# if one wasn't chosen via the "--tag" command line option.
# Only attempt this if the compiler in the base compile
# command doesn't match the default compiler.
- if test -n "$available_tags" && test -z "$tagname" && echo $base_compile | grep -v "^[ ]*[^ ]*$CC" > /dev/null; then
- 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`"
- if echo $base_compile | grep "^[ ]*[^ ]*$CC" > /dev/null; then
- # The compiler in the base compile command matches
- # the one in the tagged configuration.
- # Assume this is the tagged configuration we want.
- tagname=$z
- break
+ if test -n "$available_tags" && test -z "$tagname"; then
+ case $base_compile in
+ "$CC "*) ;;
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when ltconfig was run.
+ "`$echo X$CC | $Xsed` "*) ;;
+ *)
+ 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 "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ "`$echo X$CC | $Xsed` "*)
+ 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
- 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
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
;;
esac
libtool_args="$nonopt"
+ base_compile="$nonopt"
compile_command="$nonopt"
finalize_command="$nonopt"
# Go through the arguments, transforming them on the way.
while test $# -gt 0; do
arg="$1"
+ base_compile="$base_compile $arg"
shift
case "$arg" in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
# 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" \
- && echo $compile_command | grep -v "^[ ]*[^ ]*$CC" > /dev/null; then
- 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`"
- if echo $compile_command | grep "^[ ]*[^ ]*$CC" > /dev/null; then
- # The compiler in $compile_command matches
- # the one in the tagged configuration.
- # Assume this is the tagged configuration we want.
- tagname=$z
- break
+ if test -n "$available_tags" && test -z "$tagname"; then
+ case $base_compile in
+ "$CC "*) ;;
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when ltconfig was run.
+ "`$echo X$CC | $Xsed` "*) ;;
+ *)
+ 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 "*)
+ # The compiler in $compile_command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ "`$echo X$CC | $Xsed` "*)
+ 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
- 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