]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4 (_LT_COMPILER_BOILERPLATE, _LT_LINKER_BOILERPLATE):
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 18 Apr 2005 17:07:46 +0000 (17:07 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 18 Apr 2005 17:07:46 +0000 (17:07 +0000)
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
NEWS
libtool.m4

index 45b011dd0c95b83496d6255c9f3696f9692886bc..15e92653adf8a51b5878c087e0d4941e2d9aa114 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,20 @@
+2005-04-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * 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  <Ralf.Wildenhues@gmx.de>
 
        * 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 <menzel@ls6.cs.uni-dortmund.de>.
 
 2005-04-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>  (tiny change)
 
diff --git a/NEWS b/NEWS
index 52cab4008c5316a061f76c1ea50ef1226c09c264..d3d3e993c13411808542ba338af7e64e2da32948 100644 (file)
--- 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.
 \f
 New in 1.5.14: 2005-02-12; CVS version 1.5.13a, Libtool team:
index f238e4ab704b699f3789cecb4a343344479ec4c5..4eee72b5563a27cfdb8be970866c3a9bf6289798 100644 (file)
@@ -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"}