* arm/netbsd.h: Ensure DWARF2_UNWIND_INFO is undefined.
[official-gcc.git] / ltmain.sh
blob1893b011a6df0b8fe4b1e33b2927523d9189c2e1
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-1998 Free Software Foundation, Inc.
5 # 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 # The name of this program.
27 progname=`$echo "$0" | sed 's%^.*/%%'`
28 modename="$progname"
30 # Constants.
31 PROGRAM=ltmain.sh
32 PACKAGE=libtool
33 VERSION=1.2a
35 default_mode=
36 help="Try \`$progname --help' for more information."
37 magic="%%%MAGIC variable%%%"
38 mkdir="mkdir"
39 mv="mv -f"
40 rm="rm -f"
42 # Sed substitution that helps us do robust quoting. It backslashifies
43 # metacharacters that are still active within double-quoted strings.
44 Xsed='sed -e s/^X//'
45 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
47 # NLS nuisances.
48 # Only set LANG and LC_ALL to C if already set.
49 # These must not be set unconditionally because not all systems understand
50 # e.g. LANG=C (notably SCO).
51 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
52 if test "${LANG+set}" = set; then LANG=C; export LANG; fi
54 if test "$LTCONFIG_VERSION" != "$VERSION"; then
55 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
56 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
57 exit 1
60 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
61 echo "$modename: not configured to build any kind of library" 1>&2
62 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
63 exit 1
66 # Global variables.
67 mode=$default_mode
68 nonopt=
69 prev=
70 prevopt=
71 run=
72 show="$echo"
73 show_help=
74 execute_dlfiles=
76 # Parse our command line options once, thoroughly.
77 while test $# -gt 0
79 arg="$1"
80 shift
82 case "$arg" in
83 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
84 *) optarg= ;;
85 esac
87 # If the previous option needs an argument, assign it.
88 if test -n "$prev"; then
89 case "$prev" in
90 execute_dlfiles)
91 eval "$prev=\"\$$prev \$arg\""
94 eval "$prev=\$arg"
96 esac
98 prev=
99 prevopt=
100 continue
103 # Have we seen a non-optional argument yet?
104 case "$arg" in
105 --help)
106 show_help=yes
109 --version)
110 echo "$PROGRAM (GNU $PACKAGE) $VERSION"
111 exit 0
114 --config)
115 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
116 exit 0
119 --debug)
120 echo "$progname: enabling shell trace mode"
121 set -x
124 --dry-run | -n)
125 run=:
128 --features)
129 echo "host: $host"
130 if test "$build_libtool_libs" = yes; then
131 echo "enable shared libraries"
132 else
133 echo "disable shared libraries"
135 if test "$build_old_libs" = yes; then
136 echo "enable static libraries"
137 else
138 echo "disable static libraries"
140 exit 0
143 --finish) mode="finish" ;;
145 --mode) prevopt="--mode" prev=mode ;;
146 --mode=*) mode="$optarg" ;;
148 --quiet | --silent)
149 show=:
152 -dlopen)
153 prevopt="-dlopen"
154 prev=execute_dlfiles
158 $echo "$modename: unrecognized option \`$arg'" 1>&2
159 $echo "$help" 1>&2
160 exit 1
164 nonopt="$arg"
165 break
167 esac
168 done
170 if test -n "$prevopt"; then
171 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
172 $echo "$help" 1>&2
173 exit 1
176 if test -z "$show_help"; then
178 # Infer the operation mode.
179 if test -z "$mode"; then
180 case "$nonopt" in
181 *cc | *++ | gcc* | *-gcc*)
182 mode=link
183 for arg
185 case "$arg" in
187 mode=compile
188 break
190 esac
191 done
193 *db | *dbx)
194 mode=execute
196 *install*|cp|mv)
197 mode=install
199 *rm)
200 mode=uninstall
203 # If we have no mode, but dlfiles were specified, then do execute mode.
204 test -n "$execute_dlfiles" && mode=execute
206 # Just use the default operation mode.
207 if test -z "$mode"; then
208 if test -n "$nonopt"; then
209 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
210 else
211 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
215 esac
218 # Only execute mode is allowed to have -dlopen flags.
219 if test -n "$execute_dlfiles" && test "$mode" != execute; then
220 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
221 $echo "$help" 1>&2
222 exit 1
225 # Change the help message to a mode-specific one.
226 generic_help="$help"
227 help="Try \`$modename --help --mode=$mode' for more information."
229 # These modes are in order of execution frequency so that they run quickly.
230 case "$mode" in
231 # libtool compile mode
232 compile)
233 modename="$modename: compile"
234 # Get the compilation command and the source file.
235 base_compile=
236 lastarg=
237 srcfile="$nonopt"
238 suppress_output=
240 for arg
242 # Accept any command-line options.
243 case "$arg" in
245 $echo "$modename: you cannot specify the output filename with \`-o'" 1>&2
246 $echo "$help" 1>&2
247 exit 1
250 -static)
251 build_libtool_libs=no
252 build_old_libs=yes
253 continue
255 esac
257 # Accept the current argument as the source file.
258 lastarg="$srcfile"
259 srcfile="$arg"
261 # Aesthetically quote the previous argument.
263 # Backslashify any backslashes, double quotes, and dollar signs.
264 # These are the only characters that are still specially
265 # interpreted inside of double-quoted scrings.
266 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
268 # Double-quote args containing other shell metacharacters.
269 # Many Bourne shells cannot handle close brackets correctly in scan
270 # sets, so we specify it separately.
271 case "$lastarg" in
272 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
273 lastarg="\"$lastarg\""
275 esac
277 # Add the previous argument to base_compile.
278 if test -z "$base_compile"; then
279 base_compile="$lastarg"
280 else
281 base_compile="$base_compile $lastarg"
283 done
285 # Get the name of the library object.
286 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
288 # Recognize several different file suffixes.
289 xform='[cCFSfms]'
290 case "$libobj" in
291 *.ada) xform=ada ;;
292 *.adb) xform=adb ;;
293 *.ads) xform=ads ;;
294 *.asm) xform=asm ;;
295 *.c++) xform=c++ ;;
296 *.cc) xform=cc ;;
297 *.cpp) xform=cpp ;;
298 *.cxx) xform=cxx ;;
299 *.f90) xform=f90 ;;
300 *.for) xform=for ;;
301 esac
303 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
305 case "$libobj" in
306 *.lo) obj=`$echo "X$libobj" | $Xsed -e 's/\.lo$/.o/'` ;;
308 $echo "$modename: cannot determine name of library object from \`$srcfile'" 1>&2
309 exit 1
311 esac
313 if test -z "$base_compile"; then
314 $echo "$modename: you must specify a compilation command" 1>&2
315 $echo "$help" 1>&2
316 exit 1
319 # Delete any leftover library objects.
320 if test "$build_old_libs" = yes; then
321 $run $rm $obj $libobj
322 trap "$run $rm $obj $libobj; exit 1" 1 2 15
323 else
324 $run $rm $libobj
325 trap "$run $rm $libobj; exit 1" 1 2 15
328 # Only build a PIC object if we are building libtool libraries.
329 if test "$build_libtool_libs" = yes; then
330 # Without this assignment, base_compile gets emptied.
331 fbsd_hideous_sh_bug=$base_compile
333 # All platforms use -DPIC, to notify preprocessed assembler code.
334 $show "$base_compile$pic_flag -DPIC $srcfile"
335 if $run eval "$base_compile\$pic_flag -DPIC \$srcfile"; then :
336 else
337 test -n "$obj" && $run $rm $obj
338 exit 1
341 # If we have no pic_flag, then copy the object into place and finish.
342 if test -z "$pic_flag"; then
343 $show "$LN_S $obj $libobj"
344 $run $LN_S $obj $libobj
345 exit $?
348 # Just move the object, then go on to compile the next one
349 $show "$mv $obj $libobj"
350 $run $mv $obj $libobj || exit 1
352 # Allow error messages only from the first compilation.
353 suppress_output=' >/dev/null 2>&1'
356 # Only build a position-dependent object if we build old libraries.
357 if test "$build_old_libs" = yes; then
358 # Suppress compiler output if we already did a PIC compilation.
359 $show "$base_compile $srcfile$suppress_output"
360 if $run eval "$base_compile \$srcfile$suppress_output"; then :
361 else
362 $run $rm $obj $libobj
363 exit 1
367 # Create an invalid libtool object if no PIC, so that we do not
368 # accidentally link it into a program.
369 if test "$build_libtool_libs" != yes; then
370 $show "echo timestamp > $libobj"
371 $run eval "echo timestamp > \$libobj" || exit $?
374 exit 0
377 # libtool link mode
378 link)
379 modename="$modename: link"
380 CC="$nonopt"
381 allow_undefined=yes
382 compile_command="$CC"
383 finalize_command="$CC"
385 compile_shlibpath=
386 finalize_shlibpath=
387 deplibs=
388 dlfiles=
389 dlprefiles=
390 export_dynamic=no
391 hardcode_libdirs=
392 libobjs=
393 link_against_libtool_libs=
394 ltlibs=
395 objs=
396 prev=
397 prevarg=
398 release=
399 rpath=
400 perm_rpath=
401 temp_rpath=
402 vinfo=
404 # We need to know -static, to get the right output filenames.
405 for arg
407 case "$arg" in
408 -all-static | -static)
409 if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
410 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
412 build_libtool_libs=no
413 build_old_libs=yes
414 break
416 esac
417 done
419 # See if our shared archives depend on static archives.
420 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
422 # Go through the arguments, transforming them on the way.
423 for arg
425 # If the previous option needs an argument, assign it.
426 if test -n "$prev"; then
427 case "$prev" in
428 output)
429 compile_command="$compile_command @OUTPUT@"
430 finalize_command="$finalize_command @OUTPUT@"
432 esac
434 case "$prev" in
435 dlfiles|dlprefiles)
436 case "$arg" in
437 *.la | *.lo) ;; # We handle these cases below.
439 dlprefiles="$dlprefiles $arg"
440 test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
441 prev=
443 esac
445 release)
446 release="-$arg"
447 prev=
448 continue
450 rpath)
451 rpath="$rpath $arg"
452 prev=
453 continue
456 eval "$prev=\"\$arg\""
457 prev=
458 continue
460 esac
463 prevarg="$arg"
465 case "$arg" in
466 -all-static)
467 if test -n "$link_static_flag"; then
468 compile_command="$compile_command $link_static_flag"
469 finalize_command="$finalize_command $link_static_flag"
471 continue
474 -allow-undefined)
475 # FIXME: remove this flag sometime in the future.
476 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
477 continue
480 -dlopen)
481 prev=dlfiles
482 continue
485 -dlpreopen)
486 prev=dlprefiles
487 continue
490 -export-dynamic)
491 if test "$export_dynamic" != yes; then
492 export_dynamic=yes
493 if test -n "$export_dynamic_flag_spec"; then
494 eval arg=\"$export_dynamic_flag_spec\"
495 else
496 arg=
499 # Add the symbol object into the linking commands.
500 compile_command="$compile_command @SYMFILE@"
501 finalize_command="$finalize_command @SYMFILE@"
505 -L*)
506 dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
507 case "$dir" in
508 /* | [A-Za-z]:\\*)
509 # Add the corresponding hardcode_libdir_flag, if it is not identical.
512 $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
513 exit 1
515 esac
516 deplibs="$deplibs $arg"
519 -l*) deplibs="$deplibs $arg" ;;
521 -no-undefined)
522 allow_undefined=no
523 continue
526 -o) prev=output ;;
528 -release)
529 prev=release
530 continue
533 -rpath)
534 prev=rpath
535 continue
538 -static)
539 # If we have no pic_flag, then this is the same as -all-static.
540 if test -z "$pic_flag" && test -n "$link_static_flag"; then
541 compile_command="$compile_command $link_static_flag"
542 finalize_command="$finalize_command $link_static_flag"
544 continue
547 -version-info)
548 prev=vinfo
549 continue
552 # Some other compiler flag.
553 -* | +*)
554 # Unknown arguments in both finalize_command and compile_command need
555 # to be aesthetically quoted because they are evaled later.
556 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
557 case "$arg" in
558 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
559 arg="\"$arg\""
561 esac
564 *.o | *.a)
565 # A standard object.
566 objs="$objs $arg"
569 *.lo)
570 # A library object.
571 if test "$prev" = dlfiles; then
572 dlfiles="$dlfiles $arg"
573 if test "$build_libtool_libs" = yes; then
574 prev=
575 continue
576 else
577 # If libtool objects are unsupported, then we need to preload.
578 prev=dlprefiles
582 if test "$prev" = dlprefiles; then
583 # Preload the old-style object.
584 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e 's/\.lo$/.o/'`
585 prev=
587 libobjs="$libobjs $arg"
590 *.la)
591 # A libtool-controlled library.
593 dlname=
594 libdir=
595 library_names=
596 old_library=
598 # Check to see that this really is a libtool archive.
599 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
600 else
601 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
602 exit 1
605 # If there is no directory component, then add one.
606 case "$arg" in
607 */* | *\\*) . $arg ;;
608 *) . ./$arg ;;
609 esac
611 if test -z "$libdir"; then
612 $echo "$modename: \`$arg' contains no -rpath information" 1>&2
613 exit 1
616 # Get the name of the library we link against.
617 linklib=
618 for l in $old_library $library_names; do
619 linklib="$l"
620 done
622 if test -z "$linklib"; then
623 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
624 exit 1
627 # Find the relevant object directory and library name.
628 name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
629 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
630 if test "X$dir" = "X$arg"; then
631 dir="$objdir"
632 else
633 dir="$dir/$objdir"
636 # This library was specified with -dlopen.
637 if test "$prev" = dlfiles; then
638 dlfiles="$dlfiles $arg"
639 if test -z "$dlname"; then
640 # If there is no dlname, we need to preload.
641 prev=dlprefiles
642 else
643 # We should not create a dependency on this library, but we
644 # may need any libraries it requires.
645 compile_command="$compile_command$dependency_libs"
646 finalize_command="$finalize_command$dependency_libs"
647 prev=
648 continue
652 # The library was specified with -dlpreopen.
653 if test "$prev" = dlprefiles; then
654 # Prefer using a static library (so that no silly _DYNAMIC symbols
655 # are required to link).
656 if test -n "$old_library"; then
657 dlprefiles="$dlprefiles $dir/$old_library"
658 else
659 dlprefiles="$dlprefiles $dir/$linklib"
661 prev=
664 if test "$build_libtool_libs" = yes && test -n "$library_names"; then
665 link_against_libtool_libs="$link_against_libtool_libs $arg"
666 if test -n "$shlibpath_var"; then
667 # Make sure the rpath contains only unique directories.
668 case "$temp_rpath " in
669 *" $dir "*) ;;
670 *) temp_rpath="$temp_rpath $dir" ;;
671 esac
674 # This is the magic to use -rpath.
675 if test -n "$hardcode_libdir_flag_spec"; then
676 if test -n "$hardcode_libdir_separator"; then
677 if test -z "$hardcode_libdirs"; then
678 # Put the magic libdir with the hardcode flag.
679 hardcode_libdirs="$libdir"
680 libdir="@HARDCODE_LIBDIRS@"
681 else
682 # Just accumulate the unique libdirs.
683 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
684 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
687 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
689 esac
690 libdir=
694 if test -n "$libdir"; then
695 eval flag=\"$hardcode_libdir_flag_spec\"
697 compile_command="$compile_command $flag"
698 finalize_command="$finalize_command $flag"
700 elif test -n "$runpath_var"; then
701 # Do the same for the permanent run path.
702 case "$perm_rpath " in
703 *" $libdir "*) ;;
704 *) perm_rpath="$perm_rpath $libdir" ;;
705 esac
709 case "$hardcode_action" in
710 immediate)
711 if test "$hardcode_direct" = no; then
712 compile_command="$compile_command $dir/$linklib"
713 elif test "$hardcode_minus_L" = no; then
714 compile_command="$compile_command -L$dir -l$name"
715 elif test "$hardcode_shlibpath_var" = no; then
716 compile_shlibpath="$compile_shlibpath$dir:"
717 compile_command="$compile_command -l$name"
721 relink)
722 # We need an absolute path.
723 case "$dir" in
724 /* | [A-Za-z]:\\*) ;;
726 absdir=`cd "$dir" && pwd`
727 if test -z "$absdir"; then
728 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
729 exit 1
731 dir="$absdir"
733 esac
735 if test "$hardcode_direct" = yes; then
736 compile_command="$compile_command $dir/$linklib"
737 elif test "$hardcode_minus_L" = yes; then
738 compile_command="$compile_command -L$dir -l$name"
739 elif test "$hardcode_shlibpath_var" = yes; then
740 compile_shlibpath="$compile_shlibpath$dir:"
741 compile_command="$compile_command -l$name"
744 esac
746 # Finalize command for both is simple: just hardcode it.
747 if test "$hardcode_direct" = yes; then
748 finalize_command="$finalize_command $libdir/$linklib"
749 elif test "$hardcode_minus_L" = yes; then
750 finalize_command="$finalize_command -L$libdir -l$name"
751 elif test "$hardcode_shlibpath_var" = yes; then
752 finalize_shlibpath="$finalize_shlibpath$libdir:"
753 finalize_command="$finalize_command -l$name"
754 else
755 # We cannot seem to hardcode it, guess we'll fake it.
756 finalize_command="$finalize_command -L$libdir -l$name"
758 else
759 # Transform directly to old archives if we don't build new libraries.
760 if test -n "$pic_flag" && test -z "$old_library"; then
761 $echo "$modename: cannot find static library for \`$arg'" 1>&2
762 exit 1
765 # Here we assume that one of hardcode_direct or hardcode_minus_L
766 # is not unsupported. This is valid on all known static and
767 # shared platforms.
768 if test "$hardcode_direct" != unsupported; then
769 test -n "$old_library" && linklib="$old_library"
770 compile_command="$compile_command $dir/$linklib"
771 finalize_command="$finalize_command $dir/$linklib"
772 else
773 compile_command="$compile_command -L$dir -l$name"
774 finalize_command="$finalize_command -L$dir -l$name"
778 # Add in any libraries that this one depends upon.
779 compile_command="$compile_command$dependency_libs"
780 finalize_command="$finalize_command$dependency_libs"
781 continue
784 # Some other compiler argument.
786 # Unknown arguments in both finalize_command and compile_command need
787 # to be aesthetically quoted because they are evaled later.
788 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
789 case "$arg" in
790 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
791 arg="\"$arg\""
793 esac
795 esac
797 # Now actually substitute the argument into the commands.
798 if test -n "$arg"; then
799 compile_command="$compile_command $arg"
800 finalize_command="$finalize_command $arg"
802 done
804 if test -n "$prev"; then
805 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
806 $echo "$help" 1>&2
807 exit 1
810 if test -n "$vinfo" && test -n "$release"; then
811 $echo "$modename: you cannot specify both \`-version-info' and \`-release'" 1>&2
812 $echo "$help" 1>&2
813 exit 1
816 oldlib=
817 oldobjs=
818 case "$output" in
820 $echo "$modename: you must specify an output file" 1>&2
821 $echo "$help" 1>&2
822 exit 1
825 */* | *\\*)
826 $echo "$modename: output file \`$output' must have no directory components" 1>&2
827 exit 1
830 *.a)
831 # Now set the variables for building old libraries.
832 build_libtool_libs=no
833 build_old_libs=yes
834 oldlib="$output"
835 $show "$rm $oldlib"
836 $run $rm $oldlib
839 *.la)
840 # Make sure we only generate libraries of the form `libNAME.la'.
841 case "$output" in
842 lib*) ;;
844 $echo "$modename: libtool library \`$arg' must begin with \`lib'" 1>&2
845 $echo "$help" 1>&2
846 exit 1
848 esac
850 name=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
851 eval libname=\"$libname_spec\"
853 # All the library-specific variables (install_libdir is set above).
854 library_names=
855 old_library=
856 dlname=
857 current=0
858 revision=0
859 age=0
861 if test -n "$objs"; then
862 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
863 exit 1
866 # How the heck are we supposed to write a wrapper for a shared library?
867 if test -n "$link_against_libtool_libs"; then
868 $echo "$modename: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
869 exit 1
872 if test -n "$dlfiles$dlprefiles"; then
873 $echo "$modename: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
874 # Nullify the symbol file.
875 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
876 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
879 if test -z "$rpath"; then
880 $echo "$modename: you must specify an installation directory with \`-rpath'" 1>&2
881 $echo "$help" 1>&2
882 exit 1
885 set dummy $rpath
886 if test $# -gt 2; then
887 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
889 install_libdir="$2"
891 if test -n "$vinfo"; then
893 # Parse the version information argument.
894 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
895 set dummy $vinfo
896 IFS="$save_ifs"
898 if test -n "$5"; then
899 $echo "$modename: too many parameters to \`-version-info'" 1>&2
900 $echo "$help" 1>&2
901 exit 1
904 test -n "$2" && current="$2"
905 test -n "$3" && revision="$3"
906 test -n "$4" && age="$4"
908 # Check that each of the things are valid numbers.
909 case "$current" in
910 0 | [1-9] | [1-9][0-9]*) ;;
912 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
913 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
914 exit 1
916 esac
918 case "$revision" in
919 0 | [1-9] | [1-9][0-9]*) ;;
921 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
922 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
923 exit 1
925 esac
927 case "$age" in
928 0 | [1-9] | [1-9][0-9]*) ;;
930 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
931 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
932 exit 1
934 esac
936 if test $age -gt $current; then
937 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
938 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
939 exit 1
942 # Calculate the version variables.
943 version_vars="version_type current age revision"
944 case "$version_type" in
945 none) ;;
947 linux)
948 version_vars="$version_vars major versuffix"
949 major=.`expr $current - $age`
950 versuffix=".$major.$age.$revision"
953 osf)
954 version_vars="$version_vars versuffix verstring"
955 major=.`expr $current - $age`
956 versuffix=."$current.$age.$revision"
957 verstring="$current.$age.$revision"
959 # Add in all the interfaces that we are compatible with.
960 loop=$age
961 while test $loop != 0; do
962 iface=`expr $current - $loop`
963 loop=`expr $loop - 1`
964 verstring="$verstring:${iface}.0"
965 done
967 # Make executables depend on our current version.
968 verstring="$verstring:${current}.0"
971 sunos)
972 version_vars="$version_vars major versuffix"
973 major=."$current"
974 versuffix=."$current.$revision"
977 windows)
978 # Like Linux, but with '-' rather than '.', since we only
979 # want one extension on Windows 95.
980 version_vars="$version_vars major versuffix"
981 major=`expr $current - $age`
982 versuffix="-$major-$age-$revision"
986 $echo "$modename: unknown library version type \`$version_type'" 1>&2
987 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
988 exit 1
990 esac
991 else
993 # No version information.
994 version_vars=
996 case "$version_type" in
997 none) ;;
999 linux)
1000 version_vars="$version_vars versuffix major"
1001 major=
1002 versuffix=
1005 osf)
1006 version_vars="$version_vars versuffix verstring"
1007 major=
1008 versuffix=
1009 verstring=":0.0"
1012 sunos)
1013 version_vars="$version_vars major versuffix"
1014 major=
1015 versuffix=
1018 windows)
1019 # Like Linux, but with '-' rather than '.', and with a leading
1020 # '-', since we only want one extension on Windows 95.
1021 version_vars="$version_vars major versuffix"
1022 major=
1023 versuffix=
1027 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1028 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1029 exit 1
1031 esac
1034 # Create the output directory, or remove our outputs if we need to.
1035 if test -d $objdir; then
1036 $show "$rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*"
1037 $run $rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*
1038 else
1039 $show "$mkdir $objdir"
1040 $run $mkdir $objdir
1041 status=$?
1042 if test $status -eq 0 || test -d $objdir; then :
1043 else
1044 exit $status
1048 # Check to see if the archive will have undefined symbols.
1049 if test "$allow_undefined" = yes; then
1050 if test "$allow_undefined_flag" = unsupported; then
1051 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1052 build_libtool_libs=no
1053 build_old_libs=yes
1055 else
1056 # Don't allow undefined symbols.
1057 allow_undefined_flag="$no_undefined_flag"
1060 # Add libc to deplibs on all systems.
1061 dependency_libs="$deplibs"
1062 deplibs="$deplibs -lc"
1064 if test "$build_libtool_libs" = yes; then
1065 # Get the real and link names of the library.
1066 eval library_names=\"$library_names_spec\"
1067 set dummy $library_names
1068 realname="$2"
1069 shift; shift
1071 if test -n "$soname_spec"; then
1072 eval soname=\"$soname_spec\"
1073 else
1074 soname="$realname"
1077 lib="$objdir/$realname"
1078 for link
1080 linknames="$linknames $link"
1081 done
1083 # Use standard objects if they are PIC.
1084 test -z "$pic_flag" && libobjs=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'`
1086 # Do each of the archive commands.
1087 eval cmds=\"$archive_cmds\"
1088 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1089 for cmd in $cmds; do
1090 IFS="$save_ifs"
1091 $show "$cmd"
1092 $run eval "$cmd" || exit $?
1093 done
1094 IFS="$save_ifs"
1096 # Create links to the real library.
1097 for linkname in $linknames; do
1098 if test "$realname" != "$linkname"; then
1099 $show "(cd $objdir && $LN_S $realname $linkname)"
1100 $run eval '(cd $objdir && $LN_S $realname $linkname)' || exit $?
1102 done
1104 # If -export-dynamic was specified, set the dlname.
1105 if test "$export_dynamic" = yes; then
1106 # On all known operating systems, these are identical.
1107 dlname="$soname"
1111 # Now set the variables for building old libraries.
1112 oldlib="$objdir/$libname.a"
1115 *.lo | *.o)
1116 if test -n "$link_against_libtool_libs"; then
1117 $echo "$modename: error: cannot link libtool libraries into reloadable objects" 1>&2
1118 exit 1
1121 if test -n "$deplibs"; then
1122 $echo "$modename: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
1125 if test -n "$dlfiles$dlprefiles"; then
1126 $echo "$modename: warning: \`-dlopen' is ignored while creating objects" 1>&2
1127 # Nullify the symbol file.
1128 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
1129 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
1132 if test -n "$rpath"; then
1133 $echo "$modename: warning: \`-rpath' is ignored while creating objects" 1>&2
1136 if test -n "$vinfo"; then
1137 $echo "$modename: warning: \`-version-info' is ignored while creating objects" 1>&2
1140 if test -n "$release"; then
1141 $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
1144 case "$output" in
1145 *.lo)
1146 if test -n "$objs"; then
1147 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
1148 exit 1
1150 libobj="$output"
1151 obj=`$echo "X$output" | $Xsed -e 's/\.lo$/.o/'`
1154 libobj=
1155 obj="$output"
1157 esac
1159 # Delete the old objects.
1160 $run $rm $obj $libobj
1162 # Create the old-style object.
1163 reload_objs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1165 output="$obj"
1166 eval cmds=\"$reload_cmds\"
1167 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1168 for cmd in $cmds; do
1169 IFS="$save_ifs"
1170 $show "$cmd"
1171 $run eval "$cmd" || exit $?
1172 done
1173 IFS="$save_ifs"
1175 # Exit if we aren't doing a library object file.
1176 test -z "$libobj" && exit 0
1178 if test "$build_libtool_libs" != yes; then
1179 # Create an invalid libtool object if no PIC, so that we don't
1180 # accidentally link it into a program.
1181 $show "echo timestamp > $libobj"
1182 $run eval "echo timestamp > $libobj" || exit $?
1183 exit 0
1186 if test -n "$pic_flag"; then
1187 # Only do commands if we really have different PIC objects.
1188 reload_objs="$libobjs"
1189 output="$libobj"
1190 eval cmds=\"$reload_cmds\"
1191 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1192 for cmd in $cmds; do
1193 IFS="$save_ifs"
1194 $show "$cmd"
1195 $run eval "$cmd" || exit $?
1196 done
1197 IFS="$save_ifs"
1198 else
1199 # Just create a symlink.
1200 $show "$LN_S $obj $libobj"
1201 $run $LN_S $obj $libobj || exit 1
1204 exit 0
1208 if test -n "$vinfo"; then
1209 $echo "$modename: warning: \`-version-info' is ignored while linking programs" 1>&2
1212 if test -n "$release"; then
1213 $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
1216 if test -n "$rpath"; then
1217 # If the user specified any rpath flags, then add them.
1218 for libdir in $rpath; do
1219 if test -n "$hardcode_libdir_flag_spec"; then
1220 if test -n "$hardcode_libdir_separator"; then
1221 if test -z "$hardcode_libdirs"; then
1222 # Put the magic libdir with the hardcode flag.
1223 hardcode_libdirs="$libdir"
1224 libdir="@HARDCODE_LIBDIRS@"
1225 else
1226 # Just accumulate the unique libdirs.
1227 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
1228 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
1231 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
1233 esac
1234 libdir=
1238 if test -n "$libdir"; then
1239 eval flag=\"$hardcode_libdir_flag_spec\"
1241 compile_command="$compile_command $flag"
1242 finalize_command="$finalize_command $flag"
1244 elif test -n "$runpath_var"; then
1245 case "$perm_rpath " in
1246 *" $libdir "*) ;;
1247 *) perm_rpath="$perm_rpath $libdir" ;;
1248 esac
1250 done
1253 # Substitute the hardcoded libdirs into the compile commands.
1254 if test -n "$hardcode_libdir_separator"; then
1255 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1256 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1259 if test -n "$libobjs" && test "$build_old_libs" = yes; then
1260 # Transform all the library objects into standard objects.
1261 compile_command=`$echo "X$compile_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
1262 finalize_command=`$echo "X$finalize_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
1265 if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
1266 dlsyms="${output}S.c"
1267 else
1268 dlsyms=
1271 if test -n "$dlsyms"; then
1272 # Add our own program objects to the preloaded list.
1273 dlprefiles=`$echo "X$objs$dlprefiles " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
1275 # Discover the nlist of each of the dlfiles.
1276 nlist="$objdir/${output}.nm"
1278 if test -d $objdir; then
1279 $show "$rm $nlist ${nlist}T"
1280 $run $rm "$nlist" "${nlist}T"
1281 else
1282 $show "$mkdir $objdir"
1283 $run $mkdir $objdir
1284 status=$?
1285 if test $status -eq 0 || test -d $objdir; then :
1286 else
1287 exit $status
1291 for arg in $dlprefiles; do
1292 $show "extracting global C symbols from \`$arg'"
1293 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
1294 done
1296 # Parse the name list into a source file.
1297 $show "creating $objdir/$dlsyms"
1298 if test -z "$run"; then
1299 # Make sure we at least have an empty file.
1300 test -f "$nlist" || : > "$nlist"
1302 # Try sorting and uniquifying the output.
1303 if sort "$nlist" | uniq > "$nlist"T; then
1304 mv -f "$nlist"T "$nlist"
1305 wcout=`wc "$nlist" 2>/dev/null`
1306 count=`echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
1307 (test "$count" -ge 0) 2>/dev/null || count=-1
1308 else
1309 $rm "$nlist"T
1310 count=-1
1313 case "$dlsyms" in
1314 "") ;;
1315 *.c)
1316 $echo > "$objdir/$dlsyms" "\
1317 /* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
1318 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
1320 #ifdef __cplusplus
1321 extern \"C\" {
1322 #endif
1324 /* Prevent the only kind of declaration conflicts we can make. */
1325 #define dld_preloaded_symbol_count some_other_symbol
1326 #define dld_preloaded_symbols some_other_symbol
1328 /* External symbol declarations for the compiler. */\
1331 if test -f "$nlist"; then
1332 sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
1333 else
1334 echo '/* NONE */' >> "$objdir/$dlsyms"
1337 $echo >> "$objdir/$dlsyms" "\
1339 #undef dld_preloaded_symbol_count
1340 #undef dld_preloaded_symbols
1342 #if defined (__STDC__) && __STDC__
1343 # define __ptr_t void *
1344 #else
1345 # define __ptr_t char *
1346 #endif
1348 /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
1349 int dld_preloaded_symbol_count = $count;
1351 /* The mapping between symbol names and symbols. */
1352 struct {
1353 char *name;
1354 __ptr_t address;
1356 dld_preloaded_symbols[] =
1360 if test -f "$nlist"; then
1361 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
1364 $echo >> "$objdir/$dlsyms" "\
1365 {0, (__ptr_t) 0}
1368 #ifdef __cplusplus
1370 #endif\
1375 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
1376 exit 1
1378 esac
1381 # Now compile the dynamic symbol file.
1382 $show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")"
1383 $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
1385 # Transform the symbol file into the correct name.
1386 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
1387 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
1388 elif test "$export_dynamic" != yes; then
1389 test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
1390 else
1391 # We keep going just in case the user didn't refer to
1392 # dld_preloaded_symbols. The linker will fail if global_symbol_pipe
1393 # really was required.
1394 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
1396 # Nullify the symbol file.
1397 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
1398 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
1401 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
1402 # Replace the output file specification.
1403 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
1404 finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
1406 # We have no uninstalled library dependencies, so finalize right now.
1407 $show "$compile_command"
1408 $run eval "$compile_command"
1409 exit $?
1412 # Replace the output file specification.
1413 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'%g'`
1414 finalize_command=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'T%g'`
1416 # Create the binary in the object directory, then wrap it.
1417 if test -d $objdir; then :
1418 else
1419 $show "$mkdir $objdir"
1420 $run $mkdir $objdir
1421 status=$?
1422 if test $status -eq 0 || test -d $objdir; then :
1423 else
1424 exit $status
1428 if test -n "$shlibpath_var"; then
1429 # We should set the shlibpath_var
1430 rpath=
1431 for dir in $temp_rpath; do
1432 case "$dir" in
1433 /* | [A-Za-z]:\\*)
1434 # Absolute path.
1435 rpath="$rpath$dir:"
1438 # Relative path: add a thisdir entry.
1439 rpath="$rpath\$thisdir/$dir:"
1441 esac
1442 done
1443 temp_rpath="$rpath"
1446 # Delete the old output file.
1447 $run $rm $output
1449 if test -n "$compile_shlibpath"; then
1450 compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
1452 if test -n "$finalize_shlibpath"; then
1453 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
1456 if test -n "$runpath_var" && test -n "$perm_rpath"; then
1457 # We should set the runpath_var.
1458 rpath=
1459 for dir in $perm_rpath; do
1460 rpath="$rpath$dir:"
1461 done
1462 compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
1463 finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
1466 if test "$hardcode_action" = relink; then
1467 # AGH! Flame the AIX and HP-UX people for me, will ya?
1468 $echo "$modename: warning: using a buggy system linker" 1>&2
1469 $echo "$modename: relinking will be required before \`$output' can be installed" 1>&2
1472 $show "$compile_command"
1473 $run eval "$compile_command" || exit $?
1475 # Now create the wrapper script.
1476 $show "creating $output"
1478 # Quote the finalize command for shipping.
1479 finalize_command=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
1481 # Quote $echo for shipping.
1482 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
1484 # Only actually do things if our run command is non-null.
1485 if test -z "$run"; then
1486 $rm $output
1487 trap "$rm $output; exit 1" 1 2 15
1489 $echo > $output "\
1490 #! $SHELL
1492 # $output - temporary wrapper script for $objdir/$output
1493 # Generated by $PROGRAM - GNU $PACKAGE $VERSION
1495 # The $output program cannot be directly executed until all the libtool
1496 # libraries that it depends on are installed.
1498 # This wrapper script should never be moved out of \``pwd`'.
1499 # If it is, it will not operate correctly.
1501 # Sed substitution that helps us do robust quoting. It backslashifies
1502 # metacharacters that are still active within double-quoted strings.
1503 Xsed='sed -e s/^X//'
1504 sed_quote_subst='$sed_quote_subst'
1506 # The HP-UX ksh and POSIX shell print the target directory to stdout
1507 # if CDPATH is set.
1508 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
1510 # This environment variable determines our operation mode.
1511 if test \"\$libtool_install_magic\" = \"$magic\"; then
1512 # install mode needs the following variables:
1513 link_against_libtool_libs='$link_against_libtool_libs'
1514 finalize_command=\"$finalize_command\"
1515 else
1516 # When we are sourced in execute mode, \$file and \$echo are already set.
1517 if test \"\$libtool_execute_magic\" = \"$magic\"; then :
1518 else
1519 echo=\"$qecho\"
1520 file=\"\$0\"
1523 $echo >> $output "\
1525 # Find the directory that this script lives in.
1526 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
1527 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
1529 # Follow symbolic links until we get to the real thisdir.
1530 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
1531 while test -n \"\$file\"; do
1532 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
1534 # If there was a directory component, then change thisdir.
1535 if test \"x\$destdir\" != \"x\$file\"; then
1536 case \"\$destdir\" in
1537 /* | [A-Za-z]:\\*) thisdir=\"\$destdir\" ;;
1538 *) thisdir=\"\$thisdir/\$destdir\" ;;
1539 esac
1542 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
1543 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
1544 done
1546 # Try to get the absolute directory name.
1547 absdir=\`cd \"\$thisdir\" && pwd\`
1548 test -n \"\$absdir\" && thisdir=\"\$absdir\"
1550 progdir=\"\$thisdir/$objdir\"
1551 program='$output'
1553 if test -f \"\$progdir/\$program\"; then"
1555 # Export our shlibpath_var if we have one.
1556 if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
1557 $echo >> $output "\
1558 # Add our own library path to $shlibpath_var
1559 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
1561 # Some systems cannot cope with colon-terminated $shlibpath_var
1562 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\`
1564 export $shlibpath_var
1568 $echo >> $output "\
1569 if test \"\$libtool_execute_magic\" != \"$magic\"; then
1570 # Run the actual program with our arguments.
1572 # Export the path to the program.
1573 PATH=\"\$progdir:\$PATH\"
1574 export PATH
1576 exec \$program \${1+\"\$@\"}
1578 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
1579 exit 1
1581 else
1582 # The program doesn't exist.
1583 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
1584 \$echo \"This script is just a wrapper for \$program.\" 1>&2
1585 echo \"See the $PACKAGE documentation for more information.\" 1>&2
1586 exit 1
1590 chmod +x $output
1592 exit 0
1594 esac
1596 # See if we need to build an old-fashioned archive.
1597 if test "$build_old_libs" = "yes"; then
1598 # Transform .lo files to .o files.
1599 oldobjs="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1601 # Do each command in the archive commands.
1602 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
1603 eval cmds=\"$old_archive_from_new_cmds\"
1604 else
1605 eval cmds=\"$old_archive_cmds\"
1607 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1608 for cmd in $cmds; do
1609 IFS="$save_ifs"
1610 $show "$cmd"
1611 $run eval "$cmd" || exit $?
1612 done
1613 IFS="$save_ifs"
1616 # Now create the libtool archive.
1617 case "$output" in
1618 *.la)
1619 old_library=
1620 test "$build_old_libs" = yes && old_library="$libname.a"
1622 $show "creating $output"
1624 # Only create the output if not a dry run.
1625 if test -z "$run"; then
1626 $echo > $output "\
1627 # $output - a libtool library file
1628 # Generated by $PROGRAM - GNU $PACKAGE $VERSION
1630 # The name that we can dlopen(3).
1631 dlname='$dlname'
1633 # Names of this library.
1634 library_names='$library_names'
1636 # The name of the static archive.
1637 old_library='$old_library'
1639 # Libraries that this one depends upon.
1640 dependency_libs='$dependency_libs'
1642 # Version information for $libname.
1643 current=$current
1644 age=$age
1645 revision=$revision
1647 # Directory that this library needs to be installed in:
1648 libdir='$install_libdir'\
1652 # Do a symbolic link so that the libtool archive can be found in
1653 # LD_LIBRARY_PATH before the program is installed.
1654 $show "(cd $objdir && $LN_S ../$output $output)"
1655 $run eval "(cd $objdir && $LN_S ../$output $output)" || exit 1
1657 esac
1658 exit 0
1661 # libtool install mode
1662 install)
1663 modename="$modename: install"
1665 # There may be an optional sh(1) argument at the beginning of
1666 # install_prog (especially on Windows NT).
1667 if test "$nonopt" = "$SHELL"; then
1668 # Aesthetically quote it.
1669 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
1670 case "$arg" in
1671 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1672 arg="\"$arg\""
1674 esac
1675 install_prog="$arg "
1676 arg="$1"
1677 shift
1678 else
1679 install_prog=
1680 arg="$nonopt"
1683 # The real first argument should be the name of the installation program.
1684 # Aesthetically quote it.
1685 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1686 case "$arg" in
1687 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1688 arg="\"$arg\""
1690 esac
1691 install_prog="$install_prog$arg"
1693 # We need to accept at least all the BSD install flags.
1694 dest=
1695 files=
1696 opts=
1697 prev=
1698 install_type=
1699 isdir=no
1700 stripme=
1701 for arg
1703 if test -n "$dest"; then
1704 files="$files $dest"
1705 dest="$arg"
1706 continue
1709 case "$arg" in
1710 -d) isdir=yes ;;
1711 -f) prev="-f" ;;
1712 -g) prev="-g" ;;
1713 -m) prev="-m" ;;
1714 -o) prev="-o" ;;
1716 stripme=" -s"
1717 continue
1719 -*) ;;
1722 # If the previous option needed an argument, then skip it.
1723 if test -n "$prev"; then
1724 prev=
1725 else
1726 dest="$arg"
1727 continue
1730 esac
1732 # Aesthetically quote the argument.
1733 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1734 case "$arg" in
1735 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1736 arg="\"$arg\""
1738 esac
1739 install_prog="$install_prog $arg"
1740 done
1742 if test -z "$install_prog"; then
1743 $echo "$modename: you must specify an install program" 1>&2
1744 $echo "$help" 1>&2
1745 exit 1
1748 if test -n "$prev"; then
1749 $echo "$modename: the \`$prev' option requires an argument" 1>&2
1750 $echo "$help" 1>&2
1751 exit 1
1754 if test -z "$files"; then
1755 if test -z "$dest"; then
1756 $echo "$modename: no file or destination specified" 1>&2
1757 else
1758 $echo "$modename: you must specify a destination" 1>&2
1760 $echo "$help" 1>&2
1761 exit 1
1764 # Strip any trailing slash from the destination.
1765 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
1767 # Check to see that the destination is a directory.
1768 test -d "$dest" && isdir=yes
1769 if test "$isdir" = yes; then
1770 destdir="$dest"
1771 destname=
1772 else
1773 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
1774 test "X$destdir" = "X$dest" && destdir=.
1775 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
1777 # Not a directory, so check to see that there is only one file specified.
1778 set dummy $files
1779 if test $# -gt 2; then
1780 $echo "$modename: \`$dest' is not a directory" 1>&2
1781 $echo "$help" 1>&2
1782 exit 1
1785 case "$destdir" in
1786 /* | [A-Za-z]:\\*) ;;
1788 for file in $files; do
1789 case "$file" in
1790 *.lo) ;;
1792 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
1793 $echo "$help" 1>&2
1794 exit 1
1796 esac
1797 done
1799 esac
1801 # This variable tells wrapper scripts just to set variables rather
1802 # than running their programs.
1803 libtool_install_magic="$magic"
1805 staticlibs=
1806 future_libdirs=
1807 current_libdirs=
1808 for file in $files; do
1810 # Do each installation.
1811 case "$file" in
1812 *.a)
1813 # Do the static libraries later.
1814 staticlibs="$staticlibs $file"
1817 *.la)
1818 # Check to see that this really is a libtool archive.
1819 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1820 else
1821 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
1822 $echo "$help" 1>&2
1823 exit 1
1826 library_names=
1827 old_library=
1828 # If there is no directory component, then add one.
1829 case "$file" in
1830 */* | *\\*) . $file ;;
1831 *) . ./$file ;;
1832 esac
1834 # Add the libdir to current_libdirs if it is the destination.
1835 if test "X$destdir" = "X$libdir"; then
1836 case "$current_libdirs " in
1837 *" $libdir "*) ;;
1838 *) current_libdirs="$current_libdirs $libdir" ;;
1839 esac
1840 else
1841 # Note the libdir as a future libdir.
1842 case "$future_libdirs " in
1843 *" $libdir "*) ;;
1844 *) future_libdirs="$future_libdirs $libdir" ;;
1845 esac
1848 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
1849 test "X$dir" = "X$file/" && dir=
1850 dir="$dir$objdir"
1852 # See the names of the shared library.
1853 set dummy $library_names
1854 if test -n "$2"; then
1855 realname="$2"
1856 shift
1857 shift
1859 # Install the shared library and build the symlinks.
1860 $show "$install_prog $dir/$realname $destdir/$realname"
1861 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
1862 test "X$dlname" = "X$realname" && dlname=
1864 if test $# -gt 0; then
1865 # Delete the old symlinks.
1866 rmcmd="$rm"
1867 for linkname
1869 rmcmd="$rmcmd $destdir/$linkname"
1870 done
1871 $show "$rmcmd"
1872 $run $rmcmd
1874 # ... and create new ones.
1875 for linkname
1877 test "X$dlname" = "X$linkname" && dlname=
1878 $show "(cd $destdir && $LN_S $realname $linkname)"
1879 $run eval "(cd $destdir && $LN_S $realname $linkname)"
1880 done
1883 if test -n "$dlname"; then
1884 # Install the dynamically-loadable library.
1885 $show "$install_prog $dir/$dlname $destdir/$dlname"
1886 $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
1889 # Do each command in the postinstall commands.
1890 lib="$destdir/$realname"
1891 eval cmds=\"$postinstall_cmds\"
1892 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
1893 for cmd in $cmds; do
1894 IFS="$save_ifs"
1895 $show "$cmd"
1896 $run eval "$cmd" || exit $?
1897 done
1898 IFS="$save_ifs"
1901 # Install the pseudo-library for information purposes.
1902 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
1903 $show "$install_prog $file $destdir/$name"
1904 $run eval "$install_prog $file $destdir/$name" || exit $?
1906 # Maybe install the static library, too.
1907 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
1910 *.lo)
1911 # Install (i.e. copy) a libtool object.
1913 # Figure out destination file name, if it wasn't already specified.
1914 if test -n "$destname"; then
1915 destfile="$destdir/$destname"
1916 else
1917 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
1918 destfile="$destdir/$destfile"
1921 # Deduce the name of the destination old-style object file.
1922 case "$destfile" in
1923 *.lo)
1924 staticdest=`$echo "X$destfile" | $Xsed -e 's/\.lo$/.o/'`
1926 *.o)
1927 staticdest="$destfile"
1928 destfile=
1931 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
1932 $echo "$help" 1>&2
1933 exit 1
1935 esac
1937 # Install the libtool object if requested.
1938 if test -n "$destfile"; then
1939 $show "$install_prog $file $destfile"
1940 $run eval "$install_prog $file $destfile" || exit $?
1943 # Install the old object if enabled.
1944 if test "$build_old_libs" = yes; then
1945 # Deduce the name of the old-style object file.
1946 staticobj=`$echo "X$file" | $Xsed -e 's/\.lo$/.o/'`
1948 $show "$install_prog $staticobj $staticdest"
1949 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
1951 exit 0
1955 # Figure out destination file name, if it wasn't already specified.
1956 if test -n "$destname"; then
1957 destfile="$destdir/$destname"
1958 else
1959 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
1960 destfile="$destdir/$destfile"
1963 # Do a test to see if this is really a libtool program.
1964 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1965 link_against_libtool_libs=
1966 finalize_command=
1968 # If there is no directory component, then add one.
1969 case "$file" in
1970 */* | *\\*) . $file ;;
1971 *) . ./$file ;;
1972 esac
1974 # Check the variables that should have been set.
1975 if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
1976 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
1977 exit 1
1980 finalize=yes
1981 for lib in $link_against_libtool_libs; do
1982 # Check to see that each library is installed.
1983 libdir=
1984 if test -f "$lib"; then
1985 # If there is no directory component, then add one.
1986 case "$lib" in
1987 */* | *\\*) . $lib ;;
1988 *) . ./$lib ;;
1989 esac
1991 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
1992 if test -z "$libdir"; then
1993 $echo "$modename: warning: \`$lib' contains no -rpath information" 1>&2
1994 elif test -f "$libfile"; then :
1995 else
1996 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
1997 finalize=no
1999 done
2001 if test "$hardcode_action" = relink; then
2002 if test "$finalize" = yes; then
2003 $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
2004 $show "$finalize_command"
2005 if $run eval "$finalize_command"; then :
2006 else
2007 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
2008 continue
2010 file="$objdir/$file"T
2011 else
2012 $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
2014 else
2015 # Install the binary that we compiled earlier.
2016 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2020 $show "$install_prog$stripme $file $destfile"
2021 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
2023 esac
2024 done
2026 for file in $staticlibs; do
2027 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2029 # Set up the ranlib parameters.
2030 oldlib="$destdir/$name"
2032 $show "$install_prog $file $oldlib"
2033 $run eval "$install_prog \$file \$oldlib" || exit $?
2035 # Do each command in the postinstall commands.
2036 eval cmds=\"$old_postinstall_cmds\"
2037 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2038 for cmd in $cmds; do
2039 IFS="$save_ifs"
2040 $show "$cmd"
2041 $run eval "$cmd" || exit $?
2042 done
2043 IFS="$save_ifs"
2044 done
2046 if test -n "$future_libdirs"; then
2047 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
2050 if test -n "$current_libdirs"; then
2051 # Maybe just do a dry run.
2052 test -n "$run" && current_libdirs=" -n$current_libdirs"
2053 exec $SHELL $0 --finish$current_libdirs
2054 exit 1
2057 exit 0
2060 # libtool finish mode
2061 finish)
2062 modename="$modename: finish"
2063 libdirs="$nonopt"
2064 admincmds=
2066 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2067 for dir
2069 libdirs="$libdirs $dir"
2070 done
2072 for libdir in $libdirs; do
2073 if test -n "$finish_cmds"; then
2074 # Do each command in the finish commands.
2075 eval cmds=\"$finish_cmds\"
2076 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2077 for cmd in $cmds; do
2078 IFS="$save_ifs"
2079 $show "$cmd"
2080 $run eval "$cmd" || admincmds="$admincmds
2081 $cmd"
2082 done
2083 IFS="$save_ifs"
2085 if test -n "$finish_eval"; then
2086 # Do the single finish_eval.
2087 eval cmds=\"$finish_eval\"
2088 $run eval "$cmds" || admincmds="$admincmds
2089 $cmds"
2091 done
2094 echo "----------------------------------------------------------------------"
2095 echo "Libraries have been installed in:"
2096 for libdir in $libdirs; do
2097 echo " $libdir"
2098 done
2099 echo
2100 echo "To link against installed libraries in a given directory, LIBDIR,"
2101 echo "you must use the \`-LLIBDIR' flag during linking."
2102 echo
2103 echo " You will also need to do at least one of the following:"
2104 if test -n "$shlibpath_var"; then
2105 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2106 echo " during execution"
2108 if test -n "$runpath_var"; then
2109 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2110 echo " during linking"
2112 if test -n "$hardcode_libdir_flag_spec"; then
2113 libdir=LIBDIR
2114 eval flag=\"$hardcode_libdir_flag_spec\"
2116 echo " - use the \`$flag' linker flag"
2118 if test -n "$admincmds"; then
2119 echo " - have your system administrator run these commands:$admincmds"
2121 if test -f /etc/ld.so.conf; then
2122 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2124 echo
2125 echo "See any operating system documentation about shared libraries for"
2126 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2127 echo "----------------------------------------------------------------------"
2128 exit 0
2131 # libtool execute mode
2132 execute)
2133 modename="$modename: execute"
2135 # The first argument is the command name.
2136 cmd="$nonopt"
2137 if test -z "$cmd"; then
2138 $echo "$modename: you must specify a COMMAND" 1>&2
2139 $echo "$help"
2140 exit 1
2143 # Handle -dlopen flags immediately.
2144 for file in $execute_dlfiles; do
2145 if test -f "$file"; then :
2146 else
2147 $echo "$modename: \`$file' is not a file" 1>&2
2148 $echo "$help" 1>&2
2149 exit 1
2152 dir=
2153 case "$file" in
2154 *.la)
2155 # Check to see that this really is a libtool archive.
2156 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2157 else
2158 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2159 $echo "$help" 1>&2
2160 exit 1
2163 # Read the libtool library.
2164 dlname=
2165 library_names=
2167 # If there is no directory component, then add one.
2168 case "$file" in
2169 */* | *\\*) . $file ;;
2170 *) . ./$file ;;
2171 esac
2173 # Skip this library if it cannot be dlopened.
2174 if test -z "$dlname"; then
2175 # Warn if it was a shared library.
2176 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
2177 continue
2180 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
2181 test "X$dir" = "X$file" && dir=.
2183 if test -f "$dir/$objdir/$dlname"; then
2184 dir="$dir/$objdir"
2185 else
2186 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
2187 exit 1
2191 *.lo)
2192 # Just add the directory containing the .lo file.
2193 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
2194 test "X$dir" = "X$file" && dir=.
2198 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
2199 continue
2201 esac
2203 # Get the absolute pathname.
2204 absdir=`cd "$dir" && pwd`
2205 test -n "$absdir" && dir="$absdir"
2207 # Now add the directory to shlibpath_var.
2208 if eval "test -z \"\$$shlibpath_var\""; then
2209 eval "$shlibpath_var=\"\$dir\""
2210 else
2211 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2213 done
2215 # This variable tells wrapper scripts just to set shlibpath_var
2216 # rather than running their programs.
2217 libtool_execute_magic="$magic"
2219 # Check if any of the arguments is a wrapper script.
2220 args=
2221 for file
2223 case "$file" in
2224 -*) ;;
2226 # Do a test to see if this is really a libtool program.
2227 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2228 # If there is no directory component, then add one.
2229 case "$file" in
2230 */* | *\\*) . $file ;;
2231 *) . ./$file ;;
2232 esac
2234 # Transform arg to wrapped name.
2235 file="$progdir/$program"
2238 esac
2239 # Quote arguments (to preserve shell metacharacters).
2240 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
2241 args="$args \"$file\""
2242 done
2244 if test -z "$run"; then
2245 # Export the shlibpath_var.
2246 eval "export $shlibpath_var"
2248 # Now actually exec the command.
2249 eval "exec \$cmd$args"
2251 $echo "$modename: cannot exec \$cmd$args"
2252 exit 1
2253 else
2254 # Display what would be done.
2255 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
2256 $echo "export $shlibpath_var"
2257 $echo "$cmd$args"
2258 exit 0
2262 # libtool uninstall mode
2263 uninstall)
2264 modename="$modename: uninstall"
2265 rm="$nonopt"
2266 files=
2268 for arg
2270 case "$arg" in
2271 -*) rm="$rm $arg" ;;
2272 *) files="$files $arg" ;;
2273 esac
2274 done
2276 if test -z "$rm"; then
2277 $echo "$modename: you must specify an RM program" 1>&2
2278 $echo "$help" 1>&2
2279 exit 1
2282 for file in $files; do
2283 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
2284 test "X$dir" = "X$file" && dir=.
2285 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2287 rmfiles="$file"
2289 case "$name" in
2290 *.la)
2291 # Possibly a libtool archive, so verify it.
2292 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2293 . $dir/$name
2295 # Delete the libtool libraries and symlinks.
2296 for n in $library_names; do
2297 rmfiles="$rmfiles $dir/$n"
2298 test "X$n" = "X$dlname" && dlname=
2299 done
2300 test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
2301 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
2303 $show "$rm $rmfiles"
2304 $run $rm $rmfiles
2306 if test -n "$library_names"; then
2307 # Do each command in the postuninstall commands.
2308 eval cmds=\"$postuninstall_cmds\"
2309 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2310 for cmd in $cmds; do
2311 IFS="$save_ifs"
2312 $show "$cmd"
2313 $run eval "$cmd"
2314 done
2315 IFS="$save_ifs"
2318 if test -n "$old_library"; then
2319 # Do each command in the old_postuninstall commands.
2320 eval cmds=\"$old_postuninstall_cmds\"
2321 IFS="${IFS= }"; save_ifs="$IFS"; IFS=';'
2322 for cmd in $cmds; do
2323 IFS="$save_ifs"
2324 $show "$cmd"
2325 $run eval "$cmd"
2326 done
2327 IFS="$save_ifs"
2330 # FIXME: should reinstall the best remaining shared library.
2334 *.lo)
2335 if test "$build_old_libs" = yes; then
2336 oldobj=`$echo "X$name" | $Xsed -e 's/\.lo$/.o/'`
2337 rmfiles="$rmfiles $dir/$oldobj"
2339 $show "$rm $rmfiles"
2340 $run $rm $rmfiles
2344 $show "$rm $rmfiles"
2345 $run $rm $rmfiles
2347 esac
2348 done
2349 exit 0
2353 $echo "$modename: you must specify a MODE" 1>&2
2354 $echo "$generic_help" 1>&2
2355 exit 1
2357 esac
2359 $echo "$modename: invalid operation mode \`$mode'" 1>&2
2360 $echo "$generic_help" 1>&2
2361 exit 1
2362 fi # test -z "$show_help"
2364 # We need to display help for each of the modes.
2365 case "$mode" in
2366 "") $echo \
2367 "Usage: $modename [OPTION]... [MODE-ARG]...
2369 Provide generalized library-building support services.
2371 --config show all configuration variables
2372 --debug enable verbose shell tracing
2373 -n, --dry-run display commands without modifying any files
2374 --features display basic configuration information and exit
2375 --finish same as \`--mode=finish'
2376 --help display this help message and exit
2377 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
2378 --quiet same as \`--silent'
2379 --silent don't print informational messages
2380 --version print version information
2382 MODE must be one of the following:
2384 compile compile a source file into a libtool object
2385 execute automatically set library path, then run a program
2386 finish complete the installation of libtool libraries
2387 install install libraries or executables
2388 link create a library or an executable
2389 uninstall remove libraries from an installed directory
2391 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
2392 a more detailed description of MODE."
2393 exit 0
2396 compile)
2397 $echo \
2398 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2400 Compile a source file into a libtool library object.
2402 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2403 from the given SOURCEFILE.
2405 The output file name is determined by removing the directory component from
2406 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2407 library object suffix, \`.lo'."
2410 execute)
2411 $echo \
2412 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
2414 Automatically set library path, then run a program.
2416 This mode accepts the following additional options:
2418 -dlopen FILE add the directory containing FILE to the library path
2420 This mode sets the library path environment variable according to \`-dlopen'
2421 flags.
2423 If any of the ARGS are libtool executable wrappers, then they are translated
2424 into their corresponding uninstalled binary, and any of their required library
2425 directories are added to the library path.
2427 Then, COMMAND is executed, with ARGS as arguments."
2430 finish)
2431 $echo \
2432 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
2434 Complete the installation of libtool libraries.
2436 Each LIBDIR is a directory that contains libtool libraries.
2438 The commands that this mode executes may require superuser privileges. Use
2439 the \`--dry-run' option if you just want to see what would be executed."
2442 install)
2443 $echo \
2444 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
2446 Install executables or libraries.
2448 INSTALL-COMMAND is the installation command. The first component should be
2449 either the \`install' or \`cp' program.
2451 The rest of the components are interpreted as arguments to that command (only
2452 BSD-compatible install options are recognized)."
2455 link)
2456 $echo \
2457 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
2459 Link object files or libraries together to form another library, or to
2460 create an executable program.
2462 LINK-COMMAND is a command using the C compiler that you would use to create
2463 a program from several object files.
2465 The following components of LINK-COMMAND are treated specially:
2467 -all-static do not do any dynamic linking at all
2468 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2469 -dlpreopen FILE link in FILE and add its symbols to dld_preloaded_symbols
2470 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2471 -LLIBDIR search LIBDIR for required installed libraries
2472 -lNAME OUTPUT-FILE requires the installed library libNAME
2473 -no-undefined declare that a library does not refer to external symbols
2474 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2475 -release RELEASE specify package release information
2476 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2477 -static do not do any dynamic linking of libtool libraries
2478 -version-info CURRENT[:REVISION[:AGE]]
2479 specify library version info [each variable defaults to 0]
2481 All other options (arguments beginning with \`-') are ignored.
2483 Every other argument is treated as a filename. Files ending in \`.la' are
2484 treated as uninstalled libtool libraries, other files are standard or library
2485 object files.
2487 If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
2488 library objects (\`.lo' files) may be specified, and \`-rpath' is required.
2490 If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
2491 and \`ranlib'.
2493 If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
2494 created, otherwise an executable program is created."
2497 uninstall)
2498 $echo
2499 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2501 Remove libraries from an installation directory.
2503 RM is the name of the program to use to delete files associated with each FILE
2504 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2505 to RM.
2507 If FILE is a libtool library, all the files associated with it are deleted.
2508 Otherwise, only FILE itself is deleted using RM."
2512 $echo "$modename: invalid operation mode \`$mode'" 1>&2
2513 $echo "$help" 1>&2
2514 exit 1
2516 esac
2518 echo
2519 $echo "Try \`$modename --help' for more information about other modes."
2521 exit 0
2523 # Local Variables:
2524 # mode:shell-script
2525 # sh-indentation:2
2526 # End: