1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
6 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
7 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
28 # Check that we have a working $echo.
29 if test "X$1" = X--no-reexec; then
30 # Discard the --no-reexec flag, and continue.
32 elif test "X$1" = X--fallback-echo; then
33 # Avoid inline document here, it may be left over
35 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
36 # Yippee, $echo works!
39 # Restart under the correct shell, and then maybe $echo will work.
40 exec $SHELL "$0" --no-reexec ${1+"$@"}
43 if test "X$1" = X--fallback-echo; then
44 # used as fallback echo
52 # The name of this program.
53 progname=`$echo "$0" | sed 's%^.*/%%'`
59 VERSION=1.3.5+OpenLDAP
60 TIMESTAMP=" (1.385.2.206 2000/10/02 14:18:00)"
63 help="Try \`$progname --help' for more information."
64 magic="%%%MAGIC variable%%%"
69 # Sed substitution that helps us do robust quoting. It backslashifies
70 # metacharacters that are still active within double-quoted strings.
72 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
74 NL2SP='tr \015\012 \040\040'
77 # Only set LANG and LC_ALL to C if already set.
78 # These must not be set unconditionally because not all systems understand
79 # e.g. LANG=C (notably SCO).
80 # We save the old values to restore during execute mode.
81 if test "${LC_ALL+set}" = set; then
82 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
84 if test "${LANG+set}" = set; then
85 save_LANG="$LANG"; LANG=C; export LANG
88 if test "$LTCONFIG_VERSION" != "$VERSION"; then
89 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
90 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
94 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
95 echo "$modename: not configured to build any kind of library" 1>&2
96 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
109 lo2o="s/\\.lo\$/.${objext}/"
110 o2lo="s/\\.${objext}\$/.lo/"
112 # Parse our command line options once, thoroughly.
119 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
123 # If the previous option needs an argument, assign it.
124 if test -n "$prev"; then
127 eval "$prev=\"\$$prev \$arg\""
139 # Have we seen a non-optional argument yet?
146 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
151 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
156 echo "$progname: enabling shell trace mode"
166 if test "$build_libtool_libs" = yes; then
167 echo "enable shared libraries"
169 echo "disable shared libraries"
171 if test "$build_old_libs" = yes; then
172 echo "enable static libraries"
174 echo "disable static libraries"
179 --finish) mode="finish" ;;
181 --mode) prevopt="--mode" prev=mode ;;
182 --mode=*) mode="$optarg" ;;
185 build_libtool_libs=yes
190 build_libtool_libs=no
204 $echo "$modename: unrecognized option \`$arg'" 1>&2
216 if test -n "$prevopt"; then
217 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
222 if test -z "$show_help"; then
224 # Infer the operation mode.
225 if test -z "$mode"; then
227 *cc | *++ | gcc* | *-gcc*)
239 *db | *dbx | *strace | *truss)
249 # If we have no mode, but dlfiles were specified, then do execute mode.
250 test -n "$execute_dlfiles" && mode=execute
252 # Just use the default operation mode.
253 if test -z "$mode"; then
254 if test -n "$nonopt"; then
255 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
257 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
264 # Only execute mode is allowed to have -dlopen flags.
265 if test -n "$execute_dlfiles" && test "$mode" != execute; then
266 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
271 # Change the help message to a mode-specific one.
273 help="Try \`$modename --help --mode=$mode' for more information."
275 # These modes are in order of execution frequency so that they run quickly.
277 # libtool compile mode
279 modename="$modename: compile"
280 # Get the compilation command and the source file.
289 # Accept any command-line options.
292 if test "$user_target" != "no"; then
293 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
305 case "$user_target" in
307 # The next one is the -o target name
312 # We got the output file
319 # Accept the current argument as the source file.
323 # Aesthetically quote the previous argument.
325 # Backslashify any backslashes, double quotes, and dollar signs.
326 # These are the only characters that are still specially
327 # interpreted inside of double-quoted scrings.
328 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
330 # Double-quote args containing other shell metacharacters.
331 # Many Bourne shells cannot handle close brackets correctly in scan
332 # sets, so we specify it separately.
334 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
335 lastarg="\"$lastarg\""
339 # Add the previous argument to base_compile.
340 if test -z "$base_compile"; then
341 base_compile="$lastarg"
343 base_compile="$base_compile $lastarg"
347 case "$user_target" in
351 # Get the name of the library object.
352 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
355 $echo "$modename: you must specify a target with \`-o'" 1>&2
360 # Recognize several different file suffixes.
361 # If the user specifies -o file.o, it is replaced with file.lo
376 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
379 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
381 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
386 if test -z "$base_compile"; then
387 $echo "$modename: you must specify a compilation command" 1>&2
392 # Delete any leftover library objects.
393 if test "$build_old_libs" = yes; then
394 removelist="$obj $libobj"
400 trap "$run $rm $removelist; exit 1" 1 2 15
402 # Calculate the filename of the output object if compiler does
403 # not support -o with -c
404 if test "$compiler_c_o" = no; then
405 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
406 lockfile="$output_obj.lock"
407 removelist="$removelist $output_obj $lockfile"
408 trap "$run $rm $removelist; exit 1" 1 2 15
414 # Lock this critical section if it is needed
415 # We use this script file to make the link, it avoids creating a new file
416 if test "$need_locks" = yes; then
417 until ln "$0" "$lockfile" 2>/dev/null; do
418 $show "Waiting for $lockfile to be removed"
421 elif test "$need_locks" = warn; then
422 if test -f "$lockfile"; then
424 *** ERROR, $lockfile exists and contains:
425 `cat $lockfile 2>/dev/null`
427 This indicates that another process is trying to use the same
428 temporary object file, and libtool could not work around it because
429 your compiler does not support \`-c' and \`-o' together. If you
430 repeat this compilation, it may succeed, by chance, but you had better
431 avoid parallel builds (make -j) in this platform, or get a better
437 echo $srcfile > "$lockfile"
440 if test -n "$fix_srcfile_path"; then
441 eval srcfile=\"$fix_srcfile_path\"
444 # Only build a PIC object if we are building libtool libraries.
445 if test "$build_libtool_libs" = yes; then
446 # Without this assignment, base_compile gets emptied.
447 fbsd_hideous_sh_bug=$base_compile
449 # All platforms use -DPIC, to notify preprocessed assembler code.
450 command="$base_compile $srcfile $pic_flag -DPIC"
451 if test "$build_old_libs" = yes; then
453 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
454 if test "X$dir" = "X$libobj"; then
459 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
461 if test -d "$dir"; then
468 if test $status -ne 0 && test ! -d $dir; then
473 if test "$compiler_o_lo" = yes; then
475 command="$command -o $output_obj"
476 elif test "$compiler_c_o" = yes; then
478 command="$command -o $output_obj"
481 $run $rm "$output_obj"
483 if $run eval "$command"; then :
485 test -n "$output_obj" && $run $rm $removelist
489 if test "$need_locks" = warn &&
490 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
492 *** ERROR, $lockfile contains:
493 `cat $lockfile 2>/dev/null`
495 but it should contain:
498 This indicates that another process is trying to use the same
499 temporary object file, and libtool could not work around it because
500 your compiler does not support \`-c' and \`-o' together. If you
501 repeat this compilation, it may succeed, by chance, but you had better
502 avoid parallel builds (make -j) in this platform, or get a better
509 # Just move the object if needed, then go on to compile the next one
510 if test x"$output_obj" != x"$libobj"; then
511 $show "$mv $output_obj $libobj"
512 if $run $mv $output_obj $libobj; then :
520 # If we have no pic_flag, then copy the object into place and finish.
521 if test -z "$pic_flag" && test "$build_old_libs" = yes; then
522 # Rename the .lo from within objdir to obj
523 if test -f $obj; then
528 $show "$mv $libobj $obj"
529 if $run $mv $libobj $obj; then :
536 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
537 if test "X$xdir" = "X$obj"; then
542 baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
543 libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
544 # Now arrange that obj and lo_libobj become the same file
545 $show "(cd $xdir && $LN_S $baseobj $libobj)"
546 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
555 # Allow error messages only from the first compilation.
556 suppress_output=' >/dev/null 2>&1'
559 # Only build a position-dependent object if we build old libraries.
560 if test "$build_old_libs" = yes; then
561 command="$base_compile $srcfile"
562 if test "$compiler_c_o" = yes; then
563 command="$command -o $obj"
567 # Suppress compiler output if we already did a PIC compilation.
568 command="$command$suppress_output"
569 $run $rm "$output_obj"
571 if $run eval "$command"; then :
577 if test "$need_locks" = warn &&
578 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
580 *** ERROR, $lockfile contains:
581 `cat $lockfile 2>/dev/null`
583 but it should contain:
586 This indicates that another process is trying to use the same
587 temporary object file, and libtool could not work around it because
588 your compiler does not support \`-c' and \`-o' together. If you
589 repeat this compilation, it may succeed, by chance, but you had better
590 avoid parallel builds (make -j) in this platform, or get a better
597 # Just move the object if needed
598 if test x"$output_obj" != x"$obj"; then
599 $show "$mv $output_obj $obj"
600 if $run $mv $output_obj $obj; then :
608 # Create an invalid libtool object if no PIC, so that we do not
609 # accidentally link it into a program.
610 if test "$build_libtool_libs" != yes; then
611 $show "echo timestamp > $libobj"
612 $run eval "echo timestamp > \$libobj" || exit $?
614 # Move the .lo from within objdir
615 $show "$mv $libobj $lo_libobj"
616 if $run $mv $libobj $lo_libobj; then :
625 # Unlock the critical section if it was locked
626 if test "$need_locks" != no; then
635 modename="$modename: link"
637 *-*-cygwin* | *-*-mingw* | *-*-os2*)
638 # It is impossible to link a dll without this setting, and
639 # we shouldn't force the makefile maintainer to figure out
640 # which system we are compiling for in order to pass an extra
641 # flag for every libtool invokation.
644 # FIXME: Unfortunately, there are problems with the above when trying
645 # to make a dll which has undefined symbols, in which case not
646 # even a static library is built. For now, we need to specify
647 # -no-undefined on the libtool link line when we can be certain
648 # that all symbols are satisfied, otherwise we get a static library.
651 # This is a source program that is used to create dlls on Windows
652 # Don't remove nor modify the starting and closing comments
653 # /* ltdll.c starts here */
654 # #define WIN32_LEAN_AND_MEAN
655 # #include <windows.h>
656 # #undef WIN32_LEAN_AND_MEAN
660 # # ifdef __CYGWIN32__
661 # # define __CYGWIN__ __CYGWIN32__
668 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
674 # #include <cygwin/cygwin_dll.h>
675 # DECLARE_CYGWIN_DLL( DllMain );
677 # HINSTANCE __hDllInstance_base;
680 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
682 # __hDllInstance_base = hInst;
685 # /* ltdll.c ends here */
686 # This is a source program that is used to create import libraries
687 # on Windows for dlls which lack them. Don't remove nor modify the
688 # starting and closing comments
689 # /* impgen.c starts here */
690 # /* Copyright (C) 1999 Free Software Foundation, Inc.
692 # This file is part of GNU libtool.
694 # This program is free software; you can redistribute it and/or modify
695 # it under the terms of the GNU General Public License as published by
696 # the Free Software Foundation; either version 2 of the License, or
697 # (at your option) any later version.
699 # This program is distributed in the hope that it will be useful,
700 # but WITHOUT ANY WARRANTY; without even the implied warranty of
701 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
702 # GNU General Public License for more details.
704 # You should have received a copy of the GNU General Public License
705 # along with this program; if not, write to the Free Software
706 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
709 # #include <stdio.h> /* for printf() */
710 # #include <unistd.h> /* for open(), lseek(), read() */
711 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
712 # #include <string.h> /* for strdup() */
714 # static unsigned int
715 # pe_get16 (fd, offset)
719 # unsigned char b[2];
720 # lseek (fd, offset, SEEK_SET);
722 # return b[0] + (b[1]<<8);
725 # static unsigned int
726 # pe_get32 (fd, offset)
730 # unsigned char b[4];
731 # lseek (fd, offset, SEEK_SET);
733 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
736 # static unsigned int
740 # unsigned char *b = ptr;
741 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
750 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
751 # unsigned long export_rva, export_size, nsections, secptr, expptr;
752 # unsigned long name_rvas, nexp;
753 # unsigned char *expdata, *erva;
754 # char *filename, *dll_name;
756 # filename = argv[1];
758 # dll = open(filename, O_RDONLY|O_BINARY);
762 # dll_name = filename;
764 # for (i=0; filename[i]; i++)
765 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
766 # dll_name = filename + i +1;
768 # pe_header_offset = pe_get32 (dll, 0x3c);
769 # opthdr_ofs = pe_header_offset + 4 + 20;
770 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
772 # if (num_entries < 1) /* no exports */
775 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
776 # export_size = pe_get32 (dll, opthdr_ofs + 100);
777 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
778 # secptr = (pe_header_offset + 4 + 20 +
779 # pe_get16 (dll, pe_header_offset + 4 + 16));
782 # for (i = 0; i < nsections; i++)
785 # unsigned long secptr1 = secptr + 40 * i;
786 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
787 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
788 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
789 # lseek(dll, secptr1, SEEK_SET);
790 # read(dll, sname, 8);
791 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
793 # expptr = fptr + (export_rva - vaddr);
794 # if (export_rva + export_size > vaddr + vsize)
795 # export_size = vsize - (export_rva - vaddr);
800 # expdata = (unsigned char*)malloc(export_size);
801 # lseek (dll, expptr, SEEK_SET);
802 # read (dll, expdata, export_size);
803 # erva = expdata - export_rva;
805 # nexp = pe_as32 (expdata+24);
806 # name_rvas = pe_as32 (expdata+32);
808 # printf ("EXPORTS\n");
809 # for (i = 0; i<nexp; i++)
811 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
812 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
817 # /* impgen.c ends here */
823 compile_command="$nonopt"
824 finalize_command="$nonopt"
835 if test -n "$shlibpath_var"; then
836 # get the directories listed in $shlibpath_var
837 eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
841 # now prepend the system-specific ones
842 eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
843 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
851 export_symbols_regex=
854 link_against_libtool_libs=
858 prefer_static_libs=no
870 # We need to know -static, to get the right output filenames.
874 -all-static | -static)
875 if test "X$arg" = "X-all-static"; then
876 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
877 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
879 if test -n "$link_static_flag"; then
880 dlopen_self=$dlopen_self_static
883 if test -z "$pic_flag" && test -n "$link_static_flag"; then
884 dlopen_self=$dlopen_self_static
887 build_libtool_libs=no
889 prefer_static_libs=yes
895 # See if our shared archives depend on static archives.
896 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
898 # Go through the arguments, transforming them on the way.
899 while test $# -gt 0; do
903 # If the previous option needs an argument, assign it.
904 if test -n "$prev"; then
907 compile_command="$compile_command @OUTPUT@"
908 finalize_command="$finalize_command @OUTPUT@"
914 if test "$preload" = no; then
915 # Add the symbol object into the linking commands.
916 compile_command="$compile_command @SYMFILE@"
917 finalize_command="$finalize_command @SYMFILE@"
921 *.la | *.lo) ;; # We handle these cases below.
923 if test "$dlself" = no; then
931 if test "$prev" = dlprefiles; then
933 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
943 if test "$prev" = dlfiles; then
944 dlfiles="$dlfiles $arg"
946 dlprefiles="$dlprefiles $arg"
953 export_symbols="$arg"
954 if test ! -f "$arg"; then
955 $echo "$modename: symbol file \`$arg' does not exist"
962 export_symbols_regex="$arg"
972 # We need an absolute path.
974 [\\/]* | [A-Za-z]:[\\/]*) ;;
976 $echo "$modename: only absolute run-paths are allowed" 1>&2
980 if test "$prev" = rpath; then
983 *) rpath="$rpath $arg" ;;
988 *) xrpath="$xrpath $arg" ;;
995 eval "$prev=\"\$arg\""
1006 if test -n "$link_static_flag"; then
1007 compile_command="$compile_command $link_static_flag"
1008 finalize_command="$finalize_command $link_static_flag"
1014 # FIXME: remove this flag sometime in the future.
1015 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1039 -export-symbols | -export-symbols-regex)
1040 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1041 $echo "$modename: not more than one -exported-symbols argument allowed"
1044 if test "X$arg" = "X-export-symbols"; then
1053 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1054 # We need an absolute path.
1056 [\\/]* | [A-Za-z]:[\\/]*) ;;
1058 absdir=`cd "$dir" && pwd`
1059 if test -z "$absdir"; then
1060 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1061 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1067 case " $deplibs " in
1069 *) deplibs="$deplibs $arg";;
1071 case " $lib_search_path " in
1073 *) lib_search_path="$lib_search_path $dir";;
1076 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1077 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1078 case ":$dllsearchpath:" in
1079 ::) dllsearchpath="$dllsearchdir";;
1080 *":$dllsearchdir:"*) ;;
1081 *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
1088 if test "$arg" = "-lc"; then
1090 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos* | *-*-aix*)
1091 # These systems don't actually have c library (as such)
1094 *-*-rhapsody* | *-*-darwin*)
1095 # Darwin C library is in the System framework
1096 deplibs="$deplibs -framework System"
1099 elif test "$arg" = "-lm"; then
1101 *-*-cygwin* | *-*-beos*)
1102 # These systems don't actually have math library (as such)
1105 *-*-rhapsody* | *-*-darwin*)
1106 # Darwin math library is in the System framework
1107 deplibs="$deplibs -framework System"
1111 deplibs="$deplibs $arg"
1142 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1143 # We need an absolute path.
1145 [\\/]* | [A-Za-z]:[\\/]*) ;;
1147 $echo "$modename: only absolute run-paths are allowed" 1>&2
1153 *) xrpath="$xrpath $dir" ;;
1159 # If we have no pic_flag, then this is the same as -all-static.
1160 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1161 compile_command="$compile_command $link_static_flag"
1162 finalize_command="$finalize_command $link_static_flag"
1177 # Some other compiler flag.
1179 # Unknown arguments in both finalize_command and compile_command need
1180 # to be aesthetically quoted because they are evaled later.
1181 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1183 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1189 *.o | *.obj | *.a | *.lib)
1190 # A standard object.
1196 if test "$prev" = dlfiles; then
1197 dlfiles="$dlfiles $arg"
1198 if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
1202 # If libtool objects are unsupported, then we need to preload.
1207 if test "$prev" = dlprefiles; then
1208 # Preload the old-style object.
1209 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1212 libobjs="$libobjs $arg"
1216 # A libtool-controlled library.
1223 # Check to see that this really is a libtool archive.
1224 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1226 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
1230 # If the library was installed with an old release of libtool,
1231 # it will not redefine variable installed.
1235 # If there is no directory component, then add one.
1237 */* | *\\*) . $arg ;;
1241 # Get the name of the library we link against.
1243 for l in $old_library $library_names; do
1247 if test -z "$linklib"; then
1248 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
1252 # Find the relevant object directory and library name.
1253 name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
1255 if test "X$installed" = Xyes; then
1258 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1259 if test "X$dir" = "X$arg"; then
1266 if test -n "$dependency_libs"; then
1267 # Extract -R and -L from dependency_libs
1269 for deplib in $dependency_libs; do
1271 -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1272 case " $rpath $xrpath " in
1273 *" $temp_xrpath "*) ;;
1274 *) xrpath="$xrpath $temp_xrpath";;
1276 -L*) case "$compile_command $temp_deplibs " in
1278 *) temp_deplibs="$temp_deplibs $deplib";;
1280 temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1281 case " $lib_search_path " in
1283 *) lib_search_path="$lib_search_path $temp_dir";;
1286 *) temp_deplibs="$temp_deplibs $deplib";;
1289 dependency_libs="$temp_deplibs"
1292 if test -z "$libdir"; then
1293 # It is a libtool convenience library, so add in its objects.
1294 convenience="$convenience $dir/$old_library"
1295 old_convenience="$old_convenience $dir/$old_library"
1296 deplibs="$deplibs$dependency_libs"
1297 compile_command="$compile_command $dir/$old_library$dependency_libs"
1298 finalize_command="$finalize_command $dir/$old_library$dependency_libs"
1302 # This library was specified with -dlopen.
1303 if test "$prev" = dlfiles; then
1304 dlfiles="$dlfiles $arg"
1305 if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
1306 # If there is no dlname, no dlopen support or we're linking statically,
1307 # we need to preload.
1310 # We should not create a dependency on this library, but we
1311 # may need any libraries it requires.
1312 compile_command="$compile_command$dependency_libs"
1313 finalize_command="$finalize_command$dependency_libs"
1319 # The library was specified with -dlpreopen.
1320 if test "$prev" = dlprefiles; then
1321 # Prefer using a static library (so that no silly _DYNAMIC symbols
1322 # are required to link).
1323 if test -n "$old_library"; then
1324 dlprefiles="$dlprefiles $dir/$old_library"
1326 dlprefiles="$dlprefiles $dir/$linklib"
1331 if test -n "$library_names" &&
1332 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1333 link_against_libtool_libs="$link_against_libtool_libs $arg"
1334 if test -n "$shlibpath_var"; then
1335 # Make sure the rpath contains only unique directories.
1336 case "$temp_rpath " in
1338 *) temp_rpath="$temp_rpath $dir" ;;
1342 # We need an absolute path.
1344 [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
1346 absdir=`cd "$dir" && pwd`
1347 if test -z "$absdir"; then
1348 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1349 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1355 # This is the magic to use -rpath.
1356 # Skip directories that are in the system default run-time
1357 # search path, unless they have been requested with -R.
1358 case " $sys_lib_dlsearch_path " in
1361 case "$compile_rpath " in
1363 *) compile_rpath="$compile_rpath $absdir"
1368 case " $sys_lib_dlsearch_path " in
1371 case "$finalize_rpath " in
1373 *) finalize_rpath="$finalize_rpath $libdir"
1379 case "$hardcode_action" in
1380 immediate | unsupported)
1381 if test "$hardcode_direct" = no; then
1382 compile_command="$compile_command $dir/$linklib"
1383 deplibs="$deplibs $dir/$linklib"
1385 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1386 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1387 if test -n "$dllsearchpath"; then
1388 dllsearchpath="$dllsearchpath:$dllsearchdir"
1390 dllsearchpath="$dllsearchdir"
1394 elif test "$hardcode_minus_L" = no; then
1397 compile_shlibpath="$compile_shlibpath$dir:"
1400 case "$compile_command " in
1402 *) compile_command="$compile_command -L$dir";;
1404 compile_command="$compile_command -l$name"
1405 deplibs="$deplibs -L$dir -l$name"
1406 elif test "$hardcode_shlibpath_var" = no; then
1407 case ":$compile_shlibpath:" in
1409 *) compile_shlibpath="$compile_shlibpath$dir:";;
1411 compile_command="$compile_command -l$name"
1412 deplibs="$deplibs -l$name"
1419 if test "$hardcode_direct" = yes; then
1420 compile_command="$compile_command $absdir/$linklib"
1421 deplibs="$deplibs $absdir/$linklib"
1422 elif test "$hardcode_minus_L" = yes; then
1423 case "$compile_command " in
1425 *) compile_command="$compile_command -L$absdir";;
1427 compile_command="$compile_command -l$name"
1428 deplibs="$deplibs -L$absdir -l$name"
1429 elif test "$hardcode_shlibpath_var" = yes; then
1430 case ":$compile_shlibpath:" in
1432 *) compile_shlibpath="$compile_shlibpath$absdir:";;
1434 compile_command="$compile_command -l$name"
1435 deplibs="$deplibs -l$name"
1446 if test "$lib_linked" != yes; then
1447 $echo "$modename: configuration error: unsupported hardcode properties"
1451 # Finalize command for both is simple: just hardcode it.
1452 if test "$hardcode_direct" = yes; then
1453 finalize_command="$finalize_command $libdir/$linklib"
1454 elif test "$hardcode_minus_L" = yes; then
1455 case "$finalize_command " in
1457 *) finalize_command="$finalize_command -L$libdir";;
1459 finalize_command="$finalize_command -l$name"
1460 elif test "$hardcode_shlibpath_var" = yes; then
1461 case ":$finalize_shlibpath:" in
1463 *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
1465 finalize_command="$finalize_command -l$name"
1467 # We cannot seem to hardcode it, guess we'll fake it.
1468 case "$finalize_command " in
1470 *) finalize_command="$finalize_command -L$libdir";;
1472 finalize_command="$finalize_command -l$name"
1475 # Transform directly to old archives if we don't build new libraries.
1476 if test -n "$pic_flag" && test -z "$old_library"; then
1477 $echo "$modename: cannot find static library for \`$arg'" 1>&2
1481 # Here we assume that one of hardcode_direct or hardcode_minus_L
1482 # is not unsupported. This is valid on all known static and
1484 if test "$hardcode_direct" != unsupported; then
1485 test -n "$old_library" && linklib="$old_library"
1486 compile_command="$compile_command $dir/$linklib"
1487 finalize_command="$finalize_command $dir/$linklib"
1489 case "$compile_command " in
1491 *) compile_command="$compile_command -L$dir";;
1493 compile_command="$compile_command -l$name"
1494 case "$finalize_command " in
1496 *) finalize_command="$finalize_command -L$dir";;
1498 finalize_command="$finalize_command -l$name"
1502 # Add in any libraries that this one depends upon.
1503 compile_command="$compile_command$dependency_libs"
1504 finalize_command="$finalize_command$dependency_libs"
1508 # Some other compiler argument.
1510 # Unknown arguments in both finalize_command and compile_command need
1511 # to be aesthetically quoted because they are evaled later.
1512 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1514 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1521 # Now actually substitute the argument into the commands.
1522 if test -n "$arg"; then
1523 compile_command="$compile_command $arg"
1524 finalize_command="$finalize_command $arg"
1528 if test -n "$prev"; then
1529 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1534 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1535 eval arg=\"$export_dynamic_flag_spec\"
1536 compile_command="$compile_command $arg"
1537 finalize_command="$finalize_command $arg"
1541 # calculate the name of the file, without its directory
1542 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1543 libobjs_save="$libobjs"
1547 $echo "$modename: you must specify an output file" 1>&2
1553 if test -n "$link_against_libtool_libs"; then
1554 $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
1558 if test -n "$deplibs"; then
1559 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1562 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1563 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1566 if test -n "$rpath"; then
1567 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
1570 if test -n "$xrpath"; then
1571 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
1574 if test -n "$vinfo"; then
1575 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1578 if test -n "$release"; then
1579 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
1582 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1583 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1586 # Now set the variables for building old libraries.
1587 build_libtool_libs=no
1592 # Make sure we only generate libraries of the form `libNAME.la'.
1593 case "$outputname" in
1595 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1596 eval libname=\"$libname_spec\"
1599 if test "$module" = no; then
1600 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
1604 if test "$need_lib_prefix" != no; then
1605 # Add the "lib" prefix for modules if required
1606 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1607 eval libname=\"$libname_spec\"
1609 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1614 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1615 if test "X$output_objdir" = "X$output"; then
1616 output_objdir="$objdir"
1618 output_objdir="$output_objdir/$objdir"
1621 if test -n "$objs"; then
1622 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1626 # How the heck are we supposed to write a wrapper for a shared library?
1627 if test -n "$link_against_libtool_libs"; then
1628 $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
1632 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1633 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1637 if test $# -gt 2; then
1638 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1641 if test -n "$hardcode_default_flag"; then
1642 eval linkopts=\"$linkopts$hardcode_default_flag\"
1646 if test -z "$rpath"; then
1647 if test "$build_libtool_libs" = yes; then
1648 # Building a libtool convenience library.
1650 oldlibs="$output_objdir/$libname.$libext $oldlibs"
1651 build_libtool_libs=convenience
1654 dependency_libs="$deplibs"
1656 if test -n "$vinfo"; then
1657 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1660 if test -n "$release"; then
1661 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1665 # Parse the version information argument.
1666 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
1667 set dummy $vinfo 0 0 0
1670 if test -n "$8"; then
1671 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1680 # Check that each of the things are valid numbers.
1682 0 | [1-9] | [1-9][0-9]*) ;;
1684 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1685 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1691 0 | [1-9] | [1-9][0-9]*) ;;
1693 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1694 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1700 0 | [1-9] | [1-9][0-9]*) ;;
1702 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1703 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1708 if test $age -gt $current; then
1709 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1710 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1714 # Calculate the version variables.
1718 case "$version_type" in
1722 major=`expr $current - $age + 1`
1723 versuffix="$major.$revision"
1724 verstring="sgi$major.$revision"
1726 # Add in all the interfaces that we are compatible with.
1728 while test $loop != 0; do
1729 iface=`expr $revision - $loop`
1730 loop=`expr $loop - 1`
1731 verstring="sgi$major.$iface:$verstring"
1736 major=.`expr $current - $age`
1737 versuffix="$major.$age.$revision"
1741 major=`expr $current - $age`
1742 versuffix=".$current.$age.$revision"
1743 verstring="$current.$age.$revision"
1745 # Add in all the interfaces that we are compatible with.
1747 while test $loop != 0; do
1748 iface=`expr $current - $loop`
1749 loop=`expr $loop - 1`
1750 verstring="$verstring:${iface}.0"
1753 # Make executables depend on our current version.
1754 verstring="$verstring:${current}.0"
1759 versuffix=".$current.$revision"
1764 versuffix=".$current.$revision";
1769 versuffix=".$current";
1773 # Like Linux, but with '-' rather than '.', since we only
1774 # want one extension on Windows 95.
1775 major=`expr $current - $age`
1776 versuffix="-$major-$age-$revision"
1780 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1781 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1786 # Clear the version info if we defaulted, and they specified a release.
1787 if test -z "$vinfo" && test -n "$release"; then
1790 if test "$need_version" = no; then
1797 # Remove version info from name if versioning should be avoided
1798 if test "$avoid_version" = yes && test "$need_version" = no; then
1804 # Check to see if the archive will have undefined symbols.
1805 if test "$allow_undefined" = yes; then
1806 if test "$allow_undefined_flag" = unsupported; then
1807 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1808 build_libtool_libs=no
1812 # Don't allow undefined symbols.
1813 allow_undefined_flag="$no_undefined_flag"
1816 dependency_libs="$deplibs"
1818 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos* | *-*-aix*)
1819 # these systems don't actually have a c library (as such)!
1822 # rhapsody is a little odd...
1823 deplibs="$deplibs -framework System"
1826 # Add libc to deplibs on all other systems.
1827 deplibs="$deplibs -lc"
1832 # Create the output directory, or remove our outputs if we need to.
1833 if test -d $output_objdir; then
1834 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
1835 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
1837 $show "$mkdir $output_objdir"
1838 $run $mkdir $output_objdir
1840 if test $status -ne 0 && test ! -d $output_objdir; then
1845 # Now set the variables for building old libraries.
1846 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
1847 oldlibs="$oldlibs $output_objdir/$libname.$libext"
1849 # Transform .lo files to .o files.
1850 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
1853 if test "$build_libtool_libs" = yes; then
1854 # Transform deplibs into only deplibs that can be linked in shared.
1856 libname_save=$libname
1857 release_save=$release
1858 versuffix_save=$versuffix
1860 # I'm not sure if I'm treating the release correctly. I think
1861 # release should show up in the -l (ie -lgmp5) so we don't want to
1862 # add it in twice. Is that correct?
1868 case "$deplibs_check_method" in
1870 # Don't check for shared/static. Everything works.
1871 # This might be a little naive. We might want to check
1872 # whether the library exists or not. But this is on
1873 # osf3 & osf4 and I'm not really sure... Just
1874 # implementing what was already the behaviour.
1878 # This code stresses the "libraries are programs" paradigm to its
1879 # limits. Maybe even breaks it. We compile a program, linking it
1880 # against the deplibs as a proxy for the library. Then we can check
1881 # whether they linked in statically or dynamically with ldd.
1883 cat > conftest.c <<EOF
1884 int main() { return 0; }
1887 $CC -o conftest conftest.c $deplibs
1888 if test $? -eq 0 ; then
1889 ldd_output=`ldd conftest`
1890 for i in $deplibs; do
1891 name="`expr $i : '-l\(.*\)'`"
1892 # If $name is empty we are operating on a -L argument.
1893 if test "$name" != "" ; then
1894 libname=`eval \\$echo \"$libname_spec\"`
1895 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1896 set dummy $deplib_matches
1898 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1899 newdeplibs="$newdeplibs $i"
1903 echo "*** Warning: This library needs some functionality provided by $i."
1904 echo "*** I have the capability to make that library automatically link in when"
1905 echo "*** you link to this library. But I can only do this if you have a"
1906 echo "*** shared version of the library, which you do not appear to have."
1909 newdeplibs="$newdeplibs $i"
1913 # Error occured in the first compile. Let's try to salvage the situation:
1914 # Compile a seperate program for each library.
1915 for i in $deplibs; do
1916 name="`expr $i : '-l\(.*\)'`"
1917 # If $name is empty we are operating on a -L argument.
1918 if test "$name" != "" ; then
1920 $CC -o conftest conftest.c $i
1922 if test $? -eq 0 ; then
1923 ldd_output=`ldd conftest`
1924 libname=`eval \\$echo \"$libname_spec\"`
1925 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1926 set dummy $deplib_matches
1928 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1929 newdeplibs="$newdeplibs $i"
1933 echo "*** Warning: This library needs some functionality provided by $i."
1934 echo "*** I have the capability to make that library automatically link in when"
1935 echo "*** you link to this library. But I can only do this if you have a"
1936 echo "*** shared version of the library, which you do not appear to have."
1941 echo "*** Warning! Library $i is needed by this library but I was not able to"
1942 echo "*** make it link in! You will probably need to install it or some"
1943 echo "*** library that it depends on before this library will be fully"
1944 echo "*** functional. Installing it before continuing would be even better."
1947 newdeplibs="$newdeplibs $i"
1953 set dummy $deplibs_check_method
1954 file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
1955 for a_deplib in $deplibs; do
1956 name="`expr $a_deplib : '-l\(.*\)'`"
1957 # If $name is empty we are operating on a -L argument.
1958 if test "$name" != "" ; then
1959 libname=`eval \\$echo \"$libname_spec\"`
1960 for i in $lib_search_path; do
1961 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
1962 for potent_lib in $potential_libs; do
1963 # Follow soft links.
1964 if ls -lLd "$potent_lib" 2>/dev/null \
1965 | grep " -> " >/dev/null; then
1968 # The statement above tries to avoid entering an
1969 # endless loop below, in case of cyclic links.
1970 # We might still enter an endless loop, since a link
1971 # loop can be closed while we follow links,
1973 potlib="$potent_lib"
1974 while test -h "$potlib" 2>/dev/null; do
1975 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
1976 case "$potliblink" in
1977 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
1978 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
1981 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
1983 | egrep "$file_magic_regex" > /dev/null; then
1984 newdeplibs="$newdeplibs $a_deplib"
1990 if test -n "$a_deplib" ; then
1993 echo "*** Warning: This library needs some functionality provided by $a_deplib."
1994 echo "*** I have the capability to make that library automatically link in when"
1995 echo "*** you link to this library. But I can only do this if you have a"
1996 echo "*** shared version of the library, which you do not appear to have."
1999 # Add a -L argument.
2000 newdeplibs="$newdeplibs $a_deplib"
2002 done # Gone through all deplibs.
2006 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2007 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2008 grep . >/dev/null; then
2010 if test "X$deplibs_check_method" = "Xnone"; then
2011 echo "*** Warning: inter-library dependencies are not supported in this platform."
2013 echo "*** Warning: inter-library dependencies are not known to be supported."
2015 echo "*** All declared inter-library dependencies are being dropped."
2020 versuffix=$versuffix_save
2022 release=$release_save
2023 libname=$libname_save
2026 if test "$droppeddeps" = yes; then
2027 if test "$module" = yes; then
2029 echo "*** Warning: libtool could not satisfy all declared inter-library"
2030 echo "*** dependencies of module $libname. Therefore, libtool will create"
2031 echo "*** a static module, that should work as long as the dlopening"
2032 echo "*** application is linked with the -dlopen flag."
2033 if test -z "$global_symbol_pipe"; then
2035 echo "*** However, this would only work if libtool was able to extract symbol"
2036 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2037 echo "*** not find such a program. So, this module is probably useless."
2038 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2040 if test "$build_old_libs" = no; then
2041 oldlibs="$output_objdir/$libname.$libext"
2042 build_libtool_libs=module
2045 build_libtool_libs=no
2048 echo "*** The inter-library dependencies that have been dropped here will be"
2049 echo "*** automatically added whenever a program is linked with this library"
2050 echo "*** or is declared to -dlopen it."
2053 # Done checking deplibs!
2057 # All the library-specific variables (install_libdir is set above).
2062 # Test again, we may have decided not to build it any more
2063 if test "$build_libtool_libs" = yes; then
2064 # Get the real and link names of the library.
2065 eval library_names=\"$library_names_spec\"
2066 set dummy $library_names
2070 if test -n "$soname_spec"; then
2071 eval soname=\"$soname_spec\"
2076 lib="$output_objdir/$realname"
2079 linknames="$linknames $link"
2082 # Ensure that we have .o objects for linkers which dislike .lo
2083 # (e.g. aix) in case we are running --disable-static
2084 for obj in $libobjs; do
2085 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2086 if test "X$xdir" = "X$obj"; then
2091 baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2092 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2093 if test ! -f $xdir/$oldobj; then
2094 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2095 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
2099 # Use standard objects if they are pic
2100 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2102 # Prepare the list of exported symbols
2103 if test -z "$export_symbols"; then
2104 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2105 $show "generating symbol list for \`$libname.la'"
2106 export_symbols="$output_objdir/$libname.exp"
2107 $run $rm $export_symbols
2108 eval cmds=\"$export_symbols_cmds\"
2109 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2110 for cmd in $cmds; do
2113 $run eval "$cmd" || exit $?
2116 if test -n "$export_symbols_regex"; then
2117 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2118 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2119 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2120 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2125 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2126 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2129 if test -n "$convenience"; then
2130 if test -n "$whole_archive_flag_spec"; then
2131 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2133 gentop="$output_objdir/${outputname}x"
2134 $show "${rm}r $gentop"
2135 $run ${rm}r "$gentop"
2136 $show "mkdir $gentop"
2137 $run mkdir "$gentop"
2139 if test $status -ne 0 && test ! -d "$gentop"; then
2142 generated="$generated $gentop"
2144 for xlib in $convenience; do
2145 # Extract the objects.
2147 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2148 *) xabs=`pwd`"/$xlib" ;;
2150 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2151 xdir="$gentop/$xlib"
2153 $show "${rm}r $xdir"
2158 if test $status -ne 0 && test ! -d "$xdir"; then
2161 $show "(cd $xdir && $AR x $xabs)"
2162 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2164 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2169 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2170 eval flag=\"$thread_safe_flag_spec\"
2171 linkopts="$linkopts $flag"
2174 # Do each of the archive commands.
2175 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2176 eval cmds=\"$archive_expsym_cmds\"
2178 eval cmds=\"$archive_cmds\"
2180 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2181 for cmd in $cmds; do
2184 $run eval "$cmd" || exit $?
2188 # Create links to the real library.
2189 for linkname in $linknames; do
2190 if test "$realname" != "$linkname"; then
2191 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2192 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2196 # If -module or -export-dynamic was specified, set the dlname.
2197 if test "$module" = yes || test "$export_dynamic" = yes; then
2198 # On all known operating systems, these are identical.
2205 if test -n "$link_against_libtool_libs"; then
2206 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
2210 if test -n "$deplibs"; then
2211 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2214 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2215 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2218 if test -n "$rpath"; then
2219 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2222 if test -n "$xrpath"; then
2223 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2226 if test -n "$vinfo"; then
2227 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2230 if test -n "$release"; then
2231 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2236 if test -n "$objs"; then
2237 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2241 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2249 # Delete the old objects.
2250 $run $rm $obj $libobj
2252 # Objects from convenience libraries. This assumes
2253 # single-version convenience libraries. Whenever we create
2254 # different ones for PIC/non-PIC, this we'll have to duplicate
2258 # reload_cmds runs $LD directly, so let us get rid of
2259 # -Wl from whole_archive_flag_spec
2262 if test -n "$convenience"; then
2263 if test -n "$whole_archive_flag_spec"; then
2264 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2266 gentop="$output_objdir/${obj}x"
2267 $show "${rm}r $gentop"
2268 $run ${rm}r "$gentop"
2269 $show "mkdir $gentop"
2270 $run mkdir "$gentop"
2272 if test $status -ne 0 && test ! -d "$gentop"; then
2275 generated="$generated $gentop"
2277 for xlib in $convenience; do
2278 # Extract the objects.
2280 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2281 *) xabs=`pwd`"/$xlib" ;;
2283 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2284 xdir="$gentop/$xlib"
2286 $show "${rm}r $xdir"
2291 if test $status -ne 0 && test ! -d "$xdir"; then
2294 $show "(cd $xdir && $AR x $xabs)"
2295 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2297 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2302 # Create the old-style object.
2303 reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
2306 eval cmds=\"$reload_cmds\"
2307 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2308 for cmd in $cmds; do
2311 $run eval "$cmd" || exit $?
2315 # Exit if we aren't doing a library object file.
2316 if test -z "$libobj"; then
2317 if test -n "$gentop"; then
2318 $show "${rm}r $gentop"
2325 if test "$build_libtool_libs" != yes; then
2326 if test -n "$gentop"; then
2327 $show "${rm}r $gentop"
2331 # Create an invalid libtool object if no PIC, so that we don't
2332 # accidentally link it into a program.
2333 $show "echo timestamp > $libobj"
2334 $run eval "echo timestamp > $libobj" || exit $?
2338 if test -n "$pic_flag"; then
2339 # Only do commands if we really have different PIC objects.
2340 reload_objs="$libobjs $reload_conv_objs"
2342 eval cmds=\"$reload_cmds\"
2343 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2344 for cmd in $cmds; do
2347 $run eval "$cmd" || exit $?
2351 # Just create a symlink.
2354 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
2355 if test "X$xdir" = "X$libobj"; then
2360 baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
2361 oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2362 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
2363 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
2366 if test -n "$gentop"; then
2367 $show "${rm}r $gentop"
2374 # Anything else should be a program.
2376 if test -n "$vinfo"; then
2377 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2380 if test -n "$release"; then
2381 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2384 if test "$preload" = yes; then
2385 if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
2386 test "$dlopen_self_static" = unknown; then
2387 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2391 if test -n "$rpath$xrpath"; then
2392 # If the user specified any rpath flags, then add them.
2393 for libdir in $rpath $xrpath; do
2394 # This is the magic to use -rpath.
2395 case "$compile_rpath " in
2397 *) compile_rpath="$compile_rpath $libdir" ;;
2399 case "$finalize_rpath " in
2401 *) finalize_rpath="$finalize_rpath $libdir" ;;
2406 # Now hardcode the library paths
2409 for libdir in $compile_rpath $finalize_rpath; do
2410 if test -n "$hardcode_libdir_flag_spec"; then
2411 if test -n "$hardcode_libdir_separator"; then
2412 if test -z "$hardcode_libdirs"; then
2413 hardcode_libdirs="$libdir"
2415 # Just accumulate the unique libdirs.
2416 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2417 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2420 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2425 eval flag=\"$hardcode_libdir_flag_spec\"
2426 rpath="$rpath $flag"
2428 elif test -n "$runpath_var"; then
2429 case "$perm_rpath " in
2431 *) perm_rpath="$perm_rpath $libdir" ;;
2435 # Substitute the hardcoded libdirs into the rpath.
2436 if test -n "$hardcode_libdir_separator" &&
2437 test -n "$hardcode_libdirs"; then
2438 libdir="$hardcode_libdirs"
2439 eval rpath=\" $hardcode_libdir_flag_spec\"
2441 compile_rpath="$rpath"
2445 for libdir in $finalize_rpath; do
2446 if test -n "$hardcode_libdir_flag_spec"; then
2447 if test -n "$hardcode_libdir_separator"; then
2448 if test -z "$hardcode_libdirs"; then
2449 hardcode_libdirs="$libdir"
2451 # Just accumulate the unique libdirs.
2452 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2453 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2456 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2461 eval flag=\"$hardcode_libdir_flag_spec\"
2462 rpath="$rpath $flag"
2464 elif test -n "$runpath_var"; then
2465 case "$finalize_perm_rpath " in
2467 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
2471 # Substitute the hardcoded libdirs into the rpath.
2472 if test -n "$hardcode_libdir_separator" &&
2473 test -n "$hardcode_libdirs"; then
2474 libdir="$hardcode_libdirs"
2475 eval rpath=\" $hardcode_libdir_flag_spec\"
2477 finalize_rpath="$rpath"
2479 if test -z "$compile_rpath" -a -n "$hardcode_default_flag"; then
2480 eval compile_rpath=\" $hardcode_default_flag\"
2483 if test -z "$finalize_rpath" -a -n "$hardcode_default_flag"; then
2484 eval finalize_rpath=\" $hardcode_default_flag\"
2487 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2488 if test "X$output_objdir" = "X$output"; then
2489 output_objdir="$objdir"
2491 output_objdir="$output_objdir/$objdir"
2494 # Create the binary in the object directory, then wrap it.
2495 if test ! -d $output_objdir; then
2496 $show "$mkdir $output_objdir"
2497 $run $mkdir $output_objdir
2499 if test $status -ne 0 && test ! -d $output_objdir; then
2504 if test -n "$libobjs" && test "$build_old_libs" = yes; then
2505 # Transform all the library objects into standard objects.
2506 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2507 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2511 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2512 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2513 dlsyms="${outputname}S.c"
2515 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
2519 if test -n "$dlsyms"; then
2523 # Discover the nlist of each of the dlfiles.
2524 nlist="$output_objdir/${outputname}.nm"
2526 $show "$rm $nlist ${nlist}S ${nlist}T"
2527 $run $rm "$nlist" "${nlist}S" "${nlist}T"
2529 # Parse the name list into a source file.
2530 $show "creating $output_objdir/$dlsyms"
2532 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
2533 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
2534 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
2540 /* Prevent the only kind of declaration conflicts we can make. */
2541 #define lt_preloaded_symbols some_other_symbol
2543 /* External symbol declarations for the compiler. */\
2546 if test "$dlself" = yes; then
2547 $show "generating symbol list for \`$output'"
2549 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
2551 # Add our own program objects to the symbol list.
2552 progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2553 for arg in $progfiles; do
2554 $show "extracting global C symbols from \`$arg'"
2555 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2558 if test -n "$exclude_expsyms"; then
2559 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2560 $run eval '$mv "$nlist"T "$nlist"'
2563 if test -n "$export_symbols_regex"; then
2564 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2565 $run eval '$mv "$nlist"T "$nlist"'
2568 # Prepare the list of exported symbols
2569 if test -z "$export_symbols"; then
2570 export_symbols="$output_objdir/$output.exp"
2571 $run $rm $export_symbols
2572 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2574 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
2575 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
2576 $run eval 'mv "$nlist"T "$nlist"'
2580 # Prepare the list of exported symbols
2581 if test -z "$export_symbols"; then
2582 if test "$always_export_symbols" = yes -a -n "$link_export_all"; then
2583 eval link_export=\"$link_export_all\"
2584 elif test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2585 $show "generating symbol list for \`$output'"
2586 export_symbols="$output_objdir/$output.exp"
2587 $run $rm $export_symbols
2589 eval cmds=\"$export_symbols_cmds\"
2590 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2591 for cmd in $cmds; do
2594 $run eval "$cmd" || exit $?
2597 if test -n "$export_symbols_regex"; then
2598 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2599 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2600 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2601 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2606 for arg in $dlprefiles; do
2607 $show "extracting global C symbols from \`$arg'"
2608 name=`echo "$arg" | sed -e 's%^.*/%%'`
2609 $run eval 'echo ": $name " >> "$nlist"'
2610 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2613 if test -z "$run"; then
2614 # Make sure we have at least an empty file.
2615 test -f "$nlist" || : > "$nlist"
2617 if test -n "$exclude_expsyms"; then
2618 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2619 $mv "$nlist"T "$nlist"
2622 # Try sorting and uniquifying the output.
2623 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
2626 grep -v "^: " < "$nlist" > "$nlist"S
2629 if test -f "$nlist"S; then
2630 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
2632 echo '/* NONE */' >> "$output_objdir/$dlsyms"
2635 $echo >> "$output_objdir/$dlsyms" "\
2637 #undef lt_preloaded_symbols
2639 #if defined (__STDC__) && __STDC__
2640 # define lt_ptr_t void *
2642 # define lt_ptr_t char *
2646 /* The mapping between symbol names and symbols. */
2651 lt_preloaded_symbols[] =
2655 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
2656 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
2657 < "$nlist" >> "$output_objdir/$dlsyms"
2659 $echo >> "$output_objdir/$dlsyms" "\
2663 /* This works around a problem in FreeBSD linker */
2664 #ifdef FREEBSD_WORKAROUND
2665 static const void *lt_preloaded_setup() {
2666 return lt_preloaded_symbols;
2676 pic_flag_for_symtable=
2678 # compiling the symbol table file with pic_flag works around
2679 # a FreeBSD bug that causes programs to crash when -lm is
2680 # linked before any other PIC object. But we must not use
2681 # pic_flag when linking with -static. The problem exists in
2682 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2683 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2684 case "$compile_command " in
2686 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
2689 case "$compile_command " in
2691 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
2695 # Now compile the dynamic symbol file.
2696 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
2697 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
2699 # Clean up the generated files.
2700 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
2701 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
2703 # Transform the symbol file into the correct name.
2704 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2705 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2708 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
2713 # We keep going just in case the user didn't refer to
2714 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2715 # really was required.
2717 # Nullify the symbol file.
2718 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2719 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2723 if test -n "$export_symbols" -o -n "$dlsyms"; then
2724 eval link_export_opt=\"$link_export\"
2727 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
2728 # Replace the output file specification.
2729 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
2730 link_command="$compile_command$compile_rpath$link_export_opt"
2732 # We have no uninstalled library dependencies, so finalize right now.
2733 $show "$link_command"
2734 $run eval "$link_command"
2737 # Delete the generated files.
2738 if test -n "$dlsyms"; then
2739 $show "$rm $output_objdir/${outputname}S.${objext}"
2740 $run $rm "$output_objdir/${outputname}S.${objext}"
2746 if test -n "$shlibpath_var"; then
2747 # We should set the shlibpath_var
2749 for dir in $temp_rpath; do
2751 [\\/]* | [A-Za-z]:[\\/]*)
2756 # Relative path: add a thisdir entry.
2757 rpath="$rpath\$thisdir/$dir:"
2764 if test -n "$compile_shlibpath$finalize_shlibpath"; then
2765 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
2767 if test -n "$finalize_shlibpath"; then
2768 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
2773 if test -n "$runpath_var"; then
2774 if test -n "$perm_rpath"; then
2775 # We should set the runpath_var.
2777 for dir in $perm_rpath; do
2780 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
2782 if test -n "$finalize_perm_rpath"; then
2783 # We should set the runpath_var.
2785 for dir in $finalize_perm_rpath; do
2788 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
2792 if test "$hardcode_action" = relink; then
2793 # Fast installation is not supported
2794 link_command="$compile_var$compile_command$compile_rpath"
2795 relink_command="$finalize_var$finalize_command$finalize_rpath"
2797 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
2798 $echo "$modename: \`$output' will be relinked during installation" 1>&2
2800 if test "$fast_install" != no; then
2801 link_command="$finalize_var$compile_command$finalize_rpath"
2802 if test "$fast_install" = yes; then
2803 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
2805 # fast_install is set to needless
2809 link_command="$compile_var$compile_command$compile_rpath"
2810 relink_command="$finalize_var$finalize_command$finalize_rpath"
2814 # Replace the output file specification.
2815 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
2817 link_command="$link_command$link_export_opt"
2819 # Delete the old output files.
2820 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
2822 $show "$link_command"
2823 $run eval "$link_command" || exit $?
2825 # Now create the wrapper script.
2826 $show "creating $output"
2828 # Quote the relink command for shipping.
2829 if test -n "$relink_command"; then
2830 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
2833 # Quote $echo for shipping.
2834 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
2836 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
2837 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
2839 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
2841 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
2844 # Only actually do things if our run command is non-null.
2845 if test -z "$run"; then
2846 # win32 will think the script is a binary if it has
2847 # a .exe suffix, so we strip it off here.
2849 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
2852 trap "$rm $output; exit 1" 1 2 15
2857 # $output - temporary wrapper script for $objdir/$outputname
2858 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
2860 # The $output program cannot be directly executed until all the libtool
2861 # libraries that it depends on are installed.
2863 # This wrapper script should never be moved out of the build directory.
2864 # If it is, it will not operate correctly.
2866 # Sed substitution that helps us do robust quoting. It backslashifies
2867 # metacharacters that are still active within double-quoted strings.
2868 Xsed='sed -e 1s/^X//'
2869 sed_quote_subst='$sed_quote_subst'
2871 # The HP-UX ksh and POSIX shell print the target directory to stdout
2873 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
2875 relink_command=\"$relink_command\"
2877 # This environment variable determines our operation mode.
2878 if test \"\$libtool_install_magic\" = \"$magic\"; then
2879 # install mode needs the following variable:
2880 link_against_libtool_libs='$link_against_libtool_libs'
2882 # When we are sourced in execute mode, \$file and \$echo are already set.
2883 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2886 # Make sure echo works.
2887 if test \"X\$1\" = X--no-reexec; then
2888 # Discard the --no-reexec flag, and continue.
2890 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
2891 # Yippee, \$echo works!
2894 # Restart under the correct shell, and then maybe \$echo will work.
2895 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2901 # Find the directory that this script lives in.
2902 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2903 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2905 # Follow symbolic links until we get to the real thisdir.
2906 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
2907 while test -n \"\$file\"; do
2908 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2910 # If there was a directory component, then change thisdir.
2911 if test \"x\$destdir\" != \"x\$file\"; then
2912 case \"\$destdir\" in
2913 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
2914 *) thisdir=\"\$thisdir/\$destdir\" ;;
2918 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2919 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
2922 # Try to get the absolute directory name.
2923 absdir=\`cd \"\$thisdir\" && pwd\`
2924 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2927 if test "$fast_install" = yes; then
2929 program=lt-'$outputname'
2930 progdir=\"\$thisdir/$objdir\"
2932 if test ! -f \"\$progdir/\$program\" || \\
2933 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
2934 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2936 file=\"\$\$-\$program\"
2938 if test ! -d \"\$progdir\"; then
2939 $mkdir \"\$progdir\"
2941 $rm \"\$progdir/\$file\"
2946 # relink executable if necessary
2947 if test -n \"\$relink_command\"; then
2948 if (cd \"\$thisdir\" && eval \$relink_command); then :
2950 $rm \"\$progdir/\$file\"
2955 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2956 { $rm \"\$progdir/\$program\";
2957 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2958 $rm \"\$progdir/\$file\"
2962 program='$outputname'
2963 progdir=\"\$thisdir/$objdir\"
2969 if test -f \"\$progdir/\$program\"; then"
2971 # Export our shlibpath_var if we have one.
2972 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2974 # Add our own library path to $shlibpath_var
2975 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2977 # Some systems cannot cope with colon-terminated $shlibpath_var
2978 # The second colon is a workaround for a bug in BeOS R4 sed
2979 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2981 export $shlibpath_var
2985 # fixup the dll searchpath if we need to.
2986 if test -n "$dllsearchpath"; then
2988 # Add the dll search path components to the executable PATH
2989 PATH=$dllsearchpath:\$PATH
2994 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2995 # Run the actual program with our arguments.
2998 # win32 systems need to use the prog path for dll
3002 exec \$progdir/\$program \${1+\"\$@\"}
3006 # Backslashes separate directories on plain windows
3007 *-*-mingw | *-*-os2*)
3009 exec \$progdir\\\\\$program \${1+\"\$@\"}
3015 # Export the path to the program.
3016 PATH=\"\$progdir:\$PATH\"
3019 exec \$program \${1+\"\$@\"}
3024 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3028 # The program doesn't exist.
3029 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3030 \$echo \"This script is just a wrapper for \$program.\" 1>&2
3031 echo \"See the $PACKAGE documentation for more information.\" 1>&2
3042 # See if we need to build an old-fashioned archive.
3043 for oldlib in $oldlibs; do
3045 if test "$build_libtool_libs" = convenience; then
3046 oldobjs="$libobjs_save"
3047 addlibs="$convenience"
3048 build_libtool_libs=no
3050 if test "$build_libtool_libs" = module; then
3051 oldobjs="$libobjs_save"
3052 build_libtool_libs=no
3054 oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3056 addlibs="$old_convenience"
3059 if test -n "$addlibs"; then
3060 gentop="$output_objdir/${outputname}x"
3061 $show "${rm}r $gentop"
3062 $run ${rm}r "$gentop"
3063 $show "mkdir $gentop"
3064 $run mkdir "$gentop"
3066 if test $status -ne 0 && test ! -d "$gentop"; then
3069 generated="$generated $gentop"
3071 # Add in members from convenience archives.
3072 for xlib in $addlibs; do
3073 # Extract the objects.
3075 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3076 *) xabs=`pwd`"/$xlib" ;;
3078 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3079 xdir="$gentop/$xlib"
3081 $show "${rm}r $xdir"
3086 if test $status -ne 0 && test ! -d "$xdir"; then
3089 $show "(cd $xdir && $AR x $xabs)"
3090 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3092 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3096 # Do each command in the archive commands.
3097 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3098 eval cmds=\"$old_archive_from_new_cmds\"
3100 # Ensure that we have .o objects in place in case we decided
3101 # not to build a shared library, and have fallen back to building
3102 # static libs even though --disable-static was passed!
3103 for oldobj in $oldobjs; do
3104 if test ! -f $oldobj; then
3105 xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3106 if test "X$xdir" = "X$oldobj"; then
3111 baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3112 obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3113 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3114 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3118 eval cmds=\"$old_archive_cmds\"
3120 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3121 for cmd in $cmds; do
3124 $run eval "$cmd" || exit $?
3129 if test -n "$generated"; then
3130 $show "${rm}r$generated"
3131 $run ${rm}r$generated
3134 # Now create the libtool archive.
3138 test "$build_old_libs" = yes && old_library="$libname.$libext"
3139 $show "creating $output"
3141 if test -n "$xrpath"; then
3143 for libdir in $xrpath; do
3144 temp_xrpath="$temp_xrpath -R$libdir"
3146 dependency_libs="$temp_xrpath $dependency_libs"
3149 # Only create the output if not a dry run.
3150 if test -z "$run"; then
3151 for installed in no yes; do
3152 if test "$installed" = yes; then
3153 if test -z "$install_libdir"; then
3156 output="$output_objdir/$outputname"i
3160 # $outputname - a libtool library file
3161 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3163 # Please DO NOT delete this file!
3164 # It is necessary for linking the library.
3166 # The name that we can dlopen(3).
3169 # Names of this library.
3170 library_names='$library_names'
3172 # The name of the static archive.
3173 old_library='$old_library'
3175 # Libraries that this one depends upon.
3176 dependency_libs='$dependency_libs'
3178 # Version information for $libname.
3183 # Is this an already installed library?
3184 installed=$installed
3186 # Directory that this library needs to be installed in:
3187 libdir='$install_libdir'\
3192 # Do a symbolic link so that the libtool archive can be found in
3193 # LD_LIBRARY_PATH before the program is installed.
3194 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3195 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
3201 # libtool install mode
3203 modename="$modename: install"
3205 # There may be an optional sh(1) argument at the beginning of
3206 # install_prog (especially on Windows NT).
3207 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
3208 # Aesthetically quote it.
3209 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3211 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3215 install_prog="$arg "
3223 # The real first argument should be the name of the installation program.
3224 # Aesthetically quote it.
3225 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3227 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3231 install_prog="$install_prog$arg"
3233 # We need to accept at least all the BSD install flags.
3243 if test -n "$dest"; then
3244 files="$files $dest"
3262 # If the previous option needed an argument, then skip it.
3263 if test -n "$prev"; then
3272 # Aesthetically quote the argument.
3273 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3275 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3279 install_prog="$install_prog $arg"
3282 if test -z "$install_prog"; then
3283 $echo "$modename: you must specify an install program" 1>&2
3288 if test -n "$prev"; then
3289 $echo "$modename: the \`$prev' option requires an argument" 1>&2
3294 if test -z "$files"; then
3295 if test -z "$dest"; then
3296 $echo "$modename: no file or destination specified" 1>&2
3298 $echo "$modename: you must specify a destination" 1>&2
3304 # Strip any trailing slash from the destination.
3305 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3307 # Check to see that the destination is a directory.
3308 test -d "$dest" && isdir=yes
3309 if test "$isdir" = yes; then
3313 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3314 test "X$destdir" = "X$dest" && destdir=.
3315 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3317 # Not a directory, so check to see that there is only one file specified.
3319 if test $# -gt 2; then
3320 $echo "$modename: \`$dest' is not a directory" 1>&2
3326 [\\/]* | [A-Za-z]:[\\/]*) ;;
3328 for file in $files; do
3332 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3341 # This variable tells wrapper scripts just to set variables rather
3342 # than running their programs.
3343 libtool_install_magic="$magic"
3348 for file in $files; do
3350 # Do each installation.
3353 # Do the static libraries later.
3354 staticlibs="$staticlibs $file"
3358 # Check to see that this really is a libtool archive.
3359 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3361 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3368 # If there is no directory component, then add one.
3370 */* | *\\*) . $file ;;
3374 # Add the libdir to current_libdirs if it is the destination.
3375 if test "X$destdir" = "X$libdir"; then
3376 case "$current_libdirs " in
3378 *) current_libdirs="$current_libdirs $libdir" ;;
3381 # Note the libdir as a future libdir.
3382 case "$future_libdirs " in
3384 *) future_libdirs="$future_libdirs $libdir" ;;
3388 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
3389 test "X$dir" = "X$file/" && dir=
3392 # See the names of the shared library.
3393 set dummy $library_names
3394 if test -n "$2"; then
3399 # Install the shared library and build the symlinks.
3400 $show "$install_prog $dir/$realname $destdir/$realname"
3401 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
3403 if test $# -gt 0; then
3404 # Delete the old symlinks, and create new ones.
3407 if test "$linkname" != "$realname"; then
3408 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3409 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3414 # Do each command in the postinstall commands.
3415 lib="$destdir/$realname"
3416 eval cmds=\"$postinstall_cmds\"
3417 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3418 for cmd in $cmds; do
3421 $run eval "$cmd" || exit $?
3426 # Install the pseudo-library for information purposes.
3427 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3428 instname="$dir/$name"i
3429 $show "$install_prog $instname $destdir/$name"
3430 $run eval "$install_prog $instname $destdir/$name" || exit $?
3432 # Maybe install the static library, too.
3433 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
3437 # Install (i.e. copy) a libtool object.
3439 # Figure out destination file name, if it wasn't already specified.
3440 if test -n "$destname"; then
3441 destfile="$destdir/$destname"
3443 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3444 destfile="$destdir/$destfile"
3447 # Deduce the name of the destination old-style object file.
3450 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
3453 staticdest="$destfile"
3457 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
3463 # Install the libtool object if requested.
3464 if test -n "$destfile"; then
3465 $show "$install_prog $file $destfile"
3466 $run eval "$install_prog $file $destfile" || exit $?
3469 # Install the old object if enabled.
3470 if test "$build_old_libs" = yes; then
3471 # Deduce the name of the old-style object file.
3472 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
3474 $show "$install_prog $staticobj $staticdest"
3475 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
3481 # Figure out destination file name, if it wasn't already specified.
3482 if test -n "$destname"; then
3483 destfile="$destdir/$destname"
3485 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3486 destfile="$destdir/$destfile"
3489 # Do a test to see if this is really a libtool program.
3490 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3491 link_against_libtool_libs=
3494 # If there is no directory component, then add one.
3496 */* | *\\*) . $file ;;
3500 # Check the variables that should have been set.
3501 if test -z "$link_against_libtool_libs"; then
3502 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
3507 for lib in $link_against_libtool_libs; do
3508 # Check to see that each library is installed.
3510 if test -f "$lib"; then
3511 # If there is no directory component, then add one.
3513 */* | *\\*) . $lib ;;
3517 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
3518 if test -n "$libdir" && test ! -f "$libfile"; then
3519 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
3525 if test "$fast_install" = no && test -n "$relink_command"; then
3526 if test "$finalize" = yes && test -z "$run"; then
3528 test -n "$TMPDIR" && tmpdir="$TMPDIR"
3529 tmpdir="$tmpdir/libtool-$$"
3530 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
3532 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
3535 outputname="$tmpdir/$file"
3536 # Replace the output file specification.
3537 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
3539 $show "$relink_command"
3540 if $run eval "$relink_command"; then :
3542 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
3548 $echo "$modename: warning: cannot relink \`$file'" 1>&2
3551 # Install the binary that we compiled earlier.
3552 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
3556 $show "$install_prog$stripme $file $destfile"
3557 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
3558 test -n "$outputname" && ${rm}r "$tmpdir"
3563 for file in $staticlibs; do
3564 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3566 # Set up the ranlib parameters.
3567 oldlib="$destdir/$name"
3569 $show "$install_prog $file $oldlib"
3570 $run eval "$install_prog \$file \$oldlib" || exit $?
3572 # Do each command in the postinstall commands.
3573 eval cmds=\"$old_postinstall_cmds\"
3574 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3575 for cmd in $cmds; do
3578 $run eval "$cmd" || exit $?
3583 if test -n "$future_libdirs"; then
3584 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
3587 if test -n "$current_libdirs"; then
3588 # Maybe just do a dry run.
3589 test -n "$run" && current_libdirs=" -n$current_libdirs"
3590 exec $SHELL $0 --finish$current_libdirs
3597 # libtool finish mode
3599 modename="$modename: finish"
3603 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3606 libdirs="$libdirs $dir"
3609 for libdir in $libdirs; do
3610 if test -n "$finish_cmds"; then
3611 # Do each command in the finish commands.
3612 eval cmds=\"$finish_cmds\"
3613 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3614 for cmd in $cmds; do
3617 $run eval "$cmd" || admincmds="$admincmds
3622 if test -n "$finish_eval"; then
3623 # Do the single finish_eval.
3624 eval cmds=\"$finish_eval\"
3625 $run eval "$cmds" || admincmds="$admincmds
3631 # Exit here if they wanted silent mode.
3632 test "$show" = : && exit 0
3634 echo "----------------------------------------------------------------------"
3635 echo "Libraries have been installed in:"
3636 for libdir in $libdirs; do
3640 echo "If you ever happen to want to link against installed libraries"
3641 echo "in a given directory, LIBDIR, you must either use libtool, and"
3642 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
3643 echo "flag during linking and do at least one of the following:"
3644 if test -n "$shlibpath_var"; then
3645 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3646 echo " during execution"
3648 if test -n "$runpath_var"; then
3649 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3650 echo " during linking"
3652 if test -n "$hardcode_libdir_flag_spec"; then
3654 eval flag=\"$hardcode_libdir_flag_spec\"
3656 echo " - use the \`$flag' linker flag"
3658 if test -n "$admincmds"; then
3659 echo " - have your system administrator run these commands:$admincmds"
3661 if test -f /etc/ld.so.conf; then
3662 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3665 echo "See any operating system documentation about shared libraries for"
3666 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3667 echo "----------------------------------------------------------------------"
3671 # libtool execute mode
3673 modename="$modename: execute"
3675 # The first argument is the command name.
3677 if test -z "$cmd"; then
3678 $echo "$modename: you must specify a COMMAND" 1>&2
3683 # Handle -dlopen flags immediately.
3684 for file in $execute_dlfiles; do
3685 if test ! -f "$file"; then
3686 $echo "$modename: \`$file' is not a file" 1>&2
3694 # Check to see that this really is a libtool archive.
3695 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3697 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3702 # Read the libtool library.
3706 # If there is no directory component, then add one.
3708 */* | *\\*) . $file ;;
3712 # Skip this library if it cannot be dlopened.
3713 if test -z "$dlname"; then
3714 # Warn if it was a shared library.
3715 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
3719 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3720 test "X$dir" = "X$file" && dir=.
3722 if test -f "$dir/$objdir/$dlname"; then
3725 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
3731 # Just add the directory containing the .lo file.
3732 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3733 test "X$dir" = "X$file" && dir=.
3737 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
3742 # Get the absolute pathname.
3743 absdir=`cd "$dir" && pwd`
3744 test -n "$absdir" && dir="$absdir"
3746 # Now add the directory to shlibpath_var.
3747 if eval "test -z \"\$$shlibpath_var\""; then
3748 eval "$shlibpath_var=\"\$dir\""
3750 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3754 # This variable tells wrapper scripts just to set shlibpath_var
3755 # rather than running their programs.
3756 libtool_execute_magic="$magic"
3758 # Check if any of the arguments is a wrapper script.
3765 # Do a test to see if this is really a libtool program.
3766 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3767 # If there is no directory component, then add one.
3769 */* | *\\*) . $file ;;
3773 # Transform arg to wrapped name.
3774 file="$progdir/$program"
3778 # Quote arguments (to preserve shell metacharacters).
3779 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
3780 args="$args \"$file\""
3783 if test -z "$run"; then
3784 if test -n "$shlibpath_var"; then
3785 # Export the shlibpath_var.
3786 eval "export $shlibpath_var"
3789 # Restore saved enviroment variables
3790 if test "${save_LC_ALL+set}" = set; then
3791 LC_ALL="$save_LC_ALL"; export LC_ALL
3793 if test "${save_LANG+set}" = set; then
3794 LANG="$save_LANG"; export LANG
3797 # Now actually exec the command.
3798 eval "exec \$cmd$args"
3800 $echo "$modename: cannot exec \$cmd$args"
3803 # Display what would be done.
3804 if test -n "$shlibpath_var"; then
3805 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
3806 $echo "export $shlibpath_var"
3813 # libtool uninstall mode
3815 modename="$modename: uninstall"
3822 -*) rm="$rm $arg" ;;
3823 *) files="$files $arg" ;;
3827 if test -z "$rm"; then
3828 $echo "$modename: you must specify an RM program" 1>&2
3833 for file in $files; do
3834 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3835 test "X$dir" = "X$file" && dir=.
3836 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3842 # Possibly a libtool archive, so verify it.
3843 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3846 # Delete the libtool libraries and symlinks.
3847 for n in $library_names; do
3848 rmfiles="$rmfiles $dir/$n"
3850 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
3852 $show "$rm $rmfiles"
3855 if test -n "$library_names"; then
3856 # Do each command in the postuninstall commands.
3857 eval cmds=\"$postuninstall_cmds\"
3858 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3859 for cmd in $cmds; do
3867 if test -n "$old_library"; then
3868 # Do each command in the old_postuninstall commands.
3869 eval cmds=\"$old_postuninstall_cmds\"
3870 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3871 for cmd in $cmds; do
3879 # FIXME: should reinstall the best remaining shared library.
3884 if test "$build_old_libs" = yes; then
3885 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
3886 rmfiles="$rmfiles $dir/$oldobj"
3888 $show "$rm $rmfiles"
3893 $show "$rm $rmfiles"
3902 $echo "$modename: you must specify a MODE" 1>&2
3903 $echo "$generic_help" 1>&2
3908 $echo "$modename: invalid operation mode \`$mode'" 1>&2
3909 $echo "$generic_help" 1>&2
3911 fi # test -z "$show_help"
3913 # We need to display help for each of the modes.
3916 "Usage: $modename [OPTION]... [MODE-ARG]...
3918 Provide generalized library-building support services.
3920 --config show all configuration variables
3921 --debug enable verbose shell tracing
3922 -n, --dry-run display commands without modifying any files
3923 --features display basic configuration information and exit
3924 --finish same as \`--mode=finish'
3925 --help display this help message and exit
3926 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
3927 --quiet same as \`--silent'
3928 --silent don't print informational messages
3929 --version print version information
3931 MODE must be one of the following:
3933 compile compile a source file into a libtool object
3934 execute automatically set library path, then run a program
3935 finish complete the installation of libtool libraries
3936 install install libraries or executables
3937 link create a library or an executable
3938 uninstall remove libraries from an installed directory
3940 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
3941 a more detailed description of MODE."
3947 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
3949 Compile a source file into a libtool library object.
3951 This mode accepts the following additional options:
3953 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
3954 -static always build a \`.o' file suitable for static linking
3956 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
3957 from the given SOURCEFILE.
3959 The output file name is determined by removing the directory component from
3960 SOURCEFILE, then substituting the C source code suffix \`.c' with the
3961 library object suffix, \`.lo'."
3966 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
3968 Automatically set library path, then run a program.
3970 This mode accepts the following additional options:
3972 -dlopen FILE add the directory containing FILE to the library path
3974 This mode sets the library path environment variable according to \`-dlopen'
3977 If any of the ARGS are libtool executable wrappers, then they are translated
3978 into their corresponding uninstalled binary, and any of their required library
3979 directories are added to the library path.
3981 Then, COMMAND is executed, with ARGS as arguments."
3986 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
3988 Complete the installation of libtool libraries.
3990 Each LIBDIR is a directory that contains libtool libraries.
3992 The commands that this mode executes may require superuser privileges. Use
3993 the \`--dry-run' option if you just want to see what would be executed."
3998 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4000 Install executables or libraries.
4002 INSTALL-COMMAND is the installation command. The first component should be
4003 either the \`install' or \`cp' program.
4005 The rest of the components are interpreted as arguments to that command (only
4006 BSD-compatible install options are recognized)."
4011 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4013 Link object files or libraries together to form another library, or to
4014 create an executable program.
4016 LINK-COMMAND is a command using the C compiler that you would use to create
4017 a program from several object files.
4019 The following components of LINK-COMMAND are treated specially:
4021 -all-static do not do any dynamic linking at all
4022 -avoid-version do not add a version suffix if possible
4023 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
4024 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
4025 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4026 -export-symbols SYMFILE
4027 try to export only the symbols listed in SYMFILE
4028 -export-symbols-regex REGEX
4029 try to export only the symbols matching REGEX
4030 -LLIBDIR search LIBDIR for required installed libraries
4031 -lNAME OUTPUT-FILE requires the installed library libNAME
4032 -module build a library that can dlopened
4033 -no-undefined declare that a library does not refer to external symbols
4034 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
4035 -release RELEASE specify package release information
4036 -rpath LIBDIR the created library will eventually be installed in LIBDIR
4037 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
4038 -static do not do any dynamic linking of libtool libraries
4039 -version-info CURRENT[:REVISION[:AGE]]
4040 specify library version info [each variable defaults to 0]
4042 All other options (arguments beginning with \`-') are ignored.
4044 Every other argument is treated as a filename. Files ending in \`.la' are
4045 treated as uninstalled libtool libraries, other files are standard or library
4048 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4049 only library objects (\`.lo' files) may be specified, and \`-rpath' is
4050 required, except when creating a convenience library.
4052 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4053 using \`ar' and \`ranlib', or on Windows using \`lib'.
4055 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4056 is created, otherwise an executable program is created."
4061 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4063 Remove libraries from an installation directory.
4065 RM is the name of the program to use to delete files associated with each FILE
4066 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4069 If FILE is a libtool library, all the files associated with it are deleted.
4070 Otherwise, only FILE itself is deleted using RM."
4074 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4081 $echo "Try \`$modename --help' for more information about other modes."