comparison libtool @ 15:91b26521effc

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