1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
4 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # Check that we have a working $echo.
27 if test "X$1" = X--no-reexec
; then
28 # Discard the --no-reexec flag, and continue.
30 elif test "X$1" = X--fallback-echo
; then
31 # Avoid inline document here, it may be left over
33 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
34 # Yippee, $echo works!
37 # Restart under the correct shell, and then maybe $echo will work.
38 exec $SHELL "$0" --no-reexec ${1+"$@"}
41 if test "X$1" = X--fallback-echo
; then
42 # used as fallback echo
50 # The name of this program.
51 progname
=`$echo "$0" | sed 's%^.*/%%'`
58 TIMESTAMP
=" (1.385.2.196 1999/12/07 21:47:57)"
61 help="Try \`$progname --help' for more information."
62 magic
="%%%MAGIC variable%%%"
67 # Sed substitution that helps us do robust quoting. It backslashifies
68 # metacharacters that are still active within double-quoted strings.
70 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
72 NL2SP
='tr \015\012 \040\040'
75 # Only set LANG and LC_ALL to C if already set.
76 # These must not be set unconditionally because not all systems understand
77 # e.g. LANG=C (notably SCO).
78 # We save the old values to restore during execute mode.
79 if test "${LC_ALL+set}" = set; then
80 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
82 if test "${LANG+set}" = set; then
83 save_LANG
="$LANG"; LANG
=C
; export LANG
86 if test "$LTCONFIG_VERSION" != "$VERSION"; then
87 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
88 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
92 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
93 echo "$modename: not configured to build any kind of library" 1>&2
94 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
107 lo2o
="s/\\.lo\$/.${objext}/"
108 o2lo
="s/\\.${objext}\$/.lo/"
110 # Parse our command line options once, thoroughly.
117 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
121 # If the previous option needs an argument, assign it.
122 if test -n "$prev"; then
125 eval "$prev=\"\$$prev \$arg\""
137 # Have we seen a non-optional argument yet?
144 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
149 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
154 echo "$progname: enabling shell trace mode"
164 if test "$build_libtool_libs" = yes; then
165 echo "enable shared libraries"
167 echo "disable shared libraries"
169 if test "$build_old_libs" = yes; then
170 echo "enable static libraries"
172 echo "disable static libraries"
177 --finish) mode
="finish" ;;
179 --mode) prevopt
="--mode" prev
=mode
;;
180 --mode=*) mode
="$optarg" ;;
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 $srcfile $pic_flag -DPIC"
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 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
525 if test "X$xdir" = "X$obj"; then
530 baseobj
=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
531 libobj
=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
532 # Now arrange that obj and lo_libobj become the same file
533 $show "(cd $xdir && $LN_S $baseobj $libobj)"
534 if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
543 # Allow error messages only from the first compilation.
544 suppress_output
=' >/dev/null 2>&1'
547 # Only build a position-dependent object if we build old libraries.
548 if test "$build_old_libs" = yes; then
549 command="$base_compile $srcfile"
550 if test "$compiler_c_o" = yes; then
551 command="$command -o $obj"
555 # Suppress compiler output if we already did a PIC compilation.
556 command="$command$suppress_output"
557 $run $rm "$output_obj"
559 if $run eval "$command"; then :
565 if test "$need_locks" = warn
&&
566 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
568 *** ERROR, $lockfile contains:
569 `cat $lockfile 2>/dev/null`
571 but it should contain:
574 This indicates that another process is trying to use the same
575 temporary object file, and libtool could not work around it because
576 your compiler does not support \`-c' and \`-o' together. If you
577 repeat this compilation, it may succeed, by chance, but you had better
578 avoid parallel builds (make -j) in this platform, or get a better
585 # Just move the object if needed
586 if test x
"$output_obj" != x
"$obj"; then
587 $show "$mv $output_obj $obj"
588 if $run $mv $output_obj $obj; then :
596 # Create an invalid libtool object if no PIC, so that we do not
597 # accidentally link it into a program.
598 if test "$build_libtool_libs" != yes; then
599 $show "echo timestamp > $libobj"
600 $run eval "echo timestamp > \$libobj" ||
exit $?
602 # Move the .lo from within objdir
603 $show "$mv $libobj $lo_libobj"
604 if $run $mv $libobj $lo_libobj; then :
613 # Unlock the critical section if it was locked
614 if test "$need_locks" != no
; then
623 modename
="$modename: link"
625 *-*-cygwin* |
*-*-mingw* |
*-*-os2*)
626 # It is impossible to link a dll without this setting, and
627 # we shouldn't force the makefile maintainer to figure out
628 # which system we are compiling for in order to pass an extra
629 # flag for every libtool invokation.
632 # FIXME: Unfortunately, there are problems with the above when trying
633 # to make a dll which has undefined symbols, in which case not
634 # even a static library is built. For now, we need to specify
635 # -no-undefined on the libtool link line when we can be certain
636 # that all symbols are satisfied, otherwise we get a static library.
639 # This is a source program that is used to create dlls on Windows
640 # Don't remove nor modify the starting and closing comments
641 # /* ltdll.c starts here */
642 # #define WIN32_LEAN_AND_MEAN
643 # #include <windows.h>
644 # #undef WIN32_LEAN_AND_MEAN
648 # # ifdef __CYGWIN32__
649 # # define __CYGWIN__ __CYGWIN32__
656 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
662 # #include <cygwin/cygwin_dll.h>
663 # DECLARE_CYGWIN_DLL( DllMain );
665 # HINSTANCE __hDllInstance_base;
668 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
670 # __hDllInstance_base = hInst;
673 # /* ltdll.c ends here */
674 # This is a source program that is used to create import libraries
675 # on Windows for dlls which lack them. Don't remove nor modify the
676 # starting and closing comments
677 # /* impgen.c starts here */
678 # /* Copyright (C) 1999 Free Software Foundation, Inc.
680 # This file is part of GNU libtool.
682 # This program is free software; you can redistribute it and/or modify
683 # it under the terms of the GNU General Public License as published by
684 # the Free Software Foundation; either version 2 of the License, or
685 # (at your option) any later version.
687 # This program is distributed in the hope that it will be useful,
688 # but WITHOUT ANY WARRANTY; without even the implied warranty of
689 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
690 # GNU General Public License for more details.
692 # You should have received a copy of the GNU General Public License
693 # along with this program; if not, write to the Free Software
694 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
697 # #include <stdio.h> /* for printf() */
698 # #include <unistd.h> /* for open(), lseek(), read() */
699 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
700 # #include <string.h> /* for strdup() */
702 # static unsigned int
703 # pe_get16 (fd, offset)
707 # unsigned char b[2];
708 # lseek (fd, offset, SEEK_SET);
710 # return b[0] + (b[1]<<8);
713 # static unsigned int
714 # pe_get32 (fd, offset)
718 # unsigned char b[4];
719 # lseek (fd, offset, SEEK_SET);
721 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
724 # static unsigned int
728 # unsigned char *b = ptr;
729 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
738 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
739 # unsigned long export_rva, export_size, nsections, secptr, expptr;
740 # unsigned long name_rvas, nexp;
741 # unsigned char *expdata, *erva;
742 # char *filename, *dll_name;
744 # filename = argv[1];
746 # dll = open(filename, O_RDONLY|O_BINARY);
750 # dll_name = filename;
752 # for (i=0; filename[i]; i++)
753 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
754 # dll_name = filename + i +1;
756 # pe_header_offset = pe_get32 (dll, 0x3c);
757 # opthdr_ofs = pe_header_offset + 4 + 20;
758 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
760 # if (num_entries < 1) /* no exports */
763 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
764 # export_size = pe_get32 (dll, opthdr_ofs + 100);
765 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
766 # secptr = (pe_header_offset + 4 + 20 +
767 # pe_get16 (dll, pe_header_offset + 4 + 16));
770 # for (i = 0; i < nsections; i++)
773 # unsigned long secptr1 = secptr + 40 * i;
774 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
775 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
776 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
777 # lseek(dll, secptr1, SEEK_SET);
778 # read(dll, sname, 8);
779 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
781 # expptr = fptr + (export_rva - vaddr);
782 # if (export_rva + export_size > vaddr + vsize)
783 # export_size = vsize - (export_rva - vaddr);
788 # expdata = (unsigned char*)malloc(export_size);
789 # lseek (dll, expptr, SEEK_SET);
790 # read (dll, expdata, export_size);
791 # erva = expdata - export_rva;
793 # nexp = pe_as32 (expdata+24);
794 # name_rvas = pe_as32 (expdata+32);
796 # printf ("EXPORTS\n");
797 # for (i = 0; i<nexp; i++)
799 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
800 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
805 # /* impgen.c ends here */
811 compile_command
="$nonopt"
812 finalize_command
="$nonopt"
823 if test -n "$shlibpath_var"; then
824 # get the directories listed in $shlibpath_var
825 eval lib_search_path
=\
`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
829 # now prepend the system-specific ones
830 eval lib_search_path
=\"$sys_lib_search_path_spec\
$lib_search_path\"
831 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
839 export_symbols_regex
=
842 link_against_libtool_libs
=
846 prefer_static_libs
=no
858 # We need to know -static, to get the right output filenames.
862 -all-static |
-static)
863 if test "X$arg" = "X-all-static"; then
864 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
865 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
867 if test -n "$link_static_flag"; then
868 dlopen_self
=$dlopen_self_static
871 if test -z "$pic_flag" && test -n "$link_static_flag"; then
872 dlopen_self
=$dlopen_self_static
875 build_libtool_libs
=no
877 prefer_static_libs
=yes
883 # See if our shared archives depend on static archives.
884 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
886 # Go through the arguments, transforming them on the way.
887 while test $# -gt 0; do
891 # If the previous option needs an argument, assign it.
892 if test -n "$prev"; then
895 compile_command
="$compile_command @OUTPUT@"
896 finalize_command
="$finalize_command @OUTPUT@"
902 if test "$preload" = no
; then
903 # Add the symbol object into the linking commands.
904 compile_command
="$compile_command @SYMFILE@"
905 finalize_command
="$finalize_command @SYMFILE@"
909 *.la |
*.lo
) ;; # We handle these cases below.
911 if test "$dlself" = no
; then
919 if test "$prev" = dlprefiles
; then
921 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
931 if test "$prev" = dlfiles
; then
932 dlfiles
="$dlfiles $arg"
934 dlprefiles
="$dlprefiles $arg"
941 export_symbols
="$arg"
942 if test ! -f "$arg"; then
943 $echo "$modename: symbol file \`$arg' does not exist"
950 export_symbols_regex
="$arg"
960 # We need an absolute path.
962 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
964 $echo "$modename: only absolute run-paths are allowed" 1>&2
968 if test "$prev" = rpath
; then
971 *) rpath
="$rpath $arg" ;;
976 *) xrpath
="$xrpath $arg" ;;
983 eval "$prev=\"\$arg\""
994 if test -n "$link_static_flag"; then
995 compile_command
="$compile_command $link_static_flag"
996 finalize_command
="$finalize_command $link_static_flag"
1002 # FIXME: remove this flag sometime in the future.
1003 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1027 -export-symbols |
-export-symbols-regex)
1028 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1029 $echo "$modename: not more than one -exported-symbols argument allowed"
1032 if test "X$arg" = "X-export-symbols"; then
1041 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1042 # We need an absolute path.
1044 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1046 absdir
=`cd "$dir" && pwd`
1047 if test -z "$absdir"; then
1048 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1049 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1055 case " $deplibs " in
1057 *) deplibs
="$deplibs $arg";;
1059 case " $lib_search_path " in
1061 *) lib_search_path
="$lib_search_path $dir";;
1064 *-*-cygwin* |
*-*-mingw* |
*-*-os2*)
1065 dllsearchdir
=`cd "$dir" && pwd || echo "$dir"`
1066 case ":$dllsearchpath:" in
1067 ::) dllsearchpath
="$dllsearchdir";;
1068 *":$dllsearchdir:"*) ;;
1069 *) dllsearchpath
="$dllsearchpath:$dllsearchdir";;
1076 if test "$arg" = "-lc"; then
1078 *-*-cygwin* |
*-*-mingw* |
*-*-os2* |
*-*-beos*)
1079 # These systems don't actually have c library (as such)
1083 elif test "$arg" = "-lm"; then
1085 *-*-cygwin* |
*-*-beos*)
1086 # These systems don't actually have math library (as such)
1091 deplibs
="$deplibs $arg"
1122 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1123 # We need an absolute path.
1125 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1127 $echo "$modename: only absolute run-paths are allowed" 1>&2
1133 *) xrpath
="$xrpath $dir" ;;
1139 # If we have no pic_flag, then this is the same as -all-static.
1140 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1141 compile_command
="$compile_command $link_static_flag"
1142 finalize_command
="$finalize_command $link_static_flag"
1157 # Some other compiler flag.
1159 # Unknown arguments in both finalize_command and compile_command need
1160 # to be aesthetically quoted because they are evaled later.
1161 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1163 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1169 *.o |
*.obj |
*.a |
*.lib
)
1170 # A standard object.
1176 if test "$prev" = dlfiles
; then
1177 dlfiles
="$dlfiles $arg"
1178 if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
1182 # If libtool objects are unsupported, then we need to preload.
1187 if test "$prev" = dlprefiles
; then
1188 # Preload the old-style object.
1189 dlprefiles
="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1192 libobjs
="$libobjs $arg"
1196 # A libtool-controlled library.
1203 # Check to see that this really is a libtool archive.
1204 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1206 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
1210 # If the library was installed with an old release of libtool,
1211 # it will not redefine variable installed.
1215 # If there is no directory component, then add one.
1217 */* |
*\\*) .
$arg ;;
1221 # Get the name of the library we link against.
1223 for l
in $old_library $library_names; do
1227 if test -z "$linklib"; then
1228 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
1232 # Find the relevant object directory and library name.
1233 name
=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
1235 if test "X$installed" = Xyes
; then
1238 dir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1239 if test "X$dir" = "X$arg"; then
1246 if test -n "$dependency_libs"; then
1247 # Extract -R and -L from dependency_libs
1249 for deplib
in $dependency_libs; do
1251 -R*) temp_xrpath
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1252 case " $rpath $xrpath " in
1253 *" $temp_xrpath "*) ;;
1254 *) xrpath
="$xrpath $temp_xrpath";;
1256 -L*) case "$compile_command $temp_deplibs " in
1258 *) temp_deplibs
="$temp_deplibs $deplib";;
1260 temp_dir
=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1261 case " $lib_search_path " in
1263 *) lib_search_path
="$lib_search_path $temp_dir";;
1266 *) temp_deplibs
="$temp_deplibs $deplib";;
1269 dependency_libs
="$temp_deplibs"
1272 if test -z "$libdir"; then
1273 # It is a libtool convenience library, so add in its objects.
1274 convenience
="$convenience $dir/$old_library"
1275 old_convenience
="$old_convenience $dir/$old_library"
1276 deplibs
="$deplibs$dependency_libs"
1277 compile_command
="$compile_command $dir/$old_library$dependency_libs"
1278 finalize_command
="$finalize_command $dir/$old_library$dependency_libs"
1282 # This library was specified with -dlopen.
1283 if test "$prev" = dlfiles
; then
1284 dlfiles
="$dlfiles $arg"
1285 if test -z "$dlname" ||
test "$dlopen" != yes ||
test "$build_libtool_libs" = no
; then
1286 # If there is no dlname, no dlopen support or we're linking statically,
1287 # we need to preload.
1290 # We should not create a dependency on this library, but we
1291 # may need any libraries it requires.
1292 compile_command
="$compile_command$dependency_libs"
1293 finalize_command
="$finalize_command$dependency_libs"
1299 # The library was specified with -dlpreopen.
1300 if test "$prev" = dlprefiles
; then
1301 # Prefer using a static library (so that no silly _DYNAMIC symbols
1302 # are required to link).
1303 if test -n "$old_library"; then
1304 dlprefiles
="$dlprefiles $dir/$old_library"
1306 dlprefiles
="$dlprefiles $dir/$linklib"
1311 if test -n "$library_names" &&
1312 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
1313 link_against_libtool_libs
="$link_against_libtool_libs $arg"
1314 if test -n "$shlibpath_var"; then
1315 # Make sure the rpath contains only unique directories.
1316 case "$temp_rpath " in
1318 *) temp_rpath
="$temp_rpath $dir" ;;
1322 # We need an absolute path.
1324 [\\/] |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
1326 absdir
=`cd "$dir" && pwd`
1327 if test -z "$absdir"; then
1328 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1329 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1335 # This is the magic to use -rpath.
1336 # Skip directories that are in the system default run-time
1337 # search path, unless they have been requested with -R.
1338 case " $sys_lib_dlsearch_path " in
1341 case "$compile_rpath " in
1343 *) compile_rpath
="$compile_rpath $absdir"
1348 case " $sys_lib_dlsearch_path " in
1351 case "$finalize_rpath " in
1353 *) finalize_rpath
="$finalize_rpath $libdir"
1359 case "$hardcode_action" in
1360 immediate | unsupported
)
1361 if test "$hardcode_direct" = no
; then
1362 compile_command
="$compile_command $dir/$linklib"
1363 deplibs
="$deplibs $dir/$linklib"
1365 *-*-cygwin* |
*-*-mingw* |
*-*-os2*)
1366 dllsearchdir
=`cd "$dir" && pwd || echo "$dir"`
1367 if test -n "$dllsearchpath"; then
1368 dllsearchpath
="$dllsearchpath:$dllsearchdir"
1370 dllsearchpath
="$dllsearchdir"
1374 elif test "$hardcode_minus_L" = no
; then
1377 compile_shlibpath
="$compile_shlibpath$dir:"
1380 case "$compile_command " in
1382 *) compile_command
="$compile_command -L$dir";;
1384 compile_command
="$compile_command -l$name"
1385 deplibs
="$deplibs -L$dir -l$name"
1386 elif test "$hardcode_shlibpath_var" = no
; then
1387 case ":$compile_shlibpath:" in
1389 *) compile_shlibpath
="$compile_shlibpath$dir:";;
1391 compile_command
="$compile_command -l$name"
1392 deplibs
="$deplibs -l$name"
1399 if test "$hardcode_direct" = yes; then
1400 compile_command
="$compile_command $absdir/$linklib"
1401 deplibs
="$deplibs $absdir/$linklib"
1402 elif test "$hardcode_minus_L" = yes; then
1403 case "$compile_command " in
1405 *) compile_command
="$compile_command -L$absdir";;
1407 compile_command
="$compile_command -l$name"
1408 deplibs
="$deplibs -L$absdir -l$name"
1409 elif test "$hardcode_shlibpath_var" = yes; then
1410 case ":$compile_shlibpath:" in
1412 *) compile_shlibpath
="$compile_shlibpath$absdir:";;
1414 compile_command
="$compile_command -l$name"
1415 deplibs
="$deplibs -l$name"
1426 if test "$lib_linked" != yes; then
1427 $echo "$modename: configuration error: unsupported hardcode properties"
1431 # Finalize command for both is simple: just hardcode it.
1432 if test "$hardcode_direct" = yes; then
1433 finalize_command
="$finalize_command $libdir/$linklib"
1434 elif test "$hardcode_minus_L" = yes; then
1435 case "$finalize_command " in
1437 *) finalize_command
="$finalize_command -L$libdir";;
1439 finalize_command
="$finalize_command -l$name"
1440 elif test "$hardcode_shlibpath_var" = yes; then
1441 case ":$finalize_shlibpath:" in
1443 *) finalize_shlibpath
="$finalize_shlibpath$libdir:";;
1445 finalize_command
="$finalize_command -l$name"
1447 # We cannot seem to hardcode it, guess we'll fake it.
1448 case "$finalize_command " in
1450 *) finalize_command
="$finalize_command -L$libdir";;
1452 finalize_command
="$finalize_command -l$name"
1455 # Transform directly to old archives if we don't build new libraries.
1456 if test -n "$pic_flag" && test -z "$old_library"; then
1457 $echo "$modename: cannot find static library for \`$arg'" 1>&2
1461 # Here we assume that one of hardcode_direct or hardcode_minus_L
1462 # is not unsupported. This is valid on all known static and
1464 if test "$hardcode_direct" != unsupported
; then
1465 test -n "$old_library" && linklib
="$old_library"
1466 compile_command
="$compile_command $dir/$linklib"
1467 finalize_command
="$finalize_command $dir/$linklib"
1469 case "$compile_command " in
1471 *) compile_command
="$compile_command -L$dir";;
1473 compile_command
="$compile_command -l$name"
1474 case "$finalize_command " in
1476 *) finalize_command
="$finalize_command -L$dir";;
1478 finalize_command
="$finalize_command -l$name"
1482 # Add in any libraries that this one depends upon.
1483 compile_command
="$compile_command$dependency_libs"
1484 finalize_command
="$finalize_command$dependency_libs"
1488 # Some other compiler argument.
1490 # Unknown arguments in both finalize_command and compile_command need
1491 # to be aesthetically quoted because they are evaled later.
1492 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1494 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1501 # Now actually substitute the argument into the commands.
1502 if test -n "$arg"; then
1503 compile_command
="$compile_command $arg"
1504 finalize_command
="$finalize_command $arg"
1508 if test -n "$prev"; then
1509 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1514 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1515 eval arg
=\"$export_dynamic_flag_spec\"
1516 compile_command
="$compile_command $arg"
1517 finalize_command
="$finalize_command $arg"
1521 # calculate the name of the file, without its directory
1522 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1523 libobjs_save
="$libobjs"
1527 $echo "$modename: you must specify an output file" 1>&2
1533 if test -n "$link_against_libtool_libs"; then
1534 $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
1538 if test -n "$deplibs"; then
1539 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1542 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
1543 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1546 if test -n "$rpath"; then
1547 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
1550 if test -n "$xrpath"; then
1551 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
1554 if test -n "$vinfo"; then
1555 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1558 if test -n "$release"; then
1559 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
1562 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1563 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1566 # Now set the variables for building old libraries.
1567 build_libtool_libs
=no
1572 # Make sure we only generate libraries of the form `libNAME.la'.
1573 case "$outputname" in
1575 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1576 eval libname
=\"$libname_spec\"
1579 if test "$module" = no
; then
1580 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
1584 if test "$need_lib_prefix" != no
; then
1585 # Add the "lib" prefix for modules if required
1586 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1587 eval libname
=\"$libname_spec\"
1589 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1594 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1595 if test "X$output_objdir" = "X$output"; then
1596 output_objdir
="$objdir"
1598 output_objdir
="$output_objdir/$objdir"
1601 if test -n "$objs"; then
1602 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1606 # How the heck are we supposed to write a wrapper for a shared library?
1607 if test -n "$link_against_libtool_libs"; then
1608 $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
1612 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
1613 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1617 if test $# -gt 2; then
1618 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1623 if test -z "$rpath"; then
1624 if test "$build_libtool_libs" = yes; then
1625 # Building a libtool convenience library.
1627 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
1628 build_libtool_libs
=convenience
1631 dependency_libs
="$deplibs"
1633 if test -n "$vinfo"; then
1634 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1637 if test -n "$release"; then
1638 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1642 # Parse the version information argument.
1643 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
1644 set dummy
$vinfo 0 0 0
1647 if test -n "$8"; then
1648 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1657 # Check that each of the things are valid numbers.
1659 0 |
[1-9] |
[1-9][0-9]*) ;;
1661 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1662 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1668 0 |
[1-9] |
[1-9][0-9]*) ;;
1670 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1671 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1677 0 |
[1-9] |
[1-9][0-9]*) ;;
1679 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1680 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1685 if test $age -gt $current; then
1686 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1687 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1691 # Calculate the version variables.
1695 case "$version_type" in
1699 major
=`expr $current - $age + 1`
1700 versuffix
="$major.$revision"
1701 verstring
="sgi$major.$revision"
1703 # Add in all the interfaces that we are compatible with.
1705 while test $loop != 0; do
1706 iface
=`expr $revision - $loop`
1707 loop
=`expr $loop - 1`
1708 verstring
="sgi$major.$iface:$verstring"
1713 major
=.
`expr $current - $age`
1714 versuffix
="$major.$age.$revision"
1718 major
=`expr $current - $age`
1719 versuffix
=".$current.$age.$revision"
1720 verstring
="$current.$age.$revision"
1722 # Add in all the interfaces that we are compatible with.
1724 while test $loop != 0; do
1725 iface
=`expr $current - $loop`
1726 loop
=`expr $loop - 1`
1727 verstring
="$verstring:${iface}.0"
1730 # Make executables depend on our current version.
1731 verstring
="$verstring:${current}.0"
1736 versuffix
=".$current.$revision"
1741 versuffix
=".$current.$revision";
1746 versuffix
=".$current";
1750 # Like Linux, but with '-' rather than '.', since we only
1751 # want one extension on Windows 95.
1752 major
=`expr $current - $age`
1753 versuffix
="-$major-$age-$revision"
1757 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1758 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1763 # Clear the version info if we defaulted, and they specified a release.
1764 if test -z "$vinfo" && test -n "$release"; then
1767 if test "$need_version" = no
; then
1774 # Remove version info from name if versioning should be avoided
1775 if test "$avoid_version" = yes && test "$need_version" = no
; then
1781 # Check to see if the archive will have undefined symbols.
1782 if test "$allow_undefined" = yes; then
1783 if test "$allow_undefined_flag" = unsupported
; then
1784 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1785 build_libtool_libs
=no
1789 # Don't allow undefined symbols.
1790 allow_undefined_flag
="$no_undefined_flag"
1793 dependency_libs
="$deplibs"
1795 *-*-cygwin* |
*-*-mingw* |
*-*-os2* |
*-*-beos*)
1796 # these systems don't actually have a c library (as such)!
1799 # Add libc to deplibs on all other systems.
1800 deplibs
="$deplibs -lc"
1805 # Create the output directory, or remove our outputs if we need to.
1806 if test -d $output_objdir; then
1807 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
1808 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.
*
1810 $show "$mkdir $output_objdir"
1811 $run $mkdir $output_objdir
1813 if test $status -ne 0 && test ! -d $output_objdir; then
1818 # Now set the variables for building old libraries.
1819 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
1820 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
1822 # Transform .lo files to .o files.
1823 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
1826 if test "$build_libtool_libs" = yes; then
1827 # Transform deplibs into only deplibs that can be linked in shared.
1829 libname_save
=$libname
1830 release_save
=$release
1831 versuffix_save
=$versuffix
1833 # I'm not sure if I'm treating the release correctly. I think
1834 # release should show up in the -l (ie -lgmp5) so we don't want to
1835 # add it in twice. Is that correct?
1841 case "$deplibs_check_method" in
1843 # Don't check for shared/static. Everything works.
1844 # This might be a little naive. We might want to check
1845 # whether the library exists or not. But this is on
1846 # osf3 & osf4 and I'm not really sure... Just
1847 # implementing what was already the behaviour.
1851 # This code stresses the "libraries are programs" paradigm to its
1852 # limits. Maybe even breaks it. We compile a program, linking it
1853 # against the deplibs as a proxy for the library. Then we can check
1854 # whether they linked in statically or dynamically with ldd.
1856 cat > conftest.c
<<EOF
1857 int main() { return 0; }
1860 $CC -o conftest conftest.c
$deplibs
1861 if test $?
-eq 0 ; then
1862 ldd_output
=`ldd conftest`
1863 for i
in $deplibs; do
1864 name
="`expr $i : '-l\(.*\)'`"
1865 # If $name is empty we are operating on a -L argument.
1866 if test "$name" != "" ; then
1867 libname
=`eval \\$echo \"$libname_spec\"`
1868 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
1869 set dummy
$deplib_matches
1871 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1872 newdeplibs
="$newdeplibs $i"
1876 echo "*** Warning: This library needs some functionality provided by $i."
1877 echo "*** I have the capability to make that library automatically link in when"
1878 echo "*** you link to this library. But I can only do this if you have a"
1879 echo "*** shared version of the library, which you do not appear to have."
1882 newdeplibs
="$newdeplibs $i"
1886 # Error occured in the first compile. Let's try to salvage the situation:
1887 # Compile a seperate program for each library.
1888 for i
in $deplibs; do
1889 name
="`expr $i : '-l\(.*\)'`"
1890 # If $name is empty we are operating on a -L argument.
1891 if test "$name" != "" ; then
1893 $CC -o conftest conftest.c
$i
1895 if test $?
-eq 0 ; then
1896 ldd_output
=`ldd conftest`
1897 libname
=`eval \\$echo \"$libname_spec\"`
1898 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
1899 set dummy
$deplib_matches
1901 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1902 newdeplibs
="$newdeplibs $i"
1906 echo "*** Warning: This library needs some functionality provided by $i."
1907 echo "*** I have the capability to make that library automatically link in when"
1908 echo "*** you link to this library. But I can only do this if you have a"
1909 echo "*** shared version of the library, which you do not appear to have."
1914 echo "*** Warning! Library $i is needed by this library but I was not able to"
1915 echo "*** make it link in! You will probably need to install it or some"
1916 echo "*** library that it depends on before this library will be fully"
1917 echo "*** functional. Installing it before continuing would be even better."
1920 newdeplibs
="$newdeplibs $i"
1926 set dummy
$deplibs_check_method
1927 file_magic_regex
="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
1928 for a_deplib
in $deplibs; do
1929 name
="`expr $a_deplib : '-l\(.*\)'`"
1930 # If $name is empty we are operating on a -L argument.
1931 if test "$name" != "" ; then
1932 libname
=`eval \\$echo \"$libname_spec\"`
1933 for i
in $lib_search_path; do
1934 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
1935 for potent_lib
in $potential_libs; do
1936 # Follow soft links.
1937 if ls -lLd "$potent_lib" 2>/dev
/null \
1938 |
grep " -> " >/dev
/null
; then
1941 # The statement above tries to avoid entering an
1942 # endless loop below, in case of cyclic links.
1943 # We might still enter an endless loop, since a link
1944 # loop can be closed while we follow links,
1946 potlib
="$potent_lib"
1947 while test -h "$potlib" 2>/dev
/null
; do
1948 potliblink
=`ls -ld $potlib | sed 's/.* -> //'`
1949 case "$potliblink" in
1950 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
1951 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
1954 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
1956 |
egrep "$file_magic_regex" > /dev
/null
; then
1957 newdeplibs
="$newdeplibs $a_deplib"
1963 if test -n "$a_deplib" ; then
1966 echo "*** Warning: This library needs some functionality provided by $a_deplib."
1967 echo "*** I have the capability to make that library automatically link in when"
1968 echo "*** you link to this library. But I can only do this if you have a"
1969 echo "*** shared version of the library, which you do not appear to have."
1972 # Add a -L argument.
1973 newdeplibs
="$newdeplibs $a_deplib"
1975 done # Gone through all deplibs.
1979 if $echo "X $deplibs" |
$Xsed -e 's/ -lc$//' \
1980 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
1981 grep .
>/dev
/null
; then
1983 if test "X$deplibs_check_method" = "Xnone"; then
1984 echo "*** Warning: inter-library dependencies are not supported in this platform."
1986 echo "*** Warning: inter-library dependencies are not known to be supported."
1988 echo "*** All declared inter-library dependencies are being dropped."
1993 versuffix
=$versuffix_save
1995 release
=$release_save
1996 libname
=$libname_save
1999 if test "$droppeddeps" = yes; then
2000 if test "$module" = yes; then
2002 echo "*** Warning: libtool could not satisfy all declared inter-library"
2003 echo "*** dependencies of module $libname. Therefore, libtool will create"
2004 echo "*** a static module, that should work as long as the dlopening"
2005 echo "*** application is linked with the -dlopen flag."
2006 if test -z "$global_symbol_pipe"; then
2008 echo "*** However, this would only work if libtool was able to extract symbol"
2009 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2010 echo "*** not find such a program. So, this module is probably useless."
2011 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2013 if test "$build_old_libs" = no
; then
2014 oldlibs
="$output_objdir/$libname.$libext"
2015 build_libtool_libs
=module
2018 build_libtool_libs
=no
2021 echo "*** The inter-library dependencies that have been dropped here will be"
2022 echo "*** automatically added whenever a program is linked with this library"
2023 echo "*** or is declared to -dlopen it."
2026 # Done checking deplibs!
2030 # All the library-specific variables (install_libdir is set above).
2035 # Test again, we may have decided not to build it any more
2036 if test "$build_libtool_libs" = yes; then
2037 # Get the real and link names of the library.
2038 eval library_names
=\"$library_names_spec\"
2039 set dummy
$library_names
2043 if test -n "$soname_spec"; then
2044 eval soname
=\"$soname_spec\"
2049 lib
="$output_objdir/$realname"
2052 linknames
="$linknames $link"
2055 # Ensure that we have .o objects for linkers which dislike .lo
2056 # (e.g. aix) in case we are running --disable-static
2057 for obj
in $libobjs; do
2058 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2059 if test "X$xdir" = "X$obj"; then
2064 baseobj
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2065 oldobj
=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2066 if test ! -f $xdir/$oldobj; then
2067 $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2068 $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' ||
exit $?
2072 # Use standard objects if they are pic
2073 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2075 # Prepare the list of exported symbols
2076 if test -z "$export_symbols"; then
2077 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
2078 $show "generating symbol list for \`$libname.la'"
2079 export_symbols
="$output_objdir/$libname.exp"
2080 $run $rm $export_symbols
2081 eval cmds
=\"$export_symbols_cmds\"
2082 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2083 for cmd
in $cmds; do
2086 $run eval "$cmd" ||
exit $?
2089 if test -n "$export_symbols_regex"; then
2090 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2091 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2092 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2093 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2098 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2099 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2102 if test -n "$convenience"; then
2103 if test -n "$whole_archive_flag_spec"; then
2104 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
2106 gentop
="$output_objdir/${outputname}x"
2107 $show "${rm}r $gentop"
2108 $run ${rm}r
"$gentop"
2109 $show "mkdir $gentop"
2110 $run mkdir
"$gentop"
2112 if test $status -ne 0 && test ! -d "$gentop"; then
2115 generated
="$generated $gentop"
2117 for xlib
in $convenience; do
2118 # Extract the objects.
2120 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
2121 *) xabs
=`pwd`"/$xlib" ;;
2123 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2124 xdir
="$gentop/$xlib"
2126 $show "${rm}r $xdir"
2131 if test $status -ne 0 && test ! -d "$xdir"; then
2134 $show "(cd $xdir && $AR x $xabs)"
2135 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
2137 libobjs
="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2142 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2143 eval flag
=\"$thread_safe_flag_spec\"
2144 linkopts
="$linkopts $flag"
2147 # Do each of the archive commands.
2148 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2149 eval cmds
=\"$archive_expsym_cmds\"
2151 eval cmds
=\"$archive_cmds\"
2153 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2154 for cmd
in $cmds; do
2157 $run eval "$cmd" ||
exit $?
2161 # Create links to the real library.
2162 for linkname
in $linknames; do
2163 if test "$realname" != "$linkname"; then
2164 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2165 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
2169 # If -module or -export-dynamic was specified, set the dlname.
2170 if test "$module" = yes ||
test "$export_dynamic" = yes; then
2171 # On all known operating systems, these are identical.
2178 if test -n "$link_against_libtool_libs"; then
2179 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
2183 if test -n "$deplibs"; then
2184 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2187 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2188 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2191 if test -n "$rpath"; then
2192 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2195 if test -n "$xrpath"; then
2196 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2199 if test -n "$vinfo"; then
2200 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2203 if test -n "$release"; then
2204 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2209 if test -n "$objs"; then
2210 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2214 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
2222 # Delete the old objects.
2223 $run $rm $obj $libobj
2225 # Objects from convenience libraries. This assumes
2226 # single-version convenience libraries. Whenever we create
2227 # different ones for PIC/non-PIC, this we'll have to duplicate
2231 # reload_cmds runs $LD directly, so let us get rid of
2232 # -Wl from whole_archive_flag_spec
2235 if test -n "$convenience"; then
2236 if test -n "$whole_archive_flag_spec"; then
2237 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
2239 gentop
="$output_objdir/${obj}x"
2240 $show "${rm}r $gentop"
2241 $run ${rm}r
"$gentop"
2242 $show "mkdir $gentop"
2243 $run mkdir
"$gentop"
2245 if test $status -ne 0 && test ! -d "$gentop"; then
2248 generated
="$generated $gentop"
2250 for xlib
in $convenience; do
2251 # Extract the objects.
2253 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
2254 *) xabs
=`pwd`"/$xlib" ;;
2256 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2257 xdir
="$gentop/$xlib"
2259 $show "${rm}r $xdir"
2264 if test $status -ne 0 && test ! -d "$xdir"; then
2267 $show "(cd $xdir && $AR x $xabs)"
2268 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
2270 reload_conv_objs
="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2275 # Create the old-style object.
2276 reload_objs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
2279 eval cmds
=\"$reload_cmds\"
2280 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2281 for cmd
in $cmds; do
2284 $run eval "$cmd" ||
exit $?
2288 # Exit if we aren't doing a library object file.
2289 if test -z "$libobj"; then
2290 if test -n "$gentop"; then
2291 $show "${rm}r $gentop"
2298 if test "$build_libtool_libs" != yes; then
2299 if test -n "$gentop"; then
2300 $show "${rm}r $gentop"
2304 # Create an invalid libtool object if no PIC, so that we don't
2305 # accidentally link it into a program.
2306 $show "echo timestamp > $libobj"
2307 $run eval "echo timestamp > $libobj" ||
exit $?
2311 if test -n "$pic_flag"; then
2312 # Only do commands if we really have different PIC objects.
2313 reload_objs
="$libobjs $reload_conv_objs"
2315 eval cmds
=\"$reload_cmds\"
2316 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2317 for cmd
in $cmds; do
2320 $run eval "$cmd" ||
exit $?
2324 # Just create a symlink.
2327 xdir
=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
2328 if test "X$xdir" = "X$libobj"; then
2333 baseobj
=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
2334 oldobj
=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2335 $show "(cd $xdir && $LN_S $oldobj $baseobj)"
2336 $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' ||
exit $?
2339 if test -n "$gentop"; then
2340 $show "${rm}r $gentop"
2347 # Anything else should be a program.
2349 if test -n "$vinfo"; then
2350 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2353 if test -n "$release"; then
2354 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2357 if test "$preload" = yes; then
2358 if test "$dlopen" = unknown
&& test "$dlopen_self" = unknown
&&
2359 test "$dlopen_self_static" = unknown
; then
2360 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2364 if test -n "$rpath$xrpath"; then
2365 # If the user specified any rpath flags, then add them.
2366 for libdir
in $rpath $xrpath; do
2367 # This is the magic to use -rpath.
2368 case "$compile_rpath " in
2370 *) compile_rpath
="$compile_rpath $libdir" ;;
2372 case "$finalize_rpath " in
2374 *) finalize_rpath
="$finalize_rpath $libdir" ;;
2379 # Now hardcode the library paths
2382 for libdir
in $compile_rpath $finalize_rpath; do
2383 if test -n "$hardcode_libdir_flag_spec"; then
2384 if test -n "$hardcode_libdir_separator"; then
2385 if test -z "$hardcode_libdirs"; then
2386 hardcode_libdirs
="$libdir"
2388 # Just accumulate the unique libdirs.
2389 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2390 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2393 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2398 eval flag
=\"$hardcode_libdir_flag_spec\"
2399 rpath
="$rpath $flag"
2401 elif test -n "$runpath_var"; then
2402 case "$perm_rpath " in
2404 *) perm_rpath
="$perm_rpath $libdir" ;;
2408 # Substitute the hardcoded libdirs into the rpath.
2409 if test -n "$hardcode_libdir_separator" &&
2410 test -n "$hardcode_libdirs"; then
2411 libdir
="$hardcode_libdirs"
2412 eval rpath
=\" $hardcode_libdir_flag_spec\"
2414 compile_rpath
="$rpath"
2418 for libdir
in $finalize_rpath; do
2419 if test -n "$hardcode_libdir_flag_spec"; then
2420 if test -n "$hardcode_libdir_separator"; then
2421 if test -z "$hardcode_libdirs"; then
2422 hardcode_libdirs
="$libdir"
2424 # Just accumulate the unique libdirs.
2425 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2426 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2429 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2434 eval flag
=\"$hardcode_libdir_flag_spec\"
2435 rpath
="$rpath $flag"
2437 elif test -n "$runpath_var"; then
2438 case "$finalize_perm_rpath " in
2440 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
2444 # Substitute the hardcoded libdirs into the rpath.
2445 if test -n "$hardcode_libdir_separator" &&
2446 test -n "$hardcode_libdirs"; then
2447 libdir
="$hardcode_libdirs"
2448 eval rpath
=\" $hardcode_libdir_flag_spec\"
2450 finalize_rpath
="$rpath"
2452 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2453 if test "X$output_objdir" = "X$output"; then
2454 output_objdir
="$objdir"
2456 output_objdir
="$output_objdir/$objdir"
2459 # Create the binary in the object directory, then wrap it.
2460 if test ! -d $output_objdir; then
2461 $show "$mkdir $output_objdir"
2462 $run $mkdir $output_objdir
2464 if test $status -ne 0 && test ! -d $output_objdir; then
2469 if test -n "$libobjs" && test "$build_old_libs" = yes; then
2470 # Transform all the library objects into standard objects.
2471 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2472 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2476 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2477 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2478 dlsyms
="${outputname}S.c"
2480 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
2484 if test -n "$dlsyms"; then
2488 # Discover the nlist of each of the dlfiles.
2489 nlist
="$output_objdir/${outputname}.nm"
2491 $show "$rm $nlist ${nlist}S ${nlist}T"
2492 $run $rm "$nlist" "${nlist}S" "${nlist}T"
2494 # Parse the name list into a source file.
2495 $show "creating $output_objdir/$dlsyms"
2497 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
2498 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
2499 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
2505 /* Prevent the only kind of declaration conflicts we can make. */
2506 #define lt_preloaded_symbols some_other_symbol
2508 /* External symbol declarations for the compiler. */\
2511 if test "$dlself" = yes; then
2512 $show "generating symbol list for \`$output'"
2514 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
2516 # Add our own program objects to the symbol list.
2517 progfiles
=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2518 for arg
in $progfiles; do
2519 $show "extracting global C symbols from \`$arg'"
2520 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2523 if test -n "$exclude_expsyms"; then
2524 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2525 $run eval '$mv "$nlist"T "$nlist"'
2528 if test -n "$export_symbols_regex"; then
2529 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2530 $run eval '$mv "$nlist"T "$nlist"'
2533 # Prepare the list of exported symbols
2534 if test -z "$export_symbols"; then
2535 export_symbols
="$output_objdir/$output.exp"
2536 $run $rm $export_symbols
2537 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2539 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
2540 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
2541 $run eval 'mv "$nlist"T "$nlist"'
2545 for arg
in $dlprefiles; do
2546 $show "extracting global C symbols from \`$arg'"
2547 name
=`echo "$arg" | sed -e 's%^.*/%%'`
2548 $run eval 'echo ": $name " >> "$nlist"'
2549 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2552 if test -z "$run"; then
2553 # Make sure we have at least an empty file.
2554 test -f "$nlist" ||
: > "$nlist"
2556 if test -n "$exclude_expsyms"; then
2557 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2558 $mv "$nlist"T
"$nlist"
2561 # Try sorting and uniquifying the output.
2562 if grep -v "^: " < "$nlist" |
sort +2 |
uniq > "$nlist"S
; then
2565 grep -v "^: " < "$nlist" > "$nlist"S
2568 if test -f "$nlist"S
; then
2569 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
2571 echo '/* NONE */' >> "$output_objdir/$dlsyms"
2574 $echo >> "$output_objdir/$dlsyms" "\
2576 #undef lt_preloaded_symbols
2578 #if defined (__STDC__) && __STDC__
2579 # define lt_ptr_t void *
2581 # define lt_ptr_t char *
2585 /* The mapping between symbol names and symbols. */
2590 lt_preloaded_symbols[] =
2594 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
2595 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
2596 < "$nlist" >> "$output_objdir/$dlsyms"
2598 $echo >> "$output_objdir/$dlsyms" "\
2602 /* This works around a problem in FreeBSD linker */
2603 #ifdef FREEBSD_WORKAROUND
2604 static const void *lt_preloaded_setup() {
2605 return lt_preloaded_symbols;
2615 pic_flag_for_symtable
=
2617 # compiling the symbol table file with pic_flag works around
2618 # a FreeBSD bug that causes programs to crash when -lm is
2619 # linked before any other PIC object. But we must not use
2620 # pic_flag when linking with -static. The problem exists in
2621 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2622 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
2623 case "$compile_command " in
2625 *) pic_flag_for_symtable
=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
2628 case "$compile_command " in
2630 *) pic_flag_for_symtable
=" $pic_flag -DPIC";;
2634 # Now compile the dynamic symbol file.
2635 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
2636 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
2638 # Clean up the generated files.
2639 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
2640 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
2642 # Transform the symbol file into the correct name.
2643 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2644 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2647 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
2652 # We keep going just in case the user didn't refer to
2653 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2654 # really was required.
2656 # Nullify the symbol file.
2657 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2658 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2661 if test -z "$link_against_libtool_libs" ||
test "$build_libtool_libs" != yes; then
2662 # Replace the output file specification.
2663 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
2664 link_command
="$compile_command$compile_rpath"
2666 # We have no uninstalled library dependencies, so finalize right now.
2667 $show "$link_command"
2668 $run eval "$link_command"
2671 # Delete the generated files.
2672 if test -n "$dlsyms"; then
2673 $show "$rm $output_objdir/${outputname}S.${objext}"
2674 $run $rm "$output_objdir/${outputname}S.${objext}"
2680 if test -n "$shlibpath_var"; then
2681 # We should set the shlibpath_var
2683 for dir
in $temp_rpath; do
2685 [\\/]* |
[A-Za-z
]:[\\/]*)
2690 # Relative path: add a thisdir entry.
2691 rpath
="$rpath\$thisdir/$dir:"
2698 if test -n "$compile_shlibpath$finalize_shlibpath"; then
2699 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
2701 if test -n "$finalize_shlibpath"; then
2702 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
2707 if test -n "$runpath_var"; then
2708 if test -n "$perm_rpath"; then
2709 # We should set the runpath_var.
2711 for dir
in $perm_rpath; do
2714 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
2716 if test -n "$finalize_perm_rpath"; then
2717 # We should set the runpath_var.
2719 for dir
in $finalize_perm_rpath; do
2722 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
2726 if test "$hardcode_action" = relink
; then
2727 # Fast installation is not supported
2728 link_command
="$compile_var$compile_command$compile_rpath"
2729 relink_command
="$finalize_var$finalize_command$finalize_rpath"
2731 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
2732 $echo "$modename: \`$output' will be relinked during installation" 1>&2
2734 if test "$fast_install" != no
; then
2735 link_command
="$finalize_var$compile_command$finalize_rpath"
2736 if test "$fast_install" = yes; then
2737 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
2739 # fast_install is set to needless
2743 link_command
="$compile_var$compile_command$compile_rpath"
2744 relink_command
="$finalize_var$finalize_command$finalize_rpath"
2748 # Replace the output file specification.
2749 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
2751 # Delete the old output files.
2752 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
2754 $show "$link_command"
2755 $run eval "$link_command" ||
exit $?
2757 # Now create the wrapper script.
2758 $show "creating $output"
2760 # Quote the relink command for shipping.
2761 if test -n "$relink_command"; then
2762 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
2765 # Quote $echo for shipping.
2766 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
2768 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $0 --fallback-echo";;
2769 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
2771 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
2773 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
2776 # Only actually do things if our run command is non-null.
2777 if test -z "$run"; then
2778 # win32 will think the script is a binary if it has
2779 # a .exe suffix, so we strip it off here.
2781 *.exe
) output
=`echo $output|sed 's,.exe$,,'` ;;
2784 trap "$rm $output; exit 1" 1 2 15
2786 # quick and dirty hack by Elrond <Elrond@Wunder-Nett.org>
2787 # to get libtool work with paths in its
2789 relink_curdir
="`pwd`"
2794 # $output - temporary wrapper script for $objdir/$outputname
2795 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
2797 # The $output program cannot be directly executed until all the libtool
2798 # libraries that it depends on are installed.
2800 # This wrapper script should never be moved out of the build directory.
2801 # If it is, it will not operate correctly.
2803 # Sed substitution that helps us do robust quoting. It backslashifies
2804 # metacharacters that are still active within double-quoted strings.
2805 Xsed='sed -e 1s/^X//'
2806 sed_quote_subst='$sed_quote_subst'
2808 # The HP-UX ksh and POSIX shell print the target directory to stdout
2810 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
2812 relink_curdir=\"$relink_curdir\"
2813 relink_command=\"$relink_command\"
2815 # This environment variable determines our operation mode.
2816 if test \"\$libtool_install_magic\" = \"$magic\"; then
2817 # install mode needs the following variable:
2818 link_against_libtool_libs='$link_against_libtool_libs'
2820 # When we are sourced in execute mode, \$file and \$echo are already set.
2821 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2824 # Make sure echo works.
2825 if test \"X\$1\" = X--no-reexec; then
2826 # Discard the --no-reexec flag, and continue.
2828 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
2829 # Yippee, \$echo works!
2832 # Restart under the correct shell, and then maybe \$echo will work.
2833 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2839 # Find the directory that this script lives in.
2840 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2841 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2843 # Follow symbolic links until we get to the real thisdir.
2844 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
2845 while test -n \"\$file\"; do
2846 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2848 # If there was a directory component, then change thisdir.
2849 if test \"x\$destdir\" != \"x\$file\"; then
2850 case \"\$destdir\" in
2851 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
2852 *) thisdir=\"\$thisdir/\$destdir\" ;;
2856 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2857 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
2860 # Try to get the absolute directory name.
2861 absdir=\`cd \"\$thisdir\" && pwd\`
2862 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2865 if test "$fast_install" = yes; then
2867 program=lt-'$outputname'
2868 progdir=\"\$thisdir/$objdir\"
2870 if test ! -f \"\$progdir/\$program\" || \\
2871 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
2872 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2874 file=\"\$\$-\$program\"
2876 if test ! -d \"\$progdir\"; then
2877 $mkdir \"\$progdir\"
2879 $rm \"\$progdir/\$file\"
2884 # relink executable if necessary
2885 if test -n \"\$relink_command\"; then
2886 if (cd \"\$relink_curdir\" && eval \$relink_command); then :
2888 $rm \"\$progdir/\$file\"
2893 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2894 { $rm \"\$progdir/\$program\";
2895 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2896 $rm \"\$progdir/\$file\"
2900 program='$outputname'
2901 progdir=\"\$thisdir/$objdir\"
2907 if test -f \"\$progdir/\$program\"; then"
2909 # Export our shlibpath_var if we have one.
2910 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2912 # Add our own library path to $shlibpath_var
2913 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2915 # Some systems cannot cope with colon-terminated $shlibpath_var
2916 # The second colon is a workaround for a bug in BeOS R4 sed
2917 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2919 export $shlibpath_var
2923 # fixup the dll searchpath if we need to.
2924 if test -n "$dllsearchpath"; then
2926 # Add the dll search path components to the executable PATH
2927 PATH=$dllsearchpath:\$PATH
2932 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2933 # Run the actual program with our arguments.
2936 *-*-cygwin* |
*-*-mingw |
*-*-os2*)
2937 # win32 systems need to use the prog path for dll
2940 exec \$progdir\\\\\$program \${1+\"\$@\"}
2945 # Export the path to the program.
2946 PATH=\"\$progdir:\$PATH\"
2949 exec \$program \${1+\"\$@\"}
2954 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
2958 # The program doesn't exist.
2959 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
2960 \$echo \"This script is just a wrapper for \$program.\" 1>&2
2961 echo \"See the $PACKAGE documentation for more information.\" 1>&2
2972 # See if we need to build an old-fashioned archive.
2973 for oldlib
in $oldlibs; do
2975 if test "$build_libtool_libs" = convenience
; then
2976 oldobjs
="$libobjs_save"
2977 addlibs
="$convenience"
2978 build_libtool_libs
=no
2980 if test "$build_libtool_libs" = module
; then
2981 oldobjs
="$libobjs_save"
2982 build_libtool_libs
=no
2984 oldobjs
="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
2986 addlibs
="$old_convenience"
2989 if test -n "$addlibs"; then
2990 gentop
="$output_objdir/${outputname}x"
2991 $show "${rm}r $gentop"
2992 $run ${rm}r
"$gentop"
2993 $show "mkdir $gentop"
2994 $run mkdir
"$gentop"
2996 if test $status -ne 0 && test ! -d "$gentop"; then
2999 generated
="$generated $gentop"
3001 # Add in members from convenience archives.
3002 for xlib
in $addlibs; do
3003 # Extract the objects.
3005 [\\/]* |
[A-Za-z
]:[\\/]*) xabs
="$xlib" ;;
3006 *) xabs
=`pwd`"/$xlib" ;;
3008 xlib
=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3009 xdir
="$gentop/$xlib"
3011 $show "${rm}r $xdir"
3016 if test $status -ne 0 && test ! -d "$xdir"; then
3019 $show "(cd $xdir && $AR x $xabs)"
3020 $run eval "(cd \$xdir && $AR x \$xabs)" ||
exit $?
3022 oldobjs
="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3026 # Do each command in the archive commands.
3027 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3028 eval cmds
=\"$old_archive_from_new_cmds\"
3030 # Ensure that we have .o objects in place in case we decided
3031 # not to build a shared library, and have fallen back to building
3032 # static libs even though --disable-static was passed!
3033 for oldobj
in $oldobjs; do
3034 if test ! -f $oldobj; then
3035 xdir
=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3036 if test "X$xdir" = "X$oldobj"; then
3041 baseobj
=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3042 obj
=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3043 $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3044 $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' ||
exit $?
3048 eval cmds
=\"$old_archive_cmds\"
3050 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3051 for cmd
in $cmds; do
3054 $run eval "$cmd" ||
exit $?
3059 if test -n "$generated"; then
3060 $show "${rm}r$generated"
3061 $run ${rm}r
$generated
3064 # Now create the libtool archive.
3068 test "$build_old_libs" = yes && old_library
="$libname.$libext"
3069 $show "creating $output"
3071 if test -n "$xrpath"; then
3073 for libdir
in $xrpath; do
3074 temp_xrpath
="$temp_xrpath -R$libdir"
3076 dependency_libs
="$temp_xrpath $dependency_libs"
3079 # Only create the output if not a dry run.
3080 if test -z "$run"; then
3081 for installed
in no
yes; do
3082 if test "$installed" = yes; then
3083 if test -z "$install_libdir"; then
3086 output
="$output_objdir/$outputname"i
3090 # $outputname - a libtool library file
3091 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3093 # Please DO NOT delete this file!
3094 # It is necessary for linking the library.
3096 # The name that we can dlopen(3).
3099 # Names of this library.
3100 library_names='$library_names'
3102 # The name of the static archive.
3103 old_library='$old_library'
3105 # Libraries that this one depends upon.
3106 dependency_libs='$dependency_libs'
3108 # Version information for $libname.
3113 # Is this an already installed library?
3114 installed=$installed
3116 # Directory that this library needs to be installed in:
3117 libdir='$install_libdir'\
3122 # Do a symbolic link so that the libtool archive can be found in
3123 # LD_LIBRARY_PATH before the program is installed.
3124 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3125 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" ||
exit $?
3131 # libtool install mode
3133 modename
="$modename: install"
3135 # There may be an optional sh(1) argument at the beginning of
3136 # install_prog (especially on Windows NT).
3137 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh
; then
3138 # Aesthetically quote it.
3139 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3141 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3145 install_prog
="$arg "
3153 # The real first argument should be the name of the installation program.
3154 # Aesthetically quote it.
3155 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3157 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3161 install_prog
="$install_prog$arg"
3163 # We need to accept at least all the BSD install flags.
3173 if test -n "$dest"; then
3174 files
="$files $dest"
3192 # If the previous option needed an argument, then skip it.
3193 if test -n "$prev"; then
3202 # Aesthetically quote the argument.
3203 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3205 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3209 install_prog
="$install_prog $arg"
3212 if test -z "$install_prog"; then
3213 $echo "$modename: you must specify an install program" 1>&2
3218 if test -n "$prev"; then
3219 $echo "$modename: the \`$prev' option requires an argument" 1>&2
3224 if test -z "$files"; then
3225 if test -z "$dest"; then
3226 $echo "$modename: no file or destination specified" 1>&2
3228 $echo "$modename: you must specify a destination" 1>&2
3234 # Strip any trailing slash from the destination.
3235 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3237 # Check to see that the destination is a directory.
3238 test -d "$dest" && isdir
=yes
3239 if test "$isdir" = yes; then
3243 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3244 test "X$destdir" = "X$dest" && destdir
=.
3245 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3247 # Not a directory, so check to see that there is only one file specified.
3249 if test $# -gt 2; then
3250 $echo "$modename: \`$dest' is not a directory" 1>&2
3256 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
3258 for file in $files; do
3262 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3271 # This variable tells wrapper scripts just to set variables rather
3272 # than running their programs.
3273 libtool_install_magic
="$magic"
3278 for file in $files; do
3280 # Do each installation.
3283 # Do the static libraries later.
3284 staticlibs
="$staticlibs $file"
3288 # Check to see that this really is a libtool archive.
3289 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
3291 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3298 # If there is no directory component, then add one.
3300 */* |
*\\*) .
$file ;;
3304 # Add the libdir to current_libdirs if it is the destination.
3305 if test "X$destdir" = "X$libdir"; then
3306 case "$current_libdirs " in
3308 *) current_libdirs
="$current_libdirs $libdir" ;;
3311 # Note the libdir as a future libdir.
3312 case "$future_libdirs " in
3314 *) future_libdirs
="$future_libdirs $libdir" ;;
3318 dir
="`$echo "X
$file" | $Xsed -e 's%/[^/]*$%%'`/"
3319 test "X$dir" = "X$file/" && dir
=
3322 # See the names of the shared library.
3323 set dummy
$library_names
3324 if test -n "$2"; then
3329 # Install the shared library and build the symlinks.
3330 $show "$install_prog $dir/$realname $destdir/$realname"
3331 $run eval "$install_prog $dir/$realname $destdir/$realname" ||
exit $?
3333 if test $# -gt 0; then
3334 # Delete the old symlinks, and create new ones.
3337 if test "$linkname" != "$realname"; then
3338 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3339 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3344 # Do each command in the postinstall commands.
3345 lib
="$destdir/$realname"
3346 eval cmds
=\"$postinstall_cmds\"
3347 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3348 for cmd
in $cmds; do
3351 $run eval "$cmd" ||
exit $?
3356 # Install the pseudo-library for information purposes.
3357 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3358 instname
="$dir/$name"i
3359 $show "$install_prog $instname $destdir/$name"
3360 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
3362 # Maybe install the static library, too.
3363 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
3367 # Install (i.e. copy) a libtool object.
3369 # Figure out destination file name, if it wasn't already specified.
3370 if test -n "$destname"; then
3371 destfile
="$destdir/$destname"
3373 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3374 destfile
="$destdir/$destfile"
3377 # Deduce the name of the destination old-style object file.
3380 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
3383 staticdest
="$destfile"
3387 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
3393 # Install the libtool object if requested.
3394 if test -n "$destfile"; then
3395 $show "$install_prog $file $destfile"
3396 $run eval "$install_prog $file $destfile" ||
exit $?
3399 # Install the old object if enabled.
3400 if test "$build_old_libs" = yes; then
3401 # Deduce the name of the old-style object file.
3402 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
3404 $show "$install_prog $staticobj $staticdest"
3405 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
3411 # Figure out destination file name, if it wasn't already specified.
3412 if test -n "$destname"; then
3413 destfile
="$destdir/$destname"
3415 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3416 destfile
="$destdir/$destfile"
3419 # Do a test to see if this is really a libtool program.
3420 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
3421 link_against_libtool_libs
=
3424 # If there is no directory component, then add one.
3426 */* |
*\\*) .
$file ;;
3430 # Check the variables that should have been set.
3431 if test -z "$link_against_libtool_libs"; then
3432 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
3437 for lib
in $link_against_libtool_libs; do
3438 # Check to see that each library is installed.
3440 if test -f "$lib"; then
3441 # If there is no directory component, then add one.
3443 */* |
*\\*) .
$lib ;;
3447 libfile
="$libdir/`$echo "X
$lib" | $Xsed -e 's%^.*/%%g'`"
3448 if test -n "$libdir" && test ! -f "$libfile"; then
3449 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
3455 if test "$fast_install" = no
&& test -n "$relink_command"; then
3456 if test "$finalize" = yes && test -z "$run"; then
3458 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
3459 tmpdir
="$tmpdir/libtool-$$"
3460 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
3462 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
3465 # quick and dirty hack by Elrond <Elrond@Wunder-Nett.org>
3466 # to get libtool work with paths in its
3468 file=`$echo "X$file" | $Xsed -e 's%/%_%g'`
3469 outputname
="$tmpdir/$file"
3470 # Replace the output file specification.
3471 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
3473 $show "$relink_command"
3474 if $run eval "$relink_command"; then :
3476 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
3482 $echo "$modename: warning: cannot relink \`$file'" 1>&2
3485 # Install the binary that we compiled earlier.
3486 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
3490 $show "$install_prog$stripme $file $destfile"
3491 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
3492 test -n "$outputname" && ${rm}r
"$tmpdir"
3497 for file in $staticlibs; do
3498 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3500 # Set up the ranlib parameters.
3501 oldlib
="$destdir/$name"
3503 $show "$install_prog $file $oldlib"
3504 $run eval "$install_prog \$file \$oldlib" ||
exit $?
3506 # Do each command in the postinstall commands.
3507 eval cmds
=\"$old_postinstall_cmds\"
3508 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3509 for cmd
in $cmds; do
3512 $run eval "$cmd" ||
exit $?
3517 if test -n "$future_libdirs"; then
3518 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
3521 if test -n "$current_libdirs"; then
3522 # Maybe just do a dry run.
3523 test -n "$run" && current_libdirs
=" -n$current_libdirs"
3524 exec $SHELL $0 --finish$current_libdirs
3531 # libtool finish mode
3533 modename
="$modename: finish"
3537 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3540 libdirs
="$libdirs $dir"
3543 for libdir
in $libdirs; do
3544 if test -n "$finish_cmds"; then
3545 # Do each command in the finish commands.
3546 eval cmds
=\"$finish_cmds\"
3547 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3548 for cmd
in $cmds; do
3551 $run eval "$cmd" || admincmds
="$admincmds
3556 if test -n "$finish_eval"; then
3557 # Do the single finish_eval.
3558 eval cmds
=\"$finish_eval\"
3559 $run eval "$cmds" || admincmds
="$admincmds
3565 # Exit here if they wanted silent mode.
3566 test "$show" = : && exit 0
3568 echo "----------------------------------------------------------------------"
3569 echo "Libraries have been installed in:"
3570 for libdir
in $libdirs; do
3574 echo "If you ever happen to want to link against installed libraries"
3575 echo "in a given directory, LIBDIR, you must either use libtool, and"
3576 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
3577 echo "flag during linking and do at least one of the following:"
3578 if test -n "$shlibpath_var"; then
3579 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3580 echo " during execution"
3582 if test -n "$runpath_var"; then
3583 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3584 echo " during linking"
3586 if test -n "$hardcode_libdir_flag_spec"; then
3588 eval flag
=\"$hardcode_libdir_flag_spec\"
3590 echo " - use the \`$flag' linker flag"
3592 if test -n "$admincmds"; then
3593 echo " - have your system administrator run these commands:$admincmds"
3595 if test -f /etc
/ld.so.conf
; then
3596 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3599 echo "See any operating system documentation about shared libraries for"
3600 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3601 echo "----------------------------------------------------------------------"
3605 # libtool execute mode
3607 modename
="$modename: execute"
3609 # The first argument is the command name.
3611 if test -z "$cmd"; then
3612 $echo "$modename: you must specify a COMMAND" 1>&2
3617 # Handle -dlopen flags immediately.
3618 for file in $execute_dlfiles; do
3619 if test ! -f "$file"; then
3620 $echo "$modename: \`$file' is not a file" 1>&2
3628 # Check to see that this really is a libtool archive.
3629 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
3631 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3636 # Read the libtool library.
3640 # If there is no directory component, then add one.
3642 */* |
*\\*) .
$file ;;
3646 # Skip this library if it cannot be dlopened.
3647 if test -z "$dlname"; then
3648 # Warn if it was a shared library.
3649 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
3653 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3654 test "X$dir" = "X$file" && dir
=.
3656 if test -f "$dir/$objdir/$dlname"; then
3659 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
3665 # Just add the directory containing the .lo file.
3666 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3667 test "X$dir" = "X$file" && dir
=.
3671 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
3676 # Get the absolute pathname.
3677 absdir
=`cd "$dir" && pwd`
3678 test -n "$absdir" && dir
="$absdir"
3680 # Now add the directory to shlibpath_var.
3681 if eval "test -z \"\$$shlibpath_var\""; then
3682 eval "$shlibpath_var=\"\$dir\""
3684 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3688 # This variable tells wrapper scripts just to set shlibpath_var
3689 # rather than running their programs.
3690 libtool_execute_magic
="$magic"
3692 # Check if any of the arguments is a wrapper script.
3699 # Do a test to see if this is really a libtool program.
3700 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
3701 # If there is no directory component, then add one.
3703 */* |
*\\*) .
$file ;;
3707 # Transform arg to wrapped name.
3708 file="$progdir/$program"
3712 # Quote arguments (to preserve shell metacharacters).
3713 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
3714 args
="$args \"$file\""
3717 if test -z "$run"; then
3718 if test -n "$shlibpath_var"; then
3719 # Export the shlibpath_var.
3720 eval "export $shlibpath_var"
3723 # Restore saved enviroment variables
3724 if test "${save_LC_ALL+set}" = set; then
3725 LC_ALL
="$save_LC_ALL"; export LC_ALL
3727 if test "${save_LANG+set}" = set; then
3728 LANG
="$save_LANG"; export LANG
3731 # Now actually exec the command.
3732 eval "exec \$cmd$args"
3734 $echo "$modename: cannot exec \$cmd$args"
3737 # Display what would be done.
3738 if test -n "$shlibpath_var"; then
3739 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
3740 $echo "export $shlibpath_var"
3747 # libtool uninstall mode
3749 modename
="$modename: uninstall"
3756 -*) rm="$rm $arg" ;;
3757 *) files
="$files $arg" ;;
3761 if test -z "$rm"; then
3762 $echo "$modename: you must specify an RM program" 1>&2
3767 for file in $files; do
3768 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3769 test "X$dir" = "X$file" && dir
=.
3770 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3776 # Possibly a libtool archive, so verify it.
3777 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
3780 # Delete the libtool libraries and symlinks.
3781 for n
in $library_names; do
3782 rmfiles
="$rmfiles $dir/$n"
3784 test -n "$old_library" && rmfiles
="$rmfiles $dir/$old_library"
3786 $show "$rm $rmfiles"
3789 if test -n "$library_names"; then
3790 # Do each command in the postuninstall commands.
3791 eval cmds
=\"$postuninstall_cmds\"
3792 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3793 for cmd
in $cmds; do
3801 if test -n "$old_library"; then
3802 # Do each command in the old_postuninstall commands.
3803 eval cmds
=\"$old_postuninstall_cmds\"
3804 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
3805 for cmd
in $cmds; do
3813 # FIXME: should reinstall the best remaining shared library.
3818 if test "$build_old_libs" = yes; then
3819 oldobj
=`$echo "X$name" | $Xsed -e "$lo2o"`
3820 rmfiles
="$rmfiles $dir/$oldobj"
3822 $show "$rm $rmfiles"
3827 $show "$rm $rmfiles"
3836 $echo "$modename: you must specify a MODE" 1>&2
3837 $echo "$generic_help" 1>&2
3842 $echo "$modename: invalid operation mode \`$mode'" 1>&2
3843 $echo "$generic_help" 1>&2
3845 fi # test -z "$show_help"
3847 # We need to display help for each of the modes.
3850 "Usage: $modename [OPTION]... [MODE-ARG]...
3852 Provide generalized library-building support services.
3854 --config show all configuration variables
3855 --debug enable verbose shell tracing
3856 -n, --dry-run display commands without modifying any files
3857 --features display basic configuration information and exit
3858 --finish same as \`--mode=finish'
3859 --help display this help message and exit
3860 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
3861 --quiet same as \`--silent'
3862 --silent don't print informational messages
3863 --version print version information
3865 MODE must be one of the following:
3867 compile compile a source file into a libtool object
3868 execute automatically set library path, then run a program
3869 finish complete the installation of libtool libraries
3870 install install libraries or executables
3871 link create a library or an executable
3872 uninstall remove libraries from an installed directory
3874 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
3875 a more detailed description of MODE."
3881 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
3883 Compile a source file into a libtool library object.
3885 This mode accepts the following additional options:
3887 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
3888 -static always build a \`.o' file suitable for static linking
3890 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
3891 from the given SOURCEFILE.
3893 The output file name is determined by removing the directory component from
3894 SOURCEFILE, then substituting the C source code suffix \`.c' with the
3895 library object suffix, \`.lo'."
3900 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
3902 Automatically set library path, then run a program.
3904 This mode accepts the following additional options:
3906 -dlopen FILE add the directory containing FILE to the library path
3908 This mode sets the library path environment variable according to \`-dlopen'
3911 If any of the ARGS are libtool executable wrappers, then they are translated
3912 into their corresponding uninstalled binary, and any of their required library
3913 directories are added to the library path.
3915 Then, COMMAND is executed, with ARGS as arguments."
3920 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
3922 Complete the installation of libtool libraries.
3924 Each LIBDIR is a directory that contains libtool libraries.
3926 The commands that this mode executes may require superuser privileges. Use
3927 the \`--dry-run' option if you just want to see what would be executed."
3932 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
3934 Install executables or libraries.
3936 INSTALL-COMMAND is the installation command. The first component should be
3937 either the \`install' or \`cp' program.
3939 The rest of the components are interpreted as arguments to that command (only
3940 BSD-compatible install options are recognized)."
3945 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
3947 Link object files or libraries together to form another library, or to
3948 create an executable program.
3950 LINK-COMMAND is a command using the C compiler that you would use to create
3951 a program from several object files.
3953 The following components of LINK-COMMAND are treated specially:
3955 -all-static do not do any dynamic linking at all
3956 -avoid-version do not add a version suffix if possible
3957 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
3958 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
3959 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3960 -export-symbols SYMFILE
3961 try to export only the symbols listed in SYMFILE
3962 -export-symbols-regex REGEX
3963 try to export only the symbols matching REGEX
3964 -LLIBDIR search LIBDIR for required installed libraries
3965 -lNAME OUTPUT-FILE requires the installed library libNAME
3966 -module build a library that can dlopened
3967 -no-undefined declare that a library does not refer to external symbols
3968 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
3969 -release RELEASE specify package release information
3970 -rpath LIBDIR the created library will eventually be installed in LIBDIR
3971 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
3972 -static do not do any dynamic linking of libtool libraries
3973 -version-info CURRENT[:REVISION[:AGE]]
3974 specify library version info [each variable defaults to 0]
3976 All other options (arguments beginning with \`-') are ignored.
3978 Every other argument is treated as a filename. Files ending in \`.la' are
3979 treated as uninstalled libtool libraries, other files are standard or library
3982 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
3983 only library objects (\`.lo' files) may be specified, and \`-rpath' is
3984 required, except when creating a convenience library.
3986 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
3987 using \`ar' and \`ranlib', or on Windows using \`lib'.
3989 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
3990 is created, otherwise an executable program is created."
3995 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
3997 Remove libraries from an installation directory.
3999 RM is the name of the program to use to delete files associated with each FILE
4000 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4003 If FILE is a libtool library, all the files associated with it are deleted.
4004 Otherwise, only FILE itself is deleted using RM."
4008 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4015 $echo "Try \`$modename --help' for more information about other modes."