ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/vendor/pxys2-2.1.0/pxyscand/libtool
Revision: 3253
Committed: Wed Apr 2 20:46:18 2014 UTC (11 years, 4 months ago) by michael
File size: 206218 byte(s)
Log Message:
- Imported pxys2-2.1.0

File Contents

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

Properties

Name Value
svn:executable