Install msysDVLPR-1.0.0-alpha-1
[msysgit.git] / bin / libtool
blob07a0f9141da976ad7010067e93452338338cb8e0
1 #! /bin/sh
3 # libtoolT - Provide generalized library-building support services.
4 # Generated automatically by (GNU libtool 1.4e (1.1162 2002/11/22 22:36:25))
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
33 Xsed="sed -e s/^X//"
35 # The HP-UX ksh and POSIX shell print the target directory to stdout
36 # if CDPATH is set.
37 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
39 # The names of the tagged configurations supported by this script.
40 available_tags=" CXX F77 GCJ"
42 # ### BEGIN LIBTOOL CONFIG
44 # Libtool was configured on host du216771:
46 # Shell to use when invoking shell scripts.
47 SHELL="/bin/sh"
49 # Whether or not to build shared libraries.
50 build_libtool_libs=no
52 # Whether or not to build static libraries.
53 build_old_libs=yes
55 # Whether or not to add -lc for building shared libraries.
56 build_libtool_need_lc=yes
58 # Whether or not to disallow shared libs when runtime libs are static
59 allow_libtool_libs_with_static_runtimes=no
61 # Whether or not to optimize for fast installation.
62 fast_install=yes
64 # The host system.
65 host_alias=
66 host=i686-pc-msys
68 # An echo program that does not interpret backslashes.
69 echo="echo"
71 # The archiver.
72 AR="ar"
73 AR_FLAGS="cru"
75 # A C compiler.
76 LTCC="gcc"
78 # A language-specific compiler.
79 CC="gcc"
81 # Is the compiler the GNU C compiler?
82 with_gcc=yes
84 # An ERE matcher.
85 EGREP="grep -E"
87 # The linker used to build libraries.
88 LD="/usr/msys/bin/ld.exe"
90 # Whether we need hard or soft links.
91 LN_S="ln -s"
93 # A BSD-compatible nm program.
94 NM="/bin/nm -B"
96 # A sed program that does not truncate output.
97 SED="/bin/sed"
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 # Executable file suffix (normally "").
131 exeext=""
133 # Additional compiler flags for building library objects.
134 pic_flag=" -DPIC"
135 pic_mode=default
137 # What is the maximum length of a command?
138 max_cmd_len=262144
140 # Does compiler simultaneously support -c and -o options?
141 compiler_c_o="yes"
143 # Must we lock files when doing compilation ?
144 need_locks="no"
146 # Do we need the lib prefix for modules?
147 need_lib_prefix=unknown
149 # Do we need a version for libraries?
150 need_version=unknown
152 # Whether dlopen is supported.
153 dlopen_support=yes
155 # Whether dlopen of programs is supported.
156 dlopen_self=no
158 # Whether dlopen of statically linked programs is supported.
159 dlopen_self_static=unknown
161 # Compiler flag to prevent dynamic linking.
162 link_static_flag="-static"
164 # Compiler flag to turn off builtin functions.
165 no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
167 # Compiler flag to allow reflexive dlopens.
168 export_dynamic_flag_spec="\${wl}--export-dynamic"
170 # Compiler flag to generate shared objects directly from archives.
171 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
173 # Compiler flag to generate thread-safe objects.
174 thread_safe_flag_spec=""
176 # Library versioning type.
177 version_type=none
179 # Format of library name prefix.
180 libname_spec="lib\$name"
182 # List of archive names. First name is the real one, the rest are links.
183 # The last name is the one that the linker finds with -lNAME.
184 library_names_spec=""
186 # The coded name of the library, if different from the real name.
187 soname_spec=""
189 # Commands used to build and install an old-style archive.
190 RANLIB="ranlib"
191 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
192 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
193 old_postuninstall_cmds=""
195 # Create an old-style archive from a shared archive.
196 old_archive_from_new_cmds=""
198 # Create a temporary old-style archive to link instead of a shared archive.
199 old_archive_from_expsyms_cmds=""
201 # Commands used to build and install a shared archive.
202 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
203 archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
204 postinstall_cmds=""
205 postuninstall_cmds=""
207 # Commands to strip libraries.
208 old_striplib="strip --strip-debug"
209 striplib="strip --strip-unneeded"
211 # Dependencies to place before the objects being linked to create a
212 # shared library.
213 predep_objects=""
215 # Dependencies to place after the objects being linked to create a
216 # shared library.
217 postdep_objects=""
219 # Dependencies to place before the objects being linked to create a
220 # shared library.
221 predeps=""
223 # Dependencies to place after the objects being linked to create a
224 # shared library.
225 postdeps=""
227 # The library search path used internally by the compiler when linking
228 # a shared library.
229 compiler_lib_search_path=""
231 # Method to check whether dependent libraries are shared objects.
232 deplibs_check_method="unknown"
234 # Command to use when deplibs_check_method == file_magic.
235 file_magic_cmd="\$MAGIC_CMD"
237 # Flag that allows shared libraries with undefined symbols to be built.
238 allow_undefined_flag=""
240 # Flag that forces no undefined symbols.
241 no_undefined_flag=""
243 # Commands used to finish a libtool library installation in a directory.
244 finish_cmds=""
246 # Same as above, but a single script fragment to be evaled but not shown.
247 finish_eval=""
249 # Take the output of nm and produce a listing of raw symbols and C names.
250 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(_\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
252 # Transform the output of nm in a proper C declaration
253 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
255 # Transform the output of nm in a C name address pair
256 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
258 # This is the shared library runtime path variable.
259 runpath_var=LD_RUN_PATH
261 # This is the shared library path variable.
262 shlibpath_var=
264 # Is shlibpath searched before the hard-coded library search path?
265 shlibpath_overrides_runpath=unknown
267 # How to hardcode a shared library path into an executable.
268 hardcode_action=immediate
270 # Whether we should hardcode library paths into libraries.
271 hardcode_into_libs=no
273 # Flag to hardcode $libdir into a binary during linking.
274 # This must work even if $libdir does not exist.
275 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
277 # Whether we need a single -rpath flag with a separated argument.
278 hardcode_libdir_separator=""
280 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
281 # resulting binary.
282 hardcode_direct=no
284 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
285 # resulting binary.
286 hardcode_minus_L=no
288 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
289 # the resulting binary.
290 hardcode_shlibpath_var=unsupported
292 # Variables whose values should be saved in libtool wrapper scripts and
293 # restored at relink time.
294 variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
296 # Whether libtool must link a program against all its dependency libraries.
297 link_all_deplibs=unknown
299 # Compile-time system search path for libraries
300 sys_lib_search_path_spec=" /bin/../lib/gcc-lib/msys/2.95.3-1/ /bin/../lib/gcc-lib/ /usr/lib/gcc-lib/msys/2.95.3-1/ /usr/lib/gcc/msys/2.95.3-1/ /bin/../lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib/msys/2.95.3-1/ /bin/../lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib/ /usr/lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib/msys/2.95.3-1/ /usr/lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib/"
302 # Run-time system search path for libraries
303 sys_lib_dlsearch_path_spec="/lib /usr/lib"
305 # Fix the shell variable $srcfile for the compiler.
306 fix_srcfile_path=""
308 # Set to yes if exported symbols are required.
309 always_export_symbols=no
311 # The commands to list exported symbols.
312 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
314 # The commands to extract the exported symbol list from a shared archive.
315 extract_expsyms_cmds=""
317 # Symbols that should not be listed in the preloaded symbols.
318 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
320 # Symbols that must always be exported.
321 include_expsyms=""
323 # ### END LIBTOOL CONFIG
325 # ltmain.sh - Provide generalized library-building support services.
326 # NOTE: Changing this file will not affect anything until you rerun configure.
328 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
329 # Free Software Foundation, Inc.
330 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
332 # This program is free software; you can redistribute it and/or modify
333 # it under the terms of the GNU General Public License as published by
334 # the Free Software Foundation; either version 2 of the License, or
335 # (at your option) any later version.
337 # This program is distributed in the hope that it will be useful, but
338 # WITHOUT ANY WARRANTY; without even the implied warranty of
339 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
340 # General Public License for more details.
342 # You should have received a copy of the GNU General Public License
343 # along with this program; if not, write to the Free Software
344 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
346 # As a special exception to the GNU General Public License, if you
347 # distribute this file as part of a program that contains a
348 # configuration script generated by Autoconf, you may include it under
349 # the same distribution terms that you use for the rest of that program.
351 # Check that we have a working $echo.
352 if test "X$1" = X--no-reexec; then
353 # Discard the --no-reexec flag, and continue.
354 shift
355 elif test "X$1" = X--fallback-echo; then
356 # Avoid inline document here, it may be left over
358 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
359 # Yippee, $echo works!
361 else
362 # Restart under the correct shell, and then maybe $echo will work.
363 exec $SHELL "$0" --no-reexec ${1+"$@"}
366 if test "X$1" = X--fallback-echo; then
367 # used as fallback echo
368 shift
369 cat <<EOF
372 exit 0
375 # The name of this program.
376 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
377 modename="$progname"
379 # Constants.
380 PROGRAM=ltmain.sh
381 PACKAGE=libtool
382 VERSION=1.4e
383 TIMESTAMP=" (1.1162 2002/11/22 22:36:25)"
385 default_mode=
386 help="Try \`$progname --help' for more information."
387 magic="%%%MAGIC variable%%%"
388 mkdir="mkdir"
389 mv="mv -f"
390 rm="rm -f"
392 # Sed substitution that helps us do robust quoting. It backslashifies
393 # metacharacters that are still active within double-quoted strings.
394 Xsed="${SED}"' -e 1s/^X//'
395 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
396 # test EBCDIC or ASCII
397 case `echo A|od -x` in
398 *[Cc]1*) # EBCDIC based system
399 SP2NL="tr '\100' '\n'"
400 NL2SP="tr '\r\n' '\100\100'"
402 *) # Assume ASCII based system
403 SP2NL="tr '\040' '\012'"
404 NL2SP="tr '\015\012' '\040\040'"
406 esac
408 # NLS nuisances.
409 # Only set LANG and LC_ALL to C if already set.
410 # These must not be set unconditionally because not all systems understand
411 # e.g. LANG=C (notably SCO).
412 # We save the old values to restore during execute mode.
413 if test "${LC_ALL+set}" = set; then
414 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
416 if test "${LANG+set}" = set; then
417 save_LANG="$LANG"; LANG=C; export LANG
420 # Make sure IFS has a sensible default
421 : ${IFS=" "}
423 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
424 echo "$modename: not configured to build any kind of library" 1>&2
425 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
426 exit 1
429 # Global variables.
430 mode=$default_mode
431 nonopt=
432 prev=
433 prevopt=
434 run=
435 show="$echo"
436 show_help=
437 execute_dlfiles=
438 lo2o="s/\\.lo\$/.${objext}/"
439 o2lo="s/\\.${objext}\$/.lo/"
441 #####################################
442 # Shell function definitions:
443 # This seems to be the best place for them
445 # Need a lot of goo to handle *both* DLLs and import libs
446 # Has to be a shell function in order to 'eat' the argument
447 # that is supplied when $file_magic_command is called.
448 win32_libid () {
449 win32_libid_type="unknown"
450 if eval $OBJDUMP -f $1 2>/dev/null | \
451 grep -E 'file format pei+-i386(.*architecture: i386)?' >/dev/null ; then
452 win32_libid_type="x86 DLL"
453 else
454 if eval $OBJDUMP -f $1 2>/dev/null | \
455 grep -E 'file format pei*-i386(.*architecture: i386)?' >/dev/null ; then
456 win32_libid_type="x86"
457 if eval file $1 2>/dev/null | \
458 grep -E 'ar archive' >/dev/null; then
459 win32_libid_type="$win32_libid_type archive"
460 if eval $NM -f posix -A $1 | awk '{print $3}' | grep "I" >/dev/null ; then
461 win32_libid_type="$win32_libid_type import"
462 else
463 win32_libid_type="$win32_libid_type static"
468 echo $win32_libid_type
471 # End of Shell function definitions
472 #####################################
475 # Parse our command line options once, thoroughly.
476 while test "$#" -gt 0
478 arg="$1"
479 shift
481 case $arg in
482 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
483 *) optarg= ;;
484 esac
486 # If the previous option needs an argument, assign it.
487 if test -n "$prev"; then
488 case $prev in
489 execute_dlfiles)
490 execute_dlfiles="$execute_dlfiles $arg"
492 tag)
493 tagname="$arg"
495 # Check whether tagname contains only valid characters
496 case $tagname in
497 *[!-_A-Za-z0-9,/]*)
498 echo "$progname: invalid tag name: $tagname" 1>&2
499 exit 1
501 esac
503 case $tagname in
505 # Don't test for the "default" C tag, as we know, it's there, but
506 # not specially marked.
509 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
510 taglist="$taglist $tagname"
511 # Evaluate the configuration.
512 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
513 else
514 echo "$progname: ignoring unknown tag $tagname" 1>&2
517 esac
520 eval "$prev=\$arg"
522 esac
524 prev=
525 prevopt=
526 continue
529 # Have we seen a non-optional argument yet?
530 case $arg in
531 --help)
532 show_help=yes
535 --version)
536 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
537 echo
538 echo "Copyright 1996, 1997, 1998, 1999, 2000, 2001"
539 echo "Free Software Foundation, Inc."
540 echo "This is free software; see the source for copying conditions. There is NO"
541 echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
542 exit 0
545 --config)
546 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
547 # Now print the configurations for the tags.
548 for tagname in $taglist; do
549 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
550 done
551 exit 0
554 --debug)
555 echo "$progname: enabling shell trace mode"
556 set -x
559 --dry-run | -n)
560 run=:
563 --features)
564 echo "host: $host"
565 if test "$build_libtool_libs" = yes; then
566 echo "enable shared libraries"
567 else
568 echo "disable shared libraries"
570 if test "$build_old_libs" = yes; then
571 echo "enable static libraries"
572 else
573 echo "disable static libraries"
575 exit 0
578 --finish) mode="finish" ;;
580 --mode) prevopt="--mode" prev=mode ;;
581 --mode=*) mode="$optarg" ;;
583 --preserve-dup-deps) duplicate_deps="yes" ;;
585 --quiet | --silent)
586 show=:
589 --tag) prevopt="--tag" prev=tag ;;
590 --tag=*)
591 set tag "$optarg" ${1+"$@"}
592 shift
593 prev=tag
596 -dlopen)
597 prevopt="-dlopen"
598 prev=execute_dlfiles
602 $echo "$modename: unrecognized option \`$arg'" 1>&2
603 $echo "$help" 1>&2
604 exit 1
608 nonopt="$arg"
609 break
611 esac
612 done
614 if test -n "$prevopt"; then
615 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
616 $echo "$help" 1>&2
617 exit 1
620 # If this variable is set in any of the actions, the command in it
621 # will be execed at the end. This prevents here-documents from being
622 # left over by shells.
623 exec_cmd=
625 if test -z "$show_help"; then
627 # Infer the operation mode.
628 if test -z "$mode"; then
629 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
630 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
631 case $nonopt in
632 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
633 mode=link
634 for arg
636 case $arg in
638 mode=compile
639 break
641 esac
642 done
644 *db | *dbx | *strace | *truss)
645 mode=execute
647 *install*|cp|mv)
648 mode=install
650 *rm)
651 mode=uninstall
654 # If we have no mode, but dlfiles were specified, then do execute mode.
655 test -n "$execute_dlfiles" && mode=execute
657 # Just use the default operation mode.
658 if test -z "$mode"; then
659 if test -n "$nonopt"; then
660 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
661 else
662 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
666 esac
669 # Only execute mode is allowed to have -dlopen flags.
670 if test -n "$execute_dlfiles" && test "$mode" != execute; then
671 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
672 $echo "$help" 1>&2
673 exit 1
676 # Change the help message to a mode-specific one.
677 generic_help="$help"
678 help="Try \`$modename --help --mode=$mode' for more information."
680 # These modes are in order of execution frequency so that they run quickly.
681 case $mode in
682 # libtool compile mode
683 compile)
684 modename="$modename: compile"
685 # Get the compilation command and the source file.
686 base_compile=
687 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
688 suppress_output=
689 arg_mode=normal
690 libobj=
692 for arg
694 case "$arg_mode" in
695 arg )
696 # do not "continue". Instead, add this to base_compile
697 lastarg="$arg"
698 arg_mode=normal
701 target )
702 libobj="$arg"
703 arg_mode=normal
704 continue
707 normal )
708 # Accept any command-line options.
709 case $arg in
711 if test -n "$libobj" ; then
712 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
713 exit 1
715 arg_mode=target
716 continue
719 -static)
720 build_old_libs=yes
721 continue
724 -prefer-pic)
725 pic_mode=yes
726 continue
729 -prefer-non-pic)
730 pic_mode=no
731 continue
734 -Xcompiler)
735 arg_mode=arg # the next one goes into the "base_compile" arg list
736 continue # The current "srcfile" will either be retained or
737 ;; # replaced later. I would guess that would be a bug.
739 -Wc,*)
740 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
741 lastarg=
742 save_ifs="$IFS"; IFS=','
743 for arg in $args; do
744 IFS="$save_ifs"
746 # Double-quote args containing other shell metacharacters.
747 # Many Bourne shells cannot handle close brackets correctly
748 # in scan sets, so we specify it separately.
749 case $arg in
750 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
751 arg="\"$arg\""
753 esac
754 lastarg="$lastarg $arg"
755 done
756 IFS="$save_ifs"
757 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
759 # Add the arguments to base_compile.
760 base_compile="$base_compile $lastarg"
761 continue
765 # Accept the current argument as the source file.
766 # The previous "srcfile" becomes the current argument.
768 lastarg="$srcfile"
769 srcfile="$arg"
771 esac # case $arg
773 esac # case $arg_mode
775 # Aesthetically quote the previous argument.
776 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
778 case $lastarg in
779 # Double-quote args containing other shell metacharacters.
780 # Many Bourne shells cannot handle close brackets correctly
781 # in scan sets, so we specify it separately.
782 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
783 lastarg="\"$lastarg\""
785 esac
787 base_compile="$base_compile $lastarg"
788 done # for arg
790 case $arg_mode in
791 arg)
792 $echo "$modename: you must specify an argument for -Xcompile"
793 exit 1
795 target)
796 $echo "$modename: you must specify a target with \`-o'" 1>&2
797 exit 1
800 # Get the name of the library object.
801 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
803 esac
805 # Recognize several different file suffixes.
806 # If the user specifies -o file.o, it is replaced with file.lo
807 xform='[cCFSifmso]'
808 case $libobj in
809 *.ada) xform=ada ;;
810 *.adb) xform=adb ;;
811 *.ads) xform=ads ;;
812 *.asm) xform=asm ;;
813 *.c++) xform=c++ ;;
814 *.cc) xform=cc ;;
815 *.ii) xform=ii ;;
816 *.class) xform=class ;;
817 *.cpp) xform=cpp ;;
818 *.cxx) xform=cxx ;;
819 *.f90) xform=f90 ;;
820 *.for) xform=for ;;
821 *.java) xform=java ;;
822 esac
824 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
826 case $libobj in
827 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
829 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
830 exit 1
832 esac
834 # Infer tagged configuration to use if any are available and
835 # if one wasn't chosen via the "--tag" command line option.
836 # Only attempt this if the compiler in the base compile
837 # command doesn't match the default compiler.
838 if test -n "$available_tags" && test -z "$tagname"; then
839 case $base_compile in
840 # Blanks in the command may have been stripped by the calling shell,
841 # but not from the CC environment variable when configure was run.
842 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
843 # Blanks at the start of $base_compile will cause this to fail
844 # if we don't check for them as well.
846 for z in $available_tags; do
847 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
848 # Evaluate the configuration.
849 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
850 case "$base_compile " in
851 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
852 # The compiler in the base compile command matches
853 # the one in the tagged configuration.
854 # Assume this is the tagged configuration we want.
855 tagname=$z
856 break
858 esac
860 done
861 # If $tagname still isn't set, then no tagged configuration
862 # was found and let the user know that the "--tag" command
863 # line option must be used.
864 if test -z "$tagname"; then
865 echo "$modename: unable to infer tagged configuration"
866 echo "$modename: specify a tag with \`--tag'" 1>&2
867 exit 1
868 # else
869 # echo "$modename: using $tagname tagged configuration"
872 esac
875 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
876 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
877 if test "X$xdir" = "X$obj"; then
878 xdir=
879 else
880 xdir=$xdir/
882 lobj=${xdir}$objdir/$objname
884 if test -z "$base_compile"; then
885 $echo "$modename: you must specify a compilation command" 1>&2
886 $echo "$help" 1>&2
887 exit 1
890 # Delete any leftover library objects.
891 if test "$build_old_libs" = yes; then
892 removelist="$obj $lobj $libobj ${libobj}T"
893 else
894 removelist="$lobj $libobj ${libobj}T"
897 $run $rm $removelist
898 trap "$run $rm $removelist; exit 1" 1 2 15
900 # On Cygwin there's no "real" PIC flag so we must build both object types
901 case $host_os in
902 cygwin* | mingw* | pw32* | os2*)
903 pic_mode=default
905 esac
906 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
907 # non-PIC code in shared libraries is not supported
908 pic_mode=default
911 # Calculate the filename of the output object if compiler does
912 # not support -o with -c
913 if test "$compiler_c_o" = no; then
914 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
915 lockfile="$output_obj.lock"
916 removelist="$removelist $output_obj $lockfile"
917 trap "$run $rm $removelist; exit 1" 1 2 15
918 else
919 output_obj=
920 need_locks=no
921 lockfile=
924 # Lock this critical section if it is needed
925 # We use this script file to make the link, it avoids creating a new file
926 if test "$need_locks" = yes; then
927 until $run ln "$0" "$lockfile" 2>/dev/null; do
928 $show "Waiting for $lockfile to be removed"
929 sleep 2
930 done
931 elif test "$need_locks" = warn; then
932 if test -f "$lockfile"; then
933 echo "\
934 *** ERROR, $lockfile exists and contains:
935 `cat $lockfile 2>/dev/null`
937 This indicates that another process is trying to use the same
938 temporary object file, and libtool could not work around it because
939 your compiler does not support \`-c' and \`-o' together. If you
940 repeat this compilation, it may succeed, by chance, but you had better
941 avoid parallel builds (make -j) in this platform, or get a better
942 compiler."
944 $run $rm $removelist
945 exit 1
947 echo $srcfile > "$lockfile"
950 if test -n "$fix_srcfile_path"; then
951 eval srcfile=\"$fix_srcfile_path\"
954 $run $rm "$libobj" "${libobj}T"
956 # Create a libtool object file (analogous to a ".la" file),
957 # but don't create it if we're doing a dry run.
958 test -z "$run" && cat > ${libobj}T <<EOF
959 # $libobj - a libtool object file
960 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
962 # Please DO NOT delete this file!
963 # It is necessary for linking the library.
965 # Name of the PIC object.
968 # Only build a PIC object if we are building libtool libraries.
969 if test "$build_libtool_libs" = yes; then
970 # Without this assignment, base_compile gets emptied.
971 fbsd_hideous_sh_bug=$base_compile
973 if test "$pic_mode" != no; then
974 command="$base_compile $srcfile $pic_flag"
975 else
976 # Don't build PIC code
977 command="$base_compile $srcfile"
980 if test ! -d "${xdir}$objdir"; then
981 $show "$mkdir ${xdir}$objdir"
982 $run $mkdir ${xdir}$objdir
983 status=$?
984 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
985 exit $status
989 if test -z "$output_obj"; then
990 # Place PIC objects in $objdir
991 command="$command -o $lobj"
994 $run $rm "$lobj" "$output_obj"
996 $show "$command"
997 if $run eval "$command"; then :
998 else
999 test -n "$output_obj" && $run $rm $removelist
1000 exit 1
1003 if test "$need_locks" = warn &&
1004 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1005 echo "\
1006 *** ERROR, $lockfile contains:
1007 `cat $lockfile 2>/dev/null`
1009 but it should contain:
1010 $srcfile
1012 This indicates that another process is trying to use the same
1013 temporary object file, and libtool could not work around it because
1014 your compiler does not support \`-c' and \`-o' together. If you
1015 repeat this compilation, it may succeed, by chance, but you had better
1016 avoid parallel builds (make -j) in this platform, or get a better
1017 compiler."
1019 $run $rm $removelist
1020 exit 1
1023 # Just move the object if needed, then go on to compile the next one
1024 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1025 $show "$mv $output_obj $lobj"
1026 if $run $mv $output_obj $lobj; then :
1027 else
1028 error=$?
1029 $run $rm $removelist
1030 exit $error
1034 # Append the name of the PIC object to the libtool object file.
1035 test -z "$run" && cat >> ${libobj}T <<EOF
1036 pic_object='$objdir/$objname'
1040 # Allow error messages only from the first compilation.
1041 suppress_output=' >/dev/null 2>&1'
1042 else
1043 # No PIC object so indicate it doesn't exist in the libtool
1044 # object file.
1045 test -z "$run" && cat >> ${libobj}T <<EOF
1046 pic_object=none
1051 # Only build a position-dependent object if we build old libraries.
1052 if test "$build_old_libs" = yes; then
1053 if test "$pic_mode" != yes; then
1054 # Don't build PIC code
1055 command="$base_compile $srcfile"
1056 else
1057 command="$base_compile $srcfile $pic_flag"
1059 if test "$compiler_c_o" = yes; then
1060 command="$command -o $obj"
1063 # Suppress compiler output if we already did a PIC compilation.
1064 command="$command$suppress_output"
1065 $run $rm "$obj" "$output_obj"
1066 $show "$command"
1067 if $run eval "$command"; then :
1068 else
1069 $run $rm $removelist
1070 exit 1
1073 if test "$need_locks" = warn &&
1074 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1075 echo "\
1076 *** ERROR, $lockfile contains:
1077 `cat $lockfile 2>/dev/null`
1079 but it should contain:
1080 $srcfile
1082 This indicates that another process is trying to use the same
1083 temporary object file, and libtool could not work around it because
1084 your compiler does not support \`-c' and \`-o' together. If you
1085 repeat this compilation, it may succeed, by chance, but you had better
1086 avoid parallel builds (make -j) in this platform, or get a better
1087 compiler."
1089 $run $rm $removelist
1090 exit 1
1093 # Just move the object if needed
1094 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1095 $show "$mv $output_obj $obj"
1096 if $run $mv $output_obj $obj; then :
1097 else
1098 error=$?
1099 $run $rm $removelist
1100 exit $error
1104 # Append the name of the non-PIC object the libtool object file.
1105 # Only append if the libtool object file exists.
1106 test -z "$run" && cat >> ${libobj}T <<EOF
1107 # Name of the non-PIC object.
1108 non_pic_object='$objname'
1111 else
1112 # Append the name of the non-PIC object the libtool object file.
1113 # Only append if the libtool object file exists.
1114 test -z "$run" && cat >> ${libobj}T <<EOF
1115 # Name of the non-PIC object.
1116 non_pic_object=none
1121 $run $mv "${libobj}T" "${libobj}"
1123 # Unlock the critical section if it was locked
1124 if test "$need_locks" != no; then
1125 $run $rm "$lockfile"
1128 exit 0
1131 # libtool link mode
1132 link | relink)
1133 modename="$modename: link"
1134 case $host in
1135 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1136 # It is impossible to link a dll without this setting, and
1137 # we shouldn't force the makefile maintainer to figure out
1138 # which system we are compiling for in order to pass an extra
1139 # flag for every libtool invocation.
1140 # allow_undefined=no
1142 # FIXME: Unfortunately, there are problems with the above when trying
1143 # to make a dll which has undefined symbols, in which case not
1144 # even a static library is built. For now, we need to specify
1145 # -no-undefined on the libtool link line when we can be certain
1146 # that all symbols are satisfied, otherwise we get a static library.
1147 allow_undefined=yes
1150 allow_undefined=yes
1152 esac
1153 libtool_args="$nonopt"
1154 base_compile="$nonopt"
1155 compile_command="$nonopt"
1156 finalize_command="$nonopt"
1158 compile_rpath=
1159 finalize_rpath=
1160 compile_shlibpath=
1161 finalize_shlibpath=
1162 convenience=
1163 old_convenience=
1164 deplibs=
1165 old_deplibs=
1166 compiler_flags=
1167 linker_flags=
1168 dllsearchpath=
1169 lib_search_path=`pwd`
1170 inst_prefix_dir=
1172 avoid_version=no
1173 dlfiles=
1174 dlprefiles=
1175 dlself=no
1176 export_dynamic=no
1177 export_symbols=
1178 export_symbols_regex=
1179 generated=
1180 libobjs=
1181 ltlibs=
1182 module=no
1183 no_install=no
1184 objs=
1185 non_pic_objects=
1186 prefer_static_libs=no
1187 preload=no
1188 prev=
1189 prevarg=
1190 release=
1191 rpath=
1192 xrpath=
1193 perm_rpath=
1194 temp_rpath=
1195 thread_safe=no
1196 vinfo=
1198 # We need to know -static, to get the right output filenames.
1199 for arg
1201 case $arg in
1202 -all-static | -static)
1203 if test "X$arg" = "X-all-static"; then
1204 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1205 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1207 if test -n "$link_static_flag"; then
1208 dlopen_self=$dlopen_self_static
1210 else
1211 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1212 dlopen_self=$dlopen_self_static
1215 build_libtool_libs=no
1216 build_old_libs=yes
1217 prefer_static_libs=yes
1218 break
1220 esac
1221 done
1223 # See if our shared archives depend on static archives.
1224 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1226 # Go through the arguments, transforming them on the way.
1227 while test "$#" -gt 0; do
1228 arg="$1"
1229 base_compile="$base_compile $arg"
1230 shift
1231 case $arg in
1232 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1233 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1235 *) qarg=$arg ;;
1236 esac
1237 libtool_args="$libtool_args $qarg"
1239 # If the previous option needs an argument, assign it.
1240 if test -n "$prev"; then
1241 case $prev in
1242 output)
1243 compile_command="$compile_command @OUTPUT@"
1244 finalize_command="$finalize_command @OUTPUT@"
1246 esac
1248 case $prev in
1249 dlfiles|dlprefiles)
1250 if test "$preload" = no; then
1251 # Add the symbol object into the linking commands.
1252 compile_command="$compile_command @SYMFILE@"
1253 finalize_command="$finalize_command @SYMFILE@"
1254 preload=yes
1256 case $arg in
1257 *.la | *.lo) ;; # We handle these cases below.
1258 force)
1259 if test "$dlself" = no; then
1260 dlself=needless
1261 export_dynamic=yes
1263 prev=
1264 continue
1266 self)
1267 if test "$prev" = dlprefiles; then
1268 dlself=yes
1269 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1270 dlself=yes
1271 else
1272 dlself=needless
1273 export_dynamic=yes
1275 prev=
1276 continue
1279 if test "$prev" = dlfiles; then
1280 dlfiles="$dlfiles $arg"
1281 else
1282 dlprefiles="$dlprefiles $arg"
1284 prev=
1285 continue
1287 esac
1289 expsyms)
1290 export_symbols="$arg"
1291 if test ! -f "$arg"; then
1292 $echo "$modename: symbol file \`$arg' does not exist"
1293 exit 1
1295 prev=
1296 continue
1298 expsyms_regex)
1299 export_symbols_regex="$arg"
1300 prev=
1301 continue
1303 inst_prefix)
1304 inst_prefix_dir="$arg"
1305 prev=
1306 continue
1308 release)
1309 release="-$arg"
1310 prev=
1311 continue
1313 objectlist)
1314 if test -f "$arg"; then
1315 save_arg=$arg
1316 moreargs=
1317 for fil in `cat $save_arg`
1319 # moreargs="$moreargs $fil"
1320 arg=$fil
1321 # A libtool-controlled object.
1323 # Check to see that this really is a libtool object.
1324 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1325 pic_object=
1326 non_pic_object=
1328 # Read the .lo file
1329 # If there is no directory component, then add one.
1330 case $arg in
1331 */* | *\\*) . $arg ;;
1332 *) . ./$arg ;;
1333 esac
1335 if test -z "$pic_object" || \
1336 test -z "$non_pic_object" ||
1337 test "$pic_object" = none && \
1338 test "$non_pic_object" = none; then
1339 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1340 exit 1
1343 # Extract subdirectory from the argument.
1344 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1345 if test "X$xdir" = "X$arg"; then
1346 xdir=
1347 else
1348 xdir="$xdir/"
1351 if test "$pic_object" != none; then
1352 # Prepend the subdirectory the object is found in.
1353 pic_object="$xdir$pic_object"
1355 if test "$prev" = dlfiles; then
1356 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1357 dlfiles="$dlfiles $pic_object"
1358 prev=
1359 continue
1360 else
1361 # If libtool objects are unsupported, then we need to preload.
1362 prev=dlprefiles
1366 # CHECK ME: I think I busted this. -Ossama
1367 if test "$prev" = dlprefiles; then
1368 # Preload the old-style object.
1369 dlprefiles="$dlprefiles $pic_object"
1370 prev=
1373 # A PIC object.
1374 libobjs="$libobjs $pic_object"
1375 arg="$pic_object"
1378 # Non-PIC object.
1379 if test "$non_pic_object" != none; then
1380 # Prepend the subdirectory the object is found in.
1381 non_pic_object="$xdir$non_pic_object"
1383 # A standard non-PIC object
1384 non_pic_objects="$non_pic_objects $non_pic_object"
1385 if test -z "$pic_object" || test "$pic_object" = none ; then
1386 arg="$non_pic_object"
1389 else
1390 # Only an error if not doing a dry-run.
1391 if test -z "$run"; then
1392 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1393 exit 1
1394 else
1395 # Dry-run case.
1397 # Extract subdirectory from the argument.
1398 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1399 if test "X$xdir" = "X$arg"; then
1400 xdir=
1401 else
1402 xdir="$xdir/"
1405 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1406 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1407 libobjs="$libobjs $pic_object"
1408 non_pic_objects="$non_pic_objects $non_pic_object"
1411 done
1412 else
1413 $echo "$modename: link input file \`$save_arg' does not exist"
1414 exit 1
1416 arg=$save_arg
1417 prev=
1418 continue
1420 rpath | xrpath)
1421 # We need an absolute path.
1422 case $arg in
1423 [\\/]* | [A-Za-z]:[\\/]*) ;;
1425 $echo "$modename: only absolute run-paths are allowed" 1>&2
1426 exit 1
1428 esac
1429 if test "$prev" = rpath; then
1430 case "$rpath " in
1431 *" $arg "*) ;;
1432 *) rpath="$rpath $arg" ;;
1433 esac
1434 else
1435 case "$xrpath " in
1436 *" $arg "*) ;;
1437 *) xrpath="$xrpath $arg" ;;
1438 esac
1440 prev=
1441 continue
1443 xcompiler)
1444 compiler_flags="$compiler_flags $qarg"
1445 prev=
1446 compile_command="$compile_command $qarg"
1447 finalize_command="$finalize_command $qarg"
1448 continue
1450 xlinker)
1451 linker_flags="$linker_flags $qarg"
1452 compiler_flags="$compiler_flags $wl$qarg"
1453 prev=
1454 compile_command="$compile_command $wl$qarg"
1455 finalize_command="$finalize_command $wl$qarg"
1456 continue
1458 xcclinker)
1459 linker_flags="$linker_flags $qarg"
1460 compiler_flags="$compiler_flags $qarg"
1461 prev=
1462 compile_command="$compile_command $qarg"
1463 finalize_command="$finalize_command $qarg"
1464 continue
1467 eval "$prev=\"\$arg\""
1468 prev=
1469 continue
1471 esac
1472 fi # test -n "$prev"
1474 prevarg="$arg"
1476 case $arg in
1477 -all-static)
1478 if test -n "$link_static_flag"; then
1479 compile_command="$compile_command $link_static_flag"
1480 finalize_command="$finalize_command $link_static_flag"
1482 continue
1485 -allow-undefined)
1486 # FIXME: remove this flag sometime in the future.
1487 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1488 continue
1491 -avoid-version)
1492 avoid_version=yes
1493 continue
1496 -dlopen)
1497 prev=dlfiles
1498 continue
1501 -dlpreopen)
1502 prev=dlprefiles
1503 continue
1506 -export-dynamic)
1507 export_dynamic=yes
1508 continue
1511 -export-symbols | -export-symbols-regex)
1512 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1513 $echo "$modename: more than one -exported-symbols argument is not allowed"
1514 exit 1
1516 if test "X$arg" = "X-export-symbols"; then
1517 prev=expsyms
1518 else
1519 prev=expsyms_regex
1521 continue
1524 -inst-prefix-dir)
1525 prev=inst_prefix
1526 continue
1529 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1530 # so, if we see these flags be careful not to treat them like -L
1531 -L[A-Z][A-Z]*:*)
1532 case $with_gcc/$host in
1533 no/*-*-irix* | /*-*-irix*)
1534 compile_command="$compile_command $arg"
1535 finalize_command="$finalize_command $arg"
1537 esac
1538 continue
1541 -L*)
1542 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1543 # We need an absolute path.
1544 case $dir in
1545 [\\/]* | [A-Za-z]:[\\/]*) ;;
1547 absdir=`cd "$dir" && pwd`
1548 if test -z "$absdir"; then
1549 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1550 exit 1
1552 dir="$absdir"
1554 esac
1555 case "$deplibs " in
1556 *" -L$dir "*) ;;
1558 deplibs="$deplibs -L$dir"
1559 lib_search_path="$lib_search_path $dir"
1561 esac
1562 case $host in
1563 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1564 case :$dllsearchpath: in
1565 *":$dir:"*) ;;
1566 *) dllsearchpath="$dllsearchpath:$dir";;
1567 esac
1569 esac
1570 continue
1573 -l*)
1574 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1575 case $host in
1576 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1577 # These systems don't actually have a C or math library (as such)
1578 continue
1580 *-*-mingw* | *-*-os2*)
1581 # These systems don't actually have a C library (as such)
1582 test "X$arg" = "X-lc" && continue
1584 *-*-openbsd* | *-*-freebsd*)
1585 # Do not include libc due to us having libc/libc_r.
1586 test "X$arg" = "X-lc" && continue
1588 *-*-rhapsody* | *-*-darwin1.[012])
1589 # Rhapsody C and math libraries are in the System framework
1590 deplibs="$deplibs -framework System"
1591 continue
1592 esac
1593 elif test "X$arg" = "X-lc_r"; then
1594 case $host in
1595 *-*-openbsd* | *-*-freebsd*)
1596 # Do not include libc_r directly, use -pthread flag.
1597 continue
1599 esac
1601 deplibs="$deplibs $arg"
1602 continue
1605 -module)
1606 module=yes
1607 continue
1610 # gcc -m* arguments should be passed to the linker via $compiler_flags
1611 # in order to pass architecture information to the linker
1612 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1613 # but this is not reliable with gcc because gcc may use -mfoo to
1614 # select a different linker, different libraries, etc, while
1615 # -Wl,-mfoo simply passes -mfoo to the linker.
1616 -m*)
1617 # Unknown arguments in both finalize_command and compile_command need
1618 # to be aesthetically quoted because they are evaled later.
1619 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1620 case $arg in
1621 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1622 arg="\"$arg\""
1624 esac
1625 compile_command="$compile_command $arg"
1626 finalize_command="$finalize_command $arg"
1627 if test "$with_gcc" = "yes" ; then
1628 compiler_flags="$compiler_flags $arg"
1630 continue
1633 -no-fast-install)
1634 fast_install=no
1635 continue
1638 -no-install)
1639 case $host in
1640 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1641 # The PATH hackery in wrapper scripts is required on Windows
1642 # in order for the loader to find any dlls it needs.
1643 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1644 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1645 fast_install=no
1647 *) no_install=yes ;;
1648 esac
1649 continue
1652 -no-undefined)
1653 allow_undefined=no
1654 continue
1657 -objectlist)
1658 prev=objectlist
1659 continue
1662 -o) prev=output ;;
1664 -release)
1665 prev=release
1666 continue
1669 -rpath)
1670 prev=rpath
1671 continue
1675 prev=xrpath
1676 continue
1679 -R*)
1680 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1681 # We need an absolute path.
1682 case $dir in
1683 [\\/]* | [A-Za-z]:[\\/]*) ;;
1685 $echo "$modename: only absolute run-paths are allowed" 1>&2
1686 exit 1
1688 esac
1689 case "$xrpath " in
1690 *" $dir "*) ;;
1691 *) xrpath="$xrpath $dir" ;;
1692 esac
1693 continue
1696 -static)
1697 # The effects of -static are defined in a previous loop.
1698 # We used to do the same as -all-static on platforms that
1699 # didn't have a PIC flag, but the assumption that the effects
1700 # would be equivalent was wrong. It would break on at least
1701 # Digital Unix and AIX.
1702 continue
1705 -thread-safe)
1706 thread_safe=yes
1707 continue
1710 -version-info)
1711 prev=vinfo
1712 continue
1715 -Wc,*)
1716 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1717 arg=
1718 save_ifs="$IFS"; IFS=','
1719 for flag in $args; do
1720 IFS="$save_ifs"
1721 case $flag in
1722 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1723 flag="\"$flag\""
1725 esac
1726 arg="$arg $wl$flag"
1727 compiler_flags="$compiler_flags $flag"
1728 done
1729 IFS="$save_ifs"
1730 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1733 -Wl,*)
1734 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1735 arg=
1736 save_ifs="$IFS"; IFS=','
1737 for flag in $args; do
1738 IFS="$save_ifs"
1739 case $flag in
1740 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1741 flag="\"$flag\""
1743 esac
1744 arg="$arg $wl$flag"
1745 compiler_flags="$compiler_flags $wl$flag"
1746 linker_flags="$linker_flags $flag"
1747 done
1748 IFS="$save_ifs"
1749 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1752 -Xcompiler)
1753 prev=xcompiler
1754 continue
1757 -Xlinker)
1758 prev=xlinker
1759 continue
1762 -XCClinker)
1763 prev=xcclinker
1764 continue
1767 # Some other compiler flag.
1768 -* | +*)
1769 # Unknown arguments in both finalize_command and compile_command need
1770 # to be aesthetically quoted because they are evaled later.
1771 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1772 case $arg in
1773 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1774 arg="\"$arg\""
1776 esac
1779 *.$objext)
1780 # A standard object.
1781 objs="$objs $arg"
1784 *.lo)
1785 # A libtool-controlled object.
1787 # Check to see that this really is a libtool object.
1788 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1789 pic_object=
1790 non_pic_object=
1792 # Read the .lo file
1793 # If there is no directory component, then add one.
1794 case $arg in
1795 */* | *\\*) . $arg ;;
1796 *) . ./$arg ;;
1797 esac
1799 if test -z "$pic_object" || \
1800 test -z "$non_pic_object" ||
1801 test "$pic_object" = none && \
1802 test "$non_pic_object" = none; then
1803 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1804 exit 1
1807 # Extract subdirectory from the argument.
1808 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1809 if test "X$xdir" = "X$arg"; then
1810 xdir=
1811 else
1812 xdir="$xdir/"
1815 if test "$pic_object" != none; then
1816 # Prepend the subdirectory the object is found in.
1817 pic_object="$xdir$pic_object"
1819 if test "$prev" = dlfiles; then
1820 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1821 dlfiles="$dlfiles $pic_object"
1822 prev=
1823 continue
1824 else
1825 # If libtool objects are unsupported, then we need to preload.
1826 prev=dlprefiles
1830 # CHECK ME: I think I busted this. -Ossama
1831 if test "$prev" = dlprefiles; then
1832 # Preload the old-style object.
1833 dlprefiles="$dlprefiles $pic_object"
1834 prev=
1837 # A PIC object.
1838 libobjs="$libobjs $pic_object"
1839 arg="$pic_object"
1842 # Non-PIC object.
1843 if test "$non_pic_object" != none; then
1844 # Prepend the subdirectory the object is found in.
1845 non_pic_object="$xdir$non_pic_object"
1847 # A standard non-PIC object
1848 non_pic_objects="$non_pic_objects $non_pic_object"
1849 if test -z "$pic_object" || test "$pic_object" = none ; then
1850 arg="$non_pic_object"
1853 else
1854 # Only an error if not doing a dry-run.
1855 if test -z "$run"; then
1856 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1857 exit 1
1858 else
1859 # Dry-run case.
1861 # Extract subdirectory from the argument.
1862 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1863 if test "X$xdir" = "X$arg"; then
1864 xdir=
1865 else
1866 xdir="$xdir/"
1869 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1870 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1871 libobjs="$libobjs $pic_object"
1872 non_pic_objects="$non_pic_objects $non_pic_object"
1877 *.$libext)
1878 # An archive.
1879 deplibs="$deplibs $arg"
1880 old_deplibs="$old_deplibs $arg"
1881 continue
1884 *.la)
1885 # A libtool-controlled library.
1887 if test "$prev" = dlfiles; then
1888 # This library was specified with -dlopen.
1889 dlfiles="$dlfiles $arg"
1890 prev=
1891 elif test "$prev" = dlprefiles; then
1892 # The library was specified with -dlpreopen.
1893 dlprefiles="$dlprefiles $arg"
1894 prev=
1895 else
1896 deplibs="$deplibs $arg"
1898 continue
1901 # Some other compiler argument.
1903 # Unknown arguments in both finalize_command and compile_command need
1904 # to be aesthetically quoted because they are evaled later.
1905 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1906 case $arg in
1907 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1908 arg="\"$arg\""
1910 esac
1912 esac # arg
1914 # Now actually substitute the argument into the commands.
1915 if test -n "$arg"; then
1916 compile_command="$compile_command $arg"
1917 finalize_command="$finalize_command $arg"
1919 done # argument parsing loop
1921 if test -n "$prev"; then
1922 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1923 $echo "$help" 1>&2
1924 exit 1
1927 # Infer tagged configuration to use if any are available and
1928 # if one wasn't chosen via the "--tag" command line option.
1929 # Only attempt this if the compiler in the base link
1930 # command doesn't match the default compiler.
1931 if test -n "$available_tags" && test -z "$tagname"; then
1932 case $base_compile in
1933 # Blanks in the command may have been stripped by the calling shell,
1934 # but not from the CC environment variable when configure was run.
1935 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
1936 # Blanks at the start of $base_compile will cause this to fail
1937 # if we don't check for them as well.
1939 for z in $available_tags; do
1940 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
1941 # Evaluate the configuration.
1942 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
1943 case $base_compile in
1944 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
1945 # The compiler in $compile_command matches
1946 # the one in the tagged configuration.
1947 # Assume this is the tagged configuration we want.
1948 tagname=$z
1949 break
1951 esac
1953 done
1954 # If $tagname still isn't set, then no tagged configuration
1955 # was found and let the user know that the "--tag" command
1956 # line option must be used.
1957 if test -z "$tagname"; then
1958 echo "$modename: unable to infer tagged configuration"
1959 echo "$modename: specify a tag with \`--tag'" 1>&2
1960 exit 1
1961 # else
1962 # echo "$modename: using $tagname tagged configuration"
1965 esac
1968 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1969 eval arg=\"$export_dynamic_flag_spec\"
1970 compile_command="$compile_command $arg"
1971 finalize_command="$finalize_command $arg"
1974 oldlibs=
1975 # calculate the name of the file, without its directory
1976 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1977 libobjs_save="$libobjs"
1979 if test -n "$shlibpath_var"; then
1980 # get the directories listed in $shlibpath_var
1981 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1982 else
1983 shlib_search_path=
1985 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1986 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1988 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1989 if test "X$output_objdir" = "X$output"; then
1990 output_objdir="$objdir"
1991 else
1992 output_objdir="$output_objdir/$objdir"
1994 # Create the object directory.
1995 if test ! -d "$output_objdir"; then
1996 $show "$mkdir $output_objdir"
1997 $run $mkdir $output_objdir
1998 status=$?
1999 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
2000 exit $status
2004 # Determine the type of output
2005 case $output in
2007 $echo "$modename: you must specify an output file" 1>&2
2008 $echo "$help" 1>&2
2009 exit 1
2011 *.$libext) linkmode=oldlib ;;
2012 *.lo | *.$objext) linkmode=obj ;;
2013 *.la) linkmode=lib ;;
2014 *) linkmode=prog ;; # Anything else should be a program.
2015 esac
2017 case $host in
2018 *cygwin* | *mingw* | *pw32*)
2019 # don't eliminate duplcations in $postdeps and $predeps
2020 duplicate_compiler_generated_deps=yes
2023 duplicate_compiler_generated_deps=$duplicate_deps
2025 esac
2026 specialdeplibs=
2028 libs=
2029 # Find all interdependent deplibs by searching for libraries
2030 # that are linked more than once (e.g. -la -lb -la)
2031 for deplib in $deplibs; do
2032 if test "X$duplicate_deps" = "Xyes" ; then
2033 case "$libs " in
2034 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2035 esac
2037 libs="$libs $deplib"
2038 done
2040 if test "$linkmode" = lib; then
2041 libs="$predeps $libs $compiler_lib_search_path $postdeps"
2043 # Compute libraries that are listed more than once in $predeps
2044 # $postdeps and mark them as special (i.e., whose duplicates are
2045 # not to be eliminated).
2046 pre_post_deps=
2047 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2048 for pre_post_dep in $predeps $postdeps; do
2049 case "$pre_post_deps " in
2050 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
2051 esac
2052 pre_post_deps="$pre_post_deps $pre_post_dep"
2053 done
2055 pre_post_deps=
2058 deplibs=
2059 newdependency_libs=
2060 newlib_search_path=
2061 need_relink=no # whether we're linking any uninstalled libtool libraries
2062 notinst_deplibs= # not-installed libtool libraries
2063 notinst_path= # paths that contain not-installed libtool libraries
2064 case $linkmode in
2065 lib)
2066 passes="conv link"
2067 for file in $dlfiles $dlprefiles; do
2068 case $file in
2069 *.la) ;;
2071 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2072 exit 1
2074 esac
2075 done
2077 prog)
2078 compile_deplibs=
2079 finalize_deplibs=
2080 alldeplibs=no
2081 newdlfiles=
2082 newdlprefiles=
2083 passes="conv scan dlopen dlpreopen link"
2085 *) passes="conv"
2087 esac
2088 for pass in $passes; do
2089 if test "$linkmode,$pass" = "lib,link" ||
2090 test "$linkmode,$pass" = "prog,scan"; then
2091 libs="$deplibs"
2092 deplibs=
2094 if test "$linkmode" = prog; then
2095 case $pass in
2096 dlopen) libs="$dlfiles" ;;
2097 dlpreopen) libs="$dlprefiles" ;;
2098 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2099 esac
2101 if test "$pass" = dlopen; then
2102 # Collect dlpreopened libraries
2103 save_deplibs="$deplibs"
2104 deplibs=
2106 for deplib in $libs; do
2107 lib=
2108 found=no
2109 case $deplib in
2110 -l*)
2111 if test "$linkmode" != lib && test "$linkmode" != prog; then
2112 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2113 continue
2115 if test "$pass" = conv; then
2116 deplibs="$deplib $deplibs"
2117 continue
2119 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2120 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2121 # Search the libtool library
2122 lib="$searchdir/lib${name}.la"
2123 if test -f "$lib"; then
2124 found=yes
2125 break
2127 done
2128 if test "$found" != yes; then
2129 # deplib doesn't seem to be a libtool library
2130 if test "$linkmode,$pass" = "prog,link"; then
2131 compile_deplibs="$deplib $compile_deplibs"
2132 finalize_deplibs="$deplib $finalize_deplibs"
2133 else
2134 deplibs="$deplib $deplibs"
2135 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2137 continue
2138 else # deplib is a libtool library
2139 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2140 # We need to do some special things here, and not later.
2141 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2142 case " $predeps $postdeps " in
2143 *" $deplib "*)
2144 if (${SED} -e '2q' $lib |
2145 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2146 library_names=
2147 old_library=
2148 case $lib in
2149 */* | *\\*) . $lib ;;
2150 *) . ./$lib ;;
2151 esac
2152 for l in $old_library $library_names; do
2153 ll="$l"
2154 done
2155 if test "X$ll" = "X$old_library" ; then # only static version available
2156 found=no
2157 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2158 test "X$ladir" = "X$lib" && ladir="."
2159 lib=$ladir/$old_library
2160 if test "$linkmode,$pass" = "prog,link"; then
2161 compile_deplibs="$deplib $compile_deplibs"
2162 finalize_deplibs="$deplib $finalize_deplibs"
2163 else
2164 deplibs="$deplib $deplibs"
2165 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2167 continue
2171 *) ;;
2172 esac
2175 ;; # -l
2176 -L*)
2177 case $linkmode in
2178 lib)
2179 deplibs="$deplib $deplibs"
2180 test "$pass" = conv && continue
2181 newdependency_libs="$deplib $newdependency_libs"
2182 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2184 prog)
2185 if test "$pass" = conv; then
2186 deplibs="$deplib $deplibs"
2187 continue
2189 if test "$pass" = scan; then
2190 deplibs="$deplib $deplibs"
2191 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2192 else
2193 compile_deplibs="$deplib $compile_deplibs"
2194 finalize_deplibs="$deplib $finalize_deplibs"
2198 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2200 esac # linkmode
2201 continue
2202 ;; # -L
2203 -R*)
2204 if test "$pass" = link; then
2205 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2206 # Make sure the xrpath contains only unique directories.
2207 case "$xrpath " in
2208 *" $dir "*) ;;
2209 *) xrpath="$xrpath $dir" ;;
2210 esac
2212 deplibs="$deplib $deplibs"
2213 continue
2215 *.la) lib="$deplib" ;;
2216 *.$libext)
2217 if test "$pass" = conv; then
2218 deplibs="$deplib $deplibs"
2219 continue
2221 case $linkmode in
2222 lib)
2223 if test "$deplibs_check_method" != pass_all; then
2224 echo
2225 echo "*** Warning: Trying to link with static lib archive $deplib."
2226 echo "*** I have the capability to make that library automatically link in when"
2227 echo "*** you link to this library. But I can only do this if you have a"
2228 echo "*** shared version of the library, which you do not appear to have"
2229 echo "*** because the file extensions .$libext of this argument makes me believe"
2230 echo "*** that it is just a static archive that I should not used here."
2231 else
2232 echo
2233 echo "*** Warning: Linking the shared library $output against the"
2234 echo "*** static library $deplib is not portable!"
2235 deplibs="$deplib $deplibs"
2237 continue
2239 prog)
2240 if test "$pass" != link; then
2241 deplibs="$deplib $deplibs"
2242 else
2243 compile_deplibs="$deplib $compile_deplibs"
2244 finalize_deplibs="$deplib $finalize_deplibs"
2246 continue
2248 esac # linkmode
2249 ;; # *.$libext
2250 *.lo | *.$objext)
2251 if test "$pass" = conv; then
2252 deplibs="$deplib $deplibs"
2253 elif test "$linkmode" = prog; then
2254 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2255 # If there is no dlopen support or we're linking statically,
2256 # we need to preload.
2257 newdlprefiles="$newdlprefiles $deplib"
2258 compile_deplibs="$deplib $compile_deplibs"
2259 finalize_deplibs="$deplib $finalize_deplibs"
2260 else
2261 newdlfiles="$newdlfiles $deplib"
2264 continue
2266 %DEPLIBS%)
2267 alldeplibs=yes
2268 continue
2270 esac # case $deplib
2271 if test "$found" = yes || test -f "$lib"; then :
2272 else
2273 $echo "$modename: cannot find the library \`$lib'" 1>&2
2274 exit 1
2277 # Check to see that this really is a libtool archive.
2278 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2279 else
2280 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2281 exit 1
2284 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2285 test "X$ladir" = "X$lib" && ladir="."
2287 dlname=
2288 dlopen=
2289 dlpreopen=
2290 libdir=
2291 library_names=
2292 old_library=
2293 # If the library was installed with an old release of libtool,
2294 # it will not redefine variable installed.
2295 installed=yes
2297 # Read the .la file
2298 case $lib in
2299 */* | *\\*) . $lib ;;
2300 *) . ./$lib ;;
2301 esac
2303 if test "$linkmode,$pass" = "lib,link" ||
2304 test "$linkmode,$pass" = "prog,scan" ||
2305 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2306 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2307 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2310 if test "$pass" = conv; then
2311 # Only check for convenience libraries
2312 deplibs="$lib $deplibs"
2313 if test -z "$libdir"; then
2314 if test -z "$old_library"; then
2315 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2316 exit 1
2318 # It is a libtool convenience library, so add in its objects.
2319 convenience="$convenience $ladir/$objdir/$old_library"
2320 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2321 tmp_libs=
2322 for deplib in $dependency_libs; do
2323 deplibs="$deplib $deplibs"
2324 if test "X$duplicate_deps" = "Xyes" ; then
2325 case "$tmp_libs " in
2326 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2327 esac
2329 tmp_libs="$tmp_libs $deplib"
2330 done
2331 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2332 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2333 exit 1
2335 continue
2336 fi # $pass = conv
2338 # Get the name of the library we link against.
2339 linklib=
2340 for l in $old_library $library_names; do
2341 linklib="$l"
2342 done
2343 if test -z "$linklib"; then
2344 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2345 exit 1
2348 # This library was specified with -dlopen.
2349 if test "$pass" = dlopen; then
2350 if test -z "$libdir"; then
2351 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2352 exit 1
2354 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2355 # If there is no dlname, no dlopen support or we're linking
2356 # statically, we need to preload. We also need to preload any
2357 # dependent libraries so libltdl's deplib preloader doesn't
2358 # bomb out in the load deplibs phase.
2359 dlprefiles="$dlprefiles $lib $dependency_libs"
2360 else
2361 newdlfiles="$newdlfiles $lib"
2363 continue
2364 fi # $pass = dlopen
2366 # We need an absolute path.
2367 case $ladir in
2368 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2370 abs_ladir=`cd "$ladir" && pwd`
2371 if test -z "$abs_ladir"; then
2372 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2373 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2374 abs_ladir="$ladir"
2377 esac
2378 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2380 # Find the relevant object directory and library name.
2381 if test "X$installed" = Xyes; then
2382 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2383 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2384 dir="$ladir"
2385 absdir="$abs_ladir"
2386 libdir="$abs_ladir"
2387 else
2388 dir="$libdir"
2389 absdir="$libdir"
2391 else
2392 dir="$ladir/$objdir"
2393 absdir="$abs_ladir/$objdir"
2394 # Remove this search path later
2395 notinst_path="$notinst_path $abs_ladir"
2396 fi # $installed = yes
2397 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2399 # This library was specified with -dlpreopen.
2400 if test "$pass" = dlpreopen; then
2401 if test -z "$libdir"; then
2402 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2403 exit 1
2405 # Prefer using a static library (so that no silly _DYNAMIC symbols
2406 # are required to link).
2407 if test -n "$old_library"; then
2408 newdlprefiles="$newdlprefiles $dir/$old_library"
2409 # Otherwise, use the dlname, so that lt_dlopen finds it.
2410 elif test -n "$dlname"; then
2411 newdlprefiles="$newdlprefiles $dir/$dlname"
2412 else
2413 newdlprefiles="$newdlprefiles $dir/$linklib"
2415 fi # $pass = dlpreopen
2417 if test -z "$libdir"; then
2418 # Link the convenience library
2419 if test "$linkmode" = lib; then
2420 deplibs="$dir/$old_library $deplibs"
2421 elif test "$linkmode,$pass" = "prog,link"; then
2422 compile_deplibs="$dir/$old_library $compile_deplibs"
2423 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2424 else
2425 deplibs="$lib $deplibs" # used for prog,scan pass
2427 continue
2430 if test "$linkmode" = prog && test "$pass" != link; then
2431 newlib_search_path="$newlib_search_path $ladir"
2432 deplibs="$lib $deplibs"
2434 linkalldeplibs=no
2435 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2436 test "$build_libtool_libs" = no; then
2437 linkalldeplibs=yes
2440 tmp_libs=
2441 for deplib in $dependency_libs; do
2442 case $deplib in
2443 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2444 esac
2445 # Need to link against all dependency_libs?
2446 if test "$linkalldeplibs" = yes; then
2447 deplibs="$deplib $deplibs"
2448 else
2449 # Need to hardcode shared library paths
2450 # or/and link against static libraries
2451 newdependency_libs="$deplib $newdependency_libs"
2453 if test "X$duplicate_deps" = "Xyes" ; then
2454 case "$tmp_libs " in
2455 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2456 esac
2458 tmp_libs="$tmp_libs $deplib"
2459 done # for deplib
2460 continue
2461 fi # $linkmode = prog...
2463 if test "$linkmode,$pass" = "prog,link"; then
2464 if test -n "$library_names" &&
2465 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2466 # We need to hardcode the library path
2467 if test -n "$shlibpath_var"; then
2468 # Make sure the rpath contains only unique directories.
2469 case "$temp_rpath " in
2470 *" $dir "*) ;;
2471 *" $absdir "*) ;;
2472 *) temp_rpath="$temp_rpath $dir" ;;
2473 esac
2476 # Hardcode the library path.
2477 # Skip directories that are in the system default run-time
2478 # search path.
2479 case " $sys_lib_dlsearch_path " in
2480 *" $absdir "*) ;;
2482 case "$compile_rpath " in
2483 *" $absdir "*) ;;
2484 *) compile_rpath="$compile_rpath $absdir"
2485 esac
2487 esac
2488 case " $sys_lib_dlsearch_path " in
2489 *" $libdir "*) ;;
2491 case "$finalize_rpath " in
2492 *" $libdir "*) ;;
2493 *) finalize_rpath="$finalize_rpath $libdir"
2494 esac
2496 esac
2497 fi # $linkmode,$pass = prog,link...
2499 if test "$alldeplibs" = yes &&
2500 { test "$deplibs_check_method" = pass_all ||
2501 { test "$build_libtool_libs" = yes &&
2502 test -n "$library_names"; }; }; then
2503 # We only need to search for static libraries
2504 continue
2508 link_static=no # Whether the deplib will be linked statically
2509 if test -n "$library_names" &&
2510 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2511 if test "$installed" = no; then
2512 notinst_deplibs="$notinst_deplibs $lib"
2513 need_relink=yes
2515 # This is a shared library
2516 if test "$linkmode" = lib &&
2517 test "$hardcode_into_libs" = yes; then
2518 # Hardcode the library path.
2519 # Skip directories that are in the system default run-time
2520 # search path.
2521 case " $sys_lib_dlsearch_path " in
2522 *" $absdir "*) ;;
2524 case "$compile_rpath " in
2525 *" $absdir "*) ;;
2526 *) compile_rpath="$compile_rpath $absdir"
2527 esac
2529 esac
2530 case " $sys_lib_dlsearch_path " in
2531 *" $libdir "*) ;;
2533 case "$finalize_rpath " in
2534 *" $libdir "*) ;;
2535 *) finalize_rpath="$finalize_rpath $libdir"
2536 esac
2538 esac
2541 if test -n "$old_archive_from_expsyms_cmds"; then
2542 # figure out the soname
2543 set dummy $library_names
2544 realname="$2"
2545 shift; shift
2546 libname=`eval \\$echo \"$libname_spec\"`
2547 # use dlname if we got it. it's perfectly good, no?
2548 if test -n "$dlname"; then
2549 soname="$dlname"
2550 elif test -n "$soname_spec"; then
2551 # bleh windows
2552 case $host in
2553 *cygwin* | mingw*)
2554 major=`expr $current - $age`
2555 versuffix="-$major"
2557 esac
2558 eval soname=\"$soname_spec\"
2559 else
2560 soname="$realname"
2563 # Make a new name for the extract_expsyms_cmds to use
2564 soroot="$soname"
2565 soname=`echo $soroot | ${SED} -e 's/^.*\///'`
2566 newlib="libimp-`echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2568 # If the library has no export list, then create one now
2569 if test -f "$output_objdir/$soname-def"; then :
2570 else
2571 $show "extracting exported symbol list from \`$soname'"
2572 save_ifs="$IFS"; IFS='~'
2573 eval cmds=\"$extract_expsyms_cmds\"
2574 for cmd in $cmds; do
2575 IFS="$save_ifs"
2576 $show "$cmd"
2577 $run eval "$cmd" || exit $?
2578 done
2579 IFS="$save_ifs"
2582 # Create $newlib
2583 if test -f "$output_objdir/$newlib"; then :; else
2584 $show "generating import library for \`$soname'"
2585 save_ifs="$IFS"; IFS='~'
2586 eval cmds=\"$old_archive_from_expsyms_cmds\"
2587 for cmd in $cmds; do
2588 IFS="$save_ifs"
2589 $show "$cmd"
2590 $run eval "$cmd" || exit $?
2591 done
2592 IFS="$save_ifs"
2594 # make sure the library variables are pointing to the new library
2595 dir=$output_objdir
2596 linklib=$newlib
2597 fi # test -n "$old_archive_from_expsyms_cmds"
2599 if test "$linkmode" = prog || test "$mode" != relink; then
2600 add_shlibpath=
2601 add_dir=
2602 add=
2603 lib_linked=yes
2604 case $hardcode_action in
2605 immediate | unsupported)
2606 if test "$hardcode_direct" = no; then
2607 case $host in
2608 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2609 esac
2610 add="$dir/$linklib"
2611 elif test "$hardcode_minus_L" = no; then
2612 case $host in
2613 *-*-sunos*) add_shlibpath="$dir" ;;
2614 esac
2615 add_dir="-L$dir"
2616 add="-l$name"
2617 elif test "$hardcode_shlibpath_var" = no; then
2618 add_shlibpath="$dir"
2619 add="-l$name"
2620 else
2621 lib_linked=no
2624 relink)
2625 if test "$hardcode_direct" = yes; then
2626 add="$dir/$linklib"
2627 elif test "$hardcode_minus_L" = yes; then
2628 add_dir="-L$dir"
2629 # Try looking first in the location we're being installed to.
2630 if test -n "$inst_prefix_dir"; then
2631 case "$libdir" in
2632 [\\/]*)
2633 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2635 esac
2637 add="-l$name"
2638 elif test "$hardcode_shlibpath_var" = yes; then
2639 add_shlibpath="$dir"
2640 add="-l$name"
2641 else
2642 lib_linked=no
2645 *) lib_linked=no ;;
2646 esac
2648 if test "$lib_linked" != yes; then
2649 $echo "$modename: configuration error: unsupported hardcode properties"
2650 exit 1
2653 if test -n "$add_shlibpath"; then
2654 case :$compile_shlibpath: in
2655 *":$add_shlibpath:"*) ;;
2656 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2657 esac
2659 if test "$linkmode" = prog; then
2660 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2661 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2662 else
2663 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2664 test -n "$add" && deplibs="$add $deplibs"
2665 if test "$hardcode_direct" != yes && \
2666 test "$hardcode_minus_L" != yes && \
2667 test "$hardcode_shlibpath_var" = yes; then
2668 case :$finalize_shlibpath: in
2669 *":$libdir:"*) ;;
2670 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2671 esac
2676 if test "$linkmode" = prog || test "$mode" = relink; then
2677 add_shlibpath=
2678 add_dir=
2679 add=
2680 # Finalize command for both is simple: just hardcode it.
2681 if test "$hardcode_direct" = yes; then
2682 add="$libdir/$linklib"
2683 elif test "$hardcode_minus_L" = yes; then
2684 add_dir="-L$libdir"
2685 add="-l$name"
2686 elif test "$hardcode_shlibpath_var" = yes; then
2687 case :$finalize_shlibpath: in
2688 *":$libdir:"*) ;;
2689 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2690 esac
2691 add="-l$name"
2692 else
2693 # We cannot seem to hardcode it, guess we'll fake it.
2694 add_dir="-L$libdir"
2695 # Try looking first in the location we're being installed to.
2696 if test -n "$inst_prefix_dir"; then
2697 case "$libdir" in
2698 [\\/]*)
2699 add_dir="-L$inst_prefix_dir$libdir $add_dir"
2701 esac
2703 add="-l$name"
2706 if test "$linkmode" = prog; then
2707 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2708 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2709 else
2710 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2711 test -n "$add" && deplibs="$add $deplibs"
2714 elif test "$linkmode" = prog; then
2715 # Here we assume that one of hardcode_direct or hardcode_minus_L
2716 # is not unsupported. This is valid on all known static and
2717 # shared platforms.
2718 if test "$hardcode_direct" != unsupported; then
2719 test -n "$old_library" && linklib="$old_library"
2720 compile_deplibs="$dir/$linklib $compile_deplibs"
2721 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2722 else
2723 compile_deplibs="-l$name -L$dir $compile_deplibs"
2724 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2726 elif test "$build_libtool_libs" = yes; then
2727 # Not a shared library
2728 if test "$deplibs_check_method" != pass_all; then
2729 # We're trying link a shared library against a static one
2730 # but the system doesn't support it.
2732 # Just print a warning and add the library to dependency_libs so
2733 # that the program can be linked against the static library.
2734 echo
2735 echo "*** Warning: This system can not link to static lib archive $lib."
2736 echo "*** I have the capability to make that library automatically link in when"
2737 echo "*** you link to this library. But I can only do this if you have a"
2738 echo "*** shared version of the library, which you do not appear to have."
2739 if test "$module" = yes; then
2740 echo "*** But as you try to build a module library, libtool will still create "
2741 echo "*** a static module, that should work as long as the dlopening application"
2742 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2743 if test -z "$global_symbol_pipe"; then
2744 echo
2745 echo "*** However, this would only work if libtool was able to extract symbol"
2746 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2747 echo "*** not find such a program. So, this module is probably useless."
2748 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2750 if test "$build_old_libs" = no; then
2751 build_libtool_libs=module
2752 build_old_libs=yes
2753 else
2754 build_libtool_libs=no
2757 else
2758 convenience="$convenience $dir/$old_library"
2759 old_convenience="$old_convenience $dir/$old_library"
2760 deplibs="$dir/$old_library $deplibs"
2761 link_static=yes
2763 fi # link shared/static library?
2765 if test "$linkmode" = lib; then
2766 if test -n "$dependency_libs" &&
2767 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2768 test "$link_static" = yes; }; then
2769 # Extract -R from dependency_libs
2770 temp_deplibs=
2771 for libdir in $dependency_libs; do
2772 case $libdir in
2773 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2774 case " $xrpath " in
2775 *" $temp_xrpath "*) ;;
2776 *) xrpath="$xrpath $temp_xrpath";;
2777 esac;;
2778 *) temp_deplibs="$temp_deplibs $libdir";;
2779 esac
2780 done
2781 dependency_libs="$temp_deplibs"
2784 newlib_search_path="$newlib_search_path $absdir"
2785 # Link against this library
2786 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2787 # ... and its dependency_libs
2788 tmp_libs=
2789 for deplib in $dependency_libs; do
2790 newdependency_libs="$deplib $newdependency_libs"
2791 if test "X$duplicate_deps" = "Xyes" ; then
2792 case "$tmp_libs " in
2793 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2794 esac
2796 tmp_libs="$tmp_libs $deplib"
2797 done
2799 if test "$link_all_deplibs" != no; then
2800 # Add the search paths of all dependency libraries
2801 for deplib in $dependency_libs; do
2802 case $deplib in
2803 -L*) path="$deplib" ;;
2804 *.la)
2805 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2806 test "X$dir" = "X$deplib" && dir="."
2807 # We need an absolute path.
2808 case $dir in
2809 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2811 absdir=`cd "$dir" && pwd`
2812 if test -z "$absdir"; then
2813 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2814 absdir="$dir"
2817 esac
2818 if grep "^installed=no" $deplib > /dev/null; then
2819 path="-L$absdir/$objdir"
2820 else
2821 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2822 if test -z "$libdir"; then
2823 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2824 exit 1
2826 if test "$absdir" != "$libdir"; then
2827 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2829 path="-L$absdir"
2832 *) continue ;;
2833 esac
2834 case " $deplibs " in
2835 *" $path "*) ;;
2836 *) deplibs="$deplibs $path" ;;
2837 esac
2838 done
2839 fi # link_all_deplibs != no
2840 fi # linkmode = lib
2841 done # for deplib in $libs
2842 dependency_libs="$newdependency_libs"
2843 if test "$pass" = dlpreopen; then
2844 # Link the dlpreopened libraries before other libraries
2845 for deplib in $save_deplibs; do
2846 deplibs="$deplib $deplibs"
2847 done
2849 if test "$pass" != dlopen; then
2850 if test "$pass" != conv; then
2851 # Make sure lib_search_path contains only unique directories.
2852 lib_search_path=
2853 for dir in $newlib_search_path; do
2854 case "$lib_search_path " in
2855 *" $dir "*) ;;
2856 *) lib_search_path="$lib_search_path $dir" ;;
2857 esac
2858 done
2859 newlib_search_path=
2862 if test "$linkmode,$pass" != "prog,link"; then
2863 vars="deplibs"
2864 else
2865 vars="compile_deplibs finalize_deplibs"
2867 for var in $vars dependency_libs; do
2868 # Add libraries to $var in reverse order
2869 eval tmp_libs=\"\$$var\"
2870 new_libs=
2871 for deplib in $tmp_libs; do
2872 # FIXME: Pedantically, this is the right thing to do, so
2873 # that some nasty dependency loop isn't accidentally
2874 # broken:
2875 #new_libs="$deplib $new_libs"
2876 # Pragmatically, this seems to cause very few problems in
2877 # practice:
2878 case $deplib in
2879 -L*) new_libs="$deplib $new_libs" ;;
2881 # And here is the reason: when a library appears more
2882 # than once as an explicit dependence of a library, or
2883 # is implicitly linked in more than once by the
2884 # compiler, it is considered special, and multiple
2885 # occurrences thereof are not removed. Compare this
2886 # with having the same library being listed as a
2887 # dependency of multiple other libraries: in this case,
2888 # we know (pedantically, we assume) the library does not
2889 # need to be listed more than once, so we keep only the
2890 # last copy. This is not always right, but it is rare
2891 # enough that we require users that really mean to play
2892 # such unportable linking tricks to link the library
2893 # using -Wl,-lname, so that libtool does not consider it
2894 # for duplicate removal.
2895 case " $specialdeplibs " in
2896 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2898 case " $new_libs " in
2899 *" $deplib "*) ;;
2900 *) new_libs="$deplib $new_libs" ;;
2901 esac
2903 esac
2905 esac
2906 done
2907 tmp_libs=
2908 for deplib in $new_libs; do
2909 case $deplib in
2910 -L*)
2911 case " $tmp_libs " in
2912 *" $deplib "*) ;;
2913 *) tmp_libs="$tmp_libs $deplib" ;;
2914 esac
2916 *) tmp_libs="$tmp_libs $deplib" ;;
2917 esac
2918 done
2919 eval $var=\"$tmp_libs\"
2920 done # for var
2922 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
2923 tmp_libs=
2924 for i in $dependency_libs ; do
2925 case " $predeps $postdeps $compiler_lib_search_path " in
2926 *" $i "*)
2927 i=""
2929 esac
2930 if test -n "$i" ; then
2931 tmp_libs="$tmp_libs $i"
2933 done
2934 dependency_libs=$tmp_libs
2935 done # for pass
2936 if test "$linkmode" = prog; then
2937 dlfiles="$newdlfiles"
2938 dlprefiles="$newdlprefiles"
2941 case $linkmode in
2942 oldlib)
2943 if test -n "$deplibs"; then
2944 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2947 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2948 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2951 if test -n "$rpath"; then
2952 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2955 if test -n "$xrpath"; then
2956 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2959 if test -n "$vinfo"; then
2960 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2963 if test -n "$release"; then
2964 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2967 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2968 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2971 # Now set the variables for building old libraries.
2972 build_libtool_libs=no
2973 oldlibs="$output"
2974 objs="$objs$old_deplibs"
2977 lib)
2978 # Make sure we only generate libraries of the form `libNAME.la'.
2979 case $outputname in
2980 lib*)
2981 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2982 eval libname=\"$libname_spec\"
2985 if test "$module" = no; then
2986 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2987 $echo "$help" 1>&2
2988 exit 1
2990 if test "$need_lib_prefix" != no; then
2991 # Add the "lib" prefix for modules if required
2992 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2993 eval libname=\"$libname_spec\"
2994 else
2995 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2998 esac
3000 if test -n "$objs"; then
3001 if test "$deplibs_check_method" != pass_all; then
3002 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3003 exit 1
3004 else
3005 echo
3006 echo "*** Warning: Linking the shared library $output against the non-libtool"
3007 echo "*** objects $objs is not portable!"
3008 libobjs="$libobjs $objs"
3012 if test "$dlself" != no; then
3013 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3016 set dummy $rpath
3017 if test "$#" -gt 2; then
3018 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3020 install_libdir="$2"
3022 oldlibs=
3023 if test -z "$rpath"; then
3024 if test "$build_libtool_libs" = yes; then
3025 # Building a libtool convenience library.
3026 # Some compilers have problems with a `.al' extension so
3027 # convenience libraries should have the same extension an
3028 # archive normally would.
3029 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3030 build_libtool_libs=convenience
3031 build_old_libs=yes
3034 if test -n "$vinfo"; then
3035 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
3038 if test -n "$release"; then
3039 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3041 else
3043 # Parse the version information argument.
3044 save_ifs="$IFS"; IFS=':'
3045 set dummy $vinfo 0 0 0
3046 IFS="$save_ifs"
3048 if test -n "$8"; then
3049 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3050 $echo "$help" 1>&2
3051 exit 1
3054 current="$2"
3055 revision="$3"
3056 age="$4"
3058 # Check that each of the things are valid numbers.
3059 case $current in
3060 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3062 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3063 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3064 exit 1
3066 esac
3068 case $revision in
3069 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3071 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3072 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3073 exit 1
3075 esac
3077 case $age in
3078 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3080 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3081 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3082 exit 1
3084 esac
3086 if test "$age" -gt "$current"; then
3087 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3088 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3089 exit 1
3092 # Calculate the version variables.
3093 major=
3094 versuffix=
3095 verstring=
3096 case $version_type in
3097 none) ;;
3099 darwin)
3100 # Like Linux, but with the current version available in
3101 # verstring for coding it into the library header
3102 major=.`expr $current - $age`
3103 versuffix="$major.$age.$revision"
3104 # Darwin ld doesn't like 0 for these options...
3105 minor_current=`expr $current + 1`
3106 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3109 freebsd-aout)
3110 major=".$current"
3111 versuffix=".$current.$revision";
3114 freebsd-elf)
3115 major=".$current"
3116 versuffix=".$current";
3119 irix | nonstopux)
3120 major=`expr $current - $age`
3122 case $version_type in
3123 nonstopux) verstring_prefix=nonstopux ;;
3124 *) verstring_prefix=sgi ;;
3125 esac
3126 verstring="$verstring_prefix$major.$revision"
3128 # Add in all the interfaces that we are compatible with.
3129 loop=$revision
3130 while test "$loop" -ne 0; do
3131 iface=`expr $revision - $loop`
3132 loop=`expr $loop - 1`
3133 verstring="$verstring_prefix$major.$iface:$verstring"
3134 done
3136 # Before this point, $major must not contain `.'.
3137 major=.$major
3138 versuffix="$major.$revision"
3141 linux)
3142 major=.`expr $current - $age`
3143 versuffix="$major.$age.$revision"
3146 osf)
3147 major=.`expr $current - $age`
3148 versuffix=".$current.$age.$revision"
3149 verstring="$current.$age.$revision"
3151 # Add in all the interfaces that we are compatible with.
3152 loop=$age
3153 while test "$loop" -ne 0; do
3154 iface=`expr $current - $loop`
3155 loop=`expr $loop - 1`
3156 verstring="$verstring:${iface}.0"
3157 done
3159 # Make executables depend on our current version.
3160 verstring="$verstring:${current}.0"
3163 sunos)
3164 major=".$current"
3165 versuffix=".$current.$revision"
3168 windows)
3169 # Use '-' rather than '.', since we only want one
3170 # extension on DOS 8.3 filesystems.
3171 major=`expr $current - $age`
3172 versuffix="-$major"
3176 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3177 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3178 exit 1
3180 esac
3182 # Clear the version info if we defaulted, and they specified a release.
3183 if test -z "$vinfo" && test -n "$release"; then
3184 major=
3185 case $version_type in
3186 darwin)
3187 # we can't check for "0.0" in archive_cmds due to quoting
3188 # problems, so we reset it completely
3189 verstring=
3192 verstring="0.0"
3194 esac
3195 if test "$need_version" = no; then
3196 versuffix=
3197 else
3198 versuffix=".0.0"
3202 # Remove version info from name if versioning should be avoided
3203 if test "$avoid_version" = yes && test "$need_version" = no; then
3204 major=
3205 versuffix=
3206 verstring=""
3209 # Check to see if the archive will have undefined symbols.
3210 if test "$allow_undefined" = yes; then
3211 if test "$allow_undefined_flag" = unsupported; then
3212 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3213 build_libtool_libs=no
3214 build_old_libs=yes
3216 else
3217 # Don't allow undefined symbols.
3218 allow_undefined_flag="$no_undefined_flag"
3222 if test "$mode" != relink; then
3223 # Remove our outputs, but don't remove object files since they
3224 # may have been created when compiling PIC objects.
3225 removelist=
3226 tempremovelist=`echo "$output_objdir/*"`
3227 for p in $tempremovelist; do
3228 case $p in
3229 *.$objext)
3231 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3232 removelist="$removelist $p"
3234 *) ;;
3235 esac
3236 done
3237 if test -n "$removelist"; then
3238 $show "${rm}r $removelist"
3239 $run ${rm}r $removelist
3243 # Now set the variables for building old libraries.
3244 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3245 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3247 # Transform .lo files to .o files.
3248 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3251 # Eliminate all temporary directories.
3252 for path in $notinst_path; do
3253 lib_search_path=`echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3254 deplibs=`echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3255 dependency_libs=`echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3256 done
3258 if test -n "$xrpath"; then
3259 # If the user specified any rpath flags, then add them.
3260 temp_xrpath=
3261 for libdir in $xrpath; do
3262 temp_xrpath="$temp_xrpath -R$libdir"
3263 case "$finalize_rpath " in
3264 *" $libdir "*) ;;
3265 *) finalize_rpath="$finalize_rpath $libdir" ;;
3266 esac
3267 done
3268 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3269 dependency_libs="$temp_xrpath $dependency_libs"
3273 # Make sure dlfiles contains only unique files that won't be dlpreopened
3274 old_dlfiles="$dlfiles"
3275 dlfiles=
3276 for lib in $old_dlfiles; do
3277 case " $dlprefiles $dlfiles " in
3278 *" $lib "*) ;;
3279 *) dlfiles="$dlfiles $lib" ;;
3280 esac
3281 done
3283 # Make sure dlprefiles contains only unique files
3284 old_dlprefiles="$dlprefiles"
3285 dlprefiles=
3286 for lib in $old_dlprefiles; do
3287 case "$dlprefiles " in
3288 *" $lib "*) ;;
3289 *) dlprefiles="$dlprefiles $lib" ;;
3290 esac
3291 done
3293 if test "$build_libtool_libs" = yes; then
3294 if test -n "$rpath"; then
3295 case $host in
3296 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3297 # these systems don't actually have a c library (as such)!
3299 *-*-rhapsody* | *-*-darwin1.[012])
3300 # Rhapsody C library is in the System framework
3301 deplibs="$deplibs -framework System"
3303 *-*-netbsd*)
3304 # Don't link with libc until the a.out ld.so is fixed.
3306 *-*-openbsd* | *-*-freebsd*)
3307 # Do not include libc due to us having libc/libc_r.
3308 test "X$arg" = "X-lc" && continue
3311 # Add libc to deplibs on all other systems if necessary.
3312 if test "$build_libtool_need_lc" = "yes"; then
3313 deplibs="$deplibs -lc"
3316 esac
3319 # Transform deplibs into only deplibs that can be linked in shared.
3320 name_save=$name
3321 libname_save=$libname
3322 release_save=$release
3323 versuffix_save=$versuffix
3324 major_save=$major
3325 # I'm not sure if I'm treating the release correctly. I think
3326 # release should show up in the -l (ie -lgmp5) so we don't want to
3327 # add it in twice. Is that correct?
3328 release=""
3329 versuffix=""
3330 major=""
3331 newdeplibs=
3332 droppeddeps=no
3333 case $deplibs_check_method in
3334 pass_all)
3335 # Don't check for shared/static. Everything works.
3336 # This might be a little naive. We might want to check
3337 # whether the library exists or not. But this is on
3338 # osf3 & osf4 and I'm not really sure... Just
3339 # implementing what was already the behavior.
3340 newdeplibs=$deplibs
3342 test_compile)
3343 # This code stresses the "libraries are programs" paradigm to its
3344 # limits. Maybe even breaks it. We compile a program, linking it
3345 # against the deplibs as a proxy for the library. Then we can check
3346 # whether they linked in statically or dynamically with ldd.
3347 $rm conftest.c
3348 cat > conftest.c <<EOF
3349 int main() { return 0; }
3351 $rm conftest
3352 $LTCC -o conftest conftest.c $deplibs
3353 if test "$?" -eq 0 ; then
3354 ldd_output=`ldd conftest`
3355 for i in $deplibs; do
3356 name="`expr $i : '-l\(.*\)'`"
3357 # If $name is empty we are operating on a -L argument.
3358 if test "$name" != "" && test "$name" -ne "0"; then
3359 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3360 case " $predeps $postdeps " in
3361 *" $i "*)
3362 newdeplibs="$newdeplibs $i"
3363 i=""
3365 esac
3367 if test -n "$i" ; then
3368 libname=`eval \\$echo \"$libname_spec\"`
3369 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3370 set dummy $deplib_matches
3371 deplib_match=$2
3372 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3373 newdeplibs="$newdeplibs $i"
3374 else
3375 droppeddeps=yes
3376 echo
3377 echo "*** Warning: dynamic linker does not accept needed library $i."
3378 echo "*** I have the capability to make that library automatically link in when"
3379 echo "*** you link to this library. But I can only do this if you have a"
3380 echo "*** shared version of the library, which I believe you do not have"
3381 echo "*** because a test_compile did reveal that the linker did not use it for"
3382 echo "*** its dynamic dependency list that programs get resolved with at runtime."
3385 else
3386 newdeplibs="$newdeplibs $i"
3388 done
3389 else
3390 # Error occurred in the first compile. Let's try to salvage
3391 # the situation: Compile a separate program for each library.
3392 for i in $deplibs; do
3393 name="`expr $i : '-l\(.*\)'`"
3394 # If $name is empty we are operating on a -L argument.
3395 if test "$name" != "" && test "$name" != "0"; then
3396 $rm conftest
3397 $LTCC -o conftest conftest.c $i
3398 # Did it work?
3399 if test "$?" -eq 0 ; then
3400 ldd_output=`ldd conftest`
3401 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3402 case " $predeps $postdeps " in
3403 *" $i "*)
3404 newdeplibs="$newdeplibs $i"
3405 i=""
3407 esac
3409 if test -n "$i" ; then
3410 libname=`eval \\$echo \"$libname_spec\"`
3411 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3412 set dummy $deplib_matches
3413 deplib_match=$2
3414 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3415 newdeplibs="$newdeplibs $i"
3416 else
3417 droppeddeps=yes
3418 echo
3419 echo "*** Warning: dynamic linker does not accept needed library $i."
3420 echo "*** I have the capability to make that library automatically link in when"
3421 echo "*** you link to this library. But I can only do this if you have a"
3422 echo "*** shared version of the library, which you do not appear to have"
3423 echo "*** because a test_compile did reveal that the linker did not use this one"
3424 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3427 else
3428 droppeddeps=yes
3429 echo
3430 echo "*** Warning! Library $i is needed by this library but I was not able to"
3431 echo "*** make it link in! You will probably need to install it or some"
3432 echo "*** library that it depends on before this library will be fully"
3433 echo "*** functional. Installing it before continuing would be even better."
3435 else
3436 newdeplibs="$newdeplibs $i"
3438 done
3441 file_magic*)
3442 set dummy $deplibs_check_method
3443 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3444 for a_deplib in $deplibs; do
3445 name="`expr $a_deplib : '-l\(.*\)'`"
3446 # If $name is empty we are operating on a -L argument.
3447 if test "$name" != "" && test "$name" != "0"; then
3448 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3449 case " $predeps $postdeps " in
3450 *" $a_deplib "*)
3451 newdeplibs="$newdeplibs $a_deplib"
3452 a_deplib=""
3454 esac
3456 if test -n "$a_deplib" ; then
3457 libname=`eval \\$echo \"$libname_spec\"`
3458 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3459 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3460 for potent_lib in $potential_libs; do
3461 # Follow soft links.
3462 if ls -lLd "$potent_lib" 2>/dev/null \
3463 | grep " -> " >/dev/null; then
3464 continue
3466 # The statement above tries to avoid entering an
3467 # endless loop below, in case of cyclic links.
3468 # We might still enter an endless loop, since a link
3469 # loop can be closed while we follow links,
3470 # but so what?
3471 potlib="$potent_lib"
3472 while test -h "$potlib" 2>/dev/null; do
3473 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3474 case $potliblink in
3475 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3476 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3477 esac
3478 done
3479 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3480 | ${SED} 10q \
3481 | $EGREP "$file_magic_regex" > /dev/null; then
3482 newdeplibs="$newdeplibs $a_deplib"
3483 a_deplib=""
3484 break 2
3486 done
3487 done
3489 if test -n "$a_deplib" ; then
3490 droppeddeps=yes
3491 echo
3492 echo "*** Warning: linker path does not have real file for library $a_deplib."
3493 echo "*** I have the capability to make that library automatically link in when"
3494 echo "*** you link to this library. But I can only do this if you have a"
3495 echo "*** shared version of the library, which you do not appear to have"
3496 echo "*** because I did check the linker path looking for a file starting"
3497 if test -z "$potlib" ; then
3498 echo "*** with $libname but no candidates were found. (...for file magic test)"
3499 else
3500 echo "*** with $libname and none of the candidates passed a file format test"
3501 echo "*** using a file magic. Last file checked: $potlib"
3504 else
3505 # Add a -L argument.
3506 newdeplibs="$newdeplibs $a_deplib"
3508 done # Gone through all deplibs.
3510 match_pattern*)
3511 set dummy $deplibs_check_method
3512 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3513 for a_deplib in $deplibs; do
3514 name="`expr $a_deplib : '-l\(.*\)'`"
3515 # If $name is empty we are operating on a -L argument.
3516 if test -n "$name" && test "$name" != "0"; then
3517 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3518 case " $predeps $postdeps " in
3519 *" $a_deplib "*)
3520 newdeplibs="$newdeplibs $a_deplib"
3521 a_deplib=""
3523 esac
3525 if test -n "$a_deplib" ; then
3526 libname=`eval \\$echo \"$libname_spec\"`
3527 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3528 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3529 for potent_lib in $potential_libs; do
3530 potlib="$potent_lib" # see symlink-check above in file_magic test
3531 if eval echo \"$potent_lib\" 2>/dev/null \
3532 | ${SED} 10q \
3533 | $EGREP "$match_pattern_regex" > /dev/null; then
3534 newdeplibs="$newdeplibs $a_deplib"
3535 a_deplib=""
3536 break 2
3538 done
3539 done
3541 if test -n "$a_deplib" ; then
3542 droppeddeps=yes
3543 echo
3544 echo "*** Warning: linker path does not have real file for library $a_deplib."
3545 echo "*** I have the capability to make that library automatically link in when"
3546 echo "*** you link to this library. But I can only do this if you have a"
3547 echo "*** shared version of the library, which you do not appear to have"
3548 echo "*** because I did check the linker path looking for a file starting"
3549 if test -z "$potlib" ; then
3550 echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3551 else
3552 echo "*** with $libname and none of the candidates passed a file format test"
3553 echo "*** using a regex pattern. Last file checked: $potlib"
3556 else
3557 # Add a -L argument.
3558 newdeplibs="$newdeplibs $a_deplib"
3560 done # Gone through all deplibs.
3562 none | unknown | *)
3563 newdeplibs=""
3564 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3565 -e 's/ -[LR][^ ]*//g'`
3566 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3567 for i in $predeps $postdeps ; do
3568 # can't use Xsed below, because $i might contain '/'
3569 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3570 done
3572 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3573 | grep . >/dev/null; then
3574 echo
3575 if test "X$deplibs_check_method" = "Xnone"; then
3576 echo "*** Warning: inter-library dependencies are not supported in this platform."
3577 else
3578 echo "*** Warning: inter-library dependencies are not known to be supported."
3580 echo "*** All declared inter-library dependencies are being dropped."
3581 droppeddeps=yes
3584 esac
3585 versuffix=$versuffix_save
3586 major=$major_save
3587 release=$release_save
3588 libname=$libname_save
3589 name=$name_save
3591 case $host in
3592 *-*-rhapsody* | *-*-darwin1.[012])
3593 # On Rhapsody replace the C library is the System framework
3594 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3596 esac
3598 if test "$droppeddeps" = yes; then
3599 if test "$module" = yes; then
3600 echo
3601 echo "*** Warning: libtool could not satisfy all declared inter-library"
3602 echo "*** dependencies of module $libname. Therefore, libtool will create"
3603 echo "*** a static module, that should work as long as the dlopening"
3604 echo "*** application is linked with the -dlopen flag."
3605 if test -z "$global_symbol_pipe"; then
3606 echo
3607 echo "*** However, this would only work if libtool was able to extract symbol"
3608 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3609 echo "*** not find such a program. So, this module is probably useless."
3610 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3612 if test "$build_old_libs" = no; then
3613 oldlibs="$output_objdir/$libname.$libext"
3614 build_libtool_libs=module
3615 build_old_libs=yes
3616 else
3617 build_libtool_libs=no
3619 else
3620 echo "*** The inter-library dependencies that have been dropped here will be"
3621 echo "*** automatically added whenever a program is linked with this library"
3622 echo "*** or is declared to -dlopen it."
3624 if test "$allow_undefined" = no; then
3625 echo
3626 echo "*** Since this library must not contain undefined symbols,"
3627 echo "*** because either the platform does not support them or"
3628 echo "*** it was explicitly requested with -no-undefined,"
3629 echo "*** libtool will only create a static version of it."
3630 if test "$build_old_libs" = no; then
3631 oldlibs="$output_objdir/$libname.$libext"
3632 build_libtool_libs=module
3633 build_old_libs=yes
3634 else
3635 build_libtool_libs=no
3640 # Done checking deplibs!
3641 deplibs=$newdeplibs
3644 # All the library-specific variables (install_libdir is set above).
3645 library_names=
3646 old_library=
3647 dlname=
3649 # Test again, we may have decided not to build it any more
3650 if test "$build_libtool_libs" = yes; then
3651 if test "$hardcode_into_libs" = yes; then
3652 # Hardcode the library paths
3653 hardcode_libdirs=
3654 dep_rpath=
3655 rpath="$finalize_rpath"
3656 test "$mode" != relink && rpath="$compile_rpath$rpath"
3657 for libdir in $rpath; do
3658 if test -n "$hardcode_libdir_flag_spec"; then
3659 if test -n "$hardcode_libdir_separator"; then
3660 if test -z "$hardcode_libdirs"; then
3661 hardcode_libdirs="$libdir"
3662 else
3663 # Just accumulate the unique libdirs.
3664 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3665 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3668 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3670 esac
3672 else
3673 eval flag=\"$hardcode_libdir_flag_spec\"
3674 dep_rpath="$dep_rpath $flag"
3676 elif test -n "$runpath_var"; then
3677 case "$perm_rpath " in
3678 *" $libdir "*) ;;
3679 *) perm_rpath="$perm_rpath $libdir" ;;
3680 esac
3682 done
3683 # Substitute the hardcoded libdirs into the rpath.
3684 if test -n "$hardcode_libdir_separator" &&
3685 test -n "$hardcode_libdirs"; then
3686 libdir="$hardcode_libdirs"
3687 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3689 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3690 # We should set the runpath_var.
3691 rpath=
3692 for dir in $perm_rpath; do
3693 rpath="$rpath$dir:"
3694 done
3695 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3697 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3700 shlibpath="$finalize_shlibpath"
3701 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3702 if test -n "$shlibpath"; then
3703 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3706 # Get the real and link names of the library.
3707 eval library_names=\"$library_names_spec\"
3708 set dummy $library_names
3709 realname="$2"
3710 shift; shift
3712 if test -n "$soname_spec"; then
3713 eval soname=\"$soname_spec\"
3714 else
3715 soname="$realname"
3717 if test -z "$dlname"; then
3718 dlname=$soname
3721 lib="$output_objdir/$realname"
3722 for link
3724 linknames="$linknames $link"
3725 done
3727 # Use standard objects if they are pic
3728 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3730 # Prepare the list of exported symbols
3731 if test -z "$export_symbols"; then
3732 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3733 $show "generating symbol list for \`$libname.la'"
3734 export_symbols="$output_objdir/$libname.exp"
3735 $run $rm $export_symbols
3736 eval cmds=\"$export_symbols_cmds\"
3737 save_ifs="$IFS"; IFS='~'
3738 for cmd in $cmds; do
3739 IFS="$save_ifs"
3740 if len=`expr "X$cmd" : ".*"` &&
3741 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3742 $show "$cmd"
3743 $run eval "$cmd" || exit $?
3744 skipped_export=false
3745 else
3746 # The command line is too long to execute in one step.
3747 $show "using reloadable object file for export list..."
3748 skipped_export=:
3750 done
3751 IFS="$save_ifs"
3752 if test -n "$export_symbols_regex"; then
3753 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3754 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3755 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3756 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3761 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3762 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3765 if test -n "$convenience"; then
3766 if test -n "$whole_archive_flag_spec"; then
3767 save_libobjs=$libobjs
3768 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3769 else
3770 gentop="$output_objdir/${outputname}x"
3771 $show "${rm}r $gentop"
3772 $run ${rm}r "$gentop"
3773 $show "$mkdir $gentop"
3774 $run $mkdir "$gentop"
3775 status=$?
3776 if test "$status" -ne 0 && test ! -d "$gentop"; then
3777 exit $status
3779 generated="$generated $gentop"
3781 for xlib in $convenience; do
3782 # Extract the objects.
3783 case $xlib in
3784 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3785 *) xabs=`pwd`"/$xlib" ;;
3786 esac
3787 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3788 xdir="$gentop/$xlib"
3790 $show "${rm}r $xdir"
3791 $run ${rm}r "$xdir"
3792 $show "$mkdir $xdir"
3793 $run $mkdir "$xdir"
3794 status=$?
3795 if test "$status" -ne 0 && test ! -d "$xdir"; then
3796 exit $status
3798 $show "(cd $xdir && $AR x $xabs)"
3799 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3801 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3802 done
3806 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3807 eval flag=\"$thread_safe_flag_spec\"
3808 linker_flags="$linker_flags $flag"
3811 # Make a backup of the uninstalled library when relinking
3812 if test "$mode" = relink; then
3813 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3816 # Do each of the archive commands.
3817 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3818 eval cmds=\"$archive_expsym_cmds\"
3819 else
3820 save_deplibs="$deplibs"
3821 for conv in $convenience; do
3822 tmp_deplibs=
3823 for test_deplib in $deplibs; do
3824 if test "$test_deplib" != "$conv"; then
3825 tmp_deplibs="$tmp_deplibs $test_deplib"
3827 done
3828 deplibs="$tmp_deplibs"
3829 done
3830 eval cmds=\"$archive_cmds\"
3831 deplibs="$save_deplibs"
3834 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
3835 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3837 else
3838 # The command line is too long to link in one step, link piecewise.
3839 $echo "creating reloadable object files..."
3841 # Save the value of $output and $libobjs because we want to
3842 # use them later. If we have whole_archive_flag_spec, we
3843 # want to use save_libobjs as it was before
3844 # whole_archive_flag_spec was expanded, because we can't
3845 # assume the linker understands whole_archive_flag_spec.
3846 # This may have to be revisited, in case too many
3847 # convenience libraries get linked in and end up exceeding
3848 # the spec.
3849 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3850 save_libobjs=$libobjs
3852 save_output=$output
3854 # Clear the reloadable object creation command queue and
3855 # initialize k to one.
3856 test_cmds=
3857 concat_cmds=
3858 objlist=
3859 delfiles=
3860 last_robj=
3862 output=$output_objdir/$save_output-${k}.$objext
3863 # Loop over the list of objects to be linked.
3864 for obj in $save_libobjs
3866 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3867 if test "X$objlist" = X ||
3868 { len=`expr "X$test_cmds" : ".*"` &&
3869 test "$len" -le "$max_cmd_len"; }; then
3870 objlist="$objlist $obj"
3871 else
3872 # The command $test_cmds is almost too long, add a
3873 # command to the queue.
3874 if test "$k" -eq 1 ; then
3875 # The first file doesn't have a previous command to add.
3876 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3877 else
3878 # All subsequent reloadable object files will link in
3879 # the last one created.
3880 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3882 last_robj=$output_objdir/$save_output-${k}.$objext
3883 k=`expr $k + 1`
3884 output=$output_objdir/$save_output-${k}.$objext
3885 objlist=$obj
3886 len=1
3888 done
3889 # Handle the remaining objects by creating one last
3890 # reloadable object file. All subsequent reloadable object
3891 # files will link in the last one created.
3892 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3893 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3895 if ${skipped_export-false}; then
3896 $show "generating symbol list for \`$libname.la'"
3897 export_symbols="$output_objdir/$libname.exp"
3898 $run $rm $export_symbols
3899 libobjs=$output
3900 # Append the command to create the export file.
3901 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3904 # Set up a command to remove the reloadale object files
3905 # after they are used.
3907 while test "$i" -lt "$k"
3909 i=`expr $i + 1`
3910 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3911 done
3913 $echo "creating a temporary reloadable object file: $output"
3915 # Loop through the commands generated above and execute them.
3916 save_ifs="$IFS"; IFS='~'
3917 for cmd in $concat_cmds; do
3918 IFS="$save_ifs"
3919 $show "$cmd"
3920 $run eval "$cmd" || exit $?
3921 done
3922 IFS="$save_ifs"
3924 libobjs=$output
3925 # Restore the value of output.
3926 output=$save_output
3928 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3929 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3931 # Expand the library linking commands again to reset the
3932 # value of $libobjs for piecewise linking.
3934 # Do each of the archive commands.
3935 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3936 eval cmds=\"$archive_expsym_cmds\"
3937 else
3938 eval cmds=\"$archive_cmds\"
3941 # Append the command to remove the reloadable object files
3942 # to the just-reset $cmds.
3943 eval cmds=\"\$cmds~$rm $delfiles\"
3945 save_ifs="$IFS"; IFS='~'
3946 for cmd in $cmds; do
3947 IFS="$save_ifs"
3948 $show "$cmd"
3949 $run eval "$cmd" || exit $?
3950 done
3951 IFS="$save_ifs"
3953 # Restore the uninstalled library and exit
3954 if test "$mode" = relink; then
3955 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3956 exit 0
3959 # Create links to the real library.
3960 for linkname in $linknames; do
3961 if test "$realname" != "$linkname"; then
3962 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3963 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3965 done
3967 # If -module or -export-dynamic was specified, set the dlname.
3968 if test "$module" = yes || test "$export_dynamic" = yes; then
3969 # On all known operating systems, these are identical.
3970 dlname="$soname"
3975 obj)
3976 if test -n "$deplibs"; then
3977 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3980 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3981 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3984 if test -n "$rpath"; then
3985 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3988 if test -n "$xrpath"; then
3989 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3992 if test -n "$vinfo"; then
3993 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3996 if test -n "$release"; then
3997 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4000 case $output in
4001 *.lo)
4002 if test -n "$objs$old_deplibs"; then
4003 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4004 exit 1
4006 libobj="$output"
4007 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4010 libobj=
4011 obj="$output"
4013 esac
4015 # Delete the old objects.
4016 $run $rm $obj $libobj
4018 # Objects from convenience libraries. This assumes
4019 # single-version convenience libraries. Whenever we create
4020 # different ones for PIC/non-PIC, this we'll have to duplicate
4021 # the extraction.
4022 reload_conv_objs=
4023 gentop=
4024 # reload_cmds runs $LD directly, so let us get rid of
4025 # -Wl from whole_archive_flag_spec
4028 if test -n "$convenience"; then
4029 if test -n "$whole_archive_flag_spec"; then
4030 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4031 else
4032 gentop="$output_objdir/${obj}x"
4033 $show "${rm}r $gentop"
4034 $run ${rm}r "$gentop"
4035 $show "$mkdir $gentop"
4036 $run $mkdir "$gentop"
4037 status=$?
4038 if test "$status" -ne 0 && test ! -d "$gentop"; then
4039 exit $status
4041 generated="$generated $gentop"
4043 for xlib in $convenience; do
4044 # Extract the objects.
4045 case $xlib in
4046 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4047 *) xabs=`pwd`"/$xlib" ;;
4048 esac
4049 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4050 xdir="$gentop/$xlib"
4052 $show "${rm}r $xdir"
4053 $run ${rm}r "$xdir"
4054 $show "$mkdir $xdir"
4055 $run $mkdir "$xdir"
4056 status=$?
4057 if test "$status" -ne 0 && test ! -d "$xdir"; then
4058 exit $status
4060 $show "(cd $xdir && $AR x $xabs)"
4061 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4063 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4064 done
4068 # Create the old-style object.
4069 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
4071 output="$obj"
4072 eval cmds=\"$reload_cmds\"
4073 save_ifs="$IFS"; IFS='~'
4074 for cmd in $cmds; do
4075 IFS="$save_ifs"
4076 $show "$cmd"
4077 $run eval "$cmd" || exit $?
4078 done
4079 IFS="$save_ifs"
4081 # Exit if we aren't doing a library object file.
4082 if test -z "$libobj"; then
4083 if test -n "$gentop"; then
4084 $show "${rm}r $gentop"
4085 $run ${rm}r $gentop
4088 exit 0
4091 if test "$build_libtool_libs" != yes; then
4092 if test -n "$gentop"; then
4093 $show "${rm}r $gentop"
4094 $run ${rm}r $gentop
4097 # Create an invalid libtool object if no PIC, so that we don't
4098 # accidentally link it into a program.
4099 # $show "echo timestamp > $libobj"
4100 # $run eval "echo timestamp > $libobj" || exit $?
4101 exit 0
4104 if test -n "$pic_flag" || test "$pic_mode" != default; then
4105 # Only do commands if we really have different PIC objects.
4106 reload_objs="$libobjs $reload_conv_objs"
4107 output="$libobj"
4108 eval cmds=\"$reload_cmds\"
4109 save_ifs="$IFS"; IFS='~'
4110 for cmd in $cmds; do
4111 IFS="$save_ifs"
4112 $show "$cmd"
4113 $run eval "$cmd" || exit $?
4114 done
4115 IFS="$save_ifs"
4118 if test -n "$gentop"; then
4119 $show "${rm}r $gentop"
4120 $run ${rm}r $gentop
4123 exit 0
4126 prog)
4127 case $host in
4128 *cygwin*) output=`echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4129 esac
4130 if test -n "$vinfo"; then
4131 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4134 if test -n "$release"; then
4135 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4138 if test "$preload" = yes; then
4139 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4140 test "$dlopen_self_static" = unknown; then
4141 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4145 case $host in
4146 *-*-rhapsody* | *-*-darwin1.[012])
4147 # On Rhapsody replace the C library is the System framework
4148 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4149 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4151 esac
4153 compile_command="$compile_command $compile_deplibs"
4154 finalize_command="$finalize_command $finalize_deplibs"
4156 if test -n "$rpath$xrpath"; then
4157 # If the user specified any rpath flags, then add them.
4158 for libdir in $rpath $xrpath; do
4159 # This is the magic to use -rpath.
4160 case "$finalize_rpath " in
4161 *" $libdir "*) ;;
4162 *) finalize_rpath="$finalize_rpath $libdir" ;;
4163 esac
4164 done
4167 # Now hardcode the library paths
4168 rpath=
4169 hardcode_libdirs=
4170 for libdir in $compile_rpath $finalize_rpath; do
4171 if test -n "$hardcode_libdir_flag_spec"; then
4172 if test -n "$hardcode_libdir_separator"; then
4173 if test -z "$hardcode_libdirs"; then
4174 hardcode_libdirs="$libdir"
4175 else
4176 # Just accumulate the unique libdirs.
4177 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4178 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4181 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4183 esac
4185 else
4186 eval flag=\"$hardcode_libdir_flag_spec\"
4187 rpath="$rpath $flag"
4189 elif test -n "$runpath_var"; then
4190 case "$perm_rpath " in
4191 *" $libdir "*) ;;
4192 *) perm_rpath="$perm_rpath $libdir" ;;
4193 esac
4195 case $host in
4196 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4197 case :$dllsearchpath: in
4198 *":$libdir:"*) ;;
4199 *) dllsearchpath="$dllsearchpath:$libdir";;
4200 esac
4202 esac
4203 done
4204 # Substitute the hardcoded libdirs into the rpath.
4205 if test -n "$hardcode_libdir_separator" &&
4206 test -n "$hardcode_libdirs"; then
4207 libdir="$hardcode_libdirs"
4208 eval rpath=\" $hardcode_libdir_flag_spec\"
4210 compile_rpath="$rpath"
4212 rpath=
4213 hardcode_libdirs=
4214 for libdir in $finalize_rpath; do
4215 if test -n "$hardcode_libdir_flag_spec"; then
4216 if test -n "$hardcode_libdir_separator"; then
4217 if test -z "$hardcode_libdirs"; then
4218 hardcode_libdirs="$libdir"
4219 else
4220 # Just accumulate the unique libdirs.
4221 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4222 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4225 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4227 esac
4229 else
4230 eval flag=\"$hardcode_libdir_flag_spec\"
4231 rpath="$rpath $flag"
4233 elif test -n "$runpath_var"; then
4234 case "$finalize_perm_rpath " in
4235 *" $libdir "*) ;;
4236 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4237 esac
4239 done
4240 # Substitute the hardcoded libdirs into the rpath.
4241 if test -n "$hardcode_libdir_separator" &&
4242 test -n "$hardcode_libdirs"; then
4243 libdir="$hardcode_libdirs"
4244 eval rpath=\" $hardcode_libdir_flag_spec\"
4246 finalize_rpath="$rpath"
4248 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4249 # Transform all the library objects into standard objects.
4250 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4251 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4254 dlsyms=
4255 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4256 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4257 dlsyms="${outputname}S.c"
4258 else
4259 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4263 if test -n "$dlsyms"; then
4264 case $dlsyms in
4265 "") ;;
4266 *.c)
4267 # Discover the nlist of each of the dlfiles.
4268 nlist="$output_objdir/${outputname}.nm"
4270 $show "$rm $nlist ${nlist}S ${nlist}T"
4271 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4273 # Parse the name list into a source file.
4274 $show "creating $output_objdir/$dlsyms"
4276 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4277 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4278 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4280 #ifdef __cplusplus
4281 extern \"C\" {
4282 #endif
4284 /* Prevent the only kind of declaration conflicts we can make. */
4285 #define lt_preloaded_symbols some_other_symbol
4287 /* External symbol declarations for the compiler. */\
4290 if test "$dlself" = yes; then
4291 $show "generating symbol list for \`$output'"
4293 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4295 # Add our own program objects to the symbol list.
4296 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4297 for arg in $progfiles; do
4298 $show "extracting global C symbols from \`$arg'"
4299 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4300 done
4302 if test -n "$exclude_expsyms"; then
4303 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4304 $run eval '$mv "$nlist"T "$nlist"'
4307 if test -n "$export_symbols_regex"; then
4308 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4309 $run eval '$mv "$nlist"T "$nlist"'
4312 # Prepare the list of exported symbols
4313 if test -z "$export_symbols"; then
4314 export_symbols="$output_objdir/$output.exp"
4315 $run $rm $export_symbols
4316 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4317 else
4318 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4319 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4320 $run eval 'mv "$nlist"T "$nlist"'
4324 for arg in $dlprefiles; do
4325 $show "extracting global C symbols from \`$arg'"
4326 name=`echo "$arg" | ${SED} -e 's%^.*/%%'`
4327 $run eval 'echo ": $name " >> "$nlist"'
4328 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4329 done
4331 if test -z "$run"; then
4332 # Make sure we have at least an empty file.
4333 test -f "$nlist" || : > "$nlist"
4335 if test -n "$exclude_expsyms"; then
4336 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4337 $mv "$nlist"T "$nlist"
4340 # Try sorting and uniquifying the output.
4341 if grep -v "^: " < "$nlist" |
4342 if sort -k 3 </dev/null >/dev/null 2>&1; then
4343 sort -k 3
4344 else
4345 sort +2
4346 fi |
4347 uniq > "$nlist"S; then
4349 else
4350 grep -v "^: " < "$nlist" > "$nlist"S
4353 if test -f "$nlist"S; then
4354 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4355 else
4356 echo '/* NONE */' >> "$output_objdir/$dlsyms"
4359 $echo >> "$output_objdir/$dlsyms" "\
4361 #undef lt_preloaded_symbols
4363 #if defined (__STDC__) && __STDC__
4364 # define lt_ptr void *
4365 #else
4366 # define lt_ptr char *
4367 # define const
4368 #endif
4370 /* The mapping between symbol names and symbols. */
4371 const struct {
4372 const char *name;
4373 lt_ptr address;
4375 lt_preloaded_symbols[] =
4379 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4381 $echo >> "$output_objdir/$dlsyms" "\
4382 {0, (lt_ptr) 0}
4385 /* This works around a problem in FreeBSD linker */
4386 #ifdef FREEBSD_WORKAROUND
4387 static const void *lt_preloaded_setup() {
4388 return lt_preloaded_symbols;
4390 #endif
4392 #ifdef __cplusplus
4394 #endif\
4398 pic_flag_for_symtable=
4399 case $host in
4400 # compiling the symbol table file with pic_flag works around
4401 # a FreeBSD bug that causes programs to crash when -lm is
4402 # linked before any other PIC object. But we must not use
4403 # pic_flag when linking with -static. The problem exists in
4404 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4405 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4406 case "$compile_command " in
4407 *" -static "*) ;;
4408 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4409 esac;;
4410 *-*-hpux*)
4411 case "$compile_command " in
4412 *" -static "*) ;;
4413 *) pic_flag_for_symtable=" $pic_flag";;
4414 esac
4415 esac
4417 # Now compile the dynamic symbol file.
4418 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4419 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4421 # Clean up the generated files.
4422 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4423 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4425 # Transform the symbol file into the correct name.
4426 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4427 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4430 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4431 exit 1
4433 esac
4434 else
4435 # We keep going just in case the user didn't refer to
4436 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4437 # really was required.
4439 # Nullify the symbol file.
4440 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4441 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4444 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4445 # Replace the output file specification.
4446 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4447 link_command="$compile_command$compile_rpath"
4449 # We have no uninstalled library dependencies, so finalize right now.
4450 $show "$link_command"
4451 $run eval "$link_command"
4452 status=$?
4454 # Delete the generated files.
4455 if test -n "$dlsyms"; then
4456 $show "$rm $output_objdir/${outputname}S.${objext}"
4457 $run $rm "$output_objdir/${outputname}S.${objext}"
4460 exit $status
4463 if test -n "$shlibpath_var"; then
4464 # We should set the shlibpath_var
4465 rpath=
4466 for dir in $temp_rpath; do
4467 case $dir in
4468 [\\/]* | [A-Za-z]:[\\/]*)
4469 # Absolute path.
4470 rpath="$rpath$dir:"
4473 # Relative path: add a thisdir entry.
4474 rpath="$rpath\$thisdir/$dir:"
4476 esac
4477 done
4478 temp_rpath="$rpath"
4481 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4482 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4484 if test -n "$finalize_shlibpath"; then
4485 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4488 compile_var=
4489 finalize_var=
4490 if test -n "$runpath_var"; then
4491 if test -n "$perm_rpath"; then
4492 # We should set the runpath_var.
4493 rpath=
4494 for dir in $perm_rpath; do
4495 rpath="$rpath$dir:"
4496 done
4497 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4499 if test -n "$finalize_perm_rpath"; then
4500 # We should set the runpath_var.
4501 rpath=
4502 for dir in $finalize_perm_rpath; do
4503 rpath="$rpath$dir:"
4504 done
4505 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4509 if test "$no_install" = yes; then
4510 # We don't need to create a wrapper script.
4511 link_command="$compile_var$compile_command$compile_rpath"
4512 # Replace the output file specification.
4513 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4514 # Delete the old output file.
4515 $run $rm $output
4516 # Link the executable and exit
4517 $show "$link_command"
4518 $run eval "$link_command" || exit $?
4519 exit 0
4522 if test "$hardcode_action" = relink; then
4523 # Fast installation is not supported
4524 link_command="$compile_var$compile_command$compile_rpath"
4525 relink_command="$finalize_var$finalize_command$finalize_rpath"
4527 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4528 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4529 else
4530 if test "$fast_install" != no; then
4531 link_command="$finalize_var$compile_command$finalize_rpath"
4532 if test "$fast_install" = yes; then
4533 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4534 else
4535 # fast_install is set to needless
4536 relink_command=
4538 else
4539 link_command="$compile_var$compile_command$compile_rpath"
4540 relink_command="$finalize_var$finalize_command$finalize_rpath"
4544 # Replace the output file specification.
4545 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4547 # Delete the old output files.
4548 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4550 $show "$link_command"
4551 $run eval "$link_command" || exit $?
4553 # Now create the wrapper script.
4554 $show "creating $output"
4556 # Quote the relink command for shipping.
4557 if test -n "$relink_command"; then
4558 # Preserve any variables that may affect compiler behavior
4559 for var in $variables_saved_for_relink; do
4560 if eval test -z \"\${$var+set}\"; then
4561 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4562 elif eval var_value=\$$var; test -z "$var_value"; then
4563 relink_command="$var=; export $var; $relink_command"
4564 else
4565 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4566 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4568 done
4569 relink_command="(cd `pwd`; $relink_command)"
4570 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4573 # Quote $echo for shipping.
4574 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4575 case $0 in
4576 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4577 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4578 esac
4579 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4580 else
4581 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4584 # Only actually do things if our run command is non-null.
4585 if test -z "$run"; then
4586 # win32 will think the script is a binary if it has
4587 # a .exe suffix, so we strip it off here.
4588 case $output in
4589 *.exe) output=`echo $output|${SED} 's,.exe$,,'` ;;
4590 esac
4591 # test for cygwin because mv fails w/o .exe extensions
4592 case $host in
4593 *cygwin*)
4594 exeext=.exe
4595 outputname=`echo $outputname|${SED} 's,.exe$,,'` ;;
4596 *) exeext= ;;
4597 esac
4598 $rm $output
4599 trap "$rm $output; exit 1" 1 2 15
4601 $echo > $output "\
4602 #! $SHELL
4604 # $output - temporary wrapper script for $objdir/$outputname
4605 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4607 # The $output program cannot be directly executed until all the libtool
4608 # libraries that it depends on are installed.
4610 # This wrapper script should never be moved out of the build directory.
4611 # If it is, it will not operate correctly.
4613 # Sed substitution that helps us do robust quoting. It backslashifies
4614 # metacharacters that are still active within double-quoted strings.
4615 Xsed='${SED} -e 1s/^X//'
4616 sed_quote_subst='$sed_quote_subst'
4618 # The HP-UX ksh and POSIX shell print the target directory to stdout
4619 # if CDPATH is set.
4620 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4622 relink_command=\"$relink_command\"
4624 # This environment variable determines our operation mode.
4625 if test \"\$libtool_install_magic\" = \"$magic\"; then
4626 # install mode needs the following variable:
4627 notinst_deplibs='$notinst_deplibs'
4628 else
4629 # When we are sourced in execute mode, \$file and \$echo are already set.
4630 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4631 echo=\"$qecho\"
4632 file=\"\$0\"
4633 # Make sure echo works.
4634 if test \"X\$1\" = X--no-reexec; then
4635 # Discard the --no-reexec flag, and continue.
4636 shift
4637 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4638 # Yippee, \$echo works!
4640 else
4641 # Restart under the correct shell, and then maybe \$echo will work.
4642 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4646 $echo >> $output "\
4648 # Find the directory that this script lives in.
4649 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4650 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4652 # Follow symbolic links until we get to the real thisdir.
4653 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4654 while test -n \"\$file\"; do
4655 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4657 # If there was a directory component, then change thisdir.
4658 if test \"x\$destdir\" != \"x\$file\"; then
4659 case \"\$destdir\" in
4660 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4661 *) thisdir=\"\$thisdir/\$destdir\" ;;
4662 esac
4665 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4666 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4667 done
4669 # Try to get the absolute directory name.
4670 absdir=\`cd \"\$thisdir\" && pwd\`
4671 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4674 if test "$fast_install" = yes; then
4675 echo >> $output "\
4676 program=lt-'$outputname'$exeext
4677 progdir=\"\$thisdir/$objdir\"
4679 if test ! -f \"\$progdir/\$program\" || \\
4680 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4681 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4683 file=\"\$\$-\$program\"
4685 if test ! -d \"\$progdir\"; then
4686 $mkdir \"\$progdir\"
4687 else
4688 $rm \"\$progdir/\$file\"
4691 echo >> $output "\
4693 # relink executable if necessary
4694 if test -n \"\$relink_command\"; then
4695 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4696 else
4697 $echo \"\$relink_command_output\" >&2
4698 $rm \"\$progdir/\$file\"
4699 exit 1
4703 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4704 { $rm \"\$progdir/\$program\";
4705 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4706 $rm \"\$progdir/\$file\"
4708 else
4709 echo >> $output "\
4710 program='$outputname'
4711 progdir=\"\$thisdir/$objdir\"
4715 echo >> $output "\
4717 if test -f \"\$progdir/\$program\"; then"
4719 # Export our shlibpath_var if we have one.
4720 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4721 $echo >> $output "\
4722 # Add our own library path to $shlibpath_var
4723 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4725 # Some systems cannot cope with colon-terminated $shlibpath_var
4726 # The second colon is a workaround for a bug in BeOS R4 sed
4727 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4729 export $shlibpath_var
4733 # fixup the dll searchpath if we need to.
4734 if test -n "$dllsearchpath"; then
4735 $echo >> $output "\
4736 # Add the dll search path components to the executable PATH
4737 PATH=$dllsearchpath:\$PATH
4741 $echo >> $output "\
4742 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4743 # Run the actual program with our arguments.
4745 case $host in
4746 # Backslashes separate directories on plain windows
4747 *-*-mingw | *-*-os2*)
4748 $echo >> $output "\
4749 exec \$progdir\\\\\$program \${1+\"\$@\"}
4754 $echo >> $output "\
4755 exec \$progdir/\$program \${1+\"\$@\"}
4758 esac
4759 $echo >> $output "\
4760 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4761 exit 1
4763 else
4764 # The program doesn't exist.
4765 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4766 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4767 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4768 exit 1
4772 chmod +x $output
4774 exit 0
4776 esac
4778 # See if we need to build an old-fashioned archive.
4779 for oldlib in $oldlibs; do
4781 if test "$build_libtool_libs" = convenience; then
4782 oldobjs="$libobjs_save"
4783 addlibs="$convenience"
4784 build_libtool_libs=no
4785 else
4786 if test "$build_libtool_libs" = module; then
4787 oldobjs="$libobjs_save"
4788 build_libtool_libs=no
4789 else
4790 oldobjs="$old_deplibs $non_pic_objects"
4792 addlibs="$old_convenience"
4795 if test -n "$addlibs"; then
4796 gentop="$output_objdir/${outputname}x"
4797 $show "${rm}r $gentop"
4798 $run ${rm}r "$gentop"
4799 $show "$mkdir $gentop"
4800 $run $mkdir "$gentop"
4801 status=$?
4802 if test "$status" -ne 0 && test ! -d "$gentop"; then
4803 exit $status
4805 generated="$generated $gentop"
4807 # Add in members from convenience archives.
4808 for xlib in $addlibs; do
4809 # Extract the objects.
4810 case $xlib in
4811 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4812 *) xabs=`pwd`"/$xlib" ;;
4813 esac
4814 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4815 xdir="$gentop/$xlib"
4817 $show "${rm}r $xdir"
4818 $run ${rm}r "$xdir"
4819 $show "$mkdir $xdir"
4820 $run $mkdir "$xdir"
4821 status=$?
4822 if test "$status" -ne 0 && test ! -d "$xdir"; then
4823 exit $status
4825 $show "(cd $xdir && $AR x $xabs)"
4826 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4828 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4829 done
4832 # Do each command in the archive commands.
4833 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4834 eval cmds=\"$old_archive_from_new_cmds\"
4835 else
4836 eval cmds=\"$old_archive_cmds\"
4838 if len=`expr "X$cmds" : ".*"` &&
4839 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4841 else
4842 # the command line is too long to link in one step, link in parts
4843 $echo "using piecewise archive linking..."
4844 save_RANLIB=$RANLIB
4845 RANLIB=:
4846 objlist=
4847 concat_cmds=
4848 save_oldobjs=$oldobjs
4849 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
4850 # encoded into archives. This makes 'ar r' malfunction in
4851 # this piecewise linking case whenever conflicting object
4852 # names appear in distinct ar calls; check, warn and compensate.
4853 if (for obj in $save_oldobjs
4855 $echo "X$obj" | $Xsed -e 's%^.*/%%'
4856 done | sort | sort -uc >/dev/null 2>&1); then
4858 else
4859 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
4860 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
4861 AR_FLAGS=cq
4863 for obj in $save_oldobjs
4865 oldobjs="$objlist $obj"
4866 objlist="$objlist $obj"
4867 eval test_cmds=\"$old_archive_cmds\"
4868 if len=`expr "X$test_cmds" : ".*"` &&
4869 test "$len" -le "$max_cmd_len"; then
4871 else
4872 # the above command should be used before it gets too long
4873 oldobjs=$objlist
4874 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
4875 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
4876 objlist=
4878 done
4879 RANLIB=$save_RANLIB
4880 oldobjs=$objlist
4881 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
4884 save_ifs="$IFS"; IFS='~'
4885 for cmd in $cmds; do
4886 IFS="$save_ifs"
4887 $show "$cmd"
4888 $run eval "$cmd" || exit $?
4889 done
4890 IFS="$save_ifs"
4891 done
4893 if test -n "$generated"; then
4894 $show "${rm}r$generated"
4895 $run ${rm}r$generated
4898 # Now create the libtool archive.
4899 case $output in
4900 *.la)
4901 old_library=
4902 test "$build_old_libs" = yes && old_library="$libname.$libext"
4903 $show "creating $output"
4905 # Preserve any variables that may affect compiler behavior
4906 for var in $variables_saved_for_relink; do
4907 if eval test -z \"\${$var+set}\"; then
4908 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4909 elif eval var_value=\$$var; test -z "$var_value"; then
4910 relink_command="$var=; export $var; $relink_command"
4911 else
4912 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4913 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4915 done
4916 # Quote the link command for shipping.
4917 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
4918 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4920 # Only create the output if not a dry run.
4921 if test -z "$run"; then
4922 for installed in no yes; do
4923 if test "$installed" = yes; then
4924 if test -z "$install_libdir"; then
4925 break
4927 output="$output_objdir/$outputname"i
4928 # Replace all uninstalled libtool libraries with the installed ones
4929 newdependency_libs=
4930 for deplib in $dependency_libs; do
4931 case $deplib in
4932 *.la)
4933 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4934 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4935 if test -z "$libdir"; then
4936 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4937 exit 1
4939 newdependency_libs="$newdependency_libs $libdir/$name"
4941 *) newdependency_libs="$newdependency_libs $deplib" ;;
4942 esac
4943 done
4944 dependency_libs="$newdependency_libs"
4945 newdlfiles=
4946 for lib in $dlfiles; do
4947 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4948 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4949 if test -z "$libdir"; then
4950 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4951 exit 1
4953 newdlfiles="$newdlfiles $libdir/$name"
4954 done
4955 dlfiles="$newdlfiles"
4956 newdlprefiles=
4957 for lib in $dlprefiles; do
4958 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4959 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4960 if test -z "$libdir"; then
4961 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4962 exit 1
4964 newdlprefiles="$newdlprefiles $libdir/$name"
4965 done
4966 dlprefiles="$newdlprefiles"
4968 $rm $output
4969 # place dlname in correct position for cygwin
4970 tdlname=$dlname
4971 case $host,$output,$installed,$module,$dlname in
4972 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4973 esac
4974 $echo > $output "\
4975 # $outputname - a libtool library file
4976 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4978 # Please DO NOT delete this file!
4979 # It is necessary for linking the library.
4981 # The name that we can dlopen(3).
4982 dlname='$tdlname'
4984 # Names of this library.
4985 library_names='$library_names'
4987 # The name of the static archive.
4988 old_library='$old_library'
4990 # Libraries that this one depends upon.
4991 dependency_libs='$dependency_libs'
4993 # Version information for $libname.
4994 current=$current
4995 age=$age
4996 revision=$revision
4998 # Is this an already installed library?
4999 installed=$installed
5001 # Files to dlopen/dlpreopen
5002 dlopen='$dlfiles'
5003 dlpreopen='$dlprefiles'
5005 # Directory that this library needs to be installed in:
5006 libdir='$install_libdir'"
5007 if test "$installed" = no && test "$need_relink" = yes; then
5008 $echo >> $output "\
5009 relink_command=\"$relink_command\""
5011 done
5014 # Do a symbolic link so that the libtool archive can be found in
5015 # LD_LIBRARY_PATH before the program is installed.
5016 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5017 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5019 esac
5020 exit 0
5023 # libtool install mode
5024 install)
5025 modename="$modename: install"
5027 # There may be an optional sh(1) argument at the beginning of
5028 # install_prog (especially on Windows NT).
5029 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5030 # Allow the use of GNU shtool's install command.
5031 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5032 # Aesthetically quote it.
5033 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5034 case $arg in
5035 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5036 arg="\"$arg\""
5038 esac
5039 install_prog="$arg "
5040 arg="$1"
5041 shift
5042 else
5043 install_prog=
5044 arg="$nonopt"
5047 # The real first argument should be the name of the installation program.
5048 # Aesthetically quote it.
5049 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5050 case $arg in
5051 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5052 arg="\"$arg\""
5054 esac
5055 install_prog="$install_prog$arg"
5057 # We need to accept at least all the BSD install flags.
5058 dest=
5059 files=
5060 opts=
5061 prev=
5062 install_type=
5063 isdir=no
5064 stripme=
5065 for arg
5067 if test -n "$dest"; then
5068 files="$files $dest"
5069 dest="$arg"
5070 continue
5073 case $arg in
5074 -d) isdir=yes ;;
5075 -f) prev="-f" ;;
5076 -g) prev="-g" ;;
5077 -m) prev="-m" ;;
5078 -o) prev="-o" ;;
5080 stripme=" -s"
5081 continue
5083 -*) ;;
5086 # If the previous option needed an argument, then skip it.
5087 if test -n "$prev"; then
5088 prev=
5089 else
5090 dest="$arg"
5091 continue
5094 esac
5096 # Aesthetically quote the argument.
5097 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5098 case $arg in
5099 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5100 arg="\"$arg\""
5102 esac
5103 install_prog="$install_prog $arg"
5104 done
5106 if test -z "$install_prog"; then
5107 $echo "$modename: you must specify an install program" 1>&2
5108 $echo "$help" 1>&2
5109 exit 1
5112 if test -n "$prev"; then
5113 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5114 $echo "$help" 1>&2
5115 exit 1
5118 if test -z "$files"; then
5119 if test -z "$dest"; then
5120 $echo "$modename: no file or destination specified" 1>&2
5121 else
5122 $echo "$modename: you must specify a destination" 1>&2
5124 $echo "$help" 1>&2
5125 exit 1
5128 # Strip any trailing slash from the destination.
5129 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5131 # Check to see that the destination is a directory.
5132 test -d "$dest" && isdir=yes
5133 if test "$isdir" = yes; then
5134 destdir="$dest"
5135 destname=
5136 else
5137 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5138 test "X$destdir" = "X$dest" && destdir=.
5139 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5141 # Not a directory, so check to see that there is only one file specified.
5142 set dummy $files
5143 if test "$#" -gt 2; then
5144 $echo "$modename: \`$dest' is not a directory" 1>&2
5145 $echo "$help" 1>&2
5146 exit 1
5149 case $destdir in
5150 [\\/]* | [A-Za-z]:[\\/]*) ;;
5152 for file in $files; do
5153 case $file in
5154 *.lo) ;;
5156 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5157 $echo "$help" 1>&2
5158 exit 1
5160 esac
5161 done
5163 esac
5165 # This variable tells wrapper scripts just to set variables rather
5166 # than running their programs.
5167 libtool_install_magic="$magic"
5169 staticlibs=
5170 future_libdirs=
5171 current_libdirs=
5172 for file in $files; do
5174 # Do each installation.
5175 case $file in
5176 *.$libext)
5177 # Do the static libraries later.
5178 staticlibs="$staticlibs $file"
5181 *.la)
5182 # Check to see that this really is a libtool archive.
5183 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5184 else
5185 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5186 $echo "$help" 1>&2
5187 exit 1
5190 library_names=
5191 old_library=
5192 relink_command=
5193 # If there is no directory component, then add one.
5194 case $file in
5195 */* | *\\*) . $file ;;
5196 *) . ./$file ;;
5197 esac
5199 # Add the libdir to current_libdirs if it is the destination.
5200 if test "X$destdir" = "X$libdir"; then
5201 case "$current_libdirs " in
5202 *" $libdir "*) ;;
5203 *) current_libdirs="$current_libdirs $libdir" ;;
5204 esac
5205 else
5206 # Note the libdir as a future libdir.
5207 case "$future_libdirs " in
5208 *" $libdir "*) ;;
5209 *) future_libdirs="$future_libdirs $libdir" ;;
5210 esac
5213 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5214 test "X$dir" = "X$file/" && dir=
5215 dir="$dir$objdir"
5217 if test -n "$relink_command"; then
5218 # Determine the prefix the user has applied to our future dir.
5219 inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
5221 # Don't allow the user to place us outside of our expected
5222 # location b/c this prevents finding dependent libraries that
5223 # are installed to the same prefix.
5224 # At present, this check doesn't affect windows .dll's that
5225 # are installed into $libdir/../bin (currently, that works fine)
5226 # but it's something to keep an eye on.
5227 if test "$inst_prefix_dir" = "$destdir"; then
5228 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5229 exit 1
5232 if test -n "$inst_prefix_dir"; then
5233 # Stick the inst_prefix_dir data into the link command.
5234 relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5235 else
5236 relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
5239 $echo "$modename: warning: relinking \`$file'" 1>&2
5240 $show "$relink_command"
5241 if $run eval "$relink_command"; then :
5242 else
5243 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5244 exit 1
5248 # See the names of the shared library.
5249 set dummy $library_names
5250 if test -n "$2"; then
5251 realname="$2"
5252 shift
5253 shift
5255 srcname="$realname"
5256 test -n "$relink_command" && srcname="$realname"T
5258 # Install the shared library and build the symlinks.
5259 $show "$install_prog $dir/$srcname $destdir/$realname"
5260 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5261 if test -n "$stripme" && test -n "$striplib"; then
5262 $show "$striplib $destdir/$realname"
5263 $run eval "$striplib $destdir/$realname" || exit $?
5266 if test "$#" -gt 0; then
5267 # Delete the old symlinks, and create new ones.
5268 for linkname
5270 if test "$linkname" != "$realname"; then
5271 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5272 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5274 done
5277 # Do each command in the postinstall commands.
5278 lib="$destdir/$realname"
5279 eval cmds=\"$postinstall_cmds\"
5280 save_ifs="$IFS"; IFS='~'
5281 for cmd in $cmds; do
5282 IFS="$save_ifs"
5283 $show "$cmd"
5284 $run eval "$cmd" || exit $?
5285 done
5286 IFS="$save_ifs"
5289 # Install the pseudo-library for information purposes.
5290 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5291 instname="$dir/$name"i
5292 $show "$install_prog $instname $destdir/$name"
5293 $run eval "$install_prog $instname $destdir/$name" || exit $?
5295 # Maybe install the static library, too.
5296 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5299 *.lo)
5300 # Install (i.e. copy) a libtool object.
5302 # Figure out destination file name, if it wasn't already specified.
5303 if test -n "$destname"; then
5304 destfile="$destdir/$destname"
5305 else
5306 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5307 destfile="$destdir/$destfile"
5310 # Deduce the name of the destination old-style object file.
5311 case $destfile in
5312 *.lo)
5313 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5315 *.$objext)
5316 staticdest="$destfile"
5317 destfile=
5320 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5321 $echo "$help" 1>&2
5322 exit 1
5324 esac
5326 # Install the libtool object if requested.
5327 if test -n "$destfile"; then
5328 $show "$install_prog $file $destfile"
5329 $run eval "$install_prog $file $destfile" || exit $?
5332 # Install the old object if enabled.
5333 if test "$build_old_libs" = yes; then
5334 # Deduce the name of the old-style object file.
5335 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5337 $show "$install_prog $staticobj $staticdest"
5338 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5340 exit 0
5344 # Figure out destination file name, if it wasn't already specified.
5345 if test -n "$destname"; then
5346 destfile="$destdir/$destname"
5347 else
5348 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5349 destfile="$destdir/$destfile"
5352 # If the file is missing, and there is a .exe on the end, strip it
5353 # because it is most likely a libtool script we actually want to
5354 # install
5355 stripped_ext=""
5356 case $file in
5357 *.exe)
5358 if test ! -f "$file"; then
5359 file=`echo $file|${SED} 's,.exe$,,'`
5360 stripped_ext=".exe"
5363 esac
5365 # Do a test to see if this is really a libtool program.
5366 case $host in
5367 *cygwin*|*mingw*)
5368 wrapper=`echo $file | ${SED} -e 's,.exe$,,'`
5371 wrapper=$file
5373 esac
5374 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5375 notinst_deplibs=
5376 relink_command=
5378 # If there is no directory component, then add one.
5379 case $file in
5380 */* | *\\*) . $wrapper ;;
5381 *) . ./$wrapper ;;
5382 esac
5384 # Check the variables that should have been set.
5385 if test -z "$notinst_deplibs"; then
5386 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5387 exit 1
5390 finalize=yes
5391 for lib in $notinst_deplibs; do
5392 # Check to see that each library is installed.
5393 libdir=
5394 if test -f "$lib"; then
5395 # If there is no directory component, then add one.
5396 case $lib in
5397 */* | *\\*) . $lib ;;
5398 *) . ./$lib ;;
5399 esac
5401 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5402 if test -n "$libdir" && test ! -f "$libfile"; then
5403 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5404 finalize=no
5406 done
5408 relink_command=
5409 # If there is no directory component, then add one.
5410 case $file in
5411 */* | *\\*) . $file ;;
5412 *) . ./$file ;;
5413 esac
5415 outputname=
5416 if test "$fast_install" = no && test -n "$relink_command"; then
5417 if test "$finalize" = yes && test -z "$run"; then
5418 tmpdir="/tmp"
5419 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5420 tmpdir="$tmpdir/libtool-$$"
5421 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
5422 else
5423 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5424 continue
5426 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5427 outputname="$tmpdir/$file"
5428 # Replace the output file specification.
5429 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5431 $show "$relink_command"
5432 if $run eval "$relink_command"; then :
5433 else
5434 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5435 ${rm}r "$tmpdir"
5436 continue
5438 file="$outputname"
5439 else
5440 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5442 else
5443 # Install the binary that we compiled earlier.
5444 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5448 # remove .exe since cygwin /usr/bin/install will append another
5449 # one anyways
5450 case $install_prog,$host in
5451 */usr/bin/install*,*cygwin*)
5452 case $file:$destfile in
5453 *.exe:*.exe)
5454 # this is ok
5456 *.exe:*)
5457 destfile=$destfile.exe
5459 *:*.exe)
5460 destfile=`echo $destfile | ${SED} -e 's,.exe$,,'`
5462 esac
5464 esac
5465 $show "$install_prog$stripme $file $destfile"
5466 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5467 test -n "$outputname" && ${rm}r "$tmpdir"
5469 esac
5470 done
5472 for file in $staticlibs; do
5473 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5475 # Set up the ranlib parameters.
5476 oldlib="$destdir/$name"
5478 $show "$install_prog $file $oldlib"
5479 $run eval "$install_prog \$file \$oldlib" || exit $?
5481 if test -n "$stripme" && test -n "$striplib"; then
5482 $show "$old_striplib $oldlib"
5483 $run eval "$old_striplib $oldlib" || exit $?
5486 # Do each command in the postinstall commands.
5487 eval cmds=\"$old_postinstall_cmds\"
5488 save_ifs="$IFS"; IFS='~'
5489 for cmd in $cmds; do
5490 IFS="$save_ifs"
5491 $show "$cmd"
5492 $run eval "$cmd" || exit $?
5493 done
5494 IFS="$save_ifs"
5495 done
5497 if test -n "$future_libdirs"; then
5498 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5501 if test -n "$current_libdirs"; then
5502 # Maybe just do a dry run.
5503 test -n "$run" && current_libdirs=" -n$current_libdirs"
5504 exec_cmd='$SHELL $0 --finish$current_libdirs'
5505 else
5506 exit 0
5510 # libtool finish mode
5511 finish)
5512 modename="$modename: finish"
5513 libdirs="$nonopt"
5514 admincmds=
5516 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5517 for dir
5519 libdirs="$libdirs $dir"
5520 done
5522 for libdir in $libdirs; do
5523 if test -n "$finish_cmds"; then
5524 # Do each command in the finish commands.
5525 eval cmds=\"$finish_cmds\"
5526 save_ifs="$IFS"; IFS='~'
5527 for cmd in $cmds; do
5528 IFS="$save_ifs"
5529 $show "$cmd"
5530 $run eval "$cmd" || admincmds="$admincmds
5531 $cmd"
5532 done
5533 IFS="$save_ifs"
5535 if test -n "$finish_eval"; then
5536 # Do the single finish_eval.
5537 eval cmds=\"$finish_eval\"
5538 $run eval "$cmds" || admincmds="$admincmds
5539 $cmds"
5541 done
5544 # Exit here if they wanted silent mode.
5545 test "$show" = : && exit 0
5547 echo "----------------------------------------------------------------------"
5548 echo "Libraries have been installed in:"
5549 for libdir in $libdirs; do
5550 echo " $libdir"
5551 done
5552 echo
5553 echo "If you ever happen to want to link against installed libraries"
5554 echo "in a given directory, LIBDIR, you must either use libtool, and"
5555 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5556 echo "flag during linking and do at least one of the following:"
5557 if test -n "$shlibpath_var"; then
5558 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5559 echo " during execution"
5561 if test -n "$runpath_var"; then
5562 echo " - add LIBDIR to the \`$runpath_var' environment variable"
5563 echo " during linking"
5565 if test -n "$hardcode_libdir_flag_spec"; then
5566 libdir=LIBDIR
5567 eval flag=\"$hardcode_libdir_flag_spec\"
5569 echo " - use the \`$flag' linker flag"
5571 if test -n "$admincmds"; then
5572 echo " - have your system administrator run these commands:$admincmds"
5574 if test -f /etc/ld.so.conf; then
5575 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5577 echo
5578 echo "See any operating system documentation about shared libraries for"
5579 echo "more information, such as the ld(1) and ld.so(8) manual pages."
5580 echo "----------------------------------------------------------------------"
5581 exit 0
5584 # libtool execute mode
5585 execute)
5586 modename="$modename: execute"
5588 # The first argument is the command name.
5589 cmd="$nonopt"
5590 if test -z "$cmd"; then
5591 $echo "$modename: you must specify a COMMAND" 1>&2
5592 $echo "$help"
5593 exit 1
5596 # Handle -dlopen flags immediately.
5597 for file in $execute_dlfiles; do
5598 if test ! -f "$file"; then
5599 $echo "$modename: \`$file' is not a file" 1>&2
5600 $echo "$help" 1>&2
5601 exit 1
5604 dir=
5605 case $file in
5606 *.la)
5607 # Check to see that this really is a libtool archive.
5608 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5609 else
5610 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5611 $echo "$help" 1>&2
5612 exit 1
5615 # Read the libtool library.
5616 dlname=
5617 library_names=
5619 # If there is no directory component, then add one.
5620 case $file in
5621 */* | *\\*) . $file ;;
5622 *) . ./$file ;;
5623 esac
5625 # Skip this library if it cannot be dlopened.
5626 if test -z "$dlname"; then
5627 # Warn if it was a shared library.
5628 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5629 continue
5632 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5633 test "X$dir" = "X$file" && dir=.
5635 if test -f "$dir/$objdir/$dlname"; then
5636 dir="$dir/$objdir"
5637 else
5638 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5639 exit 1
5643 *.lo)
5644 # Just add the directory containing the .lo file.
5645 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5646 test "X$dir" = "X$file" && dir=.
5650 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5651 continue
5653 esac
5655 # Get the absolute pathname.
5656 absdir=`cd "$dir" && pwd`
5657 test -n "$absdir" && dir="$absdir"
5659 # Now add the directory to shlibpath_var.
5660 if eval "test -z \"\$$shlibpath_var\""; then
5661 eval "$shlibpath_var=\"\$dir\""
5662 else
5663 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5665 done
5667 # This variable tells wrapper scripts just to set shlibpath_var
5668 # rather than running their programs.
5669 libtool_execute_magic="$magic"
5671 # Check if any of the arguments is a wrapper script.
5672 args=
5673 for file
5675 case $file in
5676 -*) ;;
5678 # Do a test to see if this is really a libtool program.
5679 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5680 # If there is no directory component, then add one.
5681 case $file in
5682 */* | *\\*) . $file ;;
5683 *) . ./$file ;;
5684 esac
5686 # Transform arg to wrapped name.
5687 file="$progdir/$program"
5690 esac
5691 # Quote arguments (to preserve shell metacharacters).
5692 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5693 args="$args \"$file\""
5694 done
5696 if test -z "$run"; then
5697 if test -n "$shlibpath_var"; then
5698 # Export the shlibpath_var.
5699 eval "export $shlibpath_var"
5702 # Restore saved environment variables
5703 if test "${save_LC_ALL+set}" = set; then
5704 LC_ALL="$save_LC_ALL"; export LC_ALL
5706 if test "${save_LANG+set}" = set; then
5707 LANG="$save_LANG"; export LANG
5710 # Now prepare to actually exec the command.
5711 exec_cmd="\$cmd$args"
5712 else
5713 # Display what would be done.
5714 if test -n "$shlibpath_var"; then
5715 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
5716 $echo "export $shlibpath_var"
5718 $echo "$cmd$args"
5719 exit 0
5723 # libtool clean and uninstall mode
5724 clean | uninstall)
5725 modename="$modename: $mode"
5726 rm="$nonopt"
5727 files=
5728 rmforce=
5729 exit_status=0
5731 # This variable tells wrapper scripts just to set variables rather
5732 # than running their programs.
5733 libtool_install_magic="$magic"
5735 for arg
5737 case $arg in
5738 -f) rm="$rm $arg"; rmforce=yes ;;
5739 -*) rm="$rm $arg" ;;
5740 *) files="$files $arg" ;;
5741 esac
5742 done
5744 if test -z "$rm"; then
5745 $echo "$modename: you must specify an RM program" 1>&2
5746 $echo "$help" 1>&2
5747 exit 1
5750 rmdirs=
5752 for file in $files; do
5753 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5754 if test "X$dir" = "X$file"; then
5755 dir=.
5756 objdir="$objdir"
5757 else
5758 objdir="$dir/$objdir"
5760 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5761 test "$mode" = uninstall && objdir="$dir"
5763 # Remember objdir for removal later, being careful to avoid duplicates
5764 if test "$mode" = clean; then
5765 case " $rmdirs " in
5766 *" $objdir "*) ;;
5767 *) rmdirs="$rmdirs $objdir" ;;
5768 esac
5771 # Don't error if the file doesn't exist and rm -f was used.
5772 if (test -L "$file") >/dev/null 2>&1 \
5773 || (test -h "$file") >/dev/null 2>&1 \
5774 || test -f "$file"; then
5776 elif test -d "$file"; then
5777 exit_status=1
5778 continue
5779 elif test "$rmforce" = yes; then
5780 continue
5783 rmfiles="$file"
5785 case $name in
5786 *.la)
5787 # Possibly a libtool archive, so verify it.
5788 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5789 . $dir/$name
5791 # Delete the libtool libraries and symlinks.
5792 for n in $library_names; do
5793 rmfiles="$rmfiles $objdir/$n"
5794 done
5795 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5796 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5798 if test "$mode" = uninstall; then
5799 if test -n "$library_names"; then
5800 # Do each command in the postuninstall commands.
5801 eval cmds=\"$postuninstall_cmds\"
5802 save_ifs="$IFS"; IFS='~'
5803 for cmd in $cmds; do
5804 IFS="$save_ifs"
5805 $show "$cmd"
5806 $run eval "$cmd"
5807 if test "$?" -ne 0 && test "$rmforce" != yes; then
5808 exit_status=1
5810 done
5811 IFS="$save_ifs"
5814 if test -n "$old_library"; then
5815 # Do each command in the old_postuninstall commands.
5816 eval cmds=\"$old_postuninstall_cmds\"
5817 save_ifs="$IFS"; IFS='~'
5818 for cmd in $cmds; do
5819 IFS="$save_ifs"
5820 $show "$cmd"
5821 $run eval "$cmd"
5822 if test "$?" -ne 0 && test "$rmforce" != yes; then
5823 exit_status=1
5825 done
5826 IFS="$save_ifs"
5828 # FIXME: should reinstall the best remaining shared library.
5833 *.lo)
5834 # Possibly a libtool object, so verify it.
5835 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5837 # Read the .lo file
5838 . $dir/$name
5840 # Add PIC object to the list of files to remove.
5841 if test -n "$pic_object" \
5842 && test "$pic_object" != none; then
5843 rmfiles="$rmfiles $dir/$pic_object"
5846 # Add non-PIC object to the list of files to remove.
5847 if test -n "$non_pic_object" \
5848 && test "$non_pic_object" != none; then
5849 rmfiles="$rmfiles $dir/$non_pic_object"
5855 # Do a test to see if this is a libtool program.
5856 if test "$mode" = clean &&
5857 (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5858 relink_command=
5859 . $dir/$file
5861 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5862 if test "$fast_install" = yes && test -n "$relink_command"; then
5863 rmfiles="$rmfiles $objdir/lt-$name"
5867 esac
5868 $show "$rm $rmfiles"
5869 $run $rm $rmfiles || exit_status=1
5870 done
5872 # Try to remove the ${objdir}s in the directories where we deleted files
5873 for dir in $rmdirs; do
5874 if test -d "$dir"; then
5875 $show "rmdir $dir"
5876 $run rmdir $dir >/dev/null 2>&1
5878 done
5880 exit $exit_status
5884 $echo "$modename: you must specify a MODE" 1>&2
5885 $echo "$generic_help" 1>&2
5886 exit 1
5888 esac
5890 if test -z "$exec_cmd"; then
5891 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5892 $echo "$generic_help" 1>&2
5893 exit 1
5895 fi # test -z "$show_help"
5897 if test -n "$exec_cmd"; then
5898 eval exec $exec_cmd
5899 exit 1
5902 # We need to display help for each of the modes.
5903 case $mode in
5904 "") $echo \
5905 "Usage: $modename [OPTION]... [MODE-ARG]...
5907 Provide generalized library-building support services.
5909 --config show all configuration variables
5910 --debug enable verbose shell tracing
5911 -n, --dry-run display commands without modifying any files
5912 --features display basic configuration information and exit
5913 --finish same as \`--mode=finish'
5914 --help display this help message and exit
5915 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5916 --quiet same as \`--silent'
5917 --silent don't print informational messages
5918 --tag=TAG use configuration variables from tag TAG
5919 --version print version information
5921 MODE must be one of the following:
5923 clean remove files from the build directory
5924 compile compile a source file into a libtool object
5925 execute automatically set library path, then run a program
5926 finish complete the installation of libtool libraries
5927 install install libraries or executables
5928 link create a library or an executable
5929 uninstall remove libraries from an installed directory
5931 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5932 a more detailed description of MODE."
5933 exit 0
5936 clean)
5937 $echo \
5938 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5940 Remove files from the build directory.
5942 RM is the name of the program to use to delete files associated with each FILE
5943 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5944 to RM.
5946 If FILE is a libtool library, object or program, all the files associated
5947 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5950 compile)
5951 $echo \
5952 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5954 Compile a source file into a libtool library object.
5956 This mode accepts the following additional options:
5958 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5959 -prefer-pic try to building PIC objects only
5960 -prefer-non-pic try to building non-PIC objects only
5961 -static always build a \`.o' file suitable for static linking
5963 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5964 from the given SOURCEFILE.
5966 The output file name is determined by removing the directory component from
5967 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5968 library object suffix, \`.lo'."
5971 execute)
5972 $echo \
5973 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5975 Automatically set library path, then run a program.
5977 This mode accepts the following additional options:
5979 -dlopen FILE add the directory containing FILE to the library path
5981 This mode sets the library path environment variable according to \`-dlopen'
5982 flags.
5984 If any of the ARGS are libtool executable wrappers, then they are translated
5985 into their corresponding uninstalled binary, and any of their required library
5986 directories are added to the library path.
5988 Then, COMMAND is executed, with ARGS as arguments."
5991 finish)
5992 $echo \
5993 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5995 Complete the installation of libtool libraries.
5997 Each LIBDIR is a directory that contains libtool libraries.
5999 The commands that this mode executes may require superuser privileges. Use
6000 the \`--dry-run' option if you just want to see what would be executed."
6003 install)
6004 $echo \
6005 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6007 Install executables or libraries.
6009 INSTALL-COMMAND is the installation command. The first component should be
6010 either the \`install' or \`cp' program.
6012 The rest of the components are interpreted as arguments to that command (only
6013 BSD-compatible install options are recognized)."
6016 link)
6017 $echo \
6018 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6020 Link object files or libraries together to form another library, or to
6021 create an executable program.
6023 LINK-COMMAND is a command using the C compiler that you would use to create
6024 a program from several object files.
6026 The following components of LINK-COMMAND are treated specially:
6028 -all-static do not do any dynamic linking at all
6029 -avoid-version do not add a version suffix if possible
6030 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6031 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6032 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6033 -export-symbols SYMFILE
6034 try to export only the symbols listed in SYMFILE
6035 -export-symbols-regex REGEX
6036 try to export only the symbols matching REGEX
6037 -LLIBDIR search LIBDIR for required installed libraries
6038 -lNAME OUTPUT-FILE requires the installed library libNAME
6039 -module build a library that can dlopened
6040 -no-fast-install disable the fast-install mode
6041 -no-install link a not-installable executable
6042 -no-undefined declare that a library does not refer to external symbols
6043 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6044 -objectlist FILE Use a list of object files found in FILE to specify objects
6045 -release RELEASE specify package release information
6046 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6047 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6048 -static do not do any dynamic linking of libtool libraries
6049 -version-info CURRENT[:REVISION[:AGE]]
6050 specify library version info [each variable defaults to 0]
6052 All other options (arguments beginning with \`-') are ignored.
6054 Every other argument is treated as a filename. Files ending in \`.la' are
6055 treated as uninstalled libtool libraries, other files are standard or library
6056 object files.
6058 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6059 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6060 required, except when creating a convenience library.
6062 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6063 using \`ar' and \`ranlib', or on Windows using \`lib'.
6065 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6066 is created, otherwise an executable program is created."
6069 uninstall)
6070 $echo \
6071 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6073 Remove libraries from an installation directory.
6075 RM is the name of the program to use to delete files associated with each FILE
6076 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6077 to RM.
6079 If FILE is a libtool library, all the files associated with it are deleted.
6080 Otherwise, only FILE itself is deleted using RM."
6084 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6085 $echo "$help" 1>&2
6086 exit 1
6088 esac
6090 echo
6091 $echo "Try \`$modename --help' for more information about other modes."
6093 exit 0
6095 # The TAGs below are defined such that we never get into a situation
6096 # in which we disable both kinds of libraries. Given conflicting
6097 # choices, we go for a static library, that is the most portable,
6098 # since we can't tell whether shared libraries were disabled because
6099 # the user asked for that or because the platform doesn't support
6100 # them. This is particularly important on AIX, because we don't
6101 # support having both static and shared libraries enabled at the same
6102 # time on that platform, so we default to a shared-only configuration.
6103 # If a disable-shared tag is given, we'll fallback to a static-only
6104 # configuration. But we'll never go from static-only to shared-only.
6106 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6107 build_libtool_libs=no
6108 build_old_libs=yes
6109 # ### END LIBTOOL TAG CONFIG: disable-shared
6111 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6112 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
6113 # ### END LIBTOOL TAG CONFIG: disable-static
6115 # Local Variables:
6116 # mode:shell-script
6117 # sh-indentation:2
6118 # End:
6119 # ### BEGIN LIBTOOL TAG CONFIG: CXX
6121 # Libtool was configured on host du216771:
6123 # Shell to use when invoking shell scripts.
6124 SHELL="/bin/sh"
6126 # Whether or not to build shared libraries.
6127 build_libtool_libs=no
6129 # Whether or not to build static libraries.
6130 build_old_libs=yes
6132 # Whether or not to add -lc for building shared libraries.
6133 build_libtool_need_lc=yes
6135 # Whether or not to disallow shared libs when runtime libs are static
6136 allow_libtool_libs_with_static_runtimes=no
6138 # Whether or not to optimize for fast installation.
6139 fast_install=needless
6141 # The host system.
6142 host_alias=
6143 host=i686-pc-msys
6145 # An echo program that does not interpret backslashes.
6146 echo="echo"
6148 # The archiver.
6149 AR="ar"
6150 AR_FLAGS="cru"
6152 # A C compiler.
6153 LTCC="gcc"
6155 # A language-specific compiler.
6156 CC="g++"
6158 # Is the compiler the GNU C compiler?
6159 with_gcc=yes
6161 # An ERE matcher.
6162 EGREP="grep -E"
6164 # The linker used to build libraries.
6165 LD="/usr/msys/bin/ld.exe"
6167 # Whether we need hard or soft links.
6168 LN_S="ln -s"
6170 # A BSD-compatible nm program.
6171 NM="/bin/nm -B"
6173 # A sed program that does not truncate output.
6174 SED="/bin/sed"
6176 # A symbol stripping program
6177 STRIP=strip
6179 # Used to examine libraries when file_magic_cmd begins "file"
6180 MAGIC_CMD=file
6182 # Used on cygwin: DLL creation program.
6183 DLLTOOL="dlltool"
6185 # Used on cygwin: object dumper.
6186 OBJDUMP="objdump"
6188 # Used on cygwin: assembler.
6189 AS="as"
6191 # The name of the directory that contains temporary libtool files.
6192 objdir=.libs
6194 # How to create reloadable object files.
6195 reload_flag=" -r"
6196 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
6198 # How to pass a linker flag through the compiler.
6199 wl="-Wl,"
6201 # Object file suffix (normally "o").
6202 objext="o"
6204 # Old archive suffix (normally "a").
6205 libext="a"
6207 # Executable file suffix (normally "").
6208 exeext=""
6210 # Additional compiler flags for building library objects.
6211 pic_flag=" -DPIC"
6212 pic_mode=default
6214 # What is the maximum length of a command?
6215 max_cmd_len=262144
6217 # Does compiler simultaneously support -c and -o options?
6218 compiler_c_o="yes"
6220 # Must we lock files when doing compilation ?
6221 need_locks="no"
6223 # Do we need the lib prefix for modules?
6224 need_lib_prefix=unknown
6226 # Do we need a version for libraries?
6227 need_version=unknown
6229 # Whether dlopen is supported.
6230 dlopen_support=yes
6232 # Whether dlopen of programs is supported.
6233 dlopen_self=no
6235 # Whether dlopen of statically linked programs is supported.
6236 dlopen_self_static=unknown
6238 # Compiler flag to prevent dynamic linking.
6239 link_static_flag="-static"
6241 # Compiler flag to turn off builtin functions.
6242 no_builtin_flag=" -fno-builtin"
6244 # Compiler flag to allow reflexive dlopens.
6245 export_dynamic_flag_spec="\${wl}--export-dynamic"
6247 # Compiler flag to generate shared objects directly from archives.
6248 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
6250 # Compiler flag to generate thread-safe objects.
6251 thread_safe_flag_spec=""
6253 # Library versioning type.
6254 version_type=none
6256 # Format of library name prefix.
6257 libname_spec="lib\$name"
6259 # List of archive names. First name is the real one, the rest are links.
6260 # The last name is the one that the linker finds with -lNAME.
6261 library_names_spec=""
6263 # The coded name of the library, if different from the real name.
6264 soname_spec=""
6266 # Commands used to build and install an old-style archive.
6267 RANLIB="ranlib"
6268 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
6269 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
6270 old_postuninstall_cmds=""
6272 # Create an old-style archive from a shared archive.
6273 old_archive_from_new_cmds=""
6275 # Create a temporary old-style archive to link instead of a shared archive.
6276 old_archive_from_expsyms_cmds=""
6278 # Commands used to build and install a shared archive.
6279 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
6280 archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
6281 postinstall_cmds=""
6282 postuninstall_cmds=""
6284 # Commands to strip libraries.
6285 old_striplib="strip --strip-debug"
6286 striplib="strip --strip-unneeded"
6288 # Dependencies to place before the objects being linked to create a
6289 # shared library.
6290 predep_objects=""
6292 # Dependencies to place after the objects being linked to create a
6293 # shared library.
6294 postdep_objects=""
6296 # Dependencies to place before the objects being linked to create a
6297 # shared library.
6298 predeps=""
6300 # Dependencies to place after the objects being linked to create a
6301 # shared library.
6302 postdeps="-lstdc++ -lgcc -lmsys-1.0 -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc"
6304 # The library search path used internally by the compiler when linking
6305 # a shared library.
6306 compiler_lib_search_path="-L/usr/lib -L/usr/lib -L/usr/lib/w32api -L/bin/../lib/gcc-lib/msys/2.95.3-1 -L/bin/../lib/gcc-lib -L/usr/lib/gcc-lib/msys/2.95.3-1 -L/bin/../lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib -L/usr/lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib"
6308 # Method to check whether dependent libraries are shared objects.
6309 deplibs_check_method="unknown"
6311 # Command to use when deplibs_check_method == file_magic.
6312 file_magic_cmd="\$MAGIC_CMD"
6314 # Flag that allows shared libraries with undefined symbols to be built.
6315 allow_undefined_flag=""
6317 # Flag that forces no undefined symbols.
6318 no_undefined_flag=""
6320 # Commands used to finish a libtool library installation in a directory.
6321 finish_cmds=""
6323 # Same as above, but a single script fragment to be evaled but not shown.
6324 finish_eval=""
6326 # Take the output of nm and produce a listing of raw symbols and C names.
6327 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(_\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
6329 # Transform the output of nm in a proper C declaration
6330 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
6332 # Transform the output of nm in a C name address pair
6333 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
6335 # This is the shared library runtime path variable.
6336 runpath_var=LD_RUN_PATH
6338 # This is the shared library path variable.
6339 shlibpath_var=
6341 # Is shlibpath searched before the hard-coded library search path?
6342 shlibpath_overrides_runpath=unknown
6344 # How to hardcode a shared library path into an executable.
6345 hardcode_action=immediate
6347 # Whether we should hardcode library paths into libraries.
6348 hardcode_into_libs=no
6350 # Flag to hardcode $libdir into a binary during linking.
6351 # This must work even if $libdir does not exist.
6352 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
6354 # Whether we need a single -rpath flag with a separated argument.
6355 hardcode_libdir_separator=""
6357 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
6358 # resulting binary.
6359 hardcode_direct=no
6361 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
6362 # resulting binary.
6363 hardcode_minus_L=no
6365 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
6366 # the resulting binary.
6367 hardcode_shlibpath_var=
6369 # Variables whose values should be saved in libtool wrapper scripts and
6370 # restored at relink time.
6371 variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6373 # Whether libtool must link a program against all its dependency libraries.
6374 link_all_deplibs=unknown
6376 # Compile-time system search path for libraries
6377 sys_lib_search_path_spec=" /bin/../lib/gcc-lib/msys/2.95.3-1/ /bin/../lib/gcc-lib/ /usr/lib/gcc-lib/msys/2.95.3-1/ /usr/lib/gcc/msys/2.95.3-1/ /bin/../lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib/msys/2.95.3-1/ /bin/../lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib/ /usr/lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib/msys/2.95.3-1/ /usr/lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib/"
6379 # Run-time system search path for libraries
6380 sys_lib_dlsearch_path_spec="/lib /usr/lib"
6382 # Fix the shell variable $srcfile for the compiler.
6383 fix_srcfile_path=""
6385 # Set to yes if exported symbols are required.
6386 always_export_symbols=no
6388 # The commands to list exported symbols.
6389 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
6391 # The commands to extract the exported symbol list from a shared archive.
6392 extract_expsyms_cmds=""
6394 # Symbols that should not be listed in the preloaded symbols.
6395 exclude_expsyms=""
6397 # Symbols that must always be exported.
6398 include_expsyms=""
6400 # ### END LIBTOOL TAG CONFIG: CXX
6402 # ### BEGIN LIBTOOL TAG CONFIG: F77
6404 # Libtool was configured on host du216771:
6406 # Shell to use when invoking shell scripts.
6407 SHELL="/bin/sh"
6409 # Whether or not to build shared libraries.
6410 build_libtool_libs=no
6412 # Whether or not to build static libraries.
6413 build_old_libs=yes
6415 # Whether or not to add -lc for building shared libraries.
6416 build_libtool_need_lc=yes
6418 # Whether or not to disallow shared libs when runtime libs are static
6419 allow_libtool_libs_with_static_runtimes=no
6421 # Whether or not to optimize for fast installation.
6422 fast_install=needless
6424 # The host system.
6425 host_alias=
6426 host=i686-pc-msys
6428 # An echo program that does not interpret backslashes.
6429 echo="echo"
6431 # The archiver.
6432 AR="ar"
6433 AR_FLAGS="cru"
6435 # A C compiler.
6436 LTCC="gcc"
6438 # A language-specific compiler.
6439 CC="g77"
6441 # Is the compiler the GNU C compiler?
6442 with_gcc=yes
6444 # An ERE matcher.
6445 EGREP="grep -E"
6447 # The linker used to build libraries.
6448 LD="/usr/msys/bin/ld.exe"
6450 # Whether we need hard or soft links.
6451 LN_S="ln -s"
6453 # A BSD-compatible nm program.
6454 NM="/bin/nm -B"
6456 # A sed program that does not truncate output.
6457 SED="/bin/sed"
6459 # A symbol stripping program
6460 STRIP=strip
6462 # Used to examine libraries when file_magic_cmd begins "file"
6463 MAGIC_CMD=file
6465 # Used on cygwin: DLL creation program.
6466 DLLTOOL="dlltool"
6468 # Used on cygwin: object dumper.
6469 OBJDUMP="objdump"
6471 # Used on cygwin: assembler.
6472 AS="as"
6474 # The name of the directory that contains temporary libtool files.
6475 objdir=.libs
6477 # How to create reloadable object files.
6478 reload_flag=" -r"
6479 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
6481 # How to pass a linker flag through the compiler.
6482 wl="-Wl,"
6484 # Object file suffix (normally "o").
6485 objext="o"
6487 # Old archive suffix (normally "a").
6488 libext="a"
6490 # Executable file suffix (normally "").
6491 exeext=""
6493 # Additional compiler flags for building library objects.
6494 pic_flag=" -DPIC"
6495 pic_mode=default
6497 # What is the maximum length of a command?
6498 max_cmd_len=262144
6500 # Does compiler simultaneously support -c and -o options?
6501 compiler_c_o="yes"
6503 # Must we lock files when doing compilation ?
6504 need_locks="no"
6506 # Do we need the lib prefix for modules?
6507 need_lib_prefix=unknown
6509 # Do we need a version for libraries?
6510 need_version=unknown
6512 # Whether dlopen is supported.
6513 dlopen_support=yes
6515 # Whether dlopen of programs is supported.
6516 dlopen_self=no
6518 # Whether dlopen of statically linked programs is supported.
6519 dlopen_self_static=unknown
6521 # Compiler flag to prevent dynamic linking.
6522 link_static_flag="-static"
6524 # Compiler flag to turn off builtin functions.
6525 no_builtin_flag=""
6527 # Compiler flag to allow reflexive dlopens.
6528 export_dynamic_flag_spec="\${wl}--export-dynamic"
6530 # Compiler flag to generate shared objects directly from archives.
6531 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
6533 # Compiler flag to generate thread-safe objects.
6534 thread_safe_flag_spec=""
6536 # Library versioning type.
6537 version_type=none
6539 # Format of library name prefix.
6540 libname_spec="lib\$name"
6542 # List of archive names. First name is the real one, the rest are links.
6543 # The last name is the one that the linker finds with -lNAME.
6544 library_names_spec=""
6546 # The coded name of the library, if different from the real name.
6547 soname_spec=""
6549 # Commands used to build and install an old-style archive.
6550 RANLIB="ranlib"
6551 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
6552 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
6553 old_postuninstall_cmds=""
6555 # Create an old-style archive from a shared archive.
6556 old_archive_from_new_cmds=""
6558 # Create a temporary old-style archive to link instead of a shared archive.
6559 old_archive_from_expsyms_cmds=""
6561 # Commands used to build and install a shared archive.
6562 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
6563 archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
6564 postinstall_cmds=""
6565 postuninstall_cmds=""
6567 # Commands to strip libraries.
6568 old_striplib="strip --strip-debug"
6569 striplib="strip --strip-unneeded"
6571 # Dependencies to place before the objects being linked to create a
6572 # shared library.
6573 predep_objects=""
6575 # Dependencies to place after the objects being linked to create a
6576 # shared library.
6577 postdep_objects=""
6579 # Dependencies to place before the objects being linked to create a
6580 # shared library.
6581 predeps=""
6583 # Dependencies to place after the objects being linked to create a
6584 # shared library.
6585 postdeps=""
6587 # The library search path used internally by the compiler when linking
6588 # a shared library.
6589 compiler_lib_search_path=""
6591 # Method to check whether dependent libraries are shared objects.
6592 deplibs_check_method="unknown"
6594 # Command to use when deplibs_check_method == file_magic.
6595 file_magic_cmd="\$MAGIC_CMD"
6597 # Flag that allows shared libraries with undefined symbols to be built.
6598 allow_undefined_flag=""
6600 # Flag that forces no undefined symbols.
6601 no_undefined_flag=""
6603 # Commands used to finish a libtool library installation in a directory.
6604 finish_cmds=""
6606 # Same as above, but a single script fragment to be evaled but not shown.
6607 finish_eval=""
6609 # Take the output of nm and produce a listing of raw symbols and C names.
6610 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(_\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
6612 # Transform the output of nm in a proper C declaration
6613 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
6615 # Transform the output of nm in a C name address pair
6616 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
6618 # This is the shared library runtime path variable.
6619 runpath_var=LD_RUN_PATH
6621 # This is the shared library path variable.
6622 shlibpath_var=
6624 # Is shlibpath searched before the hard-coded library search path?
6625 shlibpath_overrides_runpath=unknown
6627 # How to hardcode a shared library path into an executable.
6628 hardcode_action=immediate
6630 # Whether we should hardcode library paths into libraries.
6631 hardcode_into_libs=no
6633 # Flag to hardcode $libdir into a binary during linking.
6634 # This must work even if $libdir does not exist.
6635 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
6637 # Whether we need a single -rpath flag with a separated argument.
6638 hardcode_libdir_separator=""
6640 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
6641 # resulting binary.
6642 hardcode_direct=no
6644 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
6645 # resulting binary.
6646 hardcode_minus_L=no
6648 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
6649 # the resulting binary.
6650 hardcode_shlibpath_var=unsupported
6652 # Variables whose values should be saved in libtool wrapper scripts and
6653 # restored at relink time.
6654 variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6656 # Whether libtool must link a program against all its dependency libraries.
6657 link_all_deplibs=unknown
6659 # Compile-time system search path for libraries
6660 sys_lib_search_path_spec=" /bin/../lib/gcc-lib/msys/2.95.3-1/ /bin/../lib/gcc-lib/ /usr/lib/gcc-lib/msys/2.95.3-1/ /usr/lib/gcc/msys/2.95.3-1/ /bin/../lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib/msys/2.95.3-1/ /bin/../lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib/ /usr/lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib/msys/2.95.3-1/ /usr/lib/gcc-lib/msys/2.95.3-1/../../../../msys/lib/"
6662 # Run-time system search path for libraries
6663 sys_lib_dlsearch_path_spec="/lib /usr/lib"
6665 # Fix the shell variable $srcfile for the compiler.
6666 fix_srcfile_path=""
6668 # Set to yes if exported symbols are required.
6669 always_export_symbols=no
6671 # The commands to list exported symbols.
6672 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
6674 # The commands to extract the exported symbol list from a shared archive.
6675 extract_expsyms_cmds=""
6677 # Symbols that should not be listed in the preloaded symbols.
6678 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
6680 # Symbols that must always be exported.
6681 include_expsyms=""
6683 # ### END LIBTOOL TAG CONFIG: F77
6685 # ### BEGIN LIBTOOL TAG CONFIG: GCJ
6687 # Libtool was configured on host du216771:
6689 # Shell to use when invoking shell scripts.
6690 SHELL="/bin/sh"
6692 # Whether or not to build shared libraries.
6693 build_libtool_libs=no
6695 # Whether or not to build static libraries.
6696 build_old_libs=yes
6698 # Whether or not to add -lc for building shared libraries.
6699 build_libtool_need_lc=yes
6701 # Whether or not to disallow shared libs when runtime libs are static
6702 allow_libtool_libs_with_static_runtimes=no
6704 # Whether or not to optimize for fast installation.
6705 fast_install=needless
6707 # The host system.
6708 host_alias=
6709 host=i686-pc-msys
6711 # An echo program that does not interpret backslashes.
6712 echo="echo"
6714 # The archiver.
6715 AR="ar"
6716 AR_FLAGS="cru"
6718 # A C compiler.
6719 LTCC="gcc"
6721 # A language-specific compiler.
6722 CC="no"
6724 # Is the compiler the GNU C compiler?
6725 with_gcc=
6727 # An ERE matcher.
6728 EGREP="grep -E"
6730 # The linker used to build libraries.
6731 LD=""
6733 # Whether we need hard or soft links.
6734 LN_S="ln -s"
6736 # A BSD-compatible nm program.
6737 NM="/bin/nm -B"
6739 # A sed program that does not truncate output.
6740 SED="/bin/sed"
6742 # A symbol stripping program
6743 STRIP=strip
6745 # Used to examine libraries when file_magic_cmd begins "file"
6746 MAGIC_CMD=file
6748 # Used on cygwin: DLL creation program.
6749 DLLTOOL="dlltool"
6751 # Used on cygwin: object dumper.
6752 OBJDUMP="objdump"
6754 # Used on cygwin: assembler.
6755 AS="as"
6757 # The name of the directory that contains temporary libtool files.
6758 objdir=.libs
6760 # How to create reloadable object files.
6761 reload_flag=" -r"
6762 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
6764 # How to pass a linker flag through the compiler.
6765 wl="-Wl,"
6767 # Object file suffix (normally "o").
6768 objext="o"
6770 # Old archive suffix (normally "a").
6771 libext="a"
6773 # Executable file suffix (normally "").
6774 exeext=""
6776 # Additional compiler flags for building library objects.
6777 pic_flag=""
6778 pic_mode=default
6780 # What is the maximum length of a command?
6781 max_cmd_len=262144
6783 # Does compiler simultaneously support -c and -o options?
6784 compiler_c_o="no"
6786 # Must we lock files when doing compilation ?
6787 need_locks="no"
6789 # Do we need the lib prefix for modules?
6790 need_lib_prefix=unknown
6792 # Do we need a version for libraries?
6793 need_version=unknown
6795 # Whether dlopen is supported.
6796 dlopen_support=yes
6798 # Whether dlopen of programs is supported.
6799 dlopen_self=no
6801 # Whether dlopen of statically linked programs is supported.
6802 dlopen_self_static=unknown
6804 # Compiler flag to prevent dynamic linking.
6805 link_static_flag="-static"
6807 # Compiler flag to turn off builtin functions.
6808 no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
6810 # Compiler flag to allow reflexive dlopens.
6811 export_dynamic_flag_spec="\${wl}--export-dynamic"
6813 # Compiler flag to generate shared objects directly from archives.
6814 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
6816 # Compiler flag to generate thread-safe objects.
6817 thread_safe_flag_spec=""
6819 # Library versioning type.
6820 version_type=none
6822 # Format of library name prefix.
6823 libname_spec="lib\$name"
6825 # List of archive names. First name is the real one, the rest are links.
6826 # The last name is the one that the linker finds with -lNAME.
6827 library_names_spec=""
6829 # The coded name of the library, if different from the real name.
6830 soname_spec=""
6832 # Commands used to build and install an old-style archive.
6833 RANLIB="ranlib"
6834 old_archive_cmds=""
6835 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
6836 old_postuninstall_cmds=""
6838 # Create an old-style archive from a shared archive.
6839 old_archive_from_new_cmds=""
6841 # Create a temporary old-style archive to link instead of a shared archive.
6842 old_archive_from_expsyms_cmds=""
6844 # Commands used to build and install a shared archive.
6845 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
6846 archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
6847 postinstall_cmds=""
6848 postuninstall_cmds=""
6850 # Commands to strip libraries.
6851 old_striplib="strip --strip-debug"
6852 striplib="strip --strip-unneeded"
6854 # Dependencies to place before the objects being linked to create a
6855 # shared library.
6856 predep_objects=""
6858 # Dependencies to place after the objects being linked to create a
6859 # shared library.
6860 postdep_objects=""
6862 # Dependencies to place before the objects being linked to create a
6863 # shared library.
6864 predeps=""
6866 # Dependencies to place after the objects being linked to create a
6867 # shared library.
6868 postdeps=""
6870 # The library search path used internally by the compiler when linking
6871 # a shared library.
6872 compiler_lib_search_path=""
6874 # Method to check whether dependent libraries are shared objects.
6875 deplibs_check_method="unknown"
6877 # Command to use when deplibs_check_method == file_magic.
6878 file_magic_cmd="\$MAGIC_CMD"
6880 # Flag that allows shared libraries with undefined symbols to be built.
6881 allow_undefined_flag=""
6883 # Flag that forces no undefined symbols.
6884 no_undefined_flag=""
6886 # Commands used to finish a libtool library installation in a directory.
6887 finish_cmds=""
6889 # Same as above, but a single script fragment to be evaled but not shown.
6890 finish_eval=""
6892 # Take the output of nm and produce a listing of raw symbols and C names.
6893 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(_\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
6895 # Transform the output of nm in a proper C declaration
6896 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
6898 # Transform the output of nm in a C name address pair
6899 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
6901 # This is the shared library runtime path variable.
6902 runpath_var=LD_RUN_PATH
6904 # This is the shared library path variable.
6905 shlibpath_var=
6907 # Is shlibpath searched before the hard-coded library search path?
6908 shlibpath_overrides_runpath=unknown
6910 # How to hardcode a shared library path into an executable.
6911 hardcode_action=immediate
6913 # Whether we should hardcode library paths into libraries.
6914 hardcode_into_libs=no
6916 # Flag to hardcode $libdir into a binary during linking.
6917 # This must work even if $libdir does not exist.
6918 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
6920 # Whether we need a single -rpath flag with a separated argument.
6921 hardcode_libdir_separator=""
6923 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
6924 # resulting binary.
6925 hardcode_direct=no
6927 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
6928 # resulting binary.
6929 hardcode_minus_L=no
6931 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
6932 # the resulting binary.
6933 hardcode_shlibpath_var=unsupported
6935 # Variables whose values should be saved in libtool wrapper scripts and
6936 # restored at relink time.
6937 variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
6939 # Whether libtool must link a program against all its dependency libraries.
6940 link_all_deplibs=unknown
6942 # Compile-time system search path for libraries
6943 sys_lib_search_path_spec=""
6945 # Run-time system search path for libraries
6946 sys_lib_dlsearch_path_spec="/lib /usr/lib"
6948 # Fix the shell variable $srcfile for the compiler.
6949 fix_srcfile_path=""
6951 # Set to yes if exported symbols are required.
6952 always_export_symbols=no
6954 # The commands to list exported symbols.
6955 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
6957 # The commands to extract the exported symbol list from a shared archive.
6958 extract_expsyms_cmds=""
6960 # Symbols that should not be listed in the preloaded symbols.
6961 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
6963 # Symbols that must always be exported.
6964 include_expsyms=""
6966 # ### END LIBTOOL TAG CONFIG: GCJ