summaryrefslogtreecommitdiffstats
path: root/m4/rtems-trim-builddir.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/rtems-trim-builddir.m4')
-rw-r--r--m4/rtems-trim-builddir.m426
1 files changed, 26 insertions, 0 deletions
diff --git a/m4/rtems-trim-builddir.m4 b/m4/rtems-trim-builddir.m4
new file mode 100644
index 0000000..ffd94d6
--- /dev/null
+++ b/m4/rtems-trim-builddir.m4
@@ -0,0 +1,26 @@
+# Takes one argument
+#
+# TILLAC_RTEMS_TRIM_CONFIG_DIR(dirvar)
+#
+# If 'srcdir' is a absolute path (a string
+# starting with '/' then set 'dirvar' to the
+# empty string; otherwise (srcdir is a relative path)
+# set 'dirvar' to '../'.
+#
+# This macro can be used to find 'srcdir' should
+# configure decide to step into a subdirectory inside
+# a build tree.
+#
+AC_DEFUN([TILLAC_RTEMS_TRIM_CONFIG_DIR],
+ [AC_MSG_NOTICE([Trimming source directory])
+ # leave absolute path alone, relative path needs
+ # to step one level up
+ case $srcdir in
+ /* )
+ $1=
+ ;;
+ *)
+ $1=../
+ ;;
+ esac]dnl
+)