diff --git a/ChangeLog b/ChangeLog index 79edc10a..1fef3804 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-07-10 Akim Demaille + + * aclang.m4 (AC_LANG(C), AC_LANG(C++), AC_LANG(Fortran 77)): Set + ac_gnu_compiler. + (_AC_PROG_CC_GNU, _AC_PROG_CXX_GNU, _AC_PROG_F77_GNU): Compute + ac_gnu_compiler. + * acgeneral.m4 (AC_LINKER_OPTION): Adjust. + 2000-07-10 Akim Demaille * aclang.m4 (AC_PROG_CC, AC_PROG_CXX, AC_PROG_F77): Move the code diff --git a/acgeneral.m4 b/acgeneral.m4 index b7cf77ab..abc35d09 100644 --- a/acgeneral.m4 +++ b/acgeneral.m4 @@ -5047,20 +5047,13 @@ fi # doesn't currently support. # FIXME: Get rid of this macro. AC_DEFUN([AC_LINKER_OPTION], -[AC_LANG_CASE([C], [test x"$GCC" = xyes && using_gnu_compiler=yes], - [C++], [test x"$GXX" = xyes && using_gnu_compiler=yes], - [FORTRAN77], [test x"$G77" = xyes && using_gnu_compiler=yes], - [using_gnu_compiler=]) - -dnl I don't understand the point of having the test inside of the -dnl loop. -for ac_link_opt in $1; do - if test x"$using_gnu_compiler" = xyes; then +[if test "ac_gnu_compiler" = yes; then + for ac_link_opt in $1; do $2="[$]$2 -Xlinker $ac_link_opt" - else - $2="[$]$2 $ac_link_opt" - fi -done]) + done +else + $2="[$]$2 $1" +fi]) # AC_LIST_MEMBER_OF(ELEMENT, LIST, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) diff --git a/aclang.m4 b/aclang.m4 index e0523295..2c8f9d08 100644 --- a/aclang.m4 +++ b/aclang.m4 @@ -112,7 +112,7 @@ define([_AC_LANG_DISPATCH], # ------------- # Set the current language to LANG. # -# Do *not* write AC_LANG([$1]), because this pair of parens do not +# Do *not* write AC_LANG([$1]), because this pair of parens does not # correspond to an evaluation, rather, they are just part of the name. # If you add quotes here, they will be part of the name too, yielding # `AC_LANG([C])' for instance, which does not exist. @@ -169,6 +169,7 @@ define([AC_LANG(C)], 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_gnu_compiler=$ac_cv_prog_gcc ]) @@ -191,6 +192,7 @@ define([AC_LANG(C++)], 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_gnu_compiler=$ac_cv_prog_gxx ]) @@ -211,6 +213,7 @@ 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_gnu_compiler=$ac_cv_prog_g77 ]) @@ -580,7 +583,8 @@ if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_gcc=no fi]) -if test $ac_cv_prog_gcc = yes; then +ac_gnu_compiler=$ac_cv_prog_gcc +if test $ac_gnu_compiler = yes; then GCC=yes else GCC= @@ -768,8 +772,8 @@ if AC_TRY_COMMAND(${CXX-g++} -E conftest.cc) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_gxx=no fi]) - -if test $ac_cv_prog_gxx = yes; then +ac_gnu_compiler=$ac_cv_prog_gxx +if test $ac_gnu_compiler = yes; then GXX=yes else GXX= @@ -869,7 +873,8 @@ if AC_TRY_COMMAND($F77 -E conftest.f) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_g77=no fi]) -if test $ac_cv_prog_g77 = yes; then +ac_gnu_compiler=$ac_cv_prog_g77 +if test $ac_gnu_compiler = yes; then G77=yes else G77= diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index e0523295..2c8f9d08 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -112,7 +112,7 @@ define([_AC_LANG_DISPATCH], # ------------- # Set the current language to LANG. # -# Do *not* write AC_LANG([$1]), because this pair of parens do not +# Do *not* write AC_LANG([$1]), because this pair of parens does not # correspond to an evaluation, rather, they are just part of the name. # If you add quotes here, they will be part of the name too, yielding # `AC_LANG([C])' for instance, which does not exist. @@ -169,6 +169,7 @@ define([AC_LANG(C)], 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_gnu_compiler=$ac_cv_prog_gcc ]) @@ -191,6 +192,7 @@ define([AC_LANG(C++)], 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_gnu_compiler=$ac_cv_prog_gxx ]) @@ -211,6 +213,7 @@ 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_gnu_compiler=$ac_cv_prog_g77 ]) @@ -580,7 +583,8 @@ if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_gcc=no fi]) -if test $ac_cv_prog_gcc = yes; then +ac_gnu_compiler=$ac_cv_prog_gcc +if test $ac_gnu_compiler = yes; then GCC=yes else GCC= @@ -768,8 +772,8 @@ if AC_TRY_COMMAND(${CXX-g++} -E conftest.cc) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_gxx=no fi]) - -if test $ac_cv_prog_gxx = yes; then +ac_gnu_compiler=$ac_cv_prog_gxx +if test $ac_gnu_compiler = yes; then GXX=yes else GXX= @@ -869,7 +873,8 @@ if AC_TRY_COMMAND($F77 -E conftest.f) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_g77=no fi]) -if test $ac_cv_prog_g77 = yes; then +ac_gnu_compiler=$ac_cv_prog_g77 +if test $ac_gnu_compiler = yes; then G77=yes else G77= diff --git a/lib/autoconf/fortran.m4 b/lib/autoconf/fortran.m4 index e0523295..2c8f9d08 100644 --- a/lib/autoconf/fortran.m4 +++ b/lib/autoconf/fortran.m4 @@ -112,7 +112,7 @@ define([_AC_LANG_DISPATCH], # ------------- # Set the current language to LANG. # -# Do *not* write AC_LANG([$1]), because this pair of parens do not +# Do *not* write AC_LANG([$1]), because this pair of parens does not # correspond to an evaluation, rather, they are just part of the name. # If you add quotes here, they will be part of the name too, yielding # `AC_LANG([C])' for instance, which does not exist. @@ -169,6 +169,7 @@ define([AC_LANG(C)], 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_gnu_compiler=$ac_cv_prog_gcc ]) @@ -191,6 +192,7 @@ define([AC_LANG(C++)], 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_gnu_compiler=$ac_cv_prog_gxx ]) @@ -211,6 +213,7 @@ 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_gnu_compiler=$ac_cv_prog_g77 ]) @@ -580,7 +583,8 @@ if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_gcc=no fi]) -if test $ac_cv_prog_gcc = yes; then +ac_gnu_compiler=$ac_cv_prog_gcc +if test $ac_gnu_compiler = yes; then GCC=yes else GCC= @@ -768,8 +772,8 @@ if AC_TRY_COMMAND(${CXX-g++} -E conftest.cc) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_gxx=no fi]) - -if test $ac_cv_prog_gxx = yes; then +ac_gnu_compiler=$ac_cv_prog_gxx +if test $ac_gnu_compiler = yes; then GXX=yes else GXX= @@ -869,7 +873,8 @@ if AC_TRY_COMMAND($F77 -E conftest.f) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_g77=no fi]) -if test $ac_cv_prog_g77 = yes; then +ac_gnu_compiler=$ac_cv_prog_g77 +if test $ac_gnu_compiler = yes; then G77=yes else G77= diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4 index b7cf77ab..abc35d09 100644 --- a/lib/autoconf/general.m4 +++ b/lib/autoconf/general.m4 @@ -5047,20 +5047,13 @@ fi # doesn't currently support. # FIXME: Get rid of this macro. AC_DEFUN([AC_LINKER_OPTION], -[AC_LANG_CASE([C], [test x"$GCC" = xyes && using_gnu_compiler=yes], - [C++], [test x"$GXX" = xyes && using_gnu_compiler=yes], - [FORTRAN77], [test x"$G77" = xyes && using_gnu_compiler=yes], - [using_gnu_compiler=]) - -dnl I don't understand the point of having the test inside of the -dnl loop. -for ac_link_opt in $1; do - if test x"$using_gnu_compiler" = xyes; then +[if test "ac_gnu_compiler" = yes; then + for ac_link_opt in $1; do $2="[$]$2 -Xlinker $ac_link_opt" - else - $2="[$]$2 $ac_link_opt" - fi -done]) + done +else + $2="[$]$2 $1" +fi]) # AC_LIST_MEMBER_OF(ELEMENT, LIST, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) diff --git a/lib/autoconf/lang.m4 b/lib/autoconf/lang.m4 index e0523295..2c8f9d08 100644 --- a/lib/autoconf/lang.m4 +++ b/lib/autoconf/lang.m4 @@ -112,7 +112,7 @@ define([_AC_LANG_DISPATCH], # ------------- # Set the current language to LANG. # -# Do *not* write AC_LANG([$1]), because this pair of parens do not +# Do *not* write AC_LANG([$1]), because this pair of parens does not # correspond to an evaluation, rather, they are just part of the name. # If you add quotes here, they will be part of the name too, yielding # `AC_LANG([C])' for instance, which does not exist. @@ -169,6 +169,7 @@ define([AC_LANG(C)], 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_gnu_compiler=$ac_cv_prog_gcc ]) @@ -191,6 +192,7 @@ define([AC_LANG(C++)], 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_gnu_compiler=$ac_cv_prog_gxx ]) @@ -211,6 +213,7 @@ 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_gnu_compiler=$ac_cv_prog_g77 ]) @@ -580,7 +583,8 @@ if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_gcc=no fi]) -if test $ac_cv_prog_gcc = yes; then +ac_gnu_compiler=$ac_cv_prog_gcc +if test $ac_gnu_compiler = yes; then GCC=yes else GCC= @@ -768,8 +772,8 @@ if AC_TRY_COMMAND(${CXX-g++} -E conftest.cc) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_gxx=no fi]) - -if test $ac_cv_prog_gxx = yes; then +ac_gnu_compiler=$ac_cv_prog_gxx +if test $ac_gnu_compiler = yes; then GXX=yes else GXX= @@ -869,7 +873,8 @@ if AC_TRY_COMMAND($F77 -E conftest.f) | egrep yes >/dev/null 2>&1; then else ac_cv_prog_g77=no fi]) -if test $ac_cv_prog_g77 = yes; then +ac_gnu_compiler=$ac_cv_prog_g77 +if test $ac_gnu_compiler = yes; then G77=yes else G77=