From 252e10c02385029e081c3196d0ba34d3ee74bcf0 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Mon, 18 Apr 2005 17:07:46 +0000 Subject: [PATCH] * libtool.m4 (_LT_COMPILER_BOILERPLATE, _LT_LINKER_BOILERPLATE): New macros: save warnings and boilerplate of simple compile/link tests. (AC_LIBTOOL_LANG_C_CONFIG, AC_LIBTOOL_LANG_CXX_CONFIG, AC_LIBTOOL_LANG_F77_CONFIG, AC_LIBTOOL_LANG_GCJ_CONFIG, AC_LIBTOOL_LANG_RC_CONFIG): Call. (AC_LIBTOOL_COMPILER_OPTION, AC_LIBTOOL_LINKER_OPTION, AC_LIBTOOL_PROG_CC_C_O): Fail only if nonempty warnings different from default compile/link. * NEWS: Update. --- ChangeLog | 12 +++++++++++ NEWS | 1 + libtool.m4 | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 71 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45b011dd0..15e92653a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,20 @@ +2005-04-18 Ralf Wildenhues + + * libtool.m4 (_LT_COMPILER_BOILERPLATE, _LT_LINKER_BOILERPLATE): + New macros: save warnings and boilerplate of simple compile/link tests. + (AC_LIBTOOL_LANG_C_CONFIG, AC_LIBTOOL_LANG_CXX_CONFIG, + AC_LIBTOOL_LANG_F77_CONFIG, AC_LIBTOOL_LANG_GCJ_CONFIG, + AC_LIBTOOL_LANG_RC_CONFIG): Call. + (AC_LIBTOOL_COMPILER_OPTION, AC_LIBTOOL_LINKER_OPTION, AC_LIBTOOL_PROG_CC_C_O): + Fail only if nonempty warnings different from default compile/link. + * NEWS: Update. + 2005-04-17 Ralf Wildenhues * tests/hardcode.test [solaris]: Use dumpstabs if available, to avoid false failure caused by debug section which contains command line (Solaris cc). + Reported by Ralf Menzel . 2005-04-17 Ralf Wildenhues (tiny change) diff --git a/NEWS b/NEWS index 52cab4008..d3d3e993c 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ New in 1.5.15a: 2005-??-??; CVS version 1.5.15a, Libtool team: * Allow shell special characters like `$' in source file names, but not in object names, to enhance GCJ support. * Detection of compiler wrappers like distcc/ccache and $host_alias prefix. +* More robust tests for PIC flag, `-c -o', in presence of warnings. * Bug Fixes. New in 1.5.14: 2005-02-12; CVS version 1.5.13a, Libtool team: diff --git a/libtool.m4 b/libtool.m4 index f238e4ab7..4eee72b55 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -246,6 +246,32 @@ cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_LINKER_BOILERPLATE + + # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable @@ -587,8 +613,10 @@ AC_CACHE_CHECK([$1], [$2], echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test ! -s conftest.err; then + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi @@ -619,6 +647,11 @@ AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp + $SED '/^$/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi else $2=yes fi @@ -974,7 +1007,9 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings - if test ! -s out/conftest.err; then + $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp + $SED '/^$/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi @@ -2526,6 +2561,10 @@ lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + # # Check for any special shared library compilation flags. # @@ -2662,6 +2701,10 @@ lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD @@ -3743,6 +3786,10 @@ lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} @@ -3823,6 +3870,10 @@ lt_simple_link_test_code='public class conftest { public static void main(String # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} @@ -3881,6 +3932,10 @@ lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} -- 2.47.3