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`
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" ;;
1996 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
1999 if test "$pass" = dlopen
; then
2000 # Collect dlpreopened libraries
2001 save_deplibs
="$deplibs"
2004 for deplib
in $libs; do
2008 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe)
2009 if test "$linkmode,$pass" = "prog,link"; then
2010 compile_deplibs
="$deplib $compile_deplibs"
2011 finalize_deplibs
="$deplib $finalize_deplibs"
2013 compiler_flags
="$compiler_flags $deplib"
2018 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
2019 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2022 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2023 for searchdir
in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2024 for search_ext
in .la
$std_shrext .so .a
; do
2025 # Search the libtool library
2026 lib
="$searchdir/lib${name}${search_ext}"
2027 if test -f "$lib"; then
2028 if test "$search_ext" = ".la"; then
2037 if test "$found" != yes; then
2038 # deplib doesn't seem to be a libtool library
2039 if test "$linkmode,$pass" = "prog,link"; then
2040 compile_deplibs
="$deplib $compile_deplibs"
2041 finalize_deplibs
="$deplib $finalize_deplibs"
2043 deplibs
="$deplib $deplibs"
2044 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2047 else # deplib is a libtool library
2048 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2049 # We need to do some special things here, and not later.
2050 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2051 case " $predeps $postdeps " in
2053 if (${SED} -e '2q' $lib |
2054 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2058 */* |
*\\*) .
$lib ;;
2061 for l
in $old_library $library_names; do
2064 if test "X$ll" = "X$old_library" ; then # only static version available
2066 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2067 test "X$ladir" = "X$lib" && ladir
="."
2068 lib
=$ladir/$old_library
2069 if test "$linkmode,$pass" = "prog,link"; then
2070 compile_deplibs
="$deplib $compile_deplibs"
2071 finalize_deplibs
="$deplib $finalize_deplibs"
2073 deplibs
="$deplib $deplibs"
2074 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2088 deplibs
="$deplib $deplibs"
2089 test "$pass" = conv
&& continue
2090 newdependency_libs
="$deplib $newdependency_libs"
2091 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2094 if test "$pass" = conv
; then
2095 deplibs
="$deplib $deplibs"
2098 if test "$pass" = scan
; then
2099 deplibs
="$deplib $deplibs"
2101 compile_deplibs
="$deplib $compile_deplibs"
2102 finalize_deplibs
="$deplib $finalize_deplibs"
2104 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2107 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2113 if test "$pass" = link
; then
2114 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2115 # Make sure the xrpath contains only unique directories.
2118 *) xrpath
="$xrpath $dir" ;;
2121 deplibs
="$deplib $deplibs"
2124 *.la
) lib
="$deplib" ;;
2126 if test "$pass" = conv
; then
2127 deplibs
="$deplib $deplibs"
2133 case $deplibs_check_method in
2135 set dummy
$deplibs_check_method
2136 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2137 if eval $echo \"$deplib\" 2>/dev
/null \
2139 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
2147 if test "$valid_a_lib" != yes; then
2149 $echo "*** Warning: Trying to link with static lib archive $deplib."
2150 $echo "*** I have the capability to make that library automatically link in when"
2151 $echo "*** you link to this library. But I can only do this if you have a"
2152 $echo "*** shared version of the library, which you do not appear to have"
2153 $echo "*** because the file extensions .$libext of this argument makes me believe"
2154 $echo "*** that it is just a static archive that I should not used here."
2157 $echo "*** Warning: Linking the shared library $output against the"
2158 $echo "*** static library $deplib is not portable!"
2159 deplibs
="$deplib $deplibs"
2164 if test "$pass" != link
; then
2165 deplibs
="$deplib $deplibs"
2167 compile_deplibs
="$deplib $compile_deplibs"
2168 finalize_deplibs
="$deplib $finalize_deplibs"
2175 if test "$pass" = conv
; then
2176 deplibs
="$deplib $deplibs"
2177 elif test "$linkmode" = prog
; then
2178 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2179 # If there is no dlopen support or we're linking statically,
2180 # we need to preload.
2181 newdlprefiles
="$newdlprefiles $deplib"
2182 compile_deplibs
="$deplib $compile_deplibs"
2183 finalize_deplibs
="$deplib $finalize_deplibs"
2185 newdlfiles
="$newdlfiles $deplib"
2195 if test "$found" = yes ||
test -f "$lib"; then :
2197 $echo "$modename: cannot find the library \`$lib'" 1>&2
2201 # Check to see that this really is a libtool archive.
2202 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2204 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2208 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2209 test "X$ladir" = "X$lib" && ladir
="."
2217 # If the library was installed with an old release of libtool,
2218 # it will not redefine variables installed, or shouldnotlink
2226 */* |
*\\*) .
$lib ;;
2230 if test "$linkmode,$pass" = "lib,link" ||
2231 test "$linkmode,$pass" = "prog,scan" ||
2232 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2233 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2234 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2237 if test "$pass" = conv
; then
2238 # Only check for convenience libraries
2239 deplibs
="$lib $deplibs"
2240 if test -z "$libdir"; then
2241 if test -z "$old_library"; then
2242 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2245 # It is a libtool convenience library, so add in its objects.
2246 convenience
="$convenience $ladir/$objdir/$old_library"
2247 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2249 for deplib
in $dependency_libs; do
2250 deplibs
="$deplib $deplibs"
2251 if test "X$duplicate_deps" = "Xyes" ; then
2252 case "$tmp_libs " in
2253 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2256 tmp_libs
="$tmp_libs $deplib"
2258 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2259 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2266 # Get the name of the library we link against.
2268 for l
in $old_library $library_names; do
2271 if test -z "$linklib"; then
2272 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2276 # This library was specified with -dlopen.
2277 if test "$pass" = dlopen
; then
2278 if test -z "$libdir"; then
2279 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2282 if test -z "$dlname" ||
2283 test "$dlopen_support" != yes ||
2284 test "$build_libtool_libs" = no
; then
2285 # If there is no dlname, no dlopen support or we're linking
2286 # statically, we need to preload. We also need to preload any
2287 # dependent libraries so libltdl's deplib preloader doesn't
2288 # bomb out in the load deplibs phase.
2289 dlprefiles
="$dlprefiles $lib $dependency_libs"
2291 newdlfiles
="$newdlfiles $lib"
2296 # We need an absolute path.
2298 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2300 abs_ladir
=`cd "$ladir" && pwd`
2301 if test -z "$abs_ladir"; then
2302 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2303 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2308 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2310 # Find the relevant object directory and library name.
2311 if test "X$installed" = Xyes
; then
2312 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2313 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2321 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
2323 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2326 # Remove this search path later
2327 notinst_path
="$notinst_path $abs_ladir"
2329 dir
="$ladir/$objdir"
2330 absdir
="$abs_ladir/$objdir"
2331 # Remove this search path later
2332 notinst_path
="$notinst_path $abs_ladir"
2334 fi # $installed = yes
2335 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2337 # This library was specified with -dlpreopen.
2338 if test "$pass" = dlpreopen
; then
2339 if test -z "$libdir"; then
2340 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2343 # Prefer using a static library (so that no silly _DYNAMIC symbols
2344 # are required to link).
2345 if test -n "$old_library"; then
2346 newdlprefiles
="$newdlprefiles $dir/$old_library"
2347 # Otherwise, use the dlname, so that lt_dlopen finds it.
2348 elif test -n "$dlname"; then
2349 newdlprefiles
="$newdlprefiles $dir/$dlname"
2351 newdlprefiles
="$newdlprefiles $dir/$linklib"
2353 fi # $pass = dlpreopen
2355 if test -z "$libdir"; then
2356 # Link the convenience library
2357 if test "$linkmode" = lib
; then
2358 deplibs
="$dir/$old_library $deplibs"
2359 elif test "$linkmode,$pass" = "prog,link"; then
2360 compile_deplibs
="$dir/$old_library $compile_deplibs"
2361 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2363 deplibs
="$lib $deplibs" # used for prog,scan pass
2369 if test "$linkmode" = prog
&& test "$pass" != link
; then
2370 newlib_search_path
="$newlib_search_path $ladir"
2371 deplibs
="$lib $deplibs"
2374 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2375 test "$build_libtool_libs" = no
; then
2380 for deplib
in $dependency_libs; do
2382 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2384 # Need to link against all dependency_libs?
2385 if test "$linkalldeplibs" = yes; then
2386 deplibs
="$deplib $deplibs"
2388 # Need to hardcode shared library paths
2389 # or/and link against static libraries
2390 newdependency_libs
="$deplib $newdependency_libs"
2392 if test "X$duplicate_deps" = "Xyes" ; then
2393 case "$tmp_libs " in
2394 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2397 tmp_libs
="$tmp_libs $deplib"
2400 fi # $linkmode = prog...
2402 if test "$linkmode,$pass" = "prog,link"; then
2403 if test -n "$library_names" &&
2404 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2405 # We need to hardcode the library path
2406 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2407 # Make sure the rpath contains only unique directories.
2408 case "$temp_rpath " in
2411 *) temp_rpath
="$temp_rpath $absdir" ;;
2415 # Hardcode the library path.
2416 # Skip directories that are in the system default run-time
2418 case " $sys_lib_dlsearch_path " in
2421 case "$compile_rpath " in
2423 *) compile_rpath
="$compile_rpath $absdir"
2427 case " $sys_lib_dlsearch_path " in
2430 case "$finalize_rpath " in
2432 *) finalize_rpath
="$finalize_rpath $libdir"
2436 fi # $linkmode,$pass = prog,link...
2438 if test "$alldeplibs" = yes &&
2439 { test "$deplibs_check_method" = pass_all ||
2440 { test "$build_libtool_libs" = yes &&
2441 test -n "$library_names"; }; }; then
2442 # We only need to search for static libraries
2447 link_static
=no
# Whether the deplib will be linked statically
2448 if test -n "$library_names" &&
2449 { test "$prefer_static_libs" = no ||
test -z "$old_library"; }; then
2450 if test "$installed" = no
; then
2451 notinst_deplibs
="$notinst_deplibs $lib"
2454 # This is a shared library
2456 # Warn about portability, can't link against -module's on
2457 # some systems (darwin)
2458 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2460 if test "$linkmode" = prog
; then
2461 $echo "*** Warning: Linking the executable $output against the loadable module"
2463 $echo "*** Warning: Linking the shared library $output against the loadable module"
2465 $echo "*** $linklib is not portable!"
2467 if test "$linkmode" = lib
&&
2468 test "$hardcode_into_libs" = yes; then
2469 # Hardcode the library path.
2470 # Skip directories that are in the system default run-time
2472 case " $sys_lib_dlsearch_path " in
2475 case "$compile_rpath " in
2477 *) compile_rpath
="$compile_rpath $absdir"
2481 case " $sys_lib_dlsearch_path " in
2484 case "$finalize_rpath " in
2486 *) finalize_rpath
="$finalize_rpath $libdir"
2492 if test -n "$old_archive_from_expsyms_cmds"; then
2493 # figure out the soname
2494 set dummy
$library_names
2497 libname
=`eval \\$echo \"$libname_spec\"`
2498 # use dlname if we got it. it's perfectly good, no?
2499 if test -n "$dlname"; then
2501 elif test -n "$soname_spec"; then
2505 major
=`expr $current - $age`
2509 eval soname
=\"$soname_spec\"
2514 # Make a new name for the extract_expsyms_cmds to use
2516 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
2517 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2519 # If the library has no export list, then create one now
2520 if test -f "$output_objdir/$soname-def"; then :
2522 $show "extracting exported symbol list from \`$soname'"
2523 save_ifs
="$IFS"; IFS
='~'
2524 cmds
=$extract_expsyms_cmds
2525 for cmd
in $cmds; do
2529 $run eval "$cmd" ||
exit $?
2535 if test -f "$output_objdir/$newlib"; then :; else
2536 $show "generating import library for \`$soname'"
2537 save_ifs
="$IFS"; IFS
='~'
2538 cmds
=$old_archive_from_expsyms_cmds
2539 for cmd
in $cmds; do
2543 $run eval "$cmd" ||
exit $?
2547 # make sure the library variables are pointing to the new library
2550 fi # test -n "$old_archive_from_expsyms_cmds"
2552 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2557 case $hardcode_action in
2558 immediate | unsupported
)
2559 if test "$hardcode_direct" = no
; then
2562 *-*-sco3.2v5
* ) add_dir
="-L$dir" ;;
2564 # if the lib is a module then we can not link against
2565 # it, someone is ignoring the new warnings I added
2566 if /usr
/bin
/file -L $add 2> /dev
/null |
$EGREP "bundle" >/dev
/null
; then
2567 $echo "** Warning, lib $linklib is a module, not a shared library"
2568 if test -z "$old_library" ; then
2570 $echo "** And there doesn't seem to be a static archive available"
2571 $echo "** The link will probably fail, sorry"
2573 add
="$dir/$old_library"
2577 elif test "$hardcode_minus_L" = no
; then
2579 *-*-sunos*) add_shlibpath
="$dir" ;;
2583 elif test "$hardcode_shlibpath_var" = no
; then
2584 add_shlibpath
="$dir"
2591 if test "$hardcode_direct" = yes; then
2593 elif test "$hardcode_minus_L" = yes; then
2595 # Try looking first in the location we're being installed to.
2596 if test -n "$inst_prefix_dir"; then
2599 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2604 elif test "$hardcode_shlibpath_var" = yes; then
2605 add_shlibpath
="$dir"
2614 if test "$lib_linked" != yes; then
2615 $echo "$modename: configuration error: unsupported hardcode properties"
2619 if test -n "$add_shlibpath"; then
2620 case :$compile_shlibpath: in
2621 *":$add_shlibpath:"*) ;;
2622 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2625 if test "$linkmode" = prog
; then
2626 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2627 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2629 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2630 test -n "$add" && deplibs
="$add $deplibs"
2631 if test "$hardcode_direct" != yes && \
2632 test "$hardcode_minus_L" != yes && \
2633 test "$hardcode_shlibpath_var" = yes; then
2634 case :$finalize_shlibpath: in
2636 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2642 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2646 # Finalize command for both is simple: just hardcode it.
2647 if test "$hardcode_direct" = yes; then
2648 add
="$libdir/$linklib"
2649 elif test "$hardcode_minus_L" = yes; then
2652 elif test "$hardcode_shlibpath_var" = yes; then
2653 case :$finalize_shlibpath: in
2655 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2658 elif test "$hardcode_automatic" = yes; then
2659 if test -n "$inst_prefix_dir" &&
2660 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2661 add
="$inst_prefix_dir$libdir/$linklib"
2663 add
="$libdir/$linklib"
2666 # We cannot seem to hardcode it, guess we'll fake it.
2668 # Try looking first in the location we're being installed to.
2669 if test -n "$inst_prefix_dir"; then
2672 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2679 if test "$linkmode" = prog
; then
2680 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2681 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2683 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2684 test -n "$add" && deplibs
="$add $deplibs"
2687 elif test "$linkmode" = prog
; then
2688 # Here we assume that one of hardcode_direct or hardcode_minus_L
2689 # is not unsupported. This is valid on all known static and
2691 if test "$hardcode_direct" != unsupported
; then
2692 test -n "$old_library" && linklib
="$old_library"
2693 compile_deplibs
="$dir/$linklib $compile_deplibs"
2694 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2696 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2697 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2699 elif test "$build_libtool_libs" = yes; then
2700 # Not a shared library
2701 if test "$deplibs_check_method" != pass_all
; then
2702 # We're trying link a shared library against a static one
2703 # but the system doesn't support it.
2705 # Just print a warning and add the library to dependency_libs so
2706 # that the program can be linked against the static library.
2708 $echo "*** Warning: This system can not link to static lib archive $lib."
2709 $echo "*** I have the capability to make that library automatically link in when"
2710 $echo "*** you link to this library. But I can only do this if you have a"
2711 $echo "*** shared version of the library, which you do not appear to have."
2712 if test "$module" = yes; then
2713 $echo "*** But as you try to build a module library, libtool will still create "
2714 $echo "*** a static module, that should work as long as the dlopening application"
2715 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2716 if test -z "$global_symbol_pipe"; then
2718 $echo "*** However, this would only work if libtool was able to extract symbol"
2719 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2720 $echo "*** not find such a program. So, this module is probably useless."
2721 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2723 if test "$build_old_libs" = no
; then
2724 build_libtool_libs
=module
2727 build_libtool_libs
=no
2731 deplibs
="$dir/$old_library $deplibs"
2734 fi # link shared/static library?
2736 if test "$linkmode" = lib
; then
2737 if test -n "$dependency_libs" &&
2738 { test "$hardcode_into_libs" != yes ||
2739 test "$build_old_libs" = yes ||
2740 test "$link_static" = yes; }; then
2741 # Extract -R from dependency_libs
2743 for libdir
in $dependency_libs; do
2745 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2747 *" $temp_xrpath "*) ;;
2748 *) xrpath
="$xrpath $temp_xrpath";;
2750 *) temp_deplibs
="$temp_deplibs $libdir";;
2753 dependency_libs
="$temp_deplibs"
2756 newlib_search_path
="$newlib_search_path $absdir"
2757 # Link against this library
2758 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2759 # ... and its dependency_libs
2761 for deplib
in $dependency_libs; do
2762 newdependency_libs
="$deplib $newdependency_libs"
2763 if test "X$duplicate_deps" = "Xyes" ; then
2764 case "$tmp_libs " in
2765 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2768 tmp_libs
="$tmp_libs $deplib"
2771 if test "$link_all_deplibs" != no
; then
2772 # Add the search paths of all dependency libraries
2773 for deplib
in $dependency_libs; do
2775 -L*) path
="$deplib" ;;
2777 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2778 test "X$dir" = "X$deplib" && dir
="."
2779 # We need an absolute path.
2781 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
2783 absdir
=`cd "$dir" && pwd`
2784 if test -z "$absdir"; then
2785 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2790 if grep "^installed=no" $deplib > /dev
/null
; then
2791 path
="$absdir/$objdir"
2793 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2794 if test -z "$libdir"; then
2795 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2798 if test "$absdir" != "$libdir"; then
2799 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2806 # we do not want to link against static libs,
2807 # but need to link against shared
2808 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
2809 if test -n "$deplibrary_names" ; then
2810 for tmp
in $deplibrary_names ; do
2813 if test -f "$path/$depdepl" ; then
2814 depdepl
="$path/$depdepl"
2816 # do not add paths which are already there
2817 case " $newlib_search_path " in
2819 *) newlib_search_path
="$newlib_search_path $path";;
2832 # Again, we only want to link against shared libraries
2833 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
2834 for tmp
in $newlib_search_path ; do
2835 if test -f "$tmp/lib$tmp_libs.dylib" ; then
2836 eval depdepl
="$tmp/lib$tmp_libs.dylib"
2847 case " $deplibs " in
2849 *) deplibs
="$path $deplibs" ;;
2851 case " $deplibs " in
2853 *) deplibs
="$depdepl $deplibs" ;;
2856 fi # link_all_deplibs != no
2858 done # for deplib in $libs
2859 dependency_libs
="$newdependency_libs"
2860 if test "$pass" = dlpreopen
; then
2861 # Link the dlpreopened libraries before other libraries
2862 for deplib
in $save_deplibs; do
2863 deplibs
="$deplib $deplibs"
2866 if test "$pass" != dlopen
; then
2867 if test "$pass" != conv
; then
2868 # Make sure lib_search_path contains only unique directories.
2870 for dir
in $newlib_search_path; do
2871 case "$lib_search_path " in
2873 *) lib_search_path
="$lib_search_path $dir" ;;
2879 if test "$linkmode,$pass" != "prog,link"; then
2882 vars
="compile_deplibs finalize_deplibs"
2884 for var
in $vars dependency_libs
; do
2885 # Add libraries to $var in reverse order
2886 eval tmp_libs
=\"\$
$var\"
2888 for deplib
in $tmp_libs; do
2889 # FIXME: Pedantically, this is the right thing to do, so
2890 # that some nasty dependency loop isn't accidentally
2892 #new_libs="$deplib $new_libs"
2893 # Pragmatically, this seems to cause very few problems in
2896 -L*) new_libs
="$deplib $new_libs" ;;
2899 # And here is the reason: when a library appears more
2900 # than once as an explicit dependence of a library, or
2901 # is implicitly linked in more than once by the
2902 # compiler, it is considered special, and multiple
2903 # occurrences thereof are not removed. Compare this
2904 # with having the same library being listed as a
2905 # dependency of multiple other libraries: in this case,
2906 # we know (pedantically, we assume) the library does not
2907 # need to be listed more than once, so we keep only the
2908 # last copy. This is not always right, but it is rare
2909 # enough that we require users that really mean to play
2910 # such unportable linking tricks to link the library
2911 # using -Wl,-lname, so that libtool does not consider it
2912 # for duplicate removal.
2913 case " $specialdeplibs " in
2914 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
2916 case " $new_libs " in
2918 *) new_libs
="$deplib $new_libs" ;;
2926 for deplib
in $new_libs; do
2929 case " $tmp_libs " in
2931 *) tmp_libs
="$tmp_libs $deplib" ;;
2934 *) tmp_libs
="$tmp_libs $deplib" ;;
2937 eval $var=\"$tmp_libs\"
2940 # Last step: remove runtime libs from dependency_libs
2941 # (they stay in deplibs)
2943 for i
in $dependency_libs ; do
2944 case " $predeps $postdeps $compiler_lib_search_path " in
2949 if test -n "$i" ; then
2950 tmp_libs
="$tmp_libs $i"
2953 dependency_libs
=$tmp_libs
2955 if test "$linkmode" = prog
; then
2956 dlfiles
="$newdlfiles"
2957 dlprefiles
="$newdlprefiles"
2962 if test -n "$deplibs"; then
2963 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2966 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
2967 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2970 if test -n "$rpath"; then
2971 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2974 if test -n "$xrpath"; then
2975 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2978 if test -n "$vinfo"; then
2979 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
2982 if test -n "$release"; then
2983 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2986 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
2987 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2990 # Now set the variables for building old libraries.
2991 build_libtool_libs
=no
2993 objs
="$objs$old_deplibs"
2997 # Make sure we only generate libraries of the form `libNAME.la'.
3000 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3001 eval shared_ext
=\"$shrext_cmds\"
3002 eval libname
=\"$libname_spec\"
3005 if test "$module" = no
; then
3006 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3010 if test "$need_lib_prefix" != no
; then
3011 # Add the "lib" prefix for modules if required
3012 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3013 eval shared_ext
=\"$shrext_cmds\"
3014 eval libname
=\"$libname_spec\"
3016 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3021 if test -n "$objs"; then
3022 if test "$deplibs_check_method" != pass_all
; then
3023 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3027 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3028 $echo "*** objects $objs is not portable!"
3029 libobjs
="$libobjs $objs"
3033 if test "$dlself" != no
; then
3034 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3038 if test "$#" -gt 2; then
3039 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3044 if test -z "$rpath"; then
3045 if test "$build_libtool_libs" = yes; then
3046 # Building a libtool convenience library.
3047 # Some compilers have problems with a `.al' extension so
3048 # convenience libraries should have the same extension an
3049 # archive normally would.
3050 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
3051 build_libtool_libs
=convenience
3055 if test -n "$vinfo"; then
3056 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3059 if test -n "$release"; then
3060 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3064 # Parse the version information argument.
3065 save_ifs
="$IFS"; IFS
=':'
3066 set dummy
$vinfo 0 0 0
3069 if test -n "$8"; then
3070 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3075 # convert absolute version numbers to libtool ages
3076 # this retains compatibility with .la files and attempts
3077 # to make the code below a bit more comprehensible
3079 case $vinfo_number in
3083 number_revision
="$4"
3085 # There are really only two kinds -- those that
3086 # use the current revision as the major version
3087 # and those that subtract age and use age as
3088 # a minor version. But, then there is irix
3089 # which has an extra 1 added just for fun
3091 case $version_type in
3092 darwin|linux|osf|windows
)
3093 current
=`expr $number_major + $number_minor`
3095 revision
="$number_revision"
3097 freebsd-aout|freebsd-elf|sunos
)
3098 current
="$number_major"
3099 revision
="$number_minor"
3103 current
=`expr $number_major + $number_minor - 1`
3105 revision
="$number_minor"
3116 # Check that each of the things are valid numbers.
3118 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]) ;;
3120 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3121 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3127 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]) ;;
3129 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3130 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3136 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]) ;;
3138 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3139 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3144 if test "$age" -gt "$current"; then
3145 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3146 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3150 # Calculate the version variables.
3154 case $version_type in
3158 # Like Linux, but with the current version available in
3159 # verstring for coding it into the library header
3160 major
=.
`expr $current - $age`
3161 versuffix
="$major.$age.$revision"
3162 # Darwin ld doesn't like 0 for these options...
3163 minor_current
=`expr $current + 1`
3164 verstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3169 versuffix
=".$current.$revision";
3174 versuffix
=".$current";
3178 major
=`expr $current - $age + 1`
3180 case $version_type in
3181 nonstopux
) verstring_prefix
=nonstopux
;;
3182 *) verstring_prefix
=sgi
;;
3184 verstring
="$verstring_prefix$major.$revision"
3186 # Add in all the interfaces that we are compatible with.
3188 while test "$loop" -ne 0; do
3189 iface
=`expr $revision - $loop`
3190 loop
=`expr $loop - 1`
3191 verstring
="$verstring_prefix$major.$iface:$verstring"
3194 # Before this point, $major must not contain `.'.
3196 versuffix
="$major.$revision"
3200 major
=.
`expr $current - $age`
3201 versuffix
="$major.$age.$revision"
3205 major
=.
`expr $current - $age`
3206 versuffix
=".$current.$age.$revision"
3207 verstring
="$current.$age.$revision"
3209 # Add in all the interfaces that we are compatible with.
3211 while test "$loop" -ne 0; do
3212 iface
=`expr $current - $loop`
3213 loop
=`expr $loop - 1`
3214 verstring
="$verstring:${iface}.0"
3217 # Make executables depend on our current version.
3218 verstring
="$verstring:${current}.0"
3223 versuffix
=".$current.$revision"
3227 # Use '-' rather than '.', since we only want one
3228 # extension on DOS 8.3 filesystems.
3229 major
=`expr $current - $age`
3234 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3235 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3240 # Clear the version info if we defaulted, and they specified a release.
3241 if test -z "$vinfo" && test -n "$release"; then
3243 case $version_type in
3245 # we can't check for "0.0" in archive_cmds due to quoting
3246 # problems, so we reset it completely
3253 if test "$need_version" = no
; then
3260 # Remove version info from name if versioning should be avoided
3261 if test "$avoid_version" = yes && test "$need_version" = no
; then
3267 # Check to see if the archive will have undefined symbols.
3268 if test "$allow_undefined" = yes; then
3269 if test "$allow_undefined_flag" = unsupported
; then
3270 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3271 build_libtool_libs
=no
3275 # Don't allow undefined symbols.
3276 allow_undefined_flag
="$no_undefined_flag"
3280 if test "$mode" != relink
; then
3281 # Remove our outputs, but don't remove object files since they
3282 # may have been created when compiling PIC objects.
3284 tempremovelist
=`$echo "$output_objdir/*"`
3285 for p
in $tempremovelist; do
3289 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3290 if test "X$precious_files_regex" != "X"; then
3291 if echo $p |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
3296 removelist
="$removelist $p"
3301 if test -n "$removelist"; then
3302 $show "${rm}r $removelist"
3303 $run ${rm}r
$removelist
3307 # Now set the variables for building old libraries.
3308 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3309 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3311 # Transform .lo files to .o files.
3312 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3315 # Eliminate all temporary directories.
3316 for path
in $notinst_path; do
3317 lib_search_path
=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3318 deplibs
=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3319 dependency_libs
=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3322 if test -n "$xrpath"; then
3323 # If the user specified any rpath flags, then add them.
3325 for libdir
in $xrpath; do
3326 temp_xrpath
="$temp_xrpath -R$libdir"
3327 case "$finalize_rpath " in
3329 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3332 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3333 dependency_libs
="$temp_xrpath $dependency_libs"
3337 # Make sure dlfiles contains only unique files that won't be dlpreopened
3338 old_dlfiles
="$dlfiles"
3340 for lib
in $old_dlfiles; do
3341 case " $dlprefiles $dlfiles " in
3343 *) dlfiles
="$dlfiles $lib" ;;
3347 # Make sure dlprefiles contains only unique files
3348 old_dlprefiles
="$dlprefiles"
3350 for lib
in $old_dlprefiles; do
3351 case "$dlprefiles " in
3353 *) dlprefiles
="$dlprefiles $lib" ;;
3357 if test "$build_libtool_libs" = yes; then
3358 if test -n "$rpath"; then
3360 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3361 # these systems don't actually have a c library (as such)!
3363 *-*-rhapsody* |
*-*-darwin1.
[012])
3364 # Rhapsody C library is in the System framework
3365 deplibs
="$deplibs -framework System"
3368 # Don't link with libc until the a.out ld.so is fixed.
3370 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3371 # Do not include libc due to us having libc/libc_r.
3372 test "X$arg" = "X-lc" && continue
3375 # Add libc to deplibs on all other systems if necessary.
3376 if test "$build_libtool_need_lc" = "yes"; then
3377 deplibs
="$deplibs -lc"
3383 # Transform deplibs into only deplibs that can be linked in shared.
3385 libname_save
=$libname
3386 release_save
=$release
3387 versuffix_save
=$versuffix
3389 # I'm not sure if I'm treating the release correctly. I think
3390 # release should show up in the -l (ie -lgmp5) so we don't want to
3391 # add it in twice. Is that correct?
3397 case $deplibs_check_method in
3399 # Don't check for shared/static. Everything works.
3400 # This might be a little naive. We might want to check
3401 # whether the library exists or not. But this is on
3402 # osf3 & osf4 and I'm not really sure... Just
3403 # implementing what was already the behavior.
3407 # This code stresses the "libraries are programs" paradigm to its
3408 # limits. Maybe even breaks it. We compile a program, linking it
3409 # against the deplibs as a proxy for the library. Then we can check
3410 # whether they linked in statically or dynamically with ldd.
3412 cat > conftest.c
<<EOF
3413 int main() { return 0; }
3416 $LTCC -o conftest conftest.c
$deplibs
3417 if test "$?" -eq 0 ; then
3418 ldd_output
=`ldd conftest`
3419 for i
in $deplibs; do
3420 name
=`expr $i : '-l\(.*\)'`
3421 # If $name is empty we are operating on a -L argument.
3422 if test "$name" != "" && test "$name" -ne "0"; then
3423 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3424 case " $predeps $postdeps " in
3426 newdeplibs
="$newdeplibs $i"
3431 if test -n "$i" ; then
3432 libname
=`eval \\$echo \"$libname_spec\"`
3433 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3434 set dummy
$deplib_matches
3436 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3437 newdeplibs
="$newdeplibs $i"
3441 $echo "*** Warning: dynamic linker does not accept needed library $i."
3442 $echo "*** I have the capability to make that library automatically link in when"
3443 $echo "*** you link to this library. But I can only do this if you have a"
3444 $echo "*** shared version of the library, which I believe you do not have"
3445 $echo "*** because a test_compile did reveal that the linker did not use it for"
3446 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3450 newdeplibs
="$newdeplibs $i"
3454 # Error occurred in the first compile. Let's try to salvage
3455 # the situation: Compile a separate program for each library.
3456 for i
in $deplibs; do
3457 name
=`expr $i : '-l\(.*\)'`
3458 # If $name is empty we are operating on a -L argument.
3459 if test "$name" != "" && test "$name" != "0"; then
3461 $LTCC -o conftest conftest.c
$i
3463 if test "$?" -eq 0 ; then
3464 ldd_output
=`ldd conftest`
3465 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3466 case " $predeps $postdeps " in
3468 newdeplibs
="$newdeplibs $i"
3473 if test -n "$i" ; then
3474 libname
=`eval \\$echo \"$libname_spec\"`
3475 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3476 set dummy
$deplib_matches
3478 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3479 newdeplibs
="$newdeplibs $i"
3483 $echo "*** Warning: dynamic linker does not accept needed library $i."
3484 $echo "*** I have the capability to make that library automatically link in when"
3485 $echo "*** you link to this library. But I can only do this if you have a"
3486 $echo "*** shared version of the library, which you do not appear to have"
3487 $echo "*** because a test_compile did reveal that the linker did not use this one"
3488 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3494 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3495 $echo "*** make it link in! You will probably need to install it or some"
3496 $echo "*** library that it depends on before this library will be fully"
3497 $echo "*** functional. Installing it before continuing would be even better."
3500 newdeplibs
="$newdeplibs $i"
3506 set dummy
$deplibs_check_method
3507 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3508 for a_deplib
in $deplibs; do
3509 name
=`expr $a_deplib : '-l\(.*\)'`
3510 # If $name is empty we are operating on a -L argument.
3511 if test "$name" != "" && test "$name" != "0"; then
3512 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3513 case " $predeps $postdeps " in
3515 newdeplibs
="$newdeplibs $a_deplib"
3520 if test -n "$a_deplib" ; then
3521 libname
=`eval \\$echo \"$libname_spec\"`
3522 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3523 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3524 for potent_lib
in $potential_libs; do
3525 # Follow soft links.
3526 if ls -lLd "$potent_lib" 2>/dev
/null \
3527 |
grep " -> " >/dev
/null
; then
3530 # The statement above tries to avoid entering an
3531 # endless loop below, in case of cyclic links.
3532 # We might still enter an endless loop, since a link
3533 # loop can be closed while we follow links,
3535 potlib
="$potent_lib"
3536 while test -h "$potlib" 2>/dev
/null
; do
3537 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
3539 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
3540 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3543 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3545 |
$EGREP "$file_magic_regex" > /dev
/null
; then
3546 newdeplibs
="$newdeplibs $a_deplib"
3553 if test -n "$a_deplib" ; then
3556 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3557 $echo "*** I have the capability to make that library automatically link in when"
3558 $echo "*** you link to this library. But I can only do this if you have a"
3559 $echo "*** shared version of the library, which you do not appear to have"
3560 $echo "*** because I did check the linker path looking for a file starting"
3561 if test -z "$potlib" ; then
3562 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3564 $echo "*** with $libname and none of the candidates passed a file format test"
3565 $echo "*** using a file magic. Last file checked: $potlib"
3569 # Add a -L argument.
3570 newdeplibs
="$newdeplibs $a_deplib"
3572 done # Gone through all deplibs.
3575 set dummy
$deplibs_check_method
3576 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3577 for a_deplib
in $deplibs; do
3578 name
=`expr $a_deplib : '-l\(.*\)'`
3579 # If $name is empty we are operating on a -L argument.
3580 if test -n "$name" && test "$name" != "0"; then
3581 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3582 case " $predeps $postdeps " in
3584 newdeplibs
="$newdeplibs $a_deplib"
3589 if test -n "$a_deplib" ; then
3590 libname
=`eval \\$echo \"$libname_spec\"`
3591 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3592 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3593 for potent_lib
in $potential_libs; do
3594 potlib
="$potent_lib" # see symlink-check above in file_magic test
3595 if eval $echo \"$potent_lib\" 2>/dev
/null \
3597 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3598 newdeplibs
="$newdeplibs $a_deplib"
3605 if test -n "$a_deplib" ; then
3608 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3609 $echo "*** I have the capability to make that library automatically link in when"
3610 $echo "*** you link to this library. But I can only do this if you have a"
3611 $echo "*** shared version of the library, which you do not appear to have"
3612 $echo "*** because I did check the linker path looking for a file starting"
3613 if test -z "$potlib" ; then
3614 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3616 $echo "*** with $libname and none of the candidates passed a file format test"
3617 $echo "*** using a regex pattern. Last file checked: $potlib"
3621 # Add a -L argument.
3622 newdeplibs
="$newdeplibs $a_deplib"
3624 done # Gone through all deplibs.
3628 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3629 -e 's/ -[LR][^ ]*//g'`
3630 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3631 for i
in $predeps $postdeps ; do
3632 # can't use Xsed below, because $i might contain '/'
3633 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3636 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
3637 |
grep .
>/dev
/null
; then
3639 if test "X$deplibs_check_method" = "Xnone"; then
3640 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3642 $echo "*** Warning: inter-library dependencies are not known to be supported."
3644 $echo "*** All declared inter-library dependencies are being dropped."
3649 versuffix
=$versuffix_save
3651 release
=$release_save
3652 libname
=$libname_save
3656 *-*-rhapsody* |
*-*-darwin1.
[012])
3657 # On Rhapsody replace the C library is the System framework
3658 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3662 if test "$droppeddeps" = yes; then
3663 if test "$module" = yes; then
3665 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3666 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3667 $echo "*** a static module, that should work as long as the dlopening"
3668 $echo "*** application is linked with the -dlopen flag."
3669 if test -z "$global_symbol_pipe"; then
3671 $echo "*** However, this would only work if libtool was able to extract symbol"
3672 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3673 $echo "*** not find such a program. So, this module is probably useless."
3674 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3676 if test "$build_old_libs" = no
; then
3677 oldlibs
="$output_objdir/$libname.$libext"
3678 build_libtool_libs
=module
3681 build_libtool_libs
=no
3684 $echo "*** The inter-library dependencies that have been dropped here will be"
3685 $echo "*** automatically added whenever a program is linked with this library"
3686 $echo "*** or is declared to -dlopen it."
3688 if test "$allow_undefined" = no
; then
3690 $echo "*** Since this library must not contain undefined symbols,"
3691 $echo "*** because either the platform does not support them or"
3692 $echo "*** it was explicitly requested with -no-undefined,"
3693 $echo "*** libtool will only create a static version of it."
3694 if test "$build_old_libs" = no
; then
3695 oldlibs
="$output_objdir/$libname.$libext"
3696 build_libtool_libs
=module
3699 build_libtool_libs
=no
3704 # Done checking deplibs!
3708 # All the library-specific variables (install_libdir is set above).
3713 # Test again, we may have decided not to build it any more
3714 if test "$build_libtool_libs" = yes; then
3715 if test "$hardcode_into_libs" = yes; then
3716 # Hardcode the library paths
3719 rpath
="$finalize_rpath"
3720 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
3721 for libdir
in $rpath; do
3722 if test -n "$hardcode_libdir_flag_spec"; then
3723 if test -n "$hardcode_libdir_separator"; then
3724 if test -z "$hardcode_libdirs"; then
3725 hardcode_libdirs
="$libdir"
3727 # Just accumulate the unique libdirs.
3728 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
3729 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3732 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3737 eval flag
=\"$hardcode_libdir_flag_spec\"
3738 dep_rpath
="$dep_rpath $flag"
3740 elif test -n "$runpath_var"; then
3741 case "$perm_rpath " in
3743 *) perm_rpath
="$perm_rpath $libdir" ;;
3747 # Substitute the hardcoded libdirs into the rpath.
3748 if test -n "$hardcode_libdir_separator" &&
3749 test -n "$hardcode_libdirs"; then
3750 libdir
="$hardcode_libdirs"
3751 if test -n "$hardcode_libdir_flag_spec_ld"; then
3752 eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\"
3754 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
3757 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3758 # We should set the runpath_var.
3760 for dir
in $perm_rpath; do
3763 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3765 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
3768 shlibpath
="$finalize_shlibpath"
3769 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
3770 if test -n "$shlibpath"; then
3771 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
3774 # Get the real and link names of the library.
3775 eval shared_ext
=\"$shrext_cmds\"
3776 eval library_names
=\"$library_names_spec\"
3777 set dummy
$library_names
3781 if test -n "$soname_spec"; then
3782 eval soname
=\"$soname_spec\"
3786 if test -z "$dlname"; then
3790 lib
="$output_objdir/$realname"
3793 linknames
="$linknames $link"
3796 # Use standard objects if they are pic
3797 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3799 # Prepare the list of exported symbols
3800 if test -z "$export_symbols"; then
3801 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
3802 $show "generating symbol list for \`$libname.la'"
3803 export_symbols
="$output_objdir/$libname.exp"
3804 $run $rm $export_symbols
3805 cmds
=$export_symbols_cmds
3806 save_ifs
="$IFS"; IFS
='~'
3807 for cmd
in $cmds; do
3810 if len
=`expr "X$cmd" : ".*"` &&
3811 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3813 $run eval "$cmd" ||
exit $?
3814 skipped_export
=false
3816 # The command line is too long to execute in one step.
3817 $show "using reloadable object file for export list..."
3819 # Break out early, otherwise skipped_export may be
3820 # set to false by a later but shorter cmd.
3825 if test -n "$export_symbols_regex"; then
3826 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
3827 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
3828 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
3829 $run eval '$mv "${export_symbols}T" "$export_symbols"'
3834 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3835 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3839 for test_deplib
in $deplibs; do
3840 case " $convenience " in
3841 *" $test_deplib "*) ;;
3843 tmp_deplibs
="$tmp_deplibs $test_deplib"
3847 deplibs
="$tmp_deplibs"
3849 if test -n "$convenience"; then
3850 if test -n "$whole_archive_flag_spec"; then
3851 save_libobjs
=$libobjs
3852 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3854 gentop
="$output_objdir/${outputname}x"
3855 generated
="$generated $gentop"
3857 func_extract_archives
$gentop $convenience
3858 libobjs
="$libobjs $func_extract_archives_result"
3862 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3863 eval flag
=\"$thread_safe_flag_spec\"
3864 linker_flags
="$linker_flags $flag"
3867 # Make a backup of the uninstalled library when relinking
3868 if test "$mode" = relink
; then
3869 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
3872 # Do each of the archive commands.
3873 if test "$module" = yes && test -n "$module_cmds" ; then
3874 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3875 eval test_cmds
=\"$module_expsym_cmds\"
3876 cmds
=$module_expsym_cmds
3878 eval test_cmds
=\"$module_cmds\"
3882 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
3883 eval test_cmds
=\"$archive_expsym_cmds\"
3884 cmds
=$archive_expsym_cmds
3886 eval test_cmds
=\"$archive_cmds\"
3891 if test "X$skipped_export" != "X:" &&
3892 len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3893 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
3896 # The command line is too long to link in one step, link piecewise.
3897 $echo "creating reloadable object files..."
3899 # Save the value of $output and $libobjs because we want to
3900 # use them later. If we have whole_archive_flag_spec, we
3901 # want to use save_libobjs as it was before
3902 # whole_archive_flag_spec was expanded, because we can't
3903 # assume the linker understands whole_archive_flag_spec.
3904 # This may have to be revisited, in case too many
3905 # convenience libraries get linked in and end up exceeding
3907 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
3908 save_libobjs
=$libobjs
3911 output_la
=`$echo "X$output" | $Xsed -e "$basename"`
3913 # Clear the reloadable object creation command queue and
3914 # initialize k to one.
3921 output
=$output_objdir/$output_la-${k}.
$objext
3922 # Loop over the list of objects to be linked.
3923 for obj
in $save_libobjs
3925 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
3926 if test "X$objlist" = X ||
3927 { len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3928 test "$len" -le "$max_cmd_len"; }; then
3929 objlist
="$objlist $obj"
3931 # The command $test_cmds is almost too long, add a
3932 # command to the queue.
3933 if test "$k" -eq 1 ; then
3934 # The first file doesn't have a previous command to add.
3935 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
3937 # All subsequent reloadable object files will link in
3938 # the last one created.
3939 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
3941 last_robj
=$output_objdir/$output_la-${k}.
$objext
3943 output
=$output_objdir/$output_la-${k}.
$objext
3948 # Handle the remaining objects by creating one last
3949 # reloadable object file. All subsequent reloadable object
3950 # files will link in the last one created.
3951 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
3952 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
3954 if ${skipped_export-false}; then
3955 $show "generating symbol list for \`$libname.la'"
3956 export_symbols
="$output_objdir/$libname.exp"
3957 $run $rm $export_symbols
3959 # Append the command to create the export file.
3960 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
3963 # Set up a command to remove the reloadable object files
3964 # after they are used.
3966 while test "$i" -lt "$k"
3969 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
3972 $echo "creating a temporary reloadable object file: $output"
3974 # Loop through the commands generated above and execute them.
3975 save_ifs
="$IFS"; IFS
='~'
3976 for cmd
in $concat_cmds; do
3979 $run eval "$cmd" ||
exit $?
3984 # Restore the value of output.
3987 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
3988 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
3990 # Expand the library linking commands again to reset the
3991 # value of $libobjs for piecewise linking.
3993 # Do each of the archive commands.
3994 if test "$module" = yes && test -n "$module_cmds" ; then
3995 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
3996 cmds
=$module_expsym_cmds
4001 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4002 cmds
=$archive_expsym_cmds
4008 # Append the command to remove the reloadable object files
4009 # to the just-reset $cmds.
4010 eval cmds
=\"\
$cmds~\
$rm $delfiles\"
4012 save_ifs
="$IFS"; IFS
='~'
4013 for cmd
in $cmds; do
4017 $run eval "$cmd" ||
{
4020 # Restore the uninstalled library and exit
4021 if test "$mode" = relink
; then
4022 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4030 # Restore the uninstalled library and exit
4031 if test "$mode" = relink
; then
4032 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
4034 if test -n "$convenience"; then
4035 if test -z "$whole_archive_flag_spec"; then
4036 $show "${rm}r $gentop"
4037 $run ${rm}r
"$gentop"
4044 # Create links to the real library.
4045 for linkname
in $linknames; do
4046 if test "$realname" != "$linkname"; then
4047 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4048 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
4052 # If -module or -export-dynamic was specified, set the dlname.
4053 if test "$module" = yes ||
test "$export_dynamic" = yes; then
4054 # On all known operating systems, these are identical.
4061 if test -n "$deplibs"; then
4062 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
4065 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4066 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4069 if test -n "$rpath"; then
4070 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4073 if test -n "$xrpath"; then
4074 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4077 if test -n "$vinfo"; then
4078 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4081 if test -n "$release"; then
4082 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4087 if test -n "$objs$old_deplibs"; then
4088 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4092 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
4100 # Delete the old objects.
4101 $run $rm $obj $libobj
4103 # Objects from convenience libraries. This assumes
4104 # single-version convenience libraries. Whenever we create
4105 # different ones for PIC/non-PIC, this we'll have to duplicate
4109 # reload_cmds runs $LD directly, so let us get rid of
4110 # -Wl from whole_archive_flag_spec
4113 if test -n "$convenience"; then
4114 if test -n "$whole_archive_flag_spec"; then
4115 eval reload_conv_objs
=\"\
$reload_objs $whole_archive_flag_spec\"
4117 gentop
="$output_objdir/${obj}x"
4118 generated
="$generated $gentop"
4120 func_extract_archives
$gentop $convenience
4121 reload_conv_objs
="$reload_objs $func_extract_archives_result"
4125 # Create the old-style object.
4126 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
4130 save_ifs
="$IFS"; IFS
='~'
4131 for cmd
in $cmds; do
4135 $run eval "$cmd" ||
exit $?
4139 # Exit if we aren't doing a library object file.
4140 if test -z "$libobj"; then
4141 if test -n "$gentop"; then
4142 $show "${rm}r $gentop"
4149 if test "$build_libtool_libs" != yes; then
4150 if test -n "$gentop"; then
4151 $show "${rm}r $gentop"
4155 # Create an invalid libtool object if no PIC, so that we don't
4156 # accidentally link it into a program.
4157 # $show "echo timestamp > $libobj"
4158 # $run eval "echo timestamp > $libobj" || exit $?
4162 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4163 # Only do commands if we really have different PIC objects.
4164 reload_objs
="$libobjs $reload_conv_objs"
4167 save_ifs
="$IFS"; IFS
='~'
4168 for cmd
in $cmds; do
4172 $run eval "$cmd" ||
exit $?
4177 if test -n "$gentop"; then
4178 $show "${rm}r $gentop"
4187 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4189 if test -n "$vinfo"; then
4190 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4193 if test -n "$release"; then
4194 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4197 if test "$preload" = yes; then
4198 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4199 test "$dlopen_self_static" = unknown
; then
4200 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4205 *-*-rhapsody* |
*-*-darwin1.
[012])
4206 # On Rhapsody replace the C library is the System framework
4207 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4208 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4214 # Don't allow lazy linking, it breaks C++ global constructors
4215 if test "$tagname" = CXX
; then
4216 compile_command
="$compile_command ${wl}-bind_at_load"
4217 finalize_command
="$finalize_command ${wl}-bind_at_load"
4222 compile_command
="$compile_command $compile_deplibs"
4223 finalize_command
="$finalize_command $finalize_deplibs"
4225 if test -n "$rpath$xrpath"; then
4226 # If the user specified any rpath flags, then add them.
4227 for libdir
in $rpath $xrpath; do
4228 # This is the magic to use -rpath.
4229 case "$finalize_rpath " in
4231 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4236 # Now hardcode the library paths
4239 for libdir
in $compile_rpath $finalize_rpath; do
4240 if test -n "$hardcode_libdir_flag_spec"; then
4241 if test -n "$hardcode_libdir_separator"; then
4242 if test -z "$hardcode_libdirs"; then
4243 hardcode_libdirs
="$libdir"
4245 # Just accumulate the unique libdirs.
4246 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4247 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4250 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4255 eval flag
=\"$hardcode_libdir_flag_spec\"
4256 rpath
="$rpath $flag"
4258 elif test -n "$runpath_var"; then
4259 case "$perm_rpath " in
4261 *) perm_rpath
="$perm_rpath $libdir" ;;
4265 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4266 case :$dllsearchpath: in
4268 *) dllsearchpath
="$dllsearchpath:$libdir";;
4273 # Substitute the hardcoded libdirs into the rpath.
4274 if test -n "$hardcode_libdir_separator" &&
4275 test -n "$hardcode_libdirs"; then
4276 libdir
="$hardcode_libdirs"
4277 eval rpath
=\" $hardcode_libdir_flag_spec\"
4279 compile_rpath
="$rpath"
4283 for libdir
in $finalize_rpath; do
4284 if test -n "$hardcode_libdir_flag_spec"; then
4285 if test -n "$hardcode_libdir_separator"; then
4286 if test -z "$hardcode_libdirs"; then
4287 hardcode_libdirs
="$libdir"
4289 # Just accumulate the unique libdirs.
4290 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4291 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4294 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4299 eval flag
=\"$hardcode_libdir_flag_spec\"
4300 rpath
="$rpath $flag"
4302 elif test -n "$runpath_var"; then
4303 case "$finalize_perm_rpath " in
4305 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4309 # Substitute the hardcoded libdirs into the rpath.
4310 if test -n "$hardcode_libdir_separator" &&
4311 test -n "$hardcode_libdirs"; then
4312 libdir
="$hardcode_libdirs"
4313 eval rpath
=\" $hardcode_libdir_flag_spec\"
4315 finalize_rpath
="$rpath"
4317 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4318 # Transform all the library objects into standard objects.
4319 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4320 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4324 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4325 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4326 dlsyms
="${outputname}S.c"
4328 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4332 if test -n "$dlsyms"; then
4336 # Discover the nlist of each of the dlfiles.
4337 nlist
="$output_objdir/${outputname}.nm"
4339 $show "$rm $nlist ${nlist}S ${nlist}T"
4340 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4342 # Parse the name list into a source file.
4343 $show "creating $output_objdir/$dlsyms"
4345 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4346 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4347 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4353 /* Prevent the only kind of declaration conflicts we can make. */
4354 #define lt_preloaded_symbols some_other_symbol
4356 /* External symbol declarations for the compiler. */\
4359 if test "$dlself" = yes; then
4360 $show "generating symbol list for \`$output'"
4362 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4364 # Add our own program objects to the symbol list.
4365 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4366 for arg
in $progfiles; do
4367 $show "extracting global C symbols from \`$arg'"
4368 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4371 if test -n "$exclude_expsyms"; then
4372 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4373 $run eval '$mv "$nlist"T "$nlist"'
4376 if test -n "$export_symbols_regex"; then
4377 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4378 $run eval '$mv "$nlist"T "$nlist"'
4381 # Prepare the list of exported symbols
4382 if test -z "$export_symbols"; then
4383 export_symbols
="$output_objdir/$outputname.exp"
4384 $run $rm $export_symbols
4385 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4387 $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4388 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4389 $run eval 'mv "$nlist"T "$nlist"'
4393 for arg
in $dlprefiles; do
4394 $show "extracting global C symbols from \`$arg'"
4395 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4396 $run eval '$echo ": $name " >> "$nlist"'
4397 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4400 if test -z "$run"; then
4401 # Make sure we have at least an empty file.
4402 test -f "$nlist" ||
: > "$nlist"
4404 if test -n "$exclude_expsyms"; then
4405 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4406 $mv "$nlist"T
"$nlist"
4409 # Try sorting and uniquifying the output.
4410 if grep -v "^: " < "$nlist" |
4411 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4416 uniq > "$nlist"S
; then
4419 grep -v "^: " < "$nlist" > "$nlist"S
4422 if test -f "$nlist"S
; then
4423 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4425 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4428 $echo >> "$output_objdir/$dlsyms" "\
4430 #undef lt_preloaded_symbols
4432 #if defined (__STDC__) && __STDC__
4433 # define lt_ptr void *
4435 # define lt_ptr char *
4439 /* The mapping between symbol names and symbols. */
4443 *cygwin
* |
*mingw
* )
4444 $echo >> "$output_objdir/$dlsyms" "\
4445 /* DATA imports from DLLs on WIN32 can't be const, because
4446 runtime relocations are performed -- see ld's documentation
4452 $echo >> "$output_objdir/$dlsyms" "\
4459 $echo >> "$output_objdir/$dlsyms" "\
4463 lt_preloaded_symbols[] =
4467 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4469 $echo >> "$output_objdir/$dlsyms" "\
4473 /* This works around a problem in FreeBSD linker */
4474 #ifdef FREEBSD_WORKAROUND
4475 static const void *lt_preloaded_setup() {
4476 return lt_preloaded_symbols;
4486 pic_flag_for_symtable
=
4488 # compiling the symbol table file with pic_flag works around
4489 # a FreeBSD bug that causes programs to crash when -lm is
4490 # linked before any other PIC object. But we must not use
4491 # pic_flag when linking with -static. The problem exists in
4492 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4493 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
4494 case "$compile_command " in
4496 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
4499 case "$compile_command " in
4501 *) pic_flag_for_symtable
=" $pic_flag";;
4505 # Now compile the dynamic symbol file.
4506 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4507 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
4509 # Clean up the generated files.
4510 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4511 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4513 # Transform the symbol file into the correct name.
4514 compile_command
=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4515 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4518 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4523 # We keep going just in case the user didn't refer to
4524 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4525 # really was required.
4527 # Nullify the symbol file.
4528 compile_command
=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4529 finalize_command
=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4532 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
4533 # Replace the output file specification.
4534 compile_command
=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4535 link_command
="$compile_command$compile_rpath"
4537 # We have no uninstalled library dependencies, so finalize right now.
4538 $show "$link_command"
4539 $run eval "$link_command"
4542 # Delete the generated files.
4543 if test -n "$dlsyms"; then
4544 $show "$rm $output_objdir/${outputname}S.${objext}"
4545 $run $rm "$output_objdir/${outputname}S.${objext}"
4551 if test -n "$shlibpath_var"; then
4552 # We should set the shlibpath_var
4554 for dir
in $temp_rpath; do
4556 [\\/]* |
[A-Za-z
]:[\\/]*)
4561 # Relative path: add a thisdir entry.
4562 rpath
="$rpath\$thisdir/$dir:"
4569 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4570 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4572 if test -n "$finalize_shlibpath"; then
4573 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4578 if test -n "$runpath_var"; then
4579 if test -n "$perm_rpath"; then
4580 # We should set the runpath_var.
4582 for dir
in $perm_rpath; do
4585 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4587 if test -n "$finalize_perm_rpath"; then
4588 # We should set the runpath_var.
4590 for dir
in $finalize_perm_rpath; do
4593 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4597 if test "$no_install" = yes; then
4598 # We don't need to create a wrapper script.
4599 link_command
="$compile_var$compile_command$compile_rpath"
4600 # Replace the output file specification.
4601 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4602 # Delete the old output file.
4604 # Link the executable and exit
4605 $show "$link_command"
4606 $run eval "$link_command" ||
exit $?
4610 if test "$hardcode_action" = relink
; then
4611 # Fast installation is not supported
4612 link_command
="$compile_var$compile_command$compile_rpath"
4613 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4615 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4616 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4618 if test "$fast_install" != no
; then
4619 link_command
="$finalize_var$compile_command$finalize_rpath"
4620 if test "$fast_install" = yes; then
4621 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
4623 # fast_install is set to needless
4627 link_command
="$compile_var$compile_command$compile_rpath"
4628 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4632 # Replace the output file specification.
4633 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4635 # Delete the old output files.
4636 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4638 $show "$link_command"
4639 $run eval "$link_command" ||
exit $?
4641 # Now create the wrapper script.
4642 $show "creating $output"
4644 # Quote the relink command for shipping.
4645 if test -n "$relink_command"; then
4646 # Preserve any variables that may affect compiler behavior
4647 for var
in $variables_saved_for_relink; do
4648 if eval test -z \"\
${$var+set}\"; then
4649 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
4650 elif eval var_value
=\$
$var; test -z "$var_value"; then
4651 relink_command
="$var=; export $var; $relink_command"
4653 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4654 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
4657 relink_command
="(cd `pwd`; $relink_command)"
4658 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4661 # Quote $echo for shipping.
4662 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
4664 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
4665 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
4667 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4669 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
4672 # Only actually do things if our run command is non-null.
4673 if test -z "$run"; then
4674 # win32 will think the script is a binary if it has
4675 # a .exe suffix, so we strip it off here.
4677 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
4679 # test for cygwin because mv fails w/o .exe extensions
4683 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
4687 *cygwin
* |
*mingw
* )
4688 cwrappersource
=`$echo ${objdir}/lt-${outputname}.c`
4689 cwrapper
=`$echo ${output}.exe`
4690 $rm $cwrappersource $cwrapper
4691 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4693 cat > $cwrappersource <<EOF
4695 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4696 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4698 The $output program cannot be directly executed until all the libtool
4699 libraries that it depends on are installed.
4701 This wrapper executable should never be moved out of the build directory.
4702 If it is, it will not operate correctly.
4704 Currently, it simply execs the wrapper *script* "/bin/sh $output",
4705 but could eventually absorb all of the scripts functionality and
4706 exec $objdir/$outputname directly.
4709 cat >> $cwrappersource<<"EOF"
4717 #if defined(PATH_MAX)
4718 # define LT_PATHMAX PATH_MAX
4719 #elif defined(MAXPATHLEN)
4720 # define LT_PATHMAX MAXPATHLEN
4722 # define LT_PATHMAX 1024
4725 #ifndef DIR_SEPARATOR
4726 #define DIR_SEPARATOR '/'
4729 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4731 #define HAVE_DOS_BASED_FILE_SYSTEM
4732 #ifndef DIR_SEPARATOR_2
4733 #define DIR_SEPARATOR_2 '\\'
4737 #ifndef DIR_SEPARATOR_2
4738 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4739 #else /* DIR_SEPARATOR_2 */
4740 # define IS_DIR_SEPARATOR(ch) \
4741 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4742 #endif /* DIR_SEPARATOR_2 */
4744 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4745 #define XFREE(stale) do { \
4746 if (stale) { free ((void *) stale); stale = 0; } \
4749 const char *program_name = NULL;
4751 void * xmalloc (size_t num);
4752 char * xstrdup (const char *string);
4753 char * basename (const char *name);
4754 char * fnqualify(const char *path);
4755 char * strendzap(char *str, const char *pat);
4756 void lt_fatal (const char *message, ...);
4759 main (int argc, char *argv[])
4764 program_name = (char *) xstrdup ((char *) basename (argv[0]));
4765 newargz = XMALLOC(char *, argc+2);
4768 cat >> $cwrappersource <<EOF
4769 newargz[0] = "$SHELL";
4772 cat >> $cwrappersource <<"EOF"
4773 newargz
[1] = fnqualify
(argv
[0]);
4774 /* we know the
script has the same name
, without the .exe
*/
4775 /* so
make sure newargz
[1] doesn
't end in .exe */
4776 strendzap(newargz[1],".exe");
4777 for (i = 1; i < argc; i++)
4778 newargz[i+1] = xstrdup(argv[i]);
4779 newargz[argc+1] = NULL;
4782 cat >> $cwrappersource <<EOF
4783 execv("$SHELL",newargz);
4786 cat >> $cwrappersource <<"EOF"
4791 xmalloc (size_t num)
4793 void * p = (void *) malloc (num);
4795 lt_fatal ("Memory exhausted");
4801 xstrdup (const char *string)
4803 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
4808 basename (const char *name)
4812 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4813 /* Skip over the disk name in MSDOS pathnames. */
4814 if (isalpha (name[0]) && name[1] == ':')
4818 for (base = name; *name; name++)
4819 if (IS_DIR_SEPARATOR (*name))
4821 return (char *) base;
4825 fnqualify(const char *path)
4829 char tmp[LT_PATHMAX + 1];
4831 assert(path != NULL);
4833 /* Is it qualified already? */
4834 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4835 if (isalpha (path[0]) && path[1] == ':')
4836 return xstrdup (path);
4838 if (IS_DIR_SEPARATOR (path[0]))
4839 return xstrdup (path);
4841 /* prepend the current directory */
4842 /* doesn't handle
'~' */
4843 if (getcwd
(tmp
, LT_PATHMAX
) == NULL
)
4844 lt_fatal
("getcwd failed");
4845 size
= strlen
(tmp
) + 1 + strlen
(path
) + 1; /* +2 for '/' and
'\0' */
4846 p
= XMALLOC
(char
, size
);
4847 sprintf
(p
, "%s%c%s", tmp
, DIR_SEPARATOR
, path
);
4852 strendzap
(char
*str
, const char
*pat
)
4856 assert
(str
!= NULL
);
4857 assert
(pat
!= NULL
);
4860 patlen
= strlen
(pat
);
4864 str
+= len
- patlen
;
4865 if (strcmp
(str
, pat
) == 0)
4872 lt_error_core
(int exit_status
, const char
* mode
,
4873 const char
* message
, va_list ap
)
4875 fprintf
(stderr
, "%s: %s: ", program_name
, mode
);
4876 vfprintf
(stderr
, message
, ap
);
4877 fprintf
(stderr
, ".\n");
4879 if (exit_status
>= 0)
4884 lt_fatal
(const char
*message
, ...
)
4887 va_start
(ap
, message
);
4888 lt_error_core
(EXIT_FAILURE
, "FATAL", message
, ap
);
4892 # we should really use a build-platform specific compiler
4893 # here, but OTOH, the wrappers (shell script and this C one)
4894 # are only useful if you want to execute the "real" binary.
4895 # Since the "real" binary is built for $host, then this
4896 # wrapper might as well be built for $host, too.
4897 $run $LTCC -s -o $cwrapper $cwrappersource
4901 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4906 # $output - temporary wrapper script for $objdir/$outputname
4907 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4909 # The $output program cannot be directly executed until all the libtool
4910 # libraries that it depends on are installed.
4912 # This wrapper script should never be moved out of the build directory.
4913 # If it is, it will not operate correctly.
4915 # Sed substitution that helps us do robust quoting. It backslashifies
4916 # metacharacters that are still active within double-quoted strings.
4917 Xsed='${SED} -e 1s/^X//'
4918 sed_quote_subst='$sed_quote_subst'
4920 # The HP-UX ksh and POSIX shell print the target directory to stdout
4922 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4924 relink_command=\"$relink_command\"
4926 # This environment variable determines our operation mode.
4927 if test \"\$libtool_install_magic\" = \"$magic\"; then
4928 # install mode needs the following variable:
4929 notinst_deplibs='$notinst_deplibs'
4931 # When we are sourced in execute mode, \$file and \$echo are already set.
4932 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4935 # Make sure echo works.
4936 if test \"X\$1\" = X--no-reexec; then
4937 # Discard the --no-reexec flag, and continue.
4939 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4940 # Yippee, \$echo works!
4943 # Restart under the correct shell, and then maybe \$echo will work.
4944 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4950 # Find the directory that this script lives in.
4951 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4952 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4954 # Follow symbolic links until we get to the real thisdir.
4955 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
4956 while test -n \"\$file\"; do
4957 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
4959 # If there was a directory component, then change thisdir.
4960 if test \"x\$destdir\" != \"x\$file\"; then
4961 case \"\$destdir\" in
4962 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4963 *) thisdir=\"\$thisdir/\$destdir\" ;;
4967 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4968 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
4971 # Try to get the absolute directory name.
4972 absdir=\`cd \"\$thisdir\" && pwd\`
4973 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4976 if test "$fast_install" = yes; then
4978 program=lt-'$outputname'$exeext
4979 progdir=\"\$thisdir/$objdir\"
4981 if test ! -f \"\$progdir/\$program\" || \\
4982 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4983 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4985 file=\"\$\$-\$program\"
4987 if test ! -d \"\$progdir\"; then
4988 $mkdir \"\$progdir\"
4990 $rm \"\$progdir/\$file\"
4995 # relink executable if necessary
4996 if test -n \"\$relink_command\"; then
4997 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4999 $echo \"\$relink_command_output\" >&2
5000 $rm \"\$progdir/\$file\"
5005 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5006 { $rm \"\$progdir/\$program\";
5007 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5008 $rm \"\$progdir/\$file\"
5012 program='$outputname'
5013 progdir=\"\$thisdir/$objdir\"
5019 if test -f \"\$progdir/\$program\"; then"
5021 # Export our shlibpath_var if we have one.
5022 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5024 # Add our own library path to $shlibpath_var
5025 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5027 # Some systems cannot cope with colon-terminated $shlibpath_var
5028 # The second colon is a workaround for a bug in BeOS R4 sed
5029 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5031 export $shlibpath_var
5035 # fixup the dll searchpath if we need to.
5036 if test -n "$dllsearchpath"; then
5038 # Add the dll search path components to the executable PATH
5039 PATH=$dllsearchpath:\$PATH
5044 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5045 # Run the actual program with our arguments.
5048 # Backslashes separate directories on plain windows
5049 *-*-mingw |
*-*-os2*)
5051 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5057 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5062 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
5066 # The program doesn't exist.
5067 \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5068 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5069 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5080 # See if we need to build an old-fashioned archive.
5081 for oldlib
in $oldlibs; do
5083 if test "$build_libtool_libs" = convenience
; then
5084 oldobjs
="$libobjs_save"
5085 addlibs
="$convenience"
5086 build_libtool_libs
=no
5088 if test "$build_libtool_libs" = module
; then
5089 oldobjs
="$libobjs_save"
5090 build_libtool_libs
=no
5092 oldobjs
="$old_deplibs $non_pic_objects"
5094 addlibs
="$old_convenience"
5097 if test -n "$addlibs"; then
5098 gentop
="$output_objdir/${outputname}x"
5099 generated
="$generated $gentop"
5101 func_extract_archives
$gentop $addlibs
5102 oldobjs
="$oldobjs $func_extract_archives_result"
5105 # Do each command in the archive commands.
5106 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5107 cmds
=$old_archive_from_new_cmds
5109 # POSIX demands no paths to be encoded in archives. We have
5110 # to avoid creating archives with duplicate basenames if we
5111 # might have to extract them afterwards, e.g., when creating a
5112 # static archive out of a convenience library, or when linking
5113 # the entirety of a libtool archive into another (currently
5114 # not supported by libtool).
5115 if (for obj
in $oldobjs
5117 $echo "X$obj" |
$Xsed -e 's%^.*/%%'
5118 done |
sort |
sort -uc >/dev
/null
2>&1); then
5121 $echo "copying selected object files to avoid basename conflicts..."
5123 if test -z "$gentop"; then
5124 gentop
="$output_objdir/${outputname}x"
5125 generated
="$generated $gentop"
5127 $show "${rm}r $gentop"
5128 $run ${rm}r
"$gentop"
5129 $show "$mkdir $gentop"
5130 $run $mkdir "$gentop"
5132 if test "$status" -ne 0 && test ! -d "$gentop"; then
5137 save_oldobjs
=$oldobjs
5140 for obj
in $save_oldobjs
5142 objbase
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
5143 case " $oldobjs " in
5144 " ") oldobjs
=$obj ;;
5147 # Make sure we don't pick an alternate name that also
5149 newobj
=lt
$counter-$objbase
5150 counter
=`expr $counter + 1`
5151 case " $oldobjs " in
5152 *[\
/]"$newobj "*) ;;
5153 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5156 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5157 $run ln "$obj" "$gentop/$newobj" ||
5158 $run cp "$obj" "$gentop/$newobj"
5159 oldobjs
="$oldobjs $gentop/$newobj"
5161 *) oldobjs
="$oldobjs $obj" ;;
5166 eval cmds
=\"$old_archive_cmds\"
5168 if len
=`expr "X$cmds" : ".*"` &&
5169 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
5170 cmds
=$old_archive_cmds
5172 # the command line is too long to link in one step, link in parts
5173 $echo "using piecewise archive linking..."
5178 save_oldobjs
=$oldobjs
5180 # Is there a better way of finding the last object in the list?
5181 for obj
in $save_oldobjs
5185 for obj
in $save_oldobjs
5187 oldobjs
="$objlist $obj"
5188 objlist
="$objlist $obj"
5189 eval test_cmds
=\"$old_archive_cmds\"
5190 if len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5191 test "$len" -le "$max_cmd_len"; then
5194 # the above command should be used before it gets too long
5196 if test "$obj" = "$last_oldobj" ; then
5199 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
5200 eval concat_cmds
=\"\
${concat_cmds}$old_archive_cmds\"
5206 if test "X$oldobjs" = "X" ; then
5207 eval cmds
=\"\
$concat_cmds\"
5209 eval cmds
=\"\
$concat_cmds~\
$old_archive_cmds\"
5213 save_ifs
="$IFS"; IFS
='~'
5214 for cmd
in $cmds; do
5218 $run eval "$cmd" ||
exit $?
5223 if test -n "$generated"; then
5224 $show "${rm}r$generated"
5225 $run ${rm}r
$generated
5228 # Now create the libtool archive.
5232 test "$build_old_libs" = yes && old_library
="$libname.$libext"
5233 $show "creating $output"
5235 # Preserve any variables that may affect compiler behavior
5236 for var
in $variables_saved_for_relink; do
5237 if eval test -z \"\
${$var+set}\"; then
5238 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5239 elif eval var_value
=\$
$var; test -z "$var_value"; then
5240 relink_command
="$var=; export $var; $relink_command"
5242 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5243 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
5246 # Quote the link command for shipping.
5247 relink_command
="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5248 relink_command
=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
5249 if test "$hardcode_automatic" = yes ; then
5254 # Only create the output if not a dry run.
5255 if test -z "$run"; then
5256 for installed
in no
yes; do
5257 if test "$installed" = yes; then
5258 if test -z "$install_libdir"; then
5261 output
="$output_objdir/$outputname"i
5262 # Replace all uninstalled libtool libraries with the installed ones
5264 for deplib
in $dependency_libs; do
5267 name
=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
5268 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5269 if test -z "$libdir"; then
5270 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5273 newdependency_libs
="$newdependency_libs $libdir/$name"
5275 *) newdependency_libs
="$newdependency_libs $deplib" ;;
5278 dependency_libs
="$newdependency_libs"
5280 for lib
in $dlfiles; do
5281 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5282 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5283 if test -z "$libdir"; then
5284 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5287 newdlfiles
="$newdlfiles $libdir/$name"
5289 dlfiles
="$newdlfiles"
5291 for lib
in $dlprefiles; do
5292 name
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
5293 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5294 if test -z "$libdir"; then
5295 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5298 newdlprefiles
="$newdlprefiles $libdir/$name"
5300 dlprefiles
="$newdlprefiles"
5303 for lib
in $dlfiles; do
5305 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
5306 *) abs
=`pwd`"/$lib" ;;
5308 newdlfiles
="$newdlfiles $abs"
5310 dlfiles
="$newdlfiles"
5312 for lib
in $dlprefiles; do
5314 [\\/]* |
[A-Za-z
]:[\\/]*) abs
="$lib" ;;
5315 *) abs
=`pwd`"/$lib" ;;
5317 newdlprefiles
="$newdlprefiles $abs"
5319 dlprefiles
="$newdlprefiles"
5322 # place dlname in correct position for cygwin
5324 case $host,$output,$installed,$module,$dlname in
5325 *cygwin
*,*lai
,yes,no
,*.dll |
*mingw
*,*lai
,yes,no
,*.dll
) tdlname
=..
/bin
/$dlname ;;
5328 # $outputname - a libtool library file
5329 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5331 # Please DO NOT delete this file!
5332 # It is necessary for linking the library.
5334 # The name that we can dlopen(3).
5337 # Names of this library.
5338 library_names='$library_names'
5340 # The name of the static archive.
5341 old_library='$old_library'
5343 # Libraries that this one depends upon.
5344 dependency_libs='$dependency_libs'
5346 # Version information for $libname.
5351 # Is this an already installed library?
5352 installed=$installed
5354 # Should we warn about portability when linking against -modules?
5355 shouldnotlink=$module
5357 # Files to dlopen/dlpreopen
5359 dlpreopen='$dlprefiles'
5361 # Directory that this library needs to be installed in:
5362 libdir='$install_libdir'"
5363 if test "$installed" = no
&& test "$need_relink" = yes; then
5365 relink_command=\"$relink_command\""
5370 # Do a symbolic link so that the libtool archive can be found in
5371 # LD_LIBRARY_PATH before the program is installed.
5372 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5373 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' ||
exit $?
5379 # libtool install mode
5381 modename
="$modename: install"
5383 # There may be an optional sh(1) argument at the beginning of
5384 # install_prog (especially on Windows NT).
5385 if test "$nonopt" = "$SHELL" ||
test "$nonopt" = /bin
/sh ||
5386 # Allow the use of GNU shtool's install command.
5387 $echo "X$nonopt" |
grep shtool
> /dev
/null
; then
5388 # Aesthetically quote it.
5389 arg
=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5391 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5395 install_prog
="$arg "
5403 # The real first argument should be the name of the installation program.
5404 # Aesthetically quote it.
5405 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5407 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5411 install_prog
="$install_prog$arg"
5413 # We need to accept at least all the BSD install flags.
5423 if test -n "$dest"; then
5424 files
="$files $dest"
5432 case " $install_prog " in
5437 -g |
-m |
-o) prev
=$arg ;;
5445 # If the previous option needed an argument, then skip it.
5446 if test -n "$prev"; then
5455 # Aesthetically quote the argument.
5456 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5458 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5462 install_prog
="$install_prog $arg"
5465 if test -z "$install_prog"; then
5466 $echo "$modename: you must specify an install program" 1>&2
5471 if test -n "$prev"; then
5472 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5477 if test -z "$files"; then
5478 if test -z "$dest"; then
5479 $echo "$modename: no file or destination specified" 1>&2
5481 $echo "$modename: you must specify a destination" 1>&2
5487 # Strip any trailing slash from the destination.
5488 dest
=`$echo "X$dest" | $Xsed -e 's%/$%%'`
5490 # Check to see that the destination is a directory.
5491 test -d "$dest" && isdir
=yes
5492 if test "$isdir" = yes; then
5496 destdir
=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
5497 test "X$destdir" = "X$dest" && destdir
=.
5498 destname
=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
5500 # Not a directory, so check to see that there is only one file specified.
5502 if test "$#" -gt 2; then
5503 $echo "$modename: \`$dest' is not a directory" 1>&2
5509 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
5511 for file in $files; do
5515 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
5524 # This variable tells wrapper scripts just to set variables rather
5525 # than running their programs.
5526 libtool_install_magic
="$magic"
5531 for file in $files; do
5533 # Do each installation.
5536 # Do the static libraries later.
5537 staticlibs
="$staticlibs $file"
5541 # Check to see that this really is a libtool archive.
5542 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5544 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
5552 # If there is no directory component, then add one.
5554 */* |
*\\*) .
$file ;;
5558 # Add the libdir to current_libdirs if it is the destination.
5559 if test "X$destdir" = "X$libdir"; then
5560 case "$current_libdirs " in
5562 *) current_libdirs
="$current_libdirs $libdir" ;;
5565 # Note the libdir as a future libdir.
5566 case "$future_libdirs " in
5568 *) future_libdirs
="$future_libdirs $libdir" ;;
5572 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
5573 test "X$dir" = "X$file/" && dir
=
5576 if test -n "$relink_command"; then
5577 # Determine the prefix the user has applied to our future dir.
5578 inst_prefix_dir
=`$echo "$destdir" | $SED "s%$libdir\$%%"`
5580 # Don't allow the user to place us outside of our expected
5581 # location b/c this prevents finding dependent libraries that
5582 # are installed to the same prefix.
5583 # At present, this check doesn't affect windows .dll's that
5584 # are installed into $libdir/../bin (currently, that works fine)
5585 # but it's something to keep an eye on.
5586 if test "$inst_prefix_dir" = "$destdir"; then
5587 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
5591 if test -n "$inst_prefix_dir"; then
5592 # Stick the inst_prefix_dir data into the link command.
5593 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
5595 relink_command
=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
5598 $echo "$modename: warning: relinking \`$file'" 1>&2
5599 $show "$relink_command"
5600 if $run eval "$relink_command"; then :
5602 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5607 # See the names of the shared library.
5608 set dummy
$library_names
5609 if test -n "$2"; then
5615 test -n "$relink_command" && srcname
="$realname"T
5617 # Install the shared library and build the symlinks.
5618 $show "$install_prog $dir/$srcname $destdir/$realname"
5619 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
5620 if test -n "$stripme" && test -n "$striplib"; then
5621 $show "$striplib $destdir/$realname"
5622 $run eval "$striplib $destdir/$realname" ||
exit $?
5625 if test "$#" -gt 0; then
5626 # Delete the old symlinks, and create new ones.
5627 # Try `ln -sf' first, because the `ln' binary might depend on
5628 # the symlink we replace! Solaris /bin/ln does not understand -f,
5629 # so we also need to try rm && ln -s.
5632 if test "$linkname" != "$realname"; then
5633 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5634 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5639 # Do each command in the postinstall commands.
5640 lib
="$destdir/$realname"
5641 cmds
=$postinstall_cmds
5642 save_ifs
="$IFS"; IFS
='~'
5643 for cmd
in $cmds; do
5647 $run eval "$cmd" ||
{
5650 # Restore the uninstalled library and exit
5651 if test "$mode" = relink
; then
5652 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
5661 # Install the pseudo-library for information purposes.
5662 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5663 instname
="$dir/$name"i
5664 $show "$install_prog $instname $destdir/$name"
5665 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
5667 # Maybe install the static library, too.
5668 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
5672 # Install (i.e. copy) a libtool object.
5674 # Figure out destination file name, if it wasn't already specified.
5675 if test -n "$destname"; then
5676 destfile
="$destdir/$destname"
5678 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5679 destfile
="$destdir/$destfile"
5682 # Deduce the name of the destination old-style object file.
5685 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
5688 staticdest
="$destfile"
5692 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
5698 # Install the libtool object if requested.
5699 if test -n "$destfile"; then
5700 $show "$install_prog $file $destfile"
5701 $run eval "$install_prog $file $destfile" ||
exit $?
5704 # Install the old object if enabled.
5705 if test "$build_old_libs" = yes; then
5706 # Deduce the name of the old-style object file.
5707 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
5709 $show "$install_prog $staticobj $staticdest"
5710 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
5716 # Figure out destination file name, if it wasn't already specified.
5717 if test -n "$destname"; then
5718 destfile
="$destdir/$destname"
5720 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5721 destfile
="$destdir/$destfile"
5724 # If the file is missing, and there is a .exe on the end, strip it
5725 # because it is most likely a libtool script we actually want to
5730 if test ! -f "$file"; then
5731 file=`$echo $file|${SED} 's,.exe$,,'`
5737 # Do a test to see if this is really a libtool program.
5740 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
5746 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
5750 # Note that it is not necessary on cygwin/mingw to append a dot to
5751 # foo even if both foo and FILE.exe exist: automatic-append-.exe
5752 # behavior happens only for exec(3), not for open(2)! Also, sourcing
5753 # `FILE.' does not work on cygwin managed mounts.
5755 # If there is no directory component, then add one.
5757 */* |
*\\*) .
${wrapper} ;;
5758 *) . .
/${wrapper} ;;
5761 # Check the variables that should have been set.
5762 if test -z "$notinst_deplibs"; then
5763 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
5768 for lib
in $notinst_deplibs; do
5769 # Check to see that each library is installed.
5771 if test -f "$lib"; then
5772 # If there is no directory component, then add one.
5774 */* |
*\\*) .
$lib ;;
5778 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
5779 if test -n "$libdir" && test ! -f "$libfile"; then
5780 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
5786 # Note that it is not necessary on cygwin/mingw to append a dot to
5787 # foo even if both foo and FILE.exe exist: automatic-append-.exe
5788 # behavior happens only for exec(3), not for open(2)! Also, sourcing
5789 # `FILE.' does not work on cygwin managed mounts.
5791 # If there is no directory component, then add one.
5793 */* |
*\\*) .
${wrapper} ;;
5794 *) . .
/${wrapper} ;;
5798 if test "$fast_install" = no
&& test -n "$relink_command"; then
5799 if test "$finalize" = yes && test -z "$run"; then
5801 test -n "$TMPDIR" && tmpdir
="$TMPDIR"
5802 tmpdir
="$tmpdir/libtool-$$"
5805 if $mkdir "$tmpdir"; then
5809 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5812 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5813 outputname
="$tmpdir/$file"
5814 # Replace the output file specification.
5815 relink_command
=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
5817 $show "$relink_command"
5818 if $run eval "$relink_command"; then :
5820 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
5826 $echo "$modename: warning: cannot relink \`$file'" 1>&2
5829 # Install the binary that we compiled earlier.
5830 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
5834 # remove .exe since cygwin /usr/bin/install will append another
5836 case $install_prog,$host in
5837 */usr
/bin
/install*,*cygwin
*)
5838 case $file:$destfile in
5843 destfile
=$destfile.exe
5846 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
5851 $show "$install_prog$stripme $file $destfile"
5852 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
5853 test -n "$outputname" && ${rm}r
"$tmpdir"
5858 for file in $staticlibs; do
5859 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5861 # Set up the ranlib parameters.
5862 oldlib
="$destdir/$name"
5864 $show "$install_prog $file $oldlib"
5865 $run eval "$install_prog \$file \$oldlib" ||
exit $?
5867 if test -n "$stripme" && test -n "$old_striplib"; then
5868 $show "$old_striplib $oldlib"
5869 $run eval "$old_striplib $oldlib" ||
exit $?
5872 # Do each command in the postinstall commands.
5873 cmds
=$old_postinstall_cmds
5874 save_ifs
="$IFS"; IFS
='~'
5875 for cmd
in $cmds; do
5879 $run eval "$cmd" ||
exit $?
5884 if test -n "$future_libdirs"; then
5885 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
5888 if test -n "$current_libdirs"; then
5889 # Maybe just do a dry run.
5890 test -n "$run" && current_libdirs
=" -n$current_libdirs"
5891 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
5897 # libtool finish mode
5899 modename
="$modename: finish"
5903 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
5906 libdirs
="$libdirs $dir"
5909 for libdir
in $libdirs; do
5910 if test -n "$finish_cmds"; then
5911 # Do each command in the finish commands.
5913 save_ifs
="$IFS"; IFS
='~'
5914 for cmd
in $cmds; do
5918 $run eval "$cmd" || admincmds
="$admincmds
5923 if test -n "$finish_eval"; then
5924 # Do the single finish_eval.
5925 eval cmds
=\"$finish_eval\"
5926 $run eval "$cmds" || admincmds
="$admincmds
5932 # Exit here if they wanted silent mode.
5933 test "$show" = : && exit $EXIT_SUCCESS
5935 $echo "----------------------------------------------------------------------"
5936 $echo "Libraries have been installed in:"
5937 for libdir
in $libdirs; do
5941 $echo "If you ever happen to want to link against installed libraries"
5942 $echo "in a given directory, LIBDIR, you must either use libtool, and"
5943 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
5944 $echo "flag during linking and do at least one of the following:"
5945 if test -n "$shlibpath_var"; then
5946 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
5947 $echo " during execution"
5949 if test -n "$runpath_var"; then
5950 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
5951 $echo " during linking"
5953 if test -n "$hardcode_libdir_flag_spec"; then
5955 eval flag
=\"$hardcode_libdir_flag_spec\"
5957 $echo " - use the \`$flag' linker flag"
5959 if test -n "$admincmds"; then
5960 $echo " - have your system administrator run these commands:$admincmds"
5962 if test -f /etc
/ld.so.conf
; then
5963 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
5966 $echo "See any operating system documentation about shared libraries for"
5967 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5968 $echo "----------------------------------------------------------------------"
5972 # libtool execute mode
5974 modename
="$modename: execute"
5976 # The first argument is the command name.
5978 if test -z "$cmd"; then
5979 $echo "$modename: you must specify a COMMAND" 1>&2
5984 # Handle -dlopen flags immediately.
5985 for file in $execute_dlfiles; do
5986 if test ! -f "$file"; then
5987 $echo "$modename: \`$file' is not a file" 1>&2
5995 # Check to see that this really is a libtool archive.
5996 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
5998 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6003 # Read the libtool library.
6007 # If there is no directory component, then add one.
6009 */* |
*\\*) .
$file ;;
6013 # Skip this library if it cannot be dlopened.
6014 if test -z "$dlname"; then
6015 # Warn if it was a shared library.
6016 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6020 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6021 test "X$dir" = "X$file" && dir
=.
6023 if test -f "$dir/$objdir/$dlname"; then
6026 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6032 # Just add the directory containing the .lo file.
6033 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6034 test "X$dir" = "X$file" && dir
=.
6038 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6043 # Get the absolute pathname.
6044 absdir
=`cd "$dir" && pwd`
6045 test -n "$absdir" && dir
="$absdir"
6047 # Now add the directory to shlibpath_var.
6048 if eval "test -z \"\$$shlibpath_var\""; then
6049 eval "$shlibpath_var=\"\$dir\""
6051 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6055 # This variable tells wrapper scripts just to set shlibpath_var
6056 # rather than running their programs.
6057 libtool_execute_magic
="$magic"
6059 # Check if any of the arguments is a wrapper script.
6066 # Do a test to see if this is really a libtool program.
6067 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6068 # If there is no directory component, then add one.
6070 */* |
*\\*) .
$file ;;
6074 # Transform arg to wrapped name.
6075 file="$progdir/$program"
6079 # Quote arguments (to preserve shell metacharacters).
6080 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6081 args
="$args \"$file\""
6084 if test -z "$run"; then
6085 if test -n "$shlibpath_var"; then
6086 # Export the shlibpath_var.
6087 eval "export $shlibpath_var"
6090 # Restore saved environment variables
6091 if test "${save_LC_ALL+set}" = set; then
6092 LC_ALL
="$save_LC_ALL"; export LC_ALL
6094 if test "${save_LANG+set}" = set; then
6095 LANG
="$save_LANG"; export LANG
6098 # Now prepare to actually exec the command.
6099 exec_cmd
="\$cmd$args"
6101 # Display what would be done.
6102 if test -n "$shlibpath_var"; then
6103 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6104 $echo "export $shlibpath_var"
6111 # libtool clean and uninstall mode
6113 modename
="$modename: $mode"
6119 # This variable tells wrapper scripts just to set variables rather
6120 # than running their programs.
6121 libtool_install_magic
="$magic"
6126 -f) rm="$rm $arg"; rmforce
=yes ;;
6127 -*) rm="$rm $arg" ;;
6128 *) files
="$files $arg" ;;
6132 if test -z "$rm"; then
6133 $echo "$modename: you must specify an RM program" 1>&2
6140 origobjdir
="$objdir"
6141 for file in $files; do
6142 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6143 if test "X$dir" = "X$file"; then
6145 objdir
="$origobjdir"
6147 objdir
="$dir/$origobjdir"
6149 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6150 test "$mode" = uninstall
&& objdir
="$dir"
6152 # Remember objdir for removal later, being careful to avoid duplicates
6153 if test "$mode" = clean
; then
6156 *) rmdirs
="$rmdirs $objdir" ;;
6160 # Don't error if the file doesn't exist and rm -f was used.
6161 if (test -L "$file") >/dev
/null
2>&1 \
6162 ||
(test -h "$file") >/dev
/null
2>&1 \
6163 ||
test -f "$file"; then
6165 elif test -d "$file"; then
6168 elif test "$rmforce" = yes; then
6176 # Possibly a libtool archive, so verify it.
6177 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6180 # Delete the libtool libraries and symlinks.
6181 for n
in $library_names; do
6182 rmfiles
="$rmfiles $objdir/$n"
6184 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6185 test "$mode" = clean
&& rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
6187 if test "$mode" = uninstall
; then
6188 if test -n "$library_names"; then
6189 # Do each command in the postuninstall commands.
6190 cmds
=$postuninstall_cmds
6191 save_ifs
="$IFS"; IFS
='~'
6192 for cmd
in $cmds; do
6197 if test "$?" -ne 0 && test "$rmforce" != yes; then
6204 if test -n "$old_library"; then
6205 # Do each command in the old_postuninstall commands.
6206 cmds
=$old_postuninstall_cmds
6207 save_ifs
="$IFS"; IFS
='~'
6208 for cmd
in $cmds; do
6213 if test "$?" -ne 0 && test "$rmforce" != yes; then
6219 # FIXME: should reinstall the best remaining shared library.
6225 # Possibly a libtool object, so verify it.
6226 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6231 # Add PIC object to the list of files to remove.
6232 if test -n "$pic_object" \
6233 && test "$pic_object" != none
; then
6234 rmfiles
="$rmfiles $dir/$pic_object"
6237 # Add non-PIC object to the list of files to remove.
6238 if test -n "$non_pic_object" \
6239 && test "$non_pic_object" != none
; then
6240 rmfiles
="$rmfiles $dir/$non_pic_object"
6246 if test "$mode" = clean
; then
6250 file=`$echo $file|${SED} 's,.exe$,,'`
6251 noexename
=`$echo $name|${SED} 's,.exe$,,'`
6252 # $file with .exe has already been added to rmfiles,
6253 # add $file without .exe
6254 rmfiles
="$rmfiles $file"
6257 # Do a test to see if this is a libtool program.
6258 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6262 # note $name still contains .exe if it was in $file originally
6263 # as does the version of $file that was added into $rmfiles
6264 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6265 if test "$fast_install" = yes && test -n "$relink_command"; then
6266 rmfiles
="$rmfiles $objdir/lt-$name"
6268 if test "X$noexename" != "X$name" ; then
6269 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
6275 $show "$rm $rmfiles"
6276 $run $rm $rmfiles || exit_status
=1
6278 objdir
="$origobjdir"
6280 # Try to remove the ${objdir}s in the directories where we deleted files
6281 for dir
in $rmdirs; do
6282 if test -d "$dir"; then
6284 $run rmdir $dir >/dev
/null
2>&1
6292 $echo "$modename: you must specify a MODE" 1>&2
6293 $echo "$generic_help" 1>&2
6298 if test -z "$exec_cmd"; then
6299 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6300 $echo "$generic_help" 1>&2
6303 fi # test -z "$show_help"
6305 if test -n "$exec_cmd"; then
6310 # We need to display help for each of the modes.
6313 "Usage: $modename [OPTION]... [MODE-ARG]...
6315 Provide generalized library-building support services.
6317 --config show all configuration variables
6318 --debug enable verbose shell tracing
6319 -n, --dry-run display commands without modifying any files
6320 --features display basic configuration information and exit
6321 --finish same as \`--mode=finish'
6322 --help display this help message and exit
6323 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6324 --quiet same as \`--silent'
6325 --silent don't print informational messages
6326 --tag=TAG use configuration variables from tag TAG
6327 --version print version information
6329 MODE must be one of the following:
6331 clean remove files from the build directory
6332 compile compile a source file into a libtool object
6333 execute automatically set library path, then run a program
6334 finish complete the installation of libtool libraries
6335 install install libraries or executables
6336 link create a library or an executable
6337 uninstall remove libraries from an installed directory
6339 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6340 a more detailed description of MODE.
6342 Report bugs to <bug-libtool@gnu.org>."
6348 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6350 Remove files from the build directory.
6352 RM is the name of the program to use to delete files associated with each FILE
6353 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6356 If FILE is a libtool library, object or program, all the files associated
6357 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6362 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6364 Compile a source file into a libtool library object.
6366 This mode accepts the following additional options:
6368 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6369 -prefer-pic try to building PIC objects only
6370 -prefer-non-pic try to building non-PIC objects only
6371 -static always build a \`.o' file suitable for static linking
6373 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6374 from the given SOURCEFILE.
6376 The output file name is determined by removing the directory component from
6377 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6378 library object suffix, \`.lo'."
6383 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6385 Automatically set library path, then run a program.
6387 This mode accepts the following additional options:
6389 -dlopen FILE add the directory containing FILE to the library path
6391 This mode sets the library path environment variable according to \`-dlopen'
6394 If any of the ARGS are libtool executable wrappers, then they are translated
6395 into their corresponding uninstalled binary, and any of their required library
6396 directories are added to the library path.
6398 Then, COMMAND is executed, with ARGS as arguments."
6403 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6405 Complete the installation of libtool libraries.
6407 Each LIBDIR is a directory that contains libtool libraries.
6409 The commands that this mode executes may require superuser privileges. Use
6410 the \`--dry-run' option if you just want to see what would be executed."
6415 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6417 Install executables or libraries.
6419 INSTALL-COMMAND is the installation command. The first component should be
6420 either the \`install' or \`cp' program.
6422 The rest of the components are interpreted as arguments to that command (only
6423 BSD-compatible install options are recognized)."
6428 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6430 Link object files or libraries together to form another library, or to
6431 create an executable program.
6433 LINK-COMMAND is a command using the C compiler that you would use to create
6434 a program from several object files.
6436 The following components of LINK-COMMAND are treated specially:
6438 -all-static do not do any dynamic linking at all
6439 -avoid-version do not add a version suffix if possible
6440 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6441 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6442 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6443 -export-symbols SYMFILE
6444 try to export only the symbols listed in SYMFILE
6445 -export-symbols-regex REGEX
6446 try to export only the symbols matching REGEX
6447 -LLIBDIR search LIBDIR for required installed libraries
6448 -lNAME OUTPUT-FILE requires the installed library libNAME
6449 -module build a library that can dlopened
6450 -no-fast-install disable the fast-install mode
6451 -no-install link a not-installable executable
6452 -no-undefined declare that a library does not refer to external symbols
6453 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6454 -objectlist FILE Use a list of object files found in FILE to specify objects
6455 -precious-files-regex REGEX
6456 don't remove output files matching REGEX
6457 -release RELEASE specify package release information
6458 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6459 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6460 -static do not do any dynamic linking of libtool libraries
6461 -version-info CURRENT[:REVISION[:AGE]]
6462 specify library version info [each variable defaults to 0]
6464 All other options (arguments beginning with \`-') are ignored.
6466 Every other argument is treated as a filename. Files ending in \`.la' are
6467 treated as uninstalled libtool libraries, other files are standard or library
6470 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6471 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6472 required, except when creating a convenience library.
6474 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6475 using \`ar' and \`ranlib', or on Windows using \`lib'.
6477 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6478 is created, otherwise an executable program is created."
6483 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
6485 Remove libraries from an installation directory.
6487 RM is the name of the program to use to delete files associated with each FILE
6488 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6491 If FILE is a libtool library, all the files associated with it are deleted.
6492 Otherwise, only FILE itself is deleted using RM."
6496 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6503 $echo "Try \`$modename --help' for more information about other modes."
6507 # The TAGs below are defined such that we never get into a situation
6508 # in which we disable both kinds of libraries. Given conflicting
6509 # choices, we go for a static library, that is the most portable,
6510 # since we can't tell whether shared libraries were disabled because
6511 # the user asked for that or because the platform doesn't support
6512 # them. This is particularly important on AIX, because we don't
6513 # support having both static and shared libraries enabled at the same
6514 # time on that platform, so we default to a shared-only configuration.
6515 # If a disable-shared tag is given, we'll fallback to a static-only
6516 # configuration. But we'll never go from static-only to shared-only.
6518 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6519 build_libtool_libs
=no
6521 # ### END LIBTOOL TAG CONFIG: disable-shared
6523 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
6524 build_old_libs
=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6525 # ### END LIBTOOL TAG CONFIG: disable-static