libtool-patches
[Top][All Lists]
Advanced

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

Pass default $CFLAGS with using $LTCC


From: Albert Chin
Subject: Pass default $CFLAGS with using $LTCC
Date: Fri, 3 Sep 2004 13:35:03 -0500
User-agent: Mutt/1.5.6i

-- 
albert chin (address@hidden)

-- snip snip
2004-09-03  Albert Chin-A-Young  <address@hidden>

        * m4/libtool.m4, config/ltmain.in: When calling $LTCC,
        pass default $CFLAGS through with $LTCFLAGS.

Index: m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
retrieving revision 1.98
diff -u -3 -p -r1.98 libtool.m4
--- m4/libtool.m4       3 Sep 2004 01:54:37 -0000       1.98
+++ m4/libtool.m4       3 Sep 2004 18:27:43 -0000
@@ -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
Index: config/ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/config/ltmain.in,v
retrieving revision 1.14
diff -u -3 -p -r1.14 ltmain.in
--- config/ltmain.in    3 Sep 2004 13:02:33 -0000       1.14
+++ config/ltmain.in    3 Sep 2004 18:27:43 -0000
@@ -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 +4745,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 +4790,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 +6181,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




reply via email to

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