1 | #! /bin/sh |
---|
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="/bin/sed" |
---|
34 | |
---|
35 | # Sed that helps us avoid accidentally triggering echo(1) options like -n. |
---|
36 | Xsed="/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 red-herring.mit.edu: |
---|
48 | |
---|
49 | # Shell to use when invoking shell scripts. |
---|
50 | SHELL="/bin/sh" |
---|
51 | |
---|
52 | # Whether or not to build shared libraries. |
---|
53 | build_libtool_libs=yes |
---|
54 | |
---|
55 | # Whether or not to build static libraries. |
---|
56 | build_old_libs=yes |
---|
57 | |
---|
58 | # Whether or not to add -lc for building shared libraries. |
---|
59 | build_libtool_need_lc=no |
---|
60 | |
---|
61 | # Whether or not to disallow shared libs when runtime libs are static |
---|
62 | allow_libtool_libs_with_static_runtimes=no |
---|
63 | |
---|
64 | # Whether or not to optimize for fast installation. |
---|
65 | fast_install=yes |
---|
66 | |
---|
67 | # The host system. |
---|
68 | host_alias= |
---|
69 | host=i686-redhat-linux-gnu |
---|
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="grep -E" |
---|
89 | |
---|
90 | # The linker used to build libraries. |
---|
91 | LD="/usr/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/bin/nm -B" |
---|
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=32768 |
---|
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="\${wl}--export-dynamic" |
---|
172 | |
---|
173 | # Compiler flag to generate shared objects directly from archives. |
---|
174 | whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" |
---|
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 \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" |
---|
206 | archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~ |
---|
207 | cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~ |
---|
208 | \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~ |
---|
209 | \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib" |
---|
210 | postinstall_cmds="" |
---|
211 | postuninstall_cmds="" |
---|
212 | |
---|
213 | # Commands used to build a loadable module (assumed same as above if empty) |
---|
214 | module_cmds="" |
---|
215 | module_expsym_cmds="" |
---|
216 | |
---|
217 | # Commands to strip libraries. |
---|
218 | old_striplib="strip --strip-debug" |
---|
219 | striplib="strip --strip-unneeded" |
---|
220 | |
---|
221 | # Dependencies to place before the objects being linked to create a |
---|
222 | # shared library. |
---|
223 | predep_objects="" |
---|
224 | |
---|
225 | # Dependencies to place after the objects being linked to create a |
---|
226 | # shared library. |
---|
227 | postdep_objects="" |
---|
228 | |
---|
229 | # Dependencies to place before the objects being linked to create a |
---|
230 | # shared library. |
---|
231 | predeps="" |
---|
232 | |
---|
233 | # Dependencies to place after the objects being linked to create a |
---|
234 | # shared library. |
---|
235 | postdeps="" |
---|
236 | |
---|
237 | # The library search path used internally by the compiler when linking |
---|
238 | # a shared library. |
---|
239 | compiler_lib_search_path="" |
---|
240 | |
---|
241 | # Method to check whether dependent libraries are shared objects. |
---|
242 | deplibs_check_method="pass_all" |
---|
243 | |
---|
244 | # Command to use when deplibs_check_method == file_magic. |
---|
245 | file_magic_cmd="\$MAGIC_CMD" |
---|
246 | |
---|
247 | # Flag that allows shared libraries with undefined symbols to be built. |
---|
248 | allow_undefined_flag="" |
---|
249 | |
---|
250 | # Flag that forces no undefined symbols. |
---|
251 | no_undefined_flag="" |
---|
252 | |
---|
253 | # Commands used to finish a libtool library installation in a directory. |
---|
254 | finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" |
---|
255 | |
---|
256 | # Same as above, but a single script fragment to be evaled but not shown. |
---|
257 | finish_eval="" |
---|
258 | |
---|
259 | # Take the output of nm and produce a listing of raw symbols and C names. |
---|
260 | global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" |
---|
261 | |
---|
262 | # Transform the output of nm in a proper C declaration |
---|
263 | global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" |
---|
264 | |
---|
265 | # Transform the output of nm in a C name address pair |
---|
266 | global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" |
---|
267 | |
---|
268 | # This is the shared library runtime path variable. |
---|
269 | runpath_var=LD_RUN_PATH |
---|
270 | |
---|
271 | # This is the shared library path variable. |
---|
272 | shlibpath_var=LD_LIBRARY_PATH |
---|
273 | |
---|
274 | # Is shlibpath searched before the hard-coded library search path? |
---|
275 | shlibpath_overrides_runpath=no |
---|
276 | |
---|
277 | # How to hardcode a shared library path into an executable. |
---|
278 | hardcode_action=immediate |
---|
279 | |
---|
280 | # Whether we should hardcode library paths into libraries. |
---|
281 | hardcode_into_libs=yes |
---|
282 | |
---|
283 | # Flag to hardcode $libdir into a binary during linking. |
---|
284 | # This must work even if $libdir does not exist. |
---|
285 | hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" |
---|
286 | |
---|
287 | # If ld is used when linking, flag to hardcode $libdir into |
---|
288 | # a binary during linking. This must work even if $libdir does |
---|
289 | # not exist. |
---|
290 | hardcode_libdir_flag_spec_ld="" |
---|
291 | |
---|
292 | # Whether we need a single -rpath flag with a separated argument. |
---|
293 | hardcode_libdir_separator="" |
---|
294 | |
---|
295 | # Set to yes if using DIR/libNAME during linking hardcodes DIR into the |
---|
296 | # resulting binary. |
---|
297 | hardcode_direct=no |
---|
298 | |
---|
299 | # Set to yes if using the -LDIR flag during linking hardcodes DIR into the |
---|
300 | # resulting binary. |
---|
301 | hardcode_minus_L=no |
---|
302 | |
---|
303 | # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into |
---|
304 | # the resulting binary. |
---|
305 | hardcode_shlibpath_var=unsupported |
---|
306 | |
---|
307 | # Set to yes if building a shared library automatically hardcodes DIR into the library |
---|
308 | # and all subsequent libraries and executables linked against it. |
---|
309 | hardcode_automatic=no |
---|
310 | |
---|
311 | # Variables whose values should be saved in libtool wrapper scripts and |
---|
312 | # restored at relink time. |
---|
313 | variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" |
---|
314 | |
---|
315 | # Whether libtool must link a program against all its dependency libraries. |
---|
316 | link_all_deplibs=unknown |
---|
317 | |
---|
318 | # Compile-time system search path for libraries |
---|
319 | sys_lib_search_path_spec=" /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../ /lib/i386-redhat-linux/3.4.6/ /lib/ /usr/lib/i386-redhat-linux/3.4.6/ /usr/lib/" |
---|
320 | |
---|
321 | # Run-time system search path for libraries |
---|
322 | sys_lib_dlsearch_path_spec="/lib /usr/lib include ld.so.conf.d/*.conf /usr/i486-linux-libc5/lib /usr/athena/lib " |
---|
323 | |
---|
324 | # Fix the shell variable $srcfile for the compiler. |
---|
325 | fix_srcfile_path="" |
---|
326 | |
---|
327 | # Set to yes if exported symbols are required. |
---|
328 | always_export_symbols=no |
---|
329 | |
---|
330 | # The commands to list exported symbols. |
---|
331 | export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" |
---|
332 | |
---|
333 | # The commands to extract the exported symbol list from a shared archive. |
---|
334 | extract_expsyms_cmds="" |
---|
335 | |
---|
336 | # Symbols that should not be listed in the preloaded symbols. |
---|
337 | exclude_expsyms="_GLOBAL_OFFSET_TABLE_" |
---|
338 | |
---|
339 | # Symbols that must always be exported. |
---|
340 | include_expsyms="" |
---|
341 | |
---|
342 | # ### END LIBTOOL CONFIG |
---|
343 | |
---|
344 | # ltmain.sh - Provide generalized library-building support services. |
---|
345 | # NOTE: Changing this file will not affect anything until you rerun configure. |
---|
346 | # |
---|
347 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 |
---|
348 | # Free Software Foundation, Inc. |
---|
349 | # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
---|
350 | # |
---|
351 | # This program is free software; you can redistribute it and/or modify |
---|
352 | # it under the terms of the GNU General Public License as published by |
---|
353 | # the Free Software Foundation; either version 2 of the License, or |
---|
354 | # (at your option) any later version. |
---|
355 | # |
---|
356 | # This program is distributed in the hope that it will be useful, but |
---|
357 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
358 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
359 | # General Public License for more details. |
---|
360 | # |
---|
361 | # You should have received a copy of the GNU General Public License |
---|
362 | # along with this program; if not, write to the Free Software |
---|
363 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
364 | # |
---|
365 | # As a special exception to the GNU General Public License, if you |
---|
366 | # distribute this file as part of a program that contains a |
---|
367 | # configuration script generated by Autoconf, you may include it under |
---|
368 | # the same distribution terms that you use for the rest of that program. |
---|
369 | |
---|
370 | basename="s,^.*/,,g" |
---|
371 | |
---|
372 | # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh |
---|
373 | # is ksh but when the shell is invoked as "sh" and the current value of |
---|
374 | # the _XPG environment variable is not equal to 1 (one), the special |
---|
375 | # positional parameter $0, within a function call, is the name of the |
---|
376 | # function. |
---|
377 | progpath="$0" |
---|
378 | |
---|
379 | # RH: define SED for historic ltconfig's generated by Libtool 1.3 |
---|
380 | [ -z "$SED" ] && SED=sed |
---|
381 | |
---|
382 | # The name of this program: |
---|
383 | progname=`echo "$progpath" | $SED $basename` |
---|
384 | modename="$progname" |
---|
385 | |
---|
386 | # Global variables: |
---|
387 | EXIT_SUCCESS=0 |
---|
388 | EXIT_FAILURE=1 |
---|
389 | |
---|
390 | PROGRAM=ltmain.sh |
---|
391 | PACKAGE=libtool |
---|
392 | VERSION=1.5.6 |
---|
393 | TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)" |
---|
394 | EGREP="grep -E" |
---|
395 | |
---|
396 | |
---|
397 | # Check that we have a working $echo. |
---|
398 | if test "X$1" = X--no-reexec; then |
---|
399 | # Discard the --no-reexec flag, and continue. |
---|
400 | shift |
---|
401 | elif test "X$1" = X--fallback-echo; then |
---|
402 | # Avoid inline document here, it may be left over |
---|
403 | : |
---|
404 | elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then |
---|
405 | # Yippee, $echo works! |
---|
406 | : |
---|
407 | else |
---|
408 | # Restart under the correct shell, and then maybe $echo will work. |
---|
409 | exec $SHELL "$progpath" --no-reexec ${1+"$@"} |
---|
410 | fi |
---|
411 | |
---|
412 | if test "X$1" = X--fallback-echo; then |
---|
413 | # used as fallback echo |
---|
414 | shift |
---|
415 | cat <<EOF |
---|
416 | $* |
---|
417 | EOF |
---|
418 | exit $EXIT_SUCCESS |
---|
419 | fi |
---|
420 | |
---|
421 | default_mode= |
---|
422 | help="Try \`$progname --help' for more information." |
---|
423 | magic="%%%MAGIC variable%%%" |
---|
424 | mkdir="mkdir" |
---|
425 | mv="mv -f" |
---|
426 | rm="rm -f" |
---|
427 | |
---|
428 | # Sed substitution that helps us do robust quoting. It backslashifies |
---|
429 | # metacharacters that are still active within double-quoted strings. |
---|
430 | Xsed="${SED}"' -e 1s/^X//' |
---|
431 | sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' |
---|
432 | # test EBCDIC or ASCII |
---|
433 | case `echo A|tr A '\301'` in |
---|
434 | A) # EBCDIC based system |
---|
435 | SP2NL="tr '\100' '\n'" |
---|
436 | NL2SP="tr '\r\n' '\100\100'" |
---|
437 | ;; |
---|
438 | *) # Assume ASCII based system |
---|
439 | SP2NL="tr '\040' '\012'" |
---|
440 | NL2SP="tr '\015\012' '\040\040'" |
---|
441 | ;; |
---|
442 | esac |
---|
443 | |
---|
444 | # NLS nuisances. |
---|
445 | # Only set LANG and LC_ALL to C if already set. |
---|
446 | # These must not be set unconditionally because not all systems understand |
---|
447 | # e.g. LANG=C (notably SCO). |
---|
448 | # We save the old values to restore during execute mode. |
---|
449 | if test "${LC_ALL+set}" = set; then |
---|
450 | save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL |
---|
451 | fi |
---|
452 | if test "${LANG+set}" = set; then |
---|
453 | save_LANG="$LANG"; LANG=C; export LANG |
---|
454 | fi |
---|
455 | |
---|
456 | # Make sure IFS has a sensible default |
---|
457 | : ${IFS=" |
---|
458 | "} |
---|
459 | |
---|
460 | if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then |
---|
461 | $echo "$modename: not configured to build any kind of library" 1>&2 |
---|
462 | $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
---|
463 | exit $EXIT_FAILURE |
---|
464 | fi |
---|
465 | |
---|
466 | # Global variables. |
---|
467 | mode=$default_mode |
---|
468 | nonopt= |
---|
469 | prev= |
---|
470 | prevopt= |
---|
471 | run= |
---|
472 | show="$echo" |
---|
473 | show_help= |
---|
474 | execute_dlfiles= |
---|
475 | lo2o="s/\\.lo\$/.${objext}/" |
---|
476 | o2lo="s/\\.${objext}\$/.lo/" |
---|
477 | |
---|
478 | ##################################### |
---|
479 | # Shell function definitions: |
---|
480 | # This seems to be the best place for them |
---|
481 | |
---|
482 | # func_win32_libid arg |
---|
483 | # return the library type of file 'arg' |
---|
484 | # |
---|
485 | # Need a lot of goo to handle *both* DLLs and import libs |
---|
486 | # Has to be a shell function in order to 'eat' the argument |
---|
487 | # that is supplied when $file_magic_command is called. |
---|
488 | func_win32_libid () { |
---|
489 | win32_libid_type="unknown" |
---|
490 | win32_fileres=`file -L $1 2>/dev/null` |
---|
491 | case $win32_fileres in |
---|
492 | *ar\ archive\ import\ library*) # definitely import |
---|
493 | win32_libid_type="x86 archive import" |
---|
494 | ;; |
---|
495 | *ar\ archive*) # could be an import, or static |
---|
496 | if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ |
---|
497 | $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then |
---|
498 | win32_nmres=`eval $NM -f posix -A $1 | \ |
---|
499 | sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` |
---|
500 | if test "X$win32_nmres" = "Ximport" ; then |
---|
501 | win32_libid_type="x86 archive import" |
---|
502 | else |
---|
503 | win32_libid_type="x86 archive static" |
---|
504 | fi |
---|
505 | fi |
---|
506 | ;; |
---|
507 | *DLL*) |
---|
508 | win32_libid_type="x86 DLL" |
---|
509 | ;; |
---|
510 | *executable*) # but shell scripts are "executable" too... |
---|
511 | case $win32_fileres in |
---|
512 | *MS\ Windows\ PE\ Intel*) |
---|
513 | win32_libid_type="x86 DLL" |
---|
514 | ;; |
---|
515 | esac |
---|
516 | ;; |
---|
517 | esac |
---|
518 | $echo $win32_libid_type |
---|
519 | } |
---|
520 | |
---|
521 | |
---|
522 | # func_infer_tag arg |
---|
523 | # Infer tagged configuration to use if any are available and |
---|
524 | # if one wasn't chosen via the "--tag" command line option. |
---|
525 | # Only attempt this if the compiler in the base compile |
---|
526 | # command doesn't match the default compiler. |
---|
527 | # arg is usually of the form 'gcc ...' |
---|
528 | func_infer_tag () { |
---|
529 | if test -n "$available_tags" && test -z "$tagname"; then |
---|
530 | CC_quoted= |
---|
531 | for arg in $CC; do |
---|
532 | case $arg in |
---|
533 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
---|
534 | arg="\"$arg\"" |
---|
535 | ;; |
---|
536 | esac |
---|
537 | CC_quoted="$CC_quoted $arg" |
---|
538 | done |
---|
539 | case $@ in |
---|
540 | # Blanks in the command may have been stripped by the calling shell, |
---|
541 | # but not from the CC environment variable when configure was run. |
---|
542 | " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; |
---|
543 | # Blanks at the start of $base_compile will cause this to fail |
---|
544 | # if we don't check for them as well. |
---|
545 | *) |
---|
546 | for z in $available_tags; do |
---|
547 | if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then |
---|
548 | # Evaluate the configuration. |
---|
549 | eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" |
---|
550 | CC_quoted= |
---|
551 | for arg in $CC; do |
---|
552 | # Double-quote args containing other shell metacharacters. |
---|
553 | case $arg in |
---|
554 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
---|
555 | arg="\"$arg\"" |
---|
556 | ;; |
---|
557 | esac |
---|
558 | CC_quoted="$CC_quoted $arg" |
---|
559 | done |
---|
560 | case "$@ " in |
---|
561 | " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) |
---|
562 | # The compiler in the base compile command matches |
---|
563 | # the one in the tagged configuration. |
---|
564 | # Assume this is the tagged configuration we want. |
---|
565 | tagname=$z |
---|
566 | break |
---|
567 | ;; |
---|
568 | esac |
---|
569 | fi |
---|
570 | done |
---|
571 | # If $tagname still isn't set, then no tagged configuration |
---|
572 | # was found and let the user know that the "--tag" command |
---|
573 | # line option must be used. |
---|
574 | if test -z "$tagname"; then |
---|
575 | $echo "$modename: unable to infer tagged configuration" |
---|
576 | $echo "$modename: specify a tag with \`--tag'" 1>&2 |
---|
577 | exit $EXIT_FAILURE |
---|
578 | # else |
---|
579 | # $echo "$modename: using $tagname tagged configuration" |
---|
580 | fi |
---|
581 | ;; |
---|
582 | esac |
---|
583 | fi |
---|
584 | } |
---|
585 | # End of Shell function definitions |
---|
586 | ##################################### |
---|
587 | |
---|
588 | # Darwin sucks |
---|
589 | eval std_shrext=\"$shrext_cmds\" |
---|
590 | |
---|
591 | # Parse our command line options once, thoroughly. |
---|
592 | while test "$#" -gt 0 |
---|
593 | do |
---|
594 | arg="$1" |
---|
595 | shift |
---|
596 | |
---|
597 | case $arg in |
---|
598 | -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; |
---|
599 | *) optarg= ;; |
---|
600 | esac |
---|
601 | |
---|
602 | # If the previous option needs an argument, assign it. |
---|
603 | if test -n "$prev"; then |
---|
604 | case $prev in |
---|
605 | execute_dlfiles) |
---|
606 | execute_dlfiles="$execute_dlfiles $arg" |
---|
607 | ;; |
---|
608 | tag) |
---|
609 | tagname="$arg" |
---|
610 | preserve_args="${preserve_args}=$arg" |
---|
611 | |
---|
612 | # Check whether tagname contains only valid characters |
---|
613 | case $tagname in |
---|
614 | *[!-_A-Za-z0-9,/]*) |
---|
615 | $echo "$progname: invalid tag name: $tagname" 1>&2 |
---|
616 | exit $EXIT_FAILURE |
---|
617 | ;; |
---|
618 | esac |
---|
619 | |
---|
620 | case $tagname in |
---|
621 | CC) |
---|
622 | # Don't test for the "default" C tag, as we know, it's there, but |
---|
623 | # not specially marked. |
---|
624 | ;; |
---|
625 | *) |
---|
626 | if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then |
---|
627 | taglist="$taglist $tagname" |
---|
628 | # Evaluate the configuration. |
---|
629 | eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" |
---|
630 | else |
---|
631 | $echo "$progname: ignoring unknown tag $tagname" 1>&2 |
---|
632 | fi |
---|
633 | ;; |
---|
634 | esac |
---|
635 | ;; |
---|
636 | *) |
---|
637 | eval "$prev=\$arg" |
---|
638 | ;; |
---|
639 | esac |
---|
640 | |
---|
641 | prev= |
---|
642 | prevopt= |
---|
643 | continue |
---|
644 | fi |
---|
645 | |
---|
646 | # Have we seen a non-optional argument yet? |
---|
647 | case $arg in |
---|
648 | --help) |
---|
649 | show_help=yes |
---|
650 | ;; |
---|
651 | |
---|
652 | --version) |
---|
653 | $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" |
---|
654 | $echo |
---|
655 | $echo "Copyright (C) 2003 Free Software Foundation, Inc." |
---|
656 | $echo "This is free software; see the source for copying conditions. There is NO" |
---|
657 | $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
---|
658 | exit $EXIT_SUCCESS |
---|
659 | ;; |
---|
660 | |
---|
661 | --config) |
---|
662 | ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath |
---|
663 | # Now print the configurations for the tags. |
---|
664 | for tagname in $taglist; do |
---|
665 | ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" |
---|
666 | done |
---|
667 | exit $EXIT_SUCCESS |
---|
668 | ;; |
---|
669 | |
---|
670 | --debug) |
---|
671 | $echo "$progname: enabling shell trace mode" |
---|
672 | set -x |
---|
673 | preserve_args="$preserve_args $arg" |
---|
674 | ;; |
---|
675 | |
---|
676 | --dry-run | -n) |
---|
677 | run=: |
---|
678 | ;; |
---|
679 | |
---|
680 | --features) |
---|
681 | $echo "host: $host" |
---|
682 | if test "$build_libtool_libs" = yes; then |
---|
683 | $echo "enable shared libraries" |
---|
684 | else |
---|
685 | $echo "disable shared libraries" |
---|
686 | fi |
---|
687 | if test "$build_old_libs" = yes; then |
---|
688 | $echo "enable static libraries" |
---|
689 | else |
---|
690 | $echo "disable static libraries" |
---|
691 | fi |
---|
692 | exit $EXIT_SUCCESS |
---|
693 | ;; |
---|
694 | |
---|
695 | --finish) mode="finish" ;; |
---|
696 | |
---|
697 | --mode) prevopt="--mode" prev=mode ;; |
---|
698 | --mode=*) mode="$optarg" ;; |
---|
699 | |
---|
700 | --preserve-dup-deps) duplicate_deps="yes" ;; |
---|
701 | |
---|
702 | --quiet | --silent) |
---|
703 | show=: |
---|
704 | preserve_args="$preserve_args $arg" |
---|
705 | ;; |
---|
706 | |
---|
707 | --tag) prevopt="--tag" prev=tag ;; |
---|
708 | --tag=*) |
---|
709 | set tag "$optarg" ${1+"$@"} |
---|
710 | shift |
---|
711 | prev=tag |
---|
712 | preserve_args="$preserve_args --tag" |
---|
713 | ;; |
---|
714 | |
---|
715 | -dlopen) |
---|
716 | prevopt="-dlopen" |
---|
717 | prev=execute_dlfiles |
---|
718 | ;; |
---|
719 | |
---|
720 | -*) |
---|
721 | $echo "$modename: unrecognized option \`$arg'" 1>&2 |
---|
722 | $echo "$help" 1>&2 |
---|
723 | exit $EXIT_FAILURE |
---|
724 | ;; |
---|
725 | |
---|
726 | *) |
---|
727 | nonopt="$arg" |
---|
728 | break |
---|
729 | ;; |
---|
730 | esac |
---|
731 | done |
---|
732 | |
---|
733 | if test -n "$prevopt"; then |
---|
734 | $echo "$modename: option \`$prevopt' requires an argument" 1>&2 |
---|
735 | $echo "$help" 1>&2 |
---|
736 | exit $EXIT_FAILURE |
---|
737 | fi |
---|
738 | |
---|
739 | # If this variable is set in any of the actions, the command in it |
---|
740 | # will be execed at the end. This prevents here-documents from being |
---|
741 | # left over by shells. |
---|
742 | exec_cmd= |
---|
743 | |
---|
744 | if test -z "$show_help"; then |
---|
745 | |
---|
746 | # Infer the operation mode. |
---|
747 | if test -z "$mode"; then |
---|
748 | $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 |
---|
749 | $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 |
---|
750 | case $nonopt in |
---|
751 | *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) |
---|
752 | mode=link |
---|
753 | for arg |
---|
754 | do |
---|
755 | case $arg in |
---|
756 | -c) |
---|
757 | mode=compile |
---|
758 | break |
---|
759 | ;; |
---|
760 | esac |
---|
761 | done |
---|
762 | ;; |
---|
763 | *db | *dbx | *strace | *truss) |
---|
764 | mode=execute |
---|
765 | ;; |
---|
766 | *install*|cp|mv) |
---|
767 | mode=install |
---|
768 | ;; |
---|
769 | *rm) |
---|
770 | mode=uninstall |
---|
771 | ;; |
---|
772 | *) |
---|
773 | # If we have no mode, but dlfiles were specified, then do execute mode. |
---|
774 | test -n "$execute_dlfiles" && mode=execute |
---|
775 | |
---|
776 | # Just use the default operation mode. |
---|
777 | if test -z "$mode"; then |
---|
778 | if test -n "$nonopt"; then |
---|
779 | $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 |
---|
780 | else |
---|
781 | $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 |
---|
782 | fi |
---|
783 | fi |
---|
784 | ;; |
---|
785 | esac |
---|
786 | fi |
---|
787 | |
---|
788 | # Only execute mode is allowed to have -dlopen flags. |
---|
789 | if test -n "$execute_dlfiles" && test "$mode" != execute; then |
---|
790 | $echo "$modename: unrecognized option \`-dlopen'" 1>&2 |
---|
791 | $echo "$help" 1>&2 |
---|
792 | exit $EXIT_FAILURE |
---|
793 | fi |
---|
794 | |
---|
795 | # Change the help message to a mode-specific one. |
---|
796 | generic_help="$help" |
---|
797 | help="Try \`$modename --help --mode=$mode' for more information." |
---|
798 | |
---|
799 | # These modes are in order of execution frequency so that they run quickly. |
---|
800 | case $mode in |
---|
801 | # libtool compile mode |
---|
802 | compile) |
---|
803 | modename="$modename: compile" |
---|
804 | # Get the compilation command and the source file. |
---|
805 | base_compile= |
---|
806 | srcfile="$nonopt" # always keep a non-empty value in "srcfile" |
---|
807 | suppress_opt=yes |
---|
808 | suppress_output= |
---|
809 | arg_mode=normal |
---|
810 | libobj= |
---|
811 | later= |
---|
812 | |
---|
813 | for arg |
---|
814 | do |
---|
815 | case "$arg_mode" in |
---|
816 | arg ) |
---|
817 | # do not "continue". Instead, add this to base_compile |
---|
818 | lastarg="$arg" |
---|
819 | arg_mode=normal |
---|
820 | ;; |
---|
821 | |
---|
822 | target ) |
---|
823 | libobj="$arg" |
---|
824 | arg_mode=normal |
---|
825 | continue |
---|
826 | ;; |
---|
827 | |
---|
828 | normal ) |
---|
829 | # Accept any command-line options. |
---|
830 | case $arg in |
---|
831 | -o) |
---|
832 | if test -n "$libobj" ; then |
---|
833 | $echo "$modename: you cannot specify \`-o' more than once" 1>&2 |
---|
834 | exit $EXIT_FAILURE |
---|
835 | fi |
---|
836 | arg_mode=target |
---|
837 | continue |
---|
838 | ;; |
---|
839 | |
---|
840 | -static | -prefer-pic | -prefer-non-pic) |
---|
841 | later="$later $arg" |
---|
842 | continue |
---|
843 | ;; |
---|
844 | |
---|
845 | -no-suppress) |
---|
846 | suppress_opt=no |
---|
847 | continue |
---|
848 | ;; |
---|
849 | |
---|
850 | -Xcompiler) |
---|
851 | arg_mode=arg # the next one goes into the "base_compile" arg list |
---|
852 | continue # The current "srcfile" will either be retained or |
---|
853 | ;; # replaced later. I would guess that would be a bug. |
---|
854 | |
---|
855 | -Wc,*) |
---|
856 | args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` |
---|
857 | lastarg= |
---|
858 | save_ifs="$IFS"; IFS=',' |
---|
859 | for arg in $args; do |
---|
860 | IFS="$save_ifs" |
---|
861 | |
---|
862 | # Double-quote args containing other shell metacharacters. |
---|
863 | # Many Bourne shells cannot handle close brackets correctly |
---|
864 | # in scan sets, so we specify it separately. |
---|
865 | case $arg in |
---|
866 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
---|
867 | arg="\"$arg\"" |
---|
868 | ;; |
---|
869 | esac |
---|
870 | lastarg="$lastarg $arg" |
---|
871 | done |
---|
872 | IFS="$save_ifs" |
---|
873 | lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` |
---|
874 | |
---|
875 | # Add the arguments to base_compile. |
---|
876 | base_compile="$base_compile $lastarg" |
---|
877 | continue |
---|
878 | ;; |
---|
879 | |
---|
880 | * ) |
---|
881 | # Accept the current argument as the source file. |
---|
882 | # The previous "srcfile" becomes the current argument. |
---|
883 | # |
---|
884 | lastarg="$srcfile" |
---|
885 | srcfile="$arg" |
---|
886 | ;; |
---|
887 | esac # case $arg |
---|
888 | ;; |
---|
889 | esac # case $arg_mode |
---|
890 | |
---|
891 | # Aesthetically quote the previous argument. |
---|
892 | lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` |
---|
893 | |
---|
894 | case $lastarg in |
---|
895 | # Double-quote args containing other shell metacharacters. |
---|
896 | # Many Bourne shells cannot handle close brackets correctly |
---|
897 | # in scan sets, so we specify it separately. |
---|
898 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
---|
899 | lastarg="\"$lastarg\"" |
---|
900 | ;; |
---|
901 | esac |
---|
902 | |
---|
903 | base_compile="$base_compile $lastarg" |
---|
904 | done # for arg |
---|
905 | |
---|
906 | case $arg_mode in |
---|
907 | arg) |
---|
908 | $echo "$modename: you must specify an argument for -Xcompile" |
---|
909 | exit $EXIT_FAILURE |
---|
910 | ;; |
---|
911 | target) |
---|
912 | $echo "$modename: you must specify a target with \`-o'" 1>&2 |
---|
913 | exit $EXIT_FAILURE |
---|
914 | ;; |
---|
915 | *) |
---|
916 | # Get the name of the library object. |
---|
917 | [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` |
---|
918 | ;; |
---|
919 | esac |
---|
920 | |
---|
921 | # Recognize several different file suffixes. |
---|
922 | # If the user specifies -o file.o, it is replaced with file.lo |
---|
923 | xform='[cCFSifmso]' |
---|
924 | case $libobj in |
---|
925 | *.ada) xform=ada ;; |
---|
926 | *.adb) xform=adb ;; |
---|
927 | *.ads) xform=ads ;; |
---|
928 | *.asm) xform=asm ;; |
---|
929 | *.c++) xform=c++ ;; |
---|
930 | *.cc) xform=cc ;; |
---|
931 | *.ii) xform=ii ;; |
---|
932 | *.class) xform=class ;; |
---|
933 | *.cpp) xform=cpp ;; |
---|
934 | *.cxx) xform=cxx ;; |
---|
935 | *.f90) xform=f90 ;; |
---|
936 | *.for) xform=for ;; |
---|
937 | *.java) xform=java ;; |
---|
938 | esac |
---|
939 | |
---|
940 | libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` |
---|
941 | |
---|
942 | case $libobj in |
---|
943 | *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; |
---|
944 | *) |
---|
945 | $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 |
---|
946 | exit $EXIT_FAILURE |
---|
947 | ;; |
---|
948 | esac |
---|
949 | |
---|
950 | func_infer_tag $base_compile |
---|
951 | |
---|
952 | for arg in $later; do |
---|
953 | case $arg in |
---|
954 | -static) |
---|
955 | build_old_libs=yes |
---|
956 | continue |
---|
957 | ;; |
---|
958 | |
---|
959 | -prefer-pic) |
---|
960 | pic_mode=yes |
---|
961 | continue |
---|
962 | ;; |
---|
963 | |
---|
964 | -prefer-non-pic) |
---|
965 | pic_mode=no |
---|
966 | continue |
---|
967 | ;; |
---|
968 | esac |
---|
969 | done |
---|
970 | |
---|
971 | objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
---|
972 | xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
---|
973 | if test "X$xdir" = "X$obj"; then |
---|
974 | xdir= |
---|
975 | else |
---|
976 | xdir=$xdir/ |
---|
977 | fi |
---|
978 | lobj=${xdir}$objdir/$objname |
---|
979 | |
---|
980 | if test -z "$base_compile"; then |
---|
981 | $echo "$modename: you must specify a compilation command" 1>&2 |
---|
982 | $echo "$help" 1>&2 |
---|
983 | exit $EXIT_FAILURE |
---|
984 | fi |
---|
985 | |
---|
986 | # Delete any leftover library objects. |
---|
987 | if test "$build_old_libs" = yes; then |
---|
988 | removelist="$obj $lobj $libobj ${libobj}T" |
---|
989 | else |
---|
990 | removelist="$lobj $libobj ${libobj}T" |
---|
991 | fi |
---|
992 | |
---|
993 | $run $rm $removelist |
---|
994 | trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 |
---|
995 | |
---|
996 | # On Cygwin there's no "real" PIC flag so we must build both object types |
---|
997 | case $host_os in |
---|
998 | cygwin* | mingw* | pw32* | os2*) |
---|
999 | pic_mode=default |
---|
1000 | ;; |
---|
1001 | esac |
---|
1002 | if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then |
---|
1003 | # non-PIC code in shared libraries is not supported |
---|
1004 | pic_mode=default |
---|
1005 | fi |
---|
1006 | |
---|
1007 | # Calculate the filename of the output object if compiler does |
---|
1008 | # not support -o with -c |
---|
1009 | if test "$compiler_c_o" = no; then |
---|
1010 | output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} |
---|
1011 | lockfile="$output_obj.lock" |
---|
1012 | removelist="$removelist $output_obj $lockfile" |
---|
1013 | trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 |
---|
1014 | else |
---|
1015 | output_obj= |
---|
1016 | need_locks=no |
---|
1017 | lockfile= |
---|
1018 | fi |
---|
1019 | |
---|
1020 | # Lock this critical section if it is needed |
---|
1021 | # We use this script file to make the link, it avoids creating a new file |
---|
1022 | if test "$need_locks" = yes; then |
---|
1023 | until $run ln "$progpath" "$lockfile" 2>/dev/null; do |
---|
1024 | $show "Waiting for $lockfile to be removed" |
---|
1025 | sleep 2 |
---|
1026 | done |
---|
1027 | elif test "$need_locks" = warn; then |
---|
1028 | if test -f "$lockfile"; then |
---|
1029 | $echo "\ |
---|
1030 | *** ERROR, $lockfile exists and contains: |
---|
1031 | `cat $lockfile 2>/dev/null` |
---|
1032 | |
---|
1033 | This indicates that another process is trying to use the same |
---|
1034 | temporary object file, and libtool could not work around it because |
---|
1035 | your compiler does not support \`-c' and \`-o' together. If you |
---|
1036 | repeat this compilation, it may succeed, by chance, but you had better |
---|
1037 | avoid parallel builds (make -j) in this platform, or get a better |
---|
1038 | compiler." |
---|
1039 | |
---|
1040 | $run $rm $removelist |
---|
1041 | exit $EXIT_FAILURE |
---|
1042 | fi |
---|
1043 | $echo $srcfile > "$lockfile" |
---|
1044 | fi |
---|
1045 | |
---|
1046 | if test -n "$fix_srcfile_path"; then |
---|
1047 | eval srcfile=\"$fix_srcfile_path\" |
---|
1048 | fi |
---|
1049 | |
---|
1050 | $run $rm "$libobj" "${libobj}T" |
---|
1051 | |
---|
1052 | # Create a libtool object file (analogous to a ".la" file), |
---|
1053 | # but don't create it if we're doing a dry run. |
---|
1054 | test -z "$run" && cat > ${libobj}T <<EOF |
---|
1055 | # $libobj - a libtool object file |
---|
1056 | # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
---|
1057 | # |
---|
1058 | # Please DO NOT delete this file! |
---|
1059 | # It is necessary for linking the library. |
---|
1060 | |
---|
1061 | # Name of the PIC object. |
---|
1062 | EOF |
---|
1063 | |
---|
1064 | # Only build a PIC object if we are building libtool libraries. |
---|
1065 | if test "$build_libtool_libs" = yes; then |
---|
1066 | # Without this assignment, base_compile gets emptied. |
---|
1067 | fbsd_hideous_sh_bug=$base_compile |
---|
1068 | |
---|
1069 | if test "$pic_mode" != no; then |
---|
1070 | command="$base_compile $srcfile $pic_flag" |
---|
1071 | else |
---|
1072 | # Don't build PIC code |
---|
1073 | command="$base_compile $srcfile" |
---|
1074 | fi |
---|
1075 | |
---|
1076 | if test ! -d "${xdir}$objdir"; then |
---|
1077 | $show "$mkdir ${xdir}$objdir" |
---|
1078 | $run $mkdir ${xdir}$objdir |
---|
1079 | status=$? |
---|
1080 | if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then |
---|
1081 | exit $status |
---|
1082 | fi |
---|
1083 | fi |
---|
1084 | |
---|
1085 | if test -z "$output_obj"; then |
---|
1086 | # Place PIC objects in $objdir |
---|
1087 | command="$command -o $lobj" |
---|
1088 | fi |
---|
1089 | |
---|
1090 | $run $rm "$lobj" "$output_obj" |
---|
1091 | |
---|
1092 | $show "$command" |
---|
1093 | if $run eval "$command"; then : |
---|
1094 | else |
---|
1095 | test -n "$output_obj" && $run $rm $removelist |
---|
1096 | exit $EXIT_FAILURE |
---|
1097 | fi |
---|
1098 | |
---|
1099 | if test "$need_locks" = warn && |
---|
1100 | test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then |
---|
1101 | $echo "\ |
---|
1102 | *** ERROR, $lockfile contains: |
---|
1103 | `cat $lockfile 2>/dev/null` |
---|
1104 | |
---|
1105 | but it should contain: |
---|
1106 | $srcfile |
---|
1107 | |
---|
1108 | This indicates that another process is trying to use the same |
---|
1109 | temporary object file, and libtool could not work around it because |
---|
1110 | your compiler does not support \`-c' and \`-o' together. If you |
---|
1111 | repeat this compilation, it may succeed, by chance, but you had better |
---|
1112 | avoid parallel builds (make -j) in this platform, or get a better |
---|
1113 | compiler." |
---|
1114 | |
---|
1115 | $run $rm $removelist |
---|
1116 | exit $EXIT_FAILURE |
---|
1117 | fi |
---|
1118 | |
---|
1119 | # Just move the object if needed, then go on to compile the next one |
---|
1120 | if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then |
---|
1121 | $show "$mv $output_obj $lobj" |
---|
1122 | if $run $mv $output_obj $lobj; then : |
---|
1123 | else |
---|
1124 | error=$? |
---|
1125 | $run $rm $removelist |
---|
1126 | exit $error |
---|
1127 | fi |
---|
1128 | fi |
---|
1129 | |
---|
1130 | # Append the name of the PIC object to the libtool object file. |
---|
1131 | test -z "$run" && cat >> ${libobj}T <<EOF |
---|
1132 | pic_object='$objdir/$objname' |
---|
1133 | |
---|
1134 | EOF |
---|
1135 | |
---|
1136 | # Allow error messages only from the first compilation. |
---|
1137 | if test "$suppress_opt" = yes; then |
---|
1138 | suppress_output=' >/dev/null 2>&1' |
---|
1139 | fi |
---|
1140 | else |
---|
1141 | # No PIC object so indicate it doesn't exist in the libtool |
---|
1142 | # object file. |
---|
1143 | test -z "$run" && cat >> ${libobj}T <<EOF |
---|
1144 | pic_object=none |
---|
1145 | |
---|
1146 | EOF |
---|
1147 | fi |
---|
1148 | |
---|
1149 | # Only build a position-dependent object if we build old libraries. |
---|
1150 | if test "$build_old_libs" = yes; then |
---|
1151 | if test "$pic_mode" != yes; then |
---|
1152 | # Don't build PIC code |
---|
1153 | command="$base_compile $srcfile" |
---|
1154 | else |
---|
1155 | command="$base_compile $srcfile $pic_flag" |
---|
1156 | fi |
---|
1157 | if test "$compiler_c_o" = yes; then |
---|
1158 | command="$command -o $obj" |
---|
1159 | fi |
---|
1160 | |
---|
1161 | # Suppress compiler output if we already did a PIC compilation. |
---|
1162 | command="$command$suppress_output" |
---|
1163 | $run $rm "$obj" "$output_obj" |
---|
1164 | $show "$command" |
---|
1165 | if $run eval "$command"; then : |
---|
1166 | else |
---|
1167 | $run $rm $removelist |
---|
1168 | exit $EXIT_FAILURE |
---|
1169 | fi |
---|
1170 | |
---|
1171 | if test "$need_locks" = warn && |
---|
1172 | test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then |
---|
1173 | $echo "\ |
---|
1174 | *** ERROR, $lockfile contains: |
---|
1175 | `cat $lockfile 2>/dev/null` |
---|
1176 | |
---|
1177 | but it should contain: |
---|
1178 | $srcfile |
---|
1179 | |
---|
1180 | This indicates that another process is trying to use the same |
---|
1181 | temporary object file, and libtool could not work around it because |
---|
1182 | your compiler does not support \`-c' and \`-o' together. If you |
---|
1183 | repeat this compilation, it may succeed, by chance, but you had better |
---|
1184 | avoid parallel builds (make -j) in this platform, or get a better |
---|
1185 | compiler." |
---|
1186 | |
---|
1187 | $run $rm $removelist |
---|
1188 | exit $EXIT_FAILURE |
---|
1189 | fi |
---|
1190 | |
---|
1191 | # Just move the object if needed |
---|
1192 | if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then |
---|
1193 | $show "$mv $output_obj $obj" |
---|
1194 | if $run $mv $output_obj $obj; then : |
---|
1195 | else |
---|
1196 | error=$? |
---|
1197 | $run $rm $removelist |
---|
1198 | exit $error |
---|
1199 | fi |
---|
1200 | fi |
---|
1201 | |
---|
1202 | # Append the name of the non-PIC object the libtool object file. |
---|
1203 | # Only append if the libtool object file exists. |
---|
1204 | test -z "$run" && cat >> ${libobj}T <<EOF |
---|
1205 | # Name of the non-PIC object. |
---|
1206 | non_pic_object='$objname' |
---|
1207 | |
---|
1208 | EOF |
---|
1209 | else |
---|
1210 | # Append the name of the non-PIC object the libtool object file. |
---|
1211 | # Only append if the libtool object file exists. |
---|
1212 | test -z "$run" && cat >> ${libobj}T <<EOF |
---|
1213 | # Name of the non-PIC object. |
---|
1214 | non_pic_object=none |
---|
1215 | |
---|
1216 | EOF |
---|
1217 | fi |
---|
1218 | |
---|
1219 | $run $mv "${libobj}T" "${libobj}" |
---|
1220 | |
---|
1221 | # Unlock the critical section if it was locked |
---|
1222 | if test "$need_locks" != no; then |
---|
1223 | $run $rm "$lockfile" |
---|
1224 | fi |
---|
1225 | |
---|
1226 | exit $EXIT_SUCCESS |
---|
1227 | ;; |
---|
1228 | |
---|
1229 | # libtool link mode |
---|
1230 | link | relink) |
---|
1231 | modename="$modename: link" |
---|
1232 | case $host in |
---|
1233 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
---|
1234 | # It is impossible to link a dll without this setting, and |
---|
1235 | # we shouldn't force the makefile maintainer to figure out |
---|
1236 | # which system we are compiling for in order to pass an extra |
---|
1237 | # flag for every libtool invocation. |
---|
1238 | # allow_undefined=no |
---|
1239 | |
---|
1240 | # FIXME: Unfortunately, there are problems with the above when trying |
---|
1241 | # to make a dll which has undefined symbols, in which case not |
---|
1242 | # even a static library is built. For now, we need to specify |
---|
1243 | # -no-undefined on the libtool link line when we can be certain |
---|
1244 | # that all symbols are satisfied, otherwise we get a static library. |
---|
1245 | allow_undefined=yes |
---|
1246 | ;; |
---|
1247 | *) |
---|
1248 | allow_undefined=yes |
---|
1249 | ;; |
---|
1250 | esac |
---|
1251 | libtool_args="$nonopt" |
---|
1252 | base_compile="$nonopt $@" |
---|
1253 | compile_command="$nonopt" |
---|
1254 | finalize_command="$nonopt" |
---|
1255 | |
---|
1256 | compile_rpath= |
---|
1257 | finalize_rpath= |
---|
1258 | compile_shlibpath= |
---|
1259 | finalize_shlibpath= |
---|
1260 | convenience= |
---|
1261 | old_convenience= |
---|
1262 | deplibs= |
---|
1263 | old_deplibs= |
---|
1264 | compiler_flags= |
---|
1265 | linker_flags= |
---|
1266 | dllsearchpath= |
---|
1267 | lib_search_path=`pwd` |
---|
1268 | inst_prefix_dir= |
---|
1269 | |
---|
1270 | avoid_version=no |
---|
1271 | dlfiles= |
---|
1272 | dlprefiles= |
---|
1273 | dlself=no |
---|
1274 | export_dynamic=no |
---|
1275 | export_symbols= |
---|
1276 | export_symbols_regex= |
---|
1277 | generated= |
---|
1278 | libobjs= |
---|
1279 | ltlibs= |
---|
1280 | module=no |
---|
1281 | no_install=no |
---|
1282 | objs= |
---|
1283 | non_pic_objects= |
---|
1284 | precious_files_regex= |
---|
1285 | prefer_static_libs=no |
---|
1286 | preload=no |
---|
1287 | prev= |
---|
1288 | prevarg= |
---|
1289 | release= |
---|
1290 | rpath= |
---|
1291 | xrpath= |
---|
1292 | perm_rpath= |
---|
1293 | temp_rpath= |
---|
1294 | thread_safe=no |
---|
1295 | vinfo= |
---|
1296 | vinfo_number=no |
---|
1297 | |
---|
1298 | func_infer_tag $base_compile |
---|
1299 | |
---|
1300 | # We need to know -static, to get the right output filenames. |
---|
1301 | for arg |
---|
1302 | do |
---|
1303 | case $arg in |
---|
1304 | -all-static | -static) |
---|
1305 | if test "X$arg" = "X-all-static"; then |
---|
1306 | if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then |
---|
1307 | $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 |
---|
1308 | fi |
---|
1309 | if test -n "$link_static_flag"; then |
---|
1310 | dlopen_self=$dlopen_self_static |
---|
1311 | fi |
---|
1312 | else |
---|
1313 | if test -z "$pic_flag" && test -n "$link_static_flag"; then |
---|
1314 | dlopen_self=$dlopen_self_static |
---|
1315 | fi |
---|
1316 | fi |
---|
1317 | build_libtool_libs=no |
---|
1318 | build_old_libs=yes |
---|
1319 | prefer_static_libs=yes |
---|
1320 | break |
---|
1321 | ;; |
---|
1322 | esac |
---|
1323 | done |
---|
1324 | |
---|
1325 | # See if our shared archives depend on static archives. |
---|
1326 | test -n "$old_archive_from_new_cmds" && build_old_libs=yes |
---|
1327 | |
---|
1328 | # Go through the arguments, transforming them on the way. |
---|
1329 | while test "$#" -gt 0; do |
---|
1330 | arg="$1" |
---|
1331 | shift |
---|
1332 | case $arg in |
---|
1333 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
---|
1334 | qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test |
---|
1335 | ;; |
---|
1336 | *) qarg=$arg ;; |
---|
1337 | esac |
---|
1338 | libtool_args="$libtool_args $qarg" |
---|
1339 | |
---|
1340 | # If the previous option needs an argument, assign it. |
---|
1341 | if test -n "$prev"; then |
---|
1342 | case $prev in |
---|
1343 | output) |
---|
1344 | compile_command="$compile_command @OUTPUT@" |
---|
1345 | finalize_command="$finalize_command @OUTPUT@" |
---|
1346 | ;; |
---|
1347 | esac |
---|
1348 | |
---|
1349 | case $prev in |
---|
1350 | dlfiles|dlprefiles) |
---|
1351 | if test "$preload" = no; then |
---|
1352 | # Add the symbol object into the linking commands. |
---|
1353 | compile_command="$compile_command @SYMFILE@" |
---|
1354 | finalize_command="$finalize_command @SYMFILE@" |
---|
1355 | preload=yes |
---|
1356 | fi |
---|
1357 | case $arg in |
---|
1358 | *.la | *.lo) ;; # We handle these cases below. |
---|
1359 | force) |
---|
1360 | if test "$dlself" = no; then |
---|
1361 | dlself=needless |
---|
1362 | export_dynamic=yes |
---|
1363 | fi |
---|
1364 | prev= |
---|
1365 | continue |
---|
1366 | ;; |
---|
1367 | self) |
---|
1368 | if test "$prev" = dlprefiles; then |
---|
1369 | dlself=yes |
---|
1370 | elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then |
---|
1371 | dlself=yes |
---|
1372 | else |
---|
1373 | dlself=needless |
---|
1374 | export_dynamic=yes |
---|
1375 | fi |
---|
1376 | prev= |
---|
1377 | continue |
---|
1378 | ;; |
---|
1379 | *) |
---|
1380 | if test "$prev" = dlfiles; then |
---|
1381 | dlfiles="$dlfiles $arg" |
---|
1382 | else |
---|
1383 | dlprefiles="$dlprefiles $arg" |
---|
1384 | fi |
---|
1385 | prev= |
---|
1386 | continue |
---|
1387 | ;; |
---|
1388 | esac |
---|
1389 | ;; |
---|
1390 | expsyms) |
---|
1391 | export_symbols="$arg" |
---|
1392 | if test ! -f "$arg"; then |
---|
1393 | $echo "$modename: symbol file \`$arg' does not exist" |
---|
1394 | exit $EXIT_FAILURE |
---|
1395 | fi |
---|
1396 | prev= |
---|
1397 | continue |
---|
1398 | ;; |
---|
1399 | expsyms_regex) |
---|
1400 | export_symbols_regex="$arg" |
---|
1401 | prev= |
---|
1402 | continue |
---|
1403 | ;; |
---|
1404 | inst_prefix) |
---|
1405 | inst_prefix_dir="$arg" |
---|
1406 | prev= |
---|
1407 | continue |
---|
1408 | ;; |
---|
1409 | precious_regex) |
---|
1410 | precious_files_regex="$arg" |
---|
1411 | prev= |
---|
1412 | continue |
---|
1413 | ;; |
---|
1414 | release) |
---|
1415 | release="-$arg" |
---|
1416 | prev= |
---|
1417 | continue |
---|
1418 | ;; |
---|
1419 | objectlist) |
---|
1420 | if test -f "$arg"; then |
---|
1421 | save_arg=$arg |
---|
1422 | moreargs= |
---|
1423 | for fil in `cat $save_arg` |
---|
1424 | do |
---|
1425 | # moreargs="$moreargs $fil" |
---|
1426 | arg=$fil |
---|
1427 | # A libtool-controlled object. |
---|
1428 | |
---|
1429 | # Check to see that this really is a libtool object. |
---|
1430 | if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
---|
1431 | pic_object= |
---|
1432 | non_pic_object= |
---|
1433 | |
---|
1434 | # Read the .lo file |
---|
1435 | # If there is no directory component, then add one. |
---|
1436 | case $arg in |
---|
1437 | */* | *\\*) . $arg ;; |
---|
1438 | *) . ./$arg ;; |
---|
1439 | esac |
---|
1440 | |
---|
1441 | if test -z "$pic_object" || \ |
---|
1442 | test -z "$non_pic_object" || |
---|
1443 | test "$pic_object" = none && \ |
---|
1444 | test "$non_pic_object" = none; then |
---|
1445 | $echo "$modename: cannot find name of object for \`$arg'" 1>&2 |
---|
1446 | exit $EXIT_FAILURE |
---|
1447 | fi |
---|
1448 | |
---|
1449 | # Extract subdirectory from the argument. |
---|
1450 | xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
---|
1451 | if test "X$xdir" = "X$arg"; then |
---|
1452 | xdir= |
---|
1453 | else |
---|
1454 | xdir="$xdir/" |
---|
1455 | fi |
---|
1456 | |
---|
1457 | if test "$pic_object" != none; then |
---|
1458 | # Prepend the subdirectory the object is found in. |
---|
1459 | pic_object="$xdir$pic_object" |
---|
1460 | |
---|
1461 | if test "$prev" = dlfiles; then |
---|
1462 | if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then |
---|
1463 | dlfiles="$dlfiles $pic_object" |
---|
1464 | prev= |
---|
1465 | continue |
---|
1466 | else |
---|
1467 | # If libtool objects are unsupported, then we need to preload. |
---|
1468 | prev=dlprefiles |
---|
1469 | fi |
---|
1470 | fi |
---|
1471 | |
---|
1472 | # CHECK ME: I think I busted this. -Ossama |
---|
1473 | if test "$prev" = dlprefiles; then |
---|
1474 | # Preload the old-style object. |
---|
1475 | dlprefiles="$dlprefiles $pic_object" |
---|
1476 | prev= |
---|
1477 | fi |
---|
1478 | |
---|
1479 | # A PIC object. |
---|
1480 | libobjs="$libobjs $pic_object" |
---|
1481 | arg="$pic_object" |
---|
1482 | fi |
---|
1483 | |
---|
1484 | # Non-PIC object. |
---|
1485 | if test "$non_pic_object" != none; then |
---|
1486 | # Prepend the subdirectory the object is found in. |
---|
1487 | non_pic_object="$xdir$non_pic_object" |
---|
1488 | |
---|
1489 | # A standard non-PIC object |
---|
1490 | non_pic_objects="$non_pic_objects $non_pic_object" |
---|
1491 | if test -z "$pic_object" || test "$pic_object" = none ; then |
---|
1492 | arg="$non_pic_object" |
---|
1493 | fi |
---|
1494 | fi |
---|
1495 | else |
---|
1496 | # Only an error if not doing a dry-run. |
---|
1497 | if test -z "$run"; then |
---|
1498 | $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 |
---|
1499 | exit $EXIT_FAILURE |
---|
1500 | else |
---|
1501 | # Dry-run case. |
---|
1502 | |
---|
1503 | # Extract subdirectory from the argument. |
---|
1504 | xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
---|
1505 | if test "X$xdir" = "X$arg"; then |
---|
1506 | xdir= |
---|
1507 | else |
---|
1508 | xdir="$xdir/" |
---|
1509 | fi |
---|
1510 | |
---|
1511 | pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` |
---|
1512 | non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` |
---|
1513 | libobjs="$libobjs $pic_object" |
---|
1514 | non_pic_objects="$non_pic_objects $non_pic_object" |
---|
1515 | fi |
---|
1516 | fi |
---|
1517 | done |
---|
1518 | else |
---|
1519 | $echo "$modename: link input file \`$save_arg' does not exist" |
---|
1520 | exit $EXIT_FAILURE |
---|
1521 | fi |
---|
1522 | arg=$save_arg |
---|
1523 | prev= |
---|
1524 | continue |
---|
1525 | ;; |
---|
1526 | rpath | xrpath) |
---|
1527 | # We need an absolute path. |
---|
1528 | case $arg in |
---|
1529 | [\\/]* | [A-Za-z]:[\\/]*) ;; |
---|
1530 | *) |
---|
1531 | $echo "$modename: only absolute run-paths are allowed" 1>&2 |
---|
1532 | exit $EXIT_FAILURE |
---|
1533 | ;; |
---|
1534 | esac |
---|
1535 | if test "$prev" = rpath; then |
---|
1536 | case "$rpath " in |
---|
1537 | *" $arg "*) ;; |
---|
1538 | *) rpath="$rpath $arg" ;; |
---|
1539 | esac |
---|
1540 | else |
---|
1541 | case "$xrpath " in |
---|
1542 | *" $arg "*) ;; |
---|
1543 | *) xrpath="$xrpath $arg" ;; |
---|
1544 | esac |
---|
1545 | fi |
---|
1546 | prev= |
---|
1547 | continue |
---|
1548 | ;; |
---|
1549 | xcompiler) |
---|
1550 | compiler_flags="$compiler_flags $qarg" |
---|
1551 | prev= |
---|
1552 | compile_command="$compile_command $qarg" |
---|
1553 | finalize_command="$finalize_command $qarg" |
---|
1554 | continue |
---|
1555 | ;; |
---|
1556 | xlinker) |
---|
1557 | linker_flags="$linker_flags $qarg" |
---|
1558 | compiler_flags="$compiler_flags $wl$qarg" |
---|
1559 | prev= |
---|
1560 | compile_command="$compile_command $wl$qarg" |
---|
1561 | finalize_command="$finalize_command $wl$qarg" |
---|
1562 | continue |
---|
1563 | ;; |
---|
1564 | xcclinker) |
---|
1565 | linker_flags="$linker_flags $qarg" |
---|
1566 | compiler_flags="$compiler_flags $qarg" |
---|
1567 | prev= |
---|
1568 | compile_command="$compile_command $qarg" |
---|
1569 | finalize_command="$finalize_command $qarg" |
---|
1570 | continue |
---|
1571 | ;; |
---|
1572 | shrext) |
---|
1573 | shrext_cmds="$arg" |
---|
1574 | prev= |
---|
1575 | continue |
---|
1576 | ;; |
---|
1577 | *) |
---|
1578 | eval "$prev=\"\$arg\"" |
---|
1579 | prev= |
---|
1580 | continue |
---|
1581 | ;; |
---|
1582 | esac |
---|
1583 | fi # test -n "$prev" |
---|
1584 | |
---|
1585 | prevarg="$arg" |
---|
1586 | |
---|
1587 | case $arg in |
---|
1588 | -all-static) |
---|
1589 | if test -n "$link_static_flag"; then |
---|
1590 | compile_command="$compile_command $link_static_flag" |
---|
1591 | finalize_command="$finalize_command $link_static_flag" |
---|
1592 | fi |
---|
1593 | continue |
---|
1594 | ;; |
---|
1595 | |
---|
1596 | -allow-undefined) |
---|
1597 | # FIXME: remove this flag sometime in the future. |
---|
1598 | $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 |
---|
1599 | continue |
---|
1600 | ;; |
---|
1601 | |
---|
1602 | -avoid-version) |
---|
1603 | avoid_version=yes |
---|
1604 | continue |
---|
1605 | ;; |
---|
1606 | |
---|
1607 | -dlopen) |
---|
1608 | prev=dlfiles |
---|
1609 | continue |
---|
1610 | ;; |
---|
1611 | |
---|
1612 | -dlpreopen) |
---|
1613 | prev=dlprefiles |
---|
1614 | continue |
---|
1615 | ;; |
---|
1616 | |
---|
1617 | -export-dynamic) |
---|
1618 | export_dynamic=yes |
---|
1619 | continue |
---|
1620 | ;; |
---|
1621 | |
---|
1622 | -export-symbols | -export-symbols-regex) |
---|
1623 | if test -n "$export_symbols" || test -n "$export_symbols_regex"; then |
---|
1624 | $echo "$modename: more than one -exported-symbols argument is not allowed" |
---|
1625 | exit $EXIT_FAILURE |
---|
1626 | fi |
---|
1627 | if test "X$arg" = "X-export-symbols"; then |
---|
1628 | prev=expsyms |
---|
1629 | else |
---|
1630 | prev=expsyms_regex |
---|
1631 | fi |
---|
1632 | continue |
---|
1633 | ;; |
---|
1634 | |
---|
1635 | -inst-prefix-dir) |
---|
1636 | prev=inst_prefix |
---|
1637 | continue |
---|
1638 | ;; |
---|
1639 | |
---|
1640 | # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* |
---|
1641 | # so, if we see these flags be careful not to treat them like -L |
---|
1642 | -L[A-Z][A-Z]*:*) |
---|
1643 | case $with_gcc/$host in |
---|
1644 | no/*-*-irix* | /*-*-irix*) |
---|
1645 | compile_command="$compile_command $arg" |
---|
1646 | finalize_command="$finalize_command $arg" |
---|
1647 | ;; |
---|
1648 | esac |
---|
1649 | continue |
---|
1650 | ;; |
---|
1651 | |
---|
1652 | -L*) |
---|
1653 | dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` |
---|
1654 | # We need an absolute path. |
---|
1655 | case $dir in |
---|
1656 | [\\/]* | [A-Za-z]:[\\/]*) ;; |
---|
1657 | *) |
---|
1658 | absdir=`cd "$dir" && pwd` |
---|
1659 | if test -z "$absdir"; then |
---|
1660 | $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 |
---|
1661 | exit $EXIT_FAILURE |
---|
1662 | fi |
---|
1663 | dir="$absdir" |
---|
1664 | ;; |
---|
1665 | esac |
---|
1666 | case "$deplibs " in |
---|
1667 | *" -L$dir "*) ;; |
---|
1668 | *) |
---|
1669 | deplibs="$deplibs -L$dir" |
---|
1670 | lib_search_path="$lib_search_path $dir" |
---|
1671 | ;; |
---|
1672 | esac |
---|
1673 | case $host in |
---|
1674 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
---|
1675 | case :$dllsearchpath: in |
---|
1676 | *":$dir:"*) ;; |
---|
1677 | *) dllsearchpath="$dllsearchpath:$dir";; |
---|
1678 | esac |
---|
1679 | ;; |
---|
1680 | esac |
---|
1681 | continue |
---|
1682 | ;; |
---|
1683 | |
---|
1684 | -l*) |
---|
1685 | if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then |
---|
1686 | case $host in |
---|
1687 | *-*-cygwin* | *-*-pw32* | *-*-beos*) |
---|
1688 | # These systems don't actually have a C or math library (as such) |
---|
1689 | continue |
---|
1690 | ;; |
---|
1691 | *-*-mingw* | *-*-os2*) |
---|
1692 | # These systems don't actually have a C library (as such) |
---|
1693 | test "X$arg" = "X-lc" && continue |
---|
1694 | ;; |
---|
1695 | *-*-openbsd* | *-*-freebsd*) |
---|
1696 | # Do not include libc due to us having libc/libc_r. |
---|
1697 | test "X$arg" = "X-lc" && continue |
---|
1698 | ;; |
---|
1699 | *-*-rhapsody* | *-*-darwin1.[012]) |
---|
1700 | # Rhapsody C and math libraries are in the System framework |
---|
1701 | deplibs="$deplibs -framework System" |
---|
1702 | continue |
---|
1703 | esac |
---|
1704 | elif test "X$arg" = "X-lc_r"; then |
---|
1705 | case $host in |
---|
1706 | *-*-openbsd* | *-*-freebsd*) |
---|
1707 | # Do not include libc_r directly, use -pthread flag. |
---|
1708 | continue |
---|
1709 | ;; |
---|
1710 | esac |
---|
1711 | fi |
---|
1712 | deplibs="$deplibs $arg" |
---|
1713 | continue |
---|
1714 | ;; |
---|
1715 | |
---|
1716 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) |
---|
1717 | deplibs="$deplibs $arg" |
---|
1718 | continue |
---|
1719 | ;; |
---|
1720 | |
---|
1721 | -module) |
---|
1722 | module=yes |
---|
1723 | continue |
---|
1724 | ;; |
---|
1725 | |
---|
1726 | # gcc -m* arguments should be passed to the linker via $compiler_flags |
---|
1727 | # in order to pass architecture information to the linker |
---|
1728 | # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo |
---|
1729 | # but this is not reliable with gcc because gcc may use -mfoo to |
---|
1730 | # select a different linker, different libraries, etc, while |
---|
1731 | # -Wl,-mfoo simply passes -mfoo to the linker. |
---|
1732 | -m*) |
---|
1733 | # Unknown arguments in both finalize_command and compile_command need |
---|
1734 | # to be aesthetically quoted because they are evaled later. |
---|
1735 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
---|
1736 | case $arg in |
---|
1737 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
---|
1738 | arg="\"$arg\"" |
---|
1739 | ;; |
---|
1740 | esac |
---|
1741 | compile_command="$compile_command $arg" |
---|
1742 | finalize_command="$finalize_command $arg" |
---|
1743 | if test "$with_gcc" = "yes" ; then |
---|
1744 | compiler_flags="$compiler_flags $arg" |
---|
1745 | fi |
---|
1746 | continue |
---|
1747 | ;; |
---|
1748 | |
---|
1749 | -shrext) |
---|
1750 | prev=shrext |
---|
1751 | continue |
---|
1752 | ;; |
---|
1753 | |
---|
1754 | -no-fast-install) |
---|
1755 | fast_install=no |
---|
1756 | continue |
---|
1757 | ;; |
---|
1758 | |
---|
1759 | -no-install) |
---|
1760 | case $host in |
---|
1761 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
---|
1762 | # The PATH hackery in wrapper scripts is required on Windows |
---|
1763 | # in order for the loader to find any dlls it needs. |
---|
1764 | $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 |
---|
1765 | $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 |
---|
1766 | fast_install=no |
---|
1767 | ;; |
---|
1768 | *) no_install=yes ;; |
---|
1769 | esac |
---|
1770 | continue |
---|
1771 | ;; |
---|
1772 | |
---|
1773 | -no-undefined) |
---|
1774 | allow_undefined=no |
---|
1775 | continue |
---|
1776 | ;; |
---|
1777 | |
---|
1778 | -objectlist) |
---|
1779 | prev=objectlist |
---|
1780 | continue |
---|
1781 | ;; |
---|
1782 | |
---|
1783 | -o) prev=output ;; |
---|
1784 | |
---|
1785 | -precious-files-regex) |
---|
1786 | prev=precious_regex |
---|
1787 | continue |
---|
1788 | ;; |
---|
1789 | |
---|
1790 | -release) |
---|
1791 | prev=release |
---|
1792 | continue |
---|
1793 | ;; |
---|
1794 | |
---|
1795 | -rpath) |
---|
1796 | prev=rpath |
---|
1797 | continue |
---|
1798 | ;; |
---|
1799 | |
---|
1800 | -R) |
---|
1801 | prev=xrpath |
---|
1802 | continue |
---|
1803 | ;; |
---|
1804 | |
---|
1805 | -R*) |
---|
1806 | dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` |
---|
1807 | # We need an absolute path. |
---|
1808 | case $dir in |
---|
1809 | [\\/]* | [A-Za-z]:[\\/]*) ;; |
---|
1810 | *) |
---|
1811 | $echo "$modename: only absolute run-paths are allowed" 1>&2 |
---|
1812 | exit $EXIT_FAILURE |
---|
1813 | ;; |
---|
1814 | esac |
---|
1815 | case "$xrpath " in |
---|
1816 | *" $dir "*) ;; |
---|
1817 | *) xrpath="$xrpath $dir" ;; |
---|
1818 | esac |
---|
1819 | continue |
---|
1820 | ;; |
---|
1821 | |
---|
1822 | -static) |
---|
1823 | # The effects of -static are defined in a previous loop. |
---|
1824 | # We used to do the same as -all-static on platforms that |
---|
1825 | # didn't have a PIC flag, but the assumption that the effects |
---|
1826 | # would be equivalent was wrong. It would break on at least |
---|
1827 | # Digital Unix and AIX. |
---|
1828 | continue |
---|
1829 | ;; |
---|
1830 | |
---|
1831 | -thread-safe) |
---|
1832 | thread_safe=yes |
---|
1833 | continue |
---|
1834 | ;; |
---|
1835 | |
---|
1836 | -version-info) |
---|
1837 | prev=vinfo |
---|
1838 | continue |
---|
1839 | ;; |
---|
1840 | -version-number) |
---|
1841 | prev=vinfo |
---|
1842 | vinfo_number=yes |
---|
1843 | continue |
---|
1844 | ;; |
---|
1845 | |
---|
1846 | -Wc,*) |
---|
1847 | args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` |
---|
1848 | arg= |
---|
1849 | save_ifs="$IFS"; IFS=',' |
---|
1850 | for flag in $args; do |
---|
1851 | IFS="$save_ifs" |
---|
1852 | case $flag in |
---|
1853 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
---|
1854 | flag="\"$flag\"" |
---|
1855 | ;; |
---|
1856 | esac |
---|
1857 | arg="$arg $wl$flag" |
---|
1858 | compiler_flags="$compiler_flags $flag" |
---|
1859 | done |
---|
1860 | IFS="$save_ifs" |
---|
1861 | arg=`$echo "X$arg" | $Xsed -e "s/^ //"` |
---|
1862 | ;; |
---|
1863 | |
---|
1864 | -Wl,*) |
---|
1865 | args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` |
---|
1866 | arg= |
---|
1867 | save_ifs="$IFS"; IFS=',' |
---|
1868 | for flag in $args; do |
---|
1869 | IFS="$save_ifs" |
---|
1870 | case $flag in |
---|
1871 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
---|
1872 | flag="\"$flag\"" |
---|
1873 | ;; |
---|
1874 | esac |
---|
1875 | arg="$arg $wl$flag" |
---|
1876 | compiler_flags="$compiler_flags $wl$flag" |
---|
1877 | linker_flags="$linker_flags $flag" |
---|
1878 | done |
---|
1879 | IFS="$save_ifs" |
---|
1880 | arg=`$echo "X$arg" | $Xsed -e "s/^ //"` |
---|
1881 | ;; |
---|
1882 | |
---|
1883 | -Xcompiler) |
---|
1884 | prev=xcompiler |
---|
1885 | continue |
---|
1886 | ;; |
---|
1887 | |
---|
1888 | -Xlinker) |
---|
1889 | prev=xlinker |
---|
1890 | continue |
---|
1891 | ;; |
---|
1892 | |
---|
1893 | -XCClinker) |
---|
1894 | prev=xcclinker |
---|
1895 | continue |
---|
1896 | ;; |
---|
1897 | |
---|
1898 | # Some other compiler flag. |
---|
1899 | -* | +*) |
---|
1900 | # Unknown arguments in both finalize_command and compile_command need |
---|
1901 | # to be aesthetically quoted because they are evaled later. |
---|
1902 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
---|
1903 | case $arg in |
---|
1904 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
---|
1905 | arg="\"$arg\"" |
---|
1906 | ;; |
---|
1907 | esac |
---|
1908 | ;; |
---|
1909 | |
---|
1910 | *.$objext) |
---|
1911 | # A standard object. |
---|
1912 | objs="$objs $arg" |
---|
1913 | ;; |
---|
1914 | |
---|
1915 | *.lo) |
---|
1916 | # A libtool-controlled object. |
---|
1917 | |
---|
1918 | # Check to see that this really is a libtool object. |
---|
1919 | if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
---|
1920 | pic_object= |
---|
1921 | non_pic_object= |
---|
1922 | |
---|
1923 | # Read the .lo file |
---|
1924 | # If there is no directory component, then add one. |
---|
1925 | case $arg in |
---|
1926 | */* | *\\*) . $arg ;; |
---|
1927 | *) . ./$arg ;; |
---|
1928 | esac |
---|
1929 | |
---|
1930 | if test -z "$pic_object" || \ |
---|
1931 | test -z "$non_pic_object" || |
---|
1932 | test "$pic_object" = none && \ |
---|
1933 | test "$non_pic_object" = none; then |
---|
1934 | $echo "$modename: cannot find name of object for \`$arg'" 1>&2 |
---|
1935 | exit $EXIT_FAILURE |
---|
1936 | fi |
---|
1937 | |
---|
1938 | # Extract subdirectory from the argument. |
---|
1939 | xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
---|
1940 | if test "X$xdir" = "X$arg"; then |
---|
1941 | xdir= |
---|
1942 | else |
---|
1943 | xdir="$xdir/" |
---|
1944 | fi |
---|
1945 | |
---|
1946 | if test "$pic_object" != none; then |
---|
1947 | # Prepend the subdirectory the object is found in. |
---|
1948 | pic_object="$xdir$pic_object" |
---|
1949 | |
---|
1950 | if test "$prev" = dlfiles; then |
---|
1951 | if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then |
---|
1952 | dlfiles="$dlfiles $pic_object" |
---|
1953 | prev= |
---|
1954 | continue |
---|
1955 | else |
---|
1956 | # If libtool objects are unsupported, then we need to preload. |
---|
1957 | prev=dlprefiles |
---|
1958 | fi |
---|
1959 | fi |
---|
1960 | |
---|
1961 | # CHECK ME: I think I busted this. -Ossama |
---|
1962 | if test "$prev" = dlprefiles; then |
---|
1963 | # Preload the old-style object. |
---|
1964 | dlprefiles="$dlprefiles $pic_object" |
---|
1965 | prev= |
---|
1966 | fi |
---|
1967 | |
---|
1968 | # A PIC object. |
---|
1969 | libobjs="$libobjs $pic_object" |
---|
1970 | arg="$pic_object" |
---|
1971 | fi |
---|
1972 | |
---|
1973 | # Non-PIC object. |
---|
1974 | if test "$non_pic_object" != none; then |
---|
1975 | # Prepend the subdirectory the object is found in. |
---|
1976 | non_pic_object="$xdir$non_pic_object" |
---|
1977 | |
---|
1978 | # A standard non-PIC object |
---|
1979 | non_pic_objects="$non_pic_objects $non_pic_object" |
---|
1980 | if test -z "$pic_object" || test "$pic_object" = none ; then |
---|
1981 | arg="$non_pic_object" |
---|
1982 | fi |
---|
1983 | fi |
---|
1984 | else |
---|
1985 | # Only an error if not doing a dry-run. |
---|
1986 | if test -z "$run"; then |
---|
1987 | $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 |
---|
1988 | exit $EXIT_FAILURE |
---|
1989 | else |
---|
1990 | # Dry-run case. |
---|
1991 | |
---|
1992 | # Extract subdirectory from the argument. |
---|
1993 | xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
---|
1994 | if test "X$xdir" = "X$arg"; then |
---|
1995 | xdir= |
---|
1996 | else |
---|
1997 | xdir="$xdir/" |
---|
1998 | fi |
---|
1999 | |
---|
2000 | pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` |
---|
2001 | non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` |
---|
2002 | libobjs="$libobjs $pic_object" |
---|
2003 | non_pic_objects="$non_pic_objects $non_pic_object" |
---|
2004 | fi |
---|
2005 | fi |
---|
2006 | ;; |
---|
2007 | |
---|
2008 | *.$libext) |
---|
2009 | # An archive. |
---|
2010 | deplibs="$deplibs $arg" |
---|
2011 | old_deplibs="$old_deplibs $arg" |
---|
2012 | continue |
---|
2013 | ;; |
---|
2014 | |
---|
2015 | *.la) |
---|
2016 | # A libtool-controlled library. |
---|
2017 | |
---|
2018 | if test "$prev" = dlfiles; then |
---|
2019 | # This library was specified with -dlopen. |
---|
2020 | dlfiles="$dlfiles $arg" |
---|
2021 | prev= |
---|
2022 | elif test "$prev" = dlprefiles; then |
---|
2023 | # The library was specified with -dlpreopen. |
---|
2024 | dlprefiles="$dlprefiles $arg" |
---|
2025 | prev= |
---|
2026 | else |
---|
2027 | deplibs="$deplibs $arg" |
---|
2028 | fi |
---|
2029 | continue |
---|
2030 | ;; |
---|
2031 | |
---|
2032 | # Some other compiler argument. |
---|
2033 | *) |
---|
2034 | # Unknown arguments in both finalize_command and compile_command need |
---|
2035 | # to be aesthetically quoted because they are evaled later. |
---|
2036 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
---|
2037 | case $arg in |
---|
2038 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
---|
2039 | arg="\"$arg\"" |
---|
2040 | ;; |
---|
2041 | esac |
---|
2042 | ;; |
---|
2043 | esac # arg |
---|
2044 | |
---|
2045 | # Now actually substitute the argument into the commands. |
---|
2046 | if test -n "$arg"; then |
---|
2047 | compile_command="$compile_command $arg" |
---|
2048 | finalize_command="$finalize_command $arg" |
---|
2049 | fi |
---|
2050 | done # argument parsing loop |
---|
2051 | |
---|
2052 | if test -n "$prev"; then |
---|
2053 | $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 |
---|
2054 | $echo "$help" 1>&2 |
---|
2055 | exit $EXIT_FAILURE |
---|
2056 | fi |
---|
2057 | |
---|
2058 | if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then |
---|
2059 | eval arg=\"$export_dynamic_flag_spec\" |
---|
2060 | compile_command="$compile_command $arg" |
---|
2061 | finalize_command="$finalize_command $arg" |
---|
2062 | fi |
---|
2063 | |
---|
2064 | oldlibs= |
---|
2065 | # calculate the name of the file, without its directory |
---|
2066 | outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` |
---|
2067 | libobjs_save="$libobjs" |
---|
2068 | |
---|
2069 | if test -n "$shlibpath_var"; then |
---|
2070 | # get the directories listed in $shlibpath_var |
---|
2071 | eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` |
---|
2072 | else |
---|
2073 | shlib_search_path= |
---|
2074 | fi |
---|
2075 | eval sys_lib_search_path=\"$sys_lib_search_path_spec\" |
---|
2076 | eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" |
---|
2077 | |
---|
2078 | output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` |
---|
2079 | if test "X$output_objdir" = "X$output"; then |
---|
2080 | output_objdir="$objdir" |
---|
2081 | else |
---|
2082 | output_objdir="$output_objdir/$objdir" |
---|
2083 | fi |
---|
2084 | # Create the object directory. |
---|
2085 | if test ! -d "$output_objdir"; then |
---|
2086 | $show "$mkdir $output_objdir" |
---|
2087 | $run $mkdir $output_objdir |
---|
2088 | status=$? |
---|
2089 | if test "$status" -ne 0 && test ! -d "$output_objdir"; then |
---|
2090 | exit $status |
---|
2091 | fi |
---|
2092 | fi |
---|
2093 | |
---|
2094 | # Determine the type of output |
---|
2095 | case $output in |
---|
2096 | "") |
---|
2097 | $echo "$modename: you must specify an output file" 1>&2 |
---|
2098 | $echo "$help" 1>&2 |
---|
2099 | exit $EXIT_FAILURE |
---|
2100 | ;; |
---|
2101 | *.$libext) linkmode=oldlib ;; |
---|
2102 | *.lo | *.$objext) linkmode=obj ;; |
---|
2103 | *.la) linkmode=lib ;; |
---|
2104 | *) linkmode=prog ;; # Anything else should be a program. |
---|
2105 | esac |
---|
2106 | |
---|
2107 | case $host in |
---|
2108 | *cygwin* | *mingw* | *pw32*) |
---|
2109 | # don't eliminate duplications in $postdeps and $predeps |
---|
2110 | duplicate_compiler_generated_deps=yes |
---|
2111 | ;; |
---|
2112 | *) |
---|
2113 | duplicate_compiler_generated_deps=$duplicate_deps |
---|
2114 | ;; |
---|
2115 | esac |
---|
2116 | specialdeplibs= |
---|
2117 | |
---|
2118 | libs= |
---|
2119 | # Find all interdependent deplibs by searching for libraries |
---|
2120 | # that are linked more than once (e.g. -la -lb -la) |
---|
2121 | for deplib in $deplibs; do |
---|
2122 | if test "X$duplicate_deps" = "Xyes" ; then |
---|
2123 | case "$libs " in |
---|
2124 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
---|
2125 | esac |
---|
2126 | fi |
---|
2127 | libs="$libs $deplib" |
---|
2128 | done |
---|
2129 | |
---|
2130 | if test "$linkmode" = lib; then |
---|
2131 | libs="$predeps $libs $compiler_lib_search_path $postdeps" |
---|
2132 | |
---|
2133 | # Compute libraries that are listed more than once in $predeps |
---|
2134 | # $postdeps and mark them as special (i.e., whose duplicates are |
---|
2135 | # not to be eliminated). |
---|
2136 | pre_post_deps= |
---|
2137 | if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then |
---|
2138 | for pre_post_dep in $predeps $postdeps; do |
---|
2139 | case "$pre_post_deps " in |
---|
2140 | *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; |
---|
2141 | esac |
---|
2142 | pre_post_deps="$pre_post_deps $pre_post_dep" |
---|
2143 | done |
---|
2144 | fi |
---|
2145 | pre_post_deps= |
---|
2146 | fi |
---|
2147 | |
---|
2148 | deplibs= |
---|
2149 | newdependency_libs= |
---|
2150 | newlib_search_path= |
---|
2151 | need_relink=no # whether we're linking any uninstalled libtool libraries |
---|
2152 | notinst_deplibs= # not-installed libtool libraries |
---|
2153 | notinst_path= # paths that contain not-installed libtool libraries |
---|
2154 | case $linkmode in |
---|
2155 | lib) |
---|
2156 | passes="conv link" |
---|
2157 | for file in $dlfiles $dlprefiles; do |
---|
2158 | case $file in |
---|
2159 | *.la) ;; |
---|
2160 | *) |
---|
2161 | $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 |
---|
2162 | exit $EXIT_FAILURE |
---|
2163 | ;; |
---|
2164 | esac |
---|
2165 | done |
---|
2166 | ;; |
---|
2167 | prog) |
---|
2168 | compile_deplibs= |
---|
2169 | finalize_deplibs= |
---|
2170 | alldeplibs=no |
---|
2171 | newdlfiles= |
---|
2172 | newdlprefiles= |
---|
2173 | passes="conv scan dlopen dlpreopen link" |
---|
2174 | ;; |
---|
2175 | *) passes="conv" |
---|
2176 | ;; |
---|
2177 | esac |
---|
2178 | for pass in $passes; do |
---|
2179 | if test "$linkmode,$pass" = "lib,link" || |
---|
2180 | test "$linkmode,$pass" = "prog,scan"; then |
---|
2181 | libs="$deplibs" |
---|
2182 | deplibs= |
---|
2183 | fi |
---|
2184 | if test "$linkmode" = prog; then |
---|
2185 | case $pass in |
---|
2186 | dlopen) libs="$dlfiles" ;; |
---|
2187 | dlpreopen) libs="$dlprefiles" ;; |
---|
2188 | link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; |
---|
2189 | esac |
---|
2190 | fi |
---|
2191 | if test "$pass" = dlopen; then |
---|
2192 | # Collect dlpreopened libraries |
---|
2193 | save_deplibs="$deplibs" |
---|
2194 | deplibs= |
---|
2195 | fi |
---|
2196 | for deplib in $libs; do |
---|
2197 | lib= |
---|
2198 | found=no |
---|
2199 | case $deplib in |
---|
2200 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) |
---|
2201 | if test "$linkmode,$pass" = "prog,link"; then |
---|
2202 | compile_deplibs="$deplib $compile_deplibs" |
---|
2203 | finalize_deplibs="$deplib $finalize_deplibs" |
---|
2204 | else |
---|
2205 | deplibs="$deplib $deplibs" |
---|
2206 | fi |
---|
2207 | continue |
---|
2208 | ;; |
---|
2209 | -l*) |
---|
2210 | if test "$linkmode" != lib && test "$linkmode" != prog; then |
---|
2211 | $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 |
---|
2212 | continue |
---|
2213 | fi |
---|
2214 | if test "$pass" = conv; then |
---|
2215 | deplibs="$deplib $deplibs" |
---|
2216 | continue |
---|
2217 | fi |
---|
2218 | name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
---|
2219 | for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do |
---|
2220 | for search_ext in .la $std_shrext .so .a; do |
---|
2221 | # Search the libtool library |
---|
2222 | lib="$searchdir/lib${name}${search_ext}" |
---|
2223 | if test -f "$lib"; then |
---|
2224 | if test "$search_ext" = ".la"; then |
---|
2225 | found=yes |
---|
2226 | else |
---|
2227 | found=no |
---|
2228 | fi |
---|
2229 | break 2 |
---|
2230 | fi |
---|
2231 | done |
---|
2232 | done |
---|
2233 | if test "$found" != yes; then |
---|
2234 | # deplib doesn't seem to be a libtool library |
---|
2235 | if test "$linkmode,$pass" = "prog,link"; then |
---|
2236 | compile_deplibs="$deplib $compile_deplibs" |
---|
2237 | finalize_deplibs="$deplib $finalize_deplibs" |
---|
2238 | else |
---|
2239 | deplibs="$deplib $deplibs" |
---|
2240 | test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" |
---|
2241 | fi |
---|
2242 | continue |
---|
2243 | else # deplib is a libtool library |
---|
2244 | # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, |
---|
2245 | # We need to do some special things here, and not later. |
---|
2246 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
---|
2247 | case " $predeps $postdeps " in |
---|
2248 | *" $deplib "*) |
---|
2249 | if (${SED} -e '2q' $lib | |
---|
2250 | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
---|
2251 | library_names= |
---|
2252 | old_library= |
---|
2253 | case $lib in |
---|
2254 | */* | *\\*) . $lib ;; |
---|
2255 | *) . ./$lib ;; |
---|
2256 | esac |
---|
2257 | for l in $old_library $library_names; do |
---|
2258 | ll="$l" |
---|
2259 | done |
---|
2260 | if test "X$ll" = "X$old_library" ; then # only static version available |
---|
2261 | found=no |
---|
2262 | ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` |
---|
2263 | test "X$ladir" = "X$lib" && ladir="." |
---|
2264 | lib=$ladir/$old_library |
---|
2265 | if test "$linkmode,$pass" = "prog,link"; then |
---|
2266 | compile_deplibs="$deplib $compile_deplibs" |
---|
2267 | finalize_deplibs="$deplib $finalize_deplibs" |
---|
2268 | else |
---|
2269 | deplibs="$deplib $deplibs" |
---|
2270 | test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" |
---|
2271 | fi |
---|
2272 | continue |
---|
2273 | fi |
---|
2274 | fi |
---|
2275 | ;; |
---|
2276 | *) ;; |
---|
2277 | esac |
---|
2278 | fi |
---|
2279 | fi |
---|
2280 | ;; # -l |
---|
2281 | -L*) |
---|
2282 | case $linkmode in |
---|
2283 | lib) |
---|
2284 | deplibs="$deplib $deplibs" |
---|
2285 | test "$pass" = conv && continue |
---|
2286 | newdependency_libs="$deplib $newdependency_libs" |
---|
2287 | newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
---|
2288 | ;; |
---|
2289 | prog) |
---|
2290 | if test "$pass" = conv; then |
---|
2291 | deplibs="$deplib $deplibs" |
---|
2292 | continue |
---|
2293 | fi |
---|
2294 | if test "$pass" = scan; then |
---|
2295 | deplibs="$deplib $deplibs" |
---|
2296 | else |
---|
2297 | compile_deplibs="$deplib $compile_deplibs" |
---|
2298 | finalize_deplibs="$deplib $finalize_deplibs" |
---|
2299 | fi |
---|
2300 | newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
---|
2301 | ;; |
---|
2302 | *) |
---|
2303 | $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 |
---|
2304 | ;; |
---|
2305 | esac # linkmode |
---|
2306 | continue |
---|
2307 | ;; # -L |
---|
2308 | -R*) |
---|
2309 | if test "$pass" = link; then |
---|
2310 | dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` |
---|
2311 | # Make sure the xrpath contains only unique directories. |
---|
2312 | case "$xrpath " in |
---|
2313 | *" $dir "*) ;; |
---|
2314 | *) xrpath="$xrpath $dir" ;; |
---|
2315 | esac |
---|
2316 | fi |
---|
2317 | deplibs="$deplib $deplibs" |
---|
2318 | continue |
---|
2319 | ;; |
---|
2320 | *.la) lib="$deplib" ;; |
---|
2321 | *.$libext) |
---|
2322 | if test "$pass" = conv; then |
---|
2323 | deplibs="$deplib $deplibs" |
---|
2324 | continue |
---|
2325 | fi |
---|
2326 | case $linkmode in |
---|
2327 | lib) |
---|
2328 | if test "$deplibs_check_method" != pass_all; then |
---|
2329 | $echo |
---|
2330 | $echo "*** Warning: Trying to link with static lib archive $deplib." |
---|
2331 | $echo "*** I have the capability to make that library automatically link in when" |
---|
2332 | $echo "*** you link to this library. But I can only do this if you have a" |
---|
2333 | $echo "*** shared version of the library, which you do not appear to have" |
---|
2334 | $echo "*** because the file extensions .$libext of this argument makes me believe" |
---|
2335 | $echo "*** that it is just a static archive that I should not used here." |
---|
2336 | else |
---|
2337 | $echo |
---|
2338 | $echo "*** Warning: Linking the shared library $output against the" |
---|
2339 | $echo "*** static library $deplib is not portable!" |
---|
2340 | deplibs="$deplib $deplibs" |
---|
2341 | fi |
---|
2342 | continue |
---|
2343 | ;; |
---|
2344 | prog) |
---|
2345 | if test "$pass" != link; then |
---|
2346 | deplibs="$deplib $deplibs" |
---|
2347 | else |
---|
2348 | compile_deplibs="$deplib $compile_deplibs" |
---|
2349 | finalize_deplibs="$deplib $finalize_deplibs" |
---|
2350 | fi |
---|
2351 | continue |
---|
2352 | ;; |
---|
2353 | esac # linkmode |
---|
2354 | ;; # *.$libext |
---|
2355 | *.lo | *.$objext) |
---|
2356 | if test "$pass" = conv; then |
---|
2357 | deplibs="$deplib $deplibs" |
---|
2358 | elif test "$linkmode" = prog; then |
---|
2359 | if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then |
---|
2360 | # If there is no dlopen support or we're linking statically, |
---|
2361 | # we need to preload. |
---|
2362 | newdlprefiles="$newdlprefiles $deplib" |
---|
2363 | compile_deplibs="$deplib $compile_deplibs" |
---|
2364 | finalize_deplibs="$deplib $finalize_deplibs" |
---|
2365 | else |
---|
2366 | newdlfiles="$newdlfiles $deplib" |
---|
2367 | fi |
---|
2368 | fi |
---|
2369 | continue |
---|
2370 | ;; |
---|
2371 | %DEPLIBS%) |
---|
2372 | alldeplibs=yes |
---|
2373 | continue |
---|
2374 | ;; |
---|
2375 | esac # case $deplib |
---|
2376 | if test "$found" = yes || test -f "$lib"; then : |
---|
2377 | else |
---|
2378 | $echo "$modename: cannot find the library \`$lib'" 1>&2 |
---|
2379 | exit $EXIT_FAILURE |
---|
2380 | fi |
---|
2381 | |
---|
2382 | # Check to see that this really is a libtool archive. |
---|
2383 | if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
---|
2384 | else |
---|
2385 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
---|
2386 | exit $EXIT_FAILURE |
---|
2387 | fi |
---|
2388 | |
---|
2389 | ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` |
---|
2390 | test "X$ladir" = "X$lib" && ladir="." |
---|
2391 | |
---|
2392 | dlname= |
---|
2393 | dlopen= |
---|
2394 | dlpreopen= |
---|
2395 | libdir= |
---|
2396 | library_names= |
---|
2397 | old_library= |
---|
2398 | # If the library was installed with an old release of libtool, |
---|
2399 | # it will not redefine variables installed, or shouldnotlink |
---|
2400 | installed=yes |
---|
2401 | shouldnotlink=no |
---|
2402 | |
---|
2403 | # Read the .la file |
---|
2404 | case $lib in |
---|
2405 | */* | *\\*) . $lib ;; |
---|
2406 | *) . ./$lib ;; |
---|
2407 | esac |
---|
2408 | |
---|
2409 | if test "$linkmode,$pass" = "lib,link" || |
---|
2410 | test "$linkmode,$pass" = "prog,scan" || |
---|
2411 | { test "$linkmode" != prog && test "$linkmode" != lib; }; then |
---|
2412 | test -n "$dlopen" && dlfiles="$dlfiles $dlopen" |
---|
2413 | test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" |
---|
2414 | fi |
---|
2415 | |
---|
2416 | if test "$pass" = conv; then |
---|
2417 | # Only check for convenience libraries |
---|
2418 | deplibs="$lib $deplibs" |
---|
2419 | if test -z "$libdir"; then |
---|
2420 | if test -z "$old_library"; then |
---|
2421 | $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
---|
2422 | exit $EXIT_FAILURE |
---|
2423 | fi |
---|
2424 | # It is a libtool convenience library, so add in its objects. |
---|
2425 | convenience="$convenience $ladir/$objdir/$old_library" |
---|
2426 | old_convenience="$old_convenience $ladir/$objdir/$old_library" |
---|
2427 | tmp_libs= |
---|
2428 | for deplib in $dependency_libs; do |
---|
2429 | deplibs="$deplib $deplibs" |
---|
2430 | if test "X$duplicate_deps" = "Xyes" ; then |
---|
2431 | case "$tmp_libs " in |
---|
2432 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
---|
2433 | esac |
---|
2434 | fi |
---|
2435 | tmp_libs="$tmp_libs $deplib" |
---|
2436 | done |
---|
2437 | elif test "$linkmode" != prog && test "$linkmode" != lib; then |
---|
2438 | $echo "$modename: \`$lib' is not a convenience library" 1>&2 |
---|
2439 | exit $EXIT_FAILURE |
---|
2440 | fi |
---|
2441 | continue |
---|
2442 | fi # $pass = conv |
---|
2443 | |
---|
2444 | |
---|
2445 | # Get the name of the library we link against. |
---|
2446 | linklib= |
---|
2447 | for l in $old_library $library_names; do |
---|
2448 | linklib="$l" |
---|
2449 | done |
---|
2450 | if test -z "$linklib"; then |
---|
2451 | $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
---|
2452 | exit $EXIT_FAILURE |
---|
2453 | fi |
---|
2454 | |
---|
2455 | # This library was specified with -dlopen. |
---|
2456 | if test "$pass" = dlopen; then |
---|
2457 | if test -z "$libdir"; then |
---|
2458 | $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 |
---|
2459 | exit $EXIT_FAILURE |
---|
2460 | fi |
---|
2461 | if test -z "$dlname" || |
---|
2462 | test "$dlopen_support" != yes || |
---|
2463 | test "$build_libtool_libs" = no; then |
---|
2464 | # If there is no dlname, no dlopen support or we're linking |
---|
2465 | # statically, we need to preload. We also need to preload any |
---|
2466 | # dependent libraries so libltdl's deplib preloader doesn't |
---|
2467 | # bomb out in the load deplibs phase. |
---|
2468 | dlprefiles="$dlprefiles $lib $dependency_libs" |
---|
2469 | else |
---|
2470 | newdlfiles="$newdlfiles $lib" |
---|
2471 | fi |
---|
2472 | continue |
---|
2473 | fi # $pass = dlopen |
---|
2474 | |
---|
2475 | # We need an absolute path. |
---|
2476 | case $ladir in |
---|
2477 | [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; |
---|
2478 | *) |
---|
2479 | abs_ladir=`cd "$ladir" && pwd` |
---|
2480 | if test -z "$abs_ladir"; then |
---|
2481 | $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 |
---|
2482 | $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 |
---|
2483 | abs_ladir="$ladir" |
---|
2484 | fi |
---|
2485 | ;; |
---|
2486 | esac |
---|
2487 | laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
---|
2488 | |
---|
2489 | # Find the relevant object directory and library name. |
---|
2490 | if test "X$installed" = Xyes; then |
---|
2491 | if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then |
---|
2492 | $echo "$modename: warning: library \`$lib' was moved." 1>&2 |
---|
2493 | dir="$ladir" |
---|
2494 | absdir="$abs_ladir" |
---|
2495 | libdir="$abs_ladir" |
---|
2496 | else |
---|
2497 | dir="$libdir" |
---|
2498 | absdir="$libdir" |
---|
2499 | fi |
---|
2500 | else |
---|
2501 | dir="$ladir/$objdir" |
---|
2502 | absdir="$abs_ladir/$objdir" |
---|
2503 | # Remove this search path later |
---|
2504 | notinst_path="$notinst_path $abs_ladir" |
---|
2505 | fi # $installed = yes |
---|
2506 | name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
---|
2507 | |
---|
2508 | # This library was specified with -dlpreopen. |
---|
2509 | if test "$pass" = dlpreopen; then |
---|
2510 | if test -z "$libdir"; then |
---|
2511 | $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 |
---|
2512 | exit $EXIT_FAILURE |
---|
2513 | fi |
---|
2514 | # Prefer using a static library (so that no silly _DYNAMIC symbols |
---|
2515 | # are required to link). |
---|
2516 | if test -n "$old_library"; then |
---|
2517 | newdlprefiles="$newdlprefiles $dir/$old_library" |
---|
2518 | # Otherwise, use the dlname, so that lt_dlopen finds it. |
---|
2519 | elif test -n "$dlname"; then |
---|
2520 | newdlprefiles="$newdlprefiles $dir/$dlname" |
---|
2521 | else |
---|
2522 | newdlprefiles="$newdlprefiles $dir/$linklib" |
---|
2523 | fi |
---|
2524 | fi # $pass = dlpreopen |
---|
2525 | |
---|
2526 | if test -z "$libdir"; then |
---|
2527 | # Link the convenience library |
---|
2528 | if test "$linkmode" = lib; then |
---|
2529 | deplibs="$dir/$old_library $deplibs" |
---|
2530 | elif test "$linkmode,$pass" = "prog,link"; then |
---|
2531 | compile_deplibs="$dir/$old_library $compile_deplibs" |
---|
2532 | finalize_deplibs="$dir/$old_library $finalize_deplibs" |
---|
2533 | else |
---|
2534 | deplibs="$lib $deplibs" # used for prog,scan pass |
---|
2535 | fi |
---|
2536 | continue |
---|
2537 | fi |
---|
2538 | |
---|
2539 | |
---|
2540 | if test "$linkmode" = prog && test "$pass" != link; then |
---|
2541 | newlib_search_path="$newlib_search_path $ladir" |
---|
2542 | deplibs="$lib $deplibs" |
---|
2543 | |
---|
2544 | linkalldeplibs=no |
---|
2545 | if test "$link_all_deplibs" != no || test -z "$library_names" || |
---|
2546 | test "$build_libtool_libs" = no; then |
---|
2547 | linkalldeplibs=yes |
---|
2548 | fi |
---|
2549 | |
---|
2550 | tmp_libs= |
---|
2551 | for deplib in $dependency_libs; do |
---|
2552 | case $deplib in |
---|
2553 | -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test |
---|
2554 | esac |
---|
2555 | # Need to link against all dependency_libs? |
---|
2556 | if test "$linkalldeplibs" = yes; then |
---|
2557 | deplibs="$deplib $deplibs" |
---|
2558 | else |
---|
2559 | # Need to hardcode shared library paths |
---|
2560 | # or/and link against static libraries |
---|
2561 | newdependency_libs="$deplib $newdependency_libs" |
---|
2562 | fi |
---|
2563 | if test "X$duplicate_deps" = "Xyes" ; then |
---|
2564 | case "$tmp_libs " in |
---|
2565 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
---|
2566 | esac |
---|
2567 | fi |
---|
2568 | tmp_libs="$tmp_libs $deplib" |
---|
2569 | done # for deplib |
---|
2570 | continue |
---|
2571 | fi # $linkmode = prog... |
---|
2572 | |
---|
2573 | if test "$linkmode,$pass" = "prog,link"; then |
---|
2574 | if test -n "$library_names" && |
---|
2575 | { test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
---|
2576 | # We need to hardcode the library path |
---|
2577 | if test -n "$shlibpath_var"; then |
---|
2578 | # Make sure the rpath contains only unique directories. |
---|
2579 | case "$temp_rpath " in |
---|
2580 | *" $dir "*) ;; |
---|
2581 | *" $absdir "*) ;; |
---|
2582 | *) temp_rpath="$temp_rpath $dir" ;; |
---|
2583 | esac |
---|
2584 | fi |
---|
2585 | |
---|
2586 | # Hardcode the library path. |
---|
2587 | # Skip directories that are in the system default run-time |
---|
2588 | # search path. |
---|
2589 | case " $sys_lib_dlsearch_path " in |
---|
2590 | *" $absdir "*) ;; |
---|
2591 | *) |
---|
2592 | case "$compile_rpath " in |
---|
2593 | *" $absdir "*) ;; |
---|
2594 | *) compile_rpath="$compile_rpath $absdir" |
---|
2595 | esac |
---|
2596 | ;; |
---|
2597 | esac |
---|
2598 | case " $sys_lib_dlsearch_path " in |
---|
2599 | *" $libdir "*) ;; |
---|
2600 | *) |
---|
2601 | case "$finalize_rpath " in |
---|
2602 | *" $libdir "*) ;; |
---|
2603 | *) finalize_rpath="$finalize_rpath $libdir" |
---|
2604 | esac |
---|
2605 | ;; |
---|
2606 | esac |
---|
2607 | fi # $linkmode,$pass = prog,link... |
---|
2608 | |
---|
2609 | if test "$alldeplibs" = yes && |
---|
2610 | { test "$deplibs_check_method" = pass_all || |
---|
2611 | { test "$build_libtool_libs" = yes && |
---|
2612 | test -n "$library_names"; }; }; then |
---|
2613 | # We only need to search for static libraries |
---|
2614 | continue |
---|
2615 | fi |
---|
2616 | fi |
---|
2617 | |
---|
2618 | link_static=no # Whether the deplib will be linked statically |
---|
2619 | if test -n "$library_names" && |
---|
2620 | { test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
---|
2621 | if test "$installed" = no; then |
---|
2622 | notinst_deplibs="$notinst_deplibs $lib" |
---|
2623 | need_relink=yes |
---|
2624 | fi |
---|
2625 | # This is a shared library |
---|
2626 | |
---|
2627 | # Warn about portability, can't link against -module's on |
---|
2628 | # some systems (darwin) |
---|
2629 | if test "$shouldnotlink" = yes && test "$pass" = link ; then |
---|
2630 | $echo |
---|
2631 | if test "$linkmode" = prog; then |
---|
2632 | $echo "*** Warning: Linking the executable $output against the loadable module" |
---|
2633 | else |
---|
2634 | $echo "*** Warning: Linking the shared library $output against the loadable module" |
---|
2635 | fi |
---|
2636 | $echo "*** $linklib is not portable!" |
---|
2637 | fi |
---|
2638 | if test "$linkmode" = lib && |
---|
2639 | test "$hardcode_into_libs" = yes; then |
---|
2640 | # Hardcode the library path. |
---|
2641 | # Skip directories that are in the system default run-time |
---|
2642 | # search path. |
---|
2643 | case " $sys_lib_dlsearch_path " in |
---|
2644 | *" $absdir "*) ;; |
---|
2645 | *) |
---|
2646 | case "$compile_rpath " in |
---|
2647 | *" $absdir "*) ;; |
---|
2648 | *) compile_rpath="$compile_rpath $absdir" |
---|
2649 | esac |
---|
2650 | ;; |
---|
2651 | esac |
---|
2652 | case " $sys_lib_dlsearch_path " in |
---|
2653 | *" $libdir "*) ;; |
---|
2654 | *) |
---|
2655 | case "$finalize_rpath " in |
---|
2656 | *" $libdir "*) ;; |
---|
2657 | *) finalize_rpath="$finalize_rpath $libdir" |
---|
2658 | esac |
---|
2659 | ;; |
---|
2660 | esac |
---|
2661 | fi |
---|
2662 | |
---|
2663 | if test -n "$old_archive_from_expsyms_cmds"; then |
---|
2664 | # figure out the soname |
---|
2665 | set dummy $library_names |
---|
2666 | realname="$2" |
---|
2667 | shift; shift |
---|
2668 | libname=`eval \\$echo \"$libname_spec\"` |
---|
2669 | # use dlname if we got it. it's perfectly good, no? |
---|
2670 | if test -n "$dlname"; then |
---|
2671 | soname="$dlname" |
---|
2672 | elif test -n "$soname_spec"; then |
---|
2673 | # bleh windows |
---|
2674 | case $host in |
---|
2675 | *cygwin* | mingw*) |
---|
2676 | major=`expr $current - $age` |
---|
2677 | versuffix="-$major" |
---|
2678 | ;; |
---|
2679 | esac |
---|
2680 | eval soname=\"$soname_spec\" |
---|
2681 | else |
---|
2682 | soname="$realname" |
---|
2683 | fi |
---|
2684 | |
---|
2685 | # Make a new name for the extract_expsyms_cmds to use |
---|
2686 | soroot="$soname" |
---|
2687 | soname=`$echo $soroot | ${SED} -e 's/^.*\///'` |
---|
2688 | newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" |
---|
2689 | |
---|
2690 | # If the library has no export list, then create one now |
---|
2691 | if test -f "$output_objdir/$soname-def"; then : |
---|
2692 | else |
---|
2693 | $show "extracting exported symbol list from \`$soname'" |
---|
2694 | save_ifs="$IFS"; IFS='~' |
---|
2695 | cmds=$extract_expsyms_cmds |
---|
2696 | for cmd in $cmds; do |
---|
2697 | IFS="$save_ifs" |
---|
2698 | eval cmd=\"$cmd\" |
---|
2699 | $show "$cmd" |
---|
2700 | $run eval "$cmd" || exit $? |
---|
2701 | done |
---|
2702 | IFS="$save_ifs" |
---|
2703 | fi |
---|
2704 | |
---|
2705 | # Create $newlib |
---|
2706 | if test -f "$output_objdir/$newlib"; then :; else |
---|
2707 | $show "generating import library for \`$soname'" |
---|
2708 | save_ifs="$IFS"; IFS='~' |
---|
2709 | cmds=$old_archive_from_expsyms_cmds |
---|
2710 | for cmd in $cmds; do |
---|
2711 | IFS="$save_ifs" |
---|
2712 | eval cmd=\"$cmd\" |
---|
2713 | $show "$cmd" |
---|
2714 | $run eval "$cmd" || exit $? |
---|
2715 | done |
---|
2716 | IFS="$save_ifs" |
---|
2717 | fi |
---|
2718 | # make sure the library variables are pointing to the new library |
---|
2719 | dir=$output_objdir |
---|
2720 | linklib=$newlib |
---|
2721 | fi # test -n "$old_archive_from_expsyms_cmds" |
---|
2722 | |
---|
2723 | if test "$linkmode" = prog || test "$mode" != relink; then |
---|
2724 | add_shlibpath= |
---|
2725 | add_dir= |
---|
2726 | add= |
---|
2727 | lib_linked=yes |
---|
2728 | case $hardcode_action in |
---|
2729 | immediate | unsupported) |
---|
2730 | if test "$hardcode_direct" = no; then |
---|
2731 | add="$dir/$linklib" |
---|
2732 | case $host in |
---|
2733 | *-*-sco3.2v5* ) add_dir="-L$dir" ;; |
---|
2734 | *-*-darwin* ) |
---|
2735 | # if the lib is a module then we can not link against |
---|
2736 | # it, someone is ignoring the new warnings I added |
---|
2737 | if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then |
---|
2738 | $echo "** Warning, lib $linklib is a module, not a shared library" |
---|
2739 | if test -z "$old_library" ; then |
---|
2740 | $echo |
---|
2741 | $echo "** And there doesn't seem to be a static archive available" |
---|
2742 | $echo "** The link will probably fail, sorry" |
---|
2743 | else |
---|
2744 | add="$dir/$old_library" |
---|
2745 | fi |
---|
2746 | fi |
---|
2747 | esac |
---|
2748 | elif test "$hardcode_minus_L" = no; then |
---|
2749 | case $host in |
---|
2750 | *-*-sunos*) add_shlibpath="$dir" ;; |
---|
2751 | esac |
---|
2752 | add_dir="-L$dir" |
---|
2753 | add="-l$name" |
---|
2754 | elif test "$hardcode_shlibpath_var" = no; then |
---|
2755 | add_shlibpath="$dir" |
---|
2756 | add="-l$name" |
---|
2757 | else |
---|
2758 | lib_linked=no |
---|
2759 | fi |
---|
2760 | ;; |
---|
2761 | relink) |
---|
2762 | if test "$hardcode_direct" = yes; then |
---|
2763 | add="$dir/$linklib" |
---|
2764 | elif test "$hardcode_minus_L" = yes; then |
---|
2765 | add_dir="-L$dir" |
---|
2766 | # Try looking first in the location we're being installed to. |
---|
2767 | if test -n "$inst_prefix_dir"; then |
---|
2768 | case "$libdir" in |
---|
2769 | [\\/]*) |
---|
2770 | add_dir="$add_dir -L$inst_prefix_dir$libdir" |
---|
2771 | ;; |
---|
2772 | esac |
---|
2773 | fi |
---|
2774 | add="-l$name" |
---|
2775 | elif test "$hardcode_shlibpath_var" = yes; then |
---|
2776 | add_shlibpath="$dir" |
---|
2777 | add="-l$name" |
---|
2778 | else |
---|
2779 | lib_linked=no |
---|
2780 | fi |
---|
2781 | ;; |
---|
2782 | *) lib_linked=no ;; |
---|
2783 | esac |
---|
2784 | |
---|
2785 | if test "$lib_linked" != yes; then |
---|
2786 | $echo "$modename: configuration error: unsupported hardcode properties" |
---|
2787 | exit $EXIT_FAILURE |
---|
2788 | fi |
---|
2789 | |
---|
2790 | if test -n "$add_shlibpath"; then |
---|
2791 | case :$compile_shlibpath: in |
---|
2792 | *":$add_shlibpath:"*) ;; |
---|
2793 | *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; |
---|
2794 | esac |
---|
2795 | fi |
---|
2796 | if test "$linkmode" = prog; then |
---|
2797 | test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" |
---|
2798 | test -n "$add" && compile_deplibs="$add $compile_deplibs" |
---|
2799 | else |
---|
2800 | test -n "$add_dir" && deplibs="$add_dir $deplibs" |
---|
2801 | test -n "$add" && deplibs="$add $deplibs" |
---|
2802 | if test "$hardcode_direct" != yes && \ |
---|
2803 | test "$hardcode_minus_L" != yes && \ |
---|
2804 | test "$hardcode_shlibpath_var" = yes; then |
---|
2805 | case :$finalize_shlibpath: in |
---|
2806 | *":$libdir:"*) ;; |
---|
2807 | *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; |
---|
2808 | esac |
---|
2809 | fi |
---|
2810 | fi |
---|
2811 | fi |
---|
2812 | |
---|
2813 | if test "$linkmode" = prog || test "$mode" = relink; then |
---|
2814 | add_shlibpath= |
---|
2815 | add_dir= |
---|
2816 | add= |
---|
2817 | # Finalize command for both is simple: just hardcode it. |
---|
2818 | if test "$hardcode_direct" = yes; then |
---|
2819 | add="$libdir/$linklib" |
---|
2820 | elif test "$hardcode_minus_L" = yes; then |
---|
2821 | add_dir="-L$libdir" |
---|
2822 | add="-l$name" |
---|
2823 | elif test "$hardcode_shlibpath_var" = yes; then |
---|
2824 | case :$finalize_shlibpath: in |
---|
2825 | *":$libdir:"*) ;; |
---|
2826 | *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; |
---|
2827 | esac |
---|
2828 | add="-l$name" |
---|
2829 | elif test "$hardcode_automatic" = yes; then |
---|
2830 | if test -n "$inst_prefix_dir" && |
---|
2831 | test -f "$inst_prefix_dir$libdir/$linklib" ; then |
---|
2832 | add="$inst_prefix_dir$libdir/$linklib" |
---|
2833 | else |
---|
2834 | add="$libdir/$linklib" |
---|
2835 | fi |
---|
2836 | else |
---|
2837 | # We cannot seem to hardcode it, guess we'll fake it. |
---|
2838 | add_dir="-L$libdir" |
---|
2839 | # Try looking first in the location we're being installed to. |
---|
2840 | if test -n "$inst_prefix_dir"; then |
---|
2841 | case "$libdir" in |
---|
2842 | [\\/]*) |
---|
2843 | add_dir="$add_dir -L$inst_prefix_dir$libdir" |
---|
2844 | ;; |
---|
2845 | esac |
---|
2846 | fi |
---|
2847 | add="-l$name" |
---|
2848 | fi |
---|
2849 | |
---|
2850 | if test "$linkmode" = prog; then |
---|
2851 | test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" |
---|
2852 | test -n "$add" && finalize_deplibs="$add $finalize_deplibs" |
---|
2853 | else |
---|
2854 | test -n "$add_dir" && deplibs="$add_dir $deplibs" |
---|
2855 | test -n "$add" && deplibs="$add $deplibs" |
---|
2856 | fi |
---|
2857 | fi |
---|
2858 | elif test "$linkmode" = prog; then |
---|
2859 | # Here we assume that one of hardcode_direct or hardcode_minus_L |
---|
2860 | # is not unsupported. This is valid on all known static and |
---|
2861 | # shared platforms. |
---|
2862 | if test "$hardcode_direct" != unsupported; then |
---|
2863 | test -n "$old_library" && linklib="$old_library" |
---|
2864 | compile_deplibs="$dir/$linklib $compile_deplibs" |
---|
2865 | finalize_deplibs="$dir/$linklib $finalize_deplibs" |
---|
2866 | else |
---|
2867 | compile_deplibs="-l$name -L$dir $compile_deplibs" |
---|
2868 | finalize_deplibs="-l$name -L$dir $finalize_deplibs" |
---|
2869 | fi |
---|
2870 | elif test "$build_libtool_libs" = yes; then |
---|
2871 | # Not a shared library |
---|
2872 | if test "$deplibs_check_method" != pass_all; then |
---|
2873 | # We're trying link a shared library against a static one |
---|
2874 | # but the system doesn't support it. |
---|
2875 | |
---|
2876 | # Just print a warning and add the library to dependency_libs so |
---|
2877 | # that the program can be linked against the static library. |
---|
2878 | $echo |
---|
2879 | $echo "*** Warning: This system can not link to static lib archive $lib." |
---|
2880 | $echo "*** I have the capability to make that library automatically link in when" |
---|
2881 | $echo "*** you link to this library. But I can only do this if you have a" |
---|
2882 | $echo "*** shared version of the library, which you do not appear to have." |
---|
2883 | if test "$module" = yes; then |
---|
2884 | $echo "*** But as you try to build a module library, libtool will still create " |
---|
2885 | $echo "*** a static module, that should work as long as the dlopening application" |
---|
2886 | $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." |
---|
2887 | if test -z "$global_symbol_pipe"; then |
---|
2888 | $echo |
---|
2889 | $echo "*** However, this would only work if libtool was able to extract symbol" |
---|
2890 | $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" |
---|
2891 | $echo "*** not find such a program. So, this module is probably useless." |
---|
2892 | $echo "*** \`nm' from GNU binutils and a full rebuild may help." |
---|
2893 | fi |
---|
2894 | if test "$build_old_libs" = no; then |
---|
2895 | build_libtool_libs=module |
---|
2896 | build_old_libs=yes |
---|
2897 | else |
---|
2898 | build_libtool_libs=no |
---|
2899 | fi |
---|
2900 | fi |
---|
2901 | else |
---|
2902 | convenience="$convenience $dir/$old_library" |
---|
2903 | old_convenience="$old_convenience $dir/$old_library" |
---|
2904 | deplibs="$dir/$old_library $deplibs" |
---|
2905 | link_static=yes |
---|
2906 | fi |
---|
2907 | fi # link shared/static library? |
---|
2908 | |
---|
2909 | if test "$linkmode" = lib; then |
---|
2910 | if test -n "$dependency_libs" && |
---|
2911 | { test "$hardcode_into_libs" != yes || |
---|
2912 | test "$build_old_libs" = yes || |
---|
2913 | test "$link_static" = yes; }; then |
---|
2914 | # Extract -R from dependency_libs |
---|
2915 | temp_deplibs= |
---|
2916 | for libdir in $dependency_libs; do |
---|
2917 | case $libdir in |
---|
2918 | -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` |
---|
2919 | case " $xrpath " in |
---|
2920 | *" $temp_xrpath "*) ;; |
---|
2921 | *) xrpath="$xrpath $temp_xrpath";; |
---|
2922 | esac;; |
---|
2923 | *) temp_deplibs="$temp_deplibs $libdir";; |
---|
2924 | esac |
---|
2925 | done |
---|
2926 | dependency_libs="$temp_deplibs" |
---|
2927 | fi |
---|
2928 | |
---|
2929 | newlib_search_path="$newlib_search_path $absdir" |
---|
2930 | # Link against this library |
---|
2931 | test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" |
---|
2932 | # ... and its dependency_libs |
---|
2933 | tmp_libs= |
---|
2934 | for deplib in $dependency_libs; do |
---|
2935 | newdependency_libs="$deplib $newdependency_libs" |
---|
2936 | if test "X$duplicate_deps" = "Xyes" ; then |
---|
2937 | case "$tmp_libs " in |
---|
2938 | *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
---|
2939 | esac |
---|
2940 | fi |
---|
2941 | tmp_libs="$tmp_libs $deplib" |
---|
2942 | done |
---|
2943 | |
---|
2944 | if test "$link_all_deplibs" != no; then |
---|
2945 | # Add the search paths of all dependency libraries |
---|
2946 | for deplib in $dependency_libs; do |
---|
2947 | case $deplib in |
---|
2948 | -L*) path="$deplib" ;; |
---|
2949 | *.la) |
---|
2950 | dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` |
---|
2951 | test "X$dir" = "X$deplib" && dir="." |
---|
2952 | # We need an absolute path. |
---|
2953 | case $dir in |
---|
2954 | [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; |
---|
2955 | *) |
---|
2956 | absdir=`cd "$dir" && pwd` |
---|
2957 | if test -z "$absdir"; then |
---|
2958 | $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 |
---|
2959 | absdir="$dir" |
---|
2960 | fi |
---|
2961 | ;; |
---|
2962 | esac |
---|
2963 | if grep "^installed=no" $deplib > /dev/null; then |
---|
2964 | path="$absdir/$objdir" |
---|
2965 | else |
---|
2966 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
---|
2967 | if test -z "$libdir"; then |
---|
2968 | $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
---|
2969 | exit $EXIT_FAILURE |
---|
2970 | fi |
---|
2971 | if test "$absdir" != "$libdir"; then |
---|
2972 | $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 |
---|
2973 | fi |
---|
2974 | path="$absdir" |
---|
2975 | fi |
---|
2976 | depdepl= |
---|
2977 | case $host in |
---|
2978 | *-*-darwin*) |
---|
2979 | # we do not want to link against static libs, |
---|
2980 | # but need to link against shared |
---|
2981 | eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` |
---|
2982 | if test -n "$deplibrary_names" ; then |
---|
2983 | for tmp in $deplibrary_names ; do |
---|
2984 | depdepl=$tmp |
---|
2985 | done |
---|
2986 | if test -f "$path/$depdepl" ; then |
---|
2987 | depdepl="$path/$depdepl" |
---|
2988 | fi |
---|
2989 | # do not add paths which are already there |
---|
2990 | case " $newlib_search_path " in |
---|
2991 | *" $path "*) ;; |
---|
2992 | *) newlib_search_path="$newlib_search_path $path";; |
---|
2993 | esac |
---|
2994 | fi |
---|
2995 | path="" |
---|
2996 | ;; |
---|
2997 | *) |
---|
2998 | path="-L$path" |
---|
2999 | ;; |
---|
3000 | esac |
---|
3001 | ;; |
---|
3002 | -l*) |
---|
3003 | case $host in |
---|
3004 | *-*-darwin*) |
---|
3005 | # Again, we only want to link against shared libraries |
---|
3006 | eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` |
---|
3007 | for tmp in $newlib_search_path ; do |
---|
3008 | if test -f "$tmp/lib$tmp_libs.dylib" ; then |
---|
3009 | eval depdepl="$tmp/lib$tmp_libs.dylib" |
---|
3010 | break |
---|
3011 | fi |
---|
3012 | done |
---|
3013 | path="" |
---|
3014 | ;; |
---|
3015 | *) continue ;; |
---|
3016 | esac |
---|
3017 | ;; |
---|
3018 | *) continue ;; |
---|
3019 | esac |
---|
3020 | case " $deplibs " in |
---|
3021 | *" $depdepl "*) ;; |
---|
3022 | *) deplibs="$depdepl $deplibs" ;; |
---|
3023 | esac |
---|
3024 | case " $deplibs " in |
---|
3025 | *" $path "*) ;; |
---|
3026 | *) deplibs="$deplibs $path" ;; |
---|
3027 | esac |
---|
3028 | done |
---|
3029 | fi # link_all_deplibs != no |
---|
3030 | fi # linkmode = lib |
---|
3031 | done # for deplib in $libs |
---|
3032 | dependency_libs="$newdependency_libs" |
---|
3033 | if test "$pass" = dlpreopen; then |
---|
3034 | # Link the dlpreopened libraries before other libraries |
---|
3035 | for deplib in $save_deplibs; do |
---|
3036 | deplibs="$deplib $deplibs" |
---|
3037 | done |
---|
3038 | fi |
---|
3039 | if test "$pass" != dlopen; then |
---|
3040 | if test "$pass" != conv; then |
---|
3041 | # Make sure lib_search_path contains only unique directories. |
---|
3042 | lib_search_path= |
---|
3043 | for dir in $newlib_search_path; do |
---|
3044 | case "$lib_search_path " in |
---|
3045 | *" $dir "*) ;; |
---|
3046 | *) lib_search_path="$lib_search_path $dir" ;; |
---|
3047 | esac |
---|
3048 | done |
---|
3049 | newlib_search_path= |
---|
3050 | fi |
---|
3051 | |
---|
3052 | if test "$linkmode,$pass" != "prog,link"; then |
---|
3053 | vars="deplibs" |
---|
3054 | else |
---|
3055 | vars="compile_deplibs finalize_deplibs" |
---|
3056 | fi |
---|
3057 | for var in $vars dependency_libs; do |
---|
3058 | # Add libraries to $var in reverse order |
---|
3059 | eval tmp_libs=\"\$$var\" |
---|
3060 | new_libs= |
---|
3061 | for deplib in $tmp_libs; do |
---|
3062 | # FIXME: Pedantically, this is the right thing to do, so |
---|
3063 | # that some nasty dependency loop isn't accidentally |
---|
3064 | # broken: |
---|
3065 | #new_libs="$deplib $new_libs" |
---|
3066 | # Pragmatically, this seems to cause very few problems in |
---|
3067 | # practice: |
---|
3068 | case $deplib in |
---|
3069 | -L*) new_libs="$deplib $new_libs" ;; |
---|
3070 | -R*) ;; |
---|
3071 | *) |
---|
3072 | # And here is the reason: when a library appears more |
---|
3073 | # than once as an explicit dependence of a library, or |
---|
3074 | # is implicitly linked in more than once by the |
---|
3075 | # compiler, it is considered special, and multiple |
---|
3076 | # occurrences thereof are not removed. Compare this |
---|
3077 | # with having the same library being listed as a |
---|
3078 | # dependency of multiple other libraries: in this case, |
---|
3079 | # we know (pedantically, we assume) the library does not |
---|
3080 | # need to be listed more than once, so we keep only the |
---|
3081 | # last copy. This is not always right, but it is rare |
---|
3082 | # enough that we require users that really mean to play |
---|
3083 | # such unportable linking tricks to link the library |
---|
3084 | # using -Wl,-lname, so that libtool does not consider it |
---|
3085 | # for duplicate removal. |
---|
3086 | case " $specialdeplibs " in |
---|
3087 | *" $deplib "*) new_libs="$deplib $new_libs" ;; |
---|
3088 | *) |
---|
3089 | case " $new_libs " in |
---|
3090 | *" $deplib "*) ;; |
---|
3091 | *) new_libs="$deplib $new_libs" ;; |
---|
3092 | esac |
---|
3093 | ;; |
---|
3094 | esac |
---|
3095 | ;; |
---|
3096 | esac |
---|
3097 | done |
---|
3098 | tmp_libs= |
---|
3099 | for deplib in $new_libs; do |
---|
3100 | case $deplib in |
---|
3101 | -L*) |
---|
3102 | case " $tmp_libs " in |
---|
3103 | *" $deplib "*) ;; |
---|
3104 | *) tmp_libs="$tmp_libs $deplib" ;; |
---|
3105 | esac |
---|
3106 | ;; |
---|
3107 | *) tmp_libs="$tmp_libs $deplib" ;; |
---|
3108 | esac |
---|
3109 | done |
---|
3110 | eval $var=\"$tmp_libs\" |
---|
3111 | done # for var |
---|
3112 | fi |
---|
3113 | # Last step: remove runtime libs from dependency_libs |
---|
3114 | # (they stay in deplibs) |
---|
3115 | tmp_libs= |
---|
3116 | for i in $dependency_libs ; do |
---|
3117 | case " $predeps $postdeps $compiler_lib_search_path " in |
---|
3118 | *" $i "*) |
---|
3119 | i="" |
---|
3120 | ;; |
---|
3121 | esac |
---|
3122 | if test -n "$i" ; then |
---|
3123 | tmp_libs="$tmp_libs $i" |
---|
3124 | fi |
---|
3125 | done |
---|
3126 | dependency_libs=$tmp_libs |
---|
3127 | done # for pass |
---|
3128 | if test "$linkmode" = prog; then |
---|
3129 | dlfiles="$newdlfiles" |
---|
3130 | dlprefiles="$newdlprefiles" |
---|
3131 | fi |
---|
3132 | |
---|
3133 | case $linkmode in |
---|
3134 | oldlib) |
---|
3135 | if test -n "$deplibs"; then |
---|
3136 | $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 |
---|
3137 | fi |
---|
3138 | |
---|
3139 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
---|
3140 | $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 |
---|
3141 | fi |
---|
3142 | |
---|
3143 | if test -n "$rpath"; then |
---|
3144 | $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 |
---|
3145 | fi |
---|
3146 | |
---|
3147 | if test -n "$xrpath"; then |
---|
3148 | $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 |
---|
3149 | fi |
---|
3150 | |
---|
3151 | if test -n "$vinfo"; then |
---|
3152 | $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 |
---|
3153 | fi |
---|
3154 | |
---|
3155 | if test -n "$release"; then |
---|
3156 | $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 |
---|
3157 | fi |
---|
3158 | |
---|
3159 | if test -n "$export_symbols" || test -n "$export_symbols_regex"; then |
---|
3160 | $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 |
---|
3161 | fi |
---|
3162 | |
---|
3163 | # Now set the variables for building old libraries. |
---|
3164 | build_libtool_libs=no |
---|
3165 | oldlibs="$output" |
---|
3166 | objs="$objs$old_deplibs" |
---|
3167 | ;; |
---|
3168 | |
---|
3169 | lib) |
---|
3170 | # Make sure we only generate libraries of the form `libNAME.la'. |
---|
3171 | case $outputname in |
---|
3172 | lib*) |
---|
3173 | name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
---|
3174 | eval shared_ext=\"$shrext_cmds\" |
---|
3175 | eval libname=\"$libname_spec\" |
---|
3176 | ;; |
---|
3177 | *) |
---|
3178 | if test "$module" = no; then |
---|
3179 | $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 |
---|
3180 | $echo "$help" 1>&2 |
---|
3181 | exit $EXIT_FAILURE |
---|
3182 | fi |
---|
3183 | if test "$need_lib_prefix" != no; then |
---|
3184 | # Add the "lib" prefix for modules if required |
---|
3185 | name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` |
---|
3186 | eval shared_ext=\"$shrext_cmds\" |
---|
3187 | eval libname=\"$libname_spec\" |
---|
3188 | else |
---|
3189 | libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` |
---|
3190 | fi |
---|
3191 | ;; |
---|
3192 | esac |
---|
3193 | |
---|
3194 | if test -n "$objs"; then |
---|
3195 | if test "$deplibs_check_method" != pass_all; then |
---|
3196 | $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 |
---|
3197 | exit $EXIT_FAILURE |
---|
3198 | else |
---|
3199 | $echo |
---|
3200 | $echo "*** Warning: Linking the shared library $output against the non-libtool" |
---|
3201 | $echo "*** objects $objs is not portable!" |
---|
3202 | libobjs="$libobjs $objs" |
---|
3203 | fi |
---|
3204 | fi |
---|
3205 | |
---|
3206 | if test "$dlself" != no; then |
---|
3207 | $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 |
---|
3208 | fi |
---|
3209 | |
---|
3210 | set dummy $rpath |
---|
3211 | if test "$#" -gt 2; then |
---|
3212 | $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 |
---|
3213 | fi |
---|
3214 | install_libdir="$2" |
---|
3215 | |
---|
3216 | oldlibs= |
---|
3217 | if test -z "$rpath"; then |
---|
3218 | if test "$build_libtool_libs" = yes; then |
---|
3219 | # Building a libtool convenience library. |
---|
3220 | # Some compilers have problems with a `.al' extension so |
---|
3221 | # convenience libraries should have the same extension an |
---|
3222 | # archive normally would. |
---|
3223 | oldlibs="$output_objdir/$libname.$libext $oldlibs" |
---|
3224 | build_libtool_libs=convenience |
---|
3225 | build_old_libs=yes |
---|
3226 | fi |
---|
3227 | |
---|
3228 | if test -n "$vinfo"; then |
---|
3229 | $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 |
---|
3230 | fi |
---|
3231 | |
---|
3232 | if test -n "$release"; then |
---|
3233 | $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 |
---|
3234 | fi |
---|
3235 | else |
---|
3236 | |
---|
3237 | # Parse the version information argument. |
---|
3238 | save_ifs="$IFS"; IFS=':' |
---|
3239 | set dummy $vinfo 0 0 0 |
---|
3240 | IFS="$save_ifs" |
---|
3241 | |
---|
3242 | if test -n "$8"; then |
---|
3243 | $echo "$modename: too many parameters to \`-version-info'" 1>&2 |
---|
3244 | $echo "$help" 1>&2 |
---|
3245 | exit $EXIT_FAILURE |
---|
3246 | fi |
---|
3247 | |
---|
3248 | # convert absolute version numbers to libtool ages |
---|
3249 | # this retains compatibility with .la files and attempts |
---|
3250 | # to make the code below a bit more comprehensible |
---|
3251 | |
---|
3252 | case $vinfo_number in |
---|
3253 | yes) |
---|
3254 | number_major="$2" |
---|
3255 | number_minor="$3" |
---|
3256 | number_revision="$4" |
---|
3257 | # |
---|
3258 | # There are really only two kinds -- those that |
---|
3259 | # use the current revision as the major version |
---|
3260 | # and those that subtract age and use age as |
---|
3261 | # a minor version. But, then there is irix |
---|
3262 | # which has an extra 1 added just for fun |
---|
3263 | # |
---|
3264 | case $version_type in |
---|
3265 | darwin|linux|osf|windows) |
---|
3266 | current=`expr $number_major + $number_minor` |
---|
3267 | age="$number_minor" |
---|
3268 | revision="$number_revision" |
---|
3269 | ;; |
---|
3270 | freebsd-aout|freebsd-elf|sunos) |
---|
3271 | current="$number_major" |
---|
3272 | revision="$number_minor" |
---|
3273 | age="0" |
---|
3274 | ;; |
---|
3275 | irix|nonstopux) |
---|
3276 | current=`expr $number_major + $number_minor - 1` |
---|
3277 | age="$number_minor" |
---|
3278 | revision="$number_minor" |
---|
3279 | ;; |
---|
3280 | esac |
---|
3281 | ;; |
---|
3282 | no) |
---|
3283 | current="$2" |
---|
3284 | revision="$3" |
---|
3285 | age="$4" |
---|
3286 | ;; |
---|
3287 | esac |
---|
3288 | |
---|
3289 | # Check that each of the things are valid numbers. |
---|
3290 | case $current in |
---|
3291 | [0-9]*) ;; |
---|
3292 | *) |
---|
3293 | $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 |
---|
3294 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
---|
3295 | exit $EXIT_FAILURE |
---|
3296 | ;; |
---|
3297 | esac |
---|
3298 | |
---|
3299 | case $revision in |
---|
3300 | [0-9]*) ;; |
---|
3301 | *) |
---|
3302 | $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 |
---|
3303 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
---|
3304 | exit $EXIT_FAILURE |
---|
3305 | ;; |
---|
3306 | esac |
---|
3307 | |
---|
3308 | case $age in |
---|
3309 | [0-9]*) ;; |
---|
3310 | *) |
---|
3311 | $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 |
---|
3312 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
---|
3313 | exit $EXIT_FAILURE |
---|
3314 | ;; |
---|
3315 | esac |
---|
3316 | |
---|
3317 | if test "$age" -gt "$current"; then |
---|
3318 | $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 |
---|
3319 | $echo "$modename: \`$vinfo' is not valid version information" 1>&2 |
---|
3320 | exit $EXIT_FAILURE |
---|
3321 | fi |
---|
3322 | |
---|
3323 | # Calculate the version variables. |
---|
3324 | major= |
---|
3325 | versuffix= |
---|
3326 | verstring= |
---|
3327 | case $version_type in |
---|
3328 | none) ;; |
---|
3329 | |
---|
3330 | darwin) |
---|
3331 | # Like Linux, but with the current version available in |
---|
3332 | # verstring for coding it into the library header |
---|
3333 | major=.`expr $current - $age` |
---|
3334 | versuffix="$major.$age.$revision" |
---|
3335 | # Darwin ld doesn't like 0 for these options... |
---|
3336 | minor_current=`expr $current + 1` |
---|
3337 | verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" |
---|
3338 | ;; |
---|
3339 | |
---|
3340 | freebsd-aout) |
---|
3341 | major=".$current" |
---|
3342 | versuffix=".$current.$revision"; |
---|
3343 | ;; |
---|
3344 | |
---|
3345 | freebsd-elf) |
---|
3346 | major=".$current" |
---|
3347 | versuffix=".$current"; |
---|
3348 | ;; |
---|
3349 | |
---|
3350 | irix | nonstopux) |
---|
3351 | major=`expr $current - $age + 1` |
---|
3352 | |
---|
3353 | case $version_type in |
---|
3354 | nonstopux) verstring_prefix=nonstopux ;; |
---|
3355 | *) verstring_prefix=sgi ;; |
---|
3356 | esac |
---|
3357 | verstring="$verstring_prefix$major.$revision" |
---|
3358 | |
---|
3359 | # Add in all the interfaces that we are compatible with. |
---|
3360 | loop=$revision |
---|
3361 | while test "$loop" -ne 0; do |
---|
3362 | iface=`expr $revision - $loop` |
---|
3363 | loop=`expr $loop - 1` |
---|
3364 | verstring="$verstring_prefix$major.$iface:$verstring" |
---|
3365 | done |
---|
3366 | |
---|
3367 | # Before this point, $major must not contain `.'. |
---|
3368 | major=.$major |
---|
3369 | versuffix="$major.$revision" |
---|
3370 | ;; |
---|
3371 | |
---|
3372 | linux) |
---|
3373 | major=.`expr $current - $age` |
---|
3374 | versuffix="$major.$age.$revision" |
---|
3375 | ;; |
---|
3376 | |
---|
3377 | osf) |
---|
3378 | major=.`expr $current - $age` |
---|
3379 | versuffix=".$current.$age.$revision" |
---|
3380 | verstring="$current.$age.$revision" |
---|
3381 | |
---|
3382 | # Add in all the interfaces that we are compatible with. |
---|
3383 | loop=$age |
---|
3384 | while test "$loop" -ne 0; do |
---|
3385 | iface=`expr $current - $loop` |
---|
3386 | loop=`expr $loop - 1` |
---|
3387 | verstring="$verstring:${iface}.0" |
---|
3388 | done |
---|
3389 | |
---|
3390 | # Make executables depend on our current version. |
---|
3391 | verstring="$verstring:${current}.0" |
---|
3392 | ;; |
---|
3393 | |
---|
3394 | sunos) |
---|
3395 | major=".$current" |
---|
3396 | versuffix=".$current.$revision" |
---|
3397 | ;; |
---|
3398 | |
---|
3399 | windows) |
---|
3400 | # Use '-' rather than '.', since we only want one |
---|
3401 | # extension on DOS 8.3 filesystems. |
---|
3402 | major=`expr $current - $age` |
---|
3403 | versuffix="-$major" |
---|
3404 | ;; |
---|
3405 | |
---|
3406 | *) |
---|
3407 | $echo "$modename: unknown library version type \`$version_type'" 1>&2 |
---|
3408 | $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
---|
3409 | exit $EXIT_FAILURE |
---|
3410 | ;; |
---|
3411 | esac |
---|
3412 | |
---|
3413 | # Clear the version info if we defaulted, and they specified a release. |
---|
3414 | if test -z "$vinfo" && test -n "$release"; then |
---|
3415 | major= |
---|
3416 | case $version_type in |
---|
3417 | darwin) |
---|
3418 | # we can't check for "0.0" in archive_cmds due to quoting |
---|
3419 | # problems, so we reset it completely |
---|
3420 | verstring= |
---|
3421 | ;; |
---|
3422 | *) |
---|
3423 | verstring="0.0" |
---|
3424 | ;; |
---|
3425 | esac |
---|
3426 | if test "$need_version" = no; then |
---|
3427 | versuffix= |
---|
3428 | else |
---|
3429 | versuffix=".0.0" |
---|
3430 | fi |
---|
3431 | fi |
---|
3432 | |
---|
3433 | # Remove version info from name if versioning should be avoided |
---|
3434 | if test "$avoid_version" = yes && test "$need_version" = no; then |
---|
3435 | major= |
---|
3436 | versuffix= |
---|
3437 | verstring="" |
---|
3438 | fi |
---|
3439 | |
---|
3440 | # Check to see if the archive will have undefined symbols. |
---|
3441 | if test "$allow_undefined" = yes; then |
---|
3442 | if test "$allow_undefined_flag" = unsupported; then |
---|
3443 | $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 |
---|
3444 | build_libtool_libs=no |
---|
3445 | build_old_libs=yes |
---|
3446 | fi |
---|
3447 | else |
---|
3448 | # Don't allow undefined symbols. |
---|
3449 | allow_undefined_flag="$no_undefined_flag" |
---|
3450 | fi |
---|
3451 | fi |
---|
3452 | |
---|
3453 | if test "$mode" != relink; then |
---|
3454 | # Remove our outputs, but don't remove object files since they |
---|
3455 | # may have been created when compiling PIC objects. |
---|
3456 | removelist= |
---|
3457 | tempremovelist=`$echo "$output_objdir/*"` |
---|
3458 | for p in $tempremovelist; do |
---|
3459 | case $p in |
---|
3460 | *.$objext) |
---|
3461 | ;; |
---|
3462 | $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) |
---|
3463 | if test "X$precious_files_regex" != "X"; then |
---|
3464 | if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 |
---|
3465 | then |
---|
3466 | continue |
---|
3467 | fi |
---|
3468 | fi |
---|
3469 | removelist="$removelist $p" |
---|
3470 | ;; |
---|
3471 | *) ;; |
---|
3472 | esac |
---|
3473 | done |
---|
3474 | if test -n "$removelist"; then |
---|
3475 | $show "${rm}r $removelist" |
---|
3476 | $run ${rm}r $removelist |
---|
3477 | fi |
---|
3478 | fi |
---|
3479 | |
---|
3480 | # Now set the variables for building old libraries. |
---|
3481 | if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then |
---|
3482 | oldlibs="$oldlibs $output_objdir/$libname.$libext" |
---|
3483 | |
---|
3484 | # Transform .lo files to .o files. |
---|
3485 | oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` |
---|
3486 | fi |
---|
3487 | |
---|
3488 | # Eliminate all temporary directories. |
---|
3489 | for path in $notinst_path; do |
---|
3490 | lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` |
---|
3491 | deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` |
---|
3492 | dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` |
---|
3493 | done |
---|
3494 | |
---|
3495 | if test -n "$xrpath"; then |
---|
3496 | # If the user specified any rpath flags, then add them. |
---|
3497 | temp_xrpath= |
---|
3498 | for libdir in $xrpath; do |
---|
3499 | temp_xrpath="$temp_xrpath -R$libdir" |
---|
3500 | case "$finalize_rpath " in |
---|
3501 | *" $libdir "*) ;; |
---|
3502 | *) finalize_rpath="$finalize_rpath $libdir" ;; |
---|
3503 | esac |
---|
3504 | done |
---|
3505 | if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then |
---|
3506 | dependency_libs="$temp_xrpath $dependency_libs" |
---|
3507 | fi |
---|
3508 | fi |
---|
3509 | |
---|
3510 | # Make sure dlfiles contains only unique files that won't be dlpreopened |
---|
3511 | old_dlfiles="$dlfiles" |
---|
3512 | dlfiles= |
---|
3513 | for lib in $old_dlfiles; do |
---|
3514 | case " $dlprefiles $dlfiles " in |
---|
3515 | *" $lib "*) ;; |
---|
3516 | *) dlfiles="$dlfiles $lib" ;; |
---|
3517 | esac |
---|
3518 | done |
---|
3519 | |
---|
3520 | # Make sure dlprefiles contains only unique files |
---|
3521 | old_dlprefiles="$dlprefiles" |
---|
3522 | dlprefiles= |
---|
3523 | for lib in $old_dlprefiles; do |
---|
3524 | case "$dlprefiles " in |
---|
3525 | *" $lib "*) ;; |
---|
3526 | *) dlprefiles="$dlprefiles $lib" ;; |
---|
3527 | esac |
---|
3528 | done |
---|
3529 | |
---|
3530 | if test "$build_libtool_libs" = yes; then |
---|
3531 | if test -n "$rpath"; then |
---|
3532 | case $host in |
---|
3533 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) |
---|
3534 | # these systems don't actually have a c library (as such)! |
---|
3535 | ;; |
---|
3536 | *-*-rhapsody* | *-*-darwin1.[012]) |
---|
3537 | # Rhapsody C library is in the System framework |
---|
3538 | deplibs="$deplibs -framework System" |
---|
3539 | ;; |
---|
3540 | *-*-netbsd*) |
---|
3541 | # Don't link with libc until the a.out ld.so is fixed. |
---|
3542 | ;; |
---|
3543 | *-*-openbsd* | *-*-freebsd*) |
---|
3544 | # Do not include libc due to us having libc/libc_r. |
---|
3545 | test "X$arg" = "X-lc" && continue |
---|
3546 | ;; |
---|
3547 | *) |
---|
3548 | # Add libc to deplibs on all other systems if necessary. |
---|
3549 | if test "$build_libtool_need_lc" = "yes"; then |
---|
3550 | deplibs="$deplibs -lc" |
---|
3551 | fi |
---|
3552 | ;; |
---|
3553 | esac |
---|
3554 | fi |
---|
3555 | |
---|
3556 | # Transform deplibs into only deplibs that can be linked in shared. |
---|
3557 | name_save=$name |
---|
3558 | libname_save=$libname |
---|
3559 | release_save=$release |
---|
3560 | versuffix_save=$versuffix |
---|
3561 | major_save=$major |
---|
3562 | # I'm not sure if I'm treating the release correctly. I think |
---|
3563 | # release should show up in the -l (ie -lgmp5) so we don't want to |
---|
3564 | # add it in twice. Is that correct? |
---|
3565 | release="" |
---|
3566 | versuffix="" |
---|
3567 | major="" |
---|
3568 | newdeplibs= |
---|
3569 | droppeddeps=no |
---|
3570 | case $deplibs_check_method in |
---|
3571 | pass_all) |
---|
3572 | # Don't check for shared/static. Everything works. |
---|
3573 | # This might be a little naive. We might want to check |
---|
3574 | # whether the library exists or not. But this is on |
---|
3575 | # osf3 & osf4 and I'm not really sure... Just |
---|
3576 | # implementing what was already the behavior. |
---|
3577 | newdeplibs=$deplibs |
---|
3578 | ;; |
---|
3579 | test_compile) |
---|
3580 | # This code stresses the "libraries are programs" paradigm to its |
---|
3581 | # limits. Maybe even breaks it. We compile a program, linking it |
---|
3582 | # against the deplibs as a proxy for the library. Then we can check |
---|
3583 | # whether they linked in statically or dynamically with ldd. |
---|
3584 | $rm conftest.c |
---|
3585 | cat > conftest.c <<EOF |
---|
3586 | int main() { return 0; } |
---|
3587 | EOF |
---|
3588 | $rm conftest |
---|
3589 | $LTCC -o conftest conftest.c $deplibs |
---|
3590 | if test "$?" -eq 0 ; then |
---|
3591 | ldd_output=`ldd conftest` |
---|
3592 | for i in $deplibs; do |
---|
3593 | name="`expr $i : '-l\(.*\)'`" |
---|
3594 | # If $name is empty we are operating on a -L argument. |
---|
3595 | if test "$name" != "" && test "$name" -ne "0"; then |
---|
3596 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
---|
3597 | case " $predeps $postdeps " in |
---|
3598 | *" $i "*) |
---|
3599 | newdeplibs="$newdeplibs $i" |
---|
3600 | i="" |
---|
3601 | ;; |
---|
3602 | esac |
---|
3603 | fi |
---|
3604 | if test -n "$i" ; then |
---|
3605 | libname=`eval \\$echo \"$libname_spec\"` |
---|
3606 | deplib_matches=`eval \\$echo \"$library_names_spec\"` |
---|
3607 | set dummy $deplib_matches |
---|
3608 | deplib_match=$2 |
---|
3609 | if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then |
---|
3610 | newdeplibs="$newdeplibs $i" |
---|
3611 | else |
---|
3612 | droppeddeps=yes |
---|
3613 | $echo |
---|
3614 | $echo "*** Warning: dynamic linker does not accept needed library $i." |
---|
3615 | $echo "*** I have the capability to make that library automatically link in when" |
---|
3616 | $echo "*** you link to this library. But I can only do this if you have a" |
---|
3617 | $echo "*** shared version of the library, which I believe you do not have" |
---|
3618 | $echo "*** because a test_compile did reveal that the linker did not use it for" |
---|
3619 | $echo "*** its dynamic dependency list that programs get resolved with at runtime." |
---|
3620 | fi |
---|
3621 | fi |
---|
3622 | else |
---|
3623 | newdeplibs="$newdeplibs $i" |
---|
3624 | fi |
---|
3625 | done |
---|
3626 | else |
---|
3627 | # Error occurred in the first compile. Let's try to salvage |
---|
3628 | # the situation: Compile a separate program for each library. |
---|
3629 | for i in $deplibs; do |
---|
3630 | name="`expr $i : '-l\(.*\)'`" |
---|
3631 | # If $name is empty we are operating on a -L argument. |
---|
3632 | if test "$name" != "" && test "$name" != "0"; then |
---|
3633 | $rm conftest |
---|
3634 | $LTCC -o conftest conftest.c $i |
---|
3635 | # Did it work? |
---|
3636 | if test "$?" -eq 0 ; then |
---|
3637 | ldd_output=`ldd conftest` |
---|
3638 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
---|
3639 | case " $predeps $postdeps " in |
---|
3640 | *" $i "*) |
---|
3641 | newdeplibs="$newdeplibs $i" |
---|
3642 | i="" |
---|
3643 | ;; |
---|
3644 | esac |
---|
3645 | fi |
---|
3646 | if test -n "$i" ; then |
---|
3647 | libname=`eval \\$echo \"$libname_spec\"` |
---|
3648 | deplib_matches=`eval \\$echo \"$library_names_spec\"` |
---|
3649 | set dummy $deplib_matches |
---|
3650 | deplib_match=$2 |
---|
3651 | if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then |
---|
3652 | newdeplibs="$newdeplibs $i" |
---|
3653 | else |
---|
3654 | droppeddeps=yes |
---|
3655 | $echo |
---|
3656 | $echo "*** Warning: dynamic linker does not accept needed library $i." |
---|
3657 | $echo "*** I have the capability to make that library automatically link in when" |
---|
3658 | $echo "*** you link to this library. But I can only do this if you have a" |
---|
3659 | $echo "*** shared version of the library, which you do not appear to have" |
---|
3660 | $echo "*** because a test_compile did reveal that the linker did not use this one" |
---|
3661 | $echo "*** as a dynamic dependency that programs can get resolved with at runtime." |
---|
3662 | fi |
---|
3663 | fi |
---|
3664 | else |
---|
3665 | droppeddeps=yes |
---|
3666 | $echo |
---|
3667 | $echo "*** Warning! Library $i is needed by this library but I was not able to" |
---|
3668 | $echo "*** make it link in! You will probably need to install it or some" |
---|
3669 | $echo "*** library that it depends on before this library will be fully" |
---|
3670 | $echo "*** functional. Installing it before continuing would be even better." |
---|
3671 | fi |
---|
3672 | else |
---|
3673 | newdeplibs="$newdeplibs $i" |
---|
3674 | fi |
---|
3675 | done |
---|
3676 | fi |
---|
3677 | ;; |
---|
3678 | file_magic*) |
---|
3679 | set dummy $deplibs_check_method |
---|
3680 | file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
---|
3681 | for a_deplib in $deplibs; do |
---|
3682 | name="`expr $a_deplib : '-l\(.*\)'`" |
---|
3683 | # If $name is empty we are operating on a -L argument. |
---|
3684 | if test "$name" != "" && test "$name" != "0"; then |
---|
3685 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
---|
3686 | case " $predeps $postdeps " in |
---|
3687 | *" $a_deplib "*) |
---|
3688 | newdeplibs="$newdeplibs $a_deplib" |
---|
3689 | a_deplib="" |
---|
3690 | ;; |
---|
3691 | esac |
---|
3692 | fi |
---|
3693 | if test -n "$a_deplib" ; then |
---|
3694 | libname=`eval \\$echo \"$libname_spec\"` |
---|
3695 | for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do |
---|
3696 | potential_libs=`ls $i/$libname[.-]* 2>/dev/null` |
---|
3697 | for potent_lib in $potential_libs; do |
---|
3698 | # Follow soft links. |
---|
3699 | if ls -lLd "$potent_lib" 2>/dev/null \ |
---|
3700 | | grep " -> " >/dev/null; then |
---|
3701 | continue |
---|
3702 | fi |
---|
3703 | # The statement above tries to avoid entering an |
---|
3704 | # endless loop below, in case of cyclic links. |
---|
3705 | # We might still enter an endless loop, since a link |
---|
3706 | # loop can be closed while we follow links, |
---|
3707 | # but so what? |
---|
3708 | potlib="$potent_lib" |
---|
3709 | while test -h "$potlib" 2>/dev/null; do |
---|
3710 | potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` |
---|
3711 | case $potliblink in |
---|
3712 | [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; |
---|
3713 | *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; |
---|
3714 | esac |
---|
3715 | done |
---|
3716 | if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ |
---|
3717 | | ${SED} 10q \ |
---|
3718 | | $EGREP "$file_magic_regex" > /dev/null; then |
---|
3719 | newdeplibs="$newdeplibs $a_deplib" |
---|
3720 | a_deplib="" |
---|
3721 | break 2 |
---|
3722 | fi |
---|
3723 | done |
---|
3724 | done |
---|
3725 | fi |
---|
3726 | if test -n "$a_deplib" ; then |
---|
3727 | droppeddeps=yes |
---|
3728 | $echo |
---|
3729 | $echo "*** Warning: linker path does not have real file for library $a_deplib." |
---|
3730 | $echo "*** I have the capability to make that library automatically link in when" |
---|
3731 | $echo "*** you link to this library. But I can only do this if you have a" |
---|
3732 | $echo "*** shared version of the library, which you do not appear to have" |
---|
3733 | $echo "*** because I did check the linker path looking for a file starting" |
---|
3734 | if test -z "$potlib" ; then |
---|
3735 | $echo "*** with $libname but no candidates were found. (...for file magic test)" |
---|
3736 | else |
---|
3737 | $echo "*** with $libname and none of the candidates passed a file format test" |
---|
3738 | $echo "*** using a file magic. Last file checked: $potlib" |
---|
3739 | fi |
---|
3740 | fi |
---|
3741 | else |
---|
3742 | # Add a -L argument. |
---|
3743 | newdeplibs="$newdeplibs $a_deplib" |
---|
3744 | fi |
---|
3745 | done # Gone through all deplibs. |
---|
3746 | ;; |
---|
3747 | match_pattern*) |
---|
3748 | set dummy $deplibs_check_method |
---|
3749 | match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
---|
3750 | for a_deplib in $deplibs; do |
---|
3751 | name="`expr $a_deplib : '-l\(.*\)'`" |
---|
3752 | # If $name is empty we are operating on a -L argument. |
---|
3753 | if test -n "$name" && test "$name" != "0"; then |
---|
3754 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
---|
3755 | case " $predeps $postdeps " in |
---|
3756 | *" $a_deplib "*) |
---|
3757 | newdeplibs="$newdeplibs $a_deplib" |
---|
3758 | a_deplib="" |
---|
3759 | ;; |
---|
3760 | esac |
---|
3761 | fi |
---|
3762 | if test -n "$a_deplib" ; then |
---|
3763 | libname=`eval \\$echo \"$libname_spec\"` |
---|
3764 | for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do |
---|
3765 | potential_libs=`ls $i/$libname[.-]* 2>/dev/null` |
---|
3766 | for potent_lib in $potential_libs; do |
---|
3767 | potlib="$potent_lib" # see symlink-check above in file_magic test |
---|
3768 | if eval $echo \"$potent_lib\" 2>/dev/null \ |
---|
3769 | | ${SED} 10q \ |
---|
3770 | | $EGREP "$match_pattern_regex" > /dev/null; then |
---|
3771 | newdeplibs="$newdeplibs $a_deplib" |
---|
3772 | a_deplib="" |
---|
3773 | break 2 |
---|
3774 | fi |
---|
3775 | done |
---|
3776 | done |
---|
3777 | fi |
---|
3778 | if test -n "$a_deplib" ; then |
---|
3779 | droppeddeps=yes |
---|
3780 | $echo |
---|
3781 | $echo "*** Warning: linker path does not have real file for library $a_deplib." |
---|
3782 | $echo "*** I have the capability to make that library automatically link in when" |
---|
3783 | $echo "*** you link to this library. But I can only do this if you have a" |
---|
3784 | $echo "*** shared version of the library, which you do not appear to have" |
---|
3785 | $echo "*** because I did check the linker path looking for a file starting" |
---|
3786 | if test -z "$potlib" ; then |
---|
3787 | $echo "*** with $libname but no candidates were found. (...for regex pattern test)" |
---|
3788 | else |
---|
3789 | $echo "*** with $libname and none of the candidates passed a file format test" |
---|
3790 | $echo "*** using a regex pattern. Last file checked: $potlib" |
---|
3791 | fi |
---|
3792 | fi |
---|
3793 | else |
---|
3794 | # Add a -L argument. |
---|
3795 | newdeplibs="$newdeplibs $a_deplib" |
---|
3796 | fi |
---|
3797 | done # Gone through all deplibs. |
---|
3798 | ;; |
---|
3799 | none | unknown | *) |
---|
3800 | newdeplibs="" |
---|
3801 | tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ |
---|
3802 | -e 's/ -[LR][^ ]*//g'` |
---|
3803 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
---|
3804 | for i in $predeps $postdeps ; do |
---|
3805 | # can't use Xsed below, because $i might contain '/' |
---|
3806 | tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` |
---|
3807 | done |
---|
3808 | fi |
---|
3809 | if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ |
---|
3810 | | grep . >/dev/null; then |
---|
3811 | $echo |
---|
3812 | if test "X$deplibs_check_method" = "Xnone"; then |
---|
3813 | $echo "*** Warning: inter-library dependencies are not supported in this platform." |
---|
3814 | else |
---|
3815 | $echo "*** Warning: inter-library dependencies are not known to be supported." |
---|
3816 | fi |
---|
3817 | $echo "*** All declared inter-library dependencies are being dropped." |
---|
3818 | droppeddeps=yes |
---|
3819 | fi |
---|
3820 | ;; |
---|
3821 | esac |
---|
3822 | versuffix=$versuffix_save |
---|
3823 | major=$major_save |
---|
3824 | release=$release_save |
---|
3825 | libname=$libname_save |
---|
3826 | name=$name_save |
---|
3827 | |
---|
3828 | case $host in |
---|
3829 | *-*-rhapsody* | *-*-darwin1.[012]) |
---|
3830 | # On Rhapsody replace the C library is the System framework |
---|
3831 | newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` |
---|
3832 | ;; |
---|
3833 | esac |
---|
3834 | |
---|
3835 | if test "$droppeddeps" = yes; then |
---|
3836 | if test "$module" = yes; then |
---|
3837 | $echo |
---|
3838 | $echo "*** Warning: libtool could not satisfy all declared inter-library" |
---|
3839 | $echo "*** dependencies of module $libname. Therefore, libtool will create" |
---|
3840 | $echo "*** a static module, that should work as long as the dlopening" |
---|
3841 | $echo "*** application is linked with the -dlopen flag." |
---|
3842 | if test -z "$global_symbol_pipe"; then |
---|
3843 | $echo |
---|
3844 | $echo "*** However, this would only work if libtool was able to extract symbol" |
---|
3845 | $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" |
---|
3846 | $echo "*** not find such a program. So, this module is probably useless." |
---|
3847 | $echo "*** \`nm' from GNU binutils and a full rebuild may help." |
---|
3848 | fi |
---|
3849 | if test "$build_old_libs" = no; then |
---|
3850 | oldlibs="$output_objdir/$libname.$libext" |
---|
3851 | build_libtool_libs=module |
---|
3852 | build_old_libs=yes |
---|
3853 | else |
---|
3854 | build_libtool_libs=no |
---|
3855 | fi |
---|
3856 | else |
---|
3857 | $echo "*** The inter-library dependencies that have been dropped here will be" |
---|
3858 | $echo "*** automatically added whenever a program is linked with this library" |
---|
3859 | $echo "*** or is declared to -dlopen it." |
---|
3860 | |
---|
3861 | if test "$allow_undefined" = no; then |
---|
3862 | $echo |
---|
3863 | $echo "*** Since this library must not contain undefined symbols," |
---|
3864 | $echo "*** because either the platform does not support them or" |
---|
3865 | $echo "*** it was explicitly requested with -no-undefined," |
---|
3866 | $echo "*** libtool will only create a static version of it." |
---|
3867 | if test "$build_old_libs" = no; then |
---|
3868 | oldlibs="$output_objdir/$libname.$libext" |
---|
3869 | build_libtool_libs=module |
---|
3870 | build_old_libs=yes |
---|
3871 | else |
---|
3872 | build_libtool_libs=no |
---|
3873 | fi |
---|
3874 | fi |
---|
3875 | fi |
---|
3876 | fi |
---|
3877 | # Done checking deplibs! |
---|
3878 | deplibs=$newdeplibs |
---|
3879 | fi |
---|
3880 | |
---|
3881 | # All the library-specific variables (install_libdir is set above). |
---|
3882 | library_names= |
---|
3883 | old_library= |
---|
3884 | dlname= |
---|
3885 | |
---|
3886 | # Test again, we may have decided not to build it any more |
---|
3887 | if test "$build_libtool_libs" = yes; then |
---|
3888 | if test "$hardcode_into_libs" = yes; then |
---|
3889 | # Hardcode the library paths |
---|
3890 | hardcode_libdirs= |
---|
3891 | dep_rpath= |
---|
3892 | rpath="$finalize_rpath" |
---|
3893 | test "$mode" != relink && rpath="$compile_rpath$rpath" |
---|
3894 | for libdir in $rpath; do |
---|
3895 | if test -n "$hardcode_libdir_flag_spec"; then |
---|
3896 | if test -n "$hardcode_libdir_separator"; then |
---|
3897 | if test -z "$hardcode_libdirs"; then |
---|
3898 | hardcode_libdirs="$libdir" |
---|
3899 | else |
---|
3900 | # Just accumulate the unique libdirs. |
---|
3901 | case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
---|
3902 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
---|
3903 | ;; |
---|
3904 | *) |
---|
3905 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" |
---|
3906 | ;; |
---|
3907 | esac |
---|
3908 | fi |
---|
3909 | else |
---|
3910 | eval flag=\"$hardcode_libdir_flag_spec\" |
---|
3911 | dep_rpath="$dep_rpath $flag" |
---|
3912 | fi |
---|
3913 | elif test -n "$runpath_var"; then |
---|
3914 | case "$perm_rpath " in |
---|
3915 | *" $libdir "*) ;; |
---|
3916 | *) perm_rpath="$perm_rpath $libdir" ;; |
---|
3917 | esac |
---|
3918 | fi |
---|
3919 | done |
---|
3920 | # Substitute the hardcoded libdirs into the rpath. |
---|
3921 | if test -n "$hardcode_libdir_separator" && |
---|
3922 | test -n "$hardcode_libdirs"; then |
---|
3923 | libdir="$hardcode_libdirs" |
---|
3924 | if test -n "$hardcode_libdir_flag_spec_ld"; then |
---|
3925 | eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" |
---|
3926 | else |
---|
3927 | eval dep_rpath=\"$hardcode_libdir_flag_spec\" |
---|
3928 | fi |
---|
3929 | fi |
---|
3930 | if test -n "$runpath_var" && test -n "$perm_rpath"; then |
---|
3931 | # We should set the runpath_var. |
---|
3932 | rpath= |
---|
3933 | for dir in $perm_rpath; do |
---|
3934 | rpath="$rpath$dir:" |
---|
3935 | done |
---|
3936 | eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" |
---|
3937 | fi |
---|
3938 | test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" |
---|
3939 | fi |
---|
3940 | |
---|
3941 | shlibpath="$finalize_shlibpath" |
---|
3942 | test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" |
---|
3943 | if test -n "$shlibpath"; then |
---|
3944 | eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" |
---|
3945 | fi |
---|
3946 | |
---|
3947 | # Get the real and link names of the library. |
---|
3948 | eval shared_ext=\"$shrext_cmds\" |
---|
3949 | eval library_names=\"$library_names_spec\" |
---|
3950 | set dummy $library_names |
---|
3951 | realname="$2" |
---|
3952 | shift; shift |
---|
3953 | |
---|
3954 | if test -n "$soname_spec"; then |
---|
3955 | eval soname=\"$soname_spec\" |
---|
3956 | else |
---|
3957 | soname="$realname" |
---|
3958 | fi |
---|
3959 | if test -z "$dlname"; then |
---|
3960 | dlname=$soname |
---|
3961 | fi |
---|
3962 | |
---|
3963 | lib="$output_objdir/$realname" |
---|
3964 | for link |
---|
3965 | do |
---|
3966 | linknames="$linknames $link" |
---|
3967 | done |
---|
3968 | |
---|
3969 | # Use standard objects if they are pic |
---|
3970 | test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
---|
3971 | |
---|
3972 | # Prepare the list of exported symbols |
---|
3973 | if test -z "$export_symbols"; then |
---|
3974 | if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then |
---|
3975 | $show "generating symbol list for \`$libname.la'" |
---|
3976 | export_symbols="$output_objdir/$libname.exp" |
---|
3977 | $run $rm $export_symbols |
---|
3978 | cmds=$export_symbols_cmds |
---|
3979 | save_ifs="$IFS"; IFS='~' |
---|
3980 | for cmd in $cmds; do |
---|
3981 | IFS="$save_ifs" |
---|
3982 | eval cmd=\"$cmd\" |
---|
3983 | if len=`expr "X$cmd" : ".*"` && |
---|
3984 | test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
---|
3985 | $show "$cmd" |
---|
3986 | $run eval "$cmd" || exit $? |
---|
3987 | skipped_export=false |
---|
3988 | else |
---|
3989 | # The command line is too long to execute in one step. |
---|
3990 | $show "using reloadable object file for export list..." |
---|
3991 | skipped_export=: |
---|
3992 | fi |
---|
3993 | done |
---|
3994 | IFS="$save_ifs" |
---|
3995 | if test -n "$export_symbols_regex"; then |
---|
3996 | $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" |
---|
3997 | $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' |
---|
3998 | $show "$mv \"${export_symbols}T\" \"$export_symbols\"" |
---|
3999 | $run eval '$mv "${export_symbols}T" "$export_symbols"' |
---|
4000 | fi |
---|
4001 | fi |
---|
4002 | fi |
---|
4003 | |
---|
4004 | if test -n "$export_symbols" && test -n "$include_expsyms"; then |
---|
4005 | $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' |
---|
4006 | fi |
---|
4007 | |
---|
4008 | tmp_deplibs= |
---|
4009 | for test_deplib in $deplibs; do |
---|
4010 | case " $convenience " in |
---|
4011 | *" $test_deplib "*) ;; |
---|
4012 | *) |
---|
4013 | tmp_deplibs="$tmp_deplibs $test_deplib" |
---|
4014 | ;; |
---|
4015 | esac |
---|
4016 | done |
---|
4017 | deplibs="$tmp_deplibs" |
---|
4018 | |
---|
4019 | if test -n "$convenience"; then |
---|
4020 | if test -n "$whole_archive_flag_spec"; then |
---|
4021 | save_libobjs=$libobjs |
---|
4022 | eval libobjs=\"\$libobjs $whole_archive_flag_spec\" |
---|
4023 | else |
---|
4024 | gentop="$output_objdir/${outputname}x" |
---|
4025 | $show "${rm}r $gentop" |
---|
4026 | $run ${rm}r "$gentop" |
---|
4027 | $show "$mkdir $gentop" |
---|
4028 | $run $mkdir "$gentop" |
---|
4029 | status=$? |
---|
4030 | if test "$status" -ne 0 && test ! -d "$gentop"; then |
---|
4031 | exit $status |
---|
4032 | fi |
---|
4033 | generated="$generated $gentop" |
---|
4034 | |
---|
4035 | for xlib in $convenience; do |
---|
4036 | # Extract the objects. |
---|
4037 | case $xlib in |
---|
4038 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
---|
4039 | *) xabs=`pwd`"/$xlib" ;; |
---|
4040 | esac |
---|
4041 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` |
---|
4042 | xdir="$gentop/$xlib" |
---|
4043 | |
---|
4044 | $show "${rm}r $xdir" |
---|
4045 | $run ${rm}r "$xdir" |
---|
4046 | $show "$mkdir $xdir" |
---|
4047 | $run $mkdir "$xdir" |
---|
4048 | status=$? |
---|
4049 | if test "$status" -ne 0 && test ! -d "$xdir"; then |
---|
4050 | exit $status |
---|
4051 | fi |
---|
4052 | # We will extract separately just the conflicting names and we will no |
---|
4053 | # longer touch any unique names. It is faster to leave these extract |
---|
4054 | # automatically by $AR in one run. |
---|
4055 | $show "(cd $xdir && $AR x $xabs)" |
---|
4056 | $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? |
---|
4057 | if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then |
---|
4058 | : |
---|
4059 | else |
---|
4060 | $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 |
---|
4061 | $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 |
---|
4062 | $AR t "$xabs" | sort | uniq -cd | while read -r count name |
---|
4063 | do |
---|
4064 | i=1 |
---|
4065 | while test "$i" -le "$count" |
---|
4066 | do |
---|
4067 | # Put our $i before any first dot (extension) |
---|
4068 | # Never overwrite any file |
---|
4069 | name_to="$name" |
---|
4070 | while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" |
---|
4071 | do |
---|
4072 | name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` |
---|
4073 | done |
---|
4074 | $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" |
---|
4075 | $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? |
---|
4076 | i=`expr $i + 1` |
---|
4077 | done |
---|
4078 | done |
---|
4079 | fi |
---|
4080 | |
---|
4081 | libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` |
---|
4082 | done |
---|
4083 | fi |
---|
4084 | fi |
---|
4085 | |
---|
4086 | if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then |
---|
4087 | eval flag=\"$thread_safe_flag_spec\" |
---|
4088 | linker_flags="$linker_flags $flag" |
---|
4089 | fi |
---|
4090 | |
---|
4091 | # Make a backup of the uninstalled library when relinking |
---|
4092 | if test "$mode" = relink; then |
---|
4093 | $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? |
---|
4094 | fi |
---|
4095 | |
---|
4096 | # Do each of the archive commands. |
---|
4097 | if test "$module" = yes && test -n "$module_cmds" ; then |
---|
4098 | if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then |
---|
4099 | eval test_cmds=\"$module_expsym_cmds\" |
---|
4100 | cmds=$module_expsym_cmds |
---|
4101 | else |
---|
4102 | eval test_cmds=\"$module_cmds\" |
---|
4103 | cmds=$module_cmds |
---|
4104 | fi |
---|
4105 | else |
---|
4106 | if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then |
---|
4107 | eval test_cmds=\"$archive_expsym_cmds\" |
---|
4108 | cmds=$archive_expsym_cmds |
---|
4109 | else |
---|
4110 | eval test_cmds=\"$archive_cmds\" |
---|
4111 | cmds=$archive_cmds |
---|
4112 | fi |
---|
4113 | fi |
---|
4114 | |
---|
4115 | if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && |
---|
4116 | test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
---|
4117 | : |
---|
4118 | else |
---|
4119 | # The command line is too long to link in one step, link piecewise. |
---|
4120 | $echo "creating reloadable object files..." |
---|
4121 | |
---|
4122 | # Save the value of $output and $libobjs because we want to |
---|
4123 | # use them later. If we have whole_archive_flag_spec, we |
---|
4124 | # want to use save_libobjs as it was before |
---|
4125 | # whole_archive_flag_spec was expanded, because we can't |
---|
4126 | # assume the linker understands whole_archive_flag_spec. |
---|
4127 | # This may have to be revisited, in case too many |
---|
4128 | # convenience libraries get linked in and end up exceeding |
---|
4129 | # the spec. |
---|
4130 | if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then |
---|
4131 | save_libobjs=$libobjs |
---|
4132 | fi |
---|
4133 | save_output=$output |
---|
4134 | |
---|
4135 | # Clear the reloadable object creation command queue and |
---|
4136 | # initialize k to one. |
---|
4137 | test_cmds= |
---|
4138 | concat_cmds= |
---|
4139 | objlist= |
---|
4140 | delfiles= |
---|
4141 | last_robj= |
---|
4142 | k=1 |
---|
4143 | output=$output_objdir/$save_output-${k}.$objext |
---|
4144 | # Loop over the list of objects to be linked. |
---|
4145 | for obj in $save_libobjs |
---|
4146 | do |
---|
4147 | eval test_cmds=\"$reload_cmds $objlist $last_robj\" |
---|
4148 | if test "X$objlist" = X || |
---|
4149 | { len=`expr "X$test_cmds" : ".*"` && |
---|
4150 | test "$len" -le "$max_cmd_len"; }; then |
---|
4151 | objlist="$objlist $obj" |
---|
4152 | else |
---|
4153 | # The command $test_cmds is almost too long, add a |
---|
4154 | # command to the queue. |
---|
4155 | if test "$k" -eq 1 ; then |
---|
4156 | # The first file doesn't have a previous command to add. |
---|
4157 | eval concat_cmds=\"$reload_cmds $objlist $last_robj\" |
---|
4158 | else |
---|
4159 | # All subsequent reloadable object files will link in |
---|
4160 | # the last one created. |
---|
4161 | eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" |
---|
4162 | fi |
---|
4163 | last_robj=$output_objdir/$save_output-${k}.$objext |
---|
4164 | k=`expr $k + 1` |
---|
4165 | output=$output_objdir/$save_output-${k}.$objext |
---|
4166 | objlist=$obj |
---|
4167 | len=1 |
---|
4168 | fi |
---|
4169 | done |
---|
4170 | # Handle the remaining objects by creating one last |
---|
4171 | # reloadable object file. All subsequent reloadable object |
---|
4172 | # files will link in the last one created. |
---|
4173 | test -z "$concat_cmds" || concat_cmds=$concat_cmds~ |
---|
4174 | eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" |
---|
4175 | |
---|
4176 | if ${skipped_export-false}; then |
---|
4177 | $show "generating symbol list for \`$libname.la'" |
---|
4178 | export_symbols="$output_objdir/$libname.exp" |
---|
4179 | $run $rm $export_symbols |
---|
4180 | libobjs=$output |
---|
4181 | # Append the command to create the export file. |
---|
4182 | eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" |
---|
4183 | fi |
---|
4184 | |
---|
4185 | # Set up a command to remove the reloadale object files |
---|
4186 | # after they are used. |
---|
4187 | i=0 |
---|
4188 | while test "$i" -lt "$k" |
---|
4189 | do |
---|
4190 | i=`expr $i + 1` |
---|
4191 | delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" |
---|
4192 | done |
---|
4193 | |
---|
4194 | $echo "creating a temporary reloadable object file: $output" |
---|
4195 | |
---|
4196 | # Loop through the commands generated above and execute them. |
---|
4197 | save_ifs="$IFS"; IFS='~' |
---|
4198 | for cmd in $concat_cmds; do |
---|
4199 | IFS="$save_ifs" |
---|
4200 | $show "$cmd" |
---|
4201 | $run eval "$cmd" || exit $? |
---|
4202 | done |
---|
4203 | IFS="$save_ifs" |
---|
4204 | |
---|
4205 | libobjs=$output |
---|
4206 | # Restore the value of output. |
---|
4207 | output=$save_output |
---|
4208 | |
---|
4209 | if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then |
---|
4210 | eval libobjs=\"\$libobjs $whole_archive_flag_spec\" |
---|
4211 | fi |
---|
4212 | # Expand the library linking commands again to reset the |
---|
4213 | # value of $libobjs for piecewise linking. |
---|
4214 | |
---|
4215 | # Do each of the archive commands. |
---|
4216 | if test "$module" = yes && test -n "$module_cmds" ; then |
---|
4217 | if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then |
---|
4218 | cmds=$module_expsym_cmds |
---|
4219 | else |
---|
4220 | cmds=$module_cmds |
---|
4221 | fi |
---|
4222 | else |
---|
4223 | if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then |
---|
4224 | cmds=$archive_expsym_cmds |
---|
4225 | else |
---|
4226 | cmds=$archive_cmds |
---|
4227 | fi |
---|
4228 | fi |
---|
4229 | |
---|
4230 | # Append the command to remove the reloadable object files |
---|
4231 | # to the just-reset $cmds. |
---|
4232 | eval cmds=\"\$cmds~\$rm $delfiles\" |
---|
4233 | fi |
---|
4234 | save_ifs="$IFS"; IFS='~' |
---|
4235 | for cmd in $cmds; do |
---|
4236 | IFS="$save_ifs" |
---|
4237 | eval cmd=\"$cmd\" |
---|
4238 | $show "$cmd" |
---|
4239 | $run eval "$cmd" || exit $? |
---|
4240 | done |
---|
4241 | IFS="$save_ifs" |
---|
4242 | |
---|
4243 | # Restore the uninstalled library and exit |
---|
4244 | if test "$mode" = relink; then |
---|
4245 | $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? |
---|
4246 | exit $EXIT_SUCCESS |
---|
4247 | fi |
---|
4248 | |
---|
4249 | # Create links to the real library. |
---|
4250 | for linkname in $linknames; do |
---|
4251 | if test "$realname" != "$linkname"; then |
---|
4252 | $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" |
---|
4253 | $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? |
---|
4254 | fi |
---|
4255 | done |
---|
4256 | |
---|
4257 | # If -module or -export-dynamic was specified, set the dlname. |
---|
4258 | if test "$module" = yes || test "$export_dynamic" = yes; then |
---|
4259 | # On all known operating systems, these are identical. |
---|
4260 | dlname="$soname" |
---|
4261 | fi |
---|
4262 | fi |
---|
4263 | ;; |
---|
4264 | |
---|
4265 | obj) |
---|
4266 | if test -n "$deplibs"; then |
---|
4267 | $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 |
---|
4268 | fi |
---|
4269 | |
---|
4270 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
---|
4271 | $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 |
---|
4272 | fi |
---|
4273 | |
---|
4274 | if test -n "$rpath"; then |
---|
4275 | $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 |
---|
4276 | fi |
---|
4277 | |
---|
4278 | if test -n "$xrpath"; then |
---|
4279 | $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 |
---|
4280 | fi |
---|
4281 | |
---|
4282 | if test -n "$vinfo"; then |
---|
4283 | $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 |
---|
4284 | fi |
---|
4285 | |
---|
4286 | if test -n "$release"; then |
---|
4287 | $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 |
---|
4288 | fi |
---|
4289 | |
---|
4290 | case $output in |
---|
4291 | *.lo) |
---|
4292 | if test -n "$objs$old_deplibs"; then |
---|
4293 | $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 |
---|
4294 | exit $EXIT_FAILURE |
---|
4295 | fi |
---|
4296 | libobj="$output" |
---|
4297 | obj=`$echo "X$output" | $Xsed -e "$lo2o"` |
---|
4298 | ;; |
---|
4299 | *) |
---|
4300 | libobj= |
---|
4301 | obj="$output" |
---|
4302 | ;; |
---|
4303 | esac |
---|
4304 | |
---|
4305 | # Delete the old objects. |
---|
4306 | $run $rm $obj $libobj |
---|
4307 | |
---|
4308 | # Objects from convenience libraries. This assumes |
---|
4309 | # single-version convenience libraries. Whenever we create |
---|
4310 | # different ones for PIC/non-PIC, this we'll have to duplicate |
---|
4311 | # the extraction. |
---|
4312 | reload_conv_objs= |
---|
4313 | gentop= |
---|
4314 | # reload_cmds runs $LD directly, so let us get rid of |
---|
4315 | # -Wl from whole_archive_flag_spec |
---|
4316 | wl= |
---|
4317 | |
---|
4318 | if test -n "$convenience"; then |
---|
4319 | if test -n "$whole_archive_flag_spec"; then |
---|
4320 | eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" |
---|
4321 | else |
---|
4322 | gentop="$output_objdir/${obj}x" |
---|
4323 | $show "${rm}r $gentop" |
---|
4324 | $run ${rm}r "$gentop" |
---|
4325 | $show "$mkdir $gentop" |
---|
4326 | $run $mkdir "$gentop" |
---|
4327 | status=$? |
---|
4328 | if test "$status" -ne 0 && test ! -d "$gentop"; then |
---|
4329 | exit $status |
---|
4330 | fi |
---|
4331 | generated="$generated $gentop" |
---|
4332 | |
---|
4333 | for xlib in $convenience; do |
---|
4334 | # Extract the objects. |
---|
4335 | case $xlib in |
---|
4336 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
---|
4337 | *) xabs=`pwd`"/$xlib" ;; |
---|
4338 | esac |
---|
4339 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` |
---|
4340 | xdir="$gentop/$xlib" |
---|
4341 | |
---|
4342 | $show "${rm}r $xdir" |
---|
4343 | $run ${rm}r "$xdir" |
---|
4344 | $show "$mkdir $xdir" |
---|
4345 | $run $mkdir "$xdir" |
---|
4346 | status=$? |
---|
4347 | if test "$status" -ne 0 && test ! -d "$xdir"; then |
---|
4348 | exit $status |
---|
4349 | fi |
---|
4350 | # We will extract separately just the conflicting names and we will no |
---|
4351 | # longer touch any unique names. It is faster to leave these extract |
---|
4352 | # automatically by $AR in one run. |
---|
4353 | $show "(cd $xdir && $AR x $xabs)" |
---|
4354 | $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? |
---|
4355 | if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then |
---|
4356 | : |
---|
4357 | else |
---|
4358 | $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 |
---|
4359 | $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 |
---|
4360 | $AR t "$xabs" | sort | uniq -cd | while read -r count name |
---|
4361 | do |
---|
4362 | i=1 |
---|
4363 | while test "$i" -le "$count" |
---|
4364 | do |
---|
4365 | # Put our $i before any first dot (extension) |
---|
4366 | # Never overwrite any file |
---|
4367 | name_to="$name" |
---|
4368 | while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" |
---|
4369 | do |
---|
4370 | name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` |
---|
4371 | done |
---|
4372 | $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" |
---|
4373 | $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? |
---|
4374 | i=`expr $i + 1` |
---|
4375 | done |
---|
4376 | done |
---|
4377 | fi |
---|
4378 | |
---|
4379 | reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` |
---|
4380 | done |
---|
4381 | fi |
---|
4382 | fi |
---|
4383 | |
---|
4384 | # Create the old-style object. |
---|
4385 | 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 |
---|
4386 | |
---|
4387 | output="$obj" |
---|
4388 | cmds=$reload_cmds |
---|
4389 | save_ifs="$IFS"; IFS='~' |
---|
4390 | for cmd in $cmds; do |
---|
4391 | IFS="$save_ifs" |
---|
4392 | eval cmd=\"$cmd\" |
---|
4393 | $show "$cmd" |
---|
4394 | $run eval "$cmd" || exit $? |
---|
4395 | done |
---|
4396 | IFS="$save_ifs" |
---|
4397 | |
---|
4398 | # Exit if we aren't doing a library object file. |
---|
4399 | if test -z "$libobj"; then |
---|
4400 | if test -n "$gentop"; then |
---|
4401 | $show "${rm}r $gentop" |
---|
4402 | $run ${rm}r $gentop |
---|
4403 | fi |
---|
4404 | |
---|
4405 | exit $EXIT_SUCCESS |
---|
4406 | fi |
---|
4407 | |
---|
4408 | if test "$build_libtool_libs" != yes; then |
---|
4409 | if test -n "$gentop"; then |
---|
4410 | $show "${rm}r $gentop" |
---|
4411 | $run ${rm}r $gentop |
---|
4412 | fi |
---|
4413 | |
---|
4414 | # Create an invalid libtool object if no PIC, so that we don't |
---|
4415 | # accidentally link it into a program. |
---|
4416 | # $show "echo timestamp > $libobj" |
---|
4417 | # $run eval "echo timestamp > $libobj" || exit $? |
---|
4418 | exit $EXIT_SUCCESS |
---|
4419 | fi |
---|
4420 | |
---|
4421 | if test -n "$pic_flag" || test "$pic_mode" != default; then |
---|
4422 | # Only do commands if we really have different PIC objects. |
---|
4423 | reload_objs="$libobjs $reload_conv_objs" |
---|
4424 | output="$libobj" |
---|
4425 | cmds=$reload_cmds |
---|
4426 | save_ifs="$IFS"; IFS='~' |
---|
4427 | for cmd in $cmds; do |
---|
4428 | IFS="$save_ifs" |
---|
4429 | eval cmd=\"$cmd\" |
---|
4430 | $show "$cmd" |
---|
4431 | $run eval "$cmd" || exit $? |
---|
4432 | done |
---|
4433 | IFS="$save_ifs" |
---|
4434 | fi |
---|
4435 | |
---|
4436 | if test -n "$gentop"; then |
---|
4437 | $show "${rm}r $gentop" |
---|
4438 | $run ${rm}r $gentop |
---|
4439 | fi |
---|
4440 | |
---|
4441 | exit $EXIT_SUCCESS |
---|
4442 | ;; |
---|
4443 | |
---|
4444 | prog) |
---|
4445 | case $host in |
---|
4446 | *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; |
---|
4447 | esac |
---|
4448 | if test -n "$vinfo"; then |
---|
4449 | $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 |
---|
4450 | fi |
---|
4451 | |
---|
4452 | if test -n "$release"; then |
---|
4453 | $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 |
---|
4454 | fi |
---|
4455 | |
---|
4456 | if test "$preload" = yes; then |
---|
4457 | if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && |
---|
4458 | test "$dlopen_self_static" = unknown; then |
---|
4459 | $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." |
---|
4460 | fi |
---|
4461 | fi |
---|
4462 | |
---|
4463 | case $host in |
---|
4464 | *-*-rhapsody* | *-*-darwin1.[012]) |
---|
4465 | # On Rhapsody replace the C library is the System framework |
---|
4466 | compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` |
---|
4467 | finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` |
---|
4468 | ;; |
---|
4469 | esac |
---|
4470 | |
---|
4471 | case $host in |
---|
4472 | *darwin*) |
---|
4473 | # Don't allow lazy linking, it breaks C++ global constructors |
---|
4474 | if test "$tagname" = CXX ; then |
---|
4475 | compile_command="$compile_command ${wl}-bind_at_load" |
---|
4476 | finalize_command="$finalize_command ${wl}-bind_at_load" |
---|
4477 | fi |
---|
4478 | ;; |
---|
4479 | esac |
---|
4480 | |
---|
4481 | compile_command="$compile_command $compile_deplibs" |
---|
4482 | finalize_command="$finalize_command $finalize_deplibs" |
---|
4483 | |
---|
4484 | if test -n "$rpath$xrpath"; then |
---|
4485 | # If the user specified any rpath flags, then add them. |
---|
4486 | for libdir in $rpath $xrpath; do |
---|
4487 | # This is the magic to use -rpath. |
---|
4488 | case "$finalize_rpath " in |
---|
4489 | *" $libdir "*) ;; |
---|
4490 | *) finalize_rpath="$finalize_rpath $libdir" ;; |
---|
4491 | esac |
---|
4492 | done |
---|
4493 | fi |
---|
4494 | |
---|
4495 | # Now hardcode the library paths |
---|
4496 | rpath= |
---|
4497 | hardcode_libdirs= |
---|
4498 | for libdir in $compile_rpath $finalize_rpath; do |
---|
4499 | if test -n "$hardcode_libdir_flag_spec"; then |
---|
4500 | if test -n "$hardcode_libdir_separator"; then |
---|
4501 | if test -z "$hardcode_libdirs"; then |
---|
4502 | hardcode_libdirs="$libdir" |
---|
4503 | else |
---|
4504 | # Just accumulate the unique libdirs. |
---|
4505 | case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
---|
4506 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
---|
4507 | ;; |
---|
4508 | *) |
---|
4509 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" |
---|
4510 | ;; |
---|
4511 | esac |
---|
4512 | fi |
---|
4513 | else |
---|
4514 | eval flag=\"$hardcode_libdir_flag_spec\" |
---|
4515 | rpath="$rpath $flag" |
---|
4516 | fi |
---|
4517 | elif test -n "$runpath_var"; then |
---|
4518 | case "$perm_rpath " in |
---|
4519 | *" $libdir "*) ;; |
---|
4520 | *) perm_rpath="$perm_rpath $libdir" ;; |
---|
4521 | esac |
---|
4522 | fi |
---|
4523 | case $host in |
---|
4524 | *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
---|
4525 | case :$dllsearchpath: in |
---|
4526 | *":$libdir:"*) ;; |
---|
4527 | *) dllsearchpath="$dllsearchpath:$libdir";; |
---|
4528 | esac |
---|
4529 | ;; |
---|
4530 | esac |
---|
4531 | done |
---|
4532 | # Substitute the hardcoded libdirs into the rpath. |
---|
4533 | if test -n "$hardcode_libdir_separator" && |
---|
4534 | test -n "$hardcode_libdirs"; then |
---|
4535 | libdir="$hardcode_libdirs" |
---|
4536 | eval rpath=\" $hardcode_libdir_flag_spec\" |
---|
4537 | fi |
---|
4538 | compile_rpath="$rpath" |
---|
4539 | |
---|
4540 | rpath= |
---|
4541 | hardcode_libdirs= |
---|
4542 | for libdir in $finalize_rpath; do |
---|
4543 | if test -n "$hardcode_libdir_flag_spec"; then |
---|
4544 | if test -n "$hardcode_libdir_separator"; then |
---|
4545 | if test -z "$hardcode_libdirs"; then |
---|
4546 | hardcode_libdirs="$libdir" |
---|
4547 | else |
---|
4548 | # Just accumulate the unique libdirs. |
---|
4549 | case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
---|
4550 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
---|
4551 | ;; |
---|
4552 | *) |
---|
4553 | hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" |
---|
4554 | ;; |
---|
4555 | esac |
---|
4556 | fi |
---|
4557 | else |
---|
4558 | eval flag=\"$hardcode_libdir_flag_spec\" |
---|
4559 | rpath="$rpath $flag" |
---|
4560 | fi |
---|
4561 | elif test -n "$runpath_var"; then |
---|
4562 | case "$finalize_perm_rpath " in |
---|
4563 | *" $libdir "*) ;; |
---|
4564 | *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; |
---|
4565 | esac |
---|
4566 | fi |
---|
4567 | done |
---|
4568 | # Substitute the hardcoded libdirs into the rpath. |
---|
4569 | if test -n "$hardcode_libdir_separator" && |
---|
4570 | test -n "$hardcode_libdirs"; then |
---|
4571 | libdir="$hardcode_libdirs" |
---|
4572 | eval rpath=\" $hardcode_libdir_flag_spec\" |
---|
4573 | fi |
---|
4574 | finalize_rpath="$rpath" |
---|
4575 | |
---|
4576 | if test -n "$libobjs" && test "$build_old_libs" = yes; then |
---|
4577 | # Transform all the library objects into standard objects. |
---|
4578 | compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
---|
4579 | finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
---|
4580 | fi |
---|
4581 | |
---|
4582 | dlsyms= |
---|
4583 | if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then |
---|
4584 | if test -n "$NM" && test -n "$global_symbol_pipe"; then |
---|
4585 | dlsyms="${outputname}S.c" |
---|
4586 | else |
---|
4587 | $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 |
---|
4588 | fi |
---|
4589 | fi |
---|
4590 | |
---|
4591 | if test -n "$dlsyms"; then |
---|
4592 | case $dlsyms in |
---|
4593 | "") ;; |
---|
4594 | *.c) |
---|
4595 | # Discover the nlist of each of the dlfiles. |
---|
4596 | nlist="$output_objdir/${outputname}.nm" |
---|
4597 | |
---|
4598 | $show "$rm $nlist ${nlist}S ${nlist}T" |
---|
4599 | $run $rm "$nlist" "${nlist}S" "${nlist}T" |
---|
4600 | |
---|
4601 | # Parse the name list into a source file. |
---|
4602 | $show "creating $output_objdir/$dlsyms" |
---|
4603 | |
---|
4604 | test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ |
---|
4605 | /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ |
---|
4606 | /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ |
---|
4607 | |
---|
4608 | #ifdef __cplusplus |
---|
4609 | extern \"C\" { |
---|
4610 | #endif |
---|
4611 | |
---|
4612 | /* Prevent the only kind of declaration conflicts we can make. */ |
---|
4613 | #define lt_preloaded_symbols some_other_symbol |
---|
4614 | |
---|
4615 | /* External symbol declarations for the compiler. */\ |
---|
4616 | " |
---|
4617 | |
---|
4618 | if test "$dlself" = yes; then |
---|
4619 | $show "generating symbol list for \`$output'" |
---|
4620 | |
---|
4621 | test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" |
---|
4622 | |
---|
4623 | # Add our own program objects to the symbol list. |
---|
4624 | progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
---|
4625 | for arg in $progfiles; do |
---|
4626 | $show "extracting global C symbols from \`$arg'" |
---|
4627 | $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" |
---|
4628 | done |
---|
4629 | |
---|
4630 | if test -n "$exclude_expsyms"; then |
---|
4631 | $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' |
---|
4632 | $run eval '$mv "$nlist"T "$nlist"' |
---|
4633 | fi |
---|
4634 | |
---|
4635 | if test -n "$export_symbols_regex"; then |
---|
4636 | $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' |
---|
4637 | $run eval '$mv "$nlist"T "$nlist"' |
---|
4638 | fi |
---|
4639 | |
---|
4640 | # Prepare the list of exported symbols |
---|
4641 | if test -z "$export_symbols"; then |
---|
4642 | export_symbols="$output_objdir/$output.exp" |
---|
4643 | $run $rm $export_symbols |
---|
4644 | $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' |
---|
4645 | else |
---|
4646 | $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' |
---|
4647 | $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' |
---|
4648 | $run eval 'mv "$nlist"T "$nlist"' |
---|
4649 | fi |
---|
4650 | fi |
---|
4651 | |
---|
4652 | for arg in $dlprefiles; do |
---|
4653 | $show "extracting global C symbols from \`$arg'" |
---|
4654 | name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` |
---|
4655 | $run eval '$echo ": $name " >> "$nlist"' |
---|
4656 | $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" |
---|
4657 | done |
---|
4658 | |
---|
4659 | if test -z "$run"; then |
---|
4660 | # Make sure we have at least an empty file. |
---|
4661 | test -f "$nlist" || : > "$nlist" |
---|
4662 | |
---|
4663 | if test -n "$exclude_expsyms"; then |
---|
4664 | $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T |
---|
4665 | $mv "$nlist"T "$nlist" |
---|
4666 | fi |
---|
4667 | |
---|
4668 | # Try sorting and uniquifying the output. |
---|
4669 | if grep -v "^: " < "$nlist" | |
---|
4670 | if sort -k 3 </dev/null >/dev/null 2>&1; then |
---|
4671 | sort -k 3 |
---|
4672 | else |
---|
4673 | sort +2 |
---|
4674 | fi | |
---|
4675 | uniq > "$nlist"S; then |
---|
4676 | : |
---|
4677 | else |
---|
4678 | grep -v "^: " < "$nlist" > "$nlist"S |
---|
4679 | fi |
---|
4680 | |
---|
4681 | if test -f "$nlist"S; then |
---|
4682 | eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' |
---|
4683 | else |
---|
4684 | $echo '/* NONE */' >> "$output_objdir/$dlsyms" |
---|
4685 | fi |
---|
4686 | |
---|
4687 | $echo >> "$output_objdir/$dlsyms" "\ |
---|
4688 | |
---|
4689 | #undef lt_preloaded_symbols |
---|
4690 | |
---|
4691 | #if defined (__STDC__) && __STDC__ |
---|
4692 | # define lt_ptr void * |
---|
4693 | #else |
---|
4694 | # define lt_ptr char * |
---|
4695 | # define const |
---|
4696 | #endif |
---|
4697 | |
---|
4698 | /* The mapping between symbol names and symbols. */ |
---|
4699 | const struct { |
---|
4700 | const char *name; |
---|
4701 | lt_ptr address; |
---|
4702 | } |
---|
4703 | lt_preloaded_symbols[] = |
---|
4704 | {\ |
---|
4705 | " |
---|
4706 | |
---|
4707 | eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" |
---|
4708 | |
---|
4709 | $echo >> "$output_objdir/$dlsyms" "\ |
---|
4710 | {0, (lt_ptr) 0} |
---|
4711 | }; |
---|
4712 | |
---|
4713 | /* This works around a problem in FreeBSD linker */ |
---|
4714 | #ifdef FREEBSD_WORKAROUND |
---|
4715 | static const void *lt_preloaded_setup() { |
---|
4716 | return lt_preloaded_symbols; |
---|
4717 | } |
---|
4718 | #endif |
---|
4719 | |
---|
4720 | #ifdef __cplusplus |
---|
4721 | } |
---|
4722 | #endif\ |
---|
4723 | " |
---|
4724 | fi |
---|
4725 | |
---|
4726 | pic_flag_for_symtable= |
---|
4727 | case $host in |
---|
4728 | # compiling the symbol table file with pic_flag works around |
---|
4729 | # a FreeBSD bug that causes programs to crash when -lm is |
---|
4730 | # linked before any other PIC object. But we must not use |
---|
4731 | # pic_flag when linking with -static. The problem exists in |
---|
4732 | # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. |
---|
4733 | *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) |
---|
4734 | case "$compile_command " in |
---|
4735 | *" -static "*) ;; |
---|
4736 | *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; |
---|
4737 | esac;; |
---|
4738 | *-*-hpux*) |
---|
4739 | case "$compile_command " in |
---|
4740 | *" -static "*) ;; |
---|
4741 | *) pic_flag_for_symtable=" $pic_flag";; |
---|
4742 | esac |
---|
4743 | esac |
---|
4744 | |
---|
4745 | # Now compile the dynamic symbol file. |
---|
4746 | $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" |
---|
4747 | $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? |
---|
4748 | |
---|
4749 | # Clean up the generated files. |
---|
4750 | $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" |
---|
4751 | $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" |
---|
4752 | |
---|
4753 | # Transform the symbol file into the correct name. |
---|
4754 | compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` |
---|
4755 | finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` |
---|
4756 | ;; |
---|
4757 | *) |
---|
4758 | $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 |
---|
4759 | exit $EXIT_FAILURE |
---|
4760 | ;; |
---|
4761 | esac |
---|
4762 | else |
---|
4763 | # We keep going just in case the user didn't refer to |
---|
4764 | # lt_preloaded_symbols. The linker will fail if global_symbol_pipe |
---|
4765 | # really was required. |
---|
4766 | |
---|
4767 | # Nullify the symbol file. |
---|
4768 | compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` |
---|
4769 | finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` |
---|
4770 | fi |
---|
4771 | |
---|
4772 | if test "$need_relink" = no || test "$build_libtool_libs" != yes; then |
---|
4773 | # Replace the output file specification. |
---|
4774 | compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` |
---|
4775 | link_command="$compile_command$compile_rpath" |
---|
4776 | |
---|
4777 | # We have no uninstalled library dependencies, so finalize right now. |
---|
4778 | $show "$link_command" |
---|
4779 | $run eval "$link_command" |
---|
4780 | status=$? |
---|
4781 | |
---|
4782 | # Delete the generated files. |
---|
4783 | if test -n "$dlsyms"; then |
---|
4784 | $show "$rm $output_objdir/${outputname}S.${objext}" |
---|
4785 | $run $rm "$output_objdir/${outputname}S.${objext}" |
---|
4786 | fi |
---|
4787 | |
---|
4788 | exit $status |
---|
4789 | fi |
---|
4790 | |
---|
4791 | if test -n "$shlibpath_var"; then |
---|
4792 | # We should set the shlibpath_var |
---|
4793 | rpath= |
---|
4794 | for dir in $temp_rpath; do |
---|
4795 | case $dir in |
---|
4796 | [\\/]* | [A-Za-z]:[\\/]*) |
---|
4797 | # Absolute path. |
---|
4798 | rpath="$rpath$dir:" |
---|
4799 | ;; |
---|
4800 | *) |
---|
4801 | # Relative path: add a thisdir entry. |
---|
4802 | rpath="$rpath\$thisdir/$dir:" |
---|
4803 | ;; |
---|
4804 | esac |
---|
4805 | done |
---|
4806 | temp_rpath="$rpath" |
---|
4807 | fi |
---|
4808 | |
---|
4809 | if test -n "$compile_shlibpath$finalize_shlibpath"; then |
---|
4810 | compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" |
---|
4811 | fi |
---|
4812 | if test -n "$finalize_shlibpath"; then |
---|
4813 | finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" |
---|
4814 | fi |
---|
4815 | |
---|
4816 | compile_var= |
---|
4817 | finalize_var= |
---|
4818 | if test -n "$runpath_var"; then |
---|
4819 | if test -n "$perm_rpath"; then |
---|
4820 | # We should set the runpath_var. |
---|
4821 | rpath= |
---|
4822 | for dir in $perm_rpath; do |
---|
4823 | rpath="$rpath$dir:" |
---|
4824 | done |
---|
4825 | compile_var="$runpath_var=\"$rpath\$$runpath_var\" " |
---|
4826 | fi |
---|
4827 | if test -n "$finalize_perm_rpath"; then |
---|
4828 | # We should set the runpath_var. |
---|
4829 | rpath= |
---|
4830 | for dir in $finalize_perm_rpath; do |
---|
4831 | rpath="$rpath$dir:" |
---|
4832 | done |
---|
4833 | finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " |
---|
4834 | fi |
---|
4835 | fi |
---|
4836 | |
---|
4837 | if test "$no_install" = yes; then |
---|
4838 | # We don't need to create a wrapper script. |
---|
4839 | link_command="$compile_var$compile_command$compile_rpath" |
---|
4840 | # Replace the output file specification. |
---|
4841 | link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` |
---|
4842 | # Delete the old output file. |
---|
4843 | $run $rm $output |
---|
4844 | # Link the executable and exit |
---|
4845 | $show "$link_command" |
---|
4846 | $run eval "$link_command" || exit $? |
---|
4847 | exit $EXIT_SUCCESS |
---|
4848 | fi |
---|
4849 | |
---|
4850 | if test "$hardcode_action" = relink; then |
---|
4851 | # Fast installation is not supported |
---|
4852 | link_command="$compile_var$compile_command$compile_rpath" |
---|
4853 | relink_command="$finalize_var$finalize_command$finalize_rpath" |
---|
4854 | |
---|
4855 | $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 |
---|
4856 | $echo "$modename: \`$output' will be relinked during installation" 1>&2 |
---|
4857 | else |
---|
4858 | if test "$fast_install" != no; then |
---|
4859 | link_command="$finalize_var$compile_command$finalize_rpath" |
---|
4860 | if test "$fast_install" = yes; then |
---|
4861 | relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` |
---|
4862 | else |
---|
4863 | # fast_install is set to needless |
---|
4864 | relink_command= |
---|
4865 | fi |
---|
4866 | else |
---|
4867 | link_command="$compile_var$compile_command$compile_rpath" |
---|
4868 | relink_command="$finalize_var$finalize_command$finalize_rpath" |
---|
4869 | fi |
---|
4870 | fi |
---|
4871 | |
---|
4872 | # Replace the output file specification. |
---|
4873 | link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` |
---|
4874 | |
---|
4875 | # Delete the old output files. |
---|
4876 | $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname |
---|
4877 | |
---|
4878 | $show "$link_command" |
---|
4879 | $run eval "$link_command" || exit $? |
---|
4880 | |
---|
4881 | # Now create the wrapper script. |
---|
4882 | $show "creating $output" |
---|
4883 | |
---|
4884 | # Quote the relink command for shipping. |
---|
4885 | if test -n "$relink_command"; then |
---|
4886 | # Preserve any variables that may affect compiler behavior |
---|
4887 | for var in $variables_saved_for_relink; do |
---|
4888 | if eval test -z \"\${$var+set}\"; then |
---|
4889 | relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" |
---|
4890 | elif eval var_value=\$$var; test -z "$var_value"; then |
---|
4891 | relink_command="$var=; export $var; $relink_command" |
---|
4892 | else |
---|
4893 | var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` |
---|
4894 | relink_command="$var=\"$var_value\"; export $var; $relink_command" |
---|
4895 | fi |
---|
4896 | done |
---|
4897 | relink_command="(cd `pwd`; $relink_command)" |
---|
4898 | relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` |
---|
4899 | fi |
---|
4900 | |
---|
4901 | # Quote $echo for shipping. |
---|
4902 | if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then |
---|
4903 | case $progpath in |
---|
4904 | [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; |
---|
4905 | *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; |
---|
4906 | esac |
---|
4907 | qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` |
---|
4908 | else |
---|
4909 | qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` |
---|
4910 | fi |
---|
4911 | |
---|
4912 | # Only actually do things if our run command is non-null. |
---|
4913 | if test -z "$run"; then |
---|
4914 | # win32 will think the script is a binary if it has |
---|
4915 | # a .exe suffix, so we strip it off here. |
---|
4916 | case $output in |
---|
4917 | *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; |
---|
4918 | esac |
---|
4919 | # test for cygwin because mv fails w/o .exe extensions |
---|
4920 | case $host in |
---|
4921 | *cygwin*) |
---|
4922 | exeext=.exe |
---|
4923 | outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; |
---|
4924 | *) exeext= ;; |
---|
4925 | esac |
---|
4926 | case $host in |
---|
4927 | *cygwin* | *mingw* ) |
---|
4928 | cwrappersource=`$echo ${objdir}/lt-${output}.c` |
---|
4929 | cwrapper=`$echo ${output}.exe` |
---|
4930 | $rm $cwrappersource $cwrapper |
---|
4931 | trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 |
---|
4932 | |
---|
4933 | cat > $cwrappersource <<EOF |
---|
4934 | |
---|
4935 | /* $cwrappersource - temporary wrapper executable for $objdir/$outputname |
---|
4936 | Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
---|
4937 | |
---|
4938 | The $output program cannot be directly executed until all the libtool |
---|
4939 | libraries that it depends on are installed. |
---|
4940 | |
---|
4941 | This wrapper executable should never be moved out of the build directory. |
---|
4942 | If it is, it will not operate correctly. |
---|
4943 | |
---|
4944 | Currently, it simply execs the wrapper *script* "/bin/sh $output", |
---|
4945 | but could eventually absorb all of the scripts functionality and |
---|
4946 | exec $objdir/$outputname directly. |
---|
4947 | */ |
---|
4948 | EOF |
---|
4949 | cat >> $cwrappersource<<"EOF" |
---|
4950 | #include <stdio.h> |
---|
4951 | #include <stdlib.h> |
---|
4952 | #include <unistd.h> |
---|
4953 | #include <malloc.h> |
---|
4954 | #include <stdarg.h> |
---|
4955 | #include <assert.h> |
---|
4956 | |
---|
4957 | #if defined(PATH_MAX) |
---|
4958 | # define LT_PATHMAX PATH_MAX |
---|
4959 | #elif defined(MAXPATHLEN) |
---|
4960 | # define LT_PATHMAX MAXPATHLEN |
---|
4961 | #else |
---|
4962 | # define LT_PATHMAX 1024 |
---|
4963 | #endif |
---|
4964 | |
---|
4965 | #ifndef DIR_SEPARATOR |
---|
4966 | #define DIR_SEPARATOR '/' |
---|
4967 | #endif |
---|
4968 | |
---|
4969 | #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ |
---|
4970 | defined (__OS2__) |
---|
4971 | #define HAVE_DOS_BASED_FILE_SYSTEM |
---|
4972 | #ifndef DIR_SEPARATOR_2 |
---|
4973 | #define DIR_SEPARATOR_2 '\\' |
---|
4974 | #endif |
---|
4975 | #endif |
---|
4976 | |
---|
4977 | #ifndef DIR_SEPARATOR_2 |
---|
4978 | # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) |
---|
4979 | #else /* DIR_SEPARATOR_2 */ |
---|
4980 | # define IS_DIR_SEPARATOR(ch) \ |
---|
4981 | (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) |
---|
4982 | #endif /* DIR_SEPARATOR_2 */ |
---|
4983 | |
---|
4984 | #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) |
---|
4985 | #define XFREE(stale) do { \ |
---|
4986 | if (stale) { free ((void *) stale); stale = 0; } \ |
---|
4987 | } while (0) |
---|
4988 | |
---|
4989 | const char *program_name = NULL; |
---|
4990 | |
---|
4991 | void * xmalloc (size_t num); |
---|
4992 | char * xstrdup (const char *string); |
---|
4993 | char * basename (const char *name); |
---|
4994 | char * fnqualify(const char *path); |
---|
4995 | char * strendzap(char *str, const char *pat); |
---|
4996 | void lt_fatal (const char *message, ...); |
---|
4997 | |
---|
4998 | int |
---|
4999 | main (int argc, char *argv[]) |
---|
5000 | { |
---|
5001 | char **newargz; |
---|
5002 | int i; |
---|
5003 | |
---|
5004 | program_name = (char *) xstrdup ((char *) basename (argv[0])); |
---|
5005 | newargz = XMALLOC(char *, argc+2); |
---|
5006 | EOF |
---|
5007 | |
---|
5008 | cat >> $cwrappersource <<EOF |
---|
5009 | newargz[0] = "$SHELL"; |
---|
5010 | EOF |
---|
5011 | |
---|
5012 | cat >> $cwrappersource <<"EOF" |
---|
5013 | newargz[1] = fnqualify(argv[0]); |
---|
5014 | /* we know the script has the same name, without the .exe */ |
---|
5015 | /* so make sure newargz[1] doesn't end in .exe */ |
---|
5016 | strendzap(newargz[1],".exe"); |
---|
5017 | for (i = 1; i < argc; i++) |
---|
5018 | newargz[i+1] = xstrdup(argv[i]); |
---|
5019 | newargz[argc+1] = NULL; |
---|
5020 | EOF |
---|
5021 | |
---|
5022 | cat >> $cwrappersource <<EOF |
---|
5023 | execv("$SHELL",newargz); |
---|
5024 | EOF |
---|
5025 | |
---|
5026 | cat >> $cwrappersource <<"EOF" |
---|
5027 | } |
---|
5028 | |
---|
5029 | void * |
---|
5030 | xmalloc (size_t num) |
---|
5031 | { |
---|
5032 | void * p = (void *) malloc (num); |
---|
5033 | if (!p) |
---|
5034 | lt_fatal ("Memory exhausted"); |
---|
5035 | |
---|
5036 | return p; |
---|
5037 | } |
---|
5038 | |
---|
5039 | char * |
---|
5040 | xstrdup (const char *string) |
---|
5041 | { |
---|
5042 | return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL |
---|
5043 | ; |
---|
5044 | } |
---|
5045 | |
---|
5046 | char * |
---|
5047 | basename (const char *name) |
---|
5048 | { |
---|
5049 | const char *base; |
---|
5050 | |
---|
5051 | #if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
---|
5052 | /* Skip over the disk name in MSDOS pathnames. */ |
---|
5053 | if (isalpha (name[0]) && name[1] == ':') |
---|
5054 | name += 2; |
---|
5055 | #endif |
---|
5056 | |
---|
5057 | for (base = name; *name; name++) |
---|
5058 | if (IS_DIR_SEPARATOR (*name)) |
---|
5059 | base = name + 1; |
---|
5060 | return (char *) base; |
---|
5061 | } |
---|
5062 | |
---|
5063 | char * |
---|
5064 | fnqualify(const char *path) |
---|
5065 | { |
---|
5066 | size_t size; |
---|
5067 | char *p; |
---|
5068 | char tmp[LT_PATHMAX + 1]; |
---|
5069 | |
---|
5070 | assert(path != NULL); |
---|
5071 | |
---|
5072 | /* Is it qualified already? */ |
---|
5073 | #if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
---|
5074 | if (isalpha (path[0]) && path[1] == ':') |
---|
5075 | return xstrdup (path); |
---|
5076 | #endif |
---|
5077 | if (IS_DIR_SEPARATOR (path[0])) |
---|
5078 | return xstrdup (path); |
---|
5079 | |
---|
5080 | /* prepend the current directory */ |
---|
5081 | /* doesn't handle '~' */ |
---|
5082 | if (getcwd (tmp, LT_PATHMAX) == NULL) |
---|
5083 | lt_fatal ("getcwd failed"); |
---|
5084 | size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ |
---|
5085 | p = XMALLOC(char, size); |
---|
5086 | sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); |
---|
5087 | return p; |
---|
5088 | } |
---|
5089 | |
---|
5090 | char * |
---|
5091 | strendzap(char *str, const char *pat) |
---|
5092 | { |
---|
5093 | size_t len, patlen; |
---|
5094 | |
---|
5095 | assert(str != NULL); |
---|
5096 | assert(pat != NULL); |
---|
5097 | |
---|
5098 | len = strlen(str); |
---|
5099 | patlen = strlen(pat); |
---|
5100 | |
---|
5101 | if (patlen <= len) |
---|
5102 | { |
---|
5103 | str += len - patlen; |
---|
5104 | if (strcmp(str, pat) == 0) |
---|
5105 | *str = '\0'; |
---|
5106 | } |
---|
5107 | return str; |
---|
5108 | } |
---|
5109 | |
---|
5110 | static void |
---|
5111 | lt_error_core (int exit_status, const char * mode, |
---|
5112 | const char * message, va_list ap) |
---|
5113 | { |
---|
5114 | fprintf (stderr, "%s: %s: ", program_name, mode); |
---|
5115 | vfprintf (stderr, message, ap); |
---|
5116 | fprintf (stderr, ".\n"); |
---|
5117 | |
---|
5118 | if (exit_status >= 0) |
---|
5119 | exit (exit_status); |
---|
5120 | } |
---|
5121 | |
---|
5122 | void |
---|
5123 | lt_fatal (const char *message, ...) |
---|
5124 | { |
---|
5125 | va_list ap; |
---|
5126 | va_start (ap, message); |
---|
5127 | lt_error_core (EXIT_FAILURE, "FATAL", message, ap); |
---|
5128 | va_end (ap); |
---|
5129 | } |
---|
5130 | EOF |
---|
5131 | # we should really use a build-platform specific compiler |
---|
5132 | # here, but OTOH, the wrappers (shell script and this C one) |
---|
5133 | # are only useful if you want to execute the "real" binary. |
---|
5134 | # Since the "real" binary is built for $host, then this |
---|
5135 | # wrapper might as well be built for $host, too. |
---|
5136 | $run $LTCC -s -o $cwrapper $cwrappersource |
---|
5137 | ;; |
---|
5138 | esac |
---|
5139 | $rm $output |
---|
5140 | trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 |
---|
5141 | |
---|
5142 | $echo > $output "\ |
---|
5143 | #! $SHELL |
---|
5144 | |
---|
5145 | # $output - temporary wrapper script for $objdir/$outputname |
---|
5146 | # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
---|
5147 | # |
---|
5148 | # The $output program cannot be directly executed until all the libtool |
---|
5149 | # libraries that it depends on are installed. |
---|
5150 | # |
---|
5151 | # This wrapper script should never be moved out of the build directory. |
---|
5152 | # If it is, it will not operate correctly. |
---|
5153 | |
---|
5154 | # Sed substitution that helps us do robust quoting. It backslashifies |
---|
5155 | # metacharacters that are still active within double-quoted strings. |
---|
5156 | Xsed='${SED} -e 1s/^X//' |
---|
5157 | sed_quote_subst='$sed_quote_subst' |
---|
5158 | |
---|
5159 | # The HP-UX ksh and POSIX shell print the target directory to stdout |
---|
5160 | # if CDPATH is set. |
---|
5161 | if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi |
---|
5162 | |
---|
5163 | relink_command=\"$relink_command\" |
---|
5164 | |
---|
5165 | # This environment variable determines our operation mode. |
---|
5166 | if test \"\$libtool_install_magic\" = \"$magic\"; then |
---|
5167 | # install mode needs the following variable: |
---|
5168 | notinst_deplibs='$notinst_deplibs' |
---|
5169 | else |
---|
5170 | # When we are sourced in execute mode, \$file and \$echo are already set. |
---|
5171 | if test \"\$libtool_execute_magic\" != \"$magic\"; then |
---|
5172 | echo=\"$qecho\" |
---|
5173 | file=\"\$0\" |
---|
5174 | # Make sure echo works. |
---|
5175 | if test \"X\$1\" = X--no-reexec; then |
---|
5176 | # Discard the --no-reexec flag, and continue. |
---|
5177 | shift |
---|
5178 | elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then |
---|
5179 | # Yippee, \$echo works! |
---|
5180 | : |
---|
5181 | else |
---|
5182 | # Restart under the correct shell, and then maybe \$echo will work. |
---|
5183 | exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} |
---|
5184 | fi |
---|
5185 | fi\ |
---|
5186 | " |
---|
5187 | $echo >> $output "\ |
---|
5188 | |
---|
5189 | # Find the directory that this script lives in. |
---|
5190 | thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` |
---|
5191 | test \"x\$thisdir\" = \"x\$file\" && thisdir=. |
---|
5192 | |
---|
5193 | # Follow symbolic links until we get to the real thisdir. |
---|
5194 | file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` |
---|
5195 | while test -n \"\$file\"; do |
---|
5196 | destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` |
---|
5197 | |
---|
5198 | # If there was a directory component, then change thisdir. |
---|
5199 | if test \"x\$destdir\" != \"x\$file\"; then |
---|
5200 | case \"\$destdir\" in |
---|
5201 | [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; |
---|
5202 | *) thisdir=\"\$thisdir/\$destdir\" ;; |
---|
5203 | esac |
---|
5204 | fi |
---|
5205 | |
---|
5206 | file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` |
---|
5207 | file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` |
---|
5208 | done |
---|
5209 | |
---|
5210 | # Try to get the absolute directory name. |
---|
5211 | absdir=\`cd \"\$thisdir\" && pwd\` |
---|
5212 | test -n \"\$absdir\" && thisdir=\"\$absdir\" |
---|
5213 | " |
---|
5214 | |
---|
5215 | if test "$fast_install" = yes; then |
---|
5216 | $echo >> $output "\ |
---|
5217 | program=lt-'$outputname'$exeext |
---|
5218 | progdir=\"\$thisdir/$objdir\" |
---|
5219 | |
---|
5220 | if test ! -f \"\$progdir/\$program\" || \\ |
---|
5221 | { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ |
---|
5222 | test \"X\$file\" != \"X\$progdir/\$program\"; }; then |
---|
5223 | |
---|
5224 | file=\"\$\$-\$program\" |
---|
5225 | |
---|
5226 | if test ! -d \"\$progdir\"; then |
---|
5227 | $mkdir \"\$progdir\" |
---|
5228 | else |
---|
5229 | $rm \"\$progdir/\$file\" |
---|
5230 | fi" |
---|
5231 | |
---|
5232 | $echo >> $output "\ |
---|
5233 | |
---|
5234 | # relink executable if necessary |
---|
5235 | if test -n \"\$relink_command\"; then |
---|
5236 | if relink_command_output=\`eval \$relink_command 2>&1\`; then : |
---|
5237 | else |
---|
5238 | $echo \"\$relink_command_output\" >&2 |
---|
5239 | $rm \"\$progdir/\$file\" |
---|
5240 | exit $EXIT_FAILURE |
---|
5241 | fi |
---|
5242 | fi |
---|
5243 | |
---|
5244 | $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || |
---|
5245 | { $rm \"\$progdir/\$program\"; |
---|
5246 | $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } |
---|
5247 | $rm \"\$progdir/\$file\" |
---|
5248 | fi" |
---|
5249 | else |
---|
5250 | $echo >> $output "\ |
---|
5251 | program='$outputname' |
---|
5252 | progdir=\"\$thisdir/$objdir\" |
---|
5253 | " |
---|
5254 | fi |
---|
5255 | |
---|
5256 | $echo >> $output "\ |
---|
5257 | |
---|
5258 | if test -f \"\$progdir/\$program\"; then" |
---|
5259 | |
---|
5260 | # Export our shlibpath_var if we have one. |
---|
5261 | if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then |
---|
5262 | $echo >> $output "\ |
---|
5263 | # Add our own library path to $shlibpath_var |
---|
5264 | $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" |
---|
5265 | |
---|
5266 | # Some systems cannot cope with colon-terminated $shlibpath_var |
---|
5267 | # The second colon is a workaround for a bug in BeOS R4 sed |
---|
5268 | $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` |
---|
5269 | |
---|
5270 | export $shlibpath_var |
---|
5271 | " |
---|
5272 | fi |
---|
5273 | |
---|
5274 | # fixup the dll searchpath if we need to. |
---|
5275 | if test -n "$dllsearchpath"; then |
---|
5276 | $echo >> $output "\ |
---|
5277 | # Add the dll search path components to the executable PATH |
---|
5278 | PATH=$dllsearchpath:\$PATH |
---|
5279 | " |
---|
5280 | fi |
---|
5281 | |
---|
5282 | $echo >> $output "\ |
---|
5283 | if test \"\$libtool_execute_magic\" != \"$magic\"; then |
---|
5284 | # Run the actual program with our arguments. |
---|
5285 | " |
---|
5286 | case $host in |
---|
5287 | # Backslashes separate directories on plain windows |
---|
5288 | *-*-mingw | *-*-os2*) |
---|
5289 | $echo >> $output "\ |
---|
5290 | exec \$progdir\\\\\$program \${1+\"\$@\"} |
---|
5291 | " |
---|
5292 | ;; |
---|
5293 | |
---|
5294 | *) |
---|
5295 | $echo >> $output "\ |
---|
5296 | exec \$progdir/\$program \${1+\"\$@\"} |
---|
5297 | " |
---|
5298 | ;; |
---|
5299 | esac |
---|
5300 | $echo >> $output "\ |
---|
5301 | \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" |
---|
5302 | exit $EXIT_FAILURE |
---|
5303 | fi |
---|
5304 | else |
---|
5305 | # The program doesn't exist. |
---|
5306 | \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 |
---|
5307 | \$echo \"This script is just a wrapper for \$program.\" 1>&2 |
---|
5308 | $echo \"See the $PACKAGE documentation for more information.\" 1>&2 |
---|
5309 | exit $EXIT_FAILURE |
---|
5310 | fi |
---|
5311 | fi\ |
---|
5312 | " |
---|
5313 | chmod +x $output |
---|
5314 | fi |
---|
5315 | exit $EXIT_SUCCESS |
---|
5316 | ;; |
---|
5317 | esac |
---|
5318 | |
---|
5319 | # See if we need to build an old-fashioned archive. |
---|
5320 | for oldlib in $oldlibs; do |
---|
5321 | |
---|
5322 | if test "$build_libtool_libs" = convenience; then |
---|
5323 | oldobjs="$libobjs_save" |
---|
5324 | addlibs="$convenience" |
---|
5325 | build_libtool_libs=no |
---|
5326 | else |
---|
5327 | if test "$build_libtool_libs" = module; then |
---|
5328 | oldobjs="$libobjs_save" |
---|
5329 | build_libtool_libs=no |
---|
5330 | else |
---|
5331 | oldobjs="$old_deplibs $non_pic_objects" |
---|
5332 | fi |
---|
5333 | addlibs="$old_convenience" |
---|
5334 | fi |
---|
5335 | |
---|
5336 | if test -n "$addlibs"; then |
---|
5337 | gentop="$output_objdir/${outputname}x" |
---|
5338 | $show "${rm}r $gentop" |
---|
5339 | $run ${rm}r "$gentop" |
---|
5340 | $show "$mkdir $gentop" |
---|
5341 | $run $mkdir "$gentop" |
---|
5342 | status=$? |
---|
5343 | if test "$status" -ne 0 && test ! -d "$gentop"; then |
---|
5344 | exit $status |
---|
5345 | fi |
---|
5346 | generated="$generated $gentop" |
---|
5347 | |
---|
5348 | # Add in members from convenience archives. |
---|
5349 | for xlib in $addlibs; do |
---|
5350 | # Extract the objects. |
---|
5351 | case $xlib in |
---|
5352 | [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
---|
5353 | *) xabs=`pwd`"/$xlib" ;; |
---|
5354 | esac |
---|
5355 | xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` |
---|
5356 | xdir="$gentop/$xlib" |
---|
5357 | |
---|
5358 | $show "${rm}r $xdir" |
---|
5359 | $run ${rm}r "$xdir" |
---|
5360 | $show "$mkdir $xdir" |
---|
5361 | $run $mkdir "$xdir" |
---|
5362 | status=$? |
---|
5363 | if test "$status" -ne 0 && test ! -d "$xdir"; then |
---|
5364 | exit $status |
---|
5365 | fi |
---|
5366 | # We will extract separately just the conflicting names and we will no |
---|
5367 | # longer touch any unique names. It is faster to leave these extract |
---|
5368 | # automatically by $AR in one run. |
---|
5369 | $show "(cd $xdir && $AR x $xabs)" |
---|
5370 | $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? |
---|
5371 | if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then |
---|
5372 | : |
---|
5373 | else |
---|
5374 | $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 |
---|
5375 | $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 |
---|
5376 | $AR t "$xabs" | sort | uniq -cd | while read -r count name |
---|
5377 | do |
---|
5378 | i=1 |
---|
5379 | while test "$i" -le "$count" |
---|
5380 | do |
---|
5381 | # Put our $i before any first dot (extension) |
---|
5382 | # Never overwrite any file |
---|
5383 | name_to="$name" |
---|
5384 | while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" |
---|
5385 | do |
---|
5386 | name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` |
---|
5387 | done |
---|
5388 | $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" |
---|
5389 | $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? |
---|
5390 | i=`expr $i + 1` |
---|
5391 | done |
---|
5392 | done |
---|
5393 | fi |
---|
5394 | |
---|
5395 | oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` |
---|
5396 | done |
---|
5397 | fi |
---|
5398 | |
---|
5399 | # Do each command in the archive commands. |
---|
5400 | if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then |
---|
5401 | cmds=$old_archive_from_new_cmds |
---|
5402 | else |
---|
5403 | eval cmds=\"$old_archive_cmds\" |
---|
5404 | |
---|
5405 | if len=`expr "X$cmds" : ".*"` && |
---|
5406 | test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
---|
5407 | cmds=$old_archive_cmds |
---|
5408 | else |
---|
5409 | # the command line is too long to link in one step, link in parts |
---|
5410 | $echo "using piecewise archive linking..." |
---|
5411 | save_RANLIB=$RANLIB |
---|
5412 | RANLIB=: |
---|
5413 | objlist= |
---|
5414 | concat_cmds= |
---|
5415 | save_oldobjs=$oldobjs |
---|
5416 | # GNU ar 2.10+ was changed to match POSIX; thus no paths are |
---|
5417 | # encoded into archives. This makes 'ar r' malfunction in |
---|
5418 | # this piecewise linking case whenever conflicting object |
---|
5419 | # names appear in distinct ar calls; check, warn and compensate. |
---|
5420 | if (for obj in $save_oldobjs |
---|
5421 | do |
---|
5422 | $echo "X$obj" | $Xsed -e 's%^.*/%%' |
---|
5423 | done | sort | sort -uc >/dev/null 2>&1); then |
---|
5424 | : |
---|
5425 | else |
---|
5426 | $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 |
---|
5427 | $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 |
---|
5428 | AR_FLAGS=cq |
---|
5429 | fi |
---|
5430 | # Is there a better way of finding the last object in the list? |
---|
5431 | for obj in $save_oldobjs |
---|
5432 | do |
---|
5433 | last_oldobj=$obj |
---|
5434 | done |
---|
5435 | for obj in $save_oldobjs |
---|
5436 | do |
---|
5437 | oldobjs="$objlist $obj" |
---|
5438 | objlist="$objlist $obj" |
---|
5439 | eval test_cmds=\"$old_archive_cmds\" |
---|
5440 | if len=`expr "X$test_cmds" : ".*"` && |
---|
5441 | test "$len" -le "$max_cmd_len"; then |
---|
5442 | : |
---|
5443 | else |
---|
5444 | # the above command should be used before it gets too long |
---|
5445 | oldobjs=$objlist |
---|
5446 | if test "$obj" = "$last_oldobj" ; then |
---|
5447 | RANLIB=$save_RANLIB |
---|
5448 | fi |
---|
5449 | test -z "$concat_cmds" || concat_cmds=$concat_cmds~ |
---|
5450 | eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" |
---|
5451 | objlist= |
---|
5452 | fi |
---|
5453 | done |
---|
5454 | RANLIB=$save_RANLIB |
---|
5455 | oldobjs=$objlist |
---|
5456 | if test "X$oldobjs" = "X" ; then |
---|
5457 | eval cmds=\"\$concat_cmds\" |
---|
5458 | else |
---|
5459 | eval cmds=\"\$concat_cmds~\$old_archive_cmds\" |
---|
5460 | fi |
---|
5461 | fi |
---|
5462 | fi |
---|
5463 | save_ifs="$IFS"; IFS='~' |
---|
5464 | for cmd in $cmds; do |
---|
5465 | eval cmd=\"$cmd\" |
---|
5466 | IFS="$save_ifs" |
---|
5467 | $show "$cmd" |
---|
5468 | $run eval "$cmd" || exit $? |
---|
5469 | done |
---|
5470 | IFS="$save_ifs" |
---|
5471 | done |
---|
5472 | |
---|
5473 | if test -n "$generated"; then |
---|
5474 | $show "${rm}r$generated" |
---|
5475 | $run ${rm}r$generated |
---|
5476 | fi |
---|
5477 | |
---|
5478 | # Now create the libtool archive. |
---|
5479 | case $output in |
---|
5480 | *.la) |
---|
5481 | old_library= |
---|
5482 | test "$build_old_libs" = yes && old_library="$libname.$libext" |
---|
5483 | $show "creating $output" |
---|
5484 | |
---|
5485 | # Preserve any variables that may affect compiler behavior |
---|
5486 | for var in $variables_saved_for_relink; do |
---|
5487 | if eval test -z \"\${$var+set}\"; then |
---|
5488 | relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" |
---|
5489 | elif eval var_value=\$$var; test -z "$var_value"; then |
---|
5490 | relink_command="$var=; export $var; $relink_command" |
---|
5491 | else |
---|
5492 | var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` |
---|
5493 | relink_command="$var=\"$var_value\"; export $var; $relink_command" |
---|
5494 | fi |
---|
5495 | done |
---|
5496 | # Quote the link command for shipping. |
---|
5497 | relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" |
---|
5498 | relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` |
---|
5499 | if test "$hardcode_automatic" = yes ; then |
---|
5500 | relink_command= |
---|
5501 | fi |
---|
5502 | |
---|
5503 | |
---|
5504 | # Only create the output if not a dry run. |
---|
5505 | if test -z "$run"; then |
---|
5506 | for installed in no yes; do |
---|
5507 | if test "$installed" = yes; then |
---|
5508 | if test -z "$install_libdir"; then |
---|
5509 | break |
---|
5510 | fi |
---|
5511 | output="$output_objdir/$outputname"i |
---|
5512 | # Replace all uninstalled libtool libraries with the installed ones |
---|
5513 | newdependency_libs= |
---|
5514 | for deplib in $dependency_libs; do |
---|
5515 | case $deplib in |
---|
5516 | *.la) |
---|
5517 | name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` |
---|
5518 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
---|
5519 | if test -z "$libdir"; then |
---|
5520 | $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
---|
5521 | exit $EXIT_FAILURE |
---|
5522 | fi |
---|
5523 | newdependency_libs="$newdependency_libs $libdir/$name" |
---|
5524 | ;; |
---|
5525 | *) newdependency_libs="$newdependency_libs $deplib" ;; |
---|
5526 | esac |
---|
5527 | done |
---|
5528 | dependency_libs="$newdependency_libs" |
---|
5529 | newdlfiles= |
---|
5530 | for lib in $dlfiles; do |
---|
5531 | name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
---|
5532 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` |
---|
5533 | if test -z "$libdir"; then |
---|
5534 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
---|
5535 | exit $EXIT_FAILURE |
---|
5536 | fi |
---|
5537 | newdlfiles="$newdlfiles $libdir/$name" |
---|
5538 | done |
---|
5539 | dlfiles="$newdlfiles" |
---|
5540 | newdlprefiles= |
---|
5541 | for lib in $dlprefiles; do |
---|
5542 | name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
---|
5543 | eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` |
---|
5544 | if test -z "$libdir"; then |
---|
5545 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
---|
5546 | exit $EXIT_FAILURE |
---|
5547 | fi |
---|
5548 | newdlprefiles="$newdlprefiles $libdir/$name" |
---|
5549 | done |
---|
5550 | dlprefiles="$newdlprefiles" |
---|
5551 | else |
---|
5552 | newdlfiles= |
---|
5553 | for lib in $dlfiles; do |
---|
5554 | case $lib in |
---|
5555 | [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; |
---|
5556 | *) abs=`pwd`"/$lib" ;; |
---|
5557 | esac |
---|
5558 | newdlfiles="$newdlfiles $abs" |
---|
5559 | done |
---|
5560 | dlfiles="$newdlfiles" |
---|
5561 | newdlprefiles= |
---|
5562 | for lib in $dlprefiles; do |
---|
5563 | case $lib in |
---|
5564 | [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; |
---|
5565 | *) abs=`pwd`"/$lib" ;; |
---|
5566 | esac |
---|
5567 | newdlprefiles="$newdlprefiles $abs" |
---|
5568 | done |
---|
5569 | dlprefiles="$newdlprefiles" |
---|
5570 | fi |
---|
5571 | $rm $output |
---|
5572 | # place dlname in correct position for cygwin |
---|
5573 | tdlname=$dlname |
---|
5574 | case $host,$output,$installed,$module,$dlname in |
---|
5575 | *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; |
---|
5576 | esac |
---|
5577 | $echo > $output "\ |
---|
5578 | # $outputname - a libtool library file |
---|
5579 | # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
---|
5580 | # |
---|
5581 | # Please DO NOT delete this file! |
---|
5582 | # It is necessary for linking the library. |
---|
5583 | |
---|
5584 | # The name that we can dlopen(3). |
---|
5585 | dlname='$tdlname' |
---|
5586 | |
---|
5587 | # Names of this library. |
---|
5588 | library_names='$library_names' |
---|
5589 | |
---|
5590 | # The name of the static archive. |
---|
5591 | old_library='$old_library' |
---|
5592 | |
---|
5593 | # Libraries that this one depends upon. |
---|
5594 | dependency_libs='$dependency_libs' |
---|
5595 | |
---|
5596 | # Version information for $libname. |
---|
5597 | current=$current |
---|
5598 | age=$age |
---|
5599 | revision=$revision |
---|
5600 | |
---|
5601 | # Is this an already installed library? |
---|
5602 | installed=$installed |
---|
5603 | |
---|
5604 | # Should we warn about portability when linking against -modules? |
---|
5605 | shouldnotlink=$module |
---|
5606 | |
---|
5607 | # Files to dlopen/dlpreopen |
---|
5608 | dlopen='$dlfiles' |
---|
5609 | dlpreopen='$dlprefiles' |
---|
5610 | |
---|
5611 | # Directory that this library needs to be installed in: |
---|
5612 | libdir='$install_libdir'" |
---|
5613 | if test "$installed" = no && test "$need_relink" = yes; then |
---|
5614 | $echo >> $output "\ |
---|
5615 | relink_command=\"$relink_command\"" |
---|
5616 | fi |
---|
5617 | done |
---|
5618 | fi |
---|
5619 | |
---|
5620 | # Do a symbolic link so that the libtool archive can be found in |
---|
5621 | # LD_LIBRARY_PATH before the program is installed. |
---|
5622 | $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" |
---|
5623 | $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? |
---|
5624 | ;; |
---|
5625 | esac |
---|
5626 | exit $EXIT_SUCCESS |
---|
5627 | ;; |
---|
5628 | |
---|
5629 | # libtool install mode |
---|
5630 | install) |
---|
5631 | modename="$modename: install" |
---|
5632 | |
---|
5633 | # There may be an optional sh(1) argument at the beginning of |
---|
5634 | # install_prog (especially on Windows NT). |
---|
5635 | if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || |
---|
5636 | # Allow the use of GNU shtool's install command. |
---|
5637 | $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then |
---|
5638 | # Aesthetically quote it. |
---|
5639 | arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` |
---|
5640 | case $arg in |
---|
5641 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
---|
5642 | arg="\"$arg\"" |
---|
5643 | ;; |
---|
5644 | esac |
---|
5645 | install_prog="$arg " |
---|
5646 | arg="$1" |
---|
5647 | shift |
---|
5648 | else |
---|
5649 | install_prog= |
---|
5650 | arg="$nonopt" |
---|
5651 | fi |
---|
5652 | |
---|
5653 | # The real first argument should be the name of the installation program. |
---|
5654 | # Aesthetically quote it. |
---|
5655 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
---|
5656 | case $arg in |
---|
5657 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
---|
5658 | arg="\"$arg\"" |
---|
5659 | ;; |
---|
5660 | esac |
---|
5661 | install_prog="$install_prog$arg" |
---|
5662 | |
---|
5663 | # We need to accept at least all the BSD install flags. |
---|
5664 | dest= |
---|
5665 | files= |
---|
5666 | opts= |
---|
5667 | prev= |
---|
5668 | install_type= |
---|
5669 | isdir=no |
---|
5670 | stripme= |
---|
5671 | for arg |
---|
5672 | do |
---|
5673 | if test -n "$dest"; then |
---|
5674 | files="$files $dest" |
---|
5675 | dest="$arg" |
---|
5676 | continue |
---|
5677 | fi |
---|
5678 | |
---|
5679 | case $arg in |
---|
5680 | -d) isdir=yes ;; |
---|
5681 | -f) prev="-f" ;; |
---|
5682 | -g) prev="-g" ;; |
---|
5683 | -m) prev="-m" ;; |
---|
5684 | -o) prev="-o" ;; |
---|
5685 | -s) |
---|
5686 | stripme=" -s" |
---|
5687 | continue |
---|
5688 | ;; |
---|
5689 | -*) ;; |
---|
5690 | |
---|
5691 | *) |
---|
5692 | # If the previous option needed an argument, then skip it. |
---|
5693 | if test -n "$prev"; then |
---|
5694 | prev= |
---|
5695 | else |
---|
5696 | dest="$arg" |
---|
5697 | continue |
---|
5698 | fi |
---|
5699 | ;; |
---|
5700 | esac |
---|
5701 | |
---|
5702 | # Aesthetically quote the argument. |
---|
5703 | arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
---|
5704 | case $arg in |
---|
5705 | *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
---|
5706 | arg="\"$arg\"" |
---|
5707 | ;; |
---|
5708 | esac |
---|
5709 | install_prog="$install_prog $arg" |
---|
5710 | done |
---|
5711 | |
---|
5712 | if test -z "$install_prog"; then |
---|
5713 | $echo "$modename: you must specify an install program" 1>&2 |
---|
5714 | $echo "$help" 1>&2 |
---|
5715 | exit $EXIT_FAILURE |
---|
5716 | fi |
---|
5717 | |
---|
5718 | if test -n "$prev"; then |
---|
5719 | $echo "$modename: the \`$prev' option requires an argument" 1>&2 |
---|
5720 | $echo "$help" 1>&2 |
---|
5721 | exit $EXIT_FAILURE |
---|
5722 | fi |
---|
5723 | |
---|
5724 | if test -z "$files"; then |
---|
5725 | if test -z "$dest"; then |
---|
5726 | $echo "$modename: no file or destination specified" 1>&2 |
---|
5727 | else |
---|
5728 | $echo "$modename: you must specify a destination" 1>&2 |
---|
5729 | fi |
---|
5730 | $echo "$help" 1>&2 |
---|
5731 | exit $EXIT_FAILURE |
---|
5732 | fi |
---|
5733 | |
---|
5734 | # Strip any trailing slash from the destination. |
---|
5735 | dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` |
---|
5736 | |
---|
5737 | # Check to see that the destination is a directory. |
---|
5738 | test -d "$dest" && isdir=yes |
---|
5739 | if test "$isdir" = yes; then |
---|
5740 | destdir="$dest" |
---|
5741 | destname= |
---|
5742 | else |
---|
5743 | destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` |
---|
5744 | test "X$destdir" = "X$dest" && destdir=. |
---|
5745 | destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` |
---|
5746 | |
---|
5747 | # Not a directory, so check to see that there is only one file specified. |
---|
5748 | set dummy $files |
---|
5749 | if test "$#" -gt 2; then |
---|
5750 | $echo "$modename: \`$dest' is not a directory" 1>&2 |
---|
5751 | $echo "$help" 1>&2 |
---|
5752 | exit $EXIT_FAILURE |
---|
5753 | fi |
---|
5754 | fi |
---|
5755 | case $destdir in |
---|
5756 | [\\/]* | [A-Za-z]:[\\/]*) ;; |
---|
5757 | *) |
---|
5758 | for file in $files; do |
---|
5759 | case $file in |
---|
5760 | *.lo) ;; |
---|
5761 | *) |
---|
5762 | $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 |
---|
5763 | $echo "$help" 1>&2 |
---|
5764 | exit $EXIT_FAILURE |
---|
5765 | ;; |
---|
5766 | esac |
---|
5767 | done |
---|
5768 | ;; |
---|
5769 | esac |
---|
5770 | |
---|
5771 | # This variable tells wrapper scripts just to set variables rather |
---|
5772 | # than running their programs. |
---|
5773 | libtool_install_magic="$magic" |
---|
5774 | |
---|
5775 | staticlibs= |
---|
5776 | future_libdirs= |
---|
5777 | current_libdirs= |
---|
5778 | for file in $files; do |
---|
5779 | |
---|
5780 | # Do each installation. |
---|
5781 | case $file in |
---|
5782 | *.$libext) |
---|
5783 | # Do the static libraries later. |
---|
5784 | staticlibs="$staticlibs $file" |
---|
5785 | ;; |
---|
5786 | |
---|
5787 | *.la) |
---|
5788 | # Check to see that this really is a libtool archive. |
---|
5789 | if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
---|
5790 | else |
---|
5791 | $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 |
---|
5792 | $echo "$help" 1>&2 |
---|
5793 | exit $EXIT_FAILURE |
---|
5794 | fi |
---|
5795 | |
---|
5796 | library_names= |
---|
5797 | old_library= |
---|
5798 | relink_command= |
---|
5799 | # If there is no directory component, then add one. |
---|
5800 | case $file in |
---|
5801 | */* | *\\*) . $file ;; |
---|
5802 | *) . ./$file ;; |
---|
5803 | esac |
---|
5804 | |
---|
5805 | # Add the libdir to current_libdirs if it is the destination. |
---|
5806 | if test "X$destdir" = "X$libdir"; then |
---|
5807 | case "$current_libdirs " in |
---|
5808 | *" $libdir "*) ;; |
---|
5809 | *) current_libdirs="$current_libdirs $libdir" ;; |
---|
5810 | esac |
---|
5811 | else |
---|
5812 | # Note the libdir as a future libdir. |
---|
5813 | case "$future_libdirs " in |
---|
5814 | *" $libdir "*) ;; |
---|
5815 | *) future_libdirs="$future_libdirs $libdir" ;; |
---|
5816 | esac |
---|
5817 | fi |
---|
5818 | |
---|
5819 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ |
---|
5820 | test "X$dir" = "X$file/" && dir= |
---|
5821 | dir="$dir$objdir" |
---|
5822 | |
---|
5823 | if test -n "$relink_command"; then |
---|
5824 | # Determine the prefix the user has applied to our future dir. |
---|
5825 | inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` |
---|
5826 | |
---|
5827 | # Don't allow the user to place us outside of our expected |
---|
5828 | # location b/c this prevents finding dependent libraries that |
---|
5829 | # are installed to the same prefix. |
---|
5830 | # At present, this check doesn't affect windows .dll's that |
---|
5831 | # are installed into $libdir/../bin (currently, that works fine) |
---|
5832 | # but it's something to keep an eye on. |
---|
5833 | if test "$inst_prefix_dir" = "$destdir"; then |
---|
5834 | $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 |
---|
5835 | exit $EXIT_FAILURE |
---|
5836 | fi |
---|
5837 | |
---|
5838 | if test -n "$inst_prefix_dir"; then |
---|
5839 | # Stick the inst_prefix_dir data into the link command. |
---|
5840 | relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` |
---|
5841 | else |
---|
5842 | relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` |
---|
5843 | fi |
---|
5844 | |
---|
5845 | $echo "$modename: warning: relinking \`$file'" 1>&2 |
---|
5846 | $show "$relink_command" |
---|
5847 | if $run eval "$relink_command"; then : |
---|
5848 | else |
---|
5849 | $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 |
---|
5850 | exit $EXIT_FAILURE |
---|
5851 | fi |
---|
5852 | fi |
---|
5853 | |
---|
5854 | # See the names of the shared library. |
---|
5855 | set dummy $library_names |
---|
5856 | if test -n "$2"; then |
---|
5857 | realname="$2" |
---|
5858 | shift |
---|
5859 | shift |
---|
5860 | |
---|
5861 | srcname="$realname" |
---|
5862 | test -n "$relink_command" && srcname="$realname"T |
---|
5863 | |
---|
5864 | # Install the shared library and build the symlinks. |
---|
5865 | $show "$install_prog $dir/$srcname $destdir/$realname" |
---|
5866 | $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? |
---|
5867 | if test -n "$stripme" && test -n "$striplib"; then |
---|
5868 | $show "$striplib $destdir/$realname" |
---|
5869 | $run eval "$striplib $destdir/$realname" || exit $? |
---|
5870 | fi |
---|
5871 | |
---|
5872 | if test "$#" -gt 0; then |
---|
5873 | # Delete the old symlinks, and create new ones. |
---|
5874 | for linkname |
---|
5875 | do |
---|
5876 | if test "$linkname" != "$realname"; then |
---|
5877 | $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" |
---|
5878 | $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" |
---|
5879 | fi |
---|
5880 | done |
---|
5881 | fi |
---|
5882 | |
---|
5883 | # Do each command in the postinstall commands. |
---|
5884 | lib="$destdir/$realname" |
---|
5885 | cmds=$postinstall_cmds |
---|
5886 | save_ifs="$IFS"; IFS='~' |
---|
5887 | for cmd in $cmds; do |
---|
5888 | IFS="$save_ifs" |
---|
5889 | eval cmd=\"$cmd\" |
---|
5890 | $show "$cmd" |
---|
5891 | $run eval "$cmd" || exit $? |
---|
5892 | done |
---|
5893 | IFS="$save_ifs" |
---|
5894 | fi |
---|
5895 | |
---|
5896 | # Install the pseudo-library for information purposes. |
---|
5897 | name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
---|
5898 | instname="$dir/$name"i |
---|
5899 | $show "$install_prog $instname $destdir/$name" |
---|
5900 | $run eval "$install_prog $instname $destdir/$name" || exit $? |
---|
5901 | |
---|
5902 | # Maybe install the static library, too. |
---|
5903 | test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" |
---|
5904 | ;; |
---|
5905 | |
---|
5906 | *.lo) |
---|
5907 | # Install (i.e. copy) a libtool object. |
---|
5908 | |
---|
5909 | # Figure out destination file name, if it wasn't already specified. |
---|
5910 | if test -n "$destname"; then |
---|
5911 | destfile="$destdir/$destname" |
---|
5912 | else |
---|
5913 | destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
---|
5914 | destfile="$destdir/$destfile" |
---|
5915 | fi |
---|
5916 | |
---|
5917 | # Deduce the name of the destination old-style object file. |
---|
5918 | case $destfile in |
---|
5919 | *.lo) |
---|
5920 | staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` |
---|
5921 | ;; |
---|
5922 | *.$objext) |
---|
5923 | staticdest="$destfile" |
---|
5924 | destfile= |
---|
5925 | ;; |
---|
5926 | *) |
---|
5927 | $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 |
---|
5928 | $echo "$help" 1>&2 |
---|
5929 | exit $EXIT_FAILURE |
---|
5930 | ;; |
---|
5931 | esac |
---|
5932 | |
---|
5933 | # Install the libtool object if requested. |
---|
5934 | if test -n "$destfile"; then |
---|
5935 | $show "$install_prog $file $destfile" |
---|
5936 | $run eval "$install_prog $file $destfile" || exit $? |
---|
5937 | fi |
---|
5938 | |
---|
5939 | # Install the old object if enabled. |
---|
5940 | if test "$build_old_libs" = yes; then |
---|
5941 | # Deduce the name of the old-style object file. |
---|
5942 | staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` |
---|
5943 | |
---|
5944 | $show "$install_prog $staticobj $staticdest" |
---|
5945 | $run eval "$install_prog \$staticobj \$staticdest" || exit $? |
---|
5946 | fi |
---|
5947 | exit $EXIT_SUCCESS |
---|
5948 | ;; |
---|
5949 | |
---|
5950 | *) |
---|
5951 | # Figure out destination file name, if it wasn't already specified. |
---|
5952 | if test -n "$destname"; then |
---|
5953 | destfile="$destdir/$destname" |
---|
5954 | else |
---|
5955 | destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
---|
5956 | destfile="$destdir/$destfile" |
---|
5957 | fi |
---|
5958 | |
---|
5959 | # If the file is missing, and there is a .exe on the end, strip it |
---|
5960 | # because it is most likely a libtool script we actually want to |
---|
5961 | # install |
---|
5962 | stripped_ext="" |
---|
5963 | case $file in |
---|
5964 | *.exe) |
---|
5965 | if test ! -f "$file"; then |
---|
5966 | file=`$echo $file|${SED} 's,.exe$,,'` |
---|
5967 | stripped_ext=".exe" |
---|
5968 | fi |
---|
5969 | ;; |
---|
5970 | esac |
---|
5971 | |
---|
5972 | # Do a test to see if this is really a libtool program. |
---|
5973 | case $host in |
---|
5974 | *cygwin*|*mingw*) |
---|
5975 | wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` |
---|
5976 | ;; |
---|
5977 | *) |
---|
5978 | wrapper=$file |
---|
5979 | ;; |
---|
5980 | esac |
---|
5981 | if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then |
---|
5982 | notinst_deplibs= |
---|
5983 | relink_command= |
---|
5984 | |
---|
5985 | # To insure that "foo" is sourced, and not "foo.exe", |
---|
5986 | # finese the cygwin/MSYS system by explicitly sourcing "foo." |
---|
5987 | # which disallows the automatic-append-.exe behavior. |
---|
5988 | case $build in |
---|
5989 | *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; |
---|
5990 | *) wrapperdot=${wrapper} ;; |
---|
5991 | esac |
---|
5992 | # If there is no directory component, then add one. |
---|
5993 | case $file in |
---|
5994 | */* | *\\*) . ${wrapperdot} ;; |
---|
5995 | *) . ./${wrapperdot} ;; |
---|
5996 | esac |
---|
5997 | |
---|
5998 | # Check the variables that should have been set. |
---|
5999 | if test -z "$notinst_deplibs"; then |
---|
6000 | $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 |
---|
6001 | exit $EXIT_FAILURE |
---|
6002 | fi |
---|
6003 | |
---|
6004 | finalize=yes |
---|
6005 | for lib in $notinst_deplibs; do |
---|
6006 | # Check to see that each library is installed. |
---|
6007 | libdir= |
---|
6008 | if test -f "$lib"; then |
---|
6009 | # If there is no directory component, then add one. |
---|
6010 | case $lib in |
---|
6011 | */* | *\\*) . $lib ;; |
---|
6012 | *) . ./$lib ;; |
---|
6013 | esac |
---|
6014 | fi |
---|
6015 | libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test |
---|
6016 | if test -n "$libdir" && test ! -f "$libfile"; then |
---|
6017 | $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 |
---|
6018 | finalize=no |
---|
6019 | fi |
---|
6020 | done |
---|
6021 | |
---|
6022 | relink_command= |
---|
6023 | # To insure that "foo" is sourced, and not "foo.exe", |
---|
6024 | # finese the cygwin/MSYS system by explicitly sourcing "foo." |
---|
6025 | # which disallows the automatic-append-.exe behavior. |
---|
6026 | case $build in |
---|
6027 | *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; |
---|
6028 | *) wrapperdot=${wrapper} ;; |
---|
6029 | esac |
---|
6030 | # If there is no directory component, then add one. |
---|
6031 | case $file in |
---|
6032 | */* | *\\*) . ${wrapperdot} ;; |
---|
6033 | *) . ./${wrapperdot} ;; |
---|
6034 | esac |
---|
6035 | |
---|
6036 | outputname= |
---|
6037 | if test "$fast_install" = no && test -n "$relink_command"; then |
---|
6038 | if test "$finalize" = yes && test -z "$run"; then |
---|
6039 | tmpdir="/tmp" |
---|
6040 | test -n "$TMPDIR" && tmpdir="$TMPDIR" |
---|
6041 | tmpdir="$tmpdir/libtool-$$" |
---|
6042 | save_umask=`umask` |
---|
6043 | umask 0077 |
---|
6044 | if $mkdir "$tmpdir"; then |
---|
6045 | umask $save_umask |
---|
6046 | else |
---|
6047 | umask $save_umask |
---|
6048 | $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 |
---|
6049 | continue |
---|
6050 | fi |
---|
6051 | file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` |
---|
6052 | outputname="$tmpdir/$file" |
---|
6053 | # Replace the output file specification. |
---|
6054 | relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` |
---|
6055 | |
---|
6056 | $show "$relink_command" |
---|
6057 | if $run eval "$relink_command"; then : |
---|
6058 | else |
---|
6059 | $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 |
---|
6060 | ${rm}r "$tmpdir" |
---|
6061 | continue |
---|
6062 | fi |
---|
6063 | file="$outputname" |
---|
6064 | else |
---|
6065 | $echo "$modename: warning: cannot relink \`$file'" 1>&2 |
---|
6066 | fi |
---|
6067 | else |
---|
6068 | # Install the binary that we compiled earlier. |
---|
6069 | file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` |
---|
6070 | fi |
---|
6071 | fi |
---|
6072 | |
---|
6073 | # remove .exe since cygwin /usr/bin/install will append another |
---|
6074 | # one anyways |
---|
6075 | case $install_prog,$host in |
---|
6076 | */usr/bin/install*,*cygwin*) |
---|
6077 | case $file:$destfile in |
---|
6078 | *.exe:*.exe) |
---|
6079 | # this is ok |
---|
6080 | ;; |
---|
6081 | *.exe:*) |
---|
6082 | destfile=$destfile.exe |
---|
6083 | ;; |
---|
6084 | *:*.exe) |
---|
6085 | destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` |
---|
6086 | ;; |
---|
6087 | esac |
---|
6088 | ;; |
---|
6089 | esac |
---|
6090 | $show "$install_prog$stripme $file $destfile" |
---|
6091 | $run eval "$install_prog\$stripme \$file \$destfile" || exit $? |
---|
6092 | test -n "$outputname" && ${rm}r "$tmpdir" |
---|
6093 | ;; |
---|
6094 | esac |
---|
6095 | done |
---|
6096 | |
---|
6097 | for file in $staticlibs; do |
---|
6098 | name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
---|
6099 | |
---|
6100 | # Set up the ranlib parameters. |
---|
6101 | oldlib="$destdir/$name" |
---|
6102 | |
---|
6103 | $show "$install_prog $file $oldlib" |
---|
6104 | $run eval "$install_prog \$file \$oldlib" || exit $? |
---|
6105 | |
---|
6106 | if test -n "$stripme" && test -n "$old_striplib"; then |
---|
6107 | $show "$old_striplib $oldlib" |
---|
6108 | $run eval "$old_striplib $oldlib" || exit $? |
---|
6109 | fi |
---|
6110 | |
---|
6111 | # Do each command in the postinstall commands. |
---|
6112 | cmds=$old_postinstall_cmds |
---|
6113 | save_ifs="$IFS"; IFS='~' |
---|
6114 | for cmd in $cmds; do |
---|
6115 | IFS="$save_ifs" |
---|
6116 | eval cmd=\"$cmd\" |
---|
6117 | $show "$cmd" |
---|
6118 | $run eval "$cmd" || exit $? |
---|
6119 | done |
---|
6120 | IFS="$save_ifs" |
---|
6121 | done |
---|
6122 | |
---|
6123 | if test -n "$future_libdirs"; then |
---|
6124 | $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 |
---|
6125 | fi |
---|
6126 | |
---|
6127 | if test -n "$current_libdirs"; then |
---|
6128 | # Maybe just do a dry run. |
---|
6129 | test -n "$run" && current_libdirs=" -n$current_libdirs" |
---|
6130 | exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' |
---|
6131 | else |
---|
6132 | exit $EXIT_SUCCESS |
---|
6133 | fi |
---|
6134 | ;; |
---|
6135 | |
---|
6136 | # libtool finish mode |
---|
6137 | finish) |
---|
6138 | modename="$modename: finish" |
---|
6139 | libdirs="$nonopt" |
---|
6140 | admincmds= |
---|
6141 | |
---|
6142 | if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then |
---|
6143 | for dir |
---|
6144 | do |
---|
6145 | libdirs="$libdirs $dir" |
---|
6146 | done |
---|
6147 | |
---|
6148 | for libdir in $libdirs; do |
---|
6149 | if test -n "$finish_cmds"; then |
---|
6150 | # Do each command in the finish commands. |
---|
6151 | cmds=$finish_cmds |
---|
6152 | save_ifs="$IFS"; IFS='~' |
---|
6153 | for cmd in $cmds; do |
---|
6154 | IFS="$save_ifs" |
---|
6155 | eval cmd=\"$cmd\" |
---|
6156 | $show "$cmd" |
---|
6157 | $run eval "$cmd" || admincmds="$admincmds |
---|
6158 | $cmd" |
---|
6159 | done |
---|
6160 | IFS="$save_ifs" |
---|
6161 | fi |
---|
6162 | if test -n "$finish_eval"; then |
---|
6163 | # Do the single finish_eval. |
---|
6164 | eval cmds=\"$finish_eval\" |
---|
6165 | $run eval "$cmds" || admincmds="$admincmds |
---|
6166 | $cmds" |
---|
6167 | fi |
---|
6168 | done |
---|
6169 | fi |
---|
6170 | |
---|
6171 | # Exit here if they wanted silent mode. |
---|
6172 | test "$show" = : && exit $EXIT_SUCCESS |
---|
6173 | |
---|
6174 | $echo "----------------------------------------------------------------------" |
---|
6175 | $echo "Libraries have been installed in:" |
---|
6176 | for libdir in $libdirs; do |
---|
6177 | $echo " $libdir" |
---|
6178 | done |
---|
6179 | $echo |
---|
6180 | $echo "If you ever happen to want to link against installed libraries" |
---|
6181 | $echo "in a given directory, LIBDIR, you must either use libtool, and" |
---|
6182 | $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" |
---|
6183 | $echo "flag during linking and do at least one of the following:" |
---|
6184 | if test -n "$shlibpath_var"; then |
---|
6185 | $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" |
---|
6186 | $echo " during execution" |
---|
6187 | fi |
---|
6188 | if test -n "$runpath_var"; then |
---|
6189 | $echo " - add LIBDIR to the \`$runpath_var' environment variable" |
---|
6190 | $echo " during linking" |
---|
6191 | fi |
---|
6192 | if test -n "$hardcode_libdir_flag_spec"; then |
---|
6193 | libdir=LIBDIR |
---|
6194 | eval flag=\"$hardcode_libdir_flag_spec\" |
---|
6195 | |
---|
6196 | $echo " - use the \`$flag' linker flag" |
---|
6197 | fi |
---|
6198 | if test -n "$admincmds"; then |
---|
6199 | $echo " - have your system administrator run these commands:$admincmds" |
---|
6200 | fi |
---|
6201 | if test -f /etc/ld.so.conf; then |
---|
6202 | $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" |
---|
6203 | fi |
---|
6204 | $echo |
---|
6205 | $echo "See any operating system documentation about shared libraries for" |
---|
6206 | $echo "more information, such as the ld(1) and ld.so(8) manual pages." |
---|
6207 | $echo "----------------------------------------------------------------------" |
---|
6208 | exit $EXIT_SUCCESS |
---|
6209 | ;; |
---|
6210 | |
---|
6211 | # libtool execute mode |
---|
6212 | execute) |
---|
6213 | modename="$modename: execute" |
---|
6214 | |
---|
6215 | # The first argument is the command name. |
---|
6216 | cmd="$nonopt" |
---|
6217 | if test -z "$cmd"; then |
---|
6218 | $echo "$modename: you must specify a COMMAND" 1>&2 |
---|
6219 | $echo "$help" |
---|
6220 | exit $EXIT_FAILURE |
---|
6221 | fi |
---|
6222 | |
---|
6223 | # Handle -dlopen flags immediately. |
---|
6224 | for file in $execute_dlfiles; do |
---|
6225 | if test ! -f "$file"; then |
---|
6226 | $echo "$modename: \`$file' is not a file" 1>&2 |
---|
6227 | $echo "$help" 1>&2 |
---|
6228 | exit $EXIT_FAILURE |
---|
6229 | fi |
---|
6230 | |
---|
6231 | dir= |
---|
6232 | case $file in |
---|
6233 | *.la) |
---|
6234 | # Check to see that this really is a libtool archive. |
---|
6235 | if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
---|
6236 | else |
---|
6237 | $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
---|
6238 | $echo "$help" 1>&2 |
---|
6239 | exit $EXIT_FAILURE |
---|
6240 | fi |
---|
6241 | |
---|
6242 | # Read the libtool library. |
---|
6243 | dlname= |
---|
6244 | library_names= |
---|
6245 | |
---|
6246 | # If there is no directory component, then add one. |
---|
6247 | case $file in |
---|
6248 | */* | *\\*) . $file ;; |
---|
6249 | *) . ./$file ;; |
---|
6250 | esac |
---|
6251 | |
---|
6252 | # Skip this library if it cannot be dlopened. |
---|
6253 | if test -z "$dlname"; then |
---|
6254 | # Warn if it was a shared library. |
---|
6255 | test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" |
---|
6256 | continue |
---|
6257 | fi |
---|
6258 | |
---|
6259 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` |
---|
6260 | test "X$dir" = "X$file" && dir=. |
---|
6261 | |
---|
6262 | if test -f "$dir/$objdir/$dlname"; then |
---|
6263 | dir="$dir/$objdir" |
---|
6264 | else |
---|
6265 | $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 |
---|
6266 | exit $EXIT_FAILURE |
---|
6267 | fi |
---|
6268 | ;; |
---|
6269 | |
---|
6270 | *.lo) |
---|
6271 | # Just add the directory containing the .lo file. |
---|
6272 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` |
---|
6273 | test "X$dir" = "X$file" && dir=. |
---|
6274 | ;; |
---|
6275 | |
---|
6276 | *) |
---|
6277 | $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 |
---|
6278 | continue |
---|
6279 | ;; |
---|
6280 | esac |
---|
6281 | |
---|
6282 | # Get the absolute pathname. |
---|
6283 | absdir=`cd "$dir" && pwd` |
---|
6284 | test -n "$absdir" && dir="$absdir" |
---|
6285 | |
---|
6286 | # Now add the directory to shlibpath_var. |
---|
6287 | if eval "test -z \"\$$shlibpath_var\""; then |
---|
6288 | eval "$shlibpath_var=\"\$dir\"" |
---|
6289 | else |
---|
6290 | eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" |
---|
6291 | fi |
---|
6292 | done |
---|
6293 | |
---|
6294 | # This variable tells wrapper scripts just to set shlibpath_var |
---|
6295 | # rather than running their programs. |
---|
6296 | libtool_execute_magic="$magic" |
---|
6297 | |
---|
6298 | # Check if any of the arguments is a wrapper script. |
---|
6299 | args= |
---|
6300 | for file |
---|
6301 | do |
---|
6302 | case $file in |
---|
6303 | -*) ;; |
---|
6304 | *) |
---|
6305 | # Do a test to see if this is really a libtool program. |
---|
6306 | if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
---|
6307 | # If there is no directory component, then add one. |
---|
6308 | case $file in |
---|
6309 | */* | *\\*) . $file ;; |
---|
6310 | *) . ./$file ;; |
---|
6311 | esac |
---|
6312 | |
---|
6313 | # Transform arg to wrapped name. |
---|
6314 | file="$progdir/$program" |
---|
6315 | fi |
---|
6316 | ;; |
---|
6317 | esac |
---|
6318 | # Quote arguments (to preserve shell metacharacters). |
---|
6319 | file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` |
---|
6320 | args="$args \"$file\"" |
---|
6321 | done |
---|
6322 | |
---|
6323 | if test -z "$run"; then |
---|
6324 | if test -n "$shlibpath_var"; then |
---|
6325 | # Export the shlibpath_var. |
---|
6326 | eval "export $shlibpath_var" |
---|
6327 | fi |
---|
6328 | |
---|
6329 | # Restore saved environment variables |
---|
6330 | if test "${save_LC_ALL+set}" = set; then |
---|
6331 | LC_ALL="$save_LC_ALL"; export LC_ALL |
---|
6332 | fi |
---|
6333 | if test "${save_LANG+set}" = set; then |
---|
6334 | LANG="$save_LANG"; export LANG |
---|
6335 | fi |
---|
6336 | |
---|
6337 | # Now prepare to actually exec the command. |
---|
6338 | exec_cmd="\$cmd$args" |
---|
6339 | else |
---|
6340 | # Display what would be done. |
---|
6341 | if test -n "$shlibpath_var"; then |
---|
6342 | eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" |
---|
6343 | $echo "export $shlibpath_var" |
---|
6344 | fi |
---|
6345 | $echo "$cmd$args" |
---|
6346 | exit $EXIT_SUCCESS |
---|
6347 | fi |
---|
6348 | ;; |
---|
6349 | |
---|
6350 | # libtool clean and uninstall mode |
---|
6351 | clean | uninstall) |
---|
6352 | modename="$modename: $mode" |
---|
6353 | rm="$nonopt" |
---|
6354 | files= |
---|
6355 | rmforce= |
---|
6356 | exit_status=0 |
---|
6357 | |
---|
6358 | # This variable tells wrapper scripts just to set variables rather |
---|
6359 | # than running their programs. |
---|
6360 | libtool_install_magic="$magic" |
---|
6361 | |
---|
6362 | for arg |
---|
6363 | do |
---|
6364 | case $arg in |
---|
6365 | -f) rm="$rm $arg"; rmforce=yes ;; |
---|
6366 | -*) rm="$rm $arg" ;; |
---|
6367 | *) files="$files $arg" ;; |
---|
6368 | esac |
---|
6369 | done |
---|
6370 | |
---|
6371 | if test -z "$rm"; then |
---|
6372 | $echo "$modename: you must specify an RM program" 1>&2 |
---|
6373 | $echo "$help" 1>&2 |
---|
6374 | exit $EXIT_FAILURE |
---|
6375 | fi |
---|
6376 | |
---|
6377 | rmdirs= |
---|
6378 | |
---|
6379 | origobjdir="$objdir" |
---|
6380 | for file in $files; do |
---|
6381 | dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` |
---|
6382 | if test "X$dir" = "X$file"; then |
---|
6383 | dir=. |
---|
6384 | objdir="$origobjdir" |
---|
6385 | else |
---|
6386 | objdir="$dir/$origobjdir" |
---|
6387 | fi |
---|
6388 | name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
---|
6389 | test "$mode" = uninstall && objdir="$dir" |
---|
6390 | |
---|
6391 | # Remember objdir for removal later, being careful to avoid duplicates |
---|
6392 | if test "$mode" = clean; then |
---|
6393 | case " $rmdirs " in |
---|
6394 | *" $objdir "*) ;; |
---|
6395 | *) rmdirs="$rmdirs $objdir" ;; |
---|
6396 | esac |
---|
6397 | fi |
---|
6398 | |
---|
6399 | # Don't error if the file doesn't exist and rm -f was used. |
---|
6400 | if (test -L "$file") >/dev/null 2>&1 \ |
---|
6401 | || (test -h "$file") >/dev/null 2>&1 \ |
---|
6402 | || test -f "$file"; then |
---|
6403 | : |
---|
6404 | elif test -d "$file"; then |
---|
6405 | exit_status=1 |
---|
6406 | continue |
---|
6407 | elif test "$rmforce" = yes; then |
---|
6408 | continue |
---|
6409 | fi |
---|
6410 | |
---|
6411 | rmfiles="$file" |
---|
6412 | |
---|
6413 | case $name in |
---|
6414 | *.la) |
---|
6415 | # Possibly a libtool archive, so verify it. |
---|
6416 | if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
---|
6417 | . $dir/$name |
---|
6418 | |
---|
6419 | # Delete the libtool libraries and symlinks. |
---|
6420 | for n in $library_names; do |
---|
6421 | rmfiles="$rmfiles $objdir/$n" |
---|
6422 | done |
---|
6423 | test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" |
---|
6424 | test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" |
---|
6425 | |
---|
6426 | if test "$mode" = uninstall; then |
---|
6427 | if test -n "$library_names"; then |
---|
6428 | # Do each command in the postuninstall commands. |
---|
6429 | cmds=$postuninstall_cmds |
---|
6430 | save_ifs="$IFS"; IFS='~' |
---|
6431 | for cmd in $cmds; do |
---|
6432 | IFS="$save_ifs" |
---|
6433 | eval cmd=\"$cmd\" |
---|
6434 | $show "$cmd" |
---|
6435 | $run eval "$cmd" |
---|
6436 | if test "$?" -ne 0 && test "$rmforce" != yes; then |
---|
6437 | exit_status=1 |
---|
6438 | fi |
---|
6439 | done |
---|
6440 | IFS="$save_ifs" |
---|
6441 | fi |
---|
6442 | |
---|
6443 | if test -n "$old_library"; then |
---|
6444 | # Do each command in the old_postuninstall commands. |
---|
6445 | cmds=$old_postuninstall_cmds |
---|
6446 | save_ifs="$IFS"; IFS='~' |
---|
6447 | for cmd in $cmds; do |
---|
6448 | IFS="$save_ifs" |
---|
6449 | eval cmd=\"$cmd\" |
---|
6450 | $show "$cmd" |
---|
6451 | $run eval "$cmd" |
---|
6452 | if test "$?" -ne 0 && test "$rmforce" != yes; then |
---|
6453 | exit_status=1 |
---|
6454 | fi |
---|
6455 | done |
---|
6456 | IFS="$save_ifs" |
---|
6457 | fi |
---|
6458 | # FIXME: should reinstall the best remaining shared library. |
---|
6459 | fi |
---|
6460 | fi |
---|
6461 | ;; |
---|
6462 | |
---|
6463 | *.lo) |
---|
6464 | # Possibly a libtool object, so verify it. |
---|
6465 | if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
---|
6466 | |
---|
6467 | # Read the .lo file |
---|
6468 | . $dir/$name |
---|
6469 | |
---|
6470 | # Add PIC object to the list of files to remove. |
---|
6471 | if test -n "$pic_object" \ |
---|
6472 | && test "$pic_object" != none; then |
---|
6473 | rmfiles="$rmfiles $dir/$pic_object" |
---|
6474 | fi |
---|
6475 | |
---|
6476 | # Add non-PIC object to the list of files to remove. |
---|
6477 | if test -n "$non_pic_object" \ |
---|
6478 | && test "$non_pic_object" != none; then |
---|
6479 | rmfiles="$rmfiles $dir/$non_pic_object" |
---|
6480 | fi |
---|
6481 | fi |
---|
6482 | ;; |
---|
6483 | |
---|
6484 | *) |
---|
6485 | if test "$mode" = clean ; then |
---|
6486 | noexename=$name |
---|
6487 | case $file in |
---|
6488 | *.exe) |
---|
6489 | file=`$echo $file|${SED} 's,.exe$,,'` |
---|
6490 | noexename=`$echo $name|${SED} 's,.exe$,,'` |
---|
6491 | # $file with .exe has already been added to rmfiles, |
---|
6492 | # add $file without .exe |
---|
6493 | rmfiles="$rmfiles $file" |
---|
6494 | ;; |
---|
6495 | esac |
---|
6496 | # Do a test to see if this is a libtool program. |
---|
6497 | if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
---|
6498 | relink_command= |
---|
6499 | . $dir/$noexename |
---|
6500 | |
---|
6501 | # note $name still contains .exe if it was in $file originally |
---|
6502 | # as does the version of $file that was added into $rmfiles |
---|
6503 | rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" |
---|
6504 | if test "$fast_install" = yes && test -n "$relink_command"; then |
---|
6505 | rmfiles="$rmfiles $objdir/lt-$name" |
---|
6506 | fi |
---|
6507 | if test "X$noexename" != "X$name" ; then |
---|
6508 | rmfiles="$rmfiles $objdir/lt-${noexename}.c" |
---|
6509 | fi |
---|
6510 | fi |
---|
6511 | fi |
---|
6512 | ;; |
---|
6513 | esac |
---|
6514 | $show "$rm $rmfiles" |
---|
6515 | $run $rm $rmfiles || exit_status=1 |
---|
6516 | done |
---|
6517 | objdir="$origobjdir" |
---|
6518 | |
---|
6519 | # Try to remove the ${objdir}s in the directories where we deleted files |
---|
6520 | for dir in $rmdirs; do |
---|
6521 | if test -d "$dir"; then |
---|
6522 | $show "rmdir $dir" |
---|
6523 | $run rmdir $dir >/dev/null 2>&1 |
---|
6524 | fi |
---|
6525 | done |
---|
6526 | |
---|
6527 | exit $exit_status |
---|
6528 | ;; |
---|
6529 | |
---|
6530 | "") |
---|
6531 | $echo "$modename: you must specify a MODE" 1>&2 |
---|
6532 | $echo "$generic_help" 1>&2 |
---|
6533 | exit $EXIT_FAILURE |
---|
6534 | ;; |
---|
6535 | esac |
---|
6536 | |
---|
6537 | if test -z "$exec_cmd"; then |
---|
6538 | $echo "$modename: invalid operation mode \`$mode'" 1>&2 |
---|
6539 | $echo "$generic_help" 1>&2 |
---|
6540 | exit $EXIT_FAILURE |
---|
6541 | fi |
---|
6542 | fi # test -z "$show_help" |
---|
6543 | |
---|
6544 | if test -n "$exec_cmd"; then |
---|
6545 | eval exec $exec_cmd |
---|
6546 | exit $EXIT_FAILURE |
---|
6547 | fi |
---|
6548 | |
---|
6549 | # We need to display help for each of the modes. |
---|
6550 | case $mode in |
---|
6551 | "") $echo \ |
---|
6552 | "Usage: $modename [OPTION]... [MODE-ARG]... |
---|
6553 | |
---|
6554 | Provide generalized library-building support services. |
---|
6555 | |
---|
6556 | --config show all configuration variables |
---|
6557 | --debug enable verbose shell tracing |
---|
6558 | -n, --dry-run display commands without modifying any files |
---|
6559 | --features display basic configuration information and exit |
---|
6560 | --finish same as \`--mode=finish' |
---|
6561 | --help display this help message and exit |
---|
6562 | --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] |
---|
6563 | --quiet same as \`--silent' |
---|
6564 | --silent don't print informational messages |
---|
6565 | --tag=TAG use configuration variables from tag TAG |
---|
6566 | --version print version information |
---|
6567 | |
---|
6568 | MODE must be one of the following: |
---|
6569 | |
---|
6570 | clean remove files from the build directory |
---|
6571 | compile compile a source file into a libtool object |
---|
6572 | execute automatically set library path, then run a program |
---|
6573 | finish complete the installation of libtool libraries |
---|
6574 | install install libraries or executables |
---|
6575 | link create a library or an executable |
---|
6576 | uninstall remove libraries from an installed directory |
---|
6577 | |
---|
6578 | MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for |
---|
6579 | a more detailed description of MODE. |
---|
6580 | |
---|
6581 | Report bugs to <bug-libtool@gnu.org>." |
---|
6582 | exit $EXIT_SUCCESS |
---|
6583 | ;; |
---|
6584 | |
---|
6585 | clean) |
---|
6586 | $echo \ |
---|
6587 | "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... |
---|
6588 | |
---|
6589 | Remove files from the build directory. |
---|
6590 | |
---|
6591 | RM is the name of the program to use to delete files associated with each FILE |
---|
6592 | (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed |
---|
6593 | to RM. |
---|
6594 | |
---|
6595 | If FILE is a libtool library, object or program, all the files associated |
---|
6596 | with it are deleted. Otherwise, only FILE itself is deleted using RM." |
---|
6597 | ;; |
---|
6598 | |
---|
6599 | compile) |
---|
6600 | $echo \ |
---|
6601 | "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE |
---|
6602 | |
---|
6603 | Compile a source file into a libtool library object. |
---|
6604 | |
---|
6605 | This mode accepts the following additional options: |
---|
6606 | |
---|
6607 | -o OUTPUT-FILE set the output file name to OUTPUT-FILE |
---|
6608 | -prefer-pic try to building PIC objects only |
---|
6609 | -prefer-non-pic try to building non-PIC objects only |
---|
6610 | -static always build a \`.o' file suitable for static linking |
---|
6611 | |
---|
6612 | COMPILE-COMMAND is a command to be used in creating a \`standard' object file |
---|
6613 | from the given SOURCEFILE. |
---|
6614 | |
---|
6615 | The output file name is determined by removing the directory component from |
---|
6616 | SOURCEFILE, then substituting the C source code suffix \`.c' with the |
---|
6617 | library object suffix, \`.lo'." |
---|
6618 | ;; |
---|
6619 | |
---|
6620 | execute) |
---|
6621 | $echo \ |
---|
6622 | "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... |
---|
6623 | |
---|
6624 | Automatically set library path, then run a program. |
---|
6625 | |
---|
6626 | This mode accepts the following additional options: |
---|
6627 | |
---|
6628 | -dlopen FILE add the directory containing FILE to the library path |
---|
6629 | |
---|
6630 | This mode sets the library path environment variable according to \`-dlopen' |
---|
6631 | flags. |
---|
6632 | |
---|
6633 | If any of the ARGS are libtool executable wrappers, then they are translated |
---|
6634 | into their corresponding uninstalled binary, and any of their required library |
---|
6635 | directories are added to the library path. |
---|
6636 | |
---|
6637 | Then, COMMAND is executed, with ARGS as arguments." |
---|
6638 | ;; |
---|
6639 | |
---|
6640 | finish) |
---|
6641 | $echo \ |
---|
6642 | "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... |
---|
6643 | |
---|
6644 | Complete the installation of libtool libraries. |
---|
6645 | |
---|
6646 | Each LIBDIR is a directory that contains libtool libraries. |
---|
6647 | |
---|
6648 | The commands that this mode executes may require superuser privileges. Use |
---|
6649 | the \`--dry-run' option if you just want to see what would be executed." |
---|
6650 | ;; |
---|
6651 | |
---|
6652 | install) |
---|
6653 | $echo \ |
---|
6654 | "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... |
---|
6655 | |
---|
6656 | Install executables or libraries. |
---|
6657 | |
---|
6658 | INSTALL-COMMAND is the installation command. The first component should be |
---|
6659 | either the \`install' or \`cp' program. |
---|
6660 | |
---|
6661 | The rest of the components are interpreted as arguments to that command (only |
---|
6662 | BSD-compatible install options are recognized)." |
---|
6663 | ;; |
---|
6664 | |
---|
6665 | link) |
---|
6666 | $echo \ |
---|
6667 | "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... |
---|
6668 | |
---|
6669 | Link object files or libraries together to form another library, or to |
---|
6670 | create an executable program. |
---|
6671 | |
---|
6672 | LINK-COMMAND is a command using the C compiler that you would use to create |
---|
6673 | a program from several object files. |
---|
6674 | |
---|
6675 | The following components of LINK-COMMAND are treated specially: |
---|
6676 | |
---|
6677 | -all-static do not do any dynamic linking at all |
---|
6678 | -avoid-version do not add a version suffix if possible |
---|
6679 | -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime |
---|
6680 | -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols |
---|
6681 | -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) |
---|
6682 | -export-symbols SYMFILE |
---|
6683 | try to export only the symbols listed in SYMFILE |
---|
6684 | -export-symbols-regex REGEX |
---|
6685 | try to export only the symbols matching REGEX |
---|
6686 | -LLIBDIR search LIBDIR for required installed libraries |
---|
6687 | -lNAME OUTPUT-FILE requires the installed library libNAME |
---|
6688 | -module build a library that can dlopened |
---|
6689 | -no-fast-install disable the fast-install mode |
---|
6690 | -no-install link a not-installable executable |
---|
6691 | -no-undefined declare that a library does not refer to external symbols |
---|
6692 | -o OUTPUT-FILE create OUTPUT-FILE from the specified objects |
---|
6693 | -objectlist FILE Use a list of object files found in FILE to specify objects |
---|
6694 | -precious-files-regex REGEX |
---|
6695 | don't remove output files matching REGEX |
---|
6696 | -release RELEASE specify package release information |
---|
6697 | -rpath LIBDIR the created library will eventually be installed in LIBDIR |
---|
6698 | -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries |
---|
6699 | -static do not do any dynamic linking of libtool libraries |
---|
6700 | -version-info CURRENT[:REVISION[:AGE]] |
---|
6701 | specify library version info [each variable defaults to 0] |
---|
6702 | |
---|
6703 | All other options (arguments beginning with \`-') are ignored. |
---|
6704 | |
---|
6705 | Every other argument is treated as a filename. Files ending in \`.la' are |
---|
6706 | treated as uninstalled libtool libraries, other files are standard or library |
---|
6707 | object files. |
---|
6708 | |
---|
6709 | If the OUTPUT-FILE ends in \`.la', then a libtool library is created, |
---|
6710 | only library objects (\`.lo' files) may be specified, and \`-rpath' is |
---|
6711 | required, except when creating a convenience library. |
---|
6712 | |
---|
6713 | If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created |
---|
6714 | using \`ar' and \`ranlib', or on Windows using \`lib'. |
---|
6715 | |
---|
6716 | If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file |
---|
6717 | is created, otherwise an executable program is created." |
---|
6718 | ;; |
---|
6719 | |
---|
6720 | uninstall) |
---|
6721 | $echo \ |
---|
6722 | "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... |
---|
6723 | |
---|
6724 | Remove libraries from an installation directory. |
---|
6725 | |
---|
6726 | RM is the name of the program to use to delete files associated with each FILE |
---|
6727 | (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed |
---|
6728 | to RM. |
---|
6729 | |
---|
6730 | If FILE is a libtool library, all the files associated with it are deleted. |
---|
6731 | Otherwise, only FILE itself is deleted using RM." |
---|
6732 | ;; |
---|
6733 | |
---|
6734 | *) |
---|
6735 | $echo "$modename: invalid operation mode \`$mode'" 1>&2 |
---|
6736 | $echo "$help" 1>&2 |
---|
6737 | exit $EXIT_FAILURE |
---|
6738 | ;; |
---|
6739 | esac |
---|
6740 | |
---|
6741 | $echo |
---|
6742 | $echo "Try \`$modename --help' for more information about other modes." |
---|
6743 | |
---|
6744 | exit $EXIT_SUCCESS |
---|
6745 | |
---|
6746 | # The TAGs below are defined such that we never get into a situation |
---|
6747 | # in which we disable both kinds of libraries. Given conflicting |
---|
6748 | # choices, we go for a static library, that is the most portable, |
---|
6749 | # since we can't tell whether shared libraries were disabled because |
---|
6750 | # the user asked for that or because the platform doesn't support |
---|
6751 | # them. This is particularly important on AIX, because we don't |
---|
6752 | # support having both static and shared libraries enabled at the same |
---|
6753 | # time on that platform, so we default to a shared-only configuration. |
---|
6754 | # If a disable-shared tag is given, we'll fallback to a static-only |
---|
6755 | # configuration. But we'll never go from static-only to shared-only. |
---|
6756 | |
---|
6757 | # ### BEGIN LIBTOOL TAG CONFIG: disable-shared |
---|
6758 | build_libtool_libs=no |
---|
6759 | build_old_libs=yes |
---|
6760 | # ### END LIBTOOL TAG CONFIG: disable-shared |
---|
6761 | |
---|
6762 | # ### BEGIN LIBTOOL TAG CONFIG: disable-static |
---|
6763 | build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` |
---|
6764 | # ### END LIBTOOL TAG CONFIG: disable-static |
---|
6765 | |
---|
6766 | # Local Variables: |
---|
6767 | # mode:shell-script |
---|
6768 | # sh-indentation:2 |
---|
6769 | # End: |
---|
6770 | # ### BEGIN LIBTOOL TAG CONFIG: CXX |
---|
6771 | |
---|
6772 | # Libtool was configured on host red-herring.mit.edu: |
---|
6773 | |
---|
6774 | # Shell to use when invoking shell scripts. |
---|
6775 | SHELL="/bin/sh" |
---|
6776 | |
---|
6777 | # Whether or not to build shared libraries. |
---|
6778 | build_libtool_libs=yes |
---|
6779 | |
---|
6780 | # Whether or not to build static libraries. |
---|
6781 | build_old_libs=yes |
---|
6782 | |
---|
6783 | # Whether or not to add -lc for building shared libraries. |
---|
6784 | build_libtool_need_lc=no |
---|
6785 | |
---|
6786 | # Whether or not to disallow shared libs when runtime libs are static |
---|
6787 | allow_libtool_libs_with_static_runtimes=no |
---|
6788 | |
---|
6789 | # Whether or not to optimize for fast installation. |
---|
6790 | fast_install=yes |
---|
6791 | |
---|
6792 | # The host system. |
---|
6793 | host_alias= |
---|
6794 | host=i686-redhat-linux-gnu |
---|
6795 | |
---|
6796 | # An echo program that does not interpret backslashes. |
---|
6797 | echo="echo" |
---|
6798 | |
---|
6799 | # The archiver. |
---|
6800 | AR="ar" |
---|
6801 | AR_FLAGS="cru" |
---|
6802 | |
---|
6803 | # A C compiler. |
---|
6804 | LTCC="gcc" |
---|
6805 | |
---|
6806 | # A language-specific compiler. |
---|
6807 | CC="g++" |
---|
6808 | |
---|
6809 | # Is the compiler the GNU C compiler? |
---|
6810 | with_gcc=yes |
---|
6811 | |
---|
6812 | # An ERE matcher. |
---|
6813 | EGREP="grep -E" |
---|
6814 | |
---|
6815 | # The linker used to build libraries. |
---|
6816 | LD="/usr/bin/ld" |
---|
6817 | |
---|
6818 | # Whether we need hard or soft links. |
---|
6819 | LN_S="ln -s" |
---|
6820 | |
---|
6821 | # A BSD-compatible nm program. |
---|
6822 | NM="/usr/bin/nm -B" |
---|
6823 | |
---|
6824 | # A symbol stripping program |
---|
6825 | STRIP="strip" |
---|
6826 | |
---|
6827 | # Used to examine libraries when file_magic_cmd begins "file" |
---|
6828 | MAGIC_CMD=file |
---|
6829 | |
---|
6830 | # Used on cygwin: DLL creation program. |
---|
6831 | DLLTOOL="dlltool" |
---|
6832 | |
---|
6833 | # Used on cygwin: object dumper. |
---|
6834 | OBJDUMP="objdump" |
---|
6835 | |
---|
6836 | # Used on cygwin: assembler. |
---|
6837 | AS="as" |
---|
6838 | |
---|
6839 | # The name of the directory that contains temporary libtool files. |
---|
6840 | objdir=.libs |
---|
6841 | |
---|
6842 | # How to create reloadable object files. |
---|
6843 | reload_flag=" -r" |
---|
6844 | reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" |
---|
6845 | |
---|
6846 | # How to pass a linker flag through the compiler. |
---|
6847 | wl="-Wl," |
---|
6848 | |
---|
6849 | # Object file suffix (normally "o"). |
---|
6850 | objext="o" |
---|
6851 | |
---|
6852 | # Old archive suffix (normally "a"). |
---|
6853 | libext="a" |
---|
6854 | |
---|
6855 | # Shared library suffix (normally ".so"). |
---|
6856 | shrext_cmds='.so' |
---|
6857 | |
---|
6858 | # Executable file suffix (normally ""). |
---|
6859 | exeext="" |
---|
6860 | |
---|
6861 | # Additional compiler flags for building library objects. |
---|
6862 | pic_flag=" -fPIC -DPIC" |
---|
6863 | pic_mode=default |
---|
6864 | |
---|
6865 | # What is the maximum length of a command? |
---|
6866 | max_cmd_len=32768 |
---|
6867 | |
---|
6868 | # Does compiler simultaneously support -c and -o options? |
---|
6869 | compiler_c_o="yes" |
---|
6870 | |
---|
6871 | # Must we lock files when doing compilation ? |
---|
6872 | need_locks="no" |
---|
6873 | |
---|
6874 | # Do we need the lib prefix for modules? |
---|
6875 | need_lib_prefix=no |
---|
6876 | |
---|
6877 | # Do we need a version for libraries? |
---|
6878 | need_version=no |
---|
6879 | |
---|
6880 | # Whether dlopen is supported. |
---|
6881 | dlopen_support=unknown |
---|
6882 | |
---|
6883 | # Whether dlopen of programs is supported. |
---|
6884 | dlopen_self=unknown |
---|
6885 | |
---|
6886 | # Whether dlopen of statically linked programs is supported. |
---|
6887 | dlopen_self_static=unknown |
---|
6888 | |
---|
6889 | # Compiler flag to prevent dynamic linking. |
---|
6890 | link_static_flag="-static" |
---|
6891 | |
---|
6892 | # Compiler flag to turn off builtin functions. |
---|
6893 | no_builtin_flag=" -fno-builtin" |
---|
6894 | |
---|
6895 | # Compiler flag to allow reflexive dlopens. |
---|
6896 | export_dynamic_flag_spec="\${wl}--export-dynamic" |
---|
6897 | |
---|
6898 | # Compiler flag to generate shared objects directly from archives. |
---|
6899 | whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" |
---|
6900 | |
---|
6901 | # Compiler flag to generate thread-safe objects. |
---|
6902 | thread_safe_flag_spec="" |
---|
6903 | |
---|
6904 | # Library versioning type. |
---|
6905 | version_type=linux |
---|
6906 | |
---|
6907 | # Format of library name prefix. |
---|
6908 | libname_spec="lib\$name" |
---|
6909 | |
---|
6910 | # List of archive names. First name is the real one, the rest are links. |
---|
6911 | # The last name is the one that the linker finds with -lNAME. |
---|
6912 | library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}" |
---|
6913 | |
---|
6914 | # The coded name of the library, if different from the real name. |
---|
6915 | soname_spec="\${libname}\${release}\${shared_ext}\$major" |
---|
6916 | |
---|
6917 | # Commands used to build and install an old-style archive. |
---|
6918 | RANLIB="ranlib" |
---|
6919 | old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib" |
---|
6920 | old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib" |
---|
6921 | old_postuninstall_cmds="" |
---|
6922 | |
---|
6923 | # Create an old-style archive from a shared archive. |
---|
6924 | old_archive_from_new_cmds="" |
---|
6925 | |
---|
6926 | # Create a temporary old-style archive to link instead of a shared archive. |
---|
6927 | old_archive_from_expsyms_cmds="" |
---|
6928 | |
---|
6929 | # Commands used to build and install a shared archive. |
---|
6930 | archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" |
---|
6931 | archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib" |
---|
6932 | postinstall_cmds="" |
---|
6933 | postuninstall_cmds="" |
---|
6934 | |
---|
6935 | # Commands used to build a loadable module (assumed same as above if empty) |
---|
6936 | module_cmds="" |
---|
6937 | module_expsym_cmds="" |
---|
6938 | |
---|
6939 | # Commands to strip libraries. |
---|
6940 | old_striplib="strip --strip-debug" |
---|
6941 | striplib="strip --strip-unneeded" |
---|
6942 | |
---|
6943 | # Dependencies to place before the objects being linked to create a |
---|
6944 | # shared library. |
---|
6945 | predep_objects="/usr/lib/gcc/i386-redhat-linux/3.4.6/../../../crti.o /usr/lib/gcc/i386-redhat-linux/3.4.6/crtbeginS.o" |
---|
6946 | |
---|
6947 | # Dependencies to place after the objects being linked to create a |
---|
6948 | # shared library. |
---|
6949 | postdep_objects="/usr/lib/gcc/i386-redhat-linux/3.4.6/crtendS.o /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../crtn.o" |
---|
6950 | |
---|
6951 | # Dependencies to place before the objects being linked to create a |
---|
6952 | # shared library. |
---|
6953 | predeps="" |
---|
6954 | |
---|
6955 | # Dependencies to place after the objects being linked to create a |
---|
6956 | # shared library. |
---|
6957 | postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s" |
---|
6958 | |
---|
6959 | # The library search path used internally by the compiler when linking |
---|
6960 | # a shared library. |
---|
6961 | compiler_lib_search_path="-L/usr/lib/gcc/i386-redhat-linux/3.4.6 -L/usr/lib/gcc/i386-redhat-linux/3.4.6 -L/usr/lib/gcc/i386-redhat-linux/3.4.6/../../.." |
---|
6962 | |
---|
6963 | # Method to check whether dependent libraries are shared objects. |
---|
6964 | deplibs_check_method="pass_all" |
---|
6965 | |
---|
6966 | # Command to use when deplibs_check_method == file_magic. |
---|
6967 | file_magic_cmd="\$MAGIC_CMD" |
---|
6968 | |
---|
6969 | # Flag that allows shared libraries with undefined symbols to be built. |
---|
6970 | allow_undefined_flag="" |
---|
6971 | |
---|
6972 | # Flag that forces no undefined symbols. |
---|
6973 | no_undefined_flag="" |
---|
6974 | |
---|
6975 | # Commands used to finish a libtool library installation in a directory. |
---|
6976 | finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" |
---|
6977 | |
---|
6978 | # Same as above, but a single script fragment to be evaled but not shown. |
---|
6979 | finish_eval="" |
---|
6980 | |
---|
6981 | # Take the output of nm and produce a listing of raw symbols and C names. |
---|
6982 | global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" |
---|
6983 | |
---|
6984 | # Transform the output of nm in a proper C declaration |
---|
6985 | global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" |
---|
6986 | |
---|
6987 | # Transform the output of nm in a C name address pair |
---|
6988 | global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" |
---|
6989 | |
---|
6990 | # This is the shared library runtime path variable. |
---|
6991 | runpath_var=LD_RUN_PATH |
---|
6992 | |
---|
6993 | # This is the shared library path variable. |
---|
6994 | shlibpath_var=LD_LIBRARY_PATH |
---|
6995 | |
---|
6996 | # Is shlibpath searched before the hard-coded library search path? |
---|
6997 | shlibpath_overrides_runpath=no |
---|
6998 | |
---|
6999 | # How to hardcode a shared library path into an executable. |
---|
7000 | hardcode_action=immediate |
---|
7001 | |
---|
7002 | # Whether we should hardcode library paths into libraries. |
---|
7003 | hardcode_into_libs=yes |
---|
7004 | |
---|
7005 | # Flag to hardcode $libdir into a binary during linking. |
---|
7006 | # This must work even if $libdir does not exist. |
---|
7007 | hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" |
---|
7008 | |
---|
7009 | # If ld is used when linking, flag to hardcode $libdir into |
---|
7010 | # a binary during linking. This must work even if $libdir does |
---|
7011 | # not exist. |
---|
7012 | hardcode_libdir_flag_spec_ld="" |
---|
7013 | |
---|
7014 | # Whether we need a single -rpath flag with a separated argument. |
---|
7015 | hardcode_libdir_separator="" |
---|
7016 | |
---|
7017 | # Set to yes if using DIR/libNAME during linking hardcodes DIR into the |
---|
7018 | # resulting binary. |
---|
7019 | hardcode_direct=no |
---|
7020 | |
---|
7021 | # Set to yes if using the -LDIR flag during linking hardcodes DIR into the |
---|
7022 | # resulting binary. |
---|
7023 | hardcode_minus_L=no |
---|
7024 | |
---|
7025 | # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into |
---|
7026 | # the resulting binary. |
---|
7027 | hardcode_shlibpath_var= |
---|
7028 | |
---|
7029 | # Set to yes if building a shared library automatically hardcodes DIR into the library |
---|
7030 | # and all subsequent libraries and executables linked against it. |
---|
7031 | hardcode_automatic=no |
---|
7032 | |
---|
7033 | # Variables whose values should be saved in libtool wrapper scripts and |
---|
7034 | # restored at relink time. |
---|
7035 | variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" |
---|
7036 | |
---|
7037 | # Whether libtool must link a program against all its dependency libraries. |
---|
7038 | link_all_deplibs=unknown |
---|
7039 | |
---|
7040 | # Compile-time system search path for libraries |
---|
7041 | sys_lib_search_path_spec=" /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../ /lib/i386-redhat-linux/3.4.6/ /lib/ /usr/lib/i386-redhat-linux/3.4.6/ /usr/lib/" |
---|
7042 | |
---|
7043 | # Run-time system search path for libraries |
---|
7044 | sys_lib_dlsearch_path_spec="/lib /usr/lib include ld.so.conf.d/*.conf /usr/i486-linux-libc5/lib /usr/athena/lib " |
---|
7045 | |
---|
7046 | # Fix the shell variable $srcfile for the compiler. |
---|
7047 | fix_srcfile_path="" |
---|
7048 | |
---|
7049 | # Set to yes if exported symbols are required. |
---|
7050 | always_export_symbols=no |
---|
7051 | |
---|
7052 | # The commands to list exported symbols. |
---|
7053 | export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" |
---|
7054 | |
---|
7055 | # The commands to extract the exported symbol list from a shared archive. |
---|
7056 | extract_expsyms_cmds="" |
---|
7057 | |
---|
7058 | # Symbols that should not be listed in the preloaded symbols. |
---|
7059 | exclude_expsyms="" |
---|
7060 | |
---|
7061 | # Symbols that must always be exported. |
---|
7062 | include_expsyms="" |
---|
7063 | |
---|
7064 | # ### END LIBTOOL TAG CONFIG: CXX |
---|
7065 | |
---|
7066 | # ### BEGIN LIBTOOL TAG CONFIG: F77 |
---|
7067 | |
---|
7068 | # Libtool was configured on host red-herring.mit.edu: |
---|
7069 | |
---|
7070 | # Shell to use when invoking shell scripts. |
---|
7071 | SHELL="/bin/sh" |
---|
7072 | |
---|
7073 | # Whether or not to build shared libraries. |
---|
7074 | build_libtool_libs=yes |
---|
7075 | |
---|
7076 | # Whether or not to build static libraries. |
---|
7077 | build_old_libs=yes |
---|
7078 | |
---|
7079 | # Whether or not to add -lc for building shared libraries. |
---|
7080 | build_libtool_need_lc=no |
---|
7081 | |
---|
7082 | # Whether or not to disallow shared libs when runtime libs are static |
---|
7083 | allow_libtool_libs_with_static_runtimes=no |
---|
7084 | |
---|
7085 | # Whether or not to optimize for fast installation. |
---|
7086 | fast_install=yes |
---|
7087 | |
---|
7088 | # The host system. |
---|
7089 | host_alias= |
---|
7090 | host=i686-redhat-linux-gnu |
---|
7091 | |
---|
7092 | # An echo program that does not interpret backslashes. |
---|
7093 | echo="echo" |
---|
7094 | |
---|
7095 | # The archiver. |
---|
7096 | AR="ar" |
---|
7097 | AR_FLAGS="cru" |
---|
7098 | |
---|
7099 | # A C compiler. |
---|
7100 | LTCC="gcc" |
---|
7101 | |
---|
7102 | # A language-specific compiler. |
---|
7103 | CC="g77" |
---|
7104 | |
---|
7105 | # Is the compiler the GNU C compiler? |
---|
7106 | with_gcc=yes |
---|
7107 | |
---|
7108 | # An ERE matcher. |
---|
7109 | EGREP="grep -E" |
---|
7110 | |
---|
7111 | # The linker used to build libraries. |
---|
7112 | LD="/usr/bin/ld" |
---|
7113 | |
---|
7114 | # Whether we need hard or soft links. |
---|
7115 | LN_S="ln -s" |
---|
7116 | |
---|
7117 | # A BSD-compatible nm program. |
---|
7118 | NM="/usr/bin/nm -B" |
---|
7119 | |
---|
7120 | # A symbol stripping program |
---|
7121 | STRIP="strip" |
---|
7122 | |
---|
7123 | # Used to examine libraries when file_magic_cmd begins "file" |
---|
7124 | MAGIC_CMD=file |
---|
7125 | |
---|
7126 | # Used on cygwin: DLL creation program. |
---|
7127 | DLLTOOL="dlltool" |
---|
7128 | |
---|
7129 | # Used on cygwin: object dumper. |
---|
7130 | OBJDUMP="objdump" |
---|
7131 | |
---|
7132 | # Used on cygwin: assembler. |
---|
7133 | AS="as" |
---|
7134 | |
---|
7135 | # The name of the directory that contains temporary libtool files. |
---|
7136 | objdir=.libs |
---|
7137 | |
---|
7138 | # How to create reloadable object files. |
---|
7139 | reload_flag=" -r" |
---|
7140 | reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" |
---|
7141 | |
---|
7142 | # How to pass a linker flag through the compiler. |
---|
7143 | wl="-Wl," |
---|
7144 | |
---|
7145 | # Object file suffix (normally "o"). |
---|
7146 | objext="o" |
---|
7147 | |
---|
7148 | # Old archive suffix (normally "a"). |
---|
7149 | libext="a" |
---|
7150 | |
---|
7151 | # Shared library suffix (normally ".so"). |
---|
7152 | shrext_cmds='.so' |
---|
7153 | |
---|
7154 | # Executable file suffix (normally ""). |
---|
7155 | exeext="" |
---|
7156 | |
---|
7157 | # Additional compiler flags for building library objects. |
---|
7158 | pic_flag=" -fPIC" |
---|
7159 | pic_mode=default |
---|
7160 | |
---|
7161 | # What is the maximum length of a command? |
---|
7162 | max_cmd_len=32768 |
---|
7163 | |
---|
7164 | # Does compiler simultaneously support -c and -o options? |
---|
7165 | compiler_c_o="yes" |
---|
7166 | |
---|
7167 | # Must we lock files when doing compilation ? |
---|
7168 | need_locks="no" |
---|
7169 | |
---|
7170 | # Do we need the lib prefix for modules? |
---|
7171 | need_lib_prefix=no |
---|
7172 | |
---|
7173 | # Do we need a version for libraries? |
---|
7174 | need_version=no |
---|
7175 | |
---|
7176 | # Whether dlopen is supported. |
---|
7177 | dlopen_support=unknown |
---|
7178 | |
---|
7179 | # Whether dlopen of programs is supported. |
---|
7180 | dlopen_self=unknown |
---|
7181 | |
---|
7182 | # Whether dlopen of statically linked programs is supported. |
---|
7183 | dlopen_self_static=unknown |
---|
7184 | |
---|
7185 | # Compiler flag to prevent dynamic linking. |
---|
7186 | link_static_flag="-static" |
---|
7187 | |
---|
7188 | # Compiler flag to turn off builtin functions. |
---|
7189 | no_builtin_flag="" |
---|
7190 | |
---|
7191 | # Compiler flag to allow reflexive dlopens. |
---|
7192 | export_dynamic_flag_spec="\${wl}--export-dynamic" |
---|
7193 | |
---|
7194 | # Compiler flag to generate shared objects directly from archives. |
---|
7195 | whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" |
---|
7196 | |
---|
7197 | # Compiler flag to generate thread-safe objects. |
---|
7198 | thread_safe_flag_spec="" |
---|
7199 | |
---|
7200 | # Library versioning type. |
---|
7201 | version_type=linux |
---|
7202 | |
---|
7203 | # Format of library name prefix. |
---|
7204 | libname_spec="lib\$name" |
---|
7205 | |
---|
7206 | # List of archive names. First name is the real one, the rest are links. |
---|
7207 | # The last name is the one that the linker finds with -lNAME. |
---|
7208 | library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}" |
---|
7209 | |
---|
7210 | # The coded name of the library, if different from the real name. |
---|
7211 | soname_spec="\${libname}\${release}\${shared_ext}\$major" |
---|
7212 | |
---|
7213 | # Commands used to build and install an old-style archive. |
---|
7214 | RANLIB="ranlib" |
---|
7215 | old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib" |
---|
7216 | old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib" |
---|
7217 | old_postuninstall_cmds="" |
---|
7218 | |
---|
7219 | # Create an old-style archive from a shared archive. |
---|
7220 | old_archive_from_new_cmds="" |
---|
7221 | |
---|
7222 | # Create a temporary old-style archive to link instead of a shared archive. |
---|
7223 | old_archive_from_expsyms_cmds="" |
---|
7224 | |
---|
7225 | # Commands used to build and install a shared archive. |
---|
7226 | archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" |
---|
7227 | archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~ |
---|
7228 | cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~ |
---|
7229 | \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~ |
---|
7230 | \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib" |
---|
7231 | postinstall_cmds="" |
---|
7232 | postuninstall_cmds="" |
---|
7233 | |
---|
7234 | # Commands used to build a loadable module (assumed same as above if empty) |
---|
7235 | module_cmds="" |
---|
7236 | module_expsym_cmds="" |
---|
7237 | |
---|
7238 | # Commands to strip libraries. |
---|
7239 | old_striplib="strip --strip-debug" |
---|
7240 | striplib="strip --strip-unneeded" |
---|
7241 | |
---|
7242 | # Dependencies to place before the objects being linked to create a |
---|
7243 | # shared library. |
---|
7244 | predep_objects="" |
---|
7245 | |
---|
7246 | # Dependencies to place after the objects being linked to create a |
---|
7247 | # shared library. |
---|
7248 | postdep_objects="" |
---|
7249 | |
---|
7250 | # Dependencies to place before the objects being linked to create a |
---|
7251 | # shared library. |
---|
7252 | predeps="" |
---|
7253 | |
---|
7254 | # Dependencies to place after the objects being linked to create a |
---|
7255 | # shared library. |
---|
7256 | postdeps="" |
---|
7257 | |
---|
7258 | # The library search path used internally by the compiler when linking |
---|
7259 | # a shared library. |
---|
7260 | compiler_lib_search_path="" |
---|
7261 | |
---|
7262 | # Method to check whether dependent libraries are shared objects. |
---|
7263 | deplibs_check_method="pass_all" |
---|
7264 | |
---|
7265 | # Command to use when deplibs_check_method == file_magic. |
---|
7266 | file_magic_cmd="\$MAGIC_CMD" |
---|
7267 | |
---|
7268 | # Flag that allows shared libraries with undefined symbols to be built. |
---|
7269 | allow_undefined_flag="" |
---|
7270 | |
---|
7271 | # Flag that forces no undefined symbols. |
---|
7272 | no_undefined_flag="" |
---|
7273 | |
---|
7274 | # Commands used to finish a libtool library installation in a directory. |
---|
7275 | finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" |
---|
7276 | |
---|
7277 | # Same as above, but a single script fragment to be evaled but not shown. |
---|
7278 | finish_eval="" |
---|
7279 | |
---|
7280 | # Take the output of nm and produce a listing of raw symbols and C names. |
---|
7281 | global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'" |
---|
7282 | |
---|
7283 | # Transform the output of nm in a proper C declaration |
---|
7284 | global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'" |
---|
7285 | |
---|
7286 | # Transform the output of nm in a C name address pair |
---|
7287 | global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'" |
---|
7288 | |
---|
7289 | # This is the shared library runtime path variable. |
---|
7290 | runpath_var=LD_RUN_PATH |
---|
7291 | |
---|
7292 | # This is the shared library path variable. |
---|
7293 | shlibpath_var=LD_LIBRARY_PATH |
---|
7294 | |
---|
7295 | # Is shlibpath searched before the hard-coded library search path? |
---|
7296 | shlibpath_overrides_runpath=no |
---|
7297 | |
---|
7298 | # How to hardcode a shared library path into an executable. |
---|
7299 | hardcode_action=immediate |
---|
7300 | |
---|
7301 | # Whether we should hardcode library paths into libraries. |
---|
7302 | hardcode_into_libs=yes |
---|
7303 | |
---|
7304 | # Flag to hardcode $libdir into a binary during linking. |
---|
7305 | # This must work even if $libdir does not exist. |
---|
7306 | hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir" |
---|
7307 | |
---|
7308 | # If ld is used when linking, flag to hardcode $libdir into |
---|
7309 | # a binary during linking. This must work even if $libdir does |
---|
7310 | # not exist. |
---|
7311 | hardcode_libdir_flag_spec_ld="" |
---|
7312 | |
---|
7313 | # Whether we need a single -rpath flag with a separated argument. |
---|
7314 | hardcode_libdir_separator="" |
---|
7315 | |
---|
7316 | # Set to yes if using DIR/libNAME during linking hardcodes DIR into the |
---|
7317 | # resulting binary. |
---|
7318 | hardcode_direct=no |
---|
7319 | |
---|
7320 | # Set to yes if using the -LDIR flag during linking hardcodes DIR into the |
---|
7321 | # resulting binary. |
---|
7322 | hardcode_minus_L=no |
---|
7323 | |
---|
7324 | # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into |
---|
7325 | # the resulting binary. |
---|
7326 | hardcode_shlibpath_var=unsupported |
---|
7327 | |
---|
7328 | # Set to yes if building a shared library automatically hardcodes DIR into the library |
---|
7329 | # and all subsequent libraries and executables linked against it. |
---|
7330 | hardcode_automatic=no |
---|
7331 | |
---|
7332 | # Variables whose values should be saved in libtool wrapper scripts and |
---|
7333 | # restored at relink time. |
---|
7334 | variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" |
---|
7335 | |
---|
7336 | # Whether libtool must link a program against all its dependency libraries. |
---|
7337 | link_all_deplibs=unknown |
---|
7338 | |
---|
7339 | # Compile-time system search path for libraries |
---|
7340 | sys_lib_search_path_spec=" /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../i386-redhat-linux/3.4.6/ /usr/lib/gcc/i386-redhat-linux/3.4.6/../../../ /lib/i386-redhat-linux/3.4.6/ /lib/ /usr/lib/i386-redhat-linux/3.4.6/ /usr/lib/" |
---|
7341 | |
---|
7342 | # Run-time system search path for libraries |
---|
7343 | sys_lib_dlsearch_path_spec="/lib /usr/lib include ld.so.conf.d/*.conf /usr/i486-linux-libc5/lib /usr/athena/lib " |
---|
7344 | |
---|
7345 | # Fix the shell variable $srcfile for the compiler. |
---|
7346 | fix_srcfile_path="" |
---|
7347 | |
---|
7348 | # Set to yes if exported symbols are required. |
---|
7349 | always_export_symbols=no |
---|
7350 | |
---|
7351 | # The commands to list exported symbols. |
---|
7352 | export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" |
---|
7353 | |
---|
7354 | # The commands to extract the exported symbol list from a shared archive. |
---|
7355 | extract_expsyms_cmds="" |
---|
7356 | |
---|
7357 | # Symbols that should not be listed in the preloaded symbols. |
---|
7358 | exclude_expsyms="_GLOBAL_OFFSET_TABLE_" |
---|
7359 | |
---|
7360 | # Symbols that must always be exported. |
---|
7361 | include_expsyms="" |
---|
7362 | |
---|
7363 | # ### END LIBTOOL TAG CONFIG: F77 |
---|
7364 | |
---|