Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: third_party/libxml/src/ltmain.sh

Issue 1752223002: Roll libxml to 2.9.3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-cherry-pick fprintf formatting fix. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #! /bin/sh
2 ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
3 ## by inline-source v2014-01-03.01
1 4
2 # libtool (GNU libtool) 2.4.2 5 # libtool (GNU libtool) 2.4.6
6 # Provide generalized library-building support services.
3 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 7 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4 8
5 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 9 # Copyright (C) 1996-2015 Free Software Foundation, Inc.
6 # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
7 # This is free software; see the source for copying conditions. There is NO 10 # 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. 11 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9 12
10 # GNU Libtool is free software; you can redistribute it and/or modify 13 # 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 14 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or 15 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version. 16 # (at your option) any later version.
14 # 17 #
15 # As a special exception to the GNU General Public License, 18 # As a special exception to the GNU General Public License,
16 # if you distribute this file as part of a program or library that 19 # if you distribute this file as part of a program or library that
17 # is built using GNU Libtool, you may include this file under the 20 # is built using GNU Libtool, you may include this file under the
18 # same distribution terms that you use for the rest of that program. 21 # same distribution terms that you use for the rest of that program.
19 # 22 #
20 # GNU Libtool is distributed in the hope that it will be useful, but 23 # GNU Libtool is distributed in the hope that it will be useful, but
21 # WITHOUT ANY WARRANTY; without even the implied warranty of 24 # WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 # General Public License for more details. 26 # General Public License for more details.
24 # 27 #
25 # You should have received a copy of the GNU General Public License 28 # You should have received a copy of the GNU General Public License
26 # along with GNU Libtool; see the file COPYING. If not, a copy 29 # along with this program. If not, see <http://www.gnu.org/licenses/>.
27 # can be downloaded from http://www.gnu.org/licenses/gpl.html, 30
28 # or obtained by writing to the Free Software Foundation, Inc.,
29 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30
31 # Usage: $progname [OPTION]... [MODE-ARG]...
32 #
33 # Provide generalized library-building support services.
34 #
35 # --config show all configuration variables
36 # --debug enable verbose shell tracing
37 # -n, --dry-run display commands without modifying any files
38 # --features display basic configuration information and exit
39 # --mode=MODE use operation mode MODE
40 # --preserve-dup-deps don't remove duplicate dependency libraries
41 # --quiet, --silent don't print informational messages
42 # --no-quiet, --no-silent
43 # print informational messages (default)
44 # --no-warn don't display warning messages
45 # --tag=TAG use configuration variables from tag TAG
46 # -v, --verbose print more informational messages than default
47 # --no-verbose don't print the extra informational messages
48 # --version print version information
49 # -h, --help, --help-all print short, long, or detailed help message
50 #
51 # MODE must be one of the following:
52 #
53 # clean remove files from the build directory
54 # compile compile a source file into a libtool object
55 # execute automatically set library path, then run a program
56 # finish complete the installation of libtool libraries
57 # install install libraries or executables
58 # link create a library or an executable
59 # uninstall remove libraries from an installed directory
60 #
61 # MODE-ARGS vary depending on the MODE. When passed as first option,
62 # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
63 # Try `$progname --help --mode=MODE' for a more detailed description of MODE.
64 #
65 # When reporting a bug, please describe a test case to reproduce it and
66 # include the following information:
67 #
68 # host-triplet:»$host
69 # shell:» » $SHELL
70 # compiler:» » $LTCC
71 # compiler flags:» » $LTCFLAGS
72 # linker:» » $LD (gnu? $with_gnu_ld)
73 # $progname:» (GNU libtool) 2.4.2
74 # automake:» $automake_version
75 # autoconf:» $autoconf_version
76 #
77 # Report bugs to <bug-libtool@gnu.org>.
78 # GNU libtool home page: <http://www.gnu.org/software/libtool/>.
79 # General help using GNU software: <http://www.gnu.org/gethelp/>.
80 31
81 PROGRAM=libtool 32 PROGRAM=libtool
82 PACKAGE=libtool 33 PACKAGE=libtool
83 VERSION=2.4.2 34 VERSION=2.4.6
84 TIMESTAMP="" 35 package_revision=2.4.6
85 package_revision=1.3337 36
86 37
87 # Be Bourne compatible 38 ## ------ ##
88 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 39 ## Usage. ##
40 ## ------ ##
41
42 # Run './libtool --help' for help with using this script from the
43 # command line.
44
45
46 ## ------------------------------- ##
47 ## User overridable command paths. ##
48 ## ------------------------------- ##
49
50 # After configure completes, it has a better idea of some of the
51 # shell tools we need than the defaults used by the functions shared
52 # with bootstrap, so set those here where they can still be over-
53 # ridden by the user, but otherwise take precedence.
54
55 : ${AUTOCONF="autoconf"}
56 : ${AUTOMAKE="automake"}
57
58
59 ## -------------------------- ##
60 ## Source external libraries. ##
61 ## -------------------------- ##
62
63 # Much of our low-level functionality needs to be sourced from external
64 # libraries, which are installed to $pkgauxdir.
65
66 # Set a version string for this script.
67 scriptversion=2015-01-20.17; # UTC
68
69 # General shell script boiler plate, and helper functions.
70 # Written by Gary V. Vaughan, 2004
71
72 # Copyright (C) 2004-2015 Free Software Foundation, Inc.
73 # This is free software; see the source for copying conditions. There is NO
74 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
75
76 # This program is free software; you can redistribute it and/or modify
77 # it under the terms of the GNU General Public License as published by
78 # the Free Software Foundation; either version 3 of the License, or
79 # (at your option) any later version.
80
81 # As a special exception to the GNU General Public License, if you distribute
82 # this file as part of a program or library that is built using GNU Libtool,
83 # you may include this file under the same distribution terms that you use
84 # for the rest of that program.
85
86 # This program is distributed in the hope that it will be useful,
87 # but WITHOUT ANY WARRANTY; without even the implied warranty of
88 # MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
89 # General Public License for more details.
90
91 # You should have received a copy of the GNU General Public License
92 # along with this program. If not, see <http://www.gnu.org/licenses/>.
93
94 # Please report bugs or propose patches to gary@gnu.org.
95
96
97 ## ------ ##
98 ## Usage. ##
99 ## ------ ##
100
101 # Evaluate this file near the top of your script to gain access to
102 # the functions and variables defined here:
103 #
104 # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
105 #
106 # If you need to override any of the default environment variable
107 # settings, do that before evaluating this file.
108
109
110 ## -------------------- ##
111 ## Shell normalisation. ##
112 ## -------------------- ##
113
114 # Some shells need a little help to be as Bourne compatible as possible.
115 # Before doing anything else, make sure all that help has been provided!
116
117 DUALCASE=1; export DUALCASE # for MKS sh
118 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
89 emulate sh 119 emulate sh
90 NULLCMD=: 120 NULLCMD=:
91 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which 121 # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
92 # is contrary to our usage. Disable this feature. 122 # is contrary to our usage. Disable this feature.
93 alias -g '${1+"$@"}'='"$@"' 123 alias -g '${1+"$@"}'='"$@"'
94 setopt NO_GLOB_SUBST 124 setopt NO_GLOB_SUBST
95 else 125 else
96 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac 126 case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
97 fi 127 fi
98 BIN_SH=xpg4; export BIN_SH # for Tru64 128
99 DUALCASE=1; export DUALCASE # for MKS sh 129 # NLS nuisances: We save the old values in case they are required later.
100 130 _G_user_locale=
101 # A function that is used when there is no print builtin or printf. 131 _G_safe_locale=
102 func_fallback_echo () 132 for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
103 {
104 eval 'cat <<_LTECHO_EOF
105 $1
106 _LTECHO_EOF'
107 }
108
109 # NLS nuisances: We save the old values to restore during execute mode.
110 lt_user_locale=
111 lt_safe_locale=
112 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
113 do 133 do
114 eval "if test \"\${$lt_var+set}\" = set; then 134 eval "if test set = \"\${$_G_var+set}\"; then
115 save_$lt_var=\$$lt_var 135 save_$_G_var=\$$_G_var
116 $lt_var=C 136 $_G_var=C
117 » export $lt_var 137 » export $_G_var
118 » lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" 138 » _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
119 » lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" 139 » _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
120 fi" 140 fi"
121 done 141 done
122 LC_ALL=C 142
123 LANGUAGE=C 143 # CDPATH.
124 export LANGUAGE LC_ALL 144 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
125 145
126 $lt_unset CDPATH 146 # Make sure IFS has a sensible default
127 147 sp=' '
148 nl='
149 '
150 IFS="$sp» $nl"
151
152 # There are apparently some retarded systems that use ';' as a PATH separator!
153 if test "${PATH_SEPARATOR+set}" != set; then
154 PATH_SEPARATOR=:
155 (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
156 (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
157 PATH_SEPARATOR=';'
158 }
159 fi
160
161
162
163 ## ------------------------- ##
164 ## Locate command utilities. ##
165 ## ------------------------- ##
166
167
168 # func_executable_p FILE
169 # ----------------------
170 # Check that FILE is an executable regular file.
171 func_executable_p ()
172 {
173 test -f "$1" && test -x "$1"
174 }
175
176
177 # func_path_progs PROGS_LIST CHECK_FUNC [PATH]
178 # --------------------------------------------
179 # Search for either a program that responds to --version with output
180 # containing "GNU", or else returned by CHECK_FUNC otherwise, by
181 # trying all the directories in PATH with each of the elements of
182 # PROGS_LIST.
183 #
184 # CHECK_FUNC should accept the path to a candidate program, and
185 # set $func_check_prog_result if it truncates its output less than
186 # $_G_path_prog_max characters.
187 func_path_progs ()
188 {
189 _G_progs_list=$1
190 _G_check_func=$2
191 _G_PATH=${3-"$PATH"}
192
193 _G_path_prog_max=0
194 _G_path_prog_found=false
195 _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
196 for _G_dir in $_G_PATH; do
197 IFS=$_G_save_IFS
198 test -z "$_G_dir" && _G_dir=.
199 for _G_prog_name in $_G_progs_list; do
200 for _exeext in '' .EXE; do
201 _G_path_prog=$_G_dir/$_G_prog_name$_exeext
202 func_executable_p "$_G_path_prog" || continue
203 case `"$_G_path_prog" --version 2>&1` in
204 *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
205 *) $_G_check_func $_G_path_prog
206 » » func_path_progs_result=$func_check_prog_result
207 » » ;;
208 esac
209 $_G_path_prog_found && break 3
210 done
211 done
212 done
213 IFS=$_G_save_IFS
214 test -z "$func_path_progs_result" && {
215 echo "no acceptable sed could be found in \$PATH" >&2
216 exit 1
217 }
218 }
219
220
221 # We want to be able to use the functions in this file before configure
222 # has figured out where the best binaries are kept, which means we have
223 # to search for them ourselves - except when the results are already set
224 # where we skip the searches.
225
226 # Unless the user overrides by setting SED, search the path for either GNU
227 # sed, or the sed that truncates its output the least.
228 test -z "$SED" && {
229 _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbb/
230 for _G_i in 1 2 3 4 5 6 7; do
231 _G_sed_script=$_G_sed_script$nl$_G_sed_script
232 done
233 echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
234 _G_sed_script=
235
236 func_check_prog_sed ()
237 {
238 _G_path_prog=$1
239
240 _G_count=0
241 printf 0123456789 >conftest.in
242 while :
243 do
244 cat conftest.in conftest.in >conftest.tmp
245 mv conftest.tmp conftest.in
246 cp conftest.in conftest.nl
247 echo '' >> conftest.nl
248 "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
249 diff conftest.out conftest.nl >/dev/null 2>&1 || break
250 _G_count=`expr $_G_count + 1`
251 if test "$_G_count" -gt "$_G_path_prog_max"; then
252 # Best one so far, save it but keep looking for a better one
253 func_check_prog_result=$_G_path_prog
254 _G_path_prog_max=$_G_count
255 fi
256 # 10*(2^10) chars as input seems more than enough
257 test 10 -lt "$_G_count" && break
258 done
259 rm -f conftest.in conftest.tmp conftest.nl conftest.out
260 }
261
262 func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
263 rm -f conftest.sed
264 SED=$func_path_progs_result
265 }
266
267
268 # Unless the user overrides by setting GREP, search the path for either GNU
269 # grep, or the grep that truncates its output the least.
270 test -z "$GREP" && {
271 func_check_prog_grep ()
272 {
273 _G_path_prog=$1
274
275 _G_count=0
276 _G_path_prog_max=0
277 printf 0123456789 >conftest.in
278 while :
279 do
280 cat conftest.in conftest.in >conftest.tmp
281 mv conftest.tmp conftest.in
282 cp conftest.in conftest.nl
283 echo 'GREP' >> conftest.nl
284 "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.ou t 2>/dev/null || break
285 diff conftest.out conftest.nl >/dev/null 2>&1 || break
286 _G_count=`expr $_G_count + 1`
287 if test "$_G_count" -gt "$_G_path_prog_max"; then
288 # Best one so far, save it but keep looking for a better one
289 func_check_prog_result=$_G_path_prog
290 _G_path_prog_max=$_G_count
291 fi
292 # 10*(2^10) chars as input seems more than enough
293 test 10 -lt "$_G_count" && break
294 done
295 rm -f conftest.in conftest.tmp conftest.nl conftest.out
296 }
297
298 func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
299 GREP=$func_path_progs_result
300 }
301
302
303 ## ------------------------------- ##
304 ## User overridable command paths. ##
305 ## ------------------------------- ##
306
307 # All uppercase variable names are used for environment variables. These
308 # variables can be overridden by the user before calling a script that
309 # uses them if a suitable command of that name is not already available
310 # in the command search PATH.
311
312 : ${CP="cp -f"}
313 : ${ECHO="printf %s\n"}
314 : ${EGREP="$GREP -E"}
315 : ${FGREP="$GREP -F"}
316 : ${LN_S="ln -s"}
317 : ${MAKE="make"}
318 : ${MKDIR="mkdir"}
319 : ${MV="mv -f"}
320 : ${RM="rm -f"}
321 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
322
323
324 ## -------------------- ##
325 ## Useful sed snippets. ##
326 ## -------------------- ##
327
328 sed_dirname='s|/[^/]*$||'
329 sed_basename='s|^.*/||'
330
331 # Sed substitution that helps us do robust quoting. It backslashifies
332 # metacharacters that are still active within double-quoted strings.
333 sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
334
335 # Same as above, but do not quote variable references.
336 sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
337
338 # Sed substitution that turns a string into a regex matching for the
339 # string literally.
340 sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
341
342 # Sed substitution that converts a w32 file name or path
343 # that contains forward slashes, into one that contains
344 # (escaped) backslashes. A very naive implementation.
345 sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
346
347 # Re-'\' parameter expansions in output of sed_double_quote_subst that
348 # were '\'-ed in input to the same. If an odd number of '\' preceded a
349 # '$' in input to sed_double_quote_subst, that '$' was protected from
350 # expansion. Since each input '\' is now two '\'s, look for any number
351 # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
352 _G_bs='\\'
353 _G_bs2='\\\\'
354 _G_bs4='\\\\\\\\'
355 _G_dollar='\$'
356 sed_double_backslash="\
357 s/$_G_bs4/&\\
358 /g
359 s/^$_G_bs2$_G_dollar/$_G_bs&/
360 s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
361 s/\n//g"
362
363
364 ## ----------------- ##
365 ## Global variables. ##
366 ## ----------------- ##
367
368 # Except for the global variables explicitly listed below, the following
369 # functions in the '^func_' namespace, and the '^require_' namespace
370 # variables initialised in the 'Resource management' section, sourcing
371 # this file will not pollute your global namespace with anything
372 # else. There's no portable way to scope variables in Bourne shell
373 # though, so actually running these functions will sometimes place
374 # results into a variable named after the function, and often use
375 # temporary variables in the '^_G_' namespace. If you are careful to
376 # avoid using those namespaces casually in your sourcing script, things
377 # should continue to work as you expect. And, of course, you can freely
378 # overwrite any of the functions or variables defined here before
379 # calling anything to customize them.
380
381 EXIT_SUCCESS=0
382 EXIT_FAILURE=1
383 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
384 EXIT_SKIP=77» # $? = 77 is used to indicate a skipped test to automake.
385
386 # Allow overriding, eg assuming that you follow the convention of
387 # putting '$debug_cmd' at the start of all your functions, you can get
388 # bash to show function call trace with:
389 #
390 # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
391 debug_cmd=${debug_cmd-":"}
392 exit_cmd=:
393
394 # By convention, finish your script with:
395 #
396 # exit $exit_status
397 #
398 # so that you can set exit_status to non-zero if you want to indicate
399 # something went wrong during execution without actually bailing out at
400 # the point of failure.
401 exit_status=$EXIT_SUCCESS
128 402
129 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh 403 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
130 # is ksh but when the shell is invoked as "sh" and the current value of 404 # is ksh but when the shell is invoked as "sh" and the current value of
131 # the _XPG environment variable is not equal to 1 (one), the special 405 # the _XPG environment variable is not equal to 1 (one), the special
132 # positional parameter $0, within a function call, is the name of the 406 # positional parameter $0, within a function call, is the name of the
133 # function. 407 # function.
134 progpath="$0" 408 progpath=$0
135 409
136 410 # The name of this program.
137 411 progname=`$ECHO "$progpath" |$SED "$sed_basename"`
138 : ${CP="cp -f"} 412
139 test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} 413 # Make sure we have an absolute progpath for reexecution:
140 : ${MAKE="make"} 414 case $progpath in
141 : ${MKDIR="mkdir"} 415 [\\/]*|[A-Za-z]:\\*) ;;
142 : ${MV="mv -f"} 416 *[\\/]*)
143 : ${RM="rm -f"} 417 progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
144 : ${SHELL="${CONFIG_SHELL-/bin/sh}"} 418 progdir=`cd "$progdir" && pwd`
145 : ${Xsed="$SED -e 1s/^X//"} 419 progpath=$progdir/$progname
146 420 ;;
147 # Global variables: 421 *)
148 EXIT_SUCCESS=0 422 _G_IFS=$IFS
149 EXIT_FAILURE=1 423 IFS=${PATH_SEPARATOR-:}
150 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. 424 for progdir in $PATH; do
151 EXIT_SKIP=77» # $? = 77 is used to indicate a skipped test to automake. 425 IFS=$_G_IFS
152 426 test -x "$progdir/$progname" && break
153 exit_status=$EXIT_SUCCESS 427 done
154 428 IFS=$_G_IFS
155 # Make sure IFS has a sensible default 429 test -n "$progdir" || progdir=`pwd`
156 lt_nl=' 430 progpath=$progdir/$progname
157 ' 431 ;;
158 IFS=" » $lt_nl" 432 esac
159 433
160 dirname="s,/[^/]*$,," 434
161 basename="s,^.*/,," 435 ## ----------------- ##
162 436 ## Standard options. ##
163 # func_dirname file append nondir_replacement 437 ## ----------------- ##
438
439 # The following options affect the operation of the functions defined
440 # below, and should be set appropriately depending on run-time para-
441 # meters passed on the command line.
442
443 opt_dry_run=false
444 opt_quiet=false
445 opt_verbose=false
446
447 # Categories 'all' and 'none' are always available. Append any others
448 # you will pass as the first argument to func_warning from your own
449 # code.
450 warning_categories=
451
452 # By default, display warnings according to 'opt_warning_types'. Set
453 # 'warning_func' to ':' to elide all warnings, or func_fatal_error to
454 # treat the next displayed warning as a fatal error.
455 warning_func=func_warn_and_continue
456
457 # Set to 'all' to display all warnings, 'none' to suppress all
458 # warnings, or a space delimited list of some subset of
459 # 'warning_categories' to display only the listed warnings.
460 opt_warning_types=all
461
462
463 ## -------------------- ##
464 ## Resource management. ##
465 ## -------------------- ##
466
467 # This section contains definitions for functions that each ensure a
468 # particular resource (a file, or a non-empty configuration variable for
469 # example) is available, and if appropriate to extract default values
470 # from pertinent package files. Call them using their associated
471 # 'require_*' variable to ensure that they are executed, at most, once.
472 #
473 # It's entirely deliberate that calling these functions can set
474 # variables that don't obey the namespace limitations obeyed by the rest
475 # of this file, in order that that they be as useful as possible to
476 # callers.
477
478
479 # require_term_colors
480 # -------------------
481 # Allow display of bold text on terminals that support it.
482 require_term_colors=func_require_term_colors
483 func_require_term_colors ()
484 {
485 $debug_cmd
486
487 test -t 1 && {
488 # COLORTERM and USE_ANSI_COLORS environment variables take
489 # precedence, because most terminfo databases neglect to describe
490 # whether color sequences are supported.
491 test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
492
493 if test 1 = "$USE_ANSI_COLORS"; then
494 # Standard ANSI escape sequences
495 tc_reset=''
496 tc_bold=''; tc_standout=''
497 tc_red=''; tc_green=''
498 tc_blue=''; tc_cyan=''
499 else
500 # Otherwise trust the terminfo database after all.
501 test -n "`tput sgr0 2>/dev/null`" && {
502 tc_reset=`tput sgr0`
503 test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
504 tc_standout=$tc_bold
505 test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
506 test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
507 test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
508 test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
509 test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
510 }
511 fi
512 }
513
514 require_term_colors=:
515 }
516
517
518 ## ----------------- ##
519 ## Function library. ##
520 ## ----------------- ##
521
522 # This section contains a variety of useful functions to call in your
523 # scripts. Take note of the portable wrappers for features provided by
524 # some modern shells, which will fall back to slower equivalents on
525 # less featureful shells.
526
527
528 # func_append VAR VALUE
529 # ---------------------
530 # Append VALUE onto the existing contents of VAR.
531
532 # We should try to minimise forks, especially on Windows where they are
533 # unreasonably slow, so skip the feature probes when bash or zsh are
534 # being used:
535 if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
536 : ${_G_HAVE_ARITH_OP="yes"}
537 : ${_G_HAVE_XSI_OPS="yes"}
538 # The += operator was introduced in bash 3.1
539 case $BASH_VERSION in
540 [12].* | 3.0 | 3.0*) ;;
541 *)
542 : ${_G_HAVE_PLUSEQ_OP="yes"}
543 ;;
544 esac
545 fi
546
547 # _G_HAVE_PLUSEQ_OP
548 # Can be empty, in which case the shell is probed, "yes" if += is
549 # useable or anything else if it does not work.
550 test -z "$_G_HAVE_PLUSEQ_OP" \
551 && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
552 && _G_HAVE_PLUSEQ_OP=yes
553
554 if test yes = "$_G_HAVE_PLUSEQ_OP"
555 then
556 # This is an XSI compatible shell, allowing a faster implementation...
557 eval 'func_append ()
558 {
559 $debug_cmd
560
561 eval "$1+=\$2"
562 }'
563 else
564 # ...otherwise fall back to using expr, which is often a shell builtin.
565 func_append ()
566 {
567 $debug_cmd
568
569 eval "$1=\$$1\$2"
570 }
571 fi
572
573
574 # func_append_quoted VAR VALUE
575 # ----------------------------
576 # Quote VALUE and append to the end of shell variable VAR, separated
577 # by a space.
578 if test yes = "$_G_HAVE_PLUSEQ_OP"; then
579 eval 'func_append_quoted ()
580 {
581 $debug_cmd
582
583 func_quote_for_eval "$2"
584 eval "$1+=\\ \$func_quote_for_eval_result"
585 }'
586 else
587 func_append_quoted ()
588 {
589 $debug_cmd
590
591 func_quote_for_eval "$2"
592 eval "$1=\$$1\\ \$func_quote_for_eval_result"
593 }
594 fi
595
596
597 # func_append_uniq VAR VALUE
598 # --------------------------
599 # Append unique VALUE onto the existing contents of VAR, assuming
600 # entries are delimited by the first character of VALUE. For example:
601 #
602 # func_append_uniq options " --another-option option-argument"
603 #
604 # will only append to $options if " --another-option option-argument "
605 # is not already present somewhere in $options already (note spaces at
606 # each end implied by leading space in second argument).
607 func_append_uniq ()
608 {
609 $debug_cmd
610
611 eval _G_current_value='`$ECHO $'$1'`'
612 _G_delim=`expr "$2" : '\(.\)'`
613
614 case $_G_delim$_G_current_value$_G_delim in
615 *"$2$_G_delim"*) ;;
616 *) func_append "$@" ;;
617 esac
618 }
619
620
621 # func_arith TERM...
622 # ------------------
623 # Set func_arith_result to the result of evaluating TERMs.
624 test -z "$_G_HAVE_ARITH_OP" \
625 && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
626 && _G_HAVE_ARITH_OP=yes
627
628 if test yes = "$_G_HAVE_ARITH_OP"; then
629 eval 'func_arith ()
630 {
631 $debug_cmd
632
633 func_arith_result=$(( $* ))
634 }'
635 else
636 func_arith ()
637 {
638 $debug_cmd
639
640 func_arith_result=`expr "$@"`
641 }
642 fi
643
644
645 # func_basename FILE
646 # ------------------
647 # Set func_basename_result to FILE with everything up to and including
648 # the last / stripped.
649 if test yes = "$_G_HAVE_XSI_OPS"; then
650 # If this shell supports suffix pattern removal, then use it to avoid
651 # forking. Hide the definitions single quotes in case the shell chokes
652 # on unsupported syntax...
653 _b='func_basename_result=${1##*/}'
654 _d='case $1 in
655 */*) func_dirname_result=${1%/*}$2 ;;
656 * ) func_dirname_result=$3 ;;
657 esac'
658
659 else
660 # ...otherwise fall back to using sed.
661 _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
662 _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
663 if test "X$func_dirname_result" = "X$1"; then
664 func_dirname_result=$3
665 else
666 func_append func_dirname_result "$2"
667 fi'
668 fi
669
670 eval 'func_basename ()
671 {
672 $debug_cmd
673
674 '"$_b"'
675 }'
676
677
678 # func_dirname FILE APPEND NONDIR_REPLACEMENT
679 # -------------------------------------------
164 # Compute the dirname of FILE. If nonempty, add APPEND to the result, 680 # Compute the dirname of FILE. If nonempty, add APPEND to the result,
165 # otherwise set result to NONDIR_REPLACEMENT. 681 # otherwise set result to NONDIR_REPLACEMENT.
166 func_dirname () 682 eval 'func_dirname ()
167 { 683 {
168 func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` 684 $debug_cmd
169 if test "X$func_dirname_result" = "X${1}"; then 685
170 func_dirname_result="${3}" 686 '"$_d"'
171 else 687 }'
172 func_dirname_result="$func_dirname_result${2}" 688
173 fi 689
174 } # func_dirname may be replaced by extended shell implementation 690 # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
175 691 # --------------------------------------------------------
176 692 # Perform func_basename and func_dirname in a single function
177 # func_basename file
178 func_basename ()
179 {
180 func_basename_result=`$ECHO "${1}" | $SED "$basename"`
181 } # func_basename may be replaced by extended shell implementation
182
183
184 # func_dirname_and_basename file append nondir_replacement
185 # perform func_basename and func_dirname in a single function
186 # call: 693 # call:
187 # dirname: Compute the dirname of FILE. If nonempty, 694 # dirname: Compute the dirname of FILE. If nonempty,
188 # add APPEND to the result, otherwise set result 695 # add APPEND to the result, otherwise set result
189 # to NONDIR_REPLACEMENT. 696 # to NONDIR_REPLACEMENT.
190 # value returned in "$func_dirname_result" 697 # value returned in "$func_dirname_result"
191 # basename: Compute filename of FILE. 698 # basename: Compute filename of FILE.
192 # value retuned in "$func_basename_result" 699 # value retuned in "$func_basename_result"
193 # Implementation must be kept synchronized with func_dirname 700 # For efficiency, we do not delegate to the functions above but instead
194 # and func_basename. For efficiency, we do not delegate to 701 # duplicate the functionality here.
195 # those functions but instead duplicate the functionality here. 702 eval 'func_dirname_and_basename ()
196 func_dirname_and_basename () 703 {
197 { 704 $debug_cmd
198 # Extract subdirectory from the argument. 705
199 func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` 706 '"$_b"'
200 if test "X$func_dirname_result" = "X${1}"; then 707 '"$_d"'
201 func_dirname_result="${3}" 708 }'
709
710
711 # func_echo ARG...
712 # ----------------
713 # Echo program name prefixed message.
714 func_echo ()
715 {
716 $debug_cmd
717
718 _G_message=$*
719
720 func_echo_IFS=$IFS
721 IFS=$nl
722 for _G_line in $_G_message; do
723 IFS=$func_echo_IFS
724 $ECHO "$progname: $_G_line"
725 done
726 IFS=$func_echo_IFS
727 }
728
729
730 # func_echo_all ARG...
731 # --------------------
732 # Invoke $ECHO with all args, space-separated.
733 func_echo_all ()
734 {
735 $ECHO "$*"
736 }
737
738
739 # func_echo_infix_1 INFIX ARG...
740 # ------------------------------
741 # Echo program name, followed by INFIX on the first line, with any
742 # additional lines not showing INFIX.
743 func_echo_infix_1 ()
744 {
745 $debug_cmd
746
747 $require_term_colors
748
749 _G_infix=$1; shift
750 _G_indent=$_G_infix
751 _G_prefix="$progname: $_G_infix: "
752 _G_message=$*
753
754 # Strip color escape sequences before counting printable length
755 for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$t c_blue" "$tc_cyan"
756 do
757 test -n "$_G_tc" && {
758 _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
759 _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
760 }
761 done
762 _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude f rom sc_prohibit_nested_quotes
763
764 func_echo_infix_1_IFS=$IFS
765 IFS=$nl
766 for _G_line in $_G_message; do
767 IFS=$func_echo_infix_1_IFS
768 $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
769 _G_prefix=$_G_indent
770 done
771 IFS=$func_echo_infix_1_IFS
772 }
773
774
775 # func_error ARG...
776 # -----------------
777 # Echo program name prefixed message to standard error.
778 func_error ()
779 {
780 $debug_cmd
781
782 $require_term_colors
783
784 func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
785 }
786
787
788 # func_fatal_error ARG...
789 # -----------------------
790 # Echo program name prefixed message to standard error, and exit.
791 func_fatal_error ()
792 {
793 $debug_cmd
794
795 func_error "$*"
796 exit $EXIT_FAILURE
797 }
798
799
800 # func_grep EXPRESSION FILENAME
801 # -----------------------------
802 # Check whether EXPRESSION matches any line of FILENAME, without output.
803 func_grep ()
804 {
805 $debug_cmd
806
807 $GREP "$1" "$2" >/dev/null 2>&1
808 }
809
810
811 # func_len STRING
812 # ---------------
813 # Set func_len_result to the length of STRING. STRING may not
814 # start with a hyphen.
815 test -z "$_G_HAVE_XSI_OPS" \
816 && (eval 'x=a/b/c;
817 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
818 && _G_HAVE_XSI_OPS=yes
819
820 if test yes = "$_G_HAVE_XSI_OPS"; then
821 eval 'func_len ()
822 {
823 $debug_cmd
824
825 func_len_result=${#1}
826 }'
827 else
828 func_len ()
829 {
830 $debug_cmd
831
832 func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
833 }
834 fi
835
836
837 # func_mkdir_p DIRECTORY-PATH
838 # ---------------------------
839 # Make sure the entire path to DIRECTORY-PATH is available.
840 func_mkdir_p ()
841 {
842 $debug_cmd
843
844 _G_directory_path=$1
845 _G_dir_list=
846
847 if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
848
849 # Protect directory names starting with '-'
850 case $_G_directory_path in
851 -*) _G_directory_path=./$_G_directory_path ;;
852 esac
853
854 # While some portion of DIR does not yet exist...
855 while test ! -d "$_G_directory_path"; do
856 # ...make a list in topmost first order. Use a colon delimited
857 » # list incase some portion of path contains whitespace.
858 _G_dir_list=$_G_directory_path:$_G_dir_list
859
860 # If the last portion added has no slash in it, the list is done
861 case $_G_directory_path in */*) ;; *) break ;; esac
862
863 # ...otherwise throw away the child directory and loop
864 _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
865 done
866 _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
867
868 func_mkdir_p_IFS=$IFS; IFS=:
869 for _G_dir in $_G_dir_list; do
870 » IFS=$func_mkdir_p_IFS
871 # mkdir can fail with a 'File exist' error if two processes
872 # try to create one of the directories concurrently. Don't
873 # stop in that case!
874 $MKDIR "$_G_dir" 2>/dev/null || :
875 done
876 IFS=$func_mkdir_p_IFS
877
878 # Bail out if we (or some other process) failed to create a directory.
879 test -d "$_G_directory_path" || \
880 func_fatal_error "Failed to create '$1'"
881 fi
882 }
883
884
885 # func_mktempdir [BASENAME]
886 # -------------------------
887 # Make a temporary directory that won't clash with other running
888 # libtool processes, and avoids race conditions if possible. If
889 # given, BASENAME is the basename for that directory.
890 func_mktempdir ()
891 {
892 $debug_cmd
893
894 _G_template=${TMPDIR-/tmp}/${1-$progname}
895
896 if test : = "$opt_dry_run"; then
897 # Return a directory name, but don't create it in dry-run mode
898 _G_tmpdir=$_G_template-$$
202 else 899 else
203 func_dirname_result="$func_dirname_result${2}" 900
901 # If mktemp works, use that first and foremost
902 _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
903
904 if test ! -d "$_G_tmpdir"; then
905 # Failing that, at least try and use $RANDOM to avoid a race
906 _G_tmpdir=$_G_template-${RANDOM-0}$$
907
908 func_mktempdir_umask=`umask`
909 umask 0077
910 $MKDIR "$_G_tmpdir"
911 umask $func_mktempdir_umask
912 fi
913
914 # If we're not in dry-run mode, bomb out on failure
915 test -d "$_G_tmpdir" || \
916 func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
204 fi 917 fi
205 func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` 918
206 } # func_dirname_and_basename may be replaced by extended shell implementation 919 $ECHO "$_G_tmpdir"
207 920 }
208 921
209 # func_stripname prefix suffix name
210 # strip PREFIX and SUFFIX off of NAME.
211 # PREFIX and SUFFIX must not contain globbing or regex special
212 # characters, hashes, percent signs, but SUFFIX may contain a leading
213 # dot (in which case that matches only a dot).
214 # func_strip_suffix prefix name
215 func_stripname ()
216 {
217 case ${2} in
218 .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%" `;;
219 *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
220 esac
221 } # func_stripname may be replaced by extended shell implementation
222
223
224 # These SED scripts presuppose an absolute path with a trailing slash.
225 pathcar='s,^/\([^/]*\).*$,\1,'
226 pathcdr='s,^/[^/]*,,'
227 removedotparts=':dotsl
228 » » s@/\./@/@g
229 » » t dotsl
230 » » s,/\.$,/,'
231 collapseslashes='s@/\{1,\}@/@g'
232 finalslash='s,/*$,/,'
233 922
234 # func_normal_abspath PATH 923 # func_normal_abspath PATH
924 # ------------------------
235 # Remove doubled-up and trailing slashes, "." path components, 925 # Remove doubled-up and trailing slashes, "." path components,
236 # and cancel out any ".." path components in PATH after making 926 # and cancel out any ".." path components in PATH after making
237 # it an absolute path. 927 # it an absolute path.
238 # value returned in "$func_normal_abspath_result"
239 func_normal_abspath () 928 func_normal_abspath ()
240 { 929 {
241 # Start from root dir and reassemble the path. 930 $debug_cmd
242 func_normal_abspath_result= 931
243 func_normal_abspath_tpath=$1 932 # These SED scripts presuppose an absolute path with a trailing slash.
244 func_normal_abspath_altnamespace= 933 _G_pathcar='s|^/\([^/]*\).*$|\1|'
245 case $func_normal_abspath_tpath in 934 _G_pathcdr='s|^/[^/]*||'
246 "") 935 _G_removedotparts=':dotsl
247 # Empty path, that just means $cwd. 936 » » s|/\./|/|g
248 func_stripname '' '/' "`pwd`" 937 » » t dotsl
249 func_normal_abspath_result=$func_stripname_result 938 » » s|/\.$|/|'
250 return 939 _G_collapseslashes='s|/\{1,\}|/|g'
251 ;; 940 _G_finalslash='s|/*$|/|'
252 # The next three entries are used to spot a run of precisely 941
253 # two leading slashes without using negated character classes; 942 # Start from root dir and reassemble the path.
254 # we take advantage of case's first-match behaviour. 943 func_normal_abspath_result=
255 ///*) 944 func_normal_abspath_tpath=$1
256 # Unusual form of absolute path, do nothing. 945 func_normal_abspath_altnamespace=
257 ;; 946 case $func_normal_abspath_tpath in
258 //*) 947 "")
259 # Not necessarily an ordinary path; POSIX reserves leading '//' 948 # Empty path, that just means $cwd.
260 # and for example Cygwin uses it to access remote file shares 949 func_stripname '' '/' "`pwd`"
261 # over CIFS/SMB, so we conserve a leading double slash if found. 950 func_normal_abspath_result=$func_stripname_result
262 func_normal_abspath_altnamespace=/ 951 return
263 ;; 952 ;;
264 /*) 953 # The next three entries are used to spot a run of precisely
265 # Absolute path, do nothing. 954 # two leading slashes without using negated character classes;
266 ;; 955 # we take advantage of case's first-match behaviour.
267 *) 956 ///*)
268 # Relative path, prepend $cwd. 957 # Unusual form of absolute path, do nothing.
269 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath 958 ;;
270 ;; 959 //*)
271 esac 960 # Not necessarily an ordinary path; POSIX reserves leading '//'
272 # Cancel out all the simple stuff to save iterations. We also want 961 # and for example Cygwin uses it to access remote file shares
273 # the path to end with a slash for ease of parsing, so make sure 962 # over CIFS/SMB, so we conserve a leading double slash if found.
274 # there is one (and only one) here. 963 func_normal_abspath_altnamespace=/
275 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ 964 ;;
276 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` 965 /*)
277 while :; do 966 # Absolute path, do nothing.
278 # Processed it all yet? 967 ;;
279 if test "$func_normal_abspath_tpath" = / ; then 968 *)
280 # If we ascended to the root using ".." the result may be empty now. 969 # Relative path, prepend $cwd.
281 if test -z "$func_normal_abspath_result" ; then 970 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
282 func_normal_abspath_result=/ 971 ;;
283 fi 972 esac
284 break 973
285 fi 974 # Cancel out all the simple stuff to save iterations. We also want
286 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ 975 # the path to end with a slash for ease of parsing, so make sure
287 -e "$pathcar"` 976 # there is one (and only one) here.
288 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ 977 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
289 -e "$pathcdr"` 978 -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
290 # Figure out what to do with it 979 while :; do
291 case $func_normal_abspath_tcomponent in 980 # Processed it all yet?
292 "") 981 if test / = "$func_normal_abspath_tpath"; then
293 # Trailing empty path component, ignore it. 982 # If we ascended to the root using ".." the result may be empty now.
294 ;; 983 if test -z "$func_normal_abspath_result"; then
295 ..) 984 func_normal_abspath_result=/
296 # Parent dir; strip last assembled component from result.
297 func_dirname "$func_normal_abspath_result"
298 func_normal_abspath_result=$func_dirname_result
299 ;;
300 *)
301 # Actual path component, append it.
302 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_absp ath_tcomponent
303 ;;
304 esac
305 done
306 # Restore leading double-slash if one was found on entry.
307 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspa th_result
308 }
309
310 # func_relative_path SRCDIR DSTDIR
311 # generates a relative path from SRCDIR to DSTDIR, with a trailing
312 # slash if non-empty, suitable for immediately appending a filename
313 # without needing to append a separator.
314 # value returned in "$func_relative_path_result"
315 func_relative_path ()
316 {
317 func_relative_path_result=
318 func_normal_abspath "$1"
319 func_relative_path_tlibdir=$func_normal_abspath_result
320 func_normal_abspath "$2"
321 func_relative_path_tbindir=$func_normal_abspath_result
322
323 # Ascend the tree starting from libdir
324 while :; do
325 # check if we have found a prefix of bindir
326 case $func_relative_path_tbindir in
327 $func_relative_path_tlibdir)
328 # found an exact match
329 func_relative_path_tcancelled=
330 break
331 ;;
332 $func_relative_path_tlibdir*)
333 # found a matching prefix
334 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbi ndir"
335 func_relative_path_tcancelled=$func_stripname_result
336 if test -z "$func_relative_path_result"; then
337 func_relative_path_result=.
338 fi 985 fi
339 break 986 break
340 ;; 987 fi
341 *) 988 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
342 func_dirname $func_relative_path_tlibdir 989 -e "$_G_pathcar"`
343 func_relative_path_tlibdir=${func_dirname_result} 990 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
344 if test "x$func_relative_path_tlibdir" = x ; then 991 -e "$_G_pathcdr"`
345 # Have to descend all the way to the root! 992 # Figure out what to do with it
346 func_relative_path_result=../$func_relative_path_result 993 case $func_normal_abspath_tcomponent in
347 func_relative_path_tcancelled=$func_relative_path_tbindir 994 "")
348 break 995 # Trailing empty path component, ignore it.
349 fi 996 ;;
350 func_relative_path_result=../$func_relative_path_result 997 ..)
351 ;; 998 # Parent dir; strip last assembled component from result.
352 esac 999 func_dirname "$func_normal_abspath_result"
353 done 1000 func_normal_abspath_result=$func_dirname_result
354 1001 ;;
355 # Now calculate path; take care to avoid doubling-up slashes. 1002 *)
356 func_stripname '' '/' "$func_relative_path_result" 1003 # Actual path component, append it.
357 func_relative_path_result=$func_stripname_result 1004 func_append func_normal_abspath_result "/$func_normal_abspath_tcompone nt"
358 func_stripname '/' '/' "$func_relative_path_tcancelled" 1005 ;;
359 if test "x$func_stripname_result" != x ; then 1006 esac
360 func_relative_path_result=${func_relative_path_result}/${func_stripname_resu lt} 1007 done
361 fi 1008 # Restore leading double-slash if one was found on entry.
362 1009 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abs path_result
363 # Normalisation. If bindir is libdir, return empty string, 1010 }
364 # else relative path ending with a slash; either way, target 1011
365 # file name can be directly appended. 1012
366 if test ! -z "$func_relative_path_result"; then 1013 # func_notquiet ARG...
367 func_stripname './' '' "$func_relative_path_result/" 1014 # --------------------
368 func_relative_path_result=$func_stripname_result 1015 # Echo program name prefixed message only when not in quiet mode.
369 fi 1016 func_notquiet ()
370 } 1017 {
371 1018 $debug_cmd
372 # The name of this program: 1019
373 func_dirname_and_basename "$progpath" 1020 $opt_quiet || func_echo ${1+"$@"}
374 progname=$func_basename_result
375
376 # Make sure we have an absolute path for reexecution:
377 case $progpath in
378 [\\/]*|[A-Za-z]:\\*) ;;
379 *[\\/]*)
380 progdir=$func_dirname_result
381 progdir=`cd "$progdir" && pwd`
382 progpath="$progdir/$progname"
383 ;;
384 *)
385 save_IFS="$IFS"
386 IFS=${PATH_SEPARATOR-:}
387 for progdir in $PATH; do
388 IFS="$save_IFS"
389 test -x "$progdir/$progname" && break
390 done
391 IFS="$save_IFS"
392 test -n "$progdir" || progdir=`pwd`
393 progpath="$progdir/$progname"
394 ;;
395 esac
396
397 # Sed substitution that helps us do robust quoting. It backslashifies
398 # metacharacters that are still active within double-quoted strings.
399 Xsed="${SED}"' -e 1s/^X//'
400 sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
401
402 # Same as above, but do not quote variable references.
403 double_quote_subst='s/\(["`\\]\)/\\\1/g'
404
405 # Sed substitution that turns a string into a regex matching for the
406 # string literally.
407 sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
408
409 # Sed substitution that converts a w32 file name or path
410 # which contains forward slashes, into one that contains
411 # (escaped) backslashes. A very naive implementation.
412 lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
413
414 # Re-`\' parameter expansions in output of double_quote_subst that were
415 # `\'-ed in input to the same. If an odd number of `\' preceded a '$'
416 # in input to double_quote_subst, that '$' was protected from expansion.
417 # Since each input `\' is now two `\'s, look for any number of runs of
418 # four `\'s followed by two `\'s and then a '$'. `\' that '$'.
419 bs='\\'
420 bs2='\\\\'
421 bs4='\\\\\\\\'
422 dollar='\$'
423 sed_double_backslash="\
424 s/$bs4/&\\
425 /g
426 s/^$bs2$dollar/$bs&/
427 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
428 s/\n//g"
429
430 # Standard options:
431 opt_dry_run=false
432 opt_help=false
433 opt_quiet=false
434 opt_verbose=false
435 opt_warning=:
436
437 # func_echo arg...
438 # Echo program name prefixed message, along with the current mode
439 # name if it has been set yet.
440 func_echo ()
441 {
442 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
443 }
444
445 # func_verbose arg...
446 # Echo program name prefixed message in verbose mode only.
447 func_verbose ()
448 {
449 $opt_verbose && func_echo ${1+"$@"}
450 1021
451 # A bug in bash halts the script if the last line of a function 1022 # A bug in bash halts the script if the last line of a function
452 # fails when set -e is in force, so we need another command to 1023 # fails when set -e is in force, so we need another command to
453 # work around that: 1024 # work around that:
454 : 1025 :
455 } 1026 }
456 1027
457 # func_echo_all arg... 1028
458 # Invoke $ECHO with all args, space-separated. 1029 # func_relative_path SRCDIR DSTDIR
459 func_echo_all () 1030 # --------------------------------
460 { 1031 # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
461 $ECHO "$*" 1032 func_relative_path ()
462 } 1033 {
463 1034 $debug_cmd
464 # func_error arg... 1035
465 # Echo program name prefixed message to standard error. 1036 func_relative_path_result=
466 func_error () 1037 func_normal_abspath "$1"
467 { 1038 func_relative_path_tlibdir=$func_normal_abspath_result
468 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 1039 func_normal_abspath "$2"
469 } 1040 func_relative_path_tbindir=$func_normal_abspath_result
470 1041
471 # func_warning arg... 1042 # Ascend the tree starting from libdir
472 # Echo program name prefixed warning message to standard error. 1043 while :; do
473 func_warning () 1044 # check if we have found a prefix of bindir
474 { 1045 case $func_relative_path_tbindir in
475 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 1046 $func_relative_path_tlibdir)
476 1047 # found an exact match
477 # bash bug again: 1048 func_relative_path_tcancelled=
1049 break
1050 ;;
1051 $func_relative_path_tlibdir*)
1052 # found a matching prefix
1053 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_t bindir"
1054 func_relative_path_tcancelled=$func_stripname_result
1055 if test -z "$func_relative_path_result"; then
1056 func_relative_path_result=.
1057 fi
1058 break
1059 ;;
1060 *)
1061 func_dirname $func_relative_path_tlibdir
1062 func_relative_path_tlibdir=$func_dirname_result
1063 if test -z "$func_relative_path_tlibdir"; then
1064 # Have to descend all the way to the root!
1065 func_relative_path_result=../$func_relative_path_result
1066 func_relative_path_tcancelled=$func_relative_path_tbindir
1067 break
1068 fi
1069 func_relative_path_result=../$func_relative_path_result
1070 ;;
1071 esac
1072 done
1073
1074 # Now calculate path; take care to avoid doubling-up slashes.
1075 func_stripname '' '/' "$func_relative_path_result"
1076 func_relative_path_result=$func_stripname_result
1077 func_stripname '/' '/' "$func_relative_path_tcancelled"
1078 if test -n "$func_stripname_result"; then
1079 func_append func_relative_path_result "/$func_stripname_result"
1080 fi
1081
1082 # Normalisation. If bindir is libdir, return '.' else relative path.
1083 if test -n "$func_relative_path_result"; then
1084 func_stripname './' '' "$func_relative_path_result"
1085 func_relative_path_result=$func_stripname_result
1086 fi
1087
1088 test -n "$func_relative_path_result" || func_relative_path_result=.
1089
478 : 1090 :
479 } 1091 }
480 1092
481 # func_fatal_error arg... 1093
482 # Echo program name prefixed message to standard error, and exit. 1094 # func_quote_for_eval ARG...
483 func_fatal_error () 1095 # --------------------------
484 { 1096 # Aesthetically quote ARGs to be evaled later.
485 func_error ${1+"$@"} 1097 # This function returns two values:
486 exit $EXIT_FAILURE 1098 # i) func_quote_for_eval_result
487 } 1099 # double-quoted, suitable for a subsequent eval
488 1100 # ii) func_quote_for_eval_unquoted_result
489 # func_fatal_help arg... 1101 # has all characters that are still active within double
490 # Echo program name prefixed message to standard error, followed by 1102 # quotes backslashified.
491 # a help hint, and exit. 1103 func_quote_for_eval ()
492 func_fatal_help () 1104 {
493 { 1105 $debug_cmd
494 func_error ${1+"$@"} 1106
495 func_fatal_error "$help" 1107 func_quote_for_eval_unquoted_result=
496 } 1108 func_quote_for_eval_result=
497 help="Try \`$progname --help' for more information." ## default 1109 while test 0 -lt $#; do
498 1110 case $1 in
499 1111 *[\\\`\"\$]*)
500 # func_grep expression filename 1112 » _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
501 # Check whether EXPRESSION matches any line of FILENAME, without output. 1113 *)
502 func_grep () 1114 _G_unquoted_arg=$1 ;;
503 {
504 $GREP "$1" "$2" >/dev/null 2>&1
505 }
506
507
508 # func_mkdir_p directory-path
509 # Make sure the entire path to DIRECTORY-PATH is available.
510 func_mkdir_p ()
511 {
512 my_directory_path="$1"
513 my_dir_list=
514
515 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
516
517 # Protect directory names starting with `-'
518 case $my_directory_path in
519 -*) my_directory_path="./$my_directory_path" ;;
520 esac 1115 esac
521 1116 if test -n "$func_quote_for_eval_unquoted_result"; then
522 # While some portion of DIR does not yet exist... 1117 » func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
523 while test ! -d "$my_directory_path"; do 1118 else
524 # ...make a list in topmost first order. Use a colon delimited 1119 func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
525 » # list incase some portion of path contains whitespace.
526 my_dir_list="$my_directory_path:$my_dir_list"
527
528 # If the last portion added has no slash in it, the list is done
529 case $my_directory_path in */*) ;; *) break ;; esac
530
531 # ...otherwise throw away the child directory and loop
532 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
533 done
534 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
535
536 save_mkdir_p_IFS="$IFS"; IFS=':'
537 for my_dir in $my_dir_list; do
538 » IFS="$save_mkdir_p_IFS"
539 # mkdir can fail with a `File exist' error if two processes
540 # try to create one of the directories concurrently. Don't
541 # stop in that case!
542 $MKDIR "$my_dir" 2>/dev/null || :
543 done
544 IFS="$save_mkdir_p_IFS"
545
546 # Bail out if we (or some other process) failed to create a directory.
547 test -d "$my_directory_path" || \
548 func_fatal_error "Failed to create \`$1'"
549 fi
550 }
551
552
553 # func_mktempdir [string]
554 # Make a temporary directory that won't clash with other running
555 # libtool processes, and avoids race conditions if possible. If
556 # given, STRING is the basename for that directory.
557 func_mktempdir ()
558 {
559 my_template="${TMPDIR-/tmp}/${1-$progname}"
560
561 if test "$opt_dry_run" = ":"; then
562 # Return a directory name, but don't create it in dry-run mode
563 my_tmpdir="${my_template}-$$"
564 else
565
566 # If mktemp works, use that first and foremost
567 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
568
569 if test ! -d "$my_tmpdir"; then
570 # Failing that, at least try and use $RANDOM to avoid a race
571 my_tmpdir="${my_template}-${RANDOM-0}$$"
572
573 save_mktempdir_umask=`umask`
574 umask 0077
575 $MKDIR "$my_tmpdir"
576 umask $save_mktempdir_umask
577 fi 1120 fi
578 1121
579 # If we're not in dry-run mode, bomb out on failure 1122 case $_G_unquoted_arg in
580 test -d "$my_tmpdir" || \ 1123 # Double-quote args containing shell metacharacters to delay
581 func_fatal_error "cannot create temporary directory \`$my_tmpdir'" 1124 # word splitting, command substitution and variable expansion
582 fi 1125 # for a subsequent eval.
583 1126 # Many Bourne shells cannot handle close brackets correctly
584 $ECHO "$my_tmpdir" 1127 # in scan sets, so we specify it separately.
585 } 1128 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \» ]*|*]*|"")
586 1129 _G_quoted_arg=\"$_G_unquoted_arg\"
587 1130 ;;
588 # func_quote_for_eval arg 1131 *)
589 # Aesthetically quote ARG to be evaled later. 1132 _G_quoted_arg=$_G_unquoted_arg
590 # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT 1133 » ;;
591 # is double-quoted, suitable for a subsequent eval, whereas 1134 esac
592 # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters 1135
593 # which are still active within double quotes backslashified. 1136 if test -n "$func_quote_for_eval_result"; then
594 func_quote_for_eval () 1137 » func_append func_quote_for_eval_result " $_G_quoted_arg"
595 { 1138 else
596 case $1 in 1139 func_append func_quote_for_eval_result "$_G_quoted_arg"
597 *[\\\`\"\$]*) 1140 fi
598 » func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst "` ;; 1141 shift
599 *) 1142 done
600 func_quote_for_eval_unquoted_result="$1" ;; 1143 }
601 esac 1144
602 1145
603 case $func_quote_for_eval_unquoted_result in 1146 # func_quote_for_expand ARG
604 # Double-quote args containing shell metacharacters to delay 1147 # -------------------------
605 # word splitting, command substitution and and variable
606 # expansion for a subsequent eval.
607 # Many Bourne shells cannot handle close brackets correctly
608 # in scan sets, so we specify it separately.
609 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \» ]*|*]*|"")
610 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
611 ;;
612 *)
613 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
614 esac
615 }
616
617
618 # func_quote_for_expand arg
619 # Aesthetically quote ARG to be evaled later; same as above, 1148 # Aesthetically quote ARG to be evaled later; same as above,
620 # but do not quote variable references. 1149 # but do not quote variable references.
621 func_quote_for_expand () 1150 func_quote_for_expand ()
622 { 1151 {
1152 $debug_cmd
1153
623 case $1 in 1154 case $1 in
624 *[\\\`\"]*) 1155 *[\\\`\"]*)
625 » my_arg=`$ECHO "$1" | $SED \ 1156 » _G_arg=`$ECHO "$1" | $SED \
626 » -e "$double_quote_subst" -e "$sed_double_backslash"` ;; 1157 » -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
627 *) 1158 *)
628 my_arg="$1" ;; 1159 _G_arg=$1 ;;
629 esac 1160 esac
630 1161
631 case $my_arg in 1162 case $_G_arg in
632 # Double-quote args containing shell metacharacters to delay 1163 # Double-quote args containing shell metacharacters to delay
633 # word splitting and command substitution for a subsequent eval. 1164 # word splitting and command substitution for a subsequent eval.
634 # Many Bourne shells cannot handle close brackets correctly 1165 # Many Bourne shells cannot handle close brackets correctly
635 # in scan sets, so we specify it separately. 1166 # in scan sets, so we specify it separately.
636 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") 1167 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
637 my_arg="\"$my_arg\"" 1168 _G_arg=\"$_G_arg\"
638 ;; 1169 ;;
639 esac 1170 esac
640 1171
641 func_quote_for_expand_result="$my_arg" 1172 func_quote_for_expand_result=$_G_arg
642 } 1173 }
643 1174
644 1175
645 # func_show_eval cmd [fail_exp] 1176 # func_stripname PREFIX SUFFIX NAME
646 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is 1177 # ---------------------------------
1178 # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
1179 # PREFIX and SUFFIX must not contain globbing or regex special
1180 # characters, hashes, percent signs, but SUFFIX may contain a leading
1181 # dot (in which case that matches only a dot).
1182 if test yes = "$_G_HAVE_XSI_OPS"; then
1183 eval 'func_stripname ()
1184 {
1185 $debug_cmd
1186
1187 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
1188 # positional parameters, so assign one to ordinary variable first.
1189 func_stripname_result=$3
1190 func_stripname_result=${func_stripname_result#"$1"}
1191 func_stripname_result=${func_stripname_result%"$2"}
1192 }'
1193 else
1194 func_stripname ()
1195 {
1196 $debug_cmd
1197
1198 case $2 in
1199 .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%% "`;;
1200 *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
1201 esac
1202 }
1203 fi
1204
1205
1206 # func_show_eval CMD [FAIL_EXP]
1207 # -----------------------------
1208 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
647 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP 1209 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
648 # is given, then evaluate it. 1210 # is given, then evaluate it.
649 func_show_eval () 1211 func_show_eval ()
650 { 1212 {
651 my_cmd="$1" 1213 $debug_cmd
652 my_fail_exp="${2-:}" 1214
653 1215 _G_cmd=$1
654 ${opt_silent-false} || { 1216 _G_fail_exp=${2-':'}
655 func_quote_for_expand "$my_cmd" 1217
656 eval "func_echo $func_quote_for_expand_result" 1218 func_quote_for_expand "$_G_cmd"
1219 eval "func_notquiet $func_quote_for_expand_result"
1220
1221 $opt_dry_run || {
1222 eval "$_G_cmd"
1223 _G_status=$?
1224 if test 0 -ne "$_G_status"; then
1225 » eval "(exit $_G_status); $_G_fail_exp"
1226 fi
657 } 1227 }
658 1228 }
659 if ${opt_dry_run-false}; then :; else 1229
660 eval "$my_cmd" 1230
661 my_status=$? 1231 # func_show_eval_locale CMD [FAIL_EXP]
662 if test "$my_status" -eq 0; then :; else 1232 # ------------------------------------
663 » eval "(exit $my_status); $my_fail_exp" 1233 # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
664 fi
665 fi
666 }
667
668
669 # func_show_eval_locale cmd [fail_exp]
670 # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
671 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP 1234 # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
672 # is given, then evaluate it. Use the saved locale for evaluation. 1235 # is given, then evaluate it. Use the saved locale for evaluation.
673 func_show_eval_locale () 1236 func_show_eval_locale ()
674 { 1237 {
675 my_cmd="$1" 1238 $debug_cmd
676 my_fail_exp="${2-:}" 1239
677 1240 _G_cmd=$1
678 ${opt_silent-false} || { 1241 _G_fail_exp=${2-':'}
679 func_quote_for_expand "$my_cmd" 1242
1243 $opt_quiet || {
1244 func_quote_for_expand "$_G_cmd"
680 eval "func_echo $func_quote_for_expand_result" 1245 eval "func_echo $func_quote_for_expand_result"
681 } 1246 }
682 1247
683 if ${opt_dry_run-false}; then :; else 1248 $opt_dry_run || {
684 eval "$lt_user_locale 1249 eval "$_G_user_locale
685 » $my_cmd" 1250 » $_G_cmd"
686 my_status=$? 1251 _G_status=$?
687 eval "$lt_safe_locale" 1252 eval "$_G_safe_locale"
688 if test "$my_status" -eq 0; then :; else 1253 if test 0 -ne "$_G_status"; then
689 » eval "(exit $my_status); $my_fail_exp" 1254 » eval "(exit $_G_status); $_G_fail_exp"
690 fi 1255 fi
691 fi 1256 }
692 } 1257 }
1258
693 1259
694 # func_tr_sh 1260 # func_tr_sh
1261 # ----------
695 # Turn $1 into a string suitable for a shell variable name. 1262 # Turn $1 into a string suitable for a shell variable name.
696 # Result is stored in $func_tr_sh_result. All characters 1263 # Result is stored in $func_tr_sh_result. All characters
697 # not in the set a-zA-Z0-9_ are replaced with '_'. Further, 1264 # not in the set a-zA-Z0-9_ are replaced with '_'. Further,
698 # if $1 begins with a digit, a '_' is prepended as well. 1265 # if $1 begins with a digit, a '_' is prepended as well.
699 func_tr_sh () 1266 func_tr_sh ()
700 { 1267 {
701 case $1 in 1268 $debug_cmd
702 [0-9]* | *[!a-zA-Z0-9_]*) 1269
703 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g '` 1270 case $1 in
704 ;; 1271 [0-9]* | *[!a-zA-Z0-9_]*)
705 * ) 1272 func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z 0-9_]/_/g'`
706 func_tr_sh_result=$1 1273 ;;
707 ;; 1274 * )
708 esac 1275 func_tr_sh_result=$1
709 } 1276 ;;
710 1277 esac
711 1278 }
712 # func_version 1279
713 # Echo version message to standard output and exit. 1280
714 func_version () 1281 # func_verbose ARG...
715 { 1282 # -------------------
716 $opt_debug 1283 # Echo program name prefixed message in verbose mode only.
717 1284 func_verbose ()
718 $SED -n '/(C)/!b go 1285 {
719 :more 1286 $debug_cmd
720 /\./!{ 1287
721 N 1288 $opt_verbose && func_echo "$*"
722 s/\n# / / 1289
723 b more 1290 :
724 } 1291 }
725 :go 1292
726 /^# '$PROGRAM' (GNU /,/# warranty; / { 1293
727 s/^# // 1294 # func_warn_and_continue ARG...
728 s/^# *$// 1295 # -----------------------------
729 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ 1296 # Echo program name prefixed warning message to standard error.
730 p 1297 func_warn_and_continue ()
731 }' < "$progpath" 1298 {
732 exit $? 1299 $debug_cmd
733 } 1300
734 1301 $require_term_colors
735 # func_usage 1302
736 # Echo short help message to standard output and exit. 1303 func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
737 func_usage () 1304 }
738 { 1305
739 $opt_debug 1306
740 1307 # func_warning CATEGORY ARG...
741 $SED -n '/^# Usage:/,/^# *.*--help/ { 1308 # ----------------------------
742 s/^# // 1309 # Echo program name prefixed warning message to standard error. Warning
743 s/^# *$// 1310 # messages can be filtered according to CATEGORY, where this function
744 s/\$progname/'$progname'/ 1311 # elides messages where CATEGORY is not listed in the global variable
745 p 1312 # 'opt_warning_types'.
746 }' < "$progpath" 1313 func_warning ()
747 echo 1314 {
748 $ECHO "run \`$progname --help | more' for full usage" 1315 $debug_cmd
749 exit $? 1316
750 } 1317 # CATEGORY must be in the warning_categories list!
751 1318 case " $warning_categories " in
752 # func_help [NOEXIT] 1319 *" $1 "*) ;;
753 # Echo long help message to standard output and exit, 1320 *) func_internal_error "invalid warning category '$1'" ;;
754 # unless 'noexit' is passed as argument. 1321 esac
1322
1323 _G_category=$1
1324 shift
1325
1326 case " $opt_warning_types " in
1327 *" $_G_category "*) $warning_func ${1+"$@"} ;;
1328 esac
1329 }
1330
1331
1332 # func_sort_ver VER1 VER2
1333 # -----------------------
1334 # 'sort -V' is not generally available.
1335 # Note this deviates from the version comparison in automake
1336 # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
1337 # but this should suffice as we won't be specifying old
1338 # version formats or redundant trailing .0 in bootstrap.conf.
1339 # If we did want full compatibility then we should probably
1340 # use m4_version_compare from autoconf.
1341 func_sort_ver ()
1342 {
1343 $debug_cmd
1344
1345 printf '%s\n%s\n' "$1" "$2" \
1346 | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
1347 }
1348
1349 # func_lt_ver PREV CURR
1350 # ---------------------
1351 # Return true if PREV and CURR are in the correct order according to
1352 # func_sort_ver, otherwise false. Use it like this:
1353 #
1354 # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
1355 func_lt_ver ()
1356 {
1357 $debug_cmd
1358
1359 test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
1360 }
1361
1362
1363 # Local variables:
1364 # mode: shell-script
1365 # sh-indentation: 2
1366 # eval: (add-hook 'before-save-hook 'time-stamp)
1367 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1368 # time-stamp-time-zone: "UTC"
1369 # End:
1370 #! /bin/sh
1371
1372 # Set a version string for this script.
1373 scriptversion=2014-01-07.03; # UTC
1374
1375 # A portable, pluggable option parser for Bourne shell.
1376 # Written by Gary V. Vaughan, 2010
1377
1378 # Copyright (C) 2010-2015 Free Software Foundation, Inc.
1379 # This is free software; see the source for copying conditions. There is NO
1380 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1381
1382 # This program is free software: you can redistribute it and/or modify
1383 # it under the terms of the GNU General Public License as published by
1384 # the Free Software Foundation, either version 3 of the License, or
1385 # (at your option) any later version.
1386
1387 # This program is distributed in the hope that it will be useful,
1388 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1389 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1390 # GNU General Public License for more details.
1391
1392 # You should have received a copy of the GNU General Public License
1393 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1394
1395 # Please report bugs or propose patches to gary@gnu.org.
1396
1397
1398 ## ------ ##
1399 ## Usage. ##
1400 ## ------ ##
1401
1402 # This file is a library for parsing options in your shell scripts along
1403 # with assorted other useful supporting features that you can make use
1404 # of too.
1405 #
1406 # For the simplest scripts you might need only:
1407 #
1408 # #!/bin/sh
1409 # . relative/path/to/funclib.sh
1410 # . relative/path/to/options-parser
1411 # scriptversion=1.0
1412 # func_options ${1+"$@"}
1413 # eval set dummy "$func_options_result"; shift
1414 # ...rest of your script...
1415 #
1416 # In order for the '--version' option to work, you will need to have a
1417 # suitably formatted comment like the one at the top of this file
1418 # starting with '# Written by ' and ending with '# warranty; '.
1419 #
1420 # For '-h' and '--help' to work, you will also need a one line
1421 # description of your script's purpose in a comment directly above the
1422 # '# Written by ' line, like the one at the top of this file.
1423 #
1424 # The default options also support '--debug', which will turn on shell
1425 # execution tracing (see the comment above debug_cmd below for another
1426 # use), and '--verbose' and the func_verbose function to allow your script
1427 # to display verbose messages only when your user has specified
1428 # '--verbose'.
1429 #
1430 # After sourcing this file, you can plug processing for additional
1431 # options by amending the variables from the 'Configuration' section
1432 # below, and following the instructions in the 'Option parsing'
1433 # section further down.
1434
1435 ## -------------- ##
1436 ## Configuration. ##
1437 ## -------------- ##
1438
1439 # You should override these variables in your script after sourcing this
1440 # file so that they reflect the customisations you have added to the
1441 # option parser.
1442
1443 # The usage line for option parsing errors and the start of '-h' and
1444 # '--help' output messages. You can embed shell variables for delayed
1445 # expansion at the time the message is displayed, but you will need to
1446 # quote other shell meta-characters carefully to prevent them being
1447 # expanded when the contents are evaled.
1448 usage='$progpath [OPTION]...'
1449
1450 # Short help message in response to '-h' and '--help'. Add to this or
1451 # override it after sourcing this library to reflect the full set of
1452 # options your script accepts.
1453 usage_message="\
1454 --debug enable verbose shell tracing
1455 -W, --warnings=CATEGORY
1456 report the warnings falling in CATEGORY [all]
1457 -v, --verbose verbosely report processing
1458 --version print version information and exit
1459 -h, --help print short or long help message and exit
1460 "
1461
1462 # Additional text appended to 'usage_message' in response to '--help'.
1463 long_help_message="
1464 Warning categories include:
1465 'all' show all warnings
1466 'none' turn off all the warnings
1467 'error' warnings are treated as fatal errors"
1468
1469 # Help message printed before fatal option parsing errors.
1470 fatal_help="Try '\$progname --help' for more information."
1471
1472
1473
1474 ## ------------------------- ##
1475 ## Hook function management. ##
1476 ## ------------------------- ##
1477
1478 # This section contains functions for adding, removing, and running hooks
1479 # to the main code. A hook is just a named list of of function, that can
1480 # be run in order later on.
1481
1482 # func_hookable FUNC_NAME
1483 # -----------------------
1484 # Declare that FUNC_NAME will run hooks added with
1485 # 'func_add_hook FUNC_NAME ...'.
1486 func_hookable ()
1487 {
1488 $debug_cmd
1489
1490 func_append hookable_fns " $1"
1491 }
1492
1493
1494 # func_add_hook FUNC_NAME HOOK_FUNC
1495 # ---------------------------------
1496 # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
1497 # first have been declared "hookable" by a call to 'func_hookable'.
1498 func_add_hook ()
1499 {
1500 $debug_cmd
1501
1502 case " $hookable_fns " in
1503 *" $1 "*) ;;
1504 *) func_fatal_error "'$1' does not accept hook functions." ;;
1505 esac
1506
1507 eval func_append ${1}_hooks '" $2"'
1508 }
1509
1510
1511 # func_remove_hook FUNC_NAME HOOK_FUNC
1512 # ------------------------------------
1513 # Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
1514 func_remove_hook ()
1515 {
1516 $debug_cmd
1517
1518 eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
1519 }
1520
1521
1522 # func_run_hooks FUNC_NAME [ARG]...
1523 # ---------------------------------
1524 # Run all hook functions registered to FUNC_NAME.
1525 # It is assumed that the list of hook functions contains nothing more
1526 # than a whitespace-delimited list of legal shell function names, and
1527 # no effort is wasted trying to catch shell meta-characters or preserve
1528 # whitespace.
1529 func_run_hooks ()
1530 {
1531 $debug_cmd
1532
1533 case " $hookable_fns " in
1534 *" $1 "*) ;;
1535 *) func_fatal_error "'$1' does not support hook funcions.n" ;;
1536 esac
1537
1538 eval _G_hook_fns=\$$1_hooks; shift
1539
1540 for _G_hook in $_G_hook_fns; do
1541 eval $_G_hook '"$@"'
1542
1543 # store returned options list back into positional
1544 # parameters for next 'cmd' execution.
1545 eval _G_hook_result=\$${_G_hook}_result
1546 eval set dummy "$_G_hook_result"; shift
1547 done
1548
1549 func_quote_for_eval ${1+"$@"}
1550 func_run_hooks_result=$func_quote_for_eval_result
1551 }
1552
1553
1554
1555 ## --------------- ##
1556 ## Option parsing. ##
1557 ## --------------- ##
1558
1559 # In order to add your own option parsing hooks, you must accept the
1560 # full positional parameter list in your hook function, remove any
1561 # options that you action, and then pass back the remaining unprocessed
1562 # options in '<hooked_function_name>_result', escaped suitably for
1563 # 'eval'. Like this:
1564 #
1565 # my_options_prep ()
1566 # {
1567 # $debug_cmd
1568 #
1569 # # Extend the existing usage message.
1570 # usage_message=$usage_message'
1571 # -s, --silent don'\''t print informational messages
1572 # '
1573 #
1574 # func_quote_for_eval ${1+"$@"}
1575 # my_options_prep_result=$func_quote_for_eval_result
1576 # }
1577 # func_add_hook func_options_prep my_options_prep
1578 #
1579 #
1580 # my_silent_option ()
1581 # {
1582 # $debug_cmd
1583 #
1584 # # Note that for efficiency, we parse as many options as we can
1585 # # recognise in a loop before passing the remainder back to the
1586 # # caller on the first unrecognised argument we encounter.
1587 # while test $# -gt 0; do
1588 # opt=$1; shift
1589 # case $opt in
1590 # --silent|-s) opt_silent=: ;;
1591 # # Separate non-argument short options:
1592 # -s*) func_split_short_opt "$_G_opt"
1593 # set dummy "$func_split_short_opt_name" \
1594 # "-$func_split_short_opt_arg" ${1+"$@"}
1595 # shift
1596 # ;;
1597 # *) set dummy "$_G_opt" "$*"; shift; break ;;
1598 # esac
1599 # done
1600 #
1601 # func_quote_for_eval ${1+"$@"}
1602 # my_silent_option_result=$func_quote_for_eval_result
1603 # }
1604 # func_add_hook func_parse_options my_silent_option
1605 #
1606 #
1607 # my_option_validation ()
1608 # {
1609 # $debug_cmd
1610 #
1611 # $opt_silent && $opt_verbose && func_fatal_help "\
1612 # '--silent' and '--verbose' options are mutually exclusive."
1613 #
1614 # func_quote_for_eval ${1+"$@"}
1615 # my_option_validation_result=$func_quote_for_eval_result
1616 # }
1617 # func_add_hook func_validate_options my_option_validation
1618 #
1619 # You'll alse need to manually amend $usage_message to reflect the extra
1620 # options you parse. It's preferable to append if you can, so that
1621 # multiple option parsing hooks can be added safely.
1622
1623
1624 # func_options [ARG]...
1625 # ---------------------
1626 # All the functions called inside func_options are hookable. See the
1627 # individual implementations for details.
1628 func_hookable func_options
1629 func_options ()
1630 {
1631 $debug_cmd
1632
1633 func_options_prep ${1+"$@"}
1634 eval func_parse_options \
1635 ${func_options_prep_result+"$func_options_prep_result"}
1636 eval func_validate_options \
1637 ${func_parse_options_result+"$func_parse_options_result"}
1638
1639 eval func_run_hooks func_options \
1640 ${func_validate_options_result+"$func_validate_options_result"}
1641
1642 # save modified positional parameters for caller
1643 func_options_result=$func_run_hooks_result
1644 }
1645
1646
1647 # func_options_prep [ARG]...
1648 # --------------------------
1649 # All initialisations required before starting the option parse loop.
1650 # Note that when calling hook functions, we pass through the list of
1651 # positional parameters. If a hook function modifies that list, and
1652 # needs to propogate that back to rest of this script, then the complete
1653 # modified list must be put in 'func_run_hooks_result' before
1654 # returning.
1655 func_hookable func_options_prep
1656 func_options_prep ()
1657 {
1658 $debug_cmd
1659
1660 # Option defaults:
1661 opt_verbose=false
1662 opt_warning_types=
1663
1664 func_run_hooks func_options_prep ${1+"$@"}
1665
1666 # save modified positional parameters for caller
1667 func_options_prep_result=$func_run_hooks_result
1668 }
1669
1670
1671 # func_parse_options [ARG]...
1672 # ---------------------------
1673 # The main option parsing loop.
1674 func_hookable func_parse_options
1675 func_parse_options ()
1676 {
1677 $debug_cmd
1678
1679 func_parse_options_result=
1680
1681 # this just eases exit handling
1682 while test $# -gt 0; do
1683 # Defer to hook functions for initial option parsing, so they
1684 # get priority in the event of reusing an option name.
1685 func_run_hooks func_parse_options ${1+"$@"}
1686
1687 # Adjust func_parse_options positional parameters to match
1688 eval set dummy "$func_run_hooks_result"; shift
1689
1690 # Break out of the loop if we already parsed every option.
1691 test $# -gt 0 || break
1692
1693 _G_opt=$1
1694 shift
1695 case $_G_opt in
1696 --debug|-x) debug_cmd='set -x'
1697 func_echo "enabling shell trace mode"
1698 $debug_cmd
1699 ;;
1700
1701 --no-warnings|--no-warning|--no-warn)
1702 set dummy --warnings none ${1+"$@"}
1703 shift
1704 ;;
1705
1706 --warnings|--warning|-W)
1707 test $# = 0 && func_missing_arg $_G_opt && break
1708 case " $warning_categories $1" in
1709 *" $1 "*)
1710 # trailing space prevents matching last $1 above
1711 func_append_uniq opt_warning_types " $1"
1712 ;;
1713 *all)
1714 opt_warning_types=$warning_categories
1715 ;;
1716 *none)
1717 opt_warning_types=none
1718 warning_func=:
1719 ;;
1720 *error)
1721 opt_warning_types=$warning_categories
1722 warning_func=func_fatal_error
1723 ;;
1724 *)
1725 func_fatal_error \
1726 "unsupported warning category: '$1'"
1727 ;;
1728 esac
1729 shift
1730 ;;
1731
1732 --verbose|-v) opt_verbose=: ;;
1733 --version) func_version ;;
1734 -\?|-h) func_usage ;;
1735 --help) func_help ;;
1736
1737 # Separate optargs to long options (plugins may need this):
1738 --*=*) func_split_equals "$_G_opt"
1739 set dummy "$func_split_equals_lhs" \
1740 "$func_split_equals_rhs" ${1+"$@"}
1741 shift
1742 ;;
1743
1744 # Separate optargs to short options:
1745 -W*)
1746 func_split_short_opt "$_G_opt"
1747 set dummy "$func_split_short_opt_name" \
1748 "$func_split_short_opt_arg" ${1+"$@"}
1749 shift
1750 ;;
1751
1752 # Separate non-argument short options:
1753 -\?*|-h*|-v*|-x*)
1754 func_split_short_opt "$_G_opt"
1755 set dummy "$func_split_short_opt_name" \
1756 "-$func_split_short_opt_arg" ${1+"$@"}
1757 shift
1758 ;;
1759
1760 --) break ;;
1761 -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
1762 *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
1763 esac
1764 done
1765
1766 # save modified positional parameters for caller
1767 func_quote_for_eval ${1+"$@"}
1768 func_parse_options_result=$func_quote_for_eval_result
1769 }
1770
1771
1772 # func_validate_options [ARG]...
1773 # ------------------------------
1774 # Perform any sanity checks on option settings and/or unconsumed
1775 # arguments.
1776 func_hookable func_validate_options
1777 func_validate_options ()
1778 {
1779 $debug_cmd
1780
1781 # Display all warnings if -W was not given.
1782 test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
1783
1784 func_run_hooks func_validate_options ${1+"$@"}
1785
1786 # Bail if the options were screwed!
1787 $exit_cmd $EXIT_FAILURE
1788
1789 # save modified positional parameters for caller
1790 func_validate_options_result=$func_run_hooks_result
1791 }
1792
1793
1794
1795 ## ----------------- ##
1796 ## Helper functions. ##
1797 ## ----------------- ##
1798
1799 # This section contains the helper functions used by the rest of the
1800 # hookable option parser framework in ascii-betical order.
1801
1802
1803 # func_fatal_help ARG...
1804 # ----------------------
1805 # Echo program name prefixed message to standard error, followed by
1806 # a help hint, and exit.
1807 func_fatal_help ()
1808 {
1809 $debug_cmd
1810
1811 eval \$ECHO \""Usage: $usage"\"
1812 eval \$ECHO \""$fatal_help"\"
1813 func_error ${1+"$@"}
1814 exit $EXIT_FAILURE
1815 }
1816
1817
1818 # func_help
1819 # ---------
1820 # Echo long help message to standard output and exit.
755 func_help () 1821 func_help ()
756 { 1822 {
757 $opt_debug 1823 $debug_cmd
758 1824
759 $SED -n '/^# Usage:/,/# Report bugs to/ { 1825 func_usage_message
760 » :print 1826 $ECHO "$long_help_message"
761 s/^# // 1827 exit 0
762 » s/^# *$// 1828 }
763 » s*\$progname*'$progname'* 1829
764 » s*\$host*'"$host"'* 1830
765 » s*\$SHELL*'"$SHELL"'* 1831 # func_missing_arg ARGNAME
766 » s*\$LTCC*'"$LTCC"'* 1832 # ------------------------
767 » s*\$LTCFLAGS*'"$LTCFLAGS"'*
768 » s*\$LD*'"$LD"'*
769 » s/\$with_gnu_ld/'"$with_gnu_ld"'/
770 » s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$S ED 1q`"'/
771 » s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$S ED 1q`"'/
772 » p
773 » d
774 }
775 /^# .* home page:/b print
776 /^# General help using/b print
777 ' < "$progpath"
778 ret=$?
779 if test -z "$1"; then
780 exit $ret
781 fi
782 }
783
784 # func_missing_arg argname
785 # Echo program name prefixed message to standard error and set global 1833 # Echo program name prefixed message to standard error and set global
786 # exit_cmd. 1834 # exit_cmd.
787 func_missing_arg () 1835 func_missing_arg ()
788 { 1836 {
789 $opt_debug 1837 $debug_cmd
790 1838
791 func_error "missing argument for $1." 1839 func_error "Missing argument for '$1'."
792 exit_cmd=exit 1840 exit_cmd=exit
793 } 1841 }
794 1842
795 1843
796 # func_split_short_opt shortopt 1844 # func_split_equals STRING
1845 # ------------------------
1846 # Set func_split_equals_lhs and func_split_equals_rhs shell variables after
1847 # splitting STRING at the '=' sign.
1848 test -z "$_G_HAVE_XSI_OPS" \
1849 && (eval 'x=a/b/c;
1850 test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
1851 && _G_HAVE_XSI_OPS=yes
1852
1853 if test yes = "$_G_HAVE_XSI_OPS"
1854 then
1855 # This is an XSI compatible shell, allowing a faster implementation...
1856 eval 'func_split_equals ()
1857 {
1858 $debug_cmd
1859
1860 func_split_equals_lhs=${1%%=*}
1861 func_split_equals_rhs=${1#*=}
1862 test "x$func_split_equals_lhs" = "x$1" \
1863 && func_split_equals_rhs=
1864 }'
1865 else
1866 # ...otherwise fall back to using expr, which is often a shell builtin.
1867 func_split_equals ()
1868 {
1869 $debug_cmd
1870
1871 func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
1872 func_split_equals_rhs=
1873 test "x$func_split_equals_lhs" = "x$1" \
1874 || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
1875 }
1876 fi #func_split_equals
1877
1878
1879 # func_split_short_opt SHORTOPT
1880 # -----------------------------
797 # Set func_split_short_opt_name and func_split_short_opt_arg shell 1881 # Set func_split_short_opt_name and func_split_short_opt_arg shell
798 # variables after splitting SHORTOPT after the 2nd character. 1882 # variables after splitting SHORTOPT after the 2nd character.
799 func_split_short_opt () 1883 if test yes = "$_G_HAVE_XSI_OPS"
800 { 1884 then
801 my_sed_short_opt='1s/^\(..\).*$/\1/;q' 1885 # This is an XSI compatible shell, allowing a faster implementation...
802 my_sed_short_rest='1s/^..\(.*\)$/\1/;q' 1886 eval 'func_split_short_opt ()
803 1887 {
804 func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` 1888 $debug_cmd
805 func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` 1889
806 } # func_split_short_opt may be replaced by extended shell implementation 1890 func_split_short_opt_arg=${1#??}
807 1891 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
808 1892 }'
809 # func_split_long_opt longopt 1893 else
810 # Set func_split_long_opt_name and func_split_long_opt_arg shell 1894 # ...otherwise fall back to using expr, which is often a shell builtin.
811 # variables after splitting LONGOPT at the `=' sign. 1895 func_split_short_opt ()
812 func_split_long_opt () 1896 {
813 { 1897 $debug_cmd
814 my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' 1898
815 my_sed_long_arg='1s/^--[^=]*=//' 1899 func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
816 1900 func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
817 func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` 1901 }
818 func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` 1902 fi #func_split_short_opt
819 } # func_split_long_opt may be replaced by extended shell implementation 1903
820 1904
821 exit_cmd=: 1905 # func_usage
822 1906 # ----------
823 1907 # Echo short help message to standard output and exit.
824 1908 func_usage ()
825 1909 {
826 1910 $debug_cmd
827 magic="%%%MAGIC variable%%%" 1911
828 magic_exe="%%%MAGIC EXE variable%%%" 1912 func_usage_message
829 1913 $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
830 # Global variables. 1914 exit 0
831 nonopt= 1915 }
832 preserve_args= 1916
833 lo2o="s/\\.lo\$/.${objext}/" 1917
834 o2lo="s/\\.${objext}\$/.lo/" 1918 # func_usage_message
835 extracted_archives= 1919 # ------------------
836 extracted_serial=0 1920 # Echo short help message to standard output.
837 1921 func_usage_message ()
838 # If this variable is set in any of the actions, the command in it 1922 {
839 # will be execed at the end. This prevents here-documents from being 1923 $debug_cmd
840 # left over by shells. 1924
841 exec_cmd= 1925 eval \$ECHO \""Usage: $usage"\"
842 1926 echo
843 # func_append var value 1927 $SED -n 's|^# ||
844 # Append VALUE to the end of shell variable VAR. 1928 /^Written by/{
845 func_append () 1929 x;p;x
846 { 1930 }
847 eval "${1}=\$${1}\${2}" 1931 » h
848 } # func_append may be replaced by extended shell implementation 1932 » /^Written by/q' < "$progpath"
849 1933 echo
850 # func_append_quoted var value 1934 eval \$ECHO \""$usage_message"\"
851 # Quote VALUE and append to the end of shell variable VAR, separated 1935 }
852 # by a space. 1936
853 func_append_quoted () 1937
854 { 1938 # func_version
855 func_quote_for_eval "${2}" 1939 # ------------
856 eval "${1}=\$${1}\\ \$func_quote_for_eval_result" 1940 # Echo version message to standard output and exit.
857 } # func_append_quoted may be replaced by extended shell implementation 1941 func_version ()
858 1942 {
859 1943 $debug_cmd
860 # func_arith arithmetic-term... 1944
861 func_arith () 1945 printf '%s\n' "$progname $scriptversion"
862 { 1946 $SED -n '
863 func_arith_result=`expr "${@}"` 1947 /(C)/!b go
864 } # func_arith may be replaced by extended shell implementation 1948 :more
865 1949 /\./!{
866 1950 N
867 # func_len string 1951 s|\n# | |
868 # STRING may not start with a hyphen. 1952 b more
869 func_len () 1953 }
870 { 1954 :go
871 func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` 1955 /^# Written by /,/# warranty; / {
872 } # func_len may be replaced by extended shell implementation 1956 s|^# ||
873 1957 s|^# *$||
874 1958 s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
875 # func_lo2o object 1959 p
876 func_lo2o () 1960 }
877 { 1961 /^# Written by / {
878 func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` 1962 s|^# ||
879 } # func_lo2o may be replaced by extended shell implementation 1963 p
880 1964 }
881 1965 /^warranty; /q' < "$progpath"
882 # func_xform libobj-or-source 1966
883 func_xform () 1967 exit $?
884 { 1968 }
885 func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` 1969
886 } # func_xform may be replaced by extended shell implementation 1970
887 1971 # Local variables:
888 1972 # mode: shell-script
889 # func_fatal_configuration arg... 1973 # sh-indentation: 2
1974 # eval: (add-hook 'before-save-hook 'time-stamp)
1975 # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1976 # time-stamp-time-zone: "UTC"
1977 # End:
1978
1979 # Set a version string.
1980 scriptversion='(GNU libtool) 2.4.6'
1981
1982
1983 # func_echo ARG...
1984 # ----------------
1985 # Libtool also displays the current mode in messages, so override
1986 # funclib.sh func_echo with this custom definition.
1987 func_echo ()
1988 {
1989 $debug_cmd
1990
1991 _G_message=$*
1992
1993 func_echo_IFS=$IFS
1994 IFS=$nl
1995 for _G_line in $_G_message; do
1996 IFS=$func_echo_IFS
1997 $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
1998 done
1999 IFS=$func_echo_IFS
2000 }
2001
2002
2003 # func_warning ARG...
2004 # -------------------
2005 # Libtool warnings are not categorized, so override funclib.sh
2006 # func_warning with this simpler definition.
2007 func_warning ()
2008 {
2009 $debug_cmd
2010
2011 $warning_func ${1+"$@"}
2012 }
2013
2014
2015 ## ---------------- ##
2016 ## Options parsing. ##
2017 ## ---------------- ##
2018
2019 # Hook in the functions to make sure our own options are parsed during
2020 # the option parsing loop.
2021
2022 usage='$progpath [OPTION]... [MODE-ARG]...'
2023
2024 # Short help message in response to '-h'.
2025 usage_message="Options:
2026 --config show all configuration variables
2027 --debug enable verbose shell tracing
2028 -n, --dry-run display commands without modifying any files
2029 --features display basic configuration information and exit
2030 --mode=MODE use operation mode MODE
2031 --no-warnings equivalent to '-Wnone'
2032 --preserve-dup-deps don't remove duplicate dependency libraries
2033 --quiet, --silent don't print informational messages
2034 --tag=TAG use configuration variables from tag TAG
2035 -v, --verbose print more informational messages than default
2036 --version print version information
2037 -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
2038 -h, --help, --help-all print short, long, or detailed help message
2039 "
2040
2041 # Additional text appended to 'usage_message' in response to '--help'.
2042 func_help ()
2043 {
2044 $debug_cmd
2045
2046 func_usage_message
2047 $ECHO "$long_help_message
2048
2049 MODE must be one of the following:
2050
2051 clean remove files from the build directory
2052 compile compile a source file into a libtool object
2053 execute automatically set library path, then run a program
2054 finish complete the installation of libtool libraries
2055 install install libraries or executables
2056 link create a library or an executable
2057 uninstall remove libraries from an installed directory
2058
2059 MODE-ARGS vary depending on the MODE. When passed as first option,
2060 '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
2061 Try '$progname --help --mode=MODE' for a more detailed description of MODE.
2062
2063 When reporting a bug, please describe a test case to reproduce it and
2064 include the following information:
2065
2066 host-triplet: $host
2067 shell: $SHELL
2068 compiler: $LTCC
2069 compiler flags: $LTCFLAGS
2070 linker: $LD (gnu? $with_gnu_ld)
2071 version: $progname (GNU libtool) 2.4.6
2072 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
2073 autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
2074
2075 Report bugs to <bug-libtool@gnu.org>.
2076 GNU libtool home page: <http://www.gnu.org/software/libtool/>.
2077 General help using GNU software: <http://www.gnu.org/gethelp/>."
2078 exit 0
2079 }
2080
2081
2082 # func_lo2o OBJECT-NAME
2083 # ---------------------
2084 # Transform OBJECT-NAME from a '.lo' suffix to the platform specific
2085 # object suffix.
2086
2087 lo2o=s/\\.lo\$/.$objext/
2088 o2lo=s/\\.$objext\$/.lo/
2089
2090 if test yes = "$_G_HAVE_XSI_OPS"; then
2091 eval 'func_lo2o ()
2092 {
2093 case $1 in
2094 *.lo) func_lo2o_result=${1%.lo}.$objext ;;
2095 * ) func_lo2o_result=$1 ;;
2096 esac
2097 }'
2098
2099 # func_xform LIBOBJ-OR-SOURCE
2100 # ---------------------------
2101 # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
2102 # suffix to a '.lo' libtool-object suffix.
2103 eval 'func_xform ()
2104 {
2105 func_xform_result=${1%.*}.lo
2106 }'
2107 else
2108 # ...otherwise fall back to using sed.
2109 func_lo2o ()
2110 {
2111 func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
2112 }
2113
2114 func_xform ()
2115 {
2116 func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
2117 }
2118 fi
2119
2120
2121 # func_fatal_configuration ARG...
2122 # -------------------------------
890 # Echo program name prefixed message to standard error, followed by 2123 # Echo program name prefixed message to standard error, followed by
891 # a configuration failure hint, and exit. 2124 # a configuration failure hint, and exit.
892 func_fatal_configuration () 2125 func_fatal_configuration ()
893 { 2126 {
894 func_error ${1+"$@"} 2127 func__fatal_error ${1+"$@"} \
895 func_error "See the $PACKAGE documentation for more information." 2128 "See the $PACKAGE documentation for more information." \
896 func_fatal_error "Fatal configuration error." 2129 "Fatal configuration error."
897 } 2130 }
898 2131
899 2132
900 # func_config 2133 # func_config
2134 # -----------
901 # Display the configuration for all the tags in this script. 2135 # Display the configuration for all the tags in this script.
902 func_config () 2136 func_config ()
903 { 2137 {
904 re_begincf='^# ### BEGIN LIBTOOL' 2138 re_begincf='^# ### BEGIN LIBTOOL'
905 re_endcf='^# ### END LIBTOOL' 2139 re_endcf='^# ### END LIBTOOL'
906 2140
907 # Default configuration. 2141 # Default configuration.
908 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" 2142 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
909 2143
910 # Now print the configurations for the tags. 2144 # Now print the configurations for the tags.
911 for tagname in $taglist; do 2145 for tagname in $taglist; do
912 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagn ame\$/p" < "$progpath" 2146 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagn ame\$/p" < "$progpath"
913 done 2147 done
914 2148
915 exit $? 2149 exit $?
916 } 2150 }
917 2151
2152
918 # func_features 2153 # func_features
2154 # -------------
919 # Display the features supported by this script. 2155 # Display the features supported by this script.
920 func_features () 2156 func_features ()
921 { 2157 {
922 echo "host: $host" 2158 echo "host: $host"
923 if test "$build_libtool_libs" = yes; then 2159 if test yes = "$build_libtool_libs"; then
924 echo "enable shared libraries" 2160 echo "enable shared libraries"
925 else 2161 else
926 echo "disable shared libraries" 2162 echo "disable shared libraries"
927 fi 2163 fi
928 if test "$build_old_libs" = yes; then 2164 if test yes = "$build_old_libs"; then
929 echo "enable static libraries" 2165 echo "enable static libraries"
930 else 2166 else
931 echo "disable static libraries" 2167 echo "disable static libraries"
932 fi 2168 fi
933 2169
934 exit $? 2170 exit $?
935 } 2171 }
936 2172
937 # func_enable_tag tagname 2173
2174 # func_enable_tag TAGNAME
2175 # -----------------------
938 # Verify that TAGNAME is valid, and either flag an error and exit, or 2176 # Verify that TAGNAME is valid, and either flag an error and exit, or
939 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist 2177 # enable the TAGNAME tag. We also add TAGNAME to the global $taglist
940 # variable here. 2178 # variable here.
941 func_enable_tag () 2179 func_enable_tag ()
942 { 2180 {
943 # Global variable: 2181 # Global variable:
944 tagname="$1" 2182 tagname=$1
945 2183
946 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" 2184 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
947 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" 2185 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
948 sed_extractcf="/$re_begincf/,/$re_endcf/p" 2186 sed_extractcf=/$re_begincf/,/$re_endcf/p
949 2187
950 # Validate tagname. 2188 # Validate tagname.
951 case $tagname in 2189 case $tagname in
952 *[!-_A-Za-z0-9,/]*) 2190 *[!-_A-Za-z0-9,/]*)
953 func_fatal_error "invalid tag name: $tagname" 2191 func_fatal_error "invalid tag name: $tagname"
954 ;; 2192 ;;
955 esac 2193 esac
956 2194
957 # Don't test for the "default" C tag, as we know it's 2195 # Don't test for the "default" C tag, as we know it's
958 # there but not specially marked. 2196 # there but not specially marked.
959 case $tagname in 2197 case $tagname in
960 CC) ;; 2198 CC) ;;
961 *) 2199 *)
962 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then 2200 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
963 » taglist="$taglist $tagname" 2201 » taglist="$taglist $tagname"
964 2202
965 » # Evaluate the configuration. Be careful to quote the path 2203 » # Evaluate the configuration. Be careful to quote the path
966 » # and the sed script, to avoid splitting on whitespace, but 2204 » # and the sed script, to avoid splitting on whitespace, but
967 » # also don't use non-portable quotes within backquotes within 2205 » # also don't use non-portable quotes within backquotes within
968 » # quotes we have to do it in 2 steps: 2206 » # quotes we have to do it in 2 steps:
969 » extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` 2207 » extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
970 » eval "$extractedcf" 2208 » eval "$extractedcf"
971 else 2209 else
972 » func_error "ignoring unknown tag $tagname" 2210 » func_error "ignoring unknown tag $tagname"
973 fi 2211 fi
974 ;; 2212 ;;
975 esac 2213 esac
976 } 2214 }
2215
977 2216
978 # func_check_version_match 2217 # func_check_version_match
2218 # ------------------------
979 # Ensure that we are using m4 macros, and libtool script from the same 2219 # Ensure that we are using m4 macros, and libtool script from the same
980 # release of libtool. 2220 # release of libtool.
981 func_check_version_match () 2221 func_check_version_match ()
982 { 2222 {
983 if test "$package_revision" != "$macro_revision"; then 2223 if test "$package_revision" != "$macro_revision"; then
984 if test "$VERSION" != "$macro_version"; then 2224 if test "$VERSION" != "$macro_version"; then
985 if test -z "$macro_version"; then 2225 if test -z "$macro_version"; then
986 cat >&2 <<_LT_EOF 2226 cat >&2 <<_LT_EOF
987 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the 2227 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
988 $progname: definition of this LT_INIT comes from an older release. 2228 $progname: definition of this LT_INIT comes from an older release.
989 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION 2229 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
990 $progname: and run autoconf again. 2230 $progname: and run autoconf again.
991 _LT_EOF 2231 _LT_EOF
992 else 2232 else
993 cat >&2 <<_LT_EOF 2233 cat >&2 <<_LT_EOF
994 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the 2234 $progname: Version mismatch error. This is $PACKAGE $VERSION, but the
995 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. 2235 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
996 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION 2236 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
997 $progname: and run autoconf again. 2237 $progname: and run autoconf again.
998 _LT_EOF 2238 _LT_EOF
999 fi 2239 fi
1000 else 2240 else
1001 cat >&2 <<_LT_EOF 2241 cat >&2 <<_LT_EOF
1002 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package _revision, 2242 $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package _revision,
1003 $progname: but the definition of this LT_INIT comes from revision $macro_revisio n. 2243 $progname: but the definition of this LT_INIT comes from revision $macro_revisio n.
1004 $progname: You should recreate aclocal.m4 with macros from revision $package_rev ision 2244 $progname: You should recreate aclocal.m4 with macros from revision $package_rev ision
1005 $progname: of $PACKAGE $VERSION and run autoconf again. 2245 $progname: of $PACKAGE $VERSION and run autoconf again.
1006 _LT_EOF 2246 _LT_EOF
2247 fi
2248
2249 exit $EXIT_MISMATCH
1007 fi 2250 fi
1008 2251 }
1009 exit $EXIT_MISMATCH 2252
1010 fi 2253
1011 } 2254 # libtool_options_prep [ARG]...
1012 2255 # -----------------------------
1013 2256 # Preparation for options parsed by libtool.
1014 # Shorthand for --mode=foo, only valid as the first argument 2257 libtool_options_prep ()
1015 case $1 in 2258 {
1016 clean|clea|cle|cl) 2259 $debug_mode
1017 shift; set dummy --mode clean ${1+"$@"}; shift 2260
1018 ;; 2261 # Option defaults:
1019 compile|compil|compi|comp|com|co|c) 2262 opt_config=false
1020 shift; set dummy --mode compile ${1+"$@"}; shift 2263 opt_dlopen=
1021 ;; 2264 opt_dry_run=false
1022 execute|execut|execu|exec|exe|ex|e) 2265 opt_help=false
1023 shift; set dummy --mode execute ${1+"$@"}; shift 2266 opt_mode=
1024 ;; 2267 opt_preserve_dup_deps=false
1025 finish|finis|fini|fin|fi|f) 2268 opt_quiet=false
1026 shift; set dummy --mode finish ${1+"$@"}; shift 2269
1027 ;; 2270 nonopt=
1028 install|instal|insta|inst|ins|in|i) 2271 preserve_args=
1029 shift; set dummy --mode install ${1+"$@"}; shift 2272
1030 ;; 2273 # Shorthand for --mode=foo, only valid as the first argument
1031 link|lin|li|l) 2274 case $1 in
1032 shift; set dummy --mode link ${1+"$@"}; shift 2275 clean|clea|cle|cl)
1033 ;; 2276 shift; set dummy --mode clean ${1+"$@"}; shift
1034 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) 2277 ;;
1035 shift; set dummy --mode uninstall ${1+"$@"}; shift 2278 compile|compil|compi|comp|com|co|c)
1036 ;; 2279 shift; set dummy --mode compile ${1+"$@"}; shift
1037 esac 2280 ;;
1038 2281 execute|execut|execu|exec|exe|ex|e)
1039 2282 shift; set dummy --mode execute ${1+"$@"}; shift
1040 2283 ;;
1041 # Option defaults: 2284 finish|finis|fini|fin|fi|f)
1042 opt_debug=: 2285 shift; set dummy --mode finish ${1+"$@"}; shift
1043 opt_dry_run=false 2286 ;;
1044 opt_config=false 2287 install|instal|insta|inst|ins|in|i)
1045 opt_preserve_dup_deps=false 2288 shift; set dummy --mode install ${1+"$@"}; shift
1046 opt_features=false 2289 ;;
1047 opt_finish=false 2290 link|lin|li|l)
1048 opt_help=false 2291 shift; set dummy --mode link ${1+"$@"}; shift
1049 opt_help_all=false 2292 ;;
1050 opt_silent=: 2293 uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1051 opt_warning=: 2294 shift; set dummy --mode uninstall ${1+"$@"}; shift
1052 opt_verbose=: 2295 ;;
1053 opt_silent=false
1054 opt_verbose=false
1055
1056
1057 # Parse options once, thoroughly. This comes as soon as possible in the
1058 # script to make things like `--version' happen as quickly as we can.
1059 {
1060 # this just eases exit handling
1061 while test $# -gt 0; do
1062 opt="$1"
1063 shift
1064 case $opt in
1065 --debug|-x)» opt_debug='set -x'
1066 » » » func_echo "enabling shell trace mode"
1067 » » » $opt_debug
1068 » » » ;;
1069 --dry-run|--dryrun|-n)
1070 » » » opt_dry_run=:
1071 » » » ;;
1072 --config)
1073 » » » opt_config=:
1074 func_config
1075 » » » ;;
1076 --dlopen|-dlopen)
1077 » » » optarg="$1"
1078 » » » opt_dlopen="${opt_dlopen+$opt_dlopen
1079 }$optarg"
1080 » » » shift
1081 » » » ;;
1082 --preserve-dup-deps)
1083 » » » opt_preserve_dup_deps=:
1084 » » » ;;
1085 --features)
1086 » » » opt_features=:
1087 func_features
1088 » » » ;;
1089 --finish)
1090 » » » opt_finish=:
1091 set dummy --mode finish ${1+"$@"}; shift
1092 » » » ;;
1093 --help)
1094 » » » opt_help=:
1095 » » » ;;
1096 --help-all)
1097 » » » opt_help_all=:
1098 opt_help=': help-all'
1099 » » » ;;
1100 --mode)
1101 » » » test $# = 0 && func_missing_arg $opt && break
1102 » » » optarg="$1"
1103 » » » opt_mode="$optarg"
1104 case $optarg in
1105 # Valid mode arguments:
1106 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1107
1108 # Catch anything else as an error
1109 *) func_error "invalid argument for $opt"
1110 exit_cmd=exit
1111 break
1112 ;;
1113 esac
1114 » » » shift
1115 » » » ;;
1116 --no-silent|--no-quiet)
1117 » » » opt_silent=false
1118 func_append preserve_args " $opt"
1119 » » » ;;
1120 --no-warning|--no-warn)
1121 » » » opt_warning=false
1122 func_append preserve_args " $opt"
1123 » » » ;;
1124 --no-verbose)
1125 » » » opt_verbose=false
1126 func_append preserve_args " $opt"
1127 » » » ;;
1128 --silent|--quiet)
1129 » » » opt_silent=:
1130 func_append preserve_args " $opt"
1131 opt_verbose=false
1132 » » » ;;
1133 --verbose|-v)
1134 » » » opt_verbose=:
1135 func_append preserve_args " $opt"
1136 opt_silent=false
1137 » » » ;;
1138 --tag)
1139 » » » test $# = 0 && func_missing_arg $opt && break
1140 » » » optarg="$1"
1141 » » » opt_tag="$optarg"
1142 func_append preserve_args " $opt $optarg"
1143 func_enable_tag "$optarg"
1144 » » » shift
1145 » » » ;;
1146
1147 -\?|-h)» » func_usage» » » » ;;
1148 --help)» » func_help» » » » ;;
1149 --version)» func_version» » » » ;;
1150
1151 # Separate optargs to long options:
1152 --*=*)
1153 » » » func_split_long_opt "$opt"
1154 » » » set dummy "$func_split_long_opt_name" "$func_split_long_ opt_arg" ${1+"$@"}
1155 » » » shift
1156 » » » ;;
1157
1158 # Separate non-argument short options:
1159 -\?*|-h*|-n*|-v*)
1160 » » » func_split_short_opt "$opt"
1161 » » » set dummy "$func_split_short_opt_name" "-$func_split_sho rt_opt_arg" ${1+"$@"}
1162 » » » shift
1163 » » » ;;
1164
1165 --)» » break» » » » » ;;
1166 -*)» » func_fatal_help "unrecognized option \`$opt'" ;;
1167 *)» » set dummy "$opt" ${1+"$@"};» shift; break ;;
1168 esac 2296 esac
1169 done 2297
1170 2298 # Pass back the list of options.
1171 # Validate options: 2299 func_quote_for_eval ${1+"$@"}
1172 2300 libtool_options_prep_result=$func_quote_for_eval_result
1173 # save first non-option argument 2301 }
1174 if test "$#" -gt 0; then 2302 func_add_hook func_options_prep libtool_options_prep
1175 nonopt="$opt" 2303
1176 shift 2304
1177 fi 2305 # libtool_parse_options [ARG]...
1178 2306 # ---------------------------------
1179 # preserve --debug 2307 # Provide handling for libtool specific options.
1180 test "$opt_debug" = : || func_append preserve_args " --debug" 2308 libtool_parse_options ()
1181 2309 {
1182 case $host in 2310 $debug_cmd
1183 *cygwin* | *mingw* | *pw32* | *cegcc*) 2311
1184 # don't eliminate duplications in $postdeps and $predeps 2312 # Perform our own loop to consume as many options as possible in
1185 opt_duplicate_compiler_generated_deps=: 2313 # each iteration.
1186 ;; 2314 while test $# -gt 0; do
1187 *) 2315 _G_opt=$1
1188 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps 2316 shift
1189 ;; 2317 case $_G_opt in
1190 esac 2318 --dry-run|--dryrun|-n)
1191 2319 opt_dry_run=:
1192 $opt_help || { 2320 ;;
1193 # Sanity checks first: 2321
1194 func_check_version_match 2322 --config) func_config ;;
1195 2323
1196 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then 2324 --dlopen|-dlopen)
1197 func_fatal_configuration "not configured to build any kind of library" 2325 opt_dlopen="${opt_dlopen+$opt_dlopen
2326 }$1"
2327 shift
2328 ;;
2329
2330 --preserve-dup-deps)
2331 opt_preserve_dup_deps=: ;;
2332
2333 --features) func_features ;;
2334
2335 --finish) set dummy --mode finish ${1+"$@"}; shift ;;
2336
2337 --help) opt_help=: ;;
2338
2339 --help-all) opt_help=': help-all' ;;
2340
2341 --mode) test $# = 0 && func_missing_arg $_G_opt && break
2342 opt_mode=$1
2343 case $1 in
2344 # Valid mode arguments:
2345 clean|compile|execute|finish|install|link|relink|unins tall) ;;
2346
2347 # Catch anything else as an error
2348 *) func_error "invalid argument for $_G_opt"
2349 exit_cmd=exit
2350 break
2351 ;;
2352 esac
2353 shift
2354 ;;
2355
2356 --no-silent|--no-quiet)
2357 opt_quiet=false
2358 func_append preserve_args " $_G_opt"
2359 ;;
2360
2361 --no-warnings|--no-warning|--no-warn)
2362 opt_warning=false
2363 func_append preserve_args " $_G_opt"
2364 ;;
2365
2366 --no-verbose)
2367 opt_verbose=false
2368 func_append preserve_args " $_G_opt"
2369 ;;
2370
2371 --silent|--quiet)
2372 opt_quiet=:
2373 opt_verbose=false
2374 func_append preserve_args " $_G_opt"
2375 ;;
2376
2377 --tag) test $# = 0 && func_missing_arg $_G_opt && break
2378 opt_tag=$1
2379 func_append preserve_args " $_G_opt $1"
2380 func_enable_tag "$1"
2381 shift
2382 ;;
2383
2384 --verbose|-v) opt_quiet=false
2385 opt_verbose=:
2386 func_append preserve_args " $_G_opt"
2387 ;;
2388
2389 » # An option not handled by this hook function:
2390 *)» » set dummy "$_G_opt" ${1+"$@"};» shift; break ;;
2391 esac
2392 done
2393
2394
2395 # save modified positional parameters for caller
2396 func_quote_for_eval ${1+"$@"}
2397 libtool_parse_options_result=$func_quote_for_eval_result
2398 }
2399 func_add_hook func_parse_options libtool_parse_options
2400
2401
2402
2403 # libtool_validate_options [ARG]...
2404 # ---------------------------------
2405 # Perform any sanity checks on option settings and/or unconsumed
2406 # arguments.
2407 libtool_validate_options ()
2408 {
2409 # save first non-option argument
2410 if test 0 -lt $#; then
2411 nonopt=$1
2412 shift
1198 fi 2413 fi
1199 2414
1200 # Darwin sucks 2415 # preserve --debug
1201 eval std_shrext=\"$shrext_cmds\" 2416 test : = "$debug_cmd" || func_append preserve_args " --debug"
1202 2417
1203 # Only execute mode is allowed to have -dlopen flags. 2418 case $host in
1204 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then 2419 # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
1205 func_error "unrecognized option \`-dlopen'" 2420 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
1206 $ECHO "$help" 1>&2 2421 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
1207 exit $EXIT_FAILURE 2422 # don't eliminate duplications in $postdeps and $predeps
1208 fi 2423 opt_duplicate_compiler_generated_deps=:
1209 2424 ;;
1210 # Change the help message to a mode-specific one. 2425 *)
1211 generic_help="$help" 2426 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1212 help="Try \`$progname --help --mode=$opt_mode' for more information." 2427 ;;
1213 } 2428 esac
1214 2429
1215 2430 $opt_help || {
1216 # Bail if the options were screwed 2431 # Sanity checks first:
1217 $exit_cmd $EXIT_FAILURE 2432 func_check_version_match
1218 } 2433
1219 2434 test yes != "$build_libtool_libs" \
2435 && test yes != "$build_old_libs" \
2436 && func_fatal_configuration "not configured to build any kind of library "
2437
2438 # Darwin sucks
2439 eval std_shrext=\"$shrext_cmds\"
2440
2441 # Only execute mode is allowed to have -dlopen flags.
2442 if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
2443 func_error "unrecognized option '-dlopen'"
2444 $ECHO "$help" 1>&2
2445 exit $EXIT_FAILURE
2446 fi
2447
2448 # Change the help message to a mode-specific one.
2449 generic_help=$help
2450 help="Try '$progname --help --mode=$opt_mode' for more information."
2451 }
2452
2453 # Pass back the unparsed argument list
2454 func_quote_for_eval ${1+"$@"}
2455 libtool_validate_options_result=$func_quote_for_eval_result
2456 }
2457 func_add_hook func_validate_options libtool_validate_options
2458
2459
2460 # Process options as early as possible so that --help and --version
2461 # can return quickly.
2462 func_options ${1+"$@"}
2463 eval set dummy "$func_options_result"; shift
1220 2464
1221 2465
1222 2466
1223 ## ----------- ## 2467 ## ----------- ##
1224 ## Main. ## 2468 ## Main. ##
1225 ## ----------- ## 2469 ## ----------- ##
1226 2470
2471 magic='%%%MAGIC variable%%%'
2472 magic_exe='%%%MAGIC EXE variable%%%'
2473
2474 # Global variables.
2475 extracted_archives=
2476 extracted_serial=0
2477
2478 # If this variable is set in any of the actions, the command in it
2479 # will be execed at the end. This prevents here-documents from being
2480 # left over by shells.
2481 exec_cmd=
2482
2483
2484 # A function that is used when there is no print builtin or printf.
2485 func_fallback_echo ()
2486 {
2487 eval 'cat <<_LTECHO_EOF
2488 $1
2489 _LTECHO_EOF'
2490 }
2491
2492 # func_generated_by_libtool
2493 # True iff stdin has been generated by Libtool. This function is only
2494 # a basic sanity check; it will hardly flush out determined imposters.
2495 func_generated_by_libtool_p ()
2496 {
2497 $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
2498 }
2499
1227 # func_lalib_p file 2500 # func_lalib_p file
1228 # True iff FILE is a libtool `.la' library or `.lo' object file. 2501 # True iff FILE is a libtool '.la' library or '.lo' object file.
1229 # This function is only a basic sanity check; it will hardly flush out 2502 # This function is only a basic sanity check; it will hardly flush out
1230 # determined imposters. 2503 # determined imposters.
1231 func_lalib_p () 2504 func_lalib_p ()
1232 { 2505 {
1233 test -f "$1" && 2506 test -f "$1" &&
1234 $SED -e 4q "$1" 2>/dev/null \ 2507 $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
1235 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1236 } 2508 }
1237 2509
1238 # func_lalib_unsafe_p file 2510 # func_lalib_unsafe_p file
1239 # True iff FILE is a libtool `.la' library or `.lo' object file. 2511 # True iff FILE is a libtool '.la' library or '.lo' object file.
1240 # This function implements the same check as func_lalib_p without 2512 # This function implements the same check as func_lalib_p without
1241 # resorting to external programs. To this end, it redirects stdin and 2513 # resorting to external programs. To this end, it redirects stdin and
1242 # closes it afterwards, without saving the original file descriptor. 2514 # closes it afterwards, without saving the original file descriptor.
1243 # As a safety measure, use it only where a negative result would be 2515 # As a safety measure, use it only where a negative result would be
1244 # fatal anyway. Works if `file' does not exist. 2516 # fatal anyway. Works if 'file' does not exist.
1245 func_lalib_unsafe_p () 2517 func_lalib_unsafe_p ()
1246 { 2518 {
1247 lalib_p=no 2519 lalib_p=no
1248 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then 2520 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1249 for lalib_p_l in 1 2 3 4 2521 for lalib_p_l in 1 2 3 4
1250 do 2522 do
1251 read lalib_p_line 2523 read lalib_p_line
1252 » case "$lalib_p_line" in 2524 » case $lalib_p_line in
1253 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; 2525 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1254 esac 2526 esac
1255 done 2527 done
1256 exec 0<&5 5<&- 2528 exec 0<&5 5<&-
1257 fi 2529 fi
1258 test "$lalib_p" = yes 2530 test yes = "$lalib_p"
1259 } 2531 }
1260 2532
1261 # func_ltwrapper_script_p file 2533 # func_ltwrapper_script_p file
1262 # True iff FILE is a libtool wrapper script 2534 # True iff FILE is a libtool wrapper script
1263 # This function is only a basic sanity check; it will hardly flush out 2535 # This function is only a basic sanity check; it will hardly flush out
1264 # determined imposters. 2536 # determined imposters.
1265 func_ltwrapper_script_p () 2537 func_ltwrapper_script_p ()
1266 { 2538 {
1267 func_lalib_p "$1" 2539 test -f "$1" &&
2540 $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
1268 } 2541 }
1269 2542
1270 # func_ltwrapper_executable_p file 2543 # func_ltwrapper_executable_p file
1271 # True iff FILE is a libtool wrapper executable 2544 # True iff FILE is a libtool wrapper executable
1272 # This function is only a basic sanity check; it will hardly flush out 2545 # This function is only a basic sanity check; it will hardly flush out
1273 # determined imposters. 2546 # determined imposters.
1274 func_ltwrapper_executable_p () 2547 func_ltwrapper_executable_p ()
1275 { 2548 {
1276 func_ltwrapper_exec_suffix= 2549 func_ltwrapper_exec_suffix=
1277 case $1 in 2550 case $1 in
1278 *.exe) ;; 2551 *.exe) ;;
1279 *) func_ltwrapper_exec_suffix=.exe ;; 2552 *) func_ltwrapper_exec_suffix=.exe ;;
1280 esac 2553 esac
1281 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 2554 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1282 } 2555 }
1283 2556
1284 # func_ltwrapper_scriptname file 2557 # func_ltwrapper_scriptname file
1285 # Assumes file is an ltwrapper_executable 2558 # Assumes file is an ltwrapper_executable
1286 # uses $file to determine the appropriate filename for a 2559 # uses $file to determine the appropriate filename for a
1287 # temporary ltwrapper_script. 2560 # temporary ltwrapper_script.
1288 func_ltwrapper_scriptname () 2561 func_ltwrapper_scriptname ()
1289 { 2562 {
1290 func_dirname_and_basename "$1" "" "." 2563 func_dirname_and_basename "$1" "" "."
1291 func_stripname '' '.exe' "$func_basename_result" 2564 func_stripname '' '.exe' "$func_basename_result"
1292 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripn ame_result}_ltshwrapper" 2565 func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripna me_result}_ltshwrapper
1293 } 2566 }
1294 2567
1295 # func_ltwrapper_p file 2568 # func_ltwrapper_p file
1296 # True iff FILE is a libtool wrapper script or wrapper executable 2569 # True iff FILE is a libtool wrapper script or wrapper executable
1297 # This function is only a basic sanity check; it will hardly flush out 2570 # This function is only a basic sanity check; it will hardly flush out
1298 # determined imposters. 2571 # determined imposters.
1299 func_ltwrapper_p () 2572 func_ltwrapper_p ()
1300 { 2573 {
1301 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" 2574 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1302 } 2575 }
1303 2576
1304 2577
1305 # func_execute_cmds commands fail_cmd 2578 # func_execute_cmds commands fail_cmd
1306 # Execute tilde-delimited COMMANDS. 2579 # Execute tilde-delimited COMMANDS.
1307 # If FAIL_CMD is given, eval that upon failure. 2580 # If FAIL_CMD is given, eval that upon failure.
1308 # FAIL_CMD may read-access the current command in variable CMD! 2581 # FAIL_CMD may read-access the current command in variable CMD!
1309 func_execute_cmds () 2582 func_execute_cmds ()
1310 { 2583 {
1311 $opt_debug 2584 $debug_cmd
2585
1312 save_ifs=$IFS; IFS='~' 2586 save_ifs=$IFS; IFS='~'
1313 for cmd in $1; do 2587 for cmd in $1; do
2588 IFS=$sp$nl
2589 eval cmd=\"$cmd\"
1314 IFS=$save_ifs 2590 IFS=$save_ifs
1315 eval cmd=\"$cmd\"
1316 func_show_eval "$cmd" "${2-:}" 2591 func_show_eval "$cmd" "${2-:}"
1317 done 2592 done
1318 IFS=$save_ifs 2593 IFS=$save_ifs
1319 } 2594 }
1320 2595
1321 2596
1322 # func_source file 2597 # func_source file
1323 # Source FILE, adding directory component if necessary. 2598 # Source FILE, adding directory component if necessary.
1324 # Note that it is not necessary on cygwin/mingw to append a dot to 2599 # Note that it is not necessary on cygwin/mingw to append a dot to
1325 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe 2600 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1326 # behavior happens only for exec(3), not for open(2)! Also, sourcing 2601 # behavior happens only for exec(3), not for open(2)! Also, sourcing
1327 # `FILE.' does not work on cygwin managed mounts. 2602 # 'FILE.' does not work on cygwin managed mounts.
1328 func_source () 2603 func_source ()
1329 { 2604 {
1330 $opt_debug 2605 $debug_cmd
2606
1331 case $1 in 2607 case $1 in
1332 */* | *\\*) . "$1" ;; 2608 */* | *\\*) . "$1" ;;
1333 *) . "./$1" ;; 2609 *) . "./$1" ;;
1334 esac 2610 esac
1335 } 2611 }
1336 2612
1337 2613
1338 # func_resolve_sysroot PATH 2614 # func_resolve_sysroot PATH
1339 # Replace a leading = in PATH with a sysroot. Store the result into 2615 # Replace a leading = in PATH with a sysroot. Store the result into
1340 # func_resolve_sysroot_result 2616 # func_resolve_sysroot_result
1341 func_resolve_sysroot () 2617 func_resolve_sysroot ()
1342 { 2618 {
1343 func_resolve_sysroot_result=$1 2619 func_resolve_sysroot_result=$1
1344 case $func_resolve_sysroot_result in 2620 case $func_resolve_sysroot_result in
1345 =*) 2621 =*)
1346 func_stripname '=' '' "$func_resolve_sysroot_result" 2622 func_stripname '=' '' "$func_resolve_sysroot_result"
1347 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result 2623 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1348 ;; 2624 ;;
1349 esac 2625 esac
1350 } 2626 }
1351 2627
1352 # func_replace_sysroot PATH 2628 # func_replace_sysroot PATH
1353 # If PATH begins with the sysroot, replace it with = and 2629 # If PATH begins with the sysroot, replace it with = and
1354 # store the result into func_replace_sysroot_result. 2630 # store the result into func_replace_sysroot_result.
1355 func_replace_sysroot () 2631 func_replace_sysroot ()
1356 { 2632 {
1357 case "$lt_sysroot:$1" in 2633 case $lt_sysroot:$1 in
1358 ?*:"$lt_sysroot"*) 2634 ?*:"$lt_sysroot"*)
1359 func_stripname "$lt_sysroot" '' "$1" 2635 func_stripname "$lt_sysroot" '' "$1"
1360 func_replace_sysroot_result="=$func_stripname_result" 2636 func_replace_sysroot_result='='$func_stripname_result
1361 ;; 2637 ;;
1362 *) 2638 *)
1363 # Including no sysroot. 2639 # Including no sysroot.
1364 func_replace_sysroot_result=$1 2640 func_replace_sysroot_result=$1
1365 ;; 2641 ;;
1366 esac 2642 esac
1367 } 2643 }
1368 2644
1369 # func_infer_tag arg 2645 # func_infer_tag arg
1370 # Infer tagged configuration to use if any are available and 2646 # Infer tagged configuration to use if any are available and
1371 # if one wasn't chosen via the "--tag" command line option. 2647 # if one wasn't chosen via the "--tag" command line option.
1372 # Only attempt this if the compiler in the base compile 2648 # Only attempt this if the compiler in the base compile
1373 # command doesn't match the default compiler. 2649 # command doesn't match the default compiler.
1374 # arg is usually of the form 'gcc ...' 2650 # arg is usually of the form 'gcc ...'
1375 func_infer_tag () 2651 func_infer_tag ()
1376 { 2652 {
1377 $opt_debug 2653 $debug_cmd
2654
1378 if test -n "$available_tags" && test -z "$tagname"; then 2655 if test -n "$available_tags" && test -z "$tagname"; then
1379 CC_quoted= 2656 CC_quoted=
1380 for arg in $CC; do 2657 for arg in $CC; do
1381 func_append_quoted CC_quoted "$arg" 2658 func_append_quoted CC_quoted "$arg"
1382 done 2659 done
1383 CC_expanded=`func_echo_all $CC` 2660 CC_expanded=`func_echo_all $CC`
1384 CC_quoted_expanded=`func_echo_all $CC_quoted` 2661 CC_quoted_expanded=`func_echo_all $CC_quoted`
1385 case $@ in 2662 case $@ in
1386 # Blanks in the command may have been stripped by the calling shell, 2663 # Blanks in the command may have been stripped by the calling shell,
1387 # but not from the CC environment variable when configure was run. 2664 # but not from the CC environment variable when configure was run.
1388 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ 2665 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1389 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_e xpanded "*) ;; 2666 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_e xpanded "*) ;;
1390 # Blanks at the start of $base_compile will cause this to fail 2667 # Blanks at the start of $base_compile will cause this to fail
1391 # if we don't check for them as well. 2668 # if we don't check for them as well.
1392 *) 2669 *)
1393 for z in $available_tags; do 2670 for z in $available_tags; do
1394 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/n ull; then 2671 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/n ull; then
1395 # Evaluate the configuration. 2672 # Evaluate the configuration.
1396 » eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ## # END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" 2673 » eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1397 CC_quoted= 2674 CC_quoted=
1398 for arg in $CC; do 2675 for arg in $CC; do
1399 # Double-quote args containing other shell metacharacters. 2676 # Double-quote args containing other shell metacharacters.
1400 func_append_quoted CC_quoted "$arg" 2677 func_append_quoted CC_quoted "$arg"
1401 done 2678 done
1402 CC_expanded=`func_echo_all $CC` 2679 CC_expanded=`func_echo_all $CC`
1403 CC_quoted_expanded=`func_echo_all $CC_quoted` 2680 CC_quoted_expanded=`func_echo_all $CC_quoted`
1404 case "$@ " in 2681 case "$@ " in
1405 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ 2682 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1406 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_qu oted_expanded "*) 2683 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_qu oted_expanded "*)
1407 # The compiler in the base compile command matches 2684 # The compiler in the base compile command matches
1408 # the one in the tagged configuration. 2685 # the one in the tagged configuration.
1409 # Assume this is the tagged configuration we want. 2686 # Assume this is the tagged configuration we want.
1410 tagname=$z 2687 tagname=$z
1411 break 2688 break
1412 ;; 2689 ;;
1413 esac 2690 esac
1414 fi 2691 fi
1415 done 2692 done
1416 # If $tagname still isn't set, then no tagged configuration 2693 # If $tagname still isn't set, then no tagged configuration
1417 # was found and let the user know that the "--tag" command 2694 # was found and let the user know that the "--tag" command
1418 # line option must be used. 2695 # line option must be used.
1419 if test -z "$tagname"; then 2696 if test -z "$tagname"; then
1420 func_echo "unable to infer tagged configuration" 2697 func_echo "unable to infer tagged configuration"
1421 » func_fatal_error "specify a tag with \`--tag'" 2698 » func_fatal_error "specify a tag with '--tag'"
1422 # else 2699 # else
1423 # func_verbose "using $tagname tagged configuration" 2700 # func_verbose "using $tagname tagged configuration"
1424 fi 2701 fi
1425 ;; 2702 ;;
1426 esac 2703 esac
1427 fi 2704 fi
1428 } 2705 }
1429 2706
1430 2707
1431 2708
1432 # func_write_libtool_object output_name pic_name nonpic_name 2709 # func_write_libtool_object output_name pic_name nonpic_name
1433 # Create a libtool object file (analogous to a ".la" file), 2710 # Create a libtool object file (analogous to a ".la" file),
1434 # but don't create it if we're doing a dry run. 2711 # but don't create it if we're doing a dry run.
1435 func_write_libtool_object () 2712 func_write_libtool_object ()
1436 { 2713 {
1437 write_libobj=${1} 2714 write_libobj=$1
1438 if test "$build_libtool_libs" = yes; then 2715 if test yes = "$build_libtool_libs"; then
1439 write_lobj=\'${2}\' 2716 write_lobj=\'$2\'
1440 else 2717 else
1441 write_lobj=none 2718 write_lobj=none
1442 fi 2719 fi
1443 2720
1444 if test "$build_old_libs" = yes; then 2721 if test yes = "$build_old_libs"; then
1445 write_oldobj=\'${3}\' 2722 write_oldobj=\'$3\'
1446 else 2723 else
1447 write_oldobj=none 2724 write_oldobj=none
1448 fi 2725 fi
1449 2726
1450 $opt_dry_run || { 2727 $opt_dry_run || {
1451 cat >${write_libobj}T <<EOF 2728 cat >${write_libobj}T <<EOF
1452 # $write_libobj - a libtool object file 2729 # $write_libobj - a libtool object file
1453 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION 2730 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
1454 # 2731 #
1455 # Please DO NOT delete this file! 2732 # Please DO NOT delete this file!
1456 # It is necessary for linking the library. 2733 # It is necessary for linking the library.
1457 2734
1458 # Name of the PIC object. 2735 # Name of the PIC object.
1459 pic_object=$write_lobj 2736 pic_object=$write_lobj
1460 2737
1461 # Name of the non-PIC object 2738 # Name of the non-PIC object
1462 non_pic_object=$write_oldobj 2739 non_pic_object=$write_oldobj
1463 2740
1464 EOF 2741 EOF
1465 $MV "${write_libobj}T" "${write_libobj}" 2742 $MV "${write_libobj}T" "$write_libobj"
1466 } 2743 }
1467 } 2744 }
1468 2745
1469 2746
1470 ################################################## 2747 ##################################################
1471 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # 2748 # FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1472 ################################################## 2749 ##################################################
1473 2750
1474 # func_convert_core_file_wine_to_w32 ARG 2751 # func_convert_core_file_wine_to_w32 ARG
1475 # Helper function used by file name conversion functions when $build is *nix, 2752 # Helper function used by file name conversion functions when $build is *nix,
1476 # and $host is mingw, cygwin, or some other w32 environment. Relies on a 2753 # and $host is mingw, cygwin, or some other w32 environment. Relies on a
1477 # correctly configured wine environment available, with the winepath program 2754 # correctly configured wine environment available, with the winepath program
1478 # in $build's $PATH. 2755 # in $build's $PATH.
1479 # 2756 #
1480 # ARG is the $build file name to be converted to w32 format. 2757 # ARG is the $build file name to be converted to w32 format.
1481 # Result is available in $func_convert_core_file_wine_to_w32_result, and will 2758 # Result is available in $func_convert_core_file_wine_to_w32_result, and will
1482 # be empty on error (or when ARG is empty) 2759 # be empty on error (or when ARG is empty)
1483 func_convert_core_file_wine_to_w32 () 2760 func_convert_core_file_wine_to_w32 ()
1484 { 2761 {
1485 $opt_debug 2762 $debug_cmd
1486 func_convert_core_file_wine_to_w32_result="$1" 2763
2764 func_convert_core_file_wine_to_w32_result=$1
1487 if test -n "$1"; then 2765 if test -n "$1"; then
1488 # Unfortunately, winepath does not exit with a non-zero error code, so we 2766 # Unfortunately, winepath does not exit with a non-zero error code, so we
1489 # are forced to check the contents of stdout. On the other hand, if the 2767 # are forced to check the contents of stdout. On the other hand, if the
1490 # command is not found, the shell will set an exit code of 127 and print 2768 # command is not found, the shell will set an exit code of 127 and print
1491 # *an error message* to stdout. So we must check for both error code of 2769 # *an error message* to stdout. So we must check for both error code of
1492 # zero AND non-empty stdout, which explains the odd construction: 2770 # zero AND non-empty stdout, which explains the odd construction:
1493 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` 2771 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1494 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; t hen 2772 if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; the n
1495 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_ wine_to_w32_tmp" | 2773 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_ wine_to_w32_tmp" |
1496 $SED -e "$lt_sed_naive_backslashify"` 2774 $SED -e "$sed_naive_backslashify"`
1497 else 2775 else
1498 func_convert_core_file_wine_to_w32_result= 2776 func_convert_core_file_wine_to_w32_result=
1499 fi 2777 fi
1500 fi 2778 fi
1501 } 2779 }
1502 # end: func_convert_core_file_wine_to_w32 2780 # end: func_convert_core_file_wine_to_w32
1503 2781
1504 2782
1505 # func_convert_core_path_wine_to_w32 ARG 2783 # func_convert_core_path_wine_to_w32 ARG
1506 # Helper function used by path conversion functions when $build is *nix, and 2784 # Helper function used by path conversion functions when $build is *nix, and
1507 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly 2785 # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1508 # configured wine environment available, with the winepath program in $build's 2786 # configured wine environment available, with the winepath program in $build's
1509 # $PATH. Assumes ARG has no leading or trailing path separator characters. 2787 # $PATH. Assumes ARG has no leading or trailing path separator characters.
1510 # 2788 #
1511 # ARG is path to be converted from $build format to win32. 2789 # ARG is path to be converted from $build format to win32.
1512 # Result is available in $func_convert_core_path_wine_to_w32_result. 2790 # Result is available in $func_convert_core_path_wine_to_w32_result.
1513 # Unconvertible file (directory) names in ARG are skipped; if no directory names 2791 # Unconvertible file (directory) names in ARG are skipped; if no directory names
1514 # are convertible, then the result may be empty. 2792 # are convertible, then the result may be empty.
1515 func_convert_core_path_wine_to_w32 () 2793 func_convert_core_path_wine_to_w32 ()
1516 { 2794 {
1517 $opt_debug 2795 $debug_cmd
2796
1518 # unfortunately, winepath doesn't convert paths, only file names 2797 # unfortunately, winepath doesn't convert paths, only file names
1519 func_convert_core_path_wine_to_w32_result="" 2798 func_convert_core_path_wine_to_w32_result=
1520 if test -n "$1"; then 2799 if test -n "$1"; then
1521 oldIFS=$IFS 2800 oldIFS=$IFS
1522 IFS=: 2801 IFS=:
1523 for func_convert_core_path_wine_to_w32_f in $1; do 2802 for func_convert_core_path_wine_to_w32_f in $1; do
1524 IFS=$oldIFS 2803 IFS=$oldIFS
1525 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" 2804 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1526 if test -n "$func_convert_core_file_wine_to_w32_result" ; then 2805 if test -n "$func_convert_core_file_wine_to_w32_result"; then
1527 if test -z "$func_convert_core_path_wine_to_w32_result"; then 2806 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1528 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_win e_to_w32_result" 2807 func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine _to_w32_result
1529 else 2808 else
1530 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_ core_file_wine_to_w32_result" 2809 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_ core_file_wine_to_w32_result"
1531 fi 2810 fi
1532 fi 2811 fi
1533 done 2812 done
1534 IFS=$oldIFS 2813 IFS=$oldIFS
1535 fi 2814 fi
1536 } 2815 }
1537 # end: func_convert_core_path_wine_to_w32 2816 # end: func_convert_core_path_wine_to_w32
1538 2817
1539 2818
1540 # func_cygpath ARGS... 2819 # func_cygpath ARGS...
1541 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when 2820 # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1542 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) 2821 # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1543 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or 2822 # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1544 # (2), returns the Cygwin file name or path in func_cygpath_result (input 2823 # (2), returns the Cygwin file name or path in func_cygpath_result (input
1545 # file name or path is assumed to be in w32 format, as previously converted 2824 # file name or path is assumed to be in w32 format, as previously converted
1546 # from $build's *nix or MSYS format). In case (3), returns the w32 file name 2825 # from $build's *nix or MSYS format). In case (3), returns the w32 file name
1547 # or path in func_cygpath_result (input file name or path is assumed to be in 2826 # or path in func_cygpath_result (input file name or path is assumed to be in
1548 # Cygwin format). Returns an empty string on error. 2827 # Cygwin format). Returns an empty string on error.
1549 # 2828 #
1550 # ARGS are passed to cygpath, with the last one being the file name or path to 2829 # ARGS are passed to cygpath, with the last one being the file name or path to
1551 # be converted. 2830 # be converted.
1552 # 2831 #
1553 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH 2832 # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1554 # environment variable; do not put it in $PATH. 2833 # environment variable; do not put it in $PATH.
1555 func_cygpath () 2834 func_cygpath ()
1556 { 2835 {
1557 $opt_debug 2836 $debug_cmd
2837
1558 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then 2838 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1559 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` 2839 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1560 if test "$?" -ne 0; then 2840 if test "$?" -ne 0; then
1561 # on failure, ensure result is empty 2841 # on failure, ensure result is empty
1562 func_cygpath_result= 2842 func_cygpath_result=
1563 fi 2843 fi
1564 else 2844 else
1565 func_cygpath_result= 2845 func_cygpath_result=
1566 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPAT H'" 2846 func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH '"
1567 fi 2847 fi
1568 } 2848 }
1569 #end: func_cygpath 2849 #end: func_cygpath
1570 2850
1571 2851
1572 # func_convert_core_msys_to_w32 ARG 2852 # func_convert_core_msys_to_w32 ARG
1573 # Convert file name or path ARG from MSYS format to w32 format. Return 2853 # Convert file name or path ARG from MSYS format to w32 format. Return
1574 # result in func_convert_core_msys_to_w32_result. 2854 # result in func_convert_core_msys_to_w32_result.
1575 func_convert_core_msys_to_w32 () 2855 func_convert_core_msys_to_w32 ()
1576 { 2856 {
1577 $opt_debug 2857 $debug_cmd
2858
1578 # awkward: cmd appends spaces to result 2859 # awkward: cmd appends spaces to result
1579 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | 2860 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1580 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` 2861 $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
1581 } 2862 }
1582 #end: func_convert_core_msys_to_w32 2863 #end: func_convert_core_msys_to_w32
1583 2864
1584 2865
1585 # func_convert_file_check ARG1 ARG2 2866 # func_convert_file_check ARG1 ARG2
1586 # Verify that ARG1 (a file name in $build format) was converted to $host 2867 # Verify that ARG1 (a file name in $build format) was converted to $host
1587 # format in ARG2. Otherwise, emit an error message, but continue (resetting 2868 # format in ARG2. Otherwise, emit an error message, but continue (resetting
1588 # func_to_host_file_result to ARG1). 2869 # func_to_host_file_result to ARG1).
1589 func_convert_file_check () 2870 func_convert_file_check ()
1590 { 2871 {
1591 $opt_debug 2872 $debug_cmd
1592 if test -z "$2" && test -n "$1" ; then 2873
2874 if test -z "$2" && test -n "$1"; then
1593 func_error "Could not determine host file name corresponding to" 2875 func_error "Could not determine host file name corresponding to"
1594 func_error " \`$1'" 2876 func_error " '$1'"
1595 func_error "Continuing, but uninstalled executables may not work." 2877 func_error "Continuing, but uninstalled executables may not work."
1596 # Fallback: 2878 # Fallback:
1597 func_to_host_file_result="$1" 2879 func_to_host_file_result=$1
1598 fi 2880 fi
1599 } 2881 }
1600 # end func_convert_file_check 2882 # end func_convert_file_check
1601 2883
1602 2884
1603 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH 2885 # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
1604 # Verify that FROM_PATH (a path in $build format) was converted to $host 2886 # Verify that FROM_PATH (a path in $build format) was converted to $host
1605 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting 2887 # format in TO_PATH. Otherwise, emit an error message, but continue, resetting
1606 # func_to_host_file_result to a simplistic fallback value (see below). 2888 # func_to_host_file_result to a simplistic fallback value (see below).
1607 func_convert_path_check () 2889 func_convert_path_check ()
1608 { 2890 {
1609 $opt_debug 2891 $debug_cmd
2892
1610 if test -z "$4" && test -n "$3"; then 2893 if test -z "$4" && test -n "$3"; then
1611 func_error "Could not determine the host path corresponding to" 2894 func_error "Could not determine the host path corresponding to"
1612 func_error " \`$3'" 2895 func_error " '$3'"
1613 func_error "Continuing, but uninstalled executables may not work." 2896 func_error "Continuing, but uninstalled executables may not work."
1614 # Fallback. This is a deliberately simplistic "conversion" and 2897 # Fallback. This is a deliberately simplistic "conversion" and
1615 # should not be "improved". See libtool.info. 2898 # should not be "improved". See libtool.info.
1616 if test "x$1" != "x$2"; then 2899 if test "x$1" != "x$2"; then
1617 lt_replace_pathsep_chars="s|$1|$2|g" 2900 lt_replace_pathsep_chars="s|$1|$2|g"
1618 func_to_host_path_result=`echo "$3" | 2901 func_to_host_path_result=`echo "$3" |
1619 $SED -e "$lt_replace_pathsep_chars"` 2902 $SED -e "$lt_replace_pathsep_chars"`
1620 else 2903 else
1621 func_to_host_path_result="$3" 2904 func_to_host_path_result=$3
1622 fi 2905 fi
1623 fi 2906 fi
1624 } 2907 }
1625 # end func_convert_path_check 2908 # end func_convert_path_check
1626 2909
1627 2910
1628 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG 2911 # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
1629 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT 2912 # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
1630 # and appending REPL if ORIG matches BACKPAT. 2913 # and appending REPL if ORIG matches BACKPAT.
1631 func_convert_path_front_back_pathsep () 2914 func_convert_path_front_back_pathsep ()
1632 { 2915 {
1633 $opt_debug 2916 $debug_cmd
2917
1634 case $4 in 2918 case $4 in
1635 $1 ) func_to_host_path_result="$3$func_to_host_path_result" 2919 $1 ) func_to_host_path_result=$3$func_to_host_path_result
1636 ;; 2920 ;;
1637 esac 2921 esac
1638 case $4 in 2922 case $4 in
1639 $2 ) func_append func_to_host_path_result "$3" 2923 $2 ) func_append func_to_host_path_result "$3"
1640 ;; 2924 ;;
1641 esac 2925 esac
1642 } 2926 }
1643 # end func_convert_path_front_back_pathsep 2927 # end func_convert_path_front_back_pathsep
1644 2928
1645 2929
1646 ################################################## 2930 ##################################################
1647 # $build to $host FILE NAME CONVERSION FUNCTIONS # 2931 # $build to $host FILE NAME CONVERSION FUNCTIONS #
1648 ################################################## 2932 ##################################################
1649 # invoked via `$to_host_file_cmd ARG' 2933 # invoked via '$to_host_file_cmd ARG'
1650 # 2934 #
1651 # In each case, ARG is the path to be converted from $build to $host format. 2935 # In each case, ARG is the path to be converted from $build to $host format.
1652 # Result will be available in $func_to_host_file_result. 2936 # Result will be available in $func_to_host_file_result.
1653 2937
1654 2938
1655 # func_to_host_file ARG 2939 # func_to_host_file ARG
1656 # Converts the file name ARG from $build format to $host format. Return result 2940 # Converts the file name ARG from $build format to $host format. Return result
1657 # in func_to_host_file_result. 2941 # in func_to_host_file_result.
1658 func_to_host_file () 2942 func_to_host_file ()
1659 { 2943 {
1660 $opt_debug 2944 $debug_cmd
2945
1661 $to_host_file_cmd "$1" 2946 $to_host_file_cmd "$1"
1662 } 2947 }
1663 # end func_to_host_file 2948 # end func_to_host_file
1664 2949
1665 2950
1666 # func_to_tool_file ARG LAZY 2951 # func_to_tool_file ARG LAZY
1667 # converts the file name ARG from $build format to toolchain format. Return 2952 # converts the file name ARG from $build format to toolchain format. Return
1668 # result in func_to_tool_file_result. If the conversion in use is listed 2953 # result in func_to_tool_file_result. If the conversion in use is listed
1669 # in (the comma separated) LAZY, no conversion takes place. 2954 # in (the comma separated) LAZY, no conversion takes place.
1670 func_to_tool_file () 2955 func_to_tool_file ()
1671 { 2956 {
1672 $opt_debug 2957 $debug_cmd
2958
1673 case ,$2, in 2959 case ,$2, in
1674 *,"$to_tool_file_cmd",*) 2960 *,"$to_tool_file_cmd",*)
1675 func_to_tool_file_result=$1 2961 func_to_tool_file_result=$1
1676 ;; 2962 ;;
1677 *) 2963 *)
1678 $to_tool_file_cmd "$1" 2964 $to_tool_file_cmd "$1"
1679 func_to_tool_file_result=$func_to_host_file_result 2965 func_to_tool_file_result=$func_to_host_file_result
1680 ;; 2966 ;;
1681 esac 2967 esac
1682 } 2968 }
1683 # end func_to_tool_file 2969 # end func_to_tool_file
1684 2970
1685 2971
1686 # func_convert_file_noop ARG 2972 # func_convert_file_noop ARG
1687 # Copy ARG to func_to_host_file_result. 2973 # Copy ARG to func_to_host_file_result.
1688 func_convert_file_noop () 2974 func_convert_file_noop ()
1689 { 2975 {
1690 func_to_host_file_result="$1" 2976 func_to_host_file_result=$1
1691 } 2977 }
1692 # end func_convert_file_noop 2978 # end func_convert_file_noop
1693 2979
1694 2980
1695 # func_convert_file_msys_to_w32 ARG 2981 # func_convert_file_msys_to_w32 ARG
1696 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic 2982 # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
1697 # conversion to w32 is not available inside the cwrapper. Returns result in 2983 # conversion to w32 is not available inside the cwrapper. Returns result in
1698 # func_to_host_file_result. 2984 # func_to_host_file_result.
1699 func_convert_file_msys_to_w32 () 2985 func_convert_file_msys_to_w32 ()
1700 { 2986 {
1701 $opt_debug 2987 $debug_cmd
1702 func_to_host_file_result="$1" 2988
2989 func_to_host_file_result=$1
1703 if test -n "$1"; then 2990 if test -n "$1"; then
1704 func_convert_core_msys_to_w32 "$1" 2991 func_convert_core_msys_to_w32 "$1"
1705 func_to_host_file_result="$func_convert_core_msys_to_w32_result" 2992 func_to_host_file_result=$func_convert_core_msys_to_w32_result
1706 fi 2993 fi
1707 func_convert_file_check "$1" "$func_to_host_file_result" 2994 func_convert_file_check "$1" "$func_to_host_file_result"
1708 } 2995 }
1709 # end func_convert_file_msys_to_w32 2996 # end func_convert_file_msys_to_w32
1710 2997
1711 2998
1712 # func_convert_file_cygwin_to_w32 ARG 2999 # func_convert_file_cygwin_to_w32 ARG
1713 # Convert file name ARG from Cygwin to w32 format. Returns result in 3000 # Convert file name ARG from Cygwin to w32 format. Returns result in
1714 # func_to_host_file_result. 3001 # func_to_host_file_result.
1715 func_convert_file_cygwin_to_w32 () 3002 func_convert_file_cygwin_to_w32 ()
1716 { 3003 {
1717 $opt_debug 3004 $debug_cmd
1718 func_to_host_file_result="$1" 3005
3006 func_to_host_file_result=$1
1719 if test -n "$1"; then 3007 if test -n "$1"; then
1720 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use 3008 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
1721 # LT_CYGPATH in this case. 3009 # LT_CYGPATH in this case.
1722 func_to_host_file_result=`cygpath -m "$1"` 3010 func_to_host_file_result=`cygpath -m "$1"`
1723 fi 3011 fi
1724 func_convert_file_check "$1" "$func_to_host_file_result" 3012 func_convert_file_check "$1" "$func_to_host_file_result"
1725 } 3013 }
1726 # end func_convert_file_cygwin_to_w32 3014 # end func_convert_file_cygwin_to_w32
1727 3015
1728 3016
1729 # func_convert_file_nix_to_w32 ARG 3017 # func_convert_file_nix_to_w32 ARG
1730 # Convert file name ARG from *nix to w32 format. Requires a wine environment 3018 # Convert file name ARG from *nix to w32 format. Requires a wine environment
1731 # and a working winepath. Returns result in func_to_host_file_result. 3019 # and a working winepath. Returns result in func_to_host_file_result.
1732 func_convert_file_nix_to_w32 () 3020 func_convert_file_nix_to_w32 ()
1733 { 3021 {
1734 $opt_debug 3022 $debug_cmd
1735 func_to_host_file_result="$1" 3023
3024 func_to_host_file_result=$1
1736 if test -n "$1"; then 3025 if test -n "$1"; then
1737 func_convert_core_file_wine_to_w32 "$1" 3026 func_convert_core_file_wine_to_w32 "$1"
1738 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" 3027 func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
1739 fi 3028 fi
1740 func_convert_file_check "$1" "$func_to_host_file_result" 3029 func_convert_file_check "$1" "$func_to_host_file_result"
1741 } 3030 }
1742 # end func_convert_file_nix_to_w32 3031 # end func_convert_file_nix_to_w32
1743 3032
1744 3033
1745 # func_convert_file_msys_to_cygwin ARG 3034 # func_convert_file_msys_to_cygwin ARG
1746 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. 3035 # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1747 # Returns result in func_to_host_file_result. 3036 # Returns result in func_to_host_file_result.
1748 func_convert_file_msys_to_cygwin () 3037 func_convert_file_msys_to_cygwin ()
1749 { 3038 {
1750 $opt_debug 3039 $debug_cmd
1751 func_to_host_file_result="$1" 3040
3041 func_to_host_file_result=$1
1752 if test -n "$1"; then 3042 if test -n "$1"; then
1753 func_convert_core_msys_to_w32 "$1" 3043 func_convert_core_msys_to_w32 "$1"
1754 func_cygpath -u "$func_convert_core_msys_to_w32_result" 3044 func_cygpath -u "$func_convert_core_msys_to_w32_result"
1755 func_to_host_file_result="$func_cygpath_result" 3045 func_to_host_file_result=$func_cygpath_result
1756 fi 3046 fi
1757 func_convert_file_check "$1" "$func_to_host_file_result" 3047 func_convert_file_check "$1" "$func_to_host_file_result"
1758 } 3048 }
1759 # end func_convert_file_msys_to_cygwin 3049 # end func_convert_file_msys_to_cygwin
1760 3050
1761 3051
1762 # func_convert_file_nix_to_cygwin ARG 3052 # func_convert_file_nix_to_cygwin ARG
1763 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed 3053 # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
1764 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result 3054 # in a wine environment, working winepath, and LT_CYGPATH set. Returns result
1765 # in func_to_host_file_result. 3055 # in func_to_host_file_result.
1766 func_convert_file_nix_to_cygwin () 3056 func_convert_file_nix_to_cygwin ()
1767 { 3057 {
1768 $opt_debug 3058 $debug_cmd
1769 func_to_host_file_result="$1" 3059
3060 func_to_host_file_result=$1
1770 if test -n "$1"; then 3061 if test -n "$1"; then
1771 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. 3062 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
1772 func_convert_core_file_wine_to_w32 "$1" 3063 func_convert_core_file_wine_to_w32 "$1"
1773 func_cygpath -u "$func_convert_core_file_wine_to_w32_result" 3064 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1774 func_to_host_file_result="$func_cygpath_result" 3065 func_to_host_file_result=$func_cygpath_result
1775 fi 3066 fi
1776 func_convert_file_check "$1" "$func_to_host_file_result" 3067 func_convert_file_check "$1" "$func_to_host_file_result"
1777 } 3068 }
1778 # end func_convert_file_nix_to_cygwin 3069 # end func_convert_file_nix_to_cygwin
1779 3070
1780 3071
1781 ############################################# 3072 #############################################
1782 # $build to $host PATH CONVERSION FUNCTIONS # 3073 # $build to $host PATH CONVERSION FUNCTIONS #
1783 ############################################# 3074 #############################################
1784 # invoked via `$to_host_path_cmd ARG' 3075 # invoked via '$to_host_path_cmd ARG'
1785 # 3076 #
1786 # In each case, ARG is the path to be converted from $build to $host format. 3077 # In each case, ARG is the path to be converted from $build to $host format.
1787 # The result will be available in $func_to_host_path_result. 3078 # The result will be available in $func_to_host_path_result.
1788 # 3079 #
1789 # Path separators are also converted from $build format to $host format. If 3080 # Path separators are also converted from $build format to $host format. If
1790 # ARG begins or ends with a path separator character, it is preserved (but 3081 # ARG begins or ends with a path separator character, it is preserved (but
1791 # converted to $host format) on output. 3082 # converted to $host format) on output.
1792 # 3083 #
1793 # All path conversion functions are named using the following convention: 3084 # All path conversion functions are named using the following convention:
1794 # file name conversion function : func_convert_file_X_to_Y () 3085 # file name conversion function : func_convert_file_X_to_Y ()
1795 # path conversion function : func_convert_path_X_to_Y () 3086 # path conversion function : func_convert_path_X_to_Y ()
1796 # where, for any given $build/$host combination the 'X_to_Y' value is the 3087 # where, for any given $build/$host combination the 'X_to_Y' value is the
1797 # same. If conversion functions are added for new $build/$host combinations, 3088 # same. If conversion functions are added for new $build/$host combinations,
1798 # the two new functions must follow this pattern, or func_init_to_host_path_cmd 3089 # the two new functions must follow this pattern, or func_init_to_host_path_cmd
1799 # will break. 3090 # will break.
1800 3091
1801 3092
1802 # func_init_to_host_path_cmd 3093 # func_init_to_host_path_cmd
1803 # Ensures that function "pointer" variable $to_host_path_cmd is set to the 3094 # Ensures that function "pointer" variable $to_host_path_cmd is set to the
1804 # appropriate value, based on the value of $to_host_file_cmd. 3095 # appropriate value, based on the value of $to_host_file_cmd.
1805 to_host_path_cmd= 3096 to_host_path_cmd=
1806 func_init_to_host_path_cmd () 3097 func_init_to_host_path_cmd ()
1807 { 3098 {
1808 $opt_debug 3099 $debug_cmd
3100
1809 if test -z "$to_host_path_cmd"; then 3101 if test -z "$to_host_path_cmd"; then
1810 func_stripname 'func_convert_file_' '' "$to_host_file_cmd" 3102 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1811 to_host_path_cmd="func_convert_path_${func_stripname_result}" 3103 to_host_path_cmd=func_convert_path_$func_stripname_result
1812 fi 3104 fi
1813 } 3105 }
1814 3106
1815 3107
1816 # func_to_host_path ARG 3108 # func_to_host_path ARG
1817 # Converts the path ARG from $build format to $host format. Return result 3109 # Converts the path ARG from $build format to $host format. Return result
1818 # in func_to_host_path_result. 3110 # in func_to_host_path_result.
1819 func_to_host_path () 3111 func_to_host_path ()
1820 { 3112 {
1821 $opt_debug 3113 $debug_cmd
3114
1822 func_init_to_host_path_cmd 3115 func_init_to_host_path_cmd
1823 $to_host_path_cmd "$1" 3116 $to_host_path_cmd "$1"
1824 } 3117 }
1825 # end func_to_host_path 3118 # end func_to_host_path
1826 3119
1827 3120
1828 # func_convert_path_noop ARG 3121 # func_convert_path_noop ARG
1829 # Copy ARG to func_to_host_path_result. 3122 # Copy ARG to func_to_host_path_result.
1830 func_convert_path_noop () 3123 func_convert_path_noop ()
1831 { 3124 {
1832 func_to_host_path_result="$1" 3125 func_to_host_path_result=$1
1833 } 3126 }
1834 # end func_convert_path_noop 3127 # end func_convert_path_noop
1835 3128
1836 3129
1837 # func_convert_path_msys_to_w32 ARG 3130 # func_convert_path_msys_to_w32 ARG
1838 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic 3131 # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
1839 # conversion to w32 is not available inside the cwrapper. Returns result in 3132 # conversion to w32 is not available inside the cwrapper. Returns result in
1840 # func_to_host_path_result. 3133 # func_to_host_path_result.
1841 func_convert_path_msys_to_w32 () 3134 func_convert_path_msys_to_w32 ()
1842 { 3135 {
1843 $opt_debug 3136 $debug_cmd
1844 func_to_host_path_result="$1" 3137
3138 func_to_host_path_result=$1
1845 if test -n "$1"; then 3139 if test -n "$1"; then
1846 # Remove leading and trailing path separator characters from ARG. MSYS 3140 # Remove leading and trailing path separator characters from ARG. MSYS
1847 # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; 3141 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
1848 # and winepath ignores them completely. 3142 # and winepath ignores them completely.
1849 func_stripname : : "$1" 3143 func_stripname : : "$1"
1850 func_to_host_path_tmp1=$func_stripname_result 3144 func_to_host_path_tmp1=$func_stripname_result
1851 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" 3145 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1852 func_to_host_path_result="$func_convert_core_msys_to_w32_result" 3146 func_to_host_path_result=$func_convert_core_msys_to_w32_result
1853 func_convert_path_check : ";" \ 3147 func_convert_path_check : ";" \
1854 "$func_to_host_path_tmp1" "$func_to_host_path_result" 3148 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1855 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" 3149 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1856 fi 3150 fi
1857 } 3151 }
1858 # end func_convert_path_msys_to_w32 3152 # end func_convert_path_msys_to_w32
1859 3153
1860 3154
1861 # func_convert_path_cygwin_to_w32 ARG 3155 # func_convert_path_cygwin_to_w32 ARG
1862 # Convert path ARG from Cygwin to w32 format. Returns result in 3156 # Convert path ARG from Cygwin to w32 format. Returns result in
1863 # func_to_host_file_result. 3157 # func_to_host_file_result.
1864 func_convert_path_cygwin_to_w32 () 3158 func_convert_path_cygwin_to_w32 ()
1865 { 3159 {
1866 $opt_debug 3160 $debug_cmd
1867 func_to_host_path_result="$1" 3161
3162 func_to_host_path_result=$1
1868 if test -n "$1"; then 3163 if test -n "$1"; then
1869 # See func_convert_path_msys_to_w32: 3164 # See func_convert_path_msys_to_w32:
1870 func_stripname : : "$1" 3165 func_stripname : : "$1"
1871 func_to_host_path_tmp1=$func_stripname_result 3166 func_to_host_path_tmp1=$func_stripname_result
1872 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` 3167 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
1873 func_convert_path_check : ";" \ 3168 func_convert_path_check : ";" \
1874 "$func_to_host_path_tmp1" "$func_to_host_path_result" 3169 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1875 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" 3170 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1876 fi 3171 fi
1877 } 3172 }
1878 # end func_convert_path_cygwin_to_w32 3173 # end func_convert_path_cygwin_to_w32
1879 3174
1880 3175
1881 # func_convert_path_nix_to_w32 ARG 3176 # func_convert_path_nix_to_w32 ARG
1882 # Convert path ARG from *nix to w32 format. Requires a wine environment and 3177 # Convert path ARG from *nix to w32 format. Requires a wine environment and
1883 # a working winepath. Returns result in func_to_host_file_result. 3178 # a working winepath. Returns result in func_to_host_file_result.
1884 func_convert_path_nix_to_w32 () 3179 func_convert_path_nix_to_w32 ()
1885 { 3180 {
1886 $opt_debug 3181 $debug_cmd
1887 func_to_host_path_result="$1" 3182
3183 func_to_host_path_result=$1
1888 if test -n "$1"; then 3184 if test -n "$1"; then
1889 # See func_convert_path_msys_to_w32: 3185 # See func_convert_path_msys_to_w32:
1890 func_stripname : : "$1" 3186 func_stripname : : "$1"
1891 func_to_host_path_tmp1=$func_stripname_result 3187 func_to_host_path_tmp1=$func_stripname_result
1892 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" 3188 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1893 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" 3189 func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
1894 func_convert_path_check : ";" \ 3190 func_convert_path_check : ";" \
1895 "$func_to_host_path_tmp1" "$func_to_host_path_result" 3191 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1896 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" 3192 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1897 fi 3193 fi
1898 } 3194 }
1899 # end func_convert_path_nix_to_w32 3195 # end func_convert_path_nix_to_w32
1900 3196
1901 3197
1902 # func_convert_path_msys_to_cygwin ARG 3198 # func_convert_path_msys_to_cygwin ARG
1903 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. 3199 # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
1904 # Returns result in func_to_host_file_result. 3200 # Returns result in func_to_host_file_result.
1905 func_convert_path_msys_to_cygwin () 3201 func_convert_path_msys_to_cygwin ()
1906 { 3202 {
1907 $opt_debug 3203 $debug_cmd
1908 func_to_host_path_result="$1" 3204
3205 func_to_host_path_result=$1
1909 if test -n "$1"; then 3206 if test -n "$1"; then
1910 # See func_convert_path_msys_to_w32: 3207 # See func_convert_path_msys_to_w32:
1911 func_stripname : : "$1" 3208 func_stripname : : "$1"
1912 func_to_host_path_tmp1=$func_stripname_result 3209 func_to_host_path_tmp1=$func_stripname_result
1913 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" 3210 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1914 func_cygpath -u -p "$func_convert_core_msys_to_w32_result" 3211 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1915 func_to_host_path_result="$func_cygpath_result" 3212 func_to_host_path_result=$func_cygpath_result
1916 func_convert_path_check : : \ 3213 func_convert_path_check : : \
1917 "$func_to_host_path_tmp1" "$func_to_host_path_result" 3214 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1918 func_convert_path_front_back_pathsep ":*" "*:" : "$1" 3215 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1919 fi 3216 fi
1920 } 3217 }
1921 # end func_convert_path_msys_to_cygwin 3218 # end func_convert_path_msys_to_cygwin
1922 3219
1923 3220
1924 # func_convert_path_nix_to_cygwin ARG 3221 # func_convert_path_nix_to_cygwin ARG
1925 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a 3222 # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
1926 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in 3223 # a wine environment, working winepath, and LT_CYGPATH set. Returns result in
1927 # func_to_host_file_result. 3224 # func_to_host_file_result.
1928 func_convert_path_nix_to_cygwin () 3225 func_convert_path_nix_to_cygwin ()
1929 { 3226 {
1930 $opt_debug 3227 $debug_cmd
1931 func_to_host_path_result="$1" 3228
3229 func_to_host_path_result=$1
1932 if test -n "$1"; then 3230 if test -n "$1"; then
1933 # Remove leading and trailing path separator characters from 3231 # Remove leading and trailing path separator characters from
1934 # ARG. msys behavior is inconsistent here, cygpath turns them 3232 # ARG. msys behavior is inconsistent here, cygpath turns them
1935 # into '.;' and ';.', and winepath ignores them completely. 3233 # into '.;' and ';.', and winepath ignores them completely.
1936 func_stripname : : "$1" 3234 func_stripname : : "$1"
1937 func_to_host_path_tmp1=$func_stripname_result 3235 func_to_host_path_tmp1=$func_stripname_result
1938 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" 3236 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1939 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" 3237 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1940 func_to_host_path_result="$func_cygpath_result" 3238 func_to_host_path_result=$func_cygpath_result
1941 func_convert_path_check : : \ 3239 func_convert_path_check : : \
1942 "$func_to_host_path_tmp1" "$func_to_host_path_result" 3240 "$func_to_host_path_tmp1" "$func_to_host_path_result"
1943 func_convert_path_front_back_pathsep ":*" "*:" : "$1" 3241 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1944 fi 3242 fi
1945 } 3243 }
1946 # end func_convert_path_nix_to_cygwin 3244 # end func_convert_path_nix_to_cygwin
1947 3245
1948 3246
3247 # func_dll_def_p FILE
3248 # True iff FILE is a Windows DLL '.def' file.
3249 # Keep in sync with _LT_DLL_DEF_P in libtool.m4
3250 func_dll_def_p ()
3251 {
3252 $debug_cmd
3253
3254 func_dll_def_p_tmp=`$SED -n \
3255 -e 's/^[ ]*//' \
3256 -e '/^\(;.*\)*$/d' \
3257 -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
3258 -e q \
3259 "$1"`
3260 test DEF = "$func_dll_def_p_tmp"
3261 }
3262
3263
1949 # func_mode_compile arg... 3264 # func_mode_compile arg...
1950 func_mode_compile () 3265 func_mode_compile ()
1951 { 3266 {
1952 $opt_debug 3267 $debug_cmd
3268
1953 # Get the compilation command and the source file. 3269 # Get the compilation command and the source file.
1954 base_compile= 3270 base_compile=
1955 srcfile="$nonopt" # always keep a non-empty value in "srcfile" 3271 srcfile=$nonopt # always keep a non-empty value in "srcfile"
1956 suppress_opt=yes 3272 suppress_opt=yes
1957 suppress_output= 3273 suppress_output=
1958 arg_mode=normal 3274 arg_mode=normal
1959 libobj= 3275 libobj=
1960 later= 3276 later=
1961 pie_flag= 3277 pie_flag=
1962 3278
1963 for arg 3279 for arg
1964 do 3280 do
1965 case $arg_mode in 3281 case $arg_mode in
1966 arg ) 3282 arg )
1967 # do not "continue". Instead, add this to base_compile 3283 # do not "continue". Instead, add this to base_compile
1968 » lastarg="$arg" 3284 » lastarg=$arg
1969 arg_mode=normal 3285 arg_mode=normal
1970 ;; 3286 ;;
1971 3287
1972 target ) 3288 target )
1973 » libobj="$arg" 3289 » libobj=$arg
1974 arg_mode=normal 3290 arg_mode=normal
1975 continue 3291 continue
1976 ;; 3292 ;;
1977 3293
1978 normal ) 3294 normal )
1979 # Accept any command-line options. 3295 # Accept any command-line options.
1980 case $arg in 3296 case $arg in
1981 -o) 3297 -o)
1982 test -n "$libobj" && \ 3298 test -n "$libobj" && \
1983 » func_fatal_error "you cannot specify \`-o' more than once" 3299 » func_fatal_error "you cannot specify '-o' more than once"
1984 arg_mode=target 3300 arg_mode=target
1985 continue 3301 continue
1986 ;; 3302 ;;
1987 3303
1988 -pie | -fpie | -fPIE) 3304 -pie | -fpie | -fPIE)
1989 func_append pie_flag " $arg" 3305 func_append pie_flag " $arg"
1990 continue 3306 continue
1991 ;; 3307 ;;
1992 3308
1993 -shared | -static | -prefer-pic | -prefer-non-pic) 3309 -shared | -static | -prefer-pic | -prefer-non-pic)
1994 func_append later " $arg" 3310 func_append later " $arg"
1995 continue 3311 continue
1996 ;; 3312 ;;
1997 3313
1998 -no-suppress) 3314 -no-suppress)
1999 suppress_opt=no 3315 suppress_opt=no
2000 continue 3316 continue
2001 ;; 3317 ;;
2002 3318
2003 -Xcompiler) 3319 -Xcompiler)
2004 arg_mode=arg # the next one goes into the "base_compile" arg list 3320 arg_mode=arg # the next one goes into the "base_compile" arg list
2005 continue # The current "srcfile" will either be retained or 3321 continue # The current "srcfile" will either be retained or
2006 ;; # replaced later. I would guess that would be a bug. 3322 ;; # replaced later. I would guess that would be a bug.
2007 3323
2008 -Wc,*) 3324 -Wc,*)
2009 func_stripname '-Wc,' '' "$arg" 3325 func_stripname '-Wc,' '' "$arg"
2010 args=$func_stripname_result 3326 args=$func_stripname_result
2011 lastarg= 3327 lastarg=
2012 » save_ifs="$IFS"; IFS=',' 3328 » save_ifs=$IFS; IFS=,
2013 for arg in $args; do 3329 for arg in $args; do
2014 » IFS="$save_ifs" 3330 » IFS=$save_ifs
2015 func_append_quoted lastarg "$arg" 3331 func_append_quoted lastarg "$arg"
2016 done 3332 done
2017 » IFS="$save_ifs" 3333 » IFS=$save_ifs
2018 func_stripname ' ' '' "$lastarg" 3334 func_stripname ' ' '' "$lastarg"
2019 lastarg=$func_stripname_result 3335 lastarg=$func_stripname_result
2020 3336
2021 # Add the arguments to base_compile. 3337 # Add the arguments to base_compile.
2022 func_append base_compile " $lastarg" 3338 func_append base_compile " $lastarg"
2023 continue 3339 continue
2024 ;; 3340 ;;
2025 3341
2026 *) 3342 *)
2027 # Accept the current argument as the source file. 3343 # Accept the current argument as the source file.
2028 # The previous "srcfile" becomes the current argument. 3344 # The previous "srcfile" becomes the current argument.
2029 # 3345 #
2030 » lastarg="$srcfile" 3346 » lastarg=$srcfile
2031 » srcfile="$arg" 3347 » srcfile=$arg
2032 ;; 3348 ;;
2033 esac # case $arg 3349 esac # case $arg
2034 ;; 3350 ;;
2035 esac # case $arg_mode 3351 esac # case $arg_mode
2036 3352
2037 # Aesthetically quote the previous argument. 3353 # Aesthetically quote the previous argument.
2038 func_append_quoted base_compile "$lastarg" 3354 func_append_quoted base_compile "$lastarg"
2039 done # for arg 3355 done # for arg
2040 3356
2041 case $arg_mode in 3357 case $arg_mode in
2042 arg) 3358 arg)
2043 func_fatal_error "you must specify an argument for -Xcompile" 3359 func_fatal_error "you must specify an argument for -Xcompile"
2044 ;; 3360 ;;
2045 target) 3361 target)
2046 func_fatal_error "you must specify a target with \`-o'" 3362 func_fatal_error "you must specify a target with '-o'"
2047 ;; 3363 ;;
2048 *) 3364 *)
2049 # Get the name of the library object. 3365 # Get the name of the library object.
2050 test -z "$libobj" && { 3366 test -z "$libobj" && {
2051 func_basename "$srcfile" 3367 func_basename "$srcfile"
2052 » libobj="$func_basename_result" 3368 » libobj=$func_basename_result
2053 } 3369 }
2054 ;; 3370 ;;
2055 esac 3371 esac
2056 3372
2057 # Recognize several different file suffixes. 3373 # Recognize several different file suffixes.
2058 # If the user specifies -o file.o, it is replaced with file.lo 3374 # If the user specifies -o file.o, it is replaced with file.lo
2059 case $libobj in 3375 case $libobj in
2060 *.[cCFSifmso] | \ 3376 *.[cCFSifmso] | \
2061 *.ada | *.adb | *.ads | *.asm | \ 3377 *.ada | *.adb | *.ads | *.asm | \
2062 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ 3378 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
2063 *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) 3379 *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
2064 func_xform "$libobj" 3380 func_xform "$libobj"
2065 libobj=$func_xform_result 3381 libobj=$func_xform_result
2066 ;; 3382 ;;
2067 esac 3383 esac
2068 3384
2069 case $libobj in 3385 case $libobj in
2070 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; 3386 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2071 *) 3387 *)
2072 func_fatal_error "cannot determine name of library object from \`$libobj'" 3388 func_fatal_error "cannot determine name of library object from '$libobj'"
2073 ;; 3389 ;;
2074 esac 3390 esac
2075 3391
2076 func_infer_tag $base_compile 3392 func_infer_tag $base_compile
2077 3393
2078 for arg in $later; do 3394 for arg in $later; do
2079 case $arg in 3395 case $arg in
2080 -shared) 3396 -shared)
2081 » test "$build_libtool_libs" != yes && \ 3397 » test yes = "$build_libtool_libs" \
2082 » func_fatal_configuration "can not build a shared library" 3398 » || func_fatal_configuration "cannot build a shared library"
2083 build_old_libs=no 3399 build_old_libs=no
2084 continue 3400 continue
2085 ;; 3401 ;;
2086 3402
2087 -static) 3403 -static)
2088 build_libtool_libs=no 3404 build_libtool_libs=no
2089 build_old_libs=yes 3405 build_old_libs=yes
2090 continue 3406 continue
2091 ;; 3407 ;;
2092 3408
2093 -prefer-pic) 3409 -prefer-pic)
2094 pic_mode=yes 3410 pic_mode=yes
2095 continue 3411 continue
2096 ;; 3412 ;;
2097 3413
2098 -prefer-non-pic) 3414 -prefer-non-pic)
2099 pic_mode=no 3415 pic_mode=no
2100 continue 3416 continue
2101 ;; 3417 ;;
2102 esac 3418 esac
2103 done 3419 done
2104 3420
2105 func_quote_for_eval "$libobj" 3421 func_quote_for_eval "$libobj"
2106 test "X$libobj" != "X$func_quote_for_eval_result" \ 3422 test "X$libobj" != "X$func_quote_for_eval_result" \
2107 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ 3423 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2108 && func_warning "libobj name \`$libobj' may not contain shell special char acters." 3424 && func_warning "libobj name '$libobj' may not contain shell special chara cters."
2109 func_dirname_and_basename "$obj" "/" "" 3425 func_dirname_and_basename "$obj" "/" ""
2110 objname="$func_basename_result" 3426 objname=$func_basename_result
2111 xdir="$func_dirname_result" 3427 xdir=$func_dirname_result
2112 lobj=${xdir}$objdir/$objname 3428 lobj=$xdir$objdir/$objname
2113 3429
2114 test -z "$base_compile" && \ 3430 test -z "$base_compile" && \
2115 func_fatal_help "you must specify a compilation command" 3431 func_fatal_help "you must specify a compilation command"
2116 3432
2117 # Delete any leftover library objects. 3433 # Delete any leftover library objects.
2118 if test "$build_old_libs" = yes; then 3434 if test yes = "$build_old_libs"; then
2119 removelist="$obj $lobj $libobj ${libobj}T" 3435 removelist="$obj $lobj $libobj ${libobj}T"
2120 else 3436 else
2121 removelist="$lobj $libobj ${libobj}T" 3437 removelist="$lobj $libobj ${libobj}T"
2122 fi 3438 fi
2123 3439
2124 # On Cygwin there's no "real" PIC flag so we must build both object types 3440 # On Cygwin there's no "real" PIC flag so we must build both object types
2125 case $host_os in 3441 case $host_os in
2126 cygwin* | mingw* | pw32* | os2* | cegcc*) 3442 cygwin* | mingw* | pw32* | os2* | cegcc*)
2127 pic_mode=default 3443 pic_mode=default
2128 ;; 3444 ;;
2129 esac 3445 esac
2130 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then 3446 if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
2131 # non-PIC code in shared libraries is not supported 3447 # non-PIC code in shared libraries is not supported
2132 pic_mode=default 3448 pic_mode=default
2133 fi 3449 fi
2134 3450
2135 # Calculate the filename of the output object if compiler does 3451 # Calculate the filename of the output object if compiler does
2136 # not support -o with -c 3452 # not support -o with -c
2137 if test "$compiler_c_o" = no; then 3453 if test no = "$compiler_c_o"; then
2138 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} 3454 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
2139 lockfile="$output_obj.lock" 3455 lockfile=$output_obj.lock
2140 else 3456 else
2141 output_obj= 3457 output_obj=
2142 need_locks=no 3458 need_locks=no
2143 lockfile= 3459 lockfile=
2144 fi 3460 fi
2145 3461
2146 # Lock this critical section if it is needed 3462 # Lock this critical section if it is needed
2147 # We use this script file to make the link, it avoids creating a new file 3463 # We use this script file to make the link, it avoids creating a new file
2148 if test "$need_locks" = yes; then 3464 if test yes = "$need_locks"; then
2149 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do 3465 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2150 func_echo "Waiting for $lockfile to be removed" 3466 func_echo "Waiting for $lockfile to be removed"
2151 sleep 2 3467 sleep 2
2152 done 3468 done
2153 elif test "$need_locks" = warn; then 3469 elif test warn = "$need_locks"; then
2154 if test -f "$lockfile"; then 3470 if test -f "$lockfile"; then
2155 $ECHO "\ 3471 $ECHO "\
2156 *** ERROR, $lockfile exists and contains: 3472 *** ERROR, $lockfile exists and contains:
2157 `cat $lockfile 2>/dev/null` 3473 `cat $lockfile 2>/dev/null`
2158 3474
2159 This indicates that another process is trying to use the same 3475 This indicates that another process is trying to use the same
2160 temporary object file, and libtool could not work around it because 3476 temporary object file, and libtool could not work around it because
2161 your compiler does not support \`-c' and \`-o' together. If you 3477 your compiler does not support '-c' and '-o' together. If you
2162 repeat this compilation, it may succeed, by chance, but you had better 3478 repeat this compilation, it may succeed, by chance, but you had better
2163 avoid parallel builds (make -j) in this platform, or get a better 3479 avoid parallel builds (make -j) in this platform, or get a better
2164 compiler." 3480 compiler."
2165 3481
2166 $opt_dry_run || $RM $removelist 3482 $opt_dry_run || $RM $removelist
2167 exit $EXIT_FAILURE 3483 exit $EXIT_FAILURE
2168 fi 3484 fi
2169 func_append removelist " $output_obj" 3485 func_append removelist " $output_obj"
2170 $ECHO "$srcfile" > "$lockfile" 3486 $ECHO "$srcfile" > "$lockfile"
2171 fi 3487 fi
2172 3488
2173 $opt_dry_run || $RM $removelist 3489 $opt_dry_run || $RM $removelist
2174 func_append removelist " $lockfile" 3490 func_append removelist " $lockfile"
2175 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 3491 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2176 3492
2177 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 3493 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2178 srcfile=$func_to_tool_file_result 3494 srcfile=$func_to_tool_file_result
2179 func_quote_for_eval "$srcfile" 3495 func_quote_for_eval "$srcfile"
2180 qsrcfile=$func_quote_for_eval_result 3496 qsrcfile=$func_quote_for_eval_result
2181 3497
2182 # Only build a PIC object if we are building libtool libraries. 3498 # Only build a PIC object if we are building libtool libraries.
2183 if test "$build_libtool_libs" = yes; then 3499 if test yes = "$build_libtool_libs"; then
2184 # Without this assignment, base_compile gets emptied. 3500 # Without this assignment, base_compile gets emptied.
2185 fbsd_hideous_sh_bug=$base_compile 3501 fbsd_hideous_sh_bug=$base_compile
2186 3502
2187 if test "$pic_mode" != no; then 3503 if test no != "$pic_mode"; then
2188 command="$base_compile $qsrcfile $pic_flag" 3504 command="$base_compile $qsrcfile $pic_flag"
2189 else 3505 else
2190 # Don't build PIC code 3506 # Don't build PIC code
2191 command="$base_compile $qsrcfile" 3507 command="$base_compile $qsrcfile"
2192 fi 3508 fi
2193 3509
2194 func_mkdir_p "$xdir$objdir" 3510 func_mkdir_p "$xdir$objdir"
2195 3511
2196 if test -z "$output_obj"; then 3512 if test -z "$output_obj"; then
2197 # Place PIC objects in $objdir 3513 # Place PIC objects in $objdir
2198 func_append command " -o $lobj" 3514 func_append command " -o $lobj"
2199 fi 3515 fi
2200 3516
2201 func_show_eval_locale "$command" \ 3517 func_show_eval_locale "$command" \
2202 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' 3518 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2203 3519
2204 if test "$need_locks" = warn && 3520 if test warn = "$need_locks" &&
2205 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 3521 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2206 $ECHO "\ 3522 $ECHO "\
2207 *** ERROR, $lockfile contains: 3523 *** ERROR, $lockfile contains:
2208 `cat $lockfile 2>/dev/null` 3524 `cat $lockfile 2>/dev/null`
2209 3525
2210 but it should contain: 3526 but it should contain:
2211 $srcfile 3527 $srcfile
2212 3528
2213 This indicates that another process is trying to use the same 3529 This indicates that another process is trying to use the same
2214 temporary object file, and libtool could not work around it because 3530 temporary object file, and libtool could not work around it because
2215 your compiler does not support \`-c' and \`-o' together. If you 3531 your compiler does not support '-c' and '-o' together. If you
2216 repeat this compilation, it may succeed, by chance, but you had better 3532 repeat this compilation, it may succeed, by chance, but you had better
2217 avoid parallel builds (make -j) in this platform, or get a better 3533 avoid parallel builds (make -j) in this platform, or get a better
2218 compiler." 3534 compiler."
2219 3535
2220 $opt_dry_run || $RM $removelist 3536 $opt_dry_run || $RM $removelist
2221 exit $EXIT_FAILURE 3537 exit $EXIT_FAILURE
2222 fi 3538 fi
2223 3539
2224 # Just move the object if needed, then go on to compile the next one 3540 # Just move the object if needed, then go on to compile the next one
2225 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then 3541 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2226 func_show_eval '$MV "$output_obj" "$lobj"' \ 3542 func_show_eval '$MV "$output_obj" "$lobj"' \
2227 'error=$?; $opt_dry_run || $RM $removelist; exit $error' 3543 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2228 fi 3544 fi
2229 3545
2230 # Allow error messages only from the first compilation. 3546 # Allow error messages only from the first compilation.
2231 if test "$suppress_opt" = yes; then 3547 if test yes = "$suppress_opt"; then
2232 suppress_output=' >/dev/null 2>&1' 3548 suppress_output=' >/dev/null 2>&1'
2233 fi 3549 fi
2234 fi 3550 fi
2235 3551
2236 # Only build a position-dependent object if we build old libraries. 3552 # Only build a position-dependent object if we build old libraries.
2237 if test "$build_old_libs" = yes; then 3553 if test yes = "$build_old_libs"; then
2238 if test "$pic_mode" != yes; then 3554 if test yes != "$pic_mode"; then
2239 # Don't build PIC code 3555 # Don't build PIC code
2240 command="$base_compile $qsrcfile$pie_flag" 3556 command="$base_compile $qsrcfile$pie_flag"
2241 else 3557 else
2242 command="$base_compile $qsrcfile $pic_flag" 3558 command="$base_compile $qsrcfile $pic_flag"
2243 fi 3559 fi
2244 if test "$compiler_c_o" = yes; then 3560 if test yes = "$compiler_c_o"; then
2245 func_append command " -o $obj" 3561 func_append command " -o $obj"
2246 fi 3562 fi
2247 3563
2248 # Suppress compiler output if we already did a PIC compilation. 3564 # Suppress compiler output if we already did a PIC compilation.
2249 func_append command "$suppress_output" 3565 func_append command "$suppress_output"
2250 func_show_eval_locale "$command" \ 3566 func_show_eval_locale "$command" \
2251 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 3567 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2252 3568
2253 if test "$need_locks" = warn && 3569 if test warn = "$need_locks" &&
2254 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then 3570 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2255 $ECHO "\ 3571 $ECHO "\
2256 *** ERROR, $lockfile contains: 3572 *** ERROR, $lockfile contains:
2257 `cat $lockfile 2>/dev/null` 3573 `cat $lockfile 2>/dev/null`
2258 3574
2259 but it should contain: 3575 but it should contain:
2260 $srcfile 3576 $srcfile
2261 3577
2262 This indicates that another process is trying to use the same 3578 This indicates that another process is trying to use the same
2263 temporary object file, and libtool could not work around it because 3579 temporary object file, and libtool could not work around it because
2264 your compiler does not support \`-c' and \`-o' together. If you 3580 your compiler does not support '-c' and '-o' together. If you
2265 repeat this compilation, it may succeed, by chance, but you had better 3581 repeat this compilation, it may succeed, by chance, but you had better
2266 avoid parallel builds (make -j) in this platform, or get a better 3582 avoid parallel builds (make -j) in this platform, or get a better
2267 compiler." 3583 compiler."
2268 3584
2269 $opt_dry_run || $RM $removelist 3585 $opt_dry_run || $RM $removelist
2270 exit $EXIT_FAILURE 3586 exit $EXIT_FAILURE
2271 fi 3587 fi
2272 3588
2273 # Just move the object if needed 3589 # Just move the object if needed
2274 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then 3590 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2275 func_show_eval '$MV "$output_obj" "$obj"' \ 3591 func_show_eval '$MV "$output_obj" "$obj"' \
2276 'error=$?; $opt_dry_run || $RM $removelist; exit $error' 3592 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2277 fi 3593 fi
2278 fi 3594 fi
2279 3595
2280 $opt_dry_run || { 3596 $opt_dry_run || {
2281 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" 3597 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2282 3598
2283 # Unlock the critical section if it was locked 3599 # Unlock the critical section if it was locked
2284 if test "$need_locks" != no; then 3600 if test no != "$need_locks"; then
2285 removelist=$lockfile 3601 removelist=$lockfile
2286 $RM "$lockfile" 3602 $RM "$lockfile"
2287 fi 3603 fi
2288 } 3604 }
2289 3605
2290 exit $EXIT_SUCCESS 3606 exit $EXIT_SUCCESS
2291 } 3607 }
2292 3608
2293 $opt_help || { 3609 $opt_help || {
2294 test "$opt_mode" = compile && func_mode_compile ${1+"$@"} 3610 test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
2295 } 3611 }
2296 3612
2297 func_mode_help () 3613 func_mode_help ()
2298 { 3614 {
2299 # We need to display help for each of the modes. 3615 # We need to display help for each of the modes.
2300 case $opt_mode in 3616 case $opt_mode in
2301 "") 3617 "")
2302 # Generic help is extracted from the usage comments 3618 # Generic help is extracted from the usage comments
2303 # at the start of this file. 3619 # at the start of this file.
2304 func_help 3620 func_help
2305 ;; 3621 ;;
2306 3622
2307 clean) 3623 clean)
2308 $ECHO \ 3624 $ECHO \
2309 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... 3625 "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2310 3626
2311 Remove files from the build directory. 3627 Remove files from the build directory.
2312 3628
2313 RM is the name of the program to use to delete files associated with each FILE 3629 RM is the name of the program to use to delete files associated with each FILE
2314 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 3630 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
2315 to RM. 3631 to RM.
2316 3632
2317 If FILE is a libtool library, object or program, all the files associated 3633 If FILE is a libtool library, object or program, all the files associated
2318 with it are deleted. Otherwise, only FILE itself is deleted using RM." 3634 with it are deleted. Otherwise, only FILE itself is deleted using RM."
2319 ;; 3635 ;;
2320 3636
2321 compile) 3637 compile)
2322 $ECHO \ 3638 $ECHO \
2323 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE 3639 "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2324 3640
2325 Compile a source file into a libtool library object. 3641 Compile a source file into a libtool library object.
2326 3642
2327 This mode accepts the following additional options: 3643 This mode accepts the following additional options:
2328 3644
2329 -o OUTPUT-FILE set the output file name to OUTPUT-FILE 3645 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2330 -no-suppress do not suppress compiler output for multiple passes 3646 -no-suppress do not suppress compiler output for multiple passes
2331 -prefer-pic try to build PIC objects only 3647 -prefer-pic try to build PIC objects only
2332 -prefer-non-pic try to build non-PIC objects only 3648 -prefer-non-pic try to build non-PIC objects only
2333 -shared do not build a \`.o' file suitable for static linking 3649 -shared do not build a '.o' file suitable for static linking
2334 -static only build a \`.o' file suitable for static linking 3650 -static only build a '.o' file suitable for static linking
2335 -Wc,FLAG pass FLAG directly to the compiler 3651 -Wc,FLAG pass FLAG directly to the compiler
2336 3652
2337 COMPILE-COMMAND is a command to be used in creating a \`standard' object file 3653 COMPILE-COMMAND is a command to be used in creating a 'standard' object file
2338 from the given SOURCEFILE. 3654 from the given SOURCEFILE.
2339 3655
2340 The output file name is determined by removing the directory component from 3656 The output file name is determined by removing the directory component from
2341 SOURCEFILE, then substituting the C source code suffix \`.c' with the 3657 SOURCEFILE, then substituting the C source code suffix '.c' with the
2342 library object suffix, \`.lo'." 3658 library object suffix, '.lo'."
2343 ;; 3659 ;;
2344 3660
2345 execute) 3661 execute)
2346 $ECHO \ 3662 $ECHO \
2347 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... 3663 "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2348 3664
2349 Automatically set library path, then run a program. 3665 Automatically set library path, then run a program.
2350 3666
2351 This mode accepts the following additional options: 3667 This mode accepts the following additional options:
2352 3668
2353 -dlopen FILE add the directory containing FILE to the library path 3669 -dlopen FILE add the directory containing FILE to the library path
2354 3670
2355 This mode sets the library path environment variable according to \`-dlopen' 3671 This mode sets the library path environment variable according to '-dlopen'
2356 flags. 3672 flags.
2357 3673
2358 If any of the ARGS are libtool executable wrappers, then they are translated 3674 If any of the ARGS are libtool executable wrappers, then they are translated
2359 into their corresponding uninstalled binary, and any of their required library 3675 into their corresponding uninstalled binary, and any of their required library
2360 directories are added to the library path. 3676 directories are added to the library path.
2361 3677
2362 Then, COMMAND is executed, with ARGS as arguments." 3678 Then, COMMAND is executed, with ARGS as arguments."
2363 ;; 3679 ;;
2364 3680
2365 finish) 3681 finish)
2366 $ECHO \ 3682 $ECHO \
2367 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... 3683 "Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2368 3684
2369 Complete the installation of libtool libraries. 3685 Complete the installation of libtool libraries.
2370 3686
2371 Each LIBDIR is a directory that contains libtool libraries. 3687 Each LIBDIR is a directory that contains libtool libraries.
2372 3688
2373 The commands that this mode executes may require superuser privileges. Use 3689 The commands that this mode executes may require superuser privileges. Use
2374 the \`--dry-run' option if you just want to see what would be executed." 3690 the '--dry-run' option if you just want to see what would be executed."
2375 ;; 3691 ;;
2376 3692
2377 install) 3693 install)
2378 $ECHO \ 3694 $ECHO \
2379 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... 3695 "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2380 3696
2381 Install executables or libraries. 3697 Install executables or libraries.
2382 3698
2383 INSTALL-COMMAND is the installation command. The first component should be 3699 INSTALL-COMMAND is the installation command. The first component should be
2384 either the \`install' or \`cp' program. 3700 either the 'install' or 'cp' program.
2385 3701
2386 The following components of INSTALL-COMMAND are treated specially: 3702 The following components of INSTALL-COMMAND are treated specially:
2387 3703
2388 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation 3704 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2389 3705
2390 The rest of the components are interpreted as arguments to that command (only 3706 The rest of the components are interpreted as arguments to that command (only
2391 BSD-compatible install options are recognized)." 3707 BSD-compatible install options are recognized)."
2392 ;; 3708 ;;
2393 3709
2394 link) 3710 link)
2395 $ECHO \ 3711 $ECHO \
2396 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... 3712 "Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2397 3713
2398 Link object files or libraries together to form another library, or to 3714 Link object files or libraries together to form another library, or to
2399 create an executable program. 3715 create an executable program.
2400 3716
2401 LINK-COMMAND is a command using the C compiler that you would use to create 3717 LINK-COMMAND is a command using the C compiler that you would use to create
2402 a program from several object files. 3718 a program from several object files.
2403 3719
2404 The following components of LINK-COMMAND are treated specially: 3720 The following components of LINK-COMMAND are treated specially:
2405 3721
2406 -all-static do not do any dynamic linking at all 3722 -all-static do not do any dynamic linking at all
2407 -avoid-version do not add a version suffix if possible 3723 -avoid-version do not add a version suffix if possible
2408 -bindir BINDIR specify path to binaries directory (for systems where 3724 -bindir BINDIR specify path to binaries directory (for systems where
2409 libraries must be found in the PATH setting at runtime) 3725 libraries must be found in the PATH setting at runtime)
2410 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime 3726 -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
2411 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols 3727 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2412 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) 3728 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2413 -export-symbols SYMFILE 3729 -export-symbols SYMFILE
2414 try to export only the symbols listed in SYMFILE 3730 try to export only the symbols listed in SYMFILE
2415 -export-symbols-regex REGEX 3731 -export-symbols-regex REGEX
2416 try to export only the symbols matching REGEX 3732 try to export only the symbols matching REGEX
2417 -LLIBDIR search LIBDIR for required installed libraries 3733 -LLIBDIR search LIBDIR for required installed libraries
2418 -lNAME OUTPUT-FILE requires the installed library libNAME 3734 -lNAME OUTPUT-FILE requires the installed library libNAME
2419 -module build a library that can dlopened 3735 -module build a library that can dlopened
2420 -no-fast-install disable the fast-install mode 3736 -no-fast-install disable the fast-install mode
2421 -no-install link a not-installable executable 3737 -no-install link a not-installable executable
2422 -no-undefined declare that a library does not refer to external symbols 3738 -no-undefined declare that a library does not refer to external symbols
2423 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects 3739 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2424 -objectlist FILE Use a list of object files found in FILE to specify objects 3740 -objectlist FILE use a list of object files found in FILE to specify objects
3741 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
2425 -precious-files-regex REGEX 3742 -precious-files-regex REGEX
2426 don't remove output files matching REGEX 3743 don't remove output files matching REGEX
2427 -release RELEASE specify package release information 3744 -release RELEASE specify package release information
2428 -rpath LIBDIR the created library will eventually be installed in LIBDIR 3745 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2429 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries 3746 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2430 -shared only do dynamic linking of libtool libraries 3747 -shared only do dynamic linking of libtool libraries
2431 -shrext SUFFIX override the standard shared library file extension 3748 -shrext SUFFIX override the standard shared library file extension
2432 -static do not do any dynamic linking of uninstalled libtool librari es 3749 -static do not do any dynamic linking of uninstalled libtool librari es
2433 -static-libtool-libs 3750 -static-libtool-libs
2434 do not do any dynamic linking of libtool libraries 3751 do not do any dynamic linking of libtool libraries
2435 -version-info CURRENT[:REVISION[:AGE]] 3752 -version-info CURRENT[:REVISION[:AGE]]
2436 specify library version info [each variable defaults to 0] 3753 specify library version info [each variable defaults to 0]
2437 -weak LIBNAME declare that the target provides the LIBNAME interface 3754 -weak LIBNAME declare that the target provides the LIBNAME interface
2438 -Wc,FLAG 3755 -Wc,FLAG
2439 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler 3756 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2440 -Wl,FLAG 3757 -Wl,FLAG
2441 -Xlinker FLAG pass linker-specific FLAG directly to the linker 3758 -Xlinker FLAG pass linker-specific FLAG directly to the linker
2442 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) 3759 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2443 3760
2444 All other options (arguments beginning with \`-') are ignored. 3761 All other options (arguments beginning with '-') are ignored.
2445 3762
2446 Every other argument is treated as a filename. Files ending in \`.la' are 3763 Every other argument is treated as a filename. Files ending in '.la' are
2447 treated as uninstalled libtool libraries, other files are standard or library 3764 treated as uninstalled libtool libraries, other files are standard or library
2448 object files. 3765 object files.
2449 3766
2450 If the OUTPUT-FILE ends in \`.la', then a libtool library is created, 3767 If the OUTPUT-FILE ends in '.la', then a libtool library is created,
2451 only library objects (\`.lo' files) may be specified, and \`-rpath' is 3768 only library objects ('.lo' files) may be specified, and '-rpath' is
2452 required, except when creating a convenience library. 3769 required, except when creating a convenience library.
2453 3770
2454 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created 3771 If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
2455 using \`ar' and \`ranlib', or on Windows using \`lib'. 3772 using 'ar' and 'ranlib', or on Windows using 'lib'.
2456 3773
2457 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file 3774 If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
2458 is created, otherwise an executable program is created." 3775 is created, otherwise an executable program is created."
2459 ;; 3776 ;;
2460 3777
2461 uninstall) 3778 uninstall)
2462 $ECHO \ 3779 $ECHO \
2463 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... 3780 "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2464 3781
2465 Remove libraries from an installation directory. 3782 Remove libraries from an installation directory.
2466 3783
2467 RM is the name of the program to use to delete files associated with each FILE 3784 RM is the name of the program to use to delete files associated with each FILE
2468 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed 3785 (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
2469 to RM. 3786 to RM.
2470 3787
2471 If FILE is a libtool library, all the files associated with it are deleted. 3788 If FILE is a libtool library, all the files associated with it are deleted.
2472 Otherwise, only FILE itself is deleted using RM." 3789 Otherwise, only FILE itself is deleted using RM."
2473 ;; 3790 ;;
2474 3791
2475 *) 3792 *)
2476 func_fatal_help "invalid operation mode \`$opt_mode'" 3793 func_fatal_help "invalid operation mode '$opt_mode'"
2477 ;; 3794 ;;
2478 esac 3795 esac
2479 3796
2480 echo 3797 echo
2481 $ECHO "Try \`$progname --help' for more information about other modes." 3798 $ECHO "Try '$progname --help' for more information about other modes."
2482 } 3799 }
2483 3800
2484 # Now that we've collected a possible --mode arg, show help if necessary 3801 # Now that we've collected a possible --mode arg, show help if necessary
2485 if $opt_help; then 3802 if $opt_help; then
2486 if test "$opt_help" = :; then 3803 if test : = "$opt_help"; then
2487 func_mode_help 3804 func_mode_help
2488 else 3805 else
2489 { 3806 {
2490 func_help noexit 3807 func_help noexit
2491 for opt_mode in compile link execute install finish uninstall clean; do 3808 for opt_mode in compile link execute install finish uninstall clean; do
2492 func_mode_help 3809 func_mode_help
2493 done 3810 done
2494 } | sed -n '1p; 2,$s/^Usage:/ or: /p' 3811 } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
2495 { 3812 {
2496 func_help noexit 3813 func_help noexit
2497 for opt_mode in compile link execute install finish uninstall clean; do 3814 for opt_mode in compile link execute install finish uninstall clean; do
2498 echo 3815 echo
2499 func_mode_help 3816 func_mode_help
2500 done 3817 done
2501 } | 3818 } |
2502 sed '1d 3819 $SED '1d
2503 /^When reporting/,/^Report/{ 3820 /^When reporting/,/^Report/{
2504 H 3821 H
2505 d 3822 d
2506 } 3823 }
2507 $x 3824 $x
2508 /information about other modes/d 3825 /information about other modes/d
2509 /more detailed .*MODE/d 3826 /more detailed .*MODE/d
2510 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' 3827 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2511 fi 3828 fi
2512 exit $? 3829 exit $?
2513 fi 3830 fi
2514 3831
2515 3832
2516 # func_mode_execute arg... 3833 # func_mode_execute arg...
2517 func_mode_execute () 3834 func_mode_execute ()
2518 { 3835 {
2519 $opt_debug 3836 $debug_cmd
3837
2520 # The first argument is the command name. 3838 # The first argument is the command name.
2521 cmd="$nonopt" 3839 cmd=$nonopt
2522 test -z "$cmd" && \ 3840 test -z "$cmd" && \
2523 func_fatal_help "you must specify a COMMAND" 3841 func_fatal_help "you must specify a COMMAND"
2524 3842
2525 # Handle -dlopen flags immediately. 3843 # Handle -dlopen flags immediately.
2526 for file in $opt_dlopen; do 3844 for file in $opt_dlopen; do
2527 test -f "$file" \ 3845 test -f "$file" \
2528 » || func_fatal_help "\`$file' is not a file" 3846 » || func_fatal_help "'$file' is not a file"
2529 3847
2530 dir= 3848 dir=
2531 case $file in 3849 case $file in
2532 *.la) 3850 *.la)
2533 func_resolve_sysroot "$file" 3851 func_resolve_sysroot "$file"
2534 file=$func_resolve_sysroot_result 3852 file=$func_resolve_sysroot_result
2535 3853
2536 # Check to see that this really is a libtool archive. 3854 # Check to see that this really is a libtool archive.
2537 func_lalib_unsafe_p "$file" \ 3855 func_lalib_unsafe_p "$file" \
2538 » || func_fatal_help "\`$lib' is not a valid libtool archive" 3856 » || func_fatal_help "'$lib' is not a valid libtool archive"
2539 3857
2540 # Read the libtool library. 3858 # Read the libtool library.
2541 dlname= 3859 dlname=
2542 library_names= 3860 library_names=
2543 func_source "$file" 3861 func_source "$file"
2544 3862
2545 # Skip this library if it cannot be dlopened. 3863 # Skip this library if it cannot be dlopened.
2546 if test -z "$dlname"; then 3864 if test -z "$dlname"; then
2547 # Warn if it was a shared library. 3865 # Warn if it was a shared library.
2548 test -n "$library_names" && \ 3866 test -n "$library_names" && \
2549 » func_warning "\`$file' was not linked with \`-export-dynamic'" 3867 » func_warning "'$file' was not linked with '-export-dynamic'"
2550 continue 3868 continue
2551 fi 3869 fi
2552 3870
2553 func_dirname "$file" "" "." 3871 func_dirname "$file" "" "."
2554 » dir="$func_dirname_result" 3872 » dir=$func_dirname_result
2555 3873
2556 if test -f "$dir/$objdir/$dlname"; then 3874 if test -f "$dir/$objdir/$dlname"; then
2557 func_append dir "/$objdir" 3875 func_append dir "/$objdir"
2558 else 3876 else
2559 if test ! -f "$dir/$dlname"; then 3877 if test ! -f "$dir/$dlname"; then
2560 » func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdi r'" 3878 » func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
2561 fi 3879 fi
2562 fi 3880 fi
2563 ;; 3881 ;;
2564 3882
2565 *.lo) 3883 *.lo)
2566 # Just add the directory containing the .lo file. 3884 # Just add the directory containing the .lo file.
2567 func_dirname "$file" "" "." 3885 func_dirname "$file" "" "."
2568 » dir="$func_dirname_result" 3886 » dir=$func_dirname_result
2569 ;; 3887 ;;
2570 3888
2571 *) 3889 *)
2572 » func_warning "\`-dlopen' is ignored for non-libtool libraries and object s" 3890 » func_warning "'-dlopen' is ignored for non-libtool libraries and objects "
2573 continue 3891 continue
2574 ;; 3892 ;;
2575 esac 3893 esac
2576 3894
2577 # Get the absolute pathname. 3895 # Get the absolute pathname.
2578 absdir=`cd "$dir" && pwd` 3896 absdir=`cd "$dir" && pwd`
2579 test -n "$absdir" && dir="$absdir" 3897 test -n "$absdir" && dir=$absdir
2580 3898
2581 # Now add the directory to shlibpath_var. 3899 # Now add the directory to shlibpath_var.
2582 if eval "test -z \"\$$shlibpath_var\""; then 3900 if eval "test -z \"\$$shlibpath_var\""; then
2583 eval "$shlibpath_var=\"\$dir\"" 3901 eval "$shlibpath_var=\"\$dir\""
2584 else 3902 else
2585 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" 3903 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2586 fi 3904 fi
2587 done 3905 done
2588 3906
2589 # This variable tells wrapper scripts just to set shlibpath_var 3907 # This variable tells wrapper scripts just to set shlibpath_var
2590 # rather than running their programs. 3908 # rather than running their programs.
2591 libtool_execute_magic="$magic" 3909 libtool_execute_magic=$magic
2592 3910
2593 # Check if any of the arguments is a wrapper script. 3911 # Check if any of the arguments is a wrapper script.
2594 args= 3912 args=
2595 for file 3913 for file
2596 do 3914 do
2597 case $file in 3915 case $file in
2598 -* | *.la | *.lo ) ;; 3916 -* | *.la | *.lo ) ;;
2599 *) 3917 *)
2600 # Do a test to see if this is really a libtool program. 3918 # Do a test to see if this is really a libtool program.
2601 if func_ltwrapper_script_p "$file"; then 3919 if func_ltwrapper_script_p "$file"; then
2602 func_source "$file" 3920 func_source "$file"
2603 # Transform arg to wrapped name. 3921 # Transform arg to wrapped name.
2604 » file="$progdir/$program" 3922 » file=$progdir/$program
2605 elif func_ltwrapper_executable_p "$file"; then 3923 elif func_ltwrapper_executable_p "$file"; then
2606 func_ltwrapper_scriptname "$file" 3924 func_ltwrapper_scriptname "$file"
2607 func_source "$func_ltwrapper_scriptname_result" 3925 func_source "$func_ltwrapper_scriptname_result"
2608 # Transform arg to wrapped name. 3926 # Transform arg to wrapped name.
2609 » file="$progdir/$program" 3927 » file=$progdir/$program
2610 fi 3928 fi
2611 ;; 3929 ;;
2612 esac 3930 esac
2613 # Quote arguments (to preserve shell metacharacters). 3931 # Quote arguments (to preserve shell metacharacters).
2614 func_append_quoted args "$file" 3932 func_append_quoted args "$file"
2615 done 3933 done
2616 3934
2617 if test "X$opt_dry_run" = Xfalse; then 3935 if $opt_dry_run; then
3936 # Display what would be done.
3937 if test -n "$shlibpath_var"; then
3938 » eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3939 » echo "export $shlibpath_var"
3940 fi
3941 $ECHO "$cmd$args"
3942 exit $EXIT_SUCCESS
3943 else
2618 if test -n "$shlibpath_var"; then 3944 if test -n "$shlibpath_var"; then
2619 # Export the shlibpath_var. 3945 # Export the shlibpath_var.
2620 eval "export $shlibpath_var" 3946 eval "export $shlibpath_var"
2621 fi 3947 fi
2622 3948
2623 # Restore saved environment variables 3949 # Restore saved environment variables
2624 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES 3950 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2625 do 3951 do
2626 eval "if test \"\${save_$lt_var+set}\" = set; then 3952 eval "if test \"\${save_$lt_var+set}\" = set; then
2627 $lt_var=\$save_$lt_var; export $lt_var 3953 $lt_var=\$save_$lt_var; export $lt_var
2628 else 3954 else
2629 $lt_unset $lt_var 3955 $lt_unset $lt_var
2630 fi" 3956 fi"
2631 done 3957 done
2632 3958
2633 # Now prepare to actually exec the command. 3959 # Now prepare to actually exec the command.
2634 exec_cmd="\$cmd$args" 3960 exec_cmd=\$cmd$args
2635 else
2636 # Display what would be done.
2637 if test -n "$shlibpath_var"; then
2638 » eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2639 » echo "export $shlibpath_var"
2640 fi
2641 $ECHO "$cmd$args"
2642 exit $EXIT_SUCCESS
2643 fi 3961 fi
2644 } 3962 }
2645 3963
2646 test "$opt_mode" = execute && func_mode_execute ${1+"$@"} 3964 test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
2647 3965
2648 3966
2649 # func_mode_finish arg... 3967 # func_mode_finish arg...
2650 func_mode_finish () 3968 func_mode_finish ()
2651 { 3969 {
2652 $opt_debug 3970 $debug_cmd
3971
2653 libs= 3972 libs=
2654 libdirs= 3973 libdirs=
2655 admincmds= 3974 admincmds=
2656 3975
2657 for opt in "$nonopt" ${1+"$@"} 3976 for opt in "$nonopt" ${1+"$@"}
2658 do 3977 do
2659 if test -d "$opt"; then 3978 if test -d "$opt"; then
2660 func_append libdirs " $opt" 3979 func_append libdirs " $opt"
2661 3980
2662 elif test -f "$opt"; then 3981 elif test -f "$opt"; then
2663 if func_lalib_unsafe_p "$opt"; then 3982 if func_lalib_unsafe_p "$opt"; then
2664 func_append libs " $opt" 3983 func_append libs " $opt"
2665 else 3984 else
2666 » func_warning "\`$opt' is not a valid libtool archive" 3985 » func_warning "'$opt' is not a valid libtool archive"
2667 fi 3986 fi
2668 3987
2669 else 3988 else
2670 » func_fatal_error "invalid argument \`$opt'" 3989 » func_fatal_error "invalid argument '$opt'"
2671 fi 3990 fi
2672 done 3991 done
2673 3992
2674 if test -n "$libs"; then 3993 if test -n "$libs"; then
2675 if test -n "$lt_sysroot"; then 3994 if test -n "$lt_sysroot"; then
2676 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` 3995 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
2677 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" 3996 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
2678 else 3997 else
2679 sysroot_cmd= 3998 sysroot_cmd=
2680 fi 3999 fi
2681 4000
2682 # Remove sysroot references 4001 # Remove sysroot references
2683 if $opt_dry_run; then 4002 if $opt_dry_run; then
2684 for lib in $libs; do 4003 for lib in $libs; do
2685 echo "removing references to $lt_sysroot and \`=' prefixes from $lib" 4004 echo "removing references to $lt_sysroot and '=' prefixes from $lib"
2686 done 4005 done
2687 else 4006 else
2688 tmpdir=`func_mktempdir` 4007 tmpdir=`func_mktempdir`
2689 for lib in $libs; do 4008 for lib in $libs; do
2690 » sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ 4009 » $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
2691 > $tmpdir/tmp-la 4010 > $tmpdir/tmp-la
2692 mv -f $tmpdir/tmp-la $lib 4011 mv -f $tmpdir/tmp-la $lib
2693 done 4012 done
2694 ${RM}r "$tmpdir" 4013 ${RM}r "$tmpdir"
2695 fi 4014 fi
2696 fi 4015 fi
2697 4016
2698 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 4017 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2699 for libdir in $libdirs; do 4018 for libdir in $libdirs; do
2700 if test -n "$finish_cmds"; then 4019 if test -n "$finish_cmds"; then
2701 # Do each command in the finish commands. 4020 # Do each command in the finish commands.
2702 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds 4021 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
2703 '"$cmd"'"' 4022 '"$cmd"'"'
2704 fi 4023 fi
2705 if test -n "$finish_eval"; then 4024 if test -n "$finish_eval"; then
2706 # Do the single finish_eval. 4025 # Do the single finish_eval.
2707 eval cmds=\"$finish_eval\" 4026 eval cmds=\"$finish_eval\"
2708 $opt_dry_run || eval "$cmds" || func_append admincmds " 4027 $opt_dry_run || eval "$cmds" || func_append admincmds "
2709 $cmds" 4028 $cmds"
2710 fi 4029 fi
2711 done 4030 done
2712 fi 4031 fi
2713 4032
2714 # Exit here if they wanted silent mode. 4033 # Exit here if they wanted silent mode.
2715 $opt_silent && exit $EXIT_SUCCESS 4034 $opt_quiet && exit $EXIT_SUCCESS
2716 4035
2717 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then 4036 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2718 echo "-------------------------------------------------------------------- --" 4037 echo "-------------------------------------------------------------------- --"
2719 echo "Libraries have been installed in:" 4038 echo "Libraries have been installed in:"
2720 for libdir in $libdirs; do 4039 for libdir in $libdirs; do
2721 $ECHO " $libdir" 4040 $ECHO " $libdir"
2722 done 4041 done
2723 echo 4042 echo
2724 echo "If you ever happen to want to link against installed libraries" 4043 echo "If you ever happen to want to link against installed libraries"
2725 echo "in a given directory, LIBDIR, you must either use libtool, and" 4044 echo "in a given directory, LIBDIR, you must either use libtool, and"
2726 echo "specify the full pathname of the library, or use the \`-LLIBDIR'" 4045 echo "specify the full pathname of the library, or use the '-LLIBDIR'"
2727 echo "flag during linking and do at least one of the following:" 4046 echo "flag during linking and do at least one of the following:"
2728 if test -n "$shlibpath_var"; then 4047 if test -n "$shlibpath_var"; then
2729 » echo " - add LIBDIR to the \`$shlibpath_var' environment variable" 4048 » echo " - add LIBDIR to the '$shlibpath_var' environment variable"
2730 echo " during execution" 4049 echo " during execution"
2731 fi 4050 fi
2732 if test -n "$runpath_var"; then 4051 if test -n "$runpath_var"; then
2733 » echo " - add LIBDIR to the \`$runpath_var' environment variable" 4052 » echo " - add LIBDIR to the '$runpath_var' environment variable"
2734 echo " during linking" 4053 echo " during linking"
2735 fi 4054 fi
2736 if test -n "$hardcode_libdir_flag_spec"; then 4055 if test -n "$hardcode_libdir_flag_spec"; then
2737 libdir=LIBDIR 4056 libdir=LIBDIR
2738 eval flag=\"$hardcode_libdir_flag_spec\" 4057 eval flag=\"$hardcode_libdir_flag_spec\"
2739 4058
2740 » $ECHO " - use the \`$flag' linker flag" 4059 » $ECHO " - use the '$flag' linker flag"
2741 fi 4060 fi
2742 if test -n "$admincmds"; then 4061 if test -n "$admincmds"; then
2743 $ECHO " - have your system administrator run these commands:$admincmds " 4062 $ECHO " - have your system administrator run these commands:$admincmds "
2744 fi 4063 fi
2745 if test -f /etc/ld.so.conf; then 4064 if test -f /etc/ld.so.conf; then
2746 » echo " - have your system administrator add LIBDIR to \`/etc/ld.so.con f'" 4065 » echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf '"
2747 fi 4066 fi
2748 echo 4067 echo
2749 4068
2750 echo "See any operating system documentation about shared libraries for" 4069 echo "See any operating system documentation about shared libraries for"
2751 case $host in 4070 case $host in
2752 solaris2.[6789]|solaris2.1[0-9]) 4071 solaris2.[6789]|solaris2.1[0-9])
2753 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual " 4072 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual "
2754 echo "pages." 4073 echo "pages."
2755 ;; 4074 ;;
2756 *) 4075 *)
2757 echo "more information, such as the ld(1) and ld.so(8) manual pages." 4076 echo "more information, such as the ld(1) and ld.so(8) manual pages."
2758 ;; 4077 ;;
2759 esac 4078 esac
2760 echo "-------------------------------------------------------------------- --" 4079 echo "-------------------------------------------------------------------- --"
2761 fi 4080 fi
2762 exit $EXIT_SUCCESS 4081 exit $EXIT_SUCCESS
2763 } 4082 }
2764 4083
2765 test "$opt_mode" = finish && func_mode_finish ${1+"$@"} 4084 test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
2766 4085
2767 4086
2768 # func_mode_install arg... 4087 # func_mode_install arg...
2769 func_mode_install () 4088 func_mode_install ()
2770 { 4089 {
2771 $opt_debug 4090 $debug_cmd
4091
2772 # There may be an optional sh(1) argument at the beginning of 4092 # There may be an optional sh(1) argument at the beginning of
2773 # install_prog (especially on Windows NT). 4093 # install_prog (especially on Windows NT).
2774 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || 4094 if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
2775 # Allow the use of GNU shtool's install command. 4095 # Allow the use of GNU shtool's install command.
2776 case $nonopt in *shtool*) :;; *) false;; esac; then 4096 case $nonopt in *shtool*) :;; *) false;; esac
4097 then
2777 # Aesthetically quote it. 4098 # Aesthetically quote it.
2778 func_quote_for_eval "$nonopt" 4099 func_quote_for_eval "$nonopt"
2779 install_prog="$func_quote_for_eval_result " 4100 install_prog="$func_quote_for_eval_result "
2780 arg=$1 4101 arg=$1
2781 shift 4102 shift
2782 else 4103 else
2783 install_prog= 4104 install_prog=
2784 arg=$nonopt 4105 arg=$nonopt
2785 fi 4106 fi
2786 4107
2787 # The real first argument should be the name of the installation program. 4108 # The real first argument should be the name of the installation program.
2788 # Aesthetically quote it. 4109 # Aesthetically quote it.
2789 func_quote_for_eval "$arg" 4110 func_quote_for_eval "$arg"
2790 func_append install_prog "$func_quote_for_eval_result" 4111 func_append install_prog "$func_quote_for_eval_result"
2791 install_shared_prog=$install_prog 4112 install_shared_prog=$install_prog
2792 case " $install_prog " in 4113 case " $install_prog " in
2793 *[\\\ /]cp\ *) install_cp=: ;; 4114 *[\\\ /]cp\ *) install_cp=: ;;
2794 *) install_cp=false ;; 4115 *) install_cp=false ;;
2795 esac 4116 esac
2796 4117
2797 # We need to accept at least all the BSD install flags. 4118 # We need to accept at least all the BSD install flags.
2798 dest= 4119 dest=
2799 files= 4120 files=
2800 opts= 4121 opts=
2801 prev= 4122 prev=
2802 install_type= 4123 install_type=
2803 isdir=no 4124 isdir=false
2804 stripme= 4125 stripme=
2805 no_mode=: 4126 no_mode=:
2806 for arg 4127 for arg
2807 do 4128 do
2808 arg2= 4129 arg2=
2809 if test -n "$dest"; then 4130 if test -n "$dest"; then
2810 func_append files " $dest" 4131 func_append files " $dest"
2811 dest=$arg 4132 dest=$arg
2812 continue 4133 continue
2813 fi 4134 fi
2814 4135
2815 case $arg in 4136 case $arg in
2816 -d) isdir=yes ;; 4137 -d) isdir=: ;;
2817 -f) 4138 -f)
2818 if $install_cp; then :; else 4139 if $install_cp; then :; else
2819 prev=$arg 4140 prev=$arg
2820 fi 4141 fi
2821 ;; 4142 ;;
2822 -g | -m | -o) 4143 -g | -m | -o)
2823 prev=$arg 4144 prev=$arg
2824 ;; 4145 ;;
2825 -s) 4146 -s)
2826 stripme=" -s" 4147 stripme=" -s"
2827 continue 4148 continue
2828 ;; 4149 ;;
2829 -*) 4150 -*)
2830 ;; 4151 ;;
2831 *) 4152 *)
2832 # If the previous option needed an argument, then skip it. 4153 # If the previous option needed an argument, then skip it.
2833 if test -n "$prev"; then 4154 if test -n "$prev"; then
2834 » if test "x$prev" = x-m && test -n "$install_override_mode"; then 4155 » if test X-m = "X$prev" && test -n "$install_override_mode"; then
2835 arg2=$install_override_mode 4156 arg2=$install_override_mode
2836 no_mode=false 4157 no_mode=false
2837 fi 4158 fi
2838 prev= 4159 prev=
2839 else 4160 else
2840 dest=$arg 4161 dest=$arg
2841 continue 4162 continue
2842 fi 4163 fi
2843 ;; 4164 ;;
2844 esac 4165 esac
2845 4166
2846 # Aesthetically quote the argument. 4167 # Aesthetically quote the argument.
2847 func_quote_for_eval "$arg" 4168 func_quote_for_eval "$arg"
2848 func_append install_prog " $func_quote_for_eval_result" 4169 func_append install_prog " $func_quote_for_eval_result"
2849 if test -n "$arg2"; then 4170 if test -n "$arg2"; then
2850 func_quote_for_eval "$arg2" 4171 func_quote_for_eval "$arg2"
2851 fi 4172 fi
2852 func_append install_shared_prog " $func_quote_for_eval_result" 4173 func_append install_shared_prog " $func_quote_for_eval_result"
2853 done 4174 done
2854 4175
2855 test -z "$install_prog" && \ 4176 test -z "$install_prog" && \
2856 func_fatal_help "you must specify an install program" 4177 func_fatal_help "you must specify an install program"
2857 4178
2858 test -n "$prev" && \ 4179 test -n "$prev" && \
2859 func_fatal_help "the \`$prev' option requires an argument" 4180 func_fatal_help "the '$prev' option requires an argument"
2860 4181
2861 if test -n "$install_override_mode" && $no_mode; then 4182 if test -n "$install_override_mode" && $no_mode; then
2862 if $install_cp; then :; else 4183 if $install_cp; then :; else
2863 func_quote_for_eval "$install_override_mode" 4184 func_quote_for_eval "$install_override_mode"
2864 func_append install_shared_prog " -m $func_quote_for_eval_result" 4185 func_append install_shared_prog " -m $func_quote_for_eval_result"
2865 fi 4186 fi
2866 fi 4187 fi
2867 4188
2868 if test -z "$files"; then 4189 if test -z "$files"; then
2869 if test -z "$dest"; then 4190 if test -z "$dest"; then
2870 func_fatal_help "no file or destination specified" 4191 func_fatal_help "no file or destination specified"
2871 else 4192 else
2872 func_fatal_help "you must specify a destination" 4193 func_fatal_help "you must specify a destination"
2873 fi 4194 fi
2874 fi 4195 fi
2875 4196
2876 # Strip any trailing slash from the destination. 4197 # Strip any trailing slash from the destination.
2877 func_stripname '' '/' "$dest" 4198 func_stripname '' '/' "$dest"
2878 dest=$func_stripname_result 4199 dest=$func_stripname_result
2879 4200
2880 # Check to see that the destination is a directory. 4201 # Check to see that the destination is a directory.
2881 test -d "$dest" && isdir=yes 4202 test -d "$dest" && isdir=:
2882 if test "$isdir" = yes; then 4203 if $isdir; then
2883 destdir="$dest" 4204 destdir=$dest
2884 destname= 4205 destname=
2885 else 4206 else
2886 func_dirname_and_basename "$dest" "" "." 4207 func_dirname_and_basename "$dest" "" "."
2887 destdir="$func_dirname_result" 4208 destdir=$func_dirname_result
2888 destname="$func_basename_result" 4209 destname=$func_basename_result
2889 4210
2890 # Not a directory, so check to see that there is only one file specified. 4211 # Not a directory, so check to see that there is only one file specified.
2891 set dummy $files; shift 4212 set dummy $files; shift
2892 test "$#" -gt 1 && \ 4213 test "$#" -gt 1 && \
2893 » func_fatal_help "\`$dest' is not a directory" 4214 » func_fatal_help "'$dest' is not a directory"
2894 fi 4215 fi
2895 case $destdir in 4216 case $destdir in
2896 [\\/]* | [A-Za-z]:[\\/]*) ;; 4217 [\\/]* | [A-Za-z]:[\\/]*) ;;
2897 *) 4218 *)
2898 for file in $files; do 4219 for file in $files; do
2899 case $file in 4220 case $file in
2900 *.lo) ;; 4221 *.lo) ;;
2901 *) 4222 *)
2902 » func_fatal_help "\`$destdir' must be an absolute directory name" 4223 » func_fatal_help "'$destdir' must be an absolute directory name"
2903 ;; 4224 ;;
2904 esac 4225 esac
2905 done 4226 done
2906 ;; 4227 ;;
2907 esac 4228 esac
2908 4229
2909 # This variable tells wrapper scripts just to set variables rather 4230 # This variable tells wrapper scripts just to set variables rather
2910 # than running their programs. 4231 # than running their programs.
2911 libtool_install_magic="$magic" 4232 libtool_install_magic=$magic
2912 4233
2913 staticlibs= 4234 staticlibs=
2914 future_libdirs= 4235 future_libdirs=
2915 current_libdirs= 4236 current_libdirs=
2916 for file in $files; do 4237 for file in $files; do
2917 4238
2918 # Do each installation. 4239 # Do each installation.
2919 case $file in 4240 case $file in
2920 *.$libext) 4241 *.$libext)
2921 # Do the static libraries later. 4242 # Do the static libraries later.
2922 func_append staticlibs " $file" 4243 func_append staticlibs " $file"
2923 ;; 4244 ;;
2924 4245
2925 *.la) 4246 *.la)
2926 func_resolve_sysroot "$file" 4247 func_resolve_sysroot "$file"
2927 file=$func_resolve_sysroot_result 4248 file=$func_resolve_sysroot_result
2928 4249
2929 # Check to see that this really is a libtool archive. 4250 # Check to see that this really is a libtool archive.
2930 func_lalib_unsafe_p "$file" \ 4251 func_lalib_unsafe_p "$file" \
2931 » || func_fatal_help "\`$file' is not a valid libtool archive" 4252 » || func_fatal_help "'$file' is not a valid libtool archive"
2932 4253
2933 library_names= 4254 library_names=
2934 old_library= 4255 old_library=
2935 relink_command= 4256 relink_command=
2936 func_source "$file" 4257 func_source "$file"
2937 4258
2938 # Add the libdir to current_libdirs if it is the destination. 4259 # Add the libdir to current_libdirs if it is the destination.
2939 if test "X$destdir" = "X$libdir"; then 4260 if test "X$destdir" = "X$libdir"; then
2940 case "$current_libdirs " in 4261 case "$current_libdirs " in
2941 *" $libdir "*) ;; 4262 *" $libdir "*) ;;
2942 *) func_append current_libdirs " $libdir" ;; 4263 *) func_append current_libdirs " $libdir" ;;
2943 esac 4264 esac
2944 else 4265 else
2945 # Note the libdir as a future libdir. 4266 # Note the libdir as a future libdir.
2946 case "$future_libdirs " in 4267 case "$future_libdirs " in
2947 *" $libdir "*) ;; 4268 *" $libdir "*) ;;
2948 *) func_append future_libdirs " $libdir" ;; 4269 *) func_append future_libdirs " $libdir" ;;
2949 esac 4270 esac
2950 fi 4271 fi
2951 4272
2952 func_dirname "$file" "/" "" 4273 func_dirname "$file" "/" ""
2953 » dir="$func_dirname_result" 4274 » dir=$func_dirname_result
2954 func_append dir "$objdir" 4275 func_append dir "$objdir"
2955 4276
2956 if test -n "$relink_command"; then 4277 if test -n "$relink_command"; then
2957 # Determine the prefix the user has applied to our future dir. 4278 # Determine the prefix the user has applied to our future dir.
2958 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` 4279 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2959 4280
2960 # Don't allow the user to place us outside of our expected 4281 # Don't allow the user to place us outside of our expected
2961 # location b/c this prevents finding dependent libraries that 4282 # location b/c this prevents finding dependent libraries that
2962 # are installed to the same prefix. 4283 # are installed to the same prefix.
2963 # At present, this check doesn't affect windows .dll's that 4284 # At present, this check doesn't affect windows .dll's that
2964 # are installed into $libdir/../bin (currently, that works fine) 4285 # are installed into $libdir/../bin (currently, that works fine)
2965 # but it's something to keep an eye on. 4286 # but it's something to keep an eye on.
2966 test "$inst_prefix_dir" = "$destdir" && \ 4287 test "$inst_prefix_dir" = "$destdir" && \
2967 » func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" 4288 » func_fatal_error "error: cannot install '$file' to a directory not e nding in $libdir"
2968 4289
2969 if test -n "$inst_prefix_dir"; then 4290 if test -n "$inst_prefix_dir"; then
2970 # Stick the inst_prefix_dir data into the link command. 4291 # Stick the inst_prefix_dir data into the link command.
2971 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@% -inst-prefix-dir $inst_prefix_dir%"` 4292 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@% -inst-prefix-dir $inst_prefix_dir%"`
2972 else 4293 else
2973 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@% %"` 4294 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@% %"`
2974 fi 4295 fi
2975 4296
2976 » func_warning "relinking \`$file'" 4297 » func_warning "relinking '$file'"
2977 func_show_eval "$relink_command" \ 4298 func_show_eval "$relink_command" \
2978 » 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' 4299 » 'func_fatal_error "error: relink '\''$file'\'' with the above comman d before installing it"'
2979 fi 4300 fi
2980 4301
2981 # See the names of the shared library. 4302 # See the names of the shared library.
2982 set dummy $library_names; shift 4303 set dummy $library_names; shift
2983 if test -n "$1"; then 4304 if test -n "$1"; then
2984 » realname="$1" 4305 » realname=$1
2985 shift 4306 shift
2986 4307
2987 » srcname="$realname" 4308 » srcname=$realname
2988 » test -n "$relink_command" && srcname="$realname"T 4309 » test -n "$relink_command" && srcname=${realname}T
2989 4310
2990 # Install the shared library and build the symlinks. 4311 # Install the shared library and build the symlinks.
2991 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 4312 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
2992 'exit $?' 4313 'exit $?'
2993 » tstripme="$stripme" 4314 » tstripme=$stripme
2994 case $host_os in 4315 case $host_os in
2995 cygwin* | mingw* | pw32* | cegcc*) 4316 cygwin* | mingw* | pw32* | cegcc*)
2996 case $realname in 4317 case $realname in
2997 *.dll.a) 4318 *.dll.a)
2998 » tstripme="" 4319 » tstripme=
2999 ;; 4320 ;;
3000 esac 4321 esac
3001 ;; 4322 ;;
4323 os2*)
4324 case $realname in
4325 *_dll.a)
4326 tstripme=
4327 ;;
4328 esac
4329 ;;
3002 esac 4330 esac
3003 if test -n "$tstripme" && test -n "$striplib"; then 4331 if test -n "$tstripme" && test -n "$striplib"; then
3004 func_show_eval "$striplib $destdir/$realname" 'exit $?' 4332 func_show_eval "$striplib $destdir/$realname" 'exit $?'
3005 fi 4333 fi
3006 4334
3007 if test "$#" -gt 0; then 4335 if test "$#" -gt 0; then
3008 # Delete the old symlinks, and create new ones. 4336 # Delete the old symlinks, and create new ones.
3009 » # Try `ln -sf' first, because the `ln' binary might depend on 4337 » # Try 'ln -sf' first, because the 'ln' binary might depend on
3010 # the symlink we replace! Solaris /bin/ln does not understand -f, 4338 # the symlink we replace! Solaris /bin/ln does not understand -f,
3011 # so we also need to try rm && ln -s. 4339 # so we also need to try rm && ln -s.
3012 for linkname 4340 for linkname
3013 do 4341 do
3014 test "$linkname" != "$realname" \ 4342 test "$linkname" != "$realname" \
3015 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linknam e || { $RM $linkname && $LN_S $realname $linkname; }; })" 4343 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linknam e || { $RM $linkname && $LN_S $realname $linkname; }; })"
3016 done 4344 done
3017 fi 4345 fi
3018 4346
3019 # Do each command in the postinstall commands. 4347 # Do each command in the postinstall commands.
3020 » lib="$destdir/$realname" 4348 » lib=$destdir/$realname
3021 func_execute_cmds "$postinstall_cmds" 'exit $?' 4349 func_execute_cmds "$postinstall_cmds" 'exit $?'
3022 fi 4350 fi
3023 4351
3024 # Install the pseudo-library for information purposes. 4352 # Install the pseudo-library for information purposes.
3025 func_basename "$file" 4353 func_basename "$file"
3026 » name="$func_basename_result" 4354 » name=$func_basename_result
3027 » instname="$dir/$name"i 4355 » instname=$dir/${name}i
3028 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' 4356 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3029 4357
3030 # Maybe install the static library, too. 4358 # Maybe install the static library, too.
3031 test -n "$old_library" && func_append staticlibs " $dir/$old_library" 4359 test -n "$old_library" && func_append staticlibs " $dir/$old_library"
3032 ;; 4360 ;;
3033 4361
3034 *.lo) 4362 *.lo)
3035 # Install (i.e. copy) a libtool object. 4363 # Install (i.e. copy) a libtool object.
3036 4364
3037 # Figure out destination file name, if it wasn't already specified. 4365 # Figure out destination file name, if it wasn't already specified.
3038 if test -n "$destname"; then 4366 if test -n "$destname"; then
3039 » destfile="$destdir/$destname" 4367 » destfile=$destdir/$destname
3040 else 4368 else
3041 func_basename "$file" 4369 func_basename "$file"
3042 » destfile="$func_basename_result" 4370 » destfile=$func_basename_result
3043 » destfile="$destdir/$destfile" 4371 » destfile=$destdir/$destfile
3044 fi 4372 fi
3045 4373
3046 # Deduce the name of the destination old-style object file. 4374 # Deduce the name of the destination old-style object file.
3047 case $destfile in 4375 case $destfile in
3048 *.lo) 4376 *.lo)
3049 func_lo2o "$destfile" 4377 func_lo2o "$destfile"
3050 staticdest=$func_lo2o_result 4378 staticdest=$func_lo2o_result
3051 ;; 4379 ;;
3052 *.$objext) 4380 *.$objext)
3053 » staticdest="$destfile" 4381 » staticdest=$destfile
3054 destfile= 4382 destfile=
3055 ;; 4383 ;;
3056 *) 4384 *)
3057 » func_fatal_help "cannot copy a libtool object to \`$destfile'" 4385 » func_fatal_help "cannot copy a libtool object to '$destfile'"
3058 ;; 4386 ;;
3059 esac 4387 esac
3060 4388
3061 # Install the libtool object if requested. 4389 # Install the libtool object if requested.
3062 test -n "$destfile" && \ 4390 test -n "$destfile" && \
3063 func_show_eval "$install_prog $file $destfile" 'exit $?' 4391 func_show_eval "$install_prog $file $destfile" 'exit $?'
3064 4392
3065 # Install the old object if enabled. 4393 # Install the old object if enabled.
3066 » if test "$build_old_libs" = yes; then 4394 » if test yes = "$build_old_libs"; then
3067 # Deduce the name of the old-style object file. 4395 # Deduce the name of the old-style object file.
3068 func_lo2o "$file" 4396 func_lo2o "$file"
3069 staticobj=$func_lo2o_result 4397 staticobj=$func_lo2o_result
3070 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' 4398 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
3071 fi 4399 fi
3072 exit $EXIT_SUCCESS 4400 exit $EXIT_SUCCESS
3073 ;; 4401 ;;
3074 4402
3075 *) 4403 *)
3076 # Figure out destination file name, if it wasn't already specified. 4404 # Figure out destination file name, if it wasn't already specified.
3077 if test -n "$destname"; then 4405 if test -n "$destname"; then
3078 » destfile="$destdir/$destname" 4406 » destfile=$destdir/$destname
3079 else 4407 else
3080 func_basename "$file" 4408 func_basename "$file"
3081 » destfile="$func_basename_result" 4409 » destfile=$func_basename_result
3082 » destfile="$destdir/$destfile" 4410 » destfile=$destdir/$destfile
3083 fi 4411 fi
3084 4412
3085 # If the file is missing, and there is a .exe on the end, strip it 4413 # If the file is missing, and there is a .exe on the end, strip it
3086 # because it is most likely a libtool script we actually want to 4414 # because it is most likely a libtool script we actually want to
3087 # install 4415 # install
3088 » stripped_ext="" 4416 » stripped_ext=
3089 case $file in 4417 case $file in
3090 *.exe) 4418 *.exe)
3091 if test ! -f "$file"; then 4419 if test ! -f "$file"; then
3092 func_stripname '' '.exe' "$file" 4420 func_stripname '' '.exe' "$file"
3093 file=$func_stripname_result 4421 file=$func_stripname_result
3094 » stripped_ext=".exe" 4422 » stripped_ext=.exe
3095 fi 4423 fi
3096 ;; 4424 ;;
3097 esac 4425 esac
3098 4426
3099 # Do a test to see if this is really a libtool program. 4427 # Do a test to see if this is really a libtool program.
3100 case $host in 4428 case $host in
3101 *cygwin* | *mingw*) 4429 *cygwin* | *mingw*)
3102 if func_ltwrapper_executable_p "$file"; then 4430 if func_ltwrapper_executable_p "$file"; then
3103 func_ltwrapper_scriptname "$file" 4431 func_ltwrapper_scriptname "$file"
3104 wrapper=$func_ltwrapper_scriptname_result 4432 wrapper=$func_ltwrapper_scriptname_result
3105 else 4433 else
3106 func_stripname '' '.exe' "$file" 4434 func_stripname '' '.exe' "$file"
3107 wrapper=$func_stripname_result 4435 wrapper=$func_stripname_result
3108 fi 4436 fi
3109 ;; 4437 ;;
3110 *) 4438 *)
3111 wrapper=$file 4439 wrapper=$file
3112 ;; 4440 ;;
3113 esac 4441 esac
3114 if func_ltwrapper_script_p "$wrapper"; then 4442 if func_ltwrapper_script_p "$wrapper"; then
3115 notinst_deplibs= 4443 notinst_deplibs=
3116 relink_command= 4444 relink_command=
3117 4445
3118 func_source "$wrapper" 4446 func_source "$wrapper"
3119 4447
3120 # Check the variables that should have been set. 4448 # Check the variables that should have been set.
3121 test -z "$generated_by_libtool_version" && \ 4449 test -z "$generated_by_libtool_version" && \
3122 » func_fatal_error "invalid libtool wrapper script \`$wrapper'" 4450 » func_fatal_error "invalid libtool wrapper script '$wrapper'"
3123 4451
3124 » finalize=yes 4452 » finalize=:
3125 for lib in $notinst_deplibs; do 4453 for lib in $notinst_deplibs; do
3126 # Check to see that each library is installed. 4454 # Check to see that each library is installed.
3127 libdir= 4455 libdir=
3128 if test -f "$lib"; then 4456 if test -f "$lib"; then
3129 func_source "$lib" 4457 func_source "$lib"
3130 fi 4458 fi
3131 » libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: s kip nested quoting test 4459 » libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
3132 if test -n "$libdir" && test ! -f "$libfile"; then 4460 if test -n "$libdir" && test ! -f "$libfile"; then
3133 » func_warning "\`$lib' has not been installed in \`$libdir'" 4461 » func_warning "'$lib' has not been installed in '$libdir'"
3134 » finalize=no 4462 » finalize=false
3135 fi 4463 fi
3136 done 4464 done
3137 4465
3138 relink_command= 4466 relink_command=
3139 func_source "$wrapper" 4467 func_source "$wrapper"
3140 4468
3141 outputname= 4469 outputname=
3142 » if test "$fast_install" = no && test -n "$relink_command"; then 4470 » if test no = "$fast_install" && test -n "$relink_command"; then
3143 $opt_dry_run || { 4471 $opt_dry_run || {
3144 » if test "$finalize" = yes; then 4472 » if $finalize; then
3145 tmpdir=`func_mktempdir` 4473 tmpdir=`func_mktempdir`
3146 func_basename "$file$stripped_ext" 4474 func_basename "$file$stripped_ext"
3147 » » file="$func_basename_result" 4475 » » file=$func_basename_result
3148 » outputname="$tmpdir/$file" 4476 » outputname=$tmpdir/$file
3149 # Replace the output file specification. 4477 # Replace the output file specification.
3150 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$ou tputname"'%g'` 4478 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$ou tputname"'%g'`
3151 4479
3152 » $opt_silent || { 4480 » $opt_quiet || {
3153 func_quote_for_expand "$relink_command" 4481 func_quote_for_expand "$relink_command"
3154 eval "func_echo $func_quote_for_expand_result" 4482 eval "func_echo $func_quote_for_expand_result"
3155 } 4483 }
3156 if eval "$relink_command"; then : 4484 if eval "$relink_command"; then :
3157 else 4485 else
3158 » » func_error "error: relink \`$file' with the above command befo re installing it" 4486 » » func_error "error: relink '$file' with the above command befor e installing it"
3159 $opt_dry_run || ${RM}r "$tmpdir" 4487 $opt_dry_run || ${RM}r "$tmpdir"
3160 continue 4488 continue
3161 fi 4489 fi
3162 » file="$outputname" 4490 » file=$outputname
3163 else 4491 else
3164 » func_warning "cannot relink \`$file'" 4492 » func_warning "cannot relink '$file'"
3165 fi 4493 fi
3166 } 4494 }
3167 else 4495 else
3168 # Install the binary that we compiled earlier. 4496 # Install the binary that we compiled earlier.
3169 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` 4497 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3170 fi 4498 fi
3171 fi 4499 fi
3172 4500
3173 # remove .exe since cygwin /usr/bin/install will append another 4501 # remove .exe since cygwin /usr/bin/install will append another
3174 # one anyway 4502 # one anyway
(...skipping 16 matching lines...) Expand all
3191 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' 4519 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
3192 $opt_dry_run || if test -n "$outputname"; then 4520 $opt_dry_run || if test -n "$outputname"; then
3193 ${RM}r "$tmpdir" 4521 ${RM}r "$tmpdir"
3194 fi 4522 fi
3195 ;; 4523 ;;
3196 esac 4524 esac
3197 done 4525 done
3198 4526
3199 for file in $staticlibs; do 4527 for file in $staticlibs; do
3200 func_basename "$file" 4528 func_basename "$file"
3201 name="$func_basename_result" 4529 name=$func_basename_result
3202 4530
3203 # Set up the ranlib parameters. 4531 # Set up the ranlib parameters.
3204 oldlib="$destdir/$name" 4532 oldlib=$destdir/$name
3205 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 4533 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
3206 tool_oldlib=$func_to_tool_file_result 4534 tool_oldlib=$func_to_tool_file_result
3207 4535
3208 func_show_eval "$install_prog \$file \$oldlib" 'exit $?' 4536 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
3209 4537
3210 if test -n "$stripme" && test -n "$old_striplib"; then 4538 if test -n "$stripme" && test -n "$old_striplib"; then
3211 func_show_eval "$old_striplib $tool_oldlib" 'exit $?' 4539 func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
3212 fi 4540 fi
3213 4541
3214 # Do each command in the postinstall commands. 4542 # Do each command in the postinstall commands.
3215 func_execute_cmds "$old_postinstall_cmds" 'exit $?' 4543 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
3216 done 4544 done
3217 4545
3218 test -n "$future_libdirs" && \ 4546 test -n "$future_libdirs" && \
3219 func_warning "remember to run \`$progname --finish$future_libdirs'" 4547 func_warning "remember to run '$progname --finish$future_libdirs'"
3220 4548
3221 if test -n "$current_libdirs"; then 4549 if test -n "$current_libdirs"; then
3222 # Maybe just do a dry run. 4550 # Maybe just do a dry run.
3223 $opt_dry_run && current_libdirs=" -n$current_libdirs" 4551 $opt_dry_run && current_libdirs=" -n$current_libdirs"
3224 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' 4552 exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
3225 else 4553 else
3226 exit $EXIT_SUCCESS 4554 exit $EXIT_SUCCESS
3227 fi 4555 fi
3228 } 4556 }
3229 4557
3230 test "$opt_mode" = install && func_mode_install ${1+"$@"} 4558 test install = "$opt_mode" && func_mode_install ${1+"$@"}
3231 4559
3232 4560
3233 # func_generate_dlsyms outputname originator pic_p 4561 # func_generate_dlsyms outputname originator pic_p
3234 # Extract symbols from dlprefiles and create ${outputname}S.o with 4562 # Extract symbols from dlprefiles and create ${outputname}S.o with
3235 # a dlpreopen symbol table. 4563 # a dlpreopen symbol table.
3236 func_generate_dlsyms () 4564 func_generate_dlsyms ()
3237 { 4565 {
3238 $opt_debug 4566 $debug_cmd
3239 my_outputname="$1" 4567
3240 my_originator="$2" 4568 my_outputname=$1
3241 my_pic_p="${3-no}" 4569 my_originator=$2
3242 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` 4570 my_pic_p=${3-false}
4571 my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
3243 my_dlsyms= 4572 my_dlsyms=
3244 4573
3245 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 4574 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
3246 if test -n "$NM" && test -n "$global_symbol_pipe"; then 4575 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3247 » my_dlsyms="${my_outputname}S.c" 4576 » my_dlsyms=${my_outputname}S.c
3248 else 4577 else
3249 func_error "not configured to extract global symbols from dlpreopened fi les" 4578 func_error "not configured to extract global symbols from dlpreopened fi les"
3250 fi 4579 fi
3251 fi 4580 fi
3252 4581
3253 if test -n "$my_dlsyms"; then 4582 if test -n "$my_dlsyms"; then
3254 case $my_dlsyms in 4583 case $my_dlsyms in
3255 "") ;; 4584 "") ;;
3256 *.c) 4585 *.c)
3257 # Discover the nlist of each of the dlfiles. 4586 # Discover the nlist of each of the dlfiles.
3258 » nlist="$output_objdir/${my_outputname}.nm" 4587 » nlist=$output_objdir/$my_outputname.nm
3259 4588
3260 func_show_eval "$RM $nlist ${nlist}S ${nlist}T" 4589 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3261 4590
3262 # Parse the name list into a source file. 4591 # Parse the name list into a source file.
3263 func_verbose "creating $output_objdir/$my_dlsyms" 4592 func_verbose "creating $output_objdir/$my_dlsyms"
3264 4593
3265 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ 4594 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3266 /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. * / 4595 /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
3267 /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ 4596 /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
3268 4597
3269 #ifdef __cplusplus 4598 #ifdef __cplusplus
3270 extern \"C\" { 4599 extern \"C\" {
3271 #endif 4600 #endif
3272 4601
3273 #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC_ _ > 4)) 4602 #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3274 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" 4603 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3275 #endif 4604 #endif
3276 4605
3277 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. * / 4606 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. * /
3278 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) 4607 #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
3279 /* DATA imports from DLLs on WIN32 con't be const, because runtime 4608 /* DATA imports from DLLs on WIN32 can't be const, because runtime
3280 relocations are performed -- see ld's documentation on pseudo-relocs. */ 4609 relocations are performed -- see ld's documentation on pseudo-relocs. */
3281 # define LT_DLSYM_CONST 4610 # define LT_DLSYM_CONST
3282 #elif defined(__osf__) 4611 #elif defined __osf__
3283 /* This system does not cope well with relocations in const data. */ 4612 /* This system does not cope well with relocations in const data. */
3284 # define LT_DLSYM_CONST 4613 # define LT_DLSYM_CONST
3285 #else 4614 #else
3286 # define LT_DLSYM_CONST const 4615 # define LT_DLSYM_CONST const
3287 #endif 4616 #endif
3288 4617
4618 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
4619
3289 /* External symbol declarations for the compiler. */\ 4620 /* External symbol declarations for the compiler. */\
3290 " 4621 "
3291 4622
3292 » if test "$dlself" = yes; then 4623 » if test yes = "$dlself"; then
3293 » func_verbose "generating symbol list for \`$output'" 4624 » func_verbose "generating symbol list for '$output'"
3294 4625
3295 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" 4626 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3296 4627
3297 # Add our own program objects to the symbol list. 4628 # Add our own program objects to the symbol list.
3298 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` 4629 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3299 for progfile in $progfiles; do 4630 for progfile in $progfiles; do
3300 func_to_tool_file "$progfile" func_convert_file_msys_to_w32 4631 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3301 » func_verbose "extracting global C symbols from \`$func_to_tool_file_ result'" 4632 » func_verbose "extracting global C symbols from '$func_to_tool_file_r esult'"
3302 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol _pipe >> '$nlist'" 4633 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol _pipe >> '$nlist'"
3303 done 4634 done
3304 4635
3305 if test -n "$exclude_expsyms"; then 4636 if test -n "$exclude_expsyms"; then
3306 $opt_dry_run || { 4637 $opt_dry_run || {
3307 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' 4638 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3308 eval '$MV "$nlist"T "$nlist"' 4639 eval '$MV "$nlist"T "$nlist"'
3309 } 4640 }
3310 fi 4641 fi
3311 4642
3312 if test -n "$export_symbols_regex"; then 4643 if test -n "$export_symbols_regex"; then
3313 $opt_dry_run || { 4644 $opt_dry_run || {
3314 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' 4645 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3315 eval '$MV "$nlist"T "$nlist"' 4646 eval '$MV "$nlist"T "$nlist"'
3316 } 4647 }
3317 fi 4648 fi
3318 4649
3319 # Prepare the list of exported symbols 4650 # Prepare the list of exported symbols
3320 if test -z "$export_symbols"; then 4651 if test -z "$export_symbols"; then
3321 » export_symbols="$output_objdir/$outputname.exp" 4652 » export_symbols=$output_objdir/$outputname.exp
3322 $opt_dry_run || { 4653 $opt_dry_run || {
3323 $RM $export_symbols 4654 $RM $export_symbols
3324 » eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' 4655 » eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< " $nlist" > "$export_symbols"'
3325 case $host in 4656 case $host in
3326 *cygwin* | *mingw* | *cegcc* ) 4657 *cygwin* | *mingw* | *cegcc* )
3327 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 4658 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3328 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' 4659 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3329 ;; 4660 ;;
3330 esac 4661 esac
3331 } 4662 }
3332 else 4663 else
3333 $opt_dry_run || { 4664 $opt_dry_run || {
3334 » eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'" ' < "$export_symbols" > "$output_objdir/$outputname.exp"' 4665 » eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3335 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nli st"T' 4666 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nli st"T'
3336 eval '$MV "$nlist"T "$nlist"' 4667 eval '$MV "$nlist"T "$nlist"'
3337 case $host in 4668 case $host in
3338 *cygwin* | *mingw* | *cegcc* ) 4669 *cygwin* | *mingw* | *cegcc* )
3339 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' 4670 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3340 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' 4671 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3341 ;; 4672 ;;
3342 esac 4673 esac
3343 } 4674 }
3344 fi 4675 fi
3345 fi 4676 fi
3346 4677
3347 for dlprefile in $dlprefiles; do 4678 for dlprefile in $dlprefiles; do
3348 » func_verbose "extracting global C symbols from \`$dlprefile'" 4679 » func_verbose "extracting global C symbols from '$dlprefile'"
3349 func_basename "$dlprefile" 4680 func_basename "$dlprefile"
3350 » name="$func_basename_result" 4681 » name=$func_basename_result
3351 case $host in 4682 case $host in
3352 *cygwin* | *mingw* | *cegcc* ) 4683 *cygwin* | *mingw* | *cegcc* )
3353 # if an import library, we need to obtain dlname 4684 # if an import library, we need to obtain dlname
3354 if func_win32_import_lib_p "$dlprefile"; then 4685 if func_win32_import_lib_p "$dlprefile"; then
3355 func_tr_sh "$dlprefile" 4686 func_tr_sh "$dlprefile"
3356 eval "curr_lafile=\$libfile_$func_tr_sh_result" 4687 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3357 » dlprefile_dlbasename="" 4688 » dlprefile_dlbasename=
3358 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then 4689 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3359 # Use subshell, to avoid clobbering current variable values 4690 # Use subshell, to avoid clobbering current variable values
3360 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` 4691 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3361 » if test -n "$dlprefile_dlname" ; then 4692 » if test -n "$dlprefile_dlname"; then
3362 func_basename "$dlprefile_dlname" 4693 func_basename "$dlprefile_dlname"
3363 » dlprefile_dlbasename="$func_basename_result" 4694 » dlprefile_dlbasename=$func_basename_result
3364 else 4695 else
3365 # no lafile. user explicitly requested -dlpreopen <import li brary>. 4696 # no lafile. user explicitly requested -dlpreopen <import li brary>.
3366 $sharedlib_from_linklib_cmd "$dlprefile" 4697 $sharedlib_from_linklib_cmd "$dlprefile"
3367 dlprefile_dlbasename=$sharedlib_from_linklib_result 4698 dlprefile_dlbasename=$sharedlib_from_linklib_result
3368 fi 4699 fi
3369 fi 4700 fi
3370 $opt_dry_run || { 4701 $opt_dry_run || {
3371 » if test -n "$dlprefile_dlbasename" ; then 4702 » if test -n "$dlprefile_dlbasename"; then
3372 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' 4703 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3373 else 4704 else
3374 func_warning "Could not compute DLL name from $name" 4705 func_warning "Could not compute DLL name from $name"
3375 eval '$ECHO ": $name " >> "$nlist"' 4706 eval '$ECHO ": $name " >> "$nlist"'
3376 fi 4707 fi
3377 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 4708 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3378 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_ symbol_pipe | 4709 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_ symbol_pipe |
3379 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist '" 4710 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist '"
3380 } 4711 }
3381 else # not an import lib 4712 else # not an import lib
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3417 else 4748 else
3418 $GREP -v "^: " < "$nlist" > "$nlist"S 4749 $GREP -v "^: " < "$nlist" > "$nlist"S
3419 fi 4750 fi
3420 4751
3421 if test -f "$nlist"S; then 4752 if test -f "$nlist"S; then
3422 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_d lsyms"' 4753 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_d lsyms"'
3423 else 4754 else
3424 echo '/* NONE */' >> "$output_objdir/$my_dlsyms" 4755 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3425 fi 4756 fi
3426 4757
4758 func_show_eval '$RM "${nlist}I"'
4759 if test -n "$global_symbol_to_import"; then
4760 eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
4761 fi
4762
3427 echo >> "$output_objdir/$my_dlsyms" "\ 4763 echo >> "$output_objdir/$my_dlsyms" "\
3428 4764
3429 /* The mapping between symbol names and symbols. */ 4765 /* The mapping between symbol names and symbols. */
3430 typedef struct { 4766 typedef struct {
3431 const char *name; 4767 const char *name;
3432 void *address; 4768 void *address;
3433 } lt_dlsymlist; 4769 } lt_dlsymlist;
3434 extern LT_DLSYM_CONST lt_dlsymlist 4770 extern LT_DLSYM_CONST lt_dlsymlist
3435 lt_${my_prefix}_LTX_preloaded_symbols[]; 4771 lt_${my_prefix}_LTX_preloaded_symbols[];\
4772 "
4773
4774 » if test -s "$nlist"I; then
4775 » echo >> "$output_objdir/$my_dlsyms" "\
4776 static void lt_syminit(void)
4777 {
4778 LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
4779 for (; symbol->name; ++symbol)
4780 {"
4781 » $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
4782 » echo >> "$output_objdir/$my_dlsyms" "\
4783 }
4784 }"
4785 » fi
4786 » echo >> "$output_objdir/$my_dlsyms" "\
3436 LT_DLSYM_CONST lt_dlsymlist 4787 LT_DLSYM_CONST lt_dlsymlist
3437 lt_${my_prefix}_LTX_preloaded_symbols[] = 4788 lt_${my_prefix}_LTX_preloaded_symbols[] =
3438 {\ 4789 { {\"$my_originator\", (void *) 0},"
3439 { \"$my_originator\", (void *) 0 }," 4790
4791 » if test -s "$nlist"I; then
4792 » echo >> "$output_objdir/$my_dlsyms" "\
4793 {\"@INIT@\", (void *) &lt_syminit},"
4794 » fi
3440 4795
3441 case $need_lib_prefix in 4796 case $need_lib_prefix in
3442 no) 4797 no)
3443 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdi r/$my_dlsyms" 4798 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdi r/$my_dlsyms"
3444 ;; 4799 ;;
3445 *) 4800 *)
3446 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$o utput_objdir/$my_dlsyms" 4801 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$o utput_objdir/$my_dlsyms"
3447 ;; 4802 ;;
3448 esac 4803 esac
3449 echo >> "$output_objdir/$my_dlsyms" "\ 4804 echo >> "$output_objdir/$my_dlsyms" "\
(...skipping 21 matching lines...) Expand all
3471 # compiling the symbol table file with pic_flag works around 4826 # compiling the symbol table file with pic_flag works around
3472 # a FreeBSD bug that causes programs to crash when -lm is 4827 # a FreeBSD bug that causes programs to crash when -lm is
3473 # linked before any other PIC object. But we must not use 4828 # linked before any other PIC object. But we must not use
3474 # pic_flag when linking with -static. The problem exists in 4829 # pic_flag when linking with -static. The problem exists in
3475 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. 4830 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3476 *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) 4831 *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3477 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; 4832 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
3478 *-*-hpux*) 4833 *-*-hpux*)
3479 pic_flag_for_symtable=" $pic_flag" ;; 4834 pic_flag_for_symtable=" $pic_flag" ;;
3480 *) 4835 *)
3481 » if test "X$my_pic_p" != Xno; then 4836 » $my_pic_p && pic_flag_for_symtable=" $pic_flag"
3482 » pic_flag_for_symtable=" $pic_flag"
3483 » fi
3484 ;; 4837 ;;
3485 esac 4838 esac
3486 ;; 4839 ;;
3487 esac 4840 esac
3488 symtab_cflags= 4841 symtab_cflags=
3489 for arg in $LTCFLAGS; do 4842 for arg in $LTCFLAGS; do
3490 case $arg in 4843 case $arg in
3491 -pie | -fpie | -fPIE) ;; 4844 -pie | -fpie | -fPIE) ;;
3492 *) func_append symtab_cflags " $arg" ;; 4845 *) func_append symtab_cflags " $arg" ;;
3493 esac 4846 esac
3494 done 4847 done
3495 4848
3496 # Now compile the dynamic symbol file. 4849 # Now compile the dynamic symbol file.
3497 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_ flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' 4850 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_ flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3498 4851
3499 # Clean up the generated files. 4852 # Clean up the generated files.
3500 » func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${ nlist}T"' 4853 » func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${ nlist}T" "${nlist}I"'
3501 4854
3502 # Transform the symbol file into the correct name. 4855 # Transform the symbol file into the correct name.
3503 » symfileobj="$output_objdir/${my_outputname}S.$objext" 4856 » symfileobj=$output_objdir/${my_outputname}S.$objext
3504 case $host in 4857 case $host in
3505 *cygwin* | *mingw* | *cegcc* ) 4858 *cygwin* | *mingw* | *cegcc* )
3506 if test -f "$output_objdir/$my_outputname.def"; then 4859 if test -f "$output_objdir/$my_outputname.def"; then
3507 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$outpu t_objdir/$my_outputname.def $symfileobj%"` 4860 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$outpu t_objdir/$my_outputname.def $symfileobj%"`
3508 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$out put_objdir/$my_outputname.def $symfileobj%"` 4861 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$out put_objdir/$my_outputname.def $symfileobj%"`
3509 else 4862 else
3510 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfi leobj%"` 4863 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfi leobj%"`
3511 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$sym fileobj%"` 4864 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$sym fileobj%"`
3512 fi 4865 fi
3513 ;; 4866 ;;
3514 *) 4867 *)
3515 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfile obj%"` 4868 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfile obj%"`
3516 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfi leobj%"` 4869 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfi leobj%"`
3517 ;; 4870 ;;
3518 esac 4871 esac
3519 ;; 4872 ;;
3520 *) 4873 *)
3521 » func_fatal_error "unknown suffix for \`$my_dlsyms'" 4874 » func_fatal_error "unknown suffix for '$my_dlsyms'"
3522 ;; 4875 ;;
3523 esac 4876 esac
3524 else 4877 else
3525 # We keep going just in case the user didn't refer to 4878 # We keep going just in case the user didn't refer to
3526 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe 4879 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3527 # really was required. 4880 # really was required.
3528 4881
3529 # Nullify the symbol file. 4882 # Nullify the symbol file.
3530 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` 4883 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
3531 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` 4884 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
3532 fi 4885 fi
3533 } 4886 }
3534 4887
4888 # func_cygming_gnu_implib_p ARG
4889 # This predicate returns with zero status (TRUE) if
4890 # ARG is a GNU/binutils-style import library. Returns
4891 # with nonzero status (FALSE) otherwise.
4892 func_cygming_gnu_implib_p ()
4893 {
4894 $debug_cmd
4895
4896 func_to_tool_file "$1" func_convert_file_msys_to_w32
4897 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_s ymbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$' `
4898 test -n "$func_cygming_gnu_implib_tmp"
4899 }
4900
4901 # func_cygming_ms_implib_p ARG
4902 # This predicate returns with zero status (TRUE) if
4903 # ARG is an MS-style import library. Returns
4904 # with nonzero status (FALSE) otherwise.
4905 func_cygming_ms_implib_p ()
4906 {
4907 $debug_cmd
4908
4909 func_to_tool_file "$1" func_convert_file_msys_to_w32
4910 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_sy mbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4911 test -n "$func_cygming_ms_implib_tmp"
4912 }
4913
3535 # func_win32_libid arg 4914 # func_win32_libid arg
3536 # return the library type of file 'arg' 4915 # return the library type of file 'arg'
3537 # 4916 #
3538 # Need a lot of goo to handle *both* DLLs and import libs 4917 # Need a lot of goo to handle *both* DLLs and import libs
3539 # Has to be a shell function in order to 'eat' the argument 4918 # Has to be a shell function in order to 'eat' the argument
3540 # that is supplied when $file_magic_command is called. 4919 # that is supplied when $file_magic_command is called.
3541 # Despite the name, also deal with 64 bit binaries. 4920 # Despite the name, also deal with 64 bit binaries.
3542 func_win32_libid () 4921 func_win32_libid ()
3543 { 4922 {
3544 $opt_debug 4923 $debug_cmd
3545 win32_libid_type="unknown" 4924
4925 win32_libid_type=unknown
3546 win32_fileres=`file -L $1 2>/dev/null` 4926 win32_fileres=`file -L $1 2>/dev/null`
3547 case $win32_fileres in 4927 case $win32_fileres in
3548 *ar\ archive\ import\ library*) # definitely import 4928 *ar\ archive\ import\ library*) # definitely import
3549 win32_libid_type="x86 archive import" 4929 win32_libid_type="x86 archive import"
3550 ;; 4930 ;;
3551 *ar\ archive*) # could be an import, or static 4931 *ar\ archive*) # could be an import, or static
3552 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. 4932 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3553 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | 4933 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3554 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86 -64)' >/dev/null; then 4934 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86 -64)' >/dev/null; then
3555 func_to_tool_file "$1" func_convert_file_msys_to_w32 4935 case $nm_interface in
3556 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | 4936 "MS dumpbin")
3557 » $SED -n -e ' 4937 » if func_cygming_ms_implib_p "$1" ||
4938 » func_cygming_gnu_implib_p "$1"
4939 » then
4940 » win32_nmres=import
4941 » else
4942 » win32_nmres=
4943 » fi
4944 » ;;
4945 *)
4946 » func_to_tool_file "$1" func_convert_file_msys_to_w32
4947 » win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
4948 » $SED -n -e '
3558 1,100{ 4949 1,100{
3559 / I /{ 4950 / I /{
3560 » » s,.*,import, 4951 » » s|.*|import|
3561 p 4952 p
3562 q 4953 q
3563 } 4954 }
3564 }'` 4955 }'`
4956 ;;
4957 esac
3565 case $win32_nmres in 4958 case $win32_nmres in
3566 import*) win32_libid_type="x86 archive import";; 4959 import*) win32_libid_type="x86 archive import";;
3567 *) win32_libid_type="x86 archive static";; 4960 *) win32_libid_type="x86 archive static";;
3568 esac 4961 esac
3569 fi 4962 fi
3570 ;; 4963 ;;
3571 *DLL*) 4964 *DLL*)
3572 win32_libid_type="x86 DLL" 4965 win32_libid_type="x86 DLL"
3573 ;; 4966 ;;
3574 *executable*) # but shell scripts are "executable" too... 4967 *executable*) # but shell scripts are "executable" too...
(...skipping 11 matching lines...) Expand all
3586 # 4979 #
3587 # Platform-specific function to extract the 4980 # Platform-specific function to extract the
3588 # name of the DLL associated with the specified 4981 # name of the DLL associated with the specified
3589 # import library ARG. 4982 # import library ARG.
3590 # Invoked by eval'ing the libtool variable 4983 # Invoked by eval'ing the libtool variable
3591 # $sharedlib_from_linklib_cmd 4984 # $sharedlib_from_linklib_cmd
3592 # Result is available in the variable 4985 # Result is available in the variable
3593 # $sharedlib_from_linklib_result 4986 # $sharedlib_from_linklib_result
3594 func_cygming_dll_for_implib () 4987 func_cygming_dll_for_implib ()
3595 { 4988 {
3596 $opt_debug 4989 $debug_cmd
4990
3597 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` 4991 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3598 } 4992 }
3599 4993
3600 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs 4994 # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
3601 # 4995 #
3602 # The is the core of a fallback implementation of a 4996 # The is the core of a fallback implementation of a
3603 # platform-specific function to extract the name of the 4997 # platform-specific function to extract the name of the
3604 # DLL associated with the specified import library LIBNAME. 4998 # DLL associated with the specified import library LIBNAME.
3605 # 4999 #
3606 # SECTION_NAME is either .idata$6 or .idata$7, depending 5000 # SECTION_NAME is either .idata$6 or .idata$7, depending
3607 # on the platform and compiler that created the implib. 5001 # on the platform and compiler that created the implib.
3608 # 5002 #
3609 # Echos the name of the DLL associated with the 5003 # Echos the name of the DLL associated with the
3610 # specified import library. 5004 # specified import library.
3611 func_cygming_dll_for_implib_fallback_core () 5005 func_cygming_dll_for_implib_fallback_core ()
3612 { 5006 {
3613 $opt_debug 5007 $debug_cmd
5008
3614 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` 5009 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3615 $OBJDUMP -s --section "$1" "$2" 2>/dev/null | 5010 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3616 $SED '/^Contents of section '"$match_literal"':/{ 5011 $SED '/^Contents of section '"$match_literal"':/{
3617 # Place marker at beginning of archive member dllname section 5012 # Place marker at beginning of archive member dllname section
3618 s/.*/====MARK====/ 5013 s/.*/====MARK====/
3619 p 5014 p
3620 d 5015 d
3621 } 5016 }
3622 # These lines can sometimes be longer than 43 characters, but 5017 # These lines can sometimes be longer than 43 characters, but
3623 # are always uninteresting 5018 # are always uninteresting
(...skipping 15 matching lines...) Expand all
3639 x 5034 x
3640 s/\n//g 5035 s/\n//g
3641 # Remove the marker 5036 # Remove the marker
3642 s/^====MARK====// 5037 s/^====MARK====//
3643 # Remove trailing dots and whitespace 5038 # Remove trailing dots and whitespace
3644 s/[\. \t]*$// 5039 s/[\. \t]*$//
3645 # Print 5040 # Print
3646 /./p' | 5041 /./p' |
3647 # we now have a list, one entry per line, of the stringified 5042 # we now have a list, one entry per line, of the stringified
3648 # contents of the appropriate section of all members of the 5043 # contents of the appropriate section of all members of the
3649 # archive which possess that section. Heuristic: eliminate 5044 # archive that possess that section. Heuristic: eliminate
3650 # all those which have a first or second character that is 5045 # all those that have a first or second character that is
3651 # a '.' (that is, objdump's representation of an unprintable 5046 # a '.' (that is, objdump's representation of an unprintable
3652 # character.) This should work for all archives with less than 5047 # character.) This should work for all archives with less than
3653 # 0x302f exports -- but will fail for DLLs whose name actually 5048 # 0x302f exports -- but will fail for DLLs whose name actually
3654 # begins with a literal '.' or a single character followed by 5049 # begins with a literal '.' or a single character followed by
3655 # a '.'. 5050 # a '.'.
3656 # 5051 #
3657 # Of those that remain, print the first one. 5052 # Of those that remain, print the first one.
3658 $SED -e '/^\./d;/^.\./d;q' 5053 $SED -e '/^\./d;/^.\./d;q'
3659 } 5054 }
3660 5055
3661 # func_cygming_gnu_implib_p ARG
3662 # This predicate returns with zero status (TRUE) if
3663 # ARG is a GNU/binutils-style import library. Returns
3664 # with nonzero status (FALSE) otherwise.
3665 func_cygming_gnu_implib_p ()
3666 {
3667 $opt_debug
3668 func_to_tool_file "$1" func_convert_file_msys_to_w32
3669 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_s ymbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$' `
3670 test -n "$func_cygming_gnu_implib_tmp"
3671 }
3672
3673 # func_cygming_ms_implib_p ARG
3674 # This predicate returns with zero status (TRUE) if
3675 # ARG is an MS-style import library. Returns
3676 # with nonzero status (FALSE) otherwise.
3677 func_cygming_ms_implib_p ()
3678 {
3679 $opt_debug
3680 func_to_tool_file "$1" func_convert_file_msys_to_w32
3681 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_sy mbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3682 test -n "$func_cygming_ms_implib_tmp"
3683 }
3684
3685 # func_cygming_dll_for_implib_fallback ARG 5056 # func_cygming_dll_for_implib_fallback ARG
3686 # Platform-specific function to extract the 5057 # Platform-specific function to extract the
3687 # name of the DLL associated with the specified 5058 # name of the DLL associated with the specified
3688 # import library ARG. 5059 # import library ARG.
3689 # 5060 #
3690 # This fallback implementation is for use when $DLLTOOL 5061 # This fallback implementation is for use when $DLLTOOL
3691 # does not support the --identify-strict option. 5062 # does not support the --identify-strict option.
3692 # Invoked by eval'ing the libtool variable 5063 # Invoked by eval'ing the libtool variable
3693 # $sharedlib_from_linklib_cmd 5064 # $sharedlib_from_linklib_cmd
3694 # Result is available in the variable 5065 # Result is available in the variable
3695 # $sharedlib_from_linklib_result 5066 # $sharedlib_from_linklib_result
3696 func_cygming_dll_for_implib_fallback () 5067 func_cygming_dll_for_implib_fallback ()
3697 { 5068 {
3698 $opt_debug 5069 $debug_cmd
3699 if func_cygming_gnu_implib_p "$1" ; then 5070
5071 if func_cygming_gnu_implib_p "$1"; then
3700 # binutils import library 5072 # binutils import library
3701 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.i data$7' "$1"` 5073 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.i data$7' "$1"`
3702 elif func_cygming_ms_implib_p "$1" ; then 5074 elif func_cygming_ms_implib_p "$1"; then
3703 # ms-generated import library 5075 # ms-generated import library
3704 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.i data$6' "$1"` 5076 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.i data$6' "$1"`
3705 else 5077 else
3706 # unknown 5078 # unknown
3707 sharedlib_from_linklib_result="" 5079 sharedlib_from_linklib_result=
3708 fi 5080 fi
3709 } 5081 }
3710 5082
3711 5083
3712 # func_extract_an_archive dir oldlib 5084 # func_extract_an_archive dir oldlib
3713 func_extract_an_archive () 5085 func_extract_an_archive ()
3714 { 5086 {
3715 $opt_debug 5087 $debug_cmd
3716 f_ex_an_ar_dir="$1"; shift 5088
3717 f_ex_an_ar_oldlib="$1" 5089 f_ex_an_ar_dir=$1; shift
3718 if test "$lock_old_archive_extraction" = yes; then 5090 f_ex_an_ar_oldlib=$1
5091 if test yes = "$lock_old_archive_extraction"; then
3719 lockfile=$f_ex_an_ar_oldlib.lock 5092 lockfile=$f_ex_an_ar_oldlib.lock
3720 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do 5093 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3721 func_echo "Waiting for $lockfile to be removed" 5094 func_echo "Waiting for $lockfile to be removed"
3722 sleep 2 5095 sleep 2
3723 done 5096 done
3724 fi 5097 fi
3725 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 5098 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
3726 'stat=$?; rm -f "$lockfile"; exit $stat' 5099 'stat=$?; rm -f "$lockfile"; exit $stat'
3727 if test "$lock_old_archive_extraction" = yes; then 5100 if test yes = "$lock_old_archive_extraction"; then
3728 $opt_dry_run || rm -f "$lockfile" 5101 $opt_dry_run || rm -f "$lockfile"
3729 fi 5102 fi
3730 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then 5103 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
3731 : 5104 :
3732 else 5105 else
3733 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_ an_ar_oldlib" 5106 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_ an_ar_oldlib"
3734 fi 5107 fi
3735 } 5108 }
3736 5109
3737 5110
3738 # func_extract_archives gentop oldlib ... 5111 # func_extract_archives gentop oldlib ...
3739 func_extract_archives () 5112 func_extract_archives ()
3740 { 5113 {
3741 $opt_debug 5114 $debug_cmd
3742 my_gentop="$1"; shift 5115
5116 my_gentop=$1; shift
3743 my_oldlibs=${1+"$@"} 5117 my_oldlibs=${1+"$@"}
3744 my_oldobjs="" 5118 my_oldobjs=
3745 my_xlib="" 5119 my_xlib=
3746 my_xabs="" 5120 my_xabs=
3747 my_xdir="" 5121 my_xdir=
3748 5122
3749 for my_xlib in $my_oldlibs; do 5123 for my_xlib in $my_oldlibs; do
3750 # Extract the objects. 5124 # Extract the objects.
3751 case $my_xlib in 5125 case $my_xlib in
3752 » [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; 5126 » [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
3753 *) my_xabs=`pwd`"/$my_xlib" ;; 5127 *) my_xabs=`pwd`"/$my_xlib" ;;
3754 esac 5128 esac
3755 func_basename "$my_xlib" 5129 func_basename "$my_xlib"
3756 my_xlib="$func_basename_result" 5130 my_xlib=$func_basename_result
3757 my_xlib_u=$my_xlib 5131 my_xlib_u=$my_xlib
3758 while :; do 5132 while :; do
3759 case " $extracted_archives " in 5133 case " $extracted_archives " in
3760 *" $my_xlib_u "*) 5134 *" $my_xlib_u "*)
3761 func_arith $extracted_serial + 1 5135 func_arith $extracted_serial + 1
3762 extracted_serial=$func_arith_result 5136 extracted_serial=$func_arith_result
3763 my_xlib_u=lt$extracted_serial-$my_xlib ;; 5137 my_xlib_u=lt$extracted_serial-$my_xlib ;;
3764 *) break ;; 5138 *) break ;;
3765 esac 5139 esac
3766 done 5140 done
3767 extracted_archives="$extracted_archives $my_xlib_u" 5141 extracted_archives="$extracted_archives $my_xlib_u"
3768 my_xdir="$my_gentop/$my_xlib_u" 5142 my_xdir=$my_gentop/$my_xlib_u
3769 5143
3770 func_mkdir_p "$my_xdir" 5144 func_mkdir_p "$my_xdir"
3771 5145
3772 case $host in 5146 case $host in
3773 *-darwin*) 5147 *-darwin*)
3774 func_verbose "Extracting $my_xabs" 5148 func_verbose "Extracting $my_xabs"
3775 # Do not bother doing anything if just a dry run 5149 # Do not bother doing anything if just a dry run
3776 $opt_dry_run || { 5150 $opt_dry_run || {
3777 darwin_orig_dir=`pwd` 5151 darwin_orig_dir=`pwd`
3778 cd $my_xdir || exit $? 5152 cd $my_xdir || exit $?
3779 darwin_archive=$my_xabs 5153 darwin_archive=$my_xabs
3780 darwin_curdir=`pwd` 5154 darwin_curdir=`pwd`
3781 » darwin_base_archive=`basename "$darwin_archive"` 5155 » func_basename "$darwin_archive"
5156 » darwin_base_archive=$func_basename_result
3782 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Archi tectures 2>/dev/null || true` 5157 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Archi tectures 2>/dev/null || true`
3783 if test -n "$darwin_arches"; then 5158 if test -n "$darwin_arches"; then
3784 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` 5159 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
3785 darwin_arch= 5160 darwin_arch=
3786 func_verbose "$darwin_base_archive has multiple architectures $darwi n_arches" 5161 func_verbose "$darwin_base_archive has multiple architectures $darwi n_arches"
3787 » for darwin_arch in $darwin_arches ; do 5162 » for darwin_arch in $darwin_arches; do
3788 » func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" 5163 » func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
3789 » $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}- ${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" 5164 » $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$d arwin_arch/$darwin_base_archive" "$darwin_archive"
3790 » cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" 5165 » cd "unfat-$$/$darwin_base_archive-$darwin_arch"
3791 » func_extract_an_archive "`pwd`" "${darwin_base_archive}" 5166 » func_extract_an_archive "`pwd`" "$darwin_base_archive"
3792 cd "$darwin_curdir" 5167 cd "$darwin_curdir"
3793 » $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_ archive}" 5168 » $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archi ve"
3794 done # $darwin_arches 5169 done # $darwin_arches
3795 ## Okay now we've a bunch of thin objects, gotta fatten them up :) 5170 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
3796 » darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \* .lo -print | $SED -e "$basename" | sort -u` 5171 » darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \* .lo -print | $SED -e "$sed_basename" | sort -u`
3797 darwin_file= 5172 darwin_file=
3798 darwin_files= 5173 darwin_files=
3799 for darwin_file in $darwin_filelist; do 5174 for darwin_file in $darwin_filelist; do
3800 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL 2SP` 5175 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL 2SP`
3801 $LIPO -create -output "$darwin_file" $darwin_files 5176 $LIPO -create -output "$darwin_file" $darwin_files
3802 done # $darwin_filelist 5177 done # $darwin_filelist
3803 $RM -rf unfat-$$ 5178 $RM -rf unfat-$$
3804 cd "$darwin_orig_dir" 5179 cd "$darwin_orig_dir"
3805 else 5180 else
3806 cd $darwin_orig_dir 5181 cd $darwin_orig_dir
3807 func_extract_an_archive "$my_xdir" "$my_xabs" 5182 func_extract_an_archive "$my_xdir" "$my_xabs"
3808 fi # $darwin_arches 5183 fi # $darwin_arches
3809 } # !$opt_dry_run 5184 } # !$opt_dry_run
3810 ;; 5185 ;;
3811 *) 5186 *)
3812 func_extract_an_archive "$my_xdir" "$my_xabs" 5187 func_extract_an_archive "$my_xdir" "$my_xabs"
3813 ;; 5188 ;;
3814 esac 5189 esac
3815 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \ *.lo -print | sort | $NL2SP` 5190 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \ *.lo -print | sort | $NL2SP`
3816 done 5191 done
3817 5192
3818 func_extract_archives_result="$my_oldobjs" 5193 func_extract_archives_result=$my_oldobjs
3819 } 5194 }
3820 5195
3821 5196
3822 # func_emit_wrapper [arg=no] 5197 # func_emit_wrapper [arg=no]
3823 # 5198 #
3824 # Emit a libtool wrapper script on stdout. 5199 # Emit a libtool wrapper script on stdout.
3825 # Don't directly open a file because we may want to 5200 # Don't directly open a file because we may want to
3826 # incorporate the script contents within a cygwin/mingw 5201 # incorporate the script contents within a cygwin/mingw
3827 # wrapper executable. Must ONLY be called from within 5202 # wrapper executable. Must ONLY be called from within
3828 # func_mode_link because it depends on a number of variables 5203 # func_mode_link because it depends on a number of variables
3829 # set therein. 5204 # set therein.
3830 # 5205 #
3831 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR 5206 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3832 # variable will take. If 'yes', then the emitted script 5207 # variable will take. If 'yes', then the emitted script
3833 # will assume that the directory in which it is stored is 5208 # will assume that the directory where it is stored is
3834 # the $objdir directory. This is a cygwin/mingw-specific 5209 # the $objdir directory. This is a cygwin/mingw-specific
3835 # behavior. 5210 # behavior.
3836 func_emit_wrapper () 5211 func_emit_wrapper ()
3837 { 5212 {
3838 func_emit_wrapper_arg1=${1-no} 5213 func_emit_wrapper_arg1=${1-no}
3839 5214
3840 $ECHO "\ 5215 $ECHO "\
3841 #! $SHELL 5216 #! $SHELL
3842 5217
3843 # $output - temporary wrapper script for $objdir/$outputname 5218 # $output - temporary wrapper script for $objdir/$outputname
3844 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION 5219 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
3845 # 5220 #
3846 # The $output program cannot be directly executed until all the libtool 5221 # The $output program cannot be directly executed until all the libtool
3847 # libraries that it depends on are installed. 5222 # libraries that it depends on are installed.
3848 # 5223 #
3849 # This wrapper script should never be moved out of the build directory. 5224 # This wrapper script should never be moved out of the build directory.
3850 # If it is, it will not operate correctly. 5225 # If it is, it will not operate correctly.
3851 5226
3852 # Sed substitution that helps us do robust quoting. It backslashifies 5227 # Sed substitution that helps us do robust quoting. It backslashifies
3853 # metacharacters that are still active within double-quoted strings. 5228 # metacharacters that are still active within double-quoted strings.
3854 sed_quote_subst='$sed_quote_subst' 5229 sed_quote_subst='$sed_quote_subst'
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
3891 { 5266 {
3892 eval 'cat <<_LTECHO_EOF 5267 eval 'cat <<_LTECHO_EOF
3893 \$1 5268 \$1
3894 _LTECHO_EOF' 5269 _LTECHO_EOF'
3895 } 5270 }
3896 ECHO=\"$qECHO\" 5271 ECHO=\"$qECHO\"
3897 fi 5272 fi
3898 5273
3899 # Very basic option parsing. These options are (a) specific to 5274 # Very basic option parsing. These options are (a) specific to
3900 # the libtool wrapper, (b) are identical between the wrapper 5275 # the libtool wrapper, (b) are identical between the wrapper
3901 # /script/ and the wrapper /executable/ which is used only on 5276 # /script/ and the wrapper /executable/ that is used only on
3902 # windows platforms, and (c) all begin with the string "--lt-" 5277 # windows platforms, and (c) all begin with the string "--lt-"
3903 # (application programs are unlikely to have options which match 5278 # (application programs are unlikely to have options that match
3904 # this pattern). 5279 # this pattern).
3905 # 5280 #
3906 # There are only two supported options: --lt-debug and 5281 # There are only two supported options: --lt-debug and
3907 # --lt-dump-script. There is, deliberately, no --lt-help. 5282 # --lt-dump-script. There is, deliberately, no --lt-help.
3908 # 5283 #
3909 # The first argument to this parsing function should be the 5284 # The first argument to this parsing function should be the
3910 # script's $0 value, followed by "$@". 5285 # script's $0 value, followed by "$@".
3911 lt_option_debug= 5286 lt_option_debug=
3912 func_parse_lt_options () 5287 func_parse_lt_options ()
3913 { 5288 {
(...skipping 12 matching lines...) Expand all
3926 ;; 5301 ;;
3927 --lt-*) 5302 --lt-*)
3928 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 5303 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3929 exit 1 5304 exit 1
3930 ;; 5305 ;;
3931 esac 5306 esac
3932 done 5307 done
3933 5308
3934 # Print the debug banner immediately: 5309 # Print the debug banner immediately:
3935 if test -n \"\$lt_option_debug\"; then 5310 if test -n \"\$lt_option_debug\"; then
3936 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIM ESTAMP) $VERSION\" 1>&2 5311 echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION \" 1>&2
3937 fi 5312 fi
3938 } 5313 }
3939 5314
3940 # Used when --lt-debug. Prints its arguments to stdout 5315 # Used when --lt-debug. Prints its arguments to stdout
3941 # (redirection is the responsibility of the caller) 5316 # (redirection is the responsibility of the caller)
3942 func_lt_dump_args () 5317 func_lt_dump_args ()
3943 { 5318 {
3944 lt_dump_args_N=1; 5319 lt_dump_args_N=1;
3945 for lt_arg 5320 for lt_arg
3946 do 5321 do
3947 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt _arg\" 5322 \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
3948 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` 5323 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3949 done 5324 done
3950 } 5325 }
3951 5326
3952 # Core function for launching the target application 5327 # Core function for launching the target application
3953 func_exec_program_core () 5328 func_exec_program_core ()
3954 { 5329 {
3955 " 5330 "
3956 case $host in 5331 case $host in
3957 # Backslashes separate directories on plain windows 5332 # Backslashes separate directories on plain windows
3958 *-*-mingw | *-*-os2* | *-cegcc*) 5333 *-*-mingw | *-*-os2* | *-cegcc*)
3959 $ECHO "\ 5334 $ECHO "\
3960 if test -n \"\$lt_option_debug\"; then 5335 if test -n \"\$lt_option_debug\"; then
3961 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$ program\" 1>&2 5336 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$progra m\" 1>&2
3962 func_lt_dump_args \${1+\"\$@\"} 1>&2 5337 func_lt_dump_args \${1+\"\$@\"} 1>&2
3963 fi 5338 fi
3964 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} 5339 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3965 " 5340 "
3966 ;; 5341 ;;
3967 5342
3968 *) 5343 *)
3969 $ECHO "\ 5344 $ECHO "\
3970 if test -n \"\$lt_option_debug\"; then 5345 if test -n \"\$lt_option_debug\"; then
3971 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$pro gram\" 1>&2 5346 \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
3972 func_lt_dump_args \${1+\"\$@\"} 1>&2 5347 func_lt_dump_args \${1+\"\$@\"} 1>&2
3973 fi 5348 fi
3974 exec \"\$progdir/\$program\" \${1+\"\$@\"} 5349 exec \"\$progdir/\$program\" \${1+\"\$@\"}
3975 " 5350 "
3976 ;; 5351 ;;
3977 esac 5352 esac
3978 $ECHO "\ 5353 $ECHO "\
3979 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 5354 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3980 exit 1 5355 exit 1
3981 } 5356 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
4036 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$ %%'\` ;; 5411 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$ %%'\` ;;
4037 $objdir ) thisdir=. ;; 5412 $objdir ) thisdir=. ;;
4038 esac 5413 esac
4039 fi 5414 fi
4040 5415
4041 # Try to get the absolute directory name. 5416 # Try to get the absolute directory name.
4042 absdir=\`cd \"\$thisdir\" && pwd\` 5417 absdir=\`cd \"\$thisdir\" && pwd\`
4043 test -n \"\$absdir\" && thisdir=\"\$absdir\" 5418 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4044 " 5419 "
4045 5420
4046 » if test "$fast_install" = yes; then 5421 » if test yes = "$fast_install"; then
4047 $ECHO "\ 5422 $ECHO "\
4048 program=lt-'$outputname'$exeext 5423 program=lt-'$outputname'$exeext
4049 progdir=\"\$thisdir/$objdir\" 5424 progdir=\"\$thisdir/$objdir\"
4050 5425
4051 if test ! -f \"\$progdir/\$program\" || 5426 if test ! -f \"\$progdir/\$program\" ||
4052 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/ null | ${SED} 1q\`; \\ 5427 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/ null | $SED 1q\`; \\
4053 test \"X\$file\" != \"X\$progdir/\$program\"; }; then 5428 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4054 5429
4055 file=\"\$\$-\$program\" 5430 file=\"\$\$-\$program\"
4056 5431
4057 if test ! -d \"\$progdir\"; then 5432 if test ! -d \"\$progdir\"; then
4058 $MKDIR \"\$progdir\" 5433 $MKDIR \"\$progdir\"
4059 else 5434 else
4060 $RM \"\$progdir/\$file\" 5435 $RM \"\$progdir/\$file\"
4061 fi" 5436 fi"
4062 5437
4063 $ECHO "\ 5438 $ECHO "\
4064 5439
4065 # relink executable if necessary 5440 # relink executable if necessary
4066 if test -n \"\$relink_command\"; then 5441 if test -n \"\$relink_command\"; then
4067 if relink_command_output=\`eval \$relink_command 2>&1\`; then : 5442 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4068 else 5443 else
4069 » $ECHO \"\$relink_command_output\" >&2 5444 » \$ECHO \"\$relink_command_output\" >&2
4070 $RM \"\$progdir/\$file\" 5445 $RM \"\$progdir/\$file\"
4071 exit 1 5446 exit 1
4072 fi 5447 fi
4073 fi 5448 fi
4074 5449
4075 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || 5450 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4076 { $RM \"\$progdir/\$program\"; 5451 { $RM \"\$progdir/\$program\";
4077 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } 5452 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4078 $RM \"\$progdir/\$file\" 5453 $RM \"\$progdir/\$file\"
4079 fi" 5454 fi"
(...skipping 14 matching lines...) Expand all
4094 # to shlibpath, because on Windows, both are PATH and uninstalled 5469 # to shlibpath, because on Windows, both are PATH and uninstalled
4095 # libraries must come first. 5470 # libraries must come first.
4096 if test -n "$dllsearchpath"; then 5471 if test -n "$dllsearchpath"; then
4097 $ECHO "\ 5472 $ECHO "\
4098 # Add the dll search path components to the executable PATH 5473 # Add the dll search path components to the executable PATH
4099 PATH=$dllsearchpath:\$PATH 5474 PATH=$dllsearchpath:\$PATH
4100 " 5475 "
4101 fi 5476 fi
4102 5477
4103 # Export our shlibpath_var if we have one. 5478 # Export our shlibpath_var if we have one.
4104 » if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then 5479 » if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4105 $ECHO "\ 5480 $ECHO "\
4106 # Add our own library path to $shlibpath_var 5481 # Add our own library path to $shlibpath_var
4107 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" 5482 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4108 5483
4109 # Some systems cannot cope with colon-terminated $shlibpath_var 5484 # Some systems cannot cope with colon-terminated $shlibpath_var
4110 # The second colon is a workaround for a bug in BeOS R4 sed 5485 # The second colon is a workaround for a bug in BeOS R4 sed
4111 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` 5486 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
4112 5487
4113 export $shlibpath_var 5488 export $shlibpath_var
4114 " 5489 "
4115 fi 5490 fi
4116 5491
4117 $ECHO "\ 5492 $ECHO "\
4118 if test \"\$libtool_execute_magic\" != \"$magic\"; then 5493 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4119 # Run the actual program with our arguments. 5494 # Run the actual program with our arguments.
4120 func_exec_program \${1+\"\$@\"} 5495 func_exec_program \${1+\"\$@\"}
4121 fi 5496 fi
4122 else 5497 else
4123 # The program doesn't exist. 5498 # The program doesn't exist.
4124 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 5499 \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
4125 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 5500 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4126 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 5501 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4127 exit 1 5502 exit 1
4128 fi 5503 fi
4129 fi\ 5504 fi\
4130 " 5505 "
4131 } 5506 }
4132 5507
4133 5508
4134 # func_emit_cwrapperexe_src 5509 # func_emit_cwrapperexe_src
4135 # emit the source code for a wrapper executable on stdout 5510 # emit the source code for a wrapper executable on stdout
4136 # Must ONLY be called from within func_mode_link because 5511 # Must ONLY be called from within func_mode_link because
4137 # it depends on a number of variable set therein. 5512 # it depends on a number of variable set therein.
4138 func_emit_cwrapperexe_src () 5513 func_emit_cwrapperexe_src ()
4139 { 5514 {
4140 cat <<EOF 5515 cat <<EOF
4141 5516
4142 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname 5517 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4143 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION 5518 Generated by $PROGRAM (GNU $PACKAGE) $VERSION
4144 5519
4145 The $output program cannot be directly executed until all the libtool 5520 The $output program cannot be directly executed until all the libtool
4146 libraries that it depends on are installed. 5521 libraries that it depends on are installed.
4147 5522
4148 This wrapper executable should never be moved out of the build directory. 5523 This wrapper executable should never be moved out of the build directory.
4149 If it is, it will not operate correctly. 5524 If it is, it will not operate correctly.
4150 */ 5525 */
4151 EOF 5526 EOF
4152 cat <<"EOF" 5527 cat <<"EOF"
4153 #ifdef _MSC_VER 5528 #ifdef _MSC_VER
(...skipping 14 matching lines...) Expand all
4168 #endif 5543 #endif
4169 #include <malloc.h> 5544 #include <malloc.h>
4170 #include <stdarg.h> 5545 #include <stdarg.h>
4171 #include <assert.h> 5546 #include <assert.h>
4172 #include <string.h> 5547 #include <string.h>
4173 #include <ctype.h> 5548 #include <ctype.h>
4174 #include <errno.h> 5549 #include <errno.h>
4175 #include <fcntl.h> 5550 #include <fcntl.h>
4176 #include <sys/stat.h> 5551 #include <sys/stat.h>
4177 5552
5553 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
5554
4178 /* declarations of non-ANSI functions */ 5555 /* declarations of non-ANSI functions */
4179 #if defined(__MINGW32__) 5556 #if defined __MINGW32__
4180 # ifdef __STRICT_ANSI__ 5557 # ifdef __STRICT_ANSI__
4181 int _putenv (const char *); 5558 int _putenv (const char *);
4182 # endif 5559 # endif
4183 #elif defined(__CYGWIN__) 5560 #elif defined __CYGWIN__
4184 # ifdef __STRICT_ANSI__ 5561 # ifdef __STRICT_ANSI__
4185 char *realpath (const char *, char *); 5562 char *realpath (const char *, char *);
4186 int putenv (char *); 5563 int putenv (char *);
4187 int setenv (const char *, const char *, int); 5564 int setenv (const char *, const char *, int);
4188 # endif 5565 # endif
4189 /* #elif defined (other platforms) ... */ 5566 /* #elif defined other_platform || defined ... */
4190 #endif 5567 #endif
4191 5568
4192 /* portability defines, excluding path handling macros */ 5569 /* portability defines, excluding path handling macros */
4193 #if defined(_MSC_VER) 5570 #if defined _MSC_VER
4194 # define setmode _setmode 5571 # define setmode _setmode
4195 # define stat _stat 5572 # define stat _stat
4196 # define chmod _chmod 5573 # define chmod _chmod
4197 # define getcwd _getcwd 5574 # define getcwd _getcwd
4198 # define putenv _putenv 5575 # define putenv _putenv
4199 # define S_IXUSR _S_IEXEC 5576 # define S_IXUSR _S_IEXEC
4200 # ifndef _INTPTR_T_DEFINED 5577 #elif defined __MINGW32__
4201 # define _INTPTR_T_DEFINED
4202 # define intptr_t int
4203 # endif
4204 #elif defined(__MINGW32__)
4205 # define setmode _setmode 5578 # define setmode _setmode
4206 # define stat _stat 5579 # define stat _stat
4207 # define chmod _chmod 5580 # define chmod _chmod
4208 # define getcwd _getcwd 5581 # define getcwd _getcwd
4209 # define putenv _putenv 5582 # define putenv _putenv
4210 #elif defined(__CYGWIN__) 5583 #elif defined __CYGWIN__
4211 # define HAVE_SETENV 5584 # define HAVE_SETENV
4212 # define FOPEN_WB "wb" 5585 # define FOPEN_WB "wb"
4213 /* #elif defined (other platforms) ... */ 5586 /* #elif defined other platforms ... */
4214 #endif 5587 #endif
4215 5588
4216 #if defined(PATH_MAX) 5589 #if defined PATH_MAX
4217 # define LT_PATHMAX PATH_MAX 5590 # define LT_PATHMAX PATH_MAX
4218 #elif defined(MAXPATHLEN) 5591 #elif defined MAXPATHLEN
4219 # define LT_PATHMAX MAXPATHLEN 5592 # define LT_PATHMAX MAXPATHLEN
4220 #else 5593 #else
4221 # define LT_PATHMAX 1024 5594 # define LT_PATHMAX 1024
4222 #endif 5595 #endif
4223 5596
4224 #ifndef S_IXOTH 5597 #ifndef S_IXOTH
4225 # define S_IXOTH 0 5598 # define S_IXOTH 0
4226 #endif 5599 #endif
4227 #ifndef S_IXGRP 5600 #ifndef S_IXGRP
4228 # define S_IXGRP 0 5601 # define S_IXGRP 0
4229 #endif 5602 #endif
4230 5603
4231 /* path handling portability macros */ 5604 /* path handling portability macros */
4232 #ifndef DIR_SEPARATOR 5605 #ifndef DIR_SEPARATOR
4233 # define DIR_SEPARATOR '/' 5606 # define DIR_SEPARATOR '/'
4234 # define PATH_SEPARATOR ':' 5607 # define PATH_SEPARATOR ':'
4235 #endif 5608 #endif
4236 5609
4237 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ 5610 #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
4238 defined (__OS2__) 5611 defined __OS2__
4239 # define HAVE_DOS_BASED_FILE_SYSTEM 5612 # define HAVE_DOS_BASED_FILE_SYSTEM
4240 # define FOPEN_WB "wb" 5613 # define FOPEN_WB "wb"
4241 # ifndef DIR_SEPARATOR_2 5614 # ifndef DIR_SEPARATOR_2
4242 # define DIR_SEPARATOR_2 '\\' 5615 # define DIR_SEPARATOR_2 '\\'
4243 # endif 5616 # endif
4244 # ifndef PATH_SEPARATOR_2 5617 # ifndef PATH_SEPARATOR_2
4245 # define PATH_SEPARATOR_2 ';' 5618 # define PATH_SEPARATOR_2 ';'
4246 # endif 5619 # endif
4247 #endif 5620 #endif
4248 5621
(...skipping 12 matching lines...) Expand all
4261 5634
4262 #ifndef FOPEN_WB 5635 #ifndef FOPEN_WB
4263 # define FOPEN_WB "w" 5636 # define FOPEN_WB "w"
4264 #endif 5637 #endif
4265 #ifndef _O_BINARY 5638 #ifndef _O_BINARY
4266 # define _O_BINARY 0 5639 # define _O_BINARY 0
4267 #endif 5640 #endif
4268 5641
4269 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) 5642 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4270 #define XFREE(stale) do { \ 5643 #define XFREE(stale) do { \
4271 if (stale) { free ((void *) stale); stale = 0; } \ 5644 if (stale) { free (stale); stale = 0; } \
4272 } while (0) 5645 } while (0)
4273 5646
4274 #if defined(LT_DEBUGWRAPPER) 5647 #if defined LT_DEBUGWRAPPER
4275 static int lt_debug = 1; 5648 static int lt_debug = 1;
4276 #else 5649 #else
4277 static int lt_debug = 0; 5650 static int lt_debug = 0;
4278 #endif 5651 #endif
4279 5652
4280 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ 5653 const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
4281 5654
4282 void *xmalloc (size_t num); 5655 void *xmalloc (size_t num);
4283 char *xstrdup (const char *string); 5656 char *xstrdup (const char *string);
4284 const char *base_name (const char *name); 5657 const char *base_name (const char *name);
4285 char *find_executable (const char *wrapper); 5658 char *find_executable (const char *wrapper);
4286 char *chase_symlinks (const char *pathspec); 5659 char *chase_symlinks (const char *pathspec);
4287 int make_executable (const char *path); 5660 int make_executable (const char *path);
4288 int check_executable (const char *path); 5661 int check_executable (const char *path);
4289 char *strendzap (char *str, const char *pat); 5662 char *strendzap (char *str, const char *pat);
4290 void lt_debugprintf (const char *file, int line, const char *fmt, ...); 5663 void lt_debugprintf (const char *file, int line, const char *fmt, ...);
4291 void lt_fatal (const char *file, int line, const char *message, ...); 5664 void lt_fatal (const char *file, int line, const char *message, ...);
4292 static const char *nonnull (const char *s); 5665 static const char *nonnull (const char *s);
4293 static const char *nonempty (const char *s); 5666 static const char *nonempty (const char *s);
4294 void lt_setenv (const char *name, const char *value); 5667 void lt_setenv (const char *name, const char *value);
4295 char *lt_extend_str (const char *orig_value, const char *add, int to_end); 5668 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
4296 void lt_update_exe_path (const char *name, const char *value); 5669 void lt_update_exe_path (const char *name, const char *value);
4297 void lt_update_lib_path (const char *name, const char *value); 5670 void lt_update_lib_path (const char *name, const char *value);
4298 char **prepare_spawn (char **argv); 5671 char **prepare_spawn (char **argv);
4299 void lt_dump_script (FILE *f); 5672 void lt_dump_script (FILE *f);
4300 EOF 5673 EOF
4301 5674
4302 cat <<EOF 5675 cat <<EOF
4303 volatile const char * MAGIC_EXE = "$magic_exe"; 5676 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
5677 # define externally_visible volatile
5678 #else
5679 # define externally_visible __attribute__((externally_visible)) volatile
5680 #endif
5681 externally_visible const char * MAGIC_EXE = "$magic_exe";
4304 const char * LIB_PATH_VARNAME = "$shlibpath_var"; 5682 const char * LIB_PATH_VARNAME = "$shlibpath_var";
4305 EOF 5683 EOF
4306 5684
4307 » if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_ var" && test -n "$temp_rpath"; then 5685 » if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_ var" && test -n "$temp_rpath"; then
4308 func_to_host_path "$temp_rpath" 5686 func_to_host_path "$temp_rpath"
4309 cat <<EOF 5687 cat <<EOF
4310 const char * LIB_PATH_VALUE = "$func_to_host_path_result"; 5688 const char * LIB_PATH_VALUE = "$func_to_host_path_result";
4311 EOF 5689 EOF
4312 else 5690 else
4313 cat <<"EOF" 5691 cat <<"EOF"
4314 const char * LIB_PATH_VALUE = ""; 5692 const char * LIB_PATH_VALUE = "";
4315 EOF 5693 EOF
4316 fi 5694 fi
4317 5695
4318 if test -n "$dllsearchpath"; then 5696 if test -n "$dllsearchpath"; then
4319 func_to_host_path "$dllsearchpath:" 5697 func_to_host_path "$dllsearchpath:"
4320 cat <<EOF 5698 cat <<EOF
4321 const char * EXE_PATH_VARNAME = "PATH"; 5699 const char * EXE_PATH_VARNAME = "PATH";
4322 const char * EXE_PATH_VALUE = "$func_to_host_path_result"; 5700 const char * EXE_PATH_VALUE = "$func_to_host_path_result";
4323 EOF 5701 EOF
4324 else 5702 else
4325 cat <<"EOF" 5703 cat <<"EOF"
4326 const char * EXE_PATH_VARNAME = ""; 5704 const char * EXE_PATH_VARNAME = "";
4327 const char * EXE_PATH_VALUE = ""; 5705 const char * EXE_PATH_VALUE = "";
4328 EOF 5706 EOF
4329 fi 5707 fi
4330 5708
4331 » if test "$fast_install" = yes; then 5709 » if test yes = "$fast_install"; then
4332 cat <<EOF 5710 cat <<EOF
4333 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */ 5711 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4334 EOF 5712 EOF
4335 else 5713 else
4336 cat <<EOF 5714 cat <<EOF
4337 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */ 5715 const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
4338 EOF 5716 EOF
4339 fi 5717 fi
4340 5718
4341 5719
4342 cat <<"EOF" 5720 cat <<"EOF"
4343 5721
4344 #define LTWRAPPER_OPTION_PREFIX "--lt-" 5722 #define LTWRAPPER_OPTION_PREFIX "--lt-"
4345 5723
4346 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX; 5724 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
4347 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script"; 5725 static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
4348 static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug"; 5726 static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
4349 5727
4350 int 5728 int
4351 main (int argc, char *argv[]) 5729 main (int argc, char *argv[])
4352 { 5730 {
4353 char **newargz; 5731 char **newargz;
4354 int newargc; 5732 int newargc;
4355 char *tmp_pathspec; 5733 char *tmp_pathspec;
4356 char *actual_cwrapper_path; 5734 char *actual_cwrapper_path;
4357 char *actual_cwrapper_name; 5735 char *actual_cwrapper_name;
4358 char *target_name; 5736 char *target_name;
4359 char *lt_argv_zero; 5737 char *lt_argv_zero;
4360 intptr_t rval = 127; 5738 int rval = 127;
4361 5739
4362 int i; 5740 int i;
4363 5741
4364 program_name = (char *) xstrdup (base_name (argv[0])); 5742 program_name = (char *) xstrdup (base_name (argv[0]));
4365 newargz = XMALLOC (char *, argc + 1); 5743 newargz = XMALLOC (char *, (size_t) argc + 1);
4366 5744
4367 /* very simple arg parsing; don't want to rely on getopt 5745 /* very simple arg parsing; don't want to rely on getopt
4368 * also, copy all non cwrapper options to newargz, except 5746 * also, copy all non cwrapper options to newargz, except
4369 * argz[0], which is handled differently 5747 * argz[0], which is handled differently
4370 */ 5748 */
4371 newargc=0; 5749 newargc=0;
4372 for (i = 1; i < argc; i++) 5750 for (i = 1; i < argc; i++)
4373 { 5751 {
4374 if (strcmp (argv[i], dumpscript_opt) == 0) 5752 if (STREQ (argv[i], dumpscript_opt))
4375 { 5753 {
4376 EOF 5754 EOF
4377 » case "$host" in 5755 » case $host in
4378 *mingw* | *cygwin* ) 5756 *mingw* | *cygwin* )
4379 # make stdout use "unix" line endings 5757 # make stdout use "unix" line endings
4380 echo " setmode(1,_O_BINARY);" 5758 echo " setmode(1,_O_BINARY);"
4381 ;; 5759 ;;
4382 esac 5760 esac
4383 5761
4384 cat <<"EOF" 5762 cat <<"EOF"
4385 lt_dump_script (stdout); 5763 lt_dump_script (stdout);
4386 return 0; 5764 return 0;
4387 } 5765 }
4388 if (strcmp (argv[i], debug_opt) == 0) 5766 if (STREQ (argv[i], debug_opt))
4389 { 5767 {
4390 lt_debug = 1; 5768 lt_debug = 1;
4391 continue; 5769 continue;
4392 } 5770 }
4393 if (strcmp (argv[i], ltwrapper_option_prefix) == 0) 5771 if (STREQ (argv[i], ltwrapper_option_prefix))
4394 { 5772 {
4395 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX 5773 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4396 namespace, but it is not one of the ones we know about and 5774 namespace, but it is not one of the ones we know about and
4397 have already dealt with, above (inluding dump-script), then 5775 have already dealt with, above (inluding dump-script), then
4398 report an error. Otherwise, targets might begin to believe 5776 report an error. Otherwise, targets might begin to believe
4399 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX 5777 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4400 namespace. The first time any user complains about this, we'll 5778 namespace. The first time any user complains about this, we'll
4401 need to make LTWRAPPER_OPTION_PREFIX a configure-time option 5779 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
4402 or a configure.ac-settable value. 5780 or a configure.ac-settable value.
4403 */ 5781 */
4404 lt_fatal (__FILE__, __LINE__, 5782 lt_fatal (__FILE__, __LINE__,
4405 "unrecognized %s option: '%s'", 5783 "unrecognized %s option: '%s'",
4406 ltwrapper_option_prefix, argv[i]); 5784 ltwrapper_option_prefix, argv[i]);
4407 } 5785 }
4408 /* otherwise ... */ 5786 /* otherwise ... */
4409 newargz[++newargc] = xstrdup (argv[i]); 5787 newargz[++newargc] = xstrdup (argv[i]);
4410 } 5788 }
4411 newargz[++newargc] = NULL; 5789 newargz[++newargc] = NULL;
4412 5790
4413 EOF 5791 EOF
4414 cat <<EOF 5792 cat <<EOF
4415 /* The GNU banner must be the first non-error debug message */ 5793 /* The GNU banner must be the first non-error debug message */
4416 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n"); 5794 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n ");
4417 EOF 5795 EOF
4418 cat <<"EOF" 5796 cat <<"EOF"
4419 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]); 5797 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4420 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name) ; 5798 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name) ;
4421 5799
4422 tmp_pathspec = find_executable (argv[0]); 5800 tmp_pathspec = find_executable (argv[0]);
4423 if (tmp_pathspec == NULL) 5801 if (tmp_pathspec == NULL)
4424 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]); 5802 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
4425 lt_debugprintf (__FILE__, __LINE__, 5803 lt_debugprintf (__FILE__, __LINE__,
4426 "(main) found exe (before symlink chase) at: %s\n", 5804 "(main) found exe (before symlink chase) at: %s\n",
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
4517 i, nonnull (newargz[i])); 5895 i, nonnull (newargz[i]));
4518 } 5896 }
4519 5897
4520 EOF 5898 EOF
4521 5899
4522 case $host_os in 5900 case $host_os in
4523 mingw*) 5901 mingw*)
4524 cat <<"EOF" 5902 cat <<"EOF"
4525 /* execv doesn't actually work on mingw as expected on unix */ 5903 /* execv doesn't actually work on mingw as expected on unix */
4526 newargz = prepare_spawn (newargz); 5904 newargz = prepare_spawn (newargz);
4527 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); 5905 rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4528 if (rval == -1) 5906 if (rval == -1)
4529 { 5907 {
4530 /* failed to start process */ 5908 /* failed to start process */
4531 lt_debugprintf (__FILE__, __LINE__, 5909 lt_debugprintf (__FILE__, __LINE__,
4532 "(main) failed to launch target \"%s\": %s\n", 5910 "(main) failed to launch target \"%s\": %s\n",
4533 lt_argv_zero, nonnull (strerror (errno))); 5911 lt_argv_zero, nonnull (strerror (errno)));
4534 return 127; 5912 return 127;
4535 } 5913 }
4536 return rval; 5914 return rval;
4537 EOF 5915 EOF
(...skipping 24 matching lines...) Expand all
4562 { 5940 {
4563 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), 5941 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
4564 string) : NULL; 5942 string) : NULL;
4565 } 5943 }
4566 5944
4567 const char * 5945 const char *
4568 base_name (const char *name) 5946 base_name (const char *name)
4569 { 5947 {
4570 const char *base; 5948 const char *base;
4571 5949
4572 #if defined (HAVE_DOS_BASED_FILE_SYSTEM) 5950 #if defined HAVE_DOS_BASED_FILE_SYSTEM
4573 /* Skip over the disk name in MSDOS pathnames. */ 5951 /* Skip over the disk name in MSDOS pathnames. */
4574 if (isalpha ((unsigned char) name[0]) && name[1] == ':') 5952 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
4575 name += 2; 5953 name += 2;
4576 #endif 5954 #endif
4577 5955
4578 for (base = name; *name; name++) 5956 for (base = name; *name; name++)
4579 if (IS_DIR_SEPARATOR (*name)) 5957 if (IS_DIR_SEPARATOR (*name))
4580 base = name + 1; 5958 base = name + 1;
4581 return base; 5959 return base;
4582 } 5960 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
4621 Does not chase symlinks, even on platforms that support them. 5999 Does not chase symlinks, even on platforms that support them.
4622 */ 6000 */
4623 char * 6001 char *
4624 find_executable (const char *wrapper) 6002 find_executable (const char *wrapper)
4625 { 6003 {
4626 int has_slash = 0; 6004 int has_slash = 0;
4627 const char *p; 6005 const char *p;
4628 const char *p_next; 6006 const char *p_next;
4629 /* static buffer for getcwd */ 6007 /* static buffer for getcwd */
4630 char tmp[LT_PATHMAX + 1]; 6008 char tmp[LT_PATHMAX + 1];
4631 int tmp_len; 6009 size_t tmp_len;
4632 char *concat_name; 6010 char *concat_name;
4633 6011
4634 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", 6012 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
4635 nonempty (wrapper)); 6013 nonempty (wrapper));
4636 6014
4637 if ((wrapper == NULL) || (*wrapper == '\0')) 6015 if ((wrapper == NULL) || (*wrapper == '\0'))
4638 return NULL; 6016 return NULL;
4639 6017
4640 /* Absolute path? */ 6018 /* Absolute path? */
4641 #if defined (HAVE_DOS_BASED_FILE_SYSTEM) 6019 #if defined HAVE_DOS_BASED_FILE_SYSTEM
4642 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') 6020 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
4643 { 6021 {
4644 concat_name = xstrdup (wrapper); 6022 concat_name = xstrdup (wrapper);
4645 if (check_executable (concat_name)) 6023 if (check_executable (concat_name))
4646 return concat_name; 6024 return concat_name;
4647 XFREE (concat_name); 6025 XFREE (concat_name);
4648 } 6026 }
4649 else 6027 else
4650 { 6028 {
4651 #endif 6029 #endif
4652 if (IS_DIR_SEPARATOR (wrapper[0])) 6030 if (IS_DIR_SEPARATOR (wrapper[0]))
4653 { 6031 {
4654 concat_name = xstrdup (wrapper); 6032 concat_name = xstrdup (wrapper);
4655 if (check_executable (concat_name)) 6033 if (check_executable (concat_name))
4656 return concat_name; 6034 return concat_name;
4657 XFREE (concat_name); 6035 XFREE (concat_name);
4658 } 6036 }
4659 #if defined (HAVE_DOS_BASED_FILE_SYSTEM) 6037 #if defined HAVE_DOS_BASED_FILE_SYSTEM
4660 } 6038 }
4661 #endif 6039 #endif
4662 6040
4663 for (p = wrapper; *p; p++) 6041 for (p = wrapper; *p; p++)
4664 if (*p == '/') 6042 if (*p == '/')
4665 { 6043 {
4666 has_slash = 1; 6044 has_slash = 1;
4667 break; 6045 break;
4668 } 6046 }
4669 if (!has_slash) 6047 if (!has_slash)
4670 { 6048 {
4671 /* no slashes; search PATH */ 6049 /* no slashes; search PATH */
4672 const char *path = getenv ("PATH"); 6050 const char *path = getenv ("PATH");
4673 if (path != NULL) 6051 if (path != NULL)
4674 { 6052 {
4675 for (p = path; *p; p = p_next) 6053 for (p = path; *p; p = p_next)
4676 { 6054 {
4677 const char *q; 6055 const char *q;
4678 size_t p_len; 6056 size_t p_len;
4679 for (q = p; *q; q++) 6057 for (q = p; *q; q++)
4680 if (IS_PATH_SEPARATOR (*q)) 6058 if (IS_PATH_SEPARATOR (*q))
4681 break; 6059 break;
4682 » p_len = q - p; 6060 » p_len = (size_t) (q - p);
4683 p_next = (*q == '\0' ? q : q + 1); 6061 p_next = (*q == '\0' ? q : q + 1);
4684 if (p_len == 0) 6062 if (p_len == 0)
4685 { 6063 {
4686 /* empty path: current directory */ 6064 /* empty path: current directory */
4687 if (getcwd (tmp, LT_PATHMAX) == NULL) 6065 if (getcwd (tmp, LT_PATHMAX) == NULL)
4688 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", 6066 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
4689 nonnull (strerror (errno))); 6067 nonnull (strerror (errno)));
4690 tmp_len = strlen (tmp); 6068 tmp_len = strlen (tmp);
4691 concat_name = 6069 concat_name =
4692 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); 6070 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
4791 6169
4792 assert (str != NULL); 6170 assert (str != NULL);
4793 assert (pat != NULL); 6171 assert (pat != NULL);
4794 6172
4795 len = strlen (str); 6173 len = strlen (str);
4796 patlen = strlen (pat); 6174 patlen = strlen (pat);
4797 6175
4798 if (patlen <= len) 6176 if (patlen <= len)
4799 { 6177 {
4800 str += len - patlen; 6178 str += len - patlen;
4801 if (strcmp (str, pat) == 0) 6179 if (STREQ (str, pat))
4802 *str = '\0'; 6180 *str = '\0';
4803 } 6181 }
4804 return str; 6182 return str;
4805 } 6183 }
4806 6184
4807 void 6185 void
4808 lt_debugprintf (const char *file, int line, const char *fmt, ...) 6186 lt_debugprintf (const char *file, int line, const char *fmt, ...)
4809 { 6187 {
4810 va_list args; 6188 va_list args;
4811 if (lt_debug) 6189 if (lt_debug)
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
4856 { 6234 {
4857 lt_debugprintf (__FILE__, __LINE__, 6235 lt_debugprintf (__FILE__, __LINE__,
4858 "(lt_setenv) setting '%s' to '%s'\n", 6236 "(lt_setenv) setting '%s' to '%s'\n",
4859 nonnull (name), nonnull (value)); 6237 nonnull (name), nonnull (value));
4860 { 6238 {
4861 #ifdef HAVE_SETENV 6239 #ifdef HAVE_SETENV
4862 /* always make a copy, for consistency with !HAVE_SETENV */ 6240 /* always make a copy, for consistency with !HAVE_SETENV */
4863 char *str = xstrdup (value); 6241 char *str = xstrdup (value);
4864 setenv (name, str, 1); 6242 setenv (name, str, 1);
4865 #else 6243 #else
4866 int len = strlen (name) + 1 + strlen (value) + 1; 6244 size_t len = strlen (name) + 1 + strlen (value) + 1;
4867 char *str = XMALLOC (char, len); 6245 char *str = XMALLOC (char, len);
4868 sprintf (str, "%s=%s", name, value); 6246 sprintf (str, "%s=%s", name, value);
4869 if (putenv (str) != EXIT_SUCCESS) 6247 if (putenv (str) != EXIT_SUCCESS)
4870 { 6248 {
4871 XFREE (str); 6249 XFREE (str);
4872 } 6250 }
4873 #endif 6251 #endif
4874 } 6252 }
4875 } 6253 }
4876 6254
4877 char * 6255 char *
4878 lt_extend_str (const char *orig_value, const char *add, int to_end) 6256 lt_extend_str (const char *orig_value, const char *add, int to_end)
4879 { 6257 {
4880 char *new_value; 6258 char *new_value;
4881 if (orig_value && *orig_value) 6259 if (orig_value && *orig_value)
4882 { 6260 {
4883 int orig_value_len = strlen (orig_value); 6261 size_t orig_value_len = strlen (orig_value);
4884 int add_len = strlen (add); 6262 size_t add_len = strlen (add);
4885 new_value = XMALLOC (char, add_len + orig_value_len + 1); 6263 new_value = XMALLOC (char, add_len + orig_value_len + 1);
4886 if (to_end) 6264 if (to_end)
4887 { 6265 {
4888 strcpy (new_value, orig_value); 6266 strcpy (new_value, orig_value);
4889 strcpy (new_value + orig_value_len, add); 6267 strcpy (new_value + orig_value_len, add);
4890 } 6268 }
4891 else 6269 else
4892 { 6270 {
4893 strcpy (new_value, add); 6271 strcpy (new_value, add);
4894 strcpy (new_value + add_len, orig_value); 6272 strcpy (new_value + add_len, orig_value);
(...skipping 10 matching lines...) Expand all
4905 lt_update_exe_path (const char *name, const char *value) 6283 lt_update_exe_path (const char *name, const char *value)
4906 { 6284 {
4907 lt_debugprintf (__FILE__, __LINE__, 6285 lt_debugprintf (__FILE__, __LINE__,
4908 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", 6286 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4909 nonnull (name), nonnull (value)); 6287 nonnull (name), nonnull (value));
4910 6288
4911 if (name && *name && value && *value) 6289 if (name && *name && value && *value)
4912 { 6290 {
4913 char *new_value = lt_extend_str (getenv (name), value, 0); 6291 char *new_value = lt_extend_str (getenv (name), value, 0);
4914 /* some systems can't cope with a ':'-terminated path #' */ 6292 /* some systems can't cope with a ':'-terminated path #' */
4915 int len = strlen (new_value); 6293 size_t len = strlen (new_value);
4916 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[le n-1])) 6294 while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4917 { 6295 {
4918 new_value[len-1] = '\0'; 6296 new_value[--len] = '\0';
4919 } 6297 }
4920 lt_setenv (name, new_value); 6298 lt_setenv (name, new_value);
4921 XFREE (new_value); 6299 XFREE (new_value);
4922 } 6300 }
4923 } 6301 }
4924 6302
4925 void 6303 void
4926 lt_update_lib_path (const char *name, const char *value) 6304 lt_update_lib_path (const char *name, const char *value)
4927 { 6305 {
4928 lt_debugprintf (__FILE__, __LINE__, 6306 lt_debugprintf (__FILE__, __LINE__,
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
5075 cat <<"EOF" 6453 cat <<"EOF"
5076 } 6454 }
5077 EOF 6455 EOF
5078 } 6456 }
5079 # end: func_emit_cwrapperexe_src 6457 # end: func_emit_cwrapperexe_src
5080 6458
5081 # func_win32_import_lib_p ARG 6459 # func_win32_import_lib_p ARG
5082 # True if ARG is an import lib, as indicated by $file_magic_cmd 6460 # True if ARG is an import lib, as indicated by $file_magic_cmd
5083 func_win32_import_lib_p () 6461 func_win32_import_lib_p ()
5084 { 6462 {
5085 $opt_debug 6463 $debug_cmd
6464
5086 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in 6465 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
5087 *import*) : ;; 6466 *import*) : ;;
5088 *) false ;; 6467 *) false ;;
5089 esac 6468 esac
5090 } 6469 }
5091 6470
6471 # func_suncc_cstd_abi
6472 # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
6473 # Several compiler flags select an ABI that is incompatible with the
6474 # Cstd library. Avoid specifying it if any are in CXXFLAGS.
6475 func_suncc_cstd_abi ()
6476 {
6477 $debug_cmd
6478
6479 case " $compile_command " in
6480 *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library= stlport4 "*)
6481 suncc_use_cstd_abi=no
6482 ;;
6483 *)
6484 suncc_use_cstd_abi=yes
6485 ;;
6486 esac
6487 }
6488
5092 # func_mode_link arg... 6489 # func_mode_link arg...
5093 func_mode_link () 6490 func_mode_link ()
5094 { 6491 {
5095 $opt_debug 6492 $debug_cmd
6493
5096 case $host in 6494 case $host in
5097 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) 6495 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5098 # It is impossible to link a dll without this setting, and 6496 # It is impossible to link a dll without this setting, and
5099 # we shouldn't force the makefile maintainer to figure out 6497 # we shouldn't force the makefile maintainer to figure out
5100 # which system we are compiling for in order to pass an extra 6498 # what system we are compiling for in order to pass an extra
5101 # flag for every libtool invocation. 6499 # flag for every libtool invocation.
5102 # allow_undefined=no 6500 # allow_undefined=no
5103 6501
5104 # FIXME: Unfortunately, there are problems with the above when trying 6502 # FIXME: Unfortunately, there are problems with the above when trying
5105 # to make a dll which has undefined symbols, in which case not 6503 # to make a dll that has undefined symbols, in which case not
5106 # even a static library is built. For now, we need to specify 6504 # even a static library is built. For now, we need to specify
5107 # -no-undefined on the libtool link line when we can be certain 6505 # -no-undefined on the libtool link line when we can be certain
5108 # that all symbols are satisfied, otherwise we get a static library. 6506 # that all symbols are satisfied, otherwise we get a static library.
5109 allow_undefined=yes 6507 allow_undefined=yes
5110 ;; 6508 ;;
5111 *) 6509 *)
5112 allow_undefined=yes 6510 allow_undefined=yes
5113 ;; 6511 ;;
5114 esac 6512 esac
5115 libtool_args=$nonopt 6513 libtool_args=$nonopt
(...skipping 23 matching lines...) Expand all
5139 dlself=no 6537 dlself=no
5140 export_dynamic=no 6538 export_dynamic=no
5141 export_symbols= 6539 export_symbols=
5142 export_symbols_regex= 6540 export_symbols_regex=
5143 generated= 6541 generated=
5144 libobjs= 6542 libobjs=
5145 ltlibs= 6543 ltlibs=
5146 module=no 6544 module=no
5147 no_install=no 6545 no_install=no
5148 objs= 6546 objs=
6547 os2dllname=
5149 non_pic_objects= 6548 non_pic_objects=
5150 precious_files_regex= 6549 precious_files_regex=
5151 prefer_static_libs=no 6550 prefer_static_libs=no
5152 preload=no 6551 preload=false
5153 prev= 6552 prev=
5154 prevarg= 6553 prevarg=
5155 release= 6554 release=
5156 rpath= 6555 rpath=
5157 xrpath= 6556 xrpath=
5158 perm_rpath= 6557 perm_rpath=
5159 temp_rpath= 6558 temp_rpath=
5160 thread_safe=no 6559 thread_safe=no
5161 vinfo= 6560 vinfo=
5162 vinfo_number=no 6561 vinfo_number=no
5163 weak_libs= 6562 weak_libs=
5164 single_module="${wl}-single_module" 6563 single_module=$wl-single_module
5165 func_infer_tag $base_compile 6564 func_infer_tag $base_compile
5166 6565
5167 # We need to know -static, to get the right output filenames. 6566 # We need to know -static, to get the right output filenames.
5168 for arg 6567 for arg
5169 do 6568 do
5170 case $arg in 6569 case $arg in
5171 -shared) 6570 -shared)
5172 » test "$build_libtool_libs" != yes && \ 6571 » test yes != "$build_libtool_libs" \
5173 » func_fatal_configuration "can not build a shared library" 6572 » && func_fatal_configuration "cannot build a shared library"
5174 build_old_libs=no 6573 build_old_libs=no
5175 break 6574 break
5176 ;; 6575 ;;
5177 -all-static | -static | -static-libtool-libs) 6576 -all-static | -static | -static-libtool-libs)
5178 case $arg in 6577 case $arg in
5179 -all-static) 6578 -all-static)
5180 » if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; th en 6579 » if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; th en
5181 func_warning "complete static linking is impossible in this configur ation" 6580 func_warning "complete static linking is impossible in this configur ation"
5182 fi 6581 fi
5183 if test -n "$link_static_flag"; then 6582 if test -n "$link_static_flag"; then
5184 dlopen_self=$dlopen_self_static 6583 dlopen_self=$dlopen_self_static
5185 fi 6584 fi
5186 prefer_static_libs=yes 6585 prefer_static_libs=yes
5187 ;; 6586 ;;
5188 -static) 6587 -static)
5189 if test -z "$pic_flag" && test -n "$link_static_flag"; then 6588 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5190 dlopen_self=$dlopen_self_static 6589 dlopen_self=$dlopen_self_static
(...skipping 12 matching lines...) Expand all
5203 break 6602 break
5204 ;; 6603 ;;
5205 esac 6604 esac
5206 done 6605 done
5207 6606
5208 # See if our shared archives depend on static archives. 6607 # See if our shared archives depend on static archives.
5209 test -n "$old_archive_from_new_cmds" && build_old_libs=yes 6608 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
5210 6609
5211 # Go through the arguments, transforming them on the way. 6610 # Go through the arguments, transforming them on the way.
5212 while test "$#" -gt 0; do 6611 while test "$#" -gt 0; do
5213 arg="$1" 6612 arg=$1
5214 shift 6613 shift
5215 func_quote_for_eval "$arg" 6614 func_quote_for_eval "$arg"
5216 qarg=$func_quote_for_eval_unquoted_result 6615 qarg=$func_quote_for_eval_unquoted_result
5217 func_append libtool_args " $func_quote_for_eval_result" 6616 func_append libtool_args " $func_quote_for_eval_result"
5218 6617
5219 # If the previous option needs an argument, assign it. 6618 # If the previous option needs an argument, assign it.
5220 if test -n "$prev"; then 6619 if test -n "$prev"; then
5221 case $prev in 6620 case $prev in
5222 output) 6621 output)
5223 func_append compile_command " @OUTPUT@" 6622 func_append compile_command " @OUTPUT@"
5224 func_append finalize_command " @OUTPUT@" 6623 func_append finalize_command " @OUTPUT@"
5225 ;; 6624 ;;
5226 esac 6625 esac
5227 6626
5228 case $prev in 6627 case $prev in
5229 bindir) 6628 bindir)
5230 » bindir="$arg" 6629 » bindir=$arg
5231 prev= 6630 prev=
5232 continue 6631 continue
5233 ;; 6632 ;;
5234 dlfiles|dlprefiles) 6633 dlfiles|dlprefiles)
5235 » if test "$preload" = no; then 6634 » $preload || {
5236 # Add the symbol object into the linking commands. 6635 # Add the symbol object into the linking commands.
5237 func_append compile_command " @SYMFILE@" 6636 func_append compile_command " @SYMFILE@"
5238 func_append finalize_command " @SYMFILE@" 6637 func_append finalize_command " @SYMFILE@"
5239 » preload=yes 6638 » preload=:
5240 » fi 6639 » }
5241 case $arg in 6640 case $arg in
5242 *.la | *.lo) ;; # We handle these cases below. 6641 *.la | *.lo) ;; # We handle these cases below.
5243 force) 6642 force)
5244 » if test "$dlself" = no; then 6643 » if test no = "$dlself"; then
5245 dlself=needless 6644 dlself=needless
5246 export_dynamic=yes 6645 export_dynamic=yes
5247 fi 6646 fi
5248 prev= 6647 prev=
5249 continue 6648 continue
5250 ;; 6649 ;;
5251 self) 6650 self)
5252 » if test "$prev" = dlprefiles; then 6651 » if test dlprefiles = "$prev"; then
5253 dlself=yes 6652 dlself=yes
5254 » elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then 6653 » elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
5255 dlself=yes 6654 dlself=yes
5256 else 6655 else
5257 dlself=needless 6656 dlself=needless
5258 export_dynamic=yes 6657 export_dynamic=yes
5259 fi 6658 fi
5260 prev= 6659 prev=
5261 continue 6660 continue
5262 ;; 6661 ;;
5263 *) 6662 *)
5264 » if test "$prev" = dlfiles; then 6663 » if test dlfiles = "$prev"; then
5265 func_append dlfiles " $arg" 6664 func_append dlfiles " $arg"
5266 else 6665 else
5267 func_append dlprefiles " $arg" 6666 func_append dlprefiles " $arg"
5268 fi 6667 fi
5269 prev= 6668 prev=
5270 continue 6669 continue
5271 ;; 6670 ;;
5272 esac 6671 esac
5273 ;; 6672 ;;
5274 expsyms) 6673 expsyms)
5275 » export_symbols="$arg" 6674 » export_symbols=$arg
5276 test -f "$arg" \ 6675 test -f "$arg" \
5277 » || func_fatal_error "symbol file \`$arg' does not exist" 6676 » || func_fatal_error "symbol file '$arg' does not exist"
5278 prev= 6677 prev=
5279 continue 6678 continue
5280 ;; 6679 ;;
5281 expsyms_regex) 6680 expsyms_regex)
5282 » export_symbols_regex="$arg" 6681 » export_symbols_regex=$arg
5283 prev= 6682 prev=
5284 continue 6683 continue
5285 ;; 6684 ;;
5286 framework) 6685 framework)
5287 case $host in 6686 case $host in
5288 *-*-darwin*) 6687 *-*-darwin*)
5289 case "$deplibs " in 6688 case "$deplibs " in
5290 *" $qarg.ltframework "*) ;; 6689 *" $qarg.ltframework "*) ;;
5291 *) func_append deplibs " $qarg.ltframework" # this is fixed late r 6690 *) func_append deplibs " $qarg.ltframework" # this is fixed late r
5292 ;; 6691 ;;
5293 esac 6692 esac
5294 ;; 6693 ;;
5295 esac 6694 esac
5296 prev= 6695 prev=
5297 continue 6696 continue
5298 ;; 6697 ;;
5299 inst_prefix) 6698 inst_prefix)
5300 » inst_prefix_dir="$arg" 6699 » inst_prefix_dir=$arg
5301 prev= 6700 prev=
5302 continue 6701 continue
5303 ;; 6702 ;;
6703 mllvm)
6704 # Clang does not use LLVM to link, so we can simply discard any
6705 # '-mllvm $arg' options when doing the link step.
6706 prev=
6707 continue
6708 ;;
5304 objectlist) 6709 objectlist)
5305 if test -f "$arg"; then 6710 if test -f "$arg"; then
5306 save_arg=$arg 6711 save_arg=$arg
5307 moreargs= 6712 moreargs=
5308 for fil in `cat "$save_arg"` 6713 for fil in `cat "$save_arg"`
5309 do 6714 do
5310 # func_append moreargs " $fil" 6715 # func_append moreargs " $fil"
5311 arg=$fil 6716 arg=$fil
5312 # A libtool-controlled object. 6717 # A libtool-controlled object.
5313 6718
5314 # Check to see that this really is a libtool object. 6719 # Check to see that this really is a libtool object.
5315 if func_lalib_unsafe_p "$arg"; then 6720 if func_lalib_unsafe_p "$arg"; then
5316 pic_object= 6721 pic_object=
5317 non_pic_object= 6722 non_pic_object=
5318 6723
5319 # Read the .lo file 6724 # Read the .lo file
5320 func_source "$arg" 6725 func_source "$arg"
5321 6726
5322 if test -z "$pic_object" || 6727 if test -z "$pic_object" ||
5323 test -z "$non_pic_object" || 6728 test -z "$non_pic_object" ||
5324 » » test "$pic_object" = none && 6729 » » test none = "$pic_object" &&
5325 » » test "$non_pic_object" = none; then 6730 » » test none = "$non_pic_object"; then
5326 » » func_fatal_error "cannot find name of object for \`$arg'" 6731 » » func_fatal_error "cannot find name of object for '$arg'"
5327 fi 6732 fi
5328 6733
5329 # Extract subdirectory from the argument. 6734 # Extract subdirectory from the argument.
5330 func_dirname "$arg" "/" "" 6735 func_dirname "$arg" "/" ""
5331 » » xdir="$func_dirname_result" 6736 » » xdir=$func_dirname_result
5332 6737
5333 » » if test "$pic_object" != none; then 6738 » » if test none != "$pic_object"; then
5334 # Prepend the subdirectory the object is found in. 6739 # Prepend the subdirectory the object is found in.
5335 » » pic_object="$xdir$pic_object" 6740 » » pic_object=$xdir$pic_object
5336 6741
5337 » » if test "$prev" = dlfiles; then 6742 » » if test dlfiles = "$prev"; then
5338 » » if test "$build_libtool_libs" = yes && test "$dlopen_support " = yes; then 6743 » » if test yes = "$build_libtool_libs" && test yes = "$dlopen_s upport"; then
5339 func_append dlfiles " $pic_object" 6744 func_append dlfiles " $pic_object"
5340 prev= 6745 prev=
5341 continue 6746 continue
5342 else 6747 else
5343 # If libtool objects are unsupported, then we need to prel oad. 6748 # If libtool objects are unsupported, then we need to prel oad.
5344 prev=dlprefiles 6749 prev=dlprefiles
5345 fi 6750 fi
5346 fi 6751 fi
5347 6752
5348 # CHECK ME: I think I busted this. -Ossama 6753 # CHECK ME: I think I busted this. -Ossama
5349 » » if test "$prev" = dlprefiles; then 6754 » » if test dlprefiles = "$prev"; then
5350 # Preload the old-style object. 6755 # Preload the old-style object.
5351 func_append dlprefiles " $pic_object" 6756 func_append dlprefiles " $pic_object"
5352 prev= 6757 prev=
5353 fi 6758 fi
5354 6759
5355 # A PIC object. 6760 # A PIC object.
5356 func_append libobjs " $pic_object" 6761 func_append libobjs " $pic_object"
5357 » » arg="$pic_object" 6762 » » arg=$pic_object
5358 fi 6763 fi
5359 6764
5360 # Non-PIC object. 6765 # Non-PIC object.
5361 » » if test "$non_pic_object" != none; then 6766 » » if test none != "$non_pic_object"; then
5362 # Prepend the subdirectory the object is found in. 6767 # Prepend the subdirectory the object is found in.
5363 » » non_pic_object="$xdir$non_pic_object" 6768 » » non_pic_object=$xdir$non_pic_object
5364 6769
5365 # A standard non-PIC object 6770 # A standard non-PIC object
5366 func_append non_pic_objects " $non_pic_object" 6771 func_append non_pic_objects " $non_pic_object"
5367 » » if test -z "$pic_object" || test "$pic_object" = none ; then 6772 » » if test -z "$pic_object" || test none = "$pic_object"; then
5368 » » arg="$non_pic_object" 6773 » » arg=$non_pic_object
5369 fi 6774 fi
5370 else 6775 else
5371 # If the PIC object exists, use it instead. 6776 # If the PIC object exists, use it instead.
5372 # $xdir was prepended to $pic_object above. 6777 # $xdir was prepended to $pic_object above.
5373 » » non_pic_object="$pic_object" 6778 » » non_pic_object=$pic_object
5374 func_append non_pic_objects " $non_pic_object" 6779 func_append non_pic_objects " $non_pic_object"
5375 fi 6780 fi
5376 else 6781 else
5377 # Only an error if not doing a dry-run. 6782 # Only an error if not doing a dry-run.
5378 if $opt_dry_run; then 6783 if $opt_dry_run; then
5379 # Extract subdirectory from the argument. 6784 # Extract subdirectory from the argument.
5380 func_dirname "$arg" "/" "" 6785 func_dirname "$arg" "/" ""
5381 » » xdir="$func_dirname_result" 6786 » » xdir=$func_dirname_result
5382 6787
5383 func_lo2o "$arg" 6788 func_lo2o "$arg"
5384 pic_object=$xdir$objdir/$func_lo2o_result 6789 pic_object=$xdir$objdir/$func_lo2o_result
5385 non_pic_object=$xdir$func_lo2o_result 6790 non_pic_object=$xdir$func_lo2o_result
5386 func_append libobjs " $pic_object" 6791 func_append libobjs " $pic_object"
5387 func_append non_pic_objects " $non_pic_object" 6792 func_append non_pic_objects " $non_pic_object"
5388 else 6793 else
5389 » » func_fatal_error "\`$arg' is not a valid libtool object" 6794 » » func_fatal_error "'$arg' is not a valid libtool object"
5390 fi 6795 fi
5391 fi 6796 fi
5392 done 6797 done
5393 else 6798 else
5394 » func_fatal_error "link input file \`$arg' does not exist" 6799 » func_fatal_error "link input file '$arg' does not exist"
5395 fi 6800 fi
5396 arg=$save_arg 6801 arg=$save_arg
5397 prev= 6802 prev=
5398 continue 6803 continue
5399 ;; 6804 ;;
6805 os2dllname)
6806 os2dllname=$arg
6807 prev=
6808 continue
6809 ;;
5400 precious_regex) 6810 precious_regex)
5401 » precious_files_regex="$arg" 6811 » precious_files_regex=$arg
5402 prev= 6812 prev=
5403 continue 6813 continue
5404 ;; 6814 ;;
5405 release) 6815 release)
5406 » release="-$arg" 6816 » release=-$arg
5407 prev= 6817 prev=
5408 continue 6818 continue
5409 ;; 6819 ;;
5410 rpath | xrpath) 6820 rpath | xrpath)
5411 # We need an absolute path. 6821 # We need an absolute path.
5412 case $arg in 6822 case $arg in
5413 [\\/]* | [A-Za-z]:[\\/]*) ;; 6823 [\\/]* | [A-Za-z]:[\\/]*) ;;
5414 *) 6824 *)
5415 func_fatal_error "only absolute run-paths are allowed" 6825 func_fatal_error "only absolute run-paths are allowed"
5416 ;; 6826 ;;
5417 esac 6827 esac
5418 » if test "$prev" = rpath; then 6828 » if test rpath = "$prev"; then
5419 case "$rpath " in 6829 case "$rpath " in
5420 *" $arg "*) ;; 6830 *" $arg "*) ;;
5421 *) func_append rpath " $arg" ;; 6831 *) func_append rpath " $arg" ;;
5422 esac 6832 esac
5423 else 6833 else
5424 case "$xrpath " in 6834 case "$xrpath " in
5425 *" $arg "*) ;; 6835 *" $arg "*) ;;
5426 *) func_append xrpath " $arg" ;; 6836 *) func_append xrpath " $arg" ;;
5427 esac 6837 esac
5428 fi 6838 fi
5429 prev= 6839 prev=
5430 continue 6840 continue
5431 ;; 6841 ;;
5432 shrext) 6842 shrext)
5433 » shrext_cmds="$arg" 6843 » shrext_cmds=$arg
5434 prev= 6844 prev=
5435 continue 6845 continue
5436 ;; 6846 ;;
5437 weak) 6847 weak)
5438 func_append weak_libs " $arg" 6848 func_append weak_libs " $arg"
5439 prev= 6849 prev=
5440 continue 6850 continue
5441 ;; 6851 ;;
5442 xcclinker) 6852 xcclinker)
5443 func_append linker_flags " $qarg" 6853 func_append linker_flags " $qarg"
(...skipping 19 matching lines...) Expand all
5463 continue 6873 continue
5464 ;; 6874 ;;
5465 *) 6875 *)
5466 eval "$prev=\"\$arg\"" 6876 eval "$prev=\"\$arg\""
5467 prev= 6877 prev=
5468 continue 6878 continue
5469 ;; 6879 ;;
5470 esac 6880 esac
5471 fi # test -n "$prev" 6881 fi # test -n "$prev"
5472 6882
5473 prevarg="$arg" 6883 prevarg=$arg
5474 6884
5475 case $arg in 6885 case $arg in
5476 -all-static) 6886 -all-static)
5477 if test -n "$link_static_flag"; then 6887 if test -n "$link_static_flag"; then
5478 # See comment for -static flag below, for more details. 6888 # See comment for -static flag below, for more details.
5479 func_append compile_command " $link_static_flag" 6889 func_append compile_command " $link_static_flag"
5480 func_append finalize_command " $link_static_flag" 6890 func_append finalize_command " $link_static_flag"
5481 fi 6891 fi
5482 continue 6892 continue
5483 ;; 6893 ;;
5484 6894
5485 -allow-undefined) 6895 -allow-undefined)
5486 # FIXME: remove this flag sometime in the future. 6896 # FIXME: remove this flag sometime in the future.
5487 » func_fatal_error "\`-allow-undefined' must not be used because it is the default" 6897 » func_fatal_error "'-allow-undefined' must not be used because it is the default"
5488 ;; 6898 ;;
5489 6899
5490 -avoid-version) 6900 -avoid-version)
5491 avoid_version=yes 6901 avoid_version=yes
5492 continue 6902 continue
5493 ;; 6903 ;;
5494 6904
5495 -bindir) 6905 -bindir)
5496 prev=bindir 6906 prev=bindir
5497 continue 6907 continue
(...skipping 11 matching lines...) Expand all
5509 6919
5510 -export-dynamic) 6920 -export-dynamic)
5511 export_dynamic=yes 6921 export_dynamic=yes
5512 continue 6922 continue
5513 ;; 6923 ;;
5514 6924
5515 -export-symbols | -export-symbols-regex) 6925 -export-symbols | -export-symbols-regex)
5516 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then 6926 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5517 func_fatal_error "more than one -exported-symbols argument is not allo wed" 6927 func_fatal_error "more than one -exported-symbols argument is not allo wed"
5518 fi 6928 fi
5519 » if test "X$arg" = "X-export-symbols"; then 6929 » if test X-export-symbols = "X$arg"; then
5520 prev=expsyms 6930 prev=expsyms
5521 else 6931 else
5522 prev=expsyms_regex 6932 prev=expsyms_regex
5523 fi 6933 fi
5524 continue 6934 continue
5525 ;; 6935 ;;
5526 6936
5527 -framework) 6937 -framework)
5528 prev=framework 6938 prev=framework
5529 continue 6939 continue
(...skipping 13 matching lines...) Expand all
5543 func_append finalize_command " $arg" 6953 func_append finalize_command " $arg"
5544 ;; 6954 ;;
5545 esac 6955 esac
5546 continue 6956 continue
5547 ;; 6957 ;;
5548 6958
5549 -L*) 6959 -L*)
5550 func_stripname "-L" '' "$arg" 6960 func_stripname "-L" '' "$arg"
5551 if test -z "$func_stripname_result"; then 6961 if test -z "$func_stripname_result"; then
5552 if test "$#" -gt 0; then 6962 if test "$#" -gt 0; then
5553 » func_fatal_error "require no space between \`-L' and \`$1'" 6963 » func_fatal_error "require no space between '-L' and '$1'"
5554 else 6964 else
5555 » func_fatal_error "need path for \`-L' option" 6965 » func_fatal_error "need path for '-L' option"
5556 fi 6966 fi
5557 fi 6967 fi
5558 func_resolve_sysroot "$func_stripname_result" 6968 func_resolve_sysroot "$func_stripname_result"
5559 dir=$func_resolve_sysroot_result 6969 dir=$func_resolve_sysroot_result
5560 # We need an absolute path. 6970 # We need an absolute path.
5561 case $dir in 6971 case $dir in
5562 [\\/]* | [A-Za-z]:[\\/]*) ;; 6972 [\\/]* | [A-Za-z]:[\\/]*) ;;
5563 *) 6973 *)
5564 absdir=`cd "$dir" && pwd` 6974 absdir=`cd "$dir" && pwd`
5565 test -z "$absdir" && \ 6975 test -z "$absdir" && \
5566 » func_fatal_error "cannot determine absolute directory name of \`$dir '" 6976 » func_fatal_error "cannot determine absolute directory name of '$dir' "
5567 » dir="$absdir" 6977 » dir=$absdir
5568 ;; 6978 ;;
5569 esac 6979 esac
5570 case "$deplibs " in 6980 case "$deplibs " in
5571 *" -L$dir "* | *" $arg "*) 6981 *" -L$dir "* | *" $arg "*)
5572 # Will only happen for absolute or sysroot arguments 6982 # Will only happen for absolute or sysroot arguments
5573 ;; 6983 ;;
5574 *) 6984 *)
5575 # Preserve sysroot, but never include relative directories 6985 # Preserve sysroot, but never include relative directories
5576 case $dir in 6986 case $dir in
5577 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; 6987 [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
(...skipping 14 matching lines...) Expand all
5592 *":$testbindir:"*) ;; 7002 *":$testbindir:"*) ;;
5593 ::) dllsearchpath=$testbindir;; 7003 ::) dllsearchpath=$testbindir;;
5594 *) func_append dllsearchpath ":$testbindir";; 7004 *) func_append dllsearchpath ":$testbindir";;
5595 esac 7005 esac
5596 ;; 7006 ;;
5597 esac 7007 esac
5598 continue 7008 continue
5599 ;; 7009 ;;
5600 7010
5601 -l*) 7011 -l*)
5602 » if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then 7012 » if test X-lc = "X$arg" || test X-lm = "X$arg"; then
5603 case $host in 7013 case $host in
5604 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haik u*) 7014 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haik u*)
5605 # These systems don't actually have a C or math library (as such) 7015 # These systems don't actually have a C or math library (as such)
5606 continue 7016 continue
5607 ;; 7017 ;;
5608 *-*-os2*) 7018 *-*-os2*)
5609 # These systems don't actually have a C library (as such) 7019 # These systems don't actually have a C library (as such)
5610 » test "X$arg" = "X-lc" && continue 7020 » test X-lc = "X$arg" && continue
5611 ;; 7021 ;;
5612 » *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 7022 » *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
5613 # Do not include libc due to us having libc/libc_r. 7023 # Do not include libc due to us having libc/libc_r.
5614 » test "X$arg" = "X-lc" && continue 7024 » test X-lc = "X$arg" && continue
5615 ;; 7025 ;;
5616 *-*-rhapsody* | *-*-darwin1.[012]) 7026 *-*-rhapsody* | *-*-darwin1.[012])
5617 # Rhapsody C and math libraries are in the System framework 7027 # Rhapsody C and math libraries are in the System framework
5618 func_append deplibs " System.ltframework" 7028 func_append deplibs " System.ltframework"
5619 continue 7029 continue
5620 ;; 7030 ;;
5621 *-*-sco3.2v5* | *-*-sco5v6*) 7031 *-*-sco3.2v5* | *-*-sco5v6*)
5622 # Causes problems with __ctype 7032 # Causes problems with __ctype
5623 » test "X$arg" = "X-lc" && continue 7033 » test X-lc = "X$arg" && continue
5624 ;; 7034 ;;
5625 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 7035 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
5626 # Compiler inserts libc in the correct place for threads to work 7036 # Compiler inserts libc in the correct place for threads to work
5627 » test "X$arg" = "X-lc" && continue 7037 » test X-lc = "X$arg" && continue
5628 ;; 7038 ;;
5629 esac 7039 esac
5630 » elif test "X$arg" = "X-lc_r"; then 7040 » elif test X-lc_r = "X$arg"; then
5631 case $host in 7041 case $host in
5632 » *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 7042 » *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
5633 # Do not include libc_r directly, use -pthread flag. 7043 # Do not include libc_r directly, use -pthread flag.
5634 continue 7044 continue
5635 ;; 7045 ;;
5636 esac 7046 esac
5637 fi 7047 fi
5638 func_append deplibs " $arg" 7048 func_append deplibs " $arg"
5639 continue 7049 continue
5640 ;; 7050 ;;
5641 7051
7052 -mllvm)
7053 prev=mllvm
7054 continue
7055 ;;
7056
5642 -module) 7057 -module)
5643 module=yes 7058 module=yes
5644 continue 7059 continue
5645 ;; 7060 ;;
5646 7061
5647 # Tru64 UNIX uses -model [arg] to determine the layout of C++ 7062 # Tru64 UNIX uses -model [arg] to determine the layout of C++
5648 # classes, name mangling, and exception handling. 7063 # classes, name mangling, and exception handling.
5649 # Darwin uses the -arch flag to determine output architecture. 7064 # Darwin uses the -arch flag to determine output architecture.
5650 -model|-arch|-isysroot|--sysroot) 7065 -model|-arch|-isysroot|--sysroot)
5651 func_append compiler_flags " $arg" 7066 func_append compiler_flags " $arg"
5652 func_append compile_command " $arg" 7067 func_append compile_command " $arg"
5653 func_append finalize_command " $arg" 7068 func_append finalize_command " $arg"
5654 prev=xcompiler 7069 prev=xcompiler
5655 continue 7070 continue
5656 ;; 7071 ;;
5657 7072
5658 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ 7073 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
5659 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) 7074 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
5660 func_append compiler_flags " $arg" 7075 func_append compiler_flags " $arg"
5661 func_append compile_command " $arg" 7076 func_append compile_command " $arg"
5662 func_append finalize_command " $arg" 7077 func_append finalize_command " $arg"
5663 case "$new_inherited_linker_flags " in 7078 case "$new_inherited_linker_flags " in
5664 *" $arg "*) ;; 7079 *" $arg "*) ;;
5665 * ) func_append new_inherited_linker_flags " $arg" ;; 7080 * ) func_append new_inherited_linker_flags " $arg" ;;
5666 esac 7081 esac
5667 continue 7082 continue
5668 ;; 7083 ;;
5669 7084
5670 -multi_module) 7085 -multi_module)
5671 » single_module="${wl}-multi_module" 7086 » single_module=$wl-multi_module
5672 continue 7087 continue
5673 ;; 7088 ;;
5674 7089
5675 -no-fast-install) 7090 -no-fast-install)
5676 fast_install=no 7091 fast_install=no
5677 continue 7092 continue
5678 ;; 7093 ;;
5679 7094
5680 -no-install) 7095 -no-install)
5681 case $host in 7096 case $host in
5682 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc* ) 7097 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc* )
5683 # The PATH hackery in wrapper scripts is required on Windows 7098 # The PATH hackery in wrapper scripts is required on Windows
5684 # and Darwin in order for the loader to find any dlls it needs. 7099 # and Darwin in order for the loader to find any dlls it needs.
5685 » func_warning "\`-no-install' is ignored for $host" 7100 » func_warning "'-no-install' is ignored for $host"
5686 » func_warning "assuming \`-no-fast-install' instead" 7101 » func_warning "assuming '-no-fast-install' instead"
5687 fast_install=no 7102 fast_install=no
5688 ;; 7103 ;;
5689 *) no_install=yes ;; 7104 *) no_install=yes ;;
5690 esac 7105 esac
5691 continue 7106 continue
5692 ;; 7107 ;;
5693 7108
5694 -no-undefined) 7109 -no-undefined)
5695 allow_undefined=no 7110 allow_undefined=no
5696 continue 7111 continue
5697 ;; 7112 ;;
5698 7113
5699 -objectlist) 7114 -objectlist)
5700 prev=objectlist 7115 prev=objectlist
5701 continue 7116 continue
5702 ;; 7117 ;;
5703 7118
7119 -os2dllname)
7120 prev=os2dllname
7121 continue
7122 ;;
7123
5704 -o) prev=output ;; 7124 -o) prev=output ;;
5705 7125
5706 -precious-files-regex) 7126 -precious-files-regex)
5707 prev=precious_regex 7127 prev=precious_regex
5708 continue 7128 continue
5709 ;; 7129 ;;
5710 7130
5711 -release) 7131 -release)
5712 prev=release 7132 prev=release
5713 continue 7133 continue
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
5781 7201
5782 -weak) 7202 -weak)
5783 prev=weak 7203 prev=weak
5784 continue 7204 continue
5785 ;; 7205 ;;
5786 7206
5787 -Wc,*) 7207 -Wc,*)
5788 func_stripname '-Wc,' '' "$arg" 7208 func_stripname '-Wc,' '' "$arg"
5789 args=$func_stripname_result 7209 args=$func_stripname_result
5790 arg= 7210 arg=
5791 » save_ifs="$IFS"; IFS=',' 7211 » save_ifs=$IFS; IFS=,
5792 for flag in $args; do 7212 for flag in $args; do
5793 » IFS="$save_ifs" 7213 » IFS=$save_ifs
5794 func_quote_for_eval "$flag" 7214 func_quote_for_eval "$flag"
5795 func_append arg " $func_quote_for_eval_result" 7215 func_append arg " $func_quote_for_eval_result"
5796 func_append compiler_flags " $func_quote_for_eval_result" 7216 func_append compiler_flags " $func_quote_for_eval_result"
5797 done 7217 done
5798 » IFS="$save_ifs" 7218 » IFS=$save_ifs
5799 func_stripname ' ' '' "$arg" 7219 func_stripname ' ' '' "$arg"
5800 arg=$func_stripname_result 7220 arg=$func_stripname_result
5801 ;; 7221 ;;
5802 7222
5803 -Wl,*) 7223 -Wl,*)
5804 func_stripname '-Wl,' '' "$arg" 7224 func_stripname '-Wl,' '' "$arg"
5805 args=$func_stripname_result 7225 args=$func_stripname_result
5806 arg= 7226 arg=
5807 » save_ifs="$IFS"; IFS=',' 7227 » save_ifs=$IFS; IFS=,
5808 for flag in $args; do 7228 for flag in $args; do
5809 » IFS="$save_ifs" 7229 » IFS=$save_ifs
5810 func_quote_for_eval "$flag" 7230 func_quote_for_eval "$flag"
5811 func_append arg " $wl$func_quote_for_eval_result" 7231 func_append arg " $wl$func_quote_for_eval_result"
5812 func_append compiler_flags " $wl$func_quote_for_eval_result" 7232 func_append compiler_flags " $wl$func_quote_for_eval_result"
5813 func_append linker_flags " $func_quote_for_eval_result" 7233 func_append linker_flags " $func_quote_for_eval_result"
5814 done 7234 done
5815 » IFS="$save_ifs" 7235 » IFS=$save_ifs
5816 func_stripname ' ' '' "$arg" 7236 func_stripname ' ' '' "$arg"
5817 arg=$func_stripname_result 7237 arg=$func_stripname_result
5818 ;; 7238 ;;
5819 7239
5820 -Xcompiler) 7240 -Xcompiler)
5821 prev=xcompiler 7241 prev=xcompiler
5822 continue 7242 continue
5823 ;; 7243 ;;
5824 7244
5825 -Xlinker) 7245 -Xlinker)
5826 prev=xlinker 7246 prev=xlinker
5827 continue 7247 continue
5828 ;; 7248 ;;
5829 7249
5830 -XCClinker) 7250 -XCClinker)
5831 prev=xcclinker 7251 prev=xcclinker
5832 continue 7252 continue
5833 ;; 7253 ;;
5834 7254
5835 # -msg_* for osf cc 7255 # -msg_* for osf cc
5836 -msg_*) 7256 -msg_*)
5837 func_quote_for_eval "$arg" 7257 func_quote_for_eval "$arg"
5838 » arg="$func_quote_for_eval_result" 7258 » arg=$func_quote_for_eval_result
5839 ;; 7259 ;;
5840 7260
5841 # Flags to be passed through unchanged, with rationale: 7261 # Flags to be passed through unchanged, with rationale:
5842 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler 7262 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
5843 # -r[0-9][0-9]* specify processor for the SGI compiler 7263 # -r[0-9][0-9]* specify processor for the SGI compiler
5844 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler 7264 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
5845 # +DA*, +DD* enable 64-bit mode for the HP compiler 7265 # +DA*, +DD* enable 64-bit mode for the HP compiler
5846 # -q* compiler args for the IBM compiler 7266 # -q* compiler args for the IBM compiler
5847 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC 7267 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
5848 # -F/path path to uninstalled frameworks, gcc on darwin 7268 # -F/path path to uninstalled frameworks, gcc on darwin
5849 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC 7269 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
7270 # -fstack-protector* stack protector flags for GCC
5850 # @file GCC response files 7271 # @file GCC response files
5851 # -tp=* Portland pgcc target processor selection 7272 # -tp=* Portland pgcc target processor selection
5852 # --sysroot=* for sysroot support 7273 # --sysroot=* for sysroot support
5853 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization 7274 # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimizati on
7275 # -stdlib=* select c++ std lib with clang
5854 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ 7276 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5855 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ 7277 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
5856 -O*|-flto*|-fwhopr*|-fuse-linker-plugin) 7278 -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
5857 func_quote_for_eval "$arg" 7279 func_quote_for_eval "$arg"
5858 » arg="$func_quote_for_eval_result" 7280 » arg=$func_quote_for_eval_result
5859 func_append compile_command " $arg" 7281 func_append compile_command " $arg"
5860 func_append finalize_command " $arg" 7282 func_append finalize_command " $arg"
5861 func_append compiler_flags " $arg" 7283 func_append compiler_flags " $arg"
5862 continue 7284 continue
5863 ;; 7285 ;;
5864 7286
7287 -Z*)
7288 if test os2 = "`expr $host : '.*\(os2\)'`"; then
7289 # OS/2 uses -Zxxx to specify OS/2-specific options
7290 compiler_flags="$compiler_flags $arg"
7291 func_append compile_command " $arg"
7292 func_append finalize_command " $arg"
7293 case $arg in
7294 -Zlinker | -Zstack)
7295 prev=xcompiler
7296 ;;
7297 esac
7298 continue
7299 else
7300 # Otherwise treat like 'Some other compiler flag' below
7301 func_quote_for_eval "$arg"
7302 arg=$func_quote_for_eval_result
7303 fi
7304 ;;
7305
5865 # Some other compiler flag. 7306 # Some other compiler flag.
5866 -* | +*) 7307 -* | +*)
5867 func_quote_for_eval "$arg" 7308 func_quote_for_eval "$arg"
5868 » arg="$func_quote_for_eval_result" 7309 » arg=$func_quote_for_eval_result
5869 ;; 7310 ;;
5870 7311
5871 *.$objext) 7312 *.$objext)
5872 # A standard object. 7313 # A standard object.
5873 func_append objs " $arg" 7314 func_append objs " $arg"
5874 ;; 7315 ;;
5875 7316
5876 *.lo) 7317 *.lo)
5877 # A libtool-controlled object. 7318 # A libtool-controlled object.
5878 7319
5879 # Check to see that this really is a libtool object. 7320 # Check to see that this really is a libtool object.
5880 if func_lalib_unsafe_p "$arg"; then 7321 if func_lalib_unsafe_p "$arg"; then
5881 pic_object= 7322 pic_object=
5882 non_pic_object= 7323 non_pic_object=
5883 7324
5884 # Read the .lo file 7325 # Read the .lo file
5885 func_source "$arg" 7326 func_source "$arg"
5886 7327
5887 if test -z "$pic_object" || 7328 if test -z "$pic_object" ||
5888 test -z "$non_pic_object" || 7329 test -z "$non_pic_object" ||
5889 » test "$pic_object" = none && 7330 » test none = "$pic_object" &&
5890 » test "$non_pic_object" = none; then 7331 » test none = "$non_pic_object"; then
5891 » func_fatal_error "cannot find name of object for \`$arg'" 7332 » func_fatal_error "cannot find name of object for '$arg'"
5892 fi 7333 fi
5893 7334
5894 # Extract subdirectory from the argument. 7335 # Extract subdirectory from the argument.
5895 func_dirname "$arg" "/" "" 7336 func_dirname "$arg" "/" ""
5896 » xdir="$func_dirname_result" 7337 » xdir=$func_dirname_result
5897 7338
5898 » if test "$pic_object" != none; then 7339 » test none = "$pic_object" || {
5899 # Prepend the subdirectory the object is found in. 7340 # Prepend the subdirectory the object is found in.
5900 » pic_object="$xdir$pic_object" 7341 » pic_object=$xdir$pic_object
5901 7342
5902 » if test "$prev" = dlfiles; then 7343 » if test dlfiles = "$prev"; then
5903 » if test "$build_libtool_libs" = yes && test "$dlopen_support" = ye s; then 7344 » if test yes = "$build_libtool_libs" && test yes = "$dlopen_support "; then
5904 func_append dlfiles " $pic_object" 7345 func_append dlfiles " $pic_object"
5905 prev= 7346 prev=
5906 continue 7347 continue
5907 else 7348 else
5908 # If libtool objects are unsupported, then we need to preload. 7349 # If libtool objects are unsupported, then we need to preload.
5909 prev=dlprefiles 7350 prev=dlprefiles
5910 fi 7351 fi
5911 fi 7352 fi
5912 7353
5913 # CHECK ME: I think I busted this. -Ossama 7354 # CHECK ME: I think I busted this. -Ossama
5914 » if test "$prev" = dlprefiles; then 7355 » if test dlprefiles = "$prev"; then
5915 # Preload the old-style object. 7356 # Preload the old-style object.
5916 func_append dlprefiles " $pic_object" 7357 func_append dlprefiles " $pic_object"
5917 prev= 7358 prev=
5918 fi 7359 fi
5919 7360
5920 # A PIC object. 7361 # A PIC object.
5921 func_append libobjs " $pic_object" 7362 func_append libobjs " $pic_object"
5922 » arg="$pic_object" 7363 » arg=$pic_object
5923 » fi 7364 » }
5924 7365
5925 # Non-PIC object. 7366 # Non-PIC object.
5926 » if test "$non_pic_object" != none; then 7367 » if test none != "$non_pic_object"; then
5927 # Prepend the subdirectory the object is found in. 7368 # Prepend the subdirectory the object is found in.
5928 » non_pic_object="$xdir$non_pic_object" 7369 » non_pic_object=$xdir$non_pic_object
5929 7370
5930 # A standard non-PIC object 7371 # A standard non-PIC object
5931 func_append non_pic_objects " $non_pic_object" 7372 func_append non_pic_objects " $non_pic_object"
5932 » if test -z "$pic_object" || test "$pic_object" = none ; then 7373 » if test -z "$pic_object" || test none = "$pic_object"; then
5933 » arg="$non_pic_object" 7374 » arg=$non_pic_object
5934 fi 7375 fi
5935 else 7376 else
5936 # If the PIC object exists, use it instead. 7377 # If the PIC object exists, use it instead.
5937 # $xdir was prepended to $pic_object above. 7378 # $xdir was prepended to $pic_object above.
5938 » non_pic_object="$pic_object" 7379 » non_pic_object=$pic_object
5939 func_append non_pic_objects " $non_pic_object" 7380 func_append non_pic_objects " $non_pic_object"
5940 fi 7381 fi
5941 else 7382 else
5942 # Only an error if not doing a dry-run. 7383 # Only an error if not doing a dry-run.
5943 if $opt_dry_run; then 7384 if $opt_dry_run; then
5944 # Extract subdirectory from the argument. 7385 # Extract subdirectory from the argument.
5945 func_dirname "$arg" "/" "" 7386 func_dirname "$arg" "/" ""
5946 » xdir="$func_dirname_result" 7387 » xdir=$func_dirname_result
5947 7388
5948 func_lo2o "$arg" 7389 func_lo2o "$arg"
5949 pic_object=$xdir$objdir/$func_lo2o_result 7390 pic_object=$xdir$objdir/$func_lo2o_result
5950 non_pic_object=$xdir$func_lo2o_result 7391 non_pic_object=$xdir$func_lo2o_result
5951 func_append libobjs " $pic_object" 7392 func_append libobjs " $pic_object"
5952 func_append non_pic_objects " $non_pic_object" 7393 func_append non_pic_objects " $non_pic_object"
5953 else 7394 else
5954 » func_fatal_error "\`$arg' is not a valid libtool object" 7395 » func_fatal_error "'$arg' is not a valid libtool object"
5955 fi 7396 fi
5956 fi 7397 fi
5957 ;; 7398 ;;
5958 7399
5959 *.$libext) 7400 *.$libext)
5960 # An archive. 7401 # An archive.
5961 func_append deplibs " $arg" 7402 func_append deplibs " $arg"
5962 func_append old_deplibs " $arg" 7403 func_append old_deplibs " $arg"
5963 continue 7404 continue
5964 ;; 7405 ;;
5965 7406
5966 *.la) 7407 *.la)
5967 # A libtool-controlled library. 7408 # A libtool-controlled library.
5968 7409
5969 func_resolve_sysroot "$arg" 7410 func_resolve_sysroot "$arg"
5970 » if test "$prev" = dlfiles; then 7411 » if test dlfiles = "$prev"; then
5971 # This library was specified with -dlopen. 7412 # This library was specified with -dlopen.
5972 func_append dlfiles " $func_resolve_sysroot_result" 7413 func_append dlfiles " $func_resolve_sysroot_result"
5973 prev= 7414 prev=
5974 » elif test "$prev" = dlprefiles; then 7415 » elif test dlprefiles = "$prev"; then
5975 # The library was specified with -dlpreopen. 7416 # The library was specified with -dlpreopen.
5976 func_append dlprefiles " $func_resolve_sysroot_result" 7417 func_append dlprefiles " $func_resolve_sysroot_result"
5977 prev= 7418 prev=
5978 else 7419 else
5979 func_append deplibs " $func_resolve_sysroot_result" 7420 func_append deplibs " $func_resolve_sysroot_result"
5980 fi 7421 fi
5981 continue 7422 continue
5982 ;; 7423 ;;
5983 7424
5984 # Some other compiler argument. 7425 # Some other compiler argument.
5985 *) 7426 *)
5986 # Unknown arguments in both finalize_command and compile_command need 7427 # Unknown arguments in both finalize_command and compile_command need
5987 # to be aesthetically quoted because they are evaled later. 7428 # to be aesthetically quoted because they are evaled later.
5988 func_quote_for_eval "$arg" 7429 func_quote_for_eval "$arg"
5989 » arg="$func_quote_for_eval_result" 7430 » arg=$func_quote_for_eval_result
5990 ;; 7431 ;;
5991 esac # arg 7432 esac # arg
5992 7433
5993 # Now actually substitute the argument into the commands. 7434 # Now actually substitute the argument into the commands.
5994 if test -n "$arg"; then 7435 if test -n "$arg"; then
5995 func_append compile_command " $arg" 7436 func_append compile_command " $arg"
5996 func_append finalize_command " $arg" 7437 func_append finalize_command " $arg"
5997 fi 7438 fi
5998 done # argument parsing loop 7439 done # argument parsing loop
5999 7440
6000 test -n "$prev" && \ 7441 test -n "$prev" && \
6001 func_fatal_help "the \`$prevarg' option requires an argument" 7442 func_fatal_help "the '$prevarg' option requires an argument"
6002 7443
6003 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then 7444 if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
6004 eval arg=\"$export_dynamic_flag_spec\" 7445 eval arg=\"$export_dynamic_flag_spec\"
6005 func_append compile_command " $arg" 7446 func_append compile_command " $arg"
6006 func_append finalize_command " $arg" 7447 func_append finalize_command " $arg"
6007 fi 7448 fi
6008 7449
6009 oldlibs= 7450 oldlibs=
6010 # calculate the name of the file, without its directory 7451 # calculate the name of the file, without its directory
6011 func_basename "$output" 7452 func_basename "$output"
6012 outputname="$func_basename_result" 7453 outputname=$func_basename_result
6013 libobjs_save="$libobjs" 7454 libobjs_save=$libobjs
6014 7455
6015 if test -n "$shlibpath_var"; then 7456 if test -n "$shlibpath_var"; then
6016 # get the directories listed in $shlibpath_var 7457 # get the directories listed in $shlibpath_var
6017 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\ '\` 7458 eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\ `
6018 else 7459 else
6019 shlib_search_path= 7460 shlib_search_path=
6020 fi 7461 fi
6021 eval sys_lib_search_path=\"$sys_lib_search_path_spec\" 7462 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
6022 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" 7463 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
6023 7464
7465 # Definition is injected by LT_CONFIG during libtool generation.
7466 func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
7467
6024 func_dirname "$output" "/" "" 7468 func_dirname "$output" "/" ""
6025 output_objdir="$func_dirname_result$objdir" 7469 output_objdir=$func_dirname_result$objdir
6026 func_to_tool_file "$output_objdir/" 7470 func_to_tool_file "$output_objdir/"
6027 tool_output_objdir=$func_to_tool_file_result 7471 tool_output_objdir=$func_to_tool_file_result
6028 # Create the object directory. 7472 # Create the object directory.
6029 func_mkdir_p "$output_objdir" 7473 func_mkdir_p "$output_objdir"
6030 7474
6031 # Determine the type of output 7475 # Determine the type of output
6032 case $output in 7476 case $output in
6033 "") 7477 "")
6034 func_fatal_help "you must specify an output file" 7478 func_fatal_help "you must specify an output file"
6035 ;; 7479 ;;
6036 *.$libext) linkmode=oldlib ;; 7480 *.$libext) linkmode=oldlib ;;
6037 *.lo | *.$objext) linkmode=obj ;; 7481 *.lo | *.$objext) linkmode=obj ;;
6038 *.la) linkmode=lib ;; 7482 *.la) linkmode=lib ;;
6039 *) linkmode=prog ;; # Anything else should be a program. 7483 *) linkmode=prog ;; # Anything else should be a program.
6040 esac 7484 esac
6041 7485
6042 specialdeplibs= 7486 specialdeplibs=
6043 7487
6044 libs= 7488 libs=
6045 # Find all interdependent deplibs by searching for libraries 7489 # Find all interdependent deplibs by searching for libraries
6046 # that are linked more than once (e.g. -la -lb -la) 7490 # that are linked more than once (e.g. -la -lb -la)
6047 for deplib in $deplibs; do 7491 for deplib in $deplibs; do
6048 if $opt_preserve_dup_deps ; then 7492 if $opt_preserve_dup_deps; then
6049 case "$libs " in 7493 case "$libs " in
6050 *" $deplib "*) func_append specialdeplibs " $deplib" ;; 7494 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6051 esac 7495 esac
6052 fi 7496 fi
6053 func_append libs " $deplib" 7497 func_append libs " $deplib"
6054 done 7498 done
6055 7499
6056 if test "$linkmode" = lib; then 7500 if test lib = "$linkmode"; then
6057 libs="$predeps $libs $compiler_lib_search_path $postdeps" 7501 libs="$predeps $libs $compiler_lib_search_path $postdeps"
6058 7502
6059 # Compute libraries that are listed more than once in $predeps 7503 # Compute libraries that are listed more than once in $predeps
6060 # $postdeps and mark them as special (i.e., whose duplicates are 7504 # $postdeps and mark them as special (i.e., whose duplicates are
6061 # not to be eliminated). 7505 # not to be eliminated).
6062 pre_post_deps= 7506 pre_post_deps=
6063 if $opt_duplicate_compiler_generated_deps; then 7507 if $opt_duplicate_compiler_generated_deps; then
6064 for pre_post_dep in $predeps $postdeps; do 7508 for pre_post_dep in $predeps $postdeps; do
6065 case "$pre_post_deps " in 7509 case "$pre_post_deps " in
6066 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; 7510 *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
(...skipping 11 matching lines...) Expand all
6078 notinst_deplibs= # not-installed libtool libraries 7522 notinst_deplibs= # not-installed libtool libraries
6079 notinst_path= # paths that contain not-installed libtool libraries 7523 notinst_path= # paths that contain not-installed libtool libraries
6080 7524
6081 case $linkmode in 7525 case $linkmode in
6082 lib) 7526 lib)
6083 passes="conv dlpreopen link" 7527 passes="conv dlpreopen link"
6084 for file in $dlfiles $dlprefiles; do 7528 for file in $dlfiles $dlprefiles; do
6085 case $file in 7529 case $file in
6086 *.la) ;; 7530 *.la) ;;
6087 *) 7531 *)
6088 » func_fatal_help "libraries can \`-dlopen' only libtool libraries: $f ile" 7532 » func_fatal_help "libraries can '-dlopen' only libtool libraries: $fi le"
6089 ;; 7533 ;;
6090 esac 7534 esac
6091 done 7535 done
6092 ;; 7536 ;;
6093 prog) 7537 prog)
6094 compile_deplibs= 7538 compile_deplibs=
6095 finalize_deplibs= 7539 finalize_deplibs=
6096 » alldeplibs=no 7540 » alldeplibs=false
6097 newdlfiles= 7541 newdlfiles=
6098 newdlprefiles= 7542 newdlprefiles=
6099 passes="conv scan dlopen dlpreopen link" 7543 passes="conv scan dlopen dlpreopen link"
6100 ;; 7544 ;;
6101 *) passes="conv" 7545 *) passes="conv"
6102 ;; 7546 ;;
6103 esac 7547 esac
6104 7548
6105 for pass in $passes; do 7549 for pass in $passes; do
6106 # The preopen pass in lib mode reverses $deplibs; put it back here 7550 # The preopen pass in lib mode reverses $deplibs; put it back here
6107 # so that -L comes before libs that need it for instance... 7551 # so that -L comes before libs that need it for instance...
6108 if test "$linkmode,$pass" = "lib,link"; then 7552 if test lib,link = "$linkmode,$pass"; then
6109 ## FIXME: Find the place where the list is rebuilt in the wrong 7553 ## FIXME: Find the place where the list is rebuilt in the wrong
6110 ## order, and fix it there properly 7554 ## order, and fix it there properly
6111 tmp_deplibs= 7555 tmp_deplibs=
6112 for deplib in $deplibs; do 7556 for deplib in $deplibs; do
6113 tmp_deplibs="$deplib $tmp_deplibs" 7557 tmp_deplibs="$deplib $tmp_deplibs"
6114 done 7558 done
6115 » deplibs="$tmp_deplibs" 7559 » deplibs=$tmp_deplibs
6116 fi 7560 fi
6117 7561
6118 if test "$linkmode,$pass" = "lib,link" || 7562 if test lib,link = "$linkmode,$pass" ||
6119 » test "$linkmode,$pass" = "prog,scan"; then 7563 » test prog,scan = "$linkmode,$pass"; then
6120 » libs="$deplibs" 7564 » libs=$deplibs
6121 deplibs= 7565 deplibs=
6122 fi 7566 fi
6123 if test "$linkmode" = prog; then 7567 if test prog = "$linkmode"; then
6124 case $pass in 7568 case $pass in
6125 » dlopen) libs="$dlfiles" ;; 7569 » dlopen) libs=$dlfiles ;;
6126 » dlpreopen) libs="$dlprefiles" ;; 7570 » dlpreopen) libs=$dlprefiles ;;
6127 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; 7571 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
6128 esac 7572 esac
6129 fi 7573 fi
6130 if test "$linkmode,$pass" = "lib,dlpreopen"; then 7574 if test lib,dlpreopen = "$linkmode,$pass"; then
6131 # Collect and forward deplibs of preopened libtool libs 7575 # Collect and forward deplibs of preopened libtool libs
6132 for lib in $dlprefiles; do 7576 for lib in $dlprefiles; do
6133 # Ignore non-libtool-libs 7577 # Ignore non-libtool-libs
6134 dependency_libs= 7578 dependency_libs=
6135 func_resolve_sysroot "$lib" 7579 func_resolve_sysroot "$lib"
6136 case $lib in 7580 case $lib in
6137 *.la) func_source "$func_resolve_sysroot_result" ;; 7581 *.la) func_source "$func_resolve_sysroot_result" ;;
6138 esac 7582 esac
6139 7583
6140 # Collect preopened libtool deplibs, except any this library 7584 # Collect preopened libtool deplibs, except any this library
6141 # has declared as weak libs 7585 # has declared as weak libs
6142 for deplib in $dependency_libs; do 7586 for deplib in $dependency_libs; do
6143 func_basename "$deplib" 7587 func_basename "$deplib"
6144 deplib_base=$func_basename_result 7588 deplib_base=$func_basename_result
6145 case " $weak_libs " in 7589 case " $weak_libs " in
6146 *" $deplib_base "*) ;; 7590 *" $deplib_base "*) ;;
6147 *) func_append deplibs " $deplib" ;; 7591 *) func_append deplibs " $deplib" ;;
6148 esac 7592 esac
6149 done 7593 done
6150 done 7594 done
6151 » libs="$dlprefiles" 7595 » libs=$dlprefiles
6152 fi 7596 fi
6153 if test "$pass" = dlopen; then 7597 if test dlopen = "$pass"; then
6154 # Collect dlpreopened libraries 7598 # Collect dlpreopened libraries
6155 » save_deplibs="$deplibs" 7599 » save_deplibs=$deplibs
6156 deplibs= 7600 deplibs=
6157 fi 7601 fi
6158 7602
6159 for deplib in $libs; do 7603 for deplib in $libs; do
6160 lib= 7604 lib=
6161 » found=no 7605 » found=false
6162 case $deplib in 7606 case $deplib in
6163 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ 7607 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
6164 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) 7608 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6165 » if test "$linkmode,$pass" = "prog,link"; then 7609 » if test prog,link = "$linkmode,$pass"; then
6166 compile_deplibs="$deplib $compile_deplibs" 7610 compile_deplibs="$deplib $compile_deplibs"
6167 finalize_deplibs="$deplib $finalize_deplibs" 7611 finalize_deplibs="$deplib $finalize_deplibs"
6168 else 7612 else
6169 func_append compiler_flags " $deplib" 7613 func_append compiler_flags " $deplib"
6170 » if test "$linkmode" = lib ; then 7614 » if test lib = "$linkmode"; then
6171 case "$new_inherited_linker_flags " in 7615 case "$new_inherited_linker_flags " in
6172 *" $deplib "*) ;; 7616 *" $deplib "*) ;;
6173 * ) func_append new_inherited_linker_flags " $deplib" ;; 7617 * ) func_append new_inherited_linker_flags " $deplib" ;;
6174 esac 7618 esac
6175 fi 7619 fi
6176 fi 7620 fi
6177 continue 7621 continue
6178 ;; 7622 ;;
6179 -l*) 7623 -l*)
6180 » if test "$linkmode" != lib && test "$linkmode" != prog; then 7624 » if test lib != "$linkmode" && test prog != "$linkmode"; then
6181 » func_warning "\`-l' is ignored for archives/objects" 7625 » func_warning "'-l' is ignored for archives/objects"
6182 continue 7626 continue
6183 fi 7627 fi
6184 func_stripname '-l' '' "$deplib" 7628 func_stripname '-l' '' "$deplib"
6185 name=$func_stripname_result 7629 name=$func_stripname_result
6186 » if test "$linkmode" = lib; then 7630 » if test lib = "$linkmode"; then
6187 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_searc h_dirs $sys_lib_search_path $shlib_search_path" 7631 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_searc h_dirs $sys_lib_search_path $shlib_search_path"
6188 else 7632 else
6189 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_pat h $shlib_search_path" 7633 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_pat h $shlib_search_path"
6190 fi 7634 fi
6191 for searchdir in $searchdirs; do 7635 for searchdir in $searchdirs; do
6192 for search_ext in .la $std_shrext .so .a; do 7636 for search_ext in .la $std_shrext .so .a; do
6193 # Search the libtool library 7637 # Search the libtool library
6194 » lib="$searchdir/lib${name}${search_ext}" 7638 » lib=$searchdir/lib$name$search_ext
6195 if test -f "$lib"; then 7639 if test -f "$lib"; then
6196 » » if test "$search_ext" = ".la"; then 7640 » » if test .la = "$search_ext"; then
6197 » » found=yes 7641 » » found=:
6198 else 7642 else
6199 » » found=no 7643 » » found=false
6200 fi 7644 fi
6201 break 2 7645 break 2
6202 fi 7646 fi
6203 done 7647 done
6204 done 7648 done
6205 » if test "$found" != yes; then 7649 » if $found; then
6206 » # deplib doesn't seem to be a libtool library 7650 » # deplib is a libtool library
6207 » if test "$linkmode,$pass" = "prog,link"; then
6208 » compile_deplibs="$deplib $compile_deplibs"
6209 » finalize_deplibs="$deplib $finalize_deplibs"
6210 » else
6211 » deplibs="$deplib $deplibs"
6212 » test "$linkmode" = lib && newdependency_libs="$deplib $newdependen cy_libs"
6213 » fi
6214 » continue
6215 » else # deplib is a libtool library
6216 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib , 7651 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib ,
6217 # We need to do some special things here, and not later. 7652 # We need to do some special things here, and not later.
6218 » if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 7653 » if test yes = "$allow_libtool_libs_with_static_runtimes"; then
6219 case " $predeps $postdeps " in 7654 case " $predeps $postdeps " in
6220 *" $deplib "*) 7655 *" $deplib "*)
6221 if func_lalib_p "$lib"; then 7656 if func_lalib_p "$lib"; then
6222 library_names= 7657 library_names=
6223 old_library= 7658 old_library=
6224 func_source "$lib" 7659 func_source "$lib"
6225 for l in $old_library $library_names; do 7660 for l in $old_library $library_names; do
6226 » » ll="$l" 7661 » » ll=$l
6227 done 7662 done
6228 » » if test "X$ll" = "X$old_library" ; then # only static version available 7663 » » if test "X$ll" = "X$old_library"; then # only static version a vailable
6229 » » found=no 7664 » » found=false
6230 func_dirname "$lib" "" "." 7665 func_dirname "$lib" "" "."
6231 » » ladir="$func_dirname_result" 7666 » » ladir=$func_dirname_result
6232 lib=$ladir/$old_library 7667 lib=$ladir/$old_library
6233 » » if test "$linkmode,$pass" = "prog,link"; then 7668 » » if test prog,link = "$linkmode,$pass"; then
6234 compile_deplibs="$deplib $compile_deplibs" 7669 compile_deplibs="$deplib $compile_deplibs"
6235 finalize_deplibs="$deplib $finalize_deplibs" 7670 finalize_deplibs="$deplib $finalize_deplibs"
6236 else 7671 else
6237 deplibs="$deplib $deplibs" 7672 deplibs="$deplib $deplibs"
6238 » » test "$linkmode" = lib && newdependency_libs="$deplib $new dependency_libs" 7673 » » test lib = "$linkmode" && newdependency_libs="$deplib $new dependency_libs"
6239 fi 7674 fi
6240 continue 7675 continue
6241 fi 7676 fi
6242 fi 7677 fi
6243 ;; 7678 ;;
6244 *) ;; 7679 *) ;;
6245 esac 7680 esac
6246 fi 7681 fi
7682 else
7683 # deplib doesn't seem to be a libtool library
7684 if test prog,link = "$linkmode,$pass"; then
7685 compile_deplibs="$deplib $compile_deplibs"
7686 finalize_deplibs="$deplib $finalize_deplibs"
7687 else
7688 deplibs="$deplib $deplibs"
7689 test lib = "$linkmode" && newdependency_libs="$deplib $newdependen cy_libs"
7690 fi
7691 continue
6247 fi 7692 fi
6248 ;; # -l 7693 ;; # -l
6249 *.ltframework) 7694 *.ltframework)
6250 » if test "$linkmode,$pass" = "prog,link"; then 7695 » if test prog,link = "$linkmode,$pass"; then
6251 compile_deplibs="$deplib $compile_deplibs" 7696 compile_deplibs="$deplib $compile_deplibs"
6252 finalize_deplibs="$deplib $finalize_deplibs" 7697 finalize_deplibs="$deplib $finalize_deplibs"
6253 else 7698 else
6254 deplibs="$deplib $deplibs" 7699 deplibs="$deplib $deplibs"
6255 » if test "$linkmode" = lib ; then 7700 » if test lib = "$linkmode"; then
6256 case "$new_inherited_linker_flags " in 7701 case "$new_inherited_linker_flags " in
6257 *" $deplib "*) ;; 7702 *" $deplib "*) ;;
6258 * ) func_append new_inherited_linker_flags " $deplib" ;; 7703 * ) func_append new_inherited_linker_flags " $deplib" ;;
6259 esac 7704 esac
6260 fi 7705 fi
6261 fi 7706 fi
6262 continue 7707 continue
6263 ;; 7708 ;;
6264 -L*) 7709 -L*)
6265 case $linkmode in 7710 case $linkmode in
6266 lib) 7711 lib)
6267 deplibs="$deplib $deplibs" 7712 deplibs="$deplib $deplibs"
6268 » test "$pass" = conv && continue 7713 » test conv = "$pass" && continue
6269 newdependency_libs="$deplib $newdependency_libs" 7714 newdependency_libs="$deplib $newdependency_libs"
6270 func_stripname '-L' '' "$deplib" 7715 func_stripname '-L' '' "$deplib"
6271 func_resolve_sysroot "$func_stripname_result" 7716 func_resolve_sysroot "$func_stripname_result"
6272 func_append newlib_search_path " $func_resolve_sysroot_result" 7717 func_append newlib_search_path " $func_resolve_sysroot_result"
6273 ;; 7718 ;;
6274 prog) 7719 prog)
6275 » if test "$pass" = conv; then 7720 » if test conv = "$pass"; then
6276 deplibs="$deplib $deplibs" 7721 deplibs="$deplib $deplibs"
6277 continue 7722 continue
6278 fi 7723 fi
6279 » if test "$pass" = scan; then 7724 » if test scan = "$pass"; then
6280 deplibs="$deplib $deplibs" 7725 deplibs="$deplib $deplibs"
6281 else 7726 else
6282 compile_deplibs="$deplib $compile_deplibs" 7727 compile_deplibs="$deplib $compile_deplibs"
6283 finalize_deplibs="$deplib $finalize_deplibs" 7728 finalize_deplibs="$deplib $finalize_deplibs"
6284 fi 7729 fi
6285 func_stripname '-L' '' "$deplib" 7730 func_stripname '-L' '' "$deplib"
6286 func_resolve_sysroot "$func_stripname_result" 7731 func_resolve_sysroot "$func_stripname_result"
6287 func_append newlib_search_path " $func_resolve_sysroot_result" 7732 func_append newlib_search_path " $func_resolve_sysroot_result"
6288 ;; 7733 ;;
6289 *) 7734 *)
6290 » func_warning "\`-L' is ignored for archives/objects" 7735 » func_warning "'-L' is ignored for archives/objects"
6291 ;; 7736 ;;
6292 esac # linkmode 7737 esac # linkmode
6293 continue 7738 continue
6294 ;; # -L 7739 ;; # -L
6295 -R*) 7740 -R*)
6296 » if test "$pass" = link; then 7741 » if test link = "$pass"; then
6297 func_stripname '-R' '' "$deplib" 7742 func_stripname '-R' '' "$deplib"
6298 func_resolve_sysroot "$func_stripname_result" 7743 func_resolve_sysroot "$func_stripname_result"
6299 dir=$func_resolve_sysroot_result 7744 dir=$func_resolve_sysroot_result
6300 # Make sure the xrpath contains only unique directories. 7745 # Make sure the xrpath contains only unique directories.
6301 case "$xrpath " in 7746 case "$xrpath " in
6302 *" $dir "*) ;; 7747 *" $dir "*) ;;
6303 *) func_append xrpath " $dir" ;; 7748 *) func_append xrpath " $dir" ;;
6304 esac 7749 esac
6305 fi 7750 fi
6306 deplibs="$deplib $deplibs" 7751 deplibs="$deplib $deplibs"
6307 continue 7752 continue
6308 ;; 7753 ;;
6309 *.la) 7754 *.la)
6310 func_resolve_sysroot "$deplib" 7755 func_resolve_sysroot "$deplib"
6311 lib=$func_resolve_sysroot_result 7756 lib=$func_resolve_sysroot_result
6312 ;; 7757 ;;
6313 *.$libext) 7758 *.$libext)
6314 » if test "$pass" = conv; then 7759 » if test conv = "$pass"; then
6315 deplibs="$deplib $deplibs" 7760 deplibs="$deplib $deplibs"
6316 continue 7761 continue
6317 fi 7762 fi
6318 case $linkmode in 7763 case $linkmode in
6319 lib) 7764 lib)
6320 # Linking convenience modules into shared libraries is allowed, 7765 # Linking convenience modules into shared libraries is allowed,
6321 # but linking other static libraries is non-portable. 7766 # but linking other static libraries is non-portable.
6322 case " $dlpreconveniencelibs " in 7767 case " $dlpreconveniencelibs " in
6323 *" $deplib "*) ;; 7768 *" $deplib "*) ;;
6324 *) 7769 *)
6325 » valid_a_lib=no 7770 » valid_a_lib=false
6326 case $deplibs_check_method in 7771 case $deplibs_check_method in
6327 match_pattern*) 7772 match_pattern*)
6328 set dummy $deplibs_check_method; shift 7773 set dummy $deplibs_check_method; shift
6329 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\) "` 7774 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\) "`
6330 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ 7775 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6331 | $EGREP "$match_pattern_regex" > /dev/null; then 7776 | $EGREP "$match_pattern_regex" > /dev/null; then
6332 » » valid_a_lib=yes 7777 » » valid_a_lib=:
6333 fi 7778 fi
6334 ;; 7779 ;;
6335 pass_all) 7780 pass_all)
6336 » » valid_a_lib=yes 7781 » » valid_a_lib=:
6337 ;; 7782 ;;
6338 esac 7783 esac
6339 » if test "$valid_a_lib" != yes; then 7784 » if $valid_a_lib; then
7785 » » echo
7786 » » $ECHO "*** Warning: Linking the shared library $output against t he"
7787 » » $ECHO "*** static library $deplib is not portable!"
7788 » » deplibs="$deplib $deplibs"
7789 » else
6340 echo 7790 echo
6341 $ECHO "*** Warning: Trying to link with static lib archive $depl ib." 7791 $ECHO "*** Warning: Trying to link with static lib archive $depl ib."
6342 echo "*** I have the capability to make that library automatical ly link in when" 7792 echo "*** I have the capability to make that library automatical ly link in when"
6343 echo "*** you link to this library. But I can only do this if y ou have a" 7793 echo "*** you link to this library. But I can only do this if y ou have a"
6344 echo "*** shared version of the library, which you do not appear to have" 7794 echo "*** shared version of the library, which you do not appear to have"
6345 echo "*** because the file extensions .$libext of this argument makes me believe" 7795 echo "*** because the file extensions .$libext of this argument makes me believe"
6346 echo "*** that it is just a static archive that I should not use here." 7796 echo "*** that it is just a static archive that I should not use here."
6347 else
6348 echo
6349 $ECHO "*** Warning: Linking the shared library $output against t he"
6350 $ECHO "*** static library $deplib is not portable!"
6351 deplibs="$deplib $deplibs"
6352 fi 7797 fi
6353 ;; 7798 ;;
6354 esac 7799 esac
6355 continue 7800 continue
6356 ;; 7801 ;;
6357 prog) 7802 prog)
6358 » if test "$pass" != link; then 7803 » if test link != "$pass"; then
6359 deplibs="$deplib $deplibs" 7804 deplibs="$deplib $deplibs"
6360 else 7805 else
6361 compile_deplibs="$deplib $compile_deplibs" 7806 compile_deplibs="$deplib $compile_deplibs"
6362 finalize_deplibs="$deplib $finalize_deplibs" 7807 finalize_deplibs="$deplib $finalize_deplibs"
6363 fi 7808 fi
6364 continue 7809 continue
6365 ;; 7810 ;;
6366 esac # linkmode 7811 esac # linkmode
6367 ;; # *.$libext 7812 ;; # *.$libext
6368 *.lo | *.$objext) 7813 *.lo | *.$objext)
6369 » if test "$pass" = conv; then 7814 » if test conv = "$pass"; then
6370 deplibs="$deplib $deplibs" 7815 deplibs="$deplib $deplibs"
6371 » elif test "$linkmode" = prog; then 7816 » elif test prog = "$linkmode"; then
6372 » if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then 7817 » if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
6373 # If there is no dlopen support or we're linking statically, 7818 # If there is no dlopen support or we're linking statically,
6374 # we need to preload. 7819 # we need to preload.
6375 func_append newdlprefiles " $deplib" 7820 func_append newdlprefiles " $deplib"
6376 compile_deplibs="$deplib $compile_deplibs" 7821 compile_deplibs="$deplib $compile_deplibs"
6377 finalize_deplibs="$deplib $finalize_deplibs" 7822 finalize_deplibs="$deplib $finalize_deplibs"
6378 else 7823 else
6379 func_append newdlfiles " $deplib" 7824 func_append newdlfiles " $deplib"
6380 fi 7825 fi
6381 fi 7826 fi
6382 continue 7827 continue
6383 ;; 7828 ;;
6384 %DEPLIBS%) 7829 %DEPLIBS%)
6385 » alldeplibs=yes 7830 » alldeplibs=:
6386 continue 7831 continue
6387 ;; 7832 ;;
6388 esac # case $deplib 7833 esac # case $deplib
6389 7834
6390 » if test "$found" = yes || test -f "$lib"; then : 7835 » $found || test -f "$lib" \
6391 » else 7836 » || func_fatal_error "cannot find the library '$lib' or unhandled argum ent '$deplib'"
6392 » func_fatal_error "cannot find the library \`$lib' or unhandled argumen t \`$deplib'"
6393 » fi
6394 7837
6395 # Check to see that this really is a libtool archive. 7838 # Check to see that this really is a libtool archive.
6396 func_lalib_unsafe_p "$lib" \ 7839 func_lalib_unsafe_p "$lib" \
6397 » || func_fatal_error "\`$lib' is not a valid libtool archive" 7840 » || func_fatal_error "'$lib' is not a valid libtool archive"
6398 7841
6399 func_dirname "$lib" "" "." 7842 func_dirname "$lib" "" "."
6400 » ladir="$func_dirname_result" 7843 » ladir=$func_dirname_result
6401 7844
6402 dlname= 7845 dlname=
6403 dlopen= 7846 dlopen=
6404 dlpreopen= 7847 dlpreopen=
6405 libdir= 7848 libdir=
6406 library_names= 7849 library_names=
6407 old_library= 7850 old_library=
6408 inherited_linker_flags= 7851 inherited_linker_flags=
6409 # If the library was installed with an old release of libtool, 7852 # If the library was installed with an old release of libtool,
6410 # it will not redefine variables installed, or shouldnotlink 7853 # it will not redefine variables installed, or shouldnotlink
6411 installed=yes 7854 installed=yes
6412 shouldnotlink=no 7855 shouldnotlink=no
6413 avoidtemprpath= 7856 avoidtemprpath=
6414 7857
6415 7858
6416 # Read the .la file 7859 # Read the .la file
6417 func_source "$lib" 7860 func_source "$lib"
6418 7861
6419 # Convert "-framework foo" to "foo.ltframework" 7862 # Convert "-framework foo" to "foo.ltframework"
6420 if test -n "$inherited_linker_flags"; then 7863 if test -n "$inherited_linker_flags"; then
6421 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/ -framework \([^ $]*\)/\1.ltframework/g'` 7864 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/ -framework \([^ $]*\)/\1.ltframework/g'`
6422 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do 7865 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6423 case " $new_inherited_linker_flags " in 7866 case " $new_inherited_linker_flags " in
6424 *" $tmp_inherited_linker_flag "*) ;; 7867 *" $tmp_inherited_linker_flag "*) ;;
6425 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_ flag";; 7868 *) func_append new_inherited_linker_flags " $tmp_inherited_linker_ flag";;
6426 esac 7869 esac
6427 done 7870 done
6428 fi 7871 fi
6429 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframe work% -framework \1%g'` 7872 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframe work% -framework \1%g'`
6430 » if test "$linkmode,$pass" = "lib,link" || 7873 » if test lib,link = "$linkmode,$pass" ||
6431 » test "$linkmode,$pass" = "prog,scan" || 7874 » test prog,scan = "$linkmode,$pass" ||
6432 » { test "$linkmode" != prog && test "$linkmode" != lib; }; then 7875 » { test prog != "$linkmode" && test lib != "$linkmode"; }; then
6433 test -n "$dlopen" && func_append dlfiles " $dlopen" 7876 test -n "$dlopen" && func_append dlfiles " $dlopen"
6434 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" 7877 test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
6435 fi 7878 fi
6436 7879
6437 » if test "$pass" = conv; then 7880 » if test conv = "$pass"; then
6438 # Only check for convenience libraries 7881 # Only check for convenience libraries
6439 deplibs="$lib $deplibs" 7882 deplibs="$lib $deplibs"
6440 if test -z "$libdir"; then 7883 if test -z "$libdir"; then
6441 if test -z "$old_library"; then 7884 if test -z "$old_library"; then
6442 » func_fatal_error "cannot find name of link library for \`$lib'" 7885 » func_fatal_error "cannot find name of link library for '$lib'"
6443 fi 7886 fi
6444 # It is a libtool convenience library, so add in its objects. 7887 # It is a libtool convenience library, so add in its objects.
6445 func_append convenience " $ladir/$objdir/$old_library" 7888 func_append convenience " $ladir/$objdir/$old_library"
6446 func_append old_convenience " $ladir/$objdir/$old_library" 7889 func_append old_convenience " $ladir/$objdir/$old_library"
6447 » elif test "$linkmode" != prog && test "$linkmode" != lib; then 7890 » elif test prog != "$linkmode" && test lib != "$linkmode"; then
6448 » func_fatal_error "\`$lib' is not a convenience library" 7891 » func_fatal_error "'$lib' is not a convenience library"
6449 fi 7892 fi
6450 tmp_libs= 7893 tmp_libs=
6451 for deplib in $dependency_libs; do 7894 for deplib in $dependency_libs; do
6452 deplibs="$deplib $deplibs" 7895 deplibs="$deplib $deplibs"
6453 » if $opt_preserve_dup_deps ; then 7896 » if $opt_preserve_dup_deps; then
6454 case "$tmp_libs " in 7897 case "$tmp_libs " in
6455 *" $deplib "*) func_append specialdeplibs " $deplib" ;; 7898 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6456 esac 7899 esac
6457 fi 7900 fi
6458 func_append tmp_libs " $deplib" 7901 func_append tmp_libs " $deplib"
6459 done 7902 done
6460 continue 7903 continue
6461 fi # $pass = conv 7904 fi # $pass = conv
6462 7905
6463 7906
6464 # Get the name of the library we link against. 7907 # Get the name of the library we link against.
6465 linklib= 7908 linklib=
6466 if test -n "$old_library" && 7909 if test -n "$old_library" &&
6467 » { test "$prefer_static_libs" = yes || 7910 » { test yes = "$prefer_static_libs" ||
6468 » test "$prefer_static_libs,$installed" = "built,no"; }; then 7911 » test built,no = "$prefer_static_libs,$installed"; }; then
6469 linklib=$old_library 7912 linklib=$old_library
6470 else 7913 else
6471 for l in $old_library $library_names; do 7914 for l in $old_library $library_names; do
6472 » linklib="$l" 7915 » linklib=$l
6473 done 7916 done
6474 fi 7917 fi
6475 if test -z "$linklib"; then 7918 if test -z "$linklib"; then
6476 » func_fatal_error "cannot find name of link library for \`$lib'" 7919 » func_fatal_error "cannot find name of link library for '$lib'"
6477 fi 7920 fi
6478 7921
6479 # This library was specified with -dlopen. 7922 # This library was specified with -dlopen.
6480 » if test "$pass" = dlopen; then 7923 » if test dlopen = "$pass"; then
6481 » if test -z "$libdir"; then 7924 » test -z "$libdir" \
6482 » func_fatal_error "cannot -dlopen a convenience library: \`$lib'" 7925 » && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
6483 » fi
6484 if test -z "$dlname" || 7926 if test -z "$dlname" ||
6485 » test "$dlopen_support" != yes || 7927 » test yes != "$dlopen_support" ||
6486 » test "$build_libtool_libs" = no; then 7928 » test no = "$build_libtool_libs"
7929 » then
6487 # If there is no dlname, no dlopen support or we're linking 7930 # If there is no dlname, no dlopen support or we're linking
6488 # statically, we need to preload. We also need to preload any 7931 # statically, we need to preload. We also need to preload any
6489 # dependent libraries so libltdl's deplib preloader doesn't 7932 # dependent libraries so libltdl's deplib preloader doesn't
6490 # bomb out in the load deplibs phase. 7933 # bomb out in the load deplibs phase.
6491 func_append dlprefiles " $lib $dependency_libs" 7934 func_append dlprefiles " $lib $dependency_libs"
6492 else 7935 else
6493 func_append newdlfiles " $lib" 7936 func_append newdlfiles " $lib"
6494 fi 7937 fi
6495 continue 7938 continue
6496 fi # $pass = dlopen 7939 fi # $pass = dlopen
6497 7940
6498 # We need an absolute path. 7941 # We need an absolute path.
6499 case $ladir in 7942 case $ladir in
6500 » [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; 7943 » [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
6501 *) 7944 *)
6502 abs_ladir=`cd "$ladir" && pwd` 7945 abs_ladir=`cd "$ladir" && pwd`
6503 if test -z "$abs_ladir"; then 7946 if test -z "$abs_ladir"; then
6504 » func_warning "cannot determine absolute directory name of \`$ladir'" 7947 » func_warning "cannot determine absolute directory name of '$ladir'"
6505 func_warning "passing it literally to the linker, although it might fail" 7948 func_warning "passing it literally to the linker, although it might fail"
6506 » abs_ladir="$ladir" 7949 » abs_ladir=$ladir
6507 fi 7950 fi
6508 ;; 7951 ;;
6509 esac 7952 esac
6510 func_basename "$lib" 7953 func_basename "$lib"
6511 » laname="$func_basename_result" 7954 » laname=$func_basename_result
6512 7955
6513 # Find the relevant object directory and library name. 7956 # Find the relevant object directory and library name.
6514 » if test "X$installed" = Xyes; then 7957 » if test yes = "$installed"; then
6515 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$lin klib"; then 7958 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$lin klib"; then
6516 » #func_warning "library \`$lib' was moved." 7959 » func_warning "library '$lib' was moved."
6517 » dir="$ladir" 7960 » dir=$ladir
6518 » absdir="$abs_ladir" 7961 » absdir=$abs_ladir
6519 » libdir="$abs_ladir" 7962 » libdir=$abs_ladir
6520 else 7963 else
6521 » dir="$lt_sysroot$libdir" 7964 » dir=$lt_sysroot$libdir
6522 » absdir="$lt_sysroot$libdir" 7965 » absdir=$lt_sysroot$libdir
6523 fi 7966 fi
6524 » test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes 7967 » test yes = "$hardcode_automatic" && avoidtemprpath=yes
6525 else 7968 else
6526 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib "; then 7969 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib "; then
6527 » dir="$ladir" 7970 » dir=$ladir
6528 » absdir="$abs_ladir" 7971 » absdir=$abs_ladir
6529 # Remove this search path later 7972 # Remove this search path later
6530 func_append notinst_path " $abs_ladir" 7973 func_append notinst_path " $abs_ladir"
6531 else 7974 else
6532 » dir="$ladir/$objdir" 7975 » dir=$ladir/$objdir
6533 » absdir="$abs_ladir/$objdir" 7976 » absdir=$abs_ladir/$objdir
6534 # Remove this search path later 7977 # Remove this search path later
6535 func_append notinst_path " $abs_ladir" 7978 func_append notinst_path " $abs_ladir"
6536 fi 7979 fi
6537 fi # $installed = yes 7980 fi # $installed = yes
6538 func_stripname 'lib' '.la' "$laname" 7981 func_stripname 'lib' '.la' "$laname"
6539 name=$func_stripname_result 7982 name=$func_stripname_result
6540 7983
6541 # This library was specified with -dlpreopen. 7984 # This library was specified with -dlpreopen.
6542 » if test "$pass" = dlpreopen; then 7985 » if test dlpreopen = "$pass"; then
6543 » if test -z "$libdir" && test "$linkmode" = prog; then 7986 » if test -z "$libdir" && test prog = "$linkmode"; then
6544 » func_fatal_error "only libraries may -dlpreopen a convenience librar y: \`$lib'" 7987 » func_fatal_error "only libraries may -dlpreopen a convenience librar y: '$lib'"
6545 fi 7988 fi
6546 » case "$host" in 7989 » case $host in
6547 # special handling for platforms with PE-DLLs. 7990 # special handling for platforms with PE-DLLs.
6548 *cygwin* | *mingw* | *cegcc* ) 7991 *cygwin* | *mingw* | *cegcc* )
6549 # Linker will automatically link against shared library if both 7992 # Linker will automatically link against shared library if both
6550 # static and shared are present. Therefore, ensure we extract 7993 # static and shared are present. Therefore, ensure we extract
6551 # symbols from the import library if a shared library is present 7994 # symbols from the import library if a shared library is present
6552 # (otherwise, the dlopen module name will be incorrect). We do 7995 # (otherwise, the dlopen module name will be incorrect). We do
6553 # this by putting the import library name into $newdlprefiles. 7996 # this by putting the import library name into $newdlprefiles.
6554 # We recover the dlopen module name by 'saving' the la file 7997 # We recover the dlopen module name by 'saving' the la file
6555 # name in a special purpose variable, and (later) extracting the 7998 # name in a special purpose variable, and (later) extracting the
6556 # dlname from the la file. 7999 # dlname from the la file.
(...skipping 23 matching lines...) Expand all
6580 func_append newdlprefiles " $dir/$dlname" 8023 func_append newdlprefiles " $dir/$dlname"
6581 else 8024 else
6582 func_append newdlprefiles " $dir/$linklib" 8025 func_append newdlprefiles " $dir/$linklib"
6583 fi 8026 fi
6584 ;; 8027 ;;
6585 esac 8028 esac
6586 fi # $pass = dlpreopen 8029 fi # $pass = dlpreopen
6587 8030
6588 if test -z "$libdir"; then 8031 if test -z "$libdir"; then
6589 # Link the convenience library 8032 # Link the convenience library
6590 » if test "$linkmode" = lib; then 8033 » if test lib = "$linkmode"; then
6591 deplibs="$dir/$old_library $deplibs" 8034 deplibs="$dir/$old_library $deplibs"
6592 » elif test "$linkmode,$pass" = "prog,link"; then 8035 » elif test prog,link = "$linkmode,$pass"; then
6593 compile_deplibs="$dir/$old_library $compile_deplibs" 8036 compile_deplibs="$dir/$old_library $compile_deplibs"
6594 finalize_deplibs="$dir/$old_library $finalize_deplibs" 8037 finalize_deplibs="$dir/$old_library $finalize_deplibs"
6595 else 8038 else
6596 deplibs="$lib $deplibs" # used for prog,scan pass 8039 deplibs="$lib $deplibs" # used for prog,scan pass
6597 fi 8040 fi
6598 continue 8041 continue
6599 fi 8042 fi
6600 8043
6601 8044
6602 » if test "$linkmode" = prog && test "$pass" != link; then 8045 » if test prog = "$linkmode" && test link != "$pass"; then
6603 func_append newlib_search_path " $ladir" 8046 func_append newlib_search_path " $ladir"
6604 deplibs="$lib $deplibs" 8047 deplibs="$lib $deplibs"
6605 8048
6606 » linkalldeplibs=no 8049 » linkalldeplibs=false
6607 » if test "$link_all_deplibs" != no || test -z "$library_names" || 8050 » if test no != "$link_all_deplibs" || test -z "$library_names" ||
6608 » test "$build_libtool_libs" = no; then 8051 » test no = "$build_libtool_libs"; then
6609 » linkalldeplibs=yes 8052 » linkalldeplibs=:
6610 fi 8053 fi
6611 8054
6612 tmp_libs= 8055 tmp_libs=
6613 for deplib in $dependency_libs; do 8056 for deplib in $dependency_libs; do
6614 case $deplib in 8057 case $deplib in
6615 -L*) func_stripname '-L' '' "$deplib" 8058 -L*) func_stripname '-L' '' "$deplib"
6616 func_resolve_sysroot "$func_stripname_result" 8059 func_resolve_sysroot "$func_stripname_result"
6617 func_append newlib_search_path " $func_resolve_sysroot_result" 8060 func_append newlib_search_path " $func_resolve_sysroot_result"
6618 ;; 8061 ;;
6619 esac 8062 esac
6620 # Need to link against all dependency_libs? 8063 # Need to link against all dependency_libs?
6621 » if test "$linkalldeplibs" = yes; then 8064 » if $linkalldeplibs; then
6622 deplibs="$deplib $deplibs" 8065 deplibs="$deplib $deplibs"
6623 else 8066 else
6624 # Need to hardcode shared library paths 8067 # Need to hardcode shared library paths
6625 # or/and link against static libraries 8068 # or/and link against static libraries
6626 newdependency_libs="$deplib $newdependency_libs" 8069 newdependency_libs="$deplib $newdependency_libs"
6627 fi 8070 fi
6628 » if $opt_preserve_dup_deps ; then 8071 » if $opt_preserve_dup_deps; then
6629 case "$tmp_libs " in 8072 case "$tmp_libs " in
6630 *" $deplib "*) func_append specialdeplibs " $deplib" ;; 8073 *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6631 esac 8074 esac
6632 fi 8075 fi
6633 func_append tmp_libs " $deplib" 8076 func_append tmp_libs " $deplib"
6634 done # for deplib 8077 done # for deplib
6635 continue 8078 continue
6636 fi # $linkmode = prog... 8079 fi # $linkmode = prog...
6637 8080
6638 » if test "$linkmode,$pass" = "prog,link"; then 8081 » if test prog,link = "$linkmode,$pass"; then
6639 if test -n "$library_names" && 8082 if test -n "$library_names" &&
6640 » { { test "$prefer_static_libs" = no || 8083 » { { test no = "$prefer_static_libs" ||
6641 » test "$prefer_static_libs,$installed" = "built,yes"; } || 8084 » test built,yes = "$prefer_static_libs,$installed"; } ||
6642 test -z "$old_library"; }; then 8085 test -z "$old_library"; }; then
6643 # We need to hardcode the library path 8086 # We need to hardcode the library path
6644 » if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then 8087 » if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
6645 # Make sure the rpath contains only unique directories. 8088 # Make sure the rpath contains only unique directories.
6646 » case "$temp_rpath:" in 8089 » case $temp_rpath: in
6647 *"$absdir:"*) ;; 8090 *"$absdir:"*) ;;
6648 *) func_append temp_rpath "$absdir:" ;; 8091 *) func_append temp_rpath "$absdir:" ;;
6649 esac 8092 esac
6650 fi 8093 fi
6651 8094
6652 # Hardcode the library path. 8095 # Hardcode the library path.
6653 # Skip directories that are in the system default run-time 8096 # Skip directories that are in the system default run-time
6654 # search path. 8097 # search path.
6655 case " $sys_lib_dlsearch_path " in 8098 case " $sys_lib_dlsearch_path " in
6656 *" $absdir "*) ;; 8099 *" $absdir "*) ;;
6657 *) 8100 *)
6658 case "$compile_rpath " in 8101 case "$compile_rpath " in
6659 *" $absdir "*) ;; 8102 *" $absdir "*) ;;
6660 *) func_append compile_rpath " $absdir" ;; 8103 *) func_append compile_rpath " $absdir" ;;
6661 esac 8104 esac
6662 ;; 8105 ;;
6663 esac 8106 esac
6664 case " $sys_lib_dlsearch_path " in 8107 case " $sys_lib_dlsearch_path " in
6665 *" $libdir "*) ;; 8108 *" $libdir "*) ;;
6666 *) 8109 *)
6667 case "$finalize_rpath " in 8110 case "$finalize_rpath " in
6668 *" $libdir "*) ;; 8111 *" $libdir "*) ;;
6669 *) func_append finalize_rpath " $libdir" ;; 8112 *) func_append finalize_rpath " $libdir" ;;
6670 esac 8113 esac
6671 ;; 8114 ;;
6672 esac 8115 esac
6673 fi # $linkmode,$pass = prog,link... 8116 fi # $linkmode,$pass = prog,link...
6674 8117
6675 » if test "$alldeplibs" = yes && 8118 » if $alldeplibs &&
6676 » { test "$deplibs_check_method" = pass_all || 8119 » { test pass_all = "$deplibs_check_method" ||
6677 » { test "$build_libtool_libs" = yes && 8120 » { test yes = "$build_libtool_libs" &&
6678 test -n "$library_names"; }; }; then 8121 test -n "$library_names"; }; }; then
6679 # We only need to search for static libraries 8122 # We only need to search for static libraries
6680 continue 8123 continue
6681 fi 8124 fi
6682 fi 8125 fi
6683 8126
6684 link_static=no # Whether the deplib will be linked statically 8127 link_static=no # Whether the deplib will be linked statically
6685 use_static_libs=$prefer_static_libs 8128 use_static_libs=$prefer_static_libs
6686 » if test "$use_static_libs" = built && test "$installed" = yes; then 8129 » if test built = "$use_static_libs" && test yes = "$installed"; then
6687 use_static_libs=no 8130 use_static_libs=no
6688 fi 8131 fi
6689 if test -n "$library_names" && 8132 if test -n "$library_names" &&
6690 » { test "$use_static_libs" = no || test -z "$old_library"; }; then 8133 » { test no = "$use_static_libs" || test -z "$old_library"; }; then
6691 case $host in 8134 case $host in
6692 » *cygwin* | *mingw* | *cegcc*) 8135 » *cygwin* | *mingw* | *cegcc* | *os2*)
6693 # No point in relinking DLLs because paths are not encoded 8136 # No point in relinking DLLs because paths are not encoded
6694 func_append notinst_deplibs " $lib" 8137 func_append notinst_deplibs " $lib"
6695 need_relink=no 8138 need_relink=no
6696 ;; 8139 ;;
6697 *) 8140 *)
6698 » if test "$installed" = no; then 8141 » if test no = "$installed"; then
6699 func_append notinst_deplibs " $lib" 8142 func_append notinst_deplibs " $lib"
6700 need_relink=yes 8143 need_relink=yes
6701 fi 8144 fi
6702 ;; 8145 ;;
6703 esac 8146 esac
6704 # This is a shared library 8147 # This is a shared library
6705 8148
6706 # Warn about portability, can't link against -module's on some 8149 # Warn about portability, can't link against -module's on some
6707 # systems (darwin). Don't bleat about dlopened modules though! 8150 # systems (darwin). Don't bleat about dlopened modules though!
6708 » dlopenmodule="" 8151 » dlopenmodule=
6709 for dlpremoduletest in $dlprefiles; do 8152 for dlpremoduletest in $dlprefiles; do
6710 if test "X$dlpremoduletest" = "X$lib"; then 8153 if test "X$dlpremoduletest" = "X$lib"; then
6711 » dlopenmodule="$dlpremoduletest" 8154 » dlopenmodule=$dlpremoduletest
6712 break 8155 break
6713 fi 8156 fi
6714 done 8157 done
6715 » if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pa ss" = link; then 8158 » if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
6716 echo 8159 echo
6717 » if test "$linkmode" = prog; then 8160 » if test prog = "$linkmode"; then
6718 $ECHO "*** Warning: Linking the executable $output against the loa dable module" 8161 $ECHO "*** Warning: Linking the executable $output against the loa dable module"
6719 else 8162 else
6720 $ECHO "*** Warning: Linking the shared library $output against the loadable module" 8163 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
6721 fi 8164 fi
6722 $ECHO "*** $linklib is not portable!" 8165 $ECHO "*** $linklib is not portable!"
6723 fi 8166 fi
6724 » if test "$linkmode" = lib && 8167 » if test lib = "$linkmode" &&
6725 » test "$hardcode_into_libs" = yes; then 8168 » test yes = "$hardcode_into_libs"; then
6726 # Hardcode the library path. 8169 # Hardcode the library path.
6727 # Skip directories that are in the system default run-time 8170 # Skip directories that are in the system default run-time
6728 # search path. 8171 # search path.
6729 case " $sys_lib_dlsearch_path " in 8172 case " $sys_lib_dlsearch_path " in
6730 *" $absdir "*) ;; 8173 *" $absdir "*) ;;
6731 *) 8174 *)
6732 case "$compile_rpath " in 8175 case "$compile_rpath " in
6733 *" $absdir "*) ;; 8176 *" $absdir "*) ;;
6734 *) func_append compile_rpath " $absdir" ;; 8177 *) func_append compile_rpath " $absdir" ;;
6735 esac 8178 esac
6736 ;; 8179 ;;
6737 esac 8180 esac
6738 case " $sys_lib_dlsearch_path " in 8181 case " $sys_lib_dlsearch_path " in
6739 *" $libdir "*) ;; 8182 *" $libdir "*) ;;
6740 *) 8183 *)
6741 case "$finalize_rpath " in 8184 case "$finalize_rpath " in
6742 *" $libdir "*) ;; 8185 *" $libdir "*) ;;
6743 *) func_append finalize_rpath " $libdir" ;; 8186 *) func_append finalize_rpath " $libdir" ;;
6744 esac 8187 esac
6745 ;; 8188 ;;
6746 esac 8189 esac
6747 fi 8190 fi
6748 8191
6749 if test -n "$old_archive_from_expsyms_cmds"; then 8192 if test -n "$old_archive_from_expsyms_cmds"; then
6750 # figure out the soname 8193 # figure out the soname
6751 set dummy $library_names 8194 set dummy $library_names
6752 shift 8195 shift
6753 » realname="$1" 8196 » realname=$1
6754 shift 8197 shift
6755 libname=`eval "\\$ECHO \"$libname_spec\""` 8198 libname=`eval "\\$ECHO \"$libname_spec\""`
6756 # use dlname if we got it. it's perfectly good, no? 8199 # use dlname if we got it. it's perfectly good, no?
6757 if test -n "$dlname"; then 8200 if test -n "$dlname"; then
6758 » soname="$dlname" 8201 » soname=$dlname
6759 elif test -n "$soname_spec"; then 8202 elif test -n "$soname_spec"; then
6760 # bleh windows 8203 # bleh windows
6761 case $host in 8204 case $host in
6762 » *cygwin* | mingw* | *cegcc*) 8205 » *cygwin* | mingw* | *cegcc* | *os2*)
6763 func_arith $current - $age 8206 func_arith $current - $age
6764 major=$func_arith_result 8207 major=$func_arith_result
6765 » » versuffix="-$major" 8208 » » versuffix=-$major
6766 ;; 8209 ;;
6767 esac 8210 esac
6768 eval soname=\"$soname_spec\" 8211 eval soname=\"$soname_spec\"
6769 else 8212 else
6770 » soname="$realname" 8213 » soname=$realname
6771 fi 8214 fi
6772 8215
6773 # Make a new name for the extract_expsyms_cmds to use 8216 # Make a new name for the extract_expsyms_cmds to use
6774 » soroot="$soname" 8217 » soroot=$soname
6775 func_basename "$soroot" 8218 func_basename "$soroot"
6776 » soname="$func_basename_result" 8219 » soname=$func_basename_result
6777 func_stripname 'lib' '.dll' "$soname" 8220 func_stripname 'lib' '.dll' "$soname"
6778 newlib=libimp-$func_stripname_result.a 8221 newlib=libimp-$func_stripname_result.a
6779 8222
6780 # If the library has no export list, then create one now 8223 # If the library has no export list, then create one now
6781 if test -f "$output_objdir/$soname-def"; then : 8224 if test -f "$output_objdir/$soname-def"; then :
6782 else 8225 else
6783 » func_verbose "extracting exported symbol list from \`$soname'" 8226 » func_verbose "extracting exported symbol list from '$soname'"
6784 func_execute_cmds "$extract_expsyms_cmds" 'exit $?' 8227 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
6785 fi 8228 fi
6786 8229
6787 # Create $newlib 8230 # Create $newlib
6788 if test -f "$output_objdir/$newlib"; then :; else 8231 if test -f "$output_objdir/$newlib"; then :; else
6789 » func_verbose "generating import library for \`$soname'" 8232 » func_verbose "generating import library for '$soname'"
6790 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' 8233 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
6791 fi 8234 fi
6792 # make sure the library variables are pointing to the new library 8235 # make sure the library variables are pointing to the new library
6793 dir=$output_objdir 8236 dir=$output_objdir
6794 linklib=$newlib 8237 linklib=$newlib
6795 fi # test -n "$old_archive_from_expsyms_cmds" 8238 fi # test -n "$old_archive_from_expsyms_cmds"
6796 8239
6797 » if test "$linkmode" = prog || test "$opt_mode" != relink; then 8240 » if test prog = "$linkmode" || test relink != "$opt_mode"; then
6798 add_shlibpath= 8241 add_shlibpath=
6799 add_dir= 8242 add_dir=
6800 add= 8243 add=
6801 lib_linked=yes 8244 lib_linked=yes
6802 case $hardcode_action in 8245 case $hardcode_action in
6803 immediate | unsupported) 8246 immediate | unsupported)
6804 » if test "$hardcode_direct" = no; then 8247 » if test no = "$hardcode_direct"; then
6805 » » add="$dir/$linklib" 8248 » » add=$dir/$linklib
6806 case $host in 8249 case $host in
6807 » » *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; 8250 » » *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
6808 » » *-*-sysv4*uw2*) add_dir="-L$dir" ;; 8251 » » *-*-sysv4*uw2*) add_dir=-L$dir ;;
6809 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ 8252 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
6810 » » *-*-unixware7*) add_dir="-L$dir" ;; 8253 » » *-*-unixware7*) add_dir=-L$dir ;;
6811 *-*-darwin* ) 8254 *-*-darwin* )
6812 » » # if the lib is a (non-dlopened) module then we can not 8255 » » # if the lib is a (non-dlopened) module then we cannot
6813 # link against it, someone is ignoring the earlier warnings 8256 # link against it, someone is ignoring the earlier warnings
6814 if /usr/bin/file -L $add 2> /dev/null | 8257 if /usr/bin/file -L $add 2> /dev/null |
6815 » » » $GREP ": [^:]* bundle" >/dev/null ; then 8258 » » » $GREP ": [^:]* bundle" >/dev/null; then
6816 if test "X$dlopenmodule" != "X$lib"; then 8259 if test "X$dlopenmodule" != "X$lib"; then
6817 $ECHO "*** Warning: lib $linklib is a module, not a shar ed library" 8260 $ECHO "*** Warning: lib $linklib is a module, not a shar ed library"
6818 » » » if test -z "$old_library" ; then 8261 » » » if test -z "$old_library"; then
6819 echo 8262 echo
6820 echo "*** And there doesn't seem to be a static archiv e available" 8263 echo "*** And there doesn't seem to be a static archiv e available"
6821 echo "*** The link will probably fail, sorry" 8264 echo "*** The link will probably fail, sorry"
6822 else 8265 else
6823 » » » add="$dir/$old_library" 8266 » » » add=$dir/$old_library
6824 fi 8267 fi
6825 elif test -n "$old_library"; then 8268 elif test -n "$old_library"; then
6826 » » » add="$dir/$old_library" 8269 » » » add=$dir/$old_library
6827 fi 8270 fi
6828 fi 8271 fi
6829 esac 8272 esac
6830 » elif test "$hardcode_minus_L" = no; then 8273 » elif test no = "$hardcode_minus_L"; then
6831 case $host in 8274 case $host in
6832 » » *-*-sunos*) add_shlibpath="$dir" ;; 8275 » » *-*-sunos*) add_shlibpath=$dir ;;
6833 esac 8276 esac
6834 » » add_dir="-L$dir" 8277 » » add_dir=-L$dir
6835 » » add="-l$name" 8278 » » add=-l$name
6836 » elif test "$hardcode_shlibpath_var" = no; then 8279 » elif test no = "$hardcode_shlibpath_var"; then
6837 » » add_shlibpath="$dir" 8280 » » add_shlibpath=$dir
6838 » » add="-l$name" 8281 » » add=-l$name
6839 else 8282 else
6840 lib_linked=no 8283 lib_linked=no
6841 fi 8284 fi
6842 ;; 8285 ;;
6843 relink) 8286 relink)
6844 » if test "$hardcode_direct" = yes && 8287 » if test yes = "$hardcode_direct" &&
6845 » test "$hardcode_direct_absolute" = no; then 8288 » test no = "$hardcode_direct_absolute"; then
6846 » » add="$dir/$linklib" 8289 » » add=$dir/$linklib
6847 » elif test "$hardcode_minus_L" = yes; then 8290 » elif test yes = "$hardcode_minus_L"; then
6848 » » add_dir="-L$absdir" 8291 » » add_dir=-L$absdir
6849 # Try looking first in the location we're being installed to. 8292 # Try looking first in the location we're being installed to.
6850 if test -n "$inst_prefix_dir"; then 8293 if test -n "$inst_prefix_dir"; then
6851 case $libdir in 8294 case $libdir in
6852 [\\/]*) 8295 [\\/]*)
6853 func_append add_dir " -L$inst_prefix_dir$libdir" 8296 func_append add_dir " -L$inst_prefix_dir$libdir"
6854 ;; 8297 ;;
6855 esac 8298 esac
6856 fi 8299 fi
6857 » » add="-l$name" 8300 » » add=-l$name
6858 » elif test "$hardcode_shlibpath_var" = yes; then 8301 » elif test yes = "$hardcode_shlibpath_var"; then
6859 » » add_shlibpath="$dir" 8302 » » add_shlibpath=$dir
6860 » » add="-l$name" 8303 » » add=-l$name
6861 else 8304 else
6862 lib_linked=no 8305 lib_linked=no
6863 fi 8306 fi
6864 ;; 8307 ;;
6865 *) lib_linked=no ;; 8308 *) lib_linked=no ;;
6866 esac 8309 esac
6867 8310
6868 » if test "$lib_linked" != yes; then 8311 » if test yes != "$lib_linked"; then
6869 func_fatal_configuration "unsupported hardcode properties" 8312 func_fatal_configuration "unsupported hardcode properties"
6870 fi 8313 fi
6871 8314
6872 if test -n "$add_shlibpath"; then 8315 if test -n "$add_shlibpath"; then
6873 case :$compile_shlibpath: in 8316 case :$compile_shlibpath: in
6874 *":$add_shlibpath:"*) ;; 8317 *":$add_shlibpath:"*) ;;
6875 *) func_append compile_shlibpath "$add_shlibpath:" ;; 8318 *) func_append compile_shlibpath "$add_shlibpath:" ;;
6876 esac 8319 esac
6877 fi 8320 fi
6878 » if test "$linkmode" = prog; then 8321 » if test prog = "$linkmode"; then
6879 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" 8322 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
6880 test -n "$add" && compile_deplibs="$add $compile_deplibs" 8323 test -n "$add" && compile_deplibs="$add $compile_deplibs"
6881 else 8324 else
6882 test -n "$add_dir" && deplibs="$add_dir $deplibs" 8325 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6883 test -n "$add" && deplibs="$add $deplibs" 8326 test -n "$add" && deplibs="$add $deplibs"
6884 » if test "$hardcode_direct" != yes && 8327 » if test yes != "$hardcode_direct" &&
6885 » » test "$hardcode_minus_L" != yes && 8328 » » test yes != "$hardcode_minus_L" &&
6886 » » test "$hardcode_shlibpath_var" = yes; then 8329 » » test yes = "$hardcode_shlibpath_var"; then
6887 case :$finalize_shlibpath: in 8330 case :$finalize_shlibpath: in
6888 *":$libdir:"*) ;; 8331 *":$libdir:"*) ;;
6889 *) func_append finalize_shlibpath "$libdir:" ;; 8332 *) func_append finalize_shlibpath "$libdir:" ;;
6890 esac 8333 esac
6891 fi 8334 fi
6892 fi 8335 fi
6893 fi 8336 fi
6894 8337
6895 » if test "$linkmode" = prog || test "$opt_mode" = relink; then 8338 » if test prog = "$linkmode" || test relink = "$opt_mode"; then
6896 add_shlibpath= 8339 add_shlibpath=
6897 add_dir= 8340 add_dir=
6898 add= 8341 add=
6899 # Finalize command for both is simple: just hardcode it. 8342 # Finalize command for both is simple: just hardcode it.
6900 » if test "$hardcode_direct" = yes && 8343 » if test yes = "$hardcode_direct" &&
6901 » test "$hardcode_direct_absolute" = no; then 8344 » test no = "$hardcode_direct_absolute"; then
6902 » add="$libdir/$linklib" 8345 » add=$libdir/$linklib
6903 » elif test "$hardcode_minus_L" = yes; then 8346 » elif test yes = "$hardcode_minus_L"; then
6904 » add_dir="-L$libdir" 8347 » add_dir=-L$libdir
6905 » add="-l$name" 8348 » add=-l$name
6906 » elif test "$hardcode_shlibpath_var" = yes; then 8349 » elif test yes = "$hardcode_shlibpath_var"; then
6907 case :$finalize_shlibpath: in 8350 case :$finalize_shlibpath: in
6908 *":$libdir:"*) ;; 8351 *":$libdir:"*) ;;
6909 *) func_append finalize_shlibpath "$libdir:" ;; 8352 *) func_append finalize_shlibpath "$libdir:" ;;
6910 esac 8353 esac
6911 » add="-l$name" 8354 » add=-l$name
6912 » elif test "$hardcode_automatic" = yes; then 8355 » elif test yes = "$hardcode_automatic"; then
6913 if test -n "$inst_prefix_dir" && 8356 if test -n "$inst_prefix_dir" &&
6914 » » test -f "$inst_prefix_dir$libdir/$linklib" ; then 8357 » » test -f "$inst_prefix_dir$libdir/$linklib"; then
6915 » » add="$inst_prefix_dir$libdir/$linklib" 8358 » » add=$inst_prefix_dir$libdir/$linklib
6916 else 8359 else
6917 » » add="$libdir/$linklib" 8360 » » add=$libdir/$linklib
6918 fi 8361 fi
6919 else 8362 else
6920 # We cannot seem to hardcode it, guess we'll fake it. 8363 # We cannot seem to hardcode it, guess we'll fake it.
6921 » add_dir="-L$libdir" 8364 » add_dir=-L$libdir
6922 # Try looking first in the location we're being installed to. 8365 # Try looking first in the location we're being installed to.
6923 if test -n "$inst_prefix_dir"; then 8366 if test -n "$inst_prefix_dir"; then
6924 case $libdir in 8367 case $libdir in
6925 [\\/]*) 8368 [\\/]*)
6926 func_append add_dir " -L$inst_prefix_dir$libdir" 8369 func_append add_dir " -L$inst_prefix_dir$libdir"
6927 ;; 8370 ;;
6928 esac 8371 esac
6929 fi 8372 fi
6930 » add="-l$name" 8373 » add=-l$name
6931 fi 8374 fi
6932 8375
6933 » if test "$linkmode" = prog; then 8376 » if test prog = "$linkmode"; then
6934 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs " 8377 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs "
6935 test -n "$add" && finalize_deplibs="$add $finalize_deplibs" 8378 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
6936 else 8379 else
6937 test -n "$add_dir" && deplibs="$add_dir $deplibs" 8380 test -n "$add_dir" && deplibs="$add_dir $deplibs"
6938 test -n "$add" && deplibs="$add $deplibs" 8381 test -n "$add" && deplibs="$add $deplibs"
6939 fi 8382 fi
6940 fi 8383 fi
6941 » elif test "$linkmode" = prog; then 8384 » elif test prog = "$linkmode"; then
6942 # Here we assume that one of hardcode_direct or hardcode_minus_L 8385 # Here we assume that one of hardcode_direct or hardcode_minus_L
6943 # is not unsupported. This is valid on all known static and 8386 # is not unsupported. This is valid on all known static and
6944 # shared platforms. 8387 # shared platforms.
6945 » if test "$hardcode_direct" != unsupported; then 8388 » if test unsupported != "$hardcode_direct"; then
6946 » test -n "$old_library" && linklib="$old_library" 8389 » test -n "$old_library" && linklib=$old_library
6947 compile_deplibs="$dir/$linklib $compile_deplibs" 8390 compile_deplibs="$dir/$linklib $compile_deplibs"
6948 finalize_deplibs="$dir/$linklib $finalize_deplibs" 8391 finalize_deplibs="$dir/$linklib $finalize_deplibs"
6949 else 8392 else
6950 compile_deplibs="-l$name -L$dir $compile_deplibs" 8393 compile_deplibs="-l$name -L$dir $compile_deplibs"
6951 finalize_deplibs="-l$name -L$dir $finalize_deplibs" 8394 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
6952 fi 8395 fi
6953 » elif test "$build_libtool_libs" = yes; then 8396 » elif test yes = "$build_libtool_libs"; then
6954 # Not a shared library 8397 # Not a shared library
6955 » if test "$deplibs_check_method" != pass_all; then 8398 » if test pass_all != "$deplibs_check_method"; then
6956 # We're trying link a shared library against a static one 8399 # We're trying link a shared library against a static one
6957 # but the system doesn't support it. 8400 # but the system doesn't support it.
6958 8401
6959 # Just print a warning and add the library to dependency_libs so 8402 # Just print a warning and add the library to dependency_libs so
6960 # that the program can be linked against the static library. 8403 # that the program can be linked against the static library.
6961 echo 8404 echo
6962 » $ECHO "*** Warning: This system can not link to static lib archive $ lib." 8405 » $ECHO "*** Warning: This system cannot link to static lib archive $l ib."
6963 echo "*** I have the capability to make that library automatically l ink in when" 8406 echo "*** I have the capability to make that library automatically l ink in when"
6964 echo "*** you link to this library. But I can only do this if you h ave a" 8407 echo "*** you link to this library. But I can only do this if you h ave a"
6965 echo "*** shared version of the library, which you do not appear to have." 8408 echo "*** shared version of the library, which you do not appear to have."
6966 » if test "$module" = yes; then 8409 » if test yes = "$module"; then
6967 echo "*** But as you try to build a module library, libtool will s till create " 8410 echo "*** But as you try to build a module library, libtool will s till create "
6968 echo "*** a static module, that should work as long as the dlopeni ng application" 8411 echo "*** a static module, that should work as long as the dlopeni ng application"
6969 echo "*** is linked with the -dlopen flag to resolve symbols at ru ntime." 8412 echo "*** is linked with the -dlopen flag to resolve symbols at ru ntime."
6970 if test -z "$global_symbol_pipe"; then 8413 if test -z "$global_symbol_pipe"; then
6971 echo 8414 echo
6972 echo "*** However, this would only work if libtool was able to e xtract symbol" 8415 echo "*** However, this would only work if libtool was able to e xtract symbol"
6973 » » echo "*** lists from a program, using \`nm' or equivalent, but l ibtool could" 8416 » » echo "*** lists from a program, using 'nm' or equivalent, but li btool could"
6974 echo "*** not find such a program. So, this module is probably useless." 8417 echo "*** not find such a program. So, this module is probably useless."
6975 » » echo "*** \`nm' from GNU binutils and a full rebuild may help." 8418 » » echo "*** 'nm' from GNU binutils and a full rebuild may help."
6976 fi 8419 fi
6977 » if test "$build_old_libs" = no; then 8420 » if test no = "$build_old_libs"; then
6978 build_libtool_libs=module 8421 build_libtool_libs=module
6979 build_old_libs=yes 8422 build_old_libs=yes
6980 else 8423 else
6981 build_libtool_libs=no 8424 build_libtool_libs=no
6982 fi 8425 fi
6983 fi 8426 fi
6984 else 8427 else
6985 deplibs="$dir/$old_library $deplibs" 8428 deplibs="$dir/$old_library $deplibs"
6986 link_static=yes 8429 link_static=yes
6987 fi 8430 fi
6988 fi # link shared/static library? 8431 fi # link shared/static library?
6989 8432
6990 » if test "$linkmode" = lib; then 8433 » if test lib = "$linkmode"; then
6991 if test -n "$dependency_libs" && 8434 if test -n "$dependency_libs" &&
6992 » { test "$hardcode_into_libs" != yes || 8435 » { test yes != "$hardcode_into_libs" ||
6993 » test "$build_old_libs" = yes || 8436 » test yes = "$build_old_libs" ||
6994 » test "$link_static" = yes; }; then 8437 » test yes = "$link_static"; }; then
6995 # Extract -R from dependency_libs 8438 # Extract -R from dependency_libs
6996 temp_deplibs= 8439 temp_deplibs=
6997 for libdir in $dependency_libs; do 8440 for libdir in $dependency_libs; do
6998 case $libdir in 8441 case $libdir in
6999 -R*) func_stripname '-R' '' "$libdir" 8442 -R*) func_stripname '-R' '' "$libdir"
7000 temp_xrpath=$func_stripname_result 8443 temp_xrpath=$func_stripname_result
7001 case " $xrpath " in 8444 case " $xrpath " in
7002 *" $temp_xrpath "*) ;; 8445 *" $temp_xrpath "*) ;;
7003 *) func_append xrpath " $temp_xrpath";; 8446 *) func_append xrpath " $temp_xrpath";;
7004 esac;; 8447 esac;;
7005 *) func_append temp_deplibs " $libdir";; 8448 *) func_append temp_deplibs " $libdir";;
7006 esac 8449 esac
7007 done 8450 done
7008 » dependency_libs="$temp_deplibs" 8451 » dependency_libs=$temp_deplibs
7009 fi 8452 fi
7010 8453
7011 func_append newlib_search_path " $absdir" 8454 func_append newlib_search_path " $absdir"
7012 # Link against this library 8455 # Link against this library
7013 » test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $ne wdependency_libs" 8456 » test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $ne wdependency_libs"
7014 # ... and its dependency_libs 8457 # ... and its dependency_libs
7015 tmp_libs= 8458 tmp_libs=
7016 for deplib in $dependency_libs; do 8459 for deplib in $dependency_libs; do
7017 newdependency_libs="$deplib $newdependency_libs" 8460 newdependency_libs="$deplib $newdependency_libs"
7018 case $deplib in 8461 case $deplib in
7019 -L*) func_stripname '-L' '' "$deplib" 8462 -L*) func_stripname '-L' '' "$deplib"
7020 func_resolve_sysroot "$func_stripname_result";; 8463 func_resolve_sysroot "$func_stripname_result";;
7021 *) func_resolve_sysroot "$deplib" ;; 8464 *) func_resolve_sysroot "$deplib" ;;
7022 esac 8465 esac
7023 » if $opt_preserve_dup_deps ; then 8466 » if $opt_preserve_dup_deps; then
7024 case "$tmp_libs " in 8467 case "$tmp_libs " in
7025 *" $func_resolve_sysroot_result "*) 8468 *" $func_resolve_sysroot_result "*)
7026 func_append specialdeplibs " $func_resolve_sysroot_result" ;; 8469 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
7027 esac 8470 esac
7028 fi 8471 fi
7029 func_append tmp_libs " $func_resolve_sysroot_result" 8472 func_append tmp_libs " $func_resolve_sysroot_result"
7030 done 8473 done
7031 8474
7032 » if test "$link_all_deplibs" != no; then 8475 » if test no != "$link_all_deplibs"; then
7033 # Add the search paths of all dependency libraries 8476 # Add the search paths of all dependency libraries
7034 for deplib in $dependency_libs; do 8477 for deplib in $dependency_libs; do
7035 path= 8478 path=
7036 case $deplib in 8479 case $deplib in
7037 » -L*) path="$deplib" ;; 8480 » -L*) path=$deplib ;;
7038 *.la) 8481 *.la)
7039 func_resolve_sysroot "$deplib" 8482 func_resolve_sysroot "$deplib"
7040 deplib=$func_resolve_sysroot_result 8483 deplib=$func_resolve_sysroot_result
7041 func_dirname "$deplib" "" "." 8484 func_dirname "$deplib" "" "."
7042 dir=$func_dirname_result 8485 dir=$func_dirname_result
7043 # We need an absolute path. 8486 # We need an absolute path.
7044 case $dir in 8487 case $dir in
7045 » » [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; 8488 » » [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
7046 *) 8489 *)
7047 absdir=`cd "$dir" && pwd` 8490 absdir=`cd "$dir" && pwd`
7048 if test -z "$absdir"; then 8491 if test -z "$absdir"; then
7049 » » func_warning "cannot determine absolute directory name of \` $dir'" 8492 » » func_warning "cannot determine absolute directory name of '$ dir'"
7050 » » absdir="$dir" 8493 » » absdir=$dir
7051 fi 8494 fi
7052 ;; 8495 ;;
7053 esac 8496 esac
7054 if $GREP "^installed=no" $deplib > /dev/null; then 8497 if $GREP "^installed=no" $deplib > /dev/null; then
7055 case $host in 8498 case $host in
7056 *-*-darwin*) 8499 *-*-darwin*)
7057 depdepl= 8500 depdepl=
7058 » » eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/ \1/p' $deplib` 8501 » » eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1 /p' $deplib`
7059 » » if test -n "$deplibrary_names" ; then 8502 » » if test -n "$deplibrary_names"; then
7060 » » for tmp in $deplibrary_names ; do 8503 » » for tmp in $deplibrary_names; do
7061 depdepl=$tmp 8504 depdepl=$tmp
7062 done 8505 done
7063 » » if test -f "$absdir/$objdir/$depdepl" ; then 8506 » » if test -f "$absdir/$objdir/$depdepl"; then
7064 » » depdepl="$absdir/$objdir/$depdepl" 8507 » » depdepl=$absdir/$objdir/$depdepl
7065 » » darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR = = 2) {print $1;exit}}'` 8508 » » darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7066 if test -z "$darwin_install_name"; then 8509 if test -z "$darwin_install_name"; then
7067 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{i f (NR == 2) {print $1;exit}}'` 8510 darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7068 fi 8511 fi
7069 » » func_append compiler_flags " ${wl}-dylib_file ${wl}${darwi n_install_name}:${depdepl}" 8512 » » func_append compiler_flags " $wl-dylib_file $wl$darwin_ins tall_name:$depdepl"
7070 » » func_append linker_flags " -dylib_file ${darwin_install_na me}:${depdepl}" 8513 » » func_append linker_flags " -dylib_file $darwin_install_nam e:$depdepl"
7071 path= 8514 path=
7072 fi 8515 fi
7073 fi 8516 fi
7074 ;; 8517 ;;
7075 *) 8518 *)
7076 » » path="-L$absdir/$objdir" 8519 » » path=-L$absdir/$objdir
7077 ;; 8520 ;;
7078 esac 8521 esac
7079 else 8522 else
7080 » » eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` 8523 » » eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7081 test -z "$libdir" && \ 8524 test -z "$libdir" && \
7082 » » func_fatal_error "\`$deplib' is not a valid libtool archive" 8525 » » func_fatal_error "'$deplib' is not a valid libtool archive"
7083 » » #test "$absdir" != "$libdir" && \ 8526 » » test "$absdir" != "$libdir" && \
7084 » » # func_warning "\`$deplib' seems to be moved" 8527 » » func_warning "'$deplib' seems to be moved"
7085 8528
7086 » » path="-L$absdir" 8529 » » path=-L$absdir
7087 fi 8530 fi
7088 ;; 8531 ;;
7089 esac 8532 esac
7090 case " $deplibs " in 8533 case " $deplibs " in
7091 *" $path "*) ;; 8534 *" $path "*) ;;
7092 *) deplibs="$path $deplibs" ;; 8535 *) deplibs="$path $deplibs" ;;
7093 esac 8536 esac
7094 done 8537 done
7095 fi # link_all_deplibs != no 8538 fi # link_all_deplibs != no
7096 fi # linkmode = lib 8539 fi # linkmode = lib
7097 done # for deplib in $libs 8540 done # for deplib in $libs
7098 if test "$pass" = link; then 8541 if test link = "$pass"; then
7099 » if test "$linkmode" = "prog"; then 8542 » if test prog = "$linkmode"; then
7100 compile_deplibs="$new_inherited_linker_flags $compile_deplibs" 8543 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
7101 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" 8544 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
7102 else 8545 else
7103 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` 8546 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7104 fi 8547 fi
7105 fi 8548 fi
7106 dependency_libs="$newdependency_libs" 8549 dependency_libs=$newdependency_libs
7107 if test "$pass" = dlpreopen; then 8550 if test dlpreopen = "$pass"; then
7108 # Link the dlpreopened libraries before other libraries 8551 # Link the dlpreopened libraries before other libraries
7109 for deplib in $save_deplibs; do 8552 for deplib in $save_deplibs; do
7110 deplibs="$deplib $deplibs" 8553 deplibs="$deplib $deplibs"
7111 done 8554 done
7112 fi 8555 fi
7113 if test "$pass" != dlopen; then 8556 if test dlopen != "$pass"; then
7114 » if test "$pass" != conv; then 8557 » test conv = "$pass" || {
7115 # Make sure lib_search_path contains only unique directories. 8558 # Make sure lib_search_path contains only unique directories.
7116 lib_search_path= 8559 lib_search_path=
7117 for dir in $newlib_search_path; do 8560 for dir in $newlib_search_path; do
7118 case "$lib_search_path " in 8561 case "$lib_search_path " in
7119 *" $dir "*) ;; 8562 *" $dir "*) ;;
7120 *) func_append lib_search_path " $dir" ;; 8563 *) func_append lib_search_path " $dir" ;;
7121 esac 8564 esac
7122 done 8565 done
7123 newlib_search_path= 8566 newlib_search_path=
7124 » fi 8567 » }
7125 8568
7126 » if test "$linkmode,$pass" != "prog,link"; then 8569 » if test prog,link = "$linkmode,$pass"; then
7127 » vars="deplibs" 8570 » vars="compile_deplibs finalize_deplibs"
7128 else 8571 else
7129 » vars="compile_deplibs finalize_deplibs" 8572 » vars=deplibs
7130 fi 8573 fi
7131 for var in $vars dependency_libs; do 8574 for var in $vars dependency_libs; do
7132 # Add libraries to $var in reverse order 8575 # Add libraries to $var in reverse order
7133 eval tmp_libs=\"\$$var\" 8576 eval tmp_libs=\"\$$var\"
7134 new_libs= 8577 new_libs=
7135 for deplib in $tmp_libs; do 8578 for deplib in $tmp_libs; do
7136 # FIXME: Pedantically, this is the right thing to do, so 8579 # FIXME: Pedantically, this is the right thing to do, so
7137 # that some nasty dependency loop isn't accidentally 8580 # that some nasty dependency loop isn't accidentally
7138 # broken: 8581 # broken:
7139 #new_libs="$deplib $new_libs" 8582 #new_libs="$deplib $new_libs"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
7177 *" $deplib "*) ;; 8620 *" $deplib "*) ;;
7178 *) func_append tmp_libs " $deplib" ;; 8621 *) func_append tmp_libs " $deplib" ;;
7179 esac 8622 esac
7180 ;; 8623 ;;
7181 *) func_append tmp_libs " $deplib" ;; 8624 *) func_append tmp_libs " $deplib" ;;
7182 esac 8625 esac
7183 done 8626 done
7184 eval $var=\"$tmp_libs\" 8627 eval $var=\"$tmp_libs\"
7185 done # for var 8628 done # for var
7186 fi 8629 fi
8630
8631 # Add Sun CC postdeps if required:
8632 test CXX = "$tagname" && {
8633 case $host_os in
8634 linux*)
8635 case `$CC -V 2>&1 | sed 5q` in
8636 *Sun\ C*) # Sun C++ 5.9
8637 func_suncc_cstd_abi
8638
8639 if test no != "$suncc_use_cstd_abi"; then
8640 func_append postdeps ' -library=Cstd -library=Crun'
8641 fi
8642 ;;
8643 esac
8644 ;;
8645
8646 solaris*)
8647 func_cc_basename "$CC"
8648 case $func_cc_basename_result in
8649 CC* | sunCC*)
8650 func_suncc_cstd_abi
8651
8652 if test no != "$suncc_use_cstd_abi"; then
8653 func_append postdeps ' -library=Cstd -library=Crun'
8654 fi
8655 ;;
8656 esac
8657 ;;
8658 esac
8659 }
8660
7187 # Last step: remove runtime libs from dependency_libs 8661 # Last step: remove runtime libs from dependency_libs
7188 # (they stay in deplibs) 8662 # (they stay in deplibs)
7189 tmp_libs= 8663 tmp_libs=
7190 for i in $dependency_libs ; do 8664 for i in $dependency_libs; do
7191 case " $predeps $postdeps $compiler_lib_search_path " in 8665 case " $predeps $postdeps $compiler_lib_search_path " in
7192 *" $i "*) 8666 *" $i "*)
7193 » i="" 8667 » i=
7194 ;; 8668 ;;
7195 esac 8669 esac
7196 » if test -n "$i" ; then 8670 » if test -n "$i"; then
7197 func_append tmp_libs " $i" 8671 func_append tmp_libs " $i"
7198 fi 8672 fi
7199 done 8673 done
7200 dependency_libs=$tmp_libs 8674 dependency_libs=$tmp_libs
7201 done # for pass 8675 done # for pass
7202 if test "$linkmode" = prog; then 8676 if test prog = "$linkmode"; then
7203 dlfiles="$newdlfiles" 8677 dlfiles=$newdlfiles
7204 fi 8678 fi
7205 if test "$linkmode" = prog || test "$linkmode" = lib; then 8679 if test prog = "$linkmode" || test lib = "$linkmode"; then
7206 dlprefiles="$newdlprefiles" 8680 dlprefiles=$newdlprefiles
7207 fi 8681 fi
7208 8682
7209 case $linkmode in 8683 case $linkmode in
7210 oldlib) 8684 oldlib)
7211 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 8685 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
7212 » func_warning "\`-dlopen' is ignored for archives" 8686 » func_warning "'-dlopen' is ignored for archives"
7213 fi 8687 fi
7214 8688
7215 case " $deplibs" in 8689 case " $deplibs" in
7216 *\ -l* | *\ -L*) 8690 *\ -l* | *\ -L*)
7217 » func_warning "\`-l' and \`-L' are ignored for archives" ;; 8691 » func_warning "'-l' and '-L' are ignored for archives" ;;
7218 esac 8692 esac
7219 8693
7220 test -n "$rpath" && \ 8694 test -n "$rpath" && \
7221 » func_warning "\`-rpath' is ignored for archives" 8695 » func_warning "'-rpath' is ignored for archives"
7222 8696
7223 test -n "$xrpath" && \ 8697 test -n "$xrpath" && \
7224 » func_warning "\`-R' is ignored for archives" 8698 » func_warning "'-R' is ignored for archives"
7225 8699
7226 test -n "$vinfo" && \ 8700 test -n "$vinfo" && \
7227 » func_warning "\`-version-info/-version-number' is ignored for archives" 8701 » func_warning "'-version-info/-version-number' is ignored for archives"
7228 8702
7229 test -n "$release" && \ 8703 test -n "$release" && \
7230 » func_warning "\`-release' is ignored for archives" 8704 » func_warning "'-release' is ignored for archives"
7231 8705
7232 test -n "$export_symbols$export_symbols_regex" && \ 8706 test -n "$export_symbols$export_symbols_regex" && \
7233 » func_warning "\`-export-symbols' is ignored for archives" 8707 » func_warning "'-export-symbols' is ignored for archives"
7234 8708
7235 # Now set the variables for building old libraries. 8709 # Now set the variables for building old libraries.
7236 build_libtool_libs=no 8710 build_libtool_libs=no
7237 oldlibs="$output" 8711 oldlibs=$output
7238 func_append objs "$old_deplibs" 8712 func_append objs "$old_deplibs"
7239 ;; 8713 ;;
7240 8714
7241 lib) 8715 lib)
7242 # Make sure we only generate libraries of the form `libNAME.la'. 8716 # Make sure we only generate libraries of the form 'libNAME.la'.
7243 case $outputname in 8717 case $outputname in
7244 lib*) 8718 lib*)
7245 func_stripname 'lib' '.la' "$outputname" 8719 func_stripname 'lib' '.la' "$outputname"
7246 name=$func_stripname_result 8720 name=$func_stripname_result
7247 eval shared_ext=\"$shrext_cmds\" 8721 eval shared_ext=\"$shrext_cmds\"
7248 eval libname=\"$libname_spec\" 8722 eval libname=\"$libname_spec\"
7249 ;; 8723 ;;
7250 *) 8724 *)
7251 » test "$module" = no && \ 8725 » test no = "$module" \
7252 » func_fatal_help "libtool library \`$output' must begin with \`lib'" 8726 » && func_fatal_help "libtool library '$output' must begin with 'lib'"
7253 8727
7254 » if test "$need_lib_prefix" != no; then 8728 » if test no != "$need_lib_prefix"; then
7255 # Add the "lib" prefix for modules if required 8729 # Add the "lib" prefix for modules if required
7256 func_stripname '' '.la' "$outputname" 8730 func_stripname '' '.la' "$outputname"
7257 name=$func_stripname_result 8731 name=$func_stripname_result
7258 eval shared_ext=\"$shrext_cmds\" 8732 eval shared_ext=\"$shrext_cmds\"
7259 eval libname=\"$libname_spec\" 8733 eval libname=\"$libname_spec\"
7260 else 8734 else
7261 func_stripname '' '.la' "$outputname" 8735 func_stripname '' '.la' "$outputname"
7262 libname=$func_stripname_result 8736 libname=$func_stripname_result
7263 fi 8737 fi
7264 ;; 8738 ;;
7265 esac 8739 esac
7266 8740
7267 if test -n "$objs"; then 8741 if test -n "$objs"; then
7268 » if test "$deplibs_check_method" != pass_all; then 8742 » if test pass_all != "$deplibs_check_method"; then
7269 » func_fatal_error "cannot build libtool library \`$output' from non-lib tool objects on this host:$objs" 8743 » func_fatal_error "cannot build libtool library '$output' from non-libt ool objects on this host:$objs"
7270 else 8744 else
7271 echo 8745 echo
7272 $ECHO "*** Warning: Linking the shared library $output against the non -libtool" 8746 $ECHO "*** Warning: Linking the shared library $output against the non -libtool"
7273 $ECHO "*** objects $objs is not portable!" 8747 $ECHO "*** objects $objs is not portable!"
7274 func_append libobjs " $objs" 8748 func_append libobjs " $objs"
7275 fi 8749 fi
7276 fi 8750 fi
7277 8751
7278 test "$dlself" != no && \ 8752 test no = "$dlself" \
7279 » func_warning "\`-dlopen self' is ignored for libtool libraries" 8753 » || func_warning "'-dlopen self' is ignored for libtool libraries"
7280 8754
7281 set dummy $rpath 8755 set dummy $rpath
7282 shift 8756 shift
7283 test "$#" -gt 1 && \ 8757 test 1 -lt "$#" \
7284 » func_warning "ignoring multiple \`-rpath's for a libtool library" 8758 » && func_warning "ignoring multiple '-rpath's for a libtool library"
7285 8759
7286 install_libdir="$1" 8760 install_libdir=$1
7287 8761
7288 oldlibs= 8762 oldlibs=
7289 if test -z "$rpath"; then 8763 if test -z "$rpath"; then
7290 » if test "$build_libtool_libs" = yes; then 8764 » if test yes = "$build_libtool_libs"; then
7291 # Building a libtool convenience library. 8765 # Building a libtool convenience library.
7292 » # Some compilers have problems with a `.al' extension so 8766 » # Some compilers have problems with a '.al' extension so
7293 # convenience libraries should have the same extension an 8767 # convenience libraries should have the same extension an
7294 # archive normally would. 8768 # archive normally would.
7295 oldlibs="$output_objdir/$libname.$libext $oldlibs" 8769 oldlibs="$output_objdir/$libname.$libext $oldlibs"
7296 build_libtool_libs=convenience 8770 build_libtool_libs=convenience
7297 build_old_libs=yes 8771 build_old_libs=yes
7298 fi 8772 fi
7299 8773
7300 test -n "$vinfo" && \ 8774 test -n "$vinfo" && \
7301 » func_warning "\`-version-info/-version-number' is ignored for convenie nce libraries" 8775 » func_warning "'-version-info/-version-number' is ignored for convenien ce libraries"
7302 8776
7303 test -n "$release" && \ 8777 test -n "$release" && \
7304 » func_warning "\`-release' is ignored for convenience libraries" 8778 » func_warning "'-release' is ignored for convenience libraries"
7305 else 8779 else
7306 8780
7307 # Parse the version information argument. 8781 # Parse the version information argument.
7308 » save_ifs="$IFS"; IFS=':' 8782 » save_ifs=$IFS; IFS=:
7309 set dummy $vinfo 0 0 0 8783 set dummy $vinfo 0 0 0
7310 shift 8784 shift
7311 » IFS="$save_ifs" 8785 » IFS=$save_ifs
7312 8786
7313 test -n "$7" && \ 8787 test -n "$7" && \
7314 » func_fatal_help "too many parameters to \`-version-info'" 8788 » func_fatal_help "too many parameters to '-version-info'"
7315 8789
7316 # convert absolute version numbers to libtool ages 8790 # convert absolute version numbers to libtool ages
7317 # this retains compatibility with .la files and attempts 8791 # this retains compatibility with .la files and attempts
7318 # to make the code below a bit more comprehensible 8792 # to make the code below a bit more comprehensible
7319 8793
7320 case $vinfo_number in 8794 case $vinfo_number in
7321 yes) 8795 yes)
7322 » number_major="$1" 8796 » number_major=$1
7323 » number_minor="$2" 8797 » number_minor=$2
7324 » number_revision="$3" 8798 » number_revision=$3
7325 # 8799 #
7326 # There are really only two kinds -- those that 8800 # There are really only two kinds -- those that
7327 # use the current revision as the major version 8801 # use the current revision as the major version
7328 # and those that subtract age and use age as 8802 # and those that subtract age and use age as
7329 # a minor version. But, then there is irix 8803 # a minor version. But, then there is irix
7330 » # which has an extra 1 added just for fun 8804 » # that has an extra 1 added just for fun
7331 # 8805 #
7332 case $version_type in 8806 case $version_type in
7333 # correct linux to gnu/linux during the next big refactor 8807 # correct linux to gnu/linux during the next big refactor
7334 » darwin|linux|osf|windows|none) 8808 » darwin|freebsd-elf|linux|osf|windows|none)
7335 func_arith $number_major + $number_minor 8809 func_arith $number_major + $number_minor
7336 current=$func_arith_result 8810 current=$func_arith_result
7337 » age="$number_minor" 8811 » age=$number_minor
7338 » revision="$number_revision" 8812 » revision=$number_revision
7339 ;; 8813 ;;
7340 » freebsd-aout|freebsd-elf|qnx|sunos) 8814 » freebsd-aout|qnx|sunos)
7341 » current="$number_major" 8815 » current=$number_major
7342 » revision="$number_minor" 8816 » revision=$number_minor
7343 » age="0" 8817 » age=0
7344 ;; 8818 ;;
7345 irix|nonstopux) 8819 irix|nonstopux)
7346 func_arith $number_major + $number_minor 8820 func_arith $number_major + $number_minor
7347 current=$func_arith_result 8821 current=$func_arith_result
7348 » age="$number_minor" 8822 » age=$number_minor
7349 » revision="$number_minor" 8823 » revision=$number_minor
7350 lt_irix_increment=no 8824 lt_irix_increment=no
7351 ;; 8825 ;;
7352 esac 8826 esac
7353 ;; 8827 ;;
7354 no) 8828 no)
7355 » current="$1" 8829 » current=$1
7356 » revision="$2" 8830 » revision=$2
7357 » age="$3" 8831 » age=$3
7358 ;; 8832 ;;
7359 esac 8833 esac
7360 8834
7361 # Check that each of the things are valid numbers. 8835 # Check that each of the things are valid numbers.
7362 case $current in 8836 case $current in
7363 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][ 0-9][0-9]) ;; 8837 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][ 0-9][0-9]) ;;
7364 *) 8838 *)
7365 » func_error "CURRENT \`$current' must be a nonnegative integer" 8839 » func_error "CURRENT '$current' must be a nonnegative integer"
7366 » func_fatal_error "\`$vinfo' is not valid version information" 8840 » func_fatal_error "'$vinfo' is not valid version information"
7367 ;; 8841 ;;
7368 esac 8842 esac
7369 8843
7370 case $revision in 8844 case $revision in
7371 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][ 0-9][0-9]) ;; 8845 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][ 0-9][0-9]) ;;
7372 *) 8846 *)
7373 » func_error "REVISION \`$revision' must be a nonnegative integer" 8847 » func_error "REVISION '$revision' must be a nonnegative integer"
7374 » func_fatal_error "\`$vinfo' is not valid version information" 8848 » func_fatal_error "'$vinfo' is not valid version information"
7375 ;; 8849 ;;
7376 esac 8850 esac
7377 8851
7378 case $age in 8852 case $age in
7379 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][ 0-9][0-9]) ;; 8853 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][ 0-9][0-9]) ;;
7380 *) 8854 *)
7381 » func_error "AGE \`$age' must be a nonnegative integer" 8855 » func_error "AGE '$age' must be a nonnegative integer"
7382 » func_fatal_error "\`$vinfo' is not valid version information" 8856 » func_fatal_error "'$vinfo' is not valid version information"
7383 ;; 8857 ;;
7384 esac 8858 esac
7385 8859
7386 if test "$age" -gt "$current"; then 8860 if test "$age" -gt "$current"; then
7387 » func_error "AGE \`$age' is greater than the current interface number \ `$current'" 8861 » func_error "AGE '$age' is greater than the current interface number '$ current'"
7388 » func_fatal_error "\`$vinfo' is not valid version information" 8862 » func_fatal_error "'$vinfo' is not valid version information"
7389 fi 8863 fi
7390 8864
7391 # Calculate the version variables. 8865 # Calculate the version variables.
7392 major= 8866 major=
7393 versuffix= 8867 versuffix=
7394 verstring= 8868 verstring=
7395 case $version_type in 8869 case $version_type in
7396 none) ;; 8870 none) ;;
7397 8871
7398 darwin) 8872 darwin)
7399 # Like Linux, but with the current version available in 8873 # Like Linux, but with the current version available in
7400 # verstring for coding it into the library header 8874 # verstring for coding it into the library header
7401 func_arith $current - $age 8875 func_arith $current - $age
7402 major=.$func_arith_result 8876 major=.$func_arith_result
7403 » versuffix="$major.$age.$revision" 8877 » versuffix=$major.$age.$revision
7404 # Darwin ld doesn't like 0 for these options... 8878 # Darwin ld doesn't like 0 for these options...
7405 func_arith $current + 1 8879 func_arith $current + 1
7406 minor_current=$func_arith_result 8880 minor_current=$func_arith_result
7407 » xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-cu rrent_version ${wl}$minor_current.$revision" 8881 » xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_ version $wl$minor_current.$revision"
7408 verstring="-compatibility_version $minor_current -current_version $min or_current.$revision" 8882 verstring="-compatibility_version $minor_current -current_version $min or_current.$revision"
8883 # On Darwin other compilers
8884 case $CC in
8885 nagfor*)
8886 verstring="$wl-compatibility_version $wl$minor_current $wl-cur rent_version $wl$minor_current.$revision"
8887 ;;
8888 *)
8889 verstring="-compatibility_version $minor_current -current_vers ion $minor_current.$revision"
8890 ;;
8891 esac
7409 ;; 8892 ;;
7410 8893
7411 freebsd-aout) 8894 freebsd-aout)
7412 » major=".$current" 8895 » major=.$current
7413 » versuffix=".$current.$revision"; 8896 » versuffix=.$current.$revision
7414 ;; 8897 ;;
7415 8898
7416 freebsd-elf) 8899 freebsd-elf)
7417 » major=".$current" 8900 » func_arith $current - $age
7418 » versuffix=".$current" 8901 » major=.$func_arith_result
8902 » versuffix=$major.$age.$revision
7419 ;; 8903 ;;
7420 8904
7421 irix | nonstopux) 8905 irix | nonstopux)
7422 » if test "X$lt_irix_increment" = "Xno"; then 8906 » if test no = "$lt_irix_increment"; then
7423 func_arith $current - $age 8907 func_arith $current - $age
7424 else 8908 else
7425 func_arith $current - $age + 1 8909 func_arith $current - $age + 1
7426 fi 8910 fi
7427 major=$func_arith_result 8911 major=$func_arith_result
7428 8912
7429 case $version_type in 8913 case $version_type in
7430 nonstopux) verstring_prefix=nonstopux ;; 8914 nonstopux) verstring_prefix=nonstopux ;;
7431 *) verstring_prefix=sgi ;; 8915 *) verstring_prefix=sgi ;;
7432 esac 8916 esac
7433 » verstring="$verstring_prefix$major.$revision" 8917 » verstring=$verstring_prefix$major.$revision
7434 8918
7435 # Add in all the interfaces that we are compatible with. 8919 # Add in all the interfaces that we are compatible with.
7436 loop=$revision 8920 loop=$revision
7437 » while test "$loop" -ne 0; do 8921 » while test 0 -ne "$loop"; do
7438 func_arith $revision - $loop 8922 func_arith $revision - $loop
7439 iface=$func_arith_result 8923 iface=$func_arith_result
7440 func_arith $loop - 1 8924 func_arith $loop - 1
7441 loop=$func_arith_result 8925 loop=$func_arith_result
7442 » verstring="$verstring_prefix$major.$iface:$verstring" 8926 » verstring=$verstring_prefix$major.$iface:$verstring
7443 done 8927 done
7444 8928
7445 » # Before this point, $major must not contain `.'. 8929 » # Before this point, $major must not contain '.'.
7446 major=.$major 8930 major=.$major
7447 » versuffix="$major.$revision" 8931 » versuffix=$major.$revision
7448 ;; 8932 ;;
7449 8933
7450 linux) # correct to gnu/linux during the next big refactor 8934 linux) # correct to gnu/linux during the next big refactor
7451 func_arith $current - $age 8935 func_arith $current - $age
7452 major=.$func_arith_result 8936 major=.$func_arith_result
7453 » versuffix="$major.$age.$revision" 8937 » versuffix=$major.$age.$revision
7454 ;; 8938 ;;
7455 8939
7456 osf) 8940 osf)
7457 func_arith $current - $age 8941 func_arith $current - $age
7458 major=.$func_arith_result 8942 major=.$func_arith_result
7459 » versuffix=".$current.$age.$revision" 8943 » versuffix=.$current.$age.$revision
7460 » verstring="$current.$age.$revision" 8944 » verstring=$current.$age.$revision
7461 8945
7462 # Add in all the interfaces that we are compatible with. 8946 # Add in all the interfaces that we are compatible with.
7463 loop=$age 8947 loop=$age
7464 » while test "$loop" -ne 0; do 8948 » while test 0 -ne "$loop"; do
7465 func_arith $current - $loop 8949 func_arith $current - $loop
7466 iface=$func_arith_result 8950 iface=$func_arith_result
7467 func_arith $loop - 1 8951 func_arith $loop - 1
7468 loop=$func_arith_result 8952 loop=$func_arith_result
7469 » verstring="$verstring:${iface}.0" 8953 » verstring=$verstring:$iface.0
7470 done 8954 done
7471 8955
7472 # Make executables depend on our current version. 8956 # Make executables depend on our current version.
7473 » func_append verstring ":${current}.0" 8957 » func_append verstring ":$current.0"
7474 ;; 8958 ;;
7475 8959
7476 qnx) 8960 qnx)
7477 » major=".$current" 8961 » major=.$current
7478 » versuffix=".$current" 8962 » versuffix=.$current
8963 » ;;
8964
8965 » sco)
8966 » major=.$current
8967 » versuffix=.$current
7479 ;; 8968 ;;
7480 8969
7481 sunos) 8970 sunos)
7482 » major=".$current" 8971 » major=.$current
7483 » versuffix=".$current.$revision" 8972 » versuffix=.$current.$revision
7484 ;; 8973 ;;
7485 8974
7486 windows) 8975 windows)
7487 # Use '-' rather than '.', since we only want one 8976 # Use '-' rather than '.', since we only want one
7488 » # extension on DOS 8.3 filesystems. 8977 » # extension on DOS 8.3 file systems.
7489 func_arith $current - $age 8978 func_arith $current - $age
7490 major=$func_arith_result 8979 major=$func_arith_result
7491 » versuffix="-$major" 8980 » versuffix=-$major
7492 ;; 8981 ;;
7493 8982
7494 *) 8983 *)
7495 » func_fatal_configuration "unknown library version type \`$version_type '" 8984 » func_fatal_configuration "unknown library version type '$version_type' "
7496 ;; 8985 ;;
7497 esac 8986 esac
7498 8987
7499 # Clear the version info if we defaulted, and they specified a release. 8988 # Clear the version info if we defaulted, and they specified a release.
7500 if test -z "$vinfo" && test -n "$release"; then 8989 if test -z "$vinfo" && test -n "$release"; then
7501 major= 8990 major=
7502 case $version_type in 8991 case $version_type in
7503 darwin) 8992 darwin)
7504 # we can't check for "0.0" in archive_cmds due to quoting 8993 # we can't check for "0.0" in archive_cmds due to quoting
7505 # problems, so we reset it completely 8994 # problems, so we reset it completely
7506 verstring= 8995 verstring=
7507 ;; 8996 ;;
7508 *) 8997 *)
7509 » verstring="0.0" 8998 » verstring=0.0
7510 ;; 8999 ;;
7511 esac 9000 esac
7512 » if test "$need_version" = no; then 9001 » if test no = "$need_version"; then
7513 versuffix= 9002 versuffix=
7514 else 9003 else
7515 » versuffix=".0.0" 9004 » versuffix=.0.0
7516 fi 9005 fi
7517 fi 9006 fi
7518 9007
7519 # Remove version info from name if versioning should be avoided 9008 # Remove version info from name if versioning should be avoided
7520 » if test "$avoid_version" = yes && test "$need_version" = no; then 9009 » if test yes,no = "$avoid_version,$need_version"; then
7521 major= 9010 major=
7522 versuffix= 9011 versuffix=
7523 » verstring="" 9012 » verstring=
7524 fi 9013 fi
7525 9014
7526 # Check to see if the archive will have undefined symbols. 9015 # Check to see if the archive will have undefined symbols.
7527 » if test "$allow_undefined" = yes; then 9016 » if test yes = "$allow_undefined"; then
7528 » if test "$allow_undefined_flag" = unsupported; then 9017 » if test unsupported = "$allow_undefined_flag"; then
7529 » func_warning "undefined symbols not allowed in $host shared librarie s" 9018 » if test yes = "$build_old_libs"; then
7530 » build_libtool_libs=no 9019 » func_warning "undefined symbols not allowed in $host shared librar ies; building static only"
7531 » build_old_libs=yes 9020 » build_libtool_libs=no
9021 » else
9022 » func_fatal_error "can't build $host shared library unless -no-unde fined is specified"
9023 » fi
7532 fi 9024 fi
7533 else 9025 else
7534 # Don't allow undefined symbols. 9026 # Don't allow undefined symbols.
7535 » allow_undefined_flag="$no_undefined_flag" 9027 » allow_undefined_flag=$no_undefined_flag
7536 fi 9028 fi
7537 9029
7538 fi 9030 fi
7539 9031
7540 func_generate_dlsyms "$libname" "$libname" "yes" 9032 func_generate_dlsyms "$libname" "$libname" :
7541 func_append libobjs " $symfileobj" 9033 func_append libobjs " $symfileobj"
7542 test "X$libobjs" = "X " && libobjs= 9034 test " " = "$libobjs" && libobjs=
7543 9035
7544 if test "$opt_mode" != relink; then 9036 if test relink != "$opt_mode"; then
7545 # Remove our outputs, but don't remove object files since they 9037 # Remove our outputs, but don't remove object files since they
7546 # may have been created when compiling PIC objects. 9038 # may have been created when compiling PIC objects.
7547 removelist= 9039 removelist=
7548 tempremovelist=`$ECHO "$output_objdir/*"` 9040 tempremovelist=`$ECHO "$output_objdir/*"`
7549 for p in $tempremovelist; do 9041 for p in $tempremovelist; do
7550 case $p in 9042 case $p in
7551 *.$objext | *.gcno) 9043 *.$objext | *.gcno)
7552 ;; 9044 ;;
7553 » $output_objdir/$outputname | $output_objdir/$libname.* | $output_obj dir/${libname}${release}.*) 9045 » $output_objdir/$outputname | $output_objdir/$libname.* | $output_obj dir/$libname$release.*)
7554 » if test "X$precious_files_regex" != "X"; then 9046 » if test -n "$precious_files_regex"; then
7555 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2> &1 9047 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2> &1
7556 then 9048 then
7557 continue 9049 continue
7558 fi 9050 fi
7559 fi 9051 fi
7560 func_append removelist " $p" 9052 func_append removelist " $p"
7561 ;; 9053 ;;
7562 *) ;; 9054 *) ;;
7563 esac 9055 esac
7564 done 9056 done
7565 test -n "$removelist" && \ 9057 test -n "$removelist" && \
7566 func_show_eval "${RM}r \$removelist" 9058 func_show_eval "${RM}r \$removelist"
7567 fi 9059 fi
7568 9060
7569 # Now set the variables for building old libraries. 9061 # Now set the variables for building old libraries.
7570 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenien ce ; then 9062 if test yes = "$build_old_libs" && test convenience != "$build_libtool_lib s"; then
7571 func_append oldlibs " $output_objdir/$libname.$libext" 9063 func_append oldlibs " $output_objdir/$libname.$libext"
7572 9064
7573 # Transform .lo files to .o files. 9065 # Transform .lo files to .o files.
7574 » oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2 o" | $NL2SP` 9066 » oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
7575 fi 9067 fi
7576 9068
7577 # Eliminate all temporary directories. 9069 # Eliminate all temporary directories.
7578 #for path in $notinst_path; do 9070 #for path in $notinst_path; do
7579 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` 9071 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
7580 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` 9072 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
7581 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` 9073 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
7582 #done 9074 #done
7583 9075
7584 if test -n "$xrpath"; then 9076 if test -n "$xrpath"; then
7585 # If the user specified any rpath flags, then add them. 9077 # If the user specified any rpath flags, then add them.
7586 temp_xrpath= 9078 temp_xrpath=
7587 for libdir in $xrpath; do 9079 for libdir in $xrpath; do
7588 func_replace_sysroot "$libdir" 9080 func_replace_sysroot "$libdir"
7589 func_append temp_xrpath " -R$func_replace_sysroot_result" 9081 func_append temp_xrpath " -R$func_replace_sysroot_result"
7590 case "$finalize_rpath " in 9082 case "$finalize_rpath " in
7591 *" $libdir "*) ;; 9083 *" $libdir "*) ;;
7592 *) func_append finalize_rpath " $libdir" ;; 9084 *) func_append finalize_rpath " $libdir" ;;
7593 esac 9085 esac
7594 done 9086 done
7595 » if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; th en 9087 » if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; th en
7596 dependency_libs="$temp_xrpath $dependency_libs" 9088 dependency_libs="$temp_xrpath $dependency_libs"
7597 fi 9089 fi
7598 fi 9090 fi
7599 9091
7600 # Make sure dlfiles contains only unique files that won't be dlpreopened 9092 # Make sure dlfiles contains only unique files that won't be dlpreopened
7601 old_dlfiles="$dlfiles" 9093 old_dlfiles=$dlfiles
7602 dlfiles= 9094 dlfiles=
7603 for lib in $old_dlfiles; do 9095 for lib in $old_dlfiles; do
7604 case " $dlprefiles $dlfiles " in 9096 case " $dlprefiles $dlfiles " in
7605 *" $lib "*) ;; 9097 *" $lib "*) ;;
7606 *) func_append dlfiles " $lib" ;; 9098 *) func_append dlfiles " $lib" ;;
7607 esac 9099 esac
7608 done 9100 done
7609 9101
7610 # Make sure dlprefiles contains only unique files 9102 # Make sure dlprefiles contains only unique files
7611 old_dlprefiles="$dlprefiles" 9103 old_dlprefiles=$dlprefiles
7612 dlprefiles= 9104 dlprefiles=
7613 for lib in $old_dlprefiles; do 9105 for lib in $old_dlprefiles; do
7614 case "$dlprefiles " in 9106 case "$dlprefiles " in
7615 *" $lib "*) ;; 9107 *" $lib "*) ;;
7616 *) func_append dlprefiles " $lib" ;; 9108 *) func_append dlprefiles " $lib" ;;
7617 esac 9109 esac
7618 done 9110 done
7619 9111
7620 if test "$build_libtool_libs" = yes; then 9112 if test yes = "$build_libtool_libs"; then
7621 if test -n "$rpath"; then 9113 if test -n "$rpath"; then
7622 case $host in 9114 case $host in
7623 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) 9115 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
7624 # these systems don't actually have a c library (as such)! 9116 # these systems don't actually have a c library (as such)!
7625 ;; 9117 ;;
7626 *-*-rhapsody* | *-*-darwin1.[012]) 9118 *-*-rhapsody* | *-*-darwin1.[012])
7627 # Rhapsody C library is in the System framework 9119 # Rhapsody C library is in the System framework
7628 func_append deplibs " System.ltframework" 9120 func_append deplibs " System.ltframework"
7629 ;; 9121 ;;
7630 *-*-netbsd*) 9122 *-*-netbsd*)
7631 # Don't link with libc until the a.out ld.so is fixed. 9123 # Don't link with libc until the a.out ld.so is fixed.
7632 ;; 9124 ;;
7633 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) 9125 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7634 # Do not include libc due to us having libc/libc_r. 9126 # Do not include libc due to us having libc/libc_r.
7635 ;; 9127 ;;
7636 *-*-sco3.2v5* | *-*-sco5v6*) 9128 *-*-sco3.2v5* | *-*-sco5v6*)
7637 # Causes problems with __ctype 9129 # Causes problems with __ctype
7638 ;; 9130 ;;
7639 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) 9131 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7640 # Compiler inserts libc in the correct place for threads to work 9132 # Compiler inserts libc in the correct place for threads to work
7641 ;; 9133 ;;
7642 *) 9134 *)
7643 # Add libc to deplibs on all other systems if necessary. 9135 # Add libc to deplibs on all other systems if necessary.
7644 » if test "$build_libtool_need_lc" = "yes"; then 9136 » if test yes = "$build_libtool_need_lc"; then
7645 func_append deplibs " -lc" 9137 func_append deplibs " -lc"
7646 fi 9138 fi
7647 ;; 9139 ;;
7648 esac 9140 esac
7649 fi 9141 fi
7650 9142
7651 # Transform deplibs into only deplibs that can be linked in shared. 9143 # Transform deplibs into only deplibs that can be linked in shared.
7652 name_save=$name 9144 name_save=$name
7653 libname_save=$libname 9145 libname_save=$libname
7654 release_save=$release 9146 release_save=$release
7655 versuffix_save=$versuffix 9147 versuffix_save=$versuffix
7656 major_save=$major 9148 major_save=$major
7657 # I'm not sure if I'm treating the release correctly. I think 9149 # I'm not sure if I'm treating the release correctly. I think
7658 # release should show up in the -l (ie -lgmp5) so we don't want to 9150 # release should show up in the -l (ie -lgmp5) so we don't want to
7659 # add it in twice. Is that correct? 9151 # add it in twice. Is that correct?
7660 » release="" 9152 » release=
7661 » versuffix="" 9153 » versuffix=
7662 » major="" 9154 » major=
7663 newdeplibs= 9155 newdeplibs=
7664 droppeddeps=no 9156 droppeddeps=no
7665 case $deplibs_check_method in 9157 case $deplibs_check_method in
7666 pass_all) 9158 pass_all)
7667 # Don't check for shared/static. Everything works. 9159 # Don't check for shared/static. Everything works.
7668 # This might be a little naive. We might want to check 9160 # This might be a little naive. We might want to check
7669 # whether the library exists or not. But this is on 9161 # whether the library exists or not. But this is on
7670 # osf3 & osf4 and I'm not really sure... Just 9162 # osf3 & osf4 and I'm not really sure... Just
7671 # implementing what was already the behavior. 9163 # implementing what was already the behavior.
7672 newdeplibs=$deplibs 9164 newdeplibs=$deplibs
7673 ;; 9165 ;;
7674 test_compile) 9166 test_compile)
7675 # This code stresses the "libraries are programs" paradigm to its 9167 # This code stresses the "libraries are programs" paradigm to its
7676 # limits. Maybe even breaks it. We compile a program, linking it 9168 # limits. Maybe even breaks it. We compile a program, linking it
7677 # against the deplibs as a proxy for the library. Then we can check 9169 # against the deplibs as a proxy for the library. Then we can check
7678 # whether they linked in statically or dynamically with ldd. 9170 # whether they linked in statically or dynamically with ldd.
7679 $opt_dry_run || $RM conftest.c 9171 $opt_dry_run || $RM conftest.c
7680 cat > conftest.c <<EOF 9172 cat > conftest.c <<EOF
7681 int main() { return 0; } 9173 int main() { return 0; }
7682 EOF 9174 EOF
7683 $opt_dry_run || $RM conftest 9175 $opt_dry_run || $RM conftest
7684 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then 9176 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
7685 ldd_output=`ldd conftest` 9177 ldd_output=`ldd conftest`
7686 for i in $deplibs; do 9178 for i in $deplibs; do
7687 case $i in 9179 case $i in
7688 -l*) 9180 -l*)
7689 func_stripname -l '' "$i" 9181 func_stripname -l '' "$i"
7690 name=$func_stripname_result 9182 name=$func_stripname_result
7691 » » if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; t hen 9183 » » if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7692 case " $predeps $postdeps " in 9184 case " $predeps $postdeps " in
7693 *" $i "*) 9185 *" $i "*)
7694 func_append newdeplibs " $i" 9186 func_append newdeplibs " $i"
7695 » » i="" 9187 » » i=
7696 ;; 9188 ;;
7697 esac 9189 esac
7698 fi 9190 fi
7699 » » if test -n "$i" ; then 9191 » » if test -n "$i"; then
7700 libname=`eval "\\$ECHO \"$libname_spec\""` 9192 libname=`eval "\\$ECHO \"$libname_spec\""`
7701 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` 9193 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7702 set dummy $deplib_matches; shift 9194 set dummy $deplib_matches; shift
7703 deplib_match=$1 9195 deplib_match=$1
7704 » » if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then 9196 » » if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
7705 func_append newdeplibs " $i" 9197 func_append newdeplibs " $i"
7706 else 9198 else
7707 droppeddeps=yes 9199 droppeddeps=yes
7708 echo 9200 echo
7709 $ECHO "*** Warning: dynamic linker does not accept needed li brary $i." 9201 $ECHO "*** Warning: dynamic linker does not accept needed li brary $i."
7710 echo "*** I have the capability to make that library automat ically link in when" 9202 echo "*** I have the capability to make that library automat ically link in when"
7711 echo "*** you link to this library. But I can only do this if you have a" 9203 echo "*** you link to this library. But I can only do this if you have a"
7712 echo "*** shared version of the library, which I believe you do not have" 9204 echo "*** shared version of the library, which I believe you do not have"
7713 echo "*** because a test_compile did reveal that the linker did not use it for" 9205 echo "*** because a test_compile did reveal that the linker did not use it for"
7714 echo "*** its dynamic dependency list that programs get reso lved with at runtime." 9206 echo "*** its dynamic dependency list that programs get reso lved with at runtime."
7715 fi 9207 fi
7716 fi 9208 fi
7717 ;; 9209 ;;
7718 *) 9210 *)
7719 func_append newdeplibs " $i" 9211 func_append newdeplibs " $i"
7720 ;; 9212 ;;
7721 esac 9213 esac
7722 done 9214 done
7723 else 9215 else
7724 # Error occurred in the first compile. Let's try to salvage 9216 # Error occurred in the first compile. Let's try to salvage
7725 # the situation: Compile a separate program for each library. 9217 # the situation: Compile a separate program for each library.
7726 for i in $deplibs; do 9218 for i in $deplibs; do
7727 case $i in 9219 case $i in
7728 -l*) 9220 -l*)
7729 func_stripname -l '' "$i" 9221 func_stripname -l '' "$i"
7730 name=$func_stripname_result 9222 name=$func_stripname_result
7731 $opt_dry_run || $RM conftest 9223 $opt_dry_run || $RM conftest
7732 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then 9224 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
7733 ldd_output=`ldd conftest` 9225 ldd_output=`ldd conftest`
7734 » » if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 9226 » » if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7735 case " $predeps $postdeps " in 9227 case " $predeps $postdeps " in
7736 *" $i "*) 9228 *" $i "*)
7737 func_append newdeplibs " $i" 9229 func_append newdeplibs " $i"
7738 » » i="" 9230 » » i=
7739 ;; 9231 ;;
7740 esac 9232 esac
7741 fi 9233 fi
7742 » » if test -n "$i" ; then 9234 » » if test -n "$i"; then
7743 libname=`eval "\\$ECHO \"$libname_spec\""` 9235 libname=`eval "\\$ECHO \"$libname_spec\""`
7744 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` 9236 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7745 set dummy $deplib_matches; shift 9237 set dummy $deplib_matches; shift
7746 deplib_match=$1 9238 deplib_match=$1
7747 » » if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; the n 9239 » » if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
7748 func_append newdeplibs " $i" 9240 func_append newdeplibs " $i"
7749 else 9241 else
7750 droppeddeps=yes 9242 droppeddeps=yes
7751 echo 9243 echo
7752 $ECHO "*** Warning: dynamic linker does not accept needed library $i." 9244 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7753 echo "*** I have the capability to make that library autom atically link in when" 9245 echo "*** I have the capability to make that library autom atically link in when"
7754 echo "*** you link to this library. But I can only do thi s if you have a" 9246 echo "*** you link to this library. But I can only do thi s if you have a"
7755 echo "*** shared version of the library, which you do not appear to have" 9247 echo "*** shared version of the library, which you do not appear to have"
7756 echo "*** because a test_compile did reveal that the linke r did not use this one" 9248 echo "*** because a test_compile did reveal that the linke r did not use this one"
7757 echo "*** as a dynamic dependency that programs can get re solved with at runtime." 9249 echo "*** as a dynamic dependency that programs can get re solved with at runtime."
(...skipping 16 matching lines...) Expand all
7774 fi 9266 fi
7775 ;; 9267 ;;
7776 file_magic*) 9268 file_magic*)
7777 set dummy $deplibs_check_method; shift 9269 set dummy $deplibs_check_method; shift
7778 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` 9270 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7779 for a_deplib in $deplibs; do 9271 for a_deplib in $deplibs; do
7780 case $a_deplib in 9272 case $a_deplib in
7781 -l*) 9273 -l*)
7782 func_stripname -l '' "$a_deplib" 9274 func_stripname -l '' "$a_deplib"
7783 name=$func_stripname_result 9275 name=$func_stripname_result
7784 » if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; the n 9276 » if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7785 case " $predeps $postdeps " in 9277 case " $predeps $postdeps " in
7786 *" $a_deplib "*) 9278 *" $a_deplib "*)
7787 func_append newdeplibs " $a_deplib" 9279 func_append newdeplibs " $a_deplib"
7788 » » a_deplib="" 9280 » » a_deplib=
7789 ;; 9281 ;;
7790 esac 9282 esac
7791 fi 9283 fi
7792 » if test -n "$a_deplib" ; then 9284 » if test -n "$a_deplib"; then
7793 libname=`eval "\\$ECHO \"$libname_spec\""` 9285 libname=`eval "\\$ECHO \"$libname_spec\""`
7794 if test -n "$file_magic_glob"; then 9286 if test -n "$file_magic_glob"; then
7795 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_gl ob` 9287 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_gl ob`
7796 else 9288 else
7797 libnameglob=$libname 9289 libnameglob=$libname
7798 fi 9290 fi
7799 » » test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob ` 9291 » » test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob `
7800 for i in $lib_search_path $sys_lib_search_path $shlib_search_pat h; do 9292 for i in $lib_search_path $sys_lib_search_path $shlib_search_pat h; do
7801 » » if test "$want_nocaseglob" = yes; then 9293 » » if test yes = "$want_nocaseglob"; then
7802 shopt -s nocaseglob 9294 shopt -s nocaseglob
7803 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` 9295 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7804 $nocaseglob 9296 $nocaseglob
7805 else 9297 else
7806 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` 9298 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7807 fi 9299 fi
7808 for potent_lib in $potential_libs; do 9300 for potent_lib in $potential_libs; do
7809 # Follow soft links. 9301 # Follow soft links.
7810 if ls -lLd "$potent_lib" 2>/dev/null | 9302 if ls -lLd "$potent_lib" 2>/dev/null |
7811 $GREP " -> " >/dev/null; then 9303 $GREP " -> " >/dev/null; then
7812 continue 9304 continue
7813 fi 9305 fi
7814 # The statement above tries to avoid entering an 9306 # The statement above tries to avoid entering an
7815 # endless loop below, in case of cyclic links. 9307 # endless loop below, in case of cyclic links.
7816 # We might still enter an endless loop, since a link 9308 # We might still enter an endless loop, since a link
7817 # loop can be closed while we follow links, 9309 # loop can be closed while we follow links,
7818 # but so what? 9310 # but so what?
7819 » » potlib="$potent_lib" 9311 » » potlib=$potent_lib
7820 while test -h "$potlib" 2>/dev/null; do 9312 while test -h "$potlib" 2>/dev/null; do
7821 » » » potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` 9313 » » » potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
7822 case $potliblink in 9314 case $potliblink in
7823 » » » [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; 9315 » » » [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
7824 » » » *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potlibl ink";; 9316 » » » *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potlibl ink";;
7825 esac 9317 esac
7826 done 9318 done
7827 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | 9319 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7828 $SED -e 10q | 9320 $SED -e 10q |
7829 $EGREP "$file_magic_regex" > /dev/null; then 9321 $EGREP "$file_magic_regex" > /dev/null; then
7830 func_append newdeplibs " $a_deplib" 9322 func_append newdeplibs " $a_deplib"
7831 » » » a_deplib="" 9323 » » » a_deplib=
7832 break 2 9324 break 2
7833 fi 9325 fi
7834 done 9326 done
7835 done 9327 done
7836 fi 9328 fi
7837 » if test -n "$a_deplib" ; then 9329 » if test -n "$a_deplib"; then
7838 droppeddeps=yes 9330 droppeddeps=yes
7839 echo 9331 echo
7840 $ECHO "*** Warning: linker path does not have real file for libr ary $a_deplib." 9332 $ECHO "*** Warning: linker path does not have real file for libr ary $a_deplib."
7841 echo "*** I have the capability to make that library automatical ly link in when" 9333 echo "*** I have the capability to make that library automatical ly link in when"
7842 echo "*** you link to this library. But I can only do this if y ou have a" 9334 echo "*** you link to this library. But I can only do this if y ou have a"
7843 echo "*** shared version of the library, which you do not appear to have" 9335 echo "*** shared version of the library, which you do not appear to have"
7844 echo "*** because I did check the linker path looking for a file starting" 9336 echo "*** because I did check the linker path looking for a file starting"
7845 » » if test -z "$potlib" ; then 9337 » » if test -z "$potlib"; then
7846 $ECHO "*** with $libname but no candidates were found. (...for file magic test)" 9338 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
7847 else 9339 else
7848 $ECHO "*** with $libname and none of the candidates passed a f ile format test" 9340 $ECHO "*** with $libname and none of the candidates passed a f ile format test"
7849 $ECHO "*** using a file magic. Last file checked: $potlib" 9341 $ECHO "*** using a file magic. Last file checked: $potlib"
7850 fi 9342 fi
7851 fi 9343 fi
7852 ;; 9344 ;;
7853 *) 9345 *)
7854 # Add a -L argument. 9346 # Add a -L argument.
7855 func_append newdeplibs " $a_deplib" 9347 func_append newdeplibs " $a_deplib"
7856 ;; 9348 ;;
7857 esac 9349 esac
7858 done # Gone through all deplibs. 9350 done # Gone through all deplibs.
7859 ;; 9351 ;;
7860 match_pattern*) 9352 match_pattern*)
7861 set dummy $deplibs_check_method; shift 9353 set dummy $deplibs_check_method; shift
7862 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` 9354 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7863 for a_deplib in $deplibs; do 9355 for a_deplib in $deplibs; do
7864 case $a_deplib in 9356 case $a_deplib in
7865 -l*) 9357 -l*)
7866 func_stripname -l '' "$a_deplib" 9358 func_stripname -l '' "$a_deplib"
7867 name=$func_stripname_result 9359 name=$func_stripname_result
7868 » if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; the n 9360 » if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7869 case " $predeps $postdeps " in 9361 case " $predeps $postdeps " in
7870 *" $a_deplib "*) 9362 *" $a_deplib "*)
7871 func_append newdeplibs " $a_deplib" 9363 func_append newdeplibs " $a_deplib"
7872 » » a_deplib="" 9364 » » a_deplib=
7873 ;; 9365 ;;
7874 esac 9366 esac
7875 fi 9367 fi
7876 » if test -n "$a_deplib" ; then 9368 » if test -n "$a_deplib"; then
7877 libname=`eval "\\$ECHO \"$libname_spec\""` 9369 libname=`eval "\\$ECHO \"$libname_spec\""`
7878 for i in $lib_search_path $sys_lib_search_path $shlib_search_pat h; do 9370 for i in $lib_search_path $sys_lib_search_path $shlib_search_pat h; do
7879 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` 9371 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7880 for potent_lib in $potential_libs; do 9372 for potent_lib in $potential_libs; do
7881 » » potlib="$potent_lib" # see symlink-check above in file_magic test 9373 » » potlib=$potent_lib # see symlink-check above in file_magic t est
7882 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ 9374 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
7883 $EGREP "$match_pattern_regex" > /dev/null; then 9375 $EGREP "$match_pattern_regex" > /dev/null; then
7884 func_append newdeplibs " $a_deplib" 9376 func_append newdeplibs " $a_deplib"
7885 » » a_deplib="" 9377 » » a_deplib=
7886 break 2 9378 break 2
7887 fi 9379 fi
7888 done 9380 done
7889 done 9381 done
7890 fi 9382 fi
7891 » if test -n "$a_deplib" ; then 9383 » if test -n "$a_deplib"; then
7892 droppeddeps=yes 9384 droppeddeps=yes
7893 echo 9385 echo
7894 $ECHO "*** Warning: linker path does not have real file for libr ary $a_deplib." 9386 $ECHO "*** Warning: linker path does not have real file for libr ary $a_deplib."
7895 echo "*** I have the capability to make that library automatical ly link in when" 9387 echo "*** I have the capability to make that library automatical ly link in when"
7896 echo "*** you link to this library. But I can only do this if y ou have a" 9388 echo "*** you link to this library. But I can only do this if y ou have a"
7897 echo "*** shared version of the library, which you do not appear to have" 9389 echo "*** shared version of the library, which you do not appear to have"
7898 echo "*** because I did check the linker path looking for a file starting" 9390 echo "*** because I did check the linker path looking for a file starting"
7899 » » if test -z "$potlib" ; then 9391 » » if test -z "$potlib"; then
7900 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" 9392 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
7901 else 9393 else
7902 $ECHO "*** with $libname and none of the candidates passed a f ile format test" 9394 $ECHO "*** with $libname and none of the candidates passed a f ile format test"
7903 $ECHO "*** using a regex pattern. Last file checked: $potlib" 9395 $ECHO "*** using a regex pattern. Last file checked: $potlib"
7904 fi 9396 fi
7905 fi 9397 fi
7906 ;; 9398 ;;
7907 *) 9399 *)
7908 # Add a -L argument. 9400 # Add a -L argument.
7909 func_append newdeplibs " $a_deplib" 9401 func_append newdeplibs " $a_deplib"
7910 ;; 9402 ;;
7911 esac 9403 esac
7912 done # Gone through all deplibs. 9404 done # Gone through all deplibs.
7913 ;; 9405 ;;
7914 none | unknown | *) 9406 none | unknown | *)
7915 » newdeplibs="" 9407 » newdeplibs=
7916 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` 9408 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
7917 » if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then 9409 » if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7918 » for i in $predeps $postdeps ; do 9410 » for i in $predeps $postdeps; do
7919 # can't use Xsed below, because $i might contain '/' 9411 # can't use Xsed below, because $i might contain '/'
7920 » tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` 9412 » tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
7921 done 9413 done
7922 fi 9414 fi
7923 case $tmp_deplibs in 9415 case $tmp_deplibs in
7924 *[!\ \ ]*) 9416 *[!\ \ ]*)
7925 echo 9417 echo
7926 » if test "X$deplibs_check_method" = "Xnone"; then 9418 » if test none = "$deplibs_check_method"; then
7927 echo "*** Warning: inter-library dependencies are not supported in this platform." 9419 echo "*** Warning: inter-library dependencies are not supported in this platform."
7928 else 9420 else
7929 echo "*** Warning: inter-library dependencies are not known to be supported." 9421 echo "*** Warning: inter-library dependencies are not known to be supported."
7930 fi 9422 fi
7931 echo "*** All declared inter-library dependencies are being dropped. " 9423 echo "*** All declared inter-library dependencies are being dropped. "
7932 droppeddeps=yes 9424 droppeddeps=yes
7933 ;; 9425 ;;
7934 esac 9426 esac
7935 ;; 9427 ;;
7936 esac 9428 esac
7937 versuffix=$versuffix_save 9429 versuffix=$versuffix_save
7938 major=$major_save 9430 major=$major_save
7939 release=$release_save 9431 release=$release_save
7940 libname=$libname_save 9432 libname=$libname_save
7941 name=$name_save 9433 name=$name_save
7942 9434
7943 case $host in 9435 case $host in
7944 *-*-rhapsody* | *-*-darwin1.[012]) 9436 *-*-rhapsody* | *-*-darwin1.[012])
7945 # On Rhapsody replace the C library with the System framework 9437 # On Rhapsody replace the C library with the System framework
7946 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework / '` 9438 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework / '`
7947 ;; 9439 ;;
7948 esac 9440 esac
7949 9441
7950 » if test "$droppeddeps" = yes; then 9442 » if test yes = "$droppeddeps"; then
7951 » if test "$module" = yes; then 9443 » if test yes = "$module"; then
7952 echo 9444 echo
7953 echo "*** Warning: libtool could not satisfy all declared inter-libr ary" 9445 echo "*** Warning: libtool could not satisfy all declared inter-libr ary"
7954 $ECHO "*** dependencies of module $libname. Therefore, libtool will create" 9446 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
7955 echo "*** a static module, that should work as long as the dlopening " 9447 echo "*** a static module, that should work as long as the dlopening "
7956 echo "*** application is linked with the -dlopen flag." 9448 echo "*** application is linked with the -dlopen flag."
7957 if test -z "$global_symbol_pipe"; then 9449 if test -z "$global_symbol_pipe"; then
7958 echo 9450 echo
7959 echo "*** However, this would only work if libtool was able to ext ract symbol" 9451 echo "*** However, this would only work if libtool was able to ext ract symbol"
7960 » echo "*** lists from a program, using \`nm' or equivalent, but lib tool could" 9452 » echo "*** lists from a program, using 'nm' or equivalent, but libt ool could"
7961 echo "*** not find such a program. So, this module is probably us eless." 9453 echo "*** not find such a program. So, this module is probably us eless."
7962 » echo "*** \`nm' from GNU binutils and a full rebuild may help." 9454 » echo "*** 'nm' from GNU binutils and a full rebuild may help."
7963 fi 9455 fi
7964 » if test "$build_old_libs" = no; then 9456 » if test no = "$build_old_libs"; then
7965 » oldlibs="$output_objdir/$libname.$libext" 9457 » oldlibs=$output_objdir/$libname.$libext
7966 build_libtool_libs=module 9458 build_libtool_libs=module
7967 build_old_libs=yes 9459 build_old_libs=yes
7968 else 9460 else
7969 build_libtool_libs=no 9461 build_libtool_libs=no
7970 fi 9462 fi
7971 else 9463 else
7972 echo "*** The inter-library dependencies that have been dropped here will be" 9464 echo "*** The inter-library dependencies that have been dropped here will be"
7973 echo "*** automatically added whenever a program is linked with this library" 9465 echo "*** automatically added whenever a program is linked with this library"
7974 echo "*** or is declared to -dlopen it." 9466 echo "*** or is declared to -dlopen it."
7975 9467
7976 » if test "$allow_undefined" = no; then 9468 » if test no = "$allow_undefined"; then
7977 echo 9469 echo
7978 echo "*** Since this library must not contain undefined symbols," 9470 echo "*** Since this library must not contain undefined symbols,"
7979 echo "*** because either the platform does not support them or" 9471 echo "*** because either the platform does not support them or"
7980 echo "*** it was explicitly requested with -no-undefined," 9472 echo "*** it was explicitly requested with -no-undefined,"
7981 echo "*** libtool will only create a static version of it." 9473 echo "*** libtool will only create a static version of it."
7982 » if test "$build_old_libs" = no; then 9474 » if test no = "$build_old_libs"; then
7983 » » oldlibs="$output_objdir/$libname.$libext" 9475 » » oldlibs=$output_objdir/$libname.$libext
7984 build_libtool_libs=module 9476 build_libtool_libs=module
7985 build_old_libs=yes 9477 build_old_libs=yes
7986 else 9478 else
7987 build_libtool_libs=no 9479 build_libtool_libs=no
7988 fi 9480 fi
7989 fi 9481 fi
7990 fi 9482 fi
7991 fi 9483 fi
7992 # Done checking deplibs! 9484 # Done checking deplibs!
7993 deplibs=$newdeplibs 9485 deplibs=$newdeplibs
(...skipping 25 matching lines...) Expand all
8019 case $deplib in 9511 case $deplib in
8020 -L*) 9512 -L*)
8021 case " $new_libs " in 9513 case " $new_libs " in
8022 *" $deplib "*) ;; 9514 *" $deplib "*) ;;
8023 *) func_append new_libs " $deplib" ;; 9515 *) func_append new_libs " $deplib" ;;
8024 esac 9516 esac
8025 ;; 9517 ;;
8026 *) func_append new_libs " $deplib" ;; 9518 *) func_append new_libs " $deplib" ;;
8027 esac 9519 esac
8028 done 9520 done
8029 deplibs="$new_libs" 9521 deplibs=$new_libs
8030 9522
8031 # All the library-specific variables (install_libdir is set above). 9523 # All the library-specific variables (install_libdir is set above).
8032 library_names= 9524 library_names=
8033 old_library= 9525 old_library=
8034 dlname= 9526 dlname=
8035 9527
8036 # Test again, we may have decided not to build it any more 9528 # Test again, we may have decided not to build it any more
8037 if test "$build_libtool_libs" = yes; then 9529 if test yes = "$build_libtool_libs"; then
8038 » # Remove ${wl} instances when linking with ld. 9530 » # Remove $wl instances when linking with ld.
8039 # FIXME: should test the right _cmds variable. 9531 # FIXME: should test the right _cmds variable.
8040 case $archive_cmds in 9532 case $archive_cmds in
8041 *\$LD\ *) wl= ;; 9533 *\$LD\ *) wl= ;;
8042 esac 9534 esac
8043 » if test "$hardcode_into_libs" = yes; then 9535 » if test yes = "$hardcode_into_libs"; then
8044 # Hardcode the library paths 9536 # Hardcode the library paths
8045 hardcode_libdirs= 9537 hardcode_libdirs=
8046 dep_rpath= 9538 dep_rpath=
8047 » rpath="$finalize_rpath" 9539 » rpath=$finalize_rpath
8048 » test "$opt_mode" != relink && rpath="$compile_rpath$rpath" 9540 » test relink = "$opt_mode" || rpath=$compile_rpath$rpath
8049 for libdir in $rpath; do 9541 for libdir in $rpath; do
8050 if test -n "$hardcode_libdir_flag_spec"; then 9542 if test -n "$hardcode_libdir_flag_spec"; then
8051 if test -n "$hardcode_libdir_separator"; then 9543 if test -n "$hardcode_libdir_separator"; then
8052 func_replace_sysroot "$libdir" 9544 func_replace_sysroot "$libdir"
8053 libdir=$func_replace_sysroot_result 9545 libdir=$func_replace_sysroot_result
8054 if test -z "$hardcode_libdirs"; then 9546 if test -z "$hardcode_libdirs"; then
8055 » » hardcode_libdirs="$libdir" 9547 » » hardcode_libdirs=$libdir
8056 else 9548 else
8057 # Just accumulate the unique libdirs. 9549 # Just accumulate the unique libdirs.
8058 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libd ir_separator in 9550 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libd ir_separator in
8059 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator" *) 9551 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator" *)
8060 ;; 9552 ;;
8061 *) 9553 *)
8062 func_append hardcode_libdirs "$hardcode_libdir_separator$lib dir" 9554 func_append hardcode_libdirs "$hardcode_libdir_separator$lib dir"
8063 ;; 9555 ;;
8064 esac 9556 esac
8065 fi 9557 fi
8066 else 9558 else
8067 eval flag=\"$hardcode_libdir_flag_spec\" 9559 eval flag=\"$hardcode_libdir_flag_spec\"
8068 func_append dep_rpath " $flag" 9560 func_append dep_rpath " $flag"
8069 fi 9561 fi
8070 elif test -n "$runpath_var"; then 9562 elif test -n "$runpath_var"; then
8071 case "$perm_rpath " in 9563 case "$perm_rpath " in
8072 *" $libdir "*) ;; 9564 *" $libdir "*) ;;
8073 *) func_append perm_rpath " $libdir" ;; 9565 *) func_append perm_rpath " $libdir" ;;
8074 esac 9566 esac
8075 fi 9567 fi
8076 done 9568 done
8077 # Substitute the hardcoded libdirs into the rpath. 9569 # Substitute the hardcoded libdirs into the rpath.
8078 if test -n "$hardcode_libdir_separator" && 9570 if test -n "$hardcode_libdir_separator" &&
8079 test -n "$hardcode_libdirs"; then 9571 test -n "$hardcode_libdirs"; then
8080 » libdir="$hardcode_libdirs" 9572 » libdir=$hardcode_libdirs
8081 eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" 9573 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
8082 fi 9574 fi
8083 if test -n "$runpath_var" && test -n "$perm_rpath"; then 9575 if test -n "$runpath_var" && test -n "$perm_rpath"; then
8084 # We should set the runpath_var. 9576 # We should set the runpath_var.
8085 rpath= 9577 rpath=
8086 for dir in $perm_rpath; do 9578 for dir in $perm_rpath; do
8087 func_append rpath "$dir:" 9579 func_append rpath "$dir:"
8088 done 9580 done
8089 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" 9581 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
8090 fi 9582 fi
8091 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" 9583 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
8092 fi 9584 fi
8093 9585
8094 » shlibpath="$finalize_shlibpath" 9586 » shlibpath=$finalize_shlibpath
8095 » test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" 9587 » test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
8096 if test -n "$shlibpath"; then 9588 if test -n "$shlibpath"; then
8097 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_v ar" 9589 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_v ar"
8098 fi 9590 fi
8099 9591
8100 # Get the real and link names of the library. 9592 # Get the real and link names of the library.
8101 eval shared_ext=\"$shrext_cmds\" 9593 eval shared_ext=\"$shrext_cmds\"
8102 eval library_names=\"$library_names_spec\" 9594 eval library_names=\"$library_names_spec\"
8103 set dummy $library_names 9595 set dummy $library_names
8104 shift 9596 shift
8105 » realname="$1" 9597 » realname=$1
8106 shift 9598 shift
8107 9599
8108 if test -n "$soname_spec"; then 9600 if test -n "$soname_spec"; then
8109 eval soname=\"$soname_spec\" 9601 eval soname=\"$soname_spec\"
8110 else 9602 else
8111 » soname="$realname" 9603 » soname=$realname
8112 fi 9604 fi
8113 if test -z "$dlname"; then 9605 if test -z "$dlname"; then
8114 dlname=$soname 9606 dlname=$soname
8115 fi 9607 fi
8116 9608
8117 » lib="$output_objdir/$realname" 9609 » lib=$output_objdir/$realname
8118 linknames= 9610 linknames=
8119 for link 9611 for link
8120 do 9612 do
8121 func_append linknames " $link" 9613 func_append linknames " $link"
8122 done 9614 done
8123 9615
8124 # Use standard objects if they are pic 9616 # Use standard objects if they are pic
8125 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` 9617 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
8126 test "X$libobjs" = "X " && libobjs= 9618 test "X$libobjs" = "X " && libobjs=
8127 9619
8128 delfiles= 9620 delfiles=
8129 if test -n "$export_symbols" && test -n "$include_expsyms"; then 9621 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8130 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" 9622 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8131 » export_symbols="$output_objdir/$libname.uexp" 9623 » export_symbols=$output_objdir/$libname.uexp
8132 func_append delfiles " $export_symbols" 9624 func_append delfiles " $export_symbols"
8133 fi 9625 fi
8134 9626
8135 orig_export_symbols= 9627 orig_export_symbols=
8136 case $host_os in 9628 case $host_os in
8137 cygwin* | mingw* | cegcc*) 9629 cygwin* | mingw* | cegcc*)
8138 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then 9630 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
8139 # exporting using user supplied symfile 9631 # exporting using user supplied symfile
8140 » if test "x`$SED 1q $export_symbols`" != xEXPORTS; then 9632 » func_dll_def_p "$export_symbols" || {
8141 # and it's NOT already a .def file. Must figure out 9633 # and it's NOT already a .def file. Must figure out
8142 # which of the given symbols are data symbols and tag 9634 # which of the given symbols are data symbols and tag
8143 # them as such. So, trigger use of export_symbols_cmds. 9635 # them as such. So, trigger use of export_symbols_cmds.
8144 # export_symbols gets reassigned inside the "prepare 9636 # export_symbols gets reassigned inside the "prepare
8145 # the list of exported symbols" if statement, so the 9637 # the list of exported symbols" if statement, so the
8146 # include_expsyms logic still works. 9638 # include_expsyms logic still works.
8147 » orig_export_symbols="$export_symbols" 9639 » orig_export_symbols=$export_symbols
8148 export_symbols= 9640 export_symbols=
8149 always_export_symbols=yes 9641 always_export_symbols=yes
8150 » fi 9642 » }
8151 fi 9643 fi
8152 ;; 9644 ;;
8153 esac 9645 esac
8154 9646
8155 # Prepare the list of exported symbols 9647 # Prepare the list of exported symbols
8156 if test -z "$export_symbols"; then 9648 if test -z "$export_symbols"; then
8157 » if test "$always_export_symbols" = yes || test -n "$export_symbols_reg ex"; then 9649 » if test yes = "$always_export_symbols" || test -n "$export_symbols_reg ex"; then
8158 » func_verbose "generating symbol list for \`$libname.la'" 9650 » func_verbose "generating symbol list for '$libname.la'"
8159 » export_symbols="$output_objdir/$libname.exp" 9651 » export_symbols=$output_objdir/$libname.exp
8160 $opt_dry_run || $RM $export_symbols 9652 $opt_dry_run || $RM $export_symbols
8161 cmds=$export_symbols_cmds 9653 cmds=$export_symbols_cmds
8162 » save_ifs="$IFS"; IFS='~' 9654 » save_ifs=$IFS; IFS='~'
8163 for cmd1 in $cmds; do 9655 for cmd1 in $cmds; do
8164 » IFS="$save_ifs" 9656 » IFS=$save_ifs
8165 # Take the normal branch if the nm_file_list_spec branch 9657 # Take the normal branch if the nm_file_list_spec branch
8166 # doesn't work or if tool conversion is not needed. 9658 # doesn't work or if tool conversion is not needed.
8167 case $nm_file_list_spec~$to_tool_file_cmd in 9659 case $nm_file_list_spec~$to_tool_file_cmd in
8168 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) 9660 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
8169 try_normal_branch=yes 9661 try_normal_branch=yes
8170 eval cmd=\"$cmd1\" 9662 eval cmd=\"$cmd1\"
8171 func_len " $cmd" 9663 func_len " $cmd"
8172 len=$func_len_result 9664 len=$func_len_result
8173 ;; 9665 ;;
8174 *) 9666 *)
8175 try_normal_branch=no 9667 try_normal_branch=no
8176 ;; 9668 ;;
8177 esac 9669 esac
8178 » if test "$try_normal_branch" = yes \ 9670 » if test yes = "$try_normal_branch" \
8179 && { test "$len" -lt "$max_cmd_len" \ 9671 && { test "$len" -lt "$max_cmd_len" \
8180 || test "$max_cmd_len" -le -1; } 9672 || test "$max_cmd_len" -le -1; }
8181 then 9673 then
8182 func_show_eval "$cmd" 'exit $?' 9674 func_show_eval "$cmd" 'exit $?'
8183 skipped_export=false 9675 skipped_export=false
8184 elif test -n "$nm_file_list_spec"; then 9676 elif test -n "$nm_file_list_spec"; then
8185 func_basename "$output" 9677 func_basename "$output"
8186 output_la=$func_basename_result 9678 output_la=$func_basename_result
8187 save_libobjs=$libobjs 9679 save_libobjs=$libobjs
8188 save_output=$output 9680 save_output=$output
8189 » » output=${output_objdir}/${output_la}.nm 9681 » » output=$output_objdir/$output_la.nm
8190 func_to_tool_file "$output" 9682 func_to_tool_file "$output"
8191 libobjs=$nm_file_list_spec$func_to_tool_file_result 9683 libobjs=$nm_file_list_spec$func_to_tool_file_result
8192 func_append delfiles " $output" 9684 func_append delfiles " $output"
8193 func_verbose "creating $NM input file list: $output" 9685 func_verbose "creating $NM input file list: $output"
8194 for obj in $save_libobjs; do 9686 for obj in $save_libobjs; do
8195 func_to_tool_file "$obj" 9687 func_to_tool_file "$obj"
8196 $ECHO "$func_to_tool_file_result" 9688 $ECHO "$func_to_tool_file_result"
8197 done > "$output" 9689 done > "$output"
8198 eval cmd=\"$cmd1\" 9690 eval cmd=\"$cmd1\"
8199 func_show_eval "$cmd" 'exit $?' 9691 func_show_eval "$cmd" 'exit $?'
8200 output=$save_output 9692 output=$save_output
8201 libobjs=$save_libobjs 9693 libobjs=$save_libobjs
8202 skipped_export=false 9694 skipped_export=false
8203 else 9695 else
8204 # The command line is too long to execute in one step. 9696 # The command line is too long to execute in one step.
8205 func_verbose "using reloadable object file for export list..." 9697 func_verbose "using reloadable object file for export list..."
8206 skipped_export=: 9698 skipped_export=:
8207 # Break out early, otherwise skipped_export may be 9699 # Break out early, otherwise skipped_export may be
8208 # set to false by a later but shorter cmd. 9700 # set to false by a later but shorter cmd.
8209 break 9701 break
8210 fi 9702 fi
8211 done 9703 done
8212 » IFS="$save_ifs" 9704 » IFS=$save_ifs
8213 » if test -n "$export_symbols_regex" && test "X$skipped_export" != "X: "; then 9705 » if test -n "$export_symbols_regex" && test : != "$skipped_export"; t hen
8214 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols " > "${export_symbols}T"' 9706 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols " > "${export_symbols}T"'
8215 func_show_eval '$MV "${export_symbols}T" "$export_symbols"' 9707 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8216 fi 9708 fi
8217 fi 9709 fi
8218 fi 9710 fi
8219 9711
8220 if test -n "$export_symbols" && test -n "$include_expsyms"; then 9712 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8221 » tmp_export_symbols="$export_symbols" 9713 » tmp_export_symbols=$export_symbols
8222 » test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_sym bols" 9714 » test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symb ols
8223 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_expor t_symbols"' 9715 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_expor t_symbols"'
8224 fi 9716 fi
8225 9717
8226 » if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; th en 9718 » if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
8227 # The given exports_symbols file has to be filtered, so filter it. 9719 # The given exports_symbols file has to be filtered, so filter it.
8228 » func_verbose "filter symbol list for \`$libname.la' to tag DATA export s" 9720 » func_verbose "filter symbol list for '$libname.la' to tag DATA exports "
8229 # FIXME: $output_objdir/$libname.filter potentially contains lots of 9721 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8230 » # 's' commands which not all seds can handle. GNU sed should be fine 9722 » # 's' commands, which not all seds can handle. GNU sed should be fine
8231 # though. Also, the filter scales superlinearly with the number of 9723 # though. Also, the filter scales superlinearly with the number of
8232 # global variables. join(1) would be nice here, but unfortunately 9724 # global variables. join(1) would be nice here, but unfortunately
8233 # isn't a blessed tool. 9725 # isn't a blessed tool.
8234 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2| ,' < $export_symbols > $output_objdir/$libname.filter 9726 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2| ,' < $export_symbols > $output_objdir/$libname.filter
8235 func_append delfiles " $export_symbols $output_objdir/$libname.filter" 9727 func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8236 export_symbols=$output_objdir/$libname.def 9728 export_symbols=$output_objdir/$libname.def
8237 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_ symbols > $export_symbols 9729 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_ symbols > $export_symbols
8238 fi 9730 fi
8239 9731
8240 tmp_deplibs= 9732 tmp_deplibs=
8241 for test_deplib in $deplibs; do 9733 for test_deplib in $deplibs; do
8242 case " $convenience " in 9734 case " $convenience " in
8243 *" $test_deplib "*) ;; 9735 *" $test_deplib "*) ;;
8244 *) 9736 *)
8245 func_append tmp_deplibs " $test_deplib" 9737 func_append tmp_deplibs " $test_deplib"
8246 ;; 9738 ;;
8247 esac 9739 esac
8248 done 9740 done
8249 » deplibs="$tmp_deplibs" 9741 » deplibs=$tmp_deplibs
8250 9742
8251 if test -n "$convenience"; then 9743 if test -n "$convenience"; then
8252 if test -n "$whole_archive_flag_spec" && 9744 if test -n "$whole_archive_flag_spec" &&
8253 » test "$compiler_needs_object" = yes && 9745 » test yes = "$compiler_needs_object" &&
8254 test -z "$libobjs"; then 9746 test -z "$libobjs"; then
8255 # extract the archives, so we have objects to list. 9747 # extract the archives, so we have objects to list.
8256 # TODO: could optimize this to just extract one archive. 9748 # TODO: could optimize this to just extract one archive.
8257 whole_archive_flag_spec= 9749 whole_archive_flag_spec=
8258 fi 9750 fi
8259 if test -n "$whole_archive_flag_spec"; then 9751 if test -n "$whole_archive_flag_spec"; then
8260 save_libobjs=$libobjs 9752 save_libobjs=$libobjs
8261 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 9753 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8262 test "X$libobjs" = "X " && libobjs= 9754 test "X$libobjs" = "X " && libobjs=
8263 else 9755 else
8264 » gentop="$output_objdir/${outputname}x" 9756 » gentop=$output_objdir/${outputname}x
8265 func_append generated " $gentop" 9757 func_append generated " $gentop"
8266 9758
8267 func_extract_archives $gentop $convenience 9759 func_extract_archives $gentop $convenience
8268 func_append libobjs " $func_extract_archives_result" 9760 func_append libobjs " $func_extract_archives_result"
8269 test "X$libobjs" = "X " && libobjs= 9761 test "X$libobjs" = "X " && libobjs=
8270 fi 9762 fi
8271 fi 9763 fi
8272 9764
8273 » if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then 9765 » if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
8274 eval flag=\"$thread_safe_flag_spec\" 9766 eval flag=\"$thread_safe_flag_spec\"
8275 func_append linker_flags " $flag" 9767 func_append linker_flags " $flag"
8276 fi 9768 fi
8277 9769
8278 # Make a backup of the uninstalled library when relinking 9770 # Make a backup of the uninstalled library when relinking
8279 » if test "$opt_mode" = relink; then 9771 » if test relink = "$opt_mode"; then
8280 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $r ealname ${realname}U)' || exit $? 9772 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $r ealname ${realname}U)' || exit $?
8281 fi 9773 fi
8282 9774
8283 # Do each of the archive commands. 9775 # Do each of the archive commands.
8284 » if test "$module" = yes && test -n "$module_cmds" ; then 9776 » if test yes = "$module" && test -n "$module_cmds"; then
8285 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 9777 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8286 eval test_cmds=\"$module_expsym_cmds\" 9778 eval test_cmds=\"$module_expsym_cmds\"
8287 cmds=$module_expsym_cmds 9779 cmds=$module_expsym_cmds
8288 else 9780 else
8289 eval test_cmds=\"$module_cmds\" 9781 eval test_cmds=\"$module_cmds\"
8290 cmds=$module_cmds 9782 cmds=$module_cmds
8291 fi 9783 fi
8292 else 9784 else
8293 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 9785 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8294 eval test_cmds=\"$archive_expsym_cmds\" 9786 eval test_cmds=\"$archive_expsym_cmds\"
8295 cmds=$archive_expsym_cmds 9787 cmds=$archive_expsym_cmds
8296 else 9788 else
8297 eval test_cmds=\"$archive_cmds\" 9789 eval test_cmds=\"$archive_cmds\"
8298 cmds=$archive_cmds 9790 cmds=$archive_cmds
8299 fi 9791 fi
8300 fi 9792 fi
8301 9793
8302 » if test "X$skipped_export" != "X:" && 9794 » if test : != "$skipped_export" &&
8303 func_len " $test_cmds" && 9795 func_len " $test_cmds" &&
8304 len=$func_len_result && 9796 len=$func_len_result &&
8305 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then 9797 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8306 : 9798 :
8307 else 9799 else
8308 # The command line is too long to link in one step, link piecewise 9800 # The command line is too long to link in one step, link piecewise
8309 # or, if using GNU ld and skipped_export is not :, use a linker 9801 # or, if using GNU ld and skipped_export is not :, use a linker
8310 # script. 9802 # script.
8311 9803
8312 # Save the value of $output and $libobjs because we want to 9804 # Save the value of $output and $libobjs because we want to
(...skipping 12 matching lines...) Expand all
8325 output_la=$func_basename_result 9817 output_la=$func_basename_result
8326 9818
8327 # Clear the reloadable object creation command queue and 9819 # Clear the reloadable object creation command queue and
8328 # initialize k to one. 9820 # initialize k to one.
8329 test_cmds= 9821 test_cmds=
8330 concat_cmds= 9822 concat_cmds=
8331 objlist= 9823 objlist=
8332 last_robj= 9824 last_robj=
8333 k=1 9825 k=1
8334 9826
8335 » if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then 9827 » if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
8336 » output=${output_objdir}/${output_la}.lnkscript 9828 » output=$output_objdir/$output_la.lnkscript
8337 func_verbose "creating GNU ld script: $output" 9829 func_verbose "creating GNU ld script: $output"
8338 echo 'INPUT (' > $output 9830 echo 'INPUT (' > $output
8339 for obj in $save_libobjs 9831 for obj in $save_libobjs
8340 do 9832 do
8341 func_to_tool_file "$obj" 9833 func_to_tool_file "$obj"
8342 $ECHO "$func_to_tool_file_result" >> $output 9834 $ECHO "$func_to_tool_file_result" >> $output
8343 done 9835 done
8344 echo ')' >> $output 9836 echo ')' >> $output
8345 func_append delfiles " $output" 9837 func_append delfiles " $output"
8346 func_to_tool_file "$output" 9838 func_to_tool_file "$output"
8347 output=$func_to_tool_file_result 9839 output=$func_to_tool_file_result
8348 » elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && tes t "X$file_list_spec" != X; then 9840 » elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
8349 » output=${output_objdir}/${output_la}.lnk 9841 » output=$output_objdir/$output_la.lnk
8350 func_verbose "creating linker input file list: $output" 9842 func_verbose "creating linker input file list: $output"
8351 : > $output 9843 : > $output
8352 set x $save_libobjs 9844 set x $save_libobjs
8353 shift 9845 shift
8354 firstobj= 9846 firstobj=
8355 » if test "$compiler_needs_object" = yes; then 9847 » if test yes = "$compiler_needs_object"; then
8356 firstobj="$1 " 9848 firstobj="$1 "
8357 shift 9849 shift
8358 fi 9850 fi
8359 for obj 9851 for obj
8360 do 9852 do
8361 func_to_tool_file "$obj" 9853 func_to_tool_file "$obj"
8362 $ECHO "$func_to_tool_file_result" >> $output 9854 $ECHO "$func_to_tool_file_result" >> $output
8363 done 9855 done
8364 func_append delfiles " $output" 9856 func_append delfiles " $output"
8365 func_to_tool_file "$output" 9857 func_to_tool_file "$output"
8366 output=$firstobj\"$file_list_spec$func_to_tool_file_result\" 9858 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
8367 else 9859 else
8368 if test -n "$save_libobjs"; then 9860 if test -n "$save_libobjs"; then
8369 func_verbose "creating reloadable object files..." 9861 func_verbose "creating reloadable object files..."
8370 » output=$output_objdir/$output_la-${k}.$objext 9862 » output=$output_objdir/$output_la-$k.$objext
8371 eval test_cmds=\"$reload_cmds\" 9863 eval test_cmds=\"$reload_cmds\"
8372 func_len " $test_cmds" 9864 func_len " $test_cmds"
8373 len0=$func_len_result 9865 len0=$func_len_result
8374 len=$len0 9866 len=$len0
8375 9867
8376 # Loop over the list of objects to be linked. 9868 # Loop over the list of objects to be linked.
8377 for obj in $save_libobjs 9869 for obj in $save_libobjs
8378 do 9870 do
8379 func_len " $obj" 9871 func_len " $obj"
8380 func_arith $len + $func_len_result 9872 func_arith $len + $func_len_result
8381 len=$func_arith_result 9873 len=$func_arith_result
8382 » » if test "X$objlist" = X || 9874 » » if test -z "$objlist" ||
8383 test "$len" -lt "$max_cmd_len"; then 9875 test "$len" -lt "$max_cmd_len"; then
8384 func_append objlist " $obj" 9876 func_append objlist " $obj"
8385 else 9877 else
8386 # The command $test_cmds is almost too long, add a 9878 # The command $test_cmds is almost too long, add a
8387 # command to the queue. 9879 # command to the queue.
8388 » » if test "$k" -eq 1 ; then 9880 » » if test 1 -eq "$k"; then
8389 # The first file doesn't have a previous command to add. 9881 # The first file doesn't have a previous command to add.
8390 reload_objs=$objlist 9882 reload_objs=$objlist
8391 eval concat_cmds=\"$reload_cmds\" 9883 eval concat_cmds=\"$reload_cmds\"
8392 else 9884 else
8393 # All subsequent reloadable object files will link in 9885 # All subsequent reloadable object files will link in
8394 # the last one created. 9886 # the last one created.
8395 reload_objs="$objlist $last_robj" 9887 reload_objs="$objlist $last_robj"
8396 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_rob j\" 9888 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_rob j\"
8397 fi 9889 fi
8398 » » last_robj=$output_objdir/$output_la-${k}.$objext 9890 » » last_robj=$output_objdir/$output_la-$k.$objext
8399 func_arith $k + 1 9891 func_arith $k + 1
8400 k=$func_arith_result 9892 k=$func_arith_result
8401 » » output=$output_objdir/$output_la-${k}.$objext 9893 » » output=$output_objdir/$output_la-$k.$objext
8402 objlist=" $obj" 9894 objlist=" $obj"
8403 func_len " $last_robj" 9895 func_len " $last_robj"
8404 func_arith $len0 + $func_len_result 9896 func_arith $len0 + $func_len_result
8405 len=$func_arith_result 9897 len=$func_arith_result
8406 fi 9898 fi
8407 done 9899 done
8408 # Handle the remaining objects by creating one last 9900 # Handle the remaining objects by creating one last
8409 # reloadable object file. All subsequent reloadable object 9901 # reloadable object file. All subsequent reloadable object
8410 # files will link in the last one created. 9902 # files will link in the last one created.
8411 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 9903 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8412 reload_objs="$objlist $last_robj" 9904 reload_objs="$objlist $last_robj"
8413 » eval concat_cmds=\"\${concat_cmds}$reload_cmds\" 9905 » eval concat_cmds=\"\$concat_cmds$reload_cmds\"
8414 if test -n "$last_robj"; then 9906 if test -n "$last_robj"; then
8415 » eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" 9907 » eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8416 fi 9908 fi
8417 func_append delfiles " $output" 9909 func_append delfiles " $output"
8418 9910
8419 else 9911 else
8420 output= 9912 output=
8421 fi 9913 fi
8422 9914
8423 » if ${skipped_export-false}; then 9915 » ${skipped_export-false} && {
8424 » func_verbose "generating symbol list for \`$libname.la'" 9916 » func_verbose "generating symbol list for '$libname.la'"
8425 » export_symbols="$output_objdir/$libname.exp" 9917 » export_symbols=$output_objdir/$libname.exp
8426 $opt_dry_run || $RM $export_symbols 9918 $opt_dry_run || $RM $export_symbols
8427 libobjs=$output 9919 libobjs=$output
8428 # Append the command to create the export file. 9920 # Append the command to create the export file.
8429 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 9921 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8430 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" 9922 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
8431 if test -n "$last_robj"; then 9923 if test -n "$last_robj"; then
8432 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" 9924 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8433 fi 9925 fi
8434 » fi 9926 » }
8435 9927
8436 test -n "$save_libobjs" && 9928 test -n "$save_libobjs" &&
8437 func_verbose "creating a temporary reloadable object file: $output " 9929 func_verbose "creating a temporary reloadable object file: $output "
8438 9930
8439 # Loop through the commands generated above and execute them. 9931 # Loop through the commands generated above and execute them.
8440 » save_ifs="$IFS"; IFS='~' 9932 » save_ifs=$IFS; IFS='~'
8441 for cmd in $concat_cmds; do 9933 for cmd in $concat_cmds; do
8442 » IFS="$save_ifs" 9934 » IFS=$save_ifs
8443 » $opt_silent || { 9935 » $opt_quiet || {
8444 func_quote_for_expand "$cmd" 9936 func_quote_for_expand "$cmd"
8445 eval "func_echo $func_quote_for_expand_result" 9937 eval "func_echo $func_quote_for_expand_result"
8446 } 9938 }
8447 $opt_dry_run || eval "$cmd" || { 9939 $opt_dry_run || eval "$cmd" || {
8448 lt_exit=$? 9940 lt_exit=$?
8449 9941
8450 # Restore the uninstalled library and exit 9942 # Restore the uninstalled library and exit
8451 » » if test "$opt_mode" = relink; then 9943 » » if test relink = "$opt_mode"; then
8452 ( cd "$output_objdir" && \ 9944 ( cd "$output_objdir" && \
8453 $RM "${realname}T" && \ 9945 $RM "${realname}T" && \
8454 $MV "${realname}U" "$realname" ) 9946 $MV "${realname}U" "$realname" )
8455 fi 9947 fi
8456 9948
8457 exit $lt_exit 9949 exit $lt_exit
8458 } 9950 }
8459 done 9951 done
8460 » IFS="$save_ifs" 9952 » IFS=$save_ifs
8461 9953
8462 if test -n "$export_symbols_regex" && ${skipped_export-false}; then 9954 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8463 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols " > "${export_symbols}T"' 9955 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols " > "${export_symbols}T"'
8464 func_show_eval '$MV "${export_symbols}T" "$export_symbols"' 9956 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8465 fi 9957 fi
8466 fi 9958 fi
8467 9959
8468 if ${skipped_export-false}; then 9960 ${skipped_export-false} && {
8469 if test -n "$export_symbols" && test -n "$include_expsyms"; then 9961 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8470 » tmp_export_symbols="$export_symbols" 9962 » tmp_export_symbols=$export_symbols
8471 » test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export _symbols" 9963 » test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_ symbols
8472 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_e xport_symbols"' 9964 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_e xport_symbols"'
8473 fi 9965 fi
8474 9966
8475 if test -n "$orig_export_symbols"; then 9967 if test -n "$orig_export_symbols"; then
8476 # The given exports_symbols file has to be filtered, so filter it. 9968 # The given exports_symbols file has to be filtered, so filter it.
8477 » func_verbose "filter symbol list for \`$libname.la' to tag DATA ex ports" 9969 » func_verbose "filter symbol list for '$libname.la' to tag DATA exp orts"
8478 # FIXME: $output_objdir/$libname.filter potentially contains lots of 9970 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8479 » # 's' commands which not all seds can handle. GNU sed should be fi ne 9971 » # 's' commands, which not all seds can handle. GNU sed should be f ine
8480 # though. Also, the filter scales superlinearly with the number of 9972 # though. Also, the filter scales superlinearly with the number of
8481 # global variables. join(1) would be nice here, but unfortunately 9973 # global variables. join(1) would be nice here, but unfortunately
8482 # isn't a blessed tool. 9974 # isn't a blessed tool.
8483 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\ 1\2|,' < $export_symbols > $output_objdir/$libname.filter 9975 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\ 1\2|,' < $export_symbols > $output_objdir/$libname.filter
8484 func_append delfiles " $export_symbols $output_objdir/$libname.fil ter" 9976 func_append delfiles " $export_symbols $output_objdir/$libname.fil ter"
8485 export_symbols=$output_objdir/$libname.def 9977 export_symbols=$output_objdir/$libname.def
8486 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_exp ort_symbols > $export_symbols 9978 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_exp ort_symbols > $export_symbols
8487 fi 9979 fi
8488 » fi 9980 » }
8489 9981
8490 libobjs=$output 9982 libobjs=$output
8491 # Restore the value of output. 9983 # Restore the value of output.
8492 output=$save_output 9984 output=$save_output
8493 9985
8494 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then 9986 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
8495 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" 9987 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8496 test "X$libobjs" = "X " && libobjs= 9988 test "X$libobjs" = "X " && libobjs=
8497 fi 9989 fi
8498 # Expand the library linking commands again to reset the 9990 # Expand the library linking commands again to reset the
8499 # value of $libobjs for piecewise linking. 9991 # value of $libobjs for piecewise linking.
8500 9992
8501 # Do each of the archive commands. 9993 # Do each of the archive commands.
8502 » if test "$module" = yes && test -n "$module_cmds" ; then 9994 » if test yes = "$module" && test -n "$module_cmds"; then
8503 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then 9995 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8504 cmds=$module_expsym_cmds 9996 cmds=$module_expsym_cmds
8505 else 9997 else
8506 cmds=$module_cmds 9998 cmds=$module_cmds
8507 fi 9999 fi
8508 else 10000 else
8509 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then 10001 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8510 cmds=$archive_expsym_cmds 10002 cmds=$archive_expsym_cmds
8511 else 10003 else
8512 cmds=$archive_cmds 10004 cmds=$archive_cmds
8513 fi 10005 fi
8514 fi 10006 fi
8515 fi 10007 fi
8516 10008
8517 if test -n "$delfiles"; then 10009 if test -n "$delfiles"; then
8518 # Append the command to remove temporary files to $cmds. 10010 # Append the command to remove temporary files to $cmds.
8519 eval cmds=\"\$cmds~\$RM $delfiles\" 10011 eval cmds=\"\$cmds~\$RM $delfiles\"
8520 fi 10012 fi
8521 10013
8522 # Add any objects from preloaded convenience libraries 10014 # Add any objects from preloaded convenience libraries
8523 if test -n "$dlprefiles"; then 10015 if test -n "$dlprefiles"; then
8524 » gentop="$output_objdir/${outputname}x" 10016 » gentop=$output_objdir/${outputname}x
8525 func_append generated " $gentop" 10017 func_append generated " $gentop"
8526 10018
8527 func_extract_archives $gentop $dlprefiles 10019 func_extract_archives $gentop $dlprefiles
8528 func_append libobjs " $func_extract_archives_result" 10020 func_append libobjs " $func_extract_archives_result"
8529 test "X$libobjs" = "X " && libobjs= 10021 test "X$libobjs" = "X " && libobjs=
8530 fi 10022 fi
8531 10023
8532 » save_ifs="$IFS"; IFS='~' 10024 » save_ifs=$IFS; IFS='~'
8533 for cmd in $cmds; do 10025 for cmd in $cmds; do
8534 » IFS="$save_ifs" 10026 » IFS=$sp$nl
8535 eval cmd=\"$cmd\" 10027 eval cmd=\"$cmd\"
8536 » $opt_silent || { 10028 » IFS=$save_ifs
10029 » $opt_quiet || {
8537 func_quote_for_expand "$cmd" 10030 func_quote_for_expand "$cmd"
8538 eval "func_echo $func_quote_for_expand_result" 10031 eval "func_echo $func_quote_for_expand_result"
8539 } 10032 }
8540 $opt_dry_run || eval "$cmd" || { 10033 $opt_dry_run || eval "$cmd" || {
8541 lt_exit=$? 10034 lt_exit=$?
8542 10035
8543 # Restore the uninstalled library and exit 10036 # Restore the uninstalled library and exit
8544 » if test "$opt_mode" = relink; then 10037 » if test relink = "$opt_mode"; then
8545 ( cd "$output_objdir" && \ 10038 ( cd "$output_objdir" && \
8546 $RM "${realname}T" && \ 10039 $RM "${realname}T" && \
8547 $MV "${realname}U" "$realname" ) 10040 $MV "${realname}U" "$realname" )
8548 fi 10041 fi
8549 10042
8550 exit $lt_exit 10043 exit $lt_exit
8551 } 10044 }
8552 done 10045 done
8553 » IFS="$save_ifs" 10046 » IFS=$save_ifs
8554 10047
8555 # Restore the uninstalled library and exit 10048 # Restore the uninstalled library and exit
8556 » if test "$opt_mode" = relink; then 10049 » if test relink = "$opt_mode"; then
8557 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $r ealname ${realname}T && $MV ${realname}U $realname)' || exit $? 10050 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $r ealname ${realname}T && $MV ${realname}U $realname)' || exit $?
8558 10051
8559 if test -n "$convenience"; then 10052 if test -n "$convenience"; then
8560 if test -z "$whole_archive_flag_spec"; then 10053 if test -z "$whole_archive_flag_spec"; then
8561 func_show_eval '${RM}r "$gentop"' 10054 func_show_eval '${RM}r "$gentop"'
8562 fi 10055 fi
8563 fi 10056 fi
8564 10057
8565 exit $EXIT_SUCCESS 10058 exit $EXIT_SUCCESS
8566 fi 10059 fi
8567 10060
8568 # Create links to the real library. 10061 # Create links to the real library.
8569 for linkname in $linknames; do 10062 for linkname in $linknames; do
8570 if test "$realname" != "$linkname"; then 10063 if test "$realname" != "$linkname"; then
8571 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$r ealname" "$linkname")' 'exit $?' 10064 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$r ealname" "$linkname")' 'exit $?'
8572 fi 10065 fi
8573 done 10066 done
8574 10067
8575 # If -module or -export-dynamic was specified, set the dlname. 10068 # If -module or -export-dynamic was specified, set the dlname.
8576 » if test "$module" = yes || test "$export_dynamic" = yes; then 10069 » if test yes = "$module" || test yes = "$export_dynamic"; then
8577 # On all known operating systems, these are identical. 10070 # On all known operating systems, these are identical.
8578 » dlname="$soname" 10071 » dlname=$soname
8579 fi 10072 fi
8580 fi 10073 fi
8581 ;; 10074 ;;
8582 10075
8583 obj) 10076 obj)
8584 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then 10077 if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
8585 » func_warning "\`-dlopen' is ignored for objects" 10078 » func_warning "'-dlopen' is ignored for objects"
8586 fi 10079 fi
8587 10080
8588 case " $deplibs" in 10081 case " $deplibs" in
8589 *\ -l* | *\ -L*) 10082 *\ -l* | *\ -L*)
8590 » func_warning "\`-l' and \`-L' are ignored for objects" ;; 10083 » func_warning "'-l' and '-L' are ignored for objects" ;;
8591 esac 10084 esac
8592 10085
8593 test -n "$rpath" && \ 10086 test -n "$rpath" && \
8594 » func_warning "\`-rpath' is ignored for objects" 10087 » func_warning "'-rpath' is ignored for objects"
8595 10088
8596 test -n "$xrpath" && \ 10089 test -n "$xrpath" && \
8597 » func_warning "\`-R' is ignored for objects" 10090 » func_warning "'-R' is ignored for objects"
8598 10091
8599 test -n "$vinfo" && \ 10092 test -n "$vinfo" && \
8600 » func_warning "\`-version-info' is ignored for objects" 10093 » func_warning "'-version-info' is ignored for objects"
8601 10094
8602 test -n "$release" && \ 10095 test -n "$release" && \
8603 » func_warning "\`-release' is ignored for objects" 10096 » func_warning "'-release' is ignored for objects"
8604 10097
8605 case $output in 10098 case $output in
8606 *.lo) 10099 *.lo)
8607 test -n "$objs$old_deplibs" && \ 10100 test -n "$objs$old_deplibs" && \
8608 » func_fatal_error "cannot build library object \`$output' from non-libt ool objects" 10101 » func_fatal_error "cannot build library object '$output' from non-libto ol objects"
8609 10102
8610 libobj=$output 10103 libobj=$output
8611 func_lo2o "$libobj" 10104 func_lo2o "$libobj"
8612 obj=$func_lo2o_result 10105 obj=$func_lo2o_result
8613 ;; 10106 ;;
8614 *) 10107 *)
8615 libobj= 10108 libobj=
8616 » obj="$output" 10109 » obj=$output
8617 ;; 10110 ;;
8618 esac 10111 esac
8619 10112
8620 # Delete the old objects. 10113 # Delete the old objects.
8621 $opt_dry_run || $RM $obj $libobj 10114 $opt_dry_run || $RM $obj $libobj
8622 10115
8623 # Objects from convenience libraries. This assumes 10116 # Objects from convenience libraries. This assumes
8624 # single-version convenience libraries. Whenever we create 10117 # single-version convenience libraries. Whenever we create
8625 # different ones for PIC/non-PIC, this we'll have to duplicate 10118 # different ones for PIC/non-PIC, this we'll have to duplicate
8626 # the extraction. 10119 # the extraction.
8627 reload_conv_objs= 10120 reload_conv_objs=
8628 gentop= 10121 gentop=
8629 # reload_cmds runs $LD directly, so let us get rid of 10122 # if reload_cmds runs $LD directly, get rid of -Wl from
8630 # -Wl from whole_archive_flag_spec and hope we can get by with 10123 # whole_archive_flag_spec and hope we can get by with turning comma
8631 # turning comma into space.. 10124 # into space.
8632 wl= 10125 case $reload_cmds in
8633 10126 *\$LD[\ \$]*) wl= ;;
10127 esac
8634 if test -n "$convenience"; then 10128 if test -n "$convenience"; then
8635 if test -n "$whole_archive_flag_spec"; then 10129 if test -n "$whole_archive_flag_spec"; then
8636 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" 10130 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
8637 » reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SE D 's|,| |g'` 10131 » test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_fl ags" | $SED 's|,| |g'`
10132 » reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
8638 else 10133 else
8639 » gentop="$output_objdir/${obj}x" 10134 » gentop=$output_objdir/${obj}x
8640 func_append generated " $gentop" 10135 func_append generated " $gentop"
8641 10136
8642 func_extract_archives $gentop $convenience 10137 func_extract_archives $gentop $convenience
8643 reload_conv_objs="$reload_objs $func_extract_archives_result" 10138 reload_conv_objs="$reload_objs $func_extract_archives_result"
8644 fi 10139 fi
8645 fi 10140 fi
8646 10141
8647 # If we're not building shared, we need to use non_pic_objs 10142 # If we're not building shared, we need to use non_pic_objs
8648 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" 10143 test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
8649 10144
8650 # Create the old-style object. 10145 # Create the old-style object.
8651 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${li bext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip ne sted quoting test 10146 reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$lib ext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
8652 10147
8653 output="$obj" 10148 output=$obj
8654 func_execute_cmds "$reload_cmds" 'exit $?' 10149 func_execute_cmds "$reload_cmds" 'exit $?'
8655 10150
8656 # Exit if we aren't doing a library object file. 10151 # Exit if we aren't doing a library object file.
8657 if test -z "$libobj"; then 10152 if test -z "$libobj"; then
8658 if test -n "$gentop"; then 10153 if test -n "$gentop"; then
8659 func_show_eval '${RM}r "$gentop"' 10154 func_show_eval '${RM}r "$gentop"'
8660 fi 10155 fi
8661 10156
8662 exit $EXIT_SUCCESS 10157 exit $EXIT_SUCCESS
8663 fi 10158 fi
8664 10159
8665 if test "$build_libtool_libs" != yes; then 10160 test yes = "$build_libtool_libs" || {
8666 if test -n "$gentop"; then 10161 if test -n "$gentop"; then
8667 func_show_eval '${RM}r "$gentop"' 10162 func_show_eval '${RM}r "$gentop"'
8668 fi 10163 fi
8669 10164
8670 # Create an invalid libtool object if no PIC, so that we don't 10165 # Create an invalid libtool object if no PIC, so that we don't
8671 # accidentally link it into a program. 10166 # accidentally link it into a program.
8672 # $show "echo timestamp > $libobj" 10167 # $show "echo timestamp > $libobj"
8673 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? 10168 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
8674 exit $EXIT_SUCCESS 10169 exit $EXIT_SUCCESS
8675 fi 10170 }
8676 10171
8677 if test -n "$pic_flag" || test "$pic_mode" != default; then 10172 if test -n "$pic_flag" || test default != "$pic_mode"; then
8678 # Only do commands if we really have different PIC objects. 10173 # Only do commands if we really have different PIC objects.
8679 reload_objs="$libobjs $reload_conv_objs" 10174 reload_objs="$libobjs $reload_conv_objs"
8680 » output="$libobj" 10175 » output=$libobj
8681 func_execute_cmds "$reload_cmds" 'exit $?' 10176 func_execute_cmds "$reload_cmds" 'exit $?'
8682 fi 10177 fi
8683 10178
8684 if test -n "$gentop"; then 10179 if test -n "$gentop"; then
8685 func_show_eval '${RM}r "$gentop"' 10180 func_show_eval '${RM}r "$gentop"'
8686 fi 10181 fi
8687 10182
8688 exit $EXIT_SUCCESS 10183 exit $EXIT_SUCCESS
8689 ;; 10184 ;;
8690 10185
8691 prog) 10186 prog)
8692 case $host in 10187 case $host in
8693 *cygwin*) func_stripname '' '.exe' "$output" 10188 *cygwin*) func_stripname '' '.exe' "$output"
8694 output=$func_stripname_result.exe;; 10189 output=$func_stripname_result.exe;;
8695 esac 10190 esac
8696 test -n "$vinfo" && \ 10191 test -n "$vinfo" && \
8697 » func_warning "\`-version-info' is ignored for programs" 10192 » func_warning "'-version-info' is ignored for programs"
8698 10193
8699 test -n "$release" && \ 10194 test -n "$release" && \
8700 » func_warning "\`-release' is ignored for programs" 10195 » func_warning "'-release' is ignored for programs"
8701 10196
8702 test "$preload" = yes \ 10197 $preload \
8703 && test "$dlopen_support" = unknown \ 10198 » && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_ self_static" \
8704 » && test "$dlopen_self" = unknown \ 10199 » && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen suppor t."
8705 » && test "$dlopen_self_static" = unknown && \
8706 » func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen suppor t."
8707 10200
8708 case $host in 10201 case $host in
8709 *-*-rhapsody* | *-*-darwin1.[012]) 10202 *-*-rhapsody* | *-*-darwin1.[012])
8710 # On Rhapsody replace the C library is the System framework 10203 # On Rhapsody replace the C library is the System framework
8711 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltfra mework /'` 10204 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltfra mework /'`
8712 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltf ramework /'` 10205 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltf ramework /'`
8713 ;; 10206 ;;
8714 esac 10207 esac
8715 10208
8716 case $host in 10209 case $host in
8717 *-*-darwin*) 10210 *-*-darwin*)
8718 # Don't allow lazy linking, it breaks C++ global constructors 10211 # Don't allow lazy linking, it breaks C++ global constructors
8719 # But is supposedly fixed on 10.4 or later (yay!). 10212 # But is supposedly fixed on 10.4 or later (yay!).
8720 » if test "$tagname" = CXX ; then 10213 » if test CXX = "$tagname"; then
8721 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10214 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
8722 10.[0123]) 10215 10.[0123])
8723 » func_append compile_command " ${wl}-bind_at_load" 10216 » func_append compile_command " $wl-bind_at_load"
8724 » func_append finalize_command " ${wl}-bind_at_load" 10217 » func_append finalize_command " $wl-bind_at_load"
8725 ;; 10218 ;;
8726 esac 10219 esac
8727 fi 10220 fi
8728 # Time to change all our "foo.ltframework" stuff back to "-framework foo " 10221 # Time to change all our "foo.ltframework" stuff back to "-framework foo "
8729 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframe work% -framework \1%g'` 10222 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframe work% -framework \1%g'`
8730 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltfra mework% -framework \1%g'` 10223 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltfra mework% -framework \1%g'`
8731 ;; 10224 ;;
8732 esac 10225 esac
8733 10226
8734 10227
(...skipping 15 matching lines...) Expand all
8750 case $deplib in 10243 case $deplib in
8751 -L*) 10244 -L*)
8752 case " $new_libs " in 10245 case " $new_libs " in
8753 *" $deplib "*) ;; 10246 *" $deplib "*) ;;
8754 *) func_append new_libs " $deplib" ;; 10247 *) func_append new_libs " $deplib" ;;
8755 esac 10248 esac
8756 ;; 10249 ;;
8757 *) func_append new_libs " $deplib" ;; 10250 *) func_append new_libs " $deplib" ;;
8758 esac 10251 esac
8759 done 10252 done
8760 compile_deplibs="$new_libs" 10253 compile_deplibs=$new_libs
8761 10254
8762 10255
8763 func_append compile_command " $compile_deplibs" 10256 func_append compile_command " $compile_deplibs"
8764 func_append finalize_command " $finalize_deplibs" 10257 func_append finalize_command " $finalize_deplibs"
8765 10258
8766 if test -n "$rpath$xrpath"; then 10259 if test -n "$rpath$xrpath"; then
8767 # If the user specified any rpath flags, then add them. 10260 # If the user specified any rpath flags, then add them.
8768 for libdir in $rpath $xrpath; do 10261 for libdir in $rpath $xrpath; do
8769 # This is the magic to use -rpath. 10262 # This is the magic to use -rpath.
8770 case "$finalize_rpath " in 10263 case "$finalize_rpath " in
8771 *" $libdir "*) ;; 10264 *" $libdir "*) ;;
8772 *) func_append finalize_rpath " $libdir" ;; 10265 *) func_append finalize_rpath " $libdir" ;;
8773 esac 10266 esac
8774 done 10267 done
8775 fi 10268 fi
8776 10269
8777 # Now hardcode the library paths 10270 # Now hardcode the library paths
8778 rpath= 10271 rpath=
8779 hardcode_libdirs= 10272 hardcode_libdirs=
8780 for libdir in $compile_rpath $finalize_rpath; do 10273 for libdir in $compile_rpath $finalize_rpath; do
8781 if test -n "$hardcode_libdir_flag_spec"; then 10274 if test -n "$hardcode_libdir_flag_spec"; then
8782 if test -n "$hardcode_libdir_separator"; then 10275 if test -n "$hardcode_libdir_separator"; then
8783 if test -z "$hardcode_libdirs"; then 10276 if test -z "$hardcode_libdirs"; then
8784 » hardcode_libdirs="$libdir" 10277 » hardcode_libdirs=$libdir
8785 else 10278 else
8786 # Just accumulate the unique libdirs. 10279 # Just accumulate the unique libdirs.
8787 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_s eparator in 10280 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_s eparator in
8788 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 10281 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8789 ;; 10282 ;;
8790 *) 10283 *)
8791 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" 10284 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8792 ;; 10285 ;;
8793 esac 10286 esac
8794 fi 10287 fi
8795 else 10288 else
8796 eval flag=\"$hardcode_libdir_flag_spec\" 10289 eval flag=\"$hardcode_libdir_flag_spec\"
8797 func_append rpath " $flag" 10290 func_append rpath " $flag"
8798 fi 10291 fi
8799 elif test -n "$runpath_var"; then 10292 elif test -n "$runpath_var"; then
8800 case "$perm_rpath " in 10293 case "$perm_rpath " in
8801 *" $libdir "*) ;; 10294 *" $libdir "*) ;;
8802 *) func_append perm_rpath " $libdir" ;; 10295 *) func_append perm_rpath " $libdir" ;;
8803 esac 10296 esac
8804 fi 10297 fi
8805 case $host in 10298 case $host in
8806 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) 10299 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
8807 » testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` 10300 » testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
8808 case :$dllsearchpath: in 10301 case :$dllsearchpath: in
8809 *":$libdir:"*) ;; 10302 *":$libdir:"*) ;;
8810 ::) dllsearchpath=$libdir;; 10303 ::) dllsearchpath=$libdir;;
8811 *) func_append dllsearchpath ":$libdir";; 10304 *) func_append dllsearchpath ":$libdir";;
8812 esac 10305 esac
8813 case :$dllsearchpath: in 10306 case :$dllsearchpath: in
8814 *":$testbindir:"*) ;; 10307 *":$testbindir:"*) ;;
8815 ::) dllsearchpath=$testbindir;; 10308 ::) dllsearchpath=$testbindir;;
8816 *) func_append dllsearchpath ":$testbindir";; 10309 *) func_append dllsearchpath ":$testbindir";;
8817 esac 10310 esac
8818 ;; 10311 ;;
8819 esac 10312 esac
8820 done 10313 done
8821 # Substitute the hardcoded libdirs into the rpath. 10314 # Substitute the hardcoded libdirs into the rpath.
8822 if test -n "$hardcode_libdir_separator" && 10315 if test -n "$hardcode_libdir_separator" &&
8823 test -n "$hardcode_libdirs"; then 10316 test -n "$hardcode_libdirs"; then
8824 » libdir="$hardcode_libdirs" 10317 » libdir=$hardcode_libdirs
8825 eval rpath=\" $hardcode_libdir_flag_spec\" 10318 eval rpath=\" $hardcode_libdir_flag_spec\"
8826 fi 10319 fi
8827 compile_rpath="$rpath" 10320 compile_rpath=$rpath
8828 10321
8829 rpath= 10322 rpath=
8830 hardcode_libdirs= 10323 hardcode_libdirs=
8831 for libdir in $finalize_rpath; do 10324 for libdir in $finalize_rpath; do
8832 if test -n "$hardcode_libdir_flag_spec"; then 10325 if test -n "$hardcode_libdir_flag_spec"; then
8833 if test -n "$hardcode_libdir_separator"; then 10326 if test -n "$hardcode_libdir_separator"; then
8834 if test -z "$hardcode_libdirs"; then 10327 if test -z "$hardcode_libdirs"; then
8835 » hardcode_libdirs="$libdir" 10328 » hardcode_libdirs=$libdir
8836 else 10329 else
8837 # Just accumulate the unique libdirs. 10330 # Just accumulate the unique libdirs.
8838 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_s eparator in 10331 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_s eparator in
8839 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) 10332 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8840 ;; 10333 ;;
8841 *) 10334 *)
8842 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" 10335 func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8843 ;; 10336 ;;
8844 esac 10337 esac
8845 fi 10338 fi
8846 else 10339 else
8847 eval flag=\"$hardcode_libdir_flag_spec\" 10340 eval flag=\"$hardcode_libdir_flag_spec\"
8848 func_append rpath " $flag" 10341 func_append rpath " $flag"
8849 fi 10342 fi
8850 elif test -n "$runpath_var"; then 10343 elif test -n "$runpath_var"; then
8851 case "$finalize_perm_rpath " in 10344 case "$finalize_perm_rpath " in
8852 *" $libdir "*) ;; 10345 *" $libdir "*) ;;
8853 *) func_append finalize_perm_rpath " $libdir" ;; 10346 *) func_append finalize_perm_rpath " $libdir" ;;
8854 esac 10347 esac
8855 fi 10348 fi
8856 done 10349 done
8857 # Substitute the hardcoded libdirs into the rpath. 10350 # Substitute the hardcoded libdirs into the rpath.
8858 if test -n "$hardcode_libdir_separator" && 10351 if test -n "$hardcode_libdir_separator" &&
8859 test -n "$hardcode_libdirs"; then 10352 test -n "$hardcode_libdirs"; then
8860 » libdir="$hardcode_libdirs" 10353 » libdir=$hardcode_libdirs
8861 eval rpath=\" $hardcode_libdir_flag_spec\" 10354 eval rpath=\" $hardcode_libdir_flag_spec\"
8862 fi 10355 fi
8863 finalize_rpath="$rpath" 10356 finalize_rpath=$rpath
8864 10357
8865 if test -n "$libobjs" && test "$build_old_libs" = yes; then 10358 if test -n "$libobjs" && test yes = "$build_old_libs"; then
8866 # Transform all the library objects into standard objects. 10359 # Transform all the library objects into standard objects.
8867 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2 SP` 10360 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2 SP`
8868 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $N L2SP` 10361 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $N L2SP`
8869 fi 10362 fi
8870 10363
8871 func_generate_dlsyms "$outputname" "@PROGRAM@" "no" 10364 func_generate_dlsyms "$outputname" "@PROGRAM@" false
8872 10365
8873 # template prelinking step 10366 # template prelinking step
8874 if test -n "$prelink_cmds"; then 10367 if test -n "$prelink_cmds"; then
8875 func_execute_cmds "$prelink_cmds" 'exit $?' 10368 func_execute_cmds "$prelink_cmds" 'exit $?'
8876 fi 10369 fi
8877 10370
8878 wrappers_required=yes 10371 wrappers_required=:
8879 case $host in 10372 case $host in
8880 *cegcc* | *mingw32ce*) 10373 *cegcc* | *mingw32ce*)
8881 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. 10374 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
8882 wrappers_required=no 10375 wrappers_required=false
8883 ;; 10376 ;;
8884 *cygwin* | *mingw* ) 10377 *cygwin* | *mingw* )
8885 if test "$build_libtool_libs" != yes; then 10378 test yes = "$build_libtool_libs" || wrappers_required=false
8886 wrappers_required=no
8887 fi
8888 ;; 10379 ;;
8889 *) 10380 *)
8890 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then 10381 if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
8891 wrappers_required=no 10382 wrappers_required=false
8892 fi 10383 fi
8893 ;; 10384 ;;
8894 esac 10385 esac
8895 if test "$wrappers_required" = no; then 10386 $wrappers_required || {
8896 # Replace the output file specification. 10387 # Replace the output file specification.
8897 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"' %g'` 10388 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"' %g'`
8898 » link_command="$compile_command$compile_rpath" 10389 » link_command=$compile_command$compile_rpath
8899 10390
8900 # We have no uninstalled library dependencies, so finalize right now. 10391 # We have no uninstalled library dependencies, so finalize right now.
8901 exit_status=0 10392 exit_status=0
8902 func_show_eval "$link_command" 'exit_status=$?' 10393 func_show_eval "$link_command" 'exit_status=$?'
8903 10394
8904 if test -n "$postlink_cmds"; then 10395 if test -n "$postlink_cmds"; then
8905 func_to_tool_file "$output" 10396 func_to_tool_file "$output"
8906 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'" $output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` 10397 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'" $output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8907 func_execute_cmds "$postlink_cmds" 'exit $?' 10398 func_execute_cmds "$postlink_cmds" 'exit $?'
8908 fi 10399 fi
8909 10400
8910 # Delete the generated files. 10401 # Delete the generated files.
8911 » if test -f "$output_objdir/${outputname}S.${objext}"; then 10402 » if test -f "$output_objdir/${outputname}S.$objext"; then
8912 » func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' 10403 » func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
8913 fi 10404 fi
8914 10405
8915 exit $exit_status 10406 exit $exit_status
8916 fi 10407 }
8917 10408
8918 if test -n "$compile_shlibpath$finalize_shlibpath"; then 10409 if test -n "$compile_shlibpath$finalize_shlibpath"; then
8919 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\ $$shlibpath_var\" $compile_command" 10410 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\ $$shlibpath_var\" $compile_command"
8920 fi 10411 fi
8921 if test -n "$finalize_shlibpath"; then 10412 if test -n "$finalize_shlibpath"; then
8922 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" 10413 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
8923 fi 10414 fi
8924 10415
8925 compile_var= 10416 compile_var=
8926 finalize_var= 10417 finalize_var=
8927 if test -n "$runpath_var"; then 10418 if test -n "$runpath_var"; then
8928 if test -n "$perm_rpath"; then 10419 if test -n "$perm_rpath"; then
8929 # We should set the runpath_var. 10420 # We should set the runpath_var.
8930 rpath= 10421 rpath=
8931 for dir in $perm_rpath; do 10422 for dir in $perm_rpath; do
8932 func_append rpath "$dir:" 10423 func_append rpath "$dir:"
8933 done 10424 done
8934 compile_var="$runpath_var=\"$rpath\$$runpath_var\" " 10425 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
8935 fi 10426 fi
8936 if test -n "$finalize_perm_rpath"; then 10427 if test -n "$finalize_perm_rpath"; then
8937 # We should set the runpath_var. 10428 # We should set the runpath_var.
8938 rpath= 10429 rpath=
8939 for dir in $finalize_perm_rpath; do 10430 for dir in $finalize_perm_rpath; do
8940 func_append rpath "$dir:" 10431 func_append rpath "$dir:"
8941 done 10432 done
8942 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " 10433 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
8943 fi 10434 fi
8944 fi 10435 fi
8945 10436
8946 if test "$no_install" = yes; then 10437 if test yes = "$no_install"; then
8947 # We don't need to create a wrapper script. 10438 # We don't need to create a wrapper script.
8948 » link_command="$compile_var$compile_command$compile_rpath" 10439 » link_command=$compile_var$compile_command$compile_rpath
8949 # Replace the output file specification. 10440 # Replace the output file specification.
8950 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` 10441 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8951 # Delete the old output file. 10442 # Delete the old output file.
8952 $opt_dry_run || $RM $output 10443 $opt_dry_run || $RM $output
8953 # Link the executable and exit 10444 # Link the executable and exit
8954 func_show_eval "$link_command" 'exit $?' 10445 func_show_eval "$link_command" 'exit $?'
8955 10446
8956 if test -n "$postlink_cmds"; then 10447 if test -n "$postlink_cmds"; then
8957 func_to_tool_file "$output" 10448 func_to_tool_file "$output"
8958 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'" $output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` 10449 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'" $output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8959 func_execute_cmds "$postlink_cmds" 'exit $?' 10450 func_execute_cmds "$postlink_cmds" 'exit $?'
8960 fi 10451 fi
8961 10452
8962 exit $EXIT_SUCCESS 10453 exit $EXIT_SUCCESS
8963 fi 10454 fi
8964 10455
8965 if test "$hardcode_action" = relink; then 10456 case $hardcode_action,$fast_install in
8966 » # Fast installation is not supported 10457 relink,*)
8967 » link_command="$compile_var$compile_command$compile_rpath" 10458 » # Fast installation is not supported
8968 » relink_command="$finalize_var$finalize_command$finalize_rpath" 10459 » link_command=$compile_var$compile_command$compile_rpath
10460 » relink_command=$finalize_var$finalize_command$finalize_rpath
8969 10461
8970 » func_warning "this platform does not like uninstalled shared libraries" 10462 » func_warning "this platform does not like uninstalled shared libraries "
8971 » func_warning "\`$output' will be relinked during installation" 10463 » func_warning "'$output' will be relinked during installation"
8972 else 10464 » ;;
8973 » if test "$fast_install" != no; then 10465 *,yes)
8974 » link_command="$finalize_var$compile_command$finalize_rpath" 10466 » link_command=$finalize_var$compile_command$finalize_rpath
8975 » if test "$fast_install" = yes; then 10467 » relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $ SED 's%@OUTPUT@%\$progdir/\$file%g'`
8976 » relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` 10468 ;;
8977 » else 10469 » *,no)
8978 » # fast_install is set to needless 10470 » link_command=$compile_var$compile_command$compile_rpath
8979 » relink_command= 10471 » relink_command=$finalize_var$finalize_command$finalize_rpath
8980 » fi 10472 ;;
8981 » else 10473 » *,needless)
8982 » link_command="$compile_var$compile_command$compile_rpath" 10474 » link_command=$finalize_var$compile_command$finalize_rpath
8983 » relink_command="$finalize_var$finalize_command$finalize_rpath" 10475 » relink_command=
8984 » fi 10476 ;;
8985 fi 10477 esac
8986 10478
8987 # Replace the output file specification. 10479 # Replace the output file specification.
8988 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$o utputname"'%g'` 10480 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$o utputname"'%g'`
8989 10481
8990 # Delete the old output files. 10482 # Delete the old output files.
8991 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$ outputname 10483 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$ outputname
8992 10484
8993 func_show_eval "$link_command" 'exit $?' 10485 func_show_eval "$link_command" 'exit $?'
8994 10486
8995 if test -n "$postlink_cmds"; then 10487 if test -n "$postlink_cmds"; then
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
9032 exeext=.exe 10524 exeext=.exe
9033 func_stripname '' '.exe' "$outputname" 10525 func_stripname '' '.exe' "$outputname"
9034 outputname=$func_stripname_result ;; 10526 outputname=$func_stripname_result ;;
9035 *) exeext= ;; 10527 *) exeext= ;;
9036 esac 10528 esac
9037 case $host in 10529 case $host in
9038 *cygwin* | *mingw* ) 10530 *cygwin* | *mingw* )
9039 func_dirname_and_basename "$output" "" "." 10531 func_dirname_and_basename "$output" "" "."
9040 output_name=$func_basename_result 10532 output_name=$func_basename_result
9041 output_path=$func_dirname_result 10533 output_path=$func_dirname_result
9042 » cwrappersource="$output_path/$objdir/lt-$output_name.c" 10534 » cwrappersource=$output_path/$objdir/lt-$output_name.c
9043 » cwrapper="$output_path/$output_name.exe" 10535 » cwrapper=$output_path/$output_name.exe
9044 $RM $cwrappersource $cwrapper 10536 $RM $cwrappersource $cwrapper
9045 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 10537 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
9046 10538
9047 func_emit_cwrapperexe_src > $cwrappersource 10539 func_emit_cwrapperexe_src > $cwrappersource
9048 10540
9049 # The wrapper executable is built using the $host compiler, 10541 # The wrapper executable is built using the $host compiler,
9050 # because it contains $host paths and files. If cross- 10542 # because it contains $host paths and files. If cross-
9051 # compiling, it, like the target executable, must be 10543 # compiling, it, like the target executable, must be
9052 # executed on the $host or under an emulation environment. 10544 # executed on the $host or under an emulation environment.
9053 $opt_dry_run || { 10545 $opt_dry_run || {
9054 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource 10546 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
9055 $STRIP $cwrapper 10547 $STRIP $cwrapper
9056 } 10548 }
9057 10549
9058 # Now, create the wrapper script for func_source use: 10550 # Now, create the wrapper script for func_source use:
9059 func_ltwrapper_scriptname $cwrapper 10551 func_ltwrapper_scriptname $cwrapper
9060 $RM $func_ltwrapper_scriptname_result 10552 $RM $func_ltwrapper_scriptname_result
9061 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 10553 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
9062 $opt_dry_run || { 10554 $opt_dry_run || {
9063 # note: this script will not be executed, so do not chmod. 10555 # note: this script will not be executed, so do not chmod.
9064 » if test "x$build" = "x$host" ; then 10556 » if test "x$build" = "x$host"; then
9065 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result 10557 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
9066 else 10558 else
9067 func_emit_wrapper no > $func_ltwrapper_scriptname_result 10559 func_emit_wrapper no > $func_ltwrapper_scriptname_result
9068 fi 10560 fi
9069 } 10561 }
9070 ;; 10562 ;;
9071 * ) 10563 * )
9072 $RM $output 10564 $RM $output
9073 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 10565 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
9074 10566
9075 func_emit_wrapper no > $output 10567 func_emit_wrapper no > $output
9076 chmod +x $output 10568 chmod +x $output
9077 ;; 10569 ;;
9078 esac 10570 esac
9079 } 10571 }
9080 exit $EXIT_SUCCESS 10572 exit $EXIT_SUCCESS
9081 ;; 10573 ;;
9082 esac 10574 esac
9083 10575
9084 # See if we need to build an old-fashioned archive. 10576 # See if we need to build an old-fashioned archive.
9085 for oldlib in $oldlibs; do 10577 for oldlib in $oldlibs; do
9086 10578
9087 if test "$build_libtool_libs" = convenience; then 10579 case $build_libtool_libs in
9088 » oldobjs="$libobjs_save $symfileobj" 10580 convenience)
9089 » addlibs="$convenience" 10581 » oldobjs="$libobjs_save $symfileobj"
9090 » build_libtool_libs=no 10582 » addlibs=$convenience
9091 else
9092 » if test "$build_libtool_libs" = module; then
9093 » oldobjs="$libobjs_save"
9094 build_libtool_libs=no 10583 build_libtool_libs=no
9095 » else 10584 » ;;
10585 » module)
10586 » oldobjs=$libobjs_save
10587 » addlibs=$old_convenience
10588 » build_libtool_libs=no
10589 ;;
10590 » *)
9096 oldobjs="$old_deplibs $non_pic_objects" 10591 oldobjs="$old_deplibs $non_pic_objects"
9097 » if test "$preload" = yes && test -f "$symfileobj"; then 10592 » $preload && test -f "$symfileobj" \
9098 » func_append oldobjs " $symfileobj" 10593 » && func_append oldobjs " $symfileobj"
9099 » fi 10594 » addlibs=$old_convenience
9100 » fi 10595 » ;;
9101 » addlibs="$old_convenience" 10596 esac
9102 fi
9103 10597
9104 if test -n "$addlibs"; then 10598 if test -n "$addlibs"; then
9105 » gentop="$output_objdir/${outputname}x" 10599 » gentop=$output_objdir/${outputname}x
9106 func_append generated " $gentop" 10600 func_append generated " $gentop"
9107 10601
9108 func_extract_archives $gentop $addlibs 10602 func_extract_archives $gentop $addlibs
9109 func_append oldobjs " $func_extract_archives_result" 10603 func_append oldobjs " $func_extract_archives_result"
9110 fi 10604 fi
9111 10605
9112 # Do each command in the archive commands. 10606 # Do each command in the archive commands.
9113 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = ye s; then 10607 if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs "; then
9114 cmds=$old_archive_from_new_cmds 10608 cmds=$old_archive_from_new_cmds
9115 else 10609 else
9116 10610
9117 # Add any objects from preloaded convenience libraries 10611 # Add any objects from preloaded convenience libraries
9118 if test -n "$dlprefiles"; then 10612 if test -n "$dlprefiles"; then
9119 » gentop="$output_objdir/${outputname}x" 10613 » gentop=$output_objdir/${outputname}x
9120 func_append generated " $gentop" 10614 func_append generated " $gentop"
9121 10615
9122 func_extract_archives $gentop $dlprefiles 10616 func_extract_archives $gentop $dlprefiles
9123 func_append oldobjs " $func_extract_archives_result" 10617 func_append oldobjs " $func_extract_archives_result"
9124 fi 10618 fi
9125 10619
9126 # POSIX demands no paths to be encoded in archives. We have 10620 # POSIX demands no paths to be encoded in archives. We have
9127 # to avoid creating archives with duplicate basenames if we 10621 # to avoid creating archives with duplicate basenames if we
9128 # might have to extract them afterwards, e.g., when creating a 10622 # might have to extract them afterwards, e.g., when creating a
9129 # static archive out of a convenience library, or when linking 10623 # static archive out of a convenience library, or when linking
9130 # the entirety of a libtool archive into another (currently 10624 # the entirety of a libtool archive into another (currently
9131 # not supported by libtool). 10625 # not supported by libtool).
9132 if (for obj in $oldobjs 10626 if (for obj in $oldobjs
9133 do 10627 do
9134 func_basename "$obj" 10628 func_basename "$obj"
9135 $ECHO "$func_basename_result" 10629 $ECHO "$func_basename_result"
9136 done | sort | sort -uc >/dev/null 2>&1); then 10630 done | sort | sort -uc >/dev/null 2>&1); then
9137 : 10631 :
9138 else 10632 else
9139 echo "copying selected object files to avoid basename conflicts..." 10633 echo "copying selected object files to avoid basename conflicts..."
9140 » gentop="$output_objdir/${outputname}x" 10634 » gentop=$output_objdir/${outputname}x
9141 func_append generated " $gentop" 10635 func_append generated " $gentop"
9142 func_mkdir_p "$gentop" 10636 func_mkdir_p "$gentop"
9143 save_oldobjs=$oldobjs 10637 save_oldobjs=$oldobjs
9144 oldobjs= 10638 oldobjs=
9145 counter=1 10639 counter=1
9146 for obj in $save_oldobjs 10640 for obj in $save_oldobjs
9147 do 10641 do
9148 func_basename "$obj" 10642 func_basename "$obj"
9149 » objbase="$func_basename_result" 10643 » objbase=$func_basename_result
9150 case " $oldobjs " in 10644 case " $oldobjs " in
9151 " ") oldobjs=$obj ;; 10645 " ") oldobjs=$obj ;;
9152 *[\ /]"$objbase "*) 10646 *[\ /]"$objbase "*)
9153 while :; do 10647 while :; do
9154 # Make sure we don't pick an alternate name that also 10648 # Make sure we don't pick an alternate name that also
9155 # overlaps. 10649 # overlaps.
9156 newobj=lt$counter-$objbase 10650 newobj=lt$counter-$objbase
9157 func_arith $counter + 1 10651 func_arith $counter + 1
9158 counter=$func_arith_result 10652 counter=$func_arith_result
9159 case " $oldobjs " in 10653 case " $oldobjs " in
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
9208 do 10702 do
9209 func_len " $obj" 10703 func_len " $obj"
9210 func_arith $len + $func_len_result 10704 func_arith $len + $func_len_result
9211 len=$func_arith_result 10705 len=$func_arith_result
9212 func_append objlist " $obj" 10706 func_append objlist " $obj"
9213 if test "$len" -lt "$max_cmd_len"; then 10707 if test "$len" -lt "$max_cmd_len"; then
9214 : 10708 :
9215 else 10709 else
9216 # the above command should be used before it gets too long 10710 # the above command should be used before it gets too long
9217 oldobjs=$objlist 10711 oldobjs=$objlist
9218 » if test "$obj" = "$last_oldobj" ; then 10712 » if test "$obj" = "$last_oldobj"; then
9219 RANLIB=$save_RANLIB 10713 RANLIB=$save_RANLIB
9220 fi 10714 fi
9221 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ 10715 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9222 » eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" 10716 » eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
9223 objlist= 10717 objlist=
9224 len=$len0 10718 len=$len0
9225 fi 10719 fi
9226 done 10720 done
9227 RANLIB=$save_RANLIB 10721 RANLIB=$save_RANLIB
9228 oldobjs=$objlist 10722 oldobjs=$objlist
9229 » if test "X$oldobjs" = "X" ; then 10723 » if test -z "$oldobjs"; then
9230 eval cmds=\"\$concat_cmds\" 10724 eval cmds=\"\$concat_cmds\"
9231 else 10725 else
9232 eval cmds=\"\$concat_cmds~\$old_archive_cmds\" 10726 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
9233 fi 10727 fi
9234 fi 10728 fi
9235 fi 10729 fi
9236 func_execute_cmds "$cmds" 'exit $?' 10730 func_execute_cmds "$cmds" 'exit $?'
9237 done 10731 done
9238 10732
9239 test -n "$generated" && \ 10733 test -n "$generated" && \
9240 func_show_eval "${RM}r$generated" 10734 func_show_eval "${RM}r$generated"
9241 10735
9242 # Now create the libtool archive. 10736 # Now create the libtool archive.
9243 case $output in 10737 case $output in
9244 *.la) 10738 *.la)
9245 old_library= 10739 old_library=
9246 test "$build_old_libs" = yes && old_library="$libname.$libext" 10740 test yes = "$build_old_libs" && old_library=$libname.$libext
9247 func_verbose "creating $output" 10741 func_verbose "creating $output"
9248 10742
9249 # Preserve any variables that may affect compiler behavior 10743 # Preserve any variables that may affect compiler behavior
9250 for var in $variables_saved_for_relink; do 10744 for var in $variables_saved_for_relink; do
9251 if eval test -z \"\${$var+set}\"; then 10745 if eval test -z \"\${$var+set}\"; then
9252 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var =; export $var; }; }; $relink_command" 10746 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var =; export $var; }; }; $relink_command"
9253 elif eval var_value=\$$var; test -z "$var_value"; then 10747 elif eval var_value=\$$var; test -z "$var_value"; then
9254 relink_command="$var=; export $var; $relink_command" 10748 relink_command="$var=; export $var; $relink_command"
9255 else 10749 else
9256 func_quote_for_eval "$var_value" 10750 func_quote_for_eval "$var_value"
9257 relink_command="$var=$func_quote_for_eval_result; export $var; $relink _command" 10751 relink_command="$var=$func_quote_for_eval_result; export $var; $relink _command"
9258 fi 10752 fi
9259 done 10753 done
9260 # Quote the link command for shipping. 10754 # Quote the link command for shipping.
9261 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $ libtool_args @inst_prefix_dir@)" 10755 relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=reli nk $libtool_args @inst_prefix_dir@)"
9262 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` 10756 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9263 if test "$hardcode_automatic" = yes ; then 10757 if test yes = "$hardcode_automatic"; then
9264 relink_command= 10758 relink_command=
9265 fi 10759 fi
9266 10760
9267 # Only create the output if not a dry run. 10761 # Only create the output if not a dry run.
9268 $opt_dry_run || { 10762 $opt_dry_run || {
9269 for installed in no yes; do 10763 for installed in no yes; do
9270 » if test "$installed" = yes; then 10764 » if test yes = "$installed"; then
9271 if test -z "$install_libdir"; then 10765 if test -z "$install_libdir"; then
9272 break 10766 break
9273 fi 10767 fi
9274 » output="$output_objdir/$outputname"i 10768 » output=$output_objdir/${outputname}i
9275 # Replace all uninstalled libtool libraries with the installed ones 10769 # Replace all uninstalled libtool libraries with the installed ones
9276 newdependency_libs= 10770 newdependency_libs=
9277 for deplib in $dependency_libs; do 10771 for deplib in $dependency_libs; do
9278 case $deplib in 10772 case $deplib in
9279 *.la) 10773 *.la)
9280 func_basename "$deplib" 10774 func_basename "$deplib"
9281 » » name="$func_basename_result" 10775 » » name=$func_basename_result
9282 func_resolve_sysroot "$deplib" 10776 func_resolve_sysroot "$deplib"
9283 » » eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve _sysroot_result` 10777 » » eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_s ysroot_result`
9284 test -z "$libdir" && \ 10778 test -z "$libdir" && \
9285 » » func_fatal_error "\`$deplib' is not a valid libtool archive" 10779 » » func_fatal_error "'$deplib' is not a valid libtool archive"
9286 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" 10780 func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
9287 ;; 10781 ;;
9288 -L*) 10782 -L*)
9289 func_stripname -L '' "$deplib" 10783 func_stripname -L '' "$deplib"
9290 func_replace_sysroot "$func_stripname_result" 10784 func_replace_sysroot "$func_stripname_result"
9291 func_append newdependency_libs " -L$func_replace_sysroot_result" 10785 func_append newdependency_libs " -L$func_replace_sysroot_result"
9292 ;; 10786 ;;
9293 -R*) 10787 -R*)
9294 func_stripname -R '' "$deplib" 10788 func_stripname -R '' "$deplib"
9295 func_replace_sysroot "$func_stripname_result" 10789 func_replace_sysroot "$func_stripname_result"
9296 func_append newdependency_libs " -R$func_replace_sysroot_result" 10790 func_append newdependency_libs " -R$func_replace_sysroot_result"
9297 ;; 10791 ;;
9298 *) func_append newdependency_libs " $deplib" ;; 10792 *) func_append newdependency_libs " $deplib" ;;
9299 esac 10793 esac
9300 done 10794 done
9301 » dependency_libs="$newdependency_libs" 10795 » dependency_libs=$newdependency_libs
9302 newdlfiles= 10796 newdlfiles=
9303 10797
9304 for lib in $dlfiles; do 10798 for lib in $dlfiles; do
9305 case $lib in 10799 case $lib in
9306 *.la) 10800 *.la)
9307 func_basename "$lib" 10801 func_basename "$lib"
9308 » » name="$func_basename_result" 10802 » » name=$func_basename_result
9309 » » eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 10803 » » eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9310 test -z "$libdir" && \ 10804 test -z "$libdir" && \
9311 » » func_fatal_error "\`$lib' is not a valid libtool archive" 10805 » » func_fatal_error "'$lib' is not a valid libtool archive"
9312 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" 10806 func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
9313 ;; 10807 ;;
9314 *) func_append newdlfiles " $lib" ;; 10808 *) func_append newdlfiles " $lib" ;;
9315 esac 10809 esac
9316 done 10810 done
9317 » dlfiles="$newdlfiles" 10811 » dlfiles=$newdlfiles
9318 newdlprefiles= 10812 newdlprefiles=
9319 for lib in $dlprefiles; do 10813 for lib in $dlprefiles; do
9320 case $lib in 10814 case $lib in
9321 *.la) 10815 *.la)
9322 # Only pass preopened files to the pseudo-archive (for 10816 # Only pass preopened files to the pseudo-archive (for
9323 # eventual linking with the app. that links it) if we 10817 # eventual linking with the app. that links it) if we
9324 # didn't already link the preopened objects directly into 10818 # didn't already link the preopened objects directly into
9325 # the library: 10819 # the library:
9326 func_basename "$lib" 10820 func_basename "$lib"
9327 » » name="$func_basename_result" 10821 » » name=$func_basename_result
9328 » » eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` 10822 » » eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9329 test -z "$libdir" && \ 10823 test -z "$libdir" && \
9330 » » func_fatal_error "\`$lib' is not a valid libtool archive" 10824 » » func_fatal_error "'$lib' is not a valid libtool archive"
9331 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" 10825 func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
9332 ;; 10826 ;;
9333 esac 10827 esac
9334 done 10828 done
9335 » dlprefiles="$newdlprefiles" 10829 » dlprefiles=$newdlprefiles
9336 else 10830 else
9337 newdlfiles= 10831 newdlfiles=
9338 for lib in $dlfiles; do 10832 for lib in $dlfiles; do
9339 case $lib in 10833 case $lib in
9340 » » [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; 10834 » » [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
9341 *) abs=`pwd`"/$lib" ;; 10835 *) abs=`pwd`"/$lib" ;;
9342 esac 10836 esac
9343 func_append newdlfiles " $abs" 10837 func_append newdlfiles " $abs"
9344 done 10838 done
9345 » dlfiles="$newdlfiles" 10839 » dlfiles=$newdlfiles
9346 newdlprefiles= 10840 newdlprefiles=
9347 for lib in $dlprefiles; do 10841 for lib in $dlprefiles; do
9348 case $lib in 10842 case $lib in
9349 » » [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; 10843 » » [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
9350 *) abs=`pwd`"/$lib" ;; 10844 *) abs=`pwd`"/$lib" ;;
9351 esac 10845 esac
9352 func_append newdlprefiles " $abs" 10846 func_append newdlprefiles " $abs"
9353 done 10847 done
9354 » dlprefiles="$newdlprefiles" 10848 » dlprefiles=$newdlprefiles
9355 fi 10849 fi
9356 $RM $output 10850 $RM $output
9357 # place dlname in correct position for cygwin 10851 # place dlname in correct position for cygwin
9358 # In fact, it would be nice if we could use this code for all target 10852 # In fact, it would be nice if we could use this code for all target
9359 # systems that can't hard-code library paths into their executables 10853 # systems that can't hard-code library paths into their executables
9360 # and that have no shared library path variable independent of PATH, 10854 # and that have no shared library path variable independent of PATH,
9361 # but it turns out we can't easily determine that from inspecting 10855 # but it turns out we can't easily determine that from inspecting
9362 # libtool variables, so we have to hard-code the OSs to which it 10856 # libtool variables, so we have to hard-code the OSs to which it
9363 # applies here; at the moment, that means platforms that use the PE 10857 # applies here; at the moment, that means platforms that use the PE
9364 # object format with DLL files. See the long comment at the top of 10858 # object format with DLL files. See the long comment at the top of
9365 # tests/bindir.at for full details. 10859 # tests/bindir.at for full details.
9366 tdlname=$dlname 10860 tdlname=$dlname
9367 case $host,$output,$installed,$module,$dlname in 10861 case $host,$output,$installed,$module,$dlname in
9368 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*la i,yes,no,*.dll) 10862 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*la i,yes,no,*.dll)
9369 # If a -bindir argument was supplied, place the dll there. 10863 # If a -bindir argument was supplied, place the dll there.
9370 » if test "x$bindir" != x ; 10864 » if test -n "$bindir"; then
9371 » then
9372 func_relative_path "$install_libdir" "$bindir" 10865 func_relative_path "$install_libdir" "$bindir"
9373 » » tdlname=$func_relative_path_result$dlname 10866 » » tdlname=$func_relative_path_result/$dlname
9374 else 10867 else
9375 # Otherwise fall back on heuristic. 10868 # Otherwise fall back on heuristic.
9376 tdlname=../bin/$dlname 10869 tdlname=../bin/$dlname
9377 fi 10870 fi
9378 ;; 10871 ;;
9379 esac 10872 esac
9380 $ECHO > $output "\ 10873 $ECHO > $output "\
9381 # $outputname - a libtool library file 10874 # $outputname - a libtool library file
9382 # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION 10875 # Generated by $PROGRAM (GNU $PACKAGE) $VERSION
9383 # 10876 #
9384 # Please DO NOT delete this file! 10877 # Please DO NOT delete this file!
9385 # It is necessary for linking the library. 10878 # It is necessary for linking the library.
9386 10879
9387 # The name that we can dlopen(3). 10880 # The name that we can dlopen(3).
9388 dlname='$tdlname' 10881 dlname='$tdlname'
9389 10882
9390 # Names of this library. 10883 # Names of this library.
9391 library_names='$library_names' 10884 library_names='$library_names'
9392 10885
9393 # The name of the static archive. 10886 # The name of the static archive.
9394 old_library='$old_library' 10887 old_library='$old_library'
9395 10888
9396 # Linker flags that can not go in dependency_libs. 10889 # Linker flags that cannot go in dependency_libs.
9397 inherited_linker_flags='$new_inherited_linker_flags' 10890 inherited_linker_flags='$new_inherited_linker_flags'
9398 10891
9399 # Libraries that this one depends upon. 10892 # Libraries that this one depends upon.
9400 dependency_libs='$dependency_libs' 10893 dependency_libs='$dependency_libs'
9401 10894
9402 # Names of additional weak libraries provided by this library 10895 # Names of additional weak libraries provided by this library
9403 weak_library_names='$weak_libs' 10896 weak_library_names='$weak_libs'
9404 10897
9405 # Version information for $libname. 10898 # Version information for $libname.
9406 current=$current 10899 current=$current
9407 age=$age 10900 age=$age
9408 revision=$revision 10901 revision=$revision
9409 10902
9410 # Is this an already installed library? 10903 # Is this an already installed library?
9411 installed=$installed 10904 installed=$installed
9412 10905
9413 # Should we warn about portability when linking against -modules? 10906 # Should we warn about portability when linking against -modules?
9414 shouldnotlink=$module 10907 shouldnotlink=$module
9415 10908
9416 # Files to dlopen/dlpreopen 10909 # Files to dlopen/dlpreopen
9417 dlopen='$dlfiles' 10910 dlopen='$dlfiles'
9418 dlpreopen='$dlprefiles' 10911 dlpreopen='$dlprefiles'
9419 10912
9420 # Directory that this library needs to be installed in: 10913 # Directory that this library needs to be installed in:
9421 libdir='$install_libdir'" 10914 libdir='$install_libdir'"
9422 » if test "$installed" = no && test "$need_relink" = yes; then 10915 » if test no,yes = "$installed,$need_relink"; then
9423 $ECHO >> $output "\ 10916 $ECHO >> $output "\
9424 relink_command=\"$relink_command\"" 10917 relink_command=\"$relink_command\""
9425 fi 10918 fi
9426 done 10919 done
9427 } 10920 }
9428 10921
9429 # Do a symbolic link so that the libtool archive can be found in 10922 # Do a symbolic link so that the libtool archive can be found in
9430 # LD_LIBRARY_PATH before the program is installed. 10923 # LD_LIBRARY_PATH before the program is installed.
9431 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$o utputname" "$outputname" )' 'exit $?' 10924 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$o utputname" "$outputname" )' 'exit $?'
9432 ;; 10925 ;;
9433 esac 10926 esac
9434 exit $EXIT_SUCCESS 10927 exit $EXIT_SUCCESS
9435 } 10928 }
9436 10929
9437 { test "$opt_mode" = link || test "$opt_mode" = relink; } && 10930 if test link = "$opt_mode" || test relink = "$opt_mode"; then
9438 func_mode_link ${1+"$@"} 10931 func_mode_link ${1+"$@"}
10932 fi
9439 10933
9440 10934
9441 # func_mode_uninstall arg... 10935 # func_mode_uninstall arg...
9442 func_mode_uninstall () 10936 func_mode_uninstall ()
9443 { 10937 {
9444 $opt_debug 10938 $debug_cmd
9445 RM="$nonopt" 10939
10940 RM=$nonopt
9446 files= 10941 files=
9447 rmforce= 10942 rmforce=false
9448 exit_status=0 10943 exit_status=0
9449 10944
9450 # This variable tells wrapper scripts just to set variables rather 10945 # This variable tells wrapper scripts just to set variables rather
9451 # than running their programs. 10946 # than running their programs.
9452 libtool_install_magic="$magic" 10947 libtool_install_magic=$magic
9453 10948
9454 for arg 10949 for arg
9455 do 10950 do
9456 case $arg in 10951 case $arg in
9457 -f) func_append RM " $arg"; rmforce=yes ;; 10952 -f) func_append RM " $arg"; rmforce=: ;;
9458 -*) func_append RM " $arg" ;; 10953 -*) func_append RM " $arg" ;;
9459 *) func_append files " $arg" ;; 10954 *) func_append files " $arg" ;;
9460 esac 10955 esac
9461 done 10956 done
9462 10957
9463 test -z "$RM" && \ 10958 test -z "$RM" && \
9464 func_fatal_help "you must specify an RM program" 10959 func_fatal_help "you must specify an RM program"
9465 10960
9466 rmdirs= 10961 rmdirs=
9467 10962
9468 for file in $files; do 10963 for file in $files; do
9469 func_dirname "$file" "" "." 10964 func_dirname "$file" "" "."
9470 dir="$func_dirname_result" 10965 dir=$func_dirname_result
9471 if test "X$dir" = X.; then 10966 if test . = "$dir"; then
9472 » odir="$objdir" 10967 » odir=$objdir
9473 else 10968 else
9474 » odir="$dir/$objdir" 10969 » odir=$dir/$objdir
9475 fi 10970 fi
9476 func_basename "$file" 10971 func_basename "$file"
9477 name="$func_basename_result" 10972 name=$func_basename_result
9478 test "$opt_mode" = uninstall && odir="$dir" 10973 test uninstall = "$opt_mode" && odir=$dir
9479 10974
9480 # Remember odir for removal later, being careful to avoid duplicates 10975 # Remember odir for removal later, being careful to avoid duplicates
9481 if test "$opt_mode" = clean; then 10976 if test clean = "$opt_mode"; then
9482 case " $rmdirs " in 10977 case " $rmdirs " in
9483 *" $odir "*) ;; 10978 *" $odir "*) ;;
9484 *) func_append rmdirs " $odir" ;; 10979 *) func_append rmdirs " $odir" ;;
9485 esac 10980 esac
9486 fi 10981 fi
9487 10982
9488 # Don't error if the file doesn't exist and rm -f was used. 10983 # Don't error if the file doesn't exist and rm -f was used.
9489 if { test -L "$file"; } >/dev/null 2>&1 || 10984 if { test -L "$file"; } >/dev/null 2>&1 ||
9490 { test -h "$file"; } >/dev/null 2>&1 || 10985 { test -h "$file"; } >/dev/null 2>&1 ||
9491 test -f "$file"; then 10986 test -f "$file"; then
9492 : 10987 :
9493 elif test -d "$file"; then 10988 elif test -d "$file"; then
9494 exit_status=1 10989 exit_status=1
9495 continue 10990 continue
9496 elif test "$rmforce" = yes; then 10991 elif $rmforce; then
9497 continue 10992 continue
9498 fi 10993 fi
9499 10994
9500 rmfiles="$file" 10995 rmfiles=$file
9501 10996
9502 case $name in 10997 case $name in
9503 *.la) 10998 *.la)
9504 # Possibly a libtool archive, so verify it. 10999 # Possibly a libtool archive, so verify it.
9505 if func_lalib_p "$file"; then 11000 if func_lalib_p "$file"; then
9506 func_source $dir/$name 11001 func_source $dir/$name
9507 11002
9508 # Delete the libtool libraries and symlinks. 11003 # Delete the libtool libraries and symlinks.
9509 for n in $library_names; do 11004 for n in $library_names; do
9510 func_append rmfiles " $odir/$n" 11005 func_append rmfiles " $odir/$n"
9511 done 11006 done
9512 test -n "$old_library" && func_append rmfiles " $odir/$old_library" 11007 test -n "$old_library" && func_append rmfiles " $odir/$old_library"
9513 11008
9514 » case "$opt_mode" in 11009 » case $opt_mode in
9515 clean) 11010 clean)
9516 case " $library_names " in 11011 case " $library_names " in
9517 *" $dlname "*) ;; 11012 *" $dlname "*) ;;
9518 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; 11013 *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
9519 esac 11014 esac
9520 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name} i" 11015 test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name} i"
9521 ;; 11016 ;;
9522 uninstall) 11017 uninstall)
9523 if test -n "$library_names"; then 11018 if test -n "$library_names"; then
9524 # Do each command in the postuninstall commands. 11019 # Do each command in the postuninstall commands.
9525 » func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' 11020 » func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1 '
9526 fi 11021 fi
9527 11022
9528 if test -n "$old_library"; then 11023 if test -n "$old_library"; then
9529 # Do each command in the old_postuninstall commands. 11024 # Do each command in the old_postuninstall commands.
9530 » func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' 11025 » func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_stat us=1'
9531 fi 11026 fi
9532 # FIXME: should reinstall the best remaining shared library. 11027 # FIXME: should reinstall the best remaining shared library.
9533 ;; 11028 ;;
9534 esac 11029 esac
9535 fi 11030 fi
9536 ;; 11031 ;;
9537 11032
9538 *.lo) 11033 *.lo)
9539 # Possibly a libtool object, so verify it. 11034 # Possibly a libtool object, so verify it.
9540 if func_lalib_p "$file"; then 11035 if func_lalib_p "$file"; then
9541 11036
9542 # Read the .lo file 11037 # Read the .lo file
9543 func_source $dir/$name 11038 func_source $dir/$name
9544 11039
9545 # Add PIC object to the list of files to remove. 11040 # Add PIC object to the list of files to remove.
9546 » if test -n "$pic_object" && 11041 » if test -n "$pic_object" && test none != "$pic_object"; then
9547 » test "$pic_object" != none; then
9548 func_append rmfiles " $dir/$pic_object" 11042 func_append rmfiles " $dir/$pic_object"
9549 fi 11043 fi
9550 11044
9551 # Add non-PIC object to the list of files to remove. 11045 # Add non-PIC object to the list of files to remove.
9552 » if test -n "$non_pic_object" && 11046 » if test -n "$non_pic_object" && test none != "$non_pic_object"; then
9553 » test "$non_pic_object" != none; then
9554 func_append rmfiles " $dir/$non_pic_object" 11047 func_append rmfiles " $dir/$non_pic_object"
9555 fi 11048 fi
9556 fi 11049 fi
9557 ;; 11050 ;;
9558 11051
9559 *) 11052 *)
9560 » if test "$opt_mode" = clean ; then 11053 » if test clean = "$opt_mode"; then
9561 noexename=$name 11054 noexename=$name
9562 case $file in 11055 case $file in
9563 *.exe) 11056 *.exe)
9564 func_stripname '' '.exe' "$file" 11057 func_stripname '' '.exe' "$file"
9565 file=$func_stripname_result 11058 file=$func_stripname_result
9566 func_stripname '' '.exe' "$name" 11059 func_stripname '' '.exe' "$name"
9567 noexename=$func_stripname_result 11060 noexename=$func_stripname_result
9568 # $file with .exe has already been added to rmfiles, 11061 # $file with .exe has already been added to rmfiles,
9569 # add $file without .exe 11062 # add $file without .exe
9570 func_append rmfiles " $file" 11063 func_append rmfiles " $file"
9571 ;; 11064 ;;
9572 esac 11065 esac
9573 # Do a test to see if this is a libtool program. 11066 # Do a test to see if this is a libtool program.
9574 if func_ltwrapper_p "$file"; then 11067 if func_ltwrapper_p "$file"; then
9575 if func_ltwrapper_executable_p "$file"; then 11068 if func_ltwrapper_executable_p "$file"; then
9576 func_ltwrapper_scriptname "$file" 11069 func_ltwrapper_scriptname "$file"
9577 relink_command= 11070 relink_command=
9578 func_source $func_ltwrapper_scriptname_result 11071 func_source $func_ltwrapper_scriptname_result
9579 func_append rmfiles " $func_ltwrapper_scriptname_result" 11072 func_append rmfiles " $func_ltwrapper_scriptname_result"
9580 else 11073 else
9581 relink_command= 11074 relink_command=
9582 func_source $dir/$noexename 11075 func_source $dir/$noexename
9583 fi 11076 fi
9584 11077
9585 # note $name still contains .exe if it was in $file originally 11078 # note $name still contains .exe if it was in $file originally
9586 # as does the version of $file that was added into $rmfiles 11079 # as does the version of $file that was added into $rmfiles
9587 » func_append rmfiles " $odir/$name $odir/${name}S.${objext}" 11080 » func_append rmfiles " $odir/$name $odir/${name}S.$objext"
9588 » if test "$fast_install" = yes && test -n "$relink_command"; then 11081 » if test yes = "$fast_install" && test -n "$relink_command"; then
9589 func_append rmfiles " $odir/lt-$name" 11082 func_append rmfiles " $odir/lt-$name"
9590 fi 11083 fi
9591 » if test "X$noexename" != "X$name" ; then 11084 » if test "X$noexename" != "X$name"; then
9592 » func_append rmfiles " $odir/lt-${noexename}.c" 11085 » func_append rmfiles " $odir/lt-$noexename.c"
9593 fi 11086 fi
9594 fi 11087 fi
9595 fi 11088 fi
9596 ;; 11089 ;;
9597 esac 11090 esac
9598 func_show_eval "$RM $rmfiles" 'exit_status=1' 11091 func_show_eval "$RM $rmfiles" 'exit_status=1'
9599 done 11092 done
9600 11093
9601 # Try to remove the ${objdir}s in the directories where we deleted files 11094 # Try to remove the $objdir's in the directories where we deleted files
9602 for dir in $rmdirs; do 11095 for dir in $rmdirs; do
9603 if test -d "$dir"; then 11096 if test -d "$dir"; then
9604 func_show_eval "rmdir $dir >/dev/null 2>&1" 11097 func_show_eval "rmdir $dir >/dev/null 2>&1"
9605 fi 11098 fi
9606 done 11099 done
9607 11100
9608 exit $exit_status 11101 exit $exit_status
9609 } 11102 }
9610 11103
9611 { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && 11104 if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
9612 func_mode_uninstall ${1+"$@"} 11105 func_mode_uninstall ${1+"$@"}
11106 fi
9613 11107
9614 test -z "$opt_mode" && { 11108 test -z "$opt_mode" && {
9615 help="$generic_help" 11109 help=$generic_help
9616 func_fatal_help "you must specify a MODE" 11110 func_fatal_help "you must specify a MODE"
9617 } 11111 }
9618 11112
9619 test -z "$exec_cmd" && \ 11113 test -z "$exec_cmd" && \
9620 func_fatal_help "invalid operation mode \`$opt_mode'" 11114 func_fatal_help "invalid operation mode '$opt_mode'"
9621 11115
9622 if test -n "$exec_cmd"; then 11116 if test -n "$exec_cmd"; then
9623 eval exec "$exec_cmd" 11117 eval exec "$exec_cmd"
9624 exit $EXIT_FAILURE 11118 exit $EXIT_FAILURE
9625 fi 11119 fi
9626 11120
9627 exit $exit_status 11121 exit $exit_status
9628 11122
9629 11123
9630 # The TAGs below are defined such that we never get into a situation 11124 # The TAGs below are defined such that we never get into a situation
9631 # in which we disable both kinds of libraries. Given conflicting 11125 # where we disable both kinds of libraries. Given conflicting
9632 # choices, we go for a static library, that is the most portable, 11126 # choices, we go for a static library, that is the most portable,
9633 # since we can't tell whether shared libraries were disabled because 11127 # since we can't tell whether shared libraries were disabled because
9634 # the user asked for that or because the platform doesn't support 11128 # the user asked for that or because the platform doesn't support
9635 # them. This is particularly important on AIX, because we don't 11129 # them. This is particularly important on AIX, because we don't
9636 # support having both static and shared libraries enabled at the same 11130 # support having both static and shared libraries enabled at the same
9637 # time on that platform, so we default to a shared-only configuration. 11131 # time on that platform, so we default to a shared-only configuration.
9638 # If a disable-shared tag is given, we'll fallback to a static-only 11132 # If a disable-shared tag is given, we'll fallback to a static-only
9639 # configuration. But we'll never go from static-only to shared-only. 11133 # configuration. But we'll never go from static-only to shared-only.
9640 11134
9641 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared 11135 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
9642 build_libtool_libs=no 11136 build_libtool_libs=no
9643 build_old_libs=yes 11137 build_old_libs=yes
9644 # ### END LIBTOOL TAG CONFIG: disable-shared 11138 # ### END LIBTOOL TAG CONFIG: disable-shared
9645 11139
9646 # ### BEGIN LIBTOOL TAG CONFIG: disable-static 11140 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
9647 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` 11141 build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
9648 # ### END LIBTOOL TAG CONFIG: disable-static 11142 # ### END LIBTOOL TAG CONFIG: disable-static
9649 11143
9650 # Local Variables: 11144 # Local Variables:
9651 # mode:shell-script 11145 # mode:shell-script
9652 # sh-indentation:2 11146 # sh-indentation:2
9653 # End: 11147 # End:
9654 # vi:sw=2
9655
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698