1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
4 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # Check that we have a working $echo.
27 if test "X$1" = X--no-reexec; then
28 # Discard the --no-reexec flag, and continue.
30 elif test "X$1" = X--fallback-echo; then
31 # Avoid inline document here, it may be left over
33 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
34 # Yippee, $echo works!
37 # Restart under the correct shell, and then maybe $echo will work.
38 exec $SHELL "$0" --no-reexec ${1+"$@"}
41 if test "X$1" = X--fallback-echo; then
42 # used as fallback echo
50 # The name of this program.
51 progname=`$echo "$0" | sed 's%^.*/%%'`
58 TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
61 help="Try \`$progname --help' for more information."
62 magic="%%%MAGIC variable%%%"
67 # Sed substitution that helps us do robust quoting. It backslashifies
68 # metacharacters that are still active within double-quoted strings.
70 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
72 NL2SP='tr \015\012 \040\040'
75 # Only set LANG and LC_ALL to C if already set.
76 # These must not be set unconditionally because not all systems understand
77 # e.g. LANG=C (notably SCO).
78 # We save the old values to restore during execute mode.
79 if test "${LC_ALL+set}" = set; then
80 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
82 if test "${LANG+set}" = set; then
83 save_LANG="$LANG"; LANG=C; export LANG
86 if test "$LTCONFIG_VERSION" != "$VERSION"; then
87 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
88 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
92 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
93 echo "$modename: not configured to build any kind of library" 1>&2
94 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
107 lo2o="s/\\.lo\$/.${objext}/"
108 o2lo="s/\\.${objext}\$/.lo/"
110 # Parse our command line options once, thoroughly.
117 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
121 # If the previous option needs an argument, assign it.
122 if test -n "$prev"; then
125 eval "$prev=\"\$$prev \$arg\""
137 # Have we seen a non-optional argument yet?
144 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
149 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
154 echo "$progname: enabling shell trace mode"
164 if test "$build_libtool_libs" = yes; then
165 echo "enable shared libraries"
167 echo "disable shared libraries"
169 if test "$build_old_libs" = yes; then
170 echo "enable static libraries"
172 echo "disable static libraries"
177 --finish) mode="finish" ;;
179 --mode) prevopt="--mode" prev=mode ;;
180 --mode=*) mode="$optarg" ;;
192 $echo "$modename: unrecognized option \`$arg'" 1>&2
204 if test -n "$prevopt"; then
205 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
210 case "$show $MFLAGS -$MAKEFLAGS" in
213 # Be silent inside 'make -s'
214 expr " $MFLAGS -$MAKEFLAGS" : '.* -[a-zA-Z]*s' >/dev/null && show=: ;;
217 if test -z "$show_help"; then
219 # Infer the operation mode.
220 if test -z "$mode"; then
222 *cc | *++ | gcc* | *-gcc*)
234 *db | *dbx | *strace | *truss)
244 # If we have no mode, but dlfiles were specified, then do execute mode.
245 test -n "$execute_dlfiles" && mode=execute
247 # Just use the default operation mode.
248 if test -z "$mode"; then
249 if test -n "$nonopt"; then
250 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
252 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
259 # Only execute mode is allowed to have -dlopen flags.
260 if test -n "$execute_dlfiles" && test "$mode" != execute; then
261 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
266 # Change the help message to a mode-specific one.
268 help="Try \`$modename --help --mode=$mode' for more information."
270 # These modes are in order of execution frequency so that they run quickly.
272 # libtool compile mode
274 modename="$modename: compile"
275 # Get the compilation command and the source file.
284 # Accept any command-line options.
287 if test "$user_target" != "no"; then
288 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
300 case "$user_target" in
302 # The next one is the -o target name
307 # We got the output file
314 # Accept the current argument as the source file.
318 # Aesthetically quote the previous argument.
320 # Backslashify any backslashes, double quotes, and dollar signs.
321 # These are the only characters that are still specially
322 # interpreted inside of double-quoted scrings.
323 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
325 # Double-quote args containing other shell metacharacters.
326 # Many Bourne shells cannot handle close brackets correctly in scan
327 # sets, so we specify it separately.
329 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
330 lastarg="\"$lastarg\""
334 # Add the previous argument to base_compile.
335 if test -z "$base_compile"; then
336 base_compile="$lastarg"
338 base_compile="$base_compile $lastarg"
342 case "$user_target" in
346 # Get the name of the library object.
347 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
350 $echo "$modename: you must specify a target with \`-o'" 1>&2
355 # Recognize several different file suffixes.
356 # If the user specifies -o file.o, it is replaced with file.lo
371 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
374 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
376 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
381 if test -z "$base_compile"; then
382 $echo "$modename: you must specify a compilation command" 1>&2
387 # Delete any leftover library objects.
388 if test "$build_old_libs" = yes; then
389 removelist="$obj $libobj"
395 trap "$run $rm $removelist; exit 1" 1 2 15
397 # Calculate the filename of the output object if compiler does
398 # not support -o with -c
399 if test "$compiler_c_o" = no; then
400 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
401 lockfile="$output_obj.lock"
402 removelist="$removelist $output_obj $lockfile"
403 trap "$run $rm $removelist; exit 1" 1 2 15
409 # Lock this critical section if it is needed
410 # We use this script file to make the link, it avoids creating a new file
411 if test "$need_locks" = yes; then
412 until ln "$0" "$lockfile" 2>/dev/null; do
413 $show "Waiting for $lockfile to be removed"
416 elif test "$need_locks" = warn; then
417 if test -f "$lockfile"; then
419 *** ERROR, $lockfile exists and contains:
420 `cat $lockfile 2>/dev/null`
422 This indicates that another process is trying to use the same
423 temporary object file, and libtool could not work around it because
424 your compiler does not support \`-c' and \`-o' together. If you
425 repeat this compilation, it may succeed, by chance, but you had better
426 avoid parallel builds (make -j) in this platform, or get a better
432 echo $srcfile > "$lockfile"
435 if test -n "$fix_srcfile_path"; then
436 eval srcfile=\"$fix_srcfile_path\"
439 # Only build a PIC object if we are building libtool libraries.
440 if test "$build_libtool_libs" = yes; then
441 # Without this assignment, base_compile gets emptied.
442 fbsd_hideous_sh_bug=$base_compile
444 # All platforms use -DPIC, to notify preprocessed assembler code.
445 command="$base_compile $pic_flag -DPIC $srcfile"
446 if test "$build_old_libs" = yes; then
448 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
449 if test "X$dir" = "X$libobj"; then
454 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
456 if test -d "$dir"; then
463 if test $status -ne 0 && test ! -d $dir; then
468 if test "$compiler_o_lo" = yes; then
470 command="$command -o $output_obj"
471 elif test "$compiler_c_o" = yes; then
473 command="$command -o $output_obj"
476 $run $rm "$output_obj"
478 if $run eval "$command"; then :
480 test -n "$output_obj" && $run $rm $removelist
484 if test "$need_locks" = warn &&
485 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
487 *** ERROR, $lockfile contains:
488 `cat $lockfile 2>/dev/null`
490 but it should contain:
493 This indicates that another process is trying to use the same
494 temporary object file, and libtool could not work around it because
495 your compiler does not support \`-c' and \`-o' together. If you
496 repeat this compilation, it may succeed, by chance, but you had better
497 avoid parallel builds (make -j) in this platform, or get a better
504 # Just move the object if needed, then go on to compile the next one
505 if test x"$output_obj" != x"$libobj"; then
506 $show "$mv $output_obj $libobj"
507 if $run $mv $output_obj $libobj; then :
515 # If we have no pic_flag, then copy the object into place and finish.
516 if test -z "$pic_flag" && test "$build_old_libs" = yes; then
517 # Rename the .lo from within objdir to obj
518 if test -f $obj; then
523 $show "$mv $libobj $obj"
524 if $run $mv $libobj $obj; then :
531 # Now arrange that obj and lo_libobj become the same file
532 $show "$LN_S $obj $lo_libobj"
533 if $run $LN_S $obj $lo_libobj; then
542 # Allow error messages only from the first compilation.
543 suppress_output=' >/dev/null 2>&1'
546 # Only build a position-dependent object if we build old libraries.
547 if test "$build_old_libs" = yes; then
548 command="$base_compile $srcfile"
549 if test "$compiler_c_o" = yes; then
550 command="$command -o $obj"
554 # Suppress compiler output if we already did a PIC compilation.
555 command="$command$suppress_output"
556 $run $rm "$output_obj"
558 if $run eval "$command"; then :
564 if test "$need_locks" = warn &&
565 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
567 *** ERROR, $lockfile contains:
568 `cat $lockfile 2>/dev/null`
570 but it should contain:
573 This indicates that another process is trying to use the same
574 temporary object file, and libtool could not work around it because
575 your compiler does not support \`-c' and \`-o' together. If you
576 repeat this compilation, it may succeed, by chance, but you had better
577 avoid parallel builds (make -j) in this platform, or get a better
584 # Just move the object if needed
585 if test x"$output_obj" != x"$obj"; then
586 $show "$mv $output_obj $obj"
587 if $run $mv $output_obj $obj; then :
595 # Create an invalid libtool object if no PIC, so that we do not
596 # accidentally link it into a program.
597 if test "$build_libtool_libs" != yes; then
598 $show "echo timestamp > $libobj"
599 $run eval "echo timestamp > \$libobj" || exit $?
601 # Move the .lo from within objdir
602 $show "$mv $libobj $lo_libobj"
603 if $run $mv $libobj $lo_libobj; then :
612 # Unlock the critical section if it was locked
613 if test "$need_locks" != no; then
622 modename="$modename: link"
623 C_compiler="$CC" # save it, to compile generated C sources
626 *-*-cygwin* | *-*-mingw* | *-*-os2*)
627 # It is impossible to link a dll without this setting, and
628 # we shouldn't force the makefile maintainer to figure out
629 # which system we are compiling for in order to pass an extra
630 # flag for every libtool invokation.
633 # FIXME: Unfortunately, there are problems with the above when trying
634 # to make a dll which has undefined symbols, in which case not
635 # even a static library is built. For now, we need to specify
636 # -no-undefined on the libtool link line when we can be certain
637 # that all symbols are satisfied, otherwise we get a static library.
640 # This is a source program that is used to create dlls on Windows
641 # Don't remove nor modify the starting and closing comments
642 # /* ltdll.c starts here */
643 # #define WIN32_LEAN_AND_MEAN
644 # #include <windows.h>
645 # #undef WIN32_LEAN_AND_MEAN
649 # # ifdef __CYGWIN32__
650 # # define __CYGWIN__ __CYGWIN32__
657 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
663 # #include <cygwin/cygwin_dll.h>
664 # DECLARE_CYGWIN_DLL( DllMain );
666 # HINSTANCE __hDllInstance_base;
669 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
671 # __hDllInstance_base = hInst;
674 # /* ltdll.c ends here */
675 # This is a source program that is used to create import libraries
676 # on Windows for dlls which lack them. Don't remove nor modify the
677 # starting and closing comments
678 # /* impgen.c starts here */
679 # /* Copyright (C) 1999 Free Software Foundation, Inc.
681 # This file is part of GNU libtool.
683 # This program is free software; you can redistribute it and/or modify
684 # it under the terms of the GNU General Public License as published by
685 # the Free Software Foundation; either version 2 of the License, or
686 # (at your option) any later version.
688 # This program is distributed in the hope that it will be useful,
689 # but WITHOUT ANY WARRANTY; without even the implied warranty of
690 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
691 # GNU General Public License for more details.
693 # You should have received a copy of the GNU General Public License
694 # along with this program; if not, write to the Free Software
695 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
698 # #include <stdio.h> /* for printf() */
699 # #include <unistd.h> /* for open(), lseek(), read() */
700 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
701 # #include <string.h> /* for strdup() */
703 # static unsigned int
704 # pe_get16 (fd, offset)
708 # unsigned char b[2];
709 # lseek (fd, offset, SEEK_SET);
711 # return b[0] + (b[1]<<8);
714 # static unsigned int
715 # pe_get32 (fd, offset)
719 # unsigned char b[4];
720 # lseek (fd, offset, SEEK_SET);
722 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
725 # static unsigned int
729 # unsigned char *b = ptr;
730 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
739 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
740 # unsigned long export_rva, export_size, nsections, secptr, expptr;
741 # unsigned long name_rvas, nexp;
742 # unsigned char *expdata, *erva;
743 # char *filename, *dll_name;
745 # filename = argv[1];
747 # dll = open(filename, O_RDONLY|O_BINARY);
751 # dll_name = filename;
753 # for (i=0; filename[i]; i++)
754 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
755 # dll_name = filename + i +1;
757 # pe_header_offset = pe_get32 (dll, 0x3c);
758 # opthdr_ofs = pe_header_offset + 4 + 20;
759 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
761 # if (num_entries < 1) /* no exports */
764 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
765 # export_size = pe_get32 (dll, opthdr_ofs + 100);
766 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
767 # secptr = (pe_header_offset + 4 + 20 +
768 # pe_get16 (dll, pe_header_offset + 4 + 16));
771 # for (i = 0; i < nsections; i++)
774 # unsigned long secptr1 = secptr + 40 * i;
775 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
776 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
777 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
778 # lseek(dll, secptr1, SEEK_SET);
779 # read(dll, sname, 8);
780 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
782 # expptr = fptr + (export_rva - vaddr);
783 # if (export_rva + export_size > vaddr + vsize)
784 # export_size = vsize - (export_rva - vaddr);
789 # expdata = (unsigned char*)malloc(export_size);
790 # lseek (dll, expptr, SEEK_SET);
791 # read (dll, expdata, export_size);
792 # erva = expdata - export_rva;
794 # nexp = pe_as32 (expdata+24);
795 # name_rvas = pe_as32 (expdata+32);
797 # printf ("EXPORTS\n");
798 # for (i = 0; i<nexp; i++)
800 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
801 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
806 # /* impgen.c ends here */
812 compile_command="$CC"
813 finalize_command="$CC"
824 if test -n "$shlibpath_var"; then
825 # get the directories listed in $shlibpath_var
826 eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
830 # now prepend the system-specific ones
831 eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
832 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
840 export_symbols_regex=
843 link_against_libtool_libs=
847 prefer_static_libs=no
859 # We need to know -static, to get the right output filenames.
863 -all-static | -static)
864 if test "X$arg" = "X-all-static"; then
865 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
866 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
868 if test -n "$link_static_flag"; then
869 dlopen_self=$dlopen_self_static
872 if test -z "$pic_flag" && test -n "$link_static_flag"; then
873 dlopen_self=$dlopen_self_static
876 build_libtool_libs=no
878 prefer_static_libs=yes
884 # See if our shared archives depend on static archives.
885 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
887 # Go through the arguments, transforming them on the way.
888 while test $# -gt 0; do
892 # If the previous option needs an argument, assign it.
893 if test -n "$prev"; then
896 compile_command="$compile_command @OUTPUT@"
897 finalize_command="$finalize_command @OUTPUT@"
903 if test "$preload" = no; then
904 # Add the symbol object into the linking commands.
905 compile_command="$compile_command @SYMFILE@"
906 finalize_command="$finalize_command @SYMFILE@"
910 *.la | *.lo) ;; # We handle these cases below.
912 if test "$dlself" = no; then
920 if test "$prev" = dlprefiles; then
922 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
932 if test "$prev" = dlfiles; then
933 dlfiles="$dlfiles $arg"
935 dlprefiles="$dlprefiles $arg"
942 export_symbols="$arg"
943 if test ! -f "$arg"; then
944 $echo "$modename: symbol file \`$arg' does not exist"
951 export_symbols_regex="$arg"
961 # We need an absolute path.
963 [\\/]* | [A-Za-z]:[\\/]*) ;;
965 $echo "$modename: only absolute run-paths are allowed" 1>&2
969 if test "$prev" = rpath; then
972 *) rpath="$rpath $arg" ;;
977 *) xrpath="$xrpath $arg" ;;
984 eval "$prev=\"\$arg\""
995 if test -n "$link_static_flag"; then
996 compile_command="$compile_command $link_static_flag"
997 finalize_command="$finalize_command $link_static_flag"
1003 # FIXME: remove this flag sometime in the future.
1004 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1028 -export-symbols | -export-symbols-regex)
1029 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1030 $echo "$modename: not more than one -exported-symbols argument allowed"
1033 if test "X$arg" = "X-export-symbols"; then
1042 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1043 # We need an absolute path.
1045 [\\/]* | [A-Za-z]:[\\/]*) ;;
1047 absdir=`cd "$dir" && pwd`
1048 if test -z "$absdir"; then
1049 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1050 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1056 case " $deplibs " in
1058 *) deplibs="$deplibs $arg";;
1060 case " $lib_search_path " in
1062 *) lib_search_path="$lib_search_path $dir";;
1065 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1066 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1067 case ":$dllsearchpath:" in
1068 ::) dllsearchpath="$dllsearchdir";;
1069 *":$dllsearchdir:"*) ;;
1070 *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
1077 if test "$arg" = "-lc"; then
1079 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1080 # These systems don't actually have c library (as such)
1084 elif test "$arg" = "-lm"; then
1086 *-*-cygwin* | *-*-beos*)
1087 # These systems don't actually have math library (as such)
1092 deplibs="$deplibs $arg"
1123 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1124 # We need an absolute path.
1126 [\\/]* | [A-Za-z]:[\\/]*) ;;
1128 $echo "$modename: only absolute run-paths are allowed" 1>&2
1134 *) xrpath="$xrpath $dir" ;;
1140 # If we have no pic_flag, then this is the same as -all-static.
1141 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1142 compile_command="$compile_command $link_static_flag"
1143 finalize_command="$finalize_command $link_static_flag"
1158 # Some other compiler flag.
1160 # Unknown arguments in both finalize_command and compile_command need
1161 # to be aesthetically quoted because they are evaled later.
1162 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1164 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1170 *.o | *.obj | *.a | *.lib)
1171 # A standard object.
1177 if test "$prev" = dlfiles; then
1178 dlfiles="$dlfiles $arg"
1179 if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
1183 # If libtool objects are unsupported, then we need to preload.
1188 if test "$prev" = dlprefiles; then
1189 # Preload the old-style object.
1190 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1193 libobjs="$libobjs $arg"
1197 # A libtool-controlled library.
1204 # Check to see that this really is a libtool archive.
1205 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1207 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
1211 # If the library was installed with an old release of libtool,
1212 # it will not redefine variable installed.
1216 # If there is no directory component, then add one.
1218 */* | *\\*) . $arg ;;
1222 # Get the name of the library we link against.
1224 for l in $old_library $library_names; do
1228 if test -z "$linklib"; then
1229 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
1233 # Find the relevant object directory and library name.
1234 name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
1236 if test "X$installed" = Xyes; then
1239 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1240 if test "X$dir" = "X$arg"; then
1247 if test -n "$dependency_libs"; then
1248 # Extract -R and -L from dependency_libs
1250 for deplib in $dependency_libs; do
1252 -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1253 case " $rpath $xrpath " in
1254 *" $temp_xrpath "*) ;;
1255 *) xrpath="$xrpath $temp_xrpath";;
1257 -L*) case "$compile_command $temp_deplibs " in
1259 *) temp_deplibs="$temp_deplibs $deplib";;
1261 temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1262 case " $lib_search_path " in
1264 *) lib_search_path="$lib_search_path $temp_dir";;
1267 *) temp_deplibs="$temp_deplibs $deplib";;
1270 dependency_libs="$temp_deplibs"
1273 if test -z "$libdir"; then
1274 # It is a libtool convenience library, so add in its objects.
1275 convenience="$convenience $dir/$old_library"
1276 old_convenience="$old_convenience $dir/$old_library"
1277 deplibs="$deplibs$dependency_libs"
1278 compile_command="$compile_command $dir/$old_library$dependency_libs"
1279 finalize_command="$finalize_command $dir/$old_library$dependency_libs"
1283 # This library was specified with -dlopen.
1284 if test "$prev" = dlfiles; then
1285 dlfiles="$dlfiles $arg"
1286 if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
1287 # If there is no dlname, no dlopen support or we're linking statically,
1288 # we need to preload.
1291 # We should not create a dependency on this library, but we
1292 # may need any libraries it requires.
1293 compile_command="$compile_command$dependency_libs"
1294 finalize_command="$finalize_command$dependency_libs"
1300 # The library was specified with -dlpreopen.
1301 if test "$prev" = dlprefiles; then
1302 # Prefer using a static library (so that no silly _DYNAMIC symbols
1303 # are required to link).
1304 if test -n "$old_library"; then
1305 dlprefiles="$dlprefiles $dir/$old_library"
1307 dlprefiles="$dlprefiles $dir/$linklib"
1312 if test -n "$library_names" &&
1313 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1314 link_against_libtool_libs="$link_against_libtool_libs $arg"
1315 if test -n "$shlibpath_var"; then
1316 # Make sure the rpath contains only unique directories.
1317 case "$temp_rpath " in
1319 *) temp_rpath="$temp_rpath $dir" ;;
1323 # We need an absolute path.
1325 [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
1327 absdir=`cd "$dir" && pwd`
1328 if test -z "$absdir"; then
1329 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1330 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1336 # This is the magic to use -rpath.
1337 # Skip directories that are in the system default run-time
1338 # search path, unless they have been requested with -R.
1339 case " $sys_lib_dlsearch_path " in
1342 case "$compile_rpath " in
1344 *) compile_rpath="$compile_rpath $absdir"
1349 case " $sys_lib_dlsearch_path " in
1352 case "$finalize_rpath " in
1354 *) finalize_rpath="$finalize_rpath $libdir"
1360 case "$hardcode_action" in
1361 immediate | unsupported)
1362 if test "$hardcode_direct" = no; then
1363 compile_command="$compile_command $dir/$linklib"
1364 deplibs="$deplibs $dir/$linklib"
1366 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1367 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1368 if test -n "$dllsearchpath"; then
1369 dllsearchpath="$dllsearchpath:$dllsearchdir"
1371 dllsearchpath="$dllsearchdir"
1375 elif test "$hardcode_minus_L" = no; then
1378 compile_shlibpath="$compile_shlibpath$dir:"
1381 case "$compile_command " in
1383 *) compile_command="$compile_command -L$dir";;
1385 compile_command="$compile_command -l$name"
1386 deplibs="$deplibs -L$dir -l$name"
1387 elif test "$hardcode_shlibpath_var" = no; then
1388 case ":$compile_shlibpath:" in
1390 *) compile_shlibpath="$compile_shlibpath$dir:";;
1392 compile_command="$compile_command -l$name"
1393 deplibs="$deplibs -l$name"
1400 if test "$hardcode_direct" = yes; then
1401 compile_command="$compile_command $absdir/$linklib"
1402 deplibs="$deplibs $absdir/$linklib"
1403 elif test "$hardcode_minus_L" = yes; then
1404 case "$compile_command " in
1406 *) compile_command="$compile_command -L$absdir";;
1408 compile_command="$compile_command -l$name"
1409 deplibs="$deplibs -L$absdir -l$name"
1410 elif test "$hardcode_shlibpath_var" = yes; then
1411 case ":$compile_shlibpath:" in
1413 *) compile_shlibpath="$compile_shlibpath$absdir:";;
1415 compile_command="$compile_command -l$name"
1416 deplibs="$deplibs -l$name"
1427 if test "$lib_linked" != yes; then
1428 $echo "$modename: configuration error: unsupported hardcode properties"
1432 # Finalize command for both is simple: just hardcode it.
1433 if test "$hardcode_direct" = yes; then
1434 finalize_command="$finalize_command $libdir/$linklib"
1435 elif test "$hardcode_minus_L" = yes; then
1436 case "$finalize_command " in
1438 *) finalize_command="$finalize_command -L$libdir";;
1440 finalize_command="$finalize_command -l$name"
1441 elif test "$hardcode_shlibpath_var" = yes; then
1442 case ":$finalize_shlibpath:" in
1444 *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
1446 finalize_command="$finalize_command -l$name"
1448 # We cannot seem to hardcode it, guess we'll fake it.
1449 case "$finalize_command " in
1451 *) finalize_command="$finalize_command -L$libdir";;
1453 finalize_command="$finalize_command -l$name"
1456 # Transform directly to old archives if we don't build new libraries.
1457 if test -n "$pic_flag" && test -z "$old_library"; then
1458 $echo "$modename: cannot find static library for \`$arg'" 1>&2
1462 # Here we assume that one of hardcode_direct or hardcode_minus_L
1463 # is not unsupported. This is valid on all known static and
1465 if test "$hardcode_direct" != unsupported; then
1466 test -n "$old_library" && linklib="$old_library"
1467 compile_command="$compile_command $dir/$linklib"
1468 finalize_command="$finalize_command $dir/$linklib"
1470 case "$compile_command " in
1472 *) compile_command="$compile_command -L$dir";;
1474 compile_command="$compile_command -l$name"
1475 case "$finalize_command " in
1477 *) finalize_command="$finalize_command -L$dir";;
1479 finalize_command="$finalize_command -l$name"
1483 # Add in any libraries that this one depends upon.
1484 compile_command="$compile_command$dependency_libs"
1485 finalize_command="$finalize_command$dependency_libs"
1489 # Some other compiler argument.
1491 # Unknown arguments in both finalize_command and compile_command need
1492 # to be aesthetically quoted because they are evaled later.
1493 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1495 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1502 # Now actually substitute the argument into the commands.
1503 if test -n "$arg"; then
1504 compile_command="$compile_command $arg"
1505 finalize_command="$finalize_command $arg"
1509 if test -n "$prev"; then
1510 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1515 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1516 eval arg=\"$export_dynamic_flag_spec\"
1517 compile_command="$compile_command $arg"
1518 finalize_command="$finalize_command $arg"
1522 # calculate the name of the file, without its directory
1523 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1524 libobjs_save="$libobjs"
1528 $echo "$modename: you must specify an output file" 1>&2
1534 if test -n "$link_against_libtool_libs"; then
1535 $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
1539 if test -n "$deplibs"; then
1540 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1543 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1544 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1547 if test -n "$rpath"; then
1548 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
1551 if test -n "$xrpath"; then
1552 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
1555 if test -n "$vinfo"; then
1556 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1559 if test -n "$release"; then
1560 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
1563 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1564 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1567 # Now set the variables for building old libraries.
1568 build_libtool_libs=no
1573 # Make sure we only generate libraries of the form `libNAME.la'.
1574 case "$outputname" in
1576 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1577 eval libname=\"$libname_spec\"
1580 if test "$module" = no; then
1581 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
1585 if test "$need_lib_prefix" != no; then
1586 # Add the "lib" prefix for modules if required
1587 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1588 eval libname=\"$libname_spec\"
1590 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1595 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1596 if test "X$output_objdir" = "X$output"; then
1597 output_objdir="$objdir"
1599 output_objdir="$output_objdir/$objdir"
1602 if test -n "$objs"; then
1603 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1607 # How the heck are we supposed to write a wrapper for a shared library?
1608 if test -n "$link_against_libtool_libs"; then
1609 $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
1613 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1614 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1618 if test $# -gt 2; then
1619 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1624 if test -z "$rpath"; then
1625 if test "$build_libtool_libs" = yes; then
1626 # Building a libtool convenience library.
1628 oldlibs="$output_objdir/$libname.$libext $oldlibs"
1629 build_libtool_libs=convenience
1632 dependency_libs="$deplibs"
1634 if test -n "$vinfo"; then
1635 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1638 if test -n "$release"; then
1639 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1643 # Parse the version information argument.
1644 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
1645 set dummy $vinfo 0 0 0
1648 if test -n "$8"; then
1649 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1658 # Check that each of the things are valid numbers.
1660 0 | [1-9] | [1-9][0-9]*) ;;
1662 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1663 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1669 0 | [1-9] | [1-9][0-9]*) ;;
1671 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1672 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1678 0 | [1-9] | [1-9][0-9]*) ;;
1680 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1681 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1686 if test $age -gt $current; then
1687 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1688 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1692 # Calculate the version variables.
1696 case "$version_type" in
1700 major=`expr $current - $age + 1`
1701 versuffix="$major.$revision"
1702 verstring="sgi$major.$revision"
1704 # Add in all the interfaces that we are compatible with.
1706 while test $loop != 0; do
1707 iface=`expr $revision - $loop`
1708 loop=`expr $loop - 1`
1709 verstring="sgi$major.$iface:$verstring"
1714 major=.`expr $current - $age`
1715 versuffix="$major.$age.$revision"
1719 major=`expr $current - $age`
1720 versuffix=".$current.$age.$revision"
1721 verstring="$current.$age.$revision"
1723 # Add in all the interfaces that we are compatible with.
1725 while test $loop != 0; do
1726 iface=`expr $current - $loop`
1727 loop=`expr $loop - 1`
1728 verstring="$verstring:${iface}.0"
1731 # Make executables depend on our current version.
1732 verstring="$verstring:${current}.0"
1737 versuffix=".$current.$revision"
1742 versuffix=".$current.$revision";
1747 versuffix=".$current";
1751 # Like Linux, but with '-' rather than '.', since we only
1752 # want one extension on Windows 95.
1753 major=`expr $current - $age`
1754 versuffix="-$major-$age-$revision"
1758 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1759 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1764 # Clear the version info if we defaulted, and they specified a release.
1765 if test -z "$vinfo" && test -n "$release"; then
1768 if test "$need_version" = no; then
1775 # Remove version info from name if versioning should be avoided
1776 if test "$avoid_version" = yes && test "$need_version" = no; then
1782 # Check to see if the archive will have undefined symbols.
1783 if test "$allow_undefined" = yes; then
1784 if test "$allow_undefined_flag" = unsupported; then
1785 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1786 build_libtool_libs=no
1790 # Don't allow undefined symbols.
1791 allow_undefined_flag="$no_undefined_flag"
1794 dependency_libs="$deplibs"
1796 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1797 # these systems don't actually have a c library (as such)!
1800 # Add libc to deplibs on all other systems.
1801 deplibs="$deplibs -lc"
1806 # Create the output directory, or remove our outputs if we need to.
1807 if test -d $output_objdir; then
1808 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
1809 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
1811 $show "$mkdir $output_objdir"
1812 $run $mkdir $output_objdir
1814 if test $status -ne 0 && test ! -d $output_objdir; then
1819 # Now set the variables for building old libraries.
1820 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
1821 oldlibs="$oldlibs $output_objdir/$libname.$libext"
1823 # Transform .lo files to .o files.
1824 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
1827 if test "$build_libtool_libs" = yes; then
1828 # Transform deplibs into only deplibs that can be linked in shared.
1830 libname_save=$libname
1831 release_save=$release
1832 versuffix_save=$versuffix
1834 # I'm not sure if I'm treating the release correctly. I think
1835 # release should show up in the -l (ie -lgmp5) so we don't want to
1836 # add it in twice. Is that correct?
1842 case "$deplibs_check_method" in
1844 # Don't check for shared/static. Everything works.
1845 # This might be a little naive. We might want to check
1846 # whether the library exists or not. But this is on
1847 # osf3 & osf4 and I'm not really sure... Just
1848 # implementing what was already the behaviour.
1852 # This code stresses the "libraries are programs" paradigm to its
1853 # limits. Maybe even breaks it. We compile a program, linking it
1854 # against the deplibs as a proxy for the library. Then we can check
1855 # whether they linked in statically or dynamically with ldd.
1857 cat > conftest.c <<EOF
1858 int main() { return 0; }
1861 $C_compiler -o conftest conftest.c $deplibs
1862 if test $? -eq 0 ; then
1863 ldd_output=`ldd conftest`
1864 for i in $deplibs; do
1865 name="`expr $i : '-l\(.*\)'`"
1866 # If $name is empty we are operating on a -L argument.
1867 if test "$name" != "" ; then
1868 libname=`eval \\$echo \"$libname_spec\"`
1869 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1870 set dummy $deplib_matches
1872 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1873 newdeplibs="$newdeplibs $i"
1877 echo "*** Warning: This library needs some functionality provided by $i."
1878 echo "*** I have the capability to make that library automatically link in when"
1879 echo "*** you link to this library. But I can only do this if you have a"
1880 echo "*** shared version of the library, which you do not appear to have."
1883 newdeplibs="$newdeplibs $i"
1887 # Error occured in the first compile. Let's try to salvage the situation:
1888 # Compile a seperate program for each library.
1889 for i in $deplibs; do
1890 name="`expr $i : '-l\(.*\)'`"
1891 # If $name is empty we are operating on a -L argument.
1892 if test "$name" != "" ; then
1894 $C_compiler -o conftest conftest.c $i
1896 if test $? -eq 0 ; then
1897 ldd_output=`ldd conftest`
1898 libname=`eval \\$echo \"$libname_spec\"`
1899 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1900 set dummy $deplib_matches
1902 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1903 newdeplibs="$newdeplibs $i"
1907 echo "*** Warning: This library needs some functionality provided by $i."
1908 echo "*** I have the capability to make that library automatically link in when"
1909 echo "*** you link to this library. But I can only do this if you have a"
1910 echo "*** shared version of the library, which you do not appear to have."
1915 echo "*** Warning! Library $i is needed by this library but I was not able to"
1916 echo "*** make it link in! You will probably need to install it or some"
1917 echo "*** library that it depends on before this library will be fully"
1918 echo "*** functional. Installing it before continuing would be even better."
1921 newdeplibs="$newdeplibs $i"
1927 set dummy $deplibs_check_method
1928 file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
1929 for a_deplib in $deplibs; do
1930 name="`expr $a_deplib : '-l\(.*\)'`"
1931 # If $name is empty we are operating on a -L argument.
1932 if test "$name" != "" ; then
1933 libname=`eval \\$echo \"$libname_spec\"`
1934 for i in $lib_search_path; do
1935 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
1936 for potent_lib in $potential_libs; do
1937 # Follow soft links.
1938 if ls -lLd "$potent_lib" 2>/dev/null \
1939 | grep " -> " >/dev/null; then
1942 # The statement above tries to avoid entering an
1943 # endless loop below, in case of cyclic links.
1944 # We might still enter an endless loop, since a link
1945 # loop can be closed while we follow links,
1947 potlib="$potent_lib"
1948 while test -h "$potlib" 2>/dev/null; do
1949 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
1950 case "$potliblink" in
1951 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
1952 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
1955 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
1957 | egrep "$file_magic_regex" > /dev/null; then
1958 newdeplibs="$newdeplibs $a_deplib"
1964 if test -n "$a_deplib" ; then
1967 echo "*** Warning: This library needs some functionality provided by $a_deplib."
1968 echo "*** I have the capability to make that library automatically link in when"
1969 echo "*** you link to this library. But I can only do this if you have a"
1970 echo "*** shared version of the library, which you do not appear to have."
1973 # Add a -L argument.
1974 newdeplibs="$newdeplibs $a_deplib"
1976 done # Gone through all deplibs.
1980 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
1981 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
1982 grep . >/dev/null; then
1984 if test "X$deplibs_check_method" = "Xnone"; then
1985 echo "*** Warning: inter-library dependencies are not supported in this platform."
1987 echo "*** Warning: inter-library dependencies are not known to be supported."
1989 echo "*** All declared inter-library dependencies are being dropped."
1994 versuffix=$versuffix_save
1996 release=$release_save
1997 libname=$libname_save
2000 if test "$droppeddeps" = yes; then
2001 if test "$module" = yes; then
2003 echo "*** Warning: libtool could not satisfy all declared inter-library"
2004 echo "*** dependencies of module $libname. Therefore, libtool will create"
2005 echo "*** a static module, that should work as long as the dlopening"
2006 echo "*** application is linked with the -dlopen flag."
2007 if test -z "$global_symbol_pipe"; then
2009 echo "*** However, this would only work if libtool was able to extract symbol"
2010 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2011 echo "*** not find such a program. So, this module is probably useless."
2012 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2014 if test "$build_old_libs" = no; then
2015 oldlibs="$output_objdir/$libname.$libext"
2016 build_libtool_libs=module
2019 build_libtool_libs=no
2022 echo "*** The inter-library dependencies that have been dropped here will be"
2023 echo "*** automatically added whenever a program is linked with this library"
2024 echo "*** or is declared to -dlopen it."
2027 # Done checking deplibs!
2031 # All the library-specific variables (install_libdir is set above).
2036 # Test again, we may have decided not to build it any more
2037 if test "$build_libtool_libs" = yes; then
2038 # Get the real and link names of the library.
2039 eval library_names=\"$library_names_spec\"
2040 set dummy $library_names
2044 if test -n "$soname_spec"; then
2045 eval soname=\"$soname_spec\"
2050 lib="$output_objdir/$realname"
2053 linknames="$linknames $link"
2056 # Ensure that we have .o objects for linkers which dislike .lo
2057 # (e.g. aix) incase we are running --disable-static
2058 for obj in $libobjs; do
2059 oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
2060 if test ! -f $oldobj; then
2061 $show "${LN_S} $obj $oldobj"
2062 $run ${LN_S} $obj $oldobj || exit $?
2066 # Use standard objects if they are pic
2067 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2069 # Prepare the list of exported symbols
2070 if test -z "$export_symbols"; then
2071 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2072 $show "generating symbol list for \`$libname.la'"
2073 export_symbols="$output_objdir/$libname.exp"
2074 $run $rm $export_symbols
2075 eval cmds=\"$export_symbols_cmds\"
2076 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2077 for cmd in $cmds; do
2080 $run eval "$cmd" || exit $?
2083 if test -n "$export_symbols_regex"; then
2084 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2085 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2086 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2087 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2092 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2093 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2096 if test -n "$convenience"; then
2097 if test -n "$whole_archive_flag_spec"; then
2098 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2100 gentop="$output_objdir/${outputname}x"
2101 $show "${rm}r $gentop"
2102 $run ${rm}r "$gentop"
2103 $show "mkdir $gentop"
2104 $run mkdir "$gentop"
2106 if test $status -ne 0 && test ! -d "$gentop"; then
2109 generated="$generated $gentop"
2111 for xlib in $convenience; do
2112 # Extract the objects.
2114 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2115 *) xabs=`pwd`"/$xlib" ;;
2117 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2118 xdir="$gentop/$xlib"
2120 $show "${rm}r $xdir"
2125 if test $status -ne 0 && test ! -d "$xdir"; then
2128 $show "(cd $xdir && $AR x $xabs)"
2129 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2131 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2136 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2137 eval flag=\"$thread_safe_flag_spec\"
2138 linkopts="$linkopts $flag"
2141 # Do each of the archive commands.
2142 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2143 eval cmds=\"$archive_expsym_cmds\"
2145 eval cmds=\"$archive_cmds\"
2147 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2148 for cmd in $cmds; do
2151 $run eval "$cmd" || exit $?
2155 # Create links to the real library.
2156 for linkname in $linknames; do
2157 if test "$realname" != "$linkname"; then
2158 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2159 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2163 # If -module or -export-dynamic was specified, set the dlname.
2164 if test "$module" = yes || test "$export_dynamic" = yes; then
2165 # On all known operating systems, these are identical.
2172 if test -n "$link_against_libtool_libs"; then
2173 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
2177 if test -n "$deplibs"; then
2178 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2181 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2182 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2185 if test -n "$rpath"; then
2186 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2189 if test -n "$xrpath"; then
2190 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2193 if test -n "$vinfo"; then
2194 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2197 if test -n "$release"; then
2198 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2203 if test -n "$objs"; then
2204 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2208 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2216 # Delete the old objects.
2217 $run $rm $obj $libobj
2219 # Objects from convenience libraries. This assumes
2220 # single-version convenience libraries. Whenever we create
2221 # different ones for PIC/non-PIC, this we'll have to duplicate
2225 # reload_cmds runs $LD directly, so let us get rid of
2226 # -Wl from whole_archive_flag_spec
2229 if test -n "$convenience"; then
2230 if test -n "$whole_archive_flag_spec"; then
2231 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2233 gentop="$output_objdir/${obj}x"
2234 $show "${rm}r $gentop"
2235 $run ${rm}r "$gentop"
2236 $show "mkdir $gentop"
2237 $run mkdir "$gentop"
2239 if test $status -ne 0 && test ! -d "$gentop"; then
2242 generated="$generated $gentop"
2244 for xlib in $convenience; do
2245 # Extract the objects.
2247 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2248 *) xabs=`pwd`"/$xlib" ;;
2250 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2251 xdir="$gentop/$xlib"
2253 $show "${rm}r $xdir"
2258 if test $status -ne 0 && test ! -d "$xdir"; then
2261 $show "(cd $xdir && $AR x $xabs)"
2262 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2264 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2269 # Create the old-style object.
2270 reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
2273 eval cmds=\"$reload_cmds\"
2274 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2275 for cmd in $cmds; do
2278 $run eval "$cmd" || exit $?
2282 # Exit if we aren't doing a library object file.
2283 if test -z "$libobj"; then
2284 if test -n "$gentop"; then
2285 $show "${rm}r $gentop"
2292 if test "$build_libtool_libs" != yes; then
2293 if test -n "$gentop"; then
2294 $show "${rm}r $gentop"
2298 # Create an invalid libtool object if no PIC, so that we don't
2299 # accidentally link it into a program.
2300 $show "echo timestamp > $libobj"
2301 $run eval "echo timestamp > $libobj" || exit $?
2305 if test -n "$pic_flag"; then
2306 # Only do commands if we really have different PIC objects.
2307 reload_objs="$libobjs $reload_conv_objs"
2309 eval cmds=\"$reload_cmds\"
2310 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2311 for cmd in $cmds; do
2314 $run eval "$cmd" || exit $?
2318 # Just create a symlink.
2321 $show "$LN_S $obj $libobj"
2322 $run $LN_S $obj $libobj || exit $?
2325 if test -n "$gentop"; then
2326 $show "${rm}r $gentop"
2333 # Anything else should be a program.
2335 if test -n "$vinfo"; then
2336 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2339 if test -n "$release"; then
2340 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2343 if test "$preload" = yes; then
2344 if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
2345 test "$dlopen_self_static" = unknown; then
2346 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2350 if test -n "$rpath$xrpath"; then
2351 # If the user specified any rpath flags, then add them.
2352 for libdir in $rpath $xrpath; do
2353 # This is the magic to use -rpath.
2354 case "$compile_rpath " in
2356 *) compile_rpath="$compile_rpath $libdir" ;;
2358 case "$finalize_rpath " in
2360 *) finalize_rpath="$finalize_rpath $libdir" ;;
2365 # Now hardcode the library paths
2368 for libdir in $compile_rpath $finalize_rpath; do
2369 if test -n "$hardcode_libdir_flag_spec"; then
2370 if test -n "$hardcode_libdir_separator"; then
2371 if test -z "$hardcode_libdirs"; then
2372 hardcode_libdirs="$libdir"
2374 # Just accumulate the unique libdirs.
2375 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2376 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2379 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2384 eval flag=\"$hardcode_libdir_flag_spec\"
2385 rpath="$rpath $flag"
2387 elif test -n "$runpath_var"; then
2388 case "$perm_rpath " in
2390 *) perm_rpath="$perm_rpath $libdir" ;;
2394 # Substitute the hardcoded libdirs into the rpath.
2395 if test -n "$hardcode_libdir_separator" &&
2396 test -n "$hardcode_libdirs"; then
2397 libdir="$hardcode_libdirs"
2398 eval rpath=\" $hardcode_libdir_flag_spec\"
2400 compile_rpath="$rpath"
2404 for libdir in $finalize_rpath; do
2405 if test -n "$hardcode_libdir_flag_spec"; then
2406 if test -n "$hardcode_libdir_separator"; then
2407 if test -z "$hardcode_libdirs"; then
2408 hardcode_libdirs="$libdir"
2410 # Just accumulate the unique libdirs.
2411 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2412 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2415 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2420 eval flag=\"$hardcode_libdir_flag_spec\"
2421 rpath="$rpath $flag"
2423 elif test -n "$runpath_var"; then
2424 case "$finalize_perm_rpath " in
2426 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
2430 # Substitute the hardcoded libdirs into the rpath.
2431 if test -n "$hardcode_libdir_separator" &&
2432 test -n "$hardcode_libdirs"; then
2433 libdir="$hardcode_libdirs"
2434 eval rpath=\" $hardcode_libdir_flag_spec\"
2436 finalize_rpath="$rpath"
2438 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2439 if test "X$output_objdir" = "X$output"; then
2440 output_objdir="$objdir"
2442 output_objdir="$output_objdir/$objdir"
2445 # Create the binary in the object directory, then wrap it.
2446 if test ! -d $output_objdir; then
2447 $show "$mkdir $output_objdir"
2448 $run $mkdir $output_objdir
2450 if test $status -ne 0 && test ! -d $output_objdir; then
2455 if test -n "$libobjs" && test "$build_old_libs" = yes; then
2456 # Transform all the library objects into standard objects.
2457 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2458 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2462 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2463 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2464 dlsyms="${outputname}S.c"
2466 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
2470 if test -n "$dlsyms"; then
2474 # Discover the nlist of each of the dlfiles.
2475 nlist="$output_objdir/${outputname}.nm"
2477 $show "$rm $nlist ${nlist}S ${nlist}T"
2478 $run $rm "$nlist" "${nlist}S" "${nlist}T"
2480 # Parse the name list into a source file.
2481 $show "creating $output_objdir/$dlsyms"
2483 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
2484 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
2485 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
2491 /* Prevent the only kind of declaration conflicts we can make. */
2492 #define lt_preloaded_symbols some_other_symbol
2494 /* External symbol declarations for the compiler. */\
2497 if test "$dlself" = yes; then
2498 $show "generating symbol list for \`$output'"
2500 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
2502 # Add our own program objects to the symbol list.
2503 progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2504 for arg in $progfiles; do
2505 $show "extracting global C symbols from \`$arg'"
2506 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2509 if test -n "$exclude_expsyms"; then
2510 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2511 $run eval '$mv "$nlist"T "$nlist"'
2514 if test -n "$export_symbols_regex"; then
2515 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2516 $run eval '$mv "$nlist"T "$nlist"'
2519 # Prepare the list of exported symbols
2520 if test -z "$export_symbols"; then
2521 export_symbols="$output_objdir/$output.exp"
2522 $run $rm $export_symbols
2523 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2525 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
2526 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
2527 $run eval 'mv "$nlist"T "$nlist"'
2531 for arg in $dlprefiles; do
2532 $show "extracting global C symbols from \`$arg'"
2533 name=`echo "$arg" | sed -e 's%^.*/%%'`
2534 $run eval 'echo ": $name " >> "$nlist"'
2535 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2538 if test -z "$run"; then
2539 # Make sure we have at least an empty file.
2540 test -f "$nlist" || : > "$nlist"
2542 if test -n "$exclude_expsyms"; then
2543 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2544 $mv "$nlist"T "$nlist"
2547 # Try sorting and uniquifying the output.
2548 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
2551 grep -v "^: " < "$nlist" > "$nlist"S
2554 if test -f "$nlist"S; then
2555 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
2557 echo '/* NONE */' >> "$output_objdir/$dlsyms"
2560 $echo >> "$output_objdir/$dlsyms" "\
2562 #undef lt_preloaded_symbols
2564 #if defined (__STDC__) && __STDC__
2565 # define lt_ptr_t void *
2567 # define lt_ptr_t char *
2571 /* The mapping between symbol names and symbols. */
2576 lt_preloaded_symbols[] =
2580 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
2581 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
2582 < "$nlist" >> "$output_objdir/$dlsyms"
2584 $echo >> "$output_objdir/$dlsyms" "\
2588 /* This works around a problem in FreeBSD linker */
2589 #ifdef FREEBSD_WORKAROUND
2590 static const void *lt_preloaded_setup() {
2591 return lt_preloaded_symbols;
2601 pic_flag_for_symtable=
2603 # compiling the symbol table file with pic_flag works around
2604 # a FreeBSD bug that causes programs to crash when -lm is
2605 # linked before any other PIC object. But we must not use
2606 # pic_flag when linking with -static. The problem exists in
2607 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2608 *-*-freebsd2*|*-*-freebsd3.0*)
2609 case "$compile_command " in
2611 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
2615 # Now compile the dynamic symbol file.
2616 $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
2617 $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
2619 # Clean up the generated files.
2620 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
2621 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
2623 # Transform the symbol file into the correct name.
2624 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2625 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2628 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
2633 # We keep going just in case the user didn't refer to
2634 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2635 # really was required.
2637 # Nullify the symbol file.
2638 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2639 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2642 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
2643 # Replace the output file specification.
2644 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
2645 link_command="$compile_command$compile_rpath"
2647 # We have no uninstalled library dependencies, so finalize right now.
2648 $show "$link_command"
2649 $run eval "$link_command"
2652 # Delete the generated files.
2653 if test -n "$dlsyms"; then
2654 $show "$rm $output_objdir/${outputname}S.${objext}"
2655 $run $rm "$output_objdir/${outputname}S.${objext}"
2661 if test -n "$shlibpath_var"; then
2662 # We should set the shlibpath_var
2664 for dir in $temp_rpath; do
2666 [\\/]* | [A-Za-z]:[\\/]*)
2671 # Relative path: add a thisdir entry.
2672 rpath="$rpath\$thisdir/$dir:"
2679 if test -n "$compile_shlibpath$finalize_shlibpath"; then
2680 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
2682 if test -n "$finalize_shlibpath"; then
2683 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
2688 if test -n "$runpath_var"; then
2689 if test -n "$perm_rpath"; then
2690 # We should set the runpath_var.
2692 for dir in $perm_rpath; do
2695 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
2697 if test -n "$finalize_perm_rpath"; then
2698 # We should set the runpath_var.
2700 for dir in $finalize_perm_rpath; do
2703 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
2707 if test "$hardcode_action" = relink; then
2708 # Fast installation is not supported
2709 link_command="$compile_var$compile_command$compile_rpath"
2710 relink_command="$finalize_var$finalize_command$finalize_rpath"
2712 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
2713 $echo "$modename: \`$output' will be relinked during installation" 1>&2
2715 if test "$fast_install" != no; then
2716 link_command="$finalize_var$compile_command$finalize_rpath"
2717 if test "$fast_install" = yes; then
2718 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
2720 # fast_install is set to needless
2724 link_command="$compile_var$compile_command$compile_rpath"
2725 relink_command="$finalize_var$finalize_command$finalize_rpath"
2729 # Replace the output file specification.
2730 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
2732 # Delete the old output files.
2733 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
2735 $show "$link_command"
2736 $run eval "$link_command" || exit $?
2738 # Now create the wrapper script.
2739 $show "creating $output"
2741 # Quote the relink command for shipping.
2742 if test -n "$relink_command"; then
2743 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
2746 # Quote $echo for shipping.
2747 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
2749 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
2750 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
2752 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
2754 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
2757 # Only actually do things if our run command is non-null.
2758 if test -z "$run"; then
2759 # win32 will think the script is a binary if it has
2760 # a .exe suffix, so we strip it off here.
2762 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
2765 trap "$rm $output; exit 1" 1 2 15
2770 # $output - temporary wrapper script for $objdir/$outputname
2771 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
2773 # The $output program cannot be directly executed until all the libtool
2774 # libraries that it depends on are installed.
2776 # This wrapper script should never be moved out of the build directory.
2777 # If it is, it will not operate correctly.
2779 # Sed substitution that helps us do robust quoting. It backslashifies
2780 # metacharacters that are still active within double-quoted strings.
2781 Xsed='sed -e 1s/^X//'
2782 sed_quote_subst='$sed_quote_subst'
2784 # The HP-UX ksh and POSIX shell print the target directory to stdout
2786 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
2788 relink_command=\"$relink_command\"
2790 # This environment variable determines our operation mode.
2791 if test \"\$libtool_install_magic\" = \"$magic\"; then
2792 # install mode needs the following variable:
2793 link_against_libtool_libs='$link_against_libtool_libs'
2795 # When we are sourced in execute mode, \$file and \$echo are already set.
2796 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2799 # Make sure echo works.
2800 if test \"X\$1\" = X--no-reexec; then
2801 # Discard the --no-reexec flag, and continue.
2803 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
2804 # Yippee, \$echo works!
2807 # Restart under the correct shell, and then maybe \$echo will work.
2808 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2814 # Find the directory that this script lives in.
2815 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2816 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2818 # Follow symbolic links until we get to the real thisdir.
2819 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
2820 while test -n \"\$file\"; do
2821 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2823 # If there was a directory component, then change thisdir.
2824 if test \"x\$destdir\" != \"x\$file\"; then
2825 case \"\$destdir\" in
2826 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
2827 *) thisdir=\"\$thisdir/\$destdir\" ;;
2831 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2832 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
2835 # Try to get the absolute directory name.
2836 absdir=\`cd \"\$thisdir\" && pwd\`
2837 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2840 if test "$fast_install" = yes; then
2842 program=lt-'$outputname'
2843 progdir=\"\$thisdir/$objdir\"
2845 if test ! -f \"\$progdir/\$program\" || \\
2846 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
2847 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2849 file=\"\$\$-\$program\"
2851 if test ! -d \"\$progdir\"; then
2852 $mkdir \"\$progdir\"
2854 $rm \"\$progdir/\$file\"
2859 # relink executable if necessary
2860 if test -n \"\$relink_command\"; then
2861 if (cd \"\$thisdir\" && eval \$relink_command); then :
2863 $rm \"\$progdir/\$file\"
2868 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2869 { $rm \"\$progdir/\$program\";
2870 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2871 $rm \"\$progdir/\$file\"
2875 program='$outputname$exeext'
2876 progdir=\"\$thisdir/$objdir\"
2882 if test -f \"\$progdir/\$program\"; then"
2884 # Export our shlibpath_var if we have one.
2885 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2887 # Add our own library path to $shlibpath_var
2888 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2890 # Some systems cannot cope with colon-terminated $shlibpath_var
2891 # The second colon is a workaround for a bug in BeOS R4 sed
2892 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2894 export $shlibpath_var
2898 # fixup the dll searchpath if we need to.
2899 if test -n "$dllsearchpath"; then
2901 # Add the dll search path components to the executable PATH
2902 PATH=$dllsearchpath:\$PATH
2907 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2908 # Run the actual program with our arguments.
2911 *-*-cygwin* | *-*-mingw | *-*-os2*)
2912 # win32 systems need to use the prog path for dll
2915 exec \$progdir\\\\\$program \${1+\"\$@\"}
2920 # Export the path to the program.
2921 PATH=\"\$progdir:\$PATH\"
2924 exec \$program \${1+\"\$@\"}
2929 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
2933 # The program doesn't exist.
2934 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
2935 \$echo \"This script is just a wrapper for \$program.\" 1>&2
2936 echo \"See the $PACKAGE documentation for more information.\" 1>&2
2947 # See if we need to build an old-fashioned archive.
2948 for oldlib in $oldlibs; do
2950 if test "$build_libtool_libs" = convenience; then
2951 oldobjs="$libobjs_save"
2952 addlibs="$convenience"
2953 build_libtool_libs=no
2955 if test "$build_libtool_libs" = module; then
2956 oldobjs="$libobjs_save"
2957 build_libtool_libs=no
2959 oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
2961 addlibs="$old_convenience"
2964 if test -n "$addlibs"; then
2965 gentop="$output_objdir/${outputname}x"
2966 $show "${rm}r $gentop"
2967 $run ${rm}r "$gentop"
2968 $show "mkdir $gentop"
2969 $run mkdir "$gentop"
2971 if test $status -ne 0 && test ! -d "$gentop"; then
2974 generated="$generated $gentop"
2976 # Add in members from convenience archives.
2977 for xlib in $addlibs; do
2978 # Extract the objects.
2980 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2981 *) xabs=`pwd`"/$xlib" ;;
2983 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2984 xdir="$gentop/$xlib"
2986 $show "${rm}r $xdir"
2991 if test $status -ne 0 && test ! -d "$xdir"; then
2994 $show "(cd $xdir && $AR x $xabs)"
2995 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2997 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3001 # Do each command in the archive commands.
3002 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3003 eval cmds=\"$old_archive_from_new_cmds\"
3005 # Ensure that we have .o objects in place incase we decided
3006 # not to build a shared library, and have fallen back to building
3007 # static libs even though --disable-static was passed!
3008 for oldobj in $oldobjs; do
3009 if test ! -f $oldobj; then
3010 obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
3011 $show "${LN_S} $obj $oldobj"
3012 $run ${LN_S} $obj $oldobj || exit $?
3016 eval cmds=\"$old_archive_cmds\"
3018 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3019 for cmd in $cmds; do
3022 $run eval "$cmd" || exit $?
3027 if test -n "$generated"; then
3028 $show "${rm}r$generated"
3029 $run ${rm}r$generated
3032 # Now create the libtool archive.
3036 test "$build_old_libs" = yes && old_library="$libname.$libext"
3037 $show "creating $output"
3039 if test -n "$xrpath"; then
3041 for libdir in $xrpath; do
3042 temp_xrpath="$temp_xrpath -R$libdir"
3044 dependency_libs="$temp_xrpath $dependency_libs"
3047 # Only create the output if not a dry run.
3048 if test -z "$run"; then
3049 for installed in no yes; do
3050 if test "$installed" = yes; then
3051 if test -z "$install_libdir"; then
3054 output="$output_objdir/$outputname"i
3058 # $outputname - a libtool library file
3059 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3061 # Please DO NOT delete this file!
3062 # It is necessary for linking the library.
3064 # The name that we can dlopen(3).
3067 # Names of this library.
3068 library_names='$library_names'
3070 # The name of the static archive.
3071 old_library='$old_library'
3073 # Libraries that this one depends upon.
3074 dependency_libs='$dependency_libs'
3076 # Version information for $libname.
3081 # Is this an already installed library?
3082 installed=$installed
3084 # Directory that this library needs to be installed in:
3085 libdir='$install_libdir'\
3090 # Do a symbolic link so that the libtool archive can be found in
3091 # LD_LIBRARY_PATH before the program is installed.
3092 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3093 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
3099 # libtool install mode
3101 modename="$modename: install"
3103 # There may be an optional sh(1) argument at the beginning of
3104 # install_prog (especially on Windows NT).
3105 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
3106 # Aesthetically quote it.
3107 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3109 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3113 install_prog="$arg "
3121 # The real first argument should be the name of the installation program.
3122 # Aesthetically quote it.
3123 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3125 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3129 install_prog="$install_prog$arg"
3131 # We need to accept at least all the BSD install flags.
3141 if test -n "$dest"; then
3142 files="$files $dest"
3160 # If the previous option needed an argument, then skip it.
3161 if test -n "$prev"; then
3170 # Aesthetically quote the argument.
3171 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3173 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3177 install_prog="$install_prog $arg"
3180 if test -z "$install_prog"; then
3181 $echo "$modename: you must specify an install program" 1>&2
3186 if test -n "$prev"; then
3187 $echo "$modename: the \`$prev' option requires an argument" 1>&2
3192 if test -z "$files"; then
3193 if test -z "$dest"; then
3194 $echo "$modename: no file or destination specified" 1>&2
3196 $echo "$modename: you must specify a destination" 1>&2
3202 # Strip any trailing slash from the destination.
3203 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3205 # Check to see that the destination is a directory.
3206 test -d "$dest" && isdir=yes
3207 if test "$isdir" = yes; then
3211 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3212 test "X$destdir" = "X$dest" && destdir=.
3213 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3215 # Not a directory, so check to see that there is only one file specified.
3217 if test $# -gt 2; then
3218 $echo "$modename: \`$dest' is not a directory" 1>&2
3224 [\\/]* | [A-Za-z]:[\\/]*) ;;
3226 for file in $files; do
3230 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3239 # This variable tells wrapper scripts just to set variables rather
3240 # than running their programs.
3241 libtool_install_magic="$magic"
3246 for file in $files; do
3248 # Do each installation.
3251 # Do the static libraries later.
3252 staticlibs="$staticlibs $file"
3256 # Check to see that this really is a libtool archive.
3257 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3259 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3266 # If there is no directory component, then add one.
3268 */* | *\\*) . $file ;;
3272 # Add the libdir to current_libdirs if it is the destination.
3273 if test "X$destdir" = "X$libdir"; then
3274 case "$current_libdirs " in
3276 *) current_libdirs="$current_libdirs $libdir" ;;
3279 # Note the libdir as a future libdir.
3280 case "$future_libdirs " in
3282 *) future_libdirs="$future_libdirs $libdir" ;;
3286 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
3287 test "X$dir" = "X$file/" && dir=
3290 # See the names of the shared library.
3291 set dummy $library_names
3292 if test -n "$2"; then
3297 # Install the shared library and build the symlinks.
3298 $show "$install_prog $dir/$realname $destdir/$realname"
3299 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
3301 if test $# -gt 0; then
3302 # Delete the old symlinks, and create new ones.
3305 if test "$linkname" != "$realname"; then
3306 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3307 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3312 # Do each command in the postinstall commands.
3313 lib="$destdir/$realname"
3314 eval cmds=\"$postinstall_cmds\"
3315 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3316 for cmd in $cmds; do
3319 $run eval "$cmd" || exit $?
3324 # Install the pseudo-library for information purposes.
3325 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3326 instname="$dir/$name"i
3327 $show "$install_prog $instname $destdir/$name"
3328 $run eval "$install_prog $instname $destdir/$name" || exit $?
3330 # Maybe install the static library, too.
3331 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
3335 # Install (i.e. copy) a libtool object.
3337 # Figure out destination file name, if it wasn't already specified.
3338 if test -n "$destname"; then
3339 destfile="$destdir/$destname"
3341 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3342 destfile="$destdir/$destfile"
3345 # Deduce the name of the destination old-style object file.
3348 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
3351 staticdest="$destfile"
3355 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
3361 # Install the libtool object if requested.
3362 if test -n "$destfile"; then
3363 $show "$install_prog $file $destfile"
3364 $run eval "$install_prog $file $destfile" || exit $?
3367 # Install the old object if enabled.
3368 if test "$build_old_libs" = yes; then
3369 # Deduce the name of the old-style object file.
3370 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
3372 $show "$install_prog $staticobj $staticdest"
3373 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
3379 # Figure out destination file name, if it wasn't already specified.
3380 if test -n "$destname"; then
3381 destfile="$destdir/$destname"
3383 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3384 destfile="$destdir/$destfile"
3387 # Do a test to see if this is really a libtool program.
3388 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3389 link_against_libtool_libs=
3392 # If there is no directory component, then add one.
3394 */* | *\\*) . $file ;;
3398 # Check the variables that should have been set.
3399 if test -z "$link_against_libtool_libs"; then
3400 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
3405 for lib in $link_against_libtool_libs; do
3406 # Check to see that each library is installed.
3408 if test -f "$lib"; then
3409 # If there is no directory component, then add one.
3411 */* | *\\*) . $lib ;;
3415 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
3416 if test -n "$libdir" && test ! -f "$libfile"; then
3417 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
3423 if test "$fast_install" = no && test -n "$relink_command"; then
3424 if test "$finalize" = yes && test -z "$run"; then
3426 test -n "$TMPDIR" && tmpdir="$TMPDIR"
3427 tmpdir="$tmpdir/libtool-$$"
3428 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
3430 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
3433 outputname="$tmpdir/$file"
3434 # Replace the output file specification.
3435 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
3437 $show "$relink_command"
3438 if $run eval "$relink_command"; then :
3440 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
3446 $echo "$modename: warning: cannot relink \`$file'" 1>&2
3449 # Install the binary that we compiled earlier.
3450 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
3454 $show "$install_prog$stripme $file $destfile"
3455 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
3456 test -n "$outputname" && ${rm}r "$tmpdir"
3461 for file in $staticlibs; do
3462 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3464 # Set up the ranlib parameters.
3465 oldlib="$destdir/$name"
3467 $show "$install_prog $file $oldlib"
3468 $run eval "$install_prog \$file \$oldlib" || exit $?
3470 # Do each command in the postinstall commands.
3471 eval cmds=\"$old_postinstall_cmds\"
3472 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3473 for cmd in $cmds; do
3476 $run eval "$cmd" || exit $?
3481 if test -n "$future_libdirs"; then
3482 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
3485 if test -n "$current_libdirs"; then
3486 # Maybe just do a dry run.
3487 test -n "$run" && current_libdirs=" -n$current_libdirs"
3488 exec $SHELL $0 --finish$current_libdirs
3495 # libtool finish mode
3497 modename="$modename: finish"
3501 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3504 libdirs="$libdirs $dir"
3507 for libdir in $libdirs; do
3508 if test -n "$finish_cmds"; then
3509 # Do each command in the finish commands.
3510 eval cmds=\"$finish_cmds\"
3511 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3512 for cmd in $cmds; do
3515 $run eval "$cmd" || admincmds="$admincmds
3520 if test -n "$finish_eval"; then
3521 # Do the single finish_eval.
3522 eval cmds=\"$finish_eval\"
3523 $run eval "$cmds" || admincmds="$admincmds
3529 # Exit here if they wanted silent mode.
3530 test "$show" = : && exit 0
3532 echo "----------------------------------------------------------------------"
3533 echo "Libraries have been installed in:"
3534 for libdir in $libdirs; do
3538 echo "If you ever happen to want to link against installed libraries"
3539 echo "in a given directory, LIBDIR, you must either use libtool, and"
3540 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
3541 echo "flag during linking and do at least one of the following:"
3542 if test -n "$shlibpath_var"; then
3543 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3544 echo " during execution"
3546 if test -n "$runpath_var"; then
3547 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3548 echo " during linking"
3550 if test -n "$hardcode_libdir_flag_spec"; then
3552 eval flag=\"$hardcode_libdir_flag_spec\"
3554 echo " - use the \`$flag' linker flag"
3556 if test -n "$admincmds"; then
3557 echo " - have your system administrator run these commands:$admincmds"
3559 if test -f /etc/ld.so.conf; then
3560 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3563 echo "See any operating system documentation about shared libraries for"
3564 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3565 echo "----------------------------------------------------------------------"
3569 # libtool execute mode
3571 modename="$modename: execute"
3573 # The first argument is the command name.
3575 if test -z "$cmd"; then
3576 $echo "$modename: you must specify a COMMAND" 1>&2
3581 # Handle -dlopen flags immediately.
3582 for file in $execute_dlfiles; do
3583 if test ! -f "$file"; then
3584 $echo "$modename: \`$file' is not a file" 1>&2
3592 # Check to see that this really is a libtool archive.
3593 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3595 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3600 # Read the libtool library.
3604 # If there is no directory component, then add one.
3606 */* | *\\*) . $file ;;
3610 # Skip this library if it cannot be dlopened.
3611 if test -z "$dlname"; then
3612 # Warn if it was a shared library.
3613 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
3617 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3618 test "X$dir" = "X$file" && dir=.
3620 if test -f "$dir/$objdir/$dlname"; then
3623 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
3629 # Just add the directory containing the .lo file.
3630 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3631 test "X$dir" = "X$file" && dir=.
3635 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
3640 # Get the absolute pathname.
3641 absdir=`cd "$dir" && pwd`
3642 test -n "$absdir" && dir="$absdir"
3644 # Now add the directory to shlibpath_var.
3645 if eval "test -z \"\$$shlibpath_var\""; then
3646 eval "$shlibpath_var=\"\$dir\""
3648 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3652 # This variable tells wrapper scripts just to set shlibpath_var
3653 # rather than running their programs.
3654 libtool_execute_magic="$magic"
3656 # Check if any of the arguments is a wrapper script.
3663 # Do a test to see if this is really a libtool program.
3664 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3665 # If there is no directory component, then add one.
3667 */* | *\\*) . $file ;;
3671 # Transform arg to wrapped name.
3672 file="$progdir/$program"
3676 # Quote arguments (to preserve shell metacharacters).
3677 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
3678 args="$args \"$file\""
3681 if test -z "$run"; then
3682 # Export the shlibpath_var.
3683 eval "export $shlibpath_var"
3685 # Restore saved enviroment variables
3686 if test "${save_LC_ALL+set}" = set; then
3687 LC_ALL="$save_LC_ALL"; export LC_ALL
3689 if test "${save_LANG+set}" = set; then
3690 LANG="$save_LANG"; export LANG
3693 # Now actually exec the command.
3694 eval "exec \$cmd$args"
3696 $echo "$modename: cannot exec \$cmd$args"
3699 # Display what would be done.
3700 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
3701 $echo "export $shlibpath_var"
3707 # libtool uninstall mode
3709 modename="$modename: uninstall"
3716 -*) rm="$rm $arg" ;;
3717 *) files="$files $arg" ;;
3721 if test -z "$rm"; then
3722 $echo "$modename: you must specify an RM program" 1>&2
3727 for file in $files; do
3728 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3729 test "X$dir" = "X$file" && dir=.
3730 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3736 # Possibly a libtool archive, so verify it.
3737 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3740 # Delete the libtool libraries and symlinks.
3741 for n in $library_names; do
3742 rmfiles="$rmfiles $dir/$n"
3744 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
3746 $show "$rm $rmfiles"
3749 if test -n "$library_names"; then
3750 # Do each command in the postuninstall commands.
3751 eval cmds=\"$postuninstall_cmds\"
3752 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3753 for cmd in $cmds; do
3761 if test -n "$old_library"; then
3762 # Do each command in the old_postuninstall commands.
3763 eval cmds=\"$old_postuninstall_cmds\"
3764 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3765 for cmd in $cmds; do
3773 # FIXME: should reinstall the best remaining shared library.
3778 if test "$build_old_libs" = yes; then
3779 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
3780 rmfiles="$rmfiles $dir/$oldobj"
3782 $show "$rm $rmfiles"
3787 $show "$rm $rmfiles"
3796 $echo "$modename: you must specify a MODE" 1>&2
3797 $echo "$generic_help" 1>&2
3802 $echo "$modename: invalid operation mode \`$mode'" 1>&2
3803 $echo "$generic_help" 1>&2
3805 fi # test -z "$show_help"
3807 # We need to display help for each of the modes.
3810 "Usage: $modename [OPTION]... [MODE-ARG]...
3812 Provide generalized library-building support services.
3814 --config show all configuration variables
3815 --debug enable verbose shell tracing
3816 -n, --dry-run display commands without modifying any files
3817 --features display basic configuration information and exit
3818 --finish same as \`--mode=finish'
3819 --help display this help message and exit
3820 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
3821 --quiet same as \`--silent'
3822 --silent don't print informational messages
3823 --version print version information
3825 MODE must be one of the following:
3827 compile compile a source file into a libtool object
3828 execute automatically set library path, then run a program
3829 finish complete the installation of libtool libraries
3830 install install libraries or executables
3831 link create a library or an executable
3832 uninstall remove libraries from an installed directory
3834 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
3835 a more detailed description of MODE."
3841 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
3843 Compile a source file into a libtool library object.
3845 This mode accepts the following additional options:
3847 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
3848 -static always build a \`.o' file suitable for static linking
3850 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
3851 from the given SOURCEFILE.
3853 The output file name is determined by removing the directory component from
3854 SOURCEFILE, then substituting the C source code suffix \`.c' with the
3855 library object suffix, \`.lo'."
3860 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
3862 Automatically set library path, then run a program.
3864 This mode accepts the following additional options:
3866 -dlopen FILE add the directory containing FILE to the library path
3868 This mode sets the library path environment variable according to \`-dlopen'
3871 If any of the ARGS are libtool executable wrappers, then they are translated
3872 into their corresponding uninstalled binary, and any of their required library
3873 directories are added to the library path.
3875 Then, COMMAND is executed, with ARGS as arguments."
3880 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
3882 Complete the installation of libtool libraries.
3884 Each LIBDIR is a directory that contains libtool libraries.
3886 The commands that this mode executes may require superuser privileges. Use
3887 the \`--dry-run' option if you just want to see what would be executed."
3892 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
3894 Install executables or libraries.
3896 INSTALL-COMMAND is the installation command. The first component should be
3897 either the \`install' or \`cp' program.
3899 The rest of the components are interpreted as arguments to that command (only
3900 BSD-compatible install options are recognized)."
3905 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
3907 Link object files or libraries together to form another library, or to
3908 create an executable program.
3910 LINK-COMMAND is a command using the C compiler that you would use to create
3911 a program from several object files.
3913 The following components of LINK-COMMAND are treated specially:
3915 -all-static do not do any dynamic linking at all
3916 -avoid-version do not add a version suffix if possible
3917 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
3918 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
3919 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3920 -export-symbols SYMFILE
3921 try to export only the symbols listed in SYMFILE
3922 -export-symbols-regex REGEX
3923 try to export only the symbols matching REGEX
3924 -LLIBDIR search LIBDIR for required installed libraries
3925 -lNAME OUTPUT-FILE requires the installed library libNAME
3926 -module build a library that can dlopened
3927 -no-undefined declare that a library does not refer to external symbols
3928 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
3929 -release RELEASE specify package release information
3930 -rpath LIBDIR the created library will eventually be installed in LIBDIR
3931 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
3932 -static do not do any dynamic linking of libtool libraries
3933 -version-info CURRENT[:REVISION[:AGE]]
3934 specify library version info [each variable defaults to 0]
3936 All other options (arguments beginning with \`-') are ignored.
3938 Every other argument is treated as a filename. Files ending in \`.la' are
3939 treated as uninstalled libtool libraries, other files are standard or library
3942 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
3943 only library objects (\`.lo' files) may be specified, and \`-rpath' is
3944 required, except when creating a convenience library.
3946 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
3947 using \`ar' and \`ranlib', or on Windows using \`lib'.
3949 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
3950 is created, otherwise an executable program is created."
3955 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
3957 Remove libraries from an installation directory.
3959 RM is the name of the program to use to delete files associated with each FILE
3960 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
3963 If FILE is a libtool library, all the files associated with it are deleted.
3964 Otherwise, only FILE itself is deleted using RM."
3968 $echo "$modename: invalid operation mode \`$mode'" 1>&2
3975 $echo "Try \`$modename --help' for more information about other modes."