summaryrefslogtreecommitdiffstats
path: root/ltmain.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ltmain.sh')
-rw-r--r--ltmain.sh64
1 files changed, 58 insertions, 6 deletions
diff --git a/ltmain.sh b/ltmain.sh
index 2cbb559..6fc6900 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -55,8 +55,8 @@ modename="$progname"
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
-VERSION=1.4.2a
-TIMESTAMP=" (1.922.2.94 2002/06/11 15:58:53)"
+VERSION=1.4.3
+TIMESTAMP=" (1.922.2.111 2002/10/23 02:54:36)"
default_mode=
help="Try \`$progname --help' for more information."
@@ -226,7 +226,7 @@ if test -z "$show_help"; then
# Infer the operation mode.
if test -z "$mode"; then
case $nonopt in
- *cc | *++ | gcc* | *-gcc*)
+ *cc | *++ | gcc* | *-gcc* | g++* | xlc*)
mode=link
for arg
do
@@ -768,6 +768,7 @@ compiler."
linker_flags=
dllsearchpath=
lib_search_path=`pwd`
+ inst_prefix_dir=
avoid_version=no
dlfiles=
@@ -898,6 +899,11 @@ compiler."
prev=
continue
;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
release)
release="-$arg"
prev=
@@ -999,6 +1005,11 @@ compiler."
continue
;;
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
# so, if we see these flags be careful not to treat them like -L
-L[A-Z][A-Z]*:*)
@@ -1846,6 +1857,14 @@ compiler."
add="$dir/$linklib"
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case "$libdir" in
+ [\/]*)
+ add_dir="-L$inst_prefix_dir$libdir $add_dir"
+ ;;
+ esac
+ fi
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
add_shlibpath="$dir"
@@ -1904,6 +1923,14 @@ compiler."
else
# We cannot seem to hardcode it, guess we'll fake it.
add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case "$libdir" in
+ [\/]*)
+ add_dir="-L$inst_prefix_dir$libdir $add_dir"
+ ;;
+ esac
+ fi
add="-l$name"
fi
@@ -2323,7 +2350,7 @@ compiler."
;;
osf)
- major=`expr $current - $age`
+ major=.`expr $current - $age`
versuffix=".$current.$age.$revision"
verstring="$current.$age.$revision"
@@ -3172,6 +3199,13 @@ EOF
# On Rhapsody replace the C library is the System framework
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ case $host in
+ *darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ ;;
+ esac
;;
esac
@@ -3921,7 +3955,7 @@ fi\
fi
done
# Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)"
+ relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
# Only create the output if not a dry run.
@@ -4222,12 +4256,30 @@ relink_command=\"$relink_command\""
dir="$dir$objdir"
if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ if test "$inst_prefix_dir" = "$destdir"; then
+ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+ exit 1
+ fi
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
+ fi
+
$echo "$modename: warning: relinking \`$file'" 1>&2
$show "$relink_command"
if $run eval "$relink_command"; then :
else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
- continue
+ exit 1
fi
fi