comparison ltmain.sh @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents a06113de4d67
children f6334be47118
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
1 # Generated from ltmain.m4sh. 1 # Generated from ltmain.m4sh.
2 2
3 # ltmain.sh (GNU libtool) 2.2.6 3 # libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
4 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 4 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5 5
6 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. 6 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
7 # 2007, 2008, 2009 Free Software Foundation, Inc.
7 # This is free software; see the source for copying conditions. There is NO 8 # This is free software; see the source for copying conditions. There is NO
8 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 10
10 # GNU Libtool is free software; you can redistribute it and/or modify 11 # GNU Libtool is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by 12 # it under the terms of the GNU General Public License as published by
30 31
31 # Usage: $progname [OPTION]... [MODE-ARG]... 32 # Usage: $progname [OPTION]... [MODE-ARG]...
32 # 33 #
33 # Provide generalized library-building support services. 34 # Provide generalized library-building support services.
34 # 35 #
35 # --config show all configuration variables 36 # --config show all configuration variables
36 # --debug enable verbose shell tracing 37 # --debug enable verbose shell tracing
37 # -n, --dry-run display commands without modifying any files 38 # -n, --dry-run display commands without modifying any files
38 # --features display basic configuration information and exit 39 # --features display basic configuration information and exit
39 # --mode=MODE use operation mode MODE 40 # --mode=MODE use operation mode MODE
40 # --preserve-dup-deps don't remove duplicate dependency libraries 41 # --no-finish let install mode avoid finish commands
41 # --quiet, --silent don't print informational messages 42 # --preserve-dup-deps don't remove duplicate dependency libraries
42 # --tag=TAG use configuration variables from tag TAG 43 # --quiet, --silent don't print informational messages
43 # -v, --verbose print informational messages (default) 44 # --no-quiet, --no-silent
44 # --version print version information 45 # print informational messages (default)
45 # -h, --help print short or long help message 46 # --tag=TAG use configuration variables from tag TAG
47 # -v, --verbose print more informational messages than default
48 # --no-verbose don't print the extra informational messages
49 # --version print version information
50 # -h, --help, --help-all print short, long, or detailed help message
46 # 51 #
47 # MODE must be one of the following: 52 # MODE must be one of the following:
48 # 53 #
49 # clean remove files from the build directory 54 # clean remove files from the build directory
50 # compile compile a source file into a libtool object 55 # compile compile a source file into a libtool object
51 # execute automatically set library path, then run a program 56 # execute automatically set library path, then run a program
52 # finish complete the installation of libtool libraries 57 # finish complete the installation of libtool libraries
53 # install install libraries or executables 58 # install install libraries or executables
54 # link create a library or an executable 59 # link create a library or an executable
55 # uninstall remove libraries from an installed directory 60 # uninstall remove libraries from an installed directory
56 # 61 #
57 # MODE-ARGS vary depending on the MODE. 62 # MODE-ARGS vary depending on the MODE. When passed as first option,
63 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
58 # Try `$progname --help --mode=MODE' for a more detailed description of MODE. 64 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
59 # 65 #
60 # When reporting a bug, please describe a test case to reproduce it and 66 # When reporting a bug, please describe a test case to reproduce it and
61 # include the following information: 67 # include the following information:
62 # 68 #
63 # host-triplet: $host 69 # host-triplet: $host
64 # shell: $SHELL 70 # shell: $SHELL
65 # compiler: $LTCC 71 # compiler: $LTCC
66 # compiler flags: $LTCFLAGS 72 # compiler flags: $LTCFLAGS
67 # linker: $LD (gnu? $with_gnu_ld) 73 # linker: $LD (gnu? $with_gnu_ld)
68 # $progname: (GNU libtool) 2.2.6 74 # $progname: (GNU libtool 1.3134 2009-11-29) 2.2.7a
69 # automake: $automake_version 75 # automake: $automake_version
70 # autoconf: $autoconf_version 76 # autoconf: $autoconf_version
71 # 77 #
72 # Report bugs to <bug-libtool@gnu.org>. 78 # Report bugs to <bug-libtool@gnu.org>.
73 79
74 PROGRAM=ltmain.sh 80 PROGRAM=libtool
75 PACKAGE=libtool 81 PACKAGE=libtool
76 VERSION=2.2.6 82 VERSION=2.2.7a
77 TIMESTAMP="" 83 TIMESTAMP=" 1.3134 2009-11-29"
78 package_revision=1.3012 84 package_revision=1.3134
79 85
80 # Be Bourne compatible 86 # Be Bourne compatible
81 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 87 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
82 emulate sh 88 emulate sh
83 NULLCMD=: 89 NULLCMD=:
88 else 94 else
89 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 95 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
90 fi 96 fi
91 BIN_SH=xpg4; export BIN_SH # for Tru64 97 BIN_SH=xpg4; export BIN_SH # for Tru64
92 DUALCASE=1; export DUALCASE # for MKS sh 98 DUALCASE=1; export DUALCASE # for MKS sh
99
100 # A function that is used when there is no print builtin or printf.
101 func_fallback_echo ()
102 {
103 eval 'cat <<_LTECHO_EOF
104 $1
105 _LTECHO_EOF'
106 }
93 107
94 # NLS nuisances: We save the old values to restore during execute mode. 108 # NLS nuisances: We save the old values to restore during execute mode.
95 # Only set LANG and LC_ALL to C if already set. 109 # Only set LANG and LC_ALL to C if already set.
96 # These must not be set unconditionally because not all systems understand 110 # These must not be set unconditionally because not all systems understand
97 # e.g. LANG=C (notably SCO). 111 # e.g. LANG=C (notably SCO).
112 126
113 127
114 128
115 129
116 130
131
132
133 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
134 # is ksh but when the shell is invoked as "sh" and the current value of
135 # the _XPG environment variable is not equal to 1 (one), the special
136 # positional parameter $0, within a function call, is the name of the
137 # function.
138 progpath="$0"
139
140
141
117 : ${CP="cp -f"} 142 : ${CP="cp -f"}
118 : ${ECHO="echo"} 143 : ${ECHO=$as_echo}
119 : ${EGREP="/usr/bin/grep -E"} 144 : ${EGREP="/bin/grep -E"}
120 : ${FGREP="/usr/bin/grep -F"} 145 : ${FGREP="/bin/grep -F"}
121 : ${GREP="/usr/bin/grep"} 146 : ${GREP="/bin/grep"}
122 : ${LN_S="ln -s"} 147 : ${LN_S="ln -s"}
123 : ${MAKE="make"} 148 : ${MAKE="make"}
124 : ${MKDIR="mkdir"} 149 : ${MKDIR="mkdir"}
125 : ${MV="mv -f"} 150 : ${MV="mv -f"}
126 : ${RM="rm -f"} 151 : ${RM="rm -f"}
127 : ${SED="/opt/local/bin/gsed"} 152 : ${SED="/mount/endor/wildenhu/local-x86_64/bin/sed"}
128 : ${SHELL="${CONFIG_SHELL-/bin/sh}"} 153 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
129 : ${Xsed="$SED -e 1s/^X//"} 154 : ${Xsed="$SED -e 1s/^X//"}
130 155
131 # Global variables: 156 # Global variables:
132 EXIT_SUCCESS=0 157 EXIT_SUCCESS=0
157 # and func_basename. For efficiency, we do not delegate to 182 # and func_basename. For efficiency, we do not delegate to
158 # those functions but instead duplicate the functionality here. 183 # those functions but instead duplicate the functionality here.
159 func_dirname_and_basename () 184 func_dirname_and_basename ()
160 { 185 {
161 # Extract subdirectory from the argument. 186 # Extract subdirectory from the argument.
162 func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` 187 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
163 if test "X$func_dirname_result" = "X${1}"; then 188 if test "X$func_dirname_result" = "X${1}"; then
164 func_dirname_result="${3}" 189 func_dirname_result="${3}"
165 else 190 else
166 func_dirname_result="$func_dirname_result${2}" 191 func_dirname_result="$func_dirname_result${2}"
167 fi 192 fi
168 func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` 193 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
169 } 194 }
170 195
171 # Generated shell functions inserted here. 196 # Generated shell functions inserted here.
172 197
173 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh 198 # These SED scripts presuppose an absolute path with a trailing slash.
174 # is ksh but when the shell is invoked as "sh" and the current value of 199 pathcar='s,^/\([^/]*\).*$,\1,'
175 # the _XPG environment variable is not equal to 1 (one), the special 200 pathcdr='s,^/[^/]*,,'
176 # positional parameter $0, within a function call, is the name of the 201 removedotparts=':dotsl
177 # function. 202 s@/\./@/@g
178 progpath="$0" 203 t dotsl
204 s,/\.$,/,'
205 collapseslashes='s@/\{1,\}@/@g'
206 finalslash='s,/*$,/,'
207
208 # func_normal_abspath PATH
209 # Remove doubled-up and trailing slashes, "." path components,
210 # and cancel out any ".." path components in PATH after making
211 # it an absolute path.
212 # value returned in "$func_normal_abspath_result"
213 func_normal_abspath ()
214 {
215 # Start from root dir and reassemble the path.
216 func_normal_abspath_result=
217 func_normal_abspath_tpath=$1
218 func_normal_abspath_altnamespace=
219 case $func_normal_abspath_tpath in
220 "")
221 # Empty path, that just means $cwd.
222 func_stripname '' '/' "`pwd`"
223 func_normal_abspath_result=$func_stripname_result
224 return
225 ;;
226 # The next three entries are used to spot a run of precisely
227 # two leading slashes without using negated character classes;
228 # we take advantage of case's first-match behaviour.
229 ///*)
230 # Unusual form of absolute path, do nothing.
231 ;;
232 //*)
233 # Not necessarily an ordinary path; POSIX reserves leading '//'
234 # and for example Cygwin uses it to access remote file shares
235 # over CIFS/SMB, so we conserve a leading double slash if found.
236 func_normal_abspath_altnamespace=/
237 ;;
238 /*)
239 # Absolute path, do nothing.
240 ;;
241 *)
242 # Relative path, prepend $cwd.
243 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
244 ;;
245 esac
246 # Cancel out all the simple stuff to save iterations. We also want
247 # the path to end with a slash for ease of parsing, so make sure
248 # there is one (and only one) here.
249 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
250 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
251 while :; do
252 # Processed it all yet?
253 if test "$func_normal_abspath_tpath" = / ; then
254 # If we ascended to the root using ".." the result may be empty now.
255 if test -z "$func_normal_abspath_result" ; then
256 func_normal_abspath_result=/
257 fi
258 break
259 fi
260 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
261 -e "$pathcar"`
262 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
263 -e "$pathcdr"`
264 # Figure out what to do with it
265 case $func_normal_abspath_tcomponent in
266 "")
267 # Trailing empty path component, ignore it.
268 ;;
269 ..)
270 # Parent dir; strip last assembled component from result.
271 func_dirname "$func_normal_abspath_result"
272 func_normal_abspath_result=$func_dirname_result
273 ;;
274 *)
275 # Actual path component, append it.
276 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
277 ;;
278 esac
279 done
280 # Restore leading double-slash if one was found on entry.
281 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
282 }
283
284 # func_relative_path SRCDIR DSTDIR
285 # generates a relative path from SRCDIR to DSTDIR, with a trailing
286 # slash if non-empty, suitable for immediately appending a filename
287 # without needing to append a separator.
288 # value returned in "$func_relative_path_result"
289 func_relative_path ()
290 {
291 func_relative_path_result=
292 func_normal_abspath "$1"
293 func_relative_path_tlibdir=$func_normal_abspath_result
294 func_normal_abspath "$2"
295 func_relative_path_tbindir=$func_normal_abspath_result
296
297 # Ascend the tree starting from libdir
298 while :; do
299 # check if we have found a prefix of bindir
300 case $func_relative_path_tbindir in
301 $func_relative_path_tlibdir)
302 # found an exact match
303 func_relative_path_tcancelled=
304 break
305 ;;
306 $func_relative_path_tlibdir*)
307 # found a matching prefix
308 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
309 func_relative_path_tcancelled=$func_stripname_result
310 if test -z "$func_relative_path_result"; then
311 func_relative_path_result=.
312 fi
313 break
314 ;;
315 *)
316 func_dirname $func_relative_path_tlibdir
317 func_relative_path_tlibdir=${func_dirname_result}
318 if test "x$func_relative_path_tlibdir" = x ; then
319 # Have to descend all the way to the root!
320 func_relative_path_result=../$func_relative_path_result
321 func_relative_path_tcancelled=$func_relative_path_tbindir
322 break
323 fi
324 func_relative_path_result=../$func_relative_path_result
325 ;;
326 esac
327 done
328
329 # Now calculate path; take care to avoid doubling-up slashes.
330 func_stripname '' '/' "$func_relative_path_result"
331 func_relative_path_result=$func_stripname_result
332 func_stripname '/' '/' "$func_relative_path_tcancelled"
333 if test "x$func_stripname_result" != x ; then
334 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
335 fi
336
337 # Normalisation. If bindir is libdir, return empty string,
338 # else relative path ending with a slash; either way, target
339 # file name can be directly appended.
340 if test ! -z "$func_relative_path_result"; then
341 func_stripname './' '' "$func_relative_path_result/"
342 func_relative_path_result=$func_stripname_result
343 fi
344 }
179 345
180 # The name of this program: 346 # The name of this program:
181 # In the unlikely event $progname began with a '-', it would play havoc with
182 # func_echo (imagine progname=-n), so we prepend ./ in that case:
183 func_dirname_and_basename "$progpath" 347 func_dirname_and_basename "$progpath"
184 progname=$func_basename_result 348 progname=$func_basename_result
185 case $progname in
186 -*) progname=./$progname ;;
187 esac
188 349
189 # Make sure we have an absolute path for reexecution: 350 # Make sure we have an absolute path for reexecution:
190 case $progpath in 351 case $progpath in
191 [\\/]*|[A-Za-z]:\\*) ;; 352 [\\/]*|[A-Za-z]:\\*) ;;
192 *[\\/]*) 353 *[\\/]*)
256 # fails when set -e is in force, so we need another command to 417 # fails when set -e is in force, so we need another command to
257 # work around that: 418 # work around that:
258 : 419 :
259 } 420 }
260 421
422 # func_echo_all arg...
423 # Invoke $ECHO with all args, space-separated.
424 func_echo_all ()
425 {
426 $ECHO "$*"
427 }
428
261 # func_error arg... 429 # func_error arg...
262 # Echo program name prefixed message to standard error. 430 # Echo program name prefixed message to standard error.
263 func_error () 431 func_error ()
264 { 432 {
265 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 433 $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
324 492
325 # If the last portion added has no slash in it, the list is done 493 # If the last portion added has no slash in it, the list is done
326 case $my_directory_path in */*) ;; *) break ;; esac 494 case $my_directory_path in */*) ;; *) break ;; esac
327 495
328 # ...otherwise throw away the child directory and loop 496 # ...otherwise throw away the child directory and loop
329 my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` 497 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
330 done 498 done
331 my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` 499 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
332 500
333 save_mkdir_p_IFS="$IFS"; IFS=':' 501 save_mkdir_p_IFS="$IFS"; IFS=':'
334 for my_dir in $my_dir_list; do 502 for my_dir in $my_dir_list; do
335 IFS="$save_mkdir_p_IFS" 503 IFS="$save_mkdir_p_IFS"
336 # mkdir can fail with a `File exist' error if two processes 504 # mkdir can fail with a `File exist' error if two processes
376 # If we're not in dry-run mode, bomb out on failure 544 # If we're not in dry-run mode, bomb out on failure
377 test -d "$my_tmpdir" || \ 545 test -d "$my_tmpdir" || \
378 func_fatal_error "cannot create temporary directory \`$my_tmpdir'" 546 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
379 fi 547 fi
380 548
381 $ECHO "X$my_tmpdir" | $Xsed 549 $ECHO "$my_tmpdir"
382 } 550 }
383 551
384 552
385 # func_quote_for_eval arg 553 # func_quote_for_eval arg
386 # Aesthetically quote ARG to be evaled later. 554 # Aesthetically quote ARG to be evaled later.
390 # which are still active within double quotes backslashified. 558 # which are still active within double quotes backslashified.
391 func_quote_for_eval () 559 func_quote_for_eval ()
392 { 560 {
393 case $1 in 561 case $1 in
394 *[\\\`\"\$]*) 562 *[\\\`\"\$]*)
395 func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; 563 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
396 *) 564 *)
397 func_quote_for_eval_unquoted_result="$1" ;; 565 func_quote_for_eval_unquoted_result="$1" ;;
398 esac 566 esac
399 567
400 case $func_quote_for_eval_unquoted_result in 568 case $func_quote_for_eval_unquoted_result in
417 # but do not quote variable references. 585 # but do not quote variable references.
418 func_quote_for_expand () 586 func_quote_for_expand ()
419 { 587 {
420 case $1 in 588 case $1 in
421 *[\\\`\"]*) 589 *[\\\`\"]*)
422 my_arg=`$ECHO "X$1" | $Xsed \ 590 my_arg=`$ECHO "$1" | $SED \
423 -e "$double_quote_subst" -e "$sed_double_backslash"` ;; 591 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
424 *) 592 *)
425 my_arg="$1" ;; 593 my_arg="$1" ;;
426 esac 594 esac
427 595
494 662
495 # func_version 663 # func_version
496 # Echo version message to standard output and exit. 664 # Echo version message to standard output and exit.
497 func_version () 665 func_version ()
498 { 666 {
499 $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { 667 $SED -n '/(C)/!b go
668 :more
669 /\./!{
670 N
671 s/\n# //
672 b more
673 }
674 :go
675 /^# '$PROGRAM' (GNU /,/# warranty; / {
500 s/^# // 676 s/^# //
501 s/^# *$// 677 s/^# *$//
502 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ 678 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
503 p 679 p
504 }' < "$progpath" 680 }' < "$progpath"
507 683
508 # func_usage 684 # func_usage
509 # Echo short help message to standard output and exit. 685 # Echo short help message to standard output and exit.
510 func_usage () 686 func_usage ()
511 { 687 {
512 $SED -n '/^# Usage:/,/# -h/ { 688 $SED -n '/^# Usage:/,/^# *-h/ {
513 s/^# // 689 s/^# //
514 s/^# *$// 690 s/^# *$//
515 s/\$progname/'$progname'/ 691 s/\$progname/'$progname'/
516 p 692 p
517 }' < "$progpath" 693 }' < "$progpath"
518 $ECHO 694 echo
519 $ECHO "run \`$progname --help | more' for full usage" 695 $ECHO "run \`$progname --help | more' for full usage"
520 exit $? 696 exit $?
521 } 697 }
522 698
523 # func_help 699 # func_help [NOEXIT]
524 # Echo long help message to standard output and exit. 700 # Echo long help message to standard output and exit,
701 # unless 'noexit' is passed as argument.
525 func_help () 702 func_help ()
526 { 703 {
527 $SED -n '/^# Usage:/,/# Report bugs to/ { 704 $SED -n '/^# Usage:/,/# Report bugs to/ {
528 s/^# // 705 s/^# //
529 s/^# *$// 706 s/^# *$//
536 s/\$with_gnu_ld/'"$with_gnu_ld"'/ 713 s/\$with_gnu_ld/'"$with_gnu_ld"'/
537 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ 714 s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
538 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ 715 s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
539 p 716 p
540 }' < "$progpath" 717 }' < "$progpath"
541 exit $? 718 ret=$?
719 if test -z "$1"; then
720 exit $ret
721 fi
542 } 722 }
543 723
544 # func_missing_arg argname 724 # func_missing_arg argname
545 # Echo program name prefixed message to standard error and set global 725 # Echo program name prefixed message to standard error and set global
546 # exit_cmd. 726 # exit_cmd.
554 734
555 735
556 736
557 737
558 738
559 # Check that we have a working $ECHO.
560 if test "X$1" = X--no-reexec; then
561 # Discard the --no-reexec flag, and continue.
562 shift
563 elif test "X$1" = X--fallback-echo; then
564 # Avoid inline document here, it may be left over
565 :
566 elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
567 # Yippee, $ECHO works!
568 :
569 else
570 # Restart under the correct shell, and then maybe $ECHO will work.
571 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
572 fi
573
574 if test "X$1" = X--fallback-echo; then
575 # used as fallback echo
576 shift
577 cat <<EOF
578 $*
579 EOF
580 exit $EXIT_SUCCESS
581 fi
582 739
583 magic="%%%MAGIC variable%%%" 740 magic="%%%MAGIC variable%%%"
584 magic_exe="%%%MAGIC EXE variable%%%" 741 magic_exe="%%%MAGIC EXE variable%%%"
585 742
586 # Global variables. 743 # Global variables.
592 o2lo="s/\\.${objext}\$/.lo/" 749 o2lo="s/\\.${objext}\$/.lo/"
593 extracted_archives= 750 extracted_archives=
594 extracted_serial=0 751 extracted_serial=0
595 752
596 opt_dry_run=false 753 opt_dry_run=false
754 opt_finish=:
597 opt_duplicate_deps=false 755 opt_duplicate_deps=false
598 opt_silent=false 756 opt_silent=false
599 opt_debug=: 757 opt_debug=:
600 758
601 # If this variable is set in any of the actions, the command in it 759 # If this variable is set in any of the actions, the command in it
634 792
635 # func_features 793 # func_features
636 # Display the features supported by this script. 794 # Display the features supported by this script.
637 func_features () 795 func_features ()
638 { 796 {
639 $ECHO "host: $host" 797 echo "host: $host"
640 if test "$build_libtool_libs" = yes; then 798 if test "$build_libtool_libs" = yes; then
641 $ECHO "enable shared libraries" 799 echo "enable shared libraries"
642 else 800 else
643 $ECHO "disable shared libraries" 801 echo "disable shared libraries"
644 fi 802 fi
645 if test "$build_old_libs" = yes; then 803 if test "$build_old_libs" = yes; then
646 $ECHO "enable static libraries" 804 echo "enable static libraries"
647 else 805 else
648 $ECHO "disable static libraries" 806 echo "disable static libraries"
649 fi 807 fi
650 808
651 exit $? 809 exit $?
652 } 810 }
653 811
741 ;; 899 ;;
742 900
743 --dry-run | -n) opt_dry_run=: ;; 901 --dry-run | -n) opt_dry_run=: ;;
744 --features) func_features ;; 902 --features) func_features ;;
745 --finish) mode="finish" ;; 903 --finish) mode="finish" ;;
904 --no-finish) opt_finish=false ;;
746 905
747 --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break 906 --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
748 case $1 in 907 case $1 in
749 # Valid mode arguments: 908 # Valid mode arguments:
750 clean) ;; 909 clean) ;;
770 --preserve-dup-deps) 929 --preserve-dup-deps)
771 opt_duplicate_deps=: ;; 930 opt_duplicate_deps=: ;;
772 931
773 --quiet|--silent) preserve_args="$preserve_args $opt" 932 --quiet|--silent) preserve_args="$preserve_args $opt"
774 opt_silent=: 933 opt_silent=:
934 opt_verbose=false
935 ;;
936
937 --no-quiet|--no-silent)
938 preserve_args="$preserve_args $opt"
939 opt_silent=false
775 ;; 940 ;;
776 941
777 --verbose| -v) preserve_args="$preserve_args $opt" 942 --verbose| -v) preserve_args="$preserve_args $opt"
778 opt_silent=false 943 opt_silent=false
944 opt_verbose=:
945 ;;
946
947 --no-verbose) preserve_args="$preserve_args $opt"
948 opt_verbose=false
779 ;; 949 ;;
780 950
781 --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break 951 --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
782 preserve_args="$preserve_args $opt $1" 952 preserve_args="$preserve_args $opt $1"
783 func_enable_tag "$1" # tagname is set here 953 func_enable_tag "$1" # tagname is set here
791 shift 961 shift
792 ;; 962 ;;
793 963
794 -\?|-h) func_usage ;; 964 -\?|-h) func_usage ;;
795 --help) opt_help=: ;; 965 --help) opt_help=: ;;
966 --help-all) opt_help=': help-all' ;;
796 --version) func_version ;; 967 --version) func_version ;;
797 968
798 -*) func_fatal_help "unrecognized option \`$opt'" ;; 969 -*) func_fatal_help "unrecognized option \`$opt'" ;;
799 970
800 *) nonopt="$opt" 971 *) nonopt="$opt"
869 1040
870 test -z "$mode" && func_fatal_error "error: you must specify a MODE." 1041 test -z "$mode" && func_fatal_error "error: you must specify a MODE."
871 1042
872 1043
873 # Darwin sucks 1044 # Darwin sucks
874 eval std_shrext=\"$shrext_cmds\" 1045 eval "std_shrext=\"$shrext_cmds\""
875 1046
876 1047
877 # Only execute mode is allowed to have -dlopen flags. 1048 # Only execute mode is allowed to have -dlopen flags.
878 if test -n "$execute_dlfiles" && test "$mode" != execute; then 1049 if test -n "$execute_dlfiles" && test "$mode" != execute; then
879 func_error "unrecognized option \`-dlopen'" 1050 func_error "unrecognized option \`-dlopen'"
976 { 1147 {
977 $opt_debug 1148 $opt_debug
978 save_ifs=$IFS; IFS='~' 1149 save_ifs=$IFS; IFS='~'
979 for cmd in $1; do 1150 for cmd in $1; do
980 IFS=$save_ifs 1151 IFS=$save_ifs
981 eval cmd=\"$cmd\" 1152 eval "cmd=\"$cmd\""
982 func_show_eval "$cmd" "${2-:}" 1153 func_show_eval "$cmd" "${2-:}"
983 done 1154 done
984 IFS=$save_ifs 1155 IFS=$save_ifs
985 } 1156 }
986 1157
1014 CC_quoted= 1185 CC_quoted=
1015 for arg in $CC; do 1186 for arg in $CC; do
1016 func_quote_for_eval "$arg" 1187 func_quote_for_eval "$arg"
1017 CC_quoted="$CC_quoted $func_quote_for_eval_result" 1188 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1018 done 1189 done
1190 CC_expanded=`func_echo_all $CC`
1191 CC_quoted_expanded=`func_echo_all $CC_quoted`
1019 case $@ in 1192 case $@ in
1020 # Blanks in the command may have been stripped by the calling shell, 1193 # Blanks in the command may have been stripped by the calling shell,
1021 # but not from the CC environment variable when configure was run. 1194 # but not from the CC environment variable when configure was run.
1022 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; 1195 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1196 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1023 # Blanks at the start of $base_compile will cause this to fail 1197 # Blanks at the start of $base_compile will cause this to fail
1024 # if we don't check for them as well. 1198 # if we don't check for them as well.
1025 *) 1199 *)
1026 for z in $available_tags; do 1200 for z in $available_tags; do
1027 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then 1201 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1031 for arg in $CC; do 1205 for arg in $CC; do
1032 # Double-quote args containing other shell metacharacters. 1206 # Double-quote args containing other shell metacharacters.
1033 func_quote_for_eval "$arg" 1207 func_quote_for_eval "$arg"
1034 CC_quoted="$CC_quoted $func_quote_for_eval_result" 1208 CC_quoted="$CC_quoted $func_quote_for_eval_result"
1035 done 1209 done
1210 CC_expanded=`func_echo_all $CC`
1211 CC_quoted_expanded=`func_echo_all $CC_quoted`
1036 case "$@ " in 1212 case "$@ " in
1037 " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) 1213 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1214 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1038 # The compiler in the base compile command matches 1215 # The compiler in the base compile command matches
1039 # the one in the tagged configuration. 1216 # the one in the tagged configuration.
1040 # Assume this is the tagged configuration we want. 1217 # Assume this is the tagged configuration we want.
1041 tagname=$z 1218 tagname=$z
1042 break 1219 break
1211 # If the user specifies -o file.o, it is replaced with file.lo 1388 # If the user specifies -o file.o, it is replaced with file.lo
1212 case $libobj in 1389 case $libobj in
1213 *.[cCFSifmso] | \ 1390 *.[cCFSifmso] | \
1214 *.ada | *.adb | *.ads | *.asm | \ 1391 *.ada | *.adb | *.ads | *.asm | \
1215 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ 1392 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1216 *.[fF][09]? | *.for | *.java | *.obj | *.sx) 1393 *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
1217 func_xform "$libobj" 1394 func_xform "$libobj"
1218 libobj=$func_xform_result 1395 libobj=$func_xform_result
1219 ;; 1396 ;;
1220 esac 1397 esac
1221 1398
1286 fi 1463 fi
1287 1464
1288 # Calculate the filename of the output object if compiler does 1465 # Calculate the filename of the output object if compiler does
1289 # not support -o with -c 1466 # not support -o with -c
1290 if test "$compiler_c_o" = no; then 1467 if test "$compiler_c_o" = no; then
1291 output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} 1468 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
1292 lockfile="$output_obj.lock" 1469 lockfile="$output_obj.lock"
1293 else 1470 else
1294 output_obj= 1471 output_obj=
1295 need_locks=no 1472 need_locks=no
1296 lockfile= 1473 lockfile=
1326 $opt_dry_run || $RM $removelist 1503 $opt_dry_run || $RM $removelist
1327 removelist="$removelist $lockfile" 1504 removelist="$removelist $lockfile"
1328 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 1505 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1329 1506
1330 if test -n "$fix_srcfile_path"; then 1507 if test -n "$fix_srcfile_path"; then
1331 eval srcfile=\"$fix_srcfile_path\" 1508 eval "srcfile=\"$fix_srcfile_path\""
1332 fi 1509 fi
1333 func_quote_for_eval "$srcfile" 1510 func_quote_for_eval "$srcfile"
1334 qsrcfile=$func_quote_for_eval_result 1511 qsrcfile=$func_quote_for_eval_result
1335 1512
1336 # Only build a PIC object if we are building libtool libraries. 1513 # Only build a PIC object if we are building libtool libraries.
1443 1620
1444 exit $EXIT_SUCCESS 1621 exit $EXIT_SUCCESS
1445 } 1622 }
1446 1623
1447 $opt_help || { 1624 $opt_help || {
1448 test "$mode" = compile && func_mode_compile ${1+"$@"} 1625 test "$mode" = compile && func_mode_compile ${1+"$@"}
1449 } 1626 }
1450 1627
1451 func_mode_help () 1628 func_mode_help ()
1452 { 1629 {
1453 # We need to display help for each of the modes. 1630 # We need to display help for each of the modes.
1484 -no-suppress do not suppress compiler output for multiple passes 1661 -no-suppress do not suppress compiler output for multiple passes
1485 -prefer-pic try to building PIC objects only 1662 -prefer-pic try to building PIC objects only
1486 -prefer-non-pic try to building non-PIC objects only 1663 -prefer-non-pic try to building non-PIC objects only
1487 -shared do not build a \`.o' file suitable for static linking 1664 -shared do not build a \`.o' file suitable for static linking
1488 -static only build a \`.o' file suitable for static linking 1665 -static only build a \`.o' file suitable for static linking
1666 -Wc,FLAG pass FLAG directly to the compiler
1489 1667
1490 COMPILE-COMMAND is a command to be used in creating a \`standard' object file 1668 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1491 from the given SOURCEFILE. 1669 from the given SOURCEFILE.
1492 1670
1493 The output file name is determined by removing the directory component from 1671 The output file name is determined by removing the directory component from
1536 INSTALL-COMMAND is the installation command. The first component should be 1714 INSTALL-COMMAND is the installation command. The first component should be
1537 either the \`install' or \`cp' program. 1715 either the \`install' or \`cp' program.
1538 1716
1539 The following components of INSTALL-COMMAND are treated specially: 1717 The following components of INSTALL-COMMAND are treated specially:
1540 1718
1541 -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation 1719 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
1542 1720
1543 The rest of the components are interpreted as arguments to that command (only 1721 The rest of the components are interpreted as arguments to that command (only
1544 BSD-compatible install options are recognized)." 1722 BSD-compatible install options are recognized)."
1545 ;; 1723 ;;
1546 1724
1556 1734
1557 The following components of LINK-COMMAND are treated specially: 1735 The following components of LINK-COMMAND are treated specially:
1558 1736
1559 -all-static do not do any dynamic linking at all 1737 -all-static do not do any dynamic linking at all
1560 -avoid-version do not add a version suffix if possible 1738 -avoid-version do not add a version suffix if possible
1739 -bindir BINDIR specify path to binaries directory (for systems where
1740 libraries must be found in the PATH setting at runtime)
1561 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime 1741 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
1562 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols 1742 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
1563 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) 1743 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
1564 -export-symbols SYMFILE 1744 -export-symbols SYMFILE
1565 try to export only the symbols listed in SYMFILE 1745 try to export only the symbols listed in SYMFILE
1584 -static-libtool-libs 1764 -static-libtool-libs
1585 do not do any dynamic linking of libtool libraries 1765 do not do any dynamic linking of libtool libraries
1586 -version-info CURRENT[:REVISION[:AGE]] 1766 -version-info CURRENT[:REVISION[:AGE]]
1587 specify library version info [each variable defaults to 0] 1767 specify library version info [each variable defaults to 0]
1588 -weak LIBNAME declare that the target provides the LIBNAME interface 1768 -weak LIBNAME declare that the target provides the LIBNAME interface
1769 -Wc,FLAG
1770 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
1771 -Wl,FLAG
1772 -Xlinker FLAG pass linker-specific FLAG directly to the linker
1773 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
1589 1774
1590 All other options (arguments beginning with \`-') are ignored. 1775 All other options (arguments beginning with \`-') are ignored.
1591 1776
1592 Every other argument is treated as a filename. Files ending in \`.la' are 1777 Every other argument is treated as a filename. Files ending in \`.la' are
1593 treated as uninstalled libtool libraries, other files are standard or library 1778 treated as uninstalled libtool libraries, other files are standard or library
1621 *) 1806 *)
1622 func_fatal_help "invalid operation mode \`$mode'" 1807 func_fatal_help "invalid operation mode \`$mode'"
1623 ;; 1808 ;;
1624 esac 1809 esac
1625 1810
1626 $ECHO 1811 echo
1627 $ECHO "Try \`$progname --help' for more information about other modes." 1812 $ECHO "Try \`$progname --help' for more information about other modes."
1628
1629 exit $?
1630 } 1813 }
1631 1814
1632 # Now that we've collected a possible --mode arg, show help if necessary 1815 # Now that we've collected a possible --mode arg, show help if necessary
1633 $opt_help && func_mode_help 1816 if $opt_help; then
1817 if test "$opt_help" = :; then
1818 func_mode_help
1819 else
1820 {
1821 func_help noexit
1822 for mode in compile link execute install finish uninstall clean; do
1823 func_mode_help
1824 done
1825 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
1826 {
1827 func_help noexit
1828 for mode in compile link execute install finish uninstall clean; do
1829 echo
1830 func_mode_help
1831 done
1832 } |
1833 sed '1d
1834 /^When reporting/,/^Report/{
1835 H
1836 d
1837 }
1838 $x
1839 /information about other modes/d
1840 /more detailed .*MODE/d
1841 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
1842 fi
1843 exit $?
1844 fi
1634 1845
1635 1846
1636 # func_mode_execute arg... 1847 # func_mode_execute arg...
1637 func_mode_execute () 1848 func_mode_execute ()
1638 { 1849 {
1694 # Get the absolute pathname. 1905 # Get the absolute pathname.
1695 absdir=`cd "$dir" && pwd` 1906 absdir=`cd "$dir" && pwd`
1696 test -n "$absdir" && dir="$absdir" 1907 test -n "$absdir" && dir="$absdir"
1697 1908
1698 # Now add the directory to shlibpath_var. 1909 # Now add the directory to shlibpath_var.
1699 if eval "test -z \"\$$shlibpath_var\""; then 1910 if eval test -z \"\$$shlibpath_var\"; then
1700 eval "$shlibpath_var=\"\$dir\"" 1911 eval $shlibpath_var=\$dir
1701 else 1912 else
1702 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" 1913 eval $shlibpath_var=\$dir:\$$shlibpath_var
1703 fi 1914 fi
1704 done 1915 done
1705 1916
1706 # This variable tells wrapper scripts just to set shlibpath_var 1917 # This variable tells wrapper scripts just to set shlibpath_var
1707 # rather than running their programs. 1918 # rather than running their programs.
1710 # Check if any of the arguments is a wrapper script. 1921 # Check if any of the arguments is a wrapper script.
1711 args= 1922 args=
1712 for file 1923 for file
1713 do 1924 do
1714 case $file in 1925 case $file in
1715 -*) ;; 1926 -* | *.la | *.lo ) ;;
1716 *) 1927 *)
1717 # Do a test to see if this is really a libtool program. 1928 # Do a test to see if this is really a libtool program.
1718 if func_ltwrapper_script_p "$file"; then 1929 if func_ltwrapper_script_p "$file"; then
1719 func_source "$file" 1930 func_source "$file"
1720 # Transform arg to wrapped name. 1931 # Transform arg to wrapped name.
1752 exec_cmd="\$cmd$args" 1963 exec_cmd="\$cmd$args"
1753 else 1964 else
1754 # Display what would be done. 1965 # Display what would be done.
1755 if test -n "$shlibpath_var"; then 1966 if test -n "$shlibpath_var"; then
1756 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" 1967 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
1757 $ECHO "export $shlibpath_var" 1968 echo "export $shlibpath_var"
1758 fi 1969 fi
1759 $ECHO "$cmd$args" 1970 $ECHO "$cmd$args"
1760 exit $EXIT_SUCCESS 1971 exit $EXIT_SUCCESS
1761 fi 1972 fi
1762 } 1973 }
1793 fi 2004 fi
1794 2005
1795 # Exit here if they wanted silent mode. 2006 # Exit here if they wanted silent mode.
1796 $opt_silent && exit $EXIT_SUCCESS 2007 $opt_silent && exit $EXIT_SUCCESS
1797 2008
1798 $ECHO "X----------------------------------------------------------------------" | $Xsed 2009 echo "----------------------------------------------------------------------"
1799 $ECHO "Libraries have been installed in:" 2010 echo "Libraries have been installed in:"
1800 for libdir in $libdirs; do 2011 for libdir in $libdirs; do
1801 $ECHO " $libdir" 2012 $ECHO " $libdir"
1802 done 2013 done
1803 $ECHO 2014 echo
1804 $ECHO "If you ever happen to want to link against installed libraries" 2015 echo "If you ever happen to want to link against installed libraries"
1805 $ECHO "in a given directory, LIBDIR, you must either use libtool, and" 2016 echo "in a given directory, LIBDIR, you must either use libtool, and"
1806 $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" 2017 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
1807 $ECHO "flag during linking and do at least one of the following:" 2018 echo "flag during linking and do at least one of the following:"
1808 if test -n "$shlibpath_var"; then 2019 if test -n "$shlibpath_var"; then
1809 $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" 2020 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
1810 $ECHO " during execution" 2021 echo " during execution"
1811 fi 2022 fi
1812 if test -n "$runpath_var"; then 2023 if test -n "$runpath_var"; then
1813 $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" 2024 echo " - add LIBDIR to the \`$runpath_var' environment variable"
1814 $ECHO " during linking" 2025 echo " during linking"
1815 fi 2026 fi
1816 if test -n "$hardcode_libdir_flag_spec"; then 2027 if test -n "$hardcode_libdir_flag_spec"; then
1817 libdir=LIBDIR 2028 libdir=LIBDIR
1818 eval flag=\"$hardcode_libdir_flag_spec\" 2029 eval "flag=\"$hardcode_libdir_flag_spec\""
1819 2030
1820 $ECHO " - use the \`$flag' linker flag" 2031 $ECHO " - use the \`$flag' linker flag"
1821 fi 2032 fi
1822 if test -n "$admincmds"; then 2033 if test -n "$admincmds"; then
1823 $ECHO " - have your system administrator run these commands:$admincmds" 2034 $ECHO " - have your system administrator run these commands:$admincmds"
1824 fi 2035 fi
1825 if test -f /etc/ld.so.conf; then 2036 if test -f /etc/ld.so.conf; then
1826 $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" 2037 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
1827 fi 2038 fi
1828 $ECHO 2039 echo
1829 2040
1830 $ECHO "See any operating system documentation about shared libraries for" 2041 echo "See any operating system documentation about shared libraries for"
1831 case $host in 2042 case $host in
1832 solaris2.[6789]|solaris2.1[0-9]) 2043 solaris2.[6789]|solaris2.1[0-9])
1833 $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" 2044 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
1834 $ECHO "pages." 2045 echo "pages."
1835 ;; 2046 ;;
1836 *) 2047 *)
1837 $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." 2048 echo "more information, such as the ld(1) and ld.so(8) manual pages."
1838 ;; 2049 ;;
1839 esac 2050 esac
1840 $ECHO "X----------------------------------------------------------------------" | $Xsed 2051 echo "----------------------------------------------------------------------"
1841 exit $EXIT_SUCCESS 2052 exit $EXIT_SUCCESS
1842 } 2053 }
1843 2054
1844 test "$mode" = finish && func_mode_finish ${1+"$@"} 2055 test "$mode" = finish && func_mode_finish ${1+"$@"}
1845 2056
1850 $opt_debug 2061 $opt_debug
1851 # There may be an optional sh(1) argument at the beginning of 2062 # There may be an optional sh(1) argument at the beginning of
1852 # install_prog (especially on Windows NT). 2063 # install_prog (especially on Windows NT).
1853 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || 2064 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
1854 # Allow the use of GNU shtool's install command. 2065 # Allow the use of GNU shtool's install command.
1855 $ECHO "X$nonopt" | $GREP shtool >/dev/null; then 2066 case $nonopt in *shtool*) :;; *) false;; esac; then
1856 # Aesthetically quote it. 2067 # Aesthetically quote it.
1857 func_quote_for_eval "$nonopt" 2068 func_quote_for_eval "$nonopt"
1858 install_prog="$func_quote_for_eval_result " 2069 install_prog="$func_quote_for_eval_result "
1859 arg=$1 2070 arg=$1
1860 shift 2071 shift
1865 2076
1866 # The real first argument should be the name of the installation program. 2077 # The real first argument should be the name of the installation program.
1867 # Aesthetically quote it. 2078 # Aesthetically quote it.
1868 func_quote_for_eval "$arg" 2079 func_quote_for_eval "$arg"
1869 install_prog="$install_prog$func_quote_for_eval_result" 2080 install_prog="$install_prog$func_quote_for_eval_result"
2081 install_shared_prog=$install_prog
2082 case " $install_prog " in
2083 *[\\\ /]cp\ *) install_cp=: ;;
2084 *) install_cp=false ;;
2085 esac
1870 2086
1871 # We need to accept at least all the BSD install flags. 2087 # We need to accept at least all the BSD install flags.
1872 dest= 2088 dest=
1873 files= 2089 files=
1874 opts= 2090 opts=
1875 prev= 2091 prev=
1876 install_type= 2092 install_type=
1877 isdir=no 2093 isdir=no
1878 stripme= 2094 stripme=
2095 no_mode=:
1879 for arg 2096 for arg
1880 do 2097 do
2098 arg2=
1881 if test -n "$dest"; then 2099 if test -n "$dest"; then
1882 files="$files $dest" 2100 files="$files $dest"
1883 dest=$arg 2101 dest=$arg
1884 continue 2102 continue
1885 fi 2103 fi
1886 2104
1887 case $arg in 2105 case $arg in
1888 -d) isdir=yes ;; 2106 -d) isdir=yes ;;
1889 -f) 2107 -f)
1890 case " $install_prog " in 2108 if $install_cp; then :; else
1891 *[\\\ /]cp\ *) ;; 2109 prev=$arg
1892 *) prev=$arg ;; 2110 fi
1893 esac
1894 ;; 2111 ;;
1895 -g | -m | -o) 2112 -g | -m | -o)
1896 prev=$arg 2113 prev=$arg
1897 ;; 2114 ;;
1898 -s) 2115 -s)
1902 -*) 2119 -*)
1903 ;; 2120 ;;
1904 *) 2121 *)
1905 # If the previous option needed an argument, then skip it. 2122 # If the previous option needed an argument, then skip it.
1906 if test -n "$prev"; then 2123 if test -n "$prev"; then
2124 if test "x$prev" = x-m && test -n "$install_override_mode"; then
2125 arg2=$install_override_mode
2126 no_mode=false
2127 fi
1907 prev= 2128 prev=
1908 else 2129 else
1909 dest=$arg 2130 dest=$arg
1910 continue 2131 continue
1911 fi 2132 fi
1913 esac 2134 esac
1914 2135
1915 # Aesthetically quote the argument. 2136 # Aesthetically quote the argument.
1916 func_quote_for_eval "$arg" 2137 func_quote_for_eval "$arg"
1917 install_prog="$install_prog $func_quote_for_eval_result" 2138 install_prog="$install_prog $func_quote_for_eval_result"
2139 if test -n "$arg2"; then
2140 func_quote_for_eval "$arg2"
2141 fi
2142 install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
1918 done 2143 done
1919 2144
1920 test -z "$install_prog" && \ 2145 test -z "$install_prog" && \
1921 func_fatal_help "you must specify an install program" 2146 func_fatal_help "you must specify an install program"
1922 2147
1923 test -n "$prev" && \ 2148 test -n "$prev" && \
1924 func_fatal_help "the \`$prev' option requires an argument" 2149 func_fatal_help "the \`$prev' option requires an argument"
2150
2151 if test -n "$install_override_mode" && $no_mode; then
2152 if $install_cp; then :; else
2153 func_quote_for_eval "$install_override_mode"
2154 install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
2155 fi
2156 fi
1925 2157
1926 if test -z "$files"; then 2158 if test -z "$files"; then
1927 if test -z "$dest"; then 2159 if test -z "$dest"; then
1928 func_fatal_help "no file or destination specified" 2160 func_fatal_help "no file or destination specified"
1929 else 2161 else
2008 dir="$func_dirname_result" 2240 dir="$func_dirname_result"
2009 dir="$dir$objdir" 2241 dir="$dir$objdir"
2010 2242
2011 if test -n "$relink_command"; then 2243 if test -n "$relink_command"; then
2012 # Determine the prefix the user has applied to our future dir. 2244 # Determine the prefix the user has applied to our future dir.
2013 inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` 2245 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2014 2246
2015 # Don't allow the user to place us outside of our expected 2247 # Don't allow the user to place us outside of our expected
2016 # location b/c this prevents finding dependent libraries that 2248 # location b/c this prevents finding dependent libraries that
2017 # are installed to the same prefix. 2249 # are installed to the same prefix.
2018 # At present, this check doesn't affect windows .dll's that 2250 # At present, this check doesn't affect windows .dll's that
2021 test "$inst_prefix_dir" = "$destdir" && \ 2253 test "$inst_prefix_dir" = "$destdir" && \
2022 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" 2254 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2023 2255
2024 if test -n "$inst_prefix_dir"; then 2256 if test -n "$inst_prefix_dir"; then
2025 # Stick the inst_prefix_dir data into the link command. 2257 # Stick the inst_prefix_dir data into the link command.
2026 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` 2258 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2027 else 2259 else
2028 relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` 2260 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2029 fi 2261 fi
2030 2262
2031 func_warning "relinking \`$file'" 2263 func_warning "relinking \`$file'"
2032 func_show_eval "$relink_command" \ 2264 func_show_eval "$relink_command" \
2033 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' 2265 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2041 2273
2042 srcname="$realname" 2274 srcname="$realname"
2043 test -n "$relink_command" && srcname="$realname"T 2275 test -n "$relink_command" && srcname="$realname"T
2044 2276
2045 # Install the shared library and build the symlinks. 2277 # Install the shared library and build the symlinks.
2046 func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 2278 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
2047 'exit $?' 2279 'exit $?'
2048 tstripme="$stripme" 2280 tstripme="$stripme"
2049 case $host_os in 2281 case $host_os in
2050 cygwin* | mingw* | pw32* | cegcc*) 2282 cygwin* | mingw* | pw32* | cegcc*)
2051 case $realname in 2283 case $realname in
2181 # Check to see that each library is installed. 2413 # Check to see that each library is installed.
2182 libdir= 2414 libdir=
2183 if test -f "$lib"; then 2415 if test -f "$lib"; then
2184 func_source "$lib" 2416 func_source "$lib"
2185 fi 2417 fi
2186 libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test 2418 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
2187 if test -n "$libdir" && test ! -f "$libfile"; then 2419 if test -n "$libdir" && test ! -f "$libfile"; then
2188 func_warning "\`$lib' has not been installed in \`$libdir'" 2420 func_warning "\`$lib' has not been installed in \`$libdir'"
2189 finalize=no 2421 finalize=no
2190 fi 2422 fi
2191 done 2423 done
2200 tmpdir=`func_mktempdir` 2432 tmpdir=`func_mktempdir`
2201 func_basename "$file$stripped_ext" 2433 func_basename "$file$stripped_ext"
2202 file="$func_basename_result" 2434 file="$func_basename_result"
2203 outputname="$tmpdir/$file" 2435 outputname="$tmpdir/$file"
2204 # Replace the output file specification. 2436 # Replace the output file specification.
2205 relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` 2437 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
2206 2438
2207 $opt_silent || { 2439 $opt_silent || {
2208 func_quote_for_expand "$relink_command" 2440 func_quote_for_expand "$relink_command"
2209 eval "func_echo $func_quote_for_expand_result" 2441 eval "func_echo $func_quote_for_expand_result"
2210 } 2442 }
2219 func_warning "cannot relink \`$file'" 2451 func_warning "cannot relink \`$file'"
2220 fi 2452 fi
2221 } 2453 }
2222 else 2454 else
2223 # Install the binary that we compiled earlier. 2455 # Install the binary that we compiled earlier.
2224 file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` 2456 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
2225 fi 2457 fi
2226 fi 2458 fi
2227 2459
2228 # remove .exe since cygwin /usr/bin/install will append another 2460 # remove .exe since cygwin /usr/bin/install will append another
2229 # one anyway 2461 # one anyway
2269 done 2501 done
2270 2502
2271 test -n "$future_libdirs" && \ 2503 test -n "$future_libdirs" && \
2272 func_warning "remember to run \`$progname --finish$future_libdirs'" 2504 func_warning "remember to run \`$progname --finish$future_libdirs'"
2273 2505
2274 if test -n "$current_libdirs"; then 2506 if test -n "$current_libdirs" && $opt_finish; then
2275 # Maybe just do a dry run. 2507 # Maybe just do a dry run.
2276 $opt_dry_run && current_libdirs=" -n$current_libdirs" 2508 $opt_dry_run && current_libdirs=" -n$current_libdirs"
2277 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' 2509 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
2278 else 2510 else
2279 exit $EXIT_SUCCESS 2511 exit $EXIT_SUCCESS
2321 2553
2322 #ifdef __cplusplus 2554 #ifdef __cplusplus
2323 extern \"C\" { 2555 extern \"C\" {
2324 #endif 2556 #endif
2325 2557
2558 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
2559 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
2560 #endif
2561
2326 /* External symbol declarations for the compiler. */\ 2562 /* External symbol declarations for the compiler. */\
2327 " 2563 "
2328 2564
2329 if test "$dlself" = yes; then 2565 if test "$dlself" = yes; then
2330 func_verbose "generating symbol list for \`$output'" 2566 func_verbose "generating symbol list for \`$output'"
2331 2567
2332 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" 2568 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2333 2569
2334 # Add our own program objects to the symbol list. 2570 # Add our own program objects to the symbol list.
2335 progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 2571 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
2336 for progfile in $progfiles; do 2572 for progfile in $progfiles; do
2337 func_verbose "extracting global C symbols from \`$progfile'" 2573 func_verbose "extracting global C symbols from \`$progfile'"
2338 $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" 2574 $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2339 done 2575 done
2340 2576
2341 if test -n "$exclude_expsyms"; then 2577 if test -n "$exclude_expsyms"; then
2342 $opt_dry_run || { 2578 $opt_dry_run || {
2343 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' 2579 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2344 eval '$MV "$nlist"T "$nlist"' 2580 $MV "$nlist"T "$nlist"
2345 } 2581 }
2346 fi 2582 fi
2347 2583
2348 if test -n "$export_symbols_regex"; then 2584 if test -n "$export_symbols_regex"; then
2349 $opt_dry_run || { 2585 $opt_dry_run || {
2350 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' 2586 $EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T
2351 eval '$MV "$nlist"T "$nlist"' 2587 $MV "$nlist"T "$nlist"
2352 } 2588 }
2353 fi 2589 fi
2354 2590
2355 # Prepare the list of exported symbols 2591 # Prepare the list of exported symbols
2356 if test -z "$export_symbols"; then 2592 if test -z "$export_symbols"; then
2357 export_symbols="$output_objdir/$outputname.exp" 2593 export_symbols="$output_objdir/$outputname.exp"
2358 $opt_dry_run || { 2594 $opt_dry_run || {
2359 $RM $export_symbols 2595 $RM $export_symbols
2360 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' 2596 ${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' < "$nlist" > "$export_symbols"
2361 case $host in 2597 case $host in
2362 *cygwin* | *mingw* | *cegcc* ) 2598 *cygwin* | *mingw* | *cegcc* )
2363 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 2599 echo EXPORTS > "$output_objdir/$outputname.def"
2364 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' 2600 cat "$export_symbols" >> "$output_objdir/$outputname.def"
2365 ;; 2601 ;;
2366 esac 2602 esac
2367 } 2603 }
2368 else 2604 else
2369 $opt_dry_run || { 2605 $opt_dry_run || {
2370 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' 2606 ${SED} -e 's/\([].[*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/' < "$export_symbols" > "$output_objdir/$outputname.exp"
2371 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' 2607 $GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T
2372 eval '$MV "$nlist"T "$nlist"' 2608 $MV "$nlist"T "$nlist"
2373 case $host in 2609 case $host in
2374 *cygwin | *mingw* | *cegcc* ) 2610 *cygwin* | *mingw* | *cegcc* )
2375 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 2611 echo EXPORTS > "$output_objdir/$outputname.def"
2376 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' 2612 cat "$nlist" >> "$output_objdir/$outputname.def"
2377 ;; 2613 ;;
2378 esac 2614 esac
2379 } 2615 }
2380 fi 2616 fi
2381 fi 2617 fi
2383 for dlprefile in $dlprefiles; do 2619 for dlprefile in $dlprefiles; do
2384 func_verbose "extracting global C symbols from \`$dlprefile'" 2620 func_verbose "extracting global C symbols from \`$dlprefile'"
2385 func_basename "$dlprefile" 2621 func_basename "$dlprefile"
2386 name="$func_basename_result" 2622 name="$func_basename_result"
2387 $opt_dry_run || { 2623 $opt_dry_run || {
2388 eval '$ECHO ": $name " >> "$nlist"' 2624 $ECHO ": $name " >> "$nlist"
2389 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" 2625 eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2390 } 2626 }
2391 done 2627 done
2392 2628
2393 $opt_dry_run || { 2629 $opt_dry_run || {
2413 fi 2649 fi
2414 2650
2415 if test -f "$nlist"S; then 2651 if test -f "$nlist"S; then
2416 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' 2652 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2417 else 2653 else
2418 $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" 2654 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
2419 fi 2655 fi
2420 2656
2421 $ECHO >> "$output_objdir/$my_dlsyms" "\ 2657 echo >> "$output_objdir/$my_dlsyms" "\
2422 2658
2423 /* The mapping between symbol names and symbols. */ 2659 /* The mapping between symbol names and symbols. */
2424 typedef struct { 2660 typedef struct {
2425 const char *name; 2661 const char *name;
2426 void *address; 2662 void *address;
2427 } lt_dlsymlist; 2663 } lt_dlsymlist;
2428 " 2664 "
2429 case $host in 2665 case $host in
2430 *cygwin* | *mingw* | *cegcc* ) 2666 *cygwin* | *mingw* | *cegcc* )
2431 $ECHO >> "$output_objdir/$my_dlsyms" "\ 2667 echo >> "$output_objdir/$my_dlsyms" "\
2432 /* DATA imports from DLLs on WIN32 con't be const, because 2668 /* DATA imports from DLLs on WIN32 con't be const, because
2433 runtime relocations are performed -- see ld's documentation 2669 runtime relocations are performed -- see ld's documentation
2434 on pseudo-relocs. */" 2670 on pseudo-relocs. */"
2435 lt_dlsym_const= ;; 2671 lt_dlsym_const= ;;
2436 *osf5*) 2672 *osf5*)
2439 lt_dlsym_const= ;; 2675 lt_dlsym_const= ;;
2440 *) 2676 *)
2441 lt_dlsym_const=const ;; 2677 lt_dlsym_const=const ;;
2442 esac 2678 esac
2443 2679
2444 $ECHO >> "$output_objdir/$my_dlsyms" "\ 2680 echo >> "$output_objdir/$my_dlsyms" "\
2445 extern $lt_dlsym_const lt_dlsymlist 2681 extern $lt_dlsym_const lt_dlsymlist
2446 lt_${my_prefix}_LTX_preloaded_symbols[]; 2682 lt_${my_prefix}_LTX_preloaded_symbols[];
2447 $lt_dlsym_const lt_dlsymlist 2683 $lt_dlsym_const lt_dlsymlist
2448 lt_${my_prefix}_LTX_preloaded_symbols[] = 2684 lt_${my_prefix}_LTX_preloaded_symbols[] =
2449 {\ 2685 {\
2455 ;; 2691 ;;
2456 *) 2692 *)
2457 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" 2693 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2458 ;; 2694 ;;
2459 esac 2695 esac
2460 $ECHO >> "$output_objdir/$my_dlsyms" "\ 2696 echo >> "$output_objdir/$my_dlsyms" "\
2461 {0, (void *) 0} 2697 {0, (void *) 0}
2462 }; 2698 };
2463 2699
2464 /* This works around a problem in FreeBSD linker */ 2700 /* This works around a problem in FreeBSD linker */
2465 #ifdef FREEBSD_WORKAROUND 2701 #ifdef FREEBSD_WORKAROUND
2513 # Transform the symbol file into the correct name. 2749 # Transform the symbol file into the correct name.
2514 symfileobj="$output_objdir/${my_outputname}S.$objext" 2750 symfileobj="$output_objdir/${my_outputname}S.$objext"
2515 case $host in 2751 case $host in
2516 *cygwin* | *mingw* | *cegcc* ) 2752 *cygwin* | *mingw* | *cegcc* )
2517 if test -f "$output_objdir/$my_outputname.def"; then 2753 if test -f "$output_objdir/$my_outputname.def"; then
2518 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` 2754 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2519 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` 2755 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2520 else 2756 else
2521 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` 2757 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2522 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` 2758 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2523 fi 2759 fi
2524 ;; 2760 ;;
2525 *) 2761 *)
2526 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` 2762 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2527 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` 2763 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2528 ;; 2764 ;;
2529 esac 2765 esac
2530 ;; 2766 ;;
2531 *) 2767 *)
2532 func_fatal_error "unknown suffix for \`$my_dlsyms'" 2768 func_fatal_error "unknown suffix for \`$my_dlsyms'"
2536 # We keep going just in case the user didn't refer to 2772 # We keep going just in case the user didn't refer to
2537 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe 2773 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2538 # really was required. 2774 # really was required.
2539 2775
2540 # Nullify the symbol file. 2776 # Nullify the symbol file.
2541 compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` 2777 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
2542 finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` 2778 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
2543 fi 2779 fi
2544 } 2780 }
2545 2781
2546 # func_win32_libid arg 2782 # func_win32_libid arg
2547 # return the library type of file 'arg' 2783 # return the library type of file 'arg'
2548 # 2784 #
2549 # Need a lot of goo to handle *both* DLLs and import libs 2785 # Need a lot of goo to handle *both* DLLs and import libs
2550 # Has to be a shell function in order to 'eat' the argument 2786 # Has to be a shell function in order to 'eat' the argument
2551 # that is supplied when $file_magic_command is called. 2787 # that is supplied when $file_magic_command is called.
2788 # Despite the name, also deal with 64 bit binaries.
2552 func_win32_libid () 2789 func_win32_libid ()
2553 { 2790 {
2554 $opt_debug 2791 $opt_debug
2555 win32_libid_type="unknown" 2792 win32_libid_type="unknown"
2556 win32_fileres=`file -L $1 2>/dev/null` 2793 win32_fileres=`file -L $1 2>/dev/null`
2557 case $win32_fileres in 2794 case $win32_fileres in
2558 *ar\ archive\ import\ library*) # definitely import 2795 *ar\ archive\ import\ library*) # definitely import
2559 win32_libid_type="x86 archive import" 2796 win32_libid_type="x86 archive import"
2560 ;; 2797 ;;
2561 *ar\ archive*) # could be an import, or static 2798 *ar\ archive*) # could be an import, or static
2562 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | 2799 if $OBJDUMP -f "$1" | $SED -e '10q' 2>/dev/null |
2563 $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then 2800 $EGREP 'file format (pe-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
2564 win32_nmres=`eval $NM -f posix -A $1 | 2801 win32_nmres=`$NM -f posix -A "$1" |
2565 $SED -n -e ' 2802 $SED -n -e '
2566 1,100{ 2803 1,100{
2567 / I /{ 2804 / I /{
2568 s,.*,import, 2805 s,.*,import,
2569 p 2806 p
2596 func_extract_an_archive () 2833 func_extract_an_archive ()
2597 { 2834 {
2598 $opt_debug 2835 $opt_debug
2599 f_ex_an_ar_dir="$1"; shift 2836 f_ex_an_ar_dir="$1"; shift
2600 f_ex_an_ar_oldlib="$1" 2837 f_ex_an_ar_oldlib="$1"
2601 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' 2838 if test "$lock_old_archive_extraction" = yes; then
2839 lockfile=$f_ex_an_ar_oldlib.lock
2840 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2841 func_echo "Waiting for $lockfile to be removed"
2842 sleep 2
2843 done
2844 fi
2845 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
2846 'stat=$?; rm -f "$lockfile"; exit $stat'
2847 if test "$lock_old_archive_extraction" = yes; then
2848 $opt_dry_run || rm -f "$lockfile"
2849 fi
2602 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then 2850 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
2603 : 2851 :
2604 else 2852 else
2605 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 2853 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
2606 fi 2854 fi
2689 2937
2690 func_extract_archives_result="$my_oldobjs" 2938 func_extract_archives_result="$my_oldobjs"
2691 } 2939 }
2692 2940
2693 2941
2694
2695 # func_emit_wrapper_part1 [arg=no]
2696 #
2697 # Emit the first part of a libtool wrapper script on stdout.
2698 # For more information, see the description associated with
2699 # func_emit_wrapper(), below.
2700 func_emit_wrapper_part1 ()
2701 {
2702 func_emit_wrapper_part1_arg1=no
2703 if test -n "$1" ; then
2704 func_emit_wrapper_part1_arg1=$1
2705 fi
2706
2707 $ECHO "\
2708 #! $SHELL
2709
2710 # $output - temporary wrapper script for $objdir/$outputname
2711 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
2712 #
2713 # The $output program cannot be directly executed until all the libtool
2714 # libraries that it depends on are installed.
2715 #
2716 # This wrapper script should never be moved out of the build directory.
2717 # If it is, it will not operate correctly.
2718
2719 # Sed substitution that helps us do robust quoting. It backslashifies
2720 # metacharacters that are still active within double-quoted strings.
2721 Xsed='${SED} -e 1s/^X//'
2722 sed_quote_subst='$sed_quote_subst'
2723
2724 # Be Bourne compatible
2725 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
2726 emulate sh
2727 NULLCMD=:
2728 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
2729 # is contrary to our usage. Disable this feature.
2730 alias -g '\${1+\"\$@\"}'='\"\$@\"'
2731 setopt NO_GLOB_SUBST
2732 else
2733 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
2734 fi
2735 BIN_SH=xpg4; export BIN_SH # for Tru64
2736 DUALCASE=1; export DUALCASE # for MKS sh
2737
2738 # The HP-UX ksh and POSIX shell print the target directory to stdout
2739 # if CDPATH is set.
2740 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
2741
2742 relink_command=\"$relink_command\"
2743
2744 # This environment variable determines our operation mode.
2745 if test \"\$libtool_install_magic\" = \"$magic\"; then
2746 # install mode needs the following variables:
2747 generated_by_libtool_version='$macro_version'
2748 notinst_deplibs='$notinst_deplibs'
2749 else
2750 # When we are sourced in execute mode, \$file and \$ECHO are already set.
2751 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2752 ECHO=\"$qecho\"
2753 file=\"\$0\"
2754 # Make sure echo works.
2755 if test \"X\$1\" = X--no-reexec; then
2756 # Discard the --no-reexec flag, and continue.
2757 shift
2758 elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
2759 # Yippee, \$ECHO works!
2760 :
2761 else
2762 # Restart under the correct shell, and then maybe \$ECHO will work.
2763 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2764 fi
2765 fi\
2766 "
2767 $ECHO "\
2768
2769 # Find the directory that this script lives in.
2770 thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2771 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2772
2773 # Follow symbolic links until we get to the real thisdir.
2774 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
2775 while test -n \"\$file\"; do
2776 destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2777
2778 # If there was a directory component, then change thisdir.
2779 if test \"x\$destdir\" != \"x\$file\"; then
2780 case \"\$destdir\" in
2781 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
2782 *) thisdir=\"\$thisdir/\$destdir\" ;;
2783 esac
2784 fi
2785
2786 file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2787 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
2788 done
2789 "
2790 }
2791 # end: func_emit_wrapper_part1
2792
2793 # func_emit_wrapper_part2 [arg=no]
2794 #
2795 # Emit the second part of a libtool wrapper script on stdout.
2796 # For more information, see the description associated with
2797 # func_emit_wrapper(), below.
2798 func_emit_wrapper_part2 ()
2799 {
2800 func_emit_wrapper_part2_arg1=no
2801 if test -n "$1" ; then
2802 func_emit_wrapper_part2_arg1=$1
2803 fi
2804
2805 $ECHO "\
2806
2807 # Usually 'no', except on cygwin/mingw when embedded into
2808 # the cwrapper.
2809 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
2810 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2811 # special case for '.'
2812 if test \"\$thisdir\" = \".\"; then
2813 thisdir=\`pwd\`
2814 fi
2815 # remove .libs from thisdir
2816 case \"\$thisdir\" in
2817 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
2818 $objdir ) thisdir=. ;;
2819 esac
2820 fi
2821
2822 # Try to get the absolute directory name.
2823 absdir=\`cd \"\$thisdir\" && pwd\`
2824 test -n \"\$absdir\" && thisdir=\"\$absdir\"
2825 "
2826
2827 if test "$fast_install" = yes; then
2828 $ECHO "\
2829 program=lt-'$outputname'$exeext
2830 progdir=\"\$thisdir/$objdir\"
2831
2832 if test ! -f \"\$progdir/\$program\" ||
2833 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
2834 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2835
2836 file=\"\$\$-\$program\"
2837
2838 if test ! -d \"\$progdir\"; then
2839 $MKDIR \"\$progdir\"
2840 else
2841 $RM \"\$progdir/\$file\"
2842 fi"
2843
2844 $ECHO "\
2845
2846 # relink executable if necessary
2847 if test -n \"\$relink_command\"; then
2848 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
2849 else
2850 $ECHO \"\$relink_command_output\" >&2
2851 $RM \"\$progdir/\$file\"
2852 exit 1
2853 fi
2854 fi
2855
2856 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2857 { $RM \"\$progdir/\$program\";
2858 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2859 $RM \"\$progdir/\$file\"
2860 fi"
2861 else
2862 $ECHO "\
2863 program='$outputname'
2864 progdir=\"\$thisdir/$objdir\"
2865 "
2866 fi
2867
2868 $ECHO "\
2869
2870 if test -f \"\$progdir/\$program\"; then"
2871
2872 # Export our shlibpath_var if we have one.
2873 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2874 $ECHO "\
2875 # Add our own library path to $shlibpath_var
2876 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2877
2878 # Some systems cannot cope with colon-terminated $shlibpath_var
2879 # The second colon is a workaround for a bug in BeOS R4 sed
2880 $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2881
2882 export $shlibpath_var
2883 "
2884 fi
2885
2886 # fixup the dll searchpath if we need to.
2887 if test -n "$dllsearchpath"; then
2888 $ECHO "\
2889 # Add the dll search path components to the executable PATH
2890 PATH=$dllsearchpath:\$PATH
2891 "
2892 fi
2893
2894 $ECHO "\
2895 if test \"\$libtool_execute_magic\" != \"$magic\"; then
2896 # Run the actual program with our arguments.
2897 "
2898 case $host in
2899 # Backslashes separate directories on plain windows
2900 *-*-mingw | *-*-os2* | *-cegcc*)
2901 $ECHO "\
2902 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
2903 "
2904 ;;
2905
2906 *)
2907 $ECHO "\
2908 exec \"\$progdir/\$program\" \${1+\"\$@\"}
2909 "
2910 ;;
2911 esac
2912 $ECHO "\
2913 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
2914 exit 1
2915 fi
2916 else
2917 # The program doesn't exist.
2918 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2919 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2920 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
2921 exit 1
2922 fi
2923 fi\
2924 "
2925 }
2926 # end: func_emit_wrapper_part2
2927
2928
2929 # func_emit_wrapper [arg=no] 2942 # func_emit_wrapper [arg=no]
2930 # 2943 #
2931 # Emit a libtool wrapper script on stdout. 2944 # Emit a libtool wrapper script on stdout.
2932 # Don't directly open a file because we may want to 2945 # Don't directly open a file because we may want to
2933 # incorporate the script contents within a cygwin/mingw 2946 # incorporate the script contents within a cygwin/mingw
2940 # will assume that the directory in which it is stored is 2953 # will assume that the directory in which it is stored is
2941 # the $objdir directory. This is a cygwin/mingw-specific 2954 # the $objdir directory. This is a cygwin/mingw-specific
2942 # behavior. 2955 # behavior.
2943 func_emit_wrapper () 2956 func_emit_wrapper ()
2944 { 2957 {
2945 func_emit_wrapper_arg1=no 2958 func_emit_wrapper_arg1=${1-no}
2946 if test -n "$1" ; then 2959
2947 func_emit_wrapper_arg1=$1 2960 $ECHO "\
2961 #! $SHELL
2962
2963 # $output - temporary wrapper script for $objdir/$outputname
2964 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
2965 #
2966 # The $output program cannot be directly executed until all the libtool
2967 # libraries that it depends on are installed.
2968 #
2969 # This wrapper script should never be moved out of the build directory.
2970 # If it is, it will not operate correctly.
2971
2972 # Sed substitution that helps us do robust quoting. It backslashifies
2973 # metacharacters that are still active within double-quoted strings.
2974 sed_quote_subst='$sed_quote_subst'
2975
2976 # Be Bourne compatible
2977 if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
2978 emulate sh
2979 NULLCMD=:
2980 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
2981 # is contrary to our usage. Disable this feature.
2982 alias -g '\${1+\"\$@\"}'='\"\$@\"'
2983 setopt NO_GLOB_SUBST
2984 else
2985 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
2986 fi
2987 BIN_SH=xpg4; export BIN_SH # for Tru64
2988 DUALCASE=1; export DUALCASE # for MKS sh
2989
2990 # The HP-UX ksh and POSIX shell print the target directory to stdout
2991 # if CDPATH is set.
2992 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
2993
2994 relink_command=\"$relink_command\"
2995
2996 # This environment variable determines our operation mode.
2997 if test \"\$libtool_install_magic\" = \"$magic\"; then
2998 # install mode needs the following variables:
2999 generated_by_libtool_version='$macro_version'
3000 notinst_deplibs='$notinst_deplibs'
3001 else
3002 # When we are sourced in execute mode, \$file and \$ECHO are already set.
3003 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3004 file=\"\$0\""
3005
3006 qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
3007 $ECHO "\
3008
3009 # A function that is used when there is no print builtin or printf.
3010 func_fallback_echo ()
3011 {
3012 eval 'cat <<_LTECHO_EOF
3013 \$1
3014 _LTECHO_EOF'
3015 }
3016 ECHO=\"$qECHO\"
3017 fi\
3018
3019 # Find the directory that this script lives in.
3020 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
3021 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3022
3023 # Follow symbolic links until we get to the real thisdir.
3024 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
3025 while test -n \"\$file\"; do
3026 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
3027
3028 # If there was a directory component, then change thisdir.
3029 if test \"x\$destdir\" != \"x\$file\"; then
3030 case \"\$destdir\" in
3031 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
3032 *) thisdir=\"\$thisdir/\$destdir\" ;;
3033 esac
3034 fi
3035
3036 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
3037 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
3038 done
3039
3040 # Usually 'no', except on cygwin/mingw when embedded into
3041 # the cwrapper.
3042 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
3043 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
3044 # special case for '.'
3045 if test \"\$thisdir\" = \".\"; then
3046 thisdir=\`pwd\`
3047 fi
3048 # remove .libs from thisdir
3049 case \"\$thisdir\" in
3050 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
3051 $objdir ) thisdir=. ;;
3052 esac
3053 fi
3054
3055 # Try to get the absolute directory name.
3056 absdir=\`cd \"\$thisdir\" && pwd\`
3057 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3058 "
3059
3060 if test "$fast_install" = yes; then
3061 $ECHO "\
3062 program=lt-'$outputname'$exeext
3063 progdir=\"\$thisdir/$objdir\"
3064
3065 if test ! -f \"\$progdir/\$program\" ||
3066 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
3067 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3068
3069 file=\"\$\$-\$program\"
3070
3071 if test ! -d \"\$progdir\"; then
3072 $MKDIR \"\$progdir\"
3073 else
3074 $RM \"\$progdir/\$file\"
3075 fi"
3076
3077 $ECHO "\
3078
3079 # relink executable if necessary
3080 if test -n \"\$relink_command\"; then
3081 if relink_command_output=\`eval \"\$relink_command\" 2>&1\`; then :
3082 else
3083 $ECHO \"\$relink_command_output\" >&2
3084 $RM \"\$progdir/\$file\"
3085 exit 1
3086 fi
3087 fi
3088
3089 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3090 { $RM \"\$progdir/\$program\";
3091 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3092 $RM \"\$progdir/\$file\"
3093 fi"
3094 else
3095 $ECHO "\
3096 program='$outputname'
3097 progdir=\"\$thisdir/$objdir\"
3098 "
2948 fi 3099 fi
2949 3100
2950 # split this up so that func_emit_cwrapperexe_src 3101 $ECHO "\
2951 # can call each part independently. 3102
2952 func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" 3103 if test -f \"\$progdir/\$program\"; then"
2953 func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" 3104
3105 # Export our shlibpath_var if we have one.
3106 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3107 $ECHO "\
3108 # Add our own library path to $shlibpath_var
3109 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3110
3111 # Some systems cannot cope with colon-terminated $shlibpath_var
3112 # The second colon is a workaround for a bug in BeOS R4 sed
3113 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
3114
3115 export $shlibpath_var
3116 "
3117 fi
3118
3119 # fixup the dll searchpath if we need to.
3120 if test -n "$dllsearchpath"; then
3121 $ECHO "\
3122 # Add the dll search path components to the executable PATH
3123 PATH=$dllsearchpath:\$PATH
3124 "
3125 fi
3126
3127 $ECHO "\
3128 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3129 # Run the actual program with our arguments.
3130 "
3131 case $host in
3132 # Backslashes separate directories on plain windows
3133 *-*-mingw | *-*-os2* | *-cegcc*)
3134 $ECHO "\
3135 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3136 "
3137 ;;
3138
3139 *)
3140 $ECHO "\
3141 exec \"\$progdir/\$program\" \${1+\"\$@\"}
3142 "
3143 ;;
3144 esac
3145 $ECHO "\
3146 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3147 exit 1
3148 fi
3149 else
3150 # The program doesn't exist.
3151 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
3152 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
3153 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
3154 exit 1
3155 fi
3156 fi\
3157 "
2954 } 3158 }
2955 3159
2956 3160
2957 # func_to_host_path arg 3161 # func_to_host_path arg
2958 # 3162 #
2976 # the proper representation for $host. The result is stored 3180 # the proper representation for $host. The result is stored
2977 # in $func_to_host_path_result. 3181 # in $func_to_host_path_result.
2978 func_to_host_path () 3182 func_to_host_path ()
2979 { 3183 {
2980 func_to_host_path_result="$1" 3184 func_to_host_path_result="$1"
2981 if test -n "$1" ; then 3185 if test -n "$1"; then
2982 case $host in 3186 case $host in
2983 *mingw* ) 3187 *mingw* )
2984 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' 3188 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
2985 case $build in 3189 case $build in
2986 *mingw* ) # actually, msys 3190 *mingw* ) # actually, msys
2987 # awkward: cmd appends spaces to result 3191 # awkward: cmd appends spaces to result
2988 lt_sed_strip_trailing_spaces="s/[ ]*\$//" 3192 func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
2989 func_to_host_path_tmp1=`( cmd //c echo "$1" |\ 3193 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
2990 $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
2991 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
2992 $SED -e "$lt_sed_naive_backslashify"`
2993 ;; 3194 ;;
2994 *cygwin* ) 3195 *cygwin* )
2995 func_to_host_path_tmp1=`cygpath -w "$1"` 3196 func_to_host_path_result=`cygpath -w "$1" |
2996 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ 3197 $SED -e "$lt_sed_naive_backslashify"`
2997 $SED -e "$lt_sed_naive_backslashify"`
2998 ;; 3198 ;;
2999 * ) 3199 * )
3000 # Unfortunately, winepath does not exit with a non-zero 3200 # Unfortunately, winepath does not exit with a non-zero
3001 # error code, so we are forced to check the contents of 3201 # error code, so we are forced to check the contents of
3002 # stdout. On the other hand, if the command is not 3202 # stdout. On the other hand, if the command is not
3004 # *an error message* to stdout. So we must check for both 3204 # *an error message* to stdout. So we must check for both
3005 # error code of zero AND non-empty stdout, which explains 3205 # error code of zero AND non-empty stdout, which explains
3006 # the odd construction: 3206 # the odd construction:
3007 func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` 3207 func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3008 if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then 3208 if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3009 func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ 3209 func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
3010 $SED -e "$lt_sed_naive_backslashify"` 3210 $SED -e "$lt_sed_naive_backslashify"`
3011 else 3211 else
3012 # Allow warning below. 3212 # Allow warning below.
3013 func_to_host_path_result="" 3213 func_to_host_path_result=
3014 fi 3214 fi
3015 ;; 3215 ;;
3016 esac 3216 esac
3017 if test -z "$func_to_host_path_result" ; then 3217 if test -z "$func_to_host_path_result" ; then
3018 func_error "Could not determine host path corresponding to" 3218 func_error "Could not determine host path corresponding to"
3019 func_error " '$1'" 3219 func_error " \`$1'"
3020 func_error "Continuing, but uninstalled executables may not work." 3220 func_error "Continuing, but uninstalled executables may not work."
3021 # Fallback: 3221 # Fallback:
3022 func_to_host_path_result="$1" 3222 func_to_host_path_result="$1"
3023 fi 3223 fi
3024 ;; 3224 ;;
3047 # the proper representation on $host. The result is stored 3247 # the proper representation on $host. The result is stored
3048 # in $func_to_host_pathlist_result. 3248 # in $func_to_host_pathlist_result.
3049 func_to_host_pathlist () 3249 func_to_host_pathlist ()
3050 { 3250 {
3051 func_to_host_pathlist_result="$1" 3251 func_to_host_pathlist_result="$1"
3052 if test -n "$1" ; then 3252 if test -n "$1"; then
3053 case $host in 3253 case $host in
3054 *mingw* ) 3254 *mingw* )
3055 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' 3255 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3056 # Remove leading and trailing path separator characters from 3256 # Remove leading and trailing path separator characters from
3057 # ARG. msys behavior is inconsistent here, cygpath turns them 3257 # ARG. msys behavior is inconsistent here, cygpath turns them
3058 # into '.;' and ';.', and winepath ignores them completely. 3258 # into '.;' and ';.', and winepath ignores them completely.
3059 func_to_host_pathlist_tmp2="$1" 3259 func_stripname : : "$1"
3060 # Once set for this call, this variable should not be 3260 func_to_host_pathlist_tmp1=$func_stripname_result
3061 # reassigned. It is used in tha fallback case.
3062 func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
3063 $SED -e 's|^:*||' -e 's|:*$||'`
3064 case $build in 3261 case $build in
3065 *mingw* ) # Actually, msys. 3262 *mingw* ) # Actually, msys.
3066 # Awkward: cmd appends spaces to result. 3263 # Awkward: cmd appends spaces to result.
3067 lt_sed_strip_trailing_spaces="s/[ ]*\$//" 3264 func_to_host_pathlist_result=`
3068 func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ 3265 ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
3069 $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` 3266 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
3070 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3071 $SED -e "$lt_sed_naive_backslashify"`
3072 ;; 3267 ;;
3073 *cygwin* ) 3268 *cygwin* )
3074 func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` 3269 func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
3075 func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3076 $SED -e "$lt_sed_naive_backslashify"` 3270 $SED -e "$lt_sed_naive_backslashify"`
3077 ;; 3271 ;;
3078 * ) 3272 * )
3079 # unfortunately, winepath doesn't convert pathlists 3273 # unfortunately, winepath doesn't convert pathlists
3080 func_to_host_pathlist_result="" 3274 func_to_host_pathlist_result=""
3086 func_to_host_path "$func_to_host_pathlist_f" 3280 func_to_host_path "$func_to_host_pathlist_f"
3087 if test -n "$func_to_host_path_result" ; then 3281 if test -n "$func_to_host_path_result" ; then
3088 if test -z "$func_to_host_pathlist_result" ; then 3282 if test -z "$func_to_host_pathlist_result" ; then
3089 func_to_host_pathlist_result="$func_to_host_path_result" 3283 func_to_host_pathlist_result="$func_to_host_path_result"
3090 else 3284 else
3091 func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" 3285 func_append func_to_host_pathlist_result ";$func_to_host_path_result"
3092 fi 3286 fi
3093 fi 3287 fi
3094 fi 3288 fi
3095 IFS=:
3096 done 3289 done
3097 IFS=$func_to_host_pathlist_oldIFS 3290 IFS=$func_to_host_pathlist_oldIFS
3098 ;; 3291 ;;
3099 esac 3292 esac
3100 if test -z "$func_to_host_pathlist_result" ; then 3293 if test -z "$func_to_host_pathlist_result"; then
3101 func_error "Could not determine the host path(s) corresponding to" 3294 func_error "Could not determine the host path(s) corresponding to"
3102 func_error " '$1'" 3295 func_error " \`$1'"
3103 func_error "Continuing, but uninstalled executables may not work." 3296 func_error "Continuing, but uninstalled executables may not work."
3104 # Fallback. This may break if $1 contains DOS-style drive 3297 # Fallback. This may break if $1 contains DOS-style drive
3105 # specifications. The fix is not to complicate the expression 3298 # specifications. The fix is not to complicate the expression
3106 # below, but for the user to provide a working wine installation 3299 # below, but for the user to provide a working wine installation
3107 # with winepath so that path translation in the cross-to-mingw 3300 # with winepath so that path translation in the cross-to-mingw
3114 case "$1" in 3307 case "$1" in
3115 :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" 3308 :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
3116 ;; 3309 ;;
3117 esac 3310 esac
3118 case "$1" in 3311 case "$1" in
3119 *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" 3312 *: ) func_append func_to_host_pathlist_result ";"
3120 ;; 3313 ;;
3121 esac 3314 esac
3122 ;; 3315 ;;
3123 esac 3316 esac
3124 fi 3317 fi
3146 but could eventually absorb all of the scripts functionality and 3339 but could eventually absorb all of the scripts functionality and
3147 exec $objdir/$outputname directly. 3340 exec $objdir/$outputname directly.
3148 */ 3341 */
3149 EOF 3342 EOF
3150 cat <<"EOF" 3343 cat <<"EOF"
3344 #ifdef _MSC_VER
3345 # define _CRT_SECURE_NO_DEPRECATE 1
3346 #endif
3151 #include <stdio.h> 3347 #include <stdio.h>
3152 #include <stdlib.h> 3348 #include <stdlib.h>
3153 #ifdef _MSC_VER 3349 #ifdef _MSC_VER
3154 # include <direct.h> 3350 # include <direct.h>
3155 # include <process.h> 3351 # include <process.h>
3156 # include <io.h> 3352 # include <io.h>
3157 # define setmode _setmode
3158 #else 3353 #else
3159 # include <unistd.h> 3354 # include <unistd.h>
3160 # include <stdint.h> 3355 # include <stdint.h>
3161 # ifdef __CYGWIN__ 3356 # ifdef __CYGWIN__
3162 # include <io.h> 3357 # include <io.h>
3163 # define HAVE_SETENV
3164 # ifdef __STRICT_ANSI__
3165 char *realpath (const char *, char *);
3166 int putenv (char *);
3167 int setenv (const char *, const char *, int);
3168 # endif
3169 # endif 3358 # endif
3170 #endif 3359 #endif
3171 #include <malloc.h> 3360 #include <malloc.h>
3172 #include <stdarg.h> 3361 #include <stdarg.h>
3173 #include <assert.h> 3362 #include <assert.h>
3175 #include <ctype.h> 3364 #include <ctype.h>
3176 #include <errno.h> 3365 #include <errno.h>
3177 #include <fcntl.h> 3366 #include <fcntl.h>
3178 #include <sys/stat.h> 3367 #include <sys/stat.h>
3179 3368
3369 /* declarations of non-ANSI functions */
3370 #if defined(__MINGW32__)
3371 # ifdef __STRICT_ANSI__
3372 int _putenv (const char *);
3373 # endif
3374 #elif defined(__CYGWIN__)
3375 # ifdef __STRICT_ANSI__
3376 char *realpath (const char *, char *);
3377 int putenv (char *);
3378 int setenv (const char *, const char *, int);
3379 # endif
3380 /* #elif defined (other platforms) ... */
3381 #endif
3382
3383 /* portability defines, excluding path handling macros */
3384 #if defined(_MSC_VER)
3385 # define setmode _setmode
3386 # define stat _stat
3387 # define chmod _chmod
3388 # define getcwd _getcwd
3389 # define putenv _putenv
3390 # define S_IXUSR _S_IEXEC
3391 # ifndef _INTPTR_T_DEFINED
3392 # define _INTPTR_T_DEFINED
3393 # define intptr_t int
3394 # endif
3395 #elif defined(__MINGW32__)
3396 # define setmode _setmode
3397 # define stat _stat
3398 # define chmod _chmod
3399 # define getcwd _getcwd
3400 # define putenv _putenv
3401 #elif defined(__CYGWIN__)
3402 # define HAVE_SETENV
3403 # define FOPEN_WB "wb"
3404 /* #elif defined (other platforms) ... */
3405 #endif
3406
3180 #if defined(PATH_MAX) 3407 #if defined(PATH_MAX)
3181 # define LT_PATHMAX PATH_MAX 3408 # define LT_PATHMAX PATH_MAX
3182 #elif defined(MAXPATHLEN) 3409 #elif defined(MAXPATHLEN)
3183 # define LT_PATHMAX MAXPATHLEN 3410 # define LT_PATHMAX MAXPATHLEN
3184 #else 3411 #else
3190 #endif 3417 #endif
3191 #ifndef S_IXGRP 3418 #ifndef S_IXGRP
3192 # define S_IXGRP 0 3419 # define S_IXGRP 0
3193 #endif 3420 #endif
3194 3421
3195 #ifdef _MSC_VER 3422 /* path handling portability macros */
3196 # define S_IXUSR _S_IEXEC
3197 # define stat _stat
3198 # ifndef _INTPTR_T_DEFINED
3199 # define intptr_t int
3200 # endif
3201 #endif
3202
3203 #ifndef DIR_SEPARATOR 3423 #ifndef DIR_SEPARATOR
3204 # define DIR_SEPARATOR '/' 3424 # define DIR_SEPARATOR '/'
3205 # define PATH_SEPARATOR ':' 3425 # define PATH_SEPARATOR ':'
3206 #endif 3426 #endif
3207 3427
3228 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) 3448 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3229 #else /* PATH_SEPARATOR_2 */ 3449 #else /* PATH_SEPARATOR_2 */
3230 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) 3450 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3231 #endif /* PATH_SEPARATOR_2 */ 3451 #endif /* PATH_SEPARATOR_2 */
3232 3452
3233 #ifdef __CYGWIN__
3234 # define FOPEN_WB "wb"
3235 #endif
3236
3237 #ifndef FOPEN_WB 3453 #ifndef FOPEN_WB
3238 # define FOPEN_WB "w" 3454 # define FOPEN_WB "w"
3239 #endif 3455 #endif
3240 #ifndef _O_BINARY 3456 #ifndef _O_BINARY
3241 # define _O_BINARY 0 3457 # define _O_BINARY 0
3245 #define XFREE(stale) do { \ 3461 #define XFREE(stale) do { \
3246 if (stale) { free ((void *) stale); stale = 0; } \ 3462 if (stale) { free ((void *) stale); stale = 0; } \
3247 } while (0) 3463 } while (0)
3248 3464
3249 #undef LTWRAPPER_DEBUGPRINTF 3465 #undef LTWRAPPER_DEBUGPRINTF
3250 #if defined DEBUGWRAPPER 3466 #if defined LT_DEBUGWRAPPER
3251 # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args 3467 # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3252 static void 3468 static void
3253 ltwrapper_debugprintf (const char *fmt, ...) 3469 ltwrapper_debugprintf (const char *fmt, ...)
3254 { 3470 {
3255 va_list args; 3471 va_list args;
3272 int check_executable (const char *path); 3488 int check_executable (const char *path);
3273 char *strendzap (char *str, const char *pat); 3489 char *strendzap (char *str, const char *pat);
3274 void lt_fatal (const char *message, ...); 3490 void lt_fatal (const char *message, ...);
3275 void lt_setenv (const char *name, const char *value); 3491 void lt_setenv (const char *name, const char *value);
3276 char *lt_extend_str (const char *orig_value, const char *add, int to_end); 3492 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3277 void lt_opt_process_env_set (const char *arg);
3278 void lt_opt_process_env_prepend (const char *arg);
3279 void lt_opt_process_env_append (const char *arg);
3280 int lt_split_name_value (const char *arg, char** name, char** value);
3281 void lt_update_exe_path (const char *name, const char *value); 3493 void lt_update_exe_path (const char *name, const char *value);
3282 void lt_update_lib_path (const char *name, const char *value); 3494 void lt_update_lib_path (const char *name, const char *value);
3283 3495 char **prepare_spawn (char **argv);
3284 static const char *script_text_part1 = 3496 void lt_dump_script (FILE *f);
3285 EOF 3497 EOF
3286
3287 func_emit_wrapper_part1 yes |
3288 $SED -e 's/\([\\"]\)/\\\1/g' \
3289 -e 's/^/ "/' -e 's/$/\\n"/'
3290 echo ";"
3291 cat <<EOF
3292
3293 static const char *script_text_part2 =
3294 EOF
3295 func_emit_wrapper_part2 yes |
3296 $SED -e 's/\([\\"]\)/\\\1/g' \
3297 -e 's/^/ "/' -e 's/$/\\n"/'
3298 echo ";"
3299 3498
3300 cat <<EOF 3499 cat <<EOF
3301 const char * MAGIC_EXE = "$magic_exe"; 3500 const char * MAGIC_EXE = "$magic_exe";
3302 const char * LIB_PATH_VARNAME = "$shlibpath_var"; 3501 const char * LIB_PATH_VARNAME = "$shlibpath_var";
3303 EOF 3502 EOF
3345 static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH; 3544 static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
3346 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX; 3545 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
3347 3546
3348 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script"; 3547 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
3349 3548
3350 static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
3351 static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
3352 /* argument is putenv-style "foo=bar", value of foo is set to bar */
3353
3354 static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
3355 static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
3356 /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
3357
3358 static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
3359 static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
3360 /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
3361
3362 int 3549 int
3363 main (int argc, char *argv[]) 3550 main (int argc, char *argv[])
3364 { 3551 {
3365 char **newargz; 3552 char **newargz;
3366 int newargc; 3553 int newargc;
3389 echo " setmode(1,_O_BINARY);" 3576 echo " setmode(1,_O_BINARY);"
3390 ;; 3577 ;;
3391 esac 3578 esac
3392 3579
3393 cat <<"EOF" 3580 cat <<"EOF"
3394 printf ("%s", script_text_part1); 3581 lt_dump_script (stdout);
3395 printf ("%s", script_text_part2);
3396 return 0; 3582 return 0;
3397 } 3583 }
3398 } 3584 }
3399 3585
3400 newargz = XMALLOC (char *, argc + 1); 3586 newargz = XMALLOC (char *, argc + 1);
3482 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE); 3668 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3483 3669
3484 newargc=0; 3670 newargc=0;
3485 for (i = 1; i < argc; i++) 3671 for (i = 1; i < argc; i++)
3486 { 3672 {
3487 if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
3488 {
3489 if (argv[i][env_set_opt_len] == '=')
3490 {
3491 const char *p = argv[i] + env_set_opt_len + 1;
3492 lt_opt_process_env_set (p);
3493 }
3494 else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
3495 {
3496 lt_opt_process_env_set (argv[++i]); /* don't copy */
3497 }
3498 else
3499 lt_fatal ("%s missing required argument", env_set_opt);
3500 continue;
3501 }
3502 if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
3503 {
3504 if (argv[i][env_prepend_opt_len] == '=')
3505 {
3506 const char *p = argv[i] + env_prepend_opt_len + 1;
3507 lt_opt_process_env_prepend (p);
3508 }
3509 else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
3510 {
3511 lt_opt_process_env_prepend (argv[++i]); /* don't copy */
3512 }
3513 else
3514 lt_fatal ("%s missing required argument", env_prepend_opt);
3515 continue;
3516 }
3517 if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
3518 {
3519 if (argv[i][env_append_opt_len] == '=')
3520 {
3521 const char *p = argv[i] + env_append_opt_len + 1;
3522 lt_opt_process_env_append (p);
3523 }
3524 else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
3525 {
3526 lt_opt_process_env_append (argv[++i]); /* don't copy */
3527 }
3528 else
3529 lt_fatal ("%s missing required argument", env_append_opt);
3530 continue;
3531 }
3532 if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0) 3673 if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
3533 { 3674 {
3534 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX 3675 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
3535 namespace, but it is not one of the ones we know about and 3676 namespace, but it is not one of the ones we know about and
3536 have already dealt with, above (inluding dump-script), then 3677 have already dealt with, above (inluding dump-script), then
3558 3699
3559 case $host_os in 3700 case $host_os in
3560 mingw*) 3701 mingw*)
3561 cat <<"EOF" 3702 cat <<"EOF"
3562 /* execv doesn't actually work on mingw as expected on unix */ 3703 /* execv doesn't actually work on mingw as expected on unix */
3704 newargz = prepare_spawn (newargz);
3563 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); 3705 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
3564 if (rval == -1) 3706 if (rval == -1)
3565 { 3707 {
3566 /* failed to start process */ 3708 /* failed to start process */
3567 LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); 3709 LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
3902 new_value = xstrdup (add); 4044 new_value = xstrdup (add);
3903 } 4045 }
3904 return new_value; 4046 return new_value;
3905 } 4047 }
3906 4048
3907 int
3908 lt_split_name_value (const char *arg, char** name, char** value)
3909 {
3910 const char *p;
3911 int len;
3912 if (!arg || !*arg)
3913 return 1;
3914
3915 p = strchr (arg, (int)'=');
3916
3917 if (!p)
3918 return 1;
3919
3920 *value = xstrdup (++p);
3921
3922 len = strlen (arg) - strlen (*value);
3923 *name = XMALLOC (char, len);
3924 strncpy (*name, arg, len-1);
3925 (*name)[len - 1] = '\0';
3926
3927 return 0;
3928 }
3929
3930 void
3931 lt_opt_process_env_set (const char *arg)
3932 {
3933 char *name = NULL;
3934 char *value = NULL;
3935
3936 if (lt_split_name_value (arg, &name, &value) != 0)
3937 {
3938 XFREE (name);
3939 XFREE (value);
3940 lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
3941 }
3942
3943 lt_setenv (name, value);
3944 XFREE (name);
3945 XFREE (value);
3946 }
3947
3948 void
3949 lt_opt_process_env_prepend (const char *arg)
3950 {
3951 char *name = NULL;
3952 char *value = NULL;
3953 char *new_value = NULL;
3954
3955 if (lt_split_name_value (arg, &name, &value) != 0)
3956 {
3957 XFREE (name);
3958 XFREE (value);
3959 lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
3960 }
3961
3962 new_value = lt_extend_str (getenv (name), value, 0);
3963 lt_setenv (name, new_value);
3964 XFREE (new_value);
3965 XFREE (name);
3966 XFREE (value);
3967 }
3968
3969 void
3970 lt_opt_process_env_append (const char *arg)
3971 {
3972 char *name = NULL;
3973 char *value = NULL;
3974 char *new_value = NULL;
3975
3976 if (lt_split_name_value (arg, &name, &value) != 0)
3977 {
3978 XFREE (name);
3979 XFREE (value);
3980 lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
3981 }
3982
3983 new_value = lt_extend_str (getenv (name), value, 1);
3984 lt_setenv (name, new_value);
3985 XFREE (new_value);
3986 XFREE (name);
3987 XFREE (value);
3988 }
3989
3990 void 4049 void
3991 lt_update_exe_path (const char *name, const char *value) 4050 lt_update_exe_path (const char *name, const char *value)
3992 { 4051 {
3993 LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", 4052 LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
3994 (name ? name : "<NULL>"), 4053 (name ? name : "<NULL>"),
4021 lt_setenv (name, new_value); 4080 lt_setenv (name, new_value);
4022 XFREE (new_value); 4081 XFREE (new_value);
4023 } 4082 }
4024 } 4083 }
4025 4084
4026 4085 EOF
4086 case $host_os in
4087 mingw*)
4088 cat <<"EOF"
4089
4090 /* Prepares an argument vector before calling spawn().
4091 Note that spawn() does not by itself call the command interpreter
4092 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
4093 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
4094 GetVersionEx(&v);
4095 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
4096 }) ? "cmd.exe" : "command.com").
4097 Instead it simply concatenates the arguments, separated by ' ', and calls
4098 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
4099 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
4100 special way:
4101 - Space and tab are interpreted as delimiters. They are not treated as
4102 delimiters if they are surrounded by double quotes: "...".
4103 - Unescaped double quotes are removed from the input. Their only effect is
4104 that within double quotes, space and tab are treated like normal
4105 characters.
4106 - Backslashes not followed by double quotes are not special.
4107 - But 2*n+1 backslashes followed by a double quote become
4108 n backslashes followed by a double quote (n >= 0):
4109 \" -> "
4110 \\\" -> \"
4111 \\\\\" -> \\"
4112 */
4113 #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4114 #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4115 char **
4116 prepare_spawn (char **argv)
4117 {
4118 size_t argc;
4119 char **new_argv;
4120 size_t i;
4121
4122 /* Count number of arguments. */
4123 for (argc = 0; argv[argc] != NULL; argc++)
4124 ;
4125
4126 /* Allocate new argument vector. */
4127 new_argv = XMALLOC (char *, argc + 1);
4128
4129 /* Put quoted arguments into the new argument vector. */
4130 for (i = 0; i < argc; i++)
4131 {
4132 const char *string = argv[i];
4133
4134 if (string[0] == '\0')
4135 new_argv[i] = xstrdup ("\"\"");
4136 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
4137 {
4138 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
4139 size_t length;
4140 unsigned int backslashes;
4141 const char *s;
4142 char *quoted_string;
4143 char *p;
4144
4145 length = 0;
4146 backslashes = 0;
4147 if (quote_around)
4148 length++;
4149 for (s = string; *s != '\0'; s++)
4150 {
4151 char c = *s;
4152 if (c == '"')
4153 length += backslashes + 1;
4154 length++;
4155 if (c == '\\')
4156 backslashes++;
4157 else
4158 backslashes = 0;
4159 }
4160 if (quote_around)
4161 length += backslashes + 1;
4162
4163 quoted_string = XMALLOC (char, length + 1);
4164
4165 p = quoted_string;
4166 backslashes = 0;
4167 if (quote_around)
4168 *p++ = '"';
4169 for (s = string; *s != '\0'; s++)
4170 {
4171 char c = *s;
4172 if (c == '"')
4173 {
4174 unsigned int j;
4175 for (j = backslashes + 1; j > 0; j--)
4176 *p++ = '\\';
4177 }
4178 *p++ = c;
4179 if (c == '\\')
4180 backslashes++;
4181 else
4182 backslashes = 0;
4183 }
4184 if (quote_around)
4185 {
4186 unsigned int j;
4187 for (j = backslashes; j > 0; j--)
4188 *p++ = '\\';
4189 *p++ = '"';
4190 }
4191 *p = '\0';
4192
4193 new_argv[i] = quoted_string;
4194 }
4195 else
4196 new_argv[i] = (char *) string;
4197 }
4198 new_argv[argc] = NULL;
4199
4200 return new_argv;
4201 }
4202 EOF
4203 ;;
4204 esac
4205
4206 cat <<"EOF"
4207 void lt_dump_script (FILE* f)
4208 {
4209 EOF
4210 func_emit_wrapper yes |
4211 $SED -e 's/\([\\"]\)/\\\1/g' \
4212 -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
4213
4214 cat <<"EOF"
4215 }
4027 EOF 4216 EOF
4028 } 4217 }
4029 # end: func_emit_cwrapperexe_src 4218 # end: func_emit_cwrapperexe_src
4219
4220 # func_win32_import_lib_p ARG
4221 # True if ARG is an import lib, as indicated by $file_magic_cmd
4222 func_win32_import_lib_p ()
4223 {
4224 $opt_debug
4225 case `eval "$file_magic_cmd \"\$1\" 2>/dev/null" | $SED -e 10q` in
4226 *import*) : ;;
4227 *) false ;;
4228 esac
4229 }
4030 4230
4031 # func_mode_link arg... 4231 # func_mode_link arg...
4032 func_mode_link () 4232 func_mode_link ()
4033 { 4233 {
4034 $opt_debug 4234 $opt_debug
4070 lib_search_path=`pwd` 4270 lib_search_path=`pwd`
4071 inst_prefix_dir= 4271 inst_prefix_dir=
4072 new_inherited_linker_flags= 4272 new_inherited_linker_flags=
4073 4273
4074 avoid_version=no 4274 avoid_version=no
4275 bindir=
4075 dlfiles= 4276 dlfiles=
4076 dlprefiles= 4277 dlprefiles=
4077 dlself=no 4278 dlself=no
4078 export_dynamic=no 4279 export_dynamic=no
4079 export_symbols= 4280 export_symbols=
4162 func_append finalize_command " @OUTPUT@" 4363 func_append finalize_command " @OUTPUT@"
4163 ;; 4364 ;;
4164 esac 4365 esac
4165 4366
4166 case $prev in 4367 case $prev in
4368 bindir)
4369 bindir="$arg"
4370 prev=
4371 continue
4372 ;;
4167 dlfiles|dlprefiles) 4373 dlfiles|dlprefiles)
4168 if test "$preload" = no; then 4374 if test "$preload" = no; then
4169 # Add the symbol object into the linking commands. 4375 # Add the symbol object into the linking commands.
4170 func_append compile_command " @SYMFILE@" 4376 func_append compile_command " @SYMFILE@"
4171 func_append finalize_command " @SYMFILE@" 4377 func_append finalize_command " @SYMFILE@"
4423 -avoid-version) 4629 -avoid-version)
4424 avoid_version=yes 4630 avoid_version=yes
4425 continue 4631 continue
4426 ;; 4632 ;;
4427 4633
4634 -bindir)
4635 prev=bindir
4636 continue
4637 ;;
4638
4428 -dlopen) 4639 -dlopen)
4429 prev=dlfiles 4640 prev=dlfiles
4430 continue 4641 continue
4431 ;; 4642 ;;
4432 4643
4501 lib_search_path="$lib_search_path $dir" 4712 lib_search_path="$lib_search_path $dir"
4502 ;; 4713 ;;
4503 esac 4714 esac
4504 case $host in 4715 case $host in
4505 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) 4716 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4506 testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` 4717 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
4507 case :$dllsearchpath: in 4718 case :$dllsearchpath: in
4508 *":$dir:"*) ;; 4719 *":$dir:"*) ;;
4509 ::) dllsearchpath=$dir;; 4720 ::) dllsearchpath=$dir;;
4510 *) dllsearchpath="$dllsearchpath:$dir";; 4721 *) dllsearchpath="$dllsearchpath:$dir";;
4511 esac 4722 esac
4520 ;; 4731 ;;
4521 4732
4522 -l*) 4733 -l*)
4523 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then 4734 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4524 case $host in 4735 case $host in
4525 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) 4736 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
4526 # These systems don't actually have a C or math library (as such) 4737 # These systems don't actually have a C or math library (as such)
4527 continue 4738 continue
4528 ;; 4739 ;;
4529 *-*-os2*) 4740 *-*-os2*)
4530 # These systems don't actually have a C library (as such) 4741 # These systems don't actually have a C library (as such)
4545 ;; 4756 ;;
4546 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 4757 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
4547 # Compiler inserts libc in the correct place for threads to work 4758 # Compiler inserts libc in the correct place for threads to work
4548 test "X$arg" = "X-lc" && continue 4759 test "X$arg" = "X-lc" && continue
4549 ;; 4760 ;;
4761 *-*-linux*)
4762 test "X$arg" = "X-lc" && continue
4763 ;;
4550 esac 4764 esac
4551 elif test "X$arg" = "X-lc_r"; then 4765 elif test "X$arg" = "X-lc_r"; then
4552 case $host in 4766 case $host in
4553 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 4767 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4554 # Do not include libc_r directly, use -pthread flag. 4768 # Do not include libc_r directly, use -pthread flag.
4706 arg= 4920 arg=
4707 save_ifs="$IFS"; IFS=',' 4921 save_ifs="$IFS"; IFS=','
4708 for flag in $args; do 4922 for flag in $args; do
4709 IFS="$save_ifs" 4923 IFS="$save_ifs"
4710 func_quote_for_eval "$flag" 4924 func_quote_for_eval "$flag"
4711 arg="$arg $wl$func_quote_for_eval_result" 4925 arg="$arg $func_quote_for_eval_result"
4712 compiler_flags="$compiler_flags $func_quote_for_eval_result" 4926 compiler_flags="$compiler_flags $func_quote_for_eval_result"
4713 done 4927 done
4714 IFS="$save_ifs" 4928 IFS="$save_ifs"
4715 func_stripname ' ' '' "$arg" 4929 func_stripname ' ' '' "$arg"
4716 arg=$func_stripname_result 4930 arg=$func_stripname_result
4762 # -m*, -t[45]*, -txscale* pass through architecture-specific 4976 # -m*, -t[45]*, -txscale* pass through architecture-specific
4763 # compiler args for GCC 4977 # compiler args for GCC
4764 # -F/path gives path to uninstalled frameworks, gcc on darwin 4978 # -F/path gives path to uninstalled frameworks, gcc on darwin
4765 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC 4979 # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
4766 # @file GCC response files 4980 # @file GCC response files
4981 # -tp=* Portland pgcc target processor selection
4767 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ 4982 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4768 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) 4983 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
4769 func_quote_for_eval "$arg" 4984 func_quote_for_eval "$arg"
4770 arg="$func_quote_for_eval_result" 4985 arg="$func_quote_for_eval_result"
4771 func_append compile_command " $arg" 4986 func_append compile_command " $arg"
4772 func_append finalize_command " $arg" 4987 func_append finalize_command " $arg"
4773 compiler_flags="$compiler_flags $arg" 4988 compiler_flags="$compiler_flags $arg"
4910 5125
4911 test -n "$prev" && \ 5126 test -n "$prev" && \
4912 func_fatal_help "the \`$prevarg' option requires an argument" 5127 func_fatal_help "the \`$prevarg' option requires an argument"
4913 5128
4914 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then 5129 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
4915 eval arg=\"$export_dynamic_flag_spec\" 5130 eval "arg=\"$export_dynamic_flag_spec\""
4916 func_append compile_command " $arg" 5131 func_append compile_command " $arg"
4917 func_append finalize_command " $arg" 5132 func_append finalize_command " $arg"
4918 fi 5133 fi
4919 5134
4920 oldlibs= 5135 oldlibs=
4923 outputname="$func_basename_result" 5138 outputname="$func_basename_result"
4924 libobjs_save="$libobjs" 5139 libobjs_save="$libobjs"
4925 5140
4926 if test -n "$shlibpath_var"; then 5141 if test -n "$shlibpath_var"; then
4927 # get the directories listed in $shlibpath_var 5142 # get the directories listed in $shlibpath_var
4928 eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` 5143 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
4929 else 5144 else
4930 shlib_search_path= 5145 shlib_search_path=
4931 fi 5146 fi
4932 eval sys_lib_search_path=\"$sys_lib_search_path_spec\" 5147 eval "sys_lib_search_path=\"$sys_lib_search_path_spec\""
4933 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" 5148 eval "sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\""
4934 5149
4935 func_dirname "$output" "/" "" 5150 func_dirname "$output" "/" ""
4936 output_objdir="$func_dirname_result$objdir" 5151 output_objdir="$func_dirname_result$objdir"
4937 # Create the object directory. 5152 # Create the object directory.
4938 func_mkdir_p "$output_objdir" 5153 func_mkdir_p "$output_objdir"
5046 esac 5261 esac
5047 5262
5048 # Collect preopened libtool deplibs, except any this library 5263 # Collect preopened libtool deplibs, except any this library
5049 # has declared as weak libs 5264 # has declared as weak libs
5050 for deplib in $dependency_libs; do 5265 for deplib in $dependency_libs; do
5051 deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` 5266 func_basename "$deplib"
5267 deplib_base=$func_basename_result
5052 case " $weak_libs " in 5268 case " $weak_libs " in
5053 *" $deplib_base "*) ;; 5269 *" $deplib_base "*) ;;
5054 *) deplibs="$deplibs $deplib" ;; 5270 *) deplibs="$deplibs $deplib" ;;
5055 esac 5271 esac
5056 done 5272 done
5225 valid_a_lib=no 5441 valid_a_lib=no
5226 case $deplibs_check_method in 5442 case $deplibs_check_method in
5227 match_pattern*) 5443 match_pattern*)
5228 set dummy $deplibs_check_method; shift 5444 set dummy $deplibs_check_method; shift
5229 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` 5445 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5230 if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ 5446 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
5231 | $EGREP "$match_pattern_regex" > /dev/null; then 5447 | $EGREP "$match_pattern_regex" > /dev/null; then
5232 valid_a_lib=yes 5448 valid_a_lib=yes
5233 fi 5449 fi
5234 ;; 5450 ;;
5235 pass_all) 5451 pass_all)
5236 valid_a_lib=yes 5452 valid_a_lib=yes
5237 ;; 5453 ;;
5238 esac 5454 esac
5239 if test "$valid_a_lib" != yes; then 5455 if test "$valid_a_lib" != yes; then
5240 $ECHO 5456 echo
5241 $ECHO "*** Warning: Trying to link with static lib archive $deplib." 5457 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
5242 $ECHO "*** I have the capability to make that library automatically link in when" 5458 echo "*** I have the capability to make that library automatically link in when"
5243 $ECHO "*** you link to this library. But I can only do this if you have a" 5459 echo "*** you link to this library. But I can only do this if you have a"
5244 $ECHO "*** shared version of the library, which you do not appear to have" 5460 echo "*** shared version of the library, which you do not appear to have"
5245 $ECHO "*** because the file extensions .$libext of this argument makes me believe" 5461 echo "*** because the file extensions .$libext of this argument makes me believe"
5246 $ECHO "*** that it is just a static archive that I should not use here." 5462 echo "*** that it is just a static archive that I should not use here."
5247 else 5463 else
5248 $ECHO 5464 echo
5249 $ECHO "*** Warning: Linking the shared library $output against the" 5465 $ECHO "*** Warning: Linking the shared library $output against the"
5250 $ECHO "*** static library $deplib is not portable!" 5466 $ECHO "*** static library $deplib is not portable!"
5251 deplibs="$deplib $deplibs" 5467 deplibs="$deplib $deplibs"
5252 fi 5468 fi
5253 ;; 5469 ;;
5316 # Read the .la file 5532 # Read the .la file
5317 func_source "$lib" 5533 func_source "$lib"
5318 5534
5319 # Convert "-framework foo" to "foo.ltframework" 5535 # Convert "-framework foo" to "foo.ltframework"
5320 if test -n "$inherited_linker_flags"; then 5536 if test -n "$inherited_linker_flags"; then
5321 tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` 5537 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
5322 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do 5538 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5323 case " $new_inherited_linker_flags " in 5539 case " $new_inherited_linker_flags " in
5324 *" $tmp_inherited_linker_flag "*) ;; 5540 *" $tmp_inherited_linker_flag "*) ;;
5325 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; 5541 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
5326 esac 5542 esac
5327 done 5543 done
5328 fi 5544 fi
5329 dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` 5545 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
5330 if test "$linkmode,$pass" = "lib,link" || 5546 if test "$linkmode,$pass" = "lib,link" ||
5331 test "$linkmode,$pass" = "prog,scan" || 5547 test "$linkmode,$pass" = "prog,scan" ||
5332 { test "$linkmode" != prog && test "$linkmode" != lib; }; then 5548 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5333 test -n "$dlopen" && dlfiles="$dlfiles $dlopen" 5549 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5334 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" 5550 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
5578 dlopenmodule="$dlpremoduletest" 5794 dlopenmodule="$dlpremoduletest"
5579 break 5795 break
5580 fi 5796 fi
5581 done 5797 done
5582 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then 5798 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
5583 $ECHO 5799 echo
5584 if test "$linkmode" = prog; then 5800 if test "$linkmode" = prog; then
5585 $ECHO "*** Warning: Linking the executable $output against the loadable module" 5801 $ECHO "*** Warning: Linking the executable $output against the loadable module"
5586 else 5802 else
5587 $ECHO "*** Warning: Linking the shared library $output against the loadable module" 5803 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
5588 fi 5804 fi
5617 # figure out the soname 5833 # figure out the soname
5618 set dummy $library_names 5834 set dummy $library_names
5619 shift 5835 shift
5620 realname="$1" 5836 realname="$1"
5621 shift 5837 shift
5622 libname=`eval "\\$ECHO \"$libname_spec\""` 5838 eval "libname=\"$libname_spec\""
5623 # use dlname if we got it. it's perfectly good, no? 5839 # use dlname if we got it. it's perfectly good, no?
5624 if test -n "$dlname"; then 5840 if test -n "$dlname"; then
5625 soname="$dlname" 5841 soname="$dlname"
5626 elif test -n "$soname_spec"; then 5842 elif test -n "$soname_spec"; then
5627 # bleh windows 5843 # bleh windows
5630 func_arith $current - $age 5846 func_arith $current - $age
5631 major=$func_arith_result 5847 major=$func_arith_result
5632 versuffix="-$major" 5848 versuffix="-$major"
5633 ;; 5849 ;;
5634 esac 5850 esac
5635 eval soname=\"$soname_spec\" 5851 eval "soname=\"$soname_spec\""
5636 else 5852 else
5637 soname="$realname" 5853 soname="$realname"
5638 fi 5854 fi
5639 5855
5640 # Make a new name for the extract_expsyms_cmds to use 5856 # Make a new name for the extract_expsyms_cmds to use
5681 if /usr/bin/file -L $add 2> /dev/null | 5897 if /usr/bin/file -L $add 2> /dev/null |
5682 $GREP ": [^:]* bundle" >/dev/null ; then 5898 $GREP ": [^:]* bundle" >/dev/null ; then
5683 if test "X$dlopenmodule" != "X$lib"; then 5899 if test "X$dlopenmodule" != "X$lib"; then
5684 $ECHO "*** Warning: lib $linklib is a module, not a shared library" 5900 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
5685 if test -z "$old_library" ; then 5901 if test -z "$old_library" ; then
5686 $ECHO 5902 echo
5687 $ECHO "*** And there doesn't seem to be a static archive available" 5903 echo "*** And there doesn't seem to be a static archive available"
5688 $ECHO "*** The link will probably fail, sorry" 5904 echo "*** The link will probably fail, sorry"
5689 else 5905 else
5690 add="$dir/$old_library" 5906 add="$dir/$old_library"
5691 fi 5907 fi
5692 elif test -n "$old_library"; then 5908 elif test -n "$old_library"; then
5693 add="$dir/$old_library" 5909 add="$dir/$old_library"
5823 # We're trying link a shared library against a static one 6039 # We're trying link a shared library against a static one
5824 # but the system doesn't support it. 6040 # but the system doesn't support it.
5825 6041
5826 # Just print a warning and add the library to dependency_libs so 6042 # Just print a warning and add the library to dependency_libs so
5827 # that the program can be linked against the static library. 6043 # that the program can be linked against the static library.
5828 $ECHO 6044 echo
5829 $ECHO "*** Warning: This system can not link to static lib archive $lib." 6045 $ECHO "*** Warning: This system can not link to static lib archive $lib."
5830 $ECHO "*** I have the capability to make that library automatically link in when" 6046 echo "*** I have the capability to make that library automatically link in when"
5831 $ECHO "*** you link to this library. But I can only do this if you have a" 6047 echo "*** you link to this library. But I can only do this if you have a"
5832 $ECHO "*** shared version of the library, which you do not appear to have." 6048 echo "*** shared version of the library, which you do not appear to have."
5833 if test "$module" = yes; then 6049 if test "$module" = yes; then
5834 $ECHO "*** But as you try to build a module library, libtool will still create " 6050 echo "*** But as you try to build a module library, libtool will still create "
5835 $ECHO "*** a static module, that should work as long as the dlopening application" 6051 echo "*** a static module, that should work as long as the dlopening application"
5836 $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." 6052 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
5837 if test -z "$global_symbol_pipe"; then 6053 if test -z "$global_symbol_pipe"; then
5838 $ECHO 6054 echo
5839 $ECHO "*** However, this would only work if libtool was able to extract symbol" 6055 echo "*** However, this would only work if libtool was able to extract symbol"
5840 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" 6056 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
5841 $ECHO "*** not find such a program. So, this module is probably useless." 6057 echo "*** not find such a program. So, this module is probably useless."
5842 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." 6058 echo "*** \`nm' from GNU binutils and a full rebuild may help."
5843 fi 6059 fi
5844 if test "$build_old_libs" = no; then 6060 if test "$build_old_libs" = no; then
5845 build_libtool_libs=module 6061 build_libtool_libs=module
5846 build_old_libs=yes 6062 build_old_libs=yes
5847 else 6063 else
5891 done 6107 done
5892 6108
5893 if test "$link_all_deplibs" != no; then 6109 if test "$link_all_deplibs" != no; then
5894 # Add the search paths of all dependency libraries 6110 # Add the search paths of all dependency libraries
5895 for deplib in $dependency_libs; do 6111 for deplib in $dependency_libs; do
6112 path=
5896 case $deplib in 6113 case $deplib in
5897 -L*) path="$deplib" ;; 6114 -L*) path="$deplib" ;;
5898 *.la) 6115 *.la)
5899 func_dirname "$deplib" "" "." 6116 func_dirname "$deplib" "" "."
5900 dir="$func_dirname_result" 6117 dir="$func_dirname_result"
5911 esac 6128 esac
5912 if $GREP "^installed=no" $deplib > /dev/null; then 6129 if $GREP "^installed=no" $deplib > /dev/null; then
5913 case $host in 6130 case $host in
5914 *-*-darwin*) 6131 *-*-darwin*)
5915 depdepl= 6132 depdepl=
5916 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` 6133 deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
5917 if test -n "$deplibrary_names" ; then 6134 if test -n "$deplibrary_names" ; then
5918 for tmp in $deplibrary_names ; do 6135 for tmp in $deplibrary_names ; do
5919 depdepl=$tmp 6136 depdepl=$tmp
5920 done 6137 done
5921 if test -f "$absdir/$objdir/$depdepl" ; then 6138 if test -f "$absdir/$objdir/$depdepl" ; then
5933 *) 6150 *)
5934 path="-L$absdir/$objdir" 6151 path="-L$absdir/$objdir"
5935 ;; 6152 ;;
5936 esac 6153 esac
5937 else 6154 else
5938 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 6155 libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5939 test -z "$libdir" && \ 6156 test -z "$libdir" && \
5940 func_fatal_error "\`$deplib' is not a valid libtool archive" 6157 func_fatal_error "\`$deplib' is not a valid libtool archive"
5941 test "$absdir" != "$libdir" && \ 6158 test "$absdir" != "$libdir" && \
5942 func_warning "\`$deplib' seems to be moved" 6159 func_warning "\`$deplib' seems to be moved"
5943 6160
5956 if test "$pass" = link; then 6173 if test "$pass" = link; then
5957 if test "$linkmode" = "prog"; then 6174 if test "$linkmode" = "prog"; then
5958 compile_deplibs="$new_inherited_linker_flags $compile_deplibs" 6175 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
5959 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" 6176 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
5960 else 6177 else
5961 compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` 6178 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
5962 fi 6179 fi
5963 fi 6180 fi
5964 dependency_libs="$newdependency_libs" 6181 dependency_libs="$newdependency_libs"
5965 if test "$pass" = dlpreopen; then 6182 if test "$pass" = dlpreopen; then
5966 # Link the dlpreopened libraries before other libraries 6183 # Link the dlpreopened libraries before other libraries
5986 else 6203 else
5987 vars="compile_deplibs finalize_deplibs" 6204 vars="compile_deplibs finalize_deplibs"
5988 fi 6205 fi
5989 for var in $vars dependency_libs; do 6206 for var in $vars dependency_libs; do
5990 # Add libraries to $var in reverse order 6207 # Add libraries to $var in reverse order
5991 eval tmp_libs=\"\$$var\" 6208 eval tmp_libs=\$$var
5992 new_libs= 6209 new_libs=
5993 for deplib in $tmp_libs; do 6210 for deplib in $tmp_libs; do
5994 # FIXME: Pedantically, this is the right thing to do, so 6211 # FIXME: Pedantically, this is the right thing to do, so
5995 # that some nasty dependency loop isn't accidentally 6212 # that some nasty dependency loop isn't accidentally
5996 # broken: 6213 # broken:
6037 esac 6254 esac
6038 ;; 6255 ;;
6039 *) tmp_libs="$tmp_libs $deplib" ;; 6256 *) tmp_libs="$tmp_libs $deplib" ;;
6040 esac 6257 esac
6041 done 6258 done
6042 eval $var=\"$tmp_libs\" 6259 eval $var=\$tmp_libs
6043 done # for var 6260 done # for var
6044 fi 6261 fi
6045 # Last step: remove runtime libs from dependency_libs 6262 # Last step: remove runtime libs from dependency_libs
6046 # (they stay in deplibs) 6263 # (they stay in deplibs)
6047 tmp_libs= 6264 tmp_libs=
6100 # Make sure we only generate libraries of the form `libNAME.la'. 6317 # Make sure we only generate libraries of the form `libNAME.la'.
6101 case $outputname in 6318 case $outputname in
6102 lib*) 6319 lib*)
6103 func_stripname 'lib' '.la' "$outputname" 6320 func_stripname 'lib' '.la' "$outputname"
6104 name=$func_stripname_result 6321 name=$func_stripname_result
6105 eval shared_ext=\"$shrext_cmds\" 6322 eval "shared_ext=\"$shrext_cmds\""
6106 eval libname=\"$libname_spec\" 6323 eval "libname=\"$libname_spec\""
6107 ;; 6324 ;;
6108 *) 6325 *)
6109 test "$module" = no && \ 6326 test "$module" = no && \
6110 func_fatal_help "libtool library \`$output' must begin with \`lib'" 6327 func_fatal_help "libtool library \`$output' must begin with \`lib'"
6111 6328
6112 if test "$need_lib_prefix" != no; then 6329 if test "$need_lib_prefix" != no; then
6113 # Add the "lib" prefix for modules if required 6330 # Add the "lib" prefix for modules if required
6114 func_stripname '' '.la' "$outputname" 6331 func_stripname '' '.la' "$outputname"
6115 name=$func_stripname_result 6332 name=$func_stripname_result
6116 eval shared_ext=\"$shrext_cmds\" 6333 eval "shared_ext=\"$shrext_cmds\""
6117 eval libname=\"$libname_spec\" 6334 eval "libname=\"$libname_spec\""
6118 else 6335 else
6119 func_stripname '' '.la' "$outputname" 6336 func_stripname '' '.la' "$outputname"
6120 libname=$func_stripname_result 6337 libname=$func_stripname_result
6121 fi 6338 fi
6122 ;; 6339 ;;
6124 6341
6125 if test -n "$objs"; then 6342 if test -n "$objs"; then
6126 if test "$deplibs_check_method" != pass_all; then 6343 if test "$deplibs_check_method" != pass_all; then
6127 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 6344 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6128 else 6345 else
6129 $ECHO 6346 echo
6130 $ECHO "*** Warning: Linking the shared library $output against the non-libtool" 6347 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6131 $ECHO "*** objects $objs is not portable!" 6348 $ECHO "*** objects $objs is not portable!"
6132 libobjs="$libobjs $objs" 6349 libobjs="$libobjs $objs"
6133 fi 6350 fi
6134 fi 6351 fi
6192 func_arith $number_major + $number_minor 6409 func_arith $number_major + $number_minor
6193 current=$func_arith_result 6410 current=$func_arith_result
6194 age="$number_minor" 6411 age="$number_minor"
6195 revision="$number_revision" 6412 revision="$number_revision"
6196 ;; 6413 ;;
6197 freebsd-aout|freebsd-elf|sunos) 6414 freebsd-aout|freebsd-elf|qnx|sunos)
6198 current="$number_major" 6415 current="$number_major"
6199 revision="$number_minor" 6416 revision="$number_minor"
6200 age="0" 6417 age="0"
6201 ;; 6418 ;;
6202 irix|nonstopux) 6419 irix|nonstopux)
6426 # Now set the variables for building old libraries. 6643 # Now set the variables for building old libraries.
6427 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then 6644 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
6428 oldlibs="$oldlibs $output_objdir/$libname.$libext" 6645 oldlibs="$oldlibs $output_objdir/$libname.$libext"
6429 6646
6430 # Transform .lo files to .o files. 6647 # Transform .lo files to .o files.
6431 oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` 6648 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
6432 fi 6649 fi
6433 6650
6434 # Eliminate all temporary directories. 6651 # Eliminate all temporary directories.
6435 #for path in $notinst_path; do 6652 #for path in $notinst_path; do
6436 # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` 6653 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
6437 # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` 6654 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
6438 # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` 6655 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
6439 #done 6656 #done
6440 6657
6441 if test -n "$xrpath"; then 6658 if test -n "$xrpath"; then
6442 # If the user specified any rpath flags, then add them. 6659 # If the user specified any rpath flags, then add them.
6443 temp_xrpath= 6660 temp_xrpath=
6474 done 6691 done
6475 6692
6476 if test "$build_libtool_libs" = yes; then 6693 if test "$build_libtool_libs" = yes; then
6477 if test -n "$rpath"; then 6694 if test -n "$rpath"; then
6478 case $host in 6695 case $host in
6479 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) 6696 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
6480 # these systems don't actually have a c library (as such)! 6697 # these systems don't actually have a c library (as such)!
6481 ;; 6698 ;;
6482 *-*-rhapsody* | *-*-darwin1.[012]) 6699 *-*-rhapsody* | *-*-darwin1.[012])
6483 # Rhapsody C library is in the System framework 6700 # Rhapsody C library is in the System framework
6484 deplibs="$deplibs System.ltframework" 6701 deplibs="$deplibs System.ltframework"
6551 i="" 6768 i=""
6552 ;; 6769 ;;
6553 esac 6770 esac
6554 fi 6771 fi
6555 if test -n "$i" ; then 6772 if test -n "$i" ; then
6556 libname=`eval "\\$ECHO \"$libname_spec\""` 6773 eval "libname=\"$libname_spec\""
6557 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` 6774 eval "deplib_matches=\"$library_names_spec\""
6558 set dummy $deplib_matches; shift 6775 set dummy $deplib_matches; shift
6559 deplib_match=$1 6776 deplib_match=$1
6560 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 6777 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6561 newdeplibs="$newdeplibs $i" 6778 newdeplibs="$newdeplibs $i"
6562 else 6779 else
6563 droppeddeps=yes 6780 droppeddeps=yes
6564 $ECHO 6781 echo
6565 $ECHO "*** Warning: dynamic linker does not accept needed library $i." 6782 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6566 $ECHO "*** I have the capability to make that library automatically link in when" 6783 echo "*** I have the capability to make that library automatically link in when"
6567 $ECHO "*** you link to this library. But I can only do this if you have a" 6784 echo "*** you link to this library. But I can only do this if you have a"
6568 $ECHO "*** shared version of the library, which I believe you do not have" 6785 echo "*** shared version of the library, which I believe you do not have"
6569 $ECHO "*** because a test_compile did reveal that the linker did not use it for" 6786 echo "*** because a test_compile did reveal that the linker did not use it for"
6570 $ECHO "*** its dynamic dependency list that programs get resolved with at runtime." 6787 echo "*** its dynamic dependency list that programs get resolved with at runtime."
6571 fi 6788 fi
6572 fi 6789 fi
6573 ;; 6790 ;;
6574 *) 6791 *)
6575 newdeplibs="$newdeplibs $i" 6792 newdeplibs="$newdeplibs $i"
6594 i="" 6811 i=""
6595 ;; 6812 ;;
6596 esac 6813 esac
6597 fi 6814 fi
6598 if test -n "$i" ; then 6815 if test -n "$i" ; then
6599 libname=`eval "\\$ECHO \"$libname_spec\""` 6816 eval "libname=\"$libname_spec\""
6600 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` 6817 eval "deplib_matches=\"$library_names_spec\""
6601 set dummy $deplib_matches; shift 6818 set dummy $deplib_matches; shift
6602 deplib_match=$1 6819 deplib_match=$1
6603 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 6820 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6604 newdeplibs="$newdeplibs $i" 6821 newdeplibs="$newdeplibs $i"
6605 else 6822 else
6606 droppeddeps=yes 6823 droppeddeps=yes
6607 $ECHO 6824 echo
6608 $ECHO "*** Warning: dynamic linker does not accept needed library $i." 6825 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6609 $ECHO "*** I have the capability to make that library automatically link in when" 6826 echo "*** I have the capability to make that library automatically link in when"
6610 $ECHO "*** you link to this library. But I can only do this if you have a" 6827 echo "*** you link to this library. But I can only do this if you have a"
6611 $ECHO "*** shared version of the library, which you do not appear to have" 6828 echo "*** shared version of the library, which you do not appear to have"
6612 $ECHO "*** because a test_compile did reveal that the linker did not use this one" 6829 echo "*** because a test_compile did reveal that the linker did not use this one"
6613 $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime." 6830 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
6614 fi 6831 fi
6615 fi 6832 fi
6616 else 6833 else
6617 droppeddeps=yes 6834 droppeddeps=yes
6618 $ECHO 6835 echo
6619 $ECHO "*** Warning! Library $i is needed by this library but I was not able to" 6836 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
6620 $ECHO "*** make it link in! You will probably need to install it or some" 6837 echo "*** make it link in! You will probably need to install it or some"
6621 $ECHO "*** library that it depends on before this library will be fully" 6838 echo "*** library that it depends on before this library will be fully"
6622 $ECHO "*** functional. Installing it before continuing would be even better." 6839 echo "*** functional. Installing it before continuing would be even better."
6623 fi 6840 fi
6624 ;; 6841 ;;
6625 *) 6842 *)
6626 newdeplibs="$newdeplibs $i" 6843 newdeplibs="$newdeplibs $i"
6627 ;; 6844 ;;
6644 a_deplib="" 6861 a_deplib=""
6645 ;; 6862 ;;
6646 esac 6863 esac
6647 fi 6864 fi
6648 if test -n "$a_deplib" ; then 6865 if test -n "$a_deplib" ; then
6649 libname=`eval "\\$ECHO \"$libname_spec\""` 6866 eval "libname=\"$libname_spec\""
6650 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 6867 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6651 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 6868 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6652 for potent_lib in $potential_libs; do 6869 for potent_lib in $potential_libs; do
6653 # Follow soft links. 6870 # Follow soft links.
6654 if ls -lLd "$potent_lib" 2>/dev/null | 6871 if ls -lLd "$potent_lib" 2>/dev/null |
6663 potlib="$potent_lib" 6880 potlib="$potent_lib"
6664 while test -h "$potlib" 2>/dev/null; do 6881 while test -h "$potlib" 2>/dev/null; do
6665 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` 6882 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
6666 case $potliblink in 6883 case $potliblink in
6667 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; 6884 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
6668 *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; 6885 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
6669 esac 6886 esac
6670 done 6887 done
6671 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | 6888 if eval "$file_magic_cmd \"\$potlib\"" 2>/dev/null |
6672 $SED -e 10q | 6889 $SED -e 10q |
6673 $EGREP "$file_magic_regex" > /dev/null; then 6890 $EGREP "$file_magic_regex" > /dev/null; then
6674 newdeplibs="$newdeplibs $a_deplib" 6891 newdeplibs="$newdeplibs $a_deplib"
6675 a_deplib="" 6892 a_deplib=""
6676 break 2 6893 break 2
6678 done 6895 done
6679 done 6896 done
6680 fi 6897 fi
6681 if test -n "$a_deplib" ; then 6898 if test -n "$a_deplib" ; then
6682 droppeddeps=yes 6899 droppeddeps=yes
6683 $ECHO 6900 echo
6684 $ECHO "*** Warning: linker path does not have real file for library $a_deplib." 6901 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6685 $ECHO "*** I have the capability to make that library automatically link in when" 6902 echo "*** I have the capability to make that library automatically link in when"
6686 $ECHO "*** you link to this library. But I can only do this if you have a" 6903 echo "*** you link to this library. But I can only do this if you have a"
6687 $ECHO "*** shared version of the library, which you do not appear to have" 6904 echo "*** shared version of the library, which you do not appear to have"
6688 $ECHO "*** because I did check the linker path looking for a file starting" 6905 echo "*** because I did check the linker path looking for a file starting"
6689 if test -z "$potlib" ; then 6906 if test -z "$potlib" ; then
6690 $ECHO "*** with $libname but no candidates were found. (...for file magic test)" 6907 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
6691 else 6908 else
6692 $ECHO "*** with $libname and none of the candidates passed a file format test" 6909 $ECHO "*** with $libname and none of the candidates passed a file format test"
6693 $ECHO "*** using a file magic. Last file checked: $potlib" 6910 $ECHO "*** using a file magic. Last file checked: $potlib"
6716 a_deplib="" 6933 a_deplib=""
6717 ;; 6934 ;;
6718 esac 6935 esac
6719 fi 6936 fi
6720 if test -n "$a_deplib" ; then 6937 if test -n "$a_deplib" ; then
6721 libname=`eval "\\$ECHO \"$libname_spec\""` 6938 eval "libname=\"$libname_spec\""
6722 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do 6939 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6723 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 6940 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6724 for potent_lib in $potential_libs; do 6941 for potent_lib in $potential_libs; do
6725 potlib="$potent_lib" # see symlink-check above in file_magic test 6942 potlib="$potent_lib" # see symlink-check above in file_magic test
6726 if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ 6943 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
6727 $EGREP "$match_pattern_regex" > /dev/null; then 6944 $EGREP "$match_pattern_regex" > /dev/null; then
6728 newdeplibs="$newdeplibs $a_deplib" 6945 newdeplibs="$newdeplibs $a_deplib"
6729 a_deplib="" 6946 a_deplib=""
6730 break 2 6947 break 2
6731 fi 6948 fi
6732 done 6949 done
6733 done 6950 done
6734 fi 6951 fi
6735 if test -n "$a_deplib" ; then 6952 if test -n "$a_deplib" ; then
6736 droppeddeps=yes 6953 droppeddeps=yes
6737 $ECHO 6954 echo
6738 $ECHO "*** Warning: linker path does not have real file for library $a_deplib." 6955 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6739 $ECHO "*** I have the capability to make that library automatically link in when" 6956 echo "*** I have the capability to make that library automatically link in when"
6740 $ECHO "*** you link to this library. But I can only do this if you have a" 6957 echo "*** you link to this library. But I can only do this if you have a"
6741 $ECHO "*** shared version of the library, which you do not appear to have" 6958 echo "*** shared version of the library, which you do not appear to have"
6742 $ECHO "*** because I did check the linker path looking for a file starting" 6959 echo "*** because I did check the linker path looking for a file starting"
6743 if test -z "$potlib" ; then 6960 if test -z "$potlib" ; then
6744 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" 6961 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
6745 else 6962 else
6746 $ECHO "*** with $libname and none of the candidates passed a file format test" 6963 $ECHO "*** with $libname and none of the candidates passed a file format test"
6747 $ECHO "*** using a regex pattern. Last file checked: $potlib" 6964 $ECHO "*** using a regex pattern. Last file checked: $potlib"
6755 esac 6972 esac
6756 done # Gone through all deplibs. 6973 done # Gone through all deplibs.
6757 ;; 6974 ;;
6758 none | unknown | *) 6975 none | unknown | *)
6759 newdeplibs="" 6976 newdeplibs=""
6760 tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ 6977 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
6761 -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
6762 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 6978 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6763 for i in $predeps $postdeps ; do 6979 for i in $predeps $postdeps ; do
6764 # can't use Xsed below, because $i might contain '/' 6980 # can't use Xsed below, because $i might contain '/'
6765 tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` 6981 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
6766 done 6982 done
6767 fi 6983 fi
6768 if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | 6984 case $tmp_deplibs in
6769 $GREP . >/dev/null; then 6985 *[!\ \ ]*)
6770 $ECHO 6986 echo
6771 if test "X$deplibs_check_method" = "Xnone"; then 6987 if test "X$deplibs_check_method" = "Xnone"; then
6772 $ECHO "*** Warning: inter-library dependencies are not supported in this platform." 6988 echo "*** Warning: inter-library dependencies are not supported in this platform."
6773 else 6989 else
6774 $ECHO "*** Warning: inter-library dependencies are not known to be supported." 6990 echo "*** Warning: inter-library dependencies are not known to be supported."
6775 fi 6991 fi
6776 $ECHO "*** All declared inter-library dependencies are being dropped." 6992 echo "*** All declared inter-library dependencies are being dropped."
6777 droppeddeps=yes 6993 droppeddeps=yes
6778 fi 6994 ;;
6995 esac
6779 ;; 6996 ;;
6780 esac 6997 esac
6781 versuffix=$versuffix_save 6998 versuffix=$versuffix_save
6782 major=$major_save 6999 major=$major_save
6783 release=$release_save 7000 release=$release_save
6785 name=$name_save 7002 name=$name_save
6786 7003
6787 case $host in 7004 case $host in
6788 *-*-rhapsody* | *-*-darwin1.[012]) 7005 *-*-rhapsody* | *-*-darwin1.[012])
6789 # On Rhapsody replace the C library with the System framework 7006 # On Rhapsody replace the C library with the System framework
6790 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` 7007 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
6791 ;; 7008 ;;
6792 esac 7009 esac
6793 7010
6794 if test "$droppeddeps" = yes; then 7011 if test "$droppeddeps" = yes; then
6795 if test "$module" = yes; then 7012 if test "$module" = yes; then
6796 $ECHO 7013 echo
6797 $ECHO "*** Warning: libtool could not satisfy all declared inter-library" 7014 echo "*** Warning: libtool could not satisfy all declared inter-library"
6798 $ECHO "*** dependencies of module $libname. Therefore, libtool will create" 7015 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
6799 $ECHO "*** a static module, that should work as long as the dlopening" 7016 echo "*** a static module, that should work as long as the dlopening"
6800 $ECHO "*** application is linked with the -dlopen flag." 7017 echo "*** application is linked with the -dlopen flag."
6801 if test -z "$global_symbol_pipe"; then 7018 if test -z "$global_symbol_pipe"; then
6802 $ECHO 7019 echo
6803 $ECHO "*** However, this would only work if libtool was able to extract symbol" 7020 echo "*** However, this would only work if libtool was able to extract symbol"
6804 $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" 7021 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
6805 $ECHO "*** not find such a program. So, this module is probably useless." 7022 echo "*** not find such a program. So, this module is probably useless."
6806 $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." 7023 echo "*** \`nm' from GNU binutils and a full rebuild may help."
6807 fi 7024 fi
6808 if test "$build_old_libs" = no; then 7025 if test "$build_old_libs" = no; then
6809 oldlibs="$output_objdir/$libname.$libext" 7026 oldlibs="$output_objdir/$libname.$libext"
6810 build_libtool_libs=module 7027 build_libtool_libs=module
6811 build_old_libs=yes 7028 build_old_libs=yes
6812 else 7029 else
6813 build_libtool_libs=no 7030 build_libtool_libs=no
6814 fi 7031 fi
6815 else 7032 else
6816 $ECHO "*** The inter-library dependencies that have been dropped here will be" 7033 echo "*** The inter-library dependencies that have been dropped here will be"
6817 $ECHO "*** automatically added whenever a program is linked with this library" 7034 echo "*** automatically added whenever a program is linked with this library"
6818 $ECHO "*** or is declared to -dlopen it." 7035 echo "*** or is declared to -dlopen it."
6819 7036
6820 if test "$allow_undefined" = no; then 7037 if test "$allow_undefined" = no; then
6821 $ECHO 7038 echo
6822 $ECHO "*** Since this library must not contain undefined symbols," 7039 echo "*** Since this library must not contain undefined symbols,"
6823 $ECHO "*** because either the platform does not support them or" 7040 echo "*** because either the platform does not support them or"
6824 $ECHO "*** it was explicitly requested with -no-undefined," 7041 echo "*** it was explicitly requested with -no-undefined,"
6825 $ECHO "*** libtool will only create a static version of it." 7042 echo "*** libtool will only create a static version of it."
6826 if test "$build_old_libs" = no; then 7043 if test "$build_old_libs" = no; then
6827 oldlibs="$output_objdir/$libname.$libext" 7044 oldlibs="$output_objdir/$libname.$libext"
6828 build_libtool_libs=module 7045 build_libtool_libs=module
6829 build_old_libs=yes 7046 build_old_libs=yes
6830 else 7047 else
6837 deplibs=$newdeplibs 7054 deplibs=$newdeplibs
6838 fi 7055 fi
6839 # Time to change all our "foo.ltframework" stuff back to "-framework foo" 7056 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
6840 case $host in 7057 case $host in
6841 *-*-darwin*) 7058 *-*-darwin*)
6842 newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` 7059 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6843 new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` 7060 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6844 deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` 7061 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6845 ;; 7062 ;;
6846 esac 7063 esac
6847 7064
6848 # move library search paths that coincide with paths to not yet 7065 # move library search paths that coincide with paths to not yet
6849 # installed libraries to the beginning of the library search list 7066 # installed libraries to the beginning of the library search list
6899 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 7116 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
6900 ;; 7117 ;;
6901 esac 7118 esac
6902 fi 7119 fi
6903 else 7120 else
6904 eval flag=\"$hardcode_libdir_flag_spec\" 7121 eval "flag=\"$hardcode_libdir_flag_spec\""
6905 dep_rpath="$dep_rpath $flag" 7122 dep_rpath="$dep_rpath $flag"
6906 fi 7123 fi
6907 elif test -n "$runpath_var"; then 7124 elif test -n "$runpath_var"; then
6908 case "$perm_rpath " in 7125 case "$perm_rpath " in
6909 *" $libdir "*) ;; 7126 *" $libdir "*) ;;
6914 # Substitute the hardcoded libdirs into the rpath. 7131 # Substitute the hardcoded libdirs into the rpath.
6915 if test -n "$hardcode_libdir_separator" && 7132 if test -n "$hardcode_libdir_separator" &&
6916 test -n "$hardcode_libdirs"; then 7133 test -n "$hardcode_libdirs"; then
6917 libdir="$hardcode_libdirs" 7134 libdir="$hardcode_libdirs"
6918 if test -n "$hardcode_libdir_flag_spec_ld"; then 7135 if test -n "$hardcode_libdir_flag_spec_ld"; then
6919 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" 7136 eval "dep_rpath=\"$hardcode_libdir_flag_spec_ld\""
6920 else 7137 else
6921 eval dep_rpath=\"$hardcode_libdir_flag_spec\" 7138 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
6922 fi 7139 fi
6923 fi 7140 fi
6924 if test -n "$runpath_var" && test -n "$perm_rpath"; then 7141 if test -n "$runpath_var" && test -n "$perm_rpath"; then
6925 # We should set the runpath_var. 7142 # We should set the runpath_var.
6926 rpath= 7143 rpath=
6927 for dir in $perm_rpath; do 7144 for dir in $perm_rpath; do
6928 rpath="$rpath$dir:" 7145 rpath="$rpath$dir:"
6929 done 7146 done
6930 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" 7147 eval $runpath_var=\$rpath\$$runpath_var
7148 export $runpath_var
6931 fi 7149 fi
6932 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" 7150 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
6933 fi 7151 fi
6934 7152
6935 shlibpath="$finalize_shlibpath" 7153 shlibpath="$finalize_shlibpath"
6936 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" 7154 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
6937 if test -n "$shlibpath"; then 7155 if test -n "$shlibpath"; then
6938 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" 7156 eval $shlibpath_var=\$shlibpath\$$shlibpath_var
7157 export $shlibpath_var
6939 fi 7158 fi
6940 7159
6941 # Get the real and link names of the library. 7160 # Get the real and link names of the library.
6942 eval shared_ext=\"$shrext_cmds\" 7161 eval "shared_ext=\"$shrext_cmds\""
6943 eval library_names=\"$library_names_spec\" 7162 eval "library_names=\"$library_names_spec\""
6944 set dummy $library_names 7163 set dummy $library_names
6945 shift 7164 shift
6946 realname="$1" 7165 realname="$1"
6947 shift 7166 shift
6948 7167
6949 if test -n "$soname_spec"; then 7168 if test -n "$soname_spec"; then
6950 eval soname=\"$soname_spec\" 7169 eval "soname=\"$soname_spec\""
6951 else 7170 else
6952 soname="$realname" 7171 soname="$realname"
6953 fi 7172 fi
6954 if test -z "$dlname"; then 7173 if test -z "$dlname"; then
6955 dlname=$soname 7174 dlname=$soname
6961 do 7180 do
6962 linknames="$linknames $link" 7181 linknames="$linknames $link"
6963 done 7182 done
6964 7183
6965 # Use standard objects if they are pic 7184 # Use standard objects if they are pic
6966 test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 7185 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
6967 test "X$libobjs" = "X " && libobjs= 7186 test "X$libobjs" = "X " && libobjs=
6968 7187
6969 delfiles= 7188 delfiles=
6970 if test -n "$export_symbols" && test -n "$include_expsyms"; then 7189 if test -n "$export_symbols" && test -n "$include_expsyms"; then
6971 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" 7190 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
7001 $opt_dry_run || $RM $export_symbols 7220 $opt_dry_run || $RM $export_symbols
7002 cmds=$export_symbols_cmds 7221 cmds=$export_symbols_cmds
7003 save_ifs="$IFS"; IFS='~' 7222 save_ifs="$IFS"; IFS='~'
7004 for cmd in $cmds; do 7223 for cmd in $cmds; do
7005 IFS="$save_ifs" 7224 IFS="$save_ifs"
7006 eval cmd=\"$cmd\" 7225 eval "cmd=\"$cmd\""
7007 func_len " $cmd" 7226 func_len " $cmd"
7008 len=$func_len_result 7227 len=$func_len_result
7009 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then 7228 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7010 func_show_eval "$cmd" 'exit $?' 7229 func_show_eval "$cmd" 'exit $?'
7011 skipped_export=false 7230 skipped_export=false
7027 fi 7246 fi
7028 7247
7029 if test -n "$export_symbols" && test -n "$include_expsyms"; then 7248 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7030 tmp_export_symbols="$export_symbols" 7249 tmp_export_symbols="$export_symbols"
7031 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" 7250 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7032 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' 7251 $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"
7033 fi 7252 fi
7034 7253
7035 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then 7254 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7036 # The given exports_symbols file has to be filtered, so filter it. 7255 # The given exports_symbols file has to be filtered, so filter it.
7037 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" 7256 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7065 # TODO: could optimize this to just extract one archive. 7284 # TODO: could optimize this to just extract one archive.
7066 whole_archive_flag_spec= 7285 whole_archive_flag_spec=
7067 fi 7286 fi
7068 if test -n "$whole_archive_flag_spec"; then 7287 if test -n "$whole_archive_flag_spec"; then
7069 save_libobjs=$libobjs 7288 save_libobjs=$libobjs
7070 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 7289 eval "libobjs=\"\$libobjs $whole_archive_flag_spec\""
7071 test "X$libobjs" = "X " && libobjs= 7290 test "X$libobjs" = "X " && libobjs=
7072 else 7291 else
7073 gentop="$output_objdir/${outputname}x" 7292 gentop="$output_objdir/${outputname}x"
7074 generated="$generated $gentop" 7293 generated="$generated $gentop"
7075 7294
7078 test "X$libobjs" = "X " && libobjs= 7297 test "X$libobjs" = "X " && libobjs=
7079 fi 7298 fi
7080 fi 7299 fi
7081 7300
7082 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then 7301 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7083 eval flag=\"$thread_safe_flag_spec\" 7302 eval "flag=\"$thread_safe_flag_spec\""
7084 linker_flags="$linker_flags $flag" 7303 linker_flags="$linker_flags $flag"
7085 fi 7304 fi
7086 7305
7087 # Make a backup of the uninstalled library when relinking 7306 # Make a backup of the uninstalled library when relinking
7088 if test "$mode" = relink; then 7307 if test "$mode" = relink; then
7089 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? 7308 $opt_dry_run || (cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U) || exit $?
7090 fi 7309 fi
7091 7310
7092 # Do each of the archive commands. 7311 # Do each of the archive commands.
7093 if test "$module" = yes && test -n "$module_cmds" ; then 7312 if test "$module" = yes && test -n "$module_cmds" ; then
7094 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 7313 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7095 eval test_cmds=\"$module_expsym_cmds\" 7314 eval "test_cmds=\"$module_expsym_cmds\""
7096 cmds=$module_expsym_cmds 7315 cmds=$module_expsym_cmds
7097 else 7316 else
7098 eval test_cmds=\"$module_cmds\" 7317 eval "test_cmds=\"$module_cmds\""
7099 cmds=$module_cmds 7318 cmds=$module_cmds
7100 fi 7319 fi
7101 else 7320 else
7102 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 7321 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
7103 eval test_cmds=\"$archive_expsym_cmds\" 7322 eval "test_cmds=\"$archive_expsym_cmds\""
7104 cmds=$archive_expsym_cmds 7323 cmds=$archive_expsym_cmds
7105 else 7324 else
7106 eval test_cmds=\"$archive_cmds\" 7325 eval "test_cmds=\"$archive_cmds\""
7107 cmds=$archive_cmds 7326 cmds=$archive_cmds
7108 fi 7327 fi
7109 fi 7328 fi
7110 7329
7111 if test "X$skipped_export" != "X:" && 7330 if test "X$skipped_export" != "X:" &&
7128 # the spec. 7347 # the spec.
7129 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then 7348 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
7130 save_libobjs=$libobjs 7349 save_libobjs=$libobjs
7131 fi 7350 fi
7132 save_output=$output 7351 save_output=$output
7133 output_la=`$ECHO "X$output" | $Xsed -e "$basename"` 7352 func_basename "$output"
7353 output_la=$func_basename_result
7134 7354
7135 # Clear the reloadable object creation command queue and 7355 # Clear the reloadable object creation command queue and
7136 # initialize k to one. 7356 # initialize k to one.
7137 test_cmds= 7357 test_cmds=
7138 concat_cmds= 7358 concat_cmds=
7141 k=1 7361 k=1
7142 7362
7143 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then 7363 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7144 output=${output_objdir}/${output_la}.lnkscript 7364 output=${output_objdir}/${output_la}.lnkscript
7145 func_verbose "creating GNU ld script: $output" 7365 func_verbose "creating GNU ld script: $output"
7146 $ECHO 'INPUT (' > $output 7366 echo 'INPUT (' > $output
7147 for obj in $save_libobjs 7367 for obj in $save_libobjs
7148 do 7368 do
7149 $ECHO "$obj" >> $output 7369 $ECHO "$obj" >> $output
7150 done 7370 done
7151 $ECHO ')' >> $output 7371 echo ')' >> $output
7152 delfiles="$delfiles $output" 7372 delfiles="$delfiles $output"
7153 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then 7373 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7154 output=${output_objdir}/${output_la}.lnk 7374 output=${output_objdir}/${output_la}.lnk
7155 func_verbose "creating linker input file list: $output" 7375 func_verbose "creating linker input file list: $output"
7156 : > $output 7376 : > $output
7169 output=$firstobj\"$file_list_spec$output\" 7389 output=$firstobj\"$file_list_spec$output\"
7170 else 7390 else
7171 if test -n "$save_libobjs"; then 7391 if test -n "$save_libobjs"; then
7172 func_verbose "creating reloadable object files..." 7392 func_verbose "creating reloadable object files..."
7173 output=$output_objdir/$output_la-${k}.$objext 7393 output=$output_objdir/$output_la-${k}.$objext
7174 eval test_cmds=\"$reload_cmds\" 7394 eval "test_cmds=\"$reload_cmds\""
7175 func_len " $test_cmds" 7395 func_len " $test_cmds"
7176 len0=$func_len_result 7396 len0=$func_len_result
7177 len=$len0 7397 len=$len0
7178 7398
7179 # Loop over the list of objects to be linked. 7399 # Loop over the list of objects to be linked.
7188 else 7408 else
7189 # The command $test_cmds is almost too long, add a 7409 # The command $test_cmds is almost too long, add a
7190 # command to the queue. 7410 # command to the queue.
7191 if test "$k" -eq 1 ; then 7411 if test "$k" -eq 1 ; then
7192 # The first file doesn't have a previous command to add. 7412 # The first file doesn't have a previous command to add.
7193 eval concat_cmds=\"$reload_cmds $objlist $last_robj\" 7413 reload_objs=$objlist
7414 eval "concat_cmds=\"$reload_cmds\""
7194 else 7415 else
7195 # All subsequent reloadable object files will link in 7416 # All subsequent reloadable object files will link in
7196 # the last one created. 7417 # the last one created.
7197 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" 7418 reload_objs="$objlist $last_robj"
7419 eval "concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\""
7198 fi 7420 fi
7199 last_robj=$output_objdir/$output_la-${k}.$objext 7421 last_robj=$output_objdir/$output_la-${k}.$objext
7200 func_arith $k + 1 7422 func_arith $k + 1
7201 k=$func_arith_result 7423 k=$func_arith_result
7202 output=$output_objdir/$output_la-${k}.$objext 7424 output=$output_objdir/$output_la-${k}.$objext
7203 objlist=$obj 7425 objlist=" $obj"
7204 func_len " $last_robj" 7426 func_len " $last_robj"
7205 func_arith $len0 + $func_len_result 7427 func_arith $len0 + $func_len_result
7206 len=$func_arith_result 7428 len=$func_arith_result
7207 fi 7429 fi
7208 done 7430 done
7209 # Handle the remaining objects by creating one last 7431 # Handle the remaining objects by creating one last
7210 # reloadable object file. All subsequent reloadable object 7432 # reloadable object file. All subsequent reloadable object
7211 # files will link in the last one created. 7433 # files will link in the last one created.
7212 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 7434 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7213 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" 7435 reload_objs="$objlist $last_robj"
7436 eval "concat_cmds=\"\${concat_cmds}$reload_cmds\""
7214 if test -n "$last_robj"; then 7437 if test -n "$last_robj"; then
7215 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" 7438 eval "concat_cmds=\"\${concat_cmds}~\$RM $last_robj\""
7216 fi 7439 fi
7217 delfiles="$delfiles $output" 7440 delfiles="$delfiles $output"
7218 7441
7219 else 7442 else
7220 output= 7443 output=
7225 export_symbols="$output_objdir/$libname.exp" 7448 export_symbols="$output_objdir/$libname.exp"
7226 $opt_dry_run || $RM $export_symbols 7449 $opt_dry_run || $RM $export_symbols
7227 libobjs=$output 7450 libobjs=$output
7228 # Append the command to create the export file. 7451 # Append the command to create the export file.
7229 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 7452 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7230 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" 7453 eval "concat_cmds=\"\$concat_cmds$export_symbols_cmds\""
7231 if test -n "$last_robj"; then 7454 if test -n "$last_robj"; then
7232 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" 7455 eval "concat_cmds=\"\$concat_cmds~\$RM $last_robj\""
7233 fi 7456 fi
7234 fi 7457 fi
7235 7458
7236 test -n "$save_libobjs" && 7459 test -n "$save_libobjs" &&
7237 func_verbose "creating a temporary reloadable object file: $output" 7460 func_verbose "creating a temporary reloadable object file: $output"
7267 7490
7268 if ${skipped_export-false}; then 7491 if ${skipped_export-false}; then
7269 if test -n "$export_symbols" && test -n "$include_expsyms"; then 7492 if test -n "$export_symbols" && test -n "$include_expsyms"; then
7270 tmp_export_symbols="$export_symbols" 7493 tmp_export_symbols="$export_symbols"
7271 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" 7494 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7272 $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' 7495 $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"
7273 fi 7496 fi
7274 7497
7275 if test -n "$orig_export_symbols"; then 7498 if test -n "$orig_export_symbols"; then
7276 # The given exports_symbols file has to be filtered, so filter it. 7499 # The given exports_symbols file has to be filtered, so filter it.
7277 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" 7500 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
7290 libobjs=$output 7513 libobjs=$output
7291 # Restore the value of output. 7514 # Restore the value of output.
7292 output=$save_output 7515 output=$save_output
7293 7516
7294 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then 7517 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
7295 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 7518 eval "libobjs=\"\$libobjs $whole_archive_flag_spec\""
7296 test "X$libobjs" = "X " && libobjs= 7519 test "X$libobjs" = "X " && libobjs=
7297 fi 7520 fi
7298 # Expand the library linking commands again to reset the 7521 # Expand the library linking commands again to reset the
7299 # value of $libobjs for piecewise linking. 7522 # value of $libobjs for piecewise linking.
7300 7523
7314 fi 7537 fi
7315 fi 7538 fi
7316 7539
7317 if test -n "$delfiles"; then 7540 if test -n "$delfiles"; then
7318 # Append the command to remove temporary files to $cmds. 7541 # Append the command to remove temporary files to $cmds.
7319 eval cmds=\"\$cmds~\$RM $delfiles\" 7542 eval "cmds=\"\$cmds~\$RM $delfiles\""
7320 fi 7543 fi
7321 7544
7322 # Add any objects from preloaded convenience libraries 7545 # Add any objects from preloaded convenience libraries
7323 if test -n "$dlprefiles"; then 7546 if test -n "$dlprefiles"; then
7324 gentop="$output_objdir/${outputname}x" 7547 gentop="$output_objdir/${outputname}x"
7330 fi 7553 fi
7331 7554
7332 save_ifs="$IFS"; IFS='~' 7555 save_ifs="$IFS"; IFS='~'
7333 for cmd in $cmds; do 7556 for cmd in $cmds; do
7334 IFS="$save_ifs" 7557 IFS="$save_ifs"
7335 eval cmd=\"$cmd\" 7558 eval "cmd=\"$cmd\""
7336 $opt_silent || { 7559 $opt_silent || {
7337 func_quote_for_expand "$cmd" 7560 func_quote_for_expand "$cmd"
7338 eval "func_echo $func_quote_for_expand_result" 7561 eval "func_echo $func_quote_for_expand_result"
7339 } 7562 }
7340 $opt_dry_run || eval "$cmd" || { 7563 $opt_dry_run || eval "$cmd" || {
7352 done 7575 done
7353 IFS="$save_ifs" 7576 IFS="$save_ifs"
7354 7577
7355 # Restore the uninstalled library and exit 7578 # Restore the uninstalled library and exit
7356 if test "$mode" = relink; then 7579 if test "$mode" = relink; then
7357 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? 7580 $opt_dry_run || (cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname) || exit $?
7358 7581
7359 if test -n "$convenience"; then 7582 if test -n "$convenience"; then
7360 if test -z "$whole_archive_flag_spec"; then 7583 if test -z "$whole_archive_flag_spec"; then
7361 func_show_eval '${RM}r "$gentop"' 7584 func_show_eval '${RM}r "$gentop"'
7362 fi 7585 fi
7431 # turning comma into space.. 7654 # turning comma into space..
7432 wl= 7655 wl=
7433 7656
7434 if test -n "$convenience"; then 7657 if test -n "$convenience"; then
7435 if test -n "$whole_archive_flag_spec"; then 7658 if test -n "$whole_archive_flag_spec"; then
7436 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" 7659 eval "tmp_whole_archive_flags=\"$whole_archive_flag_spec\""
7437 reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` 7660 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
7438 else 7661 else
7439 gentop="$output_objdir/${obj}x" 7662 gentop="$output_objdir/${obj}x"
7440 generated="$generated $gentop" 7663 generated="$generated $gentop"
7441 7664
7442 func_extract_archives $gentop $convenience 7665 func_extract_archives $gentop $convenience
7443 reload_conv_objs="$reload_objs $func_extract_archives_result" 7666 reload_conv_objs="$reload_objs $func_extract_archives_result"
7444 fi 7667 fi
7445 fi 7668 fi
7446 7669
7447 # Create the old-style object. 7670 # Create the old-style object.
7448 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 7671 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
7449 7672
7450 output="$obj" 7673 output="$obj"
7451 func_execute_cmds "$reload_cmds" 'exit $?' 7674 func_execute_cmds "$reload_cmds" 'exit $?'
7452 7675
7453 # Exit if we aren't doing a library object file. 7676 # Exit if we aren't doing a library object file.
7465 fi 7688 fi
7466 7689
7467 # Create an invalid libtool object if no PIC, so that we don't 7690 # Create an invalid libtool object if no PIC, so that we don't
7468 # accidentally link it into a program. 7691 # accidentally link it into a program.
7469 # $show "echo timestamp > $libobj" 7692 # $show "echo timestamp > $libobj"
7470 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? 7693 # $opt_dry_run || echo timestamp > $libobj || exit $?
7471 exit $EXIT_SUCCESS 7694 exit $EXIT_SUCCESS
7472 fi 7695 fi
7473 7696
7474 if test -n "$pic_flag" || test "$pic_mode" != default; then 7697 if test -n "$pic_flag" || test "$pic_mode" != default; then
7475 # Only do commands if we really have different PIC objects. 7698 # Only do commands if we really have different PIC objects.
7503 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." 7726 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
7504 7727
7505 case $host in 7728 case $host in
7506 *-*-rhapsody* | *-*-darwin1.[012]) 7729 *-*-rhapsody* | *-*-darwin1.[012])
7507 # On Rhapsody replace the C library is the System framework 7730 # On Rhapsody replace the C library is the System framework
7508 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` 7731 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
7509 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` 7732 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
7510 ;; 7733 ;;
7511 esac 7734 esac
7512 7735
7513 case $host in 7736 case $host in
7514 *-*-darwin*) 7737 *-*-darwin*)
7521 finalize_command="$finalize_command ${wl}-bind_at_load" 7744 finalize_command="$finalize_command ${wl}-bind_at_load"
7522 ;; 7745 ;;
7523 esac 7746 esac
7524 fi 7747 fi
7525 # Time to change all our "foo.ltframework" stuff back to "-framework foo" 7748 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7526 compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` 7749 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7527 finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` 7750 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7528 ;; 7751 ;;
7529 esac 7752 esac
7530 7753
7531 7754
7532 # move library search paths that coincide with paths to not yet 7755 # move library search paths that coincide with paths to not yet
7588 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 7811 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7589 ;; 7812 ;;
7590 esac 7813 esac
7591 fi 7814 fi
7592 else 7815 else
7593 eval flag=\"$hardcode_libdir_flag_spec\" 7816 eval "flag=\"$hardcode_libdir_flag_spec\""
7594 rpath="$rpath $flag" 7817 rpath="$rpath $flag"
7595 fi 7818 fi
7596 elif test -n "$runpath_var"; then 7819 elif test -n "$runpath_var"; then
7597 case "$perm_rpath " in 7820 case "$perm_rpath " in
7598 *" $libdir "*) ;; 7821 *" $libdir "*) ;;
7617 done 7840 done
7618 # Substitute the hardcoded libdirs into the rpath. 7841 # Substitute the hardcoded libdirs into the rpath.
7619 if test -n "$hardcode_libdir_separator" && 7842 if test -n "$hardcode_libdir_separator" &&
7620 test -n "$hardcode_libdirs"; then 7843 test -n "$hardcode_libdirs"; then
7621 libdir="$hardcode_libdirs" 7844 libdir="$hardcode_libdirs"
7622 eval rpath=\" $hardcode_libdir_flag_spec\" 7845 eval "rpath=\" $hardcode_libdir_flag_spec\""
7623 fi 7846 fi
7624 compile_rpath="$rpath" 7847 compile_rpath="$rpath"
7625 7848
7626 rpath= 7849 rpath=
7627 hardcode_libdirs= 7850 hardcode_libdirs=
7639 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" 7862 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
7640 ;; 7863 ;;
7641 esac 7864 esac
7642 fi 7865 fi
7643 else 7866 else
7644 eval flag=\"$hardcode_libdir_flag_spec\" 7867 eval "flag=\"$hardcode_libdir_flag_spec\""
7645 rpath="$rpath $flag" 7868 rpath="$rpath $flag"
7646 fi 7869 fi
7647 elif test -n "$runpath_var"; then 7870 elif test -n "$runpath_var"; then
7648 case "$finalize_perm_rpath " in 7871 case "$finalize_perm_rpath " in
7649 *" $libdir "*) ;; 7872 *" $libdir "*) ;;
7653 done 7876 done
7654 # Substitute the hardcoded libdirs into the rpath. 7877 # Substitute the hardcoded libdirs into the rpath.
7655 if test -n "$hardcode_libdir_separator" && 7878 if test -n "$hardcode_libdir_separator" &&
7656 test -n "$hardcode_libdirs"; then 7879 test -n "$hardcode_libdirs"; then
7657 libdir="$hardcode_libdirs" 7880 libdir="$hardcode_libdirs"
7658 eval rpath=\" $hardcode_libdir_flag_spec\" 7881 eval "rpath=\" $hardcode_libdir_flag_spec\""
7659 fi 7882 fi
7660 finalize_rpath="$rpath" 7883 finalize_rpath="$rpath"
7661 7884
7662 if test -n "$libobjs" && test "$build_old_libs" = yes; then 7885 if test -n "$libobjs" && test "$build_old_libs" = yes; then
7663 # Transform all the library objects into standard objects. 7886 # Transform all the library objects into standard objects.
7664 compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 7887 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
7665 finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` 7888 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
7666 fi 7889 fi
7667 7890
7668 func_generate_dlsyms "$outputname" "@PROGRAM@" "no" 7891 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
7669 7892
7670 # template prelinking step 7893 # template prelinking step
7672 func_execute_cmds "$prelink_cmds" 'exit $?' 7895 func_execute_cmds "$prelink_cmds" 'exit $?'
7673 fi 7896 fi
7674 7897
7675 wrappers_required=yes 7898 wrappers_required=yes
7676 case $host in 7899 case $host in
7900 *cegcc* | *mingw32ce*)
7901 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
7902 wrappers_required=no
7903 ;;
7677 *cygwin* | *mingw* ) 7904 *cygwin* | *mingw* )
7678 if test "$build_libtool_libs" != yes; then 7905 if test "$build_libtool_libs" != yes; then
7679 wrappers_required=no 7906 wrappers_required=no
7680 fi 7907 fi
7681 ;;
7682 *cegcc)
7683 # Disable wrappers for cegcc, we are cross compiling anyway.
7684 wrappers_required=no
7685 ;; 7908 ;;
7686 *) 7909 *)
7687 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then 7910 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7688 wrappers_required=no 7911 wrappers_required=no
7689 fi 7912 fi
7690 ;; 7913 ;;
7691 esac 7914 esac
7692 if test "$wrappers_required" = no; then 7915 if test "$wrappers_required" = no; then
7693 # Replace the output file specification. 7916 # Replace the output file specification.
7694 compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 7917 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
7695 link_command="$compile_command$compile_rpath" 7918 link_command="$compile_command$compile_rpath"
7696 7919
7697 # We have no uninstalled library dependencies, so finalize right now. 7920 # We have no uninstalled library dependencies, so finalize right now.
7698 exit_status=0 7921 exit_status=0
7699 func_show_eval "$link_command" 'exit_status=$?' 7922 func_show_eval "$link_command" 'exit_status=$?'
7736 7959
7737 if test "$no_install" = yes; then 7960 if test "$no_install" = yes; then
7738 # We don't need to create a wrapper script. 7961 # We don't need to create a wrapper script.
7739 link_command="$compile_var$compile_command$compile_rpath" 7962 link_command="$compile_var$compile_command$compile_rpath"
7740 # Replace the output file specification. 7963 # Replace the output file specification.
7741 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` 7964 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
7742 # Delete the old output file. 7965 # Delete the old output file.
7743 $opt_dry_run || $RM $output 7966 $opt_dry_run || $RM $output
7744 # Link the executable and exit 7967 # Link the executable and exit
7745 func_show_eval "$link_command" 'exit $?' 7968 func_show_eval "$link_command" 'exit $?'
7746 exit $EXIT_SUCCESS 7969 exit $EXIT_SUCCESS
7755 func_warning "\`$output' will be relinked during installation" 7978 func_warning "\`$output' will be relinked during installation"
7756 else 7979 else
7757 if test "$fast_install" != no; then 7980 if test "$fast_install" != no; then
7758 link_command="$finalize_var$compile_command$finalize_rpath" 7981 link_command="$finalize_var$compile_command$finalize_rpath"
7759 if test "$fast_install" = yes; then 7982 if test "$fast_install" = yes; then
7760 relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` 7983 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
7761 else 7984 else
7762 # fast_install is set to needless 7985 # fast_install is set to needless
7763 relink_command= 7986 relink_command=
7764 fi 7987 fi
7765 else 7988 else
7767 relink_command="$finalize_var$finalize_command$finalize_rpath" 7990 relink_command="$finalize_var$finalize_command$finalize_rpath"
7768 fi 7991 fi
7769 fi 7992 fi
7770 7993
7771 # Replace the output file specification. 7994 # Replace the output file specification.
7772 link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` 7995 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
7773 7996
7774 # Delete the old output files. 7997 # Delete the old output files.
7775 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname 7998 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
7776 7999
7777 func_show_eval "$link_command" 'exit $?' 8000 func_show_eval "$link_command" 'exit $?'
7791 func_quote_for_eval "$var_value" 8014 func_quote_for_eval "$var_value"
7792 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" 8015 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
7793 fi 8016 fi
7794 done 8017 done
7795 relink_command="(cd `pwd`; $relink_command)" 8018 relink_command="(cd `pwd`; $relink_command)"
7796 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` 8019 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
7797 fi
7798
7799 # Quote $ECHO for shipping.
7800 if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
7801 case $progpath in
7802 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
7803 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
7804 esac
7805 qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
7806 else
7807 qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
7808 fi 8020 fi
7809 8021
7810 # Only actually do things if not in dry run mode. 8022 # Only actually do things if not in dry run mode.
7811 $opt_dry_run || { 8023 $opt_dry_run || {
7812 # win32 will think the script is a binary if it has 8024 # win32 will think the script is a binary if it has
7923 func_basename "$obj" 8135 func_basename "$obj"
7924 $ECHO "$func_basename_result" 8136 $ECHO "$func_basename_result"
7925 done | sort | sort -uc >/dev/null 2>&1); then 8137 done | sort | sort -uc >/dev/null 2>&1); then
7926 : 8138 :
7927 else 8139 else
7928 $ECHO "copying selected object files to avoid basename conflicts..." 8140 echo "copying selected object files to avoid basename conflicts..."
7929 gentop="$output_objdir/${outputname}x" 8141 gentop="$output_objdir/${outputname}x"
7930 generated="$generated $gentop" 8142 generated="$generated $gentop"
7931 func_mkdir_p "$gentop" 8143 func_mkdir_p "$gentop"
7932 save_oldobjs=$oldobjs 8144 save_oldobjs=$oldobjs
7933 oldobjs= 8145 oldobjs=
7955 ;; 8167 ;;
7956 *) oldobjs="$oldobjs $obj" ;; 8168 *) oldobjs="$oldobjs $obj" ;;
7957 esac 8169 esac
7958 done 8170 done
7959 fi 8171 fi
7960 eval cmds=\"$old_archive_cmds\" 8172 eval "cmds=\"$old_archive_cmds\""
7961 8173
7962 func_len " $cmds" 8174 func_len " $cmds"
7963 len=$func_len_result 8175 len=$func_len_result
7964 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then 8176 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7965 cmds=$old_archive_cmds 8177 cmds=$old_archive_cmds
7975 # Is there a better way of finding the last object in the list? 8187 # Is there a better way of finding the last object in the list?
7976 for obj in $save_oldobjs 8188 for obj in $save_oldobjs
7977 do 8189 do
7978 last_oldobj=$obj 8190 last_oldobj=$obj
7979 done 8191 done
7980 eval test_cmds=\"$old_archive_cmds\" 8192 eval "test_cmds=\"$old_archive_cmds\""
7981 func_len " $test_cmds" 8193 func_len " $test_cmds"
7982 len0=$func_len_result 8194 len0=$func_len_result
7983 len=$len0 8195 len=$len0
7984 for obj in $save_oldobjs 8196 for obj in $save_oldobjs
7985 do 8197 do
7994 oldobjs=$objlist 8206 oldobjs=$objlist
7995 if test "$obj" = "$last_oldobj" ; then 8207 if test "$obj" = "$last_oldobj" ; then
7996 RANLIB=$save_RANLIB 8208 RANLIB=$save_RANLIB
7997 fi 8209 fi
7998 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 8210 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7999 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" 8211 eval "concat_cmds=\"\${concat_cmds}$old_archive_cmds\""
8000 objlist= 8212 objlist=
8001 len=$len0 8213 len=$len0
8002 fi 8214 fi
8003 done 8215 done
8004 RANLIB=$save_RANLIB 8216 RANLIB=$save_RANLIB
8005 oldobjs=$objlist 8217 oldobjs=$objlist
8006 if test "X$oldobjs" = "X" ; then 8218 if test "X$oldobjs" = "X" ; then
8007 eval cmds=\"\$concat_cmds\" 8219 eval "cmds=\"\$concat_cmds\""
8008 else 8220 else
8009 eval cmds=\"\$concat_cmds~\$old_archive_cmds\" 8221 eval "cmds=\"\$concat_cmds~\$old_archive_cmds\""
8010 fi 8222 fi
8011 fi 8223 fi
8012 fi 8224 fi
8013 func_execute_cmds "$cmds" 'exit $?' 8225 func_execute_cmds "$cmds" 'exit $?'
8014 done 8226 done
8034 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" 8246 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8035 fi 8247 fi
8036 done 8248 done
8037 # Quote the link command for shipping. 8249 # Quote the link command for shipping.
8038 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" 8250 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8039 relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` 8251 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
8040 if test "$hardcode_automatic" = yes ; then 8252 if test "$hardcode_automatic" = yes ; then
8041 relink_command= 8253 relink_command=
8042 fi 8254 fi
8043 8255
8044 # Only create the output if not a dry run. 8256 # Only create the output if not a dry run.
8054 for deplib in $dependency_libs; do 8266 for deplib in $dependency_libs; do
8055 case $deplib in 8267 case $deplib in
8056 *.la) 8268 *.la)
8057 func_basename "$deplib" 8269 func_basename "$deplib"
8058 name="$func_basename_result" 8270 name="$func_basename_result"
8059 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 8271 libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8060 test -z "$libdir" && \ 8272 test -z "$libdir" && \
8061 func_fatal_error "\`$deplib' is not a valid libtool archive" 8273 func_fatal_error "\`$deplib' is not a valid libtool archive"
8062 newdependency_libs="$newdependency_libs $libdir/$name" 8274 newdependency_libs="$newdependency_libs $libdir/$name"
8063 ;; 8275 ;;
8064 *) newdependency_libs="$newdependency_libs $deplib" ;; 8276 *) newdependency_libs="$newdependency_libs $deplib" ;;
8070 for lib in $dlfiles; do 8282 for lib in $dlfiles; do
8071 case $lib in 8283 case $lib in
8072 *.la) 8284 *.la)
8073 func_basename "$lib" 8285 func_basename "$lib"
8074 name="$func_basename_result" 8286 name="$func_basename_result"
8075 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 8287 libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8076 test -z "$libdir" && \ 8288 test -z "$libdir" && \
8077 func_fatal_error "\`$lib' is not a valid libtool archive" 8289 func_fatal_error "\`$lib' is not a valid libtool archive"
8078 newdlfiles="$newdlfiles $libdir/$name" 8290 newdlfiles="$newdlfiles $libdir/$name"
8079 ;; 8291 ;;
8080 *) newdlfiles="$newdlfiles $lib" ;; 8292 *) newdlfiles="$newdlfiles $lib" ;;
8089 # eventual linking with the app. that links it) if we 8301 # eventual linking with the app. that links it) if we
8090 # didn't already link the preopened objects directly into 8302 # didn't already link the preopened objects directly into
8091 # the library: 8303 # the library:
8092 func_basename "$lib" 8304 func_basename "$lib"
8093 name="$func_basename_result" 8305 name="$func_basename_result"
8094 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 8306 libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8095 test -z "$libdir" && \ 8307 test -z "$libdir" && \
8096 func_fatal_error "\`$lib' is not a valid libtool archive" 8308 func_fatal_error "\`$lib' is not a valid libtool archive"
8097 newdlprefiles="$newdlprefiles $libdir/$name" 8309 newdlprefiles="$newdlprefiles $libdir/$name"
8098 ;; 8310 ;;
8099 esac 8311 esac
8119 done 8331 done
8120 dlprefiles="$newdlprefiles" 8332 dlprefiles="$newdlprefiles"
8121 fi 8333 fi
8122 $RM $output 8334 $RM $output
8123 # place dlname in correct position for cygwin 8335 # place dlname in correct position for cygwin
8336 # In fact, it would be nice if we could use this code for all target
8337 # systems that can't hard-code library paths into their executables
8338 # and that have no shared library path variable independent of PATH,
8339 # but it turns out we can't easily determine that from inspecting
8340 # libtool variables, so we have to hard-code the OSs to which it
8341 # applies here; at the moment, that means platforms that use the PE
8342 # object format with DLL files. See the long comment at the top of
8343 # tests/bindir.at for full details.
8124 tdlname=$dlname 8344 tdlname=$dlname
8125 case $host,$output,$installed,$module,$dlname in 8345 case $host,$output,$installed,$module,$dlname in
8126 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; 8346 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
8347 # If a -bindir argument was supplied, place the dll there.
8348 if test "x$bindir" != x ;
8349 then
8350 func_relative_path "$install_libdir" "$bindir"
8351 tdlname=$func_relative_path_result$dlname
8352 else
8353 # Otherwise fall back on heuristic.
8354 tdlname=../bin/$dlname
8355 fi
8356 ;;
8127 esac 8357 esac
8128 $ECHO > $output "\ 8358 $ECHO > $output "\
8129 # $outputname - a libtool library file 8359 # $outputname - a libtool library file
8130 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION 8360 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
8131 # 8361 #
8401 # Local Variables: 8631 # Local Variables:
8402 # mode:shell-script 8632 # mode:shell-script
8403 # sh-indentation:2 8633 # sh-indentation:2
8404 # End: 8634 # End:
8405 # vi:sw=2 8635 # vi:sw=2
8636