ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid-7.2/libltdl/libtool
Revision: 941
Committed: Sat May 2 02:02:59 2009 UTC (14 years, 11 months ago) by db
File size: 218106 byte(s)
Log Message:
- Update autools versions.
- Fix acinclude.m4 to work on FreeBSD at least.


File Contents

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

Properties

Name Value
svn:executable *