libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: compensate compiler warnings and boilerplate (branch-1-5)


From: Ralf Wildenhues
Subject: FYI: compensate compiler warnings and boilerplate (branch-1-5)
Date: Mon, 18 Apr 2005 19:07:54 +0200
User-agent: Mutt/1.4.1i

Hi Gary,

* Gary V. Vaughan wrote on Mon, Apr 11, 2005 at 05:08:06PM CEST:
> Ralf Wildenhues wrote:
> > Ah, you mean using _LT_TAGVAR without also using _LT_TAGDECL, right?
> 
> Yes, _LT_TAGVAR abstracts per language variables, _LT_TAGDECL pushes them
> through config.status.

Thanks.

>>> _LT_TAGVAR(lt_simple_*_test_code, $1)="foo;\n"
>>>
>>> Which implies:
>>>
>>> # _LT_*_BOILERPLATE([TAG])

I don't have any idea how to proceed from here:

Variable $_lt_linker_boilerplate is used from _LT_LINKER_OPTION, which
has old name AC_LIBTOOL_LINKER_OPTION.  I assume it's published
interface.  How can I adapt it to use TAG?

Set _lt_linker_boilerplate=_LT_TAGVAR(_lt_linker_boilerplate, $1) in
_LT_LINKER_BOILERPLATE?  This would be ugly as hell again.  :(

Similar issue with AC_LIBTOOL_COMPILER_OPTION.  I don't think I can
change these?


> > Anyway, the changes you want me to make make more other changes
> > necessary.  Will look into how ugly the result will end up.

FYI: I have checked in the patch below to branch-1-5.

This patch should also fix Debian bug 219490.  FWIW, I think I have seen
it reported more than the two times acknowledged in the ChangeLog entry,
but cannot find any other references ATM.  (I have also corrected my
last checkin to add proper references -- sorry for not doing that right
away.)

Regards,
Ralf

        * 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.
        Reported Josselin Mouette <address@hidden> and by Marcin Siennicki.

Index: NEWS
===================================================================
RCS file: /cvsroot/libtool/libtool/NEWS,v
retrieving revision 1.109.2.28
diff -u -r1.109.2.28 NEWS
--- NEWS        15 Apr 2005 13:38:13 -0000      1.109.2.28
+++ NEWS        18 Apr 2005 16:20:53 -0000
@@ -4,6 +4,7 @@
 * 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:
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.81
diff -u -r1.314.2.81 libtool.m4
--- libtool.m4  15 Apr 2005 14:40:09 -0000      1.314.2.81
+++ libtool.m4  18 Apr 2005 16:15:17 -0000
@@ -246,6 +246,32 @@
 ])
 
 
+# _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 @@
    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 @@
      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 @@
    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_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 @@
 # 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 @@
 # 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 @@
 # 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 @@
 # 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"}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]