* doc/libtool.texi (link mode): documentation for -module updated

* ltconfig.in: fast-install mode doesn't work for
  hardcode_into_libs=yes
* ltmain.in: bugfix: "-dlopen self [-all]-static" wouldn't use
  dlopen_self_static, automatically enable -export-dynamic when
  using "-dlopen self",	always make run-paths absolute,
  ignore -lc only on platforms that don't have such a library,
  cleanups in the ILD code, find even installed libtool libraries
  that were moved, before generating the DLL-import library we need
  to set libname, improved hardcoding of shlibpath for libraries,
  don't generate an installable pseudo-library for convenience
  libraries, bugfix: export_symbols would be removed immediately
  before it is used
This commit is contained in:
Thomas Tanner 1999-03-20 21:59:15 +00:00
parent e65f46d3fc
commit f7e4e308ce
4 changed files with 310 additions and 235 deletions

View File

@ -1,3 +1,19 @@
1999-03-20 Thomas Tanner <tanner@gmx.de>
* doc/libtool.texi (link mode): documentation for -module updated
* ltconfig.in: fast-install mode doesn't work for
hardcode_into_libs=yes
* ltmain.in: bugfix: "-dlopen self [-all]-static" wouldn't use
dlopen_self_static, automatically enable -export-dynamic when
using "-dlopen self", always make run-paths absolute,
ignore -lc only on platforms that don't have such a library,
cleanups in the ILD code, find even installed libtool libraries
that were moved, before generating the DLL-import library we need
to set libname, improved hardcoding of shlibpath for libraries,
don't generate an installable pseudo-library for convenience
libraries, bugfix: export_symbols would be removed immediately
before it is used
1999-03-19 Thomas Tanner <tanner@gmx.de> 1999-03-19 Thomas Tanner <tanner@gmx.de>
* use the same header in all configure.in's and Makefile.am's * use the same header in all configure.in's and Makefile.am's

View File

@ -1189,9 +1189,7 @@ executable.
@item -module @item -module
Creates a library that can be dlopenend (@pxref{Dlopened modules}). Creates a library that can be dlopenend (@pxref{Dlopened modules}).
This option doesn't work for programs and must not be used This option doesn't work for programs.
together with @samp{-export-symbols}.
It enables the option @samp{-export-dynamic} automatically.
Module names don't need to be prefixed with 'lib'. Module names don't need to be prefixed with 'lib'.
In order to prevent name clashes, however, 'libname' and 'name' In order to prevent name clashes, however, 'libname' and 'name'
must not be used at the same time in your package. must not be used at the same time in your package.

View File

@ -1951,7 +1951,7 @@ test "$enable_shared" = yes || enable_static=yes
echo "checking whether to build static libraries... $enable_static" 1>&6 echo "checking whether to build static libraries... $enable_static" 1>&6
if test "$hardcode_action" = relink; then if test "$hardcode_action" = relink || test "$hardcode_into_libs" = yes; then
# Fast installation is not supported # Fast installation is not supported
enable_fast_install=no enable_fast_install=no
elif test "$shlibpath_overrides_runpath" = yes || elif test "$shlibpath_overrides_runpath" = yes ||

491
ltmain.in
View File

@ -824,9 +824,18 @@ compiler."
do do
case "$arg" in case "$arg" in
-all-static | -static) -all-static | -static)
if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then 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 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
fi fi
if test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
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_libtool_libs=no
build_old_libs=yes build_old_libs=yes
break break
@ -867,13 +876,18 @@ compiler."
dlself=yes dlself=yes
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
dlself=yes dlself=yes
else
export_dynamic=yes
fi fi
prev= prev=
continue continue
;; ;;
*) *)
if test "$prev" = dlfiles; then
dlfiles="$dlfiles $arg"
else
dlprefiles="$dlprefiles $arg" dlprefiles="$dlprefiles $arg"
test "$prev" = dlfiles && dlfiles="$dlfiles $arg" fi
prev= prev=
;; ;;
esac esac
@ -897,13 +911,30 @@ compiler."
prev= prev=
continue continue
;; ;;
rpath) rpath | xrpath)
rpath="$rpath $arg" # We need an absolute path.
prev= case "$arg" in
continue /* | [A-Za-z]:[/\\]*) ;;
*)
absdir=`cd "$arg" && pwd`
if test -z "$absdir"; then
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
exit 1
fi
arg="$absdir"
;; ;;
xrpath) esac
xrpath="$xrpath $arg" if test "$prev" = rpath; then
case "$rpath " in
*" $arg "*) ;;
*) rpath="$rpath $arg" ;;
esac
else
case "$xrpath " in
*" $arg "*) ;;
*) xrpath="$xrpath $arg" ;;
esac
fi
prev= prev=
continue continue
;; ;;
@ -922,7 +953,6 @@ compiler."
if test -n "$link_static_flag"; then if test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag" compile_command="$compile_command $link_static_flag"
finalize_command="$finalize_command $link_static_flag" finalize_command="$finalize_command $link_static_flag"
dlopen_self=$dlopen_self_static
fi fi
continue continue
;; ;;
@ -949,22 +979,16 @@ compiler."
;; ;;
-export-dynamic) -export-dynamic)
if test "$export_dynamic" != yes; then
export_dynamic=yes export_dynamic=yes
if test -n "$export_dynamic_flag_spec"; then continue
eval arg=\"$export_dynamic_flag_spec\"
else
arg=
fi
fi
;; ;;
-export-symbols | -export-symbols-regex) -export-symbols | -export-symbols-regex)
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: cannot have more than one -exported-symbols" $echo "$modename: not more than one -exported-symbols argument allowed"
exit 1 exit 1
fi fi
if test "$arg" = "-export-symbols"; then if test "X$arg" = "X-export-symbols"; then
prev=expsyms prev=expsyms
else else
prev=expsyms_regex prev=expsyms_regex
@ -973,7 +997,7 @@ compiler."
;; ;;
-L*) -L*)
dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'` dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
# We need an absolute path. # We need an absolute path.
case "$dir" in case "$dir" in
/* | [A-Za-z]:[/\\]*) ;; /* | [A-Za-z]:[/\\]*) ;;
@ -997,30 +1021,28 @@ compiler."
;; ;;
-l*) -l*)
if test "$arg" = "-lm"; then if test "$arg" = "-lc"; then
case "$host" in case "$host" in
*-*-cygwin* | *-*-beos*) *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
# Ignore -lm on Cygwin and BeOS # These systems don't actually have c library (as such)
continue continue
;; ;;
esac esac
elif test "$arg" = "-lc"; then elif test "$arg" = "-lm"; then
# Always ignore -lc case "$host" in
*-*-cygwin* | *-*-beos*)
# These systems don't actually have math library (as such)
continue continue
;;
esac
fi fi
deplibs="$deplibs $arg" deplibs="$deplibs $arg"
continue continue
;; ;;
-module) -module)
if test "$module" != yes; then
module=yes module=yes
if test -n "$export_dynamic_flag_spec"; then continue
eval arg=\"$export_dynamic_flag_spec\"
else
arg=
fi
fi
;; ;;
-no-undefined) -no-undefined)
@ -1046,7 +1068,23 @@ compiler."
;; ;;
-R*) -R*)
xrpath="$xrpath "`$echo "X$arg" | $Xsed -e 's/^-R//'` dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
# We need an absolute path.
case "$dir" in
/* | [A-Za-z]:[/\\]*) ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
exit 1
fi
dir="$absdir"
;;
esac
case "$xrpath " in
*" $dir "*) ;;
*) xrpath="$xrpath $dir" ;;
esac
continue continue
;; ;;
@ -1055,7 +1093,6 @@ compiler."
if test -z "$pic_flag" && test -n "$link_static_flag"; then if test -z "$pic_flag" && test -n "$link_static_flag"; then
compile_command="$compile_command $link_static_flag" compile_command="$compile_command $link_static_flag"
finalize_command="$finalize_command $link_static_flag" finalize_command="$finalize_command $link_static_flag"
dlopen_self=$dlopen_self_static
fi fi
continue continue
;; ;;
@ -1212,6 +1249,12 @@ compiler."
exit 1 exit 1
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"
finalize_command="$finalize_command $arg"
fi
oldlibs= oldlibs=
# calculate the name of the file, without its directory # calculate the name of the file, without its directory
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
@ -1259,7 +1302,7 @@ compiler."
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
fi fi
if test -n "$export_symbols"; then if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
fi fi
@ -1298,11 +1341,6 @@ compiler."
output_objdir="$output_objdir/$objdir" output_objdir="$output_objdir/$objdir"
fi fi
# All the library-specific variables (install_libdir is set above).
library_names=
old_library=
dlname=
if test -n "$objs"; then if test -n "$objs"; then
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
exit 1 exit 1
@ -1316,22 +1354,7 @@ compiler."
if test $# -gt 2; then if test $# -gt 2; then
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
fi fi
dir="$2" install_libdir="$2"
if test -n "$dir"; then
# We need an absolute path.
case "$dir" in
/* | [A-Za-z]:[/\\]*) ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
else
dir="$absdir"
fi
;;
esac
fi
install_libdir="$dir"
oldlibs= oldlibs=
if test -z "$rpath"; then if test -z "$rpath"; then
@ -1502,16 +1525,6 @@ compiler."
# Don't allow undefined symbols. # Don't allow undefined symbols.
allow_undefined_flag="$no_undefined_flag" allow_undefined_flag="$no_undefined_flag"
fi fi
case "$host" in
*-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
# these systems don't actually have a c library (as such)!
;;
*)
# Add libc to deplibs on all other systems.
deplibs="$deplibs -lc"
;;
esac
fi fi
if test "$relink" = no; then if test "$relink" = no; then
@ -1538,32 +1551,35 @@ compiler."
fi fi
# Save some variables # Save some variables
dlname_save=$dlname
library_names_save=$library_names
old_library_save=$old_library
name_save=$name name_save=$name
libname_save=$libname libname_save=$libname
release_save=$release release_save=$release
versuffix_save=$versuffix versuffix_save=$versuffix
major_save=$major major_save=$major
old_deplibs="$deplibs"
# Find libtool libraries and add their dependencies and directories # Find libtool libraries and add their dependencies and directories
newdeplibs= # libraries to link (used in archive_cmds) deplibs= # libraries to link (used in archive_cmds)
newdependency_libs= # all dependency libraries newdependency_libs= # all dependency libraries
uninst_path= # paths that contain uninstalled libtool libraries uninst_path= # paths that contain uninstalled libtool libraries
shlibpath= shlibpath=
new_lib_search_path= new_lib_search_path=
for deplib in $deplibs; do for deplib in $old_deplibs; do
lib= lib=
case "$deplib" in case "$deplib" in
-L*) -L*)
new_lib_search_path="$new_lib_search_path `expr $deplib : '-L\(.*\)'`" case "$deplibs " in
newdeplibs="$newdeplibs $deplib" *" $deplib "*) ;;
*)
deplibs="$deplibs $deplib"
newdependency_libs="$newdependency_libs $deplib" newdependency_libs="$newdependency_libs $deplib"
new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
;;
esac
continue continue
;; ;;
-l*) -l*)
name="`expr $deplib : '-l\(.*\)'`" name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
libname=`eval \\$echo \"$libname_spec\"` libname=`eval \\$echo \"$libname_spec\"`
found=no found=no
for searchdir in $lib_search_path; do for searchdir in $lib_search_path; do
@ -1575,7 +1591,7 @@ compiler."
fi fi
done done
if test "$found" != yes; then if test "$found" != yes; then
newdeplibs="$newdeplibs $deplib" deplibs="$deplibs $deplib"
newdependency_libs="$newdependency_libs $deplib" newdependency_libs="$newdependency_libs $deplib"
continue continue
fi fi
@ -1639,26 +1655,25 @@ compiler."
# Find the relevant object directory and library name. # Find the relevant object directory and library name.
if test "X$installed" = Xyes; then if test "X$installed" = Xyes; then
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
$echo "$modename: warning: library \`$lib' was moved." 1>&2
dir="$ladir"
absdir="$abs_ladir"
libdir="$abs_ladir"
else
dir="$libdir" dir="$libdir"
absdir="$libdir" absdir="$libdir"
fi
else else
dir="$ladir/$objdir" dir="$ladir/$objdir"
case "$dir" in absdir="$abs_ladir/$objdir"
/* | [A-Za-z]:[/\\]*) absdir="$dir" ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
exit 1
fi
;;
esac
# Remove this search path later # Remove this search path later
uninst_path="$uninst_path $abs_ladir" uninst_path="$uninst_path $abs_ladir"
fi fi
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
if test "$build_libtool_libs" = yes && test -n "$library_names"; then if test "$build_libtool_libs" = yes && test -n "$library_names"; then
# This is a shared library
if test "$hardcode_into_libs" = yes; then if test "$hardcode_into_libs" = yes; then
# Hardcode the library path. # Hardcode the library path.
# Skip directories that are in the system default run-time # Skip directories that are in the system default run-time
@ -1688,6 +1703,7 @@ compiler."
set dummy $library_names set dummy $library_names
realname="$2" realname="$2"
shift; shift shift; shift
libname=`eval \\$echo \"$libname_spec\"`
if test -n "$soname_spec"; then if test -n "$soname_spec"; then
eval soname=\"$soname_spec\" eval soname=\"$soname_spec\"
else else
@ -1728,61 +1744,84 @@ compiler."
linklib=$newlib linklib=$newlib
fi fi
add_dir=
add_shlibpath=
add_name=no
if test "$relink" = no; then if test "$relink" = no; then
lib_linked=yes lib_linked=yes
case "$hardcode_action" in case "$hardcode_action" in
immediate | unsupported) immediate | unsupported)
if test "$hardcode_direct" = no; then if test "$hardcode_direct" = no; then
newdeplibs="$newdeplibs $dir/$linklib" deplibs="$deplibs $dir/$linklib"
elif test "$hardcode_minus_L" = no; then elif test "$hardcode_minus_L" = no; then
case "$host" in case "$host" in
*-*-sunos*) *-*-sunos*) add_shlibpath="$dir" ;;
shlibpath="$shlibpath$dir:"
;;
esac esac
newdeplibs="$newdeplibs -L$dir -l$name" add_dir="-L$dir"
add_name=yes
elif test "$hardcode_shlibpath_var" = no; then elif test "$hardcode_shlibpath_var" = no; then
shlibpath="$shlibpath$dir:" add_shlibpath="$dir"
newdeplibs="$newdeplibs -l$name" add_name=yes
else else
lib_linked=no lib_linked=no
fi fi
;; ;;
relink) relink)
if test "$hardcode_direct" = yes; then if test "$hardcode_direct" = yes; then
newdeplibs="$newdeplibs $dir/$linklib" deplibs="$deplibs $dir/$linklib"
elif test "$hardcode_minus_L" = yes; then elif test "$hardcode_minus_L" = yes; then
newdeplibs="$newdeplibs -L$dir -l$name" add_dir="-L$dir"
add_name=yes
elif test "$hardcode_shlibpath_var" = yes; then elif test "$hardcode_shlibpath_var" = yes; then
shlibpath="$shlibpath$dir:" add_shlibpath="$dir"
newdeplibs="$newdeplibs -l$name" add_name=yes
else else
lib_linked=no lib_linked=no
fi fi
;; ;;
*) *) lib_linked=no ;;
lib_linked=no
;;
esac esac
if test "$lib_linked" != yes; then if test "$lib_linked" != yes; then
$echo "$modename: configuration error: unsupported hardcode properties" $echo "$modename: configuration error: unsupported hardcode properties"
exit 1 exit 1
fi fi
if test -n "$add_shlibpath"; then
case ":$compile_shlibpath:" in
*":$add_shlibpath:"*) ;;
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
esac
fi
else else
# Install command for both is simple: just hardcode it. # Install command for both is simple: just hardcode it.
if test "$hardcode_direct" = yes; then if test "$hardcode_direct" = yes; then
newdeplibs="$newdeplibs $libdir/$linklib" deplibs="$deplibs $libdir/$linklib"
elif test "$hardcode_minus_L" = yes; then elif test "$hardcode_minus_L" = yes; then
newdeplibs="$newdeplibs -L$libdir -l$name" add_dir="-L$libdir"
add_name=yes
elif test "$hardcode_shlibpath_var" = yes; then elif test "$hardcode_shlibpath_var" = yes; then
shlibpath="$shlibpath$libdir:" add_name=yes
newdeplibs="$newdeplibs -l$name"
else else
# We cannot seem to hardcode it, guess we'll fake it. # We cannot seem to hardcode it, guess we'll fake it.
newdeplibs="$newdeplibs -L$libdir -l$name" add_dir="-L$libdir"
add_name=yes
fi fi
fi fi
if test "$hardcode_direct" != yes && \
test "$hardcode_minus_L" != yes && \
test "$hardcode_shlibpath_var" = yes; then
case ":$finalize_shlibpath:" in
*":$libdir:"*) ;;
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
fi
if test -n "$add_dir"; then
case "$deplibs " in
*" $add_dir "*) ;;
*) deplibs="$deplibs $add_dir" ;;
esac
fi
test "$add_name" = yes && deplibs="$deplibs -l$name"
elif test "$build_libtool_libs" = yes && test "$deplibs_check_method" != pass_all; then elif test "$build_libtool_libs" = yes && test "$deplibs_check_method" != pass_all; then
echo echo
echo "*** Warning: This library needs some functionality provided by $libname." echo "*** Warning: This library needs some functionality provided by $libname."
@ -1798,11 +1837,9 @@ compiler."
fi fi
convenience="$convenience $dir/$old_library" convenience="$convenience $dir/$old_library"
old_convenience="$old_convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library"
newdeplibs="$newdeplibs $dir/$old_library" deplibs="$deplibs $dir/$old_library"
fi fi
new_lib_search_path="$new_lib_search_path $absdir"
if test -n "$dependency_libs"; then if test -n "$dependency_libs"; then
# Extract -R from dependency_libs # Extract -R from dependency_libs
temp_deplibs= temp_deplibs=
@ -1842,7 +1879,6 @@ compiler."
esac esac
done done
deplibs=$newdeplibs
# Eliminate all temporary directories. # Eliminate all temporary directories.
for path in $uninst_path; do for path in $uninst_path; do
lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
@ -1873,9 +1909,6 @@ compiler."
release=$release_save release=$release_save
libname=$libname_save libname=$libname_save
name=$name_save name=$name_save
old_library=$old_library_save
library_names=$library_names_save
dlname=$dlname_save
if test "$build_libtool_libs" = yes; then if test "$build_libtool_libs" = yes; then
# Transform deplibs into only deplibs that can be linked in shared. # Transform deplibs into only deplibs that can be linked in shared.
@ -1975,7 +2008,6 @@ EOF
fi fi
done done
fi fi
deplibs=$newdeplibs
;; ;;
file_magic*) file_magic*)
set dummy $deplibs_check_method set dummy $deplibs_check_method
@ -2029,7 +2061,8 @@ EOF
fi fi
done # Gone through all deplibs. done # Gone through all deplibs.
;; ;;
none | unknown | *) newdeplibs="" none | unknown | *)
newdeplibs=""
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
-e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
grep . >/dev/null; then grep . >/dev/null; then
@ -2071,20 +2104,34 @@ EOF
else else
build_libtool_libs=no build_libtool_libs=no
fi fi
dlname=
library_names=
else else
echo "*** The inter-library dependencies that have been dropped here will be" echo "*** The inter-library dependencies that have been dropped here will be"
echo "*** automatically added whenever a program is linked with this library" echo "*** automatically added whenever a program is linked with this library"
echo "*** or is declared to -dlopen it." echo "*** or is declared to -dlopen it."
fi fi
fi fi
# Done checking deplibs!
deplibs=$newdeplibs
fi fi
# test again, we may have decided not to build it any more # All the library-specific variables (install_libdir is set above).
library_names=
old_library=
dlname=
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then if test "$build_libtool_libs" = yes; then
deplibs=$newdeplibs if test -z "$rpath"; then
# Done checking deplibs! case "$host" in
*-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
# these systems don't actually have a c library (as such)!
;;
*)
# Add libc to deplibs on all other systems.
deplibs="$deplibs -lc"
;;
esac
fi
if test "$hardcode_into_libs" = yes; then if test "$hardcode_into_libs" = yes; then
# Hardcode the library paths # Hardcode the library paths
@ -2135,6 +2182,8 @@ EOF
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
fi fi
shlibpath="$finalize_shlibpath"
test "$relink" = no && shlibpath="$compile_shlibpath$shlibpath"
if test -n "$shlibpath"; then if test -n "$shlibpath"; then
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
fi fi
@ -2374,25 +2423,21 @@ EOF
fi fi
fi fi
if test "$dlself" = yes && test "$export_dynamic" = no; then
$echo "$modename: error: \`-dlopen self' requires \`-export-dynamic'" 1>&2
exit 1
fi
# Find libtool libraries and add their dependencies/rpaths # Find libtool libraries and add their dependencies/rpaths
newdeplibs= old_deplibs="$deplibs"
deplibs=
newdependency_libs= newdependency_libs=
new_lib_search_path= new_lib_search_path=
for deplib in $deplibs; do for deplib in $old_deplibs; do
lib= lib=
case "$deplib" in case "$deplib" in
-L*) -L*)
new_lib_search_path="$new_lib_search_path `expr $deplib : '-L\(.*\)'`" deplibs="$deplibs $deplib"
newdeplibs="$newdeplibs $deplib" new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
continue continue
;; ;;
-l*) -l*)
name="`expr $deplib : '-l\(.*\)'`" name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
libname=`eval \\$echo \"$libname_spec\"` libname=`eval \\$echo \"$libname_spec\"`
found=no found=no
for searchdir in $lib_search_path; do for searchdir in $lib_search_path; do
@ -2404,7 +2449,7 @@ EOF
fi fi
done done
if test "$found" != yes; then if test "$found" != yes; then
newdeplibs="$newdeplibs $deplib" deplibs="$deplibs $deplib"
continue continue
fi fi
;; ;;
@ -2451,7 +2496,7 @@ EOF
fi fi
new_lib_search_path="$new_lib_search_path `$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`" new_lib_search_path="$new_lib_search_path `$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`"
newdeplibs="$newdeplibs $lib" deplibs="$deplibs $lib"
for deplib in $dependency_libs; do for deplib in $dependency_libs; do
case "$deplib" in case "$deplib" in
@ -2491,7 +2536,6 @@ EOF
lib= lib=
case "$deplib" in case "$deplib" in
-L*) -L*)
compile_command="$compile_command $deplib"
case "$compile_command " in case "$compile_command " in
*" $deplib "*) ;; *" $deplib "*) ;;
*) compile_command="$compile_command $deplib";; *) compile_command="$compile_command $deplib";;
@ -2503,7 +2547,7 @@ EOF
continue continue
;; ;;
-R*) -R*)
dir=`expr $deplib : '-R\(.*\)'` dir=`$echo "X$deplib" | $Xsed -e 's/^-lR/'`
# Make sure the xrpath contains only unique directories. # Make sure the xrpath contains only unique directories.
case "$xrpath " in case "$xrpath " in
*" $dir "*) ;; *" $dir "*) ;;
@ -2519,7 +2563,7 @@ EOF
continue continue
;; ;;
-l*) -l*)
name="`expr $deplib : '-l\(.*\)'`" name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
libname=`eval \\$echo \"$libname_spec\"` libname=`eval \\$echo \"$libname_spec\"`
found=no found=no
for searchdir in $lib_search_path; do for searchdir in $lib_search_path; do
@ -2550,6 +2594,21 @@ EOF
library_names= library_names=
old_library= old_library=
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
test "X$ladir" = "X$lib" && ladir="."
# We need an absolute path.
case "$ladir" in
/* | [A-Za-z]:[/\\]*) abs_ladir="$ladir" ;;
*)
abs_ladir=`cd "$ladir" && pwd`
if test -z "$abs_ladir"; then
$echo "$modename: cannot determine absolute directory name of \`$ladir'" 1>&2
exit 1
fi
;;
esac
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
# Check to see that this really is a libtool archive. # Check to see that this really is a libtool archive.
if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else else
@ -2580,23 +2639,20 @@ EOF
# Find the relevant object directory and library name. # Find the relevant object directory and library name.
if test "X$installed" = Xyes; then if test "X$installed" = Xyes; then
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
$echo "$modename: warning: library \`$lib' was moved." 1>&2
dir="$ladir"
absdir="$abs_ladir"
libdir="$abs_ladir"
else
dir="$libdir" dir="$libdir"
absdir="$libdir" absdir="$libdir"
fi
else else
dir="`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`/" dir="$ladir/$objdir"
test "$dir" = "$deplib/" && dir= absdir="$abs_ladir/$objdir"
dir="$dir$objdir"
case "$dir" in
/* | [A-Za-z]:[/\\]*) absdir="$dir" ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
exit 1
fi
;;
esac
fi fi
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
if test "$build_libtool_libs" = yes && test -n "$library_names"; then if test "$build_libtool_libs" = yes && test -n "$library_names"; then
if test -n "$shlibpath_var"; then if test -n "$shlibpath_var"; then
@ -2636,8 +2692,6 @@ EOF
continue continue
fi fi
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
if test -z "$libdir"; then if test -z "$libdir"; then
# It is a libtool convenience library, so add in its objects. # It is a libtool convenience library, so add in its objects.
convenience="$convenience $dir/$old_library" convenience="$convenience $dir/$old_library"
@ -2655,6 +2709,7 @@ EOF
set dummy $library_names set dummy $library_names
realname="$2" realname="$2"
shift; shift shift; shift
libname=`eval \\$echo \"$libname_spec\"`
if test -n "$soname_spec"; then if test -n "$soname_spec"; then
eval soname=\"$soname_spec\" eval soname=\"$soname_spec\"
else else
@ -2696,27 +2751,22 @@ EOF
fi fi
lib_linked=yes lib_linked=yes
add_dir=
add_shlibpath=
add_name=no
case "$hardcode_action" in case "$hardcode_action" in
immediate | unsupported) immediate | unsupported)
if test "$hardcode_direct" = no; then if test "$hardcode_direct" = no; then
compile_command="$compile_command $dir/$linklib" compile_command="$compile_command $dir/$linklib"
elif test "$hardcode_minus_L" = no; then elif test "$hardcode_minus_L" = no; then
case "$host" in case "$host" in
*-*-sunos*) *-*-sunos*) add_shlibpath="$dir" ;;
compile_shlibpath="$compile_shlibpath$dir:"
;;
esac esac
case "$compile_command " in add_dir="-L$dir"
*" -L$dir "*) ;; add_name=yes
*) compile_command="$compile_command -L$dir";;
esac
compile_command="$compile_command -l$name"
elif test "$hardcode_shlibpath_var" = no; then elif test "$hardcode_shlibpath_var" = no; then
case ":$compile_shlibpath:" in add_shlibpath="$dir"
*":$dir:"*) ;; add_name=yes
*) compile_shlibpath="$compile_shlibpath$dir:";;
esac
compile_command="$compile_command -l$name"
else else
lib_linked=no lib_linked=no
fi fi
@ -2726,55 +2776,63 @@ EOF
if test "$hardcode_direct" = yes; then if test "$hardcode_direct" = yes; then
compile_command="$compile_command $absdir/$linklib" compile_command="$compile_command $absdir/$linklib"
elif test "$hardcode_minus_L" = yes; then elif test "$hardcode_minus_L" = yes; then
case "$compile_command " in add_dir="-L$absdir"
*" -L$absdir "*) ;; add_name=yes
*) compile_command="$compile_command -L$absdir";;
esac
compile_command="$compile_command -l$name"
elif test "$hardcode_shlibpath_var" = yes; then elif test "$hardcode_shlibpath_var" = yes; then
case ":$compile_shlibpath:" in add_shlibpath="$absdir"
*":$absdir:"*) ;; add_name=yes
*) compile_shlibpath="$compile_shlibpath$absdir:";;
esac
compile_command="$compile_command -l$name"
else else
lib_linked=no lib_linked=no
fi fi
;; ;;
*) *) lib_linked=no ;;
lib_linked=no
;;
esac esac
if test "$lib_linked" != yes; then if test "$lib_linked" != yes; then
$echo "$modename: configuration error: unsupported hardcode properties" $echo "$modename: configuration error: unsupported hardcode properties"
exit 1 exit 1
fi fi
if test -n "$add_dir"; then
case "$compile_command " in
*" $add_dir "*) ;;
*) compile_command="$compile_command $add_dir" ;;
esac
fi
if test -n "$add_shlibpath"; then
case ":$compile_shlibpath:" in
*":$add_shlibpath:"*) ;;
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
esac
fi
test "$add_name" = yes && compile_command="$compile_command -l$name"
add_dir=
add_name=no
# Finalize command for both is simple: just hardcode it. # Finalize command for both is simple: just hardcode it.
if test "$hardcode_direct" = yes; then if test "$hardcode_direct" = yes; then
finalize_command="$finalize_command $libdir/$linklib" finalize_command="$finalize_command $libdir/$linklib"
elif test "$hardcode_minus_L" = yes; then elif test "$hardcode_minus_L" = yes; then
case "$finalize_command " in add_dir="-L$libdir"
*" -L$libdir "*) ;; add_name=yes
*) finalize_command="$finalize_command -L$libdir";;
esac
finalize_command="$finalize_command -l$name"
elif test "$hardcode_shlibpath_var" = yes; then elif test "$hardcode_shlibpath_var" = yes; then
case ":$finalize_shlibpath:" in case ":$finalize_shlibpath:" in
*":$libdir:"*) ;; *":$libdir:"*) ;;
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac esac
finalize_command="$finalize_command -l$name" add_name=yes
else else
# We cannot seem to hardcode it, guess we'll fake it. # We cannot seem to hardcode it, guess we'll fake it.
case "$finalize_command " in add_dir="-L$libdir"
*" -L$dir "*) ;; add_name=yes
*) finalize_command="$finalize_command -L$libdir";;
esac
finalize_command="$finalize_command -l$name"
fi fi
if test -n "$add_dir"; then
case "$finalize_command " in
*" $add_dir "*) ;;
*) finalize_command="$finalize_command $add_dir" ;;
esac
fi
test "$add_name" = yes && finalize_command="$finalize_command -l$name"
else else
# Transform directly to old archives if we don't build new libraries. # Transform directly to old archives if we don't build new libraries.
if test -n "$pic_flag" && test -z "$old_library"; then if test -n "$pic_flag" && test -z "$old_library"; then
@ -2978,7 +3036,6 @@ extern \"C\" {
$run $rm $export_symbols $run $rm $export_symbols
$run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
else else
$run $rm $export_symbols
$run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$objdir/$output.exp"' $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$objdir/$output.exp"'
$run eval 'grep -f "$objdir/$output.exp" < "$nlist" > "$nlist"T' $run eval 'grep -f "$objdir/$output.exp" < "$nlist" > "$nlist"T'
$run eval 'mv "$nlist"T "$nlist"' $run eval 'mv "$nlist"T "$nlist"'
@ -3149,7 +3206,7 @@ static const void *lt_preloaded_setup() {
fi fi
fi fi
if test "$hardcode_action" = relink; then if test "$hardcode_action" = relink || test "$hardcode_into_libs" = yes; then
# Fast installation is not supported # Fast installation is not supported
link_command="$compile_var$compile_command$compile_rpath" link_command="$compile_var$compile_command$compile_rpath"
relink_command="$finalize_var$finalize_command$finalize_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath"
@ -3185,7 +3242,7 @@ static const void *lt_preloaded_setup() {
fi fi
fi fi
# Delete the old output file. # Delete the old output files.
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
$show "$link_command" $show "$link_command"
@ -3463,6 +3520,31 @@ fi\
# Only create the output if not a dry run. # Only create the output if not a dry run.
if test -z "$run"; then if test -z "$run"; then
for installed in no yes; do
if test "$installed" = yes; then
if test -z "$install_libdir"; then
break
fi
output="$output_objdir/$outputname"i
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
case "$deplib" in
*.la)
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1
fi
newdependency_libs="$newdependency_libs $libdir/$name"
;;
*) newdependency_libs="$newdependency_libs $deplib" ;;
esac
done
dependency_libs="$newdependency_libs"
fi
$rm $output
$echo > $output "\ $echo > $output "\
# $output - a libtool library file # $output - a libtool library file
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
@ -3485,36 +3567,15 @@ age=$age
revision=$revision revision=$revision
# Is this an already installed library? # Is this an already installed library?
installed=no installed=$installed
# Directory that this library needs to be installed in: # Directory that this library needs to be installed in:
libdir='$install_libdir' libdir='$install_libdir'"
if test "$installed" = no; then
$echo >> $output "\
relink_command=\"$relink_command\"" relink_command=\"$relink_command\""
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
case "$deplib" in
-L* | -R* | -l*)
newdependency_libs="$newdependency_libs $deplib"
;;
*)
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1
fi fi
newdependency_libs="$newdependency_libs $libdir/$name"
;;
esac
done done
$rm "$output_objdir/$outputname"i
sed -e 's/^installed=no$/installed=yes/' \
-e "s%^dependency_libs=\(.*\)%dependency_libs='$newdependency_libs'%" \
-e 's/^relink_command=\(.*\)//' \
< "$output" > "$output_objdir/$outputname"i || exit 1
fi fi
# Do a symbolic link so that the libtool archive can be found in # Do a symbolic link so that the libtool archive can be found in
@ -3705,8 +3766,8 @@ relink_command=\"$relink_command\""
fi fi
finalize=yes finalize=yes
deplibs=$dependency_libs link_against_libtool_libs="$dependency_libs"
for lib in $deplibs; do for lib in $link_against_libtool_libs; do
case "$lib" in case "$lib" in
*.la) *.la)
# Check to see that each library is installed. # Check to see that each library is installed.
@ -3756,7 +3817,7 @@ relink_command=\"$relink_command\""
if test "$hardcode_into_libs" = yes; then if test "$hardcode_into_libs" = yes; then
if test "$finalize" = yes; then if test "$finalize" = yes; then
$echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2 $echo "$modename: warning: relinking \`$file'" 1>&2
$show "$relink_command" $show "$relink_command"
if $run eval "$relink_command"; then : if $run eval "$relink_command"; then :
else else