From: Akim Demaille Date: Mon, 7 Aug 2000 12:33:17 +0000 (+0000) Subject: * acfunctions.m4 (_AC_LIBOBJ_ALLOCA, AC_REPLACE_FUNCS): Simplify X-Git-Tag: autoconf-2.50~663 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55d7dff046b2448e12b54ea3d5c11569320d8ca9;p=thirdparty%2Fautoconf.git * acfunctions.m4 (_AC_LIBOBJ_ALLOCA, AC_REPLACE_FUNCS): Simplify ${foo} into $foo. * aclang.m4 (AC_LANG(C), AC_LANG(C++)): Move some internal comments into the header comment. * acgeneral.m4 (AC_TRY_CPP): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 30b3d79b1..885d01d5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-08-07 Akim Demaille + + * acfunctions.m4 (_AC_LIBOBJ_ALLOCA, AC_REPLACE_FUNCS): Simplify + ${foo} into $foo. + * aclang.m4 (AC_LANG(C), AC_LANG(C++)): Move some internal + comments into the header comment. + * acgeneral.m4 (AC_TRY_CPP): Likewise. + 2000-08-07 Akim Demaille * tests/tools.m4 (undefined macros): New test. diff --git a/acfunctions.m4 b/acfunctions.m4 index 7b7b93299..a67a1b338 100644 --- a/acfunctions.m4 +++ b/acfunctions.m4 @@ -94,7 +94,7 @@ done # ----------------------------- AC_DEFUN([AC_REPLACE_FUNCS], [AC_FOREACH([AC_Func], [$1], [AC_LIBOBJ_DECL(AC_Func)])dnl -AC_CHECK_FUNCS([$1], , [_AC_LIBOBJ(${ac_func})]) +AC_CHECK_FUNCS([$1], , [_AC_LIBOBJ($ac_func)]) ]) @@ -137,7 +137,7 @@ define([_AC_LIBOBJ_ALLOCA], # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. AC_LIBOBJ_DECL(alloca) -AC_SUBST(ALLOCA, alloca.${ac_objext})dnl +AC_SUBST(ALLOCA, alloca.$ac_objext)dnl AC_DEFINE(C_ALLOCA, 1, [Define if using `alloca.c'.]) AC_CACHE_CHECK(whether `alloca.c' needs Cray hooks, ac_cv_os_cray, diff --git a/acgeneral.m4 b/acgeneral.m4 index ae63f2dcf..b703d65ee 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -3238,17 +3238,18 @@ popdef([AC_Lib_Name])dnl # AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------- -# INCLUDES are not defaulted. -AC_DEFUN([AC_TRY_CPP], -[AC_REQUIRE_CPP()dnl -AC_LANG_CONFTEST([AC_LANG_SOURCE([[$1]])]) # Capture the stderr of cpp. eval is necessary to expand ac_cpp. We # used to copy stderr to stdout and capture it in a variable, but that # breaks under sh -x, which writes compile commands starting with ` +' # to stderr in eval and subshells. +# +# INCLUDES are not defaulted. +AC_DEFUN([AC_TRY_CPP], +[AC_REQUIRE_CPP()dnl +AC_LANG_CONFTEST([AC_LANG_SOURCE([[$1]])]) ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" AC_TRY_EVAL(ac_try) -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.$ac_ext\$"` if test -z "$ac_err"; then m4_default([$2], :) else @@ -3380,7 +3381,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [$4], [$5]) AC_DEFUN([AC_RUN_IFELSE], [m4_ifvanl([$1], [AC_LANG_CONFTEST([$1])])dnl if AC_TRY_EVAL(ac_link) && - test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null; then + test -s conftest$ac_exeext && (./conftest; exit) 2>/dev/null; then m4_default([$2], :) else echo "configure: failed program was:" >&AC_FD_LOG diff --git a/aclang.m4 b/aclang.m4 index 980f628d2..6435eefe6 100644 --- a/aclang.m4 +++ b/aclang.m4 @@ -163,9 +163,9 @@ AU_DEFUN([AC_LANG_RESTORE], [AC_LANG_POP($@)]) # AC_LANG(C) # ---------- +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. define([AC_LANG(C)], [ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG' ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' @@ -186,9 +186,9 @@ AU_DEFUN([AC_LANG_C], [AC_LANG(C)]) # AC_LANG(C++) # ------------ +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. define([AC_LANG(C++)], [ac_ext=cc -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG' ac_link='${CXX-g++} -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 980f628d2..6435eefe6 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -163,9 +163,9 @@ AU_DEFUN([AC_LANG_RESTORE], [AC_LANG_POP($@)]) # AC_LANG(C) # ---------- +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. define([AC_LANG(C)], [ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG' ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' @@ -186,9 +186,9 @@ AU_DEFUN([AC_LANG_C], [AC_LANG(C)]) # AC_LANG(C++) # ------------ +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. define([AC_LANG(C++)], [ac_ext=cc -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG' ac_link='${CXX-g++} -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index 980f628d2..6435eefe6 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -163,9 +163,9 @@ AU_DEFUN([AC_LANG_RESTORE], [AC_LANG_POP($@)]) # AC_LANG(C) # ---------- +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. define([AC_LANG(C)], [ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG' ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' @@ -186,9 +186,9 @@ AU_DEFUN([AC_LANG_C], [AC_LANG(C)]) # AC_LANG(C++) # ------------ +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. define([AC_LANG(C++)], [ac_ext=cc -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG' ac_link='${CXX-g++} -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4 index 7b7b93299..a67a1b338 100644 --- a/lib/autoconf/functions.m4 +++ b/lib/autoconf/functions.m4 @@ -94,7 +94,7 @@ done # ----------------------------- AC_DEFUN([AC_REPLACE_FUNCS], [AC_FOREACH([AC_Func], [$1], [AC_LIBOBJ_DECL(AC_Func)])dnl -AC_CHECK_FUNCS([$1], , [_AC_LIBOBJ(${ac_func})]) +AC_CHECK_FUNCS([$1], , [_AC_LIBOBJ($ac_func)]) ]) @@ -137,7 +137,7 @@ define([_AC_LIBOBJ_ALLOCA], # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. AC_LIBOBJ_DECL(alloca) -AC_SUBST(ALLOCA, alloca.${ac_objext})dnl +AC_SUBST(ALLOCA, alloca.$ac_objext)dnl AC_DEFINE(C_ALLOCA, 1, [Define if using `alloca.c'.]) AC_CACHE_CHECK(whether `alloca.c' needs Cray hooks, ac_cv_os_cray, diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index ae63f2dcf..b703d65ee 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -3238,17 +3238,18 @@ popdef([AC_Lib_Name])dnl # AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------- -# INCLUDES are not defaulted. -AC_DEFUN([AC_TRY_CPP], -[AC_REQUIRE_CPP()dnl -AC_LANG_CONFTEST([AC_LANG_SOURCE([[$1]])]) # Capture the stderr of cpp. eval is necessary to expand ac_cpp. We # used to copy stderr to stdout and capture it in a variable, but that # breaks under sh -x, which writes compile commands starting with ` +' # to stderr in eval and subshells. +# +# INCLUDES are not defaulted. +AC_DEFUN([AC_TRY_CPP], +[AC_REQUIRE_CPP()dnl +AC_LANG_CONFTEST([AC_LANG_SOURCE([[$1]])]) ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" AC_TRY_EVAL(ac_try) -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.$ac_ext\$"` if test -z "$ac_err"; then m4_default([$2], :) else @@ -3380,7 +3381,7 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [$4], [$5]) AC_DEFUN([AC_RUN_IFELSE], [m4_ifvanl([$1], [AC_LANG_CONFTEST([$1])])dnl if AC_TRY_EVAL(ac_link) && - test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null; then + test -s conftest$ac_exeext && (./conftest; exit) 2>/dev/null; then m4_default([$2], :) else echo "configure: failed program was:" >&AC_FD_LOG diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4 index 980f628d2..6435eefe6 100644 --- a/lib/autoconf/lang.m4 +++ b/lib/autoconf/lang.m4 @@ -163,9 +163,9 @@ AU_DEFUN([AC_LANG_RESTORE], [AC_LANG_POP($@)]) # AC_LANG(C) # ---------- +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. define([AC_LANG(C)], [ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG' ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' @@ -186,9 +186,9 @@ AU_DEFUN([AC_LANG_C], [AC_LANG(C)]) # AC_LANG(C++) # ------------ +# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. define([AC_LANG(C++)], [ac_ext=cc -# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&AC_FD_LOG' ac_link='${CXX-g++} -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG'