esac
;;
- *.o | *.obj)
+ *.$objext)
# A standard object.
objs="$objs $arg"
;;
*.lo)
# A library object.
if test "$prev" = dlfiles; then
- dlfiles="$dlfiles $arg"
- if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
+ # This file was specified with -dlopen.
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $arg"
prev=
continue
else
# Preload the old-style object.
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
prev=
+ else
+ libobjs="$libobjs $arg"
fi
- libobjs="$libobjs $arg"
;;
- *.a | *.lib)
+ *.$libext)
# An archive.
deplibs="$deplibs $arg"
old_deplibs="$old_deplibs $arg"
*.la)
# A libtool-controlled library.
- dlname=
- libdir=
- library_names=
- old_library=
-
- # Check to see that this really is a libtool archive.
- if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
- else
- $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
- exit 1
- fi
-
- # If the library was installed with an old release of libtool,
- # it will not redefine variable installed.
- installed=yes
-
- # Read the .la file
- # If there is no directory component, then add one.
- case "$arg" in
- */* | *\\*) . $arg ;;
- *) . ./$arg ;;
- esac
-
- # Get the name of the library we link against.
- linklib=
- for l in $old_library $library_names; do
- linklib="$l"
- done
-
- if test -z "$linklib"; then
- $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
- exit 1
- fi
-
- if test "X$installed" = Xyes; then
- dir="$libdir"
- else
- dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$dir" = "X$arg"; then
- dir="$objdir"
- else
- dir="$dir/$objdir"
- fi
- fi
-
- # This library was specified with -dlopen.
if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
dlfiles="$dlfiles $arg"
- if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
- # If there is no dlname, no dlopen support or we're linking statically,
- # we need to preload.
- prev=dlprefiles
- else
- # We should not create a dependency on this library
- prev=
- continue
- fi
- fi
-
- # The library was specified with -dlpreopen.
- if test "$prev" = dlprefiles; then
- # Prefer using a static library (so that no silly _DYNAMIC symbols
- # are required to link).
- if test -n "$old_library"; then
- dlprefiles="$dlprefiles $dir/$old_library"
- else
- dlprefiles="$dlprefiles $dir/$linklib"
- fi
prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ dlprefiles="$dlprefiles $arg"
+ prev=
+ else
+ deplibs="$deplibs $arg"
fi
-
- deplibs="$deplibs $arg"
continue
;;
$echo "$help" 1>&2
exit 1
;;
- *.a | *.lib)
+ *.$libext)
linkmode=oldlib ;;
- *.lo | *.o | *.obj)
+ *.lo | *.$objext)
linkmode=obj ;;
*.la)
linkmode=lib ;;
linkmode=prog ;;
esac
- save_deplibs="$deplibs"
+ libs="$deplibs"
deplibs=
newdependency_libs=
uninst_path= # paths that contain uninstalled libtool libraries
case $linkmode in
lib)
passes="link"
+ for file in $dlfiles $dlprefiles; do
+ case "$file" in
+ *.la) ;;
+ *)
+ $echo "$modename: libraries can \`-dlopen' only libtool libraries" 1>&2
+ exit 1
+ ;;
+ esac
+ done
;;
prog)
alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
link_against_libtool_libs=
- passes="scan link"
+ passes="scan dlopen dlpreopen link"
;;
*) passes="link"
;;
esac
for pass in $passes; do
- if test "$linkmode,$pass" = "prog,link"; then
- save_deplibs="$deplibs %DEPLIBS% $dependency_libs"
+ if test $linkmode = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
fi
- for deplib in $save_deplibs; do
+ for deplib in $libs; do
lib=
found=no
case "$deplib" in
fi
;;
*.la) lib="$deplib" ;;
- *.a | *.lib)
+ *.$libext)
case $linkmode in
lib)
if test "$deplibs_check_method" != pass_all; then
;;
esac
;;
+ *.lo | *.$objext) continue ;;
%DEPLIBS%)
alldeplibs=yes
continue
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
test "X$ladir" = "X$lib" && ladir="."
+ dlname=
+ dlopen=
+ dlpreopen=
libdir=
library_names=
old_library=
*) . ./$lib ;;
esac
+ if test $linkmode = lib || test "$linkmode,$pass" = "prog,scan"; then
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
if test $linkmode != lib && test $linkmode != prog; then
# only check for convenience libraries
if test -z "$old_library"; then
exit 1
fi
- if test "$linkmode,$pass" = "prog,scan"; then
- new_lib_search_path="$new_lib_search_path $ladir"
- deplibs="$deplibs $lib"
-
- linkalldeplibs=no
- if test "$link_all_deplibs" != no || test "$fast_install" != no || \
- test "$build_libtool_libs" = no || test -z "$library_names"; then
- linkalldeplibs=yes
+ # This library was specified with -dlopen.
+ if test $pass = dlopen; then
+ if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking statically,
+ # we need to preload.
+ dlprefiles="$dlprefiles $lib"
else
- # Need to hardcode shared library paths
- # or/and link against static libraries
- newdependency_libs="$newdependency_libs $dependeny_libs"
+ newdlfiles="$newdlfiles $lib"
fi
-
- for deplib in $dependency_libs; do
- case "$deplib" in
- -L*) new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
- esac
- # Need to link against all dependency_libs?
- test $linkalldeplibs = yes && deplibs="$deplibs $deplib"
- done
continue
fi
fi
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ # This library was specified with -dlpreopen.
+ if test $pass = dlpreopen; then
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ newdlprefiles="$newdlprefiles $dir/$old_library"
+ else
+ newdlprefiles="$newdlprefiles $dir/$linklib"
+ fi
+ fi
+
+ if test $linkmode = prog && test $pass != link; then
+ new_lib_search_path="$new_lib_search_path $ladir"
+ deplibs="$deplibs $lib"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test "$fast_install" != no || \
+ test "$build_libtool_libs" = no || test -z "$library_names"; then
+ linkalldeplibs=yes
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$newdependency_libs $dependeny_libs"
+ fi
+
+ for deplib in $dependency_libs; do
+ case "$deplib" in
+ -L*) new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+ esac
+ # Need to link against all dependency_libs?
+ test $linkalldeplibs = yes && deplibs="$deplibs $deplib"
+ done
+ continue
+ fi
+
if test -z "$libdir"; then
# It is a libtool convenience library, so add in its objects.
convenience="$convenience $dir/$old_library"
case "$deplib" in
-L*) path="$deplib" ;;
*.la)
+ dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$deplib" && dir="."
+ # We need an absolute path.
+ case "$dir" in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+ absdir="$dir"
+ fi
+ ;;
+ esac
if grep "^installed=no" $deplib > /dev/null; then
- dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
- test "X$dir" = "X$deplib" && dir="."
- # We need an absolute path.
- case "$dir" in
- [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
- *)
- absdir=`cd "$dir" && pwd`
- if test -z "$absdir"; then
- $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
- absdir="$dir"
- fi
- ;;
- esac
path="-L$absdir/$objdir"
else
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1
fi
- path="-L$libdir"
+ if test "$absdir" != "$libdir"; then
+ $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+ fi
+ path="-L$absdir"
fi
;;
- *)
- continue
- ;;
+ *) continue ;;
esac
case "$deplibs " in
*" $path "*) ;;
done
lib_search_path="$lib_search_path $sys_lib_search_path"
done
+ if test $linkmode = prog; then
+ dlfiles="$newdlfiles"
+ dlprefiles="$newdlprefiles"
+ fi
case $linkmode in
oldlib)
fi
fi
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
+ if test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
fi
set dummy $rpath
fi
fi
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) dlfiles="$dlfiles $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) dlprefiles="$dlprefiles $lib" ;;
+ esac
+ done
+
if test "$build_libtool_libs" = yes; then
if test -n "$rpath"; then
case "$host" in
fi
if test "$preload" = yes; then
- if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
+ if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
test "$dlopen_self_static" = unknown; then
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
fi
esac
done
dependency_libs="$newdependency_libs"
+ newdlfiles=
+ for lib in $dlfiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ newdlfiles="$newdlfiles $libdir/$name"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ newdlprefiles="$newdlprefiles $libdir/$name"
+ done
+ dlprefiles="$newdlprefiles"
fi
$rm $output
$echo > $output "\
# Is this an already installed library?
installed=$installed
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
# Directory that this library needs to be installed in:
libdir='$install_libdir'"
if test "$installed" = no; then
# Do each installation.
case "$file" in
- *.a | *.lib)
+ *.$libext)
# Do the static libraries later.
staticlibs="$staticlibs $file"
;;
*.lo)
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
;;
- *.o | *.obj)
+ *.$objext)
staticdest="$destfile"
destfile=
;;