1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
4 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # Check that we have a working $echo.
27 if test "X$1" = X--no-reexec
; then
28 # Discard the --no-reexec flag, and continue.
30 elif test "X$1" = X--fallback-echo
; then
31 # Avoid inline document here, it may be left over
33 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
34 # Yippee, $echo works!
37 # Restart under the correct shell, and then maybe $echo will work.
38 exec $SHELL "$0" --no-reexec ${1+"$@"}
41 if test "X$1" = X--fallback-echo
; then
42 # used as fallback echo
50 # The name of this program.
51 progname
=`$echo "$0" | sed 's%^.*/%%'`
58 TIMESTAMP
=" (1.542 1999/05/27 10:56:10)"
61 help="Try \`$progname --help' for more information."
62 magic
="%%%MAGIC variable%%%"
67 # Sed substitution that helps us do robust quoting. It backslashifies
68 # metacharacters that are still active within double-quoted strings.
70 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
75 # Only set LANG and LC_ALL to C if already set.
76 # These must not be set unconditionally because not all systems understand
77 # e.g. LANG=C (notably SCO).
78 # We save the old values to restore during execute mode.
79 if test "${LC_ALL+set}" = set; then
80 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
82 if test "${LANG+set}" = set; then
83 save_LANG
="$LANG"; LANG
=C
; export LANG
86 if test "$LTCONFIG_VERSION" != "$VERSION"; then
87 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
88 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
92 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
93 echo "$modename: not configured to build any kind of library" 1>&2
94 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
107 lo2o
="s/\\.lo\$/.${objext}/"
108 o2lo
="s/\\.${objext}\$/.lo/"
110 # Parse our command line options once, thoroughly.
117 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
121 # If the previous option needs an argument, assign it.
122 if test -n "$prev"; then
125 eval "$prev=\"\$$prev \$arg\""
137 # Have we seen a non-optional argument yet?
144 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
149 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
154 echo "$progname: enabling shell trace mode"
164 if test "$build_libtool_libs" = yes; then
165 echo "enable shared libraries"
167 echo "disable shared libraries"
169 if test "$build_old_libs" = yes; then
170 echo "enable static libraries"
172 echo "disable static libraries"
177 --finish) mode
="finish" ;;
179 --mode) prevopt
="--mode" prev
=mode
;;
180 --mode=*) mode
="$optarg" ;;
192 $echo "$modename: unrecognized option \`$arg'" 1>&2
204 if test -n "$prevopt"; then
205 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
210 if test -z "$show_help"; then
212 # Infer the operation mode.
213 if test -z "$mode"; then
215 *cc |
*++ | gcc
* |
*-gcc*)
227 *db |
*dbx |
*strace |
*truss
)
237 # If we have no mode, but dlfiles were specified, then do execute mode.
238 test -n "$execute_dlfiles" && mode
=execute
240 # Just use the default operation mode.
241 if test -z "$mode"; then
242 if test -n "$nonopt"; then
243 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
245 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
252 # Only execute mode is allowed to have -dlopen flags.
253 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
254 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
259 # Change the help message to a mode-specific one.
261 help="Try \`$modename --help --mode=$mode' for more information."
263 # These modes are in order of execution frequency so that they run quickly.
265 # libtool compile mode
267 modename
="$modename: compile"
268 # Get the compilation command and the source file.
277 # Accept any command-line options.
280 if test "$user_target" != "no"; then
281 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
293 case "$user_target" in
295 # The next one is the -o target name
300 # We got the output file
307 # Accept the current argument as the source file.
311 # Aesthetically quote the previous argument.
313 # Backslashify any backslashes, double quotes, and dollar signs.
314 # These are the only characters that are still specially
315 # interpreted inside of double-quoted scrings.
316 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
318 # Double-quote args containing other shell metacharacters.
319 # Many Bourne shells cannot handle close brackets correctly in scan
320 # sets, so we specify it separately.
322 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
323 lastarg
="\"$lastarg\""
327 # Add the previous argument to base_compile.
328 if test -z "$base_compile"; then
329 base_compile
="$lastarg"
331 base_compile
="$base_compile $lastarg"
335 case "$user_target" in
339 # Get the name of the library object.
340 libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
343 $echo "$modename: you must specify a target with \`-o'" 1>&2
348 # Recognize several different file suffixes.
349 # If the user specifies -o file.o, it is replaced with file.lo
364 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
367 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
369 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
374 if test -z "$base_compile"; then
375 $echo "$modename: you must specify a compilation command" 1>&2
380 # Delete any leftover library objects.
381 if test "$build_old_libs" = yes; then
382 removelist
="$obj $libobj"
388 trap "$run $rm $removelist; exit 1" 1 2 15
390 # Calculate the filename of the output object if compiler does
391 # not support -o with -c
392 if test "$compiler_c_o" = no
; then
393 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.
${objext}
394 lockfile
="$output_obj.lock"
395 removelist
="$removelist $output_obj $lockfile"
396 trap "$run $rm $removelist; exit 1" 1 2 15
402 # Lock this critical section if it is needed
403 # We use this script file to make the link, it avoids creating a new file
404 if test "$need_locks" = yes; then
405 until ln "$0" "$lockfile" 2>/dev
/null
; do
406 $show "Waiting for $lockfile to be removed"
409 elif test "$need_locks" = warn
; then
410 if test -f "$lockfile"; then
412 *** ERROR, $lockfile exists and contains:
413 `cat $lockfile 2>/dev/null`
415 This indicates that another process is trying to use the same
416 temporary object file, and libtool could not work around it because
417 your compiler does not support \`-c' and \`-o' together. If you
418 repeat this compilation, it may succeed, by chance, but you had better
419 avoid parallel builds (make -j) in this platform, or get a better
425 echo $srcfile > "$lockfile"
428 if test -n "$fix_srcfile_path"; then
429 eval srcfile
=\"$fix_srcfile_path\"
432 # Only build a PIC object if we are building libtool libraries.
433 if test "$build_libtool_libs" = yes; then
434 # Without this assignment, base_compile gets emptied.
435 fbsd_hideous_sh_bug
=$base_compile
437 # All platforms use -DPIC, to notify preprocessed assembler code.
438 command="$base_compile $pic_flag -DPIC $srcfile"
439 if test "$build_old_libs" = yes; then
441 dir
=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
442 if test "X$dir" = "X$libobj"; then
447 libobj
="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
449 if test -d "$dir"; then
456 if test $status -ne 0 && test ! -d $dir; then
461 if test "$compiler_o_lo" = yes; then
463 command="$command -o $output_obj"
464 elif test "$compiler_c_o" = yes; then
466 command="$command -o $output_obj"
469 $run $rm "$output_obj"
471 if $run eval "$command"; then :
473 test -n "$output_obj" && $run $rm $removelist
477 if test "$need_locks" = warn
&&
478 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
480 *** ERROR, $lockfile contains:
481 `cat $lockfile 2>/dev/null`
483 but it should contain:
486 This indicates that another process is trying to use the same
487 temporary object file, and libtool could not work around it because
488 your compiler does not support \`-c' and \`-o' together. If you
489 repeat this compilation, it may succeed, by chance, but you had better
490 avoid parallel builds (make -j) in this platform, or get a better
497 # Just move the object if needed, then go on to compile the next one
498 if test x
"$output_obj" != x
"$libobj"; then
499 $show "$mv $output_obj $libobj"
500 if $run $mv $output_obj $libobj; then :
508 # If we have no pic_flag, then copy the object into place and finish.
509 if test -z "$pic_flag" && test "$build_old_libs" = yes; then
510 # Rename the .lo from within objdir to obj
511 if test -f $obj; then
516 $show "$mv $libobj $obj"
517 if $run $mv $libobj $obj; then :
524 # Now arrange that obj and lo_libobj become the same file
525 $show "$LN_S $obj $lo_libobj"
526 if $run $LN_S $obj $lo_libobj; then
535 # Allow error messages only from the first compilation.
536 suppress_output
=' >/dev/null 2>&1'
539 # Only build a position-dependent object if we build old libraries.
540 if test "$build_old_libs" = yes; then
541 command="$base_compile $srcfile"
542 if test "$compiler_c_o" = yes; then
543 command="$command -o $obj"
547 # Suppress compiler output if we already did a PIC compilation.
548 command="$command$suppress_output"
549 $run $rm "$output_obj"
551 if $run eval "$command"; then :
557 if test "$need_locks" = warn
&&
558 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
560 *** ERROR, $lockfile contains:
561 `cat $lockfile 2>/dev/null`
563 but it should contain:
566 This indicates that another process is trying to use the same
567 temporary object file, and libtool could not work around it because
568 your compiler does not support \`-c' and \`-o' together. If you
569 repeat this compilation, it may succeed, by chance, but you had better
570 avoid parallel builds (make -j) in this platform, or get a better
577 # Just move the object if needed
578 if test x
"$output_obj" != x
"$obj"; then
579 $show "$mv $output_obj $obj"
580 if $run $mv $output_obj $obj; then :
588 # Create an invalid libtool object if no PIC, so that we do not
589 # accidentally link it into a program.
590 if test "$build_libtool_libs" != yes; then
591 $show "echo timestamp > $libobj"
592 $run eval "echo timestamp > \$libobj" ||
exit $?
594 # Move the .lo from within objdir
595 $show "$mv $libobj $lo_libobj"
596 if $run $mv $libobj $lo_libobj; then :
605 # Unlock the critical section if it was locked
606 if test "$need_locks" != no
; then
615 modename
="$modename: link"
617 *-*-cygwin* |
*-*-mingw* |
*-*-os2*)
618 # It is impossible to link a dll without this setting, and
619 # we shouldn't force the makefile maintainer to figure out
620 # which system we are compiling for in order to pass an extra
621 # flag for every libtool invokation.
624 # FIXME: Unfortunately, there are problems with the above when trying
625 # to make a dll which has undefined symbols, in which case not
626 # even a static library is built. For now, we need to specify
627 # -no-undefined on the libtool link line when we can be certain
628 # that all symbols are satisfied, otherwise we get a static library.
631 # This is a source program that is used to create dlls on Windows
632 # Don't remove nor modify the starting and closing comments
633 # /* ltdll.c starts here */
634 # #define WIN32_LEAN_AND_MEAN
635 # #include <windows.h>
636 # #undef WIN32_LEAN_AND_MEAN
642 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
647 # #include <cygwin/cygwin_dll.h>
648 # DECLARE_CYGWIN_DLL( DllMain );
649 # HINSTANCE __hDllInstance_base;
652 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
654 # __hDllInstance_base = hInst;
657 # /* ltdll.c ends here */
658 # This is a source program that is used to create import libraries
659 # on Windows for dlls which lack them. Don't remove nor modify the
660 # starting and closing comments
661 # /* impgen.c starts here */
662 # /* Copyright (C) 1999 Free Software Foundation, Inc.
664 # This file is part of GNU libtool.
666 # This program is free software; you can redistribute it and/or modify
667 # it under the terms of the GNU General Public License as published by
668 # the Free Software Foundation; either version 2 of the License, or
669 # (at your option) any later version.
671 # This program is distributed in the hope that it will be useful,
672 # but WITHOUT ANY WARRANTY; without even the implied warranty of
673 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
674 # GNU General Public License for more details.
676 # You should have received a copy of the GNU General Public License
677 # along with this program; if not, write to the Free Software
678 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
681 # #include <stdio.h> /* for printf() */
682 # #include <unistd.h> /* for open(), lseek(), read() */
683 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
684 # #include <string.h> /* for strdup() */
686 # static unsigned int
687 # pe_get16 (fd, offset)
691 # unsigned char b[2];
692 # lseek (fd, offset, SEEK_SET);
694 # return b[0] + (b[1]<<8);
697 # static unsigned int
698 # pe_get32 (fd, offset)
702 # unsigned char b[4];
703 # lseek (fd, offset, SEEK_SET);
705 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
708 # static unsigned int
712 # unsigned char *b = ptr;
713 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
722 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
723 # unsigned long export_rva, export_size, nsections, secptr, expptr;
724 # unsigned long name_rvas, nexp;
725 # unsigned char *expdata, *erva;
726 # char *filename, *dll_name;
728 # filename = argv[1];
730 # dll = open(filename, O_RDONLY|O_BINARY);
734 # dll_name = filename;
736 # for (i=0; filename[i]; i++)
737 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
738 # dll_name = filename + i +1;
740 # pe_header_offset = pe_get32 (dll, 0x3c);
741 # opthdr_ofs = pe_header_offset + 4 + 20;
742 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
744 # if (num_entries < 1) /* no exports */
747 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
748 # export_size = pe_get32 (dll, opthdr_ofs + 100);
749 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
750 # secptr = (pe_header_offset + 4 + 20 +
751 # pe_get16 (dll, pe_header_offset + 4 + 16));
754 # for (i = 0; i < nsections; i++)
757 # unsigned long secptr1 = secptr + 40 * i;
758 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
759 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
760 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
761 # lseek(dll, secptr1, SEEK_SET);
762 # read(dll, sname, 8);
763 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
765 # expptr = fptr + (export_rva - vaddr);
766 # if (export_rva + export_size > vaddr + vsize)
767 # export_size = vsize - (export_rva - vaddr);
772 # expdata = (unsigned char*)malloc(export_size);
773 # lseek (dll, expptr, SEEK_SET);
774 # read (dll, expdata, export_size);
775 # erva = expdata - export_rva;
777 # nexp = pe_as32 (expdata+24);
778 # name_rvas = pe_as32 (expdata+32);
780 # printf ("EXPORTS\n");
781 # for (i = 0; i<nexp; i++)
783 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
784 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
789 # /* impgen.c ends here */
795 compile_command
="$CC"
796 finalize_command
="$CC"
808 lib_search_path
=`pwd`
816 export_symbols_regex
=
822 prefer_static_libs
=no
834 # We need to know -static, to get the right output filenames.
838 -all-static |
-static)
839 if test "X$arg" = "X-all-static"; then
840 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
841 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
843 if test -n "$link_static_flag"; then
844 dlopen_self
=$dlopen_self_static
847 if test -z "$pic_flag" && test -n "$link_static_flag"; then
848 dlopen_self
=$dlopen_self_static
851 build_libtool_libs
=no
853 prefer_static_libs
=yes
859 # See if our shared archives depend on static archives.
860 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
862 # Go through the arguments, transforming them on the way.
863 while test $# -gt 0; do
867 # If the previous option needs an argument, assign it.
868 if test -n "$prev"; then
871 compile_command
="$compile_command @OUTPUT@"
872 finalize_command
="$finalize_command @OUTPUT@"
878 if test "$preload" = no
; then
879 # Add the symbol object into the linking commands.
880 compile_command
="$compile_command @SYMFILE@"
881 finalize_command
="$finalize_command @SYMFILE@"
885 *.la |
*.lo
) ;; # We handle these cases below.
887 if test "$prev" = dlprefiles
; then
889 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
899 if test "$prev" = dlfiles
; then
900 dlfiles
="$dlfiles $arg"
902 dlprefiles
="$dlprefiles $arg"
909 export_symbols
="$arg"
910 if test ! -f "$arg"; then
911 $echo "$modename: symbol file \`$arg' does not exist"
918 export_symbols_regex
="$arg"
928 # We need an absolute path.
930 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
932 $echo "$modename: only absolute run-paths are allowed" 1>&2
936 if test "$prev" = rpath
; then
939 *) rpath
="$rpath $arg" ;;
944 *) xrpath
="$xrpath $arg" ;;
951 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
953 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
957 compiler_flags
="$compiler_flags $arg"
962 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
964 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
968 linker_flags
="$linker_flags $arg"
969 compiler_flags
="$compiler_flags $wl$arg"
974 eval "$prev=\"\$arg\""
985 if test -n "$link_static_flag"; then
986 compile_command
="$compile_command $link_static_flag"
987 finalize_command
="$finalize_command $link_static_flag"
993 # FIXME: remove this flag sometime in the future.
994 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1018 -export-symbols |
-export-symbols-regex)
1019 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1020 $echo "$modename: not more than one -exported-symbols argument allowed"
1023 if test "X$arg" = "X-export-symbols"; then
1032 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1033 # We need an absolute path.
1035 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1037 absdir
=`cd "$dir" && pwd`
1038 if test -z "$absdir"; then
1039 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1048 deplibs
="$deplibs -L$dir"
1049 lib_search_path
="$lib_search_path $dir"
1053 *-*-cygwin* |
*-*-mingw* |
*-*-os2*)
1054 case ":$dllsearchpath:" in
1056 *) dllsearchpath
="$dllsearchpath:$dir";;
1064 if test "$arg" = "-lc"; then
1066 *-*-cygwin* |
*-*-mingw* |
*-*-os2* |
*-*-beos*)
1067 # These systems don't actually have c library (as such)
1071 elif test "$arg" = "-lm"; then
1073 *-*-cygwin* |
*-*-beos*)
1074 # These systems don't actually have math library (as such)
1079 deplibs
="$deplibs $arg"
1111 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1112 # We need an absolute path.
1114 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1116 $echo "$modename: only absolute run-paths are allowed" 1>&2
1122 *) xrpath
="$xrpath $dir" ;;
1128 # If we have no pic_flag, then this is the same as -all-static.
1129 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1130 compile_command
="$compile_command $link_static_flag"
1131 finalize_command
="$finalize_command $link_static_flag"
1147 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1149 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1153 flag
=`$echo "X$arg" | $Xsed -e 's/^-Wc,//'`
1154 compiler_flags
="$compiler_flags $flag"
1158 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1160 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1164 flag
=`$echo "X$arg" | $Xsed -e 's/^-Wl,//'`
1165 linker_flags
="$linker_flags $flag"
1166 compiler_flags
="$compiler_flags $wl$flag"
1179 # Some other compiler flag.
1181 # Unknown arguments in both finalize_command and compile_command need
1182 # to be aesthetically quoted because they are evaled later.
1183 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1185 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1191 *.o |
*.obj |
*.a |
*.lib
)
1192 # A standard object.
1198 if test "$prev" = dlfiles
; then
1199 dlfiles
="$dlfiles $arg"
1200 if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
1204 # If libtool objects are unsupported, then we need to preload.
1209 if test "$prev" = dlprefiles
; then
1210 # Preload the old-style object.
1211 dlprefiles
="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1214 libobjs
="$libobjs $arg"
1218 # A libtool-controlled library.
1225 # Check to see that this really is a libtool archive.
1226 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1228 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
1232 # If the library was installed with an old release of libtool,
1233 # it will not redefine variable installed.
1237 # If there is no directory component, then add one.
1239 */* |
*\\*) .
$arg ;;
1243 # Get the name of the library we link against.
1245 for l
in $old_library $library_names; do
1249 if test -z "$linklib"; then
1250 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
1254 if test "X$installed" = Xyes
; then
1257 dir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1258 if test "X$dir" = "X$arg"; then
1265 # This library was specified with -dlopen.
1266 if test "$prev" = dlfiles
; then
1267 dlfiles
="$dlfiles $arg"
1268 if test -z "$dlname" ||
test "$dlopen" != yes ||
test "$build_libtool_libs" = no
; then
1269 # If there is no dlname, no dlopen support or we're linking statically,
1270 # we need to preload.
1273 # We should not create a dependency on this library
1279 # The library was specified with -dlpreopen.
1280 if test "$prev" = dlprefiles
; then
1281 # Prefer using a static library (so that no silly _DYNAMIC symbols
1282 # are required to link).
1283 if test -n "$old_library"; then
1284 dlprefiles
="$dlprefiles $dir/$old_library"
1286 dlprefiles
="$dlprefiles $dir/$linklib"
1291 deplibs
="$deplibs $arg"
1295 # Some other compiler argument.
1297 # Unknown arguments in both finalize_command and compile_command need
1298 # to be aesthetically quoted because they are evaled later.
1299 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1301 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1308 # Now actually substitute the argument into the commands.
1309 if test -n "$arg"; then
1310 compile_command
="$compile_command $arg"
1311 finalize_command
="$finalize_command $arg"
1315 if test -n "$prev"; then
1316 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1321 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1322 eval arg
=\"$export_dynamic_flag_spec\"
1323 compile_command
="$compile_command $arg"
1324 finalize_command
="$finalize_command $arg"
1328 # calculate the name of the file, without its directory
1329 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1330 libobjs_save
="$libobjs"
1332 if test -n "$shlibpath_var"; then
1333 # get the directories listed in $shlibpath_var
1334 eval shlib_search_path
=\
`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1338 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
1339 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
1340 lib_search_path
="$lib_search_path $sys_lib_search_path $shlib_search_path"
1344 $echo "$modename: you must specify an output file" 1>&2
1350 if test -n "$deplibs"; then
1351 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1354 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
1355 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1358 if test -n "$rpath"; then
1359 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
1362 if test -n "$xrpath"; then
1363 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
1366 if test -n "$vinfo"; then
1367 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1370 if test -n "$release"; then
1371 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
1374 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1375 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1378 # Now set the variables for building old libraries.
1379 build_libtool_libs
=no
1384 # Make sure we only generate libraries of the form `libNAME.la'.
1385 case "$outputname" in
1387 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1388 eval libname
=\"$libname_spec\"
1391 if test "$module" = no
; then
1392 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
1396 if test "$need_lib_prefix" != no
; then
1397 # Add the "lib" prefix for modules if required
1398 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1399 eval libname
=\"$libname_spec\"
1401 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1406 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1407 if test "X$output_objdir" = "X$output"; then
1408 output_objdir
="$objdir"
1410 output_objdir
="$output_objdir/$objdir"
1413 if test -n "$objs"; then
1414 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1418 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
1419 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1423 if test $# -gt 2; then
1424 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1429 if test -z "$rpath"; then
1430 if test "$build_libtool_libs" = yes; then
1431 # Building a libtool convenience library.
1433 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
1434 build_libtool_libs
=convenience
1438 if test -n "$vinfo"; then
1439 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1442 if test -n "$release"; then
1443 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1447 # Parse the version information argument.
1448 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
1449 set dummy
$vinfo 0 0 0
1452 if test -n "$8"; then
1453 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1462 # Check that each of the things are valid numbers.
1464 0 |
[1-9] |
[1-9][0-9]*) ;;
1466 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1467 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1473 0 |
[1-9] |
[1-9][0-9]*) ;;
1475 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1476 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1482 0 |
[1-9] |
[1-9][0-9]*) ;;
1484 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1485 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1490 if test $age -gt $current; then
1491 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1492 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1496 # Calculate the version variables.
1500 case "$version_type" in
1504 major
=`expr $current - $age + 1`
1505 versuffix
="$major.$revision"
1506 verstring
="sgi$major.$revision"
1508 # Add in all the interfaces that we are compatible with.
1510 while test $loop != 0; do
1511 iface
=`expr $revision - $loop`
1512 loop
=`expr $loop - 1`
1513 verstring
="sgi$major.$iface:$verstring"
1518 major
=.
`expr $current - $age`
1519 versuffix
="$major.$age.$revision"
1523 major
=`expr $current - $age`
1524 versuffix
=".$current.$age.$revision"
1525 verstring
="$current.$age.$revision"
1527 # Add in all the interfaces that we are compatible with.
1529 while test $loop != 0; do
1530 iface
=`expr $current - $loop`
1531 loop
=`expr $loop - 1`
1532 verstring
="$verstring:${iface}.0"
1535 # Make executables depend on our current version.
1536 verstring
="$verstring:${current}.0"
1541 versuffix
=".$current.$revision"
1546 versuffix
=".$current.$revision";
1551 versuffix
=".$current";
1555 # Like Linux, but with '-' rather than '.', since we only
1556 # want one extension on Windows 95.
1557 major
=`expr $current - $age`
1558 versuffix
="-$major-$age-$revision"
1562 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1563 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1568 # Clear the version info if we defaulted, and they specified a release.
1569 if test -z "$vinfo" && test -n "$release"; then
1572 if test "$need_version" = no
; then
1579 # Remove version info from name if versioning should be avoided
1580 if test "$avoid_version" = yes && test "$need_version" = no
; then
1586 # Check to see if the archive will have undefined symbols.
1587 if test "$allow_undefined" = yes; then
1588 if test "$allow_undefined_flag" = unsupported
; then
1589 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1590 build_libtool_libs
=no
1594 # Don't allow undefined symbols.
1595 allow_undefined_flag
="$no_undefined_flag"
1599 # Create the output directory, or remove our outputs if we need to.
1600 if test -d $output_objdir; then
1601 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
1602 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.
*
1604 $show "$mkdir $output_objdir"
1605 $run $mkdir $output_objdir
1607 if test $status -ne 0 && test ! -d $output_objdir; then
1612 # Now set the variables for building old libraries.
1613 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
1614 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
1616 # Transform .lo files to .o files.
1617 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
1620 # Save some variables
1622 libname_save
=$libname
1624 # Find libtool libraries and add their dependencies and directories
1625 old_deplibs
="$deplibs"
1626 deplibs
= # libraries to link (used in archive_cmds)
1627 newdependency_libs
= # all dependency libraries
1628 uninst_path
= # paths that contain uninstalled libtool libraries
1629 new_lib_search_path
=
1630 for deplib
in $old_deplibs; do
1637 deplibs
="$deplibs $deplib"
1638 newdependency_libs
="$newdependency_libs $deplib"
1639 new_lib_search_path
="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1645 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1647 for searchdir
in $lib_search_path; do
1648 # Search the libtool library
1649 lib
="$searchdir/lib${name}.la"
1650 if test -f "$lib"; then
1655 if test "$found" != yes; then
1656 deplibs
="$deplibs $deplib"
1657 newdependency_libs
="$newdependency_libs $deplib"
1663 if test -f "$lib"; then :
1665 $echo "$modename: cannot find the library \`$lib'" 1>&2
1675 # Check to see that this really is a libtool archive.
1676 if (sed -e '2q' $lib |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1678 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1682 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1683 test "X$ladir" = "X$lib" && ladir
="."
1684 # We need an absolute path.
1686 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
1688 abs_ladir
=`cd "$ladir" && pwd`
1689 if test -z "$abs_ladir"; then
1690 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1691 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1696 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1698 # If the library was installed with an old release of libtool,
1699 # it will not redefine variable installed.
1704 */* |
*\\*) .
$lib ;;
1708 # Get the name of the library we link against.
1710 for l
in $old_library $library_names; do
1714 if test -z "$linklib"; then
1715 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1719 if test -z "$libdir"; then
1720 # It is a libtool convenience library, so add in its objects.
1721 convenience
="$convenience $ladir/$objdir/$old_library"
1722 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
1723 deplibs
="$deplibs $ladir/$objdir/$old_library"
1724 newdependency_libs
="$newdependency_libs $dependency_libs"
1728 # Find the relevant object directory and library name.
1729 if test "X$installed" = Xyes
; then
1730 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1731 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1740 dir
="$ladir/$objdir"
1741 absdir
="$abs_ladir/$objdir"
1742 # Remove this search path later
1743 uninst_path
="$uninst_path $abs_ladir"
1745 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1746 link_static
=no
# Whether this library is linked statically
1748 if test -n "$library_names" &&
1749 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
1750 # This is a shared library
1751 if test -n "$old_archive_from_expsyms_cmds"; then
1752 # figure out the soname
1753 set dummy
$library_names
1756 libname
=`eval \\$echo \"$libname_spec\"`
1757 if test -n "$soname_spec"; then
1758 eval soname
=\"$soname_spec\"
1763 # Make a new name for the extract_expsyms_cmds to use
1764 newlib
="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
1766 # If the library has no export list, then create one now
1767 if test -f "$output_objdir/$soname-def"; then :
1769 $show "extracting exported symbol list from \`$soname'"
1770 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
1771 eval cmds
=\"$extract_expsyms_cmds\"
1772 for cmd
in $cmds; do
1775 $run eval "$cmd" ||
exit $?
1781 if test -f "$output_objdir/$newlib"; then :; else
1782 $show "generating import library for \`$soname'"
1783 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
1784 eval cmds
=\"$old_archive_from_expsyms_cmds\"
1785 for cmd
in $cmds; do
1788 $run eval "$cmd" ||
exit $?
1792 # make sure the library variables are pointing to the new library
1801 case "$hardcode_action" in
1802 immediate | unsupported
)
1803 if test "$hardcode_direct" = no
; then
1804 deplibs
="$deplibs $dir/$linklib"
1805 elif test "$hardcode_minus_L" = no
; then
1807 *-*-sunos*) add_shlibpath
="$dir" ;;
1811 elif test "$hardcode_shlibpath_var" = no
; then
1812 add_shlibpath
="$dir"
1819 if test "$hardcode_direct" = yes; then
1820 deplibs
="$deplibs $dir/$linklib"
1821 elif test "$hardcode_minus_L" = yes; then
1824 elif test "$hardcode_shlibpath_var" = yes; then
1825 add_shlibpath
="$dir"
1834 if test "$lib_linked" != yes; then
1835 $echo "$modename: configuration error: unsupported hardcode properties"
1838 if test -n "$add_shlibpath"; then
1839 case ":$compile_shlibpath:" in
1840 *":$add_shlibpath:"*) ;;
1841 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
1844 if test -n "$add_dir"; then
1847 *) deplibs
="$deplibs $add_dir" ;;
1850 test "$add_name" = yes && deplibs
="$deplibs -l$name"
1851 elif test "$build_libtool_libs" = yes; then
1852 # Not a shared library
1853 if test "$deplibs_check_method" != pass_all
; then
1854 # We're trying link a shared library against a static one
1855 # but the system doesn't support it.
1856 # Just print a warning and add the library to dependency_libs so
1857 # that the program can be linked against the static library.
1859 echo "*** Warning: This library needs some functionality provided by $libname."
1860 echo "*** I have the capability to make that library automatically link in when"
1861 echo "*** you link to this library. But I can only do this if you have a"
1862 echo "*** shared version of the library, which you do not appear to have."
1864 convenience
="$convenience $dir/$old_library"
1865 old_convenience
="$old_convenience $dir/$old_library"
1866 deplibs
="$deplibs $dir/$old_library"
1871 if test -n "$dependency_libs"; then
1872 # Extract -R from dependency_libs
1874 for libdir
in $dependency_libs; do
1876 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
1878 *" $temp_xrpath "*) ;;
1879 *) xrpath
="$xrpath $temp_xrpath";;
1881 *) temp_deplibs
="$temp_deplibs $libdir";;
1884 dependency_libs
="$temp_deplibs"
1887 new_lib_search_path
="$new_lib_search_path $absdir"
1888 # Link against this library
1889 test "$link_static" = no
&& newdependency_libs
="$newdependency_libs $abs_ladir/$laname"
1890 # ... and its dependency_libs
1891 newdependency_libs
="$newdependency_libs $dependency_libs"
1894 # Make sure lib_search_path contains only unique directories.
1896 for dir
in $new_lib_search_path; do
1897 case "$lib_search_path " in
1899 *) lib_search_path
="$lib_search_path $dir" ;;
1902 lib_search_path
="$lib_search_path $sys_lib_search_path"
1904 # Make sure newdependency_libs contains only unique libraries and directories.
1906 for deplib
in $newdependency_libs; do
1907 case "$dependency_libs " in
1909 *) dependency_libs
="$dependency_libs $deplib" ;;
1913 # Eliminate all temporary directories.
1914 for path
in $uninst_path; do
1915 lib_search_path
=`echo "$lib_search_path " | sed -e 's% $path % %g'`
1916 deplibs
=`echo "$deplibs " | sed -e 's% -L$path % %g'`
1917 dependency_libs
=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
1920 if test -n "$xrpath"; then
1921 # If the user specified any rpath flags, then add them.
1923 for libdir
in $xrpath; do
1924 temp_xrpath
="$temp_xrpath -R$libdir"
1925 case "$compile_rpath " in
1927 *) compile_rpath
="$compile_rpath $libdir" ;;
1929 case "$finalize_rpath " in
1931 *) finalize_rpath
="$finalize_rpath $libdir" ;;
1934 dependency_libs
="$temp_xrpath $dependency_libs"
1937 # Restore the variables
1938 libname
=$libname_save
1941 if test "$build_libtool_libs" = yes; then
1942 if test -n "$rpath"; then
1944 *-*-cygwin* |
*-*-mingw* |
*-*-os2* |
*-*-beos*)
1945 # these systems don't actually have a c library (as such)!
1948 # Add libc to deplibs on all other systems.
1949 deplibs
="$deplibs -lc"
1954 # Transform deplibs into only deplibs that can be linked in shared.
1956 libname_save
=$libname
1957 release_save
=$release
1958 versuffix_save
=$versuffix
1960 # I'm not sure if I'm treating the release correctly. I think
1961 # release should show up in the -l (ie -lgmp5) so we don't want to
1962 # add it in twice. Is that correct?
1968 case "$deplibs_check_method" in
1970 # Don't check for shared/static. Everything works.
1971 # This might be a little naive. We might want to check
1972 # whether the library exists or not. But this is on
1973 # osf3 & osf4 and I'm not really sure... Just
1974 # implementing what was already the behaviour.
1978 # This code stresses the "libraries are programs" paradigm to its
1979 # limits. Maybe even breaks it. We compile a program, linking it
1980 # against the deplibs as a proxy for the library. Then we can check
1981 # whether they linked in statically or dynamically with ldd.
1983 cat > conftest.c
<<EOF
1984 int main() { return 0; }
1987 $CC -o conftest conftest.c
$deplibs
1988 if test $?
-eq 0 ; then
1989 ldd_output
=`ldd conftest`
1990 for i
in $deplibs; do
1991 name
="`expr $i : '-l\(.*\)'`"
1992 # If $name is empty we are operating on a -L argument.
1993 if test "$name" != "" ; then
1994 libname
=`eval \\$echo \"$libname_spec\"`
1995 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
1996 set dummy
$deplib_matches
1998 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1999 newdeplibs
="$newdeplibs $i"
2003 echo "*** Warning: This library needs some functionality provided by $i."
2004 echo "*** I have the capability to make that library automatically link in when"
2005 echo "*** you link to this library. But I can only do this if you have a"
2006 echo "*** shared version of the library, which you do not appear to have."
2009 newdeplibs
="$newdeplibs $i"
2013 # Error occured in the first compile. Let's try to salvage the situation:
2014 # Compile a seperate program for each library.
2015 for i
in $deplibs; do
2016 name
="`expr $i : '-l\(.*\)'`"
2017 # If $name is empty we are operating on a -L argument.
2018 if test "$name" != "" ; then
2020 $CC -o conftest conftest.c
$i
2022 if test $?
-eq 0 ; then
2023 ldd_output
=`ldd conftest`
2024 libname
=`eval \\$echo \"$libname_spec\"`
2025 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
2026 set dummy
$deplib_matches
2028 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2029 newdeplibs
="$newdeplibs $i"
2033 echo "*** Warning: This library needs some functionality provided by $i."
2034 echo "*** I have the capability to make that library automatically link in when"
2035 echo "*** you link to this library. But I can only do this if you have a"
2036 echo "*** shared version of the library, which you do not appear to have."
2041 echo "*** Warning! Library $i is needed by this library but I was not able to"
2042 echo "*** make it link in! You will probably need to install it or some"
2043 echo "*** library that it depends on before this library will be fully"
2044 echo "*** functional. Installing it before continuing would be even better."
2047 newdeplibs
="$newdeplibs $i"
2053 set dummy
$deplibs_check_method
2054 file_magic_regex
="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
2055 for a_deplib
in $deplibs; do
2056 name
="`expr $a_deplib : '-l\(.*\)'`"
2057 # If $name is empty we are operating on a -L argument.
2058 if test "$name" != "" ; then
2059 libname
=`eval \\$echo \"$libname_spec\"`
2060 for i
in $lib_search_path; do
2061 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
2062 for potent_lib
in $potential_libs; do
2063 # Follow soft links.
2064 if ls -lLd "$potent_lib" 2>/dev
/null \
2065 |
grep " -> " >/dev
/null
; then
2068 # The statement above tries to avoid entering an
2069 # endless loop below, in case of cyclic links.
2070 # We might still enter an endless loop, since a link
2071 # loop can be closed while we follow links,
2073 potlib
="$potent_lib"
2074 while test -h "$potlib" 2>/dev
/null
; do
2075 potliblink
=`ls -ld $potlib | sed 's/.* -> //'`
2076 case "$potliblink" in
2077 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
2078 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2081 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
2083 |
egrep "$file_magic_regex" > /dev
/null
; then
2084 newdeplibs
="$newdeplibs $a_deplib"
2090 if test -n "$a_deplib" ; then
2093 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2094 echo "*** I have the capability to make that library automatically link in when"
2095 echo "*** you link to this library. But I can only do this if you have a"
2096 echo "*** shared version of the library, which you do not appear to have."
2099 # Add a -L argument.
2100 newdeplibs
="$newdeplibs $a_deplib"
2102 done # Gone through all deplibs.
2106 if $echo "X $deplibs" |
$Xsed -e 's/ -lc$//' \
2107 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2108 grep .
>/dev
/null
; then
2110 if test "X$deplibs_check_method" = "Xnone"; then
2111 echo "*** Warning: inter-library dependencies are not supported in this platform."
2113 echo "*** Warning: inter-library dependencies are not known to be supported."
2115 echo "*** All declared inter-library dependencies are being dropped."
2120 versuffix
=$versuffix_save
2122 release
=$release_save
2123 libname
=$libname_save
2126 if test "$droppeddeps" = yes; then
2127 if test "$module" = yes; then
2129 echo "*** Warning: libtool could not satisfy all declared inter-library"
2130 echo "*** dependencies of module $libname. Therefore, libtool will create"
2131 echo "*** a static module, that should work as long as the dlopening"
2132 echo "*** application is linked with the -dlopen flag."
2133 if test -z "$global_symbol_pipe"; then
2135 echo "*** However, this would only work if libtool was able to extract symbol"
2136 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2137 echo "*** not find such a program. So, this module is probably useless."
2138 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2140 if test "$build_old_libs" = no
; then
2141 oldlibs
="$output_objdir/$libname.$libext"
2142 build_libtool_libs
=module
2145 build_libtool_libs
=no
2148 echo "*** The inter-library dependencies that have been dropped here will be"
2149 echo "*** automatically added whenever a program is linked with this library"
2150 echo "*** or is declared to -dlopen it."
2153 # Done checking deplibs!
2157 # All the library-specific variables (install_libdir is set above).
2162 # Test again, we may have decided not to build it any more
2163 if test "$build_libtool_libs" = yes; then
2164 if test -n "$compile_shlibpath"; then
2165 eval "$shlibpath_var='$compile_shlibpath\$$shlibpath_var'; export $shlibpath_var"
2168 # Get the real and link names of the library.
2169 eval library_names
=\"$library_names_spec\"
2170 set dummy
$library_names
2174 if test -n "$soname_spec"; then
2175 eval soname
=\"$soname_spec\"
2180 lib
="$output_objdir/$realname"
2183 linknames
="$linknames $link"
2186 # Ensure that we have .o objects for linkers which dislike .lo
2187 # (e.g. aix) incase we are running --disable-static
2188 for obj
in $libobjs; do
2189 oldobj
=`$echo "X$obj" | $Xsed -e "$lo2o"`
2190 if test ! -f $oldobj; then
2191 $show "${LN_S} $obj $oldobj"
2192 $run ${LN_S} $obj $oldobj ||
exit $?
2196 # Use standard objects if they are pic
2197 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2199 # Prepare the list of exported symbols
2200 if test -z "$export_symbols"; then
2201 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
2202 $show "generating symbol list for \`$libname.la'"
2203 export_symbols
="$output_objdir/$libname.exp"
2204 $run $rm $export_symbols
2205 eval cmds
=\"$export_symbols_cmds\"
2206 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2207 for cmd
in $cmds; do
2210 $run eval "$cmd" ||
exit $?
2213 if test -n "$export_symbols_regex"; then
2214 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2215 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2216 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2217 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2222 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2223 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2226 if test -n "$convenience"; then
2227 if test -n "$whole_archive_flag_spec"; then
2228 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
2230 gentop
="$output_objdir/${outputname}x"
2231 $show "${rm}r $gentop"
2232 $run ${rm}r
"$gentop"
2233 $show "mkdir $gentop"
2234 $run mkdir
"$gentop"
2236 if test $status -ne 0 && test ! -d "$gentop"; then
2239 generated
="$generated $gentop"
2241 for xlib
in $convenience; do
2242 # Extract the objects.
2244 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
2245 *) xabs
=`pwd`"/$xlib" ;;
2247 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2248 xdir
="$gentop/$xlib"
2250 $show "${rm}r $xdir"
2255 if test $status -ne 0 && test ! -d "$xdir"; then
2258 $show "(cd $xdir && $AR x $xabs)"
2259 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
2261 libobjs
="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2266 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2267 eval flag
=\"$thread_safe_flag_spec\"
2268 linker_flags
="$linker_flags $flag"
2271 # Do each of the archive commands.
2272 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2273 eval cmds
=\"$archive_expsym_cmds\"
2275 eval cmds
=\"$archive_cmds\"
2277 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2278 for cmd
in $cmds; do
2281 $run eval "$cmd" ||
exit $?
2285 # Create links to the real library.
2286 for linkname
in $linknames; do
2287 if test "$realname" != "$linkname"; then
2288 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2289 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
2293 # If -module or -export-dynamic was specified, set the dlname.
2294 if test "$module" = yes ||
test "$export_dynamic" = yes; then
2295 # On all known operating systems, these are identical.
2302 if test -n "$deplibs"; then
2303 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2306 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2307 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2310 if test -n "$rpath"; then
2311 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2314 if test -n "$xrpath"; then
2315 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2318 if test -n "$vinfo"; then
2319 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2322 if test -n "$release"; then
2323 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2328 if test -n "$objs"; then
2329 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2333 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
2341 # Delete the old objects.
2342 $run $rm $obj $libobj
2344 # Create the old-style object.
2345 reload_objs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
2348 eval cmds
=\"$reload_cmds\"
2349 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2350 for cmd
in $cmds; do
2353 $run eval "$cmd" ||
exit $?
2357 # Exit if we aren't doing a library object file.
2358 test -z "$libobj" && exit 0
2360 if test "$build_libtool_libs" != yes; then
2361 # Create an invalid libtool object if no PIC, so that we don't
2362 # accidentally link it into a program.
2363 $show "echo timestamp > $libobj"
2364 $run eval "echo timestamp > $libobj" ||
exit $?
2368 if test -n "$pic_flag"; then
2369 # Only do commands if we really have different PIC objects.
2370 reload_objs
="$libobjs"
2372 eval cmds
=\"$reload_cmds\"
2373 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2374 for cmd
in $cmds; do
2377 $run eval "$cmd" ||
exit $?
2381 # Just create a symlink.
2384 $show "$LN_S $obj $libobj"
2385 $run $LN_S $obj $libobj ||
exit $?
2391 # Anything else should be a program.
2393 if test -n "$vinfo"; then
2394 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2397 if test -n "$release"; then
2398 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2401 if test "$preload" = yes; then
2402 if test "$dlopen" = unknown
&& test "$dlopen_self" = unknown
&&
2403 test "$dlopen_self_static" = unknown
; then
2404 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2408 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2409 if test "X$output_objdir" = "X$output"; then
2410 output_objdir
="$objdir"
2412 output_objdir
="$output_objdir/$objdir"
2415 # Create the binary in the object directory, then wrap it.
2416 if test ! -d $output_objdir; then
2417 $show "$mkdir $output_objdir"
2418 $run $mkdir $output_objdir
2420 if test $status -ne 0 && test ! -d $output_objdir; then
2425 # Find libtool libraries and add their dependencies
2426 old_deplibs
="$deplibs"
2429 new_lib_search_path
=
2430 for deplib
in $old_deplibs; do
2434 deplibs
="$deplibs $deplib"
2435 new_lib_search_path
="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2439 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2441 for searchdir
in $lib_search_path; do
2442 # Search the libtool library
2443 lib
="$searchdir/lib${name}.la"
2444 if test -f "$lib"; then
2449 if test "$found" != yes; then
2450 deplibs
="$deplibs $deplib"
2456 if test -f "$lib"; then :
2458 $echo "$modename: cannot find the library \`$lib'" 1>&2
2468 # Check to see that this really is a libtool archive.
2469 if (sed -e '2q' $lib |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2471 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2475 # If the library was installed with an old release of libtool,
2476 # it will not redefine variable installed.
2481 */* |
*\\*) .
$lib ;;
2485 # Get the name of the library we link against.
2487 for l
in $old_library $library_names; do
2491 if test -z "$linklib"; then
2492 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2496 new_lib_search_path
="$new_lib_search_path `$echo "X
$lib" | $Xsed -e 's%/[^/]*$%%'`"
2497 deplibs
="$deplibs $lib"
2499 for deplib
in $dependency_libs; do
2502 new_lib_search_path
="$new_lib_search_path `$echo "X
$deplib" | $Xsed -e 's/^-L//'`"
2506 if test "$link_all_deplibs" != no || \
2507 test "$fast_install" != no || \
2508 test "$build_libtool_libs" = no || \
2509 test -z "$library_names"; then
2510 # Need to link against all dependency_libs
2511 deplibs
="$deplibs $deplib"
2513 # Need to hardcode shared library paths
2514 # or/and link against static libraries
2515 newdependency_libs
="$newdependency_libs $deplib"
2520 # Eliminate all dependency_libs that are already contained in deplibs
2522 for deplib
in $newdependency_libs; do
2525 *) dependency_libs
="$dependency_libs $deplib" ;;
2529 # Make sure lib_search_path contains only unique directories.
2531 for dir
in $new_lib_search_path; do
2532 case "$lib_search_path " in
2534 *) lib_search_path
="$lib_search_path $dir" ;;
2537 lib_search_path
="$lib_search_path $sys_lib_search_path"
2539 # Find libtool libraries and add their directories
2541 link_against_libtool_libs
=
2543 for deplib
in $deplibs @DEPLIBS@
$dependency_libs; do
2547 compile_command
="$compile_command $deplib"
2548 finalize_command
="$finalize_command $deplib"
2552 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2553 # Make sure the xrpath contains only unique directories.
2556 *) xrpath
="$xrpath $dir" ;;
2565 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2567 for searchdir
in $lib_search_path; do
2568 # Search the libtool library
2569 lib
="$searchdir/lib${name}.la"
2570 if test -f "$lib"; then
2575 if test "$found" != yes; then
2576 compile_command
="$compile_command $deplib"
2577 finalize_command
="$finalize_command $deplib"
2583 if test -f "$lib"; then :
2585 $echo "$modename: cannot find the library \`$lib'" 1>&2
2595 # Check to see that this really is a libtool archive.
2596 if (sed -e '2q' $lib |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2598 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2602 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2603 test "X$ladir" = "X$lib" && ladir
="."
2604 # We need an absolute path.
2606 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2608 abs_ladir
=`cd "$ladir" && pwd`
2609 if test -z "$abs_ladir"; then
2610 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2611 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2616 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2618 # If the library was installed with an old release of libtool,
2619 # it will not redefine variable installed.
2624 */* |
*\\*) .
$lib ;;
2628 # Get the name of the library we link against.
2630 for l
in $old_library $library_names; do
2634 if test -z "$linklib"; then
2635 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2639 # Find the relevant object directory and library name.
2640 if test "X$installed" = Xyes
; then
2641 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2642 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2651 dir
="$ladir/$objdir"
2652 absdir
="$abs_ladir/$objdir"
2654 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2656 if test -n "$library_names" &&
2657 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2658 # We need to hardcode the library path
2659 if test -n "$shlibpath_var"; then
2660 # Make sure the rpath contains only unique directories.
2661 case "$temp_rpath " in
2664 *) temp_rpath
="$temp_rpath $dir" ;;
2668 # Hardcode the library path.
2669 # Skip directories that are in the system default run-time
2671 case " $sys_lib_dlsearch_path " in
2674 case "$compile_rpath " in
2676 *) compile_rpath
="$compile_rpath $absdir"
2681 case " $sys_lib_dlsearch_path " in
2684 case "$finalize_rpath " in
2686 *) finalize_rpath
="$finalize_rpath $libdir"
2692 if test "$alldeplibs" = yes &&
2693 { test "$deplibs_check_method" = pass_all ||
2694 { test "$build_libtool_libs" = yes &&
2695 test -n "$library_names"; }; }; then
2696 # Do we only need to link against static libraries?
2700 if test -z "$libdir"; then
2701 # It is a libtool convenience library, so add in its objects.
2702 convenience
="$convenience $dir/$old_library"
2703 old_convenience
="$old_convenience $dir/$old_library"
2704 compile_command
="$compile_command $dir/$old_library"
2705 finalize_command
="$finalize_command $dir/$old_library"
2709 if test -n "$library_names" &&
2710 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2711 link_against_libtool_libs
="$link_against_libtool_libs $lib"
2713 if test -n "$old_archive_from_expsyms_cmds"; then
2714 # figure out the soname
2715 set dummy
$library_names
2718 libname
=`eval \\$echo \"$libname_spec\"`
2719 if test -n "$soname_spec"; then
2720 eval soname
=\"$soname_spec\"
2725 # Make a new name for the extract_expsyms_cmds to use
2726 newlib
="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2728 # If the library has no export list, then create one now
2729 if test -f "$output_objdir/$soname-def"; then :
2731 $show "extracting exported symbol list from \`$soname'"
2732 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2733 eval cmds
=\"$extract_expsyms_cmds\"
2734 for cmd
in $cmds; do
2737 $run eval "$cmd" ||
exit $?
2743 if test -f "$output_objdir/$newlib"; then :; else
2744 $show "generating import library for \`$soname'"
2745 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2746 eval cmds
=\"$old_archive_from_expsyms_cmds\"
2747 for cmd
in $cmds; do
2750 $run eval "$cmd" ||
exit $?
2754 # make sure the library variables are pointing to the new library
2763 case "$hardcode_action" in
2764 immediate | unsupported
)
2765 if test "$hardcode_direct" = no
; then
2766 compile_command
="$compile_command $dir/$linklib"
2767 elif test "$hardcode_minus_L" = no
; then
2769 *-*-sunos*) add_shlibpath
="$dir" ;;
2773 elif test "$hardcode_shlibpath_var" = no
; then
2774 add_shlibpath
="$dir"
2782 if test "$hardcode_direct" = yes; then
2783 compile_command
="$compile_command $absdir/$linklib"
2784 elif test "$hardcode_minus_L" = yes; then
2787 elif test "$hardcode_shlibpath_var" = yes; then
2788 add_shlibpath
="$absdir"
2798 if test "$lib_linked" != yes; then
2799 $echo "$modename: configuration error: unsupported hardcode properties"
2802 if test -n "$add_dir"; then
2803 case "$compile_command " in
2805 *) compile_command
="$compile_command $add_dir" ;;
2808 if test -n "$add_shlibpath"; then
2809 case ":$compile_shlibpath:" in
2810 *":$add_shlibpath:"*) ;;
2811 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2814 test "$add_name" = yes && compile_command
="$compile_command -l$name"
2818 # Finalize command for both is simple: just hardcode it.
2819 if test "$hardcode_direct" = yes; then
2820 finalize_command
="$finalize_command $libdir/$linklib"
2821 elif test "$hardcode_minus_L" = yes; then
2824 elif test "$hardcode_shlibpath_var" = yes; then
2825 case ":$finalize_shlibpath:" in
2827 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2831 # We cannot seem to hardcode it, guess we'll fake it.
2835 if test -n "$add_dir"; then
2836 case "$finalize_command " in
2838 *) finalize_command
="$finalize_command $add_dir" ;;
2841 test "$add_name" = yes && finalize_command
="$finalize_command -l$name"
2843 # Here we assume that one of hardcode_direct or hardcode_minus_L
2844 # is not unsupported. This is valid on all known static and
2846 if test "$hardcode_direct" != unsupported
; then
2847 test -n "$old_library" && linklib
="$old_library"
2848 compile_command
="$compile_command $dir/$linklib"
2849 finalize_command
="$finalize_command $dir/$linklib"
2851 case "$compile_command " in
2853 *) compile_command
="$compile_command -L$dir";;
2855 compile_command
="$compile_command -l$name"
2856 case "$finalize_command " in
2858 *) finalize_command
="$finalize_command -L$dir";;
2860 finalize_command
="$finalize_command -l$name"
2865 if test -n "$rpath$xrpath"; then
2866 # If the user specified any rpath flags, then add them.
2867 for libdir
in $rpath $xrpath; do
2868 # This is the magic to use -rpath.
2869 case "$compile_rpath " in
2871 *) compile_rpath
="$compile_rpath $libdir" ;;
2873 case "$finalize_rpath " in
2875 *) finalize_rpath
="$finalize_rpath $libdir" ;;
2880 # Now hardcode the library paths
2883 for libdir
in $compile_rpath $finalize_rpath; do
2884 if test -n "$hardcode_libdir_flag_spec"; then
2885 if test -n "$hardcode_libdir_separator"; then
2886 if test -z "$hardcode_libdirs"; then
2887 hardcode_libdirs
="$libdir"
2889 # Just accumulate the unique libdirs.
2890 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2891 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2894 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2899 eval flag
=\"$hardcode_libdir_flag_spec\"
2900 rpath
="$rpath $flag"
2902 elif test -n "$runpath_var"; then
2903 case "$perm_rpath " in
2905 *) perm_rpath
="$perm_rpath $libdir" ;;
2909 *-*-cygwin* |
*-*-mingw* |
*-*-os2*)
2910 case ":$dllsearchpath:" in
2912 *) dllsearchpath
="$dllsearchpath:$libdir";;
2917 # Substitute the hardcoded libdirs into the rpath.
2918 if test -n "$hardcode_libdir_separator" &&
2919 test -n "$hardcode_libdirs"; then
2920 libdir
="$hardcode_libdirs"
2921 eval rpath
=\" $hardcode_libdir_flag_spec\"
2923 compile_rpath
="$rpath"
2927 for libdir
in $finalize_rpath; do
2928 if test -n "$hardcode_libdir_flag_spec"; then
2929 if test -n "$hardcode_libdir_separator"; then
2930 if test -z "$hardcode_libdirs"; then
2931 hardcode_libdirs
="$libdir"
2933 # Just accumulate the unique libdirs.
2934 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2935 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2938 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2943 eval flag
=\"$hardcode_libdir_flag_spec\"
2944 rpath
="$rpath $flag"
2946 elif test -n "$runpath_var"; then
2947 case "$finalize_perm_rpath " in
2949 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
2953 # Substitute the hardcoded libdirs into the rpath.
2954 if test -n "$hardcode_libdir_separator" &&
2955 test -n "$hardcode_libdirs"; then
2956 libdir
="$hardcode_libdirs"
2957 eval rpath
=\" $hardcode_libdir_flag_spec\"
2959 finalize_rpath
="$rpath"
2961 if test -n "$libobjs" && test "$build_old_libs" = yes; then
2962 # Transform all the library objects into standard objects.
2963 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2964 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2968 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" = yes; then
2969 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2970 dlsyms
="${outputname}S.c"
2972 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
2976 if test -n "$dlsyms"; then
2980 # Discover the nlist of each of the dlfiles.
2981 nlist
="$output_objdir/${outputname}.nm"
2983 $show "$rm $nlist ${nlist}S ${nlist}T"
2984 $run $rm "$nlist" "${nlist}S" "${nlist}T"
2986 # Parse the name list into a source file.
2987 $show "creating $output_objdir/$dlsyms"
2989 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
2990 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
2991 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
2997 /* Prevent the only kind of declaration conflicts we can make. */
2998 #define lt_preloaded_symbols some_other_symbol
3000 /* External symbol declarations for the compiler. */\
3003 if test "$dlself" = yes; then
3004 $show "generating symbol list for \`$output'"
3006 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3008 # Add our own program objects to the symbol list.
3009 progfiles
=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3010 for arg
in $progfiles; do
3011 $show "extracting global C symbols from \`$arg'"
3012 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3015 if test -n "$exclude_expsyms"; then
3016 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3017 $run eval '$mv "$nlist"T "$nlist"'
3020 if test -n "$export_symbols_regex"; then
3021 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3022 $run eval '$mv "$nlist"T "$nlist"'
3025 # Prepare the list of exported symbols
3026 if test -z "$export_symbols"; then
3027 export_symbols
="$output_objdir/$output.exp"
3028 $run $rm $export_symbols
3029 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3031 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3032 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3033 $run eval 'mv "$nlist"T "$nlist"'
3037 for arg
in $dlprefiles; do
3038 $show "extracting global C symbols from \`$arg'"
3039 name
=`echo "$arg" | sed -e 's%^.*/%%'`
3040 $run eval 'echo ": $name " >> "$nlist"'
3041 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3044 if test -z "$run"; then
3045 # Make sure we have at least an empty file.
3046 test -f "$nlist" ||
: > "$nlist"
3048 if test -n "$exclude_expsyms"; then
3049 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3050 $mv "$nlist"T
"$nlist"
3053 # Try sorting and uniquifying the output.
3054 if grep -v "^: " < "$nlist" |
sort +2 |
uniq > "$nlist"S
; then
3057 grep -v "^: " < "$nlist" > "$nlist"S
3060 if test -f "$nlist"S
; then
3061 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3063 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3066 $echo >> "$output_objdir/$dlsyms" "\
3068 #undef lt_preloaded_symbols
3070 #if defined (__STDC__) && __STDC__
3071 # define lt_ptr_t void *
3073 # define lt_ptr_t char *
3077 /* The mapping between symbol names and symbols. */
3082 lt_preloaded_symbols[] =
3086 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3087 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3088 < "$nlist" >> "$output_objdir/$dlsyms"
3090 $echo >> "$output_objdir/$dlsyms" "\
3094 /* This works around a problem in FreeBSD linker */
3095 #ifdef FREEBSD_WORKAROUND
3096 static const void *lt_preloaded_setup() {
3097 return lt_preloaded_symbols;
3107 pic_flag_for_symtable
=
3109 # compiling the symbol table file with pic_flag works around
3110 # a FreeBSD bug that causes programs to crash when -lm is
3111 # linked before any other PIC object. But we must not use
3112 # pic_flag when linking with -static. The problem exists in
3113 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3114 *-*-freebsd2*|
*-*-freebsd3.0
*)
3115 case "$compile_command " in
3117 *) pic_flag_for_symtable
=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3121 # Now compile the dynamic symbol file.
3122 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3123 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
3125 # Clean up the generated files.
3126 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3127 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3129 # Transform the symbol file into the correct name.
3130 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3131 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3134 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3139 # We keep going just in case the user didn't refer to
3140 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3141 # really was required.
3143 # Nullify the symbol file.
3144 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3145 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3148 if test -z "$link_against_libtool_libs" ||
test "$build_libtool_libs" != yes; then
3149 # Replace the output file specification.
3150 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3151 link_command
="$compile_command$compile_rpath"
3153 # We have no uninstalled library dependencies, so finalize right now.
3154 $show "$link_command"
3155 $run eval "$link_command"
3158 # Delete the generated files.
3159 if test -n "$dlsyms"; then
3160 $show "$rm $output_objdir/${outputname}S.${objext}"
3161 $run $rm "$output_objdir/${outputname}S.${objext}"
3167 if test -n "$shlibpath_var"; then
3168 # We should set the shlibpath_var
3170 for dir
in $temp_rpath; do
3172 [\\/]* |
[A-Za-z
]:[\\/]*)
3177 # Relative path: add a thisdir entry.
3178 rpath
="$rpath\$thisdir/$dir:"
3185 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3186 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3188 if test -n "$finalize_shlibpath"; then
3189 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3194 if test -n "$runpath_var"; then
3195 if test -n "$perm_rpath"; then
3196 # We should set the runpath_var.
3198 for dir
in $perm_rpath; do
3201 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3203 if test -n "$finalize_perm_rpath"; then
3204 # We should set the runpath_var.
3206 for dir
in $finalize_perm_rpath; do
3209 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
3213 if test "$hardcode_action" = relink
; then
3214 # Fast installation is not supported
3215 link_command
="$compile_var$compile_command$compile_rpath"
3216 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3218 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3219 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3221 if test "$fast_install" != no
; then
3222 link_command
="$finalize_var$compile_command$finalize_rpath"
3223 if test "$fast_install" = yes; then
3224 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3226 # fast_install is set to needless
3230 link_command
="$compile_var$compile_command$compile_rpath"
3231 relink_command
="$finalize_var$finalize_command$finalize_rpath"
3235 # Replace the output file specification.
3236 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3238 # Delete the old output files.
3239 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
3241 $show "$link_command"
3242 $run eval "$link_command" ||
exit $?
3244 # Now create the wrapper script.
3245 $show "creating $output"
3247 # Quote the relink command for shipping.
3248 if test -n "$relink_command"; then
3249 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3252 # Quote $echo for shipping.
3253 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3255 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
3256 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
3258 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3260 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3263 # Only actually do things if our run command is non-null.
3264 if test -z "$run"; then
3265 # win32 will think the script is a binary if it has
3266 # a .exe suffix, so we strip it off here.
3268 *.exe
) output
=`echo $output|sed 's,.exe$,,'` ;;
3271 trap "$rm $output; exit 1" 1 2 15
3276 # $output - temporary wrapper script for $objdir/$outputname
3277 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3279 # The $output program cannot be directly executed until all the libtool
3280 # libraries that it depends on are installed.
3282 # This wrapper script should never be moved out of the build directory.
3283 # If it is, it will not operate correctly.
3285 # Sed substitution that helps us do robust quoting. It backslashifies
3286 # metacharacters that are still active within double-quoted strings.
3287 Xsed='sed -e 1s/^X//'
3288 sed_quote_subst='$sed_quote_subst'
3290 # The HP-UX ksh and POSIX shell print the target directory to stdout
3292 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
3294 relink_command=\"$relink_command\"
3296 # This environment variable determines our operation mode.
3297 if test \"\$libtool_install_magic\" = \"$magic\"; then
3298 # install mode needs the following variable:
3299 link_against_libtool_libs='$link_against_libtool_libs'
3301 # When we are sourced in execute mode, \$file and \$echo are already set.
3302 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3305 # Make sure echo works.
3306 if test \"X\$1\" = X--no-reexec; then
3307 # Discard the --no-reexec flag, and continue.
3309 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3310 # Yippee, \$echo works!
3313 # Restart under the correct shell, and then maybe \$echo will work.
3314 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3320 # Find the directory that this script lives in.
3321 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3322 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3324 # Follow symbolic links until we get to the real thisdir.
3325 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3326 while test -n \"\$file\"; do
3327 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3329 # If there was a directory component, then change thisdir.
3330 if test \"x\$destdir\" != \"x\$file\"; then
3331 case \"\$destdir\" in
3332 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
3333 *) thisdir=\"\$thisdir/\$destdir\" ;;
3337 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3338 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3341 # Try to get the absolute directory name.
3342 absdir=\`cd \"\$thisdir\" && pwd\`
3343 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3346 if test "$fast_install" = yes; then
3348 program=lt-'$outputname'
3349 progdir=\"\$thisdir/$objdir\"
3351 if test ! -f \"\$progdir/\$program\" || \\
3352 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3353 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3355 file=\"\$\$-\$program\"
3357 if test ! -d \"\$progdir\"; then
3358 $mkdir \"\$progdir\"
3360 $rm \"\$progdir/\$file\"
3365 # relink executable if necessary
3366 if test -n \"\$relink_command\"; then
3367 if (cd \"\$thisdir\" && eval \$relink_command); then :
3369 $rm \"\$progdir/\$file\"
3374 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3375 { $rm \"\$progdir/\$program\";
3376 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3377 $rm \"\$progdir/\$file\"
3381 program='$outputname'
3382 progdir=\"\$thisdir/$objdir\"
3388 if test -f \"\$progdir/\$program\"; then"
3390 # Export our shlibpath_var if we have one.
3391 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3393 # Add our own library path to $shlibpath_var
3394 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3396 # Some systems cannot cope with colon-terminated $shlibpath_var
3397 # The second colon is a workaround for a bug in BeOS R4 sed
3398 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3400 export $shlibpath_var
3404 # fixup the dll searchpath if we need to.
3405 if test -n "$dllsearchpath"; then
3407 # Add the dll search path components to the executable PATH
3408 PATH=$dllsearchpath:\$PATH
3413 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3414 # Run the actual program with our arguments.
3417 *-*-cygwin* |
*-*-mingw |
*-*-os2*)
3418 # win32 systems need to use the prog path for dll
3421 exec \$progdir\\\\\$program \${1+\"\$@\"}
3426 # Export the path to the program.
3427 PATH=\"\$progdir:\$PATH\"
3430 exec \$program \${1+\"\$@\"}
3435 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3439 # The program doesn't exist.
3440 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3441 \$echo \"This script is just a wrapper for \$program.\" 1>&2
3442 echo \"See the $PACKAGE documentation for more information.\" 1>&2
3453 # See if we need to build an old-fashioned archive.
3454 for oldlib
in $oldlibs; do
3456 if test "$build_libtool_libs" = convenience
; then
3457 oldobjs
="$libobjs_save"
3458 addlibs
="$convenience"
3459 build_libtool_libs
=no
3461 if test "$build_libtool_libs" = module
; then
3462 oldobjs
="$libobjs_save"
3463 build_libtool_libs
=no
3465 oldobjs
="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3467 addlibs
="$old_convenience"
3470 if test -n "$addlibs"; then
3471 gentop
="$output_objdir/${outputname}x"
3472 $show "${rm}r $gentop"
3473 $run ${rm}r
"$gentop"
3474 $show "mkdir $gentop"
3475 $run mkdir
"$gentop"
3477 if test $status -ne 0 && test ! -d "$gentop"; then
3480 generated
="$generated $gentop"
3482 # Add in members from convenience archives.
3483 for xlib
in $addlibs; do
3484 # Extract the objects.
3486 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3487 *) xabs
=`pwd`"/$xlib" ;;
3489 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3490 xdir
="$gentop/$xlib"
3492 $show "${rm}r $xdir"
3497 if test $status -ne 0 && test ! -d "$xdir"; then
3500 $show "(cd $xdir && $AR x $xabs)"
3501 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3503 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3507 # Do each command in the archive commands.
3508 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3509 eval cmds
=\"$old_archive_from_new_cmds\"
3511 # Ensure that we have .o objects in place incase we decided
3512 # not to build a shared library, and have fallen back to building
3513 # static libs even though --disable-static was passed!
3514 for oldobj
in $oldobjs; do
3515 if test ! -f $oldobj; then
3516 obj
=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
3517 $show "${LN_S} $obj $oldobj"
3518 $run ${LN_S} $obj $oldobj ||
exit $?
3522 eval cmds
=\"$old_archive_cmds\"
3524 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3525 for cmd
in $cmds; do
3528 $run eval "$cmd" ||
exit $?
3533 if test -n "$generated"; then
3534 $show "${rm}r$generated"
3535 $run ${rm}r
$generated
3538 # Now create the libtool archive.
3542 test "$build_old_libs" = yes && old_library
="$libname.$libext"
3543 $show "creating $output"
3545 # Only create the output if not a dry run.
3546 if test -z "$run"; then
3547 for installed
in no
yes; do
3548 if test "$installed" = yes; then
3549 if test -z "$install_libdir"; then
3552 output
="$output_objdir/$outputname"i
3553 # Replace all uninstalled libtool libraries with the installed ones
3555 for deplib
in $dependency_libs; do
3558 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3559 eval libdir
=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3560 if test -z "$libdir"; then
3561 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3564 newdependency_libs
="$newdependency_libs $libdir/$name"
3566 *) newdependency_libs
="$newdependency_libs $deplib" ;;
3569 dependency_libs
="$newdependency_libs"
3573 # $outputname - a libtool library file
3574 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3576 # Please DO NOT delete this file!
3577 # It is necessary for linking the library.
3579 # The name that we can dlopen(3).
3582 # Names of this library.
3583 library_names='$library_names'
3585 # The name of the static archive.
3586 old_library='$old_library'
3588 # Libraries that this one depends upon.
3589 dependency_libs='$dependency_libs'
3591 # Version information for $libname.
3596 # Is this an already installed library?
3597 installed=$installed
3599 # Directory that this library needs to be installed in:
3600 libdir='$install_libdir'\
3605 # Do a symbolic link so that the libtool archive can be found in
3606 # LD_LIBRARY_PATH before the program is installed.
3607 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3608 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" ||
exit $?
3614 # libtool install mode
3616 modename
="$modename: install"
3618 # There may be an optional sh(1) argument at the beginning of
3619 # install_prog (especially on Windows NT).
3620 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh
; then
3621 # Aesthetically quote it.
3622 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3624 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3628 install_prog
="$arg "
3636 # The real first argument should be the name of the installation program.
3637 # Aesthetically quote it.
3638 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3640 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3644 install_prog
="$install_prog$arg"
3646 # We need to accept at least all the BSD install flags.
3657 if test -n "$dest"; then
3658 files
="$files $dest"
3671 strip
-V |
grep "GNU strip" >/dev
/null
&& gnustrip
=yes
3677 # If the previous option needed an argument, then skip it.
3678 if test -n "$prev"; then
3687 # Aesthetically quote the argument.
3688 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3690 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3694 install_prog
="$install_prog $arg"
3697 if test -z "$install_prog"; then
3698 $echo "$modename: you must specify an install program" 1>&2
3703 if test -n "$prev"; then
3704 $echo "$modename: the \`$prev' option requires an argument" 1>&2
3709 if test -z "$files"; then
3710 if test -z "$dest"; then
3711 $echo "$modename: no file or destination specified" 1>&2
3713 $echo "$modename: you must specify a destination" 1>&2
3719 # Strip any trailing slash from the destination.
3720 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3722 # Check to see that the destination is a directory.
3723 test -d "$dest" && isdir
=yes
3724 if test "$isdir" = yes; then
3728 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3729 test "X$destdir" = "X$dest" && destdir
=.
3730 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3732 # Not a directory, so check to see that there is only one file specified.
3734 if test $# -gt 2; then
3735 $echo "$modename: \`$dest' is not a directory" 1>&2
3741 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
3743 for file in $files; do
3747 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3756 # This variable tells wrapper scripts just to set variables rather
3757 # than running their programs.
3758 libtool_install_magic
="$magic"
3763 for file in $files; do
3765 # Do each installation.
3768 # Do the static libraries later.
3769 staticlibs
="$staticlibs $file"
3773 # Check to see that this really is a libtool archive.
3774 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
3776 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3783 # If there is no directory component, then add one.
3785 */* |
*\\*) .
$file ;;
3789 # Add the libdir to current_libdirs if it is the destination.
3790 if test "X$destdir" = "X$libdir"; then
3791 case "$current_libdirs " in
3793 *) current_libdirs
="$current_libdirs $libdir" ;;
3796 # Note the libdir as a future libdir.
3797 case "$future_libdirs " in
3799 *) future_libdirs
="$future_libdirs $libdir" ;;
3803 dir
="`$echo "X
$file" | $Xsed -e 's%/[^/]*$%%'`/"
3804 test "X$dir" = "X$file/" && dir
=
3807 # See the names of the shared library.
3808 set dummy
$library_names
3809 if test -n "$2"; then
3814 # Install the shared library and build the symlinks.
3815 $show "$install_prog $dir/$realname $destdir/$realname"
3816 $run eval "$install_prog $dir/$realname $destdir/$realname" ||
exit $?
3817 test "X$dlname" = "X$realname" && dlname
=
3818 if test $gnustrip = yes; then
3819 $show "strip --strip-unneeded $destdir/$realname"
3820 $run eval "strip --strip-unneeded $destdir/$realname" ||
exit $?
3823 if test $# -gt 0; then
3824 # Delete the old symlinks, and create new ones.
3827 test "X$dlname" = "X$linkname" && dlname
=
3828 if test "$linkname" != "$realname"; then
3829 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3830 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3835 if test -n "$dlname"; then
3836 # Install the dynamically-loadable library.
3837 $show "$install_prog $dir/$dlname $destdir/$dlname"
3838 $run eval "$install_prog $dir/$dlname $destdir/$dlname" ||
exit $?
3841 # Do each command in the postinstall commands.
3842 lib
="$destdir/$realname"
3843 eval cmds
=\"$postinstall_cmds\"
3844 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3845 for cmd
in $cmds; do
3848 $run eval "$cmd" ||
exit $?
3853 # Install the pseudo-library for information purposes.
3854 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3855 instname
="$dir/$name"i
3856 $show "$install_prog $instname $destdir/$name"
3857 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
3859 # Maybe install the static library, too.
3860 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
3864 # Install (i.e. copy) a libtool object.
3866 # Figure out destination file name, if it wasn't already specified.
3867 if test -n "$destname"; then
3868 destfile
="$destdir/$destname"
3870 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3871 destfile
="$destdir/$destfile"
3874 # Deduce the name of the destination old-style object file.
3877 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
3880 staticdest
="$destfile"
3884 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
3890 # Install the libtool object if requested.
3891 if test -n "$destfile"; then
3892 $show "$install_prog $file $destfile"
3893 $run eval "$install_prog $file $destfile" ||
exit $?
3896 # Install the old object if enabled.
3897 if test "$build_old_libs" = yes; then
3898 # Deduce the name of the old-style object file.
3899 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
3901 $show "$install_prog $staticobj $staticdest"
3902 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
3908 # Figure out destination file name, if it wasn't already specified.
3909 if test -n "$destname"; then
3910 destfile
="$destdir/$destname"
3912 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3913 destfile
="$destdir/$destfile"
3916 # Do a test to see if this is really a libtool program.
3917 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
3918 link_against_libtool_libs
=
3921 # If there is no directory component, then add one.
3923 */* |
*\\*) .
$file ;;
3927 # Check the variables that should have been set.
3928 if test -z "$link_against_libtool_libs"; then
3929 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
3934 for lib
in $link_against_libtool_libs; do
3935 # Check to see that each library is installed.
3937 if test -f "$lib"; then
3938 # If there is no directory component, then add one.
3940 */* |
*\\*) .
$lib ;;
3944 libfile
="$libdir/`$echo "X
$lib" | $Xsed -e 's%^.*/%%g'`"
3945 if test -n "$libdir" && test ! -f "$libfile"; then
3946 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
3952 if test "$fast_install" = no
&& test -n "$relink_command"; then
3953 if test "$finalize" = yes && test -z "$run"; then
3955 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
3956 tmpdir
="$tmpdir/libtool-$$"
3957 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
3959 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
3962 outputname
="$tmpdir/$file"
3963 # Replace the output file specification.
3964 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
3966 $show "$relink_command"
3967 if $run eval "$relink_command"; then :
3969 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
3975 $echo "$modename: warning: cannot relink \`$file'" 1>&2
3978 # Install the binary that we compiled earlier.
3979 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
3983 $show "$install_prog$stripme $file $destfile"
3984 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
3985 test -n "$outputname" && ${rm}r
"$tmpdir"
3990 for file in $staticlibs; do
3991 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3993 # Set up the ranlib parameters.
3994 oldlib
="$destdir/$name"
3996 $show "$install_prog $file $oldlib"
3997 $run eval "$install_prog \$file \$oldlib" ||
exit $?
3999 if test $gnustrip = yes; then
4000 $show "strip --strip-debug $oldlib"
4001 $run eval "strip --strip-debug $oldlib" ||
exit $?
4004 # Do each command in the postinstall commands.
4005 eval cmds
=\"$old_postinstall_cmds\"
4006 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4007 for cmd
in $cmds; do
4010 $run eval "$cmd" ||
exit $?
4015 if test -n "$future_libdirs"; then
4016 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4019 if test -n "$current_libdirs"; then
4020 # Maybe just do a dry run.
4021 test -n "$run" && current_libdirs
=" -n$current_libdirs"
4022 exec $SHELL $0 --finish$current_libdirs
4029 # libtool finish mode
4031 modename
="$modename: finish"
4035 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4038 libdirs
="$libdirs $dir"
4041 for libdir
in $libdirs; do
4042 if test -n "$finish_cmds"; then
4043 # Do each command in the finish commands.
4044 eval cmds
=\"$finish_cmds\"
4045 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4046 for cmd
in $cmds; do
4049 $run eval "$cmd" || admincmds
="$admincmds
4054 if test -n "$finish_eval"; then
4055 # Do the single finish_eval.
4056 eval cmds
=\"$finish_eval\"
4057 $run eval "$cmds" || admincmds
="$admincmds
4063 # Exit here if they wanted silent mode.
4064 test "$show" = : && exit 0
4066 echo "----------------------------------------------------------------------"
4067 echo "Libraries have been installed in:"
4068 for libdir
in $libdirs; do
4072 echo "If you ever happen to want to link against installed libraries"
4073 echo "in a given directory, LIBDIR, you must either use libtool, and"
4074 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
4075 echo "flag during linking and do at least one of the following:"
4076 if test -n "$shlibpath_var"; then
4077 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4078 echo " during execution"
4080 if test -n "$runpath_var"; then
4081 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4082 echo " during linking"
4084 if test -n "$hardcode_libdir_flag_spec"; then
4086 eval flag
=\"$hardcode_libdir_flag_spec\"
4088 echo " - use the \`$flag' linker flag"
4090 if test -n "$admincmds"; then
4091 echo " - have your system administrator run these commands:$admincmds"
4093 if test -f /etc
/ld.so.conf
; then
4094 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4097 echo "See any operating system documentation about shared libraries for"
4098 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4099 echo "----------------------------------------------------------------------"
4103 # libtool clean mode
4105 modename
="$modename: clean"
4109 # This variable tells wrapper scripts just to set variables rather
4110 # than running their programs.
4111 libtool_install_magic
="$magic"
4116 -*) rm="$rm $arg" ;;
4117 *) files
="$files $arg" ;;
4121 if test -z "$rm"; then
4122 $echo "$modename: you must specify an RM program" 1>&2
4127 for file in $files; do
4128 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4129 if test "X$dir" = "X$file"; then
4133 objdir
="$dir/$objdir"
4135 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4141 # Possibly a libtool archive, so verify it.
4142 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4145 # Delete the libtool libraries and symlinks.
4146 for n
in $library_names; do
4147 rmfiles
="$rmfiles $objdir/$n"
4148 test "X$n" = "X$dlname" && dlname
=
4150 test -n "$dlname" && rmfiles
="$rmfiles $objdir/$dlname"
4151 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
4152 rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
4157 if test "$build_old_libs" = yes; then
4158 oldobj
=`$echo "X$name" | $Xsed -e "$lo2o"`
4159 rmfiles
="$rmfiles $dir/$oldobj"
4164 # Do a test to see if this is a libtool program.
4165 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4169 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4170 if test "$fast_install" = yes && test -n "$relink_command"; then
4171 rmfiles
="$rmfiles $objdir/lt-$name"
4176 $show "$rm $rmfiles"
4182 # libtool execute mode
4184 modename
="$modename: execute"
4186 # The first argument is the command name.
4188 if test -z "$cmd"; then
4189 $echo "$modename: you must specify a COMMAND" 1>&2
4194 # Handle -dlopen flags immediately.
4195 for file in $execute_dlfiles; do
4196 if test ! -f "$file"; then
4197 $echo "$modename: \`$file' is not a file" 1>&2
4205 # Check to see that this really is a libtool archive.
4206 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
4208 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4213 # Read the libtool library.
4217 # If there is no directory component, then add one.
4219 */* |
*\\*) .
$file ;;
4223 # Skip this library if it cannot be dlopened.
4224 if test -z "$dlname"; then
4225 # Warn if it was a shared library.
4226 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4230 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4231 test "X$dir" = "X$file" && dir
=.
4233 if test -f "$dir/$objdir/$dlname"; then
4236 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4242 # Just add the directory containing the .lo file.
4243 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4244 test "X$dir" = "X$file" && dir
=.
4248 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4253 # Get the absolute pathname.
4254 absdir
=`cd "$dir" && pwd`
4255 test -n "$absdir" && dir
="$absdir"
4257 # Now add the directory to shlibpath_var.
4258 if eval "test -z \"\$$shlibpath_var\""; then
4259 eval "$shlibpath_var=\"\$dir\""
4261 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4265 # This variable tells wrapper scripts just to set shlibpath_var
4266 # rather than running their programs.
4267 libtool_execute_magic
="$magic"
4269 # Check if any of the arguments is a wrapper script.
4276 # Do a test to see if this is really a libtool program.
4277 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4278 # If there is no directory component, then add one.
4280 */* |
*\\*) .
$file ;;
4284 # Transform arg to wrapped name.
4285 file="$progdir/$program"
4289 # Quote arguments (to preserve shell metacharacters).
4290 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4291 args
="$args \"$file\""
4294 if test -z "$run"; then
4295 # Export the shlibpath_var.
4296 eval "export $shlibpath_var"
4298 # Restore saved enviroment variables
4299 if test "${save_LC_ALL+set}" = set; then
4300 LC_ALL
="$save_LC_ALL"; export LC_ALL
4302 if test "${save_LANG+set}" = set; then
4303 LANG
="$save_LANG"; export LANG
4306 # Now actually exec the command.
4307 eval "exec \$cmd$args"
4309 $echo "$modename: cannot exec \$cmd$args"
4312 # Display what would be done.
4313 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4314 $echo "export $shlibpath_var"
4320 # libtool uninstall mode
4322 modename
="$modename: uninstall"
4329 -*) rm="$rm $arg" ;;
4330 *) files
="$files $arg" ;;
4334 if test -z "$rm"; then
4335 $echo "$modename: you must specify an RM program" 1>&2
4340 for file in $files; do
4341 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4342 test "X$dir" = "X$file" && dir
=.
4343 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4349 # Possibly a libtool archive, so verify it.
4350 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
4353 # Delete the libtool libraries and symlinks.
4354 for n
in $library_names; do
4355 rmfiles
="$rmfiles $dir/$n"
4356 test "X$n" = "X$dlname" && dlname
=
4358 test -n "$dlname" && rmfiles
="$rmfiles $dir/$dlname"
4359 test -n "$old_library" && rmfiles
="$rmfiles $dir/$old_library"
4361 $show "$rm $rmfiles"
4364 if test -n "$library_names"; then
4365 # Do each command in the postuninstall commands.
4366 eval cmds
=\"$postuninstall_cmds\"
4367 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4368 for cmd
in $cmds; do
4376 if test -n "$old_library"; then
4377 # Do each command in the old_postuninstall commands.
4378 eval cmds
=\"$old_postuninstall_cmds\"
4379 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
4380 for cmd
in $cmds; do
4388 # FIXME: should reinstall the best remaining shared library.
4393 if test "$build_old_libs" = yes; then
4394 oldobj
=`$echo "X$name" | $Xsed -e "$lo2o"`
4395 rmfiles
="$rmfiles $dir/$oldobj"
4397 $show "$rm $rmfiles"
4402 $show "$rm $rmfiles"
4411 $echo "$modename: you must specify a MODE" 1>&2
4412 $echo "$generic_help" 1>&2
4417 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4418 $echo "$generic_help" 1>&2
4420 fi # test -z "$show_help"
4422 # We need to display help for each of the modes.
4425 "Usage: $modename [OPTION]... [MODE-ARG]...
4427 Provide generalized library-building support services.
4429 --config show all configuration variables
4430 --debug enable verbose shell tracing
4431 -n, --dry-run display commands without modifying any files
4432 --features display basic configuration information and exit
4433 --finish same as \`--mode=finish'
4434 --help display this help message and exit
4435 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
4436 --quiet same as \`--silent'
4437 --silent don't print informational messages
4438 --version print version information
4440 MODE must be one of the following:
4442 clean remove files from the build directory
4443 compile compile a source file into a libtool object
4444 execute automatically set library path, then run a program
4445 finish complete the installation of libtool libraries
4446 install install libraries or executables
4447 link create a library or an executable
4448 uninstall remove libraries from an installed directory
4450 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
4451 a more detailed description of MODE."
4457 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
4459 Remove files from the build directory.
4461 RM is the name of the program to use to delete files associated with each FILE
4462 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4465 If FILE is a libtool library, object or program, all the files associated
4466 with it are deleted. Otherwise, only FILE itself is deleted using RM."
4471 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4473 Compile a source file into a libtool library object.
4475 This mode accepts the following additional options:
4477 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
4478 -static always build a \`.o' file suitable for static linking
4480 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4481 from the given SOURCEFILE.
4483 The output file name is determined by removing the directory component from
4484 SOURCEFILE, then substituting the C source code suffix \`.c' with the
4485 library object suffix, \`.lo'."
4490 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4492 Automatically set library path, then run a program.
4494 This mode accepts the following additional options:
4496 -dlopen FILE add the directory containing FILE to the library path
4498 This mode sets the library path environment variable according to \`-dlopen'
4501 If any of the ARGS are libtool executable wrappers, then they are translated
4502 into their corresponding uninstalled binary, and any of their required library
4503 directories are added to the library path.
4505 Then, COMMAND is executed, with ARGS as arguments."
4510 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4512 Complete the installation of libtool libraries.
4514 Each LIBDIR is a directory that contains libtool libraries.
4516 The commands that this mode executes may require superuser privileges. Use
4517 the \`--dry-run' option if you just want to see what would be executed."
4522 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4524 Install executables or libraries.
4526 INSTALL-COMMAND is the installation command. The first component should be
4527 either the \`install' or \`cp' program.
4529 The rest of the components are interpreted as arguments to that command (only
4530 BSD-compatible install options are recognized)."
4535 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4537 Link object files or libraries together to form another library, or to
4538 create an executable program.
4540 LINK-COMMAND is a command using the C compiler that you would use to create
4541 a program from several object files.
4543 The following components of LINK-COMMAND are treated specially:
4545 -all-static do not do any dynamic linking at all
4546 -avoid-version do not add a version suffix if possible
4547 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
4548 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
4549 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4550 -export-symbols SYMFILE
4551 try to export only the symbols listed in SYMFILE
4552 -export-symbols-regex REGEX
4553 try to export only the symbols matching REGEX
4554 -LLIBDIR search LIBDIR for required installed libraries
4555 -lNAME OUTPUT-FILE requires the installed library libNAME
4556 -module build a library that can dlopened
4557 -no-undefined declare that a library does not refer to external symbols
4558 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
4559 -release RELEASE specify package release information
4560 -rpath LIBDIR the created library will eventually be installed in LIBDIR
4561 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
4562 -static do not do any dynamic linking of libtool libraries
4563 -version-info CURRENT[:REVISION[:AGE]]
4564 specify library version info [each variable defaults to 0]
4566 All other options (arguments beginning with \`-') are ignored.
4568 Every other argument is treated as a filename. Files ending in \`.la' are
4569 treated as uninstalled libtool libraries, other files are standard or library
4572 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4573 only library objects (\`.lo' files) may be specified, and \`-rpath' is
4574 required, except when creating a convenience library.
4576 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4577 using \`ar' and \`ranlib', or on Windows using \`lib'.
4579 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4580 is created, otherwise an executable program is created."
4585 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4587 Remove libraries from an installation directory.
4589 RM is the name of the program to use to delete files associated with each FILE
4590 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4593 If FILE is a libtool library, all the files associated with it are deleted.
4594 Otherwise, only FILE itself is deleted using RM."
4598 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4605 $echo "Try \`$modename --help' for more information about other modes."