missing project/build files
[client-tools.git] / src / external / 3rd / library / libxml / libtool
blobf885d95ae495859c8097550f84f8a05f7e72ceb4
1 #! /bin/sh
3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by (GNU libxml2 2.4.28)
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
7 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
8 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 # General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 # As a special exception to the GNU General Public License, if you
25 # distribute this file as part of a program that contains a
26 # configuration script generated by Autoconf, you may include it under
27 # the same distribution terms that you use for the rest of that program.
29 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
30 Xsed="sed -e s/^X//"
32 # The HP-UX ksh and POSIX shell print the target directory to stdout
33 # if CDPATH is set.
34 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
36 # ### BEGIN LIBTOOL CONFIG
38 # Libtool was configured on host lin-msivertson.station.sony.com:
40 # Shell to use when invoking shell scripts.
41 SHELL="/bin/sh"
43 # Whether or not to build shared libraries.
44 build_libtool_libs=yes
46 # Whether or not to build static libraries.
47 build_old_libs=yes
49 # Whether or not to add -lc for building shared libraries.
50 build_libtool_need_lc=no
52 # Whether or not to optimize for fast installation.
53 fast_install=yes
55 # The host system.
56 host_alias=
57 host=i686-pc-linux-gnu
59 # An echo program that does not interpret backslashes.
60 echo="echo"
62 # The archiver.
63 AR="ar"
64 AR_FLAGS="cru"
66 # The default C compiler.
67 CC="gcc"
69 # Is the compiler the GNU C compiler?
70 with_gcc=yes
72 # The linker used to build libraries.
73 LD="/usr/bin/ld"
75 # Whether we need hard or soft links.
76 LN_S="ln -s"
78 # A BSD-compatible nm program.
79 NM="/usr/bin/nm -B"
81 # A symbol stripping program
82 STRIP=strip
84 # Used to examine libraries when file_magic_cmd begins "file"
85 MAGIC_CMD=file
87 # Used on cygwin: DLL creation program.
88 DLLTOOL="dlltool"
90 # Used on cygwin: object dumper.
91 OBJDUMP="objdump"
93 # Used on cygwin: assembler.
94 AS="as"
96 # The name of the directory that contains temporary libtool files.
97 objdir=.libs
99 # How to create reloadable object files.
100 reload_flag=" -r"
101 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
103 # How to pass a linker flag through the compiler.
104 wl="-Wl,"
106 # Object file suffix (normally "o").
107 objext="o"
109 # Old archive suffix (normally "a").
110 libext="a"
112 # Executable file suffix (normally "").
113 exeext=""
115 # Additional compiler flags for building library objects.
116 pic_flag=" -fPIC"
117 pic_mode=default
119 # Does compiler simultaneously support -c and -o options?
120 compiler_c_o="yes"
122 # Can we write directly to a .lo ?
123 compiler_o_lo="yes"
125 # Must we lock files when doing compilation ?
126 need_locks="no"
128 # Do we need the lib prefix for modules?
129 need_lib_prefix=no
131 # Do we need a version for libraries?
132 need_version=no
134 # Whether dlopen is supported.
135 dlopen_support=unknown
137 # Whether dlopen of programs is supported.
138 dlopen_self=unknown
140 # Whether dlopen of statically linked programs is supported.
141 dlopen_self_static=unknown
143 # Compiler flag to prevent dynamic linking.
144 link_static_flag="-static"
146 # Compiler flag to turn off builtin functions.
147 no_builtin_flag=" -fno-builtin"
149 # Compiler flag to allow reflexive dlopens.
150 export_dynamic_flag_spec="\${wl}--export-dynamic"
152 # Compiler flag to generate shared objects directly from archives.
153 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
155 # Compiler flag to generate thread-safe objects.
156 thread_safe_flag_spec=""
158 # Library versioning type.
159 version_type=linux
161 # Format of library name prefix.
162 libname_spec="lib\$name"
164 # List of archive names. First name is the real one, the rest are links.
165 # The last name is the one that the linker finds with -lNAME.
166 library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
168 # The coded name of the library, if different from the real name.
169 soname_spec="\${libname}\${release}.so\$major"
171 # Commands used to build and install an old-style archive.
172 RANLIB="ranlib"
173 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
174 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
175 old_postuninstall_cmds=""
177 # Create an old-style archive from a shared archive.
178 old_archive_from_new_cmds=""
180 # Create a temporary old-style archive to link instead of a shared archive.
181 old_archive_from_expsyms_cmds=""
183 # Commands used to build and install a shared archive.
184 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
185 archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
186 postinstall_cmds=""
187 postuninstall_cmds=""
189 # Commands to strip libraries.
190 old_striplib="strip --strip-debug"
191 striplib="strip --strip-unneeded"
193 # Method to check whether dependent libraries are shared objects.
194 deplibs_check_method="pass_all"
196 # Command to use when deplibs_check_method == file_magic.
197 file_magic_cmd="\$MAGIC_CMD"
199 # Flag that allows shared libraries with undefined symbols to be built.
200 allow_undefined_flag=""
202 # Flag that forces no undefined symbols.
203 no_undefined_flag=""
205 # Commands used to finish a libtool library installation in a directory.
206 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
208 # Same as above, but a single script fragment to be evaled but not shown.
209 finish_eval=""
211 # Take the output of nm and produce a listing of raw symbols and C names.
212 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW][ABCDGISTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
214 # Transform the output of nm in a proper C declaration
215 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
217 # Transform the output of nm in a C name address pair
218 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
220 # This is the shared library runtime path variable.
221 runpath_var=LD_RUN_PATH
223 # This is the shared library path variable.
224 shlibpath_var=LD_LIBRARY_PATH
226 # Is shlibpath searched before the hard-coded library search path?
227 shlibpath_overrides_runpath=no
229 # How to hardcode a shared library path into an executable.
230 hardcode_action=immediate
232 # Whether we should hardcode library paths into libraries.
233 hardcode_into_libs=yes
235 # Flag to hardcode $libdir into a binary during linking.
236 # This must work even if $libdir does not exist.
237 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
239 # Whether we need a single -rpath flag with a separated argument.
240 hardcode_libdir_separator=""
242 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
243 # resulting binary.
244 hardcode_direct=no
246 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
247 # resulting binary.
248 hardcode_minus_L=no
250 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
251 # the resulting binary.
252 hardcode_shlibpath_var=unsupported
254 # Variables whose values should be saved in libtool wrapper scripts and
255 # restored at relink time.
256 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
258 # Whether libtool must link a program against all its dependency libraries.
259 link_all_deplibs=unknown
261 # Compile-time system search path for libraries
262 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
264 # Run-time system search path for libraries
265 sys_lib_dlsearch_path_spec="/lib /usr/lib"
267 # Fix the shell variable $srcfile for the compiler.
268 fix_srcfile_path=""
270 # Set to yes if exported symbols are required.
271 always_export_symbols=no
273 # The commands to list exported symbols.
274 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
276 # The commands to extract the exported symbol list from a shared archive.
277 extract_expsyms_cmds=""
279 # Symbols that should not be listed in the preloaded symbols.
280 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
282 # Symbols that must always be exported.
283 include_expsyms=""
285 # ### END LIBTOOL CONFIG
287 # ltmain.sh - Provide generalized library-building support services.
288 # NOTE: Changing this file will not affect anything until you rerun configure.
290 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
291 # Free Software Foundation, Inc.
292 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
294 # This program is free software; you can redistribute it and/or modify
295 # it under the terms of the GNU General Public License as published by
296 # the Free Software Foundation; either version 2 of the License, or
297 # (at your option) any later version.
299 # This program is distributed in the hope that it will be useful, but
300 # WITHOUT ANY WARRANTY; without even the implied warranty of
301 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
302 # General Public License for more details.
304 # You should have received a copy of the GNU General Public License
305 # along with this program; if not, write to the Free Software
306 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
308 # As a special exception to the GNU General Public License, if you
309 # distribute this file as part of a program that contains a
310 # configuration script generated by Autoconf, you may include it under
311 # the same distribution terms that you use for the rest of that program.
313 # Check that we have a working $echo.
314 if test "X$1" = X--no-reexec; then
315 # Discard the --no-reexec flag, and continue.
316 shift
317 elif test "X$1" = X--fallback-echo; then
318 # Avoid inline document here, it may be left over
320 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
321 # Yippee, $echo works!
323 else
324 # Restart under the correct shell, and then maybe $echo will work.
325 exec $SHELL "$0" --no-reexec ${1+"$@"}
328 if test "X$1" = X--fallback-echo; then
329 # used as fallback echo
330 shift
331 cat <<EOF
334 exit 0
337 # The name of this program.
338 progname=`$echo "$0" | sed 's%^.*/%%'`
339 modename="$progname"
341 # Constants.
342 PROGRAM=ltmain.sh
343 PACKAGE=libtool
344 VERSION=1.4.2
345 TIMESTAMP=" (1.922.2.54 2001/09/11 03:33:37)"
347 default_mode=
348 help="Try \`$progname --help' for more information."
349 magic="%%%MAGIC variable%%%"
350 mkdir="mkdir"
351 mv="mv -f"
352 rm="rm -f"
354 # Sed substitution that helps us do robust quoting. It backslashifies
355 # metacharacters that are still active within double-quoted strings.
356 Xsed='sed -e 1s/^X//'
357 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
358 SP2NL='tr \040 \012'
359 NL2SP='tr \015\012 \040\040'
361 # NLS nuisances.
362 # Only set LANG and LC_ALL to C if already set.
363 # These must not be set unconditionally because not all systems understand
364 # e.g. LANG=C (notably SCO).
365 # We save the old values to restore during execute mode.
366 if test "${LC_ALL+set}" = set; then
367 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
369 if test "${LANG+set}" = set; then
370 save_LANG="$LANG"; LANG=C; export LANG
373 # Make sure IFS has a sensible default
374 : ${IFS=" "}
376 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
377 echo "$modename: not configured to build any kind of library" 1>&2
378 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
379 exit 1
382 # Global variables.
383 mode=$default_mode
384 nonopt=
385 prev=
386 prevopt=
387 run=
388 show="$echo"
389 show_help=
390 execute_dlfiles=
391 lo2o="s/\\.lo\$/.${objext}/"
392 o2lo="s/\\.${objext}\$/.lo/"
394 # Parse our command line options once, thoroughly.
395 while test $# -gt 0
397 arg="$1"
398 shift
400 case $arg in
401 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
402 *) optarg= ;;
403 esac
405 # If the previous option needs an argument, assign it.
406 if test -n "$prev"; then
407 case $prev in
408 execute_dlfiles)
409 execute_dlfiles="$execute_dlfiles $arg"
412 eval "$prev=\$arg"
414 esac
416 prev=
417 prevopt=
418 continue
421 # Have we seen a non-optional argument yet?
422 case $arg in
423 --help)
424 show_help=yes
427 --version)
428 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
429 exit 0
432 --config)
433 sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
434 exit 0
437 --debug)
438 echo "$progname: enabling shell trace mode"
439 set -x
442 --dry-run | -n)
443 run=:
446 --features)
447 echo "host: $host"
448 if test "$build_libtool_libs" = yes; then
449 echo "enable shared libraries"
450 else
451 echo "disable shared libraries"
453 if test "$build_old_libs" = yes; then
454 echo "enable static libraries"
455 else
456 echo "disable static libraries"
458 exit 0
461 --finish) mode="finish" ;;
463 --mode) prevopt="--mode" prev=mode ;;
464 --mode=*) mode="$optarg" ;;
466 --preserve-dup-deps) duplicate_deps="yes" ;;
468 --quiet | --silent)
469 show=:
472 -dlopen)
473 prevopt="-dlopen"
474 prev=execute_dlfiles
478 $echo "$modename: unrecognized option \`$arg'" 1>&2
479 $echo "$help" 1>&2
480 exit 1
484 nonopt="$arg"
485 break
487 esac
488 done
490 if test -n "$prevopt"; then
491 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
492 $echo "$help" 1>&2
493 exit 1
496 # If this variable is set in any of the actions, the command in it
497 # will be execed at the end. This prevents here-documents from being
498 # left over by shells.
499 exec_cmd=
501 if test -z "$show_help"; then
503 # Infer the operation mode.
504 if test -z "$mode"; then
505 case $nonopt in
506 *cc | *++ | gcc* | *-gcc*)
507 mode=link
508 for arg
510 case $arg in
512 mode=compile
513 break
515 esac
516 done
518 *db | *dbx | *strace | *truss)
519 mode=execute
521 *install*|cp|mv)
522 mode=install
524 *rm)
525 mode=uninstall
528 # If we have no mode, but dlfiles were specified, then do execute mode.
529 test -n "$execute_dlfiles" && mode=execute
531 # Just use the default operation mode.
532 if test -z "$mode"; then
533 if test -n "$nonopt"; then
534 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
535 else
536 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
540 esac
543 # Only execute mode is allowed to have -dlopen flags.
544 if test -n "$execute_dlfiles" && test "$mode" != execute; then
545 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
546 $echo "$help" 1>&2
547 exit 1
550 # Change the help message to a mode-specific one.
551 generic_help="$help"
552 help="Try \`$modename --help --mode=$mode' for more information."
554 # These modes are in order of execution frequency so that they run quickly.
555 case $mode in
556 # libtool compile mode
557 compile)
558 modename="$modename: compile"
559 # Get the compilation command and the source file.
560 base_compile=
561 prev=
562 lastarg=
563 srcfile="$nonopt"
564 suppress_output=
566 user_target=no
567 for arg
569 case $prev in
570 "") ;;
571 xcompiler)
572 # Aesthetically quote the previous argument.
573 prev=
574 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
576 case $arg in
577 # Double-quote args containing other shell metacharacters.
578 # Many Bourne shells cannot handle close brackets correctly
579 # in scan sets, so we specify it separately.
580 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
581 arg="\"$arg\""
583 esac
585 # Add the previous argument to base_compile.
586 if test -z "$base_compile"; then
587 base_compile="$lastarg"
588 else
589 base_compile="$base_compile $lastarg"
591 continue
593 esac
595 # Accept any command-line options.
596 case $arg in
598 if test "$user_target" != "no"; then
599 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
600 exit 1
602 user_target=next
605 -static)
606 build_old_libs=yes
607 continue
610 -prefer-pic)
611 pic_mode=yes
612 continue
615 -prefer-non-pic)
616 pic_mode=no
617 continue
620 -Xcompiler)
621 prev=xcompiler
622 continue
625 -Wc,*)
626 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
627 lastarg=
628 save_ifs="$IFS"; IFS=','
629 for arg in $args; do
630 IFS="$save_ifs"
632 # Double-quote args containing other shell metacharacters.
633 # Many Bourne shells cannot handle close brackets correctly
634 # in scan sets, so we specify it separately.
635 case $arg in
636 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
637 arg="\"$arg\""
639 esac
640 lastarg="$lastarg $arg"
641 done
642 IFS="$save_ifs"
643 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
645 # Add the arguments to base_compile.
646 if test -z "$base_compile"; then
647 base_compile="$lastarg"
648 else
649 base_compile="$base_compile $lastarg"
651 continue
653 esac
655 case $user_target in
656 next)
657 # The next one is the -o target name
658 user_target=yes
659 continue
661 yes)
662 # We got the output file
663 user_target=set
664 libobj="$arg"
665 continue
667 esac
669 # Accept the current argument as the source file.
670 lastarg="$srcfile"
671 srcfile="$arg"
673 # Aesthetically quote the previous argument.
675 # Backslashify any backslashes, double quotes, and dollar signs.
676 # These are the only characters that are still specially
677 # interpreted inside of double-quoted scrings.
678 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
680 # Double-quote args containing other shell metacharacters.
681 # Many Bourne shells cannot handle close brackets correctly
682 # in scan sets, so we specify it separately.
683 case $lastarg in
684 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
685 lastarg="\"$lastarg\""
687 esac
689 # Add the previous argument to base_compile.
690 if test -z "$base_compile"; then
691 base_compile="$lastarg"
692 else
693 base_compile="$base_compile $lastarg"
695 done
697 case $user_target in
698 set)
701 # Get the name of the library object.
702 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
705 $echo "$modename: you must specify a target with \`-o'" 1>&2
706 exit 1
708 esac
710 # Recognize several different file suffixes.
711 # If the user specifies -o file.o, it is replaced with file.lo
712 xform='[cCFSfmso]'
713 case $libobj in
714 *.ada) xform=ada ;;
715 *.adb) xform=adb ;;
716 *.ads) xform=ads ;;
717 *.asm) xform=asm ;;
718 *.c++) xform=c++ ;;
719 *.cc) xform=cc ;;
720 *.cpp) xform=cpp ;;
721 *.cxx) xform=cxx ;;
722 *.f90) xform=f90 ;;
723 *.for) xform=for ;;
724 esac
726 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
728 case $libobj in
729 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
731 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
732 exit 1
734 esac
736 if test -z "$base_compile"; then
737 $echo "$modename: you must specify a compilation command" 1>&2
738 $echo "$help" 1>&2
739 exit 1
742 # Delete any leftover library objects.
743 if test "$build_old_libs" = yes; then
744 removelist="$obj $libobj"
745 else
746 removelist="$libobj"
749 $run $rm $removelist
750 trap "$run $rm $removelist; exit 1" 1 2 15
752 # On Cygwin there's no "real" PIC flag so we must build both object types
753 case $host_os in
754 cygwin* | mingw* | pw32* | os2*)
755 pic_mode=default
757 esac
758 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
759 # non-PIC code in shared libraries is not supported
760 pic_mode=default
763 # Calculate the filename of the output object if compiler does
764 # not support -o with -c
765 if test "$compiler_c_o" = no; then
766 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
767 lockfile="$output_obj.lock"
768 removelist="$removelist $output_obj $lockfile"
769 trap "$run $rm $removelist; exit 1" 1 2 15
770 else
771 need_locks=no
772 lockfile=
775 # Lock this critical section if it is needed
776 # We use this script file to make the link, it avoids creating a new file
777 if test "$need_locks" = yes; then
778 until $run ln "$0" "$lockfile" 2>/dev/null; do
779 $show "Waiting for $lockfile to be removed"
780 sleep 2
781 done
782 elif test "$need_locks" = warn; then
783 if test -f "$lockfile"; then
784 echo "\
785 *** ERROR, $lockfile exists and contains:
786 `cat $lockfile 2>/dev/null`
788 This indicates that another process is trying to use the same
789 temporary object file, and libtool could not work around it because
790 your compiler does not support \`-c' and \`-o' together. If you
791 repeat this compilation, it may succeed, by chance, but you had better
792 avoid parallel builds (make -j) in this platform, or get a better
793 compiler."
795 $run $rm $removelist
796 exit 1
798 echo $srcfile > "$lockfile"
801 if test -n "$fix_srcfile_path"; then
802 eval srcfile=\"$fix_srcfile_path\"
805 # Only build a PIC object if we are building libtool libraries.
806 if test "$build_libtool_libs" = yes; then
807 # Without this assignment, base_compile gets emptied.
808 fbsd_hideous_sh_bug=$base_compile
810 if test "$pic_mode" != no; then
811 # All platforms use -DPIC, to notify preprocessed assembler code.
812 command="$base_compile $srcfile $pic_flag -DPIC"
813 else
814 # Don't build PIC code
815 command="$base_compile $srcfile"
817 if test "$build_old_libs" = yes; then
818 lo_libobj="$libobj"
819 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
820 if test "X$dir" = "X$libobj"; then
821 dir="$objdir"
822 else
823 dir="$dir/$objdir"
825 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
827 if test -d "$dir"; then
828 $show "$rm $libobj"
829 $run $rm $libobj
830 else
831 $show "$mkdir $dir"
832 $run $mkdir $dir
833 status=$?
834 if test $status -ne 0 && test ! -d $dir; then
835 exit $status
839 if test "$compiler_o_lo" = yes; then
840 output_obj="$libobj"
841 command="$command -o $output_obj"
842 elif test "$compiler_c_o" = yes; then
843 output_obj="$obj"
844 command="$command -o $output_obj"
847 $run $rm "$output_obj"
848 $show "$command"
849 if $run eval "$command"; then :
850 else
851 test -n "$output_obj" && $run $rm $removelist
852 exit 1
855 if test "$need_locks" = warn &&
856 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
857 echo "\
858 *** ERROR, $lockfile contains:
859 `cat $lockfile 2>/dev/null`
861 but it should contain:
862 $srcfile
864 This indicates that another process is trying to use the same
865 temporary object file, and libtool could not work around it because
866 your compiler does not support \`-c' and \`-o' together. If you
867 repeat this compilation, it may succeed, by chance, but you had better
868 avoid parallel builds (make -j) in this platform, or get a better
869 compiler."
871 $run $rm $removelist
872 exit 1
875 # Just move the object if needed, then go on to compile the next one
876 if test x"$output_obj" != x"$libobj"; then
877 $show "$mv $output_obj $libobj"
878 if $run $mv $output_obj $libobj; then :
879 else
880 error=$?
881 $run $rm $removelist
882 exit $error
886 # If we have no pic_flag, then copy the object into place and finish.
887 if (test -z "$pic_flag" || test "$pic_mode" != default) &&
888 test "$build_old_libs" = yes; then
889 # Rename the .lo from within objdir to obj
890 if test -f $obj; then
891 $show $rm $obj
892 $run $rm $obj
895 $show "$mv $libobj $obj"
896 if $run $mv $libobj $obj; then :
897 else
898 error=$?
899 $run $rm $removelist
900 exit $error
903 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
904 if test "X$xdir" = "X$obj"; then
905 xdir="."
906 else
907 xdir="$xdir"
909 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
910 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
911 # Now arrange that obj and lo_libobj become the same file
912 $show "(cd $xdir && $LN_S $baseobj $libobj)"
913 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
914 # Unlock the critical section if it was locked
915 if test "$need_locks" != no; then
916 $run $rm "$lockfile"
918 exit 0
919 else
920 error=$?
921 $run $rm $removelist
922 exit $error
926 # Allow error messages only from the first compilation.
927 suppress_output=' >/dev/null 2>&1'
930 # Only build a position-dependent object if we build old libraries.
931 if test "$build_old_libs" = yes; then
932 if test "$pic_mode" != yes; then
933 # Don't build PIC code
934 command="$base_compile $srcfile"
935 else
936 # All platforms use -DPIC, to notify preprocessed assembler code.
937 command="$base_compile $srcfile $pic_flag -DPIC"
939 if test "$compiler_c_o" = yes; then
940 command="$command -o $obj"
941 output_obj="$obj"
944 # Suppress compiler output if we already did a PIC compilation.
945 command="$command$suppress_output"
946 $run $rm "$output_obj"
947 $show "$command"
948 if $run eval "$command"; then :
949 else
950 $run $rm $removelist
951 exit 1
954 if test "$need_locks" = warn &&
955 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
956 echo "\
957 *** ERROR, $lockfile contains:
958 `cat $lockfile 2>/dev/null`
960 but it should contain:
961 $srcfile
963 This indicates that another process is trying to use the same
964 temporary object file, and libtool could not work around it because
965 your compiler does not support \`-c' and \`-o' together. If you
966 repeat this compilation, it may succeed, by chance, but you had better
967 avoid parallel builds (make -j) in this platform, or get a better
968 compiler."
970 $run $rm $removelist
971 exit 1
974 # Just move the object if needed
975 if test x"$output_obj" != x"$obj"; then
976 $show "$mv $output_obj $obj"
977 if $run $mv $output_obj $obj; then :
978 else
979 error=$?
980 $run $rm $removelist
981 exit $error
985 # Create an invalid libtool object if no PIC, so that we do not
986 # accidentally link it into a program.
987 if test "$build_libtool_libs" != yes; then
988 $show "echo timestamp > $libobj"
989 $run eval "echo timestamp > \$libobj" || exit $?
990 else
991 # Move the .lo from within objdir
992 $show "$mv $libobj $lo_libobj"
993 if $run $mv $libobj $lo_libobj; then :
994 else
995 error=$?
996 $run $rm $removelist
997 exit $error
1002 # Unlock the critical section if it was locked
1003 if test "$need_locks" != no; then
1004 $run $rm "$lockfile"
1007 exit 0
1010 # libtool link mode
1011 link | relink)
1012 modename="$modename: link"
1013 case $host in
1014 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1015 # It is impossible to link a dll without this setting, and
1016 # we shouldn't force the makefile maintainer to figure out
1017 # which system we are compiling for in order to pass an extra
1018 # flag for every libtool invokation.
1019 # allow_undefined=no
1021 # FIXME: Unfortunately, there are problems with the above when trying
1022 # to make a dll which has undefined symbols, in which case not
1023 # even a static library is built. For now, we need to specify
1024 # -no-undefined on the libtool link line when we can be certain
1025 # that all symbols are satisfied, otherwise we get a static library.
1026 allow_undefined=yes
1029 allow_undefined=yes
1031 esac
1032 libtool_args="$nonopt"
1033 compile_command="$nonopt"
1034 finalize_command="$nonopt"
1036 compile_rpath=
1037 finalize_rpath=
1038 compile_shlibpath=
1039 finalize_shlibpath=
1040 convenience=
1041 old_convenience=
1042 deplibs=
1043 old_deplibs=
1044 compiler_flags=
1045 linker_flags=
1046 dllsearchpath=
1047 lib_search_path=`pwd`
1048 inst_prefix_dir=
1050 avoid_version=no
1051 dlfiles=
1052 dlprefiles=
1053 dlself=no
1054 export_dynamic=no
1055 export_symbols=
1056 export_symbols_regex=
1057 generated=
1058 libobjs=
1059 ltlibs=
1060 module=no
1061 no_install=no
1062 objs=
1063 prefer_static_libs=no
1064 preload=no
1065 prev=
1066 prevarg=
1067 release=
1068 rpath=
1069 xrpath=
1070 perm_rpath=
1071 temp_rpath=
1072 thread_safe=no
1073 vinfo=
1075 # We need to know -static, to get the right output filenames.
1076 for arg
1078 case $arg in
1079 -all-static | -static)
1080 if test "X$arg" = "X-all-static"; then
1081 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1082 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1084 if test -n "$link_static_flag"; then
1085 dlopen_self=$dlopen_self_static
1087 else
1088 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1089 dlopen_self=$dlopen_self_static
1092 build_libtool_libs=no
1093 build_old_libs=yes
1094 prefer_static_libs=yes
1095 break
1097 esac
1098 done
1100 # See if our shared archives depend on static archives.
1101 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1103 # Go through the arguments, transforming them on the way.
1104 while test $# -gt 0; do
1105 arg="$1"
1106 shift
1107 case $arg in
1108 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1109 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1111 *) qarg=$arg ;;
1112 esac
1113 libtool_args="$libtool_args $qarg"
1115 # If the previous option needs an argument, assign it.
1116 if test -n "$prev"; then
1117 case $prev in
1118 output)
1119 compile_command="$compile_command @OUTPUT@"
1120 finalize_command="$finalize_command @OUTPUT@"
1122 esac
1124 case $prev in
1125 dlfiles|dlprefiles)
1126 if test "$preload" = no; then
1127 # Add the symbol object into the linking commands.
1128 compile_command="$compile_command @SYMFILE@"
1129 finalize_command="$finalize_command @SYMFILE@"
1130 preload=yes
1132 case $arg in
1133 *.la | *.lo) ;; # We handle these cases below.
1134 force)
1135 if test "$dlself" = no; then
1136 dlself=needless
1137 export_dynamic=yes
1139 prev=
1140 continue
1142 self)
1143 if test "$prev" = dlprefiles; then
1144 dlself=yes
1145 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1146 dlself=yes
1147 else
1148 dlself=needless
1149 export_dynamic=yes
1151 prev=
1152 continue
1155 if test "$prev" = dlfiles; then
1156 dlfiles="$dlfiles $arg"
1157 else
1158 dlprefiles="$dlprefiles $arg"
1160 prev=
1161 continue
1163 esac
1165 expsyms)
1166 export_symbols="$arg"
1167 if test ! -f "$arg"; then
1168 $echo "$modename: symbol file \`$arg' does not exist"
1169 exit 1
1171 prev=
1172 continue
1174 expsyms_regex)
1175 export_symbols_regex="$arg"
1176 prev=
1177 continue
1179 inst_prefix)
1180 inst_prefix_dir="$arg"
1181 prev=
1182 continue
1184 release)
1185 release="-$arg"
1186 prev=
1187 continue
1189 rpath | xrpath)
1190 # We need an absolute path.
1191 case $arg in
1192 [\\/]* | [A-Za-z]:[\\/]*) ;;
1194 $echo "$modename: only absolute run-paths are allowed" 1>&2
1195 exit 1
1197 esac
1198 if test "$prev" = rpath; then
1199 case "$rpath " in
1200 *" $arg "*) ;;
1201 *) rpath="$rpath $arg" ;;
1202 esac
1203 else
1204 case "$xrpath " in
1205 *" $arg "*) ;;
1206 *) xrpath="$xrpath $arg" ;;
1207 esac
1209 prev=
1210 continue
1212 xcompiler)
1213 compiler_flags="$compiler_flags $qarg"
1214 prev=
1215 compile_command="$compile_command $qarg"
1216 finalize_command="$finalize_command $qarg"
1217 continue
1219 xlinker)
1220 linker_flags="$linker_flags $qarg"
1221 compiler_flags="$compiler_flags $wl$qarg"
1222 prev=
1223 compile_command="$compile_command $wl$qarg"
1224 finalize_command="$finalize_command $wl$qarg"
1225 continue
1228 eval "$prev=\"\$arg\""
1229 prev=
1230 continue
1232 esac
1233 fi # test -n $prev
1235 prevarg="$arg"
1237 case $arg in
1238 -all-static)
1239 if test -n "$link_static_flag"; then
1240 compile_command="$compile_command $link_static_flag"
1241 finalize_command="$finalize_command $link_static_flag"
1243 continue
1246 -allow-undefined)
1247 # FIXME: remove this flag sometime in the future.
1248 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1249 continue
1252 -avoid-version)
1253 avoid_version=yes
1254 continue
1257 -dlopen)
1258 prev=dlfiles
1259 continue
1262 -dlpreopen)
1263 prev=dlprefiles
1264 continue
1267 -export-dynamic)
1268 export_dynamic=yes
1269 continue
1272 -export-symbols | -export-symbols-regex)
1273 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1274 $echo "$modename: more than one -exported-symbols argument is not allowed"
1275 exit 1
1277 if test "X$arg" = "X-export-symbols"; then
1278 prev=expsyms
1279 else
1280 prev=expsyms_regex
1282 continue
1285 -inst-prefix-dir)
1286 prev=inst_prefix
1287 continue
1290 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1291 # so, if we see these flags be careful not to treat them like -L
1292 -L[A-Z][A-Z]*:*)
1293 case $with_gcc/$host in
1294 no/*-*-irix*)
1295 compile_command="$compile_command $arg"
1296 finalize_command="$finalize_command $arg"
1298 esac
1299 continue
1302 -L*)
1303 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1304 # We need an absolute path.
1305 case $dir in
1306 [\\/]* | [A-Za-z]:[\\/]*) ;;
1308 absdir=`cd "$dir" && pwd`
1309 if test -z "$absdir"; then
1310 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1311 exit 1
1313 dir="$absdir"
1315 esac
1316 case "$deplibs " in
1317 *" -L$dir "*) ;;
1319 deplibs="$deplibs -L$dir"
1320 lib_search_path="$lib_search_path $dir"
1322 esac
1323 case $host in
1324 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1325 case :$dllsearchpath: in
1326 *":$dir:"*) ;;
1327 *) dllsearchpath="$dllsearchpath:$dir";;
1328 esac
1330 esac
1331 continue
1334 -l*)
1335 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1336 case $host in
1337 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1338 # These systems don't actually have a C or math library (as such)
1339 continue
1341 *-*-mingw* | *-*-os2*)
1342 # These systems don't actually have a C library (as such)
1343 test "X$arg" = "X-lc" && continue
1345 *-*-openbsd*)
1346 # Do not include libc due to us having libc/libc_r.
1347 test "X$arg" = "X-lc" && continue
1349 esac
1350 elif test "X$arg" = "X-lc_r"; then
1351 case $host in
1352 *-*-openbsd*)
1353 # Do not include libc_r directly, use -pthread flag.
1354 continue
1356 esac
1358 deplibs="$deplibs $arg"
1359 continue
1362 -module)
1363 module=yes
1364 continue
1367 -no-fast-install)
1368 fast_install=no
1369 continue
1372 -no-install)
1373 case $host in
1374 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1375 # The PATH hackery in wrapper scripts is required on Windows
1376 # in order for the loader to find any dlls it needs.
1377 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1378 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1379 fast_install=no
1381 *) no_install=yes ;;
1382 esac
1383 continue
1386 -no-undefined)
1387 allow_undefined=no
1388 continue
1391 -o) prev=output ;;
1393 -release)
1394 prev=release
1395 continue
1398 -rpath)
1399 prev=rpath
1400 continue
1404 prev=xrpath
1405 continue
1408 -R*)
1409 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1410 # We need an absolute path.
1411 case $dir in
1412 [\\/]* | [A-Za-z]:[\\/]*) ;;
1414 $echo "$modename: only absolute run-paths are allowed" 1>&2
1415 exit 1
1417 esac
1418 case "$xrpath " in
1419 *" $dir "*) ;;
1420 *) xrpath="$xrpath $dir" ;;
1421 esac
1422 continue
1425 -static)
1426 # The effects of -static are defined in a previous loop.
1427 # We used to do the same as -all-static on platforms that
1428 # didn't have a PIC flag, but the assumption that the effects
1429 # would be equivalent was wrong. It would break on at least
1430 # Digital Unix and AIX.
1431 continue
1434 -thread-safe)
1435 thread_safe=yes
1436 continue
1439 -version-info)
1440 prev=vinfo
1441 continue
1444 -Wc,*)
1445 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1446 arg=
1447 save_ifs="$IFS"; IFS=','
1448 for flag in $args; do
1449 IFS="$save_ifs"
1450 case $flag in
1451 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1452 flag="\"$flag\""
1454 esac
1455 arg="$arg $wl$flag"
1456 compiler_flags="$compiler_flags $flag"
1457 done
1458 IFS="$save_ifs"
1459 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1462 -Wl,*)
1463 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1464 arg=
1465 save_ifs="$IFS"; IFS=','
1466 for flag in $args; do
1467 IFS="$save_ifs"
1468 case $flag in
1469 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1470 flag="\"$flag\""
1472 esac
1473 arg="$arg $wl$flag"
1474 compiler_flags="$compiler_flags $wl$flag"
1475 linker_flags="$linker_flags $flag"
1476 done
1477 IFS="$save_ifs"
1478 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1481 -Xcompiler)
1482 prev=xcompiler
1483 continue
1486 -Xlinker)
1487 prev=xlinker
1488 continue
1491 # Some other compiler flag.
1492 -* | +*)
1493 # Unknown arguments in both finalize_command and compile_command need
1494 # to be aesthetically quoted because they are evaled later.
1495 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1496 case $arg in
1497 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1498 arg="\"$arg\""
1500 esac
1503 *.lo | *.$objext)
1504 # A library or standard object.
1505 if test "$prev" = dlfiles; then
1506 # This file was specified with -dlopen.
1507 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1508 dlfiles="$dlfiles $arg"
1509 prev=
1510 continue
1511 else
1512 # If libtool objects are unsupported, then we need to preload.
1513 prev=dlprefiles
1517 if test "$prev" = dlprefiles; then
1518 # Preload the old-style object.
1519 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1520 prev=
1521 else
1522 case $arg in
1523 *.lo) libobjs="$libobjs $arg" ;;
1524 *) objs="$objs $arg" ;;
1525 esac
1529 *.$libext)
1530 # An archive.
1531 deplibs="$deplibs $arg"
1532 old_deplibs="$old_deplibs $arg"
1533 continue
1536 *.la)
1537 # A libtool-controlled library.
1539 if test "$prev" = dlfiles; then
1540 # This library was specified with -dlopen.
1541 dlfiles="$dlfiles $arg"
1542 prev=
1543 elif test "$prev" = dlprefiles; then
1544 # The library was specified with -dlpreopen.
1545 dlprefiles="$dlprefiles $arg"
1546 prev=
1547 else
1548 deplibs="$deplibs $arg"
1550 continue
1553 # Some other compiler argument.
1555 # Unknown arguments in both finalize_command and compile_command need
1556 # to be aesthetically quoted because they are evaled later.
1557 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1558 case $arg in
1559 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1560 arg="\"$arg\""
1562 esac
1564 esac # arg
1566 # Now actually substitute the argument into the commands.
1567 if test -n "$arg"; then
1568 compile_command="$compile_command $arg"
1569 finalize_command="$finalize_command $arg"
1571 done # argument parsing loop
1573 if test -n "$prev"; then
1574 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1575 $echo "$help" 1>&2
1576 exit 1
1579 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1580 eval arg=\"$export_dynamic_flag_spec\"
1581 compile_command="$compile_command $arg"
1582 finalize_command="$finalize_command $arg"
1585 # calculate the name of the file, without its directory
1586 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1587 libobjs_save="$libobjs"
1589 if test -n "$shlibpath_var"; then
1590 # get the directories listed in $shlibpath_var
1591 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1592 else
1593 shlib_search_path=
1595 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1596 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1598 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1599 if test "X$output_objdir" = "X$output"; then
1600 output_objdir="$objdir"
1601 else
1602 output_objdir="$output_objdir/$objdir"
1604 # Create the object directory.
1605 if test ! -d "$output_objdir"; then
1606 $show "$mkdir $output_objdir"
1607 $run $mkdir $output_objdir
1608 status=$?
1609 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1610 exit $status
1614 # Determine the type of output
1615 case $output in
1617 $echo "$modename: you must specify an output file" 1>&2
1618 $echo "$help" 1>&2
1619 exit 1
1621 *.$libext) linkmode=oldlib ;;
1622 *.lo | *.$objext) linkmode=obj ;;
1623 *.la) linkmode=lib ;;
1624 *) linkmode=prog ;; # Anything else should be a program.
1625 esac
1627 specialdeplibs=
1628 libs=
1629 # Find all interdependent deplibs by searching for libraries
1630 # that are linked more than once (e.g. -la -lb -la)
1631 for deplib in $deplibs; do
1632 if test "X$duplicate_deps" = "Xyes" ; then
1633 case "$libs " in
1634 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1635 esac
1637 libs="$libs $deplib"
1638 done
1640 if test "$linkmode" = lib; then
1641 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1643 # Compute libraries that are listed more than once in $predeps
1644 # $postdeps and mark them as special (i.e., whose duplicates are
1645 # not to be eliminated).
1646 pre_post_deps=
1647 if test "X$duplicate_deps" = "Xyes" ; then
1648 for pre_post_dep in $predeps $postdeps; do
1649 case "$pre_post_deps " in
1650 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1651 esac
1652 pre_post_deps="$pre_post_deps $pre_post_dep"
1653 done
1655 pre_post_deps=
1658 deplibs=
1659 newdependency_libs=
1660 newlib_search_path=
1661 need_relink=no # whether we're linking any uninstalled libtool libraries
1662 notinst_deplibs= # not-installed libtool libraries
1663 notinst_path= # paths that contain not-installed libtool libraries
1664 case $linkmode in
1665 lib)
1666 passes="conv link"
1667 for file in $dlfiles $dlprefiles; do
1668 case $file in
1669 *.la) ;;
1671 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1672 exit 1
1674 esac
1675 done
1677 prog)
1678 compile_deplibs=
1679 finalize_deplibs=
1680 alldeplibs=no
1681 newdlfiles=
1682 newdlprefiles=
1683 passes="conv scan dlopen dlpreopen link"
1685 *) passes="conv"
1687 esac
1688 for pass in $passes; do
1689 if test "$linkmode" = prog; then
1690 # Determine which files to process
1691 case $pass in
1692 dlopen)
1693 libs="$dlfiles"
1694 save_deplibs="$deplibs" # Collect dlpreopened libraries
1695 deplibs=
1697 dlpreopen) libs="$dlprefiles" ;;
1698 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1699 esac
1701 for deplib in $libs; do
1702 lib=
1703 found=no
1704 case $deplib in
1705 -l*)
1706 if test "$linkmode" = oldlib && test "$linkmode" = obj; then
1707 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1708 continue
1710 if test "$pass" = conv; then
1711 deplibs="$deplib $deplibs"
1712 continue
1714 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1715 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1716 # Search the libtool library
1717 lib="$searchdir/lib${name}.la"
1718 if test -f "$lib"; then
1719 found=yes
1720 break
1722 done
1723 if test "$found" != yes; then
1724 # deplib doesn't seem to be a libtool library
1725 if test "$linkmode,$pass" = "prog,link"; then
1726 compile_deplibs="$deplib $compile_deplibs"
1727 finalize_deplibs="$deplib $finalize_deplibs"
1728 else
1729 deplibs="$deplib $deplibs"
1730 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
1732 continue
1734 ;; # -l
1735 -L*)
1736 case $linkmode in
1737 lib)
1738 deplibs="$deplib $deplibs"
1739 test "$pass" = conv && continue
1740 newdependency_libs="$deplib $newdependency_libs"
1741 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1743 prog)
1744 if test "$pass" = conv; then
1745 deplibs="$deplib $deplibs"
1746 continue
1748 if test "$pass" = scan; then
1749 deplibs="$deplib $deplibs"
1750 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1751 else
1752 compile_deplibs="$deplib $compile_deplibs"
1753 finalize_deplibs="$deplib $finalize_deplibs"
1757 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1759 esac # linkmode
1760 continue
1761 ;; # -L
1762 -R*)
1763 if test "$pass" = link; then
1764 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1765 # Make sure the xrpath contains only unique directories.
1766 case "$xrpath " in
1767 *" $dir "*) ;;
1768 *) xrpath="$xrpath $dir" ;;
1769 esac
1771 deplibs="$deplib $deplibs"
1772 continue
1774 *.la) lib="$deplib" ;;
1775 *.$libext)
1776 if test "$pass" = conv; then
1777 deplibs="$deplib $deplibs"
1778 continue
1780 case $linkmode in
1781 lib)
1782 if test "$deplibs_check_method" != pass_all; then
1783 echo
1784 echo "*** Warning: This library needs some functionality provided by $deplib."
1785 echo "*** I have the capability to make that library automatically link in when"
1786 echo "*** you link to this library. But I can only do this if you have a"
1787 echo "*** shared version of the library, which you do not appear to have."
1788 else
1789 echo
1790 echo "*** Warning: Linking the shared library $output against the"
1791 echo "*** static library $deplib is not portable!"
1792 deplibs="$deplib $deplibs"
1794 continue
1796 prog)
1797 if test "$pass" != link; then
1798 deplibs="$deplib $deplibs"
1799 else
1800 compile_deplibs="$deplib $compile_deplibs"
1801 finalize_deplibs="$deplib $finalize_deplibs"
1803 continue
1805 esac # linkmode
1806 ;; # *.$libext
1807 *.lo | *.$objext)
1808 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1809 # If there is no dlopen support or we're linking statically,
1810 # we need to preload.
1811 newdlprefiles="$newdlprefiles $deplib"
1812 compile_deplibs="$deplib $compile_deplibs"
1813 finalize_deplibs="$deplib $finalize_deplibs"
1814 else
1815 newdlfiles="$newdlfiles $deplib"
1817 continue
1819 %DEPLIBS%)
1820 alldeplibs=yes
1821 continue
1823 esac # case $deplib
1824 if test "$found" = yes || test -f "$lib"; then :
1825 else
1826 $echo "$modename: cannot find the library \`$lib'" 1>&2
1827 exit 1
1830 # Check to see that this really is a libtool archive.
1831 if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1832 else
1833 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1834 exit 1
1837 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1838 test "X$ladir" = "X$lib" && ladir="."
1840 dlname=
1841 dlopen=
1842 dlpreopen=
1843 libdir=
1844 library_names=
1845 old_library=
1846 # If the library was installed with an old release of libtool,
1847 # it will not redefine variable installed.
1848 installed=yes
1850 # Read the .la file
1851 case $lib in
1852 */* | *\\*) . $lib ;;
1853 *) . ./$lib ;;
1854 esac
1856 if test "$linkmode,$pass" = "lib,link" ||
1857 test "$linkmode,$pass" = "prog,scan" ||
1858 { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then
1859 # Add dl[pre]opened files of deplib
1860 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1861 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1864 if test "$pass" = conv; then
1865 # Only check for convenience libraries
1866 deplibs="$lib $deplibs"
1867 if test -z "$libdir"; then
1868 if test -z "$old_library"; then
1869 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1870 exit 1
1872 # It is a libtool convenience library, so add in its objects.
1873 convenience="$convenience $ladir/$objdir/$old_library"
1874 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1875 tmp_libs=
1876 for deplib in $dependency_libs; do
1877 deplibs="$deplib $deplibs"
1878 if test "X$duplicate_deps" = "Xyes" ; then
1879 case "$tmp_libs " in
1880 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1881 esac
1883 tmp_libs="$tmp_libs $deplib"
1884 done
1885 elif test "$linkmode" != prog && test "$linkmode" != lib; then
1886 $echo "$modename: \`$lib' is not a convenience library" 1>&2
1887 exit 1
1889 continue
1890 fi # $pass = conv
1892 # Get the name of the library we link against.
1893 linklib=
1894 for l in $old_library $library_names; do
1895 linklib="$l"
1896 done
1897 if test -z "$linklib"; then
1898 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1899 exit 1
1902 # This library was specified with -dlopen.
1903 if test "$pass" = dlopen; then
1904 if test -z "$libdir"; then
1905 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
1906 exit 1
1908 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1909 # If there is no dlname, no dlopen support or we're linking
1910 # statically, we need to preload.
1911 dlprefiles="$dlprefiles $lib"
1912 else
1913 newdlfiles="$newdlfiles $lib"
1915 continue
1916 fi # $pass = dlopen
1918 # We need an absolute path.
1919 case $ladir in
1920 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1922 abs_ladir=`cd "$ladir" && pwd`
1923 if test -z "$abs_ladir"; then
1924 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1925 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1926 abs_ladir="$ladir"
1929 esac
1930 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1932 # Find the relevant object directory and library name.
1933 if test "X$installed" = Xyes; then
1934 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1935 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1936 dir="$ladir"
1937 absdir="$abs_ladir"
1938 libdir="$abs_ladir"
1939 else
1940 dir="$libdir"
1941 absdir="$libdir"
1943 else
1944 dir="$ladir/$objdir"
1945 absdir="$abs_ladir/$objdir"
1946 # Remove this search path later
1947 notinst_path="$notinst_path $abs_ladir"
1948 fi # $installed = yes
1949 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1951 # This library was specified with -dlpreopen.
1952 if test "$pass" = dlpreopen; then
1953 if test -z "$libdir"; then
1954 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
1955 exit 1
1957 # Prefer using a static library (so that no silly _DYNAMIC symbols
1958 # are required to link).
1959 if test -n "$old_library"; then
1960 newdlprefiles="$newdlprefiles $dir/$old_library"
1961 # Otherwise, use the dlname, so that lt_dlopen finds it.
1962 elif test -n "$dlname"; then
1963 newdlprefiles="$newdlprefiles $dir/$dlname"
1964 else
1965 newdlprefiles="$newdlprefiles $dir/$linklib"
1967 fi # $pass = dlpreopen
1969 if test -z "$libdir"; then
1970 # Link the convenience library
1971 if test "$linkmode" = lib; then
1972 deplibs="$dir/$old_library $deplibs"
1973 elif test "$linkmode,$pass" = "prog,link"; then
1974 compile_deplibs="$dir/$old_library $compile_deplibs"
1975 finalize_deplibs="$dir/$old_library $finalize_deplibs"
1976 else
1977 deplibs="$lib $deplibs"
1979 continue
1982 if test "$linkmode" = prog && test "$pass" != link; then
1983 newlib_search_path="$newlib_search_path $ladir"
1984 deplibs="$lib $deplibs"
1986 linkalldeplibs=no
1987 if test "$link_all_deplibs" != no || test -z "$library_names" ||
1988 test "$build_libtool_libs" = no; then
1989 linkalldeplibs=yes
1992 tmp_libs=
1993 for deplib in $dependency_libs; do
1994 case $deplib in
1995 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1996 esac
1997 # Need to link against all dependency_libs?
1998 if test "$linkalldeplibs" = yes; then
1999 deplibs="$deplib $deplibs"
2000 else
2001 # Need to hardcode shared library paths
2002 # or/and link against static libraries
2003 newdependency_libs="$deplib $newdependency_libs"
2005 if test "X$duplicate_deps" = "Xyes" ; then
2006 case "$tmp_libs " in
2007 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2008 esac
2010 tmp_libs="$tmp_libs $deplib"
2011 done # for deplib
2012 continue
2013 fi # $linkmode = prog...
2015 link_static=no # Whether the deplib will be linked statically
2016 if test -n "$library_names" &&
2017 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2018 # Link against this shared library
2020 if test "$linkmode,$pass" = "prog,link" ||
2021 { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then
2022 # Hardcode the library path.
2023 # Skip directories that are in the system default run-time
2024 # search path.
2025 case " $sys_lib_dlsearch_path " in
2026 *" $absdir "*) ;;
2028 case "$compile_rpath " in
2029 *" $absdir "*) ;;
2030 *) compile_rpath="$compile_rpath $absdir"
2031 esac
2033 esac
2034 case " $sys_lib_dlsearch_path " in
2035 *" $libdir "*) ;;
2037 case "$finalize_rpath " in
2038 *" $libdir "*) ;;
2039 *) finalize_rpath="$finalize_rpath $libdir"
2040 esac
2042 esac
2043 if test "$linkmode" = prog; then
2044 # We need to hardcode the library path
2045 if test -n "$shlibpath_var"; then
2046 # Make sure the rpath contains only unique directories.
2047 case "$temp_rpath " in
2048 *" $dir "*) ;;
2049 *" $absdir "*) ;;
2050 *) temp_rpath="$temp_rpath $dir" ;;
2051 esac
2054 fi # $linkmode,$pass = prog,link...
2056 if test "$alldeplibs" = yes &&
2057 { test "$deplibs_check_method" = pass_all ||
2058 { test "$build_libtool_libs" = yes &&
2059 test -n "$library_names"; }; }; then
2060 # We only need to search for static libraries
2061 continue
2064 if test "$installed" = no; then
2065 notinst_deplibs="$notinst_deplibs $lib"
2066 need_relink=yes
2069 if test -n "$old_archive_from_expsyms_cmds"; then
2070 # figure out the soname
2071 set dummy $library_names
2072 realname="$2"
2073 shift; shift
2074 libname=`eval \\$echo \"$libname_spec\"`
2075 # use dlname if we got it. it's perfectly good, no?
2076 if test -n "$dlname"; then
2077 soname="$dlname"
2078 elif test -n "$soname_spec"; then
2079 # bleh windows
2080 case $host in
2081 *cygwin*)
2082 major=`expr $current - $age`
2083 versuffix="-$major"
2085 esac
2086 eval soname=\"$soname_spec\"
2087 else
2088 soname="$realname"
2091 # Make a new name for the extract_expsyms_cmds to use
2092 soroot="$soname"
2093 soname=`echo $soroot | sed -e 's/^.*\///'`
2094 newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2096 # If the library has no export list, then create one now
2097 if test -f "$output_objdir/$soname-def"; then :
2098 else
2099 $show "extracting exported symbol list from \`$soname'"
2100 save_ifs="$IFS"; IFS='~'
2101 eval cmds=\"$extract_expsyms_cmds\"
2102 for cmd in $cmds; do
2103 IFS="$save_ifs"
2104 $show "$cmd"
2105 $run eval "$cmd" || exit $?
2106 done
2107 IFS="$save_ifs"
2110 # Create $newlib
2111 if test -f "$output_objdir/$newlib"; then :; else
2112 $show "generating import library for \`$soname'"
2113 save_ifs="$IFS"; IFS='~'
2114 eval cmds=\"$old_archive_from_expsyms_cmds\"
2115 for cmd in $cmds; do
2116 IFS="$save_ifs"
2117 $show "$cmd"
2118 $run eval "$cmd" || exit $?
2119 done
2120 IFS="$save_ifs"
2122 # make sure the library variables are pointing to the new library
2123 dir=$output_objdir
2124 linklib=$newlib
2125 fi # test -n "$old_archive_from_expsyms_cmds"
2127 if test "$linkmode" = prog || test "$mode" != relink; then
2128 add_shlibpath=
2129 add_dir=
2130 add=
2131 lib_linked=yes
2132 case $hardcode_action in
2133 immediate | unsupported)
2134 if test "$hardcode_direct" = no; then
2135 add="$dir/$linklib"
2136 elif test "$hardcode_minus_L" = no; then
2137 case $host in
2138 *-*-sunos*) add_shlibpath="$dir" ;;
2139 esac
2140 add_dir="-L$dir"
2141 add="-l$name"
2142 elif test "$hardcode_shlibpath_var" = no; then
2143 add_shlibpath="$dir"
2144 add="-l$name"
2145 else
2146 lib_linked=no
2149 relink)
2150 if test "$hardcode_direct" = yes; then
2151 add="$dir/$linklib"
2152 elif test "$hardcode_minus_L" = yes; then
2153 add_dir="-L$dir"
2154 add="-l$name"
2155 elif test "$hardcode_shlibpath_var" = yes; then
2156 add_shlibpath="$dir"
2157 add="-l$name"
2158 else
2159 lib_linked=no
2162 *) lib_linked=no ;;
2163 esac
2165 if test "$lib_linked" != yes; then
2166 $echo "$modename: configuration error: unsupported hardcode properties"
2167 exit 1
2170 if test -n "$add_shlibpath"; then
2171 case :$compile_shlibpath: in
2172 *":$add_shlibpath:"*) ;;
2173 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2174 esac
2176 if test "$linkmode" = prog; then
2177 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2178 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2179 else
2180 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2181 test -n "$add" && deplibs="$add $deplibs"
2182 if test "$hardcode_direct" != yes && \
2183 test "$hardcode_minus_L" != yes && \
2184 test "$hardcode_shlibpath_var" = yes; then
2185 case :$finalize_shlibpath: in
2186 *":$libdir:"*) ;;
2187 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2188 esac
2193 if test "$linkmode" = prog || test "$mode" = relink; then
2194 add_shlibpath=
2195 add_dir=
2196 add=
2197 # Finalize command for both is simple: just hardcode it.
2198 if test "$hardcode_direct" = yes; then
2199 add="$libdir/$linklib"
2200 elif test "$hardcode_minus_L" = yes; then
2201 # Try looking first in the location we're being installed to.
2202 add_dir=
2203 if test -n "$inst_prefix_dir"; then
2204 case "$libdir" in
2205 [\\/]*)
2206 add_dir="-L$inst_prefix_dir$libdir"
2208 esac
2210 add_dir="$add_dir -L$libdir"
2211 add="-l$name"
2212 elif test "$hardcode_shlibpath_var" = yes; then
2213 case :$finalize_shlibpath: in
2214 *":$libdir:"*) ;;
2215 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2216 esac
2217 add="-l$name"
2218 else
2219 # We cannot seem to hardcode it, guess we'll fake it.
2220 # Try looking first in the location we're being installed to.
2221 add_dir=
2222 if test -n "$inst_prefix_dir"; then
2223 case "$libdir" in
2224 [\\/]*)
2225 add_dir="-L$inst_prefix_dir$libdir"
2227 esac
2229 add_dir="$add_dir -L$libdir"
2230 add="-l$name"
2233 if test "$linkmode" = prog; then
2234 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2235 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2236 else
2237 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2238 test -n "$add" && deplibs="$add $deplibs"
2241 elif test "$linkmode" = prog; then
2242 if test "$alldeplibs" = yes &&
2243 { test "$deplibs_check_method" = pass_all ||
2244 { test "$build_libtool_libs" = yes &&
2245 test -n "$library_names"; }; }; then
2246 # We only need to search for static libraries
2247 continue
2250 # Try to link the static library
2251 # Here we assume that one of hardcode_direct or hardcode_minus_L
2252 # is not unsupported. This is valid on all known static and
2253 # shared platforms.
2254 if test "$hardcode_direct" != unsupported; then
2255 test -n "$old_library" && linklib="$old_library"
2256 compile_deplibs="$dir/$linklib $compile_deplibs"
2257 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2258 else
2259 compile_deplibs="-l$name -L$dir $compile_deplibs"
2260 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2262 elif test "$build_libtool_libs" = yes; then
2263 # Not a shared library
2264 if test "$deplibs_check_method" != pass_all; then
2265 # We're trying link a shared library against a static one
2266 # but the system doesn't support it.
2268 # Just print a warning and add the library to dependency_libs so
2269 # that the program can be linked against the static library.
2270 echo
2271 echo "*** Warning: This library needs some functionality provided by $lib."
2272 echo "*** I have the capability to make that library automatically link in when"
2273 echo "*** you link to this library. But I can only do this if you have a"
2274 echo "*** shared version of the library, which you do not appear to have."
2275 if test "$module" = yes; then
2276 echo "*** Therefore, libtool will create a static module, that should work "
2277 echo "*** as long as the dlopening application is linked with the -dlopen flag."
2278 if test -z "$global_symbol_pipe"; then
2279 echo
2280 echo "*** However, this would only work if libtool was able to extract symbol"
2281 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2282 echo "*** not find such a program. So, this module is probably useless."
2283 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2285 if test "$build_old_libs" = no; then
2286 build_libtool_libs=module
2287 build_old_libs=yes
2288 else
2289 build_libtool_libs=no
2292 else
2293 convenience="$convenience $dir/$old_library"
2294 old_convenience="$old_convenience $dir/$old_library"
2295 deplibs="$dir/$old_library $deplibs"
2296 link_static=yes
2298 fi # link shared/static library?
2300 if test "$linkmode" = lib; then
2301 if test -n "$dependency_libs" &&
2302 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
2303 test "$link_static" = yes; }; then
2304 # Extract -R from dependency_libs
2305 temp_deplibs=
2306 for libdir in $dependency_libs; do
2307 case $libdir in
2308 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2309 case " $xrpath " in
2310 *" $temp_xrpath "*) ;;
2311 *) xrpath="$xrpath $temp_xrpath";;
2312 esac;;
2313 *) temp_deplibs="$temp_deplibs $libdir";;
2314 esac
2315 done
2316 dependency_libs="$temp_deplibs"
2319 newlib_search_path="$newlib_search_path $absdir"
2320 # Link against this library
2321 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2322 # ... and its dependency_libs
2323 tmp_libs=
2324 for deplib in $dependency_libs; do
2325 newdependency_libs="$deplib $newdependency_libs"
2326 if test "X$duplicate_deps" = "Xyes" ; then
2327 case "$tmp_libs " in
2328 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2329 esac
2331 tmp_libs="$tmp_libs $deplib"
2332 done
2334 if test "$link_all_deplibs" != no; then
2335 # Add the search paths of all dependency libraries
2336 for deplib in $dependency_libs; do
2337 case $deplib in
2338 -L*) path="$deplib" ;;
2339 *.la)
2340 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2341 test "X$dir" = "X$deplib" && dir="."
2342 # We need an absolute path.
2343 case $dir in
2344 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2346 absdir=`cd "$dir" && pwd`
2347 if test -z "$absdir"; then
2348 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2349 absdir="$dir"
2352 esac
2353 if grep "^installed=no" $deplib > /dev/null; then
2354 path="-L$absdir/$objdir"
2355 else
2356 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2357 if test -z "$libdir"; then
2358 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2359 exit 1
2361 if test "$absdir" != "$libdir"; then
2362 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2364 path="-L$absdir"
2367 *) continue ;;
2368 esac
2369 case " $deplibs " in
2370 *" $path "*) ;;
2371 *) deplibs="$deplibs $path" ;;
2372 esac
2373 done
2374 fi # link_all_deplibs != no
2375 fi # linkmode = lib
2376 done # for deplib in $libs
2377 if test "$pass" = dlpreopen; then
2378 # Link the dlpreopened libraries before other libraries
2379 for deplib in $save_deplibs; do
2380 deplibs="$deplib $deplibs"
2381 done
2383 if test "$pass" != dlopen; then
2384 test "$pass" != scan && dependency_libs="$newdependency_libs"
2385 if test "$pass" != conv; then
2386 # Make sure lib_search_path contains only unique directories.
2387 lib_search_path=
2388 for dir in $newlib_search_path; do
2389 case "$lib_search_path " in
2390 *" $dir "*) ;;
2391 *) lib_search_path="$lib_search_path $dir" ;;
2392 esac
2393 done
2394 newlib_search_path=
2397 if test "$linkmode,$pass" != "prog,link"; then
2398 vars="deplibs"
2399 else
2400 vars="compile_deplibs finalize_deplibs"
2402 for var in $vars dependency_libs; do
2403 # Add libraries to $var in reverse order
2404 eval tmp_libs=\"\$$var\"
2405 new_libs=
2406 for deplib in $tmp_libs; do
2407 case $deplib in
2408 -L*) new_libs="$deplib $new_libs" ;;
2410 case " $specialdeplibs " in
2411 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2413 case " $new_libs " in
2414 *" $deplib "*) ;;
2415 *) new_libs="$deplib $new_libs" ;;
2416 esac
2418 esac
2420 esac
2421 done
2422 tmp_libs=
2423 for deplib in $new_libs; do
2424 case $deplib in
2425 -L*)
2426 case " $tmp_libs " in
2427 *" $deplib "*) ;;
2428 *) tmp_libs="$tmp_libs $deplib" ;;
2429 esac
2431 *) tmp_libs="$tmp_libs $deplib" ;;
2432 esac
2433 done
2434 eval $var=\"$tmp_libs\"
2435 done # for var
2437 if test "$pass" = "conv" &&
2438 { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2439 libs="$deplibs" # reset libs
2440 deplibs=
2442 done # for pass
2443 if test "$linkmode" = prog; then
2444 dlfiles="$newdlfiles"
2445 dlprefiles="$newdlprefiles"
2448 case $linkmode in
2449 oldlib)
2450 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2451 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2454 if test -n "$rpath"; then
2455 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2458 if test -n "$xrpath"; then
2459 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2462 if test -n "$vinfo"; then
2463 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2466 if test -n "$release"; then
2467 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2470 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2471 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2474 # Now set the variables for building old libraries.
2475 build_libtool_libs=no
2476 oldlibs="$output"
2477 objs="$objs$old_deplibs"
2480 lib)
2481 # Make sure we only generate libraries of the form `libNAME.la'.
2482 case $outputname in
2483 lib*)
2484 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2485 eval libname=\"$libname_spec\"
2488 if test "$module" = no; then
2489 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2490 $echo "$help" 1>&2
2491 exit 1
2493 if test "$need_lib_prefix" != no; then
2494 # Add the "lib" prefix for modules if required
2495 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2496 eval libname=\"$libname_spec\"
2497 else
2498 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2501 esac
2503 if test -n "$objs"; then
2504 if test "$deplibs_check_method" != pass_all; then
2505 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2506 exit 1
2507 else
2508 echo
2509 echo "*** Warning: Linking the shared library $output against the non-libtool"
2510 echo "*** objects $objs is not portable!"
2511 libobjs="$libobjs $objs"
2515 if test "$dlself" != no; then
2516 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2519 set dummy $rpath
2520 if test "$#" -gt 2; then
2521 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2523 install_libdir="$2"
2525 oldlibs=
2526 if test -z "$rpath"; then
2527 if test "$build_libtool_libs" = yes; then
2528 # Building a libtool convenience library.
2529 libext=al
2530 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2531 build_libtool_libs=convenience
2532 build_old_libs=yes
2535 if test -n "$vinfo"; then
2536 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2539 if test -n "$release"; then
2540 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2542 else
2544 # Parse the version information argument.
2545 save_ifs="$IFS"; IFS=':'
2546 set dummy $vinfo 0 0 0
2547 IFS="$save_ifs"
2549 if test -n "$8"; then
2550 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2551 $echo "$help" 1>&2
2552 exit 1
2555 current="$2"
2556 revision="$3"
2557 age="$4"
2559 # Check that each of the things are valid numbers.
2560 case $current in
2561 [0-9]*) ;;
2563 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2564 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2565 exit 1
2567 esac
2569 case $revision in
2570 [0-9]*) ;;
2572 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2573 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2574 exit 1
2576 esac
2578 case $age in
2579 [0-9]*) ;;
2581 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2582 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2583 exit 1
2585 esac
2587 if test "$age" -gt "$current"; then
2588 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2589 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2590 exit 1
2593 # Calculate the version variables.
2594 major=
2595 versuffix=
2596 verstring=
2597 case $version_type in
2598 none) ;;
2600 darwin)
2601 # Like Linux, but with the current version available in
2602 # verstring for coding it into the library header
2603 major=.`expr $current - $age`
2604 versuffix="$major.$age.$revision"
2605 # Darwin ld doesn't like 0 for these options...
2606 minor_current=`expr $current + 1`
2607 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2610 freebsd-aout)
2611 major=".$current"
2612 versuffix=".$current.$revision";
2615 freebsd-elf)
2616 major=".$current"
2617 versuffix=".$current";
2620 irix)
2621 major=`expr $current - $age + 1`
2622 verstring="sgi$major.$revision"
2624 # Add in all the interfaces that we are compatible with.
2625 loop=$revision
2626 while test "$loop" -ne 0; do
2627 iface=`expr $revision - $loop`
2628 loop=`expr $loop - 1`
2629 verstring="sgi$major.$iface:$verstring"
2630 done
2632 # Before this point, $major must not contain `.'.
2633 major=.$major
2634 versuffix="$major.$revision"
2637 linux)
2638 major=.`expr $current - $age`
2639 versuffix="$major.$age.$revision"
2642 osf)
2643 major=`expr $current - $age`
2644 versuffix=".$current.$age.$revision"
2645 verstring="$current.$age.$revision"
2647 # Add in all the interfaces that we are compatible with.
2648 loop=$age
2649 while test "$loop" -ne 0; do
2650 iface=`expr $current - $loop`
2651 loop=`expr $loop - 1`
2652 verstring="$verstring:${iface}.0"
2653 done
2655 # Make executables depend on our current version.
2656 verstring="$verstring:${current}.0"
2659 sunos)
2660 major=".$current"
2661 versuffix=".$current.$revision"
2664 windows)
2665 # Use '-' rather than '.', since we only want one
2666 # extension on DOS 8.3 filesystems.
2667 major=`expr $current - $age`
2668 versuffix="-$major"
2672 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2673 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2674 exit 1
2676 esac
2678 # Clear the version info if we defaulted, and they specified a release.
2679 if test -z "$vinfo" && test -n "$release"; then
2680 major=
2681 verstring="0.0"
2682 case $version_type in
2683 darwin)
2684 # we can't check for "0.0" in archive_cmds due to quoting
2685 # problems, so we reset it completely
2686 verstring=""
2689 verstring="0.0"
2691 esac
2692 if test "$need_version" = no; then
2693 versuffix=
2694 else
2695 versuffix=".0.0"
2699 # Remove version info from name if versioning should be avoided
2700 if test "$avoid_version" = yes && test "$need_version" = no; then
2701 major=
2702 versuffix=
2703 verstring=""
2706 # Check to see if the archive will have undefined symbols.
2707 if test "$allow_undefined" = yes; then
2708 if test "$allow_undefined_flag" = unsupported; then
2709 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2710 build_libtool_libs=no
2711 build_old_libs=yes
2713 else
2714 # Don't allow undefined symbols.
2715 allow_undefined_flag="$no_undefined_flag"
2719 if test "$mode" != relink; then
2720 # Remove our outputs.
2721 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2722 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2725 # Now set the variables for building old libraries.
2726 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2727 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2729 # Transform .lo files to .o files.
2730 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2733 # Eliminate all temporary directories.
2734 for path in $notinst_path; do
2735 lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2736 deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2737 dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2738 done
2740 if test -n "$xrpath"; then
2741 # If the user specified any rpath flags, then add them.
2742 temp_xrpath=
2743 for libdir in $xrpath; do
2744 temp_xrpath="$temp_xrpath -R$libdir"
2745 case "$finalize_rpath " in
2746 *" $libdir "*) ;;
2747 *) finalize_rpath="$finalize_rpath $libdir" ;;
2748 esac
2749 done
2750 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
2751 dependency_libs="$temp_xrpath $dependency_libs"
2755 # Make sure dlfiles contains only unique files that won't be dlpreopened
2756 old_dlfiles="$dlfiles"
2757 dlfiles=
2758 for lib in $old_dlfiles; do
2759 case " $dlprefiles $dlfiles " in
2760 *" $lib "*) ;;
2761 *) dlfiles="$dlfiles $lib" ;;
2762 esac
2763 done
2765 # Make sure dlprefiles contains only unique files
2766 old_dlprefiles="$dlprefiles"
2767 dlprefiles=
2768 for lib in $old_dlprefiles; do
2769 case "$dlprefiles " in
2770 *" $lib "*) ;;
2771 *) dlprefiles="$dlprefiles $lib" ;;
2772 esac
2773 done
2775 if test "$build_libtool_libs" = yes; then
2776 if test -n "$rpath"; then
2777 case $host in
2778 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2779 # these systems don't actually have a c library (as such)!
2781 *-*-rhapsody* | *-*-darwin1.[012])
2782 # Rhapsody C library is in the System framework
2783 deplibs="$deplibs -framework System"
2785 *-*-netbsd*)
2786 # Don't link with libc until the a.out ld.so is fixed.
2788 *-*-openbsd*)
2789 # Do not include libc due to us having libc/libc_r.
2792 # Add libc to deplibs on all other systems if necessary.
2793 if test "$build_libtool_need_lc" = "yes"; then
2794 deplibs="$deplibs -lc"
2797 esac
2800 # Transform deplibs into only deplibs that can be linked in shared.
2801 name_save=$name
2802 libname_save=$libname
2803 release_save=$release
2804 versuffix_save=$versuffix
2805 major_save=$major
2806 # I'm not sure if I'm treating the release correctly. I think
2807 # release should show up in the -l (ie -lgmp5) so we don't want to
2808 # add it in twice. Is that correct?
2809 release=""
2810 versuffix=""
2811 major=""
2812 newdeplibs=
2813 droppeddeps=no
2814 case $deplibs_check_method in
2815 pass_all)
2816 # Don't check for shared/static. Everything works.
2817 # This might be a little naive. We might want to check
2818 # whether the library exists or not. But this is on
2819 # osf3 & osf4 and I'm not really sure... Just
2820 # implementing what was already the behaviour.
2821 newdeplibs=$deplibs
2823 test_compile)
2824 # This code stresses the "libraries are programs" paradigm to its
2825 # limits. Maybe even breaks it. We compile a program, linking it
2826 # against the deplibs as a proxy for the library. Then we can check
2827 # whether they linked in statically or dynamically with ldd.
2828 $rm conftest.c
2829 cat > conftest.c <<EOF
2830 int main() { return 0; }
2832 $rm conftest
2833 $CC -o conftest conftest.c $deplibs
2834 if test "$?" -eq 0 ; then
2835 ldd_output=`ldd conftest`
2836 for i in $deplibs; do
2837 name="`expr $i : '-l\(.*\)'`"
2838 # If $name is empty we are operating on a -L argument.
2839 if test -n "$name" && test "$name" != "0"; then
2840 libname=`eval \\$echo \"$libname_spec\"`
2841 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2842 set dummy $deplib_matches
2843 deplib_match=$2
2844 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2845 newdeplibs="$newdeplibs $i"
2846 else
2847 droppeddeps=yes
2848 echo
2849 echo "*** Warning: This library needs some functionality provided by $i."
2850 echo "*** I have the capability to make that library automatically link in when"
2851 echo "*** you link to this library. But I can only do this if you have a"
2852 echo "*** shared version of the library, which you do not appear to have."
2854 else
2855 newdeplibs="$newdeplibs $i"
2857 done
2858 else
2859 # Error occured in the first compile. Let's try to salvage the situation:
2860 # Compile a seperate program for each library.
2861 for i in $deplibs; do
2862 name="`expr $i : '-l\(.*\)'`"
2863 # If $name is empty we are operating on a -L argument.
2864 if test -n "$name" && test "$name" != "0"; then
2865 $rm conftest
2866 $CC -o conftest conftest.c $i
2867 # Did it work?
2868 if test "$?" -eq 0 ; then
2869 ldd_output=`ldd conftest`
2870 libname=`eval \\$echo \"$libname_spec\"`
2871 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2872 set dummy $deplib_matches
2873 deplib_match=$2
2874 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2875 newdeplibs="$newdeplibs $i"
2876 else
2877 droppeddeps=yes
2878 echo
2879 echo "*** Warning: This library needs some functionality provided by $i."
2880 echo "*** I have the capability to make that library automatically link in when"
2881 echo "*** you link to this library. But I can only do this if you have a"
2882 echo "*** shared version of the library, which you do not appear to have."
2884 else
2885 droppeddeps=yes
2886 echo
2887 echo "*** Warning! Library $i is needed by this library but I was not able to"
2888 echo "*** make it link in! You will probably need to install it or some"
2889 echo "*** library that it depends on before this library will be fully"
2890 echo "*** functional. Installing it before continuing would be even better."
2892 else
2893 newdeplibs="$newdeplibs $i"
2895 done
2898 file_magic*)
2899 set dummy $deplibs_check_method
2900 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2901 for a_deplib in $deplibs; do
2902 name="`expr $a_deplib : '-l\(.*\)'`"
2903 # If $name is empty we are operating on a -L argument.
2904 if test -n "$name" && test "$name" != "0"; then
2905 libname=`eval \\$echo \"$libname_spec\"`
2906 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2907 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2908 for potent_lib in $potential_libs; do
2909 # Follow soft links.
2910 if ls -lLd "$potent_lib" 2>/dev/null \
2911 | grep " -> " >/dev/null; then
2912 continue
2914 # The statement above tries to avoid entering an
2915 # endless loop below, in case of cyclic links.
2916 # We might still enter an endless loop, since a link
2917 # loop can be closed while we follow links,
2918 # but so what?
2919 potlib="$potent_lib"
2920 while test -h "$potlib" 2>/dev/null; do
2921 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2922 case $potliblink in
2923 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2924 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2925 esac
2926 done
2927 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2928 | sed 10q \
2929 | egrep "$file_magic_regex" > /dev/null; then
2930 newdeplibs="$newdeplibs $a_deplib"
2931 a_deplib=""
2932 break 2
2934 done
2935 done
2936 if test -n "$a_deplib" ; then
2937 droppeddeps=yes
2938 echo
2939 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2940 echo "*** I have the capability to make that library automatically link in when"
2941 echo "*** you link to this library. But I can only do this if you have a"
2942 echo "*** shared version of the library, which you do not appear to have."
2944 else
2945 # Add a -L argument.
2946 newdeplibs="$newdeplibs $a_deplib"
2948 done # Gone through all deplibs.
2950 match_pattern*)
2951 set dummy $deplibs_check_method
2952 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2953 for a_deplib in $deplibs; do
2954 name="`expr $a_deplib : '-l\(.*\)'`"
2955 # If $name is empty we are operating on a -L argument.
2956 if test -n "$name" && test "$name" != "0"; then
2957 libname=`eval \\$echo \"$libname_spec\"`
2958 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
2959 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2960 for potent_lib in $potential_libs; do
2961 if eval echo \"$potent_lib\" 2>/dev/null \
2962 | sed 10q \
2963 | egrep "$match_pattern_regex" > /dev/null; then
2964 newdeplibs="$newdeplibs $a_deplib"
2965 a_deplib=""
2966 break 2
2968 done
2969 done
2970 if test -n "$a_deplib" ; then
2971 droppeddeps=yes
2972 echo
2973 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2974 echo "*** I have the capability to make that library automatically link in when"
2975 echo "*** you link to this library. But I can only do this if you have a"
2976 echo "*** shared version of the library, which you do not appear to have."
2978 else
2979 # Add a -L argument.
2980 newdeplibs="$newdeplibs $a_deplib"
2982 done # Gone through all deplibs.
2984 none | unknown | *)
2985 newdeplibs=""
2986 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2987 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2988 grep . >/dev/null; then
2989 echo
2990 if test "X$deplibs_check_method" = "Xnone"; then
2991 echo "*** Warning: inter-library dependencies are not supported in this platform."
2992 else
2993 echo "*** Warning: inter-library dependencies are not known to be supported."
2995 echo "*** All declared inter-library dependencies are being dropped."
2996 droppeddeps=yes
2999 esac
3000 versuffix=$versuffix_save
3001 major=$major_save
3002 release=$release_save
3003 libname=$libname_save
3004 name=$name_save
3006 case $host in
3007 *-*-rhapsody* | *-*-darwin1.[012])
3008 # On Rhapsody replace the C library is the System framework
3009 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3011 esac
3013 if test "$droppeddeps" = yes; then
3014 if test "$module" = yes; then
3015 echo
3016 echo "*** Warning: libtool could not satisfy all declared inter-library"
3017 echo "*** dependencies of module $libname. Therefore, libtool will create"
3018 echo "*** a static module, that should work as long as the dlopening"
3019 echo "*** application is linked with the -dlopen flag."
3020 if test -z "$global_symbol_pipe"; then
3021 echo
3022 echo "*** However, this would only work if libtool was able to extract symbol"
3023 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3024 echo "*** not find such a program. So, this module is probably useless."
3025 echo "*** \`nm' from GNU binutils and a full rebuild may help."
3027 if test "$build_old_libs" = no; then
3028 oldlibs="$output_objdir/$libname.$libext"
3029 build_libtool_libs=module
3030 build_old_libs=yes
3031 else
3032 build_libtool_libs=no
3034 else
3035 echo "*** The inter-library dependencies that have been dropped here will be"
3036 echo "*** automatically added whenever a program is linked with this library"
3037 echo "*** or is declared to -dlopen it."
3039 if test "$allow_undefined" = no; then
3040 echo
3041 echo "*** Since this library must not contain undefined symbols,"
3042 echo "*** because either the platform does not support them or"
3043 echo "*** it was explicitly requested with -no-undefined,"
3044 echo "*** libtool will only create a static version of it."
3045 if test "$build_old_libs" = no; then
3046 oldlibs="$output_objdir/$libname.$libext"
3047 build_libtool_libs=module
3048 build_old_libs=yes
3049 else
3050 build_libtool_libs=no
3055 # Done checking deplibs!
3056 deplibs=$newdeplibs
3059 # All the library-specific variables (install_libdir is set above).
3060 library_names=
3061 old_library=
3062 dlname=
3064 # Test again, we may have decided not to build it any more
3065 if test "$build_libtool_libs" = yes; then
3066 if test "$hardcode_into_libs" = yes; then
3067 # Hardcode the library paths
3068 hardcode_libdirs=
3069 dep_rpath=
3070 rpath="$finalize_rpath"
3071 test "$mode" != relink && rpath="$compile_rpath$rpath"
3072 for libdir in $rpath; do
3073 if test -n "$hardcode_libdir_flag_spec"; then
3074 if test -n "$hardcode_libdir_separator"; then
3075 if test -z "$hardcode_libdirs"; then
3076 hardcode_libdirs="$libdir"
3077 else
3078 # Just accumulate the unique libdirs.
3079 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3080 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3083 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3085 esac
3087 else
3088 eval flag=\"$hardcode_libdir_flag_spec\"
3089 dep_rpath="$dep_rpath $flag"
3091 elif test -n "$runpath_var"; then
3092 case "$perm_rpath " in
3093 *" $libdir "*) ;;
3094 *) perm_rpath="$perm_rpath $libdir" ;;
3095 esac
3097 done
3098 # Substitute the hardcoded libdirs into the rpath.
3099 if test -n "$hardcode_libdir_separator" &&
3100 test -n "$hardcode_libdirs"; then
3101 libdir="$hardcode_libdirs"
3102 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3104 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3105 # We should set the runpath_var.
3106 rpath=
3107 for dir in $perm_rpath; do
3108 rpath="$rpath$dir:"
3109 done
3110 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3112 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3115 shlibpath="$finalize_shlibpath"
3116 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3117 if test -n "$shlibpath"; then
3118 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3121 # Get the real and link names of the library.
3122 eval library_names=\"$library_names_spec\"
3123 set dummy $library_names
3124 realname="$2"
3125 shift; shift
3127 if test -n "$soname_spec"; then
3128 eval soname=\"$soname_spec\"
3129 else
3130 soname="$realname"
3132 test -z "$dlname" && dlname=$soname
3134 lib="$output_objdir/$realname"
3135 for link
3137 linknames="$linknames $link"
3138 done
3140 # Ensure that we have .o objects for linkers which dislike .lo
3141 # (e.g. aix) in case we are running --disable-static
3142 for obj in $libobjs; do
3143 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
3144 if test "X$xdir" = "X$obj"; then
3145 xdir="."
3146 else
3147 xdir="$xdir"
3149 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
3150 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3151 if test ! -f $xdir/$oldobj; then
3152 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
3153 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
3155 done
3157 # Use standard objects if they are pic
3158 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3160 # Prepare the list of exported symbols
3161 if test -z "$export_symbols"; then
3162 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3163 $show "generating symbol list for \`$libname.la'"
3164 export_symbols="$output_objdir/$libname.exp"
3165 $run $rm $export_symbols
3166 eval cmds=\"$export_symbols_cmds\"
3167 save_ifs="$IFS"; IFS='~'
3168 for cmd in $cmds; do
3169 IFS="$save_ifs"
3170 $show "$cmd"
3171 $run eval "$cmd" || exit $?
3172 done
3173 IFS="$save_ifs"
3174 if test -n "$export_symbols_regex"; then
3175 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3176 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3177 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3178 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3183 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3184 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3187 if test -n "$convenience"; then
3188 if test -n "$whole_archive_flag_spec"; then
3189 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3190 else
3191 gentop="$output_objdir/${outputname}x"
3192 $show "${rm}r $gentop"
3193 $run ${rm}r "$gentop"
3194 $show "mkdir $gentop"
3195 $run mkdir "$gentop"
3196 status=$?
3197 if test "$status" -ne 0 && test ! -d "$gentop"; then
3198 exit $status
3200 generated="$generated $gentop"
3202 for xlib in $convenience; do
3203 # Extract the objects.
3204 case $xlib in
3205 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3206 *) xabs=`pwd`"/$xlib" ;;
3207 esac
3208 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3209 xdir="$gentop/$xlib"
3211 $show "${rm}r $xdir"
3212 $run ${rm}r "$xdir"
3213 $show "mkdir $xdir"
3214 $run mkdir "$xdir"
3215 status=$?
3216 if test "$status" -ne 0 && test ! -d "$xdir"; then
3217 exit $status
3219 $show "(cd $xdir && $AR x $xabs)"
3220 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3222 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3223 done
3227 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3228 eval flag=\"$thread_safe_flag_spec\"
3229 linker_flags="$linker_flags $flag"
3232 # Make a backup of the uninstalled library when relinking
3233 if test "$mode" = relink; then
3234 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3237 # Do each of the archive commands.
3238 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3239 eval cmds=\"$archive_expsym_cmds\"
3240 else
3241 eval cmds=\"$archive_cmds\"
3243 save_ifs="$IFS"; IFS='~'
3244 for cmd in $cmds; do
3245 IFS="$save_ifs"
3246 $show "$cmd"
3247 $run eval "$cmd" || exit $?
3248 done
3249 IFS="$save_ifs"
3251 # Restore the uninstalled library and exit
3252 if test "$mode" = relink; then
3253 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3254 exit 0
3257 # Create links to the real library.
3258 for linkname in $linknames; do
3259 if test "$realname" != "$linkname"; then
3260 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3261 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3263 done
3265 # If -module or -export-dynamic was specified, set the dlname.
3266 if test "$module" = yes || test "$export_dynamic" = yes; then
3267 # On all known operating systems, these are identical.
3268 dlname="$soname"
3273 obj)
3274 if test -n "$deplibs"; then
3275 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3278 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3279 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3282 if test -n "$rpath"; then
3283 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3286 if test -n "$xrpath"; then
3287 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3290 if test -n "$vinfo"; then
3291 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3294 if test -n "$release"; then
3295 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3298 case $output in
3299 *.lo)
3300 if test -n "$objs$old_deplibs"; then
3301 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3302 exit 1
3304 libobj="$output"
3305 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3308 libobj=
3309 obj="$output"
3311 esac
3313 # Delete the old objects.
3314 $run $rm $obj $libobj
3316 # Objects from convenience libraries. This assumes
3317 # single-version convenience libraries. Whenever we create
3318 # different ones for PIC/non-PIC, this we'll have to duplicate
3319 # the extraction.
3320 reload_conv_objs=
3321 gentop=
3322 # reload_cmds runs $LD directly, so let us get rid of
3323 # -Wl from whole_archive_flag_spec
3326 if test -n "$convenience"; then
3327 if test -n "$whole_archive_flag_spec"; then
3328 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3329 else
3330 gentop="$output_objdir/${obj}x"
3331 $show "${rm}r $gentop"
3332 $run ${rm}r "$gentop"
3333 $show "mkdir $gentop"
3334 $run mkdir "$gentop"
3335 status=$?
3336 if test "$status" -ne 0 && test ! -d "$gentop"; then
3337 exit $status
3339 generated="$generated $gentop"
3341 for xlib in $convenience; do
3342 # Extract the objects.
3343 case $xlib in
3344 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3345 *) xabs=`pwd`"/$xlib" ;;
3346 esac
3347 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3348 xdir="$gentop/$xlib"
3350 $show "${rm}r $xdir"
3351 $run ${rm}r "$xdir"
3352 $show "mkdir $xdir"
3353 $run mkdir "$xdir"
3354 status=$?
3355 if test "$status" -ne 0 && test ! -d "$xdir"; then
3356 exit $status
3358 $show "(cd $xdir && $AR x $xabs)"
3359 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3361 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3362 done
3366 # Create the old-style object.
3367 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
3369 output="$obj"
3370 eval cmds=\"$reload_cmds\"
3371 save_ifs="$IFS"; IFS='~'
3372 for cmd in $cmds; do
3373 IFS="$save_ifs"
3374 $show "$cmd"
3375 $run eval "$cmd" || exit $?
3376 done
3377 IFS="$save_ifs"
3379 # Exit if we aren't doing a library object file.
3380 if test -z "$libobj"; then
3381 if test -n "$gentop"; then
3382 $show "${rm}r $gentop"
3383 $run ${rm}r $gentop
3386 exit 0
3389 if test "$build_libtool_libs" != yes; then
3390 if test -n "$gentop"; then
3391 $show "${rm}r $gentop"
3392 $run ${rm}r $gentop
3395 # Create an invalid libtool object if no PIC, so that we don't
3396 # accidentally link it into a program.
3397 $show "echo timestamp > $libobj"
3398 $run eval "echo timestamp > $libobj" || exit $?
3399 exit 0
3402 if test -n "$pic_flag" || test "$pic_mode" != default; then
3403 # Only do commands if we really have different PIC objects.
3404 reload_objs="$libobjs $reload_conv_objs"
3405 output="$libobj"
3406 eval cmds=\"$reload_cmds\"
3407 save_ifs="$IFS"; IFS='~'
3408 for cmd in $cmds; do
3409 IFS="$save_ifs"
3410 $show "$cmd"
3411 $run eval "$cmd" || exit $?
3412 done
3413 IFS="$save_ifs"
3414 else
3415 # Just create a symlink.
3416 $show $rm $libobj
3417 $run $rm $libobj
3418 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3419 if test "X$xdir" = "X$libobj"; then
3420 xdir="."
3421 else
3422 xdir="$xdir"
3424 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3425 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3426 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3427 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3430 if test -n "$gentop"; then
3431 $show "${rm}r $gentop"
3432 $run ${rm}r $gentop
3435 exit 0
3438 prog)
3439 case $host in
3440 *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3441 esac
3442 if test -n "$vinfo"; then
3443 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3446 if test -n "$release"; then
3447 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3450 if test "$preload" = yes; then
3451 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3452 test "$dlopen_self_static" = unknown; then
3453 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3457 case $host in
3458 *-*-rhapsody* | *-*-darwin1.[012])
3459 # On Rhapsody replace the C library is the System framework
3460 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3461 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
3463 esac
3465 compile_command="$compile_command $compile_deplibs"
3466 finalize_command="$finalize_command $finalize_deplibs"
3468 if test -n "$rpath$xrpath"; then
3469 # If the user specified any rpath flags, then add them.
3470 for libdir in $rpath $xrpath; do
3471 # This is the magic to use -rpath.
3472 case "$finalize_rpath " in
3473 *" $libdir "*) ;;
3474 *) finalize_rpath="$finalize_rpath $libdir" ;;
3475 esac
3476 done
3479 # Now hardcode the library paths
3480 rpath=
3481 hardcode_libdirs=
3482 for libdir in $compile_rpath $finalize_rpath; do
3483 if test -n "$hardcode_libdir_flag_spec"; then
3484 if test -n "$hardcode_libdir_separator"; then
3485 if test -z "$hardcode_libdirs"; then
3486 hardcode_libdirs="$libdir"
3487 else
3488 # Just accumulate the unique libdirs.
3489 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3490 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3493 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3495 esac
3497 else
3498 eval flag=\"$hardcode_libdir_flag_spec\"
3499 rpath="$rpath $flag"
3501 elif test -n "$runpath_var"; then
3502 case "$perm_rpath " in
3503 *" $libdir "*) ;;
3504 *) perm_rpath="$perm_rpath $libdir" ;;
3505 esac
3507 case $host in
3508 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3509 case :$dllsearchpath: in
3510 *":$libdir:"*) ;;
3511 *) dllsearchpath="$dllsearchpath:$libdir";;
3512 esac
3514 esac
3515 done
3516 # Substitute the hardcoded libdirs into the rpath.
3517 if test -n "$hardcode_libdir_separator" &&
3518 test -n "$hardcode_libdirs"; then
3519 libdir="$hardcode_libdirs"
3520 eval rpath=\" $hardcode_libdir_flag_spec\"
3522 compile_rpath="$rpath"
3524 rpath=
3525 hardcode_libdirs=
3526 for libdir in $finalize_rpath; do
3527 if test -n "$hardcode_libdir_flag_spec"; then
3528 if test -n "$hardcode_libdir_separator"; then
3529 if test -z "$hardcode_libdirs"; then
3530 hardcode_libdirs="$libdir"
3531 else
3532 # Just accumulate the unique libdirs.
3533 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3534 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3537 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3539 esac
3541 else
3542 eval flag=\"$hardcode_libdir_flag_spec\"
3543 rpath="$rpath $flag"
3545 elif test -n "$runpath_var"; then
3546 case "$finalize_perm_rpath " in
3547 *" $libdir "*) ;;
3548 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3549 esac
3551 done
3552 # Substitute the hardcoded libdirs into the rpath.
3553 if test -n "$hardcode_libdir_separator" &&
3554 test -n "$hardcode_libdirs"; then
3555 libdir="$hardcode_libdirs"
3556 eval rpath=\" $hardcode_libdir_flag_spec\"
3558 finalize_rpath="$rpath"
3560 if test -n "$libobjs" && test "$build_old_libs" = yes; then
3561 # Transform all the library objects into standard objects.
3562 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3563 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3566 dlsyms=
3567 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3568 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3569 dlsyms="${outputname}S.c"
3570 else
3571 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3575 if test -n "$dlsyms"; then
3576 case $dlsyms in
3577 "") ;;
3578 *.c)
3579 # Discover the nlist of each of the dlfiles.
3580 nlist="$output_objdir/${outputname}.nm"
3582 $show "$rm $nlist ${nlist}S ${nlist}T"
3583 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3585 # Parse the name list into a source file.
3586 $show "creating $output_objdir/$dlsyms"
3588 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3589 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3590 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3592 #ifdef __cplusplus
3593 extern \"C\" {
3594 #endif
3596 /* Prevent the only kind of declaration conflicts we can make. */
3597 #define lt_preloaded_symbols some_other_symbol
3599 /* External symbol declarations for the compiler. */\
3602 if test "$dlself" = yes; then
3603 $show "generating symbol list for \`$output'"
3605 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3607 # Add our own program objects to the symbol list.
3608 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3609 for arg in $progfiles; do
3610 $show "extracting global C symbols from \`$arg'"
3611 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3612 done
3614 if test -n "$exclude_expsyms"; then
3615 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3616 $run eval '$mv "$nlist"T "$nlist"'
3619 if test -n "$export_symbols_regex"; then
3620 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3621 $run eval '$mv "$nlist"T "$nlist"'
3624 # Prepare the list of exported symbols
3625 if test -z "$export_symbols"; then
3626 export_symbols="$output_objdir/$output.exp"
3627 $run $rm $export_symbols
3628 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3629 else
3630 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3631 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3632 $run eval 'mv "$nlist"T "$nlist"'
3636 for arg in $dlprefiles; do
3637 $show "extracting global C symbols from \`$arg'"
3638 name=`echo "$arg" | sed -e 's%^.*/%%'`
3639 $run eval 'echo ": $name " >> "$nlist"'
3640 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3641 done
3643 if test -z "$run"; then
3644 # Make sure we have at least an empty file.
3645 test -f "$nlist" || : > "$nlist"
3647 if test -n "$exclude_expsyms"; then
3648 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3649 $mv "$nlist"T "$nlist"
3652 # Try sorting and uniquifying the output.
3653 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3655 else
3656 grep -v "^: " < "$nlist" > "$nlist"S
3659 if test -f "$nlist"S; then
3660 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3661 else
3662 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3665 $echo >> "$output_objdir/$dlsyms" "\
3667 #undef lt_preloaded_symbols
3669 #if defined (__STDC__) && __STDC__
3670 # define lt_ptr void *
3671 #else
3672 # define lt_ptr char *
3673 # define const
3674 #endif
3676 /* The mapping between symbol names and symbols. */
3677 const struct {
3678 const char *name;
3679 lt_ptr address;
3681 lt_preloaded_symbols[] =
3685 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3687 $echo >> "$output_objdir/$dlsyms" "\
3688 {0, (lt_ptr) 0}
3691 /* This works around a problem in FreeBSD linker */
3692 #ifdef FREEBSD_WORKAROUND
3693 static const void *lt_preloaded_setup() {
3694 return lt_preloaded_symbols;
3696 #endif
3698 #ifdef __cplusplus
3700 #endif\
3704 pic_flag_for_symtable=
3705 case $host in
3706 # compiling the symbol table file with pic_flag works around
3707 # a FreeBSD bug that causes programs to crash when -lm is
3708 # linked before any other PIC object. But we must not use
3709 # pic_flag when linking with -static. The problem exists in
3710 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3711 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3712 case "$compile_command " in
3713 *" -static "*) ;;
3714 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3715 esac;;
3716 *-*-hpux*)
3717 case "$compile_command " in
3718 *" -static "*) ;;
3719 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3720 esac
3721 esac
3723 # Now compile the dynamic symbol file.
3724 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3725 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3727 # Clean up the generated files.
3728 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3729 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3731 # Transform the symbol file into the correct name.
3732 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3733 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3736 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3737 exit 1
3739 esac
3740 else
3741 # We keep going just in case the user didn't refer to
3742 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3743 # really was required.
3745 # Nullify the symbol file.
3746 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3747 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3750 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
3751 # Replace the output file specification.
3752 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3753 link_command="$compile_command$compile_rpath"
3755 # We have no uninstalled library dependencies, so finalize right now.
3756 $show "$link_command"
3757 $run eval "$link_command"
3758 status=$?
3760 # Delete the generated files.
3761 if test -n "$dlsyms"; then
3762 $show "$rm $output_objdir/${outputname}S.${objext}"
3763 $run $rm "$output_objdir/${outputname}S.${objext}"
3766 exit $status
3769 if test -n "$shlibpath_var"; then
3770 # We should set the shlibpath_var
3771 rpath=
3772 for dir in $temp_rpath; do
3773 case $dir in
3774 [\\/]* | [A-Za-z]:[\\/]*)
3775 # Absolute path.
3776 rpath="$rpath$dir:"
3779 # Relative path: add a thisdir entry.
3780 rpath="$rpath\$thisdir/$dir:"
3782 esac
3783 done
3784 temp_rpath="$rpath"
3787 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3788 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3790 if test -n "$finalize_shlibpath"; then
3791 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3794 compile_var=
3795 finalize_var=
3796 if test -n "$runpath_var"; then
3797 if test -n "$perm_rpath"; then
3798 # We should set the runpath_var.
3799 rpath=
3800 for dir in $perm_rpath; do
3801 rpath="$rpath$dir:"
3802 done
3803 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3805 if test -n "$finalize_perm_rpath"; then
3806 # We should set the runpath_var.
3807 rpath=
3808 for dir in $finalize_perm_rpath; do
3809 rpath="$rpath$dir:"
3810 done
3811 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3815 if test "$no_install" = yes; then
3816 # We don't need to create a wrapper script.
3817 link_command="$compile_var$compile_command$compile_rpath"
3818 # Replace the output file specification.
3819 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3820 # Delete the old output file.
3821 $run $rm $output
3822 # Link the executable and exit
3823 $show "$link_command"
3824 $run eval "$link_command" || exit $?
3825 exit 0
3828 if test "$hardcode_action" = relink; then
3829 # Fast installation is not supported
3830 link_command="$compile_var$compile_command$compile_rpath"
3831 relink_command="$finalize_var$finalize_command$finalize_rpath"
3833 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3834 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3835 else
3836 if test "$fast_install" != no; then
3837 link_command="$finalize_var$compile_command$finalize_rpath"
3838 if test "$fast_install" = yes; then
3839 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3840 else
3841 # fast_install is set to needless
3842 relink_command=
3844 else
3845 link_command="$compile_var$compile_command$compile_rpath"
3846 relink_command="$finalize_var$finalize_command$finalize_rpath"
3850 # Replace the output file specification.
3851 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3853 # Delete the old output files.
3854 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3856 $show "$link_command"
3857 $run eval "$link_command" || exit $?
3859 # Now create the wrapper script.
3860 $show "creating $output"
3862 # Quote the relink command for shipping.
3863 if test -n "$relink_command"; then
3864 # Preserve any variables that may affect compiler behavior
3865 for var in $variables_saved_for_relink; do
3866 if eval test -z \"\${$var+set}\"; then
3867 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
3868 elif eval var_value=\$$var; test -z "$var_value"; then
3869 relink_command="$var=; export $var; $relink_command"
3870 else
3871 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
3872 relink_command="$var=\"$var_value\"; export $var; $relink_command"
3874 done
3875 relink_command="(cd `pwd`; $relink_command)"
3876 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3879 # Quote $echo for shipping.
3880 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3881 case $0 in
3882 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3883 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3884 esac
3885 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3886 else
3887 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3890 # Only actually do things if our run command is non-null.
3891 if test -z "$run"; then
3892 # win32 will think the script is a binary if it has
3893 # a .exe suffix, so we strip it off here.
3894 case $output in
3895 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3896 esac
3897 # test for cygwin because mv fails w/o .exe extensions
3898 case $host in
3899 *cygwin*) exeext=.exe ;;
3900 *) exeext= ;;
3901 esac
3902 $rm $output
3903 trap "$rm $output; exit 1" 1 2 15
3905 $echo > $output "\
3906 #! $SHELL
3908 # $output - temporary wrapper script for $objdir/$outputname
3909 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3911 # The $output program cannot be directly executed until all the libtool
3912 # libraries that it depends on are installed.
3914 # This wrapper script should never be moved out of the build directory.
3915 # If it is, it will not operate correctly.
3917 # Sed substitution that helps us do robust quoting. It backslashifies
3918 # metacharacters that are still active within double-quoted strings.
3919 Xsed='sed -e 1s/^X//'
3920 sed_quote_subst='$sed_quote_subst'
3922 # The HP-UX ksh and POSIX shell print the target directory to stdout
3923 # if CDPATH is set.
3924 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3926 relink_command=\"$relink_command\"
3928 # This environment variable determines our operation mode.
3929 if test \"\$libtool_install_magic\" = \"$magic\"; then
3930 # install mode needs the following variable:
3931 notinst_deplibs='$notinst_deplibs'
3932 else
3933 # When we are sourced in execute mode, \$file and \$echo are already set.
3934 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3935 echo=\"$qecho\"
3936 file=\"\$0\"
3937 # Make sure echo works.
3938 if test \"X\$1\" = X--no-reexec; then
3939 # Discard the --no-reexec flag, and continue.
3940 shift
3941 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3942 # Yippee, \$echo works!
3944 else
3945 # Restart under the correct shell, and then maybe \$echo will work.
3946 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3950 $echo >> $output "\
3952 # Find the directory that this script lives in.
3953 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3954 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3956 # Follow symbolic links until we get to the real thisdir.
3957 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3958 while test -n \"\$file\"; do
3959 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3961 # If there was a directory component, then change thisdir.
3962 if test \"x\$destdir\" != \"x\$file\"; then
3963 case \"\$destdir\" in
3964 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3965 *) thisdir=\"\$thisdir/\$destdir\" ;;
3966 esac
3969 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3970 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3971 done
3973 # Try to get the absolute directory name.
3974 absdir=\`cd \"\$thisdir\" && pwd\`
3975 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3978 if test "$fast_install" = yes; then
3979 echo >> $output "\
3980 program=lt-'$outputname'$exeext
3981 progdir=\"\$thisdir/$objdir\"
3983 if test ! -f \"\$progdir/\$program\" || \\
3984 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3985 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3987 file=\"\$\$-\$program\"
3989 if test ! -d \"\$progdir\"; then
3990 $mkdir \"\$progdir\"
3991 else
3992 $rm \"\$progdir/\$file\"
3995 echo >> $output "\
3997 # relink executable if necessary
3998 if test -n \"\$relink_command\"; then
3999 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4000 else
4001 $echo \"\$relink_command_output\" >&2
4002 $rm \"\$progdir/\$file\"
4003 exit 1
4007 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4008 { $rm \"\$progdir/\$program\";
4009 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4010 $rm \"\$progdir/\$file\"
4012 else
4013 echo >> $output "\
4014 program='$outputname'
4015 progdir=\"\$thisdir/$objdir\"
4019 echo >> $output "\
4021 if test -f \"\$progdir/\$program\"; then"
4023 # Export our shlibpath_var if we have one.
4024 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4025 $echo >> $output "\
4026 # Add our own library path to $shlibpath_var
4027 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4029 # Some systems cannot cope with colon-terminated $shlibpath_var
4030 # The second colon is a workaround for a bug in BeOS R4 sed
4031 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
4033 export $shlibpath_var
4037 # fixup the dll searchpath if we need to.
4038 if test -n "$dllsearchpath"; then
4039 $echo >> $output "\
4040 # Add the dll search path components to the executable PATH
4041 PATH=$dllsearchpath:\$PATH
4045 $echo >> $output "\
4046 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4047 # Run the actual program with our arguments.
4049 case $host in
4050 # win32 systems need to use the prog path for dll
4051 # lookup to work
4052 *-*-cygwin* | *-*-pw32*)
4053 $echo >> $output "\
4054 exec \$progdir/\$program \${1+\"\$@\"}
4058 # Backslashes separate directories on plain windows
4059 *-*-mingw | *-*-os2*)
4060 $echo >> $output "\
4061 exec \$progdir\\\\\$program \${1+\"\$@\"}
4066 $echo >> $output "\
4067 # Export the path to the program.
4068 PATH=\"\$progdir:\$PATH\"
4069 export PATH
4071 exec \$program \${1+\"\$@\"}
4074 esac
4075 $echo >> $output "\
4076 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
4077 exit 1
4079 else
4080 # The program doesn't exist.
4081 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
4082 \$echo \"This script is just a wrapper for \$program.\" 1>&2
4083 echo \"See the $PACKAGE documentation for more information.\" 1>&2
4084 exit 1
4088 chmod +x $output
4090 exit 0
4092 esac
4094 # See if we need to build an old-fashioned archive.
4095 for oldlib in $oldlibs; do
4097 if test "$build_libtool_libs" = convenience; then
4098 oldobjs="$libobjs_save"
4099 addlibs="$convenience"
4100 build_libtool_libs=no
4101 else
4102 if test "$build_libtool_libs" = module; then
4103 oldobjs="$libobjs_save"
4104 build_libtool_libs=no
4105 else
4106 oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
4108 addlibs="$old_convenience"
4111 if test -n "$addlibs"; then
4112 gentop="$output_objdir/${outputname}x"
4113 $show "${rm}r $gentop"
4114 $run ${rm}r "$gentop"
4115 $show "mkdir $gentop"
4116 $run mkdir "$gentop"
4117 status=$?
4118 if test "$status" -ne 0 && test ! -d "$gentop"; then
4119 exit $status
4121 generated="$generated $gentop"
4123 # Add in members from convenience archives.
4124 for xlib in $addlibs; do
4125 # Extract the objects.
4126 case $xlib in
4127 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4128 *) xabs=`pwd`"/$xlib" ;;
4129 esac
4130 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4131 xdir="$gentop/$xlib"
4133 $show "${rm}r $xdir"
4134 $run ${rm}r "$xdir"
4135 $show "mkdir $xdir"
4136 $run mkdir "$xdir"
4137 status=$?
4138 if test "$status" -ne 0 && test ! -d "$xdir"; then
4139 exit $status
4141 $show "(cd $xdir && $AR x $xabs)"
4142 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4144 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
4145 done
4148 # Do each command in the archive commands.
4149 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
4150 eval cmds=\"$old_archive_from_new_cmds\"
4151 else
4152 # Ensure that we have .o objects in place in case we decided
4153 # not to build a shared library, and have fallen back to building
4154 # static libs even though --disable-static was passed!
4155 for oldobj in $oldobjs; do
4156 if test ! -f $oldobj; then
4157 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
4158 if test "X$xdir" = "X$oldobj"; then
4159 xdir="."
4160 else
4161 xdir="$xdir"
4163 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
4164 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
4165 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
4166 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
4168 done
4170 eval cmds=\"$old_archive_cmds\"
4172 save_ifs="$IFS"; IFS='~'
4173 for cmd in $cmds; do
4174 IFS="$save_ifs"
4175 $show "$cmd"
4176 $run eval "$cmd" || exit $?
4177 done
4178 IFS="$save_ifs"
4179 done
4181 if test -n "$generated"; then
4182 $show "${rm}r$generated"
4183 $run ${rm}r$generated
4186 # Now create the libtool archive.
4187 case $output in
4188 *.la)
4189 old_library=
4190 test "$build_old_libs" = yes && old_library="$libname.$libext"
4191 $show "creating $output"
4193 # Preserve any variables that may affect compiler behavior
4194 for var in $variables_saved_for_relink; do
4195 if eval test -z \"\${$var+set}\"; then
4196 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4197 elif eval var_value=\$$var; test -z "$var_value"; then
4198 relink_command="$var=; export $var; $relink_command"
4199 else
4200 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4201 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4203 done
4204 # Quote the link command for shipping.
4205 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
4206 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4208 # Only create the output if not a dry run.
4209 if test -z "$run"; then
4210 for installed in no yes; do
4211 if test "$installed" = yes; then
4212 if test -z "$install_libdir"; then
4213 break
4215 output="$output_objdir/$outputname"i
4216 # Replace all uninstalled libtool libraries with the installed ones
4217 newdependency_libs=
4218 for deplib in $dependency_libs; do
4219 case $deplib in
4220 *.la)
4221 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
4222 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
4223 if test -z "$libdir"; then
4224 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
4225 exit 1
4227 newdependency_libs="$newdependency_libs $libdir/$name"
4229 *) newdependency_libs="$newdependency_libs $deplib" ;;
4230 esac
4231 done
4232 dependency_libs="$newdependency_libs"
4233 newdlfiles=
4234 for lib in $dlfiles; do
4235 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4236 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4237 if test -z "$libdir"; then
4238 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4239 exit 1
4241 newdlfiles="$newdlfiles $libdir/$name"
4242 done
4243 dlfiles="$newdlfiles"
4244 newdlprefiles=
4245 for lib in $dlprefiles; do
4246 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
4247 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
4248 if test -z "$libdir"; then
4249 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4250 exit 1
4252 newdlprefiles="$newdlprefiles $libdir/$name"
4253 done
4254 dlprefiles="$newdlprefiles"
4256 $rm $output
4257 # place dlname in correct position for cygwin
4258 tdlname=$dlname
4259 case $host,$output,$installed,$module,$dlname in
4260 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4261 esac
4262 $echo > $output "\
4263 # $outputname - a libtool library file
4264 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4266 # Please DO NOT delete this file!
4267 # It is necessary for linking the library.
4269 # The name that we can dlopen(3).
4270 dlname='$tdlname'
4272 # Names of this library.
4273 library_names='$library_names'
4275 # The name of the static archive.
4276 old_library='$old_library'
4278 # Libraries that this one depends upon.
4279 dependency_libs='$dependency_libs'
4281 # Version information for $libname.
4282 current=$current
4283 age=$age
4284 revision=$revision
4286 # Is this an already installed library?
4287 installed=$installed
4289 # Files to dlopen/dlpreopen
4290 dlopen='$dlfiles'
4291 dlpreopen='$dlprefiles'
4293 # Directory that this library needs to be installed in:
4294 libdir='$install_libdir'"
4295 if test "$installed" = no && test "$need_relink" = yes; then
4296 $echo >> $output "\
4297 relink_command=\"$relink_command\""
4299 done
4302 # Do a symbolic link so that the libtool archive can be found in
4303 # LD_LIBRARY_PATH before the program is installed.
4304 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4305 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4307 esac
4308 exit 0
4311 # libtool install mode
4312 install)
4313 modename="$modename: install"
4315 # There may be an optional sh(1) argument at the beginning of
4316 # install_prog (especially on Windows NT).
4317 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4318 # Allow the use of GNU shtool's install command.
4319 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
4320 # Aesthetically quote it.
4321 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4322 case $arg in
4323 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4324 arg="\"$arg\""
4326 esac
4327 install_prog="$arg "
4328 arg="$1"
4329 shift
4330 else
4331 install_prog=
4332 arg="$nonopt"
4335 # The real first argument should be the name of the installation program.
4336 # Aesthetically quote it.
4337 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4338 case $arg in
4339 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4340 arg="\"$arg\""
4342 esac
4343 install_prog="$install_prog$arg"
4345 # We need to accept at least all the BSD install flags.
4346 dest=
4347 files=
4348 opts=
4349 prev=
4350 install_type=
4351 isdir=no
4352 stripme=
4353 for arg
4355 if test -n "$dest"; then
4356 files="$files $dest"
4357 dest="$arg"
4358 continue
4361 case $arg in
4362 -d) isdir=yes ;;
4363 -f) prev="-f" ;;
4364 -g) prev="-g" ;;
4365 -m) prev="-m" ;;
4366 -o) prev="-o" ;;
4368 stripme=" -s"
4369 continue
4371 -*) ;;
4374 # If the previous option needed an argument, then skip it.
4375 if test -n "$prev"; then
4376 prev=
4377 else
4378 dest="$arg"
4379 continue
4382 esac
4384 # Aesthetically quote the argument.
4385 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4386 case $arg in
4387 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4388 arg="\"$arg\""
4390 esac
4391 install_prog="$install_prog $arg"
4392 done
4394 if test -z "$install_prog"; then
4395 $echo "$modename: you must specify an install program" 1>&2
4396 $echo "$help" 1>&2
4397 exit 1
4400 if test -n "$prev"; then
4401 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4402 $echo "$help" 1>&2
4403 exit 1
4406 if test -z "$files"; then
4407 if test -z "$dest"; then
4408 $echo "$modename: no file or destination specified" 1>&2
4409 else
4410 $echo "$modename: you must specify a destination" 1>&2
4412 $echo "$help" 1>&2
4413 exit 1
4416 # Strip any trailing slash from the destination.
4417 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4419 # Check to see that the destination is a directory.
4420 test -d "$dest" && isdir=yes
4421 if test "$isdir" = yes; then
4422 destdir="$dest"
4423 destname=
4424 else
4425 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4426 test "X$destdir" = "X$dest" && destdir=.
4427 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4429 # Not a directory, so check to see that there is only one file specified.
4430 set dummy $files
4431 if test "$#" -gt 2; then
4432 $echo "$modename: \`$dest' is not a directory" 1>&2
4433 $echo "$help" 1>&2
4434 exit 1
4437 case $destdir in
4438 [\\/]* | [A-Za-z]:[\\/]*) ;;
4440 for file in $files; do
4441 case $file in
4442 *.lo) ;;
4444 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4445 $echo "$help" 1>&2
4446 exit 1
4448 esac
4449 done
4451 esac
4453 # This variable tells wrapper scripts just to set variables rather
4454 # than running their programs.
4455 libtool_install_magic="$magic"
4457 staticlibs=
4458 future_libdirs=
4459 current_libdirs=
4460 for file in $files; do
4462 # Do each installation.
4463 case $file in
4464 *.$libext)
4465 # Do the static libraries later.
4466 staticlibs="$staticlibs $file"
4469 *.la)
4470 # Check to see that this really is a libtool archive.
4471 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4472 else
4473 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4474 $echo "$help" 1>&2
4475 exit 1
4478 library_names=
4479 old_library=
4480 relink_command=
4481 # If there is no directory component, then add one.
4482 case $file in
4483 */* | *\\*) . $file ;;
4484 *) . ./$file ;;
4485 esac
4487 # Add the libdir to current_libdirs if it is the destination.
4488 if test "X$destdir" = "X$libdir"; then
4489 case "$current_libdirs " in
4490 *" $libdir "*) ;;
4491 *) current_libdirs="$current_libdirs $libdir" ;;
4492 esac
4493 else
4494 # Note the libdir as a future libdir.
4495 case "$future_libdirs " in
4496 *" $libdir "*) ;;
4497 *) future_libdirs="$future_libdirs $libdir" ;;
4498 esac
4501 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4502 test "X$dir" = "X$file/" && dir=
4503 dir="$dir$objdir"
4505 if test -n "$relink_command"; then
4506 # Determine the prefix the user has applied to our future dir.
4507 inst_prefix_dir=`$echo "$destdir" | sed "s%$libdir\$%%"`
4509 # Don't allow the user to place us outside of our expected
4510 # location b/c this prevents finding dependent libraries that
4511 # are installed to the same prefix.
4512 if test "$inst_prefix_dir" = "$destdir"; then
4513 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
4514 exit 1
4517 if test -n "$inst_prefix_dir"; then
4518 # Stick the inst_prefix_dir data into the link command.
4519 relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4520 else
4521 relink_command=`$echo "$relink_command" | sed "s%@inst_prefix_dir@%%"`
4524 $echo "$modename: warning: relinking \`$file'" 1>&2
4525 $show "$relink_command"
4526 if $run eval "$relink_command"; then :
4527 else
4528 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4529 exit 1
4533 # See the names of the shared library.
4534 set dummy $library_names
4535 if test -n "$2"; then
4536 realname="$2"
4537 shift
4538 shift
4540 srcname="$realname"
4541 test -n "$relink_command" && srcname="$realname"T
4543 # Install the shared library and build the symlinks.
4544 $show "$install_prog $dir/$srcname $destdir/$realname"
4545 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4546 if test -n "$stripme" && test -n "$striplib"; then
4547 $show "$striplib $destdir/$realname"
4548 $run eval "$striplib $destdir/$realname" || exit $?
4551 if test "$#" -gt 0; then
4552 # Delete the old symlinks, and create new ones.
4553 for linkname
4555 if test "$linkname" != "$realname"; then
4556 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4557 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4559 done
4562 # Do each command in the postinstall commands.
4563 lib="$destdir/$realname"
4564 eval cmds=\"$postinstall_cmds\"
4565 save_ifs="$IFS"; IFS='~'
4566 for cmd in $cmds; do
4567 IFS="$save_ifs"
4568 $show "$cmd"
4569 $run eval "$cmd" || exit $?
4570 done
4571 IFS="$save_ifs"
4574 # Install the pseudo-library for information purposes.
4575 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4576 instname="$dir/$name"i
4577 $show "$install_prog $instname $destdir/$name"
4578 $run eval "$install_prog $instname $destdir/$name" || exit $?
4580 # Maybe install the static library, too.
4581 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4584 *.lo)
4585 # Install (i.e. copy) a libtool object.
4587 # Figure out destination file name, if it wasn't already specified.
4588 if test -n "$destname"; then
4589 destfile="$destdir/$destname"
4590 else
4591 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4592 destfile="$destdir/$destfile"
4595 # Deduce the name of the destination old-style object file.
4596 case $destfile in
4597 *.lo)
4598 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4600 *.$objext)
4601 staticdest="$destfile"
4602 destfile=
4605 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4606 $echo "$help" 1>&2
4607 exit 1
4609 esac
4611 # Install the libtool object if requested.
4612 if test -n "$destfile"; then
4613 $show "$install_prog $file $destfile"
4614 $run eval "$install_prog $file $destfile" || exit $?
4617 # Install the old object if enabled.
4618 if test "$build_old_libs" = yes; then
4619 # Deduce the name of the old-style object file.
4620 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4622 $show "$install_prog $staticobj $staticdest"
4623 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4625 exit 0
4629 # Figure out destination file name, if it wasn't already specified.
4630 if test -n "$destname"; then
4631 destfile="$destdir/$destname"
4632 else
4633 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4634 destfile="$destdir/$destfile"
4637 # Do a test to see if this is really a libtool program.
4638 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4639 notinst_deplibs=
4640 relink_command=
4642 # If there is no directory component, then add one.
4643 case $file in
4644 */* | *\\*) . $file ;;
4645 *) . ./$file ;;
4646 esac
4648 # Check the variables that should have been set.
4649 if test -z "$notinst_deplibs"; then
4650 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4651 exit 1
4654 finalize=yes
4655 for lib in $notinst_deplibs; do
4656 # Check to see that each library is installed.
4657 libdir=
4658 if test -f "$lib"; then
4659 # If there is no directory component, then add one.
4660 case $lib in
4661 */* | *\\*) . $lib ;;
4662 *) . ./$lib ;;
4663 esac
4665 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4666 if test -n "$libdir" && test ! -f "$libfile"; then
4667 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4668 finalize=no
4670 done
4672 relink_command=
4673 # If there is no directory component, then add one.
4674 case $file in
4675 */* | *\\*) . $file ;;
4676 *) . ./$file ;;
4677 esac
4679 outputname=
4680 if test "$fast_install" = no && test -n "$relink_command"; then
4681 if test "$finalize" = yes && test -z "$run"; then
4682 tmpdir="/tmp"
4683 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4684 tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
4685 if test $? = 0 ; then :
4686 else
4687 tmpdir="$tmpdir/libtool-$$"
4689 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4690 else
4691 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4692 continue
4694 file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4695 outputname="$tmpdir/$file"
4696 # Replace the output file specification.
4697 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4699 $show "$relink_command"
4700 if $run eval "$relink_command"; then :
4701 else
4702 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4703 ${rm}r "$tmpdir"
4704 continue
4706 file="$outputname"
4707 else
4708 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4710 else
4711 # Install the binary that we compiled earlier.
4712 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4716 # remove .exe since cygwin /usr/bin/install will append another
4717 # one anyways
4718 case $install_prog,$host in
4719 /usr/bin/install*,*cygwin*)
4720 case $file:$destfile in
4721 *.exe:*.exe)
4722 # this is ok
4724 *.exe:*)
4725 destfile=$destfile.exe
4727 *:*.exe)
4728 destfile=`echo $destfile | sed -e 's,.exe$,,'`
4730 esac
4732 esac
4733 $show "$install_prog$stripme $file $destfile"
4734 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4735 test -n "$outputname" && ${rm}r "$tmpdir"
4737 esac
4738 done
4740 for file in $staticlibs; do
4741 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4743 # Set up the ranlib parameters.
4744 oldlib="$destdir/$name"
4746 $show "$install_prog $file $oldlib"
4747 $run eval "$install_prog \$file \$oldlib" || exit $?
4749 if test -n "$stripme" && test -n "$striplib"; then
4750 $show "$old_striplib $oldlib"
4751 $run eval "$old_striplib $oldlib" || exit $?
4754 # Do each command in the postinstall commands.
4755 eval cmds=\"$old_postinstall_cmds\"
4756 save_ifs="$IFS"; IFS='~'
4757 for cmd in $cmds; do
4758 IFS="$save_ifs"
4759 $show "$cmd"
4760 $run eval "$cmd" || exit $?
4761 done
4762 IFS="$save_ifs"
4763 done
4765 if test -n "$future_libdirs"; then
4766 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4769 if test -n "$current_libdirs"; then
4770 # Maybe just do a dry run.
4771 test -n "$run" && current_libdirs=" -n$current_libdirs"
4772 exec_cmd='$SHELL $0 --finish$current_libdirs'
4773 else
4774 exit 0
4778 # libtool finish mode
4779 finish)
4780 modename="$modename: finish"
4781 libdirs="$nonopt"
4782 admincmds=
4784 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4785 for dir
4787 libdirs="$libdirs $dir"
4788 done
4790 for libdir in $libdirs; do
4791 if test -n "$finish_cmds"; then
4792 # Do each command in the finish commands.
4793 eval cmds=\"$finish_cmds\"
4794 save_ifs="$IFS"; IFS='~'
4795 for cmd in $cmds; do
4796 IFS="$save_ifs"
4797 $show "$cmd"
4798 $run eval "$cmd" || admincmds="$admincmds
4799 $cmd"
4800 done
4801 IFS="$save_ifs"
4803 if test -n "$finish_eval"; then
4804 # Do the single finish_eval.
4805 eval cmds=\"$finish_eval\"
4806 $run eval "$cmds" || admincmds="$admincmds
4807 $cmds"
4809 done
4812 # Exit here if they wanted silent mode.
4813 test "$show" = : && exit 0
4815 echo "----------------------------------------------------------------------"
4816 echo "Libraries have been installed in:"
4817 for libdir in $libdirs; do
4818 echo " $libdir"
4819 done
4820 echo
4821 echo "If you ever happen to want to link against installed libraries"
4822 echo "in a given directory, LIBDIR, you must either use libtool, and"
4823 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4824 echo "flag during linking and do at least one of the following:"
4825 if test -n "$shlibpath_var"; then
4826 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4827 echo " during execution"
4829 if test -n "$runpath_var"; then
4830 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4831 echo " during linking"
4833 if test -n "$hardcode_libdir_flag_spec"; then
4834 libdir=LIBDIR
4835 eval flag=\"$hardcode_libdir_flag_spec\"
4837 echo " - use the \`$flag' linker flag"
4839 if test -n "$admincmds"; then
4840 echo " - have your system administrator run these commands:$admincmds"
4842 if test -f /etc/ld.so.conf; then
4843 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4845 echo
4846 echo "See any operating system documentation about shared libraries for"
4847 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4848 echo "----------------------------------------------------------------------"
4849 exit 0
4852 # libtool execute mode
4853 execute)
4854 modename="$modename: execute"
4856 # The first argument is the command name.
4857 cmd="$nonopt"
4858 if test -z "$cmd"; then
4859 $echo "$modename: you must specify a COMMAND" 1>&2
4860 $echo "$help"
4861 exit 1
4864 # Handle -dlopen flags immediately.
4865 for file in $execute_dlfiles; do
4866 if test ! -f "$file"; then
4867 $echo "$modename: \`$file' is not a file" 1>&2
4868 $echo "$help" 1>&2
4869 exit 1
4872 dir=
4873 case $file in
4874 *.la)
4875 # Check to see that this really is a libtool archive.
4876 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4877 else
4878 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4879 $echo "$help" 1>&2
4880 exit 1
4883 # Read the libtool library.
4884 dlname=
4885 library_names=
4887 # If there is no directory component, then add one.
4888 case $file in
4889 */* | *\\*) . $file ;;
4890 *) . ./$file ;;
4891 esac
4893 # Skip this library if it cannot be dlopened.
4894 if test -z "$dlname"; then
4895 # Warn if it was a shared library.
4896 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4897 continue
4900 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4901 test "X$dir" = "X$file" && dir=.
4903 if test -f "$dir/$objdir/$dlname"; then
4904 dir="$dir/$objdir"
4905 else
4906 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4907 exit 1
4911 *.lo)
4912 # Just add the directory containing the .lo file.
4913 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4914 test "X$dir" = "X$file" && dir=.
4918 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4919 continue
4921 esac
4923 # Get the absolute pathname.
4924 absdir=`cd "$dir" && pwd`
4925 test -n "$absdir" && dir="$absdir"
4927 # Now add the directory to shlibpath_var.
4928 if eval "test -z \"\$$shlibpath_var\""; then
4929 eval "$shlibpath_var=\"\$dir\""
4930 else
4931 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4933 done
4935 # This variable tells wrapper scripts just to set shlibpath_var
4936 # rather than running their programs.
4937 libtool_execute_magic="$magic"
4939 # Check if any of the arguments is a wrapper script.
4940 args=
4941 for file
4943 case $file in
4944 -*) ;;
4946 # Do a test to see if this is really a libtool program.
4947 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4948 # If there is no directory component, then add one.
4949 case $file in
4950 */* | *\\*) . $file ;;
4951 *) . ./$file ;;
4952 esac
4954 # Transform arg to wrapped name.
4955 file="$progdir/$program"
4958 esac
4959 # Quote arguments (to preserve shell metacharacters).
4960 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4961 args="$args \"$file\""
4962 done
4964 if test -z "$run"; then
4965 if test -n "$shlibpath_var"; then
4966 # Export the shlibpath_var.
4967 eval "export $shlibpath_var"
4970 # Restore saved enviroment variables
4971 if test "${save_LC_ALL+set}" = set; then
4972 LC_ALL="$save_LC_ALL"; export LC_ALL
4974 if test "${save_LANG+set}" = set; then
4975 LANG="$save_LANG"; export LANG
4978 # Now prepare to actually exec the command.
4979 exec_cmd="\$cmd$args"
4980 else
4981 # Display what would be done.
4982 if test -n "$shlibpath_var"; then
4983 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4984 $echo "export $shlibpath_var"
4986 $echo "$cmd$args"
4987 exit 0
4991 # libtool clean and uninstall mode
4992 clean | uninstall)
4993 modename="$modename: $mode"
4994 rm="$nonopt"
4995 files=
4996 rmforce=
4997 exit_status=0
4999 # This variable tells wrapper scripts just to set variables rather
5000 # than running their programs.
5001 libtool_install_magic="$magic"
5003 for arg
5005 case $arg in
5006 -f) rm="$rm $arg"; rmforce=yes ;;
5007 -*) rm="$rm $arg" ;;
5008 *) files="$files $arg" ;;
5009 esac
5010 done
5012 if test -z "$rm"; then
5013 $echo "$modename: you must specify an RM program" 1>&2
5014 $echo "$help" 1>&2
5015 exit 1
5018 rmdirs=
5020 for file in $files; do
5021 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5022 if test "X$dir" = "X$file"; then
5023 dir=.
5024 objdir="$objdir"
5025 else
5026 objdir="$dir/$objdir"
5028 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5029 test "$mode" = uninstall && objdir="$dir"
5031 # Remember objdir for removal later, being careful to avoid duplicates
5032 if test "$mode" = clean; then
5033 case " $rmdirs " in
5034 *" $objdir "*) ;;
5035 *) rmdirs="$rmdirs $objdir" ;;
5036 esac
5039 # Don't error if the file doesn't exist and rm -f was used.
5040 if (test -L "$file") >/dev/null 2>&1 \
5041 || (test -h "$file") >/dev/null 2>&1 \
5042 || test -f "$file"; then
5044 elif test -d "$file"; then
5045 exit_status=1
5046 continue
5047 elif test "$rmforce" = yes; then
5048 continue
5051 rmfiles="$file"
5053 case $name in
5054 *.la)
5055 # Possibly a libtool archive, so verify it.
5056 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5057 . $dir/$name
5059 # Delete the libtool libraries and symlinks.
5060 for n in $library_names; do
5061 rmfiles="$rmfiles $objdir/$n"
5062 done
5063 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5064 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
5066 if test "$mode" = uninstall; then
5067 if test -n "$library_names"; then
5068 # Do each command in the postuninstall commands.
5069 eval cmds=\"$postuninstall_cmds\"
5070 save_ifs="$IFS"; IFS='~'
5071 for cmd in $cmds; do
5072 IFS="$save_ifs"
5073 $show "$cmd"
5074 $run eval "$cmd"
5075 if test "$?" -ne 0 && test "$rmforce" != yes; then
5076 exit_status=1
5078 done
5079 IFS="$save_ifs"
5082 if test -n "$old_library"; then
5083 # Do each command in the old_postuninstall commands.
5084 eval cmds=\"$old_postuninstall_cmds\"
5085 save_ifs="$IFS"; IFS='~'
5086 for cmd in $cmds; do
5087 IFS="$save_ifs"
5088 $show "$cmd"
5089 $run eval "$cmd"
5090 if test "$?" -ne 0 && test "$rmforce" != yes; then
5091 exit_status=1
5093 done
5094 IFS="$save_ifs"
5096 # FIXME: should reinstall the best remaining shared library.
5101 *.lo)
5102 if test "$build_old_libs" = yes; then
5103 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
5104 rmfiles="$rmfiles $dir/$oldobj"
5109 # Do a test to see if this is a libtool program.
5110 if test "$mode" = clean &&
5111 (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5112 relink_command=
5113 . $dir/$file
5115 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
5116 if test "$fast_install" = yes && test -n "$relink_command"; then
5117 rmfiles="$rmfiles $objdir/lt-$name"
5121 esac
5122 $show "$rm $rmfiles"
5123 $run $rm $rmfiles || exit_status=1
5124 done
5126 # Try to remove the ${objdir}s in the directories where we deleted files
5127 for dir in $rmdirs; do
5128 if test -d "$dir"; then
5129 $show "rmdir $dir"
5130 $run rmdir $dir >/dev/null 2>&1
5132 done
5134 exit $exit_status
5138 $echo "$modename: you must specify a MODE" 1>&2
5139 $echo "$generic_help" 1>&2
5140 exit 1
5142 esac
5144 if test -z "$exec_cmd"; then
5145 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5146 $echo "$generic_help" 1>&2
5147 exit 1
5149 fi # test -z "$show_help"
5151 if test -n "$exec_cmd"; then
5152 eval exec $exec_cmd
5153 exit 1
5156 # We need to display help for each of the modes.
5157 case $mode in
5158 "") $echo \
5159 "Usage: $modename [OPTION]... [MODE-ARG]...
5161 Provide generalized library-building support services.
5163 --config show all configuration variables
5164 --debug enable verbose shell tracing
5165 -n, --dry-run display commands without modifying any files
5166 --features display basic configuration information and exit
5167 --finish same as \`--mode=finish'
5168 --help display this help message and exit
5169 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
5170 --quiet same as \`--silent'
5171 --silent don't print informational messages
5172 --version print version information
5174 MODE must be one of the following:
5176 clean remove files from the build directory
5177 compile compile a source file into a libtool object
5178 execute automatically set library path, then run a program
5179 finish complete the installation of libtool libraries
5180 install install libraries or executables
5181 link create a library or an executable
5182 uninstall remove libraries from an installed directory
5184 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5185 a more detailed description of MODE."
5186 exit 0
5189 clean)
5190 $echo \
5191 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5193 Remove files from the build directory.
5195 RM is the name of the program to use to delete files associated with each FILE
5196 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5197 to RM.
5199 If FILE is a libtool library, object or program, all the files associated
5200 with it are deleted. Otherwise, only FILE itself is deleted using RM."
5203 compile)
5204 $echo \
5205 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5207 Compile a source file into a libtool library object.
5209 This mode accepts the following additional options:
5211 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
5212 -prefer-pic try to building PIC objects only
5213 -prefer-non-pic try to building non-PIC objects only
5214 -static always build a \`.o' file suitable for static linking
5216 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5217 from the given SOURCEFILE.
5219 The output file name is determined by removing the directory component from
5220 SOURCEFILE, then substituting the C source code suffix \`.c' with the
5221 library object suffix, \`.lo'."
5224 execute)
5225 $echo \
5226 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5228 Automatically set library path, then run a program.
5230 This mode accepts the following additional options:
5232 -dlopen FILE add the directory containing FILE to the library path
5234 This mode sets the library path environment variable according to \`-dlopen'
5235 flags.
5237 If any of the ARGS are libtool executable wrappers, then they are translated
5238 into their corresponding uninstalled binary, and any of their required library
5239 directories are added to the library path.
5241 Then, COMMAND is executed, with ARGS as arguments."
5244 finish)
5245 $echo \
5246 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5248 Complete the installation of libtool libraries.
5250 Each LIBDIR is a directory that contains libtool libraries.
5252 The commands that this mode executes may require superuser privileges. Use
5253 the \`--dry-run' option if you just want to see what would be executed."
5256 install)
5257 $echo \
5258 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5260 Install executables or libraries.
5262 INSTALL-COMMAND is the installation command. The first component should be
5263 either the \`install' or \`cp' program.
5265 The rest of the components are interpreted as arguments to that command (only
5266 BSD-compatible install options are recognized)."
5269 link)
5270 $echo \
5271 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5273 Link object files or libraries together to form another library, or to
5274 create an executable program.
5276 LINK-COMMAND is a command using the C compiler that you would use to create
5277 a program from several object files.
5279 The following components of LINK-COMMAND are treated specially:
5281 -all-static do not do any dynamic linking at all
5282 -avoid-version do not add a version suffix if possible
5283 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
5284 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
5285 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
5286 -export-symbols SYMFILE
5287 try to export only the symbols listed in SYMFILE
5288 -export-symbols-regex REGEX
5289 try to export only the symbols matching REGEX
5290 -LLIBDIR search LIBDIR for required installed libraries
5291 -lNAME OUTPUT-FILE requires the installed library libNAME
5292 -module build a library that can dlopened
5293 -no-fast-install disable the fast-install mode
5294 -no-install link a not-installable executable
5295 -no-undefined declare that a library does not refer to external symbols
5296 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
5297 -release RELEASE specify package release information
5298 -rpath LIBDIR the created library will eventually be installed in LIBDIR
5299 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
5300 -static do not do any dynamic linking of libtool libraries
5301 -version-info CURRENT[:REVISION[:AGE]]
5302 specify library version info [each variable defaults to 0]
5304 All other options (arguments beginning with \`-') are ignored.
5306 Every other argument is treated as a filename. Files ending in \`.la' are
5307 treated as uninstalled libtool libraries, other files are standard or library
5308 object files.
5310 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
5311 only library objects (\`.lo' files) may be specified, and \`-rpath' is
5312 required, except when creating a convenience library.
5314 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
5315 using \`ar' and \`ranlib', or on Windows using \`lib'.
5317 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5318 is created, otherwise an executable program is created."
5321 uninstall)
5322 $echo \
5323 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5325 Remove libraries from an installation directory.
5327 RM is the name of the program to use to delete files associated with each FILE
5328 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
5329 to RM.
5331 If FILE is a libtool library, all the files associated with it are deleted.
5332 Otherwise, only FILE itself is deleted using RM."
5336 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5337 $echo "$help" 1>&2
5338 exit 1
5340 esac
5342 echo
5343 $echo "Try \`$modename --help' for more information about other modes."
5345 exit 0
5347 # Local Variables:
5348 # mode:shell-script
5349 # sh-indentation:2
5350 # End: