From 372d58a4e3d735a269856d1f285b5ed1b99f6dce Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 25 Jul 2012 10:28:38 -0700 Subject: [PATCH] configure: Fix check for GNU make $(if) extension. 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 Signed-off-by: Ben Pfaff --- acinclude.m4 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index b5876a88..8bd4544b 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])]) -- 2.30.2