Wrap configure rules in checks for autoconf
authorAlan T. DeKok <aland@freeradius.org>
Wed, 20 Mar 2013 12:54:57 +0000 (08:54 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 20 Mar 2013 12:54:57 +0000 (08:54 -0400)
Makefile

index ac42bf9..10521e9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -131,6 +131,14 @@ src/%all.mk: src/%all.mk.in src/%configure
        @cd $(dir $<) && ./configure $(CONFIGURE_ARGS)
 endif
 
+#
+#  The GNU tools make autoconf=="missing autoconf", which then returns
+#  0, even when autoconf doesn't exist.  This check is to ensure that
+#  we run AUTOCONF only when it exists.
+#
+AUTOCONF_EXISTS := $(shell autoconf --version 2>/dev/null)
+
+ifneq "$(AUTOCONF_EXISTS)" ""
 # Configure files depend on "in" files, and on the top-level macro files
 # If there are headers, run auto-header, too.
 src/%configure: src/%configure.in acinclude.m4 aclocal.m4
@@ -149,6 +157,7 @@ configure: configure.in $(wildcard ac*.m4)
 src/include/autoconf.h.in: configure.in
        @echo AUTOHEADER $@
        @$(AUTOHEADER)
+endif
 
 reconfig: $(CONFIGURE_FILES) src/include/autoconf.h.in