From: Albert Chin-A-Young Date: Thu, 24 Nov 2005 15:31:18 +0000 (+0000) Subject: * libtool.m4, ltmain.in: When calling $LTCC, pass default $CFLAGS X-Git-Tag: release-1-5-22~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53bd7535546aba7ecc7037b67444329013cfb2e3;p=thirdparty%2Flibtool.git * libtool.m4, ltmain.in: When calling $LTCC, pass default $CFLAGS through with $LTCFLAGS. Backport from HEAD 2004-09-05. --- diff --git a/ChangeLog b/ChangeLog index ce74acc02..2fac702e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-11-24 Albert Chin-A-Young + + * libtool.m4, ltmain.in: When calling $LTCC, pass default $CFLAGS + through with $LTCFLAGS. + Backport from HEAD 2004-09-05. + 2005-11-24 David Edelsohn * ltmain.in (link mode): Use $pic_object as $non_pic_object if diff --git a/libtool.m4 b/libtool.m4 index 36e10e348..ee36d700a 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -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) diff --git a/ltmain.in b/ltmain.in index 119e83f92..dd1fc491a 100644 --- 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