Solaris' ln needs -s -f instead of -sf.
[kdbg.git] / ltmain.sh
blobf43564a257d7a6b7f140c5801c3ec59f8e0833a9
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.
29 shift
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!
36 else
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
43 shift
44 cat <<EOF
46 EOF
47 exit 0
50 # The name of this program.
51 progname=`$echo "$0" | sed 's%^.*/%%'`
52 modename="$progname"
54 # Constants.
55 PROGRAM=ltmain.sh
56 PACKAGE=libtool
57 VERSION=1.3a
58 TIMESTAMP=" (1.542 1999/05/27 10:56:10)"
60 default_mode=
61 help="Try \`$progname --help' for more information."
62 magic="%%%MAGIC variable%%%"
63 mkdir="mkdir"
64 mv="mv -f"
65 rm="rm -f"
67 # Sed substitution that helps us do robust quoting. It backslashifies
68 # metacharacters that are still active within double-quoted strings.
69 Xsed='sed -e 1s/^X//'
70 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
71 SP2NL='tr \040 \012'
72 NL2SP='tr \012 \040'
74 # NLS nuisances.
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
89 exit 1
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
95 exit 1
98 # Global variables.
99 mode=$default_mode
100 nonopt=
101 prev=
102 prevopt=
103 run=
104 show="$echo"
105 show_help=
106 execute_dlfiles=
107 lo2o="s/\\.lo\$/.${objext}/"
108 o2lo="s/\\.${objext}\$/.lo/"
110 # Parse our command line options once, thoroughly.
111 while test $# -gt 0
113 arg="$1"
114 shift
116 case "$arg" in
117 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
118 *) optarg= ;;
119 esac
121 # If the previous option needs an argument, assign it.
122 if test -n "$prev"; then
123 case "$prev" in
124 execute_dlfiles)
125 eval "$prev=\"\$$prev \$arg\""
128 eval "$prev=\$arg"
130 esac
132 prev=
133 prevopt=
134 continue
137 # Have we seen a non-optional argument yet?
138 case "$arg" in
139 --help)
140 show_help=yes
143 --version)
144 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
145 exit 0
148 --config)
149 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
150 exit 0
153 --debug)
154 echo "$progname: enabling shell trace mode"
155 set -x
158 --dry-run | -n)
159 run=:
162 --features)
163 echo "host: $host"
164 if test "$build_libtool_libs" = yes; then
165 echo "enable shared libraries"
166 else
167 echo "disable shared libraries"
169 if test "$build_old_libs" = yes; then
170 echo "enable static libraries"
171 else
172 echo "disable static libraries"
174 exit 0
177 --finish) mode="finish" ;;
179 --mode) prevopt="--mode" prev=mode ;;
180 --mode=*) mode="$optarg" ;;
182 --quiet | --silent)
183 show=:
186 -dlopen)
187 prevopt="-dlopen"
188 prev=execute_dlfiles
192 $echo "$modename: unrecognized option \`$arg'" 1>&2
193 $echo "$help" 1>&2
194 exit 1
198 nonopt="$arg"
199 break
201 esac
202 done
204 if test -n "$prevopt"; then
205 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
206 $echo "$help" 1>&2
207 exit 1
210 if test -z "$show_help"; then
212 # Infer the operation mode.
213 if test -z "$mode"; then
214 case "$nonopt" in
215 *cc | *++ | gcc* | *-gcc*)
216 mode=link
217 for arg
219 case "$arg" in
221 mode=compile
222 break
224 esac
225 done
227 *db | *dbx | *strace | *truss)
228 mode=execute
230 *install*|cp|mv)
231 mode=install
233 *rm)
234 mode=uninstall
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
244 else
245 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
249 esac
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
255 $echo "$help" 1>&2
256 exit 1
259 # Change the help message to a mode-specific one.
260 generic_help="$help"
261 help="Try \`$modename --help --mode=$mode' for more information."
263 # These modes are in order of execution frequency so that they run quickly.
264 case "$mode" in
265 # libtool compile mode
266 compile)
267 modename="$modename: compile"
268 # Get the compilation command and the source file.
269 base_compile=
270 lastarg=
271 srcfile="$nonopt"
272 suppress_output=
274 user_target=no
275 for arg
277 # Accept any command-line options.
278 case "$arg" in
280 if test "$user_target" != "no"; then
281 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
282 exit 1
284 user_target=next
287 -static)
288 build_old_libs=yes
289 continue
291 esac
293 case "$user_target" in
294 next)
295 # The next one is the -o target name
296 user_target=yes
297 continue
299 yes)
300 # We got the output file
301 user_target=set
302 libobj="$arg"
303 continue
305 esac
307 # Accept the current argument as the source file.
308 lastarg="$srcfile"
309 srcfile="$arg"
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.
321 case "$lastarg" in
322 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
323 lastarg="\"$lastarg\""
325 esac
327 # Add the previous argument to base_compile.
328 if test -z "$base_compile"; then
329 base_compile="$lastarg"
330 else
331 base_compile="$base_compile $lastarg"
333 done
335 case "$user_target" in
336 set)
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
344 exit 1
346 esac
348 # Recognize several different file suffixes.
349 # If the user specifies -o file.o, it is replaced with file.lo
350 xform='[cCFSfmso]'
351 case "$libobj" in
352 *.ada) xform=ada ;;
353 *.adb) xform=adb ;;
354 *.ads) xform=ads ;;
355 *.asm) xform=asm ;;
356 *.c++) xform=c++ ;;
357 *.cc) xform=cc ;;
358 *.cpp) xform=cpp ;;
359 *.cxx) xform=cxx ;;
360 *.f90) xform=f90 ;;
361 *.for) xform=for ;;
362 esac
364 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
366 case "$libobj" in
367 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
369 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
370 exit 1
372 esac
374 if test -z "$base_compile"; then
375 $echo "$modename: you must specify a compilation command" 1>&2
376 $echo "$help" 1>&2
377 exit 1
380 # Delete any leftover library objects.
381 if test "$build_old_libs" = yes; then
382 removelist="$obj $libobj"
383 else
384 removelist="$libobj"
387 $run $rm $removelist
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
397 else
398 need_locks=no
399 lockfile=
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"
407 sleep 2
408 done
409 elif test "$need_locks" = warn; then
410 if test -f "$lockfile"; then
411 echo "\
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
420 compiler."
422 $run $rm $removelist
423 exit 1
425 echo $srcfile > "$lockfile"
428 if test -n "$fix_srcfile_path"; then
429 eval srcfile=\"$fix_srcfile_path\"
432 # Only build a PIC object if we are building libtool libraries.
433 if test "$build_libtool_libs" = yes; then
434 # Without this assignment, base_compile gets emptied.
435 fbsd_hideous_sh_bug=$base_compile
437 # All platforms use -DPIC, to notify preprocessed assembler code.
438 command="$base_compile $pic_flag -DPIC $srcfile"
439 if test "$build_old_libs" = yes; then
440 lo_libobj="$libobj"
441 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
442 if test "X$dir" = "X$libobj"; then
443 dir="$objdir"
444 else
445 dir="$dir/$objdir"
447 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
449 if test -d "$dir"; then
450 $show "$rm $libobj"
451 $run $rm $libobj
452 else
453 $show "$mkdir $dir"
454 $run $mkdir $dir
455 status=$?
456 if test $status -ne 0 && test ! -d $dir; then
457 exit $status
461 if test "$compiler_o_lo" = yes; then
462 output_obj="$libobj"
463 command="$command -o $output_obj"
464 elif test "$compiler_c_o" = yes; then
465 output_obj="$obj"
466 command="$command -o $output_obj"
469 $run $rm "$output_obj"
470 $show "$command"
471 if $run eval "$command"; then :
472 else
473 test -n "$output_obj" && $run $rm $removelist
474 exit 1
477 if test "$need_locks" = warn &&
478 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
479 echo "\
480 *** ERROR, $lockfile contains:
481 `cat $lockfile 2>/dev/null`
483 but it should contain:
484 $srcfile
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
491 compiler."
493 $run $rm $removelist
494 exit 1
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 :
501 else
502 error=$?
503 $run $rm $removelist
504 exit $error
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
512 $show $rm $obj
513 $run $rm $obj
516 $show "$mv $libobj $obj"
517 if $run $mv $libobj $obj; then :
518 else
519 error=$?
520 $run $rm $removelist
521 exit $error
524 # Now arrange that obj and lo_libobj become the same file
525 $show "$LN_S $obj $lo_libobj"
526 if $run $LN_S $obj $lo_libobj; then
527 exit 0
528 else
529 error=$?
530 $run $rm $removelist
531 exit $error
535 # Allow error messages only from the first compilation.
536 suppress_output=' >/dev/null 2>&1'
539 # Only build a position-dependent object if we build old libraries.
540 if test "$build_old_libs" = yes; then
541 command="$base_compile $srcfile"
542 if test "$compiler_c_o" = yes; then
543 command="$command -o $obj"
544 output_obj="$obj"
547 # Suppress compiler output if we already did a PIC compilation.
548 command="$command$suppress_output"
549 $run $rm "$output_obj"
550 $show "$command"
551 if $run eval "$command"; then :
552 else
553 $run $rm $removelist
554 exit 1
557 if test "$need_locks" = warn &&
558 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
559 echo "\
560 *** ERROR, $lockfile contains:
561 `cat $lockfile 2>/dev/null`
563 but it should contain:
564 $srcfile
566 This indicates that another process is trying to use the same
567 temporary object file, and libtool could not work around it because
568 your compiler does not support \`-c' and \`-o' together. If you
569 repeat this compilation, it may succeed, by chance, but you had better
570 avoid parallel builds (make -j) in this platform, or get a better
571 compiler."
573 $run $rm $removelist
574 exit 1
577 # Just move the object if needed
578 if test x"$output_obj" != x"$obj"; then
579 $show "$mv $output_obj $obj"
580 if $run $mv $output_obj $obj; then :
581 else
582 error=$?
583 $run $rm $removelist
584 exit $error
588 # Create an invalid libtool object if no PIC, so that we do not
589 # accidentally link it into a program.
590 if test "$build_libtool_libs" != yes; then
591 $show "echo timestamp > $libobj"
592 $run eval "echo timestamp > \$libobj" || exit $?
593 else
594 # Move the .lo from within objdir
595 $show "$mv $libobj $lo_libobj"
596 if $run $mv $libobj $lo_libobj; then :
597 else
598 error=$?
599 $run $rm $removelist
600 exit $error
605 # Unlock the critical section if it was locked
606 if test "$need_locks" != no; then
607 $rm "$lockfile"
610 exit 0
613 # libtool link mode
614 link)
615 modename="$modename: link"
616 case "$host" in
617 *-*-cygwin* | *-*-mingw* | *-*-os2*)
618 # It is impossible to link a dll without this setting, and
619 # we shouldn't force the makefile maintainer to figure out
620 # which system we are compiling for in order to pass an extra
621 # flag for every libtool invokation.
622 # allow_undefined=no
624 # FIXME: Unfortunately, there are problems with the above when trying
625 # to make a dll which has undefined symbols, in which case not
626 # even a static library is built. For now, we need to specify
627 # -no-undefined on the libtool link line when we can be certain
628 # that all symbols are satisfied, otherwise we get a static library.
629 allow_undefined=yes
631 # This is a source program that is used to create dlls on Windows
632 # Don't remove nor modify the starting and closing comments
633 # /* ltdll.c starts here */
634 # #define WIN32_LEAN_AND_MEAN
635 # #include <windows.h>
636 # #undef WIN32_LEAN_AND_MEAN
637 # #include <stdio.h>
639 # #ifdef __cplusplus
640 # extern "C" {
641 # #endif
642 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
643 # #ifdef __cplusplus
645 # #endif
647 # #include <cygwin/cygwin_dll.h>
648 # DECLARE_CYGWIN_DLL( DllMain );
649 # HINSTANCE __hDllInstance_base;
651 # BOOL APIENTRY
652 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
654 # __hDllInstance_base = hInst;
655 # return TRUE;
657 # /* ltdll.c ends here */
658 # This is a source program that is used to create import libraries
659 # on Windows for dlls which lack them. Don't remove nor modify the
660 # starting and closing comments
661 # /* impgen.c starts here */
662 # /* Copyright (C) 1999 Free Software Foundation, Inc.
664 # This file is part of GNU libtool.
666 # This program is free software; you can redistribute it and/or modify
667 # it under the terms of the GNU General Public License as published by
668 # the Free Software Foundation; either version 2 of the License, or
669 # (at your option) any later version.
671 # This program is distributed in the hope that it will be useful,
672 # but WITHOUT ANY WARRANTY; without even the implied warranty of
673 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
674 # GNU General Public License for more details.
676 # You should have received a copy of the GNU General Public License
677 # along with this program; if not, write to the Free Software
678 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
679 # */
681 # #include <stdio.h> /* for printf() */
682 # #include <unistd.h> /* for open(), lseek(), read() */
683 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
684 # #include <string.h> /* for strdup() */
686 # static unsigned int
687 # pe_get16 (fd, offset)
688 # int fd;
689 # int offset;
691 # unsigned char b[2];
692 # lseek (fd, offset, SEEK_SET);
693 # read (fd, b, 2);
694 # return b[0] + (b[1]<<8);
697 # static unsigned int
698 # pe_get32 (fd, offset)
699 # int fd;
700 # int offset;
702 # unsigned char b[4];
703 # lseek (fd, offset, SEEK_SET);
704 # read (fd, b, 4);
705 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
708 # static unsigned int
709 # pe_as32 (ptr)
710 # void *ptr;
712 # unsigned char *b = ptr;
713 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
716 # int
717 # main (argc, argv)
718 # int argc;
719 # char *argv[];
721 # int dll;
722 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
723 # unsigned long export_rva, export_size, nsections, secptr, expptr;
724 # unsigned long name_rvas, nexp;
725 # unsigned char *expdata, *erva;
726 # char *filename, *dll_name;
728 # filename = argv[1];
730 # dll = open(filename, O_RDONLY|O_BINARY);
731 # if (!dll)
732 # return 1;
734 # dll_name = filename;
736 # for (i=0; filename[i]; i++)
737 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
738 # dll_name = filename + i +1;
740 # pe_header_offset = pe_get32 (dll, 0x3c);
741 # opthdr_ofs = pe_header_offset + 4 + 20;
742 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
744 # if (num_entries < 1) /* no exports */
745 # return 1;
747 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
748 # export_size = pe_get32 (dll, opthdr_ofs + 100);
749 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
750 # secptr = (pe_header_offset + 4 + 20 +
751 # pe_get16 (dll, pe_header_offset + 4 + 16));
753 # expptr = 0;
754 # for (i = 0; i < nsections; i++)
756 # char sname[8];
757 # unsigned long secptr1 = secptr + 40 * i;
758 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
759 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
760 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
761 # lseek(dll, secptr1, SEEK_SET);
762 # read(dll, sname, 8);
763 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
765 # expptr = fptr + (export_rva - vaddr);
766 # if (export_rva + export_size > vaddr + vsize)
767 # export_size = vsize - (export_rva - vaddr);
768 # break;
772 # expdata = (unsigned char*)malloc(export_size);
773 # lseek (dll, expptr, SEEK_SET);
774 # read (dll, expdata, export_size);
775 # erva = expdata - export_rva;
777 # nexp = pe_as32 (expdata+24);
778 # name_rvas = pe_as32 (expdata+32);
780 # printf ("EXPORTS\n");
781 # for (i = 0; i<nexp; i++)
783 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
784 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
787 # return 0;
789 # /* impgen.c ends here */
792 allow_undefined=yes
794 esac
795 compile_command="$CC"
796 finalize_command="$CC"
798 compile_rpath=
799 finalize_rpath=
800 compile_shlibpath=
801 finalize_shlibpath=
802 convenience=
803 old_convenience=
804 deplibs=
805 compiler_flags=
806 linker_flags=
807 dllsearchpath=
808 lib_search_path=`pwd`
810 avoid_version=no
811 dlfiles=
812 dlprefiles=
813 dlself=no
814 export_dynamic=no
815 export_symbols=
816 export_symbols_regex=
817 generated=
818 libobjs=
819 ltlibs=
820 module=no
821 objs=
822 prefer_static_libs=no
823 preload=no
824 prev=
825 prevarg=
826 release=
827 rpath=
828 xrpath=
829 perm_rpath=
830 temp_rpath=
831 thread_safe=no
832 vinfo=
834 # We need to know -static, to get the right output filenames.
835 for arg
837 case "$arg" in
838 -all-static | -static)
839 if test "X$arg" = "X-all-static"; then
840 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
841 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
843 if test -n "$link_static_flag"; then
844 dlopen_self=$dlopen_self_static
846 else
847 if test -z "$pic_flag" && test -n "$link_static_flag"; then
848 dlopen_self=$dlopen_self_static
851 build_libtool_libs=no
852 build_old_libs=yes
853 prefer_static_libs=yes
854 break
856 esac
857 done
859 # See if our shared archives depend on static archives.
860 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
862 # Go through the arguments, transforming them on the way.
863 while test $# -gt 0; do
864 arg="$1"
865 shift
867 # If the previous option needs an argument, assign it.
868 if test -n "$prev"; then
869 case "$prev" in
870 output)
871 compile_command="$compile_command @OUTPUT@"
872 finalize_command="$finalize_command @OUTPUT@"
874 esac
876 case "$prev" in
877 dlfiles|dlprefiles)
878 if test "$preload" = no; then
879 # Add the symbol object into the linking commands.
880 compile_command="$compile_command @SYMFILE@"
881 finalize_command="$finalize_command @SYMFILE@"
882 preload=yes
884 case "$arg" in
885 *.la | *.lo) ;; # We handle these cases below.
886 self)
887 if test "$prev" = dlprefiles; then
888 dlself=yes
889 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
890 dlself=yes
891 else
892 dlself=needless
893 export_dynamic=yes
895 prev=
896 continue
899 if test "$prev" = dlfiles; then
900 dlfiles="$dlfiles $arg"
901 else
902 dlprefiles="$dlprefiles $arg"
904 prev=
906 esac
908 expsyms)
909 export_symbols="$arg"
910 if test ! -f "$arg"; then
911 $echo "$modename: symbol file \`$arg' does not exist"
912 exit 1
914 prev=
915 continue
917 expsyms_regex)
918 export_symbols_regex="$arg"
919 prev=
920 continue
922 release)
923 release="-$arg"
924 prev=
925 continue
927 rpath | xrpath)
928 # We need an absolute path.
929 case "$arg" in
930 [\\/]* | [A-Za-z]:[\\/]*) ;;
932 $echo "$modename: only absolute run-paths are allowed" 1>&2
933 exit 1
935 esac
936 if test "$prev" = rpath; then
937 case "$rpath " in
938 *" $arg "*) ;;
939 *) rpath="$rpath $arg" ;;
940 esac
941 else
942 case "$xrpath " in
943 *" $arg "*) ;;
944 *) xrpath="$xrpath $arg" ;;
945 esac
947 prev=
948 continue
950 xcompiler)
951 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
952 case "$arg" in
953 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
954 arg="\"$arg\""
956 esac
957 compiler_flags="$compiler_flags $arg"
958 prev=
959 continue
961 xlinker)
962 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
963 case "$arg" in
964 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
965 arg="\"$arg\""
967 esac
968 linker_flags="$linker_flags $arg"
969 compiler_flags="$compiler_flags $wl$arg"
970 prev=
971 continue
974 eval "$prev=\"\$arg\""
975 prev=
976 continue
978 esac
981 prevarg="$arg"
983 case "$arg" in
984 -all-static)
985 if test -n "$link_static_flag"; then
986 compile_command="$compile_command $link_static_flag"
987 finalize_command="$finalize_command $link_static_flag"
989 continue
992 -allow-undefined)
993 # FIXME: remove this flag sometime in the future.
994 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
995 continue
998 -avoid-version)
999 avoid_version=yes
1000 continue
1003 -dlopen)
1004 prev=dlfiles
1005 continue
1008 -dlpreopen)
1009 prev=dlprefiles
1010 continue
1013 -export-dynamic)
1014 export_dynamic=yes
1015 continue
1018 -export-symbols | -export-symbols-regex)
1019 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1020 $echo "$modename: not more than one -exported-symbols argument allowed"
1021 exit 1
1023 if test "X$arg" = "X-export-symbols"; then
1024 prev=expsyms
1025 else
1026 prev=expsyms_regex
1028 continue
1031 -L*)
1032 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1033 # We need an absolute path.
1034 case "$dir" in
1035 [\\/]* | [A-Za-z]:[\\/]*) ;;
1037 absdir=`cd "$dir" && pwd`
1038 if test -z "$absdir"; then
1039 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1040 exit 1
1042 dir="$absdir"
1044 esac
1045 case "$deplibs " in
1046 *" -L$dir "*) ;;
1048 deplibs="$deplibs -L$dir"
1049 lib_search_path="$lib_search_path $dir"
1051 esac
1052 case "$host" in
1053 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1054 case ":$dllsearchpath:" in
1055 *":$dir:"*) ;;
1056 *) dllsearchpath="$dllsearchpath:$dir";;
1057 esac
1059 esac
1060 continue
1063 -l*)
1064 if test "$arg" = "-lc"; then
1065 case "$host" in
1066 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1067 # These systems don't actually have c library (as such)
1068 continue
1070 esac
1071 elif test "$arg" = "-lm"; then
1072 case "$host" in
1073 *-*-cygwin* | *-*-beos*)
1074 # These systems don't actually have math library (as such)
1075 continue
1077 esac
1079 deplibs="$deplibs $arg"
1080 continue
1083 -module)
1084 module=yes
1085 continue
1088 -no-undefined)
1089 allow_undefined=no
1090 continue
1093 -o) prev=output ;;
1095 -release)
1096 prev=release
1097 continue
1100 -rpath)
1101 prev=rpath
1102 continue
1106 prev=xrpath
1107 continue
1110 -R*)
1111 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1112 # We need an absolute path.
1113 case "$dir" in
1114 [\\/]* | [A-Za-z]:[\\/]*) ;;
1116 $echo "$modename: only absolute run-paths are allowed" 1>&2
1117 exit 1
1119 esac
1120 case "$xrpath " in
1121 *" $dir "*) ;;
1122 *) xrpath="$xrpath $dir" ;;
1123 esac
1124 continue
1127 -static)
1128 # If we have no pic_flag, then this is the same as -all-static.
1129 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1130 compile_command="$compile_command $link_static_flag"
1131 finalize_command="$finalize_command $link_static_flag"
1133 continue
1136 -thread-safe)
1137 thread_safe=yes
1138 continue
1141 -version-info)
1142 prev=vinfo
1143 continue
1146 -Wc,*)
1147 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1148 case "$arg" in
1149 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1150 arg="\"$arg\""
1152 esac
1153 flag=`$echo "X$arg" | $Xsed -e 's/^-Wc,//'`
1154 compiler_flags="$compiler_flags $flag"
1157 -Wl,*)
1158 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1159 case "$arg" in
1160 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1161 arg="\"$arg\""
1163 esac
1164 flag=`$echo "X$arg" | $Xsed -e 's/^-Wl,//'`
1165 linker_flags="$linker_flags $flag"
1166 compiler_flags="$compiler_flags $wl$flag"
1169 -Xcompiler)
1170 prev=xcompiler
1171 continue
1174 -Xlinker)
1175 prev=xlinker
1176 continue
1179 # Some other compiler flag.
1180 -* | +*)
1181 # Unknown arguments in both finalize_command and compile_command need
1182 # to be aesthetically quoted because they are evaled later.
1183 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1184 case "$arg" in
1185 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1186 arg="\"$arg\""
1188 esac
1191 *.o | *.obj | *.a | *.lib)
1192 # A standard object.
1193 objs="$objs $arg"
1196 *.lo)
1197 # A library object.
1198 if test "$prev" = dlfiles; then
1199 dlfiles="$dlfiles $arg"
1200 if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
1201 prev=
1202 continue
1203 else
1204 # If libtool objects are unsupported, then we need to preload.
1205 prev=dlprefiles
1209 if test "$prev" = dlprefiles; then
1210 # Preload the old-style object.
1211 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1212 prev=
1214 libobjs="$libobjs $arg"
1217 *.la)
1218 # A libtool-controlled library.
1220 dlname=
1221 libdir=
1222 library_names=
1223 old_library=
1225 # Check to see that this really is a libtool archive.
1226 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1227 else
1228 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
1229 exit 1
1232 # If the library was installed with an old release of libtool,
1233 # it will not redefine variable installed.
1234 installed=yes
1236 # Read the .la file
1237 # If there is no directory component, then add one.
1238 case "$arg" in
1239 */* | *\\*) . $arg ;;
1240 *) . ./$arg ;;
1241 esac
1243 # Get the name of the library we link against.
1244 linklib=
1245 for l in $old_library $library_names; do
1246 linklib="$l"
1247 done
1249 if test -z "$linklib"; then
1250 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
1251 exit 1
1254 if test "X$installed" = Xyes; then
1255 dir="$libdir"
1256 else
1257 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1258 if test "X$dir" = "X$arg"; then
1259 dir="$objdir"
1260 else
1261 dir="$dir/$objdir"
1265 # This library was specified with -dlopen.
1266 if test "$prev" = dlfiles; then
1267 dlfiles="$dlfiles $arg"
1268 if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
1269 # If there is no dlname, no dlopen support or we're linking statically,
1270 # we need to preload.
1271 prev=dlprefiles
1272 else
1273 # We should not create a dependency on this library
1274 prev=
1275 continue
1279 # The library was specified with -dlpreopen.
1280 if test "$prev" = dlprefiles; then
1281 # Prefer using a static library (so that no silly _DYNAMIC symbols
1282 # are required to link).
1283 if test -n "$old_library"; then
1284 dlprefiles="$dlprefiles $dir/$old_library"
1285 else
1286 dlprefiles="$dlprefiles $dir/$linklib"
1288 prev=
1291 deplibs="$deplibs $arg"
1292 continue
1295 # Some other compiler argument.
1297 # Unknown arguments in both finalize_command and compile_command need
1298 # to be aesthetically quoted because they are evaled later.
1299 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1300 case "$arg" in
1301 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1302 arg="\"$arg\""
1304 esac
1306 esac
1308 # Now actually substitute the argument into the commands.
1309 if test -n "$arg"; then
1310 compile_command="$compile_command $arg"
1311 finalize_command="$finalize_command $arg"
1313 done
1315 if test -n "$prev"; then
1316 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1317 $echo "$help" 1>&2
1318 exit 1
1321 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1322 eval arg=\"$export_dynamic_flag_spec\"
1323 compile_command="$compile_command $arg"
1324 finalize_command="$finalize_command $arg"
1327 oldlibs=
1328 # calculate the name of the file, without its directory
1329 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1330 libobjs_save="$libobjs"
1332 if test -n "$shlibpath_var"; then
1333 # get the directories listed in $shlibpath_var
1334 eval shlib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1335 else
1336 shlib_search_path=
1338 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1339 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1340 lib_search_path="$lib_search_path $sys_lib_search_path $shlib_search_path"
1342 case "$output" in
1344 $echo "$modename: you must specify an output file" 1>&2
1345 $echo "$help" 1>&2
1346 exit 1
1349 *.a | *.lib)
1350 if test -n "$deplibs"; then
1351 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1354 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1355 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1358 if test -n "$rpath"; then
1359 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
1362 if test -n "$xrpath"; then
1363 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
1366 if test -n "$vinfo"; then
1367 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1370 if test -n "$release"; then
1371 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
1374 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1375 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1378 # Now set the variables for building old libraries.
1379 build_libtool_libs=no
1380 oldlibs="$output"
1383 *.la)
1384 # Make sure we only generate libraries of the form `libNAME.la'.
1385 case "$outputname" in
1386 lib*)
1387 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1388 eval libname=\"$libname_spec\"
1391 if test "$module" = no; then
1392 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
1393 $echo "$help" 1>&2
1394 exit 1
1396 if test "$need_lib_prefix" != no; then
1397 # Add the "lib" prefix for modules if required
1398 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1399 eval libname=\"$libname_spec\"
1400 else
1401 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1404 esac
1406 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1407 if test "X$output_objdir" = "X$output"; then
1408 output_objdir="$objdir"
1409 else
1410 output_objdir="$output_objdir/$objdir"
1413 if test -n "$objs"; then
1414 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1415 exit 1
1418 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1419 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1422 set dummy $rpath
1423 if test $# -gt 2; then
1424 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1426 install_libdir="$2"
1428 oldlibs=
1429 if test -z "$rpath"; then
1430 if test "$build_libtool_libs" = yes; then
1431 # Building a libtool convenience library.
1432 libext=al
1433 oldlibs="$output_objdir/$libname.$libext $oldlibs"
1434 build_libtool_libs=convenience
1435 build_old_libs=yes
1438 if test -n "$vinfo"; then
1439 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1442 if test -n "$release"; then
1443 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1445 else
1447 # Parse the version information argument.
1448 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
1449 set dummy $vinfo 0 0 0
1450 IFS="$save_ifs"
1452 if test -n "$8"; then
1453 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1454 $echo "$help" 1>&2
1455 exit 1
1458 current="$2"
1459 revision="$3"
1460 age="$4"
1462 # Check that each of the things are valid numbers.
1463 case "$current" in
1464 0 | [1-9] | [1-9][0-9]*) ;;
1466 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1467 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1468 exit 1
1470 esac
1472 case "$revision" in
1473 0 | [1-9] | [1-9][0-9]*) ;;
1475 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1476 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1477 exit 1
1479 esac
1481 case "$age" in
1482 0 | [1-9] | [1-9][0-9]*) ;;
1484 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1485 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1486 exit 1
1488 esac
1490 if test $age -gt $current; then
1491 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1492 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1493 exit 1
1496 # Calculate the version variables.
1497 major=
1498 versuffix=
1499 verstring=
1500 case "$version_type" in
1501 none) ;;
1503 irix)
1504 major=`expr $current - $age + 1`
1505 versuffix="$major.$revision"
1506 verstring="sgi$major.$revision"
1508 # Add in all the interfaces that we are compatible with.
1509 loop=$revision
1510 while test $loop != 0; do
1511 iface=`expr $revision - $loop`
1512 loop=`expr $loop - 1`
1513 verstring="sgi$major.$iface:$verstring"
1514 done
1517 linux)
1518 major=.`expr $current - $age`
1519 versuffix="$major.$age.$revision"
1522 osf)
1523 major=`expr $current - $age`
1524 versuffix=".$current.$age.$revision"
1525 verstring="$current.$age.$revision"
1527 # Add in all the interfaces that we are compatible with.
1528 loop=$age
1529 while test $loop != 0; do
1530 iface=`expr $current - $loop`
1531 loop=`expr $loop - 1`
1532 verstring="$verstring:${iface}.0"
1533 done
1535 # Make executables depend on our current version.
1536 verstring="$verstring:${current}.0"
1539 sunos)
1540 major=".$current"
1541 versuffix=".$current.$revision"
1544 freebsd-aout)
1545 major=".$current"
1546 versuffix=".$current.$revision";
1549 freebsd-elf)
1550 major=".$current"
1551 versuffix=".$current";
1554 windows)
1555 # Like Linux, but with '-' rather than '.', since we only
1556 # want one extension on Windows 95.
1557 major=`expr $current - $age`
1558 versuffix="-$major-$age-$revision"
1562 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1563 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1564 exit 1
1566 esac
1568 # Clear the version info if we defaulted, and they specified a release.
1569 if test -z "$vinfo" && test -n "$release"; then
1570 major=
1571 verstring="0.0"
1572 if test "$need_version" = no; then
1573 versuffix=
1574 else
1575 versuffix=".0.0"
1579 # Remove version info from name if versioning should be avoided
1580 if test "$avoid_version" = yes && test "$need_version" = no; then
1581 major=
1582 versuffix=
1583 verstring=""
1586 # Check to see if the archive will have undefined symbols.
1587 if test "$allow_undefined" = yes; then
1588 if test "$allow_undefined_flag" = unsupported; then
1589 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1590 build_libtool_libs=no
1591 build_old_libs=yes
1593 else
1594 # Don't allow undefined symbols.
1595 allow_undefined_flag="$no_undefined_flag"
1599 # Create the output directory, or remove our outputs if we need to.
1600 if test -d $output_objdir; then
1601 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
1602 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
1603 else
1604 $show "$mkdir $output_objdir"
1605 $run $mkdir $output_objdir
1606 status=$?
1607 if test $status -ne 0 && test ! -d $output_objdir; then
1608 exit $status
1612 # Now set the variables for building old libraries.
1613 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
1614 oldlibs="$oldlibs $output_objdir/$libname.$libext"
1616 # Transform .lo files to .o files.
1617 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
1620 # Save some variables
1621 name_save=$name
1622 libname_save=$libname
1624 # Find libtool libraries and add their dependencies and directories
1625 old_deplibs="$deplibs"
1626 deplibs= # libraries to link (used in archive_cmds)
1627 newdependency_libs= # all dependency libraries
1628 uninst_path= # paths that contain uninstalled libtool libraries
1629 new_lib_search_path=
1630 for deplib in $old_deplibs; do
1631 lib=
1632 case "$deplib" in
1633 -L*)
1634 case "$deplibs " in
1635 *" $deplib "*) ;;
1637 deplibs="$deplibs $deplib"
1638 newdependency_libs="$newdependency_libs $deplib"
1639 new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1641 esac
1642 continue
1644 -l*)
1645 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1646 found=no
1647 for searchdir in $lib_search_path; do
1648 # Search the libtool library
1649 lib="$searchdir/lib${name}.la"
1650 if test -f "$lib"; then
1651 found=yes
1652 break
1654 done
1655 if test "$found" != yes; then
1656 deplibs="$deplibs $deplib"
1657 newdependency_libs="$newdependency_libs $deplib"
1658 continue
1662 lib="$deplib"
1663 if test -f "$lib"; then :
1664 else
1665 $echo "$modename: cannot find the library \`$lib'" 1>&2
1666 exit 1
1669 esac
1670 dlname=
1671 libdir=
1672 library_names=
1673 old_library=
1675 # Check to see that this really is a libtool archive.
1676 if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1677 else
1678 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1679 exit 1
1682 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1683 test "X$ladir" = "X$lib" && ladir="."
1684 # We need an absolute path.
1685 case "$ladir" in
1686 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1688 abs_ladir=`cd "$ladir" && pwd`
1689 if test -z "$abs_ladir"; then
1690 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1691 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1692 absdir="$dir"
1695 esac
1696 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1698 # If the library was installed with an old release of libtool,
1699 # it will not redefine variable installed.
1700 installed=yes
1702 # Read the .la file
1703 case "$lib" in
1704 */* | *\\*) . $lib ;;
1705 *) . ./$lib ;;
1706 esac
1708 # Get the name of the library we link against.
1709 linklib=
1710 for l in $old_library $library_names; do
1711 linklib="$l"
1712 done
1714 if test -z "$linklib"; then
1715 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1716 exit 1
1719 if test -z "$libdir"; then
1720 # It is a libtool convenience library, so add in its objects.
1721 convenience="$convenience $ladir/$objdir/$old_library"
1722 old_convenience="$old_convenience $ladir/$objdir/$old_library"
1723 deplibs="$deplibs $ladir/$objdir/$old_library"
1724 newdependency_libs="$newdependency_libs $dependency_libs"
1725 continue
1728 # Find the relevant object directory and library name.
1729 if test "X$installed" = Xyes; then
1730 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1731 $echo "$modename: warning: library \`$lib' was moved." 1>&2
1732 dir="$ladir"
1733 absdir="$abs_ladir"
1734 libdir="$abs_ladir"
1735 else
1736 dir="$libdir"
1737 absdir="$libdir"
1739 else
1740 dir="$ladir/$objdir"
1741 absdir="$abs_ladir/$objdir"
1742 # Remove this search path later
1743 uninst_path="$uninst_path $abs_ladir"
1745 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1746 link_static=no # Whether this library is linked statically
1748 if test -n "$library_names" &&
1749 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1750 # This is a shared library
1751 if test -n "$old_archive_from_expsyms_cmds"; then
1752 # figure out the soname
1753 set dummy $library_names
1754 realname="$2"
1755 shift; shift
1756 libname=`eval \\$echo \"$libname_spec\"`
1757 if test -n "$soname_spec"; then
1758 eval soname=\"$soname_spec\"
1759 else
1760 soname="$realname"
1763 # Make a new name for the extract_expsyms_cmds to use
1764 newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
1766 # If the library has no export list, then create one now
1767 if test -f "$output_objdir/$soname-def"; then :
1768 else
1769 $show "extracting exported symbol list from \`$soname'"
1770 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
1771 eval cmds=\"$extract_expsyms_cmds\"
1772 for cmd in $cmds; do
1773 IFS="$save_ifs"
1774 $show "$cmd"
1775 $run eval "$cmd" || exit $?
1776 done
1777 IFS="$save_ifs"
1780 # Create $newlib
1781 if test -f "$output_objdir/$newlib"; then :; else
1782 $show "generating import library for \`$soname'"
1783 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
1784 eval cmds=\"$old_archive_from_expsyms_cmds\"
1785 for cmd in $cmds; do
1786 IFS="$save_ifs"
1787 $show "$cmd"
1788 $run eval "$cmd" || exit $?
1789 done
1790 IFS="$save_ifs"
1792 # make sure the library variables are pointing to the new library
1793 dir=$output_objdir
1794 linklib=$newlib
1797 add_dir=
1798 add_shlibpath=
1799 add_name=no
1800 lib_linked=yes
1801 case "$hardcode_action" in
1802 immediate | unsupported)
1803 if test "$hardcode_direct" = no; then
1804 deplibs="$deplibs $dir/$linklib"
1805 elif test "$hardcode_minus_L" = no; then
1806 case "$host" in
1807 *-*-sunos*) add_shlibpath="$dir" ;;
1808 esac
1809 add_dir="-L$dir"
1810 add_name=yes
1811 elif test "$hardcode_shlibpath_var" = no; then
1812 add_shlibpath="$dir"
1813 add_name=yes
1814 else
1815 lib_linked=no
1818 relink)
1819 if test "$hardcode_direct" = yes; then
1820 deplibs="$deplibs $dir/$linklib"
1821 elif test "$hardcode_minus_L" = yes; then
1822 add_dir="-L$dir"
1823 add_name=yes
1824 elif test "$hardcode_shlibpath_var" = yes; then
1825 add_shlibpath="$dir"
1826 add_name=yes
1827 else
1828 lib_linked=no
1831 *) lib_linked=no ;;
1832 esac
1834 if test "$lib_linked" != yes; then
1835 $echo "$modename: configuration error: unsupported hardcode properties"
1836 exit 1
1838 if test -n "$add_shlibpath"; then
1839 case ":$compile_shlibpath:" in
1840 *":$add_shlibpath:"*) ;;
1841 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
1842 esac
1844 if test -n "$add_dir"; then
1845 case "$deplibs " in
1846 *" $add_dir "*) ;;
1847 *) deplibs="$deplibs $add_dir" ;;
1848 esac
1850 test "$add_name" = yes && deplibs="$deplibs -l$name"
1851 elif test "$build_libtool_libs" = yes; then
1852 # Not a shared library
1853 if test "$deplibs_check_method" != pass_all; then
1854 # We're trying link a shared library against a static one
1855 # but the system doesn't support it.
1856 # Just print a warning and add the library to dependency_libs so
1857 # that the program can be linked against the static library.
1858 echo
1859 echo "*** Warning: This library needs some functionality provided by $libname."
1860 echo "*** I have the capability to make that library automatically link in when"
1861 echo "*** you link to this library. But I can only do this if you have a"
1862 echo "*** shared version of the library, which you do not appear to have."
1863 else
1864 convenience="$convenience $dir/$old_library"
1865 old_convenience="$old_convenience $dir/$old_library"
1866 deplibs="$deplibs $dir/$old_library"
1867 link_static=yes
1871 if test -n "$dependency_libs"; then
1872 # Extract -R from dependency_libs
1873 temp_deplibs=
1874 for libdir in $dependency_libs; do
1875 case "$libdir" in
1876 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
1877 case " $xrpath " in
1878 *" $temp_xrpath "*) ;;
1879 *) xrpath="$xrpath $temp_xrpath";;
1880 esac;;
1881 *) temp_deplibs="$temp_deplibs $libdir";;
1882 esac
1883 done
1884 dependency_libs="$temp_deplibs"
1887 new_lib_search_path="$new_lib_search_path $absdir"
1888 # Link against this library
1889 test "$link_static" = no && newdependency_libs="$newdependency_libs $abs_ladir/$laname"
1890 # ... and its dependency_libs
1891 newdependency_libs="$newdependency_libs $dependency_libs"
1892 done
1894 # Make sure lib_search_path contains only unique directories.
1895 lib_search_path=
1896 for dir in $new_lib_search_path; do
1897 case "$lib_search_path " in
1898 *" $dir "*) ;;
1899 *) lib_search_path="$lib_search_path $dir" ;;
1900 esac
1901 done
1902 lib_search_path="$lib_search_path $sys_lib_search_path"
1904 # Make sure newdependency_libs contains only unique libraries and directories.
1905 dependency_libs=
1906 for deplib in $newdependency_libs; do
1907 case "$dependency_libs " in
1908 *" $deplib "*) ;;
1909 *) dependency_libs="$dependency_libs $deplib" ;;
1910 esac
1911 done
1913 # Eliminate all temporary directories.
1914 for path in $uninst_path; do
1915 lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
1916 deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
1917 dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
1918 done
1920 if test -n "$xrpath"; then
1921 # If the user specified any rpath flags, then add them.
1922 temp_xrpath=
1923 for libdir in $xrpath; do
1924 temp_xrpath="$temp_xrpath -R$libdir"
1925 case "$compile_rpath " in
1926 *" $libdir "*) ;;
1927 *) compile_rpath="$compile_rpath $libdir" ;;
1928 esac
1929 case "$finalize_rpath " in
1930 *" $libdir "*) ;;
1931 *) finalize_rpath="$finalize_rpath $libdir" ;;
1932 esac
1933 done
1934 dependency_libs="$temp_xrpath $dependency_libs"
1937 # Restore the variables
1938 libname=$libname_save
1939 name=$name_save
1941 if test "$build_libtool_libs" = yes; then
1942 if test -n "$rpath"; then
1943 case "$host" in
1944 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1945 # these systems don't actually have a c library (as such)!
1948 # Add libc to deplibs on all other systems.
1949 deplibs="$deplibs -lc"
1951 esac
1954 # Transform deplibs into only deplibs that can be linked in shared.
1955 name_save=$name
1956 libname_save=$libname
1957 release_save=$release
1958 versuffix_save=$versuffix
1959 major_save=$major
1960 # I'm not sure if I'm treating the release correctly. I think
1961 # release should show up in the -l (ie -lgmp5) so we don't want to
1962 # add it in twice. Is that correct?
1963 release=""
1964 versuffix=""
1965 major=""
1966 newdeplibs=
1967 droppeddeps=no
1968 case "$deplibs_check_method" in
1969 pass_all)
1970 # Don't check for shared/static. Everything works.
1971 # This might be a little naive. We might want to check
1972 # whether the library exists or not. But this is on
1973 # osf3 & osf4 and I'm not really sure... Just
1974 # implementing what was already the behaviour.
1975 newdeplibs=$deplibs
1977 test_compile)
1978 # This code stresses the "libraries are programs" paradigm to its
1979 # limits. Maybe even breaks it. We compile a program, linking it
1980 # against the deplibs as a proxy for the library. Then we can check
1981 # whether they linked in statically or dynamically with ldd.
1982 $rm conftest.c
1983 cat > conftest.c <<EOF
1984 int main() { return 0; }
1986 $rm conftest
1987 $CC -o conftest conftest.c $deplibs
1988 if test $? -eq 0 ; then
1989 ldd_output=`ldd conftest`
1990 for i in $deplibs; do
1991 name="`expr $i : '-l\(.*\)'`"
1992 # If $name is empty we are operating on a -L argument.
1993 if test "$name" != "" ; then
1994 libname=`eval \\$echo \"$libname_spec\"`
1995 deplib_matches=`eval \\$echo \"$library_names_spec\"`
1996 set dummy $deplib_matches
1997 deplib_match=$2
1998 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1999 newdeplibs="$newdeplibs $i"
2000 else
2001 droppeddeps=yes
2002 echo
2003 echo "*** Warning: This library needs some functionality provided by $i."
2004 echo "*** I have the capability to make that library automatically link in when"
2005 echo "*** you link to this library. But I can only do this if you have a"
2006 echo "*** shared version of the library, which you do not appear to have."
2008 else
2009 newdeplibs="$newdeplibs $i"
2011 done
2012 else
2013 # Error occured in the first compile. Let's try to salvage the situation:
2014 # Compile a seperate program for each library.
2015 for i in $deplibs; do
2016 name="`expr $i : '-l\(.*\)'`"
2017 # If $name is empty we are operating on a -L argument.
2018 if test "$name" != "" ; then
2019 $rm conftest
2020 $CC -o conftest conftest.c $i
2021 # Did it work?
2022 if test $? -eq 0 ; then
2023 ldd_output=`ldd conftest`
2024 libname=`eval \\$echo \"$libname_spec\"`
2025 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2026 set dummy $deplib_matches
2027 deplib_match=$2
2028 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2029 newdeplibs="$newdeplibs $i"
2030 else
2031 droppeddeps=yes
2032 echo
2033 echo "*** Warning: This library needs some functionality provided by $i."
2034 echo "*** I have the capability to make that library automatically link in when"
2035 echo "*** you link to this library. But I can only do this if you have a"
2036 echo "*** shared version of the library, which you do not appear to have."
2038 else
2039 droppeddeps=yes
2040 echo
2041 echo "*** Warning! Library $i is needed by this library but I was not able to"
2042 echo "*** make it link in! You will probably need to install it or some"
2043 echo "*** library that it depends on before this library will be fully"
2044 echo "*** functional. Installing it before continuing would be even better."
2046 else
2047 newdeplibs="$newdeplibs $i"
2049 done
2052 file_magic*)
2053 set dummy $deplibs_check_method
2054 file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
2055 for a_deplib in $deplibs; do
2056 name="`expr $a_deplib : '-l\(.*\)'`"
2057 # If $name is empty we are operating on a -L argument.
2058 if test "$name" != "" ; then
2059 libname=`eval \\$echo \"$libname_spec\"`
2060 for i in $lib_search_path; do
2061 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2062 for potent_lib in $potential_libs; do
2063 # Follow soft links.
2064 if ls -lLd "$potent_lib" 2>/dev/null \
2065 | grep " -> " >/dev/null; then
2066 continue
2068 # The statement above tries to avoid entering an
2069 # endless loop below, in case of cyclic links.
2070 # We might still enter an endless loop, since a link
2071 # loop can be closed while we follow links,
2072 # but so what?
2073 potlib="$potent_lib"
2074 while test -h "$potlib" 2>/dev/null; do
2075 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2076 case "$potliblink" in
2077 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2078 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2079 esac
2080 done
2081 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2082 | sed 10q \
2083 | egrep "$file_magic_regex" > /dev/null; then
2084 newdeplibs="$newdeplibs $a_deplib"
2085 a_deplib=""
2086 break 2
2088 done
2089 done
2090 if test -n "$a_deplib" ; then
2091 droppeddeps=yes
2092 echo
2093 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2094 echo "*** I have the capability to make that library automatically link in when"
2095 echo "*** you link to this library. But I can only do this if you have a"
2096 echo "*** shared version of the library, which you do not appear to have."
2098 else
2099 # Add a -L argument.
2100 newdeplibs="$newdeplibs $a_deplib"
2102 done # Gone through all deplibs.
2104 none | unknown | *)
2105 newdeplibs=""
2106 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2107 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2108 grep . >/dev/null; then
2109 echo
2110 if test "X$deplibs_check_method" = "Xnone"; then
2111 echo "*** Warning: inter-library dependencies are not supported in this platform."
2112 else
2113 echo "*** Warning: inter-library dependencies are not known to be supported."
2115 echo "*** All declared inter-library dependencies are being dropped."
2116 droppeddeps=yes
2119 esac
2120 versuffix=$versuffix_save
2121 major=$major_save
2122 release=$release_save
2123 libname=$libname_save
2124 name=$name_save
2126 if test "$droppeddeps" = yes; then
2127 if test "$module" = yes; then
2128 echo
2129 echo "*** Warning: libtool could not satisfy all declared inter-library"
2130 echo "*** dependencies of module $libname. Therefore, libtool will create"
2131 echo "*** a static module, that should work as long as the dlopening"
2132 echo "*** application is linked with the -dlopen flag."
2133 if test -z "$global_symbol_pipe"; then
2134 echo
2135 echo "*** However, this would only work if libtool was able to extract symbol"
2136 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2137 echo "*** not find such a program. So, this module is probably useless."
2138 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2140 if test "$build_old_libs" = no; then
2141 oldlibs="$output_objdir/$libname.$libext"
2142 build_libtool_libs=module
2143 build_old_libs=yes
2144 else
2145 build_libtool_libs=no
2147 else
2148 echo "*** The inter-library dependencies that have been dropped here will be"
2149 echo "*** automatically added whenever a program is linked with this library"
2150 echo "*** or is declared to -dlopen it."
2153 # Done checking deplibs!
2154 deplibs=$newdeplibs
2157 # All the library-specific variables (install_libdir is set above).
2158 library_names=
2159 old_library=
2160 dlname=
2162 # Test again, we may have decided not to build it any more
2163 if test "$build_libtool_libs" = yes; then
2164 if test -n "$compile_shlibpath"; then
2165 eval "$shlibpath_var='$compile_shlibpath\$$shlibpath_var'; export $shlibpath_var"
2168 # Get the real and link names of the library.
2169 eval library_names=\"$library_names_spec\"
2170 set dummy $library_names
2171 realname="$2"
2172 shift; shift
2174 if test -n "$soname_spec"; then
2175 eval soname=\"$soname_spec\"
2176 else
2177 soname="$realname"
2180 lib="$output_objdir/$realname"
2181 for link
2183 linknames="$linknames $link"
2184 done
2186 # Ensure that we have .o objects for linkers which dislike .lo
2187 # (e.g. aix) incase we are running --disable-static
2188 for obj in $libobjs; do
2189 oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
2190 if test ! -f $oldobj; then
2191 $show "${LN_S} $obj $oldobj"
2192 $run ${LN_S} $obj $oldobj || exit $?
2194 done
2196 # Use standard objects if they are pic
2197 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2199 # Prepare the list of exported symbols
2200 if test -z "$export_symbols"; then
2201 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2202 $show "generating symbol list for \`$libname.la'"
2203 export_symbols="$output_objdir/$libname.exp"
2204 $run $rm $export_symbols
2205 eval cmds=\"$export_symbols_cmds\"
2206 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2207 for cmd in $cmds; do
2208 IFS="$save_ifs"
2209 $show "$cmd"
2210 $run eval "$cmd" || exit $?
2211 done
2212 IFS="$save_ifs"
2213 if test -n "$export_symbols_regex"; then
2214 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2215 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2216 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2217 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2222 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2223 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2226 if test -n "$convenience"; then
2227 if test -n "$whole_archive_flag_spec"; then
2228 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2229 else
2230 gentop="$output_objdir/${outputname}x"
2231 $show "${rm}r $gentop"
2232 $run ${rm}r "$gentop"
2233 $show "mkdir $gentop"
2234 $run mkdir "$gentop"
2235 status=$?
2236 if test $status -ne 0 && test ! -d "$gentop"; then
2237 exit $status
2239 generated="$generated $gentop"
2241 for xlib in $convenience; do
2242 # Extract the objects.
2243 case "$xlib" in
2244 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2245 *) xabs=`pwd`"/$xlib" ;;
2246 esac
2247 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2248 xdir="$gentop/$xlib"
2250 $show "${rm}r $xdir"
2251 $run ${rm}r "$xdir"
2252 $show "mkdir $xdir"
2253 $run mkdir "$xdir"
2254 status=$?
2255 if test $status -ne 0 && test ! -d "$xdir"; then
2256 exit $status
2258 $show "(cd $xdir && $AR x $xabs)"
2259 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2261 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2262 done
2266 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2267 eval flag=\"$thread_safe_flag_spec\"
2268 linker_flags="$linker_flags $flag"
2271 # Do each of the archive commands.
2272 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2273 eval cmds=\"$archive_expsym_cmds\"
2274 else
2275 eval cmds=\"$archive_cmds\"
2277 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2278 for cmd in $cmds; do
2279 IFS="$save_ifs"
2280 $show "$cmd"
2281 $run eval "$cmd" || exit $?
2282 done
2283 IFS="$save_ifs"
2285 # Create links to the real library.
2286 for linkname in $linknames; do
2287 if test "$realname" != "$linkname"; then
2288 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2289 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2291 done
2293 # If -module or -export-dynamic was specified, set the dlname.
2294 if test "$module" = yes || test "$export_dynamic" = yes; then
2295 # On all known operating systems, these are identical.
2296 dlname="$soname"
2301 *.lo | *.o | *.obj)
2302 if test -n "$deplibs"; then
2303 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2306 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2307 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2310 if test -n "$rpath"; then
2311 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2314 if test -n "$xrpath"; then
2315 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2318 if test -n "$vinfo"; then
2319 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2322 if test -n "$release"; then
2323 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2326 case "$output" in
2327 *.lo)
2328 if test -n "$objs"; then
2329 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2330 exit 1
2332 libobj="$output"
2333 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2336 libobj=
2337 obj="$output"
2339 esac
2341 # Delete the old objects.
2342 $run $rm $obj $libobj
2344 # Create the old-style object.
2345 reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
2347 output="$obj"
2348 eval cmds=\"$reload_cmds\"
2349 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2350 for cmd in $cmds; do
2351 IFS="$save_ifs"
2352 $show "$cmd"
2353 $run eval "$cmd" || exit $?
2354 done
2355 IFS="$save_ifs"
2357 # Exit if we aren't doing a library object file.
2358 test -z "$libobj" && exit 0
2360 if test "$build_libtool_libs" != yes; then
2361 # Create an invalid libtool object if no PIC, so that we don't
2362 # accidentally link it into a program.
2363 $show "echo timestamp > $libobj"
2364 $run eval "echo timestamp > $libobj" || exit $?
2365 exit 0
2368 if test -n "$pic_flag"; then
2369 # Only do commands if we really have different PIC objects.
2370 reload_objs="$libobjs"
2371 output="$libobj"
2372 eval cmds=\"$reload_cmds\"
2373 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2374 for cmd in $cmds; do
2375 IFS="$save_ifs"
2376 $show "$cmd"
2377 $run eval "$cmd" || exit $?
2378 done
2379 IFS="$save_ifs"
2380 else
2381 # Just create a symlink.
2382 $show $rm $libobj
2383 $run $rm $libobj
2384 $show "$LN_S $obj $libobj"
2385 $run $LN_S $obj $libobj || exit $?
2388 exit 0
2391 # Anything else should be a program.
2393 if test -n "$vinfo"; then
2394 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2397 if test -n "$release"; then
2398 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2401 if test "$preload" = yes; then
2402 if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
2403 test "$dlopen_self_static" = unknown; then
2404 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2408 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2409 if test "X$output_objdir" = "X$output"; then
2410 output_objdir="$objdir"
2411 else
2412 output_objdir="$output_objdir/$objdir"
2415 # Create the binary in the object directory, then wrap it.
2416 if test ! -d $output_objdir; then
2417 $show "$mkdir $output_objdir"
2418 $run $mkdir $output_objdir
2419 status=$?
2420 if test $status -ne 0 && test ! -d $output_objdir; then
2421 exit $status
2425 # Find libtool libraries and add their dependencies
2426 old_deplibs="$deplibs"
2427 deplibs=
2428 newdependency_libs=
2429 new_lib_search_path=
2430 for deplib in $old_deplibs; do
2431 lib=
2432 case "$deplib" in
2433 -L*)
2434 deplibs="$deplibs $deplib"
2435 new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2436 continue
2438 -l*)
2439 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2440 found=no
2441 for searchdir in $lib_search_path; do
2442 # Search the libtool library
2443 lib="$searchdir/lib${name}.la"
2444 if test -f "$lib"; then
2445 found=yes
2446 break
2448 done
2449 if test "$found" != yes; then
2450 deplibs="$deplibs $deplib"
2451 continue
2455 lib="$deplib"
2456 if test -f "$lib"; then :
2457 else
2458 $echo "$modename: cannot find the library \`$lib'" 1>&2
2459 exit 1
2462 esac
2463 dlname=
2464 libdir=
2465 library_names=
2466 old_library=
2468 # Check to see that this really is a libtool archive.
2469 if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2470 else
2471 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2472 exit 1
2475 # If the library was installed with an old release of libtool,
2476 # it will not redefine variable installed.
2477 installed=yes
2479 # Read the .la file
2480 case "$lib" in
2481 */* | *\\*) . $lib ;;
2482 *) . ./$lib ;;
2483 esac
2485 # Get the name of the library we link against.
2486 linklib=
2487 for l in $old_library $library_names; do
2488 linklib="$l"
2489 done
2491 if test -z "$linklib"; then
2492 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2493 exit 1
2496 new_lib_search_path="$new_lib_search_path `$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`"
2497 deplibs="$deplibs $lib"
2499 for deplib in $dependency_libs; do
2500 case "$deplib" in
2501 -L*)
2502 new_lib_search_path="$new_lib_search_path `$echo "X$deplib" | $Xsed -e 's/^-L//'`"
2504 esac
2506 if test "$link_all_deplibs" != no || \
2507 test "$fast_install" != no || \
2508 test "$build_libtool_libs" = no || \
2509 test -z "$library_names"; then
2510 # Need to link against all dependency_libs
2511 deplibs="$deplibs $deplib"
2512 else
2513 # Need to hardcode shared library paths
2514 # or/and link against static libraries
2515 newdependency_libs="$newdependency_libs $deplib"
2517 done
2518 done
2520 # Eliminate all dependency_libs that are already contained in deplibs
2521 dependency_libs=
2522 for deplib in $newdependency_libs; do
2523 case "$deplibs " in
2524 *" $deplib "*) ;;
2525 *) dependency_libs="$dependency_libs $deplib" ;;
2526 esac
2527 done
2529 # Make sure lib_search_path contains only unique directories.
2530 lib_search_path=
2531 for dir in $new_lib_search_path; do
2532 case "$lib_search_path " in
2533 *" $dir "*) ;;
2534 *) lib_search_path="$lib_search_path $dir" ;;
2535 esac
2536 done
2537 lib_search_path="$lib_search_path $sys_lib_search_path"
2539 # Find libtool libraries and add their directories
2540 alldeplibs=no
2541 link_against_libtool_libs=
2543 for deplib in $deplibs @DEPLIBS@ $dependency_libs; do
2544 lib=
2545 case "$deplib" in
2546 -L*)
2547 compile_command="$compile_command $deplib"
2548 finalize_command="$finalize_command $deplib"
2549 continue
2551 -R*)
2552 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2553 # Make sure the xrpath contains only unique directories.
2554 case "$xrpath " in
2555 *" $dir "*) ;;
2556 *) xrpath="$xrpath $dir" ;;
2557 esac
2558 continue
2560 @DEPLIBS@)
2561 alldeplibs=yes
2562 continue
2564 -l*)
2565 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2566 found=no
2567 for searchdir in $lib_search_path; do
2568 # Search the libtool library
2569 lib="$searchdir/lib${name}.la"
2570 if test -f "$lib"; then
2571 found=yes
2572 break
2574 done
2575 if test "$found" != yes; then
2576 compile_command="$compile_command $deplib"
2577 finalize_command="$finalize_command $deplib"
2578 continue
2582 lib="$deplib"
2583 if test -f "$lib"; then :
2584 else
2585 $echo "$modename: cannot find the library \`$lib'" 1>&2
2586 exit 1
2589 esac
2590 dlname=
2591 libdir=
2592 library_names=
2593 old_library=
2595 # Check to see that this really is a libtool archive.
2596 if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2597 else
2598 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2599 exit 1
2602 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2603 test "X$ladir" = "X$lib" && ladir="."
2604 # We need an absolute path.
2605 case "$ladir" in
2606 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2608 abs_ladir=`cd "$ladir" && pwd`
2609 if test -z "$abs_ladir"; then
2610 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2611 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2612 absdir="$dir"
2615 esac
2616 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2618 # If the library was installed with an old release of libtool,
2619 # it will not redefine variable installed.
2620 installed=yes
2622 # Read the .la file
2623 case "$lib" in
2624 */* | *\\*) . $lib ;;
2625 *) . ./$lib ;;
2626 esac
2628 # Get the name of the library we link against.
2629 linklib=
2630 for l in $old_library $library_names; do
2631 linklib="$l"
2632 done
2634 if test -z "$linklib"; then
2635 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2636 exit 1
2639 # Find the relevant object directory and library name.
2640 if test "X$installed" = Xyes; then
2641 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2642 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2643 dir="$ladir"
2644 absdir="$abs_ladir"
2645 libdir="$abs_ladir"
2646 else
2647 dir="$libdir"
2648 absdir="$libdir"
2650 else
2651 dir="$ladir/$objdir"
2652 absdir="$abs_ladir/$objdir"
2654 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2656 if test -n "$library_names" &&
2657 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2658 # We need to hardcode the library path
2659 if test -n "$shlibpath_var"; then
2660 # Make sure the rpath contains only unique directories.
2661 case "$temp_rpath " in
2662 *" $dir "*) ;;
2663 *" $absdir "*) ;;
2664 *) temp_rpath="$temp_rpath $dir" ;;
2665 esac
2668 # Hardcode the library path.
2669 # Skip directories that are in the system default run-time
2670 # search path.
2671 case " $sys_lib_dlsearch_path " in
2672 *" $absdir "*) ;;
2674 case "$compile_rpath " in
2675 *" $absdir "*) ;;
2676 *) compile_rpath="$compile_rpath $absdir"
2677 esac
2679 esac
2681 case " $sys_lib_dlsearch_path " in
2682 *" $libdir "*) ;;
2684 case "$finalize_rpath " in
2685 *" $libdir "*) ;;
2686 *) finalize_rpath="$finalize_rpath $libdir"
2687 esac
2689 esac
2692 if test "$alldeplibs" = yes &&
2693 { test "$deplibs_check_method" = pass_all ||
2694 { test "$build_libtool_libs" = yes &&
2695 test -n "$library_names"; }; }; then
2696 # Do we only need to link against static libraries?
2697 continue
2700 if test -z "$libdir"; then
2701 # It is a libtool convenience library, so add in its objects.
2702 convenience="$convenience $dir/$old_library"
2703 old_convenience="$old_convenience $dir/$old_library"
2704 compile_command="$compile_command $dir/$old_library"
2705 finalize_command="$finalize_command $dir/$old_library"
2706 continue
2709 if test -n "$library_names" &&
2710 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2711 link_against_libtool_libs="$link_against_libtool_libs $lib"
2713 if test -n "$old_archive_from_expsyms_cmds"; then
2714 # figure out the soname
2715 set dummy $library_names
2716 realname="$2"
2717 shift; shift
2718 libname=`eval \\$echo \"$libname_spec\"`
2719 if test -n "$soname_spec"; then
2720 eval soname=\"$soname_spec\"
2721 else
2722 soname="$realname"
2725 # Make a new name for the extract_expsyms_cmds to use
2726 newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2728 # If the library has no export list, then create one now
2729 if test -f "$output_objdir/$soname-def"; then :
2730 else
2731 $show "extracting exported symbol list from \`$soname'"
2732 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2733 eval cmds=\"$extract_expsyms_cmds\"
2734 for cmd in $cmds; do
2735 IFS="$save_ifs"
2736 $show "$cmd"
2737 $run eval "$cmd" || exit $?
2738 done
2739 IFS="$save_ifs"
2742 # Create $newlib
2743 if test -f "$output_objdir/$newlib"; then :; else
2744 $show "generating import library for \`$soname'"
2745 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2746 eval cmds=\"$old_archive_from_expsyms_cmds\"
2747 for cmd in $cmds; do
2748 IFS="$save_ifs"
2749 $show "$cmd"
2750 $run eval "$cmd" || exit $?
2751 done
2752 IFS="$save_ifs"
2754 # make sure the library variables are pointing to the new library
2755 dir=$output_objdir
2756 linklib=$newlib
2759 lib_linked=yes
2760 add_dir=
2761 add_shlibpath=
2762 add_name=no
2763 case "$hardcode_action" in
2764 immediate | unsupported)
2765 if test "$hardcode_direct" = no; then
2766 compile_command="$compile_command $dir/$linklib"
2767 elif test "$hardcode_minus_L" = no; then
2768 case "$host" in
2769 *-*-sunos*) add_shlibpath="$dir" ;;
2770 esac
2771 add_dir="-L$dir"
2772 add_name=yes
2773 elif test "$hardcode_shlibpath_var" = no; then
2774 add_shlibpath="$dir"
2775 add_name=yes
2776 else
2777 lib_linked=no
2781 relink)
2782 if test "$hardcode_direct" = yes; then
2783 compile_command="$compile_command $absdir/$linklib"
2784 elif test "$hardcode_minus_L" = yes; then
2785 add_dir="-L$absdir"
2786 add_name=yes
2787 elif test "$hardcode_shlibpath_var" = yes; then
2788 add_shlibpath="$absdir"
2789 add_name=yes
2790 else
2791 lib_linked=no
2795 *) lib_linked=no ;;
2796 esac
2798 if test "$lib_linked" != yes; then
2799 $echo "$modename: configuration error: unsupported hardcode properties"
2800 exit 1
2802 if test -n "$add_dir"; then
2803 case "$compile_command " in
2804 *" $add_dir "*) ;;
2805 *) compile_command="$compile_command $add_dir" ;;
2806 esac
2808 if test -n "$add_shlibpath"; then
2809 case ":$compile_shlibpath:" in
2810 *":$add_shlibpath:"*) ;;
2811 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2812 esac
2814 test "$add_name" = yes && compile_command="$compile_command -l$name"
2816 add_dir=
2817 add_name=no
2818 # Finalize command for both is simple: just hardcode it.
2819 if test "$hardcode_direct" = yes; then
2820 finalize_command="$finalize_command $libdir/$linklib"
2821 elif test "$hardcode_minus_L" = yes; then
2822 add_dir="-L$libdir"
2823 add_name=yes
2824 elif test "$hardcode_shlibpath_var" = yes; then
2825 case ":$finalize_shlibpath:" in
2826 *":$libdir:"*) ;;
2827 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2828 esac
2829 add_name=yes
2830 else
2831 # We cannot seem to hardcode it, guess we'll fake it.
2832 add_dir="-L$libdir"
2833 add_name=yes
2835 if test -n "$add_dir"; then
2836 case "$finalize_command " in
2837 *" $add_dir "*) ;;
2838 *) finalize_command="$finalize_command $add_dir" ;;
2839 esac
2841 test "$add_name" = yes && finalize_command="$finalize_command -l$name"
2842 else
2843 # Here we assume that one of hardcode_direct or hardcode_minus_L
2844 # is not unsupported. This is valid on all known static and
2845 # shared platforms.
2846 if test "$hardcode_direct" != unsupported; then
2847 test -n "$old_library" && linklib="$old_library"
2848 compile_command="$compile_command $dir/$linklib"
2849 finalize_command="$finalize_command $dir/$linklib"
2850 else
2851 case "$compile_command " in
2852 *" -L$dir "*) ;;
2853 *) compile_command="$compile_command -L$dir";;
2854 esac
2855 compile_command="$compile_command -l$name"
2856 case "$finalize_command " in
2857 *" -L$dir "*) ;;
2858 *) finalize_command="$finalize_command -L$dir";;
2859 esac
2860 finalize_command="$finalize_command -l$name"
2863 done
2865 if test -n "$rpath$xrpath"; then
2866 # If the user specified any rpath flags, then add them.
2867 for libdir in $rpath $xrpath; do
2868 # This is the magic to use -rpath.
2869 case "$compile_rpath " in
2870 *" $libdir "*) ;;
2871 *) compile_rpath="$compile_rpath $libdir" ;;
2872 esac
2873 case "$finalize_rpath " in
2874 *" $libdir "*) ;;
2875 *) finalize_rpath="$finalize_rpath $libdir" ;;
2876 esac
2877 done
2880 # Now hardcode the library paths
2881 rpath=
2882 hardcode_libdirs=
2883 for libdir in $compile_rpath $finalize_rpath; do
2884 if test -n "$hardcode_libdir_flag_spec"; then
2885 if test -n "$hardcode_libdir_separator"; then
2886 if test -z "$hardcode_libdirs"; then
2887 hardcode_libdirs="$libdir"
2888 else
2889 # Just accumulate the unique libdirs.
2890 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2891 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2894 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2896 esac
2898 else
2899 eval flag=\"$hardcode_libdir_flag_spec\"
2900 rpath="$rpath $flag"
2902 elif test -n "$runpath_var"; then
2903 case "$perm_rpath " in
2904 *" $libdir "*) ;;
2905 *) perm_rpath="$perm_rpath $libdir" ;;
2906 esac
2908 case "$host" in
2909 *-*-cygwin* | *-*-mingw* | *-*-os2*)
2910 case ":$dllsearchpath:" in
2911 *":$libdir:"*) ;;
2912 *) dllsearchpath="$dllsearchpath:$libdir";;
2913 esac
2915 esac
2916 done
2917 # Substitute the hardcoded libdirs into the rpath.
2918 if test -n "$hardcode_libdir_separator" &&
2919 test -n "$hardcode_libdirs"; then
2920 libdir="$hardcode_libdirs"
2921 eval rpath=\" $hardcode_libdir_flag_spec\"
2923 compile_rpath="$rpath"
2925 rpath=
2926 hardcode_libdirs=
2927 for libdir in $finalize_rpath; do
2928 if test -n "$hardcode_libdir_flag_spec"; then
2929 if test -n "$hardcode_libdir_separator"; then
2930 if test -z "$hardcode_libdirs"; then
2931 hardcode_libdirs="$libdir"
2932 else
2933 # Just accumulate the unique libdirs.
2934 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2935 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2938 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2940 esac
2942 else
2943 eval flag=\"$hardcode_libdir_flag_spec\"
2944 rpath="$rpath $flag"
2946 elif test -n "$runpath_var"; then
2947 case "$finalize_perm_rpath " in
2948 *" $libdir "*) ;;
2949 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
2950 esac
2952 done
2953 # Substitute the hardcoded libdirs into the rpath.
2954 if test -n "$hardcode_libdir_separator" &&
2955 test -n "$hardcode_libdirs"; then
2956 libdir="$hardcode_libdirs"
2957 eval rpath=\" $hardcode_libdir_flag_spec\"
2959 finalize_rpath="$rpath"
2961 if test -n "$libobjs" && test "$build_old_libs" = yes; then
2962 # Transform all the library objects into standard objects.
2963 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2964 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2967 dlsyms=
2968 if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then
2969 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2970 dlsyms="${outputname}S.c"
2971 else
2972 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
2976 if test -n "$dlsyms"; then
2977 case "$dlsyms" in
2978 "") ;;
2979 *.c)
2980 # Discover the nlist of each of the dlfiles.
2981 nlist="$output_objdir/${outputname}.nm"
2983 $show "$rm $nlist ${nlist}S ${nlist}T"
2984 $run $rm "$nlist" "${nlist}S" "${nlist}T"
2986 # Parse the name list into a source file.
2987 $show "creating $output_objdir/$dlsyms"
2989 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
2990 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
2991 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
2993 #ifdef __cplusplus
2994 extern \"C\" {
2995 #endif
2997 /* Prevent the only kind of declaration conflicts we can make. */
2998 #define lt_preloaded_symbols some_other_symbol
3000 /* External symbol declarations for the compiler. */\
3003 if test "$dlself" = yes; then
3004 $show "generating symbol list for \`$output'"
3006 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3008 # Add our own program objects to the symbol list.
3009 progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3010 for arg in $progfiles; do
3011 $show "extracting global C symbols from \`$arg'"
3012 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3013 done
3015 if test -n "$exclude_expsyms"; then
3016 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3017 $run eval '$mv "$nlist"T "$nlist"'
3020 if test -n "$export_symbols_regex"; then
3021 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3022 $run eval '$mv "$nlist"T "$nlist"'
3025 # Prepare the list of exported symbols
3026 if test -z "$export_symbols"; then
3027 export_symbols="$output_objdir/$output.exp"
3028 $run $rm $export_symbols
3029 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3030 else
3031 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3032 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3033 $run eval 'mv "$nlist"T "$nlist"'
3037 for arg in $dlprefiles; do
3038 $show "extracting global C symbols from \`$arg'"
3039 name=`echo "$arg" | sed -e 's%^.*/%%'`
3040 $run eval 'echo ": $name " >> "$nlist"'
3041 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3042 done
3044 if test -z "$run"; then
3045 # Make sure we have at least an empty file.
3046 test -f "$nlist" || : > "$nlist"
3048 if test -n "$exclude_expsyms"; then
3049 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3050 $mv "$nlist"T "$nlist"
3053 # Try sorting and uniquifying the output.
3054 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3056 else
3057 grep -v "^: " < "$nlist" > "$nlist"S
3060 if test -f "$nlist"S; then
3061 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3062 else
3063 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3066 $echo >> "$output_objdir/$dlsyms" "\
3068 #undef lt_preloaded_symbols
3070 #if defined (__STDC__) && __STDC__
3071 # define lt_ptr_t void *
3072 #else
3073 # define lt_ptr_t char *
3074 # define const
3075 #endif
3077 /* The mapping between symbol names and symbols. */
3078 const struct {
3079 const char *name;
3080 lt_ptr_t address;
3082 lt_preloaded_symbols[] =
3086 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
3087 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
3088 < "$nlist" >> "$output_objdir/$dlsyms"
3090 $echo >> "$output_objdir/$dlsyms" "\
3091 {0, (lt_ptr_t) 0}
3094 /* This works around a problem in FreeBSD linker */
3095 #ifdef FREEBSD_WORKAROUND
3096 static const void *lt_preloaded_setup() {
3097 return lt_preloaded_symbols;
3099 #endif
3101 #ifdef __cplusplus
3103 #endif\
3107 pic_flag_for_symtable=
3108 case "$host" in
3109 # compiling the symbol table file with pic_flag works around
3110 # a FreeBSD bug that causes programs to crash when -lm is
3111 # linked before any other PIC object. But we must not use
3112 # pic_flag when linking with -static. The problem exists in
3113 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3114 *-*-freebsd2*|*-*-freebsd3.0*)
3115 case "$compile_command " in
3116 *" -static "*) ;;
3117 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3118 esac
3119 esac
3121 # Now compile the dynamic symbol file.
3122 $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3123 $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3125 # Clean up the generated files.
3126 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3127 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3129 # Transform the symbol file into the correct name.
3130 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3131 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3134 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3135 exit 1
3137 esac
3138 else
3139 # We keep going just in case the user didn't refer to
3140 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3141 # really was required.
3143 # Nullify the symbol file.
3144 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3145 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3148 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
3149 # Replace the output file specification.
3150 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3151 link_command="$compile_command$compile_rpath"
3153 # We have no uninstalled library dependencies, so finalize right now.
3154 $show "$link_command"
3155 $run eval "$link_command"
3156 status=$?
3158 # Delete the generated files.
3159 if test -n "$dlsyms"; then
3160 $show "$rm $output_objdir/${outputname}S.${objext}"
3161 $run $rm "$output_objdir/${outputname}S.${objext}"
3164 exit $status
3167 if test -n "$shlibpath_var"; then
3168 # We should set the shlibpath_var
3169 rpath=
3170 for dir in $temp_rpath; do
3171 case "$dir" in
3172 [\\/]* | [A-Za-z]:[\\/]*)
3173 # Absolute path.
3174 rpath="$rpath$dir:"
3177 # Relative path: add a thisdir entry.
3178 rpath="$rpath\$thisdir/$dir:"
3180 esac
3181 done
3182 temp_rpath="$rpath"
3185 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3186 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3188 if test -n "$finalize_shlibpath"; then
3189 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3192 compile_var=
3193 finalize_var=
3194 if test -n "$runpath_var"; then
3195 if test -n "$perm_rpath"; then
3196 # We should set the runpath_var.
3197 rpath=
3198 for dir in $perm_rpath; do
3199 rpath="$rpath$dir:"
3200 done
3201 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3203 if test -n "$finalize_perm_rpath"; then
3204 # We should set the runpath_var.
3205 rpath=
3206 for dir in $finalize_perm_rpath; do
3207 rpath="$rpath$dir:"
3208 done
3209 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3213 if test "$hardcode_action" = relink; then
3214 # Fast installation is not supported
3215 link_command="$compile_var$compile_command$compile_rpath"
3216 relink_command="$finalize_var$finalize_command$finalize_rpath"
3218 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3219 $echo "$modename: \`$output' will be relinked during installation" 1>&2
3220 else
3221 if test "$fast_install" != no; then
3222 link_command="$finalize_var$compile_command$finalize_rpath"
3223 if test "$fast_install" = yes; then
3224 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3225 else
3226 # fast_install is set to needless
3227 relink_command=
3229 else
3230 link_command="$compile_var$compile_command$compile_rpath"
3231 relink_command="$finalize_var$finalize_command$finalize_rpath"
3235 # Replace the output file specification.
3236 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3238 # Delete the old output files.
3239 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3241 $show "$link_command"
3242 $run eval "$link_command" || exit $?
3244 # Now create the wrapper script.
3245 $show "creating $output"
3247 # Quote the relink command for shipping.
3248 if test -n "$relink_command"; then
3249 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3252 # Quote $echo for shipping.
3253 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3254 case "$0" in
3255 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3256 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3257 esac
3258 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3259 else
3260 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3263 # Only actually do things if our run command is non-null.
3264 if test -z "$run"; then
3265 # win32 will think the script is a binary if it has
3266 # a .exe suffix, so we strip it off here.
3267 case $output in
3268 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3269 esac
3270 $rm $output
3271 trap "$rm $output; exit 1" 1 2 15
3273 $echo > $output "\
3274 #! $SHELL
3276 # $output - temporary wrapper script for $objdir/$outputname
3277 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3279 # The $output program cannot be directly executed until all the libtool
3280 # libraries that it depends on are installed.
3282 # This wrapper script should never be moved out of the build directory.
3283 # If it is, it will not operate correctly.
3285 # Sed substitution that helps us do robust quoting. It backslashifies
3286 # metacharacters that are still active within double-quoted strings.
3287 Xsed='sed -e 1s/^X//'
3288 sed_quote_subst='$sed_quote_subst'
3290 # The HP-UX ksh and POSIX shell print the target directory to stdout
3291 # if CDPATH is set.
3292 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
3294 relink_command=\"$relink_command\"
3296 # This environment variable determines our operation mode.
3297 if test \"\$libtool_install_magic\" = \"$magic\"; then
3298 # install mode needs the following variable:
3299 link_against_libtool_libs='$link_against_libtool_libs'
3300 else
3301 # When we are sourced in execute mode, \$file and \$echo are already set.
3302 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3303 echo=\"$qecho\"
3304 file=\"\$0\"
3305 # Make sure echo works.
3306 if test \"X\$1\" = X--no-reexec; then
3307 # Discard the --no-reexec flag, and continue.
3308 shift
3309 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3310 # Yippee, \$echo works!
3312 else
3313 # Restart under the correct shell, and then maybe \$echo will work.
3314 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3318 $echo >> $output "\
3320 # Find the directory that this script lives in.
3321 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3322 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3324 # Follow symbolic links until we get to the real thisdir.
3325 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3326 while test -n \"\$file\"; do
3327 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3329 # If there was a directory component, then change thisdir.
3330 if test \"x\$destdir\" != \"x\$file\"; then
3331 case \"\$destdir\" in
3332 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
3333 *) thisdir=\"\$thisdir/\$destdir\" ;;
3334 esac
3337 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3338 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3339 done
3341 # Try to get the absolute directory name.
3342 absdir=\`cd \"\$thisdir\" && pwd\`
3343 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3346 if test "$fast_install" = yes; then
3347 echo >> $output "\
3348 program=lt-'$outputname'
3349 progdir=\"\$thisdir/$objdir\"
3351 if test ! -f \"\$progdir/\$program\" || \\
3352 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3353 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3355 file=\"\$\$-\$program\"
3357 if test ! -d \"\$progdir\"; then
3358 $mkdir \"\$progdir\"
3359 else
3360 $rm \"\$progdir/\$file\"
3363 echo >> $output "\
3365 # relink executable if necessary
3366 if test -n \"\$relink_command\"; then
3367 if (cd \"\$thisdir\" && eval \$relink_command); then :
3368 else
3369 $rm \"\$progdir/\$file\"
3370 exit 1
3374 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3375 { $rm \"\$progdir/\$program\";
3376 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3377 $rm \"\$progdir/\$file\"
3379 else
3380 echo >> $output "\
3381 program='$outputname'
3382 progdir=\"\$thisdir/$objdir\"
3386 echo >> $output "\
3388 if test -f \"\$progdir/\$program\"; then"
3390 # Export our shlibpath_var if we have one.
3391 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3392 $echo >> $output "\
3393 # Add our own library path to $shlibpath_var
3394 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3396 # Some systems cannot cope with colon-terminated $shlibpath_var
3397 # The second colon is a workaround for a bug in BeOS R4 sed
3398 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3400 export $shlibpath_var
3404 # fixup the dll searchpath if we need to.
3405 if test -n "$dllsearchpath"; then
3406 $echo >> $output "\
3407 # Add the dll search path components to the executable PATH
3408 PATH=$dllsearchpath:\$PATH
3412 $echo >> $output "\
3413 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3414 # Run the actual program with our arguments.
3416 case $host in
3417 *-*-cygwin* | *-*-mingw | *-*-os2*)
3418 # win32 systems need to use the prog path for dll
3419 # lookup to work
3420 $echo >> $output "\
3421 exec \$progdir\\\\\$program \${1+\"\$@\"}
3425 $echo >> $output "\
3426 # Export the path to the program.
3427 PATH=\"\$progdir:\$PATH\"
3428 export PATH
3430 exec \$program \${1+\"\$@\"}
3433 esac
3434 $echo >> $output "\
3435 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3436 exit 1
3438 else
3439 # The program doesn't exist.
3440 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3441 \$echo \"This script is just a wrapper for \$program.\" 1>&2
3442 echo \"See the $PACKAGE documentation for more information.\" 1>&2
3443 exit 1
3447 chmod +x $output
3449 exit 0
3451 esac
3453 # See if we need to build an old-fashioned archive.
3454 for oldlib in $oldlibs; do
3456 if test "$build_libtool_libs" = convenience; then
3457 oldobjs="$libobjs_save"
3458 addlibs="$convenience"
3459 build_libtool_libs=no
3460 else
3461 if test "$build_libtool_libs" = module; then
3462 oldobjs="$libobjs_save"
3463 build_libtool_libs=no
3464 else
3465 oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3467 addlibs="$old_convenience"
3470 if test -n "$addlibs"; then
3471 gentop="$output_objdir/${outputname}x"
3472 $show "${rm}r $gentop"
3473 $run ${rm}r "$gentop"
3474 $show "mkdir $gentop"
3475 $run mkdir "$gentop"
3476 status=$?
3477 if test $status -ne 0 && test ! -d "$gentop"; then
3478 exit $status
3480 generated="$generated $gentop"
3482 # Add in members from convenience archives.
3483 for xlib in $addlibs; do
3484 # Extract the objects.
3485 case "$xlib" in
3486 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3487 *) xabs=`pwd`"/$xlib" ;;
3488 esac
3489 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3490 xdir="$gentop/$xlib"
3492 $show "${rm}r $xdir"
3493 $run ${rm}r "$xdir"
3494 $show "mkdir $xdir"
3495 $run mkdir "$xdir"
3496 status=$?
3497 if test $status -ne 0 && test ! -d "$xdir"; then
3498 exit $status
3500 $show "(cd $xdir && $AR x $xabs)"
3501 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3503 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3504 done
3507 # Do each command in the archive commands.
3508 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3509 eval cmds=\"$old_archive_from_new_cmds\"
3510 else
3511 # Ensure that we have .o objects in place incase we decided
3512 # not to build a shared library, and have fallen back to building
3513 # static libs even though --disable-static was passed!
3514 for oldobj in $oldobjs; do
3515 if test ! -f $oldobj; then
3516 obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
3517 $show "${LN_S} $obj $oldobj"
3518 $run ${LN_S} $obj $oldobj || exit $?
3520 done
3522 eval cmds=\"$old_archive_cmds\"
3524 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3525 for cmd in $cmds; do
3526 IFS="$save_ifs"
3527 $show "$cmd"
3528 $run eval "$cmd" || exit $?
3529 done
3530 IFS="$save_ifs"
3531 done
3533 if test -n "$generated"; then
3534 $show "${rm}r$generated"
3535 $run ${rm}r$generated
3538 # Now create the libtool archive.
3539 case "$output" in
3540 *.la)
3541 old_library=
3542 test "$build_old_libs" = yes && old_library="$libname.$libext"
3543 $show "creating $output"
3545 # Only create the output if not a dry run.
3546 if test -z "$run"; then
3547 for installed in no yes; do
3548 if test "$installed" = yes; then
3549 if test -z "$install_libdir"; then
3550 break
3552 output="$output_objdir/$outputname"i
3553 # Replace all uninstalled libtool libraries with the installed ones
3554 newdependency_libs=
3555 for deplib in $dependency_libs; do
3556 case "$deplib" in
3557 *.la)
3558 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3559 eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3560 if test -z "$libdir"; then
3561 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3562 exit 1
3564 newdependency_libs="$newdependency_libs $libdir/$name"
3566 *) newdependency_libs="$newdependency_libs $deplib" ;;
3567 esac
3568 done
3569 dependency_libs="$newdependency_libs"
3571 $rm $output
3572 $echo > $output "\
3573 # $outputname - a libtool library file
3574 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3576 # Please DO NOT delete this file!
3577 # It is necessary for linking the library.
3579 # The name that we can dlopen(3).
3580 dlname='$dlname'
3582 # Names of this library.
3583 library_names='$library_names'
3585 # The name of the static archive.
3586 old_library='$old_library'
3588 # Libraries that this one depends upon.
3589 dependency_libs='$dependency_libs'
3591 # Version information for $libname.
3592 current=$current
3593 age=$age
3594 revision=$revision
3596 # Is this an already installed library?
3597 installed=$installed
3599 # Directory that this library needs to be installed in:
3600 libdir='$install_libdir'\
3602 done
3605 # Do a symbolic link so that the libtool archive can be found in
3606 # LD_LIBRARY_PATH before the program is installed.
3607 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3608 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
3610 esac
3611 exit 0
3614 # libtool install mode
3615 install)
3616 modename="$modename: install"
3618 # There may be an optional sh(1) argument at the beginning of
3619 # install_prog (especially on Windows NT).
3620 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
3621 # Aesthetically quote it.
3622 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3623 case "$arg" in
3624 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3625 arg="\"$arg\""
3627 esac
3628 install_prog="$arg "
3629 arg="$1"
3630 shift
3631 else
3632 install_prog=
3633 arg="$nonopt"
3636 # The real first argument should be the name of the installation program.
3637 # Aesthetically quote it.
3638 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3639 case "$arg" in
3640 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3641 arg="\"$arg\""
3643 esac
3644 install_prog="$install_prog$arg"
3646 # We need to accept at least all the BSD install flags.
3647 dest=
3648 files=
3649 opts=
3650 prev=
3651 install_type=
3652 isdir=no
3653 stripme=
3654 gnustrip=no
3655 for arg
3657 if test -n "$dest"; then
3658 files="$files $dest"
3659 dest="$arg"
3660 continue
3663 case "$arg" in
3664 -d) isdir=yes ;;
3665 -f) prev="-f" ;;
3666 -g) prev="-g" ;;
3667 -m) prev="-m" ;;
3668 -o) prev="-o" ;;
3670 stripme=" -s"
3671 strip -V | grep "GNU strip" >/dev/null && gnustrip=yes
3672 continue
3674 -*) ;;
3677 # If the previous option needed an argument, then skip it.
3678 if test -n "$prev"; then
3679 prev=
3680 else
3681 dest="$arg"
3682 continue
3685 esac
3687 # Aesthetically quote the argument.
3688 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3689 case "$arg" in
3690 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3691 arg="\"$arg\""
3693 esac
3694 install_prog="$install_prog $arg"
3695 done
3697 if test -z "$install_prog"; then
3698 $echo "$modename: you must specify an install program" 1>&2
3699 $echo "$help" 1>&2
3700 exit 1
3703 if test -n "$prev"; then
3704 $echo "$modename: the \`$prev' option requires an argument" 1>&2
3705 $echo "$help" 1>&2
3706 exit 1
3709 if test -z "$files"; then
3710 if test -z "$dest"; then
3711 $echo "$modename: no file or destination specified" 1>&2
3712 else
3713 $echo "$modename: you must specify a destination" 1>&2
3715 $echo "$help" 1>&2
3716 exit 1
3719 # Strip any trailing slash from the destination.
3720 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3722 # Check to see that the destination is a directory.
3723 test -d "$dest" && isdir=yes
3724 if test "$isdir" = yes; then
3725 destdir="$dest"
3726 destname=
3727 else
3728 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3729 test "X$destdir" = "X$dest" && destdir=.
3730 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3732 # Not a directory, so check to see that there is only one file specified.
3733 set dummy $files
3734 if test $# -gt 2; then
3735 $echo "$modename: \`$dest' is not a directory" 1>&2
3736 $echo "$help" 1>&2
3737 exit 1
3740 case "$destdir" in
3741 [\\/]* | [A-Za-z]:[\\/]*) ;;
3743 for file in $files; do
3744 case "$file" in
3745 *.lo) ;;
3747 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3748 $echo "$help" 1>&2
3749 exit 1
3751 esac
3752 done
3754 esac
3756 # This variable tells wrapper scripts just to set variables rather
3757 # than running their programs.
3758 libtool_install_magic="$magic"
3760 staticlibs=
3761 future_libdirs=
3762 current_libdirs=
3763 for file in $files; do
3765 # Do each installation.
3766 case "$file" in
3767 *.a | *.lib)
3768 # Do the static libraries later.
3769 staticlibs="$staticlibs $file"
3772 *.la)
3773 # Check to see that this really is a libtool archive.
3774 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3775 else
3776 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3777 $echo "$help" 1>&2
3778 exit 1
3781 library_names=
3782 old_library=
3783 # If there is no directory component, then add one.
3784 case "$file" in
3785 */* | *\\*) . $file ;;
3786 *) . ./$file ;;
3787 esac
3789 # Add the libdir to current_libdirs if it is the destination.
3790 if test "X$destdir" = "X$libdir"; then
3791 case "$current_libdirs " in
3792 *" $libdir "*) ;;
3793 *) current_libdirs="$current_libdirs $libdir" ;;
3794 esac
3795 else
3796 # Note the libdir as a future libdir.
3797 case "$future_libdirs " in
3798 *" $libdir "*) ;;
3799 *) future_libdirs="$future_libdirs $libdir" ;;
3800 esac
3803 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
3804 test "X$dir" = "X$file/" && dir=
3805 dir="$dir$objdir"
3807 # See the names of the shared library.
3808 set dummy $library_names
3809 if test -n "$2"; then
3810 realname="$2"
3811 shift
3812 shift
3814 # Install the shared library and build the symlinks.
3815 $show "$install_prog $dir/$realname $destdir/$realname"
3816 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
3817 test "X$dlname" = "X$realname" && dlname=
3818 if test $gnustrip = yes; then
3819 $show "strip --strip-unneeded $destdir/$realname"
3820 $run eval "strip --strip-unneeded $destdir/$realname" || exit $?
3823 if test $# -gt 0; then
3824 # Delete the old symlinks, and create new ones.
3825 for linkname
3827 test "X$dlname" = "X$linkname" && dlname=
3828 if test "$linkname" != "$realname"; then
3829 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3830 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3832 done
3835 if test -n "$dlname"; then
3836 # Install the dynamically-loadable library.
3837 $show "$install_prog $dir/$dlname $destdir/$dlname"
3838 $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
3841 # Do each command in the postinstall commands.
3842 lib="$destdir/$realname"
3843 eval cmds=\"$postinstall_cmds\"
3844 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3845 for cmd in $cmds; do
3846 IFS="$save_ifs"
3847 $show "$cmd"
3848 $run eval "$cmd" || exit $?
3849 done
3850 IFS="$save_ifs"
3853 # Install the pseudo-library for information purposes.
3854 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3855 instname="$dir/$name"i
3856 $show "$install_prog $instname $destdir/$name"
3857 $run eval "$install_prog $instname $destdir/$name" || exit $?
3859 # Maybe install the static library, too.
3860 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
3863 *.lo)
3864 # Install (i.e. copy) a libtool object.
3866 # Figure out destination file name, if it wasn't already specified.
3867 if test -n "$destname"; then
3868 destfile="$destdir/$destname"
3869 else
3870 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3871 destfile="$destdir/$destfile"
3874 # Deduce the name of the destination old-style object file.
3875 case "$destfile" in
3876 *.lo)
3877 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
3879 *.o | *.obj)
3880 staticdest="$destfile"
3881 destfile=
3884 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
3885 $echo "$help" 1>&2
3886 exit 1
3888 esac
3890 # Install the libtool object if requested.
3891 if test -n "$destfile"; then
3892 $show "$install_prog $file $destfile"
3893 $run eval "$install_prog $file $destfile" || exit $?
3896 # Install the old object if enabled.
3897 if test "$build_old_libs" = yes; then
3898 # Deduce the name of the old-style object file.
3899 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
3901 $show "$install_prog $staticobj $staticdest"
3902 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
3904 exit 0
3908 # Figure out destination file name, if it wasn't already specified.
3909 if test -n "$destname"; then
3910 destfile="$destdir/$destname"
3911 else
3912 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3913 destfile="$destdir/$destfile"
3916 # Do a test to see if this is really a libtool program.
3917 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3918 link_against_libtool_libs=
3919 relink_command=
3921 # If there is no directory component, then add one.
3922 case "$file" in
3923 */* | *\\*) . $file ;;
3924 *) . ./$file ;;
3925 esac
3927 # Check the variables that should have been set.
3928 if test -z "$link_against_libtool_libs"; then
3929 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
3930 exit 1
3933 finalize=yes
3934 for lib in $link_against_libtool_libs; do
3935 # Check to see that each library is installed.
3936 libdir=
3937 if test -f "$lib"; then
3938 # If there is no directory component, then add one.
3939 case "$lib" in
3940 */* | *\\*) . $lib ;;
3941 *) . ./$lib ;;
3942 esac
3944 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
3945 if test -n "$libdir" && test ! -f "$libfile"; then
3946 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
3947 finalize=no
3949 done
3951 outputname=
3952 if test "$fast_install" = no && test -n "$relink_command"; then
3953 if test "$finalize" = yes && test -z "$run"; then
3954 tmpdir="/tmp"
3955 test -n "$TMPDIR" && tmpdir="$TMPDIR"
3956 tmpdir="$tmpdir/libtool-$$"
3957 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
3958 else
3959 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
3960 continue
3962 outputname="$tmpdir/$file"
3963 # Replace the output file specification.
3964 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
3966 $show "$relink_command"
3967 if $run eval "$relink_command"; then :
3968 else
3969 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
3970 ${rm}r "$tmpdir"
3971 continue
3973 file="$outputname"
3974 else
3975 $echo "$modename: warning: cannot relink \`$file'" 1>&2
3977 else
3978 # Install the binary that we compiled earlier.
3979 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
3983 $show "$install_prog$stripme $file $destfile"
3984 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
3985 test -n "$outputname" && ${rm}r "$tmpdir"
3987 esac
3988 done
3990 for file in $staticlibs; do
3991 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3993 # Set up the ranlib parameters.
3994 oldlib="$destdir/$name"
3996 $show "$install_prog $file $oldlib"
3997 $run eval "$install_prog \$file \$oldlib" || exit $?
3999 if test $gnustrip = yes; then
4000 $show "strip --strip-debug $oldlib"
4001 $run eval "strip --strip-debug $oldlib" || exit $?
4004 # Do each command in the postinstall commands.
4005 eval cmds=\"$old_postinstall_cmds\"
4006 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4007 for cmd in $cmds; do
4008 IFS="$save_ifs"
4009 $show "$cmd"
4010 $run eval "$cmd" || exit $?
4011 done
4012 IFS="$save_ifs"
4013 done
4015 if test -n "$future_libdirs"; then
4016 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4019 if test -n "$current_libdirs"; then
4020 # Maybe just do a dry run.
4021 test -n "$run" && current_libdirs=" -n$current_libdirs"
4022 exec $SHELL $0 --finish$current_libdirs
4023 exit 1
4026 exit 0
4029 # libtool finish mode
4030 finish)
4031 modename="$modename: finish"
4032 libdirs="$nonopt"
4033 admincmds=
4035 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4036 for dir
4038 libdirs="$libdirs $dir"
4039 done
4041 for libdir in $libdirs; do
4042 if test -n "$finish_cmds"; then
4043 # Do each command in the finish commands.
4044 eval cmds=\"$finish_cmds\"
4045 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4046 for cmd in $cmds; do
4047 IFS="$save_ifs"
4048 $show "$cmd"
4049 $run eval "$cmd" || admincmds="$admincmds
4050 $cmd"
4051 done
4052 IFS="$save_ifs"
4054 if test -n "$finish_eval"; then
4055 # Do the single finish_eval.
4056 eval cmds=\"$finish_eval\"
4057 $run eval "$cmds" || admincmds="$admincmds
4058 $cmds"
4060 done
4063 # Exit here if they wanted silent mode.
4064 test "$show" = : && exit 0
4066 echo "----------------------------------------------------------------------"
4067 echo "Libraries have been installed in:"
4068 for libdir in $libdirs; do
4069 echo " $libdir"
4070 done
4071 echo
4072 echo "If you ever happen to want to link against installed libraries"
4073 echo "in a given directory, LIBDIR, you must either use libtool, and"
4074 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
4075 echo "flag during linking and do at least one of the following:"
4076 if test -n "$shlibpath_var"; then
4077 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
4078 echo " during execution"
4080 if test -n "$runpath_var"; then
4081 echo " - add LIBDIR to the \`$runpath_var' environment variable"
4082 echo " during linking"
4084 if test -n "$hardcode_libdir_flag_spec"; then
4085 libdir=LIBDIR
4086 eval flag=\"$hardcode_libdir_flag_spec\"
4088 echo " - use the \`$flag' linker flag"
4090 if test -n "$admincmds"; then
4091 echo " - have your system administrator run these commands:$admincmds"
4093 if test -f /etc/ld.so.conf; then
4094 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4096 echo
4097 echo "See any operating system documentation about shared libraries for"
4098 echo "more information, such as the ld(1) and ld.so(8) manual pages."
4099 echo "----------------------------------------------------------------------"
4100 exit 0
4103 # libtool clean mode
4104 clean)
4105 modename="$modename: clean"
4106 rm="$nonopt"
4107 files=
4109 # This variable tells wrapper scripts just to set variables rather
4110 # than running their programs.
4111 libtool_install_magic="$magic"
4113 for arg
4115 case "$arg" in
4116 -*) rm="$rm $arg" ;;
4117 *) files="$files $arg" ;;
4118 esac
4119 done
4121 if test -z "$rm"; then
4122 $echo "$modename: you must specify an RM program" 1>&2
4123 $echo "$help" 1>&2
4124 exit 1
4127 for file in $files; do
4128 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4129 if test "X$dir" = "X$file"; then
4130 dir=.
4131 objdir="$objdir"
4132 else
4133 objdir="$dir/$objdir"
4135 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4137 rmfiles="$file"
4139 case "$file" in
4140 *.la)
4141 # Possibly a libtool archive, so verify it.
4142 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4143 . ./$file
4145 # Delete the libtool libraries and symlinks.
4146 for n in $library_names; do
4147 rmfiles="$rmfiles $objdir/$n"
4148 test "X$n" = "X$dlname" && dlname=
4149 done
4150 test -n "$dlname" && rmfiles="$rmfiles $objdir/$dlname"
4151 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
4152 rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
4156 *.lo)
4157 if test "$build_old_libs" = yes; then
4158 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4159 rmfiles="$rmfiles $dir/$oldobj"
4164 # Do a test to see if this is a libtool program.
4165 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4166 relink_command=
4167 . $dir/$file
4169 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4170 if test "$fast_install" = yes && test -n "$relink_command"; then
4171 rmfiles="$rmfiles $objdir/lt-$name"
4175 esac
4176 $show "$rm $rmfiles"
4177 $run $rm $rmfiles
4178 done
4179 exit 0
4182 # libtool execute mode
4183 execute)
4184 modename="$modename: execute"
4186 # The first argument is the command name.
4187 cmd="$nonopt"
4188 if test -z "$cmd"; then
4189 $echo "$modename: you must specify a COMMAND" 1>&2
4190 $echo "$help"
4191 exit 1
4194 # Handle -dlopen flags immediately.
4195 for file in $execute_dlfiles; do
4196 if test ! -f "$file"; then
4197 $echo "$modename: \`$file' is not a file" 1>&2
4198 $echo "$help" 1>&2
4199 exit 1
4202 dir=
4203 case "$file" in
4204 *.la)
4205 # Check to see that this really is a libtool archive.
4206 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4207 else
4208 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4209 $echo "$help" 1>&2
4210 exit 1
4213 # Read the libtool library.
4214 dlname=
4215 library_names=
4217 # If there is no directory component, then add one.
4218 case "$file" in
4219 */* | *\\*) . $file ;;
4220 *) . ./$file ;;
4221 esac
4223 # Skip this library if it cannot be dlopened.
4224 if test -z "$dlname"; then
4225 # Warn if it was a shared library.
4226 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4227 continue
4230 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4231 test "X$dir" = "X$file" && dir=.
4233 if test -f "$dir/$objdir/$dlname"; then
4234 dir="$dir/$objdir"
4235 else
4236 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4237 exit 1
4241 *.lo)
4242 # Just add the directory containing the .lo file.
4243 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4244 test "X$dir" = "X$file" && dir=.
4248 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4249 continue
4251 esac
4253 # Get the absolute pathname.
4254 absdir=`cd "$dir" && pwd`
4255 test -n "$absdir" && dir="$absdir"
4257 # Now add the directory to shlibpath_var.
4258 if eval "test -z \"\$$shlibpath_var\""; then
4259 eval "$shlibpath_var=\"\$dir\""
4260 else
4261 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4263 done
4265 # This variable tells wrapper scripts just to set shlibpath_var
4266 # rather than running their programs.
4267 libtool_execute_magic="$magic"
4269 # Check if any of the arguments is a wrapper script.
4270 args=
4271 for file
4273 case "$file" in
4274 -*) ;;
4276 # Do a test to see if this is really a libtool program.
4277 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4278 # If there is no directory component, then add one.
4279 case "$file" in
4280 */* | *\\*) . $file ;;
4281 *) . ./$file ;;
4282 esac
4284 # Transform arg to wrapped name.
4285 file="$progdir/$program"
4288 esac
4289 # Quote arguments (to preserve shell metacharacters).
4290 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4291 args="$args \"$file\""
4292 done
4294 if test -z "$run"; then
4295 # Export the shlibpath_var.
4296 eval "export $shlibpath_var"
4298 # Restore saved enviroment variables
4299 if test "${save_LC_ALL+set}" = set; then
4300 LC_ALL="$save_LC_ALL"; export LC_ALL
4302 if test "${save_LANG+set}" = set; then
4303 LANG="$save_LANG"; export LANG
4306 # Now actually exec the command.
4307 eval "exec \$cmd$args"
4309 $echo "$modename: cannot exec \$cmd$args"
4310 exit 1
4311 else
4312 # Display what would be done.
4313 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4314 $echo "export $shlibpath_var"
4315 $echo "$cmd$args"
4316 exit 0
4320 # libtool uninstall mode
4321 uninstall)
4322 modename="$modename: uninstall"
4323 rm="$nonopt"
4324 files=
4326 for arg
4328 case "$arg" in
4329 -*) rm="$rm $arg" ;;
4330 *) files="$files $arg" ;;
4331 esac
4332 done
4334 if test -z "$rm"; then
4335 $echo "$modename: you must specify an RM program" 1>&2
4336 $echo "$help" 1>&2
4337 exit 1
4340 for file in $files; do
4341 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4342 test "X$dir" = "X$file" && dir=.
4343 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4345 rmfiles="$file"
4347 case "$name" in
4348 *.la)
4349 # Possibly a libtool archive, so verify it.
4350 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4351 . $dir/$name
4353 # Delete the libtool libraries and symlinks.
4354 for n in $library_names; do
4355 rmfiles="$rmfiles $dir/$n"
4356 test "X$n" = "X$dlname" && dlname=
4357 done
4358 test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
4359 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
4361 $show "$rm $rmfiles"
4362 $run $rm $rmfiles
4364 if test -n "$library_names"; then
4365 # Do each command in the postuninstall commands.
4366 eval cmds=\"$postuninstall_cmds\"
4367 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4368 for cmd in $cmds; do
4369 IFS="$save_ifs"
4370 $show "$cmd"
4371 $run eval "$cmd"
4372 done
4373 IFS="$save_ifs"
4376 if test -n "$old_library"; then
4377 # Do each command in the old_postuninstall commands.
4378 eval cmds=\"$old_postuninstall_cmds\"
4379 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4380 for cmd in $cmds; do
4381 IFS="$save_ifs"
4382 $show "$cmd"
4383 $run eval "$cmd"
4384 done
4385 IFS="$save_ifs"
4388 # FIXME: should reinstall the best remaining shared library.
4392 *.lo)
4393 if test "$build_old_libs" = yes; then
4394 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4395 rmfiles="$rmfiles $dir/$oldobj"
4397 $show "$rm $rmfiles"
4398 $run $rm $rmfiles
4402 $show "$rm $rmfiles"
4403 $run $rm $rmfiles
4405 esac
4406 done
4407 exit 0
4411 $echo "$modename: you must specify a MODE" 1>&2
4412 $echo "$generic_help" 1>&2
4413 exit 1
4415 esac
4417 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4418 $echo "$generic_help" 1>&2
4419 exit 1
4420 fi # test -z "$show_help"
4422 # We need to display help for each of the modes.
4423 case "$mode" in
4424 "") $echo \
4425 "Usage: $modename [OPTION]... [MODE-ARG]...
4427 Provide generalized library-building support services.
4429 --config show all configuration variables
4430 --debug enable verbose shell tracing
4431 -n, --dry-run display commands without modifying any files
4432 --features display basic configuration information and exit
4433 --finish same as \`--mode=finish'
4434 --help display this help message and exit
4435 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
4436 --quiet same as \`--silent'
4437 --silent don't print informational messages
4438 --version print version information
4440 MODE must be one of the following:
4442 clean remove files from the build directory
4443 compile compile a source file into a libtool object
4444 execute automatically set library path, then run a program
4445 finish complete the installation of libtool libraries
4446 install install libraries or executables
4447 link create a library or an executable
4448 uninstall remove libraries from an installed directory
4450 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
4451 a more detailed description of MODE."
4452 exit 0
4455 clean)
4456 $echo \
4457 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
4459 Remove files from the build directory.
4461 RM is the name of the program to use to delete files associated with each FILE
4462 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4463 to RM.
4465 If FILE is a libtool library, object or program, all the files associated
4466 with it are deleted. Otherwise, only FILE itself is deleted using RM."
4469 compile)
4470 $echo \
4471 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4473 Compile a source file into a libtool library object.
4475 This mode accepts the following additional options:
4477 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
4478 -static always build a \`.o' file suitable for static linking
4480 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4481 from the given SOURCEFILE.
4483 The output file name is determined by removing the directory component from
4484 SOURCEFILE, then substituting the C source code suffix \`.c' with the
4485 library object suffix, \`.lo'."
4488 execute)
4489 $echo \
4490 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4492 Automatically set library path, then run a program.
4494 This mode accepts the following additional options:
4496 -dlopen FILE add the directory containing FILE to the library path
4498 This mode sets the library path environment variable according to \`-dlopen'
4499 flags.
4501 If any of the ARGS are libtool executable wrappers, then they are translated
4502 into their corresponding uninstalled binary, and any of their required library
4503 directories are added to the library path.
4505 Then, COMMAND is executed, with ARGS as arguments."
4508 finish)
4509 $echo \
4510 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4512 Complete the installation of libtool libraries.
4514 Each LIBDIR is a directory that contains libtool libraries.
4516 The commands that this mode executes may require superuser privileges. Use
4517 the \`--dry-run' option if you just want to see what would be executed."
4520 install)
4521 $echo \
4522 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4524 Install executables or libraries.
4526 INSTALL-COMMAND is the installation command. The first component should be
4527 either the \`install' or \`cp' program.
4529 The rest of the components are interpreted as arguments to that command (only
4530 BSD-compatible install options are recognized)."
4533 link)
4534 $echo \
4535 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4537 Link object files or libraries together to form another library, or to
4538 create an executable program.
4540 LINK-COMMAND is a command using the C compiler that you would use to create
4541 a program from several object files.
4543 The following components of LINK-COMMAND are treated specially:
4545 -all-static do not do any dynamic linking at all
4546 -avoid-version do not add a version suffix if possible
4547 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
4548 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
4549 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4550 -export-symbols SYMFILE
4551 try to export only the symbols listed in SYMFILE
4552 -export-symbols-regex REGEX
4553 try to export only the symbols matching REGEX
4554 -LLIBDIR search LIBDIR for required installed libraries
4555 -lNAME OUTPUT-FILE requires the installed library libNAME
4556 -module build a library that can dlopened
4557 -no-undefined declare that a library does not refer to external symbols
4558 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
4559 -release RELEASE specify package release information
4560 -rpath LIBDIR the created library will eventually be installed in LIBDIR
4561 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
4562 -static do not do any dynamic linking of libtool libraries
4563 -version-info CURRENT[:REVISION[:AGE]]
4564 specify library version info [each variable defaults to 0]
4566 All other options (arguments beginning with \`-') are ignored.
4568 Every other argument is treated as a filename. Files ending in \`.la' are
4569 treated as uninstalled libtool libraries, other files are standard or library
4570 object files.
4572 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4573 only library objects (\`.lo' files) may be specified, and \`-rpath' is
4574 required, except when creating a convenience library.
4576 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4577 using \`ar' and \`ranlib', or on Windows using \`lib'.
4579 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4580 is created, otherwise an executable program is created."
4583 uninstall)
4584 $echo \
4585 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4587 Remove libraries from an installation directory.
4589 RM is the name of the program to use to delete files associated with each FILE
4590 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4591 to RM.
4593 If FILE is a libtool library, all the files associated with it are deleted.
4594 Otherwise, only FILE itself is deleted using RM."
4598 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4599 $echo "$help" 1>&2
4600 exit 1
4602 esac
4604 echo
4605 $echo "Try \`$modename --help' for more information about other modes."
4607 exit 0
4609 # Local Variables:
4610 # mode:shell-script
4611 # sh-indentation:2
4612 # End: