-2200-02-01 Ossama Othman <ossama@uci.edu>
+2000-02-03 Ossama Othman <ossama@debian.org>
+
+ * ltconfig.in (available_tags): The name of each newly added
+ tagged configuration is appended to this list. This is done at
+ ltconfig time so that the generated `libtool' script need not
+ determine which tags it supports everytime it is used. The
+ available_tags variable is used by `ltmain.in' to iterate over
+ each of the tagged configurations when attempting to automatically
+ choose which one to use for the supplied compile/link command.
+ * ltmain.in: Added ability to automatically determine which tagged
+ configuration to use based on the compiler found in the supplied
+ base compile command.
+ (available_tags): This new variable contains a list of available
+ tagged configurations. This gets generated at ltconfig time.
+ (object_name, old_object): Renamed these to pic_object and
+ non_pic_object, respectively.
+ * doc/libtool.texi (Configuration tags): Updated documentation.
+ Libtool now has the ability to infer which tagged configuration to
+ use based on the compiler found in the supplied base compile
+ command.
+ * tagdemo/configure.in, tagdemo/configure: Removed explicit
+ substitution of "--tag=CXX" in $LIBTOOL. The newly added
+ automatic selection of tagged configurations obviates the need to
+ explicitly specify which tag to use.
+
+2000-02-01 Ossama Othman <ossama@uci.edu>
* ltcf-cxx.sh: Added some untested HPUX aCC support.
* ltmain.in: Inadvertently removed some of the tags patch.
fi
done
+ # 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 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
+ fi
+ 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
+ fi
+
case "$user_target" in
set)
;;
$run $rm "$libobj"
- # Create a libtool object file (analogous to a `.la' file),
+ # Create a libtool object file (analogous to a ".la" file),
# but don't create it if we're doing a dry run.
test -z "$run" && cat > $libobj <<EOF
# $libobj - a libtool object file
# Append the name of the PIC object to the libtool object file.
test -z "$run" && cat >> $libobj <<EOF
-object_name='$output_obj'
+pic_object='$output_obj'
EOF
# No PIC object so indicate it doesn't exist in the libtool
# object file.
test -z "$run" && cat >> $libobj <<EOF
-object_name=none
+pic_object=none
EOF
fi
# Only append if the libtool object file exists.
test -z "$run" && cat >> $libobj <<EOF
# Name of the non-PIC object.
-old_object='$obj'
+non_pic_object='$obj'
EOF
# Only append if the libtool object file exists.
test -z "$run" && cat >> $libobj <<EOF
# Name of the non-PIC object.
-old_object=none
+non_pic_object=none
EOF
fi
module=no
no_install=no
objs=
- old_objects=
+ non_pic_objects=
prefer_static_libs=no
preload=no
prev=
# Check to see that this really is a libtool object.
if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- object_name=
- old_object=
+ pic_object=
+ non_pic_object=
# Read the .lo file
# If there is no directory component, then add one.
*) . ./$arg ;;
esac
- if test -z "$object_name" || \
- test -z "$old_object" ||
- test "$object_name" = none && \
- test "$old_object" = none; then
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
$echo "$modename: cannot find name of object for \`$arg'" 1>&2
exit 1
fi
xdir="$xdir/"
fi
- if test "$object_name" != none; then
+ if test "$pic_object" != none; then
# Prepend the subdirectory the object is found in.
- object_name="$xdir$object_name"
+ pic_object="$xdir$pic_object"
if test "$prev" = dlfiles; then
- dlfiles="$dlfiles $object_name"
+ dlfiles="$dlfiles $pic_object"
if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
prev=
continue
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
- dlprefiles="$dlprefiles $object_name"
+ dlprefiles="$dlprefiles $pic_object"
prev=
fi
# A PIC object.
- libobjs="$libobjs $object_name"
+ libobjs="$libobjs $pic_object"
fi
# Non-PIC object.
- if test "$old_object" != none; then
+ if test "$non_pic_object" != none; then
# Prepend the subdirectory the object is found in.
- old_object="$xdir$old_object"
+ non_pic_object="$xdir$non_pic_object"
# A standard non-PIC object
- old_objects="$old_objects $old_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
fi
else
# Only an error if not doing a dry-run.
xdir="$xdir/"
fi
- object_name=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- old_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
- libobjs="$libobjs $object_name"
- old_objects="$old_objects $old_object"
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
fi
fi
;;
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" \
+ && 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
+ fi
+ 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
+ fi
+
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
eval arg=\"$export_dynamic_flag_spec\"
compile_command="$compile_command $arg"
oldlibs="$oldlibs $output_objdir/$libname.$libext"
# Transform .lo files to .o files.
- oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
fi
# Eliminate all temporary directories.
oldobjs="$libobjs_save"
build_libtool_libs=no
else
- oldobjs="$objs$old_deplibs $old_objects"
+ oldobjs="$objs$old_deplibs $non_pic_objects"
fi
addlibs="$old_convenience"
fi
CFLAGS="$lt_save_CFLAGS"
-LIBTOOL="$LIBTOOL --tag=CXX"
-
for ac_hdr in math.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2396: checking for $ac_hdr" >&5
+echo "configure:2394: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2401 "configure"
+#line 2399 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
;;
*-ncr-sysv4.3*)
echo $ac_n "checking for _mwvalidcheckl in -lmw""... $ac_c" 1>&6
-echo "configure:2440: checking for _mwvalidcheckl in -lmw" >&5
+echo "configure:2438: checking for _mwvalidcheckl in -lmw" >&5
ac_lib_var=`echo mw'_'_mwvalidcheckl | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lmw $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2448 "configure"
+#line 2446 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
_mwvalidcheckl()
; return 0; }
EOF
-if { (eval echo configure:2462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:2483: checking for main in -lm" >&5
+echo "configure:2481: checking for main in -lm" >&5
ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2491 "configure"
+#line 2489 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
;;
*)
echo $ac_n "checking for main in -lm""... $ac_c" 1>&6
-echo "configure:2521: checking for main in -lm" >&5
+echo "configure:2519: checking for main in -lm" >&5
ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2529 "configure"
+#line 2527 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:2536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else