Debian Codegraph @

libchise/libtool

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