~ubuntu-branches/ubuntu/wily/baobab/wily-proposed

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Package Import Robot
  • Author(s): Jackson Doak
  • Date: 2014-10-15 23:15:13 UTC
  • mfrom: (2.2.1 experimental) (2.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20141015231513-6cpun88orgfpyzdv
Tags: 3.14.1-1ubuntu1
* Merge from Debian unstable. (LP: #1268721) Remaining changes:
* debian/patches/use_traditional_titlebars_in_unity.patch:
  - Use the traditional menubar under Unity
* debian/patches/git_fix_pie_chart.patch:
  - Fx top level pie chart. (LP: #1393333)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
# libtool (GNU libtool) 2.4.2
3
 
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4
 
 
5
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
6
 
# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
7
 
# This is free software; see the source for copying conditions.  There is NO
8
 
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
 
 
10
 
# GNU Libtool is free software; you can redistribute it and/or modify
11
 
# it under the terms of the GNU General Public License as published by
12
 
# the Free Software Foundation; either version 2 of the License, or
13
 
# (at your option) any later version.
14
 
#
15
 
# As a special exception to the GNU General Public License,
16
 
# 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
18
 
# same distribution terms that you use for the rest of that program.
19
 
#
20
 
# GNU Libtool is distributed in the hope that it will be useful, but
21
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
22
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23
 
# General Public License for more details.
24
 
#
25
 
# 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
27
 
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
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
 
 
81
 
PROGRAM=libtool
82
 
PACKAGE=libtool
83
 
VERSION=2.4.2
84
 
TIMESTAMP=""
85
 
: ${DD=dd}
86
 
package_revision=1.3337
87
 
 
88
 
# Be Bourne compatible
89
 
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
90
 
  emulate sh
91
 
  NULLCMD=:
92
 
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
93
 
  # is contrary to our usage.  Disable this feature.
94
 
  alias -g '${1+"$@"}'='"$@"'
95
 
  setopt NO_GLOB_SUBST
96
 
else
97
 
  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
98
 
fi
99
 
BIN_SH=xpg4; export BIN_SH # for Tru64
100
 
DUALCASE=1; export DUALCASE # for MKS sh
101
 
 
102
 
# A function that is used when there is no print builtin or printf.
103
 
func_fallback_echo ()
104
 
{
105
 
  eval 'cat <<_LTECHO_EOF
106
 
$1
107
 
_LTECHO_EOF'
108
 
}
109
 
 
110
 
# NLS nuisances: We save the old values to restore during execute mode.
111
 
lt_user_locale=
112
 
lt_safe_locale=
113
 
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
114
 
do
115
 
  eval "if test \"\${$lt_var+set}\" = set; then
116
 
          save_$lt_var=\$$lt_var
117
 
          $lt_var=C
118
 
          export $lt_var
119
 
          lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
120
 
          lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
121
 
        fi"
122
 
done
123
 
LC_ALL=C
124
 
LANGUAGE=C
125
 
export LANGUAGE LC_ALL
126
 
 
127
 
$lt_unset CDPATH
128
 
 
129
 
 
130
 
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
131
 
# is ksh but when the shell is invoked as "sh" and the current value of
132
 
# the _XPG environment variable is not equal to 1 (one), the special
133
 
# positional parameter $0, within a function call, is the name of the
134
 
# function.
135
 
progpath="$0"
136
 
 
137
 
 
138
 
 
139
 
: ${CP="cp -f"}
140
 
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
141
 
: ${MAKE="make"}
142
 
: ${MKDIR="mkdir"}
143
 
: ${MV="mv -f"}
144
 
: ${RM="rm -f"}
145
 
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
146
 
: ${Xsed="$SED -e 1s/^X//"}
147
 
 
148
 
# Global variables:
149
 
EXIT_SUCCESS=0
150
 
EXIT_FAILURE=1
151
 
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
152
 
EXIT_SKIP=77      # $? = 77 is used to indicate a skipped test to automake.
153
 
 
154
 
exit_status=$EXIT_SUCCESS
155
 
 
156
 
# Make sure IFS has a sensible default
157
 
lt_nl='
158
 
'
159
 
IFS="   $lt_nl"
160
 
 
161
 
dirname="s,/[^/]*$,,"
162
 
basename="s,^.*/,,"
163
 
 
164
 
# func_dirname file append nondir_replacement
165
 
# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
166
 
# otherwise set result to NONDIR_REPLACEMENT.
167
 
func_dirname ()
168
 
{
169
 
    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
170
 
    if test "X$func_dirname_result" = "X${1}"; then
171
 
      func_dirname_result="${3}"
172
 
    else
173
 
      func_dirname_result="$func_dirname_result${2}"
174
 
    fi
175
 
} # func_dirname may be replaced by extended shell implementation
176
 
 
177
 
 
178
 
# func_basename file
179
 
func_basename ()
180
 
{
181
 
    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
182
 
} # func_basename may be replaced by extended shell implementation
183
 
 
184
 
 
185
 
# func_dirname_and_basename file append nondir_replacement
186
 
# perform func_basename and func_dirname in a single function
187
 
# call:
188
 
#   dirname:  Compute the dirname of FILE.  If nonempty,
189
 
#             add APPEND to the result, otherwise set result
190
 
#             to NONDIR_REPLACEMENT.
191
 
#             value returned in "$func_dirname_result"
192
 
#   basename: Compute filename of FILE.
193
 
#             value retuned in "$func_basename_result"
194
 
# Implementation must be kept synchronized with func_dirname
195
 
# and func_basename. For efficiency, we do not delegate to
196
 
# those functions but instead duplicate the functionality here.
197
 
func_dirname_and_basename ()
198
 
{
199
 
    # Extract subdirectory from the argument.
200
 
    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
201
 
    if test "X$func_dirname_result" = "X${1}"; then
202
 
      func_dirname_result="${3}"
203
 
    else
204
 
      func_dirname_result="$func_dirname_result${2}"
205
 
    fi
206
 
    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
207
 
} # func_dirname_and_basename may be replaced by extended shell implementation
208
 
 
209
 
 
210
 
# func_stripname prefix suffix name
211
 
# strip PREFIX and SUFFIX off of NAME.
212
 
# PREFIX and SUFFIX must not contain globbing or regex special
213
 
# characters, hashes, percent signs, but SUFFIX may contain a leading
214
 
# dot (in which case that matches only a dot).
215
 
# func_strip_suffix prefix name
216
 
func_stripname ()
217
 
{
218
 
    case ${2} in
219
 
      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
220
 
      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
221
 
    esac
222
 
} # func_stripname may be replaced by extended shell implementation
223
 
 
224
 
 
225
 
# These SED scripts presuppose an absolute path with a trailing slash.
226
 
pathcar='s,^/\([^/]*\).*$,\1,'
227
 
pathcdr='s,^/[^/]*,,'
228
 
removedotparts=':dotsl
229
 
                s@/\./@/@g
230
 
                t dotsl
231
 
                s,/\.$,/,'
232
 
collapseslashes='s@/\{1,\}@/@g'
233
 
finalslash='s,/*$,/,'
234
 
 
235
 
# func_normal_abspath PATH
236
 
# Remove doubled-up and trailing slashes, "." path components,
237
 
# and cancel out any ".." path components in PATH after making
238
 
# it an absolute path.
239
 
#             value returned in "$func_normal_abspath_result"
240
 
func_normal_abspath ()
241
 
{
242
 
  # Start from root dir and reassemble the path.
243
 
  func_normal_abspath_result=
244
 
  func_normal_abspath_tpath=$1
245
 
  func_normal_abspath_altnamespace=
246
 
  case $func_normal_abspath_tpath in
247
 
    "")
248
 
      # Empty path, that just means $cwd.
249
 
      func_stripname '' '/' "`pwd`"
250
 
      func_normal_abspath_result=$func_stripname_result
251
 
      return
252
 
    ;;
253
 
    # The next three entries are used to spot a run of precisely
254
 
    # two leading slashes without using negated character classes;
255
 
    # we take advantage of case's first-match behaviour.
256
 
    ///*)
257
 
      # Unusual form of absolute path, do nothing.
258
 
    ;;
259
 
    //*)
260
 
      # Not necessarily an ordinary path; POSIX reserves leading '//'
261
 
      # and for example Cygwin uses it to access remote file shares
262
 
      # over CIFS/SMB, so we conserve a leading double slash if found.
263
 
      func_normal_abspath_altnamespace=/
264
 
    ;;
265
 
    /*)
266
 
      # Absolute path, do nothing.
267
 
    ;;
268
 
    *)
269
 
      # Relative path, prepend $cwd.
270
 
      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
271
 
    ;;
272
 
  esac
273
 
  # Cancel out all the simple stuff to save iterations.  We also want
274
 
  # the path to end with a slash for ease of parsing, so make sure
275
 
  # there is one (and only one) here.
276
 
  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
277
 
        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
278
 
  while :; do
279
 
    # Processed it all yet?
280
 
    if test "$func_normal_abspath_tpath" = / ; then
281
 
      # If we ascended to the root using ".." the result may be empty now.
282
 
      if test -z "$func_normal_abspath_result" ; then
283
 
        func_normal_abspath_result=/
284
 
      fi
285
 
      break
286
 
    fi
287
 
    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
288
 
        -e "$pathcar"`
289
 
    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
290
 
        -e "$pathcdr"`
291
 
    # Figure out what to do with it
292
 
    case $func_normal_abspath_tcomponent in
293
 
      "")
294
 
        # Trailing empty path component, ignore it.
295
 
      ;;
296
 
      ..)
297
 
        # Parent dir; strip last assembled component from result.
298
 
        func_dirname "$func_normal_abspath_result"
299
 
        func_normal_abspath_result=$func_dirname_result
300
 
      ;;
301
 
      *)
302
 
        # Actual path component, append it.
303
 
        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
304
 
      ;;
305
 
    esac
306
 
  done
307
 
  # Restore leading double-slash if one was found on entry.
308
 
  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
309
 
}
310
 
 
311
 
# func_relative_path SRCDIR DSTDIR
312
 
# generates a relative path from SRCDIR to DSTDIR, with a trailing
313
 
# slash if non-empty, suitable for immediately appending a filename
314
 
# without needing to append a separator.
315
 
#             value returned in "$func_relative_path_result"
316
 
func_relative_path ()
317
 
{
318
 
  func_relative_path_result=
319
 
  func_normal_abspath "$1"
320
 
  func_relative_path_tlibdir=$func_normal_abspath_result
321
 
  func_normal_abspath "$2"
322
 
  func_relative_path_tbindir=$func_normal_abspath_result
323
 
 
324
 
  # Ascend the tree starting from libdir
325
 
  while :; do
326
 
    # check if we have found a prefix of bindir
327
 
    case $func_relative_path_tbindir in
328
 
      $func_relative_path_tlibdir)
329
 
        # found an exact match
330
 
        func_relative_path_tcancelled=
331
 
        break
332
 
        ;;
333
 
      $func_relative_path_tlibdir*)
334
 
        # found a matching prefix
335
 
        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
336
 
        func_relative_path_tcancelled=$func_stripname_result
337
 
        if test -z "$func_relative_path_result"; then
338
 
          func_relative_path_result=.
339
 
        fi
340
 
        break
341
 
        ;;
342
 
      *)
343
 
        func_dirname $func_relative_path_tlibdir
344
 
        func_relative_path_tlibdir=${func_dirname_result}
345
 
        if test "x$func_relative_path_tlibdir" = x ; then
346
 
          # Have to descend all the way to the root!
347
 
          func_relative_path_result=../$func_relative_path_result
348
 
          func_relative_path_tcancelled=$func_relative_path_tbindir
349
 
          break
350
 
        fi
351
 
        func_relative_path_result=../$func_relative_path_result
352
 
        ;;
353
 
    esac
354
 
  done
355
 
 
356
 
  # Now calculate path; take care to avoid doubling-up slashes.
357
 
  func_stripname '' '/' "$func_relative_path_result"
358
 
  func_relative_path_result=$func_stripname_result
359
 
  func_stripname '/' '/' "$func_relative_path_tcancelled"
360
 
  if test "x$func_stripname_result" != x ; then
361
 
    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
362
 
  fi
363
 
 
364
 
  # Normalisation. If bindir is libdir, return empty string,
365
 
  # else relative path ending with a slash; either way, target
366
 
  # file name can be directly appended.
367
 
  if test ! -z "$func_relative_path_result"; then
368
 
    func_stripname './' '' "$func_relative_path_result/"
369
 
    func_relative_path_result=$func_stripname_result
370
 
  fi
371
 
}
372
 
 
373
 
# The name of this program:
374
 
func_dirname_and_basename "$progpath"
375
 
progname=$func_basename_result
376
 
 
377
 
# Make sure we have an absolute path for reexecution:
378
 
case $progpath in
379
 
  [\\/]*|[A-Za-z]:\\*) ;;
380
 
  *[\\/]*)
381
 
     progdir=$func_dirname_result
382
 
     progdir=`cd "$progdir" && pwd`
383
 
     progpath="$progdir/$progname"
384
 
     ;;
385
 
  *)
386
 
     save_IFS="$IFS"
387
 
     IFS=${PATH_SEPARATOR-:}
388
 
     for progdir in $PATH; do
389
 
       IFS="$save_IFS"
390
 
       test -x "$progdir/$progname" && break
391
 
     done
392
 
     IFS="$save_IFS"
393
 
     test -n "$progdir" || progdir=`pwd`
394
 
     progpath="$progdir/$progname"
395
 
     ;;
396
 
esac
397
 
 
398
 
# Sed substitution that helps us do robust quoting.  It backslashifies
399
 
# metacharacters that are still active within double-quoted strings.
400
 
Xsed="${SED}"' -e 1s/^X//'
401
 
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
402
 
 
403
 
# Same as above, but do not quote variable references.
404
 
double_quote_subst='s/\(["`\\]\)/\\\1/g'
405
 
 
406
 
# Sed substitution that turns a string into a regex matching for the
407
 
# string literally.
408
 
sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
409
 
 
410
 
# Sed substitution that converts a w32 file name or path
411
 
# which contains forward slashes, into one that contains
412
 
# (escaped) backslashes.  A very naive implementation.
413
 
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
414
 
 
415
 
# Re-`\' parameter expansions in output of double_quote_subst that were
416
 
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
417
 
# in input to double_quote_subst, that '$' was protected from expansion.
418
 
# Since each input `\' is now two `\'s, look for any number of runs of
419
 
# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
420
 
bs='\\'
421
 
bs2='\\\\'
422
 
bs4='\\\\\\\\'
423
 
dollar='\$'
424
 
sed_double_backslash="\
425
 
  s/$bs4/&\\
426
 
/g
427
 
  s/^$bs2$dollar/$bs&/
428
 
  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
429
 
  s/\n//g"
430
 
 
431
 
# Standard options:
432
 
opt_dry_run=false
433
 
opt_help=false
434
 
opt_quiet=false
435
 
opt_verbose=false
436
 
opt_warning=:
437
 
 
438
 
# func_echo arg...
439
 
# Echo program name prefixed message, along with the current mode
440
 
# name if it has been set yet.
441
 
func_echo ()
442
 
{
443
 
    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
444
 
}
445
 
 
446
 
# func_verbose arg...
447
 
# Echo program name prefixed message in verbose mode only.
448
 
func_verbose ()
449
 
{
450
 
    $opt_verbose && func_echo ${1+"$@"}
451
 
 
452
 
    # A bug in bash halts the script if the last line of a function
453
 
    # fails when set -e is in force, so we need another command to
454
 
    # work around that:
455
 
    :
456
 
}
457
 
 
458
 
# func_echo_all arg...
459
 
# Invoke $ECHO with all args, space-separated.
460
 
func_echo_all ()
461
 
{
462
 
    $ECHO "$*"
463
 
}
464
 
 
465
 
# func_error arg...
466
 
# Echo program name prefixed message to standard error.
467
 
func_error ()
468
 
{
469
 
    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
470
 
}
471
 
 
472
 
# func_warning arg...
473
 
# Echo program name prefixed warning message to standard error.
474
 
func_warning ()
475
 
{
476
 
    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
477
 
 
478
 
    # bash bug again:
479
 
    :
480
 
}
481
 
 
482
 
# func_fatal_error arg...
483
 
# Echo program name prefixed message to standard error, and exit.
484
 
func_fatal_error ()
485
 
{
486
 
    func_error ${1+"$@"}
487
 
    exit $EXIT_FAILURE
488
 
}
489
 
 
490
 
# func_fatal_help arg...
491
 
# Echo program name prefixed message to standard error, followed by
492
 
# a help hint, and exit.
493
 
func_fatal_help ()
494
 
{
495
 
    func_error ${1+"$@"}
496
 
    func_fatal_error "$help"
497
 
}
498
 
help="Try \`$progname --help' for more information."  ## default
499
 
 
500
 
 
501
 
# func_grep expression filename
502
 
# Check whether EXPRESSION matches any line of FILENAME, without output.
503
 
func_grep ()
504
 
{
505
 
    $GREP "$1" "$2" >/dev/null 2>&1
506
 
}
507
 
 
508
 
 
509
 
# func_mkdir_p directory-path
510
 
# Make sure the entire path to DIRECTORY-PATH is available.
511
 
func_mkdir_p ()
512
 
{
513
 
    my_directory_path="$1"
514
 
    my_dir_list=
515
 
 
516
 
    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
517
 
 
518
 
      # Protect directory names starting with `-'
519
 
      case $my_directory_path in
520
 
        -*) my_directory_path="./$my_directory_path" ;;
521
 
      esac
522
 
 
523
 
      # While some portion of DIR does not yet exist...
524
 
      while test ! -d "$my_directory_path"; do
525
 
        # ...make a list in topmost first order.  Use a colon delimited
526
 
        # list incase some portion of path contains whitespace.
527
 
        my_dir_list="$my_directory_path:$my_dir_list"
528
 
 
529
 
        # If the last portion added has no slash in it, the list is done
530
 
        case $my_directory_path in */*) ;; *) break ;; esac
531
 
 
532
 
        # ...otherwise throw away the child directory and loop
533
 
        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
534
 
      done
535
 
      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
536
 
 
537
 
      save_mkdir_p_IFS="$IFS"; IFS=':'
538
 
      for my_dir in $my_dir_list; do
539
 
        IFS="$save_mkdir_p_IFS"
540
 
        # mkdir can fail with a `File exist' error if two processes
541
 
        # try to create one of the directories concurrently.  Don't
542
 
        # stop in that case!
543
 
        $MKDIR "$my_dir" 2>/dev/null || :
544
 
      done
545
 
      IFS="$save_mkdir_p_IFS"
546
 
 
547
 
      # Bail out if we (or some other process) failed to create a directory.
548
 
      test -d "$my_directory_path" || \
549
 
        func_fatal_error "Failed to create \`$1'"
550
 
    fi
551
 
}
552
 
 
553
 
 
554
 
# func_mktempdir [string]
555
 
# Make a temporary directory that won't clash with other running
556
 
# libtool processes, and avoids race conditions if possible.  If
557
 
# given, STRING is the basename for that directory.
558
 
func_mktempdir ()
559
 
{
560
 
    my_template="${TMPDIR-/tmp}/${1-$progname}"
561
 
 
562
 
    if test "$opt_dry_run" = ":"; then
563
 
      # Return a directory name, but don't create it in dry-run mode
564
 
      my_tmpdir="${my_template}-$$"
565
 
    else
566
 
 
567
 
      # If mktemp works, use that first and foremost
568
 
      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
569
 
 
570
 
      if test ! -d "$my_tmpdir"; then
571
 
        # Failing that, at least try and use $RANDOM to avoid a race
572
 
        my_tmpdir="${my_template}-${RANDOM-0}$$"
573
 
 
574
 
        save_mktempdir_umask=`umask`
575
 
        umask 0077
576
 
        $MKDIR "$my_tmpdir"
577
 
        umask $save_mktempdir_umask
578
 
      fi
579
 
 
580
 
      # If we're not in dry-run mode, bomb out on failure
581
 
      test -d "$my_tmpdir" || \
582
 
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
583
 
    fi
584
 
 
585
 
    $ECHO "$my_tmpdir"
586
 
}
587
 
 
588
 
 
589
 
# func_quote_for_eval arg
590
 
# Aesthetically quote ARG to be evaled later.
591
 
# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
592
 
# is double-quoted, suitable for a subsequent eval, whereas
593
 
# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
594
 
# which are still active within double quotes backslashified.
595
 
func_quote_for_eval ()
596
 
{
597
 
    case $1 in
598
 
      *[\\\`\"\$]*)
599
 
        func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
600
 
      *)
601
 
        func_quote_for_eval_unquoted_result="$1" ;;
602
 
    esac
603
 
 
604
 
    case $func_quote_for_eval_unquoted_result in
605
 
      # Double-quote args containing shell metacharacters to delay
606
 
      # word splitting, command substitution and and variable
607
 
      # expansion for a subsequent eval.
608
 
      # Many Bourne shells cannot handle close brackets correctly
609
 
      # in scan sets, so we specify it separately.
610
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
611
 
        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
612
 
        ;;
613
 
      *)
614
 
        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
615
 
    esac
616
 
}
617
 
 
618
 
 
619
 
# func_quote_for_expand arg
620
 
# Aesthetically quote ARG to be evaled later; same as above,
621
 
# but do not quote variable references.
622
 
func_quote_for_expand ()
623
 
{
624
 
    case $1 in
625
 
      *[\\\`\"]*)
626
 
        my_arg=`$ECHO "$1" | $SED \
627
 
            -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
628
 
      *)
629
 
        my_arg="$1" ;;
630
 
    esac
631
 
 
632
 
    case $my_arg in
633
 
      # Double-quote args containing shell metacharacters to delay
634
 
      # word splitting and command substitution for a subsequent eval.
635
 
      # Many Bourne shells cannot handle close brackets correctly
636
 
      # in scan sets, so we specify it separately.
637
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
638
 
        my_arg="\"$my_arg\""
639
 
        ;;
640
 
    esac
641
 
 
642
 
    func_quote_for_expand_result="$my_arg"
643
 
}
644
 
 
645
 
 
646
 
# func_show_eval cmd [fail_exp]
647
 
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
648
 
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
649
 
# is given, then evaluate it.
650
 
func_show_eval ()
651
 
{
652
 
    my_cmd="$1"
653
 
    my_fail_exp="${2-:}"
654
 
 
655
 
    ${opt_silent-false} || {
656
 
      func_quote_for_expand "$my_cmd"
657
 
      eval "func_echo $func_quote_for_expand_result"
658
 
    }
659
 
 
660
 
    if ${opt_dry_run-false}; then :; else
661
 
      eval "$my_cmd"
662
 
      my_status=$?
663
 
      if test "$my_status" -eq 0; then :; else
664
 
        eval "(exit $my_status); $my_fail_exp"
665
 
      fi
666
 
    fi
667
 
}
668
 
 
669
 
 
670
 
# func_show_eval_locale cmd [fail_exp]
671
 
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
672
 
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
673
 
# is given, then evaluate it.  Use the saved locale for evaluation.
674
 
func_show_eval_locale ()
675
 
{
676
 
    my_cmd="$1"
677
 
    my_fail_exp="${2-:}"
678
 
 
679
 
    ${opt_silent-false} || {
680
 
      func_quote_for_expand "$my_cmd"
681
 
      eval "func_echo $func_quote_for_expand_result"
682
 
    }
683
 
 
684
 
    if ${opt_dry_run-false}; then :; else
685
 
      eval "$lt_user_locale
686
 
            $my_cmd"
687
 
      my_status=$?
688
 
      eval "$lt_safe_locale"
689
 
      if test "$my_status" -eq 0; then :; else
690
 
        eval "(exit $my_status); $my_fail_exp"
691
 
      fi
692
 
    fi
693
 
}
694
 
 
695
 
# func_tr_sh
696
 
# Turn $1 into a string suitable for a shell variable name.
697
 
# Result is stored in $func_tr_sh_result.  All characters
698
 
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
699
 
# if $1 begins with a digit, a '_' is prepended as well.
700
 
func_tr_sh ()
701
 
{
702
 
  case $1 in
703
 
  [0-9]* | *[!a-zA-Z0-9_]*)
704
 
    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
705
 
    ;;
706
 
  * )
707
 
    func_tr_sh_result=$1
708
 
    ;;
709
 
  esac
710
 
}
711
 
 
712
 
 
713
 
# func_version
714
 
# Echo version message to standard output and exit.
715
 
func_version ()
716
 
{
717
 
    $opt_debug
718
 
 
719
 
    $SED -n '/(C)/!b go
720
 
        :more
721
 
        /\./!{
722
 
          N
723
 
          s/\n# / /
724
 
          b more
725
 
        }
726
 
        :go
727
 
        /^# '$PROGRAM' (GNU /,/# warranty; / {
728
 
        s/^# //
729
 
        s/^# *$//
730
 
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
731
 
        p
732
 
     }' < "$progpath"
733
 
     exit $?
734
 
}
735
 
 
736
 
# func_usage
737
 
# Echo short help message to standard output and exit.
738
 
func_usage ()
739
 
{
740
 
    $opt_debug
741
 
 
742
 
    $SED -n '/^# Usage:/,/^#  *.*--help/ {
743
 
        s/^# //
744
 
        s/^# *$//
745
 
        s/\$progname/'$progname'/
746
 
        p
747
 
    }' < "$progpath"
748
 
    echo
749
 
    $ECHO "run \`$progname --help | more' for full usage"
750
 
    exit $?
751
 
}
752
 
 
753
 
# func_help [NOEXIT]
754
 
# Echo long help message to standard output and exit,
755
 
# unless 'noexit' is passed as argument.
756
 
func_help ()
757
 
{
758
 
    $opt_debug
759
 
 
760
 
    $SED -n '/^# Usage:/,/# Report bugs to/ {
761
 
        :print
762
 
        s/^# //
763
 
        s/^# *$//
764
 
        s*\$progname*'$progname'*
765
 
        s*\$host*'"$host"'*
766
 
        s*\$SHELL*'"$SHELL"'*
767
 
        s*\$LTCC*'"$LTCC"'*
768
 
        s*\$LTCFLAGS*'"$LTCFLAGS"'*
769
 
        s*\$LD*'"$LD"'*
770
 
        s/\$with_gnu_ld/'"$with_gnu_ld"'/
771
 
        s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
772
 
        s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
773
 
        p
774
 
        d
775
 
     }
776
 
     /^# .* home page:/b print
777
 
     /^# General help using/b print
778
 
     ' < "$progpath"
779
 
    ret=$?
780
 
    if test -z "$1"; then
781
 
      exit $ret
782
 
    fi
783
 
}
784
 
 
785
 
# func_missing_arg argname
786
 
# Echo program name prefixed message to standard error and set global
787
 
# exit_cmd.
788
 
func_missing_arg ()
789
 
{
790
 
    $opt_debug
791
 
 
792
 
    func_error "missing argument for $1."
793
 
    exit_cmd=exit
794
 
}
795
 
 
796
 
 
797
 
# func_split_short_opt shortopt
798
 
# Set func_split_short_opt_name and func_split_short_opt_arg shell
799
 
# variables after splitting SHORTOPT after the 2nd character.
800
 
func_split_short_opt ()
801
 
{
802
 
    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
803
 
    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
804
 
 
805
 
    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
806
 
    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
807
 
} # func_split_short_opt may be replaced by extended shell implementation
808
 
 
809
 
 
810
 
# func_split_long_opt longopt
811
 
# Set func_split_long_opt_name and func_split_long_opt_arg shell
812
 
# variables after splitting LONGOPT at the `=' sign.
813
 
func_split_long_opt ()
814
 
{
815
 
    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
816
 
    my_sed_long_arg='1s/^--[^=]*=//'
817
 
 
818
 
    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
819
 
    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
820
 
} # func_split_long_opt may be replaced by extended shell implementation
821
 
 
822
 
exit_cmd=:
823
 
 
824
 
 
825
 
 
826
 
 
827
 
 
828
 
magic="%%%MAGIC variable%%%"
829
 
magic_exe="%%%MAGIC EXE variable%%%"
830
 
 
831
 
# Global variables.
832
 
nonopt=
833
 
preserve_args=
834
 
lo2o="s/\\.lo\$/.${objext}/"
835
 
o2lo="s/\\.${objext}\$/.lo/"
836
 
extracted_archives=
837
 
extracted_serial=0
838
 
 
839
 
# If this variable is set in any of the actions, the command in it
840
 
# will be execed at the end.  This prevents here-documents from being
841
 
# left over by shells.
842
 
exec_cmd=
843
 
 
844
 
# func_append var value
845
 
# Append VALUE to the end of shell variable VAR.
846
 
func_append ()
847
 
{
848
 
    eval "${1}=\$${1}\${2}"
849
 
} # func_append may be replaced by extended shell implementation
850
 
 
851
 
# func_append_quoted var value
852
 
# Quote VALUE and append to the end of shell variable VAR, separated
853
 
# by a space.
854
 
func_append_quoted ()
855
 
{
856
 
    func_quote_for_eval "${2}"
857
 
    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
858
 
} # func_append_quoted may be replaced by extended shell implementation
859
 
 
860
 
 
861
 
# func_arith arithmetic-term...
862
 
func_arith ()
863
 
{
864
 
    func_arith_result=`expr "${@}"`
865
 
} # func_arith may be replaced by extended shell implementation
866
 
 
867
 
 
868
 
# func_len string
869
 
# STRING may not start with a hyphen.
870
 
func_len ()
871
 
{
872
 
    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
873
 
} # func_len may be replaced by extended shell implementation
874
 
 
875
 
 
876
 
# func_lo2o object
877
 
func_lo2o ()
878
 
{
879
 
    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
880
 
} # func_lo2o may be replaced by extended shell implementation
881
 
 
882
 
 
883
 
# func_xform libobj-or-source
884
 
func_xform ()
885
 
{
886
 
    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
887
 
} # func_xform may be replaced by extended shell implementation
888
 
 
889
 
 
890
 
# func_fatal_configuration arg...
891
 
# Echo program name prefixed message to standard error, followed by
892
 
# a configuration failure hint, and exit.
893
 
func_fatal_configuration ()
894
 
{
895
 
    func_error ${1+"$@"}
896
 
    func_error "See the $PACKAGE documentation for more information."
897
 
    func_fatal_error "Fatal configuration error."
898
 
}
899
 
 
900
 
 
901
 
# func_config
902
 
# Display the configuration for all the tags in this script.
903
 
func_config ()
904
 
{
905
 
    re_begincf='^# ### BEGIN LIBTOOL'
906
 
    re_endcf='^# ### END LIBTOOL'
907
 
 
908
 
    # Default configuration.
909
 
    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
910
 
 
911
 
    # Now print the configurations for the tags.
912
 
    for tagname in $taglist; do
913
 
      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
914
 
    done
915
 
 
916
 
    exit $?
917
 
}
918
 
 
919
 
# func_features
920
 
# Display the features supported by this script.
921
 
func_features ()
922
 
{
923
 
    echo "host: $host"
924
 
    if test "$build_libtool_libs" = yes; then
925
 
      echo "enable shared libraries"
926
 
    else
927
 
      echo "disable shared libraries"
928
 
    fi
929
 
    if test "$build_old_libs" = yes; then
930
 
      echo "enable static libraries"
931
 
    else
932
 
      echo "disable static libraries"
933
 
    fi
934
 
 
935
 
    exit $?
936
 
}
937
 
 
938
 
# func_enable_tag tagname
939
 
# Verify that TAGNAME is valid, and either flag an error and exit, or
940
 
# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
941
 
# variable here.
942
 
func_enable_tag ()
943
 
{
944
 
  # Global variable:
945
 
  tagname="$1"
946
 
 
947
 
  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
948
 
  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
949
 
  sed_extractcf="/$re_begincf/,/$re_endcf/p"
950
 
 
951
 
  # Validate tagname.
952
 
  case $tagname in
953
 
    *[!-_A-Za-z0-9,/]*)
954
 
      func_fatal_error "invalid tag name: $tagname"
955
 
      ;;
956
 
  esac
957
 
 
958
 
  # Don't test for the "default" C tag, as we know it's
959
 
  # there but not specially marked.
960
 
  case $tagname in
961
 
    CC) ;;
962
 
    *)
963
 
      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
964
 
        taglist="$taglist $tagname"
965
 
 
966
 
        # Evaluate the configuration.  Be careful to quote the path
967
 
        # and the sed script, to avoid splitting on whitespace, but
968
 
        # also don't use non-portable quotes within backquotes within
969
 
        # quotes we have to do it in 2 steps:
970
 
        extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
971
 
        eval "$extractedcf"
972
 
      else
973
 
        func_error "ignoring unknown tag $tagname"
974
 
      fi
975
 
      ;;
976
 
  esac
977
 
}
978
 
 
979
 
# func_check_version_match
980
 
# Ensure that we are using m4 macros, and libtool script from the same
981
 
# release of libtool.
982
 
func_check_version_match ()
983
 
{
984
 
  if test "$package_revision" != "$macro_revision"; then
985
 
    if test "$VERSION" != "$macro_version"; then
986
 
      if test -z "$macro_version"; then
987
 
        cat >&2 <<_LT_EOF
988
 
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
989
 
$progname: definition of this LT_INIT comes from an older release.
990
 
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
991
 
$progname: and run autoconf again.
992
 
_LT_EOF
993
 
      else
994
 
        cat >&2 <<_LT_EOF
995
 
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
996
 
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
997
 
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
998
 
$progname: and run autoconf again.
999
 
_LT_EOF
1000
 
      fi
1001
 
    else
1002
 
      cat >&2 <<_LT_EOF
1003
 
$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
1004
 
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
1005
 
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
1006
 
$progname: of $PACKAGE $VERSION and run autoconf again.
1007
 
_LT_EOF
1008
 
    fi
1009
 
 
1010
 
    exit $EXIT_MISMATCH
1011
 
  fi
1012
 
}
1013
 
 
1014
 
 
1015
 
# Shorthand for --mode=foo, only valid as the first argument
1016
 
case $1 in
1017
 
clean|clea|cle|cl)
1018
 
  shift; set dummy --mode clean ${1+"$@"}; shift
1019
 
  ;;
1020
 
compile|compil|compi|comp|com|co|c)
1021
 
  shift; set dummy --mode compile ${1+"$@"}; shift
1022
 
  ;;
1023
 
execute|execut|execu|exec|exe|ex|e)
1024
 
  shift; set dummy --mode execute ${1+"$@"}; shift
1025
 
  ;;
1026
 
finish|finis|fini|fin|fi|f)
1027
 
  shift; set dummy --mode finish ${1+"$@"}; shift
1028
 
  ;;
1029
 
install|instal|insta|inst|ins|in|i)
1030
 
  shift; set dummy --mode install ${1+"$@"}; shift
1031
 
  ;;
1032
 
link|lin|li|l)
1033
 
  shift; set dummy --mode link ${1+"$@"}; shift
1034
 
  ;;
1035
 
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1036
 
  shift; set dummy --mode uninstall ${1+"$@"}; shift
1037
 
  ;;
1038
 
esac
1039
 
 
1040
 
 
1041
 
 
1042
 
# Option defaults:
1043
 
opt_debug=:
1044
 
opt_dry_run=false
1045
 
opt_config=false
1046
 
opt_preserve_dup_deps=false
1047
 
opt_features=false
1048
 
opt_finish=false
1049
 
opt_help=false
1050
 
opt_help_all=false
1051
 
opt_silent=:
1052
 
opt_warning=:
1053
 
opt_verbose=:
1054
 
opt_silent=false
1055
 
opt_verbose=false
1056
 
 
1057
 
 
1058
 
# Parse options once, thoroughly.  This comes as soon as possible in the
1059
 
# script to make things like `--version' happen as quickly as we can.
1060
 
{
1061
 
  # this just eases exit handling
1062
 
  while test $# -gt 0; do
1063
 
    opt="$1"
1064
 
    shift
1065
 
    case $opt in
1066
 
      --debug|-x)       opt_debug='set -x'
1067
 
                        func_echo "enabling shell trace mode"
1068
 
                        $opt_debug
1069
 
                        ;;
1070
 
      --dry-run|--dryrun|-n)
1071
 
                        opt_dry_run=:
1072
 
                        ;;
1073
 
      --config)
1074
 
                        opt_config=:
1075
 
func_config
1076
 
                        ;;
1077
 
      --dlopen|-dlopen)
1078
 
                        optarg="$1"
1079
 
                        opt_dlopen="${opt_dlopen+$opt_dlopen
1080
 
}$optarg"
1081
 
                        shift
1082
 
                        ;;
1083
 
      --preserve-dup-deps)
1084
 
                        opt_preserve_dup_deps=:
1085
 
                        ;;
1086
 
      --features)
1087
 
                        opt_features=:
1088
 
func_features
1089
 
                        ;;
1090
 
      --finish)
1091
 
                        opt_finish=:
1092
 
set dummy --mode finish ${1+"$@"}; shift
1093
 
                        ;;
1094
 
      --help)
1095
 
                        opt_help=:
1096
 
                        ;;
1097
 
      --help-all)
1098
 
                        opt_help_all=:
1099
 
opt_help=': help-all'
1100
 
                        ;;
1101
 
      --mode)
1102
 
                        test $# = 0 && func_missing_arg $opt && break
1103
 
                        optarg="$1"
1104
 
                        opt_mode="$optarg"
1105
 
case $optarg in
1106
 
  # Valid mode arguments:
1107
 
  clean|compile|execute|finish|install|link|relink|uninstall) ;;
1108
 
 
1109
 
  # Catch anything else as an error
1110
 
  *) func_error "invalid argument for $opt"
1111
 
     exit_cmd=exit
1112
 
     break
1113
 
     ;;
1114
 
esac
1115
 
                        shift
1116
 
                        ;;
1117
 
      --no-silent|--no-quiet)
1118
 
                        opt_silent=false
1119
 
func_append preserve_args " $opt"
1120
 
                        ;;
1121
 
      --no-warning|--no-warn)
1122
 
                        opt_warning=false
1123
 
func_append preserve_args " $opt"
1124
 
                        ;;
1125
 
      --no-verbose)
1126
 
                        opt_verbose=false
1127
 
func_append preserve_args " $opt"
1128
 
                        ;;
1129
 
      --silent|--quiet)
1130
 
                        opt_silent=:
1131
 
func_append preserve_args " $opt"
1132
 
        opt_verbose=false
1133
 
                        ;;
1134
 
      --verbose|-v)
1135
 
                        opt_verbose=:
1136
 
func_append preserve_args " $opt"
1137
 
opt_silent=false
1138
 
                        ;;
1139
 
      --tag)
1140
 
                        test $# = 0 && func_missing_arg $opt && break
1141
 
                        optarg="$1"
1142
 
                        opt_tag="$optarg"
1143
 
func_append preserve_args " $opt $optarg"
1144
 
func_enable_tag "$optarg"
1145
 
                        shift
1146
 
                        ;;
1147
 
 
1148
 
      -\?|-h)           func_usage                              ;;
1149
 
      --help)           func_help                               ;;
1150
 
      --version)        func_version                            ;;
1151
 
 
1152
 
      # Separate optargs to long options:
1153
 
      --*=*)
1154
 
                        func_split_long_opt "$opt"
1155
 
                        set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1156
 
                        shift
1157
 
                        ;;
1158
 
 
1159
 
      # Separate non-argument short options:
1160
 
      -\?*|-h*|-n*|-v*)
1161
 
                        func_split_short_opt "$opt"
1162
 
                        set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1163
 
                        shift
1164
 
                        ;;
1165
 
 
1166
 
      --)               break                                   ;;
1167
 
      -*)               func_fatal_help "unrecognized option \`$opt'" ;;
1168
 
      *)                set dummy "$opt" ${1+"$@"};     shift; break  ;;
1169
 
    esac
1170
 
  done
1171
 
 
1172
 
  # Validate options:
1173
 
 
1174
 
  # save first non-option argument
1175
 
  if test "$#" -gt 0; then
1176
 
    nonopt="$opt"
1177
 
    shift
1178
 
  fi
1179
 
 
1180
 
  # preserve --debug
1181
 
  test "$opt_debug" = : || func_append preserve_args " --debug"
1182
 
 
1183
 
  case $host in
1184
 
    *cygwin* | *mingw* | *pw32* | *cegcc*)
1185
 
      # don't eliminate duplications in $postdeps and $predeps
1186
 
      opt_duplicate_compiler_generated_deps=:
1187
 
      ;;
1188
 
    *)
1189
 
      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1190
 
      ;;
1191
 
  esac
1192
 
 
1193
 
  $opt_help || {
1194
 
    # Sanity checks first:
1195
 
    func_check_version_match
1196
 
 
1197
 
    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1198
 
      func_fatal_configuration "not configured to build any kind of library"
1199
 
    fi
1200
 
 
1201
 
    # Darwin sucks
1202
 
    eval std_shrext=\"$shrext_cmds\"
1203
 
 
1204
 
    # Only execute mode is allowed to have -dlopen flags.
1205
 
    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1206
 
      func_error "unrecognized option \`-dlopen'"
1207
 
      $ECHO "$help" 1>&2
1208
 
      exit $EXIT_FAILURE
1209
 
    fi
1210
 
 
1211
 
    # Change the help message to a mode-specific one.
1212
 
    generic_help="$help"
1213
 
    help="Try \`$progname --help --mode=$opt_mode' for more information."
1214
 
  }
1215
 
 
1216
 
 
1217
 
  # Bail if the options were screwed
1218
 
  $exit_cmd $EXIT_FAILURE
1219
 
}
1220
 
 
1221
 
 
1222
 
 
1223
 
 
1224
 
## ----------- ##
1225
 
##    Main.    ##
1226
 
## ----------- ##
1227
 
 
1228
 
# func_try_sizelim file n
1229
 
# try to write at most the first N bytes from FILE to the standard output when
1230
 
# possible, otherwise put whole file
1231
 
func_try_sizelim ()
1232
 
{
1233
 
  if test -n "$DD"; then
1234
 
    $DD if="$1" bs=$2 count=1 2>/dev/null
1235
 
    if test $? -eq 127; then
1236
 
      cat "$1" 2>/dev/null
1237
 
    fi
1238
 
  else
1239
 
    cat "$1" 2>/dev/null
1240
 
  fi
1241
 
}
1242
 
 
1243
 
# func_lalib_p file
1244
 
# True iff FILE is a libtool `.la' library or `.lo' object file.
1245
 
# This function is only a basic sanity check; it will hardly flush out
1246
 
# determined imposters.
1247
 
func_lalib_p ()
1248
 
{
1249
 
    test -f "$1" &&
1250
 
      func_try_sizelim "$1" 4096 | $SED -e 4q 2>/dev/null \
1251
 
        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1252
 
}
1253
 
 
1254
 
# func_lalib_unsafe_p file
1255
 
# True iff FILE is a libtool `.la' library or `.lo' object file.
1256
 
# This function implements the same check as func_lalib_p without
1257
 
# resorting to external programs.  To this end, it redirects stdin and
1258
 
# closes it afterwards, without saving the original file descriptor.
1259
 
# As a safety measure, use it only where a negative result would be
1260
 
# fatal anyway.  Works if `file' does not exist.
1261
 
func_lalib_unsafe_p ()
1262
 
{
1263
 
    lalib_p=no
1264
 
    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1265
 
        for lalib_p_l in 1 2 3 4
1266
 
        do
1267
 
            read lalib_p_line
1268
 
            case "$lalib_p_line" in
1269
 
                \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1270
 
            esac
1271
 
        done
1272
 
        exec 0<&5 5<&-
1273
 
    fi
1274
 
    test "$lalib_p" = yes
1275
 
}
1276
 
 
1277
 
# func_ltwrapper_script_p file
1278
 
# True iff FILE is a libtool wrapper script
1279
 
# This function is only a basic sanity check; it will hardly flush out
1280
 
# determined imposters.
1281
 
func_ltwrapper_script_p ()
1282
 
{
1283
 
    func_lalib_p "$1"
1284
 
}
1285
 
 
1286
 
# func_ltwrapper_executable_p file
1287
 
# True iff FILE is a libtool wrapper executable
1288
 
# This function is only a basic sanity check; it will hardly flush out
1289
 
# determined imposters.
1290
 
func_ltwrapper_executable_p ()
1291
 
{
1292
 
    func_ltwrapper_exec_suffix=
1293
 
    case $1 in
1294
 
    *.exe) ;;
1295
 
    *) func_ltwrapper_exec_suffix=.exe ;;
1296
 
    esac
1297
 
    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1298
 
}
1299
 
 
1300
 
# func_ltwrapper_scriptname file
1301
 
# Assumes file is an ltwrapper_executable
1302
 
# uses $file to determine the appropriate filename for a
1303
 
# temporary ltwrapper_script.
1304
 
func_ltwrapper_scriptname ()
1305
 
{
1306
 
    func_dirname_and_basename "$1" "" "."
1307
 
    func_stripname '' '.exe' "$func_basename_result"
1308
 
    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1309
 
}
1310
 
 
1311
 
# func_ltwrapper_p file
1312
 
# True iff FILE is a libtool wrapper script or wrapper executable
1313
 
# This function is only a basic sanity check; it will hardly flush out
1314
 
# determined imposters.
1315
 
func_ltwrapper_p ()
1316
 
{
1317
 
    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1318
 
}
1319
 
 
1320
 
 
1321
 
# func_execute_cmds commands fail_cmd
1322
 
# Execute tilde-delimited COMMANDS.
1323
 
# If FAIL_CMD is given, eval that upon failure.
1324
 
# FAIL_CMD may read-access the current command in variable CMD!
1325
 
func_execute_cmds ()
1326
 
{
1327
 
    $opt_debug
1328
 
    save_ifs=$IFS; IFS='~'
1329
 
    for cmd in $1; do
1330
 
      IFS=$save_ifs
1331
 
      eval cmd=\"$cmd\"
1332
 
      func_show_eval "$cmd" "${2-:}"
1333
 
    done
1334
 
    IFS=$save_ifs
1335
 
}
1336
 
 
1337
 
 
1338
 
# func_source file
1339
 
# Source FILE, adding directory component if necessary.
1340
 
# Note that it is not necessary on cygwin/mingw to append a dot to
1341
 
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1342
 
# behavior happens only for exec(3), not for open(2)!  Also, sourcing
1343
 
# `FILE.' does not work on cygwin managed mounts.
1344
 
func_source ()
1345
 
{
1346
 
    $opt_debug
1347
 
    case $1 in
1348
 
    */* | *\\*) . "$1" ;;
1349
 
    *)          . "./$1" ;;
1350
 
    esac
1351
 
}
1352
 
 
1353
 
 
1354
 
# func_resolve_sysroot PATH
1355
 
# Replace a leading = in PATH with a sysroot.  Store the result into
1356
 
# func_resolve_sysroot_result
1357
 
func_resolve_sysroot ()
1358
 
{
1359
 
  func_resolve_sysroot_result=$1
1360
 
  case $func_resolve_sysroot_result in
1361
 
  =*)
1362
 
    func_stripname '=' '' "$func_resolve_sysroot_result"
1363
 
    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1364
 
    ;;
1365
 
  esac
1366
 
}
1367
 
 
1368
 
# func_replace_sysroot PATH
1369
 
# If PATH begins with the sysroot, replace it with = and
1370
 
# store the result into func_replace_sysroot_result.
1371
 
func_replace_sysroot ()
1372
 
{
1373
 
  case "$lt_sysroot:$1" in
1374
 
  ?*:"$lt_sysroot"*)
1375
 
    func_stripname "$lt_sysroot" '' "$1"
1376
 
    func_replace_sysroot_result="=$func_stripname_result"
1377
 
    ;;
1378
 
  *)
1379
 
    # Including no sysroot.
1380
 
    func_replace_sysroot_result=$1
1381
 
    ;;
1382
 
  esac
1383
 
}
1384
 
 
1385
 
# func_infer_tag arg
1386
 
# Infer tagged configuration to use if any are available and
1387
 
# if one wasn't chosen via the "--tag" command line option.
1388
 
# Only attempt this if the compiler in the base compile
1389
 
# command doesn't match the default compiler.
1390
 
# arg is usually of the form 'gcc ...'
1391
 
func_infer_tag ()
1392
 
{
1393
 
    $opt_debug
1394
 
    if test -n "$available_tags" && test -z "$tagname"; then
1395
 
      CC_quoted=
1396
 
      for arg in $CC; do
1397
 
        func_append_quoted CC_quoted "$arg"
1398
 
      done
1399
 
      CC_expanded=`func_echo_all $CC`
1400
 
      CC_quoted_expanded=`func_echo_all $CC_quoted`
1401
 
      case $@ in
1402
 
      # Blanks in the command may have been stripped by the calling shell,
1403
 
      # but not from the CC environment variable when configure was run.
1404
 
      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1405
 
      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1406
 
      # Blanks at the start of $base_compile will cause this to fail
1407
 
      # if we don't check for them as well.
1408
 
      *)
1409
 
        for z in $available_tags; do
1410
 
          if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1411
 
            # Evaluate the configuration.
1412
 
            eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1413
 
            CC_quoted=
1414
 
            for arg in $CC; do
1415
 
              # Double-quote args containing other shell metacharacters.
1416
 
              func_append_quoted CC_quoted "$arg"
1417
 
            done
1418
 
            CC_expanded=`func_echo_all $CC`
1419
 
            CC_quoted_expanded=`func_echo_all $CC_quoted`
1420
 
            case "$@ " in
1421
 
            " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1422
 
            " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1423
 
              # The compiler in the base compile command matches
1424
 
              # the one in the tagged configuration.
1425
 
              # Assume this is the tagged configuration we want.
1426
 
              tagname=$z
1427
 
              break
1428
 
              ;;
1429
 
            esac
1430
 
          fi
1431
 
        done
1432
 
        # If $tagname still isn't set, then no tagged configuration
1433
 
        # was found and let the user know that the "--tag" command
1434
 
        # line option must be used.
1435
 
        if test -z "$tagname"; then
1436
 
          func_echo "unable to infer tagged configuration"
1437
 
          func_fatal_error "specify a tag with \`--tag'"
1438
 
#       else
1439
 
#         func_verbose "using $tagname tagged configuration"
1440
 
        fi
1441
 
        ;;
1442
 
      esac
1443
 
    fi
1444
 
}
1445
 
 
1446
 
 
1447
 
 
1448
 
# func_write_libtool_object output_name pic_name nonpic_name
1449
 
# Create a libtool object file (analogous to a ".la" file),
1450
 
# but don't create it if we're doing a dry run.
1451
 
func_write_libtool_object ()
1452
 
{
1453
 
    write_libobj=${1}
1454
 
    if test "$build_libtool_libs" = yes; then
1455
 
      write_lobj=\'${2}\'
1456
 
    else
1457
 
      write_lobj=none
1458
 
    fi
1459
 
 
1460
 
    if test "$build_old_libs" = yes; then
1461
 
      write_oldobj=\'${3}\'
1462
 
    else
1463
 
      write_oldobj=none
1464
 
    fi
1465
 
 
1466
 
    $opt_dry_run || {
1467
 
      cat >${write_libobj}T <<EOF
1468
 
# $write_libobj - a libtool object file
1469
 
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1470
 
#
1471
 
# Please DO NOT delete this file!
1472
 
# It is necessary for linking the library.
1473
 
 
1474
 
# Name of the PIC object.
1475
 
pic_object=$write_lobj
1476
 
 
1477
 
# Name of the non-PIC object
1478
 
non_pic_object=$write_oldobj
1479
 
 
1480
 
EOF
1481
 
      $MV "${write_libobj}T" "${write_libobj}"
1482
 
    }
1483
 
}
1484
 
 
1485
 
 
1486
 
##################################################
1487
 
# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1488
 
##################################################
1489
 
 
1490
 
# func_convert_core_file_wine_to_w32 ARG
1491
 
# Helper function used by file name conversion functions when $build is *nix,
1492
 
# and $host is mingw, cygwin, or some other w32 environment. Relies on a
1493
 
# correctly configured wine environment available, with the winepath program
1494
 
# in $build's $PATH.
1495
 
#
1496
 
# ARG is the $build file name to be converted to w32 format.
1497
 
# Result is available in $func_convert_core_file_wine_to_w32_result, and will
1498
 
# be empty on error (or when ARG is empty)
1499
 
func_convert_core_file_wine_to_w32 ()
1500
 
{
1501
 
  $opt_debug
1502
 
  func_convert_core_file_wine_to_w32_result="$1"
1503
 
  if test -n "$1"; then
1504
 
    # Unfortunately, winepath does not exit with a non-zero error code, so we
1505
 
    # are forced to check the contents of stdout. On the other hand, if the
1506
 
    # command is not found, the shell will set an exit code of 127 and print
1507
 
    # *an error message* to stdout. So we must check for both error code of
1508
 
    # zero AND non-empty stdout, which explains the odd construction:
1509
 
    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1510
 
    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1511
 
      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1512
 
        $SED -e "$lt_sed_naive_backslashify"`
1513
 
    else
1514
 
      func_convert_core_file_wine_to_w32_result=
1515
 
    fi
1516
 
  fi
1517
 
}
1518
 
# end: func_convert_core_file_wine_to_w32
1519
 
 
1520
 
 
1521
 
# func_convert_core_path_wine_to_w32 ARG
1522
 
# Helper function used by path conversion functions when $build is *nix, and
1523
 
# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1524
 
# configured wine environment available, with the winepath program in $build's
1525
 
# $PATH. Assumes ARG has no leading or trailing path separator characters.
1526
 
#
1527
 
# ARG is path to be converted from $build format to win32.
1528
 
# Result is available in $func_convert_core_path_wine_to_w32_result.
1529
 
# Unconvertible file (directory) names in ARG are skipped; if no directory names
1530
 
# are convertible, then the result may be empty.
1531
 
func_convert_core_path_wine_to_w32 ()
1532
 
{
1533
 
  $opt_debug
1534
 
  # unfortunately, winepath doesn't convert paths, only file names
1535
 
  func_convert_core_path_wine_to_w32_result=""
1536
 
  if test -n "$1"; then
1537
 
    oldIFS=$IFS
1538
 
    IFS=:
1539
 
    for func_convert_core_path_wine_to_w32_f in $1; do
1540
 
      IFS=$oldIFS
1541
 
      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1542
 
      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1543
 
        if test -z "$func_convert_core_path_wine_to_w32_result"; then
1544
 
          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1545
 
        else
1546
 
          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1547
 
        fi
1548
 
      fi
1549
 
    done
1550
 
    IFS=$oldIFS
1551
 
  fi
1552
 
}
1553
 
# end: func_convert_core_path_wine_to_w32
1554
 
 
1555
 
 
1556
 
# func_cygpath ARGS...
1557
 
# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1558
 
# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1559
 
# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1560
 
# (2), returns the Cygwin file name or path in func_cygpath_result (input
1561
 
# file name or path is assumed to be in w32 format, as previously converted
1562
 
# from $build's *nix or MSYS format). In case (3), returns the w32 file name
1563
 
# or path in func_cygpath_result (input file name or path is assumed to be in
1564
 
# Cygwin format). Returns an empty string on error.
1565
 
#
1566
 
# ARGS are passed to cygpath, with the last one being the file name or path to
1567
 
# be converted.
1568
 
#
1569
 
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1570
 
# environment variable; do not put it in $PATH.
1571
 
func_cygpath ()
1572
 
{
1573
 
  $opt_debug
1574
 
  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1575
 
    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1576
 
    if test "$?" -ne 0; then
1577
 
      # on failure, ensure result is empty
1578
 
      func_cygpath_result=
1579
 
    fi
1580
 
  else
1581
 
    func_cygpath_result=
1582
 
    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
1583
 
  fi
1584
 
}
1585
 
#end: func_cygpath
1586
 
 
1587
 
 
1588
 
# func_convert_core_msys_to_w32 ARG
1589
 
# Convert file name or path ARG from MSYS format to w32 format.  Return
1590
 
# result in func_convert_core_msys_to_w32_result.
1591
 
func_convert_core_msys_to_w32 ()
1592
 
{
1593
 
  $opt_debug
1594
 
  # awkward: cmd appends spaces to result
1595
 
  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1596
 
    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
1597
 
}
1598
 
#end: func_convert_core_msys_to_w32
1599
 
 
1600
 
 
1601
 
# func_convert_file_check ARG1 ARG2
1602
 
# Verify that ARG1 (a file name in $build format) was converted to $host
1603
 
# format in ARG2. Otherwise, emit an error message, but continue (resetting
1604
 
# func_to_host_file_result to ARG1).
1605
 
func_convert_file_check ()
1606
 
{
1607
 
  $opt_debug
1608
 
  if test -z "$2" && test -n "$1" ; then
1609
 
    func_error "Could not determine host file name corresponding to"
1610
 
    func_error "  \`$1'"
1611
 
    func_error "Continuing, but uninstalled executables may not work."
1612
 
    # Fallback:
1613
 
    func_to_host_file_result="$1"
1614
 
  fi
1615
 
}
1616
 
# end func_convert_file_check
1617
 
 
1618
 
 
1619
 
# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
1620
 
# Verify that FROM_PATH (a path in $build format) was converted to $host
1621
 
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
1622
 
# func_to_host_file_result to a simplistic fallback value (see below).
1623
 
func_convert_path_check ()
1624
 
{
1625
 
  $opt_debug
1626
 
  if test -z "$4" && test -n "$3"; then
1627
 
    func_error "Could not determine the host path corresponding to"
1628
 
    func_error "  \`$3'"
1629
 
    func_error "Continuing, but uninstalled executables may not work."
1630
 
    # Fallback.  This is a deliberately simplistic "conversion" and
1631
 
    # should not be "improved".  See libtool.info.
1632
 
    if test "x$1" != "x$2"; then
1633
 
      lt_replace_pathsep_chars="s|$1|$2|g"
1634
 
      func_to_host_path_result=`echo "$3" |
1635
 
        $SED -e "$lt_replace_pathsep_chars"`
1636
 
    else
1637
 
      func_to_host_path_result="$3"
1638
 
    fi
1639
 
  fi
1640
 
}
1641
 
# end func_convert_path_check
1642
 
 
1643
 
 
1644
 
# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
1645
 
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
1646
 
# and appending REPL if ORIG matches BACKPAT.
1647
 
func_convert_path_front_back_pathsep ()
1648
 
{
1649
 
  $opt_debug
1650
 
  case $4 in
1651
 
  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
1652
 
    ;;
1653
 
  esac
1654
 
  case $4 in
1655
 
  $2 ) func_append func_to_host_path_result "$3"
1656
 
    ;;
1657
 
  esac
1658
 
}
1659
 
# end func_convert_path_front_back_pathsep
1660
 
 
1661
 
 
1662
 
##################################################
1663
 
# $build to $host FILE NAME CONVERSION FUNCTIONS #
1664
 
##################################################
1665
 
# invoked via `$to_host_file_cmd ARG'
1666
 
#
1667
 
# In each case, ARG is the path to be converted from $build to $host format.
1668
 
# Result will be available in $func_to_host_file_result.
1669
 
 
1670
 
 
1671
 
# func_to_host_file ARG
1672
 
# Converts the file name ARG from $build format to $host format. Return result
1673
 
# in func_to_host_file_result.
1674
 
func_to_host_file ()
1675
 
{
1676
 
  $opt_debug
1677
 
  $to_host_file_cmd "$1"
1678
 
}
1679
 
# end func_to_host_file
1680
 
 
1681
 
 
1682
 
# func_to_tool_file ARG LAZY
1683
 
# converts the file name ARG from $build format to toolchain format. Return
1684
 
# result in func_to_tool_file_result.  If the conversion in use is listed
1685
 
# in (the comma separated) LAZY, no conversion takes place.
1686
 
func_to_tool_file ()
1687
 
{
1688
 
  $opt_debug
1689
 
  case ,$2, in
1690
 
    *,"$to_tool_file_cmd",*)
1691
 
      func_to_tool_file_result=$1
1692
 
      ;;
1693
 
    *)
1694
 
      $to_tool_file_cmd "$1"
1695
 
      func_to_tool_file_result=$func_to_host_file_result
1696
 
      ;;
1697
 
  esac
1698
 
}
1699
 
# end func_to_tool_file
1700
 
 
1701
 
 
1702
 
# func_convert_file_noop ARG
1703
 
# Copy ARG to func_to_host_file_result.
1704
 
func_convert_file_noop ()
1705
 
{
1706
 
  func_to_host_file_result="$1"
1707
 
}
1708
 
# end func_convert_file_noop
1709
 
 
1710
 
 
1711
 
# func_convert_file_msys_to_w32 ARG
1712
 
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
1713
 
# conversion to w32 is not available inside the cwrapper.  Returns result in
1714
 
# func_to_host_file_result.
1715
 
func_convert_file_msys_to_w32 ()
1716
 
{
1717
 
  $opt_debug
1718
 
  func_to_host_file_result="$1"
1719
 
  if test -n "$1"; then
1720
 
    func_convert_core_msys_to_w32 "$1"
1721
 
    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
1722
 
  fi
1723
 
  func_convert_file_check "$1" "$func_to_host_file_result"
1724
 
}
1725
 
# end func_convert_file_msys_to_w32
1726
 
 
1727
 
 
1728
 
# func_convert_file_cygwin_to_w32 ARG
1729
 
# Convert file name ARG from Cygwin to w32 format.  Returns result in
1730
 
# func_to_host_file_result.
1731
 
func_convert_file_cygwin_to_w32 ()
1732
 
{
1733
 
  $opt_debug
1734
 
  func_to_host_file_result="$1"
1735
 
  if test -n "$1"; then
1736
 
    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
1737
 
    # LT_CYGPATH in this case.
1738
 
    func_to_host_file_result=`cygpath -m "$1"`
1739
 
  fi
1740
 
  func_convert_file_check "$1" "$func_to_host_file_result"
1741
 
}
1742
 
# end func_convert_file_cygwin_to_w32
1743
 
 
1744
 
 
1745
 
# func_convert_file_nix_to_w32 ARG
1746
 
# Convert file name ARG from *nix to w32 format.  Requires a wine environment
1747
 
# and a working winepath. Returns result in func_to_host_file_result.
1748
 
func_convert_file_nix_to_w32 ()
1749
 
{
1750
 
  $opt_debug
1751
 
  func_to_host_file_result="$1"
1752
 
  if test -n "$1"; then
1753
 
    func_convert_core_file_wine_to_w32 "$1"
1754
 
    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
1755
 
  fi
1756
 
  func_convert_file_check "$1" "$func_to_host_file_result"
1757
 
}
1758
 
# end func_convert_file_nix_to_w32
1759
 
 
1760
 
 
1761
 
# func_convert_file_msys_to_cygwin ARG
1762
 
# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
1763
 
# Returns result in func_to_host_file_result.
1764
 
func_convert_file_msys_to_cygwin ()
1765
 
{
1766
 
  $opt_debug
1767
 
  func_to_host_file_result="$1"
1768
 
  if test -n "$1"; then
1769
 
    func_convert_core_msys_to_w32 "$1"
1770
 
    func_cygpath -u "$func_convert_core_msys_to_w32_result"
1771
 
    func_to_host_file_result="$func_cygpath_result"
1772
 
  fi
1773
 
  func_convert_file_check "$1" "$func_to_host_file_result"
1774
 
}
1775
 
# end func_convert_file_msys_to_cygwin
1776
 
 
1777
 
 
1778
 
# func_convert_file_nix_to_cygwin ARG
1779
 
# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
1780
 
# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
1781
 
# in func_to_host_file_result.
1782
 
func_convert_file_nix_to_cygwin ()
1783
 
{
1784
 
  $opt_debug
1785
 
  func_to_host_file_result="$1"
1786
 
  if test -n "$1"; then
1787
 
    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
1788
 
    func_convert_core_file_wine_to_w32 "$1"
1789
 
    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1790
 
    func_to_host_file_result="$func_cygpath_result"
1791
 
  fi
1792
 
  func_convert_file_check "$1" "$func_to_host_file_result"
1793
 
}
1794
 
# end func_convert_file_nix_to_cygwin
1795
 
 
1796
 
 
1797
 
#############################################
1798
 
# $build to $host PATH CONVERSION FUNCTIONS #
1799
 
#############################################
1800
 
# invoked via `$to_host_path_cmd ARG'
1801
 
#
1802
 
# In each case, ARG is the path to be converted from $build to $host format.
1803
 
# The result will be available in $func_to_host_path_result.
1804
 
#
1805
 
# Path separators are also converted from $build format to $host format.  If
1806
 
# ARG begins or ends with a path separator character, it is preserved (but
1807
 
# converted to $host format) on output.
1808
 
#
1809
 
# All path conversion functions are named using the following convention:
1810
 
#   file name conversion function    : func_convert_file_X_to_Y ()
1811
 
#   path conversion function         : func_convert_path_X_to_Y ()
1812
 
# where, for any given $build/$host combination the 'X_to_Y' value is the
1813
 
# same.  If conversion functions are added for new $build/$host combinations,
1814
 
# the two new functions must follow this pattern, or func_init_to_host_path_cmd
1815
 
# will break.
1816
 
 
1817
 
 
1818
 
# func_init_to_host_path_cmd
1819
 
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
1820
 
# appropriate value, based on the value of $to_host_file_cmd.
1821
 
to_host_path_cmd=
1822
 
func_init_to_host_path_cmd ()
1823
 
{
1824
 
  $opt_debug
1825
 
  if test -z "$to_host_path_cmd"; then
1826
 
    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1827
 
    to_host_path_cmd="func_convert_path_${func_stripname_result}"
1828
 
  fi
1829
 
}
1830
 
 
1831
 
 
1832
 
# func_to_host_path ARG
1833
 
# Converts the path ARG from $build format to $host format. Return result
1834
 
# in func_to_host_path_result.
1835
 
func_to_host_path ()
1836
 
{
1837
 
  $opt_debug
1838
 
  func_init_to_host_path_cmd
1839
 
  $to_host_path_cmd "$1"
1840
 
}
1841
 
# end func_to_host_path
1842
 
 
1843
 
 
1844
 
# func_convert_path_noop ARG
1845
 
# Copy ARG to func_to_host_path_result.
1846
 
func_convert_path_noop ()
1847
 
{
1848
 
  func_to_host_path_result="$1"
1849
 
}
1850
 
# end func_convert_path_noop
1851
 
 
1852
 
 
1853
 
# func_convert_path_msys_to_w32 ARG
1854
 
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
1855
 
# conversion to w32 is not available inside the cwrapper.  Returns result in
1856
 
# func_to_host_path_result.
1857
 
func_convert_path_msys_to_w32 ()
1858
 
{
1859
 
  $opt_debug
1860
 
  func_to_host_path_result="$1"
1861
 
  if test -n "$1"; then
1862
 
    # Remove leading and trailing path separator characters from ARG.  MSYS
1863
 
    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
1864
 
    # and winepath ignores them completely.
1865
 
    func_stripname : : "$1"
1866
 
    func_to_host_path_tmp1=$func_stripname_result
1867
 
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1868
 
    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
1869
 
    func_convert_path_check : ";" \
1870
 
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1871
 
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1872
 
  fi
1873
 
}
1874
 
# end func_convert_path_msys_to_w32
1875
 
 
1876
 
 
1877
 
# func_convert_path_cygwin_to_w32 ARG
1878
 
# Convert path ARG from Cygwin to w32 format.  Returns result in
1879
 
# func_to_host_file_result.
1880
 
func_convert_path_cygwin_to_w32 ()
1881
 
{
1882
 
  $opt_debug
1883
 
  func_to_host_path_result="$1"
1884
 
  if test -n "$1"; then
1885
 
    # See func_convert_path_msys_to_w32:
1886
 
    func_stripname : : "$1"
1887
 
    func_to_host_path_tmp1=$func_stripname_result
1888
 
    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
1889
 
    func_convert_path_check : ";" \
1890
 
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1891
 
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1892
 
  fi
1893
 
}
1894
 
# end func_convert_path_cygwin_to_w32
1895
 
 
1896
 
 
1897
 
# func_convert_path_nix_to_w32 ARG
1898
 
# Convert path ARG from *nix to w32 format.  Requires a wine environment and
1899
 
# a working winepath.  Returns result in func_to_host_file_result.
1900
 
func_convert_path_nix_to_w32 ()
1901
 
{
1902
 
  $opt_debug
1903
 
  func_to_host_path_result="$1"
1904
 
  if test -n "$1"; then
1905
 
    # See func_convert_path_msys_to_w32:
1906
 
    func_stripname : : "$1"
1907
 
    func_to_host_path_tmp1=$func_stripname_result
1908
 
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1909
 
    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
1910
 
    func_convert_path_check : ";" \
1911
 
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1912
 
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
1913
 
  fi
1914
 
}
1915
 
# end func_convert_path_nix_to_w32
1916
 
 
1917
 
 
1918
 
# func_convert_path_msys_to_cygwin ARG
1919
 
# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
1920
 
# Returns result in func_to_host_file_result.
1921
 
func_convert_path_msys_to_cygwin ()
1922
 
{
1923
 
  $opt_debug
1924
 
  func_to_host_path_result="$1"
1925
 
  if test -n "$1"; then
1926
 
    # See func_convert_path_msys_to_w32:
1927
 
    func_stripname : : "$1"
1928
 
    func_to_host_path_tmp1=$func_stripname_result
1929
 
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1930
 
    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1931
 
    func_to_host_path_result="$func_cygpath_result"
1932
 
    func_convert_path_check : : \
1933
 
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1934
 
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1935
 
  fi
1936
 
}
1937
 
# end func_convert_path_msys_to_cygwin
1938
 
 
1939
 
 
1940
 
# func_convert_path_nix_to_cygwin ARG
1941
 
# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
1942
 
# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
1943
 
# func_to_host_file_result.
1944
 
func_convert_path_nix_to_cygwin ()
1945
 
{
1946
 
  $opt_debug
1947
 
  func_to_host_path_result="$1"
1948
 
  if test -n "$1"; then
1949
 
    # Remove leading and trailing path separator characters from
1950
 
    # ARG. msys behavior is inconsistent here, cygpath turns them
1951
 
    # into '.;' and ';.', and winepath ignores them completely.
1952
 
    func_stripname : : "$1"
1953
 
    func_to_host_path_tmp1=$func_stripname_result
1954
 
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1955
 
    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1956
 
    func_to_host_path_result="$func_cygpath_result"
1957
 
    func_convert_path_check : : \
1958
 
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1959
 
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
1960
 
  fi
1961
 
}
1962
 
# end func_convert_path_nix_to_cygwin
1963
 
 
1964
 
 
1965
 
# func_mode_compile arg...
1966
 
func_mode_compile ()
1967
 
{
1968
 
    $opt_debug
1969
 
    # Get the compilation command and the source file.
1970
 
    base_compile=
1971
 
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
1972
 
    suppress_opt=yes
1973
 
    suppress_output=
1974
 
    arg_mode=normal
1975
 
    libobj=
1976
 
    later=
1977
 
    pie_flag=
1978
 
 
1979
 
    for arg
1980
 
    do
1981
 
      case $arg_mode in
1982
 
      arg  )
1983
 
        # do not "continue".  Instead, add this to base_compile
1984
 
        lastarg="$arg"
1985
 
        arg_mode=normal
1986
 
        ;;
1987
 
 
1988
 
      target )
1989
 
        libobj="$arg"
1990
 
        arg_mode=normal
1991
 
        continue
1992
 
        ;;
1993
 
 
1994
 
      normal )
1995
 
        # Accept any command-line options.
1996
 
        case $arg in
1997
 
        -o)
1998
 
          test -n "$libobj" && \
1999
 
            func_fatal_error "you cannot specify \`-o' more than once"
2000
 
          arg_mode=target
2001
 
          continue
2002
 
          ;;
2003
 
 
2004
 
        -pie | -fpie | -fPIE)
2005
 
          func_append pie_flag " $arg"
2006
 
          continue
2007
 
          ;;
2008
 
 
2009
 
        -shared | -static | -prefer-pic | -prefer-non-pic)
2010
 
          func_append later " $arg"
2011
 
          continue
2012
 
          ;;
2013
 
 
2014
 
        -no-suppress)
2015
 
          suppress_opt=no
2016
 
          continue
2017
 
          ;;
2018
 
 
2019
 
        -Xcompiler)
2020
 
          arg_mode=arg  #  the next one goes into the "base_compile" arg list
2021
 
          continue      #  The current "srcfile" will either be retained or
2022
 
          ;;            #  replaced later.  I would guess that would be a bug.
2023
 
 
2024
 
        -Wc,*)
2025
 
          func_stripname '-Wc,' '' "$arg"
2026
 
          args=$func_stripname_result
2027
 
          lastarg=
2028
 
          save_ifs="$IFS"; IFS=','
2029
 
          for arg in $args; do
2030
 
            IFS="$save_ifs"
2031
 
            func_append_quoted lastarg "$arg"
2032
 
          done
2033
 
          IFS="$save_ifs"
2034
 
          func_stripname ' ' '' "$lastarg"
2035
 
          lastarg=$func_stripname_result
2036
 
 
2037
 
          # Add the arguments to base_compile.
2038
 
          func_append base_compile " $lastarg"
2039
 
          continue
2040
 
          ;;
2041
 
 
2042
 
        *)
2043
 
          # Accept the current argument as the source file.
2044
 
          # The previous "srcfile" becomes the current argument.
2045
 
          #
2046
 
          lastarg="$srcfile"
2047
 
          srcfile="$arg"
2048
 
          ;;
2049
 
        esac  #  case $arg
2050
 
        ;;
2051
 
      esac    #  case $arg_mode
2052
 
 
2053
 
      # Aesthetically quote the previous argument.
2054
 
      func_append_quoted base_compile "$lastarg"
2055
 
    done # for arg
2056
 
 
2057
 
    case $arg_mode in
2058
 
    arg)
2059
 
      func_fatal_error "you must specify an argument for -Xcompile"
2060
 
      ;;
2061
 
    target)
2062
 
      func_fatal_error "you must specify a target with \`-o'"
2063
 
      ;;
2064
 
    *)
2065
 
      # Get the name of the library object.
2066
 
      test -z "$libobj" && {
2067
 
        func_basename "$srcfile"
2068
 
        libobj="$func_basename_result"
2069
 
      }
2070
 
      ;;
2071
 
    esac
2072
 
 
2073
 
    # Recognize several different file suffixes.
2074
 
    # If the user specifies -o file.o, it is replaced with file.lo
2075
 
    case $libobj in
2076
 
    *.[cCFSifmso] | \
2077
 
    *.ada | *.adb | *.ads | *.asm | \
2078
 
    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
2079
 
    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
2080
 
      func_xform "$libobj"
2081
 
      libobj=$func_xform_result
2082
 
      ;;
2083
 
    esac
2084
 
 
2085
 
    case $libobj in
2086
 
    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2087
 
    *)
2088
 
      func_fatal_error "cannot determine name of library object from \`$libobj'"
2089
 
      ;;
2090
 
    esac
2091
 
 
2092
 
    func_infer_tag $base_compile
2093
 
 
2094
 
    for arg in $later; do
2095
 
      case $arg in
2096
 
      -shared)
2097
 
        test "$build_libtool_libs" != yes && \
2098
 
          func_fatal_configuration "can not build a shared library"
2099
 
        build_old_libs=no
2100
 
        continue
2101
 
        ;;
2102
 
 
2103
 
      -static)
2104
 
        build_libtool_libs=no
2105
 
        build_old_libs=yes
2106
 
        continue
2107
 
        ;;
2108
 
 
2109
 
      -prefer-pic)
2110
 
        pic_mode=yes
2111
 
        continue
2112
 
        ;;
2113
 
 
2114
 
      -prefer-non-pic)
2115
 
        pic_mode=no
2116
 
        continue
2117
 
        ;;
2118
 
      esac
2119
 
    done
2120
 
 
2121
 
    func_quote_for_eval "$libobj"
2122
 
    test "X$libobj" != "X$func_quote_for_eval_result" \
2123
 
      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'    &()|`$[]' \
2124
 
      && func_warning "libobj name \`$libobj' may not contain shell special characters."
2125
 
    func_dirname_and_basename "$obj" "/" ""
2126
 
    objname="$func_basename_result"
2127
 
    xdir="$func_dirname_result"
2128
 
    lobj=${xdir}$objdir/$objname
2129
 
 
2130
 
    test -z "$base_compile" && \
2131
 
      func_fatal_help "you must specify a compilation command"
2132
 
 
2133
 
    # Delete any leftover library objects.
2134
 
    if test "$build_old_libs" = yes; then
2135
 
      removelist="$obj $lobj $libobj ${libobj}T"
2136
 
    else
2137
 
      removelist="$lobj $libobj ${libobj}T"
2138
 
    fi
2139
 
 
2140
 
    # On Cygwin there's no "real" PIC flag so we must build both object types
2141
 
    case $host_os in
2142
 
    cygwin* | mingw* | pw32* | os2* | cegcc*)
2143
 
      pic_mode=default
2144
 
      ;;
2145
 
    esac
2146
 
    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
2147
 
      # non-PIC code in shared libraries is not supported
2148
 
      pic_mode=default
2149
 
    fi
2150
 
 
2151
 
    # Calculate the filename of the output object if compiler does
2152
 
    # not support -o with -c
2153
 
    if test "$compiler_c_o" = no; then
2154
 
      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2155
 
      lockfile="$output_obj.lock"
2156
 
    else
2157
 
      output_obj=
2158
 
      need_locks=no
2159
 
      lockfile=
2160
 
    fi
2161
 
 
2162
 
    # Lock this critical section if it is needed
2163
 
    # We use this script file to make the link, it avoids creating a new file
2164
 
    if test "$need_locks" = yes; then
2165
 
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2166
 
        func_echo "Waiting for $lockfile to be removed"
2167
 
        sleep 2
2168
 
      done
2169
 
    elif test "$need_locks" = warn; then
2170
 
      if test -f "$lockfile"; then
2171
 
        $ECHO "\
2172
 
*** ERROR, $lockfile exists and contains:
2173
 
`cat $lockfile 2>/dev/null`
2174
 
 
2175
 
This indicates that another process is trying to use the same
2176
 
temporary object file, and libtool could not work around it because
2177
 
your compiler does not support \`-c' and \`-o' together.  If you
2178
 
repeat this compilation, it may succeed, by chance, but you had better
2179
 
avoid parallel builds (make -j) in this platform, or get a better
2180
 
compiler."
2181
 
 
2182
 
        $opt_dry_run || $RM $removelist
2183
 
        exit $EXIT_FAILURE
2184
 
      fi
2185
 
      func_append removelist " $output_obj"
2186
 
      $ECHO "$srcfile" > "$lockfile"
2187
 
    fi
2188
 
 
2189
 
    $opt_dry_run || $RM $removelist
2190
 
    func_append removelist " $lockfile"
2191
 
    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2192
 
 
2193
 
    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2194
 
    srcfile=$func_to_tool_file_result
2195
 
    func_quote_for_eval "$srcfile"
2196
 
    qsrcfile=$func_quote_for_eval_result
2197
 
 
2198
 
    # Only build a PIC object if we are building libtool libraries.
2199
 
    if test "$build_libtool_libs" = yes; then
2200
 
      # Without this assignment, base_compile gets emptied.
2201
 
      fbsd_hideous_sh_bug=$base_compile
2202
 
 
2203
 
      if test "$pic_mode" != no; then
2204
 
        command="$base_compile $qsrcfile $pic_flag"
2205
 
      else
2206
 
        # Don't build PIC code
2207
 
        command="$base_compile $qsrcfile"
2208
 
      fi
2209
 
 
2210
 
      func_mkdir_p "$xdir$objdir"
2211
 
 
2212
 
      if test -z "$output_obj"; then
2213
 
        # Place PIC objects in $objdir
2214
 
        func_append command " -o $lobj"
2215
 
      fi
2216
 
 
2217
 
      func_show_eval_locale "$command"  \
2218
 
          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2219
 
 
2220
 
      if test "$need_locks" = warn &&
2221
 
         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2222
 
        $ECHO "\
2223
 
*** ERROR, $lockfile contains:
2224
 
`cat $lockfile 2>/dev/null`
2225
 
 
2226
 
but it should contain:
2227
 
$srcfile
2228
 
 
2229
 
This indicates that another process is trying to use the same
2230
 
temporary object file, and libtool could not work around it because
2231
 
your compiler does not support \`-c' and \`-o' together.  If you
2232
 
repeat this compilation, it may succeed, by chance, but you had better
2233
 
avoid parallel builds (make -j) in this platform, or get a better
2234
 
compiler."
2235
 
 
2236
 
        $opt_dry_run || $RM $removelist
2237
 
        exit $EXIT_FAILURE
2238
 
      fi
2239
 
 
2240
 
      # Just move the object if needed, then go on to compile the next one
2241
 
      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2242
 
        func_show_eval '$MV "$output_obj" "$lobj"' \
2243
 
          'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2244
 
      fi
2245
 
 
2246
 
      # Allow error messages only from the first compilation.
2247
 
      if test "$suppress_opt" = yes; then
2248
 
        suppress_output=' >/dev/null 2>&1'
2249
 
      fi
2250
 
    fi
2251
 
 
2252
 
    # Only build a position-dependent object if we build old libraries.
2253
 
    if test "$build_old_libs" = yes; then
2254
 
      if test "$pic_mode" != yes; then
2255
 
        # Don't build PIC code
2256
 
        command="$base_compile $qsrcfile$pie_flag"
2257
 
      else
2258
 
        command="$base_compile $qsrcfile $pic_flag"
2259
 
      fi
2260
 
      if test "$compiler_c_o" = yes; then
2261
 
        func_append command " -o $obj"
2262
 
      fi
2263
 
 
2264
 
      # Suppress compiler output if we already did a PIC compilation.
2265
 
      func_append command "$suppress_output"
2266
 
      func_show_eval_locale "$command" \
2267
 
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2268
 
 
2269
 
      if test "$need_locks" = warn &&
2270
 
         test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2271
 
        $ECHO "\
2272
 
*** ERROR, $lockfile contains:
2273
 
`cat $lockfile 2>/dev/null`
2274
 
 
2275
 
but it should contain:
2276
 
$srcfile
2277
 
 
2278
 
This indicates that another process is trying to use the same
2279
 
temporary object file, and libtool could not work around it because
2280
 
your compiler does not support \`-c' and \`-o' together.  If you
2281
 
repeat this compilation, it may succeed, by chance, but you had better
2282
 
avoid parallel builds (make -j) in this platform, or get a better
2283
 
compiler."
2284
 
 
2285
 
        $opt_dry_run || $RM $removelist
2286
 
        exit $EXIT_FAILURE
2287
 
      fi
2288
 
 
2289
 
      # Just move the object if needed
2290
 
      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2291
 
        func_show_eval '$MV "$output_obj" "$obj"' \
2292
 
          'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2293
 
      fi
2294
 
    fi
2295
 
 
2296
 
    $opt_dry_run || {
2297
 
      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2298
 
 
2299
 
      # Unlock the critical section if it was locked
2300
 
      if test "$need_locks" != no; then
2301
 
        removelist=$lockfile
2302
 
        $RM "$lockfile"
2303
 
      fi
2304
 
    }
2305
 
 
2306
 
    exit $EXIT_SUCCESS
2307
 
}
2308
 
 
2309
 
$opt_help || {
2310
 
  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
2311
 
}
2312
 
 
2313
 
func_mode_help ()
2314
 
{
2315
 
    # We need to display help for each of the modes.
2316
 
    case $opt_mode in
2317
 
      "")
2318
 
        # Generic help is extracted from the usage comments
2319
 
        # at the start of this file.
2320
 
        func_help
2321
 
        ;;
2322
 
 
2323
 
      clean)
2324
 
        $ECHO \
2325
 
"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2326
 
 
2327
 
Remove files from the build directory.
2328
 
 
2329
 
RM is the name of the program to use to delete files associated with each FILE
2330
 
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
2331
 
to RM.
2332
 
 
2333
 
If FILE is a libtool library, object or program, all the files associated
2334
 
with it are deleted. Otherwise, only FILE itself is deleted using RM."
2335
 
        ;;
2336
 
 
2337
 
      compile)
2338
 
      $ECHO \
2339
 
"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2340
 
 
2341
 
Compile a source file into a libtool library object.
2342
 
 
2343
 
This mode accepts the following additional options:
2344
 
 
2345
 
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
2346
 
  -no-suppress      do not suppress compiler output for multiple passes
2347
 
  -prefer-pic       try to build PIC objects only
2348
 
  -prefer-non-pic   try to build non-PIC objects only
2349
 
  -shared           do not build a \`.o' file suitable for static linking
2350
 
  -static           only build a \`.o' file suitable for static linking
2351
 
  -Wc,FLAG          pass FLAG directly to the compiler
2352
 
 
2353
 
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2354
 
from the given SOURCEFILE.
2355
 
 
2356
 
The output file name is determined by removing the directory component from
2357
 
SOURCEFILE, then substituting the C source code suffix \`.c' with the
2358
 
library object suffix, \`.lo'."
2359
 
        ;;
2360
 
 
2361
 
      execute)
2362
 
        $ECHO \
2363
 
"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2364
 
 
2365
 
Automatically set library path, then run a program.
2366
 
 
2367
 
This mode accepts the following additional options:
2368
 
 
2369
 
  -dlopen FILE      add the directory containing FILE to the library path
2370
 
 
2371
 
This mode sets the library path environment variable according to \`-dlopen'
2372
 
flags.
2373
 
 
2374
 
If any of the ARGS are libtool executable wrappers, then they are translated
2375
 
into their corresponding uninstalled binary, and any of their required library
2376
 
directories are added to the library path.
2377
 
 
2378
 
Then, COMMAND is executed, with ARGS as arguments."
2379
 
        ;;
2380
 
 
2381
 
      finish)
2382
 
        $ECHO \
2383
 
"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2384
 
 
2385
 
Complete the installation of libtool libraries.
2386
 
 
2387
 
Each LIBDIR is a directory that contains libtool libraries.
2388
 
 
2389
 
The commands that this mode executes may require superuser privileges.  Use
2390
 
the \`--dry-run' option if you just want to see what would be executed."
2391
 
        ;;
2392
 
 
2393
 
      install)
2394
 
        $ECHO \
2395
 
"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2396
 
 
2397
 
Install executables or libraries.
2398
 
 
2399
 
INSTALL-COMMAND is the installation command.  The first component should be
2400
 
either the \`install' or \`cp' program.
2401
 
 
2402
 
The following components of INSTALL-COMMAND are treated specially:
2403
 
 
2404
 
  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
2405
 
 
2406
 
The rest of the components are interpreted as arguments to that command (only
2407
 
BSD-compatible install options are recognized)."
2408
 
        ;;
2409
 
 
2410
 
      link)
2411
 
        $ECHO \
2412
 
"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2413
 
 
2414
 
Link object files or libraries together to form another library, or to
2415
 
create an executable program.
2416
 
 
2417
 
LINK-COMMAND is a command using the C compiler that you would use to create
2418
 
a program from several object files.
2419
 
 
2420
 
The following components of LINK-COMMAND are treated specially:
2421
 
 
2422
 
  -all-static       do not do any dynamic linking at all
2423
 
  -avoid-version    do not add a version suffix if possible
2424
 
  -bindir BINDIR    specify path to binaries directory (for systems where
2425
 
                    libraries must be found in the PATH setting at runtime)
2426
 
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
2427
 
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
2428
 
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2429
 
  -export-symbols SYMFILE
2430
 
                    try to export only the symbols listed in SYMFILE
2431
 
  -export-symbols-regex REGEX
2432
 
                    try to export only the symbols matching REGEX
2433
 
  -LLIBDIR          search LIBDIR for required installed libraries
2434
 
  -lNAME            OUTPUT-FILE requires the installed library libNAME
2435
 
  -module           build a library that can dlopened
2436
 
  -no-fast-install  disable the fast-install mode
2437
 
  -no-install       link a not-installable executable
2438
 
  -no-undefined     declare that a library does not refer to external symbols
2439
 
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
2440
 
  -objectlist FILE  Use a list of object files found in FILE to specify objects
2441
 
  -precious-files-regex REGEX
2442
 
                    don't remove output files matching REGEX
2443
 
  -release RELEASE  specify package release information
2444
 
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
2445
 
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
2446
 
  -shared           only do dynamic linking of libtool libraries
2447
 
  -shrext SUFFIX    override the standard shared library file extension
2448
 
  -static           do not do any dynamic linking of uninstalled libtool libraries
2449
 
  -static-libtool-libs
2450
 
                    do not do any dynamic linking of libtool libraries
2451
 
  -version-info CURRENT[:REVISION[:AGE]]
2452
 
                    specify library version info [each variable defaults to 0]
2453
 
  -weak LIBNAME     declare that the target provides the LIBNAME interface
2454
 
  -Wc,FLAG
2455
 
  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
2456
 
  -Wl,FLAG
2457
 
  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
2458
 
  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
2459
 
 
2460
 
All other options (arguments beginning with \`-') are ignored.
2461
 
 
2462
 
Every other argument is treated as a filename.  Files ending in \`.la' are
2463
 
treated as uninstalled libtool libraries, other files are standard or library
2464
 
object files.
2465
 
 
2466
 
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2467
 
only library objects (\`.lo' files) may be specified, and \`-rpath' is
2468
 
required, except when creating a convenience library.
2469
 
 
2470
 
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2471
 
using \`ar' and \`ranlib', or on Windows using \`lib'.
2472
 
 
2473
 
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2474
 
is created, otherwise an executable program is created."
2475
 
        ;;
2476
 
 
2477
 
      uninstall)
2478
 
        $ECHO \
2479
 
"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2480
 
 
2481
 
Remove libraries from an installation directory.
2482
 
 
2483
 
RM is the name of the program to use to delete files associated with each FILE
2484
 
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
2485
 
to RM.
2486
 
 
2487
 
If FILE is a libtool library, all the files associated with it are deleted.
2488
 
Otherwise, only FILE itself is deleted using RM."
2489
 
        ;;
2490
 
 
2491
 
      *)
2492
 
        func_fatal_help "invalid operation mode \`$opt_mode'"
2493
 
        ;;
2494
 
    esac
2495
 
 
2496
 
    echo
2497
 
    $ECHO "Try \`$progname --help' for more information about other modes."
2498
 
}
2499
 
 
2500
 
# Now that we've collected a possible --mode arg, show help if necessary
2501
 
if $opt_help; then
2502
 
  if test "$opt_help" = :; then
2503
 
    func_mode_help
2504
 
  else
2505
 
    {
2506
 
      func_help noexit
2507
 
      for opt_mode in compile link execute install finish uninstall clean; do
2508
 
        func_mode_help
2509
 
      done
2510
 
    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
2511
 
    {
2512
 
      func_help noexit
2513
 
      for opt_mode in compile link execute install finish uninstall clean; do
2514
 
        echo
2515
 
        func_mode_help
2516
 
      done
2517
 
    } |
2518
 
    sed '1d
2519
 
      /^When reporting/,/^Report/{
2520
 
        H
2521
 
        d
2522
 
      }
2523
 
      $x
2524
 
      /information about other modes/d
2525
 
      /more detailed .*MODE/d
2526
 
      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2527
 
  fi
2528
 
  exit $?
2529
 
fi
2530
 
 
2531
 
 
2532
 
# func_mode_execute arg...
2533
 
func_mode_execute ()
2534
 
{
2535
 
    $opt_debug
2536
 
    # The first argument is the command name.
2537
 
    cmd="$nonopt"
2538
 
    test -z "$cmd" && \
2539
 
      func_fatal_help "you must specify a COMMAND"
2540
 
 
2541
 
    # Handle -dlopen flags immediately.
2542
 
    for file in $opt_dlopen; do
2543
 
      test -f "$file" \
2544
 
        || func_fatal_help "\`$file' is not a file"
2545
 
 
2546
 
      dir=
2547
 
      case $file in
2548
 
      *.la)
2549
 
        func_resolve_sysroot "$file"
2550
 
        file=$func_resolve_sysroot_result
2551
 
 
2552
 
        # Check to see that this really is a libtool archive.
2553
 
        func_lalib_unsafe_p "$file" \
2554
 
          || func_fatal_help "\`$lib' is not a valid libtool archive"
2555
 
 
2556
 
        # Read the libtool library.
2557
 
        dlname=
2558
 
        library_names=
2559
 
        func_source "$file"
2560
 
 
2561
 
        # Skip this library if it cannot be dlopened.
2562
 
        if test -z "$dlname"; then
2563
 
          # Warn if it was a shared library.
2564
 
          test -n "$library_names" && \
2565
 
            func_warning "\`$file' was not linked with \`-export-dynamic'"
2566
 
          continue
2567
 
        fi
2568
 
 
2569
 
        func_dirname "$file" "" "."
2570
 
        dir="$func_dirname_result"
2571
 
 
2572
 
        if test -f "$dir/$objdir/$dlname"; then
2573
 
          func_append dir "/$objdir"
2574
 
        else
2575
 
          if test ! -f "$dir/$dlname"; then
2576
 
            func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2577
 
          fi
2578
 
        fi
2579
 
        ;;
2580
 
 
2581
 
      *.lo)
2582
 
        # Just add the directory containing the .lo file.
2583
 
        func_dirname "$file" "" "."
2584
 
        dir="$func_dirname_result"
2585
 
        ;;
2586
 
 
2587
 
      *)
2588
 
        func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
2589
 
        continue
2590
 
        ;;
2591
 
      esac
2592
 
 
2593
 
      # Get the absolute pathname.
2594
 
      absdir=`cd "$dir" && pwd`
2595
 
      test -n "$absdir" && dir="$absdir"
2596
 
 
2597
 
      # Now add the directory to shlibpath_var.
2598
 
      if eval "test -z \"\$$shlibpath_var\""; then
2599
 
        eval "$shlibpath_var=\"\$dir\""
2600
 
      else
2601
 
        eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
2602
 
      fi
2603
 
    done
2604
 
 
2605
 
    # This variable tells wrapper scripts just to set shlibpath_var
2606
 
    # rather than running their programs.
2607
 
    libtool_execute_magic="$magic"
2608
 
 
2609
 
    # Check if any of the arguments is a wrapper script.
2610
 
    args=
2611
 
    for file
2612
 
    do
2613
 
      case $file in
2614
 
      -* | *.la | *.lo ) ;;
2615
 
      *)
2616
 
        # Do a test to see if this is really a libtool program.
2617
 
        if func_ltwrapper_script_p "$file"; then
2618
 
          func_source "$file"
2619
 
          # Transform arg to wrapped name.
2620
 
          file="$progdir/$program"
2621
 
        elif func_ltwrapper_executable_p "$file"; then
2622
 
          func_ltwrapper_scriptname "$file"
2623
 
          func_source "$func_ltwrapper_scriptname_result"
2624
 
          # Transform arg to wrapped name.
2625
 
          file="$progdir/$program"
2626
 
        fi
2627
 
        ;;
2628
 
      esac
2629
 
      # Quote arguments (to preserve shell metacharacters).
2630
 
      func_append_quoted args "$file"
2631
 
    done
2632
 
 
2633
 
    if test "X$opt_dry_run" = Xfalse; then
2634
 
      if test -n "$shlibpath_var"; then
2635
 
        # Export the shlibpath_var.
2636
 
        eval "export $shlibpath_var"
2637
 
      fi
2638
 
 
2639
 
      # Restore saved environment variables
2640
 
      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
2641
 
      do
2642
 
        eval "if test \"\${save_$lt_var+set}\" = set; then
2643
 
                $lt_var=\$save_$lt_var; export $lt_var
2644
 
              else
2645
 
                $lt_unset $lt_var
2646
 
              fi"
2647
 
      done
2648
 
 
2649
 
      # Now prepare to actually exec the command.
2650
 
      exec_cmd="\$cmd$args"
2651
 
    else
2652
 
      # Display what would be done.
2653
 
      if test -n "$shlibpath_var"; then
2654
 
        eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2655
 
        echo "export $shlibpath_var"
2656
 
      fi
2657
 
      $ECHO "$cmd$args"
2658
 
      exit $EXIT_SUCCESS
2659
 
    fi
2660
 
}
2661
 
 
2662
 
test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
2663
 
 
2664
 
 
2665
 
# func_mode_finish arg...
2666
 
func_mode_finish ()
2667
 
{
2668
 
    $opt_debug
2669
 
    libs=
2670
 
    libdirs=
2671
 
    admincmds=
2672
 
 
2673
 
    for opt in "$nonopt" ${1+"$@"}
2674
 
    do
2675
 
      if test -d "$opt"; then
2676
 
        func_append libdirs " $opt"
2677
 
 
2678
 
      elif test -f "$opt"; then
2679
 
        if func_lalib_unsafe_p "$opt"; then
2680
 
          func_append libs " $opt"
2681
 
        else
2682
 
          func_warning "\`$opt' is not a valid libtool archive"
2683
 
        fi
2684
 
 
2685
 
      else
2686
 
        func_fatal_error "invalid argument \`$opt'"
2687
 
      fi
2688
 
    done
2689
 
 
2690
 
    if test -n "$libs"; then
2691
 
      if test -n "$lt_sysroot"; then
2692
 
        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
2693
 
        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
2694
 
      else
2695
 
        sysroot_cmd=
2696
 
      fi
2697
 
 
2698
 
      # Remove sysroot references
2699
 
      if $opt_dry_run; then
2700
 
        for lib in $libs; do
2701
 
          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
2702
 
        done
2703
 
      else
2704
 
        tmpdir=`func_mktempdir`
2705
 
        for lib in $libs; do
2706
 
          sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
2707
 
            > $tmpdir/tmp-la
2708
 
          mv -f $tmpdir/tmp-la $lib
2709
 
        done
2710
 
        ${RM}r "$tmpdir"
2711
 
      fi
2712
 
    fi
2713
 
 
2714
 
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2715
 
      for libdir in $libdirs; do
2716
 
        if test -n "$finish_cmds"; then
2717
 
          # Do each command in the finish commands.
2718
 
          func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
2719
 
'"$cmd"'"'
2720
 
        fi
2721
 
        if test -n "$finish_eval"; then
2722
 
          # Do the single finish_eval.
2723
 
          eval cmds=\"$finish_eval\"
2724
 
          $opt_dry_run || eval "$cmds" || func_append admincmds "
2725
 
       $cmds"
2726
 
        fi
2727
 
      done
2728
 
    fi
2729
 
 
2730
 
    # Exit here if they wanted silent mode.
2731
 
    $opt_silent && exit $EXIT_SUCCESS
2732
 
 
2733
 
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2734
 
      echo "----------------------------------------------------------------------"
2735
 
      echo "Libraries have been installed in:"
2736
 
      for libdir in $libdirs; do
2737
 
        $ECHO "   $libdir"
2738
 
      done
2739
 
      echo
2740
 
      echo "If you ever happen to want to link against installed libraries"
2741
 
      echo "in a given directory, LIBDIR, you must either use libtool, and"
2742
 
      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
2743
 
      echo "flag during linking and do at least one of the following:"
2744
 
      if test -n "$shlibpath_var"; then
2745
 
        echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
2746
 
        echo "     during execution"
2747
 
      fi
2748
 
      if test -n "$runpath_var"; then
2749
 
        echo "   - add LIBDIR to the \`$runpath_var' environment variable"
2750
 
        echo "     during linking"
2751
 
      fi
2752
 
      if test -n "$hardcode_libdir_flag_spec"; then
2753
 
        libdir=LIBDIR
2754
 
        eval flag=\"$hardcode_libdir_flag_spec\"
2755
 
 
2756
 
        $ECHO "   - use the \`$flag' linker flag"
2757
 
      fi
2758
 
      if test -n "$admincmds"; then
2759
 
        $ECHO "   - have your system administrator run these commands:$admincmds"
2760
 
      fi
2761
 
      if test -f /etc/ld.so.conf; then
2762
 
        echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
2763
 
      fi
2764
 
      echo
2765
 
 
2766
 
      echo "See any operating system documentation about shared libraries for"
2767
 
      case $host in
2768
 
        solaris2.[6789]|solaris2.1[0-9])
2769
 
          echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
2770
 
          echo "pages."
2771
 
          ;;
2772
 
        *)
2773
 
          echo "more information, such as the ld(1) and ld.so(8) manual pages."
2774
 
          ;;
2775
 
      esac
2776
 
      echo "----------------------------------------------------------------------"
2777
 
    fi
2778
 
    exit $EXIT_SUCCESS
2779
 
}
2780
 
 
2781
 
test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
2782
 
 
2783
 
 
2784
 
# func_mode_install arg...
2785
 
func_mode_install ()
2786
 
{
2787
 
    $opt_debug
2788
 
    # There may be an optional sh(1) argument at the beginning of
2789
 
    # install_prog (especially on Windows NT).
2790
 
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
2791
 
       # Allow the use of GNU shtool's install command.
2792
 
       case $nonopt in *shtool*) :;; *) false;; esac; then
2793
 
      # Aesthetically quote it.
2794
 
      func_quote_for_eval "$nonopt"
2795
 
      install_prog="$func_quote_for_eval_result "
2796
 
      arg=$1
2797
 
      shift
2798
 
    else
2799
 
      install_prog=
2800
 
      arg=$nonopt
2801
 
    fi
2802
 
 
2803
 
    # The real first argument should be the name of the installation program.
2804
 
    # Aesthetically quote it.
2805
 
    func_quote_for_eval "$arg"
2806
 
    func_append install_prog "$func_quote_for_eval_result"
2807
 
    install_shared_prog=$install_prog
2808
 
    case " $install_prog " in
2809
 
      *[\\\ /]cp\ *) install_cp=: ;;
2810
 
      *) install_cp=false ;;
2811
 
    esac
2812
 
 
2813
 
    # We need to accept at least all the BSD install flags.
2814
 
    dest=
2815
 
    files=
2816
 
    opts=
2817
 
    prev=
2818
 
    install_type=
2819
 
    isdir=no
2820
 
    stripme=
2821
 
    no_mode=:
2822
 
    for arg
2823
 
    do
2824
 
      arg2=
2825
 
      if test -n "$dest"; then
2826
 
        func_append files " $dest"
2827
 
        dest=$arg
2828
 
        continue
2829
 
      fi
2830
 
 
2831
 
      case $arg in
2832
 
      -d) isdir=yes ;;
2833
 
      -f)
2834
 
        if $install_cp; then :; else
2835
 
          prev=$arg
2836
 
        fi
2837
 
        ;;
2838
 
      -g | -m | -o)
2839
 
        prev=$arg
2840
 
        ;;
2841
 
      -s)
2842
 
        stripme=" -s"
2843
 
        continue
2844
 
        ;;
2845
 
      -*)
2846
 
        ;;
2847
 
      *)
2848
 
        # If the previous option needed an argument, then skip it.
2849
 
        if test -n "$prev"; then
2850
 
          if test "x$prev" = x-m && test -n "$install_override_mode"; then
2851
 
            arg2=$install_override_mode
2852
 
            no_mode=false
2853
 
          fi
2854
 
          prev=
2855
 
        else
2856
 
          dest=$arg
2857
 
          continue
2858
 
        fi
2859
 
        ;;
2860
 
      esac
2861
 
 
2862
 
      # Aesthetically quote the argument.
2863
 
      func_quote_for_eval "$arg"
2864
 
      func_append install_prog " $func_quote_for_eval_result"
2865
 
      if test -n "$arg2"; then
2866
 
        func_quote_for_eval "$arg2"
2867
 
      fi
2868
 
      func_append install_shared_prog " $func_quote_for_eval_result"
2869
 
    done
2870
 
 
2871
 
    test -z "$install_prog" && \
2872
 
      func_fatal_help "you must specify an install program"
2873
 
 
2874
 
    test -n "$prev" && \
2875
 
      func_fatal_help "the \`$prev' option requires an argument"
2876
 
 
2877
 
    if test -n "$install_override_mode" && $no_mode; then
2878
 
      if $install_cp; then :; else
2879
 
        func_quote_for_eval "$install_override_mode"
2880
 
        func_append install_shared_prog " -m $func_quote_for_eval_result"
2881
 
      fi
2882
 
    fi
2883
 
 
2884
 
    if test -z "$files"; then
2885
 
      if test -z "$dest"; then
2886
 
        func_fatal_help "no file or destination specified"
2887
 
      else
2888
 
        func_fatal_help "you must specify a destination"
2889
 
      fi
2890
 
    fi
2891
 
 
2892
 
    # Strip any trailing slash from the destination.
2893
 
    func_stripname '' '/' "$dest"
2894
 
    dest=$func_stripname_result
2895
 
 
2896
 
    # Check to see that the destination is a directory.
2897
 
    test -d "$dest" && isdir=yes
2898
 
    if test "$isdir" = yes; then
2899
 
      destdir="$dest"
2900
 
      destname=
2901
 
    else
2902
 
      func_dirname_and_basename "$dest" "" "."
2903
 
      destdir="$func_dirname_result"
2904
 
      destname="$func_basename_result"
2905
 
 
2906
 
      # Not a directory, so check to see that there is only one file specified.
2907
 
      set dummy $files; shift
2908
 
      test "$#" -gt 1 && \
2909
 
        func_fatal_help "\`$dest' is not a directory"
2910
 
    fi
2911
 
    case $destdir in
2912
 
    [\\/]* | [A-Za-z]:[\\/]*) ;;
2913
 
    *)
2914
 
      for file in $files; do
2915
 
        case $file in
2916
 
        *.lo) ;;
2917
 
        *)
2918
 
          func_fatal_help "\`$destdir' must be an absolute directory name"
2919
 
          ;;
2920
 
        esac
2921
 
      done
2922
 
      ;;
2923
 
    esac
2924
 
 
2925
 
    # This variable tells wrapper scripts just to set variables rather
2926
 
    # than running their programs.
2927
 
    libtool_install_magic="$magic"
2928
 
 
2929
 
    staticlibs=
2930
 
    future_libdirs=
2931
 
    current_libdirs=
2932
 
    for file in $files; do
2933
 
 
2934
 
      # Do each installation.
2935
 
      case $file in
2936
 
      *.$libext)
2937
 
        # Do the static libraries later.
2938
 
        func_append staticlibs " $file"
2939
 
        ;;
2940
 
 
2941
 
      *.la)
2942
 
        func_resolve_sysroot "$file"
2943
 
        file=$func_resolve_sysroot_result
2944
 
 
2945
 
        # Check to see that this really is a libtool archive.
2946
 
        func_lalib_unsafe_p "$file" \
2947
 
          || func_fatal_help "\`$file' is not a valid libtool archive"
2948
 
 
2949
 
        library_names=
2950
 
        old_library=
2951
 
        relink_command=
2952
 
        func_source "$file"
2953
 
 
2954
 
        # Add the libdir to current_libdirs if it is the destination.
2955
 
        if test "X$destdir" = "X$libdir"; then
2956
 
          case "$current_libdirs " in
2957
 
          *" $libdir "*) ;;
2958
 
          *) func_append current_libdirs " $libdir" ;;
2959
 
          esac
2960
 
        else
2961
 
          # Note the libdir as a future libdir.
2962
 
          case "$future_libdirs " in
2963
 
          *" $libdir "*) ;;
2964
 
          *) func_append future_libdirs " $libdir" ;;
2965
 
          esac
2966
 
        fi
2967
 
 
2968
 
        func_dirname "$file" "/" ""
2969
 
        dir="$func_dirname_result"
2970
 
        func_append dir "$objdir"
2971
 
 
2972
 
        if test -n "$relink_command"; then
2973
 
          # Determine the prefix the user has applied to our future dir.
2974
 
          inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2975
 
 
2976
 
          # Don't allow the user to place us outside of our expected
2977
 
          # location b/c this prevents finding dependent libraries that
2978
 
          # are installed to the same prefix.
2979
 
          # At present, this check doesn't affect windows .dll's that
2980
 
          # are installed into $libdir/../bin (currently, that works fine)
2981
 
          # but it's something to keep an eye on.
2982
 
          test "$inst_prefix_dir" = "$destdir" && \
2983
 
            func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2984
 
 
2985
 
          if test -n "$inst_prefix_dir"; then
2986
 
            # Stick the inst_prefix_dir data into the link command.
2987
 
            relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2988
 
          else
2989
 
            relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2990
 
          fi
2991
 
 
2992
 
          func_warning "relinking \`$file'"
2993
 
          func_show_eval "$relink_command" \
2994
 
            'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2995
 
        fi
2996
 
 
2997
 
        # See the names of the shared library.
2998
 
        set dummy $library_names; shift
2999
 
        if test -n "$1"; then
3000
 
          realname="$1"
3001
 
          shift
3002
 
 
3003
 
          srcname="$realname"
3004
 
          test -n "$relink_command" && srcname="$realname"T
3005
 
 
3006
 
          # Install the shared library and build the symlinks.
3007
 
          func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
3008
 
              'exit $?'
3009
 
          tstripme="$stripme"
3010
 
          case $host_os in
3011
 
          cygwin* | mingw* | pw32* | cegcc*)
3012
 
            case $realname in
3013
 
            *.dll.a)
3014
 
              tstripme=""
3015
 
              ;;
3016
 
            esac
3017
 
            ;;
3018
 
          esac
3019
 
          if test -n "$tstripme" && test -n "$striplib"; then
3020
 
            func_show_eval "$striplib $destdir/$realname" 'exit $?'
3021
 
          fi
3022
 
 
3023
 
          if test "$#" -gt 0; then
3024
 
            # Delete the old symlinks, and create new ones.
3025
 
            # Try `ln -sf' first, because the `ln' binary might depend on
3026
 
            # the symlink we replace!  Solaris /bin/ln does not understand -f,
3027
 
            # so we also need to try rm && ln -s.
3028
 
            for linkname
3029
 
            do
3030
 
              test "$linkname" != "$realname" \
3031
 
                && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
3032
 
            done
3033
 
          fi
3034
 
 
3035
 
          # Do each command in the postinstall commands.
3036
 
          lib="$destdir/$realname"
3037
 
          func_execute_cmds "$postinstall_cmds" 'exit $?'
3038
 
        fi
3039
 
 
3040
 
        # Install the pseudo-library for information purposes.
3041
 
        func_basename "$file"
3042
 
        name="$func_basename_result"
3043
 
        instname="$dir/$name"i
3044
 
        func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3045
 
 
3046
 
        # Maybe install the static library, too.
3047
 
        test -n "$old_library" && func_append staticlibs " $dir/$old_library"
3048
 
        ;;
3049
 
 
3050
 
      *.lo)
3051
 
        # Install (i.e. copy) a libtool object.
3052
 
 
3053
 
        # Figure out destination file name, if it wasn't already specified.
3054
 
        if test -n "$destname"; then
3055
 
          destfile="$destdir/$destname"
3056
 
        else
3057
 
          func_basename "$file"
3058
 
          destfile="$func_basename_result"
3059
 
          destfile="$destdir/$destfile"
3060
 
        fi
3061
 
 
3062
 
        # Deduce the name of the destination old-style object file.
3063
 
        case $destfile in
3064
 
        *.lo)
3065
 
          func_lo2o "$destfile"
3066
 
          staticdest=$func_lo2o_result
3067
 
          ;;
3068
 
        *.$objext)
3069
 
          staticdest="$destfile"
3070
 
          destfile=
3071
 
          ;;
3072
 
        *)
3073
 
          func_fatal_help "cannot copy a libtool object to \`$destfile'"
3074
 
          ;;
3075
 
        esac
3076
 
 
3077
 
        # Install the libtool object if requested.
3078
 
        test -n "$destfile" && \
3079
 
          func_show_eval "$install_prog $file $destfile" 'exit $?'
3080
 
 
3081
 
        # Install the old object if enabled.
3082
 
        if test "$build_old_libs" = yes; then
3083
 
          # Deduce the name of the old-style object file.
3084
 
          func_lo2o "$file"
3085
 
          staticobj=$func_lo2o_result
3086
 
          func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
3087
 
        fi
3088
 
        exit $EXIT_SUCCESS
3089
 
        ;;
3090
 
 
3091
 
      *)
3092
 
        # Figure out destination file name, if it wasn't already specified.
3093
 
        if test -n "$destname"; then
3094
 
          destfile="$destdir/$destname"
3095
 
        else
3096
 
          func_basename "$file"
3097
 
          destfile="$func_basename_result"
3098
 
          destfile="$destdir/$destfile"
3099
 
        fi
3100
 
 
3101
 
        # If the file is missing, and there is a .exe on the end, strip it
3102
 
        # because it is most likely a libtool script we actually want to
3103
 
        # install
3104
 
        stripped_ext=""
3105
 
        case $file in
3106
 
          *.exe)
3107
 
            if test ! -f "$file"; then
3108
 
              func_stripname '' '.exe' "$file"
3109
 
              file=$func_stripname_result
3110
 
              stripped_ext=".exe"
3111
 
            fi
3112
 
            ;;
3113
 
        esac
3114
 
 
3115
 
        # Do a test to see if this is really a libtool program.
3116
 
        case $host in
3117
 
        *cygwin* | *mingw*)
3118
 
            if func_ltwrapper_executable_p "$file"; then
3119
 
              func_ltwrapper_scriptname "$file"
3120
 
              wrapper=$func_ltwrapper_scriptname_result
3121
 
            else
3122
 
              func_stripname '' '.exe' "$file"
3123
 
              wrapper=$func_stripname_result
3124
 
            fi
3125
 
            ;;
3126
 
        *)
3127
 
            wrapper=$file
3128
 
            ;;
3129
 
        esac
3130
 
        if func_ltwrapper_script_p "$wrapper"; then
3131
 
          notinst_deplibs=
3132
 
          relink_command=
3133
 
 
3134
 
          func_source "$wrapper"
3135
 
 
3136
 
          # Check the variables that should have been set.
3137
 
          test -z "$generated_by_libtool_version" && \
3138
 
            func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3139
 
 
3140
 
          finalize=yes
3141
 
          for lib in $notinst_deplibs; do
3142
 
            # Check to see that each library is installed.
3143
 
            libdir=
3144
 
            if test -f "$lib"; then
3145
 
              func_source "$lib"
3146
 
            fi
3147
 
            libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
3148
 
            if test -n "$libdir" && test ! -f "$libfile"; then
3149
 
              func_warning "\`$lib' has not been installed in \`$libdir'"
3150
 
              finalize=no
3151
 
            fi
3152
 
          done
3153
 
 
3154
 
          relink_command=
3155
 
          func_source "$wrapper"
3156
 
 
3157
 
          outputname=
3158
 
          if test "$fast_install" = no && test -n "$relink_command"; then
3159
 
            $opt_dry_run || {
3160
 
              if test "$finalize" = yes; then
3161
 
                tmpdir=`func_mktempdir`
3162
 
                func_basename "$file$stripped_ext"
3163
 
                file="$func_basename_result"
3164
 
                outputname="$tmpdir/$file"
3165
 
                # Replace the output file specification.
3166
 
                relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3167
 
 
3168
 
                $opt_silent || {
3169
 
                  func_quote_for_expand "$relink_command"
3170
 
                  eval "func_echo $func_quote_for_expand_result"
3171
 
                }
3172
 
                if eval "$relink_command"; then :
3173
 
                  else
3174
 
                  func_error "error: relink \`$file' with the above command before installing it"
3175
 
                  $opt_dry_run || ${RM}r "$tmpdir"
3176
 
                  continue
3177
 
                fi
3178
 
                file="$outputname"
3179
 
              else
3180
 
                func_warning "cannot relink \`$file'"
3181
 
              fi
3182
 
            }
3183
 
          else
3184
 
            # Install the binary that we compiled earlier.
3185
 
            file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3186
 
          fi
3187
 
        fi
3188
 
 
3189
 
        # remove .exe since cygwin /usr/bin/install will append another
3190
 
        # one anyway
3191
 
        case $install_prog,$host in
3192
 
        */usr/bin/install*,*cygwin*)
3193
 
          case $file:$destfile in
3194
 
          *.exe:*.exe)
3195
 
            # this is ok
3196
 
            ;;
3197
 
          *.exe:*)
3198
 
            destfile=$destfile.exe
3199
 
            ;;
3200
 
          *:*.exe)
3201
 
            func_stripname '' '.exe' "$destfile"
3202
 
            destfile=$func_stripname_result
3203
 
            ;;
3204
 
          esac
3205
 
          ;;
3206
 
        esac
3207
 
        func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
3208
 
        $opt_dry_run || if test -n "$outputname"; then
3209
 
          ${RM}r "$tmpdir"
3210
 
        fi
3211
 
        ;;
3212
 
      esac
3213
 
    done
3214
 
 
3215
 
    for file in $staticlibs; do
3216
 
      func_basename "$file"
3217
 
      name="$func_basename_result"
3218
 
 
3219
 
      # Set up the ranlib parameters.
3220
 
      oldlib="$destdir/$name"
3221
 
      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
3222
 
      tool_oldlib=$func_to_tool_file_result
3223
 
 
3224
 
      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
3225
 
 
3226
 
      if test -n "$stripme" && test -n "$old_striplib"; then
3227
 
        func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
3228
 
      fi
3229
 
 
3230
 
      # Do each command in the postinstall commands.
3231
 
      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
3232
 
    done
3233
 
 
3234
 
    test -n "$future_libdirs" && \
3235
 
      func_warning "remember to run \`$progname --finish$future_libdirs'"
3236
 
 
3237
 
    if test -n "$current_libdirs"; then
3238
 
      # Maybe just do a dry run.
3239
 
      $opt_dry_run && current_libdirs=" -n$current_libdirs"
3240
 
      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
3241
 
    else
3242
 
      exit $EXIT_SUCCESS
3243
 
    fi
3244
 
}
3245
 
 
3246
 
test "$opt_mode" = install && func_mode_install ${1+"$@"}
3247
 
 
3248
 
 
3249
 
# func_generate_dlsyms outputname originator pic_p
3250
 
# Extract symbols from dlprefiles and create ${outputname}S.o with
3251
 
# a dlpreopen symbol table.
3252
 
func_generate_dlsyms ()
3253
 
{
3254
 
    $opt_debug
3255
 
    my_outputname="$1"
3256
 
    my_originator="$2"
3257
 
    my_pic_p="${3-no}"
3258
 
    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3259
 
    my_dlsyms=
3260
 
 
3261
 
    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3262
 
      if test -n "$NM" && test -n "$global_symbol_pipe"; then
3263
 
        my_dlsyms="${my_outputname}S.c"
3264
 
      else
3265
 
        func_error "not configured to extract global symbols from dlpreopened files"
3266
 
      fi
3267
 
    fi
3268
 
 
3269
 
    if test -n "$my_dlsyms"; then
3270
 
      case $my_dlsyms in
3271
 
      "") ;;
3272
 
      *.c)
3273
 
        # Discover the nlist of each of the dlfiles.
3274
 
        nlist="$output_objdir/${my_outputname}.nm"
3275
 
 
3276
 
        func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3277
 
 
3278
 
        # Parse the name list into a source file.
3279
 
        func_verbose "creating $output_objdir/$my_dlsyms"
3280
 
 
3281
 
        $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3282
 
/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3283
 
/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3284
 
 
3285
 
#ifdef __cplusplus
3286
 
extern \"C\" {
3287
 
#endif
3288
 
 
3289
 
#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3290
 
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3291
 
#endif
3292
 
 
3293
 
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3294
 
#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3295
 
/* DATA imports from DLLs on WIN32 con't be const, because runtime
3296
 
   relocations are performed -- see ld's documentation on pseudo-relocs.  */
3297
 
# define LT_DLSYM_CONST
3298
 
#elif defined(__osf__)
3299
 
/* This system does not cope well with relocations in const data.  */
3300
 
# define LT_DLSYM_CONST
3301
 
#else
3302
 
# define LT_DLSYM_CONST const
3303
 
#endif
3304
 
 
3305
 
/* External symbol declarations for the compiler. */\
3306
 
"
3307
 
 
3308
 
        if test "$dlself" = yes; then
3309
 
          func_verbose "generating symbol list for \`$output'"
3310
 
 
3311
 
          $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3312
 
 
3313
 
          # Add our own program objects to the symbol list.
3314
 
          progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3315
 
          for progfile in $progfiles; do
3316
 
            func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3317
 
            func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3318
 
            $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3319
 
          done
3320
 
 
3321
 
          if test -n "$exclude_expsyms"; then
3322
 
            $opt_dry_run || {
3323
 
              eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3324
 
              eval '$MV "$nlist"T "$nlist"'
3325
 
            }
3326
 
          fi
3327
 
 
3328
 
          if test -n "$export_symbols_regex"; then
3329
 
            $opt_dry_run || {
3330
 
              eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3331
 
              eval '$MV "$nlist"T "$nlist"'
3332
 
            }
3333
 
          fi
3334
 
 
3335
 
          # Prepare the list of exported symbols
3336
 
          if test -z "$export_symbols"; then
3337
 
            export_symbols="$output_objdir/$outputname.exp"
3338
 
            $opt_dry_run || {
3339
 
              $RM $export_symbols
3340
 
              eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3341
 
              case $host in
3342
 
              *cygwin* | *mingw* | *cegcc* )
3343
 
                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3344
 
                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3345
 
                ;;
3346
 
              esac
3347
 
            }
3348
 
          else
3349
 
            $opt_dry_run || {
3350
 
              eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3351
 
              eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3352
 
              eval '$MV "$nlist"T "$nlist"'
3353
 
              case $host in
3354
 
                *cygwin* | *mingw* | *cegcc* )
3355
 
                  eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3356
 
                  eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3357
 
                  ;;
3358
 
              esac
3359
 
            }
3360
 
          fi
3361
 
        fi
3362
 
 
3363
 
        for dlprefile in $dlprefiles; do
3364
 
          func_verbose "extracting global C symbols from \`$dlprefile'"
3365
 
          func_basename "$dlprefile"
3366
 
          name="$func_basename_result"
3367
 
          case $host in
3368
 
            *cygwin* | *mingw* | *cegcc* )
3369
 
              # if an import library, we need to obtain dlname
3370
 
              if func_win32_import_lib_p "$dlprefile"; then
3371
 
                func_tr_sh "$dlprefile"
3372
 
                eval "curr_lafile=\$libfile_$func_tr_sh_result"
3373
 
                dlprefile_dlbasename=""
3374
 
                if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3375
 
                  # Use subshell, to avoid clobbering current variable values
3376
 
                  dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3377
 
                  if test -n "$dlprefile_dlname" ; then
3378
 
                    func_basename "$dlprefile_dlname"
3379
 
                    dlprefile_dlbasename="$func_basename_result"
3380
 
                  else
3381
 
                    # no lafile. user explicitly requested -dlpreopen <import library>.
3382
 
                    $sharedlib_from_linklib_cmd "$dlprefile"
3383
 
                    dlprefile_dlbasename=$sharedlib_from_linklib_result
3384
 
                  fi
3385
 
                fi
3386
 
                $opt_dry_run || {
3387
 
                  if test -n "$dlprefile_dlbasename" ; then
3388
 
                    eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3389
 
                  else
3390
 
                    func_warning "Could not compute DLL name from $name"
3391
 
                    eval '$ECHO ": $name " >> "$nlist"'
3392
 
                  fi
3393
 
                  func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3394
 
                  eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3395
 
                    $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3396
 
                }
3397
 
              else # not an import lib
3398
 
                $opt_dry_run || {
3399
 
                  eval '$ECHO ": $name " >> "$nlist"'
3400
 
                  func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3401
 
                  eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3402
 
                }
3403
 
              fi
3404
 
            ;;
3405
 
            *)
3406
 
              $opt_dry_run || {
3407
 
                eval '$ECHO ": $name " >> "$nlist"'
3408
 
                func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3409
 
                eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3410
 
              }
3411
 
            ;;
3412
 
          esac
3413
 
        done
3414
 
 
3415
 
        $opt_dry_run || {
3416
 
          # Make sure we have at least an empty file.
3417
 
          test -f "$nlist" || : > "$nlist"
3418
 
 
3419
 
          if test -n "$exclude_expsyms"; then
3420
 
            $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3421
 
            $MV "$nlist"T "$nlist"
3422
 
          fi
3423
 
 
3424
 
          # Try sorting and uniquifying the output.
3425
 
          if $GREP -v "^: " < "$nlist" |
3426
 
              if sort -k 3 </dev/null >/dev/null 2>&1; then
3427
 
                sort -k 3
3428
 
              else
3429
 
                sort +2
3430
 
              fi |
3431
 
              uniq > "$nlist"S; then
3432
 
            :
3433
 
          else
3434
 
            $GREP -v "^: " < "$nlist" > "$nlist"S
3435
 
          fi
3436
 
 
3437
 
          if test -f "$nlist"S; then
3438
 
            eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3439
 
          else
3440
 
            echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3441
 
          fi
3442
 
 
3443
 
          echo >> "$output_objdir/$my_dlsyms" "\
3444
 
 
3445
 
/* The mapping between symbol names and symbols.  */
3446
 
typedef struct {
3447
 
  const char *name;
3448
 
  void *address;
3449
 
} lt_dlsymlist;
3450
 
extern LT_DLSYM_CONST lt_dlsymlist
3451
 
lt_${my_prefix}_LTX_preloaded_symbols[];
3452
 
LT_DLSYM_CONST lt_dlsymlist
3453
 
lt_${my_prefix}_LTX_preloaded_symbols[] =
3454
 
{\
3455
 
  { \"$my_originator\", (void *) 0 },"
3456
 
 
3457
 
          case $need_lib_prefix in
3458
 
          no)
3459
 
            eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3460
 
            ;;
3461
 
          *)
3462
 
            eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3463
 
            ;;
3464
 
          esac
3465
 
          echo >> "$output_objdir/$my_dlsyms" "\
3466
 
  {0, (void *) 0}
3467
 
};
3468
 
 
3469
 
/* This works around a problem in FreeBSD linker */
3470
 
#ifdef FREEBSD_WORKAROUND
3471
 
static const void *lt_preloaded_setup() {
3472
 
  return lt_${my_prefix}_LTX_preloaded_symbols;
3473
 
}
3474
 
#endif
3475
 
 
3476
 
#ifdef __cplusplus
3477
 
}
3478
 
#endif\
3479
 
"
3480
 
        } # !$opt_dry_run
3481
 
 
3482
 
        pic_flag_for_symtable=
3483
 
        case "$compile_command " in
3484
 
        *" -static "*) ;;
3485
 
        *)
3486
 
          case $host in
3487
 
          # compiling the symbol table file with pic_flag works around
3488
 
          # a FreeBSD bug that causes programs to crash when -lm is
3489
 
          # linked before any other PIC object.  But we must not use
3490
 
          # pic_flag when linking with -static.  The problem exists in
3491
 
          # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3492
 
          *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3493
 
            pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
3494
 
          *-*-hpux*)
3495
 
            pic_flag_for_symtable=" $pic_flag"  ;;
3496
 
          *)
3497
 
            if test "X$my_pic_p" != Xno; then
3498
 
              pic_flag_for_symtable=" $pic_flag"
3499
 
            fi
3500
 
            ;;
3501
 
          esac
3502
 
          ;;
3503
 
        esac
3504
 
        symtab_cflags=
3505
 
        for arg in $LTCFLAGS; do
3506
 
          case $arg in
3507
 
          -pie | -fpie | -fPIE) ;;
3508
 
          *) func_append symtab_cflags " $arg" ;;
3509
 
          esac
3510
 
        done
3511
 
 
3512
 
        # Now compile the dynamic symbol file.
3513
 
        func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3514
 
 
3515
 
        # Clean up the generated files.
3516
 
        func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3517
 
 
3518
 
        # Transform the symbol file into the correct name.
3519
 
        symfileobj="$output_objdir/${my_outputname}S.$objext"
3520
 
        case $host in
3521
 
        *cygwin* | *mingw* | *cegcc* )
3522
 
          if test -f "$output_objdir/$my_outputname.def"; then
3523
 
            compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3524
 
            finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3525
 
          else
3526
 
            compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3527
 
            finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3528
 
          fi
3529
 
          ;;
3530
 
        *)
3531
 
          compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3532
 
          finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3533
 
          ;;
3534
 
        esac
3535
 
        ;;
3536
 
      *)
3537
 
        func_fatal_error "unknown suffix for \`$my_dlsyms'"
3538
 
        ;;
3539
 
      esac
3540
 
    else
3541
 
      # We keep going just in case the user didn't refer to
3542
 
      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
3543
 
      # really was required.
3544
 
 
3545
 
      # Nullify the symbol file.
3546
 
      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
3547
 
      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
3548
 
    fi
3549
 
}
3550
 
 
3551
 
# func_win32_libid arg
3552
 
# return the library type of file 'arg'
3553
 
#
3554
 
# Need a lot of goo to handle *both* DLLs and import libs
3555
 
# Has to be a shell function in order to 'eat' the argument
3556
 
# that is supplied when $file_magic_command is called.
3557
 
# Despite the name, also deal with 64 bit binaries.
3558
 
func_win32_libid ()
3559
 
{
3560
 
  $opt_debug
3561
 
  win32_libid_type="unknown"
3562
 
  win32_fileres=`file -L $1 2>/dev/null`
3563
 
  case $win32_fileres in
3564
 
  *ar\ archive\ import\ library*) # definitely import
3565
 
    win32_libid_type="x86 archive import"
3566
 
    ;;
3567
 
  *ar\ archive*) # could be an import, or static
3568
 
    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3569
 
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3570
 
       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3571
 
      func_to_tool_file "$1" func_convert_file_msys_to_w32
3572
 
      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3573
 
        $SED -n -e '
3574
 
            1,100{
3575
 
                / I /{
3576
 
                    s,.*,import,
3577
 
                    p
3578
 
                    q
3579
 
                }
3580
 
            }'`
3581
 
      case $win32_nmres in
3582
 
      import*)  win32_libid_type="x86 archive import";;
3583
 
      *)        win32_libid_type="x86 archive static";;
3584
 
      esac
3585
 
    fi
3586
 
    ;;
3587
 
  *DLL*)
3588
 
    win32_libid_type="x86 DLL"
3589
 
    ;;
3590
 
  *executable*) # but shell scripts are "executable" too...
3591
 
    case $win32_fileres in
3592
 
    *MS\ Windows\ PE\ Intel*)
3593
 
      win32_libid_type="x86 DLL"
3594
 
      ;;
3595
 
    esac
3596
 
    ;;
3597
 
  esac
3598
 
  $ECHO "$win32_libid_type"
3599
 
}
3600
 
 
3601
 
# func_cygming_dll_for_implib ARG
3602
 
#
3603
 
# Platform-specific function to extract the
3604
 
# name of the DLL associated with the specified
3605
 
# import library ARG.
3606
 
# Invoked by eval'ing the libtool variable
3607
 
#    $sharedlib_from_linklib_cmd
3608
 
# Result is available in the variable
3609
 
#    $sharedlib_from_linklib_result
3610
 
func_cygming_dll_for_implib ()
3611
 
{
3612
 
  $opt_debug
3613
 
  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3614
 
}
3615
 
 
3616
 
# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
3617
 
#
3618
 
# The is the core of a fallback implementation of a
3619
 
# platform-specific function to extract the name of the
3620
 
# DLL associated with the specified import library LIBNAME.
3621
 
#
3622
 
# SECTION_NAME is either .idata$6 or .idata$7, depending
3623
 
# on the platform and compiler that created the implib.
3624
 
#
3625
 
# Echos the name of the DLL associated with the
3626
 
# specified import library.
3627
 
func_cygming_dll_for_implib_fallback_core ()
3628
 
{
3629
 
  $opt_debug
3630
 
  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3631
 
  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3632
 
    $SED '/^Contents of section '"$match_literal"':/{
3633
 
      # Place marker at beginning of archive member dllname section
3634
 
      s/.*/====MARK====/
3635
 
      p
3636
 
      d
3637
 
    }
3638
 
    # These lines can sometimes be longer than 43 characters, but
3639
 
    # are always uninteresting
3640
 
    /:[  ]*file format pe[i]\{,1\}-/d
3641
 
    /^In archive [^:]*:/d
3642
 
    # Ensure marker is printed
3643
 
    /^====MARK====/p
3644
 
    # Remove all lines with less than 43 characters
3645
 
    /^.\{43\}/!d
3646
 
    # From remaining lines, remove first 43 characters
3647
 
    s/^.\{43\}//' |
3648
 
    $SED -n '
3649
 
      # Join marker and all lines until next marker into a single line
3650
 
      /^====MARK====/ b para
3651
 
      H
3652
 
      $ b para
3653
 
      b
3654
 
      :para
3655
 
      x
3656
 
      s/\n//g
3657
 
      # Remove the marker
3658
 
      s/^====MARK====//
3659
 
      # Remove trailing dots and whitespace
3660
 
      s/[\. \t]*$//
3661
 
      # Print
3662
 
      /./p' |
3663
 
    # we now have a list, one entry per line, of the stringified
3664
 
    # contents of the appropriate section of all members of the
3665
 
    # archive which possess that section. Heuristic: eliminate
3666
 
    # all those which have a first or second character that is
3667
 
    # a '.' (that is, objdump's representation of an unprintable
3668
 
    # character.) This should work for all archives with less than
3669
 
    # 0x302f exports -- but will fail for DLLs whose name actually
3670
 
    # begins with a literal '.' or a single character followed by
3671
 
    # a '.'.
3672
 
    #
3673
 
    # Of those that remain, print the first one.
3674
 
    $SED -e '/^\./d;/^.\./d;q'
3675
 
}
3676
 
 
3677
 
# func_cygming_gnu_implib_p ARG
3678
 
# This predicate returns with zero status (TRUE) if
3679
 
# ARG is a GNU/binutils-style import library. Returns
3680
 
# with nonzero status (FALSE) otherwise.
3681
 
func_cygming_gnu_implib_p ()
3682
 
{
3683
 
  $opt_debug
3684
 
  func_to_tool_file "$1" func_convert_file_msys_to_w32
3685
 
  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
3686
 
  test -n "$func_cygming_gnu_implib_tmp"
3687
 
}
3688
 
 
3689
 
# func_cygming_ms_implib_p ARG
3690
 
# This predicate returns with zero status (TRUE) if
3691
 
# ARG is an MS-style import library. Returns
3692
 
# with nonzero status (FALSE) otherwise.
3693
 
func_cygming_ms_implib_p ()
3694
 
{
3695
 
  $opt_debug
3696
 
  func_to_tool_file "$1" func_convert_file_msys_to_w32
3697
 
  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3698
 
  test -n "$func_cygming_ms_implib_tmp"
3699
 
}
3700
 
 
3701
 
# func_cygming_dll_for_implib_fallback ARG
3702
 
# Platform-specific function to extract the
3703
 
# name of the DLL associated with the specified
3704
 
# import library ARG.
3705
 
#
3706
 
# This fallback implementation is for use when $DLLTOOL
3707
 
# does not support the --identify-strict option.
3708
 
# Invoked by eval'ing the libtool variable
3709
 
#    $sharedlib_from_linklib_cmd
3710
 
# Result is available in the variable
3711
 
#    $sharedlib_from_linklib_result
3712
 
func_cygming_dll_for_implib_fallback ()
3713
 
{
3714
 
  $opt_debug
3715
 
  if func_cygming_gnu_implib_p "$1" ; then
3716
 
    # binutils import library
3717
 
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
3718
 
  elif func_cygming_ms_implib_p "$1" ; then
3719
 
    # ms-generated import library
3720
 
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
3721
 
  else
3722
 
    # unknown
3723
 
    sharedlib_from_linklib_result=""
3724
 
  fi
3725
 
}
3726
 
 
3727
 
 
3728
 
# func_extract_an_archive dir oldlib
3729
 
func_extract_an_archive ()
3730
 
{
3731
 
    $opt_debug
3732
 
    f_ex_an_ar_dir="$1"; shift
3733
 
    f_ex_an_ar_oldlib="$1"
3734
 
    if test "$lock_old_archive_extraction" = yes; then
3735
 
      lockfile=$f_ex_an_ar_oldlib.lock
3736
 
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3737
 
        func_echo "Waiting for $lockfile to be removed"
3738
 
        sleep 2
3739
 
      done
3740
 
    fi
3741
 
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
3742
 
                   'stat=$?; rm -f "$lockfile"; exit $stat'
3743
 
    if test "$lock_old_archive_extraction" = yes; then
3744
 
      $opt_dry_run || rm -f "$lockfile"
3745
 
    fi
3746
 
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
3747
 
     :
3748
 
    else
3749
 
      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
3750
 
    fi
3751
 
}
3752
 
 
3753
 
 
3754
 
# func_extract_archives gentop oldlib ...
3755
 
func_extract_archives ()
3756
 
{
3757
 
    $opt_debug
3758
 
    my_gentop="$1"; shift
3759
 
    my_oldlibs=${1+"$@"}
3760
 
    my_oldobjs=""
3761
 
    my_xlib=""
3762
 
    my_xabs=""
3763
 
    my_xdir=""
3764
 
 
3765
 
    for my_xlib in $my_oldlibs; do
3766
 
      # Extract the objects.
3767
 
      case $my_xlib in
3768
 
        [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
3769
 
        *) my_xabs=`pwd`"/$my_xlib" ;;
3770
 
      esac
3771
 
      func_basename "$my_xlib"
3772
 
      my_xlib="$func_basename_result"
3773
 
      my_xlib_u=$my_xlib
3774
 
      while :; do
3775
 
        case " $extracted_archives " in
3776
 
        *" $my_xlib_u "*)
3777
 
          func_arith $extracted_serial + 1
3778
 
          extracted_serial=$func_arith_result
3779
 
          my_xlib_u=lt$extracted_serial-$my_xlib ;;
3780
 
        *) break ;;
3781
 
        esac
3782
 
      done
3783
 
      extracted_archives="$extracted_archives $my_xlib_u"
3784
 
      my_xdir="$my_gentop/$my_xlib_u"
3785
 
 
3786
 
      func_mkdir_p "$my_xdir"
3787
 
 
3788
 
      case $host in
3789
 
      *-darwin*)
3790
 
        func_verbose "Extracting $my_xabs"
3791
 
        # Do not bother doing anything if just a dry run
3792
 
        $opt_dry_run || {
3793
 
          darwin_orig_dir=`pwd`
3794
 
          cd $my_xdir || exit $?
3795
 
          darwin_archive=$my_xabs
3796
 
          darwin_curdir=`pwd`
3797
 
          darwin_base_archive=`basename "$darwin_archive"`
3798
 
          darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
3799
 
          if test -n "$darwin_arches"; then
3800
 
            darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
3801
 
            darwin_arch=
3802
 
            func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
3803
 
            for darwin_arch in  $darwin_arches ; do
3804
 
              func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3805
 
              $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
3806
 
              cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
3807
 
              func_extract_an_archive "`pwd`" "${darwin_base_archive}"
3808
 
              cd "$darwin_curdir"
3809
 
              $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
3810
 
            done # $darwin_arches
3811
 
            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
3812
 
            darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
3813
 
            darwin_file=
3814
 
            darwin_files=
3815
 
            for darwin_file in $darwin_filelist; do
3816
 
              darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
3817
 
              $LIPO -create -output "$darwin_file" $darwin_files
3818
 
            done # $darwin_filelist
3819
 
            $RM -rf unfat-$$
3820
 
            cd "$darwin_orig_dir"
3821
 
          else
3822
 
            cd $darwin_orig_dir
3823
 
            func_extract_an_archive "$my_xdir" "$my_xabs"
3824
 
          fi # $darwin_arches
3825
 
        } # !$opt_dry_run
3826
 
        ;;
3827
 
      *)
3828
 
        func_extract_an_archive "$my_xdir" "$my_xabs"
3829
 
        ;;
3830
 
      esac
3831
 
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
3832
 
    done
3833
 
 
3834
 
    func_extract_archives_result="$my_oldobjs"
3835
 
}
3836
 
 
3837
 
 
3838
 
# func_emit_wrapper [arg=no]
3839
 
#
3840
 
# Emit a libtool wrapper script on stdout.
3841
 
# Don't directly open a file because we may want to
3842
 
# incorporate the script contents within a cygwin/mingw
3843
 
# wrapper executable.  Must ONLY be called from within
3844
 
# func_mode_link because it depends on a number of variables
3845
 
# set therein.
3846
 
#
3847
 
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3848
 
# variable will take.  If 'yes', then the emitted script
3849
 
# will assume that the directory in which it is stored is
3850
 
# the $objdir directory.  This is a cygwin/mingw-specific
3851
 
# behavior.
3852
 
func_emit_wrapper ()
3853
 
{
3854
 
        func_emit_wrapper_arg1=${1-no}
3855
 
 
3856
 
        $ECHO "\
3857
 
#! $SHELL
3858
 
 
3859
 
# $output - temporary wrapper script for $objdir/$outputname
3860
 
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3861
 
#
3862
 
# The $output program cannot be directly executed until all the libtool
3863
 
# libraries that it depends on are installed.
3864
 
#
3865
 
# This wrapper script should never be moved out of the build directory.
3866
 
# If it is, it will not operate correctly.
3867
 
 
3868
 
# Sed substitution that helps us do robust quoting.  It backslashifies
3869
 
# metacharacters that are still active within double-quoted strings.
3870
 
sed_quote_subst='$sed_quote_subst'
3871
 
 
3872
 
# Be Bourne compatible
3873
 
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
3874
 
  emulate sh
3875
 
  NULLCMD=:
3876
 
  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
3877
 
  # is contrary to our usage.  Disable this feature.
3878
 
  alias -g '\${1+\"\$@\"}'='\"\$@\"'
3879
 
  setopt NO_GLOB_SUBST
3880
 
else
3881
 
  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
3882
 
fi
3883
 
BIN_SH=xpg4; export BIN_SH # for Tru64
3884
 
DUALCASE=1; export DUALCASE # for MKS sh
3885
 
 
3886
 
# The HP-UX ksh and POSIX shell print the target directory to stdout
3887
 
# if CDPATH is set.
3888
 
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
3889
 
 
3890
 
relink_command=\"$relink_command\"
3891
 
 
3892
 
# This environment variable determines our operation mode.
3893
 
if test \"\$libtool_install_magic\" = \"$magic\"; then
3894
 
  # install mode needs the following variables:
3895
 
  generated_by_libtool_version='$macro_version'
3896
 
  notinst_deplibs='$notinst_deplibs'
3897
 
else
3898
 
  # When we are sourced in execute mode, \$file and \$ECHO are already set.
3899
 
  if test \"\$libtool_execute_magic\" != \"$magic\"; then
3900
 
    file=\"\$0\""
3901
 
 
3902
 
    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
3903
 
    $ECHO "\
3904
 
 
3905
 
# A function that is used when there is no print builtin or printf.
3906
 
func_fallback_echo ()
3907
 
{
3908
 
  eval 'cat <<_LTECHO_EOF
3909
 
\$1
3910
 
_LTECHO_EOF'
3911
 
}
3912
 
    ECHO=\"$qECHO\"
3913
 
  fi
3914
 
 
3915
 
# Very basic option parsing. These options are (a) specific to
3916
 
# the libtool wrapper, (b) are identical between the wrapper
3917
 
# /script/ and the wrapper /executable/ which is used only on
3918
 
# windows platforms, and (c) all begin with the string "--lt-"
3919
 
# (application programs are unlikely to have options which match
3920
 
# this pattern).
3921
 
#
3922
 
# There are only two supported options: --lt-debug and
3923
 
# --lt-dump-script. There is, deliberately, no --lt-help.
3924
 
#
3925
 
# The first argument to this parsing function should be the
3926
 
# script's $0 value, followed by "$@".
3927
 
lt_option_debug=
3928
 
func_parse_lt_options ()
3929
 
{
3930
 
  lt_script_arg0=\$0
3931
 
  shift
3932
 
  for lt_opt
3933
 
  do
3934
 
    case \"\$lt_opt\" in
3935
 
    --lt-debug) lt_option_debug=1 ;;
3936
 
    --lt-dump-script)
3937
 
        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
3938
 
        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
3939
 
        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
3940
 
        cat \"\$lt_dump_D/\$lt_dump_F\"
3941
 
        exit 0
3942
 
      ;;
3943
 
    --lt-*)
3944
 
        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
3945
 
        exit 1
3946
 
      ;;
3947
 
    esac
3948
 
  done
3949
 
 
3950
 
  # Print the debug banner immediately:
3951
 
  if test -n \"\$lt_option_debug\"; then
3952
 
    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
3953
 
  fi
3954
 
}
3955
 
 
3956
 
# Used when --lt-debug. Prints its arguments to stdout
3957
 
# (redirection is the responsibility of the caller)
3958
 
func_lt_dump_args ()
3959
 
{
3960
 
  lt_dump_args_N=1;
3961
 
  for lt_arg
3962
 
  do
3963
 
    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
3964
 
    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3965
 
  done
3966
 
}
3967
 
 
3968
 
# Core function for launching the target application
3969
 
func_exec_program_core ()
3970
 
{
3971
 
"
3972
 
  case $host in
3973
 
  # Backslashes separate directories on plain windows
3974
 
  *-*-mingw | *-*-os2* | *-cegcc*)
3975
 
    $ECHO "\
3976
 
      if test -n \"\$lt_option_debug\"; then
3977
 
        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
3978
 
        func_lt_dump_args \${1+\"\$@\"} 1>&2
3979
 
      fi
3980
 
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
3981
 
"
3982
 
    ;;
3983
 
 
3984
 
  *)
3985
 
    $ECHO "\
3986
 
      if test -n \"\$lt_option_debug\"; then
3987
 
        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
3988
 
        func_lt_dump_args \${1+\"\$@\"} 1>&2
3989
 
      fi
3990
 
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
3991
 
"
3992
 
    ;;
3993
 
  esac
3994
 
  $ECHO "\
3995
 
      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
3996
 
      exit 1
3997
 
}
3998
 
 
3999
 
# A function to encapsulate launching the target application
4000
 
# Strips options in the --lt-* namespace from \$@ and
4001
 
# launches target application with the remaining arguments.
4002
 
func_exec_program ()
4003
 
{
4004
 
  case \" \$* \" in
4005
 
  *\\ --lt-*)
4006
 
    for lt_wr_arg
4007
 
    do
4008
 
      case \$lt_wr_arg in
4009
 
      --lt-*) ;;
4010
 
      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
4011
 
      esac
4012
 
      shift
4013
 
    done ;;
4014
 
  esac
4015
 
  func_exec_program_core \${1+\"\$@\"}
4016
 
}
4017
 
 
4018
 
  # Parse options
4019
 
  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
4020
 
 
4021
 
  # Find the directory that this script lives in.
4022
 
  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
4023
 
  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4024
 
 
4025
 
  # Follow symbolic links until we get to the real thisdir.
4026
 
  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
4027
 
  while test -n \"\$file\"; do
4028
 
    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
4029
 
 
4030
 
    # If there was a directory component, then change thisdir.
4031
 
    if test \"x\$destdir\" != \"x\$file\"; then
4032
 
      case \"\$destdir\" in
4033
 
      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4034
 
      *) thisdir=\"\$thisdir/\$destdir\" ;;
4035
 
      esac
4036
 
    fi
4037
 
 
4038
 
    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
4039
 
    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
4040
 
  done
4041
 
 
4042
 
  # Usually 'no', except on cygwin/mingw when embedded into
4043
 
  # the cwrapper.
4044
 
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
4045
 
  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
4046
 
    # special case for '.'
4047
 
    if test \"\$thisdir\" = \".\"; then
4048
 
      thisdir=\`pwd\`
4049
 
    fi
4050
 
    # remove .libs from thisdir
4051
 
    case \"\$thisdir\" in
4052
 
    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
4053
 
    $objdir )   thisdir=. ;;
4054
 
    esac
4055
 
  fi
4056
 
 
4057
 
  # Try to get the absolute directory name.
4058
 
  absdir=\`cd \"\$thisdir\" && pwd\`
4059
 
  test -n \"\$absdir\" && thisdir=\"\$absdir\"
4060
 
"
4061
 
 
4062
 
        if test "$fast_install" = yes; then
4063
 
          $ECHO "\
4064
 
  program=lt-'$outputname'$exeext
4065
 
  progdir=\"\$thisdir/$objdir\"
4066
 
 
4067
 
  if test ! -f \"\$progdir/\$program\" ||
4068
 
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4069
 
       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4070
 
 
4071
 
    file=\"\$\$-\$program\"
4072
 
 
4073
 
    if test ! -d \"\$progdir\"; then
4074
 
      $MKDIR \"\$progdir\"
4075
 
    else
4076
 
      $RM \"\$progdir/\$file\"
4077
 
    fi"
4078
 
 
4079
 
          $ECHO "\
4080
 
 
4081
 
    # relink executable if necessary
4082
 
    if test -n \"\$relink_command\"; then
4083
 
      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4084
 
      else
4085
 
        $ECHO \"\$relink_command_output\" >&2
4086
 
        $RM \"\$progdir/\$file\"
4087
 
        exit 1
4088
 
      fi
4089
 
    fi
4090
 
 
4091
 
    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4092
 
    { $RM \"\$progdir/\$program\";
4093
 
      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4094
 
    $RM \"\$progdir/\$file\"
4095
 
  fi"
4096
 
        else
4097
 
          $ECHO "\
4098
 
  program='$outputname'
4099
 
  progdir=\"\$thisdir/$objdir\"
4100
 
"
4101
 
        fi
4102
 
 
4103
 
        $ECHO "\
4104
 
 
4105
 
  if test -f \"\$progdir/\$program\"; then"
4106
 
 
4107
 
        # fixup the dll searchpath if we need to.
4108
 
        #
4109
 
        # Fix the DLL searchpath if we need to.  Do this before prepending
4110
 
        # to shlibpath, because on Windows, both are PATH and uninstalled
4111
 
        # libraries must come first.
4112
 
        if test -n "$dllsearchpath"; then
4113
 
          $ECHO "\
4114
 
    # Add the dll search path components to the executable PATH
4115
 
    PATH=$dllsearchpath:\$PATH
4116
 
"
4117
 
        fi
4118
 
 
4119
 
        # Export our shlibpath_var if we have one.
4120
 
        if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4121
 
          $ECHO "\
4122
 
    # Add our own library path to $shlibpath_var
4123
 
    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4124
 
 
4125
 
    # Some systems cannot cope with colon-terminated $shlibpath_var
4126
 
    # The second colon is a workaround for a bug in BeOS R4 sed
4127
 
    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
4128
 
 
4129
 
    export $shlibpath_var
4130
 
"
4131
 
        fi
4132
 
 
4133
 
        $ECHO "\
4134
 
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
4135
 
      # Run the actual program with our arguments.
4136
 
      func_exec_program \${1+\"\$@\"}
4137
 
    fi
4138
 
  else
4139
 
    # The program doesn't exist.
4140
 
    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4141
 
    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4142
 
    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4143
 
    exit 1
4144
 
  fi
4145
 
fi\
4146
 
"
4147
 
}
4148
 
 
4149
 
 
4150
 
# func_emit_cwrapperexe_src
4151
 
# emit the source code for a wrapper executable on stdout
4152
 
# Must ONLY be called from within func_mode_link because
4153
 
# it depends on a number of variable set therein.
4154
 
func_emit_cwrapperexe_src ()
4155
 
{
4156
 
        cat <<EOF
4157
 
 
4158
 
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4159
 
   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4160
 
 
4161
 
   The $output program cannot be directly executed until all the libtool
4162
 
   libraries that it depends on are installed.
4163
 
 
4164
 
   This wrapper executable should never be moved out of the build directory.
4165
 
   If it is, it will not operate correctly.
4166
 
*/
4167
 
EOF
4168
 
            cat <<"EOF"
4169
 
#ifdef _MSC_VER
4170
 
# define _CRT_SECURE_NO_DEPRECATE 1
4171
 
#endif
4172
 
#include <stdio.h>
4173
 
#include <stdlib.h>
4174
 
#ifdef _MSC_VER
4175
 
# include <direct.h>
4176
 
# include <process.h>
4177
 
# include <io.h>
4178
 
#else
4179
 
# include <unistd.h>
4180
 
# include <stdint.h>
4181
 
# ifdef __CYGWIN__
4182
 
#  include <io.h>
4183
 
# endif
4184
 
#endif
4185
 
#include <malloc.h>
4186
 
#include <stdarg.h>
4187
 
#include <assert.h>
4188
 
#include <string.h>
4189
 
#include <ctype.h>
4190
 
#include <errno.h>
4191
 
#include <fcntl.h>
4192
 
#include <sys/stat.h>
4193
 
 
4194
 
/* declarations of non-ANSI functions */
4195
 
#if defined(__MINGW32__)
4196
 
# ifdef __STRICT_ANSI__
4197
 
int _putenv (const char *);
4198
 
# endif
4199
 
#elif defined(__CYGWIN__)
4200
 
# ifdef __STRICT_ANSI__
4201
 
char *realpath (const char *, char *);
4202
 
int putenv (char *);
4203
 
int setenv (const char *, const char *, int);
4204
 
# endif
4205
 
/* #elif defined (other platforms) ... */
4206
 
#endif
4207
 
 
4208
 
/* portability defines, excluding path handling macros */
4209
 
#if defined(_MSC_VER)
4210
 
# define setmode _setmode
4211
 
# define stat    _stat
4212
 
# define chmod   _chmod
4213
 
# define getcwd  _getcwd
4214
 
# define putenv  _putenv
4215
 
# define S_IXUSR _S_IEXEC
4216
 
# ifndef _INTPTR_T_DEFINED
4217
 
#  define _INTPTR_T_DEFINED
4218
 
#  define intptr_t int
4219
 
# endif
4220
 
#elif defined(__MINGW32__)
4221
 
# define setmode _setmode
4222
 
# define stat    _stat
4223
 
# define chmod   _chmod
4224
 
# define getcwd  _getcwd
4225
 
# define putenv  _putenv
4226
 
#elif defined(__CYGWIN__)
4227
 
# define HAVE_SETENV
4228
 
# define FOPEN_WB "wb"
4229
 
/* #elif defined (other platforms) ... */
4230
 
#endif
4231
 
 
4232
 
#if defined(PATH_MAX)
4233
 
# define LT_PATHMAX PATH_MAX
4234
 
#elif defined(MAXPATHLEN)
4235
 
# define LT_PATHMAX MAXPATHLEN
4236
 
#else
4237
 
# define LT_PATHMAX 1024
4238
 
#endif
4239
 
 
4240
 
#ifndef S_IXOTH
4241
 
# define S_IXOTH 0
4242
 
#endif
4243
 
#ifndef S_IXGRP
4244
 
# define S_IXGRP 0
4245
 
#endif
4246
 
 
4247
 
/* path handling portability macros */
4248
 
#ifndef DIR_SEPARATOR
4249
 
# define DIR_SEPARATOR '/'
4250
 
# define PATH_SEPARATOR ':'
4251
 
#endif
4252
 
 
4253
 
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4254
 
  defined (__OS2__)
4255
 
# define HAVE_DOS_BASED_FILE_SYSTEM
4256
 
# define FOPEN_WB "wb"
4257
 
# ifndef DIR_SEPARATOR_2
4258
 
#  define DIR_SEPARATOR_2 '\\'
4259
 
# endif
4260
 
# ifndef PATH_SEPARATOR_2
4261
 
#  define PATH_SEPARATOR_2 ';'
4262
 
# endif
4263
 
#endif
4264
 
 
4265
 
#ifndef DIR_SEPARATOR_2
4266
 
# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4267
 
#else /* DIR_SEPARATOR_2 */
4268
 
# define IS_DIR_SEPARATOR(ch) \
4269
 
        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4270
 
#endif /* DIR_SEPARATOR_2 */
4271
 
 
4272
 
#ifndef PATH_SEPARATOR_2
4273
 
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4274
 
#else /* PATH_SEPARATOR_2 */
4275
 
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4276
 
#endif /* PATH_SEPARATOR_2 */
4277
 
 
4278
 
#ifndef FOPEN_WB
4279
 
# define FOPEN_WB "w"
4280
 
#endif
4281
 
#ifndef _O_BINARY
4282
 
# define _O_BINARY 0
4283
 
#endif
4284
 
 
4285
 
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
4286
 
#define XFREE(stale) do { \
4287
 
  if (stale) { free ((void *) stale); stale = 0; } \
4288
 
} while (0)
4289
 
 
4290
 
#if defined(LT_DEBUGWRAPPER)
4291
 
static int lt_debug = 1;
4292
 
#else
4293
 
static int lt_debug = 0;
4294
 
#endif
4295
 
 
4296
 
const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
4297
 
 
4298
 
void *xmalloc (size_t num);
4299
 
char *xstrdup (const char *string);
4300
 
const char *base_name (const char *name);
4301
 
char *find_executable (const char *wrapper);
4302
 
char *chase_symlinks (const char *pathspec);
4303
 
int make_executable (const char *path);
4304
 
int check_executable (const char *path);
4305
 
char *strendzap (char *str, const char *pat);
4306
 
void lt_debugprintf (const char *file, int line, const char *fmt, ...);
4307
 
void lt_fatal (const char *file, int line, const char *message, ...);
4308
 
static const char *nonnull (const char *s);
4309
 
static const char *nonempty (const char *s);
4310
 
void lt_setenv (const char *name, const char *value);
4311
 
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
4312
 
void lt_update_exe_path (const char *name, const char *value);
4313
 
void lt_update_lib_path (const char *name, const char *value);
4314
 
char **prepare_spawn (char **argv);
4315
 
void lt_dump_script (FILE *f);
4316
 
EOF
4317
 
 
4318
 
            cat <<EOF
4319
 
volatile const char * MAGIC_EXE = "$magic_exe";
4320
 
const char * LIB_PATH_VARNAME = "$shlibpath_var";
4321
 
EOF
4322
 
 
4323
 
            if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4324
 
              func_to_host_path "$temp_rpath"
4325
 
              cat <<EOF
4326
 
const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
4327
 
EOF
4328
 
            else
4329
 
              cat <<"EOF"
4330
 
const char * LIB_PATH_VALUE   = "";
4331
 
EOF
4332
 
            fi
4333
 
 
4334
 
            if test -n "$dllsearchpath"; then
4335
 
              func_to_host_path "$dllsearchpath:"
4336
 
              cat <<EOF
4337
 
const char * EXE_PATH_VARNAME = "PATH";
4338
 
const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
4339
 
EOF
4340
 
            else
4341
 
              cat <<"EOF"
4342
 
const char * EXE_PATH_VARNAME = "";
4343
 
const char * EXE_PATH_VALUE   = "";
4344
 
EOF
4345
 
            fi
4346
 
 
4347
 
            if test "$fast_install" = yes; then
4348
 
              cat <<EOF
4349
 
const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4350
 
EOF
4351
 
            else
4352
 
              cat <<EOF
4353
 
const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
4354
 
EOF
4355
 
            fi
4356
 
 
4357
 
 
4358
 
            cat <<"EOF"
4359
 
 
4360
 
#define LTWRAPPER_OPTION_PREFIX         "--lt-"
4361
 
 
4362
 
static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
4363
 
static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
4364
 
static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
4365
 
 
4366
 
int
4367
 
main (int argc, char *argv[])
4368
 
{
4369
 
  char **newargz;
4370
 
  int  newargc;
4371
 
  char *tmp_pathspec;
4372
 
  char *actual_cwrapper_path;
4373
 
  char *actual_cwrapper_name;
4374
 
  char *target_name;
4375
 
  char *lt_argv_zero;
4376
 
  intptr_t rval = 127;
4377
 
 
4378
 
  int i;
4379
 
 
4380
 
  program_name = (char *) xstrdup (base_name (argv[0]));
4381
 
  newargz = XMALLOC (char *, argc + 1);
4382
 
 
4383
 
  /* very simple arg parsing; don't want to rely on getopt
4384
 
   * also, copy all non cwrapper options to newargz, except
4385
 
   * argz[0], which is handled differently
4386
 
   */
4387
 
  newargc=0;
4388
 
  for (i = 1; i < argc; i++)
4389
 
    {
4390
 
      if (strcmp (argv[i], dumpscript_opt) == 0)
4391
 
        {
4392
 
EOF
4393
 
            case "$host" in
4394
 
              *mingw* | *cygwin* )
4395
 
                # make stdout use "unix" line endings
4396
 
                echo "          setmode(1,_O_BINARY);"
4397
 
                ;;
4398
 
              esac
4399
 
 
4400
 
            cat <<"EOF"
4401
 
          lt_dump_script (stdout);
4402
 
          return 0;
4403
 
        }
4404
 
      if (strcmp (argv[i], debug_opt) == 0)
4405
 
        {
4406
 
          lt_debug = 1;
4407
 
          continue;
4408
 
        }
4409
 
      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
4410
 
        {
4411
 
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4412
 
             namespace, but it is not one of the ones we know about and
4413
 
             have already dealt with, above (inluding dump-script), then
4414
 
             report an error. Otherwise, targets might begin to believe
4415
 
             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4416
 
             namespace. The first time any user complains about this, we'll
4417
 
             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
4418
 
             or a configure.ac-settable value.
4419
 
           */
4420
 
          lt_fatal (__FILE__, __LINE__,
4421
 
                    "unrecognized %s option: '%s'",
4422
 
                    ltwrapper_option_prefix, argv[i]);
4423
 
        }
4424
 
      /* otherwise ... */
4425
 
      newargz[++newargc] = xstrdup (argv[i]);
4426
 
    }
4427
 
  newargz[++newargc] = NULL;
4428
 
 
4429
 
EOF
4430
 
            cat <<EOF
4431
 
  /* The GNU banner must be the first non-error debug message */
4432
 
  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
4433
 
EOF
4434
 
            cat <<"EOF"
4435
 
  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4436
 
  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
4437
 
 
4438
 
  tmp_pathspec = find_executable (argv[0]);
4439
 
  if (tmp_pathspec == NULL)
4440
 
    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
4441
 
  lt_debugprintf (__FILE__, __LINE__,
4442
 
                  "(main) found exe (before symlink chase) at: %s\n",
4443
 
                  tmp_pathspec);
4444
 
 
4445
 
  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
4446
 
  lt_debugprintf (__FILE__, __LINE__,
4447
 
                  "(main) found exe (after symlink chase) at: %s\n",
4448
 
                  actual_cwrapper_path);
4449
 
  XFREE (tmp_pathspec);
4450
 
 
4451
 
  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
4452
 
  strendzap (actual_cwrapper_path, actual_cwrapper_name);
4453
 
 
4454
 
  /* wrapper name transforms */
4455
 
  strendzap (actual_cwrapper_name, ".exe");
4456
 
  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
4457
 
  XFREE (actual_cwrapper_name);
4458
 
  actual_cwrapper_name = tmp_pathspec;
4459
 
  tmp_pathspec = 0;
4460
 
 
4461
 
  /* target_name transforms -- use actual target program name; might have lt- prefix */
4462
 
  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
4463
 
  strendzap (target_name, ".exe");
4464
 
  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
4465
 
  XFREE (target_name);
4466
 
  target_name = tmp_pathspec;
4467
 
  tmp_pathspec = 0;
4468
 
 
4469
 
  lt_debugprintf (__FILE__, __LINE__,
4470
 
                  "(main) libtool target name: %s\n",
4471
 
                  target_name);
4472
 
EOF
4473
 
 
4474
 
            cat <<EOF
4475
 
  newargz[0] =
4476
 
    XMALLOC (char, (strlen (actual_cwrapper_path) +
4477
 
                    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
4478
 
  strcpy (newargz[0], actual_cwrapper_path);
4479
 
  strcat (newargz[0], "$objdir");
4480
 
  strcat (newargz[0], "/");
4481
 
EOF
4482
 
 
4483
 
            cat <<"EOF"
4484
 
  /* stop here, and copy so we don't have to do this twice */
4485
 
  tmp_pathspec = xstrdup (newargz[0]);
4486
 
 
4487
 
  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
4488
 
  strcat (newargz[0], actual_cwrapper_name);
4489
 
 
4490
 
  /* DO want the lt- prefix here if it exists, so use target_name */
4491
 
  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
4492
 
  XFREE (tmp_pathspec);
4493
 
  tmp_pathspec = NULL;
4494
 
EOF
4495
 
 
4496
 
            case $host_os in
4497
 
              mingw*)
4498
 
            cat <<"EOF"
4499
 
  {
4500
 
    char* p;
4501
 
    while ((p = strchr (newargz[0], '\\')) != NULL)
4502
 
      {
4503
 
        *p = '/';
4504
 
      }
4505
 
    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
4506
 
      {
4507
 
        *p = '/';
4508
 
      }
4509
 
  }
4510
 
EOF
4511
 
            ;;
4512
 
            esac
4513
 
 
4514
 
            cat <<"EOF"
4515
 
  XFREE (target_name);
4516
 
  XFREE (actual_cwrapper_path);
4517
 
  XFREE (actual_cwrapper_name);
4518
 
 
4519
 
  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
4520
 
  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
4521
 
  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
4522
 
     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4523
 
     because on Windows, both *_VARNAMEs are PATH but uninstalled
4524
 
     libraries must come first. */
4525
 
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
4526
 
  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4527
 
 
4528
 
  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4529
 
                  nonnull (lt_argv_zero));
4530
 
  for (i = 0; i < newargc; i++)
4531
 
    {
4532
 
      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4533
 
                      i, nonnull (newargz[i]));
4534
 
    }
4535
 
 
4536
 
EOF
4537
 
 
4538
 
            case $host_os in
4539
 
              mingw*)
4540
 
                cat <<"EOF"
4541
 
  /* execv doesn't actually work on mingw as expected on unix */
4542
 
  newargz = prepare_spawn (newargz);
4543
 
  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4544
 
  if (rval == -1)
4545
 
    {
4546
 
      /* failed to start process */
4547
 
      lt_debugprintf (__FILE__, __LINE__,
4548
 
                      "(main) failed to launch target \"%s\": %s\n",
4549
 
                      lt_argv_zero, nonnull (strerror (errno)));
4550
 
      return 127;
4551
 
    }
4552
 
  return rval;
4553
 
EOF
4554
 
                ;;
4555
 
              *)
4556
 
                cat <<"EOF"
4557
 
  execv (lt_argv_zero, newargz);
4558
 
  return rval; /* =127, but avoids unused variable warning */
4559
 
EOF
4560
 
                ;;
4561
 
            esac
4562
 
 
4563
 
            cat <<"EOF"
4564
 
}
4565
 
 
4566
 
void *
4567
 
xmalloc (size_t num)
4568
 
{
4569
 
  void *p = (void *) malloc (num);
4570
 
  if (!p)
4571
 
    lt_fatal (__FILE__, __LINE__, "memory exhausted");
4572
 
 
4573
 
  return p;
4574
 
}
4575
 
 
4576
 
char *
4577
 
xstrdup (const char *string)
4578
 
{
4579
 
  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
4580
 
                          string) : NULL;
4581
 
}
4582
 
 
4583
 
const char *
4584
 
base_name (const char *name)
4585
 
{
4586
 
  const char *base;
4587
 
 
4588
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4589
 
  /* Skip over the disk name in MSDOS pathnames. */
4590
 
  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
4591
 
    name += 2;
4592
 
#endif
4593
 
 
4594
 
  for (base = name; *name; name++)
4595
 
    if (IS_DIR_SEPARATOR (*name))
4596
 
      base = name + 1;
4597
 
  return base;
4598
 
}
4599
 
 
4600
 
int
4601
 
check_executable (const char *path)
4602
 
{
4603
 
  struct stat st;
4604
 
 
4605
 
  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
4606
 
                  nonempty (path));
4607
 
  if ((!path) || (!*path))
4608
 
    return 0;
4609
 
 
4610
 
  if ((stat (path, &st) >= 0)
4611
 
      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
4612
 
    return 1;
4613
 
  else
4614
 
    return 0;
4615
 
}
4616
 
 
4617
 
int
4618
 
make_executable (const char *path)
4619
 
{
4620
 
  int rval = 0;
4621
 
  struct stat st;
4622
 
 
4623
 
  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
4624
 
                  nonempty (path));
4625
 
  if ((!path) || (!*path))
4626
 
    return 0;
4627
 
 
4628
 
  if (stat (path, &st) >= 0)
4629
 
    {
4630
 
      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
4631
 
    }
4632
 
  return rval;
4633
 
}
4634
 
 
4635
 
/* Searches for the full path of the wrapper.  Returns
4636
 
   newly allocated full path name if found, NULL otherwise
4637
 
   Does not chase symlinks, even on platforms that support them.
4638
 
*/
4639
 
char *
4640
 
find_executable (const char *wrapper)
4641
 
{
4642
 
  int has_slash = 0;
4643
 
  const char *p;
4644
 
  const char *p_next;
4645
 
  /* static buffer for getcwd */
4646
 
  char tmp[LT_PATHMAX + 1];
4647
 
  int tmp_len;
4648
 
  char *concat_name;
4649
 
 
4650
 
  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
4651
 
                  nonempty (wrapper));
4652
 
 
4653
 
  if ((wrapper == NULL) || (*wrapper == '\0'))
4654
 
    return NULL;
4655
 
 
4656
 
  /* Absolute path? */
4657
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4658
 
  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
4659
 
    {
4660
 
      concat_name = xstrdup (wrapper);
4661
 
      if (check_executable (concat_name))
4662
 
        return concat_name;
4663
 
      XFREE (concat_name);
4664
 
    }
4665
 
  else
4666
 
    {
4667
 
#endif
4668
 
      if (IS_DIR_SEPARATOR (wrapper[0]))
4669
 
        {
4670
 
          concat_name = xstrdup (wrapper);
4671
 
          if (check_executable (concat_name))
4672
 
            return concat_name;
4673
 
          XFREE (concat_name);
4674
 
        }
4675
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4676
 
    }
4677
 
#endif
4678
 
 
4679
 
  for (p = wrapper; *p; p++)
4680
 
    if (*p == '/')
4681
 
      {
4682
 
        has_slash = 1;
4683
 
        break;
4684
 
      }
4685
 
  if (!has_slash)
4686
 
    {
4687
 
      /* no slashes; search PATH */
4688
 
      const char *path = getenv ("PATH");
4689
 
      if (path != NULL)
4690
 
        {
4691
 
          for (p = path; *p; p = p_next)
4692
 
            {
4693
 
              const char *q;
4694
 
              size_t p_len;
4695
 
              for (q = p; *q; q++)
4696
 
                if (IS_PATH_SEPARATOR (*q))
4697
 
                  break;
4698
 
              p_len = q - p;
4699
 
              p_next = (*q == '\0' ? q : q + 1);
4700
 
              if (p_len == 0)
4701
 
                {
4702
 
                  /* empty path: current directory */
4703
 
                  if (getcwd (tmp, LT_PATHMAX) == NULL)
4704
 
                    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
4705
 
                              nonnull (strerror (errno)));
4706
 
                  tmp_len = strlen (tmp);
4707
 
                  concat_name =
4708
 
                    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
4709
 
                  memcpy (concat_name, tmp, tmp_len);
4710
 
                  concat_name[tmp_len] = '/';
4711
 
                  strcpy (concat_name + tmp_len + 1, wrapper);
4712
 
                }
4713
 
              else
4714
 
                {
4715
 
                  concat_name =
4716
 
                    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
4717
 
                  memcpy (concat_name, p, p_len);
4718
 
                  concat_name[p_len] = '/';
4719
 
                  strcpy (concat_name + p_len + 1, wrapper);
4720
 
                }
4721
 
              if (check_executable (concat_name))
4722
 
                return concat_name;
4723
 
              XFREE (concat_name);
4724
 
            }
4725
 
        }
4726
 
      /* not found in PATH; assume curdir */
4727
 
    }
4728
 
  /* Relative path | not found in path: prepend cwd */
4729
 
  if (getcwd (tmp, LT_PATHMAX) == NULL)
4730
 
    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
4731
 
              nonnull (strerror (errno)));
4732
 
  tmp_len = strlen (tmp);
4733
 
  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
4734
 
  memcpy (concat_name, tmp, tmp_len);
4735
 
  concat_name[tmp_len] = '/';
4736
 
  strcpy (concat_name + tmp_len + 1, wrapper);
4737
 
 
4738
 
  if (check_executable (concat_name))
4739
 
    return concat_name;
4740
 
  XFREE (concat_name);
4741
 
  return NULL;
4742
 
}
4743
 
 
4744
 
char *
4745
 
chase_symlinks (const char *pathspec)
4746
 
{
4747
 
#ifndef S_ISLNK
4748
 
  return xstrdup (pathspec);
4749
 
#else
4750
 
  char buf[LT_PATHMAX];
4751
 
  struct stat s;
4752
 
  char *tmp_pathspec = xstrdup (pathspec);
4753
 
  char *p;
4754
 
  int has_symlinks = 0;
4755
 
  while (strlen (tmp_pathspec) && !has_symlinks)
4756
 
    {
4757
 
      lt_debugprintf (__FILE__, __LINE__,
4758
 
                      "checking path component for symlinks: %s\n",
4759
 
                      tmp_pathspec);
4760
 
      if (lstat (tmp_pathspec, &s) == 0)
4761
 
        {
4762
 
          if (S_ISLNK (s.st_mode) != 0)
4763
 
            {
4764
 
              has_symlinks = 1;
4765
 
              break;
4766
 
            }
4767
 
 
4768
 
          /* search backwards for last DIR_SEPARATOR */
4769
 
          p = tmp_pathspec + strlen (tmp_pathspec) - 1;
4770
 
          while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
4771
 
            p--;
4772
 
          if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
4773
 
            {
4774
 
              /* no more DIR_SEPARATORS left */
4775
 
              break;
4776
 
            }
4777
 
          *p = '\0';
4778
 
        }
4779
 
      else
4780
 
        {
4781
 
          lt_fatal (__FILE__, __LINE__,
4782
 
                    "error accessing file \"%s\": %s",
4783
 
                    tmp_pathspec, nonnull (strerror (errno)));
4784
 
        }
4785
 
    }
4786
 
  XFREE (tmp_pathspec);
4787
 
 
4788
 
  if (!has_symlinks)
4789
 
    {
4790
 
      return xstrdup (pathspec);
4791
 
    }
4792
 
 
4793
 
  tmp_pathspec = realpath (pathspec, buf);
4794
 
  if (tmp_pathspec == 0)
4795
 
    {
4796
 
      lt_fatal (__FILE__, __LINE__,
4797
 
                "could not follow symlinks for %s", pathspec);
4798
 
    }
4799
 
  return xstrdup (tmp_pathspec);
4800
 
#endif
4801
 
}
4802
 
 
4803
 
char *
4804
 
strendzap (char *str, const char *pat)
4805
 
{
4806
 
  size_t len, patlen;
4807
 
 
4808
 
  assert (str != NULL);
4809
 
  assert (pat != NULL);
4810
 
 
4811
 
  len = strlen (str);
4812
 
  patlen = strlen (pat);
4813
 
 
4814
 
  if (patlen <= len)
4815
 
    {
4816
 
      str += len - patlen;
4817
 
      if (strcmp (str, pat) == 0)
4818
 
        *str = '\0';
4819
 
    }
4820
 
  return str;
4821
 
}
4822
 
 
4823
 
void
4824
 
lt_debugprintf (const char *file, int line, const char *fmt, ...)
4825
 
{
4826
 
  va_list args;
4827
 
  if (lt_debug)
4828
 
    {
4829
 
      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
4830
 
      va_start (args, fmt);
4831
 
      (void) vfprintf (stderr, fmt, args);
4832
 
      va_end (args);
4833
 
    }
4834
 
}
4835
 
 
4836
 
static void
4837
 
lt_error_core (int exit_status, const char *file,
4838
 
               int line, const char *mode,
4839
 
               const char *message, va_list ap)
4840
 
{
4841
 
  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
4842
 
  vfprintf (stderr, message, ap);
4843
 
  fprintf (stderr, ".\n");
4844
 
 
4845
 
  if (exit_status >= 0)
4846
 
    exit (exit_status);
4847
 
}
4848
 
 
4849
 
void
4850
 
lt_fatal (const char *file, int line, const char *message, ...)
4851
 
{
4852
 
  va_list ap;
4853
 
  va_start (ap, message);
4854
 
  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
4855
 
  va_end (ap);
4856
 
}
4857
 
 
4858
 
static const char *
4859
 
nonnull (const char *s)
4860
 
{
4861
 
  return s ? s : "(null)";
4862
 
}
4863
 
 
4864
 
static const char *
4865
 
nonempty (const char *s)
4866
 
{
4867
 
  return (s && !*s) ? "(empty)" : nonnull (s);
4868
 
}
4869
 
 
4870
 
void
4871
 
lt_setenv (const char *name, const char *value)
4872
 
{
4873
 
  lt_debugprintf (__FILE__, __LINE__,
4874
 
                  "(lt_setenv) setting '%s' to '%s'\n",
4875
 
                  nonnull (name), nonnull (value));
4876
 
  {
4877
 
#ifdef HAVE_SETENV
4878
 
    /* always make a copy, for consistency with !HAVE_SETENV */
4879
 
    char *str = xstrdup (value);
4880
 
    setenv (name, str, 1);
4881
 
#else
4882
 
    int len = strlen (name) + 1 + strlen (value) + 1;
4883
 
    char *str = XMALLOC (char, len);
4884
 
    sprintf (str, "%s=%s", name, value);
4885
 
    if (putenv (str) != EXIT_SUCCESS)
4886
 
      {
4887
 
        XFREE (str);
4888
 
      }
4889
 
#endif
4890
 
  }
4891
 
}
4892
 
 
4893
 
char *
4894
 
lt_extend_str (const char *orig_value, const char *add, int to_end)
4895
 
{
4896
 
  char *new_value;
4897
 
  if (orig_value && *orig_value)
4898
 
    {
4899
 
      int orig_value_len = strlen (orig_value);
4900
 
      int add_len = strlen (add);
4901
 
      new_value = XMALLOC (char, add_len + orig_value_len + 1);
4902
 
      if (to_end)
4903
 
        {
4904
 
          strcpy (new_value, orig_value);
4905
 
          strcpy (new_value + orig_value_len, add);
4906
 
        }
4907
 
      else
4908
 
        {
4909
 
          strcpy (new_value, add);
4910
 
          strcpy (new_value + add_len, orig_value);
4911
 
        }
4912
 
    }
4913
 
  else
4914
 
    {
4915
 
      new_value = xstrdup (add);
4916
 
    }
4917
 
  return new_value;
4918
 
}
4919
 
 
4920
 
void
4921
 
lt_update_exe_path (const char *name, const char *value)
4922
 
{
4923
 
  lt_debugprintf (__FILE__, __LINE__,
4924
 
                  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4925
 
                  nonnull (name), nonnull (value));
4926
 
 
4927
 
  if (name && *name && value && *value)
4928
 
    {
4929
 
      char *new_value = lt_extend_str (getenv (name), value, 0);
4930
 
      /* some systems can't cope with a ':'-terminated path #' */
4931
 
      int len = strlen (new_value);
4932
 
      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4933
 
        {
4934
 
          new_value[len-1] = '\0';
4935
 
        }
4936
 
      lt_setenv (name, new_value);
4937
 
      XFREE (new_value);
4938
 
    }
4939
 
}
4940
 
 
4941
 
void
4942
 
lt_update_lib_path (const char *name, const char *value)
4943
 
{
4944
 
  lt_debugprintf (__FILE__, __LINE__,
4945
 
                  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4946
 
                  nonnull (name), nonnull (value));
4947
 
 
4948
 
  if (name && *name && value && *value)
4949
 
    {
4950
 
      char *new_value = lt_extend_str (getenv (name), value, 0);
4951
 
      lt_setenv (name, new_value);
4952
 
      XFREE (new_value);
4953
 
    }
4954
 
}
4955
 
 
4956
 
EOF
4957
 
            case $host_os in
4958
 
              mingw*)
4959
 
                cat <<"EOF"
4960
 
 
4961
 
/* Prepares an argument vector before calling spawn().
4962
 
   Note that spawn() does not by itself call the command interpreter
4963
 
     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
4964
 
      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
4965
 
         GetVersionEx(&v);
4966
 
         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
4967
 
      }) ? "cmd.exe" : "command.com").
4968
 
   Instead it simply concatenates the arguments, separated by ' ', and calls
4969
 
   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
4970
 
   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
4971
 
   special way:
4972
 
   - Space and tab are interpreted as delimiters. They are not treated as
4973
 
     delimiters if they are surrounded by double quotes: "...".
4974
 
   - Unescaped double quotes are removed from the input. Their only effect is
4975
 
     that within double quotes, space and tab are treated like normal
4976
 
     characters.
4977
 
   - Backslashes not followed by double quotes are not special.
4978
 
   - But 2*n+1 backslashes followed by a double quote become
4979
 
     n backslashes followed by a double quote (n >= 0):
4980
 
       \" -> "
4981
 
       \\\" -> \"
4982
 
       \\\\\" -> \\"
4983
 
 */
4984
 
#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4985
 
#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
4986
 
char **
4987
 
prepare_spawn (char **argv)
4988
 
{
4989
 
  size_t argc;
4990
 
  char **new_argv;
4991
 
  size_t i;
4992
 
 
4993
 
  /* Count number of arguments.  */
4994
 
  for (argc = 0; argv[argc] != NULL; argc++)
4995
 
    ;
4996
 
 
4997
 
  /* Allocate new argument vector.  */
4998
 
  new_argv = XMALLOC (char *, argc + 1);
4999
 
 
5000
 
  /* Put quoted arguments into the new argument vector.  */
5001
 
  for (i = 0; i < argc; i++)
5002
 
    {
5003
 
      const char *string = argv[i];
5004
 
 
5005
 
      if (string[0] == '\0')
5006
 
        new_argv[i] = xstrdup ("\"\"");
5007
 
      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
5008
 
        {
5009
 
          int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
5010
 
          size_t length;
5011
 
          unsigned int backslashes;
5012
 
          const char *s;
5013
 
          char *quoted_string;
5014
 
          char *p;
5015
 
 
5016
 
          length = 0;
5017
 
          backslashes = 0;
5018
 
          if (quote_around)
5019
 
            length++;
5020
 
          for (s = string; *s != '\0'; s++)
5021
 
            {
5022
 
              char c = *s;
5023
 
              if (c == '"')
5024
 
                length += backslashes + 1;
5025
 
              length++;
5026
 
              if (c == '\\')
5027
 
                backslashes++;
5028
 
              else
5029
 
                backslashes = 0;
5030
 
            }
5031
 
          if (quote_around)
5032
 
            length += backslashes + 1;
5033
 
 
5034
 
          quoted_string = XMALLOC (char, length + 1);
5035
 
 
5036
 
          p = quoted_string;
5037
 
          backslashes = 0;
5038
 
          if (quote_around)
5039
 
            *p++ = '"';
5040
 
          for (s = string; *s != '\0'; s++)
5041
 
            {
5042
 
              char c = *s;
5043
 
              if (c == '"')
5044
 
                {
5045
 
                  unsigned int j;
5046
 
                  for (j = backslashes + 1; j > 0; j--)
5047
 
                    *p++ = '\\';
5048
 
                }
5049
 
              *p++ = c;
5050
 
              if (c == '\\')
5051
 
                backslashes++;
5052
 
              else
5053
 
                backslashes = 0;
5054
 
            }
5055
 
          if (quote_around)
5056
 
            {
5057
 
              unsigned int j;
5058
 
              for (j = backslashes; j > 0; j--)
5059
 
                *p++ = '\\';
5060
 
              *p++ = '"';
5061
 
            }
5062
 
          *p = '\0';
5063
 
 
5064
 
          new_argv[i] = quoted_string;
5065
 
        }
5066
 
      else
5067
 
        new_argv[i] = (char *) string;
5068
 
    }
5069
 
  new_argv[argc] = NULL;
5070
 
 
5071
 
  return new_argv;
5072
 
}
5073
 
EOF
5074
 
                ;;
5075
 
            esac
5076
 
 
5077
 
            cat <<"EOF"
5078
 
void lt_dump_script (FILE* f)
5079
 
{
5080
 
EOF
5081
 
            func_emit_wrapper yes |
5082
 
              $SED -n -e '
5083
 
s/^\(.\{79\}\)\(..*\)/\1\
5084
 
\2/
5085
 
h
5086
 
s/\([\\"]\)/\\\1/g
5087
 
s/$/\\n/
5088
 
s/\([^\n]*\).*/  fputs ("\1", f);/p
5089
 
g
5090
 
D'
5091
 
            cat <<"EOF"
5092
 
}
5093
 
EOF
5094
 
}
5095
 
# end: func_emit_cwrapperexe_src
5096
 
 
5097
 
# func_win32_import_lib_p ARG
5098
 
# True if ARG is an import lib, as indicated by $file_magic_cmd
5099
 
func_win32_import_lib_p ()
5100
 
{
5101
 
    $opt_debug
5102
 
    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
5103
 
    *import*) : ;;
5104
 
    *) false ;;
5105
 
    esac
5106
 
}
5107
 
 
5108
 
# func_mode_link arg...
5109
 
func_mode_link ()
5110
 
{
5111
 
    $opt_debug
5112
 
    case $host in
5113
 
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5114
 
      # It is impossible to link a dll without this setting, and
5115
 
      # we shouldn't force the makefile maintainer to figure out
5116
 
      # which system we are compiling for in order to pass an extra
5117
 
      # flag for every libtool invocation.
5118
 
      # allow_undefined=no
5119
 
 
5120
 
      # FIXME: Unfortunately, there are problems with the above when trying
5121
 
      # to make a dll which has undefined symbols, in which case not
5122
 
      # even a static library is built.  For now, we need to specify
5123
 
      # -no-undefined on the libtool link line when we can be certain
5124
 
      # that all symbols are satisfied, otherwise we get a static library.
5125
 
      allow_undefined=yes
5126
 
      ;;
5127
 
    *)
5128
 
      allow_undefined=yes
5129
 
      ;;
5130
 
    esac
5131
 
    libtool_args=$nonopt
5132
 
    base_compile="$nonopt $@"
5133
 
    compile_command=$nonopt
5134
 
    finalize_command=$nonopt
5135
 
 
5136
 
    compile_rpath=
5137
 
    finalize_rpath=
5138
 
    compile_shlibpath=
5139
 
    finalize_shlibpath=
5140
 
    convenience=
5141
 
    old_convenience=
5142
 
    deplibs=
5143
 
    old_deplibs=
5144
 
    compiler_flags=
5145
 
    linker_flags=
5146
 
    dllsearchpath=
5147
 
    lib_search_path=`pwd`
5148
 
    inst_prefix_dir=
5149
 
    new_inherited_linker_flags=
5150
 
 
5151
 
    avoid_version=no
5152
 
    bindir=
5153
 
    dlfiles=
5154
 
    dlprefiles=
5155
 
    dlself=no
5156
 
    export_dynamic=no
5157
 
    export_symbols=
5158
 
    export_symbols_regex=
5159
 
    generated=
5160
 
    libobjs=
5161
 
    ltlibs=
5162
 
    module=no
5163
 
    no_install=no
5164
 
    objs=
5165
 
    non_pic_objects=
5166
 
    precious_files_regex=
5167
 
    prefer_static_libs=no
5168
 
    preload=no
5169
 
    prev=
5170
 
    prevarg=
5171
 
    release=
5172
 
    rpath=
5173
 
    xrpath=
5174
 
    perm_rpath=
5175
 
    temp_rpath=
5176
 
    thread_safe=no
5177
 
    vinfo=
5178
 
    vinfo_number=no
5179
 
    weak_libs=
5180
 
    single_module="${wl}-single_module"
5181
 
    func_infer_tag $base_compile
5182
 
 
5183
 
    # We need to know -static, to get the right output filenames.
5184
 
    for arg
5185
 
    do
5186
 
      case $arg in
5187
 
      -shared)
5188
 
        test "$build_libtool_libs" != yes && \
5189
 
          func_fatal_configuration "can not build a shared library"
5190
 
        build_old_libs=no
5191
 
        break
5192
 
        ;;
5193
 
      -all-static | -static | -static-libtool-libs)
5194
 
        case $arg in
5195
 
        -all-static)
5196
 
          if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
5197
 
            func_warning "complete static linking is impossible in this configuration"
5198
 
          fi
5199
 
          if test -n "$link_static_flag"; then
5200
 
            dlopen_self=$dlopen_self_static
5201
 
          fi
5202
 
          prefer_static_libs=yes
5203
 
          ;;
5204
 
        -static)
5205
 
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
5206
 
            dlopen_self=$dlopen_self_static
5207
 
          fi
5208
 
          prefer_static_libs=built
5209
 
          ;;
5210
 
        -static-libtool-libs)
5211
 
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
5212
 
            dlopen_self=$dlopen_self_static
5213
 
          fi
5214
 
          prefer_static_libs=yes
5215
 
          ;;
5216
 
        esac
5217
 
        build_libtool_libs=no
5218
 
        build_old_libs=yes
5219
 
        break
5220
 
        ;;
5221
 
      esac
5222
 
    done
5223
 
 
5224
 
    # See if our shared archives depend on static archives.
5225
 
    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
5226
 
 
5227
 
    # Go through the arguments, transforming them on the way.
5228
 
    while test "$#" -gt 0; do
5229
 
      arg="$1"
5230
 
      shift
5231
 
      func_quote_for_eval "$arg"
5232
 
      qarg=$func_quote_for_eval_unquoted_result
5233
 
      func_append libtool_args " $func_quote_for_eval_result"
5234
 
 
5235
 
      # If the previous option needs an argument, assign it.
5236
 
      if test -n "$prev"; then
5237
 
        case $prev in
5238
 
        output)
5239
 
          func_append compile_command " @OUTPUT@"
5240
 
          func_append finalize_command " @OUTPUT@"
5241
 
          ;;
5242
 
        esac
5243
 
 
5244
 
        case $prev in
5245
 
        bindir)
5246
 
          bindir="$arg"
5247
 
          prev=
5248
 
          continue
5249
 
          ;;
5250
 
        dlfiles|dlprefiles)
5251
 
          if test "$preload" = no; then
5252
 
            # Add the symbol object into the linking commands.
5253
 
            func_append compile_command " @SYMFILE@"
5254
 
            func_append finalize_command " @SYMFILE@"
5255
 
            preload=yes
5256
 
          fi
5257
 
          case $arg in
5258
 
          *.la | *.lo) ;;  # We handle these cases below.
5259
 
          force)
5260
 
            if test "$dlself" = no; then
5261
 
              dlself=needless
5262
 
              export_dynamic=yes
5263
 
            fi
5264
 
            prev=
5265
 
            continue
5266
 
            ;;
5267
 
          self)
5268
 
            if test "$prev" = dlprefiles; then
5269
 
              dlself=yes
5270
 
            elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
5271
 
              dlself=yes
5272
 
            else
5273
 
              dlself=needless
5274
 
              export_dynamic=yes
5275
 
            fi
5276
 
            prev=
5277
 
            continue
5278
 
            ;;
5279
 
          *)
5280
 
            if test "$prev" = dlfiles; then
5281
 
              func_append dlfiles " $arg"
5282
 
            else
5283
 
              func_append dlprefiles " $arg"
5284
 
            fi
5285
 
            prev=
5286
 
            continue
5287
 
            ;;
5288
 
          esac
5289
 
          ;;
5290
 
        expsyms)
5291
 
          export_symbols="$arg"
5292
 
          test -f "$arg" \
5293
 
            || func_fatal_error "symbol file \`$arg' does not exist"
5294
 
          prev=
5295
 
          continue
5296
 
          ;;
5297
 
        expsyms_regex)
5298
 
          export_symbols_regex="$arg"
5299
 
          prev=
5300
 
          continue
5301
 
          ;;
5302
 
        framework)
5303
 
          case $host in
5304
 
            *-*-darwin*)
5305
 
              case "$deplibs " in
5306
 
                *" $qarg.ltframework "*) ;;
5307
 
                *) func_append deplibs " $qarg.ltframework" # this is fixed later
5308
 
                   ;;
5309
 
              esac
5310
 
              ;;
5311
 
          esac
5312
 
          prev=
5313
 
          continue
5314
 
          ;;
5315
 
        inst_prefix)
5316
 
          inst_prefix_dir="$arg"
5317
 
          prev=
5318
 
          continue
5319
 
          ;;
5320
 
        objectlist)
5321
 
          if test -f "$arg"; then
5322
 
            save_arg=$arg
5323
 
            moreargs=
5324
 
            for fil in `cat "$save_arg"`
5325
 
            do
5326
 
#             func_append moreargs " $fil"
5327
 
              arg=$fil
5328
 
              # A libtool-controlled object.
5329
 
 
5330
 
              # Check to see that this really is a libtool object.
5331
 
              if func_lalib_unsafe_p "$arg"; then
5332
 
                pic_object=
5333
 
                non_pic_object=
5334
 
 
5335
 
                # Read the .lo file
5336
 
                func_source "$arg"
5337
 
 
5338
 
                if test -z "$pic_object" ||
5339
 
                   test -z "$non_pic_object" ||
5340
 
                   test "$pic_object" = none &&
5341
 
                   test "$non_pic_object" = none; then
5342
 
                  func_fatal_error "cannot find name of object for \`$arg'"
5343
 
                fi
5344
 
 
5345
 
                # Extract subdirectory from the argument.
5346
 
                func_dirname "$arg" "/" ""
5347
 
                xdir="$func_dirname_result"
5348
 
 
5349
 
                if test "$pic_object" != none; then
5350
 
                  # Prepend the subdirectory the object is found in.
5351
 
                  pic_object="$xdir$pic_object"
5352
 
 
5353
 
                  if test "$prev" = dlfiles; then
5354
 
                    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5355
 
                      func_append dlfiles " $pic_object"
5356
 
                      prev=
5357
 
                      continue
5358
 
                    else
5359
 
                      # If libtool objects are unsupported, then we need to preload.
5360
 
                      prev=dlprefiles
5361
 
                    fi
5362
 
                  fi
5363
 
 
5364
 
                  # CHECK ME:  I think I busted this.  -Ossama
5365
 
                  if test "$prev" = dlprefiles; then
5366
 
                    # Preload the old-style object.
5367
 
                    func_append dlprefiles " $pic_object"
5368
 
                    prev=
5369
 
                  fi
5370
 
 
5371
 
                  # A PIC object.
5372
 
                  func_append libobjs " $pic_object"
5373
 
                  arg="$pic_object"
5374
 
                fi
5375
 
 
5376
 
                # Non-PIC object.
5377
 
                if test "$non_pic_object" != none; then
5378
 
                  # Prepend the subdirectory the object is found in.
5379
 
                  non_pic_object="$xdir$non_pic_object"
5380
 
 
5381
 
                  # A standard non-PIC object
5382
 
                  func_append non_pic_objects " $non_pic_object"
5383
 
                  if test -z "$pic_object" || test "$pic_object" = none ; then
5384
 
                    arg="$non_pic_object"
5385
 
                  fi
5386
 
                else
5387
 
                  # If the PIC object exists, use it instead.
5388
 
                  # $xdir was prepended to $pic_object above.
5389
 
                  non_pic_object="$pic_object"
5390
 
                  func_append non_pic_objects " $non_pic_object"
5391
 
                fi
5392
 
              else
5393
 
                # Only an error if not doing a dry-run.
5394
 
                if $opt_dry_run; then
5395
 
                  # Extract subdirectory from the argument.
5396
 
                  func_dirname "$arg" "/" ""
5397
 
                  xdir="$func_dirname_result"
5398
 
 
5399
 
                  func_lo2o "$arg"
5400
 
                  pic_object=$xdir$objdir/$func_lo2o_result
5401
 
                  non_pic_object=$xdir$func_lo2o_result
5402
 
                  func_append libobjs " $pic_object"
5403
 
                  func_append non_pic_objects " $non_pic_object"
5404
 
                else
5405
 
                  func_fatal_error "\`$arg' is not a valid libtool object"
5406
 
                fi
5407
 
              fi
5408
 
            done
5409
 
          else
5410
 
            func_fatal_error "link input file \`$arg' does not exist"
5411
 
          fi
5412
 
          arg=$save_arg
5413
 
          prev=
5414
 
          continue
5415
 
          ;;
5416
 
        precious_regex)
5417
 
          precious_files_regex="$arg"
5418
 
          prev=
5419
 
          continue
5420
 
          ;;
5421
 
        release)
5422
 
          release="-$arg"
5423
 
          prev=
5424
 
          continue
5425
 
          ;;
5426
 
        rpath | xrpath)
5427
 
          # We need an absolute path.
5428
 
          case $arg in
5429
 
          [\\/]* | [A-Za-z]:[\\/]*) ;;
5430
 
          *)
5431
 
            func_fatal_error "only absolute run-paths are allowed"
5432
 
            ;;
5433
 
          esac
5434
 
          if test "$prev" = rpath; then
5435
 
            case "$rpath " in
5436
 
            *" $arg "*) ;;
5437
 
            *) func_append rpath " $arg" ;;
5438
 
            esac
5439
 
          else
5440
 
            case "$xrpath " in
5441
 
            *" $arg "*) ;;
5442
 
            *) func_append xrpath " $arg" ;;
5443
 
            esac
5444
 
          fi
5445
 
          prev=
5446
 
          continue
5447
 
          ;;
5448
 
        shrext)
5449
 
          shrext_cmds="$arg"
5450
 
          prev=
5451
 
          continue
5452
 
          ;;
5453
 
        weak)
5454
 
          func_append weak_libs " $arg"
5455
 
          prev=
5456
 
          continue
5457
 
          ;;
5458
 
        xcclinker)
5459
 
          func_append linker_flags " $qarg"
5460
 
          func_append compiler_flags " $qarg"
5461
 
          prev=
5462
 
          func_append compile_command " $qarg"
5463
 
          func_append finalize_command " $qarg"
5464
 
          continue
5465
 
          ;;
5466
 
        xcompiler)
5467
 
          func_append compiler_flags " $qarg"
5468
 
          prev=
5469
 
          func_append compile_command " $qarg"
5470
 
          func_append finalize_command " $qarg"
5471
 
          continue
5472
 
          ;;
5473
 
        xlinker)
5474
 
          func_append linker_flags " $qarg"
5475
 
          func_append compiler_flags " $wl$qarg"
5476
 
          prev=
5477
 
          func_append compile_command " $wl$qarg"
5478
 
          func_append finalize_command " $wl$qarg"
5479
 
          continue
5480
 
          ;;
5481
 
        *)
5482
 
          eval "$prev=\"\$arg\""
5483
 
          prev=
5484
 
          continue
5485
 
          ;;
5486
 
        esac
5487
 
      fi # test -n "$prev"
5488
 
 
5489
 
      prevarg="$arg"
5490
 
 
5491
 
      case $arg in
5492
 
      -all-static)
5493
 
        if test -n "$link_static_flag"; then
5494
 
          # See comment for -static flag below, for more details.
5495
 
          func_append compile_command " $link_static_flag"
5496
 
          func_append finalize_command " $link_static_flag"
5497
 
        fi
5498
 
        continue
5499
 
        ;;
5500
 
 
5501
 
      -allow-undefined)
5502
 
        # FIXME: remove this flag sometime in the future.
5503
 
        func_fatal_error "\`-allow-undefined' must not be used because it is the default"
5504
 
        ;;
5505
 
 
5506
 
      -avoid-version)
5507
 
        avoid_version=yes
5508
 
        continue
5509
 
        ;;
5510
 
 
5511
 
      -bindir)
5512
 
        prev=bindir
5513
 
        continue
5514
 
        ;;
5515
 
 
5516
 
      -dlopen)
5517
 
        prev=dlfiles
5518
 
        continue
5519
 
        ;;
5520
 
 
5521
 
      -dlpreopen)
5522
 
        prev=dlprefiles
5523
 
        continue
5524
 
        ;;
5525
 
 
5526
 
      -export-dynamic)
5527
 
        export_dynamic=yes
5528
 
        continue
5529
 
        ;;
5530
 
 
5531
 
      -export-symbols | -export-symbols-regex)
5532
 
        if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5533
 
          func_fatal_error "more than one -exported-symbols argument is not allowed"
5534
 
        fi
5535
 
        if test "X$arg" = "X-export-symbols"; then
5536
 
          prev=expsyms
5537
 
        else
5538
 
          prev=expsyms_regex
5539
 
        fi
5540
 
        continue
5541
 
        ;;
5542
 
 
5543
 
      -framework)
5544
 
        prev=framework
5545
 
        continue
5546
 
        ;;
5547
 
 
5548
 
      -inst-prefix-dir)
5549
 
        prev=inst_prefix
5550
 
        continue
5551
 
        ;;
5552
 
 
5553
 
      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
5554
 
      # so, if we see these flags be careful not to treat them like -L
5555
 
      -L[A-Z][A-Z]*:*)
5556
 
        case $with_gcc/$host in
5557
 
        no/*-*-irix* | /*-*-irix*)
5558
 
          func_append compile_command " $arg"
5559
 
          func_append finalize_command " $arg"
5560
 
          ;;
5561
 
        esac
5562
 
        continue
5563
 
        ;;
5564
 
 
5565
 
      -L*)
5566
 
        func_stripname "-L" '' "$arg"
5567
 
        if test -z "$func_stripname_result"; then
5568
 
          if test "$#" -gt 0; then
5569
 
            func_fatal_error "require no space between \`-L' and \`$1'"
5570
 
          else
5571
 
            func_fatal_error "need path for \`-L' option"
5572
 
          fi
5573
 
        fi
5574
 
        func_resolve_sysroot "$func_stripname_result"
5575
 
        dir=$func_resolve_sysroot_result
5576
 
        # We need an absolute path.
5577
 
        case $dir in
5578
 
        [\\/]* | [A-Za-z]:[\\/]*) ;;
5579
 
        *)
5580
 
          absdir=`cd "$dir" && pwd`
5581
 
          test -z "$absdir" && \
5582
 
            func_fatal_error "cannot determine absolute directory name of \`$dir'"
5583
 
          dir="$absdir"
5584
 
          ;;
5585
 
        esac
5586
 
        case "$deplibs " in
5587
 
        *" -L$dir "* | *" $arg "*)
5588
 
          # Will only happen for absolute or sysroot arguments
5589
 
          ;;
5590
 
        *)
5591
 
          # Preserve sysroot, but never include relative directories
5592
 
          case $dir in
5593
 
            [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
5594
 
            *) func_append deplibs " -L$dir" ;;
5595
 
          esac
5596
 
          func_append lib_search_path " $dir"
5597
 
          ;;
5598
 
        esac
5599
 
        case $host in
5600
 
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5601
 
          testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
5602
 
          case :$dllsearchpath: in
5603
 
          *":$dir:"*) ;;
5604
 
          ::) dllsearchpath=$dir;;
5605
 
          *) func_append dllsearchpath ":$dir";;
5606
 
          esac
5607
 
          case :$dllsearchpath: in
5608
 
          *":$testbindir:"*) ;;
5609
 
          ::) dllsearchpath=$testbindir;;
5610
 
          *) func_append dllsearchpath ":$testbindir";;
5611
 
          esac
5612
 
          ;;
5613
 
        esac
5614
 
        continue
5615
 
        ;;
5616
 
 
5617
 
      -l*)
5618
 
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
5619
 
          case $host in
5620
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
5621
 
            # These systems don't actually have a C or math library (as such)
5622
 
            continue
5623
 
            ;;
5624
 
          *-*-os2*)
5625
 
            # These systems don't actually have a C library (as such)
5626
 
            test "X$arg" = "X-lc" && continue
5627
 
            ;;
5628
 
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5629
 
            # Do not include libc due to us having libc/libc_r.
5630
 
            test "X$arg" = "X-lc" && continue
5631
 
            ;;
5632
 
          *-*-rhapsody* | *-*-darwin1.[012])
5633
 
            # Rhapsody C and math libraries are in the System framework
5634
 
            func_append deplibs " System.ltframework"
5635
 
            continue
5636
 
            ;;
5637
 
          *-*-sco3.2v5* | *-*-sco5v6*)
5638
 
            # Causes problems with __ctype
5639
 
            test "X$arg" = "X-lc" && continue
5640
 
            ;;
5641
 
          *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
5642
 
            # Compiler inserts libc in the correct place for threads to work
5643
 
            test "X$arg" = "X-lc" && continue
5644
 
            ;;
5645
 
          esac
5646
 
        elif test "X$arg" = "X-lc_r"; then
5647
 
         case $host in
5648
 
         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
5649
 
           # Do not include libc_r directly, use -pthread flag.
5650
 
           continue
5651
 
           ;;
5652
 
         esac
5653
 
        fi
5654
 
        func_append deplibs " $arg"
5655
 
        continue
5656
 
        ;;
5657
 
 
5658
 
      -module)
5659
 
        module=yes
5660
 
        continue
5661
 
        ;;
5662
 
 
5663
 
      # Tru64 UNIX uses -model [arg] to determine the layout of C++
5664
 
      # classes, name mangling, and exception handling.
5665
 
      # Darwin uses the -arch flag to determine output architecture.
5666
 
      -model|-arch|-isysroot|--sysroot)
5667
 
        func_append compiler_flags " $arg"
5668
 
        func_append compile_command " $arg"
5669
 
        func_append finalize_command " $arg"
5670
 
        prev=xcompiler
5671
 
        continue
5672
 
        ;;
5673
 
 
5674
 
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
5675
 
      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
5676
 
        func_append compiler_flags " $arg"
5677
 
        func_append compile_command " $arg"
5678
 
        func_append finalize_command " $arg"
5679
 
        case "$new_inherited_linker_flags " in
5680
 
            *" $arg "*) ;;
5681
 
            * ) func_append new_inherited_linker_flags " $arg" ;;
5682
 
        esac
5683
 
        continue
5684
 
        ;;
5685
 
 
5686
 
      -multi_module)
5687
 
        single_module="${wl}-multi_module"
5688
 
        continue
5689
 
        ;;
5690
 
 
5691
 
      -no-fast-install)
5692
 
        fast_install=no
5693
 
        continue
5694
 
        ;;
5695
 
 
5696
 
      -no-install)
5697
 
        case $host in
5698
 
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
5699
 
          # The PATH hackery in wrapper scripts is required on Windows
5700
 
          # and Darwin in order for the loader to find any dlls it needs.
5701
 
          func_warning "\`-no-install' is ignored for $host"
5702
 
          func_warning "assuming \`-no-fast-install' instead"
5703
 
          fast_install=no
5704
 
          ;;
5705
 
        *) no_install=yes ;;
5706
 
        esac
5707
 
        continue
5708
 
        ;;
5709
 
 
5710
 
      -no-undefined)
5711
 
        allow_undefined=no
5712
 
        continue
5713
 
        ;;
5714
 
 
5715
 
      -objectlist)
5716
 
        prev=objectlist
5717
 
        continue
5718
 
        ;;
5719
 
 
5720
 
      -o) prev=output ;;
5721
 
 
5722
 
      -precious-files-regex)
5723
 
        prev=precious_regex
5724
 
        continue
5725
 
        ;;
5726
 
 
5727
 
      -release)
5728
 
        prev=release
5729
 
        continue
5730
 
        ;;
5731
 
 
5732
 
      -rpath)
5733
 
        prev=rpath
5734
 
        continue
5735
 
        ;;
5736
 
 
5737
 
      -R)
5738
 
        prev=xrpath
5739
 
        continue
5740
 
        ;;
5741
 
 
5742
 
      -R*)
5743
 
        func_stripname '-R' '' "$arg"
5744
 
        dir=$func_stripname_result
5745
 
        # We need an absolute path.
5746
 
        case $dir in
5747
 
        [\\/]* | [A-Za-z]:[\\/]*) ;;
5748
 
        =*)
5749
 
          func_stripname '=' '' "$dir"
5750
 
          dir=$lt_sysroot$func_stripname_result
5751
 
          ;;
5752
 
        *)
5753
 
          func_fatal_error "only absolute run-paths are allowed"
5754
 
          ;;
5755
 
        esac
5756
 
        case "$xrpath " in
5757
 
        *" $dir "*) ;;
5758
 
        *) func_append xrpath " $dir" ;;
5759
 
        esac
5760
 
        continue
5761
 
        ;;
5762
 
 
5763
 
      -shared)
5764
 
        # The effects of -shared are defined in a previous loop.
5765
 
        continue
5766
 
        ;;
5767
 
 
5768
 
      -shrext)
5769
 
        prev=shrext
5770
 
        continue
5771
 
        ;;
5772
 
 
5773
 
      -static | -static-libtool-libs)
5774
 
        # The effects of -static are defined in a previous loop.
5775
 
        # We used to do the same as -all-static on platforms that
5776
 
        # didn't have a PIC flag, but the assumption that the effects
5777
 
        # would be equivalent was wrong.  It would break on at least
5778
 
        # Digital Unix and AIX.
5779
 
        continue
5780
 
        ;;
5781
 
 
5782
 
      -thread-safe)
5783
 
        thread_safe=yes
5784
 
        continue
5785
 
        ;;
5786
 
 
5787
 
      -version-info)
5788
 
        prev=vinfo
5789
 
        continue
5790
 
        ;;
5791
 
 
5792
 
      -version-number)
5793
 
        prev=vinfo
5794
 
        vinfo_number=yes
5795
 
        continue
5796
 
        ;;
5797
 
 
5798
 
      -weak)
5799
 
        prev=weak
5800
 
        continue
5801
 
        ;;
5802
 
 
5803
 
      -Wc,*)
5804
 
        func_stripname '-Wc,' '' "$arg"
5805
 
        args=$func_stripname_result
5806
 
        arg=
5807
 
        save_ifs="$IFS"; IFS=','
5808
 
        for flag in $args; do
5809
 
          IFS="$save_ifs"
5810
 
          func_quote_for_eval "$flag"
5811
 
          func_append arg " $func_quote_for_eval_result"
5812
 
          func_append compiler_flags " $func_quote_for_eval_result"
5813
 
        done
5814
 
        IFS="$save_ifs"
5815
 
        func_stripname ' ' '' "$arg"
5816
 
        arg=$func_stripname_result
5817
 
        ;;
5818
 
 
5819
 
      -Wl,*)
5820
 
        func_stripname '-Wl,' '' "$arg"
5821
 
        args=$func_stripname_result
5822
 
        arg=
5823
 
        save_ifs="$IFS"; IFS=','
5824
 
        for flag in $args; do
5825
 
          IFS="$save_ifs"
5826
 
          func_quote_for_eval "$flag"
5827
 
          func_append arg " $wl$func_quote_for_eval_result"
5828
 
          func_append compiler_flags " $wl$func_quote_for_eval_result"
5829
 
          func_append linker_flags " $func_quote_for_eval_result"
5830
 
        done
5831
 
        IFS="$save_ifs"
5832
 
        func_stripname ' ' '' "$arg"
5833
 
        arg=$func_stripname_result
5834
 
        ;;
5835
 
 
5836
 
      -Xcompiler)
5837
 
        prev=xcompiler
5838
 
        continue
5839
 
        ;;
5840
 
 
5841
 
      -Xlinker)
5842
 
        prev=xlinker
5843
 
        continue
5844
 
        ;;
5845
 
 
5846
 
      -XCClinker)
5847
 
        prev=xcclinker
5848
 
        continue
5849
 
        ;;
5850
 
 
5851
 
      # -msg_* for osf cc
5852
 
      -msg_*)
5853
 
        func_quote_for_eval "$arg"
5854
 
        arg="$func_quote_for_eval_result"
5855
 
        ;;
5856
 
 
5857
 
      # Flags to be passed through unchanged, with rationale:
5858
 
      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
5859
 
      # -r[0-9][0-9]*        specify processor for the SGI compiler
5860
 
      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
5861
 
      # +DA*, +DD*           enable 64-bit mode for the HP compiler
5862
 
      # -q*                  compiler args for the IBM compiler
5863
 
      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
5864
 
      # -F/path              path to uninstalled frameworks, gcc on darwin
5865
 
      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
5866
 
      # @file                GCC response files
5867
 
      # -tp=*                Portland pgcc target processor selection
5868
 
      # --sysroot=*          for sysroot support
5869
 
      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
5870
 
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5871
 
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
5872
 
      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
5873
 
        func_quote_for_eval "$arg"
5874
 
        arg="$func_quote_for_eval_result"
5875
 
        func_append compile_command " $arg"
5876
 
        func_append finalize_command " $arg"
5877
 
        func_append compiler_flags " $arg"
5878
 
        continue
5879
 
        ;;
5880
 
 
5881
 
      # Some other compiler flag.
5882
 
      -* | +*)
5883
 
        func_quote_for_eval "$arg"
5884
 
        arg="$func_quote_for_eval_result"
5885
 
        ;;
5886
 
 
5887
 
      *.$objext)
5888
 
        # A standard object.
5889
 
        func_append objs " $arg"
5890
 
        ;;
5891
 
 
5892
 
      *.lo)
5893
 
        # A libtool-controlled object.
5894
 
 
5895
 
        # Check to see that this really is a libtool object.
5896
 
        if func_lalib_unsafe_p "$arg"; then
5897
 
          pic_object=
5898
 
          non_pic_object=
5899
 
 
5900
 
          # Read the .lo file
5901
 
          func_source "$arg"
5902
 
 
5903
 
          if test -z "$pic_object" ||
5904
 
             test -z "$non_pic_object" ||
5905
 
             test "$pic_object" = none &&
5906
 
             test "$non_pic_object" = none; then
5907
 
            func_fatal_error "cannot find name of object for \`$arg'"
5908
 
          fi
5909
 
 
5910
 
          # Extract subdirectory from the argument.
5911
 
          func_dirname "$arg" "/" ""
5912
 
          xdir="$func_dirname_result"
5913
 
 
5914
 
          if test "$pic_object" != none; then
5915
 
            # Prepend the subdirectory the object is found in.
5916
 
            pic_object="$xdir$pic_object"
5917
 
 
5918
 
            if test "$prev" = dlfiles; then
5919
 
              if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5920
 
                func_append dlfiles " $pic_object"
5921
 
                prev=
5922
 
                continue
5923
 
              else
5924
 
                # If libtool objects are unsupported, then we need to preload.
5925
 
                prev=dlprefiles
5926
 
              fi
5927
 
            fi
5928
 
 
5929
 
            # CHECK ME:  I think I busted this.  -Ossama
5930
 
            if test "$prev" = dlprefiles; then
5931
 
              # Preload the old-style object.
5932
 
              func_append dlprefiles " $pic_object"
5933
 
              prev=
5934
 
            fi
5935
 
 
5936
 
            # A PIC object.
5937
 
            func_append libobjs " $pic_object"
5938
 
            arg="$pic_object"
5939
 
          fi
5940
 
 
5941
 
          # Non-PIC object.
5942
 
          if test "$non_pic_object" != none; then
5943
 
            # Prepend the subdirectory the object is found in.
5944
 
            non_pic_object="$xdir$non_pic_object"
5945
 
 
5946
 
            # A standard non-PIC object
5947
 
            func_append non_pic_objects " $non_pic_object"
5948
 
            if test -z "$pic_object" || test "$pic_object" = none ; then
5949
 
              arg="$non_pic_object"
5950
 
            fi
5951
 
          else
5952
 
            # If the PIC object exists, use it instead.
5953
 
            # $xdir was prepended to $pic_object above.
5954
 
            non_pic_object="$pic_object"
5955
 
            func_append non_pic_objects " $non_pic_object"
5956
 
          fi
5957
 
        else
5958
 
          # Only an error if not doing a dry-run.
5959
 
          if $opt_dry_run; then
5960
 
            # Extract subdirectory from the argument.
5961
 
            func_dirname "$arg" "/" ""
5962
 
            xdir="$func_dirname_result"
5963
 
 
5964
 
            func_lo2o "$arg"
5965
 
            pic_object=$xdir$objdir/$func_lo2o_result
5966
 
            non_pic_object=$xdir$func_lo2o_result
5967
 
            func_append libobjs " $pic_object"
5968
 
            func_append non_pic_objects " $non_pic_object"
5969
 
          else
5970
 
            func_fatal_error "\`$arg' is not a valid libtool object"
5971
 
          fi
5972
 
        fi
5973
 
        ;;
5974
 
 
5975
 
      *.$libext)
5976
 
        # An archive.
5977
 
        func_append deplibs " $arg"
5978
 
        func_append old_deplibs " $arg"
5979
 
        continue
5980
 
        ;;
5981
 
 
5982
 
      *.la)
5983
 
        # A libtool-controlled library.
5984
 
 
5985
 
        func_resolve_sysroot "$arg"
5986
 
        if test "$prev" = dlfiles; then
5987
 
          # This library was specified with -dlopen.
5988
 
          func_append dlfiles " $func_resolve_sysroot_result"
5989
 
          prev=
5990
 
        elif test "$prev" = dlprefiles; then
5991
 
          # The library was specified with -dlpreopen.
5992
 
          func_append dlprefiles " $func_resolve_sysroot_result"
5993
 
          prev=
5994
 
        else
5995
 
          func_append deplibs " $func_resolve_sysroot_result"
5996
 
        fi
5997
 
        continue
5998
 
        ;;
5999
 
 
6000
 
      # Some other compiler argument.
6001
 
      *)
6002
 
        # Unknown arguments in both finalize_command and compile_command need
6003
 
        # to be aesthetically quoted because they are evaled later.
6004
 
        func_quote_for_eval "$arg"
6005
 
        arg="$func_quote_for_eval_result"
6006
 
        ;;
6007
 
      esac # arg
6008
 
 
6009
 
      # Now actually substitute the argument into the commands.
6010
 
      if test -n "$arg"; then
6011
 
        func_append compile_command " $arg"
6012
 
        func_append finalize_command " $arg"
6013
 
      fi
6014
 
    done # argument parsing loop
6015
 
 
6016
 
    test -n "$prev" && \
6017
 
      func_fatal_help "the \`$prevarg' option requires an argument"
6018
 
 
6019
 
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
6020
 
      eval arg=\"$export_dynamic_flag_spec\"
6021
 
      func_append compile_command " $arg"
6022
 
      func_append finalize_command " $arg"
6023
 
    fi
6024
 
 
6025
 
    oldlibs=
6026
 
    # calculate the name of the file, without its directory
6027
 
    func_basename "$output"
6028
 
    outputname="$func_basename_result"
6029
 
    libobjs_save="$libobjs"
6030
 
 
6031
 
    if test -n "$shlibpath_var"; then
6032
 
      # get the directories listed in $shlibpath_var
6033
 
      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
6034
 
    else
6035
 
      shlib_search_path=
6036
 
    fi
6037
 
    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
6038
 
    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
6039
 
 
6040
 
    func_dirname "$output" "/" ""
6041
 
    output_objdir="$func_dirname_result$objdir"
6042
 
    func_to_tool_file "$output_objdir/"
6043
 
    tool_output_objdir=$func_to_tool_file_result
6044
 
    # Create the object directory.
6045
 
    func_mkdir_p "$output_objdir"
6046
 
 
6047
 
    # Determine the type of output
6048
 
    case $output in
6049
 
    "")
6050
 
      func_fatal_help "you must specify an output file"
6051
 
      ;;
6052
 
    *.$libext) linkmode=oldlib ;;
6053
 
    *.lo | *.$objext) linkmode=obj ;;
6054
 
    *.la) linkmode=lib ;;
6055
 
    *) linkmode=prog ;; # Anything else should be a program.
6056
 
    esac
6057
 
 
6058
 
    specialdeplibs=
6059
 
 
6060
 
    libs=
6061
 
    # Find all interdependent deplibs by searching for libraries
6062
 
    # that are linked more than once (e.g. -la -lb -la)
6063
 
    for deplib in $deplibs; do
6064
 
      if $opt_preserve_dup_deps ; then
6065
 
        case "$libs " in
6066
 
        *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6067
 
        esac
6068
 
      fi
6069
 
      func_append libs " $deplib"
6070
 
    done
6071
 
 
6072
 
    if test "$linkmode" = lib; then
6073
 
      libs="$predeps $libs $compiler_lib_search_path $postdeps"
6074
 
 
6075
 
      # Compute libraries that are listed more than once in $predeps
6076
 
      # $postdeps and mark them as special (i.e., whose duplicates are
6077
 
      # not to be eliminated).
6078
 
      pre_post_deps=
6079
 
      if $opt_duplicate_compiler_generated_deps; then
6080
 
        for pre_post_dep in $predeps $postdeps; do
6081
 
          case "$pre_post_deps " in
6082
 
          *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
6083
 
          esac
6084
 
          func_append pre_post_deps " $pre_post_dep"
6085
 
        done
6086
 
      fi
6087
 
      pre_post_deps=
6088
 
    fi
6089
 
 
6090
 
    deplibs=
6091
 
    newdependency_libs=
6092
 
    newlib_search_path=
6093
 
    need_relink=no # whether we're linking any uninstalled libtool libraries
6094
 
    notinst_deplibs= # not-installed libtool libraries
6095
 
    notinst_path= # paths that contain not-installed libtool libraries
6096
 
 
6097
 
    case $linkmode in
6098
 
    lib)
6099
 
        passes="conv dlpreopen link"
6100
 
        for file in $dlfiles $dlprefiles; do
6101
 
          case $file in
6102
 
          *.la) ;;
6103
 
          *)
6104
 
            func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
6105
 
            ;;
6106
 
          esac
6107
 
        done
6108
 
        ;;
6109
 
    prog)
6110
 
        compile_deplibs=
6111
 
        finalize_deplibs=
6112
 
        alldeplibs=no
6113
 
        newdlfiles=
6114
 
        newdlprefiles=
6115
 
        passes="conv scan dlopen dlpreopen link"
6116
 
        ;;
6117
 
    *)  passes="conv"
6118
 
        ;;
6119
 
    esac
6120
 
 
6121
 
    for pass in $passes; do
6122
 
      # The preopen pass in lib mode reverses $deplibs; put it back here
6123
 
      # so that -L comes before libs that need it for instance...
6124
 
      if test "$linkmode,$pass" = "lib,link"; then
6125
 
        ## FIXME: Find the place where the list is rebuilt in the wrong
6126
 
        ##        order, and fix it there properly
6127
 
        tmp_deplibs=
6128
 
        for deplib in $deplibs; do
6129
 
          tmp_deplibs="$deplib $tmp_deplibs"
6130
 
        done
6131
 
        deplibs="$tmp_deplibs"
6132
 
      fi
6133
 
 
6134
 
      if test "$linkmode,$pass" = "lib,link" ||
6135
 
         test "$linkmode,$pass" = "prog,scan"; then
6136
 
        libs="$deplibs"
6137
 
        deplibs=
6138
 
      fi
6139
 
      if test "$linkmode" = prog; then
6140
 
        case $pass in
6141
 
        dlopen) libs="$dlfiles" ;;
6142
 
        dlpreopen) libs="$dlprefiles" ;;
6143
 
        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
6144
 
        esac
6145
 
      fi
6146
 
      if test "$linkmode,$pass" = "lib,dlpreopen"; then
6147
 
        # Collect and forward deplibs of preopened libtool libs
6148
 
        for lib in $dlprefiles; do
6149
 
          # Ignore non-libtool-libs
6150
 
          dependency_libs=
6151
 
          func_resolve_sysroot "$lib"
6152
 
          case $lib in
6153
 
          *.la) func_source "$func_resolve_sysroot_result" ;;
6154
 
          esac
6155
 
 
6156
 
          # Collect preopened libtool deplibs, except any this library
6157
 
          # has declared as weak libs
6158
 
          for deplib in $dependency_libs; do
6159
 
            func_basename "$deplib"
6160
 
            deplib_base=$func_basename_result
6161
 
            case " $weak_libs " in
6162
 
            *" $deplib_base "*) ;;
6163
 
            *) func_append deplibs " $deplib" ;;
6164
 
            esac
6165
 
          done
6166
 
        done
6167
 
        libs="$dlprefiles"
6168
 
      fi
6169
 
      if test "$pass" = dlopen; then
6170
 
        # Collect dlpreopened libraries
6171
 
        save_deplibs="$deplibs"
6172
 
        deplibs=
6173
 
      fi
6174
 
 
6175
 
      for deplib in $libs; do
6176
 
        lib=
6177
 
        found=no
6178
 
        case $deplib in
6179
 
        -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
6180
 
        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6181
 
          if test "$linkmode,$pass" = "prog,link"; then
6182
 
            compile_deplibs="$deplib $compile_deplibs"
6183
 
            finalize_deplibs="$deplib $finalize_deplibs"
6184
 
          else
6185
 
            func_append compiler_flags " $deplib"
6186
 
            if test "$linkmode" = lib ; then
6187
 
                case "$new_inherited_linker_flags " in
6188
 
                    *" $deplib "*) ;;
6189
 
                    * ) func_append new_inherited_linker_flags " $deplib" ;;
6190
 
                esac
6191
 
            fi
6192
 
          fi
6193
 
          continue
6194
 
          ;;
6195
 
        -l*)
6196
 
          if test "$linkmode" != lib && test "$linkmode" != prog; then
6197
 
            func_warning "\`-l' is ignored for archives/objects"
6198
 
            continue
6199
 
          fi
6200
 
          func_stripname '-l' '' "$deplib"
6201
 
          name=$func_stripname_result
6202
 
          if test "$linkmode" = lib; then
6203
 
            searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
6204
 
          else
6205
 
            searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
6206
 
          fi
6207
 
          for searchdir in $searchdirs; do
6208
 
            for search_ext in .la $std_shrext .so .a; do
6209
 
              # Search the libtool library
6210
 
              lib="$searchdir/lib${name}${search_ext}"
6211
 
              if test -f "$lib"; then
6212
 
                if test "$search_ext" = ".la"; then
6213
 
                  found=yes
6214
 
                else
6215
 
                  found=no
6216
 
                fi
6217
 
                break 2
6218
 
              fi
6219
 
            done
6220
 
          done
6221
 
          if test "$found" != yes; then
6222
 
            # deplib doesn't seem to be a libtool library
6223
 
            if test "$linkmode,$pass" = "prog,link"; then
6224
 
              compile_deplibs="$deplib $compile_deplibs"
6225
 
              finalize_deplibs="$deplib $finalize_deplibs"
6226
 
            else
6227
 
              deplibs="$deplib $deplibs"
6228
 
              test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6229
 
            fi
6230
 
            continue
6231
 
          else # deplib is a libtool library
6232
 
            # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
6233
 
            # We need to do some special things here, and not later.
6234
 
            if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6235
 
              case " $predeps $postdeps " in
6236
 
              *" $deplib "*)
6237
 
                if func_lalib_p "$lib"; then
6238
 
                  library_names=
6239
 
                  old_library=
6240
 
                  func_source "$lib"
6241
 
                  for l in $old_library $library_names; do
6242
 
                    ll="$l"
6243
 
                  done
6244
 
                  if test "X$ll" = "X$old_library" ; then # only static version available
6245
 
                    found=no
6246
 
                    func_dirname "$lib" "" "."
6247
 
                    ladir="$func_dirname_result"
6248
 
                    lib=$ladir/$old_library
6249
 
                    if test "$linkmode,$pass" = "prog,link"; then
6250
 
                      compile_deplibs="$deplib $compile_deplibs"
6251
 
                      finalize_deplibs="$deplib $finalize_deplibs"
6252
 
                    else
6253
 
                      deplibs="$deplib $deplibs"
6254
 
                      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6255
 
                    fi
6256
 
                    continue
6257
 
                  fi
6258
 
                fi
6259
 
                ;;
6260
 
              *) ;;
6261
 
              esac
6262
 
            fi
6263
 
          fi
6264
 
          ;; # -l
6265
 
        *.ltframework)
6266
 
          if test "$linkmode,$pass" = "prog,link"; then
6267
 
            compile_deplibs="$deplib $compile_deplibs"
6268
 
            finalize_deplibs="$deplib $finalize_deplibs"
6269
 
          else
6270
 
            deplibs="$deplib $deplibs"
6271
 
            if test "$linkmode" = lib ; then
6272
 
                case "$new_inherited_linker_flags " in
6273
 
                    *" $deplib "*) ;;
6274
 
                    * ) func_append new_inherited_linker_flags " $deplib" ;;
6275
 
                esac
6276
 
            fi
6277
 
          fi
6278
 
          continue
6279
 
          ;;
6280
 
        -L*)
6281
 
          case $linkmode in
6282
 
          lib)
6283
 
            deplibs="$deplib $deplibs"
6284
 
            test "$pass" = conv && continue
6285
 
            newdependency_libs="$deplib $newdependency_libs"
6286
 
            func_stripname '-L' '' "$deplib"
6287
 
            func_resolve_sysroot "$func_stripname_result"
6288
 
            func_append newlib_search_path " $func_resolve_sysroot_result"
6289
 
            ;;
6290
 
          prog)
6291
 
            if test "$pass" = conv; then
6292
 
              deplibs="$deplib $deplibs"
6293
 
              continue
6294
 
            fi
6295
 
            if test "$pass" = scan; then
6296
 
              deplibs="$deplib $deplibs"
6297
 
            else
6298
 
              compile_deplibs="$deplib $compile_deplibs"
6299
 
              finalize_deplibs="$deplib $finalize_deplibs"
6300
 
            fi
6301
 
            func_stripname '-L' '' "$deplib"
6302
 
            func_resolve_sysroot "$func_stripname_result"
6303
 
            func_append newlib_search_path " $func_resolve_sysroot_result"
6304
 
            ;;
6305
 
          *)
6306
 
            func_warning "\`-L' is ignored for archives/objects"
6307
 
            ;;
6308
 
          esac # linkmode
6309
 
          continue
6310
 
          ;; # -L
6311
 
        -R*)
6312
 
          if test "$pass" = link; then
6313
 
            func_stripname '-R' '' "$deplib"
6314
 
            func_resolve_sysroot "$func_stripname_result"
6315
 
            dir=$func_resolve_sysroot_result
6316
 
            # Make sure the xrpath contains only unique directories.
6317
 
            case "$xrpath " in
6318
 
            *" $dir "*) ;;
6319
 
            *) func_append xrpath " $dir" ;;
6320
 
            esac
6321
 
          fi
6322
 
          deplibs="$deplib $deplibs"
6323
 
          continue
6324
 
          ;;
6325
 
        *.la)
6326
 
          func_resolve_sysroot "$deplib"
6327
 
          lib=$func_resolve_sysroot_result
6328
 
          ;;
6329
 
        *.$libext)
6330
 
          if test "$pass" = conv; then
6331
 
            deplibs="$deplib $deplibs"
6332
 
            continue
6333
 
          fi
6334
 
          case $linkmode in
6335
 
          lib)
6336
 
            # Linking convenience modules into shared libraries is allowed,
6337
 
            # but linking other static libraries is non-portable.
6338
 
            case " $dlpreconveniencelibs " in
6339
 
            *" $deplib "*) ;;
6340
 
            *)
6341
 
              valid_a_lib=no
6342
 
              case $deplibs_check_method in
6343
 
                match_pattern*)
6344
 
                  set dummy $deplibs_check_method; shift
6345
 
                  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6346
 
                  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6347
 
                    | $EGREP "$match_pattern_regex" > /dev/null; then
6348
 
                    valid_a_lib=yes
6349
 
                  fi
6350
 
                ;;
6351
 
                pass_all)
6352
 
                  valid_a_lib=yes
6353
 
                ;;
6354
 
              esac
6355
 
              if test "$valid_a_lib" != yes; then
6356
 
                echo
6357
 
                $ECHO "*** Warning: Trying to link with static lib archive $deplib."
6358
 
                echo "*** I have the capability to make that library automatically link in when"
6359
 
                echo "*** you link to this library.  But I can only do this if you have a"
6360
 
                echo "*** shared version of the library, which you do not appear to have"
6361
 
                echo "*** because the file extensions .$libext of this argument makes me believe"
6362
 
                echo "*** that it is just a static archive that I should not use here."
6363
 
              else
6364
 
                echo
6365
 
                $ECHO "*** Warning: Linking the shared library $output against the"
6366
 
                $ECHO "*** static library $deplib is not portable!"
6367
 
                deplibs="$deplib $deplibs"
6368
 
              fi
6369
 
              ;;
6370
 
            esac
6371
 
            continue
6372
 
            ;;
6373
 
          prog)
6374
 
            if test "$pass" != link; then
6375
 
              deplibs="$deplib $deplibs"
6376
 
            else
6377
 
              compile_deplibs="$deplib $compile_deplibs"
6378
 
              finalize_deplibs="$deplib $finalize_deplibs"
6379
 
            fi
6380
 
            continue
6381
 
            ;;
6382
 
          esac # linkmode
6383
 
          ;; # *.$libext
6384
 
        *.lo | *.$objext)
6385
 
          if test "$pass" = conv; then
6386
 
            deplibs="$deplib $deplibs"
6387
 
          elif test "$linkmode" = prog; then
6388
 
            if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
6389
 
              # If there is no dlopen support or we're linking statically,
6390
 
              # we need to preload.
6391
 
              func_append newdlprefiles " $deplib"
6392
 
              compile_deplibs="$deplib $compile_deplibs"
6393
 
              finalize_deplibs="$deplib $finalize_deplibs"
6394
 
            else
6395
 
              func_append newdlfiles " $deplib"
6396
 
            fi
6397
 
          fi
6398
 
          continue
6399
 
          ;;
6400
 
        %DEPLIBS%)
6401
 
          alldeplibs=yes
6402
 
          continue
6403
 
          ;;
6404
 
        esac # case $deplib
6405
 
 
6406
 
        if test "$found" = yes || test -f "$lib"; then :
6407
 
        else
6408
 
          func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6409
 
        fi
6410
 
 
6411
 
        # Check to see that this really is a libtool archive.
6412
 
        func_lalib_unsafe_p "$lib" \
6413
 
          || func_fatal_error "\`$lib' is not a valid libtool archive"
6414
 
 
6415
 
        func_dirname "$lib" "" "."
6416
 
        ladir="$func_dirname_result"
6417
 
 
6418
 
        dlname=
6419
 
        dlopen=
6420
 
        dlpreopen=
6421
 
        libdir=
6422
 
        library_names=
6423
 
        old_library=
6424
 
        inherited_linker_flags=
6425
 
        # If the library was installed with an old release of libtool,
6426
 
        # it will not redefine variables installed, or shouldnotlink
6427
 
        installed=yes
6428
 
        shouldnotlink=no
6429
 
        avoidtemprpath=
6430
 
 
6431
 
 
6432
 
        # Read the .la file
6433
 
        func_source "$lib"
6434
 
 
6435
 
        # Convert "-framework foo" to "foo.ltframework"
6436
 
        if test -n "$inherited_linker_flags"; then
6437
 
          tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
6438
 
          for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6439
 
            case " $new_inherited_linker_flags " in
6440
 
              *" $tmp_inherited_linker_flag "*) ;;
6441
 
              *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
6442
 
            esac
6443
 
          done
6444
 
        fi
6445
 
        dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6446
 
        if test "$linkmode,$pass" = "lib,link" ||
6447
 
           test "$linkmode,$pass" = "prog,scan" ||
6448
 
           { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6449
 
          test -n "$dlopen" && func_append dlfiles " $dlopen"
6450
 
          test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
6451
 
        fi
6452
 
 
6453
 
        if test "$pass" = conv; then
6454
 
          # Only check for convenience libraries
6455
 
          deplibs="$lib $deplibs"
6456
 
          if test -z "$libdir"; then
6457
 
            if test -z "$old_library"; then
6458
 
              func_fatal_error "cannot find name of link library for \`$lib'"
6459
 
            fi
6460
 
            # It is a libtool convenience library, so add in its objects.
6461
 
            func_append convenience " $ladir/$objdir/$old_library"
6462
 
            func_append old_convenience " $ladir/$objdir/$old_library"
6463
 
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
6464
 
            func_fatal_error "\`$lib' is not a convenience library"
6465
 
          fi
6466
 
          tmp_libs=
6467
 
          for deplib in $dependency_libs; do
6468
 
            deplibs="$deplib $deplibs"
6469
 
            if $opt_preserve_dup_deps ; then
6470
 
              case "$tmp_libs " in
6471
 
              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6472
 
              esac
6473
 
            fi
6474
 
            func_append tmp_libs " $deplib"
6475
 
          done
6476
 
          continue
6477
 
        fi # $pass = conv
6478
 
 
6479
 
 
6480
 
        # Get the name of the library we link against.
6481
 
        linklib=
6482
 
        if test -n "$old_library" &&
6483
 
           { test "$prefer_static_libs" = yes ||
6484
 
             test "$prefer_static_libs,$installed" = "built,no"; }; then
6485
 
          linklib=$old_library
6486
 
        else
6487
 
          for l in $old_library $library_names; do
6488
 
            linklib="$l"
6489
 
          done
6490
 
        fi
6491
 
        if test -z "$linklib"; then
6492
 
          func_fatal_error "cannot find name of link library for \`$lib'"
6493
 
        fi
6494
 
 
6495
 
        # This library was specified with -dlopen.
6496
 
        if test "$pass" = dlopen; then
6497
 
          if test -z "$libdir"; then
6498
 
            func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6499
 
          fi
6500
 
          if test -z "$dlname" ||
6501
 
             test "$dlopen_support" != yes ||
6502
 
             test "$build_libtool_libs" = no; then
6503
 
            # If there is no dlname, no dlopen support or we're linking
6504
 
            # statically, we need to preload.  We also need to preload any
6505
 
            # dependent libraries so libltdl's deplib preloader doesn't
6506
 
            # bomb out in the load deplibs phase.
6507
 
            func_append dlprefiles " $lib $dependency_libs"
6508
 
          else
6509
 
            func_append newdlfiles " $lib"
6510
 
          fi
6511
 
          continue
6512
 
        fi # $pass = dlopen
6513
 
 
6514
 
        # We need an absolute path.
6515
 
        case $ladir in
6516
 
        [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
6517
 
        *)
6518
 
          abs_ladir=`cd "$ladir" && pwd`
6519
 
          if test -z "$abs_ladir"; then
6520
 
            func_warning "cannot determine absolute directory name of \`$ladir'"
6521
 
            func_warning "passing it literally to the linker, although it might fail"
6522
 
            abs_ladir="$ladir"
6523
 
          fi
6524
 
          ;;
6525
 
        esac
6526
 
        func_basename "$lib"
6527
 
        laname="$func_basename_result"
6528
 
 
6529
 
        # Find the relevant object directory and library name.
6530
 
        if test "X$installed" = Xyes; then
6531
 
          if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6532
 
            func_warning "library \`$lib' was moved."
6533
 
            dir="$ladir"
6534
 
            absdir="$abs_ladir"
6535
 
            libdir="$abs_ladir"
6536
 
          else
6537
 
            dir="$lt_sysroot$libdir"
6538
 
            absdir="$lt_sysroot$libdir"
6539
 
          fi
6540
 
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
6541
 
        else
6542
 
          if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6543
 
            dir="$ladir"
6544
 
            absdir="$abs_ladir"
6545
 
            # Remove this search path later
6546
 
            func_append notinst_path " $abs_ladir"
6547
 
          else
6548
 
            dir="$ladir/$objdir"
6549
 
            absdir="$abs_ladir/$objdir"
6550
 
            # Remove this search path later
6551
 
            func_append notinst_path " $abs_ladir"
6552
 
          fi
6553
 
        fi # $installed = yes
6554
 
        func_stripname 'lib' '.la' "$laname"
6555
 
        name=$func_stripname_result
6556
 
 
6557
 
        # This library was specified with -dlpreopen.
6558
 
        if test "$pass" = dlpreopen; then
6559
 
          if test -z "$libdir" && test "$linkmode" = prog; then
6560
 
            func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
6561
 
          fi
6562
 
          case "$host" in
6563
 
            # special handling for platforms with PE-DLLs.
6564
 
            *cygwin* | *mingw* | *cegcc* )
6565
 
              # Linker will automatically link against shared library if both
6566
 
              # static and shared are present.  Therefore, ensure we extract
6567
 
              # symbols from the import library if a shared library is present
6568
 
              # (otherwise, the dlopen module name will be incorrect).  We do
6569
 
              # this by putting the import library name into $newdlprefiles.
6570
 
              # We recover the dlopen module name by 'saving' the la file
6571
 
              # name in a special purpose variable, and (later) extracting the
6572
 
              # dlname from the la file.
6573
 
              if test -n "$dlname"; then
6574
 
                func_tr_sh "$dir/$linklib"
6575
 
                eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
6576
 
                func_append newdlprefiles " $dir/$linklib"
6577
 
              else
6578
 
                func_append newdlprefiles " $dir/$old_library"
6579
 
                # Keep a list of preopened convenience libraries to check
6580
 
                # that they are being used correctly in the link pass.
6581
 
                test -z "$libdir" && \
6582
 
                  func_append dlpreconveniencelibs " $dir/$old_library"
6583
 
              fi
6584
 
            ;;
6585
 
            * )
6586
 
              # Prefer using a static library (so that no silly _DYNAMIC symbols
6587
 
              # are required to link).
6588
 
              if test -n "$old_library"; then
6589
 
                func_append newdlprefiles " $dir/$old_library"
6590
 
                # Keep a list of preopened convenience libraries to check
6591
 
                # that they are being used correctly in the link pass.
6592
 
                test -z "$libdir" && \
6593
 
                  func_append dlpreconveniencelibs " $dir/$old_library"
6594
 
              # Otherwise, use the dlname, so that lt_dlopen finds it.
6595
 
              elif test -n "$dlname"; then
6596
 
                func_append newdlprefiles " $dir/$dlname"
6597
 
              else
6598
 
                func_append newdlprefiles " $dir/$linklib"
6599
 
              fi
6600
 
            ;;
6601
 
          esac
6602
 
        fi # $pass = dlpreopen
6603
 
 
6604
 
        if test -z "$libdir"; then
6605
 
          # Link the convenience library
6606
 
          if test "$linkmode" = lib; then
6607
 
            deplibs="$dir/$old_library $deplibs"
6608
 
          elif test "$linkmode,$pass" = "prog,link"; then
6609
 
            compile_deplibs="$dir/$old_library $compile_deplibs"
6610
 
            finalize_deplibs="$dir/$old_library $finalize_deplibs"
6611
 
          else
6612
 
            deplibs="$lib $deplibs" # used for prog,scan pass
6613
 
          fi
6614
 
          continue
6615
 
        fi
6616
 
 
6617
 
 
6618
 
        if test "$linkmode" = prog && test "$pass" != link; then
6619
 
          func_append newlib_search_path " $ladir"
6620
 
          deplibs="$lib $deplibs"
6621
 
 
6622
 
          linkalldeplibs=no
6623
 
          if test "$link_all_deplibs" != no || test -z "$library_names" ||
6624
 
             test "$build_libtool_libs" = no; then
6625
 
            linkalldeplibs=yes
6626
 
          fi
6627
 
 
6628
 
          tmp_libs=
6629
 
          for deplib in $dependency_libs; do
6630
 
            case $deplib in
6631
 
            -L*) func_stripname '-L' '' "$deplib"
6632
 
                 func_resolve_sysroot "$func_stripname_result"
6633
 
                 func_append newlib_search_path " $func_resolve_sysroot_result"
6634
 
                 ;;
6635
 
            esac
6636
 
            # Need to link against all dependency_libs?
6637
 
            if test "$linkalldeplibs" = yes; then
6638
 
              deplibs="$deplib $deplibs"
6639
 
            else
6640
 
              # Need to hardcode shared library paths
6641
 
              # or/and link against static libraries
6642
 
              newdependency_libs="$deplib $newdependency_libs"
6643
 
            fi
6644
 
            if $opt_preserve_dup_deps ; then
6645
 
              case "$tmp_libs " in
6646
 
              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6647
 
              esac
6648
 
            fi
6649
 
            func_append tmp_libs " $deplib"
6650
 
          done # for deplib
6651
 
          continue
6652
 
        fi # $linkmode = prog...
6653
 
 
6654
 
        if test "$linkmode,$pass" = "prog,link"; then
6655
 
          if test -n "$library_names" &&
6656
 
             { { test "$prefer_static_libs" = no ||
6657
 
                 test "$prefer_static_libs,$installed" = "built,yes"; } ||
6658
 
               test -z "$old_library"; }; then
6659
 
            # We need to hardcode the library path
6660
 
            if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
6661
 
              # Make sure the rpath contains only unique directories.
6662
 
              case "$temp_rpath:" in
6663
 
              *"$absdir:"*) ;;
6664
 
              *) func_append temp_rpath "$absdir:" ;;
6665
 
              esac
6666
 
            fi
6667
 
 
6668
 
            # Hardcode the library path.
6669
 
            # Skip directories that are in the system default run-time
6670
 
            # search path.
6671
 
            case " $sys_lib_dlsearch_path " in
6672
 
            *" $absdir "*) ;;
6673
 
            *)
6674
 
              case "$compile_rpath " in
6675
 
              *" $absdir "*) ;;
6676
 
              *) func_append compile_rpath " $absdir" ;;
6677
 
              esac
6678
 
              ;;
6679
 
            esac
6680
 
            case " $sys_lib_dlsearch_path " in
6681
 
            *" $libdir "*) ;;
6682
 
            *)
6683
 
              case "$finalize_rpath " in
6684
 
              *" $libdir "*) ;;
6685
 
              *) func_append finalize_rpath " $libdir" ;;
6686
 
              esac
6687
 
              ;;
6688
 
            esac
6689
 
          fi # $linkmode,$pass = prog,link...
6690
 
 
6691
 
          if test "$alldeplibs" = yes &&
6692
 
             { test "$deplibs_check_method" = pass_all ||
6693
 
               { test "$build_libtool_libs" = yes &&
6694
 
                 test -n "$library_names"; }; }; then
6695
 
            # We only need to search for static libraries
6696
 
            continue
6697
 
          fi
6698
 
        fi
6699
 
 
6700
 
        link_static=no # Whether the deplib will be linked statically
6701
 
        use_static_libs=$prefer_static_libs
6702
 
        if test "$use_static_libs" = built && test "$installed" = yes; then
6703
 
          use_static_libs=no
6704
 
        fi
6705
 
        if test -n "$library_names" &&
6706
 
           { test "$use_static_libs" = no || test -z "$old_library"; }; then
6707
 
          case $host in
6708
 
          *cygwin* | *mingw* | *cegcc*)
6709
 
              # No point in relinking DLLs because paths are not encoded
6710
 
              func_append notinst_deplibs " $lib"
6711
 
              need_relink=no
6712
 
            ;;
6713
 
          *)
6714
 
            if test "$installed" = no; then
6715
 
              func_append notinst_deplibs " $lib"
6716
 
              need_relink=yes
6717
 
            fi
6718
 
            ;;
6719
 
          esac
6720
 
          # This is a shared library
6721
 
 
6722
 
          # Warn about portability, can't link against -module's on some
6723
 
          # systems (darwin).  Don't bleat about dlopened modules though!
6724
 
          dlopenmodule=""
6725
 
          for dlpremoduletest in $dlprefiles; do
6726
 
            if test "X$dlpremoduletest" = "X$lib"; then
6727
 
              dlopenmodule="$dlpremoduletest"
6728
 
              break
6729
 
            fi
6730
 
          done
6731
 
          if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
6732
 
            echo
6733
 
            if test "$linkmode" = prog; then
6734
 
              $ECHO "*** Warning: Linking the executable $output against the loadable module"
6735
 
            else
6736
 
              $ECHO "*** Warning: Linking the shared library $output against the loadable module"
6737
 
            fi
6738
 
            $ECHO "*** $linklib is not portable!"
6739
 
          fi
6740
 
          if test "$linkmode" = lib &&
6741
 
             test "$hardcode_into_libs" = yes; then
6742
 
            # Hardcode the library path.
6743
 
            # Skip directories that are in the system default run-time
6744
 
            # search path.
6745
 
            case " $sys_lib_dlsearch_path " in
6746
 
            *" $absdir "*) ;;
6747
 
            *)
6748
 
              case "$compile_rpath " in
6749
 
              *" $absdir "*) ;;
6750
 
              *) func_append compile_rpath " $absdir" ;;
6751
 
              esac
6752
 
              ;;
6753
 
            esac
6754
 
            case " $sys_lib_dlsearch_path " in
6755
 
            *" $libdir "*) ;;
6756
 
            *)
6757
 
              case "$finalize_rpath " in
6758
 
              *" $libdir "*) ;;
6759
 
              *) func_append finalize_rpath " $libdir" ;;
6760
 
              esac
6761
 
              ;;
6762
 
            esac
6763
 
          fi
6764
 
 
6765
 
          if test -n "$old_archive_from_expsyms_cmds"; then
6766
 
            # figure out the soname
6767
 
            set dummy $library_names
6768
 
            shift
6769
 
            realname="$1"
6770
 
            shift
6771
 
            libname=`eval "\\$ECHO \"$libname_spec\""`
6772
 
            # use dlname if we got it. it's perfectly good, no?
6773
 
            if test -n "$dlname"; then
6774
 
              soname="$dlname"
6775
 
            elif test -n "$soname_spec"; then
6776
 
              # bleh windows
6777
 
              case $host in
6778
 
              *cygwin* | mingw* | *cegcc*)
6779
 
                func_arith $current - $age
6780
 
                major=$func_arith_result
6781
 
                versuffix="-$major"
6782
 
                ;;
6783
 
              esac
6784
 
              eval soname=\"$soname_spec\"
6785
 
            else
6786
 
              soname="$realname"
6787
 
            fi
6788
 
 
6789
 
            # Make a new name for the extract_expsyms_cmds to use
6790
 
            soroot="$soname"
6791
 
            func_basename "$soroot"
6792
 
            soname="$func_basename_result"
6793
 
            func_stripname 'lib' '.dll' "$soname"
6794
 
            newlib=libimp-$func_stripname_result.a
6795
 
 
6796
 
            # If the library has no export list, then create one now
6797
 
            if test -f "$output_objdir/$soname-def"; then :
6798
 
            else
6799
 
              func_verbose "extracting exported symbol list from \`$soname'"
6800
 
              func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
6801
 
            fi
6802
 
 
6803
 
            # Create $newlib
6804
 
            if test -f "$output_objdir/$newlib"; then :; else
6805
 
              func_verbose "generating import library for \`$soname'"
6806
 
              func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
6807
 
            fi
6808
 
            # make sure the library variables are pointing to the new library
6809
 
            dir=$output_objdir
6810
 
            linklib=$newlib
6811
 
          fi # test -n "$old_archive_from_expsyms_cmds"
6812
 
 
6813
 
          if test "$linkmode" = prog || test "$opt_mode" != relink; then
6814
 
            add_shlibpath=
6815
 
            add_dir=
6816
 
            add=
6817
 
            lib_linked=yes
6818
 
            case $hardcode_action in
6819
 
            immediate | unsupported)
6820
 
              if test "$hardcode_direct" = no; then
6821
 
                add="$dir/$linklib"
6822
 
                case $host in
6823
 
                  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
6824
 
                  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
6825
 
                  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
6826
 
                    *-*-unixware7*) add_dir="-L$dir" ;;
6827
 
                  *-*-darwin* )
6828
 
                    # if the lib is a (non-dlopened) module then we can not
6829
 
                    # link against it, someone is ignoring the earlier warnings
6830
 
                    if /usr/bin/file -L $add 2> /dev/null |
6831
 
                         $GREP ": [^:]* bundle" >/dev/null ; then
6832
 
                      if test "X$dlopenmodule" != "X$lib"; then
6833
 
                        $ECHO "*** Warning: lib $linklib is a module, not a shared library"
6834
 
                        if test -z "$old_library" ; then
6835
 
                          echo
6836
 
                          echo "*** And there doesn't seem to be a static archive available"
6837
 
                          echo "*** The link will probably fail, sorry"
6838
 
                        else
6839
 
                          add="$dir/$old_library"
6840
 
                        fi
6841
 
                      elif test -n "$old_library"; then
6842
 
                        add="$dir/$old_library"
6843
 
                      fi
6844
 
                    fi
6845
 
                esac
6846
 
              elif test "$hardcode_minus_L" = no; then
6847
 
                case $host in
6848
 
                *-*-sunos*) add_shlibpath="$dir" ;;
6849
 
                esac
6850
 
                add_dir="-L$dir"
6851
 
                add="-l$name"
6852
 
              elif test "$hardcode_shlibpath_var" = no; then
6853
 
                add_shlibpath="$dir"
6854
 
                add="-l$name"
6855
 
              else
6856
 
                lib_linked=no
6857
 
              fi
6858
 
              ;;
6859
 
            relink)
6860
 
              if test "$hardcode_direct" = yes &&
6861
 
                 test "$hardcode_direct_absolute" = no; then
6862
 
                add="$dir/$linklib"
6863
 
              elif test "$hardcode_minus_L" = yes; then
6864
 
                add_dir="-L$absdir"
6865
 
                # Try looking first in the location we're being installed to.
6866
 
                if test -n "$inst_prefix_dir"; then
6867
 
                  case $libdir in
6868
 
                    [\\/]*)
6869
 
                      func_append add_dir " -L$inst_prefix_dir$libdir"
6870
 
                      ;;
6871
 
                  esac
6872
 
                fi
6873
 
                add="-l$name"
6874
 
              elif test "$hardcode_shlibpath_var" = yes; then
6875
 
                add_shlibpath="$dir"
6876
 
                add="-l$name"
6877
 
              else
6878
 
                lib_linked=no
6879
 
              fi
6880
 
              ;;
6881
 
            *) lib_linked=no ;;
6882
 
            esac
6883
 
 
6884
 
            if test "$lib_linked" != yes; then
6885
 
              func_fatal_configuration "unsupported hardcode properties"
6886
 
            fi
6887
 
 
6888
 
            if test -n "$add_shlibpath"; then
6889
 
              case :$compile_shlibpath: in
6890
 
              *":$add_shlibpath:"*) ;;
6891
 
              *) func_append compile_shlibpath "$add_shlibpath:" ;;
6892
 
              esac
6893
 
            fi
6894
 
            if test "$linkmode" = prog; then
6895
 
              test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
6896
 
              test -n "$add" && compile_deplibs="$add $compile_deplibs"
6897
 
            else
6898
 
              test -n "$add_dir" && deplibs="$add_dir $deplibs"
6899
 
              test -n "$add" && deplibs="$add $deplibs"
6900
 
              if test "$hardcode_direct" != yes &&
6901
 
                 test "$hardcode_minus_L" != yes &&
6902
 
                 test "$hardcode_shlibpath_var" = yes; then
6903
 
                case :$finalize_shlibpath: in
6904
 
                *":$libdir:"*) ;;
6905
 
                *) func_append finalize_shlibpath "$libdir:" ;;
6906
 
                esac
6907
 
              fi
6908
 
            fi
6909
 
          fi
6910
 
 
6911
 
          if test "$linkmode" = prog || test "$opt_mode" = relink; then
6912
 
            add_shlibpath=
6913
 
            add_dir=
6914
 
            add=
6915
 
            # Finalize command for both is simple: just hardcode it.
6916
 
            if test "$hardcode_direct" = yes &&
6917
 
               test "$hardcode_direct_absolute" = no; then
6918
 
              add="$libdir/$linklib"
6919
 
            elif test "$hardcode_minus_L" = yes; then
6920
 
              add_dir="-L$libdir"
6921
 
              add="-l$name"
6922
 
            elif test "$hardcode_shlibpath_var" = yes; then
6923
 
              case :$finalize_shlibpath: in
6924
 
              *":$libdir:"*) ;;
6925
 
              *) func_append finalize_shlibpath "$libdir:" ;;
6926
 
              esac
6927
 
              add="-l$name"
6928
 
            elif test "$hardcode_automatic" = yes; then
6929
 
              if test -n "$inst_prefix_dir" &&
6930
 
                 test -f "$inst_prefix_dir$libdir/$linklib" ; then
6931
 
                add="$inst_prefix_dir$libdir/$linklib"
6932
 
              else
6933
 
                add="$libdir/$linklib"
6934
 
              fi
6935
 
            else
6936
 
              # We cannot seem to hardcode it, guess we'll fake it.
6937
 
              add_dir="-L$libdir"
6938
 
              # Try looking first in the location we're being installed to.
6939
 
              if test -n "$inst_prefix_dir"; then
6940
 
                case $libdir in
6941
 
                  [\\/]*)
6942
 
                    func_append add_dir " -L$inst_prefix_dir$libdir"
6943
 
                    ;;
6944
 
                esac
6945
 
              fi
6946
 
              add="-l$name"
6947
 
            fi
6948
 
 
6949
 
            if test "$linkmode" = prog; then
6950
 
              test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
6951
 
              test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
6952
 
            else
6953
 
              test -n "$add_dir" && deplibs="$add_dir $deplibs"
6954
 
              test -n "$add" && deplibs="$add $deplibs"
6955
 
            fi
6956
 
          fi
6957
 
        elif test "$linkmode" = prog; then
6958
 
          # Here we assume that one of hardcode_direct or hardcode_minus_L
6959
 
          # is not unsupported.  This is valid on all known static and
6960
 
          # shared platforms.
6961
 
          if test "$hardcode_direct" != unsupported; then
6962
 
            test -n "$old_library" && linklib="$old_library"
6963
 
            compile_deplibs="$dir/$linklib $compile_deplibs"
6964
 
            finalize_deplibs="$dir/$linklib $finalize_deplibs"
6965
 
          else
6966
 
            compile_deplibs="-l$name -L$dir $compile_deplibs"
6967
 
            finalize_deplibs="-l$name -L$dir $finalize_deplibs"
6968
 
          fi
6969
 
        elif test "$build_libtool_libs" = yes; then
6970
 
          # Not a shared library
6971
 
          if test "$deplibs_check_method" != pass_all; then
6972
 
            # We're trying link a shared library against a static one
6973
 
            # but the system doesn't support it.
6974
 
 
6975
 
            # Just print a warning and add the library to dependency_libs so
6976
 
            # that the program can be linked against the static library.
6977
 
            echo
6978
 
            $ECHO "*** Warning: This system can not link to static lib archive $lib."
6979
 
            echo "*** I have the capability to make that library automatically link in when"
6980
 
            echo "*** you link to this library.  But I can only do this if you have a"
6981
 
            echo "*** shared version of the library, which you do not appear to have."
6982
 
            if test "$module" = yes; then
6983
 
              echo "*** But as you try to build a module library, libtool will still create "
6984
 
              echo "*** a static module, that should work as long as the dlopening application"
6985
 
              echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
6986
 
              if test -z "$global_symbol_pipe"; then
6987
 
                echo
6988
 
                echo "*** However, this would only work if libtool was able to extract symbol"
6989
 
                echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
6990
 
                echo "*** not find such a program.  So, this module is probably useless."
6991
 
                echo "*** \`nm' from GNU binutils and a full rebuild may help."
6992
 
              fi
6993
 
              if test "$build_old_libs" = no; then
6994
 
                build_libtool_libs=module
6995
 
                build_old_libs=yes
6996
 
              else
6997
 
                build_libtool_libs=no
6998
 
              fi
6999
 
            fi
7000
 
          else
7001
 
            deplibs="$dir/$old_library $deplibs"
7002
 
            link_static=yes
7003
 
          fi
7004
 
        fi # link shared/static library?
7005
 
 
7006
 
        if test "$linkmode" = lib; then
7007
 
          if test -n "$dependency_libs" &&
7008
 
             { test "$hardcode_into_libs" != yes ||
7009
 
               test "$build_old_libs" = yes ||
7010
 
               test "$link_static" = yes; }; then
7011
 
            # Extract -R from dependency_libs
7012
 
            temp_deplibs=
7013
 
            for libdir in $dependency_libs; do
7014
 
              case $libdir in
7015
 
              -R*) func_stripname '-R' '' "$libdir"
7016
 
                   temp_xrpath=$func_stripname_result
7017
 
                   case " $xrpath " in
7018
 
                   *" $temp_xrpath "*) ;;
7019
 
                   *) func_append xrpath " $temp_xrpath";;
7020
 
                   esac;;
7021
 
              *) func_append temp_deplibs " $libdir";;
7022
 
              esac
7023
 
            done
7024
 
            dependency_libs="$temp_deplibs"
7025
 
          fi
7026
 
 
7027
 
          func_append newlib_search_path " $absdir"
7028
 
          # Link against this library
7029
 
          test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7030
 
          # ... and its dependency_libs
7031
 
          tmp_libs=
7032
 
          for deplib in $dependency_libs; do
7033
 
            newdependency_libs="$deplib $newdependency_libs"
7034
 
            case $deplib in
7035
 
              -L*) func_stripname '-L' '' "$deplib"
7036
 
                   func_resolve_sysroot "$func_stripname_result";;
7037
 
              *) func_resolve_sysroot "$deplib" ;;
7038
 
            esac
7039
 
            if $opt_preserve_dup_deps ; then
7040
 
              case "$tmp_libs " in
7041
 
              *" $func_resolve_sysroot_result "*)
7042
 
                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
7043
 
              esac
7044
 
            fi
7045
 
            func_append tmp_libs " $func_resolve_sysroot_result"
7046
 
          done
7047
 
 
7048
 
          if test "$link_all_deplibs" != no; then
7049
 
            # Add the search paths of all dependency libraries
7050
 
            for deplib in $dependency_libs; do
7051
 
              path=
7052
 
              case $deplib in
7053
 
              -L*) path="$deplib" ;;
7054
 
              *.la)
7055
 
                func_resolve_sysroot "$deplib"
7056
 
                deplib=$func_resolve_sysroot_result
7057
 
                func_dirname "$deplib" "" "."
7058
 
                dir=$func_dirname_result
7059
 
                # We need an absolute path.
7060
 
                case $dir in
7061
 
                [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
7062
 
                *)
7063
 
                  absdir=`cd "$dir" && pwd`
7064
 
                  if test -z "$absdir"; then
7065
 
                    func_warning "cannot determine absolute directory name of \`$dir'"
7066
 
                    absdir="$dir"
7067
 
                  fi
7068
 
                  ;;
7069
 
                esac
7070
 
                if $GREP "^installed=no" $deplib > /dev/null; then
7071
 
                case $host in
7072
 
                *-*-darwin*)
7073
 
                  depdepl=
7074
 
                  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7075
 
                  if test -n "$deplibrary_names" ; then
7076
 
                    for tmp in $deplibrary_names ; do
7077
 
                      depdepl=$tmp
7078
 
                    done
7079
 
                    if test -f "$absdir/$objdir/$depdepl" ; then
7080
 
                      depdepl="$absdir/$objdir/$depdepl"
7081
 
                      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7082
 
                      if test -z "$darwin_install_name"; then
7083
 
                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
7084
 
                      fi
7085
 
                      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7086
 
                      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
7087
 
                      path=
7088
 
                    fi
7089
 
                  fi
7090
 
                  ;;
7091
 
                *)
7092
 
                  path="-L$absdir/$objdir"
7093
 
                  ;;
7094
 
                esac
7095
 
                else
7096
 
                  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7097
 
                  test -z "$libdir" && \
7098
 
                    func_fatal_error "\`$deplib' is not a valid libtool archive"
7099
 
                  test "$absdir" != "$libdir" && \
7100
 
                    func_warning "\`$deplib' seems to be moved"
7101
 
 
7102
 
                  path="-L$absdir"
7103
 
                fi
7104
 
                ;;
7105
 
              esac
7106
 
              case " $deplibs " in
7107
 
              *" $path "*) ;;
7108
 
              *) deplibs="$path $deplibs" ;;
7109
 
              esac
7110
 
            done
7111
 
          fi # link_all_deplibs != no
7112
 
        fi # linkmode = lib
7113
 
      done # for deplib in $libs
7114
 
      if test "$pass" = link; then
7115
 
        if test "$linkmode" = "prog"; then
7116
 
          compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
7117
 
          finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
7118
 
        else
7119
 
          compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7120
 
        fi
7121
 
      fi
7122
 
      dependency_libs="$newdependency_libs"
7123
 
      if test "$pass" = dlpreopen; then
7124
 
        # Link the dlpreopened libraries before other libraries
7125
 
        for deplib in $save_deplibs; do
7126
 
          deplibs="$deplib $deplibs"
7127
 
        done
7128
 
      fi
7129
 
      if test "$pass" != dlopen; then
7130
 
        if test "$pass" != conv; then
7131
 
          # Make sure lib_search_path contains only unique directories.
7132
 
          lib_search_path=
7133
 
          for dir in $newlib_search_path; do
7134
 
            case "$lib_search_path " in
7135
 
            *" $dir "*) ;;
7136
 
            *) func_append lib_search_path " $dir" ;;
7137
 
            esac
7138
 
          done
7139
 
          newlib_search_path=
7140
 
        fi
7141
 
 
7142
 
        if test "$linkmode,$pass" != "prog,link"; then
7143
 
          vars="deplibs"
7144
 
        else
7145
 
          vars="compile_deplibs finalize_deplibs"
7146
 
        fi
7147
 
        for var in $vars dependency_libs; do
7148
 
          # Add libraries to $var in reverse order
7149
 
          eval tmp_libs=\"\$$var\"
7150
 
          new_libs=
7151
 
          for deplib in $tmp_libs; do
7152
 
            # FIXME: Pedantically, this is the right thing to do, so
7153
 
            #        that some nasty dependency loop isn't accidentally
7154
 
            #        broken:
7155
 
            #new_libs="$deplib $new_libs"
7156
 
            # Pragmatically, this seems to cause very few problems in
7157
 
            # practice:
7158
 
            case $deplib in
7159
 
            -L*) new_libs="$deplib $new_libs" ;;
7160
 
            -R*) ;;
7161
 
            *)
7162
 
              # And here is the reason: when a library appears more
7163
 
              # than once as an explicit dependence of a library, or
7164
 
              # is implicitly linked in more than once by the
7165
 
              # compiler, it is considered special, and multiple
7166
 
              # occurrences thereof are not removed.  Compare this
7167
 
              # with having the same library being listed as a
7168
 
              # dependency of multiple other libraries: in this case,
7169
 
              # we know (pedantically, we assume) the library does not
7170
 
              # need to be listed more than once, so we keep only the
7171
 
              # last copy.  This is not always right, but it is rare
7172
 
              # enough that we require users that really mean to play
7173
 
              # such unportable linking tricks to link the library
7174
 
              # using -Wl,-lname, so that libtool does not consider it
7175
 
              # for duplicate removal.
7176
 
              case " $specialdeplibs " in
7177
 
              *" $deplib "*) new_libs="$deplib $new_libs" ;;
7178
 
              *)
7179
 
                case " $new_libs " in
7180
 
                *" $deplib "*) ;;
7181
 
                *) new_libs="$deplib $new_libs" ;;
7182
 
                esac
7183
 
                ;;
7184
 
              esac
7185
 
              ;;
7186
 
            esac
7187
 
          done
7188
 
          tmp_libs=
7189
 
          for deplib in $new_libs; do
7190
 
            case $deplib in
7191
 
            -L*)
7192
 
              case " $tmp_libs " in
7193
 
              *" $deplib "*) ;;
7194
 
              *) func_append tmp_libs " $deplib" ;;
7195
 
              esac
7196
 
              ;;
7197
 
            *) func_append tmp_libs " $deplib" ;;
7198
 
            esac
7199
 
          done
7200
 
          eval $var=\"$tmp_libs\"
7201
 
        done # for var
7202
 
      fi
7203
 
      # Last step: remove runtime libs from dependency_libs
7204
 
      # (they stay in deplibs)
7205
 
      tmp_libs=
7206
 
      for i in $dependency_libs ; do
7207
 
        case " $predeps $postdeps $compiler_lib_search_path " in
7208
 
        *" $i "*)
7209
 
          i=""
7210
 
          ;;
7211
 
        esac
7212
 
        if test -n "$i" ; then
7213
 
          func_append tmp_libs " $i"
7214
 
        fi
7215
 
      done
7216
 
      dependency_libs=$tmp_libs
7217
 
    done # for pass
7218
 
    if test "$linkmode" = prog; then
7219
 
      dlfiles="$newdlfiles"
7220
 
    fi
7221
 
    if test "$linkmode" = prog || test "$linkmode" = lib; then
7222
 
      dlprefiles="$newdlprefiles"
7223
 
    fi
7224
 
 
7225
 
    case $linkmode in
7226
 
    oldlib)
7227
 
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7228
 
        func_warning "\`-dlopen' is ignored for archives"
7229
 
      fi
7230
 
 
7231
 
      case " $deplibs" in
7232
 
      *\ -l* | *\ -L*)
7233
 
        func_warning "\`-l' and \`-L' are ignored for archives" ;;
7234
 
      esac
7235
 
 
7236
 
      test -n "$rpath" && \
7237
 
        func_warning "\`-rpath' is ignored for archives"
7238
 
 
7239
 
      test -n "$xrpath" && \
7240
 
        func_warning "\`-R' is ignored for archives"
7241
 
 
7242
 
      test -n "$vinfo" && \
7243
 
        func_warning "\`-version-info/-version-number' is ignored for archives"
7244
 
 
7245
 
      test -n "$release" && \
7246
 
        func_warning "\`-release' is ignored for archives"
7247
 
 
7248
 
      test -n "$export_symbols$export_symbols_regex" && \
7249
 
        func_warning "\`-export-symbols' is ignored for archives"
7250
 
 
7251
 
      # Now set the variables for building old libraries.
7252
 
      build_libtool_libs=no
7253
 
      oldlibs="$output"
7254
 
      func_append objs "$old_deplibs"
7255
 
      ;;
7256
 
 
7257
 
    lib)
7258
 
      # Make sure we only generate libraries of the form `libNAME.la'.
7259
 
      case $outputname in
7260
 
      lib*)
7261
 
        func_stripname 'lib' '.la' "$outputname"
7262
 
        name=$func_stripname_result
7263
 
        eval shared_ext=\"$shrext_cmds\"
7264
 
        eval libname=\"$libname_spec\"
7265
 
        ;;
7266
 
      *)
7267
 
        test "$module" = no && \
7268
 
          func_fatal_help "libtool library \`$output' must begin with \`lib'"
7269
 
 
7270
 
        if test "$need_lib_prefix" != no; then
7271
 
          # Add the "lib" prefix for modules if required
7272
 
          func_stripname '' '.la' "$outputname"
7273
 
          name=$func_stripname_result
7274
 
          eval shared_ext=\"$shrext_cmds\"
7275
 
          eval libname=\"$libname_spec\"
7276
 
        else
7277
 
          func_stripname '' '.la' "$outputname"
7278
 
          libname=$func_stripname_result
7279
 
        fi
7280
 
        ;;
7281
 
      esac
7282
 
 
7283
 
      if test -n "$objs"; then
7284
 
        if test "$deplibs_check_method" != pass_all; then
7285
 
          func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
7286
 
        else
7287
 
          echo
7288
 
          $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
7289
 
          $ECHO "*** objects $objs is not portable!"
7290
 
          func_append libobjs " $objs"
7291
 
        fi
7292
 
      fi
7293
 
 
7294
 
      test "$dlself" != no && \
7295
 
        func_warning "\`-dlopen self' is ignored for libtool libraries"
7296
 
 
7297
 
      set dummy $rpath
7298
 
      shift
7299
 
      test "$#" -gt 1 && \
7300
 
        func_warning "ignoring multiple \`-rpath's for a libtool library"
7301
 
 
7302
 
      install_libdir="$1"
7303
 
 
7304
 
      oldlibs=
7305
 
      if test -z "$rpath"; then
7306
 
        if test "$build_libtool_libs" = yes; then
7307
 
          # Building a libtool convenience library.
7308
 
          # Some compilers have problems with a `.al' extension so
7309
 
          # convenience libraries should have the same extension an
7310
 
          # archive normally would.
7311
 
          oldlibs="$output_objdir/$libname.$libext $oldlibs"
7312
 
          build_libtool_libs=convenience
7313
 
          build_old_libs=yes
7314
 
        fi
7315
 
 
7316
 
        test -n "$vinfo" && \
7317
 
          func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
7318
 
 
7319
 
        test -n "$release" && \
7320
 
          func_warning "\`-release' is ignored for convenience libraries"
7321
 
      else
7322
 
 
7323
 
        # Parse the version information argument.
7324
 
        save_ifs="$IFS"; IFS=':'
7325
 
        set dummy $vinfo 0 0 0
7326
 
        shift
7327
 
        IFS="$save_ifs"
7328
 
 
7329
 
        test -n "$7" && \
7330
 
          func_fatal_help "too many parameters to \`-version-info'"
7331
 
 
7332
 
        # convert absolute version numbers to libtool ages
7333
 
        # this retains compatibility with .la files and attempts
7334
 
        # to make the code below a bit more comprehensible
7335
 
 
7336
 
        case $vinfo_number in
7337
 
        yes)
7338
 
          number_major="$1"
7339
 
          number_minor="$2"
7340
 
          number_revision="$3"
7341
 
          #
7342
 
          # There are really only two kinds -- those that
7343
 
          # use the current revision as the major version
7344
 
          # and those that subtract age and use age as
7345
 
          # a minor version.  But, then there is irix
7346
 
          # which has an extra 1 added just for fun
7347
 
          #
7348
 
          case $version_type in
7349
 
          # correct linux to gnu/linux during the next big refactor
7350
 
          darwin|linux|osf|windows|none)
7351
 
            func_arith $number_major + $number_minor
7352
 
            current=$func_arith_result
7353
 
            age="$number_minor"
7354
 
            revision="$number_revision"
7355
 
            ;;
7356
 
          freebsd-aout|freebsd-elf|qnx|sunos)
7357
 
            current="$number_major"
7358
 
            revision="$number_minor"
7359
 
            age="0"
7360
 
            ;;
7361
 
          irix|nonstopux)
7362
 
            func_arith $number_major + $number_minor
7363
 
            current=$func_arith_result
7364
 
            age="$number_minor"
7365
 
            revision="$number_minor"
7366
 
            lt_irix_increment=no
7367
 
            ;;
7368
 
          esac
7369
 
          ;;
7370
 
        no)
7371
 
          current="$1"
7372
 
          revision="$2"
7373
 
          age="$3"
7374
 
          ;;
7375
 
        esac
7376
 
 
7377
 
        # Check that each of the things are valid numbers.
7378
 
        case $current 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]) ;;
7380
 
        *)
7381
 
          func_error "CURRENT \`$current' must be a nonnegative integer"
7382
 
          func_fatal_error "\`$vinfo' is not valid version information"
7383
 
          ;;
7384
 
        esac
7385
 
 
7386
 
        case $revision in
7387
 
        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]) ;;
7388
 
        *)
7389
 
          func_error "REVISION \`$revision' must be a nonnegative integer"
7390
 
          func_fatal_error "\`$vinfo' is not valid version information"
7391
 
          ;;
7392
 
        esac
7393
 
 
7394
 
        case $age in
7395
 
        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]) ;;
7396
 
        *)
7397
 
          func_error "AGE \`$age' must be a nonnegative integer"
7398
 
          func_fatal_error "\`$vinfo' is not valid version information"
7399
 
          ;;
7400
 
        esac
7401
 
 
7402
 
        if test "$age" -gt "$current"; then
7403
 
          func_error "AGE \`$age' is greater than the current interface number \`$current'"
7404
 
          func_fatal_error "\`$vinfo' is not valid version information"
7405
 
        fi
7406
 
 
7407
 
        # Calculate the version variables.
7408
 
        major=
7409
 
        versuffix=
7410
 
        verstring=
7411
 
        case $version_type in
7412
 
        none) ;;
7413
 
 
7414
 
        darwin)
7415
 
          # Like Linux, but with the current version available in
7416
 
          # verstring for coding it into the library header
7417
 
          func_arith $current - $age
7418
 
          major=.$func_arith_result
7419
 
          versuffix="$major.$age.$revision"
7420
 
          # Darwin ld doesn't like 0 for these options...
7421
 
          func_arith $current + 1
7422
 
          minor_current=$func_arith_result
7423
 
          xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
7424
 
          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
7425
 
          ;;
7426
 
 
7427
 
        freebsd-aout)
7428
 
          major=".$current"
7429
 
          versuffix=".$current.$revision";
7430
 
          ;;
7431
 
 
7432
 
        freebsd-elf)
7433
 
          major=".$current"
7434
 
          versuffix=".$current"
7435
 
          ;;
7436
 
 
7437
 
        irix | nonstopux)
7438
 
          if test "X$lt_irix_increment" = "Xno"; then
7439
 
            func_arith $current - $age
7440
 
          else
7441
 
            func_arith $current - $age + 1
7442
 
          fi
7443
 
          major=$func_arith_result
7444
 
 
7445
 
          case $version_type in
7446
 
            nonstopux) verstring_prefix=nonstopux ;;
7447
 
            *)         verstring_prefix=sgi ;;
7448
 
          esac
7449
 
          verstring="$verstring_prefix$major.$revision"
7450
 
 
7451
 
          # Add in all the interfaces that we are compatible with.
7452
 
          loop=$revision
7453
 
          while test "$loop" -ne 0; do
7454
 
            func_arith $revision - $loop
7455
 
            iface=$func_arith_result
7456
 
            func_arith $loop - 1
7457
 
            loop=$func_arith_result
7458
 
            verstring="$verstring_prefix$major.$iface:$verstring"
7459
 
          done
7460
 
 
7461
 
          # Before this point, $major must not contain `.'.
7462
 
          major=.$major
7463
 
          versuffix="$major.$revision"
7464
 
          ;;
7465
 
 
7466
 
        linux) # correct to gnu/linux during the next big refactor
7467
 
          func_arith $current - $age
7468
 
          major=.$func_arith_result
7469
 
          versuffix="$major.$age.$revision"
7470
 
          ;;
7471
 
 
7472
 
        osf)
7473
 
          func_arith $current - $age
7474
 
          major=.$func_arith_result
7475
 
          versuffix=".$current.$age.$revision"
7476
 
          verstring="$current.$age.$revision"
7477
 
 
7478
 
          # Add in all the interfaces that we are compatible with.
7479
 
          loop=$age
7480
 
          while test "$loop" -ne 0; do
7481
 
            func_arith $current - $loop
7482
 
            iface=$func_arith_result
7483
 
            func_arith $loop - 1
7484
 
            loop=$func_arith_result
7485
 
            verstring="$verstring:${iface}.0"
7486
 
          done
7487
 
 
7488
 
          # Make executables depend on our current version.
7489
 
          func_append verstring ":${current}.0"
7490
 
          ;;
7491
 
 
7492
 
        qnx)
7493
 
          major=".$current"
7494
 
          versuffix=".$current"
7495
 
          ;;
7496
 
 
7497
 
        sunos)
7498
 
          major=".$current"
7499
 
          versuffix=".$current.$revision"
7500
 
          ;;
7501
 
 
7502
 
        windows)
7503
 
          # Use '-' rather than '.', since we only want one
7504
 
          # extension on DOS 8.3 filesystems.
7505
 
          func_arith $current - $age
7506
 
          major=$func_arith_result
7507
 
          versuffix="-$major"
7508
 
          ;;
7509
 
 
7510
 
        *)
7511
 
          func_fatal_configuration "unknown library version type \`$version_type'"
7512
 
          ;;
7513
 
        esac
7514
 
 
7515
 
        # Clear the version info if we defaulted, and they specified a release.
7516
 
        if test -z "$vinfo" && test -n "$release"; then
7517
 
          major=
7518
 
          case $version_type in
7519
 
          darwin)
7520
 
            # we can't check for "0.0" in archive_cmds due to quoting
7521
 
            # problems, so we reset it completely
7522
 
            verstring=
7523
 
            ;;
7524
 
          *)
7525
 
            verstring="0.0"
7526
 
            ;;
7527
 
          esac
7528
 
          if test "$need_version" = no; then
7529
 
            versuffix=
7530
 
          else
7531
 
            versuffix=".0.0"
7532
 
          fi
7533
 
        fi
7534
 
 
7535
 
        # Remove version info from name if versioning should be avoided
7536
 
        if test "$avoid_version" = yes && test "$need_version" = no; then
7537
 
          major=
7538
 
          versuffix=
7539
 
          verstring=""
7540
 
        fi
7541
 
 
7542
 
        # Check to see if the archive will have undefined symbols.
7543
 
        if test "$allow_undefined" = yes; then
7544
 
          if test "$allow_undefined_flag" = unsupported; then
7545
 
            func_warning "undefined symbols not allowed in $host shared libraries"
7546
 
            build_libtool_libs=no
7547
 
            build_old_libs=yes
7548
 
          fi
7549
 
        else
7550
 
          # Don't allow undefined symbols.
7551
 
          allow_undefined_flag="$no_undefined_flag"
7552
 
        fi
7553
 
 
7554
 
      fi
7555
 
 
7556
 
      func_generate_dlsyms "$libname" "$libname" "yes"
7557
 
      func_append libobjs " $symfileobj"
7558
 
      test "X$libobjs" = "X " && libobjs=
7559
 
 
7560
 
      if test "$opt_mode" != relink; then
7561
 
        # Remove our outputs, but don't remove object files since they
7562
 
        # may have been created when compiling PIC objects.
7563
 
        removelist=
7564
 
        tempremovelist=`$ECHO "$output_objdir/*"`
7565
 
        for p in $tempremovelist; do
7566
 
          case $p in
7567
 
            *.$objext | *.gcno)
7568
 
               ;;
7569
 
            $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7570
 
               if test "X$precious_files_regex" != "X"; then
7571
 
                 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
7572
 
                 then
7573
 
                   continue
7574
 
                 fi
7575
 
               fi
7576
 
               func_append removelist " $p"
7577
 
               ;;
7578
 
            *) ;;
7579
 
          esac
7580
 
        done
7581
 
        test -n "$removelist" && \
7582
 
          func_show_eval "${RM}r \$removelist"
7583
 
      fi
7584
 
 
7585
 
      # Now set the variables for building old libraries.
7586
 
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
7587
 
        func_append oldlibs " $output_objdir/$libname.$libext"
7588
 
 
7589
 
        # Transform .lo files to .o files.
7590
 
        oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
7591
 
      fi
7592
 
 
7593
 
      # Eliminate all temporary directories.
7594
 
      #for path in $notinst_path; do
7595
 
      # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
7596
 
      # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
7597
 
      # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
7598
 
      #done
7599
 
 
7600
 
      if test -n "$xrpath"; then
7601
 
        # If the user specified any rpath flags, then add them.
7602
 
        temp_xrpath=
7603
 
        for libdir in $xrpath; do
7604
 
          func_replace_sysroot "$libdir"
7605
 
          func_append temp_xrpath " -R$func_replace_sysroot_result"
7606
 
          case "$finalize_rpath " in
7607
 
          *" $libdir "*) ;;
7608
 
          *) func_append finalize_rpath " $libdir" ;;
7609
 
          esac
7610
 
        done
7611
 
        if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
7612
 
          dependency_libs="$temp_xrpath $dependency_libs"
7613
 
        fi
7614
 
      fi
7615
 
 
7616
 
      # Make sure dlfiles contains only unique files that won't be dlpreopened
7617
 
      old_dlfiles="$dlfiles"
7618
 
      dlfiles=
7619
 
      for lib in $old_dlfiles; do
7620
 
        case " $dlprefiles $dlfiles " in
7621
 
        *" $lib "*) ;;
7622
 
        *) func_append dlfiles " $lib" ;;
7623
 
        esac
7624
 
      done
7625
 
 
7626
 
      # Make sure dlprefiles contains only unique files
7627
 
      old_dlprefiles="$dlprefiles"
7628
 
      dlprefiles=
7629
 
      for lib in $old_dlprefiles; do
7630
 
        case "$dlprefiles " in
7631
 
        *" $lib "*) ;;
7632
 
        *) func_append dlprefiles " $lib" ;;
7633
 
        esac
7634
 
      done
7635
 
 
7636
 
      if test "$build_libtool_libs" = yes; then
7637
 
        if test -n "$rpath"; then
7638
 
          case $host in
7639
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
7640
 
            # these systems don't actually have a c library (as such)!
7641
 
            ;;
7642
 
          *-*-rhapsody* | *-*-darwin1.[012])
7643
 
            # Rhapsody C library is in the System framework
7644
 
            func_append deplibs " System.ltframework"
7645
 
            ;;
7646
 
          *-*-netbsd*)
7647
 
            # Don't link with libc until the a.out ld.so is fixed.
7648
 
            ;;
7649
 
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7650
 
            # Do not include libc due to us having libc/libc_r.
7651
 
            ;;
7652
 
          *-*-sco3.2v5* | *-*-sco5v6*)
7653
 
            # Causes problems with __ctype
7654
 
            ;;
7655
 
          *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7656
 
            # Compiler inserts libc in the correct place for threads to work
7657
 
            ;;
7658
 
          *)
7659
 
            # Add libc to deplibs on all other systems if necessary.
7660
 
            if test "$build_libtool_need_lc" = "yes"; then
7661
 
              func_append deplibs " -lc"
7662
 
            fi
7663
 
            ;;
7664
 
          esac
7665
 
        fi
7666
 
 
7667
 
        # Transform deplibs into only deplibs that can be linked in shared.
7668
 
        name_save=$name
7669
 
        libname_save=$libname
7670
 
        release_save=$release
7671
 
        versuffix_save=$versuffix
7672
 
        major_save=$major
7673
 
        # I'm not sure if I'm treating the release correctly.  I think
7674
 
        # release should show up in the -l (ie -lgmp5) so we don't want to
7675
 
        # add it in twice.  Is that correct?
7676
 
        release=""
7677
 
        versuffix=""
7678
 
        major=""
7679
 
        newdeplibs=
7680
 
        droppeddeps=no
7681
 
        case $deplibs_check_method in
7682
 
        pass_all)
7683
 
          # Don't check for shared/static.  Everything works.
7684
 
          # This might be a little naive.  We might want to check
7685
 
          # whether the library exists or not.  But this is on
7686
 
          # osf3 & osf4 and I'm not really sure... Just
7687
 
          # implementing what was already the behavior.
7688
 
          newdeplibs=$deplibs
7689
 
          ;;
7690
 
        test_compile)
7691
 
          # This code stresses the "libraries are programs" paradigm to its
7692
 
          # limits. Maybe even breaks it.  We compile a program, linking it
7693
 
          # against the deplibs as a proxy for the library.  Then we can check
7694
 
          # whether they linked in statically or dynamically with ldd.
7695
 
          $opt_dry_run || $RM conftest.c
7696
 
          cat > conftest.c <<EOF
7697
 
          int main() { return 0; }
7698
 
EOF
7699
 
          $opt_dry_run || $RM conftest
7700
 
          if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
7701
 
            ldd_output=`ldd conftest`
7702
 
            for i in $deplibs; do
7703
 
              case $i in
7704
 
              -l*)
7705
 
                func_stripname -l '' "$i"
7706
 
                name=$func_stripname_result
7707
 
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7708
 
                  case " $predeps $postdeps " in
7709
 
                  *" $i "*)
7710
 
                    func_append newdeplibs " $i"
7711
 
                    i=""
7712
 
                    ;;
7713
 
                  esac
7714
 
                fi
7715
 
                if test -n "$i" ; then
7716
 
                  libname=`eval "\\$ECHO \"$libname_spec\""`
7717
 
                  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7718
 
                  set dummy $deplib_matches; shift
7719
 
                  deplib_match=$1
7720
 
                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7721
 
                    func_append newdeplibs " $i"
7722
 
                  else
7723
 
                    droppeddeps=yes
7724
 
                    echo
7725
 
                    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7726
 
                    echo "*** I have the capability to make that library automatically link in when"
7727
 
                    echo "*** you link to this library.  But I can only do this if you have a"
7728
 
                    echo "*** shared version of the library, which I believe you do not have"
7729
 
                    echo "*** because a test_compile did reveal that the linker did not use it for"
7730
 
                    echo "*** its dynamic dependency list that programs get resolved with at runtime."
7731
 
                  fi
7732
 
                fi
7733
 
                ;;
7734
 
              *)
7735
 
                func_append newdeplibs " $i"
7736
 
                ;;
7737
 
              esac
7738
 
            done
7739
 
          else
7740
 
            # Error occurred in the first compile.  Let's try to salvage
7741
 
            # the situation: Compile a separate program for each library.
7742
 
            for i in $deplibs; do
7743
 
              case $i in
7744
 
              -l*)
7745
 
                func_stripname -l '' "$i"
7746
 
                name=$func_stripname_result
7747
 
                $opt_dry_run || $RM conftest
7748
 
                if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
7749
 
                  ldd_output=`ldd conftest`
7750
 
                  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7751
 
                    case " $predeps $postdeps " in
7752
 
                    *" $i "*)
7753
 
                      func_append newdeplibs " $i"
7754
 
                      i=""
7755
 
                      ;;
7756
 
                    esac
7757
 
                  fi
7758
 
                  if test -n "$i" ; then
7759
 
                    libname=`eval "\\$ECHO \"$libname_spec\""`
7760
 
                    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7761
 
                    set dummy $deplib_matches; shift
7762
 
                    deplib_match=$1
7763
 
                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
7764
 
                      func_append newdeplibs " $i"
7765
 
                    else
7766
 
                      droppeddeps=yes
7767
 
                      echo
7768
 
                      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
7769
 
                      echo "*** I have the capability to make that library automatically link in when"
7770
 
                      echo "*** you link to this library.  But I can only do this if you have a"
7771
 
                      echo "*** shared version of the library, which you do not appear to have"
7772
 
                      echo "*** because a test_compile did reveal that the linker did not use this one"
7773
 
                      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
7774
 
                    fi
7775
 
                  fi
7776
 
                else
7777
 
                  droppeddeps=yes
7778
 
                  echo
7779
 
                  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
7780
 
                  echo "*** make it link in!  You will probably need to install it or some"
7781
 
                  echo "*** library that it depends on before this library will be fully"
7782
 
                  echo "*** functional.  Installing it before continuing would be even better."
7783
 
                fi
7784
 
                ;;
7785
 
              *)
7786
 
                func_append newdeplibs " $i"
7787
 
                ;;
7788
 
              esac
7789
 
            done
7790
 
          fi
7791
 
          ;;
7792
 
        file_magic*)
7793
 
          set dummy $deplibs_check_method; shift
7794
 
          file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7795
 
          for a_deplib in $deplibs; do
7796
 
            case $a_deplib in
7797
 
            -l*)
7798
 
              func_stripname -l '' "$a_deplib"
7799
 
              name=$func_stripname_result
7800
 
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7801
 
                case " $predeps $postdeps " in
7802
 
                *" $a_deplib "*)
7803
 
                  func_append newdeplibs " $a_deplib"
7804
 
                  a_deplib=""
7805
 
                  ;;
7806
 
                esac
7807
 
              fi
7808
 
              if test -n "$a_deplib" ; then
7809
 
                libname=`eval "\\$ECHO \"$libname_spec\""`
7810
 
                if test -n "$file_magic_glob"; then
7811
 
                  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
7812
 
                else
7813
 
                  libnameglob=$libname
7814
 
                fi
7815
 
                test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
7816
 
                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7817
 
                  if test "$want_nocaseglob" = yes; then
7818
 
                    shopt -s nocaseglob
7819
 
                    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7820
 
                    $nocaseglob
7821
 
                  else
7822
 
                    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7823
 
                  fi
7824
 
                  for potent_lib in $potential_libs; do
7825
 
                      # Follow soft links.
7826
 
                      if ls -lLd "$potent_lib" 2>/dev/null |
7827
 
                         $GREP " -> " >/dev/null; then
7828
 
                        continue
7829
 
                      fi
7830
 
                      # The statement above tries to avoid entering an
7831
 
                      # endless loop below, in case of cyclic links.
7832
 
                      # We might still enter an endless loop, since a link
7833
 
                      # loop can be closed while we follow links,
7834
 
                      # but so what?
7835
 
                      potlib="$potent_lib"
7836
 
                      while test -h "$potlib" 2>/dev/null; do
7837
 
                        potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
7838
 
                        case $potliblink in
7839
 
                        [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
7840
 
                        *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
7841
 
                        esac
7842
 
                      done
7843
 
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7844
 
                         $SED -e 10q |
7845
 
                         $EGREP "$file_magic_regex" > /dev/null; then
7846
 
                        func_append newdeplibs " $a_deplib"
7847
 
                        a_deplib=""
7848
 
                        break 2
7849
 
                      fi
7850
 
                  done
7851
 
                done
7852
 
              fi
7853
 
              if test -n "$a_deplib" ; then
7854
 
                droppeddeps=yes
7855
 
                echo
7856
 
                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7857
 
                echo "*** I have the capability to make that library automatically link in when"
7858
 
                echo "*** you link to this library.  But I can only do this if you have a"
7859
 
                echo "*** shared version of the library, which you do not appear to have"
7860
 
                echo "*** because I did check the linker path looking for a file starting"
7861
 
                if test -z "$potlib" ; then
7862
 
                  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
7863
 
                else
7864
 
                  $ECHO "*** with $libname and none of the candidates passed a file format test"
7865
 
                  $ECHO "*** using a file magic. Last file checked: $potlib"
7866
 
                fi
7867
 
              fi
7868
 
              ;;
7869
 
            *)
7870
 
              # Add a -L argument.
7871
 
              func_append newdeplibs " $a_deplib"
7872
 
              ;;
7873
 
            esac
7874
 
          done # Gone through all deplibs.
7875
 
          ;;
7876
 
        match_pattern*)
7877
 
          set dummy $deplibs_check_method; shift
7878
 
          match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7879
 
          for a_deplib in $deplibs; do
7880
 
            case $a_deplib in
7881
 
            -l*)
7882
 
              func_stripname -l '' "$a_deplib"
7883
 
              name=$func_stripname_result
7884
 
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7885
 
                case " $predeps $postdeps " in
7886
 
                *" $a_deplib "*)
7887
 
                  func_append newdeplibs " $a_deplib"
7888
 
                  a_deplib=""
7889
 
                  ;;
7890
 
                esac
7891
 
              fi
7892
 
              if test -n "$a_deplib" ; then
7893
 
                libname=`eval "\\$ECHO \"$libname_spec\""`
7894
 
                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7895
 
                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7896
 
                  for potent_lib in $potential_libs; do
7897
 
                    potlib="$potent_lib" # see symlink-check above in file_magic test
7898
 
                    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
7899
 
                       $EGREP "$match_pattern_regex" > /dev/null; then
7900
 
                      func_append newdeplibs " $a_deplib"
7901
 
                      a_deplib=""
7902
 
                      break 2
7903
 
                    fi
7904
 
                  done
7905
 
                done
7906
 
              fi
7907
 
              if test -n "$a_deplib" ; then
7908
 
                droppeddeps=yes
7909
 
                echo
7910
 
                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
7911
 
                echo "*** I have the capability to make that library automatically link in when"
7912
 
                echo "*** you link to this library.  But I can only do this if you have a"
7913
 
                echo "*** shared version of the library, which you do not appear to have"
7914
 
                echo "*** because I did check the linker path looking for a file starting"
7915
 
                if test -z "$potlib" ; then
7916
 
                  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
7917
 
                else
7918
 
                  $ECHO "*** with $libname and none of the candidates passed a file format test"
7919
 
                  $ECHO "*** using a regex pattern. Last file checked: $potlib"
7920
 
                fi
7921
 
              fi
7922
 
              ;;
7923
 
            *)
7924
 
              # Add a -L argument.
7925
 
              func_append newdeplibs " $a_deplib"
7926
 
              ;;
7927
 
            esac
7928
 
          done # Gone through all deplibs.
7929
 
          ;;
7930
 
        none | unknown | *)
7931
 
          newdeplibs=""
7932
 
          tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
7933
 
          if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7934
 
            for i in $predeps $postdeps ; do
7935
 
              # can't use Xsed below, because $i might contain '/'
7936
 
              tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
7937
 
            done
7938
 
          fi
7939
 
          case $tmp_deplibs in
7940
 
          *[!\  \ ]*)
7941
 
            echo
7942
 
            if test "X$deplibs_check_method" = "Xnone"; then
7943
 
              echo "*** Warning: inter-library dependencies are not supported in this platform."
7944
 
            else
7945
 
              echo "*** Warning: inter-library dependencies are not known to be supported."
7946
 
            fi
7947
 
            echo "*** All declared inter-library dependencies are being dropped."
7948
 
            droppeddeps=yes
7949
 
            ;;
7950
 
          esac
7951
 
          ;;
7952
 
        esac
7953
 
        versuffix=$versuffix_save
7954
 
        major=$major_save
7955
 
        release=$release_save
7956
 
        libname=$libname_save
7957
 
        name=$name_save
7958
 
 
7959
 
        case $host in
7960
 
        *-*-rhapsody* | *-*-darwin1.[012])
7961
 
          # On Rhapsody replace the C library with the System framework
7962
 
          newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
7963
 
          ;;
7964
 
        esac
7965
 
 
7966
 
        if test "$droppeddeps" = yes; then
7967
 
          if test "$module" = yes; then
7968
 
            echo
7969
 
            echo "*** Warning: libtool could not satisfy all declared inter-library"
7970
 
            $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
7971
 
            echo "*** a static module, that should work as long as the dlopening"
7972
 
            echo "*** application is linked with the -dlopen flag."
7973
 
            if test -z "$global_symbol_pipe"; then
7974
 
              echo
7975
 
              echo "*** However, this would only work if libtool was able to extract symbol"
7976
 
              echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7977
 
              echo "*** not find such a program.  So, this module is probably useless."
7978
 
              echo "*** \`nm' from GNU binutils and a full rebuild may help."
7979
 
            fi
7980
 
            if test "$build_old_libs" = no; then
7981
 
              oldlibs="$output_objdir/$libname.$libext"
7982
 
              build_libtool_libs=module
7983
 
              build_old_libs=yes
7984
 
            else
7985
 
              build_libtool_libs=no
7986
 
            fi
7987
 
          else
7988
 
            echo "*** The inter-library dependencies that have been dropped here will be"
7989
 
            echo "*** automatically added whenever a program is linked with this library"
7990
 
            echo "*** or is declared to -dlopen it."
7991
 
 
7992
 
            if test "$allow_undefined" = no; then
7993
 
              echo
7994
 
              echo "*** Since this library must not contain undefined symbols,"
7995
 
              echo "*** because either the platform does not support them or"
7996
 
              echo "*** it was explicitly requested with -no-undefined,"
7997
 
              echo "*** libtool will only create a static version of it."
7998
 
              if test "$build_old_libs" = no; then
7999
 
                oldlibs="$output_objdir/$libname.$libext"
8000
 
                build_libtool_libs=module
8001
 
                build_old_libs=yes
8002
 
              else
8003
 
                build_libtool_libs=no
8004
 
              fi
8005
 
            fi
8006
 
          fi
8007
 
        fi
8008
 
        # Done checking deplibs!
8009
 
        deplibs=$newdeplibs
8010
 
      fi
8011
 
      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
8012
 
      case $host in
8013
 
        *-*-darwin*)
8014
 
          newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8015
 
          new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8016
 
          deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8017
 
          ;;
8018
 
      esac
8019
 
 
8020
 
      # move library search paths that coincide with paths to not yet
8021
 
      # installed libraries to the beginning of the library search list
8022
 
      new_libs=
8023
 
      for path in $notinst_path; do
8024
 
        case " $new_libs " in
8025
 
        *" -L$path/$objdir "*) ;;
8026
 
        *)
8027
 
          case " $deplibs " in
8028
 
          *" -L$path/$objdir "*)
8029
 
            func_append new_libs " -L$path/$objdir" ;;
8030
 
          esac
8031
 
          ;;
8032
 
        esac
8033
 
      done
8034
 
      for deplib in $deplibs; do
8035
 
        case $deplib in
8036
 
        -L*)
8037
 
          case " $new_libs " in
8038
 
          *" $deplib "*) ;;
8039
 
          *) func_append new_libs " $deplib" ;;
8040
 
          esac
8041
 
          ;;
8042
 
        *) func_append new_libs " $deplib" ;;
8043
 
        esac
8044
 
      done
8045
 
      deplibs="$new_libs"
8046
 
 
8047
 
      # All the library-specific variables (install_libdir is set above).
8048
 
      library_names=
8049
 
      old_library=
8050
 
      dlname=
8051
 
 
8052
 
      # Test again, we may have decided not to build it any more
8053
 
      if test "$build_libtool_libs" = yes; then
8054
 
        # Remove ${wl} instances when linking with ld.
8055
 
        # FIXME: should test the right _cmds variable.
8056
 
        case $archive_cmds in
8057
 
          *\$LD\ *) wl= ;;
8058
 
        esac
8059
 
        if test "$hardcode_into_libs" = yes; then
8060
 
          # Hardcode the library paths
8061
 
          hardcode_libdirs=
8062
 
          dep_rpath=
8063
 
          rpath="$finalize_rpath"
8064
 
          test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
8065
 
          for libdir in $rpath; do
8066
 
            if test -n "$hardcode_libdir_flag_spec"; then
8067
 
              if test -n "$hardcode_libdir_separator"; then
8068
 
                func_replace_sysroot "$libdir"
8069
 
                libdir=$func_replace_sysroot_result
8070
 
                if test -z "$hardcode_libdirs"; then
8071
 
                  hardcode_libdirs="$libdir"
8072
 
                else
8073
 
                  # Just accumulate the unique libdirs.
8074
 
                  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8075
 
                  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8076
 
                    ;;
8077
 
                  *)
8078
 
                    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8079
 
                    ;;
8080
 
                  esac
8081
 
                fi
8082
 
              else
8083
 
                eval flag=\"$hardcode_libdir_flag_spec\"
8084
 
                func_append dep_rpath " $flag"
8085
 
              fi
8086
 
            elif test -n "$runpath_var"; then
8087
 
              case "$perm_rpath " in
8088
 
              *" $libdir "*) ;;
8089
 
              *) func_append perm_rpath " $libdir" ;;
8090
 
              esac
8091
 
            fi
8092
 
          done
8093
 
          # Substitute the hardcoded libdirs into the rpath.
8094
 
          if test -n "$hardcode_libdir_separator" &&
8095
 
             test -n "$hardcode_libdirs"; then
8096
 
            libdir="$hardcode_libdirs"
8097
 
            eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
8098
 
          fi
8099
 
          if test -n "$runpath_var" && test -n "$perm_rpath"; then
8100
 
            # We should set the runpath_var.
8101
 
            rpath=
8102
 
            for dir in $perm_rpath; do
8103
 
              func_append rpath "$dir:"
8104
 
            done
8105
 
            eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
8106
 
          fi
8107
 
          test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
8108
 
        fi
8109
 
 
8110
 
        shlibpath="$finalize_shlibpath"
8111
 
        test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
8112
 
        if test -n "$shlibpath"; then
8113
 
          eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
8114
 
        fi
8115
 
 
8116
 
        # Get the real and link names of the library.
8117
 
        eval shared_ext=\"$shrext_cmds\"
8118
 
        eval library_names=\"$library_names_spec\"
8119
 
        set dummy $library_names
8120
 
        shift
8121
 
        realname="$1"
8122
 
        shift
8123
 
 
8124
 
        if test -n "$soname_spec"; then
8125
 
          eval soname=\"$soname_spec\"
8126
 
        else
8127
 
          soname="$realname"
8128
 
        fi
8129
 
        if test -z "$dlname"; then
8130
 
          dlname=$soname
8131
 
        fi
8132
 
 
8133
 
        lib="$output_objdir/$realname"
8134
 
        linknames=
8135
 
        for link
8136
 
        do
8137
 
          func_append linknames " $link"
8138
 
        done
8139
 
 
8140
 
        # Use standard objects if they are pic
8141
 
        test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
8142
 
        test "X$libobjs" = "X " && libobjs=
8143
 
 
8144
 
        delfiles=
8145
 
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
8146
 
          $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8147
 
          export_symbols="$output_objdir/$libname.uexp"
8148
 
          func_append delfiles " $export_symbols"
8149
 
        fi
8150
 
 
8151
 
        orig_export_symbols=
8152
 
        case $host_os in
8153
 
        cygwin* | mingw* | cegcc*)
8154
 
          if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
8155
 
            # exporting using user supplied symfile
8156
 
            if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
8157
 
              # and it's NOT already a .def file. Must figure out
8158
 
              # which of the given symbols are data symbols and tag
8159
 
              # them as such. So, trigger use of export_symbols_cmds.
8160
 
              # export_symbols gets reassigned inside the "prepare
8161
 
              # the list of exported symbols" if statement, so the
8162
 
              # include_expsyms logic still works.
8163
 
              orig_export_symbols="$export_symbols"
8164
 
              export_symbols=
8165
 
              always_export_symbols=yes
8166
 
            fi
8167
 
          fi
8168
 
          ;;
8169
 
        esac
8170
 
 
8171
 
        # Prepare the list of exported symbols
8172
 
        if test -z "$export_symbols"; then
8173
 
          if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
8174
 
            func_verbose "generating symbol list for \`$libname.la'"
8175
 
            export_symbols="$output_objdir/$libname.exp"
8176
 
            $opt_dry_run || $RM $export_symbols
8177
 
            cmds=$export_symbols_cmds
8178
 
            save_ifs="$IFS"; IFS='~'
8179
 
            for cmd1 in $cmds; do
8180
 
              IFS="$save_ifs"
8181
 
              # Take the normal branch if the nm_file_list_spec branch
8182
 
              # doesn't work or if tool conversion is not needed.
8183
 
              case $nm_file_list_spec~$to_tool_file_cmd in
8184
 
                *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
8185
 
                  try_normal_branch=yes
8186
 
                  eval cmd=\"$cmd1\"
8187
 
                  func_len " $cmd"
8188
 
                  len=$func_len_result
8189
 
                  ;;
8190
 
                *)
8191
 
                  try_normal_branch=no
8192
 
                  ;;
8193
 
              esac
8194
 
              if test "$try_normal_branch" = yes \
8195
 
                 && { test "$len" -lt "$max_cmd_len" \
8196
 
                      || test "$max_cmd_len" -le -1; }
8197
 
              then
8198
 
                func_show_eval "$cmd" 'exit $?'
8199
 
                skipped_export=false
8200
 
              elif test -n "$nm_file_list_spec"; then
8201
 
                func_basename "$output"
8202
 
                output_la=$func_basename_result
8203
 
                save_libobjs=$libobjs
8204
 
                save_output=$output
8205
 
                output=${output_objdir}/${output_la}.nm
8206
 
                func_to_tool_file "$output"
8207
 
                libobjs=$nm_file_list_spec$func_to_tool_file_result
8208
 
                func_append delfiles " $output"
8209
 
                func_verbose "creating $NM input file list: $output"
8210
 
                for obj in $save_libobjs; do
8211
 
                  func_to_tool_file "$obj"
8212
 
                  $ECHO "$func_to_tool_file_result"
8213
 
                done > "$output"
8214
 
                eval cmd=\"$cmd1\"
8215
 
                func_show_eval "$cmd" 'exit $?'
8216
 
                output=$save_output
8217
 
                libobjs=$save_libobjs
8218
 
                skipped_export=false
8219
 
              else
8220
 
                # The command line is too long to execute in one step.
8221
 
                func_verbose "using reloadable object file for export list..."
8222
 
                skipped_export=:
8223
 
                # Break out early, otherwise skipped_export may be
8224
 
                # set to false by a later but shorter cmd.
8225
 
                break
8226
 
              fi
8227
 
            done
8228
 
            IFS="$save_ifs"
8229
 
            if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
8230
 
              func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8231
 
              func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8232
 
            fi
8233
 
          fi
8234
 
        fi
8235
 
 
8236
 
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
8237
 
          tmp_export_symbols="$export_symbols"
8238
 
          test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8239
 
          $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8240
 
        fi
8241
 
 
8242
 
        if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
8243
 
          # The given exports_symbols file has to be filtered, so filter it.
8244
 
          func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8245
 
          # FIXME: $output_objdir/$libname.filter potentially contains lots of
8246
 
          # 's' commands which not all seds can handle. GNU sed should be fine
8247
 
          # though. Also, the filter scales superlinearly with the number of
8248
 
          # global variables. join(1) would be nice here, but unfortunately
8249
 
          # isn't a blessed tool.
8250
 
          $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8251
 
          func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8252
 
          export_symbols=$output_objdir/$libname.def
8253
 
          $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8254
 
        fi
8255
 
 
8256
 
        tmp_deplibs=
8257
 
        for test_deplib in $deplibs; do
8258
 
          case " $convenience " in
8259
 
          *" $test_deplib "*) ;;
8260
 
          *)
8261
 
            func_append tmp_deplibs " $test_deplib"
8262
 
            ;;
8263
 
          esac
8264
 
        done
8265
 
        deplibs="$tmp_deplibs"
8266
 
 
8267
 
        if test -n "$convenience"; then
8268
 
          if test -n "$whole_archive_flag_spec" &&
8269
 
            test "$compiler_needs_object" = yes &&
8270
 
            test -z "$libobjs"; then
8271
 
            # extract the archives, so we have objects to list.
8272
 
            # TODO: could optimize this to just extract one archive.
8273
 
            whole_archive_flag_spec=
8274
 
          fi
8275
 
          if test -n "$whole_archive_flag_spec"; then
8276
 
            save_libobjs=$libobjs
8277
 
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8278
 
            test "X$libobjs" = "X " && libobjs=
8279
 
          else
8280
 
            gentop="$output_objdir/${outputname}x"
8281
 
            func_append generated " $gentop"
8282
 
 
8283
 
            func_extract_archives $gentop $convenience
8284
 
            func_append libobjs " $func_extract_archives_result"
8285
 
            test "X$libobjs" = "X " && libobjs=
8286
 
          fi
8287
 
        fi
8288
 
 
8289
 
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
8290
 
          eval flag=\"$thread_safe_flag_spec\"
8291
 
          func_append linker_flags " $flag"
8292
 
        fi
8293
 
 
8294
 
        # Make a backup of the uninstalled library when relinking
8295
 
        if test "$opt_mode" = relink; then
8296
 
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
8297
 
        fi
8298
 
 
8299
 
        # Do each of the archive commands.
8300
 
        if test "$module" = yes && test -n "$module_cmds" ; then
8301
 
          if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8302
 
            eval test_cmds=\"$module_expsym_cmds\"
8303
 
            cmds=$module_expsym_cmds
8304
 
          else
8305
 
            eval test_cmds=\"$module_cmds\"
8306
 
            cmds=$module_cmds
8307
 
          fi
8308
 
        else
8309
 
          if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8310
 
            eval test_cmds=\"$archive_expsym_cmds\"
8311
 
            cmds=$archive_expsym_cmds
8312
 
          else
8313
 
            eval test_cmds=\"$archive_cmds\"
8314
 
            cmds=$archive_cmds
8315
 
          fi
8316
 
        fi
8317
 
 
8318
 
        if test "X$skipped_export" != "X:" &&
8319
 
           func_len " $test_cmds" &&
8320
 
           len=$func_len_result &&
8321
 
           test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8322
 
          :
8323
 
        else
8324
 
          # The command line is too long to link in one step, link piecewise
8325
 
          # or, if using GNU ld and skipped_export is not :, use a linker
8326
 
          # script.
8327
 
 
8328
 
          # Save the value of $output and $libobjs because we want to
8329
 
          # use them later.  If we have whole_archive_flag_spec, we
8330
 
          # want to use save_libobjs as it was before
8331
 
          # whole_archive_flag_spec was expanded, because we can't
8332
 
          # assume the linker understands whole_archive_flag_spec.
8333
 
          # This may have to be revisited, in case too many
8334
 
          # convenience libraries get linked in and end up exceeding
8335
 
          # the spec.
8336
 
          if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
8337
 
            save_libobjs=$libobjs
8338
 
          fi
8339
 
          save_output=$output
8340
 
          func_basename "$output"
8341
 
          output_la=$func_basename_result
8342
 
 
8343
 
          # Clear the reloadable object creation command queue and
8344
 
          # initialize k to one.
8345
 
          test_cmds=
8346
 
          concat_cmds=
8347
 
          objlist=
8348
 
          last_robj=
8349
 
          k=1
8350
 
 
8351
 
          if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
8352
 
            output=${output_objdir}/${output_la}.lnkscript
8353
 
            func_verbose "creating GNU ld script: $output"
8354
 
            echo 'INPUT (' > $output
8355
 
            for obj in $save_libobjs
8356
 
            do
8357
 
              func_to_tool_file "$obj"
8358
 
              $ECHO "$func_to_tool_file_result" >> $output
8359
 
            done
8360
 
            echo ')' >> $output
8361
 
            func_append delfiles " $output"
8362
 
            func_to_tool_file "$output"
8363
 
            output=$func_to_tool_file_result
8364
 
          elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8365
 
            output=${output_objdir}/${output_la}.lnk
8366
 
            func_verbose "creating linker input file list: $output"
8367
 
            : > $output
8368
 
            set x $save_libobjs
8369
 
            shift
8370
 
            firstobj=
8371
 
            if test "$compiler_needs_object" = yes; then
8372
 
              firstobj="$1 "
8373
 
              shift
8374
 
            fi
8375
 
            for obj
8376
 
            do
8377
 
              func_to_tool_file "$obj"
8378
 
              $ECHO "$func_to_tool_file_result" >> $output
8379
 
            done
8380
 
            func_append delfiles " $output"
8381
 
            func_to_tool_file "$output"
8382
 
            output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
8383
 
          else
8384
 
            if test -n "$save_libobjs"; then
8385
 
              func_verbose "creating reloadable object files..."
8386
 
              output=$output_objdir/$output_la-${k}.$objext
8387
 
              eval test_cmds=\"$reload_cmds\"
8388
 
              func_len " $test_cmds"
8389
 
              len0=$func_len_result
8390
 
              len=$len0
8391
 
 
8392
 
              # Loop over the list of objects to be linked.
8393
 
              for obj in $save_libobjs
8394
 
              do
8395
 
                func_len " $obj"
8396
 
                func_arith $len + $func_len_result
8397
 
                len=$func_arith_result
8398
 
                if test "X$objlist" = X ||
8399
 
                   test "$len" -lt "$max_cmd_len"; then
8400
 
                  func_append objlist " $obj"
8401
 
                else
8402
 
                  # The command $test_cmds is almost too long, add a
8403
 
                  # command to the queue.
8404
 
                  if test "$k" -eq 1 ; then
8405
 
                    # The first file doesn't have a previous command to add.
8406
 
                    reload_objs=$objlist
8407
 
                    eval concat_cmds=\"$reload_cmds\"
8408
 
                  else
8409
 
                    # All subsequent reloadable object files will link in
8410
 
                    # the last one created.
8411
 
                    reload_objs="$objlist $last_robj"
8412
 
                    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
8413
 
                  fi
8414
 
                  last_robj=$output_objdir/$output_la-${k}.$objext
8415
 
                  func_arith $k + 1
8416
 
                  k=$func_arith_result
8417
 
                  output=$output_objdir/$output_la-${k}.$objext
8418
 
                  objlist=" $obj"
8419
 
                  func_len " $last_robj"
8420
 
                  func_arith $len0 + $func_len_result
8421
 
                  len=$func_arith_result
8422
 
                fi
8423
 
              done
8424
 
              # Handle the remaining objects by creating one last
8425
 
              # reloadable object file.  All subsequent reloadable object
8426
 
              # files will link in the last one created.
8427
 
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8428
 
              reload_objs="$objlist $last_robj"
8429
 
              eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
8430
 
              if test -n "$last_robj"; then
8431
 
                eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
8432
 
              fi
8433
 
              func_append delfiles " $output"
8434
 
 
8435
 
            else
8436
 
              output=
8437
 
            fi
8438
 
 
8439
 
            if ${skipped_export-false}; then
8440
 
              func_verbose "generating symbol list for \`$libname.la'"
8441
 
              export_symbols="$output_objdir/$libname.exp"
8442
 
              $opt_dry_run || $RM $export_symbols
8443
 
              libobjs=$output
8444
 
              # Append the command to create the export file.
8445
 
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8446
 
              eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
8447
 
              if test -n "$last_robj"; then
8448
 
                eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8449
 
              fi
8450
 
            fi
8451
 
 
8452
 
            test -n "$save_libobjs" &&
8453
 
              func_verbose "creating a temporary reloadable object file: $output"
8454
 
 
8455
 
            # Loop through the commands generated above and execute them.
8456
 
            save_ifs="$IFS"; IFS='~'
8457
 
            for cmd in $concat_cmds; do
8458
 
              IFS="$save_ifs"
8459
 
              $opt_silent || {
8460
 
                  func_quote_for_expand "$cmd"
8461
 
                  eval "func_echo $func_quote_for_expand_result"
8462
 
              }
8463
 
              $opt_dry_run || eval "$cmd" || {
8464
 
                lt_exit=$?
8465
 
 
8466
 
                # Restore the uninstalled library and exit
8467
 
                if test "$opt_mode" = relink; then
8468
 
                  ( cd "$output_objdir" && \
8469
 
                    $RM "${realname}T" && \
8470
 
                    $MV "${realname}U" "$realname" )
8471
 
                fi
8472
 
 
8473
 
                exit $lt_exit
8474
 
              }
8475
 
            done
8476
 
            IFS="$save_ifs"
8477
 
 
8478
 
            if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8479
 
              func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8480
 
              func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8481
 
            fi
8482
 
          fi
8483
 
 
8484
 
          if ${skipped_export-false}; then
8485
 
            if test -n "$export_symbols" && test -n "$include_expsyms"; then
8486
 
              tmp_export_symbols="$export_symbols"
8487
 
              test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8488
 
              $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8489
 
            fi
8490
 
 
8491
 
            if test -n "$orig_export_symbols"; then
8492
 
              # The given exports_symbols file has to be filtered, so filter it.
8493
 
              func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8494
 
              # FIXME: $output_objdir/$libname.filter potentially contains lots of
8495
 
              # 's' commands which not all seds can handle. GNU sed should be fine
8496
 
              # though. Also, the filter scales superlinearly with the number of
8497
 
              # global variables. join(1) would be nice here, but unfortunately
8498
 
              # isn't a blessed tool.
8499
 
              $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8500
 
              func_append delfiles " $export_symbols $output_objdir/$libname.filter"
8501
 
              export_symbols=$output_objdir/$libname.def
8502
 
              $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8503
 
            fi
8504
 
          fi
8505
 
 
8506
 
          libobjs=$output
8507
 
          # Restore the value of output.
8508
 
          output=$save_output
8509
 
 
8510
 
          if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
8511
 
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8512
 
            test "X$libobjs" = "X " && libobjs=
8513
 
          fi
8514
 
          # Expand the library linking commands again to reset the
8515
 
          # value of $libobjs for piecewise linking.
8516
 
 
8517
 
          # Do each of the archive commands.
8518
 
          if test "$module" = yes && test -n "$module_cmds" ; then
8519
 
            if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8520
 
              cmds=$module_expsym_cmds
8521
 
            else
8522
 
              cmds=$module_cmds
8523
 
            fi
8524
 
          else
8525
 
            if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8526
 
              cmds=$archive_expsym_cmds
8527
 
            else
8528
 
              cmds=$archive_cmds
8529
 
            fi
8530
 
          fi
8531
 
        fi
8532
 
 
8533
 
        if test -n "$delfiles"; then
8534
 
          # Append the command to remove temporary files to $cmds.
8535
 
          eval cmds=\"\$cmds~\$RM $delfiles\"
8536
 
        fi
8537
 
 
8538
 
        # Add any objects from preloaded convenience libraries
8539
 
        if test -n "$dlprefiles"; then
8540
 
          gentop="$output_objdir/${outputname}x"
8541
 
          func_append generated " $gentop"
8542
 
 
8543
 
          func_extract_archives $gentop $dlprefiles
8544
 
          func_append libobjs " $func_extract_archives_result"
8545
 
          test "X$libobjs" = "X " && libobjs=
8546
 
        fi
8547
 
 
8548
 
        save_ifs="$IFS"; IFS='~'
8549
 
        for cmd in $cmds; do
8550
 
          IFS="$save_ifs"
8551
 
          eval cmd=\"$cmd\"
8552
 
          $opt_silent || {
8553
 
            func_quote_for_expand "$cmd"
8554
 
            eval "func_echo $func_quote_for_expand_result"
8555
 
          }
8556
 
          $opt_dry_run || eval "$cmd" || {
8557
 
            lt_exit=$?
8558
 
 
8559
 
            # Restore the uninstalled library and exit
8560
 
            if test "$opt_mode" = relink; then
8561
 
              ( cd "$output_objdir" && \
8562
 
                $RM "${realname}T" && \
8563
 
                $MV "${realname}U" "$realname" )
8564
 
            fi
8565
 
 
8566
 
            exit $lt_exit
8567
 
          }
8568
 
        done
8569
 
        IFS="$save_ifs"
8570
 
 
8571
 
        # Restore the uninstalled library and exit
8572
 
        if test "$opt_mode" = relink; then
8573
 
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
8574
 
 
8575
 
          if test -n "$convenience"; then
8576
 
            if test -z "$whole_archive_flag_spec"; then
8577
 
              func_show_eval '${RM}r "$gentop"'
8578
 
            fi
8579
 
          fi
8580
 
 
8581
 
          exit $EXIT_SUCCESS
8582
 
        fi
8583
 
 
8584
 
        # Create links to the real library.
8585
 
        for linkname in $linknames; do
8586
 
          if test "$realname" != "$linkname"; then
8587
 
            func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
8588
 
          fi
8589
 
        done
8590
 
 
8591
 
        # If -module or -export-dynamic was specified, set the dlname.
8592
 
        if test "$module" = yes || test "$export_dynamic" = yes; then
8593
 
          # On all known operating systems, these are identical.
8594
 
          dlname="$soname"
8595
 
        fi
8596
 
      fi
8597
 
      ;;
8598
 
 
8599
 
    obj)
8600
 
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
8601
 
        func_warning "\`-dlopen' is ignored for objects"
8602
 
      fi
8603
 
 
8604
 
      case " $deplibs" in
8605
 
      *\ -l* | *\ -L*)
8606
 
        func_warning "\`-l' and \`-L' are ignored for objects" ;;
8607
 
      esac
8608
 
 
8609
 
      test -n "$rpath" && \
8610
 
        func_warning "\`-rpath' is ignored for objects"
8611
 
 
8612
 
      test -n "$xrpath" && \
8613
 
        func_warning "\`-R' is ignored for objects"
8614
 
 
8615
 
      test -n "$vinfo" && \
8616
 
        func_warning "\`-version-info' is ignored for objects"
8617
 
 
8618
 
      test -n "$release" && \
8619
 
        func_warning "\`-release' is ignored for objects"
8620
 
 
8621
 
      case $output in
8622
 
      *.lo)
8623
 
        test -n "$objs$old_deplibs" && \
8624
 
          func_fatal_error "cannot build library object \`$output' from non-libtool objects"
8625
 
 
8626
 
        libobj=$output
8627
 
        func_lo2o "$libobj"
8628
 
        obj=$func_lo2o_result
8629
 
        ;;
8630
 
      *)
8631
 
        libobj=
8632
 
        obj="$output"
8633
 
        ;;
8634
 
      esac
8635
 
 
8636
 
      # Delete the old objects.
8637
 
      $opt_dry_run || $RM $obj $libobj
8638
 
 
8639
 
      # Objects from convenience libraries.  This assumes
8640
 
      # single-version convenience libraries.  Whenever we create
8641
 
      # different ones for PIC/non-PIC, this we'll have to duplicate
8642
 
      # the extraction.
8643
 
      reload_conv_objs=
8644
 
      gentop=
8645
 
      # reload_cmds runs $LD directly, so let us get rid of
8646
 
      # -Wl from whole_archive_flag_spec and hope we can get by with
8647
 
      # turning comma into space..
8648
 
      wl=
8649
 
 
8650
 
      if test -n "$convenience"; then
8651
 
        if test -n "$whole_archive_flag_spec"; then
8652
 
          eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
8653
 
          reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
8654
 
        else
8655
 
          gentop="$output_objdir/${obj}x"
8656
 
          func_append generated " $gentop"
8657
 
 
8658
 
          func_extract_archives $gentop $convenience
8659
 
          reload_conv_objs="$reload_objs $func_extract_archives_result"
8660
 
        fi
8661
 
      fi
8662
 
 
8663
 
      # If we're not building shared, we need to use non_pic_objs
8664
 
      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
8665
 
 
8666
 
      # Create the old-style object.
8667
 
      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
8668
 
 
8669
 
      output="$obj"
8670
 
      func_execute_cmds "$reload_cmds" 'exit $?'
8671
 
 
8672
 
      # Exit if we aren't doing a library object file.
8673
 
      if test -z "$libobj"; then
8674
 
        if test -n "$gentop"; then
8675
 
          func_show_eval '${RM}r "$gentop"'
8676
 
        fi
8677
 
 
8678
 
        exit $EXIT_SUCCESS
8679
 
      fi
8680
 
 
8681
 
      if test "$build_libtool_libs" != yes; then
8682
 
        if test -n "$gentop"; then
8683
 
          func_show_eval '${RM}r "$gentop"'
8684
 
        fi
8685
 
 
8686
 
        # Create an invalid libtool object if no PIC, so that we don't
8687
 
        # accidentally link it into a program.
8688
 
        # $show "echo timestamp > $libobj"
8689
 
        # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
8690
 
        exit $EXIT_SUCCESS
8691
 
      fi
8692
 
 
8693
 
      if test -n "$pic_flag" || test "$pic_mode" != default; then
8694
 
        # Only do commands if we really have different PIC objects.
8695
 
        reload_objs="$libobjs $reload_conv_objs"
8696
 
        output="$libobj"
8697
 
        func_execute_cmds "$reload_cmds" 'exit $?'
8698
 
      fi
8699
 
 
8700
 
      if test -n "$gentop"; then
8701
 
        func_show_eval '${RM}r "$gentop"'
8702
 
      fi
8703
 
 
8704
 
      exit $EXIT_SUCCESS
8705
 
      ;;
8706
 
 
8707
 
    prog)
8708
 
      case $host in
8709
 
        *cygwin*) func_stripname '' '.exe' "$output"
8710
 
                  output=$func_stripname_result.exe;;
8711
 
      esac
8712
 
      test -n "$vinfo" && \
8713
 
        func_warning "\`-version-info' is ignored for programs"
8714
 
 
8715
 
      test -n "$release" && \
8716
 
        func_warning "\`-release' is ignored for programs"
8717
 
 
8718
 
      test "$preload" = yes \
8719
 
        && test "$dlopen_support" = unknown \
8720
 
        && test "$dlopen_self" = unknown \
8721
 
        && test "$dlopen_self_static" = unknown && \
8722
 
          func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
8723
 
 
8724
 
      case $host in
8725
 
      *-*-rhapsody* | *-*-darwin1.[012])
8726
 
        # On Rhapsody replace the C library is the System framework
8727
 
        compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
8728
 
        finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
8729
 
        ;;
8730
 
      esac
8731
 
 
8732
 
      case $host in
8733
 
      *-*-darwin*)
8734
 
        # Don't allow lazy linking, it breaks C++ global constructors
8735
 
        # But is supposedly fixed on 10.4 or later (yay!).
8736
 
        if test "$tagname" = CXX ; then
8737
 
          case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
8738
 
            10.[0123])
8739
 
              func_append compile_command " ${wl}-bind_at_load"
8740
 
              func_append finalize_command " ${wl}-bind_at_load"
8741
 
            ;;
8742
 
          esac
8743
 
        fi
8744
 
        # Time to change all our "foo.ltframework" stuff back to "-framework foo"
8745
 
        compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8746
 
        finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8747
 
        ;;
8748
 
      esac
8749
 
 
8750
 
 
8751
 
      # move library search paths that coincide with paths to not yet
8752
 
      # installed libraries to the beginning of the library search list
8753
 
      new_libs=
8754
 
      for path in $notinst_path; do
8755
 
        case " $new_libs " in
8756
 
        *" -L$path/$objdir "*) ;;
8757
 
        *)
8758
 
          case " $compile_deplibs " in
8759
 
          *" -L$path/$objdir "*)
8760
 
            func_append new_libs " -L$path/$objdir" ;;
8761
 
          esac
8762
 
          ;;
8763
 
        esac
8764
 
      done
8765
 
      for deplib in $compile_deplibs; do
8766
 
        case $deplib in
8767
 
        -L*)
8768
 
          case " $new_libs " in
8769
 
          *" $deplib "*) ;;
8770
 
          *) func_append new_libs " $deplib" ;;
8771
 
          esac
8772
 
          ;;
8773
 
        *) func_append new_libs " $deplib" ;;
8774
 
        esac
8775
 
      done
8776
 
      compile_deplibs="$new_libs"
8777
 
 
8778
 
 
8779
 
      func_append compile_command " $compile_deplibs"
8780
 
      func_append finalize_command " $finalize_deplibs"
8781
 
 
8782
 
      if test -n "$rpath$xrpath"; then
8783
 
        # If the user specified any rpath flags, then add them.
8784
 
        for libdir in $rpath $xrpath; do
8785
 
          # This is the magic to use -rpath.
8786
 
          case "$finalize_rpath " in
8787
 
          *" $libdir "*) ;;
8788
 
          *) func_append finalize_rpath " $libdir" ;;
8789
 
          esac
8790
 
        done
8791
 
      fi
8792
 
 
8793
 
      # Now hardcode the library paths
8794
 
      rpath=
8795
 
      hardcode_libdirs=
8796
 
      for libdir in $compile_rpath $finalize_rpath; do
8797
 
        if test -n "$hardcode_libdir_flag_spec"; then
8798
 
          if test -n "$hardcode_libdir_separator"; then
8799
 
            if test -z "$hardcode_libdirs"; then
8800
 
              hardcode_libdirs="$libdir"
8801
 
            else
8802
 
              # Just accumulate the unique libdirs.
8803
 
              case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8804
 
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8805
 
                ;;
8806
 
              *)
8807
 
                func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8808
 
                ;;
8809
 
              esac
8810
 
            fi
8811
 
          else
8812
 
            eval flag=\"$hardcode_libdir_flag_spec\"
8813
 
            func_append rpath " $flag"
8814
 
          fi
8815
 
        elif test -n "$runpath_var"; then
8816
 
          case "$perm_rpath " in
8817
 
          *" $libdir "*) ;;
8818
 
          *) func_append perm_rpath " $libdir" ;;
8819
 
          esac
8820
 
        fi
8821
 
        case $host in
8822
 
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
8823
 
          testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
8824
 
          case :$dllsearchpath: in
8825
 
          *":$libdir:"*) ;;
8826
 
          ::) dllsearchpath=$libdir;;
8827
 
          *) func_append dllsearchpath ":$libdir";;
8828
 
          esac
8829
 
          case :$dllsearchpath: in
8830
 
          *":$testbindir:"*) ;;
8831
 
          ::) dllsearchpath=$testbindir;;
8832
 
          *) func_append dllsearchpath ":$testbindir";;
8833
 
          esac
8834
 
          ;;
8835
 
        esac
8836
 
      done
8837
 
      # Substitute the hardcoded libdirs into the rpath.
8838
 
      if test -n "$hardcode_libdir_separator" &&
8839
 
         test -n "$hardcode_libdirs"; then
8840
 
        libdir="$hardcode_libdirs"
8841
 
        eval rpath=\" $hardcode_libdir_flag_spec\"
8842
 
      fi
8843
 
      compile_rpath="$rpath"
8844
 
 
8845
 
      rpath=
8846
 
      hardcode_libdirs=
8847
 
      for libdir in $finalize_rpath; do
8848
 
        if test -n "$hardcode_libdir_flag_spec"; then
8849
 
          if test -n "$hardcode_libdir_separator"; then
8850
 
            if test -z "$hardcode_libdirs"; then
8851
 
              hardcode_libdirs="$libdir"
8852
 
            else
8853
 
              # Just accumulate the unique libdirs.
8854
 
              case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8855
 
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8856
 
                ;;
8857
 
              *)
8858
 
                func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
8859
 
                ;;
8860
 
              esac
8861
 
            fi
8862
 
          else
8863
 
            eval flag=\"$hardcode_libdir_flag_spec\"
8864
 
            func_append rpath " $flag"
8865
 
          fi
8866
 
        elif test -n "$runpath_var"; then
8867
 
          case "$finalize_perm_rpath " in
8868
 
          *" $libdir "*) ;;
8869
 
          *) func_append finalize_perm_rpath " $libdir" ;;
8870
 
          esac
8871
 
        fi
8872
 
      done
8873
 
      # Substitute the hardcoded libdirs into the rpath.
8874
 
      if test -n "$hardcode_libdir_separator" &&
8875
 
         test -n "$hardcode_libdirs"; then
8876
 
        libdir="$hardcode_libdirs"
8877
 
        eval rpath=\" $hardcode_libdir_flag_spec\"
8878
 
      fi
8879
 
      finalize_rpath="$rpath"
8880
 
 
8881
 
      if test -n "$libobjs" && test "$build_old_libs" = yes; then
8882
 
        # Transform all the library objects into standard objects.
8883
 
        compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8884
 
        finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8885
 
      fi
8886
 
 
8887
 
      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
8888
 
 
8889
 
      # template prelinking step
8890
 
      if test -n "$prelink_cmds"; then
8891
 
        func_execute_cmds "$prelink_cmds" 'exit $?'
8892
 
      fi
8893
 
 
8894
 
      wrappers_required=yes
8895
 
      case $host in
8896
 
      *cegcc* | *mingw32ce*)
8897
 
        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
8898
 
        wrappers_required=no
8899
 
        ;;
8900
 
      *cygwin* | *mingw* )
8901
 
        if test "$build_libtool_libs" != yes; then
8902
 
          wrappers_required=no
8903
 
        fi
8904
 
        ;;
8905
 
      *)
8906
 
        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
8907
 
          wrappers_required=no
8908
 
        fi
8909
 
        ;;
8910
 
      esac
8911
 
      if test "$wrappers_required" = no; then
8912
 
        # Replace the output file specification.
8913
 
        compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8914
 
        link_command="$compile_command$compile_rpath"
8915
 
 
8916
 
        # We have no uninstalled library dependencies, so finalize right now.
8917
 
        exit_status=0
8918
 
        func_show_eval "$link_command" 'exit_status=$?'
8919
 
 
8920
 
        if test -n "$postlink_cmds"; then
8921
 
          func_to_tool_file "$output"
8922
 
          postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8923
 
          func_execute_cmds "$postlink_cmds" 'exit $?'
8924
 
        fi
8925
 
 
8926
 
        # Delete the generated files.
8927
 
        if test -f "$output_objdir/${outputname}S.${objext}"; then
8928
 
          func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
8929
 
        fi
8930
 
 
8931
 
        exit $exit_status
8932
 
      fi
8933
 
 
8934
 
      if test -n "$compile_shlibpath$finalize_shlibpath"; then
8935
 
        compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
8936
 
      fi
8937
 
      if test -n "$finalize_shlibpath"; then
8938
 
        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
8939
 
      fi
8940
 
 
8941
 
      compile_var=
8942
 
      finalize_var=
8943
 
      if test -n "$runpath_var"; then
8944
 
        if test -n "$perm_rpath"; then
8945
 
          # We should set the runpath_var.
8946
 
          rpath=
8947
 
          for dir in $perm_rpath; do
8948
 
            func_append rpath "$dir:"
8949
 
          done
8950
 
          compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
8951
 
        fi
8952
 
        if test -n "$finalize_perm_rpath"; then
8953
 
          # We should set the runpath_var.
8954
 
          rpath=
8955
 
          for dir in $finalize_perm_rpath; do
8956
 
            func_append rpath "$dir:"
8957
 
          done
8958
 
          finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
8959
 
        fi
8960
 
      fi
8961
 
 
8962
 
      if test "$no_install" = yes; then
8963
 
        # We don't need to create a wrapper script.
8964
 
        link_command="$compile_var$compile_command$compile_rpath"
8965
 
        # Replace the output file specification.
8966
 
        link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8967
 
        # Delete the old output file.
8968
 
        $opt_dry_run || $RM $output
8969
 
        # Link the executable and exit
8970
 
        func_show_eval "$link_command" 'exit $?'
8971
 
 
8972
 
        if test -n "$postlink_cmds"; then
8973
 
          func_to_tool_file "$output"
8974
 
          postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
8975
 
          func_execute_cmds "$postlink_cmds" 'exit $?'
8976
 
        fi
8977
 
 
8978
 
        exit $EXIT_SUCCESS
8979
 
      fi
8980
 
 
8981
 
      if test "$hardcode_action" = relink; then
8982
 
        # Fast installation is not supported
8983
 
        link_command="$compile_var$compile_command$compile_rpath"
8984
 
        relink_command="$finalize_var$finalize_command$finalize_rpath"
8985
 
 
8986
 
        func_warning "this platform does not like uninstalled shared libraries"
8987
 
        func_warning "\`$output' will be relinked during installation"
8988
 
      else
8989
 
        if test "$fast_install" != no; then
8990
 
          link_command="$finalize_var$compile_command$finalize_rpath"
8991
 
          if test "$fast_install" = yes; then
8992
 
            relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
8993
 
          else
8994
 
            # fast_install is set to needless
8995
 
            relink_command=
8996
 
          fi
8997
 
        else
8998
 
          link_command="$compile_var$compile_command$compile_rpath"
8999
 
          relink_command="$finalize_var$finalize_command$finalize_rpath"
9000
 
        fi
9001
 
      fi
9002
 
 
9003
 
      # Replace the output file specification.
9004
 
      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
9005
 
 
9006
 
      # Delete the old output files.
9007
 
      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
9008
 
 
9009
 
      func_show_eval "$link_command" 'exit $?'
9010
 
 
9011
 
      if test -n "$postlink_cmds"; then
9012
 
        func_to_tool_file "$output_objdir/$outputname"
9013
 
        postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
9014
 
        func_execute_cmds "$postlink_cmds" 'exit $?'
9015
 
      fi
9016
 
 
9017
 
      # Now create the wrapper script.
9018
 
      func_verbose "creating $output"
9019
 
 
9020
 
      # Quote the relink command for shipping.
9021
 
      if test -n "$relink_command"; then
9022
 
        # Preserve any variables that may affect compiler behavior
9023
 
        for var in $variables_saved_for_relink; do
9024
 
          if eval test -z \"\${$var+set}\"; then
9025
 
            relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9026
 
          elif eval var_value=\$$var; test -z "$var_value"; then
9027
 
            relink_command="$var=; export $var; $relink_command"
9028
 
          else
9029
 
            func_quote_for_eval "$var_value"
9030
 
            relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9031
 
          fi
9032
 
        done
9033
 
        relink_command="(cd `pwd`; $relink_command)"
9034
 
        relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9035
 
      fi
9036
 
 
9037
 
      # Only actually do things if not in dry run mode.
9038
 
      $opt_dry_run || {
9039
 
        # win32 will think the script is a binary if it has
9040
 
        # a .exe suffix, so we strip it off here.
9041
 
        case $output in
9042
 
          *.exe) func_stripname '' '.exe' "$output"
9043
 
                 output=$func_stripname_result ;;
9044
 
        esac
9045
 
        # test for cygwin because mv fails w/o .exe extensions
9046
 
        case $host in
9047
 
          *cygwin*)
9048
 
            exeext=.exe
9049
 
            func_stripname '' '.exe' "$outputname"
9050
 
            outputname=$func_stripname_result ;;
9051
 
          *) exeext= ;;
9052
 
        esac
9053
 
        case $host in
9054
 
          *cygwin* | *mingw* )
9055
 
            func_dirname_and_basename "$output" "" "."
9056
 
            output_name=$func_basename_result
9057
 
            output_path=$func_dirname_result
9058
 
            cwrappersource="$output_path/$objdir/lt-$output_name.c"
9059
 
            cwrapper="$output_path/$output_name.exe"
9060
 
            $RM $cwrappersource $cwrapper
9061
 
            trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
9062
 
 
9063
 
            func_emit_cwrapperexe_src > $cwrappersource
9064
 
 
9065
 
            # The wrapper executable is built using the $host compiler,
9066
 
            # because it contains $host paths and files. If cross-
9067
 
            # compiling, it, like the target executable, must be
9068
 
            # executed on the $host or under an emulation environment.
9069
 
            $opt_dry_run || {
9070
 
              $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
9071
 
              $STRIP $cwrapper
9072
 
            }
9073
 
 
9074
 
            # Now, create the wrapper script for func_source use:
9075
 
            func_ltwrapper_scriptname $cwrapper
9076
 
            $RM $func_ltwrapper_scriptname_result
9077
 
            trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
9078
 
            $opt_dry_run || {
9079
 
              # note: this script will not be executed, so do not chmod.
9080
 
              if test "x$build" = "x$host" ; then
9081
 
                $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
9082
 
              else
9083
 
                func_emit_wrapper no > $func_ltwrapper_scriptname_result
9084
 
              fi
9085
 
            }
9086
 
          ;;
9087
 
          * )
9088
 
            $RM $output
9089
 
            trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
9090
 
 
9091
 
            func_emit_wrapper no > $output
9092
 
            chmod +x $output
9093
 
          ;;
9094
 
        esac
9095
 
      }
9096
 
      exit $EXIT_SUCCESS
9097
 
      ;;
9098
 
    esac
9099
 
 
9100
 
    # See if we need to build an old-fashioned archive.
9101
 
    for oldlib in $oldlibs; do
9102
 
 
9103
 
      if test "$build_libtool_libs" = convenience; then
9104
 
        oldobjs="$libobjs_save $symfileobj"
9105
 
        addlibs="$convenience"
9106
 
        build_libtool_libs=no
9107
 
      else
9108
 
        if test "$build_libtool_libs" = module; then
9109
 
          oldobjs="$libobjs_save"
9110
 
          build_libtool_libs=no
9111
 
        else
9112
 
          oldobjs="$old_deplibs $non_pic_objects"
9113
 
          if test "$preload" = yes && test -f "$symfileobj"; then
9114
 
            func_append oldobjs " $symfileobj"
9115
 
          fi
9116
 
        fi
9117
 
        addlibs="$old_convenience"
9118
 
      fi
9119
 
 
9120
 
      if test -n "$addlibs"; then
9121
 
        gentop="$output_objdir/${outputname}x"
9122
 
        func_append generated " $gentop"
9123
 
 
9124
 
        func_extract_archives $gentop $addlibs
9125
 
        func_append oldobjs " $func_extract_archives_result"
9126
 
      fi
9127
 
 
9128
 
      # Do each command in the archive commands.
9129
 
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
9130
 
        cmds=$old_archive_from_new_cmds
9131
 
      else
9132
 
 
9133
 
        # Add any objects from preloaded convenience libraries
9134
 
        if test -n "$dlprefiles"; then
9135
 
          gentop="$output_objdir/${outputname}x"
9136
 
          func_append generated " $gentop"
9137
 
 
9138
 
          func_extract_archives $gentop $dlprefiles
9139
 
          func_append oldobjs " $func_extract_archives_result"
9140
 
        fi
9141
 
 
9142
 
        # POSIX demands no paths to be encoded in archives.  We have
9143
 
        # to avoid creating archives with duplicate basenames if we
9144
 
        # might have to extract them afterwards, e.g., when creating a
9145
 
        # static archive out of a convenience library, or when linking
9146
 
        # the entirety of a libtool archive into another (currently
9147
 
        # not supported by libtool).
9148
 
        if (for obj in $oldobjs
9149
 
            do
9150
 
              func_basename "$obj"
9151
 
              $ECHO "$func_basename_result"
9152
 
            done | sort | sort -uc >/dev/null 2>&1); then
9153
 
          :
9154
 
        else
9155
 
          echo "copying selected object files to avoid basename conflicts..."
9156
 
          gentop="$output_objdir/${outputname}x"
9157
 
          func_append generated " $gentop"
9158
 
          func_mkdir_p "$gentop"
9159
 
          save_oldobjs=$oldobjs
9160
 
          oldobjs=
9161
 
          counter=1
9162
 
          for obj in $save_oldobjs
9163
 
          do
9164
 
            func_basename "$obj"
9165
 
            objbase="$func_basename_result"
9166
 
            case " $oldobjs " in
9167
 
            " ") oldobjs=$obj ;;
9168
 
            *[\ /]"$objbase "*)
9169
 
              while :; do
9170
 
                # Make sure we don't pick an alternate name that also
9171
 
                # overlaps.
9172
 
                newobj=lt$counter-$objbase
9173
 
                func_arith $counter + 1
9174
 
                counter=$func_arith_result
9175
 
                case " $oldobjs " in
9176
 
                *[\ /]"$newobj "*) ;;
9177
 
                *) if test ! -f "$gentop/$newobj"; then break; fi ;;
9178
 
                esac
9179
 
              done
9180
 
              func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
9181
 
              func_append oldobjs " $gentop/$newobj"
9182
 
              ;;
9183
 
            *) func_append oldobjs " $obj" ;;
9184
 
            esac
9185
 
          done
9186
 
        fi
9187
 
        func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
9188
 
        tool_oldlib=$func_to_tool_file_result
9189
 
        eval cmds=\"$old_archive_cmds\"
9190
 
 
9191
 
        func_len " $cmds"
9192
 
        len=$func_len_result
9193
 
        if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9194
 
          cmds=$old_archive_cmds
9195
 
        elif test -n "$archiver_list_spec"; then
9196
 
          func_verbose "using command file archive linking..."
9197
 
          for obj in $oldobjs
9198
 
          do
9199
 
            func_to_tool_file "$obj"
9200
 
            $ECHO "$func_to_tool_file_result"
9201
 
          done > $output_objdir/$libname.libcmd
9202
 
          func_to_tool_file "$output_objdir/$libname.libcmd"
9203
 
          oldobjs=" $archiver_list_spec$func_to_tool_file_result"
9204
 
          cmds=$old_archive_cmds
9205
 
        else
9206
 
          # the command line is too long to link in one step, link in parts
9207
 
          func_verbose "using piecewise archive linking..."
9208
 
          save_RANLIB=$RANLIB
9209
 
          RANLIB=:
9210
 
          objlist=
9211
 
          concat_cmds=
9212
 
          save_oldobjs=$oldobjs
9213
 
          oldobjs=
9214
 
          # Is there a better way of finding the last object in the list?
9215
 
          for obj in $save_oldobjs
9216
 
          do
9217
 
            last_oldobj=$obj
9218
 
          done
9219
 
          eval test_cmds=\"$old_archive_cmds\"
9220
 
          func_len " $test_cmds"
9221
 
          len0=$func_len_result
9222
 
          len=$len0
9223
 
          for obj in $save_oldobjs
9224
 
          do
9225
 
            func_len " $obj"
9226
 
            func_arith $len + $func_len_result
9227
 
            len=$func_arith_result
9228
 
            func_append objlist " $obj"
9229
 
            if test "$len" -lt "$max_cmd_len"; then
9230
 
              :
9231
 
            else
9232
 
              # the above command should be used before it gets too long
9233
 
              oldobjs=$objlist
9234
 
              if test "$obj" = "$last_oldobj" ; then
9235
 
                RANLIB=$save_RANLIB
9236
 
              fi
9237
 
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9238
 
              eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
9239
 
              objlist=
9240
 
              len=$len0
9241
 
            fi
9242
 
          done
9243
 
          RANLIB=$save_RANLIB
9244
 
          oldobjs=$objlist
9245
 
          if test "X$oldobjs" = "X" ; then
9246
 
            eval cmds=\"\$concat_cmds\"
9247
 
          else
9248
 
            eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
9249
 
          fi
9250
 
        fi
9251
 
      fi
9252
 
      func_execute_cmds "$cmds" 'exit $?'
9253
 
    done
9254
 
 
9255
 
    test -n "$generated" && \
9256
 
      func_show_eval "${RM}r$generated"
9257
 
 
9258
 
    # Now create the libtool archive.
9259
 
    case $output in
9260
 
    *.la)
9261
 
      old_library=
9262
 
      test "$build_old_libs" = yes && old_library="$libname.$libext"
9263
 
      func_verbose "creating $output"
9264
 
 
9265
 
      # Preserve any variables that may affect compiler behavior
9266
 
      for var in $variables_saved_for_relink; do
9267
 
        if eval test -z \"\${$var+set}\"; then
9268
 
          relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9269
 
        elif eval var_value=\$$var; test -z "$var_value"; then
9270
 
          relink_command="$var=; export $var; $relink_command"
9271
 
        else
9272
 
          func_quote_for_eval "$var_value"
9273
 
          relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9274
 
        fi
9275
 
      done
9276
 
      # Quote the link command for shipping.
9277
 
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9278
 
      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9279
 
      if test "$hardcode_automatic" = yes ; then
9280
 
        relink_command=
9281
 
      fi
9282
 
 
9283
 
      # Only create the output if not a dry run.
9284
 
      $opt_dry_run || {
9285
 
        for installed in no yes; do
9286
 
          if test "$installed" = yes; then
9287
 
            if test -z "$install_libdir"; then
9288
 
              break
9289
 
            fi
9290
 
            output="$output_objdir/$outputname"i
9291
 
            # Replace all uninstalled libtool libraries with the installed ones
9292
 
            newdependency_libs=
9293
 
            for deplib in $dependency_libs; do
9294
 
              case $deplib in
9295
 
              *.la)
9296
 
                func_basename "$deplib"
9297
 
                name="$func_basename_result"
9298
 
                func_resolve_sysroot "$deplib"
9299
 
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
9300
 
                test -z "$libdir" && \
9301
 
                  func_fatal_error "\`$deplib' is not a valid libtool archive"
9302
 
                func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
9303
 
                ;;
9304
 
              -L*)
9305
 
                func_stripname -L '' "$deplib"
9306
 
                func_replace_sysroot "$func_stripname_result"
9307
 
                func_append newdependency_libs " -L$func_replace_sysroot_result"
9308
 
                ;;
9309
 
              -R*)
9310
 
                func_stripname -R '' "$deplib"
9311
 
                func_replace_sysroot "$func_stripname_result"
9312
 
                func_append newdependency_libs " -R$func_replace_sysroot_result"
9313
 
                ;;
9314
 
              *) func_append newdependency_libs " $deplib" ;;
9315
 
              esac
9316
 
            done
9317
 
            dependency_libs="$newdependency_libs"
9318
 
            newdlfiles=
9319
 
 
9320
 
            for lib in $dlfiles; do
9321
 
              case $lib in
9322
 
              *.la)
9323
 
                func_basename "$lib"
9324
 
                name="$func_basename_result"
9325
 
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9326
 
                test -z "$libdir" && \
9327
 
                  func_fatal_error "\`$lib' is not a valid libtool archive"
9328
 
                func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
9329
 
                ;;
9330
 
              *) func_append newdlfiles " $lib" ;;
9331
 
              esac
9332
 
            done
9333
 
            dlfiles="$newdlfiles"
9334
 
            newdlprefiles=
9335
 
            for lib in $dlprefiles; do
9336
 
              case $lib in
9337
 
              *.la)
9338
 
                # Only pass preopened files to the pseudo-archive (for
9339
 
                # eventual linking with the app. that links it) if we
9340
 
                # didn't already link the preopened objects directly into
9341
 
                # the library:
9342
 
                func_basename "$lib"
9343
 
                name="$func_basename_result"
9344
 
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9345
 
                test -z "$libdir" && \
9346
 
                  func_fatal_error "\`$lib' is not a valid libtool archive"
9347
 
                func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
9348
 
                ;;
9349
 
              esac
9350
 
            done
9351
 
            dlprefiles="$newdlprefiles"
9352
 
          else
9353
 
            newdlfiles=
9354
 
            for lib in $dlfiles; do
9355
 
              case $lib in
9356
 
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9357
 
                *) abs=`pwd`"/$lib" ;;
9358
 
              esac
9359
 
              func_append newdlfiles " $abs"
9360
 
            done
9361
 
            dlfiles="$newdlfiles"
9362
 
            newdlprefiles=
9363
 
            for lib in $dlprefiles; do
9364
 
              case $lib in
9365
 
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9366
 
                *) abs=`pwd`"/$lib" ;;
9367
 
              esac
9368
 
              func_append newdlprefiles " $abs"
9369
 
            done
9370
 
            dlprefiles="$newdlprefiles"
9371
 
          fi
9372
 
          $RM $output
9373
 
          # place dlname in correct position for cygwin
9374
 
          # In fact, it would be nice if we could use this code for all target
9375
 
          # systems that can't hard-code library paths into their executables
9376
 
          # and that have no shared library path variable independent of PATH,
9377
 
          # but it turns out we can't easily determine that from inspecting
9378
 
          # libtool variables, so we have to hard-code the OSs to which it
9379
 
          # applies here; at the moment, that means platforms that use the PE
9380
 
          # object format with DLL files.  See the long comment at the top of
9381
 
          # tests/bindir.at for full details.
9382
 
          tdlname=$dlname
9383
 
          case $host,$output,$installed,$module,$dlname in
9384
 
            *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
9385
 
              # If a -bindir argument was supplied, place the dll there.
9386
 
              if test "x$bindir" != x ;
9387
 
              then
9388
 
                func_relative_path "$install_libdir" "$bindir"
9389
 
                tdlname=$func_relative_path_result$dlname
9390
 
              else
9391
 
                # Otherwise fall back on heuristic.
9392
 
                tdlname=../bin/$dlname
9393
 
              fi
9394
 
              ;;
9395
 
          esac
9396
 
          $ECHO > $output "\
9397
 
# $outputname - a libtool library file
9398
 
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
9399
 
#
9400
 
# Please DO NOT delete this file!
9401
 
# It is necessary for linking the library.
9402
 
 
9403
 
# The name that we can dlopen(3).
9404
 
dlname='$tdlname'
9405
 
 
9406
 
# Names of this library.
9407
 
library_names='$library_names'
9408
 
 
9409
 
# The name of the static archive.
9410
 
old_library='$old_library'
9411
 
 
9412
 
# Linker flags that can not go in dependency_libs.
9413
 
inherited_linker_flags='$new_inherited_linker_flags'
9414
 
 
9415
 
# Libraries that this one depends upon.
9416
 
dependency_libs='$dependency_libs'
9417
 
 
9418
 
# Names of additional weak libraries provided by this library
9419
 
weak_library_names='$weak_libs'
9420
 
 
9421
 
# Version information for $libname.
9422
 
current=$current
9423
 
age=$age
9424
 
revision=$revision
9425
 
 
9426
 
# Is this an already installed library?
9427
 
installed=$installed
9428
 
 
9429
 
# Should we warn about portability when linking against -modules?
9430
 
shouldnotlink=$module
9431
 
 
9432
 
# Files to dlopen/dlpreopen
9433
 
dlopen='$dlfiles'
9434
 
dlpreopen='$dlprefiles'
9435
 
 
9436
 
# Directory that this library needs to be installed in:
9437
 
libdir='$install_libdir'"
9438
 
          if test "$installed" = no && test "$need_relink" = yes; then
9439
 
            $ECHO >> $output "\
9440
 
relink_command=\"$relink_command\""
9441
 
          fi
9442
 
        done
9443
 
      }
9444
 
 
9445
 
      # Do a symbolic link so that the libtool archive can be found in
9446
 
      # LD_LIBRARY_PATH before the program is installed.
9447
 
      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
9448
 
      ;;
9449
 
    esac
9450
 
    exit $EXIT_SUCCESS
9451
 
}
9452
 
 
9453
 
{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
9454
 
    func_mode_link ${1+"$@"}
9455
 
 
9456
 
 
9457
 
# func_mode_uninstall arg...
9458
 
func_mode_uninstall ()
9459
 
{
9460
 
    $opt_debug
9461
 
    RM="$nonopt"
9462
 
    files=
9463
 
    rmforce=
9464
 
    exit_status=0
9465
 
 
9466
 
    # This variable tells wrapper scripts just to set variables rather
9467
 
    # than running their programs.
9468
 
    libtool_install_magic="$magic"
9469
 
 
9470
 
    for arg
9471
 
    do
9472
 
      case $arg in
9473
 
      -f) func_append RM " $arg"; rmforce=yes ;;
9474
 
      -*) func_append RM " $arg" ;;
9475
 
      *) func_append files " $arg" ;;
9476
 
      esac
9477
 
    done
9478
 
 
9479
 
    test -z "$RM" && \
9480
 
      func_fatal_help "you must specify an RM program"
9481
 
 
9482
 
    rmdirs=
9483
 
 
9484
 
    for file in $files; do
9485
 
      func_dirname "$file" "" "."
9486
 
      dir="$func_dirname_result"
9487
 
      if test "X$dir" = X.; then
9488
 
        odir="$objdir"
9489
 
      else
9490
 
        odir="$dir/$objdir"
9491
 
      fi
9492
 
      func_basename "$file"
9493
 
      name="$func_basename_result"
9494
 
      test "$opt_mode" = uninstall && odir="$dir"
9495
 
 
9496
 
      # Remember odir for removal later, being careful to avoid duplicates
9497
 
      if test "$opt_mode" = clean; then
9498
 
        case " $rmdirs " in
9499
 
          *" $odir "*) ;;
9500
 
          *) func_append rmdirs " $odir" ;;
9501
 
        esac
9502
 
      fi
9503
 
 
9504
 
      # Don't error if the file doesn't exist and rm -f was used.
9505
 
      if { test -L "$file"; } >/dev/null 2>&1 ||
9506
 
         { test -h "$file"; } >/dev/null 2>&1 ||
9507
 
         test -f "$file"; then
9508
 
        :
9509
 
      elif test -d "$file"; then
9510
 
        exit_status=1
9511
 
        continue
9512
 
      elif test "$rmforce" = yes; then
9513
 
        continue
9514
 
      fi
9515
 
 
9516
 
      rmfiles="$file"
9517
 
 
9518
 
      case $name in
9519
 
      *.la)
9520
 
        # Possibly a libtool archive, so verify it.
9521
 
        if func_lalib_p "$file"; then
9522
 
          func_source $dir/$name
9523
 
 
9524
 
          # Delete the libtool libraries and symlinks.
9525
 
          for n in $library_names; do
9526
 
            func_append rmfiles " $odir/$n"
9527
 
          done
9528
 
          test -n "$old_library" && func_append rmfiles " $odir/$old_library"
9529
 
 
9530
 
          case "$opt_mode" in
9531
 
          clean)
9532
 
            case " $library_names " in
9533
 
            *" $dlname "*) ;;
9534
 
            *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
9535
 
            esac
9536
 
            test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
9537
 
            ;;
9538
 
          uninstall)
9539
 
            if test -n "$library_names"; then
9540
 
              # Do each command in the postuninstall commands.
9541
 
              func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9542
 
            fi
9543
 
 
9544
 
            if test -n "$old_library"; then
9545
 
              # Do each command in the old_postuninstall commands.
9546
 
              func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9547
 
            fi
9548
 
            # FIXME: should reinstall the best remaining shared library.
9549
 
            ;;
9550
 
          esac
9551
 
        fi
9552
 
        ;;
9553
 
 
9554
 
      *.lo)
9555
 
        # Possibly a libtool object, so verify it.
9556
 
        if func_lalib_p "$file"; then
9557
 
 
9558
 
          # Read the .lo file
9559
 
          func_source $dir/$name
9560
 
 
9561
 
          # Add PIC object to the list of files to remove.
9562
 
          if test -n "$pic_object" &&
9563
 
             test "$pic_object" != none; then
9564
 
            func_append rmfiles " $dir/$pic_object"
9565
 
          fi
9566
 
 
9567
 
          # Add non-PIC object to the list of files to remove.
9568
 
          if test -n "$non_pic_object" &&
9569
 
             test "$non_pic_object" != none; then
9570
 
            func_append rmfiles " $dir/$non_pic_object"
9571
 
          fi
9572
 
        fi
9573
 
        ;;
9574
 
 
9575
 
      *)
9576
 
        if test "$opt_mode" = clean ; then
9577
 
          noexename=$name
9578
 
          case $file in
9579
 
          *.exe)
9580
 
            func_stripname '' '.exe' "$file"
9581
 
            file=$func_stripname_result
9582
 
            func_stripname '' '.exe' "$name"
9583
 
            noexename=$func_stripname_result
9584
 
            # $file with .exe has already been added to rmfiles,
9585
 
            # add $file without .exe
9586
 
            func_append rmfiles " $file"
9587
 
            ;;
9588
 
          esac
9589
 
          # Do a test to see if this is a libtool program.
9590
 
          if func_ltwrapper_p "$file"; then
9591
 
            if func_ltwrapper_executable_p "$file"; then
9592
 
              func_ltwrapper_scriptname "$file"
9593
 
              relink_command=
9594
 
              func_source $func_ltwrapper_scriptname_result
9595
 
              func_append rmfiles " $func_ltwrapper_scriptname_result"
9596
 
            else
9597
 
              relink_command=
9598
 
              func_source $dir/$noexename
9599
 
            fi
9600
 
 
9601
 
            # note $name still contains .exe if it was in $file originally
9602
 
            # as does the version of $file that was added into $rmfiles
9603
 
            func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
9604
 
            if test "$fast_install" = yes && test -n "$relink_command"; then
9605
 
              func_append rmfiles " $odir/lt-$name"
9606
 
            fi
9607
 
            if test "X$noexename" != "X$name" ; then
9608
 
              func_append rmfiles " $odir/lt-${noexename}.c"
9609
 
            fi
9610
 
          fi
9611
 
        fi
9612
 
        ;;
9613
 
      esac
9614
 
      func_show_eval "$RM $rmfiles" 'exit_status=1'
9615
 
    done
9616
 
 
9617
 
    # Try to remove the ${objdir}s in the directories where we deleted files
9618
 
    for dir in $rmdirs; do
9619
 
      if test -d "$dir"; then
9620
 
        func_show_eval "rmdir $dir >/dev/null 2>&1"
9621
 
      fi
9622
 
    done
9623
 
 
9624
 
    exit $exit_status
9625
 
}
9626
 
 
9627
 
{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
9628
 
    func_mode_uninstall ${1+"$@"}
9629
 
 
9630
 
test -z "$opt_mode" && {
9631
 
  help="$generic_help"
9632
 
  func_fatal_help "you must specify a MODE"
9633
 
}
9634
 
 
9635
 
test -z "$exec_cmd" && \
9636
 
  func_fatal_help "invalid operation mode \`$opt_mode'"
9637
 
 
9638
 
if test -n "$exec_cmd"; then
9639
 
  eval exec "$exec_cmd"
9640
 
  exit $EXIT_FAILURE
9641
 
fi
9642
 
 
9643
 
exit $exit_status
9644
 
 
9645
 
 
9646
 
# The TAGs below are defined such that we never get into a situation
9647
 
# in which we disable both kinds of libraries.  Given conflicting
9648
 
# choices, we go for a static library, that is the most portable,
9649
 
# since we can't tell whether shared libraries were disabled because
9650
 
# the user asked for that or because the platform doesn't support
9651
 
# them.  This is particularly important on AIX, because we don't
9652
 
# support having both static and shared libraries enabled at the same
9653
 
# time on that platform, so we default to a shared-only configuration.
9654
 
# If a disable-shared tag is given, we'll fallback to a static-only
9655
 
# configuration.  But we'll never go from static-only to shared-only.
9656
 
 
9657
 
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
9658
 
build_libtool_libs=no
9659
 
build_old_libs=yes
9660
 
# ### END LIBTOOL TAG CONFIG: disable-shared
9661
 
 
9662
 
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
9663
 
build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
9664
 
# ### END LIBTOOL TAG CONFIG: disable-static
9665
 
 
9666
 
# Local Variables:
9667
 
# mode:shell-script
9668
 
# sh-indentation:2
9669
 
# End:
9670
 
# vi:sw=2
9671