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* | *-*-aix*)
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
1632 if test -n "$hardcode_default_flag"; then
1633 eval linkopts=\"$linkopts$hardcode_default_flag\"
1637 if test -z "$rpath"; then
1638 if test "$build_libtool_libs" = yes; then
1639 # Building a libtool convenience library.
1641 oldlibs="$output_objdir/$libname.$libext $oldlibs"
1642 build_libtool_libs=convenience
1645 dependency_libs="$deplibs"
1647 if test -n "$vinfo"; then
1648 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1651 if test -n "$release"; then
1652 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1656 # Parse the version information argument.
1657 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
1658 set dummy $vinfo 0 0 0
1661 if test -n "$8"; then
1662 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1671 # Check that each of the things are valid numbers.
1673 0 | [1-9] | [1-9][0-9]*) ;;
1675 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1676 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1682 0 | [1-9] | [1-9][0-9]*) ;;
1684 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1685 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1691 0 | [1-9] | [1-9][0-9]*) ;;
1693 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1694 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1699 if test $age -gt $current; then
1700 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1701 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1705 # Calculate the version variables.
1709 case "$version_type" in
1713 major=`expr $current - $age + 1`
1714 versuffix="$major.$revision"
1715 verstring="sgi$major.$revision"
1717 # Add in all the interfaces that we are compatible with.
1719 while test $loop != 0; do
1720 iface=`expr $revision - $loop`
1721 loop=`expr $loop - 1`
1722 verstring="sgi$major.$iface:$verstring"
1727 major=.`expr $current - $age`
1728 versuffix="$major.$age.$revision"
1732 major=`expr $current - $age`
1733 versuffix=".$current.$age.$revision"
1734 verstring="$current.$age.$revision"
1736 # Add in all the interfaces that we are compatible with.
1738 while test $loop != 0; do
1739 iface=`expr $current - $loop`
1740 loop=`expr $loop - 1`
1741 verstring="$verstring:${iface}.0"
1744 # Make executables depend on our current version.
1745 verstring="$verstring:${current}.0"
1750 versuffix=".$current.$revision"
1755 versuffix=".$current.$revision";
1760 versuffix=".$current";
1764 # Like Linux, but with '-' rather than '.', since we only
1765 # want one extension on Windows 95.
1766 major=`expr $current - $age`
1767 versuffix="-$major-$age-$revision"
1771 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1772 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1777 # Clear the version info if we defaulted, and they specified a release.
1778 if test -z "$vinfo" && test -n "$release"; then
1781 if test "$need_version" = no; then
1788 # Remove version info from name if versioning should be avoided
1789 if test "$avoid_version" = yes && test "$need_version" = no; then
1795 # Check to see if the archive will have undefined symbols.
1796 if test "$allow_undefined" = yes; then
1797 if test "$allow_undefined_flag" = unsupported; then
1798 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1799 build_libtool_libs=no
1803 # Don't allow undefined symbols.
1804 allow_undefined_flag="$no_undefined_flag"
1807 dependency_libs="$deplibs"
1809 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos* | *-*-aix*)
1810 # these systems don't actually have a c library (as such)!
1813 # Add libc to deplibs on all other systems.
1814 deplibs="$deplibs -lc"
1819 # Create the output directory, or remove our outputs if we need to.
1820 if test -d $output_objdir; then
1821 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
1822 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
1824 $show "$mkdir $output_objdir"
1825 $run $mkdir $output_objdir
1827 if test $status -ne 0 && test ! -d $output_objdir; then
1832 # Now set the variables for building old libraries.
1833 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
1834 oldlibs="$oldlibs $output_objdir/$libname.$libext"
1836 # Transform .lo files to .o files.
1837 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
1840 if test "$build_libtool_libs" = yes; then
1841 # Transform deplibs into only deplibs that can be linked in shared.
1843 libname_save=$libname
1844 release_save=$release
1845 versuffix_save=$versuffix
1847 # I'm not sure if I'm treating the release correctly. I think
1848 # release should show up in the -l (ie -lgmp5) so we don't want to
1849 # add it in twice. Is that correct?
1855 case "$deplibs_check_method" in
1857 # Don't check for shared/static. Everything works.
1858 # This might be a little naive. We might want to check
1859 # whether the library exists or not. But this is on
1860 # osf3 & osf4 and I'm not really sure... Just
1861 # implementing what was already the behaviour.
1865 # This code stresses the "libraries are programs" paradigm to its
1866 # limits. Maybe even breaks it. We compile a program, linking it
1867 # against the deplibs as a proxy for the library. Then we can check
1868 # whether they linked in statically or dynamically with ldd.
1870 cat > conftest.c <<EOF
1871 int main() { return 0; }
1874 $C_compiler -o conftest conftest.c $deplibs
1875 if test $? -eq 0 ; then
1876 ldd_output=`ldd conftest`
1877 for i in $deplibs; do
1878 name="`expr $i : '-l\(.*\)'`"
1879 # If $name is empty we are operating on a -L argument.
1880 if test "$name" != "" ; then
1881 libname=`eval \\$echo \"$libname_spec\"`
1882 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1883 set dummy $deplib_matches
1885 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1886 newdeplibs="$newdeplibs $i"
1890 echo "*** Warning: This library needs some functionality provided by $i."
1891 echo "*** I have the capability to make that library automatically link in when"
1892 echo "*** you link to this library. But I can only do this if you have a"
1893 echo "*** shared version of the library, which you do not appear to have."
1896 newdeplibs="$newdeplibs $i"
1900 # Error occured in the first compile. Let's try to salvage the situation:
1901 # Compile a seperate program for each library.
1902 for i in $deplibs; do
1903 name="`expr $i : '-l\(.*\)'`"
1904 # If $name is empty we are operating on a -L argument.
1905 if test "$name" != "" ; then
1907 $C_compiler -o conftest conftest.c $i
1909 if test $? -eq 0 ; then
1910 ldd_output=`ldd conftest`
1911 libname=`eval \\$echo \"$libname_spec\"`
1912 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1913 set dummy $deplib_matches
1915 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1916 newdeplibs="$newdeplibs $i"
1920 echo "*** Warning: This library needs some functionality provided by $i."
1921 echo "*** I have the capability to make that library automatically link in when"
1922 echo "*** you link to this library. But I can only do this if you have a"
1923 echo "*** shared version of the library, which you do not appear to have."
1928 echo "*** Warning! Library $i is needed by this library but I was not able to"
1929 echo "*** make it link in! You will probably need to install it or some"
1930 echo "*** library that it depends on before this library will be fully"
1931 echo "*** functional. Installing it before continuing would be even better."
1934 newdeplibs="$newdeplibs $i"
1940 set dummy $deplibs_check_method
1941 file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
1942 for a_deplib in $deplibs; do
1943 name="`expr $a_deplib : '-l\(.*\)'`"
1944 # If $name is empty we are operating on a -L argument.
1945 if test "$name" != "" ; then
1946 libname=`eval \\$echo \"$libname_spec\"`
1947 for i in $lib_search_path; do
1948 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
1949 for potent_lib in $potential_libs; do
1950 # Follow soft links.
1951 if ls -lLd "$potent_lib" 2>/dev/null \
1952 | grep " -> " >/dev/null; then
1955 # The statement above tries to avoid entering an
1956 # endless loop below, in case of cyclic links.
1957 # We might still enter an endless loop, since a link
1958 # loop can be closed while we follow links,
1960 potlib="$potent_lib"
1961 while test -h "$potlib" 2>/dev/null; do
1962 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
1963 case "$potliblink" in
1964 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
1965 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
1968 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
1970 | egrep "$file_magic_regex" > /dev/null; then
1971 newdeplibs="$newdeplibs $a_deplib"
1977 if test -n "$a_deplib" ; then
1980 echo "*** Warning: This library needs some functionality provided by $a_deplib."
1981 echo "*** I have the capability to make that library automatically link in when"
1982 echo "*** you link to this library. But I can only do this if you have a"
1983 echo "*** shared version of the library, which you do not appear to have."
1986 # Add a -L argument.
1987 newdeplibs="$newdeplibs $a_deplib"
1989 done # Gone through all deplibs.
1993 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
1994 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
1995 grep . >/dev/null; then
1997 if test "X$deplibs_check_method" = "Xnone"; then
1998 echo "*** Warning: inter-library dependencies are not supported in this platform."
2000 echo "*** Warning: inter-library dependencies are not known to be supported."
2002 echo "*** All declared inter-library dependencies are being dropped."
2007 versuffix=$versuffix_save
2009 release=$release_save
2010 libname=$libname_save
2013 if test "$droppeddeps" = yes; then
2014 if test "$module" = yes; then
2016 echo "*** Warning: libtool could not satisfy all declared inter-library"
2017 echo "*** dependencies of module $libname. Therefore, libtool will create"
2018 echo "*** a static module, that should work as long as the dlopening"
2019 echo "*** application is linked with the -dlopen flag."
2020 if test -z "$global_symbol_pipe"; then
2022 echo "*** However, this would only work if libtool was able to extract symbol"
2023 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2024 echo "*** not find such a program. So, this module is probably useless."
2025 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2027 if test "$build_old_libs" = no; then
2028 oldlibs="$output_objdir/$libname.$libext"
2029 build_libtool_libs=module
2032 build_libtool_libs=no
2035 echo "*** The inter-library dependencies that have been dropped here will be"
2036 echo "*** automatically added whenever a program is linked with this library"
2037 echo "*** or is declared to -dlopen it."
2040 # Done checking deplibs!
2044 # All the library-specific variables (install_libdir is set above).
2049 # Test again, we may have decided not to build it any more
2050 if test "$build_libtool_libs" = yes; then
2051 # Get the real and link names of the library.
2052 eval library_names=\"$library_names_spec\"
2053 set dummy $library_names
2057 if test -n "$soname_spec"; then
2058 eval soname=\"$soname_spec\"
2063 lib="$output_objdir/$realname"
2066 linknames="$linknames $link"
2069 # Ensure that we have .o objects for linkers which dislike .lo
2070 # (e.g. aix) incase we are running --disable-static
2071 for obj in $libobjs; do
2072 oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
2073 if test ! -f $oldobj; then
2074 $show "${LN_S} $obj $oldobj"
2075 $run ${LN_S} $obj $oldobj || exit $?
2079 # Use standard objects if they are pic
2080 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2082 # Prepare the list of exported symbols
2083 if test -z "$export_symbols"; then
2084 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2085 $show "generating symbol list for \`$libname.la'"
2086 export_symbols="$output_objdir/$libname.exp"
2087 $run $rm $export_symbols
2088 eval cmds=\"$export_symbols_cmds\"
2089 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2090 for cmd in $cmds; do
2093 $run eval "$cmd" || exit $?
2096 if test -n "$export_symbols_regex"; then
2097 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2098 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2099 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2100 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2105 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2106 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2109 if test -n "$convenience"; then
2110 if test -n "$whole_archive_flag_spec"; then
2111 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2113 gentop="$output_objdir/${outputname}x"
2114 $show "${rm}r $gentop"
2115 $run ${rm}r "$gentop"
2116 $show "mkdir $gentop"
2117 $run mkdir "$gentop"
2119 if test $status -ne 0 && test ! -d "$gentop"; then
2122 generated="$generated $gentop"
2124 for xlib in $convenience; do
2125 # Extract the objects.
2127 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2128 *) xabs=`pwd`"/$xlib" ;;
2130 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2131 xdir="$gentop/$xlib"
2133 $show "${rm}r $xdir"
2138 if test $status -ne 0 && test ! -d "$xdir"; then
2141 $show "(cd $xdir && $AR x $xabs)"
2142 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2144 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2149 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2150 eval flag=\"$thread_safe_flag_spec\"
2151 linkopts="$linkopts $flag"
2154 # Do each of the archive commands.
2155 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2156 eval cmds=\"$archive_expsym_cmds\"
2158 eval cmds=\"$archive_cmds\"
2160 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2161 for cmd in $cmds; do
2164 $run eval "$cmd" || exit $?
2168 # Create links to the real library.
2169 for linkname in $linknames; do
2170 if test "$realname" != "$linkname"; then
2171 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2172 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2176 # If -module or -export-dynamic was specified, set the dlname.
2177 if test "$module" = yes || test "$export_dynamic" = yes; then
2178 # On all known operating systems, these are identical.
2185 if test -n "$link_against_libtool_libs"; then
2186 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
2190 if test -n "$deplibs"; then
2191 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2194 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2195 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2198 if test -n "$rpath"; then
2199 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2202 if test -n "$xrpath"; then
2203 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2206 if test -n "$vinfo"; then
2207 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2210 if test -n "$release"; then
2211 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2216 if test -n "$objs"; then
2217 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2221 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2229 # Delete the old objects.
2230 $run $rm $obj $libobj
2232 # Objects from convenience libraries. This assumes
2233 # single-version convenience libraries. Whenever we create
2234 # different ones for PIC/non-PIC, this we'll have to duplicate
2238 # reload_cmds runs $LD directly, so let us get rid of
2239 # -Wl from whole_archive_flag_spec
2242 if test -n "$convenience"; then
2243 if test -n "$whole_archive_flag_spec"; then
2244 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2246 gentop="$output_objdir/${obj}x"
2247 $show "${rm}r $gentop"
2248 $run ${rm}r "$gentop"
2249 $show "mkdir $gentop"
2250 $run mkdir "$gentop"
2252 if test $status -ne 0 && test ! -d "$gentop"; then
2255 generated="$generated $gentop"
2257 for xlib in $convenience; do
2258 # Extract the objects.
2260 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2261 *) xabs=`pwd`"/$xlib" ;;
2263 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2264 xdir="$gentop/$xlib"
2266 $show "${rm}r $xdir"
2271 if test $status -ne 0 && test ! -d "$xdir"; then
2274 $show "(cd $xdir && $AR x $xabs)"
2275 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2277 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2282 # Create the old-style object.
2283 reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
2286 eval cmds=\"$reload_cmds\"
2287 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2288 for cmd in $cmds; do
2291 $run eval "$cmd" || exit $?
2295 # Exit if we aren't doing a library object file.
2296 if test -z "$libobj"; then
2297 if test -n "$gentop"; then
2298 $show "${rm}r $gentop"
2305 if test "$build_libtool_libs" != yes; then
2306 if test -n "$gentop"; then
2307 $show "${rm}r $gentop"
2311 # Create an invalid libtool object if no PIC, so that we don't
2312 # accidentally link it into a program.
2313 $show "echo timestamp > $libobj"
2314 $run eval "echo timestamp > $libobj" || exit $?
2318 if test -n "$pic_flag"; then
2319 # Only do commands if we really have different PIC objects.
2320 reload_objs="$libobjs $reload_conv_objs"
2322 eval cmds=\"$reload_cmds\"
2323 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2324 for cmd in $cmds; do
2327 $run eval "$cmd" || exit $?
2331 # Just create a symlink.
2334 $show "$LN_S $obj $libobj"
2335 $run $LN_S $obj $libobj || exit $?
2338 if test -n "$gentop"; then
2339 $show "${rm}r $gentop"
2346 # Anything else should be a program.
2348 if test -n "$vinfo"; then
2349 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2352 if test -n "$release"; then
2353 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2356 if test "$preload" = yes; then
2357 if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
2358 test "$dlopen_self_static" = unknown; then
2359 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2363 if test -n "$rpath$xrpath"; then
2364 # If the user specified any rpath flags, then add them.
2365 for libdir in $rpath $xrpath; do
2366 # This is the magic to use -rpath.
2367 case "$compile_rpath " in
2369 *) compile_rpath="$compile_rpath $libdir" ;;
2371 case "$finalize_rpath " in
2373 *) finalize_rpath="$finalize_rpath $libdir" ;;
2378 # Now hardcode the library paths
2381 for libdir in $compile_rpath $finalize_rpath; do
2382 if test -n "$hardcode_libdir_flag_spec"; then
2383 if test -n "$hardcode_libdir_separator"; then
2384 if test -z "$hardcode_libdirs"; then
2385 hardcode_libdirs="$libdir"
2387 # Just accumulate the unique libdirs.
2388 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2389 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2392 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2397 eval flag=\"$hardcode_libdir_flag_spec\"
2398 rpath="$rpath $flag"
2400 elif test -n "$runpath_var"; then
2401 case "$perm_rpath " in
2403 *) perm_rpath="$perm_rpath $libdir" ;;
2407 # Substitute the hardcoded libdirs into the rpath.
2408 if test -n "$hardcode_libdir_separator" &&
2409 test -n "$hardcode_libdirs"; then
2410 libdir="$hardcode_libdirs"
2411 eval rpath=\" $hardcode_libdir_flag_spec\"
2413 compile_rpath="$rpath"
2417 for libdir in $finalize_rpath; do
2418 if test -n "$hardcode_libdir_flag_spec"; then
2419 if test -n "$hardcode_libdir_separator"; then
2420 if test -z "$hardcode_libdirs"; then
2421 hardcode_libdirs="$libdir"
2423 # Just accumulate the unique libdirs.
2424 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2425 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2428 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2433 eval flag=\"$hardcode_libdir_flag_spec\"
2434 rpath="$rpath $flag"
2436 elif test -n "$runpath_var"; then
2437 case "$finalize_perm_rpath " in
2439 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
2443 # Substitute the hardcoded libdirs into the rpath.
2444 if test -n "$hardcode_libdir_separator" &&
2445 test -n "$hardcode_libdirs"; then
2446 libdir="$hardcode_libdirs"
2447 eval rpath=\" $hardcode_libdir_flag_spec\"
2449 finalize_rpath="$rpath"
2451 if test -z "$compile_rpath" -a -n "$hardcode_default_flag"; then
2452 eval compile_rpath=\" $hardcode_default_flag\"
2455 if test -z "$finalize_rpath" -a -n "$hardcode_default_flag"; then
2456 eval finalize_rpath=\" $hardcode_default_flag\"
2459 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2460 if test "X$output_objdir" = "X$output"; then
2461 output_objdir="$objdir"
2463 output_objdir="$output_objdir/$objdir"
2466 # Create the binary in the object directory, then wrap it.
2467 if test ! -d $output_objdir; then
2468 $show "$mkdir $output_objdir"
2469 $run $mkdir $output_objdir
2471 if test $status -ne 0 && test ! -d $output_objdir; then
2476 if test -n "$libobjs" && test "$build_old_libs" = yes; then
2477 # Transform all the library objects into standard objects.
2478 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2479 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2483 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2484 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2485 dlsyms="${outputname}S.c"
2487 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
2491 if test -n "$dlsyms"; then
2495 # Discover the nlist of each of the dlfiles.
2496 nlist="$output_objdir/${outputname}.nm"
2498 $show "$rm $nlist ${nlist}S ${nlist}T"
2499 $run $rm "$nlist" "${nlist}S" "${nlist}T"
2501 # Parse the name list into a source file.
2502 $show "creating $output_objdir/$dlsyms"
2504 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
2505 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
2506 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
2512 /* Prevent the only kind of declaration conflicts we can make. */
2513 #define lt_preloaded_symbols some_other_symbol
2515 /* External symbol declarations for the compiler. */\
2518 if test "$dlself" = yes; then
2519 $show "generating symbol list for \`$output'"
2521 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
2523 # Add our own program objects to the symbol list.
2524 progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2525 for arg in $progfiles; do
2526 $show "extracting global C symbols from \`$arg'"
2527 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2530 if test -n "$exclude_expsyms"; then
2531 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2532 $run eval '$mv "$nlist"T "$nlist"'
2535 if test -n "$export_symbols_regex"; then
2536 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2537 $run eval '$mv "$nlist"T "$nlist"'
2540 # Prepare the list of exported symbols
2541 if test -z "$export_symbols"; then
2542 export_symbols="$output_objdir/$output.exp"
2543 $run $rm $export_symbols
2544 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2546 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
2547 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
2548 $run eval 'mv "$nlist"T "$nlist"'
2552 # Prepare the list of exported symbols
2553 if test -z "$export_symbols"; then
2554 if test "$always_export_symbols" = yes -a -n "$link_export_all"; then
2555 eval link_export=\"$link_export_all\"
2556 elif test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2557 $show "generating symbol list for \`$output'"
2558 export_symbols="$output_objdir/$output.exp"
2559 $run $rm $export_symbols
2561 eval cmds=\"$export_symbols_cmds\"
2562 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2563 for cmd in $cmds; do
2566 $run eval "$cmd" || exit $?
2569 if test -n "$export_symbols_regex"; then
2570 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2571 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2572 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2573 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2578 for arg in $dlprefiles; do
2579 $show "extracting global C symbols from \`$arg'"
2580 name=`echo "$arg" | sed -e 's%^.*/%%'`
2581 $run eval 'echo ": $name " >> "$nlist"'
2582 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2585 if test -z "$run"; then
2586 # Make sure we have at least an empty file.
2587 test -f "$nlist" || : > "$nlist"
2589 if test -n "$exclude_expsyms"; then
2590 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2591 $mv "$nlist"T "$nlist"
2594 # Try sorting and uniquifying the output.
2595 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
2598 grep -v "^: " < "$nlist" > "$nlist"S
2601 if test -f "$nlist"S; then
2602 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
2604 echo '/* NONE */' >> "$output_objdir/$dlsyms"
2607 $echo >> "$output_objdir/$dlsyms" "\
2609 #undef lt_preloaded_symbols
2611 #if defined (__STDC__) && __STDC__
2612 # define lt_ptr_t void *
2614 # define lt_ptr_t char *
2618 /* The mapping between symbol names and symbols. */
2623 lt_preloaded_symbols[] =
2627 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
2628 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
2629 < "$nlist" >> "$output_objdir/$dlsyms"
2631 $echo >> "$output_objdir/$dlsyms" "\
2635 /* This works around a problem in FreeBSD linker */
2636 #ifdef FREEBSD_WORKAROUND
2637 static const void *lt_preloaded_setup() {
2638 return lt_preloaded_symbols;
2648 pic_flag_for_symtable=
2650 # compiling the symbol table file with pic_flag works around
2651 # a FreeBSD bug that causes programs to crash when -lm is
2652 # linked before any other PIC object. But we must not use
2653 # pic_flag when linking with -static. The problem exists in
2654 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2655 *-*-freebsd2*|*-*-freebsd3.0*)
2656 case "$compile_command " in
2658 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
2662 # Now compile the dynamic symbol file.
2663 $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
2664 $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
2666 # Clean up the generated files.
2667 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
2668 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
2670 # Transform the symbol file into the correct name.
2671 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2672 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2675 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
2680 # We keep going just in case the user didn't refer to
2681 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2682 # really was required.
2684 # Nullify the symbol file.
2685 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2686 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2690 if test -n "$export_symbols" -o -n "$dlsyms"; then
2691 eval link_export_opt=\"$link_export\"
2694 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
2695 # Replace the output file specification.
2696 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
2697 link_command="$compile_command$compile_rpath$link_export_opt"
2699 # We have no uninstalled library dependencies, so finalize right now.
2700 $show "$link_command"
2701 $run eval "$link_command"
2704 # Delete the generated files.
2705 if test -n "$dlsyms"; then
2706 $show "$rm $output_objdir/${outputname}S.${objext}"
2707 $run $rm "$output_objdir/${outputname}S.${objext}"
2713 if test -n "$shlibpath_var"; then
2714 # We should set the shlibpath_var
2716 for dir in $temp_rpath; do
2718 [\\/]* | [A-Za-z]:[\\/]*)
2723 # Relative path: add a thisdir entry.
2724 rpath="$rpath\$thisdir/$dir:"
2731 if test -n "$compile_shlibpath$finalize_shlibpath"; then
2732 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
2734 if test -n "$finalize_shlibpath"; then
2735 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
2740 if test -n "$runpath_var"; then
2741 if test -n "$perm_rpath"; then
2742 # We should set the runpath_var.
2744 for dir in $perm_rpath; do
2747 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
2749 if test -n "$finalize_perm_rpath"; then
2750 # We should set the runpath_var.
2752 for dir in $finalize_perm_rpath; do
2755 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
2759 if test "$hardcode_action" = relink; then
2760 # Fast installation is not supported
2761 link_command="$compile_var$compile_command$compile_rpath"
2762 relink_command="$finalize_var$finalize_command$finalize_rpath"
2764 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
2765 $echo "$modename: \`$output' will be relinked during installation" 1>&2
2767 if test "$fast_install" != no; then
2768 link_command="$finalize_var$compile_command$finalize_rpath"
2769 if test "$fast_install" = yes; then
2770 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
2772 # fast_install is set to needless
2776 link_command="$compile_var$compile_command$compile_rpath"
2777 relink_command="$finalize_var$finalize_command$finalize_rpath"
2781 # Replace the output file specification.
2782 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
2784 link_command="$link_command$link_export_opt"
2786 # Delete the old output files.
2787 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
2789 $show "$link_command"
2790 $run eval "$link_command" || exit $?
2792 # Now create the wrapper script.
2793 $show "creating $output"
2795 # Quote the relink command for shipping.
2796 if test -n "$relink_command"; then
2797 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
2800 # Quote $echo for shipping.
2801 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
2803 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
2804 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
2806 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
2808 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
2811 # Only actually do things if our run command is non-null.
2812 if test -z "$run"; then
2813 # win32 will think the script is a binary if it has
2814 # a .exe suffix, so we strip it off here.
2816 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
2819 trap "$rm $output; exit 1" 1 2 15
2824 # $output - temporary wrapper script for $objdir/$outputname
2825 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
2827 # The $output program cannot be directly executed until all the libtool
2828 # libraries that it depends on are installed.
2830 # This wrapper script should never be moved out of the build directory.
2831 # If it is, it will not operate correctly.
2833 # Sed substitution that helps us do robust quoting. It backslashifies
2834 # metacharacters that are still active within double-quoted strings.
2835 Xsed='sed -e 1s/^X//'
2836 sed_quote_subst='$sed_quote_subst'
2838 # The HP-UX ksh and POSIX shell print the target directory to stdout
2840 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
2842 relink_command=\"$relink_command\"
2844 # This environment variable determines our operation mode.
2845 if test \"\$libtool_install_magic\" = \"$magic\"; then
2846 # install mode needs the following variable:
2847 link_against_libtool_libs='$link_against_libtool_libs'
2849 # When we are sourced in execute mode, \$file and \$echo are already set.
2850 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2853 # Make sure echo works.
2854 if test \"X\$1\" = X--no-reexec; then
2855 # Discard the --no-reexec flag, and continue.
2857 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
2858 # Yippee, \$echo works!
2861 # Restart under the correct shell, and then maybe \$echo will work.
2862 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2868 # Find the directory that this script lives in.
2869 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2870 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2872 # Follow symbolic links until we get to the real thisdir.
2873 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
2874 while test -n \"\$file\"; do
2875 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2877 # If there was a directory component, then change thisdir.
2878 if test \"x\$destdir\" != \"x\$file\"; then
2879 case \"\$destdir\" in
2880 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
2881 *) thisdir=\"\$thisdir/\$destdir\" ;;
2885 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2886 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
2889 # Try to get the absolute directory name.
2890 absdir=\`cd \"\$thisdir\" && pwd\`
2891 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2894 if test "$fast_install" = yes; then
2896 program=lt-'$outputname'
2897 progdir=\"\$thisdir/$objdir\"
2899 if test ! -f \"\$progdir/\$program\" || \\
2900 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
2901 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2903 file=\"\$\$-\$program\"
2905 if test ! -d \"\$progdir\"; then
2906 $mkdir \"\$progdir\"
2908 $rm \"\$progdir/\$file\"
2913 # relink executable if necessary
2914 if test -n \"\$relink_command\"; then
2915 if (cd \"\$thisdir\" && eval \$relink_command); then :
2917 $rm \"\$progdir/\$file\"
2922 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2923 { $rm \"\$progdir/\$program\";
2924 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2925 $rm \"\$progdir/\$file\"
2929 program='$outputname$exeext'
2930 progdir=\"\$thisdir/$objdir\"
2936 if test -f \"\$progdir/\$program\"; then"
2938 # Export our shlibpath_var if we have one.
2939 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2941 # Add our own library path to $shlibpath_var
2942 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2944 # Some systems cannot cope with colon-terminated $shlibpath_var
2945 # The second colon is a workaround for a bug in BeOS R4 sed
2946 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2948 export $shlibpath_var
2952 # fixup the dll searchpath if we need to.
2953 if test -n "$dllsearchpath"; then
2955 # Add the dll search path components to the executable PATH
2956 PATH=$dllsearchpath:\$PATH
2961 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2962 # Run the actual program with our arguments.
2965 *-*-cygwin* | *-*-mingw* | *-*-os2*)
2966 # win32 systems need to use the prog path for dll
2969 exec \$progdir\\\\\$program \${1+\"\$@\"}
2974 # Export the path to the program.
2975 PATH=\"\$progdir:\$PATH\"
2978 exec \$program \${1+\"\$@\"}
2983 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
2987 # The program doesn't exist.
2988 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
2989 \$echo \"This script is just a wrapper for \$program.\" 1>&2
2990 echo \"See the $PACKAGE documentation for more information.\" 1>&2
3001 # See if we need to build an old-fashioned archive.
3002 for oldlib in $oldlibs; do
3004 if test "$build_libtool_libs" = convenience; then
3005 oldobjs="$libobjs_save"
3006 addlibs="$convenience"
3007 build_libtool_libs=no
3009 if test "$build_libtool_libs" = module; then
3010 oldobjs="$libobjs_save"
3011 build_libtool_libs=no
3013 oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3015 addlibs="$old_convenience"
3018 if test -n "$addlibs"; then
3019 gentop="$output_objdir/${outputname}x"
3020 $show "${rm}r $gentop"
3021 $run ${rm}r "$gentop"
3022 $show "mkdir $gentop"
3023 $run mkdir "$gentop"
3025 if test $status -ne 0 && test ! -d "$gentop"; then
3028 generated="$generated $gentop"
3030 # Add in members from convenience archives.
3031 for xlib in $addlibs; do
3032 # Extract the objects.
3034 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3035 *) xabs=`pwd`"/$xlib" ;;
3037 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3038 xdir="$gentop/$xlib"
3040 $show "${rm}r $xdir"
3045 if test $status -ne 0 && test ! -d "$xdir"; then
3048 $show "(cd $xdir && $AR x $xabs)"
3049 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3051 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3055 # Do each command in the archive commands.
3056 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3057 eval cmds=\"$old_archive_from_new_cmds\"
3059 # Ensure that we have .o objects in place incase we decided
3060 # not to build a shared library, and have fallen back to building
3061 # static libs even though --disable-static was passed!
3062 for oldobj in $oldobjs; do
3063 if test ! -f $oldobj; then
3064 obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
3065 $show "${LN_S} $obj $oldobj"
3066 $run ${LN_S} $obj $oldobj || exit $?
3070 eval cmds=\"$old_archive_cmds\"
3072 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3073 for cmd in $cmds; do
3076 $run eval "$cmd" || exit $?
3081 if test -n "$generated"; then
3082 $show "${rm}r$generated"
3083 $run ${rm}r$generated
3086 # Now create the libtool archive.
3090 test "$build_old_libs" = yes && old_library="$libname.$libext"
3091 $show "creating $output"
3093 if test -n "$xrpath"; then
3095 for libdir in $xrpath; do
3096 temp_xrpath="$temp_xrpath -R$libdir"
3098 dependency_libs="$temp_xrpath $dependency_libs"
3101 # Only create the output if not a dry run.
3102 if test -z "$run"; then
3103 for installed in no yes; do
3104 if test "$installed" = yes; then
3105 if test -z "$install_libdir"; then
3108 output="$output_objdir/$outputname"i
3112 # $outputname - a libtool library file
3113 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3115 # Please DO NOT delete this file!
3116 # It is necessary for linking the library.
3118 # The name that we can dlopen(3).
3121 # Names of this library.
3122 library_names='$library_names'
3124 # The name of the static archive.
3125 old_library='$old_library'
3127 # Libraries that this one depends upon.
3128 dependency_libs='$dependency_libs'
3130 # Version information for $libname.
3135 # Is this an already installed library?
3136 installed=$installed
3138 # Directory that this library needs to be installed in:
3139 libdir='$install_libdir'\
3144 # Do a symbolic link so that the libtool archive can be found in
3145 # LD_LIBRARY_PATH before the program is installed.
3146 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3147 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
3153 # libtool install mode
3155 modename="$modename: install"
3157 # There may be an optional sh(1) argument at the beginning of
3158 # install_prog (especially on Windows NT).
3159 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
3160 # Aesthetically quote it.
3161 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3163 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3167 install_prog="$arg "
3175 # The real first argument should be the name of the installation program.
3176 # Aesthetically quote it.
3177 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3179 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3183 install_prog="$install_prog$arg"
3185 # We need to accept at least all the BSD install flags.
3195 if test -n "$dest"; then
3196 files="$files $dest"
3214 # If the previous option needed an argument, then skip it.
3215 if test -n "$prev"; then
3224 # Aesthetically quote the argument.
3225 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3227 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3231 install_prog="$install_prog $arg"
3234 if test -z "$install_prog"; then
3235 $echo "$modename: you must specify an install program" 1>&2
3240 if test -n "$prev"; then
3241 $echo "$modename: the \`$prev' option requires an argument" 1>&2
3246 if test -z "$files"; then
3247 if test -z "$dest"; then
3248 $echo "$modename: no file or destination specified" 1>&2
3250 $echo "$modename: you must specify a destination" 1>&2
3256 # Strip any trailing slash from the destination.
3257 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3259 # Check to see that the destination is a directory.
3260 test -d "$dest" && isdir=yes
3261 if test "$isdir" = yes; then
3265 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3266 test "X$destdir" = "X$dest" && destdir=.
3267 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3269 # Not a directory, so check to see that there is only one file specified.
3271 if test $# -gt 2; then
3272 $echo "$modename: \`$dest' is not a directory" 1>&2
3278 [\\/]* | [A-Za-z]:[\\/]*) ;;
3280 for file in $files; do
3284 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3293 # This variable tells wrapper scripts just to set variables rather
3294 # than running their programs.
3295 libtool_install_magic="$magic"
3300 for file in $files; do
3302 # Do each installation.
3305 # Do the static libraries later.
3306 staticlibs="$staticlibs $file"
3310 # Check to see that this really is a libtool archive.
3311 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3313 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3320 # If there is no directory component, then add one.
3322 */* | *\\*) . $file ;;
3326 # Add the libdir to current_libdirs if it is the destination.
3327 if test "X$destdir" = "X$libdir"; then
3328 case "$current_libdirs " in
3330 *) current_libdirs="$current_libdirs $libdir" ;;
3333 # Note the libdir as a future libdir.
3334 case "$future_libdirs " in
3336 *) future_libdirs="$future_libdirs $libdir" ;;
3340 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
3341 test "X$dir" = "X$file/" && dir=
3344 # See the names of the shared library.
3345 set dummy $library_names
3346 if test -n "$2"; then
3351 # Install the shared library and build the symlinks.
3352 $show "$install_prog $dir/$realname $destdir/$realname"
3353 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
3355 # Windows does not have any symlinks to DLLs, despite what
3356 # library_names has been set to.
3359 *-*-cygwin* | *-*-mingw*) skip_syms=true ;;
3362 if test "$skip_syms" = "false" && test $# -gt 0; then
3363 # Delete the old symlinks, and create new ones.
3366 if test "$linkname" != "$realname"; then
3367 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3368 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3373 # Do each command in the postinstall commands.
3374 lib="$destdir/$realname"
3375 eval cmds=\"$postinstall_cmds\"
3376 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3377 for cmd in $cmds; do
3380 $run eval "$cmd" || exit $?
3385 # Install the pseudo-library for information purposes.
3386 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3387 instname="$dir/$name"i
3388 $show "$install_prog $instname $destdir/$name"
3389 $run eval "$install_prog $instname $destdir/$name" || exit $?
3391 # Maybe install the static library, too.
3392 test -n "$old_library" -a $build_old_libs = yes && staticlibs="$staticlibs $dir/$old_library"
3396 # Install (i.e. copy) a libtool object.
3398 # Figure out destination file name, if it wasn't already specified.
3399 if test -n "$destname"; then
3400 destfile="$destdir/$destname"
3402 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3403 destfile="$destdir/$destfile"
3406 # Deduce the name of the destination old-style object file.
3409 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
3412 staticdest="$destfile"
3416 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
3422 # Install the libtool object if requested.
3423 if test -n "$destfile"; then
3424 $show "$install_prog $file $destfile"
3425 $run eval "$install_prog $file $destfile" || exit $?
3428 # Install the old object if enabled.
3429 if test "$build_old_libs" = yes; then
3430 # Deduce the name of the old-style object file.
3431 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
3433 $show "$install_prog $staticobj $staticdest"
3434 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
3440 # Figure out destination file name, if it wasn't already specified.
3441 if test -n "$destname"; then
3442 destfile="$destdir/$destname"
3444 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3445 destfile="$destdir/$destfile"
3448 # Do a test to see if this is really a libtool program.
3449 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3450 link_against_libtool_libs=
3453 # If there is no directory component, then add one.
3455 */* | *\\*) . $file ;;
3459 # Check the variables that should have been set.
3460 if test -z "$link_against_libtool_libs"; then
3461 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
3466 for lib in $link_against_libtool_libs; do
3467 # Check to see that each library is installed.
3469 if test -f "$lib"; then
3470 # If there is no directory component, then add one.
3472 */* | *\\*) . $lib ;;
3476 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
3477 if test -n "$libdir" && test ! -f "$libfile"; then
3478 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
3484 if test "$fast_install" = no && test -n "$relink_command"; then
3485 if test "$finalize" = yes && test -z "$run"; then
3487 test -n "$TMPDIR" && tmpdir="$TMPDIR"
3488 tmpdir="$tmpdir/libtool-$$"
3489 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
3491 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
3494 outputname="$tmpdir/$file"
3495 # Replace the output file specification.
3496 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
3498 $show "$relink_command"
3499 if $run eval "$relink_command"; then :
3501 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
3507 $echo "$modename: warning: cannot relink \`$file'" 1>&2
3510 # Install the binary that we compiled earlier.
3511 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
3515 $show "$install_prog$stripme $file $destfile"
3516 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
3517 test -n "$outputname" && ${rm}r "$tmpdir"
3522 for file in $staticlibs; do
3523 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3525 # Set up the ranlib parameters.
3526 oldlib="$destdir/$name"
3528 $show "$install_prog $file $oldlib"
3529 $run eval "$install_prog \$file \$oldlib" || exit $?
3531 # Do each command in the postinstall commands.
3532 eval cmds=\"$old_postinstall_cmds\"
3533 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3534 for cmd in $cmds; do
3537 $run eval "$cmd" || exit $?
3542 if test -n "$future_libdirs"; then
3543 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
3546 if test -n "$current_libdirs"; then
3547 # Maybe just do a dry run.
3548 test -n "$run" && current_libdirs=" -n$current_libdirs"
3549 exec $SHELL $0 --finish$current_libdirs
3556 # libtool finish mode
3558 modename="$modename: finish"
3562 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3565 libdirs="$libdirs $dir"
3568 for libdir in $libdirs; do
3569 if test -n "$finish_cmds"; then
3570 # Do each command in the finish commands.
3571 eval cmds=\"$finish_cmds\"
3572 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3573 for cmd in $cmds; do
3576 $run eval "$cmd" || admincmds="$admincmds
3581 if test -n "$finish_eval"; then
3582 # Do the single finish_eval.
3583 eval cmds=\"$finish_eval\"
3584 $run eval "$cmds" || admincmds="$admincmds
3590 # Exit here if they wanted silent mode.
3591 test "$show" = : && exit 0
3593 echo "----------------------------------------------------------------------"
3594 echo "Libraries have been installed in:"
3595 for libdir in $libdirs; do
3599 echo "If you ever happen to want to link against installed libraries"
3600 echo "in a given directory, LIBDIR, you must either use libtool, and"
3601 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
3602 echo "flag during linking and do at least one of the following:"
3603 if test -n "$shlibpath_var"; then
3604 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3605 echo " during execution"
3607 if test -n "$runpath_var"; then
3608 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3609 echo " during linking"
3611 if test -n "$hardcode_libdir_flag_spec"; then
3613 eval flag=\"$hardcode_libdir_flag_spec\"
3615 echo " - use the \`$flag' linker flag"
3617 if test -n "$admincmds"; then
3618 echo " - have your system administrator run these commands:$admincmds"
3620 if test -f /etc/ld.so.conf; then
3621 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3624 echo "See any operating system documentation about shared libraries for"
3625 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3626 echo "----------------------------------------------------------------------"
3630 # libtool execute mode
3632 modename="$modename: execute"
3634 # The first argument is the command name.
3636 if test -z "$cmd"; then
3637 $echo "$modename: you must specify a COMMAND" 1>&2
3642 # Handle -dlopen flags immediately.
3643 for file in $execute_dlfiles; do
3644 if test ! -f "$file"; then
3645 $echo "$modename: \`$file' is not a file" 1>&2
3653 # Check to see that this really is a libtool archive.
3654 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3656 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3661 # Read the libtool library.
3665 # If there is no directory component, then add one.
3667 */* | *\\*) . $file ;;
3671 # Skip this library if it cannot be dlopened.
3672 if test -z "$dlname"; then
3673 # Warn if it was a shared library.
3674 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
3678 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3679 test "X$dir" = "X$file" && dir=.
3681 if test -f "$dir/$objdir/$dlname"; then
3684 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
3690 # Just add the directory containing the .lo file.
3691 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3692 test "X$dir" = "X$file" && dir=.
3696 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
3701 # Get the absolute pathname.
3702 absdir=`cd "$dir" && pwd`
3703 test -n "$absdir" && dir="$absdir"
3705 # Now add the directory to shlibpath_var.
3706 if eval "test -z \"\$$shlibpath_var\""; then
3707 eval "$shlibpath_var=\"\$dir\""
3709 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3713 # This variable tells wrapper scripts just to set shlibpath_var
3714 # rather than running their programs.
3715 libtool_execute_magic="$magic"
3717 # Check if any of the arguments is a wrapper script.
3724 # Do a test to see if this is really a libtool program.
3725 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3726 # If there is no directory component, then add one.
3728 */* | *\\*) . $file ;;
3732 # Transform arg to wrapped name.
3733 file="$progdir/$program"
3737 # Quote arguments (to preserve shell metacharacters).
3738 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
3739 args="$args \"$file\""
3742 if test -z "$run"; then
3743 # Export the shlibpath_var.
3744 eval "export $shlibpath_var"
3746 # Restore saved enviroment variables
3747 if test "${save_LC_ALL+set}" = set; then
3748 LC_ALL="$save_LC_ALL"; export LC_ALL
3750 if test "${save_LANG+set}" = set; then
3751 LANG="$save_LANG"; export LANG
3754 # Now actually exec the command.
3755 eval "exec \$cmd$args"
3757 $echo "$modename: cannot exec \$cmd$args"
3760 # Display what would be done.
3761 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
3762 $echo "export $shlibpath_var"
3768 # libtool uninstall mode
3770 modename="$modename: uninstall"
3777 -*) rm="$rm $arg" ;;
3778 *) files="$files $arg" ;;
3782 if test -z "$rm"; then
3783 $echo "$modename: you must specify an RM program" 1>&2
3788 for file in $files; do
3789 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3790 test "X$dir" = "X$file" && dir=.
3791 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3797 # Possibly a libtool archive, so verify it.
3798 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3801 # Delete the libtool libraries and symlinks.
3802 for n in $library_names; do
3803 rmfiles="$rmfiles $dir/$n"
3805 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
3807 $show "$rm $rmfiles"
3810 if test -n "$library_names"; then
3811 # Do each command in the postuninstall commands.
3812 eval cmds=\"$postuninstall_cmds\"
3813 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3814 for cmd in $cmds; do
3822 if test -n "$old_library"; then
3823 # Do each command in the old_postuninstall commands.
3824 eval cmds=\"$old_postuninstall_cmds\"
3825 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3826 for cmd in $cmds; do
3834 # FIXME: should reinstall the best remaining shared library.
3839 if test "$build_old_libs" = yes; then
3840 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
3841 rmfiles="$rmfiles $dir/$oldobj"
3843 $show "$rm $rmfiles"
3848 $show "$rm $rmfiles"
3857 $echo "$modename: you must specify a MODE" 1>&2
3858 $echo "$generic_help" 1>&2
3863 $echo "$modename: invalid operation mode \`$mode'" 1>&2
3864 $echo "$generic_help" 1>&2
3866 fi # test -z "$show_help"
3868 # We need to display help for each of the modes.
3871 "Usage: $modename [OPTION]... [MODE-ARG]...
3873 Provide generalized library-building support services.
3875 --config show all configuration variables
3876 --debug enable verbose shell tracing
3877 -n, --dry-run display commands without modifying any files
3878 --features display basic configuration information and exit
3879 --finish same as \`--mode=finish'
3880 --help display this help message and exit
3881 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
3882 --quiet same as \`--silent'
3883 --silent don't print informational messages
3884 --version print version information
3886 MODE must be one of the following:
3888 compile compile a source file into a libtool object
3889 execute automatically set library path, then run a program
3890 finish complete the installation of libtool libraries
3891 install install libraries or executables
3892 link create a library or an executable
3893 uninstall remove libraries from an installed directory
3895 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
3896 a more detailed description of MODE."
3902 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
3904 Compile a source file into a libtool library object.
3906 This mode accepts the following additional options:
3908 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
3909 -static always build a \`.o' file suitable for static linking
3911 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
3912 from the given SOURCEFILE.
3914 The output file name is determined by removing the directory component from
3915 SOURCEFILE, then substituting the C source code suffix \`.c' with the
3916 library object suffix, \`.lo'."
3921 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
3923 Automatically set library path, then run a program.
3925 This mode accepts the following additional options:
3927 -dlopen FILE add the directory containing FILE to the library path
3929 This mode sets the library path environment variable according to \`-dlopen'
3932 If any of the ARGS are libtool executable wrappers, then they are translated
3933 into their corresponding uninstalled binary, and any of their required library
3934 directories are added to the library path.
3936 Then, COMMAND is executed, with ARGS as arguments."
3941 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
3943 Complete the installation of libtool libraries.
3945 Each LIBDIR is a directory that contains libtool libraries.
3947 The commands that this mode executes may require superuser privileges. Use
3948 the \`--dry-run' option if you just want to see what would be executed."
3953 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
3955 Install executables or libraries.
3957 INSTALL-COMMAND is the installation command. The first component should be
3958 either the \`install' or \`cp' program.
3960 The rest of the components are interpreted as arguments to that command (only
3961 BSD-compatible install options are recognized)."
3966 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
3968 Link object files or libraries together to form another library, or to
3969 create an executable program.
3971 LINK-COMMAND is a command using the C compiler that you would use to create
3972 a program from several object files.
3974 The following components of LINK-COMMAND are treated specially:
3976 -all-static do not do any dynamic linking at all
3977 -avoid-version do not add a version suffix if possible
3978 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
3979 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
3980 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3981 -export-symbols SYMFILE
3982 try to export only the symbols listed in SYMFILE
3983 -export-symbols-regex REGEX
3984 try to export only the symbols matching REGEX
3985 -LLIBDIR search LIBDIR for required installed libraries
3986 -lNAME OUTPUT-FILE requires the installed library libNAME
3987 -module build a library that can dlopened
3988 -no-undefined declare that a library does not refer to external symbols
3989 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
3990 -release RELEASE specify package release information
3991 -rpath LIBDIR the created library will eventually be installed in LIBDIR
3992 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
3993 -static do not do any dynamic linking of libtool libraries
3994 -version-info CURRENT[:REVISION[:AGE]]
3995 specify library version info [each variable defaults to 0]
3997 All other options (arguments beginning with \`-') are ignored.
3999 Every other argument is treated as a filename. Files ending in \`.la' are
4000 treated as uninstalled libtool libraries, other files are standard or library
4003 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4004 only library objects (\`.lo' files) may be specified, and \`-rpath' is
4005 required, except when creating a convenience library.
4007 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4008 using \`ar' and \`ranlib', or on Windows using \`lib'.
4010 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4011 is created, otherwise an executable program is created."
4016 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4018 Remove libraries from an installation directory.
4020 RM is the name of the program to use to delete files associated with each FILE
4021 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4024 If FILE is a libtool library, all the files associated with it are deleted.
4025 Otherwise, only FILE itself is deleted using RM."
4029 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4036 $echo "Try \`$modename --help' for more information about other modes."