From: Akim Demaille Date: Fri, 4 Feb 2000 12:44:56 +0000 (+0000) Subject: Run the `syntax' test on acgeneral macros too. X-Git-Tag: autoconf-2.50~1251 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f7835e642003b544df66de94adadfb81e1bbcdf;p=thirdparty%2Fautoconf.git 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. --- diff --git a/ChangeLog b/ChangeLog index 76e413d11..b56bd9513 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +1999-11-13 Akim Demaille + + 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 Really install this patch. diff --git a/acgeneral.m4 b/acgeneral.m4 index 5448112ea..797129946 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -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]) ]) diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index 5448112ea..797129946 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -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]) ]) diff --git a/tests/Makefile.am b/tests/Makefile.am index 3b27fb4be..733017cbf 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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