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, 2006,
5 # 2007, 2008 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.492 2008/01/30 06:40:56)"
49 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
50 if test -n "${ZSH_VERSION+set}" && (emulate sh
) >/dev
/null
2>&1; then
53 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
54 # is contrary to our usage. Disable this feature.
55 alias -g '${1+"$@"}'='"$@"'
58 case `(set -o) 2>/dev/null` in *posix
*) set -o posix
;; esac
60 BIN_SH
=xpg4
; export BIN_SH
# for Tru64
61 DUALCASE
=1; export DUALCASE
# for MKS sh
63 # Check that we have a working $echo.
64 if test "X$1" = X--no-reexec
; then
65 # Discard the --no-reexec flag, and continue.
67 elif test "X$1" = X--fallback-echo
; then
68 # Avoid inline document here, it may be left over
70 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
71 # Yippee, $echo works!
74 # Restart under the correct shell, and then maybe $echo will work.
75 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
78 if test "X$1" = X--fallback-echo
; then
79 # used as fallback echo
88 help="Try \`$progname --help' for more information."
89 magic
="%%%MAGIC variable%%%"
94 # Sed substitution that helps us do robust quoting. It backslashifies
95 # metacharacters that are still active within double-quoted strings.
96 Xsed
="${SED}"' -e 1s/^X//'
97 sed_quote_subst
='s/\([\\`\\"$\\\\]\)/\\\1/g'
98 # test EBCDIC or ASCII
99 case `echo X|tr X '\101'` in
100 A
) # ASCII based system
101 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
103 NL2SP
='tr \015\012 \040\040'
105 *) # EBCDIC based system
107 NL2SP
='tr \r\n \100\100'
112 # Only set LANG and LC_ALL to C if already set.
113 # These must not be set unconditionally because not all systems understand
114 # e.g. LANG=C (notably SCO).
115 # We save the old values to restore during execute mode.
117 for lt_var
in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
119 eval "if test \"\${$lt_var+set}\" = set; then
120 save_$lt_var=\$$lt_var
121 lt_env=\"$lt_var=\$$lt_var \$lt_env\"
127 if test -n "$lt_env"; then
131 # Make sure IFS has a sensible default
136 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
137 $echo "$modename: not configured to build any kind of library" 1>&2
138 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
153 lo2o
="s/\\.lo\$/.${objext}/"
154 o2lo
="s/\\.${objext}\$/.lo/"
158 #####################################
159 # Shell function definitions:
160 # This seems to be the best place for them
162 # func_mktempdir [string]
163 # Make a temporary directory that won't clash with other running
164 # libtool processes, and avoids race conditions if possible. If
165 # given, STRING is the basename for that directory.
168 my_template
="${TMPDIR-/tmp}/${1-$progname}"
170 if test "$run" = ":"; then
171 # Return a directory name, but don't create it in dry-run mode
172 my_tmpdir
="${my_template}-$$"
175 # If mktemp works, use that first and foremost
176 my_tmpdir
=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
178 if test ! -d "$my_tmpdir"; then
179 # Failing that, at least try and use $RANDOM to avoid a race
180 my_tmpdir
="${my_template}-${RANDOM-0}$$"
182 save_mktempdir_umask
=`umask`
185 umask $save_mktempdir_umask
188 # If we're not in dry-run mode, bomb out on failure
189 test -d "$my_tmpdir" ||
{
190 $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
195 $echo "X$my_tmpdir" |
$Xsed
199 # func_win32_libid arg
200 # return the library type of file 'arg'
202 # Need a lot of goo to handle *both* DLLs and import libs
203 # Has to be a shell function in order to 'eat' the argument
204 # that is supplied when $file_magic_command is called.
207 win32_libid_type
="unknown"
208 win32_fileres
=`file -L $1 2>/dev/null`
209 case $win32_fileres in
210 *ar\ archive\ import\ library
*) # definitely import
211 win32_libid_type
="x86 archive import"
213 *ar\ archive
*) # could be an import, or static
214 if eval $OBJDUMP -f $1 |
$SED -e '10q' 2>/dev
/null | \
215 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev
/null
; then
216 win32_nmres
=`eval $NM -f posix -A $1 | \
225 import
*) win32_libid_type
="x86 archive import";;
226 *) win32_libid_type
="x86 archive static";;
231 win32_libid_type
="x86 DLL"
233 *executable
*) # but shell scripts are "executable" too...
234 case $win32_fileres in
235 *MS\ Windows\ PE\ Intel
*)
236 win32_libid_type
="x86 DLL"
241 $echo $win32_libid_type
246 # Infer tagged configuration to use if any are available and
247 # if one wasn't chosen via the "--tag" command line option.
248 # Only attempt this if the compiler in the base compile
249 # command doesn't match the default compiler.
250 # arg is usually of the form 'gcc ...'
253 # Set the commonly-used compilers for some tags.
254 tag_compilers_CC
="*cc *xlc"
255 tag_compilers_CXX
="*++ *CC"
256 tag_compilers_F77
="*77 *fort"
257 base_compiler
=`set -- "$@"; $echo $1`
258 # If $tagname still isn't set, then try to infer if the default
259 # "CC" tag applies by matching up the base compile command to some
260 # compilers commonly used for the "CC" tag.
261 if test -z "$tagname"; then
263 eval "tag_compilers=\$tag_compilers_${z}"
264 if test -n "$tag_compilers"; then
265 for zp
in $tag_compilers; do
266 case $base_compiler in
268 # The compiler in the base compile command matches
269 # one of the common compilers for the current tag.
270 # Assume this is the tagged configuration we want.
278 if test -n "$available_tags" && test -z "$tagname"; then
282 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
286 CC_quoted
="$CC_quoted $arg"
289 # Blanks in the command may have been stripped by the calling shell,
290 # but not from the CC environment variable when configure was run.
291 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*) ;;
292 # Blanks at the start of $base_compile will cause this to fail
293 # if we don't check for them as well.
295 for z
in $available_tags; do
296 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev
/null
; then
297 # Evaluate the configuration.
298 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
301 # Double-quote args containing other shell metacharacters.
303 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
307 CC_quoted
="$CC_quoted $arg"
310 " $CC "* |
"$CC "* |
" `$echo $CC` "* |
"`$echo $CC` "* |
" $CC_quoted"* |
"$CC_quoted "* |
" `$echo $CC_quoted` "* |
"`$echo $CC_quoted` "*)
311 # The compiler in the base compile command matches
312 # the one in the tagged configuration.
313 # Assume this is the tagged configuration we want.
318 # If $tagname still isn't set, then try to infer it by
319 # matching up the base compile command to some compilers
320 # commonly used for certain tags.
321 base_compiler
=`set -- "$@"; $echo $1`
322 eval "tag_compilers=\$tag_compilers_${z}"
323 if test -n "$tag_compilers"; then
324 for zp
in $tag_compilers; do
325 case $base_compiler in
327 # The compiler in the base compile command matches
328 # one of the common compilers for the current tag.
329 # Assume this is the tagged configuration we want.
335 if test -n "$tagname"; then
341 # If $tagname still isn't set, then no tagged configuration
342 # was found and let the user know that the "--tag" command
343 # line option must be used.
344 if test -z "$tagname"; then
345 $echo "$modename: unable to infer tagged configuration"
346 $echo "$modename: specify a tag with \`--tag'" 1>&2
349 # $echo "$modename: using $tagname tagged configuration"
357 # func_extract_an_archive dir oldlib
358 func_extract_an_archive
()
360 f_ex_an_ar_dir
="$1"; shift
361 f_ex_an_ar_oldlib
="$1"
363 $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
364 $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" ||
exit $?
365 if ($AR t
"$f_ex_an_ar_oldlib" |
sort |
sort -uc >/dev
/null
2>&1); then
368 $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
373 # func_extract_archives gentop oldlib ...
374 func_extract_archives
()
376 my_gentop
="$1"; shift
384 $show "${rm}r $my_gentop"
385 $run ${rm}r
"$my_gentop"
386 $show "$mkdir $my_gentop"
387 $run $mkdir "$my_gentop"
389 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
393 for my_xlib
in $my_oldlibs; do
394 # Extract the objects.
396 [\\/]* |
[A-Za-z
]:[\\/]*) my_xabs
="$my_xlib" ;;
397 *) my_xabs
=`pwd`"/$my_xlib" ;;
399 my_xlib
=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
402 case " $extracted_archives " in
404 extracted_serial
=`expr $extracted_serial + 1`
405 my_xlib_u
=lt
$extracted_serial-$my_xlib ;;
409 extracted_archives
="$extracted_archives $my_xlib_u"
410 my_xdir
="$my_gentop/$my_xlib_u"
412 $show "${rm}r $my_xdir"
413 $run ${rm}r
"$my_xdir"
414 $show "$mkdir $my_xdir"
415 $run $mkdir "$my_xdir"
417 if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
422 $show "Extracting $my_xabs"
423 # Do not bother doing anything if just a dry run
424 if test -z "$run"; then
425 darwin_orig_dir
=`pwd`
426 cd $my_xdir ||
exit $?
427 darwin_archive
=$my_xabs
429 darwin_base_archive
=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
430 darwin_arches
=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
431 if test -n "$darwin_arches"; then
432 darwin_arches
=`echo "$darwin_arches" | $SED -e 's/.*are://'`
434 $show "$darwin_base_archive has multiple architectures $darwin_arches"
435 for darwin_arch
in $darwin_arches ; do
436 mkdir
-p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
437 lipo
-thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
438 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
439 func_extract_an_archive
"`pwd`" "${darwin_base_archive}"
441 $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
442 done # $darwin_arches
443 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
444 darwin_filelist
=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
447 for darwin_file
in $darwin_filelist; do
448 darwin_files
=`find unfat-$$ -name $darwin_file -print | $NL2SP`
449 lipo
-create -output "$darwin_file" $darwin_files
450 done # $darwin_filelist
452 cd "$darwin_orig_dir"
454 cd "$darwin_orig_dir"
455 func_extract_an_archive
"$my_xdir" "$my_xabs"
460 func_extract_an_archive
"$my_xdir" "$my_xabs"
463 my_oldobjs
="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
465 func_extract_archives_result
="$my_oldobjs"
467 # End of Shell function definitions
468 #####################################
471 eval std_shrext
=\"$shrext_cmds\"
475 # Parse our command line options once, thoroughly.
476 while test "$#" -gt 0
482 -*=*) optarg
=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
486 # If the previous option needs an argument, assign it.
487 if test -n "$prev"; then
490 execute_dlfiles
="$execute_dlfiles $arg"
494 preserve_args
="${preserve_args}=$arg"
496 # Check whether tagname contains only valid characters
499 $echo "$progname: invalid tag name: $tagname" 1>&2
506 # Don't test for the "default" C tag, as we know, it's there, but
507 # not specially marked.
510 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev
/null
; then
511 taglist
="$taglist $tagname"
512 # Evaluate the configuration.
513 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
515 $echo "$progname: ignoring unknown tag $tagname" 1>&2
530 # Have we seen a non-optional argument yet?
538 $PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
540 Copyright (C) 2008 Free Software Foundation, Inc.
541 This is free software; see the source for copying conditions. There is NO
542 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
547 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
548 # Now print the configurations for the tags.
549 for tagname
in $taglist; do
550 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
556 $echo "$progname: enabling shell trace mode"
558 preserve_args
="$preserve_args $arg"
567 if test "$build_libtool_libs" = yes; then
568 $echo "enable shared libraries"
570 $echo "disable shared libraries"
572 if test "$build_old_libs" = yes; then
573 $echo "enable static libraries"
575 $echo "disable static libraries"
580 --finish) mode
="finish" ;;
582 --mode) prevopt
="--mode" prev
=mode
;;
583 --mode=*) mode
="$optarg" ;;
585 --preserve-dup-deps) duplicate_deps
="yes" ;;
589 preserve_args
="$preserve_args $arg"
595 preserve_args
="$preserve_args --tag"
598 set tag
"$optarg" ${1+"$@"}
601 preserve_args
="$preserve_args --tag"
610 $echo "$modename: unrecognized option \`$arg'" 1>&2
622 if test -n "$prevopt"; then
623 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
628 case $disable_libs in
632 build_libtool_libs
=no
636 build_old_libs
=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
640 # If this variable is set in any of the actions, the command in it
641 # will be execed at the end. This prevents here-documents from being
642 # left over by shells.
645 if test -z "$show_help"; then
647 # Infer the operation mode.
648 if test -z "$mode"; then
649 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
650 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
652 *cc | cc
* |
*++ | gcc
* |
*-gcc* | g
++* | xlc
* |
*CC
)
664 *db |
*dbx |
*strace |
*truss
)
674 # If we have no mode, but dlfiles were specified, then do execute mode.
675 test -n "$execute_dlfiles" && mode
=execute
677 # Just use the default operation mode.
678 if test -z "$mode"; then
679 if test -n "$nonopt"; then
680 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
682 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
689 # Only execute mode is allowed to have -dlopen flags.
690 if test -n "$execute_dlfiles" && test "$mode" != execute
; then
691 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
696 # Change the help message to a mode-specific one.
698 help="Try \`$modename --help --mode=$mode' for more information."
700 # These modes are in order of execution frequency so that they run quickly.
702 # libtool compile mode
704 modename
="$modename: compile"
705 # Get the compilation command and the source file.
707 srcfile
="$nonopt" # always keep a non-empty value in "srcfile"
718 # do not "continue". Instead, add this to base_compile
730 # Accept any command-line options.
733 if test -n "$libobj" ; then
734 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
741 -static |
-prefer-pic |
-prefer-non-pic)
752 arg_mode
=arg
# the next one goes into the "base_compile" arg list
753 continue # The current "srcfile" will either be retained or
754 ;; # replaced later. I would guess that would be a bug.
757 args
=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
759 save_ifs
="$IFS"; IFS
=','
763 # Double-quote args containing other shell metacharacters.
764 # Many Bourne shells cannot handle close brackets correctly
765 # in scan sets, so we specify it separately.
767 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
771 lastarg
="$lastarg $arg"
774 lastarg
=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
776 # Add the arguments to base_compile.
777 base_compile
="$base_compile $lastarg"
782 # Accept the current argument as the source file.
783 # The previous "srcfile" becomes the current argument.
790 esac # case $arg_mode
792 # Aesthetically quote the previous argument.
793 lastarg
=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
796 # Double-quote args containing other shell metacharacters.
797 # Many Bourne shells cannot handle close brackets correctly
798 # in scan sets, and some SunOS ksh mistreat backslash-escaping
799 # in scan sets (worked around with variable expansion),
800 # and furthermore cannot handle '|' '&' '(' ')' in scan sets
801 # at all, so we specify them separately.
802 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
803 lastarg
="\"$lastarg\""
807 base_compile
="$base_compile $lastarg"
812 $echo "$modename: you must specify an argument for -Xcompile"
816 $echo "$modename: you must specify a target with \`-o'" 1>&2
820 # Get the name of the library object.
821 [ -z "$libobj" ] && libobj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
825 # Recognize several different file suffixes.
826 # If the user specifies -o file.o, it is replaced with file.lo
836 *.class
) xform
=class
;;
839 *.
[fF
][09]?
) xform
=[fF
][09].
;;
841 *.java
) xform
=java
;;
846 libobj
=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
849 *.lo
) obj
=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
851 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
856 func_infer_tag
$base_compile
858 for arg
in $later; do
877 qlibobj
=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
879 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
880 qlibobj
="\"$qlibobj\"" ;;
882 test "X$libobj" != "X$qlibobj" \
883 && $echo "X$libobj" |
grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
884 && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
885 objname
=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
886 xdir
=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
887 if test "X$xdir" = "X$obj"; then
892 lobj
=${xdir}$objdir/$objname
894 if test -z "$base_compile"; then
895 $echo "$modename: you must specify a compilation command" 1>&2
900 # Delete any leftover library objects.
901 if test "$build_old_libs" = yes; then
902 removelist
="$obj $lobj $libobj ${libobj}T"
904 removelist
="$lobj $libobj ${libobj}T"
908 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
910 # On Cygwin there's no "real" PIC flag so we must build both object types
912 cygwin
* | mingw
* | pw32
* | os2
*)
916 if test "$pic_mode" = no
&& test "$deplibs_check_method" != pass_all
; then
917 # non-PIC code in shared libraries is not supported
921 # Calculate the filename of the output object if compiler does
922 # not support -o with -c
923 if test "$compiler_c_o" = no
; then
924 output_obj
=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.
${objext}
925 lockfile
="$output_obj.lock"
926 removelist
="$removelist $output_obj $lockfile"
927 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
934 # Lock this critical section if it is needed
935 # We use this script file to make the link, it avoids creating a new file
936 if test "$need_locks" = yes; then
937 until $run ln "$progpath" "$lockfile" 2>/dev
/null
; do
938 $show "Waiting for $lockfile to be removed"
941 elif test "$need_locks" = warn
; then
942 if test -f "$lockfile"; then
944 *** ERROR, $lockfile exists and contains:
945 `cat $lockfile 2>/dev/null`
947 This indicates that another process is trying to use the same
948 temporary object file, and libtool could not work around it because
949 your compiler does not support \`-c' and \`-o' together. If you
950 repeat this compilation, it may succeed, by chance, but you had better
951 avoid parallel builds (make -j) in this platform, or get a better
957 $echo "$srcfile" > "$lockfile"
960 if test -n "$fix_srcfile_path"; then
961 eval srcfile
=\"$fix_srcfile_path\"
963 qsrcfile
=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
965 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
966 qsrcfile
="\"$qsrcfile\"" ;;
969 $run $rm "$libobj" "${libobj}T"
971 # Create a libtool object file (analogous to a ".la" file),
972 # but don't create it if we're doing a dry run.
973 test -z "$run" && cat > ${libobj}T
<<EOF
974 # $libobj - a libtool object file
975 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
977 # Please DO NOT delete this file!
978 # It is necessary for linking the library.
980 # Name of the PIC object.
983 # Only build a PIC object if we are building libtool libraries.
984 if test "$build_libtool_libs" = yes; then
985 # Without this assignment, base_compile gets emptied.
986 fbsd_hideous_sh_bug
=$base_compile
988 if test "$pic_mode" != no
; then
989 command="$base_compile $qsrcfile $pic_flag"
991 # Don't build PIC code
992 command="$base_compile $qsrcfile"
995 if test ! -d "${xdir}$objdir"; then
996 $show "$mkdir ${xdir}$objdir"
997 $run $mkdir ${xdir}$objdir
999 if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
1004 if test -z "$output_obj"; then
1005 # Place PIC objects in $objdir
1006 command="$command -o $lobj"
1009 $run $rm "$lobj" "$output_obj"
1012 if $run eval $lt_env "$command"; then :
1014 test -n "$output_obj" && $run $rm $removelist
1018 if test "$need_locks" = warn
&&
1019 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1021 *** ERROR, $lockfile contains:
1022 `cat $lockfile 2>/dev/null`
1024 but it should contain:
1027 This indicates that another process is trying to use the same
1028 temporary object file, and libtool could not work around it because
1029 your compiler does not support \`-c' and \`-o' together. If you
1030 repeat this compilation, it may succeed, by chance, but you had better
1031 avoid parallel builds (make -j) in this platform, or get a better
1034 $run $rm $removelist
1038 # Just move the object if needed, then go on to compile the next one
1039 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1040 $show "$mv $output_obj $lobj"
1041 if $run $mv $output_obj $lobj; then :
1044 $run $rm $removelist
1049 # Append the name of the PIC object to the libtool object file.
1050 test -z "$run" && cat >> ${libobj}T
<<EOF
1051 pic_object='$objdir/$objname'
1055 # Allow error messages only from the first compilation.
1056 if test "$suppress_opt" = yes; then
1057 suppress_output
=' >/dev/null 2>&1'
1060 # No PIC object so indicate it doesn't exist in the libtool
1062 test -z "$run" && cat >> ${libobj}T
<<EOF
1068 # Only build a position-dependent object if we build old libraries.
1069 if test "$build_old_libs" = yes; then
1070 if test "$pic_mode" != yes; then
1071 # Don't build PIC code
1072 command="$base_compile $qsrcfile"
1074 command="$base_compile $qsrcfile $pic_flag"
1076 if test "$compiler_c_o" = yes; then
1077 command="$command -o $obj"
1080 # Suppress compiler output if we already did a PIC compilation.
1081 command="$command$suppress_output"
1082 $run $rm "$obj" "$output_obj"
1084 if $run eval $lt_env "$command"; then :
1086 $run $rm $removelist
1090 if test "$need_locks" = warn
&&
1091 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1093 *** ERROR, $lockfile contains:
1094 `cat $lockfile 2>/dev/null`
1096 but it should contain:
1099 This indicates that another process is trying to use the same
1100 temporary object file, and libtool could not work around it because
1101 your compiler does not support \`-c' and \`-o' together. If you
1102 repeat this compilation, it may succeed, by chance, but you had better
1103 avoid parallel builds (make -j) in this platform, or get a better
1106 $run $rm $removelist
1110 # Just move the object if needed
1111 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1112 $show "$mv $output_obj $obj"
1113 if $run $mv $output_obj $obj; then :
1116 $run $rm $removelist
1121 # Append the name of the non-PIC object the libtool object file.
1122 # Only append if the libtool object file exists.
1123 test -z "$run" && cat >> ${libobj}T
<<EOF
1124 # Name of the non-PIC object.
1125 non_pic_object='$objname'
1129 # Append the name of the non-PIC object the libtool object file.
1130 # Only append if the libtool object file exists.
1131 test -z "$run" && cat >> ${libobj}T
<<EOF
1132 # Name of the non-PIC object.
1138 $run $mv "${libobj}T" "${libobj}"
1140 # Unlock the critical section if it was locked
1141 if test "$need_locks" != no
; then
1142 $run $rm "$lockfile"
1150 modename
="$modename: link"
1152 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1153 # It is impossible to link a dll without this setting, and
1154 # we shouldn't force the makefile maintainer to figure out
1155 # which system we are compiling for in order to pass an extra
1156 # flag for every libtool invocation.
1157 # allow_undefined=no
1159 # FIXME: Unfortunately, there are problems with the above when trying
1160 # to make a dll which has undefined symbols, in which case not
1161 # even a static library is built. For now, we need to specify
1162 # -no-undefined on the libtool link line when we can be certain
1163 # that all symbols are satisfied, otherwise we get a static library.
1170 libtool_args
="$nonopt"
1171 base_compile
="$nonopt $@"
1172 compile_command
="$nonopt"
1173 finalize_command
="$nonopt"
1186 lib_search_path
=`pwd`
1195 export_symbols_regex
=
1203 notinst_path
= # paths that contain not-installed libtool libraries
1204 precious_files_regex
=
1205 prefer_static_libs
=no
1217 single_module
="${wl}-single_module"
1219 func_infer_tag
$base_compile
1221 # We need to know -static, to get the right output filenames.
1225 -all-static |
-static |
-static-libtool-libs)
1228 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1229 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1231 if test -n "$link_static_flag"; then
1232 dlopen_self
=$dlopen_self_static
1234 prefer_static_libs
=yes
1237 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1238 dlopen_self
=$dlopen_self_static
1240 prefer_static_libs
=built
1242 -static-libtool-libs)
1243 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1244 dlopen_self
=$dlopen_self_static
1246 prefer_static_libs
=yes
1249 build_libtool_libs
=no
1256 # See if our shared archives depend on static archives.
1257 test -n "$old_archive_from_new_cmds" && build_old_libs
=yes
1259 # Go through the arguments, transforming them on the way.
1260 while test "$#" -gt 0; do
1264 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1265 qarg
=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1269 libtool_args
="$libtool_args $qarg"
1271 # If the previous option needs an argument, assign it.
1272 if test -n "$prev"; then
1275 compile_command
="$compile_command @OUTPUT@"
1276 finalize_command
="$finalize_command @OUTPUT@"
1282 if test "$preload" = no
; then
1283 # Add the symbol object into the linking commands.
1284 compile_command
="$compile_command @SYMFILE@"
1285 finalize_command
="$finalize_command @SYMFILE@"
1289 *.la |
*.lo
) ;; # We handle these cases below.
1291 if test "$dlself" = no
; then
1299 if test "$prev" = dlprefiles
; then
1301 elif test "$prev" = dlfiles
&& test "$dlopen_self" != yes; then
1311 if test "$prev" = dlfiles
; then
1312 dlfiles
="$dlfiles $arg"
1314 dlprefiles
="$dlprefiles $arg"
1322 export_symbols
="$arg"
1323 if test ! -f "$arg"; then
1324 $echo "$modename: symbol file \`$arg' does not exist"
1331 export_symbols_regex
="$arg"
1336 inst_prefix_dir
="$arg"
1341 precious_files_regex
="$arg"
1351 if test -f "$arg"; then
1354 for fil
in `cat $save_arg`
1356 # moreargs="$moreargs $fil"
1358 # A libtool-controlled object.
1360 # Check to see that this really is a libtool object.
1361 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1366 # If there is no directory component, then add one.
1368 */* |
*\\*) .
$arg ;;
1372 if test -z "$pic_object" || \
1373 test -z "$non_pic_object" ||
1374 test "$pic_object" = none
&& \
1375 test "$non_pic_object" = none
; then
1376 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1380 # Extract subdirectory from the argument.
1381 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1382 if test "X$xdir" = "X$arg"; then
1388 if test "$pic_object" != none
; then
1389 # Prepend the subdirectory the object is found in.
1390 pic_object
="$xdir$pic_object"
1392 if test "$prev" = dlfiles
; then
1393 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1394 dlfiles
="$dlfiles $pic_object"
1398 # If libtool objects are unsupported, then we need to preload.
1403 # CHECK ME: I think I busted this. -Ossama
1404 if test "$prev" = dlprefiles
; then
1405 # Preload the old-style object.
1406 dlprefiles
="$dlprefiles $pic_object"
1411 libobjs
="$libobjs $pic_object"
1416 if test "$non_pic_object" != none
; then
1417 # Prepend the subdirectory the object is found in.
1418 non_pic_object
="$xdir$non_pic_object"
1420 # A standard non-PIC object
1421 non_pic_objects
="$non_pic_objects $non_pic_object"
1422 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1423 arg
="$non_pic_object"
1426 # If the PIC object exists, use it instead.
1427 # $xdir was prepended to $pic_object above.
1428 non_pic_object
="$pic_object"
1429 non_pic_objects
="$non_pic_objects $non_pic_object"
1432 # Only an error if not doing a dry-run.
1433 if test -z "$run"; then
1434 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
1439 # Extract subdirectory from the argument.
1440 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1441 if test "X$xdir" = "X$arg"; then
1447 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
1448 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
1449 libobjs
="$libobjs $pic_object"
1450 non_pic_objects
="$non_pic_objects $non_pic_object"
1455 $echo "$modename: link input file \`$save_arg' does not exist"
1463 # We need an absolute path.
1465 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1467 $echo "$modename: only absolute run-paths are allowed" 1>&2
1471 # Canonicalise the pathname
1473 while test "$arg" != "$tmp"
1476 arg
=`$echo "X$arg" | $Xsed -e 's%[^/.][^/.]*/\.\.%%g' -e 's%/\./%/%g' -e 's%//*%/%g' -e 's%/$%%g'`
1478 if test "$prev" = rpath
; then
1481 *) rpath
="$rpath $arg" ;;
1486 *) xrpath
="$xrpath $arg" ;;
1493 compiler_flags
="$compiler_flags $qarg"
1495 compile_command
="$compile_command $qarg"
1496 finalize_command
="$finalize_command $qarg"
1500 linker_flags
="$linker_flags $qarg"
1501 compiler_flags
="$compiler_flags $wl$qarg"
1503 compile_command
="$compile_command $wl$qarg"
1504 finalize_command
="$finalize_command $wl$qarg"
1508 linker_flags
="$linker_flags $qarg"
1509 compiler_flags
="$compiler_flags $qarg"
1511 compile_command
="$compile_command $qarg"
1512 finalize_command
="$finalize_command $qarg"
1520 darwin_framework|darwin_framework_skip
)
1521 test "$prev" = "darwin_framework" && compiler_flags
="$compiler_flags $arg"
1522 compile_command
="$compile_command $arg"
1523 finalize_command
="$finalize_command $arg"
1528 eval "$prev=\"\$arg\""
1533 fi # test -n "$prev"
1539 if test -n "$link_static_flag"; then
1540 compile_command
="$compile_command $link_static_flag"
1541 finalize_command
="$finalize_command $link_static_flag"
1547 # FIXME: remove this flag sometime in the future.
1548 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1572 -export-symbols |
-export-symbols-regex)
1573 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
1574 $echo "$modename: more than one -exported-symbols argument is not allowed"
1577 if test "X$arg" = "X-export-symbols"; then
1585 -framework|
-arch|
-isysroot)
1587 *" ${arg} ${1} "* | *" ${arg} ${1} "*)
1588 prev
=darwin_framework_skip
;;
1589 *) compiler_flags
="$compiler_flags $arg"
1590 prev
=darwin_framework
;;
1592 compile_command
="$compile_command $arg"
1593 finalize_command
="$finalize_command $arg"
1602 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
1603 # so, if we see these flags be careful not to treat them like -L
1605 case $with_gcc/$host in
1606 no
/*-*-irix* |
/*-*-irix*)
1607 compile_command
="$compile_command $arg"
1608 finalize_command
="$finalize_command $arg"
1615 dir
=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1616 # We need an absolute path.
1618 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1620 absdir
=`cd "$dir" && pwd`
1621 if test -z "$absdir"; then
1622 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1624 notinst_path
="$notinst_path $dir"
1632 deplibs
="$deplibs -L$dir"
1633 lib_search_path
="$lib_search_path $dir"
1637 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
1638 testbindir
=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1639 case :$dllsearchpath: in
1641 *) dllsearchpath
="$dllsearchpath:$dir";;
1643 case :$dllsearchpath: in
1644 *":$testbindir:"*) ;;
1645 *) dllsearchpath
="$dllsearchpath:$testbindir";;
1653 if test "X$arg" = "X-lc" ||
test "X$arg" = "X-lm"; then
1655 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-beos*)
1656 # These systems don't actually have a C or math library (as such)
1660 # These systems don't actually have a C library (as such)
1661 test "X$arg" = "X-lc" && continue
1663 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1664 # Do not include libc due to us having libc/libc_r.
1665 test "X$arg" = "X-lc" && continue
1667 *-*-rhapsody* |
*-*-darwin1.
[012])
1668 # Rhapsody C and math libraries are in the System framework
1669 deplibs
="$deplibs -framework System"
1672 *-*-sco3.2v5
* |
*-*-sco5v6*)
1673 # Causes problems with __ctype
1674 test "X$arg" = "X-lc" && continue
1676 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
1677 # Compiler inserts libc in the correct place for threads to work
1678 test "X$arg" = "X-lc" && continue
1681 elif test "X$arg" = "X-lc_r"; then
1683 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
1684 # Do not include libc_r directly, use -pthread flag.
1689 deplibs
="$deplibs $arg"
1693 # Tru64 UNIX uses -model [arg] to determine the layout of C++
1694 # classes, name mangling, and exception handling.
1696 compile_command
="$compile_command $arg"
1697 compiler_flags
="$compiler_flags $arg"
1698 finalize_command
="$finalize_command $arg"
1703 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe|
-threads)
1704 compiler_flags
="$compiler_flags $arg"
1705 compile_command
="$compile_command $arg"
1706 finalize_command
="$finalize_command $arg"
1708 *-*-dragonfly*:-pthread)
1709 # pkgsrc hack to use -pthread in .la file for final linking
1710 deplibs
="$deplibs $arg"
1717 single_module
="${wl}-multi_module"
1726 # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
1727 # -r[0-9][0-9]* specifies the processor on the SGI compiler
1728 # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
1729 # +DA*, +DD* enable 64-bit mode on the HP compiler
1730 # -q* pass through compiler args for the IBM compiler
1731 # -m* pass through architecture-specific compiler args for GCC
1732 # -m*, -t[45]*, -txscale* pass through architecture-specific
1733 # compiler args for GCC
1734 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
1735 # -F/path gives path to uninstalled frameworks, gcc on darwin
1736 # @file GCC response files
1737 -64|
-mips[0-9]|
-r[0-9][0-9]*|
-xarch=*|
-xtarget=*|
+DA
*|
+DD
*|
-q*|
-m*| \
1738 -t[45]*|
-txscale*|
-p|
-pg|
--coverage|
-fprofile-*|
-F*|@
*)
1740 # Unknown arguments in both finalize_command and compile_command need
1741 # to be aesthetically quoted because they are evaled later.
1742 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1744 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1748 compile_command
="$compile_command $arg"
1749 finalize_command
="$finalize_command $arg"
1750 compiler_flags
="$compiler_flags $arg"
1766 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-darwin*)
1767 # The PATH hackery in wrapper scripts is required on Windows
1768 # and Darwin in order for the loader to find any dlls it needs.
1769 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1770 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1773 *) no_install
=yes ;;
1790 -precious-files-regex)
1811 dir
=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1812 # We need an absolute path.
1814 [\\/]* |
[A-Za-z
]:[\\/]*) ;;
1816 $echo "$modename: only absolute run-paths are allowed" 1>&2
1822 *) xrpath
="$xrpath $dir" ;;
1827 -static |
-static-libtool-libs)
1828 # The effects of -static are defined in a previous loop.
1829 # We used to do the same as -all-static on platforms that
1830 # didn't have a PIC flag, but the assumption that the effects
1831 # would be equivalent was wrong. It would break on at least
1832 # Digital Unix and AIX.
1852 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1854 save_ifs
="$IFS"; IFS
=','
1855 for flag
in $args; do
1858 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1863 compiler_flags
="$compiler_flags $flag"
1866 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1870 args
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1872 save_ifs
="$IFS"; IFS
=','
1873 for flag
in $args; do
1876 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1881 compiler_flags
="$compiler_flags $wl$flag"
1882 linker_flags
="$linker_flags $flag"
1885 arg
=`$echo "X$arg" | $Xsed -e "s/^ //"`
1903 # Some other compiler flag.
1905 # Unknown arguments in both finalize_command and compile_command need
1906 # to be aesthetically quoted because they are evaled later.
1907 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1909 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1916 # A standard object.
1921 # A libtool-controlled object.
1923 # Check to see that this really is a libtool object.
1924 if (${SED} -e '2q' $arg |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
1929 # If there is no directory component, then add one.
1931 */* |
*\\*) .
$arg ;;
1935 if test -z "$pic_object" || \
1936 test -z "$non_pic_object" ||
1937 test "$pic_object" = none
&& \
1938 test "$non_pic_object" = none
; then
1939 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
1943 # Extract subdirectory from the argument.
1944 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1945 if test "X$xdir" = "X$arg"; then
1951 if test "$pic_object" != none
; then
1952 # Prepend the subdirectory the object is found in.
1953 pic_object
="$xdir$pic_object"
1955 if test "$prev" = dlfiles
; then
1956 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1957 dlfiles
="$dlfiles $pic_object"
1961 # If libtool objects are unsupported, then we need to preload.
1966 # CHECK ME: I think I busted this. -Ossama
1967 if test "$prev" = dlprefiles
; then
1968 # Preload the old-style object.
1969 dlprefiles
="$dlprefiles $pic_object"
1974 libobjs
="$libobjs $pic_object"
1979 if test "$non_pic_object" != none
; then
1980 # Prepend the subdirectory the object is found in.
1981 non_pic_object
="$xdir$non_pic_object"
1983 # A standard non-PIC object
1984 non_pic_objects
="$non_pic_objects $non_pic_object"
1985 if test -z "$pic_object" ||
test "$pic_object" = none
; then
1986 arg
="$non_pic_object"
1989 # If the PIC object exists, use it instead.
1990 # $xdir was prepended to $pic_object above.
1991 non_pic_object
="$pic_object"
1992 non_pic_objects
="$non_pic_objects $non_pic_object"
1995 # Only an error if not doing a dry-run.
1996 if test -z "$run"; then
1997 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
2002 # Extract subdirectory from the argument.
2003 xdir
=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
2004 if test "X$xdir" = "X$arg"; then
2010 pic_object
=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
2011 non_pic_object
=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
2012 libobjs
="$libobjs $pic_object"
2013 non_pic_objects
="$non_pic_objects $non_pic_object"
2020 deplibs
="$deplibs $arg"
2021 old_deplibs
="$old_deplibs $arg"
2026 # A libtool-controlled library.
2028 if test "$prev" = dlfiles
; then
2029 # This library was specified with -dlopen.
2030 dlfiles
="$dlfiles $arg"
2032 elif test "$prev" = dlprefiles
; then
2033 # The library was specified with -dlpreopen.
2034 dlprefiles
="$dlprefiles $arg"
2037 deplibs
="$deplibs $arg"
2042 # Some other compiler argument.
2044 # Unknown arguments in both finalize_command and compile_command need
2045 # to be aesthetically quoted because they are evaled later.
2046 arg
=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
2048 *[\
[\~\
#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
2055 # Now actually substitute the argument into the commands.
2056 if test -n "$arg"; then
2057 compile_command
="$compile_command $arg"
2058 finalize_command
="$finalize_command $arg"
2060 done # argument parsing loop
2062 if test -n "$prev"; then
2063 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
2068 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
2069 eval arg
=\"$export_dynamic_flag_spec\"
2070 compile_command
="$compile_command $arg"
2071 finalize_command
="$finalize_command $arg"
2075 # calculate the name of the file, without its directory
2076 outputname
=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
2077 libobjs_save
="$libobjs"
2079 if test -n "$shlibpath_var"; then
2080 # get the directories listed in $shlibpath_var
2081 eval shlib_search_path
=\
`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
2085 eval sys_lib_search_path
=\"$sys_lib_search_path_spec\"
2086 eval sys_lib_dlsearch_path
=\"$sys_lib_dlsearch_path_spec\"
2088 output_objdir
=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2089 if test "X$output_objdir" = "X$output"; then
2090 output_objdir
="$objdir"
2092 output_objdir
="$output_objdir/$objdir"
2094 # Create the object directory.
2095 if test ! -d "$output_objdir"; then
2096 $show "$mkdir $output_objdir"
2097 $run $mkdir $output_objdir
2099 if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
2104 # Determine the type of output
2107 $echo "$modename: you must specify an output file" 1>&2
2111 *.
$libext) linkmode
=oldlib
;;
2112 *.lo |
*.
$objext) linkmode
=obj
;;
2113 *.la
) linkmode
=lib
;;
2114 *) linkmode
=prog
;; # Anything else should be a program.
2118 *cygwin
* |
*mingw
* |
*pw32
*)
2119 # don't eliminate duplications in $postdeps and $predeps
2120 duplicate_compiler_generated_deps
=yes
2123 duplicate_compiler_generated_deps
=$duplicate_deps
2129 # Find all interdependent deplibs by searching for libraries
2130 # that are linked more than once (e.g. -la -lb -la)
2131 for deplib
in $deplibs; do
2132 if test "X$duplicate_deps" = "Xyes" ; then
2134 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2137 libs
="$libs $deplib"
2140 if test "$linkmode" = lib
; then
2141 libs
="$predeps $libs $compiler_lib_search_path $postdeps"
2143 # Compute libraries that are listed more than once in $predeps
2144 # $postdeps and mark them as special (i.e., whose duplicates are
2145 # not to be eliminated).
2147 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
2148 for pre_post_dep
in $predeps $postdeps; do
2149 case "$pre_post_deps " in
2150 *" $pre_post_dep "*) specialdeplibs
="$specialdeplibs $pre_post_deps" ;;
2152 pre_post_deps
="$pre_post_deps $pre_post_dep"
2161 need_relink
=no
# whether we're linking any uninstalled libtool libraries
2162 notinst_deplibs
= # not-installed libtool libraries
2166 for file in $dlfiles $dlprefiles; do
2170 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
2182 passes
="conv scan dlopen dlpreopen link"
2187 for pass
in $passes; do
2188 if test "$linkmode,$pass" = "lib,link" ||
2189 test "$linkmode,$pass" = "prog,scan"; then
2193 if test "$linkmode" = prog
; then
2195 dlopen
) libs
="$dlfiles" ;;
2196 dlpreopen
) libs
="$dlprefiles" ;;
2197 link
) libs
="$deplibs %DEPLIBS% $dependency_libs" ;;
2200 if test "$pass" = dlopen
; then
2201 # Collect dlpreopened libraries
2202 save_deplibs
="$deplibs"
2205 for deplib
in $libs; do
2209 -mt|
-mthreads|
-kthread|
-Kthread|
-pthread|
-pthreads|
--thread-safe|
-threads)
2210 if test "$linkmode,$pass" = "prog,link"; then
2211 compile_deplibs
="$deplib $compile_deplibs"
2212 finalize_deplibs
="$deplib $finalize_deplibs"
2214 compiler_flags
="$compiler_flags $deplib"
2216 case $host:$deplib in
2217 *-*-dragonfly*:-pthread)
2218 # pkgsrc hack to use -pthread in .la file for final linking
2221 deplibs
="$deplib $deplibs"
2222 test "$pass" = conv
&& continue
2223 newdependency_libs
="$deplib $newdependency_libs"
2226 if test "$pass" = conv
; then
2227 deplibs
="$deplib $deplibs"
2230 if test "$pass" = scan
; then
2231 deplibs
="$deplib $deplibs"
2233 compile_deplibs
="$deplib $compile_deplibs"
2234 finalize_deplibs
="$deplib $finalize_deplibs"
2243 if test "$linkmode" != lib
&& test "$linkmode" != prog
; then
2244 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2247 name
=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2248 if test "$linkmode" = lib
; then
2249 searchdirs
="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
2251 searchdirs
="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
2253 for searchdir
in $searchdirs; do
2254 for search_ext
in .la
$std_shrext .so .a
; do
2255 # Search the libtool library
2256 lib
="$searchdir/lib${name}${search_ext}"
2257 if test -f "$lib"; then
2258 if test "$search_ext" = ".la"; then
2267 if test "$found" != yes; then
2268 # deplib doesn't seem to be a libtool library
2269 if test "$linkmode,$pass" = "prog,link"; then
2270 compile_deplibs
="$deplib $compile_deplibs"
2271 finalize_deplibs
="$deplib $finalize_deplibs"
2273 deplibs
="$deplib $deplibs"
2274 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2277 else # deplib is a libtool library
2278 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
2279 # We need to do some special things here, and not later.
2280 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
2281 case " $predeps $postdeps " in
2283 if (${SED} -e '2q' $lib |
2284 grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
2288 */* |
*\\*) .
$lib ;;
2291 for l
in $old_library $library_names; do
2294 if test "X$ll" = "X$old_library" ; then # only static version available
2296 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2297 test "X$ladir" = "X$lib" && ladir
="."
2298 lib
=$ladir/$old_library
2299 if test "$linkmode,$pass" = "prog,link"; then
2300 compile_deplibs
="$deplib $compile_deplibs"
2301 finalize_deplibs
="$deplib $finalize_deplibs"
2303 deplibs
="$deplib $deplibs"
2304 test "$linkmode" = lib
&& newdependency_libs
="$deplib $newdependency_libs"
2318 deplibs
="$deplib $deplibs"
2319 test "$pass" = conv
&& continue
2320 newdependency_libs
="$deplib $newdependency_libs"
2321 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2324 if test "$pass" = conv
; then
2325 deplibs
="$deplib $deplibs"
2328 if test "$pass" = scan
; then
2329 deplibs
="$deplib $deplibs"
2331 compile_deplibs
="$deplib $compile_deplibs"
2332 finalize_deplibs
="$deplib $finalize_deplibs"
2334 newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
2337 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
2343 if test "$pass" = link
; then
2344 dir
=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
2345 # Make sure the xrpath contains only unique directories.
2348 *) xrpath
="$xrpath $dir" ;;
2351 deplibs
="$deplib $deplibs"
2354 *.la
) lib
="$deplib" ;;
2356 if test "$pass" = conv
; then
2357 deplibs
="$deplib $deplibs"
2363 case $deplibs_check_method in
2365 set dummy
$deplibs_check_method
2366 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2367 if eval $echo \"$deplib\" 2>/dev
/null \
2369 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
2377 if test "$valid_a_lib" != yes; then
2379 $echo "*** Warning: Trying to link with static lib archive $deplib."
2380 $echo "*** I have the capability to make that library automatically link in when"
2381 $echo "*** you link to this library. But I can only do this if you have a"
2382 $echo "*** shared version of the library, which you do not appear to have"
2383 $echo "*** because the file extensions .$libext of this argument makes me believe"
2384 $echo "*** that it is just a static archive that I should not used here."
2387 $echo "*** Warning: Linking the shared library $output against the"
2388 $echo "*** static library $deplib is not portable!"
2389 deplibs
="$deplib $deplibs"
2394 if test "$pass" != link
; then
2395 deplibs
="$deplib $deplibs"
2397 compile_deplibs
="$deplib $compile_deplibs"
2398 finalize_deplibs
="$deplib $finalize_deplibs"
2405 if test "$pass" = conv
; then
2406 deplibs
="$deplib $deplibs"
2407 elif test "$linkmode" = prog
; then
2408 if test "$pass" = dlpreopen ||
test "$dlopen_support" != yes ||
test "$build_libtool_libs" = no
; then
2409 # If there is no dlopen support or we're linking statically,
2410 # we need to preload.
2411 newdlprefiles
="$newdlprefiles $deplib"
2412 compile_deplibs
="$deplib $compile_deplibs"
2413 finalize_deplibs
="$deplib $finalize_deplibs"
2415 newdlfiles
="$newdlfiles $deplib"
2425 if test "$found" = yes ||
test -f "$lib"; then :
2427 $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2431 # Check to see that this really is a libtool archive.
2432 if (${SED} -e '2q' $lib |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
2434 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2438 ladir
=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2439 test "X$ladir" = "X$lib" && ladir
="."
2447 # If the library was installed with an old release of libtool,
2448 # it will not redefine variables installed, or shouldnotlink
2456 */* |
*\\*) .
$lib ;;
2460 if test "$linkmode,$pass" = "lib,link" ||
2461 test "$linkmode,$pass" = "prog,scan" ||
2462 { test "$linkmode" != prog
&& test "$linkmode" != lib
; }; then
2463 test -n "$dlopen" && dlfiles
="$dlfiles $dlopen"
2464 test -n "$dlpreopen" && dlprefiles
="$dlprefiles $dlpreopen"
2467 if test "$pass" = conv
; then
2468 # Only check for convenience libraries
2469 deplibs
="$lib $deplibs"
2470 if test -z "$libdir"; then
2471 if test -z "$old_library"; then
2472 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2475 # It is a libtool convenience library, so add in its objects.
2476 convenience
="$convenience $ladir/$objdir/$old_library"
2477 old_convenience
="$old_convenience $ladir/$objdir/$old_library"
2479 for deplib
in $dependency_libs; do
2480 deplibs
="$deplib $deplibs"
2481 if test "X$duplicate_deps" = "Xyes" ; then
2482 case "$tmp_libs " in
2483 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2486 tmp_libs
="$tmp_libs $deplib"
2488 elif test "$linkmode" != prog
&& test "$linkmode" != lib
; then
2489 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2496 # Get the name of the library we link against.
2498 for l
in $old_library $library_names; do
2501 if test -z "$linklib"; then
2502 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
2506 # This library was specified with -dlopen.
2507 if test "$pass" = dlopen
; then
2508 if test -z "$libdir"; then
2509 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
2512 if test -z "$dlname" ||
2513 test "$dlopen_support" != yes ||
2514 test "$build_libtool_libs" = no
; then
2515 # If there is no dlname, no dlopen support or we're linking
2516 # statically, we need to preload. We also need to preload any
2517 # dependent libraries so libltdl's deplib preloader doesn't
2518 # bomb out in the load deplibs phase.
2519 dlprefiles
="$dlprefiles $lib $dependency_libs"
2521 newdlfiles
="$newdlfiles $lib"
2526 # We need an absolute path.
2528 [\\/]* |
[A-Za-z
]:[\\/]*) abs_ladir
="$ladir" ;;
2530 abs_ladir
=`cd "$ladir" && pwd`
2531 if test -z "$abs_ladir"; then
2532 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
2533 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
2538 laname
=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
2540 # Find the relevant object directory and library name.
2541 if test "X$installed" = Xyes
; then
2542 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2543 $echo "$modename: warning: library \`$lib' was moved." 1>&2
2551 test "X$hardcode_automatic" = Xyes
&& avoidtemprpath
=yes
2553 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
2556 # Remove this search path later
2557 notinst_path
="$notinst_path $abs_ladir"
2559 dir
="$ladir/$objdir"
2560 absdir
="$abs_ladir/$objdir"
2561 # Remove this search path later
2562 notinst_path
="$notinst_path $abs_ladir"
2564 fi # $installed = yes
2565 name
=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2567 # This library was specified with -dlpreopen.
2568 if test "$pass" = dlpreopen
; then
2569 if test -z "$libdir"; then
2570 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
2573 # Prefer using a static library (so that no silly _DYNAMIC symbols
2574 # are required to link).
2575 if test -n "$old_library"; then
2576 newdlprefiles
="$newdlprefiles $dir/$old_library"
2577 # Otherwise, use the dlname, so that lt_dlopen finds it.
2578 elif test -n "$dlname"; then
2579 newdlprefiles
="$newdlprefiles $dir/$dlname"
2581 newdlprefiles
="$newdlprefiles $dir/$linklib"
2583 fi # $pass = dlpreopen
2585 if test -z "$libdir"; then
2586 # Link the convenience library
2587 if test "$linkmode" = lib
; then
2588 deplibs
="$dir/$old_library $deplibs"
2589 elif test "$linkmode,$pass" = "prog,link"; then
2590 compile_deplibs
="$dir/$old_library $compile_deplibs"
2591 finalize_deplibs
="$dir/$old_library $finalize_deplibs"
2593 deplibs
="$lib $deplibs" # used for prog,scan pass
2599 if test "$linkmode" = prog
&& test "$pass" != link
; then
2600 newlib_search_path
="$newlib_search_path $ladir"
2601 deplibs
="$lib $deplibs"
2604 if test "$link_all_deplibs" != no ||
test -z "$library_names" ||
2605 test "$build_libtool_libs" = no
; then
2610 for deplib
in $dependency_libs; do
2612 -L*) newlib_search_path
="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2614 # Need to link against all dependency_libs?
2615 if test "$linkalldeplibs" = yes; then
2616 deplibs
="$deplib $deplibs"
2618 # Need to hardcode shared library paths
2619 # or/and link against static libraries
2620 newdependency_libs
="$deplib $newdependency_libs"
2622 if test "X$duplicate_deps" = "Xyes" ; then
2623 case "$tmp_libs " in
2624 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
2627 tmp_libs
="$tmp_libs $deplib"
2630 fi # $linkmode = prog...
2632 if test "$linkmode,$pass" = "prog,link"; then
2633 if test -n "$library_names" &&
2634 { { test "$prefer_static_libs" = no ||
2635 test "$prefer_static_libs,$installed" = "built,yes"; } ||
2636 test -z "$old_library"; }; then
2637 # We need to hardcode the library path
2638 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2639 # Make sure the rpath contains only unique directories.
2640 case "$temp_rpath " in
2643 *) temp_rpath
="$temp_rpath $absdir" ;;
2647 # Hardcode the library path.
2648 # Skip directories that are in the system default run-time
2650 case " $sys_lib_dlsearch_path " in
2653 case "$compile_rpath " in
2655 *) compile_rpath
="$compile_rpath $absdir"
2659 case " $sys_lib_dlsearch_path " in
2662 case "$finalize_rpath " in
2664 *) finalize_rpath
="$finalize_rpath $libdir"
2668 fi # $linkmode,$pass = prog,link...
2670 if test "$alldeplibs" = yes &&
2671 { test "$deplibs_check_method" = pass_all ||
2672 { test "$build_libtool_libs" = yes &&
2673 test -n "$library_names"; }; }; then
2674 # We only need to search for static libraries
2679 link_static
=no
# Whether the deplib will be linked statically
2680 use_static_libs
=$prefer_static_libs
2681 if test "$use_static_libs" = built
&& test "$installed" = yes ; then
2684 if test -n "$library_names" &&
2685 { test "$use_static_libs" = no ||
test -z "$old_library"; }; then
2686 if test "$installed" = no
; then
2687 notinst_deplibs
="$notinst_deplibs $lib"
2690 # This is a shared library
2692 # Warn about portability, can't link against -module's on
2693 # some systems (darwin)
2694 if test "$shouldnotlink" = yes && test "$pass" = link
; then
2696 if test "$linkmode" = prog
; then
2697 $echo "*** Warning: Linking the executable $output against the loadable module"
2699 $echo "*** Warning: Linking the shared library $output against the loadable module"
2701 $echo "*** $linklib is not portable!"
2703 if test "$linkmode" = lib
&&
2704 test "$hardcode_into_libs" = yes; then
2705 # Hardcode the library path.
2706 # Skip directories that are in the system default run-time
2708 case " $sys_lib_dlsearch_path " in
2711 case "$compile_rpath " in
2713 *) compile_rpath
="$compile_rpath $absdir"
2717 case " $sys_lib_dlsearch_path " in
2720 case "$finalize_rpath " in
2722 *) finalize_rpath
="$finalize_rpath $libdir"
2728 if test -n "$old_archive_from_expsyms_cmds"; then
2729 # figure out the soname
2730 set dummy
$library_names
2733 libname
=`eval \\$echo \"$libname_spec\"`
2734 # use dlname if we got it. it's perfectly good, no?
2735 if test -n "$dlname"; then
2737 elif test -n "$soname_spec"; then
2741 major
=`expr $current - $age`
2745 eval soname
=\"$soname_spec\"
2750 # Make a new name for the extract_expsyms_cmds to use
2752 soname
=`$echo $soroot | ${SED} -e 's/^.*\///'`
2753 newlib
="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
2755 # If the library has no export list, then create one now
2756 if test -f "$output_objdir/$soname-def"; then :
2758 $show "extracting exported symbol list from \`$soname'"
2759 save_ifs
="$IFS"; IFS
='~'
2760 cmds
=$extract_expsyms_cmds
2761 for cmd
in $cmds; do
2765 $run eval "$cmd" ||
exit $?
2771 if test -f "$output_objdir/$newlib"; then :; else
2772 $show "generating import library for \`$soname'"
2773 save_ifs
="$IFS"; IFS
='~'
2774 cmds
=$old_archive_from_expsyms_cmds
2775 for cmd
in $cmds; do
2779 $run eval "$cmd" ||
exit $?
2783 # make sure the library variables are pointing to the new library
2786 fi # test -n "$old_archive_from_expsyms_cmds"
2788 if test "$linkmode" = prog ||
test "$mode" != relink
; then
2793 case $hardcode_action in
2794 immediate | unsupported
)
2795 if test "$hardcode_direct" = no
; then
2798 *-*-sco3.2v5.0.
[024]*) add_dir
="-L$dir" ;;
2799 *-*-sysv4*uw2
*) add_dir
="-L$dir" ;;
2800 *-*-sysv5OpenUNIX* |
*-*-sysv5UnixWare7.
[01].
[10]* | \
2801 *-*-unixware7*) add_dir
="-L$dir" ;;
2803 # if the lib is a module then we can not link against
2804 # it, someone is ignoring the new warnings I added
2805 if /usr
/bin
/file -L $add 2> /dev
/null |
2806 $EGREP ": [^:]* bundle" >/dev
/null
; then
2807 $echo "** Warning, lib $linklib is a module, not a shared library"
2808 if test -z "$old_library" ; then
2810 $echo "** And there doesn't seem to be a static archive available"
2811 $echo "** The link will probably fail, sorry"
2813 add
="$dir/$old_library"
2817 elif test "$hardcode_minus_L" = no
; then
2819 *-*-sunos*) add_shlibpath
="$dir" ;;
2823 elif test "$hardcode_shlibpath_var" = no
; then
2824 add_shlibpath
="$dir"
2831 if test "$hardcode_direct" = yes; then
2833 elif test "$hardcode_minus_L" = yes; then
2835 # Try looking first in the location we're being installed to.
2836 if test -n "$inst_prefix_dir"; then
2839 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2844 elif test "$hardcode_shlibpath_var" = yes; then
2845 add_shlibpath
="$dir"
2854 if test "$lib_linked" != yes; then
2855 $echo "$modename: configuration error: unsupported hardcode properties"
2859 if test -n "$add_shlibpath"; then
2860 case :$compile_shlibpath: in
2861 *":$add_shlibpath:"*) ;;
2862 *) compile_shlibpath
="$compile_shlibpath$add_shlibpath:" ;;
2865 if test "$linkmode" = prog
; then
2866 test -n "$add_dir" && compile_deplibs
="$add_dir $compile_deplibs"
2867 test -n "$add" && compile_deplibs
="$add $compile_deplibs"
2869 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2870 test -n "$add" && deplibs
="$add $deplibs"
2871 if test "$hardcode_direct" != yes && \
2872 test "$hardcode_minus_L" != yes && \
2873 test "$hardcode_shlibpath_var" = yes; then
2874 case :$finalize_shlibpath: in
2876 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2882 if test "$linkmode" = prog ||
test "$mode" = relink
; then
2886 # Finalize command for both is simple: just hardcode it.
2887 if test "$hardcode_direct" = yes; then
2888 add
="$libdir/$linklib"
2889 elif test "$hardcode_minus_L" = yes; then
2892 elif test "$hardcode_shlibpath_var" = yes; then
2893 case :$finalize_shlibpath: in
2895 *) finalize_shlibpath
="$finalize_shlibpath$libdir:" ;;
2898 elif test "$hardcode_automatic" = yes; then
2899 if test -n "$inst_prefix_dir" &&
2900 test -f "$inst_prefix_dir$libdir/$linklib" ; then
2901 add
="$inst_prefix_dir$libdir/$linklib"
2903 add
="$libdir/$linklib"
2906 # We cannot seem to hardcode it, guess we'll fake it.
2908 # Try looking first in the location we're being installed to.
2909 if test -n "$inst_prefix_dir"; then
2912 add_dir
="$add_dir -L$inst_prefix_dir$libdir"
2919 if test "$linkmode" = prog
; then
2920 test -n "$add_dir" && finalize_deplibs
="$add_dir $finalize_deplibs"
2921 test -n "$add" && finalize_deplibs
="$add $finalize_deplibs"
2923 test -n "$add_dir" && deplibs
="$add_dir $deplibs"
2924 test -n "$add" && deplibs
="$add $deplibs"
2927 elif test "$linkmode" = prog
; then
2928 # Here we assume that one of hardcode_direct or hardcode_minus_L
2929 # is not unsupported. This is valid on all known static and
2931 if test "$hardcode_direct" != unsupported
; then
2932 test -n "$old_library" && linklib
="$old_library"
2933 compile_deplibs
="$dir/$linklib $compile_deplibs"
2934 finalize_deplibs
="$dir/$linklib $finalize_deplibs"
2936 compile_deplibs
="-l$name -L$dir $compile_deplibs"
2937 finalize_deplibs
="-l$name -L$dir $finalize_deplibs"
2939 elif test "$build_libtool_libs" = yes; then
2940 # Not a shared library
2941 if test "$deplibs_check_method" != pass_all
; then
2942 # We're trying link a shared library against a static one
2943 # but the system doesn't support it.
2945 # Just print a warning and add the library to dependency_libs so
2946 # that the program can be linked against the static library.
2948 $echo "*** Warning: This system can not link to static lib archive $lib."
2949 $echo "*** I have the capability to make that library automatically link in when"
2950 $echo "*** you link to this library. But I can only do this if you have a"
2951 $echo "*** shared version of the library, which you do not appear to have."
2952 if test "$module" = yes; then
2953 $echo "*** But as you try to build a module library, libtool will still create "
2954 $echo "*** a static module, that should work as long as the dlopening application"
2955 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
2956 if test -z "$global_symbol_pipe"; then
2958 $echo "*** However, this would only work if libtool was able to extract symbol"
2959 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2960 $echo "*** not find such a program. So, this module is probably useless."
2961 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
2963 if test "$build_old_libs" = no
; then
2964 build_libtool_libs
=module
2967 build_libtool_libs
=no
2971 deplibs
="$dir/$old_library $deplibs"
2974 fi # link shared/static library?
2976 if test "$linkmode" = lib
; then
2977 if test -n "$dependency_libs" &&
2978 { test "$hardcode_into_libs" != yes ||
2979 test "$build_old_libs" = yes ||
2980 test "$link_static" = yes; }; then
2981 # Extract -R from dependency_libs
2983 for libdir
in $dependency_libs; do
2985 -R*) temp_xrpath
=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2987 *" $temp_xrpath "*) ;;
2988 *) xrpath
="$xrpath $temp_xrpath";;
2990 *) temp_deplibs
="$temp_deplibs $libdir";;
2993 dependency_libs
="$temp_deplibs"
2996 newlib_search_path
="$newlib_search_path $absdir"
2997 # Link against this library
2998 test "$link_static" = no
&& newdependency_libs
="$abs_ladir/$laname $newdependency_libs"
2999 # ... and its dependency_libs
3001 for deplib
in $dependency_libs; do
3002 newdependency_libs
="$deplib $newdependency_libs"
3003 if test "X$duplicate_deps" = "Xyes" ; then
3004 case "$tmp_libs " in
3005 *" $deplib "*) specialdeplibs
="$specialdeplibs $deplib" ;;
3008 tmp_libs
="$tmp_libs $deplib"
3011 if test "$link_all_deplibs" != no
; then
3012 # Add the search paths of all dependency libraries
3013 for deplib
in $dependency_libs; do
3015 -L*) path
="$deplib" ;;
3017 dir
=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
3018 test "X$dir" = "X$deplib" && dir
="."
3019 # We need an absolute path.
3021 [\\/]* |
[A-Za-z
]:[\\/]*) absdir
="$dir" ;;
3023 absdir
=`cd "$dir" && pwd`
3024 if test -z "$absdir"; then
3025 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
3030 if grep "^installed=no" $deplib > /dev
/null
; then
3031 path
="$absdir/$objdir"
3033 eval libdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3034 if test -z "$libdir"; then
3035 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3038 if test "$absdir" != "$libdir"; then
3039 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
3046 # we do not want to link against static libs,
3047 # but need to link against shared
3048 eval deplibrary_names
=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
3049 eval deplibdir
=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3050 if test -n "$deplibrary_names" ; then
3051 for tmp
in $deplibrary_names ; do
3054 if test -f "$deplibdir/$depdepl" ; then
3055 depdepl
="$deplibdir/$depdepl"
3056 elif test -f "$path/$depdepl" ; then
3057 depdepl
="$path/$depdepl"
3059 # Can't find it, oh well...
3062 # do not add paths which are already there
3063 case " $newlib_search_path " in
3065 *) newlib_search_path
="$newlib_search_path $path";;
3078 # Again, we only want to link against shared libraries
3079 eval tmp_libs
=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
3080 for tmp
in $newlib_search_path ; do
3081 if test -f "$tmp/lib$tmp_libs.dylib" ; then
3082 eval depdepl
="$tmp/lib$tmp_libs.dylib"
3093 case " $deplibs " in
3095 *) deplibs
="$path $deplibs" ;;
3097 case " $deplibs " in
3099 *) deplibs
="$depdepl $deplibs" ;;
3102 fi # link_all_deplibs != no
3104 done # for deplib in $libs
3105 dependency_libs
="$newdependency_libs"
3106 if test "$pass" = dlpreopen
; then
3107 # Link the dlpreopened libraries before other libraries
3108 for deplib
in $save_deplibs; do
3109 deplibs
="$deplib $deplibs"
3112 if test "$pass" != dlopen
; then
3113 if test "$pass" != conv
; then
3114 # Make sure lib_search_path contains only unique directories.
3116 for dir
in $newlib_search_path; do
3117 case "$lib_search_path " in
3119 *) lib_search_path
="$lib_search_path $dir" ;;
3125 if test "$linkmode,$pass" != "prog,link"; then
3128 vars
="compile_deplibs finalize_deplibs"
3130 for var
in $vars dependency_libs
; do
3131 # Add libraries to $var in reverse order
3132 eval tmp_libs
=\"\$
$var\"
3134 for deplib
in $tmp_libs; do
3135 # FIXME: Pedantically, this is the right thing to do, so
3136 # that some nasty dependency loop isn't accidentally
3138 #new_libs="$deplib $new_libs"
3139 # Pragmatically, this seems to cause very few problems in
3142 -L*) new_libs
="$deplib $new_libs" ;;
3145 # And here is the reason: when a library appears more
3146 # than once as an explicit dependence of a library, or
3147 # is implicitly linked in more than once by the
3148 # compiler, it is considered special, and multiple
3149 # occurrences thereof are not removed. Compare this
3150 # with having the same library being listed as a
3151 # dependency of multiple other libraries: in this case,
3152 # we know (pedantically, we assume) the library does not
3153 # need to be listed more than once, so we keep only the
3154 # last copy. This is not always right, but it is rare
3155 # enough that we require users that really mean to play
3156 # such unportable linking tricks to link the library
3157 # using -Wl,-lname, so that libtool does not consider it
3158 # for duplicate removal.
3159 case " $specialdeplibs " in
3160 *" $deplib "*) new_libs
="$deplib $new_libs" ;;
3162 case " $new_libs " in
3164 *) new_libs
="$deplib $new_libs" ;;
3172 for deplib
in $new_libs; do
3175 case " $tmp_libs " in
3177 *) tmp_libs
="$tmp_libs $deplib" ;;
3180 *) tmp_libs
="$tmp_libs $deplib" ;;
3183 eval $var=\"$tmp_libs\"
3186 # Last step: remove runtime libs from dependency_libs
3187 # (they stay in deplibs)
3189 for i
in $dependency_libs ; do
3190 case " $predeps $postdeps $compiler_lib_search_path " in
3195 if test -n "$i" ; then
3196 tmp_libs
="$tmp_libs $i"
3199 dependency_libs
=$tmp_libs
3201 if test "$linkmode" = prog
; then
3202 dlfiles
="$newdlfiles"
3203 dlprefiles
="$newdlprefiles"
3210 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
3213 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
3214 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
3217 if test -n "$rpath"; then
3218 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
3221 if test -n "$xrpath"; then
3222 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
3225 if test -n "$vinfo"; then
3226 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
3229 if test -n "$release"; then
3230 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
3233 if test -n "$export_symbols" ||
test -n "$export_symbols_regex"; then
3234 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
3237 # Now set the variables for building old libraries.
3238 build_libtool_libs
=no
3240 objs
="$objs$old_deplibs"
3244 # Make sure we only generate libraries of the form `libNAME.la'.
3247 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
3248 eval shared_ext
=\"$shrext_cmds\"
3249 eval libname
=\"$libname_spec\"
3252 if test "$module" = no
; then
3253 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
3257 if test "$need_lib_prefix" != no
; then
3258 # Add the "lib" prefix for modules if required
3259 name
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3260 eval shared_ext
=\"$shrext_cmds\"
3261 eval libname
=\"$libname_spec\"
3263 libname
=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
3268 if test -n "$objs"; then
3269 if test "$deplibs_check_method" != pass_all
; then
3270 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
3274 $echo "*** Warning: Linking the shared library $output against the non-libtool"
3275 $echo "*** objects $objs is not portable!"
3276 libobjs
="$libobjs $objs"
3280 if test "$dlself" != no
; then
3281 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
3285 if test "$#" -gt 2; then
3286 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
3291 if test -z "$rpath"; then
3292 if test "$build_libtool_libs" = yes; then
3293 # Building a libtool convenience library.
3294 # Some compilers have problems with a `.al' extension so
3295 # convenience libraries should have the same extension an
3296 # archive normally would.
3297 oldlibs
="$output_objdir/$libname.$libext $oldlibs"
3298 build_libtool_libs
=convenience
3302 if test -n "$vinfo"; then
3303 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
3306 if test -n "$release"; then
3307 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
3311 # Parse the version information argument.
3312 save_ifs
="$IFS"; IFS
=':'
3313 set dummy
$vinfo 0 0 0
3316 if test -n "$8"; then
3317 $echo "$modename: too many parameters to \`-version-info'" 1>&2
3322 # convert absolute version numbers to libtool ages
3323 # this retains compatibility with .la files and attempts
3324 # to make the code below a bit more comprehensible
3326 case $vinfo_number in
3330 number_revision
="$4"
3332 # There are really only two kinds -- those that
3333 # use the current revision as the major version
3334 # and those that subtract age and use age as
3335 # a minor version. But, then there is irix
3336 # which has an extra 1 added just for fun
3338 case $version_type in
3339 darwin|linux|osf|windows|none
)
3340 current
=`expr $number_major + $number_minor`
3342 revision
="$number_revision"
3344 freebsd-aout|freebsd-elf|sunos
)
3345 current
="$number_major"
3346 revision
="$number_minor"
3350 current
=`expr $number_major + $number_minor`
3352 revision
="$number_minor"
3353 lt_irix_increment
=no
3364 # Check that each of the things are valid numbers.
3366 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]) ;;
3368 $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
3369 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3375 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]) ;;
3377 $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
3378 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3384 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]) ;;
3386 $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
3387 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3392 if test "$age" -gt "$current"; then
3393 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
3394 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3398 # Calculate the version variables.
3403 case $version_type in
3407 # Like Linux, but with the current version available in
3408 # verstring for coding it into the library header
3409 major
=.
`expr $current - $age`
3410 versuffix
="$major.$age.$revision"
3411 # Darwin ld doesn't like 0 for these options...
3412 minor_current
=`expr $current + 1`
3413 xlcverstring
="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
3414 verstring
="-compatibility_version $minor_current -current_version $minor_current.$revision"
3419 versuffix
=".$current.$revision";
3424 versuffix
=".$current";
3428 if test "X$lt_irix_increment" = "Xno"; then
3429 major
=`expr $current - $age`
3431 major
=`expr $current - $age + 1`
3433 case $version_type in
3434 nonstopux
) verstring_prefix
=nonstopux
;;
3435 *) verstring_prefix
=sgi
;;
3437 verstring
="$verstring_prefix$major.$revision"
3439 # Add in all the interfaces that we are compatible with.
3441 while test "$loop" -ne 0; do
3442 iface
=`expr $revision - $loop`
3443 loop
=`expr $loop - 1`
3444 verstring
="$verstring_prefix$major.$iface:$verstring"
3447 # Before this point, $major must not contain `.'.
3449 versuffix
="$major.$revision"
3453 major
=.
`expr $current - $age`
3454 versuffix
="$major.$age.$revision"
3455 versuffix2
="$major.$age"
3459 major
=.
`expr $current - $age`
3460 versuffix
=".$current.$age.$revision"
3461 verstring
="$current.$age.$revision"
3463 # Add in all the interfaces that we are compatible with.
3465 while test "$loop" -ne 0; do
3466 iface
=`expr $current - $loop`
3467 loop
=`expr $loop - 1`
3468 verstring
="$verstring:${iface}.0"
3471 # Make executables depend on our current version.
3472 verstring
="$verstring:${current}.0"
3477 versuffix
=".$current.$revision"
3481 # Use '-' rather than '.', since we only want one
3482 # extension on DOS 8.3 filesystems.
3483 major
=`expr $current - $age`
3488 $echo "$modename: unknown library version type \`$version_type'" 1>&2
3489 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
3494 # Clear the version info if we defaulted, and they specified a release.
3495 if test -z "$vinfo" && test -n "$release"; then
3497 case $version_type in
3499 # we can't check for "0.0" in archive_cmds due to quoting
3500 # problems, so we reset it completely
3507 if test "$need_version" = no
; then
3514 # Remove version info from name if versioning should be avoided
3515 if test "$avoid_version" = yes && test "$need_version" = no
; then
3522 # Check to see if the archive will have undefined symbols.
3523 if test "$allow_undefined" = yes; then
3524 if test "$allow_undefined_flag" = unsupported
; then
3525 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
3526 build_libtool_libs
=no
3530 # Don't allow undefined symbols.
3531 allow_undefined_flag
="$no_undefined_flag"
3535 if test "$mode" != relink
; then
3536 # Remove our outputs, but don't remove object files since they
3537 # may have been created when compiling PIC objects.
3539 tempremovelist
=`$echo "$output_objdir/*"`
3540 for p
in $tempremovelist; do
3544 $output_objdir/$outputname |
$output_objdir/$libname.
* |
$output_objdir/${libname}${release}.
*)
3545 if test "X$precious_files_regex" != "X"; then
3546 if echo $p |
$EGREP -e "$precious_files_regex" >/dev
/null
2>&1
3551 removelist
="$removelist $p"
3556 if test -n "$removelist"; then
3557 $show "${rm}r $removelist"
3558 $run ${rm}r
$removelist
3562 # Now set the variables for building old libraries.
3563 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience
; then
3564 oldlibs
="$oldlibs $output_objdir/$libname.$libext"
3566 # Transform .lo files to .o files.
3567 oldobjs
="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
3570 # Eliminate all temporary directories.
3571 #for path in $notinst_path; do
3572 # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
3573 # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
3574 # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3577 if test -n "$xrpath"; then
3578 # If the user specified any rpath flags, then add them.
3580 for libdir
in $xrpath; do
3581 temp_xrpath
="$temp_xrpath -R$libdir"
3582 case "$finalize_rpath " in
3584 *) finalize_rpath
="$finalize_rpath $libdir" ;;
3587 if test "$hardcode_into_libs" != yes ||
test "$build_old_libs" = yes; then
3588 dependency_libs
="$temp_xrpath $dependency_libs"
3592 # Make sure dlfiles contains only unique files that won't be dlpreopened
3593 old_dlfiles
="$dlfiles"
3595 for lib
in $old_dlfiles; do
3596 case " $dlprefiles $dlfiles " in
3598 *) dlfiles
="$dlfiles $lib" ;;
3602 # Make sure dlprefiles contains only unique files
3603 old_dlprefiles
="$dlprefiles"
3605 for lib
in $old_dlprefiles; do
3606 case "$dlprefiles " in
3608 *) dlprefiles
="$dlprefiles $lib" ;;
3612 if test "$build_libtool_libs" = yes; then
3613 if test -n "$rpath"; then
3615 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2* |
*-*-beos*)
3616 # these systems don't actually have a c library (as such)!
3618 *-*-rhapsody* |
*-*-darwin1.
[012])
3619 # Rhapsody C library is in the System framework
3620 deplibs
="$deplibs -framework System"
3623 # Don't link with libc until the a.out ld.so is fixed.
3625 *-*-openbsd* |
*-*-freebsd* |
*-*-dragonfly*)
3626 # Do not include libc due to us having libc/libc_r.
3628 *-*-sco3.2v5
* |
*-*-sco5v6*)
3629 # Causes problems with __ctype
3631 *-*-sysv4.2uw2
* |
*-*-sysv5* |
*-*-unixware* |
*-*-OpenUNIX*)
3632 # Compiler inserts libc in the correct place for threads to work
3635 # Add libc to deplibs on all other systems if necessary.
3636 if test "$build_libtool_need_lc" = "yes"; then
3637 deplibs
="$deplibs -lc"
3643 # Transform deplibs into only deplibs that can be linked in shared.
3645 libname_save
=$libname
3646 release_save
=$release
3647 versuffix_save
=$versuffix
3649 # I'm not sure if I'm treating the release correctly. I think
3650 # release should show up in the -l (ie -lgmp5) so we don't want to
3651 # add it in twice. Is that correct?
3657 case $deplibs_check_method in
3659 # Don't check for shared/static. Everything works.
3660 # This might be a little naive. We might want to check
3661 # whether the library exists or not. But this is on
3662 # osf3 & osf4 and I'm not really sure... Just
3663 # implementing what was already the behavior.
3667 # This code stresses the "libraries are programs" paradigm to its
3668 # limits. Maybe even breaks it. We compile a program, linking it
3669 # against the deplibs as a proxy for the library. Then we can check
3670 # whether they linked in statically or dynamically with ldd.
3672 cat > conftest.c
<<EOF
3673 int main() { return 0; }
3676 if $LTCC $LTCFLAGS -o conftest conftest.c
$deplibs; then
3677 ldd_output
=`ldd conftest`
3678 for i
in $deplibs; do
3679 name
=`expr $i : '-l\(.*\)'`
3680 # If $name is empty we are operating on a -L argument.
3681 if test "$name" != "" && test "$name" != "0"; then
3682 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3683 case " $predeps $postdeps " in
3685 newdeplibs
="$newdeplibs $i"
3690 if test -n "$i" ; then
3691 libname
=`eval \\$echo \"$libname_spec\"`
3692 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3693 set dummy
$deplib_matches
3695 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3696 newdeplibs
="$newdeplibs $i"
3700 $echo "*** Warning: dynamic linker does not accept needed library $i."
3701 $echo "*** I have the capability to make that library automatically link in when"
3702 $echo "*** you link to this library. But I can only do this if you have a"
3703 $echo "*** shared version of the library, which I believe you do not have"
3704 $echo "*** because a test_compile did reveal that the linker did not use it for"
3705 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
3709 newdeplibs
="$newdeplibs $i"
3713 # Error occurred in the first compile. Let's try to salvage
3714 # the situation: Compile a separate program for each library.
3715 for i
in $deplibs; do
3716 name
=`expr $i : '-l\(.*\)'`
3717 # If $name is empty we are operating on a -L argument.
3718 if test "$name" != "" && test "$name" != "0"; then
3720 if $LTCC $LTCFLAGS -o conftest conftest.c
$i; then
3721 ldd_output
=`ldd conftest`
3722 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3723 case " $predeps $postdeps " in
3725 newdeplibs
="$newdeplibs $i"
3730 if test -n "$i" ; then
3731 libname
=`eval \\$echo \"$libname_spec\"`
3732 deplib_matches
=`eval \\$echo \"$library_names_spec\"`
3733 set dummy
$deplib_matches
3735 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3736 newdeplibs
="$newdeplibs $i"
3740 $echo "*** Warning: dynamic linker does not accept needed library $i."
3741 $echo "*** I have the capability to make that library automatically link in when"
3742 $echo "*** you link to this library. But I can only do this if you have a"
3743 $echo "*** shared version of the library, which you do not appear to have"
3744 $echo "*** because a test_compile did reveal that the linker did not use this one"
3745 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
3751 $echo "*** Warning! Library $i is needed by this library but I was not able to"
3752 $echo "*** make it link in! You will probably need to install it or some"
3753 $echo "*** library that it depends on before this library will be fully"
3754 $echo "*** functional. Installing it before continuing would be even better."
3757 newdeplibs
="$newdeplibs $i"
3763 set dummy
$deplibs_check_method
3764 file_magic_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3765 for a_deplib
in $deplibs; do
3766 name
=`expr $a_deplib : '-l\(.*\)'`
3767 # If $name is empty we are operating on a -L argument.
3768 if test "$name" != "" && test "$name" != "0"; then
3769 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3770 case " $predeps $postdeps " in
3772 newdeplibs
="$newdeplibs $a_deplib"
3777 if test -n "$a_deplib" ; then
3778 libname
=`eval \\$echo \"$libname_spec\"`
3779 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3780 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3781 for potent_lib
in $potential_libs; do
3782 # Follow soft links.
3783 if ls -lLd "$potent_lib" 2>/dev
/null \
3784 |
grep " -> " >/dev
/null
; then
3787 # The statement above tries to avoid entering an
3788 # endless loop below, in case of cyclic links.
3789 # We might still enter an endless loop, since a link
3790 # loop can be closed while we follow links,
3792 potlib
="$potent_lib"
3793 while test -h "$potlib" 2>/dev
/null
; do
3794 potliblink
=`ls -ld $potlib | ${SED} 's/.* -> //'`
3796 [\\/]* |
[A-Za-z
]:[\\/]*) potlib
="$potliblink";;
3797 *) potlib
=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3800 if eval $file_magic_cmd \"\
$potlib\" 2>/dev
/null \
3802 |
$EGREP "$file_magic_regex" > /dev
/null
; then
3803 newdeplibs
="$newdeplibs $a_deplib"
3810 if test -n "$a_deplib" ; then
3813 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3814 $echo "*** I have the capability to make that library automatically link in when"
3815 $echo "*** you link to this library. But I can only do this if you have a"
3816 $echo "*** shared version of the library, which you do not appear to have"
3817 $echo "*** because I did check the linker path looking for a file starting"
3818 if test -z "$potlib" ; then
3819 $echo "*** with $libname but no candidates were found. (...for file magic test)"
3821 $echo "*** with $libname and none of the candidates passed a file format test"
3822 $echo "*** using a file magic. Last file checked: $potlib"
3826 # Add a -L argument.
3827 newdeplibs
="$newdeplibs $a_deplib"
3829 done # Gone through all deplibs.
3832 set dummy
$deplibs_check_method
3833 match_pattern_regex
=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3834 for a_deplib
in $deplibs; do
3835 name
=`expr $a_deplib : '-l\(.*\)'`
3836 # If $name is empty we are operating on a -L argument.
3837 if test -n "$name" && test "$name" != "0"; then
3838 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3839 case " $predeps $postdeps " in
3841 newdeplibs
="$newdeplibs $a_deplib"
3846 if test -n "$a_deplib" ; then
3847 libname
=`eval \\$echo \"$libname_spec\"`
3848 for i
in $lib_search_path $sys_lib_search_path $shlib_search_path; do
3849 potential_libs
=`ls $i/$libname[.-]* 2>/dev/null`
3850 for potent_lib
in $potential_libs; do
3851 potlib
="$potent_lib" # see symlink-check above in file_magic test
3852 if eval $echo \"$potent_lib\" 2>/dev
/null \
3854 |
$EGREP "$match_pattern_regex" > /dev
/null
; then
3855 newdeplibs
="$newdeplibs $a_deplib"
3862 if test -n "$a_deplib" ; then
3865 $echo "*** Warning: linker path does not have real file for library $a_deplib."
3866 $echo "*** I have the capability to make that library automatically link in when"
3867 $echo "*** you link to this library. But I can only do this if you have a"
3868 $echo "*** shared version of the library, which you do not appear to have"
3869 $echo "*** because I did check the linker path looking for a file starting"
3870 if test -z "$potlib" ; then
3871 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
3873 $echo "*** with $libname and none of the candidates passed a file format test"
3874 $echo "*** using a regex pattern. Last file checked: $potlib"
3878 # Add a -L argument.
3879 newdeplibs
="$newdeplibs $a_deplib"
3881 done # Gone through all deplibs.
3885 tmp_deplibs
=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3886 -e 's/ -[LR][^ ]*//g'`
3887 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3888 for i
in $predeps $postdeps ; do
3889 # can't use Xsed below, because $i might contain '/'
3890 tmp_deplibs
=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
3893 if $echo "X $tmp_deplibs" |
$Xsed -e 's/[ ]//g' \
3894 |
grep .
>/dev
/null
; then
3896 if test "X$deplibs_check_method" = "Xnone"; then
3897 $echo "*** Warning: inter-library dependencies are not supported in this platform."
3899 $echo "*** Warning: inter-library dependencies are not known to be supported."
3901 $echo "*** All declared inter-library dependencies are being dropped."
3906 versuffix
=$versuffix_save
3908 release
=$release_save
3909 libname
=$libname_save
3913 *-*-rhapsody* |
*-*-darwin1.
[012])
3914 # On Rhapsody replace the C library is the System framework
3915 newdeplibs
=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
3919 if test "$droppeddeps" = yes; then
3920 if test "$module" = yes; then
3922 $echo "*** Warning: libtool could not satisfy all declared inter-library"
3923 $echo "*** dependencies of module $libname. Therefore, libtool will create"
3924 $echo "*** a static module, that should work as long as the dlopening"
3925 $echo "*** application is linked with the -dlopen flag."
3926 if test -z "$global_symbol_pipe"; then
3928 $echo "*** However, this would only work if libtool was able to extract symbol"
3929 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
3930 $echo "*** not find such a program. So, this module is probably useless."
3931 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
3933 if test "$build_old_libs" = no
; then
3934 oldlibs
="$output_objdir/$libname.$libext"
3935 build_libtool_libs
=module
3938 build_libtool_libs
=no
3941 $echo "*** The inter-library dependencies that have been dropped here will be"
3942 $echo "*** automatically added whenever a program is linked with this library"
3943 $echo "*** or is declared to -dlopen it."
3945 if test "$allow_undefined" = no
; then
3947 $echo "*** Since this library must not contain undefined symbols,"
3948 $echo "*** because either the platform does not support them or"
3949 $echo "*** it was explicitly requested with -no-undefined,"
3950 $echo "*** libtool will only create a static version of it."
3951 if test "$build_old_libs" = no
; then
3952 oldlibs
="$output_objdir/$libname.$libext"
3953 build_libtool_libs
=module
3956 build_libtool_libs
=no
3961 # Done checking deplibs!
3966 # move library search paths that coincide with paths to not yet
3967 # installed libraries to the beginning of the library search list
3969 for path
in $notinst_path; do
3970 case " $new_libs " in
3971 *" -L$path/$objdir "*) ;;
3973 case " $deplibs " in
3974 *" -L$path/$objdir "*)
3975 new_libs
="$new_libs -L$path/$objdir" ;;
3980 for deplib
in $deplibs; do
3983 case " $new_libs " in
3985 *) new_libs
="$new_libs $deplib" ;;
3988 *) new_libs
="$new_libs $deplib" ;;
3994 # All the library-specific variables (install_libdir is set above).
3999 # Test again, we may have decided not to build it any more
4000 if test "$build_libtool_libs" = yes; then
4001 if test "$hardcode_into_libs" = yes; then
4002 # Hardcode the library paths
4005 rpath
="$finalize_rpath"
4006 test "$mode" != relink
&& rpath
="$compile_rpath$rpath"
4007 for libdir
in $rpath; do
4008 if test -n "$hardcode_libdir_flag_spec"; then
4009 if test -n "$hardcode_libdir_separator"; then
4010 if test -z "$hardcode_libdirs"; then
4011 hardcode_libdirs
="$libdir"
4013 # Just accumulate the unique libdirs.
4014 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4015 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4018 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4023 eval flag
=\"$hardcode_libdir_flag_spec\"
4024 dep_rpath
="$dep_rpath $flag"
4026 elif test -n "$runpath_var"; then
4027 case "$perm_rpath " in
4029 *) perm_rpath
="$perm_rpath $libdir" ;;
4033 # Substitute the hardcoded libdirs into the rpath.
4034 if test -n "$hardcode_libdir_separator" &&
4035 test -n "$hardcode_libdirs"; then
4036 libdir
="$hardcode_libdirs"
4037 if test -n "$hardcode_libdir_flag_spec_ld"; then
4038 case $archive_cmds in
4039 *\
$LD*) eval dep_rpath
=\"$hardcode_libdir_flag_spec_ld\" ;;
4040 *) eval dep_rpath
=\"$hardcode_libdir_flag_spec\" ;;
4043 eval dep_rpath
=\"$hardcode_libdir_flag_spec\"
4046 if test -n "$runpath_var" && test -n "$perm_rpath"; then
4047 # We should set the runpath_var.
4049 for dir
in $perm_rpath; do
4052 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
4054 test -n "$dep_rpath" && deplibs
="$dep_rpath $deplibs"
4057 shlibpath
="$finalize_shlibpath"
4058 test "$mode" != relink
&& shlibpath
="$compile_shlibpath$shlibpath"
4059 if test -n "$shlibpath"; then
4060 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
4063 # Get the real and link names of the library.
4064 eval shared_ext
=\"$shrext_cmds\"
4065 eval library_names
=\"$library_names_spec\"
4066 set dummy
$library_names
4070 if test -n "$soname_spec"; then
4071 eval soname
=\"$soname_spec\"
4075 if test -z "$dlname"; then
4079 lib
="$output_objdir/$realname"
4083 linknames
="$linknames $link"
4086 # Use standard objects if they are pic
4087 test -z "$pic_flag" && libobjs
=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4089 # Prepare the list of exported symbols
4090 if test -z "$export_symbols"; then
4091 if test "$always_export_symbols" = yes ||
test -n "$export_symbols_regex"; then
4092 $show "generating symbol list for \`$libname.la'"
4093 export_symbols
="$output_objdir/$libname.exp"
4094 $run $rm $export_symbols
4095 cmds
=$export_symbols_cmds
4096 save_ifs
="$IFS"; IFS
='~'
4097 for cmd
in $cmds; do
4100 if len
=`expr "X$cmd" : ".*"` &&
4101 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4103 $run eval "$cmd" ||
exit $?
4104 skipped_export
=false
4106 # The command line is too long to execute in one step.
4107 $show "using reloadable object file for export list..."
4109 # Break out early, otherwise skipped_export may be
4110 # set to false by a later but shorter cmd.
4115 if test -n "$export_symbols_regex"; then
4116 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
4117 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
4118 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
4119 $run eval '$mv "${export_symbols}T" "$export_symbols"'
4124 if test -n "$export_symbols" && test -n "$include_expsyms"; then
4125 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
4129 for test_deplib
in $deplibs; do
4130 case " $convenience " in
4131 *" $test_deplib "*) ;;
4133 tmp_deplibs
="$tmp_deplibs $test_deplib"
4137 deplibs
="$tmp_deplibs"
4139 if test -n "$convenience"; then
4140 if test -n "$whole_archive_flag_spec"; then
4141 save_libobjs
=$libobjs
4142 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4144 gentop
="$output_objdir/${outputname}x"
4145 generated
="$generated $gentop"
4147 func_extract_archives
$gentop $convenience
4148 libobjs
="$libobjs $func_extract_archives_result"
4152 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4153 eval flag
=\"$thread_safe_flag_spec\"
4154 linker_flags
="$linker_flags $flag"
4157 # Make a backup of the uninstalled library when relinking
4158 if test "$mode" = relink
; then
4159 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' ||
exit $?
4162 # Do each of the archive commands.
4163 if test "$module" = yes && test -n "$module_cmds" ; then
4164 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4165 eval test_cmds
=\"$module_expsym_cmds\"
4166 cmds
=$module_expsym_cmds
4168 eval test_cmds
=\"$module_cmds\"
4172 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4173 eval test_cmds
=\"$archive_expsym_cmds\"
4174 cmds
=$archive_expsym_cmds
4176 eval test_cmds
=\"$archive_cmds\"
4181 if test "X$skipped_export" != "X:" &&
4182 len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4183 test "$len" -le "$max_cmd_len" ||
test "$max_cmd_len" -le -1; then
4186 # The command line is too long to link in one step, link piecewise.
4187 $echo "creating reloadable object files..."
4189 # Save the value of $output and $libobjs because we want to
4190 # use them later. If we have whole_archive_flag_spec, we
4191 # want to use save_libobjs as it was before
4192 # whole_archive_flag_spec was expanded, because we can't
4193 # assume the linker understands whole_archive_flag_spec.
4194 # This may have to be revisited, in case too many
4195 # convenience libraries get linked in and end up exceeding
4197 if test -z "$convenience" ||
test -z "$whole_archive_flag_spec"; then
4198 save_libobjs
=$libobjs
4201 output_la
=`$echo "X$output" | $Xsed -e "$basename"`
4203 # Clear the reloadable object creation command queue and
4204 # initialize k to one.
4211 output
=$output_objdir/$output_la-${k}.
$objext
4212 # Loop over the list of objects to be linked.
4213 for obj
in $save_libobjs
4215 eval test_cmds
=\"$reload_cmds $objlist $last_robj\"
4216 if test "X$objlist" = X ||
4217 { len
=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
4218 test "$len" -le "$max_cmd_len"; }; then
4219 objlist
="$objlist $obj"
4221 # The command $test_cmds is almost too long, add a
4222 # command to the queue.
4223 if test "$k" -eq 1 ; then
4224 # The first file doesn't have a previous command to add.
4225 eval concat_cmds
=\"$reload_cmds $objlist $last_robj\"
4227 # All subsequent reloadable object files will link in
4228 # the last one created.
4229 eval concat_cmds
=\"\
$concat_cmds~
$reload_cmds $objlist $last_robj\"
4231 last_robj
=$output_objdir/$output_la-${k}.
$objext
4233 output
=$output_objdir/$output_la-${k}.
$objext
4238 # Handle the remaining objects by creating one last
4239 # reloadable object file. All subsequent reloadable object
4240 # files will link in the last one created.
4241 test -z "$concat_cmds" || concat_cmds
=$concat_cmds~
4242 eval concat_cmds
=\"\
${concat_cmds}$reload_cmds $objlist $last_robj\"
4244 if ${skipped_export-false}; then
4245 $show "generating symbol list for \`$libname.la'"
4246 export_symbols
="$output_objdir/$libname.exp"
4247 $run $rm $export_symbols
4249 # Append the command to create the export file.
4250 eval concat_cmds
=\"\
$concat_cmds~
$export_symbols_cmds\"
4253 # Set up a command to remove the reloadable object files
4254 # after they are used.
4256 while test "$i" -lt "$k"
4259 delfiles
="$delfiles $output_objdir/$output_la-${i}.$objext"
4262 $echo "creating a temporary reloadable object file: $output"
4264 # Loop through the commands generated above and execute them.
4265 save_ifs
="$IFS"; IFS
='~'
4266 for cmd
in $concat_cmds; do
4269 $run eval "$cmd" ||
exit $?
4274 # Restore the value of output.
4277 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
4278 eval libobjs
=\"\
$libobjs $whole_archive_flag_spec\"
4280 # Expand the library linking commands again to reset the
4281 # value of $libobjs for piecewise linking.
4283 # Do each of the archive commands.
4284 if test "$module" = yes && test -n "$module_cmds" ; then
4285 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
4286 cmds
=$module_expsym_cmds
4291 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
4292 cmds
=$archive_expsym_cmds
4298 # Append the command to remove the reloadable object files
4299 # to the just-reset $cmds.
4300 eval cmds
=\"\
$cmds~\
$rm $delfiles\"
4302 save_ifs
="$IFS"; IFS
='~'
4303 for cmd
in $cmds; do
4307 $run eval "$cmd" ||
{
4310 # Restore the uninstalled library and exit
4311 if test "$mode" = relink
; then
4312 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
4320 # Restore the uninstalled library and exit
4321 if test "$mode" = relink
; then
4322 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' ||
exit $?
4324 if test -n "$convenience"; then
4325 if test -z "$whole_archive_flag_spec"; then
4326 $show "${rm}r $gentop"
4327 $run ${rm}r
"$gentop"
4334 # Create links to the real library.
4335 for linkname
in $linknames; do
4336 if test "$realname" != "$linkname"; then
4337 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
4338 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' ||
exit $?
4342 # If -module or -export-dynamic was specified, set the dlname.
4343 if test "$module" = yes ||
test "$export_dynamic" = yes; then
4344 # On all known operating systems, these are identical.
4353 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
4356 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4357 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
4360 if test -n "$rpath"; then
4361 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
4364 if test -n "$xrpath"; then
4365 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
4368 if test -n "$vinfo"; then
4369 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
4372 if test -n "$release"; then
4373 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
4378 if test -n "$objs$old_deplibs"; then
4379 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
4383 obj
=`$echo "X$output" | $Xsed -e "$lo2o"`
4391 # Delete the old objects.
4392 $run $rm $obj $libobj
4394 # Objects from convenience libraries. This assumes
4395 # single-version convenience libraries. Whenever we create
4396 # different ones for PIC/non-PIC, this we'll have to duplicate
4400 # reload_cmds runs $LD directly, so let us get rid of
4401 # -Wl from whole_archive_flag_spec and hope we can get by with
4402 # turning comma into space..
4405 if test -n "$convenience"; then
4406 if test -n "$whole_archive_flag_spec"; then
4407 eval tmp_whole_archive_flags
=\"$whole_archive_flag_spec\"
4408 reload_conv_objs
=$reload_objs\
`$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
4410 gentop
="$output_objdir/${obj}x"
4411 generated
="$generated $gentop"
4413 func_extract_archives
$gentop $convenience
4414 reload_conv_objs
="$reload_objs $func_extract_archives_result"
4418 # Create the old-style object.
4419 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
4423 save_ifs
="$IFS"; IFS
='~'
4424 for cmd
in $cmds; do
4428 $run eval "$cmd" ||
exit $?
4432 # Exit if we aren't doing a library object file.
4433 if test -z "$libobj"; then
4434 if test -n "$gentop"; then
4435 $show "${rm}r $gentop"
4442 if test "$build_libtool_libs" != yes; then
4443 if test -n "$gentop"; then
4444 $show "${rm}r $gentop"
4448 # Create an invalid libtool object if no PIC, so that we don't
4449 # accidentally link it into a program.
4450 # $show "echo timestamp > $libobj"
4451 # $run eval "echo timestamp > $libobj" || exit $?
4455 if test -n "$pic_flag" ||
test "$pic_mode" != default
; then
4456 # Only do commands if we really have different PIC objects.
4457 reload_objs
="$libobjs $reload_conv_objs"
4460 save_ifs
="$IFS"; IFS
='~'
4461 for cmd
in $cmds; do
4465 $run eval "$cmd" ||
exit $?
4470 if test -n "$gentop"; then
4471 $show "${rm}r $gentop"
4480 *cygwin
*) output
=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
4482 if test -n "$vinfo"; then
4483 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
4486 if test -n "$release"; then
4487 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
4490 if test "$preload" = yes; then
4491 if test "$dlopen_support" = unknown
&& test "$dlopen_self" = unknown
&&
4492 test "$dlopen_self_static" = unknown
; then
4493 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
4498 *-*-rhapsody* |
*-*-darwin1.
[012])
4499 # On Rhapsody replace the C library is the System framework
4500 compile_deplibs
=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4501 finalize_deplibs
=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
4507 # Don't allow lazy linking, it breaks C++ global constructors
4508 if test "$tagname" = CXX
; then
4509 compile_command
="$compile_command ${wl}-bind_at_load"
4510 finalize_command
="$finalize_command ${wl}-bind_at_load"
4516 # move library search paths that coincide with paths to not yet
4517 # installed libraries to the beginning of the library search list
4519 for path
in $notinst_path; do
4520 case " $new_libs " in
4521 *" -L$path/$objdir "*) ;;
4523 case " $compile_deplibs " in
4524 *" -L$path/$objdir "*)
4525 new_libs
="$new_libs -L$path/$objdir" ;;
4530 for deplib
in $compile_deplibs; do
4533 case " $new_libs " in
4535 *) new_libs
="$new_libs $deplib" ;;
4538 *) new_libs
="$new_libs $deplib" ;;
4541 compile_deplibs
="$new_libs"
4544 compile_command
="$compile_command $compile_deplibs"
4545 finalize_command
="$finalize_command $finalize_deplibs"
4547 if test -n "$rpath$xrpath"; then
4548 # If the user specified any rpath flags, then add them.
4549 for libdir
in $rpath $xrpath; do
4550 # This is the magic to use -rpath.
4551 case "$finalize_rpath " in
4553 *) finalize_rpath
="$finalize_rpath $libdir" ;;
4558 # Now hardcode the library paths
4561 for libdir
in $compile_rpath $finalize_rpath; do
4562 if test -n "$hardcode_libdir_flag_spec"; then
4563 if test -n "$hardcode_libdir_separator"; then
4564 if test -z "$hardcode_libdirs"; then
4565 hardcode_libdirs
="$libdir"
4567 # Just accumulate the unique libdirs.
4568 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4569 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4572 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4577 eval flag
=\"$hardcode_libdir_flag_spec\"
4578 rpath
="$rpath $flag"
4580 elif test -n "$runpath_var"; then
4581 case "$perm_rpath " in
4583 *) perm_rpath
="$perm_rpath $libdir" ;;
4587 *-*-cygwin* |
*-*-mingw* |
*-*-pw32* |
*-*-os2*)
4588 testbindir
=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4589 case :$dllsearchpath: in
4591 *) dllsearchpath
="$dllsearchpath:$libdir";;
4593 case :$dllsearchpath: in
4594 *":$testbindir:"*) ;;
4595 *) dllsearchpath
="$dllsearchpath:$testbindir";;
4600 # Substitute the hardcoded libdirs into the rpath.
4601 if test -n "$hardcode_libdir_separator" &&
4602 test -n "$hardcode_libdirs"; then
4603 libdir
="$hardcode_libdirs"
4604 eval rpath
=\" $hardcode_libdir_flag_spec\"
4606 compile_rpath
="$rpath"
4610 for libdir
in $finalize_rpath; do
4611 if test -n "$hardcode_libdir_flag_spec"; then
4612 if test -n "$hardcode_libdir_separator"; then
4613 if test -z "$hardcode_libdirs"; then
4614 hardcode_libdirs
="$libdir"
4616 # Just accumulate the unique libdirs.
4617 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
4618 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
4621 hardcode_libdirs
="$hardcode_libdirs$hardcode_libdir_separator$libdir"
4626 eval flag
=\"$hardcode_libdir_flag_spec\"
4627 rpath
="$rpath $flag"
4629 elif test -n "$runpath_var"; then
4630 case "$finalize_perm_rpath " in
4632 *) finalize_perm_rpath
="$finalize_perm_rpath $libdir" ;;
4636 # Substitute the hardcoded libdirs into the rpath.
4637 if test -n "$hardcode_libdir_separator" &&
4638 test -n "$hardcode_libdirs"; then
4639 libdir
="$hardcode_libdirs"
4640 eval rpath
=\" $hardcode_libdir_flag_spec\"
4642 finalize_rpath
="$rpath"
4644 if test -n "$libobjs" && test "$build_old_libs" = yes; then
4645 # Transform all the library objects into standard objects.
4646 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4647 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4651 if test -n "$dlfiles$dlprefiles" ||
test "$dlself" != no
; then
4652 if test -n "$NM" && test -n "$global_symbol_pipe"; then
4653 dlsyms
="${outputname}S.c"
4655 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
4659 if test -n "$dlsyms"; then
4663 # Discover the nlist of each of the dlfiles.
4664 nlist
="$output_objdir/${outputname}.nm"
4666 $show "$rm $nlist ${nlist}S ${nlist}T"
4667 $run $rm "$nlist" "${nlist}S" "${nlist}T"
4669 # Parse the name list into a source file.
4670 $show "creating $output_objdir/$dlsyms"
4672 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
4673 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
4674 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
4680 /* Prevent the only kind of declaration conflicts we can make. */
4681 #define lt_preloaded_symbols some_other_symbol
4683 /* External symbol declarations for the compiler. */\
4686 if test "$dlself" = yes; then
4687 $show "generating symbol list for \`$output'"
4689 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
4691 # Add our own program objects to the symbol list.
4692 progfiles
=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4693 for arg
in $progfiles; do
4694 $show "extracting global C symbols from \`$arg'"
4695 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4698 if test -n "$exclude_expsyms"; then
4699 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4700 $run eval '$mv "$nlist"T "$nlist"'
4703 if test -n "$export_symbols_regex"; then
4704 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
4705 $run eval '$mv "$nlist"T "$nlist"'
4708 # Prepare the list of exported symbols
4709 if test -z "$export_symbols"; then
4710 export_symbols
="$output_objdir/$outputname.exp"
4711 $run $rm $export_symbols
4712 $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4714 *cygwin
* |
*mingw
* )
4715 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4716 $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4720 $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4721 $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4722 $run eval 'mv "$nlist"T "$nlist"'
4724 *cygwin
* |
*mingw
* )
4725 $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4726 $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4732 for arg
in $dlprefiles; do
4733 $show "extracting global C symbols from \`$arg'"
4734 name
=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
4735 $run eval '$echo ": $name " >> "$nlist"'
4736 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
4739 if test -z "$run"; then
4740 # Make sure we have at least an empty file.
4741 test -f "$nlist" ||
: > "$nlist"
4743 if test -n "$exclude_expsyms"; then
4744 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
4745 $mv "$nlist"T
"$nlist"
4748 # Try sorting and uniquifying the output.
4749 if grep -v "^: " < "$nlist" |
4750 if sort -k 3 </dev
/null
>/dev
/null
2>&1; then
4755 uniq > "$nlist"S
; then
4758 grep -v "^: " < "$nlist" > "$nlist"S
4761 if test -f "$nlist"S
; then
4762 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
4764 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
4767 $echo >> "$output_objdir/$dlsyms" "\
4769 #undef lt_preloaded_symbols
4771 #if defined (__STDC__) && __STDC__
4772 # define lt_ptr void *
4774 # define lt_ptr char *
4778 /* The mapping between symbol names and symbols. */
4782 *cygwin
* |
*mingw
* )
4783 $echo >> "$output_objdir/$dlsyms" "\
4784 /* DATA imports from DLLs on WIN32 can't be const, because
4785 runtime relocations are performed -- see ld's documentation
4791 $echo >> "$output_objdir/$dlsyms" "\
4798 $echo >> "$output_objdir/$dlsyms" "\
4802 lt_preloaded_symbols[] =
4806 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
4808 $echo >> "$output_objdir/$dlsyms" "\
4812 /* This works around a problem in FreeBSD linker */
4813 #ifdef FREEBSD_WORKAROUND
4814 static const void *lt_preloaded_setup() {
4815 return lt_preloaded_symbols;
4825 pic_flag_for_symtable
=
4827 # compiling the symbol table file with pic_flag works around
4828 # a FreeBSD bug that causes programs to crash when -lm is
4829 # linked before any other PIC object. But we must not use
4830 # pic_flag when linking with -static. The problem exists in
4831 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4832 *-*-freebsd2*|
*-*-freebsd3.0
*|
*-*-freebsdelf3.0
*)
4833 case "$compile_command " in
4835 *) pic_flag_for_symtable
=" $pic_flag -DFREEBSD_WORKAROUND";;
4838 case "$compile_command " in
4840 *) pic_flag_for_symtable
=" $pic_flag";;
4844 # Now compile the dynamic symbol file.
4845 $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4846 $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' ||
exit $?
4848 # Clean up the generated files.
4849 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4850 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4852 # Transform the symbol file into the correct name.
4854 *cygwin
* |
*mingw
* )
4855 if test -f "$output_objdir/${outputname}.def" ; then
4856 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4857 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
4859 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4860 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4864 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4865 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
4870 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4875 # We keep going just in case the user didn't refer to
4876 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
4877 # really was required.
4879 # Nullify the symbol file.
4880 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4881 finalize_command
=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4884 if test "$need_relink" = no ||
test "$build_libtool_libs" != yes; then
4885 # Replace the output file specification.
4886 compile_command
=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
4887 link_command
="$compile_command$compile_rpath"
4889 # We have no uninstalled library dependencies, so finalize right now.
4890 $show "$link_command"
4891 $run eval "$link_command"
4894 # Delete the generated files.
4895 if test -n "$dlsyms"; then
4896 $show "$rm $output_objdir/${outputname}S.${objext}"
4897 $run $rm "$output_objdir/${outputname}S.${objext}"
4903 if test -n "$shlibpath_var"; then
4904 # We should set the shlibpath_var
4906 for dir
in $temp_rpath; do
4908 [\\/]* |
[A-Za-z
]:[\\/]*)
4913 # Relative path: add a thisdir entry.
4914 rpath
="$rpath\$thisdir/$dir:"
4921 if test -n "$compile_shlibpath$finalize_shlibpath"; then
4922 compile_command
="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
4924 if test -n "$finalize_shlibpath"; then
4925 finalize_command
="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
4930 if test -n "$runpath_var"; then
4931 if test -n "$perm_rpath"; then
4932 # We should set the runpath_var.
4934 for dir
in $perm_rpath; do
4937 compile_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4939 if test -n "$finalize_perm_rpath"; then
4940 # We should set the runpath_var.
4942 for dir
in $finalize_perm_rpath; do
4945 finalize_var
="$runpath_var=\"$rpath\$$runpath_var\" "
4949 if test "$no_install" = yes; then
4950 # We don't need to create a wrapper script.
4951 link_command
="$compile_var$compile_command$compile_rpath"
4952 # Replace the output file specification.
4953 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
4954 # Delete the old output file.
4956 # Link the executable and exit
4957 $show "$link_command"
4958 $run eval "$link_command" ||
exit $?
4962 if test "$hardcode_action" = relink
; then
4963 # Fast installation is not supported
4964 link_command
="$compile_var$compile_command$compile_rpath"
4965 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4967 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
4968 $echo "$modename: \`$output' will be relinked during installation" 1>&2
4970 if test "$fast_install" != no
; then
4971 link_command
="$finalize_var$compile_command$finalize_rpath"
4972 if test "$fast_install" = yes; then
4973 relink_command
=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
4975 # fast_install is set to needless
4979 link_command
="$compile_var$compile_command$compile_rpath"
4980 relink_command
="$finalize_var$finalize_command$finalize_rpath"
4984 # Replace the output file specification.
4985 link_command
=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4987 # Delete the old output files.
4988 $run $rm $output $output_objdir/$outputname $output_objdir/lt-
$outputname
4990 $show "$link_command"
4991 $run eval "$link_command" ||
exit $?
4993 # Now create the wrapper script.
4994 $show "creating $output"
4996 # Quote the relink command for shipping.
4997 if test -n "$relink_command"; then
4998 # Preserve any variables that may affect compiler behavior
4999 for var
in $variables_saved_for_relink; do
5000 if eval test -z \"\
${$var+set}\"; then
5001 relink_command
="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5002 elif eval var_value
=\$
$var; test -z "$var_value"; then
5003 relink_command
="$var=; export $var; $relink_command"
5005 var_value
=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
5006 relink_command
="$var=\"$var_value\"; export $var; $relink_command"
5009 relink_command
="(cd `pwd`; $relink_command)"
5010 relink_command
=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5013 # Quote $echo for shipping.
5014 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
5016 [\\/]* |
[A-Za-z
]:[\\/]*) qecho
="$SHELL $progpath --fallback-echo";;
5017 *) qecho
="$SHELL `pwd`/$progpath --fallback-echo";;
5019 qecho
=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
5021 qecho
=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
5024 # Only actually do things if our run command is non-null.
5025 if test -z "$run"; then
5026 # win32 will think the script is a binary if it has
5027 # a .exe suffix, so we strip it off here.
5029 *.exe
) output
=`$echo $output|${SED} 's,.exe$,,'` ;;
5031 # test for cygwin because mv fails w/o .exe extensions
5035 outputname
=`$echo $outputname|${SED} 's,.exe$,,'` ;;
5039 *cygwin
* |
*mingw
* )
5040 output_name
=`basename $output`
5041 output_path
=`dirname $output`
5042 cwrappersource
="$output_path/$objdir/lt-$output_name.c"
5043 cwrapper
="$output_path/$output_name.exe"
5044 $rm $cwrappersource $cwrapper
5045 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
5047 cat > $cwrappersource <<EOF
5049 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5050 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5052 The $output program cannot be directly executed until all the libtool
5053 libraries that it depends on are installed.
5055 This wrapper executable should never be moved out of the build directory.
5056 If it is, it will not operate correctly.
5058 Currently, it simply execs the wrapper *script* "/bin/sh $output",
5059 but could eventually absorb all of the scripts functionality and
5060 exec $objdir/$outputname directly.
5063 cat >> $cwrappersource<<"EOF"
5072 #include <sys/stat.h>
5074 #if defined(PATH_MAX)
5075 # define LT_PATHMAX PATH_MAX
5076 #elif defined(MAXPATHLEN)
5077 # define LT_PATHMAX MAXPATHLEN
5079 # define LT_PATHMAX 1024
5082 #ifndef DIR_SEPARATOR
5083 # define DIR_SEPARATOR '/'
5084 # define PATH_SEPARATOR ':'
5087 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5089 # define HAVE_DOS_BASED_FILE_SYSTEM
5090 # ifndef DIR_SEPARATOR_2
5091 # define DIR_SEPARATOR_2 '\\'
5093 # ifndef PATH_SEPARATOR_2
5094 # define PATH_SEPARATOR_2 ';'
5098 #ifndef DIR_SEPARATOR_2
5099 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
5100 #else /* DIR_SEPARATOR_2 */
5101 # define IS_DIR_SEPARATOR(ch) \
5102 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
5103 #endif /* DIR_SEPARATOR_2 */
5105 #ifndef PATH_SEPARATOR_2
5106 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5107 #else /* PATH_SEPARATOR_2 */
5108 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5109 #endif /* PATH_SEPARATOR_2 */
5111 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
5112 #define XFREE(stale) do { \
5113 if (stale) { free ((void *) stale); stale = 0; } \
5116 /* -DDEBUG is fairly common in CFLAGS. */
5118 #if defined DEBUGWRAPPER
5119 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
5121 # define DEBUG(format, ...)
5124 const char *program_name = NULL;
5126 void * xmalloc (size_t num);
5127 char * xstrdup (const char *string);
5128 const char * base_name (const char *name);
5129 char * find_executable(const char *wrapper);
5130 int check_executable(const char *path);
5131 char * strendzap(char *str, const char *pat);
5132 void lt_fatal (const char *message, ...);
5135 main (int argc, char *argv[])
5140 program_name = (char *) xstrdup (base_name (argv[0]));
5141 DEBUG("(main) argv[0] : %s\n",argv[0]);
5142 DEBUG("(main) program_name : %s\n",program_name);
5143 newargz = XMALLOC(char *, argc+2);
5146 cat >> $cwrappersource <<EOF
5147 newargz[0] = (char *) xstrdup("$SHELL");
5150 cat >> $cwrappersource <<"EOF"
5151 newargz
[1] = find_executable
(argv
[0]);
5152 if (newargz
[1] == NULL
)
5153 lt_fatal
("Couldn't find %s", argv
[0]);
5154 DEBUG
("(main) found exe at : %s\n",newargz
[1]);
5155 /* we know the
script has the same name
, without the .exe
*/
5156 /* so
make sure newargz
[1] doesn
't end in .exe */
5157 strendzap(newargz[1],".exe");
5158 for (i = 1; i < argc; i++)
5159 newargz[i+1] = xstrdup(argv[i]);
5160 newargz[argc+1] = NULL;
5162 for (i=0; i<argc+1; i++)
5164 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
5172 cat >> $cwrappersource <<EOF
5173 execv("$SHELL",(char const **)newargz);
5177 cat >> $cwrappersource <<EOF
5178 execv("$SHELL",newargz);
5183 cat >> $cwrappersource <<"EOF"
5188 xmalloc (size_t num)
5190 void * p = (void *) malloc (num);
5192 lt_fatal ("Memory exhausted");
5198 xstrdup (const char *string)
5200 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
5205 base_name (const char *name)
5209 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5210 /* Skip over the disk name in MSDOS pathnames. */
5211 if (isalpha ((unsigned char)name[0]) && name[1] == ':')
5215 for (base = name; *name; name++)
5216 if (IS_DIR_SEPARATOR (*name))
5222 check_executable(const char * path)
5226 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
5227 if ((!path) || (!*path))
5230 if ((stat (path, &st) >= 0) &&
5232 /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
5233 #if defined (S_IXOTH)
5234 ((st.st_mode & S_IXOTH) == S_IXOTH) ||
5236 #if defined (S_IXGRP)
5237 ((st.st_mode & S_IXGRP) == S_IXGRP) ||
5239 ((st.st_mode & S_IXUSR) == S_IXUSR))
5246 /* Searches for the full path of the wrapper. Returns
5247 newly allocated full path name if found, NULL otherwise */
5249 find_executable (const char* wrapper)
5254 /* static buffer for getcwd */
5255 char tmp[LT_PATHMAX + 1];
5259 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
5261 if ((wrapper == NULL) || (*wrapper == '\
0'))
5264 /* Absolute path? */
5265 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5266 if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
5268 concat_name = xstrdup (wrapper);
5269 if (check_executable(concat_name))
5276 if (IS_DIR_SEPARATOR (wrapper[0]))
5278 concat_name = xstrdup (wrapper);
5279 if (check_executable(concat_name))
5283 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5287 for (p = wrapper; *p; p++)
5295 /* no slashes; search PATH */
5296 const char* path = getenv ("PATH");
5299 for (p = path; *p; p = p_next)
5303 for (q = p; *q; q++)
5304 if (IS_PATH_SEPARATOR(*q))
5307 p_next = (*q == '\
0' ? q : q + 1);
5310 /* empty path: current directory */
5311 if (getcwd (tmp, LT_PATHMAX) == NULL)
5312 lt_fatal ("getcwd failed");
5313 tmp_len = strlen(tmp);
5314 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5315 memcpy (concat_name, tmp, tmp_len);
5316 concat_name[tmp_len] = '/';
5317 strcpy (concat_name + tmp_len + 1, wrapper);
5321 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
5322 memcpy (concat_name, p, p_len);
5323 concat_name[p_len] = '/';
5324 strcpy (concat_name + p_len + 1, wrapper);
5326 if (check_executable(concat_name))
5331 /* not found in PATH; assume curdir */
5333 /* Relative path | not found in path: prepend cwd */
5334 if (getcwd (tmp, LT_PATHMAX) == NULL)
5335 lt_fatal ("getcwd failed");
5336 tmp_len = strlen(tmp);
5337 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
5338 memcpy (concat_name, tmp, tmp_len);
5339 concat_name[tmp_len] = '/';
5340 strcpy (concat_name + tmp_len + 1, wrapper);
5342 if (check_executable(concat_name))
5349 strendzap(char *str, const char *pat)
5353 assert(str != NULL);
5354 assert(pat != NULL);
5357 patlen = strlen(pat);
5361 str += len - patlen;
5362 if (strcmp(str, pat) == 0)
5369 lt_error_core (int exit_status, const char * mode,
5370 const char * message, va_list ap)
5372 fprintf (stderr, "%s: %s: ", program_name, mode);
5373 vfprintf (stderr, message, ap);
5374 fprintf (stderr, ".\n");
5376 if (exit_status >= 0)
5381 lt_fatal (const char *message, ...)
5384 va_start (ap, message);
5385 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
5389 # we should really use a build-platform specific compiler
5390 # here, but OTOH, the wrappers (shell script and this C one)
5391 # are only useful if you want to execute the "real" binary.
5392 # Since the "real" binary is built for $host, then this
5393 # wrapper might as well be built for $host, too.
5394 $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
5398 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5403 # $output - temporary wrapper script for $objdir/$outputname
5404 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5406 # The $output program cannot be directly executed until all the libtool
5407 # libraries that it depends on are installed.
5409 # This wrapper script should never be moved out of the build directory.
5410 # If it is, it will not operate correctly.
5412 # Sed substitution that helps us do robust quoting. It backslashifies
5413 # metacharacters that are still active within double-quoted strings.
5414 Xsed='${SED} -e 1s
/^X
//'
5415 sed_quote_subst='$sed_quote_subst'
5417 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
5418 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5421 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
5422 # is contrary to our usage. Disable this feature.
5423 alias -g '\
${1+\"\$@\"}'='\"\$@
\"'
5424 setopt NO_GLOB_SUBST
5426 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
5428 BIN_SH=xpg4; export BIN_SH # for Tru64
5429 DUALCASE=1; export DUALCASE # for MKS sh
5431 # The HP-UX ksh and POSIX shell print the target directory to stdout
5433 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5435 relink_command=\"$relink_command\"
5437 # This environment variable determines our operation mode.
5438 if test \"\$libtool_install_magic\" = \"$magic\"; then
5439 # install mode needs the following variable:
5440 notinst_deplibs='$notinst_deplibs'
5442 # When we are sourced in execute mode, \$file and \$echo are already set.
5443 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5446 # Make sure echo works.
5447 if test \"X\$1\" = X--no-reexec; then
5448 # Discard the --no-reexec flag, and continue.
5450 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X
\t'; then
5451 # Yippee, \$echo works!
5454 # Restart under the correct shell, and then maybe \$echo will work.
5455 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5461 # Find the directory that this script lives in.
5462 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*$
%%'\`
5463 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5465 # Follow symbolic links until we get to the real thisdir.
5466 file=\`ls -ld \"\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5467 while test -n \"\$file\"; do
5468 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's
%/[^
/]*\$
%%'\`
5470 # If there was a directory component, then change thisdir.
5471 if test \"x\$destdir\" != \"x\$file\"; then
5472 case \"\$destdir\" in
5473 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5474 *) thisdir=\"\$thisdir/\$destdir\" ;;
5478 file=\`\$echo \"X\$file\" | \$Xsed -e 's
%^.
*/%%'\`
5479 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's
/.
*-> //p
'\`
5482 # Try to get the absolute directory name.
5483 absdir=\`cd \"\$thisdir\" && pwd\`
5484 test -n \"\$absdir\" && thisdir=\"\$absdir\"
5487 if test "$fast_install" = yes; then
5489 program=lt-'$outputname'$exeext
5490 progdir=\"\$thisdir/$objdir\"
5492 if test ! -f \"\$progdir/\$program\" || \\
5493 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5494 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5496 file=\"\$\$-\$program\"
5498 if test ! -d \"\$progdir\"; then
5499 $mkdir \"\$progdir\"
5501 $rm \"\$progdir/\$file\"
5506 # relink executable if necessary
5507 if test -n \"\$relink_command\"; then
5508 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5510 $echo \"\$relink_command_output\" >&2
5511 $rm \"\$progdir/\$file\"
5516 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
5517 { $rm \"\$progdir/\$program\";
5518 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
5519 $rm \"\$progdir/\$file\"
5523 program='$outputname'
5524 progdir=\"\$thisdir/$objdir\"
5530 if test -f \"\$progdir/\$program\"; then"
5532 # Export our shlibpath_var if we have one.
5533 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5535 # Add our own library path to $shlibpath_var
5536 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5538 # Some systems cannot cope with colon-terminated $shlibpath_var
5539 # The second colon is a workaround for a bug in BeOS R4 sed
5540 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's
/::*\$
//'\`
5542 export $shlibpath_var
5546 # fixup the dll searchpath if we need to.
5547 if test -n "$dllsearchpath"; then
5549 # Add the dll search path components to the executable PATH
5550 PATH=$dllsearchpath:\$PATH
5555 if test \"\$libtool_execute_magic\" != \"$magic\"; then
5556 # Run the actual program with our arguments.
5559 # Backslashes separate directories on plain windows
5560 *-*-mingw | *-*-os2*)
5562 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5568 exec \"\$progdir/\$program\" \${1+\"\$@\"}
5573 \$echo \"\$0: cannot exec \$program \$*\"
5577 # The program doesn't exist.
5578 \
$echo \"\
$0: error
: \\\
`\$progdir/\$program' does not exist\" 1>&2
5579 \$echo \"This script is just a wrapper for \$program.\" 1>&2
5580 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5591 # See if we need to build an old-fashioned archive.
5592 for oldlib in $oldlibs; do
5594 if test "$build_libtool_libs" = convenience; then
5595 oldobjs="$libobjs_save"
5596 addlibs="$convenience"
5597 build_libtool_libs=no
5599 if test "$build_libtool_libs" = module; then
5600 oldobjs="$libobjs_save"
5601 build_libtool_libs=no
5603 oldobjs="$old_deplibs $non_pic_objects"
5605 addlibs="$old_convenience"
5608 if test -n "$addlibs"; then
5609 gentop="$output_objdir/${outputname}x"
5610 generated="$generated $gentop"
5612 func_extract_archives $gentop $addlibs
5613 oldobjs="$oldobjs $func_extract_archives_result"
5616 # Do each command in the archive commands.
5617 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5618 cmds=$old_archive_from_new_cmds
5620 # POSIX demands no paths to be encoded in archives. We have
5621 # to avoid creating archives with duplicate basenames if we
5622 # might have to extract them afterwards, e.g., when creating a
5623 # static archive out of a convenience library, or when linking
5624 # the entirety of a libtool archive into another (currently
5625 # not supported by libtool).
5626 if (for obj in $oldobjs
5628 $echo "X$obj" | $Xsed -e 's%^.*/%%'
5629 done | sort | sort -uc >/dev/null 2>&1); then
5632 $echo "copying selected object files to avoid basename conflicts..."
5634 if test -z "$gentop"; then
5635 gentop="$output_objdir/${outputname}x"
5636 generated="$generated $gentop"
5638 $show "${rm}r $gentop"
5639 $run ${rm}r "$gentop"
5640 $show "$mkdir $gentop"
5641 $run $mkdir "$gentop"
5643 if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
5648 save_oldobjs=$oldobjs
5651 for obj in $save_oldobjs
5653 objbase=`$echo "X$obj" |
$Xsed -e 's%^.*/%%'`
5654 case " $oldobjs " in
5655 " ") oldobjs=$obj ;;
5658 # Make sure we don't pick an alternate name that also
5660 newobj=lt$counter-$objbase
5661 counter=`expr $counter + 1`
5662 case " $oldobjs " in
5663 *[\ /]"$newobj "*) ;;
5664 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
5667 $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
5668 $run ln "$obj" "$gentop/$newobj" ||
5669 $run cp "$obj" "$gentop/$newobj"
5670 oldobjs="$oldobjs $gentop/$newobj"
5672 *) oldobjs="$oldobjs $obj" ;;
5677 eval cmds=\"$old_archive_cmds\"
5679 if len=`expr "X$cmds" : ".*"` &&
5680 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
5681 cmds=$old_archive_cmds
5683 # the command line is too long to link in one step, link in parts
5684 $echo "using piecewise archive linking..."
5689 save_oldobjs=$oldobjs
5691 # Is there a better way of finding the last object in the list?
5692 for obj in $save_oldobjs
5696 for obj in $save_oldobjs
5698 oldobjs="$objlist $obj"
5699 objlist="$objlist $obj"
5700 eval test_cmds=\"$old_archive_cmds\"
5701 if len=`expr "X$test_cmds" : ".*" 2>/dev
/null
` &&
5702 test "$len" -le "$max_cmd_len"; then
5705 # the above command should be used before it gets too long
5707 if test "$obj" = "$last_oldobj" ; then
5710 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
5711 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
5717 if test "X$oldobjs" = "X" ; then
5718 eval cmds=\"\$concat_cmds\"
5720 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
5724 save_ifs="$IFS"; IFS='~'
5725 for cmd in $cmds; do
5729 $run eval "$cmd" || exit $?
5734 if test -n "$generated"; then
5735 $show "${rm}r$generated"
5736 $run ${rm}r$generated
5739 # Now create the libtool archive.
5743 test "$build_old_libs" = yes && old_library="$libname.$libext"
5744 $show "creating $output"
5746 # Preserve any variables that may affect compiler behavior
5747 for var in $variables_saved_for_relink; do
5748 if eval test -z \"\${$var+set}\"; then
5749 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
5750 elif eval var_value=\$$var; test -z "$var_value"; then
5751 relink_command="$var=; export $var; $relink_command"
5753 var_value=`$echo "X$var_value" |
$Xsed -e "$sed_quote_subst"`
5754 relink_command="$var=\"$var_value\"; export $var; $relink_command"
5757 # Quote the link command for shipping.
5758 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5759 relink_command=`$echo "X$relink_command" |
$SP2NL |
$Xsed -e "$sed_quote_subst" |
$NL2SP`
5760 if test "$hardcode_automatic" = yes ; then
5765 # Only create the output if not a dry run.
5766 if test -z "$run"; then
5767 for installed in no yes; do
5768 if test "$installed" = yes; then
5769 if test -z "$install_libdir"; then
5772 output="$output_objdir/$outputname"i
5773 # Replace all uninstalled libtool libraries with the installed ones
5775 for deplib in $dependency_libs; do
5778 name=`$echo "X$deplib" |
$Xsed -e 's%^.*/%%'`
5779 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5780 if test -z "$libdir"; then
5781 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
5784 newdependency_libs="$newdependency_libs $libdir/$name"
5786 *) newdependency_libs="$newdependency_libs $deplib" ;;
5789 dependency_libs="$newdependency_libs"
5791 for lib in $dlfiles; do
5792 name=`$echo "X$lib" | $Xsed -e 's
%^.
*/%%'`
5793 eval libdir=`${SED} -n -e 's
/^libdir
=\
(.
*\
)$
/\
1/p
' $lib`
5794 if test -z "$libdir"; then
5795 $echo "$modename: \`$lib' is not a valid libtool archive
" 1>&2
5798 newdlfiles="$newdlfiles $libdir/$name"
5800 dlfiles="$newdlfiles"
5802 for lib in $dlprefiles; do
5803 name=`$echo "X
$lib" | $Xsed -e 's%^.*/%%'`
5804 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
5805 if test -z "$libdir"; then
5806 $echo "$modename: \
`$lib' is not a valid libtool archive" 1>&2
5809 newdlprefiles="$newdlprefiles $libdir/$name"
5811 dlprefiles="$newdlprefiles"
5814 for lib in $dlfiles; do
5816 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5817 *) abs=`pwd`"/$lib" ;;
5819 newdlfiles="$newdlfiles $abs"
5821 dlfiles="$newdlfiles"
5823 for lib in $dlprefiles; do
5825 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
5826 *) abs=`pwd`"/$lib" ;;
5828 newdlprefiles="$newdlprefiles $abs"
5830 dlprefiles="$newdlprefiles"
5833 # place dlname in correct position for cygwin
5835 case $host,$output,$installed,$module,$dlname in
5836 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
5839 # $outputname - a libtool library file
5840 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
5842 # Please DO NOT delete this file!
5843 # It is necessary for linking the library.
5845 # The name that we can dlopen(3).
5848 # Names of this library.
5849 library_names='$library_names'
5851 # The name of the static archive.
5852 old_library='$old_library'
5854 # Libraries that this one depends upon.
5855 dependency_libs='$dependency_libs'
5857 # Version information for $libname.
5862 # Is this an already installed library?
5863 installed=$installed
5865 # Should we warn about portability when linking against -modules?
5866 shouldnotlink=$module
5868 # Files to dlopen/dlpreopen
5870 dlpreopen='$dlprefiles'
5872 # Directory that this library needs to be installed in:
5873 libdir='$install_libdir'"
5874 if test "$installed" = no && test "$need_relink" = yes; then
5876 relink_command=\"$relink_command\""
5881 # Do a symbolic link so that the libtool archive can be found in
5882 # LD_LIBRARY_PATH before the program is installed.
5883 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
5884 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
5890 # libtool install mode
5892 modename="$modename: install"
5894 # There may be an optional sh(1) argument at the beginning of
5895 # install_prog (especially on Windows NT).
5896 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5897 # Allow the use of GNU shtool's install command.
5898 $echo "X$nonopt" | grep shtool > /dev/null; then
5899 # Aesthetically quote it.
5900 arg=`$echo "X$nonopt" |
$Xsed -e "$sed_quote_subst"`
5902 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5906 install_prog="$arg "
5914 # The real first argument should be the name of the installation program.
5915 # Aesthetically quote it.
5916 arg=`$echo "X$arg" |
$Xsed -e "$sed_quote_subst"`
5918 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5922 install_prog="$install_prog$arg"
5924 # We need to accept at least all the BSD install flags.
5934 if test -n "$dest"; then
5935 files="$files $dest"
5943 case " $install_prog " in
5948 -g | -m | -o) prev=$arg ;;
5956 # If the previous option needed an argument, then skip it.
5957 if test -n "$prev"; then
5966 # Aesthetically quote the argument.
5967 arg=`$echo "X$arg" |
$Xsed -e "$sed_quote_subst"`
5969 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
5973 install_prog="$install_prog $arg"
5976 if test -z "$install_prog"; then
5977 $echo "$modename: you must specify an install program" 1>&2
5982 if test -n "$prev"; then
5983 $echo "$modename: the \`$prev' option requires an argument" 1>&2
5988 if test -z "$files"; then
5989 if test -z "$dest"; then
5990 $echo "$modename: no file or destination specified" 1>&2
5992 $echo "$modename: you must specify a destination" 1>&2
5998 # Canonicalise the pathname:
6002 # - strip any trailing /
6004 while test "$dest" != "$tmp"; do
6006 dest=`$echo "X$dest" | $Xsed -e 's
%[^
/.
][^
/.
]*/\.\.
%%g
' -e 's
%/\.
/%/%g
' -e 's
%//*%/%g
' -e 's
%/$
%%g
'`
6009 # Check to see that the destination is a directory.
6010 test -d "$dest" && isdir=yes
6011 if test "$isdir" = yes; then
6015 destdir=`$echo "X$dest" | $Xsed -e 's
%/[^
/]*$
%%'`
6016 test "X$destdir" = "X$dest" && destdir=.
6017 destname=`$echo "X$dest" | $Xsed -e 's
%^.
*/%%'`
6019 # Not a directory, so check to see that there is only one file specified.
6021 if test "$#" -gt 2; then
6022 $echo "$modename: \`$dest' is not a directory
" 1>&2
6028 [\\/]* | [A-Za-z]:[\\/]*) ;;
6030 for file in $files; do
6034 $echo "$modename: \
`$destdir' must be an absolute directory name" 1>&2
6043 # This variable tells wrapper scripts just to set variables rather
6044 # than running their programs.
6045 libtool_install_magic="$magic"
6050 for file in $files; do
6052 # Do each installation.
6055 # Do the static libraries later.
6056 staticlibs="$staticlibs $file"
6060 # Check to see that this really is a libtool archive.
6061 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
6063 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
6071 # If there is no directory component, then add one.
6073 */* | *\\*) . $file ;;
6077 # Add the libdir to current_libdirs if it is the destination.
6078 if test "X$destdir" = "X$libdir"; then
6079 case "$current_libdirs " in
6081 *) current_libdirs="$current_libdirs $libdir" ;;
6084 # Note the libdir as a future libdir.
6085 case "$future_libdirs " in
6087 *) future_libdirs="$future_libdirs $libdir" ;;
6091 dir=`$echo "X$file" | $Xsed -e 's
%/[^
/]*$
%%'`/
6092 test "X$dir" = "X$file/" && dir=
6095 if test -n "$relink_command"; then
6096 # Determine the prefix the user has applied to our future dir.
6097 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
6099 # Don't allow the user to place us outside of our expected
6100 # location b/c this prevents finding dependent libraries that
6101 # are installed to the same prefix.
6102 # At present, this check doesn't affect windows .dll's that
6103 # are installed into $libdir/../bin (currently, that works fine)
6104 # but it's something to keep an eye on.
6105 if test "$inst_prefix_dir" = "$destdir"; then
6106 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
6110 if test -n "$inst_prefix_dir"; then
6111 # Stick the inst_prefix_dir data into the link command.
6112 relink_command
=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
6114 relink_command
=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
6117 $echo "$modename: warning: relinking \`$file'" 1>&2
6118 $show "$relink_command"
6119 if $run eval "$relink_command"; then :
6121 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6126 # See the names of the shared library.
6127 set dummy
$library_names
6128 if test -n "$2"; then
6134 test -n "$relink_command" && srcname
="$realname"T
6136 # Install the shared library and build the symlinks.
6137 $show "$install_prog $dir/$srcname $destdir/$realname"
6138 $run eval "$install_prog $dir/$srcname $destdir/$realname" ||
exit $?
6139 if test -n "$stripme" && test -n "$striplib"; then
6140 $show "$striplib $destdir/$realname"
6141 $run eval "$striplib $destdir/$realname" ||
exit $?
6144 if test "$#" -gt 0; then
6145 # Delete the old symlinks, and create new ones.
6146 # Try `ln -sf' first, because the `ln' binary might depend on
6147 # the symlink we replace! Solaris /bin/ln does not understand -f,
6148 # so we also need to try rm && ln -s.
6151 if test "$linkname" != "$realname"; then
6152 $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6153 $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
6158 # Do each command in the postinstall commands.
6159 lib
="$destdir/$realname"
6160 cmds
=$postinstall_cmds
6161 save_ifs
="$IFS"; IFS
='~'
6162 for cmd
in $cmds; do
6166 $run eval "$cmd" ||
{
6169 # Restore the uninstalled library and exit
6170 if test "$mode" = relink
; then
6171 $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
6180 # Install the pseudo-library for information purposes.
6181 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6182 instname
="$dir/$name"i
6183 $show "$install_prog $instname $destdir/$name"
6184 $run eval "$install_prog $instname $destdir/$name" ||
exit $?
6186 # Maybe install the static library, too.
6187 test -n "$old_library" && staticlibs
="$staticlibs $dir/$old_library"
6191 # Install (i.e. copy) a libtool object.
6193 # Figure out destination file name, if it wasn't already specified.
6194 if test -n "$destname"; then
6195 destfile
="$destdir/$destname"
6197 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6198 destfile
="$destdir/$destfile"
6201 # Deduce the name of the destination old-style object file.
6204 staticdest
=`$echo "X$destfile" | $Xsed -e "$lo2o"`
6207 staticdest
="$destfile"
6211 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
6217 # Install the libtool object if requested.
6218 if test -n "$destfile"; then
6219 $show "$install_prog $file $destfile"
6220 $run eval "$install_prog $file $destfile" ||
exit $?
6223 # Install the old object if enabled.
6224 if test "$build_old_libs" = yes; then
6225 # Deduce the name of the old-style object file.
6226 staticobj
=`$echo "X$file" | $Xsed -e "$lo2o"`
6228 $show "$install_prog $staticobj $staticdest"
6229 $run eval "$install_prog \$staticobj \$staticdest" ||
exit $?
6235 # Figure out destination file name, if it wasn't already specified.
6236 if test -n "$destname"; then
6237 destfile
="$destdir/$destname"
6239 destfile
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6240 destfile
="$destdir/$destfile"
6243 # If the file is missing, and there is a .exe on the end, strip it
6244 # because it is most likely a libtool script we actually want to
6249 if test ! -f "$file"; then
6250 file=`$echo $file|${SED} 's,.exe$,,'`
6256 # Do a test to see if this is really a libtool program.
6259 wrapper
=`$echo $file | ${SED} -e 's,.exe$,,'`
6265 if (${SED} -e '4q' $wrapper |
grep "^# Generated by .*$PACKAGE")>/dev
/null
2>&1; then
6269 # Note that it is not necessary on cygwin/mingw to append a dot to
6270 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6271 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6272 # `FILE.' does not work on cygwin managed mounts.
6274 # If there is no directory component, then add one.
6276 */* |
*\\*) .
${wrapper} ;;
6277 *) . .
/${wrapper} ;;
6280 # Check the variables that should have been set.
6281 if test -z "$notinst_deplibs"; then
6282 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
6287 for lib
in $notinst_deplibs; do
6288 # Check to see that each library is installed.
6290 if test -f "$lib"; then
6291 # If there is no directory component, then add one.
6293 */* |
*\\*) .
$lib ;;
6297 libfile
="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
6298 if test -n "$libdir" && test ! -f "$libfile"; then
6299 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
6305 # Note that it is not necessary on cygwin/mingw to append a dot to
6306 # foo even if both foo and FILE.exe exist: automatic-append-.exe
6307 # behavior happens only for exec(3), not for open(2)! Also, sourcing
6308 # `FILE.' does not work on cygwin managed mounts.
6310 # If there is no directory component, then add one.
6312 */* |
*\\*) .
${wrapper} ;;
6313 *) . .
/${wrapper} ;;
6317 if test "$fast_install" = no
&& test -n "$relink_command"; then
6318 if test "$finalize" = yes && test -z "$run"; then
6319 tmpdir
=`func_mktempdir`
6320 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6321 outputname
="$tmpdir/$file"
6322 # Replace the output file specification.
6323 relink_command
=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
6325 $show "$relink_command"
6326 if $run eval "$relink_command"; then :
6328 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
6334 $echo "$modename: warning: cannot relink \`$file'" 1>&2
6337 # Install the binary that we compiled earlier.
6338 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
6342 # remove .exe since cygwin /usr/bin/install will append another
6344 case $install_prog,$host in
6345 */usr
/bin
/install*,*cygwin
*)
6346 case $file:$destfile in
6351 destfile
=$destfile.exe
6354 destfile
=`$echo $destfile | ${SED} -e 's,.exe$,,'`
6359 $show "$install_prog$stripme $file $destfile"
6360 $run eval "$install_prog\$stripme \$file \$destfile" ||
exit $?
6361 test -n "$outputname" && ${rm}r
"$tmpdir"
6366 for file in $staticlibs; do
6367 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6369 # Set up the ranlib parameters.
6370 oldlib
="$destdir/$name"
6372 $show "$install_prog $file $oldlib"
6373 $run eval "$install_prog \$file \$oldlib" ||
exit $?
6375 if test -n "$stripme" && test -n "$old_striplib"; then
6376 $show "$old_striplib $oldlib"
6377 $run eval "$old_striplib $oldlib" ||
exit $?
6380 # Do each command in the postinstall commands.
6381 cmds
=$old_postinstall_cmds
6382 save_ifs
="$IFS"; IFS
='~'
6383 for cmd
in $cmds; do
6387 $run eval "$cmd" ||
exit $?
6392 if test -n "$future_libdirs"; then
6393 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
6396 if test -n "$current_libdirs"; then
6397 # Maybe just do a dry run.
6398 test -n "$run" && current_libdirs
=" -n$current_libdirs"
6399 exec_cmd
='$SHELL $progpath $preserve_args --finish$current_libdirs'
6405 # libtool finish mode
6407 modename
="$modename: finish"
6411 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
6414 libdirs
="$libdirs $dir"
6417 for libdir
in $libdirs; do
6418 if test -n "$finish_cmds"; then
6419 # Do each command in the finish commands.
6421 save_ifs
="$IFS"; IFS
='~'
6422 for cmd
in $cmds; do
6426 $run eval "$cmd" || admincmds
="$admincmds
6431 if test -n "$finish_eval"; then
6432 # Do the single finish_eval.
6433 eval cmds
=\"$finish_eval\"
6434 $run eval "$cmds" || admincmds
="$admincmds
6440 # Exit here if they wanted silent mode.
6441 test "$show" = : && exit $EXIT_SUCCESS
6443 $echo "X----------------------------------------------------------------------" |
$Xsed
6444 $echo "Libraries have been installed in:"
6445 for libdir
in $libdirs; do
6449 $echo "If you ever happen to want to link against installed libraries"
6450 $echo "in a given directory, LIBDIR, you must either use libtool, and"
6451 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
6452 $echo "flag during linking and do at least one of the following:"
6453 if test -n "$shlibpath_var"; then
6454 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
6455 $echo " during execution"
6457 if test -n "$runpath_var"; then
6458 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
6459 $echo " during linking"
6461 if test -n "$hardcode_libdir_flag_spec"; then
6463 eval flag
=\"$hardcode_libdir_flag_spec\"
6465 $echo " - use the \`$flag' linker flag"
6467 if test -n "$admincmds"; then
6468 $echo " - have your system administrator run these commands:$admincmds"
6470 if test -f /etc
/ld.so.conf
; then
6471 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
6474 $echo "See any operating system documentation about shared libraries for"
6475 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6476 $echo "X----------------------------------------------------------------------" |
$Xsed
6480 # libtool execute mode
6482 modename
="$modename: execute"
6484 # The first argument is the command name.
6486 if test -z "$cmd"; then
6487 $echo "$modename: you must specify a COMMAND" 1>&2
6492 # Handle -dlopen flags immediately.
6493 for file in $execute_dlfiles; do
6494 if test ! -f "$file"; then
6495 $echo "$modename: \`$file' is not a file" 1>&2
6503 # Check to see that this really is a libtool archive.
6504 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then :
6506 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
6511 # Read the libtool library.
6515 # If there is no directory component, then add one.
6517 */* |
*\\*) .
$file ;;
6521 # Skip this library if it cannot be dlopened.
6522 if test -z "$dlname"; then
6523 # Warn if it was a shared library.
6524 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
6528 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6529 test "X$dir" = "X$file" && dir
=.
6531 if test -f "$dir/$objdir/$dlname"; then
6534 if test ! -f "$dir/$dlname"; then
6535 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
6542 # Just add the directory containing the .lo file.
6543 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6544 test "X$dir" = "X$file" && dir
=.
6548 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
6553 # Get the absolute pathname.
6554 absdir
=`cd "$dir" && pwd`
6555 test -n "$absdir" && dir
="$absdir"
6557 # Now add the directory to shlibpath_var.
6558 if eval "test -z \"\$$shlibpath_var\""; then
6559 eval "$shlibpath_var=\"\$dir\""
6561 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
6565 # This variable tells wrapper scripts just to set shlibpath_var
6566 # rather than running their programs.
6567 libtool_execute_magic
="$magic"
6569 # Check if any of the arguments is a wrapper script.
6576 # Do a test to see if this is really a libtool program.
6577 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6578 # If there is no directory component, then add one.
6580 */* |
*\\*) .
$file ;;
6584 # Transform arg to wrapped name.
6585 file="$progdir/$program"
6589 # Quote arguments (to preserve shell metacharacters).
6590 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
6591 args
="$args \"$file\""
6594 if test -z "$run"; then
6595 if test -n "$shlibpath_var"; then
6596 # Export the shlibpath_var.
6597 eval "export $shlibpath_var"
6600 # Restore saved environment variables
6601 for lt_var
in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
6603 eval "if test \"\${save_$lt_var+set}\" = set; then
6604 $lt_var=\$save_$lt_var; export $lt_var
6608 # Now prepare to actually exec the command.
6609 exec_cmd
="\$cmd$args"
6611 # Display what would be done.
6612 if test -n "$shlibpath_var"; then
6613 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
6614 $echo "export $shlibpath_var"
6621 # libtool clean and uninstall mode
6623 modename
="$modename: $mode"
6629 # This variable tells wrapper scripts just to set variables rather
6630 # than running their programs.
6631 libtool_install_magic
="$magic"
6636 -f) rm="$rm $arg"; rmforce
=yes ;;
6637 -*) rm="$rm $arg" ;;
6638 *) files
="$files $arg" ;;
6642 if test -z "$rm"; then
6643 $echo "$modename: you must specify an RM program" 1>&2
6650 origobjdir
="$objdir"
6651 for file in $files; do
6652 dir
=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
6653 if test "X$dir" = "X$file"; then
6655 objdir
="$origobjdir"
6657 objdir
="$dir/$origobjdir"
6659 name
=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
6660 test "$mode" = uninstall
&& objdir
="$dir"
6662 # Remember objdir for removal later, being careful to avoid duplicates
6663 if test "$mode" = clean
; then
6666 *) rmdirs
="$rmdirs $objdir" ;;
6670 # Don't error if the file doesn't exist and rm -f was used.
6671 if (test -L "$file") >/dev
/null
2>&1 \
6672 ||
(test -h "$file") >/dev
/null
2>&1 \
6673 ||
test -f "$file"; then
6675 elif test -d "$file"; then
6678 elif test "$rmforce" = yes; then
6686 # Possibly a libtool archive, so verify it.
6687 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6690 # Delete the libtool libraries and symlinks.
6691 for n
in $library_names; do
6692 rmfiles
="$rmfiles $objdir/$n"
6694 test -n "$old_library" && rmfiles
="$rmfiles $objdir/$old_library"
6698 case " $library_names " in
6699 # " " in the beginning catches empty $dlname
6701 *) rmfiles
="$rmfiles $objdir/$dlname" ;;
6703 test -n "$libdir" && rmfiles
="$rmfiles $objdir/$name $objdir/${name}i"
6706 if test -n "$library_names"; then
6707 # Do each command in the postuninstall commands.
6708 cmds
=$postuninstall_cmds
6709 save_ifs
="$IFS"; IFS
='~'
6710 for cmd
in $cmds; do
6715 if test "$?" -ne 0 && test "$rmforce" != yes; then
6722 if test -n "$old_library"; then
6723 # Do each command in the old_postuninstall commands.
6724 cmds
=$old_postuninstall_cmds
6725 save_ifs
="$IFS"; IFS
='~'
6726 for cmd
in $cmds; do
6731 if test "$?" -ne 0 && test "$rmforce" != yes; then
6737 # FIXME: should reinstall the best remaining shared library.
6744 # Possibly a libtool object, so verify it.
6745 if (${SED} -e '2q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6750 # Add PIC object to the list of files to remove.
6751 if test -n "$pic_object" \
6752 && test "$pic_object" != none
; then
6753 rmfiles
="$rmfiles $dir/$pic_object"
6756 # Add non-PIC object to the list of files to remove.
6757 if test -n "$non_pic_object" \
6758 && test "$non_pic_object" != none
; then
6759 rmfiles
="$rmfiles $dir/$non_pic_object"
6765 if test "$mode" = clean
; then
6769 file=`$echo $file|${SED} 's,.exe$,,'`
6770 noexename
=`$echo $name|${SED} 's,.exe$,,'`
6771 # $file with .exe has already been added to rmfiles,
6772 # add $file without .exe
6773 rmfiles
="$rmfiles $file"
6776 # Do a test to see if this is a libtool program.
6777 if (${SED} -e '4q' $file |
grep "^# Generated by .*$PACKAGE") >/dev
/null
2>&1; then
6781 # note $name still contains .exe if it was in $file originally
6782 # as does the version of $file that was added into $rmfiles
6783 rmfiles
="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
6784 if test "$fast_install" = yes && test -n "$relink_command"; then
6785 rmfiles
="$rmfiles $objdir/lt-$name"
6787 if test "X$noexename" != "X$name" ; then
6788 rmfiles
="$rmfiles $objdir/lt-${noexename}.c"
6794 $show "$rm $rmfiles"
6795 $run $rm $rmfiles || exit_status
=1
6797 objdir
="$origobjdir"
6799 # Try to remove the ${objdir}s in the directories where we deleted files
6800 for dir
in $rmdirs; do
6801 if test -d "$dir"; then
6803 $run rmdir $dir >/dev
/null
2>&1
6811 $echo "$modename: you must specify a MODE" 1>&2
6812 $echo "$generic_help" 1>&2
6817 if test -z "$exec_cmd"; then
6818 $echo "$modename: invalid operation mode \`$mode'" 1>&2
6819 $echo "$generic_help" 1>&2
6822 fi # test -z "$show_help"
6824 if test -n "$exec_cmd"; then
6829 # We need to display help for each of the modes.
6832 "Usage: $modename [OPTION]... [MODE-ARG]...
6834 Provide generalized library-building support services.
6836 --config show all configuration variables
6837 --debug enable verbose shell tracing
6838 -n, --dry-run display commands without modifying any files
6839 --features display basic configuration information and exit
6840 --finish same as \`--mode=finish'
6841 --help display this help message and exit
6842 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
6843 --quiet same as \`--silent'
6844 --silent don't print informational messages
6845 --tag=TAG use configuration variables from tag TAG
6846 --version print version information
6848 MODE must be one of the following:
6850 clean remove files from the build directory
6851 compile compile a source file into a libtool object
6852 execute automatically set library path, then run a program
6853 finish complete the installation of libtool libraries
6854 install install libraries or executables
6855 link create a library or an executable
6856 uninstall remove libraries from an installed directory
6858 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
6859 a more detailed description of MODE.
6861 Report bugs to <bug-libtool@gnu.org>."
6867 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
6869 Remove files from the build directory.
6871 RM is the name of the program to use to delete files associated with each FILE
6872 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
6875 If FILE is a libtool library, object or program, all the files associated
6876 with it are deleted. Otherwise, only FILE itself is deleted using RM."
6881 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
6883 Compile a source file into a libtool library object.
6885 This mode accepts the following additional options:
6887 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
6888 -prefer-pic try to building PIC objects only
6889 -prefer-non-pic try to building non-PIC objects only
6890 -static always build a \`.o' file suitable for static linking
6892 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
6893 from the given SOURCEFILE.
6895 The output file name is determined by removing the directory component from
6896 SOURCEFILE, then substituting the C source code suffix \`.c' with the
6897 library object suffix, \`.lo'."
6902 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
6904 Automatically set library path, then run a program.
6906 This mode accepts the following additional options:
6908 -dlopen FILE add the directory containing FILE to the library path
6910 This mode sets the library path environment variable according to \`-dlopen'
6913 If any of the ARGS are libtool executable wrappers, then they are translated
6914 into their corresponding uninstalled binary, and any of their required library
6915 directories are added to the library path.
6917 Then, COMMAND is executed, with ARGS as arguments."
6922 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
6924 Complete the installation of libtool libraries.
6926 Each LIBDIR is a directory that contains libtool libraries.
6928 The commands that this mode executes may require superuser privileges. Use
6929 the \`--dry-run' option if you just want to see what would be executed."
6934 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
6936 Install executables or libraries.
6938 INSTALL-COMMAND is the installation command. The first component should be
6939 either the \`install' or \`cp' program.
6941 The rest of the components are interpreted as arguments to that command (only
6942 BSD-compatible install options are recognized)."
6947 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
6949 Link object files or libraries together to form another library, or to
6950 create an executable program.
6952 LINK-COMMAND is a command using the C compiler that you would use to create
6953 a program from several object files.
6955 The following components of LINK-COMMAND are treated specially:
6957 -all-static do not do any dynamic linking at all
6958 -avoid-version do not add a version suffix if possible
6959 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
6960 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
6961 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6962 -export-symbols SYMFILE
6963 try to export only the symbols listed in SYMFILE
6964 -export-symbols-regex REGEX
6965 try to export only the symbols matching REGEX
6966 -LLIBDIR search LIBDIR for required installed libraries
6967 -lNAME OUTPUT-FILE requires the installed library libNAME
6968 -module build a library that can dlopened
6969 -no-fast-install disable the fast-install mode
6970 -no-install link a not-installable executable
6971 -no-undefined declare that a library does not refer to external symbols
6972 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
6973 -objectlist FILE Use a list of object files found in FILE to specify objects
6974 -precious-files-regex REGEX
6975 don't remove output files matching REGEX
6976 -release RELEASE specify package release information
6977 -rpath LIBDIR the created library will eventually be installed in LIBDIR
6978 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
6979 -static do not do any dynamic linking of uninstalled libtool libraries
6980 -static-libtool-libs
6981 do not do any dynamic linking of libtool libraries
6982 -version-info CURRENT[:REVISION[:AGE]]
6983 specify library version info [each variable defaults to 0]
6985 All other options (arguments beginning with \`-') are ignored.
6987 Every other argument is treated as a filename. Files ending in \`.la' are
6988 treated as uninstalled libtool libraries, other files are standard or library
6991 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
6992 only library objects (\`.lo' files) may be specified, and \`-rpath' is
6993 required, except when creating a convenience library.
6995 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
6996 using \`ar' and \`ranlib', or on Windows using \`lib'.
6998 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
6999 is created, otherwise an executable program is created."
7004 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
7006 Remove libraries from an installation directory.
7008 RM is the name of the program to use to delete files associated with each FILE
7009 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
7012 If FILE is a libtool library, all the files associated with it are deleted.
7013 Otherwise, only FILE itself is deleted using RM."
7017 $echo "$modename: invalid operation mode \`$mode'" 1>&2
7024 $echo "Try \`$modename --help' for more information about other modes."
7028 # The TAGs below are defined such that we never get into a situation
7029 # in which we disable both kinds of libraries. Given conflicting
7030 # choices, we go for a static library, that is the most portable,
7031 # since we can't tell whether shared libraries were disabled because
7032 # the user asked for that or because the platform doesn't support
7033 # them. This is particularly important on AIX, because we don't
7034 # support having both static and shared libraries enabled at the same
7035 # time on that platform, so we default to a shared-only configuration.
7036 # If a disable-shared tag is given, we'll fallback to a static-only
7037 # configuration. But we'll never go from static-only to shared-only.
7039 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
7041 # ### END LIBTOOL TAG CONFIG: disable-shared
7043 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
7045 # ### END LIBTOOL TAG CONFIG: disable-static