1 # ltmain.sh - Provide generalized library-building support services.
2 # NOTE: Changing this file will not affect anything until you rerun configure.
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
5 # Free Software Foundation, Inc.
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 # As a special exception to the GNU General Public License, if you
23 # distribute this file as part of a program that contains a
24 # configuration script generated by Autoconf, you may include it under
25 # the same distribution terms that you use for the rest of that program.
29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
30 # is ksh but when the shell is invoked as "sh" and the current value of
31 # the _XPG environment variable is not equal to 1 (one), the special
32 # positional parameter $0, within a function call, is the name of the
36 # The name of this program:
37 progname=`echo "$progpath" | $SED $basename`
46 VERSION="1.5.20 Debian 1.5.20-2"
47 TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)"
49 # See if we are running on zsh, and set the options which allow our
50 # commands through without removal of \ escapes.
51 if test -n "${ZSH_VERSION+set}" ; then
55 # Check that we have a working $echo.
56 if test "X$1" = X--no-reexec; then
57 # Discard the --no-reexec flag, and continue.
59 elif test "X$1" = X--fallback-echo; then
60 # Avoid inline document here, it may be left over
62 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
63 # Yippee, $echo works!
66 # Restart under the correct shell, and then maybe $echo will work.
67 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
70 if test "X$1" = X--fallback-echo; then
71 # used as fallback echo
80 help="Try \`$progname --help' for more information."
81 magic="%%%MAGIC variable%%%"
86 # Sed substitution that helps us do robust quoting. It backslashifies
87 # metacharacters that are still active within double-quoted strings.
88 Xsed="${SED}"' -e 1s/^X//'
89 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
90 # test EBCDIC or ASCII
91 case `echo X|tr X '\101'` in
92 A) # ASCII based system
93 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
95 NL2SP='tr \015\012 \040\040'
97 *) # EBCDIC based system
99 NL2SP='tr \r\n \100\100'
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
120 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
121 $echo "$modename: not configured to build any kind of library" 1>&2
122 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
135 lo2o="s/\\.lo\$/.${objext}/"
136 o2lo="s/\\.${objext}\$/.lo/"
138 #####################################
139 # Shell function definitions:
140 # This seems to be the best place for them
142 # func_win32_libid arg
143 # return the library type of file 'arg'
145 # Need a lot of goo to handle *both* DLLs and import libs
146 # Has to be a shell function in order to 'eat' the argument
147 # that is supplied when $file_magic_command is called.
150 win32_libid_type="unknown"
151 win32_fileres=`file -L $1 2>/dev/null`
152 case $win32_fileres in
153 *ar\ archive\ import\ library*) # definitely import
154 win32_libid_type="x86 archive import"
156 *ar\ archive*) # could be an import, or static
157 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
158 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
159 win32_nmres=`eval $NM -f posix -A $1 | \
160 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
161 if test "X$win32_nmres" = "Ximport" ; then
162 win32_libid_type="x86 archive import"
164 win32_libid_type="x86 archive static"
169 win32_libid_type="x86 DLL"
171 *executable*) # but shell scripts are "executable" too...
172 case $win32_fileres in
173 *MS\ Windows\ PE\ Intel*)
174 win32_libid_type="x86 DLL"
179 $echo $win32_libid_type
184 # Infer tagged configuration to use if any are available and
185 # if one wasn't chosen via the "--tag" command line option.
186 # Only attempt this if the compiler in the base compile
187 # command doesn't match the default compiler.
188 # arg is usually of the form 'gcc ...'
191 if test -n "$available_tags" && test -z "$tagname"; then
195 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
199 CC_quoted="$CC_quoted $arg"
202 # Blanks in the command may have been stripped by the calling shell,
203 # but not from the CC environment variable when configure was run.
204 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
205 # Blanks at the start of $base_compile will cause this to fail
206 # if we don't check for them as well.
208 for z in $available_tags; do
209 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
210 # Evaluate the configuration.
211 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
214 # Double-quote args containing other shell metacharacters.
216 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
220 CC_quoted="$CC_quoted $arg"
223 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
224 # The compiler in the base compile command matches
225 # the one in the tagged configuration.
226 # Assume this is the tagged configuration we want.
233 # If $tagname still isn't set, then no tagged configuration
234 # was found and let the user know that the "--tag" command
235 # line option must be used.
236 if test -z "$tagname"; then
237 $echo "$modename: unable to infer tagged configuration"
238 $echo "$modename: specify a tag with \`--tag'" 1>&2
241 # $echo "$modename: using $tagname tagged configuration"
249 # func_extract_an_archive dir oldlib
250 func_extract_an_archive ()
252 f_ex_an_ar_dir="$1"; shift
253 f_ex_an_ar_oldlib="$1"
255 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
256 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
257 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
260 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
265 # func_extract_archives gentop oldlib ...
266 func_extract_archives ()
268 my_gentop="$1"; shift
276 $show "${rm}r $my_gentop"
277 $run ${rm}r "$my_gentop"
278 $show "$mkdir $my_gentop"
279 $run $mkdir "$my_gentop"
281 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
285 for my_xlib in $my_oldlibs; do
286 # Extract the objects.
288 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
289 *) my_xabs=`pwd`"/$my_xlib" ;;
291 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
292 my_xdir="$my_gentop/$my_xlib"
294 $show "${rm}r $my_xdir"
295 $run ${rm}r "$my_xdir"
296 $show "$mkdir $my_xdir"
297 $run $mkdir "$my_xdir"
299 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
304 $show "Extracting $my_xabs"
305 # Do not bother doing anything if just a dry run
306 if test -z "$run"; then
307 darwin_orig_dir=`pwd`
308 cd $my_xdir || exit $?
309 darwin_archive=$my_xabs
311 darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
312 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
313 if test -n "$darwin_arches"; then
314 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
316 $show "$darwin_base_archive has multiple architectures $darwin_arches"
317 for darwin_arch in $darwin_arches ; do
318 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
319 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
320 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
321 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
323 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
324 done # $darwin_arches
325 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
326 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
329 for darwin_file in $darwin_filelist; do
330 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
331 lipo -create -output "$darwin_file" $darwin_files
332 done # $darwin_filelist
334 cd "$darwin_orig_dir"
336 cd "$darwin_orig_dir"
337 func_extract_an_archive "$my_xdir" "$my_xabs"
342 func_extract_an_archive "$my_xdir" "$my_xabs"
345 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
347 func_extract_archives_result="$my_oldobjs"
349 # End of Shell function definitions
350 #####################################
353 eval std_shrext=\"$shrext_cmds\"
355 # Parse our command line options once, thoroughly.
356 while test "$#" -gt 0
362 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
366 # If the previous option needs an argument, assign it.
367 if test -n "$prev"; then
370 execute_dlfiles="$execute_dlfiles $arg"
374 preserve_args="${preserve_args}=$arg"
376 # Check whether tagname contains only valid characters
379 $echo "$progname: invalid tag name: $tagname" 1>&2
386 # Don't test for the "default" C tag, as we know, it's there, but
387 # not specially marked.
390 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
391 taglist="$taglist $tagname"
392 # Evaluate the configuration.
393 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
395 $echo "$progname: ignoring unknown tag $tagname" 1>&2
410 # Have we seen a non-optional argument yet?
417 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
419 $echo "Copyright (C) 2005 Free Software Foundation, Inc."
420 $echo "This is free software; see the source for copying conditions. There is NO"
421 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
426 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
427 # Now print the configurations for the tags.
428 for tagname in $taglist; do
429 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
435 $echo "$progname: enabling shell trace mode"
437 preserve_args="$preserve_args $arg"
446 if test "$build_libtool_libs" = yes; then
447 $echo "enable shared libraries"
449 $echo "disable shared libraries"
451 if test "$build_old_libs" = yes; then
452 $echo "enable static libraries"
454 $echo "disable static libraries"
459 --finish) mode="finish" ;;
461 --mode) prevopt="--mode" prev=mode ;;
462 --mode=*) mode="$optarg" ;;
464 --preserve-dup-deps) duplicate_deps="yes" ;;
468 preserve_args="$preserve_args $arg"
471 --tag) prevopt="--tag" prev=tag ;;
473 set tag "$optarg" ${1+"$@"}
476 preserve_args="$preserve_args --tag"
485 $echo "$modename: unrecognized option \`$arg'" 1>&2
497 if test -n "$prevopt"; then
498 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
503 # If this variable is set in any of the actions, the command in it
504 # will be execed at the end. This prevents here-documents from being
505 # left over by shells.
508 if test -z "$show_help"; then
510 # Infer the operation mode.
511 if test -z "$mode"; then
512 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
513 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
515 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
527 *db | *dbx | *strace | *truss)
537 # If we have no mode, but dlfiles were specified, then do execute mode.
538 test -n "$execute_dlfiles" && mode=execute
540 # Just use the default operation mode.
541 if test -z "$mode"; then
542 if test -n "$nonopt"; then
543 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
545 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
552 # Only execute mode is allowed to have -dlopen flags.
553 if test -n "$execute_dlfiles" && test "$mode" != execute; then
554 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
559 # Change the help message to a mode-specific one.
561 help="Try \`$modename --help --mode=$mode' for more information."
563 # These modes are in order of execution frequency so that they run quickly.
565 # libtool compile mode
567 modename="$modename: compile"
568 # Get the compilation command and the source file.
570 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
581 # do not "continue". Instead, add this to base_compile
593 # Accept any command-line options.
596 if test -n "$libobj" ; then
597 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
604 -static | -prefer-pic | -prefer-non-pic)
615 arg_mode=arg # the next one goes into the "base_compile" arg list
616 continue # The current "srcfile" will either be retained or
617 ;; # replaced later. I would guess that would be a bug.
620 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
622 save_ifs="$IFS"; IFS=','
626 # Double-quote args containing other shell metacharacters.
627 # Many Bourne shells cannot handle close brackets correctly
628 # in scan sets, so we specify it separately.
630 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
634 lastarg="$lastarg $arg"
637 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
639 # Add the arguments to base_compile.
640 base_compile="$base_compile $lastarg"
645 # Accept the current argument as the source file.
646 # The previous "srcfile" becomes the current argument.
653 esac # case $arg_mode
655 # Aesthetically quote the previous argument.
656 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
659 # Double-quote args containing other shell metacharacters.
660 # Many Bourne shells cannot handle close brackets correctly
661 # in scan sets, and some SunOS ksh mistreat backslash-escaping
662 # in scan sets (worked around with variable expansion),
663 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
664 # at all, so we specify them separately.
665 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
666 lastarg="\"$lastarg\""
670 base_compile="$base_compile $lastarg"
675 $echo "$modename: you must specify an argument for -Xcompile"
679 $echo "$modename: you must specify a target with \`-o'" 1>&2
683 # Get the name of the library object.
684 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
688 # Recognize several different file suffixes.
689 # If the user specifies -o file.o, it is replaced with file.lo
699 *.class) xform=class ;;
704 *.java) xform=java ;;
707 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
710 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
712 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
717 func_infer_tag $base_compile
719 for arg in $later; do
738 qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
740 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
741 qlibobj="\"$qlibobj\"" ;;
743 test "X$libobj" != "X$qlibobj" \
744 && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
745 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
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\"
824 qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
826 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
827 qsrcfile="\"$qsrcfile\"" ;;
830 $run $rm "$libobj" "${libobj}T"
832 # Create a libtool object file (analogous to a ".la" file),
833 # but don't create it if we're doing a dry run.
834 test -z "$run" && cat > ${libobj}T <<EOF
835 # $libobj - a libtool object file
836 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
838 # Please DO NOT delete this file!
839 # It is necessary for linking the library.
841 # Name of the PIC object.
844 # Only build a PIC object if we are building libtool libraries.
845 if test "$build_libtool_libs" = yes; then
846 # Without this assignment, base_compile gets emptied.
847 fbsd_hideous_sh_bug=$base_compile
849 if test "$pic_mode" != no; then
850 command="$base_compile $qsrcfile $pic_flag"
852 # Don't build PIC code
853 command="$base_compile $qsrcfile"
856 if test ! -d "${xdir}$objdir"; then
857 $show "$mkdir ${xdir}$objdir"
858 $run $mkdir ${xdir}$objdir
860 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
865 if test -z "$output_obj"; then
866 # Place PIC objects in $objdir
867 command="$command -o $lobj"
870 $run $rm "$lobj" "$output_obj"
873 if $run eval "$command"; then :
875 test -n "$output_obj" && $run $rm $removelist
879 if test "$need_locks" = warn &&
880 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
882 *** ERROR, $lockfile contains:
883 `cat $lockfile 2>/dev/null`
885 but it should contain:
888 This indicates that another process is trying to use the same
889 temporary object file, and libtool could not work around it because
890 your compiler does not support \`-c' and \`-o' together. If you
891 repeat this compilation, it may succeed, by chance, but you had better
892 avoid parallel builds (make -j) in this platform, or get a better
899 # Just move the object if needed, then go on to compile the next one
900 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
901 $show "$mv $output_obj $lobj"
902 if $run $mv $output_obj $lobj; then :
910 # Append the name of the PIC object to the libtool object file.
911 test -z "$run" && cat >> ${libobj}T <<EOF
912 pic_object='$objdir/$objname'
916 # Allow error messages only from the first compilation.
917 if test "$suppress_opt" = yes; then
918 suppress_output=' >/dev/null 2>&1'
921 # No PIC object so indicate it doesn't exist in the libtool
923 test -z "$run" && cat >> ${libobj}T <<EOF
929 # Only build a position-dependent object if we build old libraries.
930 if test "$build_old_libs" = yes; then
931 if test "$pic_mode" != yes; then
932 # Don't build PIC code
933 command="$base_compile $qsrcfile"
935 command="$base_compile $qsrcfile $pic_flag"
937 if test "$compiler_c_o" = yes; then
938 command="$command -o $obj"
941 # Suppress compiler output if we already did a PIC compilation.
942 command="$command$suppress_output"
943 $run $rm "$obj" "$output_obj"
945 if $run eval "$command"; then :
951 if test "$need_locks" = warn &&
952 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
954 *** ERROR, $lockfile contains:
955 `cat $lockfile 2>/dev/null`
957 but it should contain:
960 This indicates that another process is trying to use the same
961 temporary object file, and libtool could not work around it because
962 your compiler does not support \`-c' and \`-o' together. If you
963 repeat this compilation, it may succeed, by chance, but you had better
964 avoid parallel builds (make -j) in this platform, or get a better
971 # Just move the object if needed
972 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
973 $show "$mv $output_obj $obj"
974 if $run $mv $output_obj $obj; then :
982 # Append the name of the non-PIC object the libtool object file.
983 # Only append if the libtool object file exists.
984 test -z "$run" && cat >> ${libobj}T <<EOF
985 # Name of the non-PIC object.
986 non_pic_object='$objname'
990 # Append the name of the non-PIC object the libtool object file.
991 # Only append if the libtool object file exists.
992 test -z "$run" && cat >> ${libobj}T <<EOF
993 # Name of the non-PIC object.
999 $run $mv "${libobj}T" "${libobj}"
1001 # Unlock the critical section if it was locked
1002 if test "$need_locks" != no; then
1003 $run $rm "$lockfile"
1011 modename="$modename: link"
1013 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1014 # It is impossible to link a dll without this setting, and
1015 # we shouldn't force the makefile maintainer to figure out
1016 # which system we are compiling for in order to pass an extra
1017 # flag for every libtool invocation.
1018 # allow_undefined=no
1020 # FIXME: Unfortunately, there are problems with the above when trying
1021 # to make a dll which has undefined symbols, in which case not
1022 # even a static library is built. For now, we need to specify
1023 # -no-undefined on the libtool link line when we can be certain
1024 # that all symbols are satisfied, otherwise we get a static library.
1031 libtool_args="$nonopt"
1032 base_compile="$nonopt $@"
1033 compile_command="$nonopt"
1034 finalize_command="$nonopt"
1047 lib_search_path=`pwd`
1056 export_symbols_regex=
1064 precious_files_regex=
1065 prefer_static_libs=no
1078 func_infer_tag $base_compile
1080 # We need to know -static, to get the right output filenames.
1084 -all-static | -static)
1085 if test "X$arg" = "X-all-static"; then
1086 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1087 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1089 if test -n "$link_static_flag"; then
1090 dlopen_self=$dlopen_self_static
1093 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1094 dlopen_self=$dlopen_self_static
1097 build_libtool_libs=no
1099 prefer_static_libs=yes
1105 # See if our shared archives depend on static archives.
1106 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1108 # Go through the arguments, transforming them on the way.
1109 while test "$#" -gt 0; do
1113 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1114 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1118 libtool_args="$libtool_args $qarg"
1120 # If the previous option needs an argument, assign it.
1121 if test -n "$prev"; then
1124 compile_command="$compile_command @OUTPUT@"
1125 finalize_command="$finalize_command @OUTPUT@"
1131 if test "$preload" = no; then
1132 # Add the symbol object into the linking commands.
1133 compile_command="$compile_command @SYMFILE@"
1134 finalize_command="$finalize_command @SYMFILE@"
1138 *.la | *.lo) ;; # We handle these cases below.
1140 if test "$dlself" = no; then
1148 if test "$prev" = dlprefiles; then
1150 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1160 if test "$prev" = dlfiles; then
1161 dlfiles="$dlfiles $arg"
1163 dlprefiles="$dlprefiles $arg"
1171 export_symbols="$arg"
1172 if test ! -f "$arg"; then
1173 $echo "$modename: symbol file \`$arg' does not exist"
1180 export_symbols_regex="$arg"
1185 inst_prefix_dir="$arg"
1190 precious_files_regex="$arg"
1200 if test -f "$arg"; then
1203 for fil in `cat $save_arg`
1205 # moreargs="$moreargs $fil"
1207 # A libtool-controlled object.
1209 # Check to see that this really is a libtool object.
1210 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1215 # If there is no directory component, then add one.
1217 */* | *\\*) . $arg ;;
1221 if test -z "$pic_object" || \
1222 test -z "$non_pic_object" ||
1223 test "$pic_object" = none && \
1224 test "$non_pic_object" = none; then
1225 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1229 # Extract subdirectory from the argument.
1230 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1231 if test "X$xdir" = "X$arg"; then
1237 if test "$pic_object" != none; then
1238 # Prepend the subdirectory the object is found in.
1239 pic_object="$xdir$pic_object"
1241 if test "$prev" = dlfiles; then
1242 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1243 dlfiles="$dlfiles $pic_object"
1247 # If libtool objects are unsupported, then we need to preload.
1252 # CHECK ME: I think I busted this. -Ossama
1253 if test "$prev" = dlprefiles; then
1254 # Preload the old-style object.
1255 dlprefiles="$dlprefiles $pic_object"
1260 libobjs="$libobjs $pic_object"
1265 if test "$non_pic_object" != none; then
1266 # Prepend the subdirectory the object is found in.
1267 non_pic_object="$xdir$non_pic_object"
1269 # A standard non-PIC object
1270 non_pic_objects="$non_pic_objects $non_pic_object"
1271 if test -z "$pic_object" || test "$pic_object" = none ; then
1272 arg="$non_pic_object"
1276 # Only an error if not doing a dry-run.
1277 if test -z "$run"; then
1278 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1283 # Extract subdirectory from the argument.
1284 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1285 if test "X$xdir" = "X$arg"; then
1291 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1292 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1293 libobjs="$libobjs $pic_object"
1294 non_pic_objects="$non_pic_objects $non_pic_object"
1299 $echo "$modename: link input file \`$save_arg' does not exist"
1307 # We need an absolute path.
1309 [\\/]* | [A-Za-z]:[\\/]*) ;;
1311 $echo "$modename: only absolute run-paths are allowed" 1>&2
1315 if test "$prev" = rpath; then
1318 *) rpath="$rpath $arg" ;;
1323 *) xrpath="$xrpath $arg" ;;
1330 compiler_flags="$compiler_flags $qarg"
1332 compile_command="$compile_command $qarg"
1333 finalize_command="$finalize_command $qarg"
1337 linker_flags="$linker_flags $qarg"
1338 compiler_flags="$compiler_flags $wl$qarg"
1340 compile_command="$compile_command $wl$qarg"
1341 finalize_command="$finalize_command $wl$qarg"
1345 linker_flags="$linker_flags $qarg"
1346 compiler_flags="$compiler_flags $qarg"
1348 compile_command="$compile_command $qarg"
1349 finalize_command="$finalize_command $qarg"
1358 compiler_flags="$compiler_flags $arg"
1359 compile_command="$compile_command $arg"
1360 finalize_command="$finalize_command $arg"
1365 eval "$prev=\"\$arg\""
1370 fi # test -n "$prev"
1376 if test -n "$link_static_flag"; then
1377 compile_command="$compile_command $link_static_flag"
1378 finalize_command="$finalize_command $link_static_flag"
1384 # FIXME: remove this flag sometime in the future.
1385 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1409 -export-symbols | -export-symbols-regex)
1410 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1411 $echo "$modename: more than one -exported-symbols argument is not allowed"
1414 if test "X$arg" = "X-export-symbols"; then
1423 prev=darwin_framework
1424 compiler_flags="$compiler_flags $arg"
1425 compile_command="$compile_command $arg"
1426 finalize_command="$finalize_command $arg"
1435 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1436 # so, if we see these flags be careful not to treat them like -L
1438 case $with_gcc/$host in
1439 no/*-*-irix* | /*-*-irix*)
1440 compile_command="$compile_command $arg"
1441 finalize_command="$finalize_command $arg"
1448 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1449 # We need an absolute path.
1451 [\\/]* | [A-Za-z]:[\\/]*) ;;
1453 absdir=`cd "$dir" && pwd`
1454 if test -z "$absdir"; then
1455 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1464 deplibs="$deplibs -L$dir"
1465 lib_search_path="$lib_search_path $dir"
1469 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1470 case :$dllsearchpath: in
1472 *) dllsearchpath="$dllsearchpath:$dir";;
1480 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1482 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1483 # These systems don't actually have a C or math library (as such)
1486 *-*-mingw* | *-*-os2*)
1487 # These systems don't actually have a C library (as such)
1488 test "X$arg" = "X-lc" && continue
1490 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1491 # Do not include libc due to us having libc/libc_r.
1492 test "X$arg" = "X-lc" && continue
1494 *-*-rhapsody* | *-*-darwin1.[012])
1495 # Rhapsody C and math libraries are in the System framework
1496 deplibs="$deplibs -framework System"
1499 elif test "X$arg" = "X-lc_r"; then
1501 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1502 # Do not include libc_r directly, use -pthread flag.
1507 deplibs="$deplibs $arg"
1511 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1512 # classes, name mangling, and exception handling.
1514 compile_command="$compile_command $arg"
1515 compiler_flags="$compiler_flags $arg"
1516 finalize_command="$finalize_command $arg"
1521 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1522 compiler_flags="$compiler_flags $arg"
1523 compile_command="$compile_command $arg"
1524 finalize_command="$finalize_command $arg"
1533 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1534 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1535 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1536 # +DA*, +DD* enable 64-bit mode on the HP compiler
1537 # -q* pass through compiler args for the IBM compiler
1538 # -m* pass through architecture-specific compiler args for GCC
1539 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
1541 # Unknown arguments in both finalize_command and compile_command need
1542 # to be aesthetically quoted because they are evaled later.
1543 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1545 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1549 compile_command="$compile_command $arg"
1550 finalize_command="$finalize_command $arg"
1551 if test "$with_gcc" = "yes" ; then
1552 compiler_flags="$compiler_flags $arg"
1569 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1570 # The PATH hackery in wrapper scripts is required on Windows
1571 # in order for the loader to find any dlls it needs.
1572 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1573 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1576 *) no_install=yes ;;
1593 -precious-files-regex)
1614 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1615 # We need an absolute path.
1617 [\\/]* | [A-Za-z]:[\\/]*) ;;
1619 $echo "$modename: only absolute run-paths are allowed" 1>&2
1625 *) xrpath="$xrpath $dir" ;;
1631 # The effects of -static are defined in a previous loop.
1632 # We used to do the same as -all-static on platforms that
1633 # didn't have a PIC flag, but the assumption that the effects
1634 # would be equivalent was wrong. It would break on at least
1635 # Digital Unix and AIX.
1655 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1657 save_ifs="$IFS"; IFS=','
1658 for flag in $args; do
1661 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1666 compiler_flags="$compiler_flags $flag"
1669 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1673 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1675 save_ifs="$IFS"; IFS=','
1676 for flag in $args; do
1679 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1684 compiler_flags="$compiler_flags $wl$flag"
1685 linker_flags="$linker_flags $flag"
1688 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1706 # Some other compiler flag.
1708 # Unknown arguments in both finalize_command and compile_command need
1709 # to be aesthetically quoted because they are evaled later.
1710 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1712 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1719 # A standard object.
1724 # A libtool-controlled object.
1726 # Check to see that this really is a libtool object.
1727 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
1732 # If there is no directory component, then add one.
1734 */* | *\\*) . $arg ;;
1738 if test -z "$pic_object" || \
1739 test -z "$non_pic_object" ||
1740 test "$pic_object" = none && \
1741 test "$non_pic_object" = none; then
1742 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1746 # Extract subdirectory from the argument.
1747 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1748 if test "X$xdir" = "X$arg"; then
1754 if test "$pic_object" != none; then
1755 # Prepend the subdirectory the object is found in.
1756 pic_object="$xdir$pic_object"
1758 if test "$prev" = dlfiles; then
1759 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1760 dlfiles="$dlfiles $pic_object"
1764 # If libtool objects are unsupported, then we need to preload.
1769 # CHECK ME: I think I busted this. -Ossama
1770 if test "$prev" = dlprefiles; then
1771 # Preload the old-style object.
1772 dlprefiles="$dlprefiles $pic_object"
1777 libobjs="$libobjs $pic_object"
1782 if test "$non_pic_object" != none; then
1783 # Prepend the subdirectory the object is found in.
1784 non_pic_object="$xdir$non_pic_object"
1786 # A standard non-PIC object
1787 non_pic_objects="$non_pic_objects $non_pic_object"
1788 if test -z "$pic_object" || test "$pic_object" = none ; then
1789 arg="$non_pic_object"
1793 # Only an error if not doing a dry-run.
1794 if test -z "$run"; then
1795 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1800 # Extract subdirectory from the argument.
1801 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1802 if test "X$xdir" = "X$arg"; then
1808 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1809 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1810 libobjs="$libobjs $pic_object"
1811 non_pic_objects="$non_pic_objects $non_pic_object"
1818 deplibs="$deplibs $arg"
1819 old_deplibs="$old_deplibs $arg"
1824 # A libtool-controlled library.
1826 if test "$prev" = dlfiles; then
1827 # This library was specified with -dlopen.
1828 dlfiles="$dlfiles $arg"
1830 elif test "$prev" = dlprefiles; then
1831 # The library was specified with -dlpreopen.
1832 dlprefiles="$dlprefiles $arg"
1835 deplibs="$deplibs $arg"
1840 # Some other compiler argument.
1842 # Unknown arguments in both finalize_command and compile_command need
1843 # to be aesthetically quoted because they are evaled later.
1844 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1846 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1853 # Now actually substitute the argument into the commands.
1854 if test -n "$arg"; then
1855 compile_command="$compile_command $arg"
1856 finalize_command="$finalize_command $arg"
1858 done # argument parsing loop
1860 if test -n "$prev"; then
1861 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1866 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1867 eval arg=\"$export_dynamic_flag_spec\"
1868 compile_command="$compile_command $arg"
1869 finalize_command="$finalize_command $arg"
1873 # calculate the name of the file, without its directory
1874 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1875 libobjs_save="$libobjs"
1877 if test -n "$shlibpath_var"; then
1878 # get the directories listed in $shlibpath_var
1879 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1883 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1884 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1886 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1887 if test "X$output_objdir" = "X$output"; then
1888 output_objdir="$objdir"
1890 output_objdir="$output_objdir/$objdir"
1892 # Create the object directory.
1893 if test ! -d "$output_objdir"; then
1894 $show "$mkdir $output_objdir"
1895 $run $mkdir $output_objdir
1897 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1902 # Determine the type of output
1905 $echo "$modename: you must specify an output file" 1>&2
1909 *.$libext) linkmode=oldlib ;;
1910 *.lo | *.$objext) linkmode=obj ;;
1911 *.la) linkmode=lib ;;
1912 *) linkmode=prog ;; # Anything else should be a program.
1916 *cygwin* | *mingw* | *pw32*)
1917 # don't eliminate duplications in $postdeps and $predeps
1918 duplicate_compiler_generated_deps=yes
1921 duplicate_compiler_generated_deps=$duplicate_deps
1927 # Find all interdependent deplibs by searching for libraries
1928 # that are linked more than once (e.g. -la -lb -la)
1929 for deplib in $deplibs; do
1930 if test "X$duplicate_deps" = "Xyes" ; then
1932 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1935 libs="$libs $deplib"
1938 if test "$linkmode" = lib; then
1939 libs="$predeps $libs $compiler_lib_search_path $postdeps"
1941 # Compute libraries that are listed more than once in $predeps
1942 # $postdeps and mark them as special (i.e., whose duplicates are
1943 # not to be eliminated).
1945 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
1946 for pre_post_dep in $predeps $postdeps; do
1947 case "$pre_post_deps " in
1948 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
1950 pre_post_deps="$pre_post_deps $pre_post_dep"
1959 need_relink=no # whether we're linking any uninstalled libtool libraries
1960 notinst_deplibs= # not-installed libtool libraries
1961 notinst_path= # paths that contain not-installed libtool libraries
1965 for file in $dlfiles $dlprefiles; do
1969 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1981 passes="conv scan dlopen dlpreopen link"
1986 for pass in $passes; do
1987 if test "$linkmode,$pass" = "lib,link" ||
1988 test "$linkmode,$pass" = "prog,scan"; then
1992 if test "$linkmode" = prog; then
1994 dlopen) libs="$dlfiles" ;;
1995 dlpreopen) libs="$dlprefiles" ;;
1997 libs="$deplibs %DEPLIBS%"
1998 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
2002 if test "$pass" = dlopen; then
2003 # Collect dlpreopened libraries
2004 save_deplibs="$deplibs"
2007 for deplib in $libs; do
2011 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
2012 if test "$linkmode,$pass" = "prog,link"; then
2013 compile_deplibs="$deplib $compile_deplibs"
2014 finalize_deplibs="$deplib $finalize_deplibs"
2016 compiler_flags="$compiler_flags $deplib"
2021 if test "$linkmode" != lib && test "$linkmode" != prog; then
2022 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2025 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2026 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2027 for search_ext in .la $std_shrext .so .a; do
2028 # Search the libtool library
2029 lib="$searchdir/lib${name}${search_ext}"
2030 if test -f "$lib"; then
2031 if test "$search_ext" = ".la"; then
2040 if test "$found" != yes; then
2041 # deplib doesn't seem to be a libtool library
2042 if test "$linkmode,$pass" = "prog,link"; then
2043 compile_deplibs="$deplib $compile_deplibs"
2044 finalize_deplibs="$deplib $finalize_deplibs"
2046 deplibs="$deplib $deplibs"
2047 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2050 else # deplib is a libtool library
2051 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2052 # We need to do some special things here, and not later.
2053 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2054 case " $predeps $postdeps " in
2056 if (${SED} -e '2q' $lib |
2057 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
2061 */* | *\\*) . $lib ;;
2064 for l in $old_library $library_names; do
2067 if test "X$ll" = "X$old_library" ; then # only static version available
2069 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2070 test "X$ladir" = "X$lib" && ladir="."
2071 lib=$ladir/$old_library
2072 if test "$linkmode,$pass" = "prog,link"; then
2073 compile_deplibs="$deplib $compile_deplibs"
2074 finalize_deplibs="$deplib $finalize_deplibs"
2076 deplibs="$deplib $deplibs"
2077 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
2091 deplibs="$deplib $deplibs"
2092 test "$pass" = conv && continue
2093 newdependency_libs="$deplib $newdependency_libs"
2094 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2097 if test "$pass" = conv; then
2098 deplibs="$deplib $deplibs"
2101 if test "$pass" = scan; then
2102 deplibs="$deplib $deplibs"
2104 compile_deplibs="$deplib $compile_deplibs"
2105 finalize_deplibs="$deplib $finalize_deplibs"
2107 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2110 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2116 if test "$pass" = link; then
2117 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2118 # Make sure the xrpath contains only unique directories.
2121 *) xrpath="$xrpath $dir" ;;
2124 deplibs="$deplib $deplibs"
2127 *.la) lib="$deplib" ;;
2129 if test "$pass" = conv; then
2130 deplibs="$deplib $deplibs"
2136 case $deplibs_check_method in
2138 set dummy $deplibs_check_method
2139 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2140 if eval $echo \"$deplib\" 2>/dev/null \
2142 | $EGREP "$match_pattern_regex" > /dev/null; then
2150 if test "$valid_a_lib" != yes; then
2152 $echo "*** Warning: Trying to link with static lib archive $deplib."
2153 $echo "*** I have the capability to make that library automatically link in when"
2154 $echo "*** you link to this library. But I can only do this if you have a"
2155 $echo "*** shared version of the library, which you do not appear to have"
2156 $echo "*** because the file extensions .$libext of this argument makes me believe"
2157 $echo "*** that it is just a static archive that I should not used here."
2160 $echo "*** Warning: Linking the shared library $output against the"
2161 $echo "*** static library $deplib is not portable!"
2162 deplibs="$deplib $deplibs"
2167 if test "$pass" != link; then
2168 deplibs="$deplib $deplibs"
2170 compile_deplibs="$deplib $compile_deplibs"
2171 finalize_deplibs="$deplib $finalize_deplibs"
2178 if test "$pass" = conv; then
2179 deplibs="$deplib $deplibs"
2180 elif test "$linkmode" = prog; then
2181 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
2182 # If there is no dlopen support or we're linking statically,
2183 # we need to preload.
2184 newdlprefiles="$newdlprefiles $deplib"
2185 compile_deplibs="$deplib $compile_deplibs"
2186 finalize_deplibs="$deplib $finalize_deplibs"
2188 newdlfiles="$newdlfiles $deplib"
2198 if test "$found" = yes || test -f "$lib"; then :
2200 $echo "$modename: cannot find the library \`$lib'" 1>&2
2204 # Check to see that this really is a libtool archive.
2205 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
2207 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2211 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2212 test "X$ladir" = "X$lib" && ladir="."
2220 # If the library was installed with an old release of libtool,
2221 # it will not redefine variables installed, or shouldnotlink
2229 */* | *\\*) . $lib ;;
2233 if test "$linkmode,$pass" = "lib,link" ||
2234 test "$linkmode,$pass" = "prog,scan" ||
2235 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
2236 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
2237 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
2240 if test "$pass" = conv; then
2241 # Only check for convenience libraries
2242 deplibs="$lib $deplibs"
2243 if test -z "$libdir"; then
2244 if test -z "$old_library"; then
2245 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2248 # It is a libtool convenience library, so add in its objects.
2249 convenience="$convenience $ladir/$objdir/$old_library"
2250 old_convenience="$old_convenience $ladir/$objdir/$old_library"
2252 for deplib in $dependency_libs; do
2253 deplibs="$deplib $deplibs"
2254 if test "X$duplicate_deps" = "Xyes" ; then
2255 case "$tmp_libs " in
2256 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2259 tmp_libs="$tmp_libs $deplib"
2261 elif test "$linkmode" != prog && test "$linkmode" != lib; then
2262 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2269 # Get the name of the library we link against.
2271 for l in $old_library $library_names; do
2274 if test -z "$linklib"; then
2275 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2279 # This library was specified with -dlopen.
2280 if test "$pass" = dlopen; then
2281 if test -z "$libdir"; then
2282 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2285 if test -z "$dlname" ||
2286 test "$dlopen_support" != yes ||
2287 test "$build_libtool_libs" = no; then
2288 # If there is no dlname, no dlopen support or we're linking
2289 # statically, we need to preload. We also need to preload any
2290 # dependent libraries so libltdl's deplib preloader doesn't
2291 # bomb out in the load deplibs phase.
2292 dlprefiles="$dlprefiles $lib $dependency_libs"
2294 newdlfiles="$newdlfiles $lib"
2299 # We need an absolute path.
2301 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
2303 abs_ladir=`cd "$ladir" && pwd`
2304 if test -z "$abs_ladir"; then
2305 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2306 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2311 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2313 # Find the relevant object directory and library name.
2314 if test "X$installed" = Xyes; then
2315 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2316 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2324 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2326 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2329 # Remove this search path later
2330 notinst_path="$notinst_path $abs_ladir"
2332 dir="$ladir/$objdir"
2333 absdir="$abs_ladir/$objdir"
2334 # Remove this search path later
2335 notinst_path="$notinst_path $abs_ladir"
2337 fi # $installed = yes
2338 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2340 # This library was specified with -dlpreopen.
2341 if test "$pass" = dlpreopen; then
2342 if test -z "$libdir"; then
2343 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2346 # Prefer using a static library (so that no silly _DYNAMIC symbols
2347 # are required to link).
2348 if test -n "$old_library"; then
2349 newdlprefiles="$newdlprefiles $dir/$old_library"
2350 # Otherwise, use the dlname, so that lt_dlopen finds it.
2351 elif test -n "$dlname"; then
2352 newdlprefiles="$newdlprefiles $dir/$dlname"
2354 newdlprefiles="$newdlprefiles $dir/$linklib"
2356 fi # $pass = dlpreopen
2358 if test -z "$libdir"; then
2359 # Link the convenience library
2360 if test "$linkmode" = lib; then
2361 deplibs="$dir/$old_library $deplibs"
2362 elif test "$linkmode,$pass" = "prog,link"; then
2363 compile_deplibs="$dir/$old_library $compile_deplibs"
2364 finalize_deplibs="$dir/$old_library $finalize_deplibs"
2366 deplibs="$lib $deplibs" # used for prog,scan pass
2372 if test "$linkmode" = prog && test "$pass" != link; then
2373 newlib_search_path="$newlib_search_path $ladir"
2374 deplibs="$lib $deplibs"
2377 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2378 test "$build_libtool_libs" = no; then
2383 for deplib in $dependency_libs; do
2385 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2387 # Need to link against all dependency_libs?
2388 if test "$linkalldeplibs" = yes; then
2389 deplibs="$deplib $deplibs"
2391 # Need to hardcode shared library paths
2392 # or/and link against static libraries
2393 newdependency_libs="$deplib $newdependency_libs"
2395 if test "X$duplicate_deps" = "Xyes" ; then
2396 case "$tmp_libs " in
2397 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2400 tmp_libs="$tmp_libs $deplib"
2403 fi # $linkmode = prog...
2405 if test "$linkmode,$pass" = "prog,link"; then
2406 if test -n "$library_names" &&
2407 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2408 # We need to hardcode the library path
2409 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2410 # Make sure the rpath contains only unique directories.
2411 case "$temp_rpath " in
2414 *) temp_rpath="$temp_rpath $absdir" ;;
2418 # Hardcode the library path.
2419 # Skip directories that are in the system default run-time
2421 case " $sys_lib_dlsearch_path " in
2424 case "$compile_rpath " in
2426 *) compile_rpath="$compile_rpath $absdir"
2430 case " $sys_lib_dlsearch_path " in
2433 case "$finalize_rpath " in
2435 *) finalize_rpath="$finalize_rpath $libdir"
2439 fi # $linkmode,$pass = prog,link...
2441 if test "$alldeplibs" = yes &&
2442 { test "$deplibs_check_method" = pass_all ||
2443 { test "$build_libtool_libs" = yes &&
2444 test -n "$library_names"; }; }; then
2445 # We only need to search for static libraries
2450 link_static=no # Whether the deplib will be linked statically
2451 if test -n "$library_names" &&
2452 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2453 if test "$installed" = no; then
2454 notinst_deplibs="$notinst_deplibs $lib"
2457 # This is a shared library
2459 # Warn about portability, can't link against -module's on
2460 # some systems (darwin)
2461 if test "$shouldnotlink" = yes && test "$pass" = link ; then
2463 if test "$linkmode" = prog; then
2464 $echo "*** Warning: Linking the executable $output against the loadable module"
2466 $echo "*** Warning: Linking the shared library $output against the loadable module"
2468 $echo "*** $linklib is not portable!"
2470 if test "$linkmode" = lib &&
2471 test "$hardcode_into_libs" = yes; then
2472 # Hardcode the library path.
2473 # Skip directories that are in the system default run-time
2475 case " $sys_lib_dlsearch_path " in
2478 case "$compile_rpath " in
2480 *) compile_rpath="$compile_rpath $absdir"
2484 case " $sys_lib_dlsearch_path " in
2487 case "$finalize_rpath " in
2489 *) finalize_rpath="$finalize_rpath $libdir"
2495 if test -n "$old_archive_from_expsyms_cmds"; then
2496 # figure out the soname
2497 set dummy $library_names
2500 libname=`eval \\$echo \"$libname_spec\"`
2501 # use dlname if we got it. it's perfectly good, no?
2502 if test -n "$dlname"; then
2504 elif test -n "$soname_spec"; then
2508 major=`expr $current - $age`
2512 eval soname=\"$soname_spec\"
2517 # Make a new name for the extract_expsyms_cmds to use
2519 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
2520 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2522 # If the library has no export list, then create one now
2523 if test -f "$output_objdir/$soname-def"; then :
2525 $show "extracting exported symbol list from \`$soname'"
2526 save_ifs="$IFS"; IFS='~'
2527 cmds=$extract_expsyms_cmds
2528 for cmd in $cmds; do
2532 $run eval "$cmd" || exit $?
2538 if test -f "$output_objdir/$newlib"; then :; else
2539 $show "generating import library for \`$soname'"
2540 save_ifs="$IFS"; IFS='~'
2541 cmds=$old_archive_from_expsyms_cmds
2542 for cmd in $cmds; do
2546 $run eval "$cmd" || exit $?
2550 # make sure the library variables are pointing to the new library
2553 fi # test -n "$old_archive_from_expsyms_cmds"
2555 if test "$linkmode" = prog || test "$mode" != relink; then
2560 case $hardcode_action in
2561 immediate | unsupported)
2562 if test "$hardcode_direct" = no; then
2565 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2567 # if the lib is a module then we can not link against
2568 # it, someone is ignoring the new warnings I added
2569 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2570 $echo "** Warning, lib $linklib is a module, not a shared library"
2571 if test -z "$old_library" ; then
2573 $echo "** And there doesn't seem to be a static archive available"
2574 $echo "** The link will probably fail, sorry"
2576 add="$dir/$old_library"
2580 elif test "$hardcode_minus_L" = no; then
2582 *-*-sunos*) add_shlibpath="$dir" ;;
2586 elif test "$hardcode_shlibpath_var" = no; then
2587 add_shlibpath="$dir"
2594 if test "$hardcode_direct" = yes; then
2596 elif test "$hardcode_minus_L" = yes; then
2598 # Try looking first in the location we're being installed to.
2599 if test -n "$inst_prefix_dir"; then
2602 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2607 elif test "$hardcode_shlibpath_var" = yes; then
2608 add_shlibpath="$dir"
2617 if test "$lib_linked" != yes; then
2618 $echo "$modename: configuration error: unsupported hardcode properties"
2622 if test -n "$add_shlibpath"; then
2623 case :$compile_shlibpath: in
2624 *":$add_shlibpath:"*) ;;
2625 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2628 if test "$linkmode" = prog; then
2629 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2630 test -n "$add" && compile_deplibs="$add $compile_deplibs"
2632 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2633 test -n "$add" && deplibs="$add $deplibs"
2634 if test "$hardcode_direct" != yes && \
2635 test "$hardcode_minus_L" != yes && \
2636 test "$hardcode_shlibpath_var" = yes; then
2637 case :$finalize_shlibpath: in
2639 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2645 if test "$linkmode" = prog || test "$mode" = relink; then
2649 # Finalize command for both is simple: just hardcode it.
2650 if test "$hardcode_direct" = yes; then
2651 add="$libdir/$linklib"
2652 elif test "$hardcode_minus_L" = yes; then
2655 elif test "$hardcode_shlibpath_var" = yes; then
2656 case :$finalize_shlibpath: in
2658 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2661 elif test "$hardcode_automatic" = yes; then
2662 if test -n "$inst_prefix_dir" &&
2663 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2664 add="$inst_prefix_dir$libdir/$linklib"
2666 add="$libdir/$linklib"
2669 # We cannot seem to hardcode it, guess we'll fake it.
2671 # Try looking first in the location we're being installed to.
2672 if test -n "$inst_prefix_dir"; then
2675 add_dir="$add_dir -L$inst_prefix_dir$libdir"
2682 if test "$linkmode" = prog; then
2683 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2684 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2686 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2687 test -n "$add" && deplibs="$add $deplibs"
2690 elif test "$linkmode" = prog; then
2691 # Here we assume that one of hardcode_direct or hardcode_minus_L
2692 # is not unsupported. This is valid on all known static and
2694 if test "$hardcode_direct" != unsupported; then
2695 test -n "$old_library" && linklib="$old_library"
2696 compile_deplibs="$dir/$linklib $compile_deplibs"
2697 finalize_deplibs="$dir/$linklib $finalize_deplibs"
2699 compile_deplibs="-l$name -L$dir $compile_deplibs"
2700 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2702 elif test "$build_libtool_libs" = yes; then
2703 # Not a shared library
2704 if test "$deplibs_check_method" != pass_all; then
2705 # We're trying link a shared library against a static one
2706 # but the system doesn't support it.
2708 # Just print a warning and add the library to dependency_libs so
2709 # that the program can be linked against the static library.
2711 $echo "*** Warning: This system can not link to static lib archive $lib."
2712 $echo "*** I have the capability to make that library automatically link in when"
2713 $echo "*** you link to this library. But I can only do this if you have a"
2714 $echo "*** shared version of the library, which you do not appear to have."
2715 if test "$module" = yes; then
2716 $echo "*** But as you try to build a module library, libtool will still create "
2717 $echo "*** a static module, that should work as long as the dlopening application"
2718 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2719 if test -z "$global_symbol_pipe"; then
2721 $echo "*** However, this would only work if libtool was able to extract symbol"
2722 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2723 $echo "*** not find such a program. So, this module is probably useless."
2724 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2726 if test "$build_old_libs" = no; then
2727 build_libtool_libs=module
2730 build_libtool_libs=no
2734 deplibs="$dir/$old_library $deplibs"
2737 fi # link shared/static library?
2739 if test "$linkmode" = lib; then
2740 if test -n "$dependency_libs" &&
2741 { test "$hardcode_into_libs" != yes ||
2742 test "$build_old_libs" = yes ||
2743 test "$link_static" = yes; }; then
2744 # Extract -R from dependency_libs
2746 for libdir in $dependency_libs; do
2748 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2750 *" $temp_xrpath "*) ;;
2751 *) xrpath="$xrpath $temp_xrpath";;
2753 *) temp_deplibs="$temp_deplibs $libdir";;
2756 dependency_libs="$temp_deplibs"
2759 newlib_search_path="$newlib_search_path $absdir"
2760 # Link against this library
2761 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2762 # ... and its dependency_libs
2764 for deplib in $dependency_libs; do
2765 newdependency_libs="$deplib $newdependency_libs"
2766 if test "X$duplicate_deps" = "Xyes" ; then
2767 case "$tmp_libs " in
2768 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2771 tmp_libs="$tmp_libs $deplib"
2774 if test "$link_all_deplibs" != no; then
2775 # Add the search paths of all dependency libraries
2776 for deplib in $dependency_libs; do
2778 -L*) path="$deplib" ;;
2780 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2781 test "X$dir" = "X$deplib" && dir="."
2782 # We need an absolute path.
2784 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2786 absdir=`cd "$dir" && pwd`
2787 if test -z "$absdir"; then
2788 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2793 if grep "^installed=no" $deplib > /dev/null; then
2794 path="$absdir/$objdir"
2796 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2797 if test -z "$libdir"; then
2798 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2801 if test "$absdir" != "$libdir"; then
2802 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2809 # we do not want to link against static libs,
2810 # but need to link against shared
2811 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2812 if test -n "$deplibrary_names" ; then
2813 for tmp in $deplibrary_names ; do
2816 if test -f "$path/$depdepl" ; then
2817 depdepl="$path/$depdepl"
2819 # do not add paths which are already there
2820 case " $newlib_search_path " in
2822 *) newlib_search_path="$newlib_search_path $path";;
2835 # Again, we only want to link against shared libraries
2836 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2837 for tmp in $newlib_search_path ; do
2838 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2839 eval depdepl="$tmp/lib$tmp_libs.dylib"
2850 case " $deplibs " in
2852 *) deplibs="$path $deplibs" ;;
2854 case " $deplibs " in
2856 *) deplibs="$depdepl $deplibs" ;;
2859 fi # link_all_deplibs != no
2861 done # for deplib in $libs
2862 dependency_libs="$newdependency_libs"
2863 if test "$pass" = dlpreopen; then
2864 # Link the dlpreopened libraries before other libraries
2865 for deplib in $save_deplibs; do
2866 deplibs="$deplib $deplibs"
2869 if test "$pass" != dlopen; then
2870 if test "$pass" != conv; then
2871 # Make sure lib_search_path contains only unique directories.
2873 for dir in $newlib_search_path; do
2874 case "$lib_search_path " in
2876 *) lib_search_path="$lib_search_path $dir" ;;
2882 if test "$linkmode,$pass" != "prog,link"; then
2885 vars="compile_deplibs finalize_deplibs"
2887 for var in $vars dependency_libs; do
2888 # Add libraries to $var in reverse order
2889 eval tmp_libs=\"\$$var\"
2891 for deplib in $tmp_libs; do
2892 # FIXME: Pedantically, this is the right thing to do, so
2893 # that some nasty dependency loop isn't accidentally
2895 #new_libs="$deplib $new_libs"
2896 # Pragmatically, this seems to cause very few problems in
2899 -L*) new_libs="$deplib $new_libs" ;;
2902 # And here is the reason: when a library appears more
2903 # than once as an explicit dependence of a library, or
2904 # is implicitly linked in more than once by the
2905 # compiler, it is considered special, and multiple
2906 # occurrences thereof are not removed. Compare this
2907 # with having the same library being listed as a
2908 # dependency of multiple other libraries: in this case,
2909 # we know (pedantically, we assume) the library does not
2910 # need to be listed more than once, so we keep only the
2911 # last copy. This is not always right, but it is rare
2912 # enough that we require users that really mean to play
2913 # such unportable linking tricks to link the library
2914 # using -Wl,-lname, so that libtool does not consider it
2915 # for duplicate removal.
2916 case " $specialdeplibs " in
2917 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2919 case " $new_libs " in
2921 *) new_libs="$deplib $new_libs" ;;
2929 for deplib in $new_libs; do
2932 case " $tmp_libs " in
2934 *) tmp_libs="$tmp_libs $deplib" ;;
2937 *) tmp_libs="$tmp_libs $deplib" ;;
2940 eval $var=\"$tmp_libs\"
2943 # Last step: remove runtime libs from dependency_libs
2944 # (they stay in deplibs)
2946 for i in $dependency_libs ; do
2947 case " $predeps $postdeps $compiler_lib_search_path " in
2952 if test -n "$i" ; then
2953 tmp_libs="$tmp_libs $i"
2956 dependency_libs=$tmp_libs
2958 if test "$linkmode" = prog; then
2959 dlfiles="$newdlfiles"
2960 dlprefiles="$newdlprefiles"
2965 if test -n "$deplibs"; then
2966 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2969 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2970 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2973 if test -n "$rpath"; then
2974 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2977 if test -n "$xrpath"; then
2978 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2981 if test -n "$vinfo"; then
2982 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2985 if test -n "$release"; then
2986 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2989 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2990 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2993 # Now set the variables for building old libraries.
2994 build_libtool_libs=no
2996 objs="$objs$old_deplibs"
3000 # Make sure we only generate libraries of the form `libNAME.la'.
3003 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3004 eval shared_ext=\"$shrext_cmds\"
3005 eval libname=\"$libname_spec\"
3008 if test "$module" = no; then
3009 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3013 if test "$need_lib_prefix" != no; then
3014 # Add the "lib" prefix for modules if required
3015 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3016 eval shared_ext=\"$shrext_cmds\"
3017 eval libname=\"$libname_spec\"
3019 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3024 if test -n "$objs"; then
3025 if test "$deplibs_check_method" != pass_all; then
3026 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3030 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3031 $echo "*** objects $objs is not portable!"
3032 libobjs="$libobjs $objs"
3036 if test "$dlself" != no; then
3037 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3041 if test "$#" -gt 2; then
3042 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3047 if test -z "$rpath"; then
3048 if test "$build_libtool_libs" = yes; then
3049 # Building a libtool convenience library.
3050 # Some compilers have problems with a `.al' extension so
3051 # convenience libraries should have the same extension an
3052 # archive normally would.
3053 oldlibs="$output_objdir/$libname.$libext $oldlibs"
3054 build_libtool_libs=convenience
3058 if test -n "$vinfo"; then
3059 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3062 if test -n "$release"; then
3063 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3067 # Parse the version information argument.
3068 save_ifs="$IFS"; IFS=':'
3069 set dummy $vinfo 0 0 0
3072 if test -n "$8"; then
3073 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3078 # convert absolute version numbers to libtool ages
3079 # this retains compatibility with .la files and attempts
3080 # to make the code below a bit more comprehensible
3082 case $vinfo_number in
3086 number_revision="$4"
3088 # There are really only two kinds -- those that
3089 # use the current revision as the major version
3090 # and those that subtract age and use age as
3091 # a minor version. But, then there is irix
3092 # which has an extra 1 added just for fun
3094 case $version_type in
3095 darwin|linux|osf|windows)
3096 current=`expr $number_major + $number_minor`
3098 revision="$number_revision"
3100 freebsd-aout|freebsd-elf|sunos)
3101 current="$number_major"
3102 revision="$number_minor"
3106 current=`expr $number_major + $number_minor - 1`
3108 revision="$number_minor"
3111 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3112 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3124 # Check that each of the things are valid numbers.
3126 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3128 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3129 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3135 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3137 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3138 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3144 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
3146 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3147 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3152 if test "$age" -gt "$current"; then
3153 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3154 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3158 # Calculate the version variables.
3162 case $version_type in
3166 # Like Linux, but with the current version available in
3167 # verstring for coding it into the library header
3168 major=.`expr $current - $age`
3169 versuffix="$major.$age.$revision"
3170 # Darwin ld doesn't like 0 for these options...
3171 minor_current=`expr $current + 1`
3172 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3177 versuffix=".$current.$revision";
3182 versuffix=".$current";
3186 major=`expr $current - $age + 1`
3188 case $version_type in
3189 nonstopux) verstring_prefix=nonstopux ;;
3190 *) verstring_prefix=sgi ;;
3192 verstring="$verstring_prefix$major.$revision"
3194 # Add in all the interfaces that we are compatible with.
3196 while test "$loop" -ne 0; do
3197 iface=`expr $revision - $loop`
3198 loop=`expr $loop - 1`
3199 verstring="$verstring_prefix$major.$iface:$verstring"
3202 # Before this point, $major must not contain `.'.
3204 versuffix="$major.$revision"
3208 major=.`expr $current - $age`
3209 versuffix="$major.$age.$revision"
3213 major=.`expr $current - $age`
3214 versuffix=".$current.$age.$revision"
3215 verstring="$current.$age.$revision"
3217 # Add in all the interfaces that we are compatible with.
3219 while test "$loop" -ne 0; do
3220 iface=`expr $current - $loop`
3221 loop=`expr $loop - 1`
3222 verstring="$verstring:${iface}.0"
3225 # Make executables depend on our current version.
3226 verstring="$verstring:${current}.0"
3231 versuffix=".$current.$revision"
3235 # Use '-' rather than '.', since we only want one
3236 # extension on DOS 8.3 filesystems.
3237 major=`expr $current - $age`
3242 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3243 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3248 # Clear the version info if we defaulted, and they specified a release.
3249 if test -z "$vinfo" && test -n "$release"; then
3251 case $version_type in
3253 # we can't check for "0.0" in archive_cmds due to quoting
3254 # problems, so we reset it completely
3261 if test "$need_version" = no; then
3268 # Remove version info from name if versioning should be avoided
3269 if test "$avoid_version" = yes && test "$need_version" = no; then
3275 # Check to see if the archive will have undefined symbols.
3276 if test "$allow_undefined" = yes; then
3277 if test "$allow_undefined_flag" = unsupported; then
3278 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3279 build_libtool_libs=no
3283 # Don't allow undefined symbols.
3284 allow_undefined_flag="$no_undefined_flag"
3288 if test "$mode" != relink; then
3289 # Remove our outputs, but don't remove object files since they
3290 # may have been created when compiling PIC objects.
3292 tempremovelist=`$echo "$output_objdir/*"`
3293 for p in $tempremovelist; do
3297 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
3298 if test "X$precious_files_regex" != "X"; then
3299 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
3304 removelist="$removelist $p"
3309 if test -n "$removelist"; then
3310 $show "${rm}r $removelist"
3311 $run ${rm}r $removelist
3315 # Now set the variables for building old libraries.
3316 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
3317 oldlibs="$oldlibs $output_objdir/$libname.$libext"
3319 # Transform .lo files to .o files.
3320 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3323 # Eliminate all temporary directories.
3324 for path in $notinst_path; do
3325 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3326 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3327 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3330 if test -n "$xrpath"; then
3331 # If the user specified any rpath flags, then add them.
3333 for libdir in $xrpath; do
3334 temp_xrpath="$temp_xrpath -R$libdir"
3335 case "$finalize_rpath " in
3337 *) finalize_rpath="$finalize_rpath $libdir" ;;
3340 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
3341 dependency_libs="$temp_xrpath $dependency_libs"
3345 # Make sure dlfiles contains only unique files that won't be dlpreopened
3346 old_dlfiles="$dlfiles"
3348 for lib in $old_dlfiles; do
3349 case " $dlprefiles $dlfiles " in
3351 *) dlfiles="$dlfiles $lib" ;;
3355 # Make sure dlprefiles contains only unique files
3356 old_dlprefiles="$dlprefiles"
3358 for lib in $old_dlprefiles; do
3359 case "$dlprefiles " in
3361 *) dlprefiles="$dlprefiles $lib" ;;
3365 if test "$build_libtool_libs" = yes; then
3366 if test -n "$rpath"; then
3368 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
3369 # these systems don't actually have a c library (as such)!
3371 *-*-rhapsody* | *-*-darwin1.[012])
3372 # Rhapsody C library is in the System framework
3373 deplibs="$deplibs -framework System"
3376 # Don't link with libc until the a.out ld.so is fixed.
3378 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3379 # Do not include libc due to us having libc/libc_r.
3380 test "X$arg" = "X-lc" && continue
3383 # Add libc to deplibs on all other systems if necessary.
3384 if test "$build_libtool_need_lc" = "yes"; then
3385 deplibs="$deplibs -lc"
3391 # Transform deplibs into only deplibs that can be linked in shared.
3393 libname_save=$libname
3394 release_save=$release
3395 versuffix_save=$versuffix
3397 # I'm not sure if I'm treating the release correctly. I think
3398 # release should show up in the -l (ie -lgmp5) so we don't want to
3399 # add it in twice. Is that correct?
3405 case $deplibs_check_method in
3407 # Don't check for shared/static. Everything works.
3408 # This might be a little naive. We might want to check
3409 # whether the library exists or not. But this is on
3410 # osf3 & osf4 and I'm not really sure... Just
3411 # implementing what was already the behavior.
3415 # This code stresses the "libraries are programs" paradigm to its
3416 # limits. Maybe even breaks it. We compile a program, linking it
3417 # against the deplibs as a proxy for the library. Then we can check
3418 # whether they linked in statically or dynamically with ldd.
3420 cat > conftest.c <<EOF
3421 int main() { return 0; }
3424 $LTCC -o conftest conftest.c $deplibs
3425 if test "$?" -eq 0 ; then
3426 ldd_output=`ldd conftest`
3427 for i in $deplibs; do
3428 name=`expr $i : '-l\(.*\)'`
3429 # If $name is empty we are operating on a -L argument.
3430 if test "$name" != "" && test "$name" -ne "0"; then
3431 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3432 case " $predeps $postdeps " in
3434 newdeplibs="$newdeplibs $i"
3439 if test -n "$i" ; then
3440 libname=`eval \\$echo \"$libname_spec\"`
3441 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3442 set dummy $deplib_matches
3444 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3445 newdeplibs="$newdeplibs $i"
3449 $echo "*** Warning: dynamic linker does not accept needed library $i."
3450 $echo "*** I have the capability to make that library automatically link in when"
3451 $echo "*** you link to this library. But I can only do this if you have a"
3452 $echo "*** shared version of the library, which I believe you do not have"
3453 $echo "*** because a test_compile did reveal that the linker did not use it for"
3454 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3458 newdeplibs="$newdeplibs $i"
3462 # Error occurred in the first compile. Let's try to salvage
3463 # the situation: Compile a separate program for each library.
3464 for i in $deplibs; do
3465 name=`expr $i : '-l\(.*\)'`
3466 # If $name is empty we are operating on a -L argument.
3467 if test "$name" != "" && test "$name" != "0"; then
3469 $LTCC -o conftest conftest.c $i
3471 if test "$?" -eq 0 ; then
3472 ldd_output=`ldd conftest`
3473 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3474 case " $predeps $postdeps " in
3476 newdeplibs="$newdeplibs $i"
3481 if test -n "$i" ; then
3482 libname=`eval \\$echo \"$libname_spec\"`
3483 deplib_matches=`eval \\$echo \"$library_names_spec\"`
3484 set dummy $deplib_matches
3486 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3487 newdeplibs="$newdeplibs $i"
3491 $echo "*** Warning: dynamic linker does not accept needed library $i."
3492 $echo "*** I have the capability to make that library automatically link in when"
3493 $echo "*** you link to this library. But I can only do this if you have a"
3494 $echo "*** shared version of the library, which you do not appear to have"
3495 $echo "*** because a test_compile did reveal that the linker did not use this one"
3496 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3502 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3503 $echo "*** make it link in! You will probably need to install it or some"
3504 $echo "*** library that it depends on before this library will be fully"
3505 $echo "*** functional. Installing it before continuing would be even better."
3508 newdeplibs="$newdeplibs $i"
3514 set dummy $deplibs_check_method
3515 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3516 for a_deplib in $deplibs; do
3517 name=`expr $a_deplib : '-l\(.*\)'`
3518 # If $name is empty we are operating on a -L argument.
3519 if test "$name" != "" && test "$name" != "0"; then
3520 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3521 case " $predeps $postdeps " in
3523 newdeplibs="$newdeplibs $a_deplib"
3528 if test -n "$a_deplib" ; then
3529 libname=`eval \\$echo \"$libname_spec\"`
3530 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3531 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3532 for potent_lib in $potential_libs; do
3533 # Follow soft links.
3534 if ls -lLd "$potent_lib" 2>/dev/null \
3535 | grep " -> " >/dev/null; then
3538 # The statement above tries to avoid entering an
3539 # endless loop below, in case of cyclic links.
3540 # We might still enter an endless loop, since a link
3541 # loop can be closed while we follow links,
3543 potlib="$potent_lib"
3544 while test -h "$potlib" 2>/dev/null; do
3545 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
3547 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3548 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3551 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3553 | $EGREP "$file_magic_regex" > /dev/null; then
3554 newdeplibs="$newdeplibs $a_deplib"
3561 if test -n "$a_deplib" ; then
3564 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3565 $echo "*** I have the capability to make that library automatically link in when"
3566 $echo "*** you link to this library. But I can only do this if you have a"
3567 $echo "*** shared version of the library, which you do not appear to have"
3568 $echo "*** because I did check the linker path looking for a file starting"
3569 if test -z "$potlib" ; then
3570 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3572 $echo "*** with $libname and none of the candidates passed a file format test"
3573 $echo "*** using a file magic. Last file checked: $potlib"
3577 # Add a -L argument.
3578 newdeplibs="$newdeplibs $a_deplib"
3580 done # Gone through all deplibs.
3583 set dummy $deplibs_check_method
3584 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3585 for a_deplib in $deplibs; do
3586 name=`expr $a_deplib : '-l\(.*\)'`
3587 # If $name is empty we are operating on a -L argument.
3588 if test -n "$name" && test "$name" != "0"; then
3589 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3590 case " $predeps $postdeps " in
3592 newdeplibs="$newdeplibs $a_deplib"
3597 if test -n "$a_deplib" ; then
3598 libname=`eval \\$echo \"$libname_spec\"`
3599 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3600 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
3601 for potent_lib in $potential_libs; do
3602 potlib="$potent_lib" # see symlink-check above in file_magic test
3603 if eval $echo \"$potent_lib\" 2>/dev/null \
3605 | $EGREP "$match_pattern_regex" > /dev/null; then
3606 newdeplibs="$newdeplibs $a_deplib"
3613 if test -n "$a_deplib" ; then
3616 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3617 $echo "*** I have the capability to make that library automatically link in when"
3618 $echo "*** you link to this library. But I can only do this if you have a"
3619 $echo "*** shared version of the library, which you do not appear to have"
3620 $echo "*** because I did check the linker path looking for a file starting"
3621 if test -z "$potlib" ; then
3622 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3624 $echo "*** with $libname and none of the candidates passed a file format test"
3625 $echo "*** using a regex pattern. Last file checked: $potlib"
3629 # Add a -L argument.
3630 newdeplibs="$newdeplibs $a_deplib"
3632 done # Gone through all deplibs.
3636 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3637 -e 's/ -[LR][^ ]*//g'`
3638 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3639 for i in $predeps $postdeps ; do
3640 # can't use Xsed below, because $i might contain '/'
3641 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3644 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
3645 | grep . >/dev/null; then
3647 if test "X$deplibs_check_method" = "Xnone"; then
3648 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3650 $echo "*** Warning: inter-library dependencies are not known to be supported."
3652 $echo "*** All declared inter-library dependencies are being dropped."
3657 versuffix=$versuffix_save
3659 release=$release_save
3660 libname=$libname_save
3664 *-*-rhapsody* | *-*-darwin1.[012])
3665 # On Rhapsody replace the C library is the System framework
3666 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3670 if test "$droppeddeps" = yes; then
3671 if test "$module" = yes; then
3673 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3674 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3675 $echo "*** a static module, that should work as long as the dlopening"
3676 $echo "*** application is linked with the -dlopen flag."
3677 if test -z "$global_symbol_pipe"; then
3679 $echo "*** However, this would only work if libtool was able to extract symbol"
3680 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3681 $echo "*** not find such a program. So, this module is probably useless."
3682 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3684 if test "$build_old_libs" = no; then
3685 oldlibs="$output_objdir/$libname.$libext"
3686 build_libtool_libs=module
3689 build_libtool_libs=no
3692 $echo "*** The inter-library dependencies that have been dropped here will be"
3693 $echo "*** automatically added whenever a program is linked with this library"
3694 $echo "*** or is declared to -dlopen it."
3696 if test "$allow_undefined" = no; then
3698 $echo "*** Since this library must not contain undefined symbols,"
3699 $echo "*** because either the platform does not support them or"
3700 $echo "*** it was explicitly requested with -no-undefined,"
3701 $echo "*** libtool will only create a static version of it."
3702 if test "$build_old_libs" = no; then
3703 oldlibs="$output_objdir/$libname.$libext"
3704 build_libtool_libs=module
3707 build_libtool_libs=no
3712 # Done checking deplibs!
3716 # All the library-specific variables (install_libdir is set above).
3721 # Test again, we may have decided not to build it any more
3722 if test "$build_libtool_libs" = yes; then
3723 if test "$hardcode_into_libs" = yes; then
3724 # Hardcode the library paths
3727 rpath="$finalize_rpath"
3728 test "$mode" != relink && rpath="$compile_rpath$rpath"
3729 for libdir in $rpath; do
3730 if test -n "$hardcode_libdir_flag_spec"; then
3731 if test -n "$hardcode_libdir_separator"; then
3732 if test -z "$hardcode_libdirs"; then
3733 hardcode_libdirs="$libdir"
3735 # Just accumulate the unique libdirs.
3736 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3737 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3740 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3745 eval flag=\"$hardcode_libdir_flag_spec\"
3746 dep_rpath="$dep_rpath $flag"
3748 elif test -n "$runpath_var"; then
3749 case "$perm_rpath " in
3751 *) perm_rpath="$perm_rpath $libdir" ;;
3755 # Substitute the hardcoded libdirs into the rpath.
3756 if test -n "$hardcode_libdir_separator" &&
3757 test -n "$hardcode_libdirs"; then
3758 libdir="$hardcode_libdirs"
3759 if test -n "$hardcode_libdir_flag_spec_ld"; then
3760 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
3762 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3765 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3766 # We should set the runpath_var.
3768 for dir in $perm_rpath; do
3771 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3773 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
3776 shlibpath="$finalize_shlibpath"
3777 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
3778 if test -n "$shlibpath"; then
3779 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3782 # Get the real and link names of the library.
3783 eval shared_ext=\"$shrext_cmds\"
3784 eval library_names=\"$library_names_spec\"
3785 set dummy $library_names
3789 if test -n "$soname_spec"; then
3790 eval soname=\"$soname_spec\"
3794 if test -z "$dlname"; then
3798 lib="$output_objdir/$realname"
3801 linknames="$linknames $link"
3804 # Use standard objects if they are pic
3805 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3807 # Prepare the list of exported symbols
3808 if test -z "$export_symbols"; then
3809 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
3810 $show "generating symbol list for \`$libname.la'"
3811 export_symbols="$output_objdir/$libname.exp"
3812 $run $rm $export_symbols
3813 cmds=$export_symbols_cmds
3814 save_ifs="$IFS"; IFS='~'
3815 for cmd in $cmds; do
3818 if len=`expr "X$cmd" : ".*"` &&
3819 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3821 $run eval "$cmd" || exit $?
3822 skipped_export=false
3824 # The command line is too long to execute in one step.
3825 $show "using reloadable object file for export list..."
3827 # Break out early, otherwise skipped_export may be
3828 # set to false by a later but shorter cmd.
3833 if test -n "$export_symbols_regex"; then
3834 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3835 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3836 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3837 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3842 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3843 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3847 for test_deplib in $deplibs; do
3848 case " $convenience " in
3849 *" $test_deplib "*) ;;
3851 tmp_deplibs="$tmp_deplibs $test_deplib"
3855 deplibs="$tmp_deplibs"
3857 if test -n "$convenience"; then
3858 if test -n "$whole_archive_flag_spec"; then
3859 save_libobjs=$libobjs
3860 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3862 gentop="$output_objdir/${outputname}x"
3863 generated="$generated $gentop"
3865 func_extract_archives $gentop $convenience
3866 libobjs="$libobjs $func_extract_archives_result"
3870 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3871 eval flag=\"$thread_safe_flag_spec\"
3872 linker_flags="$linker_flags $flag"
3875 # Make a backup of the uninstalled library when relinking
3876 if test "$mode" = relink; then
3877 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
3880 # Do each of the archive commands.
3881 if test "$module" = yes && test -n "$module_cmds" ; then
3882 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3883 eval test_cmds=\"$module_expsym_cmds\"
3884 cmds=$module_expsym_cmds
3886 eval test_cmds=\"$module_cmds\"
3890 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3891 eval test_cmds=\"$archive_expsym_cmds\"
3892 cmds=$archive_expsym_cmds
3894 eval test_cmds=\"$archive_cmds\"
3899 if test "X$skipped_export" != "X:" &&
3900 len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3901 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3904 # The command line is too long to link in one step, link piecewise.
3905 $echo "creating reloadable object files..."
3907 # Save the value of $output and $libobjs because we want to
3908 # use them later. If we have whole_archive_flag_spec, we
3909 # want to use save_libobjs as it was before
3910 # whole_archive_flag_spec was expanded, because we can't
3911 # assume the linker understands whole_archive_flag_spec.
3912 # This may have to be revisited, in case too many
3913 # convenience libraries get linked in and end up exceeding
3915 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
3916 save_libobjs=$libobjs
3919 output_la=`$echo "X$output" | $Xsed -e "$basename"`
3921 # Clear the reloadable object creation command queue and
3922 # initialize k to one.
3929 output=$output_objdir/$output_la-${k}.$objext
3930 # Loop over the list of objects to be linked.
3931 for obj in $save_libobjs
3933 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3934 if test "X$objlist" = X ||
3935 { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3936 test "$len" -le "$max_cmd_len"; }; then
3937 objlist="$objlist $obj"
3939 # The command $test_cmds is almost too long, add a
3940 # command to the queue.
3941 if test "$k" -eq 1 ; then
3942 # The first file doesn't have a previous command to add.
3943 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
3945 # All subsequent reloadable object files will link in
3946 # the last one created.
3947 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3949 last_robj=$output_objdir/$output_la-${k}.$objext
3951 output=$output_objdir/$output_la-${k}.$objext
3956 # Handle the remaining objects by creating one last
3957 # reloadable object file. All subsequent reloadable object
3958 # files will link in the last one created.
3959 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
3960 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
3962 if ${skipped_export-false}; then
3963 $show "generating symbol list for \`$libname.la'"
3964 export_symbols="$output_objdir/$libname.exp"
3965 $run $rm $export_symbols
3967 # Append the command to create the export file.
3968 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3971 # Set up a command to remove the reloadable object files
3972 # after they are used.
3974 while test "$i" -lt "$k"
3977 delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3980 $echo "creating a temporary reloadable object file: $output"
3982 # Loop through the commands generated above and execute them.
3983 save_ifs="$IFS"; IFS='~'
3984 for cmd in $concat_cmds; do
3987 $run eval "$cmd" || exit $?
3992 # Restore the value of output.
3995 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3996 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3998 # Expand the library linking commands again to reset the
3999 # value of $libobjs for piecewise linking.
4001 # Do each of the archive commands.
4002 if test "$module" = yes && test -n "$module_cmds" ; then
4003 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4004 cmds=$module_expsym_cmds
4009 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4010 cmds=$archive_expsym_cmds
4016 # Append the command to remove the reloadable object files
4017 # to the just-reset $cmds.
4018 eval cmds=\"\$cmds~\$rm $delfiles\"
4020 save_ifs="$IFS"; IFS='~'
4021 for cmd in $cmds; do
4025 $run eval "$cmd" || {
4028 # Restore the uninstalled library and exit
4029 if test "$mode" = relink; then
4030 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4038 # Restore the uninstalled library and exit
4039 if test "$mode" = relink; then
4040 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
4042 if test -n "$convenience"; then
4043 if test -z "$whole_archive_flag_spec"; then
4044 $show "${rm}r $gentop"
4045 $run ${rm}r "$gentop"
4052 # Create links to the real library.
4053 for linkname in $linknames; do
4054 if test "$realname" != "$linkname"; then
4055 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4056 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
4060 # If -module or -export-dynamic was specified, set the dlname.
4061 if test "$module" = yes || test "$export_dynamic" = yes; then
4062 # On all known operating systems, these are identical.
4069 if test -n "$deplibs"; then
4070 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4073 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4074 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4077 if test -n "$rpath"; then
4078 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4081 if test -n "$xrpath"; then
4082 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4085 if test -n "$vinfo"; then
4086 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4089 if test -n "$release"; then
4090 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4095 if test -n "$objs$old_deplibs"; then
4096 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4100 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
4108 # Delete the old objects.
4109 $run $rm $obj $libobj
4111 # Objects from convenience libraries. This assumes
4112 # single-version convenience libraries. Whenever we create
4113 # different ones for PIC/non-PIC, this we'll have to duplicate
4117 # reload_cmds runs $LD directly, so let us get rid of
4118 # -Wl from whole_archive_flag_spec
4121 if test -n "$convenience"; then
4122 if test -n "$whole_archive_flag_spec"; then
4123 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4125 gentop="$output_objdir/${obj}x"
4126 generated="$generated $gentop"
4128 func_extract_archives $gentop $convenience
4129 reload_conv_objs="$reload_objs $func_extract_archives_result"
4133 # Create the old-style object.
4134 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
4138 save_ifs="$IFS"; IFS='~'
4139 for cmd in $cmds; do
4143 $run eval "$cmd" || exit $?
4147 # Exit if we aren't doing a library object file.
4148 if test -z "$libobj"; then
4149 if test -n "$gentop"; then
4150 $show "${rm}r $gentop"
4157 if test "$build_libtool_libs" != yes; then
4158 if test -n "$gentop"; then
4159 $show "${rm}r $gentop"
4163 # Create an invalid libtool object if no PIC, so that we don't
4164 # accidentally link it into a program.
4165 # $show "echo timestamp > $libobj"
4166 # $run eval "echo timestamp > $libobj" || exit $?
4170 if test -n "$pic_flag" || test "$pic_mode" != default; then
4171 # Only do commands if we really have different PIC objects.
4172 reload_objs="$libobjs $reload_conv_objs"
4175 save_ifs="$IFS"; IFS='~'
4176 for cmd in $cmds; do
4180 $run eval "$cmd" || exit $?
4185 if test -n "$gentop"; then
4186 $show "${rm}r $gentop"
4195 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4197 if test -n "$vinfo"; then
4198 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4201 if test -n "$release"; then
4202 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4205 if test "$preload" = yes; then
4206 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
4207 test "$dlopen_self_static" = unknown; then
4208 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4213 *-*-rhapsody* | *-*-darwin1.[012])
4214 # On Rhapsody replace the C library is the System framework
4215 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4216 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4222 # Don't allow lazy linking, it breaks C++ global constructors
4223 if test "$tagname" = CXX ; then
4224 compile_command="$compile_command ${wl}-bind_at_load"
4225 finalize_command="$finalize_command ${wl}-bind_at_load"
4230 compile_command="$compile_command $compile_deplibs"
4231 finalize_command="$finalize_command $finalize_deplibs"
4233 if test -n "$rpath$xrpath"; then
4234 # If the user specified any rpath flags, then add them.
4235 for libdir in $rpath $xrpath; do
4236 # This is the magic to use -rpath.
4237 case "$finalize_rpath " in
4239 *) finalize_rpath="$finalize_rpath $libdir" ;;
4244 # Now hardcode the library paths
4247 for libdir in $compile_rpath $finalize_rpath; do
4248 if test -n "$hardcode_libdir_flag_spec"; then
4249 if test -n "$hardcode_libdir_separator"; then
4250 if test -z "$hardcode_libdirs"; then
4251 hardcode_libdirs="$libdir"
4253 # Just accumulate the unique libdirs.
4254 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4255 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4258 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4263 eval flag=\"$hardcode_libdir_flag_spec\"
4264 rpath="$rpath $flag"
4266 elif test -n "$runpath_var"; then
4267 case "$perm_rpath " in
4269 *) perm_rpath="$perm_rpath $libdir" ;;
4273 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4274 case :$dllsearchpath: in
4276 *) dllsearchpath="$dllsearchpath:$libdir";;
4281 # Substitute the hardcoded libdirs into the rpath.
4282 if test -n "$hardcode_libdir_separator" &&
4283 test -n "$hardcode_libdirs"; then
4284 libdir="$hardcode_libdirs"
4285 eval rpath=\" $hardcode_libdir_flag_spec\"
4287 compile_rpath="$rpath"
4291 for libdir in $finalize_rpath; do
4292 if test -n "$hardcode_libdir_flag_spec"; then
4293 if test -n "$hardcode_libdir_separator"; then
4294 if test -z "$hardcode_libdirs"; then
4295 hardcode_libdirs="$libdir"
4297 # Just accumulate the unique libdirs.
4298 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4299 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4302 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4307 eval flag=\"$hardcode_libdir_flag_spec\"
4308 rpath="$rpath $flag"
4310 elif test -n "$runpath_var"; then
4311 case "$finalize_perm_rpath " in
4313 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
4317 # Substitute the hardcoded libdirs into the rpath.
4318 if test -n "$hardcode_libdir_separator" &&
4319 test -n "$hardcode_libdirs"; then
4320 libdir="$hardcode_libdirs"
4321 eval rpath=\" $hardcode_libdir_flag_spec\"
4323 finalize_rpath="$rpath"
4325 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4326 # Transform all the library objects into standard objects.
4327 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4328 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4332 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4333 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4334 dlsyms="${outputname}S.c"
4336 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4340 if test -n "$dlsyms"; then
4344 # Discover the nlist of each of the dlfiles.
4345 nlist="$output_objdir/${outputname}.nm"
4347 $show "$rm $nlist ${nlist}S ${nlist}T"
4348 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4350 # Parse the name list into a source file.
4351 $show "creating $output_objdir/$dlsyms"
4353 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4354 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4355 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4361 /* Prevent the only kind of declaration conflicts we can make. */
4362 #define lt_preloaded_symbols some_other_symbol
4364 /* External symbol declarations for the compiler. */\
4367 if test "$dlself" = yes; then
4368 $show "generating symbol list for \`$output'"
4370 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4372 # Add our own program objects to the symbol list.
4373 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4374 for arg in $progfiles; do
4375 $show "extracting global C symbols from \`$arg'"
4376 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4379 if test -n "$exclude_expsyms"; then
4380 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4381 $run eval '$mv "$nlist"T "$nlist"'
4384 if test -n "$export_symbols_regex"; then
4385 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4386 $run eval '$mv "$nlist"T "$nlist"'
4389 # Prepare the list of exported symbols
4390 if test -z "$export_symbols"; then
4391 export_symbols="$output_objdir/$outputname.exp"
4392 $run $rm $export_symbols
4393 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4395 $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4396 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4397 $run eval 'mv "$nlist"T "$nlist"'
4401 for arg in $dlprefiles; do
4402 $show "extracting global C symbols from \`$arg'"
4403 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4404 $run eval '$echo ": $name " >> "$nlist"'
4405 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4408 if test -z "$run"; then
4409 # Make sure we have at least an empty file.
4410 test -f "$nlist" || : > "$nlist"
4412 if test -n "$exclude_expsyms"; then
4413 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4414 $mv "$nlist"T "$nlist"
4417 # Try sorting and uniquifying the output.
4418 if grep -v "^: " < "$nlist" |
4419 if sort -k 3 </dev/null >/dev/null 2>&1; then
4424 uniq > "$nlist"S; then
4427 grep -v "^: " < "$nlist" > "$nlist"S
4430 if test -f "$nlist"S; then
4431 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4433 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4436 $echo >> "$output_objdir/$dlsyms" "\
4438 #undef lt_preloaded_symbols
4440 #if defined (__STDC__) && __STDC__
4441 # define lt_ptr void *
4443 # define lt_ptr char *
4447 /* The mapping between symbol names and symbols. */
4451 *cygwin* | *mingw* )
4452 $echo >> "$output_objdir/$dlsyms" "\
4453 /* DATA imports from DLLs on WIN32 can't be const, because
4454 runtime relocations are performed -- see ld's documentation
4460 $echo >> "$output_objdir/$dlsyms" "\
4467 $echo >> "$output_objdir/$dlsyms" "\
4471 lt_preloaded_symbols[] =
4475 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4477 $echo >> "$output_objdir/$dlsyms" "\
4481 /* This works around a problem in FreeBSD linker */
4482 #ifdef FREEBSD_WORKAROUND
4483 static const void *lt_preloaded_setup() {
4484 return lt_preloaded_symbols;
4494 pic_flag_for_symtable=
4496 # compiling the symbol table file with pic_flag works around
4497 # a FreeBSD bug that causes programs to crash when -lm is
4498 # linked before any other PIC object. But we must not use
4499 # pic_flag when linking with -static. The problem exists in
4500 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4501 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4502 case "$compile_command " in
4504 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
4507 case "$compile_command " in
4509 *) pic_flag_for_symtable=" $pic_flag";;
4513 # Now compile the dynamic symbol file.
4514 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4515 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4517 # Clean up the generated files.
4518 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4519 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4521 # Transform the symbol file into the correct name.
4522 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4523 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4526 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4531 # We keep going just in case the user didn't refer to
4532 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4533 # really was required.
4535 # Nullify the symbol file.
4536 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4537 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4540 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4541 # Replace the output file specification.
4542 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4543 link_command="$compile_command$compile_rpath"
4545 # We have no uninstalled library dependencies, so finalize right now.
4546 $show "$link_command"
4547 $run eval "$link_command"
4550 # Delete the generated files.
4551 if test -n "$dlsyms"; then
4552 $show "$rm $output_objdir/${outputname}S.${objext}"
4553 $run $rm "$output_objdir/${outputname}S.${objext}"
4559 if test -n "$shlibpath_var"; then
4560 # We should set the shlibpath_var
4562 for dir in $temp_rpath; do
4564 [\\/]* | [A-Za-z]:[\\/]*)
4569 # Relative path: add a thisdir entry.
4570 rpath="$rpath\$thisdir/$dir:"
4577 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4578 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4580 if test -n "$finalize_shlibpath"; then
4581 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4586 if test -n "$runpath_var"; then
4587 if test -n "$perm_rpath"; then
4588 # We should set the runpath_var.
4590 for dir in $perm_rpath; do
4593 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
4595 if test -n "$finalize_perm_rpath"; then
4596 # We should set the runpath_var.
4598 for dir in $finalize_perm_rpath; do
4601 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
4605 if test "$no_install" = yes; then
4606 # We don't need to create a wrapper script.
4607 link_command="$compile_var$compile_command$compile_rpath"
4608 # Replace the output file specification.
4609 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4610 # Delete the old output file.
4612 # Link the executable and exit
4613 $show "$link_command"
4614 $run eval "$link_command" || exit $?
4618 if test "$hardcode_action" = relink; then
4619 # Fast installation is not supported
4620 link_command="$compile_var$compile_command$compile_rpath"
4621 relink_command="$finalize_var$finalize_command$finalize_rpath"
4623 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4624 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4626 if test "$fast_install" != no; then
4627 link_command="$finalize_var$compile_command$finalize_rpath"
4628 if test "$fast_install" = yes; then
4629 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4631 # fast_install is set to needless
4635 link_command="$compile_var$compile_command$compile_rpath"
4636 relink_command="$finalize_var$finalize_command$finalize_rpath"
4640 # Replace the output file specification.
4641 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4643 # Delete the old output files.
4644 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4646 $show "$link_command"
4647 $run eval "$link_command" || exit $?
4649 # Now create the wrapper script.
4650 $show "creating $output"
4652 # Quote the relink command for shipping.
4653 if test -n "$relink_command"; then
4654 # Preserve any variables that may affect compiler behavior
4655 for var in $variables_saved_for_relink; do
4656 if eval test -z \"\${$var+set}\"; then
4657 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4658 elif eval var_value=\$$var; test -z "$var_value"; then
4659 relink_command="$var=; export $var; $relink_command"
4661 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4662 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4665 relink_command="(cd `pwd`; $relink_command)"
4666 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4669 # Quote $echo for shipping.
4670 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4672 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
4673 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
4675 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4677 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4680 # Only actually do things if our run command is non-null.
4681 if test -z "$run"; then
4682 # win32 will think the script is a binary if it has
4683 # a .exe suffix, so we strip it off here.
4685 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
4687 # test for cygwin because mv fails w/o .exe extensions
4691 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4695 *cygwin* | *mingw* )
4696 cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4697 cwrapper=`$echo ${output}.exe`
4698 $rm $cwrappersource $cwrapper
4699 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4701 cat > $cwrappersource <<EOF
4703 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4704 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4706 The $output program cannot be directly executed until all the libtool
4707 libraries that it depends on are installed.
4709 This wrapper executable should never be moved out of the build directory.
4710 If it is, it will not operate correctly.
4712 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4713 but could eventually absorb all of the scripts functionality and
4714 exec $objdir/$outputname directly.
4717 cat >> $cwrappersource<<"EOF"
4725 #if defined(PATH_MAX)
4726 # define LT_PATHMAX PATH_MAX
4727 #elif defined(MAXPATHLEN)
4728 # define LT_PATHMAX MAXPATHLEN
4730 # define LT_PATHMAX 1024
4733 #ifndef DIR_SEPARATOR
4734 #define DIR_SEPARATOR '/'
4737 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4739 #define HAVE_DOS_BASED_FILE_SYSTEM
4740 #ifndef DIR_SEPARATOR_2
4741 #define DIR_SEPARATOR_2 '\\'
4745 #ifndef DIR_SEPARATOR_2
4746 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4747 #else /* DIR_SEPARATOR_2 */
4748 # define IS_DIR_SEPARATOR(ch) \
4749 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4750 #endif /* DIR_SEPARATOR_2 */
4752 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4753 #define XFREE(stale) do { \
4754 if (stale) { free ((void *) stale); stale = 0; } \
4757 const char *program_name = NULL;
4759 void * xmalloc (size_t num);
4760 char * xstrdup (const char *string);
4761 char * basename (const char *name);
4762 char * fnqualify(const char *path);
4763 char * strendzap(char *str, const char *pat);
4764 void lt_fatal (const char *message, ...);
4767 main (int argc, char *argv[])
4772 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4773 newargz = XMALLOC(char *, argc+2);
4776 cat >> $cwrappersource <<EOF
4777 newargz[0] = "$SHELL";
4780 cat >> $cwrappersource <<"EOF"
4781 newargz[1] = fnqualify(argv[0]);
4782 /* we know the script has the same name, without the .exe */
4783 /* so make sure newargz[1] doesn't end in .exe */
4784 strendzap(newargz[1],".exe");
4785 for (i = 1; i < argc; i++)
4786 newargz[i+1] = xstrdup(argv[i]);
4787 newargz[argc+1] = NULL;
4790 cat >> $cwrappersource <<EOF
4791 execv("$SHELL",newargz);
4794 cat >> $cwrappersource <<"EOF"
4799 xmalloc (size_t num)
4801 void * p = (void *) malloc (num);
4803 lt_fatal ("Memory exhausted");
4809 xstrdup (const char *string)
4811 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4816 basename (const char *name)
4820 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4821 /* Skip over the disk name in MSDOS pathnames. */
4822 if (isalpha (name[0]) && name[1] == ':')
4826 for (base = name; *name; name++)
4827 if (IS_DIR_SEPARATOR (*name))
4829 return (char *) base;
4833 fnqualify(const char *path)
4837 char tmp[LT_PATHMAX + 1];
4839 assert(path != NULL);
4841 /* Is it qualified already? */
4842 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4843 if (isalpha (path[0]) && path[1] == ':')
4844 return xstrdup (path);
4846 if (IS_DIR_SEPARATOR (path[0]))
4847 return xstrdup (path);
4849 /* prepend the current directory */
4850 /* doesn't handle '~' */
4851 if (getcwd (tmp, LT_PATHMAX) == NULL)
4852 lt_fatal ("getcwd failed");
4853 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4854 p = XMALLOC(char, size);
4855 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4860 strendzap(char *str, const char *pat)
4864 assert(str != NULL);
4865 assert(pat != NULL);
4868 patlen = strlen(pat);
4872 str += len - patlen;
4873 if (strcmp(str, pat) == 0)
4880 lt_error_core (int exit_status, const char * mode,
4881 const char * message, va_list ap)
4883 fprintf (stderr, "%s: %s: ", program_name, mode);
4884 vfprintf (stderr, message, ap);
4885 fprintf (stderr, ".\n");
4887 if (exit_status >= 0)
4892 lt_fatal (const char *message, ...)
4895 va_start (ap, message);
4896 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
4900 # we should really use a build-platform specific compiler
4901 # here, but OTOH, the wrappers (shell script and this C one)
4902 # are only useful if you want to execute the "real" binary.
4903 # Since the "real" binary is built for $host, then this
4904 # wrapper might as well be built for $host, too.
4905 $run $LTCC -s -o $cwrapper $cwrappersource
4909 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4914 # $output - temporary wrapper script for $objdir/$outputname
4915 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4917 # The $output program cannot be directly executed until all the libtool
4918 # libraries that it depends on are installed.
4920 # This wrapper script should never be moved out of the build directory.
4921 # If it is, it will not operate correctly.
4923 # Sed substitution that helps us do robust quoting. It backslashifies
4924 # metacharacters that are still active within double-quoted strings.
4925 Xsed='${SED} -e 1s/^X//'
4926 sed_quote_subst='$sed_quote_subst'
4928 # The HP-UX ksh and POSIX shell print the target directory to stdout
4930 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4932 relink_command=\"$relink_command\"
4934 # This environment variable determines our operation mode.
4935 if test \"\$libtool_install_magic\" = \"$magic\"; then
4936 # install mode needs the following variable:
4937 notinst_deplibs='$notinst_deplibs'
4939 # When we are sourced in execute mode, \$file and \$echo are already set.
4940 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4943 # Make sure echo works.
4944 if test \"X\$1\" = X--no-reexec; then
4945 # Discard the --no-reexec flag, and continue.
4947 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4948 # Yippee, \$echo works!
4951 # Restart under the correct shell, and then maybe \$echo will work.
4952 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4958 # Find the directory that this script lives in.
4959 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4960 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4962 # Follow symbolic links until we get to the real thisdir.
4963 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4964 while test -n \"\$file\"; do
4965 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4967 # If there was a directory component, then change thisdir.
4968 if test \"x\$destdir\" != \"x\$file\"; then
4969 case \"\$destdir\" in
4970 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4971 *) thisdir=\"\$thisdir/\$destdir\" ;;
4975 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4976 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4979 # Try to get the absolute directory name.
4980 absdir=\`cd \"\$thisdir\" && pwd\`
4981 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4984 if test "$fast_install" = yes; then
4986 program=lt-'$outputname'$exeext
4987 progdir=\"\$thisdir/$objdir\"
4989 if test ! -f \"\$progdir/\$program\" || \\
4990 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4991 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4993 file=\"\$\$-\$program\"
4995 if test ! -d \"\$progdir\"; then
4996 $mkdir \"\$progdir\"
4998 $rm \"\$progdir/\$file\"
5003 # relink executable if necessary
5004 if test -n \"\$relink_command\"; then
5005 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5007 $echo \"\$relink_command_output\" >&2
5008 $rm \"\$progdir/\$file\"
5013 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5014 { $rm \"\$progdir/\$program\";
5015 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5016 $rm \"\$progdir/\$file\"
5020 program='$outputname'
5021 progdir=\"\$thisdir/$objdir\"
5027 if test -f \"\$progdir/\$program\"; then"
5029 # Export our shlibpath_var if we have one.
5030 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5032 # Add our own library path to $shlibpath_var
5033 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5035 # Some systems cannot cope with colon-terminated $shlibpath_var
5036 # The second colon is a workaround for a bug in BeOS R4 sed
5037 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5039 export $shlibpath_var
5043 # fixup the dll searchpath if we need to.
5044 if test -n "$dllsearchpath"; then
5046 # Add the dll search path components to the executable PATH
5047 PATH=$dllsearchpath:\$PATH
5052 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5053 # Run the actual program with our arguments.
5056 # Backslashes separate directories on plain windows
5057 *-*-mingw | *-*-os2*)
5059 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5065 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5070 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5074 # The program doesn't exist.
5075 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5076 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5077 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5088 # See if we need to build an old-fashioned archive.
5089 for oldlib in $oldlibs; do
5091 if test "$build_libtool_libs" = convenience; then
5092 oldobjs="$libobjs_save"
5093 addlibs="$convenience"
5094 build_libtool_libs=no
5096 if test "$build_libtool_libs" = module; then
5097 oldobjs="$libobjs_save"
5098 build_libtool_libs=no
5100 oldobjs="$old_deplibs $non_pic_objects"
5102 addlibs="$old_convenience"
5105 if test -n "$addlibs"; then
5106 gentop="$output_objdir/${outputname}x"
5107 generated="$generated $gentop"
5109 func_extract_archives $gentop $addlibs
5110 oldobjs="$oldobjs $func_extract_archives_result"
5113 # Do each command in the archive commands.
5114 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5115 cmds=$old_archive_from_new_cmds
5117 # POSIX demands no paths to be encoded in archives. We have
5118 # to avoid creating archives with duplicate basenames if we
5119 # might have to extract them afterwards, e.g., when creating a
5120 # static archive out of a convenience library, or when linking
5121 # the entirety of a libtool archive into another (currently
5122 # not supported by libtool).
5123 if (for obj in $oldobjs
5125 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5126 done | sort | sort -uc >/dev/null 2>&1); then
5129 $echo "copying selected object files to avoid basename conflicts..."
5131 if test -z "$gentop"; then
5132 gentop="$output_objdir/${outputname}x"
5133 generated="$generated $gentop"
5135 $show "${rm}r $gentop"
5136 $run ${rm}r "$gentop"
5137 $show "$mkdir $gentop"
5138 $run $mkdir "$gentop"
5140 if test "$status" -ne 0 && test ! -d "$gentop"; then
5145 save_oldobjs=$oldobjs
5148 for obj in $save_oldobjs
5150 objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5151 case " $oldobjs " in
5152 " ") oldobjs=$obj ;;
5155 # Make sure we don't pick an alternate name that also
5157 newobj=lt$counter-$objbase
5158 counter=`expr $counter + 1`
5159 case " $oldobjs " in
5160 *[\ /]"$newobj "*) ;;
5161 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5164 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5165 $run ln "$obj" "$gentop/$newobj" ||
5166 $run cp "$obj" "$gentop/$newobj"
5167 oldobjs="$oldobjs $gentop/$newobj"
5169 *) oldobjs="$oldobjs $obj" ;;
5174 eval cmds=\"$old_archive_cmds\"
5176 if len=`expr "X$cmds" : ".*"` &&
5177 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5178 cmds=$old_archive_cmds
5180 # the command line is too long to link in one step, link in parts
5181 $echo "using piecewise archive linking..."
5186 save_oldobjs=$oldobjs
5188 # Is there a better way of finding the last object in the list?
5189 for obj in $save_oldobjs
5193 for obj in $save_oldobjs
5195 oldobjs="$objlist $obj"
5196 objlist="$objlist $obj"
5197 eval test_cmds=\"$old_archive_cmds\"
5198 if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5199 test "$len" -le "$max_cmd_len"; then
5202 # the above command should be used before it gets too long
5204 if test "$obj" = "$last_oldobj" ; then
5207 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5208 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5214 if test "X$oldobjs" = "X" ; then
5215 eval cmds=\"\$concat_cmds\"
5217 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5221 save_ifs="$IFS"; IFS='~'
5222 for cmd in $cmds; do
5226 $run eval "$cmd" || exit $?
5231 if test -n "$generated"; then
5232 $show "${rm}r$generated"
5233 $run ${rm}r$generated
5236 # Now create the libtool archive.
5240 test "$build_old_libs" = yes && old_library="$libname.$libext"
5241 $show "creating $output"
5243 # Preserve any variables that may affect compiler behavior
5244 for var in $variables_saved_for_relink; do
5245 if eval test -z \"\${$var+set}\"; then
5246 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5247 elif eval var_value=\$$var; test -z "$var_value"; then
5248 relink_command="$var=; export $var; $relink_command"
5250 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5251 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5254 # Quote the link command for shipping.
5255 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5256 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5257 if test "$hardcode_automatic" = yes ; then
5262 # Only create the output if not a dry run.
5263 if test -z "$run"; then
5264 for installed in no yes; do
5265 if test "$installed" = yes; then
5266 if test -z "$install_libdir"; then
5269 output="$output_objdir/$outputname"i
5270 # Replace all uninstalled libtool libraries with the installed ones
5272 for deplib in $dependency_libs; do
5275 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5276 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5277 if test -z "$libdir"; then
5278 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5281 newdependency_libs="$newdependency_libs $libdir/$name"
5283 *) newdependency_libs="$newdependency_libs $deplib" ;;
5286 dependency_libs="$newdependency_libs"
5288 for lib in $dlfiles; do
5289 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5290 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5291 if test -z "$libdir"; then
5292 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5295 newdlfiles="$newdlfiles $libdir/$name"
5297 dlfiles="$newdlfiles"
5299 for lib in $dlprefiles; do
5300 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5301 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5302 if test -z "$libdir"; then
5303 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5306 newdlprefiles="$newdlprefiles $libdir/$name"
5308 dlprefiles="$newdlprefiles"
5311 for lib in $dlfiles; do
5313 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5314 *) abs=`pwd`"/$lib" ;;
5316 newdlfiles="$newdlfiles $abs"
5318 dlfiles="$newdlfiles"
5320 for lib in $dlprefiles; do
5322 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5323 *) abs=`pwd`"/$lib" ;;
5325 newdlprefiles="$newdlprefiles $abs"
5327 dlprefiles="$newdlprefiles"
5330 # place dlname in correct position for cygwin
5332 case $host,$output,$installed,$module,$dlname in
5333 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5336 # $outputname - a libtool library file
5337 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5339 # Please DO NOT delete this file!
5340 # It is necessary for linking the library.
5342 # The name that we can dlopen(3).
5345 # Names of this library.
5346 library_names='$library_names'
5348 # The name of the static archive.
5349 old_library='$old_library'
5351 # Libraries that this one depends upon.
5352 dependency_libs='$dependency_libs'
5354 # Version information for $libname.
5359 # Is this an already installed library?
5360 installed=$installed
5362 # Should we warn about portability when linking against -modules?
5363 shouldnotlink=$module
5365 # Files to dlopen/dlpreopen
5367 dlpreopen='$dlprefiles'
5369 # Directory that this library needs to be installed in:
5370 libdir='$install_libdir'"
5371 if test "$installed" = no && test "$need_relink" = yes; then
5373 relink_command=\"$relink_command\""
5378 # Do a symbolic link so that the libtool archive can be found in
5379 # LD_LIBRARY_PATH before the program is installed.
5380 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5381 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5387 # libtool install mode
5389 modename="$modename: install"
5391 # There may be an optional sh(1) argument at the beginning of
5392 # install_prog (especially on Windows NT).
5393 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5394 # Allow the use of GNU shtool's install command.
5395 $echo "X$nonopt" | grep shtool > /dev/null; then
5396 # Aesthetically quote it.
5397 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5399 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5403 install_prog="$arg "
5411 # The real first argument should be the name of the installation program.
5412 # Aesthetically quote it.
5413 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5415 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5419 install_prog="$install_prog$arg"
5421 # We need to accept at least all the BSD install flags.
5431 if test -n "$dest"; then
5432 files="$files $dest"
5440 case " $install_prog " in
5445 -g | -m | -o) prev=$arg ;;
5453 # If the previous option needed an argument, then skip it.
5454 if test -n "$prev"; then
5463 # Aesthetically quote the argument.
5464 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5466 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5470 install_prog="$install_prog $arg"
5473 if test -z "$install_prog"; then
5474 $echo "$modename: you must specify an install program" 1>&2
5479 if test -n "$prev"; then
5480 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5485 if test -z "$files"; then
5486 if test -z "$dest"; then
5487 $echo "$modename: no file or destination specified" 1>&2
5489 $echo "$modename: you must specify a destination" 1>&2
5495 # Strip any trailing slash from the destination.
5496 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5498 # Check to see that the destination is a directory.
5499 test -d "$dest" && isdir=yes
5500 if test "$isdir" = yes; then
5504 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5505 test "X$destdir" = "X$dest" && destdir=.
5506 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5508 # Not a directory, so check to see that there is only one file specified.
5510 if test "$#" -gt 2; then
5511 $echo "$modename: \`$dest' is not a directory" 1>&2
5517 [\\/]* | [A-Za-z]:[\\/]*) ;;
5519 for file in $files; do
5523 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5532 # This variable tells wrapper scripts just to set variables rather
5533 # than running their programs.
5534 libtool_install_magic="$magic"
5539 for file in $files; do
5541 # Do each installation.
5544 # Do the static libraries later.
5545 staticlibs="$staticlibs $file"
5549 # Check to see that this really is a libtool archive.
5550 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
5552 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5560 # If there is no directory component, then add one.
5562 */* | *\\*) . $file ;;
5566 # Add the libdir to current_libdirs if it is the destination.
5567 if test "X$destdir" = "X$libdir"; then
5568 case "$current_libdirs " in
5570 *) current_libdirs="$current_libdirs $libdir" ;;
5573 # Note the libdir as a future libdir.
5574 case "$future_libdirs " in
5576 *) future_libdirs="$future_libdirs $libdir" ;;
5580 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5581 test "X$dir" = "X$file/" && dir=
5584 if test -n "$relink_command"; then
5585 # Determine the prefix the user has applied to our future dir.
5586 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5588 # Don't allow the user to place us outside of our expected
5589 # location b/c this prevents finding dependent libraries that
5590 # are installed to the same prefix.
5591 # At present, this check doesn't affect windows .dll's that
5592 # are installed into $libdir/../bin (currently, that works fine)
5593 # but it's something to keep an eye on.
5594 if test "$inst_prefix_dir" = "$destdir"; then
5595 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5599 if test -n "$inst_prefix_dir"; then
5600 # Stick the inst_prefix_dir data into the link command.
5601 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5603 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5606 $echo "$modename: warning: relinking \`$file'" 1>&2
5607 $show "$relink_command"
5608 if $run eval "$relink_command"; then :
5610 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5615 # See the names of the shared library.
5616 set dummy $library_names
5617 if test -n "$2"; then
5623 test -n "$relink_command" && srcname="$realname"T
5625 # Install the shared library and build the symlinks.
5626 $show "$install_prog $dir/$srcname $destdir/$realname"
5627 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
5628 if test -n "$stripme" && test -n "$striplib"; then
5629 $show "$striplib $destdir/$realname"
5630 $run eval "$striplib $destdir/$realname" || exit $?
5633 if test "$#" -gt 0; then
5634 # Delete the old symlinks, and create new ones.
5635 # Try `ln -sf' first, because the `ln' binary might depend on
5636 # the symlink we replace! Solaris /bin/ln does not understand -f,
5637 # so we also need to try rm && ln -s.
5640 if test "$linkname" != "$realname"; then
5641 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5642 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5647 # Do each command in the postinstall commands.
5648 lib="$destdir/$realname"
5649 cmds=$postinstall_cmds
5650 save_ifs="$IFS"; IFS='~'
5651 for cmd in $cmds; do
5655 $run eval "$cmd" || {
5658 # Restore the uninstalled library and exit
5659 if test "$mode" = relink; then
5660 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
5669 # Install the pseudo-library for information purposes.
5670 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5671 instname="$dir/$name"i
5672 $show "$install_prog $instname $destdir/$name"
5673 $run eval "$install_prog $instname $destdir/$name" || exit $?
5675 # Maybe install the static library, too.
5676 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
5680 # Install (i.e. copy) a libtool object.
5682 # Figure out destination file name, if it wasn't already specified.
5683 if test -n "$destname"; then
5684 destfile="$destdir/$destname"
5686 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5687 destfile="$destdir/$destfile"
5690 # Deduce the name of the destination old-style object file.
5693 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5696 staticdest="$destfile"
5700 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5706 # Install the libtool object if requested.
5707 if test -n "$destfile"; then
5708 $show "$install_prog $file $destfile"
5709 $run eval "$install_prog $file $destfile" || exit $?
5712 # Install the old object if enabled.
5713 if test "$build_old_libs" = yes; then
5714 # Deduce the name of the old-style object file.
5715 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
5717 $show "$install_prog $staticobj $staticdest"
5718 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
5724 # Figure out destination file name, if it wasn't already specified.
5725 if test -n "$destname"; then
5726 destfile="$destdir/$destname"
5728 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5729 destfile="$destdir/$destfile"
5732 # If the file is missing, and there is a .exe on the end, strip it
5733 # because it is most likely a libtool script we actually want to
5738 if test ! -f "$file"; then
5739 file=`$echo $file|${SED} 's,.exe$,,'`
5745 # Do a test to see if this is really a libtool program.
5748 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
5754 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
5758 # Note that it is not necessary on cygwin/mingw to append a dot to
5759 # foo even if both foo and FILE.exe exist: automatic-append-.exe
5760 # behavior happens only for exec(3), not for open(2)! Also, sourcing
5761 # `FILE.' does not work on cygwin managed mounts.
5763 # If there is no directory component, then add one.
5765 */* | *\\*) . ${wrapper} ;;
5766 *) . ./${wrapper} ;;
5769 # Check the variables that should have been set.
5770 if test -z "$notinst_deplibs"; then
5771 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5776 for lib in $notinst_deplibs; do
5777 # Check to see that each library is installed.
5779 if test -f "$lib"; then
5780 # If there is no directory component, then add one.
5782 */* | *\\*) . $lib ;;
5786 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5787 if test -n "$libdir" && test ! -f "$libfile"; then
5788 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5794 # Note that it is not necessary on cygwin/mingw to append a dot to
5795 # foo even if both foo and FILE.exe exist: automatic-append-.exe
5796 # behavior happens only for exec(3), not for open(2)! Also, sourcing
5797 # `FILE.' does not work on cygwin managed mounts.
5799 # If there is no directory component, then add one.
5801 */* | *\\*) . ${wrapper} ;;
5802 *) . ./${wrapper} ;;
5806 if test "$fast_install" = no && test -n "$relink_command"; then
5807 if test "$finalize" = yes && test -z "$run"; then
5809 test -n "$TMPDIR" && tmpdir="$TMPDIR"
5810 tmpdir="$tmpdir/libtool-$$"
5813 if $mkdir "$tmpdir"; then
5817 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5820 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5821 outputname="$tmpdir/$file"
5822 # Replace the output file specification.
5823 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5825 $show "$relink_command"
5826 if $run eval "$relink_command"; then :
5828 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5834 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5837 # Install the binary that we compiled earlier.
5838 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5842 # remove .exe since cygwin /usr/bin/install will append another
5844 case $install_prog,$host in
5845 */usr/bin/install*,*cygwin*)
5846 case $file:$destfile in
5851 destfile=$destfile.exe
5854 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5859 $show "$install_prog$stripme $file $destfile"
5860 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
5861 test -n "$outputname" && ${rm}r "$tmpdir"
5866 for file in $staticlibs; do
5867 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5869 # Set up the ranlib parameters.
5870 oldlib="$destdir/$name"
5872 $show "$install_prog $file $oldlib"
5873 $run eval "$install_prog \$file \$oldlib" || exit $?
5875 if test -n "$stripme" && test -n "$old_striplib"; then
5876 $show "$old_striplib $oldlib"
5877 $run eval "$old_striplib $oldlib" || exit $?
5880 # Do each command in the postinstall commands.
5881 cmds=$old_postinstall_cmds
5882 save_ifs="$IFS"; IFS='~'
5883 for cmd in $cmds; do
5887 $run eval "$cmd" || exit $?
5892 if test -n "$future_libdirs"; then
5893 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5896 if test -n "$current_libdirs"; then
5897 # Maybe just do a dry run.
5898 test -n "$run" && current_libdirs=" -n$current_libdirs"
5899 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
5905 # libtool finish mode
5907 modename="$modename: finish"
5911 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5914 libdirs="$libdirs $dir"
5917 for libdir in $libdirs; do
5918 if test -n "$finish_cmds"; then
5919 # Do each command in the finish commands.
5921 save_ifs="$IFS"; IFS='~'
5922 for cmd in $cmds; do
5926 $run eval "$cmd" || admincmds="$admincmds
5931 if test -n "$finish_eval"; then
5932 # Do the single finish_eval.
5933 eval cmds=\"$finish_eval\"
5934 $run eval "$cmds" || admincmds="$admincmds
5940 # Exit here if they wanted silent mode.
5941 test "$show" = : && exit $EXIT_SUCCESS
5943 $echo "----------------------------------------------------------------------"
5944 $echo "Libraries have been installed in:"
5945 for libdir in $libdirs; do
5949 $echo "If you ever happen to want to link against installed libraries"
5950 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5951 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5952 $echo "flag during linking and do at least one of the following:"
5953 if test -n "$shlibpath_var"; then
5954 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5955 $echo " during execution"
5957 if test -n "$runpath_var"; then
5958 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5959 $echo " during linking"
5961 if test -n "$hardcode_libdir_flag_spec"; then
5963 eval flag=\"$hardcode_libdir_flag_spec\"
5965 $echo " - use the \`$flag' linker flag"
5967 if test -n "$admincmds"; then
5968 $echo " - have your system administrator run these commands:$admincmds"
5970 if test -f /etc/ld.so.conf; then
5971 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5974 $echo "See any operating system documentation about shared libraries for"
5975 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5976 $echo "----------------------------------------------------------------------"
5980 # libtool execute mode
5982 modename="$modename: execute"
5984 # The first argument is the command name.
5986 if test -z "$cmd"; then
5987 $echo "$modename: you must specify a COMMAND" 1>&2
5992 # Handle -dlopen flags immediately.
5993 for file in $execute_dlfiles; do
5994 if test ! -f "$file"; then
5995 $echo "$modename: \`$file' is not a file" 1>&2
6003 # Check to see that this really is a libtool archive.
6004 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6006 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6011 # Read the libtool library.
6015 # If there is no directory component, then add one.
6017 */* | *\\*) . $file ;;
6021 # Skip this library if it cannot be dlopened.
6022 if test -z "$dlname"; then
6023 # Warn if it was a shared library.
6024 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6028 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6029 test "X$dir" = "X$file" && dir=.
6031 if test -f "$dir/$objdir/$dlname"; then
6034 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6040 # Just add the directory containing the .lo file.
6041 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6042 test "X$dir" = "X$file" && dir=.
6046 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6051 # Get the absolute pathname.
6052 absdir=`cd "$dir" && pwd`
6053 test -n "$absdir" && dir="$absdir"
6055 # Now add the directory to shlibpath_var.
6056 if eval "test -z \"\$$shlibpath_var\""; then
6057 eval "$shlibpath_var=\"\$dir\""
6059 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6063 # This variable tells wrapper scripts just to set shlibpath_var
6064 # rather than running their programs.
6065 libtool_execute_magic="$magic"
6067 # Check if any of the arguments is a wrapper script.
6074 # Do a test to see if this is really a libtool program.
6075 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6076 # If there is no directory component, then add one.
6078 */* | *\\*) . $file ;;
6082 # Transform arg to wrapped name.
6083 file="$progdir/$program"
6087 # Quote arguments (to preserve shell metacharacters).
6088 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6089 args="$args \"$file\""
6092 if test -z "$run"; then
6093 if test -n "$shlibpath_var"; then
6094 # Export the shlibpath_var.
6095 eval "export $shlibpath_var"
6098 # Restore saved environment variables
6099 if test "${save_LC_ALL+set}" = set; then
6100 LC_ALL="$save_LC_ALL"; export LC_ALL
6102 if test "${save_LANG+set}" = set; then
6103 LANG="$save_LANG"; export LANG
6106 # Now prepare to actually exec the command.
6107 exec_cmd="\$cmd$args"
6109 # Display what would be done.
6110 if test -n "$shlibpath_var"; then
6111 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6112 $echo "export $shlibpath_var"
6119 # libtool clean and uninstall mode
6121 modename="$modename: $mode"
6127 # This variable tells wrapper scripts just to set variables rather
6128 # than running their programs.
6129 libtool_install_magic="$magic"
6134 -f) rm="$rm $arg"; rmforce=yes ;;
6135 -*) rm="$rm $arg" ;;
6136 *) files="$files $arg" ;;
6140 if test -z "$rm"; then
6141 $echo "$modename: you must specify an RM program" 1>&2
6148 origobjdir="$objdir"
6149 for file in $files; do
6150 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6151 if test "X$dir" = "X$file"; then
6153 objdir="$origobjdir"
6155 objdir="$dir/$origobjdir"
6157 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6158 test "$mode" = uninstall && objdir="$dir"
6160 # Remember objdir for removal later, being careful to avoid duplicates
6161 if test "$mode" = clean; then
6164 *) rmdirs="$rmdirs $objdir" ;;
6168 # Don't error if the file doesn't exist and rm -f was used.
6169 if (test -L "$file") >/dev/null 2>&1 \
6170 || (test -h "$file") >/dev/null 2>&1 \
6171 || test -f "$file"; then
6173 elif test -d "$file"; then
6176 elif test "$rmforce" = yes; then
6184 # Possibly a libtool archive, so verify it.
6185 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6188 # Delete the libtool libraries and symlinks.
6189 for n in $library_names; do
6190 rmfiles="$rmfiles $objdir/$n"
6192 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6193 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6195 if test "$mode" = uninstall; then
6196 if test -n "$library_names"; then
6197 # Do each command in the postuninstall commands.
6198 cmds=$postuninstall_cmds
6199 save_ifs="$IFS"; IFS='~'
6200 for cmd in $cmds; do
6205 if test "$?" -ne 0 && test "$rmforce" != yes; then
6212 if test -n "$old_library"; then
6213 # Do each command in the old_postuninstall commands.
6214 cmds=$old_postuninstall_cmds
6215 save_ifs="$IFS"; IFS='~'
6216 for cmd in $cmds; do
6221 if test "$?" -ne 0 && test "$rmforce" != yes; then
6227 # FIXME: should reinstall the best remaining shared library.
6233 # Possibly a libtool object, so verify it.
6234 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6239 # Add PIC object to the list of files to remove.
6240 if test -n "$pic_object" \
6241 && test "$pic_object" != none; then
6242 rmfiles="$rmfiles $dir/$pic_object"
6245 # Add non-PIC object to the list of files to remove.
6246 if test -n "$non_pic_object" \
6247 && test "$non_pic_object" != none; then
6248 rmfiles="$rmfiles $dir/$non_pic_object"
6254 if test "$mode" = clean ; then
6258 file=`$echo $file|${SED} 's,.exe$,,'`
6259 noexename=`$echo $name|${SED} 's,.exe$,,'`
6260 # $file with .exe has already been added to rmfiles,
6261 # add $file without .exe
6262 rmfiles="$rmfiles $file"
6265 # Do a test to see if this is a libtool program.
6266 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
6270 # note $name still contains .exe if it was in $file originally
6271 # as does the version of $file that was added into $rmfiles
6272 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6273 if test "$fast_install" = yes && test -n "$relink_command"; then
6274 rmfiles="$rmfiles $objdir/lt-$name"
6276 if test "X$noexename" != "X$name" ; then
6277 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
6283 $show "$rm $rmfiles"
6284 $run $rm $rmfiles || exit_status=1
6286 objdir="$origobjdir"
6288 # Try to remove the ${objdir}s in the directories where we deleted files
6289 for dir in $rmdirs; do
6290 if test -d "$dir"; then
6292 $run rmdir $dir >/dev/null 2>&1
6300 $echo "$modename: you must specify a MODE" 1>&2
6301 $echo "$generic_help" 1>&2
6306 if test -z "$exec_cmd"; then
6307 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6308 $echo "$generic_help" 1>&2
6311 fi # test -z "$show_help"
6313 if test -n "$exec_cmd"; then
6318 # We need to display help for each of the modes.
6321 "Usage: $modename [OPTION]... [MODE-ARG]...
6323 Provide generalized library-building support services.
6325 --config show all configuration variables
6326 --debug enable verbose shell tracing
6327 -n, --dry-run display commands without modifying any files
6328 --features display basic configuration information and exit
6329 --finish same as \`--mode=finish'
6330 --help display this help message and exit
6331 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6332 --quiet same as \`--silent'
6333 --silent don't print informational messages
6334 --tag=TAG use configuration variables from tag TAG
6335 --version print version information
6337 MODE must be one of the following:
6339 clean remove files from the build directory
6340 compile compile a source file into a libtool object
6341 execute automatically set library path, then run a program
6342 finish complete the installation of libtool libraries
6343 install install libraries or executables
6344 link create a library or an executable
6345 uninstall remove libraries from an installed directory
6347 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6348 a more detailed description of MODE.
6350 Report bugs to <bug-libtool@gnu.org>."
6356 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6358 Remove files from the build directory.
6360 RM is the name of the program to use to delete files associated with each FILE
6361 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6364 If FILE is a libtool library, object or program, all the files associated
6365 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6370 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6372 Compile a source file into a libtool library object.
6374 This mode accepts the following additional options:
6376 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6377 -prefer-pic try to building PIC objects only
6378 -prefer-non-pic try to building non-PIC objects only
6379 -static always build a \`.o' file suitable for static linking
6381 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6382 from the given SOURCEFILE.
6384 The output file name is determined by removing the directory component from
6385 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6386 library object suffix, \`.lo'."
6391 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6393 Automatically set library path, then run a program.
6395 This mode accepts the following additional options:
6397 -dlopen FILE add the directory containing FILE to the library path
6399 This mode sets the library path environment variable according to \`-dlopen'
6402 If any of the ARGS are libtool executable wrappers, then they are translated
6403 into their corresponding uninstalled binary, and any of their required library
6404 directories are added to the library path.
6406 Then, COMMAND is executed, with ARGS as arguments."
6411 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6413 Complete the installation of libtool libraries.
6415 Each LIBDIR is a directory that contains libtool libraries.
6417 The commands that this mode executes may require superuser privileges. Use
6418 the \`--dry-run' option if you just want to see what would be executed."
6423 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6425 Install executables or libraries.
6427 INSTALL-COMMAND is the installation command. The first component should be
6428 either the \`install' or \`cp' program.
6430 The rest of the components are interpreted as arguments to that command (only
6431 BSD-compatible install options are recognized)."
6436 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6438 Link object files or libraries together to form another library, or to
6439 create an executable program.
6441 LINK-COMMAND is a command using the C compiler that you would use to create
6442 a program from several object files.
6444 The following components of LINK-COMMAND are treated specially:
6446 -all-static do not do any dynamic linking at all
6447 -avoid-version do not add a version suffix if possible
6448 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6449 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6450 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6451 -export-symbols SYMFILE
6452 try to export only the symbols listed in SYMFILE
6453 -export-symbols-regex REGEX
6454 try to export only the symbols matching REGEX
6455 -LLIBDIR search LIBDIR for required installed libraries
6456 -lNAME OUTPUT-FILE requires the installed library libNAME
6457 -module build a library that can dlopened
6458 -no-fast-install disable the fast-install mode
6459 -no-install link a not-installable executable
6460 -no-undefined declare that a library does not refer to external symbols
6461 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6462 -objectlist FILE Use a list of object files found in FILE to specify objects
6463 -precious-files-regex REGEX
6464 don't remove output files matching REGEX
6465 -release RELEASE specify package release information
6466 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6467 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6468 -static do not do any dynamic linking of libtool libraries
6469 -version-info CURRENT[:REVISION[:AGE]]
6470 specify library version info [each variable defaults to 0]
6472 All other options (arguments beginning with \`-') are ignored.
6474 Every other argument is treated as a filename. Files ending in \`.la' are
6475 treated as uninstalled libtool libraries, other files are standard or library
6478 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6479 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6480 required, except when creating a convenience library.
6482 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6483 using \`ar' and \`ranlib', or on Windows using \`lib'.
6485 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6486 is created, otherwise an executable program is created."
6491 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6493 Remove libraries from an installation directory.
6495 RM is the name of the program to use to delete files associated with each FILE
6496 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6499 If FILE is a libtool library, all the files associated with it are deleted.
6500 Otherwise, only FILE itself is deleted using RM."
6504 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6511 $echo "Try \`$modename --help' for more information about other modes."
6515 # The TAGs below are defined such that we never get into a situation
6516 # in which we disable both kinds of libraries. Given conflicting
6517 # choices, we go for a static library, that is the most portable,
6518 # since we can't tell whether shared libraries were disabled because
6519 # the user asked for that or because the platform doesn't support
6520 # them. This is particularly important on AIX, because we don't
6521 # support having both static and shared libraries enabled at the same
6522 # time on that platform, so we default to a shared-only configuration.
6523 # If a disable-shared tag is given, we'll fallback to a static-only
6524 # configuration. But we'll never go from static-only to shared-only.
6526 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6527 build_libtool_libs=no
6529 # ### END LIBTOOL TAG CONFIG: disable-shared
6531 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6532 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6533 # ### END LIBTOOL TAG CONFIG: disable-static