1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
4 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # Check that we have a working $echo.
27 if test "X$1" = X--no-reexec; then
28 # Discard the --no-reexec flag, and continue.
30 elif test "X$1" = X--fallback-echo; then
31 # Avoid inline document here, it may be left over
33 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
34 # Yippee, $echo works!
37 # Restart under the correct shell, and then maybe $echo will work.
38 exec $SHELL "$0" --no-reexec ${1+"$@"}
41 if test "X$1" = X--fallback-echo; then
42 # used as fallback echo
50 # The name of this program.
51 progname=`$echo "$0" | sed 's%^.*/%%'`
58 TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
61 help="Try \`$progname --help' for more information."
62 magic="%%%MAGIC variable%%%"
67 # Sed substitution that helps us do robust quoting. It backslashifies
68 # metacharacters that are still active within double-quoted strings.
70 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
72 NL2SP='tr \015\012 \040\040'
75 # Only set LANG and LC_ALL to C if already set.
76 # These must not be set unconditionally because not all systems understand
77 # e.g. LANG=C (notably SCO).
78 # We save the old values to restore during execute mode.
79 if test "${LC_ALL+set}" = set; then
80 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
82 if test "${LANG+set}" = set; then
83 save_LANG="$LANG"; LANG=C; export LANG
86 if test "$LTCONFIG_VERSION" != "$VERSION"; then
87 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
88 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
92 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
93 echo "$modename: not configured to build any kind of library" 1>&2
94 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
107 lo2o="s/\\.lo\$/.${objext}/"
108 o2lo="s/\\.${objext}\$/.lo/"
110 # Parse our command line options once, thoroughly.
117 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
121 # If the previous option needs an argument, assign it.
122 if test -n "$prev"; then
125 eval "$prev=\"\$$prev \$arg\""
137 # Have we seen a non-optional argument yet?
144 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
149 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
154 echo "$progname: enabling shell trace mode"
164 if test "$build_libtool_libs" = yes; then
165 echo "enable shared libraries"
167 echo "disable shared libraries"
169 if test "$build_old_libs" = yes; then
170 echo "enable static libraries"
172 echo "disable static libraries"
177 --finish) mode="finish" ;;
179 --mode) prevopt="--mode" prev=mode ;;
180 --mode=*) mode="$optarg" ;;
183 build_libtool_libs=yes
188 build_libtool_libs=no
202 $echo "$modename: unrecognized option \`$arg'" 1>&2
214 if test -n "$prevopt"; then
215 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
220 case "$show $MFLAGS -$MAKEFLAGS" in
223 # Be silent inside 'make -s'
224 expr " $MFLAGS -$MAKEFLAGS" : '.* -[a-zA-Z]*s' >/dev/null && show=: ;;
227 if test -z "$show_help"; then
229 # Infer the operation mode.
230 if test -z "$mode"; then
232 *cc | *++ | gcc* | *-gcc*)
244 *db | *dbx | *strace | *truss)
254 # If we have no mode, but dlfiles were specified, then do execute mode.
255 test -n "$execute_dlfiles" && mode=execute
257 # Just use the default operation mode.
258 if test -z "$mode"; then
259 if test -n "$nonopt"; then
260 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
262 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
269 # Only execute mode is allowed to have -dlopen flags.
270 if test -n "$execute_dlfiles" && test "$mode" != execute; then
271 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
276 # Change the help message to a mode-specific one.
278 help="Try \`$modename --help --mode=$mode' for more information."
280 # These modes are in order of execution frequency so that they run quickly.
282 # libtool compile mode
284 modename="$modename: compile"
285 # Get the compilation command and the source file.
294 # Accept any command-line options.
297 if test "$user_target" != "no"; then
298 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
310 case "$user_target" in
312 # The next one is the -o target name
317 # We got the output file
324 # Accept the current argument as the source file.
328 # Aesthetically quote the previous argument.
330 # Backslashify any backslashes, double quotes, and dollar signs.
331 # These are the only characters that are still specially
332 # interpreted inside of double-quoted scrings.
333 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
335 # Double-quote args containing other shell metacharacters.
336 # Many Bourne shells cannot handle close brackets correctly in scan
337 # sets, so we specify it separately.
339 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
340 lastarg="\"$lastarg\""
344 # Add the previous argument to base_compile.
345 if test -z "$base_compile"; then
346 base_compile="$lastarg"
348 base_compile="$base_compile $lastarg"
352 case "$user_target" in
356 # Get the name of the library object.
357 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
360 $echo "$modename: you must specify a target with \`-o'" 1>&2
365 # Recognize several different file suffixes.
366 # If the user specifies -o file.o, it is replaced with file.lo
381 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
384 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
386 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
391 if test -z "$base_compile"; then
392 $echo "$modename: you must specify a compilation command" 1>&2
397 # Delete any leftover library objects.
398 if test "$build_old_libs" = yes; then
399 removelist="$obj $libobj"
405 trap "$run $rm $removelist; exit 1" 1 2 15
407 # Calculate the filename of the output object if compiler does
408 # not support -o with -c
409 if test "$compiler_c_o" = no; then
410 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
411 lockfile="$output_obj.lock"
412 removelist="$removelist $output_obj $lockfile"
413 trap "$run $rm $removelist; exit 1" 1 2 15
419 # Lock this critical section if it is needed
420 # We use this script file to make the link, it avoids creating a new file
421 if test "$need_locks" = yes; then
422 until ln "$0" "$lockfile" 2>/dev/null; do
423 $show "Waiting for $lockfile to be removed"
426 elif test "$need_locks" = warn; then
427 if test -f "$lockfile"; then
429 *** ERROR, $lockfile exists and contains:
430 `cat $lockfile 2>/dev/null`
432 This indicates that another process is trying to use the same
433 temporary object file, and libtool could not work around it because
434 your compiler does not support \`-c' and \`-o' together. If you
435 repeat this compilation, it may succeed, by chance, but you had better
436 avoid parallel builds (make -j) in this platform, or get a better
442 echo $srcfile > "$lockfile"
445 if test -n "$fix_srcfile_path"; then
446 eval srcfile=\"$fix_srcfile_path\"
449 # Only build a PIC object if we are building libtool libraries.
450 if test "$build_libtool_libs" = yes; then
451 # Without this assignment, base_compile gets emptied.
452 fbsd_hideous_sh_bug=$base_compile
454 # All platforms use -DPIC, to notify preprocessed assembler code.
455 command="$base_compile $pic_flag -DPIC $srcfile"
456 if test "$build_old_libs" = yes; then
458 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
459 if test "X$dir" = "X$libobj"; then
464 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
466 if test -d "$dir"; then
473 if test $status -ne 0 && test ! -d $dir; then
478 if test "$compiler_o_lo" = yes; then
480 command="$command -o $output_obj"
481 elif test "$compiler_c_o" = yes; then
483 command="$command -o $output_obj"
486 $run $rm "$output_obj"
488 if $run eval "$command"; then :
490 test -n "$output_obj" && $run $rm $removelist
494 if test "$need_locks" = warn &&
495 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
497 *** ERROR, $lockfile contains:
498 `cat $lockfile 2>/dev/null`
500 but it should contain:
503 This indicates that another process is trying to use the same
504 temporary object file, and libtool could not work around it because
505 your compiler does not support \`-c' and \`-o' together. If you
506 repeat this compilation, it may succeed, by chance, but you had better
507 avoid parallel builds (make -j) in this platform, or get a better
514 # Just move the object if needed, then go on to compile the next one
515 if test x"$output_obj" != x"$libobj"; then
516 $show "$mv $output_obj $libobj"
517 if $run $mv $output_obj $libobj; then :
525 # If we have no pic_flag, then copy the object into place and finish.
526 if test -z "$pic_flag" && test "$build_old_libs" = yes; then
527 # Rename the .lo from within objdir to obj
528 if test -f $obj; then
533 $show "$mv $libobj $obj"
534 if $run $mv $libobj $obj; then :
541 # Now arrange that obj and lo_libobj become the same file
542 $show "$LN_S $obj $lo_libobj"
543 if $run $LN_S $obj $lo_libobj; then
552 # Allow error messages only from the first compilation.
553 suppress_output=' >/dev/null 2>&1'
556 # Only build a position-dependent object if we build old libraries.
557 if test "$build_old_libs" = yes; then
558 command="$base_compile $srcfile"
559 if test "$compiler_c_o" = yes; then
560 command="$command -o $obj"
564 # Suppress compiler output if we already did a PIC compilation.
565 command="$command$suppress_output"
566 $run $rm "$output_obj"
568 if $run eval "$command"; then :
574 if test "$need_locks" = warn &&
575 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
577 *** ERROR, $lockfile contains:
578 `cat $lockfile 2>/dev/null`
580 but it should contain:
583 This indicates that another process is trying to use the same
584 temporary object file, and libtool could not work around it because
585 your compiler does not support \`-c' and \`-o' together. If you
586 repeat this compilation, it may succeed, by chance, but you had better
587 avoid parallel builds (make -j) in this platform, or get a better
594 # Just move the object if needed
595 if test x"$output_obj" != x"$obj"; then
596 $show "$mv $output_obj $obj"
597 if $run $mv $output_obj $obj; then :
605 # Create an invalid libtool object if no PIC, so that we do not
606 # accidentally link it into a program.
607 if test "$build_libtool_libs" != yes; then
608 $show "echo timestamp > $libobj"
609 $run eval "echo timestamp > \$libobj" || exit $?
611 # Move the .lo from within objdir
612 $show "$mv $libobj $lo_libobj"
613 if $run $mv $libobj $lo_libobj; then :
622 # Unlock the critical section if it was locked
623 if test "$need_locks" != no; then
632 modename="$modename: link"
633 C_compiler="$CC" # save it, to compile generated C sources
636 *-*-cygwin* | *-*-mingw* | *-*-os2*)
637 # It is impossible to link a dll without this setting, and
638 # we shouldn't force the makefile maintainer to figure out
639 # which system we are compiling for in order to pass an extra
640 # flag for every libtool invokation.
643 # FIXME: Unfortunately, there are problems with the above when trying
644 # to make a dll which has undefined symbols, in which case not
645 # even a static library is built. For now, we need to specify
646 # -no-undefined on the libtool link line when we can be certain
647 # that all symbols are satisfied, otherwise we get a static library.
650 # This is a source program that is used to create dlls on Windows
651 # Don't remove nor modify the starting and closing comments
652 # /* ltdll.c starts here */
653 # #define WIN32_LEAN_AND_MEAN
654 # #include <windows.h>
655 # #undef WIN32_LEAN_AND_MEAN
659 # # ifdef __CYGWIN32__
660 # # define __CYGWIN__ __CYGWIN32__
667 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
673 # #include <cygwin/cygwin_dll.h>
674 # DECLARE_CYGWIN_DLL( DllMain );
676 # HINSTANCE __hDllInstance_base;
679 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
681 # __hDllInstance_base = hInst;
684 # /* ltdll.c ends here */
685 # This is a source program that is used to create import libraries
686 # on Windows for dlls which lack them. Don't remove nor modify the
687 # starting and closing comments
688 # /* impgen.c starts here */
689 # /* Copyright (C) 1999 Free Software Foundation, Inc.
691 # This file is part of GNU libtool.
693 # This program is free software; you can redistribute it and/or modify
694 # it under the terms of the GNU General Public License as published by
695 # the Free Software Foundation; either version 2 of the License, or
696 # (at your option) any later version.
698 # This program is distributed in the hope that it will be useful,
699 # but WITHOUT ANY WARRANTY; without even the implied warranty of
700 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
701 # GNU General Public License for more details.
703 # You should have received a copy of the GNU General Public License
704 # along with this program; if not, write to the Free Software
705 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
708 # #include <stdio.h> /* for printf() */
709 # #include <unistd.h> /* for open(), lseek(), read() */
710 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
711 # #include <string.h> /* for strdup() */
713 # static unsigned int
714 # pe_get16 (fd, offset)
718 # unsigned char b[2];
719 # lseek (fd, offset, SEEK_SET);
721 # return b[0] + (b[1]<<8);
724 # static unsigned int
725 # pe_get32 (fd, offset)
729 # unsigned char b[4];
730 # lseek (fd, offset, SEEK_SET);
732 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
735 # static unsigned int
739 # unsigned char *b = ptr;
740 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
749 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
750 # unsigned long export_rva, export_size, nsections, secptr, expptr;
751 # unsigned long name_rvas, nexp;
752 # unsigned char *expdata, *erva;
753 # char *filename, *dll_name;
755 # filename = argv[1];
757 # dll = open(filename, O_RDONLY|O_BINARY);
761 # dll_name = filename;
763 # for (i=0; filename[i]; i++)
764 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
765 # dll_name = filename + i +1;
767 # pe_header_offset = pe_get32 (dll, 0x3c);
768 # opthdr_ofs = pe_header_offset + 4 + 20;
769 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
771 # if (num_entries < 1) /* no exports */
774 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
775 # export_size = pe_get32 (dll, opthdr_ofs + 100);
776 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
777 # secptr = (pe_header_offset + 4 + 20 +
778 # pe_get16 (dll, pe_header_offset + 4 + 16));
781 # for (i = 0; i < nsections; i++)
784 # unsigned long secptr1 = secptr + 40 * i;
785 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
786 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
787 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
788 # lseek(dll, secptr1, SEEK_SET);
789 # read(dll, sname, 8);
790 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
792 # expptr = fptr + (export_rva - vaddr);
793 # if (export_rva + export_size > vaddr + vsize)
794 # export_size = vsize - (export_rva - vaddr);
799 # expdata = (unsigned char*)malloc(export_size);
800 # lseek (dll, expptr, SEEK_SET);
801 # read (dll, expdata, export_size);
802 # erva = expdata - export_rva;
804 # nexp = pe_as32 (expdata+24);
805 # name_rvas = pe_as32 (expdata+32);
807 # printf ("EXPORTS\n");
808 # for (i = 0; i<nexp; i++)
810 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
811 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
816 # /* impgen.c ends here */
822 compile_command="$CC"
823 finalize_command="$CC"
834 if test -n "$shlibpath_var"; then
835 # get the directories listed in $shlibpath_var
836 eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
840 # now prepend the system-specific ones
841 eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
842 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
850 export_symbols_regex=
853 link_against_libtool_libs=
857 prefer_static_libs=no
869 # We need to know -static, to get the right output filenames.
873 -all-static | -static)
874 if test "X$arg" = "X-all-static"; then
875 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
876 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
878 if test -n "$link_static_flag"; then
879 dlopen_self=$dlopen_self_static
882 if test -z "$pic_flag" && test -n "$link_static_flag"; then
883 dlopen_self=$dlopen_self_static
886 build_libtool_libs=no
888 prefer_static_libs=yes
894 # See if our shared archives depend on static archives.
895 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
897 # Go through the arguments, transforming them on the way.
898 while test $# -gt 0; do
902 # If the previous option needs an argument, assign it.
903 if test -n "$prev"; then
906 compile_command="$compile_command @OUTPUT@"
907 finalize_command="$finalize_command @OUTPUT@"
913 if test "$preload" = no; then
914 # Add the symbol object into the linking commands.
915 compile_command="$compile_command @SYMFILE@"
916 finalize_command="$finalize_command @SYMFILE@"
920 *.la | *.lo) ;; # We handle these cases below.
922 if test "$dlself" = no; then
930 if test "$prev" = dlprefiles; then
932 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
942 if test "$prev" = dlfiles; then
943 dlfiles="$dlfiles $arg"
945 dlprefiles="$dlprefiles $arg"
952 export_symbols="$arg"
953 if test ! -f "$arg"; then
954 $echo "$modename: symbol file \`$arg' does not exist"
961 export_symbols_regex="$arg"
971 # We need an absolute path.
973 [\\/]* | [A-Za-z]:[\\/]*) ;;
975 $echo "$modename: only absolute run-paths are allowed" 1>&2
979 if test "$prev" = rpath; then
982 *) rpath="$rpath $arg" ;;
987 *) xrpath="$xrpath $arg" ;;
994 eval "$prev=\"\$arg\""
1005 if test -n "$link_static_flag"; then
1006 compile_command="$compile_command $link_static_flag"
1007 finalize_command="$finalize_command $link_static_flag"
1013 # FIXME: remove this flag sometime in the future.
1014 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1038 -export-symbols | -export-symbols-regex)
1039 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1040 $echo "$modename: not more than one -exported-symbols argument allowed"
1043 if test "X$arg" = "X-export-symbols"; then
1052 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1053 # We need an absolute path.
1055 [\\/]* | [A-Za-z]:[\\/]*) ;;
1057 absdir=`cd "$dir" && pwd`
1058 if test -z "$absdir"; then
1059 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1060 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1066 case " $deplibs " in
1068 *) deplibs="$deplibs $arg";;
1070 case " $lib_search_path " in
1072 *) lib_search_path="$lib_search_path $dir";;
1075 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1076 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1077 case ":$dllsearchpath:" in
1078 ::) dllsearchpath="$dllsearchdir";;
1079 *":$dllsearchdir:"*) ;;
1080 *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
1087 if test "$arg" = "-lc"; then
1089 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1090 # These systems don't actually have c library (as such)
1094 elif test "$arg" = "-lm"; then
1096 *-*-cygwin* | *-*-beos*)
1097 # These systems don't actually have math library (as such)
1102 deplibs="$deplibs $arg"
1133 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1134 # We need an absolute path.
1136 [\\/]* | [A-Za-z]:[\\/]*) ;;
1138 $echo "$modename: only absolute run-paths are allowed" 1>&2
1144 *) xrpath="$xrpath $dir" ;;
1150 # If we have no pic_flag, then this is the same as -all-static.
1151 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1152 compile_command="$compile_command $link_static_flag"
1153 finalize_command="$finalize_command $link_static_flag"
1168 # Some other compiler flag.
1170 # Unknown arguments in both finalize_command and compile_command need
1171 # to be aesthetically quoted because they are evaled later.
1172 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1174 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1180 *.o | *.obj | *.a | *.lib)
1181 # A standard object.
1187 if test "$prev" = dlfiles; then
1188 dlfiles="$dlfiles $arg"
1189 if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
1193 # If libtool objects are unsupported, then we need to preload.
1198 if test "$prev" = dlprefiles; then
1199 # Preload the old-style object.
1200 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1203 libobjs="$libobjs $arg"
1207 # A libtool-controlled library.
1214 # Check to see that this really is a libtool archive.
1215 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1217 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
1221 # If the library was installed with an old release of libtool,
1222 # it will not redefine variable installed.
1226 # If there is no directory component, then add one.
1228 */* | *\\*) . $arg ;;
1232 # Get the name of the library we link against.
1234 for l in $old_library $library_names; do
1238 if test -z "$linklib"; then
1239 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
1243 # Find the relevant object directory and library name.
1244 name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
1246 if test "X$installed" = Xyes; then
1249 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1250 if test "X$dir" = "X$arg"; then
1257 if test -n "$dependency_libs"; then
1258 # Extract -R and -L from dependency_libs
1260 for deplib in $dependency_libs; do
1262 -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1263 case " $rpath $xrpath " in
1264 *" $temp_xrpath "*) ;;
1265 *) xrpath="$xrpath $temp_xrpath";;
1267 -L*) case "$compile_command $temp_deplibs " in
1269 *) temp_deplibs="$temp_deplibs $deplib";;
1271 temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1272 case " $lib_search_path " in
1274 *) lib_search_path="$lib_search_path $temp_dir";;
1277 *) temp_deplibs="$temp_deplibs $deplib";;
1280 dependency_libs="$temp_deplibs"
1283 if test -z "$libdir"; then
1284 # It is a libtool convenience library, so add in its objects.
1285 convenience="$convenience $dir/$old_library"
1286 old_convenience="$old_convenience $dir/$old_library"
1287 deplibs="$deplibs$dependency_libs"
1288 compile_command="$compile_command $dir/$old_library$dependency_libs"
1289 finalize_command="$finalize_command $dir/$old_library$dependency_libs"
1293 # This library was specified with -dlopen.
1294 if test "$prev" = dlfiles; then
1295 dlfiles="$dlfiles $arg"
1296 if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
1297 # If there is no dlname, no dlopen support or we're linking statically,
1298 # we need to preload.
1301 # We should not create a dependency on this library, but we
1302 # may need any libraries it requires.
1303 compile_command="$compile_command$dependency_libs"
1304 finalize_command="$finalize_command$dependency_libs"
1310 # The library was specified with -dlpreopen.
1311 if test "$prev" = dlprefiles; then
1312 # Prefer using a static library (so that no silly _DYNAMIC symbols
1313 # are required to link).
1314 if test -n "$old_library"; then
1315 dlprefiles="$dlprefiles $dir/$old_library"
1317 dlprefiles="$dlprefiles $dir/$linklib"
1322 if test -n "$library_names" &&
1323 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1324 link_against_libtool_libs="$link_against_libtool_libs $arg"
1325 if test -n "$shlibpath_var"; then
1326 # Make sure the rpath contains only unique directories.
1327 case "$temp_rpath " in
1329 *) temp_rpath="$temp_rpath $dir" ;;
1333 # We need an absolute path.
1335 [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
1337 absdir=`cd "$dir" && pwd`
1338 if test -z "$absdir"; then
1339 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1340 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1346 # This is the magic to use -rpath.
1347 # Skip directories that are in the system default run-time
1348 # search path, unless they have been requested with -R.
1349 case " $sys_lib_dlsearch_path " in
1352 case "$compile_rpath " in
1354 *) compile_rpath="$compile_rpath $absdir"
1359 case " $sys_lib_dlsearch_path " in
1362 case "$finalize_rpath " in
1364 *) finalize_rpath="$finalize_rpath $libdir"
1370 case "$hardcode_action" in
1371 immediate | unsupported)
1372 if test "$hardcode_direct" = no; then
1373 compile_command="$compile_command $dir/$linklib"
1374 deplibs="$deplibs $dir/$linklib"
1376 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1377 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1378 if test -n "$dllsearchpath"; then
1379 dllsearchpath="$dllsearchpath:$dllsearchdir"
1381 dllsearchpath="$dllsearchdir"
1385 elif test "$hardcode_minus_L" = no; then
1388 compile_shlibpath="$compile_shlibpath$dir:"
1391 case "$compile_command " in
1393 *) compile_command="$compile_command -L$dir";;
1395 compile_command="$compile_command -l$name"
1396 deplibs="$deplibs -L$dir -l$name"
1397 elif test "$hardcode_shlibpath_var" = no; then
1398 case ":$compile_shlibpath:" in
1400 *) compile_shlibpath="$compile_shlibpath$dir:";;
1402 compile_command="$compile_command -l$name"
1403 deplibs="$deplibs -l$name"
1410 if test "$hardcode_direct" = yes; then
1411 compile_command="$compile_command $absdir/$linklib"
1412 deplibs="$deplibs $absdir/$linklib"
1413 elif test "$hardcode_minus_L" = yes; then
1414 case "$compile_command " in
1416 *) compile_command="$compile_command -L$absdir";;
1418 compile_command="$compile_command -l$name"
1419 deplibs="$deplibs -L$absdir -l$name"
1420 elif test "$hardcode_shlibpath_var" = yes; then
1421 case ":$compile_shlibpath:" in
1423 *) compile_shlibpath="$compile_shlibpath$absdir:";;
1425 compile_command="$compile_command -l$name"
1426 deplibs="$deplibs -l$name"
1437 if test "$lib_linked" != yes; then
1438 $echo "$modename: configuration error: unsupported hardcode properties"
1442 # Finalize command for both is simple: just hardcode it.
1443 if test "$hardcode_direct" = yes; then
1444 finalize_command="$finalize_command $libdir/$linklib"
1445 elif test "$hardcode_minus_L" = yes; then
1446 case "$finalize_command " in
1448 *) finalize_command="$finalize_command -L$libdir";;
1450 finalize_command="$finalize_command -l$name"
1451 elif test "$hardcode_shlibpath_var" = yes; then
1452 case ":$finalize_shlibpath:" in
1454 *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
1456 finalize_command="$finalize_command -l$name"
1458 # We cannot seem to hardcode it, guess we'll fake it.
1459 case "$finalize_command " in
1461 *) finalize_command="$finalize_command -L$libdir";;
1463 finalize_command="$finalize_command -l$name"
1466 # Transform directly to old archives if we don't build new libraries.
1467 if test -n "$pic_flag" && test -z "$old_library"; then
1468 $echo "$modename: cannot find static library for \`$arg'" 1>&2
1472 # Here we assume that one of hardcode_direct or hardcode_minus_L
1473 # is not unsupported. This is valid on all known static and
1475 if test "$hardcode_direct" != unsupported; then
1476 test -n "$old_library" && linklib="$old_library"
1477 compile_command="$compile_command $dir/$linklib"
1478 finalize_command="$finalize_command $dir/$linklib"
1480 case "$compile_command " in
1482 *) compile_command="$compile_command -L$dir";;
1484 compile_command="$compile_command -l$name"
1485 case "$finalize_command " in
1487 *) finalize_command="$finalize_command -L$dir";;
1489 finalize_command="$finalize_command -l$name"
1493 # Add in any libraries that this one depends upon.
1494 compile_command="$compile_command$dependency_libs"
1495 finalize_command="$finalize_command$dependency_libs"
1499 # Some other compiler argument.
1501 # Unknown arguments in both finalize_command and compile_command need
1502 # to be aesthetically quoted because they are evaled later.
1503 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1505 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1512 # Now actually substitute the argument into the commands.
1513 if test -n "$arg"; then
1514 compile_command="$compile_command $arg"
1515 finalize_command="$finalize_command $arg"
1519 if test -n "$prev"; then
1520 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1525 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1526 eval arg=\"$export_dynamic_flag_spec\"
1527 compile_command="$compile_command $arg"
1528 finalize_command="$finalize_command $arg"
1532 # calculate the name of the file, without its directory
1533 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1534 libobjs_save="$libobjs"
1538 $echo "$modename: you must specify an output file" 1>&2
1544 if test -n "$link_against_libtool_libs"; then
1545 $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
1549 if test -n "$deplibs"; then
1550 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1553 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1554 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1557 if test -n "$rpath"; then
1558 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
1561 if test -n "$xrpath"; then
1562 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
1565 if test -n "$vinfo"; then
1566 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1569 if test -n "$release"; then
1570 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
1573 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1574 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1577 # Now set the variables for building old libraries.
1578 build_libtool_libs=no
1583 # Make sure we only generate libraries of the form `libNAME.la'.
1584 case "$outputname" in
1586 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1587 eval libname=\"$libname_spec\"
1590 if test "$module" = no; then
1591 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
1595 if test "$need_lib_prefix" != no; then
1596 # Add the "lib" prefix for modules if required
1597 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1598 eval libname=\"$libname_spec\"
1600 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1605 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1606 if test "X$output_objdir" = "X$output"; then
1607 output_objdir="$objdir"
1609 output_objdir="$output_objdir/$objdir"
1612 if test -n "$objs"; then
1613 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1617 # How the heck are we supposed to write a wrapper for a shared library?
1618 if test -n "$link_against_libtool_libs"; then
1619 $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
1623 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1624 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1628 if test $# -gt 2; then
1629 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1634 if test -z "$rpath"; then
1635 if test "$build_libtool_libs" = yes; then
1636 # Building a libtool convenience library.
1638 oldlibs="$output_objdir/$libname.$libext $oldlibs"
1639 build_libtool_libs=convenience
1642 dependency_libs="$deplibs"
1644 if test -n "$vinfo"; then
1645 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1648 if test -n "$release"; then
1649 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1653 # Parse the version information argument.
1654 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
1655 set dummy $vinfo 0 0 0
1658 if test -n "$8"; then
1659 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1668 # Check that each of the things are valid numbers.
1670 0 | [1-9] | [1-9][0-9]*) ;;
1672 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1673 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1679 0 | [1-9] | [1-9][0-9]*) ;;
1681 $echo "$modename: REVISION \`$revision' 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: AGE \`$age' is not a nonnegative integer" 1>&2
1691 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1696 if test $age -gt $current; then
1697 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1698 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1702 # Calculate the version variables.
1706 case "$version_type" in
1710 major=`expr $current - $age + 1`
1711 versuffix="$major.$revision"
1712 verstring="sgi$major.$revision"
1714 # Add in all the interfaces that we are compatible with.
1716 while test $loop != 0; do
1717 iface=`expr $revision - $loop`
1718 loop=`expr $loop - 1`
1719 verstring="sgi$major.$iface:$verstring"
1724 major=.`expr $current - $age`
1725 versuffix="$major.$age.$revision"
1729 major=`expr $current - $age`
1730 versuffix=".$current.$age.$revision"
1731 verstring="$current.$age.$revision"
1733 # Add in all the interfaces that we are compatible with.
1735 while test $loop != 0; do
1736 iface=`expr $current - $loop`
1737 loop=`expr $loop - 1`
1738 verstring="$verstring:${iface}.0"
1741 # Make executables depend on our current version.
1742 verstring="$verstring:${current}.0"
1747 versuffix=".$current.$revision"
1752 versuffix=".$current.$revision";
1757 versuffix=".$current";
1761 # Like Linux, but with '-' rather than '.', since we only
1762 # want one extension on Windows 95.
1763 major=`expr $current - $age`
1764 versuffix="-$major-$age-$revision"
1768 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1769 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1774 # Clear the version info if we defaulted, and they specified a release.
1775 if test -z "$vinfo" && test -n "$release"; then
1778 if test "$need_version" = no; then
1785 # Remove version info from name if versioning should be avoided
1786 if test "$avoid_version" = yes && test "$need_version" = no; then
1792 # Check to see if the archive will have undefined symbols.
1793 if test "$allow_undefined" = yes; then
1794 if test "$allow_undefined_flag" = unsupported; then
1795 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1796 build_libtool_libs=no
1800 # Don't allow undefined symbols.
1801 allow_undefined_flag="$no_undefined_flag"
1804 dependency_libs="$deplibs"
1806 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1807 # these systems don't actually have a c library (as such)!
1810 # Add libc to deplibs on all other systems.
1811 deplibs="$deplibs -lc"
1816 # Create the output directory, or remove our outputs if we need to.
1817 if test -d $output_objdir; then
1818 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
1819 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
1821 $show "$mkdir $output_objdir"
1822 $run $mkdir $output_objdir
1824 if test $status -ne 0 && test ! -d $output_objdir; then
1829 # Now set the variables for building old libraries.
1830 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
1831 oldlibs="$oldlibs $output_objdir/$libname.$libext"
1833 # Transform .lo files to .o files.
1834 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
1837 if test "$build_libtool_libs" = yes; then
1838 # Transform deplibs into only deplibs that can be linked in shared.
1840 libname_save=$libname
1841 release_save=$release
1842 versuffix_save=$versuffix
1844 # I'm not sure if I'm treating the release correctly. I think
1845 # release should show up in the -l (ie -lgmp5) so we don't want to
1846 # add it in twice. Is that correct?
1852 case "$deplibs_check_method" in
1854 # Don't check for shared/static. Everything works.
1855 # This might be a little naive. We might want to check
1856 # whether the library exists or not. But this is on
1857 # osf3 & osf4 and I'm not really sure... Just
1858 # implementing what was already the behaviour.
1862 # This code stresses the "libraries are programs" paradigm to its
1863 # limits. Maybe even breaks it. We compile a program, linking it
1864 # against the deplibs as a proxy for the library. Then we can check
1865 # whether they linked in statically or dynamically with ldd.
1867 cat > conftest.c <<EOF
1868 int main() { return 0; }
1871 $C_compiler -o conftest conftest.c $deplibs
1872 if test $? -eq 0 ; then
1873 ldd_output=`ldd conftest`
1874 for i in $deplibs; do
1875 name="`expr $i : '-l\(.*\)'`"
1876 # If $name is empty we are operating on a -L argument.
1877 if test "$name" != "" ; then
1878 libname=`eval \\$echo \"$libname_spec\"`
1879 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1880 set dummy $deplib_matches
1882 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1883 newdeplibs="$newdeplibs $i"
1887 echo "*** Warning: This library needs some functionality provided by $i."
1888 echo "*** I have the capability to make that library automatically link in when"
1889 echo "*** you link to this library. But I can only do this if you have a"
1890 echo "*** shared version of the library, which you do not appear to have."
1893 newdeplibs="$newdeplibs $i"
1897 # Error occured in the first compile. Let's try to salvage the situation:
1898 # Compile a seperate program for each library.
1899 for i in $deplibs; do
1900 name="`expr $i : '-l\(.*\)'`"
1901 # If $name is empty we are operating on a -L argument.
1902 if test "$name" != "" ; then
1904 $C_compiler -o conftest conftest.c $i
1906 if test $? -eq 0 ; then
1907 ldd_output=`ldd conftest`
1908 libname=`eval \\$echo \"$libname_spec\"`
1909 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1910 set dummy $deplib_matches
1912 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1913 newdeplibs="$newdeplibs $i"
1917 echo "*** Warning: This library needs some functionality provided by $i."
1918 echo "*** I have the capability to make that library automatically link in when"
1919 echo "*** you link to this library. But I can only do this if you have a"
1920 echo "*** shared version of the library, which you do not appear to have."
1925 echo "*** Warning! Library $i is needed by this library but I was not able to"
1926 echo "*** make it link in! You will probably need to install it or some"
1927 echo "*** library that it depends on before this library will be fully"
1928 echo "*** functional. Installing it before continuing would be even better."
1931 newdeplibs="$newdeplibs $i"
1937 set dummy $deplibs_check_method
1938 file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
1939 for a_deplib in $deplibs; do
1940 name="`expr $a_deplib : '-l\(.*\)'`"
1941 # If $name is empty we are operating on a -L argument.
1942 if test "$name" != "" ; then
1943 libname=`eval \\$echo \"$libname_spec\"`
1944 for i in $lib_search_path; do
1945 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
1946 for potent_lib in $potential_libs; do
1947 # Follow soft links.
1948 if ls -lLd "$potent_lib" 2>/dev/null \
1949 | grep " -> " >/dev/null; then
1952 # The statement above tries to avoid entering an
1953 # endless loop below, in case of cyclic links.
1954 # We might still enter an endless loop, since a link
1955 # loop can be closed while we follow links,
1957 potlib="$potent_lib"
1958 while test -h "$potlib" 2>/dev/null; do
1959 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
1960 case "$potliblink" in
1961 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
1962 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
1965 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
1967 | egrep "$file_magic_regex" > /dev/null; then
1968 newdeplibs="$newdeplibs $a_deplib"
1974 if test -n "$a_deplib" ; then
1977 echo "*** Warning: This library needs some functionality provided by $a_deplib."
1978 echo "*** I have the capability to make that library automatically link in when"
1979 echo "*** you link to this library. But I can only do this if you have a"
1980 echo "*** shared version of the library, which you do not appear to have."
1983 # Add a -L argument.
1984 newdeplibs="$newdeplibs $a_deplib"
1986 done # Gone through all deplibs.
1990 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
1991 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
1992 grep . >/dev/null; then
1994 if test "X$deplibs_check_method" = "Xnone"; then
1995 echo "*** Warning: inter-library dependencies are not supported in this platform."
1997 echo "*** Warning: inter-library dependencies are not known to be supported."
1999 echo "*** All declared inter-library dependencies are being dropped."
2004 versuffix=$versuffix_save
2006 release=$release_save
2007 libname=$libname_save
2010 if test "$droppeddeps" = yes; then
2011 if test "$module" = yes; then
2013 echo "*** Warning: libtool could not satisfy all declared inter-library"
2014 echo "*** dependencies of module $libname. Therefore, libtool will create"
2015 echo "*** a static module, that should work as long as the dlopening"
2016 echo "*** application is linked with the -dlopen flag."
2017 if test -z "$global_symbol_pipe"; then
2019 echo "*** However, this would only work if libtool was able to extract symbol"
2020 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2021 echo "*** not find such a program. So, this module is probably useless."
2022 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2024 if test "$build_old_libs" = no; then
2025 oldlibs="$output_objdir/$libname.$libext"
2026 build_libtool_libs=module
2029 build_libtool_libs=no
2032 echo "*** The inter-library dependencies that have been dropped here will be"
2033 echo "*** automatically added whenever a program is linked with this library"
2034 echo "*** or is declared to -dlopen it."
2037 # Done checking deplibs!
2041 # All the library-specific variables (install_libdir is set above).
2046 # Test again, we may have decided not to build it any more
2047 if test "$build_libtool_libs" = yes; then
2048 # Get the real and link names of the library.
2049 eval library_names=\"$library_names_spec\"
2050 set dummy $library_names
2054 if test -n "$soname_spec"; then
2055 eval soname=\"$soname_spec\"
2060 lib="$output_objdir/$realname"
2063 linknames="$linknames $link"
2066 # Ensure that we have .o objects for linkers which dislike .lo
2067 # (e.g. aix) incase we are running --disable-static
2068 for obj in $libobjs; do
2069 oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
2070 if test ! -f $oldobj; then
2071 $show "${LN_S} $obj $oldobj"
2072 $run ${LN_S} $obj $oldobj || exit $?
2076 # Use standard objects if they are pic
2077 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2079 # Prepare the list of exported symbols
2080 if test -z "$export_symbols"; then
2081 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2082 $show "generating symbol list for \`$libname.la'"
2083 export_symbols="$output_objdir/$libname.exp"
2084 $run $rm $export_symbols
2085 eval cmds=\"$export_symbols_cmds\"
2086 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2087 for cmd in $cmds; do
2090 $run eval "$cmd" || exit $?
2093 if test -n "$export_symbols_regex"; then
2094 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2095 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2096 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2097 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2102 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2103 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2106 if test -n "$convenience"; then
2107 if test -n "$whole_archive_flag_spec"; then
2108 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2110 gentop="$output_objdir/${outputname}x"
2111 $show "${rm}r $gentop"
2112 $run ${rm}r "$gentop"
2113 $show "mkdir $gentop"
2114 $run mkdir "$gentop"
2116 if test $status -ne 0 && test ! -d "$gentop"; then
2119 generated="$generated $gentop"
2121 for xlib in $convenience; do
2122 # Extract the objects.
2124 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2125 *) xabs=`pwd`"/$xlib" ;;
2127 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2128 xdir="$gentop/$xlib"
2130 $show "${rm}r $xdir"
2135 if test $status -ne 0 && test ! -d "$xdir"; then
2138 $show "(cd $xdir && $AR x $xabs)"
2139 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2141 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2146 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2147 eval flag=\"$thread_safe_flag_spec\"
2148 linkopts="$linkopts $flag"
2151 # Do each of the archive commands.
2152 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2153 eval cmds=\"$archive_expsym_cmds\"
2155 eval cmds=\"$archive_cmds\"
2157 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2158 for cmd in $cmds; do
2161 $run eval "$cmd" || exit $?
2165 # Create links to the real library.
2166 for linkname in $linknames; do
2167 if test "$realname" != "$linkname"; then
2168 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2169 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2173 # If -module or -export-dynamic was specified, set the dlname.
2174 if test "$module" = yes || test "$export_dynamic" = yes; then
2175 # On all known operating systems, these are identical.
2182 if test -n "$link_against_libtool_libs"; then
2183 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
2187 if test -n "$deplibs"; then
2188 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2191 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2192 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2195 if test -n "$rpath"; then
2196 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2199 if test -n "$xrpath"; then
2200 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2203 if test -n "$vinfo"; then
2204 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2207 if test -n "$release"; then
2208 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2213 if test -n "$objs"; then
2214 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2218 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2226 # Delete the old objects.
2227 $run $rm $obj $libobj
2229 # Objects from convenience libraries. This assumes
2230 # single-version convenience libraries. Whenever we create
2231 # different ones for PIC/non-PIC, this we'll have to duplicate
2235 # reload_cmds runs $LD directly, so let us get rid of
2236 # -Wl from whole_archive_flag_spec
2239 if test -n "$convenience"; then
2240 if test -n "$whole_archive_flag_spec"; then
2241 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2243 gentop="$output_objdir/${obj}x"
2244 $show "${rm}r $gentop"
2245 $run ${rm}r "$gentop"
2246 $show "mkdir $gentop"
2247 $run mkdir "$gentop"
2249 if test $status -ne 0 && test ! -d "$gentop"; then
2252 generated="$generated $gentop"
2254 for xlib in $convenience; do
2255 # Extract the objects.
2257 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2258 *) xabs=`pwd`"/$xlib" ;;
2260 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2261 xdir="$gentop/$xlib"
2263 $show "${rm}r $xdir"
2268 if test $status -ne 0 && test ! -d "$xdir"; then
2271 $show "(cd $xdir && $AR x $xabs)"
2272 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2274 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2279 # Create the old-style object.
2280 reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
2283 eval cmds=\"$reload_cmds\"
2284 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2285 for cmd in $cmds; do
2288 $run eval "$cmd" || exit $?
2292 # Exit if we aren't doing a library object file.
2293 if test -z "$libobj"; then
2294 if test -n "$gentop"; then
2295 $show "${rm}r $gentop"
2302 if test "$build_libtool_libs" != yes; then
2303 if test -n "$gentop"; then
2304 $show "${rm}r $gentop"
2308 # Create an invalid libtool object if no PIC, so that we don't
2309 # accidentally link it into a program.
2310 $show "echo timestamp > $libobj"
2311 $run eval "echo timestamp > $libobj" || exit $?
2315 if test -n "$pic_flag"; then
2316 # Only do commands if we really have different PIC objects.
2317 reload_objs="$libobjs $reload_conv_objs"
2319 eval cmds=\"$reload_cmds\"
2320 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2321 for cmd in $cmds; do
2324 $run eval "$cmd" || exit $?
2328 # Just create a symlink.
2331 $show "$LN_S $obj $libobj"
2332 $run $LN_S $obj $libobj || exit $?
2335 if test -n "$gentop"; then
2336 $show "${rm}r $gentop"
2343 # Anything else should be a program.
2345 if test -n "$vinfo"; then
2346 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2349 if test -n "$release"; then
2350 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2353 if test "$preload" = yes; then
2354 if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
2355 test "$dlopen_self_static" = unknown; then
2356 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2360 if test -n "$rpath$xrpath"; then
2361 # If the user specified any rpath flags, then add them.
2362 for libdir in $rpath $xrpath; do
2363 # This is the magic to use -rpath.
2364 case "$compile_rpath " in
2366 *) compile_rpath="$compile_rpath $libdir" ;;
2368 case "$finalize_rpath " in
2370 *) finalize_rpath="$finalize_rpath $libdir" ;;
2375 # Now hardcode the library paths
2378 for libdir in $compile_rpath $finalize_rpath; do
2379 if test -n "$hardcode_libdir_flag_spec"; then
2380 if test -n "$hardcode_libdir_separator"; then
2381 if test -z "$hardcode_libdirs"; then
2382 hardcode_libdirs="$libdir"
2384 # Just accumulate the unique libdirs.
2385 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2386 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2389 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2394 eval flag=\"$hardcode_libdir_flag_spec\"
2395 rpath="$rpath $flag"
2397 elif test -n "$runpath_var"; then
2398 case "$perm_rpath " in
2400 *) perm_rpath="$perm_rpath $libdir" ;;
2404 # Substitute the hardcoded libdirs into the rpath.
2405 if test -n "$hardcode_libdir_separator" &&
2406 test -n "$hardcode_libdirs"; then
2407 libdir="$hardcode_libdirs"
2408 eval rpath=\" $hardcode_libdir_flag_spec\"
2410 compile_rpath="$rpath"
2414 for libdir in $finalize_rpath; do
2415 if test -n "$hardcode_libdir_flag_spec"; then
2416 if test -n "$hardcode_libdir_separator"; then
2417 if test -z "$hardcode_libdirs"; then
2418 hardcode_libdirs="$libdir"
2420 # Just accumulate the unique libdirs.
2421 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2422 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2425 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2430 eval flag=\"$hardcode_libdir_flag_spec\"
2431 rpath="$rpath $flag"
2433 elif test -n "$runpath_var"; then
2434 case "$finalize_perm_rpath " in
2436 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
2440 # Substitute the hardcoded libdirs into the rpath.
2441 if test -n "$hardcode_libdir_separator" &&
2442 test -n "$hardcode_libdirs"; then
2443 libdir="$hardcode_libdirs"
2444 eval rpath=\" $hardcode_libdir_flag_spec\"
2446 finalize_rpath="$rpath"
2448 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2449 if test "X$output_objdir" = "X$output"; then
2450 output_objdir="$objdir"
2452 output_objdir="$output_objdir/$objdir"
2455 # Create the binary in the object directory, then wrap it.
2456 if test ! -d $output_objdir; then
2457 $show "$mkdir $output_objdir"
2458 $run $mkdir $output_objdir
2460 if test $status -ne 0 && test ! -d $output_objdir; then
2465 if test -n "$libobjs" && test "$build_old_libs" = yes; then
2466 # Transform all the library objects into standard objects.
2467 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2468 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2472 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2473 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2474 dlsyms="${outputname}S.c"
2476 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
2480 if test -n "$dlsyms"; then
2484 # Discover the nlist of each of the dlfiles.
2485 nlist="$output_objdir/${outputname}.nm"
2487 $show "$rm $nlist ${nlist}S ${nlist}T"
2488 $run $rm "$nlist" "${nlist}S" "${nlist}T"
2490 # Parse the name list into a source file.
2491 $show "creating $output_objdir/$dlsyms"
2493 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
2494 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
2495 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
2501 /* Prevent the only kind of declaration conflicts we can make. */
2502 #define lt_preloaded_symbols some_other_symbol
2504 /* External symbol declarations for the compiler. */\
2507 if test "$dlself" = yes; then
2508 $show "generating symbol list for \`$output'"
2510 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
2512 # Add our own program objects to the symbol list.
2513 progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2514 for arg in $progfiles; do
2515 $show "extracting global C symbols from \`$arg'"
2516 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2519 if test -n "$exclude_expsyms"; then
2520 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2521 $run eval '$mv "$nlist"T "$nlist"'
2524 if test -n "$export_symbols_regex"; then
2525 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2526 $run eval '$mv "$nlist"T "$nlist"'
2529 # Prepare the list of exported symbols
2530 if test -z "$export_symbols"; then
2531 export_symbols="$output_objdir/$output.exp"
2532 $run $rm $export_symbols
2533 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2535 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
2536 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
2537 $run eval 'mv "$nlist"T "$nlist"'
2541 for arg in $dlprefiles; do
2542 $show "extracting global C symbols from \`$arg'"
2543 name=`echo "$arg" | sed -e 's%^.*/%%'`
2544 $run eval 'echo ": $name " >> "$nlist"'
2545 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2548 if test -z "$run"; then
2549 # Make sure we have at least an empty file.
2550 test -f "$nlist" || : > "$nlist"
2552 if test -n "$exclude_expsyms"; then
2553 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2554 $mv "$nlist"T "$nlist"
2557 # Try sorting and uniquifying the output.
2558 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
2561 grep -v "^: " < "$nlist" > "$nlist"S
2564 if test -f "$nlist"S; then
2565 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
2567 echo '/* NONE */' >> "$output_objdir/$dlsyms"
2570 $echo >> "$output_objdir/$dlsyms" "\
2572 #undef lt_preloaded_symbols
2574 #if defined (__STDC__) && __STDC__
2575 # define lt_ptr_t void *
2577 # define lt_ptr_t char *
2581 /* The mapping between symbol names and symbols. */
2586 lt_preloaded_symbols[] =
2590 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
2591 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
2592 < "$nlist" >> "$output_objdir/$dlsyms"
2594 $echo >> "$output_objdir/$dlsyms" "\
2598 /* This works around a problem in FreeBSD linker */
2599 #ifdef FREEBSD_WORKAROUND
2600 static const void *lt_preloaded_setup() {
2601 return lt_preloaded_symbols;
2611 pic_flag_for_symtable=
2613 # compiling the symbol table file with pic_flag works around
2614 # a FreeBSD bug that causes programs to crash when -lm is
2615 # linked before any other PIC object. But we must not use
2616 # pic_flag when linking with -static. The problem exists in
2617 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2618 *-*-freebsd2*|*-*-freebsd3.0*)
2619 case "$compile_command " in
2621 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
2625 # Now compile the dynamic symbol file.
2626 $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
2627 $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
2629 # Clean up the generated files.
2630 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
2631 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
2633 # Transform the symbol file into the correct name.
2634 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2635 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2638 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
2643 # We keep going just in case the user didn't refer to
2644 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2645 # really was required.
2647 # Nullify the symbol file.
2648 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2649 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2652 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
2653 # Replace the output file specification.
2654 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
2655 link_command="$compile_command$compile_rpath"
2657 # We have no uninstalled library dependencies, so finalize right now.
2658 $show "$link_command"
2659 $run eval "$link_command"
2662 # Delete the generated files.
2663 if test -n "$dlsyms"; then
2664 $show "$rm $output_objdir/${outputname}S.${objext}"
2665 $run $rm "$output_objdir/${outputname}S.${objext}"
2671 if test -n "$shlibpath_var"; then
2672 # We should set the shlibpath_var
2674 for dir in $temp_rpath; do
2676 [\\/]* | [A-Za-z]:[\\/]*)
2681 # Relative path: add a thisdir entry.
2682 rpath="$rpath\$thisdir/$dir:"
2689 if test -n "$compile_shlibpath$finalize_shlibpath"; then
2690 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
2692 if test -n "$finalize_shlibpath"; then
2693 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
2698 if test -n "$runpath_var"; then
2699 if test -n "$perm_rpath"; then
2700 # We should set the runpath_var.
2702 for dir in $perm_rpath; do
2705 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
2707 if test -n "$finalize_perm_rpath"; then
2708 # We should set the runpath_var.
2710 for dir in $finalize_perm_rpath; do
2713 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
2717 if test "$hardcode_action" = relink; then
2718 # Fast installation is not supported
2719 link_command="$compile_var$compile_command$compile_rpath"
2720 relink_command="$finalize_var$finalize_command$finalize_rpath"
2722 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
2723 $echo "$modename: \`$output' will be relinked during installation" 1>&2
2725 if test "$fast_install" != no; then
2726 link_command="$finalize_var$compile_command$finalize_rpath"
2727 if test "$fast_install" = yes; then
2728 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
2730 # fast_install is set to needless
2734 link_command="$compile_var$compile_command$compile_rpath"
2735 relink_command="$finalize_var$finalize_command$finalize_rpath"
2739 # Replace the output file specification.
2740 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
2742 # Delete the old output files.
2743 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
2745 $show "$link_command"
2746 $run eval "$link_command" || exit $?
2748 # Now create the wrapper script.
2749 $show "creating $output"
2751 # Quote the relink command for shipping.
2752 if test -n "$relink_command"; then
2753 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
2756 # Quote $echo for shipping.
2757 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
2759 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
2760 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
2762 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
2764 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
2767 # Only actually do things if our run command is non-null.
2768 if test -z "$run"; then
2769 # win32 will think the script is a binary if it has
2770 # a .exe suffix, so we strip it off here.
2772 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
2775 trap "$rm $output; exit 1" 1 2 15
2780 # $output - temporary wrapper script for $objdir/$outputname
2781 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
2783 # The $output program cannot be directly executed until all the libtool
2784 # libraries that it depends on are installed.
2786 # This wrapper script should never be moved out of the build directory.
2787 # If it is, it will not operate correctly.
2789 # Sed substitution that helps us do robust quoting. It backslashifies
2790 # metacharacters that are still active within double-quoted strings.
2791 Xsed='sed -e 1s/^X//'
2792 sed_quote_subst='$sed_quote_subst'
2794 # The HP-UX ksh and POSIX shell print the target directory to stdout
2796 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
2798 relink_command=\"$relink_command\"
2800 # This environment variable determines our operation mode.
2801 if test \"\$libtool_install_magic\" = \"$magic\"; then
2802 # install mode needs the following variable:
2803 link_against_libtool_libs='$link_against_libtool_libs'
2805 # When we are sourced in execute mode, \$file and \$echo are already set.
2806 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2809 # Make sure echo works.
2810 if test \"X\$1\" = X--no-reexec; then
2811 # Discard the --no-reexec flag, and continue.
2813 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
2814 # Yippee, \$echo works!
2817 # Restart under the correct shell, and then maybe \$echo will work.
2818 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2824 # Find the directory that this script lives in.
2825 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2826 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2828 # Follow symbolic links until we get to the real thisdir.
2829 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
2830 while test -n \"\$file\"; do
2831 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2833 # If there was a directory component, then change thisdir.
2834 if test \"x\$destdir\" != \"x\$file\"; then
2835 case \"\$destdir\" in
2836 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
2837 *) thisdir=\"\$thisdir/\$destdir\" ;;
2841 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2842 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
2845 # Try to get the absolute directory name.
2846 absdir=\`cd \"\$thisdir\" && pwd\`
2847 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2850 if test "$fast_install" = yes; then
2852 program=lt-'$outputname'
2853 progdir=\"\$thisdir/$objdir\"
2855 if test ! -f \"\$progdir/\$program\" || \\
2856 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
2857 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2859 file=\"\$\$-\$program\"
2861 if test ! -d \"\$progdir\"; then
2862 $mkdir \"\$progdir\"
2864 $rm \"\$progdir/\$file\"
2869 # relink executable if necessary
2870 if test -n \"\$relink_command\"; then
2871 if (cd \"\$thisdir\" && eval \$relink_command); then :
2873 $rm \"\$progdir/\$file\"
2878 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2879 { $rm \"\$progdir/\$program\";
2880 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2881 $rm \"\$progdir/\$file\"
2885 program='$outputname$exeext'
2886 progdir=\"\$thisdir/$objdir\"
2892 if test -f \"\$progdir/\$program\"; then"
2894 # Export our shlibpath_var if we have one.
2895 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2897 # Add our own library path to $shlibpath_var
2898 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2900 # Some systems cannot cope with colon-terminated $shlibpath_var
2901 # The second colon is a workaround for a bug in BeOS R4 sed
2902 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2904 export $shlibpath_var
2908 # fixup the dll searchpath if we need to.
2909 if test -n "$dllsearchpath"; then
2911 # Add the dll search path components to the executable PATH
2912 PATH=$dllsearchpath:\$PATH
2917 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2918 # Run the actual program with our arguments.
2921 *-*-cygwin* | *-*-mingw | *-*-os2*)
2922 # win32 systems need to use the prog path for dll
2925 exec \$progdir\\\\\$program \${1+\"\$@\"}
2930 # Export the path to the program.
2931 PATH=\"\$progdir:\$PATH\"
2934 exec \$program \${1+\"\$@\"}
2939 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
2943 # The program doesn't exist.
2944 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
2945 \$echo \"This script is just a wrapper for \$program.\" 1>&2
2946 echo \"See the $PACKAGE documentation for more information.\" 1>&2
2957 # See if we need to build an old-fashioned archive.
2958 for oldlib in $oldlibs; do
2960 if test "$build_libtool_libs" = convenience; then
2961 oldobjs="$libobjs_save"
2962 addlibs="$convenience"
2963 build_libtool_libs=no
2965 if test "$build_libtool_libs" = module; then
2966 oldobjs="$libobjs_save"
2967 build_libtool_libs=no
2969 oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
2971 addlibs="$old_convenience"
2974 if test -n "$addlibs"; then
2975 gentop="$output_objdir/${outputname}x"
2976 $show "${rm}r $gentop"
2977 $run ${rm}r "$gentop"
2978 $show "mkdir $gentop"
2979 $run mkdir "$gentop"
2981 if test $status -ne 0 && test ! -d "$gentop"; then
2984 generated="$generated $gentop"
2986 # Add in members from convenience archives.
2987 for xlib in $addlibs; do
2988 # Extract the objects.
2990 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2991 *) xabs=`pwd`"/$xlib" ;;
2993 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2994 xdir="$gentop/$xlib"
2996 $show "${rm}r $xdir"
3001 if test $status -ne 0 && test ! -d "$xdir"; then
3004 $show "(cd $xdir && $AR x $xabs)"
3005 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3007 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3011 # Do each command in the archive commands.
3012 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3013 eval cmds=\"$old_archive_from_new_cmds\"
3015 # Ensure that we have .o objects in place incase we decided
3016 # not to build a shared library, and have fallen back to building
3017 # static libs even though --disable-static was passed!
3018 for oldobj in $oldobjs; do
3019 if test ! -f $oldobj; then
3020 obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
3021 $show "${LN_S} $obj $oldobj"
3022 $run ${LN_S} $obj $oldobj || exit $?
3026 eval cmds=\"$old_archive_cmds\"
3028 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3029 for cmd in $cmds; do
3032 $run eval "$cmd" || exit $?
3037 if test -n "$generated"; then
3038 $show "${rm}r$generated"
3039 $run ${rm}r$generated
3042 # Now create the libtool archive.
3046 test "$build_old_libs" = yes && old_library="$libname.$libext"
3047 $show "creating $output"
3049 if test -n "$xrpath"; then
3051 for libdir in $xrpath; do
3052 temp_xrpath="$temp_xrpath -R$libdir"
3054 dependency_libs="$temp_xrpath $dependency_libs"
3057 # Only create the output if not a dry run.
3058 if test -z "$run"; then
3059 for installed in no yes; do
3060 if test "$installed" = yes; then
3061 if test -z "$install_libdir"; then
3064 output="$output_objdir/$outputname"i
3068 # $outputname - a libtool library file
3069 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3071 # Please DO NOT delete this file!
3072 # It is necessary for linking the library.
3074 # The name that we can dlopen(3).
3077 # Names of this library.
3078 library_names='$library_names'
3080 # The name of the static archive.
3081 old_library='$old_library'
3083 # Libraries that this one depends upon.
3084 dependency_libs='$dependency_libs'
3086 # Version information for $libname.
3091 # Is this an already installed library?
3092 installed=$installed
3094 # Directory that this library needs to be installed in:
3095 libdir='$install_libdir'\
3100 # Do a symbolic link so that the libtool archive can be found in
3101 # LD_LIBRARY_PATH before the program is installed.
3102 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3103 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
3109 # libtool install mode
3111 modename="$modename: install"
3113 # There may be an optional sh(1) argument at the beginning of
3114 # install_prog (especially on Windows NT).
3115 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
3116 # Aesthetically quote it.
3117 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3119 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3123 install_prog="$arg "
3131 # The real first argument should be the name of the installation program.
3132 # Aesthetically quote it.
3133 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3135 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3139 install_prog="$install_prog$arg"
3141 # We need to accept at least all the BSD install flags.
3151 if test -n "$dest"; then
3152 files="$files $dest"
3170 # If the previous option needed an argument, then skip it.
3171 if test -n "$prev"; then
3180 # Aesthetically quote the argument.
3181 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3183 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3187 install_prog="$install_prog $arg"
3190 if test -z "$install_prog"; then
3191 $echo "$modename: you must specify an install program" 1>&2
3196 if test -n "$prev"; then
3197 $echo "$modename: the \`$prev' option requires an argument" 1>&2
3202 if test -z "$files"; then
3203 if test -z "$dest"; then
3204 $echo "$modename: no file or destination specified" 1>&2
3206 $echo "$modename: you must specify a destination" 1>&2
3212 # Strip any trailing slash from the destination.
3213 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3215 # Check to see that the destination is a directory.
3216 test -d "$dest" && isdir=yes
3217 if test "$isdir" = yes; then
3221 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3222 test "X$destdir" = "X$dest" && destdir=.
3223 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3225 # Not a directory, so check to see that there is only one file specified.
3227 if test $# -gt 2; then
3228 $echo "$modename: \`$dest' is not a directory" 1>&2
3234 [\\/]* | [A-Za-z]:[\\/]*) ;;
3236 for file in $files; do
3240 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3249 # This variable tells wrapper scripts just to set variables rather
3250 # than running their programs.
3251 libtool_install_magic="$magic"
3256 for file in $files; do
3258 # Do each installation.
3261 # Do the static libraries later.
3262 staticlibs="$staticlibs $file"
3266 # Check to see that this really is a libtool archive.
3267 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3269 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3276 # If there is no directory component, then add one.
3278 */* | *\\*) . $file ;;
3282 # Add the libdir to current_libdirs if it is the destination.
3283 if test "X$destdir" = "X$libdir"; then
3284 case "$current_libdirs " in
3286 *) current_libdirs="$current_libdirs $libdir" ;;
3289 # Note the libdir as a future libdir.
3290 case "$future_libdirs " in
3292 *) future_libdirs="$future_libdirs $libdir" ;;
3296 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
3297 test "X$dir" = "X$file/" && dir=
3300 # See the names of the shared library.
3301 set dummy $library_names
3302 if test -n "$2"; then
3307 # Install the shared library and build the symlinks.
3308 $show "$install_prog $dir/$realname $destdir/$realname"
3309 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
3311 if test $# -gt 0; then
3312 # Delete the old symlinks, and create new ones.
3315 if test "$linkname" != "$realname"; then
3316 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3317 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3322 # Do each command in the postinstall commands.
3323 lib="$destdir/$realname"
3324 eval cmds=\"$postinstall_cmds\"
3325 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3326 for cmd in $cmds; do
3329 $run eval "$cmd" || exit $?
3334 # Install the pseudo-library for information purposes.
3335 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3336 instname="$dir/$name"i
3337 $show "$install_prog $instname $destdir/$name"
3338 $run eval "$install_prog $instname $destdir/$name" || exit $?
3340 # Maybe install the static library, too.
3341 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
3345 # Install (i.e. copy) a libtool object.
3347 # Figure out destination file name, if it wasn't already specified.
3348 if test -n "$destname"; then
3349 destfile="$destdir/$destname"
3351 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3352 destfile="$destdir/$destfile"
3355 # Deduce the name of the destination old-style object file.
3358 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
3361 staticdest="$destfile"
3365 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
3371 # Install the libtool object if requested.
3372 if test -n "$destfile"; then
3373 $show "$install_prog $file $destfile"
3374 $run eval "$install_prog $file $destfile" || exit $?
3377 # Install the old object if enabled.
3378 if test "$build_old_libs" = yes; then
3379 # Deduce the name of the old-style object file.
3380 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
3382 $show "$install_prog $staticobj $staticdest"
3383 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
3389 # Figure out destination file name, if it wasn't already specified.
3390 if test -n "$destname"; then
3391 destfile="$destdir/$destname"
3393 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3394 destfile="$destdir/$destfile"
3397 # Do a test to see if this is really a libtool program.
3398 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3399 link_against_libtool_libs=
3402 # If there is no directory component, then add one.
3404 */* | *\\*) . $file ;;
3408 # Check the variables that should have been set.
3409 if test -z "$link_against_libtool_libs"; then
3410 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
3415 for lib in $link_against_libtool_libs; do
3416 # Check to see that each library is installed.
3418 if test -f "$lib"; then
3419 # If there is no directory component, then add one.
3421 */* | *\\*) . $lib ;;
3425 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
3426 if test -n "$libdir" && test ! -f "$libfile"; then
3427 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
3433 if test "$fast_install" = no && test -n "$relink_command"; then
3434 if test "$finalize" = yes && test -z "$run"; then
3436 test -n "$TMPDIR" && tmpdir="$TMPDIR"
3437 tmpdir="$tmpdir/libtool-$$"
3438 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
3440 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
3443 outputname="$tmpdir/$file"
3444 # Replace the output file specification.
3445 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
3447 $show "$relink_command"
3448 if $run eval "$relink_command"; then :
3450 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
3456 $echo "$modename: warning: cannot relink \`$file'" 1>&2
3459 # Install the binary that we compiled earlier.
3460 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
3464 $show "$install_prog$stripme $file $destfile"
3465 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
3466 test -n "$outputname" && ${rm}r "$tmpdir"
3471 for file in $staticlibs; do
3472 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3474 # Set up the ranlib parameters.
3475 oldlib="$destdir/$name"
3477 $show "$install_prog $file $oldlib"
3478 $run eval "$install_prog \$file \$oldlib" || exit $?
3480 # Do each command in the postinstall commands.
3481 eval cmds=\"$old_postinstall_cmds\"
3482 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3483 for cmd in $cmds; do
3486 $run eval "$cmd" || exit $?
3491 if test -n "$future_libdirs"; then
3492 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
3495 if test -n "$current_libdirs"; then
3496 # Maybe just do a dry run.
3497 test -n "$run" && current_libdirs=" -n$current_libdirs"
3498 exec $SHELL $0 --finish$current_libdirs
3505 # libtool finish mode
3507 modename="$modename: finish"
3511 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3514 libdirs="$libdirs $dir"
3517 for libdir in $libdirs; do
3518 if test -n "$finish_cmds"; then
3519 # Do each command in the finish commands.
3520 eval cmds=\"$finish_cmds\"
3521 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3522 for cmd in $cmds; do
3525 $run eval "$cmd" || admincmds="$admincmds
3530 if test -n "$finish_eval"; then
3531 # Do the single finish_eval.
3532 eval cmds=\"$finish_eval\"
3533 $run eval "$cmds" || admincmds="$admincmds
3539 # Exit here if they wanted silent mode.
3540 test "$show" = : && exit 0
3542 echo "----------------------------------------------------------------------"
3543 echo "Libraries have been installed in:"
3544 for libdir in $libdirs; do
3548 echo "If you ever happen to want to link against installed libraries"
3549 echo "in a given directory, LIBDIR, you must either use libtool, and"
3550 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
3551 echo "flag during linking and do at least one of the following:"
3552 if test -n "$shlibpath_var"; then
3553 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3554 echo " during execution"
3556 if test -n "$runpath_var"; then
3557 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3558 echo " during linking"
3560 if test -n "$hardcode_libdir_flag_spec"; then
3562 eval flag=\"$hardcode_libdir_flag_spec\"
3564 echo " - use the \`$flag' linker flag"
3566 if test -n "$admincmds"; then
3567 echo " - have your system administrator run these commands:$admincmds"
3569 if test -f /etc/ld.so.conf; then
3570 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3573 echo "See any operating system documentation about shared libraries for"
3574 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3575 echo "----------------------------------------------------------------------"
3579 # libtool execute mode
3581 modename="$modename: execute"
3583 # The first argument is the command name.
3585 if test -z "$cmd"; then
3586 $echo "$modename: you must specify a COMMAND" 1>&2
3591 # Handle -dlopen flags immediately.
3592 for file in $execute_dlfiles; do
3593 if test ! -f "$file"; then
3594 $echo "$modename: \`$file' is not a file" 1>&2
3602 # Check to see that this really is a libtool archive.
3603 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3605 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3610 # Read the libtool library.
3614 # If there is no directory component, then add one.
3616 */* | *\\*) . $file ;;
3620 # Skip this library if it cannot be dlopened.
3621 if test -z "$dlname"; then
3622 # Warn if it was a shared library.
3623 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
3627 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3628 test "X$dir" = "X$file" && dir=.
3630 if test -f "$dir/$objdir/$dlname"; then
3633 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
3639 # Just add the directory containing the .lo file.
3640 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3641 test "X$dir" = "X$file" && dir=.
3645 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
3650 # Get the absolute pathname.
3651 absdir=`cd "$dir" && pwd`
3652 test -n "$absdir" && dir="$absdir"
3654 # Now add the directory to shlibpath_var.
3655 if eval "test -z \"\$$shlibpath_var\""; then
3656 eval "$shlibpath_var=\"\$dir\""
3658 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3662 # This variable tells wrapper scripts just to set shlibpath_var
3663 # rather than running their programs.
3664 libtool_execute_magic="$magic"
3666 # Check if any of the arguments is a wrapper script.
3673 # Do a test to see if this is really a libtool program.
3674 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3675 # If there is no directory component, then add one.
3677 */* | *\\*) . $file ;;
3681 # Transform arg to wrapped name.
3682 file="$progdir/$program"
3686 # Quote arguments (to preserve shell metacharacters).
3687 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
3688 args="$args \"$file\""
3691 if test -z "$run"; then
3692 # Export the shlibpath_var.
3693 eval "export $shlibpath_var"
3695 # Restore saved enviroment variables
3696 if test "${save_LC_ALL+set}" = set; then
3697 LC_ALL="$save_LC_ALL"; export LC_ALL
3699 if test "${save_LANG+set}" = set; then
3700 LANG="$save_LANG"; export LANG
3703 # Now actually exec the command.
3704 eval "exec \$cmd$args"
3706 $echo "$modename: cannot exec \$cmd$args"
3709 # Display what would be done.
3710 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
3711 $echo "export $shlibpath_var"
3717 # libtool uninstall mode
3719 modename="$modename: uninstall"
3726 -*) rm="$rm $arg" ;;
3727 *) files="$files $arg" ;;
3731 if test -z "$rm"; then
3732 $echo "$modename: you must specify an RM program" 1>&2
3737 for file in $files; do
3738 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3739 test "X$dir" = "X$file" && dir=.
3740 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3746 # Possibly a libtool archive, so verify it.
3747 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3750 # Delete the libtool libraries and symlinks.
3751 for n in $library_names; do
3752 rmfiles="$rmfiles $dir/$n"
3754 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
3756 $show "$rm $rmfiles"
3759 if test -n "$library_names"; then
3760 # Do each command in the postuninstall commands.
3761 eval cmds=\"$postuninstall_cmds\"
3762 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3763 for cmd in $cmds; do
3771 if test -n "$old_library"; then
3772 # Do each command in the old_postuninstall commands.
3773 eval cmds=\"$old_postuninstall_cmds\"
3774 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3775 for cmd in $cmds; do
3783 # FIXME: should reinstall the best remaining shared library.
3788 if test "$build_old_libs" = yes; then
3789 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
3790 rmfiles="$rmfiles $dir/$oldobj"
3792 $show "$rm $rmfiles"
3797 $show "$rm $rmfiles"
3806 $echo "$modename: you must specify a MODE" 1>&2
3807 $echo "$generic_help" 1>&2
3812 $echo "$modename: invalid operation mode \`$mode'" 1>&2
3813 $echo "$generic_help" 1>&2
3815 fi # test -z "$show_help"
3817 # We need to display help for each of the modes.
3820 "Usage: $modename [OPTION]... [MODE-ARG]...
3822 Provide generalized library-building support services.
3824 --config show all configuration variables
3825 --debug enable verbose shell tracing
3826 -n, --dry-run display commands without modifying any files
3827 --features display basic configuration information and exit
3828 --finish same as \`--mode=finish'
3829 --help display this help message and exit
3830 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
3831 --quiet same as \`--silent'
3832 --silent don't print informational messages
3833 --version print version information
3835 MODE must be one of the following:
3837 compile compile a source file into a libtool object
3838 execute automatically set library path, then run a program
3839 finish complete the installation of libtool libraries
3840 install install libraries or executables
3841 link create a library or an executable
3842 uninstall remove libraries from an installed directory
3844 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
3845 a more detailed description of MODE."
3851 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
3853 Compile a source file into a libtool library object.
3855 This mode accepts the following additional options:
3857 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
3858 -static always build a \`.o' file suitable for static linking
3860 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
3861 from the given SOURCEFILE.
3863 The output file name is determined by removing the directory component from
3864 SOURCEFILE, then substituting the C source code suffix \`.c' with the
3865 library object suffix, \`.lo'."
3870 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
3872 Automatically set library path, then run a program.
3874 This mode accepts the following additional options:
3876 -dlopen FILE add the directory containing FILE to the library path
3878 This mode sets the library path environment variable according to \`-dlopen'
3881 If any of the ARGS are libtool executable wrappers, then they are translated
3882 into their corresponding uninstalled binary, and any of their required library
3883 directories are added to the library path.
3885 Then, COMMAND is executed, with ARGS as arguments."
3890 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
3892 Complete the installation of libtool libraries.
3894 Each LIBDIR is a directory that contains libtool libraries.
3896 The commands that this mode executes may require superuser privileges. Use
3897 the \`--dry-run' option if you just want to see what would be executed."
3902 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
3904 Install executables or libraries.
3906 INSTALL-COMMAND is the installation command. The first component should be
3907 either the \`install' or \`cp' program.
3909 The rest of the components are interpreted as arguments to that command (only
3910 BSD-compatible install options are recognized)."
3915 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
3917 Link object files or libraries together to form another library, or to
3918 create an executable program.
3920 LINK-COMMAND is a command using the C compiler that you would use to create
3921 a program from several object files.
3923 The following components of LINK-COMMAND are treated specially:
3925 -all-static do not do any dynamic linking at all
3926 -avoid-version do not add a version suffix if possible
3927 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
3928 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
3929 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3930 -export-symbols SYMFILE
3931 try to export only the symbols listed in SYMFILE
3932 -export-symbols-regex REGEX
3933 try to export only the symbols matching REGEX
3934 -LLIBDIR search LIBDIR for required installed libraries
3935 -lNAME OUTPUT-FILE requires the installed library libNAME
3936 -module build a library that can dlopened
3937 -no-undefined declare that a library does not refer to external symbols
3938 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
3939 -release RELEASE specify package release information
3940 -rpath LIBDIR the created library will eventually be installed in LIBDIR
3941 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
3942 -static do not do any dynamic linking of libtool libraries
3943 -version-info CURRENT[:REVISION[:AGE]]
3944 specify library version info [each variable defaults to 0]
3946 All other options (arguments beginning with \`-') are ignored.
3948 Every other argument is treated as a filename. Files ending in \`.la' are
3949 treated as uninstalled libtool libraries, other files are standard or library
3952 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
3953 only library objects (\`.lo' files) may be specified, and \`-rpath' is
3954 required, except when creating a convenience library.
3956 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
3957 using \`ar' and \`ranlib', or on Windows using \`lib'.
3959 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
3960 is created, otherwise an executable program is created."
3965 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
3967 Remove libraries from an installation directory.
3969 RM is the name of the program to use to delete files associated with each FILE
3970 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
3973 If FILE is a libtool library, all the files associated with it are deleted.
3974 Otherwise, only FILE itself is deleted using RM."
3978 $echo "$modename: invalid operation mode \`$mode'" 1>&2
3985 $echo "Try \`$modename --help' for more information about other modes."