1 |
#! /bin/sh |
2 |
|
3 |
# libtoolT - Provide generalized library-building support services. |
4 |
# Generated automatically by (GNU ircd-hybrid 7.2.4) |
5 |
# NOTE: Changes made to this file will be lost: look at ltmain.sh. |
6 |
# |
7 |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 |
8 |
# Free Software Foundation, Inc. |
9 |
# |
10 |
# This file is part of GNU Libtool: |
11 |
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
12 |
# |
13 |
# This program is free software; you can redistribute it and/or modify |
14 |
# it under the terms of the GNU General Public License as published by |
15 |
# the Free Software Foundation; either version 2 of the License, or |
16 |
# (at your option) any later version. |
17 |
# |
18 |
# This program is distributed in the hope that it will be useful, but |
19 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
20 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
21 |
# General Public License for more details. |
22 |
# |
23 |
# You should have received a copy of the GNU General Public License |
24 |
# along with this program; if not, write to the Free Software |
25 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
26 |
# |
27 |
# As a special exception to the GNU General Public License, if you |
28 |
# distribute this file as part of a program that contains a |
29 |
# configuration script generated by Autoconf, you may include it under |
30 |
# the same distribution terms that you use for the rest of that program. |
31 |
|
32 |
# A sed program that does not truncate output. |
33 |
SED="/bin/sed" |
34 |
|
35 |
# Sed that helps us avoid accidentally triggering echo(1) options like -n. |
36 |
Xsed="/bin/sed -e 1s/^X//" |
37 |
|
38 |
# The HP-UX ksh and POSIX shell print the target directory to stdout |
39 |
# if CDPATH is set. |
40 |
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH |
41 |
|
42 |
# The names of the tagged configurations supported by this script. |
43 |
available_tags=" CXX" |
44 |
|
45 |
# ### BEGIN LIBTOOL CONFIG |
46 |
|
47 |
# Libtool was configured on host hell: |
48 |
|
49 |
# Shell to use when invoking shell scripts. |
50 |
SHELL="/bin/sh" |
51 |
|
52 |
# Whether or not to build shared libraries. |
53 |
build_libtool_libs=yes |
54 |
|
55 |
# Whether or not to build static libraries. |
56 |
build_old_libs=no |
57 |
|
58 |
# Whether or not to add -lc for building shared libraries. |
59 |
build_libtool_need_lc=no |
60 |
|
61 |
# Whether or not to disallow shared libs when runtime libs are static |
62 |
allow_libtool_libs_with_static_runtimes=no |
63 |
|
64 |
# Whether or not to optimize for fast installation. |
65 |
fast_install=yes |
66 |
|
67 |
# The host system. |
68 |
host_alias= |
69 |
host=i686-pc-linux-gnu |
70 |
host_os=linux-gnu |
71 |
|
72 |
# The build system. |
73 |
build_alias= |
74 |
build=i686-pc-linux-gnu |
75 |
build_os=linux-gnu |
76 |
|
77 |
# An echo program that does not interpret backslashes. |
78 |
echo="echo" |
79 |
|
80 |
# The archiver. |
81 |
AR="ar" |
82 |
AR_FLAGS="cru" |
83 |
|
84 |
# A C compiler. |
85 |
LTCC="gcc" |
86 |
|
87 |
# LTCC compiler flags. |
88 |
LTCFLAGS="-g -O2" |
89 |
|
90 |
# A language-specific compiler. |
91 |
CC="gcc" |
92 |
|
93 |
# Is the compiler the GNU C compiler? |
94 |
with_gcc=yes |
95 |
|
96 |
# An ERE matcher. |
97 |
EGREP="/bin/grep -E" |
98 |
|
99 |
# The linker used to build libraries. |
100 |
LD="/usr/bin/ld" |
101 |
|
102 |
# Whether we need hard or soft links. |
103 |
LN_S="ln -s" |
104 |
|
105 |
# A BSD-compatible nm program. |
106 |
NM="/usr/bin/nm -B" |
107 |
|
108 |
# A symbol stripping program |
109 |
STRIP="strip" |
110 |
|
111 |
# Used to examine libraries when file_magic_cmd begins "file" |
112 |
MAGIC_CMD=file |
113 |
|
114 |
# Used on cygwin: DLL creation program. |
115 |
DLLTOOL="dlltool" |
116 |
|
117 |
# Used on cygwin: object dumper. |
118 |
OBJDUMP="objdump" |
119 |
|
120 |
# Used on cygwin: assembler. |
121 |
AS="as" |
122 |
|
123 |
# The name of the directory that contains temporary libtool files. |
124 |
objdir=.libs |
125 |
|
126 |
# How to create reloadable object files. |
127 |
reload_flag=" -r" |
128 |
reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" |
129 |
|
130 |
# How to pass a linker flag through the compiler. |
131 |
wl="-Wl," |
132 |
|
133 |
# Object file suffix (normally "o"). |
134 |
objext="o" |
135 |
|
136 |
# Old archive suffix (normally "a"). |
137 |
libext="a" |
138 |
|
139 |
# Shared library suffix (normally ".so"). |
140 |
shrext_cmds='.so' |
141 |
|
142 |
# Executable file suffix (normally ""). |
143 |
exeext="" |
144 |
|
145 |
# Additional compiler flags for building library objects. |
146 |
pic_flag=" -fPIC -DPIC" |
147 |
pic_mode=default |
148 |
|
149 |
# What is the maximum length of a command? |
150 |
max_cmd_len=98304 |
151 |
|
152 |
# Does compiler simultaneously support -c and -o options? |
153 |
compiler_c_o="yes" |
154 |
|
155 |
# Must we lock files when doing compilation? |
156 |
need_locks="no" |
157 |
|
158 |
# Do we need the lib prefix for modules? |
159 |
need_lib_prefix=no |
160 |
|
161 |
# Do we need a version for libraries? |
162 |
need_version=no |
163 |
|
164 |
# Whether dlopen is supported. |
165 |
dlopen_support=yes |
166 |
|
167 |
# Whether dlopen of programs is supported. |
168 |
dlopen_self=yes |
169 |
|
170 |
# Whether dlopen of statically linked programs is supported. |
171 |
dlopen_self_static=yes |
172 |
|
173 |
# Compiler flag to prevent dynamic linking. |
174 |
link_static_flag="" |
175 |
|
176 |
# Compiler flag to turn off builtin functions. |
177 |
no_builtin_flag=" -fno-builtin" |
178 |
|
179 |
# Compiler flag to allow reflexive dlopens. |
180 |
export_dynamic_flag_spec="\${wl}--export-dynamic" |
181 |
|
182 |
# Compiler flag to generate shared objects directly from archives. |
183 |
whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" |
184 |
|
185 |
# Compiler flag to generate thread-safe objects. |
186 |
thread_safe_flag_spec="" |
187 |
|
188 |
# Library versioning type. |
189 |
version_type=linux |
190 |
|
191 |
# Format of library name prefix. |
192 |
libname_spec="lib\$name" |
193 |
|
194 |
# List of archive names. First name is the real one, the rest are links. |
195 |
# The last name is the one that the linker finds with -lNAME. |
196 |
library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}" |
197 |
|
198 |
# The coded name of the library, if different from the real name. |
199 |
soname_spec="\${libname}\${release}\${shared_ext}\$major" |
200 |
|
201 |
# Commands used to build and install an old-style archive. |
202 |
RANLIB="ranlib" |
203 |
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib" |
204 |
old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib" |
205 |
old_postuninstall_cmds="" |
206 |
|
207 |
# Create an old-style archive from a shared archive. |
208 |
old_archive_from_new_cmds="" |
209 |
|
210 |
# Create a temporary old-style archive to link instead of a shared archive. |
211 |
old_archive_from_expsyms_cmds="" |
212 |
|
213 |
# Commands used to build and install a shared archive. |
214 |
archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" |
215 |
archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~ |
216 |
cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~ |
217 |
\$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~ |
218 |
\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib" |
219 |
postinstall_cmds="" |
220 |
postuninstall_cmds="" |
221 |
|
222 |
# Commands used to build a loadable module (assumed same as above if empty) |
223 |
module_cmds="" |
224 |
module_expsym_cmds="" |
225 |
|
226 |
# Commands to strip libraries. |
227 |
old_striplib="strip --strip-debug" |
228 |
striplib="strip --strip-unneeded" |
229 |
|
230 |
# Dependencies to place before the objects being linked to create a |
231 |
# shared library. |
232 |
predep_objects="" |
233 |
|
234 |
# Dependencies to place after the objects being linked to create a |
235 |
# shared library. |
236 |
postdep_objects="" |
237 |
|
238 |
# Dependencies to place before the objects being linked to create a |
239 |
# shared library. |
240 |
predeps="" |
241 |
|
242 |
# Dependencies to place after the objects being linked to create a |
243 |
# shared library. |
244 |
postdeps="" |
245 |
|
246 |
# The library search path used internally by the compiler when linking |
247 |
# a shared library. |
248 |
compiler_lib_search_path="" |
249 |
|
250 |
# Method to check whether dependent libraries are shared objects. |
251 |
deplibs_check_method="pass_all" |
252 |
|
253 |
# Command to use when deplibs_check_method == file_magic. |
254 |
file_magic_cmd="\$MAGIC_CMD" |
255 |
|
256 |
# Flag that allows shared libraries with undefined symbols to be built. |
257 |
allow_undefined_flag="" |
258 |
|
259 |
# Flag that forces no undefined symbols. |
260 |
no_undefined_flag="" |
261 |
|
262 |
# Commands used to finish a libtool library installation in a directory. |
263 |
finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" |
264 |
|
265 |
# Same as above, but a single script fragment to be evaled but not shown. |
266 |
finish_eval="" |
267 |
|
268 |
# Take the output of nm and produce a listing of raw symbols and C names. |
269 |
global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'" |
270 |
|
271 |
# Transform the output of nm in a proper C declaration |
272 |
global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" |
273 |
|
274 |
# Transform the output of nm in a C name address pair |
275 |
global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" |
276 |
|
277 |
# This is the shared library runtime path variable. |
278 |
runpath_var=LD_RUN_PATH |
279 |
|
280 |
# This is the shared library path variable. |
281 |
shlibpath_var=LD_LIBRARY_PATH |
282 |
|
283 |
# Is shlibpath searched before the hard-coded library search path? |
284 |
shlibpath_overrides_runpath=no |
285 |
|
286 |
# How to hardcode a shared library path into an executable. |
287 |
hardcode_action=immediate |
288 |
|
289 |
# Whether we should hardcode library paths into libraries. |
290 |
hardcode_into_libs=yes |
291 |
|
292 |
# Flag to hardcode $libdir into a binary during linking. |
293 |
# This must work even if $libdir does not exist. |
294 |
hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" |
295 |
|
296 |
# If ld is used when linking, flag to hardcode $libdir into |
297 |
# a binary during linking. This must work even if $libdir does |
298 |
# not exist. |
299 |
hardcode_libdir_flag_spec_ld="" |
300 |
|
301 |
# Whether we need a single -rpath flag with a separated argument. |
302 |
hardcode_libdir_separator="" |
303 |
|
304 |
# Set to yes if using DIR/libNAME during linking hardcodes DIR into the |
305 |
# resulting binary. |
306 |
hardcode_direct=no |
307 |
|
308 |
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the |
309 |
# resulting binary. |
310 |
hardcode_minus_L=no |
311 |
|
312 |
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into |
313 |
# the resulting binary. |
314 |
hardcode_shlibpath_var=unsupported |
315 |
|
316 |
# Set to yes if building a shared library automatically hardcodes DIR into the library |
317 |
# and all subsequent libraries and executables linked against it. |
318 |
hardcode_automatic=no |
319 |
|
320 |
# Variables whose values should be saved in libtool wrapper scripts and |
321 |
# restored at relink time. |
322 |
variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" |
323 |
|
324 |
# Whether libtool must link a program against all its dependency libraries. |
325 |
link_all_deplibs=unknown |
326 |
|
327 |
# Compile-time system search path for libraries |
328 |
sys_lib_search_path_spec="/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1 /usr/lib /lib" |
329 |
|
330 |
# Run-time system search path for libraries |
331 |
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib /usr/lib/qt3/lib " |
332 |
|
333 |
# Fix the shell variable $srcfile for the compiler. |
334 |
fix_srcfile_path="" |
335 |
|
336 |
# Set to yes if exported symbols are required. |
337 |
always_export_symbols=no |
338 |
|
339 |
# The commands to list exported symbols. |
340 |
export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" |
341 |
|
342 |
# The commands to extract the exported symbol list from a shared archive. |
343 |
extract_expsyms_cmds="" |
344 |
|
345 |
# Symbols that should not be listed in the preloaded symbols. |
346 |
exclude_expsyms="_GLOBAL_OFFSET_TABLE_" |
347 |
|
348 |
# Symbols that must always be exported. |
349 |
include_expsyms="" |
350 |
|
351 |
# ### END LIBTOOL CONFIG |
352 |
|
353 |
# ltmain.sh - Provide generalized library-building support services. |
354 |
# NOTE: Changing this file will not affect anything until you rerun configure. |
355 |
# |
356 |
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, |
357 |
# 2007 Free Software Foundation, Inc. |
358 |
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
359 |
# |
360 |
# This program is free software; you can redistribute it and/or modify |
361 |
# it under the terms of the GNU General Public License as published by |
362 |
# the Free Software Foundation; either version 2 of the License, or |
363 |
# (at your option) any later version. |
364 |
# |
365 |
# This program is distributed in the hope that it will be useful, but |
366 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
367 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
368 |
# General Public License for more details. |
369 |
# |
370 |
# You should have received a copy of the GNU General Public License |
371 |
# along with this program; if not, write to the Free Software |
372 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
373 |
# |
374 |
# As a special exception to the GNU General Public License, if you |
375 |
# distribute this file as part of a program that contains a |
376 |
# configuration script generated by Autoconf, you may include it under |
377 |
# the same distribution terms that you use for the rest of that program. |
378 |
|
379 |
basename="s,^.*/,,g" |
380 |
|
381 |
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh |
382 |
# is ksh but when the shell is invoked as "sh" and the current value of |
383 |
# the _XPG environment variable is not equal to 1 (one), the special |
384 |
# positional parameter $0, within a function call, is the name of the |
385 |
# function. |
386 |
progpath="$0" |
387 |
|
388 |
# The name of this program: |
389 |
progname=`echo "$progpath" | $SED $basename` |
390 |
modename="$progname" |
391 |
|
392 |
# Global variables: |
393 |
EXIT_SUCCESS=0 |
394 |
EXIT_FAILURE=1 |
395 |
|
396 |
PROGRAM=ltmain.sh |
397 |
PACKAGE=libtool |
398 |
VERSION=1.5.24 |
399 |
TIMESTAMP=" (1.1220.2.455 2007/06/24 02:13:29)" |
400 |
|
401 |
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). |
402 |
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then |
403 |
emulate sh |
404 |
NULLCMD=: |
405 |
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which |
406 |
# is contrary to our usage. Disable this feature. |
407 |
alias -g '${1+"$@"}'='"$@"' |
408 |
setopt NO_GLOB_SUBST |
409 |
else |
410 |
case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac |
411 |
fi |
412 |
BIN_SH=xpg4; export BIN_SH # for Tru64 |
413 |
DUALCASE=1; export DUALCASE # for MKS sh |
414 |
|
415 |
# Check that we have a working $echo. |
416 |
if test "X$1" = X--no-reexec; then |
417 |
# Discard the --no-reexec flag, and continue. |
418 |
shift |
419 |
elif test "X$1" = X--fallback-echo; then |
420 |
# Avoid inline document here, it may be left over |
421 |
: |
422 |
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then |
423 |
# Yippee, $echo works! |
424 |
: |
425 |
else |
426 |
# Restart under the correct shell, and then maybe $echo will work. |
427 |
exec $SHELL "$progpath" --no-reexec ${1+"$@"} |
428 |
fi |
429 |
|
430 |
if test "X$1" = X--fallback-echo; then |
431 |
# used as fallback echo |
432 |
shift |
433 |
cat <<EOF |
434 |
$* |
435 |
EOF |
436 |
exit $EXIT_SUCCESS |
437 |
fi |
438 |
|
439 |
default_mode= |
440 |
help="Try \`$progname --help' for more information." |
441 |
magic="%%%MAGIC variable%%%" |
442 |
mkdir="mkdir" |
443 |
mv="mv -f" |
444 |
rm="rm -f" |
445 |
|
446 |
# Sed substitution that helps us do robust quoting. It backslashifies |
447 |
# metacharacters that are still active within double-quoted strings. |
448 |
Xsed="${SED}"' -e 1s/^X//' |
449 |
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' |
450 |
# test EBCDIC or ASCII |
451 |
case `echo X|tr X '\101'` in |
452 |
A) # ASCII based system |
453 |
# \n is not interpreted correctly by Solaris 8 /usr/ucb/tr |
454 |
SP2NL='tr \040 \012' |
455 |
NL2SP='tr \015\012 \040\040' |
456 |
;; |
457 |
*) # EBCDIC based system |
458 |
SP2NL='tr \100 \n' |
459 |
NL2SP='tr \r\n \100\100' |
460 |
;; |
461 |
esac |
462 |
|
463 |
# NLS nuisances. |
464 |
# Only set LANG and LC_ALL to C if already set. |
465 |
# These must not be set unconditionally because not all systems understand |
466 |
# e.g. LANG=C (notably SCO). |
467 |
# We save the old values to restore during execute mode. |
468 |
for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES |
469 |
do |
470 |
eval "if test \"\${$lt_var+set}\" = set; then |
471 |
save_$lt_var=\$$lt_var |
472 |
$lt_var=C |
473 |
export $lt_var |
474 |
fi" |
475 |
done |
476 |
|
477 |
# Make sure IFS has a sensible default |
478 |
lt_nl=' |
479 |
' |
480 |
IFS=" $lt_nl" |
481 |
|
482 |
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
483 |
$echo "$modename: not configured to build any kind of library" 1>&2 |
484 |
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
485 |
exit $EXIT_FAILURE |
486 |
fi |
487 |
|
488 |
# Global variables. |
489 |
mode=$default_mode |
490 |
nonopt= |
491 |
prev= |
492 |
prevopt= |
493 |
run= |
494 |
show="$echo" |
495 |
show_help= |
496 |
execute_dlfiles= |
497 |
duplicate_deps=no |
498 |
preserve_args= |
499 |
lo2o="s/\\.lo\$/.${objext}/" |
500 |
o2lo="s/\\.${objext}\$/.lo/" |
501 |
extracted_archives= |
502 |
extracted_serial=0 |
503 |
|
504 |
##################################### |
505 |
# Shell function definitions: |
506 |
# This seems to be the best place for them |
507 |
|
508 |
# func_mktempdir [string] |
509 |
# Make a temporary directory that won't clash with other running |
510 |
# libtool processes, and avoids race conditions if possible. If |
511 |
# given, STRING is the basename for that directory. |
512 |
func_mktempdir () |
513 |
{ |
514 |
my_template="${TMPDIR-/tmp}/${1-$progname}" |
515 |
|
516 |
if test "$run" = ":"; then |
517 |
# Return a directory name, but don't create it in dry-run mode |
518 |
my_tmpdir="${my_template}-$$" |
519 |
else |
520 |
|
521 |
# If mktemp works, use that first and foremost |
522 |
my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` |
523 |
|
524 |
if test ! -d "$my_tmpdir"; then |
525 |
# Failing that, at least try and use $RANDOM to avoid a race |
526 |
my_tmpdir="${my_template}-${RANDOM-0}$$" |
527 |
|
528 |
save_mktempdir_umask=`umask` |
529 |
umask 0077 |
530 |
$mkdir "$my_tmpdir" |
531 |
umask $save_mktempdir_umask |
532 |
fi |
533 |
|
534 |
# If we're not in dry-run mode, bomb out on failure |
535 |
test -d "$my_tmpdir" || { |
536 |
$echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 |
537 |
exit $EXIT_FAILURE |
538 |
} |
539 |
fi |
540 |
|
541 |
$echo "X$my_tmpdir" | $Xsed |
542 |
} |
543 |
|
544 |
|
545 |
# func_win32_libid arg |
546 |
# return the library type of file 'arg' |
547 |
# |
548 |
# Need a lot of goo to handle *both* DLLs and import libs |
549 |
# Has to be a shell function in order to 'eat' the argument |
550 |
# that is supplied when $file_magic_command is called. |
551 |
func_win32_libid () |
552 |
{ |
553 |
win32_libid_type="unknown" |
554 |
win32_fileres=`file -L $1 2>/dev/null` |
555 |
case $win32_fileres in |
556 |
*ar\ archive\ import\ library*) # definitely import |
557 |
win32_libid_type="x86 archive import" |
558 |
;; |
559 |
*ar\ archive*) # could be an import, or static |
560 |
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ |
561 |
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then |
562 |
win32_nmres=`eval $NM -f posix -A $1 | \ |
563 |
$SED -n -e '1,100{ |
564 |
/ I /{ |
565 |
s,.*,import, |
566 |
p |
567 |
q |
568 |
} |
569 |
}'` |
570 |
case $win32_nmres in |
571 |
import*) win32_libid_type="x86 archive import";; |
572 |
*) win32_libid_type="x86 archive static";; |
573 |
esac |
574 |
fi |
575 |
;; |
576 |
*DLL*) |
577 |
win32_libid_type="x86 DLL" |
578 |
;; |
579 |
*executable*) # but shell scripts are "executable" too... |
580 |
case $win32_fileres in |
581 |
*MS\ Windows\ PE\ Intel*) |
582 |
win32_libid_type="x86 DLL" |
583 |
;; |
584 |
esac |
585 |
;; |
586 |
esac |
587 |
$echo $win32_libid_type |
588 |
} |
589 |
|
590 |
|
591 |
# func_infer_tag arg |
592 |
# Infer tagged configuration to use if any are available and |
593 |
# if one wasn't chosen via the "--tag" command line option. |
594 |
# Only attempt this if the compiler in the base compile |
595 |
# command doesn't match the default compiler. |
596 |
# arg is usually of the form 'gcc ...' |
597 |
func_infer_tag () |
598 |
{ |
599 |
if test -n "$available_tags" && test -z "$tagname"; then |
600 |
CC_quoted= |
601 |
for arg in $CC; do |
602 |
case $arg in |
603 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
604 |
arg="\"$arg\"" |
605 |
;; |
606 |
esac |
607 |
CC_quoted="$CC_quoted $arg" |
608 |
done |
609 |
case $@ in |
610 |
# Blanks in the command may have been stripped by the calling shell, |
611 |
# but not from the CC environment variable when configure was run. |
612 |
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; |
613 |
# Blanks at the start of $base_compile will cause this to fail |
614 |
# if we don't check for them as well. |
615 |
*) |
616 |
for z in $available_tags; do |
617 |
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then |
618 |
# Evaluate the configuration. |
619 |
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" |
620 |
CC_quoted= |
621 |
for arg in $CC; do |
622 |
# Double-quote args containing other shell metacharacters. |
623 |
case $arg in |
624 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
625 |
arg="\"$arg\"" |
626 |
;; |
627 |
esac |
628 |
CC_quoted="$CC_quoted $arg" |
629 |
done |
630 |
case "$@ " in |
631 |
" $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) |
632 |
# The compiler in the base compile command matches |
633 |
# the one in the tagged configuration. |
634 |
# Assume this is the tagged configuration we want. |
635 |
tagname=$z |
636 |
break |
637 |
;; |
638 |
esac |
639 |
fi |
640 |
done |
641 |
# If $tagname still isn't set, then no tagged configuration |
642 |
# was found and let the user know that the "--tag" command |
643 |
# line option must be used. |
644 |
if test -z "$tagname"; then |
645 |
$echo "$modename: unable to infer tagged configuration" |
646 |
$echo "$modename: specify a tag with \`--tag'" 1>&2 |
647 |
exit $EXIT_FAILURE |
648 |
# else |
649 |
# $echo "$modename: using $tagname tagged configuration" |
650 |
fi |
651 |
;; |
652 |
esac |
653 |
fi |
654 |
} |
655 |
|
656 |
|
657 |
# func_extract_an_archive dir oldlib |
658 |
func_extract_an_archive () |
659 |
{ |
660 |
f_ex_an_ar_dir="$1"; shift |
661 |
f_ex_an_ar_oldlib="$1" |
662 |
|
663 |
$show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" |
664 |
$run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? |
665 |
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then |
666 |
: |
667 |
else |
668 |
$echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 |
669 |
exit $EXIT_FAILURE |
670 |
fi |
671 |
} |
672 |
|
673 |
# func_extract_archives gentop oldlib ... |
674 |
func_extract_archives () |
675 |
{ |
676 |
my_gentop="$1"; shift |
677 |
my_oldlibs=${1+"$@"} |
678 |
my_oldobjs="" |
679 |
my_xlib="" |
680 |
my_xabs="" |
681 |
my_xdir="" |
682 |
my_status="" |
683 |
|
684 |
$show "${rm}r $my_gentop" |
685 |
$run ${rm}r "$my_gentop" |
686 |
$show "$mkdir $my_gentop" |
687 |
$run $mkdir "$my_gentop" |
688 |
my_status=$? |
689 |
if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then |
690 |
exit $my_status |
691 |
fi |
692 |
|
693 |
for my_xlib in $my_oldlibs; do |
694 |
# Extract the objects. |
695 |
case $my_xlib in |
696 |
[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; |
697 |
*) my_xabs=`pwd`"/$my_xlib" ;; |
698 |
esac |
699 |
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` |
700 |
my_xlib_u=$my_xlib |
701 |
while :; do |
702 |
case " $extracted_archives " in |
703 |
*" $my_xlib_u "*) |
704 |
extracted_serial=`expr $extracted_serial + 1` |
705 |
my_xlib_u=lt$extracted_serial-$my_xlib ;; |
706 |
*) break ;; |
707 |
esac |
708 |
done |
709 |
extracted_archives="$extracted_archives $my_xlib_u" |
710 |
my_xdir="$my_gentop/$my_xlib_u" |
711 |
|
712 |
$show "${rm}r $my_xdir" |
713 |
$run ${rm}r "$my_xdir" |
714 |
$show "$mkdir $my_xdir" |
715 |
$run $mkdir "$my_xdir" |
716 |
exit_status=$? |
717 |
if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then |
718 |
exit $exit_status |
719 |
fi |
720 |
case $host in |
721 |
*-darwin*) |
722 |
$show "Extracting $my_xabs" |
723 |
# Do not bother doing anything if just a dry run |
724 |
if test -z "$run"; then |
725 |
darwin_orig_dir=`pwd` |
726 |
cd $my_xdir || exit $? |
727 |
darwin_archive=$my_xabs |
728 |
darwin_curdir=`pwd` |
729 |
darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` |
730 |
darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` |
731 |
if test -n "$darwin_arches"; then |
732 |
darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` |
733 |
darwin_arch= |
734 |
$show "$darwin_base_archive has multiple architectures $darwin_arches" |
735 |
for darwin_arch in $darwin_arches ; do |
736 |
mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" |
737 |
lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" |
738 |
cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" |
739 |
func_extract_an_archive "`pwd`" "${darwin_base_archive}" |
740 |
cd "$darwin_curdir" |
741 |
$rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" |
742 |
done # $darwin_arches |
743 |
## Okay now we have a bunch of thin objects, gotta fatten them up :) |
744 |
darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` |
745 |
darwin_file= |
746 |
darwin_files= |
747 |
for darwin_file in $darwin_filelist; do |
748 |
darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` |
749 |
lipo -create -output "$darwin_file" $darwin_files |
750 |
done # $darwin_filelist |
751 |
${rm}r unfat-$$ |
752 |
cd "$darwin_orig_dir" |
753 |
else |
754 |
cd "$darwin_orig_dir" |
755 |
func_extract_an_archive "$my_xdir" "$my_xabs" |
756 |
fi # $darwin_arches |
757 |
fi # $run |
758 |
;; |
759 |
*) |
760 |
func_extract_an_archive "$my_xdir" "$my_xabs" |
761 |
;; |
762 |
esac |
763 |
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` |
764 |
done |
765 |
func_extract_archives_result="$my_oldobjs" |
766 |
} |
767 |
# End of Shell function definitions |
768 |
##################################### |
769 |
|
770 |
# Darwin sucks |
771 |
eval std_shrext=\"$shrext_cmds\" |
772 |
|
773 |
disable_libs=no |
774 |
|
775 |
# Parse our command line options once, thoroughly. |
776 |
while test "$#" -gt 0 |
777 |
do |
778 |
arg="$1" |
779 |
shift |
780 |
|
781 |
case $arg in |
782 |
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; |
783 |
*) optarg= ;; |
784 |
esac |
785 |
|
786 |
# If the previous option needs an argument, assign it. |
787 |
if test -n "$prev"; then |
788 |
case $prev in |
789 |
execute_dlfiles) |
790 |
execute_dlfiles="$execute_dlfiles $arg" |
791 |
;; |
792 |
tag) |
793 |
tagname="$arg" |
794 |
preserve_args="${preserve_args}=$arg" |
795 |
|
796 |
# Check whether tagname contains only valid characters |
797 |
case $tagname in |
798 |
*[!-_A-Za-z0-9,/]*) |
799 |
$echo "$progname: invalid tag name: $tagname" 1>&2 |
800 |
exit $EXIT_FAILURE |
801 |
;; |
802 |
esac |
803 |
|
804 |
case $tagname in |
805 |
CC) |
806 |
# Don't test for the "default" C tag, as we know, it's there, but |
807 |
# not specially marked. |
808 |
;; |
809 |
*) |
810 |
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then |
811 |
taglist="$taglist $tagname" |
812 |
# Evaluate the configuration. |
813 |
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" |
814 |
else |
815 |
$echo "$progname: ignoring unknown tag $tagname" 1>&2 |
816 |
fi |
817 |
;; |
818 |
esac |
819 |
;; |
820 |
*) |
821 |
eval "$prev=\$arg" |
822 |
;; |
823 |
esac |
824 |
|
825 |
prev= |
826 |
prevopt= |
827 |
continue |
828 |
fi |
829 |
|
830 |
# Have we seen a non-optional argument yet? |
831 |
case $arg in |
832 |
--help) |
833 |
show_help=yes |
834 |
;; |
835 |
|
836 |
--version) |
837 |
echo "\ |
838 |
$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP |
839 |
|
840 |
Copyright (C) 2007 Free Software Foundation, Inc. |
841 |
This is free software; see the source for copying conditions. There is NO |
842 |
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
843 |
exit $? |
844 |
;; |
845 |
|
846 |
--config) |
847 |
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath |
848 |
# Now print the configurations for the tags. |
849 |
for tagname in $taglist; do |
850 |
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" |
851 |
done |
852 |
exit $? |
853 |
;; |
854 |
|
855 |
--debug) |
856 |
$echo "$progname: enabling shell trace mode" |
857 |
set -x |
858 |
preserve_args="$preserve_args $arg" |
859 |
;; |
860 |
|
861 |
--dry-run | -n) |
862 |
run=: |
863 |
;; |
864 |
|
865 |
--features) |
866 |
$echo "host: $host" |
867 |
if test "$build_libtool_libs" = yes; then |
868 |
$echo "enable shared libraries" |
869 |
else |
870 |
$echo "disable shared libraries" |
871 |
fi |
872 |
if test "$build_old_libs" = yes; then |
873 |
$echo "enable static libraries" |
874 |
else |
875 |
$echo "disable static libraries" |
876 |
fi |
877 |
exit $? |
878 |
;; |
879 |
|
880 |
--finish) mode="finish" ;; |
881 |
|
882 |
--mode) prevopt="--mode" prev=mode ;; |
883 |
--mode=*) mode="$optarg" ;; |
884 |
|
885 |
--preserve-dup-deps) duplicate_deps="yes" ;; |
886 |
|
887 |
--quiet | --silent) |
888 |
show=: |
889 |
preserve_args="$preserve_args $arg" |
890 |
;; |
891 |
|
892 |
--tag) |
893 |
prevopt="--tag" |
894 |
prev=tag |
895 |
preserve_args="$preserve_args --tag" |
896 |
;; |
897 |
--tag=*) |
898 |
set tag "$optarg" ${1+"$@"} |
899 |
shift |
900 |
prev=tag |
901 |
preserve_args="$preserve_args --tag" |
902 |
;; |
903 |
|
904 |
-dlopen) |
905 |
prevopt="-dlopen" |
906 |
prev=execute_dlfiles |
907 |
;; |
908 |
|
909 |
-*) |
910 |
$echo "$modename: unrecognized option \`$arg'" 1>&2 |
911 |
$echo "$help" 1>&2 |
912 |
exit $EXIT_FAILURE |
913 |
;; |
914 |
|
915 |
*) |
916 |
nonopt="$arg" |
917 |
break |
918 |
;; |
919 |
esac |
920 |
done |
921 |
|
922 |
if test -n "$prevopt"; then |
923 |
$echo "$modename: option \`$prevopt' requires an argument" 1>&2 |
924 |
$echo "$help" 1>&2 |
925 |
exit $EXIT_FAILURE |
926 |
fi |
927 |
|
928 |
case $disable_libs in |
929 |
no) |
930 |
;; |
931 |
shared) |
932 |
build_libtool_libs=no |
933 |
build_old_libs=yes |
934 |
;; |
935 |
static) |
936 |
build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` |
937 |
;; |
938 |
esac |
939 |
|
940 |
# If this variable is set in any of the actions, the command in it |
941 |
# will be execed at the end. This prevents here-documents from being |
942 |
# left over by shells. |
943 |
exec_cmd= |
944 |
|
945 |
if test -z "$show_help"; then |
946 |
|
947 |
# Infer the operation mode. |
948 |
if test -z "$mode"; then |
949 |
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 |
950 |
$echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 |
951 |
case $nonopt in |
952 |
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) |
953 |
mode=link |
954 |
for arg |
955 |
do |
956 |
case $arg in |
957 |
-c) |
958 |
mode=compile |
959 |
break |
960 |
;; |
961 |
esac |
962 |
done |
963 |
;; |
964 |
*db | *dbx | *strace | *truss) |
965 |
mode=execute |
966 |
;; |
967 |
*install*|cp|mv) |
968 |
mode=install |
969 |
;; |
970 |
*rm) |
971 |
mode=uninstall |
972 |
;; |
973 |
*) |
974 |
# If we have no mode, but dlfiles were specified, then do execute mode. |
975 |
test -n "$execute_dlfiles" && mode=execute |
976 |
|
977 |
# Just use the default operation mode. |
978 |
if test -z "$mode"; then |
979 |
if test -n "$nonopt"; then |
980 |
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 |
981 |
else |
982 |
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 |
983 |
fi |
984 |
fi |
985 |
;; |
986 |
esac |
987 |
fi |
988 |
|
989 |
# Only execute mode is allowed to have -dlopen flags. |
990 |
if test -n "$execute_dlfiles" && test "$mode" != execute; then |
991 |
$echo "$modename: unrecognized option \`-dlopen'" 1>&2 |
992 |
$echo "$help" 1>&2 |
993 |
exit $EXIT_FAILURE |
994 |
fi |
995 |
|
996 |
# Change the help message to a mode-specific one. |
997 |
generic_help="$help" |
998 |
help="Try \`$modename --help --mode=$mode' for more information." |
999 |
|
1000 |
# These modes are in order of execution frequency so that they run quickly. |
1001 |
case $mode in |
1002 |
# libtool compile mode |
1003 |
compile) |
1004 |
modename="$modename: compile" |
1005 |
# Get the compilation command and the source file. |
1006 |
base_compile= |
1007 |
srcfile="$nonopt" # always keep a non-empty value in "srcfile" |
1008 |
suppress_opt=yes |
1009 |
suppress_output= |
1010 |
arg_mode=normal |
1011 |
libobj= |
1012 |
later= |
1013 |
|
1014 |
for arg |
1015 |
do |
1016 |
case $arg_mode in |
1017 |
arg ) |
1018 |
# do not "continue". Instead, add this to base_compile |
1019 |
lastarg="$arg" |
1020 |
arg_mode=normal |
1021 |
;; |
1022 |
|
1023 |
target ) |
1024 |
libobj="$arg" |
1025 |
arg_mode=normal |
1026 |
continue |
1027 |
;; |
1028 |
|
1029 |
normal ) |
1030 |
# Accept any command-line options. |
1031 |
case $arg in |
1032 |
-o) |
1033 |
if test -n "$libobj" ; then |
1034 |
$echo "$modename: you cannot specify \`-o' more than once" 1>&2 |
1035 |
exit $EXIT_FAILURE |
1036 |
fi |
1037 |
arg_mode=target |
1038 |
continue |
1039 |
;; |
1040 |
|
1041 |
-static | -prefer-pic | -prefer-non-pic) |
1042 |
later="$later $arg" |
1043 |
continue |
1044 |
;; |
1045 |
|
1046 |
-no-suppress) |
1047 |
suppress_opt=no |
1048 |
continue |
1049 |
;; |
1050 |
|
1051 |
-Xcompiler) |
1052 |
arg_mode=arg # the next one goes into the "base_compile" arg list |
1053 |
continue # The current "srcfile" will either be retained or |
1054 |
;; # replaced later. I would guess that would be a bug. |
1055 |
|
1056 |
-Wc,*) |
1057 |
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` |
1058 |
lastarg= |
1059 |
save_ifs="$IFS"; IFS=',' |
1060 |
for arg in $args; do |
1061 |
IFS="$save_ifs" |
1062 |
|
1063 |
# Double-quote args containing other shell metacharacters. |
1064 |
# Many Bourne shells cannot handle close brackets correctly |
1065 |
# in scan sets, so we specify it separately. |
1066 |
case $arg in |
1067 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1068 |
arg="\"$arg\"" |
1069 |
;; |
1070 |
esac |
1071 |
lastarg="$lastarg $arg" |
1072 |
done |
1073 |
IFS="$save_ifs" |
1074 |
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` |
1075 |
|
1076 |
# Add the arguments to base_compile. |
1077 |
base_compile="$base_compile $lastarg" |
1078 |
continue |
1079 |
;; |
1080 |
|
1081 |
* ) |
1082 |
# Accept the current argument as the source file. |
1083 |
# The previous "srcfile" becomes the current argument. |
1084 |
# |
1085 |
lastarg="$srcfile" |
1086 |
srcfile="$arg" |
1087 |
;; |
1088 |
esac # case $arg |
1089 |
;; |
1090 |
esac # case $arg_mode |
1091 |
|
1092 |
# Aesthetically quote the previous argument. |
1093 |
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` |
1094 |
|
1095 |
case $lastarg in |
1096 |
# Double-quote args containing other shell metacharacters. |
1097 |
# Many Bourne shells cannot handle close brackets correctly |
1098 |
# in scan sets, and some SunOS ksh mistreat backslash-escaping |
1099 |
# in scan sets (worked around with variable expansion), |
1100 |
# and furthermore cannot handle '|' '&' '(' ')' in scan sets |
1101 |
# at all, so we specify them separately. |
1102 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1103 |
lastarg="\"$lastarg\"" |
1104 |
;; |
1105 |
esac |
1106 |
|
1107 |
base_compile="$base_compile $lastarg" |
1108 |
done # for arg |
1109 |
|
1110 |
case $arg_mode in |
1111 |
arg) |
1112 |
$echo "$modename: you must specify an argument for -Xcompile" |
1113 |
exit $EXIT_FAILURE |
1114 |
;; |
1115 |
target) |
1116 |
$echo "$modename: you must specify a target with \`-o'" 1>&2 |
1117 |
exit $EXIT_FAILURE |
1118 |
;; |
1119 |
*) |
1120 |
# Get the name of the library object. |
1121 |
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` |
1122 |
;; |
1123 |
esac |
1124 |
|
1125 |
# Recognize several different file suffixes. |
1126 |
# If the user specifies -o file.o, it is replaced with file.lo |
1127 |
xform='[cCFSifmso]' |
1128 |
case $libobj in |
1129 |
*.ada) xform=ada ;; |
1130 |
*.adb) xform=adb ;; |
1131 |
*.ads) xform=ads ;; |
1132 |
*.asm) xform=asm ;; |
1133 |
*.c++) xform=c++ ;; |
1134 |
*.cc) xform=cc ;; |
1135 |
*.ii) xform=ii ;; |
1136 |
*.class) xform=class ;; |
1137 |
*.cpp) xform=cpp ;; |
1138 |
*.cxx) xform=cxx ;; |
1139 |
*.[fF][09]?) xform=[fF][09]. ;; |
1140 |
*.for) xform=for ;; |
1141 |
*.java) xform=java ;; |
1142 |
*.obj) xform=obj ;; |
1143 |
esac |
1144 |
|
1145 |
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` |
1146 |
|
1147 |
case $libobj in |
1148 |
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; |
1149 |
*) |
1150 |
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 |
1151 |
exit $EXIT_FAILURE |
1152 |
;; |
1153 |
esac |
1154 |
|
1155 |
func_infer_tag $base_compile |
1156 |
|
1157 |
for arg in $later; do |
1158 |
case $arg in |
1159 |
-static) |
1160 |
build_old_libs=yes |
1161 |
continue |
1162 |
;; |
1163 |
|
1164 |
-prefer-pic) |
1165 |
pic_mode=yes |
1166 |
continue |
1167 |
;; |
1168 |
|
1169 |
-prefer-non-pic) |
1170 |
pic_mode=no |
1171 |
continue |
1172 |
;; |
1173 |
esac |
1174 |
done |
1175 |
|
1176 |
qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` |
1177 |
case $qlibobj in |
1178 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1179 |
qlibobj="\"$qlibobj\"" ;; |
1180 |
esac |
1181 |
test "X$libobj" != "X$qlibobj" \ |
1182 |
&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ |
1183 |
&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters." |
1184 |
objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
1185 |
xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
1186 |
if test "X$xdir" = "X$obj"; then |
1187 |
xdir= |
1188 |
else |
1189 |
xdir=$xdir/ |
1190 |
fi |
1191 |
lobj=${xdir}$objdir/$objname |
1192 |
|
1193 |
if test -z "$base_compile"; then |
1194 |
$echo "$modename: you must specify a compilation command" 1>&2 |
1195 |
$echo "$help" 1>&2 |
1196 |
exit $EXIT_FAILURE |
1197 |
fi |
1198 |
|
1199 |
# Delete any leftover library objects. |
1200 |
if test "$build_old_libs" = yes; then |
1201 |
removelist="$obj $lobj $libobj ${libobj}T" |
1202 |
else |
1203 |
removelist="$lobj $libobj ${libobj}T" |
1204 |
fi |
1205 |
|
1206 |
$run $rm $removelist |
1207 |
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 |
1208 |
|
1209 |
# On Cygwin there's no "real" PIC flag so we must build both object types |
1210 |
case $host_os in |
1211 |
cygwin* | mingw* | pw32* | os2*) |
1212 |
pic_mode=default |
1213 |
;; |
1214 |
esac |
1215 |
if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then |
1216 |
# non-PIC code in shared libraries is not supported |
1217 |
pic_mode=default |
1218 |
fi |
1219 |
|
1220 |
# Calculate the filename of the output object if compiler does |
1221 |
# not support -o with -c |
1222 |
if test "$compiler_c_o" = no; then |
1223 |
output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} |
1224 |
lockfile="$output_obj.lock" |
1225 |
removelist="$removelist $output_obj $lockfile" |
1226 |
trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 |
1227 |
else |
1228 |
output_obj= |
1229 |
need_locks=no |
1230 |
lockfile= |
1231 |
fi |
1232 |
|
1233 |
# Lock this critical section if it is needed |
1234 |
# We use this script file to make the link, it avoids creating a new file |
1235 |
if test "$need_locks" = yes; then |
1236 |
until $run ln "$progpath" "$lockfile" 2>/dev/null; do |
1237 |
$show "Waiting for $lockfile to be removed" |
1238 |
sleep 2 |
1239 |
done |
1240 |
elif test "$need_locks" = warn; then |
1241 |
if test -f "$lockfile"; then |
1242 |
$echo "\ |
1243 |
*** ERROR, $lockfile exists and contains: |
1244 |
`cat $lockfile 2>/dev/null` |
1245 |
|
1246 |
This indicates that another process is trying to use the same |
1247 |
temporary object file, and libtool could not work around it because |
1248 |
your compiler does not support \`-c' and \`-o' together. If you |
1249 |
repeat this compilation, it may succeed, by chance, but you had better |
1250 |
avoid parallel builds (make -j) in this platform, or get a better |
1251 |
compiler." |
1252 |
|
1253 |
$run $rm $removelist |
1254 |
exit $EXIT_FAILURE |
1255 |
fi |
1256 |
$echo "$srcfile" > "$lockfile" |
1257 |
fi |
1258 |
|
1259 |
if test -n "$fix_srcfile_path"; then |
1260 |
eval srcfile=\"$fix_srcfile_path\" |
1261 |
fi |
1262 |
qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` |
1263 |
case $qsrcfile in |
1264 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1265 |
qsrcfile="\"$qsrcfile\"" ;; |
1266 |
esac |
1267 |
|
1268 |
$run $rm "$libobj" "${libobj}T" |
1269 |
|
1270 |
# Create a libtool object file (analogous to a ".la" file), |
1271 |
# but don't create it if we're doing a dry run. |
1272 |
test -z "$run" && cat > ${libobj}T <<EOF |
1273 |
# $libobj - a libtool object file |
1274 |
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
1275 |
# |
1276 |
# Please DO NOT delete this file! |
1277 |
# It is necessary for linking the library. |
1278 |
|
1279 |
# Name of the PIC object. |
1280 |
EOF |
1281 |
|
1282 |
# Only build a PIC object if we are building libtool libraries. |
1283 |
if test "$build_libtool_libs" = yes; then |
1284 |
# Without this assignment, base_compile gets emptied. |
1285 |
fbsd_hideous_sh_bug=$base_compile |
1286 |
|
1287 |
if test "$pic_mode" != no; then |
1288 |
command="$base_compile $qsrcfile $pic_flag" |
1289 |
else |
1290 |
# Don't build PIC code |
1291 |
command="$base_compile $qsrcfile" |
1292 |
fi |
1293 |
|
1294 |
if test ! -d "${xdir}$objdir"; then |
1295 |
$show "$mkdir ${xdir}$objdir" |
1296 |
$run $mkdir ${xdir}$objdir |
1297 |
exit_status=$? |
1298 |
if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then |
1299 |
exit $exit_status |
1300 |
fi |
1301 |
fi |
1302 |
|
1303 |
if test -z "$output_obj"; then |
1304 |
# Place PIC objects in $objdir |
1305 |
command="$command -o $lobj" |
1306 |
fi |
1307 |
|
1308 |
$run $rm "$lobj" "$output_obj" |
1309 |
|
1310 |
$show "$command" |
1311 |
if $run eval "$command"; then : |
1312 |
else |
1313 |
test -n "$output_obj" && $run $rm $removelist |
1314 |
exit $EXIT_FAILURE |
1315 |
fi |
1316 |
|
1317 |
if test "$need_locks" = warn && |
1318 |
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then |
1319 |
$echo "\ |
1320 |
*** ERROR, $lockfile contains: |
1321 |
`cat $lockfile 2>/dev/null` |
1322 |
|
1323 |
but it should contain: |
1324 |
$srcfile |
1325 |
|
1326 |
This indicates that another process is trying to use the same |
1327 |
temporary object file, and libtool could not work around it because |
1328 |
your compiler does not support \`-c' and \`-o' together. If you |
1329 |
repeat this compilation, it may succeed, by chance, but you had better |
1330 |
avoid parallel builds (make -j) in this platform, or get a better |
1331 |
compiler." |
1332 |
|
1333 |
$run $rm $removelist |
1334 |
exit $EXIT_FAILURE |
1335 |
fi |
1336 |
|
1337 |
# Just move the object if needed, then go on to compile the next one |
1338 |
if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then |
1339 |
$show "$mv $output_obj $lobj" |
1340 |
if $run $mv $output_obj $lobj; then : |
1341 |
else |
1342 |
error=$? |
1343 |
$run $rm $removelist |
1344 |
exit $error |
1345 |
fi |
1346 |
fi |
1347 |
|
1348 |
# Append the name of the PIC object to the libtool object file. |
1349 |
test -z "$run" && cat >> ${libobj}T <<EOF |
1350 |
pic_object='$objdir/$objname' |
1351 |
|
1352 |
EOF |
1353 |
|
1354 |
# Allow error messages only from the first compilation. |
1355 |
if test "$suppress_opt" = yes; then |
1356 |
suppress_output=' >/dev/null 2>&1' |
1357 |
fi |
1358 |
else |
1359 |
# No PIC object so indicate it doesn't exist in the libtool |
1360 |
# object file. |
1361 |
test -z "$run" && cat >> ${libobj}T <<EOF |
1362 |
pic_object=none |
1363 |
|
1364 |
EOF |
1365 |
fi |
1366 |
|
1367 |
# Only build a position-dependent object if we build old libraries. |
1368 |
if test "$build_old_libs" = yes; then |
1369 |
if test "$pic_mode" != yes; then |
1370 |
# Don't build PIC code |
1371 |
command="$base_compile $qsrcfile" |
1372 |
else |
1373 |
command="$base_compile $qsrcfile $pic_flag" |
1374 |
fi |
1375 |
if test "$compiler_c_o" = yes; then |
1376 |
command="$command -o $obj" |
1377 |
fi |
1378 |
|
1379 |
# Suppress compiler output if we already did a PIC compilation. |
1380 |
command="$command$suppress_output" |
1381 |
$run $rm "$obj" "$output_obj" |
1382 |
$show "$command" |
1383 |
if $run eval "$command"; then : |
1384 |
else |
1385 |
$run $rm $removelist |
1386 |
exit $EXIT_FAILURE |
1387 |
fi |
1388 |
|
1389 |
if test "$need_locks" = warn && |
1390 |
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then |
1391 |
$echo "\ |
1392 |
*** ERROR, $lockfile contains: |
1393 |
`cat $lockfile 2>/dev/null` |
1394 |
|
1395 |
but it should contain: |
1396 |
$srcfile |
1397 |
|
1398 |
This indicates that another process is trying to use the same |
1399 |
temporary object file, and libtool could not work around it because |
1400 |
your compiler does not support \`-c' and \`-o' together. If you |
1401 |
repeat this compilation, it may succeed, by chance, but you had better |
1402 |
avoid parallel builds (make -j) in this platform, or get a better |
1403 |
compiler." |
1404 |
|
1405 |
$run $rm $removelist |
1406 |
exit $EXIT_FAILURE |
1407 |
fi |
1408 |
|
1409 |
# Just move the object if needed |
1410 |
if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then |
1411 |
$show "$mv $output_obj $obj" |
1412 |
if $run $mv $output_obj $obj; then : |
1413 |
else |
1414 |
error=$? |
1415 |
$run $rm $removelist |
1416 |
exit $error |
1417 |
fi |
1418 |
fi |
1419 |
|
1420 |
# Append the name of the non-PIC object the libtool object file. |
1421 |
# Only append if the libtool object file exists. |
1422 |
test -z "$run" && cat >> ${libobj}T <<EOF |
1423 |
# Name of the non-PIC object. |
1424 |
non_pic_object='$objname' |
1425 |
|
1426 |
EOF |
1427 |
else |
1428 |
# Append the name of the non-PIC object the libtool object file. |
1429 |
# Only append if the libtool object file exists. |
1430 |
test -z "$run" && cat >> ${libobj}T <<EOF |
1431 |
# Name of the non-PIC object. |
1432 |
non_pic_object=none |
1433 |
|
1434 |
EOF |
1435 |
fi |
1436 |
|
1437 |
$run $mv "${libobj}T" "${libobj}" |
1438 |
|
1439 |
# Unlock the critical section if it was locked |
1440 |
if test "$need_locks" != no; then |
1441 |
$run $rm "$lockfile" |
1442 |
fi |
1443 |
|
1444 |
exit $EXIT_SUCCESS |
1445 |
;; |
1446 |
|
1447 |
# libtool link mode |
1448 |
link | relink) |
1449 |
modename="$modename: link" |
1450 |
case $host in |
1451 |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
1452 |
# It is impossible to link a dll without this setting, and |
1453 |
# we shouldn't force the makefile maintainer to figure out |
1454 |
# which system we are compiling for in order to pass an extra |
1455 |
# flag for every libtool invocation. |
1456 |
# allow_undefined=no |
1457 |
|
1458 |
# FIXME: Unfortunately, there are problems with the above when trying |
1459 |
# to make a dll which has undefined symbols, in which case not |
1460 |
# even a static library is built. For now, we need to specify |
1461 |
# -no-undefined on the libtool link line when we can be certain |
1462 |
# that all symbols are satisfied, otherwise we get a static library. |
1463 |
allow_undefined=yes |
1464 |
;; |
1465 |
*) |
1466 |
allow_undefined=yes |
1467 |
;; |
1468 |
esac |
1469 |
libtool_args="$nonopt" |
1470 |
base_compile="$nonopt $@" |
1471 |
compile_command="$nonopt" |
1472 |
finalize_command="$nonopt" |
1473 |
|
1474 |
compile_rpath= |
1475 |
finalize_rpath= |
1476 |
compile_shlibpath= |
1477 |
finalize_shlibpath= |
1478 |
convenience= |
1479 |
old_convenience= |
1480 |
deplibs= |
1481 |
old_deplibs= |
1482 |
compiler_flags= |
1483 |
linker_flags= |
1484 |
dllsearchpath= |
1485 |
lib_search_path=`pwd` |
1486 |
inst_prefix_dir= |
1487 |
|
1488 |
avoid_version=no |
1489 |
dlfiles= |
1490 |
dlprefiles= |
1491 |
dlself=no |
1492 |
export_dynamic=no |
1493 |
export_symbols= |
1494 |
export_symbols_regex= |
1495 |
generated= |
1496 |
libobjs= |
1497 |
ltlibs= |
1498 |
module=no |
1499 |
no_install=no |
1500 |
objs= |
1501 |
non_pic_objects= |
1502 |
notinst_path= # paths that contain not-installed libtool libraries |
1503 |
precious_files_regex= |
1504 |
prefer_static_libs=no |
1505 |
preload=no |
1506 |
prev= |
1507 |
prevarg= |
1508 |
release= |
1509 |
rpath= |
1510 |
xrpath= |
1511 |
perm_rpath= |
1512 |
temp_rpath= |
1513 |
thread_safe=no |
1514 |
vinfo= |
1515 |
vinfo_number=no |
1516 |
|
1517 |
func_infer_tag $base_compile |
1518 |
|
1519 |
# We need to know -static, to get the right output filenames. |
1520 |
for arg |
1521 |
do |
1522 |
case $arg in |
1523 |
-all-static | -static | -static-libtool-libs) |
1524 |
case $arg in |
1525 |
-all-static) |
1526 |
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then |
1527 |
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 |
1528 |
fi |
1529 |
if test -n "$link_static_flag"; then |
1530 |
dlopen_self=$dlopen_self_static |
1531 |
fi |
1532 |
prefer_static_libs=yes |
1533 |
;; |
1534 |
-static) |
1535 |
if test -z "$pic_flag" && test -n "$link_static_flag"; then |
1536 |
dlopen_self=$dlopen_self_static |
1537 |
fi |
1538 |
prefer_static_libs=built |
1539 |
;; |
1540 |
-static-libtool-libs) |
1541 |
if test -z "$pic_flag" && test -n "$link_static_flag"; then |
1542 |
dlopen_self=$dlopen_self_static |
1543 |
fi |
1544 |
prefer_static_libs=yes |
1545 |
;; |
1546 |
esac |
1547 |
build_libtool_libs=no |
1548 |
build_old_libs=yes |
1549 |
break |
1550 |
;; |
1551 |
esac |
1552 |
done |
1553 |
|
1554 |
# See if our shared archives depend on static archives. |
1555 |
test -n "$old_archive_from_new_cmds" && build_old_libs=yes |
1556 |
|
1557 |
# Go through the arguments, transforming them on the way. |
1558 |
while test "$#" -gt 0; do |
1559 |
arg="$1" |
1560 |
shift |
1561 |
case $arg in |
1562 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
1563 |
qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test |
1564 |
;; |
1565 |
*) qarg=$arg ;; |
1566 |
esac |
1567 |
libtool_args="$libtool_args $qarg" |
1568 |
|
1569 |
# If the previous option needs an argument, assign it. |
1570 |
if test -n "$prev"; then |
1571 |
case $prev in |
1572 |
output) |
1573 |
compile_command="$compile_command @OUTPUT@" |
1574 |
finalize_command="$finalize_command @OUTPUT@" |
1575 |
;; |
1576 |
esac |
1577 |
|
1578 |
case $prev in |
1579 |
dlfiles|dlprefiles) |
1580 |
if test "$preload" = no; then |
1581 |
# Add the symbol object into the linking commands. |
1582 |
compile_command="$compile_command @SYMFILE@" |
1583 |
finalize_command="$finalize_command @SYMFILE@" |
1584 |
preload=yes |
1585 |
fi |
1586 |
case $arg in |
1587 |
*.la | *.lo) ;; # We handle these cases below. |
1588 |
force) |
1589 |
if test "$dlself" = no; then |
1590 |
dlself=needless |
1591 |
export_dynamic=yes |
1592 |
fi |
1593 |
prev= |
1594 |
continue |
1595 |
;; |
1596 |
self) |
1597 |
if test "$prev" = dlprefiles; then |
1598 |
dlself=yes |
1599 |
elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then |
1600 |
dlself=yes |
1601 |
else |
1602 |
dlself=needless |
1603 |
export_dynamic=yes |
1604 |
fi |
1605 |
prev= |
1606 |
continue |
1607 |
;; |
1608 |
*) |
1609 |
if test "$prev" = dlfiles; then |
1610 |
dlfiles="$dlfiles $arg" |
1611 |
else |
1612 |
dlprefiles="$dlprefiles $arg" |
1613 |
fi |
1614 |
prev= |
1615 |
continue |
1616 |
;; |
1617 |
esac |
1618 |
;; |
1619 |
expsyms) |
1620 |
export_symbols="$arg" |
1621 |
if test ! -f "$arg"; then |
1622 |
$echo "$modename: symbol file \`$arg' does not exist" |
1623 |
exit $EXIT_FAILURE |
1624 |
fi |
1625 |
prev= |
1626 |
continue |
1627 |
;; |
1628 |
expsyms_regex) |
1629 |
export_symbols_regex="$arg" |
1630 |
prev= |
1631 |
continue |
1632 |
;; |
1633 |
inst_prefix) |
1634 |
inst_prefix_dir="$arg" |
1635 |
prev= |
1636 |
continue |
1637 |
;; |
1638 |
precious_regex) |
1639 |
precious_files_regex="$arg" |
1640 |
prev= |
1641 |
continue |
1642 |
;; |
1643 |
release) |
1644 |
release="-$arg" |
1645 |
prev= |
1646 |
continue |
1647 |
;; |
1648 |
objectlist) |
1649 |
if test -f "$arg"; then |
1650 |
save_arg=$arg |
1651 |
moreargs= |
1652 |
for fil in `cat $save_arg` |
1653 |
do |
1654 |
# moreargs="$moreargs $fil" |
1655 |
arg=$fil |
1656 |
# A libtool-controlled object. |
1657 |
|
1658 |
# Check to see that this really is a libtool object. |
1659 |
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
1660 |
pic_object= |
1661 |
non_pic_object= |
1662 |
|
1663 |
# Read the .lo file |
1664 |
# If there is no directory component, then add one. |
1665 |
case $arg in |
1666 |
*/* | *\\*) . $arg ;; |
1667 |
*) . ./$arg ;; |
1668 |
esac |
1669 |
|
1670 |
if test -z "$pic_object" || \ |
1671 |
test -z "$non_pic_object" || |
1672 |
test "$pic_object" = none && \ |
1673 |
test "$non_pic_object" = none; then |
1674 |
$echo "$modename: cannot find name of object for \`$arg'" 1>&2 |
1675 |
exit $EXIT_FAILURE |
1676 |
fi |
1677 |
|
1678 |
# Extract subdirectory from the argument. |
1679 |
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
1680 |
if test "X$xdir" = "X$arg"; then |
1681 |
xdir= |
1682 |
else |
1683 |
xdir="$xdir/" |
1684 |
fi |
1685 |
|
1686 |
if test "$pic_object" != none; then |
1687 |
# Prepend the subdirectory the object is found in. |
1688 |
pic_object="$xdir$pic_object" |
1689 |
|
1690 |
if test "$prev" = dlfiles; then |
1691 |
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then |
1692 |
dlfiles="$dlfiles $pic_object" |
1693 |
prev= |
1694 |
continue |
1695 |
else |
1696 |
# If libtool objects are unsupported, then we need to preload. |
1697 |
prev=dlprefiles |
1698 |
fi |
1699 |
fi |
1700 |
|
1701 |
# CHECK ME: I think I busted this. -Ossama |
1702 |
if test "$prev" = dlprefiles; then |
1703 |
# Preload the old-style object. |
1704 |
dlprefiles="$dlprefiles $pic_object" |
1705 |
prev= |
1706 |
fi |
1707 |
|
1708 |
# A PIC object. |
1709 |
libobjs="$libobjs $pic_object" |
1710 |
arg="$pic_object" |
1711 |
fi |
1712 |
|
1713 |
# Non-PIC object. |
1714 |
if test "$non_pic_object" != none; then |
1715 |
# Prepend the subdirectory the object is found in. |
1716 |
non_pic_object="$xdir$non_pic_object" |
1717 |
|
1718 |
# A standard non-PIC object |
1719 |
non_pic_objects="$non_pic_objects $non_pic_object" |
1720 |
if test -z "$pic_object" || test "$pic_object" = none ; then |
1721 |
arg="$non_pic_object" |
1722 |
fi |
1723 |
else |
1724 |
# If the PIC object exists, use it instead. |
1725 |
# $xdir was prepended to $pic_object above. |
1726 |
non_pic_object="$pic_object" |
1727 |
non_pic_objects="$non_pic_objects $non_pic_object" |
1728 |
fi |
1729 |
else |
1730 |
# Only an error if not doing a dry-run. |
1731 |
if test -z "$run"; then |
1732 |
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2 |
1733 |
exit $EXIT_FAILURE |
1734 |
else |
1735 |
# Dry-run case. |
1736 |
|
1737 |
# Extract subdirectory from the argument. |
1738 |
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
1739 |
if test "X$xdir" = "X$arg"; then |
1740 |
xdir= |
1741 |
else |
1742 |
xdir="$xdir/" |
1743 |
fi |
1744 |
|
1745 |
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` |
1746 |
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` |
1747 |
libobjs="$libobjs $pic_object" |
1748 |
non_pic_objects="$non_pic_objects $non_pic_object" |
1749 |
fi |
1750 |
fi |
1751 |
done |
1752 |
else |
1753 |
$echo "$modename: link input file \`$save_arg' does not exist" |
1754 |
exit $EXIT_FAILURE |
1755 |
fi |
1756 |
arg=$save_arg |
1757 |
prev= |
1758 |
continue |
1759 |
;; |
1760 |
rpath | xrpath) |
1761 |
# We need an absolute path. |
1762 |
case $arg in |
1763 |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
1764 |
*) |
1765 |
$echo "$modename: only absolute run-paths are allowed" 1>&2 |
1766 |
exit $EXIT_FAILURE |
1767 |
;; |
1768 |
esac |
1769 |
if test "$prev" = rpath; then |
1770 |
case "$rpath " in |
1771 |
*" $arg "*) ;; |
1772 |
*) rpath="$rpath $arg" ;; |
1773 |
esac |
1774 |
else |
1775 |
case "$xrpath " in |
1776 |
*" $arg "*) ;; |
1777 |
*) xrpath="$xrpath $arg" ;; |
1778 |
esac |
1779 |
fi |
1780 |
prev= |
1781 |
continue |
1782 |
;; |
1783 |
xcompiler) |
1784 |
compiler_flags="$compiler_flags $qarg" |
1785 |
prev= |
1786 |
compile_command="$compile_command $qarg" |
1787 |
finalize_command="$finalize_command $qarg" |
1788 |
continue |
1789 |
;; |
1790 |
xlinker) |
1791 |
linker_flags="$linker_flags $qarg" |
1792 |
compiler_flags="$compiler_flags $wl$qarg" |
1793 |
prev= |
1794 |
compile_command="$compile_command $wl$qarg" |
1795 |
finalize_command="$finalize_command $wl$qarg" |
1796 |
continue |
1797 |
;; |
1798 |
xcclinker) |
1799 |
linker_flags="$linker_flags $qarg" |
1800 |
compiler_flags="$compiler_flags $qarg" |
1801 |
prev= |
1802 |
compile_command="$compile_command $qarg" |
1803 |
finalize_command="$finalize_command $qarg" |
1804 |
continue |
1805 |
;; |
1806 |
shrext) |
1807 |
shrext_cmds="$arg" |
1808 |
prev= |
1809 |
continue |
1810 |
;; |
1811 |
darwin_framework|darwin_framework_skip) |
1812 |
test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" |
1813 |
compile_command="$compile_command $arg" |
1814 |
finalize_command="$finalize_command $arg" |
1815 |
prev= |
1816 |
continue |
1817 |
;; |
1818 |
*) |
1819 |
eval "$prev=\"\$arg\"" |
1820 |
prev= |
1821 |
continue |
1822 |
;; |
1823 |
esac |
1824 |
fi # test -n "$prev" |
1825 |
|
1826 |
prevarg="$arg" |
1827 |
|
1828 |
case $arg in |
1829 |
-all-static) |
1830 |
if test -n "$link_static_flag"; then |
1831 |
compile_command="$compile_command $link_static_flag" |
1832 |
finalize_command="$finalize_command $link_static_flag" |
1833 |
fi |
1834 |
continue |
1835 |
;; |
1836 |
|
1837 |
-allow-undefined) |
1838 |
# FIXME: remove this flag sometime in the future. |
1839 |
$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 |
1840 |
continue |
1841 |
;; |
1842 |
|
1843 |
-avoid-version) |
1844 |
avoid_version=yes |
1845 |
continue |
1846 |
;; |
1847 |
|
1848 |
-dlopen) |
1849 |
prev=dlfiles |
1850 |
continue |
1851 |
;; |
1852 |
|
1853 |
-dlpreopen) |
1854 |
prev=dlprefiles |
1855 |
continue |
1856 |
;; |
1857 |
|
1858 |
-export-dynamic) |
1859 |
export_dynamic=yes |
1860 |
continue |
1861 |
;; |
1862 |
|
1863 |
-export-symbols | -export-symbols-regex) |
1864 |
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then |
1865 |
$echo "$modename: more than one -exported-symbols argument is not allowed" |
1866 |
exit $EXIT_FAILURE |
1867 |
fi |
1868 |
if test "X$arg" = "X-export-symbols"; then |
1869 |
prev=expsyms |
1870 |
else |
1871 |
prev=expsyms_regex |
1872 |
fi |
1873 |
continue |
1874 |
;; |
1875 |
|
1876 |
-framework|-arch|-isysroot) |
1877 |
case " $CC " in |
1878 |
*" ${arg} ${1} "* | *" ${arg} ${1} "*) |
1879 |
prev=darwin_framework_skip ;; |
1880 |
*) compiler_flags="$compiler_flags $arg" |
1881 |
prev=darwin_framework ;; |
1882 |
esac |
1883 |
compile_command="$compile_command $arg" |
1884 |
finalize_command="$finalize_command $arg" |
1885 |
continue |
1886 |
;; |
1887 |
|
1888 |
-inst-prefix-dir) |
1889 |
prev=inst_prefix |
1890 |
continue |
1891 |
;; |
1892 |
|
1893 |
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* |
1894 |
# so, if we see these flags be careful not to treat them like -L |
1895 |
-L[A-Z][A-Z]*:*) |
1896 |
case $with_gcc/$host in |
1897 |
no/*-*-irix* | /*-*-irix*) |
1898 |
compile_command="$compile_command $arg" |
1899 |
finalize_command="$finalize_command $arg" |
1900 |
;; |
1901 |
esac |
1902 |
continue |
1903 |
;; |
1904 |
|
1905 |
-L*) |
1906 |
dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` |
1907 |
# We need an absolute path. |
1908 |
case $dir in |
1909 |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
1910 |
*) |
1911 |
absdir=`cd "$dir" && pwd` |
1912 |
if test -z "$absdir"; then |
1913 |
$echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 |
1914 |
absdir="$dir" |
1915 |
notinst_path="$notinst_path $dir" |
1916 |
fi |
1917 |
dir="$absdir" |
1918 |
;; |
1919 |
esac |
1920 |
case "$deplibs " in |
1921 |
*" -L$dir "*) ;; |
1922 |
*) |
1923 |
deplibs="$deplibs -L$dir" |
1924 |
lib_search_path="$lib_search_path $dir" |
1925 |
;; |
1926 |
esac |
1927 |
case $host in |
1928 |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
1929 |
testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` |
1930 |
case :$dllsearchpath: in |
1931 |
*":$dir:"*) ;; |
1932 |
*) dllsearchpath="$dllsearchpath:$dir";; |
1933 |
esac |
1934 |
case :$dllsearchpath: in |
1935 |
*":$testbindir:"*) ;; |
1936 |
*) dllsearchpath="$dllsearchpath:$testbindir";; |
1937 |
esac |
1938 |
;; |
1939 |
esac |
1940 |
continue |
1941 |
;; |
1942 |
|
1943 |
-l*) |
1944 |
if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then |
1945 |
case $host in |
1946 |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) |
1947 |
# These systems don't actually have a C or math library (as such) |
1948 |
continue |
1949 |
;; |
1950 |
*-*-os2*) |
1951 |
# These systems don't actually have a C library (as such) |
1952 |
test "X$arg" = "X-lc" && continue |
1953 |
;; |
1954 |
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) |
1955 |
# Do not include libc due to us having libc/libc_r. |
1956 |
test "X$arg" = "X-lc" && continue |
1957 |
;; |
1958 |
*-*-rhapsody* | *-*-darwin1.[012]) |
1959 |
# Rhapsody C and math libraries are in the System framework |
1960 |
deplibs="$deplibs -framework System" |
1961 |
continue |
1962 |
;; |
1963 |
*-*-sco3.2v5* | *-*-sco5v6*) |
1964 |
# Causes problems with __ctype |
1965 |
test "X$arg" = "X-lc" && continue |
1966 |
;; |
1967 |
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) |
1968 |
# Compiler inserts libc in the correct place for threads to work |
1969 |
test "X$arg" = "X-lc" && continue |
1970 |
;; |
1971 |
esac |
1972 |
elif test "X$arg" = "X-lc_r"; then |
1973 |
case $host in |
1974 |
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) |
1975 |
# Do not include libc_r directly, use -pthread flag. |
1976 |
continue |
1977 |
;; |
1978 |
esac |
1979 |
fi |
1980 |
deplibs="$deplibs $arg" |
1981 |
continue |
1982 |
;; |
1983 |
|
1984 |
# Tru64 UNIX uses -model [arg] to determine the layout of C++ |
1985 |
# classes, name mangling, and exception handling. |
1986 |
-model) |
1987 |
compile_command="$compile_command $arg" |
1988 |
compiler_flags="$compiler_flags $arg" |
1989 |
finalize_command="$finalize_command $arg" |
1990 |
prev=xcompiler |
1991 |
continue |
1992 |
;; |
1993 |
|
1994 |
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) |
1995 |
compiler_flags="$compiler_flags $arg" |
1996 |
compile_command="$compile_command $arg" |
1997 |
finalize_command="$finalize_command $arg" |
1998 |
continue |
1999 |
;; |
2000 |
|
2001 |
-module) |
2002 |
module=yes |
2003 |
continue |
2004 |
;; |
2005 |
|
2006 |
# -64, -mips[0-9] enable 64-bit mode on the SGI compiler |
2007 |
# -r[0-9][0-9]* specifies the processor on the SGI compiler |
2008 |
# -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler |
2009 |
# +DA*, +DD* enable 64-bit mode on the HP compiler |
2010 |
# -q* pass through compiler args for the IBM compiler |
2011 |
# -m* pass through architecture-specific compiler args for GCC |
2012 |
# -m*, -t[45]*, -txscale* pass through architecture-specific |
2013 |
# compiler args for GCC |
2014 |
# -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC |
2015 |
# -F/path gives path to uninstalled frameworks, gcc on darwin |
2016 |
# @file GCC response files |
2017 |
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ |
2018 |
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) |
2019 |
|
2020 |
# Unknown arguments in both finalize_command and compile_command need |
2021 |
# to be aesthetically quoted because they are evaled later. |
2022 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
2023 |
case $arg in |
2024 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
2025 |
arg="\"$arg\"" |
2026 |
;; |
2027 |
esac |
2028 |
compile_command="$compile_command $arg" |
2029 |
finalize_command="$finalize_command $arg" |
2030 |
compiler_flags="$compiler_flags $arg" |
2031 |
continue |
2032 |
;; |
2033 |
|
2034 |
-shrext) |
2035 |
prev=shrext |
2036 |
continue |
2037 |
;; |
2038 |
|
2039 |
-no-fast-install) |
2040 |
fast_install=no |
2041 |
continue |
2042 |
;; |
2043 |
|
2044 |
-no-install) |
2045 |
case $host in |
2046 |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) |
2047 |
# The PATH hackery in wrapper scripts is required on Windows |
2048 |
# and Darwin in order for the loader to find any dlls it needs. |
2049 |
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 |
2050 |
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 |
2051 |
fast_install=no |
2052 |
;; |
2053 |
*) no_install=yes ;; |
2054 |
esac |
2055 |
continue |
2056 |
;; |
2057 |
|
2058 |
-no-undefined) |
2059 |
allow_undefined=no |
2060 |
continue |
2061 |
;; |
2062 |
|
2063 |
-objectlist) |
2064 |
prev=objectlist |
2065 |
continue |
2066 |
;; |
2067 |
|
2068 |
-o) prev=output ;; |
2069 |
|
2070 |
-precious-files-regex) |
2071 |
prev=precious_regex |
2072 |
continue |
2073 |
;; |
2074 |
|
2075 |
-release) |
2076 |
prev=release |
2077 |
continue |
2078 |
;; |
2079 |
|
2080 |
-rpath) |
2081 |
prev=rpath |
2082 |
continue |
2083 |
;; |
2084 |
|
2085 |
-R) |
2086 |
prev=xrpath |
2087 |
continue |
2088 |
;; |
2089 |
|
2090 |
-R*) |
2091 |
dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` |
2092 |
# We need an absolute path. |
2093 |
case $dir in |
2094 |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
2095 |
*) |
2096 |
$echo "$modename: only absolute run-paths are allowed" 1>&2 |
2097 |
exit $EXIT_FAILURE |
2098 |
;; |
2099 |
esac |
2100 |
case "$xrpath " in |
2101 |
*" $dir "*) ;; |
2102 |
*) xrpath="$xrpath $dir" ;; |
2103 |
esac |
2104 |
continue |
2105 |
;; |
2106 |
|
2107 |
-static | -static-libtool-libs) |
2108 |
# The effects of -static are defined in a previous loop. |
2109 |
# We used to do the same as -all-static on platforms that |
2110 |
# didn't have a PIC flag, but the assumption that the effects |
2111 |
# would be equivalent was wrong. It would break on at least |
2112 |
# Digital Unix and AIX. |
2113 |
continue |
2114 |
;; |
2115 |
|
2116 |
-thread-safe) |
2117 |
thread_safe=yes |
2118 |
continue |
2119 |
;; |
2120 |
|
2121 |
-version-info) |
2122 |
prev=vinfo |
2123 |
continue |
2124 |
;; |
2125 |
-version-number) |
2126 |
prev=vinfo |
2127 |
vinfo_number=yes |
2128 |
continue |
2129 |
;; |
2130 |
|
2131 |
-Wc,*) |
2132 |
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` |
2133 |
arg= |
2134 |
save_ifs="$IFS"; IFS=',' |
2135 |
for flag in $args; do |
2136 |
IFS="$save_ifs" |
2137 |
case $flag in |
2138 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
2139 |
flag="\"$flag\"" |
2140 |
;; |
2141 |
esac |
2142 |
arg="$arg $wl$flag" |
2143 |
compiler_flags="$compiler_flags $flag" |
2144 |
done |
2145 |
IFS="$save_ifs" |
2146 |
arg=`$echo "X$arg" | $Xsed -e "s/^ //"` |
2147 |
;; |
2148 |
|
2149 |
-Wl,*) |
2150 |
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` |
2151 |
arg= |
2152 |
save_ifs="$IFS"; IFS=',' |
2153 |
for flag in $args; do |
2154 |
IFS="$save_ifs" |
2155 |
case $flag in |
2156 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
2157 |
flag="\"$flag\"" |
2158 |
;; |
2159 |
esac |
2160 |
arg="$arg $wl$flag" |
2161 |
compiler_flags="$compiler_flags $wl$flag" |
2162 |
linker_flags="$linker_flags $flag" |
2163 |
done |
2164 |
IFS="$save_ifs" |
2165 |
arg=`$echo "X$arg" | $Xsed -e "s/^ //"` |
2166 |
;; |
2167 |
|
2168 |
-Xcompiler) |
2169 |
prev=xcompiler |
2170 |
continue |
2171 |
;; |
2172 |
|
2173 |
-Xlinker) |
2174 |
prev=xlinker |
2175 |
continue |
2176 |
;; |
2177 |
|
2178 |
-XCClinker) |
2179 |
prev=xcclinker |
2180 |
continue |
2181 |
;; |
2182 |
|
2183 |
# Some other compiler flag. |
2184 |
-* | +*) |
2185 |
# Unknown arguments in both finalize_command and compile_command need |
2186 |
# to be aesthetically quoted because they are evaled later. |
2187 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
2188 |
case $arg in |
2189 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
2190 |
arg="\"$arg\"" |
2191 |
;; |
2192 |
esac |
2193 |
;; |
2194 |
|
2195 |
*.$objext) |
2196 |
# A standard object. |
2197 |
objs="$objs $arg" |
2198 |
;; |
2199 |
|
2200 |
*.lo) |
2201 |
# A libtool-controlled object. |
2202 |
|
2203 |
# Check to see that this really is a libtool object. |
2204 |
if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
2205 |
pic_object= |
2206 |
non_pic_object= |
2207 |
|
2208 |
# Read the .lo file |
2209 |
# If there is no directory component, then add one. |
2210 |
case $arg in |
2211 |
*/* | *\\*) . $arg ;; |
2212 |
*) . ./$arg ;; |
2213 |
esac |
2214 |
|
2215 |
if test -z "$pic_object" || \ |
2216 |
test -z "$non_pic_object" || |
2217 |
test "$pic_object" = none && \ |
2218 |
test "$non_pic_object" = none; then |
2219 |
$echo "$modename: cannot find name of object for \`$arg'" 1>&2 |
2220 |
exit $EXIT_FAILURE |
2221 |
fi |
2222 |
|
2223 |
# Extract subdirectory from the argument. |
2224 |
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
2225 |
if test "X$xdir" = "X$arg"; then |
2226 |
xdir= |
2227 |
else |
2228 |
xdir="$xdir/" |
2229 |
fi |
2230 |
|
2231 |
if test "$pic_object" != none; then |
2232 |
# Prepend the subdirectory the object is found in. |
2233 |
pic_object="$xdir$pic_object" |
2234 |
|
2235 |
if test "$prev" = dlfiles; then |
2236 |
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then |
2237 |
dlfiles="$dlfiles $pic_object" |
2238 |
prev= |
2239 |
continue |
2240 |
else |
2241 |
# If libtool objects are unsupported, then we need to preload. |
2242 |
prev=dlprefiles |
2243 |
fi |
2244 |
fi |
2245 |
|
2246 |
# CHECK ME: I think I busted this. -Ossama |
2247 |
if test "$prev" = dlprefiles; then |
2248 |
# Preload the old-style object. |
2249 |
dlprefiles="$dlprefiles $pic_object" |
2250 |
prev= |
2251 |
fi |
2252 |
|
2253 |
# A PIC object. |
2254 |
libobjs="$libobjs $pic_object" |
2255 |
arg="$pic_object" |
2256 |
fi |
2257 |
|
2258 |
# Non-PIC object. |
2259 |
if test "$non_pic_object" != none; then |
2260 |
# Prepend the subdirectory the object is found in. |
2261 |
non_pic_object="$xdir$non_pic_object" |
2262 |
|
2263 |
# A standard non-PIC object |
2264 |
non_pic_objects="$non_pic_objects $non_pic_object" |
2265 |
if test -z "$pic_object" || test "$pic_object" = none ; then |
2266 |
arg="$non_pic_object" |
2267 |
fi |
2268 |
else |
2269 |
# If the PIC object exists, use it instead. |
2270 |
# $xdir was prepended to $pic_object above. |
2271 |
non_pic_object="$pic_object" |
2272 |
non_pic_objects="$non_pic_objects $non_pic_object" |
2273 |
fi |
2274 |
else |
2275 |
# Only an error if not doing a dry-run. |
2276 |
if test -z "$run"; then |
2277 |
$echo "$modename: \`$arg' is not a valid libtool object" 1>&2 |
2278 |
exit $EXIT_FAILURE |
2279 |
else |
2280 |
# Dry-run case. |
2281 |
|
2282 |
# Extract subdirectory from the argument. |
2283 |
xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
2284 |
if test "X$xdir" = "X$arg"; then |
2285 |
xdir= |
2286 |
else |
2287 |
xdir="$xdir/" |
2288 |
fi |
2289 |
|
2290 |
pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` |
2291 |
non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` |
2292 |
libobjs="$libobjs $pic_object" |
2293 |
non_pic_objects="$non_pic_objects $non_pic_object" |
2294 |
fi |
2295 |
fi |
2296 |
;; |
2297 |
|
2298 |
*.$libext) |
2299 |
# An archive. |
2300 |
deplibs="$deplibs $arg" |
2301 |
old_deplibs="$old_deplibs $arg" |
2302 |
continue |
2303 |
;; |
2304 |
|
2305 |
*.la) |
2306 |
# A libtool-controlled library. |
2307 |
|
2308 |
if test "$prev" = dlfiles; then |
2309 |
# This library was specified with -dlopen. |
2310 |
dlfiles="$dlfiles $arg" |
2311 |
prev= |
2312 |
elif test "$prev" = dlprefiles; then |
2313 |
# The library was specified with -dlpreopen. |
2314 |
dlprefiles="$dlprefiles $arg" |
2315 |
prev= |
2316 |
else |
2317 |
deplibs="$deplibs $arg" |
2318 |
fi |
2319 |
continue |
2320 |
;; |
2321 |
|
2322 |
# Some other compiler argument. |
2323 |
*) |
2324 |
# Unknown arguments in both finalize_command and compile_command need |
2325 |
# to be aesthetically quoted because they are evaled later. |
2326 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
2327 |
case $arg in |
2328 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
2329 |
arg="\"$arg\"" |
2330 |
;; |
2331 |
esac |
2332 |
;; |
2333 |
esac # arg |
2334 |
|
2335 |
# Now actually substitute the argument into the commands. |
2336 |
if test -n "$arg"; then |
2337 |
compile_command="$compile_command $arg" |
2338 |
finalize_command="$finalize_command $arg" |
2339 |
fi |
2340 |
done # argument parsing loop |
2341 |
|
2342 |
if test -n "$prev"; then |
2343 |
$echo "$modename: the \`$prevarg' option requires an argument" 1>&2 |
2344 |
$echo "$help" 1>&2 |
2345 |
exit $EXIT_FAILURE |
2346 |
fi |
2347 |
|
2348 |
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then |
2349 |
eval arg=\"$export_dynamic_flag_spec\" |
2350 |
compile_command="$compile_command $arg" |
2351 |
finalize_command="$finalize_command $arg" |
2352 |
fi |
2353 |
|
2354 |
oldlibs= |
2355 |
# calculate the name of the file, without its directory |
2356 |
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` |
2357 |
libobjs_save="$libobjs" |
2358 |
|
2359 |
if test -n "$shlibpath_var"; then |
2360 |
# get the directories listed in $shlibpath_var |
2361 |
eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` |
2362 |
else |
2363 |
shlib_search_path= |
2364 |
fi |
2365 |
eval sys_lib_search_path=\"$sys_lib_search_path_spec\" |
2366 |
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" |
2367 |
|
2368 |
output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` |
2369 |
if test "X$output_objdir" = "X$output"; then |
2370 |
output_objdir="$objdir" |
2371 |
else |
2372 |
output_objdir="$output_objdir/$objdir" |
2373 |
fi |
2374 |
# Create the object directory. |
2375 |
if test ! -d "$output_objdir"; then |
2376 |
$show "$mkdir $output_objdir" |
2377 |
$run $mkdir $output_objdir |
2378 |
exit_status=$? |
2379 |
if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then |
2380 |
exit $exit_status |
2381 |
fi |
2382 |
fi |
2383 |
|
2384 |
# Determine the type of output |
2385 |
case $output in |
2386 |
"") |
2387 |
$echo "$modename: you must specify an output file" 1>&2 |
2388 |
$echo "$help" 1>&2 |
2389 |
exit $EXIT_FAILURE |
2390 |
;; |
2391 |
*.$libext) linkmode=oldlib ;; |
2392 |
*.lo | *.$objext) linkmode=obj ;; |
2393 |
*.la) linkmode=lib ;; |
2394 |
*) linkmode=prog ;; # Anything else should be a program. |
2395 |
esac |
2396 |
|
2397 |
case $host in |
2398 |
*cygwin* | *mingw* | *pw32*) |
2399 |
# don't eliminate duplications in $postdeps and $predeps |
2400 |
duplicate_compiler_generated_deps=yes |
2401 |
;; |
2402 |
*) |
2403 |
duplicate_compiler_generated_deps=$duplicate_deps |
2404 |
;; |
2405 |
esac |
2406 |
specialdeplibs= |
2407 |
|
2408 |
libs= |
2409 |
# Find all interdependent deplibs by searching for libraries |
2410 |
# that are linked more than once (e.g. -la -lb -la) |
2411 |
for deplib in $deplibs; do |
2412 |
if test "X$duplicate_deps" = "Xyes" ; then |
2413 |
case "$libs " in |
2414 |
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
2415 |
esac |
2416 |
fi |
2417 |
libs="$libs $deplib" |
2418 |
done |
2419 |
|
2420 |
if test "$linkmode" = lib; then |
2421 |
libs="$predeps $libs $compiler_lib_search_path $postdeps" |
2422 |
|
2423 |
# Compute libraries that are listed more than once in $predeps |
2424 |
# $postdeps and mark them as special (i.e., whose duplicates are |
2425 |
# not to be eliminated). |
2426 |
pre_post_deps= |
2427 |
if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then |
2428 |
for pre_post_dep in $predeps $postdeps; do |
2429 |
case "$pre_post_deps " in |
2430 |
*" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; |
2431 |
esac |
2432 |
pre_post_deps="$pre_post_deps $pre_post_dep" |
2433 |
done |
2434 |
fi |
2435 |
pre_post_deps= |
2436 |
fi |
2437 |
|
2438 |
deplibs= |
2439 |
newdependency_libs= |
2440 |
newlib_search_path= |
2441 |
need_relink=no # whether we're linking any uninstalled libtool libraries |
2442 |
notinst_deplibs= # not-installed libtool libraries |
2443 |
case $linkmode in |
2444 |
lib) |
2445 |
passes="conv link" |
2446 |
for file in $dlfiles $dlprefiles; do |
2447 |
case $file in |
2448 |
*.la) ;; |
2449 |
*) |
2450 |
$echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 |
2451 |
exit $EXIT_FAILURE |
2452 |
;; |
2453 |
esac |
2454 |
done |
2455 |
;; |
2456 |
prog) |
2457 |
compile_deplibs= |
2458 |
finalize_deplibs= |
2459 |
alldeplibs=no |
2460 |
newdlfiles= |
2461 |
newdlprefiles= |
2462 |
passes="conv scan dlopen dlpreopen link" |
2463 |
;; |
2464 |
*) passes="conv" |
2465 |
;; |
2466 |
esac |
2467 |
for pass in $passes; do |
2468 |
if test "$linkmode,$pass" = "lib,link" || |
2469 |
test "$linkmode,$pass" = "prog,scan"; then |
2470 |
libs="$deplibs" |
2471 |
deplibs= |
2472 |
fi |
2473 |
if test "$linkmode" = prog; then |
2474 |
case $pass in |
2475 |
dlopen) libs="$dlfiles" ;; |
2476 |
dlpreopen) libs="$dlprefiles" ;; |
2477 |
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; |
2478 |
esac |
2479 |
fi |
2480 |
if test "$pass" = dlopen; then |
2481 |
# Collect dlpreopened libraries |
2482 |
save_deplibs="$deplibs" |
2483 |
deplibs= |
2484 |
fi |
2485 |
for deplib in $libs; do |
2486 |
lib= |
2487 |
found=no |
2488 |
case $deplib in |
2489 |
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) |
2490 |
if test "$linkmode,$pass" = "prog,link"; then |
2491 |
compile_deplibs="$deplib $compile_deplibs" |
2492 |
finalize_deplibs="$deplib $finalize_deplibs" |
2493 |
else |
2494 |
compiler_flags="$compiler_flags $deplib" |
2495 |
fi |
2496 |
continue |
2497 |
;; |
2498 |
-l*) |
2499 |
if test "$linkmode" != lib && test "$linkmode" != prog; then |
2500 |
$echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 |
2501 |
continue |
2502 |
fi |
2503 |
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
2504 |
for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do |
2505 |
for search_ext in .la $std_shrext .so .a; do |
2506 |
# Search the libtool library |
2507 |
lib="$searchdir/lib${name}${search_ext}" |
2508 |
if test -f "$lib"; then |
2509 |
if test "$search_ext" = ".la"; then |
2510 |
found=yes |
2511 |
else |
2512 |
found=no |
2513 |
fi |
2514 |
break 2 |
2515 |
fi |
2516 |
done |
2517 |
done |
2518 |
if test "$found" != yes; then |
2519 |
# deplib doesn't seem to be a libtool library |
2520 |
if test "$linkmode,$pass" = "prog,link"; then |
2521 |
compile_deplibs="$deplib $compile_deplibs" |
2522 |
finalize_deplibs="$deplib $finalize_deplibs" |
2523 |
else |
2524 |
deplibs="$deplib $deplibs" |
2525 |
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" |
2526 |
fi |
2527 |
continue |
2528 |
else # deplib is a libtool library |
2529 |
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, |
2530 |
# We need to do some special things here, and not later. |
2531 |
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
2532 |
case " $predeps $postdeps " in |
2533 |
*" $deplib "*) |
2534 |
if (${SED} -e '2q' $lib | |
2535 |
grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
2536 |
library_names= |
2537 |
old_library= |
2538 |
case $lib in |
2539 |
*/* | *\\*) . $lib ;; |
2540 |
*) . ./$lib ;; |
2541 |
esac |
2542 |
for l in $old_library $library_names; do |
2543 |
ll="$l" |
2544 |
done |
2545 |
if test "X$ll" = "X$old_library" ; then # only static version available |
2546 |
found=no |
2547 |
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` |
2548 |
test "X$ladir" = "X$lib" && ladir="." |
2549 |
lib=$ladir/$old_library |
2550 |
if test "$linkmode,$pass" = "prog,link"; then |
2551 |
compile_deplibs="$deplib $compile_deplibs" |
2552 |
finalize_deplibs="$deplib $finalize_deplibs" |
2553 |
else |
2554 |
deplibs="$deplib $deplibs" |
2555 |
test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" |
2556 |
fi |
2557 |
continue |
2558 |
fi |
2559 |
fi |
2560 |
;; |
2561 |
*) ;; |
2562 |
esac |
2563 |
fi |
2564 |
fi |
2565 |
;; # -l |
2566 |
-L*) |
2567 |
case $linkmode in |
2568 |
lib) |
2569 |
deplibs="$deplib $deplibs" |
2570 |
test "$pass" = conv && continue |
2571 |
newdependency_libs="$deplib $newdependency_libs" |
2572 |
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
2573 |
;; |
2574 |
prog) |
2575 |
if test "$pass" = conv; then |
2576 |
deplibs="$deplib $deplibs" |
2577 |
continue |
2578 |
fi |
2579 |
if test "$pass" = scan; then |
2580 |
deplibs="$deplib $deplibs" |
2581 |
else |
2582 |
compile_deplibs="$deplib $compile_deplibs" |
2583 |
finalize_deplibs="$deplib $finalize_deplibs" |
2584 |
fi |
2585 |
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
2586 |
;; |
2587 |
*) |
2588 |
$echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 |
2589 |
;; |
2590 |
esac # linkmode |
2591 |
continue |
2592 |
;; # -L |
2593 |
-R*) |
2594 |
if test "$pass" = link; then |
2595 |
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` |
2596 |
# Make sure the xrpath contains only unique directories. |
2597 |
case "$xrpath " in |
2598 |
*" $dir "*) ;; |
2599 |
*) xrpath="$xrpath $dir" ;; |
2600 |
esac |
2601 |
fi |
2602 |
deplibs="$deplib $deplibs" |
2603 |
continue |
2604 |
;; |
2605 |
*.la) lib="$deplib" ;; |
2606 |
*.$libext) |
2607 |
if test "$pass" = conv; then |
2608 |
deplibs="$deplib $deplibs" |
2609 |
continue |
2610 |
fi |
2611 |
case $linkmode in |
2612 |
lib) |
2613 |
valid_a_lib=no |
2614 |
case $deplibs_check_method in |
2615 |
match_pattern*) |
2616 |
set dummy $deplibs_check_method |
2617 |
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
2618 |
if eval $echo \"$deplib\" 2>/dev/null \ |
2619 |
| $SED 10q \ |
2620 |
| $EGREP "$match_pattern_regex" > /dev/null; then |
2621 |
valid_a_lib=yes |
2622 |
fi |
2623 |
;; |
2624 |
pass_all) |
2625 |
valid_a_lib=yes |
2626 |
;; |
2627 |
esac |
2628 |
if test "$valid_a_lib" != yes; then |
2629 |
$echo |
2630 |
$echo "*** Warning: Trying to link with static lib archive $deplib." |
2631 |
$echo "*** I have the capability to make that library automatically link in when" |
2632 |
$echo "*** you link to this library. But I can only do this if you have a" |
2633 |
$echo "*** shared version of the library, which you do not appear to have" |
2634 |
$echo "*** because the file extensions .$libext of this argument makes me believe" |
2635 |
$echo "*** that it is just a static archive that I should not used here." |
2636 |
else |
2637 |
$echo |
2638 |
$echo "*** Warning: Linking the shared library $output against the" |
2639 |
$echo "*** static library $deplib is not portable!" |
2640 |
deplibs="$deplib $deplibs" |
2641 |
fi |
2642 |
continue |
2643 |
;; |
2644 |
prog) |
2645 |
if test "$pass" != link; then |
2646 |
deplibs="$deplib $deplibs" |
2647 |
else |
2648 |
compile_deplibs="$deplib $compile_deplibs" |
2649 |
finalize_deplibs="$deplib $finalize_deplibs" |
2650 |
fi |
2651 |
continue |
2652 |
;; |
2653 |
esac # linkmode |
2654 |
;; # *.$libext |
2655 |
*.lo | *.$objext) |
2656 |
if test "$pass" = conv; then |
2657 |
deplibs="$deplib $deplibs" |
2658 |
elif test "$linkmode" = prog; then |
2659 |
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then |
2660 |
# If there is no dlopen support or we're linking statically, |
2661 |
# we need to preload. |
2662 |
newdlprefiles="$newdlprefiles $deplib" |
2663 |
compile_deplibs="$deplib $compile_deplibs" |
2664 |
finalize_deplibs="$deplib $finalize_deplibs" |
2665 |
else |
2666 |
newdlfiles="$newdlfiles $deplib" |
2667 |
fi |
2668 |
fi |
2669 |
continue |
2670 |
;; |
2671 |
%DEPLIBS%) |
2672 |
alldeplibs=yes |
2673 |
continue |
2674 |
;; |
2675 |
esac # case $deplib |
2676 |
if test "$found" = yes || test -f "$lib"; then : |
2677 |
else |
2678 |
$echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 |
2679 |
exit $EXIT_FAILURE |
2680 |
fi |
2681 |
|
2682 |
# Check to see that this really is a libtool archive. |
2683 |
if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
2684 |
else |
2685 |
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
2686 |
exit $EXIT_FAILURE |
2687 |
fi |
2688 |
|
2689 |
ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` |
2690 |
test "X$ladir" = "X$lib" && ladir="." |
2691 |
|
2692 |
dlname= |
2693 |
dlopen= |
2694 |
dlpreopen= |
2695 |
libdir= |
2696 |
library_names= |
2697 |
old_library= |
2698 |
# If the library was installed with an old release of libtool, |
2699 |
# it will not redefine variables installed, or shouldnotlink |
2700 |
installed=yes |
2701 |
shouldnotlink=no |
2702 |
avoidtemprpath= |
2703 |
|
2704 |
|
2705 |
# Read the .la file |
2706 |
case $lib in |
2707 |
*/* | *\\*) . $lib ;; |
2708 |
*) . ./$lib ;; |
2709 |
esac |
2710 |
|
2711 |
if test "$linkmode,$pass" = "lib,link" || |
2712 |
test "$linkmode,$pass" = "prog,scan" || |
2713 |
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then |
2714 |
test -n "$dlopen" && dlfiles="$dlfiles $dlopen" |
2715 |
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" |
2716 |
fi |
2717 |
|
2718 |
if test "$pass" = conv; then |
2719 |
# Only check for convenience libraries |
2720 |
deplibs="$lib $deplibs" |
2721 |
if test -z "$libdir"; then |
2722 |
if test -z "$old_library"; then |
2723 |
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
2724 |
exit $EXIT_FAILURE |
2725 |
fi |
2726 |
# It is a libtool convenience library, so add in its objects. |
2727 |
convenience="$convenience $ladir/$objdir/$old_library" |
2728 |
old_convenience="$old_convenience $ladir/$objdir/$old_library" |
2729 |
tmp_libs= |
2730 |
for deplib in $dependency_libs; do |
2731 |
deplibs="$deplib $deplibs" |
2732 |
if test "X$duplicate_deps" = "Xyes" ; then |
2733 |
case "$tmp_libs " in |
2734 |
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
2735 |
esac |
2736 |
fi |
2737 |
tmp_libs="$tmp_libs $deplib" |
2738 |
done |
2739 |
elif test "$linkmode" != prog && test "$linkmode" != lib; then |
2740 |
$echo "$modename: \`$lib' is not a convenience library" 1>&2 |
2741 |
exit $EXIT_FAILURE |
2742 |
fi |
2743 |
continue |
2744 |
fi # $pass = conv |
2745 |
|
2746 |
|
2747 |
# Get the name of the library we link against. |
2748 |
linklib= |
2749 |
for l in $old_library $library_names; do |
2750 |
linklib="$l" |
2751 |
done |
2752 |
if test -z "$linklib"; then |
2753 |
$echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
2754 |
exit $EXIT_FAILURE |
2755 |
fi |
2756 |
|
2757 |
# This library was specified with -dlopen. |
2758 |
if test "$pass" = dlopen; then |
2759 |
if test -z "$libdir"; then |
2760 |
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 |
2761 |
exit $EXIT_FAILURE |
2762 |
fi |
2763 |
if test -z "$dlname" || |
2764 |
test "$dlopen_support" != yes || |
2765 |
test "$build_libtool_libs" = no; then |
2766 |
# If there is no dlname, no dlopen support or we're linking |
2767 |
# statically, we need to preload. We also need to preload any |
2768 |
# dependent libraries so libltdl's deplib preloader doesn't |
2769 |
# bomb out in the load deplibs phase. |
2770 |
dlprefiles="$dlprefiles $lib $dependency_libs" |
2771 |
else |
2772 |
newdlfiles="$newdlfiles $lib" |
2773 |
fi |
2774 |
continue |
2775 |
fi # $pass = dlopen |
2776 |
|
2777 |
# We need an absolute path. |
2778 |
case $ladir in |
2779 |
[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; |
2780 |
*) |
2781 |
abs_ladir=`cd "$ladir" && pwd` |
2782 |
if test -z "$abs_ladir"; then |
2783 |
$echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 |
2784 |
$echo "$modename: passing it literally to the linker, although it might fail" 1>&2 |
2785 |
abs_ladir="$ladir" |
2786 |
fi |
2787 |
;; |
2788 |
esac |
2789 |
laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
2790 |
|
2791 |
# Find the relevant object directory and library name. |
2792 |
if test "X$installed" = Xyes; then |
2793 |
if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then |
2794 |
$echo "$modename: warning: library \`$lib' was moved." 1>&2 |
2795 |
dir="$ladir" |
2796 |
absdir="$abs_ladir" |
2797 |
libdir="$abs_ladir" |
2798 |
else |
2799 |
dir="$libdir" |
2800 |
absdir="$libdir" |
2801 |
fi |
2802 |
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes |
2803 |
else |
2804 |
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then |
2805 |
dir="$ladir" |
2806 |
absdir="$abs_ladir" |
2807 |
# Remove this search path later |
2808 |
notinst_path="$notinst_path $abs_ladir" |
2809 |
else |
2810 |
dir="$ladir/$objdir" |
2811 |
absdir="$abs_ladir/$objdir" |
2812 |
# Remove this search path later |
2813 |
notinst_path="$notinst_path $abs_ladir" |
2814 |
fi |
2815 |
fi # $installed = yes |
2816 |
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
2817 |
|
2818 |
# This library was specified with -dlpreopen. |
2819 |
if test "$pass" = dlpreopen; then |
2820 |
if test -z "$libdir"; then |
2821 |
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 |
2822 |
exit $EXIT_FAILURE |
2823 |
fi |
2824 |
# Prefer using a static library (so that no silly _DYNAMIC symbols |
2825 |
# are required to link). |
2826 |
if test -n "$old_library"; then |
2827 |
newdlprefiles="$newdlprefiles $dir/$old_library" |
2828 |
# Otherwise, use the dlname, so that lt_dlopen finds it. |
2829 |
elif test -n "$dlname"; then |
2830 |
newdlprefiles="$newdlprefiles $dir/$dlname" |
2831 |
else |
2832 |
newdlprefiles="$newdlprefiles $dir/$linklib" |
2833 |
fi |
2834 |
fi # $pass = dlpreopen |
2835 |
|
2836 |
if test -z "$libdir"; then |
2837 |
# Link the convenience library |
2838 |
if test "$linkmode" = lib; then |
2839 |
deplibs="$dir/$old_library $deplibs" |
2840 |
elif test "$linkmode,$pass" = "prog,link"; then |
2841 |
compile_deplibs="$dir/$old_library $compile_deplibs" |
2842 |
finalize_deplibs="$dir/$old_library $finalize_deplibs" |
2843 |
else |
2844 |
deplibs="$lib $deplibs" # used for prog,scan pass |
2845 |
fi |
2846 |
continue |
2847 |
fi |
2848 |
|
2849 |
|
2850 |
if test "$linkmode" = prog && test "$pass" != link; then |
2851 |
newlib_search_path="$newlib_search_path $ladir" |
2852 |
deplibs="$lib $deplibs" |
2853 |
|
2854 |
linkalldeplibs=no |
2855 |
if test "$link_all_deplibs" != no || test -z "$library_names" || |
2856 |
test "$build_libtool_libs" = no; then |
2857 |
linkalldeplibs=yes |
2858 |
fi |
2859 |
|
2860 |
tmp_libs= |
2861 |
for deplib in $dependency_libs; do |
2862 |
case $deplib in |
2863 |
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test |
2864 |
esac |
2865 |
# Need to link against all dependency_libs? |
2866 |
if test "$linkalldeplibs" = yes; then |
2867 |
deplibs="$deplib $deplibs" |
2868 |
else |
2869 |
# Need to hardcode shared library paths |
2870 |
# or/and link against static libraries |
2871 |
newdependency_libs="$deplib $newdependency_libs" |
2872 |
fi |
2873 |
if test "X$duplicate_deps" = "Xyes" ; then |
2874 |
case "$tmp_libs " in |
2875 |
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
2876 |
esac |
2877 |
fi |
2878 |
tmp_libs="$tmp_libs $deplib" |
2879 |
done # for deplib |
2880 |
continue |
2881 |
fi # $linkmode = prog... |
2882 |
|
2883 |
if test "$linkmode,$pass" = "prog,link"; then |
2884 |
if test -n "$library_names" && |
2885 |
{ { test "$prefer_static_libs" = no || |
2886 |
test "$prefer_static_libs,$installed" = "built,yes"; } || |
2887 |
test -z "$old_library"; }; then |
2888 |
# We need to hardcode the library path |
2889 |
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then |
2890 |
# Make sure the rpath contains only unique directories. |
2891 |
case "$temp_rpath " in |
2892 |
*" $dir "*) ;; |
2893 |
*" $absdir "*) ;; |
2894 |
*) temp_rpath="$temp_rpath $absdir" ;; |
2895 |
esac |
2896 |
fi |
2897 |
|
2898 |
# Hardcode the library path. |
2899 |
# Skip directories that are in the system default run-time |
2900 |
# search path. |
2901 |
case " $sys_lib_dlsearch_path " in |
2902 |
*" $absdir "*) ;; |
2903 |
*) |
2904 |
case "$compile_rpath " in |
2905 |
*" $absdir "*) ;; |
2906 |
*) compile_rpath="$compile_rpath $absdir" |
2907 |
esac |
2908 |
;; |
2909 |
esac |
2910 |
case " $sys_lib_dlsearch_path " in |
2911 |
*" $libdir "*) ;; |
2912 |
*) |
2913 |
case "$finalize_rpath " in |
2914 |
*" $libdir "*) ;; |
2915 |
*) finalize_rpath="$finalize_rpath $libdir" |
2916 |
esac |
2917 |
;; |
2918 |
esac |
2919 |
fi # $linkmode,$pass = prog,link... |
2920 |
|
2921 |
if test "$alldeplibs" = yes && |
2922 |
{ test "$deplibs_check_method" = pass_all || |
2923 |
{ test "$build_libtool_libs" = yes && |
2924 |
test -n "$library_names"; }; }; then |
2925 |
# We only need to search for static libraries |
2926 |
continue |
2927 |
fi |
2928 |
fi |
2929 |
|
2930 |
link_static=no # Whether the deplib will be linked statically |
2931 |
use_static_libs=$prefer_static_libs |
2932 |
if test "$use_static_libs" = built && test "$installed" = yes ; then |
2933 |
use_static_libs=no |
2934 |
fi |
2935 |
if test -n "$library_names" && |
2936 |
{ test "$use_static_libs" = no || test -z "$old_library"; }; then |
2937 |
if test "$installed" = no; then |
2938 |
notinst_deplibs="$notinst_deplibs $lib" |
2939 |
need_relink=yes |
2940 |
fi |
2941 |
# This is a shared library |
2942 |
|
2943 |
# Warn about portability, can't link against -module's on |
2944 |
# some systems (darwin) |
2945 |
if test "$shouldnotlink" = yes && test "$pass" = link ; then |
2946 |
$echo |
2947 |
if test "$linkmode" = prog; then |
2948 |
$echo "*** Warning: Linking the executable $output against the loadable module" |
2949 |
else |
2950 |
$echo "*** Warning: Linking the shared library $output against the loadable module" |
2951 |
fi |
2952 |
$echo "*** $linklib is not portable!" |
2953 |
fi |
2954 |
if test "$linkmode" = lib && |
2955 |
test "$hardcode_into_libs" = yes; then |
2956 |
# Hardcode the library path. |
2957 |
# Skip directories that are in the system default run-time |
2958 |
# search path. |
2959 |
case " $sys_lib_dlsearch_path " in |
2960 |
*" $absdir "*) ;; |
2961 |
*) |
2962 |
case "$compile_rpath " in |
2963 |
*" $absdir "*) ;; |
2964 |
*) compile_rpath="$compile_rpath $absdir" |
2965 |
esac |
2966 |
;; |
2967 |
esac |
2968 |
case " $sys_lib_dlsearch_path " in |
2969 |
*" $libdir "*) ;; |
2970 |
*) |
2971 |
case "$finalize_rpath " in |
2972 |
*" $libdir "*) ;; |
2973 |
*) finalize_rpath="$finalize_rpath $libdir" |
2974 |
esac |
2975 |
;; |
2976 |
esac |
2977 |
fi |
2978 |
|
2979 |
if test -n "$old_archive_from_expsyms_cmds"; then |
2980 |
# figure out the soname |
2981 |
set dummy $library_names |
2982 |
realname="$2" |
2983 |
shift; shift |
2984 |
libname=`eval \\$echo \"$libname_spec\"` |
2985 |
# use dlname if we got it. it's perfectly good, no? |
2986 |
if test -n "$dlname"; then |
2987 |
soname="$dlname" |
2988 |
elif test -n "$soname_spec"; then |
2989 |
# bleh windows |
2990 |
case $host in |
2991 |
*cygwin* | mingw*) |
2992 |
major=`expr $current - $age` |
2993 |
versuffix="-$major" |
2994 |
;; |
2995 |
esac |
2996 |
eval soname=\"$soname_spec\" |
2997 |
else |
2998 |
soname="$realname" |
2999 |
fi |
3000 |
|
3001 |
# Make a new name for the extract_expsyms_cmds to use |
3002 |
soroot="$soname" |
3003 |
soname=`$echo $soroot | ${SED} -e 's/^.*\///'` |
3004 |
newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" |
3005 |
|
3006 |
# If the library has no export list, then create one now |
3007 |
if test -f "$output_objdir/$soname-def"; then : |
3008 |
else |
3009 |
$show "extracting exported symbol list from \`$soname'" |
3010 |
save_ifs="$IFS"; IFS='~' |
3011 |
cmds=$extract_expsyms_cmds |
3012 |
for cmd in $cmds; do |
3013 |
IFS="$save_ifs" |
3014 |
eval cmd=\"$cmd\" |
3015 |
$show "$cmd" |
3016 |
$run eval "$cmd" || exit $? |
3017 |
done |
3018 |
IFS="$save_ifs" |
3019 |
fi |
3020 |
|
3021 |
# Create $newlib |
3022 |
if test -f "$output_objdir/$newlib"; then :; else |
3023 |
$show "generating import library for \`$soname'" |
3024 |
save_ifs="$IFS"; IFS='~' |
3025 |
cmds=$old_archive_from_expsyms_cmds |
3026 |
for cmd in $cmds; do |
3027 |
IFS="$save_ifs" |
3028 |
eval cmd=\"$cmd\" |
3029 |
$show "$cmd" |
3030 |
$run eval "$cmd" || exit $? |
3031 |
done |
3032 |
IFS="$save_ifs" |
3033 |
fi |
3034 |
# make sure the library variables are pointing to the new library |
3035 |
dir=$output_objdir |
3036 |
linklib=$newlib |
3037 |
fi # test -n "$old_archive_from_expsyms_cmds" |
3038 |
|
3039 |
if test "$linkmode" = prog || test "$mode" != relink; then |
3040 |
add_shlibpath= |
3041 |
add_dir= |
3042 |
add= |
3043 |
lib_linked=yes |
3044 |
case $hardcode_action in |
3045 |
immediate | unsupported) |
3046 |
if test "$hardcode_direct" = no; then |
3047 |
add="$dir/$linklib" |
3048 |
case $host in |
3049 |
*-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; |
3050 |
*-*-sysv4*uw2*) add_dir="-L$dir" ;; |
3051 |
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ |
3052 |
*-*-unixware7*) add_dir="-L$dir" ;; |
3053 |
*-*-darwin* ) |
3054 |
# if the lib is a module then we can not link against |
3055 |
# it, someone is ignoring the new warnings I added |
3056 |
if /usr/bin/file -L $add 2> /dev/null | |
3057 |
$EGREP ": [^:]* bundle" >/dev/null ; then |
3058 |
$echo "** Warning, lib $linklib is a module, not a shared library" |
3059 |
if test -z "$old_library" ; then |
3060 |
$echo |
3061 |
$echo "** And there doesn't seem to be a static archive available" |
3062 |
$echo "** The link will probably fail, sorry" |
3063 |
else |
3064 |
add="$dir/$old_library" |
3065 |
fi |
3066 |
fi |
3067 |
esac |
3068 |
elif test "$hardcode_minus_L" = no; then |
3069 |
case $host in |
3070 |
*-*-sunos*) add_shlibpath="$dir" ;; |
3071 |
esac |
3072 |
add_dir="-L$dir" |
3073 |
add="-l$name" |
3074 |
elif test "$hardcode_shlibpath_var" = no; then |
3075 |
add_shlibpath="$dir" |
3076 |
add="-l$name" |
3077 |
else |
3078 |
lib_linked=no |
3079 |
fi |
3080 |
;; |
3081 |
relink) |
3082 |
if test "$hardcode_direct" = yes; then |
3083 |
add="$dir/$linklib" |
3084 |
elif test "$hardcode_minus_L" = yes; then |
3085 |
add_dir="-L$dir" |
3086 |
# Try looking first in the location we're being installed to. |
3087 |
if test -n "$inst_prefix_dir"; then |
3088 |
case $libdir in |
3089 |
[\\/]*) |
3090 |
add_dir="$add_dir -L$inst_prefix_dir$libdir" |
3091 |
;; |
3092 |
esac |
3093 |
fi |
3094 |
add="-l$name" |
3095 |
elif test "$hardcode_shlibpath_var" = yes; then |
3096 |
add_shlibpath="$dir" |
3097 |
add="-l$name" |
3098 |
else |
3099 |
lib_linked=no |
3100 |
fi |
3101 |
;; |
3102 |
*) lib_linked=no ;; |
3103 |
esac |
3104 |
|
3105 |
if test "$lib_linked" != yes; then |
3106 |
$echo "$modename: configuration error: unsupported hardcode properties" |
3107 |
exit $EXIT_FAILURE |
3108 |
fi |
3109 |
|
3110 |
if test -n "$add_shlibpath"; then |
3111 |
case :$compile_shlibpath: in |
3112 |
*":$add_shlibpath:"*) ;; |
3113 |
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; |
3114 |
esac |
3115 |
fi |
3116 |
if test "$linkmode" = prog; then |
3117 |
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" |
3118 |
test -n "$add" && compile_deplibs="$add $compile_deplibs" |
3119 |
else |
3120 |
test -n "$add_dir" && deplibs="$add_dir $deplibs" |
3121 |
test -n "$add" && deplibs="$add $deplibs" |
3122 |
if test "$hardcode_direct" != yes && \ |
3123 |
test "$hardcode_minus_L" != yes && \ |
3124 |
test "$hardcode_shlibpath_var" = yes; then |
3125 |
case :$finalize_shlibpath: in |
3126 |
*":$libdir:"*) ;; |
3127 |
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; |
3128 |
esac |
3129 |
fi |
3130 |
fi |
3131 |
fi |
3132 |
|
3133 |
if test "$linkmode" = prog || test "$mode" = relink; then |
3134 |
add_shlibpath= |
3135 |
add_dir= |
3136 |
add= |
3137 |
# Finalize command for both is simple: just hardcode it. |
3138 |
if test "$hardcode_direct" = yes; then |
3139 |
add="$libdir/$linklib" |
3140 |
elif test "$hardcode_minus_L" = yes; then |
3141 |
add_dir="-L$libdir" |
3142 |
add="-l$name" |
3143 |
elif test "$hardcode_shlibpath_var" = yes; then |
3144 |
case :$finalize_shlibpath: in |
3145 |
*":$libdir:"*) ;; |
3146 |
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; |
3147 |
esac |
3148 |
add="-l$name" |
3149 |
elif test "$hardcode_automatic" = yes; then |
3150 |
if test -n "$inst_prefix_dir" && |
3151 |
test -f "$inst_prefix_dir$libdir/$linklib" ; then |
3152 |
add="$inst_prefix_dir$libdir/$linklib" |
3153 |
else |
3154 |
add="$libdir/$linklib" |
3155 |
fi |
3156 |
else |
3157 |
# We cannot seem to hardcode it, guess we'll fake it. |
3158 |
add_dir="-L$libdir" |
3159 |
# Try looking first in the location we're being installed to. |
3160 |
if test -n "$inst_prefix_dir"; then |
3161 |
case $libdir in |
3162 |
[\\/]*) |
3163 |
add_dir="$add_dir -L$inst_prefix_dir$libdir" |
3164 |
;; |
3165 |
esac |
3166 |
fi |
3167 |
add="-l$name" |
3168 |
fi |
3169 |
|
3170 |
if test "$linkmode" = prog; then |
3171 |
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" |
3172 |
test -n "$add" && finalize_deplibs="$add $finalize_deplibs" |
3173 |
else |
3174 |
test -n "$add_dir" && deplibs="$add_dir $deplibs" |
3175 |
test -n "$add" && deplibs="$add $deplibs" |
3176 |
fi |
3177 |
fi |
3178 |
elif test "$linkmode" = prog; then |
3179 |
# Here we assume that one of hardcode_direct or hardcode_minus_L |
3180 |
# is not unsupported. This is valid on all known static and |
3181 |
# shared platforms. |
3182 |
if test "$hardcode_direct" != unsupported; then |
3183 |
test -n "$old_library" && linklib="$old_library" |
3184 |
compile_deplibs="$dir/$linklib $compile_deplibs" |
3185 |
finalize_deplibs="$dir/$linklib $finalize_deplibs" |
3186 |
else |
3187 |
compile_deplibs="-l$name -L$dir $compile_deplibs" |
3188 |
finalize_deplibs="-l$name -L$dir $finalize_deplibs" |
3189 |
fi |
3190 |
elif test "$build_libtool_libs" = yes; then |
3191 |
# Not a shared library |
3192 |
if test "$deplibs_check_method" != pass_all; then |
3193 |
# We're trying link a shared library against a static one |
3194 |
# but the system doesn't support it. |
3195 |
|
3196 |
# Just print a warning and add the library to dependency_libs so |
3197 |
# that the program can be linked against the static library. |
3198 |
$echo |
3199 |
$echo "*** Warning: This system can not link to static lib archive $lib." |
3200 |
$echo "*** I have the capability to make that library automatically link in when" |
3201 |
$echo "*** you link to this library. But I can only do this if you have a" |
3202 |
$echo "*** shared version of the library, which you do not appear to have." |
3203 |
if test "$module" = yes; then |
3204 |
$echo "*** But as you try to build a module library, libtool will still create " |
3205 |
$echo "*** a static module, that should work as long as the dlopening application" |
3206 |
$echo "*** is linked with the -dlopen flag to resolve symbols at runtime." |
3207 |
if test -z "$global_symbol_pipe"; then |
3208 |
$echo |
3209 |
$echo "*** However, this would only work if libtool was able to extract symbol" |
3210 |
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could" |
3211 |
$echo "*** not find such a program. So, this module is probably useless." |
3212 |
$echo "*** \`nm' from GNU binutils and a full rebuild may help." |
3213 |
fi |
3214 |
if test "$build_old_libs" = no; then |
3215 |
build_libtool_libs=module |
3216 |
build_old_libs=yes |
3217 |
else |
3218 |
build_libtool_libs=no |
3219 |
fi |
3220 |
fi |
3221 |
else |
3222 |
deplibs="$dir/$old_library $deplibs" |
3223 |
link_static=yes |
3224 |
fi |
3225 |
fi # link shared/static library? |
3226 |
|
3227 |
if test "$linkmode" = lib; then |
3228 |
if test -n "$dependency_libs" && |
3229 |
{ test "$hardcode_into_libs" != yes || |
3230 |
test "$build_old_libs" = yes || |
3231 |
test "$link_static" = yes; }; then |
3232 |
# Extract -R from dependency_libs |
3233 |
temp_deplibs= |
3234 |
for libdir in $dependency_libs; do |
3235 |
case $libdir in |
3236 |
-R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` |
3237 |
case " $xrpath " in |
3238 |
*" $temp_xrpath "*) ;; |
3239 |
*) xrpath="$xrpath $temp_xrpath";; |
3240 |
esac;; |
3241 |
*) temp_deplibs="$temp_deplibs $libdir";; |
3242 |
esac |
3243 |
done |
3244 |
dependency_libs="$temp_deplibs" |
3245 |
fi |
3246 |
|
3247 |
newlib_search_path="$newlib_search_path $absdir" |
3248 |
# Link against this library |
3249 |
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" |
3250 |
# ... and its dependency_libs |
3251 |
tmp_libs= |
3252 |
for deplib in $dependency_libs; do |
3253 |
newdependency_libs="$deplib $newdependency_libs" |
3254 |
if test "X$duplicate_deps" = "Xyes" ; then |
3255 |
case "$tmp_libs " in |
3256 |
*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
3257 |
esac |
3258 |
fi |
3259 |
tmp_libs="$tmp_libs $deplib" |
3260 |
done |
3261 |
|
3262 |
if test "$link_all_deplibs" != no; then |
3263 |
# Add the search paths of all dependency libraries |
3264 |
for deplib in $dependency_libs; do |
3265 |
case $deplib in |
3266 |
-L*) path="$deplib" ;; |
3267 |
*.la) |
3268 |
dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` |
3269 |
test "X$dir" = "X$deplib" && dir="." |
3270 |
# We need an absolute path. |
3271 |
case $dir in |
3272 |
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; |
3273 |
*) |
3274 |
absdir=`cd "$dir" && pwd` |
3275 |
if test -z "$absdir"; then |
3276 |
$echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 |
3277 |
absdir="$dir" |
3278 |
fi |
3279 |
;; |
3280 |
esac |
3281 |
if grep "^installed=no" $deplib > /dev/null; then |
3282 |
path="$absdir/$objdir" |
3283 |
else |
3284 |
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
3285 |
if test -z "$libdir"; then |
3286 |
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
3287 |
exit $EXIT_FAILURE |
3288 |
fi |
3289 |
if test "$absdir" != "$libdir"; then |
3290 |
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 |
3291 |
fi |
3292 |
path="$absdir" |
3293 |
fi |
3294 |
depdepl= |
3295 |
case $host in |
3296 |
*-*-darwin*) |
3297 |
# we do not want to link against static libs, |
3298 |
# but need to link against shared |
3299 |
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` |
3300 |
if test -n "$deplibrary_names" ; then |
3301 |
for tmp in $deplibrary_names ; do |
3302 |
depdepl=$tmp |
3303 |
done |
3304 |
if test -f "$path/$depdepl" ; then |
3305 |
depdepl="$path/$depdepl" |
3306 |
fi |
3307 |
# do not add paths which are already there |
3308 |
case " $newlib_search_path " in |
3309 |
*" $path "*) ;; |
3310 |
*) newlib_search_path="$newlib_search_path $path";; |
3311 |
esac |
3312 |
fi |
3313 |
path="" |
3314 |
;; |
3315 |
*) |
3316 |
path="-L$path" |
3317 |
;; |
3318 |
esac |
3319 |
;; |
3320 |
-l*) |
3321 |
case $host in |
3322 |
*-*-darwin*) |
3323 |
# Again, we only want to link against shared libraries |
3324 |
eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` |
3325 |
for tmp in $newlib_search_path ; do |
3326 |
if test -f "$tmp/lib$tmp_libs.dylib" ; then |
3327 |
eval depdepl="$tmp/lib$tmp_libs.dylib" |
3328 |
break |
3329 |
fi |
3330 |
done |
3331 |
path="" |
3332 |
;; |
3333 |
*) continue ;; |
3334 |
esac |
3335 |
;; |
3336 |
*) continue ;; |
3337 |
esac |
3338 |
case " $deplibs " in |
3339 |
*" $path "*) ;; |
3340 |
*) deplibs="$path $deplibs" ;; |
3341 |
esac |
3342 |
case " $deplibs " in |
3343 |
*" $depdepl "*) ;; |
3344 |
*) deplibs="$depdepl $deplibs" ;; |
3345 |
esac |
3346 |
done |
3347 |
fi # link_all_deplibs != no |
3348 |
fi # linkmode = lib |
3349 |
done # for deplib in $libs |
3350 |
dependency_libs="$newdependency_libs" |
3351 |
if test "$pass" = dlpreopen; then |
3352 |
# Link the dlpreopened libraries before other libraries |
3353 |
for deplib in $save_deplibs; do |
3354 |
deplibs="$deplib $deplibs" |
3355 |
done |
3356 |
fi |
3357 |
if test "$pass" != dlopen; then |
3358 |
if test "$pass" != conv; then |
3359 |
# Make sure lib_search_path contains only unique directories. |
3360 |
lib_search_path= |
3361 |
for dir in $newlib_search_path; do |
3362 |
case "$lib_search_path " in |
3363 |
*" $dir "*) ;; |
3364 |
*) lib_search_path="$lib_search_path $dir" ;; |
3365 |
esac |
3366 |
done |
3367 |
newlib_search_path= |
3368 |
fi |
3369 |
|
3370 |
if test "$linkmode,$pass" != "prog,link"; then |
3371 |
vars="deplibs" |
3372 |
else |
3373 |
vars="compile_deplibs finalize_deplibs" |
3374 |
fi |
3375 |
for var in $vars dependency_libs; do |
3376 |
# Add libraries to $var in reverse order |
3377 |
eval tmp_libs=\"\$$var\" |
3378 |
new_libs= |
3379 |
for deplib in $tmp_libs; do |
3380 |
# FIXME: Pedantically, this is the right thing to do, so |
3381 |
# that some nasty dependency loop isn't accidentally |
3382 |
# broken: |
3383 |
#new_libs="$deplib $new_libs" |
3384 |
# Pragmatically, this seems to cause very few problems in |
3385 |
# practice: |
3386 |
case $deplib in |
3387 |
-L*) new_libs="$deplib $new_libs" ;; |
3388 |
-R*) ;; |
3389 |
*) |
3390 |
# And here is the reason: when a library appears more |
3391 |
# than once as an explicit dependence of a library, or |
3392 |
# is implicitly linked in more than once by the |
3393 |
# compiler, it is considered special, and multiple |
3394 |
# occurrences thereof are not removed. Compare this |
3395 |
# with having the same library being listed as a |
3396 |
# dependency of multiple other libraries: in this case, |
3397 |
# we know (pedantically, we assume) the library does not |
3398 |
# need to be listed more than once, so we keep only the |
3399 |
# last copy. This is not always right, but it is rare |
3400 |
# enough that we require users that really mean to play |
3401 |
# such unportable linking tricks to link the library |
3402 |
# using -Wl,-lname, so that libtool does not consider it |
3403 |
# for duplicate removal. |
3404 |
case " $specialdeplibs " in |
3405 |
*" $deplib "*) new_libs="$deplib $new_libs" ;; |
3406 |
*) |
3407 |
case " $new_libs " in |
3408 |
*" $deplib "*) ;; |
3409 |
*) new_libs="$deplib $new_libs" ;; |
3410 |
esac |
3411 |
;; |
3412 |
esac |
3413 |
;; |
3414 |
esac |
3415 |
done |
3416 |
tmp_libs= |
3417 |
for deplib in $new_libs; do |
3418 |
case $deplib in |
3419 |
-L*) |
3420 |
case " $tmp_libs " in |
3421 |
*" $deplib "*) ;; |
3422 |
*) tmp_libs="$tmp_libs $deplib" ;; |
3423 |
esac |
3424 |
;; |
3425 |
*) tmp_libs="$tmp_libs $deplib" ;; |
3426 |
esac |
3427 |
done |
3428 |
eval $var=\"$tmp_libs\" |
3429 |
done # for var |
3430 |
fi |
3431 |
# Last step: remove runtime libs from dependency_libs |
3432 |
# (they stay in deplibs) |
3433 |
tmp_libs= |
3434 |
for i in $dependency_libs ; do |
3435 |
case " $predeps $postdeps $compiler_lib_search_path " in |
3436 |
*" $i "*) |
3437 |
i="" |
3438 |
;; |
3439 |
esac |
3440 |
if test -n "$i" ; then |
3441 |
tmp_libs="$tmp_libs $i" |
3442 |
fi |
3443 |
done |
3444 |
dependency_libs=$tmp_libs |
3445 |
done # for pass |
3446 |
if test "$linkmode" = prog; then |
3447 |
dlfiles="$newdlfiles" |
3448 |
dlprefiles="$newdlprefiles" |
3449 |
fi |
3450 |
|
3451 |
case $linkmode in |
3452 |
oldlib) |
3453 |
if test -n "$deplibs"; then |
3454 |
$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 |
3455 |
fi |
3456 |
|
3457 |
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
3458 |
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 |
3459 |
fi |
3460 |
|
3461 |
if test -n "$rpath"; then |
3462 |
$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 |
3463 |
fi |
3464 |
|
3465 |
if test -n "$xrpath"; then |
3466 |
$echo "$modename: warning: \`-R' is ignored for archives" 1>&2 |
3467 |
fi |
3468 |
|
3469 |
if test -n "$vinfo"; then |
3470 |
$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 |
3471 |
fi |
3472 |
|
3473 |
if test -n "$release"; then |
3474 |
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2 |
3475 |
fi |
3476 |
|
3477 |
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then |
3478 |
$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 |
3479 |
fi |
3480 |
|
3481 |
# Now set the variables for building old libraries. |
3482 |
build_libtool_libs=no |
3483 |
oldlibs="$output" |
3484 |
objs="$objs$old_deplibs" |
3485 |
;; |
3486 |
|
3487 |
lib) |
3488 |
# Make sure we only generate libraries of the form `libNAME.la'. |
3489 |
case $outputname in |
3490 |
lib*) |
3491 |
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
3492 |
eval shared_ext=\"$shrext_cmds\" |
3493 |
eval libname=\"$libname_spec\" |
3494 |
;; |
3495 |
*) |
3496 |
if test "$module" = no; then |
3497 |
$echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 |
3498 |
$echo "$help" 1>&2 |
3499 |
exit $EXIT_FAILURE |
3500 |
fi |
3501 |
if test "$need_lib_prefix" != no; then |
3502 |
# Add the "lib" prefix for modules if required |
3503 |
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` |
3504 |
eval shared_ext=\"$shrext_cmds\" |
3505 |
eval libname=\"$libname_spec\" |
3506 |
else |
3507 |
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` |
3508 |
fi |
3509 |
;; |
3510 |
esac |
3511 |
|
3512 |
if test -n "$objs"; then |
3513 |
if test "$deplibs_check_method" != pass_all; then |
3514 |
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 |
3515 |
exit $EXIT_FAILURE |
3516 |
else |
3517 |
$echo |
3518 |
$echo "*** Warning: Linking the shared library $output against the non-libtool" |
3519 |
$echo "*** objects $objs is not portable!" |
3520 |
libobjs="$libobjs $objs" |
3521 |
fi |
3522 |
fi |
3523 |
|
3524 |
if test "$dlself" != no; then |
3525 |
$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 |
3526 |
fi |
3527 |
|
3528 |
set dummy $rpath |
3529 |
if test "$#" -gt 2; then |
3530 |
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 |
3531 |
fi |
3532 |
install_libdir="$2" |
3533 |
|
3534 |
oldlibs= |
3535 |
if test -z "$rpath"; then |
3536 |
if test "$build_libtool_libs" = yes; then |
3537 |
# Building a libtool convenience library. |
3538 |
# Some compilers have problems with a `.al' extension so |
3539 |
# convenience libraries should have the same extension an |
3540 |
# archive normally would. |
3541 |
oldlibs="$output_objdir/$libname.$libext $oldlibs" |
3542 |
build_libtool_libs=convenience |
3543 |
build_old_libs=yes |
3544 |
fi |
3545 |
|
3546 |
if test -n "$vinfo"; then |
3547 |
$echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 |
3548 |
fi |
3549 |
|
3550 |
if test -n "$release"; then |
3551 |
$echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 |
3552 |
fi |
3553 |
else |
3554 |
|
3555 |
# Parse the version information argument. |
3556 |
save_ifs="$IFS"; IFS=':' |
3557 |
set dummy $vinfo 0 0 0 |
3558 |
IFS="$save_ifs" |
3559 |
|
3560 |
if test -n "$8"; then |
3561 |
$echo "$modename: too many parameters to \`-version-info'" 1>&2 |
3562 |
$echo "$help" 1>&2 |
3563 |
exit $EXIT_FAILURE |
3564 |
fi |
3565 |
|
3566 |
# convert absolute version numbers to libtool ages |
3567 |
# this retains compatibility with .la files and attempts |
3568 |
# to make the code below a bit more comprehensible |
3569 |
|
3570 |
case $vinfo_number in |
3571 |
yes) |
3572 |
number_major="$2" |
3573 |
number_minor="$3" |
3574 |
number_revision="$4" |
3575 |
# |
3576 |
# There are really only two kinds -- those that |
3577 |
# use the current revision as the major version |
3578 |
# and those that subtract age and use age as |
3579 |
# a minor version. But, then there is irix |
3580 |
# which has an extra 1 added just for fun |
3581 |
# |
3582 |
case $version_type in |
3583 |
darwin|linux|osf|windows|none) |
3584 |
current=`expr $number_major + $number_minor` |
3585 |
age="$number_minor" |
3586 |
revision="$number_revision" |
3587 |
;; |
3588 |
freebsd-aout|freebsd-elf|sunos) |
3589 |
current="$number_major" |
3590 |
revision="$number_minor" |
3591 |
age="0" |
3592 |
;; |
3593 |
irix|nonstopux) |
3594 |
current=`expr $number_major + $number_minor` |
3595 |
age="$number_minor" |
3596 |
revision="$number_minor" |
3597 |
lt_irix_increment=no |
3598 |
;; |
3599 |
esac |
3600 |
;; |
3601 |
no) |
3602 |
current="$2" |
3603 |
revision="$3" |
3604 |
age="$4" |
3605 |
;; |
3606 |
esac |
3607 |
|
3608 |
# Check that each of the things are valid numbers. |
3609 |
case $current in |
3610 |
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; |
3611 |
*) |
3612 |
$echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 |
3613 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
3614 |
exit $EXIT_FAILURE |
3615 |
;; |
3616 |
esac |
3617 |
|
3618 |
case $revision in |
3619 |
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; |
3620 |
*) |
3621 |
$echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 |
3622 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
3623 |
exit $EXIT_FAILURE |
3624 |
;; |
3625 |
esac |
3626 |
|
3627 |
case $age in |
3628 |
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; |
3629 |
*) |
3630 |
$echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 |
3631 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
3632 |
exit $EXIT_FAILURE |
3633 |
;; |
3634 |
esac |
3635 |
|
3636 |
if test "$age" -gt "$current"; then |
3637 |
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 |
3638 |
$echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
3639 |
exit $EXIT_FAILURE |
3640 |
fi |
3641 |
|
3642 |
# Calculate the version variables. |
3643 |
major= |
3644 |
versuffix= |
3645 |
verstring= |
3646 |
case $version_type in |
3647 |
none) ;; |
3648 |
|
3649 |
darwin) |
3650 |
# Like Linux, but with the current version available in |
3651 |
# verstring for coding it into the library header |
3652 |
major=.`expr $current - $age` |
3653 |
versuffix="$major.$age.$revision" |
3654 |
# Darwin ld doesn't like 0 for these options... |
3655 |
minor_current=`expr $current + 1` |
3656 |
xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" |
3657 |
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" |
3658 |
;; |
3659 |
|
3660 |
freebsd-aout) |
3661 |
major=".$current" |
3662 |
versuffix=".$current.$revision"; |
3663 |
;; |
3664 |
|
3665 |
freebsd-elf) |
3666 |
major=".$current" |
3667 |
versuffix=".$current"; |
3668 |
;; |
3669 |
|
3670 |
irix | nonstopux) |
3671 |
if test "X$lt_irix_increment" = "Xno"; then |
3672 |
major=`expr $current - $age` |
3673 |
else |
3674 |
major=`expr $current - $age + 1` |
3675 |
fi |
3676 |
case $version_type in |
3677 |
nonstopux) verstring_prefix=nonstopux ;; |
3678 |
*) verstring_prefix=sgi ;; |
3679 |
esac |
3680 |
verstring="$verstring_prefix$major.$revision" |
3681 |
|
3682 |
# Add in all the interfaces that we are compatible with. |
3683 |
loop=$revision |
3684 |
while test "$loop" -ne 0; do |
3685 |
iface=`expr $revision - $loop` |
3686 |
loop=`expr $loop - 1` |
3687 |
verstring="$verstring_prefix$major.$iface:$verstring" |
3688 |
done |
3689 |
|
3690 |
# Before this point, $major must not contain `.'. |
3691 |
major=.$major |
3692 |
versuffix="$major.$revision" |
3693 |
;; |
3694 |
|
3695 |
linux) |
3696 |
major=.`expr $current - $age` |
3697 |
versuffix="$major.$age.$revision" |
3698 |
;; |
3699 |
|
3700 |
osf) |
3701 |
major=.`expr $current - $age` |
3702 |
versuffix=".$current.$age.$revision" |
3703 |
verstring="$current.$age.$revision" |
3704 |
|
3705 |
# Add in all the interfaces that we are compatible with. |
3706 |
loop=$age |
3707 |
while test "$loop" -ne 0; do |
3708 |
iface=`expr $current - $loop` |
3709 |
loop=`expr $loop - 1` |
3710 |
verstring="$verstring:${iface}.0" |
3711 |
done |
3712 |
|
3713 |
# Make executables depend on our current version. |
3714 |
verstring="$verstring:${current}.0" |
3715 |
;; |
3716 |
|
3717 |
sunos) |
3718 |
major=".$current" |
3719 |
versuffix=".$current.$revision" |
3720 |
;; |
3721 |
|
3722 |
windows) |
3723 |
# Use '-' rather than '.', since we only want one |
3724 |
# extension on DOS 8.3 filesystems. |
3725 |
major=`expr $current - $age` |
3726 |
versuffix="-$major" |
3727 |
;; |
3728 |
|
3729 |
*) |
3730 |
$echo "$modename: unknown library version type \`$version_type'" 1>&2 |
3731 |
$echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
3732 |
exit $EXIT_FAILURE |
3733 |
;; |
3734 |
esac |
3735 |
|
3736 |
# Clear the version info if we defaulted, and they specified a release. |
3737 |
if test -z "$vinfo" && test -n "$release"; then |
3738 |
major= |
3739 |
case $version_type in |
3740 |
darwin) |
3741 |
# we can't check for "0.0" in archive_cmds due to quoting |
3742 |
# problems, so we reset it completely |
3743 |
verstring= |
3744 |
;; |
3745 |
*) |
3746 |
verstring="0.0" |
3747 |
;; |
3748 |
esac |
3749 |
if test "$need_version" = no; then |
3750 |
versuffix= |
3751 |
else |
3752 |
versuffix=".0.0" |
3753 |
fi |
3754 |
fi |
3755 |
|
3756 |
# Remove version info from name if versioning should be avoided |
3757 |
if test "$avoid_version" = yes && test "$need_version" = no; then |
3758 |
major= |
3759 |
versuffix= |
3760 |
verstring="" |
3761 |
fi |
3762 |
|
3763 |
# Check to see if the archive will have undefined symbols. |
3764 |
if test "$allow_undefined" = yes; then |
3765 |
if test "$allow_undefined_flag" = unsupported; then |
3766 |
$echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 |
3767 |
build_libtool_libs=no |
3768 |
build_old_libs=yes |
3769 |
fi |
3770 |
else |
3771 |
# Don't allow undefined symbols. |
3772 |
allow_undefined_flag="$no_undefined_flag" |
3773 |
fi |
3774 |
fi |
3775 |
|
3776 |
if test "$mode" != relink; then |
3777 |
# Remove our outputs, but don't remove object files since they |
3778 |
# may have been created when compiling PIC objects. |
3779 |
removelist= |
3780 |
tempremovelist=`$echo "$output_objdir/*"` |
3781 |
for p in $tempremovelist; do |
3782 |
case $p in |
3783 |
*.$objext) |
3784 |
;; |
3785 |
$output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) |
3786 |
if test "X$precious_files_regex" != "X"; then |
3787 |
if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 |
3788 |
then |
3789 |
continue |
3790 |
fi |
3791 |
fi |
3792 |
removelist="$removelist $p" |
3793 |
;; |
3794 |
*) ;; |
3795 |
esac |
3796 |
done |
3797 |
if test -n "$removelist"; then |
3798 |
$show "${rm}r $removelist" |
3799 |
$run ${rm}r $removelist |
3800 |
fi |
3801 |
fi |
3802 |
|
3803 |
# Now set the variables for building old libraries. |
3804 |
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then |
3805 |
oldlibs="$oldlibs $output_objdir/$libname.$libext" |
3806 |
|
3807 |
# Transform .lo files to .o files. |
3808 |
oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` |
3809 |
fi |
3810 |
|
3811 |
# Eliminate all temporary directories. |
3812 |
#for path in $notinst_path; do |
3813 |
# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` |
3814 |
# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` |
3815 |
# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` |
3816 |
#done |
3817 |
|
3818 |
if test -n "$xrpath"; then |
3819 |
# If the user specified any rpath flags, then add them. |
3820 |
temp_xrpath= |
3821 |
for libdir in $xrpath; do |
3822 |
temp_xrpath="$temp_xrpath -R$libdir" |
3823 |
case "$finalize_rpath " in |
3824 |
*" $libdir "*) ;; |
3825 |
*) finalize_rpath="$finalize_rpath $libdir" ;; |
3826 |
esac |
3827 |
done |
3828 |
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then |
3829 |
dependency_libs="$temp_xrpath $dependency_libs" |
3830 |
fi |
3831 |
fi |
3832 |
|
3833 |
# Make sure dlfiles contains only unique files that won't be dlpreopened |
3834 |
old_dlfiles="$dlfiles" |
3835 |
dlfiles= |
3836 |
for lib in $old_dlfiles; do |
3837 |
case " $dlprefiles $dlfiles " in |
3838 |
*" $lib "*) ;; |
3839 |
*) dlfiles="$dlfiles $lib" ;; |
3840 |
esac |
3841 |
done |
3842 |
|
3843 |
# Make sure dlprefiles contains only unique files |
3844 |
old_dlprefiles="$dlprefiles" |
3845 |
dlprefiles= |
3846 |
for lib in $old_dlprefiles; do |
3847 |
case "$dlprefiles " in |
3848 |
*" $lib "*) ;; |
3849 |
*) dlprefiles="$dlprefiles $lib" ;; |
3850 |
esac |
3851 |
done |
3852 |
|
3853 |
if test "$build_libtool_libs" = yes; then |
3854 |
if test -n "$rpath"; then |
3855 |
case $host in |
3856 |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) |
3857 |
# these systems don't actually have a c library (as such)! |
3858 |
;; |
3859 |
*-*-rhapsody* | *-*-darwin1.[012]) |
3860 |
# Rhapsody C library is in the System framework |
3861 |
deplibs="$deplibs -framework System" |
3862 |
;; |
3863 |
*-*-netbsd*) |
3864 |
# Don't link with libc until the a.out ld.so is fixed. |
3865 |
;; |
3866 |
*-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) |
3867 |
# Do not include libc due to us having libc/libc_r. |
3868 |
;; |
3869 |
*-*-sco3.2v5* | *-*-sco5v6*) |
3870 |
# Causes problems with __ctype |
3871 |
;; |
3872 |
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) |
3873 |
# Compiler inserts libc in the correct place for threads to work |
3874 |
;; |
3875 |
*) |
3876 |
# Add libc to deplibs on all other systems if necessary. |
3877 |
if test "$build_libtool_need_lc" = "yes"; then |
3878 |
deplibs="$deplibs -lc" |
3879 |
fi |
3880 |
;; |
3881 |
esac |
3882 |
fi |
3883 |
|
3884 |
# Transform deplibs into only deplibs that can be linked in shared. |
3885 |
name_save=$name |
3886 |
libname_save=$libname |
3887 |
release_save=$release |
3888 |
versuffix_save=$versuffix |
3889 |
major_save=$major |
3890 |
# I'm not sure if I'm treating the release correctly. I think |
3891 |
# release should show up in the -l (ie -lgmp5) so we don't want to |
3892 |
# add it in twice. Is that correct? |
3893 |
release="" |
3894 |
versuffix="" |
3895 |
major="" |
3896 |
newdeplibs= |
3897 |
droppeddeps=no |
3898 |
case $deplibs_check_method in |
3899 |
pass_all) |
3900 |
# Don't check for shared/static. Everything works. |
3901 |
# This might be a little naive. We might want to check |
3902 |
# whether the library exists or not. But this is on |
3903 |
# osf3 & osf4 and I'm not really sure... Just |
3904 |
# implementing what was already the behavior. |
3905 |
newdeplibs=$deplibs |
3906 |
;; |
3907 |
test_compile) |
3908 |
# This code stresses the "libraries are programs" paradigm to its |
3909 |
# limits. Maybe even breaks it. We compile a program, linking it |
3910 |
# against the deplibs as a proxy for the library. Then we can check |
3911 |
# whether they linked in statically or dynamically with ldd. |
3912 |
$rm conftest.c |
3913 |
cat > conftest.c <<EOF |
3914 |
int main() { return 0; } |
3915 |
EOF |
3916 |
$rm conftest |
3917 |
if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then |
3918 |
ldd_output=`ldd conftest` |
3919 |
for i in $deplibs; do |
3920 |
name=`expr $i : '-l\(.*\)'` |
3921 |
# If $name is empty we are operating on a -L argument. |
3922 |
if test "$name" != "" && test "$name" != "0"; then |
3923 |
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
3924 |
case " $predeps $postdeps " in |
3925 |
*" $i "*) |
3926 |
newdeplibs="$newdeplibs $i" |
3927 |
i="" |
3928 |
;; |
3929 |
esac |
3930 |
fi |
3931 |
if test -n "$i" ; then |
3932 |
libname=`eval \\$echo \"$libname_spec\"` |
3933 |
deplib_matches=`eval \\$echo \"$library_names_spec\"` |
3934 |
set dummy $deplib_matches |
3935 |
deplib_match=$2 |
3936 |
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then |
3937 |
newdeplibs="$newdeplibs $i" |
3938 |
else |
3939 |
droppeddeps=yes |
3940 |
$echo |
3941 |
$echo "*** Warning: dynamic linker does not accept needed library $i." |
3942 |
$echo "*** I have the capability to make that library automatically link in when" |
3943 |
$echo "*** you link to this library. But I can only do this if you have a" |
3944 |
$echo "*** shared version of the library, which I believe you do not have" |
3945 |
$echo "*** because a test_compile did reveal that the linker did not use it for" |
3946 |
$echo "*** its dynamic dependency list that programs get resolved with at runtime." |
3947 |
fi |
3948 |
fi |
3949 |
else |
3950 |
newdeplibs="$newdeplibs $i" |
3951 |
fi |
3952 |
done |
3953 |
else |
3954 |
# Error occurred in the first compile. Let's try to salvage |
3955 |
# the situation: Compile a separate program for each library. |
3956 |
for i in $deplibs; do |
3957 |
name=`expr $i : '-l\(.*\)'` |
3958 |
# If $name is empty we are operating on a -L argument. |
3959 |
if test "$name" != "" && test "$name" != "0"; then |
3960 |
$rm conftest |
3961 |
if $LTCC $LTCFLAGS -o conftest conftest.c $i; then |
3962 |
ldd_output=`ldd conftest` |
3963 |
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
3964 |
case " $predeps $postdeps " in |
3965 |
*" $i "*) |
3966 |
newdeplibs="$newdeplibs $i" |
3967 |
i="" |
3968 |
;; |
3969 |
esac |
3970 |
fi |
3971 |
if test -n "$i" ; then |
3972 |
libname=`eval \\$echo \"$libname_spec\"` |
3973 |
deplib_matches=`eval \\$echo \"$library_names_spec\"` |
3974 |
set dummy $deplib_matches |
3975 |
deplib_match=$2 |
3976 |
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then |
3977 |
newdeplibs="$newdeplibs $i" |
3978 |
else |
3979 |
droppeddeps=yes |
3980 |
$echo |
3981 |
$echo "*** Warning: dynamic linker does not accept needed library $i." |
3982 |
$echo "*** I have the capability to make that library automatically link in when" |
3983 |
$echo "*** you link to this library. But I can only do this if you have a" |
3984 |
$echo "*** shared version of the library, which you do not appear to have" |
3985 |
$echo "*** because a test_compile did reveal that the linker did not use this one" |
3986 |
$echo "*** as a dynamic dependency that programs can get resolved with at runtime." |
3987 |
fi |
3988 |
fi |
3989 |
else |
3990 |
droppeddeps=yes |
3991 |
$echo |
3992 |
$echo "*** Warning! Library $i is needed by this library but I was not able to" |
3993 |
$echo "*** make it link in! You will probably need to install it or some" |
3994 |
$echo "*** library that it depends on before this library will be fully" |
3995 |
$echo "*** functional. Installing it before continuing would be even better." |
3996 |
fi |
3997 |
else |
3998 |
newdeplibs="$newdeplibs $i" |
3999 |
fi |
4000 |
done |
4001 |
fi |
4002 |
;; |
4003 |
file_magic*) |
4004 |
set dummy $deplibs_check_method |
4005 |
file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
4006 |
for a_deplib in $deplibs; do |
4007 |
name=`expr $a_deplib : '-l\(.*\)'` |
4008 |
# If $name is empty we are operating on a -L argument. |
4009 |
if test "$name" != "" && test "$name" != "0"; then |
4010 |
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
4011 |
case " $predeps $postdeps " in |
4012 |
*" $a_deplib "*) |
4013 |
newdeplibs="$newdeplibs $a_deplib" |
4014 |
a_deplib="" |
4015 |
;; |
4016 |
esac |
4017 |
fi |
4018 |
if test -n "$a_deplib" ; then |
4019 |
libname=`eval \\$echo \"$libname_spec\"` |
4020 |
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do |
4021 |
potential_libs=`ls $i/$libname[.-]* 2>/dev/null` |
4022 |
for potent_lib in $potential_libs; do |
4023 |
# Follow soft links. |
4024 |
if ls -lLd "$potent_lib" 2>/dev/null \ |
4025 |
| grep " -> " >/dev/null; then |
4026 |
continue |
4027 |
fi |
4028 |
# The statement above tries to avoid entering an |
4029 |
# endless loop below, in case of cyclic links. |
4030 |
# We might still enter an endless loop, since a link |
4031 |
# loop can be closed while we follow links, |
4032 |
# but so what? |
4033 |
potlib="$potent_lib" |
4034 |
while test -h "$potlib" 2>/dev/null; do |
4035 |
potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` |
4036 |
case $potliblink in |
4037 |
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; |
4038 |
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; |
4039 |
esac |
4040 |
done |
4041 |
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ |
4042 |
| ${SED} 10q \ |
4043 |
| $EGREP "$file_magic_regex" > /dev/null; then |
4044 |
newdeplibs="$newdeplibs $a_deplib" |
4045 |
a_deplib="" |
4046 |
break 2 |
4047 |
fi |
4048 |
done |
4049 |
done |
4050 |
fi |
4051 |
if test -n "$a_deplib" ; then |
4052 |
droppeddeps=yes |
4053 |
$echo |
4054 |
$echo "*** Warning: linker path does not have real file for library $a_deplib." |
4055 |
$echo "*** I have the capability to make that library automatically link in when" |
4056 |
$echo "*** you link to this library. But I can only do this if you have a" |
4057 |
$echo "*** shared version of the library, which you do not appear to have" |
4058 |
$echo "*** because I did check the linker path looking for a file starting" |
4059 |
if test -z "$potlib" ; then |
4060 |
$echo "*** with $libname but no candidates were found. (...for file magic test)" |
4061 |
else |
4062 |
$echo "*** with $libname and none of the candidates passed a file format test" |
4063 |
$echo "*** using a file magic. Last file checked: $potlib" |
4064 |
fi |
4065 |
fi |
4066 |
else |
4067 |
# Add a -L argument. |
4068 |
newdeplibs="$newdeplibs $a_deplib" |
4069 |
fi |
4070 |
done # Gone through all deplibs. |
4071 |
;; |
4072 |
match_pattern*) |
4073 |
set dummy $deplibs_check_method |
4074 |
match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
4075 |
for a_deplib in $deplibs; do |
4076 |
name=`expr $a_deplib : '-l\(.*\)'` |
4077 |
# If $name is empty we are operating on a -L argument. |
4078 |
if test -n "$name" && test "$name" != "0"; then |
4079 |
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
4080 |
case " $predeps $postdeps " in |
4081 |
*" $a_deplib "*) |
4082 |
newdeplibs="$newdeplibs $a_deplib" |
4083 |
a_deplib="" |
4084 |
;; |
4085 |
esac |
4086 |
fi |
4087 |
if test -n "$a_deplib" ; then |
4088 |
libname=`eval \\$echo \"$libname_spec\"` |
4089 |
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do |
4090 |
potential_libs=`ls $i/$libname[.-]* 2>/dev/null` |
4091 |
for potent_lib in $potential_libs; do |
4092 |
potlib="$potent_lib" # see symlink-check above in file_magic test |
4093 |
if eval $echo \"$potent_lib\" 2>/dev/null \ |
4094 |
| ${SED} 10q \ |
4095 |
| $EGREP "$match_pattern_regex" > /dev/null; then |
4096 |
newdeplibs="$newdeplibs $a_deplib" |
4097 |
a_deplib="" |
4098 |
break 2 |
4099 |
fi |
4100 |
done |
4101 |
done |
4102 |
fi |
4103 |
if test -n "$a_deplib" ; then |
4104 |
droppeddeps=yes |
4105 |
$echo |
4106 |
$echo "*** Warning: linker path does not have real file for library $a_deplib." |
4107 |
$echo "*** I have the capability to make that library automatically link in when" |
4108 |
$echo "*** you link to this library. But I can only do this if you have a" |
4109 |
$echo "*** shared version of the library, which you do not appear to have" |
4110 |
$echo "*** because I did check the linker path looking for a file starting" |
4111 |
if test -z "$potlib" ; then |
4112 |
$echo "*** with $libname but no candidates were found. (...for regex pattern test)" |
4113 |
else |
4114 |
$echo "*** with $libname and none of the candidates passed a file format test" |
4115 |
$echo "*** using a regex pattern. Last file checked: $potlib" |
4116 |
fi |
4117 |
fi |
4118 |
else |
4119 |
# Add a -L argument. |
4120 |
newdeplibs="$newdeplibs $a_deplib" |
4121 |
fi |
4122 |
done # Gone through all deplibs. |
4123 |
;; |
4124 |
none | unknown | *) |
4125 |
newdeplibs="" |
4126 |
tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ |
4127 |
-e 's/ -[LR][^ ]*//g'` |
4128 |
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
4129 |
for i in $predeps $postdeps ; do |
4130 |
# can't use Xsed below, because $i might contain '/' |
4131 |
tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` |
4132 |
done |
4133 |
fi |
4134 |
if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ |
4135 |
| grep . >/dev/null; then |
4136 |
$echo |
4137 |
if test "X$deplibs_check_method" = "Xnone"; then |
4138 |
$echo "*** Warning: inter-library dependencies are not supported in this platform." |
4139 |
else |
4140 |
$echo "*** Warning: inter-library dependencies are not known to be supported." |
4141 |
fi |
4142 |
$echo "*** All declared inter-library dependencies are being dropped." |
4143 |
droppeddeps=yes |
4144 |
fi |
4145 |
;; |
4146 |
esac |
4147 |
versuffix=$versuffix_save |
4148 |
major=$major_save |
4149 |
release=$release_save |
4150 |
libname=$libname_save |
4151 |
name=$name_save |
4152 |
|
4153 |
case $host in |
4154 |
*-*-rhapsody* | *-*-darwin1.[012]) |
4155 |
# On Rhapsody replace the C library is the System framework |
4156 |
newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` |
4157 |
;; |
4158 |
esac |
4159 |
|
4160 |
if test "$droppeddeps" = yes; then |
4161 |
if test "$module" = yes; then |
4162 |
$echo |
4163 |
$echo "*** Warning: libtool could not satisfy all declared inter-library" |
4164 |
$echo "*** dependencies of module $libname. Therefore, libtool will create" |
4165 |
$echo "*** a static module, that should work as long as the dlopening" |
4166 |
$echo "*** application is linked with the -dlopen flag." |
4167 |
if test -z "$global_symbol_pipe"; then |
4168 |
$echo |
4169 |
$echo "*** However, this would only work if libtool was able to extract symbol" |
4170 |
$echo "*** lists from a program, using \`nm' or equivalent, but libtool could" |
4171 |
$echo "*** not find such a program. So, this module is probably useless." |
4172 |
$echo "*** \`nm' from GNU binutils and a full rebuild may help." |
4173 |
fi |
4174 |
if test "$build_old_libs" = no; then |
4175 |
oldlibs="$output_objdir/$libname.$libext" |
4176 |
build_libtool_libs=module |
4177 |
build_old_libs=yes |
4178 |
else |
4179 |
build_libtool_libs=no |
4180 |
fi |
4181 |
else |
4182 |
$echo "*** The inter-library dependencies that have been dropped here will be" |
4183 |
$echo "*** automatically added whenever a program is linked with this library" |
4184 |
$echo "*** or is declared to -dlopen it." |
4185 |
|
4186 |
if test "$allow_undefined" = no; then |
4187 |
$echo |
4188 |
$echo "*** Since this library must not contain undefined symbols," |
4189 |
$echo "*** because either the platform does not support them or" |
4190 |
$echo "*** it was explicitly requested with -no-undefined," |
4191 |
$echo "*** libtool will only create a static version of it." |
4192 |
if test "$build_old_libs" = no; then |
4193 |
oldlibs="$output_objdir/$libname.$libext" |
4194 |
build_libtool_libs=module |
4195 |
build_old_libs=yes |
4196 |
else |
4197 |
build_libtool_libs=no |
4198 |
fi |
4199 |
fi |
4200 |
fi |
4201 |
fi |
4202 |
# Done checking deplibs! |
4203 |
deplibs=$newdeplibs |
4204 |
fi |
4205 |
|
4206 |
|
4207 |
# move library search paths that coincide with paths to not yet |
4208 |
# installed libraries to the beginning of the library search list |
4209 |
new_libs= |
4210 |
for path in $notinst_path; do |
4211 |
case " $new_libs " in |
4212 |
*" -L$path/$objdir "*) ;; |
4213 |
*) |
4214 |
case " $deplibs " in |
4215 |
*" -L$path/$objdir "*) |
4216 |
new_libs="$new_libs -L$path/$objdir" ;; |
4217 |
esac |
4218 |
;; |
4219 |
esac |
4220 |
done |
4221 |
for deplib in $deplibs; do |
4222 |
case $deplib in |
4223 |
-L*) |
4224 |
case " $new_libs " in |
4225 |
*" $deplib "*) ;; |
4226 |
*) new_libs="$new_libs $deplib" ;; |
4227 |
esac |
4228 |
;; |
4229 |
*) new_libs="$new_libs $deplib" ;; |
4230 |
esac |
4231 |
done |
4232 |
deplibs="$new_libs" |
4233 |
|
4234 |
|
4235 |
# All the library-specific variables (install_libdir is set above). |
4236 |
library_names= |
4237 |
old_library= |
4238 |
dlname= |
4239 |
|
4240 |
# Test again, we may have decided not to build it any more |
4241 |
if test "$build_libtool_libs" = yes; then |
4242 |
if test "$hardcode_into_libs" = yes; then |
4243 |
# Hardcode the library paths |
4244 |
hardcode_libdirs= |
4245 |
dep_rpath= |
4246 |
rpath="$finalize_rpath" |
4247 |
test "$mode" != relink && rpath="$compile_rpath$rpath" |
4248 |
for libdir in $rpath; do |
4249 |
if test -n "$hardcode_libdir_flag_spec"; then |
4250 |
if test -n "$hardcode_libdir_separator"; then |
4251 |
if test -z "$hardcode_libdirs"; then |
4252 |
hardcode_libdirs="$libdir" |
4253 |
else |
4254 |
# Just accumulate the unique libdirs. |
4255 |
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
4256 |
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
4257 |
;; |
4258 |
*) |
4259 |
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" |
4260 |
;; |
4261 |
esac |
4262 |
fi |
4263 |
else |
4264 |
eval flag=\"$hardcode_libdir_flag_spec\" |
4265 |
dep_rpath="$dep_rpath $flag" |
4266 |
fi |
4267 |
elif test -n "$runpath_var"; then |
4268 |
case "$perm_rpath " in |
4269 |
*" $libdir "*) ;; |
4270 |
*) perm_rpath="$perm_rpath $libdir" ;; |
4271 |
esac |
4272 |
fi |
4273 |
done |
4274 |
# Substitute the hardcoded libdirs into the rpath. |
4275 |
if test -n "$hardcode_libdir_separator" && |
4276 |
test -n "$hardcode_libdirs"; then |
4277 |
libdir="$hardcode_libdirs" |
4278 |
if test -n "$hardcode_libdir_flag_spec_ld"; then |
4279 |
case $archive_cmds in |
4280 |
*\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;; |
4281 |
*) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;; |
4282 |
esac |
4283 |
else |
4284 |
eval dep_rpath=\"$hardcode_libdir_flag_spec\" |
4285 |
fi |
4286 |
fi |
4287 |
if test -n "$runpath_var" && test -n "$perm_rpath"; then |
4288 |
# We should set the runpath_var. |
4289 |
rpath= |
4290 |
for dir in $perm_rpath; do |
4291 |
rpath="$rpath$dir:" |
4292 |
done |
4293 |
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" |
4294 |
fi |
4295 |
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" |
4296 |
fi |
4297 |
|
4298 |
shlibpath="$finalize_shlibpath" |
4299 |
test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" |
4300 |
if test -n "$shlibpath"; then |
4301 |
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" |
4302 |
fi |
4303 |
|
4304 |
# Get the real and link names of the library. |
4305 |
eval shared_ext=\"$shrext_cmds\" |
4306 |
eval library_names=\"$library_names_spec\" |
4307 |
set dummy $library_names |
4308 |
realname="$2" |
4309 |
shift; shift |
4310 |
|
4311 |
if test -n "$soname_spec"; then |
4312 |
eval soname=\"$soname_spec\" |
4313 |
else |
4314 |
soname="$realname" |
4315 |
fi |
4316 |
if test -z "$dlname"; then |
4317 |
dlname=$soname |
4318 |
fi |
4319 |
|
4320 |
lib="$output_objdir/$realname" |
4321 |
linknames= |
4322 |
for link |
4323 |
do |
4324 |
linknames="$linknames $link" |
4325 |
done |
4326 |
|
4327 |
# Use standard objects if they are pic |
4328 |
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
4329 |
|
4330 |
# Prepare the list of exported symbols |
4331 |
if test -z "$export_symbols"; then |
4332 |
if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then |
4333 |
$show "generating symbol list for \`$libname.la'" |
4334 |
export_symbols="$output_objdir/$libname.exp" |
4335 |
$run $rm $export_symbols |
4336 |
cmds=$export_symbols_cmds |
4337 |
save_ifs="$IFS"; IFS='~' |
4338 |
for cmd in $cmds; do |
4339 |
IFS="$save_ifs" |
4340 |
eval cmd=\"$cmd\" |
4341 |
if len=`expr "X$cmd" : ".*"` && |
4342 |
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
4343 |
$show "$cmd" |
4344 |
$run eval "$cmd" || exit $? |
4345 |
skipped_export=false |
4346 |
else |
4347 |
# The command line is too long to execute in one step. |
4348 |
$show "using reloadable object file for export list..." |
4349 |
skipped_export=: |
4350 |
# Break out early, otherwise skipped_export may be |
4351 |
# set to false by a later but shorter cmd. |
4352 |
break |
4353 |
fi |
4354 |
done |
4355 |
IFS="$save_ifs" |
4356 |
if test -n "$export_symbols_regex"; then |
4357 |
$show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" |
4358 |
$run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' |
4359 |
$show "$mv \"${export_symbols}T\" \"$export_symbols\"" |
4360 |
$run eval '$mv "${export_symbols}T" "$export_symbols"' |
4361 |
fi |
4362 |
fi |
4363 |
fi |
4364 |
|
4365 |
if test -n "$export_symbols" && test -n "$include_expsyms"; then |
4366 |
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' |
4367 |
fi |
4368 |
|
4369 |
tmp_deplibs= |
4370 |
for test_deplib in $deplibs; do |
4371 |
case " $convenience " in |
4372 |
*" $test_deplib "*) ;; |
4373 |
*) |
4374 |
tmp_deplibs="$tmp_deplibs $test_deplib" |
4375 |
;; |
4376 |
esac |
4377 |
done |
4378 |
deplibs="$tmp_deplibs" |
4379 |
|
4380 |
if test -n "$convenience"; then |
4381 |
if test -n "$whole_archive_flag_spec"; then |
4382 |
save_libobjs=$libobjs |
4383 |
eval libobjs=\"\$libobjs $whole_archive_flag_spec\" |
4384 |
else |
4385 |
gentop="$output_objdir/${outputname}x" |
4386 |
generated="$generated $gentop" |
4387 |
|
4388 |
func_extract_archives $gentop $convenience |
4389 |
libobjs="$libobjs $func_extract_archives_result" |
4390 |
fi |
4391 |
fi |
4392 |
|
4393 |
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then |
4394 |
eval flag=\"$thread_safe_flag_spec\" |
4395 |
linker_flags="$linker_flags $flag" |
4396 |
fi |
4397 |
|
4398 |
# Make a backup of the uninstalled library when relinking |
4399 |
if test "$mode" = relink; then |
4400 |
$run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? |
4401 |
fi |
4402 |
|
4403 |
# Do each of the archive commands. |
4404 |
if test "$module" = yes && test -n "$module_cmds" ; then |
4405 |
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then |
4406 |
eval test_cmds=\"$module_expsym_cmds\" |
4407 |
cmds=$module_expsym_cmds |
4408 |
else |
4409 |
eval test_cmds=\"$module_cmds\" |
4410 |
cmds=$module_cmds |
4411 |
fi |
4412 |
else |
4413 |
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then |
4414 |
eval test_cmds=\"$archive_expsym_cmds\" |
4415 |
cmds=$archive_expsym_cmds |
4416 |
else |
4417 |
eval test_cmds=\"$archive_cmds\" |
4418 |
cmds=$archive_cmds |
4419 |
fi |
4420 |
fi |
4421 |
|
4422 |
if test "X$skipped_export" != "X:" && |
4423 |
len=`expr "X$test_cmds" : ".*" 2>/dev/null` && |
4424 |
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
4425 |
: |
4426 |
else |
4427 |
# The command line is too long to link in one step, link piecewise. |
4428 |
$echo "creating reloadable object files..." |
4429 |
|
4430 |
# Save the value of $output and $libobjs because we want to |
4431 |
# use them later. If we have whole_archive_flag_spec, we |
4432 |
# want to use save_libobjs as it was before |
4433 |
# whole_archive_flag_spec was expanded, because we can't |
4434 |
# assume the linker understands whole_archive_flag_spec. |
4435 |
# This may have to be revisited, in case too many |
4436 |
# convenience libraries get linked in and end up exceeding |
4437 |
# the spec. |
4438 |
if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then |
4439 |
save_libobjs=$libobjs |
4440 |
fi |
4441 |
save_output=$output |
4442 |
output_la=`$echo "X$output" | $Xsed -e "$basename"` |
4443 |
|
4444 |
# Clear the reloadable object creation command queue and |
4445 |
# initialize k to one. |
4446 |
test_cmds= |
4447 |
concat_cmds= |
4448 |
objlist= |
4449 |
delfiles= |
4450 |
last_robj= |
4451 |
k=1 |
4452 |
output=$output_objdir/$output_la-${k}.$objext |
4453 |
# Loop over the list of objects to be linked. |
4454 |
for obj in $save_libobjs |
4455 |
do |
4456 |
eval test_cmds=\"$reload_cmds $objlist $last_robj\" |
4457 |
if test "X$objlist" = X || |
4458 |
{ len=`expr "X$test_cmds" : ".*" 2>/dev/null` && |
4459 |
test "$len" -le "$max_cmd_len"; }; then |
4460 |
objlist="$objlist $obj" |
4461 |
else |
4462 |
# The command $test_cmds is almost too long, add a |
4463 |
# command to the queue. |
4464 |
if test "$k" -eq 1 ; then |
4465 |
# The first file doesn't have a previous command to add. |
4466 |
eval concat_cmds=\"$reload_cmds $objlist $last_robj\" |
4467 |
else |
4468 |
# All subsequent reloadable object files will link in |
4469 |
# the last one created. |
4470 |
eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" |
4471 |
fi |
4472 |
last_robj=$output_objdir/$output_la-${k}.$objext |
4473 |
k=`expr $k + 1` |
4474 |
output=$output_objdir/$output_la-${k}.$objext |
4475 |
objlist=$obj |
4476 |
len=1 |
4477 |
fi |
4478 |
done |
4479 |
# Handle the remaining objects by creating one last |
4480 |
# reloadable object file. All subsequent reloadable object |
4481 |
# files will link in the last one created. |
4482 |
test -z "$concat_cmds" || concat_cmds=$concat_cmds~ |
4483 |
eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" |
4484 |
|
4485 |
if ${skipped_export-false}; then |
4486 |
$show "generating symbol list for \`$libname.la'" |
4487 |
export_symbols="$output_objdir/$libname.exp" |
4488 |
$run $rm $export_symbols |
4489 |
libobjs=$output |
4490 |
# Append the command to create the export file. |
4491 |
eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" |
4492 |
fi |
4493 |
|
4494 |
# Set up a command to remove the reloadable object files |
4495 |
# after they are used. |
4496 |
i=0 |
4497 |
while test "$i" -lt "$k" |
4498 |
do |
4499 |
i=`expr $i + 1` |
4500 |
delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" |
4501 |
done |
4502 |
|
4503 |
$echo "creating a temporary reloadable object file: $output" |
4504 |
|
4505 |
# Loop through the commands generated above and execute them. |
4506 |
save_ifs="$IFS"; IFS='~' |
4507 |
for cmd in $concat_cmds; do |
4508 |
IFS="$save_ifs" |
4509 |
$show "$cmd" |
4510 |
$run eval "$cmd" || exit $? |
4511 |
done |
4512 |
IFS="$save_ifs" |
4513 |
|
4514 |
libobjs=$output |
4515 |
# Restore the value of output. |
4516 |
output=$save_output |
4517 |
|
4518 |
if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then |
4519 |
eval libobjs=\"\$libobjs $whole_archive_flag_spec\" |
4520 |
fi |
4521 |
# Expand the library linking commands again to reset the |
4522 |
# value of $libobjs for piecewise linking. |
4523 |
|
4524 |
# Do each of the archive commands. |
4525 |
if test "$module" = yes && test -n "$module_cmds" ; then |
4526 |
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then |
4527 |
cmds=$module_expsym_cmds |
4528 |
else |
4529 |
cmds=$module_cmds |
4530 |
fi |
4531 |
else |
4532 |
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then |
4533 |
cmds=$archive_expsym_cmds |
4534 |
else |
4535 |
cmds=$archive_cmds |
4536 |
fi |
4537 |
fi |
4538 |
|
4539 |
# Append the command to remove the reloadable object files |
4540 |
# to the just-reset $cmds. |
4541 |
eval cmds=\"\$cmds~\$rm $delfiles\" |
4542 |
fi |
4543 |
save_ifs="$IFS"; IFS='~' |
4544 |
for cmd in $cmds; do |
4545 |
IFS="$save_ifs" |
4546 |
eval cmd=\"$cmd\" |
4547 |
$show "$cmd" |
4548 |
$run eval "$cmd" || { |
4549 |
lt_exit=$? |
4550 |
|
4551 |
# Restore the uninstalled library and exit |
4552 |
if test "$mode" = relink; then |
4553 |
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' |
4554 |
fi |
4555 |
|
4556 |
exit $lt_exit |
4557 |
} |
4558 |
done |
4559 |
IFS="$save_ifs" |
4560 |
|
4561 |
# Restore the uninstalled library and exit |
4562 |
if test "$mode" = relink; then |
4563 |
$run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? |
4564 |
|
4565 |
if test -n "$convenience"; then |
4566 |
if test -z "$whole_archive_flag_spec"; then |
4567 |
$show "${rm}r $gentop" |
4568 |
$run ${rm}r "$gentop" |
4569 |
fi |
4570 |
fi |
4571 |
|
4572 |
exit $EXIT_SUCCESS |
4573 |
fi |
4574 |
|
4575 |
# Create links to the real library. |
4576 |
for linkname in $linknames; do |
4577 |
if test "$realname" != "$linkname"; then |
4578 |
$show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" |
4579 |
$run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? |
4580 |
fi |
4581 |
done |
4582 |
|
4583 |
# If -module or -export-dynamic was specified, set the dlname. |
4584 |
if test "$module" = yes || test "$export_dynamic" = yes; then |
4585 |
# On all known operating systems, these are identical. |
4586 |
dlname="$soname" |
4587 |
fi |
4588 |
fi |
4589 |
;; |
4590 |
|
4591 |
obj) |
4592 |
if test -n "$deplibs"; then |
4593 |
$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 |
4594 |
fi |
4595 |
|
4596 |
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
4597 |
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 |
4598 |
fi |
4599 |
|
4600 |
if test -n "$rpath"; then |
4601 |
$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 |
4602 |
fi |
4603 |
|
4604 |
if test -n "$xrpath"; then |
4605 |
$echo "$modename: warning: \`-R' is ignored for objects" 1>&2 |
4606 |
fi |
4607 |
|
4608 |
if test -n "$vinfo"; then |
4609 |
$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 |
4610 |
fi |
4611 |
|
4612 |
if test -n "$release"; then |
4613 |
$echo "$modename: warning: \`-release' is ignored for objects" 1>&2 |
4614 |
fi |
4615 |
|
4616 |
case $output in |
4617 |
*.lo) |
4618 |
if test -n "$objs$old_deplibs"; then |
4619 |
$echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 |
4620 |
exit $EXIT_FAILURE |
4621 |
fi |
4622 |
libobj="$output" |
4623 |
obj=`$echo "X$output" | $Xsed -e "$lo2o"` |
4624 |
;; |
4625 |
*) |
4626 |
libobj= |
4627 |
obj="$output" |
4628 |
;; |
4629 |
esac |
4630 |
|
4631 |
# Delete the old objects. |
4632 |
$run $rm $obj $libobj |
4633 |
|
4634 |
# Objects from convenience libraries. This assumes |
4635 |
# single-version convenience libraries. Whenever we create |
4636 |
# different ones for PIC/non-PIC, this we'll have to duplicate |
4637 |
# the extraction. |
4638 |
reload_conv_objs= |
4639 |
gentop= |
4640 |
# reload_cmds runs $LD directly, so let us get rid of |
4641 |
# -Wl from whole_archive_flag_spec and hope we can get by with |
4642 |
# turning comma into space.. |
4643 |
wl= |
4644 |
|
4645 |
if test -n "$convenience"; then |
4646 |
if test -n "$whole_archive_flag_spec"; then |
4647 |
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" |
4648 |
reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` |
4649 |
else |
4650 |
gentop="$output_objdir/${obj}x" |
4651 |
generated="$generated $gentop" |
4652 |
|
4653 |
func_extract_archives $gentop $convenience |
4654 |
reload_conv_objs="$reload_objs $func_extract_archives_result" |
4655 |
fi |
4656 |
fi |
4657 |
|
4658 |
# Create the old-style object. |
4659 |
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 |
4660 |
|
4661 |
output="$obj" |
4662 |
cmds=$reload_cmds |
4663 |
save_ifs="$IFS"; IFS='~' |
4664 |
for cmd in $cmds; do |
4665 |
IFS="$save_ifs" |
4666 |
eval cmd=\"$cmd\" |
4667 |
$show "$cmd" |
4668 |
$run eval "$cmd" || exit $? |
4669 |
done |
4670 |
IFS="$save_ifs" |
4671 |
|
4672 |
# Exit if we aren't doing a library object file. |
4673 |
if test -z "$libobj"; then |
4674 |
if test -n "$gentop"; then |
4675 |
$show "${rm}r $gentop" |
4676 |
$run ${rm}r $gentop |
4677 |
fi |
4678 |
|
4679 |
exit $EXIT_SUCCESS |
4680 |
fi |
4681 |
|
4682 |
if test "$build_libtool_libs" != yes; then |
4683 |
if test -n "$gentop"; then |
4684 |
$show "${rm}r $gentop" |
4685 |
$run ${rm}r $gentop |
4686 |
fi |
4687 |
|
4688 |
# Create an invalid libtool object if no PIC, so that we don't |
4689 |
# accidentally link it into a program. |
4690 |
# $show "echo timestamp > $libobj" |
4691 |
# $run eval "echo timestamp > $libobj" || exit $? |
4692 |
exit $EXIT_SUCCESS |
4693 |
fi |
4694 |
|
4695 |
if test -n "$pic_flag" || test "$pic_mode" != default; then |
4696 |
# Only do commands if we really have different PIC objects. |
4697 |
reload_objs="$libobjs $reload_conv_objs" |
4698 |
output="$libobj" |
4699 |
cmds=$reload_cmds |
4700 |
save_ifs="$IFS"; IFS='~' |
4701 |
for cmd in $cmds; do |
4702 |
IFS="$save_ifs" |
4703 |
eval cmd=\"$cmd\" |
4704 |
$show "$cmd" |
4705 |
$run eval "$cmd" || exit $? |
4706 |
done |
4707 |
IFS="$save_ifs" |
4708 |
fi |
4709 |
|
4710 |
if test -n "$gentop"; then |
4711 |
$show "${rm}r $gentop" |
4712 |
$run ${rm}r $gentop |
4713 |
fi |
4714 |
|
4715 |
exit $EXIT_SUCCESS |
4716 |
;; |
4717 |
|
4718 |
prog) |
4719 |
case $host in |
4720 |
*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; |
4721 |
esac |
4722 |
if test -n "$vinfo"; then |
4723 |
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 |
4724 |
fi |
4725 |
|
4726 |
if test -n "$release"; then |
4727 |
$echo "$modename: warning: \`-release' is ignored for programs" 1>&2 |
4728 |
fi |
4729 |
|
4730 |
if test "$preload" = yes; then |
4731 |
if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && |
4732 |
test "$dlopen_self_static" = unknown; then |
4733 |
$echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." |
4734 |
fi |
4735 |
fi |
4736 |
|
4737 |
case $host in |
4738 |
*-*-rhapsody* | *-*-darwin1.[012]) |
4739 |
# On Rhapsody replace the C library is the System framework |
4740 |
compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` |
4741 |
finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` |
4742 |
;; |
4743 |
esac |
4744 |
|
4745 |
case $host in |
4746 |
*darwin*) |
4747 |
# Don't allow lazy linking, it breaks C++ global constructors |
4748 |
if test "$tagname" = CXX ; then |
4749 |
compile_command="$compile_command ${wl}-bind_at_load" |
4750 |
finalize_command="$finalize_command ${wl}-bind_at_load" |
4751 |
fi |
4752 |
;; |
4753 |
esac |
4754 |
|
4755 |
|
4756 |
# move library search paths that coincide with paths to not yet |
4757 |
# installed libraries to the beginning of the library search list |
4758 |
new_libs= |
4759 |
for path in $notinst_path; do |
4760 |
case " $new_libs " in |
4761 |
*" -L$path/$objdir "*) ;; |
4762 |
*) |
4763 |
case " $compile_deplibs " in |
4764 |
*" -L$path/$objdir "*) |
4765 |
new_libs="$new_libs -L$path/$objdir" ;; |
4766 |
esac |
4767 |
;; |
4768 |
esac |
4769 |
done |
4770 |
for deplib in $compile_deplibs; do |
4771 |
case $deplib in |
4772 |
-L*) |
4773 |
case " $new_libs " in |
4774 |
*" $deplib "*) ;; |
4775 |
*) new_libs="$new_libs $deplib" ;; |
4776 |
esac |
4777 |
;; |
4778 |
*) new_libs="$new_libs $deplib" ;; |
4779 |
esac |
4780 |
done |
4781 |
compile_deplibs="$new_libs" |
4782 |
|
4783 |
|
4784 |
compile_command="$compile_command $compile_deplibs" |
4785 |
finalize_command="$finalize_command $finalize_deplibs" |
4786 |
|
4787 |
if test -n "$rpath$xrpath"; then |
4788 |
# If the user specified any rpath flags, then add them. |
4789 |
for libdir in $rpath $xrpath; do |
4790 |
# This is the magic to use -rpath. |
4791 |
case "$finalize_rpath " in |
4792 |
*" $libdir "*) ;; |
4793 |
*) finalize_rpath="$finalize_rpath $libdir" ;; |
4794 |
esac |
4795 |
done |
4796 |
fi |
4797 |
|
4798 |
# Now hardcode the library paths |
4799 |
rpath= |
4800 |
hardcode_libdirs= |
4801 |
for libdir in $compile_rpath $finalize_rpath; do |
4802 |
if test -n "$hardcode_libdir_flag_spec"; then |
4803 |
if test -n "$hardcode_libdir_separator"; then |
4804 |
if test -z "$hardcode_libdirs"; then |
4805 |
hardcode_libdirs="$libdir" |
4806 |
else |
4807 |
# Just accumulate the unique libdirs. |
4808 |
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
4809 |
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
4810 |
;; |
4811 |
*) |
4812 |
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" |
4813 |
;; |
4814 |
esac |
4815 |
fi |
4816 |
else |
4817 |
eval flag=\"$hardcode_libdir_flag_spec\" |
4818 |
rpath="$rpath $flag" |
4819 |
fi |
4820 |
elif test -n "$runpath_var"; then |
4821 |
case "$perm_rpath " in |
4822 |
*" $libdir "*) ;; |
4823 |
*) perm_rpath="$perm_rpath $libdir" ;; |
4824 |
esac |
4825 |
fi |
4826 |
case $host in |
4827 |
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
4828 |
testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` |
4829 |
case :$dllsearchpath: in |
4830 |
*":$libdir:"*) ;; |
4831 |
*) dllsearchpath="$dllsearchpath:$libdir";; |
4832 |
esac |
4833 |
case :$dllsearchpath: in |
4834 |
*":$testbindir:"*) ;; |
4835 |
*) dllsearchpath="$dllsearchpath:$testbindir";; |
4836 |
esac |
4837 |
;; |
4838 |
esac |
4839 |
done |
4840 |
# Substitute the hardcoded libdirs into the rpath. |
4841 |
if test -n "$hardcode_libdir_separator" && |
4842 |
test -n "$hardcode_libdirs"; then |
4843 |
libdir="$hardcode_libdirs" |
4844 |
eval rpath=\" $hardcode_libdir_flag_spec\" |
4845 |
fi |
4846 |
compile_rpath="$rpath" |
4847 |
|
4848 |
rpath= |
4849 |
hardcode_libdirs= |
4850 |
for libdir in $finalize_rpath; do |
4851 |
if test -n "$hardcode_libdir_flag_spec"; then |
4852 |
if test -n "$hardcode_libdir_separator"; then |
4853 |
if test -z "$hardcode_libdirs"; then |
4854 |
hardcode_libdirs="$libdir" |
4855 |
else |
4856 |
# Just accumulate the unique libdirs. |
4857 |
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
4858 |
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
4859 |
;; |
4860 |
*) |
4861 |
hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" |
4862 |
;; |
4863 |
esac |
4864 |
fi |
4865 |
else |
4866 |
eval flag=\"$hardcode_libdir_flag_spec\" |
4867 |
rpath="$rpath $flag" |
4868 |
fi |
4869 |
elif test -n "$runpath_var"; then |
4870 |
case "$finalize_perm_rpath " in |
4871 |
*" $libdir "*) ;; |
4872 |
*) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; |
4873 |
esac |
4874 |
fi |
4875 |
done |
4876 |
# Substitute the hardcoded libdirs into the rpath. |
4877 |
if test -n "$hardcode_libdir_separator" && |
4878 |
test -n "$hardcode_libdirs"; then |
4879 |
libdir="$hardcode_libdirs" |
4880 |
eval rpath=\" $hardcode_libdir_flag_spec\" |
4881 |
fi |
4882 |
finalize_rpath="$rpath" |
4883 |
|
4884 |
if test -n "$libobjs" && test "$build_old_libs" = yes; then |
4885 |
# Transform all the library objects into standard objects. |
4886 |
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
4887 |
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
4888 |
fi |
4889 |
|
4890 |
dlsyms= |
4891 |
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
4892 |
if test -n "$NM" && test -n "$global_symbol_pipe"; then |
4893 |
dlsyms="${outputname}S.c" |
4894 |
else |
4895 |
$echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 |
4896 |
fi |
4897 |
fi |
4898 |
|
4899 |
if test -n "$dlsyms"; then |
4900 |
case $dlsyms in |
4901 |
"") ;; |
4902 |
*.c) |
4903 |
# Discover the nlist of each of the dlfiles. |
4904 |
nlist="$output_objdir/${outputname}.nm" |
4905 |
|
4906 |
$show "$rm $nlist ${nlist}S ${nlist}T" |
4907 |
$run $rm "$nlist" "${nlist}S" "${nlist}T" |
4908 |
|
4909 |
# Parse the name list into a source file. |
4910 |
$show "creating $output_objdir/$dlsyms" |
4911 |
|
4912 |
test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ |
4913 |
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ |
4914 |
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ |
4915 |
|
4916 |
#ifdef __cplusplus |
4917 |
extern \"C\" { |
4918 |
#endif |
4919 |
|
4920 |
/* Prevent the only kind of declaration conflicts we can make. */ |
4921 |
#define lt_preloaded_symbols some_other_symbol |
4922 |
|
4923 |
/* External symbol declarations for the compiler. */\ |
4924 |
" |
4925 |
|
4926 |
if test "$dlself" = yes; then |
4927 |
$show "generating symbol list for \`$output'" |
4928 |
|
4929 |
test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" |
4930 |
|
4931 |
# Add our own program objects to the symbol list. |
4932 |
progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
4933 |
for arg in $progfiles; do |
4934 |
$show "extracting global C symbols from \`$arg'" |
4935 |
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" |
4936 |
done |
4937 |
|
4938 |
if test -n "$exclude_expsyms"; then |
4939 |
$run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' |
4940 |
$run eval '$mv "$nlist"T "$nlist"' |
4941 |
fi |
4942 |
|
4943 |
if test -n "$export_symbols_regex"; then |
4944 |
$run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' |
4945 |
$run eval '$mv "$nlist"T "$nlist"' |
4946 |
fi |
4947 |
|
4948 |
# Prepare the list of exported symbols |
4949 |
if test -z "$export_symbols"; then |
4950 |
export_symbols="$output_objdir/$outputname.exp" |
4951 |
$run $rm $export_symbols |
4952 |
$run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' |
4953 |
case $host in |
4954 |
*cygwin* | *mingw* ) |
4955 |
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' |
4956 |
$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' |
4957 |
;; |
4958 |
esac |
4959 |
else |
4960 |
$run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' |
4961 |
$run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' |
4962 |
$run eval 'mv "$nlist"T "$nlist"' |
4963 |
case $host in |
4964 |
*cygwin* | *mingw* ) |
4965 |
$run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' |
4966 |
$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' |
4967 |
;; |
4968 |
esac |
4969 |
fi |
4970 |
fi |
4971 |
|
4972 |
for arg in $dlprefiles; do |
4973 |
$show "extracting global C symbols from \`$arg'" |
4974 |
name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` |
4975 |
$run eval '$echo ": $name " >> "$nlist"' |
4976 |
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" |
4977 |
done |
4978 |
|
4979 |
if test -z "$run"; then |
4980 |
# Make sure we have at least an empty file. |
4981 |
test -f "$nlist" || : > "$nlist" |
4982 |
|
4983 |
if test -n "$exclude_expsyms"; then |
4984 |
$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T |
4985 |
$mv "$nlist"T "$nlist" |
4986 |
fi |
4987 |
|
4988 |
# Try sorting and uniquifying the output. |
4989 |
if grep -v "^: " < "$nlist" | |
4990 |
if sort -k 3 </dev/null >/dev/null 2>&1; then |
4991 |
sort -k 3 |
4992 |
else |
4993 |
sort +2 |
4994 |
fi | |
4995 |
uniq > "$nlist"S; then |
4996 |
: |
4997 |
else |
4998 |
grep -v "^: " < "$nlist" > "$nlist"S |
4999 |
fi |
5000 |
|
5001 |
if test -f "$nlist"S; then |
5002 |
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' |
5003 |
else |
5004 |
$echo '/* NONE */' >> "$output_objdir/$dlsyms" |
5005 |
fi |
5006 |
|
5007 |
$echo >> "$output_objdir/$dlsyms" "\ |
5008 |
|
5009 |
#undef lt_preloaded_symbols |
5010 |
|
5011 |
#if defined (__STDC__) && __STDC__ |
5012 |
# define lt_ptr void * |
5013 |
#else |
5014 |
# define lt_ptr char * |
5015 |
# define const |
5016 |
#endif |
5017 |
|
5018 |
/* The mapping between symbol names and symbols. */ |
5019 |
" |
5020 |
|
5021 |
case $host in |
5022 |
*cygwin* | *mingw* ) |
5023 |
$echo >> "$output_objdir/$dlsyms" "\ |
5024 |
/* DATA imports from DLLs on WIN32 can't be const, because |
5025 |
runtime relocations are performed -- see ld's documentation |
5026 |
on pseudo-relocs */ |
5027 |
struct { |
5028 |
" |
5029 |
;; |
5030 |
* ) |
5031 |
$echo >> "$output_objdir/$dlsyms" "\ |
5032 |
const struct { |
5033 |
" |
5034 |
;; |
5035 |
esac |
5036 |
|
5037 |
|
5038 |
$echo >> "$output_objdir/$dlsyms" "\ |
5039 |
const char *name; |
5040 |
lt_ptr address; |
5041 |
} |
5042 |
lt_preloaded_symbols[] = |
5043 |
{\ |
5044 |
" |
5045 |
|
5046 |
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" |
5047 |
|
5048 |
$echo >> "$output_objdir/$dlsyms" "\ |
5049 |
{0, (lt_ptr) 0} |
5050 |
}; |
5051 |
|
5052 |
/* This works around a problem in FreeBSD linker */ |
5053 |
#ifdef FREEBSD_WORKAROUND |
5054 |
static const void *lt_preloaded_setup() { |
5055 |
return lt_preloaded_symbols; |
5056 |
} |
5057 |
#endif |
5058 |
|
5059 |
#ifdef __cplusplus |
5060 |
} |
5061 |
#endif\ |
5062 |
" |
5063 |
fi |
5064 |
|
5065 |
pic_flag_for_symtable= |
5066 |
case $host in |
5067 |
# compiling the symbol table file with pic_flag works around |
5068 |
# a FreeBSD bug that causes programs to crash when -lm is |
5069 |
# linked before any other PIC object. But we must not use |
5070 |
# pic_flag when linking with -static. The problem exists in |
5071 |
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. |
5072 |
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) |
5073 |
case "$compile_command " in |
5074 |
*" -static "*) ;; |
5075 |
*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; |
5076 |
esac;; |
5077 |
*-*-hpux*) |
5078 |
case "$compile_command " in |
5079 |
*" -static "*) ;; |
5080 |
*) pic_flag_for_symtable=" $pic_flag";; |
5081 |
esac |
5082 |
esac |
5083 |
|
5084 |
# Now compile the dynamic symbol file. |
5085 |
$show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" |
5086 |
$run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? |
5087 |
|
5088 |
# Clean up the generated files. |
5089 |
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" |
5090 |
$run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" |
5091 |
|
5092 |
# Transform the symbol file into the correct name. |
5093 |
case $host in |
5094 |
*cygwin* | *mingw* ) |
5095 |
if test -f "$output_objdir/${outputname}.def" ; then |
5096 |
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` |
5097 |
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` |
5098 |
else |
5099 |
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` |
5100 |
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` |
5101 |
fi |
5102 |
;; |
5103 |
* ) |
5104 |
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` |
5105 |
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` |
5106 |
;; |
5107 |
esac |
5108 |
;; |
5109 |
*) |
5110 |
$echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 |
5111 |
exit $EXIT_FAILURE |
5112 |
;; |
5113 |
esac |
5114 |
else |
5115 |
# We keep going just in case the user didn't refer to |
5116 |
# lt_preloaded_symbols. The linker will fail if global_symbol_pipe |
5117 |
# really was required. |
5118 |
|
5119 |
# Nullify the symbol file. |
5120 |
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` |
5121 |
finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` |
5122 |
fi |
5123 |
|
5124 |
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then |
5125 |
# Replace the output file specification. |
5126 |
compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` |
5127 |
link_command="$compile_command$compile_rpath" |
5128 |
|
5129 |
# We have no uninstalled library dependencies, so finalize right now. |
5130 |
$show "$link_command" |
5131 |
$run eval "$link_command" |
5132 |
exit_status=$? |
5133 |
|
5134 |
# Delete the generated files. |
5135 |
if test -n "$dlsyms"; then |
5136 |
$show "$rm $output_objdir/${outputname}S.${objext}" |
5137 |
$run $rm "$output_objdir/${outputname}S.${objext}" |
5138 |
fi |
5139 |
|
5140 |
exit $exit_status |
5141 |
fi |
5142 |
|
5143 |
if test -n "$shlibpath_var"; then |
5144 |
# We should set the shlibpath_var |
5145 |
rpath= |
5146 |
for dir in $temp_rpath; do |
5147 |
case $dir in |
5148 |
[\\/]* | [A-Za-z]:[\\/]*) |
5149 |
# Absolute path. |
5150 |
rpath="$rpath$dir:" |
5151 |
;; |
5152 |
*) |
5153 |
# Relative path: add a thisdir entry. |
5154 |
rpath="$rpath\$thisdir/$dir:" |
5155 |
;; |
5156 |
esac |
5157 |
done |
5158 |
temp_rpath="$rpath" |
5159 |
fi |
5160 |
|
5161 |
if test -n "$compile_shlibpath$finalize_shlibpath"; then |
5162 |
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" |
5163 |
fi |
5164 |
if test -n "$finalize_shlibpath"; then |
5165 |
finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" |
5166 |
fi |
5167 |
|
5168 |
compile_var= |
5169 |
finalize_var= |
5170 |
if test -n "$runpath_var"; then |
5171 |
if test -n "$perm_rpath"; then |
5172 |
# We should set the runpath_var. |
5173 |
rpath= |
5174 |
for dir in $perm_rpath; do |
5175 |
rpath="$rpath$dir:" |
5176 |
done |
5177 |
compile_var="$runpath_var=\"$rpath\$$runpath_var\" " |
5178 |
fi |
5179 |
if test -n "$finalize_perm_rpath"; then |
5180 |
# We should set the runpath_var. |
5181 |
rpath= |
5182 |
for dir in $finalize_perm_rpath; do |
5183 |
rpath="$rpath$dir:" |
5184 |
done |
5185 |
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " |
5186 |
fi |
5187 |
fi |
5188 |
|
5189 |
if test "$no_install" = yes; then |
5190 |
# We don't need to create a wrapper script. |
5191 |
link_command="$compile_var$compile_command$compile_rpath" |
5192 |
# Replace the output file specification. |
5193 |
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` |
5194 |
# Delete the old output file. |
5195 |
$run $rm $output |
5196 |
# Link the executable and exit |
5197 |
$show "$link_command" |
5198 |
$run eval "$link_command" || exit $? |
5199 |
exit $EXIT_SUCCESS |
5200 |
fi |
5201 |
|
5202 |
if test "$hardcode_action" = relink; then |
5203 |
# Fast installation is not supported |
5204 |
link_command="$compile_var$compile_command$compile_rpath" |
5205 |
relink_command="$finalize_var$finalize_command$finalize_rpath" |
5206 |
|
5207 |
$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 |
5208 |
$echo "$modename: \`$output' will be relinked during installation" 1>&2 |
5209 |
else |
5210 |
if test "$fast_install" != no; then |
5211 |
link_command="$finalize_var$compile_command$finalize_rpath" |
5212 |
if test "$fast_install" = yes; then |
5213 |
relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` |
5214 |
else |
5215 |
# fast_install is set to needless |
5216 |
relink_command= |
5217 |
fi |
5218 |
else |
5219 |
link_command="$compile_var$compile_command$compile_rpath" |
5220 |
relink_command="$finalize_var$finalize_command$finalize_rpath" |
5221 |
fi |
5222 |
fi |
5223 |
|
5224 |
# Replace the output file specification. |
5225 |
link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` |
5226 |
|
5227 |
# Delete the old output files. |
5228 |
$run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname |
5229 |
|
5230 |
$show "$link_command" |
5231 |
$run eval "$link_command" || exit $? |
5232 |
|
5233 |
# Now create the wrapper script. |
5234 |
$show "creating $output" |
5235 |
|
5236 |
# Quote the relink command for shipping. |
5237 |
if test -n "$relink_command"; then |
5238 |
# Preserve any variables that may affect compiler behavior |
5239 |
for var in $variables_saved_for_relink; do |
5240 |
if eval test -z \"\${$var+set}\"; then |
5241 |
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" |
5242 |
elif eval var_value=\$$var; test -z "$var_value"; then |
5243 |
relink_command="$var=; export $var; $relink_command" |
5244 |
else |
5245 |
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` |
5246 |
relink_command="$var=\"$var_value\"; export $var; $relink_command" |
5247 |
fi |
5248 |
done |
5249 |
relink_command="(cd `pwd`; $relink_command)" |
5250 |
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` |
5251 |
fi |
5252 |
|
5253 |
# Quote $echo for shipping. |
5254 |
if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then |
5255 |
case $progpath in |
5256 |
[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; |
5257 |
*) qecho="$SHELL `pwd`/$progpath --fallback-echo";; |
5258 |
esac |
5259 |
qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` |
5260 |
else |
5261 |
qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` |
5262 |
fi |
5263 |
|
5264 |
# Only actually do things if our run command is non-null. |
5265 |
if test -z "$run"; then |
5266 |
# win32 will think the script is a binary if it has |
5267 |
# a .exe suffix, so we strip it off here. |
5268 |
case $output in |
5269 |
*.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; |
5270 |
esac |
5271 |
# test for cygwin because mv fails w/o .exe extensions |
5272 |
case $host in |
5273 |
*cygwin*) |
5274 |
exeext=.exe |
5275 |
outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; |
5276 |
*) exeext= ;; |
5277 |
esac |
5278 |
case $host in |
5279 |
*cygwin* | *mingw* ) |
5280 |
output_name=`basename $output` |
5281 |
output_path=`dirname $output` |
5282 |
cwrappersource="$output_path/$objdir/lt-$output_name.c" |
5283 |
cwrapper="$output_path/$output_name.exe" |
5284 |
$rm $cwrappersource $cwrapper |
5285 |
trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 |
5286 |
|
5287 |
cat > $cwrappersource <<EOF |
5288 |
|
5289 |
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname |
5290 |
Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
5291 |
|
5292 |
The $output program cannot be directly executed until all the libtool |
5293 |
libraries that it depends on are installed. |
5294 |
|
5295 |
This wrapper executable should never be moved out of the build directory. |
5296 |
If it is, it will not operate correctly. |
5297 |
|
5298 |
Currently, it simply execs the wrapper *script* "/bin/sh $output", |
5299 |
but could eventually absorb all of the scripts functionality and |
5300 |
exec $objdir/$outputname directly. |
5301 |
*/ |
5302 |
EOF |
5303 |
cat >> $cwrappersource<<"EOF" |
5304 |
#include <stdio.h> |
5305 |
#include <stdlib.h> |
5306 |
#include <unistd.h> |
5307 |
#include <malloc.h> |
5308 |
#include <stdarg.h> |
5309 |
#include <assert.h> |
5310 |
#include <string.h> |
5311 |
#include <ctype.h> |
5312 |
#include <sys/stat.h> |
5313 |
|
5314 |
#if defined(PATH_MAX) |
5315 |
# define LT_PATHMAX PATH_MAX |
5316 |
#elif defined(MAXPATHLEN) |
5317 |
# define LT_PATHMAX MAXPATHLEN |
5318 |
#else |
5319 |
# define LT_PATHMAX 1024 |
5320 |
#endif |
5321 |
|
5322 |
#ifndef DIR_SEPARATOR |
5323 |
# define DIR_SEPARATOR '/' |
5324 |
# define PATH_SEPARATOR ':' |
5325 |
#endif |
5326 |
|
5327 |
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ |
5328 |
defined (__OS2__) |
5329 |
# define HAVE_DOS_BASED_FILE_SYSTEM |
5330 |
# ifndef DIR_SEPARATOR_2 |
5331 |
# define DIR_SEPARATOR_2 '\\' |
5332 |
# endif |
5333 |
# ifndef PATH_SEPARATOR_2 |
5334 |
# define PATH_SEPARATOR_2 ';' |
5335 |
# endif |
5336 |
#endif |
5337 |
|
5338 |
#ifndef DIR_SEPARATOR_2 |
5339 |
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) |
5340 |
#else /* DIR_SEPARATOR_2 */ |
5341 |
# define IS_DIR_SEPARATOR(ch) \ |
5342 |
(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) |
5343 |
#endif /* DIR_SEPARATOR_2 */ |
5344 |
|
5345 |
#ifndef PATH_SEPARATOR_2 |
5346 |
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) |
5347 |
#else /* PATH_SEPARATOR_2 */ |
5348 |
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) |
5349 |
#endif /* PATH_SEPARATOR_2 */ |
5350 |
|
5351 |
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) |
5352 |
#define XFREE(stale) do { \ |
5353 |
if (stale) { free ((void *) stale); stale = 0; } \ |
5354 |
} while (0) |
5355 |
|
5356 |
/* -DDEBUG is fairly common in CFLAGS. */ |
5357 |
#undef DEBUG |
5358 |
#if defined DEBUGWRAPPER |
5359 |
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) |
5360 |
#else |
5361 |
# define DEBUG(format, ...) |
5362 |
#endif |
5363 |
|
5364 |
const char *program_name = NULL; |
5365 |
|
5366 |
void * xmalloc (size_t num); |
5367 |
char * xstrdup (const char *string); |
5368 |
const char * base_name (const char *name); |
5369 |
char * find_executable(const char *wrapper); |
5370 |
int check_executable(const char *path); |
5371 |
char * strendzap(char *str, const char *pat); |
5372 |
void lt_fatal (const char *message, ...); |
5373 |
|
5374 |
int |
5375 |
main (int argc, char *argv[]) |
5376 |
{ |
5377 |
char **newargz; |
5378 |
int i; |
5379 |
|
5380 |
program_name = (char *) xstrdup (base_name (argv[0])); |
5381 |
DEBUG("(main) argv[0] : %s\n",argv[0]); |
5382 |
DEBUG("(main) program_name : %s\n",program_name); |
5383 |
newargz = XMALLOC(char *, argc+2); |
5384 |
EOF |
5385 |
|
5386 |
cat >> $cwrappersource <<EOF |
5387 |
newargz[0] = (char *) xstrdup("$SHELL"); |
5388 |
EOF |
5389 |
|
5390 |
cat >> $cwrappersource <<"EOF" |
5391 |
newargz[1] = find_executable(argv[0]); |
5392 |
if (newargz[1] == NULL) |
5393 |
lt_fatal("Couldn't find %s", argv[0]); |
5394 |
DEBUG("(main) found exe at : %s\n",newargz[1]); |
5395 |
/* we know the script has the same name, without the .exe */ |
5396 |
/* so make sure newargz[1] doesn't end in .exe */ |
5397 |
strendzap(newargz[1],".exe"); |
5398 |
for (i = 1; i < argc; i++) |
5399 |
newargz[i+1] = xstrdup(argv[i]); |
5400 |
newargz[argc+1] = NULL; |
5401 |
|
5402 |
for (i=0; i<argc+1; i++) |
5403 |
{ |
5404 |
DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]); |
5405 |
; |
5406 |
} |
5407 |
|
5408 |
EOF |
5409 |
|
5410 |
case $host_os in |
5411 |
mingw*) |
5412 |
cat >> $cwrappersource <<EOF |
5413 |
execv("$SHELL",(char const **)newargz); |
5414 |
EOF |
5415 |
;; |
5416 |
*) |
5417 |
cat >> $cwrappersource <<EOF |
5418 |
execv("$SHELL",newargz); |
5419 |
EOF |
5420 |
;; |
5421 |
esac |
5422 |
|
5423 |
cat >> $cwrappersource <<"EOF" |
5424 |
return 127; |
5425 |
} |
5426 |
|
5427 |
void * |
5428 |
xmalloc (size_t num) |
5429 |
{ |
5430 |
void * p = (void *) malloc (num); |
5431 |
if (!p) |
5432 |
lt_fatal ("Memory exhausted"); |
5433 |
|
5434 |
return p; |
5435 |
} |
5436 |
|
5437 |
char * |
5438 |
xstrdup (const char *string) |
5439 |
{ |
5440 |
return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL |
5441 |
; |
5442 |
} |
5443 |
|
5444 |
const char * |
5445 |
base_name (const char *name) |
5446 |
{ |
5447 |
const char *base; |
5448 |
|
5449 |
#if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
5450 |
/* Skip over the disk name in MSDOS pathnames. */ |
5451 |
if (isalpha ((unsigned char)name[0]) && name[1] == ':') |
5452 |
name += 2; |
5453 |
#endif |
5454 |
|
5455 |
for (base = name; *name; name++) |
5456 |
if (IS_DIR_SEPARATOR (*name)) |
5457 |
base = name + 1; |
5458 |
return base; |
5459 |
} |
5460 |
|
5461 |
int |
5462 |
check_executable(const char * path) |
5463 |
{ |
5464 |
struct stat st; |
5465 |
|
5466 |
DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); |
5467 |
if ((!path) || (!*path)) |
5468 |
return 0; |
5469 |
|
5470 |
if ((stat (path, &st) >= 0) && |
5471 |
( |
5472 |
/* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ |
5473 |
#if defined (S_IXOTH) |
5474 |
((st.st_mode & S_IXOTH) == S_IXOTH) || |
5475 |
#endif |
5476 |
#if defined (S_IXGRP) |
5477 |
((st.st_mode & S_IXGRP) == S_IXGRP) || |
5478 |
#endif |
5479 |
((st.st_mode & S_IXUSR) == S_IXUSR)) |
5480 |
) |
5481 |
return 1; |
5482 |
else |
5483 |
return 0; |
5484 |
} |
5485 |
|
5486 |
/* Searches for the full path of the wrapper. Returns |
5487 |
newly allocated full path name if found, NULL otherwise */ |
5488 |
char * |
5489 |
find_executable (const char* wrapper) |
5490 |
{ |
5491 |
int has_slash = 0; |
5492 |
const char* p; |
5493 |
const char* p_next; |
5494 |
/* static buffer for getcwd */ |
5495 |
char tmp[LT_PATHMAX + 1]; |
5496 |
int tmp_len; |
5497 |
char* concat_name; |
5498 |
|
5499 |
DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); |
5500 |
|
5501 |
if ((wrapper == NULL) || (*wrapper == '\0')) |
5502 |
return NULL; |
5503 |
|
5504 |
/* Absolute path? */ |
5505 |
#if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
5506 |
if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') |
5507 |
{ |
5508 |
concat_name = xstrdup (wrapper); |
5509 |
if (check_executable(concat_name)) |
5510 |
return concat_name; |
5511 |
XFREE(concat_name); |
5512 |
} |
5513 |
else |
5514 |
{ |
5515 |
#endif |
5516 |
if (IS_DIR_SEPARATOR (wrapper[0])) |
5517 |
{ |
5518 |
concat_name = xstrdup (wrapper); |
5519 |
if (check_executable(concat_name)) |
5520 |
return concat_name; |
5521 |
XFREE(concat_name); |
5522 |
} |
5523 |
#if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
5524 |
} |
5525 |
#endif |
5526 |
|
5527 |
for (p = wrapper; *p; p++) |
5528 |
if (*p == '/') |
5529 |
{ |
5530 |
has_slash = 1; |
5531 |
break; |
5532 |
} |
5533 |
if (!has_slash) |
5534 |
{ |
5535 |
/* no slashes; search PATH */ |
5536 |
const char* path = getenv ("PATH"); |
5537 |
if (path != NULL) |
5538 |
{ |
5539 |
for (p = path; *p; p = p_next) |
5540 |
{ |
5541 |
const char* q; |
5542 |
size_t p_len; |
5543 |
for (q = p; *q; q++) |
5544 |
if (IS_PATH_SEPARATOR(*q)) |
5545 |
break; |
5546 |
p_len = q - p; |
5547 |
p_next = (*q == '\0' ? q : q + 1); |
5548 |
if (p_len == 0) |
5549 |
{ |
5550 |
/* empty path: current directory */ |
5551 |
if (getcwd (tmp, LT_PATHMAX) == NULL) |
5552 |
lt_fatal ("getcwd failed"); |
5553 |
tmp_len = strlen(tmp); |
5554 |
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); |
5555 |
memcpy (concat_name, tmp, tmp_len); |
5556 |
concat_name[tmp_len] = '/'; |
5557 |
strcpy (concat_name + tmp_len + 1, wrapper); |
5558 |
} |
5559 |
else |
5560 |
{ |
5561 |
concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); |
5562 |
memcpy (concat_name, p, p_len); |
5563 |
concat_name[p_len] = '/'; |
5564 |
strcpy (concat_name + p_len + 1, wrapper); |
5565 |
} |
5566 |
if (check_executable(concat_name)) |
5567 |
return concat_name; |
5568 |
XFREE(concat_name); |
5569 |
} |
5570 |
} |
5571 |
/* not found in PATH; assume curdir */ |
5572 |
} |
5573 |
/* Relative path | not found in path: prepend cwd */ |
5574 |
if (getcwd (tmp, LT_PATHMAX) == NULL) |
5575 |
lt_fatal ("getcwd failed"); |
5576 |
tmp_len = strlen(tmp); |
5577 |
concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); |
5578 |
memcpy (concat_name, tmp, tmp_len); |
5579 |
concat_name[tmp_len] = '/'; |
5580 |
strcpy (concat_name + tmp_len + 1, wrapper); |
5581 |
|
5582 |
if (check_executable(concat_name)) |
5583 |
return concat_name; |
5584 |
XFREE(concat_name); |
5585 |
return NULL; |
5586 |
} |
5587 |
|
5588 |
char * |
5589 |
strendzap(char *str, const char *pat) |
5590 |
{ |
5591 |
size_t len, patlen; |
5592 |
|
5593 |
assert(str != NULL); |
5594 |
assert(pat != NULL); |
5595 |
|
5596 |
len = strlen(str); |
5597 |
patlen = strlen(pat); |
5598 |
|
5599 |
if (patlen <= len) |
5600 |
{ |
5601 |
str += len - patlen; |
5602 |
if (strcmp(str, pat) == 0) |
5603 |
*str = '\0'; |
5604 |
} |
5605 |
return str; |
5606 |
} |
5607 |
|
5608 |
static void |
5609 |
lt_error_core (int exit_status, const char * mode, |
5610 |
const char * message, va_list ap) |
5611 |
{ |
5612 |
fprintf (stderr, "%s: %s: ", program_name, mode); |
5613 |
vfprintf (stderr, message, ap); |
5614 |
fprintf (stderr, ".\n"); |
5615 |
|
5616 |
if (exit_status >= 0) |
5617 |
exit (exit_status); |
5618 |
} |
5619 |
|
5620 |
void |
5621 |
lt_fatal (const char *message, ...) |
5622 |
{ |
5623 |
va_list ap; |
5624 |
va_start (ap, message); |
5625 |
lt_error_core (EXIT_FAILURE, "FATAL", message, ap); |
5626 |
va_end (ap); |
5627 |
} |
5628 |
EOF |
5629 |
# we should really use a build-platform specific compiler |
5630 |
# here, but OTOH, the wrappers (shell script and this C one) |
5631 |
# are only useful if you want to execute the "real" binary. |
5632 |
# Since the "real" binary is built for $host, then this |
5633 |
# wrapper might as well be built for $host, too. |
5634 |
$run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource |
5635 |
;; |
5636 |
esac |
5637 |
$rm $output |
5638 |
trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 |
5639 |
|
5640 |
$echo > $output "\ |
5641 |
#! $SHELL |
5642 |
|
5643 |
# $output - temporary wrapper script for $objdir/$outputname |
5644 |
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
5645 |
# |
5646 |
# The $output program cannot be directly executed until all the libtool |
5647 |
# libraries that it depends on are installed. |
5648 |
# |
5649 |
# This wrapper script should never be moved out of the build directory. |
5650 |
# If it is, it will not operate correctly. |
5651 |
|
5652 |
# Sed substitution that helps us do robust quoting. It backslashifies |
5653 |
# metacharacters that are still active within double-quoted strings. |
5654 |
Xsed='${SED} -e 1s/^X//' |
5655 |
sed_quote_subst='$sed_quote_subst' |
5656 |
|
5657 |
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). |
5658 |
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then |
5659 |
emulate sh |
5660 |
NULLCMD=: |
5661 |
# Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which |
5662 |
# is contrary to our usage. Disable this feature. |
5663 |
alias -g '\${1+\"\$@\"}'='\"\$@\"' |
5664 |
setopt NO_GLOB_SUBST |
5665 |
else |
5666 |
case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac |
5667 |
fi |
5668 |
BIN_SH=xpg4; export BIN_SH # for Tru64 |
5669 |
DUALCASE=1; export DUALCASE # for MKS sh |
5670 |
|
5671 |
# The HP-UX ksh and POSIX shell print the target directory to stdout |
5672 |
# if CDPATH is set. |
5673 |
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH |
5674 |
|
5675 |
relink_command=\"$relink_command\" |
5676 |
|
5677 |
# This environment variable determines our operation mode. |
5678 |
if test \"\$libtool_install_magic\" = \"$magic\"; then |
5679 |
# install mode needs the following variable: |
5680 |
notinst_deplibs='$notinst_deplibs' |
5681 |
else |
5682 |
# When we are sourced in execute mode, \$file and \$echo are already set. |
5683 |
if test \"\$libtool_execute_magic\" != \"$magic\"; then |
5684 |
echo=\"$qecho\" |
5685 |
file=\"\$0\" |
5686 |
# Make sure echo works. |
5687 |
if test \"X\$1\" = X--no-reexec; then |
5688 |
# Discard the --no-reexec flag, and continue. |
5689 |
shift |
5690 |
elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then |
5691 |
# Yippee, \$echo works! |
5692 |
: |
5693 |
else |
5694 |
# Restart under the correct shell, and then maybe \$echo will work. |
5695 |
exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} |
5696 |
fi |
5697 |
fi\ |
5698 |
" |
5699 |
$echo >> $output "\ |
5700 |
|
5701 |
# Find the directory that this script lives in. |
5702 |
thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` |
5703 |
test \"x\$thisdir\" = \"x\$file\" && thisdir=. |
5704 |
|
5705 |
# Follow symbolic links until we get to the real thisdir. |
5706 |
file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` |
5707 |
while test -n \"\$file\"; do |
5708 |
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` |
5709 |
|
5710 |
# If there was a directory component, then change thisdir. |
5711 |
if test \"x\$destdir\" != \"x\$file\"; then |
5712 |
case \"\$destdir\" in |
5713 |
[\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; |
5714 |
*) thisdir=\"\$thisdir/\$destdir\" ;; |
5715 |
esac |
5716 |
fi |
5717 |
|
5718 |
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` |
5719 |
file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` |
5720 |
done |
5721 |
|
5722 |
# Try to get the absolute directory name. |
5723 |
absdir=\`cd \"\$thisdir\" && pwd\` |
5724 |
test -n \"\$absdir\" && thisdir=\"\$absdir\" |
5725 |
" |
5726 |
|
5727 |
if test "$fast_install" = yes; then |
5728 |
$echo >> $output "\ |
5729 |
program=lt-'$outputname'$exeext |
5730 |
progdir=\"\$thisdir/$objdir\" |
5731 |
|
5732 |
if test ! -f \"\$progdir/\$program\" || \\ |
5733 |
{ file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ |
5734 |
test \"X\$file\" != \"X\$progdir/\$program\"; }; then |
5735 |
|
5736 |
file=\"\$\$-\$program\" |
5737 |
|
5738 |
if test ! -d \"\$progdir\"; then |
5739 |
$mkdir \"\$progdir\" |
5740 |
else |
5741 |
$rm \"\$progdir/\$file\" |
5742 |
fi" |
5743 |
|
5744 |
$echo >> $output "\ |
5745 |
|
5746 |
# relink executable if necessary |
5747 |
if test -n \"\$relink_command\"; then |
5748 |
if relink_command_output=\`eval \$relink_command 2>&1\`; then : |
5749 |
else |
5750 |
$echo \"\$relink_command_output\" >&2 |
5751 |
$rm \"\$progdir/\$file\" |
5752 |
exit $EXIT_FAILURE |
5753 |
fi |
5754 |
fi |
5755 |
|
5756 |
$mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || |
5757 |
{ $rm \"\$progdir/\$program\"; |
5758 |
$mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } |
5759 |
$rm \"\$progdir/\$file\" |
5760 |
fi" |
5761 |
else |
5762 |
$echo >> $output "\ |
5763 |
program='$outputname' |
5764 |
progdir=\"\$thisdir/$objdir\" |
5765 |
" |
5766 |
fi |
5767 |
|
5768 |
$echo >> $output "\ |
5769 |
|
5770 |
if test -f \"\$progdir/\$program\"; then" |
5771 |
|
5772 |
# Export our shlibpath_var if we have one. |
5773 |
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then |
5774 |
$echo >> $output "\ |
5775 |
# Add our own library path to $shlibpath_var |
5776 |
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\" |
5777 |
|
5778 |
# Some systems cannot cope with colon-terminated $shlibpath_var |
5779 |
# The second colon is a workaround for a bug in BeOS R4 sed |
5780 |
$shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` |
5781 |
|
5782 |
export $shlibpath_var |
5783 |
" |
5784 |
fi |
5785 |
|
5786 |
# fixup the dll searchpath if we need to. |
5787 |
if test -n "$dllsearchpath"; then |
5788 |
$echo >> $output "\ |
5789 |
# Add the dll search path components to the executable PATH |
5790 |
PATH=$dllsearchpath:\$PATH |
5791 |
" |
5792 |
fi |
5793 |
|
5794 |
$echo >> $output "\ |
5795 |
if test \"\$libtool_execute_magic\" != \"$magic\"; then |
5796 |
# Run the actual program with our arguments. |
5797 |
" |
5798 |
case $host in |
5799 |
# Backslashes separate directories on plain windows |
5800 |
*-*-mingw | *-*-os2*) |
5801 |
$echo >> $output "\ |
5802 |
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} |
5803 |
" |
5804 |
;; |
5805 |
|
5806 |
*) |
5807 |
$echo >> $output "\ |
5808 |
exec \"\$progdir/\$program\" \${1+\"\$@\"} |
5809 |
" |
5810 |
;; |
5811 |
esac |
5812 |
$echo >> $output "\ |
5813 |
\$echo \"\$0: cannot exec \$program \$*\" |
5814 |
exit $EXIT_FAILURE |
5815 |
fi |
5816 |
else |
5817 |
# The program doesn't exist. |
5818 |
\$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 |
5819 |
\$echo \"This script is just a wrapper for \$program.\" 1>&2 |
5820 |
$echo \"See the $PACKAGE documentation for more information.\" 1>&2 |
5821 |
exit $EXIT_FAILURE |
5822 |
fi |
5823 |
fi\ |
5824 |
" |
5825 |
chmod +x $output |
5826 |
fi |
5827 |
exit $EXIT_SUCCESS |
5828 |
;; |
5829 |
esac |
5830 |
|
5831 |
# See if we need to build an old-fashioned archive. |
5832 |
for oldlib in $oldlibs; do |
5833 |
|
5834 |
if test "$build_libtool_libs" = convenience; then |
5835 |
oldobjs="$libobjs_save" |
5836 |
addlibs="$convenience" |
5837 |
build_libtool_libs=no |
5838 |
else |
5839 |
if test "$build_libtool_libs" = module; then |
5840 |
oldobjs="$libobjs_save" |
5841 |
build_libtool_libs=no |
5842 |
else |
5843 |
oldobjs="$old_deplibs $non_pic_objects" |
5844 |
fi |
5845 |
addlibs="$old_convenience" |
5846 |
fi |
5847 |
|
5848 |
if test -n "$addlibs"; then |
5849 |
gentop="$output_objdir/${outputname}x" |
5850 |
generated="$generated $gentop" |
5851 |
|
5852 |
func_extract_archives $gentop $addlibs |
5853 |
oldobjs="$oldobjs $func_extract_archives_result" |
5854 |
fi |
5855 |
|
5856 |
# Do each command in the archive commands. |
5857 |
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then |
5858 |
cmds=$old_archive_from_new_cmds |
5859 |
else |
5860 |
# POSIX demands no paths to be encoded in archives. We have |
5861 |
# to avoid creating archives with duplicate basenames if we |
5862 |
# might have to extract them afterwards, e.g., when creating a |
5863 |
# static archive out of a convenience library, or when linking |
5864 |
# the entirety of a libtool archive into another (currently |
5865 |
# not supported by libtool). |
5866 |
if (for obj in $oldobjs |
5867 |
do |
5868 |
$echo "X$obj" | $Xsed -e 's%^.*/%%' |
5869 |
done | sort | sort -uc >/dev/null 2>&1); then |
5870 |
: |
5871 |
else |
5872 |
$echo "copying selected object files to avoid basename conflicts..." |
5873 |
|
5874 |
if test -z "$gentop"; then |
5875 |
gentop="$output_objdir/${outputname}x" |
5876 |
generated="$generated $gentop" |
5877 |
|
5878 |
$show "${rm}r $gentop" |
5879 |
$run ${rm}r "$gentop" |
5880 |
$show "$mkdir $gentop" |
5881 |
$run $mkdir "$gentop" |
5882 |
exit_status=$? |
5883 |
if test "$exit_status" -ne 0 && test ! -d "$gentop"; then |
5884 |
exit $exit_status |
5885 |
fi |
5886 |
fi |
5887 |
|
5888 |
save_oldobjs=$oldobjs |
5889 |
oldobjs= |
5890 |
counter=1 |
5891 |
for obj in $save_oldobjs |
5892 |
do |
5893 |
objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
5894 |
case " $oldobjs " in |
5895 |
" ") oldobjs=$obj ;; |
5896 |
*[\ /]"$objbase "*) |
5897 |
while :; do |
5898 |
# Make sure we don't pick an alternate name that also |
5899 |
# overlaps. |
5900 |
newobj=lt$counter-$objbase |
5901 |
counter=`expr $counter + 1` |
5902 |
case " $oldobjs " in |
5903 |
*[\ /]"$newobj "*) ;; |
5904 |
*) if test ! -f "$gentop/$newobj"; then break; fi ;; |
5905 |
esac |
5906 |
done |
5907 |
$show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" |
5908 |
$run ln "$obj" "$gentop/$newobj" || |
5909 |
$run cp "$obj" "$gentop/$newobj" |
5910 |
oldobjs="$oldobjs $gentop/$newobj" |
5911 |
;; |
5912 |
*) oldobjs="$oldobjs $obj" ;; |
5913 |
esac |
5914 |
done |
5915 |
fi |
5916 |
|
5917 |
eval cmds=\"$old_archive_cmds\" |
5918 |
|
5919 |
if len=`expr "X$cmds" : ".*"` && |
5920 |
test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
5921 |
cmds=$old_archive_cmds |
5922 |
else |
5923 |
# the command line is too long to link in one step, link in parts |
5924 |
$echo "using piecewise archive linking..." |
5925 |
save_RANLIB=$RANLIB |
5926 |
RANLIB=: |
5927 |
objlist= |
5928 |
concat_cmds= |
5929 |
save_oldobjs=$oldobjs |
5930 |
|
5931 |
# Is there a better way of finding the last object in the list? |
5932 |
for obj in $save_oldobjs |
5933 |
do |
5934 |
last_oldobj=$obj |
5935 |
done |
5936 |
for obj in $save_oldobjs |
5937 |
do |
5938 |
oldobjs="$objlist $obj" |
5939 |
objlist="$objlist $obj" |
5940 |
eval test_cmds=\"$old_archive_cmds\" |
5941 |
if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && |
5942 |
test "$len" -le "$max_cmd_len"; then |
5943 |
: |
5944 |
else |
5945 |
# the above command should be used before it gets too long |
5946 |
oldobjs=$objlist |
5947 |
if test "$obj" = "$last_oldobj" ; then |
5948 |
RANLIB=$save_RANLIB |
5949 |
fi |
5950 |
test -z "$concat_cmds" || concat_cmds=$concat_cmds~ |
5951 |
eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" |
5952 |
objlist= |
5953 |
fi |
5954 |
done |
5955 |
RANLIB=$save_RANLIB |
5956 |
oldobjs=$objlist |
5957 |
if test "X$oldobjs" = "X" ; then |
5958 |
eval cmds=\"\$concat_cmds\" |
5959 |
else |
5960 |
eval cmds=\"\$concat_cmds~\$old_archive_cmds\" |
5961 |
fi |
5962 |
fi |
5963 |
fi |
5964 |
save_ifs="$IFS"; IFS='~' |
5965 |
for cmd in $cmds; do |
5966 |
eval cmd=\"$cmd\" |
5967 |
IFS="$save_ifs" |
5968 |
$show "$cmd" |
5969 |
$run eval "$cmd" || exit $? |
5970 |
done |
5971 |
IFS="$save_ifs" |
5972 |
done |
5973 |
|
5974 |
if test -n "$generated"; then |
5975 |
$show "${rm}r$generated" |
5976 |
$run ${rm}r$generated |
5977 |
fi |
5978 |
|
5979 |
# Now create the libtool archive. |
5980 |
case $output in |
5981 |
*.la) |
5982 |
old_library= |
5983 |
test "$build_old_libs" = yes && old_library="$libname.$libext" |
5984 |
$show "creating $output" |
5985 |
|
5986 |
# Preserve any variables that may affect compiler behavior |
5987 |
for var in $variables_saved_for_relink; do |
5988 |
if eval test -z \"\${$var+set}\"; then |
5989 |
relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" |
5990 |
elif eval var_value=\$$var; test -z "$var_value"; then |
5991 |
relink_command="$var=; export $var; $relink_command" |
5992 |
else |
5993 |
var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` |
5994 |
relink_command="$var=\"$var_value\"; export $var; $relink_command" |
5995 |
fi |
5996 |
done |
5997 |
# Quote the link command for shipping. |
5998 |
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" |
5999 |
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` |
6000 |
if test "$hardcode_automatic" = yes ; then |
6001 |
relink_command= |
6002 |
fi |
6003 |
|
6004 |
|
6005 |
# Only create the output if not a dry run. |
6006 |
if test -z "$run"; then |
6007 |
for installed in no yes; do |
6008 |
if test "$installed" = yes; then |
6009 |
if test -z "$install_libdir"; then |
6010 |
break |
6011 |
fi |
6012 |
output="$output_objdir/$outputname"i |
6013 |
# Replace all uninstalled libtool libraries with the installed ones |
6014 |
newdependency_libs= |
6015 |
for deplib in $dependency_libs; do |
6016 |
case $deplib in |
6017 |
*.la) |
6018 |
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` |
6019 |
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
6020 |
if test -z "$libdir"; then |
6021 |
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
6022 |
exit $EXIT_FAILURE |
6023 |
fi |
6024 |
newdependency_libs="$newdependency_libs $libdir/$name" |
6025 |
;; |
6026 |
*) newdependency_libs="$newdependency_libs $deplib" ;; |
6027 |
esac |
6028 |
done |
6029 |
dependency_libs="$newdependency_libs" |
6030 |
newdlfiles= |
6031 |
for lib in $dlfiles; do |
6032 |
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
6033 |
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` |
6034 |
if test -z "$libdir"; then |
6035 |
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
6036 |
exit $EXIT_FAILURE |
6037 |
fi |
6038 |
newdlfiles="$newdlfiles $libdir/$name" |
6039 |
done |
6040 |
dlfiles="$newdlfiles" |
6041 |
newdlprefiles= |
6042 |
for lib in $dlprefiles; do |
6043 |
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
6044 |
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` |
6045 |
if test -z "$libdir"; then |
6046 |
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
6047 |
exit $EXIT_FAILURE |
6048 |
fi |
6049 |
newdlprefiles="$newdlprefiles $libdir/$name" |
6050 |
done |
6051 |
dlprefiles="$newdlprefiles" |
6052 |
else |
6053 |
newdlfiles= |
6054 |
for lib in $dlfiles; do |
6055 |
case $lib in |
6056 |
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; |
6057 |
*) abs=`pwd`"/$lib" ;; |
6058 |
esac |
6059 |
newdlfiles="$newdlfiles $abs" |
6060 |
done |
6061 |
dlfiles="$newdlfiles" |
6062 |
newdlprefiles= |
6063 |
for lib in $dlprefiles; do |
6064 |
case $lib in |
6065 |
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; |
6066 |
*) abs=`pwd`"/$lib" ;; |
6067 |
esac |
6068 |
newdlprefiles="$newdlprefiles $abs" |
6069 |
done |
6070 |
dlprefiles="$newdlprefiles" |
6071 |
fi |
6072 |
$rm $output |
6073 |
# place dlname in correct position for cygwin |
6074 |
tdlname=$dlname |
6075 |
case $host,$output,$installed,$module,$dlname in |
6076 |
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; |
6077 |
esac |
6078 |
$echo > $output "\ |
6079 |
# $outputname - a libtool library file |
6080 |
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
6081 |
# |
6082 |
# Please DO NOT delete this file! |
6083 |
# It is necessary for linking the library. |
6084 |
|
6085 |
# The name that we can dlopen(3). |
6086 |
dlname='$tdlname' |
6087 |
|
6088 |
# Names of this library. |
6089 |
library_names='$library_names' |
6090 |
|
6091 |
# The name of the static archive. |
6092 |
old_library='$old_library' |
6093 |
|
6094 |
# Libraries that this one depends upon. |
6095 |
dependency_libs='$dependency_libs' |
6096 |
|
6097 |
# Version information for $libname. |
6098 |
current=$current |
6099 |
age=$age |
6100 |
revision=$revision |
6101 |
|
6102 |
# Is this an already installed library? |
6103 |
installed=$installed |
6104 |
|
6105 |
# Should we warn about portability when linking against -modules? |
6106 |
shouldnotlink=$module |
6107 |
|
6108 |
# Files to dlopen/dlpreopen |
6109 |
dlopen='$dlfiles' |
6110 |
dlpreopen='$dlprefiles' |
6111 |
|
6112 |
# Directory that this library needs to be installed in: |
6113 |
libdir='$install_libdir'" |
6114 |
if test "$installed" = no && test "$need_relink" = yes; then |
6115 |
$echo >> $output "\ |
6116 |
relink_command=\"$relink_command\"" |
6117 |
fi |
6118 |
done |
6119 |
fi |
6120 |
|
6121 |
# Do a symbolic link so that the libtool archive can be found in |
6122 |
# LD_LIBRARY_PATH before the program is installed. |
6123 |
$show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" |
6124 |
$run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? |
6125 |
;; |
6126 |
esac |
6127 |
exit $EXIT_SUCCESS |
6128 |
;; |
6129 |
|
6130 |
# libtool install mode |
6131 |
install) |
6132 |
modename="$modename: install" |
6133 |
|
6134 |
# There may be an optional sh(1) argument at the beginning of |
6135 |
# install_prog (especially on Windows NT). |
6136 |
if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || |
6137 |
# Allow the use of GNU shtool's install command. |
6138 |
$echo "X$nonopt" | grep shtool > /dev/null; then |
6139 |
# Aesthetically quote it. |
6140 |
arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` |
6141 |
case $arg in |
6142 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
6143 |
arg="\"$arg\"" |
6144 |
;; |
6145 |
esac |
6146 |
install_prog="$arg " |
6147 |
arg="$1" |
6148 |
shift |
6149 |
else |
6150 |
install_prog= |
6151 |
arg=$nonopt |
6152 |
fi |
6153 |
|
6154 |
# The real first argument should be the name of the installation program. |
6155 |
# Aesthetically quote it. |
6156 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
6157 |
case $arg in |
6158 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
6159 |
arg="\"$arg\"" |
6160 |
;; |
6161 |
esac |
6162 |
install_prog="$install_prog$arg" |
6163 |
|
6164 |
# We need to accept at least all the BSD install flags. |
6165 |
dest= |
6166 |
files= |
6167 |
opts= |
6168 |
prev= |
6169 |
install_type= |
6170 |
isdir=no |
6171 |
stripme= |
6172 |
for arg |
6173 |
do |
6174 |
if test -n "$dest"; then |
6175 |
files="$files $dest" |
6176 |
dest=$arg |
6177 |
continue |
6178 |
fi |
6179 |
|
6180 |
case $arg in |
6181 |
-d) isdir=yes ;; |
6182 |
-f) |
6183 |
case " $install_prog " in |
6184 |
*[\\\ /]cp\ *) ;; |
6185 |
*) prev=$arg ;; |
6186 |
esac |
6187 |
;; |
6188 |
-g | -m | -o) prev=$arg ;; |
6189 |
-s) |
6190 |
stripme=" -s" |
6191 |
continue |
6192 |
;; |
6193 |
-*) |
6194 |
;; |
6195 |
*) |
6196 |
# If the previous option needed an argument, then skip it. |
6197 |
if test -n "$prev"; then |
6198 |
prev= |
6199 |
else |
6200 |
dest=$arg |
6201 |
continue |
6202 |
fi |
6203 |
;; |
6204 |
esac |
6205 |
|
6206 |
# Aesthetically quote the argument. |
6207 |
arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
6208 |
case $arg in |
6209 |
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
6210 |
arg="\"$arg\"" |
6211 |
;; |
6212 |
esac |
6213 |
install_prog="$install_prog $arg" |
6214 |
done |
6215 |
|
6216 |
if test -z "$install_prog"; then |
6217 |
$echo "$modename: you must specify an install program" 1>&2 |
6218 |
$echo "$help" 1>&2 |
6219 |
exit $EXIT_FAILURE |
6220 |
fi |
6221 |
|
6222 |
if test -n "$prev"; then |
6223 |
$echo "$modename: the \`$prev' option requires an argument" 1>&2 |
6224 |
$echo "$help" 1>&2 |
6225 |
exit $EXIT_FAILURE |
6226 |
fi |
6227 |
|
6228 |
if test -z "$files"; then |
6229 |
if test -z "$dest"; then |
6230 |
$echo "$modename: no file or destination specified" 1>&2 |
6231 |
else |
6232 |
$echo "$modename: you must specify a destination" 1>&2 |
6233 |
fi |
6234 |
$echo "$help" 1>&2 |
6235 |
exit $EXIT_FAILURE |
6236 |
fi |
6237 |
|
6238 |
# Strip any trailing slash from the destination. |
6239 |
dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` |
6240 |
|
6241 |
# Check to see that the destination is a directory. |
6242 |
test -d "$dest" && isdir=yes |
6243 |
if test "$isdir" = yes; then |
6244 |
destdir="$dest" |
6245 |
destname= |
6246 |
else |
6247 |
destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` |
6248 |
test "X$destdir" = "X$dest" && destdir=. |
6249 |
destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` |
6250 |
|
6251 |
# Not a directory, so check to see that there is only one file specified. |
6252 |
set dummy $files |
6253 |
if test "$#" -gt 2; then |
6254 |
$echo "$modename: \`$dest' is not a directory" 1>&2 |
6255 |
$echo "$help" 1>&2 |
6256 |
exit $EXIT_FAILURE |
6257 |
fi |
6258 |
fi |
6259 |
case $destdir in |
6260 |
[\\/]* | [A-Za-z]:[\\/]*) ;; |
6261 |
*) |
6262 |
for file in $files; do |
6263 |
case $file in |
6264 |
*.lo) ;; |
6265 |
*) |
6266 |
$echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 |
6267 |
$echo "$help" 1>&2 |
6268 |
exit $EXIT_FAILURE |
6269 |
;; |
6270 |
esac |
6271 |
done |
6272 |
;; |
6273 |
esac |
6274 |
|
6275 |
# This variable tells wrapper scripts just to set variables rather |
6276 |
# than running their programs. |
6277 |
libtool_install_magic="$magic" |
6278 |
|
6279 |
staticlibs= |
6280 |
future_libdirs= |
6281 |
current_libdirs= |
6282 |
for file in $files; do |
6283 |
|
6284 |
# Do each installation. |
6285 |
case $file in |
6286 |
*.$libext) |
6287 |
# Do the static libraries later. |
6288 |
staticlibs="$staticlibs $file" |
6289 |
;; |
6290 |
|
6291 |
*.la) |
6292 |
# Check to see that this really is a libtool archive. |
6293 |
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
6294 |
else |
6295 |
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2 |
6296 |
$echo "$help" 1>&2 |
6297 |
exit $EXIT_FAILURE |
6298 |
fi |
6299 |
|
6300 |
library_names= |
6301 |
old_library= |
6302 |
relink_command= |
6303 |
# If there is no directory component, then add one. |
6304 |
case $file in |
6305 |
*/* | *\\*) . $file ;; |
6306 |
*) . ./$file ;; |
6307 |
esac |
6308 |
|
6309 |
# Add the libdir to current_libdirs if it is the destination. |
6310 |
if test "X$destdir" = "X$libdir"; then |
6311 |
case "$current_libdirs " in |
6312 |
*" $libdir "*) ;; |
6313 |
*) current_libdirs="$current_libdirs $libdir" ;; |
6314 |
esac |
6315 |
else |
6316 |
# Note the libdir as a future libdir. |
6317 |
case "$future_libdirs " in |
6318 |
*" $libdir "*) ;; |
6319 |
*) future_libdirs="$future_libdirs $libdir" ;; |
6320 |
esac |
6321 |
fi |
6322 |
|
6323 |
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ |
6324 |
test "X$dir" = "X$file/" && dir= |
6325 |
dir="$dir$objdir" |
6326 |
|
6327 |
if test -n "$relink_command"; then |
6328 |
# Determine the prefix the user has applied to our future dir. |
6329 |
inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` |
6330 |
|
6331 |
# Don't allow the user to place us outside of our expected |
6332 |
# location b/c this prevents finding dependent libraries that |
6333 |
# are installed to the same prefix. |
6334 |
# At present, this check doesn't affect windows .dll's that |
6335 |
# are installed into $libdir/../bin (currently, that works fine) |
6336 |
# but it's something to keep an eye on. |
6337 |
if test "$inst_prefix_dir" = "$destdir"; then |
6338 |
$echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 |
6339 |
exit $EXIT_FAILURE |
6340 |
fi |
6341 |
|
6342 |
if test -n "$inst_prefix_dir"; then |
6343 |
# Stick the inst_prefix_dir data into the link command. |
6344 |
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` |
6345 |
else |
6346 |
relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` |
6347 |
fi |
6348 |
|
6349 |
$echo "$modename: warning: relinking \`$file'" 1>&2 |
6350 |
$show "$relink_command" |
6351 |
if $run eval "$relink_command"; then : |
6352 |
else |
6353 |
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 |
6354 |
exit $EXIT_FAILURE |
6355 |
fi |
6356 |
fi |
6357 |
|
6358 |
# See the names of the shared library. |
6359 |
set dummy $library_names |
6360 |
if test -n "$2"; then |
6361 |
realname="$2" |
6362 |
shift |
6363 |
shift |
6364 |
|
6365 |
srcname="$realname" |
6366 |
test -n "$relink_command" && srcname="$realname"T |
6367 |
|
6368 |
# Install the shared library and build the symlinks. |
6369 |
$show "$install_prog $dir/$srcname $destdir/$realname" |
6370 |
$run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? |
6371 |
if test -n "$stripme" && test -n "$striplib"; then |
6372 |
$show "$striplib $destdir/$realname" |
6373 |
$run eval "$striplib $destdir/$realname" || exit $? |
6374 |
fi |
6375 |
|
6376 |
if test "$#" -gt 0; then |
6377 |
# Delete the old symlinks, and create new ones. |
6378 |
# Try `ln -sf' first, because the `ln' binary might depend on |
6379 |
# the symlink we replace! Solaris /bin/ln does not understand -f, |
6380 |
# so we also need to try rm && ln -s. |
6381 |
for linkname |
6382 |
do |
6383 |
if test "$linkname" != "$realname"; then |
6384 |
$show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" |
6385 |
$run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" |
6386 |
fi |
6387 |
done |
6388 |
fi |
6389 |
|
6390 |
# Do each command in the postinstall commands. |
6391 |
lib="$destdir/$realname" |
6392 |
cmds=$postinstall_cmds |
6393 |
save_ifs="$IFS"; IFS='~' |
6394 |
for cmd in $cmds; do |
6395 |
IFS="$save_ifs" |
6396 |
eval cmd=\"$cmd\" |
6397 |
$show "$cmd" |
6398 |
$run eval "$cmd" || { |
6399 |
lt_exit=$? |
6400 |
|
6401 |
# Restore the uninstalled library and exit |
6402 |
if test "$mode" = relink; then |
6403 |
$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' |
6404 |
fi |
6405 |
|
6406 |
exit $lt_exit |
6407 |
} |
6408 |
done |
6409 |
IFS="$save_ifs" |
6410 |
fi |
6411 |
|
6412 |
# Install the pseudo-library for information purposes. |
6413 |
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
6414 |
instname="$dir/$name"i |
6415 |
$show "$install_prog $instname $destdir/$name" |
6416 |
$run eval "$install_prog $instname $destdir/$name" || exit $? |
6417 |
|
6418 |
# Maybe install the static library, too. |
6419 |
test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" |
6420 |
;; |
6421 |
|
6422 |
*.lo) |
6423 |
# Install (i.e. copy) a libtool object. |
6424 |
|
6425 |
# Figure out destination file name, if it wasn't already specified. |
6426 |
if test -n "$destname"; then |
6427 |
destfile="$destdir/$destname" |
6428 |
else |
6429 |
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
6430 |
destfile="$destdir/$destfile" |
6431 |
fi |
6432 |
|
6433 |
# Deduce the name of the destination old-style object file. |
6434 |
case $destfile in |
6435 |
*.lo) |
6436 |
staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` |
6437 |
;; |
6438 |
*.$objext) |
6439 |
staticdest="$destfile" |
6440 |
destfile= |
6441 |
;; |
6442 |
*) |
6443 |
$echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 |
6444 |
$echo "$help" 1>&2 |
6445 |
exit $EXIT_FAILURE |
6446 |
;; |
6447 |
esac |
6448 |
|
6449 |
# Install the libtool object if requested. |
6450 |
if test -n "$destfile"; then |
6451 |
$show "$install_prog $file $destfile" |
6452 |
$run eval "$install_prog $file $destfile" || exit $? |
6453 |
fi |
6454 |
|
6455 |
# Install the old object if enabled. |
6456 |
if test "$build_old_libs" = yes; then |
6457 |
# Deduce the name of the old-style object file. |
6458 |
staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` |
6459 |
|
6460 |
$show "$install_prog $staticobj $staticdest" |
6461 |
$run eval "$install_prog \$staticobj \$staticdest" || exit $? |
6462 |
fi |
6463 |
exit $EXIT_SUCCESS |
6464 |
;; |
6465 |
|
6466 |
*) |
6467 |
# Figure out destination file name, if it wasn't already specified. |
6468 |
if test -n "$destname"; then |
6469 |
destfile="$destdir/$destname" |
6470 |
else |
6471 |
destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
6472 |
destfile="$destdir/$destfile" |
6473 |
fi |
6474 |
|
6475 |
# If the file is missing, and there is a .exe on the end, strip it |
6476 |
# because it is most likely a libtool script we actually want to |
6477 |
# install |
6478 |
stripped_ext="" |
6479 |
case $file in |
6480 |
*.exe) |
6481 |
if test ! -f "$file"; then |
6482 |
file=`$echo $file|${SED} 's,.exe$,,'` |
6483 |
stripped_ext=".exe" |
6484 |
fi |
6485 |
;; |
6486 |
esac |
6487 |
|
6488 |
# Do a test to see if this is really a libtool program. |
6489 |
case $host in |
6490 |
*cygwin*|*mingw*) |
6491 |
wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` |
6492 |
;; |
6493 |
*) |
6494 |
wrapper=$file |
6495 |
;; |
6496 |
esac |
6497 |
if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then |
6498 |
notinst_deplibs= |
6499 |
relink_command= |
6500 |
|
6501 |
# Note that it is not necessary on cygwin/mingw to append a dot to |
6502 |
# foo even if both foo and FILE.exe exist: automatic-append-.exe |
6503 |
# behavior happens only for exec(3), not for open(2)! Also, sourcing |
6504 |
# `FILE.' does not work on cygwin managed mounts. |
6505 |
# |
6506 |
# If there is no directory component, then add one. |
6507 |
case $wrapper in |
6508 |
*/* | *\\*) . ${wrapper} ;; |
6509 |
*) . ./${wrapper} ;; |
6510 |
esac |
6511 |
|
6512 |
# Check the variables that should have been set. |
6513 |
if test -z "$notinst_deplibs"; then |
6514 |
$echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 |
6515 |
exit $EXIT_FAILURE |
6516 |
fi |
6517 |
|
6518 |
finalize=yes |
6519 |
for lib in $notinst_deplibs; do |
6520 |
# Check to see that each library is installed. |
6521 |
libdir= |
6522 |
if test -f "$lib"; then |
6523 |
# If there is no directory component, then add one. |
6524 |
case $lib in |
6525 |
*/* | *\\*) . $lib ;; |
6526 |
*) . ./$lib ;; |
6527 |
esac |
6528 |
fi |
6529 |
libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test |
6530 |
if test -n "$libdir" && test ! -f "$libfile"; then |
6531 |
$echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 |
6532 |
finalize=no |
6533 |
fi |
6534 |
done |
6535 |
|
6536 |
relink_command= |
6537 |
# Note that it is not necessary on cygwin/mingw to append a dot to |
6538 |
# foo even if both foo and FILE.exe exist: automatic-append-.exe |
6539 |
# behavior happens only for exec(3), not for open(2)! Also, sourcing |
6540 |
# `FILE.' does not work on cygwin managed mounts. |
6541 |
# |
6542 |
# If there is no directory component, then add one. |
6543 |
case $wrapper in |
6544 |
*/* | *\\*) . ${wrapper} ;; |
6545 |
*) . ./${wrapper} ;; |
6546 |
esac |
6547 |
|
6548 |
outputname= |
6549 |
if test "$fast_install" = no && test -n "$relink_command"; then |
6550 |
if test "$finalize" = yes && test -z "$run"; then |
6551 |
tmpdir=`func_mktempdir` |
6552 |
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` |
6553 |
outputname="$tmpdir/$file" |
6554 |
# Replace the output file specification. |
6555 |
relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` |
6556 |
|
6557 |
$show "$relink_command" |
6558 |
if $run eval "$relink_command"; then : |
6559 |
else |
6560 |
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 |
6561 |
${rm}r "$tmpdir" |
6562 |
continue |
6563 |
fi |
6564 |
file="$outputname" |
6565 |
else |
6566 |
$echo "$modename: warning: cannot relink \`$file'" 1>&2 |
6567 |
fi |
6568 |
else |
6569 |
# Install the binary that we compiled earlier. |
6570 |
file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` |
6571 |
fi |
6572 |
fi |
6573 |
|
6574 |
# remove .exe since cygwin /usr/bin/install will append another |
6575 |
# one anyway |
6576 |
case $install_prog,$host in |
6577 |
*/usr/bin/install*,*cygwin*) |
6578 |
case $file:$destfile in |
6579 |
*.exe:*.exe) |
6580 |
# this is ok |
6581 |
;; |
6582 |
*.exe:*) |
6583 |
destfile=$destfile.exe |
6584 |
;; |
6585 |
*:*.exe) |
6586 |
destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` |
6587 |
;; |
6588 |
esac |
6589 |
;; |
6590 |
esac |
6591 |
$show "$install_prog$stripme $file $destfile" |
6592 |
$run eval "$install_prog\$stripme \$file \$destfile" || exit $? |
6593 |
test -n "$outputname" && ${rm}r "$tmpdir" |
6594 |
;; |
6595 |
esac |
6596 |
done |
6597 |
|
6598 |
for file in $staticlibs; do |
6599 |
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
6600 |
|
6601 |
# Set up the ranlib parameters. |
6602 |
oldlib="$destdir/$name" |
6603 |
|
6604 |
$show "$install_prog $file $oldlib" |
6605 |
$run eval "$install_prog \$file \$oldlib" || exit $? |
6606 |
|
6607 |
if test -n "$stripme" && test -n "$old_striplib"; then |
6608 |
$show "$old_striplib $oldlib" |
6609 |
$run eval "$old_striplib $oldlib" || exit $? |
6610 |
fi |
6611 |
|
6612 |
# Do each command in the postinstall commands. |
6613 |
cmds=$old_postinstall_cmds |
6614 |
save_ifs="$IFS"; IFS='~' |
6615 |
for cmd in $cmds; do |
6616 |
IFS="$save_ifs" |
6617 |
eval cmd=\"$cmd\" |
6618 |
$show "$cmd" |
6619 |
$run eval "$cmd" || exit $? |
6620 |
done |
6621 |
IFS="$save_ifs" |
6622 |
done |
6623 |
|
6624 |
if test -n "$future_libdirs"; then |
6625 |
$echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 |
6626 |
fi |
6627 |
|
6628 |
if test -n "$current_libdirs"; then |
6629 |
# Maybe just do a dry run. |
6630 |
test -n "$run" && current_libdirs=" -n$current_libdirs" |
6631 |
exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' |
6632 |
else |
6633 |
exit $EXIT_SUCCESS |
6634 |
fi |
6635 |
;; |
6636 |
|
6637 |
# libtool finish mode |
6638 |
finish) |
6639 |
modename="$modename: finish" |
6640 |
libdirs="$nonopt" |
6641 |
admincmds= |
6642 |
|
6643 |
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then |
6644 |
for dir |
6645 |
do |
6646 |
libdirs="$libdirs $dir" |
6647 |
done |
6648 |
|
6649 |
for libdir in $libdirs; do |
6650 |
if test -n "$finish_cmds"; then |
6651 |
# Do each command in the finish commands. |
6652 |
cmds=$finish_cmds |
6653 |
save_ifs="$IFS"; IFS='~' |
6654 |
for cmd in $cmds; do |
6655 |
IFS="$save_ifs" |
6656 |
eval cmd=\"$cmd\" |
6657 |
$show "$cmd" |
6658 |
$run eval "$cmd" || admincmds="$admincmds |
6659 |
$cmd" |
6660 |
done |
6661 |
IFS="$save_ifs" |
6662 |
fi |
6663 |
if test -n "$finish_eval"; then |
6664 |
# Do the single finish_eval. |
6665 |
eval cmds=\"$finish_eval\" |
6666 |
$run eval "$cmds" || admincmds="$admincmds |
6667 |
$cmds" |
6668 |
fi |
6669 |
done |
6670 |
fi |
6671 |
|
6672 |
# Exit here if they wanted silent mode. |
6673 |
test "$show" = : && exit $EXIT_SUCCESS |
6674 |
|
6675 |
$echo "X----------------------------------------------------------------------" | $Xsed |
6676 |
$echo "Libraries have been installed in:" |
6677 |
for libdir in $libdirs; do |
6678 |
$echo " $libdir" |
6679 |
done |
6680 |
$echo |
6681 |
$echo "If you ever happen to want to link against installed libraries" |
6682 |
$echo "in a given directory, LIBDIR, you must either use libtool, and" |
6683 |
$echo "specify the full pathname of the library, or use the \`-LLIBDIR'" |
6684 |
$echo "flag during linking and do at least one of the following:" |
6685 |
if test -n "$shlibpath_var"; then |
6686 |
$echo " - add LIBDIR to the \`$shlibpath_var' environment variable" |
6687 |
$echo " during execution" |
6688 |
fi |
6689 |
if test -n "$runpath_var"; then |
6690 |
$echo " - add LIBDIR to the \`$runpath_var' environment variable" |
6691 |
$echo " during linking" |
6692 |
fi |
6693 |
if test -n "$hardcode_libdir_flag_spec"; then |
6694 |
libdir=LIBDIR |
6695 |
eval flag=\"$hardcode_libdir_flag_spec\" |
6696 |
|
6697 |
$echo " - use the \`$flag' linker flag" |
6698 |
fi |
6699 |
if test -n "$admincmds"; then |
6700 |
$echo " - have your system administrator run these commands:$admincmds" |
6701 |
fi |
6702 |
if test -f /etc/ld.so.conf; then |
6703 |
$echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" |
6704 |
fi |
6705 |
$echo |
6706 |
$echo "See any operating system documentation about shared libraries for" |
6707 |
$echo "more information, such as the ld(1) and ld.so(8) manual pages." |
6708 |
$echo "X----------------------------------------------------------------------" | $Xsed |
6709 |
exit $EXIT_SUCCESS |
6710 |
;; |
6711 |
|
6712 |
# libtool execute mode |
6713 |
execute) |
6714 |
modename="$modename: execute" |
6715 |
|
6716 |
# The first argument is the command name. |
6717 |
cmd="$nonopt" |
6718 |
if test -z "$cmd"; then |
6719 |
$echo "$modename: you must specify a COMMAND" 1>&2 |
6720 |
$echo "$help" |
6721 |
exit $EXIT_FAILURE |
6722 |
fi |
6723 |
|
6724 |
# Handle -dlopen flags immediately. |
6725 |
for file in $execute_dlfiles; do |
6726 |
if test ! -f "$file"; then |
6727 |
$echo "$modename: \`$file' is not a file" 1>&2 |
6728 |
$echo "$help" 1>&2 |
6729 |
exit $EXIT_FAILURE |
6730 |
fi |
6731 |
|
6732 |
dir= |
6733 |
case $file in |
6734 |
*.la) |
6735 |
# Check to see that this really is a libtool archive. |
6736 |
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
6737 |
else |
6738 |
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
6739 |
$echo "$help" 1>&2 |
6740 |
exit $EXIT_FAILURE |
6741 |
fi |
6742 |
|
6743 |
# Read the libtool library. |
6744 |
dlname= |
6745 |
library_names= |
6746 |
|
6747 |
# If there is no directory component, then add one. |
6748 |
case $file in |
6749 |
*/* | *\\*) . $file ;; |
6750 |
*) . ./$file ;; |
6751 |
esac |
6752 |
|
6753 |
# Skip this library if it cannot be dlopened. |
6754 |
if test -z "$dlname"; then |
6755 |
# Warn if it was a shared library. |
6756 |
test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" |
6757 |
continue |
6758 |
fi |
6759 |
|
6760 |
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` |
6761 |
test "X$dir" = "X$file" && dir=. |
6762 |
|
6763 |
if test -f "$dir/$objdir/$dlname"; then |
6764 |
dir="$dir/$objdir" |
6765 |
else |
6766 |
if test ! -f "$dir/$dlname"; then |
6767 |
$echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 |
6768 |
exit $EXIT_FAILURE |
6769 |
fi |
6770 |
fi |
6771 |
;; |
6772 |
|
6773 |
*.lo) |
6774 |
# Just add the directory containing the .lo file. |
6775 |
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` |
6776 |
test "X$dir" = "X$file" && dir=. |
6777 |
;; |
6778 |
|
6779 |
*) |
6780 |
$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 |
6781 |
continue |
6782 |
;; |
6783 |
esac |
6784 |
|
6785 |
# Get the absolute pathname. |
6786 |
absdir=`cd "$dir" && pwd` |
6787 |
test -n "$absdir" && dir="$absdir" |
6788 |
|
6789 |
# Now add the directory to shlibpath_var. |
6790 |
if eval "test -z \"\$$shlibpath_var\""; then |
6791 |
eval "$shlibpath_var=\"\$dir\"" |
6792 |
else |
6793 |
eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" |
6794 |
fi |
6795 |
done |
6796 |
|
6797 |
# This variable tells wrapper scripts just to set shlibpath_var |
6798 |
# rather than running their programs. |
6799 |
libtool_execute_magic="$magic" |
6800 |
|
6801 |
# Check if any of the arguments is a wrapper script. |
6802 |
args= |
6803 |
for file |
6804 |
do |
6805 |
case $file in |
6806 |
-*) ;; |
6807 |
*) |
6808 |
# Do a test to see if this is really a libtool program. |
6809 |
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
6810 |
# If there is no directory component, then add one. |
6811 |
case $file in |
6812 |
*/* | *\\*) . $file ;; |
6813 |
*) . ./$file ;; |
6814 |
esac |
6815 |
|
6816 |
# Transform arg to wrapped name. |
6817 |
file="$progdir/$program" |
6818 |
fi |
6819 |
;; |
6820 |
esac |
6821 |
# Quote arguments (to preserve shell metacharacters). |
6822 |
file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` |
6823 |
args="$args \"$file\"" |
6824 |
done |
6825 |
|
6826 |
if test -z "$run"; then |
6827 |
if test -n "$shlibpath_var"; then |
6828 |
# Export the shlibpath_var. |
6829 |
eval "export $shlibpath_var" |
6830 |
fi |
6831 |
|
6832 |
# Restore saved environment variables |
6833 |
for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES |
6834 |
do |
6835 |
eval "if test \"\${save_$lt_var+set}\" = set; then |
6836 |
$lt_var=\$save_$lt_var; export $lt_var |
6837 |
fi" |
6838 |
done |
6839 |
|
6840 |
# Now prepare to actually exec the command. |
6841 |
exec_cmd="\$cmd$args" |
6842 |
else |
6843 |
# Display what would be done. |
6844 |
if test -n "$shlibpath_var"; then |
6845 |
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" |
6846 |
$echo "export $shlibpath_var" |
6847 |
fi |
6848 |
$echo "$cmd$args" |
6849 |
exit $EXIT_SUCCESS |
6850 |
fi |
6851 |
;; |
6852 |
|
6853 |
# libtool clean and uninstall mode |
6854 |
clean | uninstall) |
6855 |
modename="$modename: $mode" |
6856 |
rm="$nonopt" |
6857 |
files= |
6858 |
rmforce= |
6859 |
exit_status=0 |
6860 |
|
6861 |
# This variable tells wrapper scripts just to set variables rather |
6862 |
# than running their programs. |
6863 |
libtool_install_magic="$magic" |
6864 |
|
6865 |
for arg |
6866 |
do |
6867 |
case $arg in |
6868 |
-f) rm="$rm $arg"; rmforce=yes ;; |
6869 |
-*) rm="$rm $arg" ;; |
6870 |
*) files="$files $arg" ;; |
6871 |
esac |
6872 |
done |
6873 |
|
6874 |
if test -z "$rm"; then |
6875 |
$echo "$modename: you must specify an RM program" 1>&2 |
6876 |
$echo "$help" 1>&2 |
6877 |
exit $EXIT_FAILURE |
6878 |
fi |
6879 |
|
6880 |
rmdirs= |
6881 |
|
6882 |
origobjdir="$objdir" |
6883 |
for file in $files; do |
6884 |
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` |
6885 |
if test "X$dir" = "X$file"; then |
6886 |
dir=. |
6887 |
objdir="$origobjdir" |
6888 |
else |
6889 |
objdir="$dir/$origobjdir" |
6890 |
fi |
6891 |
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
6892 |
test "$mode" = uninstall && objdir="$dir" |
6893 |
|
6894 |
# Remember objdir for removal later, being careful to avoid duplicates |
6895 |
if test "$mode" = clean; then |
6896 |
case " $rmdirs " in |
6897 |
*" $objdir "*) ;; |
6898 |
*) rmdirs="$rmdirs $objdir" ;; |
6899 |
esac |
6900 |
fi |
6901 |
|
6902 |
# Don't error if the file doesn't exist and rm -f was used. |
6903 |
if (test -L "$file") >/dev/null 2>&1 \ |
6904 |
|| (test -h "$file") >/dev/null 2>&1 \ |
6905 |
|| test -f "$file"; then |
6906 |
: |
6907 |
elif test -d "$file"; then |
6908 |
exit_status=1 |
6909 |
continue |
6910 |
elif test "$rmforce" = yes; then |
6911 |
continue |
6912 |
fi |
6913 |
|
6914 |
rmfiles="$file" |
6915 |
|
6916 |
case $name in |
6917 |
*.la) |
6918 |
# Possibly a libtool archive, so verify it. |
6919 |
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
6920 |
. $dir/$name |
6921 |
|
6922 |
# Delete the libtool libraries and symlinks. |
6923 |
for n in $library_names; do |
6924 |
rmfiles="$rmfiles $objdir/$n" |
6925 |
done |
6926 |
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" |
6927 |
|
6928 |
case "$mode" in |
6929 |
clean) |
6930 |
case " $library_names " in |
6931 |
# " " in the beginning catches empty $dlname |
6932 |
*" $dlname "*) ;; |
6933 |
*) rmfiles="$rmfiles $objdir/$dlname" ;; |
6934 |
esac |
6935 |
test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" |
6936 |
;; |
6937 |
uninstall) |
6938 |
if test -n "$library_names"; then |
6939 |
# Do each command in the postuninstall commands. |
6940 |
cmds=$postuninstall_cmds |
6941 |
save_ifs="$IFS"; IFS='~' |
6942 |
for cmd in $cmds; do |
6943 |
IFS="$save_ifs" |
6944 |
eval cmd=\"$cmd\" |
6945 |
$show "$cmd" |
6946 |
$run eval "$cmd" |
6947 |
if test "$?" -ne 0 && test "$rmforce" != yes; then |
6948 |
exit_status=1 |
6949 |
fi |
6950 |
done |
6951 |
IFS="$save_ifs" |
6952 |
fi |
6953 |
|
6954 |
if test -n "$old_library"; then |
6955 |
# Do each command in the old_postuninstall commands. |
6956 |
cmds=$old_postuninstall_cmds |
6957 |
save_ifs="$IFS"; IFS='~' |
6958 |
for cmd in $cmds; do |
6959 |
IFS="$save_ifs" |
6960 |
eval cmd=\"$cmd\" |
6961 |
$show "$cmd" |
6962 |
$run eval "$cmd" |
6963 |
if test "$?" -ne 0 && test "$rmforce" != yes; then |
6964 |
exit_status=1 |
6965 |
fi |
6966 |
done |
6967 |
IFS="$save_ifs" |
6968 |
fi |
6969 |
# FIXME: should reinstall the best remaining shared library. |
6970 |
;; |
6971 |
esac |
6972 |
fi |
6973 |
;; |
6974 |
|
6975 |
*.lo) |
6976 |
# Possibly a libtool object, so verify it. |
6977 |
if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
6978 |
|
6979 |
# Read the .lo file |
6980 |
. $dir/$name |
6981 |
|
6982 |
# Add PIC object to the list of files to remove. |
6983 |
if test -n "$pic_object" \ |
6984 |
&& test "$pic_object" != none; then |
6985 |
rmfiles="$rmfiles $dir/$pic_object" |
6986 |
fi |
6987 |
|
6988 |
# Add non-PIC object to the list of files to remove. |
6989 |
if test -n "$non_pic_object" \ |
6990 |
&& test "$non_pic_object" != none; then |
6991 |
rmfiles="$rmfiles $dir/$non_pic_object" |
6992 |
fi |
6993 |
fi |
6994 |
;; |
6995 |
|
6996 |
*) |
6997 |
if test "$mode" = clean ; then |
6998 |
noexename=$name |
6999 |
case $file in |
7000 |
*.exe) |
7001 |
file=`$echo $file|${SED} 's,.exe$,,'` |
7002 |
noexename=`$echo $name|${SED} 's,.exe$,,'` |
7003 |
# $file with .exe has already been added to rmfiles, |
7004 |
# add $file without .exe |
7005 |
rmfiles="$rmfiles $file" |
7006 |
;; |
7007 |
esac |
7008 |
# Do a test to see if this is a libtool program. |
7009 |
if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
7010 |
relink_command= |
7011 |
. $dir/$noexename |
7012 |
|
7013 |
# note $name still contains .exe if it was in $file originally |
7014 |
# as does the version of $file that was added into $rmfiles |
7015 |
rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" |
7016 |
if test "$fast_install" = yes && test -n "$relink_command"; then |
7017 |
rmfiles="$rmfiles $objdir/lt-$name" |
7018 |
fi |
7019 |
if test "X$noexename" != "X$name" ; then |
7020 |
rmfiles="$rmfiles $objdir/lt-${noexename}.c" |
7021 |
fi |
7022 |
fi |
7023 |
fi |
7024 |
;; |
7025 |
esac |
7026 |
$show "$rm $rmfiles" |
7027 |
$run $rm $rmfiles || exit_status=1 |
7028 |
done |
7029 |
objdir="$origobjdir" |
7030 |
|
7031 |
# Try to remove the ${objdir}s in the directories where we deleted files |
7032 |
for dir in $rmdirs; do |
7033 |
if test -d "$dir"; then |
7034 |
$show "rmdir $dir" |
7035 |
$run rmdir $dir >/dev/null 2>&1 |
7036 |
fi |
7037 |
done |
7038 |
|
7039 |
exit $exit_status |
7040 |
;; |
7041 |
|
7042 |
"") |
7043 |
$echo "$modename: you must specify a MODE" 1>&2 |
7044 |
$echo "$generic_help" 1>&2 |
7045 |
exit $EXIT_FAILURE |
7046 |
;; |
7047 |
esac |
7048 |
|
7049 |
if test -z "$exec_cmd"; then |
7050 |
$echo "$modename: invalid operation mode \`$mode'" 1>&2 |
7051 |
$echo "$generic_help" 1>&2 |
7052 |
exit $EXIT_FAILURE |
7053 |
fi |
7054 |
fi # test -z "$show_help" |
7055 |
|
7056 |
if test -n "$exec_cmd"; then |
7057 |
eval exec $exec_cmd |
7058 |
exit $EXIT_FAILURE |
7059 |
fi |
7060 |
|
7061 |
# We need to display help for each of the modes. |
7062 |
case $mode in |
7063 |
"") $echo \ |
7064 |
"Usage: $modename [OPTION]... [MODE-ARG]... |
7065 |
|
7066 |
Provide generalized library-building support services. |
7067 |
|
7068 |
--config show all configuration variables |
7069 |
--debug enable verbose shell tracing |
7070 |
-n, --dry-run display commands without modifying any files |
7071 |
--features display basic configuration information and exit |
7072 |
--finish same as \`--mode=finish' |
7073 |
--help display this help message and exit |
7074 |
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] |
7075 |
--quiet same as \`--silent' |
7076 |
--silent don't print informational messages |
7077 |
--tag=TAG use configuration variables from tag TAG |
7078 |
--version print version information |
7079 |
|
7080 |
MODE must be one of the following: |
7081 |
|
7082 |
clean remove files from the build directory |
7083 |
compile compile a source file into a libtool object |
7084 |
execute automatically set library path, then run a program |
7085 |
finish complete the installation of libtool libraries |
7086 |
install install libraries or executables |
7087 |
link create a library or an executable |
7088 |
uninstall remove libraries from an installed directory |
7089 |
|
7090 |
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for |
7091 |
a more detailed description of MODE. |
7092 |
|
7093 |
Report bugs to <bug-libtool@gnu.org>." |
7094 |
exit $EXIT_SUCCESS |
7095 |
;; |
7096 |
|
7097 |
clean) |
7098 |
$echo \ |
7099 |
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... |
7100 |
|
7101 |
Remove files from the build directory. |
7102 |
|
7103 |
RM is the name of the program to use to delete files associated with each FILE |
7104 |
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed |
7105 |
to RM. |
7106 |
|
7107 |
If FILE is a libtool library, object or program, all the files associated |
7108 |
with it are deleted. Otherwise, only FILE itself is deleted using RM." |
7109 |
;; |
7110 |
|
7111 |
compile) |
7112 |
$echo \ |
7113 |
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE |
7114 |
|
7115 |
Compile a source file into a libtool library object. |
7116 |
|
7117 |
This mode accepts the following additional options: |
7118 |
|
7119 |
-o OUTPUT-FILE set the output file name to OUTPUT-FILE |
7120 |
-prefer-pic try to building PIC objects only |
7121 |
-prefer-non-pic try to building non-PIC objects only |
7122 |
-static always build a \`.o' file suitable for static linking |
7123 |
|
7124 |
COMPILE-COMMAND is a command to be used in creating a \`standard' object file |
7125 |
from the given SOURCEFILE. |
7126 |
|
7127 |
The output file name is determined by removing the directory component from |
7128 |
SOURCEFILE, then substituting the C source code suffix \`.c' with the |
7129 |
library object suffix, \`.lo'." |
7130 |
;; |
7131 |
|
7132 |
execute) |
7133 |
$echo \ |
7134 |
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... |
7135 |
|
7136 |
Automatically set library path, then run a program. |
7137 |
|
7138 |
This mode accepts the following additional options: |
7139 |
|
7140 |
-dlopen FILE add the directory containing FILE to the library path |
7141 |
|
7142 |
This mode sets the library path environment variable according to \`-dlopen' |
7143 |
flags. |
7144 |
|
7145 |
If any of the ARGS are libtool executable wrappers, then they are translated |
7146 |
into their corresponding uninstalled binary, and any of their required library |
7147 |
directories are added to the library path. |
7148 |
|
7149 |
Then, COMMAND is executed, with ARGS as arguments." |
7150 |
;; |
7151 |
|
7152 |
finish) |
7153 |
$echo \ |
7154 |
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... |
7155 |
|
7156 |
Complete the installation of libtool libraries. |
7157 |
|
7158 |
Each LIBDIR is a directory that contains libtool libraries. |
7159 |
|
7160 |
The commands that this mode executes may require superuser privileges. Use |
7161 |
the \`--dry-run' option if you just want to see what would be executed." |
7162 |
;; |
7163 |
|
7164 |
install) |
7165 |
$echo \ |
7166 |
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... |
7167 |
|
7168 |
Install executables or libraries. |
7169 |
|
7170 |
INSTALL-COMMAND is the installation command. The first component should be |
7171 |
either the \`install' or \`cp' program. |
7172 |
|
7173 |
The rest of the components are interpreted as arguments to that command (only |
7174 |
BSD-compatible install options are recognized)." |
7175 |
;; |
7176 |
|
7177 |
link) |
7178 |
$echo \ |
7179 |
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... |
7180 |
|
7181 |
Link object files or libraries together to form another library, or to |
7182 |
create an executable program. |
7183 |
|
7184 |
LINK-COMMAND is a command using the C compiler that you would use to create |
7185 |
a program from several object files. |
7186 |
|
7187 |
The following components of LINK-COMMAND are treated specially: |
7188 |
|
7189 |
-all-static do not do any dynamic linking at all |
7190 |
-avoid-version do not add a version suffix if possible |
7191 |
-dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime |
7192 |
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols |
7193 |
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) |
7194 |
-export-symbols SYMFILE |
7195 |
try to export only the symbols listed in SYMFILE |
7196 |
-export-symbols-regex REGEX |
7197 |
try to export only the symbols matching REGEX |
7198 |
-LLIBDIR search LIBDIR for required installed libraries |
7199 |
-lNAME OUTPUT-FILE requires the installed library libNAME |
7200 |
-module build a library that can dlopened |
7201 |
-no-fast-install disable the fast-install mode |
7202 |
-no-install link a not-installable executable |
7203 |
-no-undefined declare that a library does not refer to external symbols |
7204 |
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects |
7205 |
-objectlist FILE Use a list of object files found in FILE to specify objects |
7206 |
-precious-files-regex REGEX |
7207 |
don't remove output files matching REGEX |
7208 |
-release RELEASE specify package release information |
7209 |
-rpath LIBDIR the created library will eventually be installed in LIBDIR |
7210 |
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries |
7211 |
-static do not do any dynamic linking of uninstalled libtool libraries |
7212 |
-static-libtool-libs |
7213 |
do not do any dynamic linking of libtool libraries |
7214 |
-version-info CURRENT[:REVISION[:AGE]] |
7215 |
specify library version info [each variable defaults to 0] |
7216 |
|
7217 |
All other options (arguments beginning with \`-') are ignored. |
7218 |
|
7219 |
Every other argument is treated as a filename. Files ending in \`.la' are |
7220 |
treated as uninstalled libtool libraries, other files are standard or library |
7221 |
object files. |
7222 |
|
7223 |
If the OUTPUT-FILE ends in \`.la', then a libtool library is created, |
7224 |
only library objects (\`.lo' files) may be specified, and \`-rpath' is |
7225 |
required, except when creating a convenience library. |
7226 |
|
7227 |
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created |
7228 |
using \`ar' and \`ranlib', or on Windows using \`lib'. |
7229 |
|
7230 |
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file |
7231 |
is created, otherwise an executable program is created." |
7232 |
;; |
7233 |
|
7234 |
uninstall) |
7235 |
$echo \ |
7236 |
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... |
7237 |
|
7238 |
Remove libraries from an installation directory. |
7239 |
|
7240 |
RM is the name of the program to use to delete files associated with each FILE |
7241 |
(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed |
7242 |
to RM. |
7243 |
|
7244 |
If FILE is a libtool library, all the files associated with it are deleted. |
7245 |
Otherwise, only FILE itself is deleted using RM." |
7246 |
;; |
7247 |
|
7248 |
*) |
7249 |
$echo "$modename: invalid operation mode \`$mode'" 1>&2 |
7250 |
$echo "$help" 1>&2 |
7251 |
exit $EXIT_FAILURE |
7252 |
;; |
7253 |
esac |
7254 |
|
7255 |
$echo |
7256 |
$echo "Try \`$modename --help' for more information about other modes." |
7257 |
|
7258 |
exit $? |
7259 |
|
7260 |
# The TAGs below are defined such that we never get into a situation |
7261 |
# in which we disable both kinds of libraries. Given conflicting |
7262 |
# choices, we go for a static library, that is the most portable, |
7263 |
# since we can't tell whether shared libraries were disabled because |
7264 |
# the user asked for that or because the platform doesn't support |
7265 |
# them. This is particularly important on AIX, because we don't |
7266 |
# support having both static and shared libraries enabled at the same |
7267 |
# time on that platform, so we default to a shared-only configuration. |
7268 |
# If a disable-shared tag is given, we'll fallback to a static-only |
7269 |
# configuration. But we'll never go from static-only to shared-only. |
7270 |
|
7271 |
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared |
7272 |
disable_libs=shared |
7273 |
# ### END LIBTOOL TAG CONFIG: disable-shared |
7274 |
|
7275 |
# ### BEGIN LIBTOOL TAG CONFIG: disable-static |
7276 |
disable_libs=static |
7277 |
# ### END LIBTOOL TAG CONFIG: disable-static |
7278 |
|
7279 |
# Local Variables: |
7280 |
# mode:shell-script |
7281 |
# sh-indentation:2 |
7282 |
# End: |
7283 |
# ### BEGIN LIBTOOL TAG CONFIG: CXX |
7284 |
|
7285 |
# Libtool was configured on host hell: |
7286 |
|
7287 |
# Shell to use when invoking shell scripts. |
7288 |
SHELL="/bin/sh" |
7289 |
|
7290 |
# Whether or not to build shared libraries. |
7291 |
build_libtool_libs=yes |
7292 |
|
7293 |
# Whether or not to build static libraries. |
7294 |
build_old_libs=no |
7295 |
|
7296 |
# Whether or not to add -lc for building shared libraries. |
7297 |
build_libtool_need_lc=no |
7298 |
|
7299 |
# Whether or not to disallow shared libs when runtime libs are static |
7300 |
allow_libtool_libs_with_static_runtimes=no |
7301 |
|
7302 |
# Whether or not to optimize for fast installation. |
7303 |
fast_install=yes |
7304 |
|
7305 |
# The host system. |
7306 |
host_alias= |
7307 |
host=i686-pc-linux-gnu |
7308 |
host_os=linux-gnu |
7309 |
|
7310 |
# The build system. |
7311 |
build_alias= |
7312 |
build=i686-pc-linux-gnu |
7313 |
build_os=linux-gnu |
7314 |
|
7315 |
# An echo program that does not interpret backslashes. |
7316 |
echo="echo" |
7317 |
|
7318 |
# The archiver. |
7319 |
AR="ar" |
7320 |
AR_FLAGS="cru" |
7321 |
|
7322 |
# A C compiler. |
7323 |
LTCC="gcc" |
7324 |
|
7325 |
# LTCC compiler flags. |
7326 |
LTCFLAGS="-g -O2" |
7327 |
|
7328 |
# A language-specific compiler. |
7329 |
CC="g++" |
7330 |
|
7331 |
# Is the compiler the GNU C compiler? |
7332 |
with_gcc=yes |
7333 |
|
7334 |
# An ERE matcher. |
7335 |
EGREP="/bin/grep -E" |
7336 |
|
7337 |
# The linker used to build libraries. |
7338 |
LD="/usr/bin/ld" |
7339 |
|
7340 |
# Whether we need hard or soft links. |
7341 |
LN_S="ln -s" |
7342 |
|
7343 |
# A BSD-compatible nm program. |
7344 |
NM="/usr/bin/nm -B" |
7345 |
|
7346 |
# A symbol stripping program |
7347 |
STRIP="strip" |
7348 |
|
7349 |
# Used to examine libraries when file_magic_cmd begins "file" |
7350 |
MAGIC_CMD=file |
7351 |
|
7352 |
# Used on cygwin: DLL creation program. |
7353 |
DLLTOOL="dlltool" |
7354 |
|
7355 |
# Used on cygwin: object dumper. |
7356 |
OBJDUMP="objdump" |
7357 |
|
7358 |
# Used on cygwin: assembler. |
7359 |
AS="as" |
7360 |
|
7361 |
# The name of the directory that contains temporary libtool files. |
7362 |
objdir=.libs |
7363 |
|
7364 |
# How to create reloadable object files. |
7365 |
reload_flag=" -r" |
7366 |
reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" |
7367 |
|
7368 |
# How to pass a linker flag through the compiler. |
7369 |
wl="-Wl," |
7370 |
|
7371 |
# Object file suffix (normally "o"). |
7372 |
objext="o" |
7373 |
|
7374 |
# Old archive suffix (normally "a"). |
7375 |
libext="a" |
7376 |
|
7377 |
# Shared library suffix (normally ".so"). |
7378 |
shrext_cmds='.so' |
7379 |
|
7380 |
# Executable file suffix (normally ""). |
7381 |
exeext="" |
7382 |
|
7383 |
# Additional compiler flags for building library objects. |
7384 |
pic_flag=" -fPIC -DPIC" |
7385 |
pic_mode=default |
7386 |
|
7387 |
# What is the maximum length of a command? |
7388 |
max_cmd_len=98304 |
7389 |
|
7390 |
# Does compiler simultaneously support -c and -o options? |
7391 |
compiler_c_o="yes" |
7392 |
|
7393 |
# Must we lock files when doing compilation? |
7394 |
need_locks="no" |
7395 |
|
7396 |
# Do we need the lib prefix for modules? |
7397 |
need_lib_prefix=no |
7398 |
|
7399 |
# Do we need a version for libraries? |
7400 |
need_version=no |
7401 |
|
7402 |
# Whether dlopen is supported. |
7403 |
dlopen_support=yes |
7404 |
|
7405 |
# Whether dlopen of programs is supported. |
7406 |
dlopen_self=yes |
7407 |
|
7408 |
# Whether dlopen of statically linked programs is supported. |
7409 |
dlopen_self_static=yes |
7410 |
|
7411 |
# Compiler flag to prevent dynamic linking. |
7412 |
link_static_flag="" |
7413 |
|
7414 |
# Compiler flag to turn off builtin functions. |
7415 |
no_builtin_flag=" -fno-builtin" |
7416 |
|
7417 |
# Compiler flag to allow reflexive dlopens. |
7418 |
export_dynamic_flag_spec="\${wl}--export-dynamic" |
7419 |
|
7420 |
# Compiler flag to generate shared objects directly from archives. |
7421 |
whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" |
7422 |
|
7423 |
# Compiler flag to generate thread-safe objects. |
7424 |
thread_safe_flag_spec="" |
7425 |
|
7426 |
# Library versioning type. |
7427 |
version_type=linux |
7428 |
|
7429 |
# Format of library name prefix. |
7430 |
libname_spec="lib\$name" |
7431 |
|
7432 |
# List of archive names. First name is the real one, the rest are links. |
7433 |
# The last name is the one that the linker finds with -lNAME. |
7434 |
library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}" |
7435 |
|
7436 |
# The coded name of the library, if different from the real name. |
7437 |
soname_spec="\${libname}\${release}\${shared_ext}\$major" |
7438 |
|
7439 |
# Commands used to build and install an old-style archive. |
7440 |
RANLIB="ranlib" |
7441 |
old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib" |
7442 |
old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib" |
7443 |
old_postuninstall_cmds="" |
7444 |
|
7445 |
# Create an old-style archive from a shared archive. |
7446 |
old_archive_from_new_cmds="" |
7447 |
|
7448 |
# Create a temporary old-style archive to link instead of a shared archive. |
7449 |
old_archive_from_expsyms_cmds="" |
7450 |
|
7451 |
# Commands used to build and install a shared archive. |
7452 |
archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" |
7453 |
archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib" |
7454 |
postinstall_cmds="" |
7455 |
postuninstall_cmds="" |
7456 |
|
7457 |
# Commands used to build a loadable module (assumed same as above if empty) |
7458 |
module_cmds="" |
7459 |
module_expsym_cmds="" |
7460 |
|
7461 |
# Commands to strip libraries. |
7462 |
old_striplib="strip --strip-debug" |
7463 |
striplib="strip --strip-unneeded" |
7464 |
|
7465 |
# Dependencies to place before the objects being linked to create a |
7466 |
# shared library. |
7467 |
predep_objects="/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1/../../../crti.o /usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1/crtbeginS.o" |
7468 |
|
7469 |
# Dependencies to place after the objects being linked to create a |
7470 |
# shared library. |
7471 |
postdep_objects="/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1/crtendS.o /usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1/../../../crtn.o" |
7472 |
|
7473 |
# Dependencies to place before the objects being linked to create a |
7474 |
# shared library. |
7475 |
predeps="" |
7476 |
|
7477 |
# Dependencies to place after the objects being linked to create a |
7478 |
# shared library. |
7479 |
postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s" |
7480 |
|
7481 |
# The library search path used internally by the compiler when linking |
7482 |
# a shared library. |
7483 |
compiler_lib_search_path="-L/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1 -L/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1 -L/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1/../../.." |
7484 |
|
7485 |
# Method to check whether dependent libraries are shared objects. |
7486 |
deplibs_check_method="pass_all" |
7487 |
|
7488 |
# Command to use when deplibs_check_method == file_magic. |
7489 |
file_magic_cmd="\$MAGIC_CMD" |
7490 |
|
7491 |
# Flag that allows shared libraries with undefined symbols to be built. |
7492 |
allow_undefined_flag="" |
7493 |
|
7494 |
# Flag that forces no undefined symbols. |
7495 |
no_undefined_flag="" |
7496 |
|
7497 |
# Commands used to finish a libtool library installation in a directory. |
7498 |
finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" |
7499 |
|
7500 |
# Same as above, but a single script fragment to be evaled but not shown. |
7501 |
finish_eval="" |
7502 |
|
7503 |
# Take the output of nm and produce a listing of raw symbols and C names. |
7504 |
global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'" |
7505 |
|
7506 |
# Transform the output of nm in a proper C declaration |
7507 |
global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" |
7508 |
|
7509 |
# Transform the output of nm in a C name address pair |
7510 |
global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" |
7511 |
|
7512 |
# This is the shared library runtime path variable. |
7513 |
runpath_var=LD_RUN_PATH |
7514 |
|
7515 |
# This is the shared library path variable. |
7516 |
shlibpath_var=LD_LIBRARY_PATH |
7517 |
|
7518 |
# Is shlibpath searched before the hard-coded library search path? |
7519 |
shlibpath_overrides_runpath=no |
7520 |
|
7521 |
# How to hardcode a shared library path into an executable. |
7522 |
hardcode_action=immediate |
7523 |
|
7524 |
# Whether we should hardcode library paths into libraries. |
7525 |
hardcode_into_libs=yes |
7526 |
|
7527 |
# Flag to hardcode $libdir into a binary during linking. |
7528 |
# This must work even if $libdir does not exist. |
7529 |
hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" |
7530 |
|
7531 |
# If ld is used when linking, flag to hardcode $libdir into |
7532 |
# a binary during linking. This must work even if $libdir does |
7533 |
# not exist. |
7534 |
hardcode_libdir_flag_spec_ld="" |
7535 |
|
7536 |
# Whether we need a single -rpath flag with a separated argument. |
7537 |
hardcode_libdir_separator="" |
7538 |
|
7539 |
# Set to yes if using DIR/libNAME during linking hardcodes DIR into the |
7540 |
# resulting binary. |
7541 |
hardcode_direct=no |
7542 |
|
7543 |
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the |
7544 |
# resulting binary. |
7545 |
hardcode_minus_L=no |
7546 |
|
7547 |
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into |
7548 |
# the resulting binary. |
7549 |
hardcode_shlibpath_var=unsupported |
7550 |
|
7551 |
# Set to yes if building a shared library automatically hardcodes DIR into the library |
7552 |
# and all subsequent libraries and executables linked against it. |
7553 |
hardcode_automatic=no |
7554 |
|
7555 |
# Variables whose values should be saved in libtool wrapper scripts and |
7556 |
# restored at relink time. |
7557 |
variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" |
7558 |
|
7559 |
# Whether libtool must link a program against all its dependency libraries. |
7560 |
link_all_deplibs=unknown |
7561 |
|
7562 |
# Compile-time system search path for libraries |
7563 |
sys_lib_search_path_spec="/usr/lib/gcc/i586-mandriva-linux-gnu/4.1.1 /usr/lib /lib" |
7564 |
|
7565 |
# Run-time system search path for libraries |
7566 |
sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/X11R6/lib /usr/lib/qt3/lib " |
7567 |
|
7568 |
# Fix the shell variable $srcfile for the compiler. |
7569 |
fix_srcfile_path="" |
7570 |
|
7571 |
# Set to yes if exported symbols are required. |
7572 |
always_export_symbols=no |
7573 |
|
7574 |
# The commands to list exported symbols. |
7575 |
export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" |
7576 |
|
7577 |
# The commands to extract the exported symbol list from a shared archive. |
7578 |
extract_expsyms_cmds="" |
7579 |
|
7580 |
# Symbols that should not be listed in the preloaded symbols. |
7581 |
exclude_expsyms="" |
7582 |
|
7583 |
# Symbols that must always be exported. |
7584 |
include_expsyms="" |
7585 |
|
7586 |
# ### END LIBTOOL TAG CONFIG: CXX |
7587 |
|