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, 2000 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.196 1999/12/07 21:47:57)"
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 if test -z "$show_help"; then
212 # Infer the operation mode.
213 if test -z "$mode"; then
215 *cc | *++ | gcc* | *-gcc*)
227 *db | *dbx | *strace | *truss)
237 # If we have no mode, but dlfiles were specified, then do execute mode.
238 test -n "$execute_dlfiles" && mode=execute
240 # Just use the default operation mode.
241 if test -z "$mode"; then
242 if test -n "$nonopt"; then
243 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
245 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
252 # Only execute mode is allowed to have -dlopen flags.
253 if test -n "$execute_dlfiles" && test "$mode" != execute; then
254 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
259 # Change the help message to a mode-specific one.
261 help="Try \`$modename --help --mode=$mode' for more information."
263 # These modes are in order of execution frequency so that they run quickly.
265 # libtool compile mode
267 modename="$modename: compile"
268 # Get the compilation command and the source file.
277 # Accept any command-line options.
280 if test "$user_target" != "no"; then
281 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
293 case "$user_target" in
295 # The next one is the -o target name
300 # We got the output file
307 # Accept the current argument as the source file.
311 # Aesthetically quote the previous argument.
313 # Backslashify any backslashes, double quotes, and dollar signs.
314 # These are the only characters that are still specially
315 # interpreted inside of double-quoted scrings.
316 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
318 # Double-quote args containing other shell metacharacters.
319 # Many Bourne shells cannot handle close brackets correctly in scan
320 # sets, so we specify it separately.
322 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
323 lastarg="\"$lastarg\""
327 # Add the previous argument to base_compile.
328 if test -z "$base_compile"; then
329 base_compile="$lastarg"
331 base_compile="$base_compile $lastarg"
335 case "$user_target" in
339 # Get the name of the library object.
340 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
343 $echo "$modename: you must specify a target with \`-o'" 1>&2
348 # Recognize several different file suffixes.
349 # If the user specifies -o file.o, it is replaced with file.lo
364 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
367 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
369 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
374 if test -z "$base_compile"; then
375 $echo "$modename: you must specify a compilation command" 1>&2
380 # Delete any leftover library objects.
381 if test "$build_old_libs" = yes; then
382 removelist="$obj $libobj"
388 trap "$run $rm $removelist; exit 1" 1 2 15
390 # Calculate the filename of the output object if compiler does
391 # not support -o with -c
392 if test "$compiler_c_o" = no; then
393 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
394 lockfile="$output_obj.lock"
395 removelist="$removelist $output_obj $lockfile"
396 trap "$run $rm $removelist; exit 1" 1 2 15
402 # Lock this critical section if it is needed
403 # We use this script file to make the link, it avoids creating a new file
404 if test "$need_locks" = yes; then
405 until ln "$0" "$lockfile" 2>/dev/null; do
406 $show "Waiting for $lockfile to be removed"
409 elif test "$need_locks" = warn; then
410 if test -f "$lockfile"; then
412 *** ERROR, $lockfile exists and contains:
413 `cat $lockfile 2>/dev/null`
415 This indicates that another process is trying to use the same
416 temporary object file, and libtool could not work around it because
417 your compiler does not support \`-c' and \`-o' together. If you
418 repeat this compilation, it may succeed, by chance, but you had better
419 avoid parallel builds (make -j) in this platform, or get a better
425 echo $srcfile > "$lockfile"
428 if test -n "$fix_srcfile_path"; then
429 eval srcfile=\"$fix_srcfile_path\"
432 # Only build a PIC object if we are building libtool libraries.
433 if test "$build_libtool_libs" = yes; then
434 # Without this assignment, base_compile gets emptied.
435 fbsd_hideous_sh_bug=$base_compile
437 # All platforms use -DPIC, to notify preprocessed assembler code.
438 # However, make sure we only set it for non-Java code.
441 command="$base_compile $pic_flag $srcfile";;
443 command="$base_compile $srcfile $pic_flag -DPIC";;
445 if test "$build_old_libs" = yes; then
447 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
448 if test "X$dir" = "X$libobj"; then
453 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
455 if test -d "$dir"; then
462 if test $status -ne 0 && test ! -d $dir; then
467 if test "$compiler_o_lo" = yes; then
469 command="$command -o $output_obj"
470 elif test "$compiler_c_o" = yes; then
472 command="$command -o $output_obj"
475 $run $rm "$output_obj"
477 if $run eval "$command"; then :
479 test -n "$output_obj" && $run $rm $removelist
483 if test "$need_locks" = warn &&
484 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
486 *** ERROR, $lockfile contains:
487 `cat $lockfile 2>/dev/null`
489 but it should contain:
492 This indicates that another process is trying to use the same
493 temporary object file, and libtool could not work around it because
494 your compiler does not support \`-c' and \`-o' together. If you
495 repeat this compilation, it may succeed, by chance, but you had better
496 avoid parallel builds (make -j) in this platform, or get a better
503 # Just move the object if needed, then go on to compile the next one
504 if test x"$output_obj" != x"$libobj"; then
505 $show "$mv $output_obj $libobj"
506 if $run $mv $output_obj $libobj; then :
514 # If we have no pic_flag, then copy the object into place and finish.
515 if test -z "$pic_flag" && test "$build_old_libs" = yes; then
516 # Rename the .lo from within objdir to obj
517 if test -f $obj; then
522 $show "$mv $libobj $obj"
523 if $run $mv $libobj $obj; then :
530 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
531 if test "X$xdir" = "X$obj"; then
536 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
537 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
538 # Now arrange that obj and lo_libobj become the same file
539 $show "(cd $xdir && $LN_S $baseobj $libobj)"
540 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
549 # Allow error messages only from the first compilation.
550 suppress_output=' >/dev/null 2>&1'
553 # Only build a position-dependent object if we build old libraries.
554 if test "$build_old_libs" = yes; then
555 command="$base_compile $srcfile"
556 if test "$compiler_c_o" = yes; then
557 command="$command -o $obj"
561 # Suppress compiler output if we already did a PIC compilation.
562 command="$command$suppress_output"
563 $run $rm "$output_obj"
565 if $run eval "$command"; then :
571 if test "$need_locks" = warn &&
572 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
574 *** ERROR, $lockfile contains:
575 `cat $lockfile 2>/dev/null`
577 but it should contain:
580 This indicates that another process is trying to use the same
581 temporary object file, and libtool could not work around it because
582 your compiler does not support \`-c' and \`-o' together. If you
583 repeat this compilation, it may succeed, by chance, but you had better
584 avoid parallel builds (make -j) in this platform, or get a better
591 # Just move the object if needed
592 if test x"$output_obj" != x"$obj"; then
593 $show "$mv $output_obj $obj"
594 if $run $mv $output_obj $obj; then :
602 # Create an invalid libtool object if no PIC, so that we do not
603 # accidentally link it into a program.
604 if test "$build_libtool_libs" != yes; then
605 $show "echo timestamp > $libobj"
606 $run eval "echo timestamp > \$libobj" || exit $?
608 # Move the .lo from within objdir
609 $show "$mv $libobj $lo_libobj"
610 if $run $mv $libobj $lo_libobj; then :
619 # Unlock the critical section if it was locked
620 if test "$need_locks" != no; then
629 modename="$modename: link"
630 C_compiler="$CC" # save it, to compile generated C sources
631 # Always respect the CC configured in by ltconfig.
633 # CYGNUS LOCAL: tromey/java
634 # Add -B options to link line.
645 *-*-cygwin* | *-*-mingw* | *-*-os2*)
646 # It is impossible to link a dll without this setting, and
647 # we shouldn't force the makefile maintainer to figure out
648 # which system we are compiling for in order to pass an extra
649 # flag for every libtool invokation.
652 # FIXME: Unfortunately, there are problems with the above when trying
653 # to make a dll which has undefined symbols, in which case not
654 # even a static library is built. For now, we need to specify
655 # -no-undefined on the libtool link line when we can be certain
656 # that all symbols are satisfied, otherwise we get a static library.
659 # This is a source program that is used to create dlls on Windows
660 # Don't remove nor modify the starting and closing comments
661 # /* ltdll.c starts here */
662 # #define WIN32_LEAN_AND_MEAN
663 # #include <windows.h>
664 # #undef WIN32_LEAN_AND_MEAN
668 # # ifdef __CYGWIN32__
669 # # define __CYGWIN__ __CYGWIN32__
676 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
682 # #include <cygwin/cygwin_dll.h>
683 # DECLARE_CYGWIN_DLL( DllMain );
685 # HINSTANCE __hDllInstance_base;
688 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
690 # __hDllInstance_base = hInst;
693 # /* ltdll.c ends here */
694 # This is a source program that is used to create import libraries
695 # on Windows for dlls which lack them. Don't remove nor modify the
696 # starting and closing comments
697 # /* impgen.c starts here */
698 # /* Copyright (C) 1999 Free Software Foundation, Inc.
700 # This file is part of GNU libtool.
702 # This program is free software; you can redistribute it and/or modify
703 # it under the terms of the GNU General Public License as published by
704 # the Free Software Foundation; either version 2 of the License, or
705 # (at your option) any later version.
707 # This program is distributed in the hope that it will be useful,
708 # but WITHOUT ANY WARRANTY; without even the implied warranty of
709 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
710 # GNU General Public License for more details.
712 # You should have received a copy of the GNU General Public License
713 # along with this program; if not, write to the Free Software
714 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
717 # #include <stdio.h> /* for printf() */
718 # #include <unistd.h> /* for open(), lseek(), read() */
719 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
720 # #include <string.h> /* for strdup() */
722 # static unsigned int
723 # pe_get16 (fd, offset)
727 # unsigned char b[2];
728 # lseek (fd, offset, SEEK_SET);
730 # return b[0] + (b[1]<<8);
733 # static unsigned int
734 # pe_get32 (fd, offset)
738 # unsigned char b[4];
739 # lseek (fd, offset, SEEK_SET);
741 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
744 # static unsigned int
748 # unsigned char *b = ptr;
749 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
758 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
759 # unsigned long export_rva, export_size, nsections, secptr, expptr;
760 # unsigned long name_rvas, nexp;
761 # unsigned char *expdata, *erva;
762 # char *filename, *dll_name;
764 # filename = argv[1];
766 # dll = open(filename, O_RDONLY|O_BINARY);
770 # dll_name = filename;
772 # for (i=0; filename[i]; i++)
773 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
774 # dll_name = filename + i +1;
776 # pe_header_offset = pe_get32 (dll, 0x3c);
777 # opthdr_ofs = pe_header_offset + 4 + 20;
778 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
780 # if (num_entries < 1) /* no exports */
783 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
784 # export_size = pe_get32 (dll, opthdr_ofs + 100);
785 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
786 # secptr = (pe_header_offset + 4 + 20 +
787 # pe_get16 (dll, pe_header_offset + 4 + 16));
790 # for (i = 0; i < nsections; i++)
793 # unsigned long secptr1 = secptr + 40 * i;
794 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
795 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
796 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
797 # lseek(dll, secptr1, SEEK_SET);
798 # read(dll, sname, 8);
799 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
801 # expptr = fptr + (export_rva - vaddr);
802 # if (export_rva + export_size > vaddr + vsize)
803 # export_size = vsize - (export_rva - vaddr);
808 # expdata = (unsigned char*)malloc(export_size);
809 # lseek (dll, expptr, SEEK_SET);
810 # read (dll, expdata, export_size);
811 # erva = expdata - export_rva;
813 # nexp = pe_as32 (expdata+24);
814 # name_rvas = pe_as32 (expdata+32);
816 # printf ("EXPORTS\n");
817 # for (i = 0; i<nexp; i++)
819 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
820 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
825 # /* impgen.c ends here */
831 compile_command="$nonopt"
832 finalize_command="$nonopt"
843 if test -n "$shlibpath_var"; then
844 # get the directories listed in $shlibpath_var
845 eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
849 # now prepend the system-specific ones
850 eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
851 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
859 export_symbols_regex=
862 link_against_libtool_libs=
866 prefer_static_libs=no
878 # We need to know -static, to get the right output filenames.
882 -all-static | -static)
883 if test "X$arg" = "X-all-static"; then
884 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
885 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
887 if test -n "$link_static_flag"; then
888 dlopen_self=$dlopen_self_static
891 if test -z "$pic_flag" && test -n "$link_static_flag"; then
892 dlopen_self=$dlopen_self_static
895 build_libtool_libs=no
897 prefer_static_libs=yes
903 # See if our shared archives depend on static archives.
904 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
906 # Go through the arguments, transforming them on the way.
907 while test $# -gt 0; do
911 # If the previous option needs an argument, assign it.
912 if test -n "$prev"; then
915 compile_command="$compile_command @OUTPUT@"
916 finalize_command="$finalize_command @OUTPUT@"
922 if test "$preload" = no; then
923 # Add the symbol object into the linking commands.
924 compile_command="$compile_command @SYMFILE@"
925 finalize_command="$finalize_command @SYMFILE@"
929 *.la | *.lo) ;; # We handle these cases below.
931 if test "$dlself" = no; then
939 if test "$prev" = dlprefiles; then
941 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
951 if test "$prev" = dlfiles; then
952 dlfiles="$dlfiles $arg"
954 dlprefiles="$dlprefiles $arg"
961 export_symbols="$arg"
962 if test ! -f "$arg"; then
963 $echo "$modename: symbol file \`$arg' does not exist"
970 export_symbols_regex="$arg"
980 # We need an absolute path.
982 [\\/]* | [A-Za-z]:[\\/]*) ;;
984 $echo "$modename: only absolute run-paths are allowed" 1>&2
988 if test "$prev" = rpath; then
991 *) rpath="$rpath $arg" ;;
996 *) xrpath="$xrpath $arg" ;;
1003 eval "$prev=\"\$arg\""
1014 if test -n "$link_static_flag"; then
1015 compile_command="$compile_command $link_static_flag"
1016 finalize_command="$finalize_command $link_static_flag"
1022 # FIXME: remove this flag sometime in the future.
1023 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1047 -export-symbols | -export-symbols-regex)
1048 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1049 $echo "$modename: not more than one -exported-symbols argument allowed"
1052 if test "X$arg" = "X-export-symbols"; then
1061 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1062 # We need an absolute path.
1064 [\\/]* | [A-Za-z]:[\\/]*) ;;
1066 absdir=`cd "$dir" && pwd`
1067 if test -z "$absdir"; then
1068 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1069 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1075 case " $deplibs " in
1077 *) deplibs="$deplibs $arg";;
1079 case " $lib_search_path " in
1081 *) lib_search_path="$lib_search_path $dir";;
1084 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1085 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1086 case ":$dllsearchpath:" in
1087 ::) dllsearchpath="$dllsearchdir";;
1088 *":$dllsearchdir:"*) ;;
1089 *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
1096 if test "$arg" = "-lc"; then
1098 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1099 # These systems don't actually have c library (as such)
1103 elif test "$arg" = "-lm"; then
1105 *-*-cygwin* | *-*-beos*)
1106 # These systems don't actually have math library (as such)
1111 deplibs="$deplibs $arg"
1142 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1143 # We need an absolute path.
1145 [\\/]* | [A-Za-z]:[\\/]*) ;;
1147 $echo "$modename: only absolute run-paths are allowed" 1>&2
1153 *) xrpath="$xrpath $dir" ;;
1159 # If we have no pic_flag, then this is the same as -all-static.
1160 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1161 compile_command="$compile_command $link_static_flag"
1162 finalize_command="$finalize_command $link_static_flag"
1177 # Some other compiler flag.
1179 # Unknown arguments in both finalize_command and compile_command need
1180 # to be aesthetically quoted because they are evaled later.
1181 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1183 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1189 *.o | *.obj | *.a | *.lib)
1190 # A standard object.
1196 if test "$prev" = dlfiles; then
1197 dlfiles="$dlfiles $arg"
1198 if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
1202 # If libtool objects are unsupported, then we need to preload.
1207 if test "$prev" = dlprefiles; then
1208 # Preload the old-style object.
1209 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1212 libobjs="$libobjs $arg"
1216 # A libtool-controlled library.
1223 # Check to see that this really is a libtool archive.
1224 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1226 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
1230 # If the library was installed with an old release of libtool,
1231 # it will not redefine variable installed.
1235 # If there is no directory component, then add one.
1237 */* | *\\*) . $arg ;;
1241 # Get the name of the library we link against.
1243 for l in $old_library $library_names; do
1247 if test -z "$linklib"; then
1248 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
1252 # Find the relevant object directory and library name.
1253 name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
1255 if test "X$installed" = Xyes; then
1258 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1259 if test "X$dir" = "X$arg"; then
1266 if test -n "$dependency_libs"; then
1267 # Extract -R and -L from dependency_libs
1269 for deplib in $dependency_libs; do
1271 -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1272 case " $rpath $xrpath " in
1273 *" $temp_xrpath "*) ;;
1274 *) xrpath="$xrpath $temp_xrpath";;
1276 -L*) case "$compile_command $temp_deplibs " in
1278 *) temp_deplibs="$temp_deplibs $deplib";;
1280 temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1281 case " $lib_search_path " in
1283 *) lib_search_path="$lib_search_path $temp_dir";;
1286 *) temp_deplibs="$temp_deplibs $deplib";;
1289 dependency_libs="$temp_deplibs"
1292 if test -z "$libdir"; then
1293 # It is a libtool convenience library, so add in its objects.
1294 convenience="$convenience $dir/$old_library"
1295 old_convenience="$old_convenience $dir/$old_library"
1296 deplibs="$deplibs$dependency_libs"
1297 compile_command="$compile_command $dir/$old_library$dependency_libs"
1298 finalize_command="$finalize_command $dir/$old_library$dependency_libs"
1302 # This library was specified with -dlopen.
1303 if test "$prev" = dlfiles; then
1304 dlfiles="$dlfiles $arg"
1305 if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
1306 # If there is no dlname, no dlopen support or we're linking statically,
1307 # we need to preload.
1310 # We should not create a dependency on this library, but we
1311 # may need any libraries it requires.
1312 compile_command="$compile_command$dependency_libs"
1313 finalize_command="$finalize_command$dependency_libs"
1319 # The library was specified with -dlpreopen.
1320 if test "$prev" = dlprefiles; then
1321 # Prefer using a static library (so that no silly _DYNAMIC symbols
1322 # are required to link).
1323 if test -n "$old_library"; then
1324 dlprefiles="$dlprefiles $dir/$old_library"
1326 dlprefiles="$dlprefiles $dir/$linklib"
1331 if test -n "$library_names" &&
1332 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1333 link_against_libtool_libs="$link_against_libtool_libs $arg"
1334 if test -n "$shlibpath_var"; then
1335 # Make sure the rpath contains only unique directories.
1336 case "$temp_rpath " in
1338 *) temp_rpath="$temp_rpath $dir" ;;
1342 # We need an absolute path.
1344 [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
1346 absdir=`cd "$dir" && pwd`
1347 if test -z "$absdir"; then
1348 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1349 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1355 # This is the magic to use -rpath.
1356 # Skip directories that are in the system default run-time
1357 # search path, unless they have been requested with -R.
1358 case " $sys_lib_dlsearch_path " in
1361 case "$compile_rpath " in
1363 *) compile_rpath="$compile_rpath $absdir"
1368 case " $sys_lib_dlsearch_path " in
1371 case "$finalize_rpath " in
1373 *) finalize_rpath="$finalize_rpath $libdir"
1379 case "$hardcode_action" in
1380 immediate | unsupported)
1381 if test "$hardcode_direct" = no; then
1382 compile_command="$compile_command $dir/$linklib"
1383 deplibs="$deplibs $dir/$linklib"
1385 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1386 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1387 if test -n "$dllsearchpath"; then
1388 dllsearchpath="$dllsearchpath:$dllsearchdir"
1390 dllsearchpath="$dllsearchdir"
1394 elif test "$hardcode_minus_L" = no; then
1397 compile_shlibpath="$compile_shlibpath$dir:"
1400 case "$compile_command " in
1402 *) compile_command="$compile_command -L$dir";;
1404 compile_command="$compile_command -l$name"
1405 deplibs="$deplibs -L$dir -l$name"
1406 elif test "$hardcode_shlibpath_var" = no; then
1407 case ":$compile_shlibpath:" in
1409 *) compile_shlibpath="$compile_shlibpath$dir:";;
1411 compile_command="$compile_command -l$name"
1412 deplibs="$deplibs -l$name"
1419 if test "$hardcode_direct" = yes; then
1420 compile_command="$compile_command $absdir/$linklib"
1421 deplibs="$deplibs $absdir/$linklib"
1422 elif test "$hardcode_minus_L" = yes; then
1423 case "$compile_command " in
1425 *) compile_command="$compile_command -L$absdir";;
1427 compile_command="$compile_command -l$name"
1428 deplibs="$deplibs -L$absdir -l$name"
1429 elif test "$hardcode_shlibpath_var" = yes; then
1430 case ":$compile_shlibpath:" in
1432 *) compile_shlibpath="$compile_shlibpath$absdir:";;
1434 compile_command="$compile_command -l$name"
1435 deplibs="$deplibs -l$name"
1446 if test "$lib_linked" != yes; then
1447 $echo "$modename: configuration error: unsupported hardcode properties"
1451 # Finalize command for both is simple: just hardcode it.
1452 if test "$hardcode_direct" = yes; then
1453 finalize_command="$finalize_command $libdir/$linklib"
1454 elif test "$hardcode_minus_L" = yes; then
1455 case "$finalize_command " in
1457 *) finalize_command="$finalize_command -L$libdir";;
1459 finalize_command="$finalize_command -l$name"
1460 elif test "$hardcode_shlibpath_var" = yes; then
1461 case ":$finalize_shlibpath:" in
1463 *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
1465 finalize_command="$finalize_command -l$name"
1467 # We cannot seem to hardcode it, guess we'll fake it.
1468 case "$finalize_command " in
1470 *) finalize_command="$finalize_command -L$libdir";;
1472 finalize_command="$finalize_command -l$name"
1475 # Transform directly to old archives if we don't build new libraries.
1476 if test -n "$pic_flag" && test -z "$old_library"; then
1477 $echo "$modename: cannot find static library for \`$arg'" 1>&2
1481 # Here we assume that one of hardcode_direct or hardcode_minus_L
1482 # is not unsupported. This is valid on all known static and
1484 if test "$hardcode_direct" != unsupported; then
1485 test -n "$old_library" && linklib="$old_library"
1486 compile_command="$compile_command $dir/$linklib"
1487 finalize_command="$finalize_command $dir/$linklib"
1489 case "$compile_command " in
1491 *) compile_command="$compile_command -L$dir";;
1493 compile_command="$compile_command -l$name"
1494 case "$finalize_command " in
1496 *) finalize_command="$finalize_command -L$dir";;
1498 finalize_command="$finalize_command -l$name"
1502 # Add in any libraries that this one depends upon.
1503 compile_command="$compile_command$dependency_libs"
1504 finalize_command="$finalize_command$dependency_libs"
1508 # Some other compiler argument.
1510 # Unknown arguments in both finalize_command and compile_command need
1511 # to be aesthetically quoted because they are evaled later.
1512 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1514 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1521 # Now actually substitute the argument into the commands.
1522 if test -n "$arg"; then
1523 compile_command="$compile_command $arg"
1524 finalize_command="$finalize_command $arg"
1528 if test -n "$prev"; then
1529 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1534 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1535 eval arg=\"$export_dynamic_flag_spec\"
1536 compile_command="$compile_command $arg"
1537 finalize_command="$finalize_command $arg"
1541 # calculate the name of the file, without its directory
1542 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1543 libobjs_save="$libobjs"
1547 $echo "$modename: you must specify an output file" 1>&2
1553 if test -n "$link_against_libtool_libs"; then
1554 $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
1558 if test -n "$deplibs"; then
1559 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1562 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1563 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1566 if test -n "$rpath"; then
1567 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
1570 if test -n "$xrpath"; then
1571 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
1574 if test -n "$vinfo"; then
1575 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1578 if test -n "$release"; then
1579 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
1582 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1583 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1586 # Now set the variables for building old libraries.
1587 build_libtool_libs=no
1592 # Make sure we only generate libraries of the form `libNAME.la'.
1593 case "$outputname" in
1595 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1596 eval libname=\"$libname_spec\"
1599 if test "$module" = no; then
1600 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
1604 if test "$need_lib_prefix" != no; then
1605 # Add the "lib" prefix for modules if required
1606 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1607 eval libname=\"$libname_spec\"
1609 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1614 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1615 if test "X$output_objdir" = "X$output"; then
1616 output_objdir="$objdir"
1618 output_objdir="$output_objdir/$objdir"
1621 if test -n "$objs"; then
1622 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1626 # How the heck are we supposed to write a wrapper for a shared library?
1627 if test -n "$link_against_libtool_libs"; then
1628 $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
1632 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1633 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1637 if test $# -gt 2; then
1638 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1643 if test -z "$rpath"; then
1644 if test "$build_libtool_libs" = yes; then
1645 # Building a libtool convenience library.
1647 oldlibs="$output_objdir/$libname.$libext $oldlibs"
1648 build_libtool_libs=convenience
1651 dependency_libs="$deplibs"
1653 if test -n "$vinfo"; then
1654 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1657 if test -n "$release"; then
1658 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1662 # Parse the version information argument.
1663 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
1664 set dummy $vinfo 0 0 0
1667 if test -n "$8"; then
1668 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1677 # Check that each of the things are valid numbers.
1679 0 | [1-9] | [1-9][0-9]*) ;;
1681 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1682 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1688 0 | [1-9] | [1-9][0-9]*) ;;
1690 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1691 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1697 0 | [1-9] | [1-9][0-9]*) ;;
1699 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1700 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1705 if test $age -gt $current; then
1706 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1707 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1711 # Calculate the version variables.
1715 case "$version_type" in
1719 major=`expr $current - $age + 1`
1720 versuffix="$major.$revision"
1721 verstring="sgi$major.$revision"
1723 # Add in all the interfaces that we are compatible with.
1725 while test $loop != 0; do
1726 iface=`expr $revision - $loop`
1727 loop=`expr $loop - 1`
1728 verstring="sgi$major.$iface:$verstring"
1733 major=.`expr $current - $age`
1734 versuffix="$major.$age.$revision"
1738 major=`expr $current - $age`
1739 versuffix=".$current.$age.$revision"
1740 verstring="$current.$age.$revision"
1742 # Add in all the interfaces that we are compatible with.
1744 while test $loop != 0; do
1745 iface=`expr $current - $loop`
1746 loop=`expr $loop - 1`
1747 verstring="$verstring:${iface}.0"
1750 # Make executables depend on our current version.
1751 verstring="$verstring:${current}.0"
1756 versuffix=".$current.$revision"
1761 versuffix=".$current.$revision";
1766 versuffix=".$current";
1770 # Like Linux, but with '-' rather than '.', since we only
1771 # want one extension on Windows 95.
1772 major=`expr $current - $age`
1773 versuffix="-$major-$age-$revision"
1777 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1778 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1783 # Clear the version info if we defaulted, and they specified a release.
1784 if test -z "$vinfo" && test -n "$release"; then
1787 if test "$need_version" = no; then
1794 # Remove version info from name if versioning should be avoided
1795 if test "$avoid_version" = yes && test "$need_version" = no; then
1801 # Check to see if the archive will have undefined symbols.
1802 if test "$allow_undefined" = yes; then
1803 if test "$allow_undefined_flag" = unsupported; then
1804 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1805 build_libtool_libs=no
1809 # Don't allow undefined symbols.
1810 allow_undefined_flag="$no_undefined_flag"
1813 dependency_libs="$deplibs"
1815 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1816 # these systems don't actually have a c library (as such)!
1819 # Add libc to deplibs on all other systems.
1820 deplibs="$deplibs -lc"
1825 # Create the output directory, or remove our outputs if we need to.
1826 if test -d $output_objdir; then
1827 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
1828 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
1830 $show "$mkdir $output_objdir"
1831 $run $mkdir $output_objdir
1833 if test $status -ne 0 && test ! -d $output_objdir; then
1838 # Now set the variables for building old libraries.
1839 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
1840 oldlibs="$oldlibs $output_objdir/$libname.$libext"
1842 # Transform .lo files to .o files.
1843 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
1846 if test "$build_libtool_libs" = yes; then
1847 # Transform deplibs into only deplibs that can be linked in shared.
1849 libname_save=$libname
1850 release_save=$release
1851 versuffix_save=$versuffix
1853 # I'm not sure if I'm treating the release correctly. I think
1854 # release should show up in the -l (ie -lgmp5) so we don't want to
1855 # add it in twice. Is that correct?
1861 case "$deplibs_check_method" in
1863 # Don't check for shared/static. Everything works.
1864 # This might be a little naive. We might want to check
1865 # whether the library exists or not. But this is on
1866 # osf3 & osf4 and I'm not really sure... Just
1867 # implementing what was already the behaviour.
1871 # This code stresses the "libraries are programs" paradigm to its
1872 # limits. Maybe even breaks it. We compile a program, linking it
1873 # against the deplibs as a proxy for the library. Then we can check
1874 # whether they linked in statically or dynamically with ldd.
1876 cat > conftest.c <<EOF
1877 int main() { return 0; }
1880 $CC -o conftest conftest.c $deplibs
1881 if test $? -eq 0 ; then
1882 ldd_output=`ldd conftest`
1883 for i in $deplibs; do
1884 name="`expr $i : '-l\(.*\)'`"
1885 # If $name is empty we are operating on a -L argument.
1886 if test "$name" != "" ; then
1887 libname=`eval \\$echo \"$libname_spec\"`
1888 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1889 set dummy $deplib_matches
1891 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1892 newdeplibs="$newdeplibs $i"
1896 echo "*** Warning: This library needs some functionality provided by $i."
1897 echo "*** I have the capability to make that library automatically link in when"
1898 echo "*** you link to this library. But I can only do this if you have a"
1899 echo "*** shared version of the library, which you do not appear to have."
1902 newdeplibs="$newdeplibs $i"
1906 # Error occured in the first compile. Let's try to salvage the situation:
1907 # Compile a seperate program for each library.
1908 for i in $deplibs; do
1909 name="`expr $i : '-l\(.*\)'`"
1910 # If $name is empty we are operating on a -L argument.
1911 if test "$name" != "" ; then
1913 $CC -o conftest conftest.c $i
1915 if test $? -eq 0 ; then
1916 ldd_output=`ldd conftest`
1917 libname=`eval \\$echo \"$libname_spec\"`
1918 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1919 set dummy $deplib_matches
1921 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1922 newdeplibs="$newdeplibs $i"
1926 echo "*** Warning: This library needs some functionality provided by $i."
1927 echo "*** I have the capability to make that library automatically link in when"
1928 echo "*** you link to this library. But I can only do this if you have a"
1929 echo "*** shared version of the library, which you do not appear to have."
1934 echo "*** Warning! Library $i is needed by this library but I was not able to"
1935 echo "*** make it link in! You will probably need to install it or some"
1936 echo "*** library that it depends on before this library will be fully"
1937 echo "*** functional. Installing it before continuing would be even better."
1940 newdeplibs="$newdeplibs $i"
1946 set dummy $deplibs_check_method
1947 file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
1948 for a_deplib in $deplibs; do
1949 name="`expr $a_deplib : '-l\(.*\)'`"
1950 # If $name is empty we are operating on a -L argument.
1951 if test "$name" != "" ; then
1952 libname=`eval \\$echo \"$libname_spec\"`
1953 for i in $lib_search_path; do
1954 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
1955 for potent_lib in $potential_libs; do
1956 # Follow soft links.
1957 if ls -lLd "$potent_lib" 2>/dev/null \
1958 | grep " -> " >/dev/null; then
1961 # The statement above tries to avoid entering an
1962 # endless loop below, in case of cyclic links.
1963 # We might still enter an endless loop, since a link
1964 # loop can be closed while we follow links,
1966 potlib="$potent_lib"
1967 while test -h "$potlib" 2>/dev/null; do
1968 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
1969 case "$potliblink" in
1970 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
1971 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
1974 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
1976 | egrep "$file_magic_regex" > /dev/null; then
1977 newdeplibs="$newdeplibs $a_deplib"
1983 if test -n "$a_deplib" ; then
1986 echo "*** Warning: This library needs some functionality provided by $a_deplib."
1987 echo "*** I have the capability to make that library automatically link in when"
1988 echo "*** you link to this library. But I can only do this if you have a"
1989 echo "*** shared version of the library, which you do not appear to have."
1992 # Add a -L argument.
1993 newdeplibs="$newdeplibs $a_deplib"
1995 done # Gone through all deplibs.
1999 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2000 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2001 grep . >/dev/null; then
2003 if test "X$deplibs_check_method" = "Xnone"; then
2004 echo "*** Warning: inter-library dependencies are not supported in this platform."
2006 echo "*** Warning: inter-library dependencies are not known to be supported."
2008 echo "*** All declared inter-library dependencies are being dropped."
2013 versuffix=$versuffix_save
2015 release=$release_save
2016 libname=$libname_save
2019 if test "$droppeddeps" = yes; then
2020 if test "$module" = yes; then
2022 echo "*** Warning: libtool could not satisfy all declared inter-library"
2023 echo "*** dependencies of module $libname. Therefore, libtool will create"
2024 echo "*** a static module, that should work as long as the dlopening"
2025 echo "*** application is linked with the -dlopen flag."
2026 if test -z "$global_symbol_pipe"; then
2028 echo "*** However, this would only work if libtool was able to extract symbol"
2029 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2030 echo "*** not find such a program. So, this module is probably useless."
2031 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2033 if test "$build_old_libs" = no; then
2034 oldlibs="$output_objdir/$libname.$libext"
2035 build_libtool_libs=module
2038 build_libtool_libs=no
2041 echo "*** The inter-library dependencies that have been dropped here will be"
2042 echo "*** automatically added whenever a program is linked with this library"
2043 echo "*** or is declared to -dlopen it."
2046 # Done checking deplibs!
2050 # All the library-specific variables (install_libdir is set above).
2055 # Test again, we may have decided not to build it any more
2056 if test "$build_libtool_libs" = yes; then
2057 # Get the real and link names of the library.
2058 eval library_names=\"$library_names_spec\"
2059 set dummy $library_names
2063 if test -n "$soname_spec"; then
2064 eval soname=\"$soname_spec\"
2069 lib="$output_objdir/$realname"
2072 linknames="$linknames $link"
2075 # Ensure that we have .o objects for linkers which dislike .lo
2076 # (e.g. aix) in case we are running --disable-static
2077 for obj in $libobjs; do
2078 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2079 if test "X$xdir" = "X$obj"; then
2084 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2085 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2086 if test ! -f $xdir/$oldobj; then
2087 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2088 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
2092 # Use standard objects if they are pic
2093 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2095 # Prepare the list of exported symbols
2096 if test -z "$export_symbols"; then
2097 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2098 $show "generating symbol list for \`$libname.la'"
2099 export_symbols="$output_objdir/$libname.exp"
2100 $run $rm $export_symbols
2101 eval cmds=\"$export_symbols_cmds\"
2102 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2103 for cmd in $cmds; do
2106 $run eval "$cmd" || exit $?
2109 if test -n "$export_symbols_regex"; then
2110 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2111 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2112 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2113 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2118 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2119 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2122 if test -n "$convenience"; then
2123 if test -n "$whole_archive_flag_spec"; then
2124 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2126 gentop="$output_objdir/${outputname}x"
2127 $show "${rm}r $gentop"
2128 $run ${rm}r "$gentop"
2129 $show "mkdir $gentop"
2130 $run mkdir "$gentop"
2132 if test $status -ne 0 && test ! -d "$gentop"; then
2135 generated="$generated $gentop"
2137 for xlib in $convenience; do
2138 # Extract the objects.
2140 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2141 *) xabs=`pwd`"/$xlib" ;;
2143 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2144 xdir="$gentop/$xlib"
2146 $show "${rm}r $xdir"
2151 if test $status -ne 0 && test ! -d "$xdir"; then
2154 $show "(cd $xdir && $AR x $xabs)"
2155 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2157 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2162 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2163 eval flag=\"$thread_safe_flag_spec\"
2164 linkopts="$linkopts $flag"
2167 # Do each of the archive commands.
2168 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2169 eval cmds=\"$archive_expsym_cmds\"
2171 eval cmds=\"$archive_cmds\"
2173 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2174 for cmd in $cmds; do
2177 $run eval "$cmd" || exit $?
2181 # Create links to the real library.
2182 for linkname in $linknames; do
2183 if test "$realname" != "$linkname"; then
2184 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2185 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2189 # If -module or -export-dynamic was specified, set the dlname.
2190 if test "$module" = yes || test "$export_dynamic" = yes; then
2191 # On all known operating systems, these are identical.
2198 if test -n "$link_against_libtool_libs"; then
2199 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
2203 if test -n "$deplibs"; then
2204 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2207 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2208 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2211 if test -n "$rpath"; then
2212 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2215 if test -n "$xrpath"; then
2216 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2219 if test -n "$vinfo"; then
2220 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2223 if test -n "$release"; then
2224 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2229 if test -n "$objs"; then
2230 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2234 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2242 # Delete the old objects.
2243 $run $rm $obj $libobj
2245 # Objects from convenience libraries. This assumes
2246 # single-version convenience libraries. Whenever we create
2247 # different ones for PIC/non-PIC, this we'll have to duplicate
2251 # reload_cmds runs $LD directly, so let us get rid of
2252 # -Wl from whole_archive_flag_spec
2255 if test -n "$convenience"; then
2256 if test -n "$whole_archive_flag_spec"; then
2257 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2259 gentop="$output_objdir/${obj}x"
2260 $show "${rm}r $gentop"
2261 $run ${rm}r "$gentop"
2262 $show "mkdir $gentop"
2263 $run mkdir "$gentop"
2265 if test $status -ne 0 && test ! -d "$gentop"; then
2268 generated="$generated $gentop"
2270 for xlib in $convenience; do
2271 # Extract the objects.
2273 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2274 *) xabs=`pwd`"/$xlib" ;;
2276 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2277 xdir="$gentop/$xlib"
2279 $show "${rm}r $xdir"
2284 if test $status -ne 0 && test ! -d "$xdir"; then
2287 $show "(cd $xdir && $AR x $xabs)"
2288 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2290 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2295 # Create the old-style object.
2296 reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
2299 eval cmds=\"$reload_cmds\"
2300 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2301 for cmd in $cmds; do
2304 $run eval "$cmd" || exit $?
2308 # Exit if we aren't doing a library object file.
2309 if test -z "$libobj"; then
2310 if test -n "$gentop"; then
2311 $show "${rm}r $gentop"
2318 if test "$build_libtool_libs" != yes; then
2319 if test -n "$gentop"; then
2320 $show "${rm}r $gentop"
2324 # Create an invalid libtool object if no PIC, so that we don't
2325 # accidentally link it into a program.
2326 $show "echo timestamp > $libobj"
2327 $run eval "echo timestamp > $libobj" || exit $?
2331 if test -n "$pic_flag"; then
2332 # Only do commands if we really have different PIC objects.
2333 reload_objs="$libobjs $reload_conv_objs"
2335 eval cmds=\"$reload_cmds\"
2336 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2337 for cmd in $cmds; do
2340 $run eval "$cmd" || exit $?
2344 # Just create a symlink.
2347 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
2348 if test "X$xdir" = "X$libobj"; then
2353 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
2354 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2355 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
2356 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
2359 if test -n "$gentop"; then
2360 $show "${rm}r $gentop"
2367 # Anything else should be a program.
2369 if test -n "$vinfo"; then
2370 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2373 if test -n "$release"; then
2374 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2377 if test "$preload" = yes; then
2378 if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
2379 test "$dlopen_self_static" = unknown; then
2380 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2384 if test -n "$rpath$xrpath"; then
2385 # If the user specified any rpath flags, then add them.
2386 for libdir in $rpath $xrpath; do
2387 # This is the magic to use -rpath.
2388 case "$compile_rpath " in
2390 *) compile_rpath="$compile_rpath $libdir" ;;
2392 case "$finalize_rpath " in
2394 *) finalize_rpath="$finalize_rpath $libdir" ;;
2399 # Now hardcode the library paths
2402 for libdir in $compile_rpath $finalize_rpath; do
2403 if test -n "$hardcode_libdir_flag_spec"; then
2404 if test -n "$hardcode_libdir_separator"; then
2405 if test -z "$hardcode_libdirs"; then
2406 hardcode_libdirs="$libdir"
2408 # Just accumulate the unique libdirs.
2409 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2410 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2413 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2418 eval flag=\"$hardcode_libdir_flag_spec\"
2419 rpath="$rpath $flag"
2421 elif test -n "$runpath_var"; then
2422 case "$perm_rpath " in
2424 *) perm_rpath="$perm_rpath $libdir" ;;
2428 # Substitute the hardcoded libdirs into the rpath.
2429 if test -n "$hardcode_libdir_separator" &&
2430 test -n "$hardcode_libdirs"; then
2431 libdir="$hardcode_libdirs"
2432 eval rpath=\" $hardcode_libdir_flag_spec\"
2434 compile_rpath="$rpath"
2438 for libdir in $finalize_rpath; do
2439 if test -n "$hardcode_libdir_flag_spec"; then
2440 if test -n "$hardcode_libdir_separator"; then
2441 if test -z "$hardcode_libdirs"; then
2442 hardcode_libdirs="$libdir"
2444 # Just accumulate the unique libdirs.
2445 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2446 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2449 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2454 eval flag=\"$hardcode_libdir_flag_spec\"
2455 rpath="$rpath $flag"
2457 elif test -n "$runpath_var"; then
2458 case "$finalize_perm_rpath " in
2460 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
2464 # Substitute the hardcoded libdirs into the rpath.
2465 if test -n "$hardcode_libdir_separator" &&
2466 test -n "$hardcode_libdirs"; then
2467 libdir="$hardcode_libdirs"
2468 eval rpath=\" $hardcode_libdir_flag_spec\"
2470 finalize_rpath="$rpath"
2472 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2473 if test "X$output_objdir" = "X$output"; then
2474 output_objdir="$objdir"
2476 output_objdir="$output_objdir/$objdir"
2479 # Create the binary in the object directory, then wrap it.
2480 if test ! -d $output_objdir; then
2481 $show "$mkdir $output_objdir"
2482 $run $mkdir $output_objdir
2484 if test $status -ne 0 && test ! -d $output_objdir; then
2489 if test -n "$libobjs" && test "$build_old_libs" = yes; then
2490 # Transform all the library objects into standard objects.
2491 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2492 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2496 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2497 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2498 dlsyms="${outputname}S.c"
2500 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
2504 if test -n "$dlsyms"; then
2508 # Discover the nlist of each of the dlfiles.
2509 nlist="$output_objdir/${outputname}.nm"
2511 $show "$rm $nlist ${nlist}S ${nlist}T"
2512 $run $rm "$nlist" "${nlist}S" "${nlist}T"
2514 # Parse the name list into a source file.
2515 $show "creating $output_objdir/$dlsyms"
2517 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
2518 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
2519 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
2525 /* Prevent the only kind of declaration conflicts we can make. */
2526 #define lt_preloaded_symbols some_other_symbol
2528 /* External symbol declarations for the compiler. */\
2531 if test "$dlself" = yes; then
2532 $show "generating symbol list for \`$output'"
2534 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
2536 # Add our own program objects to the symbol list.
2537 progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2538 for arg in $progfiles; do
2539 $show "extracting global C symbols from \`$arg'"
2540 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2543 if test -n "$exclude_expsyms"; then
2544 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2545 $run eval '$mv "$nlist"T "$nlist"'
2548 if test -n "$export_symbols_regex"; then
2549 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2550 $run eval '$mv "$nlist"T "$nlist"'
2553 # Prepare the list of exported symbols
2554 if test -z "$export_symbols"; then
2555 export_symbols="$output_objdir/$output.exp"
2556 $run $rm $export_symbols
2557 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2559 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
2560 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
2561 $run eval 'mv "$nlist"T "$nlist"'
2565 for arg in $dlprefiles; do
2566 $show "extracting global C symbols from \`$arg'"
2567 name=`echo "$arg" | sed -e 's%^.*/%%'`
2568 $run eval 'echo ": $name " >> "$nlist"'
2569 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2572 if test -z "$run"; then
2573 # Make sure we have at least an empty file.
2574 test -f "$nlist" || : > "$nlist"
2576 if test -n "$exclude_expsyms"; then
2577 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2578 $mv "$nlist"T "$nlist"
2581 # Try sorting and uniquifying the output.
2582 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
2585 grep -v "^: " < "$nlist" > "$nlist"S
2588 if test -f "$nlist"S; then
2589 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
2591 echo '/* NONE */' >> "$output_objdir/$dlsyms"
2594 $echo >> "$output_objdir/$dlsyms" "\
2596 #undef lt_preloaded_symbols
2598 #if defined (__STDC__) && __STDC__
2599 # define lt_ptr_t void *
2601 # define lt_ptr_t char *
2605 /* The mapping between symbol names and symbols. */
2610 lt_preloaded_symbols[] =
2614 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
2615 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
2616 < "$nlist" >> "$output_objdir/$dlsyms"
2618 $echo >> "$output_objdir/$dlsyms" "\
2622 /* This works around a problem in FreeBSD linker */
2623 #ifdef FREEBSD_WORKAROUND
2624 static const void *lt_preloaded_setup() {
2625 return lt_preloaded_symbols;
2635 pic_flag_for_symtable=
2637 # compiling the symbol table file with pic_flag works around
2638 # a FreeBSD bug that causes programs to crash when -lm is
2639 # linked before any other PIC object. But we must not use
2640 # pic_flag when linking with -static. The problem exists in
2641 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2642 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
\r
2643 case "$compile_command " in
2645 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
2648 case "$compile_command " in
2650 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
2654 # Now compile the dynamic symbol file.
2655 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
2656 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
2658 # Clean up the generated files.
2659 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
2660 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
2662 # Transform the symbol file into the correct name.
2663 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2664 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2667 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
2672 # We keep going just in case the user didn't refer to
2673 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2674 # really was required.
2676 # Nullify the symbol file.
2677 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2678 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2681 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
2682 # Replace the output file specification.
2683 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
2684 link_command="$compile_command$compile_rpath"
2686 # We have no uninstalled library dependencies, so finalize right now.
2687 $show "$link_command"
2688 $run eval "$link_command"
2691 # Delete the generated files.
2692 if test -n "$dlsyms"; then
2693 $show "$rm $output_objdir/${outputname}S.${objext}"
2694 $run $rm "$output_objdir/${outputname}S.${objext}"
2700 if test -n "$shlibpath_var"; then
2701 # We should set the shlibpath_var
2703 for dir in $temp_rpath; do
2705 [\\/]* | [A-Za-z]:[\\/]*)
2710 # Relative path: add a thisdir entry.
2711 rpath="$rpath\$thisdir/$dir:"
2718 if test -n "$compile_shlibpath$finalize_shlibpath"; then
2719 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
2721 if test -n "$finalize_shlibpath"; then
2722 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
2727 if test -n "$runpath_var"; then
2728 if test -n "$perm_rpath"; then
2729 # We should set the runpath_var.
2731 for dir in $perm_rpath; do
2734 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
2736 if test -n "$finalize_perm_rpath"; then
2737 # We should set the runpath_var.
2739 for dir in $finalize_perm_rpath; do
2742 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
2746 if test "$hardcode_action" = relink; then
2747 # Fast installation is not supported
2748 link_command="$compile_var$compile_command$compile_rpath"
2749 relink_command="$finalize_var$finalize_command$finalize_rpath"
2751 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
2752 $echo "$modename: \`$output' will be relinked during installation" 1>&2
2754 if test "$fast_install" != no; then
2755 link_command="$finalize_var$compile_command$finalize_rpath"
2756 if test "$fast_install" = yes; then
2757 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
2759 # fast_install is set to needless
2763 link_command="$compile_var$compile_command$compile_rpath"
2764 relink_command="$finalize_var$finalize_command$finalize_rpath"
2768 # Replace the output file specification.
2769 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
2771 # Delete the old output files.
2772 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
2774 $show "$link_command"
2775 $run eval "$link_command" || exit $?
2777 # Now create the wrapper script.
2778 $show "creating $output"
2780 # Quote the relink command for shipping.
2781 if test -n "$relink_command"; then
2782 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
2785 # Quote $echo for shipping.
2786 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
2788 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
2789 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
2791 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
2793 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
2796 # Only actually do things if our run command is non-null.
2797 if test -z "$run"; then
2798 # win32 will think the script is a binary if it has
2799 # a .exe suffix, so we strip it off here.
2801 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
2804 trap "$rm $output; exit 1" 1 2 15
2809 # $output - temporary wrapper script for $objdir/$outputname
2810 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
2812 # The $output program cannot be directly executed until all the libtool
2813 # libraries that it depends on are installed.
2815 # This wrapper script should never be moved out of the build directory.
2816 # If it is, it will not operate correctly.
2818 # Sed substitution that helps us do robust quoting. It backslashifies
2819 # metacharacters that are still active within double-quoted strings.
2820 Xsed='sed -e 1s/^X//'
2821 sed_quote_subst='$sed_quote_subst'
2823 # The HP-UX ksh and POSIX shell print the target directory to stdout
2825 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
2827 relink_command=\"$relink_command\"
2829 # This environment variable determines our operation mode.
2830 if test \"\$libtool_install_magic\" = \"$magic\"; then
2831 # install mode needs the following variable:
2832 link_against_libtool_libs='$link_against_libtool_libs'
2834 # When we are sourced in execute mode, \$file and \$echo are already set.
2835 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2838 # Make sure echo works.
2839 if test \"X\$1\" = X--no-reexec; then
2840 # Discard the --no-reexec flag, and continue.
2842 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
2843 # Yippee, \$echo works!
2846 # Restart under the correct shell, and then maybe \$echo will work.
2847 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2853 # Find the directory that this script lives in.
2854 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2855 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2857 # Follow symbolic links until we get to the real thisdir.
2858 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
2859 while test -n \"\$file\"; do
2860 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2862 # If there was a directory component, then change thisdir.
2863 if test \"x\$destdir\" != \"x\$file\"; then
2864 case \"\$destdir\" in
2865 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
2866 *) thisdir=\"\$thisdir/\$destdir\" ;;
2870 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2871 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
2874 # Try to get the absolute directory name.
2875 absdir=\`cd \"\$thisdir\" && pwd\`
2876 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2879 if test "$fast_install" = yes; then
2881 program=lt-'$outputname'
2882 progdir=\"\$thisdir/$objdir\"
2884 if test ! -f \"\$progdir/\$program\" || \\
2885 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
2886 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2888 file=\"\$\$-\$program\"
2890 if test ! -d \"\$progdir\"; then
2891 $mkdir \"\$progdir\"
2893 $rm \"\$progdir/\$file\"
2898 # relink executable if necessary
2899 if test -n \"\$relink_command\"; then
2900 if (cd \"\$thisdir\" && eval \$relink_command); then :
2902 $rm \"\$progdir/\$file\"
2907 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2908 { $rm \"\$progdir/\$program\";
2909 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2910 $rm \"\$progdir/\$file\"
2914 program='$outputname'
2915 progdir=\"\$thisdir/$objdir\"
2921 if test -f \"\$progdir/\$program\"; then"
2923 # Export our shlibpath_var if we have one.
2924 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2926 # Add our own library path to $shlibpath_var
2927 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2929 # Some systems cannot cope with colon-terminated $shlibpath_var
2930 # The second colon is a workaround for a bug in BeOS R4 sed
2931 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2933 export $shlibpath_var
2937 # fixup the dll searchpath if we need to.
2938 if test -n "$dllsearchpath"; then
2940 # Add the dll search path components to the executable PATH
2941 PATH=$dllsearchpath:\$PATH
2946 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2947 # Run the actual program with our arguments.
2950 *-*-cygwin* | *-*-mingw | *-*-os2*)
2951 # win32 systems need to use the prog path for dll
2954 exec \$progdir\\\\\$program \${1+\"\$@\"}
2959 # Export the path to the program.
2960 PATH=\"\$progdir:\$PATH\"
2963 exec \$program \${1+\"\$@\"}
2968 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
2972 # The program doesn't exist.
2973 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
2974 \$echo \"This script is just a wrapper for \$program.\" 1>&2
2975 echo \"See the $PACKAGE documentation for more information.\" 1>&2
2986 # See if we need to build an old-fashioned archive.
2987 for oldlib in $oldlibs; do
2989 if test "$build_libtool_libs" = convenience; then
2990 oldobjs="$libobjs_save"
2991 addlibs="$convenience"
2992 build_libtool_libs=no
2994 if test "$build_libtool_libs" = module; then
2995 oldobjs="$libobjs_save"
2996 build_libtool_libs=no
2998 oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3000 addlibs="$old_convenience"
3003 if test -n "$addlibs"; then
3004 gentop="$output_objdir/${outputname}x"
3005 $show "${rm}r $gentop"
3006 $run ${rm}r "$gentop"
3007 $show "mkdir $gentop"
3008 $run mkdir "$gentop"
3010 if test $status -ne 0 && test ! -d "$gentop"; then
3013 generated="$generated $gentop"
3015 # Add in members from convenience archives.
3016 for xlib in $addlibs; do
3017 # Extract the objects.
3019 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3020 *) xabs=`pwd`"/$xlib" ;;
3022 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3023 xdir="$gentop/$xlib"
3025 $show "${rm}r $xdir"
3030 if test $status -ne 0 && test ! -d "$xdir"; then
3033 $show "(cd $xdir && $AR x $xabs)"
3034 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3036 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3040 # Do each command in the archive commands.
3041 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3042 eval cmds=\"$old_archive_from_new_cmds\"
3044 # Ensure that we have .o objects in place in case we decided
3045 # not to build a shared library, and have fallen back to building
3046 # static libs even though --disable-static was passed!
3047 for oldobj in $oldobjs; do
3048 if test ! -f $oldobj; then
3049 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3050 if test "X$xdir" = "X$oldobj"; then
3055 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3056 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3057 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3058 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3062 eval cmds=\"$old_archive_cmds\"
3064 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3065 for cmd in $cmds; do
3068 $run eval "$cmd" || exit $?
3073 if test -n "$generated"; then
3074 $show "${rm}r$generated"
3075 $run ${rm}r$generated
3078 # Now create the libtool archive.
3082 test "$build_old_libs" = yes && old_library="$libname.$libext"
3083 $show "creating $output"
3085 if test -n "$xrpath"; then
3087 for libdir in $xrpath; do
3088 temp_xrpath="$temp_xrpath -R$libdir"
3090 dependency_libs="$temp_xrpath $dependency_libs"
3093 # Only create the output if not a dry run.
3094 if test -z "$run"; then
3095 for installed in no yes; do
3096 if test "$installed" = yes; then
3097 if test -z "$install_libdir"; then
3100 output="$output_objdir/$outputname"i
3104 # $outputname - a libtool library file
3105 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3107 # Please DO NOT delete this file!
3108 # It is necessary for linking the library.
3110 # The name that we can dlopen(3).
3113 # Names of this library.
3114 library_names='$library_names'
3116 # The name of the static archive.
3117 old_library='$old_library'
3119 # Libraries that this one depends upon.
3120 dependency_libs='$dependency_libs'
3122 # Version information for $libname.
3127 # Is this an already installed library?
3128 installed=$installed
3130 # Directory that this library needs to be installed in:
3131 libdir='$install_libdir'\
3136 # Do a symbolic link so that the libtool archive can be found in
3137 # LD_LIBRARY_PATH before the program is installed.
3138 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3139 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
3145 # libtool install mode
3147 modename="$modename: install"
3149 # There may be an optional sh(1) argument at the beginning of
3150 # install_prog (especially on Windows NT).
3151 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
3152 # Aesthetically quote it.
3153 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3155 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3159 install_prog="$arg "
3167 # The real first argument should be the name of the installation program.
3168 # Aesthetically quote it.
3169 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3171 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3175 install_prog="$install_prog$arg"
3177 # We need to accept at least all the BSD install flags.
3187 if test -n "$dest"; then
3188 files="$files $dest"
3206 # If the previous option needed an argument, then skip it.
3207 if test -n "$prev"; then
3216 # Aesthetically quote the argument.
3217 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3219 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3223 install_prog="$install_prog $arg"
3226 if test -z "$install_prog"; then
3227 $echo "$modename: you must specify an install program" 1>&2
3232 if test -n "$prev"; then
3233 $echo "$modename: the \`$prev' option requires an argument" 1>&2
3238 if test -z "$files"; then
3239 if test -z "$dest"; then
3240 $echo "$modename: no file or destination specified" 1>&2
3242 $echo "$modename: you must specify a destination" 1>&2
3248 # Strip any trailing slash from the destination.
3249 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3251 # Check to see that the destination is a directory.
3252 test -d "$dest" && isdir=yes
3253 if test "$isdir" = yes; then
3257 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3258 test "X$destdir" = "X$dest" && destdir=.
3259 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3261 # Not a directory, so check to see that there is only one file specified.
3263 if test $# -gt 2; then
3264 $echo "$modename: \`$dest' is not a directory" 1>&2
3270 [\\/]* | [A-Za-z]:[\\/]*) ;;
3272 for file in $files; do
3276 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3285 # This variable tells wrapper scripts just to set variables rather
3286 # than running their programs.
3287 libtool_install_magic="$magic"
3292 for file in $files; do
3294 # Do each installation.
3297 # Do the static libraries later.
3298 staticlibs="$staticlibs $file"
3302 # Check to see that this really is a libtool archive.
3303 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3305 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3312 # If there is no directory component, then add one.
3314 */* | *\\*) . $file ;;
3318 # Add the libdir to current_libdirs if it is the destination.
3319 if test "X$destdir" = "X$libdir"; then
3320 case "$current_libdirs " in
3322 *) current_libdirs="$current_libdirs $libdir" ;;
3325 # Note the libdir as a future libdir.
3326 case "$future_libdirs " in
3328 *) future_libdirs="$future_libdirs $libdir" ;;
3332 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
3333 test "X$dir" = "X$file/" && dir=
3336 # See the names of the shared library.
3337 set dummy $library_names
3338 if test -n "$2"; then
3343 # Install the shared library and build the symlinks.
3344 $show "$install_prog $dir/$realname $destdir/$realname"
3345 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
3347 if test $# -gt 0; then
3348 # Delete the old symlinks, and create new ones.
3351 if test "$linkname" != "$realname"; then
3352 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3353 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3358 # Do each command in the postinstall commands.
3359 lib="$destdir/$realname"
3360 eval cmds=\"$postinstall_cmds\"
3361 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3362 for cmd in $cmds; do
3365 $run eval "$cmd" || exit $?
3370 # Install the pseudo-library for information purposes.
3371 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3372 instname="$dir/$name"i
3373 $show "$install_prog $instname $destdir/$name"
3374 $run eval "$install_prog $instname $destdir/$name" || exit $?
3376 # Maybe install the static library, too.
3377 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
3381 # Install (i.e. copy) a libtool object.
3383 # Figure out destination file name, if it wasn't already specified.
3384 if test -n "$destname"; then
3385 destfile="$destdir/$destname"
3387 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3388 destfile="$destdir/$destfile"
3391 # Deduce the name of the destination old-style object file.
3394 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
3397 staticdest="$destfile"
3401 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
3407 # Install the libtool object if requested.
3408 if test -n "$destfile"; then
3409 $show "$install_prog $file $destfile"
3410 $run eval "$install_prog $file $destfile" || exit $?
3413 # Install the old object if enabled.
3414 if test "$build_old_libs" = yes; then
3415 # Deduce the name of the old-style object file.
3416 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
3418 $show "$install_prog $staticobj $staticdest"
3419 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
3425 # Figure out destination file name, if it wasn't already specified.
3426 if test -n "$destname"; then
3427 destfile="$destdir/$destname"
3429 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3430 destfile="$destdir/$destfile"
3433 # Do a test to see if this is really a libtool program.
3434 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3435 link_against_libtool_libs=
3438 # If there is no directory component, then add one.
3440 */* | *\\*) . $file ;;
3444 # Check the variables that should have been set.
3445 if test -z "$link_against_libtool_libs"; then
3446 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
3451 for lib in $link_against_libtool_libs; do
3452 # Check to see that each library is installed.
3454 if test -f "$lib"; then
3455 # If there is no directory component, then add one.
3457 */* | *\\*) . $lib ;;
3461 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
3462 if test -n "$libdir" && test ! -f "$libfile"; then
3463 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
3469 if test "$fast_install" = no && test -n "$relink_command"; then
3470 if test "$finalize" = yes && test -z "$run"; then
3472 test -n "$TMPDIR" && tmpdir="$TMPDIR"
3473 tmpdir="$tmpdir/libtool-$$"
3474 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
3476 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
3479 outputname="$tmpdir/$file"
3480 # Replace the output file specification.
3481 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
3483 $show "$relink_command"
3484 if $run eval "$relink_command"; then :
3486 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
3492 $echo "$modename: warning: cannot relink \`$file'" 1>&2
3495 # Install the binary that we compiled earlier.
3496 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
3500 $show "$install_prog$stripme $file $destfile"
3501 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
3502 test -n "$outputname" && ${rm}r "$tmpdir"
3507 for file in $staticlibs; do
3508 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3510 # Set up the ranlib parameters.
3511 oldlib="$destdir/$name"
3513 $show "$install_prog $file $oldlib"
3514 $run eval "$install_prog \$file \$oldlib" || exit $?
3516 # Do each command in the postinstall commands.
3517 eval cmds=\"$old_postinstall_cmds\"
3518 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3519 for cmd in $cmds; do
3522 $run eval "$cmd" || exit $?
3527 if test -n "$future_libdirs"; then
3528 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
3531 if test -n "$current_libdirs"; then
3532 # Maybe just do a dry run.
3533 test -n "$run" && current_libdirs=" -n$current_libdirs"
3534 exec $SHELL $0 --finish$current_libdirs
3541 # libtool finish mode
3543 modename="$modename: finish"
3547 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3550 libdirs="$libdirs $dir"
3553 for libdir in $libdirs; do
3554 if test -n "$finish_cmds"; then
3555 # Do each command in the finish commands.
3556 eval cmds=\"$finish_cmds\"
3557 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3558 for cmd in $cmds; do
3561 $run eval "$cmd" || admincmds="$admincmds
3566 if test -n "$finish_eval"; then
3567 # Do the single finish_eval.
3568 eval cmds=\"$finish_eval\"
3569 $run eval "$cmds" || admincmds="$admincmds
3575 # Exit here if they wanted silent mode.
3576 test "$show" = : && exit 0
3578 echo "----------------------------------------------------------------------"
3579 echo "Libraries have been installed in:"
3580 for libdir in $libdirs; do
3584 echo "If you ever happen to want to link against installed libraries"
3585 echo "in a given directory, LIBDIR, you must either use libtool, and"
3586 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
3587 echo "flag during linking and do at least one of the following:"
3588 if test -n "$shlibpath_var"; then
3589 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3590 echo " during execution"
3592 if test -n "$runpath_var"; then
3593 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3594 echo " during linking"
3596 if test -n "$hardcode_libdir_flag_spec"; then
3598 eval flag=\"$hardcode_libdir_flag_spec\"
3600 echo " - use the \`$flag' linker flag"
3602 if test -n "$admincmds"; then
3603 echo " - have your system administrator run these commands:$admincmds"
3605 if test -f /etc/ld.so.conf; then
3606 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3609 echo "See any operating system documentation about shared libraries for"
3610 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3611 echo "----------------------------------------------------------------------"
3615 # libtool execute mode
3617 modename="$modename: execute"
3619 # The first argument is the command name.
3621 if test -z "$cmd"; then
3622 $echo "$modename: you must specify a COMMAND" 1>&2
3627 # Handle -dlopen flags immediately.
3628 for file in $execute_dlfiles; do
3629 if test ! -f "$file"; then
3630 $echo "$modename: \`$file' is not a file" 1>&2
3638 # Check to see that this really is a libtool archive.
3639 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3641 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3646 # Read the libtool library.
3650 # If there is no directory component, then add one.
3652 */* | *\\*) . $file ;;
3656 # Skip this library if it cannot be dlopened.
3657 if test -z "$dlname"; then
3658 # Warn if it was a shared library.
3659 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
3663 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3664 test "X$dir" = "X$file" && dir=.
3666 if test -f "$dir/$objdir/$dlname"; then
3669 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
3675 # Just add the directory containing the .lo file.
3676 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3677 test "X$dir" = "X$file" && dir=.
3681 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
3686 # Get the absolute pathname.
3687 absdir=`cd "$dir" && pwd`
3688 test -n "$absdir" && dir="$absdir"
3690 # Now add the directory to shlibpath_var.
3691 if eval "test -z \"\$$shlibpath_var\""; then
3692 eval "$shlibpath_var=\"\$dir\""
3694 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3698 # This variable tells wrapper scripts just to set shlibpath_var
3699 # rather than running their programs.
3700 libtool_execute_magic="$magic"
3702 # Check if any of the arguments is a wrapper script.
3709 # Do a test to see if this is really a libtool program.
3710 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3711 # If there is no directory component, then add one.
3713 */* | *\\*) . $file ;;
3717 # Transform arg to wrapped name.
3718 file="$progdir/$program"
3722 # Quote arguments (to preserve shell metacharacters).
3723 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
3724 args="$args \"$file\""
3727 if test -z "$run"; then
3728 if test -n "$shlibpath_var"; then
3729 # Export the shlibpath_var.
3730 eval "export $shlibpath_var"
3733 # Restore saved enviroment variables
3734 if test "${save_LC_ALL+set}" = set; then
3735 LC_ALL="$save_LC_ALL"; export LC_ALL
3737 if test "${save_LANG+set}" = set; then
3738 LANG="$save_LANG"; export LANG
3741 # Now actually exec the command.
3742 eval "exec \$cmd$args"
3744 $echo "$modename: cannot exec \$cmd$args"
3747 # Display what would be done.
3748 if test -n "$shlibpath_var"; then
3749 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
3750 $echo "export $shlibpath_var"
3757 # libtool uninstall mode
3759 modename="$modename: uninstall"
3766 -*) rm="$rm $arg" ;;
3767 *) files="$files $arg" ;;
3771 if test -z "$rm"; then
3772 $echo "$modename: you must specify an RM program" 1>&2
3777 for file in $files; do
3778 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3779 test "X$dir" = "X$file" && dir=.
3780 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3786 # Possibly a libtool archive, so verify it.
3787 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3790 # Delete the libtool libraries and symlinks.
3791 for n in $library_names; do
3792 rmfiles="$rmfiles $dir/$n"
3794 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
3796 $show "$rm $rmfiles"
3799 if test -n "$library_names"; then
3800 # Do each command in the postuninstall commands.
3801 eval cmds=\"$postuninstall_cmds\"
3802 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3803 for cmd in $cmds; do
3811 if test -n "$old_library"; then
3812 # Do each command in the old_postuninstall commands.
3813 eval cmds=\"$old_postuninstall_cmds\"
3814 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3815 for cmd in $cmds; do
3823 # FIXME: should reinstall the best remaining shared library.
3828 if test "$build_old_libs" = yes; then
3829 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
3830 rmfiles="$rmfiles $dir/$oldobj"
3832 $show "$rm $rmfiles"
3837 $show "$rm $rmfiles"
3846 $echo "$modename: you must specify a MODE" 1>&2
3847 $echo "$generic_help" 1>&2
3852 $echo "$modename: invalid operation mode \`$mode'" 1>&2
3853 $echo "$generic_help" 1>&2
3855 fi # test -z "$show_help"
3857 # We need to display help for each of the modes.
3860 "Usage: $modename [OPTION]... [MODE-ARG]...
3862 Provide generalized library-building support services.
3864 --config show all configuration variables
3865 --debug enable verbose shell tracing
3866 -n, --dry-run display commands without modifying any files
3867 --features display basic configuration information and exit
3868 --finish same as \`--mode=finish'
3869 --help display this help message and exit
3870 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
3871 --quiet same as \`--silent'
3872 --silent don't print informational messages
3873 --version print version information
3875 MODE must be one of the following:
3877 compile compile a source file into a libtool object
3878 execute automatically set library path, then run a program
3879 finish complete the installation of libtool libraries
3880 install install libraries or executables
3881 link create a library or an executable
3882 uninstall remove libraries from an installed directory
3884 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
3885 a more detailed description of MODE."
3891 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
3893 Compile a source file into a libtool library object.
3895 This mode accepts the following additional options:
3897 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
3898 -static always build a \`.o' file suitable for static linking
3900 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
3901 from the given SOURCEFILE.
3903 The output file name is determined by removing the directory component from
3904 SOURCEFILE, then substituting the C source code suffix \`.c' with the
3905 library object suffix, \`.lo'."
3910 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
3912 Automatically set library path, then run a program.
3914 This mode accepts the following additional options:
3916 -dlopen FILE add the directory containing FILE to the library path
3918 This mode sets the library path environment variable according to \`-dlopen'
3921 If any of the ARGS are libtool executable wrappers, then they are translated
3922 into their corresponding uninstalled binary, and any of their required library
3923 directories are added to the library path.
3925 Then, COMMAND is executed, with ARGS as arguments."
3930 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
3932 Complete the installation of libtool libraries.
3934 Each LIBDIR is a directory that contains libtool libraries.
3936 The commands that this mode executes may require superuser privileges. Use
3937 the \`--dry-run' option if you just want to see what would be executed."
3942 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
3944 Install executables or libraries.
3946 INSTALL-COMMAND is the installation command. The first component should be
3947 either the \`install' or \`cp' program.
3949 The rest of the components are interpreted as arguments to that command (only
3950 BSD-compatible install options are recognized)."
3955 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
3957 Link object files or libraries together to form another library, or to
3958 create an executable program.
3960 LINK-COMMAND is a command using the C compiler that you would use to create
3961 a program from several object files.
3963 The following components of LINK-COMMAND are treated specially:
3965 -all-static do not do any dynamic linking at all
3966 -avoid-version do not add a version suffix if possible
3967 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
3968 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
3969 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3970 -export-symbols SYMFILE
3971 try to export only the symbols listed in SYMFILE
3972 -export-symbols-regex REGEX
3973 try to export only the symbols matching REGEX
3974 -LLIBDIR search LIBDIR for required installed libraries
3975 -lNAME OUTPUT-FILE requires the installed library libNAME
3976 -module build a library that can dlopened
3977 -no-undefined declare that a library does not refer to external symbols
3978 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
3979 -release RELEASE specify package release information
3980 -rpath LIBDIR the created library will eventually be installed in LIBDIR
3981 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
3982 -static do not do any dynamic linking of libtool libraries
3983 -version-info CURRENT[:REVISION[:AGE]]
3984 specify library version info [each variable defaults to 0]
3986 All other options (arguments beginning with \`-') are ignored.
3988 Every other argument is treated as a filename. Files ending in \`.la' are
3989 treated as uninstalled libtool libraries, other files are standard or library
3992 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
3993 only library objects (\`.lo' files) may be specified, and \`-rpath' is
3994 required, except when creating a convenience library.
3996 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
3997 using \`ar' and \`ranlib', or on Windows using \`lib'.
3999 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4000 is created, otherwise an executable program is created."
4005 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4007 Remove libraries from an installation directory.
4009 RM is the name of the program to use to delete files associated with each FILE
4010 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4013 If FILE is a libtool library, all the files associated with it are deleted.
4014 Otherwise, only FILE itself is deleted using RM."
4018 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4025 $echo "Try \`$modename --help' for more information about other modes."