From: Akim Demaille Date: Fri, 28 Jul 2000 07:36:11 +0000 (+0000) Subject: * aclang.m4 (_AC_PROG_CC_GNU, _AC_PROG_CXX_GNU, X-Git-Tag: autoconf-2.50~695 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80a7004bc384f7a055a8f97a73e360f7d116dbf4;p=thirdparty%2Fautoconf.git * aclang.m4 (_AC_PROG_CC_GNU, _AC_PROG_CXX_GNU, _AC_PROG_F77_GNU): Use ac_ext. Use ACEOF instead of EOF. (AC_LANG_CONFTEST): New macro. (_AC_PROG_CC_G, AC_PROG_CC_C_O, _AC_PROG_CXX_G, AC_PROG_F77_C_O, _AC_PROG_F77_V_OUTPUT): Use it. * acgeneral.m4 (AC_TRY_CPP, AC_EGREP_CPP, AC_COMPILE_IFELSE, AC_LINK_IFELSE, AC_RUN_IFELSE): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 423b7d95b..8d55f5c97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2000-07-28 Akim Demaille + + * aclang.m4 (_AC_PROG_CC_GNU, _AC_PROG_CXX_GNU, + _AC_PROG_F77_GNU): Use ac_ext. Use ACEOF instead of EOF. + (AC_LANG_CONFTEST): New macro. + (_AC_PROG_CC_G, AC_PROG_CC_C_O, _AC_PROG_CXX_G, AC_PROG_F77_C_O, + _AC_PROG_F77_V_OUTPUT): Use it. + * acgeneral.m4 (AC_TRY_CPP, AC_EGREP_CPP, AC_COMPILE_IFELSE, + AC_LINK_IFELSE, AC_RUN_IFELSE): Likewise. + 2000-07-24 Steven G. Johnson * aclang.m4 (AC_F77_FUNC): New macro to give the user a clean diff --git a/INSTALL b/INSTALL index cdfa1123d..ff159e274 100644 --- a/INSTALL +++ b/INSTALL @@ -13,8 +13,8 @@ file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=./config.cache' or simply `-C') that -saves the results of its tests to speed up reconfiguring. (Caching is +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) @@ -133,7 +133,7 @@ Specifying the System Type automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it cannot guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system +`--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM @@ -147,9 +147,18 @@ where SYSTEM can have one of these forms: `config.sub' isn't included in this package, then this package doesn't need to know the host type. - If you are building compiler tools for cross-compiling, you can also -use the `--target=TYPE' option to select the type of system they will -produce code for. + If you are _building_ compiler tools for cross-compiling, you can +also use the `--target=TYPE' option to select the type of system they +will produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the host +platform (i.e., that on which the generated programs will eventually be +run) with `--host=TYPE'. In this case, you should also specify the +build platform with `--build=TYPE', because, in this case, it may not +be possible to guess the build platform (it sometimes involves +compiling and running simple test programs, and this can't be done if +the compiler is a cross compiler). Sharing Defaults ================ @@ -193,7 +202,7 @@ operates. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, - traditionally `./config.cache'. FILE defaults to `/dev/null' to + traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' diff --git a/acgeneral.m4 b/acgeneral.m4 index cbc4766a7..3e575267d 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -3162,13 +3162,11 @@ popdef([AC_Lib_Name])dnl # INCLUDES are not defaulted. AC_DEFUN([AC_TRY_CPP], [AC_REQUIRE_CPP()dnl -cat >conftest.$ac_ext <conftest.$ac_ext <&AC_FD_LOG | @@ -3228,9 +3224,7 @@ rm -f conftest* # -------------------------------------------------------------------- # Try to compile PROGRAM. AC_DEFUN([AC_COMPILE_IFELSE], -[cat >conftest.$ac_ext <conftest.$ac_ext <conftest.$ac_ext </dev/null; then m4_default([$2], :) diff --git a/aclang.m4 b/aclang.m4 index ed1f02d16..e0effda33 100644 --- a/aclang.m4 +++ b/aclang.m4 @@ -168,7 +168,7 @@ define([AC_LANG(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' +ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' ac_gnu_compiler=$ac_cv_prog_gcc ]) @@ -191,7 +191,7 @@ define([AC_LANG(C++)], # 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' +ac_link='${CXX-g++} -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' ac_gnu_compiler=$ac_cv_prog_gxx ]) @@ -212,7 +212,7 @@ AU_DEFUN([AC_LANG_CPLUSPLUS], [AC_LANG(C++)]) define([AC_LANG(Fortran 77)], [ac_ext=f ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext >&AC_FD_LOG' -ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' +ac_link='${F77-f77} -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' ac_gnu_compiler=$ac_cv_prog_g77 ]) @@ -230,14 +230,26 @@ AU_DEFUN([AC_LANG_FORTRAN77], [AC_LANG(Fortran 77)]) ## 2.Producing programs. ## ## ---------------------- ## + # ---------------------- # # 2a. Generic routines. # # ---------------------- # + +# AC_LANG_CONFTEST(BODY) +# --------------------- +# Save the BODY in `conftest.$acext'. Add a trailing new line. +define([AC_LANG_CONFTEST], +[cat >conftest.$ac_ext <conftest.c <conftest.$ac_ext </dev/null 2>&1; then +ACEOF +if AC_TRY_COMMAND(${CC-cc} -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -603,8 +615,8 @@ define([_AC_PROG_CC_G], ac_save_CFLAGS=$CFLAGS CFLAGS= AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_cc_g, -[echo 'void f(){}' >conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) +if test -z "`${CC-cc} -g -c conftest.$ac_ext 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no @@ -666,21 +678,21 @@ fi set dummy $CC; ac_cc=`echo $[2] | sed 's/[[^a-zA-Z0-9_]]/_/g;s/^[[0-9]]/_/'` AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o, -[echo 'foo(){}' >conftest.c +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. -ac_try='${CC-cc} -c conftest.c -o conftest.o >&AC_FD_LOG' +ac_try='${CC-cc} -c conftest.$ac_ext -o conftest.$objext >&AC_FD_LOG' if AC_TRY_EVAL(ac_try) && - test -f conftest.o && AC_TRY_EVAL(ac_try); + test -f conftest.$objext && AC_TRY_EVAL(ac_try); then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if AC_TRY_COMMAND(cc -c conftest.c >&AC_FD_LOG); then - ac_try='cc -c conftest.c -o conftest.o >&AC_FD_LOG' + if AC_TRY_COMMAND(cc -c conftest.$ac_ext >&AC_FD_LOG); then + ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&AC_FD_LOG' if AC_TRY_EVAL(ac_try) && - test -f conftest.o && AC_TRY_EVAL(ac_try); + test -f conftest.$objext && AC_TRY_EVAL(ac_try); then # cc works too. : @@ -766,12 +778,12 @@ AC_LANG_POP define([_AC_PROG_CXX_GNU], [AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, [# The semicolon is to pacify NeXT's syntax-checking cpp. -cat >conftest.cc <conftest.$ac_ext </dev/null 2>&1; then +ACEOF +if AC_TRY_COMMAND(${CXX-g++} -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -795,8 +807,8 @@ define([_AC_PROG_CXX_G], ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS= AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_cxx_g, -[echo 'void f(){}' >conftest.cc -if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) +if test -z "`${CXX-g++} -g -c conftest.$ac_ext 2>&1`"; then ac_cv_prog_cxx_g=yes else ac_cv_prog_cxx_g=no @@ -868,12 +880,12 @@ AC_LANG_POP # do CPP pre-processing. define([_AC_PROG_F77_GNU], [AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77, -[cat >conftest.f <conftest.$ac_ext </dev/null 2>&1; then +ACEOF +if AC_TRY_COMMAND($F77 -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then ac_cv_prog_g77=yes else ac_cv_prog_g77=no @@ -932,14 +944,12 @@ AC_DEFUN([AC_PROG_F77_C_O], [AC_REQUIRE([AC_PROG_F77])dnl AC_CACHE_CHECK([whether $F77 understand -c and -o together], [ac_cv_prog_f77_c_o], -[cat >conftest.f <conftest.$ac_ext <conftest.$ac_ext <conftest.c <conftest.$ac_ext </dev/null 2>&1; then +ACEOF +if AC_TRY_COMMAND(${CC-cc} -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -603,8 +615,8 @@ define([_AC_PROG_CC_G], ac_save_CFLAGS=$CFLAGS CFLAGS= AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_cc_g, -[echo 'void f(){}' >conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) +if test -z "`${CC-cc} -g -c conftest.$ac_ext 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no @@ -666,21 +678,21 @@ fi set dummy $CC; ac_cc=`echo $[2] | sed 's/[[^a-zA-Z0-9_]]/_/g;s/^[[0-9]]/_/'` AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o, -[echo 'foo(){}' >conftest.c +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. -ac_try='${CC-cc} -c conftest.c -o conftest.o >&AC_FD_LOG' +ac_try='${CC-cc} -c conftest.$ac_ext -o conftest.$objext >&AC_FD_LOG' if AC_TRY_EVAL(ac_try) && - test -f conftest.o && AC_TRY_EVAL(ac_try); + test -f conftest.$objext && AC_TRY_EVAL(ac_try); then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if AC_TRY_COMMAND(cc -c conftest.c >&AC_FD_LOG); then - ac_try='cc -c conftest.c -o conftest.o >&AC_FD_LOG' + if AC_TRY_COMMAND(cc -c conftest.$ac_ext >&AC_FD_LOG); then + ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&AC_FD_LOG' if AC_TRY_EVAL(ac_try) && - test -f conftest.o && AC_TRY_EVAL(ac_try); + test -f conftest.$objext && AC_TRY_EVAL(ac_try); then # cc works too. : @@ -766,12 +778,12 @@ AC_LANG_POP define([_AC_PROG_CXX_GNU], [AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, [# The semicolon is to pacify NeXT's syntax-checking cpp. -cat >conftest.cc <conftest.$ac_ext </dev/null 2>&1; then +ACEOF +if AC_TRY_COMMAND(${CXX-g++} -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -795,8 +807,8 @@ define([_AC_PROG_CXX_G], ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS= AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_cxx_g, -[echo 'void f(){}' >conftest.cc -if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) +if test -z "`${CXX-g++} -g -c conftest.$ac_ext 2>&1`"; then ac_cv_prog_cxx_g=yes else ac_cv_prog_cxx_g=no @@ -868,12 +880,12 @@ AC_LANG_POP # do CPP pre-processing. define([_AC_PROG_F77_GNU], [AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77, -[cat >conftest.f <conftest.$ac_ext </dev/null 2>&1; then +ACEOF +if AC_TRY_COMMAND($F77 -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then ac_cv_prog_g77=yes else ac_cv_prog_g77=no @@ -932,14 +944,12 @@ AC_DEFUN([AC_PROG_F77_C_O], [AC_REQUIRE([AC_PROG_F77])dnl AC_CACHE_CHECK([whether $F77 understand -c and -o together], [ac_cv_prog_f77_c_o], -[cat >conftest.f <conftest.$ac_ext <conftest.$ac_ext <conftest.c <conftest.$ac_ext </dev/null 2>&1; then +ACEOF +if AC_TRY_COMMAND(${CC-cc} -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -603,8 +615,8 @@ define([_AC_PROG_CC_G], ac_save_CFLAGS=$CFLAGS CFLAGS= AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_cc_g, -[echo 'void f(){}' >conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) +if test -z "`${CC-cc} -g -c conftest.$ac_ext 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no @@ -666,21 +678,21 @@ fi set dummy $CC; ac_cc=`echo $[2] | sed 's/[[^a-zA-Z0-9_]]/_/g;s/^[[0-9]]/_/'` AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o, -[echo 'foo(){}' >conftest.c +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. -ac_try='${CC-cc} -c conftest.c -o conftest.o >&AC_FD_LOG' +ac_try='${CC-cc} -c conftest.$ac_ext -o conftest.$objext >&AC_FD_LOG' if AC_TRY_EVAL(ac_try) && - test -f conftest.o && AC_TRY_EVAL(ac_try); + test -f conftest.$objext && AC_TRY_EVAL(ac_try); then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if AC_TRY_COMMAND(cc -c conftest.c >&AC_FD_LOG); then - ac_try='cc -c conftest.c -o conftest.o >&AC_FD_LOG' + if AC_TRY_COMMAND(cc -c conftest.$ac_ext >&AC_FD_LOG); then + ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&AC_FD_LOG' if AC_TRY_EVAL(ac_try) && - test -f conftest.o && AC_TRY_EVAL(ac_try); + test -f conftest.$objext && AC_TRY_EVAL(ac_try); then # cc works too. : @@ -766,12 +778,12 @@ AC_LANG_POP define([_AC_PROG_CXX_GNU], [AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, [# The semicolon is to pacify NeXT's syntax-checking cpp. -cat >conftest.cc <conftest.$ac_ext </dev/null 2>&1; then +ACEOF +if AC_TRY_COMMAND(${CXX-g++} -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -795,8 +807,8 @@ define([_AC_PROG_CXX_G], ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS= AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_cxx_g, -[echo 'void f(){}' >conftest.cc -if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) +if test -z "`${CXX-g++} -g -c conftest.$ac_ext 2>&1`"; then ac_cv_prog_cxx_g=yes else ac_cv_prog_cxx_g=no @@ -868,12 +880,12 @@ AC_LANG_POP # do CPP pre-processing. define([_AC_PROG_F77_GNU], [AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77, -[cat >conftest.f <conftest.$ac_ext </dev/null 2>&1; then +ACEOF +if AC_TRY_COMMAND($F77 -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then ac_cv_prog_g77=yes else ac_cv_prog_g77=no @@ -932,14 +944,12 @@ AC_DEFUN([AC_PROG_F77_C_O], [AC_REQUIRE([AC_PROG_F77])dnl AC_CACHE_CHECK([whether $F77 understand -c and -o together], [ac_cv_prog_f77_c_o], -[cat >conftest.f <conftest.$ac_ext <conftest.$ac_ext <conftest.$ac_ext <&AC_FD_LOG | @@ -3228,9 +3224,7 @@ rm -f conftest* # -------------------------------------------------------------------- # Try to compile PROGRAM. AC_DEFUN([AC_COMPILE_IFELSE], -[cat >conftest.$ac_ext <conftest.$ac_ext <conftest.$ac_ext </dev/null; then m4_default([$2], :) diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4 index ed1f02d16..e0effda33 100644 --- a/lib/autoconf/lang.m4 +++ b/lib/autoconf/lang.m4 @@ -168,7 +168,7 @@ define([AC_LANG(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' +ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' ac_gnu_compiler=$ac_cv_prog_gcc ]) @@ -191,7 +191,7 @@ define([AC_LANG(C++)], # 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' +ac_link='${CXX-g++} -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' ac_gnu_compiler=$ac_cv_prog_gxx ]) @@ -212,7 +212,7 @@ AU_DEFUN([AC_LANG_CPLUSPLUS], [AC_LANG(C++)]) define([AC_LANG(Fortran 77)], [ac_ext=f ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext >&AC_FD_LOG' -ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' +ac_link='${F77-f77} -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AC_FD_LOG' ac_gnu_compiler=$ac_cv_prog_g77 ]) @@ -230,14 +230,26 @@ AU_DEFUN([AC_LANG_FORTRAN77], [AC_LANG(Fortran 77)]) ## 2.Producing programs. ## ## ---------------------- ## + # ---------------------- # # 2a. Generic routines. # # ---------------------- # + +# AC_LANG_CONFTEST(BODY) +# --------------------- +# Save the BODY in `conftest.$acext'. Add a trailing new line. +define([AC_LANG_CONFTEST], +[cat >conftest.$ac_ext <conftest.c <conftest.$ac_ext </dev/null 2>&1; then +ACEOF +if AC_TRY_COMMAND(${CC-cc} -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -603,8 +615,8 @@ define([_AC_PROG_CC_G], ac_save_CFLAGS=$CFLAGS CFLAGS= AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_cc_g, -[echo 'void f(){}' >conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) +if test -z "`${CC-cc} -g -c conftest.$ac_ext 2>&1`"; then ac_cv_prog_cc_g=yes else ac_cv_prog_cc_g=no @@ -666,21 +678,21 @@ fi set dummy $CC; ac_cc=`echo $[2] | sed 's/[[^a-zA-Z0-9_]]/_/g;s/^[[0-9]]/_/'` AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o, -[echo 'foo(){}' >conftest.c +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. -ac_try='${CC-cc} -c conftest.c -o conftest.o >&AC_FD_LOG' +ac_try='${CC-cc} -c conftest.$ac_ext -o conftest.$objext >&AC_FD_LOG' if AC_TRY_EVAL(ac_try) && - test -f conftest.o && AC_TRY_EVAL(ac_try); + test -f conftest.$objext && AC_TRY_EVAL(ac_try); then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. - if AC_TRY_COMMAND(cc -c conftest.c >&AC_FD_LOG); then - ac_try='cc -c conftest.c -o conftest.o >&AC_FD_LOG' + if AC_TRY_COMMAND(cc -c conftest.$ac_ext >&AC_FD_LOG); then + ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&AC_FD_LOG' if AC_TRY_EVAL(ac_try) && - test -f conftest.o && AC_TRY_EVAL(ac_try); + test -f conftest.$objext && AC_TRY_EVAL(ac_try); then # cc works too. : @@ -766,12 +778,12 @@ AC_LANG_POP define([_AC_PROG_CXX_GNU], [AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, [# The semicolon is to pacify NeXT's syntax-checking cpp. -cat >conftest.cc <conftest.$ac_ext </dev/null 2>&1; then +ACEOF +if AC_TRY_COMMAND(${CXX-g++} -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -795,8 +807,8 @@ define([_AC_PROG_CXX_G], ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS= AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_cxx_g, -[echo 'void f(){}' >conftest.cc -if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then +[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) +if test -z "`${CXX-g++} -g -c conftest.$ac_ext 2>&1`"; then ac_cv_prog_cxx_g=yes else ac_cv_prog_cxx_g=no @@ -868,12 +880,12 @@ AC_LANG_POP # do CPP pre-processing. define([_AC_PROG_F77_GNU], [AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77, -[cat >conftest.f <conftest.$ac_ext </dev/null 2>&1; then +ACEOF +if AC_TRY_COMMAND($F77 -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then ac_cv_prog_g77=yes else ac_cv_prog_g77=no @@ -932,14 +944,12 @@ AC_DEFUN([AC_PROG_F77_C_O], [AC_REQUIRE([AC_PROG_F77])dnl AC_CACHE_CHECK([whether $F77 understand -c and -o together], [ac_cv_prog_f77_c_o], -[cat >conftest.f <conftest.$ac_ext <