# ltmain.sh - Provide generalized library-building support services.
-# Generated automatically from ltmain.sh.in by configure.
+# Generated automatically from ltmain.in by configure.
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
-echo=echo
-if test X`$echo '\t'` = 'X\t'; then :
+#FIXME: echo=echo
+echo='printf %s\n'
+if test "X`$echo '\t'`" = 'X\t'; then :
else
# The Solaris and AIX default echo program unquotes backslashes.
# This makes it impossible to quote backslashes using
# echo "$something" | sed 's/\\/\\\\/g'
# So, we emulate echo with printf '%s\n'
echo='printf %s\n'
- if test X`$echo '\t'` = 'X\t'; then :
+ if test "X`$echo '\t'`" = 'X\t'; then :
else
# Oops. We have no working printf. Try to find a not-so-buggy echo.
echo=echo
save_PATH="$PATH"
PATH="$PATH":/usr/ucb
for dir in $PATH; do
- if test -f $dir/echo && test X`$dir/echo '\t'` = 'X\t'; then
+ if test -f $dir/echo && test "X`$dir/echo '\t'`" = 'X\t'; then
echo="$dir/echo"
break
fi
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
-VERSION=1.0b
+VERSION=1.0c
default_mode=
help="Try \`$progname --help' for more information."
magic="%%%MAGIC variable%%%"
mkdir="mkdir"
mv="mv -f"
-objdir=.libs
+objdir=_libs
rm="rm -f"
# Sed substitution that helps us do robust quoting. It backslashifies
# link it into a program.
if test "$build_libtool_libs" != yes; then
$show "$echo timestamp > $libobj"
- $run eval "$echo timestamp > \$libobj" || exit $?
+ $run eval "\$echo timestamp > \$libobj" || exit $?
fi
exit 0
dlprefiles=
export_dynamic=no
hardcode_libdirs=
- install_libdir=
libobjs=
link_against_libtool_libs=
- link_static=
ltlibs=
objs=
prev=
prevarg=
+ rpath=
perm_rpath=
temp_rpath=
vinfo=
for arg
do
case "$arg" in
- -static)
- if test "$build_libtool_libs" = yes; then
- if test "$hardcode_direct" = unsupported && test -z "$link_static_flag"; then
- $echo "$progname: warning: static linking is impossible in this configuration" 1>&2
- else
- build_libtool_libs=no
- fi
+ -all-static | -static)
+ if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ $echo "$progname: warning: complete static linking is impossible in this configuration" 1>&2
fi
+ build_libtool_libs=no
build_old_libs=yes
break
;;
;;
esac
;;
+ rpath)
+ rpath="$rpath $arg"
+ prev=
+ continue
+ ;;
*)
eval "$prev=\"\$arg\""
prev=
prevarg="$arg"
case "$arg" in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
+ continue
+ ;;
+
-allow-undefined)
allow_undefined=yes
continue
-export-dynamic)
if test "$export_dynamic" != yes; then
export_dynamic=yes
- arg=`eval $echo "$export_dynamic_flag_spec"`
+ arg=`eval \\$echo "$export_dynamic_flag_spec"`
# Add the symbol object into the linking commands.
compile_command="$compile_command @SYMFILE@"
-o) prev=output ;;
-rpath)
- prev=install_libdir
+ prev=rpath
continue
;;
-static)
- link_static="$link_static_flag"
- compile_command="$compile_command $link_static"
- finalize_command="$finalize_command $link_static"
+ # We already handled this flag above.
continue
- ;;
+ ;;
-version-info)
prev=vinfo
esac
fi
-
+ # FIXME: This is the magic to use -rpath.
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
fi
if test -n "$libdir"; then
- flag=`eval $echo \"$hardcode_libdir_flag_spec\"`
+ flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
compile_command="$compile_command $flag"
finalize_command="$finalize_command $flag"
compile_command="$compile_command $dir/$linklib"
finalize_command="$finalize_command $dir/$linklib"
else
- # Here we assume that "$hardcode_minusL" != unsupported.
+ # Here we assume that "$hardcode_minus_L" != unsupported.
# This is valid on all known static and shared platforms.
compile_command="$compile_command -L$dir -l$name"
finalize_command="$finalize_command -L$dir -l$name"
exit 1
fi
- # Substitute the hardcoded libdirs into the compile commands.
- if test -n "$hardcode_libdir_separator"; then
- compile_command=`$echo "$compile_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
- finalize_command=`$echo "$finalize_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
- fi
-
oldlib=
oldobjs=
case "$output" in
finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
fi
- if test -z "$install_libdir"; then
+ if test -z "$rpath"; then
$echo "$progname: you must specify an installation directory with \`-rpath'" 1>&2
+ $echo "$help" 1>&2
exit 1
fi
+ set dummy $rpath
+ if test $# -gt 2; then
+ $echo "$progname: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+ fi
+ install_libdir="$2"
+
# Parse the version information argument.
IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
set dummy $vinfo
if test "$build_libtool_libs" = yes; then
# Get the real and link names of the library.
- library_names=`eval $echo \"$library_names_spec\"`
+ library_names=`eval \\$echo \"$library_names_spec\"`
set dummy $library_names
realname="$2"
shift; shift
if test -n "$soname_spec"; then
- soname=`eval $echo \"$soname_spec\"`
+ soname=`eval \\$echo \"$soname_spec\"`
else
soname="$realname"
fi
test -z "$pic_flag" && libobjs=`$echo "$libobjs " | sed -e 's/\.lo /.o /g' -e 's/ $//g'`
# Do each of the archive commands.
- cmds=`eval $echo \"$archive_cmds\"`
+ cmds=`eval \\$echo \"$archive_cmds\"`
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
fi
- if test -n "$install_libdir"; then
+ if test -n "$rpath"; then
$echo "$progname: warning: \`-rpath' is ignored while creating objects" 1>&2
fi
reload_objs="$objs"`$echo "$libobjs " | sed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
output="$obj"
- cmds=`eval $echo \"$reload_cmds\"`
+ cmds=`eval \\$echo \"$reload_cmds\"`
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
# Create an invalid libtool object if no PIC, so that we don't
# accidentally link it into a program.
$show "$echo timestamp > $libobj"
- $run eval "$echo timestamp > $libobj" || exit $?
+ $run eval "\$echo timestamp > $libobj" || exit $?
exit 0
fi
# Only do commands if we really have different PIC objects.
reload_objs="$libobjs"
output="$libobj"
- cmds=`eval $echo \"$reload_cmds\"`
+ cmds=`eval \\$echo \"$reload_cmds\"`
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
;;
*)
- if test -n "$install_libdir"; then
- $echo "$progname: warning: \`-rpath' is ignored while linking programs" 1>&2
- fi
-
if test -n "$vinfo"; then
$echo "$progname: warning: \`-version-info' is ignored while linking programs" 1>&2
fi
- if test -n "$libobjs"; then
+ if test -n "$rpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ # Put the magic libdir with the hardcode flag.
+ hardcode_libdirs="$libdir"
+ libdir="@HARDCODE_LIBDIRS@"
+ else
+ # Just accumulate the libdirs.
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ libdir=
+ fi
+ fi
+
+ if test -n "$libdir"; then
+ flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
+
+ compile_command="$compile_command $flag"
+ finalize_command="$finalize_command $flag"
+ fi
+ elif test "$hardcode_runpath_var" = yes; then
+ case "$perm_rpath " in
+ "* $libdir *") ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ fi
+
+ # Substitute the hardcoded libdirs into the compile commands.
+ if test -n "$hardcode_libdir_separator"; then
+ compile_command=`$echo "$compile_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
+ finalize_command=`$echo "$finalize_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
+ fi
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
# Transform all the library objects into standard objects.
compile_command=`$echo "$compile_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
finalize_command=`$echo "$finalize_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
# We have no uninstalled library dependencies, so finalize right now.
$show "$compile_command"
$run eval "$compile_command"
- status=$?
-
- # If we failed to link statically, then try again.
- if test $status -ne 0 && test -n "$link_static"; then
- $echo "$progname: cannot link \`$output' statically; retrying semi-dynamically" 1>&2
- compile_command=`$echo "$compile_command " | sed -e "s% $link_static % %" -e 's/ $//'`
- $show "$compile_command"
- $run eval "$compile_command"
- status=$?
- fi
- exit $status
+ exit $?
fi
# Replace the output file specification.
link_against_libtool_libs='$link_against_libtool_libs'
finalize_command="$finalize_command"
else
- # When we are sourced in execute mode, \$file is already set.
- test "\$libtool_execute_magic" = "$magic" || file="\$0"
+ # When we are sourced in execute mode, \$file and \$echo are already set.
+ if test "\$libtool_execute_magic" = "$magic"; then :
+ else
+ echo='$echo'
+ file="\$0"
+ fi
# Find the directory that this script lives in.
- thisdir=\`$echo "\$file" | sed 's%/[^/]*$%%'\`
+ thisdir=\`\$echo "\$file" | sed 's%/[^/]*$%%'\`
test "x\$thisdir" = "x\$file" && thisdir=.
# Try to get the absolute directory name.
$shlibpath_var="$temp_rpath\$$shlibpath_var"
# Some systems cannot cope with colon-terminated $shlibpath_var
- $shlibpath_var=\`$echo \$$shlibpath_var | sed -e 's/:*\$//'\`
+ $shlibpath_var=\`\$echo \$$shlibpath_var | sed -e 's/:*\$//'\`
export $shlibpath_var
do
# Quote arguments (to preserve shell metacharacters).
sed_quote_subst='$sed_quote_subst'
- arg=\`$echo "\$arg" | sed "\$sed_quote_subst"\`
+ arg=\`\$echo "\$arg" | sed "\$sed_quote_subst"\`
args="\$args \\"\$arg\\""
done
eval "exec \$program \$args"
- $echo "\$0: cannot exec \$program \$args"
+ \$echo "\$0: cannot exec \$program \$args"
exit 1
fi
else
# The program doesn't exist.
- $echo "\$0: error: neither \$oprogdir/\$program nor \$progdir/\$program exists" 1>&2
- $echo "This script is just a wrapper for \$program." 1>&2
- $echo "See the $PACKAGE documentation for more information." 1>&2
+ \$echo "\$0: error: neither \$oprogdir/\$program nor \$progdir/\$program exists" 1>&2
+ \$echo "This script is just a wrapper for \$program." 1>&2
+ \$echo "See the $PACKAGE documentation for more information." 1>&2
exit 1
fi
fi
fi
# Do each command in the archive commands.
- cmds=`eval $echo \"$old_archive_cmds\"`
+ cmds=`eval \\$echo \"$old_archive_cmds\"`
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
# Do each command in the postinstall commands.
lib="$destdir/$realname"
- cmds=`eval $echo \"$postinstall_cmds\"`
+ cmds=`eval \\$echo \"$postinstall_cmds\"`
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
fi
# Do each command in the postinstall commands.
- cmds=`eval $echo \"$old_postinstall_cmds\"`
+ cmds=`eval \\$echo \"$old_postinstall_cmds\"`
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
for libdir in $libdirs; do
# Do each command in the postinstall commands.
- cmds=`eval $echo \"$finish_cmds\"`
+ cmds=`eval \\$echo \"$finish_cmds\"`
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
exit 1
else
# Display what would be done.
- eval "$echo \"\$shlibpath_var=\$$shlibpath_var\""
+ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
$echo "export $shlibpath_var"
$echo "$cmd$args"
exit 0
The following components of LINK-COMMAND are treated specially:
+ -all-static do not do any dynamic linking at all
-allow-undefined allow a libtool library to reference undefined symbols
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
-dlpreopen FILE link in FILE and add its symbols to dld_preloaded_symbols
-lNAME OUTPUT-FILE requires the installed library libNAME
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
-rpath LIBDIR the created library will eventually be installed in LIBDIR
- -static do not do any dynamic linking or shared library creation
+ -static do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]]
specify library version info [each variable defaults to 0]