| 1 |
# ltmain.sh - Provide generalized library-building support services. |
# ltmain.sh - Provide generalized library-building support services. |
| 2 |
# NOTE: Changing this file will not affect anything until you rerun configure. |
# NOTE: Changing this file will not affect anything until you rerun configure. |
| 3 |
# |
# |
| 4 |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 |
| 5 |
# Free Software Foundation, Inc. |
# Free Software Foundation, Inc. |
| 6 |
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
| 7 |
# |
# |
| 17 |
# |
# |
| 18 |
# You should have received a copy of the GNU General Public License |
# You should have received a copy of the GNU General Public License |
| 19 |
# along with this program; if not, write to the Free Software |
# along with this program; if not, write to the Free Software |
| 20 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 21 |
# |
# |
| 22 |
# As a special exception to the GNU General Public License, if you |
# As a special exception to the GNU General Public License, if you |
| 23 |
# distribute this file as part of a program that contains a |
# distribute this file as part of a program that contains a |
| 33 |
# function. |
# function. |
| 34 |
progpath="$0" |
progpath="$0" |
| 35 |
|
|
| 36 |
# Modification by PH (26-Aug-2004, originally 18-Feb-2003) to ensure that |
# define SED for historic ltconfig's generated by Libtool 1.3 |
| 37 |
# ${SED} is always set (it is not set on my system). |
test -z "$SED" && SED=sed |
|
|
|
|
case "X${SED}" in |
|
|
X) SED=sed ;; |
|
|
esac |
|
| 38 |
|
|
| 39 |
# The name of this program: |
# The name of this program: |
| 40 |
progname=`echo "$progpath" | $SED $basename` |
progname=`echo "$progpath" | $SED $basename` |
| 46 |
|
|
| 47 |
PROGRAM=ltmain.sh |
PROGRAM=ltmain.sh |
| 48 |
PACKAGE=libtool |
PACKAGE=libtool |
| 49 |
VERSION=1.5.8 |
VERSION=1.5.22 |
| 50 |
TIMESTAMP=" (1.1220.2.117 2004/08/04 14:12:05)" |
TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" |
| 51 |
|
|
| 52 |
# See if we are running on zsh, and set the options which allow our |
# See if we are running on zsh, and set the options which allow our |
| 53 |
# commands through without removal of \ escapes. |
# commands through without removal of \ escapes. |
| 54 |
if test -n "${ZSH_VERSION+set}" ; then |
if test -n "${ZSH_VERSION+set}" ; then |
| 55 |
setopt NO_GLOB_SUBST |
setopt NO_GLOB_SUBST |
| 56 |
fi |
fi |
| 57 |
|
# Same for EGREP, and just to be sure, do LTCC as well |
| 58 |
|
if test "X$EGREP" = X ; then |
| 59 |
|
EGREP=egrep |
| 60 |
|
fi |
| 61 |
|
if test "X$LTCC" = X ; then |
| 62 |
|
LTCC=${CC-gcc} |
| 63 |
|
fi |
| 64 |
|
|
| 65 |
# Check that we have a working $echo. |
# Check that we have a working $echo. |
| 66 |
if test "X$1" = X--no-reexec; then |
if test "X$1" = X--no-reexec; then |
| 98 |
Xsed="${SED}"' -e 1s/^X//' |
Xsed="${SED}"' -e 1s/^X//' |
| 99 |
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' |
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' |
| 100 |
# test EBCDIC or ASCII |
# test EBCDIC or ASCII |
| 101 |
case `echo A|tr A '\301'` in |
case `echo X|tr X '\101'` in |
| 102 |
A) # EBCDIC based system |
A) # ASCII based system |
| 103 |
SP2NL="tr '\100' '\n'" |
# \n is not interpreted correctly by Solaris 8 /usr/ucb/tr |
| 104 |
NL2SP="tr '\r\n' '\100\100'" |
SP2NL='tr \040 \012' |
| 105 |
|
NL2SP='tr \015\012 \040\040' |
| 106 |
;; |
;; |
| 107 |
*) # Assume ASCII based system |
*) # EBCDIC based system |
| 108 |
SP2NL="tr '\040' '\012'" |
SP2NL='tr \100 \n' |
| 109 |
NL2SP="tr '\015\012' '\040\040'" |
NL2SP='tr \r\n \100\100' |
| 110 |
;; |
;; |
| 111 |
esac |
esac |
| 112 |
|
|
| 123 |
fi |
fi |
| 124 |
|
|
| 125 |
# Make sure IFS has a sensible default |
# Make sure IFS has a sensible default |
| 126 |
: ${IFS=" |
lt_nl=' |
| 127 |
"} |
' |
| 128 |
|
IFS=" $lt_nl" |
| 129 |
|
|
| 130 |
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
| 131 |
$echo "$modename: not configured to build any kind of library" 1>&2 |
$echo "$modename: not configured to build any kind of library" 1>&2 |
| 142 |
show="$echo" |
show="$echo" |
| 143 |
show_help= |
show_help= |
| 144 |
execute_dlfiles= |
execute_dlfiles= |
| 145 |
|
duplicate_deps=no |
| 146 |
|
preserve_args= |
| 147 |
lo2o="s/\\.lo\$/.${objext}/" |
lo2o="s/\\.lo\$/.${objext}/" |
| 148 |
o2lo="s/\\.${objext}\$/.lo/" |
o2lo="s/\\.${objext}\$/.lo/" |
| 149 |
|
|
| 150 |
|
if test -z "$max_cmd_len"; then |
| 151 |
|
i=0 |
| 152 |
|
testring="ABCD" |
| 153 |
|
new_result= |
| 154 |
|
|
| 155 |
|
# If test is not a shell built-in, we'll probably end up computing a |
| 156 |
|
# maximum length that is only half of the actual maximum length, but |
| 157 |
|
# we can't tell. |
| 158 |
|
while (test "X"`$SHELL $0 --fallback-echo "X$testring" 2>/dev/null` \ |
| 159 |
|
= "XX$testring") >/dev/null 2>&1 && |
| 160 |
|
new_result=`expr "X$testring" : ".*" 2>&1` && |
| 161 |
|
max_cmd_len="$new_result" && |
| 162 |
|
test "$i" != 17 # 1/2 MB should be enough |
| 163 |
|
do |
| 164 |
|
i=`expr $i + 1` |
| 165 |
|
testring="$testring$testring" |
| 166 |
|
done |
| 167 |
|
testring= |
| 168 |
|
# Add a significant safety factor because C++ compilers can tack on massive |
| 169 |
|
# amounts of additional arguments before passing them to the linker. |
| 170 |
|
# It appears as though 1/2 is a usable value. |
| 171 |
|
max_cmd_len=`expr $max_cmd_len \/ 2` |
| 172 |
|
fi |
| 173 |
|
|
| 174 |
##################################### |
##################################### |
| 175 |
# Shell function definitions: |
# Shell function definitions: |
| 176 |
# This seems to be the best place for them |
# This seems to be the best place for them |
| 177 |
|
|
| 178 |
|
# func_mktempdir [string] |
| 179 |
|
# Make a temporary directory that won't clash with other running |
| 180 |
|
# libtool processes, and avoids race conditions if possible. If |
| 181 |
|
# given, STRING is the basename for that directory. |
| 182 |
|
func_mktempdir () |
| 183 |
|
{ |
| 184 |
|
my_template="${TMPDIR-/tmp}/${1-$progname}" |
| 185 |
|
|
| 186 |
|
if test "$run" = ":"; then |
| 187 |
|
# Return a directory name, but don't create it in dry-run mode |
| 188 |
|
my_tmpdir="${my_template}-$$" |
| 189 |
|
else |
| 190 |
|
|
| 191 |
|
# If mktemp works, use that first and foremost |
| 192 |
|
my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` |
| 193 |
|
|
| 194 |
|
if test ! -d "$my_tmpdir"; then |
| 195 |
|
# Failing that, at least try and use $RANDOM to avoid a race |
| 196 |
|
my_tmpdir="${my_template}-${RANDOM-0}$$" |
| 197 |
|
|
| 198 |
|
save_mktempdir_umask=`umask` |
| 199 |
|
umask 0077 |
| 200 |
|
$mkdir "$my_tmpdir" |
| 201 |
|
umask $save_mktempdir_umask |
| 202 |
|
fi |
| 203 |
|
|
| 204 |
|
# If we're not in dry-run mode, bomb out on failure |
| 205 |
|
test -d "$my_tmpdir" || { |
| 206 |
|
$echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 |
| 207 |
|
exit $EXIT_FAILURE |
| 208 |
|
} |
| 209 |
|
fi |
| 210 |
|
|
| 211 |
|
$echo "X$my_tmpdir" | $Xsed |
| 212 |
|
} |
| 213 |
|
|
| 214 |
|
|
| 215 |
# func_win32_libid arg |
# func_win32_libid arg |
| 216 |
# return the library type of file 'arg' |
# return the library type of file 'arg' |
| 217 |
# |
# |
| 218 |
# Need a lot of goo to handle *both* DLLs and import libs |
# Need a lot of goo to handle *both* DLLs and import libs |
| 219 |
# Has to be a shell function in order to 'eat' the argument |
# Has to be a shell function in order to 'eat' the argument |
| 220 |
# that is supplied when $file_magic_command is called. |
# that is supplied when $file_magic_command is called. |
| 221 |
func_win32_libid () { |
func_win32_libid () |
| 222 |
|
{ |
| 223 |
win32_libid_type="unknown" |
win32_libid_type="unknown" |
| 224 |
win32_fileres=`file -L $1 2>/dev/null` |
win32_fileres=`file -L $1 2>/dev/null` |
| 225 |
case $win32_fileres in |
case $win32_fileres in |
| 230 |
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ |
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ |
| 231 |
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then |
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then |
| 232 |
win32_nmres=`eval $NM -f posix -A $1 | \ |
win32_nmres=`eval $NM -f posix -A $1 | \ |
| 233 |
sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` |
$SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` |
| 234 |
if test "X$win32_nmres" = "Ximport" ; then |
case $win32_nmres in |
| 235 |
win32_libid_type="x86 archive import" |
import*) win32_libid_type="x86 archive import";; |
| 236 |
else |
*) win32_libid_type="x86 archive static";; |
| 237 |
win32_libid_type="x86 archive static" |
esac |
|
fi |
|
| 238 |
fi |
fi |
| 239 |
;; |
;; |
| 240 |
*DLL*) |
*DLL*) |
| 258 |
# Only attempt this if the compiler in the base compile |
# Only attempt this if the compiler in the base compile |
| 259 |
# command doesn't match the default compiler. |
# command doesn't match the default compiler. |
| 260 |
# arg is usually of the form 'gcc ...' |
# arg is usually of the form 'gcc ...' |
| 261 |
func_infer_tag () { |
func_infer_tag () |
| 262 |
|
{ |
| 263 |
if test -n "$available_tags" && test -z "$tagname"; then |
if test -n "$available_tags" && test -z "$tagname"; then |
| 264 |
CC_quoted= |
CC_quoted= |
| 265 |
for arg in $CC; do |
for arg in $CC; do |
| 266 |
case $arg in |
case $arg in |
| 267 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
| 268 |
arg="\"$arg\"" |
arg="\"$arg\"" |
| 269 |
;; |
;; |
| 270 |
esac |
esac |
| 291 |
esac |
esac |
| 292 |
CC_quoted="$CC_quoted $arg" |
CC_quoted="$CC_quoted $arg" |
| 293 |
done |
done |
| 294 |
|
# user sometimes does CC=<HOST>-gcc so we need to match that to 'gcc' |
| 295 |
|
trimedcc=`echo ${CC} | $SED -e "s/${host}-//g"` |
| 296 |
|
# and sometimes libtool has CC=<HOST>-gcc but user does CC=gcc |
| 297 |
|
extendcc=${host}-${CC} |
| 298 |
|
# and sometimes libtool has CC=<OLDHOST>-gcc but user has CC=<NEWHOST>-gcc |
| 299 |
|
# (Gentoo-specific hack because we always export $CHOST) |
| 300 |
|
mungedcc=${CHOST-${host}}-${trimedcc} |
| 301 |
case "$@ " in |
case "$@ " in |
| 302 |
|
"cc "* | " cc "* | "${host}-cc "* | " ${host}-cc "*|\ |
| 303 |
|
"gcc "* | " gcc "* | "${host}-gcc "* | " ${host}-gcc "*) |
| 304 |
|
tagname=CC |
| 305 |
|
break ;; |
| 306 |
|
"$trimedcc "* | " $trimedcc "* | "`$echo $trimedcc` "* | " `$echo $trimedcc` "*|\ |
| 307 |
|
"$extendcc "* | " $extendcc "* | "`$echo $extendcc` "* | " `$echo $extendcc` "*|\ |
| 308 |
|
"$mungedcc "* | " $mungedcc "* | "`$echo $mungedcc` "* | " `$echo $mungedcc` "*|\ |
| 309 |
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) |
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) |
| 310 |
# The compiler in the base compile command matches |
# The compiler in the base compile command matches |
| 311 |
# the one in the tagged configuration. |
# the one in the tagged configuration. |
| 332 |
} |
} |
| 333 |
|
|
| 334 |
|
|
| 335 |
|
# func_extract_an_archive dir oldlib |
| 336 |
|
func_extract_an_archive () |
| 337 |
|
{ |
| 338 |
|
f_ex_an_ar_dir="$1"; shift |
| 339 |
|
f_ex_an_ar_oldlib="$1" |
| 340 |
|
|
| 341 |
|
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" |
| 342 |
|
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? |
| 343 |
|
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then |
| 344 |
|
: |
| 345 |
|
else |
| 346 |
|
$echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 |
| 347 |
|
exit $EXIT_FAILURE |
| 348 |
|
fi |
| 349 |
|
} |
| 350 |
|
|
| 351 |
# func_extract_archives gentop oldlib ... |
# func_extract_archives gentop oldlib ... |
| 352 |
func_extract_archives () { |
func_extract_archives () |
| 353 |
|
{ |
| 354 |
my_gentop="$1"; shift |
my_gentop="$1"; shift |
| 355 |
my_oldlibs=${1+"$@"} |
my_oldlibs=${1+"$@"} |
| 356 |
my_oldobjs="" |
my_oldobjs="" |
| 381 |
$run ${rm}r "$my_xdir" |
$run ${rm}r "$my_xdir" |
| 382 |
$show "$mkdir $my_xdir" |
$show "$mkdir $my_xdir" |
| 383 |
$run $mkdir "$my_xdir" |
$run $mkdir "$my_xdir" |
| 384 |
status=$? |
exit_status=$? |
| 385 |
if test "$status" -ne 0 && test ! -d "$my_xdir"; then |
if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then |
| 386 |
exit $status |
exit $exit_status |
| 387 |
fi |
fi |
| 388 |
case $host in |
case $host in |
| 389 |
*-darwin*) |
*-darwin*) |
| 394 |
cd $my_xdir || exit $? |
cd $my_xdir || exit $? |
| 395 |
darwin_archive=$my_xabs |
darwin_archive=$my_xabs |
| 396 |
darwin_curdir=`pwd` |
darwin_curdir=`pwd` |
| 397 |
darwin_base_archive=`basename $darwin_archive` |
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` |
| 398 |
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` |
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` |
| 399 |
if test -n "$darwin_arches"; then |
if test -n "$darwin_arches"; then |
| 400 |
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` |
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` |
| 401 |
darwin_arch= |
darwin_arch= |
| 402 |
$show "$darwin_base_archive has multiple architectures $darwin_arches" |
$show "$darwin_base_archive has multiple architectures $darwin_arches" |
| 403 |
for darwin_arch in $darwin_arches ; do |
for darwin_arch in $darwin_arches ; do |
| 404 |
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" |
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" |
| 405 |
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" |
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" |
|
# Remove the table of contents from the thin files. |
|
|
$AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true |
|
|
$AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true |
|
| 406 |
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" |
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" |
| 407 |
$AR -xo "${darwin_base_archive}" |
func_extract_an_archive "`pwd`" "${darwin_base_archive}" |
|
rm "${darwin_base_archive}" |
|
| 408 |
cd "$darwin_curdir" |
cd "$darwin_curdir" |
| 409 |
|
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" |
| 410 |
done # $darwin_arches |
done # $darwin_arches |
| 411 |
## Okay now we have a bunch of thin objects, gotta fatten them up :) |
## Okay now we have a bunch of thin objects, gotta fatten them up :) |
| 412 |
darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP` |
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` |
| 413 |
darwin_file= |
darwin_file= |
| 414 |
darwin_files= |
darwin_files= |
| 415 |
for darwin_file in $darwin_filelist; do |
for darwin_file in $darwin_filelist; do |
| 416 |
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` |
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` |
| 417 |
lipo -create -output "$darwin_file" $darwin_files |
lipo -create -output "$darwin_file" $darwin_files |
| 418 |
done # $darwin_filelist |
done # $darwin_filelist |
| 419 |
rm -rf unfat-$$ |
${rm}r unfat-$$ |
| 420 |
cd "$darwin_orig_dir" |
cd "$darwin_orig_dir" |
| 421 |
else |
else |
| 422 |
cd $darwin_orig_dir |
cd "$darwin_orig_dir" |
| 423 |
(cd $my_xdir && $AR x $my_xabs) || exit $? |
func_extract_an_archive "$my_xdir" "$my_xabs" |
| 424 |
fi # $darwin_arches |
fi # $darwin_arches |
| 425 |
fi # $run |
fi # $run |
|
;; |
|
|
*) |
|
|
# We will extract separately just the conflicting names and we will |
|
|
# no longer touch any unique names. It is faster to leave these |
|
|
# extract automatically by $AR in one run. |
|
|
$show "(cd $my_xdir && $AR x $my_xabs)" |
|
|
$run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $? |
|
|
if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then |
|
|
: |
|
|
else |
|
|
$echo "$modename: warning: object name conflicts; renaming object files" 1>&2 |
|
|
$echo "$modename: warning: to ensure that they will not overwrite" 1>&2 |
|
|
$AR t "$my_xabs" | sort | uniq -cd | while read -r count name |
|
|
do |
|
|
i=1 |
|
|
while test "$i" -le "$count" |
|
|
do |
|
|
# Put our $i before any first dot (extension) |
|
|
# Never overwrite any file |
|
|
name_to="$name" |
|
|
while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to" |
|
|
do |
|
|
name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` |
|
|
done |
|
|
$show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')" |
|
|
$run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $? |
|
|
i=`expr $i + 1` |
|
|
done |
|
|
done |
|
|
fi |
|
| 426 |
;; |
;; |
| 427 |
|
*) |
| 428 |
|
func_extract_an_archive "$my_xdir" "$my_xabs" |
| 429 |
|
;; |
| 430 |
esac |
esac |
| 431 |
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` |
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` |
| 432 |
done |
done |
|
|
|
| 433 |
func_extract_archives_result="$my_oldobjs" |
func_extract_archives_result="$my_oldobjs" |
| 434 |
} |
} |
| 435 |
# End of Shell function definitions |
# End of Shell function definitions |
| 438 |
# Darwin sucks |
# Darwin sucks |
| 439 |
eval std_shrext=\"$shrext_cmds\" |
eval std_shrext=\"$shrext_cmds\" |
| 440 |
|
|
| 441 |
|
disable_libs=no |
| 442 |
|
|
| 443 |
# Parse our command line options once, thoroughly. |
# Parse our command line options once, thoroughly. |
| 444 |
while test "$#" -gt 0 |
while test "$#" -gt 0 |
| 445 |
do |
do |
| 504 |
--version) |
--version) |
| 505 |
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" |
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" |
| 506 |
$echo |
$echo |
| 507 |
$echo "Copyright (C) 2003 Free Software Foundation, Inc." |
$echo "Copyright (C) 2005 Free Software Foundation, Inc." |
| 508 |
$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" |
| 509 |
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
| 510 |
exit $EXIT_SUCCESS |
exit $? |
| 511 |
;; |
;; |
| 512 |
|
|
| 513 |
--config) |
--config) |
| 516 |
for tagname in $taglist; do |
for tagname in $taglist; do |
| 517 |
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" |
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" |
| 518 |
done |
done |
| 519 |
exit $EXIT_SUCCESS |
exit $? |
| 520 |
;; |
;; |
| 521 |
|
|
| 522 |
--debug) |
--debug) |
| 541 |
else |
else |
| 542 |
$echo "disable static libraries" |
$echo "disable static libraries" |
| 543 |
fi |
fi |
| 544 |
exit $EXIT_SUCCESS |
exit $? |
| 545 |
;; |
;; |
| 546 |
|
|
| 547 |
--finish) mode="finish" ;; |
--finish) mode="finish" ;; |
| 556 |
preserve_args="$preserve_args $arg" |
preserve_args="$preserve_args $arg" |
| 557 |
;; |
;; |
| 558 |
|
|
| 559 |
--tag) prevopt="--tag" prev=tag ;; |
--tag) |
| 560 |
|
prevopt="--tag" |
| 561 |
|
prev=tag |
| 562 |
|
preserve_args="$preserve_args --tag" |
| 563 |
|
;; |
| 564 |
--tag=*) |
--tag=*) |
| 565 |
set tag "$optarg" ${1+"$@"} |
set tag "$optarg" ${1+"$@"} |
| 566 |
shift |
shift |
| 592 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
| 593 |
fi |
fi |
| 594 |
|
|
| 595 |
|
case $disable_libs in |
| 596 |
|
no) |
| 597 |
|
;; |
| 598 |
|
shared) |
| 599 |
|
build_libtool_libs=no |
| 600 |
|
build_old_libs=yes |
| 601 |
|
;; |
| 602 |
|
static) |
| 603 |
|
build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` |
| 604 |
|
;; |
| 605 |
|
esac |
| 606 |
|
|
| 607 |
# 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 |
| 608 |
# will be execed at the end. This prevents here-documents from being |
# will be execed at the end. This prevents here-documents from being |
| 609 |
# left over by shells. |
# left over by shells. |
| 614 |
# Infer the operation mode. |
# Infer the operation mode. |
| 615 |
if test -z "$mode"; then |
if test -z "$mode"; then |
| 616 |
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 |
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 |
| 617 |
$echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 |
$echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 |
| 618 |
case $nonopt in |
case $nonopt in |
| 619 |
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) |
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) |
| 620 |
mode=link |
mode=link |
| 680 |
|
|
| 681 |
for arg |
for arg |
| 682 |
do |
do |
| 683 |
case "$arg_mode" in |
case $arg_mode in |
| 684 |
arg ) |
arg ) |
| 685 |
# do not "continue". Instead, add this to base_compile |
# do not "continue". Instead, add this to base_compile |
| 686 |
lastarg="$arg" |
lastarg="$arg" |
| 716 |
;; |
;; |
| 717 |
|
|
| 718 |
-Xcompiler) |
-Xcompiler) |
| 719 |
arg_mode=arg # the next one goes into the "base_compile" arg list |
arg_mode=arg # the next one goes into the "base_compile" arg list |
| 720 |
continue # The current "srcfile" will either be retained or |
continue # The current "srcfile" will either be retained or |
| 721 |
;; # replaced later. I would guess that would be a bug. |
;; # replaced later. I would guess that would be a bug. |
| 722 |
|
|
| 723 |
-Wc,*) |
-Wc,*) |
| 724 |
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` |
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` |
| 725 |
lastarg= |
lastarg= |
| 726 |
save_ifs="$IFS"; IFS=',' |
save_ifs="$IFS"; IFS=',' |
| 727 |
for arg in $args; do |
for arg in $args; do |
| 728 |
IFS="$save_ifs" |
IFS="$save_ifs" |
| 729 |
|
|
| 730 |
# Double-quote args containing other shell metacharacters. |
# Double-quote args containing other shell metacharacters. |
| 762 |
case $lastarg in |
case $lastarg in |
| 763 |
# Double-quote args containing other shell metacharacters. |
# Double-quote args containing other shell metacharacters. |
| 764 |
# Many Bourne shells cannot handle close brackets correctly |
# Many Bourne shells cannot handle close brackets correctly |
| 765 |
# in scan sets, so we specify it separately. |
# in scan sets, and some SunOS ksh mistreat backslash-escaping |
| 766 |
|
# in scan sets (worked around with variable expansion), |
| 767 |
|
# and furthermore cannot handle '|' '&' '(' ')' in scan sets |
| 768 |
|
# at all, so we specify them separately. |
| 769 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
| 770 |
lastarg="\"$lastarg\"" |
lastarg="\"$lastarg\"" |
| 771 |
;; |
;; |
| 839 |
esac |
esac |
| 840 |
done |
done |
| 841 |
|
|
| 842 |
|
qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` |
| 843 |
|
case $qlibobj in |
| 844 |
|
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
| 845 |
|
qlibobj="\"$qlibobj\"" ;; |
| 846 |
|
esac |
| 847 |
|
test "X$libobj" != "X$qlibobj" \ |
| 848 |
|
&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ |
| 849 |
|
&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters." |
| 850 |
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
| 851 |
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
| 852 |
if test "X$xdir" = "X$obj"; then |
if test "X$xdir" = "X$obj"; then |
| 899 |
# Lock this critical section if it is needed |
# Lock this critical section if it is needed |
| 900 |
# 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 |
| 901 |
if test "$need_locks" = yes; then |
if test "$need_locks" = yes; then |
| 902 |
until $run ln "$progpath" "$lockfile" 2>/dev/null; do |
until $run ln "$srcfile" "$lockfile" 2>/dev/null; do |
| 903 |
$show "Waiting for $lockfile to be removed" |
$show "Waiting for $lockfile to be removed" |
| 904 |
sleep 2 |
sleep 2 |
| 905 |
done |
done |
| 919 |
$run $rm $removelist |
$run $rm $removelist |
| 920 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
| 921 |
fi |
fi |
| 922 |
$echo $srcfile > "$lockfile" |
$echo "$srcfile" > "$lockfile" |
| 923 |
fi |
fi |
| 924 |
|
|
| 925 |
if test -n "$fix_srcfile_path"; then |
if test -n "$fix_srcfile_path"; then |
| 926 |
eval srcfile=\"$fix_srcfile_path\" |
eval srcfile=\"$fix_srcfile_path\" |
| 927 |
fi |
fi |
| 928 |
|
qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` |
| 929 |
|
case $qsrcfile in |
| 930 |
|
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
| 931 |
|
qsrcfile="\"$qsrcfile\"" ;; |
| 932 |
|
esac |
| 933 |
|
|
| 934 |
$run $rm "$libobj" "${libobj}T" |
$run $rm "$libobj" "${libobj}T" |
| 935 |
|
|
| 951 |
fbsd_hideous_sh_bug=$base_compile |
fbsd_hideous_sh_bug=$base_compile |
| 952 |
|
|
| 953 |
if test "$pic_mode" != no; then |
if test "$pic_mode" != no; then |
| 954 |
command="$base_compile $srcfile $pic_flag" |
command="$base_compile $qsrcfile $pic_flag" |
| 955 |
else |
else |
| 956 |
# Don't build PIC code |
# Don't build PIC code |
| 957 |
command="$base_compile $srcfile" |
command="$base_compile $qsrcfile" |
| 958 |
fi |
fi |
| 959 |
|
|
| 960 |
if test ! -d "${xdir}$objdir"; then |
if test ! -d "${xdir}$objdir"; then |
| 961 |
$show "$mkdir ${xdir}$objdir" |
$show "$mkdir ${xdir}$objdir" |
| 962 |
$run $mkdir ${xdir}$objdir |
$run $mkdir ${xdir}$objdir |
| 963 |
status=$? |
exit_status=$? |
| 964 |
if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then |
if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then |
| 965 |
exit $status |
exit $exit_status |
| 966 |
fi |
fi |
| 967 |
fi |
fi |
| 968 |
|
|
| 1034 |
if test "$build_old_libs" = yes; then |
if test "$build_old_libs" = yes; then |
| 1035 |
if test "$pic_mode" != yes; then |
if test "$pic_mode" != yes; then |
| 1036 |
# Don't build PIC code |
# Don't build PIC code |
| 1037 |
command="$base_compile $srcfile" |
command="$base_compile $qsrcfile" |
| 1038 |
else |
else |
| 1039 |
command="$base_compile $srcfile $pic_flag" |
command="$base_compile $qsrcfile $pic_flag" |
| 1040 |
fi |
fi |
| 1041 |
if test "$compiler_c_o" = yes; then |
if test "$compiler_c_o" = yes; then |
| 1042 |
command="$command -o $obj" |
command="$command -o $obj" |
| 1165 |
no_install=no |
no_install=no |
| 1166 |
objs= |
objs= |
| 1167 |
non_pic_objects= |
non_pic_objects= |
| 1168 |
|
notinst_path= # paths that contain not-installed libtool libraries |
| 1169 |
precious_files_regex= |
precious_files_regex= |
| 1170 |
prefer_static_libs=no |
prefer_static_libs=no |
| 1171 |
preload=no |
preload=no |
| 1194 |
if test -n "$link_static_flag"; then |
if test -n "$link_static_flag"; then |
| 1195 |
dlopen_self=$dlopen_self_static |
dlopen_self=$dlopen_self_static |
| 1196 |
fi |
fi |
| 1197 |
|
prefer_static_libs=yes |
| 1198 |
else |
else |
| 1199 |
if test -z "$pic_flag" && test -n "$link_static_flag"; then |
if test -z "$pic_flag" && test -n "$link_static_flag"; then |
| 1200 |
dlopen_self=$dlopen_self_static |
dlopen_self=$dlopen_self_static |
| 1201 |
fi |
fi |
| 1202 |
|
prefer_static_libs=built |
| 1203 |
fi |
fi |
| 1204 |
build_libtool_libs=no |
build_libtool_libs=no |
| 1205 |
build_old_libs=yes |
build_old_libs=yes |
|
prefer_static_libs=yes |
|
| 1206 |
break |
break |
| 1207 |
;; |
;; |
| 1208 |
esac |
esac |
| 1377 |
if test -z "$pic_object" || test "$pic_object" = none ; then |
if test -z "$pic_object" || test "$pic_object" = none ; then |
| 1378 |
arg="$non_pic_object" |
arg="$non_pic_object" |
| 1379 |
fi |
fi |
| 1380 |
|
else |
| 1381 |
|
# If the PIC object exists, use it instead. |
| 1382 |
|
# $xdir was prepended to $pic_object above. |
| 1383 |
|
non_pic_object="$pic_object" |
| 1384 |
|
non_pic_objects="$non_pic_objects $non_pic_object" |
| 1385 |
fi |
fi |
| 1386 |
else |
else |
| 1387 |
# Only an error if not doing a dry-run. |
# Only an error if not doing a dry-run. |
| 1461 |
continue |
continue |
| 1462 |
;; |
;; |
| 1463 |
shrext) |
shrext) |
| 1464 |
shrext_cmds="$arg" |
shrext_cmds="$arg" |
| 1465 |
|
prev= |
| 1466 |
|
continue |
| 1467 |
|
;; |
| 1468 |
|
darwin_framework|darwin_framework_skip) |
| 1469 |
|
test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" |
| 1470 |
|
compile_command="$compile_command $arg" |
| 1471 |
|
finalize_command="$finalize_command $arg" |
| 1472 |
prev= |
prev= |
| 1473 |
continue |
continue |
| 1474 |
;; |
;; |
| 1530 |
continue |
continue |
| 1531 |
;; |
;; |
| 1532 |
|
|
| 1533 |
|
-framework|-arch|-isysroot) |
| 1534 |
|
case " $CC " in |
| 1535 |
|
*" ${arg} ${1} "* | *" ${arg} ${1} "*) |
| 1536 |
|
prev=darwin_framework_skip ;; |
| 1537 |
|
*) compiler_flags="$compiler_flags $arg" |
| 1538 |
|
prev=darwin_framework ;; |
| 1539 |
|
esac |
| 1540 |
|
compile_command="$compile_command $arg" |
| 1541 |
|
finalize_command="$finalize_command $arg" |
| 1542 |
|
continue |
| 1543 |
|
;; |
| 1544 |
|
|
| 1545 |
-inst-prefix-dir) |
-inst-prefix-dir) |
| 1546 |
prev=inst_prefix |
prev=inst_prefix |
| 1547 |
continue |
continue |
| 1568 |
absdir=`cd "$dir" && pwd` |
absdir=`cd "$dir" && pwd` |
| 1569 |
if test -z "$absdir"; then |
if test -z "$absdir"; then |
| 1570 |
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 |
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 |
| 1571 |
exit $EXIT_FAILURE |
absdir="$dir" |
| 1572 |
|
notinst_path="$notinst_path $dir" |
| 1573 |
fi |
fi |
| 1574 |
dir="$absdir" |
dir="$absdir" |
| 1575 |
;; |
;; |
| 1583 |
esac |
esac |
| 1584 |
case $host in |
case $host in |
| 1585 |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
| 1586 |
|
testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` |
| 1587 |
case :$dllsearchpath: in |
case :$dllsearchpath: in |
| 1588 |
*":$dir:"*) ;; |
*":$dir:"*) ;; |
| 1589 |
*) dllsearchpath="$dllsearchpath:$dir";; |
*) dllsearchpath="$dllsearchpath:$dir";; |
| 1590 |
esac |
esac |
| 1591 |
|
case :$dllsearchpath: in |
| 1592 |
|
*":$testbindir:"*) ;; |
| 1593 |
|
*) dllsearchpath="$dllsearchpath:$testbindir";; |
| 1594 |
|
esac |
| 1595 |
;; |
;; |
| 1596 |
esac |
esac |
| 1597 |
continue |
continue |
| 1600 |
-l*) |
-l*) |
| 1601 |
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then |
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then |
| 1602 |
case $host in |
case $host in |
| 1603 |
*-*-cygwin* | *-*-pw32* | *-*-beos*) |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) |
| 1604 |
# These systems don't actually have a C or math library (as such) |
# These systems don't actually have a C or math library (as such) |
| 1605 |
continue |
continue |
| 1606 |
;; |
;; |
| 1607 |
*-*-mingw* | *-*-os2*) |
*-*-os2*) |
| 1608 |
# These systems don't actually have a C library (as such) |
# These systems don't actually have a C library (as such) |
| 1609 |
test "X$arg" = "X-lc" && continue |
test "X$arg" = "X-lc" && continue |
| 1610 |
;; |
;; |
| 1611 |
*-*-openbsd* | *-*-freebsd*) |
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) |
| 1612 |
# Do not include libc due to us having libc/libc_r. |
# Do not include libc due to us having libc/libc_r. |
| 1613 |
test "X$arg" = "X-lc" && continue |
test "X$arg" = "X-lc" && continue |
| 1614 |
;; |
;; |
| 1616 |
# Rhapsody C and math libraries are in the System framework |
# Rhapsody C and math libraries are in the System framework |
| 1617 |
deplibs="$deplibs -framework System" |
deplibs="$deplibs -framework System" |
| 1618 |
continue |
continue |
| 1619 |
|
;; |
| 1620 |
|
*-*-sco3.2v5* | *-*-sco5v6*) |
| 1621 |
|
# Causes problems with __ctype |
| 1622 |
|
test "X$arg" = "X-lc" && continue |
| 1623 |
|
;; |
| 1624 |
|
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) |
| 1625 |
|
# Compiler inserts libc in the correct place for threads to work |
| 1626 |
|
test "X$arg" = "X-lc" && continue |
| 1627 |
|
;; |
| 1628 |
esac |
esac |
| 1629 |
elif test "X$arg" = "X-lc_r"; then |
elif test "X$arg" = "X-lc_r"; then |
| 1630 |
case $host in |
case $host in |
| 1631 |
*-*-openbsd* | *-*-freebsd*) |
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) |
| 1632 |
# Do not include libc_r directly, use -pthread flag. |
# Do not include libc_r directly, use -pthread flag. |
| 1633 |
continue |
continue |
| 1634 |
;; |
;; |
| 1638 |
continue |
continue |
| 1639 |
;; |
;; |
| 1640 |
|
|
| 1641 |
|
# Tru64 UNIX uses -model [arg] to determine the layout of C++ |
| 1642 |
|
# classes, name mangling, and exception handling. |
| 1643 |
|
-model) |
| 1644 |
|
compile_command="$compile_command $arg" |
| 1645 |
|
compiler_flags="$compiler_flags $arg" |
| 1646 |
|
finalize_command="$finalize_command $arg" |
| 1647 |
|
prev=xcompiler |
| 1648 |
|
continue |
| 1649 |
|
;; |
| 1650 |
|
|
| 1651 |
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) |
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) |
| 1652 |
deplibs="$deplibs $arg" |
compiler_flags="$compiler_flags $arg" |
| 1653 |
|
compile_command="$compile_command $arg" |
| 1654 |
|
finalize_command="$finalize_command $arg" |
| 1655 |
continue |
continue |
| 1656 |
;; |
;; |
| 1657 |
|
|
| 1660 |
continue |
continue |
| 1661 |
;; |
;; |
| 1662 |
|
|
| 1663 |
# gcc -m* arguments should be passed to the linker via $compiler_flags |
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler |
| 1664 |
# in order to pass architecture information to the linker |
# -r[0-9][0-9]* specifies the processor on the SGI compiler |
| 1665 |
# (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo |
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler |
| 1666 |
# but this is not reliable with gcc because gcc may use -mfoo to |
# +DA*, +DD* enable 64-bit mode on the HP compiler |
| 1667 |
# select a different linker, different libraries, etc, while |
# -q* pass through compiler args for the IBM compiler |
| 1668 |
# -Wl,-mfoo simply passes -mfoo to the linker. |
# -m* pass through architecture-specific compiler args for GCC |
| 1669 |
-m*) |
# -m*, -t[45]*, -txscale* pass through architecture-specific |
| 1670 |
|
# compiler args for GCC |
| 1671 |
|
# -pg pass through profiling flag for GCC |
| 1672 |
|
# @file GCC response files |
| 1673 |
|
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ |
| 1674 |
|
-t[45]*|-txscale*|@*) |
| 1675 |
|
|
| 1676 |
# Unknown arguments in both finalize_command and compile_command need |
# Unknown arguments in both finalize_command and compile_command need |
| 1677 |
# to be aesthetically quoted because they are evaled later. |
# to be aesthetically quoted because they are evaled later. |
| 1678 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
| 1683 |
esac |
esac |
| 1684 |
compile_command="$compile_command $arg" |
compile_command="$compile_command $arg" |
| 1685 |
finalize_command="$finalize_command $arg" |
finalize_command="$finalize_command $arg" |
| 1686 |
if test "$with_gcc" = "yes" ; then |
compiler_flags="$compiler_flags $arg" |
|
compiler_flags="$compiler_flags $arg" |
|
|
fi |
|
| 1687 |
continue |
continue |
| 1688 |
;; |
;; |
| 1689 |
|
|
| 1880 |
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
| 1881 |
if test "X$xdir" = "X$arg"; then |
if test "X$xdir" = "X$arg"; then |
| 1882 |
xdir= |
xdir= |
| 1883 |
else |
else |
| 1884 |
xdir="$xdir/" |
xdir="$xdir/" |
| 1885 |
fi |
fi |
| 1886 |
|
|
| 1921 |
if test -z "$pic_object" || test "$pic_object" = none ; then |
if test -z "$pic_object" || test "$pic_object" = none ; then |
| 1922 |
arg="$non_pic_object" |
arg="$non_pic_object" |
| 1923 |
fi |
fi |
| 1924 |
|
else |
| 1925 |
|
# If the PIC object exists, use it instead. |
| 1926 |
|
# $xdir was prepended to $pic_object above. |
| 1927 |
|
non_pic_object="$pic_object" |
| 1928 |
|
non_pic_objects="$non_pic_objects $non_pic_object" |
| 1929 |
fi |
fi |
| 1930 |
else |
else |
| 1931 |
# Only an error if not doing a dry-run. |
# Only an error if not doing a dry-run. |
| 2031 |
if test ! -d "$output_objdir"; then |
if test ! -d "$output_objdir"; then |
| 2032 |
$show "$mkdir $output_objdir" |
$show "$mkdir $output_objdir" |
| 2033 |
$run $mkdir $output_objdir |
$run $mkdir $output_objdir |
| 2034 |
status=$? |
exit_status=$? |
| 2035 |
if test "$status" -ne 0 && test ! -d "$output_objdir"; then |
if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then |
| 2036 |
exit $status |
exit $exit_status |
| 2037 |
fi |
fi |
| 2038 |
fi |
fi |
| 2039 |
|
|
| 2096 |
newlib_search_path= |
newlib_search_path= |
| 2097 |
need_relink=no # whether we're linking any uninstalled libtool libraries |
need_relink=no # whether we're linking any uninstalled libtool libraries |
| 2098 |
notinst_deplibs= # not-installed libtool libraries |
notinst_deplibs= # not-installed libtool libraries |
|
notinst_path= # paths that contain not-installed libtool libraries |
|
| 2099 |
case $linkmode in |
case $linkmode in |
| 2100 |
lib) |
lib) |
| 2101 |
passes="conv link" |
passes="conv link" |
| 2147 |
compile_deplibs="$deplib $compile_deplibs" |
compile_deplibs="$deplib $compile_deplibs" |
| 2148 |
finalize_deplibs="$deplib $finalize_deplibs" |
finalize_deplibs="$deplib $finalize_deplibs" |
| 2149 |
else |
else |
| 2150 |
deplibs="$deplib $deplibs" |
compiler_flags="$compiler_flags $deplib" |
| 2151 |
fi |
fi |
| 2152 |
continue |
continue |
| 2153 |
;; |
;; |
| 2156 |
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 |
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 |
| 2157 |
continue |
continue |
| 2158 |
fi |
fi |
|
if test "$pass" = conv; then |
|
|
deplibs="$deplib $deplibs" |
|
|
continue |
|
|
fi |
|
| 2159 |
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
| 2160 |
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 |
| 2161 |
for search_ext in .la $std_shrext .so .a; do |
for search_ext in .la $std_shrext .so .a; do |
| 2213 |
continue |
continue |
| 2214 |
fi |
fi |
| 2215 |
fi |
fi |
| 2216 |
;; |
;; |
| 2217 |
*) ;; |
*) ;; |
| 2218 |
esac |
esac |
| 2219 |
fi |
fi |
| 2270 |
case $deplibs_check_method in |
case $deplibs_check_method in |
| 2271 |
match_pattern*) |
match_pattern*) |
| 2272 |
set dummy $deplibs_check_method |
set dummy $deplibs_check_method |
| 2273 |
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
| 2274 |
if eval $echo \"$deplib\" 2>/dev/null \ |
if eval $echo \"$deplib\" 2>/dev/null \ |
| 2275 |
| $SED 10q \ |
| $SED 10q \ |
| 2276 |
| $EGREP "$match_pattern_regex" > /dev/null; then |
| $EGREP "$match_pattern_regex" > /dev/null; then |
| 2331 |
esac # case $deplib |
esac # case $deplib |
| 2332 |
if test "$found" = yes || test -f "$lib"; then : |
if test "$found" = yes || test -f "$lib"; then : |
| 2333 |
else |
else |
| 2334 |
$echo "$modename: cannot find the library \`$lib'" 1>&2 |
$echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 |
| 2335 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
| 2336 |
fi |
fi |
| 2337 |
|
|
| 2355 |
# it will not redefine variables installed, or shouldnotlink |
# it will not redefine variables installed, or shouldnotlink |
| 2356 |
installed=yes |
installed=yes |
| 2357 |
shouldnotlink=no |
shouldnotlink=no |
| 2358 |
|
avoidtemprpath= |
| 2359 |
|
|
| 2360 |
|
|
| 2361 |
# Read the .la file |
# Read the .la file |
| 2362 |
case $lib in |
case $lib in |
| 2386 |
for deplib in $dependency_libs; do |
for deplib in $dependency_libs; do |
| 2387 |
deplibs="$deplib $deplibs" |
deplibs="$deplib $deplibs" |
| 2388 |
if test "X$duplicate_deps" = "Xyes" ; then |
if test "X$duplicate_deps" = "Xyes" ; then |
| 2389 |
case "$tmp_libs " in |
case "$tmp_libs " in |
| 2390 |
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
| 2391 |
esac |
esac |
| 2392 |
fi |
fi |
| 2393 |
tmp_libs="$tmp_libs $deplib" |
tmp_libs="$tmp_libs $deplib" |
| 2394 |
done |
done |
| 2455 |
dir="$libdir" |
dir="$libdir" |
| 2456 |
absdir="$libdir" |
absdir="$libdir" |
| 2457 |
fi |
fi |
| 2458 |
|
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes |
| 2459 |
else |
else |
| 2460 |
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then |
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then |
| 2461 |
dir="$ladir" |
dir="$ladir" |
| 2540 |
if test -n "$library_names" && |
if test -n "$library_names" && |
| 2541 |
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
| 2542 |
# We need to hardcode the library path |
# We need to hardcode the library path |
| 2543 |
if test -n "$shlibpath_var"; then |
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then |
| 2544 |
# Make sure the rpath contains only unique directories. |
# Make sure the rpath contains only unique directories. |
| 2545 |
case "$temp_rpath " in |
case "$temp_rpath " in |
| 2546 |
*" $dir "*) ;; |
*" $dir "*) ;; |
| 2547 |
*" $absdir "*) ;; |
*" $absdir "*) ;; |
| 2548 |
*) temp_rpath="$temp_rpath $dir" ;; |
*) temp_rpath="$temp_rpath $absdir" ;; |
| 2549 |
esac |
esac |
| 2550 |
fi |
fi |
| 2551 |
|
|
| 2582 |
fi |
fi |
| 2583 |
|
|
| 2584 |
link_static=no # Whether the deplib will be linked statically |
link_static=no # Whether the deplib will be linked statically |
| 2585 |
|
use_static_libs=$prefer_static_libs |
| 2586 |
|
if test "$use_static_libs" = built && test "$installed" = yes ; then |
| 2587 |
|
use_static_libs=no |
| 2588 |
|
fi |
| 2589 |
if test -n "$library_names" && |
if test -n "$library_names" && |
| 2590 |
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
{ test "$use_static_libs" = no || test -z "$old_library"; }; then |
| 2591 |
if test "$installed" = no; then |
if test "$installed" = no; then |
| 2592 |
notinst_deplibs="$notinst_deplibs $lib" |
notinst_deplibs="$notinst_deplibs $lib" |
| 2593 |
need_relink=yes |
need_relink=yes |
| 2700 |
if test "$hardcode_direct" = no; then |
if test "$hardcode_direct" = no; then |
| 2701 |
add="$dir/$linklib" |
add="$dir/$linklib" |
| 2702 |
case $host in |
case $host in |
| 2703 |
*-*-sco3.2v5* ) add_dir="-L$dir" ;; |
*-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; |
| 2704 |
|
*-*-sysv4*uw2*) add_dir="-L$dir" ;; |
| 2705 |
|
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ |
| 2706 |
|
*-*-unixware7*) add_dir="-L$dir" ;; |
| 2707 |
*-*-darwin* ) |
*-*-darwin* ) |
| 2708 |
# if the lib is a module then we can not link against |
# if the lib is a module then we can not link against |
| 2709 |
# it, someone is ignoring the new warnings I added |
# it, someone is ignoring the new warnings I added |
| 2710 |
if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then |
if /usr/bin/file -L $add 2> /dev/null | |
| 2711 |
|
$EGREP ": [^:]* bundle" >/dev/null ; then |
| 2712 |
$echo "** Warning, lib $linklib is a module, not a shared library" |
$echo "** Warning, lib $linklib is a module, not a shared library" |
| 2713 |
if test -z "$old_library" ; then |
if test -z "$old_library" ; then |
| 2714 |
$echo |
$echo |
| 2715 |
$echo "** And there doesn't seem to be a static archive available" |
$echo "** And there doesn't seem to be a static archive available" |
| 2716 |
$echo "** The link will probably fail, sorry" |
$echo "** The link will probably fail, sorry" |
| 2717 |
else |
else |
| 2718 |
add="$dir/$old_library" |
add="$dir/$old_library" |
| 2719 |
fi |
fi |
| 2720 |
fi |
fi |
| 2721 |
esac |
esac |
| 2739 |
add_dir="-L$dir" |
add_dir="-L$dir" |
| 2740 |
# Try looking first in the location we're being installed to. |
# Try looking first in the location we're being installed to. |
| 2741 |
if test -n "$inst_prefix_dir"; then |
if test -n "$inst_prefix_dir"; then |
| 2742 |
case "$libdir" in |
case $libdir in |
| 2743 |
[\\/]*) |
[\\/]*) |
| 2744 |
add_dir="$add_dir -L$inst_prefix_dir$libdir" |
add_dir="$add_dir -L$inst_prefix_dir$libdir" |
| 2745 |
;; |
;; |
| 2803 |
elif test "$hardcode_automatic" = yes; then |
elif test "$hardcode_automatic" = yes; then |
| 2804 |
if test -n "$inst_prefix_dir" && |
if test -n "$inst_prefix_dir" && |
| 2805 |
test -f "$inst_prefix_dir$libdir/$linklib" ; then |
test -f "$inst_prefix_dir$libdir/$linklib" ; then |
| 2806 |
add="$inst_prefix_dir$libdir/$linklib" |
add="$inst_prefix_dir$libdir/$linklib" |
| 2807 |
else |
else |
| 2808 |
add="$libdir/$linklib" |
add="$libdir/$linklib" |
| 2809 |
fi |
fi |
| 2810 |
else |
else |
| 2811 |
# We cannot seem to hardcode it, guess we'll fake it. |
# We cannot seem to hardcode it, guess we'll fake it. |
| 2812 |
add_dir="-L$libdir" |
add_dir="-L$libdir" |
| 2813 |
# Try looking first in the location we're being installed to. |
# Try looking first in the location we're being installed to. |
| 2814 |
if test -n "$inst_prefix_dir"; then |
if test -n "$inst_prefix_dir"; then |
| 2815 |
case "$libdir" in |
case $libdir in |
| 2816 |
[\\/]*) |
[\\/]*) |
| 2817 |
add_dir="$add_dir -L$inst_prefix_dir$libdir" |
add_dir="$add_dir -L$inst_prefix_dir$libdir" |
| 2818 |
;; |
;; |
| 2873 |
fi |
fi |
| 2874 |
fi |
fi |
| 2875 |
else |
else |
|
convenience="$convenience $dir/$old_library" |
|
|
old_convenience="$old_convenience $dir/$old_library" |
|
| 2876 |
deplibs="$dir/$old_library $deplibs" |
deplibs="$dir/$old_library $deplibs" |
| 2877 |
link_static=yes |
link_static=yes |
| 2878 |
fi |
fi |
| 2990 |
*) continue ;; |
*) continue ;; |
| 2991 |
esac |
esac |
| 2992 |
case " $deplibs " in |
case " $deplibs " in |
| 2993 |
*" $depdepl "*) ;; |
*" $path "*) ;; |
| 2994 |
*) deplibs="$depdepl $deplibs" ;; |
*) deplibs="$path $deplibs" ;; |
| 2995 |
esac |
esac |
| 2996 |
case " $deplibs " in |
case " $deplibs " in |
| 2997 |
*" $path "*) ;; |
*" $depdepl "*) ;; |
| 2998 |
*) deplibs="$deplibs $path" ;; |
*) deplibs="$depdepl $deplibs" ;; |
| 2999 |
esac |
esac |
| 3000 |
done |
done |
| 3001 |
fi # link_all_deplibs != no |
fi # link_all_deplibs != no |
| 3032 |
new_libs= |
new_libs= |
| 3033 |
for deplib in $tmp_libs; do |
for deplib in $tmp_libs; do |
| 3034 |
# FIXME: Pedantically, this is the right thing to do, so |
# FIXME: Pedantically, this is the right thing to do, so |
| 3035 |
# that some nasty dependency loop isn't accidentally |
# that some nasty dependency loop isn't accidentally |
| 3036 |
# broken: |
# broken: |
| 3037 |
#new_libs="$deplib $new_libs" |
#new_libs="$deplib $new_libs" |
| 3038 |
# Pragmatically, this seems to cause very few problems in |
# Pragmatically, this seems to cause very few problems in |
| 3039 |
# practice: |
# practice: |
| 3260 |
|
|
| 3261 |
# Check that each of the things are valid numbers. |
# Check that each of the things are valid numbers. |
| 3262 |
case $current in |
case $current in |
| 3263 |
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; |
| 3264 |
*) |
*) |
| 3265 |
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 |
$echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 |
| 3266 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
| 3267 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
| 3268 |
;; |
;; |
| 3269 |
esac |
esac |
| 3270 |
|
|
| 3271 |
case $revision in |
case $revision in |
| 3272 |
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; |
| 3273 |
*) |
*) |
| 3274 |
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 |
$echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 |
| 3275 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
| 3276 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
| 3277 |
;; |
;; |
| 3278 |
esac |
esac |
| 3279 |
|
|
| 3280 |
case $age in |
case $age in |
| 3281 |
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; |
| 3282 |
*) |
*) |
| 3283 |
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 |
$echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 |
| 3284 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
| 3285 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
| 3286 |
;; |
;; |
| 3324 |
|
|
| 3325 |
case $version_type in |
case $version_type in |
| 3326 |
nonstopux) verstring_prefix=nonstopux ;; |
nonstopux) verstring_prefix=nonstopux ;; |
| 3327 |
*) verstring_prefix=sgi ;; |
*) verstring_prefix=sgi ;; |
| 3328 |
esac |
esac |
| 3329 |
verstring="$verstring_prefix$major.$revision" |
verstring="$verstring_prefix$major.$revision" |
| 3330 |
|
|
| 3433 |
;; |
;; |
| 3434 |
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) |
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) |
| 3435 |
if test "X$precious_files_regex" != "X"; then |
if test "X$precious_files_regex" != "X"; then |
| 3436 |
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 |
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 |
| 3437 |
then |
then |
| 3438 |
continue |
continue |
| 3439 |
fi |
fi |
| 3440 |
fi |
fi |
| 3459 |
|
|
| 3460 |
# Eliminate all temporary directories. |
# Eliminate all temporary directories. |
| 3461 |
for path in $notinst_path; do |
for path in $notinst_path; do |
| 3462 |
lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` |
lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` |
| 3463 |
deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` |
deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` |
| 3464 |
dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` |
dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` |
| 3465 |
done |
done |
| 3466 |
|
|
| 3467 |
if test -n "$xrpath"; then |
if test -n "$xrpath"; then |
| 3512 |
*-*-netbsd*) |
*-*-netbsd*) |
| 3513 |
# Don't link with libc until the a.out ld.so is fixed. |
# Don't link with libc until the a.out ld.so is fixed. |
| 3514 |
;; |
;; |
| 3515 |
*-*-openbsd* | *-*-freebsd*) |
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) |
| 3516 |
# Do not include libc due to us having libc/libc_r. |
# Do not include libc due to us having libc/libc_r. |
|
test "X$arg" = "X-lc" && continue |
|
| 3517 |
;; |
;; |
| 3518 |
*) |
*-*-sco3.2v5* | *-*-sco5v6*) |
| 3519 |
|
# Causes problems with __ctype |
| 3520 |
|
;; |
| 3521 |
|
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) |
| 3522 |
|
# Compiler inserts libc in the correct place for threads to work |
| 3523 |
|
;; |
| 3524 |
|
*) |
| 3525 |
# Add libc to deplibs on all other systems if necessary. |
# Add libc to deplibs on all other systems if necessary. |
| 3526 |
if test "$build_libtool_need_lc" = "yes"; then |
if test "$build_libtool_need_lc" = "yes"; then |
| 3527 |
deplibs="$deplibs -lc" |
deplibs="$deplibs -lc" |
| 3548 |
pass_all) |
pass_all) |
| 3549 |
# Don't check for shared/static. Everything works. |
# Don't check for shared/static. Everything works. |
| 3550 |
# This might be a little naive. We might want to check |
# This might be a little naive. We might want to check |
| 3551 |
# whether the library exists or not. But this is on |
# whether the library exists or not. But this is on |
| 3552 |
# osf3 & osf4 and I'm not really sure... Just |
# osf3 & osf4 and I'm not really sure... Just |
| 3553 |
# implementing what was already the behavior. |
# implementing what was already the behavior. |
| 3554 |
newdeplibs=$deplibs |
newdeplibs=$deplibs |
| 3563 |
int main() { return 0; } |
int main() { return 0; } |
| 3564 |
EOF |
EOF |
| 3565 |
$rm conftest |
$rm conftest |
| 3566 |
$LTCC -o conftest conftest.c $deplibs |
$LTCC $LTCFLAGS -o conftest conftest.c $deplibs |
| 3567 |
if test "$?" -eq 0 ; then |
if test "$?" -eq 0 ; then |
| 3568 |
ldd_output=`ldd conftest` |
ldd_output=`ldd conftest` |
| 3569 |
for i in $deplibs; do |
for i in $deplibs; do |
| 3570 |
name="`expr $i : '-l\(.*\)'`" |
name=`expr $i : '-l\(.*\)'` |
| 3571 |
# If $name is empty we are operating on a -L argument. |
# If $name is empty we are operating on a -L argument. |
| 3572 |
if test "$name" != "" && test "$name" -ne "0"; then |
if test "$name" != "" && test "$name" -ne "0"; then |
| 3573 |
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
| 3577 |
i="" |
i="" |
| 3578 |
;; |
;; |
| 3579 |
esac |
esac |
| 3580 |
fi |
fi |
| 3581 |
if test -n "$i" ; then |
if test -n "$i" ; then |
| 3582 |
libname=`eval \\$echo \"$libname_spec\"` |
libname=`eval \\$echo \"$libname_spec\"` |
| 3583 |
deplib_matches=`eval \\$echo \"$library_names_spec\"` |
deplib_matches=`eval \\$echo \"$library_names_spec\"` |
| 3604 |
# Error occurred in the first compile. Let's try to salvage |
# Error occurred in the first compile. Let's try to salvage |
| 3605 |
# the situation: Compile a separate program for each library. |
# the situation: Compile a separate program for each library. |
| 3606 |
for i in $deplibs; do |
for i in $deplibs; do |
| 3607 |
name="`expr $i : '-l\(.*\)'`" |
name=`expr $i : '-l\(.*\)'` |
| 3608 |
# If $name is empty we are operating on a -L argument. |
# If $name is empty we are operating on a -L argument. |
| 3609 |
if test "$name" != "" && test "$name" != "0"; then |
if test "$name" != "" && test "$name" != "0"; then |
| 3610 |
$rm conftest |
$rm conftest |
| 3611 |
$LTCC -o conftest conftest.c $i |
$LTCC $LTCFLAGS -o conftest conftest.c $i |
| 3612 |
# Did it work? |
# Did it work? |
| 3613 |
if test "$?" -eq 0 ; then |
if test "$?" -eq 0 ; then |
| 3614 |
ldd_output=`ldd conftest` |
ldd_output=`ldd conftest` |
| 3642 |
droppeddeps=yes |
droppeddeps=yes |
| 3643 |
$echo |
$echo |
| 3644 |
$echo "*** Warning! Library $i is needed by this library but I was not able to" |
$echo "*** Warning! Library $i is needed by this library but I was not able to" |
| 3645 |
$echo "*** make it link in! You will probably need to install it or some" |
$echo "*** make it link in! You will probably need to install it or some" |
| 3646 |
$echo "*** library that it depends on before this library will be fully" |
$echo "*** library that it depends on before this library will be fully" |
| 3647 |
$echo "*** functional. Installing it before continuing would be even better." |
$echo "*** functional. Installing it before continuing would be even better." |
| 3648 |
fi |
fi |
| 3656 |
set dummy $deplibs_check_method |
set dummy $deplibs_check_method |
| 3657 |
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
| 3658 |
for a_deplib in $deplibs; do |
for a_deplib in $deplibs; do |
| 3659 |
name="`expr $a_deplib : '-l\(.*\)'`" |
name=`expr $a_deplib : '-l\(.*\)'` |
| 3660 |
# If $name is empty we are operating on a -L argument. |
# If $name is empty we are operating on a -L argument. |
| 3661 |
if test "$name" != "" && test "$name" != "0"; then |
if test "$name" != "" && test "$name" != "0"; then |
| 3662 |
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
| 3690 |
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; |
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; |
| 3691 |
esac |
esac |
| 3692 |
done |
done |
| 3693 |
|
# It is ok to link against an archive when |
| 3694 |
|
# building a shared library. |
| 3695 |
|
if $AR -t $potlib > /dev/null 2>&1; then |
| 3696 |
|
newdeplibs="$newdeplibs $a_deplib" |
| 3697 |
|
a_deplib="" |
| 3698 |
|
break 2 |
| 3699 |
|
fi |
| 3700 |
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ |
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ |
| 3701 |
| ${SED} 10q \ |
| ${SED} 10q \ |
| 3702 |
| $EGREP "$file_magic_regex" > /dev/null; then |
| $EGREP "$file_magic_regex" > /dev/null; then |
| 3732 |
set dummy $deplibs_check_method |
set dummy $deplibs_check_method |
| 3733 |
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
| 3734 |
for a_deplib in $deplibs; do |
for a_deplib in $deplibs; do |
| 3735 |
name="`expr $a_deplib : '-l\(.*\)'`" |
name=`expr $a_deplib : '-l\(.*\)'` |
| 3736 |
# If $name is empty we are operating on a -L argument. |
# If $name is empty we are operating on a -L argument. |
| 3737 |
if test -n "$name" && test "$name" != "0"; then |
if test -n "$name" && test "$name" != "0"; then |
| 3738 |
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
| 3750 |
for potent_lib in $potential_libs; do |
for potent_lib in $potential_libs; do |
| 3751 |
potlib="$potent_lib" # see symlink-check above in file_magic test |
potlib="$potent_lib" # see symlink-check above in file_magic test |
| 3752 |
if eval $echo \"$potent_lib\" 2>/dev/null \ |
if eval $echo \"$potent_lib\" 2>/dev/null \ |
| 3753 |
| ${SED} 10q \ |
| ${SED} 10q \ |
| 3754 |
| $EGREP "$match_pattern_regex" > /dev/null; then |
| $EGREP "$match_pattern_regex" > /dev/null; then |
| 3755 |
newdeplibs="$newdeplibs $a_deplib" |
newdeplibs="$newdeplibs $a_deplib" |
| 3756 |
a_deplib="" |
a_deplib="" |
| 3757 |
break 2 |
break 2 |
| 3790 |
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` |
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` |
| 3791 |
done |
done |
| 3792 |
fi |
fi |
| 3793 |
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ |
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ |
| 3794 |
| grep . >/dev/null; then |
| grep . >/dev/null; then |
| 3795 |
$echo |
$echo |
| 3796 |
if test "X$deplibs_check_method" = "Xnone"; then |
if test "X$deplibs_check_method" = "Xnone"; then |
| 3862 |
deplibs=$newdeplibs |
deplibs=$newdeplibs |
| 3863 |
fi |
fi |
| 3864 |
|
|
| 3865 |
|
|
| 3866 |
|
# move library search paths that coincide with paths to not yet |
| 3867 |
|
# installed libraries to the beginning of the library search list |
| 3868 |
|
new_libs= |
| 3869 |
|
for path in $notinst_path; do |
| 3870 |
|
case " $new_libs " in |
| 3871 |
|
*" -L$path/$objdir "*) ;; |
| 3872 |
|
*) |
| 3873 |
|
case " $deplibs " in |
| 3874 |
|
*" -L$path/$objdir "*) |
| 3875 |
|
new_libs="$new_libs -L$path/$objdir" ;; |
| 3876 |
|
esac |
| 3877 |
|
;; |
| 3878 |
|
esac |
| 3879 |
|
done |
| 3880 |
|
for deplib in $deplibs; do |
| 3881 |
|
case $deplib in |
| 3882 |
|
-L*) |
| 3883 |
|
case " $new_libs " in |
| 3884 |
|
*" $deplib "*) ;; |
| 3885 |
|
*) new_libs="$new_libs $deplib" ;; |
| 3886 |
|
esac |
| 3887 |
|
;; |
| 3888 |
|
*) new_libs="$new_libs $deplib" ;; |
| 3889 |
|
esac |
| 3890 |
|
done |
| 3891 |
|
deplibs="$new_libs" |
| 3892 |
|
|
| 3893 |
|
|
| 3894 |
# All the library-specific variables (install_libdir is set above). |
# All the library-specific variables (install_libdir is set above). |
| 3895 |
library_names= |
library_names= |
| 3896 |
old_library= |
old_library= |
| 3974 |
fi |
fi |
| 3975 |
|
|
| 3976 |
lib="$output_objdir/$realname" |
lib="$output_objdir/$realname" |
| 3977 |
|
linknames= |
| 3978 |
for link |
for link |
| 3979 |
do |
do |
| 3980 |
linknames="$linknames $link" |
linknames="$linknames $link" |
| 3996 |
eval cmd=\"$cmd\" |
eval cmd=\"$cmd\" |
| 3997 |
if len=`expr "X$cmd" : ".*"` && |
if len=`expr "X$cmd" : ".*"` && |
| 3998 |
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 |
| 3999 |
$show "$cmd" |
$show "$cmd" |
| 4000 |
$run eval "$cmd" || exit $? |
$run eval "$cmd" || exit $? |
| 4001 |
skipped_export=false |
skipped_export=false |
| 4002 |
else |
else |
| 4003 |
# The command line is too long to execute in one step. |
# The command line is too long to execute in one step. |
| 4004 |
$show "using reloadable object file for export list..." |
$show "using reloadable object file for export list..." |
| 4005 |
skipped_export=: |
skipped_export=: |
| 4006 |
|
# Break out early, otherwise skipped_export may be |
| 4007 |
|
# set to false by a later but shorter cmd. |
| 4008 |
|
break |
| 4009 |
fi |
fi |
| 4010 |
done |
done |
| 4011 |
IFS="$save_ifs" |
IFS="$save_ifs" |
| 4075 |
fi |
fi |
| 4076 |
fi |
fi |
| 4077 |
|
|
| 4078 |
if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && |
if test "X$skipped_export" != "X:" && |
| 4079 |
|
len=`expr "X$test_cmds" : ".*" 2>/dev/null` && |
| 4080 |
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 |
| 4081 |
: |
: |
| 4082 |
else |
else |
| 4095 |
save_libobjs=$libobjs |
save_libobjs=$libobjs |
| 4096 |
fi |
fi |
| 4097 |
save_output=$output |
save_output=$output |
| 4098 |
|
output_la=`$echo "X$output" | $Xsed -e "$basename"` |
| 4099 |
|
|
| 4100 |
# Clear the reloadable object creation command queue and |
# Clear the reloadable object creation command queue and |
| 4101 |
# initialize k to one. |
# initialize k to one. |
| 4105 |
delfiles= |
delfiles= |
| 4106 |
last_robj= |
last_robj= |
| 4107 |
k=1 |
k=1 |
| 4108 |
output=$output_objdir/$save_output-${k}.$objext |
output=$output_objdir/$output_la-${k}.$objext |
| 4109 |
# Loop over the list of objects to be linked. |
# Loop over the list of objects to be linked. |
| 4110 |
for obj in $save_libobjs |
for obj in $save_libobjs |
| 4111 |
do |
do |
| 4112 |
eval test_cmds=\"$reload_cmds $objlist $last_robj\" |
eval test_cmds=\"$reload_cmds $objlist $last_robj\" |
| 4113 |
if test "X$objlist" = X || |
if test "X$objlist" = X || |
| 4114 |
{ len=`expr "X$test_cmds" : ".*"` && |
{ len=`expr "X$test_cmds" : ".*" 2>/dev/null` && |
| 4115 |
test "$len" -le "$max_cmd_len"; }; then |
test "$len" -le "$max_cmd_len"; }; then |
| 4116 |
objlist="$objlist $obj" |
objlist="$objlist $obj" |
| 4117 |
else |
else |
| 4125 |
# the last one created. |
# the last one created. |
| 4126 |
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" |
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" |
| 4127 |
fi |
fi |
| 4128 |
last_robj=$output_objdir/$save_output-${k}.$objext |
last_robj=$output_objdir/$output_la-${k}.$objext |
| 4129 |
k=`expr $k + 1` |
k=`expr $k + 1` |
| 4130 |
output=$output_objdir/$save_output-${k}.$objext |
output=$output_objdir/$output_la-${k}.$objext |
| 4131 |
objlist=$obj |
objlist=$obj |
| 4132 |
len=1 |
len=1 |
| 4133 |
fi |
fi |
| 4147 |
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" |
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" |
| 4148 |
fi |
fi |
| 4149 |
|
|
| 4150 |
# Set up a command to remove the reloadale object files |
# Set up a command to remove the reloadable object files |
| 4151 |
# after they are used. |
# after they are used. |
| 4152 |
i=0 |
i=0 |
| 4153 |
while test "$i" -lt "$k" |
while test "$i" -lt "$k" |
| 4154 |
do |
do |
| 4155 |
i=`expr $i + 1` |
i=`expr $i + 1` |
| 4156 |
delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" |
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" |
| 4157 |
done |
done |
| 4158 |
|
|
| 4159 |
$echo "creating a temporary reloadable object file: $output" |
$echo "creating a temporary reloadable object file: $output" |
| 4201 |
IFS="$save_ifs" |
IFS="$save_ifs" |
| 4202 |
eval cmd=\"$cmd\" |
eval cmd=\"$cmd\" |
| 4203 |
$show "$cmd" |
$show "$cmd" |
| 4204 |
$run eval "$cmd" || exit $? |
$run eval "$cmd" || { |
| 4205 |
|
lt_exit=$? |
| 4206 |
|
|
| 4207 |
|
# Restore the uninstalled library and exit |
| 4208 |
|
if test "$mode" = relink; then |
| 4209 |
|
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' |
| 4210 |
|
fi |
| 4211 |
|
|
| 4212 |
|
exit $lt_exit |
| 4213 |
|
} |
| 4214 |
done |
done |
| 4215 |
IFS="$save_ifs" |
IFS="$save_ifs" |
| 4216 |
|
|
| 4217 |
# Restore the uninstalled library and exit |
# Restore the uninstalled library and exit |
| 4218 |
if test "$mode" = relink; then |
if test "$mode" = relink; then |
| 4219 |
$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 $? |
| 4220 |
|
|
| 4221 |
|
if test -n "$convenience"; then |
| 4222 |
|
if test -z "$whole_archive_flag_spec"; then |
| 4223 |
|
$show "${rm}r $gentop" |
| 4224 |
|
$run ${rm}r "$gentop" |
| 4225 |
|
fi |
| 4226 |
|
fi |
| 4227 |
|
|
| 4228 |
exit $EXIT_SUCCESS |
exit $EXIT_SUCCESS |
| 4229 |
fi |
fi |
| 4230 |
|
|
| 4406 |
;; |
;; |
| 4407 |
esac |
esac |
| 4408 |
|
|
| 4409 |
|
|
| 4410 |
|
# move library search paths that coincide with paths to not yet |
| 4411 |
|
# installed libraries to the beginning of the library search list |
| 4412 |
|
new_libs= |
| 4413 |
|
for path in $notinst_path; do |
| 4414 |
|
case " $new_libs " in |
| 4415 |
|
*" -L$path/$objdir "*) ;; |
| 4416 |
|
*) |
| 4417 |
|
case " $compile_deplibs " in |
| 4418 |
|
*" -L$path/$objdir "*) |
| 4419 |
|
new_libs="$new_libs -L$path/$objdir" ;; |
| 4420 |
|
esac |
| 4421 |
|
;; |
| 4422 |
|
esac |
| 4423 |
|
done |
| 4424 |
|
for deplib in $compile_deplibs; do |
| 4425 |
|
case $deplib in |
| 4426 |
|
-L*) |
| 4427 |
|
case " $new_libs " in |
| 4428 |
|
*" $deplib "*) ;; |
| 4429 |
|
*) new_libs="$new_libs $deplib" ;; |
| 4430 |
|
esac |
| 4431 |
|
;; |
| 4432 |
|
*) new_libs="$new_libs $deplib" ;; |
| 4433 |
|
esac |
| 4434 |
|
done |
| 4435 |
|
compile_deplibs="$new_libs" |
| 4436 |
|
|
| 4437 |
|
|
| 4438 |
compile_command="$compile_command $compile_deplibs" |
compile_command="$compile_command $compile_deplibs" |
| 4439 |
finalize_command="$finalize_command $finalize_deplibs" |
finalize_command="$finalize_command $finalize_deplibs" |
| 4440 |
|
|
| 4479 |
fi |
fi |
| 4480 |
case $host in |
case $host in |
| 4481 |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
| 4482 |
|
testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` |
| 4483 |
case :$dllsearchpath: in |
case :$dllsearchpath: in |
| 4484 |
*":$libdir:"*) ;; |
*":$libdir:"*) ;; |
| 4485 |
*) dllsearchpath="$dllsearchpath:$libdir";; |
*) dllsearchpath="$dllsearchpath:$libdir";; |
| 4486 |
esac |
esac |
| 4487 |
|
case :$dllsearchpath: in |
| 4488 |
|
*":$testbindir:"*) ;; |
| 4489 |
|
*) dllsearchpath="$dllsearchpath:$testbindir";; |
| 4490 |
|
esac |
| 4491 |
;; |
;; |
| 4492 |
esac |
esac |
| 4493 |
done |
done |
| 4601 |
|
|
| 4602 |
# Prepare the list of exported symbols |
# Prepare the list of exported symbols |
| 4603 |
if test -z "$export_symbols"; then |
if test -z "$export_symbols"; then |
| 4604 |
export_symbols="$output_objdir/$output.exp" |
export_symbols="$output_objdir/$outputname.exp" |
| 4605 |
$run $rm $export_symbols |
$run $rm $export_symbols |
| 4606 |
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' |
$run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' |
| 4607 |
|
case $host in |
| 4608 |
|
*cygwin* | *mingw* ) |
| 4609 |
|
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' |
| 4610 |
|
$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' |
| 4611 |
|
;; |
| 4612 |
|
esac |
| 4613 |
else |
else |
| 4614 |
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' |
$run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' |
| 4615 |
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' |
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' |
| 4616 |
$run eval 'mv "$nlist"T "$nlist"' |
$run eval 'mv "$nlist"T "$nlist"' |
| 4617 |
|
case $host in |
| 4618 |
|
*cygwin* | *mingw* ) |
| 4619 |
|
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' |
| 4620 |
|
$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' |
| 4621 |
|
;; |
| 4622 |
|
esac |
| 4623 |
fi |
fi |
| 4624 |
fi |
fi |
| 4625 |
|
|
| 4670 |
#endif |
#endif |
| 4671 |
|
|
| 4672 |
/* The mapping between symbol names and symbols. */ |
/* The mapping between symbol names and symbols. */ |
| 4673 |
|
" |
| 4674 |
|
|
| 4675 |
|
case $host in |
| 4676 |
|
*cygwin* | *mingw* ) |
| 4677 |
|
$echo >> "$output_objdir/$dlsyms" "\ |
| 4678 |
|
/* DATA imports from DLLs on WIN32 can't be const, because |
| 4679 |
|
runtime relocations are performed -- see ld's documentation |
| 4680 |
|
on pseudo-relocs */ |
| 4681 |
|
struct { |
| 4682 |
|
" |
| 4683 |
|
;; |
| 4684 |
|
* ) |
| 4685 |
|
$echo >> "$output_objdir/$dlsyms" "\ |
| 4686 |
const struct { |
const struct { |
| 4687 |
|
" |
| 4688 |
|
;; |
| 4689 |
|
esac |
| 4690 |
|
|
| 4691 |
|
|
| 4692 |
|
$echo >> "$output_objdir/$dlsyms" "\ |
| 4693 |
const char *name; |
const char *name; |
| 4694 |
lt_ptr address; |
lt_ptr address; |
| 4695 |
} |
} |
| 4736 |
esac |
esac |
| 4737 |
|
|
| 4738 |
# Now compile the dynamic symbol file. |
# Now compile the dynamic symbol file. |
| 4739 |
$show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" |
$show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" |
| 4740 |
$run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? |
$run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? |
| 4741 |
|
|
| 4742 |
# Clean up the generated files. |
# Clean up the generated files. |
| 4743 |
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" |
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" |
| 4744 |
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" |
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" |
| 4745 |
|
|
| 4746 |
# Transform the symbol file into the correct name. |
# Transform the symbol file into the correct name. |
| 4747 |
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` |
case $host in |
| 4748 |
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` |
*cygwin* | *mingw* ) |
| 4749 |
|
if test -f "$output_objdir/${outputname}.def" ; then |
| 4750 |
|
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` |
| 4751 |
|
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"` |
| 4752 |
|
else |
| 4753 |
|
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` |
| 4754 |
|
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` |
| 4755 |
|
fi |
| 4756 |
|
;; |
| 4757 |
|
* ) |
| 4758 |
|
compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` |
| 4759 |
|
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` |
| 4760 |
|
;; |
| 4761 |
|
esac |
| 4762 |
;; |
;; |
| 4763 |
*) |
*) |
| 4764 |
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 |
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 |
| 4783 |
# We have no uninstalled library dependencies, so finalize right now. |
# We have no uninstalled library dependencies, so finalize right now. |
| 4784 |
$show "$link_command" |
$show "$link_command" |
| 4785 |
$run eval "$link_command" |
$run eval "$link_command" |
| 4786 |
status=$? |
exit_status=$? |
| 4787 |
|
|
| 4788 |
# Delete the generated files. |
# Delete the generated files. |
| 4789 |
if test -n "$dlsyms"; then |
if test -n "$dlsyms"; then |
| 4791 |
$run $rm "$output_objdir/${outputname}S.${objext}" |
$run $rm "$output_objdir/${outputname}S.${objext}" |
| 4792 |
fi |
fi |
| 4793 |
|
|
| 4794 |
exit $status |
exit $exit_status |
| 4795 |
fi |
fi |
| 4796 |
|
|
| 4797 |
if test -n "$shlibpath_var"; then |
if test -n "$shlibpath_var"; then |
| 4931 |
esac |
esac |
| 4932 |
case $host in |
case $host in |
| 4933 |
*cygwin* | *mingw* ) |
*cygwin* | *mingw* ) |
| 4934 |
cwrappersource=`$echo ${objdir}/lt-${output}.c` |
output_name=`basename $output` |
| 4935 |
cwrapper=`$echo ${output}.exe` |
output_path=`dirname $output` |
| 4936 |
$rm $cwrappersource $cwrapper |
cwrappersource="$output_path/$objdir/lt-$output_name.c" |
| 4937 |
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 |
cwrapper="$output_path/$output_name.exe" |
| 4938 |
|
$rm $cwrappersource $cwrapper |
| 4939 |
|
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 |
| 4940 |
|
|
| 4941 |
cat > $cwrappersource <<EOF |
cat > $cwrappersource <<EOF |
| 4942 |
|
|
| 4961 |
#include <malloc.h> |
#include <malloc.h> |
| 4962 |
#include <stdarg.h> |
#include <stdarg.h> |
| 4963 |
#include <assert.h> |
#include <assert.h> |
| 4964 |
|
#include <string.h> |
| 4965 |
|
#include <ctype.h> |
| 4966 |
|
#include <sys/stat.h> |
| 4967 |
|
|
| 4968 |
#if defined(PATH_MAX) |
#if defined(PATH_MAX) |
| 4969 |
# define LT_PATHMAX PATH_MAX |
# define LT_PATHMAX PATH_MAX |
| 4974 |
#endif |
#endif |
| 4975 |
|
|
| 4976 |
#ifndef DIR_SEPARATOR |
#ifndef DIR_SEPARATOR |
| 4977 |
#define DIR_SEPARATOR '/' |
# define DIR_SEPARATOR '/' |
| 4978 |
|
# define PATH_SEPARATOR ':' |
| 4979 |
#endif |
#endif |
| 4980 |
|
|
| 4981 |
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ |
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ |
| 4982 |
defined (__OS2__) |
defined (__OS2__) |
| 4983 |
#define HAVE_DOS_BASED_FILE_SYSTEM |
# define HAVE_DOS_BASED_FILE_SYSTEM |
| 4984 |
#ifndef DIR_SEPARATOR_2 |
# ifndef DIR_SEPARATOR_2 |
| 4985 |
#define DIR_SEPARATOR_2 '\\' |
# define DIR_SEPARATOR_2 '\\' |
| 4986 |
#endif |
# endif |
| 4987 |
|
# ifndef PATH_SEPARATOR_2 |
| 4988 |
|
# define PATH_SEPARATOR_2 ';' |
| 4989 |
|
# endif |
| 4990 |
#endif |
#endif |
| 4991 |
|
|
| 4992 |
#ifndef DIR_SEPARATOR_2 |
#ifndef DIR_SEPARATOR_2 |
| 4996 |
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) |
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) |
| 4997 |
#endif /* DIR_SEPARATOR_2 */ |
#endif /* DIR_SEPARATOR_2 */ |
| 4998 |
|
|
| 4999 |
|
#ifndef PATH_SEPARATOR_2 |
| 5000 |
|
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) |
| 5001 |
|
#else /* PATH_SEPARATOR_2 */ |
| 5002 |
|
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) |
| 5003 |
|
#endif /* PATH_SEPARATOR_2 */ |
| 5004 |
|
|
| 5005 |
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) |
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) |
| 5006 |
#define XFREE(stale) do { \ |
#define XFREE(stale) do { \ |
| 5007 |
if (stale) { free ((void *) stale); stale = 0; } \ |
if (stale) { free ((void *) stale); stale = 0; } \ |
| 5008 |
} while (0) |
} while (0) |
| 5009 |
|
|
| 5010 |
|
/* -DDEBUG is fairly common in CFLAGS. */ |
| 5011 |
|
#undef DEBUG |
| 5012 |
|
#if defined DEBUGWRAPPER |
| 5013 |
|
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) |
| 5014 |
|
#else |
| 5015 |
|
# define DEBUG(format, ...) |
| 5016 |
|
#endif |
| 5017 |
|
|
| 5018 |
const char *program_name = NULL; |
const char *program_name = NULL; |
| 5019 |
|
|
| 5020 |
void * xmalloc (size_t num); |
void * xmalloc (size_t num); |
| 5021 |
char * xstrdup (const char *string); |
char * xstrdup (const char *string); |
| 5022 |
char * basename (const char *name); |
const char * base_name (const char *name); |
| 5023 |
char * fnqualify(const char *path); |
char * find_executable(const char *wrapper); |
| 5024 |
|
int check_executable(const char *path); |
| 5025 |
char * strendzap(char *str, const char *pat); |
char * strendzap(char *str, const char *pat); |
| 5026 |
void lt_fatal (const char *message, ...); |
void lt_fatal (const char *message, ...); |
| 5027 |
|
|
| 5031 |
char **newargz; |
char **newargz; |
| 5032 |
int i; |
int i; |
| 5033 |
|
|
| 5034 |
program_name = (char *) xstrdup ((char *) basename (argv[0])); |
program_name = (char *) xstrdup (base_name (argv[0])); |
| 5035 |
|
DEBUG("(main) argv[0] : %s\n",argv[0]); |
| 5036 |
|
DEBUG("(main) program_name : %s\n",program_name); |
| 5037 |
newargz = XMALLOC(char *, argc+2); |
newargz = XMALLOC(char *, argc+2); |
| 5038 |
EOF |
EOF |
| 5039 |
|
|
| 5040 |
cat >> $cwrappersource <<EOF |
cat >> $cwrappersource <<EOF |
| 5041 |
newargz[0] = "$SHELL"; |
newargz[0] = (char *) xstrdup("$SHELL"); |
| 5042 |
EOF |
EOF |
| 5043 |
|
|
| 5044 |
cat >> $cwrappersource <<"EOF" |
cat >> $cwrappersource <<"EOF" |
| 5045 |
newargz[1] = fnqualify(argv[0]); |
newargz[1] = find_executable(argv[0]); |
| 5046 |
|
if (newargz[1] == NULL) |
| 5047 |
|
lt_fatal("Couldn't find %s", argv[0]); |
| 5048 |
|
DEBUG("(main) found exe at : %s\n",newargz[1]); |
| 5049 |
/* we know the script has the same name, without the .exe */ |
/* we know the script has the same name, without the .exe */ |
| 5050 |
/* so make sure newargz[1] doesn't end in .exe */ |
/* so make sure newargz[1] doesn't end in .exe */ |
| 5051 |
strendzap(newargz[1],".exe"); |
strendzap(newargz[1],".exe"); |
| 5052 |
for (i = 1; i < argc; i++) |
for (i = 1; i < argc; i++) |
| 5053 |
newargz[i+1] = xstrdup(argv[i]); |
newargz[i+1] = xstrdup(argv[i]); |
| 5054 |
newargz[argc+1] = NULL; |
newargz[argc+1] = NULL; |
| 5055 |
|
|
| 5056 |
|
for (i=0; i<argc+1; i++) |
| 5057 |
|
{ |
| 5058 |
|
DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]); |
| 5059 |
|
; |
| 5060 |
|
} |
| 5061 |
|
|
| 5062 |
EOF |
EOF |
| 5063 |
|
|
| 5064 |
cat >> $cwrappersource <<EOF |
case $host_os in |
| 5065 |
|
mingw*) |
| 5066 |
|
cat >> $cwrappersource <<EOF |
| 5067 |
|
execv("$SHELL",(char const **)newargz); |
| 5068 |
|
EOF |
| 5069 |
|
;; |
| 5070 |
|
*) |
| 5071 |
|
cat >> $cwrappersource <<EOF |
| 5072 |
execv("$SHELL",newargz); |
execv("$SHELL",newargz); |
| 5073 |
EOF |
EOF |
| 5074 |
|
;; |
| 5075 |
|
esac |
| 5076 |
|
|
| 5077 |
cat >> $cwrappersource <<"EOF" |
cat >> $cwrappersource <<"EOF" |
| 5078 |
|
return 127; |
| 5079 |
} |
} |
| 5080 |
|
|
| 5081 |
void * |
void * |
| 5095 |
; |
; |
| 5096 |
} |
} |
| 5097 |
|
|
| 5098 |
char * |
const char * |
| 5099 |
basename (const char *name) |
base_name (const char *name) |
| 5100 |
{ |
{ |
| 5101 |
const char *base; |
const char *base; |
| 5102 |
|
|
| 5103 |
#if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
#if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
| 5104 |
/* Skip over the disk name in MSDOS pathnames. */ |
/* Skip over the disk name in MSDOS pathnames. */ |
| 5105 |
if (isalpha (name[0]) && name[1] == ':') |
if (isalpha ((unsigned char)name[0]) && name[1] == ':') |
| 5106 |
name += 2; |
name += 2; |
| 5107 |
#endif |
#endif |
| 5108 |
|
|
| 5109 |
for (base = name; *name; name++) |
for (base = name; *name; name++) |
| 5110 |
if (IS_DIR_SEPARATOR (*name)) |
if (IS_DIR_SEPARATOR (*name)) |
| 5111 |
base = name + 1; |
base = name + 1; |
| 5112 |
return (char *) base; |
return base; |
| 5113 |
|
} |
| 5114 |
|
|
| 5115 |
|
int |
| 5116 |
|
check_executable(const char * path) |
| 5117 |
|
{ |
| 5118 |
|
struct stat st; |
| 5119 |
|
|
| 5120 |
|
DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); |
| 5121 |
|
if ((!path) || (!*path)) |
| 5122 |
|
return 0; |
| 5123 |
|
|
| 5124 |
|
if ((stat (path, &st) >= 0) && |
| 5125 |
|
( |
| 5126 |
|
/* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ |
| 5127 |
|
#if defined (S_IXOTH) |
| 5128 |
|
((st.st_mode & S_IXOTH) == S_IXOTH) || |
| 5129 |
|
#endif |
| 5130 |
|
#if defined (S_IXGRP) |
| 5131 |
|
((st.st_mode & S_IXGRP) == S_IXGRP) || |
| 5132 |
|
#endif |
| 5133 |
|
((st.st_mode & S_IXUSR) == S_IXUSR)) |
| 5134 |
|
) |
| 5135 |
|
return 1; |
| 5136 |
|
else |
| 5137 |
|
return 0; |
| 5138 |
} |
} |
| 5139 |
|
|
| 5140 |
|
/* Searches for the full path of the wrapper. Returns |
| 5141 |
|
newly allocated full path name if found, NULL otherwise */ |
| 5142 |
char * |
char * |
| 5143 |
fnqualify(const char *path) |
find_executable (const char* wrapper) |
| 5144 |
{ |
{ |
| 5145 |
size_t size; |
int has_slash = 0; |
| 5146 |
char *p; |
const char* p; |
| 5147 |
|
const char* p_next; |
| 5148 |
|
/* static buffer for getcwd */ |
| 5149 |
char tmp[LT_PATHMAX + 1]; |
char tmp[LT_PATHMAX + 1]; |
| 5150 |
|
int tmp_len; |
| 5151 |
|
char* concat_name; |
| 5152 |
|
|
| 5153 |
|
DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); |
| 5154 |
|
|
| 5155 |
assert(path != NULL); |
if ((wrapper == NULL) || (*wrapper == '\0')) |
| 5156 |
|
return NULL; |
| 5157 |
|
|
| 5158 |
/* Is it qualified already? */ |
/* Absolute path? */ |
| 5159 |
#if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
#if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
| 5160 |
if (isalpha (path[0]) && path[1] == ':') |
if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') |
| 5161 |
return xstrdup (path); |
{ |
| 5162 |
|
concat_name = xstrdup (wrapper); |
| 5163 |
|
if (check_executable(concat_name)) |
| 5164 |
|
return concat_name; |
| 5165 |
|
XFREE(concat_name); |
| 5166 |
|
} |
| 5167 |
|
else |
| 5168 |
|
{ |
| 5169 |
|
#endif |
| 5170 |
|
if (IS_DIR_SEPARATOR (wrapper[0])) |
| 5171 |
|
{ |
| 5172 |
|
concat_name = xstrdup (wrapper); |
| 5173 |
|
if (check_executable(concat_name)) |
| 5174 |
|
return concat_name; |
| 5175 |
|
XFREE(concat_name); |
| 5176 |
|
} |
| 5177 |
|
#if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
| 5178 |
|
} |
| 5179 |
#endif |
#endif |
|
if (IS_DIR_SEPARATOR (path[0])) |
|
|
return xstrdup (path); |
|
| 5180 |
|
|
| 5181 |
/* prepend the current directory */ |
for (p = wrapper; *p; p++) |
| 5182 |
/* doesn't handle '~' */ |
if (*p == '/') |
| 5183 |
|
{ |
| 5184 |
|
has_slash = 1; |
| 5185 |
|
break; |
| 5186 |
|
} |
| 5187 |
|
if (!has_slash) |
| 5188 |
|
{ |
| 5189 |
|
/* no slashes; search PATH */ |
| 5190 |
|
const char* path = getenv ("PATH"); |
| 5191 |
|
if (path != NULL) |
| 5192 |
|
{ |
| 5193 |
|
for (p = path; *p; p = p_next) |
| 5194 |
|
{ |
| 5195 |
|
const char* q; |
| 5196 |
|
size_t p_len; |
| 5197 |
|
for (q = p; *q; q++) |
| 5198 |
|
if (IS_PATH_SEPARATOR(*q)) |
| 5199 |
|
break; |
| 5200 |
|
p_len = q - p; |
| 5201 |
|
p_next = (*q == '\0' ? q : q + 1); |
| 5202 |
|
if (p_len == 0) |
| 5203 |
|
{ |
| 5204 |
|
/* empty path: current directory */ |
| 5205 |
|
if (getcwd (tmp, LT_PATHMAX) == NULL) |
| 5206 |
|
lt_fatal ("getcwd failed"); |
| 5207 |
|
tmp_len = strlen(tmp); |
| 5208 |
|
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); |
| 5209 |
|
memcpy (concat_name, tmp, tmp_len); |
| 5210 |
|
concat_name[tmp_len] = '/'; |
| 5211 |
|
strcpy (concat_name + tmp_len + 1, wrapper); |
| 5212 |
|
} |
| 5213 |
|
else |
| 5214 |
|
{ |
| 5215 |
|
concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); |
| 5216 |
|
memcpy (concat_name, p, p_len); |
| 5217 |
|
concat_name[p_len] = '/'; |
| 5218 |
|
strcpy (concat_name + p_len + 1, wrapper); |
| 5219 |
|
} |
| 5220 |
|
if (check_executable(concat_name)) |
| 5221 |
|
return concat_name; |
| 5222 |
|
XFREE(concat_name); |
| 5223 |
|
} |
| 5224 |
|
} |
| 5225 |
|
/* not found in PATH; assume curdir */ |
| 5226 |
|
} |
| 5227 |
|
/* Relative path | not found in path: prepend cwd */ |
| 5228 |
if (getcwd (tmp, LT_PATHMAX) == NULL) |
if (getcwd (tmp, LT_PATHMAX) == NULL) |
| 5229 |
lt_fatal ("getcwd failed"); |
lt_fatal ("getcwd failed"); |
| 5230 |
size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ |
tmp_len = strlen(tmp); |
| 5231 |
p = XMALLOC(char, size); |
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); |
| 5232 |
sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); |
memcpy (concat_name, tmp, tmp_len); |
| 5233 |
return p; |
concat_name[tmp_len] = '/'; |
| 5234 |
|
strcpy (concat_name + tmp_len + 1, wrapper); |
| 5235 |
|
|
| 5236 |
|
if (check_executable(concat_name)) |
| 5237 |
|
return concat_name; |
| 5238 |
|
XFREE(concat_name); |
| 5239 |
|
return NULL; |
| 5240 |
} |
} |
| 5241 |
|
|
| 5242 |
char * |
char * |
| 5280 |
va_end (ap); |
va_end (ap); |
| 5281 |
} |
} |
| 5282 |
EOF |
EOF |
| 5283 |
# we should really use a build-platform specific compiler |
# we should really use a build-platform specific compiler |
| 5284 |
# here, but OTOH, the wrappers (shell script and this C one) |
# here, but OTOH, the wrappers (shell script and this C one) |
| 5285 |
# are only useful if you want to execute the "real" binary. |
# are only useful if you want to execute the "real" binary. |
| 5286 |
# Since the "real" binary is built for $host, then this |
# Since the "real" binary is built for $host, then this |
| 5287 |
# wrapper might as well be built for $host, too. |
# wrapper might as well be built for $host, too. |
| 5288 |
$run $LTCC -s -o $cwrapper $cwrappersource |
$run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource |
| 5289 |
;; |
;; |
| 5290 |
esac |
esac |
| 5291 |
$rm $output |
$rm $output |
| 5292 |
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 |
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 |
| 5293 |
|
|
| 5294 |
$echo > $output "\ |
$echo > $output "\ |
| 5295 |
#! $SHELL |
#! $SHELL |
| 5434 |
$echo >> $output "\ |
$echo >> $output "\ |
| 5435 |
if test \"\$libtool_execute_magic\" != \"$magic\"; then |
if test \"\$libtool_execute_magic\" != \"$magic\"; then |
| 5436 |
# Run the actual program with our arguments. |
# Run the actual program with our arguments. |
| 5437 |
|
|
| 5438 |
|
# Make sure env LD_LIBRARY_PATH does not mess us up |
| 5439 |
|
if test -n \"\${LD_LIBRARY_PATH+set}\"; then |
| 5440 |
|
export LD_LIBRARY_PATH=\$progdir:\$LD_LIBRARY_PATH |
| 5441 |
|
fi |
| 5442 |
" |
" |
| 5443 |
case $host in |
case $host in |
| 5444 |
# Backslashes separate directories on plain windows |
# Backslashes separate directories on plain windows |
| 5445 |
*-*-mingw | *-*-os2*) |
*-*-mingw | *-*-os2*) |
| 5446 |
$echo >> $output "\ |
$echo >> $output "\ |
| 5447 |
exec \$progdir\\\\\$program \${1+\"\$@\"} |
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} |
| 5448 |
" |
" |
| 5449 |
;; |
;; |
| 5450 |
|
|
| 5451 |
*) |
*) |
| 5452 |
$echo >> $output "\ |
$echo >> $output "\ |
| 5453 |
exec \$progdir/\$program \${1+\"\$@\"} |
exec \"\$progdir/\$program\" \${1+\"\$@\"} |
| 5454 |
" |
" |
| 5455 |
;; |
;; |
| 5456 |
esac |
esac |
| 5460 |
fi |
fi |
| 5461 |
else |
else |
| 5462 |
# The program doesn't exist. |
# The program doesn't exist. |
| 5463 |
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 |
\$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 |
| 5464 |
\$echo \"This script is just a wrapper for \$program.\" 1>&2 |
\$echo \"This script is just a wrapper for \$program.\" 1>&2 |
| 5465 |
$echo \"See the $PACKAGE documentation for more information.\" 1>&2 |
$echo \"See the $PACKAGE documentation for more information.\" 1>&2 |
| 5466 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
| 5502 |
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 |
| 5503 |
cmds=$old_archive_from_new_cmds |
cmds=$old_archive_from_new_cmds |
| 5504 |
else |
else |
| 5505 |
|
# POSIX demands no paths to be encoded in archives. We have |
| 5506 |
|
# to avoid creating archives with duplicate basenames if we |
| 5507 |
|
# might have to extract them afterwards, e.g., when creating a |
| 5508 |
|
# static archive out of a convenience library, or when linking |
| 5509 |
|
# the entirety of a libtool archive into another (currently |
| 5510 |
|
# not supported by libtool). |
| 5511 |
|
if (for obj in $oldobjs |
| 5512 |
|
do |
| 5513 |
|
$echo "X$obj" | $Xsed -e 's%^.*/%%' |
| 5514 |
|
done | sort | sort -uc >/dev/null 2>&1); then |
| 5515 |
|
: |
| 5516 |
|
else |
| 5517 |
|
$echo "copying selected object files to avoid basename conflicts..." |
| 5518 |
|
|
| 5519 |
|
if test -z "$gentop"; then |
| 5520 |
|
gentop="$output_objdir/${outputname}x" |
| 5521 |
|
generated="$generated $gentop" |
| 5522 |
|
|
| 5523 |
|
$show "${rm}r $gentop" |
| 5524 |
|
$run ${rm}r "$gentop" |
| 5525 |
|
$show "$mkdir $gentop" |
| 5526 |
|
$run $mkdir "$gentop" |
| 5527 |
|
exit_status=$? |
| 5528 |
|
if test "$exit_status" -ne 0 && test ! -d "$gentop"; then |
| 5529 |
|
exit $exit_status |
| 5530 |
|
fi |
| 5531 |
|
fi |
| 5532 |
|
|
| 5533 |
|
save_oldobjs=$oldobjs |
| 5534 |
|
oldobjs= |
| 5535 |
|
counter=1 |
| 5536 |
|
for obj in $save_oldobjs |
| 5537 |
|
do |
| 5538 |
|
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
| 5539 |
|
case " $oldobjs " in |
| 5540 |
|
" ") oldobjs=$obj ;; |
| 5541 |
|
*[\ /]"$objbase "*) |
| 5542 |
|
while :; do |
| 5543 |
|
# Make sure we don't pick an alternate name that also |
| 5544 |
|
# overlaps. |
| 5545 |
|
newobj=lt$counter-$objbase |
| 5546 |
|
counter=`expr $counter + 1` |
| 5547 |
|
case " $oldobjs " in |
| 5548 |
|
*[\ /]"$newobj "*) ;; |
| 5549 |
|
*) if test ! -f "$gentop/$newobj"; then break; fi ;; |
| 5550 |
|
esac |
| 5551 |
|
done |
| 5552 |
|
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" |
| 5553 |
|
$run ln "$obj" "$gentop/$newobj" || |
| 5554 |
|
$run cp "$obj" "$gentop/$newobj" |
| 5555 |
|
oldobjs="$oldobjs $gentop/$newobj" |
| 5556 |
|
;; |
| 5557 |
|
*) oldobjs="$oldobjs $obj" ;; |
| 5558 |
|
esac |
| 5559 |
|
done |
| 5560 |
|
fi |
| 5561 |
|
|
| 5562 |
eval cmds=\"$old_archive_cmds\" |
eval cmds=\"$old_archive_cmds\" |
| 5563 |
|
|
| 5564 |
if len=`expr "X$cmds" : ".*"` && |
if len=`expr "X$cmds" : ".*"` && |
| 5572 |
objlist= |
objlist= |
| 5573 |
concat_cmds= |
concat_cmds= |
| 5574 |
save_oldobjs=$oldobjs |
save_oldobjs=$oldobjs |
| 5575 |
# GNU ar 2.10+ was changed to match POSIX; thus no paths are |
|
|
# encoded into archives. This makes 'ar r' malfunction in |
|
|
# this piecewise linking case whenever conflicting object |
|
|
# names appear in distinct ar calls; check, warn and compensate. |
|
|
if (for obj in $save_oldobjs |
|
|
do |
|
|
$echo "X$obj" | $Xsed -e 's%^.*/%%' |
|
|
done | sort | sort -uc >/dev/null 2>&1); then |
|
|
: |
|
|
else |
|
|
$echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 |
|
|
$echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 |
|
|
AR_FLAGS=cq |
|
|
fi |
|
| 5576 |
# Is there a better way of finding the last object in the list? |
# Is there a better way of finding the last object in the list? |
| 5577 |
for obj in $save_oldobjs |
for obj in $save_oldobjs |
| 5578 |
do |
do |
| 5583 |
oldobjs="$objlist $obj" |
oldobjs="$objlist $obj" |
| 5584 |
objlist="$objlist $obj" |
objlist="$objlist $obj" |
| 5585 |
eval test_cmds=\"$old_archive_cmds\" |
eval test_cmds=\"$old_archive_cmds\" |
| 5586 |
if len=`expr "X$test_cmds" : ".*"` && |
if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && |
| 5587 |
test "$len" -le "$max_cmd_len"; then |
test "$len" -le "$max_cmd_len"; then |
| 5588 |
: |
: |
| 5589 |
else |
else |
| 5590 |
# the above command should be used before it gets too long |
# the above command should be used before it gets too long |
| 5591 |
oldobjs=$objlist |
oldobjs=$objlist |
| 5592 |
if test "$obj" = "$last_oldobj" ; then |
if test "$obj" = "$last_oldobj" ; then |
| 5593 |
RANLIB=$save_RANLIB |
RANLIB=$save_RANLIB |
| 5594 |
fi |
fi |
| 5595 |
test -z "$concat_cmds" || concat_cmds=$concat_cmds~ |
test -z "$concat_cmds" || concat_cmds=$concat_cmds~ |
| 5596 |
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" |
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" |
| 5666 |
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
| 5667 |
exit $EXIT_FAILURE |
exit $EXIT_FAILURE |
| 5668 |
fi |
fi |
| 5669 |
newdependency_libs="$newdependency_libs $libdir/$name" |
if test "X$EGREP" = X ; then |
| 5670 |
|
EGREP=egrep |
| 5671 |
|
fi |
| 5672 |
|
# We do not want portage's install root ($D) present. Check only for |
| 5673 |
|
# this if the .la is being installed. |
| 5674 |
|
if test "$installed" = yes && test "$D"; then |
| 5675 |
|
eval mynewdependency_lib=`echo "$libdir/$name" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` |
| 5676 |
|
else |
| 5677 |
|
mynewdependency_lib="$libdir/$name" |
| 5678 |
|
fi |
| 5679 |
|
# Do not add duplicates |
| 5680 |
|
if test "$mynewdependency_lib"; then |
| 5681 |
|
my_little_ninja_foo_1=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` |
| 5682 |
|
if test -z "$my_little_ninja_foo_1"; then |
| 5683 |
|
newdependency_libs="$newdependency_libs $mynewdependency_lib" |
| 5684 |
|
fi |
| 5685 |
|
fi |
| 5686 |
|
;; |
| 5687 |
|
*) |
| 5688 |
|
if test "$installed" = yes; then |
| 5689 |
|
# Rather use S=WORKDIR if our version of portage supports it. |
| 5690 |
|
# This is because some ebuild (gcc) do not use $S as buildroot. |
| 5691 |
|
if test "$PWORKDIR"; then |
| 5692 |
|
S="$PWORKDIR" |
| 5693 |
|
fi |
| 5694 |
|
# We do not want portage's build root ($S) present. |
| 5695 |
|
my_little_ninja_foo_2=`echo $deplib |$EGREP -e "$S"` |
| 5696 |
|
# We do not want portage's install root ($D) present. |
| 5697 |
|
my_little_ninja_foo_3=`echo $deplib |$EGREP -e "$D"` |
| 5698 |
|
if test -n "$my_little_ninja_foo_2" && test "$S"; then |
| 5699 |
|
mynewdependency_lib="" |
| 5700 |
|
elif test -n "$my_little_ninja_foo_3" && test "$D"; then |
| 5701 |
|
eval mynewdependency_lib=`echo "$deplib" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` |
| 5702 |
|
else |
| 5703 |
|
mynewdependency_lib="$deplib" |
| 5704 |
|
fi |
| 5705 |
|
else |
| 5706 |
|
mynewdependency_lib="$deplib" |
| 5707 |
|
fi |
| 5708 |
|
# Do not add duplicates |
| 5709 |
|
if test "$mynewdependency_lib"; then |
| 5710 |
|
my_little_ninja_foo_4=`echo $newdependency_libs |$EGREP -e "$mynewdependency_lib"` |
| 5711 |
|
if test -z "$my_little_ninja_foo_4"; then |
| 5712 |
|
newdependency_libs="$newdependency_libs $mynewdependency_lib" |
| 5713 |
|
fi |
| 5714 |
|
fi |
| 5715 |
;; |
;; |
|
*) newdependency_libs="$newdependency_libs $deplib" ;; |
|
| 5716 |
esac |
esac |
| 5717 |
done |
done |
| 5718 |
dependency_libs="$newdependency_libs" |
dependency_libs="$newdependency_libs" |
| 5764 |
case $host,$output,$installed,$module,$dlname in |
case $host,$output,$installed,$module,$dlname in |
| 5765 |
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; |
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; |
| 5766 |
esac |
esac |
| 5767 |
|
# Do not add duplicates |
| 5768 |
|
if test "$installed" = yes && test "$D"; then |
| 5769 |
|
install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` |
| 5770 |
|
fi |
| 5771 |
$echo > $output "\ |
$echo > $output "\ |
| 5772 |
# $outputname - a libtool library file |
# $outputname - a libtool library file |
| 5773 |
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
| 5828 |
# install_prog (especially on Windows NT). |
# install_prog (especially on Windows NT). |
| 5829 |
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || |
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || |
| 5830 |
# Allow the use of GNU shtool's install command. |
# Allow the use of GNU shtool's install command. |
| 5831 |
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then |
$echo "X$nonopt" | grep shtool > /dev/null; then |
| 5832 |
# Aesthetically quote it. |
# Aesthetically quote it. |
| 5833 |
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` |
| 5834 |
case $arg in |
case $arg in |
| 5835 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
| 5836 |
arg="\"$arg\"" |
arg="\"$arg\"" |
| 5837 |
;; |
;; |
| 5838 |
esac |
esac |
| 5841 |
shift |
shift |
| 5842 |
else |
else |
| 5843 |
install_prog= |
install_prog= |
| 5844 |
arg="$nonopt" |
arg=$nonopt |
| 5845 |
fi |
fi |
| 5846 |
|
|
| 5847 |
# The real first argument should be the name of the installation program. |
# The real first argument should be the name of the installation program. |
| 5848 |
# Aesthetically quote it. |
# Aesthetically quote it. |
| 5849 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
| 5850 |
case $arg in |
case $arg in |
| 5851 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
| 5852 |
arg="\"$arg\"" |
arg="\"$arg\"" |
| 5853 |
;; |
;; |
| 5854 |
esac |
esac |
| 5866 |
do |
do |
| 5867 |
if test -n "$dest"; then |
if test -n "$dest"; then |
| 5868 |
files="$files $dest" |
files="$files $dest" |
| 5869 |
dest="$arg" |
dest=$arg |
| 5870 |
continue |
continue |
| 5871 |
fi |
fi |
| 5872 |
|
|
| 5873 |
case $arg in |
case $arg in |
| 5874 |
-d) isdir=yes ;; |
-d) isdir=yes ;; |
| 5875 |
-f) prev="-f" ;; |
-f) |
| 5876 |
-g) prev="-g" ;; |
case " $install_prog " in |
| 5877 |
-m) prev="-m" ;; |
*[\\\ /]cp\ *) ;; |
| 5878 |
-o) prev="-o" ;; |
*) prev=$arg ;; |
| 5879 |
|
esac |
| 5880 |
|
;; |
| 5881 |
|
-g | -m | -o) prev=$arg ;; |
| 5882 |
-s) |
-s) |
| 5883 |
stripme=" -s" |
stripme=" -s" |
| 5884 |
continue |
continue |
| 5885 |
;; |
;; |
| 5886 |
-*) ;; |
-*) |
| 5887 |
|
;; |
| 5888 |
*) |
*) |
| 5889 |
# If the previous option needed an argument, then skip it. |
# If the previous option needed an argument, then skip it. |
| 5890 |
if test -n "$prev"; then |
if test -n "$prev"; then |
| 5891 |
prev= |
prev= |
| 5892 |
else |
else |
| 5893 |
dest="$arg" |
dest=$arg |
| 5894 |
continue |
continue |
| 5895 |
fi |
fi |
| 5896 |
;; |
;; |
| 5899 |
# Aesthetically quote the argument. |
# Aesthetically quote the argument. |
| 5900 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
| 5901 |
case $arg in |
case $arg in |
| 5902 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
| 5903 |
arg="\"$arg\"" |
arg="\"$arg\"" |
| 5904 |
;; |
;; |
| 5905 |
esac |
esac |
| 6068 |
|
|
| 6069 |
if test "$#" -gt 0; then |
if test "$#" -gt 0; then |
| 6070 |
# Delete the old symlinks, and create new ones. |
# Delete the old symlinks, and create new ones. |
| 6071 |
|
# Try `ln -sf' first, because the `ln' binary might depend on |
| 6072 |
|
# the symlink we replace! Solaris /bin/ln does not understand -f, |
| 6073 |
|
# so we also need to try rm && ln -s. |
| 6074 |
for linkname |
for linkname |
| 6075 |
do |
do |
| 6076 |
if test "$linkname" != "$realname"; then |
if test "$linkname" != "$realname"; then |
| 6077 |
$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" |
$show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" |
| 6078 |
$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" |
$run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" |
| 6079 |
fi |
fi |
| 6080 |
done |
done |
| 6081 |
fi |
fi |
| 6088 |
IFS="$save_ifs" |
IFS="$save_ifs" |
| 6089 |
eval cmd=\"$cmd\" |
eval cmd=\"$cmd\" |
| 6090 |
$show "$cmd" |
$show "$cmd" |
| 6091 |
$run eval "$cmd" || exit $? |
$run eval "$cmd" || { |
| 6092 |
|
lt_exit=$? |
| 6093 |
|
|
| 6094 |
|
# Restore the uninstalled library and exit |
| 6095 |
|
if test "$mode" = relink; then |
| 6096 |
|
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' |
| 6097 |
|
fi |
| 6098 |
|
|
| 6099 |
|
exit $lt_exit |
| 6100 |
|
} |
| 6101 |
done |
done |
| 6102 |
IFS="$save_ifs" |
IFS="$save_ifs" |
| 6103 |
fi |
fi |
| 6191 |
notinst_deplibs= |
notinst_deplibs= |
| 6192 |
relink_command= |
relink_command= |
| 6193 |
|
|
| 6194 |
# To insure that "foo" is sourced, and not "foo.exe", |
# Note that it is not necessary on cygwin/mingw to append a dot to |
| 6195 |
# finese the cygwin/MSYS system by explicitly sourcing "foo." |
# foo even if both foo and FILE.exe exist: automatic-append-.exe |
| 6196 |
# which disallows the automatic-append-.exe behavior. |
# behavior happens only for exec(3), not for open(2)! Also, sourcing |
| 6197 |
case $build in |
# `FILE.' does not work on cygwin managed mounts. |
| 6198 |
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;; |
# |
|
*) wrapperdot=${wrapper} ;; |
|
|
esac |
|
| 6199 |
# If there is no directory component, then add one. |
# If there is no directory component, then add one. |
| 6200 |
case $file in |
case $wrapper in |
| 6201 |
*/* | *\\*) . ${wrapperdot} ;; |
*/* | *\\*) . ${wrapper} ;; |
| 6202 |
*) . ./${wrapperdot} ;; |
*) . ./${wrapper} ;; |
| 6203 |
esac |
esac |
| 6204 |
|
|
| 6205 |
# Check the variables that should have been set. |
# Check the variables that should have been set. |
| 6227 |
done |
done |
| 6228 |
|
|
| 6229 |
relink_command= |
relink_command= |
| 6230 |
# To insure that "foo" is sourced, and not "foo.exe", |
# Note that it is not necessary on cygwin/mingw to append a dot to |
| 6231 |
# finese the cygwin/MSYS system by explicitly sourcing "foo." |
# foo even if both foo and FILE.exe exist: automatic-append-.exe |
| 6232 |
# which disallows the automatic-append-.exe behavior. |
# behavior happens only for exec(3), not for open(2)! Also, sourcing |
| 6233 |
case $build in |
# `FILE.' does not work on cygwin managed mounts. |
| 6234 |
*cygwin* | *mingw*) wrapperdot=${wrapper}. ;; |
# |
|
*) wrapperdot=${wrapper} ;; |
|
|
esac |
|
| 6235 |
# If there is no directory component, then add one. |
# If there is no directory component, then add one. |
| 6236 |
case $file in |
case $wrapper in |
| 6237 |
*/* | *\\*) . ${wrapperdot} ;; |
*/* | *\\*) . ${wrapper} ;; |
| 6238 |
*) . ./${wrapperdot} ;; |
*) . ./${wrapper} ;; |
| 6239 |
esac |
esac |
| 6240 |
|
|
| 6241 |
outputname= |
outputname= |
| 6242 |
if test "$fast_install" = no && test -n "$relink_command"; then |
if test "$fast_install" = no && test -n "$relink_command"; then |
| 6243 |
if test "$finalize" = yes && test -z "$run"; then |
if test "$finalize" = yes && test -z "$run"; then |
| 6244 |
tmpdir="/tmp" |
tmpdir=`func_mktempdir` |
|
test -n "$TMPDIR" && tmpdir="$TMPDIR" |
|
|
tmpdir="$tmpdir/libtool-$$" |
|
|
save_umask=`umask` |
|
|
umask 0077 |
|
|
if $mkdir "$tmpdir"; then |
|
|
umask $save_umask |
|
|
else |
|
|
umask $save_umask |
|
|
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 |
|
|
continue |
|
|
fi |
|
| 6245 |
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` |
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` |
| 6246 |
outputname="$tmpdir/$file" |
outputname="$tmpdir/$file" |
| 6247 |
# Replace the output file specification. |
# Replace the output file specification. |
| 6265 |
fi |
fi |
| 6266 |
|
|
| 6267 |
# remove .exe since cygwin /usr/bin/install will append another |
# remove .exe since cygwin /usr/bin/install will append another |
| 6268 |
# one anyways |
# one anyway |
| 6269 |
case $install_prog,$host in |
case $install_prog,$host in |
| 6270 |
*/usr/bin/install*,*cygwin*) |
*/usr/bin/install*,*cygwin*) |
| 6271 |
case $file:$destfile in |
case $file:$destfile in |
| 6365 |
# Exit here if they wanted silent mode. |
# Exit here if they wanted silent mode. |
| 6366 |
test "$show" = : && exit $EXIT_SUCCESS |
test "$show" = : && exit $EXIT_SUCCESS |
| 6367 |
|
|
| 6368 |
$echo "----------------------------------------------------------------------" |
$echo "X----------------------------------------------------------------------" | $Xsed |
| 6369 |
$echo "Libraries have been installed in:" |
$echo "Libraries have been installed in:" |
| 6370 |
for libdir in $libdirs; do |
for libdir in $libdirs; do |
| 6371 |
$echo " $libdir" |
$echo " $libdir" |
| 6398 |
$echo |
$echo |
| 6399 |
$echo "See any operating system documentation about shared libraries for" |
$echo "See any operating system documentation about shared libraries for" |
| 6400 |
$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." |
| 6401 |
$echo "----------------------------------------------------------------------" |
$echo "X----------------------------------------------------------------------" | $Xsed |
| 6402 |
exit $EXIT_SUCCESS |
exit $EXIT_SUCCESS |
| 6403 |
;; |
;; |
| 6404 |
|
|
| 6615 |
rmfiles="$rmfiles $objdir/$n" |
rmfiles="$rmfiles $objdir/$n" |
| 6616 |
done |
done |
| 6617 |
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" |
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" |
|
test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" |
|
| 6618 |
|
|
| 6619 |
if test "$mode" = uninstall; then |
case "$mode" in |
| 6620 |
|
clean) |
| 6621 |
|
case " $library_names " in |
| 6622 |
|
# " " in the beginning catches empty $dlname |
| 6623 |
|
*" $dlname "*) ;; |
| 6624 |
|
*) rmfiles="$rmfiles $objdir/$dlname" ;; |
| 6625 |
|
esac |
| 6626 |
|
test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" |
| 6627 |
|
;; |
| 6628 |
|
uninstall) |
| 6629 |
if test -n "$library_names"; then |
if test -n "$library_names"; then |
| 6630 |
# Do each command in the postuninstall commands. |
# Do each command in the postuninstall commands. |
| 6631 |
cmds=$postuninstall_cmds |
cmds=$postuninstall_cmds |
| 6658 |
IFS="$save_ifs" |
IFS="$save_ifs" |
| 6659 |
fi |
fi |
| 6660 |
# FIXME: should reinstall the best remaining shared library. |
# FIXME: should reinstall the best remaining shared library. |
| 6661 |
fi |
;; |
| 6662 |
|
esac |
| 6663 |
fi |
fi |
| 6664 |
;; |
;; |
| 6665 |
|
|
| 6944 |
$echo |
$echo |
| 6945 |
$echo "Try \`$modename --help' for more information about other modes." |
$echo "Try \`$modename --help' for more information about other modes." |
| 6946 |
|
|
| 6947 |
exit $EXIT_SUCCESS |
exit $? |
| 6948 |
|
|
| 6949 |
# 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 |
| 6950 |
# in which we disable both kinds of libraries. Given conflicting |
# in which we disable both kinds of libraries. Given conflicting |
| 6958 |
# configuration. But we'll never go from static-only to shared-only. |
# configuration. But we'll never go from static-only to shared-only. |
| 6959 |
|
|
| 6960 |
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared |
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared |
| 6961 |
build_libtool_libs=no |
disable_libs=shared |
|
build_old_libs=yes |
|
| 6962 |
# ### END LIBTOOL TAG CONFIG: disable-shared |
# ### END LIBTOOL TAG CONFIG: disable-shared |
| 6963 |
|
|
| 6964 |
# ### BEGIN LIBTOOL TAG CONFIG: disable-static |
# ### BEGIN LIBTOOL TAG CONFIG: disable-static |
| 6965 |
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` |
disable_libs=static |
| 6966 |
# ### END LIBTOOL TAG CONFIG: disable-static |
# ### END LIBTOOL TAG CONFIG: disable-static |
| 6967 |
|
|
| 6968 |
# Local Variables: |
# Local Variables: |