]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Run the `syntax' test on acgeneral macros too.
authorAkim Demaille <akim@epita.fr>
Fri, 4 Feb 2000 12:44:56 +0000 (12:44 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 4 Feb 2000 12:44:56 +0000 (12:44 +0000)
Fix the bugs discovered.

* acgeneral.m4 (AC_CANONICAL_THING): Quote the
AC_REQUIRE([AC_CANONICAL_HOST]).  Bug triggered by the use of
AC_CANONICAL_BUILD alone in configure.in.  Also, quote the
arguments of macros (eg, ifelse([$1]...), not ifelse($1...)).
(m4_case): New macro.
(AC_LINKER_OPTION): Don't clash with user's name space
(s/i/ac_link_opt).
(AC_LIST_MEMBER_OF).  You mean AC_FATAL, not AC_MSG_ERROR.
Quote properly the argument.
dnl out the empty lines that result from m4 pure code.
Don't pollute the user name space.
Use AC_SHELL_IFELSE.
(AC_F77_NAME_MANGLING): Don't use `test -o'.  There are still
name space problems.
* tests/Makefile.am (macros.m4): Also fetch the macros from
acgeneral.m4.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4
tests/Makefile.am

index 76e413d1168e8b5abff72223ca3181d238cbce02..b56bd9513b8b54ae1ddaa173c6e3ba9f32d0cab2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+1999-11-13  Akim Demaille  <akim@epita.fr>
+
+       Run the `syntax' test on acgeneral macros too.
+       Fix the bugs discovered.
+
+       * acgeneral.m4 (AC_CANONICAL_THING): Quote the
+       AC_REQUIRE([AC_CANONICAL_HOST]).  Bug triggered by the use of
+       AC_CANONICAL_BUILD alone in configure.in.  Also, quote the
+       arguments of macros (eg, ifelse([$1]...), not ifelse($1...)).
+       (m4_case): New macro.
+       (AC_LINKER_OPTION): Don't clash with user's name space
+       (s/i/ac_link_opt).
+       (AC_LIST_MEMBER_OF).  You mean AC_FATAL, not AC_MSG_ERROR.
+       Quote properly the argument.
+       dnl out the empty lines that result from m4 pure code.
+       Don't pollute the user name space.
+       Use AC_SHELL_IFELSE.
+       (AC_F77_NAME_MANGLING): Don't use `test -o'.  There are still
+       name space problems.
+       * tests/Makefile.am (macros.m4): Also fetch the macros from
+       acgeneral.m4.
+
 1999-11-13  Akim Demaille  <akim@epita.fr>
 
        Really install this patch.
index 5448112ea29a4b1b2487664e86a1cf4beae9b2dc..797129946aa6ddc445b40ca2f298c829f261110c 100644 (file)
@@ -1742,7 +1742,7 @@ dnl -------------------------
 AC_DEFUN(AC_CANONICAL_THING,
 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 
-ifelse($1, [host], ,AC_REQUIRE([AC_CANONICAL_HOST]))dnl
+ifelse([$1], [host], , [AC_REQUIRE([AC_CANONICAL_HOST])])dnl
 AC_MSG_CHECKING([$1 system type])
 if test "x$ac_cv_$1" = "x" || (test "x$$1" != "xNONE" && test "x$$1" != "x$ac_cv_$1_alias"); then
 
@@ -1757,12 +1757,12 @@ dnl Set $1_alias.
   NONE)
     case $nonopt in
     NONE)
-ifelse($1, [host],[dnl
+ifelse([$1], [host],[dnl
       if ac_cv_$1_alias=`$ac_config_guess`; then :
       else AC_MSG_ERROR(cannot guess $1 type; you must specify one)
       fi ;;],[dnl
       ac_cv_$1_alias=$host_alias ;;
-])
+])dnl
     *) ac_cv_$1_alias=$nonopt ;;
     esac ;;
   esac
@@ -2210,11 +2210,11 @@ AC_DEFUN(AC_CHECK_MEMBER,
 AC_VAR_PUSHDEF([ac_Member], [ac_cv_member_$1])dnl
 dnl Extract the aggregate name, and the member name
 AC_VAR_IF_INDIR([$1],
-[AC_FATAL([$0: requires manifest arguments])],
-[ifelse(regexp([$1], [\.]), -1,
-        [AC_FATAL([$0: Did not see any dot in `$1'])])dnl
+[AC_FATAL([$0: requires manifest arguments])])
+ifelse(regexp([$1], [\.]), -1,
+       [AC_FATAL([$0: Did not see any dot in `$1'])])dnl
 pushdef(AC_Member_Aggregate, [patsubst([$1], [\.[^.]*])])dnl
-pushdef(AC_Member_Member,     [patsubst([$1], [.*\.])])])dnl
+pushdef(AC_Member_Member,    [patsubst([$1], [.*\.])])dnl
 AC_CACHE_CHECK([for $1], ac_Member,
 [AC_TRY_COMPILE(AC_INCLUDES_DEFAULT([$4]),
 ac_Member_Aggregate foo;
@@ -4287,22 +4287,17 @@ dnl ACTION-IF-NOT-FOUND.
 dnl
 dnl pushdef([AC_LIST_MEMBER_OF],
 AC_DEFUN(AC_LIST_MEMBER_OF,
-[
-  dnl Do some sanity checking of the arguments.
-  ifelse($1, , [AC_MSG_ERROR([$0]: 1st arg must be defined)])
-  ifelse($2, , [AC_MSG_ERROR([$0]: 2nd arg must be defined)])
-
-  exists=false
-  for i in $2; do
-      if test x"$1" = x"$i"; then
-          exists=true
-          break
-      fi
+[dnl Do some sanity checking of the arguments.
+ifelse([$1], , [AC_FATAL([$0]: missing argument 1)])dnl
+ifelse([$2], , [AC_FATAL([$0]: missing argument 2)])dnl
+
+  ac_exists=false
+  for ac_i in $2; do
+    if test x"$1" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
   done
 
-  if test x"$exists" = xtrue; then
-      ifelse($3, , :, $3)
-  else
-      ifelse($4, , :, $4)
-  fi
+  AC_SHELL_IFELSE([test x"ac_$exists" = xtrue], [$3], [$4])
 ])
index 5448112ea29a4b1b2487664e86a1cf4beae9b2dc..797129946aa6ddc445b40ca2f298c829f261110c 100644 (file)
@@ -1742,7 +1742,7 @@ dnl -------------------------
 AC_DEFUN(AC_CANONICAL_THING,
 [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 
-ifelse($1, [host], ,AC_REQUIRE([AC_CANONICAL_HOST]))dnl
+ifelse([$1], [host], , [AC_REQUIRE([AC_CANONICAL_HOST])])dnl
 AC_MSG_CHECKING([$1 system type])
 if test "x$ac_cv_$1" = "x" || (test "x$$1" != "xNONE" && test "x$$1" != "x$ac_cv_$1_alias"); then
 
@@ -1757,12 +1757,12 @@ dnl Set $1_alias.
   NONE)
     case $nonopt in
     NONE)
-ifelse($1, [host],[dnl
+ifelse([$1], [host],[dnl
       if ac_cv_$1_alias=`$ac_config_guess`; then :
       else AC_MSG_ERROR(cannot guess $1 type; you must specify one)
       fi ;;],[dnl
       ac_cv_$1_alias=$host_alias ;;
-])
+])dnl
     *) ac_cv_$1_alias=$nonopt ;;
     esac ;;
   esac
@@ -2210,11 +2210,11 @@ AC_DEFUN(AC_CHECK_MEMBER,
 AC_VAR_PUSHDEF([ac_Member], [ac_cv_member_$1])dnl
 dnl Extract the aggregate name, and the member name
 AC_VAR_IF_INDIR([$1],
-[AC_FATAL([$0: requires manifest arguments])],
-[ifelse(regexp([$1], [\.]), -1,
-        [AC_FATAL([$0: Did not see any dot in `$1'])])dnl
+[AC_FATAL([$0: requires manifest arguments])])
+ifelse(regexp([$1], [\.]), -1,
+       [AC_FATAL([$0: Did not see any dot in `$1'])])dnl
 pushdef(AC_Member_Aggregate, [patsubst([$1], [\.[^.]*])])dnl
-pushdef(AC_Member_Member,     [patsubst([$1], [.*\.])])])dnl
+pushdef(AC_Member_Member,    [patsubst([$1], [.*\.])])dnl
 AC_CACHE_CHECK([for $1], ac_Member,
 [AC_TRY_COMPILE(AC_INCLUDES_DEFAULT([$4]),
 ac_Member_Aggregate foo;
@@ -4287,22 +4287,17 @@ dnl ACTION-IF-NOT-FOUND.
 dnl
 dnl pushdef([AC_LIST_MEMBER_OF],
 AC_DEFUN(AC_LIST_MEMBER_OF,
-[
-  dnl Do some sanity checking of the arguments.
-  ifelse($1, , [AC_MSG_ERROR([$0]: 1st arg must be defined)])
-  ifelse($2, , [AC_MSG_ERROR([$0]: 2nd arg must be defined)])
-
-  exists=false
-  for i in $2; do
-      if test x"$1" = x"$i"; then
-          exists=true
-          break
-      fi
+[dnl Do some sanity checking of the arguments.
+ifelse([$1], , [AC_FATAL([$0]: missing argument 1)])dnl
+ifelse([$2], , [AC_FATAL([$0]: missing argument 2)])dnl
+
+  ac_exists=false
+  for ac_i in $2; do
+    if test x"$1" = x"$ac_i"; then
+      ac_exists=true
+      break
+    fi
   done
 
-  if test x"$exists" = xtrue; then
-      ifelse($3, , :, $3)
-  else
-      ifelse($4, , :, $4)
-  fi
+  AC_SHELL_IFELSE([test x"ac_$exists" = xtrue], [$3], [$4])
 ])
index 3b27fb4be6ec855188b52f51a31ebd0da92e1fd0..733017cbf1a5139b58c4641791bb8ba71905757b 100644 (file)
@@ -39,10 +39,9 @@ testsuite: atgeneral.m4 suite.m4 macros.m4 $(SUITE)
        mv $@-tmp $@
 
 macros.m4: $(top_srcdir)/acspecific.m4 $(srcdir)/Makefile.am
-       cat $(top_srcdir)/acspecific.m4 | \
-         sed -ne 's/^AC_DEFUN(\([^,]*\).*/\1/p' | \
+       cat $(top_srcdir)/acgeneral.m4 $(top_srcdir)/acspecific.m4 | \
+         sed -ne 's/^AC_DEFUN(\[*\([^],]*\).*/\1/p' | \
          sort >macros
-       echo >$@
        for macro in `cat macros`; do \
          echo "TEST_MACRO([$$macro])" >>$@; \
        done