Yannick Shpilka , cleaned up
[kgraphinterface.git] / libtool
blobadd56dbe53ef367c289ab913422b025c72f2e504
1 #! /bin/bash
3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU kgraphinterface 0.1)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
8 # Free Software Foundation, Inc.
10 # This file is part of GNU Libtool:
11 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
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.
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.
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.
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.
32 # A sed program that does not truncate output.
33 SED="/bin/sed"
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
36 Xsed="/bin/sed -e s/^X//"
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
39 # if CDPATH is set.
40 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
42 # The names of the tagged configurations supported by this script.
43 available_tags=" CXX"
45 # ### BEGIN LIBTOOL CONFIG
47 # Libtool was configured on host yannick:
49 # Shell to use when invoking shell scripts.
50 SHELL="/bin/bash"
52 # Whether or not to build shared libraries.
53 build_libtool_libs=yes
55 # Whether or not to build static libraries.
56 build_old_libs=no
58 # Whether or not to add -lc for building shared libraries.
59 build_libtool_need_lc=no
61 # Whether or not to disallow shared libs when runtime libs are static
62 allow_libtool_libs_with_static_runtimes=no
64 # Whether or not to optimize for fast installation.
65 fast_install=yes
67 # The host system.
68 host_alias=
69 host=i686-pc-linux-gnu
71 # An echo program that does not interpret backslashes.
72 echo="echo"
74 # The archiver.
75 AR="ar"
76 AR_FLAGS="cru"
78 # A C compiler.
79 LTCC="gcc"
81 # A language-specific compiler.
82 CC="gcc"
84 # Is the compiler the GNU C compiler?
85 with_gcc=yes
87 # An ERE matcher.
88 EGREP="grep -E"
90 # The linker used to build libraries.
91 LD="/usr/bin/ld"
93 # Whether we need hard or soft links.
94 LN_S="ln -s"
96 # A BSD-compatible nm program.
97 NM="/usr/bin/nm -B"
99 # A symbol stripping program
100 STRIP=strip
102 # Used to examine libraries when file_magic_cmd begins "file"
103 MAGIC_CMD=file
105 # Used on cygwin: DLL creation program.
106 DLLTOOL="dlltool"
108 # Used on cygwin: object dumper.
109 OBJDUMP="objdump"
111 # Used on cygwin: assembler.
112 AS="as"
114 # The name of the directory that contains temporary libtool files.
115 objdir=.libs
117 # How to create reloadable object files.
118 reload_flag=" -r"
119 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
121 # How to pass a linker flag through the compiler.
122 wl="-Wl,"
124 # Object file suffix (normally "o").
125 objext="o"
127 # Old archive suffix (normally "a").
128 libext="a"
130 # Shared library suffix (normally ".so").
131 shrext='.so'
133 # Executable file suffix (normally "").
134 exeext=""
136 # Additional compiler flags for building library objects.
137 pic_flag=" -fPIC -DPIC"
138 pic_mode=default
140 # What is the maximum length of a command?
141 max_cmd_len=32768
143 # Does compiler simultaneously support -c and -o options?
144 compiler_c_o="yes"
146 # Must we lock files when doing compilation ?
147 need_locks="no"
149 # Do we need the lib prefix for modules?
150 need_lib_prefix=no
152 # Do we need a version for libraries?
153 need_version=no
155 # Whether dlopen is supported.
156 dlopen_support=yes
158 # Whether dlopen of programs is supported.
159 dlopen_self=yes
161 # Whether dlopen of statically linked programs is supported.
162 dlopen_self_static=yes
164 # Compiler flag to prevent dynamic linking.
165 link_static_flag="-static"
167 # Compiler flag to turn off builtin functions.
168 no_builtin_flag=" -fno-builtin"
170 # Compiler flag to allow reflexive dlopens.
171 export_dynamic_flag_spec="\${wl}--export-dynamic"
173 # Compiler flag to generate shared objects directly from archives.
174 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
176 # Compiler flag to generate thread-safe objects.
177 thread_safe_flag_spec=""
179 # Library versioning type.
180 version_type=linux
182 # Format of library name prefix.
183 libname_spec="lib\$name"
185 # List of archive names. First name is the real one, the rest are links.
186 # The last name is the one that the linker finds with -lNAME.
187 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
189 # The coded name of the library, if different from the real name.
190 soname_spec="\${libname}\${release}\${shared_ext}\$major"
192 # Commands used to build and install an old-style archive.
193 RANLIB="ranlib"
194 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
195 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
196 old_postuninstall_cmds=""
198 # Create an old-style archive from a shared archive.
199 old_archive_from_new_cmds=""
201 # Create a temporary old-style archive to link instead of a shared archive.
202 old_archive_from_expsyms_cmds=""
204 # Commands used to build and install a shared archive.
205 archive_cmds="\$CC -shared \$compiler_flags \$libobjs \$deplibs \${wl}-soname \$wl\$soname -o \$lib"
206 archive_expsym_cmds="\$CC -shared \$compiler_flags \$libobjs \$deplibs \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
207 postinstall_cmds=""
208 postuninstall_cmds=""
210 # Commands used to build a loadable module (assumed same as above if empty)
211 module_cmds=""
212 module_expsym_cmds=""
214 # Commands to strip libraries.
215 old_striplib="strip --strip-debug"
216 striplib="strip --strip-unneeded"
218 # Dependencies to place before the objects being linked to create a
219 # shared library.
220 predep_objects=""
222 # Dependencies to place after the objects being linked to create a
223 # shared library.
224 postdep_objects=""
226 # Dependencies to place before the objects being linked to create a
227 # shared library.
228 predeps=""
230 # Dependencies to place after the objects being linked to create a
231 # shared library.
232 postdeps=""
234 # The library search path used internally by the compiler when linking
235 # a shared library.
236 compiler_lib_search_path=""
238 # Method to check whether dependent libraries are shared objects.
239 deplibs_check_method="pass_all"
241 # Command to use when deplibs_check_method == file_magic.
242 file_magic_cmd="\$MAGIC_CMD"
244 # Flag that allows shared libraries with undefined symbols to be built.
245 allow_undefined_flag=""
247 # Flag that forces no undefined symbols.
248 no_undefined_flag=""
250 # Commands used to finish a libtool library installation in a directory.
251 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
253 # Same as above, but a single script fragment to be evaled but not shown.
254 finish_eval=""
256 # Take the output of nm and produce a listing of raw symbols and C names.
257 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
259 # Transform the output of nm in a proper C declaration
260 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
262 # Transform the output of nm in a C name address pair
263 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
265 # This is the shared library runtime path variable.
266 runpath_var=LD_RUN_PATH
268 # This is the shared library path variable.
269 shlibpath_var=LD_LIBRARY_PATH
271 # Is shlibpath searched before the hard-coded library search path?
272 shlibpath_overrides_runpath=no
274 # How to hardcode a shared library path into an executable.
275 hardcode_action=immediate
277 # Whether we should hardcode library paths into libraries.
278 hardcode_into_libs=yes
280 # Flag to hardcode $libdir into a binary during linking.
281 # This must work even if $libdir does not exist.
282 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
284 # If ld is used when linking, flag to hardcode $libdir into
285 # a binary during linking. This must work even if $libdir does
286 # not exist.
287 hardcode_libdir_flag_spec_ld=""
289 # Whether we need a single -rpath flag with a separated argument.
290 hardcode_libdir_separator=""
292 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
293 # resulting binary.
294 hardcode_direct=no
296 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
297 # resulting binary.
298 hardcode_minus_L=no
300 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
301 # the resulting binary.
302 hardcode_shlibpath_var=unsupported
304 # Set to yes if building a shared library automatically hardcodes DIR into the library
305 # and all subsequent libraries and executables linked against it.
306 hardcode_automatic=no
308 # Variables whose values should be saved in libtool wrapper scripts and
309 # restored at relink time.
310 variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
312 # Whether libtool must link a program against all its dependency libraries.
313 link_all_deplibs=unknown
315 # Compile-time system search path for libraries
316 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
318 # Run-time system search path for libraries
319 sys_lib_dlsearch_path_spec="/lib /usr/lib"
321 # Fix the shell variable $srcfile for the compiler.
322 fix_srcfile_path=""
324 # Set to yes if exported symbols are required.
325 always_export_symbols=no
327 # The commands to list exported symbols.
328 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
330 # The commands to extract the exported symbol list from a shared archive.
331 extract_expsyms_cmds=""
333 # Symbols that should not be listed in the preloaded symbols.
334 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
336 # Symbols that must always be exported.
337 include_expsyms=""
339 # ### END LIBTOOL CONFIG
341 # ltmain.sh - Provide generalized library-building support services.
342 # NOTE: Changing this file will not affect anything until you rerun configure.
344 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
345 # Free Software Foundation, Inc.
346 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
348 # This program is free software; you can redistribute it and/or modify
349 # it under the terms of the GNU General Public License as published by
350 # the Free Software Foundation; either version 2 of the License, or
351 # (at your option) any later version.
353 # This program is distributed in the hope that it will be useful, but
354 # WITHOUT ANY WARRANTY; without even the implied warranty of
355 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
356 # General Public License for more details.
358 # You should have received a copy of the GNU General Public License
359 # along with this program; if not, write to the Free Software
360 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
362 # As a special exception to the GNU General Public License, if you
363 # distribute this file as part of a program that contains a
364 # configuration script generated by Autoconf, you may include it under
365 # the same distribution terms that you use for the rest of that program.
367 # Check that we have a working $echo.
368 if test "X$1" = X--no-reexec; then
369 # Discard the --no-reexec flag, and continue.
370 shift
371 elif test "X$1" = X--fallback-echo; then
372 # Avoid inline document here, it may be left over
374 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
375 # Yippee, $echo works!
377 else
378 # Restart under the correct shell, and then maybe $echo will work.
379 exec $SHELL "$0" --no-reexec ${1+"$@"}
382 if test "X$1" = X--fallback-echo; then
383 # used as fallback echo
384 shift
385 cat <<EOF
388 exit 0
391 # The name of this program.
392 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
393 modename="$progname"
395 # Constants.
396 PROGRAM=ltmain.sh
397 PACKAGE=libtool
398 VERSION=1.5a
399 TIMESTAMP=" (1.1240 2003/06/26 06:55:19)"
401 default_mode=
402 help="Try \`$progname --help' for more information."
403 magic="%%%MAGIC variable%%%"
404 mkdir="mkdir"
405 mv="mv -f"
406 rm="rm -f"
408 # Sed substitution that helps us do robust quoting. It backslashifies
409 # metacharacters that are still active within double-quoted strings.
410 Xsed="${SED}"' -e 1s/^X//'
411 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
412 # test EBCDIC or ASCII
413 case `echo A|tr A '\301'` in
414 A) # EBCDIC based system
415 SP2NL="tr '\100' '\n'"
416 NL2SP="tr '\r\n' '\100\100'"
418 *) # Assume ASCII based system
419 SP2NL="tr '\040' '\012'"
420 NL2SP="tr '\015\012' '\040\040'"
422 esac
424 # NLS nuisances.
425 # Only set LANG and LC_ALL to C if already set.
426 # These must not be set unconditionally because not all systems understand
427 # e.g. LANG=C (notably SCO).
428 # We save the old values to restore during execute mode.
429 if test "${LC_ALL+set}" = set; then
430 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
432 if test "${LANG+set}" = set; then
433 save_LANG="$LANG"; LANG=C; export LANG
436 # Make sure IFS has a sensible default
437 : ${IFS=" "}
439 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
440 $echo "$modename: not configured to build any kind of library" 1>&2
441 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
442 exit 1
445 # Global variables.
446 mode=$default_mode
447 nonopt=
448 prev=
449 prevopt=
450 run=
451 show="$echo"
452 show_help=
453 execute_dlfiles=
454 lo2o="s/\\.lo\$/.${objext}/"
455 o2lo="s/\\.${objext}\$/.lo/"
457 #####################################
458 # Shell function definitions:
459 # This seems to be the best place for them
461 # Need a lot of goo to handle *both* DLLs and import libs
462 # Has to be a shell function in order to 'eat' the argument
463 # that is supplied when $file_magic_command is called.
464 win32_libid () {
465 win32_libid_type="unknown"
466 win32_fileres=`file -L $1 2>/dev/null`
467 case $win32_fileres in
468 *ar\ archive\ import\ library*) # definitely import
469 win32_libid_type="x86 archive import"
471 *ar\ archive*) # could be an import, or static
472 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
473 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
474 win32_nmres=`eval $NM -f posix -A $1 | \
475 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
476 if test "X$win32_nmres" = "Ximport" ; then
477 win32_libid_type="x86 archive import"
478 else
479 win32_libid_type="x86 archive static"
483 *DLL*)
484 win32_libid_type="x86 DLL"
486 *executable*) # but shell scripts are "executable" too...
487 case $win32_fileres in
488 *MS\ Windows\ PE\ Intel*)
489 win32_libid_type="x86 DLL"
491 esac
493 esac
494 $echo $win32_libid_type
497 # End of Shell function definitions
498 #####################################
500 # Parse our command line options once, thoroughly.
501 while test "$#" -gt 0
503 arg="$1"
504 shift
506 case $arg in
507 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
508 *) optarg= ;;
509 esac
511 # If the previous option needs an argument, assign it.
512 if test -n "$prev"; then
513 case $prev in
514 execute_dlfiles)
515 execute_dlfiles="$execute_dlfiles $arg"
517 tag)
518 tagname="$arg"
520 # Check whether tagname contains only valid characters
521 case $tagname in
522 *[!-_A-Za-z0-9,/]*)
523 $echo "$progname: invalid tag name: $tagname" 1>&2
524 exit 1
526 esac
528 case $tagname in
530 # Don't test for the "default" C tag, as we know, it's there, but
531 # not specially marked.
534 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
535 taglist="$taglist $tagname"
536 # Evaluate the configuration.
537 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
538 else
539 $echo "$progname: ignoring unknown tag $tagname" 1>&2
542 esac
545 eval "$prev=\$arg"
547 esac
549 prev=
550 prevopt=
551 continue
554 # Have we seen a non-optional argument yet?
555 case $arg in
556 --help)
557 show_help=yes
560 --version)
561 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
562 $echo
563 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
564 $echo "This is free software; see the source for copying conditions. There is NO"
565 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
566 exit 0
569 --config)
570 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
571 # Now print the configurations for the tags.
572 for tagname in $taglist; do
573 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
574 done
575 exit 0
578 --debug)
579 $echo "$progname: enabling shell trace mode"
580 set -x
583 --dry-run | -n)
584 run=:
587 --features)
588 $echo "host: $host"
589 if test "$build_libtool_libs" = yes; then
590 $echo "enable shared libraries"
591 else
592 $echo "disable shared libraries"
594 if test "$build_old_libs" = yes; then
595 $echo "enable static libraries"
596 else
597 $echo "disable static libraries"
599 exit 0
602 --finish) mode="finish" ;;
604 --mode) prevopt="--mode" prev=mode ;;
605 --mode=*) mode="$optarg" ;;
607 --preserve-dup-deps) duplicate_deps="yes" ;;
609 --quiet | --silent)
610 show=:
613 --tag) prevopt="--tag" prev=tag ;;
614 --tag=*)
615 set tag "$optarg" ${1+"$@"}
616 shift
617 prev=tag
620 -dlopen)
621 prevopt="-dlopen"
622 prev=execute_dlfiles
626 $echo "$modename: unrecognized option \`$arg'" 1>&2
627 $echo "$help" 1>&2
628 exit 1
632 nonopt="$arg"
633 break
635 esac
636 done
638 if test -n "$prevopt"; then
639 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
640 $echo "$help" 1>&2
641 exit 1
644 # If this variable is set in any of the actions, the command in it
645 # will be execed at the end. This prevents here-documents from being
646 # left over by shells.
647 exec_cmd=
649 if test -z "$show_help"; then
651 # Infer the operation mode.
652 if test -z "$mode"; then
653 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
654 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
655 case $nonopt in
656 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
657 mode=link
658 for arg
660 case $arg in
662 mode=compile
663 break
665 esac
666 done
668 *db | *dbx | *strace | *truss)
669 mode=execute
671 *install*|cp|mv)
672 mode=install
674 *rm)
675 mode=uninstall
678 # If we have no mode, but dlfiles were specified, then do execute mode.
679 test -n "$execute_dlfiles" && mode=execute
681 # Just use the default operation mode.
682 if test -z "$mode"; then
683 if test -n "$nonopt"; then
684 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
685 else
686 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
690 esac
693 # Only execute mode is allowed to have -dlopen flags.
694 if test -n "$execute_dlfiles" && test "$mode" != execute; then
695 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
696 $echo "$help" 1>&2
697 exit 1
700 # Change the help message to a mode-specific one.
701 generic_help="$help"
702 help="Try \`$modename --help --mode=$mode' for more information."
704 # These modes are in order of execution frequency so that they run quickly.
705 case $mode in
706 # libtool compile mode
707 compile)
708 modename="$modename: compile"
709 # Get the compilation command and the source file.
710 base_compile=
711 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
712 suppress_output=
713 arg_mode=normal
714 libobj=
716 for arg
718 case "$arg_mode" in
719 arg )
720 # do not "continue". Instead, add this to base_compile
721 lastarg="$arg"
722 arg_mode=normal
725 target )
726 libobj="$arg"
727 arg_mode=normal
728 continue
731 normal )
732 # Accept any command-line options.
733 case $arg in
735 if test -n "$libobj" ; then
736 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
737 exit 1
739 arg_mode=target
740 continue
743 -static)
744 build_old_libs=yes
745 continue
748 -prefer-pic)
749 pic_mode=yes
750 continue
753 -prefer-non-pic)
754 pic_mode=no
755 continue
758 -Xcompiler)
759 arg_mode=arg # the next one goes into the "base_compile" arg list
760 continue # The current "srcfile" will either be retained or
761 ;; # replaced later. I would guess that would be a bug.
763 -Wc,*)
764 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
765 lastarg=
766 save_ifs="$IFS"; IFS=','
767 for arg in $args; do
768 IFS="$save_ifs"
770 # Double-quote args containing other shell metacharacters.
771 # Many Bourne shells cannot handle close brackets correctly
772 # in scan sets, so we specify it separately.
773 case $arg in
774 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
775 arg="\"$arg\""
777 esac
778 lastarg="$lastarg $arg"
779 done
780 IFS="$save_ifs"
781 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
783 # Add the arguments to base_compile.
784 base_compile="$base_compile $lastarg"
785 continue
789 # Accept the current argument as the source file.
790 # The previous "srcfile" becomes the current argument.
792 lastarg="$srcfile"
793 srcfile="$arg"
795 esac # case $arg
797 esac # case $arg_mode
799 # Aesthetically quote the previous argument.
800 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
802 case $lastarg in
803 # Double-quote args containing other shell metacharacters.
804 # Many Bourne shells cannot handle close brackets correctly
805 # in scan sets, so we specify it separately.
806 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
807 lastarg="\"$lastarg\""
809 esac
811 base_compile="$base_compile $lastarg"
812 done # for arg
814 case $arg_mode in
815 arg)
816 $echo "$modename: you must specify an argument for -Xcompile"
817 exit 1
819 target)
820 $echo "$modename: you must specify a target with \`-o'" 1>&2
821 exit 1
824 # Get the name of the library object.
825 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
827 esac
829 # Recognize several different file suffixes.
830 # If the user specifies -o file.o, it is replaced with file.lo
831 xform='[cCFSifmso]'
832 case $libobj in
833 *.ada) xform=ada ;;
834 *.adb) xform=adb ;;
835 *.ads) xform=ads ;;
836 *.asm) xform=asm ;;
837 *.c++) xform=c++ ;;
838 *.cc) xform=cc ;;
839 *.ii) xform=ii ;;
840 *.class) xform=class ;;
841 *.cpp) xform=cpp ;;
842 *.cxx) xform=cxx ;;
843 *.f90) xform=f90 ;;
844 *.for) xform=for ;;
845 *.java) xform=java ;;
846 esac
848 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
850 case $libobj in
851 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
853 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
854 exit 1
856 esac
858 # Infer tagged configuration to use if any are available and
859 # if one wasn't chosen via the "--tag" command line option.
860 # Only attempt this if the compiler in the base compile
861 # command doesn't match the default compiler.
862 if test -n "$available_tags" && test -z "$tagname"; then
863 case $base_compile in
864 # Blanks in the command may have been stripped by the calling shell,
865 # but not from the CC environment variable when configure was run.
866 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
867 # Blanks at the start of $base_compile will cause this to fail
868 # if we don't check for them as well.
870 for z in $available_tags; do
871 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
872 # Evaluate the configuration.
873 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
874 case "$base_compile " in
875 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
876 # The compiler in the base compile command matches
877 # the one in the tagged configuration.
878 # Assume this is the tagged configuration we want.
879 tagname=$z
880 break
882 esac
884 done
885 # If $tagname still isn't set, then no tagged configuration
886 # was found and let the user know that the "--tag" command
887 # line option must be used.
888 if test -z "$tagname"; then
889 $echo "$modename: unable to infer tagged configuration"
890 $echo "$modename: specify a tag with \`--tag'" 1>&2
891 exit 1
892 # else
893 # $echo "$modename: using $tagname tagged configuration"
896 esac
899 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
900 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
901 if test "X$xdir" = "X$obj"; then
902 xdir=
903 else
904 xdir=$xdir/
906 lobj=${xdir}$objdir/$objname
908 if test -z "$base_compile"; then
909 $echo "$modename: you must specify a compilation command" 1>&2
910 $echo "$help" 1>&2
911 exit 1
914 # Delete any leftover library objects.
915 if test "$build_old_libs" = yes; then
916 removelist="$obj $lobj $libobj ${libobj}T"
917 else
918 removelist="$lobj $libobj ${libobj}T"
921 $run $rm $removelist
922 trap "$run $rm $removelist; exit 1" 1 2 15
924 # On Cygwin there's no "real" PIC flag so we must build both object types
925 case $host_os in
926 cygwin* | mingw* | pw32* | os2*)
927 pic_mode=default
929 esac
930 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
931 # non-PIC code in shared libraries is not supported
932 pic_mode=default
935 # Calculate the filename of the output object if compiler does
936 # not support -o with -c
937 if test "$compiler_c_o" = no; then
938 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
939 lockfile="$output_obj.lock"
940 removelist="$removelist $output_obj $lockfile"
941 trap "$run $rm $removelist; exit 1" 1 2 15
942 else
943 output_obj=
944 need_locks=no
945 lockfile=
948 # Lock this critical section if it is needed
949 # We use this script file to make the link, it avoids creating a new file
950 if test "$need_locks" = yes; then
951 until $run ln "$0" "$lockfile" 2>/dev/null; do
952 $show "Waiting for $lockfile to be removed"
953 sleep 2
954 done
955 elif test "$need_locks" = warn; then
956 if test -f "$lockfile"; then
957 $echo "\
958 *** ERROR, $lockfile exists and contains:
959 `cat $lockfile 2>/dev/null`
961 This indicates that another process is trying to use the same
962 temporary object file, and libtool could not work around it because
963 your compiler does not support \`-c' and \`-o' together. If you
964 repeat this compilation, it may succeed, by chance, but you had better
965 avoid parallel builds (make -j) in this platform, or get a better
966 compiler."
968 $run $rm $removelist
969 exit 1
971 $echo $srcfile > "$lockfile"
974 if test -n "$fix_srcfile_path"; then
975 eval srcfile=\"$fix_srcfile_path\"
978 $run $rm "$libobj" "${libobj}T"
980 # Create a libtool object file (analogous to a ".la" file),
981 # but don't create it if we're doing a dry run.
982 test -z "$run" && cat > ${libobj}T <<EOF
983 # $libobj - a libtool object file
984 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
986 # Please DO NOT delete this file!
987 # It is necessary for linking the library.
989 # Name of the PIC object.
992 # Only build a PIC object if we are building libtool libraries.
993 if test "$build_libtool_libs" = yes; then
994 # Without this assignment, base_compile gets emptied.
995 fbsd_hideous_sh_bug=$base_compile
997 if test "$pic_mode" != no; then
998 command="$base_compile $srcfile $pic_flag"
999 else
1000 # Don't build PIC code
1001 command="$base_compile $srcfile"
1004 if test ! -d "${xdir}$objdir"; then
1005 $show "$mkdir ${xdir}$objdir"
1006 $run $mkdir ${xdir}$objdir
1007 status=$?
1008 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
1009 exit $status
1013 if test -z "$output_obj"; then
1014 # Place PIC objects in $objdir
1015 command="$command -o $lobj"
1018 $run $rm "$lobj" "$output_obj"
1020 $show "$command"
1021 if $run eval "$command"; then :
1022 else
1023 test -n "$output_obj" && $run $rm $removelist
1024 exit 1
1027 if test "$need_locks" = warn &&
1028 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1029 $echo "\
1030 *** ERROR, $lockfile contains:
1031 `cat $lockfile 2>/dev/null`
1033 but it should contain:
1034 $srcfile
1036 This indicates that another process is trying to use the same
1037 temporary object file, and libtool could not work around it because
1038 your compiler does not support \`-c' and \`-o' together. If you
1039 repeat this compilation, it may succeed, by chance, but you had better
1040 avoid parallel builds (make -j) in this platform, or get a better
1041 compiler."
1043 $run $rm $removelist
1044 exit 1
1047 # Just move the object if needed, then go on to compile the next one
1048 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1049 $show "$mv $output_obj $lobj"
1050 if $run $mv $output_obj $lobj; then :
1051 else
1052 error=$?
1053 $run $rm $removelist
1054 exit $error
1058 # Append the name of the PIC object to the libtool object file.
1059 test -z "$run" && cat >> ${libobj}T <<EOF
1060 pic_object='$objdir/$objname'
1064 # Allow error messages only from the first compilation.
1065 suppress_output=' >/dev/null 2>&1'
1066 else
1067 # No PIC object so indicate it doesn't exist in the libtool
1068 # object file.
1069 test -z "$run" && cat >> ${libobj}T <<EOF
1070 pic_object=none
1075 # Only build a position-dependent object if we build old libraries.
1076 if test "$build_old_libs" = yes; then
1077 if test "$pic_mode" != yes; then
1078 # Don't build PIC code
1079 command="$base_compile $srcfile"
1080 else
1081 command="$base_compile $srcfile $pic_flag"
1083 if test "$compiler_c_o" = yes; then
1084 command="$command -o $obj"
1087 # Suppress compiler output if we already did a PIC compilation.
1088 command="$command$suppress_output"
1089 $run $rm "$obj" "$output_obj"
1090 $show "$command"
1091 if $run eval "$command"; then :
1092 else
1093 $run $rm $removelist
1094 exit 1
1097 if test "$need_locks" = warn &&
1098 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1099 $echo "\
1100 *** ERROR, $lockfile contains:
1101 `cat $lockfile 2>/dev/null`
1103 but it should contain:
1104 $srcfile
1106 This indicates that another process is trying to use the same
1107 temporary object file, and libtool could not work around it because
1108 your compiler does not support \`-c' and \`-o' together. If you
1109 repeat this compilation, it may succeed, by chance, but you had better
1110 avoid parallel builds (make -j) in this platform, or get a better
1111 compiler."
1113 $run $rm $removelist
1114 exit 1
1117 # Just move the object if needed
1118 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1119 $show "$mv $output_obj $obj"
1120 if $run $mv $output_obj $obj; then :
1121 else
1122 error=$?
1123 $run $rm $removelist
1124 exit $error
1128 # Append the name of the non-PIC object the libtool object file.
1129 # Only append if the libtool object file exists.
1130 test -z "$run" && cat >> ${libobj}T <<EOF
1131 # Name of the non-PIC object.
1132 non_pic_object='$objname'
1135 else
1136 # Append the name of the non-PIC object the libtool object file.
1137 # Only append if the libtool object file exists.
1138 test -z "$run" && cat >> ${libobj}T <<EOF
1139 # Name of the non-PIC object.
1140 non_pic_object=none
1145 $run $mv "${libobj}T" "${libobj}"
1147 # Unlock the critical section if it was locked
1148 if test "$need_locks" != no; then
1149 $run $rm "$lockfile"
1152 exit 0
1155 # libtool link mode
1156 link | relink)
1157 modename="$modename: link"
1158 case $host in
1159 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1160 # It is impossible to link a dll without this setting, and
1161 # we shouldn't force the makefile maintainer to figure out
1162 # which system we are compiling for in order to pass an extra
1163 # flag for every libtool invocation.
1164 # allow_undefined=no
1166 # FIXME: Unfortunately, there are problems with the above when trying
1167 # to make a dll which has undefined symbols, in which case not
1168 # even a static library is built. For now, we need to specify
1169 # -no-undefined on the libtool link line when we can be certain
1170 # that all symbols are satisfied, otherwise we get a static library.
1171 allow_undefined=yes
1174 allow_undefined=yes
1176 esac
1177 libtool_args="$nonopt"
1178 base_compile="$nonopt"
1179 compile_command="$nonopt"
1180 finalize_command="$nonopt"
1182 compile_rpath=
1183 finalize_rpath=
1184 compile_shlibpath=
1185 finalize_shlibpath=
1186 convenience=
1187 old_convenience=
1188 deplibs=
1189 old_deplibs=
1190 add_flags=
1191 compiler_flags=
1192 linker_flags=
1193 dllsearchpath=
1194 lib_search_path=`pwd`
1195 inst_prefix_dir=
1197 avoid_version=no
1198 dlfiles=
1199 dlprefiles=
1200 dlself=no
1201 export_dynamic=no
1202 export_symbols=
1203 export_symbols_regex=
1204 generated=
1205 libobjs=
1206 ltlibs=
1207 module=no
1208 no_install=no
1209 objs=
1210 non_pic_objects=
1211 prefer_static_libs=no
1212 preload=no
1213 prev=
1214 prevarg=
1215 release=
1216 rpath=
1217 xrpath=
1218 perm_rpath=
1219 temp_rpath=
1220 thread_safe=no
1221 vinfo=
1222 vinfo_number=no
1224 # We need to know -static, to get the right output filenames.
1225 for arg
1227 case $arg in
1228 -all-static | -static)
1229 if test "X$arg" = "X-all-static"; then
1230 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1231 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1233 if test -n "$link_static_flag"; then
1234 dlopen_self=$dlopen_self_static
1236 else
1237 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1238 dlopen_self=$dlopen_self_static
1241 build_libtool_libs=no
1242 build_old_libs=yes
1243 prefer_static_libs=yes
1244 break
1246 esac
1247 done
1249 # See if our shared archives depend on static archives.
1250 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1252 # Go through the arguments, transforming them on the way.
1253 while test "$#" -gt 0; do
1254 arg="$1"
1255 base_compile="$base_compile $arg"
1256 shift
1257 case $arg in
1258 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1259 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1261 *) qarg=$arg ;;
1262 esac
1263 libtool_args="$libtool_args $qarg"
1265 # If the previous option needs an argument, assign it.
1266 if test -n "$prev"; then
1267 case $prev in
1268 output)
1269 compile_command="$compile_command @OUTPUT@"
1270 finalize_command="$finalize_command @OUTPUT@"
1272 esac
1274 case $prev in
1275 dlfiles|dlprefiles)
1276 if test "$preload" = no; then
1277 # Add the symbol object into the linking commands.
1278 compile_command="$compile_command @SYMFILE@"
1279 finalize_command="$finalize_command @SYMFILE@"
1280 preload=yes
1282 case $arg in
1283 *.la | *.lo) ;; # We handle these cases below.
1284 force)
1285 if test "$dlself" = no; then
1286 dlself=needless
1287 export_dynamic=yes
1289 prev=
1290 continue
1292 self)
1293 if test "$prev" = dlprefiles; then
1294 dlself=yes
1295 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1296 dlself=yes
1297 else
1298 dlself=needless
1299 export_dynamic=yes
1301 prev=
1302 continue
1305 if test "$prev" = dlfiles; then
1306 dlfiles="$dlfiles $arg"
1307 else
1308 dlprefiles="$dlprefiles $arg"
1310 prev=
1311 continue
1313 esac
1315 expsyms)
1316 export_symbols="$arg"
1317 if test ! -f "$arg"; then
1318 $echo "$modename: symbol file \`$arg' does not exist"
1319 exit 1
1321 prev=
1322 continue
1324 expsyms_regex)
1325 export_symbols_regex="$arg"
1326 prev=
1327 continue
1329 inst_prefix)
1330 inst_prefix_dir="$arg"
1331 prev=
1332 continue
1334 release)
1335 release="-$arg"
1336 prev=
1337 continue
1339 objectlist)
1340 if test -f "$arg"; then
1341 save_arg=$arg
1342 moreargs=
1343 for fil in `cat $save_arg`
1345 # moreargs="$moreargs $fil"
1346 arg=$fil
1347 # A libtool-controlled object.
1349 # Check to see that this really is a libtool object.
1350 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1351 pic_object=
1352 non_pic_object=
1354 # Read the .lo file
1355 # If there is no directory component, then add one.
1356 case $arg in
1357 */* | *\\*) . $arg ;;
1358 *) . ./$arg ;;
1359 esac
1361 if test -z "$pic_object" || \
1362 test -z "$non_pic_object" ||
1363 test "$pic_object" = none && \
1364 test "$non_pic_object" = none; then
1365 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1366 exit 1
1369 # Extract subdirectory from the argument.
1370 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1371 if test "X$xdir" = "X$arg"; then
1372 xdir=
1373 else
1374 xdir="$xdir/"
1377 if test "$pic_object" != none; then
1378 # Prepend the subdirectory the object is found in.
1379 pic_object="$xdir$pic_object"
1381 if test "$prev" = dlfiles; then
1382 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1383 dlfiles="$dlfiles $pic_object"
1384 prev=
1385 continue
1386 else
1387 # If libtool objects are unsupported, then we need to preload.
1388 prev=dlprefiles
1392 # CHECK ME: I think I busted this. -Ossama
1393 if test "$prev" = dlprefiles; then
1394 # Preload the old-style object.
1395 dlprefiles="$dlprefiles $pic_object"
1396 prev=
1399 # A PIC object.
1400 libobjs="$libobjs $pic_object"
1401 arg="$pic_object"
1404 # Non-PIC object.
1405 if test "$non_pic_object" != none; then
1406 # Prepend the subdirectory the object is found in.
1407 non_pic_object="$xdir$non_pic_object"
1409 # A standard non-PIC object
1410 non_pic_objects="$non_pic_objects $non_pic_object"
1411 if test -z "$pic_object" || test "$pic_object" = none ; then
1412 arg="$non_pic_object"
1415 else
1416 # Only an error if not doing a dry-run.
1417 if test -z "$run"; then
1418 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1419 exit 1
1420 else
1421 # Dry-run case.
1423 # Extract subdirectory from the argument.
1424 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1425 if test "X$xdir" = "X$arg"; then
1426 xdir=
1427 else
1428 xdir="$xdir/"
1431 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1432 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1433 libobjs="$libobjs $pic_object"
1434 non_pic_objects="$non_pic_objects $non_pic_object"
1437 done
1438 else
1439 $echo "$modename: link input file \`$save_arg' does not exist"
1440 exit 1
1442 arg=$save_arg
1443 prev=
1444 continue
1446 rpath | xrpath)
1447 # We need an absolute path.
1448 case $arg in
1449 [\\/]* | [A-Za-z]:[\\/]*) ;;
1451 $echo "$modename: only absolute run-paths are allowed" 1>&2
1452 exit 1
1454 esac
1455 if test "$prev" = rpath; then
1456 case "$rpath " in
1457 *" $arg "*) ;;
1458 *) rpath="$rpath $arg" ;;
1459 esac
1460 else
1461 case "$xrpath " in
1462 *" $arg "*) ;;
1463 *) xrpath="$xrpath $arg" ;;
1464 esac
1466 prev=
1467 continue
1469 xcompiler)
1470 compiler_flags="$compiler_flags $qarg"
1471 prev=
1472 compile_command="$compile_command $qarg"
1473 finalize_command="$finalize_command $qarg"
1474 continue
1476 xlinker)
1477 linker_flags="$linker_flags $qarg"
1478 compiler_flags="$compiler_flags $wl$qarg"
1479 prev=
1480 compile_command="$compile_command $wl$qarg"
1481 finalize_command="$finalize_command $wl$qarg"
1482 continue
1484 xcclinker)
1485 linker_flags="$linker_flags $qarg"
1486 compiler_flags="$compiler_flags $qarg"
1487 prev=
1488 compile_command="$compile_command $qarg"
1489 finalize_command="$finalize_command $qarg"
1490 continue
1492 framework)
1493 case $host in
1494 *-*-darwin*)
1495 case "$deplibs " in
1496 *" $qarg.ltframework "*) ;;
1497 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
1499 esac
1501 esac
1502 prev=
1503 continue
1506 eval "$prev=\"\$arg\""
1507 prev=
1508 continue
1510 esac
1511 fi # test -n "$prev"
1513 prevarg="$arg"
1515 case $arg in
1516 -all-static)
1517 if test -n "$link_static_flag"; then
1518 compile_command="$compile_command $link_static_flag"
1519 finalize_command="$finalize_command $link_static_flag"
1521 continue
1524 -allow-undefined)
1525 # FIXME: remove this flag sometime in the future.
1526 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1527 continue
1530 -avoid-version)
1531 avoid_version=yes
1532 continue
1535 -dlopen)
1536 prev=dlfiles
1537 continue
1540 -dlpreopen)
1541 prev=dlprefiles
1542 continue
1545 -export-dynamic)
1546 export_dynamic=yes
1547 continue
1550 -export-symbols | -export-symbols-regex)
1551 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1552 $echo "$modename: more than one -exported-symbols argument is not allowed"
1553 exit 1
1555 if test "X$arg" = "X-export-symbols"; then
1556 prev=expsyms
1557 else
1558 prev=expsyms_regex
1560 continue
1563 -inst-prefix-dir)
1564 prev=inst_prefix
1565 continue
1568 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1569 # so, if we see these flags be careful not to treat them like -L
1570 -L[A-Z][A-Z]*:*)
1571 case $with_gcc/$host in
1572 no/*-*-irix* | /*-*-irix*)
1573 compile_command="$compile_command $arg"
1574 finalize_command="$finalize_command $arg"
1576 esac
1577 continue
1580 -L*)
1581 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1582 # We need an absolute path.
1583 case $dir in
1584 [\\/]* | [A-Za-z]:[\\/]*) ;;
1586 absdir=`cd "$dir" && pwd`
1587 if test -z "$absdir"; then
1588 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1589 exit 1
1591 dir="$absdir"
1593 esac
1594 case "$deplibs " in
1595 *" -L$dir "*) ;;
1597 deplibs="$deplibs -L$dir"
1598 lib_search_path="$lib_search_path $dir"
1600 esac
1601 case $host in
1602 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1603 case :$dllsearchpath: in
1604 *":$dir:"*) ;;
1605 *) dllsearchpath="$dllsearchpath:$dir";;
1606 esac
1608 esac
1609 continue
1612 -l*)
1613 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1614 case $host in
1615 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1616 # These systems don't actually have a C or math library (as such)
1617 continue
1619 *-*-mingw* | *-*-os2*)
1620 # These systems don't actually have a C library (as such)
1621 test "X$arg" = "X-lc" && continue
1623 *-*-openbsd* | *-*-freebsd*)
1624 # Do not include libc due to us having libc/libc_r.
1625 test "X$arg" = "X-lc" && continue
1627 *-*-rhapsody* | *-*-darwin1.[012])
1628 # Rhapsody C and math libraries are in the System framework
1629 deplibs="$deplibs System.ltframework"
1630 continue
1631 esac
1632 elif test "X$arg" = "X-lc_r"; then
1633 case $host in
1634 *-*-openbsd*)
1635 # Do not include libc_r directly, use -pthread flag.
1636 continue
1638 esac
1640 deplibs="$deplibs $arg"
1641 continue
1644 -module)
1645 module=yes
1646 continue
1649 # gcc -m* arguments should be passed to the linker via $compiler_flags
1650 # in order to pass architecture information to the linker
1651 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1652 # but this is not reliable with gcc because gcc may use -mfoo to
1653 # select a different linker, different libraries, etc, while
1654 # -Wl,-mfoo simply passes -mfoo to the linker.
1655 -m*)
1656 # Unknown arguments in both finalize_command and compile_command need
1657 # to be aesthetically quoted because they are evaled later.
1658 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1659 case $arg in
1660 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1661 arg="\"$arg\""
1663 esac
1664 compile_command="$compile_command $arg"
1665 finalize_command="$finalize_command $arg"
1666 if test "$with_gcc" = "yes" ; then
1667 compiler_flags="$compiler_flags $arg"
1669 continue
1672 -shrext)
1673 prev=shrext
1674 continue
1677 -no-fast-install)
1678 fast_install=no
1679 continue
1682 -no-install)
1683 case $host in
1684 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1685 # The PATH hackery in wrapper scripts is required on Windows
1686 # in order for the loader to find any dlls it needs.
1687 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1688 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1689 fast_install=no
1691 *) no_install=yes ;;
1692 esac
1693 continue
1696 -no-undefined)
1697 allow_undefined=no
1698 continue
1701 -objectlist)
1702 prev=objectlist
1703 continue
1706 -o) prev=output ;;
1708 -release)
1709 prev=release
1710 continue
1713 -rpath)
1714 prev=rpath
1715 continue
1719 prev=xrpath
1720 continue
1723 -R*)
1724 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1725 # We need an absolute path.
1726 case $dir in
1727 [\\/]* | [A-Za-z]:[\\/]*) ;;
1729 $echo "$modename: only absolute run-paths are allowed" 1>&2
1730 exit 1
1732 esac
1733 case "$xrpath " in
1734 *" $dir "*) ;;
1735 *) xrpath="$xrpath $dir" ;;
1736 esac
1737 continue
1740 -static)
1741 # The effects of -static are defined in a previous loop.
1742 # We used to do the same as -all-static on platforms that
1743 # didn't have a PIC flag, but the assumption that the effects
1744 # would be equivalent was wrong. It would break on at least
1745 # Digital Unix and AIX.
1746 continue
1749 -thread-safe)
1750 thread_safe=yes
1751 continue
1754 -version-info)
1755 prev=vinfo
1756 continue
1758 -version-number)
1759 prev=vinfo
1760 vinfo_number=yes
1761 continue
1764 -Wc,*)
1765 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1766 arg=
1767 save_ifs="$IFS"; IFS=','
1768 for flag in $args; do
1769 IFS="$save_ifs"
1770 case $flag in
1771 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1772 flag="\"$flag\""
1774 esac
1775 arg="$arg $wl$flag"
1776 compiler_flags="$compiler_flags $flag"
1777 done
1778 IFS="$save_ifs"
1779 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1782 -Wl,*)
1783 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1784 arg=
1785 save_ifs="$IFS"; IFS=','
1786 for flag in $args; do
1787 IFS="$save_ifs"
1788 case $flag in
1789 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1790 flag="\"$flag\""
1792 esac
1793 arg="$arg $wl$flag"
1794 compiler_flags="$compiler_flags $wl$flag"
1795 linker_flags="$linker_flags $flag"
1796 done
1797 IFS="$save_ifs"
1798 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1801 -Xcompiler)
1802 prev=xcompiler
1803 continue
1806 -Xlinker)
1807 prev=xlinker
1808 continue
1811 -XCClinker)
1812 prev=xcclinker
1813 continue
1816 -framework)
1817 prev=framework
1818 continue
1821 # Some other compiler flag.
1822 -* | +*)
1823 # Unknown arguments in both finalize_command and compile_command need
1824 # to be aesthetically quoted because they are evaled later.
1825 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1826 case $arg in
1827 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1828 arg="\"$arg\""
1830 esac
1831 add_flags="$add_flags $arg"
1834 *.$objext)
1835 # A standard object.
1836 objs="$objs $arg"
1839 *.lo)
1840 # A libtool-controlled object.
1842 # Check to see that this really is a libtool object.
1843 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1844 pic_object=
1845 non_pic_object=
1847 # Read the .lo file
1848 # If there is no directory component, then add one.
1849 case $arg in
1850 */* | *\\*) . $arg ;;
1851 *) . ./$arg ;;
1852 esac
1854 if test -z "$pic_object" || \
1855 test -z "$non_pic_object" ||
1856 test "$pic_object" = none && \
1857 test "$non_pic_object" = none; then
1858 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1859 exit 1
1862 # Extract subdirectory from the argument.
1863 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1864 if test "X$xdir" = "X$arg"; then
1865 xdir=
1866 else
1867 xdir="$xdir/"
1870 if test "$pic_object" != none; then
1871 # Prepend the subdirectory the object is found in.
1872 pic_object="$xdir$pic_object"
1874 if test "$prev" = dlfiles; then
1875 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1876 dlfiles="$dlfiles $pic_object"
1877 prev=
1878 continue
1879 else
1880 # If libtool objects are unsupported, then we need to preload.
1881 prev=dlprefiles
1885 # CHECK ME: I think I busted this. -Ossama
1886 if test "$prev" = dlprefiles; then
1887 # Preload the old-style object.
1888 dlprefiles="$dlprefiles $pic_object"
1889 prev=
1892 # A PIC object.
1893 libobjs="$libobjs $pic_object"
1894 arg="$pic_object"
1897 # Non-PIC object.
1898 if test "$non_pic_object" != none; then
1899 # Prepend the subdirectory the object is found in.
1900 non_pic_object="$xdir$non_pic_object"
1902 # A standard non-PIC object
1903 non_pic_objects="$non_pic_objects $non_pic_object"
1904 if test -z "$pic_object" || test "$pic_object" = none ; then
1905 arg="$non_pic_object"
1908 else
1909 # Only an error if not doing a dry-run.
1910 if test -z "$run"; then
1911 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1912 exit 1
1913 else
1914 # Dry-run case.
1916 # Extract subdirectory from the argument.
1917 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1918 if test "X$xdir" = "X$arg"; then
1919 xdir=
1920 else
1921 xdir="$xdir/"
1924 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1925 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1926 libobjs="$libobjs $pic_object"
1927 non_pic_objects="$non_pic_objects $non_pic_object"
1932 *.$libext)
1933 # An archive.
1934 deplibs="$deplibs $arg"
1935 old_deplibs="$old_deplibs $arg"
1936 continue
1939 *.la)
1940 # A libtool-controlled library.
1942 if test "$prev" = dlfiles; then
1943 # This library was specified with -dlopen.
1944 dlfiles="$dlfiles $arg"
1945 prev=
1946 elif test "$prev" = dlprefiles; then
1947 # The library was specified with -dlpreopen.
1948 dlprefiles="$dlprefiles $arg"
1949 prev=
1950 else
1951 deplibs="$deplibs $arg"
1953 continue
1956 # Some other compiler argument.
1958 # Unknown arguments in both finalize_command and compile_command need
1959 # to be aesthetically quoted because they are evaled later.
1960 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1961 case $arg in
1962 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1963 arg="\"$arg\""
1965 esac
1966 add_flags="$add_flags $arg"
1968 esac # arg
1970 # Now actually substitute the argument into the commands.
1971 if test -n "$arg"; then
1972 compile_command="$compile_command $arg"
1973 finalize_command="$finalize_command $arg"
1975 done # argument parsing loop
1977 if test -n "$prev"; then
1978 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1979 $echo "$help" 1>&2
1980 exit 1
1983 # Infer tagged configuration to use if any are available and
1984 # if one wasn't chosen via the "--tag" command line option.
1985 # Only attempt this if the compiler in the base link
1986 # command doesn't match the default compiler.
1987 if test -n "$available_tags" && test -z "$tagname"; then
1988 case $base_compile in
1989 # Blanks in the command may have been stripped by the calling shell,
1990 # but not from the CC environment variable when configure was run.
1991 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1992 # Blanks at the start of $base_compile will cause this to fail
1993 # if we don't check for them as well.
1995 for z in $available_tags; do
1996 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1997 # Evaluate the configuration.
1998 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1999 case $base_compile in
2000 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
2001 # The compiler in $compile_command matches
2002 # the one in the tagged configuration.
2003 # Assume this is the tagged configuration we want.
2004 tagname=$z
2005 break
2007 esac
2009 done
2010 # If $tagname still isn't set, then no tagged configuration
2011 # was found and let the user know that the "--tag" command
2012 # line option must be used.
2013 if test -z "$tagname"; then
2014 $echo "$modename: unable to infer tagged configuration"
2015 $echo "$modename: specify a tag with \`--tag'" 1>&2
2016 exit 1
2017 # else
2018 # $echo "$modename: using $tagname tagged configuration"
2021 esac
2024 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2025 eval arg=\"$export_dynamic_flag_spec\"
2026 compile_command="$compile_command $arg"
2027 finalize_command="$finalize_command $arg"
2030 oldlibs=
2031 # calculate the name of the file, without its directory
2032 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2033 libobjs_save="$libobjs"
2035 if test -n "$shlibpath_var"; then
2036 # get the directories listed in $shlibpath_var
2037 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2038 else
2039 shlib_search_path=
2041 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
2042 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
2044 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2045 if test "X$output_objdir" = "X$output"; then
2046 output_objdir="$objdir"
2047 else
2048 output_objdir="$output_objdir/$objdir"
2050 # Create the object directory.
2051 if test ! -d "$output_objdir"; then
2052 $show "$mkdir $output_objdir"
2053 $run $mkdir $output_objdir
2054 status=$?
2055 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
2056 exit $status
2060 # Determine the type of output
2061 case $output in
2063 $echo "$modename: you must specify an output file" 1>&2
2064 $echo "$help" 1>&2
2065 exit 1
2067 *.$libext) linkmode=oldlib ;;
2068 *.lo | *.$objext) linkmode=obj ;;
2069 *.la) linkmode=lib ;;
2070 *) linkmode=prog ;; # Anything else should be a program.
2071 esac
2073 case $host in
2074 *cygwin* | *mingw* | *pw32*)
2075 # don't eliminate duplcations in $postdeps and $predeps
2076 duplicate_compiler_generated_deps=yes
2079 duplicate_compiler_generated_deps=$duplicate_deps
2081 esac
2082 specialdeplibs=
2084 libs=
2085 # Find all interdependent deplibs by searching for libraries
2086 # that are linked more than once (e.g. -la -lb -la)
2087 for deplib in $deplibs; do
2088 if test "X$duplicate_deps" = "Xyes" ; then
2089 case "$libs " in
2090 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2091 esac
2093 libs="$libs $deplib"
2094 done
2096 if test "$linkmode" = lib; then
2097 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2099 # Compute libraries that are listed more than once in $predeps
2100 # $postdeps and mark them as special (i.e., whose duplicates are
2101 # not to be eliminated).
2102 pre_post_deps=
2103 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2104 for pre_post_dep in $predeps $postdeps; do
2105 case "$pre_post_deps " in
2106 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2107 esac
2108 pre_post_deps="$pre_post_deps $pre_post_dep"
2109 done
2111 pre_post_deps=
2114 deplibs=
2115 newdependency_libs=
2116 newlib_search_path=
2117 need_relink=no # whether we're linking any uninstalled libtool libraries
2118 notinst_deplibs= # not-installed libtool libraries
2119 notinst_path= # paths that contain not-installed libtool libraries
2120 case $linkmode in
2121 lib)
2122 passes="conv link"
2123 for file in $dlfiles $dlprefiles; do
2124 case $file in
2125 *.la) ;;
2127 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2128 exit 1
2130 esac
2131 done
2133 prog)
2134 compile_deplibs=
2135 finalize_deplibs=
2136 alldeplibs=no
2137 newdlfiles=
2138 newdlprefiles=
2139 passes="conv scan dlopen dlpreopen link"
2141 *) passes="conv"
2143 esac
2144 for pass in $passes; do
2145 if test "$linkmode,$pass" = "lib,link" ||
2146 test "$linkmode,$pass" = "prog,scan"; then
2147 libs="$deplibs"
2148 deplibs=
2150 if test "$linkmode" = prog; then
2151 case $pass in
2152 dlopen) libs="$dlfiles" ;;
2153 dlpreopen) libs="$dlprefiles" ;;
2154 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2155 esac
2157 if test "$pass" = dlopen; then
2158 # Collect dlpreopened libraries
2159 save_deplibs="$deplibs"
2160 deplibs=
2162 for deplib in $libs; do
2163 lib=
2164 found=no
2165 case $deplib in
2166 -l*)
2167 if test "$linkmode" != lib && test "$linkmode" != prog; then
2168 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2169 continue
2171 if test "$pass" = conv && test "$allow_undefined" = yes; then
2172 deplibs="$deplib $deplibs"
2173 continue
2175 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2176 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2177 for search_ext in .la $shrext .so .a; do
2178 # Search the libtool library
2179 lib="$searchdir/lib${name}${search_ext}"
2180 if test -f "$lib"; then
2181 if test "$search_ext" = ".la"; then
2182 found=yes
2183 else
2184 found=no
2186 break 2
2188 done
2189 done
2190 if test "$found" != yes; then
2191 # deplib doesn't seem to be a libtool library
2192 if test "$linkmode,$pass" = "prog,link"; then
2193 compile_deplibs="$deplib $compile_deplibs"
2194 finalize_deplibs="$deplib $finalize_deplibs"
2195 else
2196 deplibs="$deplib $deplibs"
2197 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2199 continue
2200 else # deplib is a libtool library
2201 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2202 # We need to do some special things here, and not later.
2203 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2204 case " $predeps $postdeps " in
2205 *" $deplib "*)
2206 if (${SED} -e '2q' $lib |
2207 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2208 library_names=
2209 old_library=
2210 case $lib in
2211 */* | *\\*) . $lib ;;
2212 *) . ./$lib ;;
2213 esac
2214 for l in $old_library $library_names; do
2215 ll="$l"
2216 done
2217 if test "X$ll" = "X$old_library" ; then # only static version available
2218 found=no
2219 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2220 test "X$ladir" = "X$lib" && ladir="."
2221 lib=$ladir/$old_library
2222 if test "$linkmode,$pass" = "prog,link"; then
2223 compile_deplibs="$deplib $compile_deplibs"
2224 finalize_deplibs="$deplib $finalize_deplibs"
2225 else
2226 deplibs="$deplib $deplibs"
2227 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2229 continue
2233 *) ;;
2234 esac
2237 ;; # -l
2238 *.ltframework)
2239 if test "$linkmode,$pass" = "prog,link"; then
2240 compile_deplibs="$deplib $compile_deplibs"
2241 finalize_deplibs="$deplib $finalize_deplibs"
2242 else
2243 deplibs="$deplib $deplibs"
2244 if test "$linkmode" = lib ; then
2245 newdependency_libs="$deplib $newdependency_libs"
2248 continue
2250 -L*)
2251 case $linkmode in
2252 lib)
2253 deplibs="$deplib $deplibs"
2254 test "$pass" = conv && continue
2255 newdependency_libs="$deplib $newdependency_libs"
2256 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2258 prog)
2259 if test "$pass" = conv; then
2260 deplibs="$deplib $deplibs"
2261 continue
2263 if test "$pass" = scan; then
2264 deplibs="$deplib $deplibs"
2265 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2266 else
2267 compile_deplibs="$deplib $compile_deplibs"
2268 finalize_deplibs="$deplib $finalize_deplibs"
2272 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2274 esac # linkmode
2275 continue
2276 ;; # -L
2277 -R*)
2278 if test "$pass" = link; then
2279 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2280 # Make sure the xrpath contains only unique directories.
2281 case "$xrpath " in
2282 *" $dir "*) ;;
2283 *) xrpath="$xrpath $dir" ;;
2284 esac
2286 deplibs="$deplib $deplibs"
2287 continue
2289 *.la) lib="$deplib" ;;
2290 *.$libext)
2291 if test "$pass" = conv; then
2292 deplibs="$deplib $deplibs"
2293 continue
2295 case $linkmode in
2296 lib)
2297 if test "$deplibs_check_method" != pass_all; then
2298 $echo
2299 $echo "*** Warning: Trying to link with static lib archive $deplib."
2300 $echo "*** I have the capability to make that library automatically link in when"
2301 $echo "*** you link to this library. But I can only do this if you have a"
2302 $echo "*** shared version of the library, which you do not appear to have"
2303 $echo "*** because the file extensions .$libext of this argument makes me believe"
2304 $echo "*** that it is just a static archive that I should not used here."
2305 else
2306 $echo
2307 $echo "*** Warning: Linking the shared library $output against the"
2308 $echo "*** static library $deplib is not portable!"
2309 deplibs="$deplib $deplibs"
2311 continue
2313 prog)
2314 if test "$pass" != link; then
2315 deplibs="$deplib $deplibs"
2316 else
2317 compile_deplibs="$deplib $compile_deplibs"
2318 finalize_deplibs="$deplib $finalize_deplibs"
2320 continue
2322 esac # linkmode
2323 ;; # *.$libext
2324 *.lo | *.$objext)
2325 if test "$pass" = conv; then
2326 deplibs="$deplib $deplibs"
2327 elif test "$linkmode" = prog; then
2328 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2329 # If there is no dlopen support or we're linking statically,
2330 # we need to preload.
2331 newdlprefiles="$newdlprefiles $deplib"
2332 compile_deplibs="$deplib $compile_deplibs"
2333 finalize_deplibs="$deplib $finalize_deplibs"
2334 else
2335 newdlfiles="$newdlfiles $deplib"
2338 continue
2340 %DEPLIBS%)
2341 alldeplibs=yes
2342 continue
2344 esac # case $deplib
2345 if test "$found" = yes || test -f "$lib"; then :
2346 else
2347 $echo "$modename: cannot find the library \`$lib'" 1>&2
2348 exit 1
2351 # Check to see that this really is a libtool archive.
2352 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2353 else
2354 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2355 exit 1
2358 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2359 test "X$ladir" = "X$lib" && ladir="."
2361 dlname=
2362 dlopen=
2363 dlpreopen=
2364 libdir=
2365 library_names=
2366 old_library=
2367 # If the library was installed with an old release of libtool,
2368 # it will not redefine variables installed, or shouldnotlink
2369 installed=yes
2370 shouldnotlink=no
2372 # Read the .la file
2373 case $lib in
2374 */* | *\\*) . $lib ;;
2375 *) . ./$lib ;;
2376 esac
2378 case $host in
2379 *-*-darwin*)
2380 # Convert "-framework foo" to "foo.ltframework" in dependency_libs
2381 test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
2383 esac
2385 if test "$linkmode,$pass" = "lib,link" ||
2386 test "$linkmode,$pass" = "prog,scan" ||
2387 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2388 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2389 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2392 if test "$pass" = conv; then
2393 # Only check for convenience libraries
2394 deplibs="$lib $deplibs"
2395 tmp_libs=
2396 for deplib in $dependency_libs; do
2397 #echo "Adding $deplib to \$deplibs"
2398 deplibs="$deplib $deplibs"
2399 if test "X$duplicate_deps" = "Xyes" ; then
2400 case "$tmp_libs " in
2401 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2402 esac
2404 tmp_libs="$tmp_libs $deplib"
2405 done
2406 if test -z "$libdir"; then
2407 if test -z "$old_library"; then
2408 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2409 exit 1
2411 # It is a libtool convenience library, so add in its objects.
2412 convenience="$convenience $ladir/$objdir/$old_library"
2413 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2414 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2415 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2416 exit 1
2418 continue
2419 fi # $pass = conv
2422 # Get the name of the library we link against.
2423 linklib=
2424 for l in $old_library $library_names; do
2425 linklib="$l"
2426 done
2427 if test -z "$linklib"; then
2428 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2429 exit 1
2432 # This library was specified with -dlopen.
2433 if test "$pass" = dlopen; then
2434 if test -z "$libdir"; then
2435 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2436 exit 1
2438 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2439 # If there is no dlname, no dlopen support or we're linking
2440 # statically, we need to preload. We also need to preload any
2441 # dependent libraries so libltdl's deplib preloader doesn't
2442 # bomb out in the load deplibs phase.
2443 dlprefiles="$dlprefiles $lib $dependency_libs"
2444 else
2445 newdlfiles="$newdlfiles $lib"
2447 continue
2448 fi # $pass = dlopen
2450 # We need an absolute path.
2451 case $ladir in
2452 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2454 abs_ladir=`cd "$ladir" && pwd`
2455 if test -z "$abs_ladir"; then
2456 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2457 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2458 abs_ladir="$ladir"
2461 esac
2462 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2464 # Find the relevant object directory and library name.
2465 if test "X$installed" = Xyes; then
2466 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2467 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2468 dir="$ladir"
2469 absdir="$abs_ladir"
2470 libdir="$abs_ladir"
2471 else
2472 dir="$libdir"
2473 absdir="$libdir"
2475 else
2476 dir="$ladir/$objdir"
2477 absdir="$abs_ladir/$objdir"
2478 # Remove this search path later
2479 notinst_path="$notinst_path $abs_ladir"
2480 fi # $installed = yes
2481 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2483 # This library was specified with -dlpreopen.
2484 if test "$pass" = dlpreopen; then
2485 if test -z "$libdir"; then
2486 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2487 exit 1
2489 # Prefer using a static library (so that no silly _DYNAMIC symbols
2490 # are required to link).
2491 if test -n "$old_library"; then
2492 newdlprefiles="$newdlprefiles $dir/$old_library"
2493 # Otherwise, use the dlname, so that lt_dlopen finds it.
2494 elif test -n "$dlname"; then
2495 newdlprefiles="$newdlprefiles $dir/$dlname"
2496 else
2497 newdlprefiles="$newdlprefiles $dir/$linklib"
2499 fi # $pass = dlpreopen
2501 if test -z "$libdir"; then
2502 # Link the convenience library
2503 if test "$linkmode" = lib; then
2504 deplibs="$dir/$old_library $deplibs"
2505 elif test "$linkmode,$pass" = "prog,link"; then
2506 compile_deplibs="$dir/$old_library $compile_deplibs"
2507 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2508 else
2509 deplibs="$lib $deplibs" # used for prog,scan pass
2511 continue
2515 if test "$linkmode" = prog && test "$pass" != link; then
2516 newlib_search_path="$newlib_search_path $ladir"
2517 deplibs="$lib $deplibs"
2519 linkalldeplibs=no
2520 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2521 test "$build_libtool_libs" = no; then
2522 linkalldeplibs=yes
2525 tmp_libs=
2526 for deplib in $dependency_libs; do
2527 case $deplib in
2528 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2529 esac
2530 # Need to link against all dependency_libs?
2531 if test "$linkalldeplibs" = yes; then
2532 deplibs="$deplib $deplibs"
2533 else
2534 # Need to hardcode shared library paths
2535 # or/and link against static libraries
2536 newdependency_libs="$deplib $newdependency_libs"
2538 if test "X$duplicate_deps" = "Xyes" ; then
2539 case "$tmp_libs " in
2540 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2541 esac
2543 tmp_libs="$tmp_libs $deplib"
2544 done # for deplib
2545 continue
2546 fi # $linkmode = prog...
2548 if test "$linkmode,$pass" = "prog,link"; then
2549 if test -n "$library_names" &&
2550 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2551 # We need to hardcode the library path
2552 if test -n "$shlibpath_var"; then
2553 # Make sure the rpath contains only unique directories.
2554 case "$temp_rpath " in
2555 *" $dir "*) ;;
2556 *" $absdir "*) ;;
2557 *) temp_rpath="$temp_rpath $dir" ;;
2558 esac
2561 # Hardcode the library path.
2562 # Skip directories that are in the system default run-time
2563 # search path.
2564 case " $sys_lib_dlsearch_path " in
2565 *" $absdir "*) ;;
2567 case "$compile_rpath " in
2568 *" $absdir "*) ;;
2569 *) compile_rpath="$compile_rpath $absdir"
2570 esac
2572 esac
2573 case " $sys_lib_dlsearch_path " in
2574 *" $libdir "*) ;;
2576 case "$finalize_rpath " in
2577 *" $libdir "*) ;;
2578 *) finalize_rpath="$finalize_rpath $libdir"
2579 esac
2581 esac
2582 fi # $linkmode,$pass = prog,link...
2584 if test "$alldeplibs" = yes &&
2585 { test "$deplibs_check_method" = pass_all ||
2586 { test "$build_libtool_libs" = yes &&
2587 test -n "$library_names"; }; }; then
2588 # We only need to search for static libraries
2589 continue
2593 link_static=no # Whether the deplib will be linked statically
2594 if test -n "$library_names" &&
2595 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2596 if test "$installed" = no; then
2597 notinst_deplibs="$notinst_deplibs $lib"
2598 need_relink=yes
2600 # This is a shared library
2602 # Warn about portability, can't link against -module's on some systems (darwin)
2603 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2604 $echo
2605 if test "$linkmode" = prog; then
2606 $echo "*** Warning: Linking the executable $output against the loadable module"
2607 else
2608 $echo "*** Warning: Linking the shared library $output against the loadable module"
2610 $echo "*** $linklib is not portable!"
2612 if test "$linkmode" = lib &&
2613 test "$hardcode_into_libs" = yes; then
2614 # Hardcode the library path.
2615 # Skip directories that are in the system default run-time
2616 # search path.
2617 case " $sys_lib_dlsearch_path " in
2618 *" $absdir "*) ;;
2620 case "$compile_rpath " in
2621 *" $absdir "*) ;;
2622 *) compile_rpath="$compile_rpath $absdir"
2623 esac
2625 esac
2626 case " $sys_lib_dlsearch_path " in
2627 *" $libdir "*) ;;
2629 case "$finalize_rpath " in
2630 *" $libdir "*) ;;
2631 *) finalize_rpath="$finalize_rpath $libdir"
2632 esac
2634 esac
2637 if test -n "$old_archive_from_expsyms_cmds"; then
2638 # figure out the soname
2639 set dummy $library_names
2640 realname="$2"
2641 shift; shift
2642 libname=`eval \\$echo \"$libname_spec\"`
2643 # use dlname if we got it. it's perfectly good, no?
2644 if test -n "$dlname"; then
2645 soname="$dlname"
2646 elif test -n "$soname_spec"; then
2647 # bleh windows
2648 case $host in
2649 *cygwin* | mingw*)
2650 major=`expr $current - $age`
2651 versuffix="-$major"
2653 esac
2654 eval soname=\"$soname_spec\"
2655 else
2656 soname="$realname"
2659 # Make a new name for the extract_expsyms_cmds to use
2660 soroot="$soname"
2661 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2662 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2664 # If the library has no export list, then create one now
2665 if test -f "$output_objdir/$soname-def"; then :
2666 else
2667 $show "extracting exported symbol list from \`$soname'"
2668 save_ifs="$IFS"; IFS='~'
2669 eval cmds=\"$extract_expsyms_cmds\"
2670 for cmd in $cmds; do
2671 IFS="$save_ifs"
2672 $show "$cmd"
2673 $run eval "$cmd" || exit $?
2674 done
2675 IFS="$save_ifs"
2678 # Create $newlib
2679 if test -f "$output_objdir/$newlib"; then :; else
2680 $show "generating import library for \`$soname'"
2681 save_ifs="$IFS"; IFS='~'
2682 eval cmds=\"$old_archive_from_expsyms_cmds\"
2683 for cmd in $cmds; do
2684 IFS="$save_ifs"
2685 $show "$cmd"
2686 $run eval "$cmd" || exit $?
2687 done
2688 IFS="$save_ifs"
2690 # make sure the library variables are pointing to the new library
2691 dir=$output_objdir
2692 linklib=$newlib
2693 fi # test -n "$old_archive_from_expsyms_cmds"
2695 if test "$linkmode" = prog || test "$mode" != relink; then
2696 add_shlibpath=
2697 add_dir=
2698 add=
2699 lib_linked=yes
2700 case $hardcode_action in
2701 immediate | unsupported)
2702 if test "$hardcode_direct" = no; then
2703 add="$dir/$linklib"
2704 case $host in
2705 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2706 *-*-darwin* )
2707 # if the lib is a module then we can not link against it, someone
2708 # is ignoring the new warnings I added
2709 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
2710 $echo "** Warning, lib $linklib is a module, not a shared library"
2711 if test -z "$old_library" ; then
2712 $echo
2713 $echo "** And there doesn't seem to be a static archive available"
2714 $echo "** The link will probably fail, sorry"
2715 else
2716 add="$dir/$old_library"
2719 esac
2720 elif test "$hardcode_minus_L" = no; then
2721 case $host in
2722 *-*-sunos*) add_shlibpath="$dir" ;;
2723 esac
2724 add_dir="-L$dir"
2725 add="-l$name"
2726 elif test "$hardcode_shlibpath_var" = no; then
2727 add_shlibpath="$dir"
2728 add="-l$name"
2729 else
2730 lib_linked=no
2733 relink)
2734 if test "$hardcode_direct" = yes; then
2735 add="$dir/$linklib"
2736 elif test "$hardcode_minus_L" = yes; then
2737 add_dir="-L$dir"
2738 # Try looking first in the location we're being installed to.
2739 if test -n "$inst_prefix_dir"; then
2740 case "$libdir" in
2741 [\\/]*)
2742 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2744 esac
2746 add="-l$name"
2747 elif test "$hardcode_shlibpath_var" = yes; then
2748 add_shlibpath="$dir"
2749 add="-l$name"
2750 else
2751 lib_linked=no
2754 *) lib_linked=no ;;
2755 esac
2757 if test "$lib_linked" != yes; then
2758 $echo "$modename: configuration error: unsupported hardcode properties"
2759 exit 1
2762 if test -n "$add_shlibpath"; then
2763 case :$compile_shlibpath: in
2764 *":$add_shlibpath:"*) ;;
2765 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2766 esac
2768 if test "$linkmode" = prog; then
2769 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2770 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2771 else
2772 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2773 test -n "$add" && deplibs="$add $deplibs"
2774 if test "$hardcode_direct" != yes && \
2775 test "$hardcode_minus_L" != yes && \
2776 test "$hardcode_shlibpath_var" = yes; then
2777 case :$finalize_shlibpath: in
2778 *":$libdir:"*) ;;
2779 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2780 esac
2785 if test "$linkmode" = prog || test "$mode" = relink; then
2786 add_shlibpath=
2787 add_dir=
2788 add=
2789 # Finalize command for both is simple: just hardcode it.
2790 if test "$hardcode_direct" = yes; then
2791 add="$libdir/$linklib"
2792 elif test "$hardcode_minus_L" = yes; then
2793 add_dir="-L$libdir"
2794 add="-l$name"
2795 elif test "$hardcode_shlibpath_var" = yes; then
2796 case :$finalize_shlibpath: in
2797 *":$libdir:"*) ;;
2798 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2799 esac
2800 add="-l$name"
2801 elif test "$hardcode_automatic" = yes; then
2802 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
2803 add="$inst_prefix_dir$libdir/$linklib"
2804 else
2805 add="$libdir/$linklib"
2807 else
2808 # We cannot seem to hardcode it, guess we'll fake it.
2809 add_dir="-L$libdir"
2810 # Try looking first in the location we're being installed to.
2811 if test -n "$inst_prefix_dir"; then
2812 case "$libdir" in
2813 [\\/]*)
2814 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2816 esac
2818 add="-l$name"
2821 if test "$linkmode" = prog; then
2822 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2823 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2824 else
2825 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2826 test -n "$add" && deplibs="$add $deplibs"
2829 elif test "$linkmode" = prog; then
2830 # Here we assume that one of hardcode_direct or hardcode_minus_L
2831 # is not unsupported. This is valid on all known static and
2832 # shared platforms.
2833 if test "$hardcode_direct" != unsupported; then
2834 test -n "$old_library" && linklib="$old_library"
2835 compile_deplibs="$dir/$linklib $compile_deplibs"
2836 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2837 else
2838 compile_deplibs="-l$name -L$dir $compile_deplibs"
2839 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2841 elif test "$build_libtool_libs" = yes; then
2842 # Not a shared library
2843 if test "$deplibs_check_method" != pass_all; then
2844 # We're trying link a shared library against a static one
2845 # but the system doesn't support it.
2847 # Just print a warning and add the library to dependency_libs so
2848 # that the program can be linked against the static library.
2849 $echo
2850 $echo "*** Warning: This system can not link to static lib archive $lib."
2851 $echo "*** I have the capability to make that library automatically link in when"
2852 $echo "*** you link to this library. But I can only do this if you have a"
2853 $echo "*** shared version of the library, which you do not appear to have."
2854 if test "$module" = yes; then
2855 $echo "*** But as you try to build a module library, libtool will still create "
2856 $echo "*** a static module, that should work as long as the dlopening application"
2857 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2858 if test -z "$global_symbol_pipe"; then
2859 $echo
2860 $echo "*** However, this would only work if libtool was able to extract symbol"
2861 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2862 $echo "*** not find such a program. So, this module is probably useless."
2863 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2865 if test "$build_old_libs" = no; then
2866 build_libtool_libs=module
2867 build_old_libs=yes
2868 else
2869 build_libtool_libs=no
2872 else
2873 convenience="$convenience $dir/$old_library"
2874 old_convenience="$old_convenience $dir/$old_library"
2875 deplibs="$dir/$old_library $deplibs"
2876 link_static=yes
2878 fi # link shared/static library?
2880 if test "$linkmode" = lib; then
2881 #if test -n "$dependency_libs" &&
2882 # { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2883 # test "$link_static" = yes; }; then
2884 # Extract -R from dependency_libs
2885 temp_deplibs=
2886 for libdir in $dependency_libs; do
2887 case $libdir in
2888 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2889 case " $xrpath " in
2890 *" $temp_xrpath "*) ;;
2891 *) xrpath="$xrpath $temp_xrpath";;
2892 esac;;
2893 *) temp_deplibs="$temp_deplibs $libdir";;
2894 esac
2895 done
2896 dependency_libs="$temp_deplibs"
2899 newlib_search_path="$newlib_search_path $absdir"
2900 # Link against this library
2901 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2902 # ... and its dependency_libs
2903 tmp_libs=
2904 for deplib in $dependency_libs; do
2905 newdependency_libs="$deplib $newdependency_libs"
2906 if test "X$duplicate_deps" = "Xyes" ; then
2907 case "$tmp_libs " in
2908 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2909 esac
2911 tmp_libs="$tmp_libs $deplib"
2912 done
2914 if test "$link_all_deplibs" != no; then
2915 # Add the search paths of all dependency libraries
2916 for deplib in $dependency_libs; do
2917 case $deplib in
2918 -L*) path="$deplib" ;;
2919 *.la)
2920 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2921 test "X$dir" = "X$deplib" && dir="."
2922 # We need an absolute path.
2923 case $dir in
2924 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2926 absdir=`cd "$dir" && pwd`
2927 if test -z "$absdir"; then
2928 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2929 absdir="$dir"
2932 esac
2933 if grep "^installed=no" $deplib > /dev/null; then
2934 path="$absdir/$objdir"
2935 else
2936 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2937 if test -z "$libdir"; then
2938 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2939 exit 1
2941 if test "$absdir" != "$libdir"; then
2942 # Sure, some shells/systems don't implement the -ef.
2943 # Those will have to live with the warning.
2944 test "$absdir" -ef "$libdir" > /dev/null 2>&1 ||
2945 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2947 path="$absdir"
2949 depdepl=
2950 case $host in
2951 *-*-darwin*)
2952 # we do not want to link against static libs, but need to link against shared
2953 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2954 if test -n "$deplibrary_names" ; then
2955 for tmp in $deplibrary_names ; do
2956 depdepl=$tmp
2957 done
2958 if test -f "$path/$depdepl" ; then
2959 depdepl="$path/$depdepl"
2961 # do not add paths which are already there
2962 case " $newlib_search_path " in
2963 *" $path "*) ;;
2964 *) newlib_search_path="$newlib_search_path $path";;
2965 esac
2966 path=""
2970 path="-L$path"
2972 esac
2975 -l*)
2976 case $host in
2977 *-*-darwin*)
2978 # Again, we only want to link against shared libraries
2979 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2980 for tmp in $newlib_search_path ; do
2981 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2982 eval depdepl="$tmp/lib$tmp_libs.dylib"
2983 break
2985 done
2986 path=""
2988 *) continue ;;
2989 esac
2992 *.ltframework)
2993 case $host in
2994 *-*-darwin*)
2995 depdepl="$deplib"
2997 esac
3000 *) continue ;;
3001 esac
3002 case " $deplibs " in
3003 *" $depdepl "*) ;;
3004 *) deplibs="$deplibs $depdepl" ;;
3005 esac
3006 case " $deplibs " in
3007 *" $path "*) ;;
3008 *) deplibs="$deplibs $path" ;;
3009 esac
3010 done
3011 fi # link_all_deplibs != no
3012 fi # linkmode = lib
3013 done # for deplib in $libs
3014 dependency_libs="$newdependency_libs"
3015 if test "$pass" = dlpreopen; then
3016 # Link the dlpreopened libraries before other libraries
3017 for deplib in $save_deplibs; do
3018 deplibs="$deplib $deplibs"
3019 done
3021 if test "$pass" != dlopen; then
3022 if test "$pass" != conv; then
3023 # Make sure lib_search_path contains only unique directories.
3024 lib_search_path=
3025 for dir in $newlib_search_path; do
3026 case "$lib_search_path " in
3027 *" $dir "*) ;;
3028 *) lib_search_path="$lib_search_path $dir" ;;
3029 esac
3030 done
3031 newlib_search_path=
3034 if test "$linkmode,$pass" != "prog,link"; then
3035 vars="deplibs"
3036 else
3037 vars="compile_deplibs finalize_deplibs"
3039 for var in $vars dependency_libs; do
3040 # Add libraries to $var in reverse order
3041 eval tmp_libs=\"\$$var\"
3042 new_libs=
3043 for deplib in $tmp_libs; do
3044 # FIXME: Pedantically, this is the right thing to do, so
3045 # that some nasty dependency loop isn't accidentally
3046 # broken:
3047 #new_libs="$deplib $new_libs"
3048 # Pragmatically, this seems to cause very few problems in
3049 # practice:
3050 case $deplib in
3051 -L*) new_libs="$deplib $new_libs" ;;
3052 -R*) ;;
3054 # And here is the reason: when a library appears more
3055 # than once as an explicit dependence of a library, or
3056 # is implicitly linked in more than once by the
3057 # compiler, it is considered special, and multiple
3058 # occurrences thereof are not removed. Compare this
3059 # with having the same library being listed as a
3060 # dependency of multiple other libraries: in this case,
3061 # we know (pedantically, we assume) the library does not
3062 # need to be listed more than once, so we keep only the
3063 # last copy. This is not always right, but it is rare
3064 # enough that we require users that really mean to play
3065 # such unportable linking tricks to link the library
3066 # using -Wl,-lname, so that libtool does not consider it
3067 # for duplicate removal.
3068 case " $specialdeplibs " in
3069 *" $deplib "*) new_libs="$deplib $new_libs" ;;
3071 case " $new_libs " in
3072 *" $deplib "*) ;;
3073 *) new_libs="$deplib $new_libs" ;;
3074 esac
3076 esac
3078 esac
3079 done
3080 tmp_libs=
3081 for deplib in $new_libs; do
3082 case $deplib in
3083 -L*)
3084 case " $tmp_libs " in
3085 *" $deplib "*) ;;
3086 *) tmp_libs="$tmp_libs $deplib" ;;
3087 esac
3089 *) tmp_libs="$tmp_libs $deplib" ;;
3090 esac
3091 done
3092 eval $var=\"$tmp_libs\"
3093 done # for var
3095 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
3096 tmp_libs=
3097 for i in $dependency_libs ; do
3098 case " $predeps $postdeps $compiler_lib_search_path " in
3099 *" $i "*)
3100 i=""
3102 esac
3103 if test -n "$i" ; then
3104 tmp_libs="$tmp_libs $i"
3106 done
3107 dependency_libs=$tmp_libs
3108 done # for pass
3109 if test "$linkmode" = prog; then
3110 dlfiles="$newdlfiles"
3111 dlprefiles="$newdlprefiles"
3114 case $linkmode in
3115 oldlib)
3116 if test -n "$deplibs"; then
3117 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
3120 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3121 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3124 if test -n "$rpath"; then
3125 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3128 if test -n "$xrpath"; then
3129 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3132 if test -n "$vinfo"; then
3133 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3136 if test -n "$release"; then
3137 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3140 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3141 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3144 # Now set the variables for building old libraries.
3145 build_libtool_libs=no
3146 oldlibs="$output"
3147 objs="$objs$old_deplibs"
3150 lib)
3151 # Make sure we only generate libraries of the form `libNAME.la'.
3152 case $outputname in
3153 lib*)
3154 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3155 eval shared_ext=\"$shrext\"
3156 eval libname=\"$libname_spec\"
3159 if test "$module" = no; then
3160 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3161 $echo "$help" 1>&2
3162 exit 1
3164 if test "$need_lib_prefix" != no; then
3165 # Add the "lib" prefix for modules if required
3166 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3167 eval shared_ext=\"$shrext\"
3168 eval libname=\"$libname_spec\"
3169 else
3170 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3173 esac
3175 if test -n "$objs"; then
3176 if test "$deplibs_check_method" != pass_all; then
3177 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3178 exit 1
3179 else
3180 $echo
3181 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3182 $echo "*** objects $objs is not portable!"
3183 libobjs="$libobjs $objs"
3187 if test "$dlself" != no; then
3188 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3191 set dummy $rpath
3192 if test "$#" -gt 2; then
3193 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3195 install_libdir="$2"
3197 oldlibs=
3198 if test -z "$rpath"; then
3199 if test "$build_libtool_libs" = yes; then
3200 # Building a libtool convenience library.
3201 # Some compilers have problems with a `.al' extension so
3202 # convenience libraries should have the same extension an
3203 # archive normally would.
3204 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3205 build_libtool_libs=convenience
3206 build_old_libs=yes
3209 if test -n "$vinfo"; then
3210 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3213 if test -n "$release"; then
3214 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3216 else
3218 # Parse the version information argument.
3219 save_ifs="$IFS"; IFS=':'
3220 set dummy $vinfo 0 0 0
3221 IFS="$save_ifs"
3223 if test -n "$8"; then
3224 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3225 $echo "$help" 1>&2
3226 exit 1
3229 # convert absolute version numbers to libtool ages
3230 # this retains compatibility with .la files and attempts
3231 # to make the code below a bit more comprehensible
3233 case $vinfo_number in
3234 yes)
3235 number_major="$2"
3236 number_minor="$3"
3237 number_revision="$4"
3239 # There are really only two kinds -- those that
3240 # use the current revision as the major version
3241 # and those that subtract age and use age as
3242 # a minor version. But, then there is irix
3243 # which has an extra 1 added just for fun
3245 case $version_type in
3246 darwin|linux|osf|windows)
3247 current=`expr $number_major + $number_minor`
3248 age="$number_minor"
3249 revision="$number_revision"
3251 freebsd-aout|freebsd-elf|sunos)
3252 current="$number_major"
3253 revision="$number_minor"
3254 age="0"
3256 irix|nonstopux)
3257 current=`expr $number_major + $number_minor - 1`
3258 age="$number_minor"
3259 revision="$number_minor"
3261 esac
3264 current="$2"
3265 revision="$3"
3266 age="$4"
3268 esac
3270 # Check that each of the things are valid numbers.
3271 case $current in
3272 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3274 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3275 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3276 exit 1
3278 esac
3280 case $revision in
3281 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3283 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3284 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3285 exit 1
3287 esac
3289 case $age in
3290 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3292 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3293 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3294 exit 1
3296 esac
3298 if test "$age" -gt "$current"; then
3299 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3300 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3301 exit 1
3304 # Calculate the version variables.
3305 major=
3306 versuffix=
3307 verstring=
3308 case $version_type in
3309 none) ;;
3311 darwin)
3312 # Like Linux, but with the current version available in
3313 # verstring for coding it into the library header
3314 major=.`expr $current - $age`
3315 versuffix="$major.$age.$revision"
3316 # Darwin ld doesn't like 0 for these options...
3317 minor_current=`expr $current + 1`
3318 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3321 freebsd-aout)
3322 major=".$current"
3323 versuffix=".$current.$revision";
3326 freebsd-elf)
3327 major=".$current"
3328 versuffix=".$current";
3331 irix | nonstopux)
3332 major=`expr $current - $age + 1`
3334 case $version_type in
3335 nonstopux) verstring_prefix=nonstopux ;;
3336 *) verstring_prefix=sgi ;;
3337 esac
3338 verstring="$verstring_prefix$major.$revision"
3340 # Add in all the interfaces that we are compatible with.
3341 loop=$revision
3342 while test "$loop" -ne 0; do
3343 iface=`expr $revision - $loop`
3344 loop=`expr $loop - 1`
3345 verstring="$verstring_prefix$major.$iface:$verstring"
3346 done
3348 # Before this point, $major must not contain `.'.
3349 major=.$major
3350 versuffix="$major.$revision"
3353 linux)
3354 major=.`expr $current - $age`
3355 versuffix="$major.$age.$revision"
3358 osf)
3359 major=.`expr $current - $age`
3360 versuffix=".$current.$age.$revision"
3361 verstring="$current.$age.$revision"
3363 # Add in all the interfaces that we are compatible with.
3364 loop=$age
3365 while test "$loop" -ne 0; do
3366 iface=`expr $current - $loop`
3367 loop=`expr $loop - 1`
3368 verstring="$verstring:${iface}.0"
3369 done
3371 # Make executables depend on our current version.
3372 verstring="$verstring:${current}.0"
3375 sunos)
3376 major=".$current"
3377 versuffix=".$current.$revision"
3380 windows)
3381 # Use '-' rather than '.', since we only want one
3382 # extension on DOS 8.3 filesystems.
3383 major=`expr $current - $age`
3384 versuffix="-$major"
3388 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3389 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3390 exit 1
3392 esac
3394 # Clear the version info if we defaulted, and they specified a release.
3395 if test -z "$vinfo" && test -n "$release"; then
3396 major=
3397 case $version_type in
3398 darwin)
3399 # we can't check for "0.0" in archive_cmds due to quoting
3400 # problems, so we reset it completely
3401 verstring=
3404 verstring="0.0"
3406 esac
3407 if test "$need_version" = no; then
3408 versuffix=
3409 else
3410 versuffix=".0.0"
3414 # Remove version info from name if versioning should be avoided
3415 if test "$avoid_version" = yes && test "$need_version" = no; then
3416 major=
3417 versuffix=
3418 verstring=""
3421 # Check to see if the archive will have undefined symbols.
3422 if test "$allow_undefined" = yes; then
3423 if test "$allow_undefined_flag" = unsupported; then
3424 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3425 build_libtool_libs=no
3426 build_old_libs=yes
3428 else
3429 # Don't allow undefined symbols.
3430 allow_undefined_flag="$no_undefined_flag"
3434 if test "$mode" != relink; then
3435 # Remove our outputs, but don't remove object files since they
3436 # may have been created when compiling PIC objects.
3437 removelist=
3438 tempremovelist=`$echo "$output_objdir/*"`
3439 for p in $tempremovelist; do
3440 case $p in
3441 *.$objext | *$exeext)
3443 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3444 removelist="$removelist $p"
3446 *) ;;
3447 esac
3448 done
3449 if test -n "$removelist"; then
3450 $show "${rm}r $removelist"
3451 $run ${rm}r $removelist
3455 # Now set the variables for building old libraries.
3456 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3457 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3459 # Transform .lo files to .o files.
3460 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3463 # Eliminate all temporary directories.
3464 for path in $notinst_path; do
3465 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3466 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3467 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3468 done
3470 if test -n "$xrpath"; then
3471 # If the user specified any rpath flags, then add them.
3472 temp_xrpath=
3473 for libdir in $xrpath; do
3474 temp_xrpath="$temp_xrpath -R$libdir"
3475 case "$finalize_rpath " in
3476 *" $libdir "*) ;;
3477 *) finalize_rpath="$finalize_rpath $libdir" ;;
3478 esac
3479 done
3480 if true || test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3481 dependency_libs="$temp_xrpath $dependency_libs"
3485 # Make sure dlfiles contains only unique files that won't be dlpreopened
3486 old_dlfiles="$dlfiles"
3487 dlfiles=
3488 for lib in $old_dlfiles; do
3489 case " $dlprefiles $dlfiles " in
3490 *" $lib "*) ;;
3491 *) dlfiles="$dlfiles $lib" ;;
3492 esac
3493 done
3495 # Make sure dlprefiles contains only unique files
3496 old_dlprefiles="$dlprefiles"
3497 dlprefiles=
3498 for lib in $old_dlprefiles; do
3499 case "$dlprefiles " in
3500 *" $lib "*) ;;
3501 *) dlprefiles="$dlprefiles $lib" ;;
3502 esac
3503 done
3505 if test "$build_libtool_libs" = yes; then
3506 if test -n "$rpath"; then
3507 case $host in
3508 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3509 # these systems don't actually have a c library (as such)!
3511 *-*-rhapsody* | *-*-darwin1.[012])
3512 # Rhapsody C library is in the System framework
3513 deplibs="$deplibs System.ltframework"
3515 *-*-netbsd*)
3516 # Don't link with libc until the a.out ld.so is fixed.
3518 *-*-openbsd* | *-*-freebsd*)
3519 # Do not include libc due to us having libc/libc_r.
3520 test "X$arg" = "X-lc" && continue
3523 # Add libc to deplibs on all other systems if necessary.
3524 if test "$build_libtool_need_lc" = "yes"; then
3525 deplibs="$deplibs -lc"
3528 esac
3531 # Transform deplibs into only deplibs that can be linked in shared.
3532 name_save=$name
3533 libname_save=$libname
3534 release_save=$release
3535 versuffix_save=$versuffix
3536 major_save=$major
3537 # I'm not sure if I'm treating the release correctly. I think
3538 # release should show up in the -l (ie -lgmp5) so we don't want to
3539 # add it in twice. Is that correct?
3540 release=""
3541 versuffix=""
3542 major=""
3543 newdeplibs=
3544 droppeddeps=no
3545 case $deplibs_check_method in
3546 pass_all)
3547 # Don't check for shared/static. Everything works.
3548 # This might be a little naive. We might want to check
3549 # whether the library exists or not. But this is on
3550 # osf3 & osf4 and I'm not really sure... Just
3551 # implementing what was already the behavior.
3552 newdeplibs=$deplibs
3554 test_compile)
3555 # This code stresses the "libraries are programs" paradigm to its
3556 # limits. Maybe even breaks it. We compile a program, linking it
3557 # against the deplibs as a proxy for the library. Then we can check
3558 # whether they linked in statically or dynamically with ldd.
3559 $rm conftest.c
3560 cat > conftest.c <<EOF
3561 int main() { return 0; }
3563 $rm conftest
3564 $LTCC -o conftest conftest.c $deplibs
3565 if test "$?" -eq 0 ; then
3566 ldd_output=`ldd conftest`
3567 for i in $deplibs; do
3568 name="`expr $i : '-l\(.*\)'`"
3569 # If $name is empty we are operating on a -L argument.
3570 if test "$name" != "" && test "$name" -ne "0"; then
3571 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3572 case " $predeps $postdeps " in
3573 *" $i "*)
3574 newdeplibs="$newdeplibs $i"
3575 i=""
3577 esac
3579 if test -n "$i" ; then
3580 libname=`eval \\$echo \"$libname_spec\"`
3581 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3582 set dummy $deplib_matches
3583 deplib_match=$2
3584 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3585 newdeplibs="$newdeplibs $i"
3586 else
3587 droppeddeps=yes
3588 $echo
3589 $echo "*** Warning: dynamic linker does not accept needed library $i."
3590 $echo "*** I have the capability to make that library automatically link in when"
3591 $echo "*** you link to this library. But I can only do this if you have a"
3592 $echo "*** shared version of the library, which I believe you do not have"
3593 $echo "*** because a test_compile did reveal that the linker did not use it for"
3594 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3597 else
3598 newdeplibs="$newdeplibs $i"
3600 done
3601 else
3602 # Error occurred in the first compile. Let's try to salvage
3603 # the situation: Compile a separate program for each library.
3604 for i in $deplibs; do
3605 name="`expr $i : '-l\(.*\)'`"
3606 # If $name is empty we are operating on a -L argument.
3607 if test "$name" != "" && test "$name" != "0"; then
3608 $rm conftest
3609 $LTCC -o conftest conftest.c $i
3610 # Did it work?
3611 if test "$?" -eq 0 ; then
3612 ldd_output=`ldd conftest`
3613 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3614 case " $predeps $postdeps " in
3615 *" $i "*)
3616 newdeplibs="$newdeplibs $i"
3617 i=""
3619 esac
3621 if test -n "$i" ; then
3622 libname=`eval \\$echo \"$libname_spec\"`
3623 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3624 set dummy $deplib_matches
3625 deplib_match=$2
3626 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3627 newdeplibs="$newdeplibs $i"
3628 else
3629 droppeddeps=yes
3630 $echo
3631 $echo "*** Warning: dynamic linker does not accept needed library $i."
3632 $echo "*** I have the capability to make that library automatically link in when"
3633 $echo "*** you link to this library. But I can only do this if you have a"
3634 $echo "*** shared version of the library, which you do not appear to have"
3635 $echo "*** because a test_compile did reveal that the linker did not use this one"
3636 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3639 else
3640 droppeddeps=yes
3641 $echo
3642 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3643 $echo "*** make it link in! You will probably need to install it or some"
3644 $echo "*** library that it depends on before this library will be fully"
3645 $echo "*** functional. Installing it before continuing would be even better."
3647 else
3648 newdeplibs="$newdeplibs $i"
3650 done
3653 file_magic*)
3654 set dummy $deplibs_check_method
3655 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3656 for a_deplib in $deplibs; do
3657 name="`expr $a_deplib : '-l\(.*\)'`"
3658 # If $name is empty we are operating on a -L argument.
3659 if test "$name" != "" && test "$name" != "0"; then
3660 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3661 case " $predeps $postdeps " in
3662 *" $a_deplib "*)
3663 newdeplibs="$newdeplibs $a_deplib"
3664 a_deplib=""
3666 esac
3668 if test -n "$a_deplib" ; then
3669 libname=`eval \\$echo \"$libname_spec\"`
3670 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3671 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3672 for potent_lib in $potential_libs; do
3673 # Follow soft links.
3674 if ls -lLd "$potent_lib" 2>/dev/null \
3675 | grep " -> " >/dev/null; then
3676 continue
3678 # The statement above tries to avoid entering an
3679 # endless loop below, in case of cyclic links.
3680 # We might still enter an endless loop, since a link
3681 # loop can be closed while we follow links,
3682 # but so what?
3683 potlib="$potent_lib"
3684 while test -h "$potlib" 2>/dev/null; do
3685 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3686 case $potliblink in
3687 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3688 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3689 esac
3690 done
3691 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3692 | ${SED} 10q \
3693 | $EGREP "$file_magic_regex" > /dev/null; then
3694 newdeplibs="$newdeplibs $a_deplib"
3695 a_deplib=""
3696 break 2
3698 done
3699 done
3701 if test -n "$a_deplib" ; then
3702 droppeddeps=yes
3703 $echo
3704 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3705 $echo "*** I have the capability to make that library automatically link in when"
3706 $echo "*** you link to this library. But I can only do this if you have a"
3707 $echo "*** shared version of the library, which you do not appear to have"
3708 $echo "*** because I did check the linker path looking for a file starting"
3709 if test -z "$potlib" ; then
3710 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3711 else
3712 $echo "*** with $libname and none of the candidates passed a file format test"
3713 $echo "*** using a file magic. Last file checked: $potlib"
3716 else
3717 # Add a -L argument.
3718 newdeplibs="$newdeplibs $a_deplib"
3720 done # Gone through all deplibs.
3722 match_pattern*)
3723 set dummy $deplibs_check_method
3724 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3725 for a_deplib in $deplibs; do
3726 name="`expr $a_deplib : '-l\(.*\)'`"
3727 # If $name is empty we are operating on a -L argument.
3728 if test -n "$name" && test "$name" != "0"; then
3729 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3730 case " $predeps $postdeps " in
3731 *" $a_deplib "*)
3732 newdeplibs="$newdeplibs $a_deplib"
3733 a_deplib=""
3735 esac
3737 if test -n "$a_deplib" ; then
3738 libname=`eval \\$echo \"$libname_spec\"`
3739 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3740 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3741 for potent_lib in $potential_libs; do
3742 potlib="$potent_lib" # see symlink-check above in file_magic test
3743 if eval $echo \"$potent_lib\" 2>/dev/null \
3744 | ${SED} 10q \
3745 | $EGREP "$match_pattern_regex" > /dev/null; then
3746 newdeplibs="$newdeplibs $a_deplib"
3747 a_deplib=""
3748 break 2
3750 done
3751 done
3753 if test -n "$a_deplib" ; then
3754 droppeddeps=yes
3755 $echo
3756 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3757 $echo "*** I have the capability to make that library automatically link in when"
3758 $echo "*** you link to this library. But I can only do this if you have a"
3759 $echo "*** shared version of the library, which you do not appear to have"
3760 $echo "*** because I did check the linker path looking for a file starting"
3761 if test -z "$potlib" ; then
3762 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3763 else
3764 $echo "*** with $libname and none of the candidates passed a file format test"
3765 $echo "*** using a regex pattern. Last file checked: $potlib"
3768 else
3769 # Add a -L argument.
3770 newdeplibs="$newdeplibs $a_deplib"
3772 done # Gone through all deplibs.
3774 none | unknown | *)
3775 newdeplibs=""
3776 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3777 -e 's/ -[LR][^ ]*//g'`
3778 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3779 for i in $predeps $postdeps ; do
3780 # can't use Xsed below, because $i might contain '/'
3781 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3782 done
3784 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3785 | grep . >/dev/null; then
3786 $echo
3787 if test "X$deplibs_check_method" = "Xnone"; then
3788 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3789 else
3790 $echo "*** Warning: inter-library dependencies are not known to be supported."
3792 $echo "*** All declared inter-library dependencies are being dropped."
3793 droppeddeps=yes
3796 esac
3797 versuffix=$versuffix_save
3798 major=$major_save
3799 release=$release_save
3800 libname=$libname_save
3801 name=$name_save
3803 case $host in
3804 *-*-rhapsody* | *-*-darwin1.[012])
3805 # On Rhapsody replace the C library is the System framework
3806 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
3808 esac
3810 if test "$droppeddeps" = yes; then
3811 if test "$module" = yes; then
3812 $echo
3813 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3814 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3815 $echo "*** a static module, that should work as long as the dlopening"
3816 $echo "*** application is linked with the -dlopen flag."
3817 if test -z "$global_symbol_pipe"; then
3818 $echo
3819 $echo "*** However, this would only work if libtool was able to extract symbol"
3820 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3821 $echo "*** not find such a program. So, this module is probably useless."
3822 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3824 if test "$build_old_libs" = no; then
3825 oldlibs="$output_objdir/$libname.$libext"
3826 build_libtool_libs=module
3827 build_old_libs=yes
3828 else
3829 build_libtool_libs=no
3831 else
3832 $echo "*** The inter-library dependencies that have been dropped here will be"
3833 $echo "*** automatically added whenever a program is linked with this library"
3834 $echo "*** or is declared to -dlopen it."
3836 if test "$allow_undefined" = no; then
3837 $echo
3838 $echo "*** Since this library must not contain undefined symbols,"
3839 $echo "*** because either the platform does not support them or"
3840 $echo "*** it was explicitly requested with -no-undefined,"
3841 $echo "*** libtool will only create a static version of it."
3842 if test "$build_old_libs" = no; then
3843 oldlibs="$output_objdir/$libname.$libext"
3844 build_libtool_libs=module
3845 build_old_libs=yes
3846 else
3847 build_libtool_libs=no
3852 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
3853 case $host in
3854 *-*-darwin*)
3855 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
3856 dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
3858 esac
3859 # Done checking deplibs!
3860 deplibs=$newdeplibs
3863 # All the library-specific variables (install_libdir is set above).
3864 library_names=
3865 old_library=
3866 dlname=
3868 # Test again, we may have decided not to build it any more
3869 if test "$build_libtool_libs" = yes; then
3870 if test "$hardcode_into_libs" = yes; then
3871 # Hardcode the library paths
3872 hardcode_libdirs=
3873 dep_rpath=
3874 rpath="$finalize_rpath"
3875 test "$mode" != relink && test "$fast_install" = no && rpath="$compile_rpath$rpath"
3876 for libdir in $rpath; do
3877 if test -n "$hardcode_libdir_flag_spec"; then
3878 if test -n "$hardcode_libdir_separator"; then
3879 if test -z "$hardcode_libdirs"; then
3880 hardcode_libdirs="$libdir"
3881 else
3882 # Just accumulate the unique libdirs.
3883 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3884 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3887 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3889 esac
3891 else
3892 eval flag=\"$hardcode_libdir_flag_spec\"
3893 dep_rpath="$dep_rpath $flag"
3895 elif test -n "$runpath_var"; then
3896 case "$perm_rpath " in
3897 *" $libdir "*) ;;
3898 *) perm_rpath="$perm_rpath $libdir" ;;
3899 esac
3901 done
3902 # Substitute the hardcoded libdirs into the rpath.
3903 if test -n "$hardcode_libdir_separator" &&
3904 test -n "$hardcode_libdirs"; then
3905 libdir="$hardcode_libdirs"
3906 if test -n "$hardcode_libdir_flag_spec_ld"; then
3907 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3908 else
3909 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3912 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3913 # We should set the runpath_var.
3914 rpath=
3915 for dir in $perm_rpath; do
3916 rpath="$rpath$dir:"
3917 done
3918 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3920 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3923 shlibpath="$finalize_shlibpath"
3924 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3925 if test -n "$shlibpath"; then
3926 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3929 # Get the real and link names of the library.
3930 eval shared_ext=\"$shrext\"
3931 eval library_names=\"$library_names_spec\"
3932 set dummy $library_names
3933 realname="$2"
3934 shift; shift
3936 if test -n "$soname_spec"; then
3937 eval soname=\"$soname_spec\"
3938 else
3939 soname="$realname"
3941 if test -z "$dlname"; then
3942 dlname=$soname
3945 lib="$output_objdir/$realname"
3946 for link
3948 linknames="$linknames $link"
3949 done
3951 # Use standard objects if they are pic
3952 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3954 # Prepare the list of exported symbols
3955 if test -z "$export_symbols"; then
3956 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3957 $show "generating symbol list for \`$libname.la'"
3958 export_symbols="$output_objdir/$libname.exp"
3959 $run $rm $export_symbols
3960 eval cmds=\"$export_symbols_cmds\"
3961 save_ifs="$IFS"; IFS='~'
3962 for cmd in $cmds; do
3963 IFS="$save_ifs"
3964 if len=`expr "X$cmd" : ".*"` &&
3965 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3966 $show "$cmd"
3967 $run eval "$cmd" || exit $?
3968 skipped_export=false
3969 else
3970 # The command line is too long to execute in one step.
3971 $show "using reloadable object file for export list..."
3972 skipped_export=:
3974 done
3975 IFS="$save_ifs"
3976 if test -n "$export_symbols_regex"; then
3977 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3978 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3979 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3980 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3985 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3986 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3989 tmp_deplibs=
3990 for test_deplib in $deplibs; do
3991 case " $convenience " in
3992 *" $test_deplib "*) ;;
3994 tmp_deplibs="$tmp_deplibs $test_deplib"
3996 esac
3997 done
3998 deplibs="$tmp_deplibs"
4000 if test -n "$convenience"; then
4001 if test -n "$whole_archive_flag_spec"; then
4002 save_libobjs=$libobjs
4003 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4004 else
4005 gentop="$output_objdir/${outputname}x"
4006 $show "${rm}r $gentop"
4007 $run ${rm}r "$gentop"
4008 $show "$mkdir $gentop"
4009 $run $mkdir "$gentop"
4010 status=$?
4011 if test "$status" -ne 0 && test ! -d "$gentop"; then
4012 exit $status
4014 generated="$generated $gentop"
4016 for xlib in $convenience; do
4017 # Extract the objects.
4018 case $xlib in
4019 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4020 *) xabs=`pwd`"/$xlib" ;;
4021 esac
4022 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4023 xdir="$gentop/$xlib"
4025 $show "${rm}r $xdir"
4026 $run ${rm}r "$xdir"
4027 $show "$mkdir $xdir"
4028 $run $mkdir "$xdir"
4029 status=$?
4030 if test "$status" -ne 0 && test ! -d "$xdir"; then
4031 exit $status
4033 # We will extract separately just the conflicting names and we will no
4034 # longer touch any unique names. It is faster to leave these extract
4035 # automatically by $AR in one run.
4036 $show "(cd $xdir && $AR x $xabs)"
4037 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4038 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4040 else
4041 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4042 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4043 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4046 while test "$i" -le "$count"
4048 # Put our $i before any first dot (extension)
4049 # Never overwrite any file
4050 name_to="$name"
4051 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4053 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4054 done
4055 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4056 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4057 i=`expr $i + 1`
4058 done
4059 done
4062 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4063 done
4067 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4068 eval flag=\"$thread_safe_flag_spec\"
4069 linker_flags="$linker_flags $flag"
4072 # Make a backup of the uninstalled library when relinking
4073 if test "$mode" = relink; then
4074 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
4077 # Add all flags from the command line. We here create a library,
4078 # but those flags were only added to compile_command and
4079 # finalize_command, which are only used when creating executables.
4080 # So do it by hand here.
4081 compiler_flags="$compiler_flags $add_flags"
4082 # Only add it to commands which use CC, instead of LD, i.e.
4083 # only to $compiler_flags
4084 #linker_flags="$linker_flags $add_flags"
4086 # Do each of the archive commands.
4087 if test "$module" = yes && test -n "$module_cmds" ; then
4088 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4089 eval cmds=\"$module_expsym_cmds\"
4090 else
4091 eval cmds=\"$module_cmds\"
4093 else
4094 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4095 eval cmds=\"$archive_expsym_cmds\"
4096 else
4097 eval cmds=\"$archive_cmds\"
4101 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
4102 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4104 else
4105 # The command line is too long to link in one step, link piecewise.
4106 $echo "creating reloadable object files..."
4108 # Save the value of $output and $libobjs because we want to
4109 # use them later. If we have whole_archive_flag_spec, we
4110 # want to use save_libobjs as it was before
4111 # whole_archive_flag_spec was expanded, because we can't
4112 # assume the linker understands whole_archive_flag_spec.
4113 # This may have to be revisited, in case too many
4114 # convenience libraries get linked in and end up exceeding
4115 # the spec.
4116 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
4117 save_libobjs=$libobjs
4119 save_output=$output
4121 # Clear the reloadable object creation command queue and
4122 # initialize k to one.
4123 test_cmds=
4124 concat_cmds=
4125 objlist=
4126 delfiles=
4127 last_robj=
4129 output=$output_objdir/$save_output-${k}.$objext
4130 # Loop over the list of objects to be linked.
4131 for obj in $save_libobjs
4133 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4134 if test "X$objlist" = X ||
4135 { len=`expr "X$test_cmds" : ".*"` &&
4136 test "$len" -le "$max_cmd_len"; }; then
4137 objlist="$objlist $obj"
4138 else
4139 # The command $test_cmds is almost too long, add a
4140 # command to the queue.
4141 if test "$k" -eq 1 ; then
4142 # The first file doesn't have a previous command to add.
4143 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
4144 else
4145 # All subsequent reloadable object files will link in
4146 # the last one created.
4147 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4149 last_robj=$output_objdir/$save_output-${k}.$objext
4150 k=`expr $k + 1`
4151 output=$output_objdir/$save_output-${k}.$objext
4152 objlist=$obj
4153 len=1
4155 done
4156 # Handle the remaining objects by creating one last
4157 # reloadable object file. All subsequent reloadable object
4158 # files will link in the last one created.
4159 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4160 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
4162 if ${skipped_export-false}; then
4163 $show "generating symbol list for \`$libname.la'"
4164 export_symbols="$output_objdir/$libname.exp"
4165 $run $rm $export_symbols
4166 libobjs=$output
4167 # Append the command to create the export file.
4168 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4171 # Set up a command to remove the reloadale object files
4172 # after they are used.
4174 while test "$i" -lt "$k"
4176 i=`expr $i + 1`
4177 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
4178 done
4180 $echo "creating a temporary reloadable object file: $output"
4182 # Loop through the commands generated above and execute them.
4183 save_ifs="$IFS"; IFS='~'
4184 for cmd in $concat_cmds; do
4185 IFS="$save_ifs"
4186 $show "$cmd"
4187 $run eval "$cmd" || exit $?
4188 done
4189 IFS="$save_ifs"
4191 libobjs=$output
4192 # Restore the value of output.
4193 output=$save_output
4195 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4196 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4198 # Expand the library linking commands again to reset the
4199 # value of $libobjs for piecewise linking.
4201 # Do each of the archive commands.
4202 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4203 eval cmds=\"$archive_expsym_cmds\"
4204 else
4205 eval cmds=\"$archive_cmds\"
4208 # Append the command to remove the reloadable object files
4209 # to the just-reset $cmds.
4210 eval cmds=\"\$cmds~$rm $delfiles\"
4212 save_ifs="$IFS"; IFS='~'
4213 for cmd in $cmds; do
4214 IFS="$save_ifs"
4215 $show "$cmd"
4216 $run eval "$cmd" || exit $?
4217 done
4218 IFS="$save_ifs"
4220 # Restore the uninstalled library and exit
4221 if test "$mode" = relink; then
4222 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4223 exit 0
4226 # Create links to the real library.
4227 for linkname in $linknames; do
4228 if test "$realname" != "$linkname"; then
4229 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4230 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4232 done
4234 # If -module or -export-dynamic was specified, set the dlname.
4235 if test "$module" = yes || test "$export_dynamic" = yes; then
4236 # On all known operating systems, these are identical.
4237 dlname="$soname"
4242 obj)
4243 if test -n "$deplibs"; then
4244 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4247 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4248 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4251 if test -n "$rpath"; then
4252 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4255 if test -n "$xrpath"; then
4256 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4259 if test -n "$vinfo"; then
4260 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4263 if test -n "$release"; then
4264 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4267 case $output in
4268 *.lo)
4269 if test -n "$objs$old_deplibs"; then
4270 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4271 exit 1
4273 libobj="$output"
4274 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4277 libobj=
4278 obj="$output"
4280 esac
4282 # Delete the old objects.
4283 $run $rm $obj $libobj
4285 # Objects from convenience libraries. This assumes
4286 # single-version convenience libraries. Whenever we create
4287 # different ones for PIC/non-PIC, this we'll have to duplicate
4288 # the extraction.
4289 reload_conv_objs=
4290 gentop=
4291 # reload_cmds runs $LD directly, so let us get rid of
4292 # -Wl from whole_archive_flag_spec
4295 if test -n "$convenience"; then
4296 if test -n "$whole_archive_flag_spec"; then
4297 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4298 else
4299 gentop="$output_objdir/${obj}x"
4300 $show "${rm}r $gentop"
4301 $run ${rm}r "$gentop"
4302 $show "$mkdir $gentop"
4303 $run $mkdir "$gentop"
4304 status=$?
4305 if test "$status" -ne 0 && test ! -d "$gentop"; then
4306 exit $status
4308 generated="$generated $gentop"
4310 for xlib in $convenience; do
4311 # Extract the objects.
4312 case $xlib in
4313 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4314 *) xabs=`pwd`"/$xlib" ;;
4315 esac
4316 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4317 xdir="$gentop/$xlib"
4319 $show "${rm}r $xdir"
4320 $run ${rm}r "$xdir"
4321 $show "$mkdir $xdir"
4322 $run $mkdir "$xdir"
4323 status=$?
4324 if test "$status" -ne 0 && test ! -d "$xdir"; then
4325 exit $status
4327 # We will extract separately just the conflicting names and we will no
4328 # longer touch any unique names. It is faster to leave these extract
4329 # automatically by $AR in one run.
4330 $show "(cd $xdir && $AR x $xabs)"
4331 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4332 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4334 else
4335 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4336 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4337 $AR t "$xabs" | sort | uniq -cd | while read -r count name
4340 while test "$i" -le "$count"
4342 # Put our $i before any first dot (extension)
4343 # Never overwrite any file
4344 name_to="$name"
4345 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4347 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4348 done
4349 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4350 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4351 i=`expr $i + 1`
4352 done
4353 done
4356 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4357 done
4361 # Create the old-style object.
4362 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
4364 output="$obj"
4365 eval cmds=\"$reload_cmds\"
4366 save_ifs="$IFS"; IFS='~'
4367 for cmd in $cmds; do
4368 IFS="$save_ifs"
4369 $show "$cmd"
4370 $run eval "$cmd" || exit $?
4371 done
4372 IFS="$save_ifs"
4374 # Exit if we aren't doing a library object file.
4375 if test -z "$libobj"; then
4376 if test -n "$gentop"; then
4377 $show "${rm}r $gentop"
4378 $run ${rm}r $gentop
4381 exit 0
4384 if test "$build_libtool_libs" != yes; then
4385 if test -n "$gentop"; then
4386 $show "${rm}r $gentop"
4387 $run ${rm}r $gentop
4390 # Create an invalid libtool object if no PIC, so that we don't
4391 # accidentally link it into a program.
4392 # $show "echo timestamp > $libobj"
4393 # $run eval "echo timestamp > $libobj" || exit $?
4394 exit 0
4397 if test -n "$pic_flag" || test "$pic_mode" != default; then
4398 # Only do commands if we really have different PIC objects.
4399 reload_objs="$libobjs $reload_conv_objs"
4400 output="$libobj"
4401 eval cmds=\"$reload_cmds\"
4402 save_ifs="$IFS"; IFS='~'
4403 for cmd in $cmds; do
4404 IFS="$save_ifs"
4405 $show "$cmd"
4406 $run eval "$cmd" || exit $?
4407 done
4408 IFS="$save_ifs"
4411 if test -n "$gentop"; then
4412 $show "${rm}r $gentop"
4413 $run ${rm}r $gentop
4416 exit 0
4419 prog)
4420 case $host in
4421 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4422 esac
4423 if test -n "$vinfo"; then
4424 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4427 if test -n "$release"; then
4428 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4431 if test "$preload" = yes; then
4432 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4433 test "$dlopen_self_static" = unknown; then
4434 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4438 case $host in
4439 *-*-rhapsody* | *-*-darwin1.[012])
4440 # On Rhapsody replace the C library is the System framework
4441 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
4442 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
4444 esac
4446 case $host in
4447 *-*-darwin*)
4448 # Don't allow lazy linking, it breaks C++ global constructors
4449 if test "$tagname" = CXX ; then
4450 compile_command="$compile_command ${wl}-bind_at_load"
4451 finalize_command="$finalize_command ${wl}-bind_at_load"
4453 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
4454 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
4455 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
4457 esac
4459 compile_command="$compile_command $compile_deplibs"
4460 finalize_command="$finalize_command $finalize_deplibs"
4462 if test -n "$rpath$xrpath"; then
4463 # If the user specified any rpath flags, then add them.
4464 for libdir in $rpath $xrpath; do
4465 # This is the magic to use -rpath.
4466 case "$finalize_rpath " in
4467 *" $libdir "*) ;;
4468 *) finalize_rpath="$finalize_rpath $libdir" ;;
4469 esac
4470 done
4473 # Now hardcode the library paths
4474 rpath=
4475 hardcode_libdirs=
4476 for libdir in $compile_rpath $finalize_rpath; do
4477 if test -n "$hardcode_libdir_flag_spec"; then
4478 if test -n "$hardcode_libdir_separator"; then
4479 if test -z "$hardcode_libdirs"; then
4480 hardcode_libdirs="$libdir"
4481 else
4482 # Just accumulate the unique libdirs.
4483 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4484 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4487 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4489 esac
4491 else
4492 eval flag=\"$hardcode_libdir_flag_spec\"
4493 rpath="$rpath $flag"
4495 elif test -n "$runpath_var"; then
4496 case "$perm_rpath " in
4497 *" $libdir "*) ;;
4498 *) perm_rpath="$perm_rpath $libdir" ;;
4499 esac
4501 case $host in
4502 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4503 case :$dllsearchpath: in
4504 *":$libdir:"*) ;;
4505 *) dllsearchpath="$dllsearchpath:$libdir";;
4506 esac
4508 esac
4509 done
4510 # Substitute the hardcoded libdirs into the rpath.
4511 if test -n "$hardcode_libdir_separator" &&
4512 test -n "$hardcode_libdirs"; then
4513 libdir="$hardcode_libdirs"
4514 eval rpath=\" $hardcode_libdir_flag_spec\"
4516 compile_rpath="$rpath"
4518 rpath=
4519 hardcode_libdirs=
4520 for libdir in $finalize_rpath; do
4521 if test -n "$hardcode_libdir_flag_spec"; then
4522 if test -n "$hardcode_libdir_separator"; then
4523 if test -z "$hardcode_libdirs"; then
4524 hardcode_libdirs="$libdir"
4525 else
4526 # Just accumulate the unique libdirs.
4527 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4528 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4531 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4533 esac
4535 else
4536 eval flag=\"$hardcode_libdir_flag_spec\"
4537 rpath="$rpath $flag"
4539 elif test -n "$runpath_var"; then
4540 case "$finalize_perm_rpath " in
4541 *" $libdir "*) ;;
4542 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4543 esac
4545 done
4546 # Substitute the hardcoded libdirs into the rpath.
4547 if test -n "$hardcode_libdir_separator" &&
4548 test -n "$hardcode_libdirs"; then
4549 libdir="$hardcode_libdirs"
4550 eval rpath=\" $hardcode_libdir_flag_spec\"
4552 finalize_rpath="$rpath"
4554 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4555 # Transform all the library objects into standard objects.
4556 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4557 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4560 dlsyms=
4561 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4562 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4563 dlsyms="${outputname}S.c"
4564 else
4565 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4569 if test -n "$dlsyms"; then
4570 case $dlsyms in
4571 "") ;;
4572 *.c)
4573 # Discover the nlist of each of the dlfiles.
4574 nlist="$output_objdir/${outputname}.nm"
4576 $show "$rm $nlist ${nlist}S ${nlist}T"
4577 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4579 # Parse the name list into a source file.
4580 $show "creating $output_objdir/$dlsyms"
4582 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4583 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4584 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4586 #ifdef __cplusplus
4587 extern \"C\" {
4588 #endif
4590 /* Prevent the only kind of declaration conflicts we can make. */
4591 #define lt_preloaded_symbols some_other_symbol
4593 /* External symbol declarations for the compiler. */\
4596 if test "$dlself" = yes; then
4597 $show "generating symbol list for \`$output'"
4599 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4601 # Add our own program objects to the symbol list.
4602 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4603 for arg in $progfiles; do
4604 $show "extracting global C symbols from \`$arg'"
4605 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4606 done
4608 if test -n "$exclude_expsyms"; then
4609 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4610 $run eval '$mv "$nlist"T "$nlist"'
4613 if test -n "$export_symbols_regex"; then
4614 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4615 $run eval '$mv "$nlist"T "$nlist"'
4618 # Prepare the list of exported symbols
4619 if test -z "$export_symbols"; then
4620 export_symbols="$output_objdir/$output.exp"
4621 $run $rm $export_symbols
4622 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4623 else
4624 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4625 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4626 $run eval 'mv "$nlist"T "$nlist"'
4630 for arg in $dlprefiles; do
4631 $show "extracting global C symbols from \`$arg'"
4632 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4633 $run eval '$echo ": $name " >> "$nlist"'
4634 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4635 done
4637 if test -z "$run"; then
4638 # Make sure we have at least an empty file.
4639 test -f "$nlist" || : > "$nlist"
4641 if test -n "$exclude_expsyms"; then
4642 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4643 $mv "$nlist"T "$nlist"
4646 # Try sorting and uniquifying the output.
4647 if grep -v "^: " < "$nlist" |
4648 if sort -k 3 </dev/null >/dev/null 2>&1; then
4649 sort -k 3
4650 else
4651 sort +2
4652 fi |
4653 uniq > "$nlist"S; then
4655 else
4656 grep -v "^: " < "$nlist" > "$nlist"S
4659 if test -f "$nlist"S; then
4660 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4661 else
4662 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4665 $echo >> "$output_objdir/$dlsyms" "\
4667 #undef lt_preloaded_symbols
4669 #if defined (__STDC__) && __STDC__
4670 # define lt_ptr void *
4671 #else
4672 # define lt_ptr char *
4673 # define const
4674 #endif
4676 /* The mapping between symbol names and symbols. */
4677 const struct {
4678 const char *name;
4679 lt_ptr address;
4681 lt_preloaded_symbols[] =
4685 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4687 $echo >> "$output_objdir/$dlsyms" "\
4688 {0, (lt_ptr) 0}
4691 /* This works around a problem in FreeBSD linker */
4692 #ifdef FREEBSD_WORKAROUND
4693 static const void *lt_preloaded_setup() {
4694 return lt_preloaded_symbols;
4696 #endif
4698 #ifdef __cplusplus
4700 #endif\
4704 pic_flag_for_symtable=
4705 case $host in
4706 # compiling the symbol table file with pic_flag works around
4707 # a FreeBSD bug that causes programs to crash when -lm is
4708 # linked before any other PIC object. But we must not use
4709 # pic_flag when linking with -static. The problem exists in
4710 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4711 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4712 case "$compile_command " in
4713 *" -static "*) ;;
4714 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4715 esac;;
4716 *-*-hpux*)
4717 case "$compile_command " in
4718 *" -static "*) ;;
4719 *) pic_flag_for_symtable=" $pic_flag";;
4720 esac
4721 esac
4723 # Now compile the dynamic symbol file.
4724 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4725 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4727 # Clean up the generated files.
4728 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4729 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4731 # Transform the symbol file into the correct name.
4732 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4733 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4736 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4737 exit 1
4739 esac
4740 else
4741 # We keep going just in case the user didn't refer to
4742 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4743 # really was required.
4745 # Nullify the symbol file.
4746 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4747 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4750 # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
4751 # Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath.
4752 # Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld.
4753 # This does not apply on AIX for ia64, which uses a SysV linker.
4754 case "$host" in
4755 ia64-*-aix5*) ;;
4756 *-*-aix4* | *-*-aix5*)
4757 compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
4758 finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
4759 esac
4761 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4762 # Replace the output file specification.
4763 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4764 link_command="$compile_command$compile_rpath"
4766 # We have no uninstalled library dependencies, so finalize right now.
4767 $show "$link_command"
4768 $run eval "$link_command"
4769 status=$?
4771 # Delete the generated files.
4772 if test -n "$dlsyms"; then
4773 $show "$rm $output_objdir/${outputname}S.${objext}"
4774 $run $rm "$output_objdir/${outputname}S.${objext}"
4777 exit $status
4780 if test -n "$shlibpath_var"; then
4781 # We should set the shlibpath_var
4782 rpath=
4783 for dir in $temp_rpath; do
4784 case $dir in
4785 [\\/]* | [A-Za-z]:[\\/]*)
4786 # Absolute path.
4787 rpath="$rpath$dir:"
4790 # Relative path: add a thisdir entry.
4791 rpath="$rpath\$thisdir/$dir:"
4793 esac
4794 done
4795 temp_rpath="$rpath"
4798 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4799 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4801 if test -n "$finalize_shlibpath"; then
4802 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4805 compile_var=
4806 finalize_var=
4807 if test -n "$runpath_var"; then
4808 if test -n "$perm_rpath"; then
4809 # We should set the runpath_var.
4810 rpath=
4811 for dir in $perm_rpath; do
4812 rpath="$rpath$dir:"
4813 done
4814 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4816 if test -n "$finalize_perm_rpath"; then
4817 # We should set the runpath_var.
4818 rpath=
4819 for dir in $finalize_perm_rpath; do
4820 rpath="$rpath$dir:"
4821 done
4822 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4826 if test "$no_install" = yes; then
4827 # We don't need to create a wrapper script.
4828 link_command="$compile_var$compile_command$compile_rpath"
4829 # Replace the output file specification.
4830 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4831 # Delete the old output file.
4832 $run $rm $output
4833 # Link the executable and exit
4834 $show "$link_command"
4835 $run eval "$link_command" || exit $?
4836 exit 0
4839 if test "$hardcode_action" = relink; then
4840 # Fast installation is not supported
4841 link_command="$compile_var$compile_command$compile_rpath"
4842 relink_command="$finalize_var$finalize_command$finalize_rpath"
4844 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4845 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4846 else
4847 if test "$fast_install" != no; then
4848 link_command="$finalize_var$compile_command$finalize_rpath"
4849 if test "$fast_install" = yes; then
4850 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4851 else
4852 # fast_install is set to needless
4853 relink_command=
4855 else
4856 link_command="$compile_var$compile_command$compile_rpath"
4857 relink_command="$finalize_var$finalize_command$finalize_rpath"
4861 # Replace the output file specification.
4862 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4864 # Delete the old output files.
4865 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4867 $show "$link_command"
4868 $run eval "$link_command" || exit $?
4870 # Now create the wrapper script.
4871 $show "creating $output"
4873 # Quote the relink command for shipping.
4874 if test -n "$relink_command"; then
4875 # Preserve any variables that may affect compiler behavior
4876 for var in $variables_saved_for_relink; do
4877 if eval test -z \"\${$var+set}\"; then
4878 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4879 elif eval var_value=\$$var; test -z "$var_value"; then
4880 relink_command="$var=; export $var; $relink_command"
4881 else
4882 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4883 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4885 done
4886 relink_command="(cd `pwd`; $relink_command)"
4887 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4890 # Quote $echo for shipping.
4891 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4892 case $0 in
4893 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4894 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4895 esac
4896 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4897 else
4898 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4901 # Only actually do things if our run command is non-null.
4902 if test -z "$run"; then
4903 # win32 will think the script is a binary if it has
4904 # a .exe suffix, so we strip it off here.
4905 case $output in
4906 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4907 esac
4908 # test for cygwin because mv fails w/o .exe extensions
4909 case $host in
4910 *cygwin*)
4911 exeext=.exe
4912 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4913 *) exeext= ;;
4914 esac
4915 case $host in
4916 *mingw* )
4917 cwrappersource=`$echo ${output_objdir}/lt-${outputname}.c`
4918 cwrapper=`$echo ${output}.exe`
4919 $rm $cwrappersource $cwrapper
4920 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
4922 cat > $cwrappersource <<EOF
4924 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4925 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4927 The $output program cannot be directly executed until all the libtool
4928 libraries that it depends on are installed.
4930 This wrapper executable should never be moved out of the build directory.
4931 If it is, it will not operate correctly.
4933 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4934 but could eventually absorb all of the scripts functionality and
4935 exec $objdir/$outputname directly.
4938 cat >> $cwrappersource<<"EOF"
4939 #include <stdio.h>
4940 #include <stdlib.h>
4941 #include <unistd.h>
4942 #include <malloc.h>
4943 #include <stdarg.h>
4944 #include <assert.h>
4946 #if defined(PATH_MAX)
4947 # define LT_PATHMAX PATH_MAX
4948 #elif defined(MAXPATHLEN)
4949 # define LT_PATHMAX MAXPATHLEN
4950 #else
4951 # define LT_PATHMAX 1024
4952 #endif
4954 #ifndef DIR_SEPARATOR
4955 #define DIR_SEPARATOR '/'
4956 #endif
4958 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4959 defined (__OS2__)
4960 #define HAVE_DOS_BASED_FILE_SYSTEM
4961 #ifndef DIR_SEPARATOR_2
4962 #define DIR_SEPARATOR_2 '\\'
4963 #endif
4964 #endif
4966 #ifndef DIR_SEPARATOR_2
4967 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4968 #else /* DIR_SEPARATOR_2 */
4969 # define IS_DIR_SEPARATOR(ch) \
4970 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4971 #endif /* DIR_SEPARATOR_2 */
4973 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4974 #define XFREE(stale) do { \
4975 if (stale) { free ((void *) stale); stale = 0; } \
4976 } while (0)
4978 const char *program_name = NULL;
4980 void * xmalloc (size_t num);
4981 char * xstrdup (const char *string);
4982 char * basename (const char *name);
4983 char * fnqualify(const char *path);
4984 char * strendzap(char *str, const char *pat);
4985 void lt_fatal (const char *message, ...);
4988 main (int argc, char *argv[])
4990 char **newargz;
4991 int i;
4993 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4994 newargz = XMALLOC(char *, argc+2);
4997 cat >> $cwrappersource <<EOF
4998 newargz[0] = "$SHELL";
5001 cat >> $cwrappersource <<"EOF"
5002 newargz[1] = fnqualify(argv[0]);
5003 /* we know the script has the same name, without the .exe */
5004 /* so make sure newargz[1] doesn't end in .exe */
5005 strendzap(newargz[1],".exe");
5006 for (i = 1; i < argc; i++)
5007 newargz[i+1] = xstrdup(argv[i]);
5008 newargz[argc+1] = NULL;
5011 cat >> $cwrappersource <<EOF
5012 execv("$SHELL",newargz);
5015 cat >> $cwrappersource <<"EOF"
5018 void *
5019 xmalloc (size_t num)
5021 void * p = (void *) malloc (num);
5022 if (!p)
5023 lt_fatal ("Memory exhausted");
5025 return p;
5028 char *
5029 xstrdup (const char *string)
5031 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5035 char *
5036 basename (const char *name)
5038 const char *base;
5040 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5041 /* Skip over the disk name in MSDOS pathnames. */
5042 if (isalpha (name[0]) && name[1] == ':')
5043 name += 2;
5044 #endif
5046 for (base = name; *name; name++)
5047 if (IS_DIR_SEPARATOR (*name))
5048 base = name + 1;
5049 return (char *) base;
5052 char *
5053 fnqualify(const char *path)
5055 size_t size;
5056 char *p;
5057 char tmp[LT_PATHMAX + 1];
5059 assert(path != NULL);
5061 /* Is it qualified already? */
5062 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5063 if (isalpha (path[0]) && path[1] == ':')
5064 return xstrdup (path);
5065 #endif
5066 if (IS_DIR_SEPARATOR (path[0]))
5067 return xstrdup (path);
5069 /* prepend the current directory */
5070 /* doesn't handle '~' */
5071 if (getcwd (tmp, LT_PATHMAX) == NULL)
5072 lt_fatal ("getcwd failed");
5073 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
5074 p = XMALLOC(char, size);
5075 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
5076 return p;
5079 char *
5080 strendzap(char *str, const char *pat)
5082 size_t len, patlen;
5084 assert(str != NULL);
5085 assert(pat != NULL);
5087 len = strlen(str);
5088 patlen = strlen(pat);
5090 if (patlen <= len)
5092 str += len - patlen;
5093 if (strcmp(str, pat) == 0)
5094 *str = '\0';
5096 return str;
5099 static void
5100 lt_error_core (int exit_status, const char * mode,
5101 const char * message, va_list ap)
5103 fprintf (stderr, "%s: %s: ", program_name, mode);
5104 vfprintf (stderr, message, ap);
5105 fprintf (stderr, ".\n");
5107 if (exit_status >= 0)
5108 exit (exit_status);
5111 void
5112 lt_fatal (const char *message, ...)
5114 va_list ap;
5115 va_start (ap, message);
5116 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5117 va_end (ap);
5120 # we should really use a build-platform specific compiler
5121 # here, but OTOH, the wrappers (shell script and this C one)
5122 # are only useful if you want to execute the "real" binary.
5123 # Since the "real" binary is built for $host, then this
5124 # wrapper might as well be built for $host, too.
5125 $run $LTCC -s -o $cwrapper $cwrappersource
5127 esac
5128 $rm $output
5129 trap "$rm $output; exit 1" 1 2 15
5131 $echo > $output "\
5132 #! $SHELL
5134 # $output - temporary wrapper script for $objdir/$outputname
5135 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5137 # The $output program cannot be directly executed until all the libtool
5138 # libraries that it depends on are installed.
5140 # This wrapper script should never be moved out of the build directory.
5141 # If it is, it will not operate correctly.
5143 # Sed substitution that helps us do robust quoting. It backslashifies
5144 # metacharacters that are still active within double-quoted strings.
5145 Xsed='${SED} -e 1s/^X//'
5146 sed_quote_subst='$sed_quote_subst'
5148 # The HP-UX ksh and POSIX shell print the target directory to stdout
5149 # if CDPATH is set.
5150 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
5152 relink_command=\"$relink_command\"
5154 # This environment variable determines our operation mode.
5155 if test \"\$libtool_install_magic\" = \"$magic\"; then
5156 # install mode needs the following variable:
5157 notinst_deplibs='$notinst_deplibs'
5158 else
5159 # When we are sourced in execute mode, \$file and \$echo are already set.
5160 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5161 echo=\"$qecho\"
5162 file=\"\$0\"
5163 # Make sure echo works.
5164 if test \"X\$1\" = X--no-reexec; then
5165 # Discard the --no-reexec flag, and continue.
5166 shift
5167 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
5168 # Yippee, \$echo works!
5170 else
5171 # Restart under the correct shell, and then maybe \$echo will work.
5172 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5176 $echo >> $output "\
5178 # Find the directory that this script lives in.
5179 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5180 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5182 # Follow symbolic links until we get to the real thisdir.
5183 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5184 while test -n \"\$file\"; do
5185 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5187 # If there was a directory component, then change thisdir.
5188 if test \"x\$destdir\" != \"x\$file\"; then
5189 case \"\$destdir\" in
5190 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5191 *) thisdir=\"\$thisdir/\$destdir\" ;;
5192 esac
5195 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5196 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5197 done
5199 # Try to get the absolute directory name.
5200 absdir=\`cd \"\$thisdir\" && pwd\`
5201 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5204 if test "$fast_install" = yes; then
5205 $echo >> $output "\
5206 program=lt-'$outputname'$exeext
5207 progdir=\"\$thisdir/$objdir\"
5209 if test ! -f \"\$progdir/\$program\" || \\
5210 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5211 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5213 file=\"\$\$-\$program\"
5215 if test ! -d \"\$progdir\"; then
5216 $mkdir \"\$progdir\"
5217 else
5218 $rm \"\$progdir/\$file\"
5221 $echo >> $output "\
5223 # relink executable if necessary
5224 if test -n \"\$relink_command\"; then
5225 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5226 else
5227 $echo \"\$relink_command_output\" >&2
5228 $rm \"\$progdir/\$file\"
5229 exit 1
5233 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5234 { $rm \"\$progdir/\$program\";
5235 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5236 $rm \"\$progdir/\$file\"
5238 else
5239 $echo >> $output "\
5240 program='$outputname'
5241 progdir=\"\$thisdir/$objdir\"
5245 $echo >> $output "\
5247 if test -f \"\$progdir/\$program\"; then"
5249 # Export our shlibpath_var if we have one.
5250 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5251 $echo >> $output "\
5252 # Add our own library path to $shlibpath_var
5253 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5255 # Some systems cannot cope with colon-terminated $shlibpath_var
5256 # The second colon is a workaround for a bug in BeOS R4 sed
5257 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5259 export $shlibpath_var
5263 # fixup the dll searchpath if we need to.
5264 if test -n "$dllsearchpath"; then
5265 $echo >> $output "\
5266 # Add the dll search path components to the executable PATH
5267 PATH=$dllsearchpath:\$PATH
5271 $echo >> $output "\
5272 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5273 # Run the actual program with our arguments.
5275 case $host in
5276 # Backslashes separate directories on plain windows
5277 *-*-mingw | *-*-os2*)
5278 $echo >> $output "\
5279 exec \$progdir\\\\\$program \${1+\"\$@\"}
5284 # Need to set LD_LIBRARY_PATH, to the value already
5285 # computed within libtool.
5286 $echo >> $output "\
5287 LD_LIBRARY_PATH=\"$rpath\" exec \$progdir/\$program \${1+\"\$@\"}
5290 esac
5291 $echo >> $output "\
5292 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5293 exit 1
5295 else
5296 # The program doesn't exist.
5297 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5298 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5299 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5300 exit 1
5304 chmod +x $output
5306 exit 0
5308 esac
5310 # See if we need to build an old-fashioned archive.
5311 for oldlib in $oldlibs; do
5313 if test "$build_libtool_libs" = convenience; then
5314 oldobjs="$libobjs_save"
5315 addlibs="$convenience"
5316 build_libtool_libs=no
5317 else
5318 if test "$build_libtool_libs" = module; then
5319 oldobjs="$libobjs_save"
5320 build_libtool_libs=no
5321 else
5322 oldobjs="$old_deplibs $non_pic_objects"
5324 addlibs="$old_convenience"
5327 if test -n "$addlibs"; then
5328 gentop="$output_objdir/${outputname}x"
5329 $show "${rm}r $gentop"
5330 $run ${rm}r "$gentop"
5331 $show "$mkdir $gentop"
5332 $run $mkdir "$gentop"
5333 status=$?
5334 if test "$status" -ne 0 && test ! -d "$gentop"; then
5335 exit $status
5337 generated="$generated $gentop"
5339 # Add in members from convenience archives.
5340 for xlib in $addlibs; do
5341 # Extract the objects.
5342 case $xlib in
5343 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5344 *) xabs=`pwd`"/$xlib" ;;
5345 esac
5346 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5347 xdir="$gentop/$xlib"
5349 $show "${rm}r $xdir"
5350 $run ${rm}r "$xdir"
5351 $show "$mkdir $xdir"
5352 $run $mkdir "$xdir"
5353 status=$?
5354 if test "$status" -ne 0 && test ! -d "$xdir"; then
5355 exit $status
5357 # We will extract separately just the conflicting names and we will no
5358 # longer touch any unique names. It is faster to leave these extract
5359 # automatically by $AR in one run.
5360 $show "(cd $xdir && $AR x $xabs)"
5361 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5362 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5364 else
5365 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5366 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5367 $AR t "$xabs" | sort | uniq -cd | while read -r count name
5370 while test "$i" -le "$count"
5372 # Put our $i before any first dot (extension)
5373 # Never overwrite any file
5374 name_to="$name"
5375 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5377 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5378 done
5379 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5380 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5381 i=`expr $i + 1`
5382 done
5383 done
5386 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5387 done
5390 compiler_flags="$compiler_flags $add_flags"
5392 # Do each command in the archive commands.
5393 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5394 eval cmds=\"$old_archive_from_new_cmds\"
5395 else
5396 eval cmds=\"$old_archive_cmds\"
5398 if len=`expr "X$cmds" : ".*"` &&
5399 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5401 else
5402 # the command line is too long to link in one step, link in parts
5403 $echo "using piecewise archive linking..."
5404 save_RANLIB=$RANLIB
5405 RANLIB=:
5406 objlist=
5407 concat_cmds=
5408 save_oldobjs=$oldobjs
5409 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5410 # encoded into archives. This makes 'ar r' malfunction in
5411 # this piecewise linking case whenever conflicting object
5412 # names appear in distinct ar calls; check, warn and compensate.
5413 if (for obj in $save_oldobjs
5415 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5416 done | sort | sort -uc >/dev/null 2>&1); then
5418 else
5419 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5420 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5421 AR_FLAGS=cq
5423 # Is there a better way of finding the last object in the list?
5424 for obj in $save_oldobjs
5426 last_oldobj=$obj
5427 done
5428 for obj in $save_oldobjs
5430 oldobjs="$objlist $obj"
5431 objlist="$objlist $obj"
5432 eval test_cmds=\"$old_archive_cmds\"
5433 if len=`expr "X$test_cmds" : ".*"` &&
5434 test "$len" -le "$max_cmd_len"; then
5436 else
5437 # the above command should be used before it gets too long
5438 oldobjs=$objlist
5439 if test "$obj" = "$last_oldobj" ; then
5440 RANLIB=$save_RANLIB
5442 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5443 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5444 objlist=
5446 done
5447 RANLIB=$save_RANLIB
5448 oldobjs=$objlist
5449 if test "X$oldobjs" = "X" ; then
5450 eval cmds=\"\$concat_cmds\"
5451 else
5452 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
5456 save_ifs="$IFS"; IFS='~'
5457 for cmd in $cmds; do
5458 IFS="$save_ifs"
5459 $show "$cmd"
5460 $run eval "$cmd" || exit $?
5461 done
5462 IFS="$save_ifs"
5463 done
5465 if test -n "$generated"; then
5466 $show "${rm}r$generated"
5467 $run ${rm}r$generated
5470 # Now create the libtool archive.
5471 case $output in
5472 *.la)
5473 old_library=
5474 test "$build_old_libs" = yes && old_library="$libname.$libext"
5475 $show "creating $output"
5477 # Preserve any variables that may affect compiler behavior
5478 for var in $variables_saved_for_relink; do
5479 if eval test -z \"\${$var+set}\"; then
5480 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5481 elif eval var_value=\$$var; test -z "$var_value"; then
5482 relink_command="$var=; export $var; $relink_command"
5483 else
5484 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5485 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5487 done
5488 # Quote the link command for shipping.
5489 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
5490 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5491 if test "$hardcode_automatic" = yes ; then
5492 relink_command=
5494 # Only create the output if not a dry run.
5495 if test -z "$run"; then
5496 for installed in no yes; do
5497 if test "$installed" = yes; then
5498 if test -z "$install_libdir"; then
5499 break
5501 output="$output_objdir/$outputname"i
5502 # Replace all uninstalled libtool libraries with the installed ones
5503 newdependency_libs=
5504 for deplib in $dependency_libs; do
5505 case $deplib in
5506 *.la)
5507 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5508 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5509 if test -z "$libdir"; then
5510 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5511 exit 1
5513 newdependency_libs="$newdependency_libs $libdir/$name"
5515 *) newdependency_libs="$newdependency_libs $deplib" ;;
5516 esac
5517 done
5518 dependency_libs="$newdependency_libs"
5519 newdlfiles=
5520 for lib in $dlfiles; do
5521 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5522 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5523 if test -z "$libdir"; then
5524 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5525 exit 1
5527 newdlfiles="$newdlfiles $libdir/$name"
5528 done
5529 dlfiles="$newdlfiles"
5530 newdlprefiles=
5531 for lib in $dlprefiles; do
5532 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5533 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5534 if test -z "$libdir"; then
5535 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5536 exit 1
5538 newdlprefiles="$newdlprefiles $libdir/$name"
5539 done
5540 dlprefiles="$newdlprefiles"
5542 $rm $output
5543 # place dlname in correct position for cygwin
5544 tdlname=$dlname
5545 case $host,$output,$installed,$module,$dlname in
5546 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5547 esac
5548 $echo > $output "\
5549 # $outputname - a libtool library file
5550 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5552 # Please DO NOT delete this file!
5553 # It is necessary for linking the library.
5555 # The name that we can dlopen(3).
5556 dlname='$tdlname'
5558 # Names of this library.
5559 library_names='$library_names'
5561 # The name of the static archive.
5562 old_library='$old_library'
5564 # Libraries that this one depends upon.
5565 dependency_libs='$dependency_libs'
5567 # Version information for $libname.
5568 current=$current
5569 age=$age
5570 revision=$revision
5572 # Is this an already installed library?
5573 installed=$installed
5575 # Should we warn about portability when linking against -modules?
5576 shouldnotlink=$module
5578 # Files to dlopen/dlpreopen
5579 dlopen='$dlfiles'
5580 dlpreopen='$dlprefiles'
5582 # Directory that this library needs to be installed in:
5583 libdir='$install_libdir'"
5584 if test "$installed" = no && test "$need_relink" = yes && test "$fast_install" = no; then
5585 $echo >> $output "\
5586 relink_command=\"$relink_command\""
5588 done
5591 # Do a symbolic link so that the libtool archive can be found in
5592 # LD_LIBRARY_PATH before the program is installed.
5593 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5594 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5596 esac
5597 exit 0
5600 # libtool install mode
5601 install)
5602 modename="$modename: install"
5604 # There may be an optional sh(1) argument at the beginning of
5605 # install_prog (especially on Windows NT).
5606 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5607 # Allow the use of GNU shtool's install command.
5608 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5609 # Aesthetically quote it.
5610 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5611 case $arg in
5612 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5613 arg="\"$arg\""
5615 esac
5616 install_prog="$arg "
5617 arg="$1"
5618 shift
5619 else
5620 install_prog=
5621 arg="$nonopt"
5624 # The real first argument should be the name of the installation program.
5625 # Aesthetically quote it.
5626 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5627 case $arg in
5628 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5629 arg="\"$arg\""
5631 esac
5632 install_prog="$install_prog$arg"
5634 # We need to accept at least all the BSD install flags.
5635 dest=
5636 files=
5637 opts=
5638 prev=
5639 install_type=
5640 isdir=no
5641 stripme=
5642 for arg
5644 if test -n "$dest"; then
5645 files="$files $dest"
5646 dest="$arg"
5647 continue
5650 case $arg in
5651 -d) isdir=yes ;;
5652 -f) prev="-f" ;;
5653 -g) prev="-g" ;;
5654 -m) prev="-m" ;;
5655 -o) prev="-o" ;;
5657 stripme=" -s"
5658 continue
5660 -*) ;;
5663 # If the previous option needed an argument, then skip it.
5664 if test -n "$prev"; then
5665 prev=
5666 else
5667 dest="$arg"
5668 continue
5671 esac
5673 # Aesthetically quote the argument.
5674 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5675 case $arg in
5676 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5677 arg="\"$arg\""
5679 esac
5680 install_prog="$install_prog $arg"
5681 done
5683 if test -z "$install_prog"; then
5684 $echo "$modename: you must specify an install program" 1>&2
5685 $echo "$help" 1>&2
5686 exit 1
5689 if test -n "$prev"; then
5690 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5691 $echo "$help" 1>&2
5692 exit 1
5695 if test -z "$files"; then
5696 if test -z "$dest"; then
5697 $echo "$modename: no file or destination specified" 1>&2
5698 else
5699 $echo "$modename: you must specify a destination" 1>&2
5701 $echo "$help" 1>&2
5702 exit 1
5705 # Strip any trailing slash from the destination.
5706 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5708 # Check to see that the destination is a directory.
5709 test -d "$dest" && isdir=yes
5710 if test "$isdir" = yes; then
5711 destdir="$dest"
5712 destname=
5713 else
5714 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5715 test "X$destdir" = "X$dest" && destdir=.
5716 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5718 # Not a directory, so check to see that there is only one file specified.
5719 set dummy $files
5720 if test "$#" -gt 2; then
5721 $echo "$modename: \`$dest' is not a directory" 1>&2
5722 $echo "$help" 1>&2
5723 exit 1
5726 case $destdir in
5727 [\\/]* | [A-Za-z]:[\\/]*) ;;
5729 for file in $files; do
5730 case $file in
5731 *.lo) ;;
5733 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5734 $echo "$help" 1>&2
5735 exit 1
5737 esac
5738 done
5740 esac
5742 # This variable tells wrapper scripts just to set variables rather
5743 # than running their programs.
5744 libtool_install_magic="$magic"
5746 staticlibs=
5747 future_libdirs=
5748 current_libdirs=
5749 for file in $files; do
5751 # Do each installation.
5752 case $file in
5753 *.$libext)
5754 # Do the static libraries later.
5755 staticlibs="$staticlibs $file"
5758 *.la)
5759 # Check to see that this really is a libtool archive.
5760 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5761 else
5762 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5763 $echo "$help" 1>&2
5764 exit 1
5767 library_names=
5768 old_library=
5769 relink_command=
5770 # If there is no directory component, then add one.
5771 case $file in
5772 */* | *\\*) . $file ;;
5773 *) . ./$file ;;
5774 esac
5776 # Add the libdir to current_libdirs if it is the destination.
5777 if test "X$destdir" = "X$libdir"; then
5778 case "$current_libdirs " in
5779 *" $libdir "*) ;;
5780 *) current_libdirs="$current_libdirs $libdir" ;;
5781 esac
5782 else
5783 # Note the libdir as a future libdir.
5784 case "$future_libdirs " in
5785 *" $libdir "*) ;;
5786 *) future_libdirs="$future_libdirs $libdir" ;;
5787 esac
5790 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5791 test "X$dir" = "X$file/" && dir=
5792 dir="$dir$objdir"
5794 if test -n "$relink_command"; then
5795 # Determine the prefix the user has applied to our future dir.
5796 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5798 # Don't allow the user to place us outside of our expected
5799 # location b/c this prevents finding dependent libraries that
5800 # are installed to the same prefix.
5801 # At present, this check doesn't affect windows .dll's that
5802 # are installed into $libdir/../bin (currently, that works fine)
5803 # but it's something to keep an eye on.
5804 if test "$inst_prefix_dir" = "$destdir"; then
5805 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5806 exit 1
5809 if test -n "$inst_prefix_dir"; then
5810 # Stick the inst_prefix_dir data into the link command.
5811 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5812 else
5813 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5816 $echo "$modename: warning: relinking \`$file'" 1>&2
5817 $show "$relink_command"
5818 if $run eval "$relink_command"; then :
5819 else
5820 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5821 exit 1
5825 # See the names of the shared library.
5826 set dummy $library_names
5827 if test -n "$2"; then
5828 realname="$2"
5829 shift
5830 shift
5832 srcname="$realname"
5833 test -n "$relink_command" && srcname="$realname"T
5835 # Install the shared library and build the symlinks.
5836 $show "$install_prog $dir/$srcname $destdir/$realname"
5837 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5838 if test -n "$stripme" && test -n "$striplib"; then
5839 $show "$striplib $destdir/$realname"
5840 $run eval "$striplib $destdir/$realname" || exit $?
5843 if test "$#" -gt 0; then
5844 # Delete the old symlinks, and create new ones.
5845 for linkname
5847 if test "$linkname" != "$realname"; then
5848 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5849 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5851 done
5854 # Do each command in the postinstall commands.
5855 lib="$destdir/$realname"
5856 eval cmds=\"$postinstall_cmds\"
5857 save_ifs="$IFS"; IFS='~'
5858 for cmd in $cmds; do
5859 IFS="$save_ifs"
5860 $show "$cmd"
5861 $run eval "$cmd" || exit $?
5862 done
5863 IFS="$save_ifs"
5866 # Install the pseudo-library for information purposes.
5867 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5868 instname="$dir/$name"i
5869 $show "$install_prog $instname $destdir/$name"
5870 $run eval "$install_prog $instname $destdir/$name" || exit $?
5872 # Maybe install the static library, too.
5873 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5876 *.lo)
5877 # Install (i.e. copy) a libtool object.
5879 # Figure out destination file name, if it wasn't already specified.
5880 if test -n "$destname"; then
5881 destfile="$destdir/$destname"
5882 else
5883 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5884 destfile="$destdir/$destfile"
5887 # Deduce the name of the destination old-style object file.
5888 case $destfile in
5889 *.lo)
5890 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5892 *.$objext)
5893 staticdest="$destfile"
5894 destfile=
5897 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5898 $echo "$help" 1>&2
5899 exit 1
5901 esac
5903 # Install the libtool object if requested.
5904 if test -n "$destfile"; then
5905 $show "$install_prog $file $destfile"
5906 $run eval "$install_prog $file $destfile" || exit $?
5909 # Install the old object if enabled.
5910 if test "$build_old_libs" = yes; then
5911 # Deduce the name of the old-style object file.
5912 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5914 $show "$install_prog $staticobj $staticdest"
5915 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5917 exit 0
5921 # Figure out destination file name, if it wasn't already specified.
5922 if test -n "$destname"; then
5923 destfile="$destdir/$destname"
5924 else
5925 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5926 destfile="$destdir/$destfile"
5929 # If the file is missing, and there is a .exe on the end, strip it
5930 # because it is most likely a libtool script we actually want to
5931 # install
5932 stripped_ext=""
5933 case $file in
5934 *.exe)
5935 if test ! -f "$file"; then
5936 file=`$echo $file|${SED} 's,.exe$,,'`
5937 stripped_ext=".exe"
5940 esac
5942 # Do a test to see if this is really a libtool program.
5943 case $host in
5944 *cygwin*|*mingw*)
5945 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5948 wrapper=$file
5950 esac
5951 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5952 notinst_deplibs=
5953 relink_command=
5955 # To insure that "foo" is sourced, and not "foo.exe",
5956 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5957 # which disallows the automatic-append-.exe behavior.
5958 case $build in
5959 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5960 *) wrapperdot=${wrapper} ;;
5961 esac
5962 # If there is no directory component, then add one.
5963 case $file in
5964 */* | *\\*) . ${wrapperdot} ;;
5965 *) . ./${wrapperdot} ;;
5966 esac
5968 # Check the variables that should have been set.
5969 if test -z "$notinst_deplibs"; then
5970 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5971 exit 1
5974 finalize=yes
5975 for lib in $notinst_deplibs; do
5976 # Check to see that each library is installed.
5977 libdir=
5978 if test -f "$lib"; then
5979 # If there is no directory component, then add one.
5980 case $lib in
5981 */* | *\\*) . $lib ;;
5982 *) . ./$lib ;;
5983 esac
5985 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5986 if test -n "$libdir" && test ! -f "$libfile"; then
5987 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5988 finalize=no
5990 done
5992 relink_command=
5993 # To insure that "foo" is sourced, and not "foo.exe",
5994 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5995 # which disallows the automatic-append-.exe behavior.
5996 case $build in
5997 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5998 *) wrapperdot=${wrapper} ;;
5999 esac
6000 # If there is no directory component, then add one.
6001 case $file in
6002 */* | *\\*) . ${wrapperdot} ;;
6003 *) . ./${wrapperdot} ;;
6004 esac
6006 outputname=
6007 if test "$fast_install" = no && test -n "$relink_command"; then
6008 if test "$finalize" = yes && test -z "$run"; then
6009 tmpdir="/tmp"
6010 test -n "$TMPDIR" && tmpdir="$TMPDIR"
6011 tmpdir="$tmpdir/libtool-$$"
6012 if $mkdir "$tmpdir" && chmod 700 "$tmpdir"; then :
6013 else
6014 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
6015 continue
6017 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6018 outputname="$tmpdir/$file"
6019 # Replace the output file specification.
6020 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
6022 $show "$relink_command"
6023 if $run eval "$relink_command"; then :
6024 else
6025 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6026 ${rm}r "$tmpdir"
6027 continue
6029 file="$outputname"
6030 else
6031 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6033 else
6034 # Install the binary that we compiled earlier.
6035 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6039 # remove .exe since cygwin /usr/bin/install will append another
6040 # one anyways
6041 case $install_prog,$host in
6042 */usr/bin/install*,*cygwin*)
6043 case $file:$destfile in
6044 *.exe:*.exe)
6045 # this is ok
6047 *.exe:*)
6048 destfile=$destfile.exe
6050 *:*.exe)
6051 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6053 esac
6055 esac
6056 $show "$install_prog$stripme $file $destfile"
6057 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
6058 test -n "$outputname" && ${rm}r "$tmpdir"
6060 esac
6061 done
6063 for file in $staticlibs; do
6064 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6066 # Set up the ranlib parameters.
6067 oldlib="$destdir/$name"
6069 $show "$install_prog $file $oldlib"
6070 $run eval "$install_prog \$file \$oldlib" || exit $?
6072 if test -n "$stripme" && test -n "$striplib"; then
6073 $show "$old_striplib $oldlib"
6074 $run eval "$old_striplib $oldlib" || exit $?
6077 # Do each command in the postinstall commands.
6078 eval cmds=\"$old_postinstall_cmds\"
6079 save_ifs="$IFS"; IFS='~'
6080 for cmd in $cmds; do
6081 IFS="$save_ifs"
6082 $show "$cmd"
6083 $run eval "$cmd" || exit $?
6084 done
6085 IFS="$save_ifs"
6086 done
6088 if test -n "$future_libdirs"; then
6089 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6092 if test -n "$current_libdirs"; then
6093 # Maybe just do a dry run.
6094 test -n "$run" && current_libdirs=" -n$current_libdirs"
6095 exec_cmd='$SHELL $0 --finish$current_libdirs'
6096 else
6097 exit 0
6101 # libtool finish mode
6102 finish)
6103 modename="$modename: finish"
6104 libdirs="$nonopt"
6105 admincmds=
6107 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6108 for dir
6110 libdirs="$libdirs $dir"
6111 done
6113 for libdir in $libdirs; do
6114 if test -n "$finish_cmds"; then
6115 # Do each command in the finish commands.
6116 eval cmds=\"$finish_cmds\"
6117 save_ifs="$IFS"; IFS='~'
6118 for cmd in $cmds; do
6119 IFS="$save_ifs"
6120 $show "$cmd"
6121 $run eval "$cmd" || admincmds="$admincmds
6122 $cmd"
6123 done
6124 IFS="$save_ifs"
6126 if test -n "$finish_eval"; then
6127 # Do the single finish_eval.
6128 eval cmds=\"$finish_eval\"
6129 $run eval "$cmds" || admincmds="$admincmds
6130 $cmds"
6132 done
6135 # Exit here if they wanted silent mode.
6136 exit 0
6138 $echo "----------------------------------------------------------------------"
6139 $echo "Libraries have been installed in:"
6140 for libdir in $libdirs; do
6141 $echo " $libdir"
6142 done
6143 $echo
6144 $echo "If you ever happen to want to link against installed libraries"
6145 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6146 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6147 $echo "flag during linking and do at least one of the following:"
6148 if test -n "$shlibpath_var"; then
6149 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6150 $echo " during execution"
6152 if test -n "$runpath_var"; then
6153 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6154 $echo " during linking"
6156 if test -n "$hardcode_libdir_flag_spec"; then
6157 libdir=LIBDIR
6158 eval flag=\"$hardcode_libdir_flag_spec\"
6160 $echo " - use the \`$flag' linker flag"
6162 if test -n "$admincmds"; then
6163 $echo " - have your system administrator run these commands:$admincmds"
6165 if test -f /etc/ld.so.conf; then
6166 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6168 $echo
6169 $echo "See any operating system documentation about shared libraries for"
6170 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6171 $echo "----------------------------------------------------------------------"
6172 exit 0
6175 # libtool execute mode
6176 execute)
6177 modename="$modename: execute"
6179 # The first argument is the command name.
6180 cmd="$nonopt"
6181 if test -z "$cmd"; then
6182 $echo "$modename: you must specify a COMMAND" 1>&2
6183 $echo "$help"
6184 exit 1
6187 # Handle -dlopen flags immediately.
6188 for file in $execute_dlfiles; do
6189 if test ! -f "$file"; then
6190 $echo "$modename: \`$file' is not a file" 1>&2
6191 $echo "$help" 1>&2
6192 exit 1
6195 dir=
6196 case $file in
6197 *.la)
6198 # Check to see that this really is a libtool archive.
6199 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6200 else
6201 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6202 $echo "$help" 1>&2
6203 exit 1
6206 # Read the libtool library.
6207 dlname=
6208 library_names=
6210 # If there is no directory component, then add one.
6211 case $file in
6212 */* | *\\*) . $file ;;
6213 *) . ./$file ;;
6214 esac
6216 # Skip this library if it cannot be dlopened.
6217 if test -z "$dlname"; then
6218 # Warn if it was a shared library.
6219 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6220 continue
6223 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6224 test "X$dir" = "X$file" && dir=.
6226 if test -f "$dir/$objdir/$dlname"; then
6227 dir="$dir/$objdir"
6228 else
6229 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6230 exit 1
6234 *.lo)
6235 # Just add the directory containing the .lo file.
6236 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6237 test "X$dir" = "X$file" && dir=.
6241 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6242 continue
6244 esac
6246 # Get the absolute pathname.
6247 absdir=`cd "$dir" && pwd`
6248 test -n "$absdir" && dir="$absdir"
6250 # Now add the directory to shlibpath_var.
6251 if eval "test -z \"\$$shlibpath_var\""; then
6252 eval "$shlibpath_var=\"\$dir\""
6253 else
6254 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6256 done
6258 # This variable tells wrapper scripts just to set shlibpath_var
6259 # rather than running their programs.
6260 libtool_execute_magic="$magic"
6262 # Check if any of the arguments is a wrapper script.
6263 args=
6264 for file
6266 case $file in
6267 -*) ;;
6269 # Do a test to see if this is really a libtool program.
6270 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6271 # If there is no directory component, then add one.
6272 case $file in
6273 */* | *\\*) . $file ;;
6274 *) . ./$file ;;
6275 esac
6277 # Transform arg to wrapped name.
6278 file="$progdir/$program"
6281 esac
6282 # Quote arguments (to preserve shell metacharacters).
6283 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6284 args="$args \"$file\""
6285 done
6287 if test -z "$run"; then
6288 if test -n "$shlibpath_var"; then
6289 # Export the shlibpath_var.
6290 eval "export $shlibpath_var"
6293 # Restore saved environment variables
6294 if test "${save_LC_ALL+set}" = set; then
6295 LC_ALL="$save_LC_ALL"; export LC_ALL
6297 if test "${save_LANG+set}" = set; then
6298 LANG="$save_LANG"; export LANG
6301 # Now prepare to actually exec the command.
6302 exec_cmd="\$cmd$args"
6303 else
6304 # Display what would be done.
6305 if test -n "$shlibpath_var"; then
6306 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6307 $echo "export $shlibpath_var"
6309 $echo "$cmd$args"
6310 exit 0
6314 # libtool clean and uninstall mode
6315 clean | uninstall)
6316 modename="$modename: $mode"
6317 rm="$nonopt"
6318 files=
6319 rmforce=
6320 exit_status=0
6322 # This variable tells wrapper scripts just to set variables rather
6323 # than running their programs.
6324 libtool_install_magic="$magic"
6326 for arg
6328 case $arg in
6329 -f) rm="$rm $arg"; rmforce=yes ;;
6330 -*) rm="$rm $arg" ;;
6331 *) files="$files $arg" ;;
6332 esac
6333 done
6335 if test -z "$rm"; then
6336 $echo "$modename: you must specify an RM program" 1>&2
6337 $echo "$help" 1>&2
6338 exit 1
6341 rmdirs=
6343 origobjdir="$objdir"
6344 for file in $files; do
6345 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6346 if test "X$dir" = "X$file"; then
6347 dir=.
6348 objdir="$origobjdir"
6349 else
6350 objdir="$dir/$origobjdir"
6352 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6353 test "$mode" = uninstall && objdir="$dir"
6355 # Remember objdir for removal later, being careful to avoid duplicates
6356 if test "$mode" = clean; then
6357 case " $rmdirs " in
6358 *" $objdir "*) ;;
6359 *) rmdirs="$rmdirs $objdir" ;;
6360 esac
6363 # Don't error if the file doesn't exist and rm -f was used.
6364 if (test -L "$file") >/dev/null 2>&1 \
6365 || (test -h "$file") >/dev/null 2>&1 \
6366 || test -f "$file"; then
6368 elif test -d "$file"; then
6369 exit_status=1
6370 continue
6371 elif test "$rmforce" = yes; then
6372 continue
6375 rmfiles="$file"
6377 case $name in
6378 *.la)
6379 # Possibly a libtool archive, so verify it.
6380 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6381 . $dir/$name
6383 # Delete the libtool libraries and symlinks.
6384 for n in $library_names; do
6385 rmfiles="$rmfiles $objdir/$n"
6386 done
6387 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6388 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6390 if test "$mode" = uninstall; then
6391 if test -n "$library_names"; then
6392 # Do each command in the postuninstall commands.
6393 eval cmds=\"$postuninstall_cmds\"
6394 save_ifs="$IFS"; IFS='~'
6395 for cmd in $cmds; do
6396 IFS="$save_ifs"
6397 $show "$cmd"
6398 $run eval "$cmd"
6399 if test "$?" -ne 0 && test "$rmforce" != yes; then
6400 exit_status=1
6402 done
6403 IFS="$save_ifs"
6406 if test -n "$old_library"; then
6407 # Do each command in the old_postuninstall commands.
6408 eval cmds=\"$old_postuninstall_cmds\"
6409 save_ifs="$IFS"; IFS='~'
6410 for cmd in $cmds; do
6411 IFS="$save_ifs"
6412 $show "$cmd"
6413 $run eval "$cmd"
6414 if test "$?" -ne 0 && test "$rmforce" != yes; then
6415 exit_status=1
6417 done
6418 IFS="$save_ifs"
6420 # FIXME: should reinstall the best remaining shared library.
6425 *.lo)
6426 # Possibly a libtool object, so verify it.
6427 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6429 # Read the .lo file
6430 . $dir/$name
6432 # Add PIC object to the list of files to remove.
6433 if test -n "$pic_object" \
6434 && test "$pic_object" != none; then
6435 rmfiles="$rmfiles $dir/$pic_object"
6438 # Add non-PIC object to the list of files to remove.
6439 if test -n "$non_pic_object" \
6440 && test "$non_pic_object" != none; then
6441 rmfiles="$rmfiles $dir/$non_pic_object"
6447 if test "$mode" = clean ; then
6448 noexename=$name
6449 case $file in
6450 *.exe)
6451 file=`$echo $file|${SED} 's,.exe$,,'`
6452 noexename=`$echo $name|${SED} 's,.exe$,,'`
6453 # $file with .exe has already been added to rmfiles,
6454 # add $file without .exe
6455 rmfiles="$rmfiles $file"
6457 esac
6458 # Do a test to see if this is a libtool program.
6459 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6460 relink_command=
6461 . $dir/$noexename
6463 # note $name still contains .exe if it was in $file originally
6464 # as does the version of $file that was added into $rmfiles
6465 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6466 if test "$fast_install" = yes && test -n "$relink_command"; then
6467 rmfiles="$rmfiles $objdir/lt-$name"
6469 if test "X$noexename" != "X$name" ; then
6470 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6475 esac
6476 $show "$rm $rmfiles"
6477 $run $rm $rmfiles || exit_status=1
6478 done
6479 objdir="$origobjdir"
6481 # Try to remove the ${objdir}s in the directories where we deleted files
6482 for dir in $rmdirs; do
6483 if test -d "$dir"; then
6484 $show "rmdir $dir"
6485 $run rmdir $dir >/dev/null 2>&1
6487 done
6489 exit $exit_status
6493 $echo "$modename: you must specify a MODE" 1>&2
6494 $echo "$generic_help" 1>&2
6495 exit 1
6497 esac
6499 if test -z "$exec_cmd"; then
6500 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6501 $echo "$generic_help" 1>&2
6502 exit 1
6504 fi # test -z "$show_help"
6506 if test -n "$exec_cmd"; then
6507 eval exec $exec_cmd
6508 exit 1
6511 # We need to display help for each of the modes.
6512 case $mode in
6513 "") $echo \
6514 "Usage: $modename [OPTION]... [MODE-ARG]...
6516 Provide generalized library-building support services.
6518 --config show all configuration variables
6519 --debug enable verbose shell tracing
6520 -n, --dry-run display commands without modifying any files
6521 --features display basic configuration information and exit
6522 --finish same as \`--mode=finish'
6523 --help display this help message and exit
6524 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6525 --quiet same as \`--silent'
6526 --silent don't print informational messages
6527 --tag=TAG use configuration variables from tag TAG
6528 --version print version information
6530 MODE must be one of the following:
6532 clean remove files from the build directory
6533 compile compile a source file into a libtool object
6534 execute automatically set library path, then run a program
6535 finish complete the installation of libtool libraries
6536 install install libraries or executables
6537 link create a library or an executable
6538 uninstall remove libraries from an installed directory
6540 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6541 a more detailed description of MODE.
6543 Report bugs to <bug-libtool@gnu.org>."
6544 exit 0
6547 clean)
6548 $echo \
6549 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6551 Remove files from the build directory.
6553 RM is the name of the program to use to delete files associated with each FILE
6554 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6555 to RM.
6557 If FILE is a libtool library, object or program, all the files associated
6558 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6561 compile)
6562 $echo \
6563 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6565 Compile a source file into a libtool library object.
6567 This mode accepts the following additional options:
6569 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6570 -prefer-pic try to building PIC objects only
6571 -prefer-non-pic try to building non-PIC objects only
6572 -static always build a \`.o' file suitable for static linking
6574 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6575 from the given SOURCEFILE.
6577 The output file name is determined by removing the directory component from
6578 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6579 library object suffix, \`.lo'."
6582 execute)
6583 $echo \
6584 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6586 Automatically set library path, then run a program.
6588 This mode accepts the following additional options:
6590 -dlopen FILE add the directory containing FILE to the library path
6592 This mode sets the library path environment variable according to \`-dlopen'
6593 flags.
6595 If any of the ARGS are libtool executable wrappers, then they are translated
6596 into their corresponding uninstalled binary, and any of their required library
6597 directories are added to the library path.
6599 Then, COMMAND is executed, with ARGS as arguments."
6602 finish)
6603 $echo \
6604 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6606 Complete the installation of libtool libraries.
6608 Each LIBDIR is a directory that contains libtool libraries.
6610 The commands that this mode executes may require superuser privileges. Use
6611 the \`--dry-run' option if you just want to see what would be executed."
6614 install)
6615 $echo \
6616 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6618 Install executables or libraries.
6620 INSTALL-COMMAND is the installation command. The first component should be
6621 either the \`install' or \`cp' program.
6623 The rest of the components are interpreted as arguments to that command (only
6624 BSD-compatible install options are recognized)."
6627 link)
6628 $echo \
6629 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6631 Link object files or libraries together to form another library, or to
6632 create an executable program.
6634 LINK-COMMAND is a command using the C compiler that you would use to create
6635 a program from several object files.
6637 The following components of LINK-COMMAND are treated specially:
6639 -all-static do not do any dynamic linking at all
6640 -avoid-version do not add a version suffix if possible
6641 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6642 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6643 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6644 -export-symbols SYMFILE
6645 try to export only the symbols listed in SYMFILE
6646 -export-symbols-regex REGEX
6647 try to export only the symbols matching REGEX
6648 -LLIBDIR search LIBDIR for required installed libraries
6649 -lNAME OUTPUT-FILE requires the installed library libNAME
6650 -module build a library that can dlopened
6651 -no-fast-install disable the fast-install mode
6652 -no-install link a not-installable executable
6653 -no-undefined declare that a library does not refer to external symbols
6654 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6655 -objectlist FILE Use a list of object files found in FILE to specify objects
6656 -release RELEASE specify package release information
6657 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6658 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6659 -static do not do any dynamic linking of libtool libraries
6660 -version-info CURRENT[:REVISION[:AGE]]
6661 specify library version info [each variable defaults to 0]
6663 All other options (arguments beginning with \`-') are ignored.
6665 Every other argument is treated as a filename. Files ending in \`.la' are
6666 treated as uninstalled libtool libraries, other files are standard or library
6667 object files.
6669 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6670 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6671 required, except when creating a convenience library.
6673 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6674 using \`ar' and \`ranlib', or on Windows using \`lib'.
6676 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6677 is created, otherwise an executable program is created."
6680 uninstall)
6681 $echo \
6682 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6684 Remove libraries from an installation directory.
6686 RM is the name of the program to use to delete files associated with each FILE
6687 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6688 to RM.
6690 If FILE is a libtool library, all the files associated with it are deleted.
6691 Otherwise, only FILE itself is deleted using RM."
6695 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6696 $echo "$help" 1>&2
6697 exit 1
6699 esac
6701 $echo
6702 $echo "Try \`$modename --help' for more information about other modes."
6704 exit 0
6706 # The TAGs below are defined such that we never get into a situation
6707 # in which we disable both kinds of libraries. Given conflicting
6708 # choices, we go for a static library, that is the most portable,
6709 # since we can't tell whether shared libraries were disabled because
6710 # the user asked for that or because the platform doesn't support
6711 # them. This is particularly important on AIX, because we don't
6712 # support having both static and shared libraries enabled at the same
6713 # time on that platform, so we default to a shared-only configuration.
6714 # If a disable-shared tag is given, we'll fallback to a static-only
6715 # configuration. But we'll never go from static-only to shared-only.
6717 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6718 build_libtool_libs=no
6719 build_old_libs=yes
6720 # ### END LIBTOOL TAG CONFIG: disable-shared
6722 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6723 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6724 # ### END LIBTOOL TAG CONFIG: disable-static
6726 # Local Variables:
6727 # mode:shell-script
6728 # sh-indentation:2
6729 # End:
6730 # ### BEGIN LIBTOOL TAG CONFIG: CXX
6732 # Libtool was configured on host yannick:
6734 # Shell to use when invoking shell scripts.
6735 SHELL="/bin/bash"
6737 # Whether or not to build shared libraries.
6738 build_libtool_libs=yes
6740 # Whether or not to build static libraries.
6741 build_old_libs=no
6743 # Whether or not to add -lc for building shared libraries.
6744 build_libtool_need_lc=no
6746 # Whether or not to disallow shared libs when runtime libs are static
6747 allow_libtool_libs_with_static_runtimes=no
6749 # Whether or not to optimize for fast installation.
6750 fast_install=yes
6752 # The host system.
6753 host_alias=
6754 host=i686-pc-linux-gnu
6756 # An echo program that does not interpret backslashes.
6757 echo="echo"
6759 # The archiver.
6760 AR="ar"
6761 AR_FLAGS="cru"
6763 # A C compiler.
6764 LTCC="gcc"
6766 # A language-specific compiler.
6767 CC="g++"
6769 # Is the compiler the GNU C compiler?
6770 with_gcc=yes
6772 # An ERE matcher.
6773 EGREP="grep -E"
6775 # The linker used to build libraries.
6776 LD="/usr/bin/ld"
6778 # Whether we need hard or soft links.
6779 LN_S="ln -s"
6781 # A BSD-compatible nm program.
6782 NM="/usr/bin/nm -B"
6784 # A symbol stripping program
6785 STRIP=strip
6787 # Used to examine libraries when file_magic_cmd begins "file"
6788 MAGIC_CMD=file
6790 # Used on cygwin: DLL creation program.
6791 DLLTOOL="dlltool"
6793 # Used on cygwin: object dumper.
6794 OBJDUMP="objdump"
6796 # Used on cygwin: assembler.
6797 AS="as"
6799 # The name of the directory that contains temporary libtool files.
6800 objdir=.libs
6802 # How to create reloadable object files.
6803 reload_flag=" -r"
6804 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
6806 # How to pass a linker flag through the compiler.
6807 wl="-Wl,"
6809 # Object file suffix (normally "o").
6810 objext="o"
6812 # Old archive suffix (normally "a").
6813 libext="a"
6815 # Shared library suffix (normally ".so").
6816 shrext='.so'
6818 # Executable file suffix (normally "").
6819 exeext=""
6821 # Additional compiler flags for building library objects.
6822 pic_flag=" -fPIC -DPIC"
6823 pic_mode=default
6825 # What is the maximum length of a command?
6826 max_cmd_len=32768
6828 # Does compiler simultaneously support -c and -o options?
6829 compiler_c_o="yes"
6831 # Must we lock files when doing compilation ?
6832 need_locks="no"
6834 # Do we need the lib prefix for modules?
6835 need_lib_prefix=no
6837 # Do we need a version for libraries?
6838 need_version=no
6840 # Whether dlopen is supported.
6841 dlopen_support=yes
6843 # Whether dlopen of programs is supported.
6844 dlopen_self=yes
6846 # Whether dlopen of statically linked programs is supported.
6847 dlopen_self_static=yes
6849 # Compiler flag to prevent dynamic linking.
6850 link_static_flag="-static"
6852 # Compiler flag to turn off builtin functions.
6853 no_builtin_flag=" -fno-builtin"
6855 # Compiler flag to allow reflexive dlopens.
6856 export_dynamic_flag_spec="\${wl}--export-dynamic"
6858 # Compiler flag to generate shared objects directly from archives.
6859 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
6861 # Compiler flag to generate thread-safe objects.
6862 thread_safe_flag_spec=""
6864 # Library versioning type.
6865 version_type=linux
6867 # Format of library name prefix.
6868 libname_spec="lib\$name"
6870 # List of archive names. First name is the real one, the rest are links.
6871 # The last name is the one that the linker finds with -lNAME.
6872 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
6874 # The coded name of the library, if different from the real name.
6875 soname_spec="\${libname}\${release}\${shared_ext}\$major"
6877 # Commands used to build and install an old-style archive.
6878 RANLIB="ranlib"
6879 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
6880 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
6881 old_postuninstall_cmds=""
6883 # Create an old-style archive from a shared archive.
6884 old_archive_from_new_cmds=""
6886 # Create a temporary old-style archive to link instead of a shared archive.
6887 old_archive_from_expsyms_cmds=""
6889 # Commands used to build and install a shared archive.
6890 archive_cmds="\$CC -shared -nostdlib \$compiler_flags \$predep_objects \$libobjs \$deplibs \$postdep_objects \${wl}-soname \$wl\$soname -o \$lib"
6891 archive_expsym_cmds="\$CC -shared -nostdlib \$compiler_flags \$predep_objects \$libobjs \$deplibs \$postdep_objects \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
6892 postinstall_cmds=""
6893 postuninstall_cmds=""
6895 # Commands used to build a loadable module (assumed same as above if empty)
6896 module_cmds=""
6897 module_expsym_cmds=""
6899 # Commands to strip libraries.
6900 old_striplib="strip --strip-debug"
6901 striplib="strip --strip-unneeded"
6903 # Dependencies to place before the objects being linked to create a
6904 # shared library.
6905 predep_objects="/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.1.2/crtbeginS.o"
6907 # Dependencies to place after the objects being linked to create a
6908 # shared library.
6909 postdep_objects="/usr/lib/gcc/i486-linux-gnu/4.1.2/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crtn.o"
6911 # Dependencies to place before the objects being linked to create a
6912 # shared library.
6913 predeps=""
6915 # Dependencies to place after the objects being linked to create a
6916 # shared library.
6917 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
6919 # The library search path used internally by the compiler when linking
6920 # a shared library.
6921 compiler_lib_search_path="-L/usr/lib/gcc/i486-linux-gnu/4.1.2 -L/usr/lib/gcc/i486-linux-gnu/4.1.2 -L/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib"
6923 # Method to check whether dependent libraries are shared objects.
6924 deplibs_check_method="pass_all"
6926 # Command to use when deplibs_check_method == file_magic.
6927 file_magic_cmd="\$MAGIC_CMD"
6929 # Flag that allows shared libraries with undefined symbols to be built.
6930 allow_undefined_flag=""
6932 # Flag that forces no undefined symbols.
6933 no_undefined_flag=""
6935 # Commands used to finish a libtool library installation in a directory.
6936 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
6938 # Same as above, but a single script fragment to be evaled but not shown.
6939 finish_eval=""
6941 # Take the output of nm and produce a listing of raw symbols and C names.
6942 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
6944 # Transform the output of nm in a proper C declaration
6945 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
6947 # Transform the output of nm in a C name address pair
6948 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
6950 # This is the shared library runtime path variable.
6951 runpath_var=LD_RUN_PATH
6953 # This is the shared library path variable.
6954 shlibpath_var=LD_LIBRARY_PATH
6956 # Is shlibpath searched before the hard-coded library search path?
6957 shlibpath_overrides_runpath=no
6959 # How to hardcode a shared library path into an executable.
6960 hardcode_action=immediate
6962 # Whether we should hardcode library paths into libraries.
6963 hardcode_into_libs=yes
6965 # Flag to hardcode $libdir into a binary during linking.
6966 # This must work even if $libdir does not exist.
6967 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
6969 # If ld is used when linking, flag to hardcode $libdir into
6970 # a binary during linking. This must work even if $libdir does
6971 # not exist.
6972 hardcode_libdir_flag_spec_ld=""
6974 # Whether we need a single -rpath flag with a separated argument.
6975 hardcode_libdir_separator=""
6977 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
6978 # resulting binary.
6979 hardcode_direct=no
6981 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
6982 # resulting binary.
6983 hardcode_minus_L=no
6985 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
6986 # the resulting binary.
6987 hardcode_shlibpath_var=
6989 # Set to yes if building a shared library automatically hardcodes DIR into the library
6990 # and all subsequent libraries and executables linked against it.
6991 hardcode_automatic=no
6993 # Variables whose values should be saved in libtool wrapper scripts and
6994 # restored at relink time.
6995 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6997 # Whether libtool must link a program against all its dependency libraries.
6998 link_all_deplibs=unknown
7000 # Compile-time system search path for libraries
7001 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
7003 # Run-time system search path for libraries
7004 sys_lib_dlsearch_path_spec="/lib /usr/lib"
7006 # Fix the shell variable $srcfile for the compiler.
7007 fix_srcfile_path=""
7009 # Set to yes if exported symbols are required.
7010 always_export_symbols=no
7012 # The commands to list exported symbols.
7013 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
7015 # The commands to extract the exported symbol list from a shared archive.
7016 extract_expsyms_cmds=""
7018 # Symbols that should not be listed in the preloaded symbols.
7019 exclude_expsyms=""
7021 # Symbols that must always be exported.
7022 include_expsyms=""
7024 # ### END LIBTOOL TAG CONFIG: CXX