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