summaryrefslogtreecommitdiffstats
path: root/m4/config-if-present.m4
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-02-19 19:55:40 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-02-19 19:55:40 +0000
commit89376b7141edb6f927fb940c27391cda6e67c785 (patch)
tree57dd01fd9328b879289493ba848ae5c34c607b91 /m4/config-if-present.m4
downloadlibbsdport-89376b7141edb6f927fb940c27391cda6e67c785.tar.bz2
Initial import.initial
Diffstat (limited to 'm4/config-if-present.m4')
-rw-r--r--m4/config-if-present.m423
1 files changed, 23 insertions, 0 deletions
diff --git a/m4/config-if-present.m4 b/m4/config-if-present.m4
new file mode 100644
index 0000000..ed402ff
--- /dev/null
+++ b/m4/config-if-present.m4
@@ -0,0 +1,23 @@
+dnl while we can get autoconf to properly handle nonexisting
+dnl directories (e.g., because a sub-package only requires and
+dnl distributes a subset of the directories under ssrlApps)
+dnl via
+dnl if [ -d somedir ] ; then AC_CONFIG_FILES([somedir/Makefile]) ; fi
+dnl this doesn't work for automake -- automake doesn't understand
+dnl the shell commands.
+dnl
+dnl The 'TILLAC_M4_IF_PRESENT' macro tests at 'autoconf/automake'-time
+dnl if the argument file with '.am' appended exists and expands
+dnl $2 if it does. Otherwise, $2 is suppressed.
+dnl
+dnl USAGE:
+dnl
+dnl TILLAC_M4_IR_PRESENT(
+dnl [mysubdir/Makefile],
+dnl [<configure commands to configure 'mysubdir'
+dnl including AC_CONFIG_FILES([mysubdir/Makefile])])
+dnl
+AC_DEFUN([TILLAC_M4_IF_PRESENT],
+[m4_syscmd([test -d $1])
+m4_if(0,m4_sysval,[$2])]dnl
+)