]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in: In compile mode, delay parsing of -shared, -static,
authorScott James Remnant <scott@netsplit.com>
Mon, 17 Nov 2003 11:19:07 +0000 (11:19 +0000)
committerScott James Remnant <scott@netsplit.com>
Mon, 17 Nov 2003 11:19:07 +0000 (11:19 +0000)
-prefer-pic and -prefer-non-pic until after tagged configuration
has been read.  In link mode, read tagged configuration before
parsing any arguments.  These arguments will now work when using
a non-C compiler.

ChangeLog
ltmain.in

index ce3286d7b799c2abbfd2105af0b038bb76456b0f..a12622018b04a1c9e08cce2cc8d5b1ef486e1208 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-11-15  Scott James Remnant  <scott@netsplit.com>
+
+       * ltmain.in: In compile mode, delay parsing of -shared, -static,
+       -prefer-pic and -prefer-non-pic until after tagged configuration
+       has been read.  In link mode, read tagged configuration before
+       parsing any arguments.  These arguments will now work when using
+       a non-C compiler.
+
 2003-11-14  Gary V. Vaughan  <gary@gnu.org>
 
        * NEWS: Mention AC_LIBTOOL_TAGS.
index 3bce91ef4b529f5441826be063a69233f7f55b8e..0ee019571c2ac310c89d3cf8b6259c693a9e3d3c 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -365,6 +365,7 @@ exec_cmd=
     suppress_output=
     arg_mode=normal
     libobj=
+    later=
 
     for arg
     do
@@ -393,29 +394,8 @@ exec_cmd=
          continue
          ;;
 
-       -shared)
-         if test "$build_libtool_libs" != yes; then
-           $echo "$modename: can not build a shared library" 1>&2
-           $echo "Fatal configuration error." 1>&2
-           exit 1
-         fi
-         build_old_libs=no
-         continue
-         ;;
-
-       -static)
-         build_libtool_libs=no
-         build_old_libs=yes
-         continue
-         ;;
-
-       -prefer-pic)
-         pic_mode=yes
-         continue
-         ;;
-
-       -prefer-non-pic)
-         pic_mode=no
+       -shared | -static | -prefer-pic | -prefer-non-pic)
+         later="$later $arg"
          continue
          ;;
 
@@ -565,6 +545,36 @@ exec_cmd=
       esac
     fi
 
+    for arg in $later; do
+      case $arg in
+      -shared)
+       if test "$build_libtool_libs" != yes; then
+         $echo "$modename: can not build a shared library" 1>&2
+         $echo "Fatal configuration error." 1>&2
+         exit 1
+       fi
+       build_old_libs=no
+       continue
+       ;;
+
+      -static)
+       build_libtool_libs=no
+       build_old_libs=yes
+       continue
+       ;;
+
+      -prefer-pic)
+       pic_mode=yes
+       continue
+       ;;
+
+      -prefer-non-pic)
+       pic_mode=no
+       continue
+       ;;
+      esac
+    done
+
     objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
     xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
     if test "X$xdir" = "X$obj"; then
@@ -891,6 +901,47 @@ EOF
     vinfo=
     vinfo_number=no
 
+    # Infer tagged configuration to use if any are available and
+    # if one wasn't chosen via the "--tag" command line option.
+    # Only attempt this if the compiler in the base link
+    # command doesn't match the default compiler.
+    if test -n "$available_tags" && test -z "$tagname"; then
+      case "$base_compile " in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+       for z in $available_tags; do
+         if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+           # Evaluate the configuration.
+           eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+           case "$base_compile " in
+           "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+             # The compiler in $compile_command matches
+             # the one in the tagged configuration.
+             # Assume this is the tagged configuration we want.
+             tagname=$z
+             break
+             ;;
+           esac
+         fi
+       done
+       # If $tagname still isn't set, then no tagged configuration
+       # was found and let the user know that the "--tag" command
+       # line option must be used.
+       if test -z "$tagname"; then
+         $echo "$modename: unable to infer tagged configuration"
+         $echo "$modename: specify a tag with \`--tag'" 1>&2
+         exit 1
+#       else
+#         $echo "$modename: using $tagname tagged configuration"
+       fi
+       ;;
+      esac
+    fi
+
     # We need to know -static, to get the right output filenames.
     for arg
     do
@@ -1667,47 +1718,6 @@ EOF
       exit 1
     fi
 
-    # Infer tagged configuration to use if any are available and
-    # if one wasn't chosen via the "--tag" command line option.
-    # Only attempt this if the compiler in the base link
-    # command doesn't match the default compiler.
-    if test -n "$available_tags" && test -z "$tagname"; then
-      case $base_compile in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
-      *)
-       for z in $available_tags; do
-         if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
-           # Evaluate the configuration.
-           eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
-           case $base_compile in
-           "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
-             # The compiler in $compile_command matches
-             # the one in the tagged configuration.
-             # Assume this is the tagged configuration we want.
-             tagname=$z
-             break
-             ;;
-           esac
-         fi
-       done
-       # If $tagname still isn't set, then no tagged configuration
-       # was found and let the user know that the "--tag" command
-       # line option must be used.
-       if test -z "$tagname"; then
-         $echo "$modename: unable to infer tagged configuration"
-         $echo "$modename: specify a tag with \`--tag'" 1>&2
-         exit 1
-#       else
-#         $echo "$modename: using $tagname tagged configuration"
-       fi
-       ;;
-      esac
-    fi
-
     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
       eval arg=\"$export_dynamic_flag_spec\"
       compile_command="$compile_command $arg"