1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
4 # Copyright (C) 1996-1998 Free Software Foundation, Inc.
5 # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 # As a special exception to the GNU General Public License, if you
22 # distribute this file as part of a program that contains a
23 # configuration script generated by Autoconf, you may include it under
24 # the same distribution terms that you use for the rest of that program.
26 # The name of this program.
27 progname
=`$echo "$0" | sed 's%^.*/%%'`
36 help="Try \`$progname --help' for more information."
37 magic
="%%%MAGIC variable%%%"
42 # Sed substitution that helps us do robust quoting. It backslashifies
43 # metacharacters that are still active within double-quoted strings.
45 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
48 # Only set LANG and LC_ALL to C if already set.
49 # These must not be set unconditionally because not all systems understand
50 # e.g. LANG=C (notably SCO).
51 if test "${LC_ALL+set}" = set; then LC_ALL
=C
; export LC_ALL
; fi
52 if test "${LANG+set}" = set; then LANG
=C
; export LANG
; fi
54 if test "$LTCONFIG_VERSION" != "$VERSION"; then
55 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
56 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
60 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
61 echo "$modename: not configured to build any kind of library" 1>&2
62 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
76 # Parse our command line options once, thoroughly.
83 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
87 # If the previous option needs an argument, assign it.
88 if test -n "$prev"; then
91 eval "$prev=\"\$$prev \$arg\""
103 # Have we seen a non-optional argument yet?
110 echo "$PROGRAM (GNU $PACKAGE) $VERSION"
115 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
120 echo "$progname: enabling shell trace mode"
130 if test "$build_libtool_libs" = yes; then
131 echo "enable shared libraries"
133 echo "disable shared libraries"
135 if test "$build_old_libs" = yes; then
136 echo "enable static libraries"
138 echo "disable static libraries"
143 --finish) mode
="finish" ;;
145 --mode) prevopt
="--mode" prev
=mode
;;
146 --mode=*) mode
="$optarg" ;;
158 $echo "$modename: unrecognized option \`$arg'" 1>&2
170 if test -n "$prevopt"; then
171 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
176 if test -z "$show_help"; then
178 # Infer the operation mode.
179 if test -z "$mode"; then
181 *cc |
*++ | gcc
* |
*-gcc*)
203 # If we have no mode, but dlfiles were specified, then do execute mode.
204 test -n "$execute_dlfiles" && mode
=execute
206 # Just use the default operation mode.
207 if test -z "$mode"; then
208 if test -n "$nonopt"; then
209 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
211 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
218 # Only execute mode is allowed to have -dlopen flags.
219 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
220 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
225 # Change the help message to a mode-specific one.
227 help="Try \`$modename --help --mode=$mode' for more information."
229 # These modes are in order of execution frequency so that they run quickly.
231 # libtool compile mode
233 modename
="$modename: compile"
234 # Get the compilation command and the source file.
242 # Accept any command-line options.
245 $echo "$modename: you cannot specify the output filename with \`-o'" 1>&2
251 build_libtool_libs
=no
257 # Accept the current argument as the source file.
261 # Aesthetically quote the previous argument.
263 # Backslashify any backslashes, double quotes, and dollar signs.
264 # These are the only characters that are still specially
265 # interpreted inside of double-quoted scrings.
266 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
268 # Double-quote args containing other shell metacharacters.
269 # Many Bourne shells cannot handle close brackets correctly in scan
270 # sets, so we specify it separately.
272 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
273 lastarg
="\"$lastarg\""
277 # Add the previous argument to base_compile.
278 if test -z "$base_compile"; then
279 base_compile
="$lastarg"
281 base_compile
="$base_compile $lastarg"
285 # Get the name of the library object.
286 libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
288 # Recognize several different file suffixes.
303 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
306 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e 's/\.lo$/.o/'` ;;
308 $echo "$modename: cannot determine name of library object from \`$srcfile'" 1>&2
313 if test -z "$base_compile"; then
314 $echo "$modename: you must specify a compilation command" 1>&2
319 # Delete any leftover library objects.
320 if test "$build_old_libs" = yes; then
321 $run $rm $obj $libobj
322 trap "$run $rm $obj $libobj; exit 1" 1 2 15
325 trap "$run $rm $libobj; exit 1" 1 2 15
328 # Only build a PIC object if we are building libtool libraries.
329 if test "$build_libtool_libs" = yes; then
330 # Without this assignment, base_compile gets emptied.
331 fbsd_hideous_sh_bug
=$base_compile
333 # All platforms use -DPIC, to notify preprocessed assembler code.
334 $show "$base_compile$pic_flag -DPIC $srcfile"
335 if $run eval "$base_compile\$pic_flag -DPIC \$srcfile"; then :
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 do not
368 # accidentally link it into a program.
369 if test "$build_libtool_libs" != yes; then
370 $show "echo timestamp > $libobj"
371 $run eval "echo timestamp > \$libobj" ||
exit $?
379 modename
="$modename: link"
382 compile_command
="$CC"
383 finalize_command
="$CC"
393 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 "$modename: warning: complete static linking is impossible in this configuration" 1>&2
412 build_libtool_libs
=no
419 # See if our shared archives depend on static archives.
420 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
422 # Go through the arguments, transforming them on the way.
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"
456 eval "$prev=\"\$arg\""
467 if test -n "$link_static_flag"; then
468 compile_command
="$compile_command $link_static_flag"
469 finalize_command
="$finalize_command $link_static_flag"
475 # FIXME: remove this flag sometime in the future.
476 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
491 if test "$export_dynamic" != yes; then
493 if test -n "$export_dynamic_flag_spec"; then
494 eval arg
=\"$export_dynamic_flag_spec\"
499 # Add the symbol object into the linking commands.
500 compile_command
="$compile_command @SYMFILE@"
501 finalize_command
="$finalize_command @SYMFILE@"
506 dir
=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
509 # Add the corresponding hardcode_libdir_flag, if it is not identical.
512 $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
516 deplibs
="$deplibs $arg"
519 -l*) deplibs
="$deplibs $arg" ;;
539 # If we have no pic_flag, then this is the same as -all-static.
540 if test -z "$pic_flag" && test -n "$link_static_flag"; then
541 compile_command
="$compile_command $link_static_flag"
542 finalize_command
="$finalize_command $link_static_flag"
552 # Some other compiler flag.
554 # Unknown arguments in both finalize_command and compile_command need
555 # to be aesthetically quoted because they are evaled later.
556 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
558 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
571 if test "$prev" = dlfiles
; then
572 dlfiles
="$dlfiles $arg"
573 if test "$build_libtool_libs" = yes; then
577 # If libtool objects are unsupported, then we need to preload.
582 if test "$prev" = dlprefiles
; then
583 # Preload the old-style object.
584 dlprefiles
="$dlprefiles "`$echo "X$arg" | $Xsed -e 's/\.lo$/.o/'`
587 libobjs
="$libobjs $arg"
591 # A libtool-controlled library.
598 # Check to see that this really is a libtool archive.
599 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
601 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
605 # If there is no directory component, then add one.
607 */* |
*\\*) .
$arg ;;
611 if test -z "$libdir"; then
612 $echo "$modename: \`$arg' contains no -rpath information" 1>&2
616 # Get the name of the library we link against.
618 for l
in $old_library $library_names; do
622 if test -z "$linklib"; then
623 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
627 # Find the relevant object directory and library name.
628 name
=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
629 dir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
630 if test "X$dir" = "X$arg"; then
636 # This library was specified with -dlopen.
637 if test "$prev" = dlfiles
; then
638 dlfiles
="$dlfiles $arg"
639 if test -z "$dlname"; then
640 # If there is no dlname, we need to preload.
643 # We should not create a dependency on this library, but we
644 # may need any libraries it requires.
645 compile_command
="$compile_command$dependency_libs"
646 finalize_command
="$finalize_command$dependency_libs"
652 # The library was specified with -dlpreopen.
653 if test "$prev" = dlprefiles
; then
654 # Prefer using a static library (so that no silly _DYNAMIC symbols
655 # are required to link).
656 if test -n "$old_library"; then
657 dlprefiles
="$dlprefiles $dir/$old_library"
659 dlprefiles
="$dlprefiles $dir/$linklib"
664 if test "$build_libtool_libs" = yes && test -n "$library_names"; then
665 link_against_libtool_libs
="$link_against_libtool_libs $arg"
666 if test -n "$shlibpath_var"; then
667 # Make sure the rpath contains only unique directories.
668 case "$temp_rpath " in
670 *) temp_rpath
="$temp_rpath $dir" ;;
674 # This is the magic to use -rpath.
675 if test -n "$hardcode_libdir_flag_spec"; then
676 if test -n "$hardcode_libdir_separator"; then
677 if test -z "$hardcode_libdirs"; then
678 # Put the magic libdir with the hardcode flag.
679 hardcode_libdirs
="$libdir"
680 libdir
="@HARDCODE_LIBDIRS@"
682 # Just accumulate the unique libdirs.
683 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
684 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
687 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
694 if test -n "$libdir"; then
695 eval flag
=\"$hardcode_libdir_flag_spec\"
697 compile_command
="$compile_command $flag"
698 finalize_command
="$finalize_command $flag"
700 elif test -n "$runpath_var"; then
701 # Do the same for the permanent run path.
702 case "$perm_rpath " in
704 *) perm_rpath
="$perm_rpath $libdir" ;;
709 case "$hardcode_action" in
711 if test "$hardcode_direct" = no
; then
712 compile_command
="$compile_command $dir/$linklib"
713 elif test "$hardcode_minus_L" = no
; then
714 compile_command
="$compile_command -L$dir -l$name"
715 elif test "$hardcode_shlibpath_var" = no
; then
716 compile_shlibpath
="$compile_shlibpath$dir:"
717 compile_command
="$compile_command -l$name"
722 # We need an absolute path.
724 /* |
[A-Za-z
]:\\*) ;;
726 absdir
=`cd "$dir" && pwd`
727 if test -z "$absdir"; then
728 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
735 if test "$hardcode_direct" = yes; then
736 compile_command
="$compile_command $dir/$linklib"
737 elif test "$hardcode_minus_L" = yes; then
738 compile_command
="$compile_command -L$dir -l$name"
739 elif test "$hardcode_shlibpath_var" = yes; then
740 compile_shlibpath
="$compile_shlibpath$dir:"
741 compile_command
="$compile_command -l$name"
746 # Finalize command for both is simple: just hardcode it.
747 if test "$hardcode_direct" = yes; then
748 finalize_command
="$finalize_command $libdir/$linklib"
749 elif test "$hardcode_minus_L" = yes; then
750 finalize_command
="$finalize_command -L$libdir -l$name"
751 elif test "$hardcode_shlibpath_var" = yes; then
752 finalize_shlibpath
="$finalize_shlibpath$libdir:"
753 finalize_command
="$finalize_command -l$name"
755 # We cannot seem to hardcode it, guess we'll fake it.
756 finalize_command
="$finalize_command -L$libdir -l$name"
759 # Transform directly to old archives if we don't build new libraries.
760 if test -n "$pic_flag" && test -z "$old_library"; then
761 $echo "$modename: cannot find static library for \`$arg'" 1>&2
765 # Here we assume that one of hardcode_direct or hardcode_minus_L
766 # is not unsupported. This is valid on all known static and
768 if test "$hardcode_direct" != unsupported
; then
769 test -n "$old_library" && linklib
="$old_library"
770 compile_command
="$compile_command $dir/$linklib"
771 finalize_command
="$finalize_command $dir/$linklib"
773 compile_command
="$compile_command -L$dir -l$name"
774 finalize_command
="$finalize_command -L$dir -l$name"
778 # Add in any libraries that this one depends upon.
779 compile_command
="$compile_command$dependency_libs"
780 finalize_command
="$finalize_command$dependency_libs"
784 # Some other compiler argument.
786 # Unknown arguments in both finalize_command and compile_command need
787 # to be aesthetically quoted because they are evaled later.
788 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
790 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
797 # Now actually substitute the argument into the commands.
798 if test -n "$arg"; then
799 compile_command
="$compile_command $arg"
800 finalize_command
="$finalize_command $arg"
804 if test -n "$prev"; then
805 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
810 if test -n "$vinfo" && test -n "$release"; then
811 $echo "$modename: you cannot specify both \`-version-info' and \`-release'" 1>&2
820 $echo "$modename: you must specify an output file" 1>&2
826 $echo "$modename: output file \`$output' must have no directory components" 1>&2
831 # Now set the variables for building old libraries.
832 build_libtool_libs
=no
840 # Make sure we only generate libraries of the form `libNAME.la'.
844 $echo "$modename: libtool library \`$arg' must begin with \`lib'" 1>&2
850 name
=`$echo "X$output" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
851 eval libname
=\"$libname_spec\"
853 # All the library-specific variables (install_libdir is set above).
861 if test -n "$objs"; then
862 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
866 # How the heck are we supposed to write a wrapper for a shared library?
867 if test -n "$link_against_libtool_libs"; then
868 $echo "$modename: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
872 if test -n "$dlfiles$dlprefiles"; then
873 $echo "$modename: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
874 # Nullify the symbol file.
875 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
876 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
879 if test -z "$rpath"; then
880 $echo "$modename: you must specify an installation directory with \`-rpath'" 1>&2
886 if test $# -gt 2; then
887 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
891 if test -n "$vinfo"; then
893 # Parse the version information argument.
894 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
898 if test -n "$5"; then
899 $echo "$modename: too many parameters to \`-version-info'" 1>&2
904 test -n "$2" && current
="$2"
905 test -n "$3" && revision
="$3"
906 test -n "$4" && age
="$4"
908 # Check that each of the things are valid numbers.
910 0 |
[1-9] |
[1-9][0-9]*) ;;
912 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
913 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
919 0 |
[1-9] |
[1-9][0-9]*) ;;
921 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
922 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
928 0 |
[1-9] |
[1-9][0-9]*) ;;
930 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
931 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
936 if test $age -gt $current; then
937 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
938 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
942 # Calculate the version variables.
943 version_vars
="version_type current age revision"
944 case "$version_type" in
948 version_vars
="$version_vars major versuffix"
949 major
=.
`expr $current - $age`
950 versuffix
=".$major.$age.$revision"
954 version_vars
="$version_vars versuffix verstring"
955 major
=.
`expr $current - $age`
956 versuffix
=.
"$current.$age.$revision"
957 verstring
="$current.$age.$revision"
959 # Add in all the interfaces that we are compatible with.
961 while test $loop != 0; do
962 iface
=`expr $current - $loop`
963 loop
=`expr $loop - 1`
964 verstring
="$verstring:${iface}.0"
967 # Make executables depend on our current version.
968 verstring
="$verstring:${current}.0"
972 version_vars
="$version_vars major versuffix"
974 versuffix
=.
"$current.$revision"
978 # Like Linux, but with '-' rather than '.', since we only
979 # want one extension on Windows 95.
980 version_vars
="$version_vars major versuffix"
981 major
=`expr $current - $age`
982 versuffix
="-$major-$age-$revision"
986 $echo "$modename: unknown library version type \`$version_type'" 1>&2
987 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
993 # No version information.
996 case "$version_type" in
1000 version_vars
="$version_vars versuffix major"
1006 version_vars
="$version_vars versuffix verstring"
1013 version_vars
="$version_vars major versuffix"
1019 # Like Linux, but with '-' rather than '.', and with a leading
1020 # '-', since we only want one extension on Windows 95.
1021 version_vars
="$version_vars major versuffix"
1027 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1028 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1034 # Create the output directory, or remove our outputs if we need to.
1035 if test -d $objdir; then
1036 $show "$rm $objdir/$output $objdir/$libname.* $objdir/${libname}${release}.*"
1037 $run $rm $objdir/$output $objdir/$libname.
* $objdir/${libname}${release}.
*
1039 $show "$mkdir $objdir"
1042 if test $status -eq 0 ||
test -d $objdir; then :
1048 # Check to see if the archive will have undefined symbols.
1049 if test "$allow_undefined" = yes; then
1050 if test "$allow_undefined_flag" = unsupported
; then
1051 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1052 build_libtool_libs
=no
1056 # Don't allow undefined symbols.
1057 allow_undefined_flag
="$no_undefined_flag"
1060 # Add libc to deplibs on all systems.
1061 dependency_libs
="$deplibs"
1062 deplibs
="$deplibs -lc"
1064 if test "$build_libtool_libs" = yes; then
1065 # Get the real and link names of the library.
1066 eval library_names
=\"$library_names_spec\"
1067 set dummy
$library_names
1071 if test -n "$soname_spec"; then
1072 eval soname
=\"$soname_spec\"
1077 lib
="$objdir/$realname"
1080 linknames
="$linknames $link"
1083 # Use standard objects if they are PIC.
1084 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//g'`
1086 # Do each of the archive commands.
1087 eval cmds
=\"$archive_cmds\"
1088 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1089 for cmd
in $cmds; do
1092 $run eval "$cmd" ||
exit $?
1096 # Create links to the real library.
1097 for linkname
in $linknames; do
1098 if test "$realname" != "$linkname"; then
1099 $show "(cd $objdir && $LN_S $realname $linkname)"
1100 $run eval '(cd $objdir && $LN_S $realname $linkname)' ||
exit $?
1104 # If -export-dynamic was specified, set the dlname.
1105 if test "$export_dynamic" = yes; then
1106 # On all known operating systems, these are identical.
1111 # Now set the variables for building old libraries.
1112 oldlib
="$objdir/$libname.a"
1116 if test -n "$link_against_libtool_libs"; then
1117 $echo "$modename: error: cannot link libtool libraries into reloadable objects" 1>&2
1121 if test -n "$deplibs"; then
1122 $echo "$modename: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
1125 if test -n "$dlfiles$dlprefiles"; then
1126 $echo "$modename: warning: \`-dlopen' is ignored while creating objects" 1>&2
1127 # Nullify the symbol file.
1128 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
1129 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
1132 if test -n "$rpath"; then
1133 $echo "$modename: warning: \`-rpath' is ignored while creating objects" 1>&2
1136 if test -n "$vinfo"; then
1137 $echo "$modename: warning: \`-version-info' is ignored while creating objects" 1>&2
1140 if test -n "$release"; then
1141 $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
1146 if test -n "$objs"; then
1147 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
1151 obj
=`$echo "X$output" | $Xsed -e 's/\.lo$/.o/'`
1159 # Delete the old objects.
1160 $run $rm $obj $libobj
1162 # Create the old-style object.
1163 reload_objs
="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1166 eval cmds
=\"$reload_cmds\"
1167 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1168 for cmd
in $cmds; do
1171 $run eval "$cmd" ||
exit $?
1175 # Exit if we aren't doing a library object file.
1176 test -z "$libobj" && exit 0
1178 if test "$build_libtool_libs" != yes; then
1179 # Create an invalid libtool object if no PIC, so that we don't
1180 # accidentally link it into a program.
1181 $show "echo timestamp > $libobj"
1182 $run eval "echo timestamp > $libobj" ||
exit $?
1186 if test -n "$pic_flag"; then
1187 # Only do commands if we really have different PIC objects.
1188 reload_objs
="$libobjs"
1190 eval cmds
=\"$reload_cmds\"
1191 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1192 for cmd
in $cmds; do
1195 $run eval "$cmd" ||
exit $?
1199 # Just create a symlink.
1200 $show "$LN_S $obj $libobj"
1201 $run $LN_S $obj $libobj ||
exit 1
1208 if test -n "$vinfo"; then
1209 $echo "$modename: warning: \`-version-info' is ignored while linking programs" 1>&2
1212 if test -n "$release"; then
1213 $echo "$modename: warning: \`-release' is ignored while creating objects" 1>&2
1216 if test -n "$rpath"; then
1217 # If the user specified any rpath flags, then add them.
1218 for libdir
in $rpath; do
1219 if test -n "$hardcode_libdir_flag_spec"; then
1220 if test -n "$hardcode_libdir_separator"; then
1221 if test -z "$hardcode_libdirs"; then
1222 # Put the magic libdir with the hardcode flag.
1223 hardcode_libdirs
="$libdir"
1224 libdir
="@HARDCODE_LIBDIRS@"
1226 # Just accumulate the unique libdirs.
1227 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
1228 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
1231 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
1238 if test -n "$libdir"; then
1239 eval flag
=\"$hardcode_libdir_flag_spec\"
1241 compile_command
="$compile_command $flag"
1242 finalize_command
="$finalize_command $flag"
1244 elif test -n "$runpath_var"; then
1245 case "$perm_rpath " in
1247 *) perm_rpath
="$perm_rpath $libdir" ;;
1253 # Substitute the hardcoded libdirs into the compile commands.
1254 if test -n "$hardcode_libdir_separator"; then
1255 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1256 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1259 if test -n "$libobjs" && test "$build_old_libs" = yes; then
1260 # Transform all the library objects into standard objects.
1261 compile_command
=`$echo "X$compile_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
1262 finalize_command
=`$echo "X$finalize_command " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
1265 if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
1266 dlsyms
="${output}S.c"
1271 if test -n "$dlsyms"; then
1272 # Add our own program objects to the preloaded list.
1273 dlprefiles
=`$echo "X$objs$dlprefiles " | $Xsed -e 's/\.lo /.o /g' -e 's/ $//'`
1275 # Discover the nlist of each of the dlfiles.
1276 nlist
="$objdir/${output}.nm"
1278 if test -d $objdir; then
1279 $show "$rm $nlist ${nlist}T"
1280 $run $rm "$nlist" "${nlist}T"
1282 $show "$mkdir $objdir"
1285 if test $status -eq 0 ||
test -d $objdir; then :
1291 for arg
in $dlprefiles; do
1292 $show "extracting global C symbols from \`$arg'"
1293 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
1296 # Parse the name list into a source file.
1297 $show "creating $objdir/$dlsyms"
1298 if test -z "$run"; then
1299 # Make sure we at least have an empty file.
1300 test -f "$nlist" ||
: > "$nlist"
1302 # Try sorting and uniquifying the output.
1303 if sort "$nlist" |
uniq > "$nlist"T
; then
1304 mv -f "$nlist"T
"$nlist"
1305 wcout
=`wc "$nlist" 2>/dev/null`
1306 count
=`echo "X$wcout" | $Xsed -e 's/^[ ]*\([0-9][0-9]*\).*$/\1/'`
1307 (test "$count" -ge 0) 2>/dev
/null || count
=-1
1316 $echo > "$objdir/$dlsyms" "\
1317 /* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
1318 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
1324 /* Prevent the only kind of declaration conflicts we can make. */
1325 #define dld_preloaded_symbol_count some_other_symbol
1326 #define dld_preloaded_symbols some_other_symbol
1328 /* External symbol declarations for the compiler. */\
1331 if test -f "$nlist"; then
1332 sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
1334 echo '/* NONE */' >> "$objdir/$dlsyms"
1337 $echo >> "$objdir/$dlsyms" "\
1339 #undef dld_preloaded_symbol_count
1340 #undef dld_preloaded_symbols
1342 #if defined (__STDC__) && __STDC__
1343 # define __ptr_t void *
1345 # define __ptr_t char *
1348 /* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
1349 int dld_preloaded_symbol_count = $count;
1351 /* The mapping between symbol names and symbols. */
1356 dld_preloaded_symbols[] =
1360 if test -f "$nlist"; then
1361 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
1364 $echo >> "$objdir/$dlsyms" "\
1375 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
1381 # Now compile the dynamic symbol file.
1382 $show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")"
1383 $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' ||
exit $?
1385 # Transform the symbol file into the correct name.
1386 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
1387 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.o%"`
1388 elif test "$export_dynamic" != yes; then
1389 test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
1391 # We keep going just in case the user didn't refer to
1392 # dld_preloaded_symbols. The linker will fail if global_symbol_pipe
1393 # really was required.
1394 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
1396 # Nullify the symbol file.
1397 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
1398 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
1401 if test -z "$link_against_libtool_libs" ||
test "$build_libtool_libs" != yes; then
1402 # Replace the output file specification.
1403 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
1404 finalize_command
=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
1406 # We have no uninstalled library dependencies, so finalize right now.
1407 $show "$compile_command"
1408 $run eval "$compile_command"
1412 # Replace the output file specification.
1413 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'%g'`
1414 finalize_command
=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$objdir/$output"'T%g'`
1416 # Create the binary in the object directory, then wrap it.
1417 if test -d $objdir; then :
1419 $show "$mkdir $objdir"
1422 if test $status -eq 0 ||
test -d $objdir; then :
1428 if test -n "$shlibpath_var"; then
1429 # We should set the shlibpath_var
1431 for dir
in $temp_rpath; do
1438 # Relative path: add a thisdir entry.
1439 rpath
="$rpath\$thisdir/$dir:"
1446 # Delete the old output file.
1449 if test -n "$compile_shlibpath"; then
1450 compile_command
="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
1452 if test -n "$finalize_shlibpath"; then
1453 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
1456 if test -n "$runpath_var" && test -n "$perm_rpath"; then
1457 # We should set the runpath_var.
1459 for dir
in $perm_rpath; do
1462 compile_command
="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
1463 finalize_command
="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
1466 if test "$hardcode_action" = relink
; then
1467 # AGH! Flame the AIX and HP-UX people for me, will ya?
1468 $echo "$modename: warning: using a buggy system linker" 1>&2
1469 $echo "$modename: relinking will be required before \`$output' can be installed" 1>&2
1472 $show "$compile_command"
1473 $run eval "$compile_command" ||
exit $?
1475 # Now create the wrapper script.
1476 $show "creating $output"
1478 # Quote the finalize command for shipping.
1479 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
1481 # Quote $echo for shipping.
1482 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
1484 # Only actually do things if our run command is non-null.
1485 if test -z "$run"; then
1487 trap "$rm $output; exit 1" 1 2 15
1492 # $output - temporary wrapper script for $objdir/$output
1493 # Generated by $PROGRAM - GNU $PACKAGE $VERSION
1495 # The $output program cannot be directly executed until all the libtool
1496 # libraries that it depends on are installed.
1498 # This wrapper script should never be moved out of \``pwd`'.
1499 # If it is, it will not operate correctly.
1501 # Sed substitution that helps us do robust quoting. It backslashifies
1502 # metacharacters that are still active within double-quoted strings.
1503 Xsed='sed -e s/^X//'
1504 sed_quote_subst='$sed_quote_subst'
1506 # The HP-UX ksh and POSIX shell print the target directory to stdout
1508 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
1510 # This environment variable determines our operation mode.
1511 if test \"\$libtool_install_magic\" = \"$magic\"; then
1512 # install mode needs the following variables:
1513 link_against_libtool_libs='$link_against_libtool_libs'
1514 finalize_command=\"$finalize_command\"
1516 # When we are sourced in execute mode, \$file and \$echo are already set.
1517 if test \"\$libtool_execute_magic\" = \"$magic\"; then :
1525 # Find the directory that this script lives in.
1526 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
1527 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
1529 # Follow symbolic links until we get to the real thisdir.
1530 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
1531 while test -n \"\$file\"; do
1532 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
1534 # If there was a directory component, then change thisdir.
1535 if test \"x\$destdir\" != \"x\$file\"; then
1536 case \"\$destdir\" in
1537 /* | [A-Za-z]:\\*) thisdir=\"\$destdir\" ;;
1538 *) thisdir=\"\$thisdir/\$destdir\" ;;
1542 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
1543 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
1546 # Try to get the absolute directory name.
1547 absdir=\`cd \"\$thisdir\" && pwd\`
1548 test -n \"\$absdir\" && thisdir=\"\$absdir\"
1550 progdir=\"\$thisdir/$objdir\"
1553 if test -f \"\$progdir/\$program\"; then"
1555 # Export our shlibpath_var if we have one.
1556 if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
1558 # Add our own library path to $shlibpath_var
1559 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
1561 # Some systems cannot cope with colon-terminated $shlibpath_var
1562 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\`
1564 export $shlibpath_var
1569 if test \"\$libtool_execute_magic\" != \"$magic\"; then
1570 # Run the actual program with our arguments.
1572 # Export the path to the program.
1573 PATH=\"\$progdir:\$PATH\"
1576 exec \$program \${1+\"\$@\"}
1578 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
1582 # The program doesn't exist.
1583 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
1584 \$echo \"This script is just a wrapper for \$program.\" 1>&2
1585 echo \"See the $PACKAGE documentation for more information.\" 1>&2
1596 # See if we need to build an old-fashioned archive.
1597 if test "$build_old_libs" = "yes"; then
1598 # Transform .lo files to .o files.
1599 oldobjs
="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
1601 # Do each command in the archive commands.
1602 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
1603 eval cmds
=\"$old_archive_from_new_cmds\"
1605 eval cmds
=\"$old_archive_cmds\"
1607 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1608 for cmd
in $cmds; do
1611 $run eval "$cmd" ||
exit $?
1616 # Now create the libtool archive.
1620 test "$build_old_libs" = yes && old_library
="$libname.a"
1622 $show "creating $output"
1624 # Only create the output if not a dry run.
1625 if test -z "$run"; then
1627 # $output - a libtool library file
1628 # Generated by $PROGRAM - GNU $PACKAGE $VERSION
1630 # The name that we can dlopen(3).
1633 # Names of this library.
1634 library_names='$library_names'
1636 # The name of the static archive.
1637 old_library='$old_library'
1639 # Libraries that this one depends upon.
1640 dependency_libs='$dependency_libs'
1642 # Version information for $libname.
1647 # Directory that this library needs to be installed in:
1648 libdir='$install_libdir'\
1652 # Do a symbolic link so that the libtool archive can be found in
1653 # LD_LIBRARY_PATH before the program is installed.
1654 $show "(cd $objdir && $LN_S ../$output $output)"
1655 $run eval "(cd $objdir && $LN_S ../$output $output)" ||
exit 1
1661 # libtool install mode
1663 modename
="$modename: install"
1665 # There may be an optional sh(1) argument at the beginning of
1666 # install_prog (especially on Windows NT).
1667 if test "$nonopt" = "$SHELL"; then
1668 # Aesthetically quote it.
1669 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
1671 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1675 install_prog
="$arg "
1683 # The real first argument should be the name of the installation program.
1684 # Aesthetically quote it.
1685 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1687 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1691 install_prog
="$install_prog$arg"
1693 # We need to accept at least all the BSD install flags.
1703 if test -n "$dest"; then
1704 files
="$files $dest"
1722 # If the previous option needed an argument, then skip it.
1723 if test -n "$prev"; then
1732 # Aesthetically quote the argument.
1733 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1735 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1739 install_prog
="$install_prog $arg"
1742 if test -z "$install_prog"; then
1743 $echo "$modename: you must specify an install program" 1>&2
1748 if test -n "$prev"; then
1749 $echo "$modename: the \`$prev' option requires an argument" 1>&2
1754 if test -z "$files"; then
1755 if test -z "$dest"; then
1756 $echo "$modename: no file or destination specified" 1>&2
1758 $echo "$modename: you must specify a destination" 1>&2
1764 # Strip any trailing slash from the destination.
1765 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
1767 # Check to see that the destination is a directory.
1768 test -d "$dest" && isdir
=yes
1769 if test "$isdir" = yes; then
1773 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
1774 test "X$destdir" = "X$dest" && destdir
=.
1775 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
1777 # Not a directory, so check to see that there is only one file specified.
1779 if test $# -gt 2; then
1780 $echo "$modename: \`$dest' is not a directory" 1>&2
1786 /* |
[A-Za-z
]:\\*) ;;
1788 for file in $files; do
1792 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
1801 # This variable tells wrapper scripts just to set variables rather
1802 # than running their programs.
1803 libtool_install_magic
="$magic"
1808 for file in $files; do
1810 # Do each installation.
1813 # Do the static libraries later.
1814 staticlibs
="$staticlibs $file"
1818 # Check to see that this really is a libtool archive.
1819 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
1821 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
1828 # If there is no directory component, then add one.
1830 */* |
*\\*) .
$file ;;
1834 # Add the libdir to current_libdirs if it is the destination.
1835 if test "X$destdir" = "X$libdir"; then
1836 case "$current_libdirs " in
1838 *) current_libdirs
="$current_libdirs $libdir" ;;
1841 # Note the libdir as a future libdir.
1842 case "$future_libdirs " in
1844 *) future_libdirs
="$future_libdirs $libdir" ;;
1848 dir
="`$echo "X
$file" | $Xsed -e 's%/[^/]*$%%'`/"
1849 test "X$dir" = "X$file/" && dir
=
1852 # See the names of the shared library.
1853 set dummy
$library_names
1854 if test -n "$2"; then
1859 # Install the shared library and build the symlinks.
1860 $show "$install_prog $dir/$realname $destdir/$realname"
1861 $run eval "$install_prog $dir/$realname $destdir/$realname" ||
exit $?
1862 test "X$dlname" = "X$realname" && dlname
=
1864 if test $# -gt 0; then
1865 # Delete the old symlinks.
1869 rmcmd
="$rmcmd $destdir/$linkname"
1874 # ... and create new ones.
1877 test "X$dlname" = "X$linkname" && dlname
=
1878 $show "(cd $destdir && $LN_S $realname $linkname)"
1879 $run eval "(cd $destdir && $LN_S $realname $linkname)"
1883 if test -n "$dlname"; then
1884 # Install the dynamically-loadable library.
1885 $show "$install_prog $dir/$dlname $destdir/$dlname"
1886 $run eval "$install_prog $dir/$dlname $destdir/$dlname" ||
exit $?
1889 # Do each command in the postinstall commands.
1890 lib
="$destdir/$realname"
1891 eval cmds
=\"$postinstall_cmds\"
1892 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
1893 for cmd
in $cmds; do
1896 $run eval "$cmd" ||
exit $?
1901 # Install the pseudo-library for information purposes.
1902 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
1903 $show "$install_prog $file $destdir/$name"
1904 $run eval "$install_prog $file $destdir/$name" ||
exit $?
1906 # Maybe install the static library, too.
1907 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
1911 # Install (i.e. copy) a libtool object.
1913 # Figure out destination file name, if it wasn't already specified.
1914 if test -n "$destname"; then
1915 destfile
="$destdir/$destname"
1917 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
1918 destfile
="$destdir/$destfile"
1921 # Deduce the name of the destination old-style object file.
1924 staticdest
=`$echo "X$destfile" | $Xsed -e 's/\.lo$/.o/'`
1927 staticdest
="$destfile"
1931 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
1937 # Install the libtool object if requested.
1938 if test -n "$destfile"; then
1939 $show "$install_prog $file $destfile"
1940 $run eval "$install_prog $file $destfile" ||
exit $?
1943 # Install the old object if enabled.
1944 if test "$build_old_libs" = yes; then
1945 # Deduce the name of the old-style object file.
1946 staticobj
=`$echo "X$file" | $Xsed -e 's/\.lo$/.o/'`
1948 $show "$install_prog $staticobj $staticdest"
1949 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
1955 # Figure out destination file name, if it wasn't already specified.
1956 if test -n "$destname"; then
1957 destfile
="$destdir/$destname"
1959 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
1960 destfile
="$destdir/$destfile"
1963 # Do a test to see if this is really a libtool program.
1964 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1965 link_against_libtool_libs
=
1968 # If there is no directory component, then add one.
1970 */* |
*\\*) .
$file ;;
1974 # Check the variables that should have been set.
1975 if test -z "$link_against_libtool_libs" ||
test -z "$finalize_command"; then
1976 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
1981 for lib
in $link_against_libtool_libs; do
1982 # Check to see that each library is installed.
1984 if test -f "$lib"; then
1985 # If there is no directory component, then add one.
1987 */* |
*\\*) .
$lib ;;
1991 libfile
="$libdir/`$echo "X
$lib" | $Xsed -e 's%^.*/%%g'`"
1992 if test -z "$libdir"; then
1993 $echo "$modename: warning: \`$lib' contains no -rpath information" 1>&2
1994 elif test -f "$libfile"; then :
1996 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
2001 if test "$hardcode_action" = relink
; then
2002 if test "$finalize" = yes; then
2003 $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
2004 $show "$finalize_command"
2005 if $run eval "$finalize_command"; then :
2007 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
2010 file="$objdir/$file"T
2012 $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
2015 # Install the binary that we compiled earlier.
2016 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2020 $show "$install_prog$stripme $file $destfile"
2021 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
2026 for file in $staticlibs; do
2027 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2029 # Set up the ranlib parameters.
2030 oldlib
="$destdir/$name"
2032 $show "$install_prog $file $oldlib"
2033 $run eval "$install_prog \$file \$oldlib" ||
exit $?
2035 # Do each command in the postinstall commands.
2036 eval cmds
=\"$old_postinstall_cmds\"
2037 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
2038 for cmd
in $cmds; do
2041 $run eval "$cmd" ||
exit $?
2046 if test -n "$future_libdirs"; then
2047 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
2050 if test -n "$current_libdirs"; then
2051 # Maybe just do a dry run.
2052 test -n "$run" && current_libdirs
=" -n$current_libdirs"
2053 exec $SHELL $0 --finish$current_libdirs
2060 # libtool finish mode
2062 modename
="$modename: finish"
2066 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2069 libdirs
="$libdirs $dir"
2072 for libdir
in $libdirs; do
2073 if test -n "$finish_cmds"; then
2074 # Do each command in the finish commands.
2075 eval cmds
=\"$finish_cmds\"
2076 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
2077 for cmd
in $cmds; do
2080 $run eval "$cmd" || admincmds
="$admincmds
2085 if test -n "$finish_eval"; then
2086 # Do the single finish_eval.
2087 eval cmds
=\"$finish_eval\"
2088 $run eval "$cmds" || admincmds
="$admincmds
2094 echo "----------------------------------------------------------------------"
2095 echo "Libraries have been installed in:"
2096 for libdir
in $libdirs; do
2100 echo "To link against installed libraries in a given directory, LIBDIR,"
2101 echo "you must use the \`-LLIBDIR' flag during linking."
2103 echo " You will also need to do at least one of the following:"
2104 if test -n "$shlibpath_var"; then
2105 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2106 echo " during execution"
2108 if test -n "$runpath_var"; then
2109 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2110 echo " during linking"
2112 if test -n "$hardcode_libdir_flag_spec"; then
2114 eval flag
=\"$hardcode_libdir_flag_spec\"
2116 echo " - use the \`$flag' linker flag"
2118 if test -n "$admincmds"; then
2119 echo " - have your system administrator run these commands:$admincmds"
2121 if test -f /etc
/ld.so.conf
; then
2122 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2125 echo "See any operating system documentation about shared libraries for"
2126 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2127 echo "----------------------------------------------------------------------"
2131 # libtool execute mode
2133 modename
="$modename: execute"
2135 # The first argument is the command name.
2137 if test -z "$cmd"; then
2138 $echo "$modename: you must specify a COMMAND" 1>&2
2143 # Handle -dlopen flags immediately.
2144 for file in $execute_dlfiles; do
2145 if test -f "$file"; then :
2147 $echo "$modename: \`$file' is not a file" 1>&2
2155 # Check to see that this really is a libtool archive.
2156 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2158 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2163 # Read the libtool library.
2167 # If there is no directory component, then add one.
2169 */* |
*\\*) .
$file ;;
2173 # Skip this library if it cannot be dlopened.
2174 if test -z "$dlname"; then
2175 # Warn if it was a shared library.
2176 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
2180 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
2181 test "X$dir" = "X$file" && dir
=.
2183 if test -f "$dir/$objdir/$dlname"; then
2186 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
2192 # Just add the directory containing the .lo file.
2193 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
2194 test "X$dir" = "X$file" && dir
=.
2198 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
2203 # Get the absolute pathname.
2204 absdir
=`cd "$dir" && pwd`
2205 test -n "$absdir" && dir
="$absdir"
2207 # Now add the directory to shlibpath_var.
2208 if eval "test -z \"\$$shlibpath_var\""; then
2209 eval "$shlibpath_var=\"\$dir\""
2211 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2215 # This variable tells wrapper scripts just to set shlibpath_var
2216 # rather than running their programs.
2217 libtool_execute_magic
="$magic"
2219 # Check if any of the arguments is a wrapper script.
2226 # Do a test to see if this is really a libtool program.
2227 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2228 # If there is no directory component, then add one.
2230 */* |
*\\*) .
$file ;;
2234 # Transform arg to wrapped name.
2235 file="$progdir/$program"
2239 # Quote arguments (to preserve shell metacharacters).
2240 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
2241 args
="$args \"$file\""
2244 if test -z "$run"; then
2245 # Export the shlibpath_var.
2246 eval "export $shlibpath_var"
2248 # Now actually exec the command.
2249 eval "exec \$cmd$args"
2251 $echo "$modename: cannot exec \$cmd$args"
2254 # Display what would be done.
2255 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
2256 $echo "export $shlibpath_var"
2262 # libtool uninstall mode
2264 modename
="$modename: uninstall"
2271 -*) rm="$rm $arg" ;;
2272 *) files
="$files $arg" ;;
2276 if test -z "$rm"; then
2277 $echo "$modename: you must specify an RM program" 1>&2
2282 for file in $files; do
2283 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
2284 test "X$dir" = "X$file" && dir
=.
2285 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2291 # Possibly a libtool archive, so verify it.
2292 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2295 # Delete the libtool libraries and symlinks.
2296 for n
in $library_names; do
2297 rmfiles
="$rmfiles $dir/$n"
2298 test "X$n" = "X$dlname" && dlname
=
2300 test -n "$dlname" && rmfiles
="$rmfiles $dir/$dlname"
2301 test -n "$old_library" && rmfiles
="$rmfiles $dir/$old_library"
2303 $show "$rm $rmfiles"
2306 if test -n "$library_names"; then
2307 # Do each command in the postuninstall commands.
2308 eval cmds
=\"$postuninstall_cmds\"
2309 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
2310 for cmd
in $cmds; do
2318 if test -n "$old_library"; then
2319 # Do each command in the old_postuninstall commands.
2320 eval cmds
=\"$old_postuninstall_cmds\"
2321 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=';'
2322 for cmd
in $cmds; do
2330 # FIXME: should reinstall the best remaining shared library.
2335 if test "$build_old_libs" = yes; then
2336 oldobj
=`$echo "X$name" | $Xsed -e 's/\.lo$/.o/'`
2337 rmfiles
="$rmfiles $dir/$oldobj"
2339 $show "$rm $rmfiles"
2344 $show "$rm $rmfiles"
2353 $echo "$modename: you must specify a MODE" 1>&2
2354 $echo "$generic_help" 1>&2
2359 $echo "$modename: invalid operation mode \`$mode'" 1>&2
2360 $echo "$generic_help" 1>&2
2362 fi # test -z "$show_help"
2364 # We need to display help for each of the modes.
2367 "Usage: $modename [OPTION]... [MODE-ARG]...
2369 Provide generalized library-building support services.
2371 --config show all configuration variables
2372 --debug enable verbose shell tracing
2373 -n, --dry-run display commands without modifying any files
2374 --features display basic configuration information and exit
2375 --finish same as \`--mode=finish'
2376 --help display this help message and exit
2377 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
2378 --quiet same as \`--silent'
2379 --silent don't print informational messages
2380 --version print version information
2382 MODE must be one of the following:
2384 compile compile a source file into a libtool object
2385 execute automatically set library path, then run a program
2386 finish complete the installation of libtool libraries
2387 install install libraries or executables
2388 link create a library or an executable
2389 uninstall remove libraries from an installed directory
2391 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
2392 a more detailed description of MODE."
2398 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2400 Compile a source file into a libtool library object.
2402 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2403 from the given SOURCEFILE.
2405 The output file name is determined by removing the directory component from
2406 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2407 library object suffix, \`.lo'."
2412 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
2414 Automatically set library path, then run a program.
2416 This mode accepts the following additional options:
2418 -dlopen FILE add the directory containing FILE to the library path
2420 This mode sets the library path environment variable according to \`-dlopen'
2423 If any of the ARGS are libtool executable wrappers, then they are translated
2424 into their corresponding uninstalled binary, and any of their required library
2425 directories are added to the library path.
2427 Then, COMMAND is executed, with ARGS as arguments."
2432 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
2434 Complete the installation of libtool libraries.
2436 Each LIBDIR is a directory that contains libtool libraries.
2438 The commands that this mode executes may require superuser privileges. Use
2439 the \`--dry-run' option if you just want to see what would be executed."
2444 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
2446 Install executables or libraries.
2448 INSTALL-COMMAND is the installation command. The first component should be
2449 either the \`install' or \`cp' program.
2451 The rest of the components are interpreted as arguments to that command (only
2452 BSD-compatible install options are recognized)."
2457 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
2459 Link object files or libraries together to form another library, or to
2460 create an executable program.
2462 LINK-COMMAND is a command using the C compiler that you would use to create
2463 a program from several object files.
2465 The following components of LINK-COMMAND are treated specially:
2467 -all-static do not do any dynamic linking at all
2468 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2469 -dlpreopen FILE link in FILE and add its symbols to dld_preloaded_symbols
2470 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2471 -LLIBDIR search LIBDIR for required installed libraries
2472 -lNAME OUTPUT-FILE requires the installed library libNAME
2473 -no-undefined declare that a library does not refer to external symbols
2474 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2475 -release RELEASE specify package release information
2476 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2477 -static do not do any dynamic linking of libtool libraries
2478 -version-info CURRENT[:REVISION[:AGE]]
2479 specify library version info [each variable defaults to 0]
2481 All other options (arguments beginning with \`-') are ignored.
2483 Every other argument is treated as a filename. Files ending in \`.la' are
2484 treated as uninstalled libtool libraries, other files are standard or library
2487 If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
2488 library objects (\`.lo' files) may be specified, and \`-rpath' is required.
2490 If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
2493 If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
2494 created, otherwise an executable program is created."
2499 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2501 Remove libraries from an installation directory.
2503 RM is the name of the program to use to delete files associated with each FILE
2504 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2507 If FILE is a libtool library, all the files associated with it are deleted.
2508 Otherwise, only FILE itself is deleted using RM."
2512 $echo "$modename: invalid operation mode \`$mode'" 1>&2
2519 $echo "Try \`$modename --help' for more information about other modes."