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 ltconfig. |
# NOTE: Changing this file will not affect anything until you rerun configure. |
3 |
# |
# |
4 |
# Copyright (C) 1996-1999 Free Software Foundation, Inc. |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 |
5 |
|
# 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 |
# |
# |
8 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
55 |
# Constants. |
# Constants. |
56 |
PROGRAM=ltmain.sh |
PROGRAM=ltmain.sh |
57 |
PACKAGE=libtool |
PACKAGE=libtool |
58 |
VERSION=1.3b |
VERSION=1.4.2 |
59 |
TIMESTAMP=" (1.581 1999/07/02 15:16:39)" |
TIMESTAMP=" (1.922.2.53 2001/09/11 03:18:52)" |
60 |
|
|
61 |
default_mode= |
default_mode= |
62 |
help="Try \`$progname --help' for more information." |
help="Try \`$progname --help' for more information." |
84 |
save_LANG="$LANG"; LANG=C; export LANG |
save_LANG="$LANG"; LANG=C; export LANG |
85 |
fi |
fi |
86 |
|
|
87 |
if test "$LTCONFIG_VERSION" != "$VERSION"; then |
# Make sure IFS has a sensible default |
88 |
echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2 |
: ${IFS=" "} |
|
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
|
|
exit 1 |
|
|
fi |
|
89 |
|
|
90 |
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
91 |
echo "$modename: not configured to build any kind of library" 1>&2 |
echo "$modename: not configured to build any kind of library" 1>&2 |
111 |
arg="$1" |
arg="$1" |
112 |
shift |
shift |
113 |
|
|
114 |
case "$arg" in |
case $arg in |
115 |
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; |
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; |
116 |
*) optarg= ;; |
*) optarg= ;; |
117 |
esac |
esac |
118 |
|
|
119 |
# If the previous option needs an argument, assign it. |
# If the previous option needs an argument, assign it. |
120 |
if test -n "$prev"; then |
if test -n "$prev"; then |
121 |
case "$prev" in |
case $prev in |
122 |
execute_dlfiles) |
execute_dlfiles) |
123 |
eval "$prev=\"\$$prev \$arg\"" |
execute_dlfiles="$execute_dlfiles $arg" |
124 |
;; |
;; |
125 |
*) |
*) |
126 |
eval "$prev=\$arg" |
eval "$prev=\$arg" |
133 |
fi |
fi |
134 |
|
|
135 |
# Have we seen a non-optional argument yet? |
# Have we seen a non-optional argument yet? |
136 |
case "$arg" in |
case $arg in |
137 |
--help) |
--help) |
138 |
show_help=yes |
show_help=yes |
139 |
;; |
;; |
144 |
;; |
;; |
145 |
|
|
146 |
--config) |
--config) |
147 |
sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0 |
sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 |
148 |
exit 0 |
exit 0 |
149 |
;; |
;; |
150 |
|
|
205 |
exit 1 |
exit 1 |
206 |
fi |
fi |
207 |
|
|
208 |
|
# If this variable is set in any of the actions, the command in it |
209 |
|
# will be execed at the end. This prevents here-documents from being |
210 |
|
# left over by shells. |
211 |
|
exec_cmd= |
212 |
|
|
213 |
if test -z "$show_help"; then |
if test -z "$show_help"; then |
214 |
|
|
215 |
# Infer the operation mode. |
# Infer the operation mode. |
216 |
if test -z "$mode"; then |
if test -z "$mode"; then |
217 |
case "$nonopt" in |
case $nonopt in |
218 |
*cc | *++ | gcc* | *-gcc*) |
*cc | *++ | gcc* | *-gcc*) |
219 |
mode=link |
mode=link |
220 |
for arg |
for arg |
221 |
do |
do |
222 |
case "$arg" in |
case $arg in |
223 |
-c) |
-c) |
224 |
mode=compile |
mode=compile |
225 |
break |
break |
264 |
help="Try \`$modename --help --mode=$mode' for more information." |
help="Try \`$modename --help --mode=$mode' for more information." |
265 |
|
|
266 |
# These modes are in order of execution frequency so that they run quickly. |
# These modes are in order of execution frequency so that they run quickly. |
267 |
case "$mode" in |
case $mode in |
268 |
# libtool compile mode |
# libtool compile mode |
269 |
compile) |
compile) |
270 |
modename="$modename: compile" |
modename="$modename: compile" |
271 |
# Get the compilation command and the source file. |
# Get the compilation command and the source file. |
272 |
base_compile= |
base_compile= |
273 |
|
prev= |
274 |
lastarg= |
lastarg= |
275 |
srcfile="$nonopt" |
srcfile="$nonopt" |
276 |
suppress_output= |
suppress_output= |
278 |
user_target=no |
user_target=no |
279 |
for arg |
for arg |
280 |
do |
do |
281 |
|
case $prev in |
282 |
|
"") ;; |
283 |
|
xcompiler) |
284 |
|
# Aesthetically quote the previous argument. |
285 |
|
prev= |
286 |
|
lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
287 |
|
|
288 |
|
case $arg in |
289 |
|
# Double-quote args containing other shell metacharacters. |
290 |
|
# Many Bourne shells cannot handle close brackets correctly |
291 |
|
# in scan sets, so we specify it separately. |
292 |
|
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
293 |
|
arg="\"$arg\"" |
294 |
|
;; |
295 |
|
esac |
296 |
|
|
297 |
|
# Add the previous argument to base_compile. |
298 |
|
if test -z "$base_compile"; then |
299 |
|
base_compile="$lastarg" |
300 |
|
else |
301 |
|
base_compile="$base_compile $lastarg" |
302 |
|
fi |
303 |
|
continue |
304 |
|
;; |
305 |
|
esac |
306 |
|
|
307 |
# Accept any command-line options. |
# Accept any command-line options. |
308 |
case "$arg" in |
case $arg in |
309 |
-o) |
-o) |
310 |
if test "$user_target" != "no"; then |
if test "$user_target" != "no"; then |
311 |
$echo "$modename: you cannot specify \`-o' more than once" 1>&2 |
$echo "$modename: you cannot specify \`-o' more than once" 1>&2 |
318 |
build_old_libs=yes |
build_old_libs=yes |
319 |
continue |
continue |
320 |
;; |
;; |
321 |
|
|
322 |
|
-prefer-pic) |
323 |
|
pic_mode=yes |
324 |
|
continue |
325 |
|
;; |
326 |
|
|
327 |
|
-prefer-non-pic) |
328 |
|
pic_mode=no |
329 |
|
continue |
330 |
|
;; |
331 |
|
|
332 |
|
-Xcompiler) |
333 |
|
prev=xcompiler |
334 |
|
continue |
335 |
|
;; |
336 |
|
|
337 |
|
-Wc,*) |
338 |
|
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` |
339 |
|
lastarg= |
340 |
|
save_ifs="$IFS"; IFS=',' |
341 |
|
for arg in $args; do |
342 |
|
IFS="$save_ifs" |
343 |
|
|
344 |
|
# Double-quote args containing other shell metacharacters. |
345 |
|
# Many Bourne shells cannot handle close brackets correctly |
346 |
|
# in scan sets, so we specify it separately. |
347 |
|
case $arg in |
348 |
|
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
349 |
|
arg="\"$arg\"" |
350 |
|
;; |
351 |
|
esac |
352 |
|
lastarg="$lastarg $arg" |
353 |
|
done |
354 |
|
IFS="$save_ifs" |
355 |
|
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` |
356 |
|
|
357 |
|
# Add the arguments to base_compile. |
358 |
|
if test -z "$base_compile"; then |
359 |
|
base_compile="$lastarg" |
360 |
|
else |
361 |
|
base_compile="$base_compile $lastarg" |
362 |
|
fi |
363 |
|
continue |
364 |
|
;; |
365 |
esac |
esac |
366 |
|
|
367 |
case "$user_target" in |
case $user_target in |
368 |
next) |
next) |
369 |
# The next one is the -o target name |
# The next one is the -o target name |
370 |
user_target=yes |
user_target=yes |
390 |
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` |
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` |
391 |
|
|
392 |
# Double-quote args containing other shell metacharacters. |
# Double-quote args containing other shell metacharacters. |
393 |
# Many Bourne shells cannot handle close brackets correctly in scan |
# Many Bourne shells cannot handle close brackets correctly |
394 |
# sets, so we specify it separately. |
# in scan sets, so we specify it separately. |
395 |
case "$lastarg" in |
case $lastarg in |
396 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
397 |
lastarg="\"$lastarg\"" |
lastarg="\"$lastarg\"" |
398 |
;; |
;; |
399 |
esac |
esac |
406 |
fi |
fi |
407 |
done |
done |
408 |
|
|
409 |
case "$user_target" in |
case $user_target in |
410 |
set) |
set) |
411 |
;; |
;; |
412 |
no) |
no) |
422 |
# Recognize several different file suffixes. |
# Recognize several different file suffixes. |
423 |
# If the user specifies -o file.o, it is replaced with file.lo |
# If the user specifies -o file.o, it is replaced with file.lo |
424 |
xform='[cCFSfmso]' |
xform='[cCFSfmso]' |
425 |
case "$libobj" in |
case $libobj in |
426 |
*.ada) xform=ada ;; |
*.ada) xform=ada ;; |
427 |
*.adb) xform=adb ;; |
*.adb) xform=adb ;; |
428 |
*.ads) xform=ads ;; |
*.ads) xform=ads ;; |
437 |
|
|
438 |
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` |
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` |
439 |
|
|
440 |
case "$libobj" in |
case $libobj in |
441 |
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; |
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; |
442 |
*) |
*) |
443 |
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 |
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 |
461 |
$run $rm $removelist |
$run $rm $removelist |
462 |
trap "$run $rm $removelist; exit 1" 1 2 15 |
trap "$run $rm $removelist; exit 1" 1 2 15 |
463 |
|
|
464 |
|
# On Cygwin there's no "real" PIC flag so we must build both object types |
465 |
|
case $host_os in |
466 |
|
cygwin* | mingw* | pw32* | os2*) |
467 |
|
pic_mode=default |
468 |
|
;; |
469 |
|
esac |
470 |
|
if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then |
471 |
|
# non-PIC code in shared libraries is not supported |
472 |
|
pic_mode=default |
473 |
|
fi |
474 |
|
|
475 |
# Calculate the filename of the output object if compiler does |
# Calculate the filename of the output object if compiler does |
476 |
# not support -o with -c |
# not support -o with -c |
477 |
if test "$compiler_c_o" = no; then |
if test "$compiler_c_o" = no; then |
478 |
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext} |
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} |
479 |
lockfile="$output_obj.lock" |
lockfile="$output_obj.lock" |
480 |
removelist="$removelist $output_obj $lockfile" |
removelist="$removelist $output_obj $lockfile" |
481 |
trap "$run $rm $removelist; exit 1" 1 2 15 |
trap "$run $rm $removelist; exit 1" 1 2 15 |
487 |
# Lock this critical section if it is needed |
# Lock this critical section if it is needed |
488 |
# 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 |
489 |
if test "$need_locks" = yes; then |
if test "$need_locks" = yes; then |
490 |
until ln "$0" "$lockfile" 2>/dev/null; do |
until $run ln "$0" "$lockfile" 2>/dev/null; do |
491 |
$show "Waiting for $lockfile to be removed" |
$show "Waiting for $lockfile to be removed" |
492 |
sleep 2 |
sleep 2 |
493 |
done |
done |
519 |
# Without this assignment, base_compile gets emptied. |
# Without this assignment, base_compile gets emptied. |
520 |
fbsd_hideous_sh_bug=$base_compile |
fbsd_hideous_sh_bug=$base_compile |
521 |
|
|
522 |
# All platforms use -DPIC, to notify preprocessed assembler code. |
if test "$pic_mode" != no; then |
523 |
command="$base_compile $pic_flag -DPIC $srcfile" |
# All platforms use -DPIC, to notify preprocessed assembler code. |
524 |
|
command="$base_compile $srcfile $pic_flag -DPIC" |
525 |
|
else |
526 |
|
# Don't build PIC code |
527 |
|
command="$base_compile $srcfile" |
528 |
|
fi |
529 |
if test "$build_old_libs" = yes; then |
if test "$build_old_libs" = yes; then |
530 |
lo_libobj="$libobj" |
lo_libobj="$libobj" |
531 |
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` |
dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` |
596 |
fi |
fi |
597 |
|
|
598 |
# If we have no pic_flag, then copy the object into place and finish. |
# If we have no pic_flag, then copy the object into place and finish. |
599 |
if test -z "$pic_flag" && test "$build_old_libs" = yes; then |
if (test -z "$pic_flag" || test "$pic_mode" != default) && |
600 |
|
test "$build_old_libs" = yes; then |
601 |
# Rename the .lo from within objdir to obj |
# Rename the .lo from within objdir to obj |
602 |
if test -f $obj; then |
if test -f $obj; then |
603 |
$show $rm $obj |
$show $rm $obj |
612 |
exit $error |
exit $error |
613 |
fi |
fi |
614 |
|
|
615 |
|
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
616 |
|
if test "X$xdir" = "X$obj"; then |
617 |
|
xdir="." |
618 |
|
else |
619 |
|
xdir="$xdir" |
620 |
|
fi |
621 |
|
baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` |
622 |
|
libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` |
623 |
# Now arrange that obj and lo_libobj become the same file |
# Now arrange that obj and lo_libobj become the same file |
624 |
$show "$LN_S $obj $lo_libobj" |
$show "(cd $xdir && $LN_S $baseobj $libobj)" |
625 |
if $run $LN_S $obj $lo_libobj; then |
if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then |
626 |
|
# Unlock the critical section if it was locked |
627 |
|
if test "$need_locks" != no; then |
628 |
|
$run $rm "$lockfile" |
629 |
|
fi |
630 |
exit 0 |
exit 0 |
631 |
else |
else |
632 |
error=$? |
error=$? |
641 |
|
|
642 |
# Only build a position-dependent object if we build old libraries. |
# Only build a position-dependent object if we build old libraries. |
643 |
if test "$build_old_libs" = yes; then |
if test "$build_old_libs" = yes; then |
644 |
command="$base_compile $srcfile" |
if test "$pic_mode" != yes; then |
645 |
|
# Don't build PIC code |
646 |
|
command="$base_compile $srcfile" |
647 |
|
else |
648 |
|
# All platforms use -DPIC, to notify preprocessed assembler code. |
649 |
|
command="$base_compile $srcfile $pic_flag -DPIC" |
650 |
|
fi |
651 |
if test "$compiler_c_o" = yes; then |
if test "$compiler_c_o" = yes; then |
652 |
command="$command -o $obj" |
command="$command -o $obj" |
653 |
output_obj="$obj" |
output_obj="$obj" |
713 |
|
|
714 |
# Unlock the critical section if it was locked |
# Unlock the critical section if it was locked |
715 |
if test "$need_locks" != no; then |
if test "$need_locks" != no; then |
716 |
$rm "$lockfile" |
$run $rm "$lockfile" |
717 |
fi |
fi |
718 |
|
|
719 |
exit 0 |
exit 0 |
722 |
# libtool link mode |
# libtool link mode |
723 |
link | relink) |
link | relink) |
724 |
modename="$modename: link" |
modename="$modename: link" |
725 |
relink=no |
case $host in |
726 |
test "$mode" = "relink" && relink=yes |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
|
case "$host" in |
|
|
*-*-cygwin* | *-*-mingw* | *-*-os2*) |
|
727 |
# It is impossible to link a dll without this setting, and |
# It is impossible to link a dll without this setting, and |
728 |
# we shouldn't force the makefile maintainer to figure out |
# we shouldn't force the makefile maintainer to figure out |
729 |
# which system we are compiling for in order to pass an extra |
# which system we are compiling for in order to pass an extra |
736 |
# -no-undefined on the libtool link line when we can be certain |
# -no-undefined on the libtool link line when we can be certain |
737 |
# that all symbols are satisfied, otherwise we get a static library. |
# that all symbols are satisfied, otherwise we get a static library. |
738 |
allow_undefined=yes |
allow_undefined=yes |
|
|
|
|
# This is a source program that is used to create dlls on Windows |
|
|
# Don't remove nor modify the starting and closing comments |
|
|
# /* ltdll.c starts here */ |
|
|
# #define WIN32_LEAN_AND_MEAN |
|
|
# #include <windows.h> |
|
|
# #undef WIN32_LEAN_AND_MEAN |
|
|
# #include <stdio.h> |
|
|
# |
|
|
# #ifndef __CYGWIN__ |
|
|
# # ifdef __CYGWIN32__ |
|
|
# # define __CYGWIN__ __CYGWIN32__ |
|
|
# # endif |
|
|
# #endif |
|
|
# |
|
|
# #ifdef __cplusplus |
|
|
# extern "C" { |
|
|
# #endif |
|
|
# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); |
|
|
# #ifdef __cplusplus |
|
|
# } |
|
|
# #endif |
|
|
# |
|
|
# #ifdef __CYGWIN__ |
|
|
# #include <cygwin/cygwin_dll.h> |
|
|
# DECLARE_CYGWIN_DLL( DllMain ); |
|
|
# #endif |
|
|
# HINSTANCE __hDllInstance_base; |
|
|
# |
|
|
# BOOL APIENTRY |
|
|
# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) |
|
|
# { |
|
|
# __hDllInstance_base = hInst; |
|
|
# return TRUE; |
|
|
# } |
|
|
# /* ltdll.c ends here */ |
|
|
# This is a source program that is used to create import libraries |
|
|
# on Windows for dlls which lack them. Don't remove nor modify the |
|
|
# starting and closing comments |
|
|
# /* impgen.c starts here */ |
|
|
# /* Copyright (C) 1999 Free Software Foundation, Inc. |
|
|
# |
|
|
# This file is part of GNU libtool. |
|
|
# |
|
|
# This program is free software; you can redistribute it and/or modify |
|
|
# it under the terms of the GNU General Public License as published by |
|
|
# the Free Software Foundation; either version 2 of the License, or |
|
|
# (at your option) any later version. |
|
|
# |
|
|
# This program is distributed in the hope that it will be useful, |
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
# GNU General Public License for more details. |
|
|
# |
|
|
# You should have received a copy of the GNU General Public License |
|
|
# along with this program; if not, write to the Free Software |
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
|
# */ |
|
|
# |
|
|
# #include <stdio.h> /* for printf() */ |
|
|
# #include <unistd.h> /* for open(), lseek(), read() */ |
|
|
# #include <fcntl.h> /* for O_RDONLY, O_BINARY */ |
|
|
# #include <string.h> /* for strdup() */ |
|
|
# |
|
|
# static unsigned int |
|
|
# pe_get16 (fd, offset) |
|
|
# int fd; |
|
|
# int offset; |
|
|
# { |
|
|
# unsigned char b[2]; |
|
|
# lseek (fd, offset, SEEK_SET); |
|
|
# read (fd, b, 2); |
|
|
# return b[0] + (b[1]<<8); |
|
|
# } |
|
|
# |
|
|
# static unsigned int |
|
|
# pe_get32 (fd, offset) |
|
|
# int fd; |
|
|
# int offset; |
|
|
# { |
|
|
# unsigned char b[4]; |
|
|
# lseek (fd, offset, SEEK_SET); |
|
|
# read (fd, b, 4); |
|
|
# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); |
|
|
# } |
|
|
# |
|
|
# static unsigned int |
|
|
# pe_as32 (ptr) |
|
|
# void *ptr; |
|
|
# { |
|
|
# unsigned char *b = ptr; |
|
|
# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); |
|
|
# } |
|
|
# |
|
|
# int |
|
|
# main (argc, argv) |
|
|
# int argc; |
|
|
# char *argv[]; |
|
|
# { |
|
|
# int dll; |
|
|
# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; |
|
|
# unsigned long export_rva, export_size, nsections, secptr, expptr; |
|
|
# unsigned long name_rvas, nexp; |
|
|
# unsigned char *expdata, *erva; |
|
|
# char *filename, *dll_name; |
|
|
# |
|
|
# filename = argv[1]; |
|
|
# |
|
|
# dll = open(filename, O_RDONLY|O_BINARY); |
|
|
# if (!dll) |
|
|
# return 1; |
|
|
# |
|
|
# dll_name = filename; |
|
|
# |
|
|
# for (i=0; filename[i]; i++) |
|
|
# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') |
|
|
# dll_name = filename + i +1; |
|
|
# |
|
|
# pe_header_offset = pe_get32 (dll, 0x3c); |
|
|
# opthdr_ofs = pe_header_offset + 4 + 20; |
|
|
# num_entries = pe_get32 (dll, opthdr_ofs + 92); |
|
|
# |
|
|
# if (num_entries < 1) /* no exports */ |
|
|
# return 1; |
|
|
# |
|
|
# export_rva = pe_get32 (dll, opthdr_ofs + 96); |
|
|
# export_size = pe_get32 (dll, opthdr_ofs + 100); |
|
|
# nsections = pe_get16 (dll, pe_header_offset + 4 +2); |
|
|
# secptr = (pe_header_offset + 4 + 20 + |
|
|
# pe_get16 (dll, pe_header_offset + 4 + 16)); |
|
|
# |
|
|
# expptr = 0; |
|
|
# for (i = 0; i < nsections; i++) |
|
|
# { |
|
|
# char sname[8]; |
|
|
# unsigned long secptr1 = secptr + 40 * i; |
|
|
# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); |
|
|
# unsigned long vsize = pe_get32 (dll, secptr1 + 16); |
|
|
# unsigned long fptr = pe_get32 (dll, secptr1 + 20); |
|
|
# lseek(dll, secptr1, SEEK_SET); |
|
|
# read(dll, sname, 8); |
|
|
# if (vaddr <= export_rva && vaddr+vsize > export_rva) |
|
|
# { |
|
|
# expptr = fptr + (export_rva - vaddr); |
|
|
# if (export_rva + export_size > vaddr + vsize) |
|
|
# export_size = vsize - (export_rva - vaddr); |
|
|
# break; |
|
|
# } |
|
|
# } |
|
|
# |
|
|
# expdata = (unsigned char*)malloc(export_size); |
|
|
# lseek (dll, expptr, SEEK_SET); |
|
|
# read (dll, expdata, export_size); |
|
|
# erva = expdata - export_rva; |
|
|
# |
|
|
# nexp = pe_as32 (expdata+24); |
|
|
# name_rvas = pe_as32 (expdata+32); |
|
|
# |
|
|
# printf ("EXPORTS\n"); |
|
|
# for (i = 0; i<nexp; i++) |
|
|
# { |
|
|
# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4); |
|
|
# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i); |
|
|
# } |
|
|
# |
|
|
# return 0; |
|
|
# } |
|
|
# /* impgen.c ends here */ |
|
739 |
;; |
;; |
740 |
*) |
*) |
741 |
allow_undefined=yes |
allow_undefined=yes |
769 |
libobjs= |
libobjs= |
770 |
ltlibs= |
ltlibs= |
771 |
module=no |
module=no |
772 |
|
no_install=no |
773 |
objs= |
objs= |
774 |
prefer_static_libs=no |
prefer_static_libs=no |
775 |
preload=no |
preload=no |
786 |
# We need to know -static, to get the right output filenames. |
# We need to know -static, to get the right output filenames. |
787 |
for arg |
for arg |
788 |
do |
do |
789 |
case "$arg" in |
case $arg in |
790 |
-all-static | -static) |
-all-static | -static) |
791 |
if test "X$arg" = "X-all-static"; then |
if test "X$arg" = "X-all-static"; then |
792 |
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then |
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then |
815 |
while test $# -gt 0; do |
while test $# -gt 0; do |
816 |
arg="$1" |
arg="$1" |
817 |
shift |
shift |
818 |
libtool_args="$libtool_args $arg" |
case $arg in |
819 |
|
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
820 |
|
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test |
821 |
|
;; |
822 |
|
*) qarg=$arg ;; |
823 |
|
esac |
824 |
|
libtool_args="$libtool_args $qarg" |
825 |
|
|
826 |
# If the previous option needs an argument, assign it. |
# If the previous option needs an argument, assign it. |
827 |
if test -n "$prev"; then |
if test -n "$prev"; then |
828 |
case "$prev" in |
case $prev in |
829 |
output) |
output) |
830 |
compile_command="$compile_command @OUTPUT@" |
compile_command="$compile_command @OUTPUT@" |
831 |
finalize_command="$finalize_command @OUTPUT@" |
finalize_command="$finalize_command @OUTPUT@" |
832 |
;; |
;; |
833 |
esac |
esac |
834 |
|
|
835 |
case "$prev" in |
case $prev in |
836 |
dlfiles|dlprefiles) |
dlfiles|dlprefiles) |
837 |
if test "$preload" = no; then |
if test "$preload" = no; then |
838 |
# Add the symbol object into the linking commands. |
# Add the symbol object into the linking commands. |
840 |
finalize_command="$finalize_command @SYMFILE@" |
finalize_command="$finalize_command @SYMFILE@" |
841 |
preload=yes |
preload=yes |
842 |
fi |
fi |
843 |
case "$arg" in |
case $arg in |
844 |
*.la | *.lo) ;; # We handle these cases below. |
*.la | *.lo) ;; # We handle these cases below. |
845 |
force) |
force) |
846 |
if test "$dlself" = no; then |
if test "$dlself" = no; then |
869 |
dlprefiles="$dlprefiles $arg" |
dlprefiles="$dlprefiles $arg" |
870 |
fi |
fi |
871 |
prev= |
prev= |
872 |
|
continue |
873 |
;; |
;; |
874 |
esac |
esac |
875 |
;; |
;; |
894 |
;; |
;; |
895 |
rpath | xrpath) |
rpath | xrpath) |
896 |
# We need an absolute path. |
# We need an absolute path. |
897 |
case "$arg" in |
case $arg in |
898 |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
899 |
*) |
*) |
900 |
$echo "$modename: only absolute run-paths are allowed" 1>&2 |
$echo "$modename: only absolute run-paths are allowed" 1>&2 |
916 |
continue |
continue |
917 |
;; |
;; |
918 |
xcompiler) |
xcompiler) |
919 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
compiler_flags="$compiler_flags $qarg" |
|
case "$arg" in |
|
|
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
|
|
arg="\"$arg\"" |
|
|
;; |
|
|
esac |
|
|
compiler_flags="$compiler_flags $arg" |
|
920 |
prev= |
prev= |
921 |
|
compile_command="$compile_command $qarg" |
922 |
|
finalize_command="$finalize_command $qarg" |
923 |
continue |
continue |
924 |
;; |
;; |
925 |
xlinker) |
xlinker) |
926 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
linker_flags="$linker_flags $qarg" |
927 |
case "$arg" in |
compiler_flags="$compiler_flags $wl$qarg" |
|
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
|
|
arg="\"$arg\"" |
|
|
;; |
|
|
esac |
|
|
linker_flags="$linker_flags $arg" |
|
|
compiler_flags="$compiler_flags $wl$arg" |
|
928 |
prev= |
prev= |
929 |
|
compile_command="$compile_command $wl$qarg" |
930 |
|
finalize_command="$finalize_command $wl$qarg" |
931 |
continue |
continue |
932 |
;; |
;; |
933 |
*) |
*) |
936 |
continue |
continue |
937 |
;; |
;; |
938 |
esac |
esac |
939 |
fi |
fi # test -n $prev |
940 |
|
|
941 |
prevarg="$arg" |
prevarg="$arg" |
942 |
|
|
943 |
case "$arg" in |
case $arg in |
944 |
-all-static) |
-all-static) |
945 |
if test -n "$link_static_flag"; then |
if test -n "$link_static_flag"; then |
946 |
compile_command="$compile_command $link_static_flag" |
compile_command="$compile_command $link_static_flag" |
977 |
|
|
978 |
-export-symbols | -export-symbols-regex) |
-export-symbols | -export-symbols-regex) |
979 |
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then |
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then |
980 |
$echo "$modename: not more than one -exported-symbols argument allowed" |
$echo "$modename: more than one -exported-symbols argument is not allowed" |
981 |
exit 1 |
exit 1 |
982 |
fi |
fi |
983 |
if test "X$arg" = "X-export-symbols"; then |
if test "X$arg" = "X-export-symbols"; then |
988 |
continue |
continue |
989 |
;; |
;; |
990 |
|
|
991 |
|
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* |
992 |
|
# so, if we see these flags be careful not to treat them like -L |
993 |
|
-L[A-Z][A-Z]*:*) |
994 |
|
case $with_gcc/$host in |
995 |
|
no/*-*-irix*) |
996 |
|
compile_command="$compile_command $arg" |
997 |
|
finalize_command="$finalize_command $arg" |
998 |
|
;; |
999 |
|
esac |
1000 |
|
continue |
1001 |
|
;; |
1002 |
|
|
1003 |
-L*) |
-L*) |
1004 |
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` |
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` |
1005 |
# We need an absolute path. |
# We need an absolute path. |
1006 |
case "$dir" in |
case $dir in |
1007 |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
1008 |
*) |
*) |
1009 |
absdir=`cd "$dir" && pwd` |
absdir=`cd "$dir" && pwd` |
1021 |
lib_search_path="$lib_search_path $dir" |
lib_search_path="$lib_search_path $dir" |
1022 |
;; |
;; |
1023 |
esac |
esac |
1024 |
case "$host" in |
case $host in |
1025 |
*-*-cygwin* | *-*-mingw* | *-*-os2*) |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
1026 |
case ":$dllsearchpath:" in |
case :$dllsearchpath: in |
1027 |
*":$dir:"*) ;; |
*":$dir:"*) ;; |
1028 |
*) dllsearchpath="$dllsearchpath:$dir";; |
*) dllsearchpath="$dllsearchpath:$dir";; |
1029 |
esac |
esac |
1033 |
;; |
;; |
1034 |
|
|
1035 |
-l*) |
-l*) |
1036 |
if test "$arg" = "-lc"; then |
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then |
1037 |
case "$host" in |
case $host in |
1038 |
*-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) |
*-*-cygwin* | *-*-pw32* | *-*-beos*) |
1039 |
# These systems don't actually have c library (as such) |
# These systems don't actually have a C or math library (as such) |
1040 |
continue |
continue |
1041 |
;; |
;; |
1042 |
|
*-*-mingw* | *-*-os2*) |
1043 |
|
# These systems don't actually have a C library (as such) |
1044 |
|
test "X$arg" = "X-lc" && continue |
1045 |
|
;; |
1046 |
|
*-*-openbsd*) |
1047 |
|
# Do not include libc due to us having libc/libc_r. |
1048 |
|
test "X$arg" = "X-lc" && continue |
1049 |
|
;; |
1050 |
esac |
esac |
1051 |
elif test "$arg" = "-lm"; then |
elif test "X$arg" = "X-lc_r"; then |
1052 |
case "$host" in |
case $host in |
1053 |
*-*-cygwin* | *-*-beos*) |
*-*-openbsd*) |
1054 |
# These systems don't actually have math library (as such) |
# Do not include libc_r directly, use -pthread flag. |
1055 |
continue |
continue |
1056 |
;; |
;; |
1057 |
esac |
esac |
1070 |
continue |
continue |
1071 |
;; |
;; |
1072 |
|
|
1073 |
|
-no-install) |
1074 |
|
case $host in |
1075 |
|
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
1076 |
|
# The PATH hackery in wrapper scripts is required on Windows |
1077 |
|
# in order for the loader to find any dlls it needs. |
1078 |
|
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 |
1079 |
|
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 |
1080 |
|
fast_install=no |
1081 |
|
;; |
1082 |
|
*) no_install=yes ;; |
1083 |
|
esac |
1084 |
|
continue |
1085 |
|
;; |
1086 |
|
|
1087 |
-no-undefined) |
-no-undefined) |
1088 |
allow_undefined=no |
allow_undefined=no |
1089 |
continue |
continue |
1109 |
-R*) |
-R*) |
1110 |
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` |
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` |
1111 |
# We need an absolute path. |
# We need an absolute path. |
1112 |
case "$dir" in |
case $dir in |
1113 |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
1114 |
*) |
*) |
1115 |
$echo "$modename: only absolute run-paths are allowed" 1>&2 |
$echo "$modename: only absolute run-paths are allowed" 1>&2 |
1124 |
;; |
;; |
1125 |
|
|
1126 |
-static) |
-static) |
1127 |
# If we have no pic_flag, then this is the same as -all-static. |
# The effects of -static are defined in a previous loop. |
1128 |
if test -z "$pic_flag" && test -n "$link_static_flag"; then |
# We used to do the same as -all-static on platforms that |
1129 |
compile_command="$compile_command $link_static_flag" |
# didn't have a PIC flag, but the assumption that the effects |
1130 |
finalize_command="$finalize_command $link_static_flag" |
# would be equivalent was wrong. It would break on at least |
1131 |
fi |
# Digital Unix and AIX. |
1132 |
continue |
continue |
1133 |
;; |
;; |
1134 |
|
|
1141 |
prev=vinfo |
prev=vinfo |
1142 |
continue |
continue |
1143 |
;; |
;; |
1144 |
|
|
1145 |
-Wc,*) |
-Wc,*) |
1146 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` |
1147 |
case "$arg" in |
arg= |
1148 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
save_ifs="$IFS"; IFS=',' |
1149 |
arg="\"$arg\"" |
for flag in $args; do |
1150 |
;; |
IFS="$save_ifs" |
1151 |
esac |
case $flag in |
1152 |
flag=`$echo "X$arg" | $Xsed -e 's/^-Wc,//'` |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1153 |
compiler_flags="$compiler_flags $flag" |
flag="\"$flag\"" |
1154 |
|
;; |
1155 |
|
esac |
1156 |
|
arg="$arg $wl$flag" |
1157 |
|
compiler_flags="$compiler_flags $flag" |
1158 |
|
done |
1159 |
|
IFS="$save_ifs" |
1160 |
|
arg=`$echo "X$arg" | $Xsed -e "s/^ //"` |
1161 |
;; |
;; |
1162 |
|
|
1163 |
-Wl,*) |
-Wl,*) |
1164 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` |
1165 |
case "$arg" in |
arg= |
1166 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
save_ifs="$IFS"; IFS=',' |
1167 |
arg="\"$arg\"" |
for flag in $args; do |
1168 |
;; |
IFS="$save_ifs" |
1169 |
esac |
case $flag in |
1170 |
flag=`$echo "X$arg" | $Xsed -e 's/^-Wl,//'` |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1171 |
linker_flags="$linker_flags $flag" |
flag="\"$flag\"" |
1172 |
compiler_flags="$compiler_flags $wl$flag" |
;; |
1173 |
|
esac |
1174 |
|
arg="$arg $wl$flag" |
1175 |
|
compiler_flags="$compiler_flags $wl$flag" |
1176 |
|
linker_flags="$linker_flags $flag" |
1177 |
|
done |
1178 |
|
IFS="$save_ifs" |
1179 |
|
arg=`$echo "X$arg" | $Xsed -e "s/^ //"` |
1180 |
;; |
;; |
1181 |
|
|
1182 |
-Xcompiler) |
-Xcompiler) |
1194 |
# Unknown arguments in both finalize_command and compile_command need |
# Unknown arguments in both finalize_command and compile_command need |
1195 |
# to be aesthetically quoted because they are evaled later. |
# to be aesthetically quoted because they are evaled later. |
1196 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1197 |
case "$arg" in |
case $arg in |
1198 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1199 |
arg="\"$arg\"" |
arg="\"$arg\"" |
1200 |
;; |
;; |
1201 |
esac |
esac |
1202 |
;; |
;; |
1203 |
|
|
1204 |
*.o | *.obj) |
*.lo | *.$objext) |
1205 |
# A standard object. |
# A library or standard object. |
|
objs="$objs $arg" |
|
|
;; |
|
|
|
|
|
*.lo) |
|
|
# A library object. |
|
1206 |
if test "$prev" = dlfiles; then |
if test "$prev" = dlfiles; then |
1207 |
dlfiles="$dlfiles $arg" |
# This file was specified with -dlopen. |
1208 |
if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then |
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then |
1209 |
|
dlfiles="$dlfiles $arg" |
1210 |
prev= |
prev= |
1211 |
continue |
continue |
1212 |
else |
else |
1219 |
# Preload the old-style object. |
# Preload the old-style object. |
1220 |
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` |
dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` |
1221 |
prev= |
prev= |
1222 |
|
else |
1223 |
|
case $arg in |
1224 |
|
*.lo) libobjs="$libobjs $arg" ;; |
1225 |
|
*) objs="$objs $arg" ;; |
1226 |
|
esac |
1227 |
fi |
fi |
|
libobjs="$libobjs $arg" |
|
1228 |
;; |
;; |
1229 |
|
|
1230 |
*.a | *.lib) |
*.$libext) |
1231 |
# An archive. |
# An archive. |
1232 |
deplibs="$deplibs $arg" |
deplibs="$deplibs $arg" |
1233 |
old_deplibs="$old_deplibs $arg" |
old_deplibs="$old_deplibs $arg" |
1237 |
*.la) |
*.la) |
1238 |
# A libtool-controlled library. |
# A libtool-controlled library. |
1239 |
|
|
|
dlname= |
|
|
libdir= |
|
|
library_names= |
|
|
old_library= |
|
|
|
|
|
# Check to see that this really is a libtool archive. |
|
|
if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
|
|
else |
|
|
$echo "$modename: \`$arg' is not a valid libtool archive" 1>&2 |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
# If the library was installed with an old release of libtool, |
|
|
# it will not redefine variable installed. |
|
|
installed=yes |
|
|
|
|
|
# Read the .la file |
|
|
# If there is no directory component, then add one. |
|
|
case "$arg" in |
|
|
*/* | *\\*) . $arg ;; |
|
|
*) . ./$arg ;; |
|
|
esac |
|
|
|
|
|
# Get the name of the library we link against. |
|
|
linklib= |
|
|
for l in $old_library $library_names; do |
|
|
linklib="$l" |
|
|
done |
|
|
|
|
|
if test -z "$linklib"; then |
|
|
$echo "$modename: cannot find name of link library for \`$arg'" 1>&2 |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
if test "X$installed" = Xyes; then |
|
|
dir="$libdir" |
|
|
else |
|
|
dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
|
|
if test "X$dir" = "X$arg"; then |
|
|
dir="$objdir" |
|
|
else |
|
|
dir="$dir/$objdir" |
|
|
fi |
|
|
fi |
|
|
|
|
|
# This library was specified with -dlopen. |
|
1240 |
if test "$prev" = dlfiles; then |
if test "$prev" = dlfiles; then |
1241 |
|
# This library was specified with -dlopen. |
1242 |
dlfiles="$dlfiles $arg" |
dlfiles="$dlfiles $arg" |
|
if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then |
|
|
# If there is no dlname, no dlopen support or we're linking statically, |
|
|
# we need to preload. |
|
|
prev=dlprefiles |
|
|
else |
|
|
# We should not create a dependency on this library |
|
|
prev= |
|
|
continue |
|
|
fi |
|
|
fi |
|
|
|
|
|
# The library was specified with -dlpreopen. |
|
|
if test "$prev" = dlprefiles; then |
|
|
# Prefer using a static library (so that no silly _DYNAMIC symbols |
|
|
# are required to link). |
|
|
if test -n "$old_library"; then |
|
|
dlprefiles="$dlprefiles $dir/$old_library" |
|
|
else |
|
|
dlprefiles="$dlprefiles $dir/$linklib" |
|
|
fi |
|
1243 |
prev= |
prev= |
1244 |
|
elif test "$prev" = dlprefiles; then |
1245 |
|
# The library was specified with -dlpreopen. |
1246 |
|
dlprefiles="$dlprefiles $arg" |
1247 |
|
prev= |
1248 |
|
else |
1249 |
|
deplibs="$deplibs $arg" |
1250 |
fi |
fi |
|
|
|
|
deplibs="$deplibs $arg" |
|
1251 |
continue |
continue |
1252 |
;; |
;; |
1253 |
|
|
1256 |
# Unknown arguments in both finalize_command and compile_command need |
# Unknown arguments in both finalize_command and compile_command need |
1257 |
# to be aesthetically quoted because they are evaled later. |
# to be aesthetically quoted because they are evaled later. |
1258 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
1259 |
case "$arg" in |
case $arg in |
1260 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1261 |
arg="\"$arg\"" |
arg="\"$arg\"" |
1262 |
;; |
;; |
1263 |
esac |
esac |
1264 |
;; |
;; |
1265 |
esac |
esac # arg |
1266 |
|
|
1267 |
# Now actually substitute the argument into the commands. |
# Now actually substitute the argument into the commands. |
1268 |
if test -n "$arg"; then |
if test -n "$arg"; then |
1269 |
compile_command="$compile_command $arg" |
compile_command="$compile_command $arg" |
1270 |
finalize_command="$finalize_command $arg" |
finalize_command="$finalize_command $arg" |
1271 |
fi |
fi |
1272 |
done |
done # argument parsing loop |
1273 |
|
|
1274 |
if test -n "$prev"; then |
if test -n "$prev"; then |
1275 |
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2 |
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2 |
1283 |
finalize_command="$finalize_command $arg" |
finalize_command="$finalize_command $arg" |
1284 |
fi |
fi |
1285 |
|
|
|
oldlibs= |
|
1286 |
# calculate the name of the file, without its directory |
# calculate the name of the file, without its directory |
1287 |
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` |
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` |
1288 |
libobjs_save="$libobjs" |
libobjs_save="$libobjs" |
1289 |
|
|
1290 |
if test -n "$shlibpath_var"; then |
if test -n "$shlibpath_var"; then |
1291 |
# get the directories listed in $shlibpath_var |
# get the directories listed in $shlibpath_var |
1292 |
eval shlib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` |
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` |
1293 |
else |
else |
1294 |
shlib_search_path= |
shlib_search_path= |
1295 |
fi |
fi |
1296 |
eval sys_lib_search_path=\"$sys_lib_search_path_spec\" |
eval sys_lib_search_path=\"$sys_lib_search_path_spec\" |
1297 |
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" |
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" |
|
lib_search_path="$lib_search_path $sys_lib_search_path $shlib_search_path" |
|
1298 |
|
|
1299 |
case "$output" in |
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` |
1300 |
|
if test "X$output_objdir" = "X$output"; then |
1301 |
|
output_objdir="$objdir" |
1302 |
|
else |
1303 |
|
output_objdir="$output_objdir/$objdir" |
1304 |
|
fi |
1305 |
|
# Create the object directory. |
1306 |
|
if test ! -d $output_objdir; then |
1307 |
|
$show "$mkdir $output_objdir" |
1308 |
|
$run $mkdir $output_objdir |
1309 |
|
status=$? |
1310 |
|
if test $status -ne 0 && test ! -d $output_objdir; then |
1311 |
|
exit $status |
1312 |
|
fi |
1313 |
|
fi |
1314 |
|
|
1315 |
|
# Determine the type of output |
1316 |
|
case $output in |
1317 |
"") |
"") |
1318 |
$echo "$modename: you must specify an output file" 1>&2 |
$echo "$modename: you must specify an output file" 1>&2 |
1319 |
$echo "$help" 1>&2 |
$echo "$help" 1>&2 |
1320 |
exit 1 |
exit 1 |
1321 |
;; |
;; |
1322 |
|
*.$libext) linkmode=oldlib ;; |
1323 |
|
*.lo | *.$objext) linkmode=obj ;; |
1324 |
|
*.la) linkmode=lib ;; |
1325 |
|
*) linkmode=prog ;; # Anything else should be a program. |
1326 |
|
esac |
1327 |
|
|
1328 |
*.a | *.lib) |
specialdeplibs= |
1329 |
if test -n "$deplibs"; then |
libs= |
1330 |
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 |
# Find all interdependent deplibs by searching for libraries |
1331 |
fi |
# that are linked more than once (e.g. -la -lb -la) |
1332 |
|
for deplib in $deplibs; do |
1333 |
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
case "$libs " in |
1334 |
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 |
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
1335 |
fi |
esac |
1336 |
|
libs="$libs $deplib" |
1337 |
if test -n "$rpath"; then |
done |
1338 |
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 |
deplibs= |
1339 |
fi |
newdependency_libs= |
1340 |
|
newlib_search_path= |
1341 |
if test -n "$xrpath"; then |
need_relink=no # whether we're linking any uninstalled libtool libraries |
1342 |
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2 |
notinst_deplibs= # not-installed libtool libraries |
1343 |
fi |
notinst_path= # paths that contain not-installed libtool libraries |
1344 |
|
case $linkmode in |
1345 |
if test -n "$vinfo"; then |
lib) |
1346 |
$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 |
passes="conv link" |
1347 |
fi |
for file in $dlfiles $dlprefiles; do |
1348 |
|
case $file in |
1349 |
if test -n "$release"; then |
*.la) ;; |
1350 |
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2 |
*) |
1351 |
fi |
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 |
1352 |
|
exit 1 |
1353 |
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then |
;; |
1354 |
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 |
esac |
1355 |
fi |
done |
|
|
|
|
# Now set the variables for building old libraries. |
|
|
build_libtool_libs=no |
|
|
oldlibs="$output" |
|
|
objs="$objs$old_deplibs" |
|
|
;; |
|
|
|
|
|
*.la) |
|
|
# Make sure we only generate libraries of the form `libNAME.la'. |
|
|
case "$outputname" in |
|
|
lib*) |
|
|
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
|
|
eval libname=\"$libname_spec\" |
|
1356 |
;; |
;; |
1357 |
*) |
prog) |
1358 |
if test "$module" = no; then |
compile_deplibs= |
1359 |
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 |
finalize_deplibs= |
1360 |
$echo "$help" 1>&2 |
alldeplibs=no |
1361 |
exit 1 |
newdlfiles= |
1362 |
fi |
newdlprefiles= |
1363 |
if test "$need_lib_prefix" != no; then |
passes="conv scan dlopen dlpreopen link" |
|
# Add the "lib" prefix for modules if required |
|
|
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` |
|
|
eval libname=\"$libname_spec\" |
|
|
else |
|
|
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` |
|
|
fi |
|
1364 |
;; |
;; |
1365 |
esac |
*) passes="conv" |
1366 |
|
;; |
1367 |
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` |
esac |
1368 |
if test "X$output_objdir" = "X$output"; then |
for pass in $passes; do |
1369 |
output_objdir="$objdir" |
if test $linkmode = prog; then |
1370 |
else |
# Determine which files to process |
1371 |
output_objdir="$output_objdir/$objdir" |
case $pass in |
1372 |
fi |
dlopen) |
1373 |
|
libs="$dlfiles" |
1374 |
if test -n "$objs$old_deplibs"; then |
save_deplibs="$deplibs" # Collect dlpreopened libraries |
1375 |
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 |
deplibs= |
|
exit 1 |
|
|
fi |
|
|
|
|
|
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
|
|
$echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 |
|
|
fi |
|
|
|
|
|
set dummy $rpath |
|
|
if test $# -gt 2; then |
|
|
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 |
|
|
fi |
|
|
install_libdir="$2" |
|
|
|
|
|
oldlibs= |
|
|
if test -z "$rpath"; then |
|
|
if test "$build_libtool_libs" = yes; then |
|
|
# Building a libtool convenience library. |
|
|
libext=al |
|
|
oldlibs="$output_objdir/$libname.$libext $oldlibs" |
|
|
build_libtool_libs=convenience |
|
|
build_old_libs=yes |
|
|
fi |
|
|
|
|
|
if test -n "$vinfo"; then |
|
|
$echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 |
|
|
fi |
|
|
|
|
|
if test -n "$release"; then |
|
|
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 |
|
|
fi |
|
|
else |
|
|
|
|
|
# Parse the version information argument. |
|
|
IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' |
|
|
set dummy $vinfo 0 0 0 |
|
|
IFS="$save_ifs" |
|
|
|
|
|
if test -n "$8"; then |
|
|
$echo "$modename: too many parameters to \`-version-info'" 1>&2 |
|
|
$echo "$help" 1>&2 |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
current="$2" |
|
|
revision="$3" |
|
|
age="$4" |
|
|
|
|
|
# Check that each of the things are valid numbers. |
|
|
case "$current" in |
|
|
0 | [1-9] | [1-9][0-9]*) ;; |
|
|
*) |
|
|
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 |
|
|
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
|
|
exit 1 |
|
|
;; |
|
|
esac |
|
|
|
|
|
case "$revision" in |
|
|
0 | [1-9] | [1-9][0-9]*) ;; |
|
|
*) |
|
|
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 |
|
|
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
|
|
exit 1 |
|
|
;; |
|
|
esac |
|
|
|
|
|
case "$age" in |
|
|
0 | [1-9] | [1-9][0-9]*) ;; |
|
|
*) |
|
|
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 |
|
|
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
|
|
exit 1 |
|
|
;; |
|
|
esac |
|
|
|
|
|
if test $age -gt $current; then |
|
|
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 |
|
|
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
# Calculate the version variables. |
|
|
major= |
|
|
versuffix= |
|
|
verstring= |
|
|
case "$version_type" in |
|
|
none) ;; |
|
|
|
|
|
irix) |
|
|
major=`expr $current - $age + 1` |
|
|
versuffix="$major.$revision" |
|
|
verstring="sgi$major.$revision" |
|
|
|
|
|
# Add in all the interfaces that we are compatible with. |
|
|
loop=$revision |
|
|
while test $loop != 0; do |
|
|
iface=`expr $revision - $loop` |
|
|
loop=`expr $loop - 1` |
|
|
verstring="sgi$major.$iface:$verstring" |
|
|
done |
|
|
;; |
|
|
|
|
|
linux) |
|
|
major=.`expr $current - $age` |
|
|
versuffix="$major.$age.$revision" |
|
|
;; |
|
|
|
|
|
osf) |
|
|
major=`expr $current - $age` |
|
|
versuffix=".$current.$age.$revision" |
|
|
verstring="$current.$age.$revision" |
|
|
|
|
|
# Add in all the interfaces that we are compatible with. |
|
|
loop=$age |
|
|
while test $loop != 0; do |
|
|
iface=`expr $current - $loop` |
|
|
loop=`expr $loop - 1` |
|
|
verstring="$verstring:${iface}.0" |
|
|
done |
|
|
|
|
|
# Make executables depend on our current version. |
|
|
verstring="$verstring:${current}.0" |
|
|
;; |
|
|
|
|
|
sunos) |
|
|
major=".$current" |
|
|
versuffix=".$current.$revision" |
|
|
;; |
|
|
|
|
|
freebsd-aout) |
|
|
major=".$current" |
|
|
versuffix=".$current.$revision"; |
|
|
;; |
|
|
|
|
|
freebsd-elf) |
|
|
major=".$current" |
|
|
versuffix=".$current"; |
|
|
;; |
|
|
|
|
|
windows) |
|
|
# Like Linux, but with '-' rather than '.', since we only |
|
|
# want one extension on Windows 95. |
|
|
major=`expr $current - $age` |
|
|
versuffix="-$major-$age-$revision" |
|
|
;; |
|
|
|
|
|
*) |
|
|
$echo "$modename: unknown library version type \`$version_type'" 1>&2 |
|
|
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
|
|
exit 1 |
|
1376 |
;; |
;; |
1377 |
|
dlpreopen) libs="$dlprefiles" ;; |
1378 |
|
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; |
1379 |
esac |
esac |
|
|
|
|
# Clear the version info if we defaulted, and they specified a release. |
|
|
if test -z "$vinfo" && test -n "$release"; then |
|
|
major= |
|
|
verstring="0.0" |
|
|
if test "$need_version" = no; then |
|
|
versuffix= |
|
|
else |
|
|
versuffix=".0.0" |
|
|
fi |
|
|
fi |
|
|
|
|
|
# Remove version info from name if versioning should be avoided |
|
|
if test "$avoid_version" = yes && test "$need_version" = no; then |
|
|
major= |
|
|
versuffix= |
|
|
verstring="" |
|
|
fi |
|
|
|
|
|
# Check to see if the archive will have undefined symbols. |
|
|
if test "$allow_undefined" = yes; then |
|
|
if test "$allow_undefined_flag" = unsupported; then |
|
|
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 |
|
|
build_libtool_libs=no |
|
|
build_old_libs=yes |
|
|
fi |
|
|
else |
|
|
# Don't allow undefined symbols. |
|
|
allow_undefined_flag="$no_undefined_flag" |
|
|
fi |
|
|
fi |
|
|
|
|
|
if test "$relink" = no; then |
|
|
# Create the output directory, or remove our outputs if we need to. |
|
|
if test -d $output_objdir; then |
|
|
$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" |
|
|
$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* |
|
|
else |
|
|
$show "$mkdir $output_objdir" |
|
|
$run $mkdir $output_objdir |
|
|
status=$? |
|
|
if test $status -ne 0 && test ! -d $output_objdir; then |
|
|
exit $status |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
|
|
|
# Now set the variables for building old libraries. |
|
|
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then |
|
|
oldlibs="$oldlibs $output_objdir/$libname.$libext" |
|
|
|
|
|
# Transform .lo files to .o files. |
|
|
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` |
|
1380 |
fi |
fi |
1381 |
|
for deplib in $libs; do |
|
# Save some variables |
|
|
name_save=$name |
|
|
libname_save=$libname |
|
|
|
|
|
# Find libtool libraries and add their dependencies and directories |
|
|
save_deplibs="$deplibs" |
|
|
deplibs= # libraries to link (used in archive_cmds) |
|
|
newdependency_libs= # all dependency libraries |
|
|
uninst_path= # paths that contain uninstalled libtool libraries |
|
|
new_lib_search_path= |
|
|
for deplib in $save_deplibs; do |
|
1382 |
lib= |
lib= |
1383 |
case "$deplib" in |
found=no |
1384 |
-L*) |
case $deplib in |
|
case "$deplibs " in |
|
|
*" $deplib "*) ;; |
|
|
*) |
|
|
deplibs="$deplibs $deplib" |
|
|
newdependency_libs="$newdependency_libs $deplib" |
|
|
new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
|
|
;; |
|
|
esac |
|
|
continue |
|
|
;; |
|
1385 |
-l*) |
-l*) |
1386 |
|
if test $linkmode = oldlib && test $linkmode = obj; then |
1387 |
|
$echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 |
1388 |
|
continue |
1389 |
|
fi |
1390 |
|
if test $pass = conv; then |
1391 |
|
deplibs="$deplib $deplibs" |
1392 |
|
continue |
1393 |
|
fi |
1394 |
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
1395 |
found=no |
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do |
|
for searchdir in $lib_search_path; do |
|
1396 |
# Search the libtool library |
# Search the libtool library |
1397 |
lib="$searchdir/lib${name}.la" |
lib="$searchdir/lib${name}.la" |
1398 |
if test -f "$lib"; then |
if test -f "$lib"; then |
1401 |
fi |
fi |
1402 |
done |
done |
1403 |
if test "$found" != yes; then |
if test "$found" != yes; then |
1404 |
deplibs="$deplibs $deplib" |
# deplib doesn't seem to be a libtool library |
1405 |
newdependency_libs="$newdependency_libs $deplib" |
if test "$linkmode,$pass" = "prog,link"; then |
1406 |
|
compile_deplibs="$deplib $compile_deplibs" |
1407 |
|
finalize_deplibs="$deplib $finalize_deplibs" |
1408 |
|
else |
1409 |
|
deplibs="$deplib $deplibs" |
1410 |
|
test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs" |
1411 |
|
fi |
1412 |
continue |
continue |
1413 |
fi |
fi |
1414 |
|
;; # -l |
1415 |
|
-L*) |
1416 |
|
case $linkmode in |
1417 |
|
lib) |
1418 |
|
deplibs="$deplib $deplibs" |
1419 |
|
test $pass = conv && continue |
1420 |
|
newdependency_libs="$deplib $newdependency_libs" |
1421 |
|
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
1422 |
|
;; |
1423 |
|
prog) |
1424 |
|
if test $pass = conv; then |
1425 |
|
deplibs="$deplib $deplibs" |
1426 |
|
continue |
1427 |
|
fi |
1428 |
|
if test $pass = scan; then |
1429 |
|
deplibs="$deplib $deplibs" |
1430 |
|
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
1431 |
|
else |
1432 |
|
compile_deplibs="$deplib $compile_deplibs" |
1433 |
|
finalize_deplibs="$deplib $finalize_deplibs" |
1434 |
|
fi |
1435 |
|
;; |
1436 |
|
*) |
1437 |
|
$echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 |
1438 |
|
;; |
1439 |
|
esac # linkmode |
1440 |
|
continue |
1441 |
|
;; # -L |
1442 |
|
-R*) |
1443 |
|
if test $pass = link; then |
1444 |
|
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` |
1445 |
|
# Make sure the xrpath contains only unique directories. |
1446 |
|
case "$xrpath " in |
1447 |
|
*" $dir "*) ;; |
1448 |
|
*) xrpath="$xrpath $dir" ;; |
1449 |
|
esac |
1450 |
|
fi |
1451 |
|
deplibs="$deplib $deplibs" |
1452 |
|
continue |
1453 |
;; |
;; |
1454 |
*) |
*.la) lib="$deplib" ;; |
1455 |
lib="$deplib" |
*.$libext) |
1456 |
if test -f "$lib"; then : |
if test $pass = conv; then |
1457 |
|
deplibs="$deplib $deplibs" |
1458 |
|
continue |
1459 |
|
fi |
1460 |
|
case $linkmode in |
1461 |
|
lib) |
1462 |
|
if test "$deplibs_check_method" != pass_all; then |
1463 |
|
echo |
1464 |
|
echo "*** Warning: This library needs some functionality provided by $deplib." |
1465 |
|
echo "*** I have the capability to make that library automatically link in when" |
1466 |
|
echo "*** you link to this library. But I can only do this if you have a" |
1467 |
|
echo "*** shared version of the library, which you do not appear to have." |
1468 |
|
else |
1469 |
|
echo |
1470 |
|
echo "*** Warning: Linking the shared library $output against the" |
1471 |
|
echo "*** static library $deplib is not portable!" |
1472 |
|
deplibs="$deplib $deplibs" |
1473 |
|
fi |
1474 |
|
continue |
1475 |
|
;; |
1476 |
|
prog) |
1477 |
|
if test $pass != link; then |
1478 |
|
deplibs="$deplib $deplibs" |
1479 |
|
else |
1480 |
|
compile_deplibs="$deplib $compile_deplibs" |
1481 |
|
finalize_deplibs="$deplib $finalize_deplibs" |
1482 |
|
fi |
1483 |
|
continue |
1484 |
|
;; |
1485 |
|
esac # linkmode |
1486 |
|
;; # *.$libext |
1487 |
|
*.lo | *.$objext) |
1488 |
|
if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then |
1489 |
|
# If there is no dlopen support or we're linking statically, |
1490 |
|
# we need to preload. |
1491 |
|
newdlprefiles="$newdlprefiles $deplib" |
1492 |
|
compile_deplibs="$deplib $compile_deplibs" |
1493 |
|
finalize_deplibs="$deplib $finalize_deplibs" |
1494 |
else |
else |
1495 |
$echo "$modename: cannot find the library \`$lib'" 1>&2 |
newdlfiles="$newdlfiles $deplib" |
|
exit 1 |
|
1496 |
fi |
fi |
1497 |
|
continue |
1498 |
;; |
;; |
1499 |
esac |
%DEPLIBS%) |
1500 |
libdir= |
alldeplibs=yes |
1501 |
library_names= |
continue |
1502 |
old_library= |
;; |
1503 |
|
esac # case $deplib |
1504 |
|
if test $found = yes || test -f "$lib"; then : |
1505 |
|
else |
1506 |
|
$echo "$modename: cannot find the library \`$lib'" 1>&2 |
1507 |
|
exit 1 |
1508 |
|
fi |
1509 |
|
|
1510 |
# Check to see that this really is a libtool archive. |
# Check to see that this really is a libtool archive. |
1511 |
if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
1516 |
|
|
1517 |
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` |
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` |
1518 |
test "X$ladir" = "X$lib" && ladir="." |
test "X$ladir" = "X$lib" && ladir="." |
|
# We need an absolute path. |
|
|
case "$ladir" in |
|
|
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; |
|
|
*) |
|
|
abs_ladir=`cd "$ladir" && pwd` |
|
|
if test -z "$abs_ladir"; then |
|
|
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 |
|
|
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2 |
|
|
abs_ladir="$ladir" |
|
|
fi |
|
|
;; |
|
|
esac |
|
|
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
|
1519 |
|
|
1520 |
|
dlname= |
1521 |
|
dlopen= |
1522 |
|
dlpreopen= |
1523 |
|
libdir= |
1524 |
|
library_names= |
1525 |
|
old_library= |
1526 |
# If the library was installed with an old release of libtool, |
# If the library was installed with an old release of libtool, |
1527 |
# it will not redefine variable installed. |
# it will not redefine variable installed. |
1528 |
installed=yes |
installed=yes |
1529 |
|
|
1530 |
# Read the .la file |
# Read the .la file |
1531 |
case "$lib" in |
case $lib in |
1532 |
*/* | *\\*) . $lib ;; |
*/* | *\\*) . $lib ;; |
1533 |
*) . ./$lib ;; |
*) . ./$lib ;; |
1534 |
esac |
esac |
1535 |
|
|
1536 |
|
if test "$linkmode,$pass" = "lib,link" || |
1537 |
|
test "$linkmode,$pass" = "prog,scan" || |
1538 |
|
{ test $linkmode = oldlib && test $linkmode = obj; }; then |
1539 |
|
# Add dl[pre]opened files of deplib |
1540 |
|
test -n "$dlopen" && dlfiles="$dlfiles $dlopen" |
1541 |
|
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" |
1542 |
|
fi |
1543 |
|
|
1544 |
|
if test $pass = conv; then |
1545 |
|
# Only check for convenience libraries |
1546 |
|
deplibs="$lib $deplibs" |
1547 |
|
if test -z "$libdir"; then |
1548 |
|
if test -z "$old_library"; then |
1549 |
|
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
1550 |
|
exit 1 |
1551 |
|
fi |
1552 |
|
# It is a libtool convenience library, so add in its objects. |
1553 |
|
convenience="$convenience $ladir/$objdir/$old_library" |
1554 |
|
old_convenience="$old_convenience $ladir/$objdir/$old_library" |
1555 |
|
tmp_libs= |
1556 |
|
for deplib in $dependency_libs; do |
1557 |
|
deplibs="$deplib $deplibs" |
1558 |
|
case "$tmp_libs " in |
1559 |
|
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
1560 |
|
esac |
1561 |
|
tmp_libs="$tmp_libs $deplib" |
1562 |
|
done |
1563 |
|
elif test $linkmode != prog && test $linkmode != lib; then |
1564 |
|
$echo "$modename: \`$lib' is not a convenience library" 1>&2 |
1565 |
|
exit 1 |
1566 |
|
fi |
1567 |
|
continue |
1568 |
|
fi # $pass = conv |
1569 |
|
|
1570 |
# Get the name of the library we link against. |
# Get the name of the library we link against. |
1571 |
linklib= |
linklib= |
1572 |
for l in $old_library $library_names; do |
for l in $old_library $library_names; do |
1573 |
linklib="$l" |
linklib="$l" |
1574 |
done |
done |
|
|
|
1575 |
if test -z "$linklib"; then |
if test -z "$linklib"; then |
1576 |
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
1577 |
exit 1 |
exit 1 |
1578 |
fi |
fi |
1579 |
|
|
1580 |
if test -z "$libdir"; then |
# This library was specified with -dlopen. |
1581 |
# It is a libtool convenience library, so add in its objects. |
if test $pass = dlopen; then |
1582 |
convenience="$convenience $ladir/$objdir/$old_library" |
if test -z "$libdir"; then |
1583 |
old_convenience="$old_convenience $ladir/$objdir/$old_library" |
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 |
1584 |
deplibs="$deplibs $ladir/$objdir/$old_library" |
exit 1 |
1585 |
newdependency_libs="$newdependency_libs $dependency_libs" |
fi |
1586 |
|
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then |
1587 |
|
# If there is no dlname, no dlopen support or we're linking |
1588 |
|
# statically, we need to preload. |
1589 |
|
dlprefiles="$dlprefiles $lib" |
1590 |
|
else |
1591 |
|
newdlfiles="$newdlfiles $lib" |
1592 |
|
fi |
1593 |
continue |
continue |
1594 |
fi |
fi # $pass = dlopen |
1595 |
|
|
1596 |
|
# We need an absolute path. |
1597 |
|
case $ladir in |
1598 |
|
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; |
1599 |
|
*) |
1600 |
|
abs_ladir=`cd "$ladir" && pwd` |
1601 |
|
if test -z "$abs_ladir"; then |
1602 |
|
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 |
1603 |
|
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2 |
1604 |
|
abs_ladir="$ladir" |
1605 |
|
fi |
1606 |
|
;; |
1607 |
|
esac |
1608 |
|
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
1609 |
|
|
1610 |
# Find the relevant object directory and library name. |
# Find the relevant object directory and library name. |
1611 |
if test "X$installed" = Xyes; then |
if test "X$installed" = Xyes; then |
1622 |
dir="$ladir/$objdir" |
dir="$ladir/$objdir" |
1623 |
absdir="$abs_ladir/$objdir" |
absdir="$abs_ladir/$objdir" |
1624 |
# Remove this search path later |
# Remove this search path later |
1625 |
uninst_path="$uninst_path $abs_ladir" |
notinst_path="$notinst_path $abs_ladir" |
1626 |
fi |
fi # $installed = yes |
1627 |
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
|
link_static=no # Whether this library is linked statically |
|
1628 |
|
|
1629 |
|
# This library was specified with -dlpreopen. |
1630 |
|
if test $pass = dlpreopen; then |
1631 |
|
if test -z "$libdir"; then |
1632 |
|
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 |
1633 |
|
exit 1 |
1634 |
|
fi |
1635 |
|
# Prefer using a static library (so that no silly _DYNAMIC symbols |
1636 |
|
# are required to link). |
1637 |
|
if test -n "$old_library"; then |
1638 |
|
newdlprefiles="$newdlprefiles $dir/$old_library" |
1639 |
|
# Otherwise, use the dlname, so that lt_dlopen finds it. |
1640 |
|
elif test -n "$dlname"; then |
1641 |
|
newdlprefiles="$newdlprefiles $dir/$dlname" |
1642 |
|
else |
1643 |
|
newdlprefiles="$newdlprefiles $dir/$linklib" |
1644 |
|
fi |
1645 |
|
fi # $pass = dlpreopen |
1646 |
|
|
1647 |
|
if test -z "$libdir"; then |
1648 |
|
# Link the convenience library |
1649 |
|
if test $linkmode = lib; then |
1650 |
|
deplibs="$dir/$old_library $deplibs" |
1651 |
|
elif test "$linkmode,$pass" = "prog,link"; then |
1652 |
|
compile_deplibs="$dir/$old_library $compile_deplibs" |
1653 |
|
finalize_deplibs="$dir/$old_library $finalize_deplibs" |
1654 |
|
else |
1655 |
|
deplibs="$lib $deplibs" |
1656 |
|
fi |
1657 |
|
continue |
1658 |
|
fi |
1659 |
|
|
1660 |
|
if test $linkmode = prog && test $pass != link; then |
1661 |
|
newlib_search_path="$newlib_search_path $ladir" |
1662 |
|
deplibs="$lib $deplibs" |
1663 |
|
|
1664 |
|
linkalldeplibs=no |
1665 |
|
if test "$link_all_deplibs" != no || test -z "$library_names" || |
1666 |
|
test "$build_libtool_libs" = no; then |
1667 |
|
linkalldeplibs=yes |
1668 |
|
fi |
1669 |
|
|
1670 |
|
tmp_libs= |
1671 |
|
for deplib in $dependency_libs; do |
1672 |
|
case $deplib in |
1673 |
|
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test |
1674 |
|
esac |
1675 |
|
# Need to link against all dependency_libs? |
1676 |
|
if test $linkalldeplibs = yes; then |
1677 |
|
deplibs="$deplib $deplibs" |
1678 |
|
else |
1679 |
|
# Need to hardcode shared library paths |
1680 |
|
# or/and link against static libraries |
1681 |
|
newdependency_libs="$deplib $newdependency_libs" |
1682 |
|
fi |
1683 |
|
case "$tmp_libs " in |
1684 |
|
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
1685 |
|
esac |
1686 |
|
tmp_libs="$tmp_libs $deplib" |
1687 |
|
done # for deplib |
1688 |
|
continue |
1689 |
|
fi # $linkmode = prog... |
1690 |
|
|
1691 |
|
link_static=no # Whether the deplib will be linked statically |
1692 |
if test -n "$library_names" && |
if test -n "$library_names" && |
1693 |
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
1694 |
# This is a shared library |
# Link against this shared library |
1695 |
if test "$hardcode_into_libs" = yes; then |
|
1696 |
|
if test "$linkmode,$pass" = "prog,link" || |
1697 |
|
{ test $linkmode = lib && test $hardcode_into_libs = yes; }; then |
1698 |
# Hardcode the library path. |
# Hardcode the library path. |
1699 |
# Skip directories that are in the system default run-time |
# Skip directories that are in the system default run-time |
1700 |
# search path. |
# search path. |
1703 |
*) |
*) |
1704 |
case "$compile_rpath " in |
case "$compile_rpath " in |
1705 |
*" $absdir "*) ;; |
*" $absdir "*) ;; |
1706 |
*) compile_rpath="$compile_rpath $absdir" |
*) compile_rpath="$compile_rpath $absdir" |
1707 |
esac |
esac |
1708 |
;; |
;; |
1709 |
esac |
esac |
1716 |
esac |
esac |
1717 |
;; |
;; |
1718 |
esac |
esac |
1719 |
|
if test $linkmode = prog; then |
1720 |
|
# We need to hardcode the library path |
1721 |
|
if test -n "$shlibpath_var"; then |
1722 |
|
# Make sure the rpath contains only unique directories. |
1723 |
|
case "$temp_rpath " in |
1724 |
|
*" $dir "*) ;; |
1725 |
|
*" $absdir "*) ;; |
1726 |
|
*) temp_rpath="$temp_rpath $dir" ;; |
1727 |
|
esac |
1728 |
|
fi |
1729 |
|
fi |
1730 |
|
fi # $linkmode,$pass = prog,link... |
1731 |
|
|
1732 |
|
if test "$alldeplibs" = yes && |
1733 |
|
{ test "$deplibs_check_method" = pass_all || |
1734 |
|
{ test "$build_libtool_libs" = yes && |
1735 |
|
test -n "$library_names"; }; }; then |
1736 |
|
# We only need to search for static libraries |
1737 |
|
continue |
1738 |
fi |
fi |
1739 |
|
|
1740 |
|
if test "$installed" = no; then |
1741 |
|
notinst_deplibs="$notinst_deplibs $lib" |
1742 |
|
need_relink=yes |
1743 |
|
fi |
1744 |
|
|
1745 |
if test -n "$old_archive_from_expsyms_cmds"; then |
if test -n "$old_archive_from_expsyms_cmds"; then |
1746 |
# figure out the soname |
# figure out the soname |
1747 |
set dummy $library_names |
set dummy $library_names |
1748 |
realname="$2" |
realname="$2" |
1749 |
shift; shift |
shift; shift |
1750 |
libname=`eval \\$echo \"$libname_spec\"` |
libname=`eval \\$echo \"$libname_spec\"` |
1751 |
if test -n "$soname_spec"; then |
# use dlname if we got it. it's perfectly good, no? |
1752 |
|
if test -n "$dlname"; then |
1753 |
|
soname="$dlname" |
1754 |
|
elif test -n "$soname_spec"; then |
1755 |
|
# bleh windows |
1756 |
|
case $host in |
1757 |
|
*cygwin*) |
1758 |
|
major=`expr $current - $age` |
1759 |
|
versuffix="-$major" |
1760 |
|
;; |
1761 |
|
esac |
1762 |
eval soname=\"$soname_spec\" |
eval soname=\"$soname_spec\" |
1763 |
else |
else |
1764 |
soname="$realname" |
soname="$realname" |
1765 |
fi |
fi |
1766 |
|
|
1767 |
# Make a new name for the extract_expsyms_cmds to use |
# Make a new name for the extract_expsyms_cmds to use |
1768 |
|
soroot="$soname" |
1769 |
|
soname=`echo $soroot | sed -e 's/^.*\///'` |
1770 |
newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" |
newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" |
1771 |
|
|
1772 |
# If the library has no export list, then create one now |
# If the library has no export list, then create one now |
1773 |
if test -f "$output_objdir/$soname-def"; then : |
if test -f "$output_objdir/$soname-def"; then : |
1774 |
else |
else |
1775 |
$show "extracting exported symbol list from \`$soname'" |
$show "extracting exported symbol list from \`$soname'" |
1776 |
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
save_ifs="$IFS"; IFS='~' |
1777 |
eval cmds=\"$extract_expsyms_cmds\" |
eval cmds=\"$extract_expsyms_cmds\" |
1778 |
for cmd in $cmds; do |
for cmd in $cmds; do |
1779 |
IFS="$save_ifs" |
IFS="$save_ifs" |
1782 |
done |
done |
1783 |
IFS="$save_ifs" |
IFS="$save_ifs" |
1784 |
fi |
fi |
1785 |
|
|
1786 |
# Create $newlib |
# Create $newlib |
1787 |
if test -f "$output_objdir/$newlib"; then :; else |
if test -f "$output_objdir/$newlib"; then :; else |
1788 |
$show "generating import library for \`$soname'" |
$show "generating import library for \`$soname'" |
1789 |
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
save_ifs="$IFS"; IFS='~' |
1790 |
eval cmds=\"$old_archive_from_expsyms_cmds\" |
eval cmds=\"$old_archive_from_expsyms_cmds\" |
1791 |
for cmd in $cmds; do |
for cmd in $cmds; do |
1792 |
IFS="$save_ifs" |
IFS="$save_ifs" |
1798 |
# make sure the library variables are pointing to the new library |
# make sure the library variables are pointing to the new library |
1799 |
dir=$output_objdir |
dir=$output_objdir |
1800 |
linklib=$newlib |
linklib=$newlib |
1801 |
fi |
fi # test -n $old_archive_from_expsyms_cmds |
1802 |
|
|
1803 |
add_dir= |
if test $linkmode = prog || test "$mode" != relink; then |
1804 |
add_shlibpath= |
add_shlibpath= |
1805 |
add_name=no |
add_dir= |
1806 |
if test "$relink" = no; then |
add= |
1807 |
lib_linked=yes |
lib_linked=yes |
1808 |
case "$hardcode_action" in |
case $hardcode_action in |
1809 |
immediate | unsupported) |
immediate | unsupported) |
1810 |
if test "$hardcode_direct" = no; then |
if test "$hardcode_direct" = no; then |
1811 |
deplibs="$deplibs $dir/$linklib" |
add="$dir/$linklib" |
1812 |
elif test "$hardcode_minus_L" = no; then |
elif test "$hardcode_minus_L" = no; then |
1813 |
case "$host" in |
case $host in |
1814 |
*-*-sunos*) add_shlibpath="$dir" ;; |
*-*-sunos*) add_shlibpath="$dir" ;; |
1815 |
esac |
esac |
1816 |
add_dir="-L$dir" |
add_dir="-L$dir" |
1817 |
add_name=yes |
add="-l$name" |
1818 |
elif test "$hardcode_shlibpath_var" = no; then |
elif test "$hardcode_shlibpath_var" = no; then |
1819 |
add_shlibpath="$dir" |
add_shlibpath="$dir" |
1820 |
add_name=yes |
add="-l$name" |
1821 |
else |
else |
1822 |
lib_linked=no |
lib_linked=no |
1823 |
fi |
fi |
1824 |
;; |
;; |
1825 |
relink) |
relink) |
1826 |
if test "$hardcode_direct" = yes; then |
if test "$hardcode_direct" = yes; then |
1827 |
deplibs="$deplibs $dir/$linklib" |
add="$dir/$linklib" |
1828 |
elif test "$hardcode_minus_L" = yes; then |
elif test "$hardcode_minus_L" = yes; then |
1829 |
add_dir="-L$dir" |
add_dir="-L$dir" |
1830 |
add_name=yes |
add="-l$name" |
1831 |
elif test "$hardcode_shlibpath_var" = yes; then |
elif test "$hardcode_shlibpath_var" = yes; then |
1832 |
add_shlibpath="$dir" |
add_shlibpath="$dir" |
1833 |
add_name=yes |
add="-l$name" |
1834 |
else |
else |
1835 |
lib_linked=no |
lib_linked=no |
1836 |
fi |
fi |
1842 |
$echo "$modename: configuration error: unsupported hardcode properties" |
$echo "$modename: configuration error: unsupported hardcode properties" |
1843 |
exit 1 |
exit 1 |
1844 |
fi |
fi |
1845 |
|
|
1846 |
if test -n "$add_shlibpath"; then |
if test -n "$add_shlibpath"; then |
1847 |
case ":$compile_shlibpath:" in |
case :$compile_shlibpath: in |
1848 |
*":$add_shlibpath:"*) ;; |
*":$add_shlibpath:"*) ;; |
1849 |
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; |
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; |
1850 |
esac |
esac |
1851 |
fi |
fi |
1852 |
else |
if test $linkmode = prog; then |
1853 |
# Install command for both is simple: just hardcode it. |
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" |
1854 |
|
test -n "$add" && compile_deplibs="$add $compile_deplibs" |
1855 |
|
else |
1856 |
|
test -n "$add_dir" && deplibs="$add_dir $deplibs" |
1857 |
|
test -n "$add" && deplibs="$add $deplibs" |
1858 |
|
if test "$hardcode_direct" != yes && \ |
1859 |
|
test "$hardcode_minus_L" != yes && \ |
1860 |
|
test "$hardcode_shlibpath_var" = yes; then |
1861 |
|
case :$finalize_shlibpath: in |
1862 |
|
*":$libdir:"*) ;; |
1863 |
|
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; |
1864 |
|
esac |
1865 |
|
fi |
1866 |
|
fi |
1867 |
|
fi |
1868 |
|
|
1869 |
|
if test $linkmode = prog || test "$mode" = relink; then |
1870 |
|
add_shlibpath= |
1871 |
|
add_dir= |
1872 |
|
add= |
1873 |
|
# Finalize command for both is simple: just hardcode it. |
1874 |
if test "$hardcode_direct" = yes; then |
if test "$hardcode_direct" = yes; then |
1875 |
deplibs="$deplibs $libdir/$linklib" |
add="$libdir/$linklib" |
1876 |
elif test "$hardcode_minus_L" = yes; then |
elif test "$hardcode_minus_L" = yes; then |
1877 |
add_dir="-L$libdir" |
add_dir="-L$libdir" |
1878 |
add_name=yes |
add="-l$name" |
1879 |
elif test "$hardcode_shlibpath_var" = yes; then |
elif test "$hardcode_shlibpath_var" = yes; then |
1880 |
add_name=yes |
case :$finalize_shlibpath: in |
1881 |
|
*":$libdir:"*) ;; |
1882 |
|
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; |
1883 |
|
esac |
1884 |
|
add="-l$name" |
1885 |
else |
else |
1886 |
# We cannot seem to hardcode it, guess we'll fake it. |
# We cannot seem to hardcode it, guess we'll fake it. |
1887 |
add_dir="-L$libdir" |
add_dir="-L$libdir" |
1888 |
add_name=yes |
add="-l$name" |
1889 |
|
fi |
1890 |
|
|
1891 |
|
if test $linkmode = prog; then |
1892 |
|
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" |
1893 |
|
test -n "$add" && finalize_deplibs="$add $finalize_deplibs" |
1894 |
|
else |
1895 |
|
test -n "$add_dir" && deplibs="$add_dir $deplibs" |
1896 |
|
test -n "$add" && deplibs="$add $deplibs" |
1897 |
fi |
fi |
1898 |
fi |
fi |
1899 |
if test "$hardcode_direct" != yes && \ |
elif test $linkmode = prog; then |
1900 |
test "$hardcode_minus_L" != yes && \ |
if test "$alldeplibs" = yes && |
1901 |
test "$hardcode_shlibpath_var" = yes; then |
{ test "$deplibs_check_method" = pass_all || |
1902 |
case ":$finalize_shlibpath:" in |
{ test "$build_libtool_libs" = yes && |
1903 |
*":$libdir:"*) ;; |
test -n "$library_names"; }; }; then |
1904 |
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; |
# We only need to search for static libraries |
1905 |
esac |
continue |
1906 |
fi |
fi |
1907 |
if test -n "$add_dir"; then |
|
1908 |
case "$deplibs " in |
# Try to link the static library |
1909 |
*" $add_dir "*) ;; |
# Here we assume that one of hardcode_direct or hardcode_minus_L |
1910 |
*) deplibs="$deplibs $add_dir" ;; |
# is not unsupported. This is valid on all known static and |
1911 |
esac |
# shared platforms. |
1912 |
|
if test "$hardcode_direct" != unsupported; then |
1913 |
|
test -n "$old_library" && linklib="$old_library" |
1914 |
|
compile_deplibs="$dir/$linklib $compile_deplibs" |
1915 |
|
finalize_deplibs="$dir/$linklib $finalize_deplibs" |
1916 |
|
else |
1917 |
|
compile_deplibs="-l$name -L$dir $compile_deplibs" |
1918 |
|
finalize_deplibs="-l$name -L$dir $finalize_deplibs" |
1919 |
fi |
fi |
|
test "$add_name" = yes && deplibs="$deplibs -l$name" |
|
1920 |
elif test "$build_libtool_libs" = yes; then |
elif test "$build_libtool_libs" = yes; then |
1921 |
# Not a shared library |
# Not a shared library |
1922 |
if test "$deplibs_check_method" != pass_all; then |
if test "$deplibs_check_method" != pass_all; then |
1923 |
# We're trying link a shared library against a static one |
# We're trying link a shared library against a static one |
1924 |
# but the system doesn't support it. |
# but the system doesn't support it. |
1925 |
|
|
1926 |
# Just print a warning and add the library to dependency_libs so |
# Just print a warning and add the library to dependency_libs so |
1927 |
# that the program can be linked against the static library. |
# that the program can be linked against the static library. |
1928 |
echo |
echo |
1929 |
echo "*** Warning: This library needs some functionality provided by $libname." |
echo "*** Warning: This library needs some functionality provided by $lib." |
1930 |
echo "*** I have the capability to make that library automatically link in when" |
echo "*** I have the capability to make that library automatically link in when" |
1931 |
echo "*** you link to this library. But I can only do this if you have a" |
echo "*** you link to this library. But I can only do this if you have a" |
1932 |
echo "*** shared version of the library, which you do not appear to have." |
echo "*** shared version of the library, which you do not appear to have." |
1933 |
|
if test "$module" = yes; then |
1934 |
|
echo "*** Therefore, libtool will create a static module, that should work " |
1935 |
|
echo "*** as long as the dlopening application is linked with the -dlopen flag." |
1936 |
|
if test -z "$global_symbol_pipe"; then |
1937 |
|
echo |
1938 |
|
echo "*** However, this would only work if libtool was able to extract symbol" |
1939 |
|
echo "*** lists from a program, using \`nm' or equivalent, but libtool could" |
1940 |
|
echo "*** not find such a program. So, this module is probably useless." |
1941 |
|
echo "*** \`nm' from GNU binutils and a full rebuild may help." |
1942 |
|
fi |
1943 |
|
if test "$build_old_libs" = no; then |
1944 |
|
build_libtool_libs=module |
1945 |
|
build_old_libs=yes |
1946 |
|
else |
1947 |
|
build_libtool_libs=no |
1948 |
|
fi |
1949 |
|
fi |
1950 |
else |
else |
1951 |
convenience="$convenience $dir/$old_library" |
convenience="$convenience $dir/$old_library" |
1952 |
old_convenience="$old_convenience $dir/$old_library" |
old_convenience="$old_convenience $dir/$old_library" |
1953 |
deplibs="$deplibs $dir/$old_library" |
deplibs="$dir/$old_library $deplibs" |
1954 |
link_static=yes |
link_static=yes |
1955 |
fi |
fi |
1956 |
fi |
fi # link shared/static library? |
1957 |
|
|
1958 |
|
if test $linkmode = lib; then |
1959 |
|
if test -n "$dependency_libs" && |
1960 |
|
{ test $hardcode_into_libs != yes || test $build_old_libs = yes || |
1961 |
|
test $link_static = yes; }; then |
1962 |
|
# Extract -R from dependency_libs |
1963 |
|
temp_deplibs= |
1964 |
|
for libdir in $dependency_libs; do |
1965 |
|
case $libdir in |
1966 |
|
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` |
1967 |
|
case " $xrpath " in |
1968 |
|
*" $temp_xrpath "*) ;; |
1969 |
|
*) xrpath="$xrpath $temp_xrpath";; |
1970 |
|
esac;; |
1971 |
|
*) temp_deplibs="$temp_deplibs $libdir";; |
1972 |
|
esac |
1973 |
|
done |
1974 |
|
dependency_libs="$temp_deplibs" |
1975 |
|
fi |
1976 |
|
|
1977 |
if test -n "$dependency_libs"; then |
newlib_search_path="$newlib_search_path $absdir" |
1978 |
# Extract -R from dependency_libs |
# Link against this library |
1979 |
temp_deplibs= |
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" |
1980 |
for libdir in $dependency_libs; do |
# ... and its dependency_libs |
1981 |
case "$libdir" in |
tmp_libs= |
1982 |
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` |
for deplib in $dependency_libs; do |
1983 |
case " $xrpath " in |
newdependency_libs="$deplib $newdependency_libs" |
1984 |
*" $temp_xrpath "*) ;; |
case "$tmp_libs " in |
1985 |
*) xrpath="$xrpath $temp_xrpath";; |
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
|
esac;; |
|
|
*) temp_deplibs="$temp_deplibs $libdir";; |
|
1986 |
esac |
esac |
1987 |
|
tmp_libs="$tmp_libs $deplib" |
1988 |
done |
done |
|
dependency_libs="$temp_deplibs" |
|
|
fi |
|
|
|
|
|
new_lib_search_path="$new_lib_search_path $absdir" |
|
|
# Link against this library |
|
|
test "$link_static" = no && newdependency_libs="$newdependency_libs $abs_ladir/$laname" |
|
|
# ... and its dependency_libs |
|
|
newdependency_libs="$newdependency_libs $dependency_libs" |
|
1989 |
|
|
1990 |
if test $link_all_deplibs != no; then |
if test $link_all_deplibs != no; then |
1991 |
# Add the search paths of all dependency libraries |
# Add the search paths of all dependency libraries |
1992 |
for deplib in $dependency_libs; do |
for deplib in $dependency_libs; do |
1993 |
case "$deplib" in |
case $deplib in |
1994 |
-L*) path="$deplib" ;; |
-L*) path="$deplib" ;; |
1995 |
*.la) |
*.la) |
|
if grep "^installed=no" $deplib > /dev/null; then |
|
1996 |
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` |
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` |
1997 |
test "X$dir" = "X$deplib" && dir="." |
test "X$dir" = "X$deplib" && dir="." |
1998 |
# We need an absolute path. |
# We need an absolute path. |
1999 |
case "$dir" in |
case $dir in |
2000 |
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; |
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; |
2001 |
*) |
*) |
2002 |
absdir=`cd "$dir" && pwd` |
absdir=`cd "$dir" && pwd` |
2006 |
fi |
fi |
2007 |
;; |
;; |
2008 |
esac |
esac |
2009 |
path="-L$absdir/$objdir" |
if grep "^installed=no" $deplib > /dev/null; then |
2010 |
else |
path="-L$absdir/$objdir" |
2011 |
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
else |
2012 |
if test -z "$libdir"; then |
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
2013 |
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
if test -z "$libdir"; then |
2014 |
exit 1 |
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
2015 |
|
exit 1 |
2016 |
|
fi |
2017 |
|
if test "$absdir" != "$libdir"; then |
2018 |
|
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 |
2019 |
|
fi |
2020 |
|
path="-L$absdir" |
2021 |
fi |
fi |
2022 |
path="-L$libdir" |
;; |
2023 |
fi |
*) continue ;; |
2024 |
;; |
esac |
2025 |
|
case " $deplibs " in |
2026 |
|
*" $path "*) ;; |
2027 |
|
*) deplibs="$deplibs $path" ;; |
2028 |
|
esac |
2029 |
|
done |
2030 |
|
fi # link_all_deplibs != no |
2031 |
|
fi # linkmode = lib |
2032 |
|
done # for deplib in $libs |
2033 |
|
if test $pass = dlpreopen; then |
2034 |
|
# Link the dlpreopened libraries before other libraries |
2035 |
|
for deplib in $save_deplibs; do |
2036 |
|
deplibs="$deplib $deplibs" |
2037 |
|
done |
2038 |
|
fi |
2039 |
|
if test $pass != dlopen; then |
2040 |
|
test $pass != scan && dependency_libs="$newdependency_libs" |
2041 |
|
if test $pass != conv; then |
2042 |
|
# Make sure lib_search_path contains only unique directories. |
2043 |
|
lib_search_path= |
2044 |
|
for dir in $newlib_search_path; do |
2045 |
|
case "$lib_search_path " in |
2046 |
|
*" $dir "*) ;; |
2047 |
|
*) lib_search_path="$lib_search_path $dir" ;; |
2048 |
|
esac |
2049 |
|
done |
2050 |
|
newlib_search_path= |
2051 |
|
fi |
2052 |
|
|
2053 |
|
if test "$linkmode,$pass" != "prog,link"; then |
2054 |
|
vars="deplibs" |
2055 |
|
else |
2056 |
|
vars="compile_deplibs finalize_deplibs" |
2057 |
|
fi |
2058 |
|
for var in $vars dependency_libs; do |
2059 |
|
# Add libraries to $var in reverse order |
2060 |
|
eval tmp_libs=\"\$$var\" |
2061 |
|
new_libs= |
2062 |
|
for deplib in $tmp_libs; do |
2063 |
|
case $deplib in |
2064 |
|
-L*) new_libs="$deplib $new_libs" ;; |
2065 |
*) |
*) |
2066 |
continue |
case " $specialdeplibs " in |
2067 |
|
*" $deplib "*) new_libs="$deplib $new_libs" ;; |
2068 |
|
*) |
2069 |
|
case " $new_libs " in |
2070 |
|
*" $deplib "*) ;; |
2071 |
|
*) new_libs="$deplib $new_libs" ;; |
2072 |
|
esac |
2073 |
|
;; |
2074 |
|
esac |
2075 |
;; |
;; |
2076 |
esac |
esac |
2077 |
case "$deplibs " in |
done |
2078 |
*" $path "*) ;; |
tmp_libs= |
2079 |
*) deplibs="$path $deplibs" ;; |
for deplib in $new_libs; do |
2080 |
|
case $deplib in |
2081 |
|
-L*) |
2082 |
|
case " $tmp_libs " in |
2083 |
|
*" $deplib "*) ;; |
2084 |
|
*) tmp_libs="$tmp_libs $deplib" ;; |
2085 |
|
esac |
2086 |
|
;; |
2087 |
|
*) tmp_libs="$tmp_libs $deplib" ;; |
2088 |
esac |
esac |
2089 |
done |
done |
2090 |
|
eval $var=\"$tmp_libs\" |
2091 |
|
done # for var |
2092 |
|
fi |
2093 |
|
if test "$pass" = "conv" && |
2094 |
|
{ test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then |
2095 |
|
libs="$deplibs" # reset libs |
2096 |
|
deplibs= |
2097 |
|
fi |
2098 |
|
done # for pass |
2099 |
|
if test $linkmode = prog; then |
2100 |
|
dlfiles="$newdlfiles" |
2101 |
|
dlprefiles="$newdlprefiles" |
2102 |
|
fi |
2103 |
|
|
2104 |
|
case $linkmode in |
2105 |
|
oldlib) |
2106 |
|
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
2107 |
|
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 |
2108 |
|
fi |
2109 |
|
|
2110 |
|
if test -n "$rpath"; then |
2111 |
|
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 |
2112 |
|
fi |
2113 |
|
|
2114 |
|
if test -n "$xrpath"; then |
2115 |
|
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2 |
2116 |
|
fi |
2117 |
|
|
2118 |
|
if test -n "$vinfo"; then |
2119 |
|
$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 |
2120 |
|
fi |
2121 |
|
|
2122 |
|
if test -n "$release"; then |
2123 |
|
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2 |
2124 |
|
fi |
2125 |
|
|
2126 |
|
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then |
2127 |
|
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 |
2128 |
|
fi |
2129 |
|
|
2130 |
|
# Now set the variables for building old libraries. |
2131 |
|
build_libtool_libs=no |
2132 |
|
oldlibs="$output" |
2133 |
|
objs="$objs$old_deplibs" |
2134 |
|
;; |
2135 |
|
|
2136 |
|
lib) |
2137 |
|
# Make sure we only generate libraries of the form `libNAME.la'. |
2138 |
|
case $outputname in |
2139 |
|
lib*) |
2140 |
|
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
2141 |
|
eval libname=\"$libname_spec\" |
2142 |
|
;; |
2143 |
|
*) |
2144 |
|
if test "$module" = no; then |
2145 |
|
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 |
2146 |
|
$echo "$help" 1>&2 |
2147 |
|
exit 1 |
2148 |
fi |
fi |
2149 |
done |
if test "$need_lib_prefix" != no; then |
2150 |
|
# Add the "lib" prefix for modules if required |
2151 |
|
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` |
2152 |
|
eval libname=\"$libname_spec\" |
2153 |
|
else |
2154 |
|
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` |
2155 |
|
fi |
2156 |
|
;; |
2157 |
|
esac |
2158 |
|
|
2159 |
# Make sure lib_search_path contains only unique directories. |
if test -n "$objs"; then |
2160 |
lib_search_path= |
if test "$deplibs_check_method" != pass_all; then |
2161 |
for dir in $new_lib_search_path; do |
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 |
2162 |
case "$lib_search_path " in |
exit 1 |
2163 |
*" $dir "*) ;; |
else |
2164 |
*) lib_search_path="$lib_search_path $dir" ;; |
echo |
2165 |
|
echo "*** Warning: Linking the shared library $output against the non-libtool" |
2166 |
|
echo "*** objects $objs is not portable!" |
2167 |
|
libobjs="$libobjs $objs" |
2168 |
|
fi |
2169 |
|
fi |
2170 |
|
|
2171 |
|
if test "$dlself" != no; then |
2172 |
|
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 |
2173 |
|
fi |
2174 |
|
|
2175 |
|
set dummy $rpath |
2176 |
|
if test $# -gt 2; then |
2177 |
|
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 |
2178 |
|
fi |
2179 |
|
install_libdir="$2" |
2180 |
|
|
2181 |
|
oldlibs= |
2182 |
|
if test -z "$rpath"; then |
2183 |
|
if test "$build_libtool_libs" = yes; then |
2184 |
|
# Building a libtool convenience library. |
2185 |
|
libext=al |
2186 |
|
oldlibs="$output_objdir/$libname.$libext $oldlibs" |
2187 |
|
build_libtool_libs=convenience |
2188 |
|
build_old_libs=yes |
2189 |
|
fi |
2190 |
|
|
2191 |
|
if test -n "$vinfo"; then |
2192 |
|
$echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 |
2193 |
|
fi |
2194 |
|
|
2195 |
|
if test -n "$release"; then |
2196 |
|
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 |
2197 |
|
fi |
2198 |
|
else |
2199 |
|
|
2200 |
|
# Parse the version information argument. |
2201 |
|
save_ifs="$IFS"; IFS=':' |
2202 |
|
set dummy $vinfo 0 0 0 |
2203 |
|
IFS="$save_ifs" |
2204 |
|
|
2205 |
|
if test -n "$8"; then |
2206 |
|
$echo "$modename: too many parameters to \`-version-info'" 1>&2 |
2207 |
|
$echo "$help" 1>&2 |
2208 |
|
exit 1 |
2209 |
|
fi |
2210 |
|
|
2211 |
|
current="$2" |
2212 |
|
revision="$3" |
2213 |
|
age="$4" |
2214 |
|
|
2215 |
|
# Check that each of the things are valid numbers. |
2216 |
|
case $current in |
2217 |
|
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
2218 |
|
*) |
2219 |
|
$echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 |
2220 |
|
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
2221 |
|
exit 1 |
2222 |
|
;; |
2223 |
esac |
esac |
2224 |
done |
|
2225 |
lib_search_path="$lib_search_path $sys_lib_search_path" |
case $revision in |
2226 |
|
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
2227 |
# Make sure newdependency_libs contains only unique libraries and directories. |
*) |
2228 |
dependency_libs= |
$echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 |
2229 |
for deplib in $newdependency_libs; do |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
2230 |
case "$dependency_libs " in |
exit 1 |
2231 |
*" $deplib "*) ;; |
;; |
|
*) dependency_libs="$dependency_libs $deplib" ;; |
|
2232 |
esac |
esac |
2233 |
done |
|
2234 |
|
case $age in |
2235 |
|
0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
2236 |
|
*) |
2237 |
|
$echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 |
2238 |
|
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
2239 |
|
exit 1 |
2240 |
|
;; |
2241 |
|
esac |
2242 |
|
|
2243 |
|
if test $age -gt $current; then |
2244 |
|
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 |
2245 |
|
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
2246 |
|
exit 1 |
2247 |
|
fi |
2248 |
|
|
2249 |
|
# Calculate the version variables. |
2250 |
|
major= |
2251 |
|
versuffix= |
2252 |
|
verstring= |
2253 |
|
case $version_type in |
2254 |
|
none) ;; |
2255 |
|
|
2256 |
|
darwin) |
2257 |
|
# Like Linux, but with the current version available in |
2258 |
|
# verstring for coding it into the library header |
2259 |
|
major=.`expr $current - $age` |
2260 |
|
versuffix="$major.$age.$revision" |
2261 |
|
# Darwin ld doesn't like 0 for these options... |
2262 |
|
minor_current=`expr $current + 1` |
2263 |
|
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" |
2264 |
|
;; |
2265 |
|
|
2266 |
|
freebsd-aout) |
2267 |
|
major=".$current" |
2268 |
|
versuffix=".$current.$revision"; |
2269 |
|
;; |
2270 |
|
|
2271 |
|
freebsd-elf) |
2272 |
|
major=".$current" |
2273 |
|
versuffix=".$current"; |
2274 |
|
;; |
2275 |
|
|
2276 |
|
irix) |
2277 |
|
major=`expr $current - $age + 1` |
2278 |
|
verstring="sgi$major.$revision" |
2279 |
|
|
2280 |
|
# Add in all the interfaces that we are compatible with. |
2281 |
|
loop=$revision |
2282 |
|
while test $loop != 0; do |
2283 |
|
iface=`expr $revision - $loop` |
2284 |
|
loop=`expr $loop - 1` |
2285 |
|
verstring="sgi$major.$iface:$verstring" |
2286 |
|
done |
2287 |
|
|
2288 |
|
# Before this point, $major must not contain `.'. |
2289 |
|
major=.$major |
2290 |
|
versuffix="$major.$revision" |
2291 |
|
;; |
2292 |
|
|
2293 |
|
linux) |
2294 |
|
major=.`expr $current - $age` |
2295 |
|
versuffix="$major.$age.$revision" |
2296 |
|
;; |
2297 |
|
|
2298 |
|
osf) |
2299 |
|
major=`expr $current - $age` |
2300 |
|
versuffix=".$current.$age.$revision" |
2301 |
|
verstring="$current.$age.$revision" |
2302 |
|
|
2303 |
|
# Add in all the interfaces that we are compatible with. |
2304 |
|
loop=$age |
2305 |
|
while test $loop != 0; do |
2306 |
|
iface=`expr $current - $loop` |
2307 |
|
loop=`expr $loop - 1` |
2308 |
|
verstring="$verstring:${iface}.0" |
2309 |
|
done |
2310 |
|
|
2311 |
|
# Make executables depend on our current version. |
2312 |
|
verstring="$verstring:${current}.0" |
2313 |
|
;; |
2314 |
|
|
2315 |
|
sunos) |
2316 |
|
major=".$current" |
2317 |
|
versuffix=".$current.$revision" |
2318 |
|
;; |
2319 |
|
|
2320 |
|
windows) |
2321 |
|
# Use '-' rather than '.', since we only want one |
2322 |
|
# extension on DOS 8.3 filesystems. |
2323 |
|
major=`expr $current - $age` |
2324 |
|
versuffix="-$major" |
2325 |
|
;; |
2326 |
|
|
2327 |
|
*) |
2328 |
|
$echo "$modename: unknown library version type \`$version_type'" 1>&2 |
2329 |
|
echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
2330 |
|
exit 1 |
2331 |
|
;; |
2332 |
|
esac |
2333 |
|
|
2334 |
|
# Clear the version info if we defaulted, and they specified a release. |
2335 |
|
if test -z "$vinfo" && test -n "$release"; then |
2336 |
|
major= |
2337 |
|
verstring="0.0" |
2338 |
|
case $version_type in |
2339 |
|
darwin) |
2340 |
|
# we can't check for "0.0" in archive_cmds due to quoting |
2341 |
|
# problems, so we reset it completely |
2342 |
|
verstring="" |
2343 |
|
;; |
2344 |
|
*) |
2345 |
|
verstring="0.0" |
2346 |
|
;; |
2347 |
|
esac |
2348 |
|
if test "$need_version" = no; then |
2349 |
|
versuffix= |
2350 |
|
else |
2351 |
|
versuffix=".0.0" |
2352 |
|
fi |
2353 |
|
fi |
2354 |
|
|
2355 |
|
# Remove version info from name if versioning should be avoided |
2356 |
|
if test "$avoid_version" = yes && test "$need_version" = no; then |
2357 |
|
major= |
2358 |
|
versuffix= |
2359 |
|
verstring="" |
2360 |
|
fi |
2361 |
|
|
2362 |
|
# Check to see if the archive will have undefined symbols. |
2363 |
|
if test "$allow_undefined" = yes; then |
2364 |
|
if test "$allow_undefined_flag" = unsupported; then |
2365 |
|
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 |
2366 |
|
build_libtool_libs=no |
2367 |
|
build_old_libs=yes |
2368 |
|
fi |
2369 |
|
else |
2370 |
|
# Don't allow undefined symbols. |
2371 |
|
allow_undefined_flag="$no_undefined_flag" |
2372 |
|
fi |
2373 |
|
fi |
2374 |
|
|
2375 |
|
if test "$mode" != relink; then |
2376 |
|
# Remove our outputs. |
2377 |
|
$show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" |
2378 |
|
$run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* |
2379 |
|
fi |
2380 |
|
|
2381 |
|
# Now set the variables for building old libraries. |
2382 |
|
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then |
2383 |
|
oldlibs="$oldlibs $output_objdir/$libname.$libext" |
2384 |
|
|
2385 |
|
# Transform .lo files to .o files. |
2386 |
|
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` |
2387 |
|
fi |
2388 |
|
|
2389 |
# Eliminate all temporary directories. |
# Eliminate all temporary directories. |
2390 |
for path in $uninst_path; do |
for path in $notinst_path; do |
2391 |
lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` |
lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` |
2392 |
deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` |
deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` |
2393 |
dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` |
dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` |
2394 |
done |
done |
2395 |
|
|
2396 |
if test -n "$xrpath"; then |
if test -n "$xrpath"; then |
2397 |
# If the user specified any rpath flags, then add them. |
# If the user specified any rpath flags, then add them. |
2398 |
temp_xrpath= |
temp_xrpath= |
2399 |
for libdir in $xrpath; do |
for libdir in $xrpath; do |
2400 |
temp_xrpath="$temp_xrpath -R$libdir" |
temp_xrpath="$temp_xrpath -R$libdir" |
|
case "$compile_rpath " in |
|
|
*" $libdir "*) ;; |
|
|
*) compile_rpath="$compile_rpath $libdir" ;; |
|
|
esac |
|
2401 |
case "$finalize_rpath " in |
case "$finalize_rpath " in |
2402 |
*" $libdir "*) ;; |
*" $libdir "*) ;; |
2403 |
*) finalize_rpath="$finalize_rpath $libdir" ;; |
*) finalize_rpath="$finalize_rpath $libdir" ;; |
2404 |
esac |
esac |
2405 |
done |
done |
2406 |
dependency_libs="$temp_xrpath $dependency_libs" |
if test $hardcode_into_libs != yes || test $build_old_libs = yes; then |
2407 |
|
dependency_libs="$temp_xrpath $dependency_libs" |
2408 |
|
fi |
2409 |
fi |
fi |
2410 |
|
|
2411 |
# Restore the variables |
# Make sure dlfiles contains only unique files that won't be dlpreopened |
2412 |
libname=$libname_save |
old_dlfiles="$dlfiles" |
2413 |
name=$name_save |
dlfiles= |
2414 |
|
for lib in $old_dlfiles; do |
2415 |
|
case " $dlprefiles $dlfiles " in |
2416 |
|
*" $lib "*) ;; |
2417 |
|
*) dlfiles="$dlfiles $lib" ;; |
2418 |
|
esac |
2419 |
|
done |
2420 |
|
|
2421 |
|
# Make sure dlprefiles contains only unique files |
2422 |
|
old_dlprefiles="$dlprefiles" |
2423 |
|
dlprefiles= |
2424 |
|
for lib in $old_dlprefiles; do |
2425 |
|
case "$dlprefiles " in |
2426 |
|
*" $lib "*) ;; |
2427 |
|
*) dlprefiles="$dlprefiles $lib" ;; |
2428 |
|
esac |
2429 |
|
done |
2430 |
|
|
2431 |
if test "$build_libtool_libs" = yes; then |
if test "$build_libtool_libs" = yes; then |
2432 |
if test -n "$rpath"; then |
if test -n "$rpath"; then |
2433 |
case "$host" in |
case $host in |
2434 |
*-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) |
2435 |
# these systems don't actually have a c library (as such)! |
# these systems don't actually have a c library (as such)! |
2436 |
;; |
;; |
2437 |
|
*-*-rhapsody* | *-*-darwin1.[012]) |
2438 |
|
# Rhapsody C library is in the System framework |
2439 |
|
deplibs="$deplibs -framework System" |
2440 |
|
;; |
2441 |
|
*-*-netbsd*) |
2442 |
|
# Don't link with libc until the a.out ld.so is fixed. |
2443 |
|
;; |
2444 |
|
*-*-openbsd*) |
2445 |
|
# Do not include libc due to us having libc/libc_r. |
2446 |
|
;; |
2447 |
*) |
*) |
2448 |
# Add libc to deplibs on all other systems. |
# Add libc to deplibs on all other systems if necessary. |
2449 |
deplibs="$deplibs -lc" |
if test $build_libtool_need_lc = "yes"; then |
2450 |
|
deplibs="$deplibs -lc" |
2451 |
|
fi |
2452 |
;; |
;; |
2453 |
esac |
esac |
2454 |
fi |
fi |
2467 |
major="" |
major="" |
2468 |
newdeplibs= |
newdeplibs= |
2469 |
droppeddeps=no |
droppeddeps=no |
2470 |
case "$deplibs_check_method" in |
case $deplibs_check_method in |
2471 |
pass_all) |
pass_all) |
2472 |
# Don't check for shared/static. Everything works. |
# Don't check for shared/static. Everything works. |
2473 |
# This might be a little naive. We might want to check |
# This might be a little naive. We might want to check |
2492 |
for i in $deplibs; do |
for i in $deplibs; do |
2493 |
name="`expr $i : '-l\(.*\)'`" |
name="`expr $i : '-l\(.*\)'`" |
2494 |
# If $name is empty we are operating on a -L argument. |
# If $name is empty we are operating on a -L argument. |
2495 |
if test "$name" != "" ; then |
if test -n "$name" && test "$name" != "0"; then |
2496 |
libname=`eval \\$echo \"$libname_spec\"` |
libname=`eval \\$echo \"$libname_spec\"` |
2497 |
deplib_matches=`eval \\$echo \"$library_names_spec\"` |
deplib_matches=`eval \\$echo \"$library_names_spec\"` |
2498 |
set dummy $deplib_matches |
set dummy $deplib_matches |
2517 |
for i in $deplibs; do |
for i in $deplibs; do |
2518 |
name="`expr $i : '-l\(.*\)'`" |
name="`expr $i : '-l\(.*\)'`" |
2519 |
# If $name is empty we are operating on a -L argument. |
# If $name is empty we are operating on a -L argument. |
2520 |
if test "$name" != "" ; then |
if test -n "$name" && test "$name" != "0"; then |
2521 |
$rm conftest |
$rm conftest |
2522 |
$CC -o conftest conftest.c $i |
$CC -o conftest conftest.c $i |
2523 |
# Did it work? |
# Did it work? |
2553 |
;; |
;; |
2554 |
file_magic*) |
file_magic*) |
2555 |
set dummy $deplibs_check_method |
set dummy $deplibs_check_method |
2556 |
file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`" |
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
2557 |
for a_deplib in $deplibs; do |
for a_deplib in $deplibs; do |
2558 |
name="`expr $a_deplib : '-l\(.*\)'`" |
name="`expr $a_deplib : '-l\(.*\)'`" |
2559 |
# If $name is empty we are operating on a -L argument. |
# If $name is empty we are operating on a -L argument. |
2560 |
if test "$name" != "" ; then |
if test -n "$name" && test "$name" != "0"; then |
2561 |
libname=`eval \\$echo \"$libname_spec\"` |
libname=`eval \\$echo \"$libname_spec\"` |
2562 |
for i in $lib_search_path; do |
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do |
2563 |
potential_libs=`ls $i/$libname[.-]* 2>/dev/null` |
potential_libs=`ls $i/$libname[.-]* 2>/dev/null` |
2564 |
for potent_lib in $potential_libs; do |
for potent_lib in $potential_libs; do |
2565 |
# Follow soft links. |
# Follow soft links. |
2566 |
if ls -lLd "$potent_lib" 2>/dev/null \ |
if ls -lLd "$potent_lib" 2>/dev/null \ |
2567 |
| grep " -> " >/dev/null; then |
| grep " -> " >/dev/null; then |
2568 |
continue |
continue |
2569 |
fi |
fi |
2570 |
# The statement above tries to avoid entering an |
# The statement above tries to avoid entering an |
2571 |
# endless loop below, in case of cyclic links. |
# endless loop below, in case of cyclic links. |
2575 |
potlib="$potent_lib" |
potlib="$potent_lib" |
2576 |
while test -h "$potlib" 2>/dev/null; do |
while test -h "$potlib" 2>/dev/null; do |
2577 |
potliblink=`ls -ld $potlib | sed 's/.* -> //'` |
potliblink=`ls -ld $potlib | sed 's/.* -> //'` |
2578 |
case "$potliblink" in |
case $potliblink in |
2579 |
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; |
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; |
2580 |
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; |
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; |
2581 |
esac |
esac |
2603 |
fi |
fi |
2604 |
done # Gone through all deplibs. |
done # Gone through all deplibs. |
2605 |
;; |
;; |
2606 |
|
match_pattern*) |
2607 |
|
set dummy $deplibs_check_method |
2608 |
|
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
2609 |
|
for a_deplib in $deplibs; do |
2610 |
|
name="`expr $a_deplib : '-l\(.*\)'`" |
2611 |
|
# If $name is empty we are operating on a -L argument. |
2612 |
|
if test -n "$name" && test "$name" != "0"; then |
2613 |
|
libname=`eval \\$echo \"$libname_spec\"` |
2614 |
|
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do |
2615 |
|
potential_libs=`ls $i/$libname[.-]* 2>/dev/null` |
2616 |
|
for potent_lib in $potential_libs; do |
2617 |
|
if eval echo \"$potent_lib\" 2>/dev/null \ |
2618 |
|
| sed 10q \ |
2619 |
|
| egrep "$match_pattern_regex" > /dev/null; then |
2620 |
|
newdeplibs="$newdeplibs $a_deplib" |
2621 |
|
a_deplib="" |
2622 |
|
break 2 |
2623 |
|
fi |
2624 |
|
done |
2625 |
|
done |
2626 |
|
if test -n "$a_deplib" ; then |
2627 |
|
droppeddeps=yes |
2628 |
|
echo |
2629 |
|
echo "*** Warning: This library needs some functionality provided by $a_deplib." |
2630 |
|
echo "*** I have the capability to make that library automatically link in when" |
2631 |
|
echo "*** you link to this library. But I can only do this if you have a" |
2632 |
|
echo "*** shared version of the library, which you do not appear to have." |
2633 |
|
fi |
2634 |
|
else |
2635 |
|
# Add a -L argument. |
2636 |
|
newdeplibs="$newdeplibs $a_deplib" |
2637 |
|
fi |
2638 |
|
done # Gone through all deplibs. |
2639 |
|
;; |
2640 |
none | unknown | *) |
none | unknown | *) |
2641 |
newdeplibs="" |
newdeplibs="" |
2642 |
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ |
if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ |
2659 |
libname=$libname_save |
libname=$libname_save |
2660 |
name=$name_save |
name=$name_save |
2661 |
|
|
2662 |
|
case $host in |
2663 |
|
*-*-rhapsody* | *-*-darwin1.[012]) |
2664 |
|
# On Rhapsody replace the C library is the System framework |
2665 |
|
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` |
2666 |
|
;; |
2667 |
|
esac |
2668 |
|
|
2669 |
if test "$droppeddeps" = yes; then |
if test "$droppeddeps" = yes; then |
2670 |
if test "$module" = yes; then |
if test "$module" = yes; then |
2671 |
echo |
echo |
2691 |
echo "*** The inter-library dependencies that have been dropped here will be" |
echo "*** The inter-library dependencies that have been dropped here will be" |
2692 |
echo "*** automatically added whenever a program is linked with this library" |
echo "*** automatically added whenever a program is linked with this library" |
2693 |
echo "*** or is declared to -dlopen it." |
echo "*** or is declared to -dlopen it." |
2694 |
|
|
2695 |
|
if test $allow_undefined = no; then |
2696 |
|
echo |
2697 |
|
echo "*** Since this library must not contain undefined symbols," |
2698 |
|
echo "*** because either the platform does not support them or" |
2699 |
|
echo "*** it was explicitly requested with -no-undefined," |
2700 |
|
echo "*** libtool will only create a static version of it." |
2701 |
|
if test "$build_old_libs" = no; then |
2702 |
|
oldlibs="$output_objdir/$libname.$libext" |
2703 |
|
build_libtool_libs=module |
2704 |
|
build_old_libs=yes |
2705 |
|
else |
2706 |
|
build_libtool_libs=no |
2707 |
|
fi |
2708 |
|
fi |
2709 |
fi |
fi |
2710 |
fi |
fi |
2711 |
# Done checking deplibs! |
# Done checking deplibs! |
2716 |
library_names= |
library_names= |
2717 |
old_library= |
old_library= |
2718 |
dlname= |
dlname= |
2719 |
|
|
2720 |
# Test again, we may have decided not to build it any more |
# Test again, we may have decided not to build it any more |
2721 |
if test "$build_libtool_libs" = yes; then |
if test "$build_libtool_libs" = yes; then |
2722 |
if test "$hardcode_into_libs" = yes; then |
if test $hardcode_into_libs = yes; then |
2723 |
# Hardcode the library paths |
# Hardcode the library paths |
2724 |
hardcode_libdirs= |
hardcode_libdirs= |
2725 |
dep_rpath= |
dep_rpath= |
2726 |
rpath="$finalize_rpath" |
rpath="$finalize_rpath" |
2727 |
test "$relink" = no && rpath="$compile_rpath$rpath" |
test "$mode" != relink && rpath="$compile_rpath$rpath" |
2728 |
for libdir in $rpath; do |
for libdir in $rpath; do |
2729 |
if test -n "$hardcode_libdir_flag_spec"; then |
if test -n "$hardcode_libdir_flag_spec"; then |
2730 |
if test -n "$hardcode_libdir_separator"; then |
if test -n "$hardcode_libdir_separator"; then |
2732 |
hardcode_libdirs="$libdir" |
hardcode_libdirs="$libdir" |
2733 |
else |
else |
2734 |
# Just accumulate the unique libdirs. |
# Just accumulate the unique libdirs. |
2735 |
case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in |
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
2736 |
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
2737 |
;; |
;; |
2738 |
*) |
*) |
2768 |
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" |
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" |
2769 |
fi |
fi |
2770 |
|
|
2771 |
shlibpath="$finalize_shlibpath" |
shlibpath="$finalize_shlibpath" |
2772 |
test "$relink" = no && shlibpath="$compile_shlibpath$shlibpath" |
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" |
2773 |
if test -n "$shlibpath"; then |
if test -n "$shlibpath"; then |
2774 |
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" |
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" |
2775 |
fi |
fi |
2776 |
|
|
2777 |
# Get the real and link names of the library. |
# Get the real and link names of the library. |
2778 |
eval library_names=\"$library_names_spec\" |
eval library_names=\"$library_names_spec\" |
2779 |
set dummy $library_names |
set dummy $library_names |
2785 |
else |
else |
2786 |
soname="$realname" |
soname="$realname" |
2787 |
fi |
fi |
2788 |
|
test -z "$dlname" && dlname=$soname |
2789 |
|
|
2790 |
lib="$output_objdir/$realname" |
lib="$output_objdir/$realname" |
2791 |
for link |
for link |
2794 |
done |
done |
2795 |
|
|
2796 |
# Ensure that we have .o objects for linkers which dislike .lo |
# Ensure that we have .o objects for linkers which dislike .lo |
2797 |
# (e.g. aix) incase we are running --disable-static |
# (e.g. aix) in case we are running --disable-static |
2798 |
for obj in $libobjs; do |
for obj in $libobjs; do |
2799 |
oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"` |
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
2800 |
if test ! -f $oldobj; then |
if test "X$xdir" = "X$obj"; then |
2801 |
$show "${LN_S} $obj $oldobj" |
xdir="." |
2802 |
$run ${LN_S} $obj $oldobj || exit $? |
else |
2803 |
|
xdir="$xdir" |
2804 |
|
fi |
2805 |
|
baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
2806 |
|
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` |
2807 |
|
if test ! -f $xdir/$oldobj; then |
2808 |
|
$show "(cd $xdir && ${LN_S} $baseobj $oldobj)" |
2809 |
|
$run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? |
2810 |
fi |
fi |
2811 |
done |
done |
2812 |
|
|
2820 |
export_symbols="$output_objdir/$libname.exp" |
export_symbols="$output_objdir/$libname.exp" |
2821 |
$run $rm $export_symbols |
$run $rm $export_symbols |
2822 |
eval cmds=\"$export_symbols_cmds\" |
eval cmds=\"$export_symbols_cmds\" |
2823 |
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
save_ifs="$IFS"; IFS='~' |
2824 |
for cmd in $cmds; do |
for cmd in $cmds; do |
2825 |
IFS="$save_ifs" |
IFS="$save_ifs" |
2826 |
$show "$cmd" |
$show "$cmd" |
2857 |
|
|
2858 |
for xlib in $convenience; do |
for xlib in $convenience; do |
2859 |
# Extract the objects. |
# Extract the objects. |
2860 |
case "$xlib" in |
case $xlib in |
2861 |
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
2862 |
*) xabs=`pwd`"/$xlib" ;; |
*) xabs=`pwd`"/$xlib" ;; |
2863 |
esac |
esac |
2886 |
fi |
fi |
2887 |
|
|
2888 |
# Make a backup of the uninstalled library when relinking |
# Make a backup of the uninstalled library when relinking |
2889 |
if test "$relink" = yes && test "$hardcode_into_libs" = yes ; then |
if test "$mode" = relink; then |
2890 |
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? |
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? |
2891 |
fi |
fi |
2892 |
|
|
2896 |
else |
else |
2897 |
eval cmds=\"$archive_cmds\" |
eval cmds=\"$archive_cmds\" |
2898 |
fi |
fi |
2899 |
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
save_ifs="$IFS"; IFS='~' |
2900 |
for cmd in $cmds; do |
for cmd in $cmds; do |
2901 |
IFS="$save_ifs" |
IFS="$save_ifs" |
2902 |
$show "$cmd" |
$show "$cmd" |
2905 |
IFS="$save_ifs" |
IFS="$save_ifs" |
2906 |
|
|
2907 |
# Restore the uninstalled library and exit |
# Restore the uninstalled library and exit |
2908 |
if test "$relink" = yes && test "$hardcode_into_libs" = yes; then |
if test "$mode" = relink; then |
2909 |
$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 $? |
2910 |
exit 0 |
exit 0 |
2911 |
fi |
fi |
2926 |
fi |
fi |
2927 |
;; |
;; |
2928 |
|
|
2929 |
*.lo | *.o | *.obj) |
obj) |
2930 |
if test -n "$deplibs"; then |
if test -n "$deplibs"; then |
2931 |
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 |
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 |
2932 |
fi |
fi |
2951 |
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2 |
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2 |
2952 |
fi |
fi |
2953 |
|
|
2954 |
case "$output" in |
case $output in |
2955 |
*.lo) |
*.lo) |
2956 |
if test -n "$objs$old_deplibs"; then |
if test -n "$objs$old_deplibs"; then |
2957 |
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 |
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 |
2977 |
gentop= |
gentop= |
2978 |
# reload_cmds runs $LD directly, so let us get rid of |
# reload_cmds runs $LD directly, so let us get rid of |
2979 |
# -Wl from whole_archive_flag_spec |
# -Wl from whole_archive_flag_spec |
2980 |
wl= |
wl= |
2981 |
|
|
2982 |
if test -n "$convenience"; then |
if test -n "$convenience"; then |
2983 |
if test -n "$whole_archive_flag_spec"; then |
if test -n "$whole_archive_flag_spec"; then |
2996 |
|
|
2997 |
for xlib in $convenience; do |
for xlib in $convenience; do |
2998 |
# Extract the objects. |
# Extract the objects. |
2999 |
case "$xlib" in |
case $xlib in |
3000 |
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
3001 |
*) xabs=`pwd`"/$xlib" ;; |
*) xabs=`pwd`"/$xlib" ;; |
3002 |
esac |
esac |
3020 |
fi |
fi |
3021 |
|
|
3022 |
# Create the old-style object. |
# Create the old-style object. |
3023 |
reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" |
reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test |
3024 |
|
|
3025 |
output="$obj" |
output="$obj" |
3026 |
eval cmds=\"$reload_cmds\" |
eval cmds=\"$reload_cmds\" |
3027 |
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
save_ifs="$IFS"; IFS='~' |
3028 |
for cmd in $cmds; do |
for cmd in $cmds; do |
3029 |
IFS="$save_ifs" |
IFS="$save_ifs" |
3030 |
$show "$cmd" |
$show "$cmd" |
3055 |
exit 0 |
exit 0 |
3056 |
fi |
fi |
3057 |
|
|
3058 |
if test -n "$pic_flag"; then |
if test -n "$pic_flag" || test "$pic_mode" != default; then |
3059 |
# Only do commands if we really have different PIC objects. |
# Only do commands if we really have different PIC objects. |
3060 |
reload_objs="$libobjs $reload_conv_objs" |
reload_objs="$libobjs $reload_conv_objs" |
3061 |
output="$libobj" |
output="$libobj" |
3062 |
eval cmds=\"$reload_cmds\" |
eval cmds=\"$reload_cmds\" |
3063 |
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
save_ifs="$IFS"; IFS='~' |
3064 |
for cmd in $cmds; do |
for cmd in $cmds; do |
3065 |
IFS="$save_ifs" |
IFS="$save_ifs" |
3066 |
$show "$cmd" |
$show "$cmd" |
3071 |
# Just create a symlink. |
# Just create a symlink. |
3072 |
$show $rm $libobj |
$show $rm $libobj |
3073 |
$run $rm $libobj |
$run $rm $libobj |
3074 |
$show "$LN_S $obj $libobj" |
xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` |
3075 |
$run $LN_S $obj $libobj || exit $? |
if test "X$xdir" = "X$libobj"; then |
3076 |
|
xdir="." |
3077 |
|
else |
3078 |
|
xdir="$xdir" |
3079 |
|
fi |
3080 |
|
baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` |
3081 |
|
oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` |
3082 |
|
$show "(cd $xdir && $LN_S $oldobj $baseobj)" |
3083 |
|
$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? |
3084 |
fi |
fi |
3085 |
|
|
3086 |
if test -n "$gentop"; then |
if test -n "$gentop"; then |
3091 |
exit 0 |
exit 0 |
3092 |
;; |
;; |
3093 |
|
|
3094 |
# Anything else should be a program. |
prog) |
3095 |
*) |
case $host in |
3096 |
|
*cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; |
3097 |
|
esac |
3098 |
if test -n "$vinfo"; then |
if test -n "$vinfo"; then |
3099 |
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 |
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 |
3100 |
fi |
fi |
3104 |
fi |
fi |
3105 |
|
|
3106 |
if test "$preload" = yes; then |
if test "$preload" = yes; then |
3107 |
if test "$dlopen" = unknown && test "$dlopen_self" = unknown && |
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && |
3108 |
test "$dlopen_self_static" = unknown; then |
test "$dlopen_self_static" = unknown; then |
3109 |
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." |
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." |
|
fi |
|
|
fi |
|
|
|
|
|
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` |
|
|
if test "X$output_objdir" = "X$output"; then |
|
|
output_objdir="$objdir" |
|
|
else |
|
|
output_objdir="$output_objdir/$objdir" |
|
|
fi |
|
|
|
|
|
# Create the binary in the object directory, then wrap it. |
|
|
if test ! -d $output_objdir; then |
|
|
$show "$mkdir $output_objdir" |
|
|
$run $mkdir $output_objdir |
|
|
status=$? |
|
|
if test $status -ne 0 && test ! -d $output_objdir; then |
|
|
exit $status |
|
3110 |
fi |
fi |
3111 |
fi |
fi |
3112 |
|
|
3113 |
# Find libtool libraries and add their dependencies |
case $host in |
3114 |
save_deplibs="$deplibs" |
*-*-rhapsody* | *-*-darwin1.[012]) |
3115 |
deplibs= |
# On Rhapsody replace the C library is the System framework |
3116 |
newdependency_libs= |
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` |
3117 |
new_lib_search_path= |
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` |
3118 |
for deplib in $save_deplibs; do |
;; |
3119 |
lib= |
esac |
|
case "$deplib" in |
|
|
*.a | *.lib) |
|
|
deplibs="$deplibs $deplib" |
|
|
continue |
|
|
;; |
|
|
-L*) |
|
|
deplibs="$deplibs $deplib" |
|
|
new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
|
|
continue |
|
|
;; |
|
|
-l*) |
|
|
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
|
|
found=no |
|
|
for searchdir in $lib_search_path; do |
|
|
# Search the libtool library |
|
|
lib="$searchdir/lib${name}.la" |
|
|
if test -f "$lib"; then |
|
|
found=yes |
|
|
break |
|
|
fi |
|
|
done |
|
|
if test "$found" != yes; then |
|
|
deplibs="$deplibs $deplib" |
|
|
continue |
|
|
fi |
|
|
;; |
|
|
*) |
|
|
lib="$deplib" |
|
|
if test -f "$lib"; then : |
|
|
else |
|
|
$echo "$modename: cannot find the library \`$lib'" 1>&2 |
|
|
exit 1 |
|
|
fi |
|
|
;; |
|
|
esac |
|
|
libdir= |
|
|
library_names= |
|
|
old_library= |
|
|
|
|
|
# Check to see that this really is a libtool archive. |
|
|
if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
|
|
else |
|
|
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
# If the library was installed with an old release of libtool, |
|
|
# it will not redefine variable installed. |
|
|
installed=yes |
|
|
|
|
|
# Read the .la file |
|
|
case "$lib" in |
|
|
*/* | *\\*) . $lib ;; |
|
|
*) . ./$lib ;; |
|
|
esac |
|
|
|
|
|
# Get the name of the library we link against. |
|
|
linklib= |
|
|
for l in $old_library $library_names; do |
|
|
linklib="$l" |
|
|
done |
|
|
|
|
|
if test -z "$linklib"; then |
|
|
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
new_lib_search_path="$new_lib_search_path `$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`" |
|
|
deplibs="$deplibs $lib" |
|
|
|
|
|
for deplib in $dependency_libs; do |
|
|
case "$deplib" in |
|
|
-L*) |
|
|
new_lib_search_path="$new_lib_search_path `$echo "X$deplib" | $Xsed -e 's/^-L//'`" |
|
|
;; |
|
|
esac |
|
|
|
|
|
if test "$link_all_deplibs" != no || \ |
|
|
test "$fast_install" != no || \ |
|
|
test "$build_libtool_libs" = no || \ |
|
|
test -z "$library_names"; then |
|
|
# Need to link against all dependency_libs |
|
|
deplibs="$deplibs $deplib" |
|
|
else |
|
|
# Need to hardcode shared library paths |
|
|
# or/and link against static libraries |
|
|
newdependency_libs="$newdependency_libs $deplib" |
|
|
fi |
|
|
done |
|
|
done |
|
|
|
|
|
# Eliminate all dependency_libs that are already contained in deplibs |
|
|
dependency_libs= |
|
|
for deplib in $newdependency_libs; do |
|
|
case "$deplibs " in |
|
|
*" $deplib "*) ;; |
|
|
*) dependency_libs="$dependency_libs $deplib" ;; |
|
|
esac |
|
|
done |
|
|
|
|
|
# Make sure lib_search_path contains only unique directories. |
|
|
lib_search_path= |
|
|
for dir in $new_lib_search_path; do |
|
|
case "$lib_search_path " in |
|
|
*" $dir "*) ;; |
|
|
*) lib_search_path="$lib_search_path $dir" ;; |
|
|
esac |
|
|
done |
|
|
lib_search_path="$lib_search_path $sys_lib_search_path" |
|
|
|
|
|
# Find libtool libraries and add their directories |
|
|
alldeplibs=no |
|
|
link_against_libtool_libs= |
|
|
|
|
|
for deplib in $deplibs @DEPLIBS@ $dependency_libs; do |
|
|
lib= |
|
|
case "$deplib" in |
|
|
-L* | *.a | *.lib) |
|
|
compile_command="$compile_command $deplib" |
|
|
finalize_command="$finalize_command $deplib" |
|
|
continue |
|
|
;; |
|
|
-R*) |
|
|
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` |
|
|
# Make sure the xrpath contains only unique directories. |
|
|
case "$xrpath " in |
|
|
*" $dir "*) ;; |
|
|
*) xrpath="$xrpath $dir" ;; |
|
|
esac |
|
|
continue |
|
|
;; |
|
|
@DEPLIBS@) |
|
|
alldeplibs=yes |
|
|
continue |
|
|
;; |
|
|
-l*) |
|
|
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
|
|
found=no |
|
|
for searchdir in $lib_search_path; do |
|
|
# Search the libtool library |
|
|
lib="$searchdir/lib${name}.la" |
|
|
if test -f "$lib"; then |
|
|
found=yes |
|
|
break |
|
|
fi |
|
|
done |
|
|
if test "$found" != yes; then |
|
|
compile_command="$compile_command $deplib" |
|
|
finalize_command="$finalize_command $deplib" |
|
|
continue |
|
|
fi |
|
|
;; |
|
|
*) |
|
|
lib="$deplib" |
|
|
if test -f "$lib"; then : |
|
|
else |
|
|
$echo "$modename: cannot find the library \`$lib'" 1>&2 |
|
|
exit 1 |
|
|
fi |
|
|
;; |
|
|
esac |
|
|
libdir= |
|
|
library_names= |
|
|
old_library= |
|
|
|
|
|
# Check to see that this really is a libtool archive. |
|
|
if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
|
|
else |
|
|
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` |
|
|
test "X$ladir" = "X$lib" && ladir="." |
|
|
# We need an absolute path. |
|
|
case "$ladir" in |
|
|
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; |
|
|
*) |
|
|
abs_ladir=`cd "$ladir" && pwd` |
|
|
if test -z "$abs_ladir"; then |
|
|
$echo "$modename: warning: cannot determine absolute directory name of \`$abs_ladir'" 1>&2 |
|
|
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2 |
|
|
abs_ladir="$ladir" |
|
|
fi |
|
|
;; |
|
|
esac |
|
|
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
|
|
|
|
|
# If the library was installed with an old release of libtool, |
|
|
# it will not redefine variable installed. |
|
|
installed=yes |
|
|
|
|
|
# Read the .la file |
|
|
case "$lib" in |
|
|
*/* | *\\*) . $lib ;; |
|
|
*) . ./$lib ;; |
|
|
esac |
|
|
|
|
|
# Get the name of the library we link against. |
|
|
linklib= |
|
|
for l in $old_library $library_names; do |
|
|
linklib="$l" |
|
|
done |
|
|
|
|
|
if test -z "$linklib"; then |
|
|
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
# Find the relevant object directory and library name. |
|
|
if test "X$installed" = Xyes; then |
|
|
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then |
|
|
$echo "$modename: warning: library \`$lib' was moved." 1>&2 |
|
|
dir="$ladir" |
|
|
absdir="$abs_ladir" |
|
|
libdir="$abs_ladir" |
|
|
else |
|
|
dir="$libdir" |
|
|
absdir="$libdir" |
|
|
fi |
|
|
else |
|
|
dir="$ladir/$objdir" |
|
|
absdir="$abs_ladir/$objdir" |
|
|
fi |
|
|
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
|
|
|
|
|
hardcode=yes |
|
|
test "$hardcode_into_libs" = yes && test "$alldeplibs" = yes && hardcode=no |
|
|
if test "$hardcode" = yes && test -n "$library_names" && |
|
|
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
|
|
# We need to hardcode the library path |
|
|
if test -n "$shlibpath_var"; then |
|
|
# Make sure the rpath contains only unique directories. |
|
|
case "$temp_rpath " in |
|
|
*" $dir "*) ;; |
|
|
*" $absdir "*) ;; |
|
|
*) temp_rpath="$temp_rpath $dir" ;; |
|
|
esac |
|
|
fi |
|
|
|
|
|
# Hardcode the library path. |
|
|
# Skip directories that are in the system default run-time |
|
|
# search path. |
|
|
case " $sys_lib_dlsearch_path " in |
|
|
*" $absdir "*) ;; |
|
|
*) |
|
|
case "$compile_rpath " in |
|
|
*" $absdir "*) ;; |
|
|
*) compile_rpath="$compile_rpath $absdir" |
|
|
esac |
|
|
;; |
|
|
esac |
|
|
|
|
|
case " $sys_lib_dlsearch_path " in |
|
|
*" $libdir "*) ;; |
|
|
*) |
|
|
case "$finalize_rpath " in |
|
|
*" $libdir "*) ;; |
|
|
*) finalize_rpath="$finalize_rpath $libdir" |
|
|
esac |
|
|
;; |
|
|
esac |
|
|
fi |
|
|
|
|
|
if test "$alldeplibs" = yes && |
|
|
{ test "$deplibs_check_method" = pass_all || |
|
|
{ test "$build_libtool_libs" = yes && |
|
|
test -n "$library_names"; }; }; then |
|
|
# Do we only need to link against static libraries? |
|
|
continue |
|
|
fi |
|
|
|
|
|
if test -z "$libdir"; then |
|
|
# It is a libtool convenience library, so add in its objects. |
|
|
convenience="$convenience $dir/$old_library" |
|
|
old_convenience="$old_convenience $dir/$old_library" |
|
|
compile_command="$compile_command $dir/$old_library" |
|
|
finalize_command="$finalize_command $dir/$old_library" |
|
|
continue |
|
|
fi |
|
|
|
|
|
if test -n "$library_names" && |
|
|
{ test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
|
|
link_against_libtool_libs="$link_against_libtool_libs $lib" |
|
|
|
|
|
if test -n "$old_archive_from_expsyms_cmds"; then |
|
|
# figure out the soname |
|
|
set dummy $library_names |
|
|
realname="$2" |
|
|
shift; shift |
|
|
libname=`eval \\$echo \"$libname_spec\"` |
|
|
if test -n "$soname_spec"; then |
|
|
eval soname=\"$soname_spec\" |
|
|
else |
|
|
soname="$realname" |
|
|
fi |
|
|
|
|
|
# Make a new name for the extract_expsyms_cmds to use |
|
|
newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" |
|
|
|
|
|
# If the library has no export list, then create one now |
|
|
if test -f "$output_objdir/$soname-def"; then : |
|
|
else |
|
|
$show "extracting exported symbol list from \`$soname'" |
|
|
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
|
|
eval cmds=\"$extract_expsyms_cmds\" |
|
|
for cmd in $cmds; do |
|
|
IFS="$save_ifs" |
|
|
$show "$cmd" |
|
|
$run eval "$cmd" || exit $? |
|
|
done |
|
|
IFS="$save_ifs" |
|
|
fi |
|
|
|
|
|
# Create $newlib |
|
|
if test -f "$output_objdir/$newlib"; then :; else |
|
|
$show "generating import library for \`$soname'" |
|
|
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
|
|
eval cmds=\"$old_archive_from_expsyms_cmds\" |
|
|
for cmd in $cmds; do |
|
|
IFS="$save_ifs" |
|
|
$show "$cmd" |
|
|
$run eval "$cmd" || exit $? |
|
|
done |
|
|
IFS="$save_ifs" |
|
|
fi |
|
|
# make sure the library variables are pointing to the new library |
|
|
dir=$output_objdir |
|
|
linklib=$newlib |
|
|
fi |
|
|
|
|
|
lib_linked=yes |
|
|
add_dir= |
|
|
add_shlibpath= |
|
|
add_name=no |
|
|
case "$hardcode_action" in |
|
|
immediate | unsupported) |
|
|
if test "$hardcode_direct" = no; then |
|
|
compile_command="$compile_command $dir/$linklib" |
|
|
elif test "$hardcode_minus_L" = no; then |
|
|
case "$host" in |
|
|
*-*-sunos*) add_shlibpath="$dir" ;; |
|
|
esac |
|
|
add_dir="-L$dir" |
|
|
add_name=yes |
|
|
elif test "$hardcode_shlibpath_var" = no; then |
|
|
add_shlibpath="$dir" |
|
|
add_name=yes |
|
|
else |
|
|
lib_linked=no |
|
|
fi |
|
|
;; |
|
|
|
|
|
relink) |
|
|
if test "$hardcode_direct" = yes; then |
|
|
compile_command="$compile_command $absdir/$linklib" |
|
|
elif test "$hardcode_minus_L" = yes; then |
|
|
add_dir="-L$absdir" |
|
|
add_name=yes |
|
|
elif test "$hardcode_shlibpath_var" = yes; then |
|
|
add_shlibpath="$absdir" |
|
|
add_name=yes |
|
|
else |
|
|
lib_linked=no |
|
|
fi |
|
|
;; |
|
|
|
|
|
*) lib_linked=no ;; |
|
|
esac |
|
3120 |
|
|
3121 |
if test "$lib_linked" != yes; then |
compile_command="$compile_command $compile_deplibs" |
3122 |
$echo "$modename: configuration error: unsupported hardcode properties" |
finalize_command="$finalize_command $finalize_deplibs" |
|
exit 1 |
|
|
fi |
|
|
if test -n "$add_dir"; then |
|
|
case "$compile_command " in |
|
|
*" $add_dir "*) ;; |
|
|
*) compile_command="$compile_command $add_dir" ;; |
|
|
esac |
|
|
fi |
|
|
if test -n "$add_shlibpath"; then |
|
|
case ":$compile_shlibpath:" in |
|
|
*":$add_shlibpath:"*) ;; |
|
|
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; |
|
|
esac |
|
|
fi |
|
|
test "$add_name" = yes && compile_command="$compile_command -l$name" |
|
3123 |
|
|
|
add_dir= |
|
|
add_name=no |
|
|
# Finalize command for both is simple: just hardcode it. |
|
|
if test "$hardcode_direct" = yes; then |
|
|
finalize_command="$finalize_command $libdir/$linklib" |
|
|
elif test "$hardcode_minus_L" = yes; then |
|
|
add_dir="-L$libdir" |
|
|
add_name=yes |
|
|
elif test "$hardcode_shlibpath_var" = yes; then |
|
|
case ":$finalize_shlibpath:" in |
|
|
*":$libdir:"*) ;; |
|
|
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; |
|
|
esac |
|
|
add_name=yes |
|
|
else |
|
|
# We cannot seem to hardcode it, guess we'll fake it. |
|
|
add_dir="-L$libdir" |
|
|
add_name=yes |
|
|
fi |
|
|
if test -n "$add_dir"; then |
|
|
case "$finalize_command " in |
|
|
*" $add_dir "*) ;; |
|
|
*) finalize_command="$finalize_command $add_dir" ;; |
|
|
esac |
|
|
fi |
|
|
test "$add_name" = yes && finalize_command="$finalize_command -l$name" |
|
|
else |
|
|
# Here we assume that one of hardcode_direct or hardcode_minus_L |
|
|
# is not unsupported. This is valid on all known static and |
|
|
# shared platforms. |
|
|
if test "$hardcode_direct" != unsupported; then |
|
|
test -n "$old_library" && linklib="$old_library" |
|
|
compile_command="$compile_command $dir/$linklib" |
|
|
finalize_command="$finalize_command $dir/$linklib" |
|
|
else |
|
|
case "$compile_command " in |
|
|
*" -L$dir "*) ;; |
|
|
*) compile_command="$compile_command -L$dir";; |
|
|
esac |
|
|
compile_command="$compile_command -l$name" |
|
|
case "$finalize_command " in |
|
|
*" -L$dir "*) ;; |
|
|
*) finalize_command="$finalize_command -L$dir";; |
|
|
esac |
|
|
finalize_command="$finalize_command -l$name" |
|
|
fi |
|
|
fi |
|
|
done |
|
|
|
|
3124 |
if test -n "$rpath$xrpath"; then |
if test -n "$rpath$xrpath"; then |
3125 |
# If the user specified any rpath flags, then add them. |
# If the user specified any rpath flags, then add them. |
3126 |
for libdir in $rpath $xrpath; do |
for libdir in $rpath $xrpath; do |
3127 |
# This is the magic to use -rpath. |
# This is the magic to use -rpath. |
|
case "$compile_rpath " in |
|
|
*" $libdir "*) ;; |
|
|
*) compile_rpath="$compile_rpath $libdir" ;; |
|
|
esac |
|
3128 |
case "$finalize_rpath " in |
case "$finalize_rpath " in |
3129 |
*" $libdir "*) ;; |
*" $libdir "*) ;; |
3130 |
*) finalize_rpath="$finalize_rpath $libdir" ;; |
*) finalize_rpath="$finalize_rpath $libdir" ;; |
3142 |
hardcode_libdirs="$libdir" |
hardcode_libdirs="$libdir" |
3143 |
else |
else |
3144 |
# Just accumulate the unique libdirs. |
# Just accumulate the unique libdirs. |
3145 |
case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in |
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
3146 |
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
3147 |
;; |
;; |
3148 |
*) |
*) |
3160 |
*) perm_rpath="$perm_rpath $libdir" ;; |
*) perm_rpath="$perm_rpath $libdir" ;; |
3161 |
esac |
esac |
3162 |
fi |
fi |
3163 |
case "$host" in |
case $host in |
3164 |
*-*-cygwin* | *-*-mingw* | *-*-os2*) |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
3165 |
case ":$dllsearchpath:" in |
case :$dllsearchpath: in |
3166 |
*":$libdir:"*) ;; |
*":$libdir:"*) ;; |
3167 |
*) dllsearchpath="$dllsearchpath:$libdir";; |
*) dllsearchpath="$dllsearchpath:$libdir";; |
3168 |
esac |
esac |
3186 |
hardcode_libdirs="$libdir" |
hardcode_libdirs="$libdir" |
3187 |
else |
else |
3188 |
# Just accumulate the unique libdirs. |
# Just accumulate the unique libdirs. |
3189 |
case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in |
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
3190 |
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
3191 |
;; |
;; |
3192 |
*) |
*) |
3229 |
fi |
fi |
3230 |
|
|
3231 |
if test -n "$dlsyms"; then |
if test -n "$dlsyms"; then |
3232 |
case "$dlsyms" in |
case $dlsyms in |
3233 |
"") ;; |
"") ;; |
3234 |
*.c) |
*.c) |
3235 |
# Discover the nlist of each of the dlfiles. |
# Discover the nlist of each of the dlfiles. |
3271 |
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' |
$run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' |
3272 |
$run eval '$mv "$nlist"T "$nlist"' |
$run eval '$mv "$nlist"T "$nlist"' |
3273 |
fi |
fi |
3274 |
|
|
3275 |
if test -n "$export_symbols_regex"; then |
if test -n "$export_symbols_regex"; then |
3276 |
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' |
$run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' |
3277 |
$run eval '$mv "$nlist"T "$nlist"' |
$run eval '$mv "$nlist"T "$nlist"' |
3323 |
#undef lt_preloaded_symbols |
#undef lt_preloaded_symbols |
3324 |
|
|
3325 |
#if defined (__STDC__) && __STDC__ |
#if defined (__STDC__) && __STDC__ |
3326 |
# define lt_ptr_t void * |
# define lt_ptr void * |
3327 |
#else |
#else |
3328 |
# define lt_ptr_t char * |
# define lt_ptr char * |
3329 |
# define const |
# define const |
3330 |
#endif |
#endif |
3331 |
|
|
3332 |
/* The mapping between symbol names and symbols. */ |
/* The mapping between symbol names and symbols. */ |
3333 |
const struct { |
const struct { |
3334 |
const char *name; |
const char *name; |
3335 |
lt_ptr_t address; |
lt_ptr address; |
3336 |
} |
} |
3337 |
lt_preloaded_symbols[] = |
lt_preloaded_symbols[] = |
3338 |
{\ |
{\ |
3339 |
" |
" |
3340 |
|
|
3341 |
sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ |
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" |
|
-e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ |
|
|
< "$nlist" >> "$output_objdir/$dlsyms" |
|
3342 |
|
|
3343 |
$echo >> "$output_objdir/$dlsyms" "\ |
$echo >> "$output_objdir/$dlsyms" "\ |
3344 |
{0, (lt_ptr_t) 0} |
{0, (lt_ptr) 0} |
3345 |
}; |
}; |
3346 |
|
|
3347 |
/* This works around a problem in FreeBSD linker */ |
/* This works around a problem in FreeBSD linker */ |
3358 |
fi |
fi |
3359 |
|
|
3360 |
pic_flag_for_symtable= |
pic_flag_for_symtable= |
3361 |
case "$host" in |
case $host in |
3362 |
# compiling the symbol table file with pic_flag works around |
# compiling the symbol table file with pic_flag works around |
3363 |
# a FreeBSD bug that causes programs to crash when -lm is |
# a FreeBSD bug that causes programs to crash when -lm is |
3364 |
# linked before any other PIC object. But we must not use |
# linked before any other PIC object. But we must not use |
3365 |
# pic_flag when linking with -static. The problem exists in |
# pic_flag when linking with -static. The problem exists in |
3366 |
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. |
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. |
3367 |
*-*-freebsd2*|*-*-freebsd3.0*) |
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) |
3368 |
case "$compile_command " in |
case "$compile_command " in |
3369 |
*" -static "*) ;; |
*" -static "*) ;; |
3370 |
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; |
*) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; |
3371 |
|
esac;; |
3372 |
|
*-*-hpux*) |
3373 |
|
case "$compile_command " in |
3374 |
|
*" -static "*) ;; |
3375 |
|
*) pic_flag_for_symtable=" $pic_flag -DPIC";; |
3376 |
esac |
esac |
3377 |
esac |
esac |
3378 |
|
|
3403 |
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` |
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` |
3404 |
fi |
fi |
3405 |
|
|
3406 |
if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then |
if test $need_relink = no || test "$build_libtool_libs" != yes; then |
3407 |
# Replace the output file specification. |
# Replace the output file specification. |
3408 |
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` |
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` |
3409 |
link_command="$compile_command$compile_rpath" |
link_command="$compile_command$compile_rpath" |
3412 |
$show "$link_command" |
$show "$link_command" |
3413 |
$run eval "$link_command" |
$run eval "$link_command" |
3414 |
status=$? |
status=$? |
3415 |
|
|
3416 |
# Delete the generated files. |
# Delete the generated files. |
3417 |
if test -n "$dlsyms"; then |
if test -n "$dlsyms"; then |
3418 |
$show "$rm $output_objdir/${outputname}S.${objext}" |
$show "$rm $output_objdir/${outputname}S.${objext}" |
3426 |
# We should set the shlibpath_var |
# We should set the shlibpath_var |
3427 |
rpath= |
rpath= |
3428 |
for dir in $temp_rpath; do |
for dir in $temp_rpath; do |
3429 |
case "$dir" in |
case $dir in |
3430 |
[\\/]* | [A-Za-z]:[\\/]*) |
[\\/]* | [A-Za-z]:[\\/]*) |
3431 |
# Absolute path. |
# Absolute path. |
3432 |
rpath="$rpath$dir:" |
rpath="$rpath$dir:" |
3468 |
fi |
fi |
3469 |
fi |
fi |
3470 |
|
|
3471 |
if test "$hardcode_action" = relink || test "$hardcode_into_libs" = yes; then |
if test "$no_install" = yes; then |
3472 |
|
# We don't need to create a wrapper script. |
3473 |
|
link_command="$compile_var$compile_command$compile_rpath" |
3474 |
|
# Replace the output file specification. |
3475 |
|
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` |
3476 |
|
# Delete the old output file. |
3477 |
|
$run $rm $output |
3478 |
|
# Link the executable and exit |
3479 |
|
$show "$link_command" |
3480 |
|
$run eval "$link_command" || exit $? |
3481 |
|
exit 0 |
3482 |
|
fi |
3483 |
|
|
3484 |
|
if test "$hardcode_action" = relink; then |
3485 |
# Fast installation is not supported |
# Fast installation is not supported |
3486 |
link_command="$compile_var$compile_command$compile_rpath" |
link_command="$compile_var$compile_command$compile_rpath" |
3487 |
relink_command="$finalize_var$finalize_command$finalize_rpath" |
relink_command="$finalize_var$finalize_command$finalize_rpath" |
3488 |
|
|
3489 |
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 |
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 |
3490 |
$echo "$modename: \`$output' will be relinked during installation" 1>&2 |
$echo "$modename: \`$output' will be relinked during installation" 1>&2 |
3491 |
else |
else |
3505 |
|
|
3506 |
# Replace the output file specification. |
# Replace the output file specification. |
3507 |
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` |
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` |
3508 |
|
|
3509 |
# Delete the old output files. |
# Delete the old output files. |
3510 |
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname |
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname |
3511 |
|
|
3517 |
|
|
3518 |
# Quote the relink command for shipping. |
# Quote the relink command for shipping. |
3519 |
if test -n "$relink_command"; then |
if test -n "$relink_command"; then |
3520 |
|
# Preserve any variables that may affect compiler behavior |
3521 |
|
for var in $variables_saved_for_relink; do |
3522 |
|
if eval test -z \"\${$var+set}\"; then |
3523 |
|
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" |
3524 |
|
elif eval var_value=\$$var; test -z "$var_value"; then |
3525 |
|
relink_command="$var=; export $var; $relink_command" |
3526 |
|
else |
3527 |
|
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` |
3528 |
|
relink_command="$var=\"$var_value\"; export $var; $relink_command" |
3529 |
|
fi |
3530 |
|
done |
3531 |
|
relink_command="cd `pwd`; $relink_command" |
3532 |
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` |
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` |
3533 |
fi |
fi |
3534 |
|
|
3535 |
# Quote $echo for shipping. |
# Quote $echo for shipping. |
3536 |
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then |
if test "X$echo" = "X$SHELL $0 --fallback-echo"; then |
3537 |
case "$0" in |
case $0 in |
3538 |
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; |
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; |
3539 |
*) qecho="$SHELL `pwd`/$0 --fallback-echo";; |
*) qecho="$SHELL `pwd`/$0 --fallback-echo";; |
3540 |
esac |
esac |
3550 |
case $output in |
case $output in |
3551 |
*.exe) output=`echo $output|sed 's,.exe$,,'` ;; |
*.exe) output=`echo $output|sed 's,.exe$,,'` ;; |
3552 |
esac |
esac |
3553 |
|
# test for cygwin because mv fails w/o .exe extensions |
3554 |
|
case $host in |
3555 |
|
*cygwin*) exeext=.exe ;; |
3556 |
|
*) exeext= ;; |
3557 |
|
esac |
3558 |
$rm $output |
$rm $output |
3559 |
trap "$rm $output; exit 1" 1 2 15 |
trap "$rm $output; exit 1" 1 2 15 |
3560 |
|
|
3577 |
|
|
3578 |
# The HP-UX ksh and POSIX shell print the target directory to stdout |
# The HP-UX ksh and POSIX shell print the target directory to stdout |
3579 |
# if CDPATH is set. |
# if CDPATH is set. |
3580 |
if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi |
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi |
3581 |
|
|
3582 |
relink_command=\"$relink_command\" |
relink_command=\"$relink_command\" |
3583 |
|
|
3584 |
# This environment variable determines our operation mode. |
# This environment variable determines our operation mode. |
3585 |
if test \"\$libtool_install_magic\" = \"$magic\"; then |
if test \"\$libtool_install_magic\" = \"$magic\"; then |
3586 |
# install mode needs the following variable: |
# install mode needs the following variable: |
3587 |
link_against_libtool_libs='$link_against_libtool_libs' |
notinst_deplibs='$notinst_deplibs' |
3588 |
else |
else |
3589 |
# When we are sourced in execute mode, \$file and \$echo are already set. |
# When we are sourced in execute mode, \$file and \$echo are already set. |
3590 |
if test \"\$libtool_execute_magic\" != \"$magic\"; then |
if test \"\$libtool_execute_magic\" != \"$magic\"; then |
3617 |
# If there was a directory component, then change thisdir. |
# If there was a directory component, then change thisdir. |
3618 |
if test \"x\$destdir\" != \"x\$file\"; then |
if test \"x\$destdir\" != \"x\$file\"; then |
3619 |
case \"\$destdir\" in |
case \"\$destdir\" in |
3620 |
[\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;; |
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; |
3621 |
*) thisdir=\"\$thisdir/\$destdir\" ;; |
*) thisdir=\"\$thisdir/\$destdir\" ;; |
3622 |
esac |
esac |
3623 |
fi |
fi |
3633 |
|
|
3634 |
if test "$fast_install" = yes; then |
if test "$fast_install" = yes; then |
3635 |
echo >> $output "\ |
echo >> $output "\ |
3636 |
program=lt-'$outputname' |
program=lt-'$outputname'$exeext |
3637 |
progdir=\"\$thisdir/$objdir\" |
progdir=\"\$thisdir/$objdir\" |
3638 |
|
|
3639 |
if test ! -f \"\$progdir/\$program\" || \\ |
if test ! -f \"\$progdir/\$program\" || \\ |
3640 |
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ |
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ |
3641 |
test \"X\$file\" != \"X\$progdir/\$program\"; }; then |
test \"X\$file\" != \"X\$progdir/\$program\"; }; then |
3652 |
|
|
3653 |
# relink executable if necessary |
# relink executable if necessary |
3654 |
if test -n \"\$relink_command\"; then |
if test -n \"\$relink_command\"; then |
3655 |
if (cd \"\$thisdir\" && eval \$relink_command); then : |
if relink_command_output=\`eval \$relink_command 2>&1\`; then : |
3656 |
else |
else |
3657 |
|
$echo \"\$relink_command_output\" >&2 |
3658 |
$rm \"\$progdir/\$file\" |
$rm \"\$progdir/\$file\" |
3659 |
exit 1 |
exit 1 |
3660 |
fi |
fi |
3667 |
fi" |
fi" |
3668 |
else |
else |
3669 |
echo >> $output "\ |
echo >> $output "\ |
3670 |
program='$outputname$exeext' |
program='$outputname' |
3671 |
progdir=\"\$thisdir/$objdir\" |
progdir=\"\$thisdir/$objdir\" |
3672 |
" |
" |
3673 |
fi |
fi |
3703 |
# Run the actual program with our arguments. |
# Run the actual program with our arguments. |
3704 |
" |
" |
3705 |
case $host in |
case $host in |
3706 |
*-*-cygwin* | *-*-mingw | *-*-os2*) |
# win32 systems need to use the prog path for dll |
3707 |
# win32 systems need to use the prog path for dll |
# lookup to work |
3708 |
# lookup to work |
*-*-cygwin* | *-*-pw32*) |
3709 |
|
$echo >> $output "\ |
3710 |
|
exec \$progdir/\$program \${1+\"\$@\"} |
3711 |
|
" |
3712 |
|
;; |
3713 |
|
|
3714 |
|
# Backslashes separate directories on plain windows |
3715 |
|
*-*-mingw | *-*-os2*) |
3716 |
$echo >> $output "\ |
$echo >> $output "\ |
3717 |
exec \$progdir\\\\\$program \${1+\"\$@\"} |
exec \$progdir\\\\\$program \${1+\"\$@\"} |
3718 |
" |
" |
3719 |
;; |
;; |
3720 |
|
|
3721 |
*) |
*) |
3722 |
$echo >> $output "\ |
$echo >> $output "\ |
3723 |
# Export the path to the program. |
# Export the path to the program. |
3775 |
exit $status |
exit $status |
3776 |
fi |
fi |
3777 |
generated="$generated $gentop" |
generated="$generated $gentop" |
3778 |
|
|
3779 |
# Add in members from convenience archives. |
# Add in members from convenience archives. |
3780 |
for xlib in $addlibs; do |
for xlib in $addlibs; do |
3781 |
# Extract the objects. |
# Extract the objects. |
3782 |
case "$xlib" in |
case $xlib in |
3783 |
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
[\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
3784 |
*) xabs=`pwd`"/$xlib" ;; |
*) xabs=`pwd`"/$xlib" ;; |
3785 |
esac |
esac |
3805 |
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 |
3806 |
eval cmds=\"$old_archive_from_new_cmds\" |
eval cmds=\"$old_archive_from_new_cmds\" |
3807 |
else |
else |
3808 |
# Ensure that we have .o objects in place incase we decided |
# Ensure that we have .o objects in place in case we decided |
3809 |
# not to build a shared library, and have fallen back to building |
# not to build a shared library, and have fallen back to building |
3810 |
# static libs even though --disable-static was passed! |
# static libs even though --disable-static was passed! |
3811 |
for oldobj in $oldobjs; do |
for oldobj in $oldobjs; do |
3812 |
if test ! -f $oldobj; then |
if test ! -f $oldobj; then |
3813 |
obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"` |
xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` |
3814 |
$show "${LN_S} $obj $oldobj" |
if test "X$xdir" = "X$oldobj"; then |
3815 |
$run ${LN_S} $obj $oldobj || exit $? |
xdir="." |
3816 |
|
else |
3817 |
|
xdir="$xdir" |
3818 |
|
fi |
3819 |
|
baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` |
3820 |
|
obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` |
3821 |
|
$show "(cd $xdir && ${LN_S} $obj $baseobj)" |
3822 |
|
$run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? |
3823 |
fi |
fi |
3824 |
done |
done |
3825 |
|
|
3826 |
eval cmds=\"$old_archive_cmds\" |
eval cmds=\"$old_archive_cmds\" |
3827 |
fi |
fi |
3828 |
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
save_ifs="$IFS"; IFS='~' |
3829 |
for cmd in $cmds; do |
for cmd in $cmds; do |
3830 |
IFS="$save_ifs" |
IFS="$save_ifs" |
3831 |
$show "$cmd" |
$show "$cmd" |
3840 |
fi |
fi |
3841 |
|
|
3842 |
# Now create the libtool archive. |
# Now create the libtool archive. |
3843 |
case "$output" in |
case $output in |
3844 |
*.la) |
*.la) |
3845 |
old_library= |
old_library= |
3846 |
test "$build_old_libs" = yes && old_library="$libname.$libext" |
test "$build_old_libs" = yes && old_library="$libname.$libext" |
3847 |
$show "creating $output" |
$show "creating $output" |
3848 |
|
|
3849 |
|
# Preserve any variables that may affect compiler behavior |
3850 |
|
for var in $variables_saved_for_relink; do |
3851 |
|
if eval test -z \"\${$var+set}\"; then |
3852 |
|
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" |
3853 |
|
elif eval var_value=\$$var; test -z "$var_value"; then |
3854 |
|
relink_command="$var=; export $var; $relink_command" |
3855 |
|
else |
3856 |
|
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` |
3857 |
|
relink_command="$var=\"$var_value\"; export $var; $relink_command" |
3858 |
|
fi |
3859 |
|
done |
3860 |
# Quote the link command for shipping. |
# Quote the link command for shipping. |
3861 |
relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" |
relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args" |
3862 |
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` |
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` |
3863 |
|
|
3864 |
# Only create the output if not a dry run. |
# Only create the output if not a dry run. |
3865 |
if test -z "$run"; then |
if test -z "$run"; then |
3866 |
for installed in no yes; do |
for installed in no yes; do |
3872 |
# Replace all uninstalled libtool libraries with the installed ones |
# Replace all uninstalled libtool libraries with the installed ones |
3873 |
newdependency_libs= |
newdependency_libs= |
3874 |
for deplib in $dependency_libs; do |
for deplib in $dependency_libs; do |
3875 |
case "$deplib" in |
case $deplib in |
3876 |
*.la) |
*.la) |
3877 |
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` |
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` |
3878 |
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
3879 |
if test -z "$libdir"; then |
if test -z "$libdir"; then |
3886 |
esac |
esac |
3887 |
done |
done |
3888 |
dependency_libs="$newdependency_libs" |
dependency_libs="$newdependency_libs" |
3889 |
|
newdlfiles= |
3890 |
|
for lib in $dlfiles; do |
3891 |
|
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
3892 |
|
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` |
3893 |
|
if test -z "$libdir"; then |
3894 |
|
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
3895 |
|
exit 1 |
3896 |
|
fi |
3897 |
|
newdlfiles="$newdlfiles $libdir/$name" |
3898 |
|
done |
3899 |
|
dlfiles="$newdlfiles" |
3900 |
|
newdlprefiles= |
3901 |
|
for lib in $dlprefiles; do |
3902 |
|
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
3903 |
|
eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` |
3904 |
|
if test -z "$libdir"; then |
3905 |
|
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
3906 |
|
exit 1 |
3907 |
|
fi |
3908 |
|
newdlprefiles="$newdlprefiles $libdir/$name" |
3909 |
|
done |
3910 |
|
dlprefiles="$newdlprefiles" |
3911 |
fi |
fi |
3912 |
$rm $output |
$rm $output |
3913 |
|
# place dlname in correct position for cygwin |
3914 |
|
tdlname=$dlname |
3915 |
|
case $host,$output,$installed,$module,$dlname in |
3916 |
|
*cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; |
3917 |
|
esac |
3918 |
$echo > $output "\ |
$echo > $output "\ |
3919 |
# $outputname - a libtool library file |
# $outputname - a libtool library file |
3920 |
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
3923 |
# It is necessary for linking the library. |
# It is necessary for linking the library. |
3924 |
|
|
3925 |
# The name that we can dlopen(3). |
# The name that we can dlopen(3). |
3926 |
dlname='$dlname' |
dlname='$tdlname' |
3927 |
|
|
3928 |
# Names of this library. |
# Names of this library. |
3929 |
library_names='$library_names' |
library_names='$library_names' |
3942 |
# Is this an already installed library? |
# Is this an already installed library? |
3943 |
installed=$installed |
installed=$installed |
3944 |
|
|
3945 |
|
# Files to dlopen/dlpreopen |
3946 |
|
dlopen='$dlfiles' |
3947 |
|
dlpreopen='$dlprefiles' |
3948 |
|
|
3949 |
# Directory that this library needs to be installed in: |
# Directory that this library needs to be installed in: |
3950 |
libdir='$install_libdir'" |
libdir='$install_libdir'" |
3951 |
if test "$installed" = no; then |
if test "$installed" = no && test $need_relink = yes; then |
3952 |
$echo >> $output "\ |
$echo >> $output "\ |
3953 |
relink_command=\"$relink_command\"" |
relink_command=\"$relink_command\"" |
3954 |
fi |
fi |
3958 |
# Do a symbolic link so that the libtool archive can be found in |
# Do a symbolic link so that the libtool archive can be found in |
3959 |
# LD_LIBRARY_PATH before the program is installed. |
# LD_LIBRARY_PATH before the program is installed. |
3960 |
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" |
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" |
3961 |
$run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $? |
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? |
3962 |
;; |
;; |
3963 |
esac |
esac |
3964 |
exit 0 |
exit 0 |
3970 |
|
|
3971 |
# There may be an optional sh(1) argument at the beginning of |
# There may be an optional sh(1) argument at the beginning of |
3972 |
# install_prog (especially on Windows NT). |
# install_prog (especially on Windows NT). |
3973 |
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then |
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || |
3974 |
|
# Allow the use of GNU shtool's install command. |
3975 |
|
$echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then |
3976 |
# Aesthetically quote it. |
# Aesthetically quote it. |
3977 |
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` |
3978 |
case "$arg" in |
case $arg in |
3979 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
3980 |
arg="\"$arg\"" |
arg="\"$arg\"" |
3981 |
;; |
;; |
3991 |
# The real first argument should be the name of the installation program. |
# The real first argument should be the name of the installation program. |
3992 |
# Aesthetically quote it. |
# Aesthetically quote it. |
3993 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
3994 |
case "$arg" in |
case $arg in |
3995 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
3996 |
arg="\"$arg\"" |
arg="\"$arg\"" |
3997 |
;; |
;; |
4014 |
continue |
continue |
4015 |
fi |
fi |
4016 |
|
|
4017 |
case "$arg" in |
case $arg in |
4018 |
-d) isdir=yes ;; |
-d) isdir=yes ;; |
4019 |
-f) prev="-f" ;; |
-f) prev="-f" ;; |
4020 |
-g) prev="-g" ;; |
-g) prev="-g" ;; |
4039 |
|
|
4040 |
# Aesthetically quote the argument. |
# Aesthetically quote the argument. |
4041 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
4042 |
case "$arg" in |
case $arg in |
4043 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
4044 |
arg="\"$arg\"" |
arg="\"$arg\"" |
4045 |
;; |
;; |
4090 |
exit 1 |
exit 1 |
4091 |
fi |
fi |
4092 |
fi |
fi |
4093 |
case "$destdir" in |
case $destdir in |
4094 |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
4095 |
*) |
*) |
4096 |
for file in $files; do |
for file in $files; do |
4097 |
case "$file" in |
case $file in |
4098 |
*.lo) ;; |
*.lo) ;; |
4099 |
*) |
*) |
4100 |
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 |
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 |
4116 |
for file in $files; do |
for file in $files; do |
4117 |
|
|
4118 |
# Do each installation. |
# Do each installation. |
4119 |
case "$file" in |
case $file in |
4120 |
*.a | *.lib) |
*.$libext) |
4121 |
# Do the static libraries later. |
# Do the static libraries later. |
4122 |
staticlibs="$staticlibs $file" |
staticlibs="$staticlibs $file" |
4123 |
;; |
;; |
4135 |
old_library= |
old_library= |
4136 |
relink_command= |
relink_command= |
4137 |
# If there is no directory component, then add one. |
# If there is no directory component, then add one. |
4138 |
case "$file" in |
case $file in |
4139 |
*/* | *\\*) . $file ;; |
*/* | *\\*) . $file ;; |
4140 |
*) . ./$file ;; |
*) . ./$file ;; |
4141 |
esac |
esac |
4154 |
esac |
esac |
4155 |
fi |
fi |
4156 |
|
|
4157 |
dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/" |
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ |
4158 |
test "X$dir" = "X$file/" && dir= |
test "X$dir" = "X$file/" && dir= |
4159 |
dir="$dir$objdir" |
dir="$dir$objdir" |
4160 |
|
|
4161 |
if test "$hardcode_into_libs" = yes; then |
if test -n "$relink_command"; then |
|
if test -z "$relink_command"; then |
|
|
$echo "$modename: invalid libtool pseudo library \`$file'" 1>&2 |
|
|
exit 1 |
|
|
fi |
|
4162 |
$echo "$modename: warning: relinking \`$file'" 1>&2 |
$echo "$modename: warning: relinking \`$file'" 1>&2 |
4163 |
$show "$relink_command" |
$show "$relink_command" |
4164 |
if $run eval "$relink_command"; then : |
if $run eval "$relink_command"; then : |
4167 |
continue |
continue |
4168 |
fi |
fi |
4169 |
fi |
fi |
4170 |
|
|
4171 |
# See the names of the shared library. |
# See the names of the shared library. |
4172 |
set dummy $library_names |
set dummy $library_names |
4173 |
if test -n "$2"; then |
if test -n "$2"; then |
4176 |
shift |
shift |
4177 |
|
|
4178 |
srcname="$realname" |
srcname="$realname" |
4179 |
test "$hardcode_into_libs" = yes && srcname="$realname"T |
test -n "$relink_command" && srcname="$realname"T |
4180 |
|
|
4181 |
# Install the shared library and build the symlinks. |
# Install the shared library and build the symlinks. |
4182 |
$show "$install_prog $dir/$srcname $destdir/$realname" |
$show "$install_prog $dir/$srcname $destdir/$realname" |
4200 |
# Do each command in the postinstall commands. |
# Do each command in the postinstall commands. |
4201 |
lib="$destdir/$realname" |
lib="$destdir/$realname" |
4202 |
eval cmds=\"$postinstall_cmds\" |
eval cmds=\"$postinstall_cmds\" |
4203 |
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
save_ifs="$IFS"; IFS='~' |
4204 |
for cmd in $cmds; do |
for cmd in $cmds; do |
4205 |
IFS="$save_ifs" |
IFS="$save_ifs" |
4206 |
$show "$cmd" |
$show "$cmd" |
4231 |
fi |
fi |
4232 |
|
|
4233 |
# Deduce the name of the destination old-style object file. |
# Deduce the name of the destination old-style object file. |
4234 |
case "$destfile" in |
case $destfile in |
4235 |
*.lo) |
*.lo) |
4236 |
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` |
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` |
4237 |
;; |
;; |
4238 |
*.o | *.obj) |
*.$objext) |
4239 |
staticdest="$destfile" |
staticdest="$destfile" |
4240 |
destfile= |
destfile= |
4241 |
;; |
;; |
4274 |
|
|
4275 |
# Do a test to see if this is really a libtool program. |
# Do a test to see if this is really a libtool program. |
4276 |
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
4277 |
link_against_libtool_libs= |
notinst_deplibs= |
4278 |
relink_command= |
relink_command= |
4279 |
|
|
4280 |
# If there is no directory component, then add one. |
# If there is no directory component, then add one. |
4281 |
case "$file" in |
case $file in |
4282 |
*/* | *\\*) . $file ;; |
*/* | *\\*) . $file ;; |
4283 |
*) . ./$file ;; |
*) . ./$file ;; |
4284 |
esac |
esac |
4285 |
|
|
4286 |
# Check the variables that should have been set. |
# Check the variables that should have been set. |
4287 |
if test -z "$link_against_libtool_libs"; then |
if test -z "$notinst_deplibs"; then |
4288 |
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 |
$echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 |
4289 |
exit 1 |
exit 1 |
4290 |
fi |
fi |
4291 |
|
|
4292 |
finalize=yes |
finalize=yes |
4293 |
for lib in $link_against_libtool_libs; do |
for lib in $notinst_deplibs; do |
4294 |
# Check to see that each library is installed. |
# Check to see that each library is installed. |
4295 |
libdir= |
libdir= |
4296 |
if test -f "$lib"; then |
if test -f "$lib"; then |
4297 |
# If there is no directory component, then add one. |
# If there is no directory component, then add one. |
4298 |
case "$lib" in |
case $lib in |
4299 |
*/* | *\\*) . $lib ;; |
*/* | *\\*) . $lib ;; |
4300 |
*) . ./$lib ;; |
*) . ./$lib ;; |
4301 |
esac |
esac |
4302 |
fi |
fi |
4303 |
libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`" |
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test |
4304 |
if test -n "$libdir" && test ! -f "$libfile"; then |
if test -n "$libdir" && test ! -f "$libfile"; then |
4305 |
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 |
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 |
4306 |
finalize=no |
finalize=no |
4309 |
|
|
4310 |
relink_command= |
relink_command= |
4311 |
# If there is no directory component, then add one. |
# If there is no directory component, then add one. |
4312 |
case "$file" in |
case $file in |
4313 |
*/* | *\\*) . $file ;; |
*/* | *\\*) . $file ;; |
4314 |
*) . ./$file ;; |
*) . ./$file ;; |
4315 |
esac |
esac |
4325 |
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 |
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 |
4326 |
continue |
continue |
4327 |
fi |
fi |
4328 |
|
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
4329 |
outputname="$tmpdir/$file" |
outputname="$tmpdir/$file" |
4330 |
# Replace the output file specification. |
# Replace the output file specification. |
4331 |
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` |
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` |
4347 |
fi |
fi |
4348 |
fi |
fi |
4349 |
|
|
4350 |
|
# remove .exe since cygwin /usr/bin/install will append another |
4351 |
|
# one anyways |
4352 |
|
case $install_prog,$host in |
4353 |
|
/usr/bin/install*,*cygwin*) |
4354 |
|
case $file:$destfile in |
4355 |
|
*.exe:*.exe) |
4356 |
|
# this is ok |
4357 |
|
;; |
4358 |
|
*.exe:*) |
4359 |
|
destfile=$destfile.exe |
4360 |
|
;; |
4361 |
|
*:*.exe) |
4362 |
|
destfile=`echo $destfile | sed -e 's,.exe$,,'` |
4363 |
|
;; |
4364 |
|
esac |
4365 |
|
;; |
4366 |
|
esac |
4367 |
$show "$install_prog$stripme $file $destfile" |
$show "$install_prog$stripme $file $destfile" |
4368 |
$run eval "$install_prog\$stripme \$file \$destfile" || exit $? |
$run eval "$install_prog\$stripme \$file \$destfile" || exit $? |
4369 |
test -n "$outputname" && ${rm}r "$tmpdir" |
test -n "$outputname" && ${rm}r "$tmpdir" |
4384 |
$show "$old_striplib $oldlib" |
$show "$old_striplib $oldlib" |
4385 |
$run eval "$old_striplib $oldlib" || exit $? |
$run eval "$old_striplib $oldlib" || exit $? |
4386 |
fi |
fi |
4387 |
|
|
4388 |
# Do each command in the postinstall commands. |
# Do each command in the postinstall commands. |
4389 |
eval cmds=\"$old_postinstall_cmds\" |
eval cmds=\"$old_postinstall_cmds\" |
4390 |
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
save_ifs="$IFS"; IFS='~' |
4391 |
for cmd in $cmds; do |
for cmd in $cmds; do |
4392 |
IFS="$save_ifs" |
IFS="$save_ifs" |
4393 |
$show "$cmd" |
$show "$cmd" |
4403 |
if test -n "$current_libdirs"; then |
if test -n "$current_libdirs"; then |
4404 |
# Maybe just do a dry run. |
# Maybe just do a dry run. |
4405 |
test -n "$run" && current_libdirs=" -n$current_libdirs" |
test -n "$run" && current_libdirs=" -n$current_libdirs" |
4406 |
exec $SHELL $0 --finish$current_libdirs |
exec_cmd='$SHELL $0 --finish$current_libdirs' |
4407 |
exit 1 |
else |
4408 |
|
exit 0 |
4409 |
fi |
fi |
|
|
|
|
exit 0 |
|
4410 |
;; |
;; |
4411 |
|
|
4412 |
# libtool finish mode |
# libtool finish mode |
4425 |
if test -n "$finish_cmds"; then |
if test -n "$finish_cmds"; then |
4426 |
# Do each command in the finish commands. |
# Do each command in the finish commands. |
4427 |
eval cmds=\"$finish_cmds\" |
eval cmds=\"$finish_cmds\" |
4428 |
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
save_ifs="$IFS"; IFS='~' |
4429 |
for cmd in $cmds; do |
for cmd in $cmds; do |
4430 |
IFS="$save_ifs" |
IFS="$save_ifs" |
4431 |
$show "$cmd" |
$show "$cmd" |
4444 |
fi |
fi |
4445 |
|
|
4446 |
# Exit here if they wanted silent mode. |
# Exit here if they wanted silent mode. |
4447 |
test "$show" = : && exit 0 |
test "$show" = ":" && exit 0 |
4448 |
|
|
4449 |
echo "----------------------------------------------------------------------" |
echo "----------------------------------------------------------------------" |
4450 |
echo "Libraries have been installed in:" |
echo "Libraries have been installed in:" |
4454 |
echo |
echo |
4455 |
echo "If you ever happen to want to link against installed libraries" |
echo "If you ever happen to want to link against installed libraries" |
4456 |
echo "in a given directory, LIBDIR, you must either use libtool, and" |
echo "in a given directory, LIBDIR, you must either use libtool, and" |
4457 |
echo "specify the full pathname of the library, or use \`-LLIBDIR'" |
echo "specify the full pathname of the library, or use the \`-LLIBDIR'" |
4458 |
echo "flag during linking and do at least one of the following:" |
echo "flag during linking and do at least one of the following:" |
4459 |
if test -n "$shlibpath_var"; then |
if test -n "$shlibpath_var"; then |
4460 |
echo " - add LIBDIR to the \`$shlibpath_var' environment variable" |
echo " - add LIBDIR to the \`$shlibpath_var' environment variable" |
4483 |
exit 0 |
exit 0 |
4484 |
;; |
;; |
4485 |
|
|
|
# libtool clean mode |
|
|
clean) |
|
|
modename="$modename: clean" |
|
|
rm="$nonopt" |
|
|
files= |
|
|
|
|
|
# This variable tells wrapper scripts just to set variables rather |
|
|
# than running their programs. |
|
|
libtool_install_magic="$magic" |
|
|
|
|
|
for arg |
|
|
do |
|
|
case "$arg" in |
|
|
-*) rm="$rm $arg" ;; |
|
|
*) files="$files $arg" ;; |
|
|
esac |
|
|
done |
|
|
|
|
|
if test -z "$rm"; then |
|
|
$echo "$modename: you must specify an RM program" 1>&2 |
|
|
$echo "$help" 1>&2 |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
for file in $files; do |
|
|
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` |
|
|
if test "X$dir" = "X$file"; then |
|
|
dir=. |
|
|
objdir="$objdir" |
|
|
else |
|
|
objdir="$dir/$objdir" |
|
|
fi |
|
|
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
|
|
|
|
|
rmfiles="$file" |
|
|
|
|
|
case "$file" in |
|
|
*.la) |
|
|
# Possibly a libtool archive, so verify it. |
|
|
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
|
|
. ./$file |
|
|
|
|
|
# Delete the libtool libraries and symlinks. |
|
|
for n in $library_names; do |
|
|
rmfiles="$rmfiles $objdir/$n" |
|
|
done |
|
|
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" |
|
|
rmfiles="$rmfiles $objdir/$name $objdir/${name}i" |
|
|
fi |
|
|
;; |
|
|
|
|
|
*.lo) |
|
|
if test "$build_old_libs" = yes; then |
|
|
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` |
|
|
rmfiles="$rmfiles $dir/$oldobj" |
|
|
fi |
|
|
;; |
|
|
|
|
|
*) |
|
|
# Do a test to see if this is a libtool program. |
|
|
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
|
|
relink_command= |
|
|
. $dir/$file |
|
|
|
|
|
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" |
|
|
if test "$fast_install" = yes && test -n "$relink_command"; then |
|
|
rmfiles="$rmfiles $objdir/lt-$name" |
|
|
fi |
|
|
fi |
|
|
;; |
|
|
esac |
|
|
$show "$rm $rmfiles" |
|
|
$run $rm $rmfiles |
|
|
done |
|
|
exit 0 |
|
|
;; |
|
|
|
|
4486 |
# libtool execute mode |
# libtool execute mode |
4487 |
execute) |
execute) |
4488 |
modename="$modename: execute" |
modename="$modename: execute" |
4504 |
fi |
fi |
4505 |
|
|
4506 |
dir= |
dir= |
4507 |
case "$file" in |
case $file in |
4508 |
*.la) |
*.la) |
4509 |
# Check to see that this really is a libtool archive. |
# Check to see that this really is a libtool archive. |
4510 |
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
4519 |
library_names= |
library_names= |
4520 |
|
|
4521 |
# If there is no directory component, then add one. |
# If there is no directory component, then add one. |
4522 |
case "$file" in |
case $file in |
4523 |
*/* | *\\*) . $file ;; |
*/* | *\\*) . $file ;; |
4524 |
*) . ./$file ;; |
*) . ./$file ;; |
4525 |
esac |
esac |
4574 |
args= |
args= |
4575 |
for file |
for file |
4576 |
do |
do |
4577 |
case "$file" in |
case $file in |
4578 |
-*) ;; |
-*) ;; |
4579 |
*) |
*) |
4580 |
# Do a test to see if this is really a libtool program. |
# Do a test to see if this is really a libtool program. |
4581 |
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
4582 |
# If there is no directory component, then add one. |
# If there is no directory component, then add one. |
4583 |
case "$file" in |
case $file in |
4584 |
*/* | *\\*) . $file ;; |
*/* | *\\*) . $file ;; |
4585 |
*) . ./$file ;; |
*) . ./$file ;; |
4586 |
esac |
esac |
4596 |
done |
done |
4597 |
|
|
4598 |
if test -z "$run"; then |
if test -z "$run"; then |
4599 |
# Export the shlibpath_var. |
if test -n "$shlibpath_var"; then |
4600 |
eval "export $shlibpath_var" |
# Export the shlibpath_var. |
4601 |
|
eval "export $shlibpath_var" |
4602 |
|
fi |
4603 |
|
|
4604 |
# Restore saved enviroment variables |
# Restore saved enviroment variables |
4605 |
if test "${save_LC_ALL+set}" = set; then |
if test "${save_LC_ALL+set}" = set; then |
4609 |
LANG="$save_LANG"; export LANG |
LANG="$save_LANG"; export LANG |
4610 |
fi |
fi |
4611 |
|
|
4612 |
# Now actually exec the command. |
# Now prepare to actually exec the command. |
4613 |
eval "exec \$cmd$args" |
exec_cmd='"$cmd"$args' |
|
|
|
|
$echo "$modename: cannot exec \$cmd$args" |
|
|
exit 1 |
|
4614 |
else |
else |
4615 |
# Display what would be done. |
# Display what would be done. |
4616 |
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" |
if test -n "$shlibpath_var"; then |
4617 |
$echo "export $shlibpath_var" |
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" |
4618 |
|
$echo "export $shlibpath_var" |
4619 |
|
fi |
4620 |
$echo "$cmd$args" |
$echo "$cmd$args" |
4621 |
exit 0 |
exit 0 |
4622 |
fi |
fi |
4623 |
;; |
;; |
4624 |
|
|
4625 |
# libtool uninstall mode |
# libtool clean and uninstall mode |
4626 |
uninstall) |
clean | uninstall) |
4627 |
modename="$modename: uninstall" |
modename="$modename: $mode" |
4628 |
rm="$nonopt" |
rm="$nonopt" |
4629 |
files= |
files= |
4630 |
|
rmforce= |
4631 |
|
exit_status=0 |
4632 |
|
|
4633 |
|
# This variable tells wrapper scripts just to set variables rather |
4634 |
|
# than running their programs. |
4635 |
|
libtool_install_magic="$magic" |
4636 |
|
|
4637 |
for arg |
for arg |
4638 |
do |
do |
4639 |
case "$arg" in |
case $arg in |
4640 |
|
-f) rm="$rm $arg"; rmforce=yes ;; |
4641 |
-*) rm="$rm $arg" ;; |
-*) rm="$rm $arg" ;; |
4642 |
*) files="$files $arg" ;; |
*) files="$files $arg" ;; |
4643 |
esac |
esac |
4649 |
exit 1 |
exit 1 |
4650 |
fi |
fi |
4651 |
|
|
4652 |
|
rmdirs= |
4653 |
|
|
4654 |
for file in $files; do |
for file in $files; do |
4655 |
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` |
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` |
4656 |
test "X$dir" = "X$file" && dir=. |
if test "X$dir" = "X$file"; then |
4657 |
|
dir=. |
4658 |
|
objdir="$objdir" |
4659 |
|
else |
4660 |
|
objdir="$dir/$objdir" |
4661 |
|
fi |
4662 |
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
4663 |
|
test $mode = uninstall && objdir="$dir" |
4664 |
|
|
4665 |
|
# Remember objdir for removal later, being careful to avoid duplicates |
4666 |
|
if test $mode = clean; then |
4667 |
|
case " $rmdirs " in |
4668 |
|
*" $objdir "*) ;; |
4669 |
|
*) rmdirs="$rmdirs $objdir" ;; |
4670 |
|
esac |
4671 |
|
fi |
4672 |
|
|
4673 |
|
# Don't error if the file doesn't exist and rm -f was used. |
4674 |
|
if (test -L "$file") >/dev/null 2>&1 \ |
4675 |
|
|| (test -h "$file") >/dev/null 2>&1 \ |
4676 |
|
|| test -f "$file"; then |
4677 |
|
: |
4678 |
|
elif test -d "$file"; then |
4679 |
|
exit_status=1 |
4680 |
|
continue |
4681 |
|
elif test "$rmforce" = yes; then |
4682 |
|
continue |
4683 |
|
fi |
4684 |
|
|
4685 |
rmfiles="$file" |
rmfiles="$file" |
4686 |
|
|
4687 |
case "$name" in |
case $name in |
4688 |
*.la) |
*.la) |
4689 |
# Possibly a libtool archive, so verify it. |
# Possibly a libtool archive, so verify it. |
4690 |
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
4692 |
|
|
4693 |
# Delete the libtool libraries and symlinks. |
# Delete the libtool libraries and symlinks. |
4694 |
for n in $library_names; do |
for n in $library_names; do |
4695 |
rmfiles="$rmfiles $dir/$n" |
rmfiles="$rmfiles $objdir/$n" |
4696 |
done |
done |
4697 |
test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" |
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" |
4698 |
|
test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" |
|
$show "$rm $rmfiles" |
|
|
$run $rm $rmfiles |
|
4699 |
|
|
4700 |
if test -n "$library_names"; then |
if test $mode = uninstall; then |
4701 |
# Do each command in the postuninstall commands. |
if test -n "$library_names"; then |
4702 |
eval cmds=\"$postuninstall_cmds\" |
# Do each command in the postuninstall commands. |
4703 |
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
eval cmds=\"$postuninstall_cmds\" |
4704 |
for cmd in $cmds; do |
save_ifs="$IFS"; IFS='~' |
4705 |
|
for cmd in $cmds; do |
4706 |
|
IFS="$save_ifs" |
4707 |
|
$show "$cmd" |
4708 |
|
$run eval "$cmd" |
4709 |
|
if test $? != 0 && test "$rmforce" != yes; then |
4710 |
|
exit_status=1 |
4711 |
|
fi |
4712 |
|
done |
4713 |
IFS="$save_ifs" |
IFS="$save_ifs" |
4714 |
$show "$cmd" |
fi |
|
$run eval "$cmd" |
|
|
done |
|
|
IFS="$save_ifs" |
|
|
fi |
|
4715 |
|
|
4716 |
if test -n "$old_library"; then |
if test -n "$old_library"; then |
4717 |
# Do each command in the old_postuninstall commands. |
# Do each command in the old_postuninstall commands. |
4718 |
eval cmds=\"$old_postuninstall_cmds\" |
eval cmds=\"$old_postuninstall_cmds\" |
4719 |
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' |
save_ifs="$IFS"; IFS='~' |
4720 |
for cmd in $cmds; do |
for cmd in $cmds; do |
4721 |
|
IFS="$save_ifs" |
4722 |
|
$show "$cmd" |
4723 |
|
$run eval "$cmd" |
4724 |
|
if test $? != 0 && test "$rmforce" != yes; then |
4725 |
|
exit_status=1 |
4726 |
|
fi |
4727 |
|
done |
4728 |
IFS="$save_ifs" |
IFS="$save_ifs" |
4729 |
$show "$cmd" |
fi |
4730 |
$run eval "$cmd" |
# FIXME: should reinstall the best remaining shared library. |
|
done |
|
|
IFS="$save_ifs" |
|
4731 |
fi |
fi |
|
|
|
|
# FIXME: should reinstall the best remaining shared library. |
|
4732 |
fi |
fi |
4733 |
;; |
;; |
4734 |
|
|
4737 |
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` |
oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` |
4738 |
rmfiles="$rmfiles $dir/$oldobj" |
rmfiles="$rmfiles $dir/$oldobj" |
4739 |
fi |
fi |
|
$show "$rm $rmfiles" |
|
|
$run $rm $rmfiles |
|
4740 |
;; |
;; |
4741 |
|
|
4742 |
*) |
*) |
4743 |
$show "$rm $rmfiles" |
# Do a test to see if this is a libtool program. |
4744 |
$run $rm $rmfiles |
if test $mode = clean && |
4745 |
|
(sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
4746 |
|
relink_command= |
4747 |
|
. $dir/$file |
4748 |
|
|
4749 |
|
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" |
4750 |
|
if test "$fast_install" = yes && test -n "$relink_command"; then |
4751 |
|
rmfiles="$rmfiles $objdir/lt-$name" |
4752 |
|
fi |
4753 |
|
fi |
4754 |
;; |
;; |
4755 |
esac |
esac |
4756 |
|
$show "$rm $rmfiles" |
4757 |
|
$run $rm $rmfiles || exit_status=1 |
4758 |
done |
done |
4759 |
exit 0 |
|
4760 |
|
# Try to remove the ${objdir}s in the directories where we deleted files |
4761 |
|
for dir in $rmdirs; do |
4762 |
|
if test -d "$dir"; then |
4763 |
|
$show "rmdir $dir" |
4764 |
|
$run rmdir $dir >/dev/null 2>&1 |
4765 |
|
fi |
4766 |
|
done |
4767 |
|
|
4768 |
|
exit $exit_status |
4769 |
;; |
;; |
4770 |
|
|
4771 |
"") |
"") |
4775 |
;; |
;; |
4776 |
esac |
esac |
4777 |
|
|
4778 |
$echo "$modename: invalid operation mode \`$mode'" 1>&2 |
if test -z "$exec_cmd"; then |
4779 |
$echo "$generic_help" 1>&2 |
$echo "$modename: invalid operation mode \`$mode'" 1>&2 |
4780 |
exit 1 |
$echo "$generic_help" 1>&2 |
4781 |
|
exit 1 |
4782 |
|
fi |
4783 |
fi # test -z "$show_help" |
fi # test -z "$show_help" |
4784 |
|
|
4785 |
|
if test -n "$exec_cmd"; then |
4786 |
|
eval exec $exec_cmd |
4787 |
|
exit 1 |
4788 |
|
fi |
4789 |
|
|
4790 |
# We need to display help for each of the modes. |
# We need to display help for each of the modes. |
4791 |
case "$mode" in |
case $mode in |
4792 |
"") $echo \ |
"") $echo \ |
4793 |
"Usage: $modename [OPTION]... [MODE-ARG]... |
"Usage: $modename [OPTION]... [MODE-ARG]... |
4794 |
|
|
4843 |
This mode accepts the following additional options: |
This mode accepts the following additional options: |
4844 |
|
|
4845 |
-o OUTPUT-FILE set the output file name to OUTPUT-FILE |
-o OUTPUT-FILE set the output file name to OUTPUT-FILE |
4846 |
|
-prefer-pic try to building PIC objects only |
4847 |
|
-prefer-non-pic try to building non-PIC objects only |
4848 |
-static always build a \`.o' file suitable for static linking |
-static always build a \`.o' file suitable for static linking |
4849 |
|
|
4850 |
COMPILE-COMMAND is a command to be used in creating a \`standard' object file |
COMPILE-COMMAND is a command to be used in creating a \`standard' object file |
4924 |
-LLIBDIR search LIBDIR for required installed libraries |
-LLIBDIR search LIBDIR for required installed libraries |
4925 |
-lNAME OUTPUT-FILE requires the installed library libNAME |
-lNAME OUTPUT-FILE requires the installed library libNAME |
4926 |
-module build a library that can dlopened |
-module build a library that can dlopened |
4927 |
|
-no-fast-install disable the fast-install mode |
4928 |
|
-no-install link a not-installable executable |
4929 |
-no-undefined declare that a library does not refer to external symbols |
-no-undefined declare that a library does not refer to external symbols |
4930 |
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects |
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects |
4931 |
-release RELEASE specify package release information |
-release RELEASE specify package release information |