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-2013 CEA/DEN, EDF R&D, OPEN CASCADE
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # Check that we have a working $echo.
24 if test "X$1" = X--no-reexec; then
25 # Discard the --no-reexec flag, and continue.
27 elif test "X$1" = X--fallback-echo; then
28 # Avoid inline document here, it may be left over
30 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
31 # Yippee, $echo works!
34 # Restart under the correct shell, and then maybe $echo will work.
35 exec $SHELL "$0" --no-reexec ${1+"$@"}
38 if test "X$1" = X--fallback-echo; then
39 # used as fallback echo
47 # The name of this program.
48 progname=`$echo "$0" | sed 's%^.*/%%'`
55 TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)"
58 help="Try \`$progname --help' for more information."
59 magic="%%%MAGIC variable%%%"
64 # Sed substitution that helps us do robust quoting. It backslashifies
65 # metacharacters that are still active within double-quoted strings.
67 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
69 NL2SP='tr \015\012 \040\040'
72 # Only set LANG and LC_ALL to C if already set.
73 # These must not be set unconditionally because not all systems understand
74 # e.g. LANG=C (notably SCO).
75 # We save the old values to restore during execute mode.
76 if test "${LC_ALL+set}" = set; then
77 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
79 if test "${LANG+set}" = set; then
80 save_LANG="$LANG"; LANG=C; export LANG
83 if test "$LTCONFIG_VERSION" != "$VERSION"; then
84 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
85 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
89 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
90 echo "$modename: not configured to build any kind of library" 1>&2
91 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
104 lo2o="s/\\.lo\$/.${objext}/"
105 o2lo="s/\\.${objext}\$/.lo/"
107 # Parse our command line options once, thoroughly.
114 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
118 # If the previous option needs an argument, assign it.
119 if test -n "$prev"; then
122 eval "$prev=\"\$$prev \$arg\""
134 # Have we seen a non-optional argument yet?
141 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
146 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
151 echo "$progname: enabling shell trace mode"
161 if test "$build_libtool_libs" = yes; then
162 echo "enable shared libraries"
164 echo "disable shared libraries"
166 if test "$build_old_libs" = yes; then
167 echo "enable static libraries"
169 echo "disable static libraries"
174 --finish) mode="finish" ;;
176 --mode) prevopt="--mode" prev=mode ;;
177 --mode=*) mode="$optarg" ;;
189 $echo "$modename: unrecognized option \`$arg'" 1>&2
201 if test -n "$prevopt"; then
202 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
207 if test -z "$show_help"; then
209 # Infer the operation mode.
210 if test -z "$mode"; then
212 *cc | *++ | gcc* | *-gcc*)
224 *db | *dbx | *strace | *truss)
234 # If we have no mode, but dlfiles were specified, then do execute mode.
235 test -n "$execute_dlfiles" && mode=execute
237 # Just use the default operation mode.
238 if test -z "$mode"; then
239 if test -n "$nonopt"; then
240 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
242 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
249 # Only execute mode is allowed to have -dlopen flags.
250 if test -n "$execute_dlfiles" && test "$mode" != execute; then
251 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
256 # Change the help message to a mode-specific one.
258 help="Try \`$modename --help --mode=$mode' for more information."
260 # These modes are in order of execution frequency so that they run quickly.
262 # libtool compile mode
264 modename="$modename: compile"
265 # Get the compilation command and the source file.
274 # Accept any command-line options.
277 if test "$user_target" != "no"; then
278 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
290 case "$user_target" in
292 # The next one is the -o target name
297 # We got the output file
304 # Accept the current argument as the source file.
308 # Aesthetically quote the previous argument.
310 # Backslashify any backslashes, double quotes, and dollar signs.
311 # These are the only characters that are still specially
312 # interpreted inside of double-quoted scrings.
313 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
315 # Double-quote args containing other shell metacharacters.
316 # Many Bourne shells cannot handle close brackets correctly in scan
317 # sets, so we specify it separately.
319 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
320 lastarg="\"$lastarg\""
324 # Add the previous argument to base_compile.
325 if test -z "$base_compile"; then
326 base_compile="$lastarg"
328 base_compile="$base_compile $lastarg"
332 case "$user_target" in
336 # Get the name of the library object.
337 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
340 $echo "$modename: you must specify a target with \`-o'" 1>&2
345 # Recognize several different file suffixes.
346 # If the user specifies -o file.o, it is replaced with file.lo
361 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
364 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
366 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
371 if test -z "$base_compile"; then
372 $echo "$modename: you must specify a compilation command" 1>&2
377 # Delete any leftover library objects.
378 if test "$build_old_libs" = yes; then
379 removelist="$obj $libobj"
385 trap "$run $rm $removelist; exit 1" 1 2 15
387 # Calculate the filename of the output object if compiler does
388 # not support -o with -c
389 if test "$compiler_c_o" = no; then
390 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
391 lockfile="$output_obj.lock"
392 removelist="$removelist $output_obj $lockfile"
393 trap "$run $rm $removelist; exit 1" 1 2 15
399 # Lock this critical section if it is needed
400 # We use this script file to make the link, it avoids creating a new file
401 if test "$need_locks" = yes; then
402 until ln "$0" "$lockfile" 2>/dev/null; do
403 $show "Waiting for $lockfile to be removed"
406 elif test "$need_locks" = warn; then
407 if test -f "$lockfile"; then
409 *** ERROR, $lockfile exists and contains:
410 `cat $lockfile 2>/dev/null`
412 This indicates that another process is trying to use the same
413 temporary object file, and libtool could not work around it because
414 your compiler does not support \`-c' and \`-o' together. If you
415 repeat this compilation, it may succeed, by chance, but you had better
416 avoid parallel builds (make -j) in this platform, or get a better
422 echo $srcfile > "$lockfile"
425 if test -n "$fix_srcfile_path"; then
426 eval srcfile=\"$fix_srcfile_path\"
429 # Only build a PIC object if we are building libtool libraries.
430 if test "$build_libtool_libs" = yes; then
431 # Without this assignment, base_compile gets emptied.
432 fbsd_hideous_sh_bug=$base_compile
434 # All platforms use -DPIC, to notify preprocessed assembler code.
435 command="$base_compile $srcfile $pic_flag -DPIC"
436 if test "$build_old_libs" = yes; then
438 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
439 if test "X$dir" = "X$libobj"; then
444 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
446 if test -d "$dir"; then
453 if test $status -ne 0 && test ! -d $dir; then
458 if test "$compiler_o_lo" = yes; then
460 command="$command -o $output_obj"
461 elif test "$compiler_c_o" = yes; then
463 command="$command -o $output_obj"
466 $run $rm "$output_obj"
468 if $run eval "$command"; then :
470 test -n "$output_obj" && $run $rm $removelist
474 if test "$need_locks" = warn &&
475 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
477 *** ERROR, $lockfile contains:
478 `cat $lockfile 2>/dev/null`
480 but it should contain:
483 This indicates that another process is trying to use the same
484 temporary object file, and libtool could not work around it because
485 your compiler does not support \`-c' and \`-o' together. If you
486 repeat this compilation, it may succeed, by chance, but you had better
487 avoid parallel builds (make -j) in this platform, or get a better
494 # Just move the object if needed, then go on to compile the next one
495 if test x"$output_obj" != x"$libobj"; then
496 $show "$mv $output_obj $libobj"
497 if $run $mv $output_obj $libobj; then :
505 # If we have no pic_flag, then copy the object into place and finish.
506 if test -z "$pic_flag" && test "$build_old_libs" = yes; then
507 # Rename the .lo from within objdir to obj
508 if test -f $obj; then
513 $show "$mv $libobj $obj"
514 if $run $mv $libobj $obj; then :
521 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
522 if test "X$xdir" = "X$obj"; then
527 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
528 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
529 # Now arrange that obj and lo_libobj become the same file
530 $show "(cd $xdir && $LN_S $baseobj $libobj)"
531 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
540 # Allow error messages only from the first compilation.
541 suppress_output=' >/dev/null 2>&1'
544 # Only build a position-dependent object if we build old libraries.
545 if test "$build_old_libs" = yes; then
546 command="$base_compile $srcfile"
547 if test "$compiler_c_o" = yes; then
548 command="$command -o $obj"
552 # Suppress compiler output if we already did a PIC compilation.
553 command="$command$suppress_output"
554 $run $rm "$output_obj"
556 if $run eval "$command"; then :
562 if test "$need_locks" = warn &&
563 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
565 *** ERROR, $lockfile contains:
566 `cat $lockfile 2>/dev/null`
568 but it should contain:
571 This indicates that another process is trying to use the same
572 temporary object file, and libtool could not work around it because
573 your compiler does not support \`-c' and \`-o' together. If you
574 repeat this compilation, it may succeed, by chance, but you had better
575 avoid parallel builds (make -j) in this platform, or get a better
582 # Just move the object if needed
583 if test x"$output_obj" != x"$obj"; then
584 $show "$mv $output_obj $obj"
585 if $run $mv $output_obj $obj; then :
593 # Create an invalid libtool object if no PIC, so that we do not
594 # accidentally link it into a program.
595 if test "$build_libtool_libs" != yes; then
596 $show "echo timestamp > $libobj"
597 $run eval "echo timestamp > \$libobj" || exit $?
599 # Move the .lo from within objdir
600 $show "$mv $libobj $lo_libobj"
601 if $run $mv $libobj $lo_libobj; then :
610 # Unlock the critical section if it was locked
611 if test "$need_locks" != no; then
620 modename="$modename: link"
622 *-*-cygwin* | *-*-mingw* | *-*-os2*)
623 # It is impossible to link a dll without this setting, and
624 # we shouldn't force the makefile maintainer to figure out
625 # which system we are compiling for in order to pass an extra
626 # flag for every libtool invokation.
629 # FIXME: Unfortunately, there are problems with the above when trying
630 # to make a dll which has undefined symbols, in which case not
631 # even a static library is built. For now, we need to specify
632 # -no-undefined on the libtool link line when we can be certain
633 # that all symbols are satisfied, otherwise we get a static library.
636 # This is a source program that is used to create dlls on Windows
637 # Don't remove nor modify the starting and closing comments
638 # /* ltdll.c starts here */
639 # #define WIN32_LEAN_AND_MEAN
640 # #include <windows.h>
641 # #undef WIN32_LEAN_AND_MEAN
645 # # ifdef __CYGWIN32__
646 # # define __CYGWIN__ __CYGWIN32__
653 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
659 # #include <cygwin/cygwin_dll.h>
660 # DECLARE_CYGWIN_DLL( DllMain );
662 # HINSTANCE __hDllInstance_base;
665 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
667 # __hDllInstance_base = hInst;
670 # /* ltdll.c ends here */
671 # This is a source program that is used to create import libraries
672 # on Windows for dlls which lack them. Don't remove nor modify the
673 # starting and closing comments
674 # /* impgen.c starts here */
675 # /* Copyright (C) 1999 Free Software Foundation, Inc.
677 # This file is part of GNU libtool.
679 # This program is free software; you can redistribute it and/or modify
680 # it under the terms of the GNU General Public License as published by
681 # the Free Software Foundation; either version 2 of the License, or
682 # (at your option) any later version.
684 # This program is distributed in the hope that it will be useful,
685 # but WITHOUT ANY WARRANTY; without even the implied warranty of
686 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
687 # GNU General Public License for more details.
689 # You should have received a copy of the GNU General Public License
690 # along with this program; if not, write to the Free Software
691 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
694 # #include <stdio.h> /* for printf() */
695 # #include <unistd.h> /* for open(), lseek(), read() */
696 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
697 # #include <string.h> /* for strdup() */
699 # static unsigned int
700 # pe_get16 (fd, offset)
704 # unsigned char b[2];
705 # lseek (fd, offset, SEEK_SET);
707 # return b[0] + (b[1]<<8);
710 # static unsigned int
711 # pe_get32 (fd, offset)
715 # unsigned char b[4];
716 # lseek (fd, offset, SEEK_SET);
718 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
721 # static unsigned int
725 # unsigned char *b = ptr;
726 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
735 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
736 # unsigned long export_rva, export_size, nsections, secptr, expptr;
737 # unsigned long name_rvas, nexp;
738 # unsigned char *expdata, *erva;
739 # char *filename, *dll_name;
741 # filename = argv[1];
743 # dll = open(filename, O_RDONLY|O_BINARY);
747 # dll_name = filename;
749 # for (i=0; filename[i]; i++)
750 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
751 # dll_name = filename + i +1;
753 # pe_header_offset = pe_get32 (dll, 0x3c);
754 # opthdr_ofs = pe_header_offset + 4 + 20;
755 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
757 # if (num_entries < 1) /* no exports */
760 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
761 # export_size = pe_get32 (dll, opthdr_ofs + 100);
762 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
763 # secptr = (pe_header_offset + 4 + 20 +
764 # pe_get16 (dll, pe_header_offset + 4 + 16));
767 # for (i = 0; i < nsections; i++)
770 # unsigned long secptr1 = secptr + 40 * i;
771 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
772 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
773 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
774 # lseek(dll, secptr1, SEEK_SET);
775 # read(dll, sname, 8);
776 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
778 # expptr = fptr + (export_rva - vaddr);
779 # if (export_rva + export_size > vaddr + vsize)
780 # export_size = vsize - (export_rva - vaddr);
785 # expdata = (unsigned char*)malloc(export_size);
786 # lseek (dll, expptr, SEEK_SET);
787 # read (dll, expdata, export_size);
788 # erva = expdata - export_rva;
790 # nexp = pe_as32 (expdata+24);
791 # name_rvas = pe_as32 (expdata+32);
793 # printf ("EXPORTS\n");
794 # for (i = 0; i<nexp; i++)
796 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
797 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
802 # /* impgen.c ends here */
808 compile_command="$nonopt"
809 finalize_command="$nonopt"
820 if test -n "$shlibpath_var"; then
821 # get the directories listed in $shlibpath_var
822 eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
826 # now prepend the system-specific ones
827 eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
828 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
836 export_symbols_regex=
839 link_against_libtool_libs=
843 prefer_static_libs=no
855 # We need to know -static, to get the right output filenames.
859 -all-static | -static)
860 if test "X$arg" = "X-all-static"; then
861 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
862 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
864 if test -n "$link_static_flag"; then
865 dlopen_self=$dlopen_self_static
868 if test -z "$pic_flag" && test -n "$link_static_flag"; then
869 dlopen_self=$dlopen_self_static
872 build_libtool_libs=no
874 prefer_static_libs=yes
880 # See if our shared archives depend on static archives.
881 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
883 # Go through the arguments, transforming them on the way.
884 while test $# -gt 0; do
888 # If the previous option needs an argument, assign it.
889 if test -n "$prev"; then
892 compile_command="$compile_command @OUTPUT@"
893 finalize_command="$finalize_command @OUTPUT@"
899 if test "$preload" = no; then
900 # Add the symbol object into the linking commands.
901 compile_command="$compile_command @SYMFILE@"
902 finalize_command="$finalize_command @SYMFILE@"
906 *.la | *.lo) ;; # We handle these cases below.
908 if test "$dlself" = no; then
916 if test "$prev" = dlprefiles; then
918 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
928 if test "$prev" = dlfiles; then
929 dlfiles="$dlfiles $arg"
931 dlprefiles="$dlprefiles $arg"
938 export_symbols="$arg"
939 if test ! -f "$arg"; then
940 $echo "$modename: symbol file \`$arg' does not exist"
947 export_symbols_regex="$arg"
957 # We need an absolute path.
959 [\\/]* | [A-Za-z]:[\\/]*) ;;
961 $echo "$modename: only absolute run-paths are allowed" 1>&2
965 if test "$prev" = rpath; then
968 *) rpath="$rpath $arg" ;;
973 *) xrpath="$xrpath $arg" ;;
980 eval "$prev=\"\$arg\""
991 if test -n "$link_static_flag"; then
992 compile_command="$compile_command $link_static_flag"
993 finalize_command="$finalize_command $link_static_flag"
999 # FIXME: remove this flag sometime in the future.
1000 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1024 -export-symbols | -export-symbols-regex)
1025 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1026 $echo "$modename: not more than one -exported-symbols argument allowed"
1029 if test "X$arg" = "X-export-symbols"; then
1038 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1039 # We need an absolute path.
1041 [\\/]* | [A-Za-z]:[\\/]*) ;;
1043 absdir=`cd "$dir" && pwd`
1044 if test -z "$absdir"; then
1045 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1046 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1052 case " $deplibs " in
1054 *) deplibs="$deplibs $arg";;
1056 case " $lib_search_path " in
1058 *) lib_search_path="$lib_search_path $dir";;
1061 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1062 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1063 case ":$dllsearchpath:" in
1064 ::) dllsearchpath="$dllsearchdir";;
1065 *":$dllsearchdir:"*) ;;
1066 *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
1073 if test "$arg" = "-lc"; then
1075 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1076 # These systems don't actually have c library (as such)
1080 elif test "$arg" = "-lm"; then
1082 *-*-cygwin* | *-*-beos*)
1083 # These systems don't actually have math library (as such)
1088 deplibs="$deplibs $arg"
1119 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1120 # We need an absolute path.
1122 [\\/]* | [A-Za-z]:[\\/]*) ;;
1124 $echo "$modename: only absolute run-paths are allowed" 1>&2
1130 *) xrpath="$xrpath $dir" ;;
1136 # If we have no pic_flag, then this is the same as -all-static.
1137 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1138 compile_command="$compile_command $link_static_flag"
1139 finalize_command="$finalize_command $link_static_flag"
1154 # Some other compiler flag.
1156 # Unknown arguments in both finalize_command and compile_command need
1157 # to be aesthetically quoted because they are evaled later.
1158 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1160 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1166 *.o | *.obj | *.a | *.lib)
1167 # A standard object.
1173 if test "$prev" = dlfiles; then
1174 dlfiles="$dlfiles $arg"
1175 if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
1179 # If libtool objects are unsupported, then we need to preload.
1184 if test "$prev" = dlprefiles; then
1185 # Preload the old-style object.
1186 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1189 libobjs="$libobjs $arg"
1193 # A libtool-controlled library.
1200 # Check to see that this really is a libtool archive.
1201 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1203 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
1207 # If the library was installed with an old release of libtool,
1208 # it will not redefine variable installed.
1212 # If there is no directory component, then add one.
1214 */* | *\\*) . $arg ;;
1218 # Get the name of the library we link against.
1220 for l in $old_library $library_names; do
1224 if test -z "$linklib"; then
1225 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
1229 # Find the relevant object directory and library name.
1230 name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
1232 if test "X$installed" = Xyes; then
1235 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1236 if test "X$dir" = "X$arg"; then
1243 if test -n "$dependency_libs"; then
1244 # Extract -R and -L from dependency_libs
1246 for deplib in $dependency_libs; do
1248 -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1249 case " $rpath $xrpath " in
1250 *" $temp_xrpath "*) ;;
1251 *) xrpath="$xrpath $temp_xrpath";;
1253 -L*) case "$compile_command $temp_deplibs " in
1255 *) temp_deplibs="$temp_deplibs $deplib";;
1257 temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1258 case " $lib_search_path " in
1260 *) lib_search_path="$lib_search_path $temp_dir";;
1263 *) temp_deplibs="$temp_deplibs $deplib";;
1266 dependency_libs="$temp_deplibs"
1269 if test -z "$libdir"; then
1270 # It is a libtool convenience library, so add in its objects.
1271 convenience="$convenience $dir/$old_library"
1272 old_convenience="$old_convenience $dir/$old_library"
1273 deplibs="$deplibs$dependency_libs"
1274 compile_command="$compile_command $dir/$old_library$dependency_libs"
1275 finalize_command="$finalize_command $dir/$old_library$dependency_libs"
1279 # This library was specified with -dlopen.
1280 if test "$prev" = dlfiles; then
1281 dlfiles="$dlfiles $arg"
1282 if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
1283 # If there is no dlname, no dlopen support or we're linking statically,
1284 # we need to preload.
1287 # We should not create a dependency on this library, but we
1288 # may need any libraries it requires.
1289 compile_command="$compile_command$dependency_libs"
1290 finalize_command="$finalize_command$dependency_libs"
1296 # The library was specified with -dlpreopen.
1297 if test "$prev" = dlprefiles; then
1298 # Prefer using a static library (so that no silly _DYNAMIC symbols
1299 # are required to link).
1300 if test -n "$old_library"; then
1301 dlprefiles="$dlprefiles $dir/$old_library"
1303 dlprefiles="$dlprefiles $dir/$linklib"
1308 if test -n "$library_names" &&
1309 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1310 link_against_libtool_libs="$link_against_libtool_libs $arg"
1311 if test -n "$shlibpath_var"; then
1312 # Make sure the rpath contains only unique directories.
1313 case "$temp_rpath " in
1315 *) temp_rpath="$temp_rpath $dir" ;;
1319 # We need an absolute path.
1321 [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
1323 absdir=`cd "$dir" && pwd`
1324 if test -z "$absdir"; then
1325 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1326 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1332 # This is the magic to use -rpath.
1333 # Skip directories that are in the system default run-time
1334 # search path, unless they have been requested with -R.
1335 case " $sys_lib_dlsearch_path " in
1338 case "$compile_rpath " in
1340 *) compile_rpath="$compile_rpath $absdir"
1345 case " $sys_lib_dlsearch_path " in
1348 case "$finalize_rpath " in
1350 *) finalize_rpath="$finalize_rpath $libdir"
1356 case "$hardcode_action" in
1357 immediate | unsupported)
1358 if test "$hardcode_direct" = no; then
1359 compile_command="$compile_command $dir/$linklib"
1360 deplibs="$deplibs $dir/$linklib"
1362 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1363 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1364 if test -n "$dllsearchpath"; then
1365 dllsearchpath="$dllsearchpath:$dllsearchdir"
1367 dllsearchpath="$dllsearchdir"
1371 elif test "$hardcode_minus_L" = no; then
1374 compile_shlibpath="$compile_shlibpath$dir:"
1377 case "$compile_command " in
1379 *) compile_command="$compile_command -L$dir";;
1381 compile_command="$compile_command -l$name"
1382 deplibs="$deplibs -L$dir -l$name"
1383 elif test "$hardcode_shlibpath_var" = no; then
1384 case ":$compile_shlibpath:" in
1386 *) compile_shlibpath="$compile_shlibpath$dir:";;
1388 compile_command="$compile_command -l$name"
1389 deplibs="$deplibs -l$name"
1396 if test "$hardcode_direct" = yes; then
1397 compile_command="$compile_command $absdir/$linklib"
1398 deplibs="$deplibs $absdir/$linklib"
1399 elif test "$hardcode_minus_L" = yes; then
1400 case "$compile_command " in
1402 *) compile_command="$compile_command -L$absdir";;
1404 compile_command="$compile_command -l$name"
1405 deplibs="$deplibs -L$absdir -l$name"
1406 elif test "$hardcode_shlibpath_var" = yes; then
1407 case ":$compile_shlibpath:" in
1409 *) compile_shlibpath="$compile_shlibpath$absdir:";;
1411 compile_command="$compile_command -l$name"
1412 deplibs="$deplibs -l$name"
1423 if test "$lib_linked" != yes; then
1424 $echo "$modename: configuration error: unsupported hardcode properties"
1428 # Finalize command for both is simple: just hardcode it.
1429 if test "$hardcode_direct" = yes; then
1430 finalize_command="$finalize_command $libdir/$linklib"
1431 elif test "$hardcode_minus_L" = yes; then
1432 case "$finalize_command " in
1434 *) finalize_command="$finalize_command -L$libdir";;
1436 finalize_command="$finalize_command -l$name"
1437 elif test "$hardcode_shlibpath_var" = yes; then
1438 case ":$finalize_shlibpath:" in
1440 *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
1442 finalize_command="$finalize_command -l$name"
1444 # We cannot seem to hardcode it, guess we'll fake it.
1445 case "$finalize_command " in
1447 *) finalize_command="$finalize_command -L$libdir";;
1449 finalize_command="$finalize_command -l$name"
1452 # Transform directly to old archives if we don't build new libraries.
1453 if test -n "$pic_flag" && test -z "$old_library"; then
1454 $echo "$modename: cannot find static library for \`$arg'" 1>&2
1458 # Here we assume that one of hardcode_direct or hardcode_minus_L
1459 # is not unsupported. This is valid on all known static and
1461 if test "$hardcode_direct" != unsupported; then
1462 test -n "$old_library" && linklib="$old_library"
1463 compile_command="$compile_command $dir/$linklib"
1464 finalize_command="$finalize_command $dir/$linklib"
1466 case "$compile_command " in
1468 *) compile_command="$compile_command -L$dir";;
1470 compile_command="$compile_command -l$name"
1471 case "$finalize_command " in
1473 *) finalize_command="$finalize_command -L$dir";;
1475 finalize_command="$finalize_command -l$name"
1479 # Add in any libraries that this one depends upon.
1480 compile_command="$compile_command$dependency_libs"
1481 finalize_command="$finalize_command$dependency_libs"
1485 # Some other compiler argument.
1487 # Unknown arguments in both finalize_command and compile_command need
1488 # to be aesthetically quoted because they are evaled later.
1489 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1491 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1498 # Now actually substitute the argument into the commands.
1499 if test -n "$arg"; then
1500 compile_command="$compile_command $arg"
1501 finalize_command="$finalize_command $arg"
1505 if test -n "$prev"; then
1506 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1511 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1512 eval arg=\"$export_dynamic_flag_spec\"
1513 compile_command="$compile_command $arg"
1514 finalize_command="$finalize_command $arg"
1518 # calculate the name of the file, without its directory
1519 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1520 libobjs_save="$libobjs"
1524 $echo "$modename: you must specify an output file" 1>&2
1530 if test -n "$link_against_libtool_libs"; then
1531 $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
1535 if test -n "$deplibs"; then
1536 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1539 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1540 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1543 if test -n "$rpath"; then
1544 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
1547 if test -n "$xrpath"; then
1548 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
1551 if test -n "$vinfo"; then
1552 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1555 if test -n "$release"; then
1556 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
1559 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1560 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1563 # Now set the variables for building old libraries.
1564 build_libtool_libs=no
1569 # Make sure we only generate libraries of the form `libNAME.la'.
1570 case "$outputname" in
1572 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1573 eval libname=\"$libname_spec\"
1576 if test "$module" = no; then
1577 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
1581 if test "$need_lib_prefix" != no; then
1582 # Add the "lib" prefix for modules if required
1583 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1584 eval libname=\"$libname_spec\"
1586 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1591 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1592 if test "X$output_objdir" = "X$output"; then
1593 output_objdir="$objdir"
1595 output_objdir="$output_objdir/$objdir"
1598 if test -n "$objs"; then
1599 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1603 # How the heck are we supposed to write a wrapper for a shared library?
1604 if test -n "$link_against_libtool_libs"; then
1605 $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
1609 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1610 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1614 if test $# -gt 2; then
1615 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1620 if test -z "$rpath"; then
1621 if test "$build_libtool_libs" = yes; then
1622 # Building a libtool convenience library.
1624 oldlibs="$output_objdir/$libname.$libext $oldlibs"
1625 build_libtool_libs=convenience
1628 dependency_libs="$deplibs"
1630 if test -n "$vinfo"; then
1631 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1634 if test -n "$release"; then
1635 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1639 # Parse the version information argument.
1640 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
1641 set dummy $vinfo 0 0 0
1644 if test -n "$8"; then
1645 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1654 # Check that each of the things are valid numbers.
1658 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1659 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1667 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1668 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1676 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1677 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1682 if test $age -gt $current; then
1683 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1684 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1688 # Calculate the version variables.
1692 case "$version_type" in
1696 major=`expr $current - $age + 1`
1697 versuffix="$major.$revision"
1698 verstring="sgi$major.$revision"
1700 # Add in all the interfaces that we are compatible with.
1702 while test $loop != 0; do
1703 iface=`expr $revision - $loop`
1704 loop=`expr $loop - 1`
1705 verstring="sgi$major.$iface:$verstring"
1710 major=.`expr $current - $age`
1711 versuffix="$major.$age.$revision"
1715 major=`expr $current - $age`
1716 versuffix=".$current.$age.$revision"
1717 verstring="$current.$age.$revision"
1719 # Add in all the interfaces that we are compatible with.
1721 while test $loop != 0; do
1722 iface=`expr $current - $loop`
1723 loop=`expr $loop - 1`
1724 verstring="$verstring:${iface}.0"
1727 # Make executables depend on our current version.
1728 verstring="$verstring:${current}.0"
1733 versuffix=".$current.$revision"
1738 versuffix=".$current.$revision";
1743 versuffix=".$current";
1747 # Like Linux, but with '-' rather than '.', since we only
1748 # want one extension on Windows 95.
1749 major=`expr $current - $age`
1750 versuffix="-$major-$age-$revision"
1754 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1755 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1760 # Clear the version info if we defaulted, and they specified a release.
1761 if test -z "$vinfo" && test -n "$release"; then
1764 if test "$need_version" = no; then
1771 # Remove version info from name if versioning should be avoided
1772 if test "$avoid_version" = yes && test "$need_version" = no; then
1778 # Check to see if the archive will have undefined symbols.
1779 if test "$allow_undefined" = yes; then
1780 if test "$allow_undefined_flag" = unsupported; then
1781 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1782 build_libtool_libs=no
1786 # Don't allow undefined symbols.
1787 allow_undefined_flag="$no_undefined_flag"
1790 dependency_libs="$deplibs"
1792 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1793 # these systems don't actually have a c library (as such)!
1796 # rhapsody is a little odd...
1797 deplibs="$deplibs -framework System"
1800 # Add libc to deplibs on all other systems.
1801 deplibs="$deplibs -lc"
1806 # Create the output directory, or remove our outputs if we need to.
1807 if test -d $output_objdir; then
1808 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
1809 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
1811 $show "$mkdir $output_objdir"
1812 $run $mkdir $output_objdir
1814 if test $status -ne 0 && test ! -d $output_objdir; then
1819 # Now set the variables for building old libraries.
1820 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
1821 oldlibs="$oldlibs $output_objdir/$libname.$libext"
1823 # Transform .lo files to .o files.
1824 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
1827 if test "$build_libtool_libs" = yes; then
1828 # Transform deplibs into only deplibs that can be linked in shared.
1830 libname_save=$libname
1831 release_save=$release
1832 versuffix_save=$versuffix
1834 # I'm not sure if I'm treating the release correctly. I think
1835 # release should show up in the -l (ie -lgmp5) so we don't want to
1836 # add it in twice. Is that correct?
1842 case "$deplibs_check_method" in
1844 # Don't check for shared/static. Everything works.
1845 # This might be a little naive. We might want to check
1846 # whether the library exists or not. But this is on
1847 # osf3 & osf4 and I'm not really sure... Just
1848 # implementing what was already the behaviour.
1852 # This code stresses the "libraries are programs" paradigm to its
1853 # limits. Maybe even breaks it. We compile a program, linking it
1854 # against the deplibs as a proxy for the library. Then we can check
1855 # whether they linked in statically or dynamically with ldd.
1857 cat > conftest.c <<EOF
1858 int main() { return 0; }
1861 $CC -o conftest conftest.c $deplibs
1862 if test $? -eq 0 ; then
1863 ldd_output=`ldd conftest`
1864 for i in $deplibs; do
1865 name="`expr $i : '-l\(.*\)'`"
1866 # If $name is empty we are operating on a -L argument.
1867 if test "$name" != "" ; then
1868 libname=`eval \\$echo \"$libname_spec\"`
1869 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1870 set dummy $deplib_matches
1872 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1873 newdeplibs="$newdeplibs $i"
1877 echo "*** Warning: This library needs some functionality provided by $i."
1878 echo "*** I have the capability to make that library automatically link in when"
1879 echo "*** you link to this library. But I can only do this if you have a"
1880 echo "*** shared version of the library, which you do not appear to have."
1883 newdeplibs="$newdeplibs $i"
1887 # Error occured in the first compile. Let's try to salvage the situation:
1888 # Compile a seperate program for each library.
1889 for i in $deplibs; do
1890 name="`expr $i : '-l\(.*\)'`"
1891 # If $name is empty we are operating on a -L argument.
1892 if test "$name" != "" ; then
1894 $CC -o conftest conftest.c $i
1896 if test $? -eq 0 ; then
1897 ldd_output=`ldd conftest`
1898 libname=`eval \\$echo \"$libname_spec\"`
1899 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1900 set dummy $deplib_matches
1902 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1903 newdeplibs="$newdeplibs $i"
1907 echo "*** Warning: This library needs some functionality provided by $i."
1908 echo "*** I have the capability to make that library automatically link in when"
1909 echo "*** you link to this library. But I can only do this if you have a"
1910 echo "*** shared version of the library, which you do not appear to have."
1915 echo "*** Warning! Library $i is needed by this library but I was not able to"
1916 echo "*** make it link in! You will probably need to install it or some"
1917 echo "*** library that it depends on before this library will be fully"
1918 echo "*** functional. Installing it before continuing would be even better."
1921 newdeplibs="$newdeplibs $i"
1927 set dummy $deplibs_check_method
1928 file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
1929 for a_deplib in $deplibs; do
1930 name="`expr $a_deplib : '-l\(.*\)'`"
1931 # If $name is empty we are operating on a -L argument.
1932 if test "$name" != "" ; then
1933 libname=`eval \\$echo \"$libname_spec\"`
1934 for i in $lib_search_path; do
1935 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
1936 for potent_lib in $potential_libs; do
1937 # Follow soft links.
1938 if ls -lLd "$potent_lib" 2>/dev/null \
1939 | grep " -> " >/dev/null; then
1942 # The statement above tries to avoid entering an
1943 # endless loop below, in case of cyclic links.
1944 # We might still enter an endless loop, since a link
1945 # loop can be closed while we follow links,
1947 potlib="$potent_lib"
1948 while test -h "$potlib" 2>/dev/null; do
1949 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
1950 case "$potliblink" in
1951 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
1952 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
1955 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
1957 | egrep "$file_magic_regex" > /dev/null; then
1958 newdeplibs="$newdeplibs $a_deplib"
1964 if test -n "$a_deplib" ; then
1967 echo "*** Warning: This library needs some functionality provided by $a_deplib."
1968 echo "*** I have the capability to make that library automatically link in when"
1969 echo "*** you link to this library. But I can only do this if you have a"
1970 echo "*** shared version of the library, which you do not appear to have."
1973 # Add a -L argument.
1974 newdeplibs="$newdeplibs $a_deplib"
1976 done # Gone through all deplibs.
1980 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
1981 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
1982 grep . >/dev/null; then
1984 if test "X$deplibs_check_method" = "Xnone"; then
1985 echo "*** Warning: inter-library dependencies are not supported in this platform."
1987 echo "*** Warning: inter-library dependencies are not known to be supported."
1989 echo "*** All declared inter-library dependencies are being dropped."
1994 versuffix=$versuffix_save
1996 release=$release_save
1997 libname=$libname_save
2000 if test "$droppeddeps" = yes; then
2001 if test "$module" = yes; then
2003 echo "*** Warning: libtool could not satisfy all declared inter-library"
2004 echo "*** dependencies of module $libname. Therefore, libtool will create"
2005 echo "*** a static module, that should work as long as the dlopening"
2006 echo "*** application is linked with the -dlopen flag."
2007 if test -z "$global_symbol_pipe"; then
2009 echo "*** However, this would only work if libtool was able to extract symbol"
2010 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2011 echo "*** not find such a program. So, this module is probably useless."
2012 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2014 if test "$build_old_libs" = no; then
2015 oldlibs="$output_objdir/$libname.$libext"
2016 build_libtool_libs=module
2019 build_libtool_libs=no
2022 echo "*** The inter-library dependencies that have been dropped here will be"
2023 echo "*** automatically added whenever a program is linked with this library"
2024 echo "*** or is declared to -dlopen it."
2027 # Done checking deplibs!
2031 # All the library-specific variables (install_libdir is set above).
2036 # Test again, we may have decided not to build it any more
2037 if test "$build_libtool_libs" = yes; then
2038 # Get the real and link names of the library.
2039 eval library_names=\"$library_names_spec\"
2040 set dummy $library_names
2044 if test -n "$soname_spec"; then
2045 eval soname=\"$soname_spec\"
2050 lib="$output_objdir/$realname"
2053 linknames="$linknames $link"
2056 # Ensure that we have .o objects for linkers which dislike .lo
2057 # (e.g. aix) in case we are running --disable-static
2058 for obj in $libobjs; do
2059 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2060 if test "X$xdir" = "X$obj"; then
2065 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2066 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2067 if test ! -f $xdir/$oldobj; then
2068 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2069 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
2073 # Use standard objects if they are pic
2074 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2076 # Prepare the list of exported symbols
2077 if test -z "$export_symbols"; then
2078 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2079 $show "generating symbol list for \`$libname.la'"
2080 export_symbols="$output_objdir/$libname.exp"
2081 $run $rm $export_symbols
2082 eval cmds=\"$export_symbols_cmds\"
2083 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2084 for cmd in $cmds; do
2087 $run eval "$cmd" || exit $?
2090 if test -n "$export_symbols_regex"; then
2091 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2092 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2093 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2094 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2099 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2100 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2103 if test -n "$convenience"; then
2104 if test -n "$whole_archive_flag_spec"; then
2105 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2107 gentop="$output_objdir/${outputname}x"
2108 $show "${rm}r $gentop"
2109 $run ${rm}r "$gentop"
2110 $show "mkdir $gentop"
2111 $run mkdir "$gentop"
2113 if test $status -ne 0 && test ! -d "$gentop"; then
2116 generated="$generated $gentop"
2118 for xlib in $convenience; do
2119 # Extract the objects.
2121 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2122 *) xabs=`pwd`"/$xlib" ;;
2124 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2125 xdir="$gentop/$xlib"
2127 $show "${rm}r $xdir"
2132 if test $status -ne 0 && test ! -d "$xdir"; then
2135 $show "(cd $xdir && $AR x $xabs)"
2136 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2138 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2143 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2144 eval flag=\"$thread_safe_flag_spec\"
2145 linkopts="$linkopts $flag"
2148 # Do each of the archive commands.
2149 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2150 eval cmds=\"$archive_expsym_cmds\"
2152 eval cmds=\"$archive_cmds\"
2154 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2155 for cmd in $cmds; do
2158 $run eval "$cmd" || exit $?
2162 # Create links to the real library.
2163 for linkname in $linknames; do
2164 if test "$realname" != "$linkname"; then
2165 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2166 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2170 # If -module or -export-dynamic was specified, set the dlname.
2171 if test "$module" = yes || test "$export_dynamic" = yes; then
2172 # On all known operating systems, these are identical.
2179 if test -n "$link_against_libtool_libs"; then
2180 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
2184 if test -n "$deplibs"; then
2185 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2188 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2189 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2192 if test -n "$rpath"; then
2193 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2196 if test -n "$xrpath"; then
2197 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2200 if test -n "$vinfo"; then
2201 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2204 if test -n "$release"; then
2205 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2210 if test -n "$objs"; then
2211 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2215 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2223 # Delete the old objects.
2224 $run $rm $obj $libobj
2226 # Objects from convenience libraries. This assumes
2227 # single-version convenience libraries. Whenever we create
2228 # different ones for PIC/non-PIC, this we'll have to duplicate
2232 # reload_cmds runs $LD directly, so let us get rid of
2233 # -Wl from whole_archive_flag_spec
2236 if test -n "$convenience"; then
2237 if test -n "$whole_archive_flag_spec"; then
2238 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2240 gentop="$output_objdir/${obj}x"
2241 $show "${rm}r $gentop"
2242 $run ${rm}r "$gentop"
2243 $show "mkdir $gentop"
2244 $run mkdir "$gentop"
2246 if test $status -ne 0 && test ! -d "$gentop"; then
2249 generated="$generated $gentop"
2251 for xlib in $convenience; do
2252 # Extract the objects.
2254 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2255 *) xabs=`pwd`"/$xlib" ;;
2257 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2258 xdir="$gentop/$xlib"
2260 $show "${rm}r $xdir"
2265 if test $status -ne 0 && test ! -d "$xdir"; then
2268 $show "(cd $xdir && $AR x $xabs)"
2269 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2271 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2276 # Create the old-style object.
2277 reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
2280 eval cmds=\"$reload_cmds\"
2281 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2282 for cmd in $cmds; do
2285 $run eval "$cmd" || exit $?
2289 # Exit if we aren't doing a library object file.
2290 if test -z "$libobj"; then
2291 if test -n "$gentop"; then
2292 $show "${rm}r $gentop"
2299 if test "$build_libtool_libs" != yes; then
2300 if test -n "$gentop"; then
2301 $show "${rm}r $gentop"
2305 # Create an invalid libtool object if no PIC, so that we don't
2306 # accidentally link it into a program.
2307 $show "echo timestamp > $libobj"
2308 $run eval "echo timestamp > $libobj" || exit $?
2312 if test -n "$pic_flag"; then
2313 # Only do commands if we really have different PIC objects.
2314 reload_objs="$libobjs $reload_conv_objs"
2316 eval cmds=\"$reload_cmds\"
2317 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2318 for cmd in $cmds; do
2321 $run eval "$cmd" || exit $?
2325 # Just create a symlink.
2328 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
2329 if test "X$xdir" = "X$libobj"; then
2334 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
2335 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2336 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
2337 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
2340 if test -n "$gentop"; then
2341 $show "${rm}r $gentop"
2348 # Anything else should be a program.
2350 if test -n "$vinfo"; then
2351 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2354 if test -n "$release"; then
2355 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2358 if test "$preload" = yes; then
2359 if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
2360 test "$dlopen_self_static" = unknown; then
2361 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2365 if test -n "$rpath$xrpath"; then
2366 # If the user specified any rpath flags, then add them.
2367 for libdir in $rpath $xrpath; do
2368 # This is the magic to use -rpath.
2369 case "$compile_rpath " in
2371 *) compile_rpath="$compile_rpath $libdir" ;;
2373 case "$finalize_rpath " in
2375 *) finalize_rpath="$finalize_rpath $libdir" ;;
2380 # Now hardcode the library paths
2383 for libdir in $compile_rpath $finalize_rpath; do
2384 if test -n "$hardcode_libdir_flag_spec"; then
2385 if test -n "$hardcode_libdir_separator"; then
2386 if test -z "$hardcode_libdirs"; then
2387 hardcode_libdirs="$libdir"
2389 # Just accumulate the unique libdirs.
2390 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2391 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2394 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2399 eval flag=\"$hardcode_libdir_flag_spec\"
2400 rpath="$rpath $flag"
2402 elif test -n "$runpath_var"; then
2403 case "$perm_rpath " in
2405 *) perm_rpath="$perm_rpath $libdir" ;;
2409 # Substitute the hardcoded libdirs into the rpath.
2410 if test -n "$hardcode_libdir_separator" &&
2411 test -n "$hardcode_libdirs"; then
2412 libdir="$hardcode_libdirs"
2413 eval rpath=\" $hardcode_libdir_flag_spec\"
2415 compile_rpath="$rpath"
2419 for libdir in $finalize_rpath; do
2420 if test -n "$hardcode_libdir_flag_spec"; then
2421 if test -n "$hardcode_libdir_separator"; then
2422 if test -z "$hardcode_libdirs"; then
2423 hardcode_libdirs="$libdir"
2425 # Just accumulate the unique libdirs.
2426 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2427 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2430 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2435 eval flag=\"$hardcode_libdir_flag_spec\"
2436 rpath="$rpath $flag"
2438 elif test -n "$runpath_var"; then
2439 case "$finalize_perm_rpath " in
2441 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
2445 # Substitute the hardcoded libdirs into the rpath.
2446 if test -n "$hardcode_libdir_separator" &&
2447 test -n "$hardcode_libdirs"; then
2448 libdir="$hardcode_libdirs"
2449 eval rpath=\" $hardcode_libdir_flag_spec\"
2451 finalize_rpath="$rpath"
2453 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2454 if test "X$output_objdir" = "X$output"; then
2455 output_objdir="$objdir"
2457 output_objdir="$output_objdir/$objdir"
2460 # Create the binary in the object directory, then wrap it.
2461 if test ! -d $output_objdir; then
2462 $show "$mkdir $output_objdir"
2463 $run $mkdir $output_objdir
2465 if test $status -ne 0 && test ! -d $output_objdir; then
2470 if test -n "$libobjs" && test "$build_old_libs" = yes; then
2471 # Transform all the library objects into standard objects.
2472 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2473 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2477 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2478 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2479 dlsyms="${outputname}S.c"
2481 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
2485 if test -n "$dlsyms"; then
2489 # Discover the nlist of each of the dlfiles.
2490 nlist="$output_objdir/${outputname}.nm"
2492 $show "$rm $nlist ${nlist}S ${nlist}T"
2493 $run $rm "$nlist" "${nlist}S" "${nlist}T"
2495 # Parse the name list into a source file.
2496 $show "creating $output_objdir/$dlsyms"
2498 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
2499 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
2500 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
2506 /* Prevent the only kind of declaration conflicts we can make. */
2507 #define lt_preloaded_symbols some_other_symbol
2509 /* External symbol declarations for the compiler. */\
2512 if test "$dlself" = yes; then
2513 $show "generating symbol list for \`$output'"
2515 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
2517 # Add our own program objects to the symbol list.
2518 progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2519 for arg in $progfiles; do
2520 $show "extracting global C symbols from \`$arg'"
2521 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2524 if test -n "$exclude_expsyms"; then
2525 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2526 $run eval '$mv "$nlist"T "$nlist"'
2529 if test -n "$export_symbols_regex"; then
2530 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2531 $run eval '$mv "$nlist"T "$nlist"'
2534 # Prepare the list of exported symbols
2535 if test -z "$export_symbols"; then
2536 export_symbols="$output_objdir/$output.exp"
2537 $run $rm $export_symbols
2538 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2540 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
2541 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
2542 $run eval 'mv "$nlist"T "$nlist"'
2546 for arg in $dlprefiles; do
2547 $show "extracting global C symbols from \`$arg'"
2548 name=`echo "$arg" | sed -e 's%^.*/%%'`
2549 $run eval 'echo ": $name " >> "$nlist"'
2550 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2553 if test -z "$run"; then
2554 # Make sure we have at least an empty file.
2555 test -f "$nlist" || : > "$nlist"
2557 if test -n "$exclude_expsyms"; then
2558 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2559 $mv "$nlist"T "$nlist"
2562 # Try sorting and uniquifying the output.
2563 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
2566 grep -v "^: " < "$nlist" > "$nlist"S
2569 if test -f "$nlist"S; then
2570 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
2572 echo '/* NONE */' >> "$output_objdir/$dlsyms"
2575 $echo >> "$output_objdir/$dlsyms" "\
2577 #undef lt_preloaded_symbols
2579 #if defined (__STDC__) && __STDC__
2580 # define lt_ptr_t void *
2582 # define lt_ptr_t char *
2586 /* The mapping between symbol names and symbols. */
2591 lt_preloaded_symbols[] =
2595 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
2596 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
2597 < "$nlist" >> "$output_objdir/$dlsyms"
2599 $echo >> "$output_objdir/$dlsyms" "\
2603 /* This works around a problem in FreeBSD linker */
2604 #ifdef FREEBSD_WORKAROUND
2605 static const void *lt_preloaded_setup() {
2606 return lt_preloaded_symbols;
2616 pic_flag_for_symtable=
2618 # compiling the symbol table file with pic_flag works around
2619 # a FreeBSD bug that causes programs to crash when -lm is
2620 # linked before any other PIC object. But we must not use
2621 # pic_flag when linking with -static. The problem exists in
2622 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2623 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2624 case "$compile_command " in
2626 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
2629 case "$compile_command " in
2631 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
2635 # Now compile the dynamic symbol file.
2636 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
2637 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
2639 # Clean up the generated files.
2640 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
2641 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
2643 # Transform the symbol file into the correct name.
2644 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2645 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2648 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
2653 # We keep going just in case the user didn't refer to
2654 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2655 # really was required.
2657 # Nullify the symbol file.
2658 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2659 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2662 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
2663 # Replace the output file specification.
2664 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
2665 link_command="$compile_command$compile_rpath"
2667 # We have no uninstalled library dependencies, so finalize right now.
2668 $show "$link_command"
2669 $run eval "$link_command"
2672 # Delete the generated files.
2673 if test -n "$dlsyms"; then
2674 $show "$rm $output_objdir/${outputname}S.${objext}"
2675 $run $rm "$output_objdir/${outputname}S.${objext}"
2681 if test -n "$shlibpath_var"; then
2682 # We should set the shlibpath_var
2684 for dir in $temp_rpath; do
2686 [\\/]* | [A-Za-z]:[\\/]*)
2691 # Relative path: add a thisdir entry.
2692 rpath="$rpath\$thisdir/$dir:"
2699 if test -n "$compile_shlibpath$finalize_shlibpath"; then
2700 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
2702 if test -n "$finalize_shlibpath"; then
2703 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
2708 if test -n "$runpath_var"; then
2709 if test -n "$perm_rpath"; then
2710 # We should set the runpath_var.
2712 for dir in $perm_rpath; do
2715 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
2717 if test -n "$finalize_perm_rpath"; then
2718 # We should set the runpath_var.
2720 for dir in $finalize_perm_rpath; do
2723 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
2727 if test "$hardcode_action" = relink; then
2728 # Fast installation is not supported
2729 link_command="$compile_var$compile_command$compile_rpath"
2730 relink_command="$finalize_var$finalize_command$finalize_rpath"
2732 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
2733 $echo "$modename: \`$output' will be relinked during installation" 1>&2
2735 if test "$fast_install" != no; then
2736 link_command="$finalize_var$compile_command$finalize_rpath"
2737 if test "$fast_install" = yes; then
2738 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
2740 # fast_install is set to needless
2744 link_command="$compile_var$compile_command$compile_rpath"
2745 relink_command="$finalize_var$finalize_command$finalize_rpath"
2749 # Replace the output file specification.
2750 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
2752 # Delete the old output files.
2753 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
2755 $show "$link_command"
2756 $run eval "$link_command" || exit $?
2758 # Now create the wrapper script.
2759 $show "creating $output"
2761 # Quote the relink command for shipping.
2762 if test -n "$relink_command"; then
2763 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
2766 # Quote $echo for shipping.
2767 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
2769 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
2770 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
2772 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
2774 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
2777 # Only actually do things if our run command is non-null.
2778 if test -z "$run"; then
2779 # win32 will think the script is a binary if it has
2780 # a .exe suffix, so we strip it off here.
2782 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
2785 trap "$rm $output; exit 1" 1 2 15
2790 # $output - temporary wrapper script for $objdir/$outputname
2791 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
2793 # The $output program cannot be directly executed until all the libtool
2794 # libraries that it depends on are installed.
2796 # This wrapper script should never be moved out of the build directory.
2797 # If it is, it will not operate correctly.
2799 # Sed substitution that helps us do robust quoting. It backslashifies
2800 # metacharacters that are still active within double-quoted strings.
2801 Xsed='sed -e 1s/^X//'
2802 sed_quote_subst='$sed_quote_subst'
2804 # The HP-UX ksh and POSIX shell print the target directory to stdout
2806 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
2808 relink_command=\"$relink_command\"
2810 # This environment variable determines our operation mode.
2811 if test \"\$libtool_install_magic\" = \"$magic\"; then
2812 # install mode needs the following variable:
2813 link_against_libtool_libs='$link_against_libtool_libs'
2815 # When we are sourced in execute mode, \$file and \$echo are already set.
2816 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2819 # Make sure echo works.
2820 if test \"X\$1\" = X--no-reexec; then
2821 # Discard the --no-reexec flag, and continue.
2823 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
2824 # Yippee, \$echo works!
2827 # Restart under the correct shell, and then maybe \$echo will work.
2828 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2834 # Find the directory that this script lives in.
2835 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2836 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2838 # Follow symbolic links until we get to the real thisdir.
2839 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
2840 while test -n \"\$file\"; do
2841 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2843 # If there was a directory component, then change thisdir.
2844 if test \"x\$destdir\" != \"x\$file\"; then
2845 case \"\$destdir\" in
2846 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
2847 *) thisdir=\"\$thisdir/\$destdir\" ;;
2851 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2852 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
2855 # Try to get the absolute directory name.
2856 absdir=\`cd \"\$thisdir\" && pwd\`
2857 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2860 if test "$fast_install" = yes; then
2862 program=lt-'$outputname'
2863 progdir=\"\$thisdir/$objdir\"
2865 if test ! -f \"\$progdir/\$program\" || \\
2866 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
2867 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2869 file=\"\$\$-\$program\"
2871 if test ! -d \"\$progdir\"; then
2872 $mkdir \"\$progdir\"
2874 $rm \"\$progdir/\$file\"
2879 # relink executable if necessary
2880 if test -n \"\$relink_command\"; then
2881 if (cd \"\$thisdir\" && eval \$relink_command); then :
2883 $rm \"\$progdir/\$file\"
2888 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2889 { $rm \"\$progdir/\$program\";
2890 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2891 $rm \"\$progdir/\$file\"
2895 program='$outputname'
2896 progdir=\"\$thisdir/$objdir\"
2902 if test -f \"\$progdir/\$program\"; then"
2904 # Export our shlibpath_var if we have one.
2905 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2907 # Add our own library path to $shlibpath_var
2908 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2910 # Some systems cannot cope with colon-terminated $shlibpath_var
2911 # The second colon is a workaround for a bug in BeOS R4 sed
2912 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2914 export $shlibpath_var
2918 # fixup the dll searchpath if we need to.
2919 if test -n "$dllsearchpath"; then
2921 # Add the dll search path components to the executable PATH
2922 PATH=$dllsearchpath:\$PATH
2927 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2928 # Run the actual program with our arguments.
2931 # win32 systems need to use the prog path for dll
2935 exec \$progdir/\$program \${1+\"\$@\"}
2939 # Backslashes separate directories on plain windows
2940 *-*-mingw | *-*-os2*)
2942 exec \$progdir\\\\\$program \${1+\"\$@\"}
2948 # Export the path to the program.
2949 PATH=\"\$progdir:\$PATH\"
2952 exec \$program \${1+\"\$@\"}
2957 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
2961 # The program doesn't exist.
2962 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
2963 \$echo \"This script is just a wrapper for \$program.\" 1>&2
2964 echo \"See the $PACKAGE documentation for more information.\" 1>&2
2975 # See if we need to build an old-fashioned archive.
2976 for oldlib in $oldlibs; do
2978 if test "$build_libtool_libs" = convenience; then
2979 oldobjs="$libobjs_save"
2980 addlibs="$convenience"
2981 build_libtool_libs=no
2983 if test "$build_libtool_libs" = module; then
2984 oldobjs="$libobjs_save"
2985 build_libtool_libs=no
2987 oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
2989 addlibs="$old_convenience"
2992 if test -n "$addlibs"; then
2993 gentop="$output_objdir/${outputname}x"
2994 $show "${rm}r $gentop"
2995 $run ${rm}r "$gentop"
2996 $show "mkdir $gentop"
2997 $run mkdir "$gentop"
2999 if test $status -ne 0 && test ! -d "$gentop"; then
3002 generated="$generated $gentop"
3004 # Add in members from convenience archives.
3005 for xlib in $addlibs; do
3006 # Extract the objects.
3008 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3009 *) xabs=`pwd`"/$xlib" ;;
3011 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3012 xdir="$gentop/$xlib"
3014 $show "${rm}r $xdir"
3019 if test $status -ne 0 && test ! -d "$xdir"; then
3022 $show "(cd $xdir && $AR x $xabs)"
3023 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3025 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3029 # Do each command in the archive commands.
3030 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3031 eval cmds=\"$old_archive_from_new_cmds\"
3033 # Ensure that we have .o objects in place in case we decided
3034 # not to build a shared library, and have fallen back to building
3035 # static libs even though --disable-static was passed!
3036 for oldobj in $oldobjs; do
3037 if test ! -f $oldobj; then
3038 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3039 if test "X$xdir" = "X$oldobj"; then
3044 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3045 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3046 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3047 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3051 eval cmds=\"$old_archive_cmds\"
3053 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3054 for cmd in $cmds; do
3057 $run eval "$cmd" || exit $?
3062 if test -n "$generated"; then
3063 $show "${rm}r$generated"
3064 $run ${rm}r$generated
3067 # Now create the libtool archive.
3071 test "$build_old_libs" = yes && old_library="$libname.$libext"
3072 $show "creating $output"
3074 if test -n "$xrpath"; then
3076 for libdir in $xrpath; do
3077 temp_xrpath="$temp_xrpath -R$libdir"
3079 dependency_libs="$temp_xrpath $dependency_libs"
3082 # Only create the output if not a dry run.
3083 if test -z "$run"; then
3084 for installed in no yes; do
3085 if test "$installed" = yes; then
3086 if test -z "$install_libdir"; then
3089 output="$output_objdir/$outputname"i
3093 # $outputname - a libtool library file
3094 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3096 # Please DO NOT delete this file!
3097 # It is necessary for linking the library.
3099 # The name that we can dlopen(3).
3102 # Names of this library.
3103 library_names='$library_names'
3105 # The name of the static archive.
3106 old_library='$old_library'
3108 # Libraries that this one depends upon.
3109 dependency_libs='$dependency_libs'
3111 # Version information for $libname.
3116 # Is this an already installed library?
3117 installed=$installed
3119 # Directory that this library needs to be installed in:
3120 libdir='$install_libdir'\
3125 # Do a symbolic link so that the libtool archive can be found in
3126 # LD_LIBRARY_PATH before the program is installed.
3127 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3128 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
3134 # libtool install mode
3136 modename="$modename: install"
3138 # There may be an optional sh(1) argument at the beginning of
3139 # install_prog (especially on Windows NT).
3140 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
3141 # Aesthetically quote it.
3142 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3144 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3148 install_prog="$arg "
3156 # The real first argument should be the name of the installation program.
3157 # Aesthetically quote it.
3158 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3160 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3164 install_prog="$install_prog$arg"
3166 # We need to accept at least all the BSD install flags.
3176 if test -n "$dest"; then
3177 files="$files $dest"
3195 # If the previous option needed an argument, then skip it.
3196 if test -n "$prev"; then
3205 # Aesthetically quote the argument.
3206 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3208 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3212 install_prog="$install_prog $arg"
3215 if test -z "$install_prog"; then
3216 $echo "$modename: you must specify an install program" 1>&2
3221 if test -n "$prev"; then
3222 $echo "$modename: the \`$prev' option requires an argument" 1>&2
3227 if test -z "$files"; then
3228 if test -z "$dest"; then
3229 $echo "$modename: no file or destination specified" 1>&2
3231 $echo "$modename: you must specify a destination" 1>&2
3237 # Strip any trailing slash from the destination.
3238 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3240 # Check to see that the destination is a directory.
3241 test -d "$dest" && isdir=yes
3242 if test "$isdir" = yes; then
3246 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3247 test "X$destdir" = "X$dest" && destdir=.
3248 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3250 # Not a directory, so check to see that there is only one file specified.
3252 if test $# -gt 2; then
3253 $echo "$modename: \`$dest' is not a directory" 1>&2
3259 [\\/]* | [A-Za-z]:[\\/]*) ;;
3261 for file in $files; do
3265 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3274 # This variable tells wrapper scripts just to set variables rather
3275 # than running their programs.
3276 libtool_install_magic="$magic"
3281 for file in $files; do
3283 # Do each installation.
3286 # Do the static libraries later.
3287 staticlibs="$staticlibs $file"
3291 # Check to see that this really is a libtool archive.
3292 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3294 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3301 # If there is no directory component, then add one.
3303 */* | *\\*) . $file ;;
3307 # Add the libdir to current_libdirs if it is the destination.
3308 if test "X$destdir" = "X$libdir"; then
3309 case "$current_libdirs " in
3311 *) current_libdirs="$current_libdirs $libdir" ;;
3314 # Note the libdir as a future libdir.
3315 case "$future_libdirs " in
3317 *) future_libdirs="$future_libdirs $libdir" ;;
3321 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
3322 test "X$dir" = "X$file/" && dir=
3325 # See the names of the shared library.
3326 set dummy $library_names
3327 if test -n "$2"; then
3332 # Install the shared library and build the symlinks.
3333 $show "$install_prog $dir/$realname $destdir/$realname"
3334 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
3336 if test $# -gt 0; then
3337 # Delete the old symlinks, and create new ones.
3340 if test "$linkname" != "$realname"; then
3341 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3342 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3347 # Do each command in the postinstall commands.
3348 lib="$destdir/$realname"
3349 eval cmds=\"$postinstall_cmds\"
3350 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3351 for cmd in $cmds; do
3354 $run eval "$cmd" || exit $?
3359 # Install the pseudo-library for information purposes.
3360 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3361 instname="$dir/$name"i
3362 $show "$install_prog $instname $destdir/$name"
3363 $run eval "$install_prog $instname $destdir/$name" || exit $?
3365 # Maybe install the static library, too.
3366 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
3370 # Install (i.e. copy) a libtool object.
3372 # Figure out destination file name, if it wasn't already specified.
3373 if test -n "$destname"; then
3374 destfile="$destdir/$destname"
3376 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3377 destfile="$destdir/$destfile"
3380 # Deduce the name of the destination old-style object file.
3383 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
3386 staticdest="$destfile"
3390 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
3396 # Install the libtool object if requested.
3397 if test -n "$destfile"; then
3398 $show "$install_prog $file $destfile"
3399 $run eval "$install_prog $file $destfile" || exit $?
3402 # Install the old object if enabled.
3403 if test "$build_old_libs" = yes; then
3404 # Deduce the name of the old-style object file.
3405 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
3407 $show "$install_prog $staticobj $staticdest"
3408 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
3414 # Figure out destination file name, if it wasn't already specified.
3415 if test -n "$destname"; then
3416 destfile="$destdir/$destname"
3418 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3419 destfile="$destdir/$destfile"
3422 # Do a test to see if this is really a libtool program.
3423 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3424 link_against_libtool_libs=
3427 # If there is no directory component, then add one.
3429 */* | *\\*) . $file ;;
3433 # Check the variables that should have been set.
3434 if test -z "$link_against_libtool_libs"; then
3435 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
3440 for lib in $link_against_libtool_libs; do
3441 # Check to see that each library is installed.
3443 if test -f "$lib"; then
3444 # If there is no directory component, then add one.
3446 */* | *\\*) . $lib ;;
3450 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
3451 if test -n "$libdir" && test ! -f "$libfile"; then
3452 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
3458 if test "$fast_install" = no && test -n "$relink_command"; then
3459 if test "$finalize" = yes && test -z "$run"; then
3461 test -n "$TMPDIR" && tmpdir="$TMPDIR"
3462 tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null`
3463 if test $? = 0 ; then :
3465 tmpdir="$tmpdir/libtool-$$"
3467 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
3469 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
3472 outputname="$tmpdir/$file"
3473 # Replace the output file specification.
3474 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
3476 $show "$relink_command"
3477 if $run eval "$relink_command"; then :
3479 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
3485 $echo "$modename: warning: cannot relink \`$file'" 1>&2
3488 # Install the binary that we compiled earlier.
3489 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
3493 $show "$install_prog$stripme $file $destfile"
3494 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
3495 test -n "$outputname" && ${rm}r "$tmpdir"
3500 for file in $staticlibs; do
3501 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3503 # Set up the ranlib parameters.
3504 oldlib="$destdir/$name"
3506 $show "$install_prog $file $oldlib"
3507 $run eval "$install_prog \$file \$oldlib" || exit $?
3509 # Do each command in the postinstall commands.
3510 eval cmds=\"$old_postinstall_cmds\"
3511 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3512 for cmd in $cmds; do
3515 $run eval "$cmd" || exit $?
3520 if test -n "$future_libdirs"; then
3521 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
3524 if test -n "$current_libdirs"; then
3525 # Maybe just do a dry run.
3526 test -n "$run" && current_libdirs=" -n$current_libdirs"
3527 exec $SHELL $0 --finish$current_libdirs
3534 # libtool finish mode
3536 modename="$modename: finish"
3540 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3543 libdirs="$libdirs $dir"
3546 for libdir in $libdirs; do
3547 if test -n "$finish_cmds"; then
3548 # Do each command in the finish commands.
3549 eval cmds=\"$finish_cmds\"
3550 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3551 for cmd in $cmds; do
3554 $run eval "$cmd" || admincmds="$admincmds
3559 if test -n "$finish_eval"; then
3560 # Do the single finish_eval.
3561 eval cmds=\"$finish_eval\"
3562 $run eval "$cmds" || admincmds="$admincmds
3568 # Exit here if they wanted silent mode.
3569 test "$show" = : && exit 0
3571 echo "----------------------------------------------------------------------"
3572 echo "Libraries have been installed in:"
3573 for libdir in $libdirs; do
3577 echo "If you ever happen to want to link against installed libraries"
3578 echo "in a given directory, LIBDIR, you must either use libtool, and"
3579 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
3580 echo "flag during linking and do at least one of the following:"
3581 if test -n "$shlibpath_var"; then
3582 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3583 echo " during execution"
3585 if test -n "$runpath_var"; then
3586 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3587 echo " during linking"
3589 if test -n "$hardcode_libdir_flag_spec"; then
3591 eval flag=\"$hardcode_libdir_flag_spec\"
3593 echo " - use the \`$flag' linker flag"
3595 if test -n "$admincmds"; then
3596 echo " - have your system administrator run these commands:$admincmds"
3598 if test -f /etc/ld.so.conf; then
3599 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3602 echo "See any operating system documentation about shared libraries for"
3603 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3604 echo "----------------------------------------------------------------------"
3608 # libtool execute mode
3610 modename="$modename: execute"
3612 # The first argument is the command name.
3614 if test -z "$cmd"; then
3615 $echo "$modename: you must specify a COMMAND" 1>&2
3620 # Handle -dlopen flags immediately.
3621 for file in $execute_dlfiles; do
3622 if test ! -f "$file"; then
3623 $echo "$modename: \`$file' is not a file" 1>&2
3631 # Check to see that this really is a libtool archive.
3632 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3634 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3639 # Read the libtool library.
3643 # If there is no directory component, then add one.
3645 */* | *\\*) . $file ;;
3649 # Skip this library if it cannot be dlopened.
3650 if test -z "$dlname"; then
3651 # Warn if it was a shared library.
3652 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
3656 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3657 test "X$dir" = "X$file" && dir=.
3659 if test -f "$dir/$objdir/$dlname"; then
3662 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
3668 # Just add the directory containing the .lo file.
3669 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3670 test "X$dir" = "X$file" && dir=.
3674 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
3679 # Get the absolute pathname.
3680 absdir=`cd "$dir" && pwd`
3681 test -n "$absdir" && dir="$absdir"
3683 # Now add the directory to shlibpath_var.
3684 if eval "test -z \"\$$shlibpath_var\""; then
3685 eval "$shlibpath_var=\"\$dir\""
3687 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3691 # This variable tells wrapper scripts just to set shlibpath_var
3692 # rather than running their programs.
3693 libtool_execute_magic="$magic"
3695 # Check if any of the arguments is a wrapper script.
3702 # Do a test to see if this is really a libtool program.
3703 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3704 # If there is no directory component, then add one.
3706 */* | *\\*) . $file ;;
3710 # Transform arg to wrapped name.
3711 file="$progdir/$program"
3715 # Quote arguments (to preserve shell metacharacters).
3716 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
3717 args="$args \"$file\""
3720 if test -z "$run"; then
3721 if test -n "$shlibpath_var"; then
3722 # Export the shlibpath_var.
3723 eval "export $shlibpath_var"
3726 # Restore saved enviroment variables
3727 if test "${save_LC_ALL+set}" = set; then
3728 LC_ALL="$save_LC_ALL"; export LC_ALL
3730 if test "${save_LANG+set}" = set; then
3731 LANG="$save_LANG"; export LANG
3734 # Now actually exec the command.
3735 eval "exec \$cmd$args"
3737 $echo "$modename: cannot exec \$cmd$args"
3740 # Display what would be done.
3741 if test -n "$shlibpath_var"; then
3742 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
3743 $echo "export $shlibpath_var"
3750 # libtool uninstall mode
3752 modename="$modename: uninstall"
3759 -*) rm="$rm $arg" ;;
3760 *) files="$files $arg" ;;
3764 if test -z "$rm"; then
3765 $echo "$modename: you must specify an RM program" 1>&2
3770 for file in $files; do
3771 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3772 test "X$dir" = "X$file" && dir=.
3773 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3779 # Possibly a libtool archive, so verify it.
3780 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3783 # Delete the libtool libraries and symlinks.
3784 for n in $library_names; do
3785 rmfiles="$rmfiles $dir/$n"
3787 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
3789 $show "$rm $rmfiles"
3792 if test -n "$library_names"; then
3793 # Do each command in the postuninstall commands.
3794 eval cmds=\"$postuninstall_cmds\"
3795 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3796 for cmd in $cmds; do
3804 if test -n "$old_library"; then
3805 # Do each command in the old_postuninstall commands.
3806 eval cmds=\"$old_postuninstall_cmds\"
3807 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3808 for cmd in $cmds; do
3816 # FIXME: should reinstall the best remaining shared library.
3821 if test "$build_old_libs" = yes; then
3822 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
3823 rmfiles="$rmfiles $dir/$oldobj"
3825 $show "$rm $rmfiles"
3830 $show "$rm $rmfiles"
3839 $echo "$modename: you must specify a MODE" 1>&2
3840 $echo "$generic_help" 1>&2
3845 $echo "$modename: invalid operation mode \`$mode'" 1>&2
3846 $echo "$generic_help" 1>&2
3848 fi # test -z "$show_help"
3850 # We need to display help for each of the modes.
3853 "Usage: $modename [OPTION]... [MODE-ARG]...
3855 Provide generalized library-building support services.
3857 --config show all configuration variables
3858 --debug enable verbose shell tracing
3859 -n, --dry-run display commands without modifying any files
3860 --features display basic configuration information and exit
3861 --finish same as \`--mode=finish'
3862 --help display this help message and exit
3863 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
3864 --quiet same as \`--silent'
3865 --silent don't print informational messages
3866 --version print version information
3868 MODE must be one of the following:
3870 compile compile a source file into a libtool object
3871 execute automatically set library path, then run a program
3872 finish complete the installation of libtool libraries
3873 install install libraries or executables
3874 link create a library or an executable
3875 uninstall remove libraries from an installed directory
3877 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
3878 a more detailed description of MODE."
3884 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
3886 Compile a source file into a libtool library object.
3888 This mode accepts the following additional options:
3890 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
3891 -static always build a \`.o' file suitable for static linking
3893 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
3894 from the given SOURCEFILE.
3896 The output file name is determined by removing the directory component from
3897 SOURCEFILE, then substituting the C source code suffix \`.c' with the
3898 library object suffix, \`.lo'."
3903 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
3905 Automatically set library path, then run a program.
3907 This mode accepts the following additional options:
3909 -dlopen FILE add the directory containing FILE to the library path
3911 This mode sets the library path environment variable according to \`-dlopen'
3914 If any of the ARGS are libtool executable wrappers, then they are translated
3915 into their corresponding uninstalled binary, and any of their required library
3916 directories are added to the library path.
3918 Then, COMMAND is executed, with ARGS as arguments."
3923 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
3925 Complete the installation of libtool libraries.
3927 Each LIBDIR is a directory that contains libtool libraries.
3929 The commands that this mode executes may require superuser privileges. Use
3930 the \`--dry-run' option if you just want to see what would be executed."
3935 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
3937 Install executables or libraries.
3939 INSTALL-COMMAND is the installation command. The first component should be
3940 either the \`install' or \`cp' program.
3942 The rest of the components are interpreted as arguments to that command (only
3943 BSD-compatible install options are recognized)."
3948 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
3950 Link object files or libraries together to form another library, or to
3951 create an executable program.
3953 LINK-COMMAND is a command using the C compiler that you would use to create
3954 a program from several object files.
3956 The following components of LINK-COMMAND are treated specially:
3958 -all-static do not do any dynamic linking at all
3959 -avoid-version do not add a version suffix if possible
3960 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
3961 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
3962 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3963 -export-symbols SYMFILE
3964 try to export only the symbols listed in SYMFILE
3965 -export-symbols-regex REGEX
3966 try to export only the symbols matching REGEX
3967 -LLIBDIR search LIBDIR for required installed libraries
3968 -lNAME OUTPUT-FILE requires the installed library libNAME
3969 -module build a library that can dlopened
3970 -no-undefined declare that a library does not refer to external symbols
3971 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
3972 -release RELEASE specify package release information
3973 -rpath LIBDIR the created library will eventually be installed in LIBDIR
3974 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
3975 -static do not do any dynamic linking of libtool libraries
3976 -version-info CURRENT[:REVISION[:AGE]]
3977 specify library version info [each variable defaults to 0]
3979 All other options (arguments beginning with \`-') are ignored.
3981 Every other argument is treated as a filename. Files ending in \`.la' are
3982 treated as uninstalled libtool libraries, other files are standard or library
3985 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
3986 only library objects (\`.lo' files) may be specified, and \`-rpath' is
3987 required, except when creating a convenience library.
3989 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
3990 using \`ar' and \`ranlib', or on Windows using \`lib'.
3992 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
3993 is created, otherwise an executable program is created."
3998 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4000 Remove libraries from an installation directory.
4002 RM is the name of the program to use to delete files associated with each FILE
4003 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4006 If FILE is a libtool library, all the files associated with it are deleted.
4007 Otherwise, only FILE itself is deleted using RM."
4011 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4018 $echo "Try \`$modename --help' for more information about other modes."