For next public release:
************************
+* For every `-L' flag, hardcode a corresponding directory. For
+aesthetics and least redundancy, this should only be done once for
+each dir (i.e. no duplicates). So, if the expansion is the same as
+`-Llibdir', then don't add anything. Also, check that directories
+added by this feature do not duplicate flags added with `-rpath'.
+
+The question is: should this only be done for programs? The answer
+is, I think, YES! Libtool libraries and inter-library dependencies
+are tricky enough without trying to factor in this complexity.
+
* Document `execute' mode, and the experimental nature of -dlopen and
-dlpreopen.
symbols to be included in a libtool archive.
* Somehow we need to make sure that static libraries never appear in
-$deplibs. If a program linked against a library doesn't contain the
-basename of the library (or is the same size), then the library is
-probably static.
+$deplibs. This, will probably require that libtool discover exactly
+which files would be linked from which directories when somebody says
+`-lsomething'. This adds a lot of complexity, but I see no other way
+around it.
* Need to finalize the documentation, and give a specification of
`.la' files so that people can depend on their format. This also
esac
;;
rpath)
- rpath="$rpath $arg"
+ rpath="$rpath $arg"
prev=
continue
;;
dir=`$echo "$arg" | sed 's%^-L\(.*\)$%\1%'`
case "$dir" in
/*)
+ # Add the corresponding hardcode_libdir_flag, if it is not identical.
;;
*)
$echo "$progname: \`-L$dir' cannot specify a relative directory" 1>&2
;;
-static)
- # We already handled this flag above.
+ # If we have no pic_flag, then this is the same as -all-static.
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
continue
;;
old_library=
# Check to see that this really is a libtool archive.
- if egrep "^# Generated by ltmain.sh" $arg >/dev/null 2>&1; then :
+ if egrep '^# Generated by ltmain.sh' $arg >/dev/null 2>&1; then :
else
$echo "$progname: \`$arg' is not a valid libtool archive" 1>&2
exit 1
if test -n "$shlibpath_var"; then
# Make sure the rpath contains only unique directories.
case "$temp_rpath " in
- "* $dir *") ;;
+ *" $dir "*) ;;
*) temp_rpath="$temp_rpath $dir" ;;
esac
fi
- # FIXME: This is the magic to use -rpath.
+ # 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
hardcode_libdirs="$libdir"
libdir="@HARDCODE_LIBDIRS@"
else
- # Just accumulate the libdirs.
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ # Just accumulate the unique libdirs.
+ case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
libdir=
fi
fi
elif test "$hardcode_runpath_var" = yes; then
# Do the same for the permanent run path.
case "$perm_rpath " in
- "* $libdir *") ;;
+ *" $libdir "*) ;;
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
hardcode_libdirs="$libdir"
libdir="@HARDCODE_LIBDIRS@"
else
- # Just accumulate the libdirs.
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ # Just accumulate the unique libdirs.
+ case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
libdir=
fi
fi
fi
elif test "$hardcode_runpath_var" = yes; then
case "$perm_rpath " in
- "* $libdir *") ;;
+ *" $libdir "*) ;;
*) perm_rpath="$perm_rpath $libdir" ;;
esac
fi
/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
-/* Prevent the only kind of declaration conflicts we can make. */
-#define dld_preloaded_symbol_count some_other_symbol
-#define dld_preloaded_symbols some_other_symbol
-
#ifdef __cplusplus
extern "C" {
#endif
+/* Prevent the only kind of declaration conflicts we can make. */
+#define dld_preloaded_symbol_count some_other_symbol
+#define dld_preloaded_symbols some_other_symbol
+
/* External symbol declarations for the compiler. */
EOF
if test -f "$nlist"; then
*.la)
# Check to see that this really is a libtool archive.
- if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then :
+ if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then :
else
$echo "$progname: \`$file' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
# Add the libdir to current_libdirs if it is the destination.
if test "X$destdir" = "X$libdir"; then
case "$current_libdirs " in
- "* $libdir *") ;;
+ *" $libdir "*) ;;
*) current_libdirs="$current_libdirs $libdir" ;;
esac
else
# Note the libdir as a future libdir.
case "$future_libdirs " in
- "* $libdir *") ;;
+ *" $libdir "*) ;;
*) future_libdirs="$future_libdirs $libdir" ;;
esac
fi
case "$file" in
*.la)
# Check to see that this really is a libtool archive.
- if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then :
+ if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then :
else
$echo "$progname: \`$lib' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
case "$name" in
*.la)
# Possibly a libtool archive, so verify it.
- if egrep "^# Generated by ltmain.sh" $file >/dev/null 2>&1; then
+ if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then
. $dir/$name
# Delete the libtool libraries and symlinks.