1 # ltmain.sh - Provide generalized library-building support services.
2 # Generated automatically from ltmain.sh.in by configure.
3 # Copyright (C) 1996 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.
25 # The name of this program.
26 progname
=`echo "$0" | sed 's%^.*/%%'`
34 help="Try \`$progname --help' for more information."
37 magic
="%%%MAGIC variable%%%"
43 if test "$LTCONFIG_VERSION" != "$VERSION"; then
44 echo "$progname: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
45 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
58 # Parse our command line options once, thoroughly.
65 -*=*) optarg
=`echo "$arg" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
69 # If the previous option needs an argument, assign it.
70 if test -n "$prev"; then
77 # Have we seen a non-optional argument yet?
84 echo "$PROGRAM (GNU $PACKAGE) $VERSION"
92 --finish) mode
="finish" ;;
94 --mode) prevopt
="--mode" prev
=mode
;;
95 --mode=*) mode
="$optarg" ;;
98 echo "$progname: unrecognized option \`$arg'" 1>&2
111 if test -n "$prevopt"; then
112 echo "$progname: option \`$prevopt' requires an argument" 1>&2
118 if test -z "$show_help"; then
120 # Infer the operation mode.
121 if test "$mode" = NONE
; then
124 if echo " $@ " |
egrep "[ ]-c[ ]" > /dev
/null
2>&1; then
137 # Just use the default operation mode.
138 if test "$mode" = NONE
; then
139 if test -n "$nonopt"; then
140 echo "$progname: warning: cannot infer operation mode from \`$nonopt $@'" 1>&2
142 echo "$progname: warning: cannot infer operation mode from no MODE-ARGS" 1>&2
149 # Change the help message to a mode-specific one.
151 help="Try \`$progname --help --mode=$mode' for more information."
153 # These modes are in order of execution frequency so that they run quickly.
155 # libtool compile mode
157 # Get the compilation command and the source file.
158 base_compile
="$nonopt"
164 # Quote any args containing shell metacharacters.
166 *" "*|
*" "*|
*[\
[\
]\~\
#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*|*\"*)
167 quote_arg
="'$arg'" ;;
168 *) quote_arg
="$arg" ;;
171 base_compile
="$base_compile$lastarg"
176 # Get the name of the library object.
177 libobj
=`echo "$srcfile" | sed -e 's%^.*/%%; s/\.[Sc]$/.lo/'`
179 *.lo
) obj
=`echo "$libobj" | sed -e 's/\.lo$/.o/'` ;;
181 echo "$progname: cannot determine name of library object from \`$srcfile'"
186 if test -z "$base_compile"; then
187 echo "$progname: you must specify a compilation command" 1>&2
192 # Delete any old library objects.
193 $run $rm $obj $libobj
194 trap "$run $rm $obj $libobj; exit 1" 1 2 15
196 # Only build a PIC object if we are building libtool libraries.
197 if test "$build_libtool_libs" = yes; then
198 # All platforms use -DPIC, to notify preprocessed assembler code.
199 $show "$base_compile$pic_flag -DPIC $srcfile"
200 if eval "$run $base_compile$pic_flag -DPIC $srcfile"; then :
206 # If we have no pic_flag, then copy the object into place and finish.
207 if test -z "$pic_flag"; then
208 $show "$ln_s $obj $libobj"
209 $run $ln_s $obj $libobj ||
$run $cp_p $obj $libobj
213 # Just move the object, then go on to compile the next one
214 $show "$mv $obj $libobj"
215 $run $mv $obj $libobj ||
exit 1
218 # Compile the position-dependent object.
219 $show "$base_compile $srcfile"
220 if eval "$run $base_compile $srcfile"; then :
222 $run $rm $obj $libobj
226 # Symlink or copy the object file into library object, if no PIC.
227 if test "$build_libtool_libs" != yes; then
228 $show "$ln_s $obj $libobj"
229 $run $ln_s $obj $libobj ||
$run $cp_p $obj $libobj
238 # Go through the arguments, transforming them on the way.
241 compile_command
="$cc"
242 finalize_command
="$cc"
246 link_against_libtool_libs
=
257 # FIXME Maybe set the library names to libNAME_p.a if we are doing profiling.
258 # if echo " $@ " | egrep "[ ]$profile_flag_pattern[ ]" > /dev/null 2>&1; then
266 # If the previous option needs an argument, assign it.
267 if test -n "$prev"; then
270 compile_command
="$compile_command $objdir/$arg"
271 finalize_command
="$finalize_command $objdir/$arg"T
282 # The finalize and compile arguments.
288 deplibs
="$deplibs $arg"
289 dir
=`echo "$arg" | sed 's%^-L\(.*\)$%\1%'`
294 echo "$progname: \`-L$dir' cannot specify a relative directory" 1>&2
300 -l*) deplibs
="$deplibs $arg" ;;
304 -rpath) prev
=install_libdir carg
= farg
= ;;
307 build_libtool_libs
=no
308 farg
="$link_static_flag"
313 echo "$progname: \`-version-file' has been replaced by \`-version-info'" 1>&2
318 -version-info) prev
=vinfo carg
= farg
= ;;
320 -*) cc
="$cc $arg" ;; # Some other compiler flag.
322 # Automake's ansi2knr support code uses the "._o" and ".l_o" object
331 libobjs
="$libobjs $arg"
335 # A libtool-controlled library.
336 dir
=`echo "$arg" | sed 's%/[^/]*$%%'`
337 test "$dir" = "$arg" && dir
=.
338 file=`echo "$arg" | sed 's%^.*/%%'`
340 link_against_libtool_libs
="$link_against_libtool_libs $arg"
341 if test "$build_libtool_libs" = yes; then
342 # Specify the library as -lNAME.
343 carg
="-l`echo "$file" | sed 's/lib\(..*\)\.la$/\1/'`"
346 if test -n "$shlibpath_var"; then
347 # Make sure the rpath contains only unique directories.
348 case "$temp_rpath " in
350 *) temp_rpath
="$temp_rpath $dir" ;;
354 # Check to see that this really is a libtool archive.
355 if egrep "^# Generated by $PROGRAM" $arg >/dev
/null
2>&1; then :
357 echo "$progname: \`$arg' is not a valid libtool archive" 1>&2
364 if test -z "$libdir"; then
365 echo "$progname: \`$arg' contains no -rpath information" 1>&2
369 if test -n "$link_rpath_flag"; then
370 carg
="`eval echo \"$link_rpath_flag\"` $carg"
374 if test "$hardcode_minus_L" != yes; then
375 # Just give the right -L directory flag.
376 carg
="-L$dir/$objdir $carg"
378 elif test "$hardcode_shlibpath_var" = yes; then
379 # Give an absolute path to the library.
383 absdir
=`cd $dir && pwd`
384 if test -z "$absdir"; then
385 echo "$progname: cannot determine absolute pathname of \`$dir'" 1>&2
390 carg
="-L$absdir/$objdir $carg"
391 farg
="-L$libdir $farg"
394 # Transform directly to old archives if we don't build new libraries.
395 carg
="$dir/$objdir/`echo "$file" | sed 's/\.la$/.a/'`"
401 echo "$progname: unknown file suffix for \`$arg'" 1>&2
409 compile_command
="$compile_command $carg"
410 finalize_command
="$finalize_command $farg"
414 if test -n "$prev"; then
415 echo "$progname: the \`$prevarg' option requires an argument"
424 echo "$progname: you must specify an output file" 1>&2
430 echo "$progname: output file \`$output' must have no directory components" 1>&2
438 if test -n "$install_libdir"; then
439 echo "$progname: warning: \`-rpath' is ignored while linking old-style libraries" 1>&2
442 if test -n "$vinfo"; then
443 echo "$progname: warning: \`-version-info' is ignored while linking old-style libraries" 1>&2
448 libname
=`echo "$output" | sed 's/\.la$//'`
450 if test -n "$objs"; then
451 echo "$progname: cannot build libtool library \`$output' from non-libtool objects"
455 # How the heck are we supposed to write a wrapper for a shared library?
456 if test -n "$link_against_libtool_libs"; then
457 echo "$progname: libtool libraries may not depend on uninstalled libraries" 1>&2
461 if test -z "$install_libdir"; then
462 echo "$progname: you must specify an installation directory with \`-rpath'" 1>&2
470 # Parse the version information argument.
471 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
475 if test -n "$5"; then
476 echo "$progname: too many parameters to \`-version-info'" 1>&2
481 test -n "$2" && current
="$2"
482 test -n "$3" && revision
="$3"
483 test -n "$4" && age
="$4"
485 # Check that each of the things are valid numbers.
487 0 |
[1-9] |
[1-9][0-9]*) ;;
489 echo "$progname: CURRENT \`$current' is not a nonnegative integer" 1>&2
490 echo "$progname: \`$vinfo' is not valid version information" 1>&2
496 0 |
[1-9] |
[1-9][0-9]*) ;;
498 echo "$progname: REVISION \`$revision' is not a nonnegative integer" 1>&2
499 echo "$progname: \`$vinfo' is not valid version information" 1>&2
505 0 |
[1-9] |
[1-9][0-9]*) ;;
507 echo "$progname: AGE \`$age' is not a nonnegative integer" 1>&2
508 echo "$progname: \`$vinfo' is not valid version information" 1>&2
513 if test $age -gt $current; then
514 echo "$progname: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
515 echo "$progname: \`$vinfo' is not valid version information" 1>&2
519 # Calculate the version variables.
520 version_vars
="version_type current age revision"
521 case "$version_type" in
525 version_vars
="$version_vars versuffix"
526 versuffix
="$current.$age.$revision"
530 version_vars
="$version_vars major versuffix"
531 major
=`expr $current - $age`
532 versuffix
="$major.$age.$revision"
536 version_vars
="$version_vars versuffix verstring"
537 versuffix
="$current.$age.$revision"
538 verstring
="$versuffix"
540 # Add in all the interfaces that we are compatible with.
542 while test $loop != 0; do
543 iface
=`expr $current - $loop`
544 loop
=`expr $loop - 1`
545 verstring
="$verstring:${iface}.0"
548 # Make executables depend on our current version.
549 verstring
="$verstring:${current}.0"
553 version_vars
="$version_vars major versuffix"
555 versuffix
="$current.$revision"
559 echo "$progname: unknown library version type \`$version_type'" 1>&2
560 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
565 # Maybe add a suffix.
566 test -n "$suffix" && libname
=$libname"_$suffix"
568 # Create the output directory, or remove our outputs if we need to.
569 if test -d $objdir; then
570 $show "$rm $objdir/$libname.*"
571 $run $rm $objdir/$libname.
*
573 $show "$mkdir $objdir"
574 $run $mkdir $objdir ||
exit $?
577 if test "$build_libtool_libs" = yes; then
578 # Get the real and link names of the library.
579 library_names
=`eval echo \"$lib_names\"`
580 set dummy
$library_names
584 if test -n "$soname_spec"; then
585 soname
=`eval echo \"$soname_spec\"`
590 lib
="$objdir/$realname"
594 linknames
="$linknames $objdir/$link"
597 # Use standard objects if they are PIC.
598 test -z "$pic_flag" && libobjs
=`echo "$libobjs " | sed 's/\.lo /.o /g; s/\.l_o /._o /g; s/ $//g'`
600 # Do each of the archive commands.
601 cmds
=`eval echo \"$archive_cmds\"`
602 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
606 eval "$run $cmd" ||
exit $?
610 # Create links to the real library.
611 for link
in $linknames; do
612 $show "$ln_s $realname $link"
613 $run $ln_s $realname $link ||
exit $?
619 if test -n "$link_against_libtool_libs"; then
620 echo "$progname: error: cannot link libtool libraries into reloadable objects" 1>&2
624 if test -n "$deplibs"; then
625 echo "$progname: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
628 if test -n "$install_libdir"; then
629 echo "$progname: warning: \`-rpath' is ignored while creating objects" 1>&2
632 if test -n "$vinfo"; then
633 echo "$progname: warning: \`-version-info' is ignored while creating objects" 1>&2
638 if test -n "$objs"; then
639 echo "$progname: cannot build library object \`$output' from non-libtool objects" 1>&2
643 obj
=`echo "$output" | sed 's/\.lo$/.o/'`
651 # Delete the old objects.
652 $run $rm $obj $libobj
654 # Create the old-style object.
655 reload_objs
="$objs"`echo "$libobjs " | sed 's/\.lo /.o /g; s/\.l_o /._o /g; s/ $//g'`
658 cmds
=`eval echo \"$reload_cmds\"`
659 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
663 eval "$run $cmd" ||
exit $?
667 # Exit if we aren't doing a library object file.
668 test -z "$libobj" && exit 0
670 if test "$build_libtool_libs" = yes && test -n "$pic_flag"; then
671 # Only do commands if we really have different PIC objects.
672 reload_objs
="$libobjs"
674 cmds
=`eval echo \"$reload_cmds\"`
675 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
679 eval "$run $cmd" ||
exit $?
683 # Just create a symlink.
684 $show "$ln_s $obj $libobj"
685 $run $ln_s $obj $libobj ||
$run $cp_p $obj $libobj ||
exit 1
692 if test -n "$install_libdir"; then
693 echo "$progname: warning: \`-rpath' is ignored while linking programs" 1>&2
696 if test -n "$vinfo"; then
697 echo "$progname: warning: \`-version-info' is ignored while linking programs" 1>&2
700 if test -n "$libobjs"; then
701 # Transform all the library objects into standard objects.
702 compile_command
=`echo "$compile_command " | sed 's/\.lo /.o /g; s/\.l_o /._o /g; s/ $//g'`
706 if test -z "$link_against_libtool_libs" ||
test "$build_libtool_libs" != yes; then
707 # We have no uninstalled library dependencies, so finalize right now.
708 compile_command
=`echo "$compile_command" | sed "s%-o $objdir/%-o %"`
709 $show "$compile_command"
710 $run $compile_command
714 # Create the binary in the object directory, then wrap it.
715 if test -d $objdir; then :
717 $show "$mkdir $objdir"
718 $run $mkdir $objdir ||
exit $?
721 if test -n "$shlibpath_var"; then
722 # We should set the shlibpath_var
724 for dir
in $temp_rpath; do
728 rpath
="$rpath:$dir/$objdir"
731 # Relative path: add a thisdir entry.
732 rpath
="$rpath:\$thisdir/$dir/$objdir"
737 # Strip the ugly leading colon.
738 rpath
=`echo "$rpath" | sed 's/^://'`
740 # Prettify the rpath for the link command.
741 linkrpath
=`echo "$rpath" | sed 's%\$thisdir/%%g'`
744 # Delete the old output file.
747 if test "$hardcode_minus_L" != yes; then
748 # Things are fine, the world is a beautiful place.
749 $show "$compile_command"
751 elif test "$hardcode_shlibpath_var" != yes; then
752 # We just need to export the shlibpath for the link command.
753 $show "$shlibpath_var=$linkrpath $compile_command"
754 eval "export $shlibpath_var=$linkrpath"
757 # AGH! Flame the AIX and HP-UX people for me, will ya?
758 echo "$progname: warning: using a buggy hardcoding system linker" 1>&2
759 echo "$progname: relinking will be required before \`$output' can be installed" 1>&2
761 $show "$compile_command"
764 $run $compile_command ||
exit $?
766 # Now create the wrapper script.
767 echo "creating $output"
769 # Only actually do things if our run command is non-null.
770 if test -z "$run"; then
772 trap "$rm $output; exit 1" 1 2 15
777 # $output - temporary wrapper script for $objdir/$output
778 # Generated by $PROGRAM - GNU $PACKAGE $VERSION
780 # The $output program cannot be directly executed until all the libtool
781 # libraries that it depends on are installed.
783 # This wrapper script should never be moved out of \``pwd`'.
784 # If it is, it will not operate correctly.
786 # This environment variable determines our operation mode.
787 if test "\$libtool_install_magic" = "$magic"; then
788 # install mode needs the following variables:
789 link_against_libtool_libs="$link_against_libtool_libs"
790 finalize_command="$finalize_command"
792 # Find the directory that this script lives in.
793 thisdir=\`echo \$0 | sed 's%/[^/]*$%%'\`
794 test "x\$thisdir" = "x\$0" && thisdir=.
796 # Try to get the absolute directory name.
797 absdir=\`cd "\$thisdir" && pwd\`
798 test -n "\$absdir" && thisdir="\$absdir"
800 program="\$thisdir/$objdir/$output"
803 # Export our shlibpath_var if we have one.
804 if test -n "$shlibpath_var" && test -n "$rpath"; then
807 # Add our own library path to $shlibpath_var
808 $shlibpath_var="$rpath:\$$shlibpath_var"
809 export $shlibpath_var
815 if test -f "\$program"; then
816 # Run the actual program with our arguments.
820 # Quote arguments (to preserve shell metacharacters).
821 args="\$args '\$arg'"
823 eval "exec \$program \$args"
825 echo "\$0: cannot exec \$program \$args"
828 # The program doesn't exist.
829 echo "\$0: error: \$program does not exist" 1>&2
830 echo "This script is just a wrapper for \$program." 1>&2
831 echo "See the $PACKAGE documentation for more information." 1>&2
843 # See if we need to build an old-fashioned archive.
844 if test "$build_old_libs" = "yes"; then
845 # Transform .lo files to .o (and don't forget ansi2knr .l_o to ._o).
846 oldobjs
="$objs"`echo "$libobjs " | sed 's/\.lo /.o /g; s/\.l_o /._o /g; s/ $//g'`
849 # Now set the variables for building old libraries.
850 oldlib
="$objdir/$libname.a"
859 # Do each command in the archive commands.
860 cmds
=`eval echo \"$old_archive_cmds\"`
861 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
865 eval "$run $cmd" ||
exit $?
870 # Now create the libtool archive.
874 test "$build_old_libs" = yes && old_library
="$libname.a"
876 echo "creating $output"
878 # Only create the output if not a dry run.
879 if test -z "$run"; then
881 # $output - a libtool library file
882 # Generated by $PROGRAM - GNU $PACKAGE $VERSION
884 # Names of this library.
885 library_names='$library_names'
887 # The name of the static archive.
888 old_library='$old_library'
890 # Version information for $libname.
895 # Directory that this library needs to be installed in:
896 libdir='$install_libdir'
904 # libtool install mode
907 # The first argument is the name of the installation program.
908 install_prog
="$nonopt"
910 # We need to accept at least all the BSD install flags.
920 if test -n "$dest"; then
939 # If the previous option needed an argument, then skip it.
940 if test -n "$prev"; then
948 install_prog
="$install_prog $arg"
951 if test -z "$install_prog"; then
952 echo "$progname: you must specify an install program" 1>&2
957 if test -n "$prev"; then
958 echo "$progname: the \`$prev' option requires an argument" 1>&2
963 if test -z "$files"; then
964 if test -z "$dest"; then
965 echo "$progname: no file or destination specified" 1>&2
967 echo "$progname: you must specify a destination" 1>&2
973 # Strip any trailing slash from the destination.
974 dest
=`echo "$dest" | sed 's%/$%%'`
976 # Check to see that the destination is a directory.
977 test -d "$dest" && isdir
=yes
978 if test -n "$isdir"; then
981 destdir
=`echo "$dest" | sed 's%/[^/]*$%%'`
986 echo "$progname: $destdir must be an absolute directory name" 1>&2
994 for file in $files; do
996 # Do each installation.
999 # Do the static libraries later.
1000 staticlibs
="$staticlibs $file"
1004 # Check to see that this really is a libtool archive.
1005 if egrep "^# Generated by $PROGRAM" $file >/dev
/null
2>&1; then :
1007 echo "$progname: \`$file' is not a valid libtool archive" 1>&2
1014 # If there is no directory component, then add one.
1020 # Add the libdir to current_libdirs if it is the destination.
1021 if test "$destdir" = "$libdir"; then
1022 case "$current_libdirs " in
1024 *) current_libdirs
="$current_libdirs $libdir" ;;
1027 # Note the libdir as a future libdir.
1028 case "$future_libdirs " in
1030 *) future_libdirs
="$future_libdirs $libdir" ;;
1034 dir
="`echo "$file" | sed 's%/[^/]*$%%'`/"
1035 test "$dir" = "$file/" && dir
=
1038 # See the names of the shared library.
1039 set dummy
$library_names
1040 if test -n "$2"; then
1045 # Install the shared library and build the symlinks.
1046 $show "$install_prog $dir/$realname $destdir/$realname"
1047 eval "$run $install_prog $dir/$realname $destdir/$realname" ||
exit $?
1049 # Support stripping libraries.
1050 if test -n "$stripme"; then
1051 if test -n "$striplib"; then
1052 $show "$striplib $destdir/$realname"
1053 $run $striplib $destdir/$realname ||
exit $?
1055 echo "$progname: warning: no library stripping program" 1>&2
1059 if test -n "$1"; then
1060 # Delete the old symlinks.
1064 rmcmd
="$rmcmd $destdir/$linkname"
1069 # ... and create new ones.
1072 $show "$ln_s $realname $destdir/$linkname"
1073 $run $ln_s $realname $destdir/$linkname
1077 # Do each command in the postinstall commands.
1078 lib
="$destdir/$realname"
1079 cmds
=`eval echo \"$postinstall_cmds\"`
1080 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1081 for cmd
in $cmds; do
1084 eval "$run $cmd" ||
exit $?
1089 # Install the pseudo-library for information purposes.
1090 name
=`echo "$file" | sed 's%^.*/%%'`
1091 $show "$install_prog $file $destdir/$name"
1092 $run $install_prog $file $destdir/$name ||
exit $?
1094 # Maybe install the static library, too.
1095 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
1099 # Do a test to see if this is really a libtool program.
1100 if egrep "^# Generated by $PROGRAM" $file >/dev
/null
2>&1; then
1101 # This variable tells wrapper scripts just to set variables rather
1102 # than running their programs.
1103 libtool_install_magic
="$magic"
1104 link_against_libtool_libs
=
1107 # If there is no directory component, then add one.
1113 # Check the variables that should have been set.
1114 if test -z "$link_against_libtool_libs" ||
test -z "$finalize_command"; then
1115 echo "$progname: invalid libtool wrapper script \`$file'"
1120 for lib
in $link_against_libtool_libs; do
1121 # Check to see that each library is installed.
1123 if test -f "$lib"; then
1124 # If there is no directory component, then add one.
1130 libfile
="$libdir/`echo "$lib" | sed 's%^.*/%%g'`"
1131 if test -z "$libdir"; then
1132 echo "$progname: warning: \`$lib' contains no -rpath information"
1133 elif test -f "$libfile"; then :
1135 echo "$progname: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
1140 if test "$hardcode_minus_L" = yes && test "$hardcode_shlibpath_var" = yes; then
1141 if test "$finalize" = no
; then
1142 echo "$progname: warning: cannot relink \`$file' on behalf of your buggy system linker"
1144 echo "$progname: warning: relinking \`$file' on behalf of your buggy system linker"
1145 $show "$finalize_command"
1146 if $run $finalize_command; then :
1148 echo "$progname: error: relink \`$file' with the above command before installing it" 1>&2
1151 file="$objdir/$file"T
1154 # Install the binary that we compiled earlier.
1155 dir
=`echo "$file" | sed 's%/[^/]*$%%'`
1156 if test "$file" = "$dir"; then
1157 file="$objdir/$file"
1159 file="$dir/$objdir/`echo "$file" | sed 's%^.*/%%'`"
1164 $show "$install_prog$stripme $file $dest"
1165 $run $install_prog$stripme $file $dest ||
exit $?
1170 # FIXME Install any profiled libraries, too.
1172 # for file in $staticlibs; do
1173 # newfiles="$newfiles $file"
1174 # pfile=`echo "$file" | sed 's/\.a$/_p.a/'`
1175 # test -f "$pfile" && newfiles="$newfiles $pfile"
1177 # staticlibs="$newfiles"
1179 for file in $staticlibs; do
1180 name
=`echo "$file" | sed 's%^.*/%%'`
1182 # Set up the ranlib parameters.
1183 oldlib
="$destdir/$name"
1185 $show "$install_prog $file $oldlib"
1186 $run $install_prog $file $oldlib ||
exit $?
1188 # Support stripping libraries.
1189 if test -n "$stripme"; then
1190 if test -n "$old_striplib"; then
1191 $show "$old_striplib $oldlib"
1192 $run $old_striplib $oldlib ||
exit $?
1194 echo "$progname: warning: no static library stripping program" 1>&2
1198 # Do each command in the postinstall commands.
1199 cmds
=`eval echo \"$old_postinstall_cmds\"`
1200 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1201 for cmd
in $cmds; do
1204 eval "$run $cmd" ||
exit $?
1209 if test -n "$future_libdirs"; then
1210 echo "$progname: warning: remember to run \`$progname --finish$future_libdirs'"
1213 if test -n "$current_libdirs"; then
1214 # Maybe just do a dry run.
1215 test -n "$run" && current_libdirs
=" -n$current_libdirs"
1216 exec $0 --finish$current_libdirs
1223 # libtool finish mode
1227 if test -n "$finish_cmds" && test -n "$libdirs"; then
1230 libdirs
="$libdirs $dir"
1233 for libdir
in $libdirs; do
1234 # Do each command in the postinstall commands.
1235 cmds
=`eval echo \"$finish_cmds\"`
1236 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1237 for cmd
in $cmds; do
1246 echo "To link against installed libraries in LIBDIR, users may have to:"
1247 if test -n "$shlibpath_var"; then
1248 echo " - add LIBDIR to their \`$shlibpath_var' environment variable"
1250 echo " - use the \`-LLIBDIR' linker flag"
1254 # libtool uninstall mode
1262 -*) rm="$rm $arg" ;;
1263 *) files
="$files $arg" ;;
1267 if test -z "$rm"; then
1268 echo "$progname: you must specify an RM program" 1>&2
1273 for file in $files; do
1274 dir
=`echo "$file" | sed -e 's%/[^/]*$%%'`
1275 test "$dir" = "$file" && dir
=.
1276 name
=`echo "$file" | sed -e 's%^.*/%%'`
1280 # Possibly a libtool archive, so verify it.
1281 if egrep "^# Generated by $PROGRAM" $file >/dev
/null
2>&1; then
1284 # Delete the libtool libraries and symlinks.
1285 for n
in $library_names; do
1290 # Delete the old-fashioned archive.
1291 if test -n "$old_library"; then
1292 $show "$rm $dir/$old_library"
1293 $run $rm $dir/$old_library
1306 echo "$progname: you must specify a MODE" 1>&2
1307 echo "$generic_help" 1>&2
1312 echo "$progname: invalid operation mode \`$mode'" 1>&2
1313 echo "$generic_help" 1>&2
1315 fi # test -z "$show_help"
1317 # We need to display help for each of the modes.
1320 Usage: $progname [OPTION]... [MODE-ARG]...
1322 Provide generalized library-building support services.
1324 -n, --dry-run display commands without modifying any files
1325 --finish same as \`--mode=finish'
1326 --help display this help message and exit
1327 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
1328 --version print version information
1330 MODE must be one of the following:
1332 compile compile a source file into a libtool object
1333 finish complete the installation of libtool libraries
1334 install install libraries or executables
1335 link create a library or an executable
1336 uninstall remove libraries from an installed directory
1338 MODE-ARGS vary depending on the MODE. Try \`$progname --help --mode=MODE' for
1339 a more detailed description of MODE.
1345 Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1347 Compile a source file into a libtool library object.
1349 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1350 from the given SOURCEFILE.
1352 The output file name is determined by removing the directory component from
1353 SOURCEFILE, then substituting the C source code suffix \`.c' with the
1354 library object suffix, \`.lo'.
1360 Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
1362 Complete the installation of libtool libraries.
1364 Each LIBDIR is a directory that contains libtool libraries.
1366 The commands that this mode executes may require superuser privileges. Use
1367 the \`--dry-run' option if you just want to see what would be executed.
1373 Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
1375 Install executables or libraries.
1377 INSTALL-COMMAND is the installation command. The first component should be
1378 either the \`install' or \`cp' program.
1380 The rest of the components are interpreted as arguments to that command (only
1381 BSD-compatible install options are recognized).
1387 Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
1389 Link object files or libraries together to form another library, or to
1390 create an executable program.
1392 LINK-COMMAND is a command using the C compiler that you would use to create
1393 a program from several object files.
1395 The following components of LINK-COMMAND are treated specially:
1397 -LLIBDIR search LIBDIR for required installed libraries
1398 -lNAME OUTPUT-FILE requires the installed library libNAME
1399 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
1400 -rpath LIBDIR the created library will eventually be installed in LIBDIR
1401 -static do not do any dynamic linking or shared library creation
1402 -version-info CURRENT[:REVISION[:AGE]]
1403 specify library version info [each variable defaults to 0]
1405 All other options (arguments beginning with \`-') are ignored.
1407 Every other argument is treated as a filename. Files ending in \`.la' are
1408 treated as uninstalled libtool libraries, other files are standard or library
1411 If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
1412 library objects (\`.lo' or \`.l_o' files) may be specified, and the \`-rpath'
1415 If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
1418 If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
1419 created, otherwise an executable program is created.
1425 Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
1427 Remove libraries from an installation directory.
1429 RM is the name of the program to use to delete files associated with each FILE
1430 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1433 If FILE is a libtool library, all the files associated with it are deleted.
1434 Otherwise, only FILE itself is deleted using RM.
1439 echo "$progname: invalid operation mode \`$mode'" 1>&2
1448 echo "Try \`$progname --help' for more information about other modes."