As it turns out, the argument to AC_CONFIG_COMMANDS_PRE gets copied into
config.status whether or not it gets run by the shell at "configure" time,
defeating my attempt to support non-GNU make here.

Reported-by: Ed Maste <ema...@freebsd.org>
Signed-off-by: Ben Pfaff <b...@nicira.com>
---
 acinclude.m4 |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index b5876a8..8bd4544 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -405,7 +405,7 @@ dnl OVS_MAKE_HAS_IF([if-true], [if-false])
 dnl
 dnl Checks whether make has the GNU make $(if condition,then,else) extension.
 dnl Runs 'if-true' if so, 'if-false' otherwise.
-AC_DEFUN([OVS_MAKE_HAS_IF],
+AC_DEFUN([OVS_CHECK_MAKE_IF],
   [AC_CACHE_CHECK(
      [whether ${MAKE-make} has GNU make \$(if) extension],
      [ovs_cv_gnu_make_if],
@@ -425,8 +425,7 @@ EOF
         ovs_cv_gnu_make_if=yes
       else
         ovs_cv_gnu_make_if=no
-      fi])
-   AS_IF([test $ovs_cv_gnu_make_if = yes], [$1], [$2])])
+      fi])])
 
 dnl OVS_CHECK_SPARSE_TARGET
 dnl
@@ -450,8 +449,10 @@ AC_DEFUN([OVS_CHECK_SPARSE_TARGET],
 dnl OVS_ENABLE_SPARSE
 AC_DEFUN([OVS_ENABLE_SPARSE],
   [AC_REQUIRE([OVS_CHECK_SPARSE_TARGET])
-   OVS_MAKE_HAS_IF(
-     [AC_CONFIG_COMMANDS_PRE(
-        [: ${SPARSE=sparse}
-         AC_SUBST([SPARSE])
-         CC='$(if $(C),REAL_CC="'"$CC"'" CHECK="$(SPARSE) -I 
$(top_srcdir)/include/sparse $(SPARSEFLAGS)" cgcc $(CGCCFLAGS),'"$CC"')'])])])
+   AC_REQUIRE([OVS_CHECK_MAKE_IF])
+   : ${SPARSE=sparse}
+   AC_SUBST([SPARSE])
+   AC_CONFIG_COMMANDS_PRE(
+     [if test $ovs_cv_gnu_make_if = yes; then
+        CC='$(if $(C),REAL_CC="'"$CC"'" CHECK="$(SPARSE) -I 
$(top_srcdir)/include/sparse $(SPARSEFLAGS)" cgcc $(CGCCFLAGS),'"$CC"')'
+      fi])])
-- 
1.7.2.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to