1 # ltmain.sh - Provide generalized library-building support services.
2 # Generated automatically from ltmain.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.
27 if test "X`$echo '\t'`" = 'X\t'; then :
29 # The Solaris and AIX default echo program unquotes backslashes.
30 # This makes it impossible to quote backslashes using
31 # echo "$something" | sed 's/\\/\\\\/g'
32 # So, we emulate echo with printf '%s\n'
34 if test "X`$echo '\t'`" = 'X\t'; then :
36 # Oops. We have no working printf. Try to find a not-so-buggy echo.
38 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
="${IFS}:"
42 if test -f $dir/echo && test "X`$dir/echo '\t'`" = 'X\t'; then
52 # The name of this program.
53 progname
=`$echo "$0" | sed 's%^.*/%%'`
61 help="Try \`$progname --help' for more information."
62 magic
="%%%MAGIC variable%%%"
68 # Sed substitution that helps us do robust quoting. It backslashifies
69 # metacharacters that are still active within double-quoted strings.
70 sed_quote_subst
='s/\([\\"$]\)/\\\1/g'
73 # Only set LANG and LC_ALL to C if already set.
74 # These must not be set unconditionally because not all systems understand
75 # e.g. LANG=C (notably SCO).
76 if test "${LC_ALL+set}" = set; then LC_ALL
=C
; export LC_ALL
; fi
77 if test "${LANG+set}" = set; then LANG
=C
; export LANG
; fi
79 if test "$LTCONFIG_VERSION" != "$VERSION"; then
80 $echo "$progname: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
81 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
86 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
87 $echo "$progname: not configured to build any kind of library" 1>&2
88 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
102 # Parse our command line options once, thoroughly.
109 -*=*) optarg
=`$echo "$arg" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
113 # If the previous option needs an argument, assign it.
114 if test -n "$prev"; then
117 eval "$prev=\"\$$prev \$arg\""
129 # Have we seen a non-optional argument yet?
136 $echo "$PROGRAM (GNU $PACKAGE) $VERSION"
146 if test "$build_libtool_libs" = yes; then
147 $echo "enable shared libraries"
149 $echo "disable shared libraries"
151 if test "$build_old_libs" = yes; then
152 $echo "enable static libraries"
154 $echo "disable static libraries"
159 --finish) mode
="finish" ;;
161 --mode) prevopt
="--mode" prev
=mode
;;
162 --mode=*) mode
="$optarg" ;;
174 $echo "$progname: unrecognized option \`$arg'" 1>&2
186 if test -n "$prevopt"; then
187 $echo "$progname: option \`$prevopt' requires an argument" 1>&2
192 if test -z "$show_help"; then
194 # Infer the operation mode.
195 if test -z "$mode"; then
219 # If we have no mode, but dlfiles were specified, then do execute mode.
220 test -n "$execute_dlfiles" && mode
=execute
222 # Just use the default operation mode.
223 if test -z "$mode"; then
224 if test -n "$nonopt"; then
225 $echo "$progname: warning: cannot infer operation mode from \`$nonopt'" 1>&2
227 $echo "$progname: warning: cannot infer operation mode without MODE-ARGS" 1>&2
234 # Only execute mode is allowed to have -dlopen flags.
235 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
236 $echo "$progname: unrecognized option \`-dlopen'" 1>&2
241 # Change the help message to a mode-specific one.
243 help="Try \`$progname --help --mode=$mode' for more information."
245 # These modes are in order of execution frequency so that they run quickly.
247 # libtool compile mode
249 progname
="$progname: compile"
250 # Get the compilation command and the source file.
258 # The only flag that cannot be specified is the output filename.
259 if test "X$arg" = "X-o"; then
260 $echo "$progname: you cannot specify the output filename with \`-o'" 1>&2
265 # Accept the current argument as the source file.
269 # Aesthetically quote the previous argument.
271 # Backslashify any backslashes, double quotes, and dollar signs.
272 # These are the only characters that are still specially
273 # interpreted inside of double-quoted scrings.
274 lastarg
=`$echo "$lastarg" | sed "$sed_quote_subst"`
276 # Double-quote args containing other shell metacharacters.
277 # Many Bourne shells cannot handle close brackets correctly in scan
278 # sets, so we specify it separately.
280 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
281 lastarg
="\"$lastarg\""
285 # Add the previous argument to base_compile.
286 if test -z "$base_compile"; then
287 base_compile
="$lastarg"
289 base_compile
="$base_compile $lastarg"
293 # Get the name of the library object.
294 libobj
=`$echo "$srcfile" | sed -e 's%^.*/%%'`
296 # Recognize several different file suffixes.
307 libobj
=`$echo "$libobj" | sed -e "s/\.$xform$/.lo/"`
310 *.lo
) obj
=`$echo "$libobj" | sed -e 's/\.lo$/.o/'` ;;
312 $echo "$progname: cannot determine name of library object from \`$srcfile'" 1>&2
317 if test -z "$base_compile"; then
318 $echo "$progname: you must specify a compilation command" 1>&2
323 # Delete any leftover library objects.
324 if test "$build_old_libs" = yes; then
325 $run $rm $obj $libobj
326 trap "$run $rm $obj $libobj; exit 1" 1 2 15
329 trap "$run $rm $libobj; exit 1" 1 2 15
332 # Only build a PIC object if we are building libtool libraries.
333 if test "$build_libtool_libs" = yes; then
334 # All platforms use -DPIC, to notify preprocessed assembler code.
335 $show "$base_compile$pic_flag -DPIC $srcfile"
336 if $run eval "$base_compile\$pic_flag -DPIC \$srcfile"; then :
338 test -n "$obj" && $run $rm $obj
342 # If we have no pic_flag, then copy the object into place and finish.
343 if test -z "$pic_flag"; then
344 $show "$LN_S $obj $libobj"
345 $run $LN_S $obj $libobj
349 # Just move the object, then go on to compile the next one
350 $show "$mv $obj $libobj"
351 $run $mv $obj $libobj ||
exit 1
353 # Allow error messages only from the first compilation.
354 suppress_output
=' >/dev/null 2>&1'
357 # Only build a position-dependent object if we build old libraries.
358 if test "$build_old_libs" = yes; then
359 # Suppress compiler output if we already did a PIC compilation.
360 $show "$base_compile $srcfile$suppress_output"
361 if $run eval "$base_compile \$srcfile$suppress_output"; then :
363 $run $rm $obj $libobj
368 # Create an invalid libtool object if no PIC, so that we don't accidentally
369 # link it into a program.
370 if test "$build_libtool_libs" != yes; then
371 $show "$echo timestamp > $libobj"
372 $run eval "\$echo timestamp > \$libobj" ||
exit $?
380 progname
="$progname: link"
383 compile_command
="$CC"
384 finalize_command
="$CC"
394 link_against_libtool_libs
=
404 # We need to know -static, to get the right output filenames.
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 "$progname: warning: complete static linking is impossible in this configuration" 1>&2
412 build_libtool_libs
=no
419 # Go through the arguments, transforming them on the way.
422 # If the previous option needs an argument, assign it.
423 if test -n "$prev"; then
426 compile_command
="$compile_command @OUTPUT@"
427 finalize_command
="$finalize_command @OUTPUT@"
434 *.la |
*.lo
) ;; # We handle these cases below.
436 dlprefiles
="$dlprefiles $arg"
437 test "$prev" = dlfiles
&& dlfiles
="$dlfiles $arg"
448 eval "$prev=\"\$arg\""
459 if test -n "$link_static_flag"; then
460 compile_command
="$compile_command $link_static_flag"
461 finalize_command
="$finalize_command $link_static_flag"
482 if test "$export_dynamic" != yes; then
484 arg
=`eval \\$echo "$export_dynamic_flag_spec"`
486 # Add the symbol object into the linking commands.
487 compile_command
="$compile_command @SYMFILE@"
488 finalize_command
="$finalize_command @SYMFILE@"
493 dir
=`$echo "$arg" | sed 's%^-L\(.*\)$%\1%'`
498 $echo "$progname: \`-L$dir' cannot specify a relative directory" 1>&2
502 deplibs
="$deplibs $arg"
505 -l*) deplibs
="$deplibs $arg" ;;
515 # We already handled this flag above.
524 # Some other compiler flag.
526 # Unknown arguments in both finalize_command and compile_command need
527 # to be aesthetically quoted because they are evaled later.
528 arg
=`$echo "$arg" | sed "$sed_quote_subst"`
530 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
543 if test "$prev" = dlfiles
; then
544 dlfiles
="$dlfiles $arg"
545 if test "$build_libtool_libs" = yes; then
549 # If libtool objects are unsupported, then we need to preload.
554 if test "$prev" = dlprefiles
; then
555 # Preload the old-style object.
556 dlprefiles
="$dlprefiles "`$echo "$arg" | sed 's/\.lo$/\.o/'`
559 libobjs
="$libobjs $arg"
563 # A libtool-controlled library.
570 # Check to see that this really is a libtool archive.
571 if egrep "^# Generated by ltmain.sh" $arg >/dev
/null
2>&1; then :
573 $echo "$progname: \`$arg' is not a valid libtool archive" 1>&2
577 # If there is no directory component, then add one.
583 if test -z "$libdir"; then
584 $echo "$progname: \`$arg' contains no -rpath information" 1>&2
588 # Get the name of the library we link against.
590 for l
in $old_library $library_names; do
594 if test -z "$linklib"; then
595 $echo "$progname: cannot find name of link library for \`$arg'" 1>&2
599 # Find the relevant object directory and library name.
600 name
=`$echo "$arg" | sed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
601 dir
=`$echo "$arg" | sed 's%/[^/]*$%%'`
602 if test "X$dir" = "X$arg"; then
608 # This library was specified with -dlopen.
609 if test "$prev" = dlfiles
; then
610 dlfiles
="$dlfiles $arg"
611 if test -z "$dlname"; then
612 # If there is no dlname, we need to preload.
615 # We should not create a dependency on this library.
621 # The library was specified with -dlpreopen.
622 if test "$prev" = dlprefiles
; then
623 # Prefer using a static library (so that no silly _DYNAMIC symbols
624 # are required to link).
625 if test -n "$old_library"; then
626 dlprefiles
="$dlprefiles $dir/$old_library"
628 dlprefiles
="$dlprefiles $dir/$linklib"
633 if test "$build_libtool_libs" = yes && test -n "$library_names"; then
634 link_against_libtool_libs
="$link_against_libtool_libs $arg"
635 if test -n "$shlibpath_var"; then
636 # Make sure the rpath contains only unique directories.
637 case "$temp_rpath " in
639 *) temp_rpath
="$temp_rpath $dir" ;;
643 # FIXME: This is the magic to use -rpath.
644 if test -n "$hardcode_libdir_flag_spec"; then
645 if test -n "$hardcode_libdir_separator"; then
646 if test -z "$hardcode_libdirs"; then
647 # Put the magic libdir with the hardcode flag.
648 hardcode_libdirs
="$libdir"
649 libdir
="@HARDCODE_LIBDIRS@"
651 # Just accumulate the libdirs.
652 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
657 if test -n "$libdir"; then
658 flag
=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
660 compile_command
="$compile_command $flag"
661 finalize_command
="$finalize_command $flag"
663 elif test "$hardcode_runpath_var" = yes; then
664 # Do the same for the permanent run path.
665 case "$perm_rpath " in
667 *) perm_rpath
="$perm_rpath $libdir" ;;
672 case "$hardcode_action" in
674 if test "$hardcode_direct" = no
; then
675 compile_command
="$compile_command $dir/$linklib"
676 elif test "$hardcode_minus_L" = no
; then
677 compile_command
="$compile_command -L$dir -l$name"
678 elif test "$hardcode_shlibpath_var" = no
; then
679 compile_shlibpath
="$compile_shlibpath$dir:"
680 compile_command
="$compile_command -l$name"
685 # We need an absolute path.
689 absdir
=`cd "$dir" && pwd`
690 if test -z "$absdir"; then
691 $echo "$progname: cannot determine absolute directory name of \`$dir'" 1>&2
698 if test "$hardcode_direct" = yes; then
699 compile_command
="$compile_command $dir/$linklib"
700 elif test "$hardcode_minus_L" = yes; then
701 compile_command
="$compile_command -L$dir -l$name"
702 elif test "$hardcode_shlibpath_var" = yes; then
703 compile_shlibpath
="$compile_shlibpath$dir:"
704 compile_command
="$compile_command -l$name"
709 $echo "$progname: \`$hardcode_action' is an unknown hardcode action" 1>&2
714 # Finalize command for both is simple: just hardcode it.
715 if test "$hardcode_direct" = yes; then
716 finalize_command
="$finalize_command $libdir/$linklib"
717 elif test "$hardcode_minus_L" = yes; then
718 finalize_command
="$finalize_command -L$libdir -l$name"
719 elif test "$hardcode_shlibpath_var" = yes; then
720 finalize_shlibpath
="$finalize_shlibpath$libdir:"
721 finalize_command
="$finalize_command -l$name"
723 # We can't seem to hardcode it, guess we'll fake it.
724 finalize_command
="$finalize_command -L$libdir -l$name"
727 # Transform directly to old archives if we don't build new libraries.
728 if test -n "$pic_flag" && test -z "$old_library"; then
729 $echo "$progname: cannot find static library for \`$arg'" 1>&2
733 if test "$hardcode_direct" != unsupported
; then
734 test -n "$old_library" && linklib
="$old_library"
735 compile_command
="$compile_command $dir/$linklib"
736 finalize_command
="$finalize_command $dir/$linklib"
738 # Here we assume that "$hardcode_minus_L" != unsupported.
739 # This is valid on all known static and shared platforms.
740 compile_command
="$compile_command -L$dir -l$name"
741 finalize_command
="$finalize_command -L$dir -l$name"
748 $echo "$progname: unknown file suffix for \`$arg'" 1>&2
754 # Now actually substitute the argument into the commands.
755 compile_command
="$compile_command $arg"
756 finalize_command
="$finalize_command $arg"
759 if test -n "$prev"; then
760 $echo "$progname: the \`$prevarg' option requires an argument" 1>&2
769 $echo "$progname: you must specify an output file" 1>&2
775 $echo "$progname: output file \`$output' must have no directory components" 1>&2
780 libname
=`$echo "$output" | sed 's/\.la$//'`
782 # All the library-specific variables (install_libdir is set above).
790 if test -n "$objs"; then
791 $echo "$progname: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
795 # How the heck are we supposed to write a wrapper for a shared library?
796 if test -n "$link_against_libtool_libs"; then
797 $echo "$progname: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
801 if test -n "$dlfiles$dlprefiles"; then
802 $echo "$progname: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
803 # Nullify the symbol file.
804 compile_command
=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
805 finalize_command
=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
808 if test -z "$rpath"; then
809 $echo "$progname: you must specify an installation directory with \`-rpath'" 1>&2
815 if test $# -gt 2; then
816 $echo "$progname: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
820 # Parse the version information argument.
821 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
825 if test -n "$5"; then
826 $echo "$progname: too many parameters to \`-version-info'" 1>&2
831 test -n "$2" && current
="$2"
832 test -n "$3" && revision
="$3"
833 test -n "$4" && age
="$4"
835 # Check that each of the things are valid numbers.
837 0 |
[1-9] |
[1-9][0-9]*) ;;
839 $echo "$progname: CURRENT \`$current' 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: REVISION \`$revision' is not a nonnegative integer" 1>&2
849 $echo "$progname: \`$vinfo' is not valid version information" 1>&2
855 0 |
[1-9] |
[1-9][0-9]*) ;;
857 $echo "$progname: AGE \`$age' is not a nonnegative integer" 1>&2
858 $echo "$progname: \`$vinfo' is not valid version information" 1>&2
863 if test $age -gt $current; then
864 $echo "$progname: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
865 $echo "$progname: \`$vinfo' is not valid version information" 1>&2
869 # Calculate the version variables.
870 version_vars
="version_type current age revision"
871 case "$version_type" in
875 version_vars
="$version_vars major versuffix"
876 major
=`expr $current - $age`
877 versuffix
="$major.$age.$revision"
881 version_vars
="$version_vars versuffix verstring"
882 major
=`expr $current - $age`
883 versuffix
="$current.$age.$revision"
884 verstring
="$versuffix"
886 # Add in all the interfaces that we are compatible with.
888 while test $loop != 0; do
889 iface
=`expr $current - $loop`
890 loop
=`expr $loop - 1`
891 verstring
="$verstring:${iface}.0"
894 # Make executables depend on our current version.
895 verstring
="$verstring:${current}.0"
899 version_vars
="$version_vars major versuffix"
901 versuffix
="$current.$revision"
905 $echo "$progname: unknown library version type \`$version_type'" 1>&2
906 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
911 # Create the output directory, or remove our outputs if we need to.
912 if test -d $objdir; then
913 $show "$rm $objdir/$libname.*"
914 $run $rm $objdir/$libname.
*
916 $show "$mkdir $objdir"
917 $run $mkdir $objdir ||
exit $?
920 # Check to see if the archive will have undefined symbols.
921 if test "$allow_undefined" = yes; then
922 if test "$allow_undefined_flag" = unsupported
; then
923 $echo "$progname: warning: undefined symbols not allowed in $host shared libraries" 1>&2
924 build_libtool_libs
=no
929 allow_undefined_flag
=
932 if test "$build_libtool_libs" = yes; then
933 # Get the real and link names of the library.
934 library_names
=`eval \\$echo \"$library_names_spec\"`
935 set dummy
$library_names
939 if test -n "$soname_spec"; then
940 soname
=`eval \\$echo \"$soname_spec\"`
945 lib
="$objdir/$realname"
949 linknames
="$linknames $link"
952 # Use standard objects if they are PIC.
953 test -z "$pic_flag" && libobjs
=`$echo "$libobjs " | sed -e 's/\.lo /.o /g' -e 's/ $//g'`
955 # Do each of the archive commands.
956 cmds
=`eval \\$echo \"$archive_cmds\"`
957 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
961 $run eval "$cmd" ||
exit $?
965 # Create links to the real library.
966 for link
in $linknames; do
967 $show "(cd $objdir && $LN_S $realname $link)"
968 $run eval '(cd $objdir && $LN_S $realname $link)' ||
exit $?
971 # If -export-dynamic was specified, set the dlname.
972 if test "$export_dynamic" = yes; then
973 # On all known operating systems, these are identical.
980 if test -n "$link_against_libtool_libs"; then
981 $echo "$progname: error: cannot link libtool libraries into reloadable objects" 1>&2
985 if test -n "$deplibs"; then
986 $echo "$progname: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
989 if test -n "$dlfiles$dlprefiles"; then
990 $echo "$progname: warning: \`-dlopen' is ignored while creating objects" 1>&2
991 # Nullify the symbol file.
992 compile_command
=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
993 finalize_command
=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
996 if test -n "$rpath"; then
997 $echo "$progname: warning: \`-rpath' is ignored while creating objects" 1>&2
1000 if test -n "$vinfo"; then
1001 $echo "$progname: warning: \`-version-info' is ignored while creating objects" 1>&2
1006 if test -n "$objs"; then
1007 $echo "$progname: cannot build library object \`$output' from non-libtool objects" 1>&2
1011 obj
=`$echo "$output" | sed 's/\.lo$/.o/'`
1019 # Delete the old objects.
1020 $run $rm $obj $libobj
1022 # Create the old-style object.
1023 reload_objs
="$objs"`$echo "$libobjs " | sed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1026 cmds
=`eval \\$echo \"$reload_cmds\"`
1027 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1028 for cmd
in $cmds; do
1031 $run eval "$cmd" ||
exit $?
1035 # Exit if we aren't doing a library object file.
1036 test -z "$libobj" && exit 0
1038 if test "$build_libtool_libs" != yes; then
1039 # Create an invalid libtool object if no PIC, so that we don't
1040 # accidentally link it into a program.
1041 $show "$echo timestamp > $libobj"
1042 $run eval "\$echo timestamp > $libobj" ||
exit $?
1046 if test -n "$pic_flag"; then
1047 # Only do commands if we really have different PIC objects.
1048 reload_objs
="$libobjs"
1050 cmds
=`eval \\$echo \"$reload_cmds\"`
1051 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1052 for cmd
in $cmds; do
1055 $run eval "$cmd" ||
exit $?
1059 # Just create a symlink.
1060 $show "$LN_S $obj $libobj"
1061 $run $LN_S $obj $libobj ||
exit 1
1068 if test -n "$vinfo"; then
1069 $echo "$progname: warning: \`-version-info' is ignored while linking programs" 1>&2
1072 if test -n "$rpath"; then
1073 # If the user specified any rpath flags, then add them.
1074 for libdir
in $rpath; do
1075 if test -n "$hardcode_libdir_flag_spec"; then
1076 if test -n "$hardcode_libdir_separator"; then
1077 if test -z "$hardcode_libdirs"; then
1078 # Put the magic libdir with the hardcode flag.
1079 hardcode_libdirs
="$libdir"
1080 libdir
="@HARDCODE_LIBDIRS@"
1082 # Just accumulate the libdirs.
1083 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
1088 if test -n "$libdir"; then
1089 flag
=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
1091 compile_command
="$compile_command $flag"
1092 finalize_command
="$finalize_command $flag"
1094 elif test "$hardcode_runpath_var" = yes; then
1095 case "$perm_rpath " in
1097 *) perm_rpath
="$perm_rpath $libdir" ;;
1103 # Substitute the hardcoded libdirs into the compile commands.
1104 if test -n "$hardcode_libdir_separator"; then
1105 compile_command
=`$echo "$compile_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1106 finalize_command
=`$echo "$finalize_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1109 if test -n "$libobjs" && test "$build_old_libs" = yes; then
1110 # Transform all the library objects into standard objects.
1111 compile_command
=`$echo "$compile_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
1112 finalize_command
=`$echo "$finalize_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
1115 if test "$export_dynamic" = yes && test -n "$global_symbol_pipe" && test -n "$NM"; then
1116 # Add our own program objects to the preloaded list.
1117 dlprefiles
=`$echo "$objs$dlprefiles " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
1119 # Discover the nlist of each of the dlfiles.
1120 dlsyms
="$objdir/${output}S.c"
1121 nlist
="$objdir/${output}.nm"
1123 $run rm -f "$nlist" "$nlist"T
1124 for arg
in $dlprefiles; do
1125 $echo "extracting global symbols from \`$arg'"
1126 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
1129 # Parse the name list into a C file.
1130 $echo "creating $dlsyms"
1131 if test -z "$run"; then
1132 # Try sorting and uniquifying the output.
1133 if sort "$nlist" |
uniq > "$nlist"T
; then
1134 mv -f "$nlist"T
"$nlist"
1135 wcout
=`wc "$nlist" 2>/dev/null`
1136 count
=`$echo "$wcout" | sed 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
1137 test "$wcout" = "$count" && count
=-1
1143 cat <<EOF > "$dlsyms"
1144 /* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
1145 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
1147 /* Prevent the only kind of circular reference mistakes we can make. */
1148 #define dld_preloaded_symbol_count some_other_symbol
1149 #define dld_preloaded_symbols some_other_symbol
1151 /* External symbol declarations for the compiler. */
1153 if test -f "$nlist"; then
1154 sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$dlsyms"
1156 $echo "/* NONE */" >> "$dlsyms"
1159 cat <<EOF >> "$dlsyms"
1161 #undef dld_preloaded_symbol_count
1162 #undef dld_preloaded_symbols
1164 #if defined (__STDC__) && __STDC__
1165 # define __ptr_t void *
1167 # define __ptr_t char *
1170 /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
1171 int dld_preloaded_symbol_count = $count;
1173 /* The mapping between symbol names and symbols. */
1178 dld_preloaded_symbols[] =
1182 if test -f "$nlist"; then
1183 sed 's/^\(.*\) \(.*\)$/ {"\1", \&\2},/' < "$nlist" >> "$dlsyms"
1186 cat <<\EOF
>> "$dlsyms"
1191 $run rm -f "$nlist" "$nlist"T
1193 # Now compile the dynamic symbol file.
1194 $show "(cd $objdir && $CC -c$no_builtin_flag \"${output}S.c\")"
1195 $run eval '(cd $objdir && $CC -c$no_builtin_flag "${output}S.c")' ||
exit $?
1197 # Transform the symbol file into the correct name.
1198 compile_command
=`$echo "$compile_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
1199 finalize_command
=`$echo "$finalize_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
1200 elif test "$export_dynamic" != yes; then
1201 test -n "$dlfiles$dlprefiles" && $echo "$progname: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
1203 # We keep going just in case the user didn't refer to
1204 # dld_preloaded_symbols. The linker will fail if global_symbol_pipe
1205 # really was required.
1206 $echo "$progname: not configured to extract global symbols from dlpreopened files" 1>&2
1208 # Nullify the symbol file.
1209 compile_command
=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
1210 finalize_command
=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
1213 if test -z "$link_against_libtool_libs" ||
test "$build_libtool_libs" != yes; then
1214 # Replace the output file specification.
1215 compile_command
=`$echo "$compile_command" | sed 's%@OUTPUT@%'"$output"'%g'`
1216 finalize_command
=`$echo "$finalize_command" | sed 's%@OUTPUT@%'"$output"'%g'`
1218 # We have no uninstalled library dependencies, so finalize right now.
1219 $show "$compile_command"
1220 $run eval "$compile_command"
1224 # Replace the output file specification.
1225 compile_command
=`$echo "$compile_command" | sed 's%@OUTPUT@%'"$objdir/$output"'%g'`
1226 finalize_command
=`$echo "$finalize_command" | sed 's%@OUTPUT@%'"$objdir/$output"'T%g'`
1228 # Create the binary in the object directory, then wrap it.
1229 if test -d $objdir; then :
1231 $show "$mkdir $objdir"
1232 $run $mkdir $objdir ||
exit $?
1235 if test -n "$shlibpath_var"; then
1236 # We should set the shlibpath_var
1238 for dir
in $temp_rpath; do
1245 # Relative path: add a thisdir entry.
1246 rpath
="$rpath\$thisdir/$dir:"
1253 # Delete the old output file.
1256 if test -n "$compile_shlibpath"; then
1257 compile_command
="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
1259 if test -n "$finalize_shlibpath"; then
1260 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
1263 if test -n "$perm_rpath"; then
1264 # We should set the runpath_var.
1266 for dir
in $perm_rpath; do
1269 compile_command
="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
1270 finalize_command
="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
1273 case "$hardcode_action" in
1275 # AGH! Flame the AIX and HP-UX people for me, will ya?
1276 $echo "$progname: warning: using a buggy system linker" 1>&2
1277 $echo "$progname: relinking will be required before \`$output' can be installed" 1>&2
1281 $show "$compile_command"
1282 $run eval "$compile_command" ||
exit $?
1284 # Now create the wrapper script.
1285 $echo "creating $output"
1287 # Quote the finalize command for shipping.
1288 finalize_command
=`$echo "$finalize_command" | sed "$sed_quote_subst"`
1290 # Only actually do things if our run command is non-null.
1291 if test -z "$run"; then
1293 trap "$rm $output; exit 1" 1 2 15
1298 # $output - temporary wrapper script for $objdir/$output
1299 # Generated by ltmain.sh - GNU $PACKAGE $VERSION
1301 # The $output program cannot be directly executed until all the libtool
1302 # libraries that it depends on are installed.
1304 # This wrapper script should never be moved out of \``pwd`'.
1305 # If it is, it will not operate correctly.
1307 # This environment variable determines our operation mode.
1308 if test "\$libtool_install_magic" = "$magic"; then
1309 # install mode needs the following variables:
1310 link_against_libtool_libs='$link_against_libtool_libs'
1311 finalize_command="$finalize_command"
1313 # When we are sourced in execute mode, \$file and \$echo are already set.
1314 if test "\$libtool_execute_magic" = "$magic"; then :
1320 # Find the directory that this script lives in.
1321 thisdir=\`\$echo "\$file" | sed 's%/[^/]*$%%'\`
1322 test "x\$thisdir" = "x\$file" && thisdir=.
1324 # Try to get the absolute directory name.
1325 absdir=\`cd "\$thisdir" && pwd\`
1326 test -n "\$absdir" && thisdir="\$absdir"
1328 progdir="\$thisdir/$objdir"
1331 # If the \$file dir failed (maybe due to symlink), try a hardcoded dir.
1332 oprogdir="\$progdir"
1333 if test -f "\$progdir/\$program"; then :
1336 progdir="\$thisdir/$objdir"
1339 if test -f "\$progdir/\$program"; then
1342 # Export our shlibpath_var if we have one.
1343 if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
1344 cat >> $output <<EOF
1345 # Add our own library path to $shlibpath_var
1346 $shlibpath_var="$temp_rpath\$$shlibpath_var"
1348 # Some systems cannot cope with colon-terminated $shlibpath_var
1349 $shlibpath_var=\`\$echo \$$shlibpath_var | sed -e 's/:*\$//'\`
1351 export $shlibpath_var
1356 cat >> $output <<EOF
1357 if test "\$libtool_execute_magic" != "$magic"; then
1358 # Run the actual program with our arguments.
1362 # Quote arguments (to preserve shell metacharacters).
1363 sed_quote_subst='$sed_quote_subst'
1364 arg=\`\$echo "\$arg" | sed "\$sed_quote_subst"\`
1365 args="\$args \\"\$arg\\""
1368 # Export the path to the program.
1369 PATH="\$progdir:\$PATH"
1372 eval "exec \$program \$args"
1374 \$echo "\$0: cannot exec \$program \$args"
1378 # The program doesn't exist.
1379 \$echo "\$0: error: neither \$oprogdir/\$program nor \$progdir/\$program exists" 1>&2
1380 \$echo "This script is just a wrapper for \$program." 1>&2
1381 \$echo "See the $PACKAGE documentation for more information." 1>&2
1393 # See if we need to build an old-fashioned archive.
1394 if test "$build_old_libs" = "yes"; then
1395 # Now set the variables for building old libraries.
1396 oldlib
="$objdir/$libname.a"
1398 # Transform .lo files to .o files.
1399 oldobjs
="$objs"`$echo "$libobjs " | sed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1401 if test -d "$objdir"; then
1405 $show "$mkdir $objdir"
1409 # Do each command in the archive commands.
1410 cmds
=`eval \\$echo \"$old_archive_cmds\"`
1411 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1412 for cmd
in $cmds; do
1415 $run eval "$cmd" ||
exit $?
1420 # Now create the libtool archive.
1424 test "$build_old_libs" = yes && old_library
="$libname.a"
1426 $echo "creating $output"
1428 # Only create the output if not a dry run.
1429 if test -z "$run"; then
1431 # $output - a libtool library file
1432 # Generated by ltmain.sh - GNU $PACKAGE $VERSION
1434 # The name that we can dlopen(3).
1437 # Names of this library.
1438 library_names='$library_names'
1440 # The name of the static archive.
1441 old_library='$old_library'
1443 # Version information for $libname.
1448 # Directory that this library needs to be installed in:
1449 libdir='$install_libdir'
1453 # Do a symbolic link so that the libtool archive can be found in
1454 # LD_LIBRARY_PATH before the program is installed.
1455 $show "(cd $objdir && $LN_S ../$output $output)"
1456 $run eval "(cd $objdir && $LN_S ../$output $output)" ||
exit 1
1462 # libtool install mode
1464 progname
="$progname: install"
1466 # The first argument is the name of the installation program.
1467 # Aesthetically quote it.
1468 arg
=`$echo "$nonopt" | sed "$sed_quote_subst"`
1470 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1476 # We need to accept at least all the BSD install flags.
1486 if test -n "$dest"; then
1487 files
="$files $dest"
1505 # If the previous option needed an argument, then skip it.
1506 if test -n "$prev"; then
1515 # Aesthetically quote the argument.
1516 arg
=`$echo "$arg" | sed "$sed_quote_subst"`
1518 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1522 install_prog
="$install_prog $arg"
1525 if test -z "$install_prog"; then
1526 $echo "$progname: you must specify an install program" 1>&2
1531 if test -n "$prev"; then
1532 $echo "$progname: the \`$prev' option requires an argument" 1>&2
1537 if test -z "$files"; then
1538 if test -z "$dest"; then
1539 $echo "$progname: no file or destination specified" 1>&2
1541 $echo "$progname: you must specify a destination" 1>&2
1547 # Strip any trailing slash from the destination.
1548 dest
=`$echo "$dest" | sed 's%/$%%'`
1550 # Check to see that the destination is a directory.
1551 test -d "$dest" && isdir
=yes
1552 if test -n "$isdir"; then
1556 destdir
=`$echo "$dest" | sed 's%/[^/]*$%%'`
1557 test "X$destdir" = "X$dest" && destdir
=.
1558 destname
=`$echo "$dest" | sed 's%^.*/%%'`
1560 # Not a directory, so check to see that there is only one file specified.
1562 if test $# -gt 2; then
1563 $echo "$progname: \`$dest' is not a directory" 1>&2
1571 for file in $files; do
1575 $echo "$progname: \`$destdir' must be an absolute directory name" 1>&2
1584 # This variable tells wrapper scripts just to set variables rather
1585 # than running their programs.
1586 libtool_install_magic
="$magic"
1591 for file in $files; do
1593 # Do each installation.
1596 # Do the static libraries later.
1597 staticlibs
="$staticlibs $file"
1601 # Check to see that this really is a libtool archive.
1602 if egrep "^# Generated by ltmain.sh" $file >/dev
/null
2>&1; then :
1604 $echo "$progname: \`$file' is not a valid libtool archive" 1>&2
1611 # If there is no directory component, then add one.
1617 # Add the libdir to current_libdirs if it is the destination.
1618 if test "X$destdir" = "X$libdir"; then
1619 case "$current_libdirs " in
1621 *) current_libdirs
="$current_libdirs $libdir" ;;
1624 # Note the libdir as a future libdir.
1625 case "$future_libdirs " in
1627 *) future_libdirs
="$future_libdirs $libdir" ;;
1631 dir
="`$echo "$file" | sed 's%/[^/]*$%%'`/"
1632 test "X$dir" = "X$file/" && dir
=
1635 # See the names of the shared library.
1636 set dummy
$library_names
1637 if test -n "$2"; then
1642 # Install the shared library and build the symlinks.
1643 $show "$install_prog $dir/$realname $destdir/$realname"
1644 $run eval "$install_prog $dir/$realname $destdir/$realname" ||
exit $?
1645 test "X$dlname" = "X$realname" && dlname
=
1647 # Support stripping libraries.
1648 if test -n "$stripme"; then
1649 if test -n "$striplib"; then
1650 $show "$striplib $destdir/$realname"
1651 $run $striplib $destdir/$realname ||
exit $?
1653 $echo "$progname: warning: no library stripping program" 1>&2
1657 if test $# -gt 0; then
1658 # Delete the old symlinks.
1662 rmcmd
="$rmcmd $destdir/$linkname"
1667 # ... and create new ones.
1670 test "X$dlname" = "X$linkname" && dlname
=
1671 $show "(cd $destdir && $LN_S $realname $linkname)"
1672 $run eval "(cd $destdir && $LN_S $realname $linkname)"
1676 if test -n "$dlname"; then
1677 # Install the dynamically-loadable library.
1678 $show "$install_prog $dir/$dlname $destdir/$dlname"
1679 $run eval "$install_prog $dir/$dlname $destdir/$dlname" ||
exit $?
1682 # Do each command in the postinstall commands.
1683 lib
="$destdir/$realname"
1684 cmds
=`eval \\$echo \"$postinstall_cmds\"`
1685 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1686 for cmd
in $cmds; do
1689 $run eval "$cmd" ||
exit $?
1694 # Install the pseudo-library for information purposes.
1695 name
=`$echo "$file" | sed 's%^.*/%%'`
1696 $show "$install_prog $file $destdir/$name"
1697 $run eval "$install_prog $file $destdir/$name" ||
exit $?
1699 # Maybe install the static library, too.
1700 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
1704 # Install (i.e. copy) a libtool object.
1706 # Figure out destination file name, if it wasn't already specified.
1707 if test -n "$destname"; then
1708 destfile
="$destdir/$destname"
1710 destfile
=`$echo "$file" | sed 's%^.*/%%'`
1711 destfile
="$destdir/$destfile"
1714 # Deduce the name of the destination old-style object file.
1717 staticdest
=`$echo "$destfile" | sed 's/\.lo$/\.o/'`
1720 staticdest
="$destfile"
1724 $echo "$progname: cannot copy a libtool object to \`$destfile'" 1>&2
1730 # Install the libtool object if requested.
1731 if test -n "$destfile"; then
1732 $show "$install_prog $file $destfile"
1733 $run eval "$install_prog $file $destfile" ||
exit $?
1736 # Install the old object if enabled.
1737 if test "$build_old_libs" = yes; then
1738 # Deduce the name of the old-style object file.
1739 staticobj
=`$echo "$file" | sed 's/\.lo$/\.o/'`
1741 $show "$install_prog $staticobj $staticdest"
1742 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
1748 # Do a test to see if this is really a libtool program.
1749 if egrep '^# Generated by ltmain.sh' $file >/dev
/null
2>&1; then
1750 link_against_libtool_libs
=
1753 # If there is no directory component, then add one.
1759 # Check the variables that should have been set.
1760 if test -z "$link_against_libtool_libs" ||
test -z "$finalize_command"; then
1761 $echo "$progname: invalid libtool wrapper script \`$file'" 1>&2
1766 for lib
in $link_against_libtool_libs; do
1767 # Check to see that each library is installed.
1769 if test -f "$lib"; then
1770 # If there is no directory component, then add one.
1776 libfile
="$libdir/`$echo "$lib" | sed 's%^.*/%%g'`"
1777 if test -z "$libdir"; then
1778 $echo "$progname: warning: \`$lib' contains no -rpath information" 1>&2
1779 elif test -f "$libfile"; then :
1781 $echo "$progname: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
1786 if test "$hardcode_action" = relink
; then
1787 if test "$finalize" = yes; then
1788 $echo "$progname: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
1789 $show "$finalize_command"
1790 if $run eval "$finalize_command"; then :
1792 $echo "$progname: error: relink \`$file' with the above command before installing it" 1>&2
1795 file="$objdir/$file"T
1797 $echo "$progname: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
1800 # Install the binary that we compiled earlier.
1801 file=`$echo "$file" | sed "s%\([^/]*\)$%$objdir/\1%"`
1805 $show "$install_prog$stripme $file $dest"
1806 $run eval "$install_prog\$stripme \$file \$dest" ||
exit $?
1811 for file in $staticlibs; do
1812 name
=`$echo "$file" | sed 's%^.*/%%'`
1814 # Set up the ranlib parameters.
1815 oldlib
="$destdir/$name"
1817 $show "$install_prog $file $oldlib"
1818 $run eval "$install_prog \$file \$oldlib" ||
exit $?
1820 # Support stripping libraries.
1821 if test -n "$stripme"; then
1822 if test -n "$old_striplib"; then
1823 $show "$old_striplib $oldlib"
1824 $run $old_striplib $oldlib ||
exit $?
1826 $echo "$progname: warning: no static library stripping program" 1>&2
1830 # Do each command in the postinstall commands.
1831 cmds
=`eval \\$echo \"$old_postinstall_cmds\"`
1832 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1833 for cmd
in $cmds; do
1836 $run eval "$cmd" ||
exit $?
1841 if test -n "$future_libdirs"; then
1842 $echo "$progname: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
1845 if test -n "$current_libdirs"; then
1846 # Maybe just do a dry run.
1847 test -n "$run" && current_libdirs
=" -n$current_libdirs"
1848 exec $0 --finish$current_libdirs
1855 # libtool finish mode
1857 progname
="$progname: finish"
1860 if test -n "$finish_cmds" && test -n "$libdirs"; then
1863 libdirs
="$libdirs $dir"
1866 for libdir
in $libdirs; do
1867 # Do each command in the postinstall commands.
1868 cmds
=`eval \\$echo \"$finish_cmds\"`
1869 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1870 for cmd
in $cmds; do
1879 $echo "To link against installed libraries in LIBDIR, users may have to:"
1880 if test -n "$shlibpath_var"; then
1881 $echo " - add LIBDIR to their \`$shlibpath_var' environment variable"
1883 $echo " - use the \`-LLIBDIR' linker flag"
1887 # libtool execute mode
1889 progname
="$progname: execute"
1891 # The first argument is the command name.
1893 if test -z "$cmd"; then
1894 $echo "$progname: you must specify a COMMAND" 1>&2
1899 # Handle -dlopen flags immediately.
1900 for file in $execute_dlfiles; do
1901 if test -f "$file"; then :
1903 $echo "$progname: \`$file' is not a file" 1>&2
1911 # Check to see that this really is a libtool archive.
1912 if egrep "^# Generated by ltmain.sh" $file >/dev
/null
2>&1; then :
1914 $echo "$progname: \`$lib' is not a valid libtool archive" 1>&2
1919 # Read the libtool library.
1923 # If there is no directory component, then add one.
1929 # Skip this library if it cannot be dlopened.
1930 if test -z "$dlname"; then
1931 # Warn if it was a shared library.
1932 test -n "$library_names" && $echo "$progname: warning: \`$file' was not linked with \`-export-dynamic'"
1936 dir
=`$echo "$file" | sed 's%/[^/]*$%%'`
1937 test "X$dir" = "X$file" && dir
=.
1939 if test -f "$dir/$objdir/$dlname"; then
1942 $echo "$progname: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
1948 # Just add the directory containing the .lo file.
1949 dir
=`$echo "$file" | sed 's%/[^/]*$%%'`
1950 test "X$dir" = "X$file" && dir
=.
1954 $echo "$progname: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
1959 # Get the absolute pathname.
1960 absdir
=`cd "$dir" && pwd`
1961 test -n "$absdir" && dir
="$absdir"
1963 # Now add the directory to shlibpath_var.
1964 if eval "test -z \"\$$shlibpath_var\""; then
1965 eval "$shlibpath_var=\"\$dir\""
1967 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
1971 # This variable tells wrapper scripts just to set shlibpath_var
1972 # rather than running their programs.
1973 libtool_execute_magic
="$magic"
1975 # Check if any of the arguments is a wrapper script.
1982 if egrep '^# Generated by ltmain.sh' $file >/dev
/null
2>&1; then
1983 # If there is no directory component, then add one.
1989 # Transform arg to wrapped name.
1990 file="$progdir/$program"
1994 # Quote arguments (to preserve shell metacharacters).
1995 file=`$echo "$file" | sed "$sed_quote_subst"`
1996 args
="$args \"$file\""
1999 if test -z "$run"; then
2000 # Export the shlibpath_var.
2001 eval "export $shlibpath_var"
2003 # Now actually exec the command.
2004 eval "exec \$cmd$args"
2006 $echo "$progname: cannot exec \$cmd$args"
2009 # Display what would be done.
2010 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
2011 $echo "export $shlibpath_var"
2017 # libtool uninstall mode
2019 progname
="$progname: uninstall"
2026 -*) rm="$rm $arg" ;;
2027 *) files
="$files $arg" ;;
2031 if test -z "$rm"; then
2032 $echo "$progname: you must specify an RM program" 1>&2
2037 for file in $files; do
2038 dir
=`$echo "$file" | sed -e 's%/[^/]*$%%'`
2039 test "X$dir" = "X$file" && dir
=.
2040 name
=`$echo "$file" | sed -e 's%^.*/%%'`
2046 # Possibly a libtool archive, so verify it.
2047 if egrep "^# Generated by ltmain.sh" $file >/dev
/null
2>&1; then
2050 # Delete the libtool libraries and symlinks.
2051 for n
in $library_names; do
2052 rmfiles
="$rmfiles $dir/$n"
2053 test "X$n" = "X$dlname" && dlname
=
2055 test -n "$dlname" && rmfiles
="$rmfiles $dir/$dlname"
2056 test -n "$old_library" && rmfiles
="$rmfiles $dir/$old_library"
2058 # FIXME: should reinstall the best remaining shared library.
2063 if test "$build_old_libs" = yes; then
2064 oldobj
=`$echo "$name" | sed 's/\.lo$/\.o/'`
2065 rmfiles
="$rmfiles $dir/$oldobj"
2070 $show "$rm $rmfiles"
2077 $echo "$progname: you must specify a MODE" 1>&2
2078 $echo "$generic_help" 1>&2
2083 $echo "$progname: invalid operation mode \`$mode'" 1>&2
2084 $echo "$generic_help" 1>&2
2086 fi # test -z "$show_help"
2088 # We need to display help for each of the modes.
2091 Usage: $progname [OPTION]... [MODE-ARG]...
2093 Provide generalized library-building support services.
2095 -n, --dry-run display commands without modifying any files
2096 --features display configuration information and exit
2097 --finish same as \`--mode=finish'
2098 --help display this help message and exit
2099 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
2100 --quiet same as \`--silent'
2101 --silent don't print informational messages
2102 --version print version information
2104 MODE must be one of the following:
2106 compile compile a source file into a libtool object
2107 execute automatically set library path, then run a program
2108 finish complete the installation of libtool libraries
2109 install install libraries or executables
2110 link create a library or an executable
2111 uninstall remove libraries from an installed directory
2113 MODE-ARGS vary depending on the MODE. Try \`$progname --help --mode=MODE' for
2114 a more detailed description of MODE.
2120 Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2122 Compile a source file into a libtool library object.
2124 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2125 from the given SOURCEFILE.
2127 The output file name is determined by removing the directory component from
2128 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2129 library object suffix, \`.lo'.
2135 Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2137 Automatically set library path, then run a program.
2139 This mode accepts the following additional options:
2141 -dlopen FILE add the directory containing FILE to the library path
2143 This mode sets the library path environment variable according to \`-dlopen'
2146 If any of the ARGS are libtool executable wrappers, then they are translated
2147 into their corresponding uninstalled binary, and any of their required library
2148 directories are added to the library path.
2150 Then, COMMAND is executed, with ARGS as arguments.
2156 Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2158 Complete the installation of libtool libraries.
2160 Each LIBDIR is a directory that contains libtool libraries.
2162 The commands that this mode executes may require superuser privileges. Use
2163 the \`--dry-run' option if you just want to see what would be executed.
2169 Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2171 Install executables or libraries.
2173 INSTALL-COMMAND is the installation command. The first component should be
2174 either the \`install' or \`cp' program.
2176 The rest of the components are interpreted as arguments to that command (only
2177 BSD-compatible install options are recognized).
2183 Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2185 Link object files or libraries together to form another library, or to
2186 create an executable program.
2188 LINK-COMMAND is a command using the C compiler that you would use to create
2189 a program from several object files.
2191 The following components of LINK-COMMAND are treated specially:
2193 -all-static do not do any dynamic linking at all
2194 -allow-undefined allow a libtool library to reference undefined symbols
2195 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2196 -dlpreopen FILE link in FILE and add its symbols to dld_preloaded_symbols
2197 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2198 -LLIBDIR search LIBDIR for required installed libraries
2199 -lNAME OUTPUT-FILE requires the installed library libNAME
2200 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2201 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2202 -static do not do any dynamic linking of libtool libraries
2203 -version-info CURRENT[:REVISION[:AGE]]
2204 specify library version info [each variable defaults to 0]
2206 All other options (arguments beginning with \`-') are ignored.
2208 Every other argument is treated as a filename. Files ending in \`.la' are
2209 treated as uninstalled libtool libraries, other files are standard or library
2212 If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
2213 library objects (\`.lo' files) may be specified, and \`-rpath' is required.
2215 If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
2218 If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
2219 created, otherwise an executable program is created.
2225 Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2227 Remove libraries from an installation directory.
2229 RM is the name of the program to use to delete files associated with each FILE
2230 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2233 If FILE is a libtool library, all the files associated with it are deleted.
2234 Otherwise, only FILE itself is deleted using RM.
2239 $echo "$progname: invalid operation mode \`$mode'" 1>&2
2246 $echo "Try \`$progname --help' for more information about other modes."