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