1 # ltmain.sh - Provide generalized library-building support services.
2 # Generated automatically from ltmain.sh.in by configure.
3 # Copyright (C) 1996, 1997 Free Software Foundation, Inc.
4 # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 # As a special exception to the GNU General Public License, if you
21 # distribute this file as part of a program that contains a
22 # configuration script generated by Autoconf, you may include it under
23 # the same distribution terms that you use for the rest of that program.
26 if test X
`$echo '\t'` = 'X\t'; then :
28 # The Solaris and AIX default echo program unquotes backslashes.
29 # This makes it impossible to quote backslashes using
30 # echo "$something" | sed 's/\\/\\\\/g'
31 # So, we emulate echo with printf '%s\n'
33 if test X
`$echo '\t'` = 'X\t'; then :
35 # Oops. We have no working printf. Try to find a not-so-buggy echo.
37 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
41 if test -f $dir/echo && test X
`$dir/echo '\t'` = 'X\t'; then
51 # The name of this program.
52 progname
=`$echo "$0" | sed 's%^.*/%%'`
60 help="Try \`$progname --help' for more information."
61 magic
="%%%MAGIC variable%%%"
67 # Sed substitution that helps us do robust quoting. It backslashifies
68 # metacharacters that are still active within double-quoted strings.
69 sed_quote_subst
='s/\([\\"$]\)/\\\1/g'
72 # Only set LANG and LC_ALL to C if already set.
73 # These must not be set unconditionally because not all systems understand
74 # e.g. LANG=C (notably SCO).
75 if test "${LC_ALL+set}" = set; then LC_ALL
=C
; export LC_ALL
; fi
76 if test "${LANG+set}" = set; then LANG
=C
; export LANG
; fi
78 if test "$LTCONFIG_VERSION" != "$VERSION"; then
79 $echo "$progname: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
80 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
85 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
86 $echo "$progname: not configured to build any kind of library" 1>&2
87 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
101 # Parse our command line options once, thoroughly.
108 -*=*) optarg
=`$echo "$arg" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
112 # If the previous option needs an argument, assign it.
113 if test -n "$prev"; then
116 eval "$prev=\"\$$prev \$arg\""
128 # Have we seen a non-optional argument yet?
135 $echo "$PROGRAM (GNU $PACKAGE) $VERSION"
145 if test "$build_libtool_libs" = yes; then
146 $echo "enable shared libraries"
148 $echo "disable shared libraries"
150 if test "$build_old_libs" = yes; then
151 $echo "enable static libraries"
153 $echo "disable static libraries"
158 --finish) mode
="finish" ;;
160 --mode) prevopt
="--mode" prev
=mode
;;
161 --mode=*) mode
="$optarg" ;;
173 $echo "$progname: unrecognized option \`$arg'" 1>&2
185 if test -n "$prevopt"; then
186 $echo "$progname: option \`$prevopt' requires an argument" 1>&2
191 if test -z "$show_help"; then
193 # Infer the operation mode.
194 if test -z "$mode"; then
218 # If we have no mode, but dlfiles were specified, then do execute mode.
219 test -n "$execute_dlfiles" && mode
=execute
221 # Just use the default operation mode.
222 if test -z "$mode"; then
223 if test -n "$nonopt"; then
224 $echo "$progname: warning: cannot infer operation mode from \`$nonopt'" 1>&2
226 $echo "$progname: warning: cannot infer operation mode without MODE-ARGS" 1>&2
233 # Only execute mode is allowed to have -dlopen flags.
234 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
235 $echo "$progname: unrecognized option \`-dlopen'" 1>&2
240 # Change the help message to a mode-specific one.
242 help="Try \`$progname --help --mode=$mode' for more information."
244 # These modes are in order of execution frequency so that they run quickly.
246 # libtool compile mode
248 progname
="$progname: compile"
249 # Get the compilation command and the source file.
257 # The only flag that cannot be specified is the output filename.
258 if test "X$arg" = "X-o"; then
259 $echo "$progname: you cannot specify the output filename with \`-o'" 1>&2
264 # Accept the current argument as the source file.
268 # Aesthetically quote the previous argument.
270 # Backslashify any backslashes, double quotes, and dollar signs.
271 # These are the only characters that are still specially
272 # interpreted inside of double-quoted scrings.
273 lastarg
=`$echo "$lastarg" | sed "$sed_quote_subst"`
275 # Double-quote args containing other shell metacharacters.
276 # Many Bourne shells cannot handle close brackets correctly in scan
277 # sets, so we specify it separately.
279 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
280 lastarg
="\"$lastarg\""
284 # Add the previous argument to base_compile.
285 if test -z "$base_compile"; then
286 base_compile
="$lastarg"
288 base_compile
="$base_compile $lastarg"
292 # Get the name of the library object.
293 libobj
=`$echo "$srcfile" | sed -e 's%^.*/%%'`
295 # Recognize several different file suffixes.
306 libobj
=`$echo "$libobj" | sed -e "s/\.$xform$/.lo/"`
309 *.lo
) obj
=`$echo "$libobj" | sed -e 's/\.lo$/.o/'` ;;
311 $echo "$progname: cannot determine name of library object from \`$srcfile'" 1>&2
316 if test -z "$base_compile"; then
317 $echo "$progname: you must specify a compilation command" 1>&2
322 # Delete any leftover library objects.
323 if test "$build_old_libs" = yes; then
324 $run $rm $obj $libobj
325 trap "$run $rm $obj $libobj; exit 1" 1 2 15
328 trap "$run $rm $libobj; exit 1" 1 2 15
331 # Only build a PIC object if we are building libtool libraries.
332 if test "$build_libtool_libs" = yes; then
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 :
337 test -n "$obj" && $run $rm $obj
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
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 :
362 $run $rm $obj $libobj
367 # Create an invalid libtool object if no PIC, so that we don't accidentally
368 # 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 $?
379 progname
="$progname: link"
382 compile_command
="$CC"
383 finalize_command
="$CC"
394 link_against_libtool_libs
=
404 # We need to know -static, to get the right output filenames.
409 if test "$build_libtool_libs" = yes; then
410 if test "$hardcode_direct" = unsupported
&& test -z "$link_static_flag"; then
411 $echo "$progname: warning: static linking is impossible in this configuration" 1>&2
413 build_libtool_libs
=no
422 # Go through the arguments, transforming them on the way.
425 # If the previous option needs an argument, assign it.
426 if test -n "$prev"; then
429 compile_command
="$compile_command @OUTPUT@"
430 finalize_command
="$finalize_command @OUTPUT@"
437 *.la |
*.lo
) ;; # We handle these cases below.
439 dlprefiles
="$dlprefiles $arg"
440 test "$prev" = dlfiles
&& dlfiles
="$dlfiles $arg"
446 eval "$prev=\"\$arg\""
472 if test "$export_dynamic" != yes; then
474 arg
=`eval $echo "$export_dynamic_flag_spec"`
476 # Add the symbol object into the linking commands.
477 compile_command
="$compile_command @SYMFILE@"
478 finalize_command
="$finalize_command @SYMFILE@"
483 dir
=`$echo "$arg" | sed 's%^-L\(.*\)$%\1%'`
488 $echo "$progname: \`-L$dir' cannot specify a relative directory" 1>&2
492 deplibs
="$deplibs $arg"
495 -l*) deplibs
="$deplibs $arg" ;;
505 link_static
="$link_static_flag"
506 compile_command
="$compile_command $link_static"
507 finalize_command
="$finalize_command $link_static"
516 # Some other compiler flag.
518 # Unknown arguments in both finalize_command and compile_command need
519 # to be aesthetically quoted because they are evaled later.
520 arg
=`$echo "$arg" | sed "$sed_quote_subst"`
522 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
535 if test "$prev" = dlfiles
; then
536 dlfiles
="$dlfiles $arg"
537 if test "$build_libtool_libs" = yes; then
541 # If libtool objects are unsupported, then we need to preload.
546 if test "$prev" = dlprefiles
; then
547 # Preload the old-style object.
548 dlprefiles
="$dlprefiles "`$echo "$arg" | sed 's/\.lo$/\.o/'`
551 libobjs
="$libobjs $arg"
555 # A libtool-controlled library.
562 # Check to see that this really is a libtool archive.
563 if egrep "^# Generated by ltmain.sh" $arg >/dev
/null
2>&1; then :
565 $echo "$progname: \`$arg' is not a valid libtool archive" 1>&2
569 # If there is no directory component, then add one.
575 if test -z "$libdir"; then
576 $echo "$progname: \`$arg' contains no -rpath information" 1>&2
580 # Get the name of the library we link against.
582 for l
in $old_library $library_names; do
586 if test -z "$linklib"; then
587 $echo "$progname: cannot find name of link library for \`$arg'" 1>&2
591 # Find the relevant object directory and library name.
592 name
=`$echo "$arg" | sed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
593 dir
=`$echo "$arg" | sed 's%/[^/]*$%%'`
594 if test "X$dir" = "X$arg"; then
600 # This library was specified with -dlopen.
601 if test "$prev" = dlfiles
; then
602 dlfiles
="$dlfiles $arg"
603 if test -z "$dlname"; then
604 # If there is no dlname, we need to preload.
607 # We should not create a dependency on this library.
613 # The library was specified with -dlpreopen.
614 if test "$prev" = dlprefiles
; then
615 # Prefer using a static library (so that no silly _DYNAMIC symbols
616 # are required to link).
617 if test -n "$old_library"; then
618 dlprefiles
="$dlprefiles $dir/$old_library"
620 dlprefiles
="$dlprefiles $dir/$linklib"
625 if test "$build_libtool_libs" = yes && test -n "$library_names"; then
626 link_against_libtool_libs
="$link_against_libtool_libs $arg"
627 if test -n "$shlibpath_var"; then
628 # Make sure the rpath contains only unique directories.
629 case "$temp_rpath " in
631 *) temp_rpath
="$temp_rpath $dir" ;;
636 if test -n "$hardcode_libdir_flag_spec"; then
637 if test -n "$hardcode_libdir_separator"; then
638 if test -z "$hardcode_libdirs"; then
639 # Put the magic libdir with the hardcode flag.
640 hardcode_libdirs
="$libdir"
641 libdir
="@HARDCODE_LIBDIRS@"
643 # Just accumulate the libdirs.
644 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
649 if test -n "$libdir"; then
650 flag
=`eval $echo \"$hardcode_libdir_flag_spec\"`
652 compile_command
="$compile_command $flag"
653 finalize_command
="$finalize_command $flag"
655 elif test "$hardcode_runpath_var" = yes; then
656 # Do the same for the permanent run path.
657 case "$perm_rpath " in
659 *) perm_rpath
="$perm_rpath $libdir" ;;
664 case "$hardcode_action" in
666 if test "$hardcode_direct" = no
; then
667 compile_command
="$compile_command $dir/$linklib"
668 elif test "$hardcode_minus_L" = no
; then
669 compile_command
="$compile_command -L$dir -l$name"
670 elif test "$hardcode_shlibpath_var" = no
; then
671 compile_shlibpath
="$compile_shlibpath$dir:"
672 compile_command
="$compile_command -l$name"
677 # We need an absolute path.
681 absdir
=`cd "$dir" && pwd`
682 if test -z "$absdir"; then
683 $echo "$progname: cannot determine absolute directory name of \`$dir'" 1>&2
690 if test "$hardcode_direct" = yes; then
691 compile_command
="$compile_command $dir/$linklib"
692 elif test "$hardcode_minus_L" = yes; then
693 compile_command
="$compile_command -L$dir -l$name"
694 elif test "$hardcode_shlibpath_var" = yes; then
695 compile_shlibpath
="$compile_shlibpath$dir:"
696 compile_command
="$compile_command -l$name"
701 $echo "$progname: \`$hardcode_action' is an unknown hardcode action" 1>&2
706 # Finalize command for both is simple: just hardcode it.
707 if test "$hardcode_direct" = yes; then
708 finalize_command
="$finalize_command $libdir/$linklib"
709 elif test "$hardcode_minus_L" = yes; then
710 finalize_command
="$finalize_command -L$libdir -l$name"
711 elif test "$hardcode_shlibpath_var" = yes; then
712 finalize_shlibpath
="$finalize_shlibpath$libdir:"
713 finalize_command
="$finalize_command -l$name"
715 # We can't seem to hardcode it, guess we'll fake it.
716 finalize_command
="$finalize_command -L$libdir -l$name"
719 # Transform directly to old archives if we don't build new libraries.
720 if test -n "$pic_flag" && test -z "$old_library"; then
721 $echo "$progname: cannot find static library for \`$arg'" 1>&2
725 if test "$hardcode_direct" != unsupported
; then
726 test -n "$old_library" && linklib
="$old_library"
727 compile_command
="$compile_command $dir/$linklib"
728 finalize_command
="$finalize_command $dir/$linklib"
730 # Here we assume that "$hardcode_minusL" != unsupported.
731 # This is valid on all known static and shared platforms.
732 compile_command
="$compile_command -L$dir -l$name"
733 finalize_command
="$finalize_command -L$dir -l$name"
740 $echo "$progname: unknown file suffix for \`$arg'" 1>&2
746 # Now actually substitute the argument into the commands.
747 compile_command
="$compile_command $arg"
748 finalize_command
="$finalize_command $arg"
751 if test -n "$prev"; then
752 $echo "$progname: the \`$prevarg' option requires an argument" 1>&2
757 # Substitute the hardcoded libdirs into the compile commands.
758 if test -n "$hardcode_libdir_separator"; then
759 compile_command
=`$echo "$compile_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
760 finalize_command
=`$echo "$finalize_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
767 $echo "$progname: you must specify an output file" 1>&2
773 $echo "$progname: output file \`$output' must have no directory components" 1>&2
778 libname
=`$echo "$output" | sed 's/\.la$//'`
780 # All the library-specific variables (install_libdir is set above).
788 if test -n "$objs"; then
789 $echo "$progname: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
793 # How the heck are we supposed to write a wrapper for a shared library?
794 if test -n "$link_against_libtool_libs"; then
795 $echo "$progname: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
799 if test -n "$dlfiles$dlprefiles"; then
800 $echo "$progname: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
801 # Nullify the symbol file.
802 compile_command
=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
803 finalize_command
=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
806 if test -z "$install_libdir"; then
807 $echo "$progname: you must specify an installation directory with \`-rpath'" 1>&2
811 # Parse the version information argument.
812 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
816 if test -n "$5"; then
817 $echo "$progname: too many parameters to \`-version-info'" 1>&2
822 test -n "$2" && current
="$2"
823 test -n "$3" && revision
="$3"
824 test -n "$4" && age
="$4"
826 # Check that each of the things are valid numbers.
828 0 |
[1-9] |
[1-9][0-9]*) ;;
830 $echo "$progname: CURRENT \`$current' is not a nonnegative integer" 1>&2
831 $echo "$progname: \`$vinfo' is not valid version information" 1>&2
837 0 |
[1-9] |
[1-9][0-9]*) ;;
839 $echo "$progname: REVISION \`$revision' is not a nonnegative integer" 1>&2
840 $echo "$progname: \`$vinfo' is not valid version information" 1>&2
846 0 |
[1-9] |
[1-9][0-9]*) ;;
848 $echo "$progname: AGE \`$age' is not a nonnegative integer" 1>&2
849 $echo "$progname: \`$vinfo' is not valid version information" 1>&2
854 if test $age -gt $current; then
855 $echo "$progname: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
856 $echo "$progname: \`$vinfo' is not valid version information" 1>&2
860 # Calculate the version variables.
861 version_vars
="version_type current age revision"
862 case "$version_type" in
866 version_vars
="$version_vars major versuffix"
867 major
=`expr $current - $age`
868 versuffix
="$major.$age.$revision"
872 version_vars
="$version_vars versuffix verstring"
873 major
=`expr $current - $age`
874 versuffix
="$current.$age.$revision"
875 verstring
="$versuffix"
877 # Add in all the interfaces that we are compatible with.
879 while test $loop != 0; do
880 iface
=`expr $current - $loop`
881 loop
=`expr $loop - 1`
882 verstring
="$verstring:${iface}.0"
885 # Make executables depend on our current version.
886 verstring
="$verstring:${current}.0"
890 version_vars
="$version_vars major versuffix"
892 versuffix
="$current.$revision"
896 $echo "$progname: unknown library version type \`$version_type'" 1>&2
897 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
902 # Create the output directory, or remove our outputs if we need to.
903 if test -d $objdir; then
904 $show "$rm $objdir/$libname.*"
905 $run $rm $objdir/$libname.
*
907 $show "$mkdir $objdir"
908 $run $mkdir $objdir ||
exit $?
911 # Check to see if the archive will have undefined symbols.
912 if test "$allow_undefined" = yes; then
913 if test "$allow_undefined_flag" = unsupported
; then
914 $echo "$progname: warning: undefined symbols not allowed in $host shared libraries" 1>&2
915 build_libtool_libs
=no
920 allow_undefined_flag
=
923 if test "$build_libtool_libs" = yes; then
924 # Get the real and link names of the library.
925 library_names
=`eval $echo \"$library_names_spec\"`
926 set dummy
$library_names
930 if test -n "$soname_spec"; then
931 soname
=`eval $echo \"$soname_spec\"`
936 lib
="$objdir/$realname"
940 linknames
="$linknames $link"
943 # Use standard objects if they are PIC.
944 test -z "$pic_flag" && libobjs
=`$echo "$libobjs " | sed -e 's/\.lo /.o /g' -e 's/ $//g'`
946 # Do each of the archive commands.
947 cmds
=`eval $echo \"$archive_cmds\"`
948 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
952 $run eval "$cmd" ||
exit $?
956 # Create links to the real library.
957 for link
in $linknames; do
958 $show "(cd $objdir && $LN_S $realname $link)"
959 $run eval '(cd $objdir && $LN_S $realname $link)' ||
exit $?
962 # If -export-dynamic was specified, set the dlname.
963 if test "$export_dynamic" = yes; then
964 # On all known operating systems, these are identical.
971 if test -n "$link_against_libtool_libs"; then
972 $echo "$progname: error: cannot link libtool libraries into reloadable objects" 1>&2
976 if test -n "$deplibs"; then
977 $echo "$progname: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
980 if test -n "$dlfiles$dlprefiles"; then
981 $echo "$progname: warning: \`-dlopen' is ignored while creating objects" 1>&2
982 # Nullify the symbol file.
983 compile_command
=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
984 finalize_command
=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
987 if test -n "$install_libdir"; then
988 $echo "$progname: warning: \`-rpath' is ignored while creating objects" 1>&2
991 if test -n "$vinfo"; then
992 $echo "$progname: warning: \`-version-info' is ignored while creating objects" 1>&2
997 if test -n "$objs"; then
998 $echo "$progname: cannot build library object \`$output' from non-libtool objects" 1>&2
1002 obj
=`$echo "$output" | sed 's/\.lo$/.o/'`
1010 # Delete the old objects.
1011 $run $rm $obj $libobj
1013 # Create the old-style object.
1014 reload_objs
="$objs"`$echo "$libobjs " | sed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1017 cmds
=`eval $echo \"$reload_cmds\"`
1018 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1019 for cmd
in $cmds; do
1022 $run eval "$cmd" ||
exit $?
1026 # Exit if we aren't doing a library object file.
1027 test -z "$libobj" && exit 0
1029 if test "$build_libtool_libs" != yes; then
1030 # Create an invalid libtool object if no PIC, so that we don't
1031 # accidentally link it into a program.
1032 $show "$echo timestamp > $libobj"
1033 $run eval "$echo timestamp > $libobj" ||
exit $?
1037 if test -n "$pic_flag"; then
1038 # Only do commands if we really have different PIC objects.
1039 reload_objs
="$libobjs"
1041 cmds
=`eval $echo \"$reload_cmds\"`
1042 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1043 for cmd
in $cmds; do
1046 $run eval "$cmd" ||
exit $?
1050 # Just create a symlink.
1051 $show "$LN_S $obj $libobj"
1052 $run $LN_S $obj $libobj ||
exit 1
1059 if test -n "$install_libdir"; then
1060 $echo "$progname: warning: \`-rpath' is ignored while linking programs" 1>&2
1063 if test -n "$vinfo"; then
1064 $echo "$progname: warning: \`-version-info' is ignored while linking programs" 1>&2
1067 if test -n "$libobjs"; then
1068 # Transform all the library objects into standard objects.
1069 compile_command
=`$echo "$compile_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
1070 finalize_command
=`$echo "$finalize_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
1073 if test "$export_dynamic" = yes && test -n "$global_symbol_pipe" && test -n "$NM"; then
1074 # Add our own program objects to the preloaded list.
1075 dlprefiles
=`$echo "$objs$dlprefiles " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
1077 # Discover the nlist of each of the dlfiles.
1078 dlsyms
="$objdir/${output}S.c"
1079 nlist
="$objdir/${output}.nm"
1081 $run rm -f "$nlist" "$nlist"T
1082 for arg
in $dlprefiles; do
1083 $echo "extracting global symbols from \`$arg'"
1084 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
1087 # Parse the name list into a C file.
1088 $echo "creating $dlsyms"
1089 if test -z "$run"; then
1090 # Try sorting and uniquifying the output.
1091 if sort "$nlist" |
uniq > "$nlist"T
; then
1092 mv -f "$nlist"T
"$nlist"
1093 wcout
=`wc "$nlist" 2>/dev/null`
1094 count
=`$echo "$wcout" | sed 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
1095 test "$wcout" = "$count" && count
=-1
1101 cat <<EOF > "$dlsyms"
1102 /* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
1103 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
1105 /* Prevent the only kind of circular reference mistakes we can make. */
1106 #define dld_preloaded_symbol_count some_other_symbol
1107 #define dld_preloaded_symbols some_other_symbol
1109 /* External symbol declarations for the compiler. */
1111 if test -f "$nlist"; then
1112 sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$dlsyms"
1114 $echo "/* NONE */" >> "$dlsyms"
1117 cat <<EOF >> "$dlsyms"
1119 #undef dld_preloaded_symbol_count
1120 #undef dld_preloaded_symbols
1122 #if defined (__STDC__) && __STDC__
1123 # define __ptr_t void *
1125 # define __ptr_t char *
1128 /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
1129 int dld_preloaded_symbol_count = $count;
1131 /* The mapping between symbol names and symbols. */
1136 dld_preloaded_symbols[] =
1140 if test -f "$nlist"; then
1141 sed 's/^\(.*\) \(.*\)$/ {"\1", \&\2},/' < "$nlist" >> "$dlsyms"
1144 cat <<\EOF
>> "$dlsyms"
1149 $run rm -f "$nlist" "$nlist"T
1151 # Now compile the dynamic symbol file.
1152 $show "(cd $objdir && $CC -c$no_builtin_flag \"${output}S.c\")"
1153 $run eval '(cd $objdir && $CC -c$no_builtin_flag "${output}S.c")' ||
exit $?
1155 # Transform the symbol file into the correct name.
1156 compile_command
=`$echo "$compile_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
1157 finalize_command
=`$echo "$finalize_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
1158 elif test "$export_dynamic" != yes; then
1159 test -n "$dlfiles$dlprefiles" && $echo "$progname: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
1161 # We keep going just in case the user didn't refer to
1162 # dld_preloaded_symbols. The linker will fail if global_symbol_pipe
1163 # really was required.
1164 $echo "$progname: not configured to extract global symbols from dlpreopened files" 1>&2
1166 # Nullify the symbol file.
1167 compile_command
=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
1168 finalize_command
=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
1171 if test -z "$link_against_libtool_libs" ||
test "$build_libtool_libs" != yes; then
1172 # Replace the output file specification.
1173 compile_command
=`$echo "$compile_command" | sed 's%@OUTPUT@%'"$output"'%g'`
1174 finalize_command
=`$echo "$finalize_command" | sed 's%@OUTPUT@%'"$output"'%g'`
1176 # We have no uninstalled library dependencies, so finalize right now.
1177 $show "$compile_command"
1178 $run eval "$compile_command"
1181 # If we failed to link statically, then try again.
1182 if test $status -ne 0 && test -n "$link_static"; then
1183 $echo "$progname: cannot link \`$output' statically; retrying semi-dynamically" 1>&2
1184 compile_command
=`$echo "$compile_command " | sed -e "s% $link_static % %" -e 's/ $//'`
1185 $show "$compile_command"
1186 $run eval "$compile_command"
1192 # Replace the output file specification.
1193 compile_command
=`$echo "$compile_command" | sed 's%@OUTPUT@%'"$objdir/$output"'%g'`
1194 finalize_command
=`$echo "$finalize_command" | sed 's%@OUTPUT@%'"$objdir/$output"'T%g'`
1196 # Create the binary in the object directory, then wrap it.
1197 if test -d $objdir; then :
1199 $show "$mkdir $objdir"
1200 $run $mkdir $objdir ||
exit $?
1203 if test -n "$shlibpath_var"; then
1204 # We should set the shlibpath_var
1206 for dir
in $temp_rpath; do
1213 # Relative path: add a thisdir entry.
1214 rpath
="$rpath\$thisdir/$dir:"
1221 # Delete the old output file.
1224 if test -n "$compile_shlibpath"; then
1225 compile_command
="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
1227 if test -n "$finalize_shlibpath"; then
1228 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
1231 if test -n "$perm_rpath"; then
1232 # We should set the runpath_var.
1234 for dir
in $perm_rpath; do
1237 compile_command
="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
1238 finalize_command
="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
1241 case "$hardcode_action" in
1243 # AGH! Flame the AIX and HP-UX people for me, will ya?
1244 $echo "$progname: warning: using a buggy system linker" 1>&2
1245 $echo "$progname: relinking will be required before \`$output' can be installed" 1>&2
1249 $show "$compile_command"
1250 $run eval "$compile_command" ||
exit $?
1252 # Now create the wrapper script.
1253 $echo "creating $output"
1255 # Quote the finalize command for shipping.
1256 finalize_command
=`$echo "$finalize_command" | sed "$sed_quote_subst"`
1258 # Only actually do things if our run command is non-null.
1259 if test -z "$run"; then
1261 trap "$rm $output; exit 1" 1 2 15
1266 # $output - temporary wrapper script for $objdir/$output
1267 # Generated by ltmain.sh - GNU $PACKAGE $VERSION
1269 # The $output program cannot be directly executed until all the libtool
1270 # libraries that it depends on are installed.
1272 # This wrapper script should never be moved out of \``pwd`'.
1273 # If it is, it will not operate correctly.
1275 # This environment variable determines our operation mode.
1276 if test "\$libtool_install_magic" = "$magic"; then
1277 # install mode needs the following variables:
1278 link_against_libtool_libs='$link_against_libtool_libs'
1279 finalize_command="$finalize_command"
1281 # When we are sourced in execute mode, \$file is already set.
1282 test "\$libtool_execute_magic" = "$magic" || file="\$0"
1284 # Find the directory that this script lives in.
1285 thisdir=\`$echo "\$file" | sed 's%/[^/]*$%%'\`
1286 test "x\$thisdir" = "x\$file" && thisdir=.
1288 # Try to get the absolute directory name.
1289 absdir=\`cd "\$thisdir" && pwd\`
1290 test -n "\$absdir" && thisdir="\$absdir"
1292 progdir="\$thisdir/$objdir"
1295 # If the \$file dir failed (maybe due to symlink), try a hardcoded dir.
1296 oprogdir="\$progdir"
1297 if test -f "\$progdir/\$program"; then :
1300 progdir="\$thisdir/$objdir"
1303 if test -f "\$progdir/\$program"; then
1306 # Export our shlibpath_var if we have one.
1307 if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
1308 cat >> $output <<EOF
1309 # Add our own library path to $shlibpath_var
1310 $shlibpath_var="$temp_rpath\$$shlibpath_var"
1312 # Some systems cannot cope with colon-terminated $shlibpath_var
1313 $shlibpath_var=\`$echo \$$shlibpath_var | sed -e 's/:*\$//'\`
1315 export $shlibpath_var
1320 cat >> $output <<EOF
1321 if test "\$libtool_execute_magic" != "$magic"; then
1322 # Run the actual program with our arguments.
1326 # Quote arguments (to preserve shell metacharacters).
1327 sed_quote_subst='$sed_quote_subst'
1328 arg=\`$echo "\$arg" | sed "\$sed_quote_subst"\`
1329 args="\$args \\"\$arg\\""
1332 # Export the path to the program.
1333 PATH="\$progdir:\$PATH"
1336 eval "exec \$program \$args"
1338 $echo "\$0: cannot exec \$program \$args"
1342 # The program doesn't exist.
1343 $echo "\$0: error: neither \$oprogdir/\$program nor \$progdir/\$program exists" 1>&2
1344 $echo "This script is just a wrapper for \$program." 1>&2
1345 $echo "See the $PACKAGE documentation for more information." 1>&2
1357 # See if we need to build an old-fashioned archive.
1358 if test "$build_old_libs" = "yes"; then
1359 # Now set the variables for building old libraries.
1360 oldlib
="$objdir/$libname.a"
1362 # Transform .lo files to .o files.
1363 oldobjs
="$objs"`$echo "$libobjs " | sed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1365 if test -d "$objdir"; then
1369 $show "$mkdir $objdir"
1373 # Do each command in the archive commands.
1374 cmds
=`eval $echo \"$old_archive_cmds\"`
1375 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1376 for cmd
in $cmds; do
1379 $run eval "$cmd" ||
exit $?
1384 # Now create the libtool archive.
1388 test "$build_old_libs" = yes && old_library
="$libname.a"
1390 $echo "creating $output"
1392 # Only create the output if not a dry run.
1393 if test -z "$run"; then
1395 # $output - a libtool library file
1396 # Generated by ltmain.sh - GNU $PACKAGE $VERSION
1398 # The name that we can dlopen(3).
1401 # Names of this library.
1402 library_names='$library_names'
1404 # The name of the static archive.
1405 old_library='$old_library'
1407 # Version information for $libname.
1412 # Directory that this library needs to be installed in:
1413 libdir='$install_libdir'
1417 # Do a symbolic link so that the libtool archive can be found in
1418 # LD_LIBRARY_PATH before the program is installed.
1419 $show "(cd $objdir && $LN_S ../$output $output)"
1420 $run eval "(cd $objdir && $LN_S ../$output $output)" ||
exit 1
1426 # libtool install mode
1428 progname
="$progname: install"
1430 # The first argument is the name of the installation program.
1431 # Aesthetically quote it.
1432 arg
=`$echo "$nonopt" | sed "$sed_quote_subst"`
1434 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1440 # We need to accept at least all the BSD install flags.
1450 if test -n "$dest"; then
1451 files
="$files $dest"
1469 # If the previous option needed an argument, then skip it.
1470 if test -n "$prev"; then
1479 # Aesthetically quote the argument.
1480 arg
=`$echo "$arg" | sed "$sed_quote_subst"`
1482 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1486 install_prog
="$install_prog $arg"
1489 if test -z "$install_prog"; then
1490 $echo "$progname: you must specify an install program" 1>&2
1495 if test -n "$prev"; then
1496 $echo "$progname: the \`$prev' option requires an argument" 1>&2
1501 if test -z "$files"; then
1502 if test -z "$dest"; then
1503 $echo "$progname: no file or destination specified" 1>&2
1505 $echo "$progname: you must specify a destination" 1>&2
1511 # Strip any trailing slash from the destination.
1512 dest
=`$echo "$dest" | sed 's%/$%%'`
1514 # Check to see that the destination is a directory.
1515 test -d "$dest" && isdir
=yes
1516 if test -n "$isdir"; then
1520 destdir
=`$echo "$dest" | sed 's%/[^/]*$%%'`
1521 test "X$destdir" = "X$dest" && destdir
=.
1522 destname
=`$echo "$dest" | sed 's%^.*/%%'`
1524 # Not a directory, so check to see that there is only one file specified.
1526 if test $# -gt 2; then
1527 $echo "$progname: \`$dest' is not a directory" 1>&2
1535 for file in $files; do
1539 $echo "$progname: \`$destdir' must be an absolute directory name" 1>&2
1548 # This variable tells wrapper scripts just to set variables rather
1549 # than running their programs.
1550 libtool_install_magic
="$magic"
1555 for file in $files; do
1557 # Do each installation.
1560 # Do the static libraries later.
1561 staticlibs
="$staticlibs $file"
1565 # Check to see that this really is a libtool archive.
1566 if egrep "^# Generated by ltmain.sh" $file >/dev
/null
2>&1; then :
1568 $echo "$progname: \`$file' is not a valid libtool archive" 1>&2
1575 # If there is no directory component, then add one.
1581 # Add the libdir to current_libdirs if it is the destination.
1582 if test "X$destdir" = "X$libdir"; then
1583 case "$current_libdirs " in
1585 *) current_libdirs
="$current_libdirs $libdir" ;;
1588 # Note the libdir as a future libdir.
1589 case "$future_libdirs " in
1591 *) future_libdirs
="$future_libdirs $libdir" ;;
1595 dir
="`$echo "$file" | sed 's%/[^/]*$%%'`/"
1596 test "X$dir" = "X$file/" && dir
=
1599 # See the names of the shared library.
1600 set dummy
$library_names
1601 if test -n "$2"; then
1606 # Install the shared library and build the symlinks.
1607 $show "$install_prog $dir/$realname $destdir/$realname"
1608 $run eval "$install_prog $dir/$realname $destdir/$realname" ||
exit $?
1609 test "X$dlname" = "X$realname" && dlname
=
1611 # Support stripping libraries.
1612 if test -n "$stripme"; then
1613 if test -n "$striplib"; then
1614 $show "$striplib $destdir/$realname"
1615 $run $striplib $destdir/$realname ||
exit $?
1617 $echo "$progname: warning: no library stripping program" 1>&2
1621 if test $# -gt 0; then
1622 # Delete the old symlinks.
1626 rmcmd
="$rmcmd $destdir/$linkname"
1631 # ... and create new ones.
1634 test "X$dlname" = "X$linkname" && dlname
=
1635 $show "(cd $destdir && $LN_S $realname $linkname)"
1636 $run eval "(cd $destdir && $LN_S $realname $linkname)"
1640 if test -n "$dlname"; then
1641 # Install the dynamically-loadable library.
1642 $show "$install_prog $dir/$dlname $destdir/$dlname"
1643 $run eval "$install_prog $dir/$dlname $destdir/$dlname" ||
exit $?
1646 # Do each command in the postinstall commands.
1647 lib
="$destdir/$realname"
1648 cmds
=`eval $echo \"$postinstall_cmds\"`
1649 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1650 for cmd
in $cmds; do
1653 $run eval "$cmd" ||
exit $?
1658 # Install the pseudo-library for information purposes.
1659 name
=`$echo "$file" | sed 's%^.*/%%'`
1660 $show "$install_prog $file $destdir/$name"
1661 $run eval "$install_prog $file $destdir/$name" ||
exit $?
1663 # Maybe install the static library, too.
1664 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
1668 # Install (i.e. copy) a libtool object.
1670 # Figure out destination file name, if it wasn't already specified.
1671 if test -n "$destname"; then
1672 destfile
="$destdir/$destname"
1674 destfile
=`$echo "$file" | sed 's%^.*/%%'`
1675 destfile
="$destdir/$destfile"
1678 # Deduce the name of the destination old-style object file.
1681 staticdest
=`$echo "$destfile" | sed 's/\.lo$/\.o/'`
1684 staticdest
="$destfile"
1688 $echo "$progname: cannot copy a libtool object to \`$destfile'" 1>&2
1694 # Install the libtool object if requested.
1695 if test -n "$destfile"; then
1696 $show "$install_prog $file $destfile"
1697 $run eval "$install_prog $file $destfile" ||
exit $?
1700 # Install the old object if enabled.
1701 if test "$build_old_libs" = yes; then
1702 # Deduce the name of the old-style object file.
1703 staticobj
=`$echo "$file" | sed 's/\.lo$/\.o/'`
1705 $show "$install_prog $staticobj $staticdest"
1706 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
1712 # Do a test to see if this is really a libtool program.
1713 if egrep '^# Generated by ltmain.sh' $file >/dev
/null
2>&1; then
1714 link_against_libtool_libs
=
1717 # If there is no directory component, then add one.
1723 # Check the variables that should have been set.
1724 if test -z "$link_against_libtool_libs" ||
test -z "$finalize_command"; then
1725 $echo "$progname: invalid libtool wrapper script \`$file'" 1>&2
1730 for lib
in $link_against_libtool_libs; do
1731 # Check to see that each library is installed.
1733 if test -f "$lib"; then
1734 # If there is no directory component, then add one.
1740 libfile
="$libdir/`$echo "$lib" | sed 's%^.*/%%g'`"
1741 if test -z "$libdir"; then
1742 $echo "$progname: warning: \`$lib' contains no -rpath information" 1>&2
1743 elif test -f "$libfile"; then :
1745 $echo "$progname: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
1750 if test "$hardcode_action" = relink
; then
1751 if test "$finalize" = yes; then
1752 $echo "$progname: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
1753 $show "$finalize_command"
1754 if $run eval "$finalize_command"; then :
1756 $echo "$progname: error: relink \`$file' with the above command before installing it" 1>&2
1759 file="$objdir/$file"T
1761 $echo "$progname: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
1764 # Install the binary that we compiled earlier.
1765 file=`$echo "$file" | sed "s%\([^/]*\)$%$objdir/\1%"`
1769 $show "$install_prog$stripme $file $dest"
1770 $run eval "$install_prog\$stripme \$file \$dest" ||
exit $?
1775 for file in $staticlibs; do
1776 name
=`$echo "$file" | sed 's%^.*/%%'`
1778 # Set up the ranlib parameters.
1779 oldlib
="$destdir/$name"
1781 $show "$install_prog $file $oldlib"
1782 $run eval "$install_prog \$file \$oldlib" ||
exit $?
1784 # Support stripping libraries.
1785 if test -n "$stripme"; then
1786 if test -n "$old_striplib"; then
1787 $show "$old_striplib $oldlib"
1788 $run $old_striplib $oldlib ||
exit $?
1790 $echo "$progname: warning: no static library stripping program" 1>&2
1794 # Do each command in the postinstall commands.
1795 cmds
=`eval $echo \"$old_postinstall_cmds\"`
1796 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1797 for cmd
in $cmds; do
1800 $run eval "$cmd" ||
exit $?
1805 if test -n "$future_libdirs"; then
1806 $echo "$progname: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
1809 if test -n "$current_libdirs"; then
1810 # Maybe just do a dry run.
1811 test -n "$run" && current_libdirs
=" -n$current_libdirs"
1812 exec $0 --finish$current_libdirs
1819 # libtool finish mode
1821 progname
="$progname: finish"
1824 if test -n "$finish_cmds" && test -n "$libdirs"; then
1827 libdirs
="$libdirs $dir"
1830 for libdir
in $libdirs; do
1831 # Do each command in the postinstall commands.
1832 cmds
=`eval $echo \"$finish_cmds\"`
1833 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1834 for cmd
in $cmds; do
1843 $echo "To link against installed libraries in LIBDIR, users may have to:"
1844 if test -n "$shlibpath_var"; then
1845 $echo " - add LIBDIR to their \`$shlibpath_var' environment variable"
1847 $echo " - use the \`-LLIBDIR' linker flag"
1851 # libtool execute mode
1853 progname
="$progname: execute"
1855 # The first argument is the command name.
1857 if test -z "$cmd"; then
1858 $echo "$progname: you must specify a COMMAND" 1>&2
1863 # Handle -dlopen flags immediately.
1864 for file in $execute_dlfiles; do
1865 if test -f "$file"; then :
1867 $echo "$progname: \`$file' is not a file" 1>&2
1875 # Check to see that this really is a libtool archive.
1876 if egrep "^# Generated by ltmain.sh" $file >/dev
/null
2>&1; then :
1878 $echo "$progname: \`$lib' is not a valid libtool archive" 1>&2
1883 # Read the libtool library.
1887 # If there is no directory component, then add one.
1893 # Skip this library if it cannot be dlopened.
1894 if test -z "$dlname"; then
1895 # Warn if it was a shared library.
1896 test -n "$library_names" && $echo "$progname: warning: \`$file' was not linked with \`-export-dynamic'"
1900 dir
=`$echo "$file" | sed 's%/[^/]*$%%'`
1901 test "X$dir" = "X$file" && dir
=.
1903 if test -f "$dir/$objdir/$dlname"; then
1906 $echo "$progname: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
1912 # Just add the directory containing the .lo file.
1913 dir
=`$echo "$file" | sed 's%/[^/]*$%%'`
1914 test "X$dir" = "X$file" && dir
=.
1918 $echo "$progname: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
1923 # Get the absolute pathname.
1924 absdir
=`cd "$dir" && pwd`
1925 test -n "$absdir" && dir
="$absdir"
1927 # Now add the directory to shlibpath_var.
1928 if eval "test -z \"\$$shlibpath_var\""; then
1929 eval "$shlibpath_var=\"\$dir\""
1931 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
1935 # This variable tells wrapper scripts just to set shlibpath_var
1936 # rather than running their programs.
1937 libtool_execute_magic
="$magic"
1939 # Check if any of the arguments is a wrapper script.
1946 if egrep '^# Generated by ltmain.sh' $file >/dev
/null
2>&1; then
1947 # If there is no directory component, then add one.
1953 # Transform arg to wrapped name.
1954 file="$progdir/$program"
1958 # Quote arguments (to preserve shell metacharacters).
1959 file=`$echo "$file" | sed "$sed_quote_subst"`
1960 args
="$args \"$file\""
1963 if test -z "$run"; then
1964 # Export the shlibpath_var.
1965 eval "export $shlibpath_var"
1967 # Now actually exec the command.
1968 eval "exec \$cmd$args"
1970 $echo "$progname: cannot exec \$cmd$args"
1973 # Display what would be done.
1974 eval "$echo \"\$shlibpath_var=\$$shlibpath_var\""
1975 $echo "export $shlibpath_var"
1981 # libtool uninstall mode
1983 progname
="$progname: uninstall"
1990 -*) rm="$rm $arg" ;;
1991 *) files
="$files $arg" ;;
1995 if test -z "$rm"; then
1996 $echo "$progname: you must specify an RM program" 1>&2
2001 for file in $files; do
2002 dir
=`$echo "$file" | sed -e 's%/[^/]*$%%'`
2003 test "X$dir" = "X$file" && dir
=.
2004 name
=`$echo "$file" | sed -e 's%^.*/%%'`
2010 # Possibly a libtool archive, so verify it.
2011 if egrep "^# Generated by ltmain.sh" $file >/dev
/null
2>&1; then
2014 # Delete the libtool libraries and symlinks.
2015 for n
in $library_names; do
2016 rmfiles
="$rmfiles $dir/$n"
2017 test "X$n" = "X$dlname" && dlname
=
2019 test -n "$dlname" && rmfiles
="$rmfiles $dir/$dlname"
2020 test -n "$old_library" && rmfiles
="$rmfiles $dir/$old_library"
2022 # FIXME: should reinstall the best remaining shared library.
2027 if test "$build_old_libs" = yes; then
2028 oldobj
=`$echo "$name" | sed 's/\.lo$/\.o/'`
2029 rmfiles
="$rmfiles $dir/$oldobj"
2034 $show "$rm $rmfiles"
2041 $echo "$progname: you must specify a MODE" 1>&2
2042 $echo "$generic_help" 1>&2
2047 $echo "$progname: invalid operation mode \`$mode'" 1>&2
2048 $echo "$generic_help" 1>&2
2050 fi # test -z "$show_help"
2052 # We need to display help for each of the modes.
2055 Usage: $progname [OPTION]... [MODE-ARG]...
2057 Provide generalized library-building support services.
2059 -n, --dry-run display commands without modifying any files
2060 --features display configuration information and exit
2061 --finish same as \`--mode=finish'
2062 --help display this help message and exit
2063 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
2064 --quiet same as \`--silent'
2065 --silent don't print informational messages
2066 --version print version information
2068 MODE must be one of the following:
2070 compile compile a source file into a libtool object
2071 execute automatically set library path, then run a program
2072 finish complete the installation of libtool libraries
2073 install install libraries or executables
2074 link create a library or an executable
2075 uninstall remove libraries from an installed directory
2077 MODE-ARGS vary depending on the MODE. Try \`$progname --help --mode=MODE' for
2078 a more detailed description of MODE.
2084 Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2086 Compile a source file into a libtool library object.
2088 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2089 from the given SOURCEFILE.
2091 The output file name is determined by removing the directory component from
2092 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2093 library object suffix, \`.lo'.
2099 Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2101 Automatically set library path, then run a program.
2103 This mode accepts the following additional options:
2105 -dlopen FILE add the directory containing FILE to the library path
2107 This mode sets the library path environment variable according to \`-dlopen'
2110 If any of the ARGS are libtool executable wrappers, then they are translated
2111 into their corresponding uninstalled binary, and any of their required library
2112 directories are added to the library path.
2114 Then, COMMAND is executed, with ARGS as arguments.
2120 Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2122 Complete the installation of libtool libraries.
2124 Each LIBDIR is a directory that contains libtool libraries.
2126 The commands that this mode executes may require superuser privileges. Use
2127 the \`--dry-run' option if you just want to see what would be executed.
2133 Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2135 Install executables or libraries.
2137 INSTALL-COMMAND is the installation command. The first component should be
2138 either the \`install' or \`cp' program.
2140 The rest of the components are interpreted as arguments to that command (only
2141 BSD-compatible install options are recognized).
2147 Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2149 Link object files or libraries together to form another library, or to
2150 create an executable program.
2152 LINK-COMMAND is a command using the C compiler that you would use to create
2153 a program from several object files.
2155 The following components of LINK-COMMAND are treated specially:
2157 -allow-undefined allow a libtool library to reference undefined symbols
2158 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2159 -dlpreopen FILE link in FILE and add its symbols to dld_preloaded_symbols
2160 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2161 -LLIBDIR search LIBDIR for required installed libraries
2162 -lNAME OUTPUT-FILE requires the installed library libNAME
2163 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2164 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2165 -static do not do any dynamic linking or shared library creation
2166 -version-info CURRENT[:REVISION[:AGE]]
2167 specify library version info [each variable defaults to 0]
2169 All other options (arguments beginning with \`-') are ignored.
2171 Every other argument is treated as a filename. Files ending in \`.la' are
2172 treated as uninstalled libtool libraries, other files are standard or library
2175 If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
2176 library objects (\`.lo' files) may be specified, and \`-rpath' is required.
2178 If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
2181 If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
2182 created, otherwise an executable program is created.
2188 Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2190 Remove libraries from an installation directory.
2192 RM is the name of the program to use to delete files associated with each FILE
2193 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2196 If FILE is a libtool library, all the files associated with it are deleted.
2197 Otherwise, only FILE itself is deleted using RM.
2202 $echo "$progname: invalid operation mode \`$mode'" 1>&2
2209 $echo "Try \`$progname --help' for more information about other modes."