]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4, ltmain.in: When calling $LTCC, pass default $CFLAGS
authorAlbert Chin-A-Young <china@thewrittenword.com>
Thu, 24 Nov 2005 15:31:18 +0000 (15:31 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Thu, 24 Nov 2005 15:31:18 +0000 (15:31 +0000)
through with $LTCFLAGS.
Backport from HEAD 2004-09-05.

ChangeLog
libtool.m4
ltmain.in

index ce74acc02aa674943da377ba53bd0763ca2cbda4..2fac702e9ec1689e1b0a534cf0032adda515de72 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-11-24  Albert Chin-A-Young  <china@thewrittenword.com>
+
+       * libtool.m4, ltmain.in: When calling $LTCC, pass default $CFLAGS
+       through with $LTCFLAGS.
+       Backport from HEAD 2004-09-05.
+
 2005-11-24  David Edelsohn  <dje@watson.ibm.com>
 
        * ltmain.in (link mode): Use $pic_object as $non_pic_object if
index 36e10e348e449855785db423e43e2a5b05c15baf..ee36d700ade087ce98d01f53e40405d5420260e3 100644 (file)
@@ -157,6 +157,7 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
 test -z "$AS" && AS=as
 test -z "$CC" && CC=cc
 test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
 test -z "$DLLTOOL" && DLLTOOL=dlltool
 test -z "$LD" && LD=ld
 test -z "$LN_S" && LN_S="ln -s"
@@ -227,6 +228,9 @@ AC_DEFUN([_LT_AC_SYS_COMPILER],
 # 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_AC_SYS_COMPILER
@@ -1798,6 +1802,9 @@ if test -f "$ltmain" && test -n "$tagnames"; then
       AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
     fi
   fi
+  if test -z "$LTCFLAGS"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+  fi
 
   # Extract list of available tagged configurations in $ofile.
   # Note that this assumes the entire list is on one line.
@@ -4101,7 +4108,7 @@ if test -f "$ltmain"; then
   # Now quote all the things that may contain metacharacters while being
   # careful not to overquote the AC_SUBSTed values.  We take copies of the
   # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
     SED SHELL STRIP \
     libname_spec library_names_spec soname_spec extract_expsyms_cmds \
     old_striplib striplib file_magic_cmd finish_cmds finish_eval \
@@ -4270,6 +4277,9 @@ AR_FLAGS=$lt_AR_FLAGS
 # A C compiler.
 LTCC=$lt_LTCC
 
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
 # A language-specific compiler.
 CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
 
index 119e83f92b4d20f9f48e976d75b644286f76fdc7..dd1fc491a9458b874ca6f16ec5f3c1307fd9e53c 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -3447,7 +3447,7 @@ EOF
          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
@@ -3492,7 +3492,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`
@@ -4923,16 +4923,16 @@ lt_fatal (const char *message, ...)
   va_end (ap);
 }
 EOF
-         # we should really use a build-platform specific compiler
-         # here, but OTOH, the wrappers (shell script and this C one)
-         # 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
-         ;;
-       esac
-       $rm $output
-       trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+          # we should really use a build-platform specific compiler
+          # here, but OTOH, the wrappers (shell script and this C one)
+          # 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 $LTCFLAGS -s -o $cwrapper $cwrappersource
+          ;;
+        esac
+        $rm $output
+        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
 
        $echo > $output "\
 #! $SHELL