On Sat, 2003-12-06 at 15:14, Peter O'Gorman wrote:

> Albert Chin wrote:
> | On Sat, Dec 06, 2003 at 10:57:52PM +0900, Peter O'Gorman wrote:
> |
> |>Okay, I must be stupid, the tag inference goes like this:
> |>case $base_compile in
> |>
> | Before the case, what is the output of:
> |   echo .$CC.
> 
> And things begin to make a little more sense, with echo .$CC. and echo
> .$base_compile. before the case statement in both compile and link
> modes, I get the following output # comments added:
> 
> .gcc -arch ppc -arch i386. # This is .$CC.
> .gcc. # And .$base_compile.
> libtool: link: unable to infer tagged configuration
> libtool: link: specify a tag with `--tag'
> make[1]: *** [libltdl.la] Error 1
> make: *** [all] Error 2
> 
> Looks like it is simply infering too early in link mode.
> 
Yeah, my last patch moved the code to before the rest of the argument
parsing to make -shared, -static and -all-static work with a tagged
configuration.

Here's a patch you might want to try; it moves the tagged config
inference to beneath the argument parsing again.  I also had to move the
handling of those three arguments to beneath it as well, even though for
some reason they were separate (I couldn't find a reason for this
anymore...)

Anyway, this probably breaks everything, but try it anyway :-)

Scott
-- 
Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?

diff -ruNp libtool-CVS~/ChangeLog libtool-CVS/ChangeLog
--- libtool-CVS~/ChangeLog	2003-11-30 17:13:29.000000000 +0000
+++ libtool-CVS/ChangeLog	2003-12-07 18:59:19.000000000 +0000
@@ -0,0 +1,7 @@
+2003-12-07  Scott James Remnant  <[EMAIL PROTECTED]>
+
+	* ltmain.in: Move the code to infer the tagged configuration in
+	link mode until after the argument parsing again, so $base_compile
+	contains the complete command line.  Move the code to handle -shared,
+	-static and -all-static until after this.
+	
diff -ruNp libtool-CVS~/ltmain.in libtool-CVS/ltmain.in
--- libtool-CVS~/ltmain.in	2003-11-26 15:20:42.000000000 +0000
+++ libtool-CVS/ltmain.in	2003-12-07 18:54:43.000000000 +0000
@@ -900,87 +900,7 @@ EOF
     thread_safe=no
     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
-      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
-	break
-	;;
-      -all-static | -static)
-	if test "X$arg" = "X-all-static"; then
-	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
-	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
-	  fi
-	  if test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	    # See comment for -static flag below, for more details.
-	    compile_command="$compile_command $link_static_flag"
-	    finalize_command="$finalize_command $link_static_flag"
-	  fi
-	else
-	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
-	    dlopen_self=$dlopen_self_static
-	  fi
-	fi
-	build_libtool_libs=no
-	build_old_libs=yes
-	prefer_static_libs=yes
-	break
-	;;
-      esac
-    done
-
-    # See if our shared archives depend on static archives.
-    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+    later=
 
     # Go through the arguments, transforming them on the way.
     while test "$#" -gt 0; do
@@ -1247,7 +1167,7 @@ EOF
 
       case $arg in
       -all-static)
-	# The effects of -all-static are defined in a previous loop.
+        later="$later $arg"
 	continue
 	;;
 
@@ -1473,16 +1393,12 @@ EOF
 	;;
 
       -shared)
-	# The effects of -shared are defined in a previous loop.
+        later="$later $arg"
 	continue
 	;;
 
       -static)
-	# The effects of -static are defined in a previous loop.
-	# We used to do the same as -all-static on platforms that
-	# didn't have a PIC flag, but the assumption that the effects
-	# would be equivalent was wrong.  It would break on at least
-	# Digital Unix and AIX.
+        later="$later $arg"
 	continue
 	;;
 
@@ -1718,6 +1634,85 @@ 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
+
+    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
+	;;
+      -all-static | -static)
+	if test "X$arg" = "X-all-static"; then
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	    # See comment for -static flag below, for more details.
+	    compile_command="$compile_command $link_static_flag"
+	    finalize_command="$finalize_command $link_static_flag"
+	  fi
+	else
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	fi
+	build_libtool_libs=no
+	build_old_libs=yes
+	prefer_static_libs=yes
+	continue
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
       eval arg=\"$export_dynamic_flag_spec\"
       compile_command="$compile_command $arg"

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Libtool mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/libtool

Reply via email to