]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* m4/libtool.m4, config/ltmain.in: When calling $LTCC,
authorAlbert Chin-A-Young <china@thewrittenword.com>
Sun, 5 Sep 2004 17:35:16 +0000 (17:35 +0000)
committerGary V. Vaughan <gary@gnu.org>
Sun, 5 Sep 2004 17:35:16 +0000 (17:35 +0000)
pass default $CFLAGS through with $LTCFLAGS.

ChangeLog
NEWS
config/ltmain.in
m4/libtool.m4

index 791fdacb1c40236e6596ce2361b2c191f2477e54..a3e732a274f68658c9407b42f1283fb4175e040b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-05  Albert Chin-A-Young  <china@thewrittenword.com>
+
+       * m4/libtool.m4, config/ltmain.in: When calling $LTCC,
+       pass default $CFLAGS through with $LTCFLAGS.
+
 2004-09-03  David Edelsohn  <dje@watson.ibm.com>
 
        * config/ltmain.in (func_mode_link): Use $pic_object as
diff --git a/NEWS b/NEWS
index f92ff5d4ca3bc8434727da24758e9c2dd814be86..a462dbdbdb3e7aa68869b7e4253bf934902710b6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ New in 1.9d: 2004-??-??; CVS version 1.9c, Libtool team:
 * If non-pic objects were not compiled, and libtool is called in link mode,
   libtool no longer silently creates an empty archive, but rather falls
   back to pic objects.
+* When compiling C glue code with $LTCC, libtool now saves the setting of
+  $compiler_flags from the C tag, and passes those flags to $LTCC.
 * libtool uses automake's $(mkdir_p), and can support `make -j' on
   multi-processor hosts if automake discovered a multithreadable mkdir.  If
   it still doesn't work for you, install GNU mkdir (in GNU coreutils).
index e22f0d2b0d86e199e0bf5579368674c9135a349c..b77a9446f649e6d0413350f4de9f0f3e57ee3c41 100644 (file)
@@ -60,6 +60,7 @@
 #       host-triplet:  @host_triplet@
 #       shell:         $SHELL
 #       compiler:              $LTCC
+#       compiler flags:                $LTCFLAGS
 #       linker:                $LD (gnu? $with_gnu_ld)
 #       $progname:             (GNU @PACKAGE@@TIMESTAMP@) @VERSION@
 #       automake:              $automake_version
@@ -300,6 +301,7 @@ func_help ()
        s:\$progname:'$progname':;
        s:\$SHELL:'"$SHELL"':;
        s:\$LTCC:'"$LTCC"':;
+       s:\$LTCFLAGS:'"$LTCFLAGS"':;
        s:\$LD:'"$LD"':;
        s/\$with_gnu_ld/'"$with_gnu_ld"'/;
        s/\$automake_version/'"`automake --version 2>/dev/null |$SED 1q`"'/;
@@ -1044,8 +1046,8 @@ static const void *lt_preloaded_setup() {
        esac
 
        # Now compile the dynamic symbol file.
-       $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$my_dlsyms\")"
-       $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' || exit $?
+       $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$my_dlsyms\")"
+       $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' || exit $?
 
        # Clean up the generated files.
        $show "$RM $output_objdir/$my_dlsyms $nlist ${nlist}S ${nlist}T"
@@ -4708,7 +4710,7 @@ func_mode_link ()
          int main() { return 0; }
 EOF
          $RM conftest
-         $LTCC -o conftest conftest.c $deplibs
+         $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
          if test "$?" -eq 0 ; then
            ldd_output=`ldd conftest`
            for i in $deplibs; do
@@ -4753,7 +4755,7 @@ EOF
              # If $name is empty we are operating on a -L argument.
              if test "$name" != "" && test "$name" != "0"; then
                $RM conftest
-               $LTCC -o conftest conftest.c $i
+               $LTCC $LTCFLAGS -o conftest conftest.c $i
                # Did it work?
                if test "$?" -eq 0 ; then
                  ldd_output=`ldd conftest`
@@ -6144,7 +6146,7 @@ EOF
          # are only useful if you want to execute the "real" binary.
          # Since the "real" binary is built for $host, then this
          # wrapper might as well be built for $host, too.
-         $run $LTCC -s -o $cwrapper $cwrappersource
+         $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
          ;;
        esac
        $RM $output
index 24ca7911b1d8335a38d81cda22411236988e5cc7..b26360e52f71236f9398c56f9f30ff84f124cc9c 100644 (file)
@@ -170,6 +170,7 @@ old_CFLAGS="$CFLAGS"
 # Set sane defaults for various variables
 test -z "$CC" && CC=cc
 test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
 test -z "$LD" && LD=ld
 test -z "$ac_objext" && ac_objext=o
 
@@ -435,6 +436,7 @@ double_quote_subst='$double_quote_subst'
 delay_variable_subst='$delay_variable_subst'
 _LT_CONFIG_STATUS_DECLARATIONS
 LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
 compiler='$compiler_DEFAULT'
 
 # Quote evaled strings.
@@ -628,12 +630,16 @@ m4_defun([_LT_TAG_COMPILER],
 [AC_REQUIRE([AC_PROG_CC])dnl
 
 _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
 _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
 _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU C compiler?])dnl
 
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
 # Allow CC to be a program name with arguments.
 compiler=$CC
 ])# _LT_TAG_COMPILER