version 1.5 | | version 1.6 |
---|
| | |
# ltmain.sh - Provide generalized library-building support services. | | # ltmain.sh - Provide generalized library-building support services. |
# NOTE: Changing this file will not affect anything until you rerun configure. | | # NOTE: Changing this file will not affect anything until you rerun configure. |
# | | # |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 | | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 |
# Free Software Foundation, Inc. | | # Free Software Foundation, Inc. |
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 | | # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
# | | # |
| | |
# configuration script generated by Autoconf, you may include it under | | # configuration script generated by Autoconf, you may include it under |
# the same distribution terms that you use for the rest of that program. | | # the same distribution terms that you use for the rest of that program. |
| | |
| | basename="s,^.*/,,g" |
| | |
| | # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh |
| | # is ksh but when the shell is invoked as "sh" and the current value of |
| | # the _XPG environment variable is not equal to 1 (one), the special |
| | # positional parameter $0, within a function call, is the name of the |
| | # function. |
| | progpath="$0" |
| | |
| | # The name of this program: |
| | progname=`echo "$progpath" | $SED $basename` |
| | modename="$progname" |
| | |
| | # Global variables: |
| | EXIT_SUCCESS=0 |
| | EXIT_FAILURE=1 |
| | |
| | PROGRAM=ltmain.sh |
| | PACKAGE=libtool |
| | VERSION=1.5.6 |
| | TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 220 $" |
| | |
| | |
# Check that we have a working $echo. | | # Check that we have a working $echo. |
if test "X$1" = X--no-reexec; then | | if test "X$1" = X--no-reexec; then |
# Discard the --no-reexec flag, and continue. | | # Discard the --no-reexec flag, and continue. |
| | |
: | | : |
else | | else |
# Restart under the correct shell, and then maybe $echo will work. | | # Restart under the correct shell, and then maybe $echo will work. |
exec $SHELL "$0" --no-reexec ${1+"$@"} | | exec $SHELL "$progpath" --no-reexec ${1+"$@"} |
fi | | fi |
| | |
if test "X$1" = X--fallback-echo; then | | if test "X$1" = X--fallback-echo; then |
| | |
cat <<EOF | | cat <<EOF |
$* | | $* |
EOF | | EOF |
exit 0 | | exit $EXIT_SUCCESS |
fi | | fi |
| | |
# The name of this program. | | |
progname=`$echo "$0" | ${SED} 's%^.*/%%'` | | |
modename="$progname" | | |
| | |
# Constants. | | |
PROGRAM=ltmain.sh | | |
PACKAGE=libtool | | |
VERSION=1.5.0a | | |
TIMESTAMP=" (1.1220.2.35 2003/11/12 18:51:58) Debian$Rev: 159 $" | | |
| | |
default_mode= | | default_mode= |
help="Try \`$progname --help' for more information." | | help="Try \`$progname --help' for more information." |
magic="%%%MAGIC variable%%%" | | magic="%%%MAGIC variable%%%" |
| | |
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then | | if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
$echo "$modename: not configured to build any kind of library" 1>&2 | | $echo "$modename: not configured to build any kind of library" 1>&2 |
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 | | $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# Global variables. | | # Global variables. |
| | |
# Shell function definitions: | | # Shell function definitions: |
# This seems to be the best place for them | | # This seems to be the best place for them |
| | |
| | # func_win32_libid arg |
| | # return the library type of file 'arg' |
| | # |
# Need a lot of goo to handle *both* DLLs and import libs | | # Need a lot of goo to handle *both* DLLs and import libs |
# Has to be a shell function in order to 'eat' the argument | | # Has to be a shell function in order to 'eat' the argument |
# that is supplied when $file_magic_command is called. | | # that is supplied when $file_magic_command is called. |
win32_libid () { | | func_win32_libid () { |
win32_libid_type="unknown" | | win32_libid_type="unknown" |
win32_fileres=`file -L $1 2>/dev/null` | | win32_fileres=`file -L $1 2>/dev/null` |
case $win32_fileres in | | case $win32_fileres in |
| | |
;; | | ;; |
*ar\ archive*) # could be an import, or static | | *ar\ archive*) # could be an import, or static |
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ | | if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ |
grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then | | $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then |
win32_nmres=`eval $NM -f posix -A $1 | \ | | win32_nmres=`eval $NM -f posix -A $1 | \ |
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` | | sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` |
if test "X$win32_nmres" = "Ximport" ; then | | if test "X$win32_nmres" = "Ximport" ; then |
| | |
$echo $win32_libid_type | | $echo $win32_libid_type |
} | | } |
| | |
| | |
| | # func_infer_tag arg |
| | # Infer tagged configuration to use if any are available and |
| | # if one wasn't chosen via the "--tag" command line option. |
| | # Only attempt this if the compiler in the base compile |
| | # command doesn't match the default compiler. |
| | # arg is usually of the form 'gcc ...' |
| | func_infer_tag () { |
| | if test -n "$available_tags" && test -z "$tagname"; then |
| | CC_quoted= |
| | for arg in $CC; do |
| | case $arg in |
| | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
| | arg="\"$arg\"" |
| | ;; |
| | esac |
| | CC_quoted="$CC_quoted $arg" |
| | done |
| | case $@ in |
| | # Blanks in the command may have been stripped by the calling shell, |
| | # but not from the CC environment variable when configure was run. |
| | " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; |
| | # Blanks at the start of $base_compile will cause this to fail |
| | # if we don't check for them as well. |
| | *) |
| | for z in $available_tags; do |
| | if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then |
| | # Evaluate the configuration. |
| | eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" |
| | CC_quoted= |
| | for arg in $CC; do |
| | # Double-quote args containing other shell metacharacters. |
| | case $arg in |
| | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
| | arg="\"$arg\"" |
| | ;; |
| | esac |
| | CC_quoted="$CC_quoted $arg" |
| | done |
| | case "$@ " in |
| | " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) |
| | # The compiler in the base compile command matches |
| | # the one in the tagged configuration. |
| | # Assume this is the tagged configuration we want. |
| | tagname=$z |
| | break |
| | ;; |
| | esac |
| | fi |
| | done |
| | # If $tagname still isn't set, then no tagged configuration |
| | # was found and let the user know that the "--tag" command |
| | # line option must be used. |
| | if test -z "$tagname"; then |
| | $echo "$modename: unable to infer tagged configuration" |
| | $echo "$modename: specify a tag with \`--tag'" 1>&2 |
| | exit $EXIT_FAILURE |
| | # else |
| | # $echo "$modename: using $tagname tagged configuration" |
| | fi |
| | ;; |
| | esac |
| | fi |
| | } |
# End of Shell function definitions | | # End of Shell function definitions |
##################################### | | ##################################### |
| | |
| | # Darwin sucks |
| | eval std_shrext=\"$shrext_cmds\" |
| | |
# Parse our command line options once, thoroughly. | | # Parse our command line options once, thoroughly. |
while test "$#" -gt 0 | | while test "$#" -gt 0 |
do | | do |
| | |
case $tagname in | | case $tagname in |
*[!-_A-Za-z0-9,/]*) | | *[!-_A-Za-z0-9,/]*) |
$echo "$progname: invalid tag name: $tagname" 1>&2 | | $echo "$progname: invalid tag name: $tagname" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
| | |
| | |
# not specially marked. | | # not specially marked. |
;; | | ;; |
*) | | *) |
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then | | if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then |
taglist="$taglist $tagname" | | taglist="$taglist $tagname" |
# Evaluate the configuration. | | # Evaluate the configuration. |
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" | | eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" |
else | | else |
$echo "$progname: ignoring unknown tag $tagname" 1>&2 | | $echo "$progname: ignoring unknown tag $tagname" 1>&2 |
fi | | fi |
| | |
$echo "Copyright (C) 2003 Free Software Foundation, Inc." | | $echo "Copyright (C) 2003 Free Software Foundation, Inc." |
$echo "This is free software; see the source for copying conditions. There is NO" | | $echo "This is free software; see the source for copying conditions. There is NO" |
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." | | $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
exit 0 | | exit $EXIT_SUCCESS |
;; | | ;; |
| | |
--config) | | --config) |
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 | | ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath |
# Now print the configurations for the tags. | | # Now print the configurations for the tags. |
for tagname in $taglist; do | | for tagname in $taglist; do |
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" | | ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" |
done | | done |
exit 0 | | exit $EXIT_SUCCESS |
;; | | ;; |
| | |
--debug) | | --debug) |
| | |
else | | else |
$echo "disable static libraries" | | $echo "disable static libraries" |
fi | | fi |
exit 0 | | exit $EXIT_SUCCESS |
;; | | ;; |
| | |
--finish) mode="finish" ;; | | --finish) mode="finish" ;; |
| | |
-*) | | -*) |
$echo "$modename: unrecognized option \`$arg'" 1>&2 | | $echo "$modename: unrecognized option \`$arg'" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
| | |
*) | | *) |
| | |
if test -n "$prevopt"; then | | if test -n "$prevopt"; then |
$echo "$modename: option \`$prevopt' requires an argument" 1>&2 | | $echo "$modename: option \`$prevopt' requires an argument" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# If this variable is set in any of the actions, the command in it | | # If this variable is set in any of the actions, the command in it |
| | |
if test -n "$execute_dlfiles" && test "$mode" != execute; then | | if test -n "$execute_dlfiles" && test "$mode" != execute; then |
$echo "$modename: unrecognized option \`-dlopen'" 1>&2 | | $echo "$modename: unrecognized option \`-dlopen'" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# Change the help message to a mode-specific one. | | # Change the help message to a mode-specific one. |
| | |
-o) | | -o) |
if test -n "$libobj" ; then | | if test -n "$libobj" ; then |
$echo "$modename: you cannot specify \`-o' more than once" 1>&2 | | $echo "$modename: you cannot specify \`-o' more than once" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
arg_mode=target | | arg_mode=target |
continue | | continue |
| | |
case $arg_mode in | | case $arg_mode in |
arg) | | arg) |
$echo "$modename: you must specify an argument for -Xcompile" | | $echo "$modename: you must specify an argument for -Xcompile" |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
target) | | target) |
$echo "$modename: you must specify a target with \`-o'" 1>&2 | | $echo "$modename: you must specify a target with \`-o'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
*) | | *) |
# Get the name of the library object. | | # Get the name of the library object. |
| | |
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; | | *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; |
*) | | *) |
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 | | $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
| | |
# Infer tagged configuration to use if any are available and | | func_infer_tag $base_compile |
# if one wasn't chosen via the "--tag" command line option. | | |
# Only attempt this if the compiler in the base compile | | |
# command doesn't match the default compiler. | | |
if test -n "$available_tags" && test -z "$tagname"; then | | |
case $base_compile in | | |
# Blanks in the command may have been stripped by the calling shell, | | |
# but not from the CC environment variable when configure was run. | | |
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; | | |
# Blanks at the start of $base_compile will cause this to fail | | |
# if we don't check for them as well. | | |
*) | | |
for z in $available_tags; do | | |
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then | | |
# Evaluate the configuration. | | |
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" | | |
case "$base_compile " in | | |
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) | | |
# The compiler in the base compile command matches | | |
# the one in the tagged configuration. | | |
# Assume this is the tagged configuration we want. | | |
tagname=$z | | |
break | | |
;; | | |
esac | | |
fi | | |
done | | |
# If $tagname still isn't set, then no tagged configuration | | |
# was found and let the user know that the "--tag" command | | |
# line option must be used. | | |
if test -z "$tagname"; then | | |
$echo "$modename: unable to infer tagged configuration" | | |
$echo "$modename: specify a tag with \`--tag'" 1>&2 | | |
exit 1 | | |
# else | | |
# $echo "$modename: using $tagname tagged configuration" | | |
fi | | |
;; | | |
esac | | |
fi | | |
| | |
for arg in $later; do | | for arg in $later; do |
case $arg in | | case $arg in |
| | |
if test -z "$base_compile"; then | | if test -z "$base_compile"; then |
$echo "$modename: you must specify a compilation command" 1>&2 | | $echo "$modename: you must specify a compilation command" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# Delete any leftover library objects. | | # Delete any leftover library objects. |
| | |
fi | | fi |
| | |
$run $rm $removelist | | $run $rm $removelist |
trap "$run $rm $removelist; exit 1" 1 2 15 | | trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 |
| | |
# On Cygwin there's no "real" PIC flag so we must build both object types | | # On Cygwin there's no "real" PIC flag so we must build both object types |
case $host_os in | | case $host_os in |
| | |
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} | | output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} |
lockfile="$output_obj.lock" | | lockfile="$output_obj.lock" |
removelist="$removelist $output_obj $lockfile" | | removelist="$removelist $output_obj $lockfile" |
trap "$run $rm $removelist; exit 1" 1 2 15 | | trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 |
else | | else |
output_obj= | | output_obj= |
need_locks=no | | need_locks=no |
| | |
# Lock this critical section if it is needed | | # Lock this critical section if it is needed |
# We use this script file to make the link, it avoids creating a new file | | # We use this script file to make the link, it avoids creating a new file |
if test "$need_locks" = yes; then | | if test "$need_locks" = yes; then |
until $run ln "$0" "$lockfile" 2>/dev/null; do | | until $run ln "$progpath" "$lockfile" 2>/dev/null; do |
$show "Waiting for $lockfile to be removed" | | $show "Waiting for $lockfile to be removed" |
sleep 2 | | sleep 2 |
done | | done |
| | |
compiler." | | compiler." |
| | |
$run $rm $removelist | | $run $rm $removelist |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
$echo $srcfile > "$lockfile" | | $echo $srcfile > "$lockfile" |
fi | | fi |
| | |
if $run eval "$command"; then : | | if $run eval "$command"; then : |
else | | else |
test -n "$output_obj" && $run $rm $removelist | | test -n "$output_obj" && $run $rm $removelist |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
if test "$need_locks" = warn && | | if test "$need_locks" = warn && |
| | |
compiler." | | compiler." |
| | |
$run $rm $removelist | | $run $rm $removelist |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# Just move the object if needed, then go on to compile the next one | | # Just move the object if needed, then go on to compile the next one |
| | |
if $run eval "$command"; then : | | if $run eval "$command"; then : |
else | | else |
$run $rm $removelist | | $run $rm $removelist |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
if test "$need_locks" = warn && | | if test "$need_locks" = warn && |
| | |
compiler." | | compiler." |
| | |
$run $rm $removelist | | $run $rm $removelist |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# Just move the object if needed | | # Just move the object if needed |
| | |
$run $rm "$lockfile" | | $run $rm "$lockfile" |
fi | | fi |
| | |
exit 0 | | exit $EXIT_SUCCESS |
;; | | ;; |
| | |
# libtool link mode | | # libtool link mode |
| | |
;; | | ;; |
esac | | esac |
libtool_args="$nonopt" | | libtool_args="$nonopt" |
base_compile="$nonopt" | | base_compile="$nonopt $@" |
compile_command="$nonopt" | | compile_command="$nonopt" |
finalize_command="$nonopt" | | finalize_command="$nonopt" |
| | |
| | |
no_install=no | | no_install=no |
objs= | | objs= |
non_pic_objects= | | non_pic_objects= |
| | precious_files_regex= |
prefer_static_libs=no | | prefer_static_libs=no |
preload=no | | preload=no |
prev= | | prev= |
| | |
vinfo= | | vinfo= |
vinfo_number=no | | vinfo_number=no |
| | |
# Infer tagged configuration to use if any are available and | | func_infer_tag $base_compile |
# if one wasn't chosen via the "--tag" command line option. | | |
# Only attempt this if the compiler in the base link | | |
# command doesn't match the default compiler. | | |
if test -n "$available_tags" && test -z "$tagname"; then | | |
case "$base_compile " in | | |
# Blanks in the command may have been stripped by the calling shell, | | |
# but not from the CC environment variable when configure was run. | | |
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;; | | |
# Blanks at the start of $base_compile will cause this to fail | | |
# if we don't check for them as well. | | |
*) | | |
for z in $available_tags; do | | |
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then | | |
# Evaluate the configuration. | | |
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" | | |
case "$base_compile " in | | |
"$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) | | |
# The compiler in $compile_command matches | | |
# the one in the tagged configuration. | | |
# Assume this is the tagged configuration we want. | | |
tagname=$z | | |
break | | |
;; | | |
esac | | |
fi | | |
done | | |
# If $tagname still isn't set, then no tagged configuration | | |
# was found and let the user know that the "--tag" command | | |
# line option must be used. | | |
if test -z "$tagname"; then | | |
$echo "$modename: unable to infer tagged configuration" | | |
$echo "$modename: specify a tag with \`--tag'" 1>&2 | | |
exit 1 | | |
# else | | |
# $echo "$modename: using $tagname tagged configuration" | | |
fi | | |
;; | | |
esac | | |
fi | | |
| | |
# We need to know -static, to get the right output filenames. | | # We need to know -static, to get the right output filenames. |
for arg | | for arg |
| | |
# Go through the arguments, transforming them on the way. | | # Go through the arguments, transforming them on the way. |
while test "$#" -gt 0; do | | while test "$#" -gt 0; do |
arg="$1" | | arg="$1" |
base_compile="$base_compile $arg" | | |
shift | | shift |
case $arg in | | case $arg in |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") | | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
| | |
export_symbols="$arg" | | export_symbols="$arg" |
if test ! -f "$arg"; then | | if test ! -f "$arg"; then |
$echo "$modename: symbol file \`$arg' does not exist" | | $echo "$modename: symbol file \`$arg' does not exist" |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
prev= | | prev= |
continue | | continue |
| | |
prev= | | prev= |
continue | | continue |
;; | | ;; |
| | precious_regex) |
| | precious_files_regex="$arg" |
| | prev= |
| | continue |
| | ;; |
release) | | release) |
release="-$arg" | | release="-$arg" |
prev= | | prev= |
| | |
test "$pic_object" = none && \ | | test "$pic_object" = none && \ |
test "$non_pic_object" = none; then | | test "$non_pic_object" = none; then |
$echo "$modename: cannot find name of object for \`$arg'" 1>&2 | | $echo "$modename: cannot find name of object for \`$arg'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# Extract subdirectory from the argument. | | # Extract subdirectory from the argument. |
| | |
# Only an error if not doing a dry-run. | | # Only an error if not doing a dry-run. |
if test -z "$run"; then | | if test -z "$run"; then |
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2 | | $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
else | | else |
# Dry-run case. | | # Dry-run case. |
| | |
| | |
done | | done |
else | | else |
$echo "$modename: link input file \`$save_arg' does not exist" | | $echo "$modename: link input file \`$save_arg' does not exist" |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
arg=$save_arg | | arg=$save_arg |
prev= | | prev= |
| | |
[\\/]* | [A-Za-z]:[\\/]*) ;; | | [\\/]* | [A-Za-z]:[\\/]*) ;; |
*) | | *) |
$echo "$modename: only absolute run-paths are allowed" 1>&2 | | $echo "$modename: only absolute run-paths are allowed" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
if test "$prev" = rpath; then | | if test "$prev" = rpath; then |
| | |
finalize_command="$finalize_command $qarg" | | finalize_command="$finalize_command $qarg" |
continue | | continue |
;; | | ;; |
| | shrext) |
| | shrext_cmds="$arg" |
| | prev= |
| | continue |
| | ;; |
*) | | *) |
eval "$prev=\"\$arg\"" | | eval "$prev=\"\$arg\"" |
prev= | | prev= |
| | |
-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: more than one -exported-symbols argument is not allowed" | | $echo "$modename: more than one -exported-symbols argument is not allowed" |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
if test "X$arg" = "X-export-symbols"; then | | if test "X$arg" = "X-export-symbols"; then |
prev=expsyms | | prev=expsyms |
| | |
absdir=`cd "$dir" && pwd` | | absdir=`cd "$dir" && pwd` |
if test -z "$absdir"; then | | if test -z "$absdir"; then |
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 | | $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
dir="$absdir" | | dir="$absdir" |
;; | | ;; |
| | |
| | |
-o) prev=output ;; | | -o) prev=output ;; |
| | |
| | -precious-files-regex) |
| | prev=precious_regex |
| | continue |
| | ;; |
| | |
-release) | | -release) |
prev=release | | prev=release |
continue | | continue |
| | |
[\\/]* | [A-Za-z]:[\\/]*) ;; | | [\\/]* | [A-Za-z]:[\\/]*) ;; |
*) | | *) |
$echo "$modename: only absolute run-paths are allowed" 1>&2 | | $echo "$modename: only absolute run-paths are allowed" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
case "$xrpath " in | | case "$xrpath " in |
| | |
test "$pic_object" = none && \ | | test "$pic_object" = none && \ |
test "$non_pic_object" = none; then | | test "$non_pic_object" = none; then |
$echo "$modename: cannot find name of object for \`$arg'" 1>&2 | | $echo "$modename: cannot find name of object for \`$arg'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# Extract subdirectory from the argument. | | # Extract subdirectory from the argument. |
| | |
# Only an error if not doing a dry-run. | | # Only an error if not doing a dry-run. |
if test -z "$run"; then | | if test -z "$run"; then |
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2 | | $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
else | | else |
# Dry-run case. | | # Dry-run case. |
| | |
| | |
if test -n "$prev"; then | | if test -n "$prev"; then |
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2 | | $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then | | if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then |
| | |
"") | | "") |
$echo "$modename: you must specify an output file" 1>&2 | | $echo "$modename: you must specify an output file" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
*.$libext) linkmode=oldlib ;; | | *.$libext) linkmode=oldlib ;; |
*.lo | *.$objext) linkmode=obj ;; | | *.lo | *.$objext) linkmode=obj ;; |
| | |
| | |
case $host in | | case $host in |
*cygwin* | *mingw* | *pw32*) | | *cygwin* | *mingw* | *pw32*) |
# don't eliminate duplcations in $postdeps and $predeps | | # don't eliminate duplications in $postdeps and $predeps |
duplicate_compiler_generated_deps=yes | | duplicate_compiler_generated_deps=yes |
;; | | ;; |
*) | | *) |
| | |
*.la) ;; | | *.la) ;; |
*) | | *) |
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 | | $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
done | | done |
| | |
case $pass in | | case $pass in |
dlopen) libs="$dlfiles" ;; | | dlopen) libs="$dlfiles" ;; |
dlpreopen) libs="$dlprefiles" ;; | | dlpreopen) libs="$dlprefiles" ;; |
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; | | link) |
| | libs="$deplibs %DEPLIBS%" |
| | test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" |
| | ;; |
esac | | esac |
fi | | fi |
if test "$pass" = dlopen; then | | if test "$pass" = dlopen; then |
| | |
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 | | $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 |
continue | | continue |
fi | | fi |
if test "$pass" = conv; then | | |
deplibs="$deplib $deplibs" | | |
continue | | |
fi | | |
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` | | name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do | | for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do |
for search_ext in .la $shrext .so .a; do | | for search_ext in .la $std_shrext .so .a; do |
# Search the libtool library | | # Search the libtool library |
lib="$searchdir/lib${name}${search_ext}" | | lib="$searchdir/lib${name}${search_ext}" |
if test -f "$lib"; then | | if test -f "$lib"; then |
| | |
fi | | fi |
if test "$pass" = scan; then | | if test "$pass" = scan; then |
deplibs="$deplib $deplibs" | | deplibs="$deplib $deplibs" |
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` | | |
else | | else |
compile_deplibs="$deplib $compile_deplibs" | | compile_deplibs="$deplib $compile_deplibs" |
finalize_deplibs="$deplib $finalize_deplibs" | | finalize_deplibs="$deplib $finalize_deplibs" |
fi | | fi |
| | newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
;; | | ;; |
*) | | *) |
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 | | $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 |
| | |
if test "$found" = yes || test -f "$lib"; then : | | if test "$found" = yes || test -f "$lib"; then : |
else | | else |
$echo "$modename: cannot find the library \`$lib'" 1>&2 | | $echo "$modename: cannot find the library \`$lib'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# 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 | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : | | if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
else | | else |
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` | | ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` |
| | |
if test -z "$libdir"; then | | if test -z "$libdir"; then |
if test -z "$old_library"; then | | if test -z "$old_library"; then |
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 | | $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
# It is a libtool convenience library, so add in its objects. | | # It is a libtool convenience library, so add in its objects. |
convenience="$convenience $ladir/$objdir/$old_library" | | convenience="$convenience $ladir/$objdir/$old_library" |
| | |
done | | done |
elif test "$linkmode" != prog && test "$linkmode" != lib; then | | elif test "$linkmode" != prog && test "$linkmode" != lib; then |
$echo "$modename: \`$lib' is not a convenience library" 1>&2 | | $echo "$modename: \`$lib' is not a convenience library" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
continue | | continue |
fi # $pass = conv | | fi # $pass = conv |
| | |
done | | done |
if test -z "$linklib"; then | | if test -z "$linklib"; then |
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 | | $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# This library was specified with -dlopen. | | # This library was specified with -dlopen. |
if test "$pass" = dlopen; then | | if test "$pass" = dlopen; then |
if test -z "$libdir"; then | | if test -z "$libdir"; then |
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 | | $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then | | if test -z "$dlname" || |
| | test "$dlopen_support" != yes || |
| | test "$build_libtool_libs" = no; then |
# If there is no dlname, no dlopen support or we're linking | | # If there is no dlname, no dlopen support or we're linking |
# statically, we need to preload. We also need to preload any | | # statically, we need to preload. We also need to preload any |
# dependent libraries so libltdl's deplib preloader doesn't | | # dependent libraries so libltdl's deplib preloader doesn't |
| | |
if test "$pass" = dlpreopen; then | | if test "$pass" = dlpreopen; then |
if test -z "$libdir"; then | | if test -z "$libdir"; then |
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 | | $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
# Prefer using a static library (so that no silly _DYNAMIC symbols | | # Prefer using a static library (so that no silly _DYNAMIC symbols |
# are required to link). | | # are required to link). |
| | |
fi | | fi |
# This is a shared library | | # This is a shared library |
| | |
# Warn about portability, can't link against -module's on some systems (darwin) | | # Warn about portability, can't link against -module's on |
| | # some systems (darwin) |
if test "$shouldnotlink" = yes && test "$pass" = link ; then | | if test "$shouldnotlink" = yes && test "$pass" = link ; then |
$echo | | $echo |
if test "$linkmode" = prog; then | | if test "$linkmode" = prog; then |
| | |
else | | else |
$show "extracting exported symbol list from \`$soname'" | | $show "extracting exported symbol list from \`$soname'" |
save_ifs="$IFS"; IFS='~' | | save_ifs="$IFS"; IFS='~' |
eval cmds=\"$extract_expsyms_cmds\" | | cmds=$extract_expsyms_cmds |
for cmd in $cmds; do | | for cmd in $cmds; do |
IFS="$save_ifs" | | IFS="$save_ifs" |
| | eval cmd=\"$cmd\" |
$show "$cmd" | | $show "$cmd" |
$run eval "$cmd" || exit $? | | $run eval "$cmd" || exit $? |
done | | done |
| | |
if test -f "$output_objdir/$newlib"; then :; else | | if test -f "$output_objdir/$newlib"; then :; else |
$show "generating import library for \`$soname'" | | $show "generating import library for \`$soname'" |
save_ifs="$IFS"; IFS='~' | | save_ifs="$IFS"; IFS='~' |
eval cmds=\"$old_archive_from_expsyms_cmds\" | | cmds=$old_archive_from_expsyms_cmds |
for cmd in $cmds; do | | for cmd in $cmds; do |
IFS="$save_ifs" | | IFS="$save_ifs" |
| | eval cmd=\"$cmd\" |
$show "$cmd" | | $show "$cmd" |
$run eval "$cmd" || exit $? | | $run eval "$cmd" || exit $? |
done | | done |
| | |
case $host in | | case $host in |
*-*-sco3.2v5* ) add_dir="-L$dir" ;; | | *-*-sco3.2v5* ) add_dir="-L$dir" ;; |
*-*-darwin* ) | | *-*-darwin* ) |
# if the lib is a module then we can not link against it, someone | | # if the lib is a module then we can not link against |
# is ignoring the new warnings I added | | # it, someone is ignoring the new warnings I added |
if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then | | if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then |
$echo "** Warning, lib $linklib is a module, not a shared library" | | $echo "** Warning, lib $linklib is a module, not a shared library" |
if test -z "$old_library" ; then | | if test -z "$old_library" ; then |
$echo | | $echo |
| | |
| | |
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 $EXIT_FAILURE |
fi | | fi |
| | |
if test -n "$add_shlibpath"; then | | if test -n "$add_shlibpath"; then |
| | |
esac | | esac |
add="-l$name" | | add="-l$name" |
elif test "$hardcode_automatic" = yes; then | | elif test "$hardcode_automatic" = yes; then |
if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then | | if test -n "$inst_prefix_dir" && |
| | test -f "$inst_prefix_dir$libdir/$linklib" ; then |
add="$inst_prefix_dir$libdir/$linklib" | | add="$inst_prefix_dir$libdir/$linklib" |
else | | else |
add="$libdir/$linklib" | | add="$libdir/$linklib" |
| | |
| | |
if test "$linkmode" = lib; then | | if test "$linkmode" = lib; then |
if test -n "$dependency_libs" && | | if test -n "$dependency_libs" && |
{ test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || | | { test "$hardcode_into_libs" != yes || |
| | test "$build_old_libs" = yes || |
test "$link_static" = yes; }; then | | test "$link_static" = yes; }; then |
# Extract -R from dependency_libs | | # Extract -R from dependency_libs |
temp_deplibs= | | temp_deplibs= |
| | |
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` | | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
if test -z "$libdir"; then | | if test -z "$libdir"; then |
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 | | $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
if test "$absdir" != "$libdir"; then | | if test "$absdir" != "$libdir"; then |
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 | | $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 |
| | |
depdepl= | | depdepl= |
case $host in | | case $host in |
*-*-darwin*) | | *-*-darwin*) |
# we do not want to link against static libs, but need to link against shared | | # we do not want to link against static libs, |
| | # but need to link against shared |
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` | | eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` |
if test -n "$deplibrary_names" ; then | | if test -n "$deplibrary_names" ; then |
for tmp in $deplibrary_names ; do | | for tmp in $deplibrary_names ; do |
| | |
*" $path "*) ;; | | *" $path "*) ;; |
*) newlib_search_path="$newlib_search_path $path";; | | *) newlib_search_path="$newlib_search_path $path";; |
esac | | esac |
path="" | | |
fi | | fi |
| | path="" |
;; | | ;; |
*) | | *) |
path="-L$path" | | path="-L$path" |
;; | | ;; |
esac | | esac |
| | |
;; | | ;; |
-l*) | | -l*) |
case $host in | | case $host in |
| | |
esac | | esac |
case " $deplibs " in | | case " $deplibs " in |
*" $depdepl "*) ;; | | *" $depdepl "*) ;; |
*) deplibs="$deplibs $depdepl" ;; | | *) deplibs="$depdepl $deplibs" ;; |
esac | | esac |
case " $deplibs " in | | case " $deplibs " in |
*" $path "*) ;; | | *" $path "*) ;; |
| | |
eval $var=\"$tmp_libs\" | | eval $var=\"$tmp_libs\" |
done # for var | | done # for var |
fi | | fi |
# Last step: remove runtime libs from dependency_libs (they stay in deplibs) | | # Last step: remove runtime libs from dependency_libs |
| | # (they stay in deplibs) |
tmp_libs= | | tmp_libs= |
for i in $dependency_libs ; do | | for i in $dependency_libs ; do |
case " $predeps $postdeps $compiler_lib_search_path " in | | case " $predeps $postdeps $compiler_lib_search_path " in |
| | |
case $outputname in | | case $outputname in |
lib*) | | lib*) |
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` | | name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
eval shared_ext=\"$shrext\" | | eval shared_ext=\"$shrext_cmds\" |
eval libname=\"$libname_spec\" | | eval libname=\"$libname_spec\" |
;; | | ;; |
*) | | *) |
if test "$module" = no; then | | if test "$module" = no; then |
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 | | $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
if test "$need_lib_prefix" != no; then | | if test "$need_lib_prefix" != no; then |
# Add the "lib" prefix for modules if required | | # Add the "lib" prefix for modules if required |
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` | | name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` |
eval shared_ext=\"$shrext\" | | eval shared_ext=\"$shrext_cmds\" |
eval libname=\"$libname_spec\" | | eval libname=\"$libname_spec\" |
else | | else |
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` | | libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` |
| | |
if test -n "$objs"; then | | if test -n "$objs"; then |
if test "$deplibs_check_method" != pass_all; then | | if test "$deplibs_check_method" != pass_all; then |
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 | | $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 |
exit 1 | | exit $EXIT_FAILURE |
else | | else |
$echo | | $echo |
$echo "*** Warning: Linking the shared library $output against the non-libtool" | | $echo "*** Warning: Linking the shared library $output against the non-libtool" |
| | |
if test -n "$8"; then | | if test -n "$8"; then |
$echo "$modename: too many parameters to \`-version-info'" 1>&2 | | $echo "$modename: too many parameters to \`-version-info'" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# convert absolute version numbers to libtool ages | | # convert absolute version numbers to libtool ages |
| | |
age="$number_minor" | | age="$number_minor" |
revision="$number_minor" | | revision="$number_minor" |
;; | | ;; |
| | *) |
| | $echo "$modename: unknown library version type \`$version_type'" 1>&2 |
| | $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
| | exit $EXIT_FAILURE |
| | ;; |
esac | | esac |
;; | | ;; |
no) | | no) |
| | |
*) | | *) |
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 | | $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 | | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
| | |
| | |
*) | | *) |
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 | | $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 | | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
| | |
| | |
*) | | *) |
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 | | $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 | | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
| | |
if test "$age" -gt "$current"; then | | if test "$age" -gt "$current"; then |
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 | | $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 | | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# Calculate the version variables. | | # Calculate the version variables. |
| | |
*) | | *) |
$echo "$modename: unknown library version type \`$version_type'" 1>&2 | | $echo "$modename: unknown library version type \`$version_type'" 1>&2 |
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 | | $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
| | |
| | |
*.$objext) | | *.$objext) |
;; | | ;; |
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) | | $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) |
| | if test "X$precious_files_regex" != "X"; then |
| | if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 |
| | then |
| | continue |
| | fi |
| | fi |
removelist="$removelist $p" | | removelist="$removelist $p" |
;; | | ;; |
*) ;; | | *) ;; |
| | |
fi | | fi |
| | |
# Get the real and link names of the library. | | # Get the real and link names of the library. |
eval shared_ext=\"$shrext\" | | eval shared_ext=\"$shrext_cmds\" |
eval library_names=\"$library_names_spec\" | | eval library_names=\"$library_names_spec\" |
set dummy $library_names | | set dummy $library_names |
realname="$2" | | realname="$2" |
| | |
$show "generating symbol list for \`$libname.la'" | | $show "generating symbol list for \`$libname.la'" |
export_symbols="$output_objdir/$libname.exp" | | export_symbols="$output_objdir/$libname.exp" |
$run $rm $export_symbols | | $run $rm $export_symbols |
eval cmds=\"$export_symbols_cmds\" | | cmds=$export_symbols_cmds |
save_ifs="$IFS"; IFS='~' | | save_ifs="$IFS"; IFS='~' |
for cmd in $cmds; do | | for cmd in $cmds; do |
IFS="$save_ifs" | | IFS="$save_ifs" |
| | eval cmd=\"$cmd\" |
if len=`expr "X$cmd" : ".*"` && | | if len=`expr "X$cmd" : ".*"` && |
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then | | test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
$show "$cmd" | | $show "$cmd" |
| | |
# Do each of the archive commands. | | # Do each of the archive commands. |
if test "$module" = yes && test -n "$module_cmds" ; then | | if test "$module" = yes && test -n "$module_cmds" ; then |
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then | | if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then |
eval cmds=\"$module_expsym_cmds\" | | eval test_cmds=\"$module_expsym_cmds\" |
| | cmds=$module_expsym_cmds |
else | | else |
eval cmds=\"$module_cmds\" | | eval test_cmds=\"$module_cmds\" |
| | cmds=$module_cmds |
fi | | fi |
else | | else |
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then | | if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then |
eval cmds=\"$archive_expsym_cmds\" | | eval test_cmds=\"$archive_expsym_cmds\" |
| | cmds=$archive_expsym_cmds |
else | | else |
eval cmds=\"$archive_cmds\" | | eval test_cmds=\"$archive_cmds\" |
| | cmds=$archive_cmds |
fi | | fi |
fi | | fi |
| | |
if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && | | if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && |
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then | | test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
: | | : |
else | | else |
| | |
# value of $libobjs for piecewise linking. | | # value of $libobjs for piecewise linking. |
| | |
# Do each of the archive commands. | | # Do each of the archive commands. |
| | if test "$module" = yes && test -n "$module_cmds" ; then |
| | if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then |
| | cmds=$module_expsym_cmds |
| | else |
| | cmds=$module_cmds |
| | fi |
| | else |
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then | | if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then |
eval cmds=\"$archive_expsym_cmds\" | | cmds=$archive_expsym_cmds |
else | | else |
eval cmds=\"$archive_cmds\" | | cmds=$archive_cmds |
| | fi |
fi | | fi |
| | |
# Append the command to remove the reloadable object files | | # Append the command to remove the reloadable object files |
# to the just-reset $cmds. | | # to the just-reset $cmds. |
eval cmds=\"\$cmds~$rm $delfiles\" | | eval cmds=\"\$cmds~\$rm $delfiles\" |
fi | | fi |
save_ifs="$IFS"; IFS='~' | | save_ifs="$IFS"; IFS='~' |
for cmd in $cmds; do | | for cmd in $cmds; do |
IFS="$save_ifs" | | IFS="$save_ifs" |
| | eval cmd=\"$cmd\" |
$show "$cmd" | | $show "$cmd" |
$run eval "$cmd" || exit $? | | $run eval "$cmd" || exit $? |
done | | done |
| | |
# Restore the uninstalled library and exit | | # Restore the uninstalled library and exit |
if test "$mode" = relink; then | | if test "$mode" = relink; then |
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? | | $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? |
exit 0 | | exit $EXIT_SUCCESS |
fi | | fi |
| | |
# Create links to the real library. | | # Create links to the real library. |
| | |
*.lo) | | *.lo) |
if test -n "$objs$old_deplibs"; then | | if test -n "$objs$old_deplibs"; then |
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 | | $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
libobj="$output" | | libobj="$output" |
obj=`$echo "X$output" | $Xsed -e "$lo2o"` | | obj=`$echo "X$output" | $Xsed -e "$lo2o"` |
| | |
reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test | | reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test |
| | |
output="$obj" | | output="$obj" |
eval cmds=\"$reload_cmds\" | | cmds=$reload_cmds |
save_ifs="$IFS"; IFS='~' | | save_ifs="$IFS"; IFS='~' |
for cmd in $cmds; do | | for cmd in $cmds; do |
IFS="$save_ifs" | | IFS="$save_ifs" |
| | eval cmd=\"$cmd\" |
$show "$cmd" | | $show "$cmd" |
$run eval "$cmd" || exit $? | | $run eval "$cmd" || exit $? |
done | | done |
| | |
$run ${rm}r $gentop | | $run ${rm}r $gentop |
fi | | fi |
| | |
exit 0 | | exit $EXIT_SUCCESS |
fi | | fi |
| | |
if test "$build_libtool_libs" != yes; then | | if test "$build_libtool_libs" != yes; then |
| | |
# accidentally link it into a program. | | # accidentally link it into a program. |
# $show "echo timestamp > $libobj" | | # $show "echo timestamp > $libobj" |
# $run eval "echo timestamp > $libobj" || exit $? | | # $run eval "echo timestamp > $libobj" || exit $? |
exit 0 | | exit $EXIT_SUCCESS |
fi | | fi |
| | |
if test -n "$pic_flag" || test "$pic_mode" != default; then | | if test -n "$pic_flag" || test "$pic_mode" != default; then |
# Only do commands if we really have different PIC objects. | | # Only do commands if we really have different PIC objects. |
reload_objs="$libobjs $reload_conv_objs" | | reload_objs="$libobjs $reload_conv_objs" |
output="$libobj" | | output="$libobj" |
eval cmds=\"$reload_cmds\" | | cmds=$reload_cmds |
save_ifs="$IFS"; IFS='~' | | save_ifs="$IFS"; IFS='~' |
for cmd in $cmds; do | | for cmd in $cmds; do |
IFS="$save_ifs" | | IFS="$save_ifs" |
| | eval cmd=\"$cmd\" |
$show "$cmd" | | $show "$cmd" |
$run eval "$cmd" || exit $? | | $run eval "$cmd" || exit $? |
done | | done |
| | |
$run ${rm}r $gentop | | $run ${rm}r $gentop |
fi | | fi |
| | |
exit 0 | | exit $EXIT_SUCCESS |
;; | | ;; |
| | |
prog) | | prog) |
| | |
;; | | ;; |
*) | | *) |
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 | | $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
else | | else |
| | |
# Link the executable and exit | | # Link the executable and exit |
$show "$link_command" | | $show "$link_command" |
$run eval "$link_command" || exit $? | | $run eval "$link_command" || exit $? |
exit 0 | | exit $EXIT_SUCCESS |
fi | | fi |
| | |
if test "$hardcode_action" = relink; then | | if test "$hardcode_action" = relink; then |
| | |
fi | | fi |
| | |
# Quote $echo for shipping. | | # Quote $echo for shipping. |
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then | | if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then |
case $0 in | | case $progpath in |
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; | | [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; |
*) qecho="$SHELL `pwd`/$0 --fallback-echo";; | | *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; |
esac | | esac |
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` | | qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` |
else | | else |
| | |
cwrappersource=`$echo ${objdir}/lt-${output}.c` | | cwrappersource=`$echo ${objdir}/lt-${output}.c` |
cwrapper=`$echo ${output}.exe` | | cwrapper=`$echo ${output}.exe` |
$rm $cwrappersource $cwrapper | | $rm $cwrappersource $cwrapper |
trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 | | trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 |
| | |
cat > $cwrappersource <<EOF | | cat > $cwrappersource <<EOF |
| | |
| | |
;; | | ;; |
esac | | esac |
$rm $output | | $rm $output |
trap "$rm $output; exit 1" 1 2 15 | | trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 |
| | |
$echo > $output "\ | | $echo > $output "\ |
#! $SHELL | | #! $SHELL |
| | |
else | | else |
$echo \"\$relink_command_output\" >&2 | | $echo \"\$relink_command_output\" >&2 |
$rm \"\$progdir/\$file\" | | $rm \"\$progdir/\$file\" |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
fi | | fi |
| | |
| | |
esac | | esac |
$echo >> $output "\ | | $echo >> $output "\ |
\$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" | | \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
else | | else |
# The program doesn't exist. | | # The program doesn't exist. |
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 | | \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 |
\$echo \"This script is just a wrapper for \$program.\" 1>&2 | | \$echo \"This script is just a wrapper for \$program.\" 1>&2 |
$echo \"See the $PACKAGE documentation for more information.\" 1>&2 | | $echo \"See the $PACKAGE documentation for more information.\" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
fi\ | | fi\ |
" | | " |
chmod +x $output | | chmod +x $output |
fi | | fi |
exit 0 | | exit $EXIT_SUCCESS |
;; | | ;; |
esac | | esac |
| | |
| | |
| | |
# Do each command in the archive commands. | | # Do each command in the archive commands. |
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then | | if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then |
eval cmds=\"$old_archive_from_new_cmds\" | | cmds=$old_archive_from_new_cmds |
else | | else |
eval cmds=\"$old_archive_cmds\" | | eval cmds=\"$old_archive_cmds\" |
| | |
if len=`expr "X$cmds" : ".*"` && | | if len=`expr "X$cmds" : ".*"` && |
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then | | test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
: | | cmds=$old_archive_cmds |
else | | else |
# the command line is too long to link in one step, link in parts | | # the command line is too long to link in one step, link in parts |
$echo "using piecewise archive linking..." | | $echo "using piecewise archive linking..." |
| | |
if test "X$oldobjs" = "X" ; then | | if test "X$oldobjs" = "X" ; then |
eval cmds=\"\$concat_cmds\" | | eval cmds=\"\$concat_cmds\" |
else | | else |
eval cmds=\"\$concat_cmds~$old_archive_cmds\" | | eval cmds=\"\$concat_cmds~\$old_archive_cmds\" |
fi | | fi |
fi | | fi |
fi | | fi |
save_ifs="$IFS"; IFS='~' | | save_ifs="$IFS"; IFS='~' |
for cmd in $cmds; do | | for cmd in $cmds; do |
| | eval cmd=\"$cmd\" |
IFS="$save_ifs" | | IFS="$save_ifs" |
$show "$cmd" | | $show "$cmd" |
$run eval "$cmd" || exit $? | | $run eval "$cmd" || exit $? |
| | |
fi | | fi |
done | | done |
# Quote the link command for shipping. | | # Quote the link command for shipping. |
relink_command="(cd `pwd`; $SHELL $0 $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" | | relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" |
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` | | relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` |
if test "$hardcode_automatic" = yes ; then | | if test "$hardcode_automatic" = yes ; then |
relink_command= | | relink_command= |
fi | | 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 | | for installed in no yes; do |
| | |
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` | | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
if test -z "$libdir"; then | | if test -z "$libdir"; then |
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 | | $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
newdependency_libs="$newdependency_libs $libdir/$name" | | newdependency_libs="$newdependency_libs $libdir/$name" |
;; | | ;; |
| | |
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` | | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` |
if test -z "$libdir"; then | | if test -z "$libdir"; then |
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
newdlfiles="$newdlfiles $libdir/$name" | | newdlfiles="$newdlfiles $libdir/$name" |
done | | done |
| | |
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` | | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` |
if test -z "$libdir"; then | | if test -z "$libdir"; then |
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
newdlprefiles="$newdlprefiles $libdir/$name" | | newdlprefiles="$newdlprefiles $libdir/$name" |
done | | done |
| | |
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? | | $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? |
;; | | ;; |
esac | | esac |
exit 0 | | exit $EXIT_SUCCESS |
;; | | ;; |
| | |
# libtool install mode | | # libtool install mode |
| | |
if test -z "$install_prog"; then | | if test -z "$install_prog"; then |
$echo "$modename: you must specify an install program" 1>&2 | | $echo "$modename: you must specify an install program" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
if test -n "$prev"; then | | if test -n "$prev"; then |
$echo "$modename: the \`$prev' option requires an argument" 1>&2 | | $echo "$modename: the \`$prev' option requires an argument" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
if test -z "$files"; then | | if test -z "$files"; then |
| | |
$echo "$modename: you must specify a destination" 1>&2 | | $echo "$modename: you must specify a destination" 1>&2 |
fi | | fi |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# Strip any trailing slash from the destination. | | # Strip any trailing slash from the destination. |
| | |
if test "$#" -gt 2; then | | if test "$#" -gt 2; then |
$echo "$modename: \`$dest' is not a directory" 1>&2 | | $echo "$modename: \`$dest' is not a directory" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
fi | | fi |
case $destdir in | | case $destdir in |
| | |
*) | | *) |
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 | | $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
done | | done |
| | |
else | | else |
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2 | | $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
library_names= | | library_names= |
| | |
# but it's something to keep an eye on. | | # but it's something to keep an eye on. |
if test "$inst_prefix_dir" = "$destdir"; then | | if test "$inst_prefix_dir" = "$destdir"; then |
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 | | $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
if test -n "$inst_prefix_dir"; then | | if test -n "$inst_prefix_dir"; then |
| | |
if $run eval "$relink_command"; then : | | if $run eval "$relink_command"; then : |
else | | else |
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 | | $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
fi | | fi |
| | |
| | |
| | |
# Do each command in the postinstall commands. | | # Do each command in the postinstall commands. |
lib="$destdir/$realname" | | lib="$destdir/$realname" |
eval cmds=\"$postinstall_cmds\" | | cmds=$postinstall_cmds |
save_ifs="$IFS"; IFS='~' | | save_ifs="$IFS"; IFS='~' |
for cmd in $cmds; do | | for cmd in $cmds; do |
IFS="$save_ifs" | | IFS="$save_ifs" |
| | eval cmd=\"$cmd\" |
$show "$cmd" | | $show "$cmd" |
$run eval "$cmd" || exit $? | | $run eval "$cmd" || exit $? |
done | | done |
| | |
*) | | *) |
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 | | $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
| | |
| | |
$show "$install_prog $staticobj $staticdest" | | $show "$install_prog $staticobj $staticdest" |
$run eval "$install_prog \$staticobj \$staticdest" || exit $? | | $run eval "$install_prog \$staticobj \$staticdest" || exit $? |
fi | | fi |
exit 0 | | exit $EXIT_SUCCESS |
;; | | ;; |
| | |
*) | | *) |
| | |
# Check the variables that should have been set. | | # Check the variables that should have been set. |
if test -z "$notinst_deplibs"; then | | if test -z "$notinst_deplibs"; then |
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 | | $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
finalize=yes | | finalize=yes |
| | |
tmpdir="/tmp" | | tmpdir="/tmp" |
test -n "$TMPDIR" && tmpdir="$TMPDIR" | | test -n "$TMPDIR" && tmpdir="$TMPDIR" |
tmpdir="$tmpdir/libtool-$$" | | tmpdir="$tmpdir/libtool-$$" |
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : | | save_umask=`umask` |
| | umask 0077 |
| | if $mkdir "$tmpdir"; then |
| | umask $save_umask |
else | | else |
| | umask $save_umask |
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 | | $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 |
continue | | continue |
fi | | fi |
| | |
$show "$install_prog $file $oldlib" | | $show "$install_prog $file $oldlib" |
$run eval "$install_prog \$file \$oldlib" || exit $? | | $run eval "$install_prog \$file \$oldlib" || exit $? |
| | |
if test -n "$stripme" && test -n "$striplib"; then | | if test -n "$stripme" && test -n "$old_striplib"; then |
$show "$old_striplib $oldlib" | | $show "$old_striplib $oldlib" |
$run eval "$old_striplib $oldlib" || exit $? | | $run eval "$old_striplib $oldlib" || exit $? |
fi | | fi |
| | |
# Do each command in the postinstall commands. | | # Do each command in the postinstall commands. |
eval cmds=\"$old_postinstall_cmds\" | | cmds=$old_postinstall_cmds |
save_ifs="$IFS"; IFS='~' | | save_ifs="$IFS"; IFS='~' |
for cmd in $cmds; do | | for cmd in $cmds; do |
IFS="$save_ifs" | | IFS="$save_ifs" |
| | eval cmd=\"$cmd\" |
$show "$cmd" | | $show "$cmd" |
$run eval "$cmd" || exit $? | | $run eval "$cmd" || exit $? |
done | | done |
| | |
if test -n "$current_libdirs"; then | | if test -n "$current_libdirs"; then |
# Maybe just do a dry run. | | # Maybe just do a dry run. |
test -n "$run" && current_libdirs=" -n$current_libdirs" | | test -n "$run" && current_libdirs=" -n$current_libdirs" |
exec_cmd='$SHELL $0 $preserve_args --finish$current_libdirs' | | exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' |
else | | else |
exit 0 | | exit $EXIT_SUCCESS |
fi | | fi |
;; | | ;; |
| | |
| | |
for libdir in $libdirs; do | | for libdir in $libdirs; do |
if test -n "$finish_cmds"; then | | if test -n "$finish_cmds"; then |
# Do each command in the finish commands. | | # Do each command in the finish commands. |
eval cmds=\"$finish_cmds\" | | cmds=$finish_cmds |
save_ifs="$IFS"; IFS='~' | | save_ifs="$IFS"; IFS='~' |
for cmd in $cmds; do | | for cmd in $cmds; do |
IFS="$save_ifs" | | IFS="$save_ifs" |
| | eval cmd=\"$cmd\" |
$show "$cmd" | | $show "$cmd" |
$run eval "$cmd" || admincmds="$admincmds | | $run eval "$cmd" || admincmds="$admincmds |
$cmd" | | $cmd" |
| | |
fi | | fi |
| | |
# Exit here if they wanted silent mode. | | # Exit here if they wanted silent mode. |
test "$show" = : && exit 0 | | test "$show" = : && exit $EXIT_SUCCESS |
| | |
$echo "----------------------------------------------------------------------" | | $echo "----------------------------------------------------------------------" |
$echo "Libraries have been installed in:" | | $echo "Libraries have been installed in:" |
| | |
$echo "See any operating system documentation about shared libraries for" | | $echo "See any operating system documentation about shared libraries for" |
$echo "more information, such as the ld(1) and ld.so(8) manual pages." | | $echo "more information, such as the ld(1) and ld.so(8) manual pages." |
$echo "----------------------------------------------------------------------" | | $echo "----------------------------------------------------------------------" |
exit 0 | | exit $EXIT_SUCCESS |
;; | | ;; |
| | |
# libtool execute mode | | # libtool execute mode |
| | |
if test -z "$cmd"; then | | if test -z "$cmd"; then |
$echo "$modename: you must specify a COMMAND" 1>&2 | | $echo "$modename: you must specify a COMMAND" 1>&2 |
$echo "$help" | | $echo "$help" |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# Handle -dlopen flags immediately. | | # Handle -dlopen flags immediately. |
| | |
if test ! -f "$file"; then | | if test ! -f "$file"; then |
$echo "$modename: \`$file' is not a file" 1>&2 | | $echo "$modename: \`$file' is not a file" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
dir= | | dir= |
| | |
else | | else |
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# Read the libtool library. | | # Read the libtool library. |
| | |
dir="$dir/$objdir" | | dir="$dir/$objdir" |
else | | else |
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 | | $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
;; | | ;; |
| | |
| | |
$echo "export $shlibpath_var" | | $echo "export $shlibpath_var" |
fi | | fi |
$echo "$cmd$args" | | $echo "$cmd$args" |
exit 0 | | exit $EXIT_SUCCESS |
fi | | fi |
;; | | ;; |
| | |
| | |
if test -z "$rm"; then | | if test -z "$rm"; then |
$echo "$modename: you must specify an RM program" 1>&2 | | $echo "$modename: you must specify an RM program" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
rmdirs= | | rmdirs= |
| | |
if test "$mode" = uninstall; then | | if test "$mode" = uninstall; then |
if test -n "$library_names"; then | | if test -n "$library_names"; then |
# Do each command in the postuninstall commands. | | # Do each command in the postuninstall commands. |
eval cmds=\"$postuninstall_cmds\" | | cmds=$postuninstall_cmds |
save_ifs="$IFS"; IFS='~' | | save_ifs="$IFS"; IFS='~' |
for cmd in $cmds; do | | for cmd in $cmds; do |
IFS="$save_ifs" | | IFS="$save_ifs" |
| | eval cmd=\"$cmd\" |
$show "$cmd" | | $show "$cmd" |
$run eval "$cmd" | | $run eval "$cmd" |
if test "$?" -ne 0 && test "$rmforce" != yes; then | | if test "$?" -ne 0 && test "$rmforce" != yes; then |
| | |
| | |
if test -n "$old_library"; then | | if test -n "$old_library"; then |
# Do each command in the old_postuninstall commands. | | # Do each command in the old_postuninstall commands. |
eval cmds=\"$old_postuninstall_cmds\" | | cmds=$old_postuninstall_cmds |
save_ifs="$IFS"; IFS='~' | | save_ifs="$IFS"; IFS='~' |
for cmd in $cmds; do | | for cmd in $cmds; do |
IFS="$save_ifs" | | IFS="$save_ifs" |
| | eval cmd=\"$cmd\" |
$show "$cmd" | | $show "$cmd" |
$run eval "$cmd" | | $run eval "$cmd" |
if test "$?" -ne 0 && test "$rmforce" != yes; then | | if test "$?" -ne 0 && test "$rmforce" != yes; then |
| | |
"") | | "") |
$echo "$modename: you must specify a MODE" 1>&2 | | $echo "$modename: you must specify a MODE" 1>&2 |
$echo "$generic_help" 1>&2 | | $echo "$generic_help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
| | |
if test -z "$exec_cmd"; then | | if test -z "$exec_cmd"; then |
$echo "$modename: invalid operation mode \`$mode'" 1>&2 | | $echo "$modename: invalid operation mode \`$mode'" 1>&2 |
$echo "$generic_help" 1>&2 | | $echo "$generic_help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
fi # test -z "$show_help" | | fi # test -z "$show_help" |
| | |
if test -n "$exec_cmd"; then | | if test -n "$exec_cmd"; then |
eval exec $exec_cmd | | eval exec $exec_cmd |
exit 1 | | exit $EXIT_FAILURE |
fi | | fi |
| | |
# We need to display help for each of the modes. | | # We need to display help for each of the modes. |
| | |
a more detailed description of MODE. | | a more detailed description of MODE. |
| | |
Report bugs to <bug-libtool@gnu.org>." | | Report bugs to <bug-libtool@gnu.org>." |
exit 0 | | exit $EXIT_SUCCESS |
;; | | ;; |
| | |
clean) | | clean) |
| | |
-no-undefined declare that a library does not refer to external symbols | | -no-undefined declare that a library does not refer to external symbols |
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects | | -o OUTPUT-FILE create OUTPUT-FILE from the specified objects |
-objectlist FILE Use a list of object files found in FILE to specify objects | | -objectlist FILE Use a list of object files found in FILE to specify objects |
| | -precious-files-regex REGEX |
| | don't remove output files matching REGEX |
-release RELEASE specify package release information | | -release RELEASE specify package release information |
-rpath LIBDIR the created library will eventually be installed in LIBDIR | | -rpath LIBDIR the created library will eventually be installed in LIBDIR |
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries | | -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries |
| | |
*) | | *) |
$echo "$modename: invalid operation mode \`$mode'" 1>&2 | | $echo "$modename: invalid operation mode \`$mode'" 1>&2 |
$echo "$help" 1>&2 | | $echo "$help" 1>&2 |
exit 1 | | exit $EXIT_FAILURE |
;; | | ;; |
esac | | esac |
| | |
$echo | | $echo |
$echo "Try \`$modename --help' for more information about other modes." | | $echo "Try \`$modename --help' for more information about other modes." |
| | |
exit 0 | | exit $EXIT_SUCCESS |
| | |
# The TAGs below are defined such that we never get into a situation | | # The TAGs below are defined such that we never get into a situation |
# in which we disable both kinds of libraries. Given conflicting | | # in which we disable both kinds of libraries. Given conflicting |