1 # Based on libtool-1.5.8
2 # ltmain.sh - Provide generalized library-building support services.
3 # NOTE: Changing this file will not affect anything until you rerun configure.
5 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
6 # Free Software Foundation, Inc.
7 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 # As a special exception to the GNU General Public License, if you
24 # distribute this file as part of a program that contains a
25 # configuration script generated by Autoconf, you may include it under
26 # the same distribution terms that you use for the rest of that program.
30 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
31 # is ksh but when the shell is invoked as "sh" and the current value of
32 # the _XPG environment variable is not equal to 1 (one), the special
33 # positional parameter $0, within a function call, is the name of the
37 # The name of this program:
38 progname=`echo "$progpath" | $SED $basename`
48 TIMESTAMP=" (1.1220.2.117 2004/08/04 14:12:05)"
50 # See if we are running on zsh, and set the options which allow our
51 # commands through without removal of \ escapes.
52 if test -n "${ZSH_VERSION+set}" ; then
56 # Check that we have a working $echo.
57 if test "X$1" = X--no-reexec; then
58 # Discard the --no-reexec flag, and continue.
60 elif test "X$1" = X--fallback-echo; then
61 # Avoid inline document here, it may be left over
63 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
64 # Yippee, $echo works!
67 # Restart under the correct shell, and then maybe $echo will work.
68 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
71 if test "X$1" = X--fallback-echo; then
72 # used as fallback echo
81 help="Try \`$progname --help' for more information."
82 magic="%%%MAGIC variable%%%"
87 # Sed substitution that helps us do robust quoting. It backslashifies
88 # metacharacters that are still active within double-quoted strings.
89 Xsed="${SED}"' -e 1s/^X//'
90 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
91 # test EBCDIC or ASCII
92 case `echo A|tr A '\301'` in
93 A) # EBCDIC based system
94 SP2NL="tr '\100' '\n'"
95 NL2SP="tr '\r\n' '\100\100'"
97 *) # Assume ASCII based system
98 SP2NL="tr '\040' '\012'"
99 NL2SP="tr '\015\012' '\040\040'"
104 # Only set LANG and LC_ALL to C if already set.
105 # These must not be set unconditionally because not all systems understand
106 # e.g. LANG=C (notably SCO).
107 # We save the old values to restore during execute mode.
108 if test "${LC_ALL+set}" = set; then
109 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
111 if test "${LANG+set}" = set; then
112 save_LANG="$LANG"; LANG=C; export LANG
115 # Make sure IFS has a sensible default
119 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
120 $echo "$modename: not configured to build any kind of library" 1>&2
121 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
134 lo2o="s/\\.lo\$/.${objext}/"
135 o2lo="s/\\.${objext}\$/.lo/"
137 #####################################
138 # Shell function definitions:
139 # This seems to be the best place for them
141 # func_win32_libid arg
142 # return the library type of file 'arg'
144 # Need a lot of goo to handle *both* DLLs and import libs
145 # Has to be a shell function in order to 'eat' the argument
146 # that is supplied when $file_magic_command is called.
147 func_win32_libid () {
148 win32_libid_type="unknown"
149 win32_fileres=`file -L $1 2>/dev/null`
150 case $win32_fileres in
151 *ar\ archive\ import\ library*) # definitely import
152 win32_libid_type="x86 archive import"
154 *ar\ archive*) # could be an import, or static
155 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
156 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
157 win32_nmres=`eval $NM -f posix -A $1 | \
158 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
159 if test "X$win32_nmres" = "Ximport" ; then
160 win32_libid_type="x86 archive import"
162 win32_libid_type="x86 archive static"
167 win32_libid_type="x86 DLL"
169 *executable*) # but shell scripts are "executable" too...
170 case $win32_fileres in
171 *MS\ Windows\ PE\ Intel*)
172 win32_libid_type="x86 DLL"
177 $echo $win32_libid_type
182 # Infer tagged configuration to use if any are available and
183 # if one wasn't chosen via the "--tag" command line option.
184 # Only attempt this if the compiler in the base compile
185 # command doesn't match the default compiler.
186 # arg is usually of the form 'gcc ...'
188 if test -n "$available_tags" && test -z "$tagname"; then
192 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
196 CC_quoted="$CC_quoted $arg"
199 # Blanks in the command may have been stripped by the calling shell,
200 # but not from the CC environment variable when configure was run.
201 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
202 # Blanks at the start of $base_compile will cause this to fail
203 # if we don't check for them as well.
205 for z in $available_tags; do
206 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
207 # Evaluate the configuration.
208 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
211 # Double-quote args containing other shell metacharacters.
213 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
217 CC_quoted="$CC_quoted $arg"
220 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
221 # The compiler in the base compile command matches
222 # the one in the tagged configuration.
223 # Assume this is the tagged configuration we want.
230 # If $tagname still isn't set, then no tagged configuration
231 # was found and let the user know that the "--tag" command
232 # line option must be used.
233 if test -z "$tagname"; then
234 $echo "$modename: unable to infer tagged configuration"
235 $echo "$modename: specify a tag with \`--tag'" 1>&2
238 # $echo "$modename: using $tagname tagged configuration"
246 # func_extract_archives gentop oldlib ...
247 func_extract_archives () {
248 my_gentop="$1"; shift
256 $show "${rm}r $my_gentop"
257 $run ${rm}r "$my_gentop"
258 $show "$mkdir $my_gentop"
259 $run $mkdir "$my_gentop"
261 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
265 for my_xlib in $my_oldlibs; do
266 # Extract the objects.
268 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
269 *) my_xabs=`pwd`"/$my_xlib" ;;
271 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
272 my_xdir="$my_gentop/$my_xlib"
274 $show "${rm}r $my_xdir"
275 $run ${rm}r "$my_xdir"
276 $show "$mkdir $my_xdir"
277 $run $mkdir "$my_xdir"
279 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
284 $show "Extracting $my_xabs"
285 # Do not bother doing anything if just a dry run
286 if test -z "$run"; then
287 darwin_orig_dir=`pwd`
288 cd $my_xdir || exit $?
289 darwin_archive=$my_xabs
291 darwin_base_archive=`basename $darwin_archive`
292 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
293 if test -n "$darwin_arches"; then
294 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
296 $show "$darwin_base_archive has multiple architectures $darwin_arches"
297 for darwin_arch in $darwin_arches ; do
298 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
299 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
300 # Remove the table of contents from the thin files.
301 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
302 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
303 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
304 $AR -xo "${darwin_base_archive}"
305 rm "${darwin_base_archive}"
307 done # $darwin_arches
308 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
309 darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
312 for darwin_file in $darwin_filelist; do
313 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
314 lipo -create -output "$darwin_file" $darwin_files
315 done # $darwin_filelist
317 cd "$darwin_orig_dir"
320 (cd $my_xdir && $AR x $my_xabs) || exit $?
325 # We will extract separately just the conflicting names and we will
326 # no longer touch any unique names. It is faster to leave these
327 # extract automatically by $AR in one run.
328 $show "(cd $my_xdir && $AR x $my_xabs)"
329 $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
330 if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
333 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
334 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
335 $AR t "$my_xabs" | sort | uniq -cd | while read -r count name
338 while test "$i" -le "$count"
340 # Put our $i before any first dot (extension)
341 # Never overwrite any file
343 while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
345 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
347 $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
348 $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
355 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
358 func_extract_archives_result="$my_oldobjs"
360 # End of Shell function definitions
361 #####################################
364 eval std_shrext=\"$shrext_cmds\"
366 # Parse our command line options once, thoroughly.
367 while test "$#" -gt 0
373 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
377 # If the previous option needs an argument, assign it.
378 if test -n "$prev"; then
381 execute_dlfiles="$execute_dlfiles $arg"
385 preserve_args="${preserve_args}=$arg"
387 # Check whether tagname contains only valid characters
390 $echo "$progname: invalid tag name: $tagname" 1>&2
397 # Don't test for the "default" C tag, as we know, it's there, but
398 # not specially marked.
401 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
402 taglist="$taglist $tagname"
403 # Evaluate the configuration.
404 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
406 $echo "$progname: ignoring unknown tag $tagname" 1>&2
421 # Have we seen a non-optional argument yet?
428 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
430 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
431 $echo "This is free software; see the source for copying conditions. There is NO"
432 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
437 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
438 # Now print the configurations for the tags.
439 for tagname in $taglist; do
440 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
446 $echo "$progname: enabling shell trace mode"
448 preserve_args="$preserve_args $arg"
457 if test "$build_libtool_libs" = yes; then
458 $echo "enable shared libraries"
460 $echo "disable shared libraries"
462 if test "$build_old_libs" = yes; then
463 $echo "enable static libraries"
465 $echo "disable static libraries"
470 --finish) mode="finish" ;;
472 --mode) prevopt="--mode" prev=mode ;;
473 --mode=*) mode="$optarg" ;;
475 --preserve-dup-deps) duplicate_deps="yes" ;;
479 preserve_args="$preserve_args $arg"
482 --tag) prevopt="--tag" prev=tag ;;
484 set tag "$optarg" ${1+"$@"}
487 preserve_args="$preserve_args --tag"
496 $echo "$modename: unrecognized option \`$arg'" 1>&2
508 if test -n "$prevopt"; then
509 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
514 # If this variable is set in any of the actions, the command in it
515 # will be execed at the end. This prevents here-documents from being
516 # left over by shells.
519 if test -z "$show_help"; then
521 # Infer the operation mode.
522 if test -z "$mode"; then
523 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
524 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
526 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
538 *db | *dbx | *strace | *truss)
548 # If we have no mode, but dlfiles were specified, then do execute mode.
549 test -n "$execute_dlfiles" && mode=execute
551 # Just use the default operation mode.
552 if test -z "$mode"; then
553 if test -n "$nonopt"; then
554 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
556 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
563 # Only execute mode is allowed to have -dlopen flags.
564 if test -n "$execute_dlfiles" && test "$mode" != execute; then
565 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
570 # Change the help message to a mode-specific one.
572 help="Try \`$modename --help --mode=$mode' for more information."
574 # These modes are in order of execution frequency so that they run quickly.
576 # libtool compile mode
578 modename="$modename: compile"
579 # Get the compilation command and the source file.
581 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
592 # do not "continue". Instead, add this to base_compile
604 # Accept any command-line options.
607 if test -n "$libobj" ; then
608 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
615 -static | -prefer-pic | -prefer-non-pic)
626 arg_mode=arg # the next one goes into the "base_compile" arg list
627 continue # The current "srcfile" will either be retained or
628 ;; # replaced later. I would guess that would be a bug.
631 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
633 save_ifs="$IFS"; IFS=','
637 # Double-quote args containing other shell metacharacters.
638 # Many Bourne shells cannot handle close brackets correctly
639 # in scan sets, so we specify it separately.
641 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
645 lastarg="$lastarg $arg"
648 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
650 # Add the arguments to base_compile.
651 base_compile="$base_compile $lastarg"
656 # Accept the current argument as the source file.
657 # The previous "srcfile" becomes the current argument.
664 esac # case $arg_mode
666 # Aesthetically quote the previous argument.
667 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
670 # Double-quote args containing other shell metacharacters.
671 # Many Bourne shells cannot handle close brackets correctly
672 # in scan sets, so we specify it separately.
673 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
674 lastarg="\"$lastarg\""
678 base_compile="$base_compile $lastarg"
683 $echo "$modename: you must specify an argument for -Xcompile"
687 $echo "$modename: you must specify a target with \`-o'" 1>&2
691 # Get the name of the library object.
692 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
696 # Recognize several different file suffixes.
697 # If the user specifies -o file.o, it is replaced with file.lo
707 *.class) xform=class ;;
712 *.java) xform=java ;;
715 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
718 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
720 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
725 func_infer_tag $base_compile
727 for arg in $later; do
746 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
747 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
748 if test "X$xdir" = "X$obj"; then
753 lobj=${xdir}$objdir/$objname
755 if test -z "$base_compile"; then
756 $echo "$modename: you must specify a compilation command" 1>&2
761 # Delete any leftover library objects.
762 if test "$build_old_libs" = yes; then
763 removelist="$obj $lobj $libobj ${libobj}T"
765 removelist="$lobj $libobj ${libobj}T"
769 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
771 # On Cygwin there's no "real" PIC flag so we must build both object types
773 cygwin* | mingw* | pw32* | os2*)
777 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
778 # non-PIC code in shared libraries is not supported
782 # Calculate the filename of the output object if compiler does
783 # not support -o with -c
784 if test "$compiler_c_o" = no; then
785 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
786 lockfile="$output_obj.lock"
787 removelist="$removelist $output_obj $lockfile"
788 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
795 # Lock this critical section if it is needed
796 # We use this script file to make the link, it avoids creating a new file
797 if test "$need_locks" = yes; then
798 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
799 $show "Waiting for $lockfile to be removed"
802 elif test "$need_locks" = warn; then
803 if test -f "$lockfile"; then
805 *** ERROR, $lockfile exists and contains:
806 `cat $lockfile 2>/dev/null`
808 This indicates that another process is trying to use the same
809 temporary object file, and libtool could not work around it because
810 your compiler does not support \`-c' and \`-o' together. If you
811 repeat this compilation, it may succeed, by chance, but you had better
812 avoid parallel builds (make -j) in this platform, or get a better
818 $echo $srcfile > "$lockfile"
821 if test -n "$fix_srcfile_path"; then
822 eval srcfile=\"$fix_srcfile_path\"
825 $run $rm "$libobj" "${libobj}T"
827 # Create a libtool object file (analogous to a ".la" file),
828 # but don't create it if we're doing a dry run.
829 test -z "$run" && cat > ${libobj}T <<EOF
830 # $libobj - a libtool object file
831 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
833 # Please DO NOT delete this file!
834 # It is necessary for linking the library.
836 # Name of the PIC object.
839 # Only build a PIC object if we are building libtool libraries.
840 if test "$build_libtool_libs" = yes; then
841 # Without this assignment, base_compile gets emptied.
842 fbsd_hideous_sh_bug=$base_compile
844 if test "$pic_mode" != no; then
845 command="$base_compile $srcfile $pic_flag"
847 # Don't build PIC code
848 command="$base_compile $srcfile"
851 if test ! -d "${xdir}$objdir"; then
852 $show "$mkdir ${xdir}$objdir"
853 $run $mkdir ${xdir}$objdir
855 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
860 if test -z "$output_obj"; then
861 # Place PIC objects in $objdir
862 command="$command -o $lobj"
865 $run $rm "$lobj" "$output_obj"
868 if $run eval "$command"; then :
870 test -n "$output_obj" && $run $rm $removelist
874 if test "$need_locks" = warn &&
875 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
877 *** ERROR, $lockfile contains:
878 `cat $lockfile 2>/dev/null`
880 but it should contain:
883 This indicates that another process is trying to use the same
884 temporary object file, and libtool could not work around it because
885 your compiler does not support \`-c' and \`-o' together. If you
886 repeat this compilation, it may succeed, by chance, but you had better
887 avoid parallel builds (make -j) in this platform, or get a better
894 # Just move the object if needed, then go on to compile the next one
895 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
896 $show "$mv $output_obj $lobj"
897 if $run $mv $output_obj $lobj; then :
905 # Append the name of the PIC object to the libtool object file.
906 test -z "$run" && cat >> ${libobj}T <<EOF
907 pic_object='$objdir/$objname'
911 # Allow error messages only from the first compilation.
912 if test "$suppress_opt" = yes; then
913 suppress_output=' >/dev/null 2>&1'
916 # No PIC object so indicate it doesn't exist in the libtool
918 test -z "$run" && cat >> ${libobj}T <<EOF
924 # Only build a position-dependent object if we build old libraries.
925 if test "$build_old_libs" = yes; then
926 if test "$pic_mode" != yes; then
927 # Don't build PIC code
928 command="$base_compile $srcfile"
930 command="$base_compile $srcfile $pic_flag"
932 if test "$compiler_c_o" = yes; then
933 command="$command -o $obj"
936 # Suppress compiler output if we already did a PIC compilation.
937 command="$command$suppress_output"
938 $run $rm "$obj" "$output_obj"
940 if $run eval "$command"; then :
946 if test "$need_locks" = warn &&
947 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
949 *** ERROR, $lockfile contains:
950 `cat $lockfile 2>/dev/null`
952 but it should contain:
955 This indicates that another process is trying to use the same
956 temporary object file, and libtool could not work around it because
957 your compiler does not support \`-c' and \`-o' together. If you
958 repeat this compilation, it may succeed, by chance, but you had better
959 avoid parallel builds (make -j) in this platform, or get a better
966 # Just move the object if needed
967 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
968 $show "$mv $output_obj $obj"
969 if $run $mv $output_obj $obj; then :
977 # Append the name of the non-PIC object the libtool object file.
978 # Only append if the libtool object file exists.
979 test -z "$run" && cat >> ${libobj}T <<EOF
980 # Name of the non-PIC object.
981 non_pic_object='$objname'
985 # Append the name of the non-PIC object the libtool object file.
986 # Only append if the libtool object file exists.
987 test -z "$run" && cat >> ${libobj}T <<EOF
988 # Name of the non-PIC object.
994 $run $mv "${libobj}T" "${libobj}"
996 # Unlock the critical section if it was locked
997 if test "$need_locks" != no; then
1006 modename="$modename: link"
1008 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1009 # It is impossible to link a dll without this setting, and
1010 # we shouldn't force the makefile maintainer to figure out
1011 # which system we are compiling for in order to pass an extra
1012 # flag for every libtool invocation.
1013 # allow_undefined=no
1015 # FIXME: Unfortunately, there are problems with the above when trying
1016 # to make a dll which has undefined symbols, in which case not
1017 # even a static library is built. For now, we need to specify
1018 # -no-undefined on the libtool link line when we can be certain
1019 # that all symbols are satisfied, otherwise we get a static library.
1026 libtool_args="$nonopt"
1027 base_compile="$nonopt $@"
1028 compile_command="$nonopt"
1029 finalize_command="$nonopt"
1042 lib_search_path=`pwd`
1051 export_symbols_regex=
1059 precious_files_regex=
1060 prefer_static_libs=no
1073 func_infer_tag $base_compile
1075 # We need to know -static, to get the right output filenames.
1079 -all-static | -static)
1080 if test "X$arg" = "X-all-static"; then
1081 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1082 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1084 if test -n "$link_static_flag"; then
1085 dlopen_self=$dlopen_self_static
1088 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1089 dlopen_self=$dlopen_self_static
1092 build_libtool_libs=no
1094 prefer_static_libs=yes
1100 # See if our shared archives depend on static archives.
1101 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1103 # Go through the arguments, transforming them on the way.
1104 while test "$#" -gt 0; do
1108 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1109 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1113 libtool_args="$libtool_args $qarg"
1115 # If the previous option needs an argument, assign it.
1116 if test -n "$prev"; then
1119 compile_command="$compile_command @OUTPUT@"
1120 finalize_command="$finalize_command @OUTPUT@"
1126 if test "$preload" = no; then
1127 # Add the symbol object into the linking commands.
1128 compile_command="$compile_command @SYMFILE@"
1129 finalize_command="$finalize_command @SYMFILE@"
1133 *.la | *.lo) ;; # We handle these cases below.
1135 if test "$dlself" = no; then
1143 if test "$prev" = dlprefiles; then
1145 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1155 if test "$prev" = dlfiles; then
1156 dlfiles="$dlfiles $arg"
1158 dlprefiles="$dlprefiles $arg"
1166 export_symbols="$arg"
1167 if test ! -f "$arg"; then
1168 $echo "$modename: symbol file \`$arg' does not exist"
1175 export_symbols_regex="$arg"
1180 inst_prefix_dir="$arg"
1185 precious_files_regex="$arg"
1195 if test -f "$arg"; then
1198 for fil in `cat $save_arg`
1200 # moreargs="$moreargs $fil"
1202 # A libtool-controlled object.
1204 # Check to see that this really is a libtool object.
1205 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1210 # If there is no directory component, then add one.
1212 */* | *\\*) . $arg ;;
1216 if test -z "$pic_object" || \
1217 test -z "$non_pic_object" ||
1218 test "$pic_object" = none && \
1219 test "$non_pic_object" = none; then
1220 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1224 # Extract subdirectory from the argument.
1225 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1226 if test "X$xdir" = "X$arg"; then
1232 if test "$pic_object" != none; then
1233 # Prepend the subdirectory the object is found in.
1234 pic_object="$xdir$pic_object"
1236 if test "$prev" = dlfiles; then
1237 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1238 dlfiles="$dlfiles $pic_object"
1242 # If libtool objects are unsupported, then we need to preload.
1247 # CHECK ME: I think I busted this. -Ossama
1248 if test "$prev" = dlprefiles; then
1249 # Preload the old-style object.
1250 dlprefiles="$dlprefiles $pic_object"
1255 libobjs="$libobjs $pic_object"
1260 if test "$non_pic_object" != none; then
1261 # Prepend the subdirectory the object is found in.
1262 non_pic_object="$xdir$non_pic_object"
1264 # A standard non-PIC object
1265 non_pic_objects="$non_pic_objects $non_pic_object"
1266 if test -z "$pic_object" || test "$pic_object" = none ; then
1267 arg="$non_pic_object"
1271 # Only an error if not doing a dry-run.
1272 if test -z "$run"; then
1273 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1278 # Extract subdirectory from the argument.
1279 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1280 if test "X$xdir" = "X$arg"; then
1286 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1287 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1288 libobjs="$libobjs $pic_object"
1289 non_pic_objects="$non_pic_objects $non_pic_object"
1294 $echo "$modename: link input file \`$save_arg' does not exist"
1302 # We need an absolute path.
1304 [\\/]* | [A-Za-z]:[\\/]*) ;;
1306 $echo "$modename: only absolute run-paths are allowed" 1>&2
1310 if test "$prev" = rpath; then
1313 *) rpath="$rpath $arg" ;;
1318 *) xrpath="$xrpath $arg" ;;
1325 compiler_flags="$compiler_flags $qarg"
1327 compile_command="$compile_command $qarg"
1328 finalize_command="$finalize_command $qarg"
1332 linker_flags="$linker_flags $qarg"
1333 compiler_flags="$compiler_flags $wl$qarg"
1335 compile_command="$compile_command $wl$qarg"
1336 finalize_command="$finalize_command $wl$qarg"
1340 linker_flags="$linker_flags $qarg"
1341 compiler_flags="$compiler_flags $qarg"
1343 compile_command="$compile_command $qarg"
1344 finalize_command="$finalize_command $qarg"
1351 *" $qarg.framework "*) ;;
1352 *) deplibs="$deplibs $qarg.framework" # this is fixed later
1366 eval "$prev=\"\$arg\""
1371 fi # test -n "$prev"
1377 if test -n "$link_static_flag"; then
1378 compile_command="$compile_command $link_static_flag"
1379 finalize_command="$finalize_command $link_static_flag"
1385 # FIXME: remove this flag sometime in the future.
1386 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1410 -export-symbols | -export-symbols-regex)
1411 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1412 $echo "$modename: more than one -exported-symbols argument is not allowed"
1415 if test "X$arg" = "X-export-symbols"; then
1428 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1429 # so, if we see these flags be careful not to treat them like -L
1431 case $with_gcc/$host in
1432 no/*-*-irix* | /*-*-irix*)
1433 compile_command="$compile_command $arg"
1434 finalize_command="$finalize_command $arg"
1441 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1442 # We need an absolute path.
1444 [\\/]* | [A-Za-z]:[\\/]*) ;;
1446 absdir=`cd "$dir" && pwd`
1447 if test -z "$absdir"; then
1448 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1457 deplibs="$deplibs -L$dir"
1458 lib_search_path="$lib_search_path $dir"
1462 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1463 case :$dllsearchpath: in
1465 *) dllsearchpath="$dllsearchpath:$dir";;
1473 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1475 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1476 # These systems don't actually have a C or math library (as such)
1479 *-*-mingw* | *-*-os2*)
1480 # These systems don't actually have a C library (as such)
1481 test "X$arg" = "X-lc" && continue
1483 *-*-openbsd* | *-*-freebsd*)
1484 # Do not include libc due to us having libc/libc_r.
1485 test "X$arg" = "X-lc" && continue
1487 *-*-rhapsody* | *-*-darwin1.[012])
1488 # Rhapsody C and math libraries are in the System framework
1489 deplibs="$deplibs -framework System"
1492 elif test "X$arg" = "X-lc_r"; then
1494 *-*-openbsd* | *-*-freebsd*)
1495 # Do not include libc_r directly, use -pthread flag.
1500 deplibs="$deplibs $arg"
1504 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1505 deplibs="$deplibs $arg"
1514 # gcc -m* arguments should be passed to the linker via $compiler_flags
1515 # in order to pass architecture information to the linker
1516 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
1517 # but this is not reliable with gcc because gcc may use -mfoo to
1518 # select a different linker, different libraries, etc, while
1519 # -Wl,-mfoo simply passes -mfoo to the linker.
1521 # Unknown arguments in both finalize_command and compile_command need
1522 # to be aesthetically quoted because they are evaled later.
1523 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1525 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1529 compile_command="$compile_command $arg"
1530 finalize_command="$finalize_command $arg"
1531 if test "$with_gcc" = "yes" ; then
1532 compiler_flags="$compiler_flags $arg"
1549 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1550 # The PATH hackery in wrapper scripts is required on Windows
1551 # in order for the loader to find any dlls it needs.
1552 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1553 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1556 *) no_install=yes ;;
1573 -precious-files-regex)
1594 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1595 # We need an absolute path.
1597 [\\/]* | [A-Za-z]:[\\/]*) ;;
1599 $echo "$modename: only absolute run-paths are allowed" 1>&2
1605 *) xrpath="$xrpath $dir" ;;
1611 # The effects of -static are defined in a previous loop.
1612 # We used to do the same as -all-static on platforms that
1613 # didn't have a PIC flag, but the assumption that the effects
1614 # would be equivalent was wrong. It would break on at least
1615 # Digital Unix and AIX.
1635 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1637 save_ifs="$IFS"; IFS=','
1638 for flag in $args; do
1641 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1646 compiler_flags="$compiler_flags $flag"
1649 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1653 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1655 save_ifs="$IFS"; IFS=','
1656 for flag in $args; do
1659 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1664 compiler_flags="$compiler_flags $wl$flag"
1665 linker_flags="$linker_flags $flag"
1668 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1691 # Some other compiler flag.
1693 # Unknown arguments in both finalize_command and compile_command need
1694 # to be aesthetically quoted because they are evaled later.
1695 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1697 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1704 # A standard object.
1709 # A libtool-controlled object.
1711 # Check to see that this really is a libtool object.
1712 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1717 # If there is no directory component, then add one.
1719 */* | *\\*) . $arg ;;
1723 if test -z "$pic_object" || \
1724 test -z "$non_pic_object" ||
1725 test "$pic_object" = none && \
1726 test "$non_pic_object" = none; then
1727 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1731 # Extract subdirectory from the argument.
1732 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1733 if test "X$xdir" = "X$arg"; then
1739 if test "$pic_object" != none; then
1740 # Prepend the subdirectory the object is found in.
1741 pic_object="$xdir$pic_object"
1743 if test "$prev" = dlfiles; then
1744 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1745 dlfiles="$dlfiles $pic_object"
1749 # If libtool objects are unsupported, then we need to preload.
1754 # CHECK ME: I think I busted this. -Ossama
1755 if test "$prev" = dlprefiles; then
1756 # Preload the old-style object.
1757 dlprefiles="$dlprefiles $pic_object"
1762 libobjs="$libobjs $pic_object"
1767 if test "$non_pic_object" != none; then
1768 # Prepend the subdirectory the object is found in.
1769 non_pic_object="$xdir$non_pic_object"
1771 # A standard non-PIC object
1772 non_pic_objects="$non_pic_objects $non_pic_object"
1773 if test -z "$pic_object" || test "$pic_object" = none ; then
1774 arg="$non_pic_object"
1778 # Only an error if not doing a dry-run.
1779 if test -z "$run"; then
1780 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1785 # Extract subdirectory from the argument.
1786 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1787 if test "X$xdir" = "X$arg"; then
1793 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1794 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1795 libobjs="$libobjs $pic_object"
1796 non_pic_objects="$non_pic_objects $non_pic_object"
1803 deplibs="$deplibs $arg"
1804 old_deplibs="$old_deplibs $arg"
1809 # A libtool-controlled library.
1811 if test "$prev" = dlfiles; then
1812 # This library was specified with -dlopen.
1813 dlfiles="$dlfiles $arg"
1815 elif test "$prev" = dlprefiles; then
1816 # The library was specified with -dlpreopen.
1817 dlprefiles="$dlprefiles $arg"
1820 deplibs="$deplibs $arg"
1825 # Some other compiler argument.
1827 # Unknown arguments in both finalize_command and compile_command need
1828 # to be aesthetically quoted because they are evaled later.
1829 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1831 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1838 # Now actually substitute the argument into the commands.
1839 if test -n "$arg"; then
1840 compile_command="$compile_command $arg"
1841 finalize_command="$finalize_command $arg"
1843 done # argument parsing loop
1845 if test -n "$prev"; then
1846 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1851 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1852 eval arg=\"$export_dynamic_flag_spec\"
1853 compile_command="$compile_command $arg"
1854 finalize_command="$finalize_command $arg"
1858 # calculate the name of the file, without its directory
1859 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1860 libobjs_save="$libobjs"
1862 if test -n "$shlibpath_var"; then
1863 # get the directories listed in $shlibpath_var
1864 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1868 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1869 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1871 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1872 if test "X$output_objdir" = "X$output"; then
1873 output_objdir="$objdir"
1875 output_objdir="$output_objdir/$objdir"
1877 # Create the object directory.
1878 if test ! -d "$output_objdir"; then
1879 $show "$mkdir $output_objdir"
1880 $run $mkdir $output_objdir
1882 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1887 # Determine the type of output
1890 $echo "$modename: you must specify an output file" 1>&2
1894 *.$libext) linkmode=oldlib ;;
1895 *.lo | *.$objext) linkmode=obj ;;
1896 *.la) linkmode=lib ;;
1897 *) linkmode=prog ;; # Anything else should be a program.
1901 *cygwin* | *mingw* | *pw32*)
1902 # don't eliminate duplications in $postdeps and $predeps
1903 duplicate_compiler_generated_deps=yes
1906 duplicate_compiler_generated_deps=$duplicate_deps
1912 # Find all interdependent deplibs by searching for libraries
1913 # that are linked more than once (e.g. -la -lb -la)
1914 for deplib in $deplibs; do
1915 if test "X$duplicate_deps" = "Xyes" ; then
1917 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1920 libs="$libs $deplib"
1923 if test "$linkmode" = lib; then
1924 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1926 # Compute libraries that are listed more than once in $predeps
1927 # $postdeps and mark them as special (i.e., whose duplicates are
1928 # not to be eliminated).
1930 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1931 for pre_post_dep in $predeps $postdeps; do
1932 case "$pre_post_deps " in
1933 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1935 pre_post_deps="$pre_post_deps $pre_post_dep"
1944 need_relink=no # whether we're linking any uninstalled libtool libraries
1945 notinst_deplibs= # not-installed libtool libraries
1946 notinst_path= # paths that contain not-installed libtool libraries
1950 for file in $dlfiles $dlprefiles; do
1954 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1966 passes="conv scan dlopen dlpreopen link"
1971 for pass in $passes; do
1972 if test "$linkmode,$pass" = "lib,link" ||
1973 test "$linkmode,$pass" = "prog,scan"; then
1977 if test "$linkmode" = prog; then
1979 dlopen) libs="$dlfiles" ;;
1980 dlpreopen) libs="$dlprefiles" ;;
1981 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1984 if test "$pass" = dlopen; then
1985 # Collect dlpreopened libraries
1986 save_deplibs="$deplibs"
1989 for deplib in $libs; do
1993 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1994 if test "$linkmode,$pass" = "prog,link"; then
1995 compile_deplibs="$deplib $compile_deplibs"
1996 finalize_deplibs="$deplib $finalize_deplibs"
1998 deplibs="$deplib $deplibs"
2003 if test "$linkmode" != lib && test "$linkmode" != prog; then
2004 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2007 if test "$pass" = conv; then
2008 deplibs="$deplib $deplibs"
2011 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2012 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2013 for search_ext in .la $std_shrext .so .a; do
2014 # Search the libtool library
2015 lib="$searchdir/lib${name}${search_ext}"
2016 if test -f "$lib"; then
2017 if test "$search_ext" = ".la"; then
2026 if test "$found" != yes; then
2027 # deplib doesn't seem to be a libtool library
2028 if test "$linkmode,$pass" = "prog,link"; then
2029 compile_deplibs="$deplib $compile_deplibs"
2030 finalize_deplibs="$deplib $finalize_deplibs"
2032 deplibs="$deplib $deplibs"
2033 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2036 else # deplib is a libtool library
2037 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2038 # We need to do some special things here, and not later.
2039 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2040 case " $predeps $postdeps " in
2042 if (${SED} -e '2q' $lib |
2043 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2047 */* | *\\*) . $lib ;;
2050 for l in $old_library $library_names; do
2053 if test "X$ll" = "X$old_library" ; then # only static version available
2055 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2056 test "X$ladir" = "X$lib" && ladir="."
2057 lib=$ladir/$old_library
2058 if test "$linkmode,$pass" = "prog,link"; then
2059 compile_deplibs="$deplib $compile_deplibs"
2060 finalize_deplibs="$deplib $finalize_deplibs"
2062 deplibs="$deplib $deplibs"
2063 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2075 if test "$linkmode,$pass" = "prog,link"; then
2076 compile_deplibs="$deplib $compile_deplibs"
2077 finalize_deplibs="$deplib $finalize_deplibs"
2079 deplibs="$deplib $deplibs"
2080 if test "$linkmode" = lib ; then
2081 newdependency_libs="$deplib $newdependency_libs"
2089 deplibs="$deplib $deplibs"
2090 test "$pass" = conv && continue
2091 newdependency_libs="$deplib $newdependency_libs"
2092 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2095 if test "$pass" = conv; then
2096 deplibs="$deplib $deplibs"
2099 if test "$pass" = scan; then
2100 deplibs="$deplib $deplibs"
2102 compile_deplibs="$deplib $compile_deplibs"
2103 finalize_deplibs="$deplib $finalize_deplibs"
2105 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2108 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2114 if test "$pass" = link; then
2115 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2116 # Make sure the xrpath contains only unique directories.
2119 *) xrpath="$xrpath $dir" ;;
2122 deplibs="$deplib $deplibs"
2125 *.la) lib="$deplib" ;;
2127 if test "$pass" = conv; then
2128 deplibs="$deplib $deplibs"
2134 case $deplibs_check_method in
2136 set dummy $deplibs_check_method
2137 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2138 if eval $echo \"$deplib\" 2>/dev/null \
2140 | $EGREP "$match_pattern_regex" > /dev/null; then
2148 if test "$valid_a_lib" != yes; then
2150 $echo "*** Warning: Trying to link with static lib archive $deplib."
2151 $echo "*** I have the capability to make that library automatically link in when"
2152 $echo "*** you link to this library. But I can only do this if you have a"
2153 $echo "*** shared version of the library, which you do not appear to have"
2154 $echo "*** because the file extensions .$libext of this argument makes me believe"
2155 $echo "*** that it is just a static archive that I should not used here."
2158 $echo "*** Warning: Linking the shared library $output against the"
2159 $echo "*** static library $deplib is not portable!"
2160 deplibs="$deplib $deplibs"
2165 if test "$pass" != link; then
2166 deplibs="$deplib $deplibs"
2168 compile_deplibs="$deplib $compile_deplibs"
2169 finalize_deplibs="$deplib $finalize_deplibs"
2176 if test "$pass" = conv; then
2177 deplibs="$deplib $deplibs"
2178 elif test "$linkmode" = prog; then
2179 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2180 # If there is no dlopen support or we're linking statically,
2181 # we need to preload.
2182 newdlprefiles="$newdlprefiles $deplib"
2183 compile_deplibs="$deplib $compile_deplibs"
2184 finalize_deplibs="$deplib $finalize_deplibs"
2186 newdlfiles="$newdlfiles $deplib"
2196 if test "$found" = yes || test -f "$lib"; then :
2198 $echo "$modename: cannot find the library \`$lib'" 1>&2
2202 # Check to see that this really is a libtool archive.
2203 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2205 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2209 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2210 test "X$ladir" = "X$lib" && ladir="."
2218 # If the library was installed with an old release of libtool,
2219 # it will not redefine variables installed, or shouldnotlink
2225 */* | *\\*) . $lib ;;
2231 # Convert "-framework foo" to "foo.framework" in dependency_libs
2232 test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.framework/g'`
2236 if test "$linkmode,$pass" = "lib,link" ||
2237 test "$linkmode,$pass" = "prog,scan" ||
2238 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2239 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2240 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2243 if test "$pass" = conv; then
2244 # Only check for convenience libraries
2245 deplibs="$lib $deplibs"
2246 if test -z "$libdir"; then
2247 if test -z "$old_library"; then
2248 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2251 # It is a libtool convenience library, so add in its objects.
2252 convenience="$convenience $ladir/$objdir/$old_library"
2253 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2255 for deplib in $dependency_libs; do
2256 deplibs="$deplib $deplibs"
2257 if test "X$duplicate_deps" = "Xyes" ; then
2258 case "$tmp_libs " in
2259 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2262 tmp_libs="$tmp_libs $deplib"
2264 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2265 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2272 # Get the name of the library we link against.
2274 for l in $old_library $library_names; do
2277 if test -z "$linklib"; then
2278 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2282 # This library was specified with -dlopen.
2283 if test "$pass" = dlopen; then
2284 if test -z "$libdir"; then
2285 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2288 if test -z "$dlname" ||
2289 test "$dlopen_support" != yes ||
2290 test "$build_libtool_libs" = no; then
2291 # If there is no dlname, no dlopen support or we're linking
2292 # statically, we need to preload. We also need to preload any
2293 # dependent libraries so libltdl's deplib preloader doesn't
2294 # bomb out in the load deplibs phase.
2295 dlprefiles="$dlprefiles $lib $dependency_libs"
2297 newdlfiles="$newdlfiles $lib"
2302 # We need an absolute path.
2304 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2306 abs_ladir=`cd "$ladir" && pwd`
2307 if test -z "$abs_ladir"; then
2308 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2309 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2314 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2316 # Find the relevant object directory and library name.
2317 if test "X$installed" = Xyes; then
2318 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2319 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2328 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2331 # Remove this search path later
2332 notinst_path="$notinst_path $abs_ladir"
2334 dir="$ladir/$objdir"
2335 absdir="$abs_ladir/$objdir"
2336 # Remove this search path later
2337 notinst_path="$notinst_path $abs_ladir"
2339 fi # $installed = yes
2340 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2342 # This library was specified with -dlpreopen.
2343 if test "$pass" = dlpreopen; then
2344 if test -z "$libdir"; then
2345 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2348 # Prefer using a static library (so that no silly _DYNAMIC symbols
2349 # are required to link).
2350 if test -n "$old_library"; then
2351 newdlprefiles="$newdlprefiles $dir/$old_library"
2352 # Otherwise, use the dlname, so that lt_dlopen finds it.
2353 elif test -n "$dlname"; then
2354 newdlprefiles="$newdlprefiles $dir/$dlname"
2356 newdlprefiles="$newdlprefiles $dir/$linklib"
2358 fi # $pass = dlpreopen
2360 if test -z "$libdir"; then
2361 # Link the convenience library
2362 if test "$linkmode" = lib; then
2363 deplibs="$dir/$old_library $deplibs"
2364 elif test "$linkmode,$pass" = "prog,link"; then
2365 compile_deplibs="$dir/$old_library $compile_deplibs"
2366 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2368 deplibs="$lib $deplibs" # used for prog,scan pass
2374 if test "$linkmode" = prog && test "$pass" != link; then
2375 newlib_search_path="$newlib_search_path $ladir"
2376 deplibs="$lib $deplibs"
2379 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2380 test "$build_libtool_libs" = no; then
2385 for deplib in $dependency_libs; do
2387 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2389 # Need to link against all dependency_libs?
2390 if test "$linkalldeplibs" = yes; then
2391 deplibs="$deplib $deplibs"
2393 # Need to hardcode shared library paths
2394 # or/and link against static libraries
2395 newdependency_libs="$deplib $newdependency_libs"
2397 if test "X$duplicate_deps" = "Xyes" ; then
2398 case "$tmp_libs " in
2399 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2402 tmp_libs="$tmp_libs $deplib"
2405 fi # $linkmode = prog...
2407 if test "$linkmode,$pass" = "prog,link"; then
2408 if test -n "$library_names" &&
2409 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2410 # We need to hardcode the library path
2411 if test -n "$shlibpath_var"; then
2412 # Make sure the rpath contains only unique directories.
2413 case "$temp_rpath " in
2416 *) temp_rpath="$temp_rpath $dir" ;;
2420 # Hardcode the library path.
2421 # Skip directories that are in the system default run-time
2423 case " $sys_lib_dlsearch_path " in
2426 case "$compile_rpath " in
2428 *) compile_rpath="$compile_rpath $absdir"
2432 case " $sys_lib_dlsearch_path " in
2435 case "$finalize_rpath " in
2437 *) finalize_rpath="$finalize_rpath $libdir"
2441 fi # $linkmode,$pass = prog,link...
2443 if test "$alldeplibs" = yes &&
2444 { test "$deplibs_check_method" = pass_all ||
2445 { test "$build_libtool_libs" = yes &&
2446 test -n "$library_names"; }; }; then
2447 # We only need to search for static libraries
2452 link_static=no # Whether the deplib will be linked statically
2453 if test -n "$library_names" &&
2454 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2455 if test "$installed" = no; then
2456 notinst_deplibs="$notinst_deplibs $lib"
2459 # This is a shared library
2461 # Warn about portability, can't link against -module's on
2462 # some systems (darwin)
2463 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2465 if test "$linkmode" = prog; then
2466 $echo "*** Warning: Linking the executable $output against the loadable module"
2468 $echo "*** Warning: Linking the shared library $output against the loadable module"
2470 $echo "*** $linklib is not portable!"
2472 if test "$linkmode" = lib &&
2473 test "$hardcode_into_libs" = yes; then
2474 # Hardcode the library path.
2475 # Skip directories that are in the system default run-time
2477 case " $sys_lib_dlsearch_path " in
2480 case "$compile_rpath " in
2482 *) compile_rpath="$compile_rpath $absdir"
2486 case " $sys_lib_dlsearch_path " in
2489 case "$finalize_rpath " in
2491 *) finalize_rpath="$finalize_rpath $libdir"
2497 if test -n "$old_archive_from_expsyms_cmds"; then
2498 # figure out the soname
2499 set dummy $library_names
2502 libname=`eval \\$echo \"$libname_spec\"`
2503 # use dlname if we got it. it's perfectly good, no?
2504 if test -n "$dlname"; then
2506 elif test -n "$soname_spec"; then
2510 major=`expr $current - $age`
2514 eval soname=\"$soname_spec\"
2519 # Make a new name for the extract_expsyms_cmds to use
2521 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2522 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2524 # If the library has no export list, then create one now
2525 if test -f "$output_objdir/$soname-def"; then :
2527 $show "extracting exported symbol list from \`$soname'"
2528 save_ifs="$IFS"; IFS='~'
2529 cmds=$extract_expsyms_cmds
2530 for cmd in $cmds; do
2534 $run eval "$cmd" || exit $?
2540 if test -f "$output_objdir/$newlib"; then :; else
2541 $show "generating import library for \`$soname'"
2542 save_ifs="$IFS"; IFS='~'
2543 cmds=$old_archive_from_expsyms_cmds
2544 for cmd in $cmds; do
2548 $run eval "$cmd" || exit $?
2552 # make sure the library variables are pointing to the new library
2555 fi # test -n "$old_archive_from_expsyms_cmds"
2557 if test "$linkmode" = prog || test "$mode" != relink; then
2562 case $hardcode_action in
2563 immediate | unsupported)
2564 if test "$hardcode_direct" = no; then
2567 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2569 # if the lib is a module then we can not link against
2570 # it, someone is ignoring the new warnings I added
2571 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2572 $echo "** Warning, lib $linklib is a module, not a shared library"
2573 if test -z "$old_library" ; then
2575 $echo "** And there doesn't seem to be a static archive available"
2576 $echo "** The link will probably fail, sorry"
2578 add="$dir/$old_library"
2582 elif test "$hardcode_minus_L" = no; then
2584 *-*-sunos*) add_shlibpath="$dir" ;;
2588 elif test "$hardcode_shlibpath_var" = no; then
2589 add_shlibpath="$dir"
2596 if test "$hardcode_direct" = yes; then
2598 elif test "$hardcode_minus_L" = yes; then
2600 # Try looking first in the location we're being installed to.
2601 if test -n "$inst_prefix_dir"; then
2604 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2609 elif test "$hardcode_shlibpath_var" = yes; then
2610 add_shlibpath="$dir"
2619 if test "$lib_linked" != yes; then
2620 $echo "$modename: configuration error: unsupported hardcode properties"
2624 if test -n "$add_shlibpath"; then
2625 case :$compile_shlibpath: in
2626 *":$add_shlibpath:"*) ;;
2627 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2630 if test "$linkmode" = prog; then
2631 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2632 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2634 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2635 test -n "$add" && deplibs="$add $deplibs"
2636 if test "$hardcode_direct" != yes && \
2637 test "$hardcode_minus_L" != yes && \
2638 test "$hardcode_shlibpath_var" = yes; then
2639 case :$finalize_shlibpath: in
2641 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2647 if test "$linkmode" = prog || test "$mode" = relink; then
2651 # Finalize command for both is simple: just hardcode it.
2652 if test "$hardcode_direct" = yes; then
2653 add="$libdir/$linklib"
2654 elif test "$hardcode_minus_L" = yes; then
2657 elif test "$hardcode_shlibpath_var" = yes; then
2658 case :$finalize_shlibpath: in
2660 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2663 elif test "$hardcode_automatic" = yes; then
2664 if test -n "$inst_prefix_dir" &&
2665 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2666 add="$inst_prefix_dir$libdir/$linklib"
2668 add="$libdir/$linklib"
2671 # We cannot seem to hardcode it, guess we'll fake it.
2673 # Try looking first in the location we're being installed to.
2674 if test -n "$inst_prefix_dir"; then
2677 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2684 if test "$linkmode" = prog; then
2685 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2686 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2688 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2689 test -n "$add" && deplibs="$add $deplibs"
2692 elif test "$linkmode" = prog; then
2693 # Here we assume that one of hardcode_direct or hardcode_minus_L
2694 # is not unsupported. This is valid on all known static and
2696 if test "$hardcode_direct" != unsupported; then
2697 test -n "$old_library" && linklib="$old_library"
2698 compile_deplibs="$dir/$linklib $compile_deplibs"
2699 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2701 compile_deplibs="-l$name -L$dir $compile_deplibs"
2702 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2704 elif test "$build_libtool_libs" = yes; then
2705 # Not a shared library
2706 if test "$deplibs_check_method" != pass_all; then
2707 # We're trying link a shared library against a static one
2708 # but the system doesn't support it.
2710 # Just print a warning and add the library to dependency_libs so
2711 # that the program can be linked against the static library.
2713 $echo "*** Warning: This system can not link to static lib archive $lib."
2714 $echo "*** I have the capability to make that library automatically link in when"
2715 $echo "*** you link to this library. But I can only do this if you have a"
2716 $echo "*** shared version of the library, which you do not appear to have."
2717 if test "$module" = yes; then
2718 $echo "*** But as you try to build a module library, libtool will still create "
2719 $echo "*** a static module, that should work as long as the dlopening application"
2720 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2721 if test -z "$global_symbol_pipe"; then
2723 $echo "*** However, this would only work if libtool was able to extract symbol"
2724 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2725 $echo "*** not find such a program. So, this module is probably useless."
2726 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2728 if test "$build_old_libs" = no; then
2729 build_libtool_libs=module
2732 build_libtool_libs=no
2736 convenience="$convenience $dir/$old_library"
2737 old_convenience="$old_convenience $dir/$old_library"
2738 deplibs="$dir/$old_library $deplibs"
2741 fi # link shared/static library?
2743 if test "$linkmode" = lib; then
2744 if test -n "$dependency_libs" &&
2745 { test "$hardcode_into_libs" != yes ||
2746 test "$build_old_libs" = yes ||
2747 test "$link_static" = yes; }; then
2748 # Extract -R from dependency_libs
2750 for libdir in $dependency_libs; do
2752 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2754 *" $temp_xrpath "*) ;;
2755 *) xrpath="$xrpath $temp_xrpath";;
2757 *) temp_deplibs="$temp_deplibs $libdir";;
2760 dependency_libs="$temp_deplibs"
2763 newlib_search_path="$newlib_search_path $absdir"
2764 # Link against this library
2765 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2766 # ... and its dependency_libs
2768 for deplib in $dependency_libs; do
2769 newdependency_libs="$deplib $newdependency_libs"
2770 if test "X$duplicate_deps" = "Xyes" ; then
2771 case "$tmp_libs " in
2772 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2775 tmp_libs="$tmp_libs $deplib"
2778 if test "$link_all_deplibs" != no; then
2779 # Add the search paths of all dependency libraries
2780 for deplib in $dependency_libs; do
2782 -L*) path="$deplib" ;;
2784 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2785 test "X$dir" = "X$deplib" && dir="."
2786 # We need an absolute path.
2788 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2790 absdir=`cd "$dir" && pwd`
2791 if test -z "$absdir"; then
2792 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2797 if grep "^installed=no" $deplib > /dev/null; then
2798 path="$absdir/$objdir"
2800 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2801 if test -z "$libdir"; then
2802 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2805 if test "$absdir" != "$libdir"; then
2806 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2813 # we do not want to link against static libs,
2814 # but need to link against shared
2815 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2816 if test -n "$deplibrary_names" ; then
2817 for tmp in $deplibrary_names ; do
2820 if test -f "$path/$depdepl" ; then
2821 depdepl="$path/$depdepl"
2823 # do not add paths which are already there
2824 case " $newlib_search_path " in
2826 *) newlib_search_path="$newlib_search_path $path";;
2839 # Again, we only want to link against shared libraries
2840 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2841 for tmp in $newlib_search_path ; do
2842 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2843 eval depdepl="$tmp/lib$tmp_libs.dylib"
2861 case " $deplibs " in
2863 *) deplibs="$depdepl $deplibs" ;;
2865 case " $deplibs " in
2867 *) deplibs="$deplibs $path" ;;
2870 fi # link_all_deplibs != no
2872 done # for deplib in $libs
2873 dependency_libs="$newdependency_libs"
2874 if test "$pass" = dlpreopen; then
2875 # Link the dlpreopened libraries before other libraries
2876 for deplib in $save_deplibs; do
2877 deplibs="$deplib $deplibs"
2880 if test "$pass" != dlopen; then
2881 if test "$pass" != conv; then
2882 # Make sure lib_search_path contains only unique directories.
2884 for dir in $newlib_search_path; do
2885 case "$lib_search_path " in
2887 *) lib_search_path="$lib_search_path $dir" ;;
2893 if test "$linkmode,$pass" != "prog,link"; then
2896 vars="compile_deplibs finalize_deplibs"
2898 for var in $vars dependency_libs; do
2899 # Add libraries to $var in reverse order
2900 eval tmp_libs=\"\$$var\"
2902 for deplib in $tmp_libs; do
2903 # FIXME: Pedantically, this is the right thing to do, so
2904 # that some nasty dependency loop isn't accidentally
2906 #new_libs="$deplib $new_libs"
2907 # Pragmatically, this seems to cause very few problems in
2910 -L*) new_libs="$deplib $new_libs" ;;
2913 # And here is the reason: when a library appears more
2914 # than once as an explicit dependence of a library, or
2915 # is implicitly linked in more than once by the
2916 # compiler, it is considered special, and multiple
2917 # occurrences thereof are not removed. Compare this
2918 # with having the same library being listed as a
2919 # dependency of multiple other libraries: in this case,
2920 # we know (pedantically, we assume) the library does not
2921 # need to be listed more than once, so we keep only the
2922 # last copy. This is not always right, but it is rare
2923 # enough that we require users that really mean to play
2924 # such unportable linking tricks to link the library
2925 # using -Wl,-lname, so that libtool does not consider it
2926 # for duplicate removal.
2927 case " $specialdeplibs " in
2928 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2930 case " $new_libs " in
2932 *) new_libs="$deplib $new_libs" ;;
2940 for deplib in $new_libs; do
2943 case " $tmp_libs " in
2945 *) tmp_libs="$tmp_libs $deplib" ;;
2948 *) tmp_libs="$tmp_libs $deplib" ;;
2951 eval $var=\"$tmp_libs\"
2954 # Last step: remove runtime libs from dependency_libs
2955 # (they stay in deplibs)
2957 for i in $dependency_libs ; do
2958 case " $predeps $postdeps $compiler_lib_search_path " in
2963 if test -n "$i" ; then
2964 tmp_libs="$tmp_libs $i"
2967 dependency_libs=$tmp_libs
2969 if test "$linkmode" = prog; then
2970 dlfiles="$newdlfiles"
2971 dlprefiles="$newdlprefiles"
2976 if test -n "$deplibs"; then
2977 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2980 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2981 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2984 if test -n "$rpath"; then
2985 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2988 if test -n "$xrpath"; then
2989 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2992 if test -n "$vinfo"; then
2993 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2996 if test -n "$release"; then
2997 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3000 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
3001 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3004 # Now set the variables for building old libraries.
3005 build_libtool_libs=no
3007 objs="$objs$old_deplibs"
3011 # Make sure we only generate libraries of the form `libNAME.la'.
3014 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3015 eval shared_ext=\"$shrext_cmds\"
3016 eval libname=\"$libname_spec\"
3019 if test "$module" = no; then
3020 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3024 if test "$need_lib_prefix" != no; then
3025 # Add the "lib" prefix for modules if required
3026 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3027 eval shared_ext=\"$shrext_cmds\"
3028 eval libname=\"$libname_spec\"
3030 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3035 if test -n "$objs"; then
3036 if test "$deplibs_check_method" != pass_all; then
3037 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3041 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3042 $echo "*** objects $objs is not portable!"
3043 libobjs="$libobjs $objs"
3047 if test "$dlself" != no; then
3048 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3052 if test "$#" -gt 2; then
3053 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3058 if test -z "$rpath"; then
3059 if test "$build_libtool_libs" = yes; then
3060 # Building a libtool convenience library.
3061 # Some compilers have problems with a `.al' extension so
3062 # convenience libraries should have the same extension an
3063 # archive normally would.
3064 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3065 build_libtool_libs=convenience
3069 if test -n "$vinfo"; then
3070 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3073 if test -n "$release"; then
3074 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3078 # Parse the version information argument.
3079 save_ifs="$IFS"; IFS=':'
3080 set dummy $vinfo 0 0 0
3083 if test -n "$8"; then
3084 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3089 # convert absolute version numbers to libtool ages
3090 # this retains compatibility with .la files and attempts
3091 # to make the code below a bit more comprehensible
3093 case $vinfo_number in
3097 number_revision="$4"
3099 # There are really only two kinds -- those that
3100 # use the current revision as the major version
3101 # and those that subtract age and use age as
3102 # a minor version. But, then there is irix
3103 # which has an extra 1 added just for fun
3105 case $version_type in
3106 darwin|linux|osf|windows)
3107 current=`expr $number_major + $number_minor`
3109 revision="$number_revision"
3111 freebsd-aout|freebsd-elf|sunos)
3112 current="$number_major"
3113 revision="$number_minor"
3117 current=`expr $number_major + $number_minor - 1`
3119 revision="$number_minor"
3130 # Check that each of the things are valid numbers.
3132 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3134 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3135 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3141 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3143 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3144 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3150 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
3152 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3153 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3158 if test "$age" -gt "$current"; then
3159 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3160 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3164 # Calculate the version variables.
3168 case $version_type in
3172 # Like Linux, but with the current version available in
3173 # verstring for coding it into the library header
3174 major=.`expr $current - $age`
3175 versuffix="$major.$age.$revision"
3176 # Darwin ld doesn't like 0 for these options...
3177 minor_current=`expr $current + 1`
3178 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3183 versuffix=".$current.$revision";
3188 versuffix=".$current";
3192 major=`expr $current - $age + 1`
3194 case $version_type in
3195 nonstopux) verstring_prefix=nonstopux ;;
3196 *) verstring_prefix=sgi ;;
3198 verstring="$verstring_prefix$major.$revision"
3200 # Add in all the interfaces that we are compatible with.
3202 while test "$loop" -ne 0; do
3203 iface=`expr $revision - $loop`
3204 loop=`expr $loop - 1`
3205 verstring="$verstring_prefix$major.$iface:$verstring"
3208 # Before this point, $major must not contain `.'.
3210 versuffix="$major.$revision"
3214 major=.`expr $current - $age`
3215 versuffix="$major.$age.$revision"
3219 major=.`expr $current - $age`
3220 versuffix=".$current.$age.$revision"
3221 verstring="$current.$age.$revision"
3223 # Add in all the interfaces that we are compatible with.
3225 while test "$loop" -ne 0; do
3226 iface=`expr $current - $loop`
3227 loop=`expr $loop - 1`
3228 verstring="$verstring:${iface}.0"
3231 # Make executables depend on our current version.
3232 verstring="$verstring:${current}.0"
3237 versuffix=".$current.$revision"
3241 # Use '-' rather than '.', since we only want one
3242 # extension on DOS 8.3 filesystems.
3243 major=`expr $current - $age`
3248 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3249 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3254 # Clear the version info if we defaulted, and they specified a release.
3255 if test -z "$vinfo" && test -n "$release"; then
3257 case $version_type in
3259 # we can't check for "0.0" in archive_cmds due to quoting
3260 # problems, so we reset it completely
3267 if test "$need_version" = no; then
3274 # Remove version info from name if versioning should be avoided
3275 if test "$avoid_version" = yes && test "$need_version" = no; then
3281 # Check to see if the archive will have undefined symbols.
3282 if test "$allow_undefined" = yes; then
3283 if test "$allow_undefined_flag" = unsupported; then
3284 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3285 build_libtool_libs=no
3289 # Don't allow undefined symbols.
3290 allow_undefined_flag="$no_undefined_flag"
3294 if test "$mode" != relink; then
3295 # Remove our outputs, but don't remove object files since they
3296 # may have been created when compiling PIC objects.
3298 tempremovelist=`$echo "$output_objdir/*"`
3299 for p in $tempremovelist; do
3303 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3304 if test "X$precious_files_regex" != "X"; then
3305 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3310 removelist="$removelist $p"
3315 if test -n "$removelist"; then
3316 $show "${rm}r $removelist"
3317 $run ${rm}r $removelist
3321 # Now set the variables for building old libraries.
3322 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3323 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3325 # Transform .lo files to .o files.
3326 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3329 # Eliminate all temporary directories.
3330 for path in $notinst_path; do
3331 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3332 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3333 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3336 if test -n "$xrpath"; then
3337 # If the user specified any rpath flags, then add them.
3339 for libdir in $xrpath; do
3340 temp_xrpath="$temp_xrpath -R$libdir"
3341 case "$finalize_rpath " in
3343 *) finalize_rpath="$finalize_rpath $libdir" ;;
3346 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3347 dependency_libs="$temp_xrpath $dependency_libs"
3351 # Make sure dlfiles contains only unique files that won't be dlpreopened
3352 old_dlfiles="$dlfiles"
3354 for lib in $old_dlfiles; do
3355 case " $dlprefiles $dlfiles " in
3357 *) dlfiles="$dlfiles $lib" ;;
3361 # Make sure dlprefiles contains only unique files
3362 old_dlprefiles="$dlprefiles"
3364 for lib in $old_dlprefiles; do
3365 case "$dlprefiles " in
3367 *) dlprefiles="$dlprefiles $lib" ;;
3371 if test "$build_libtool_libs" = yes; then
3372 if test -n "$rpath"; then
3374 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3375 # these systems don't actually have a c library (as such)!
3377 *-*-rhapsody* | *-*-darwin1.[012])
3378 # Rhapsody C library is in the System framework
3379 deplibs="$deplibs -framework System"
3382 # Don't link with libc until the a.out ld.so is fixed.
3384 *-*-openbsd* | *-*-freebsd*)
3385 # Do not include libc due to us having libc/libc_r.
3386 test "X$arg" = "X-lc" && continue
3389 # Add libc to deplibs on all other systems if necessary.
3390 if test "$build_libtool_need_lc" = "yes"; then
3391 deplibs="$deplibs -lc"
3397 # Transform deplibs into only deplibs that can be linked in shared.
3399 libname_save=$libname
3400 release_save=$release
3401 versuffix_save=$versuffix
3403 # I'm not sure if I'm treating the release correctly. I think
3404 # release should show up in the -l (ie -lgmp5) so we don't want to
3405 # add it in twice. Is that correct?
3411 case $deplibs_check_method in
3413 # Don't check for shared/static. Everything works.
3414 # This might be a little naive. We might want to check
3415 # whether the library exists or not. But this is on
3416 # osf3 & osf4 and I'm not really sure... Just
3417 # implementing what was already the behavior.
3421 # This code stresses the "libraries are programs" paradigm to its
3422 # limits. Maybe even breaks it. We compile a program, linking it
3423 # against the deplibs as a proxy for the library. Then we can check
3424 # whether they linked in statically or dynamically with ldd.
3426 cat > conftest.c <<EOF
3427 int main() { return 0; }
3430 $LTCC -o conftest conftest.c $deplibs
3431 if test "$?" -eq 0 ; then
3432 ldd_output=`ldd conftest`
3433 for i in $deplibs; do
3434 name="`expr $i : '-l\(.*\)'`"
3435 # If $name is empty we are operating on a -L argument.
3436 if test "$name" != "" && test "$name" -ne "0"; then
3437 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3438 case " $predeps $postdeps " in
3440 newdeplibs="$newdeplibs $i"
3445 if test -n "$i" ; then
3446 libname=`eval \\$echo \"$libname_spec\"`
3447 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3448 set dummy $deplib_matches
3450 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3451 newdeplibs="$newdeplibs $i"
3455 $echo "*** Warning: dynamic linker does not accept needed library $i."
3456 $echo "*** I have the capability to make that library automatically link in when"
3457 $echo "*** you link to this library. But I can only do this if you have a"
3458 $echo "*** shared version of the library, which I believe you do not have"
3459 $echo "*** because a test_compile did reveal that the linker did not use it for"
3460 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3464 newdeplibs="$newdeplibs $i"
3468 # Error occurred in the first compile. Let's try to salvage
3469 # the situation: Compile a separate program for each library.
3470 for i in $deplibs; do
3471 name="`expr $i : '-l\(.*\)'`"
3472 # If $name is empty we are operating on a -L argument.
3473 if test "$name" != "" && test "$name" != "0"; then
3475 $LTCC -o conftest conftest.c $i
3477 if test "$?" -eq 0 ; then
3478 ldd_output=`ldd conftest`
3479 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3480 case " $predeps $postdeps " in
3482 newdeplibs="$newdeplibs $i"
3487 if test -n "$i" ; then
3488 libname=`eval \\$echo \"$libname_spec\"`
3489 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3490 set dummy $deplib_matches
3492 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3493 newdeplibs="$newdeplibs $i"
3497 $echo "*** Warning: dynamic linker does not accept needed library $i."
3498 $echo "*** I have the capability to make that library automatically link in when"
3499 $echo "*** you link to this library. But I can only do this if you have a"
3500 $echo "*** shared version of the library, which you do not appear to have"
3501 $echo "*** because a test_compile did reveal that the linker did not use this one"
3502 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3508 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3509 $echo "*** make it link in! You will probably need to install it or some"
3510 $echo "*** library that it depends on before this library will be fully"
3511 $echo "*** functional. Installing it before continuing would be even better."
3514 newdeplibs="$newdeplibs $i"
3520 set dummy $deplibs_check_method
3521 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3522 for a_deplib in $deplibs; do
3523 name="`expr $a_deplib : '-l\(.*\)'`"
3524 # If $name is empty we are operating on a -L argument.
3525 if test "$name" != "" && test "$name" != "0"; then
3526 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3527 case " $predeps $postdeps " in
3529 newdeplibs="$newdeplibs $a_deplib"
3534 if test -n "$a_deplib" ; then
3535 libname=`eval \\$echo \"$libname_spec\"`
3536 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3537 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3538 for potent_lib in $potential_libs; do
3539 # Follow soft links.
3540 if ls -lLd "$potent_lib" 2>/dev/null \
3541 | grep " -> " >/dev/null; then
3544 # The statement above tries to avoid entering an
3545 # endless loop below, in case of cyclic links.
3546 # We might still enter an endless loop, since a link
3547 # loop can be closed while we follow links,
3549 potlib="$potent_lib"
3550 while test -h "$potlib" 2>/dev/null; do
3551 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3553 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3554 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3557 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3559 | $EGREP "$file_magic_regex" > /dev/null; then
3560 newdeplibs="$newdeplibs $a_deplib"
3567 if test -n "$a_deplib" ; then
3570 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3571 $echo "*** I have the capability to make that library automatically link in when"
3572 $echo "*** you link to this library. But I can only do this if you have a"
3573 $echo "*** shared version of the library, which you do not appear to have"
3574 $echo "*** because I did check the linker path looking for a file starting"
3575 if test -z "$potlib" ; then
3576 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3578 $echo "*** with $libname and none of the candidates passed a file format test"
3579 $echo "*** using a file magic. Last file checked: $potlib"
3583 # Add a -L argument.
3584 newdeplibs="$newdeplibs $a_deplib"
3586 done # Gone through all deplibs.
3589 set dummy $deplibs_check_method
3590 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3591 for a_deplib in $deplibs; do
3592 name="`expr $a_deplib : '-l\(.*\)'`"
3593 # If $name is empty we are operating on a -L argument.
3594 if test -n "$name" && test "$name" != "0"; then
3595 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3596 case " $predeps $postdeps " in
3598 newdeplibs="$newdeplibs $a_deplib"
3603 if test -n "$a_deplib" ; then
3604 libname=`eval \\$echo \"$libname_spec\"`
3605 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3606 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3607 for potent_lib in $potential_libs; do
3608 potlib="$potent_lib" # see symlink-check above in file_magic test
3609 if eval $echo \"$potent_lib\" 2>/dev/null \
3611 | $EGREP "$match_pattern_regex" > /dev/null; then
3612 newdeplibs="$newdeplibs $a_deplib"
3619 if test -n "$a_deplib" ; then
3622 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3623 $echo "*** I have the capability to make that library automatically link in when"
3624 $echo "*** you link to this library. But I can only do this if you have a"
3625 $echo "*** shared version of the library, which you do not appear to have"
3626 $echo "*** because I did check the linker path looking for a file starting"
3627 if test -z "$potlib" ; then
3628 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3630 $echo "*** with $libname and none of the candidates passed a file format test"
3631 $echo "*** using a regex pattern. Last file checked: $potlib"
3635 # Add a -L argument.
3636 newdeplibs="$newdeplibs $a_deplib"
3638 done # Gone through all deplibs.
3642 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3643 -e 's/ -[LR][^ ]*//g'`
3644 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3645 for i in $predeps $postdeps ; do
3646 # can't use Xsed below, because $i might contain '/'
3647 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3650 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3651 | grep . >/dev/null; then
3653 if test "X$deplibs_check_method" = "Xnone"; then
3654 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3656 $echo "*** Warning: inter-library dependencies are not known to be supported."
3658 $echo "*** All declared inter-library dependencies are being dropped."
3663 versuffix=$versuffix_save
3665 release=$release_save
3666 libname=$libname_save
3670 *-*-rhapsody* | *-*-darwin1.[012])
3671 # On Rhapsody replace the C library is the System framework
3672 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3676 if test "$droppeddeps" = yes; then
3677 if test "$module" = yes; then
3679 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3680 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3681 $echo "*** a static module, that should work as long as the dlopening"
3682 $echo "*** application is linked with the -dlopen flag."
3683 if test -z "$global_symbol_pipe"; then
3685 $echo "*** However, this would only work if libtool was able to extract symbol"
3686 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3687 $echo "*** not find such a program. So, this module is probably useless."
3688 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3690 if test "$build_old_libs" = no; then
3691 oldlibs="$output_objdir/$libname.$libext"
3692 build_libtool_libs=module
3695 build_libtool_libs=no
3698 $echo "*** The inter-library dependencies that have been dropped here will be"
3699 $echo "*** automatically added whenever a program is linked with this library"
3700 $echo "*** or is declared to -dlopen it."
3702 if test "$allow_undefined" = no; then
3704 $echo "*** Since this library must not contain undefined symbols,"
3705 $echo "*** because either the platform does not support them or"
3706 $echo "*** it was explicitly requested with -no-undefined,"
3707 $echo "*** libtool will only create a static version of it."
3708 if test "$build_old_libs" = no; then
3709 oldlibs="$output_objdir/$libname.$libext"
3710 build_libtool_libs=module
3713 build_libtool_libs=no
3718 # Time to change all our "foo.framework" stuff back to "-framework foo"
3721 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
3722 dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).framework%%g'`
3725 # Done checking deplibs!
3729 # All the library-specific variables (install_libdir is set above).
3734 # Test again, we may have decided not to build it any more
3735 if test "$build_libtool_libs" = yes; then
3736 if test "$hardcode_into_libs" = yes; then
3737 # Hardcode the library paths
3740 rpath="$finalize_rpath"
3741 test "$mode" != relink && rpath="$compile_rpath$rpath"
3742 for libdir in $rpath; do
3743 if test -n "$hardcode_libdir_flag_spec"; then
3744 if test -n "$hardcode_libdir_separator"; then
3745 if test -z "$hardcode_libdirs"; then
3746 hardcode_libdirs="$libdir"
3748 # Just accumulate the unique libdirs.
3749 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3750 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3753 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3758 eval flag=\"$hardcode_libdir_flag_spec\"
3759 dep_rpath="$dep_rpath $flag"
3761 elif test -n "$runpath_var"; then
3762 case "$perm_rpath " in
3764 *) perm_rpath="$perm_rpath $libdir" ;;
3768 # Substitute the hardcoded libdirs into the rpath.
3769 if test -n "$hardcode_libdir_separator" &&
3770 test -n "$hardcode_libdirs"; then
3771 libdir="$hardcode_libdirs"
3772 if test -n "$hardcode_libdir_flag_spec_ld"; then
3773 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3775 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3778 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3779 # We should set the runpath_var.
3781 for dir in $perm_rpath; do
3784 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3786 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3789 shlibpath="$finalize_shlibpath"
3790 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3791 if test -n "$shlibpath"; then
3792 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3795 # Get the real and link names of the library.
3796 eval shared_ext=\"$shrext_cmds\"
3797 eval library_names=\"$library_names_spec\"
3798 set dummy $library_names
3802 if test -n "$soname_spec"; then
3803 eval soname=\"$soname_spec\"
3807 if test -z "$dlname"; then
3811 lib="$output_objdir/$realname"
3814 linknames="$linknames $link"
3817 # Use standard objects if they are pic
3818 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3820 # Prepare the list of exported symbols
3821 if test -z "$export_symbols"; then
3822 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3823 $show "generating symbol list for \`$libname.la'"
3824 export_symbols="$output_objdir/$libname.exp"
3825 $run $rm $export_symbols
3826 cmds=$export_symbols_cmds
3827 save_ifs="$IFS"; IFS='~'
3828 for cmd in $cmds; do
3831 if len=`expr "X$cmd" : ".*"` &&
3832 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3834 $run eval "$cmd" || exit $?
3835 skipped_export=false
3837 # The command line is too long to execute in one step.
3838 $show "using reloadable object file for export list..."
3843 if test -n "$export_symbols_regex"; then
3844 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3845 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3846 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3847 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3852 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3853 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3857 for test_deplib in $deplibs; do
3858 case " $convenience " in
3859 *" $test_deplib "*) ;;
3861 tmp_deplibs="$tmp_deplibs $test_deplib"
3865 deplibs="$tmp_deplibs"
3867 if test -n "$convenience"; then
3868 if test -n "$whole_archive_flag_spec"; then
3869 save_libobjs=$libobjs
3870 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3872 gentop="$output_objdir/${outputname}x"
3873 generated="$generated $gentop"
3875 func_extract_archives $gentop $convenience
3876 libobjs="$libobjs $func_extract_archives_result"
3880 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3881 eval flag=\"$thread_safe_flag_spec\"
3882 linker_flags="$linker_flags $flag"
3885 # Make a backup of the uninstalled library when relinking
3886 if test "$mode" = relink; then
3887 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3890 # Do each of the archive commands.
3891 if test "$module" = yes && test -n "$module_cmds" ; then
3892 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3893 eval test_cmds=\"$module_expsym_cmds\"
3894 cmds=$module_expsym_cmds
3896 eval test_cmds=\"$module_cmds\"
3900 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3901 eval test_cmds=\"$archive_expsym_cmds\"
3902 cmds=$archive_expsym_cmds
3904 eval test_cmds=\"$archive_cmds\"
3909 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
3910 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3913 # The command line is too long to link in one step, link piecewise.
3914 $echo "creating reloadable object files..."
3916 # Save the value of $output and $libobjs because we want to
3917 # use them later. If we have whole_archive_flag_spec, we
3918 # want to use save_libobjs as it was before
3919 # whole_archive_flag_spec was expanded, because we can't
3920 # assume the linker understands whole_archive_flag_spec.
3921 # This may have to be revisited, in case too many
3922 # convenience libraries get linked in and end up exceeding
3924 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3925 save_libobjs=$libobjs
3929 # Clear the reloadable object creation command queue and
3930 # initialize k to one.
3937 output=$output_objdir/$save_output-${k}.$objext
3938 # Loop over the list of objects to be linked.
3939 for obj in $save_libobjs
3941 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3942 if test "X$objlist" = X ||
3943 { len=`expr "X$test_cmds" : ".*"` &&
3944 test "$len" -le "$max_cmd_len"; }; then
3945 objlist="$objlist $obj"
3947 # The command $test_cmds is almost too long, add a
3948 # command to the queue.
3949 if test "$k" -eq 1 ; then
3950 # The first file doesn't have a previous command to add.
3951 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3953 # All subsequent reloadable object files will link in
3954 # the last one created.
3955 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3957 last_robj=$output_objdir/$save_output-${k}.$objext
3959 output=$output_objdir/$save_output-${k}.$objext
3964 # Handle the remaining objects by creating one last
3965 # reloadable object file. All subsequent reloadable object
3966 # files will link in the last one created.
3967 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3968 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3970 if ${skipped_export-false}; then
3971 $show "generating symbol list for \`$libname.la'"
3972 export_symbols="$output_objdir/$libname.exp"
3973 $run $rm $export_symbols
3975 # Append the command to create the export file.
3976 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3979 # Set up a command to remove the reloadale object files
3980 # after they are used.
3982 while test "$i" -lt "$k"
3985 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
3988 $echo "creating a temporary reloadable object file: $output"
3990 # Loop through the commands generated above and execute them.
3991 save_ifs="$IFS"; IFS='~'
3992 for cmd in $concat_cmds; do
3995 $run eval "$cmd" || exit $?
4000 # Restore the value of output.
4003 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4004 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
4006 # Expand the library linking commands again to reset the
4007 # value of $libobjs for piecewise linking.
4009 # Do each of the archive commands.
4010 if test "$module" = yes && test -n "$module_cmds" ; then
4011 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4012 cmds=$module_expsym_cmds
4017 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4018 cmds=$archive_expsym_cmds
4024 # Append the command to remove the reloadable object files
4025 # to the just-reset $cmds.
4026 eval cmds=\"\$cmds~\$rm $delfiles\"
4028 save_ifs="$IFS"; IFS='~'
4029 for cmd in $cmds; do
4033 $run eval "$cmd" || exit $?
4037 # Restore the uninstalled library and exit
4038 if test "$mode" = relink; then
4039 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4043 # Create links to the real library.
4044 for linkname in $linknames; do
4045 if test "$realname" != "$linkname"; then
4046 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4047 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4051 # If -module or -export-dynamic was specified, set the dlname.
4052 if test "$module" = yes || test "$export_dynamic" = yes; then
4053 # On all known operating systems, these are identical.
4060 if test -n "$deplibs"; then
4061 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4064 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4065 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4068 if test -n "$rpath"; then
4069 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4072 if test -n "$xrpath"; then
4073 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4076 if test -n "$vinfo"; then
4077 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4080 if test -n "$release"; then
4081 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4086 if test -n "$objs$old_deplibs"; then
4087 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4091 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4099 # Delete the old objects.
4100 $run $rm $obj $libobj
4102 # Objects from convenience libraries. This assumes
4103 # single-version convenience libraries. Whenever we create
4104 # different ones for PIC/non-PIC, this we'll have to duplicate
4108 # reload_cmds runs $LD directly, so let us get rid of
4109 # -Wl from whole_archive_flag_spec
4112 if test -n "$convenience"; then
4113 if test -n "$whole_archive_flag_spec"; then
4114 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4116 gentop="$output_objdir/${obj}x"
4117 generated="$generated $gentop"
4119 func_extract_archives $gentop $convenience
4120 reload_conv_objs="$reload_objs $func_extract_archives_result"
4124 # Create the old-style object.
4125 reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
4129 save_ifs="$IFS"; IFS='~'
4130 for cmd in $cmds; do
4134 $run eval "$cmd" || exit $?
4138 # Exit if we aren't doing a library object file.
4139 if test -z "$libobj"; then
4140 if test -n "$gentop"; then
4141 $show "${rm}r $gentop"
4148 if test "$build_libtool_libs" != yes; then
4149 if test -n "$gentop"; then
4150 $show "${rm}r $gentop"
4154 # Create an invalid libtool object if no PIC, so that we don't
4155 # accidentally link it into a program.
4156 # $show "echo timestamp > $libobj"
4157 # $run eval "echo timestamp > $libobj" || exit $?
4161 if test -n "$pic_flag" || test "$pic_mode" != default; then
4162 # Only do commands if we really have different PIC objects.
4163 reload_objs="$libobjs $reload_conv_objs"
4166 save_ifs="$IFS"; IFS='~'
4167 for cmd in $cmds; do
4171 $run eval "$cmd" || exit $?
4176 if test -n "$gentop"; then
4177 $show "${rm}r $gentop"
4186 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4188 if test -n "$vinfo"; then
4189 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4192 if test -n "$release"; then
4193 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4196 if test "$preload" = yes; then
4197 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4198 test "$dlopen_self_static" = unknown; then
4199 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4204 *-*-rhapsody* | *-*-darwin1.[012])
4205 # On Rhapsody replace the C library is the System framework
4206 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4207 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4213 # Don't allow lazy linking, it breaks C++ global constructors
4214 if test "$tagname" = CXX ; then
4215 compile_command="$compile_command ${wl}-bind_at_load"
4216 finalize_command="$finalize_command ${wl}-bind_at_load"
4218 # Time to change all our "foo.framework" stuff back to "-framework foo"
4219 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
4220 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
4224 compile_command="$compile_command $compile_deplibs"
4225 finalize_command="$finalize_command $finalize_deplibs"
4227 if test -n "$rpath$xrpath"; then
4228 # If the user specified any rpath flags, then add them.
4229 for libdir in $rpath $xrpath; do
4230 # This is the magic to use -rpath.
4231 case "$finalize_rpath " in
4233 *) finalize_rpath="$finalize_rpath $libdir" ;;
4238 # Now hardcode the library paths
4241 for libdir in $compile_rpath $finalize_rpath; do
4242 if test -n "$hardcode_libdir_flag_spec"; then
4243 if test -n "$hardcode_libdir_separator"; then
4244 if test -z "$hardcode_libdirs"; then
4245 hardcode_libdirs="$libdir"
4247 # Just accumulate the unique libdirs.
4248 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4249 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4252 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4257 eval flag=\"$hardcode_libdir_flag_spec\"
4258 rpath="$rpath $flag"
4260 elif test -n "$runpath_var"; then
4261 case "$perm_rpath " in
4263 *) perm_rpath="$perm_rpath $libdir" ;;
4267 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4268 case :$dllsearchpath: in
4270 *) dllsearchpath="$dllsearchpath:$libdir";;
4275 # Substitute the hardcoded libdirs into the rpath.
4276 if test -n "$hardcode_libdir_separator" &&
4277 test -n "$hardcode_libdirs"; then
4278 libdir="$hardcode_libdirs"
4279 eval rpath=\" $hardcode_libdir_flag_spec\"
4281 compile_rpath="$rpath"
4285 for libdir in $finalize_rpath; do
4286 if test -n "$hardcode_libdir_flag_spec"; then
4287 if test -n "$hardcode_libdir_separator"; then
4288 if test -z "$hardcode_libdirs"; then
4289 hardcode_libdirs="$libdir"
4291 # Just accumulate the unique libdirs.
4292 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4293 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4296 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4301 eval flag=\"$hardcode_libdir_flag_spec\"
4302 rpath="$rpath $flag"
4304 elif test -n "$runpath_var"; then
4305 case "$finalize_perm_rpath " in
4307 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4311 # Substitute the hardcoded libdirs into the rpath.
4312 if test -n "$hardcode_libdir_separator" &&
4313 test -n "$hardcode_libdirs"; then
4314 libdir="$hardcode_libdirs"
4315 eval rpath=\" $hardcode_libdir_flag_spec\"
4317 finalize_rpath="$rpath"
4319 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4320 # Transform all the library objects into standard objects.
4321 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4322 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4326 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4327 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4328 dlsyms="${outputname}S.c"
4330 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4334 if test -n "$dlsyms"; then
4338 # Discover the nlist of each of the dlfiles.
4339 nlist="$output_objdir/${outputname}.nm"
4341 $show "$rm $nlist ${nlist}S ${nlist}T"
4342 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4344 # Parse the name list into a source file.
4345 $show "creating $output_objdir/$dlsyms"
4347 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4348 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4349 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4355 /* Prevent the only kind of declaration conflicts we can make. */
4356 #define lt_preloaded_symbols some_other_symbol
4358 /* External symbol declarations for the compiler. */\
4361 if test "$dlself" = yes; then
4362 $show "generating symbol list for \`$output'"
4364 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4366 # Add our own program objects to the symbol list.
4367 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4368 for arg in $progfiles; do
4369 $show "extracting global C symbols from \`$arg'"
4370 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4373 if test -n "$exclude_expsyms"; then
4374 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4375 $run eval '$mv "$nlist"T "$nlist"'
4378 if test -n "$export_symbols_regex"; then
4379 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4380 $run eval '$mv "$nlist"T "$nlist"'
4383 # Prepare the list of exported symbols
4384 if test -z "$export_symbols"; then
4385 export_symbols="$output_objdir/$output.exp"
4386 $run $rm $export_symbols
4387 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4389 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4390 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4391 $run eval 'mv "$nlist"T "$nlist"'
4395 for arg in $dlprefiles; do
4396 $show "extracting global C symbols from \`$arg'"
4397 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4398 $run eval '$echo ": $name " >> "$nlist"'
4399 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4402 if test -z "$run"; then
4403 # Make sure we have at least an empty file.
4404 test -f "$nlist" || : > "$nlist"
4406 if test -n "$exclude_expsyms"; then
4407 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4408 $mv "$nlist"T "$nlist"
4411 # Try sorting and uniquifying the output.
4412 if grep -v "^: " < "$nlist" |
4413 if sort -k 3 </dev/null >/dev/null 2>&1; then
4418 uniq > "$nlist"S; then
4421 grep -v "^: " < "$nlist" > "$nlist"S
4424 if test -f "$nlist"S; then
4425 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4427 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4430 $echo >> "$output_objdir/$dlsyms" "\
4432 #undef lt_preloaded_symbols
4434 #if defined (__STDC__) && __STDC__
4435 # define lt_ptr void *
4437 # define lt_ptr char *
4441 /* The mapping between symbol names and symbols. */
4446 lt_preloaded_symbols[] =
4450 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4452 $echo >> "$output_objdir/$dlsyms" "\
4456 /* This works around a problem in FreeBSD linker */
4457 #ifdef FREEBSD_WORKAROUND
4458 static const void *lt_preloaded_setup() {
4459 return lt_preloaded_symbols;
4469 pic_flag_for_symtable=
4471 # compiling the symbol table file with pic_flag works around
4472 # a FreeBSD bug that causes programs to crash when -lm is
4473 # linked before any other PIC object. But we must not use
4474 # pic_flag when linking with -static. The problem exists in
4475 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4476 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4477 case "$compile_command " in
4479 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4482 case "$compile_command " in
4484 *) pic_flag_for_symtable=" $pic_flag";;
4488 # Now compile the dynamic symbol file.
4489 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4490 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4492 # Clean up the generated files.
4493 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4494 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4496 # Transform the symbol file into the correct name.
4497 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4498 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4501 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4506 # We keep going just in case the user didn't refer to
4507 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4508 # really was required.
4510 # Nullify the symbol file.
4511 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4512 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4515 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4516 # Replace the output file specification.
4517 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4518 link_command="$compile_command$compile_rpath"
4520 # We have no uninstalled library dependencies, so finalize right now.
4521 $show "$link_command"
4522 $run eval "$link_command"
4525 # Delete the generated files.
4526 if test -n "$dlsyms"; then
4527 $show "$rm $output_objdir/${outputname}S.${objext}"
4528 $run $rm "$output_objdir/${outputname}S.${objext}"
4534 if test -n "$shlibpath_var"; then
4535 # We should set the shlibpath_var
4537 for dir in $temp_rpath; do
4539 [\\/]* | [A-Za-z]:[\\/]*)
4544 # Relative path: add a thisdir entry.
4545 rpath="$rpath\$thisdir/$dir:"
4552 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4553 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4555 if test -n "$finalize_shlibpath"; then
4556 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4561 if test -n "$runpath_var"; then
4562 if test -n "$perm_rpath"; then
4563 # We should set the runpath_var.
4565 for dir in $perm_rpath; do
4568 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4570 if test -n "$finalize_perm_rpath"; then
4571 # We should set the runpath_var.
4573 for dir in $finalize_perm_rpath; do
4576 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4580 if test "$no_install" = yes; then
4581 # We don't need to create a wrapper script.
4582 link_command="$compile_var$compile_command$compile_rpath"
4583 # Replace the output file specification.
4584 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4585 # Delete the old output file.
4587 # Link the executable and exit
4588 $show "$link_command"
4589 $run eval "$link_command" || exit $?
4593 if test "$hardcode_action" = relink; then
4594 # Fast installation is not supported
4595 link_command="$compile_var$compile_command$compile_rpath"
4596 relink_command="$finalize_var$finalize_command$finalize_rpath"
4598 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4599 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4601 if test "$fast_install" != no; then
4602 link_command="$finalize_var$compile_command$finalize_rpath"
4603 if test "$fast_install" = yes; then
4604 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4606 # fast_install is set to needless
4610 link_command="$compile_var$compile_command$compile_rpath"
4611 relink_command="$finalize_var$finalize_command$finalize_rpath"
4615 # Replace the output file specification.
4616 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4618 # Delete the old output files.
4619 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4621 $show "$link_command"
4622 $run eval "$link_command" || exit $?
4624 # Now create the wrapper script.
4625 $show "creating $output"
4627 # Quote the relink command for shipping.
4628 if test -n "$relink_command"; then
4629 # Preserve any variables that may affect compiler behavior
4630 for var in $variables_saved_for_relink; do
4631 if eval test -z \"\${$var+set}\"; then
4632 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4633 elif eval var_value=\$$var; test -z "$var_value"; then
4634 relink_command="$var=; export $var; $relink_command"
4636 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4637 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4640 relink_command="(cd `pwd`; $relink_command)"
4641 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4644 # Quote $echo for shipping.
4645 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4647 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4648 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4650 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4652 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4655 # Only actually do things if our run command is non-null.
4656 if test -z "$run"; then
4657 # win32 will think the script is a binary if it has
4658 # a .exe suffix, so we strip it off here.
4660 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4662 # test for cygwin because mv fails w/o .exe extensions
4666 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4670 *cygwin* | *mingw* )
4671 cwrappersource=`$echo ${objdir}/lt-${output}.c`
4672 cwrapper=`$echo ${output}.exe`
4673 $rm $cwrappersource $cwrapper
4674 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4676 cat > $cwrappersource <<EOF
4678 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4679 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4681 The $output program cannot be directly executed until all the libtool
4682 libraries that it depends on are installed.
4684 This wrapper executable should never be moved out of the build directory.
4685 If it is, it will not operate correctly.
4687 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4688 but could eventually absorb all of the scripts functionality and
4689 exec $objdir/$outputname directly.
4692 cat >> $cwrappersource<<"EOF"
4700 #if defined(PATH_MAX)
4701 # define LT_PATHMAX PATH_MAX
4702 #elif defined(MAXPATHLEN)
4703 # define LT_PATHMAX MAXPATHLEN
4705 # define LT_PATHMAX 1024
4708 #ifndef DIR_SEPARATOR
4709 #define DIR_SEPARATOR '/'
4712 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4714 #define HAVE_DOS_BASED_FILE_SYSTEM
4715 #ifndef DIR_SEPARATOR_2
4716 #define DIR_SEPARATOR_2 '\\'
4720 #ifndef DIR_SEPARATOR_2
4721 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4722 #else /* DIR_SEPARATOR_2 */
4723 # define IS_DIR_SEPARATOR(ch) \
4724 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4725 #endif /* DIR_SEPARATOR_2 */
4727 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4728 #define XFREE(stale) do { \
4729 if (stale) { free ((void *) stale); stale = 0; } \
4732 const char *program_name = NULL;
4734 void * xmalloc (size_t num);
4735 char * xstrdup (const char *string);
4736 char * basename (const char *name);
4737 char * fnqualify(const char *path);
4738 char * strendzap(char *str, const char *pat);
4739 void lt_fatal (const char *message, ...);
4742 main (int argc, char *argv[])
4747 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4748 newargz = XMALLOC(char *, argc+2);
4751 cat >> $cwrappersource <<EOF
4752 newargz[0] = "$SHELL";
4755 cat >> $cwrappersource <<"EOF"
4756 newargz[1] = fnqualify(argv[0]);
4757 /* we know the script has the same name, without the .exe */
4758 /* so make sure newargz[1] doesn't end in .exe */
4759 strendzap(newargz[1],".exe");
4760 for (i = 1; i < argc; i++)
4761 newargz[i+1] = xstrdup(argv[i]);
4762 newargz[argc+1] = NULL;
4765 cat >> $cwrappersource <<EOF
4766 execv("$SHELL",newargz);
4769 cat >> $cwrappersource <<"EOF"
4773 xmalloc (size_t num)
4775 void * p = (void *) malloc (num);
4777 lt_fatal ("Memory exhausted");
4783 xstrdup (const char *string)
4785 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4790 basename (const char *name)
4794 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4795 /* Skip over the disk name in MSDOS pathnames. */
4796 if (isalpha (name[0]) && name[1] == ':')
4800 for (base = name; *name; name++)
4801 if (IS_DIR_SEPARATOR (*name))
4803 return (char *) base;
4807 fnqualify(const char *path)
4811 char tmp[LT_PATHMAX + 1];
4813 assert(path != NULL);
4815 /* Is it qualified already? */
4816 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4817 if (isalpha (path[0]) && path[1] == ':')
4818 return xstrdup (path);
4820 if (IS_DIR_SEPARATOR (path[0]))
4821 return xstrdup (path);
4823 /* prepend the current directory */
4824 /* doesn't handle '~' */
4825 if (getcwd (tmp, LT_PATHMAX) == NULL)
4826 lt_fatal ("getcwd failed");
4827 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4828 p = XMALLOC(char, size);
4829 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4834 strendzap(char *str, const char *pat)
4838 assert(str != NULL);
4839 assert(pat != NULL);
4842 patlen = strlen(pat);
4846 str += len - patlen;
4847 if (strcmp(str, pat) == 0)
4854 lt_error_core (int exit_status, const char * mode,
4855 const char * message, va_list ap)
4857 fprintf (stderr, "%s: %s: ", program_name, mode);
4858 vfprintf (stderr, message, ap);
4859 fprintf (stderr, ".\n");
4861 if (exit_status >= 0)
4866 lt_fatal (const char *message, ...)
4869 va_start (ap, message);
4870 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4874 # we should really use a build-platform specific compiler
4875 # here, but OTOH, the wrappers (shell script and this C one)
4876 # are only useful if you want to execute the "real" binary.
4877 # Since the "real" binary is built for $host, then this
4878 # wrapper might as well be built for $host, too.
4879 $run $LTCC -s -o $cwrapper $cwrappersource
4883 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4888 # $output - temporary wrapper script for $objdir/$outputname
4889 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4891 # The $output program cannot be directly executed until all the libtool
4892 # libraries that it depends on are installed.
4894 # This wrapper script should never be moved out of the build directory.
4895 # If it is, it will not operate correctly.
4897 # Sed substitution that helps us do robust quoting. It backslashifies
4898 # metacharacters that are still active within double-quoted strings.
4899 Xsed='${SED} -e 1s/^X//'
4900 sed_quote_subst='$sed_quote_subst'
4902 # The HP-UX ksh and POSIX shell print the target directory to stdout
4904 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4906 relink_command=\"$relink_command\"
4908 # This environment variable determines our operation mode.
4909 if test \"\$libtool_install_magic\" = \"$magic\"; then
4910 # install mode needs the following variable:
4911 notinst_deplibs='$notinst_deplibs'
4913 # When we are sourced in execute mode, \$file and \$echo are already set.
4914 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4917 # Make sure echo works.
4918 if test \"X\$1\" = X--no-reexec; then
4919 # Discard the --no-reexec flag, and continue.
4921 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4922 # Yippee, \$echo works!
4925 # Restart under the correct shell, and then maybe \$echo will work.
4926 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4932 # Find the directory that this script lives in.
4933 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4934 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4936 # Follow symbolic links until we get to the real thisdir.
4937 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4938 while test -n \"\$file\"; do
4939 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4941 # If there was a directory component, then change thisdir.
4942 if test \"x\$destdir\" != \"x\$file\"; then
4943 case \"\$destdir\" in
4944 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4945 *) thisdir=\"\$thisdir/\$destdir\" ;;
4949 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4950 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4953 # Try to get the absolute directory name.
4954 absdir=\`cd \"\$thisdir\" && pwd\`
4955 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4958 if test "$fast_install" = yes; then
4960 program=lt-'$outputname'$exeext
4961 progdir=\"\$thisdir/$objdir\"
4963 if test ! -f \"\$progdir/\$program\" || \\
4964 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4965 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4967 file=\"\$\$-\$program\"
4969 if test ! -d \"\$progdir\"; then
4970 $mkdir \"\$progdir\"
4972 $rm \"\$progdir/\$file\"
4977 # relink executable if necessary
4978 if test -n \"\$relink_command\"; then
4979 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4981 $echo \"\$relink_command_output\" >&2
4982 $rm \"\$progdir/\$file\"
4987 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4988 { $rm \"\$progdir/\$program\";
4989 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4990 $rm \"\$progdir/\$file\"
4994 program='$outputname'
4995 progdir=\"\$thisdir/$objdir\"
5001 if test -f \"\$progdir/\$program\"; then"
5003 # Export our shlibpath_var if we have one.
5004 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5006 # Add our own library path to $shlibpath_var
5007 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5009 # Some systems cannot cope with colon-terminated $shlibpath_var
5010 # The second colon is a workaround for a bug in BeOS R4 sed
5011 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5013 export $shlibpath_var
5017 # fixup the dll searchpath if we need to.
5018 if test -n "$dllsearchpath"; then
5020 # Add the dll search path components to the executable PATH
5021 PATH=$dllsearchpath:\$PATH
5026 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5027 # Run the actual program with our arguments.
5030 # Backslashes separate directories on plain windows
5031 *-*-mingw | *-*-os2*)
5033 exec \$progdir\\\\\$program \${1+\"\$@\"}
5039 exec \$progdir/\$program \${1+\"\$@\"}
5044 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5048 # The program doesn't exist.
5049 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5050 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5051 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5062 # See if we need to build an old-fashioned archive.
5063 for oldlib in $oldlibs; do
5065 if test "$build_libtool_libs" = convenience; then
5066 oldobjs="$libobjs_save"
5067 addlibs="$convenience"
5068 build_libtool_libs=no
5070 if test "$build_libtool_libs" = module; then
5071 oldobjs="$libobjs_save"
5072 build_libtool_libs=no
5074 oldobjs="$old_deplibs $non_pic_objects"
5076 addlibs="$old_convenience"
5079 if test -n "$addlibs"; then
5080 gentop="$output_objdir/${outputname}x"
5081 generated="$generated $gentop"
5083 func_extract_archives $gentop $addlibs
5084 oldobjs="$oldobjs $func_extract_archives_result"
5087 # Do each command in the archive commands.
5088 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5089 cmds=$old_archive_from_new_cmds
5091 eval cmds=\"$old_archive_cmds\"
5093 if len=`expr "X$cmds" : ".*"` &&
5094 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5095 cmds=$old_archive_cmds
5097 # the command line is too long to link in one step, link in parts
5098 $echo "using piecewise archive linking..."
5103 save_oldobjs=$oldobjs
5104 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5105 # encoded into archives. This makes 'ar r' malfunction in
5106 # this piecewise linking case whenever conflicting object
5107 # names appear in distinct ar calls; check, warn and compensate.
5108 if (for obj in $save_oldobjs
5110 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5111 done | sort | sort -uc >/dev/null 2>&1); then
5114 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5115 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5118 # Is there a better way of finding the last object in the list?
5119 for obj in $save_oldobjs
5123 for obj in $save_oldobjs
5125 oldobjs="$objlist $obj"
5126 objlist="$objlist $obj"
5127 eval test_cmds=\"$old_archive_cmds\"
5128 if len=`expr "X$test_cmds" : ".*"` &&
5129 test "$len" -le "$max_cmd_len"; then
5132 # the above command should be used before it gets too long
5134 if test "$obj" = "$last_oldobj" ; then
5137 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5138 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5144 if test "X$oldobjs" = "X" ; then
5145 eval cmds=\"\$concat_cmds\"
5147 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5151 save_ifs="$IFS"; IFS='~'
5152 for cmd in $cmds; do
5156 $run eval "$cmd" || exit $?
5161 if test -n "$generated"; then
5162 $show "${rm}r$generated"
5163 $run ${rm}r$generated
5166 # Now create the libtool archive.
5170 test "$build_old_libs" = yes && old_library="$libname.$libext"
5171 $show "creating $output"
5173 # Preserve any variables that may affect compiler behavior
5174 for var in $variables_saved_for_relink; do
5175 if eval test -z \"\${$var+set}\"; then
5176 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5177 elif eval var_value=\$$var; test -z "$var_value"; then
5178 relink_command="$var=; export $var; $relink_command"
5180 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5181 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5184 # Quote the link command for shipping.
5185 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5186 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5187 if test "$hardcode_automatic" = yes ; then
5192 # Only create the output if not a dry run.
5193 if test -z "$run"; then
5194 for installed in no yes; do
5195 if test "$installed" = yes; then
5196 if test -z "$install_libdir"; then
5199 output="$output_objdir/$outputname"i
5200 # Replace all uninstalled libtool libraries with the installed ones
5202 for deplib in $dependency_libs; do
5205 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5206 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5207 if test -z "$libdir"; then
5208 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5211 newdependency_libs="$newdependency_libs $libdir/$name"
5213 *) newdependency_libs="$newdependency_libs $deplib" ;;
5216 dependency_libs="$newdependency_libs"
5218 for lib in $dlfiles; do
5219 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5220 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5221 if test -z "$libdir"; then
5222 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5225 newdlfiles="$newdlfiles $libdir/$name"
5227 dlfiles="$newdlfiles"
5229 for lib in $dlprefiles; do
5230 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5231 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5232 if test -z "$libdir"; then
5233 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5236 newdlprefiles="$newdlprefiles $libdir/$name"
5238 dlprefiles="$newdlprefiles"
5241 for lib in $dlfiles; do
5243 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5244 *) abs=`pwd`"/$lib" ;;
5246 newdlfiles="$newdlfiles $abs"
5248 dlfiles="$newdlfiles"
5250 for lib in $dlprefiles; do
5252 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5253 *) abs=`pwd`"/$lib" ;;
5255 newdlprefiles="$newdlprefiles $abs"
5257 dlprefiles="$newdlprefiles"
5260 # place dlname in correct position for cygwin
5262 case $host,$output,$installed,$module,$dlname in
5263 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5266 # $outputname - a libtool library file
5267 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5269 # Please DO NOT delete this file!
5270 # It is necessary for linking the library.
5272 # The name that we can dlopen(3).
5275 # Names of this library.
5276 library_names='$library_names'
5278 # The name of the static archive.
5279 old_library='$old_library'
5281 # Libraries that this one depends upon.
5282 dependency_libs='$dependency_libs'
5284 # Version information for $libname.
5289 # Is this an already installed library?
5290 installed=$installed
5292 # Should we warn about portability when linking against -modules?
5293 shouldnotlink=$module
5295 # Files to dlopen/dlpreopen
5297 dlpreopen='$dlprefiles'
5299 # Directory that this library needs to be installed in:
5300 libdir='$install_libdir'"
5301 if test "$installed" = no && test "$need_relink" = yes; then
5303 relink_command=\"$relink_command\""
5308 # Do a symbolic link so that the libtool archive can be found in
5309 # LD_LIBRARY_PATH before the program is installed.
5310 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5311 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5317 # libtool install mode
5319 modename="$modename: install"
5321 # There may be an optional sh(1) argument at the beginning of
5322 # install_prog (especially on Windows NT).
5323 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5324 # Allow the use of GNU shtool's install command.
5325 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5326 # Aesthetically quote it.
5327 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5329 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5333 install_prog="$arg "
5341 # The real first argument should be the name of the installation program.
5342 # Aesthetically quote it.
5343 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5345 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5349 install_prog="$install_prog$arg"
5351 # We need to accept at least all the BSD install flags.
5361 if test -n "$dest"; then
5362 files="$files $dest"
5380 # If the previous option needed an argument, then skip it.
5381 if test -n "$prev"; then
5390 # Aesthetically quote the argument.
5391 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5393 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
5397 install_prog="$install_prog $arg"
5400 if test -z "$install_prog"; then
5401 $echo "$modename: you must specify an install program" 1>&2
5406 if test -n "$prev"; then
5407 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5412 if test -z "$files"; then
5413 if test -z "$dest"; then
5414 $echo "$modename: no file or destination specified" 1>&2
5416 $echo "$modename: you must specify a destination" 1>&2
5422 # Strip any trailing slash from the destination.
5423 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5425 # Check to see that the destination is a directory.
5426 test -d "$dest" && isdir=yes
5427 if test "$isdir" = yes; then
5431 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5432 test "X$destdir" = "X$dest" && destdir=.
5433 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5435 # Not a directory, so check to see that there is only one file specified.
5437 if test "$#" -gt 2; then
5438 $echo "$modename: \`$dest' is not a directory" 1>&2
5444 [\\/]* | [A-Za-z]:[\\/]*) ;;
5446 for file in $files; do
5450 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5459 # This variable tells wrapper scripts just to set variables rather
5460 # than running their programs.
5461 libtool_install_magic="$magic"
5466 for file in $files; do
5468 # Do each installation.
5471 # Do the static libraries later.
5472 staticlibs="$staticlibs $file"
5476 # Check to see that this really is a libtool archive.
5477 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5479 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5487 # If there is no directory component, then add one.
5489 */* | *\\*) . $file ;;
5493 # Add the libdir to current_libdirs if it is the destination.
5494 if test "X$destdir" = "X$libdir"; then
5495 case "$current_libdirs " in
5497 *) current_libdirs="$current_libdirs $libdir" ;;
5500 # Note the libdir as a future libdir.
5501 case "$future_libdirs " in
5503 *) future_libdirs="$future_libdirs $libdir" ;;
5507 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5508 test "X$dir" = "X$file/" && dir=
5511 if test -n "$relink_command"; then
5512 # Determine the prefix the user has applied to our future dir.
5513 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5515 # Don't allow the user to place us outside of our expected
5516 # location b/c this prevents finding dependent libraries that
5517 # are installed to the same prefix.
5518 # At present, this check doesn't affect windows .dll's that
5519 # are installed into $libdir/../bin (currently, that works fine)
5520 # but it's something to keep an eye on.
5521 if test "$inst_prefix_dir" = "$destdir"; then
5522 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5526 if test -n "$inst_prefix_dir"; then
5527 # Stick the inst_prefix_dir data into the link command.
5528 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5530 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5533 $echo "$modename: warning: relinking \`$file'" 1>&2
5534 $show "$relink_command"
5535 if $run eval "$relink_command"; then :
5537 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5542 # See the names of the shared library.
5543 set dummy $library_names
5544 if test -n "$2"; then
5550 test -n "$relink_command" && srcname="$realname"T
5552 # Install the shared library and build the symlinks.
5553 $show "$install_prog $dir/$srcname $destdir/$realname"
5554 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5555 if test -n "$stripme" && test -n "$striplib"; then
5556 $show "$striplib $destdir/$realname"
5557 $run eval "$striplib $destdir/$realname" || exit $?
5560 if test "$#" -gt 0; then
5561 # Delete the old symlinks, and create new ones.
5564 if test "$linkname" != "$realname"; then
5565 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5566 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5571 # Do each command in the postinstall commands.
5572 lib="$destdir/$realname"
5573 cmds=$postinstall_cmds
5574 save_ifs="$IFS"; IFS='~'
5575 for cmd in $cmds; do
5579 $run eval "$cmd" || exit $?
5584 # Install the pseudo-library for information purposes.
5585 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5586 instname="$dir/$name"i
5587 $show "$install_prog $instname $destdir/$name"
5588 $run eval "$install_prog $instname $destdir/$name" || exit $?
5590 # Maybe install the static library, too.
5591 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5595 # Install (i.e. copy) a libtool object.
5597 # Figure out destination file name, if it wasn't already specified.
5598 if test -n "$destname"; then
5599 destfile="$destdir/$destname"
5601 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5602 destfile="$destdir/$destfile"
5605 # Deduce the name of the destination old-style object file.
5608 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5611 staticdest="$destfile"
5615 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5621 # Install the libtool object if requested.
5622 if test -n "$destfile"; then
5623 $show "$install_prog $file $destfile"
5624 $run eval "$install_prog $file $destfile" || exit $?
5627 # Install the old object if enabled.
5628 if test "$build_old_libs" = yes; then
5629 # Deduce the name of the old-style object file.
5630 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5632 $show "$install_prog $staticobj $staticdest"
5633 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5639 # Figure out destination file name, if it wasn't already specified.
5640 if test -n "$destname"; then
5641 destfile="$destdir/$destname"
5643 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5644 destfile="$destdir/$destfile"
5647 # If the file is missing, and there is a .exe on the end, strip it
5648 # because it is most likely a libtool script we actually want to
5653 if test ! -f "$file"; then
5654 file=`$echo $file|${SED} 's,.exe$,,'`
5660 # Do a test to see if this is really a libtool program.
5663 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5669 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5673 # To insure that "foo" is sourced, and not "foo.exe",
5674 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5675 # which disallows the automatic-append-.exe behavior.
5677 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5678 *) wrapperdot=${wrapper} ;;
5680 # If there is no directory component, then add one.
5682 */* | *\\*) . ${wrapperdot} ;;
5683 *) . ./${wrapperdot} ;;
5686 # Check the variables that should have been set.
5687 if test -z "$notinst_deplibs"; then
5688 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5693 for lib in $notinst_deplibs; do
5694 # Check to see that each library is installed.
5696 if test -f "$lib"; then
5697 # If there is no directory component, then add one.
5699 */* | *\\*) . $lib ;;
5703 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5704 if test -n "$libdir" && test ! -f "$libfile"; then
5705 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5711 # To insure that "foo" is sourced, and not "foo.exe",
5712 # finese the cygwin/MSYS system by explicitly sourcing "foo."
5713 # which disallows the automatic-append-.exe behavior.
5715 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5716 *) wrapperdot=${wrapper} ;;
5718 # If there is no directory component, then add one.
5720 */* | *\\*) . ${wrapperdot} ;;
5721 *) . ./${wrapperdot} ;;
5725 if test "$fast_install" = no && test -n "$relink_command"; then
5726 if test "$finalize" = yes && test -z "$run"; then
5728 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5729 tmpdir="$tmpdir/libtool-$$"
5732 if $mkdir "$tmpdir"; then
5736 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5739 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5740 outputname="$tmpdir/$file"
5741 # Replace the output file specification.
5742 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5744 $show "$relink_command"
5745 if $run eval "$relink_command"; then :
5747 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5753 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5756 # Install the binary that we compiled earlier.
5757 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5761 # remove .exe since cygwin /usr/bin/install will append another
5763 case $install_prog,$host in
5764 */usr/bin/install*,*cygwin*)
5765 case $file:$destfile in
5770 destfile=$destfile.exe
5773 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5778 $show "$install_prog$stripme $file $destfile"
5779 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5780 test -n "$outputname" && ${rm}r "$tmpdir"
5785 for file in $staticlibs; do
5786 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5788 # Set up the ranlib parameters.
5789 oldlib="$destdir/$name"
5791 $show "$install_prog $file $oldlib"
5792 $run eval "$install_prog \$file \$oldlib" || exit $?
5794 if test -n "$stripme" && test -n "$old_striplib"; then
5795 $show "$old_striplib $oldlib"
5796 $run eval "$old_striplib $oldlib" || exit $?
5799 # Do each command in the postinstall commands.
5800 cmds=$old_postinstall_cmds
5801 save_ifs="$IFS"; IFS='~'
5802 for cmd in $cmds; do
5806 $run eval "$cmd" || exit $?
5811 if test -n "$future_libdirs"; then
5812 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5815 if test -n "$current_libdirs"; then
5816 # Maybe just do a dry run.
5817 test -n "$run" && current_libdirs=" -n$current_libdirs"
5818 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5824 # libtool finish mode
5826 modename="$modename: finish"
5830 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5833 libdirs="$libdirs $dir"
5836 for libdir in $libdirs; do
5837 if test -n "$finish_cmds"; then
5838 # Do each command in the finish commands.
5840 save_ifs="$IFS"; IFS='~'
5841 for cmd in $cmds; do
5845 $run eval "$cmd" || admincmds="$admincmds
5850 if test -n "$finish_eval"; then
5851 # Do the single finish_eval.
5852 eval cmds=\"$finish_eval\"
5853 $run eval "$cmds" || admincmds="$admincmds
5859 # Exit here if they wanted silent mode.
5860 test "$show" = : && exit $EXIT_SUCCESS
5862 $echo "----------------------------------------------------------------------"
5863 $echo "Libraries have been installed in:"
5864 for libdir in $libdirs; do
5868 $echo "If you ever happen to want to link against installed libraries"
5869 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5870 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5871 $echo "flag during linking and do at least one of the following:"
5872 if test -n "$shlibpath_var"; then
5873 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5874 $echo " during execution"
5876 if test -n "$runpath_var"; then
5877 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5878 $echo " during linking"
5880 if test -n "$hardcode_libdir_flag_spec"; then
5882 eval flag=\"$hardcode_libdir_flag_spec\"
5884 $echo " - use the \`$flag' linker flag"
5886 if test -n "$admincmds"; then
5887 $echo " - have your system administrator run these commands:$admincmds"
5889 if test -f /etc/ld.so.conf; then
5890 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5893 $echo "See any operating system documentation about shared libraries for"
5894 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5895 $echo "----------------------------------------------------------------------"
5899 # libtool execute mode
5901 modename="$modename: execute"
5903 # The first argument is the command name.
5905 if test -z "$cmd"; then
5906 $echo "$modename: you must specify a COMMAND" 1>&2
5911 # Handle -dlopen flags immediately.
5912 for file in $execute_dlfiles; do
5913 if test ! -f "$file"; then
5914 $echo "$modename: \`$file' is not a file" 1>&2
5922 # Check to see that this really is a libtool archive.
5923 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5925 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5930 # Read the libtool library.
5934 # If there is no directory component, then add one.
5936 */* | *\\*) . $file ;;
5940 # Skip this library if it cannot be dlopened.
5941 if test -z "$dlname"; then
5942 # Warn if it was a shared library.
5943 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
5947 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5948 test "X$dir" = "X$file" && dir=.
5950 if test -f "$dir/$objdir/$dlname"; then
5953 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5959 # Just add the directory containing the .lo file.
5960 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5961 test "X$dir" = "X$file" && dir=.
5965 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5970 # Get the absolute pathname.
5971 absdir=`cd "$dir" && pwd`
5972 test -n "$absdir" && dir="$absdir"
5974 # Now add the directory to shlibpath_var.
5975 if eval "test -z \"\$$shlibpath_var\""; then
5976 eval "$shlibpath_var=\"\$dir\""
5978 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5982 # This variable tells wrapper scripts just to set shlibpath_var
5983 # rather than running their programs.
5984 libtool_execute_magic="$magic"
5986 # Check if any of the arguments is a wrapper script.
5993 # Do a test to see if this is really a libtool program.
5994 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5995 # If there is no directory component, then add one.
5997 */* | *\\*) . $file ;;
6001 # Transform arg to wrapped name.
6002 file="$progdir/$program"
6006 # Quote arguments (to preserve shell metacharacters).
6007 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6008 args="$args \"$file\""
6011 if test -z "$run"; then
6012 if test -n "$shlibpath_var"; then
6013 # Export the shlibpath_var.
6014 eval "export $shlibpath_var"
6017 # Restore saved environment variables
6018 if test "${save_LC_ALL+set}" = set; then
6019 LC_ALL="$save_LC_ALL"; export LC_ALL
6021 if test "${save_LANG+set}" = set; then
6022 LANG="$save_LANG"; export LANG
6025 # Now prepare to actually exec the command.
6026 exec_cmd="\$cmd$args"
6028 # Display what would be done.
6029 if test -n "$shlibpath_var"; then
6030 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6031 $echo "export $shlibpath_var"
6038 # libtool clean and uninstall mode
6040 modename="$modename: $mode"
6046 # This variable tells wrapper scripts just to set variables rather
6047 # than running their programs.
6048 libtool_install_magic="$magic"
6053 -f) rm="$rm $arg"; rmforce=yes ;;
6054 -*) rm="$rm $arg" ;;
6055 *) files="$files $arg" ;;
6059 if test -z "$rm"; then
6060 $echo "$modename: you must specify an RM program" 1>&2
6067 origobjdir="$objdir"
6068 for file in $files; do
6069 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6070 if test "X$dir" = "X$file"; then
6072 objdir="$origobjdir"
6074 objdir="$dir/$origobjdir"
6076 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6077 test "$mode" = uninstall && objdir="$dir"
6079 # Remember objdir for removal later, being careful to avoid duplicates
6080 if test "$mode" = clean; then
6083 *) rmdirs="$rmdirs $objdir" ;;
6087 # Don't error if the file doesn't exist and rm -f was used.
6088 if (test -L "$file") >/dev/null 2>&1 \
6089 || (test -h "$file") >/dev/null 2>&1 \
6090 || test -f "$file"; then
6092 elif test -d "$file"; then
6095 elif test "$rmforce" = yes; then
6103 # Possibly a libtool archive, so verify it.
6104 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6107 # Delete the libtool libraries and symlinks.
6108 for n in $library_names; do
6109 rmfiles="$rmfiles $objdir/$n"
6111 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6112 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6114 if test "$mode" = uninstall; then
6115 if test -n "$library_names"; then
6116 # Do each command in the postuninstall commands.
6117 cmds=$postuninstall_cmds
6118 save_ifs="$IFS"; IFS='~'
6119 for cmd in $cmds; do
6124 if test "$?" -ne 0 && test "$rmforce" != yes; then
6131 if test -n "$old_library"; then
6132 # Do each command in the old_postuninstall commands.
6133 cmds=$old_postuninstall_cmds
6134 save_ifs="$IFS"; IFS='~'
6135 for cmd in $cmds; do
6140 if test "$?" -ne 0 && test "$rmforce" != yes; then
6146 # FIXME: should reinstall the best remaining shared library.
6152 # Possibly a libtool object, so verify it.
6153 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6158 # Add PIC object to the list of files to remove.
6159 if test -n "$pic_object" \
6160 && test "$pic_object" != none; then
6161 rmfiles="$rmfiles $dir/$pic_object"
6164 # Add non-PIC object to the list of files to remove.
6165 if test -n "$non_pic_object" \
6166 && test "$non_pic_object" != none; then
6167 rmfiles="$rmfiles $dir/$non_pic_object"
6173 if test "$mode" = clean ; then
6177 file=`$echo $file|${SED} 's,.exe$,,'`
6178 noexename=`$echo $name|${SED} 's,.exe$,,'`
6179 # $file with .exe has already been added to rmfiles,
6180 # add $file without .exe
6181 rmfiles="$rmfiles $file"
6184 # Do a test to see if this is a libtool program.
6185 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6189 # note $name still contains .exe if it was in $file originally
6190 # as does the version of $file that was added into $rmfiles
6191 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6192 if test "$fast_install" = yes && test -n "$relink_command"; then
6193 rmfiles="$rmfiles $objdir/lt-$name"
6195 if test "X$noexename" != "X$name" ; then
6196 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6202 $show "$rm $rmfiles"
6203 $run $rm $rmfiles || exit_status=1
6205 objdir="$origobjdir"
6207 # Try to remove the ${objdir}s in the directories where we deleted files
6208 for dir in $rmdirs; do
6209 if test -d "$dir"; then
6211 $run rmdir $dir >/dev/null 2>&1
6219 $echo "$modename: you must specify a MODE" 1>&2
6220 $echo "$generic_help" 1>&2
6225 if test -z "$exec_cmd"; then
6226 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6227 $echo "$generic_help" 1>&2
6230 fi # test -z "$show_help"
6232 if test -n "$exec_cmd"; then
6237 # We need to display help for each of the modes.
6240 "Usage: $modename [OPTION]... [MODE-ARG]...
6242 Provide generalized library-building support services.
6244 --config show all configuration variables
6245 --debug enable verbose shell tracing
6246 -n, --dry-run display commands without modifying any files
6247 --features display basic configuration information and exit
6248 --finish same as \`--mode=finish'
6249 --help display this help message and exit
6250 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6251 --quiet same as \`--silent'
6252 --silent don't print informational messages
6253 --tag=TAG use configuration variables from tag TAG
6254 --version print version information
6256 MODE must be one of the following:
6258 clean remove files from the build directory
6259 compile compile a source file into a libtool object
6260 execute automatically set library path, then run a program
6261 finish complete the installation of libtool libraries
6262 install install libraries or executables
6263 link create a library or an executable
6264 uninstall remove libraries from an installed directory
6266 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6267 a more detailed description of MODE.
6269 Report bugs to <bug-libtool@gnu.org>."
6275 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6277 Remove files from the build directory.
6279 RM is the name of the program to use to delete files associated with each FILE
6280 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6283 If FILE is a libtool library, object or program, all the files associated
6284 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6289 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6291 Compile a source file into a libtool library object.
6293 This mode accepts the following additional options:
6295 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6296 -prefer-pic try to building PIC objects only
6297 -prefer-non-pic try to building non-PIC objects only
6298 -static always build a \`.o' file suitable for static linking
6300 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6301 from the given SOURCEFILE.
6303 The output file name is determined by removing the directory component from
6304 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6305 library object suffix, \`.lo'."
6310 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6312 Automatically set library path, then run a program.
6314 This mode accepts the following additional options:
6316 -dlopen FILE add the directory containing FILE to the library path
6318 This mode sets the library path environment variable according to \`-dlopen'
6321 If any of the ARGS are libtool executable wrappers, then they are translated
6322 into their corresponding uninstalled binary, and any of their required library
6323 directories are added to the library path.
6325 Then, COMMAND is executed, with ARGS as arguments."
6330 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6332 Complete the installation of libtool libraries.
6334 Each LIBDIR is a directory that contains libtool libraries.
6336 The commands that this mode executes may require superuser privileges. Use
6337 the \`--dry-run' option if you just want to see what would be executed."
6342 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6344 Install executables or libraries.
6346 INSTALL-COMMAND is the installation command. The first component should be
6347 either the \`install' or \`cp' program.
6349 The rest of the components are interpreted as arguments to that command (only
6350 BSD-compatible install options are recognized)."
6355 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6357 Link object files or libraries together to form another library, or to
6358 create an executable program.
6360 LINK-COMMAND is a command using the C compiler that you would use to create
6361 a program from several object files.
6363 The following components of LINK-COMMAND are treated specially:
6365 -all-static do not do any dynamic linking at all
6366 -avoid-version do not add a version suffix if possible
6367 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6368 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6369 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6370 -export-symbols SYMFILE
6371 try to export only the symbols listed in SYMFILE
6372 -export-symbols-regex REGEX
6373 try to export only the symbols matching REGEX
6374 -LLIBDIR search LIBDIR for required installed libraries
6375 -lNAME OUTPUT-FILE requires the installed library libNAME
6376 -module build a library that can dlopened
6377 -no-fast-install disable the fast-install mode
6378 -no-install link a not-installable executable
6379 -no-undefined declare that a library does not refer to external symbols
6380 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6381 -objectlist FILE Use a list of object files found in FILE to specify objects
6382 -precious-files-regex REGEX
6383 don't remove output files matching REGEX
6384 -release RELEASE specify package release information
6385 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6386 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6387 -static do not do any dynamic linking of libtool libraries
6388 -version-info CURRENT[:REVISION[:AGE]]
6389 specify library version info [each variable defaults to 0]
6391 All other options (arguments beginning with \`-') are ignored.
6393 Every other argument is treated as a filename. Files ending in \`.la' are
6394 treated as uninstalled libtool libraries, other files are standard or library
6397 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6398 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6399 required, except when creating a convenience library.
6401 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6402 using \`ar' and \`ranlib', or on Windows using \`lib'.
6404 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6405 is created, otherwise an executable program is created."
6410 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6412 Remove libraries from an installation directory.
6414 RM is the name of the program to use to delete files associated with each FILE
6415 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6418 If FILE is a libtool library, all the files associated with it are deleted.
6419 Otherwise, only FILE itself is deleted using RM."
6423 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6430 $echo "Try \`$modename --help' for more information about other modes."
6434 # The TAGs below are defined such that we never get into a situation
6435 # in which we disable both kinds of libraries. Given conflicting
6436 # choices, we go for a static library, that is the most portable,
6437 # since we can't tell whether shared libraries were disabled because
6438 # the user asked for that or because the platform doesn't support
6439 # them. This is particularly important on AIX, because we don't
6440 # support having both static and shared libraries enabled at the same
6441 # time on that platform, so we default to a shared-only configuration.
6442 # If a disable-shared tag is given, we'll fallback to a static-only
6443 # configuration. But we'll never go from static-only to shared-only.
6445 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6446 build_libtool_libs=no
6448 # ### END LIBTOOL TAG CONFIG: disable-shared
6450 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6451 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6452 # ### END LIBTOOL TAG CONFIG: disable-static