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 # Check that we have a working $echo.
27 if test "X$1" = X--no-reexec
; then
28 # Discard the --no-reexec flag, and continue.
30 elif test "X$1" = X--fallback-echo
; then
31 # used as fallback echo
37 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
38 # Yippee, $echo works!
41 # Restart under the correct shell, and then maybe $echo will work.
42 exec $SHELL "$0" --no-reexec ${1+"$@"}
45 # The name of this program.
46 progname
=`$echo "$0" | sed 's%^.*/%%'`
55 help="Try \`$progname --help' for more information."
56 magic
="%%%MAGIC variable%%%"
61 # Sed substitution that helps us do robust quoting. It backslashifies
62 # metacharacters that are still active within double-quoted strings.
64 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
67 # Only set LANG and LC_ALL to C if already set.
68 # These must not be set unconditionally because not all systems understand
69 # e.g. LANG=C (notably SCO).
70 # We save the old values to restore during execute mode.
71 if test "${LC_ALL+set}" = set; then
72 save_LC_ALL
="$LC_ALL"; LC_ALL
=C
; export LC_ALL
74 if test "${LANG+set}" = set; then
75 save_LANG
="$LANG"; LANG
=C
; export LANG
78 if test "$LTCONFIG_VERSION" != "$VERSION"; then
79 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
80 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
84 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
85 echo "$modename: not configured to build any kind of library" 1>&2
86 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
99 lo2o
="s/\\.lo\$/.${objext}/"
100 los2o
="s/\\.lo /.${objext} /g"
102 # Parse our command line options once, thoroughly.
109 -*=*) optarg
=`$echo "X$arg" | $Xsed -e '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"
141 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
146 echo "$progname: enabling shell trace mode"
156 if test "$build_libtool_libs" = yes; then
157 echo "enable shared libraries"
159 echo "disable shared libraries"
161 if test "$build_old_libs" = yes; then
162 echo "enable static libraries"
164 echo "disable static libraries"
169 --finish) mode
="finish" ;;
171 --mode) prevopt
="--mode" prev
=mode
;;
172 --mode=*) mode
="$optarg" ;;
184 $echo "$modename: unrecognized option \`$arg'" 1>&2
196 if test -n "$prevopt"; then
197 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
202 if test -z "$show_help"; then
204 # Infer the operation mode.
205 if test -z "$mode"; then
207 *cc |
*++ | gcc
* |
*-gcc*)
219 *db |
*dbx |
*strace |
*truss
)
229 # If we have no mode, but dlfiles were specified, then do execute mode.
230 test -n "$execute_dlfiles" && mode
=execute
232 # Just use the default operation mode.
233 if test -z "$mode"; then
234 if test -n "$nonopt"; then
235 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
237 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
244 # Only execute mode is allowed to have -dlopen flags.
245 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
246 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
251 # Change the help message to a mode-specific one.
253 help="Try \`$modename --help --mode=$mode' for more information."
255 # These modes are in order of execution frequency so that they run quickly.
257 # libtool compile mode
259 modename
="$modename: compile"
260 # Get the compilation command and the source file.
270 # Accept any command-line options.
273 if test "$user_target" != "no"; then
274 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
291 case "$user_target" in
293 # The next one is the -o target name
298 # We got the output file
305 # Accept the current argument as the source file.
309 # Aesthetically quote the previous argument.
311 # Backslashify any backslashes, double quotes, and dollar signs.
312 # These are the only characters that are still specially
313 # interpreted inside of double-quoted scrings.
314 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
316 # Double-quote args containing other shell metacharacters.
317 # Many Bourne shells cannot handle close brackets correctly in scan
318 # sets, so we specify it separately.
320 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
321 lastarg
="\"$lastarg\""
325 # Add the previous argument to base_compile.
326 if test -z "$base_compile"; then
327 base_compile
="$lastarg"
329 base_compile
="$base_compile $lastarg"
333 case "$user_target" in
337 # Get the name of the library object.
338 libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
341 $echo "$modename: you must specify a target with \`-o'" 1>&2
346 # Recognize several different file suffixes.
347 # If the user specifies -o file.o, it is replaced with file.lo
362 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
365 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
367 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
372 if test -z "$base_compile"; then
373 $echo "$modename: you must specify a compilation command" 1>&2
378 # Delete any leftover library objects.
379 if test "$build_old_libs" = yes; then
380 removelist
="$obj $libobj $lockfile"
382 removelist
="$libobj $lockfile"
386 trap "$run $rm $removelist; exit 1" 1 2 15
388 # Calculate the filename of the output object if compiler does
389 # not support -o with -c
390 if test "$compiler_c_o" = no
; then
391 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.
${objext}
392 lockfile
="$output_obj.lock"
393 removelist
="$removelist $output_obj $lockfile"
394 trap "$run $rm $removelist; exit 1" 1 2 15
400 # Lock this critical section if it is needed
401 # We use this script file to make the link, it avoids creating a new file
402 if test "$need_locks" = yes; then
403 until ln "$0" "$lockfile" 2>/dev
/null
; do
404 $show "Waiting for $lockfile to be removed"
407 elif test "$need_locks" = warn
; then
408 if test -f "$lockfile"; then
410 *** ERROR, $lockfile exists and contains:
411 `cat $lockfile 2>/dev/null`
413 This indicates that another process is trying to use the same
414 temporary object file, and libtool could not work around it because
415 your compiler does not support \`-c' and \`-o' together. If you
416 repeat this compilation, it may succeed, by chance, but you had better
417 avoid parallel builds (make -j) in this platform, or get a better
423 echo $srcfile > "$lockfile"
426 if test -n "$fix_srcfile_path"; then
427 eval srcfile
=\"$fix_srcfile_path\"
430 # Only build a PIC object if we are building libtool libraries.
431 if test "$build_libtool_libs" = yes; then
432 # Without this assignment, base_compile gets emptied.
433 fbsd_hideous_sh_bug
=$base_compile
435 # All platforms use -DPIC, to notify preprocessed assembler code.
436 command="$base_compile$pic_flag -DPIC $srcfile"
437 if test "$compiler_o_lo" = yes; then
438 command="$command -o $libobj"
440 elif test "$compiler_c_o" = yes; then
441 command="$command -o $obj"
446 if $run eval "$command"; then :
448 test -n "$output_obj" && $run $rm $removelist
452 if test "$need_locks" = warn
&&
453 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
455 *** ERROR, $lockfile contains:
456 `cat $lockfile 2>/dev/null`
458 but it should contain:
461 This indicates that another process is trying to use the same
462 temporary object file, and libtool could not work around it because
463 your compiler does not support \`-c' and \`-o' together. If you
464 repeat this compilation, it may succeed, by chance, but you had better
465 avoid parallel builds (make -j) in this platform, or get a better
472 # Just move the object if needed, then go on to compile the next one
473 if test "$compiler_o_lo" = no
&& test x
"$output_obj" != x
"$libobj"; then
474 $show "$mv $output_obj $libobj"
475 if $run $mv $output_obj $libobj; then :
483 # If we have no pic_flag and do not have -force-static,
484 # then copy the object into place and finish.
485 if test -z "$pic_flag" && test "$force_static" = no
; then
486 $show "$LN_S $libobj $obj"
487 if $run $LN_S $libobj $obj; then
496 # Allow error messages only from the first compilation.
497 suppress_output
=' >/dev/null 2>&1'
500 # Only build a position-dependent object if we build old libraries.
501 if test "$build_old_libs" = yes; then
502 command="$base_compile $srcfile"
503 if test "$force_static" = yes; then
504 command="$command -DLIBTOOL_STATIC"
506 if test "$compiler_c_o" = yes; then
507 command="$command -o $obj"
511 # Suppress compiler output if we already did a PIC compilation.
512 command="$command$suppress_output"
514 if $run eval "$command"; then :
520 if test "$need_locks" = warn
&&
521 test x
"`cat $lockfile 2>/dev/null`" != x
"$srcfile"; then
523 *** ERROR, $lockfile contains:
524 `cat $lockfile 2>/dev/null`
526 but it should contain:
529 This indicates that another process is trying to use the same
530 temporary object file, and libtool could not work around it because
531 your compiler does not support \`-c' and \`-o' together. If you
532 repeat this compilation, it may succeed, by chance, but you had better
533 avoid parallel builds (make -j) in this platform, or get a better
540 # Just move the object if needed
541 if test "$compiler_c_o" = no
&& test x
"$output_obj" != x
"$obj"; then
542 $show "$mv $output_obj $obj"
543 if $run $mv $output_obj $obj; then :
552 # Unlock the critical section if it was locked
553 if test "$need_locks" != no
; then
557 # Create an invalid libtool object if no PIC, so that we do not
558 # accidentally link it into a program.
559 if test "$build_libtool_libs" != yes; then
560 $show "echo timestamp > $libobj"
561 $run eval "echo timestamp > \$libobj" ||
exit $?
569 modename
="$modename: link"
570 C_compiler
="$CC" # save it, to compile generated C sources
573 compile_command
="$CC"
574 finalize_command
="$CC"
581 eval lib_search_path
=\"$sys_lib_search_path\"
590 link_against_libtool_libs
=
602 # We need to know -static, to get the right output filenames.
606 -all-static |
-static)
607 if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
608 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
610 build_libtool_libs
=no
617 # See if our shared archives depend on static archives.
618 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
620 # Go through the arguments, transforming them on the way.
621 while test $# -gt 0; do
625 # If the previous option needs an argument, assign it.
626 if test -n "$prev"; then
629 compile_command
="$compile_command @OUTPUT@"
630 finalize_command
="$finalize_command @OUTPUT@"
637 *.la |
*.lo
) ;; # We handle these cases below.
639 dlprefiles
="$dlprefiles $arg"
640 test "$prev" = dlfiles
&& dlfiles
="$dlfiles $arg"
646 export_symbols
="$arg"
647 if test ! -f "$arg"; then
648 $echo "$modename: symbol file \`$arg' does not exist"
664 eval "$prev=\"\$arg\""
675 if test -n "$link_static_flag"; then
676 compile_command
="$compile_command $link_static_flag"
677 finalize_command
="$finalize_command $link_static_flag"
683 # FIXME: remove this flag sometime in the future.
684 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
699 if test "$export_dynamic" != yes; then
701 if test -n "$export_dynamic_flag_spec"; then
702 eval arg
=\"$export_dynamic_flag_spec\"
707 # Add the symbol object into the linking commands.
708 compile_command
="$compile_command @SYMFILE@"
709 finalize_command
="$finalize_command @SYMFILE@"
714 if test -n "$export_symbols"; then
715 $echo "$modename: cannot have more than one -exported-symbols"
723 dir
=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
725 /* |
[A-Za-z
]:[/\\]*)
726 # Add the corresponding hardcode_libdir_flag, if it is not identical.
729 $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
733 deplibs
="$deplibs $arg"
734 lib_search_path
="$lib_search_path `expr $arg : '-L\(.*\)'`"
737 -l*) deplibs
="$deplibs $arg" ;;
740 if test "$module" != yes; then
742 if test -n "$export_dynamic_flag_spec"; then
743 eval arg
=\"$export_dynamic_flag_spec\"
768 # If we have no pic_flag, then this is the same as -all-static.
769 if test -z "$pic_flag" && test -n "$link_static_flag"; then
770 compile_command
="$compile_command $link_static_flag"
771 finalize_command
="$finalize_command $link_static_flag"
781 # Some other compiler flag.
783 # Unknown arguments in both finalize_command and compile_command need
784 # to be aesthetically quoted because they are evaled later.
785 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
787 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
793 *.o |
*.obj |
*.a |
*.lib
)
800 if test "$prev" = dlfiles
; then
801 dlfiles
="$dlfiles $arg"
802 if test "$build_libtool_libs" = yes; then
806 # If libtool objects are unsupported, then we need to preload.
811 if test "$prev" = dlprefiles
; then
812 # Preload the old-style object.
813 dlprefiles
="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
816 libobjs
="$libobjs $arg"
820 # A libtool-controlled library.
827 # Check to see that this really is a libtool archive.
828 if (sed -e '2q' $arg |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
830 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
834 # If the library was installed with an old release of libtool,
835 # it will not redefine variable installed.
838 # If there is no directory component, then add one.
840 */* |
*\\*) .
$arg ;;
844 # Get the name of the library we link against.
846 for l
in $old_library $library_names; do
850 if test -z "$linklib"; then
851 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
855 # Find the relevant object directory and library name.
856 name
=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
858 if test "X$installed" = Xyes
; then
861 dir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
862 if test "X$dir" = "X$arg"; then
869 if test -z "$libdir"; then
870 # It is a libtool convenience library, so add in its objects.
871 convenience
="$convenience $dir/$old_library"
872 old_convenience
="$old_convenience $dir/$old_library"
873 deplibs
="$deplibs$dependency_libs"
874 compile_command
="$compile_command $dir/$old_library$dependency_libs"
875 finalize_command
="$finalize_command $dir/$old_library$dependency_libs"
879 # This library was specified with -dlopen.
880 if test "$prev" = dlfiles
; then
881 dlfiles
="$dlfiles $arg"
882 if test -z "$dlname" ||
test "$build_libtool_libs" = no
; then
883 # If there is no dlname or we're linking statically,
884 # we need to preload.
887 # We should not create a dependency on this library, but we
888 # may need any libraries it requires.
889 compile_command
="$compile_command$dependency_libs"
890 finalize_command
="$finalize_command$dependency_libs"
896 # The library was specified with -dlpreopen.
897 if test "$prev" = dlprefiles
; then
898 # Prefer using a static library (so that no silly _DYNAMIC symbols
899 # are required to link).
900 if test -n "$old_library"; then
901 dlprefiles
="$dlprefiles $dir/$old_library"
903 dlprefiles
="$dlprefiles $dir/$linklib"
908 if test "$build_libtool_libs" = yes && test -n "$library_names"; then
909 link_against_libtool_libs
="$link_against_libtool_libs $arg"
910 if test -n "$shlibpath_var"; then
911 # Make sure the rpath contains only unique directories.
912 case "$temp_rpath " in
914 *) temp_rpath
="$temp_rpath $dir" ;;
918 # This is the magic to use -rpath.
919 if test -n "$hardcode_libdir_flag_spec"; then
920 if test -n "$hardcode_libdir_separator"; then
921 if test -z "$hardcode_libdirs"; then
922 # Put the magic libdir with the hardcode flag.
923 hardcode_libdirs
="$libdir"
924 libdir
="@HARDCODE_LIBDIRS@"
926 # Just accumulate the unique libdirs.
927 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
928 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
931 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
938 if test -n "$libdir"; then
939 eval flag
=\"$hardcode_libdir_flag_spec\"
941 compile_command
="$compile_command $flag"
942 finalize_command
="$finalize_command $flag"
944 elif test -n "$runpath_var"; then
945 # Do the same for the permanent run path.
946 case "$perm_rpath " in
948 *) perm_rpath
="$perm_rpath $libdir" ;;
954 case "$hardcode_action" in
955 immediate | unsupported
)
956 if test "$hardcode_direct" = no
; then
957 compile_command
="$compile_command $dir/$linklib"
958 elif test "$hardcode_minus_L" = no
; then
961 compile_shlibpath
="$compile_shlibpath$dir:"
964 compile_command
="$compile_command -L$dir -l$name"
965 elif test "$hardcode_shlibpath_var" = no
; then
966 compile_shlibpath
="$compile_shlibpath$dir:"
967 compile_command
="$compile_command -l$name"
974 # We need an absolute path.
976 /* |
[A-Za-z
]:[/\\]*) ;;
978 absdir
=`cd "$dir" && pwd`
979 if test -z "$absdir"; then
980 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
987 if test "$hardcode_direct" = yes; then
988 compile_command
="$compile_command $dir/$linklib"
989 elif test "$hardcode_minus_L" = yes; then
990 compile_command
="$compile_command -L$dir -l$name"
991 elif test "$hardcode_shlibpath_var" = yes; then
992 compile_shlibpath
="$compile_shlibpath$dir:"
993 compile_command
="$compile_command -l$name"
1004 if test "$lib_linked" != yes; then
1005 $echo "$modename: configuration error: unsupported hardcode properties"
1009 # Finalize command for both is simple: just hardcode it.
1010 if test "$hardcode_direct" = yes; then
1011 finalize_command
="$finalize_command $libdir/$linklib"
1012 elif test "$hardcode_minus_L" = yes; then
1013 finalize_command
="$finalize_command -L$libdir -l$name"
1014 elif test "$hardcode_shlibpath_var" = yes; then
1015 finalize_shlibpath
="$finalize_shlibpath$libdir:"
1016 finalize_command
="$finalize_command -l$name"
1018 # We cannot seem to hardcode it, guess we'll fake it.
1019 finalize_command
="$finalize_command -L$libdir -l$name"
1022 # Transform directly to old archives if we don't build new libraries.
1023 if test -n "$pic_flag" && test -z "$old_library"; then
1024 $echo "$modename: cannot find static library for \`$arg'" 1>&2
1028 # Here we assume that one of hardcode_direct or hardcode_minus_L
1029 # is not unsupported. This is valid on all known static and
1031 if test "$hardcode_direct" != unsupported
; then
1032 test -n "$old_library" && linklib
="$old_library"
1033 compile_command
="$compile_command $dir/$linklib"
1034 finalize_command
="$finalize_command $dir/$linklib"
1036 compile_command
="$compile_command -L$dir -l$name"
1037 finalize_command
="$finalize_command -L$dir -l$name"
1041 # Add in any libraries that this one depends upon.
1042 compile_command
="$compile_command$dependency_libs"
1043 finalize_command
="$finalize_command$dependency_libs"
1047 # Some other compiler argument.
1049 # Unknown arguments in both finalize_command and compile_command need
1050 # to be aesthetically quoted because they are evaled later.
1051 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1053 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1060 # Now actually substitute the argument into the commands.
1061 if test -n "$arg"; then
1062 compile_command
="$compile_command $arg"
1063 finalize_command
="$finalize_command $arg"
1067 if test -n "$prev"; then
1068 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1073 if test -n "$export_symbols" && test "$module" = yes; then
1074 $echo "$modename: \`-export-symbols' is not supported for modules"
1079 # calculate the name of the file, without its directory
1080 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1084 $echo "$modename: you must specify an output file" 1>&2
1090 if test -n "$link_against_libtool_libs"; then
1091 $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
1095 if test -n "$deplibs"; then
1096 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1099 if test -n "$dlfiles$dlprefiles"; then
1100 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1103 if test -n "$rpath"; then
1104 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
1107 if test -n "$vinfo"; then
1108 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1111 if test -n "$release"; then
1112 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
1115 if test -n "$export_symbols"; then
1116 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1119 # Now set the variables for building old libraries.
1120 build_libtool_libs
=no
1125 # Make sure we only generate libraries of the form `libNAME.la'.
1126 case "$outputname" in
1129 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
1135 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1136 eval libname
=\"$libname_spec\"
1138 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1139 if test "X$output_objdir" = "X$output"; then
1140 output_objdir
="$objdir"
1142 output_objdir
="$output_objdir/$objdir"
1145 # All the library-specific variables (install_libdir is set above).
1150 if test -n "$objs"; then
1151 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1155 # How the heck are we supposed to write a wrapper for a shared library?
1156 if test -n "$link_against_libtool_libs"; then
1157 $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
1161 if test -n "$dlfiles$dlprefiles"; then
1162 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1166 if test $# -gt 2; then
1167 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1172 if test -z "$rpath"; then
1173 # Building a libtool convenience library.
1175 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
1176 build_libtool_libs
=convenience
1177 dependency_libs
="$deplibs"
1179 if test -n "$vinfo"; then
1180 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1183 if test -n "$release"; then
1184 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1188 # Parse the version information argument.
1189 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
=':'
1190 set dummy
$vinfo 0 0 0
1193 if test -n "$8"; then
1194 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1203 # Check that each of the things are valid numbers.
1205 0 |
[1-9] |
[1-9][0-9]*) ;;
1207 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1208 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1214 0 |
[1-9] |
[1-9][0-9]*) ;;
1216 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1217 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1223 0 |
[1-9] |
[1-9][0-9]*) ;;
1225 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1226 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1231 if test $age -gt $current; then
1232 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1233 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1237 # Calculate the version variables.
1241 case "$version_type" in
1245 major
=.
`expr $current - $age`
1246 versuffix
="$major.$age.$revision"
1250 major
=`expr $current - $age`
1251 versuffix
=".$current.$age.$revision"
1252 verstring
="$current.$age.$revision"
1254 # Add in all the interfaces that we are compatible with.
1256 while test $loop != 0; do
1257 iface
=`expr $current - $loop`
1258 loop
=`expr $loop - 1`
1259 verstring
="$verstring:${iface}.0"
1262 # Make executables depend on our current version.
1263 verstring
="$verstring:${current}.0"
1268 versuffix
=".$current.$revision"
1273 versuffix
=".$current.$revision";
1278 versuffix
=".$current";
1282 # Like Linux, but with '-' rather than '.', since we only
1283 # want one extension on Windows 95.
1284 major
=`expr $current - $age`
1285 versuffix
="-$major-$age-$revision"
1289 $echo "$modename: unknown library version type \`$version_type'" 1>&2
1290 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
1295 # Clear the version info if we defaulted, and they specified a release.
1296 if test -z "$vinfo" && test -n "$release"; then
1307 # Check to see if the archive will have undefined symbols.
1308 if test "$allow_undefined" = yes; then
1309 if test "$allow_undefined_flag" = unsupported
; then
1310 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
1311 build_libtool_libs
=no
1315 # Don't allow undefined symbols.
1316 allow_undefined_flag
="$no_undefined_flag"
1319 # Add libc to deplibs on all systems.
1320 dependency_libs
="$deplibs"
1321 deplibs
="$deplibs -lc"
1324 # Create the output directory, or remove our outputs if we need to.
1325 if test -d $output_objdir; then
1326 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
1327 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.
*
1329 $show "$mkdir $output_objdir"
1330 $run $mkdir $output_objdir
1332 if test $status -ne 0 && test ! -d $output_objdir; then
1337 # Now set the variables for building old libraries.
1338 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
1339 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
1341 # Transform .lo files to .o files.
1342 oldobjs
="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.'${libext}' //g' -e "$los2o" -e 's/ $//g'`
1345 if test "$build_libtool_libs" = yes; then
1346 # Transform deplibs into only deplibs that can be linked in shared.
1347 ## Gordon: Do you check for the existence of the libraries in deplibs
1348 ## on the system? That should maybe be merged in here someplace....
1349 ## Actually: I think test_compile and file_magic do this... file_regex
1350 ## sorta does this. Only pas_all needs to be changed. -Toshio
1352 libname_save
=$libname
1353 release_save
=$release
1354 versuffix_save
=$versuffix
1356 # I'm not sure if I'm treating the release correctly. I think
1357 # release should show up in the -l (ie -lgmp5) so we don't want to
1358 # add it in twice. Is that correct?
1363 case "$check_shared_deplibs_method" in
1366 ;; # Don't check for shared/static. Everything works.
1367 # This might be a little naive. We might want to check
1368 # whether the library exists or not. But this is on
1369 # osf3 & osf4 and I'm not really sure... Just
1370 # implementing what was already the behaviour.
1372 # This code stresses the "libraries are programs" paradigm to its
1373 # limits. Maybe even breaks it. We compile a program, linking it
1374 # against the deplibs as a proxy for the library. Then we can check
1375 # whether they linked in statically or dynamically with ldd.
1377 cat > conftest.c
<<EOF
1378 int main() { return 0; }
1381 $C_compiler conftest.c
$deplibs
1382 if test $?
-eq 0 ; then
1383 ldd_output
=`ldd a.out`
1384 for i
in $deplibs; do
1385 name
="`expr $i : '-l\(.*\)'`"
1386 # If $name is empty we are operating on a -L argument.
1387 if test "$name" != "" ; then
1388 libname
=`eval \\$echo \"$libname_spec\"`
1389 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
1390 set dummy
$deplib_matches
1392 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1393 newdeplibs
="$newdeplibs $i"
1396 echo "*** Warning: This library needs some functionality provided by $i."
1397 echo "*** I have the capability to make that library automatically link in when"
1398 echo "*** you link to this library. But I can only do this if you have a"
1399 echo "*** shared version of the library, which you do not appear to have."
1402 newdeplibs
="$newdeplibs $i"
1406 # Error occured in the first compile. Let's try to salvage the situation:
1407 # Compile a seperate program for each library.
1408 for i
in $deplibs; do
1409 name
="`expr $i : '-l\(.*\)'`"
1410 # If $name is empty we are operating on a -L argument.
1411 if test "$name" != "" ; then
1413 $C_compiler conftest.c
$i
1415 if test $?
-eq 0 ; then
1416 ldd_output
=`ldd a.out`
1417 libname
=`eval \\$echo \"$libname_spec\"`
1418 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
1419 set dummy
$deplib_matches
1421 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
1422 newdeplibs
="$newdeplibs $i"
1425 echo "*** Warning: This library needs some functionality provided by $i."
1426 echo "*** I have the capability to make that library automatically link in when"
1427 echo "*** you link to this library. But I can only do this if you have a"
1428 echo "*** shared version of the library, which you do not appear to have."
1432 echo "*** Warning! Library $i is needed by this library but I was not able to"
1433 echo "*** make it link in! You will probably need to install it or some"
1434 echo "*** library that it depends on before this library will be fully"
1435 echo "*** functional. Installing it before continuing would be even better."
1438 newdeplibs
="$newdeplibs $i"
1444 file_magic
* | file_regex
)
1445 set dummy
$check_shared_deplibs_method
1446 file_magic_regex
="`expr \"$check_shared_deplibs_method\" : \"$2\(.*\)\"`"
1447 for a_deplib
in $deplibs; do
1448 name
="`expr $a_deplib : '-l\(.*\)'`"
1449 # If $name is empty we are operating on a -L argument.
1450 if test "$name" != "" ; then
1451 libname
=`eval \\$echo \"$libname_spec\"`
1452 case "$check_shared_deplibs_method" in
1454 for i
in $lib_search_path; do
1455 # This needs to be more general than file_regex in order to
1456 # catch things like glibc on linux. Maybe file_regex
1457 # should be more general as well, but maybe not. Since
1458 # library names are supposed to conform to
1459 # library_name_spec, I think file_regex should remain
1460 # strict. What do you think Gordon?
1461 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
1462 for potent_lib
in $potential_libs; do
1463 file_output
=`file $potent_lib`
1464 if test `expr "$file_output" : ".*$file_magic_regex"` -ne 0 ; then
1465 newdeplibs
="$newdeplibs $a_deplib"
1473 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
1474 set dummy
$deplib_matches
1476 for i
in $lib_search_path; do
1477 potential_libs
=`ls $i/$deplib_match* 2>/dev/null`
1478 if test "$potential_libs" != "" ; then
1479 newdeplibs
="$newdeplibs $a_deplib"
1486 if test "$a_deplib" != "" ; then
1488 echo "*** Warning: This library needs some functionality provided by $a_deplib."
1489 echo "*** I have the capability to make that library automatically link in when"
1490 echo "*** you link to this library. But I can only do this if you have a"
1491 echo "*** shared version of the library, which you do not appear to have."
1494 # Add a -L argument.
1495 newdeplibs
="$newdeplibs $a_deplib"
1497 done # Gone through all deplibs.
1499 none |
*) deplibs
="" ;;
1501 versuffix
=$versuffix_save
1503 release
=$release_save
1504 libname
=$libname_save
1507 # Done checking deplibs!
1509 # Get the real and link names of the library.
1510 eval library_names
=\"$library_names_spec\"
1511 set dummy
$library_names
1515 if test -n "$soname_spec"; then
1516 eval soname
=\"$soname_spec\"
1521 lib
="$output_objdir/$realname"
1524 linknames
="$linknames $link"
1527 # Use standard objects if they are PIC.
1528 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs " | $Xsed -e "$los2o" -e 's/ $//g'`
1530 if test -n "$whole_archive_flag_spec"; then
1531 if test -n "$convenience"; then
1532 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
1535 for xlib
in $convenience; do
1536 # Extract the objects.
1538 generated
="$generated $xdir"
1539 xlib
=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
1541 $show "${rm}r $xdir"
1546 if test $status -ne 0 && test ! -d "$xdir"; then
1549 $show "(cd $xdir && $AR x ../$xlib)"
1550 $run eval "(cd \$xdir && $AR x ../\$xlib)" ||
exit $?
1552 libobjs
="$libobjs `echo $xdir/*`"
1556 # Do each of the archive commands.
1557 if test -n "$export_symbols" && test -n "$archive_sym_cmds"; then
1558 eval cmds
=\"$archive_sym_cmds\"
1560 eval cmds
=\"$archive_cmds\"
1562 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
1563 for cmd
in $cmds; do
1566 $run eval "$cmd" ||
exit $?
1570 # Create links to the real library.
1571 for linkname
in $linknames; do
1572 if test "$realname" != "$linkname"; then
1573 $show "(cd $output_objdir && $LN_S $realname $linkname)"
1574 $run eval '(cd $output_objdir && $LN_S $realname $linkname)' ||
exit $?
1578 # If -module or -export-dynamic was specified, set the dlname.
1579 if test "$module" = yes ||
test "$export_dynamic" = yes; then
1580 # On all known operating systems, these are identical.
1587 if test -n "$link_against_libtool_libs"; then
1588 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
1592 if test -n "$deplibs"; then
1593 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
1596 if test -n "$dlfiles$dlprefiles"; then
1597 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
1600 if test -n "$rpath"; then
1601 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
1604 if test -n "$vinfo"; then
1605 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
1608 if test -n "$release"; then
1609 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
1614 if test -n "$objs"; then
1615 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
1619 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
1627 # Delete the old objects.
1628 $run $rm $obj $libobj
1630 # Create the old-style object.
1631 reload_objs
="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.'${libext}' //g' -e 's/[^ ]*\.lib //g' -e "$los2o" -e 's/ $//g'`
1634 eval cmds
=\"$reload_cmds\"
1635 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
1636 for cmd
in $cmds; do
1639 $run eval "$cmd" ||
exit $?
1643 # Exit if we aren't doing a library object file.
1644 test -z "$libobj" && exit 0
1646 if test "$build_libtool_libs" != yes; then
1647 # Create an invalid libtool object if no PIC, so that we don't
1648 # accidentally link it into a program.
1649 $show "echo timestamp > $libobj"
1650 $run eval "echo timestamp > $libobj" ||
exit $?
1654 if test -n "$pic_flag"; then
1655 # Only do commands if we really have different PIC objects.
1656 reload_objs
="$libobjs"
1658 eval cmds
=\"$reload_cmds\"
1659 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
1660 for cmd
in $cmds; do
1663 $run eval "$cmd" ||
exit $?
1667 # Just create a symlink.
1668 $show "$LN_S $obj $libobj"
1669 $run $LN_S $obj $libobj ||
exit $?
1675 # Anything else should be a program.
1677 if test -n "$vinfo"; then
1678 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
1681 if test -n "$release"; then
1682 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
1685 if test -n "$rpath"; then
1686 # If the user specified any rpath flags, then add them.
1687 for libdir
in $rpath; do
1688 if test -n "$hardcode_libdir_flag_spec"; then
1689 if test -n "$hardcode_libdir_separator"; then
1690 if test -z "$hardcode_libdirs"; then
1691 # Put the magic libdir with the hardcode flag.
1692 hardcode_libdirs
="$libdir"
1693 libdir
="@HARDCODE_LIBDIRS@"
1695 # Just accumulate the unique libdirs.
1696 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
1697 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
1700 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
1707 if test -n "$libdir"; then
1708 eval flag
=\"$hardcode_libdir_flag_spec\"
1710 compile_command
="$compile_command $flag"
1711 finalize_command
="$finalize_command $flag"
1713 elif test -n "$runpath_var"; then
1714 case "$perm_rpath " in
1716 *) perm_rpath
="$perm_rpath $libdir" ;;
1722 # Substitute the hardcoded libdirs into the compile commands.
1723 if test -n "$hardcode_libdir_separator"; then
1724 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1725 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
1728 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1729 if test "X$output_objdir" = "X$output"; then
1730 output_objdir
="$objdir"
1732 output_objdir
="$output_objdir/$objdir"
1735 if test -n "$libobjs" && test "$build_old_libs" = yes; then
1736 # Transform all the library objects into standard objects.
1737 compile_command
=`$echo "X$compile_command " | $Xsed -e "$los2o" -e 's/ $//'`
1738 finalize_command
=`$echo "X$finalize_command " | $Xsed -e "$los2o" -e 's/ $//'`
1741 if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
1742 dlsyms
="${outputname}S.c"
1747 if test -n "$dlsyms"; then
1751 if test -z "$export_symbols"; then
1752 # Add our own program objects to the preloaded list.
1753 dlprefiles
=`$echo "X$objs$dlprefiles " | $Xsed -e "$los2o" -e 's/ $//'`
1756 # Discover the nlist of each of the dlfiles.
1757 nlist
="$objdir/${output}.nm"
1759 if test -d $objdir; then
1760 $show "$rm $nlist ${nlist}T"
1761 $run $rm "$nlist" "${nlist}T"
1763 $show "$mkdir $objdir"
1766 if test $status -ne 0 && test ! -d $objdir; then
1771 # Parse the name list into a source file.
1772 $show "creating $objdir/$dlsyms"
1774 $echo > "$objdir/$dlsyms" "\
1775 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
1776 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
1782 /* Prevent the only kind of declaration conflicts we can make. */
1783 #define dld_preloaded_symbols some_other_symbol
1785 /* External symbol declarations for the compiler. */\
1788 if test -n "$export_symbols"; then
1789 sed -e 's/^\(.*\)/\1 \1/' < "$export_symbols" > "$nlist"
1792 for arg
in $dlprefiles; do
1793 $show "extracting global C symbols from \`$arg'"
1794 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
1797 if test -z "$run"; then
1798 # Make sure we at least have an empty file.
1799 test -f "$nlist" ||
: > "$nlist"
1801 # Try sorting and uniquifying the output.
1802 if sort "$nlist" |
uniq > "$nlist"T
; then
1803 mv -f "$nlist"T
"$nlist"
1808 if test -f "$nlist"; then
1809 sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$output_objdir/$dlsyms"
1811 echo '/* NONE */' >> "$output_objdir/$dlsyms"
1814 $echo >> "$output_objdir/$dlsyms" "\
1816 #undef dld_preloaded_symbols
1818 #if defined (__STDC__) && __STDC__
1819 # define __ptr_t void *
1821 # define __ptr_t char *
1824 /* The mapping between symbol names and symbols. */
1829 dld_preloaded_symbols[] =
1833 if test -n "$export_symbols"; then
1834 echo >> "$objdir/$dlsyms" "\
1835 {\"${output}\", (__ptr_t) 0},"
1836 sed 's/^\(.*\)/ {"\1", (__ptr_t) \&\1},/' < "$export_symbols" >> "$objdir/$dlsyms"
1839 for arg
in $dlprefiles; do
1840 name
=`echo "$arg" | sed -e 's%^.*/%%'`
1841 echo >> "$objdir/$dlsyms" "\
1842 {\"$name\", (__ptr_t) 0},"
1843 eval "$NM $arg | $global_symbol_pipe > '$nlist'"
1845 if test -f "$nlist"; then
1846 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
1848 echo '/* NONE */' >> "$output_objdir/$dlsyms"
1853 if test -f "$nlist"; then
1854 sed 's/^\(.*\) \(.*\)$/ {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms"
1857 $echo >> "$output_objdir/$dlsyms" "\
1867 # Now compile the dynamic symbol file.
1868 $show "(cd $objdir && $C_compiler -c$no_builtin_flag \"$dlsyms\")"
1869 $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag "$dlsyms")' ||
exit $?
1871 # Transform the symbol file into the correct name.
1872 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
1873 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
1876 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
1880 elif test "$export_dynamic" != yes; then
1881 test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
1883 # We keep going just in case the user didn't refer to
1884 # dld_preloaded_symbols. The linker will fail if global_symbol_pipe
1885 # really was required.
1886 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
1888 # Nullify the symbol file.
1889 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
1890 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
1893 if test -z "$link_against_libtool_libs" ||
test "$build_libtool_libs" != yes; then
1894 # Replace the output file specification.
1895 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
1896 finalize_command
=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
1898 # We have no uninstalled library dependencies, so finalize right now.
1899 $show "$compile_command"
1900 $run eval "$compile_command"
1904 # Replace the output file specification.
1905 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
1906 finalize_command
=`$echo "X$finalize_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'T%g'`
1908 # Create the binary in the object directory, then wrap it.
1909 if test ! -d $output_objdir; then
1910 $show "$mkdir $output_objdir"
1911 $run $mkdir $output_objdir
1913 if test $status -ne 0 && test ! -d $objdir; then
1918 if test -n "$shlibpath_var"; then
1919 # We should set the shlibpath_var
1921 for dir
in $temp_rpath; do
1923 /* |
[A-Za-z
]:[/\\]*)
1928 # Relative path: add a thisdir entry.
1929 rpath
="$rpath\$thisdir/$dir:"
1936 # Delete the old output file.
1939 if test -n "$compile_shlibpath"; then
1940 compile_command
="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
1942 if test -n "$finalize_shlibpath"; then
1943 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
1946 if test -n "$runpath_var" && test -n "$perm_rpath"; then
1947 # We should set the runpath_var.
1949 for dir
in $perm_rpath; do
1952 compile_command
="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
1953 finalize_command
="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
1956 if test "$hardcode_action" = relink
; then
1957 # AGH! Flame the AIX and HP-UX people for me, will ya?
1958 $echo "$modename: warning: this platform doesn\'t like uninstalled shared libraries" 1>&2
1959 $echo "$modename: \`$output' will be relinked during installation" 1>&2
1962 $show "$compile_command"
1963 $run eval "$compile_command" ||
exit $?
1965 # Now create the wrapper script.
1966 $show "creating $output"
1968 # Quote the finalize command for shipping.
1969 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "$sed_quote_subst"`
1971 # Quote $echo for shipping.
1972 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
1974 /* |
[A-Za-z
]:[/\\]*) qecho
="$SHELL $0 --fallback-echo";;
1975 *) qecho
="$SHELL `pwd`/$0 --fallback-echo";;
1977 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
1979 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
1982 # Only actually do things if our run command is non-null.
1983 if test -z "$run"; then
1985 trap "$rm $output; exit 1" 1 2 15
1990 # $output - temporary wrapper script for $objdir/$outputname
1991 # Generated by $PROGRAM - GNU $PACKAGE $VERSION
1993 # The $output program cannot be directly executed until all the libtool
1994 # libraries that it depends on are installed.
1996 # This wrapper script should never be moved out of the build directory.
1997 # If it is, it will not operate correctly.
1999 # Sed substitution that helps us do robust quoting. It backslashifies
2000 # metacharacters that are still active within double-quoted strings.
2001 Xsed='sed -e s/^X//'
2002 sed_quote_subst='$sed_quote_subst'
2004 # The HP-UX ksh and POSIX shell print the target directory to stdout
2006 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
2008 # This environment variable determines our operation mode.
2009 if test \"\$libtool_install_magic\" = \"$magic\"; then
2010 # install mode needs the following variables:
2011 link_against_libtool_libs='$link_against_libtool_libs'
2012 finalize_command=\"cd `pwd | sed -e $sed_quote_subst`; $finalize_command\"
2014 # When we are sourced in execute mode, \$file and \$echo are already set.
2015 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2018 # Make sure echo works.
2019 if test \"X\$1\" = X--no-reexec; then
2020 # Discard the --no-reexec flag, and continue.
2022 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
2023 # Yippee, \$echo works!
2026 # Restart under the correct shell, and then maybe \$echo will work.
2027 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2033 # Find the directory that this script lives in.
2034 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2035 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2037 # Follow symbolic links until we get to the real thisdir.
2038 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
2039 while test -n \"\$file\"; do
2040 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2042 # If there was a directory component, then change thisdir.
2043 if test \"x\$destdir\" != \"x\$file\"; then
2044 case \"\$destdir\" in
2045 /* | [A-Za-z]:[/\\]*) thisdir=\"\$destdir\" ;;
2046 *) thisdir=\"\$thisdir/\$destdir\" ;;
2050 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2051 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
2054 # Try to get the absolute directory name.
2055 absdir=\`cd \"\$thisdir\" && pwd\`
2056 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2058 progdir=\"\$thisdir/$objdir\"
2059 program='$outputname'
2061 if test -f \"\$progdir/\$program\"; then"
2063 # Export our shlibpath_var if we have one.
2064 if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2066 # Add our own library path to $shlibpath_var
2067 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2069 # Some systems cannot cope with colon-terminated $shlibpath_var
2070 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/:*\$//'\`
2072 export $shlibpath_var
2077 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2078 # Run the actual program with our arguments.
2080 # Export the path to the program.
2081 PATH=\"\$progdir:\$PATH\"
2084 exec \$program \${1+\"\$@\"}
2086 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
2090 # The program doesn't exist.
2091 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
2092 \$echo \"This script is just a wrapper for \$program.\" 1>&2
2093 echo \"See the $PACKAGE documentation for more information.\" 1>&2
2104 # See if we need to build an old-fashioned archive.
2105 for oldlib
in $oldlibs; do
2107 if test "$build_libtool_libs" = convenience
; then
2109 addlibs
="$convenience"
2110 build_libtool_libs
=no
2112 oldobjs
="$objs"`$echo "X$libobjs " | $Xsed -e 's/[^ ]*\.'${libext}' //g' -e 's/[^ ]*\.lib //g' -e "$los2o" -e 's/ $//g'`
2113 addlibs
="$old_convenience"
2116 # Add in members from convenience archives.
2117 for xlib
in $addlibs; do
2118 # Extract the objects.
2120 generated
="$generated $xdir"
2121 xlib
=`echo "$xlib" | $Xsed -e 's%^.*/%%'`
2123 $show "${rm}r $xdir"
2128 if test $status -ne 0 && test ! -d "$xdir"; then
2131 $show "(cd $xdir && $AR x ../$xlib)"
2132 $run eval "(cd \$xdir && $AR x ../\$xlib)" ||
exit $?
2134 oldobjs
="$oldobjs `echo $xdir/*`"
2137 # Do each command in the archive commands.
2138 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
2139 eval cmds
=\"$old_archive_from_new_cmds\"
2141 eval cmds
=\"$old_archive_cmds\"
2143 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2144 for cmd
in $cmds; do
2147 $run eval "$cmd" ||
exit $?
2152 if test -n "$generated"; then
2153 $show "${rm}r$generated"
2154 $run ${rm}r
$generated
2157 # Now create the libtool archive.
2161 test "$build_old_libs" = yes && old_library
="$libname.$libext"
2162 $show "creating $output"
2164 # Only create the output if not a dry run.
2165 if test -z "$run"; then
2167 # $output - a libtool library file
2168 # Generated by $PROGRAM - GNU $PACKAGE $VERSION
2170 # The name that we can dlopen(3).
2173 # Names of this library.
2174 library_names='$library_names'
2176 # The name of the static archive.
2177 old_library='$old_library'
2179 # Libraries that this one depends upon.
2180 dependency_libs='$dependency_libs'
2182 # Version information for $libname.
2187 # Is this an already installed library?
2190 # Directory that this library needs to be installed in:
2191 libdir='$install_libdir'\
2195 # Do a symbolic link so that the libtool archive can be found in
2196 # LD_LIBRARY_PATH before the program is installed.
2197 $show "(cd $output_objdir && $LN_S ../$outputname $outputname)"
2198 $run eval "(cd $output_objdir && $LN_S ../$outputname $outputname)" ||
exit $?
2204 # libtool install mode
2206 modename
="$modename: install"
2208 # There may be an optional sh(1) argument at the beginning of
2209 # install_prog (especially on Windows NT).
2210 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh
; then
2211 # Aesthetically quote it.
2212 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
2214 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
2218 install_prog
="$arg "
2226 # The real first argument should be the name of the installation program.
2227 # Aesthetically quote it.
2228 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2230 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
2234 install_prog
="$install_prog$arg"
2236 # We need to accept at least all the BSD install flags.
2246 if test -n "$dest"; then
2247 files
="$files $dest"
2265 # If the previous option needed an argument, then skip it.
2266 if test -n "$prev"; then
2275 # Aesthetically quote the argument.
2276 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2278 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
2282 install_prog
="$install_prog $arg"
2285 if test -z "$install_prog"; then
2286 $echo "$modename: you must specify an install program" 1>&2
2291 if test -n "$prev"; then
2292 $echo "$modename: the \`$prev' option requires an argument" 1>&2
2297 if test -z "$files"; then
2298 if test -z "$dest"; then
2299 $echo "$modename: no file or destination specified" 1>&2
2301 $echo "$modename: you must specify a destination" 1>&2
2307 # Strip any trailing slash from the destination.
2308 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
2310 # Check to see that the destination is a directory.
2311 test -d "$dest" && isdir
=yes
2312 if test "$isdir" = yes; then
2316 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
2317 test "X$destdir" = "X$dest" && destdir
=.
2318 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
2320 # Not a directory, so check to see that there is only one file specified.
2322 if test $# -gt 2; then
2323 $echo "$modename: \`$dest' is not a directory" 1>&2
2329 /* |
[A-Za-z
]:[/\\]*) ;;
2331 for file in $files; do
2335 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
2344 # This variable tells wrapper scripts just to set variables rather
2345 # than running their programs.
2346 libtool_install_magic
="$magic"
2351 for file in $files; do
2353 # Do each installation.
2356 # Do the static libraries later.
2357 staticlibs
="$staticlibs $file"
2361 # Check to see that this really is a libtool archive.
2362 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2364 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
2371 # If there is no directory component, then add one.
2373 */* |
*\\*) .
$file ;;
2377 # Add the libdir to current_libdirs if it is the destination.
2378 if test "X$destdir" = "X$libdir"; then
2379 case "$current_libdirs " in
2381 *) current_libdirs
="$current_libdirs $libdir" ;;
2384 # Note the libdir as a future libdir.
2385 case "$future_libdirs " in
2387 *) future_libdirs
="$future_libdirs $libdir" ;;
2391 dir
="`$echo "X
$file" | $Xsed -e 's%/[^/]*$%%'`/"
2392 test "X$dir" = "X$file/" && dir
=
2395 # See the names of the shared library.
2396 set dummy
$library_names
2397 if test -n "$2"; then
2402 # Install the shared library and build the symlinks.
2403 $show "$install_prog $dir/$realname $destdir/$realname"
2404 $run eval "$install_prog $dir/$realname $destdir/$realname" ||
exit $?
2405 test "X$dlname" = "X$realname" && dlname
=
2407 if test $# -gt 0; then
2408 # Delete the old symlinks, and create new ones.
2411 test "X$dlname" = "X$linkname" && dlname
=
2412 if test "$linkname" != "$realname"; then
2413 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
2414 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
2419 if test -n "$dlname"; then
2420 # Install the dynamically-loadable library.
2421 $show "$install_prog $dir/$dlname $destdir/$dlname"
2422 $run eval "$install_prog $dir/$dlname $destdir/$dlname" ||
exit $?
2425 # Do each command in the postinstall commands.
2426 lib
="$destdir/$realname"
2427 eval cmds
=\"$postinstall_cmds\"
2428 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2429 for cmd
in $cmds; do
2432 $run eval "$cmd" ||
exit $?
2437 # Install the pseudo-library for information purposes.
2438 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2439 instname
="$dir/$name"i
2440 $show "Creating $instname"
2442 sed 's/^installed=no$/installed=yes/' "$file" > "$instname"
2443 $show "$install_prog $instname $destdir/$name"
2444 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
2445 $show "$rm $instname"
2448 # Maybe install the static library, too.
2449 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
2453 # Install (i.e. copy) a libtool object.
2455 # Figure out destination file name, if it wasn't already specified.
2456 if test -n "$destname"; then
2457 destfile
="$destdir/$destname"
2459 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2460 destfile
="$destdir/$destfile"
2463 # Deduce the name of the destination old-style object file.
2466 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
2469 staticdest
="$destfile"
2473 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
2479 # Install the libtool object if requested.
2480 if test -n "$destfile"; then
2481 $show "$install_prog $file $destfile"
2482 $run eval "$install_prog $file $destfile" ||
exit $?
2485 # Install the old object if enabled.
2486 if test "$build_old_libs" = yes; then
2487 # Deduce the name of the old-style object file.
2488 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
2490 $show "$install_prog $staticobj $staticdest"
2491 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
2497 # Figure out destination file name, if it wasn't already specified.
2498 if test -n "$destname"; then
2499 destfile
="$destdir/$destname"
2501 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2502 destfile
="$destdir/$destfile"
2505 # Do a test to see if this is really a libtool program.
2506 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2507 link_against_libtool_libs
=
2510 # If there is no directory component, then add one.
2512 */* |
*\\*) .
$file ;;
2516 # Check the variables that should have been set.
2517 if test -z "$link_against_libtool_libs" ||
test -z "$finalize_command"; then
2518 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
2523 for lib
in $link_against_libtool_libs; do
2524 # Check to see that each library is installed.
2526 if test -f "$lib"; then
2527 # If there is no directory component, then add one.
2529 */* |
*\\*) .
$lib ;;
2533 libfile
="$libdir/`$echo "X
$lib" | $Xsed -e 's%^.*/%%g'`"
2534 if test -n "$libdir" && test ! -f "$libfile"; then
2535 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
2540 if test "$hardcode_action" = relink
; then
2541 if test "$finalize" = yes; then
2542 $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
2543 $show "$finalize_command"
2544 if $run eval "$finalize_command"; then :
2546 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
2549 file="$objdir/$file"T
2551 $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
2554 # Install the binary that we compiled earlier.
2555 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2559 $show "$install_prog$stripme $file $destfile"
2560 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
2565 for file in $staticlibs; do
2566 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2568 # Set up the ranlib parameters.
2569 oldlib
="$destdir/$name"
2571 $show "$install_prog $file $oldlib"
2572 $run eval "$install_prog \$file \$oldlib" ||
exit $?
2574 # Do each command in the postinstall commands.
2575 eval cmds
=\"$old_postinstall_cmds\"
2576 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2577 for cmd
in $cmds; do
2580 $run eval "$cmd" ||
exit $?
2585 if test -n "$future_libdirs"; then
2586 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
2589 if test -n "$current_libdirs"; then
2590 # Maybe just do a dry run.
2591 test -n "$run" && current_libdirs
=" -n$current_libdirs"
2592 exec $SHELL $0 --finish$current_libdirs
2599 # libtool finish mode
2601 modename
="$modename: finish"
2605 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2608 libdirs
="$libdirs $dir"
2611 for libdir
in $libdirs; do
2612 if test -n "$finish_cmds"; then
2613 # Do each command in the finish commands.
2614 eval cmds
=\"$finish_cmds\"
2615 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2616 for cmd
in $cmds; do
2619 $run eval "$cmd" || admincmds
="$admincmds
2624 if test -n "$finish_eval"; then
2625 # Do the single finish_eval.
2626 eval cmds
=\"$finish_eval\"
2627 $run eval "$cmds" || admincmds
="$admincmds
2633 # Exit here if they wanted silent mode.
2634 test "$show" = : && exit 0
2636 echo "----------------------------------------------------------------------"
2637 echo "Libraries have been installed in:"
2638 for libdir
in $libdirs; do
2642 echo "To link against installed libraries in a given directory, LIBDIR,"
2643 echo "you must use the \`-LLIBDIR' flag during linking."
2645 echo " You will also need to do at least one of the following:"
2646 if test -n "$shlibpath_var"; then
2647 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
2648 echo " during execution"
2650 if test -n "$runpath_var"; then
2651 echo " - add LIBDIR to the \`$runpath_var' environment variable"
2652 echo " during linking"
2654 if test -n "$hardcode_libdir_flag_spec"; then
2656 eval flag
=\"$hardcode_libdir_flag_spec\"
2658 echo " - use the \`$flag' linker flag"
2660 if test -n "$admincmds"; then
2661 echo " - have your system administrator run these commands:$admincmds"
2663 if test -f /etc
/ld.so.conf
; then
2664 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2667 echo "See any operating system documentation about shared libraries for"
2668 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2669 echo "----------------------------------------------------------------------"
2673 # libtool execute mode
2675 modename
="$modename: execute"
2677 # The first argument is the command name.
2679 if test -z "$cmd"; then
2680 $echo "$modename: you must specify a COMMAND" 1>&2
2685 # Handle -dlopen flags immediately.
2686 for file in $execute_dlfiles; do
2687 if test ! -f "$file"; then
2688 $echo "$modename: \`$file' is not a file" 1>&2
2696 # Check to see that this really is a libtool archive.
2697 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2699 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2704 # Read the libtool library.
2708 # If there is no directory component, then add one.
2710 */* |
*\\*) .
$file ;;
2714 # Skip this library if it cannot be dlopened.
2715 if test -z "$dlname"; then
2716 # Warn if it was a shared library.
2717 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
2721 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
2722 test "X$dir" = "X$file" && dir
=.
2724 if test -f "$dir/$objdir/$dlname"; then
2727 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
2733 # Just add the directory containing the .lo file.
2734 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
2735 test "X$dir" = "X$file" && dir
=.
2739 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
2744 # Get the absolute pathname.
2745 absdir
=`cd "$dir" && pwd`
2746 test -n "$absdir" && dir
="$absdir"
2748 # Now add the directory to shlibpath_var.
2749 if eval "test -z \"\$$shlibpath_var\""; then
2750 eval "$shlibpath_var=\"\$dir\""
2752 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2756 # This variable tells wrapper scripts just to set shlibpath_var
2757 # rather than running their programs.
2758 libtool_execute_magic
="$magic"
2760 # Check if any of the arguments is a wrapper script.
2767 # Do a test to see if this is really a libtool program.
2768 if (sed -e '4q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2769 # If there is no directory component, then add one.
2771 */* |
*\\*) .
$file ;;
2775 # Transform arg to wrapped name.
2776 file="$progdir/$program"
2780 # Quote arguments (to preserve shell metacharacters).
2781 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
2782 args
="$args \"$file\""
2785 if test -z "$run"; then
2786 # Export the shlibpath_var.
2787 eval "export $shlibpath_var"
2789 # Restore saved enviroment variables
2790 if test "${save_LC_ALL+set}" = set; then
2791 LC_ALL
="$save_LC_ALL"; export LC_ALL
2793 if test "${save_LANG+set}" = set; then
2794 LANG
="$save_LANG"; export LANG
2797 # Now actually exec the command.
2798 eval "exec \$cmd$args"
2800 $echo "$modename: cannot exec \$cmd$args"
2803 # Display what would be done.
2804 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
2805 $echo "export $shlibpath_var"
2811 # libtool uninstall mode
2813 modename
="$modename: uninstall"
2820 -*) rm="$rm $arg" ;;
2821 *) files
="$files $arg" ;;
2825 if test -z "$rm"; then
2826 $echo "$modename: you must specify an RM program" 1>&2
2831 for file in $files; do
2832 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
2833 test "X$dir" = "X$file" && dir
=.
2834 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
2840 # Possibly a libtool archive, so verify it.
2841 if (sed -e '2q' $file |
egrep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2844 # Delete the libtool libraries and symlinks.
2845 for n
in $library_names; do
2846 rmfiles
="$rmfiles $dir/$n"
2847 test "X$n" = "X$dlname" && dlname
=
2849 test -n "$dlname" && rmfiles
="$rmfiles $dir/$dlname"
2850 test -n "$old_library" && rmfiles
="$rmfiles $dir/$old_library"
2852 $show "$rm $rmfiles"
2855 if test -n "$library_names"; then
2856 # Do each command in the postuninstall commands.
2857 eval cmds
=\"$postuninstall_cmds\"
2858 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2859 for cmd
in $cmds; do
2867 if test -n "$old_library"; then
2868 # Do each command in the old_postuninstall commands.
2869 eval cmds
=\"$old_postuninstall_cmds\"
2870 IFS
="${IFS= }"; save_ifs
="$IFS"; IFS
='~'
2871 for cmd
in $cmds; do
2879 # FIXME: should reinstall the best remaining shared library.
2884 if test "$build_old_libs" = yes; then
2885 oldobj
=`$echo "X$name" | $Xsed -e "$lo2o"`
2886 rmfiles
="$rmfiles $dir/$oldobj"
2888 $show "$rm $rmfiles"
2893 $show "$rm $rmfiles"
2902 $echo "$modename: you must specify a MODE" 1>&2
2903 $echo "$generic_help" 1>&2
2908 $echo "$modename: invalid operation mode \`$mode'" 1>&2
2909 $echo "$generic_help" 1>&2
2911 fi # test -z "$show_help"
2913 # We need to display help for each of the modes.
2916 "Usage: $modename [OPTION]... [MODE-ARG]...
2918 Provide generalized library-building support services.
2920 --config show all configuration variables
2921 --debug enable verbose shell tracing
2922 -n, --dry-run display commands without modifying any files
2923 --features display basic configuration information and exit
2924 --finish same as \`--mode=finish'
2925 --help display this help message and exit
2926 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
2927 --quiet same as \`--silent'
2928 --silent don't print informational messages
2929 --version print version information
2931 MODE must be one of the following:
2933 compile compile a source file into a libtool object
2934 execute automatically set library path, then run a program
2935 finish complete the installation of libtool libraries
2936 install install libraries or executables
2937 link create a library or an executable
2938 uninstall remove libraries from an installed directory
2940 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
2941 a more detailed description of MODE."
2947 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2949 Compile a source file into a libtool library object.
2951 This mode accepts the following additional options:
2953 -static always build a \`.o' file suitable for static linking
2955 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2956 from the given SOURCEFILE.
2958 The output file name is determined by removing the directory component from
2959 SOURCEFILE, then substituting the C source code suffix \`.c' with the
2960 library object suffix, \`.lo'."
2965 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
2967 Automatically set library path, then run a program.
2969 This mode accepts the following additional options:
2971 -dlopen FILE add the directory containing FILE to the library path
2973 This mode sets the library path environment variable according to \`-dlopen'
2976 If any of the ARGS are libtool executable wrappers, then they are translated
2977 into their corresponding uninstalled binary, and any of their required library
2978 directories are added to the library path.
2980 Then, COMMAND is executed, with ARGS as arguments."
2985 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
2987 Complete the installation of libtool libraries.
2989 Each LIBDIR is a directory that contains libtool libraries.
2991 The commands that this mode executes may require superuser privileges. Use
2992 the \`--dry-run' option if you just want to see what would be executed."
2997 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
2999 Install executables or libraries.
3001 INSTALL-COMMAND is the installation command. The first component should be
3002 either the \`install' or \`cp' program.
3004 The rest of the components are interpreted as arguments to that command (only
3005 BSD-compatible install options are recognized)."
3010 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
3012 Link object files or libraries together to form another library, or to
3013 create an executable program.
3015 LINK-COMMAND is a command using the C compiler that you would use to create
3016 a program from several object files.
3018 The following components of LINK-COMMAND are treated specially:
3020 -all-static do not do any dynamic linking at all
3021 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
3022 -dlpreopen FILE link in FILE and add its symbols to dld_preloaded_symbols
3023 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3024 -LLIBDIR search LIBDIR for required installed libraries
3025 -lNAME OUTPUT-FILE requires the installed library libNAME
3026 -no-undefined declare that a library does not refer to external symbols
3027 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
3028 -release RELEASE specify package release information
3029 -rpath LIBDIR the created library will eventually be installed in LIBDIR
3030 -static do not do any dynamic linking of libtool libraries
3031 -version-info CURRENT[:REVISION[:AGE]]
3032 specify library version info [each variable defaults to 0]
3034 All other options (arguments beginning with \`-') are ignored.
3036 Every other argument is treated as a filename. Files ending in \`.la' are
3037 treated as uninstalled libtool libraries, other files are standard or library
3040 If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
3041 library objects (\`.lo' files) may be specified, and \`-rpath' is required.
3043 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
3044 using \`ar' and \`ranlib', or on Windows using \`lib'.
3046 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
3047 is created, otherwise an executable program is created."
3052 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
3054 Remove libraries from an installation directory.
3056 RM is the name of the program to use to delete files associated with each FILE
3057 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
3060 If FILE is a libtool library, all the files associated with it are deleted.
3061 Otherwise, only FILE itself is deleted using RM."
3065 $echo "$modename: invalid operation mode \`$mode'" 1>&2
3072 $echo "Try \`$modename --help' for more information about other modes."