represented by integers. When a program is linked against a library, it
may use any subset of those interfaces.
-Libtool's description of the interfaces that a program uses is very
-simple: it encodes the least and the greatest interface numbers in the
-resulting binary (@var{first-interface}, @var{last-interface}).
+Libtool's description of the interfaces that a program uses is simple:
+it encodes the least and the greatest interface numbers in the resulting
+binary (@var{first-interface}, @var{last-interface}).
The dynamic linker is guaranteed that if a library supports @emph{every}
interface number between @var{first-interface} and @var{last-interface},
previous versions and other compilers do not.
@end enumerate
-This second issue is very complex. Basically, you should avoid any
-global or static variable initializations that would cause an
-``initializer element is not constant'' error if you compiled them with
-a standard C compiler.
+This second issue is complex. Basically, you should avoid any global or
+static variable initializations that would cause an ``initializer
+element is not constant'' error if you compiled them with a standard C
+compiler.
There are other ways of working around this problem, but they are beyond
the scope of this manual.
describes the programs that libtool uses, how they vary from system to
system, and how to test for them.
-Because libtool is a shell script, it is @emph{very} difficult to
-understand just by reading it from top to bottom. This section helps
-show why libtool does things a certain way. After reading it, then
-reading the scripts themselves, you should have a better sense of how to
-improve libtool, or write your own.
+Because libtool is a shell script, it is difficult to understand just by
+reading it from top to bottom. This section helps show why libtool does
+things a certain way. After reading it, then reading the scripts
+themselves, you should have a better sense of how to improve libtool, or
+write your own.
@menu
* References:: Finding more information.
if test "$export_dynamic" != yes; then
export_dynamic=yes
if test -n "$export_dynamic_flag_spec"; then
- arg=`eval \\$echo "$export_dynamic_flag_spec"`
+ eval arg=\"$export_dynamic_flag_spec\"
else
arg=
fi
fi
if test -n "$libdir"; then
- flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
+ eval flag=\"$hardcode_libdir_flag_spec\"
compile_command="$compile_command $flag"
finalize_command="$finalize_command $flag"
esac
name=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
- libname=`eval \\$echo \"$libname_spec\"`
+ eval libname=\"$libname_spec\"
# All the library-specific variables (install_libdir is set above).
library_names=
if test "$build_libtool_libs" = yes; then
# Get the real and link names of the library.
- library_names=`eval \\$echo \"$library_names_spec\"`
+ eval library_names=\"$library_names_spec\"
set dummy $library_names
realname="$2"
shift; shift
if test -n "$soname_spec"; then
- soname=`eval \\$echo \"$soname_spec\"`
+ eval soname=\"$soname_spec\"
else
soname="$realname"
fi
test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'`
# Do each of the archive commands.
- cmds=`eval \\$echo \"$archive_cmds\"`
+ eval cmds=\"$archive_cmds\"
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
output="$obj"
- cmds=`eval \\$echo \"$reload_cmds\"`
+ eval cmds=\"$reload_cmds\"
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
# Only do commands if we really have different PIC objects.
reload_objs="$libobjs"
output="$libobj"
- cmds=`eval \\$echo \"$reload_cmds\"`
+ eval cmds=\"$reload_cmds\"
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
fi
if test -n "$libdir"; then
- flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
+ eval flag=\"$hardcode_libdir_flag_spec\"
compile_command="$compile_command $flag"
finalize_command="$finalize_command $flag"
case "$dlsyms" in
"") ;;
*.c)
- $echo > "$objdir/$dlsyms" \
-"/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
+ $echo > "$objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
#ifdef __cplusplus
#define dld_preloaded_symbol_count some_other_symbol
#define dld_preloaded_symbols some_other_symbol
-/* External symbol declarations for the compiler. */"
+/* External symbol declarations for the compiler. */\
+"
if test -f "$nlist"; then
sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
else
echo '/* NONE */' >> "$objdir/$dlsyms"
-EOF
fi
- $echo >> "$objdir/$dlsyms" \
-"
+ $echo >> "$objdir/$dlsyms" "\
+
#undef dld_preloaded_symbol_count
#undef dld_preloaded_symbols
__ptr_t address;
}
dld_preloaded_symbols[] =
-{"
+{\
+"
if test -f "$nlist"; then
sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
fi
- $echo >> "$objdir/$dlsyms" \
-" {0, (__ptr_t) 0}
+ $echo >> "$objdir/$dlsyms" "\
+ {0, (__ptr_t) 0}
};
#ifdef __cplusplus
}
-#endif"
+#endif\
+"
;;
*)
$rm $output
trap "$rm $output; exit 1" 1 2 15
- $echo > $output \
-"#! /bin/sh
+ $echo > $output "\
+#! /bin/sh
# $output - temporary wrapper script for $objdir/$output
# Generated by ltmain.sh - GNU $PACKAGE $VERSION
else
echo=\"$qecho\"
file=\"\$0\"
- fi
+ fi\
+"
+ $echo >> $output "\
# Find the directory that this script lives in.
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
# Export our shlibpath_var if we have one.
if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- $echo >> $output \
-" # Add our own library path to $shlibpath_var
+ $echo >> $output "\
+ # Add our own library path to $shlibpath_var
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
# Some systems cannot cope with colon-terminated $shlibpath_var
"
fi
- echo >> $output \
-" if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ $echo >> $output "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
# Run the actual program with our arguments.
- args=
- for arg
- do
- # Quote arguments (to preserve shell metacharacters).
- arg=\`\$echo \"X\$arg\" | \$Xsed -e \"\$sed_quote_subst\"\`
- args=\"\$args \\\"\$arg\\\"\"
- done
# Export the path to the program.
PATH=\"\$progdir:\$PATH\"
export PATH
- eval \"exec \$program \$args\"
+ exec \$program \${1+\"\$@\"}
- \$echo \"\$0: cannot exec \$program \$args\"
+ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
exit 1
fi
else
echo \"See the $PACKAGE documentation for more information.\" 1>&2
exit 1
fi
-fi"
+fi\
+"
chmod +x $output
fi
exit 0
# Do each command in the archive commands.
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
- cmds=`eval \\$echo \"$old_archive_from_new_cmds\"`
+ eval cmds=\"$old_archive_from_new_cmds\"
else
- cmds=`eval \\$echo \"$old_archive_cmds\"`
+ eval cmds=\"$old_archive_cmds\"
fi
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
# Only create the output if not a dry run.
if test -z "$run"; then
- echo > $output \
-"# $output - a libtool library file
+ $echo > $output "\
+# $output - a libtool library file
# Generated by ltmain.sh - GNU $PACKAGE $VERSION
# The name that we can dlopen(3).
revision=$revision
# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
+libdir='$install_libdir'\
+"
fi
# Do a symbolic link so that the libtool archive can be found in
# Do each command in the postinstall commands.
lib="$destdir/$realname"
- cmds=`eval \\$echo \"$postinstall_cmds\"`
+ eval cmds=\"$postinstall_cmds\"
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
$run eval "$install_prog \$file \$oldlib" || exit $?
# Do each command in the postinstall commands.
- cmds=`eval \\$echo \"$old_postinstall_cmds\"`
+ eval cmds=\"$old_postinstall_cmds\"
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
# Do each command in the finish commands.
- cmds=`eval \\$echo \"$finish_cmds\"`
+ eval cmds=\"$finish_cmds\"
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
fi
if test -n "$finish_eval"; then
# Do the single finish_eval.
- cmds=`eval \\$echo \"$finish_eval\"`
+ eval cmds=\"$finish_eval\"
$run eval "$cmds"
fi
done
fi
if test -n "$hardcode_libdir_flag_spec"; then
libdir=LIBDIR
- flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
+ eval flag=\"$hardcode_libdir_flag_spec\"
echo " - use the \`$flag' linker flag"
fi
if test -n "$library_names"; then
# Do each command in the postuninstall commands.
- cmds=`eval \\$echo \"$postuninstall_cmds\"`
+ eval cmds=\"$postuninstall_cmds\"
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"
if test -n "$old_library"; then
# Do each command in the old_postuninstall commands.
- cmds=`eval \\$echo \"$old_postuninstall_cmds\"`
+ eval cmds=\"$old_postuninstall_cmds\"
IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
for cmd in $cmds; do
IFS="$save_ifs"