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.
This commit is contained in:
Akim Demaille 2000-02-04 12:44:56 +00:00
parent 682572c9b1
commit 4f7835e642
4 changed files with 58 additions and 47 deletions

View File

@ -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.

View 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)])
[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
exists=false
for i in $2; do
if test x"$1" = x"$i"; then
exists=true
break
fi
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])
])

View 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)])
[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
exists=false
for i in $2; do
if test x"$1" = x"$i"; then
exists=true
break
fi
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])
])

View 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