The R Project SVN R

Rev

Rev 48718 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 48718 Rev 68801
Line -... Line 1...
-
 
1
#! /bin/sh
1
# Generated from ltmain.m4sh.
2
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
-
 
3
##               by inline-source v2014-01-03.01
2
 
4
 
3
# ltmain.sh (GNU libtool) 2.2.6
5
# libtool (GNU libtool) 2.4.6
-
 
6
# Provide generalized library-building support services.
4
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5
 
8
 
6
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
9
# Copyright (C) 1996-2015 Free Software Foundation, Inc.
7
# This is free software; see the source for copying conditions.  There is NO
10
# This is free software; see the source for copying conditions.  There is NO
8
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
 
12
 
10
# GNU Libtool is free software; you can redistribute it and/or modify
13
# GNU Libtool is free software; you can redistribute it and/or modify
11
# it under the terms of the GNU General Public License as published by
14
# it under the terms of the GNU General Public License as published by
Line 21... Line 24...
21
# WITHOUT ANY WARRANTY; without even the implied warranty of
24
# WITHOUT ANY WARRANTY; without even the implied warranty of
22
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23
# General Public License for more details.
26
# General Public License for more details.
24
#
27
#
25
# You should have received a copy of the GNU General Public License
28
# You should have received a copy of the GNU General Public License
26
# along with GNU Libtool; see the file COPYING.  If not, a copy
-
 
27
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
29
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
28
# or obtained by writing to the Free Software Foundation, Inc.,
-
 
29
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
 
30
 
30
 
-
 
31
 
-
 
32
PROGRAM=libtool
-
 
33
PACKAGE=libtool
-
 
34
VERSION=2.4.6
-
 
35
package_revision=2.4.6
-
 
36
 
-
 
37
 
-
 
38
## ------ ##
-
 
39
## Usage. ##
-
 
40
## ------ ##
-
 
41
 
-
 
42
# Run './libtool --help' for help with using this script from the
-
 
43
# command line.
-
 
44
 
-
 
45
 
-
 
46
## ------------------------------- ##
-
 
47
## User overridable command paths. ##
-
 
48
## ------------------------------- ##
-
 
49
 
-
 
50
# After configure completes, it has a better idea of some of the
-
 
51
# shell tools we need than the defaults used by the functions shared
-
 
52
# with bootstrap, so set those here where they can still be over-
-
 
53
# ridden by the user, but otherwise take precedence.
-
 
54
 
-
 
55
: ${AUTOCONF="autoconf"}
-
 
56
: ${AUTOMAKE="automake"}
-
 
57
 
-
 
58
 
-
 
59
## -------------------------- ##
-
 
60
## Source external libraries. ##
-
 
61
## -------------------------- ##
-
 
62
 
-
 
63
# Much of our low-level functionality needs to be sourced from external
31
# Usage: $progname [OPTION]... [MODE-ARG]...
64
# libraries, which are installed to $pkgauxdir.
-
 
65
 
-
 
66
# Set a version string for this script.
-
 
67
scriptversion=2015-01-20.17; # UTC
-
 
68
 
-
 
69
# General shell script boiler plate, and helper functions.
-
 
70
# Written by Gary V. Vaughan, 2004
-
 
71
 
-
 
72
# Copyright (C) 2004-2015 Free Software Foundation, Inc.
-
 
73
# This is free software; see the source for copying conditions.  There is NO
-
 
74
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
 
75
 
-
 
76
# This program is free software; you can redistribute it and/or modify
-
 
77
# it under the terms of the GNU General Public License as published by
-
 
78
# the Free Software Foundation; either version 3 of the License, or
-
 
79
# (at your option) any later version.
-
 
80
 
-
 
81
# As a special exception to the GNU General Public License, if you distribute
-
 
82
# this file as part of a program or library that is built using GNU Libtool,
-
 
83
# you may include this file under the same distribution terms that you use
-
 
84
# for the rest of that program.
32
#
85
 
-
 
86
# This program is distributed in the hope that it will be useful,
-
 
87
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-
 
88
# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
33
# Provide generalized library-building support services.
89
# General Public License for more details.
-
 
90
 
-
 
91
# You should have received a copy of the GNU General Public License
-
 
92
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
 
93
 
-
 
94
# Please report bugs or propose patches to gary@gnu.org.
-
 
95
 
-
 
96
 
-
 
97
## ------ ##
-
 
98
## Usage. ##
-
 
99
## ------ ##
-
 
100
 
-
 
101
# Evaluate this file near the top of your script to gain access to
-
 
102
# the functions and variables defined here:
34
#
103
#
35
#     --config             show all configuration variables
104
#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
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
#     --tag=TAG            use configuration variables from tag TAG
-
 
43
# -v, --verbose            print informational messages (default)
-
 
44
#     --version            print version information
-
 
45
# -h, --help               print short or long help message
-
 
46
#
-
 
47
# MODE must be one of the following:
-
 
48
#
-
 
49
#       clean              remove files from the build directory
-
 
50
#       compile            compile a source file into a libtool object
-
 
51
#       execute            automatically set library path, then run a program
-
 
52
#       finish             complete the installation of libtool libraries
-
 
53
#       install            install libraries or executables
-
 
54
#       link               create a library or an executable
-
 
55
#       uninstall          remove libraries from an installed directory
-
 
56
#
-
 
57
# MODE-ARGS vary depending on the MODE.
-
 
58
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-
 
59
#
-
 
60
# When reporting a bug, please describe a test case to reproduce it and
-
 
61
# include the following information:
-
 
62
#
-
 
63
#       host-triplet:	$host
-
 
64
#       shell:		$SHELL
-
 
65
#       compiler:		$LTCC
-
 
66
#       compiler flags:		$LTCFLAGS
-
 
67
#       linker:		$LD (gnu? $with_gnu_ld)
-
 
68
#       $progname:		(GNU libtool) 2.2.6
-
 
69
#       automake:		$automake_version
-
 
70
#       autoconf:		$autoconf_version
-
 
71
#
105
#
-
 
106
# If you need to override any of the default environment variable
72
# Report bugs to <bug-libtool@gnu.org>.
107
# settings, do that before evaluating this file.
73
 
108
 
74
PROGRAM=ltmain.sh
-
 
75
PACKAGE=libtool
-
 
76
VERSION=2.2.6
-
 
77
TIMESTAMP=""
-
 
78
package_revision=1.3012
-
 
79
 
109
 
-
 
110
## -------------------- ##
80
# Be Bourne compatible
111
## Shell normalisation. ##
-
 
112
## -------------------- ##
-
 
113
 
-
 
114
# Some shells need a little help to be as Bourne compatible as possible.
-
 
115
# Before doing anything else, make sure all that help has been provided!
-
 
116
 
-
 
117
DUALCASE=1; export DUALCASE # for MKS sh
81
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
118
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
82
  emulate sh
119
  emulate sh
83
  NULLCMD=:
120
  NULLCMD=:
84
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
121
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
85
  # is contrary to our usage.  Disable this feature.
122
  # is contrary to our usage.  Disable this feature.
86
  alias -g '${1+"$@"}'='"$@"'
123
  alias -g '${1+"$@"}'='"$@"'
87
  setopt NO_GLOB_SUBST
124
  setopt NO_GLOB_SUBST
88
else
125
else
89
  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
126
  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
90
fi
127
fi
91
BIN_SH=xpg4; export BIN_SH # for Tru64
-
 
92
DUALCASE=1; export DUALCASE # for MKS sh
-
 
93
 
128
 
94
# NLS nuisances: We save the old values to restore during execute mode.
129
# NLS nuisances: We save the old values in case they are required later.
95
# Only set LANG and LC_ALL to C if already set.
-
 
96
# These must not be set unconditionally because not all systems understand
-
 
97
# e.g. LANG=C (notably SCO).
-
 
98
lt_user_locale=
130
_G_user_locale=
99
lt_safe_locale=
131
_G_safe_locale=
100
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
132
for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
101
do
133
do
102
  eval "if test \"\${$lt_var+set}\" = set; then
134
  eval "if test set = \"\${$_G_var+set}\"; then
103
          save_$lt_var=\$$lt_var
135
          save_$_G_var=\$$_G_var
104
          $lt_var=C
136
          $_G_var=C
105
	  export $lt_var
137
	  export $_G_var
106
	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
138
	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
107
	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
139
	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
108
	fi"
140
	fi"
109
done
141
done
110
 
142
 
111
$lt_unset CDPATH
143
# CDPATH.
-
 
144
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
 
145
 
-
 
146
# Make sure IFS has a sensible default
-
 
147
sp=' '
-
 
148
nl='
-
 
149
'
-
 
150
IFS="$sp	$nl"
-
 
151
 
-
 
152
# There are apparently some retarded systems that use ';' as a PATH separator!
-
 
153
if test "${PATH_SEPARATOR+set}" != set; then
-
 
154
  PATH_SEPARATOR=:
-
 
155
  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-
 
156
    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-
 
157
      PATH_SEPARATOR=';'
-
 
158
  }
-
 
159
fi
-
 
160
 
112
 
161
 
113
 
162
 
-
 
163
## ------------------------- ##
-
 
164
## Locate command utilities. ##
-
 
165
## ------------------------- ##
114
 
166
 
115
 
167
 
-
 
168
# func_executable_p FILE
-
 
169
# ----------------------
-
 
170
# Check that FILE is an executable regular file.
-
 
171
func_executable_p ()
-
 
172
{
-
 
173
    test -f "$1" && test -x "$1"
-
 
174
}
-
 
175
 
-
 
176
 
-
 
177
# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
-
 
178
# --------------------------------------------
-
 
179
# Search for either a program that responds to --version with output
-
 
180
# containing "GNU", or else returned by CHECK_FUNC otherwise, by
-
 
181
# trying all the directories in PATH with each of the elements of
-
 
182
# PROGS_LIST.
-
 
183
#
-
 
184
# CHECK_FUNC should accept the path to a candidate program, and
-
 
185
# set $func_check_prog_result if it truncates its output less than
-
 
186
# $_G_path_prog_max characters.
-
 
187
func_path_progs ()
-
 
188
{
-
 
189
    _G_progs_list=$1
-
 
190
    _G_check_func=$2
-
 
191
    _G_PATH=${3-"$PATH"}
-
 
192
 
-
 
193
    _G_path_prog_max=0
-
 
194
    _G_path_prog_found=false
-
 
195
    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
-
 
196
    for _G_dir in $_G_PATH; do
-
 
197
      IFS=$_G_save_IFS
-
 
198
      test -z "$_G_dir" && _G_dir=.
-
 
199
      for _G_prog_name in $_G_progs_list; do
-
 
200
        for _exeext in '' .EXE; do
-
 
201
          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
-
 
202
          func_executable_p "$_G_path_prog" || continue
-
 
203
          case `"$_G_path_prog" --version 2>&1` in
-
 
204
            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
-
 
205
            *)     $_G_check_func $_G_path_prog
-
 
206
		   func_path_progs_result=$func_check_prog_result
-
 
207
		   ;;
-
 
208
          esac
-
 
209
          $_G_path_prog_found && break 3
-
 
210
        done
-
 
211
      done
-
 
212
    done
-
 
213
    IFS=$_G_save_IFS
-
 
214
    test -z "$func_path_progs_result" && {
-
 
215
      echo "no acceptable sed could be found in \$PATH" >&2
-
 
216
      exit 1
-
 
217
    }
-
 
218
}
-
 
219
 
-
 
220
 
-
 
221
# We want to be able to use the functions in this file before configure
-
 
222
# has figured out where the best binaries are kept, which means we have
-
 
223
# to search for them ourselves - except when the results are already set
-
 
224
# where we skip the searches.
-
 
225
 
-
 
226
# Unless the user overrides by setting SED, search the path for either GNU
-
 
227
# sed, or the sed that truncates its output the least.
-
 
228
test -z "$SED" && {
-
 
229
  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-
 
230
  for _G_i in 1 2 3 4 5 6 7; do
-
 
231
    _G_sed_script=$_G_sed_script$nl$_G_sed_script
-
 
232
  done
-
 
233
  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
-
 
234
  _G_sed_script=
-
 
235
 
-
 
236
  func_check_prog_sed ()
-
 
237
  {
-
 
238
    _G_path_prog=$1
-
 
239
 
-
 
240
    _G_count=0
-
 
241
    printf 0123456789 >conftest.in
-
 
242
    while :
-
 
243
    do
-
 
244
      cat conftest.in conftest.in >conftest.tmp
-
 
245
      mv conftest.tmp conftest.in
-
 
246
      cp conftest.in conftest.nl
-
 
247
      echo '' >> conftest.nl
-
 
248
      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
-
 
249
      diff conftest.out conftest.nl >/dev/null 2>&1 || break
-
 
250
      _G_count=`expr $_G_count + 1`
-
 
251
      if test "$_G_count" -gt "$_G_path_prog_max"; then
-
 
252
        # Best one so far, save it but keep looking for a better one
-
 
253
        func_check_prog_result=$_G_path_prog
-
 
254
        _G_path_prog_max=$_G_count
-
 
255
      fi
-
 
256
      # 10*(2^10) chars as input seems more than enough
-
 
257
      test 10 -lt "$_G_count" && break
-
 
258
    done
-
 
259
    rm -f conftest.in conftest.tmp conftest.nl conftest.out
-
 
260
  }
-
 
261
 
-
 
262
  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
-
 
263
  rm -f conftest.sed
-
 
264
  SED=$func_path_progs_result
-
 
265
}
-
 
266
 
-
 
267
 
-
 
268
# Unless the user overrides by setting GREP, search the path for either GNU
-
 
269
# grep, or the grep that truncates its output the least.
-
 
270
test -z "$GREP" && {
-
 
271
  func_check_prog_grep ()
-
 
272
  {
-
 
273
    _G_path_prog=$1
-
 
274
 
-
 
275
    _G_count=0
-
 
276
    _G_path_prog_max=0
-
 
277
    printf 0123456789 >conftest.in
-
 
278
    while :
-
 
279
    do
-
 
280
      cat conftest.in conftest.in >conftest.tmp
-
 
281
      mv conftest.tmp conftest.in
-
 
282
      cp conftest.in conftest.nl
-
 
283
      echo 'GREP' >> conftest.nl
-
 
284
      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
-
 
285
      diff conftest.out conftest.nl >/dev/null 2>&1 || break
-
 
286
      _G_count=`expr $_G_count + 1`
-
 
287
      if test "$_G_count" -gt "$_G_path_prog_max"; then
-
 
288
        # Best one so far, save it but keep looking for a better one
-
 
289
        func_check_prog_result=$_G_path_prog
-
 
290
        _G_path_prog_max=$_G_count
-
 
291
      fi
-
 
292
      # 10*(2^10) chars as input seems more than enough
-
 
293
      test 10 -lt "$_G_count" && break
-
 
294
    done
-
 
295
    rm -f conftest.in conftest.tmp conftest.nl conftest.out
-
 
296
  }
-
 
297
 
-
 
298
  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
-
 
299
  GREP=$func_path_progs_result
-
 
300
}
-
 
301
 
-
 
302
 
-
 
303
## ------------------------------- ##
-
 
304
## User overridable command paths. ##
-
 
305
## ------------------------------- ##
-
 
306
 
-
 
307
# All uppercase variable names are used for environment variables.  These
-
 
308
# variables can be overridden by the user before calling a script that
-
 
309
# uses them if a suitable command of that name is not already available
-
 
310
# in the command search PATH.
116
 
311
 
117
: ${CP="cp -f"}
312
: ${CP="cp -f"}
118
: ${ECHO="echo"}
313
: ${ECHO="printf %s\n"}
119
: ${EGREP="/usr/bin/grep -E"}
314
: ${EGREP="$GREP -E"}
120
: ${FGREP="/usr/bin/grep -F"}
315
: ${FGREP="$GREP -F"}
121
: ${GREP="/usr/bin/grep"}
-
 
122
: ${LN_S="ln -s"}
316
: ${LN_S="ln -s"}
123
: ${MAKE="make"}
317
: ${MAKE="make"}
124
: ${MKDIR="mkdir"}
318
: ${MKDIR="mkdir"}
125
: ${MV="mv -f"}
319
: ${MV="mv -f"}
126
: ${RM="rm -f"}
320
: ${RM="rm -f"}
127
: ${SED="/opt/local/bin/gsed"}
-
 
128
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
321
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
129
: ${Xsed="$SED -e 1s/^X//"}
-
 
130
 
322
 
-
 
323
 
-
 
324
## -------------------- ##
-
 
325
## Useful sed snippets. ##
-
 
326
## -------------------- ##
-
 
327
 
-
 
328
sed_dirname='s|/[^/]*$||'
-
 
329
sed_basename='s|^.*/||'
-
 
330
 
-
 
331
# Sed substitution that helps us do robust quoting.  It backslashifies
-
 
332
# metacharacters that are still active within double-quoted strings.
-
 
333
sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
-
 
334
 
-
 
335
# Same as above, but do not quote variable references.
-
 
336
sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
 
337
 
-
 
338
# Sed substitution that turns a string into a regex matching for the
-
 
339
# string literally.
-
 
340
sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
-
 
341
 
-
 
342
# Sed substitution that converts a w32 file name or path
-
 
343
# that contains forward slashes, into one that contains
-
 
344
# (escaped) backslashes.  A very naive implementation.
-
 
345
sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
 
346
 
-
 
347
# Re-'\' parameter expansions in output of sed_double_quote_subst that
-
 
348
# were '\'-ed in input to the same.  If an odd number of '\' preceded a
-
 
349
# '$' in input to sed_double_quote_subst, that '$' was protected from
-
 
350
# expansion.  Since each input '\' is now two '\'s, look for any number
-
 
351
# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
-
 
352
_G_bs='\\'
-
 
353
_G_bs2='\\\\'
-
 
354
_G_bs4='\\\\\\\\'
-
 
355
_G_dollar='\$'
-
 
356
sed_double_backslash="\
-
 
357
  s/$_G_bs4/&\\
-
 
358
/g
-
 
359
  s/^$_G_bs2$_G_dollar/$_G_bs&/
-
 
360
  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
-
 
361
  s/\n//g"
-
 
362
 
-
 
363
 
-
 
364
## ----------------- ##
131
# Global variables:
365
## Global variables. ##
-
 
366
## ----------------- ##
-
 
367
 
-
 
368
# Except for the global variables explicitly listed below, the following
-
 
369
# functions in the '^func_' namespace, and the '^require_' namespace
-
 
370
# variables initialised in the 'Resource management' section, sourcing
-
 
371
# this file will not pollute your global namespace with anything
-
 
372
# else. There's no portable way to scope variables in Bourne shell
-
 
373
# though, so actually running these functions will sometimes place
-
 
374
# results into a variable named after the function, and often use
-
 
375
# temporary variables in the '^_G_' namespace. If you are careful to
-
 
376
# avoid using those namespaces casually in your sourcing script, things
-
 
377
# should continue to work as you expect. And, of course, you can freely
-
 
378
# overwrite any of the functions or variables defined here before
-
 
379
# calling anything to customize them.
-
 
380
 
132
EXIT_SUCCESS=0
381
EXIT_SUCCESS=0
133
EXIT_FAILURE=1
382
EXIT_FAILURE=1
134
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
383
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
135
EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
384
EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
136
 
385
 
137
exit_status=$EXIT_SUCCESS
-
 
138
 
-
 
139
# Make sure IFS has a sensible default
-
 
140
lt_nl='
-
 
141
'
-
 
142
IFS=" 	$lt_nl"
-
 
143
 
-
 
144
dirname="s,/[^/]*$,,"
-
 
145
basename="s,^.*/,,"
-
 
146
 
-
 
147
# func_dirname_and_basename file append nondir_replacement
-
 
148
# perform func_basename and func_dirname in a single function
386
# Allow overriding, eg assuming that you follow the convention of
149
# call:
-
 
150
#   dirname:  Compute the dirname of FILE.  If nonempty,
387
# putting '$debug_cmd' at the start of all your functions, you can get
151
#             add APPEND to the result, otherwise set result
-
 
152
#             to NONDIR_REPLACEMENT.
-
 
153
#             value returned in "$func_dirname_result"
-
 
154
#   basename: Compute filename of FILE.
388
# bash to show function call trace with:
155
#             value retuned in "$func_basename_result"
-
 
156
# Implementation must be kept synchronized with func_dirname
-
 
157
# and func_basename. For efficiency, we do not delegate to
-
 
158
# those functions but instead duplicate the functionality here.
-
 
159
func_dirname_and_basename ()
-
 
160
{
389
#
161
  # Extract subdirectory from the argument.
-
 
162
  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
390
#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
163
  if test "X$func_dirname_result" = "X${1}"; then
-
 
164
    func_dirname_result="${3}"
391
debug_cmd=${debug_cmd-":"}
165
  else
392
exit_cmd=:
166
    func_dirname_result="$func_dirname_result${2}"
-
 
167
  fi
-
 
168
  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-
 
169
}
-
 
170
 
393
 
171
# Generated shell functions inserted here.
394
# By convention, finish your script with:
-
 
395
#
-
 
396
#    exit $exit_status
-
 
397
#
-
 
398
# so that you can set exit_status to non-zero if you want to indicate
-
 
399
# something went wrong during execution without actually bailing out at
-
 
400
# the point of failure.
-
 
401
exit_status=$EXIT_SUCCESS
172
 
402
 
173
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
403
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
174
# is ksh but when the shell is invoked as "sh" and the current value of
404
# is ksh but when the shell is invoked as "sh" and the current value of
175
# the _XPG environment variable is not equal to 1 (one), the special
405
# the _XPG environment variable is not equal to 1 (one), the special
176
# positional parameter $0, within a function call, is the name of the
406
# positional parameter $0, within a function call, is the name of the
177
# function.
407
# function.
178
progpath="$0"
408
progpath=$0
179
 
409
 
180
# The name of this program:
410
# The name of this program.
181
# In the unlikely event $progname began with a '-', it would play havoc with
-
 
182
# func_echo (imagine progname=-n), so we prepend ./ in that case:
-
 
183
func_dirname_and_basename "$progpath"
-
 
184
progname=$func_basename_result
411
progname=`$ECHO "$progpath" |$SED "$sed_basename"`
185
case $progname in
-
 
186
  -*) progname=./$progname ;;
-
 
187
esac
-
 
188
 
412
 
189
# Make sure we have an absolute path for reexecution:
413
# Make sure we have an absolute progpath for reexecution:
190
case $progpath in
414
case $progpath in
191
  [\\/]*|[A-Za-z]:\\*) ;;
415
  [\\/]*|[A-Za-z]:\\*) ;;
192
  *[\\/]*)
416
  *[\\/]*)
193
     progdir=$func_dirname_result
417
     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
194
     progdir=`cd "$progdir" && pwd`
418
     progdir=`cd "$progdir" && pwd`
195
     progpath="$progdir/$progname"
419
     progpath=$progdir/$progname
196
     ;;
420
     ;;
197
  *)
421
  *)
198
     save_IFS="$IFS"
422
     _G_IFS=$IFS
199
     IFS=:
423
     IFS=${PATH_SEPARATOR-:}
200
     for progdir in $PATH; do
424
     for progdir in $PATH; do
201
       IFS="$save_IFS"
425
       IFS=$_G_IFS
202
       test -x "$progdir/$progname" && break
426
       test -x "$progdir/$progname" && break
203
     done
427
     done
204
     IFS="$save_IFS"
428
     IFS=$_G_IFS
205
     test -n "$progdir" || progdir=`pwd`
429
     test -n "$progdir" || progdir=`pwd`
206
     progpath="$progdir/$progname"
430
     progpath=$progdir/$progname
207
     ;;
431
     ;;
208
esac
432
esac
209
 
433
 
210
# Sed substitution that helps us do robust quoting.  It backslashifies
-
 
211
# metacharacters that are still active within double-quoted strings.
-
 
212
Xsed="${SED}"' -e 1s/^X//'
-
 
213
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
 
214
 
-
 
215
# Same as above, but do not quote variable references.
-
 
216
double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
 
217
 
434
 
218
# Re-`\' parameter expansions in output of double_quote_subst that were
-
 
219
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
-
 
220
# in input to double_quote_subst, that '$' was protected from expansion.
-
 
221
# Since each input `\' is now two `\'s, look for any number of runs of
-
 
222
# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
-
 
223
bs='\\'
-
 
224
bs2='\\\\'
-
 
225
bs4='\\\\\\\\'
435
## ----------------- ##
226
dollar='\$'
-
 
227
sed_double_backslash="\
436
## Standard options. ##
228
  s/$bs4/&\\
437
## ----------------- ##
229
/g
438
 
230
  s/^$bs2$dollar/$bs&/
439
# The following options affect the operation of the functions defined
231
  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
440
# below, and should be set appropriately depending on run-time para-
232
  s/\n//g"
441
# meters passed on the command line.
233
 
442
 
234
# Standard options:
-
 
235
opt_dry_run=false
443
opt_dry_run=false
236
opt_help=false
-
 
237
opt_quiet=false
444
opt_quiet=false
238
opt_verbose=false
445
opt_verbose=false
239
opt_warning=:
-
 
240
 
446
 
-
 
447
# Categories 'all' and 'none' are always available.  Append any others
-
 
448
# you will pass as the first argument to func_warning from your own
-
 
449
# code.
-
 
450
warning_categories=
-
 
451
 
-
 
452
# By default, display warnings according to 'opt_warning_types'.  Set
-
 
453
# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
-
 
454
# treat the next displayed warning as a fatal error.
-
 
455
warning_func=func_warn_and_continue
-
 
456
 
-
 
457
# Set to 'all' to display all warnings, 'none' to suppress all
-
 
458
# warnings, or a space delimited list of some subset of
-
 
459
# 'warning_categories' to display only the listed warnings.
-
 
460
opt_warning_types=all
-
 
461
 
-
 
462
 
-
 
463
## -------------------- ##
-
 
464
## Resource management. ##
-
 
465
## -------------------- ##
-
 
466
 
-
 
467
# This section contains definitions for functions that each ensure a
-
 
468
# particular resource (a file, or a non-empty configuration variable for
-
 
469
# example) is available, and if appropriate to extract default values
-
 
470
# from pertinent package files. Call them using their associated
-
 
471
# 'require_*' variable to ensure that they are executed, at most, once.
-
 
472
#
-
 
473
# It's entirely deliberate that calling these functions can set
-
 
474
# variables that don't obey the namespace limitations obeyed by the rest
-
 
475
# of this file, in order that that they be as useful as possible to
-
 
476
# callers.
-
 
477
 
-
 
478
 
-
 
479
# require_term_colors
-
 
480
# -------------------
-
 
481
# Allow display of bold text on terminals that support it.
-
 
482
require_term_colors=func_require_term_colors
-
 
483
func_require_term_colors ()
-
 
484
{
-
 
485
    $debug_cmd
-
 
486
 
-
 
487
    test -t 1 && {
-
 
488
      # COLORTERM and USE_ANSI_COLORS environment variables take
-
 
489
      # precedence, because most terminfo databases neglect to describe
-
 
490
      # whether color sequences are supported.
-
 
491
      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
-
 
492
 
-
 
493
      if test 1 = "$USE_ANSI_COLORS"; then
-
 
494
        # Standard ANSI escape sequences
-
 
495
        tc_reset=''
-
 
496
        tc_bold='';   tc_standout=''
-
 
497
        tc_red='';   tc_green=''
-
 
498
        tc_blue='';  tc_cyan=''
-
 
499
      else
-
 
500
        # Otherwise trust the terminfo database after all.
-
 
501
        test -n "`tput sgr0 2>/dev/null`" && {
-
 
502
          tc_reset=`tput sgr0`
-
 
503
          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
-
 
504
          tc_standout=$tc_bold
-
 
505
          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
-
 
506
          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
-
 
507
          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
-
 
508
          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
-
 
509
          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
-
 
510
        }
-
 
511
      fi
-
 
512
    }
-
 
513
 
-
 
514
    require_term_colors=:
-
 
515
}
-
 
516
 
-
 
517
 
-
 
518
## ----------------- ##
-
 
519
## Function library. ##
-
 
520
## ----------------- ##
-
 
521
 
-
 
522
# This section contains a variety of useful functions to call in your
-
 
523
# scripts. Take note of the portable wrappers for features provided by
-
 
524
# some modern shells, which will fall back to slower equivalents on
-
 
525
# less featureful shells.
-
 
526
 
-
 
527
 
-
 
528
# func_append VAR VALUE
-
 
529
# ---------------------
-
 
530
# Append VALUE onto the existing contents of VAR.
-
 
531
 
-
 
532
  # We should try to minimise forks, especially on Windows where they are
-
 
533
  # unreasonably slow, so skip the feature probes when bash or zsh are
-
 
534
  # being used:
-
 
535
  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
-
 
536
    : ${_G_HAVE_ARITH_OP="yes"}
-
 
537
    : ${_G_HAVE_XSI_OPS="yes"}
-
 
538
    # The += operator was introduced in bash 3.1
-
 
539
    case $BASH_VERSION in
-
 
540
      [12].* | 3.0 | 3.0*) ;;
-
 
541
      *)
-
 
542
        : ${_G_HAVE_PLUSEQ_OP="yes"}
-
 
543
        ;;
-
 
544
    esac
-
 
545
  fi
-
 
546
 
-
 
547
  # _G_HAVE_PLUSEQ_OP
-
 
548
  # Can be empty, in which case the shell is probed, "yes" if += is
-
 
549
  # useable or anything else if it does not work.
-
 
550
  test -z "$_G_HAVE_PLUSEQ_OP" \
-
 
551
    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
-
 
552
    && _G_HAVE_PLUSEQ_OP=yes
-
 
553
 
-
 
554
if test yes = "$_G_HAVE_PLUSEQ_OP"
-
 
555
then
-
 
556
  # This is an XSI compatible shell, allowing a faster implementation...
-
 
557
  eval 'func_append ()
-
 
558
  {
-
 
559
    $debug_cmd
-
 
560
 
-
 
561
    eval "$1+=\$2"
-
 
562
  }'
-
 
563
else
-
 
564
  # ...otherwise fall back to using expr, which is often a shell builtin.
-
 
565
  func_append ()
-
 
566
  {
-
 
567
    $debug_cmd
-
 
568
 
-
 
569
    eval "$1=\$$1\$2"
-
 
570
  }
-
 
571
fi
-
 
572
 
-
 
573
 
-
 
574
# func_append_quoted VAR VALUE
-
 
575
# ----------------------------
-
 
576
# Quote VALUE and append to the end of shell variable VAR, separated
-
 
577
# by a space.
-
 
578
if test yes = "$_G_HAVE_PLUSEQ_OP"; then
-
 
579
  eval 'func_append_quoted ()
-
 
580
  {
-
 
581
    $debug_cmd
-
 
582
 
-
 
583
    func_quote_for_eval "$2"
-
 
584
    eval "$1+=\\ \$func_quote_for_eval_result"
-
 
585
  }'
-
 
586
else
-
 
587
  func_append_quoted ()
-
 
588
  {
-
 
589
    $debug_cmd
-
 
590
 
-
 
591
    func_quote_for_eval "$2"
-
 
592
    eval "$1=\$$1\\ \$func_quote_for_eval_result"
-
 
593
  }
-
 
594
fi
-
 
595
 
-
 
596
 
-
 
597
# func_append_uniq VAR VALUE
-
 
598
# --------------------------
-
 
599
# Append unique VALUE onto the existing contents of VAR, assuming
-
 
600
# entries are delimited by the first character of VALUE.  For example:
-
 
601
#
-
 
602
#   func_append_uniq options " --another-option option-argument"
-
 
603
#
-
 
604
# will only append to $options if " --another-option option-argument "
-
 
605
# is not already present somewhere in $options already (note spaces at
-
 
606
# each end implied by leading space in second argument).
-
 
607
func_append_uniq ()
-
 
608
{
-
 
609
    $debug_cmd
-
 
610
 
-
 
611
    eval _G_current_value='`$ECHO $'$1'`'
-
 
612
    _G_delim=`expr "$2" : '\(.\)'`
-
 
613
 
-
 
614
    case $_G_delim$_G_current_value$_G_delim in
-
 
615
      *"$2$_G_delim"*) ;;
-
 
616
      *) func_append "$@" ;;
-
 
617
    esac
-
 
618
}
-
 
619
 
-
 
620
 
241
# func_echo arg...
621
# func_arith TERM...
-
 
622
# ------------------
-
 
623
# Set func_arith_result to the result of evaluating TERMs.
-
 
624
  test -z "$_G_HAVE_ARITH_OP" \
-
 
625
    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
-
 
626
    && _G_HAVE_ARITH_OP=yes
-
 
627
 
-
 
628
if test yes = "$_G_HAVE_ARITH_OP"; then
-
 
629
  eval 'func_arith ()
-
 
630
  {
-
 
631
    $debug_cmd
-
 
632
 
-
 
633
    func_arith_result=$(( $* ))
-
 
634
  }'
-
 
635
else
-
 
636
  func_arith ()
-
 
637
  {
-
 
638
    $debug_cmd
-
 
639
 
-
 
640
    func_arith_result=`expr "$@"`
-
 
641
  }
-
 
642
fi
-
 
643
 
-
 
644
 
-
 
645
# func_basename FILE
-
 
646
# ------------------
-
 
647
# Set func_basename_result to FILE with everything up to and including
-
 
648
# the last / stripped.
-
 
649
if test yes = "$_G_HAVE_XSI_OPS"; then
-
 
650
  # If this shell supports suffix pattern removal, then use it to avoid
242
# Echo program name prefixed message, along with the current mode
651
  # forking. Hide the definitions single quotes in case the shell chokes
-
 
652
  # on unsupported syntax...
-
 
653
  _b='func_basename_result=${1##*/}'
-
 
654
  _d='case $1 in
-
 
655
        */*) func_dirname_result=${1%/*}$2 ;;
-
 
656
        *  ) func_dirname_result=$3        ;;
-
 
657
      esac'
-
 
658
 
-
 
659
else
-
 
660
  # ...otherwise fall back to using sed.
-
 
661
  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
-
 
662
  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
-
 
663
      if test "X$func_dirname_result" = "X$1"; then
-
 
664
        func_dirname_result=$3
-
 
665
      else
-
 
666
        func_append func_dirname_result "$2"
-
 
667
      fi'
-
 
668
fi
-
 
669
 
-
 
670
eval 'func_basename ()
-
 
671
{
-
 
672
    $debug_cmd
-
 
673
 
-
 
674
    '"$_b"'
-
 
675
}'
-
 
676
 
-
 
677
 
-
 
678
# func_dirname FILE APPEND NONDIR_REPLACEMENT
-
 
679
# -------------------------------------------
-
 
680
# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-
 
681
# otherwise set result to NONDIR_REPLACEMENT.
-
 
682
eval 'func_dirname ()
-
 
683
{
-
 
684
    $debug_cmd
-
 
685
 
-
 
686
    '"$_d"'
-
 
687
}'
-
 
688
 
-
 
689
 
-
 
690
# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
-
 
691
# --------------------------------------------------------
-
 
692
# Perform func_basename and func_dirname in a single function
-
 
693
# call:
-
 
694
#   dirname:  Compute the dirname of FILE.  If nonempty,
-
 
695
#             add APPEND to the result, otherwise set result
-
 
696
#             to NONDIR_REPLACEMENT.
-
 
697
#             value returned in "$func_dirname_result"
-
 
698
#   basename: Compute filename of FILE.
-
 
699
#             value retuned in "$func_basename_result"
-
 
700
# For efficiency, we do not delegate to the functions above but instead
-
 
701
# duplicate the functionality here.
-
 
702
eval 'func_dirname_and_basename ()
-
 
703
{
-
 
704
    $debug_cmd
-
 
705
 
-
 
706
    '"$_b"'
-
 
707
    '"$_d"'
-
 
708
}'
-
 
709
 
-
 
710
 
-
 
711
# func_echo ARG...
-
 
712
# ----------------
243
# name if it has been set yet.
713
# Echo program name prefixed message.
244
func_echo ()
714
func_echo ()
245
{
715
{
-
 
716
    $debug_cmd
-
 
717
 
-
 
718
    _G_message=$*
-
 
719
 
-
 
720
    func_echo_IFS=$IFS
-
 
721
    IFS=$nl
-
 
722
    for _G_line in $_G_message; do
-
 
723
      IFS=$func_echo_IFS
246
    $ECHO "$progname${mode+: }$mode: $*"
724
      $ECHO "$progname: $_G_line"
-
 
725
    done
-
 
726
    IFS=$func_echo_IFS
247
}
727
}
248
 
728
 
-
 
729
 
249
# func_verbose arg...
730
# func_echo_all ARG...
-
 
731
# --------------------
250
# Echo program name prefixed message in verbose mode only.
732
# Invoke $ECHO with all args, space-separated.
251
func_verbose ()
733
func_echo_all ()
252
{
734
{
253
    $opt_verbose && func_echo ${1+"$@"}
735
    $ECHO "$*"
-
 
736
}
254
 
737
 
-
 
738
 
-
 
739
# func_echo_infix_1 INFIX ARG...
-
 
740
# ------------------------------
255
    # A bug in bash halts the script if the last line of a function
741
# Echo program name, followed by INFIX on the first line, with any
-
 
742
# additional lines not showing INFIX.
-
 
743
func_echo_infix_1 ()
-
 
744
{
-
 
745
    $debug_cmd
-
 
746
 
-
 
747
    $require_term_colors
-
 
748
 
-
 
749
    _G_infix=$1; shift
-
 
750
    _G_indent=$_G_infix
-
 
751
    _G_prefix="$progname: $_G_infix: "
-
 
752
    _G_message=$*
-
 
753
 
256
    # fails when set -e is in force, so we need another command to
754
    # Strip color escape sequences before counting printable length
-
 
755
    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
-
 
756
    do
257
    # work around that:
757
      test -n "$_G_tc" && {
-
 
758
        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
-
 
759
        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
258
    :
760
      }
-
 
761
    done
-
 
762
    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
-
 
763
 
-
 
764
    func_echo_infix_1_IFS=$IFS
-
 
765
    IFS=$nl
-
 
766
    for _G_line in $_G_message; do
-
 
767
      IFS=$func_echo_infix_1_IFS
-
 
768
      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
-
 
769
      _G_prefix=$_G_indent
-
 
770
    done
-
 
771
    IFS=$func_echo_infix_1_IFS
259
}
772
}
260
 
773
 
-
 
774
 
261
# func_error arg...
775
# func_error ARG...
-
 
776
# -----------------
262
# Echo program name prefixed message to standard error.
777
# Echo program name prefixed message to standard error.
263
func_error ()
778
func_error ()
264
{
779
{
265
    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
780
    $debug_cmd
266
}
-
 
267
 
781
 
268
# func_warning arg...
782
    $require_term_colors
269
# Echo program name prefixed warning message to standard error.
-
 
270
func_warning ()
-
 
271
{
-
 
272
    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
-
 
273
 
783
 
274
    # bash bug again:
784
    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
275
    :
-
 
276
}
785
}
277
 
786
 
-
 
787
 
278
# func_fatal_error arg...
788
# func_fatal_error ARG...
-
 
789
# -----------------------
279
# Echo program name prefixed message to standard error, and exit.
790
# Echo program name prefixed message to standard error, and exit.
280
func_fatal_error ()
791
func_fatal_error ()
281
{
792
{
282
    func_error ${1+"$@"}
-
 
283
    exit $EXIT_FAILURE
793
    $debug_cmd
284
}
-
 
285
 
794
 
286
# func_fatal_help arg...
-
 
287
# Echo program name prefixed message to standard error, followed by
-
 
288
# a help hint, and exit.
-
 
289
func_fatal_help ()
-
 
290
{
-
 
291
    func_error ${1+"$@"}
795
    func_error "$*"
292
    func_fatal_error "$help"
796
    exit $EXIT_FAILURE
293
}
797
}
294
help="Try \`$progname --help' for more information."  ## default
-
 
295
 
798
 
296
 
799
 
297
# func_grep expression filename
800
# func_grep EXPRESSION FILENAME
-
 
801
# -----------------------------
298
# Check whether EXPRESSION matches any line of FILENAME, without output.
802
# Check whether EXPRESSION matches any line of FILENAME, without output.
299
func_grep ()
803
func_grep ()
300
{
804
{
-
 
805
    $debug_cmd
-
 
806
 
301
    $GREP "$1" "$2" >/dev/null 2>&1
807
    $GREP "$1" "$2" >/dev/null 2>&1
302
}
808
}
303
 
809
 
304
 
810
 
-
 
811
# func_len STRING
-
 
812
# ---------------
-
 
813
# Set func_len_result to the length of STRING. STRING may not
-
 
814
# start with a hyphen.
-
 
815
  test -z "$_G_HAVE_XSI_OPS" \
-
 
816
    && (eval 'x=a/b/c;
-
 
817
      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
-
 
818
    && _G_HAVE_XSI_OPS=yes
-
 
819
 
-
 
820
if test yes = "$_G_HAVE_XSI_OPS"; then
-
 
821
  eval 'func_len ()
-
 
822
  {
-
 
823
    $debug_cmd
-
 
824
 
-
 
825
    func_len_result=${#1}
-
 
826
  }'
-
 
827
else
-
 
828
  func_len ()
-
 
829
  {
-
 
830
    $debug_cmd
-
 
831
 
-
 
832
    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
-
 
833
  }
-
 
834
fi
-
 
835
 
-
 
836
 
305
# func_mkdir_p directory-path
837
# func_mkdir_p DIRECTORY-PATH
-
 
838
# ---------------------------
306
# Make sure the entire path to DIRECTORY-PATH is available.
839
# Make sure the entire path to DIRECTORY-PATH is available.
307
func_mkdir_p ()
840
func_mkdir_p ()
308
{
841
{
-
 
842
    $debug_cmd
-
 
843
 
309
    my_directory_path="$1"
844
    _G_directory_path=$1
310
    my_dir_list=
845
    _G_dir_list=
311
 
846
 
312
    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
847
    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
313
 
848
 
314
      # Protect directory names starting with `-'
849
      # Protect directory names starting with '-'
315
      case $my_directory_path in
850
      case $_G_directory_path in
316
        -*) my_directory_path="./$my_directory_path" ;;
851
        -*) _G_directory_path=./$_G_directory_path ;;
317
      esac
852
      esac
318
 
853
 
319
      # While some portion of DIR does not yet exist...
854
      # While some portion of DIR does not yet exist...
320
      while test ! -d "$my_directory_path"; do
855
      while test ! -d "$_G_directory_path"; do
321
        # ...make a list in topmost first order.  Use a colon delimited
856
        # ...make a list in topmost first order.  Use a colon delimited
322
	# list incase some portion of path contains whitespace.
857
	# list incase some portion of path contains whitespace.
323
        my_dir_list="$my_directory_path:$my_dir_list"
858
        _G_dir_list=$_G_directory_path:$_G_dir_list
324
 
859
 
325
        # If the last portion added has no slash in it, the list is done
860
        # If the last portion added has no slash in it, the list is done
326
        case $my_directory_path in */*) ;; *) break ;; esac
861
        case $_G_directory_path in */*) ;; *) break ;; esac
327
 
862
 
328
        # ...otherwise throw away the child directory and loop
863
        # ...otherwise throw away the child directory and loop
329
        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
864
        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
330
      done
865
      done
331
      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
866
      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
332
 
867
 
333
      save_mkdir_p_IFS="$IFS"; IFS=':'
868
      func_mkdir_p_IFS=$IFS; IFS=:
334
      for my_dir in $my_dir_list; do
869
      for _G_dir in $_G_dir_list; do
335
	IFS="$save_mkdir_p_IFS"
870
	IFS=$func_mkdir_p_IFS
336
        # mkdir can fail with a `File exist' error if two processes
871
        # mkdir can fail with a 'File exist' error if two processes
337
        # try to create one of the directories concurrently.  Don't
872
        # try to create one of the directories concurrently.  Don't
338
        # stop in that case!
873
        # stop in that case!
339
        $MKDIR "$my_dir" 2>/dev/null || :
874
        $MKDIR "$_G_dir" 2>/dev/null || :
340
      done
875
      done
341
      IFS="$save_mkdir_p_IFS"
876
      IFS=$func_mkdir_p_IFS
342
 
877
 
343
      # Bail out if we (or some other process) failed to create a directory.
878
      # Bail out if we (or some other process) failed to create a directory.
344
      test -d "$my_directory_path" || \
879
      test -d "$_G_directory_path" || \
345
        func_fatal_error "Failed to create \`$1'"
880
        func_fatal_error "Failed to create '$1'"
346
    fi
881
    fi
347
}
882
}
348
 
883
 
349
 
884
 
350
# func_mktempdir [string]
885
# func_mktempdir [BASENAME]
-
 
886
# -------------------------
351
# Make a temporary directory that won't clash with other running
887
# Make a temporary directory that won't clash with other running
352
# libtool processes, and avoids race conditions if possible.  If
888
# libtool processes, and avoids race conditions if possible.  If
353
# given, STRING is the basename for that directory.
889
# given, BASENAME is the basename for that directory.
354
func_mktempdir ()
890
func_mktempdir ()
355
{
891
{
-
 
892
    $debug_cmd
-
 
893
 
356
    my_template="${TMPDIR-/tmp}/${1-$progname}"
894
    _G_template=${TMPDIR-/tmp}/${1-$progname}
357
 
895
 
358
    if test "$opt_dry_run" = ":"; then
896
    if test : = "$opt_dry_run"; then
359
      # Return a directory name, but don't create it in dry-run mode
897
      # Return a directory name, but don't create it in dry-run mode
360
      my_tmpdir="${my_template}-$$"
898
      _G_tmpdir=$_G_template-$$
361
    else
899
    else
362
 
900
 
363
      # If mktemp works, use that first and foremost
901
      # If mktemp works, use that first and foremost
364
      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
902
      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
365
 
903
 
366
      if test ! -d "$my_tmpdir"; then
904
      if test ! -d "$_G_tmpdir"; then
367
        # Failing that, at least try and use $RANDOM to avoid a race
905
        # Failing that, at least try and use $RANDOM to avoid a race
368
        my_tmpdir="${my_template}-${RANDOM-0}$$"
906
        _G_tmpdir=$_G_template-${RANDOM-0}$$
369
 
907
 
370
        save_mktempdir_umask=`umask`
908
        func_mktempdir_umask=`umask`
371
        umask 0077
909
        umask 0077
372
        $MKDIR "$my_tmpdir"
910
        $MKDIR "$_G_tmpdir"
373
        umask $save_mktempdir_umask
911
        umask $func_mktempdir_umask
374
      fi
912
      fi
375
 
913
 
376
      # If we're not in dry-run mode, bomb out on failure
914
      # If we're not in dry-run mode, bomb out on failure
377
      test -d "$my_tmpdir" || \
915
      test -d "$_G_tmpdir" || \
378
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
916
        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
379
    fi
917
    fi
380
 
918
 
381
    $ECHO "X$my_tmpdir" | $Xsed
919
    $ECHO "$_G_tmpdir"
382
}
920
}
383
 
921
 
384
 
922
 
385
# func_quote_for_eval arg
923
# func_normal_abspath PATH
386
# Aesthetically quote ARG to be evaled later.
924
# ------------------------
387
# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-
 
388
# is double-quoted, suitable for a subsequent eval, whereas
925
# Remove doubled-up and trailing slashes, "." path components,
389
# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
926
# and cancel out any ".." path components in PATH after making
390
# which are still active within double quotes backslashified.
927
# it an absolute path.
391
func_quote_for_eval ()
928
func_normal_abspath ()
392
{
929
{
393
    case $1 in
930
    $debug_cmd
-
 
931
 
-
 
932
    # These SED scripts presuppose an absolute path with a trailing slash.
-
 
933
    _G_pathcar='s|^/\([^/]*\).*$|\1|'
394
      *[\\\`\"\$]*)
934
    _G_pathcdr='s|^/[^/]*||'
395
	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
935
    _G_removedotparts=':dotsl
-
 
936
		s|/\./|/|g
396
      *)
937
		t dotsl
-
 
938
		s|/\.$|/|'
397
        func_quote_for_eval_unquoted_result="$1" ;;
939
    _G_collapseslashes='s|/\{1,\}|/|g'
398
    esac
940
    _G_finalslash='s|/*$|/|'
399
 
941
 
-
 
942
    # Start from root dir and reassemble the path.
-
 
943
    func_normal_abspath_result=
-
 
944
    func_normal_abspath_tpath=$1
-
 
945
    func_normal_abspath_altnamespace=
400
    case $func_quote_for_eval_unquoted_result in
946
    case $func_normal_abspath_tpath in
-
 
947
      "")
-
 
948
        # Empty path, that just means $cwd.
-
 
949
        func_stripname '' '/' "`pwd`"
-
 
950
        func_normal_abspath_result=$func_stripname_result
-
 
951
        return
-
 
952
        ;;
-
 
953
      # The next three entries are used to spot a run of precisely
401
      # Double-quote args containing shell metacharacters to delay
954
      # two leading slashes without using negated character classes;
402
      # word splitting, command substitution and and variable
955
      # we take advantage of case's first-match behaviour.
-
 
956
      ///*)
403
      # expansion for a subsequent eval.
957
        # Unusual form of absolute path, do nothing.
-
 
958
        ;;
-
 
959
      //*)
404
      # Many Bourne shells cannot handle close brackets correctly
960
        # Not necessarily an ordinary path; POSIX reserves leading '//'
405
      # in scan sets, so we specify it separately.
961
        # and for example Cygwin uses it to access remote file shares
406
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
962
        # over CIFS/SMB, so we conserve a leading double slash if found.
407
        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
963
        func_normal_abspath_altnamespace=/
-
 
964
        ;;
-
 
965
      /*)
-
 
966
        # Absolute path, do nothing.
408
        ;;
967
        ;;
409
      *)
968
      *)
-
 
969
        # Relative path, prepend $cwd.
410
        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
970
        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
-
 
971
        ;;
411
    esac
972
    esac
-
 
973
 
-
 
974
    # Cancel out all the simple stuff to save iterations.  We also want
-
 
975
    # the path to end with a slash for ease of parsing, so make sure
-
 
976
    # there is one (and only one) here.
-
 
977
    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-
 
978
          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
-
 
979
    while :; do
-
 
980
      # Processed it all yet?
-
 
981
      if test / = "$func_normal_abspath_tpath"; then
-
 
982
        # If we ascended to the root using ".." the result may be empty now.
-
 
983
        if test -z "$func_normal_abspath_result"; then
-
 
984
          func_normal_abspath_result=/
-
 
985
        fi
-
 
986
        break
-
 
987
      fi
-
 
988
      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-
 
989
          -e "$_G_pathcar"`
-
 
990
      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-
 
991
          -e "$_G_pathcdr"`
-
 
992
      # Figure out what to do with it
-
 
993
      case $func_normal_abspath_tcomponent in
-
 
994
        "")
-
 
995
          # Trailing empty path component, ignore it.
-
 
996
          ;;
-
 
997
        ..)
-
 
998
          # Parent dir; strip last assembled component from result.
-
 
999
          func_dirname "$func_normal_abspath_result"
-
 
1000
          func_normal_abspath_result=$func_dirname_result
-
 
1001
          ;;
-
 
1002
        *)
-
 
1003
          # Actual path component, append it.
-
 
1004
          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
-
 
1005
          ;;
-
 
1006
      esac
-
 
1007
    done
-
 
1008
    # Restore leading double-slash if one was found on entry.
-
 
1009
    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-
 
1010
}
-
 
1011
 
-
 
1012
 
-
 
1013
# func_notquiet ARG...
-
 
1014
# --------------------
-
 
1015
# Echo program name prefixed message only when not in quiet mode.
-
 
1016
func_notquiet ()
-
 
1017
{
-
 
1018
    $debug_cmd
-
 
1019
 
-
 
1020
    $opt_quiet || func_echo ${1+"$@"}
-
 
1021
 
-
 
1022
    # A bug in bash halts the script if the last line of a function
-
 
1023
    # fails when set -e is in force, so we need another command to
-
 
1024
    # work around that:
-
 
1025
    :
412
}
1026
}
413
 
1027
 
414
 
1028
 
-
 
1029
# func_relative_path SRCDIR DSTDIR
-
 
1030
# --------------------------------
-
 
1031
# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
-
 
1032
func_relative_path ()
-
 
1033
{
-
 
1034
    $debug_cmd
-
 
1035
 
-
 
1036
    func_relative_path_result=
-
 
1037
    func_normal_abspath "$1"
-
 
1038
    func_relative_path_tlibdir=$func_normal_abspath_result
-
 
1039
    func_normal_abspath "$2"
-
 
1040
    func_relative_path_tbindir=$func_normal_abspath_result
-
 
1041
 
-
 
1042
    # Ascend the tree starting from libdir
-
 
1043
    while :; do
-
 
1044
      # check if we have found a prefix of bindir
-
 
1045
      case $func_relative_path_tbindir in
-
 
1046
        $func_relative_path_tlibdir)
-
 
1047
          # found an exact match
-
 
1048
          func_relative_path_tcancelled=
-
 
1049
          break
-
 
1050
          ;;
-
 
1051
        $func_relative_path_tlibdir*)
-
 
1052
          # found a matching prefix
-
 
1053
          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
-
 
1054
          func_relative_path_tcancelled=$func_stripname_result
-
 
1055
          if test -z "$func_relative_path_result"; then
-
 
1056
            func_relative_path_result=.
-
 
1057
          fi
-
 
1058
          break
-
 
1059
          ;;
-
 
1060
        *)
-
 
1061
          func_dirname $func_relative_path_tlibdir
-
 
1062
          func_relative_path_tlibdir=$func_dirname_result
-
 
1063
          if test -z "$func_relative_path_tlibdir"; then
-
 
1064
            # Have to descend all the way to the root!
-
 
1065
            func_relative_path_result=../$func_relative_path_result
-
 
1066
            func_relative_path_tcancelled=$func_relative_path_tbindir
-
 
1067
            break
-
 
1068
          fi
-
 
1069
          func_relative_path_result=../$func_relative_path_result
-
 
1070
          ;;
-
 
1071
      esac
-
 
1072
    done
-
 
1073
 
-
 
1074
    # Now calculate path; take care to avoid doubling-up slashes.
-
 
1075
    func_stripname '' '/' "$func_relative_path_result"
-
 
1076
    func_relative_path_result=$func_stripname_result
-
 
1077
    func_stripname '/' '/' "$func_relative_path_tcancelled"
-
 
1078
    if test -n "$func_stripname_result"; then
-
 
1079
      func_append func_relative_path_result "/$func_stripname_result"
-
 
1080
    fi
-
 
1081
 
-
 
1082
    # Normalisation. If bindir is libdir, return '.' else relative path.
-
 
1083
    if test -n "$func_relative_path_result"; then
-
 
1084
      func_stripname './' '' "$func_relative_path_result"
-
 
1085
      func_relative_path_result=$func_stripname_result
-
 
1086
    fi
-
 
1087
 
-
 
1088
    test -n "$func_relative_path_result" || func_relative_path_result=.
-
 
1089
 
-
 
1090
    :
-
 
1091
}
-
 
1092
 
-
 
1093
 
-
 
1094
# func_quote_for_eval ARG...
-
 
1095
# --------------------------
-
 
1096
# Aesthetically quote ARGs to be evaled later.
-
 
1097
# This function returns two values:
-
 
1098
#   i) func_quote_for_eval_result
-
 
1099
#      double-quoted, suitable for a subsequent eval
-
 
1100
#  ii) func_quote_for_eval_unquoted_result
-
 
1101
#      has all characters that are still active within double
-
 
1102
#      quotes backslashified.
-
 
1103
func_quote_for_eval ()
-
 
1104
{
-
 
1105
    $debug_cmd
-
 
1106
 
-
 
1107
    func_quote_for_eval_unquoted_result=
-
 
1108
    func_quote_for_eval_result=
-
 
1109
    while test 0 -lt $#; do
-
 
1110
      case $1 in
-
 
1111
        *[\\\`\"\$]*)
-
 
1112
	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
-
 
1113
        *)
-
 
1114
          _G_unquoted_arg=$1 ;;
-
 
1115
      esac
-
 
1116
      if test -n "$func_quote_for_eval_unquoted_result"; then
-
 
1117
	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
-
 
1118
      else
-
 
1119
        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
-
 
1120
      fi
-
 
1121
 
-
 
1122
      case $_G_unquoted_arg in
-
 
1123
        # Double-quote args containing shell metacharacters to delay
-
 
1124
        # word splitting, command substitution and variable expansion
-
 
1125
        # for a subsequent eval.
-
 
1126
        # Many Bourne shells cannot handle close brackets correctly
-
 
1127
        # in scan sets, so we specify it separately.
-
 
1128
        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-
 
1129
          _G_quoted_arg=\"$_G_unquoted_arg\"
-
 
1130
          ;;
-
 
1131
        *)
-
 
1132
          _G_quoted_arg=$_G_unquoted_arg
-
 
1133
	  ;;
-
 
1134
      esac
-
 
1135
 
-
 
1136
      if test -n "$func_quote_for_eval_result"; then
-
 
1137
	func_append func_quote_for_eval_result " $_G_quoted_arg"
-
 
1138
      else
-
 
1139
        func_append func_quote_for_eval_result "$_G_quoted_arg"
-
 
1140
      fi
-
 
1141
      shift
-
 
1142
    done
-
 
1143
}
-
 
1144
 
-
 
1145
 
415
# func_quote_for_expand arg
1146
# func_quote_for_expand ARG
-
 
1147
# -------------------------
416
# Aesthetically quote ARG to be evaled later; same as above,
1148
# Aesthetically quote ARG to be evaled later; same as above,
417
# but do not quote variable references.
1149
# but do not quote variable references.
418
func_quote_for_expand ()
1150
func_quote_for_expand ()
419
{
1151
{
-
 
1152
    $debug_cmd
-
 
1153
 
420
    case $1 in
1154
    case $1 in
421
      *[\\\`\"]*)
1155
      *[\\\`\"]*)
422
	my_arg=`$ECHO "X$1" | $Xsed \
1156
	_G_arg=`$ECHO "$1" | $SED \
423
	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
1157
	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
424
      *)
1158
      *)
425
        my_arg="$1" ;;
1159
        _G_arg=$1 ;;
426
    esac
1160
    esac
427
 
1161
 
428
    case $my_arg in
1162
    case $_G_arg in
429
      # Double-quote args containing shell metacharacters to delay
1163
      # Double-quote args containing shell metacharacters to delay
430
      # word splitting and command substitution for a subsequent eval.
1164
      # word splitting and command substitution for a subsequent eval.
431
      # Many Bourne shells cannot handle close brackets correctly
1165
      # Many Bourne shells cannot handle close brackets correctly
432
      # in scan sets, so we specify it separately.
1166
      # in scan sets, so we specify it separately.
433
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1167
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
434
        my_arg="\"$my_arg\""
1168
        _G_arg=\"$_G_arg\"
435
        ;;
1169
        ;;
436
    esac
1170
    esac
437
 
1171
 
438
    func_quote_for_expand_result="$my_arg"
1172
    func_quote_for_expand_result=$_G_arg
439
}
1173
}
440
 
1174
 
441
 
1175
 
-
 
1176
# func_stripname PREFIX SUFFIX NAME
-
 
1177
# ---------------------------------
-
 
1178
# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
-
 
1179
# PREFIX and SUFFIX must not contain globbing or regex special
-
 
1180
# characters, hashes, percent signs, but SUFFIX may contain a leading
-
 
1181
# dot (in which case that matches only a dot).
-
 
1182
if test yes = "$_G_HAVE_XSI_OPS"; then
-
 
1183
  eval 'func_stripname ()
-
 
1184
  {
-
 
1185
    $debug_cmd
-
 
1186
 
-
 
1187
    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-
 
1188
    # positional parameters, so assign one to ordinary variable first.
-
 
1189
    func_stripname_result=$3
-
 
1190
    func_stripname_result=${func_stripname_result#"$1"}
-
 
1191
    func_stripname_result=${func_stripname_result%"$2"}
-
 
1192
  }'
-
 
1193
else
-
 
1194
  func_stripname ()
-
 
1195
  {
-
 
1196
    $debug_cmd
-
 
1197
 
-
 
1198
    case $2 in
-
 
1199
      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
-
 
1200
      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
-
 
1201
    esac
-
 
1202
  }
-
 
1203
fi
-
 
1204
 
-
 
1205
 
442
# func_show_eval cmd [fail_exp]
1206
# func_show_eval CMD [FAIL_EXP]
-
 
1207
# -----------------------------
443
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
1208
# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
444
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
1209
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
445
# is given, then evaluate it.
1210
# is given, then evaluate it.
446
func_show_eval ()
1211
func_show_eval ()
447
{
1212
{
448
    my_cmd="$1"
1213
    $debug_cmd
449
    my_fail_exp="${2-:}"
-
 
450
 
1214
 
451
    ${opt_silent-false} || {
1215
    _G_cmd=$1
452
      func_quote_for_expand "$my_cmd"
1216
    _G_fail_exp=${2-':'}
453
      eval "func_echo $func_quote_for_expand_result"
-
 
454
    }
-
 
455
 
1217
 
-
 
1218
    func_quote_for_expand "$_G_cmd"
-
 
1219
    eval "func_notquiet $func_quote_for_expand_result"
-
 
1220
 
456
    if ${opt_dry_run-false}; then :; else
1221
    $opt_dry_run || {
457
      eval "$my_cmd"
1222
      eval "$_G_cmd"
458
      my_status=$?
1223
      _G_status=$?
459
      if test "$my_status" -eq 0; then :; else
1224
      if test 0 -ne "$_G_status"; then
460
	eval "(exit $my_status); $my_fail_exp"
1225
	eval "(exit $_G_status); $_G_fail_exp"
461
      fi
1226
      fi
462
    fi
1227
    }
463
}
1228
}
464
 
1229
 
465
 
1230
 
466
# func_show_eval_locale cmd [fail_exp]
1231
# func_show_eval_locale CMD [FAIL_EXP]
-
 
1232
# ------------------------------------
467
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
1233
# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
468
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
1234
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
469
# is given, then evaluate it.  Use the saved locale for evaluation.
1235
# is given, then evaluate it.  Use the saved locale for evaluation.
470
func_show_eval_locale ()
1236
func_show_eval_locale ()
471
{
1237
{
-
 
1238
    $debug_cmd
-
 
1239
 
472
    my_cmd="$1"
1240
    _G_cmd=$1
473
    my_fail_exp="${2-:}"
1241
    _G_fail_exp=${2-':'}
474
 
1242
 
475
    ${opt_silent-false} || {
1243
    $opt_quiet || {
476
      func_quote_for_expand "$my_cmd"
1244
      func_quote_for_expand "$_G_cmd"
477
      eval "func_echo $func_quote_for_expand_result"
1245
      eval "func_echo $func_quote_for_expand_result"
478
    }
1246
    }
479
 
1247
 
480
    if ${opt_dry_run-false}; then :; else
1248
    $opt_dry_run || {
481
      eval "$lt_user_locale
1249
      eval "$_G_user_locale
482
	    $my_cmd"
1250
	    $_G_cmd"
483
      my_status=$?
1251
      _G_status=$?
484
      eval "$lt_safe_locale"
1252
      eval "$_G_safe_locale"
485
      if test "$my_status" -eq 0; then :; else
1253
      if test 0 -ne "$_G_status"; then
486
	eval "(exit $my_status); $my_fail_exp"
1254
	eval "(exit $_G_status); $_G_fail_exp"
487
      fi
1255
      fi
488
    fi
1256
    }
489
}
1257
}
490
 
1258
 
491
 
1259
 
-
 
1260
# func_tr_sh
-
 
1261
# ----------
-
 
1262
# Turn $1 into a string suitable for a shell variable name.
-
 
1263
# Result is stored in $func_tr_sh_result.  All characters
-
 
1264
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-
 
1265
# if $1 begins with a digit, a '_' is prepended as well.
-
 
1266
func_tr_sh ()
-
 
1267
{
-
 
1268
    $debug_cmd
492
 
1269
 
-
 
1270
    case $1 in
-
 
1271
    [0-9]* | *[!a-zA-Z0-9_]*)
-
 
1272
      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
-
 
1273
      ;;
-
 
1274
    * )
-
 
1275
      func_tr_sh_result=$1
-
 
1276
      ;;
-
 
1277
    esac
-
 
1278
}
493
 
1279
 
494
 
1280
 
495
# func_version
1281
# func_verbose ARG...
-
 
1282
# -------------------
496
# Echo version message to standard output and exit.
1283
# Echo program name prefixed message in verbose mode only.
497
func_version ()
1284
func_verbose ()
498
{
1285
{
499
    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
-
 
500
        s/^# //
1286
    $debug_cmd
501
	s/^# *$//
1287
 
502
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1288
    $opt_verbose && func_echo "$*"
503
        p
1289
 
504
     }' < "$progpath"
-
 
505
     exit $?
1290
    :
506
}
1291
}
507
 
1292
 
-
 
1293
 
508
# func_usage
1294
# func_warn_and_continue ARG...
-
 
1295
# -----------------------------
509
# Echo short help message to standard output and exit.
1296
# Echo program name prefixed warning message to standard error.
510
func_usage ()
1297
func_warn_and_continue ()
511
{
1298
{
-
 
1299
    $debug_cmd
-
 
1300
 
-
 
1301
    $require_term_colors
-
 
1302
 
-
 
1303
    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
-
 
1304
}
-
 
1305
 
-
 
1306
 
-
 
1307
# func_warning CATEGORY ARG...
-
 
1308
# ----------------------------
-
 
1309
# Echo program name prefixed warning message to standard error. Warning
-
 
1310
# messages can be filtered according to CATEGORY, where this function
-
 
1311
# elides messages where CATEGORY is not listed in the global variable
-
 
1312
# 'opt_warning_types'.
-
 
1313
func_warning ()
-
 
1314
{
-
 
1315
    $debug_cmd
-
 
1316
 
-
 
1317
    # CATEGORY must be in the warning_categories list!
512
    $SED -n '/^# Usage:/,/# -h/ {
1318
    case " $warning_categories " in
513
        s/^# //
1319
      *" $1 "*) ;;
-
 
1320
      *) func_internal_error "invalid warning category '$1'" ;;
514
	s/^# *$//
1321
    esac
-
 
1322
 
515
	s/\$progname/'$progname'/
1323
    _G_category=$1
-
 
1324
    shift
516
	p
1325
 
517
    }' < "$progpath"
1326
    case " $opt_warning_types " in
-
 
1327
      *" $_G_category "*) $warning_func ${1+"$@"} ;;
518
    $ECHO
1328
    esac
-
 
1329
}
-
 
1330
 
-
 
1331
 
-
 
1332
# func_sort_ver VER1 VER2
-
 
1333
# -----------------------
-
 
1334
# 'sort -V' is not generally available.
-
 
1335
# Note this deviates from the version comparison in automake
-
 
1336
# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
-
 
1337
# but this should suffice as we won't be specifying old
-
 
1338
# version formats or redundant trailing .0 in bootstrap.conf.
-
 
1339
# If we did want full compatibility then we should probably
-
 
1340
# use m4_version_compare from autoconf.
-
 
1341
func_sort_ver ()
-
 
1342
{
-
 
1343
    $debug_cmd
-
 
1344
 
-
 
1345
    printf '%s\n%s\n' "$1" "$2" \
-
 
1346
      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
-
 
1347
}
-
 
1348
 
-
 
1349
# func_lt_ver PREV CURR
-
 
1350
# ---------------------
-
 
1351
# Return true if PREV and CURR are in the correct order according to
-
 
1352
# func_sort_ver, otherwise false.  Use it like this:
-
 
1353
#
-
 
1354
#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
-
 
1355
func_lt_ver ()
-
 
1356
{
-
 
1357
    $debug_cmd
-
 
1358
 
-
 
1359
    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
-
 
1360
}
-
 
1361
 
-
 
1362
 
-
 
1363
# Local variables:
-
 
1364
# mode: shell-script
-
 
1365
# sh-indentation: 2
-
 
1366
# eval: (add-hook 'before-save-hook 'time-stamp)
-
 
1367
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
-
 
1368
# time-stamp-time-zone: "UTC"
-
 
1369
# End:
-
 
1370
#! /bin/sh
-
 
1371
 
-
 
1372
# Set a version string for this script.
-
 
1373
scriptversion=2014-01-07.03; # UTC
-
 
1374
 
-
 
1375
# A portable, pluggable option parser for Bourne shell.
-
 
1376
# Written by Gary V. Vaughan, 2010
-
 
1377
 
-
 
1378
# Copyright (C) 2010-2015 Free Software Foundation, Inc.
-
 
1379
# This is free software; see the source for copying conditions.  There is NO
-
 
1380
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
 
1381
 
-
 
1382
# This program is free software: you can redistribute it and/or modify
-
 
1383
# it under the terms of the GNU General Public License as published by
-
 
1384
# the Free Software Foundation, either version 3 of the License, or
-
 
1385
# (at your option) any later version.
-
 
1386
 
-
 
1387
# This program is distributed in the hope that it will be useful,
-
 
1388
# but WITHOUT ANY WARRANTY; without even the implied warranty of
-
 
1389
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-
 
1390
# GNU General Public License for more details.
-
 
1391
 
-
 
1392
# You should have received a copy of the GNU General Public License
-
 
1393
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
 
1394
 
-
 
1395
# Please report bugs or propose patches to gary@gnu.org.
-
 
1396
 
-
 
1397
 
-
 
1398
## ------ ##
-
 
1399
## Usage. ##
-
 
1400
## ------ ##
-
 
1401
 
-
 
1402
# This file is a library for parsing options in your shell scripts along
-
 
1403
# with assorted other useful supporting features that you can make use
-
 
1404
# of too.
-
 
1405
#
-
 
1406
# For the simplest scripts you might need only:
-
 
1407
#
-
 
1408
#   #!/bin/sh
-
 
1409
#   . relative/path/to/funclib.sh
-
 
1410
#   . relative/path/to/options-parser
-
 
1411
#   scriptversion=1.0
-
 
1412
#   func_options ${1+"$@"}
-
 
1413
#   eval set dummy "$func_options_result"; shift
-
 
1414
#   ...rest of your script...
-
 
1415
#
-
 
1416
# In order for the '--version' option to work, you will need to have a
-
 
1417
# suitably formatted comment like the one at the top of this file
-
 
1418
# starting with '# Written by ' and ending with '# warranty; '.
-
 
1419
#
-
 
1420
# For '-h' and '--help' to work, you will also need a one line
-
 
1421
# description of your script's purpose in a comment directly above the
-
 
1422
# '# Written by ' line, like the one at the top of this file.
-
 
1423
#
-
 
1424
# The default options also support '--debug', which will turn on shell
-
 
1425
# execution tracing (see the comment above debug_cmd below for another
-
 
1426
# use), and '--verbose' and the func_verbose function to allow your script
-
 
1427
# to display verbose messages only when your user has specified
-
 
1428
# '--verbose'.
-
 
1429
#
-
 
1430
# After sourcing this file, you can plug processing for additional
-
 
1431
# options by amending the variables from the 'Configuration' section
-
 
1432
# below, and following the instructions in the 'Option parsing'
-
 
1433
# section further down.
-
 
1434
 
-
 
1435
## -------------- ##
-
 
1436
## Configuration. ##
-
 
1437
## -------------- ##
-
 
1438
 
-
 
1439
# You should override these variables in your script after sourcing this
-
 
1440
# file so that they reflect the customisations you have added to the
-
 
1441
# option parser.
-
 
1442
 
-
 
1443
# The usage line for option parsing errors and the start of '-h' and
-
 
1444
# '--help' output messages. You can embed shell variables for delayed
-
 
1445
# expansion at the time the message is displayed, but you will need to
-
 
1446
# quote other shell meta-characters carefully to prevent them being
-
 
1447
# expanded when the contents are evaled.
-
 
1448
usage='$progpath [OPTION]...'
-
 
1449
 
-
 
1450
# Short help message in response to '-h' and '--help'.  Add to this or
-
 
1451
# override it after sourcing this library to reflect the full set of
-
 
1452
# options your script accepts.
-
 
1453
usage_message="\
-
 
1454
       --debug        enable verbose shell tracing
-
 
1455
   -W, --warnings=CATEGORY
-
 
1456
                      report the warnings falling in CATEGORY [all]
-
 
1457
   -v, --verbose      verbosely report processing
-
 
1458
       --version      print version information and exit
-
 
1459
   -h, --help         print short or long help message and exit
-
 
1460
"
-
 
1461
 
-
 
1462
# Additional text appended to 'usage_message' in response to '--help'.
-
 
1463
long_help_message="
-
 
1464
Warning categories include:
-
 
1465
       'all'          show all warnings
-
 
1466
       'none'         turn off all the warnings
-
 
1467
       'error'        warnings are treated as fatal errors"
-
 
1468
 
-
 
1469
# Help message printed before fatal option parsing errors.
519
    $ECHO "run \`$progname --help | more' for full usage"
1470
fatal_help="Try '\$progname --help' for more information."
-
 
1471
 
-
 
1472
 
-
 
1473
 
-
 
1474
## ------------------------- ##
-
 
1475
## Hook function management. ##
-
 
1476
## ------------------------- ##
-
 
1477
 
-
 
1478
# This section contains functions for adding, removing, and running hooks
-
 
1479
# to the main code.  A hook is just a named list of of function, that can
-
 
1480
# be run in order later on.
-
 
1481
 
-
 
1482
# func_hookable FUNC_NAME
-
 
1483
# -----------------------
-
 
1484
# Declare that FUNC_NAME will run hooks added with
-
 
1485
# 'func_add_hook FUNC_NAME ...'.
-
 
1486
func_hookable ()
-
 
1487
{
520
    exit $?
1488
    $debug_cmd
-
 
1489
 
-
 
1490
    func_append hookable_fns " $1"
521
}
1491
}
522
 
1492
 
-
 
1493
 
-
 
1494
# func_add_hook FUNC_NAME HOOK_FUNC
-
 
1495
# ---------------------------------
-
 
1496
# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
-
 
1497
# first have been declared "hookable" by a call to 'func_hookable'.
-
 
1498
func_add_hook ()
-
 
1499
{
-
 
1500
    $debug_cmd
-
 
1501
 
-
 
1502
    case " $hookable_fns " in
-
 
1503
      *" $1 "*) ;;
-
 
1504
      *) func_fatal_error "'$1' does not accept hook functions." ;;
-
 
1505
    esac
-
 
1506
 
-
 
1507
    eval func_append ${1}_hooks '" $2"'
-
 
1508
}
-
 
1509
 
-
 
1510
 
-
 
1511
# func_remove_hook FUNC_NAME HOOK_FUNC
-
 
1512
# ------------------------------------
-
 
1513
# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
-
 
1514
func_remove_hook ()
-
 
1515
{
-
 
1516
    $debug_cmd
-
 
1517
 
-
 
1518
    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
-
 
1519
}
-
 
1520
 
-
 
1521
 
-
 
1522
# func_run_hooks FUNC_NAME [ARG]...
-
 
1523
# ---------------------------------
-
 
1524
# Run all hook functions registered to FUNC_NAME.
-
 
1525
# It is assumed that the list of hook functions contains nothing more
-
 
1526
# than a whitespace-delimited list of legal shell function names, and
-
 
1527
# no effort is wasted trying to catch shell meta-characters or preserve
-
 
1528
# whitespace.
-
 
1529
func_run_hooks ()
-
 
1530
{
-
 
1531
    $debug_cmd
-
 
1532
 
-
 
1533
    case " $hookable_fns " in
-
 
1534
      *" $1 "*) ;;
-
 
1535
      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
-
 
1536
    esac
-
 
1537
 
-
 
1538
    eval _G_hook_fns=\$$1_hooks; shift
-
 
1539
 
-
 
1540
    for _G_hook in $_G_hook_fns; do
-
 
1541
      eval $_G_hook '"$@"'
-
 
1542
 
-
 
1543
      # store returned options list back into positional
-
 
1544
      # parameters for next 'cmd' execution.
-
 
1545
      eval _G_hook_result=\$${_G_hook}_result
-
 
1546
      eval set dummy "$_G_hook_result"; shift
-
 
1547
    done
-
 
1548
 
-
 
1549
    func_quote_for_eval ${1+"$@"}
-
 
1550
    func_run_hooks_result=$func_quote_for_eval_result
-
 
1551
}
-
 
1552
 
-
 
1553
 
-
 
1554
 
-
 
1555
## --------------- ##
-
 
1556
## Option parsing. ##
-
 
1557
## --------------- ##
-
 
1558
 
-
 
1559
# In order to add your own option parsing hooks, you must accept the
-
 
1560
# full positional parameter list in your hook function, remove any
-
 
1561
# options that you action, and then pass back the remaining unprocessed
-
 
1562
# options in '<hooked_function_name>_result', escaped suitably for
-
 
1563
# 'eval'.  Like this:
-
 
1564
#
-
 
1565
#    my_options_prep ()
-
 
1566
#    {
-
 
1567
#        $debug_cmd
-
 
1568
#
-
 
1569
#        # Extend the existing usage message.
-
 
1570
#        usage_message=$usage_message'
-
 
1571
#      -s, --silent       don'\''t print informational messages
-
 
1572
#    '
-
 
1573
#
-
 
1574
#        func_quote_for_eval ${1+"$@"}
-
 
1575
#        my_options_prep_result=$func_quote_for_eval_result
-
 
1576
#    }
-
 
1577
#    func_add_hook func_options_prep my_options_prep
-
 
1578
#
-
 
1579
#
-
 
1580
#    my_silent_option ()
-
 
1581
#    {
-
 
1582
#        $debug_cmd
-
 
1583
#
-
 
1584
#        # Note that for efficiency, we parse as many options as we can
-
 
1585
#        # recognise in a loop before passing the remainder back to the
-
 
1586
#        # caller on the first unrecognised argument we encounter.
-
 
1587
#        while test $# -gt 0; do
-
 
1588
#          opt=$1; shift
-
 
1589
#          case $opt in
-
 
1590
#            --silent|-s) opt_silent=: ;;
-
 
1591
#            # Separate non-argument short options:
-
 
1592
#            -s*)         func_split_short_opt "$_G_opt"
-
 
1593
#                         set dummy "$func_split_short_opt_name" \
-
 
1594
#                             "-$func_split_short_opt_arg" ${1+"$@"}
-
 
1595
#                         shift
-
 
1596
#                         ;;
-
 
1597
#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
-
 
1598
#          esac
-
 
1599
#        done
-
 
1600
#
-
 
1601
#        func_quote_for_eval ${1+"$@"}
-
 
1602
#        my_silent_option_result=$func_quote_for_eval_result
-
 
1603
#    }
-
 
1604
#    func_add_hook func_parse_options my_silent_option
-
 
1605
#
-
 
1606
#
-
 
1607
#    my_option_validation ()
-
 
1608
#    {
-
 
1609
#        $debug_cmd
-
 
1610
#
-
 
1611
#        $opt_silent && $opt_verbose && func_fatal_help "\
-
 
1612
#    '--silent' and '--verbose' options are mutually exclusive."
-
 
1613
#
-
 
1614
#        func_quote_for_eval ${1+"$@"}
-
 
1615
#        my_option_validation_result=$func_quote_for_eval_result
-
 
1616
#    }
-
 
1617
#    func_add_hook func_validate_options my_option_validation
-
 
1618
#
-
 
1619
# You'll alse need to manually amend $usage_message to reflect the extra
-
 
1620
# options you parse.  It's preferable to append if you can, so that
-
 
1621
# multiple option parsing hooks can be added safely.
-
 
1622
 
-
 
1623
 
-
 
1624
# func_options [ARG]...
-
 
1625
# ---------------------
-
 
1626
# All the functions called inside func_options are hookable. See the
-
 
1627
# individual implementations for details.
-
 
1628
func_hookable func_options
-
 
1629
func_options ()
-
 
1630
{
-
 
1631
    $debug_cmd
-
 
1632
 
-
 
1633
    func_options_prep ${1+"$@"}
-
 
1634
    eval func_parse_options \
-
 
1635
        ${func_options_prep_result+"$func_options_prep_result"}
-
 
1636
    eval func_validate_options \
-
 
1637
        ${func_parse_options_result+"$func_parse_options_result"}
-
 
1638
 
-
 
1639
    eval func_run_hooks func_options \
-
 
1640
        ${func_validate_options_result+"$func_validate_options_result"}
-
 
1641
 
-
 
1642
    # save modified positional parameters for caller
-
 
1643
    func_options_result=$func_run_hooks_result
-
 
1644
}
-
 
1645
 
-
 
1646
 
-
 
1647
# func_options_prep [ARG]...
-
 
1648
# --------------------------
-
 
1649
# All initialisations required before starting the option parse loop.
-
 
1650
# Note that when calling hook functions, we pass through the list of
-
 
1651
# positional parameters.  If a hook function modifies that list, and
-
 
1652
# needs to propogate that back to rest of this script, then the complete
-
 
1653
# modified list must be put in 'func_run_hooks_result' before
-
 
1654
# returning.
-
 
1655
func_hookable func_options_prep
-
 
1656
func_options_prep ()
-
 
1657
{
-
 
1658
    $debug_cmd
-
 
1659
 
-
 
1660
    # Option defaults:
-
 
1661
    opt_verbose=false
-
 
1662
    opt_warning_types=
-
 
1663
 
-
 
1664
    func_run_hooks func_options_prep ${1+"$@"}
-
 
1665
 
-
 
1666
    # save modified positional parameters for caller
-
 
1667
    func_options_prep_result=$func_run_hooks_result
-
 
1668
}
-
 
1669
 
-
 
1670
 
-
 
1671
# func_parse_options [ARG]...
-
 
1672
# ---------------------------
-
 
1673
# The main option parsing loop.
-
 
1674
func_hookable func_parse_options
-
 
1675
func_parse_options ()
-
 
1676
{
-
 
1677
    $debug_cmd
-
 
1678
 
-
 
1679
    func_parse_options_result=
-
 
1680
 
-
 
1681
    # this just eases exit handling
-
 
1682
    while test $# -gt 0; do
-
 
1683
      # Defer to hook functions for initial option parsing, so they
-
 
1684
      # get priority in the event of reusing an option name.
-
 
1685
      func_run_hooks func_parse_options ${1+"$@"}
-
 
1686
 
-
 
1687
      # Adjust func_parse_options positional parameters to match
-
 
1688
      eval set dummy "$func_run_hooks_result"; shift
-
 
1689
 
-
 
1690
      # Break out of the loop if we already parsed every option.
-
 
1691
      test $# -gt 0 || break
-
 
1692
 
-
 
1693
      _G_opt=$1
-
 
1694
      shift
-
 
1695
      case $_G_opt in
-
 
1696
        --debug|-x)   debug_cmd='set -x'
-
 
1697
                      func_echo "enabling shell trace mode"
-
 
1698
                      $debug_cmd
-
 
1699
                      ;;
-
 
1700
 
-
 
1701
        --no-warnings|--no-warning|--no-warn)
-
 
1702
                      set dummy --warnings none ${1+"$@"}
-
 
1703
                      shift
-
 
1704
		      ;;
-
 
1705
 
-
 
1706
        --warnings|--warning|-W)
-
 
1707
                      test $# = 0 && func_missing_arg $_G_opt && break
-
 
1708
                      case " $warning_categories $1" in
-
 
1709
                        *" $1 "*)
-
 
1710
                          # trailing space prevents matching last $1 above
-
 
1711
                          func_append_uniq opt_warning_types " $1"
-
 
1712
                          ;;
-
 
1713
                        *all)
-
 
1714
                          opt_warning_types=$warning_categories
-
 
1715
                          ;;
-
 
1716
                        *none)
-
 
1717
                          opt_warning_types=none
-
 
1718
                          warning_func=:
-
 
1719
                          ;;
-
 
1720
                        *error)
-
 
1721
                          opt_warning_types=$warning_categories
-
 
1722
                          warning_func=func_fatal_error
-
 
1723
                          ;;
-
 
1724
                        *)
-
 
1725
                          func_fatal_error \
-
 
1726
                             "unsupported warning category: '$1'"
-
 
1727
                          ;;
-
 
1728
                      esac
-
 
1729
                      shift
-
 
1730
                      ;;
-
 
1731
 
-
 
1732
        --verbose|-v) opt_verbose=: ;;
-
 
1733
        --version)    func_version ;;
-
 
1734
        -\?|-h)       func_usage ;;
-
 
1735
        --help)       func_help ;;
-
 
1736
 
-
 
1737
	# Separate optargs to long options (plugins may need this):
-
 
1738
	--*=*)        func_split_equals "$_G_opt"
-
 
1739
	              set dummy "$func_split_equals_lhs" \
-
 
1740
                          "$func_split_equals_rhs" ${1+"$@"}
-
 
1741
                      shift
-
 
1742
                      ;;
-
 
1743
 
-
 
1744
       # Separate optargs to short options:
-
 
1745
        -W*)
-
 
1746
                      func_split_short_opt "$_G_opt"
-
 
1747
                      set dummy "$func_split_short_opt_name" \
-
 
1748
                          "$func_split_short_opt_arg" ${1+"$@"}
-
 
1749
                      shift
-
 
1750
                      ;;
-
 
1751
 
-
 
1752
        # Separate non-argument short options:
-
 
1753
        -\?*|-h*|-v*|-x*)
-
 
1754
                      func_split_short_opt "$_G_opt"
-
 
1755
                      set dummy "$func_split_short_opt_name" \
-
 
1756
                          "-$func_split_short_opt_arg" ${1+"$@"}
-
 
1757
                      shift
-
 
1758
                      ;;
-
 
1759
 
-
 
1760
        --)           break ;;
-
 
1761
        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
-
 
1762
        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
-
 
1763
      esac
-
 
1764
    done
-
 
1765
 
-
 
1766
    # save modified positional parameters for caller
-
 
1767
    func_quote_for_eval ${1+"$@"}
-
 
1768
    func_parse_options_result=$func_quote_for_eval_result
-
 
1769
}
-
 
1770
 
-
 
1771
 
-
 
1772
# func_validate_options [ARG]...
-
 
1773
# ------------------------------
-
 
1774
# Perform any sanity checks on option settings and/or unconsumed
-
 
1775
# arguments.
-
 
1776
func_hookable func_validate_options
-
 
1777
func_validate_options ()
-
 
1778
{
-
 
1779
    $debug_cmd
-
 
1780
 
-
 
1781
    # Display all warnings if -W was not given.
-
 
1782
    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
-
 
1783
 
-
 
1784
    func_run_hooks func_validate_options ${1+"$@"}
-
 
1785
 
-
 
1786
    # Bail if the options were screwed!
-
 
1787
    $exit_cmd $EXIT_FAILURE
-
 
1788
 
-
 
1789
    # save modified positional parameters for caller
-
 
1790
    func_validate_options_result=$func_run_hooks_result
-
 
1791
}
-
 
1792
 
-
 
1793
 
-
 
1794
 
-
 
1795
## ----------------- ##
-
 
1796
## Helper functions. ##
-
 
1797
## ----------------- ##
-
 
1798
 
-
 
1799
# This section contains the helper functions used by the rest of the
-
 
1800
# hookable option parser framework in ascii-betical order.
-
 
1801
 
-
 
1802
 
-
 
1803
# func_fatal_help ARG...
-
 
1804
# ----------------------
-
 
1805
# Echo program name prefixed message to standard error, followed by
-
 
1806
# a help hint, and exit.
-
 
1807
func_fatal_help ()
-
 
1808
{
-
 
1809
    $debug_cmd
-
 
1810
 
-
 
1811
    eval \$ECHO \""Usage: $usage"\"
-
 
1812
    eval \$ECHO \""$fatal_help"\"
-
 
1813
    func_error ${1+"$@"}
-
 
1814
    exit $EXIT_FAILURE
-
 
1815
}
-
 
1816
 
-
 
1817
 
523
# func_help
1818
# func_help
-
 
1819
# ---------
524
# Echo long help message to standard output and exit.
1820
# Echo long help message to standard output and exit.
525
func_help ()
1821
func_help ()
526
{
1822
{
527
    $SED -n '/^# Usage:/,/# Report bugs to/ {
-
 
528
        s/^# //
1823
    $debug_cmd
529
	s/^# *$//
-
 
530
	s*\$progname*'$progname'*
-
 
531
	s*\$host*'"$host"'*
-
 
532
	s*\$SHELL*'"$SHELL"'*
-
 
533
	s*\$LTCC*'"$LTCC"'*
-
 
534
	s*\$LTCFLAGS*'"$LTCFLAGS"'*
-
 
535
	s*\$LD*'"$LD"'*
-
 
536
	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-
 
537
	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
-
 
538
	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
-
 
539
	p
1824
 
-
 
1825
    func_usage_message
540
     }' < "$progpath"
1826
    $ECHO "$long_help_message"
541
    exit $?
1827
    exit 0
542
}
1828
}
543
 
1829
 
-
 
1830
 
544
# func_missing_arg argname
1831
# func_missing_arg ARGNAME
-
 
1832
# ------------------------
545
# Echo program name prefixed message to standard error and set global
1833
# Echo program name prefixed message to standard error and set global
546
# exit_cmd.
1834
# exit_cmd.
547
func_missing_arg ()
1835
func_missing_arg ()
548
{
1836
{
-
 
1837
    $debug_cmd
-
 
1838
 
549
    func_error "missing argument for $1"
1839
    func_error "Missing argument for '$1'."
550
    exit_cmd=exit
1840
    exit_cmd=exit
551
}
1841
}
552
 
1842
 
553
exit_cmd=:
-
 
554
 
1843
 
-
 
1844
# func_split_equals STRING
-
 
1845
# ------------------------
-
 
1846
# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
-
 
1847
# splitting STRING at the '=' sign.
-
 
1848
test -z "$_G_HAVE_XSI_OPS" \
-
 
1849
    && (eval 'x=a/b/c;
-
 
1850
      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
-
 
1851
    && _G_HAVE_XSI_OPS=yes
-
 
1852
 
-
 
1853
if test yes = "$_G_HAVE_XSI_OPS"
-
 
1854
then
-
 
1855
  # This is an XSI compatible shell, allowing a faster implementation...
-
 
1856
  eval 'func_split_equals ()
-
 
1857
  {
-
 
1858
      $debug_cmd
555
 
1859
 
-
 
1860
      func_split_equals_lhs=${1%%=*}
-
 
1861
      func_split_equals_rhs=${1#*=}
-
 
1862
      test "x$func_split_equals_lhs" = "x$1" \
-
 
1863
        && func_split_equals_rhs=
-
 
1864
  }'
-
 
1865
else
-
 
1866
  # ...otherwise fall back to using expr, which is often a shell builtin.
-
 
1867
  func_split_equals ()
-
 
1868
  {
-
 
1869
      $debug_cmd
556
 
1870
 
-
 
1871
      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
-
 
1872
      func_split_equals_rhs=
-
 
1873
      test "x$func_split_equals_lhs" = "x$1" \
-
 
1874
        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
-
 
1875
  }
-
 
1876
fi #func_split_equals
557
 
1877
 
558
 
1878
 
559
# Check that we have a working $ECHO.
1879
# func_split_short_opt SHORTOPT
560
if test "X$1" = X--no-reexec; then
1880
# -----------------------------
-
 
1881
# Set func_split_short_opt_name and func_split_short_opt_arg shell
561
  # Discard the --no-reexec flag, and continue.
1882
# variables after splitting SHORTOPT after the 2nd character.
-
 
1883
if test yes = "$_G_HAVE_XSI_OPS"
562
  shift
1884
then
563
elif test "X$1" = X--fallback-echo; then
1885
  # This is an XSI compatible shell, allowing a faster implementation...
564
  # Avoid inline document here, it may be left over
1886
  eval 'func_split_short_opt ()
565
  :
1887
  {
566
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
1888
      $debug_cmd
-
 
1889
 
567
  # Yippee, $ECHO works!
1890
      func_split_short_opt_arg=${1#??}
-
 
1891
      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
568
  :
1892
  }'
569
else
1893
else
570
  # Restart under the correct shell, and then maybe $ECHO will work.
1894
  # ...otherwise fall back to using expr, which is often a shell builtin.
571
  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
1895
  func_split_short_opt ()
572
fi
1896
  {
-
 
1897
      $debug_cmd
573
 
1898
 
574
if test "X$1" = X--fallback-echo; then
1899
      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
575
  # used as fallback echo
1900
      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
576
  shift
-
 
577
  cat <<EOF
-
 
578
$*
-
 
579
EOF
1901
  }
580
  exit $EXIT_SUCCESS
1902
fi #func_split_short_opt
581
fi
-
 
582
 
1903
 
583
magic="%%%MAGIC variable%%%"
-
 
584
magic_exe="%%%MAGIC EXE variable%%%"
-
 
585
 
1904
 
586
# Global variables.
-
 
587
# $mode is unset
1905
# func_usage
588
nonopt=
-
 
589
execute_dlfiles=
-
 
590
preserve_args=
1906
# ----------
591
lo2o="s/\\.lo\$/.${objext}/"
1907
# Echo short help message to standard output and exit.
592
o2lo="s/\\.${objext}\$/.lo/"
-
 
593
extracted_archives=
1908
func_usage ()
-
 
1909
{
594
extracted_serial=0
1910
    $debug_cmd
595
 
1911
 
596
opt_dry_run=false
1912
    func_usage_message
597
opt_duplicate_deps=false
1913
    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
598
opt_silent=false
1914
    exit 0
599
opt_debug=:
1915
}
600
 
1916
 
601
# If this variable is set in any of the actions, the command in it
-
 
602
# will be execed at the end.  This prevents here-documents from being
-
 
603
# left over by shells.
-
 
604
exec_cmd=
-
 
605
 
1917
 
-
 
1918
# func_usage_message
-
 
1919
# ------------------
-
 
1920
# Echo short help message to standard output.
-
 
1921
func_usage_message ()
-
 
1922
{
-
 
1923
    $debug_cmd
-
 
1924
 
-
 
1925
    eval \$ECHO \""Usage: $usage"\"
-
 
1926
    echo
-
 
1927
    $SED -n 's|^# ||
-
 
1928
        /^Written by/{
-
 
1929
          x;p;x
-
 
1930
        }
-
 
1931
	h
-
 
1932
	/^Written by/q' < "$progpath"
-
 
1933
    echo
-
 
1934
    eval \$ECHO \""$usage_message"\"
-
 
1935
}
-
 
1936
 
-
 
1937
 
-
 
1938
# func_version
-
 
1939
# ------------
-
 
1940
# Echo version message to standard output and exit.
-
 
1941
func_version ()
-
 
1942
{
-
 
1943
    $debug_cmd
-
 
1944
 
-
 
1945
    printf '%s\n' "$progname $scriptversion"
-
 
1946
    $SED -n '
-
 
1947
        /(C)/!b go
-
 
1948
        :more
-
 
1949
        /\./!{
-
 
1950
          N
-
 
1951
          s|\n# | |
-
 
1952
          b more
-
 
1953
        }
-
 
1954
        :go
-
 
1955
        /^# Written by /,/# warranty; / {
-
 
1956
          s|^# ||
-
 
1957
          s|^# *$||
-
 
1958
          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
-
 
1959
          p
-
 
1960
        }
-
 
1961
        /^# Written by / {
-
 
1962
          s|^# ||
-
 
1963
          p
-
 
1964
        }
-
 
1965
        /^warranty; /q' < "$progpath"
-
 
1966
 
-
 
1967
    exit $?
-
 
1968
}
-
 
1969
 
-
 
1970
 
-
 
1971
# Local variables:
-
 
1972
# mode: shell-script
-
 
1973
# sh-indentation: 2
-
 
1974
# eval: (add-hook 'before-save-hook 'time-stamp)
-
 
1975
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
-
 
1976
# time-stamp-time-zone: "UTC"
-
 
1977
# End:
-
 
1978
 
-
 
1979
# Set a version string.
-
 
1980
scriptversion='(GNU libtool) 2.4.6'
-
 
1981
 
-
 
1982
 
-
 
1983
# func_echo ARG...
-
 
1984
# ----------------
-
 
1985
# Libtool also displays the current mode in messages, so override
-
 
1986
# funclib.sh func_echo with this custom definition.
-
 
1987
func_echo ()
-
 
1988
{
-
 
1989
    $debug_cmd
-
 
1990
 
-
 
1991
    _G_message=$*
-
 
1992
 
-
 
1993
    func_echo_IFS=$IFS
-
 
1994
    IFS=$nl
-
 
1995
    for _G_line in $_G_message; do
-
 
1996
      IFS=$func_echo_IFS
-
 
1997
      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
-
 
1998
    done
-
 
1999
    IFS=$func_echo_IFS
-
 
2000
}
-
 
2001
 
-
 
2002
 
-
 
2003
# func_warning ARG...
-
 
2004
# -------------------
-
 
2005
# Libtool warnings are not categorized, so override funclib.sh
-
 
2006
# func_warning with this simpler definition.
-
 
2007
func_warning ()
-
 
2008
{
-
 
2009
    $debug_cmd
-
 
2010
 
-
 
2011
    $warning_func ${1+"$@"}
-
 
2012
}
-
 
2013
 
-
 
2014
 
-
 
2015
## ---------------- ##
-
 
2016
## Options parsing. ##
-
 
2017
## ---------------- ##
-
 
2018
 
-
 
2019
# Hook in the functions to make sure our own options are parsed during
-
 
2020
# the option parsing loop.
-
 
2021
 
-
 
2022
usage='$progpath [OPTION]... [MODE-ARG]...'
-
 
2023
 
-
 
2024
# Short help message in response to '-h'.
-
 
2025
usage_message="Options:
-
 
2026
       --config             show all configuration variables
-
 
2027
       --debug              enable verbose shell tracing
-
 
2028
   -n, --dry-run            display commands without modifying any files
-
 
2029
       --features           display basic configuration information and exit
-
 
2030
       --mode=MODE          use operation mode MODE
-
 
2031
       --no-warnings        equivalent to '-Wnone'
-
 
2032
       --preserve-dup-deps  don't remove duplicate dependency libraries
-
 
2033
       --quiet, --silent    don't print informational messages
-
 
2034
       --tag=TAG            use configuration variables from tag TAG
-
 
2035
   -v, --verbose            print more informational messages than default
-
 
2036
       --version            print version information
-
 
2037
   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
-
 
2038
   -h, --help, --help-all   print short, long, or detailed help message
-
 
2039
"
-
 
2040
 
-
 
2041
# Additional text appended to 'usage_message' in response to '--help'.
-
 
2042
func_help ()
-
 
2043
{
-
 
2044
    $debug_cmd
-
 
2045
 
-
 
2046
    func_usage_message
-
 
2047
    $ECHO "$long_help_message
-
 
2048
 
-
 
2049
MODE must be one of the following:
-
 
2050
 
-
 
2051
       clean           remove files from the build directory
-
 
2052
       compile         compile a source file into a libtool object
-
 
2053
       execute         automatically set library path, then run a program
-
 
2054
       finish          complete the installation of libtool libraries
-
 
2055
       install         install libraries or executables
-
 
2056
       link            create a library or an executable
-
 
2057
       uninstall       remove libraries from an installed directory
-
 
2058
 
-
 
2059
MODE-ARGS vary depending on the MODE.  When passed as first option,
-
 
2060
'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
-
 
2061
Try '$progname --help --mode=MODE' for a more detailed description of MODE.
-
 
2062
 
-
 
2063
When reporting a bug, please describe a test case to reproduce it and
-
 
2064
include the following information:
-
 
2065
 
-
 
2066
       host-triplet:   $host
-
 
2067
       shell:          $SHELL
-
 
2068
       compiler:       $LTCC
-
 
2069
       compiler flags: $LTCFLAGS
-
 
2070
       linker:         $LD (gnu? $with_gnu_ld)
-
 
2071
       version:        $progname (GNU libtool) 2.4.6
-
 
2072
       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
-
 
2073
       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
-
 
2074
 
-
 
2075
Report bugs to <bug-libtool@gnu.org>.
-
 
2076
GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-
 
2077
General help using GNU software: <http://www.gnu.org/gethelp/>."
-
 
2078
    exit 0
-
 
2079
}
-
 
2080
 
-
 
2081
 
-
 
2082
# func_lo2o OBJECT-NAME
-
 
2083
# ---------------------
-
 
2084
# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
-
 
2085
# object suffix.
-
 
2086
 
-
 
2087
lo2o=s/\\.lo\$/.$objext/
-
 
2088
o2lo=s/\\.$objext\$/.lo/
-
 
2089
 
-
 
2090
if test yes = "$_G_HAVE_XSI_OPS"; then
-
 
2091
  eval 'func_lo2o ()
-
 
2092
  {
-
 
2093
    case $1 in
-
 
2094
      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
-
 
2095
      *   ) func_lo2o_result=$1               ;;
-
 
2096
    esac
-
 
2097
  }'
-
 
2098
 
-
 
2099
  # func_xform LIBOBJ-OR-SOURCE
-
 
2100
  # ---------------------------
-
 
2101
  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
-
 
2102
  # suffix to a '.lo' libtool-object suffix.
-
 
2103
  eval 'func_xform ()
-
 
2104
  {
-
 
2105
    func_xform_result=${1%.*}.lo
-
 
2106
  }'
-
 
2107
else
-
 
2108
  # ...otherwise fall back to using sed.
-
 
2109
  func_lo2o ()
-
 
2110
  {
-
 
2111
    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
-
 
2112
  }
-
 
2113
 
-
 
2114
  func_xform ()
-
 
2115
  {
-
 
2116
    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
-
 
2117
  }
-
 
2118
fi
-
 
2119
 
-
 
2120
 
606
# func_fatal_configuration arg...
2121
# func_fatal_configuration ARG...
-
 
2122
# -------------------------------
607
# Echo program name prefixed message to standard error, followed by
2123
# Echo program name prefixed message to standard error, followed by
608
# a configuration failure hint, and exit.
2124
# a configuration failure hint, and exit.
609
func_fatal_configuration ()
2125
func_fatal_configuration ()
610
{
2126
{
611
    func_error ${1+"$@"}
2127
    func__fatal_error ${1+"$@"} \
612
    func_error "See the $PACKAGE documentation for more information."
2128
      "See the $PACKAGE documentation for more information." \
613
    func_fatal_error "Fatal configuration error."
2129
      "Fatal configuration error."
614
}
2130
}
615
 
2131
 
616
 
2132
 
617
# func_config
2133
# func_config
-
 
2134
# -----------
618
# Display the configuration for all the tags in this script.
2135
# Display the configuration for all the tags in this script.
619
func_config ()
2136
func_config ()
620
{
2137
{
621
    re_begincf='^# ### BEGIN LIBTOOL'
2138
    re_begincf='^# ### BEGIN LIBTOOL'
622
    re_endcf='^# ### END LIBTOOL'
2139
    re_endcf='^# ### END LIBTOOL'
Line 630... Line 2147...
630
    done
2147
    done
631
 
2148
 
632
    exit $?
2149
    exit $?
633
}
2150
}
634
 
2151
 
-
 
2152
 
635
# func_features
2153
# func_features
-
 
2154
# -------------
636
# Display the features supported by this script.
2155
# Display the features supported by this script.
637
func_features ()
2156
func_features ()
638
{
2157
{
639
    $ECHO "host: $host"
2158
    echo "host: $host"
640
    if test "$build_libtool_libs" = yes; then
2159
    if test yes = "$build_libtool_libs"; then
641
      $ECHO "enable shared libraries"
2160
      echo "enable shared libraries"
642
    else
2161
    else
643
      $ECHO "disable shared libraries"
2162
      echo "disable shared libraries"
644
    fi
2163
    fi
645
    if test "$build_old_libs" = yes; then
2164
    if test yes = "$build_old_libs"; then
646
      $ECHO "enable static libraries"
2165
      echo "enable static libraries"
647
    else
2166
    else
648
      $ECHO "disable static libraries"
2167
      echo "disable static libraries"
649
    fi
2168
    fi
650
 
2169
 
651
    exit $?
2170
    exit $?
652
}
2171
}
653
 
2172
 
-
 
2173
 
654
# func_enable_tag tagname
2174
# func_enable_tag TAGNAME
-
 
2175
# -----------------------
655
# Verify that TAGNAME is valid, and either flag an error and exit, or
2176
# Verify that TAGNAME is valid, and either flag an error and exit, or
656
# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
2177
# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
657
# variable here.
2178
# variable here.
658
func_enable_tag ()
2179
func_enable_tag ()
659
{
2180
{
660
  # Global variable:
2181
    # Global variable:
661
  tagname="$1"
2182
    tagname=$1
662
 
-
 
663
  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-
 
664
  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-
 
665
  sed_extractcf="/$re_begincf/,/$re_endcf/p"
-
 
666
 
-
 
667
  # Validate tagname.
-
 
668
  case $tagname in
-
 
669
    *[!-_A-Za-z0-9,/]*)
-
 
670
      func_fatal_error "invalid tag name: $tagname"
-
 
671
      ;;
-
 
672
  esac
-
 
673
 
-
 
674
  # Don't test for the "default" C tag, as we know it's
-
 
675
  # there but not specially marked.
-
 
676
  case $tagname in
-
 
677
    CC) ;;
-
 
678
    *)
-
 
679
      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-
 
680
	taglist="$taglist $tagname"
-
 
681
 
-
 
682
	# Evaluate the configuration.  Be careful to quote the path
-
 
683
	# and the sed script, to avoid splitting on whitespace, but
-
 
684
	# also don't use non-portable quotes within backquotes within
-
 
685
	# quotes we have to do it in 2 steps:
-
 
686
	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-
 
687
	eval "$extractedcf"
-
 
688
      else
-
 
689
	func_error "ignoring unknown tag $tagname"
-
 
690
      fi
-
 
691
      ;;
-
 
692
  esac
-
 
693
}
-
 
694
 
2183
 
695
# Parse options once, thoroughly.  This comes as soon as possible in
2184
    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
696
# the script to make things like `libtool --version' happen quickly.
-
 
697
{
-
 
698
 
-
 
699
  # Shorthand for --mode=foo, only valid as the first argument
2185
    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
700
  case $1 in
-
 
701
  clean|clea|cle|cl)
-
 
702
    shift; set dummy --mode clean ${1+"$@"}; shift
-
 
703
    ;;
-
 
704
  compile|compil|compi|comp|com|co|c)
-
 
705
    shift; set dummy --mode compile ${1+"$@"}; shift
-
 
706
    ;;
-
 
707
  execute|execut|execu|exec|exe|ex|e)
-
 
708
    shift; set dummy --mode execute ${1+"$@"}; shift
-
 
709
    ;;
-
 
710
  finish|finis|fini|fin|fi|f)
-
 
711
    shift; set dummy --mode finish ${1+"$@"}; shift
-
 
712
    ;;
-
 
713
  install|instal|insta|inst|ins|in|i)
-
 
714
    shift; set dummy --mode install ${1+"$@"}; shift
-
 
715
    ;;
-
 
716
  link|lin|li|l)
-
 
717
    shift; set dummy --mode link ${1+"$@"}; shift
2186
    sed_extractcf=/$re_begincf/,/$re_endcf/p
718
    ;;
-
 
719
  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-
 
720
    shift; set dummy --mode uninstall ${1+"$@"}; shift
-
 
721
    ;;
-
 
722
  esac
-
 
723
 
2187
 
724
  # Parse non-mode specific arguments:
-
 
725
  while test "$#" -gt 0; do
2188
    # Validate tagname.
726
    opt="$1"
-
 
727
    shift
-
 
728
 
-
 
729
    case $opt in
2189
    case $tagname in
730
      --config)		func_config					;;
-
 
731
 
-
 
732
      --debug)		preserve_args="$preserve_args $opt"
-
 
733
			func_echo "enabling shell trace mode"
-
 
734
			opt_debug='set -x'
-
 
735
			$opt_debug
-
 
736
			;;
-
 
737
 
-
 
738
      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
-
 
739
			execute_dlfiles="$execute_dlfiles $1"
-
 
740
			shift
-
 
741
			;;
-
 
742
 
-
 
743
      --dry-run | -n)	opt_dry_run=:					;;
-
 
744
      --features)       func_features					;;
-
 
745
      --finish)		mode="finish"					;;
-
 
746
 
-
 
747
      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
-
 
748
			case $1 in
-
 
749
			  # Valid mode arguments:
2190
      *[!-_A-Za-z0-9,/]*)
750
			  clean)	;;
-
 
751
			  compile)	;;
-
 
752
			  execute)	;;
-
 
753
			  finish)	;;
-
 
754
			  install)	;;
-
 
755
			  link)		;;
-
 
756
			  relink)	;;
-
 
757
			  uninstall)	;;
-
 
758
 
-
 
759
			  # Catch anything else as an error
-
 
760
			  *) func_error "invalid argument for $opt"
2191
        func_fatal_error "invalid tag name: $tagname"
761
			     exit_cmd=exit
-
 
762
			     break
-
 
763
			     ;;
2192
        ;;
764
		        esac
-
 
765
 
-
 
766
			mode="$1"
-
 
767
			shift
-
 
768
			;;
-
 
769
 
-
 
770
      --preserve-dup-deps)
-
 
771
			opt_duplicate_deps=:				;;
-
 
772
 
-
 
773
      --quiet|--silent)	preserve_args="$preserve_args $opt"
-
 
774
			opt_silent=:
-
 
775
			;;
-
 
776
 
-
 
777
      --verbose| -v)	preserve_args="$preserve_args $opt"
-
 
778
			opt_silent=false
-
 
779
			;;
-
 
780
 
-
 
781
      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
-
 
782
			preserve_args="$preserve_args $opt $1"
-
 
783
			func_enable_tag "$1"	# tagname is set here
-
 
784
			shift
-
 
785
			;;
-
 
786
 
-
 
787
      # Separate optargs to long options:
-
 
788
      -dlopen=*|--mode=*|--tag=*)
-
 
789
			func_opt_split "$opt"
-
 
790
			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
-
 
791
			shift
-
 
792
			;;
-
 
793
 
-
 
794
      -\?|-h)		func_usage					;;
-
 
795
      --help)		opt_help=:					;;
-
 
796
      --version)	func_version					;;
-
 
797
 
-
 
798
      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
-
 
799
 
-
 
800
      *)		nonopt="$opt"
-
 
801
			break
-
 
802
			;;
-
 
803
    esac
2193
    esac
804
  done
-
 
805
 
-
 
806
 
2194
 
807
  case $host in
-
 
808
    *cygwin* | *mingw* | *pw32* | *cegcc*)
2195
    # Don't test for the "default" C tag, as we know it's
809
      # don't eliminate duplications in $postdeps and $predeps
2196
    # there but not specially marked.
810
      opt_duplicate_compiler_generated_deps=:
2197
    case $tagname in
811
      ;;
2198
        CC) ;;
812
    *)
2199
    *)
813
      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
2200
        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
814
      ;;
2201
	  taglist="$taglist $tagname"
815
  esac
-
 
816
 
2202
 
-
 
2203
	  # Evaluate the configuration.  Be careful to quote the path
817
  # Having warned about all mis-specified options, bail out if
2204
	  # and the sed script, to avoid splitting on whitespace, but
-
 
2205
	  # also don't use non-portable quotes within backquotes within
818
  # anything was wrong.
2206
	  # quotes we have to do it in 2 steps:
-
 
2207
	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
819
  $exit_cmd $EXIT_FAILURE
2208
	  eval "$extractedcf"
-
 
2209
        else
-
 
2210
	  func_error "ignoring unknown tag $tagname"
-
 
2211
        fi
-
 
2212
        ;;
-
 
2213
    esac
820
}
2214
}
821
 
2215
 
-
 
2216
 
822
# func_check_version_match
2217
# func_check_version_match
-
 
2218
# ------------------------
823
# Ensure that we are using m4 macros, and libtool script from the same
2219
# Ensure that we are using m4 macros, and libtool script from the same
824
# release of libtool.
2220
# release of libtool.
825
func_check_version_match ()
2221
func_check_version_match ()
826
{
2222
{
827
  if test "$package_revision" != "$macro_revision"; then
2223
    if test "$package_revision" != "$macro_revision"; then
828
    if test "$VERSION" != "$macro_version"; then
2224
      if test "$VERSION" != "$macro_version"; then
829
      if test -z "$macro_version"; then
2225
        if test -z "$macro_version"; then
830
        cat >&2 <<_LT_EOF
2226
          cat >&2 <<_LT_EOF
831
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
2227
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
832
$progname: definition of this LT_INIT comes from an older release.
2228
$progname: definition of this LT_INIT comes from an older release.
833
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2229
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
834
$progname: and run autoconf again.
2230
$progname: and run autoconf again.
835
_LT_EOF
2231
_LT_EOF
836
      else
2232
        else
837
        cat >&2 <<_LT_EOF
2233
          cat >&2 <<_LT_EOF
838
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
2234
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
839
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
2235
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
840
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2236
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
841
$progname: and run autoconf again.
2237
$progname: and run autoconf again.
842
_LT_EOF
2238
_LT_EOF
843
      fi
2239
        fi
844
    else
2240
      else
845
      cat >&2 <<_LT_EOF
2241
        cat >&2 <<_LT_EOF
846
$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
2242
$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
847
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
2243
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
848
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
2244
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
849
$progname: of $PACKAGE $VERSION and run autoconf again.
2245
$progname: of $PACKAGE $VERSION and run autoconf again.
850
_LT_EOF
2246
_LT_EOF
-
 
2247
      fi
-
 
2248
 
-
 
2249
      exit $EXIT_MISMATCH
851
    fi
2250
    fi
-
 
2251
}
852
 
2252
 
-
 
2253
 
-
 
2254
# libtool_options_prep [ARG]...
-
 
2255
# -----------------------------
-
 
2256
# Preparation for options parsed by libtool.
-
 
2257
libtool_options_prep ()
-
 
2258
{
-
 
2259
    $debug_mode
-
 
2260
 
-
 
2261
    # Option defaults:
-
 
2262
    opt_config=false
-
 
2263
    opt_dlopen=
853
    exit $EXIT_MISMATCH
2264
    opt_dry_run=false
-
 
2265
    opt_help=false
-
 
2266
    opt_mode=
-
 
2267
    opt_preserve_dup_deps=false
-
 
2268
    opt_quiet=false
-
 
2269
 
-
 
2270
    nonopt=
-
 
2271
    preserve_args=
-
 
2272
 
-
 
2273
    # Shorthand for --mode=foo, only valid as the first argument
-
 
2274
    case $1 in
-
 
2275
    clean|clea|cle|cl)
-
 
2276
      shift; set dummy --mode clean ${1+"$@"}; shift
-
 
2277
      ;;
-
 
2278
    compile|compil|compi|comp|com|co|c)
-
 
2279
      shift; set dummy --mode compile ${1+"$@"}; shift
-
 
2280
      ;;
-
 
2281
    execute|execut|execu|exec|exe|ex|e)
-
 
2282
      shift; set dummy --mode execute ${1+"$@"}; shift
-
 
2283
      ;;
-
 
2284
    finish|finis|fini|fin|fi|f)
-
 
2285
      shift; set dummy --mode finish ${1+"$@"}; shift
-
 
2286
      ;;
-
 
2287
    install|instal|insta|inst|ins|in|i)
-
 
2288
      shift; set dummy --mode install ${1+"$@"}; shift
-
 
2289
      ;;
-
 
2290
    link|lin|li|l)
-
 
2291
      shift; set dummy --mode link ${1+"$@"}; shift
-
 
2292
      ;;
-
 
2293
    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-
 
2294
      shift; set dummy --mode uninstall ${1+"$@"}; shift
-
 
2295
      ;;
854
  fi
2296
    esac
-
 
2297
 
-
 
2298
    # Pass back the list of options.
-
 
2299
    func_quote_for_eval ${1+"$@"}
-
 
2300
    libtool_options_prep_result=$func_quote_for_eval_result
855
}
2301
}
-
 
2302
func_add_hook func_options_prep libtool_options_prep
856
 
2303
 
857
 
2304
 
-
 
2305
# libtool_parse_options [ARG]...
858
## ----------- ##
2306
# ---------------------------------
-
 
2307
# Provide handling for libtool specific options.
859
##    Main.    ##
2308
libtool_parse_options ()
-
 
2309
{
860
## ----------- ##
2310
    $debug_cmd
861
 
2311
 
-
 
2312
    # Perform our own loop to consume as many options as possible in
-
 
2313
    # each iteration.
-
 
2314
    while test $# -gt 0; do
862
$opt_help || {
2315
      _G_opt=$1
-
 
2316
      shift
863
  # Sanity checks first:
2317
      case $_G_opt in
-
 
2318
        --dry-run|--dryrun|-n)
-
 
2319
                        opt_dry_run=:
-
 
2320
                        ;;
-
 
2321
 
-
 
2322
        --config)       func_config ;;
-
 
2323
 
-
 
2324
        --dlopen|-dlopen)
-
 
2325
                        opt_dlopen="${opt_dlopen+$opt_dlopen
-
 
2326
}$1"
-
 
2327
                        shift
-
 
2328
                        ;;
-
 
2329
 
-
 
2330
        --preserve-dup-deps)
-
 
2331
                        opt_preserve_dup_deps=: ;;
-
 
2332
 
-
 
2333
        --features)     func_features ;;
-
 
2334
 
-
 
2335
        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
-
 
2336
 
-
 
2337
        --help)         opt_help=: ;;
-
 
2338
 
-
 
2339
        --help-all)     opt_help=': help-all' ;;
-
 
2340
 
-
 
2341
        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
-
 
2342
                        opt_mode=$1
-
 
2343
                        case $1 in
-
 
2344
                          # Valid mode arguments:
-
 
2345
                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
 
2346
 
-
 
2347
                          # Catch anything else as an error
-
 
2348
                          *) func_error "invalid argument for $_G_opt"
-
 
2349
                             exit_cmd=exit
-
 
2350
                             break
-
 
2351
                             ;;
-
 
2352
                        esac
-
 
2353
                        shift
-
 
2354
                        ;;
-
 
2355
 
-
 
2356
        --no-silent|--no-quiet)
-
 
2357
                        opt_quiet=false
-
 
2358
                        func_append preserve_args " $_G_opt"
-
 
2359
                        ;;
-
 
2360
 
-
 
2361
        --no-warnings|--no-warning|--no-warn)
-
 
2362
                        opt_warning=false
-
 
2363
                        func_append preserve_args " $_G_opt"
-
 
2364
                        ;;
-
 
2365
 
864
  func_check_version_match
2366
        --no-verbose)
-
 
2367
                        opt_verbose=false
-
 
2368
                        func_append preserve_args " $_G_opt"
-
 
2369
                        ;;
-
 
2370
 
-
 
2371
        --silent|--quiet)
-
 
2372
                        opt_quiet=:
-
 
2373
                        opt_verbose=false
-
 
2374
                        func_append preserve_args " $_G_opt"
-
 
2375
                        ;;
-
 
2376
 
-
 
2377
        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
-
 
2378
                        opt_tag=$1
-
 
2379
                        func_append preserve_args " $_G_opt $1"
-
 
2380
                        func_enable_tag "$1"
-
 
2381
                        shift
-
 
2382
                        ;;
-
 
2383
 
-
 
2384
        --verbose|-v)   opt_quiet=false
-
 
2385
                        opt_verbose=:
-
 
2386
                        func_append preserve_args " $_G_opt"
-
 
2387
                        ;;
865
 
2388
 
866
  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
2389
	# An option not handled by this hook function:
867
    func_fatal_configuration "not configured to build any kind of library"
2390
        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
-
 
2391
      esac
868
  fi
2392
    done
869
 
2393
 
870
  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
-
 
871
 
2394
 
-
 
2395
    # save modified positional parameters for caller
-
 
2396
    func_quote_for_eval ${1+"$@"}
-
 
2397
    libtool_parse_options_result=$func_quote_for_eval_result
-
 
2398
}
-
 
2399
func_add_hook func_parse_options libtool_parse_options
872
 
2400
 
873
  # Darwin sucks
-
 
874
  eval std_shrext=\"$shrext_cmds\"
-
 
875
 
2401
 
876
 
2402
 
877
  # Only execute mode is allowed to have -dlopen flags.
2403
# libtool_validate_options [ARG]...
-
 
2404
# ---------------------------------
878
  if test -n "$execute_dlfiles" && test "$mode" != execute; then
2405
# Perform any sanity checks on option settings and/or unconsumed
-
 
2406
# arguments.
-
 
2407
libtool_validate_options ()
-
 
2408
{
879
    func_error "unrecognized option \`-dlopen'"
2409
    # save first non-option argument
880
    $ECHO "$help" 1>&2
2410
    if test 0 -lt $#; then
881
    exit $EXIT_FAILURE
2411
      nonopt=$1
-
 
2412
      shift
882
  fi
2413
    fi
-
 
2414
 
-
 
2415
    # preserve --debug
-
 
2416
    test : = "$debug_cmd" || func_append preserve_args " --debug"
883
 
2417
 
-
 
2418
    case $host in
-
 
2419
      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
-
 
2420
      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
-
 
2421
      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
-
 
2422
        # don't eliminate duplications in $postdeps and $predeps
-
 
2423
        opt_duplicate_compiler_generated_deps=:
-
 
2424
        ;;
-
 
2425
      *)
-
 
2426
        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-
 
2427
        ;;
-
 
2428
    esac
-
 
2429
 
-
 
2430
    $opt_help || {
-
 
2431
      # Sanity checks first:
-
 
2432
      func_check_version_match
-
 
2433
 
-
 
2434
      test yes != "$build_libtool_libs" \
-
 
2435
        && test yes != "$build_old_libs" \
-
 
2436
        && func_fatal_configuration "not configured to build any kind of library"
-
 
2437
 
-
 
2438
      # Darwin sucks
-
 
2439
      eval std_shrext=\"$shrext_cmds\"
-
 
2440
 
-
 
2441
      # Only execute mode is allowed to have -dlopen flags.
-
 
2442
      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
-
 
2443
        func_error "unrecognized option '-dlopen'"
-
 
2444
        $ECHO "$help" 1>&2
-
 
2445
        exit $EXIT_FAILURE
-
 
2446
      fi
-
 
2447
 
884
  # Change the help message to a mode-specific one.
2448
      # Change the help message to a mode-specific one.
885
  generic_help="$help"
2449
      generic_help=$help
886
  help="Try \`$progname --help --mode=$mode' for more information."
2450
      help="Try '$progname --help --mode=$opt_mode' for more information."
-
 
2451
    }
-
 
2452
 
-
 
2453
    # Pass back the unparsed argument list
-
 
2454
    func_quote_for_eval ${1+"$@"}
-
 
2455
    libtool_validate_options_result=$func_quote_for_eval_result
-
 
2456
}
-
 
2457
func_add_hook func_validate_options libtool_validate_options
-
 
2458
 
-
 
2459
 
-
 
2460
# Process options as early as possible so that --help and --version
-
 
2461
# can return quickly.
-
 
2462
func_options ${1+"$@"}
-
 
2463
eval set dummy "$func_options_result"; shift
-
 
2464
 
-
 
2465
 
-
 
2466
 
-
 
2467
## ----------- ##
-
 
2468
##    Main.    ##
-
 
2469
## ----------- ##
-
 
2470
 
-
 
2471
magic='%%%MAGIC variable%%%'
-
 
2472
magic_exe='%%%MAGIC EXE variable%%%'
-
 
2473
 
-
 
2474
# Global variables.
-
 
2475
extracted_archives=
-
 
2476
extracted_serial=0
-
 
2477
 
-
 
2478
# If this variable is set in any of the actions, the command in it
-
 
2479
# will be execed at the end.  This prevents here-documents from being
-
 
2480
# left over by shells.
-
 
2481
exec_cmd=
-
 
2482
 
-
 
2483
 
-
 
2484
# A function that is used when there is no print builtin or printf.
-
 
2485
func_fallback_echo ()
-
 
2486
{
-
 
2487
  eval 'cat <<_LTECHO_EOF
-
 
2488
$1
-
 
2489
_LTECHO_EOF'
887
}
2490
}
888
 
2491
 
-
 
2492
# func_generated_by_libtool
-
 
2493
# True iff stdin has been generated by Libtool. This function is only
-
 
2494
# a basic sanity check; it will hardly flush out determined imposters.
-
 
2495
func_generated_by_libtool_p ()
-
 
2496
{
-
 
2497
  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-
 
2498
}
889
 
2499
 
890
# func_lalib_p file
2500
# func_lalib_p file
891
# True iff FILE is a libtool `.la' library or `.lo' object file.
2501
# True iff FILE is a libtool '.la' library or '.lo' object file.
892
# This function is only a basic sanity check; it will hardly flush out
2502
# This function is only a basic sanity check; it will hardly flush out
893
# determined imposters.
2503
# determined imposters.
894
func_lalib_p ()
2504
func_lalib_p ()
895
{
2505
{
896
    test -f "$1" &&
2506
    test -f "$1" &&
897
      $SED -e 4q "$1" 2>/dev/null \
2507
      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
898
        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-
 
899
}
2508
}
900
 
2509
 
901
# func_lalib_unsafe_p file
2510
# func_lalib_unsafe_p file
902
# True iff FILE is a libtool `.la' library or `.lo' object file.
2511
# True iff FILE is a libtool '.la' library or '.lo' object file.
903
# This function implements the same check as func_lalib_p without
2512
# This function implements the same check as func_lalib_p without
904
# resorting to external programs.  To this end, it redirects stdin and
2513
# resorting to external programs.  To this end, it redirects stdin and
905
# closes it afterwards, without saving the original file descriptor.
2514
# closes it afterwards, without saving the original file descriptor.
906
# As a safety measure, use it only where a negative result would be
2515
# As a safety measure, use it only where a negative result would be
907
# fatal anyway.  Works if `file' does not exist.
2516
# fatal anyway.  Works if 'file' does not exist.
908
func_lalib_unsafe_p ()
2517
func_lalib_unsafe_p ()
909
{
2518
{
910
    lalib_p=no
2519
    lalib_p=no
911
    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
2520
    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
912
	for lalib_p_l in 1 2 3 4
2521
	for lalib_p_l in 1 2 3 4
913
	do
2522
	do
914
	    read lalib_p_line
2523
	    read lalib_p_line
915
	    case "$lalib_p_line" in
2524
	    case $lalib_p_line in
916
		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
2525
		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
917
	    esac
2526
	    esac
918
	done
2527
	done
919
	exec 0<&5 5<&-
2528
	exec 0<&5 5<&-
920
    fi
2529
    fi
921
    test "$lalib_p" = yes
2530
    test yes = "$lalib_p"
922
}
2531
}
923
 
2532
 
924
# func_ltwrapper_script_p file
2533
# func_ltwrapper_script_p file
925
# True iff FILE is a libtool wrapper script
2534
# True iff FILE is a libtool wrapper script
926
# This function is only a basic sanity check; it will hardly flush out
2535
# This function is only a basic sanity check; it will hardly flush out
927
# determined imposters.
2536
# determined imposters.
928
func_ltwrapper_script_p ()
2537
func_ltwrapper_script_p ()
929
{
2538
{
930
    func_lalib_p "$1"
2539
    test -f "$1" &&
-
 
2540
      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
931
}
2541
}
932
 
2542
 
933
# func_ltwrapper_executable_p file
2543
# func_ltwrapper_executable_p file
934
# True iff FILE is a libtool wrapper executable
2544
# True iff FILE is a libtool wrapper executable
935
# This function is only a basic sanity check; it will hardly flush out
2545
# This function is only a basic sanity check; it will hardly flush out
Line 948... Line 2558...
948
# Assumes file is an ltwrapper_executable
2558
# Assumes file is an ltwrapper_executable
949
# uses $file to determine the appropriate filename for a
2559
# uses $file to determine the appropriate filename for a
950
# temporary ltwrapper_script.
2560
# temporary ltwrapper_script.
951
func_ltwrapper_scriptname ()
2561
func_ltwrapper_scriptname ()
952
{
2562
{
953
    func_ltwrapper_scriptname_result=""
-
 
954
    if func_ltwrapper_executable_p "$1"; then
-
 
955
	func_dirname_and_basename "$1" "" "."
2563
    func_dirname_and_basename "$1" "" "."
956
	func_stripname '' '.exe' "$func_basename_result"
2564
    func_stripname '' '.exe' "$func_basename_result"
957
	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
2565
    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
958
    fi
-
 
959
}
2566
}
960
 
2567
 
961
# func_ltwrapper_p file
2568
# func_ltwrapper_p file
962
# True iff FILE is a libtool wrapper script or wrapper executable
2569
# True iff FILE is a libtool wrapper script or wrapper executable
963
# This function is only a basic sanity check; it will hardly flush out
2570
# This function is only a basic sanity check; it will hardly flush out
Line 972... Line 2579...
972
# Execute tilde-delimited COMMANDS.
2579
# Execute tilde-delimited COMMANDS.
973
# If FAIL_CMD is given, eval that upon failure.
2580
# If FAIL_CMD is given, eval that upon failure.
974
# FAIL_CMD may read-access the current command in variable CMD!
2581
# FAIL_CMD may read-access the current command in variable CMD!
975
func_execute_cmds ()
2582
func_execute_cmds ()
976
{
2583
{
977
    $opt_debug
2584
    $debug_cmd
-
 
2585
 
978
    save_ifs=$IFS; IFS='~'
2586
    save_ifs=$IFS; IFS='~'
979
    for cmd in $1; do
2587
    for cmd in $1; do
980
      IFS=$save_ifs
2588
      IFS=$sp$nl
981
      eval cmd=\"$cmd\"
2589
      eval cmd=\"$cmd\"
-
 
2590
      IFS=$save_ifs
982
      func_show_eval "$cmd" "${2-:}"
2591
      func_show_eval "$cmd" "${2-:}"
983
    done
2592
    done
984
    IFS=$save_ifs
2593
    IFS=$save_ifs
985
}
2594
}
986
 
2595
 
Line 988... Line 2597...
988
# func_source file
2597
# func_source file
989
# Source FILE, adding directory component if necessary.
2598
# Source FILE, adding directory component if necessary.
990
# Note that it is not necessary on cygwin/mingw to append a dot to
2599
# Note that it is not necessary on cygwin/mingw to append a dot to
991
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
2600
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
992
# behavior happens only for exec(3), not for open(2)!  Also, sourcing
2601
# behavior happens only for exec(3), not for open(2)!  Also, sourcing
993
# `FILE.' does not work on cygwin managed mounts.
2602
# 'FILE.' does not work on cygwin managed mounts.
994
func_source ()
2603
func_source ()
995
{
2604
{
996
    $opt_debug
2605
    $debug_cmd
-
 
2606
 
997
    case $1 in
2607
    case $1 in
998
    */* | *\\*)	. "$1" ;;
2608
    */* | *\\*)	. "$1" ;;
999
    *)		. "./$1" ;;
2609
    *)		. "./$1" ;;
1000
    esac
2610
    esac
1001
}
2611
}
1002
 
2612
 
1003
 
2613
 
-
 
2614
# func_resolve_sysroot PATH
-
 
2615
# Replace a leading = in PATH with a sysroot.  Store the result into
-
 
2616
# func_resolve_sysroot_result
-
 
2617
func_resolve_sysroot ()
-
 
2618
{
-
 
2619
  func_resolve_sysroot_result=$1
-
 
2620
  case $func_resolve_sysroot_result in
-
 
2621
  =*)
-
 
2622
    func_stripname '=' '' "$func_resolve_sysroot_result"
-
 
2623
    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
-
 
2624
    ;;
-
 
2625
  esac
-
 
2626
}
-
 
2627
 
-
 
2628
# func_replace_sysroot PATH
-
 
2629
# If PATH begins with the sysroot, replace it with = and
-
 
2630
# store the result into func_replace_sysroot_result.
-
 
2631
func_replace_sysroot ()
-
 
2632
{
-
 
2633
  case $lt_sysroot:$1 in
-
 
2634
  ?*:"$lt_sysroot"*)
-
 
2635
    func_stripname "$lt_sysroot" '' "$1"
-
 
2636
    func_replace_sysroot_result='='$func_stripname_result
-
 
2637
    ;;
-
 
2638
  *)
-
 
2639
    # Including no sysroot.
-
 
2640
    func_replace_sysroot_result=$1
-
 
2641
    ;;
-
 
2642
  esac
-
 
2643
}
-
 
2644
 
1004
# func_infer_tag arg
2645
# func_infer_tag arg
1005
# Infer tagged configuration to use if any are available and
2646
# Infer tagged configuration to use if any are available and
1006
# if one wasn't chosen via the "--tag" command line option.
2647
# if one wasn't chosen via the "--tag" command line option.
1007
# Only attempt this if the compiler in the base compile
2648
# Only attempt this if the compiler in the base compile
1008
# command doesn't match the default compiler.
2649
# command doesn't match the default compiler.
1009
# arg is usually of the form 'gcc ...'
2650
# arg is usually of the form 'gcc ...'
1010
func_infer_tag ()
2651
func_infer_tag ()
1011
{
2652
{
1012
    $opt_debug
2653
    $debug_cmd
-
 
2654
 
1013
    if test -n "$available_tags" && test -z "$tagname"; then
2655
    if test -n "$available_tags" && test -z "$tagname"; then
1014
      CC_quoted=
2656
      CC_quoted=
1015
      for arg in $CC; do
2657
      for arg in $CC; do
1016
        func_quote_for_eval "$arg"
2658
	func_append_quoted CC_quoted "$arg"
1017
	CC_quoted="$CC_quoted $func_quote_for_eval_result"
-
 
1018
      done
2659
      done
-
 
2660
      CC_expanded=`func_echo_all $CC`
-
 
2661
      CC_quoted_expanded=`func_echo_all $CC_quoted`
1019
      case $@ in
2662
      case $@ in
1020
      # Blanks in the command may have been stripped by the calling shell,
2663
      # Blanks in the command may have been stripped by the calling shell,
1021
      # but not from the CC environment variable when configure was run.
2664
      # but not from the CC environment variable when configure was run.
-
 
2665
      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1022
      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
2666
      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1023
      # Blanks at the start of $base_compile will cause this to fail
2667
      # Blanks at the start of $base_compile will cause this to fail
1024
      # if we don't check for them as well.
2668
      # if we don't check for them as well.
1025
      *)
2669
      *)
1026
	for z in $available_tags; do
2670
	for z in $available_tags; do
1027
	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
2671
	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1028
	    # Evaluate the configuration.
2672
	    # Evaluate the configuration.
1029
	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
2673
	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1030
	    CC_quoted=
2674
	    CC_quoted=
1031
	    for arg in $CC; do
2675
	    for arg in $CC; do
1032
	      # Double-quote args containing other shell metacharacters.
2676
	      # Double-quote args containing other shell metacharacters.
1033
	      func_quote_for_eval "$arg"
2677
	      func_append_quoted CC_quoted "$arg"
1034
	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
-
 
1035
	    done
2678
	    done
-
 
2679
	    CC_expanded=`func_echo_all $CC`
-
 
2680
	    CC_quoted_expanded=`func_echo_all $CC_quoted`
1036
	    case "$@ " in
2681
	    case "$@ " in
-
 
2682
	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1037
	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
2683
	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1038
	      # The compiler in the base compile command matches
2684
	      # The compiler in the base compile command matches
1039
	      # the one in the tagged configuration.
2685
	      # the one in the tagged configuration.
1040
	      # Assume this is the tagged configuration we want.
2686
	      # Assume this is the tagged configuration we want.
1041
	      tagname=$z
2687
	      tagname=$z
1042
	      break
2688
	      break
Line 1047... Line 2693...
1047
	# If $tagname still isn't set, then no tagged configuration
2693
	# If $tagname still isn't set, then no tagged configuration
1048
	# was found and let the user know that the "--tag" command
2694
	# was found and let the user know that the "--tag" command
1049
	# line option must be used.
2695
	# line option must be used.
1050
	if test -z "$tagname"; then
2696
	if test -z "$tagname"; then
1051
	  func_echo "unable to infer tagged configuration"
2697
	  func_echo "unable to infer tagged configuration"
1052
	  func_fatal_error "specify a tag with \`--tag'"
2698
	  func_fatal_error "specify a tag with '--tag'"
1053
#	else
2699
#	else
1054
#	  func_verbose "using $tagname tagged configuration"
2700
#	  func_verbose "using $tagname tagged configuration"
1055
	fi
2701
	fi
1056
	;;
2702
	;;
1057
      esac
2703
      esac
Line 1063... Line 2709...
1063
# func_write_libtool_object output_name pic_name nonpic_name
2709
# func_write_libtool_object output_name pic_name nonpic_name
1064
# Create a libtool object file (analogous to a ".la" file),
2710
# Create a libtool object file (analogous to a ".la" file),
1065
# but don't create it if we're doing a dry run.
2711
# but don't create it if we're doing a dry run.
1066
func_write_libtool_object ()
2712
func_write_libtool_object ()
1067
{
2713
{
1068
    write_libobj=${1}
2714
    write_libobj=$1
1069
    if test "$build_libtool_libs" = yes; then
2715
    if test yes = "$build_libtool_libs"; then
1070
      write_lobj=\'${2}\'
2716
      write_lobj=\'$2\'
1071
    else
2717
    else
1072
      write_lobj=none
2718
      write_lobj=none
1073
    fi
2719
    fi
1074
 
2720
 
1075
    if test "$build_old_libs" = yes; then
2721
    if test yes = "$build_old_libs"; then
1076
      write_oldobj=\'${3}\'
2722
      write_oldobj=\'$3\'
1077
    else
2723
    else
1078
      write_oldobj=none
2724
      write_oldobj=none
1079
    fi
2725
    fi
1080
 
2726
 
1081
    $opt_dry_run || {
2727
    $opt_dry_run || {
1082
      cat >${write_libobj}T <<EOF
2728
      cat >${write_libobj}T <<EOF
1083
# $write_libobj - a libtool object file
2729
# $write_libobj - a libtool object file
1084
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
2730
# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
1085
#
2731
#
1086
# Please DO NOT delete this file!
2732
# Please DO NOT delete this file!
1087
# It is necessary for linking the library.
2733
# It is necessary for linking the library.
1088
 
2734
 
1089
# Name of the PIC object.
2735
# Name of the PIC object.
Line 1091... Line 2737...
1091
 
2737
 
1092
# Name of the non-PIC object
2738
# Name of the non-PIC object
1093
non_pic_object=$write_oldobj
2739
non_pic_object=$write_oldobj
1094
 
2740
 
1095
EOF
2741
EOF
1096
      $MV "${write_libobj}T" "${write_libobj}"
2742
      $MV "${write_libobj}T" "$write_libobj"
1097
    }
2743
    }
1098
}
2744
}
1099
 
2745
 
-
 
2746
 
-
 
2747
##################################################
-
 
2748
# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
-
 
2749
##################################################
-
 
2750
 
-
 
2751
# func_convert_core_file_wine_to_w32 ARG
-
 
2752
# Helper function used by file name conversion functions when $build is *nix,
-
 
2753
# and $host is mingw, cygwin, or some other w32 environment. Relies on a
-
 
2754
# correctly configured wine environment available, with the winepath program
-
 
2755
# in $build's $PATH.
-
 
2756
#
-
 
2757
# ARG is the $build file name to be converted to w32 format.
-
 
2758
# Result is available in $func_convert_core_file_wine_to_w32_result, and will
-
 
2759
# be empty on error (or when ARG is empty)
-
 
2760
func_convert_core_file_wine_to_w32 ()
-
 
2761
{
-
 
2762
  $debug_cmd
-
 
2763
 
-
 
2764
  func_convert_core_file_wine_to_w32_result=$1
-
 
2765
  if test -n "$1"; then
-
 
2766
    # Unfortunately, winepath does not exit with a non-zero error code, so we
-
 
2767
    # are forced to check the contents of stdout. On the other hand, if the
-
 
2768
    # command is not found, the shell will set an exit code of 127 and print
-
 
2769
    # *an error message* to stdout. So we must check for both error code of
-
 
2770
    # zero AND non-empty stdout, which explains the odd construction:
-
 
2771
    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-
 
2772
    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
-
 
2773
      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-
 
2774
        $SED -e "$sed_naive_backslashify"`
-
 
2775
    else
-
 
2776
      func_convert_core_file_wine_to_w32_result=
-
 
2777
    fi
-
 
2778
  fi
-
 
2779
}
-
 
2780
# end: func_convert_core_file_wine_to_w32
-
 
2781
 
-
 
2782
 
-
 
2783
# func_convert_core_path_wine_to_w32 ARG
-
 
2784
# Helper function used by path conversion functions when $build is *nix, and
-
 
2785
# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
-
 
2786
# configured wine environment available, with the winepath program in $build's
-
 
2787
# $PATH. Assumes ARG has no leading or trailing path separator characters.
-
 
2788
#
-
 
2789
# ARG is path to be converted from $build format to win32.
-
 
2790
# Result is available in $func_convert_core_path_wine_to_w32_result.
-
 
2791
# Unconvertible file (directory) names in ARG are skipped; if no directory names
-
 
2792
# are convertible, then the result may be empty.
-
 
2793
func_convert_core_path_wine_to_w32 ()
-
 
2794
{
-
 
2795
  $debug_cmd
-
 
2796
 
-
 
2797
  # unfortunately, winepath doesn't convert paths, only file names
-
 
2798
  func_convert_core_path_wine_to_w32_result=
-
 
2799
  if test -n "$1"; then
-
 
2800
    oldIFS=$IFS
-
 
2801
    IFS=:
-
 
2802
    for func_convert_core_path_wine_to_w32_f in $1; do
-
 
2803
      IFS=$oldIFS
-
 
2804
      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-
 
2805
      if test -n "$func_convert_core_file_wine_to_w32_result"; then
-
 
2806
        if test -z "$func_convert_core_path_wine_to_w32_result"; then
-
 
2807
          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
-
 
2808
        else
-
 
2809
          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
-
 
2810
        fi
-
 
2811
      fi
-
 
2812
    done
-
 
2813
    IFS=$oldIFS
-
 
2814
  fi
-
 
2815
}
-
 
2816
# end: func_convert_core_path_wine_to_w32
-
 
2817
 
-
 
2818
 
-
 
2819
# func_cygpath ARGS...
-
 
2820
# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
-
 
2821
# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
-
 
2822
# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
-
 
2823
# (2), returns the Cygwin file name or path in func_cygpath_result (input
-
 
2824
# file name or path is assumed to be in w32 format, as previously converted
-
 
2825
# from $build's *nix or MSYS format). In case (3), returns the w32 file name
-
 
2826
# or path in func_cygpath_result (input file name or path is assumed to be in
-
 
2827
# Cygwin format). Returns an empty string on error.
-
 
2828
#
-
 
2829
# ARGS are passed to cygpath, with the last one being the file name or path to
-
 
2830
# be converted.
-
 
2831
#
-
 
2832
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
-
 
2833
# environment variable; do not put it in $PATH.
-
 
2834
func_cygpath ()
-
 
2835
{
-
 
2836
  $debug_cmd
-
 
2837
 
-
 
2838
  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
-
 
2839
    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
-
 
2840
    if test "$?" -ne 0; then
-
 
2841
      # on failure, ensure result is empty
-
 
2842
      func_cygpath_result=
-
 
2843
    fi
-
 
2844
  else
-
 
2845
    func_cygpath_result=
-
 
2846
    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
-
 
2847
  fi
-
 
2848
}
-
 
2849
#end: func_cygpath
-
 
2850
 
-
 
2851
 
-
 
2852
# func_convert_core_msys_to_w32 ARG
-
 
2853
# Convert file name or path ARG from MSYS format to w32 format.  Return
-
 
2854
# result in func_convert_core_msys_to_w32_result.
-
 
2855
func_convert_core_msys_to_w32 ()
-
 
2856
{
-
 
2857
  $debug_cmd
-
 
2858
 
-
 
2859
  # awkward: cmd appends spaces to result
-
 
2860
  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-
 
2861
    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
-
 
2862
}
-
 
2863
#end: func_convert_core_msys_to_w32
-
 
2864
 
-
 
2865
 
-
 
2866
# func_convert_file_check ARG1 ARG2
-
 
2867
# Verify that ARG1 (a file name in $build format) was converted to $host
-
 
2868
# format in ARG2. Otherwise, emit an error message, but continue (resetting
-
 
2869
# func_to_host_file_result to ARG1).
-
 
2870
func_convert_file_check ()
-
 
2871
{
-
 
2872
  $debug_cmd
-
 
2873
 
-
 
2874
  if test -z "$2" && test -n "$1"; then
-
 
2875
    func_error "Could not determine host file name corresponding to"
-
 
2876
    func_error "  '$1'"
-
 
2877
    func_error "Continuing, but uninstalled executables may not work."
-
 
2878
    # Fallback:
-
 
2879
    func_to_host_file_result=$1
-
 
2880
  fi
-
 
2881
}
-
 
2882
# end func_convert_file_check
-
 
2883
 
-
 
2884
 
-
 
2885
# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
-
 
2886
# Verify that FROM_PATH (a path in $build format) was converted to $host
-
 
2887
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
-
 
2888
# func_to_host_file_result to a simplistic fallback value (see below).
-
 
2889
func_convert_path_check ()
-
 
2890
{
-
 
2891
  $debug_cmd
-
 
2892
 
-
 
2893
  if test -z "$4" && test -n "$3"; then
-
 
2894
    func_error "Could not determine the host path corresponding to"
-
 
2895
    func_error "  '$3'"
-
 
2896
    func_error "Continuing, but uninstalled executables may not work."
-
 
2897
    # Fallback.  This is a deliberately simplistic "conversion" and
-
 
2898
    # should not be "improved".  See libtool.info.
-
 
2899
    if test "x$1" != "x$2"; then
-
 
2900
      lt_replace_pathsep_chars="s|$1|$2|g"
-
 
2901
      func_to_host_path_result=`echo "$3" |
-
 
2902
        $SED -e "$lt_replace_pathsep_chars"`
-
 
2903
    else
-
 
2904
      func_to_host_path_result=$3
-
 
2905
    fi
-
 
2906
  fi
-
 
2907
}
-
 
2908
# end func_convert_path_check
-
 
2909
 
-
 
2910
 
-
 
2911
# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
-
 
2912
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
-
 
2913
# and appending REPL if ORIG matches BACKPAT.
-
 
2914
func_convert_path_front_back_pathsep ()
-
 
2915
{
-
 
2916
  $debug_cmd
-
 
2917
 
-
 
2918
  case $4 in
-
 
2919
  $1 ) func_to_host_path_result=$3$func_to_host_path_result
-
 
2920
    ;;
-
 
2921
  esac
-
 
2922
  case $4 in
-
 
2923
  $2 ) func_append func_to_host_path_result "$3"
-
 
2924
    ;;
-
 
2925
  esac
-
 
2926
}
-
 
2927
# end func_convert_path_front_back_pathsep
-
 
2928
 
-
 
2929
 
-
 
2930
##################################################
-
 
2931
# $build to $host FILE NAME CONVERSION FUNCTIONS #
-
 
2932
##################################################
-
 
2933
# invoked via '$to_host_file_cmd ARG'
-
 
2934
#
-
 
2935
# In each case, ARG is the path to be converted from $build to $host format.
-
 
2936
# Result will be available in $func_to_host_file_result.
-
 
2937
 
-
 
2938
 
-
 
2939
# func_to_host_file ARG
-
 
2940
# Converts the file name ARG from $build format to $host format. Return result
-
 
2941
# in func_to_host_file_result.
-
 
2942
func_to_host_file ()
-
 
2943
{
-
 
2944
  $debug_cmd
-
 
2945
 
-
 
2946
  $to_host_file_cmd "$1"
-
 
2947
}
-
 
2948
# end func_to_host_file
-
 
2949
 
-
 
2950
 
-
 
2951
# func_to_tool_file ARG LAZY
-
 
2952
# converts the file name ARG from $build format to toolchain format. Return
-
 
2953
# result in func_to_tool_file_result.  If the conversion in use is listed
-
 
2954
# in (the comma separated) LAZY, no conversion takes place.
-
 
2955
func_to_tool_file ()
-
 
2956
{
-
 
2957
  $debug_cmd
-
 
2958
 
-
 
2959
  case ,$2, in
-
 
2960
    *,"$to_tool_file_cmd",*)
-
 
2961
      func_to_tool_file_result=$1
-
 
2962
      ;;
-
 
2963
    *)
-
 
2964
      $to_tool_file_cmd "$1"
-
 
2965
      func_to_tool_file_result=$func_to_host_file_result
-
 
2966
      ;;
-
 
2967
  esac
-
 
2968
}
-
 
2969
# end func_to_tool_file
-
 
2970
 
-
 
2971
 
-
 
2972
# func_convert_file_noop ARG
-
 
2973
# Copy ARG to func_to_host_file_result.
-
 
2974
func_convert_file_noop ()
-
 
2975
{
-
 
2976
  func_to_host_file_result=$1
-
 
2977
}
-
 
2978
# end func_convert_file_noop
-
 
2979
 
-
 
2980
 
-
 
2981
# func_convert_file_msys_to_w32 ARG
-
 
2982
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
-
 
2983
# conversion to w32 is not available inside the cwrapper.  Returns result in
-
 
2984
# func_to_host_file_result.
-
 
2985
func_convert_file_msys_to_w32 ()
-
 
2986
{
-
 
2987
  $debug_cmd
-
 
2988
 
-
 
2989
  func_to_host_file_result=$1
-
 
2990
  if test -n "$1"; then
-
 
2991
    func_convert_core_msys_to_w32 "$1"
-
 
2992
    func_to_host_file_result=$func_convert_core_msys_to_w32_result
-
 
2993
  fi
-
 
2994
  func_convert_file_check "$1" "$func_to_host_file_result"
-
 
2995
}
-
 
2996
# end func_convert_file_msys_to_w32
-
 
2997
 
-
 
2998
 
-
 
2999
# func_convert_file_cygwin_to_w32 ARG
-
 
3000
# Convert file name ARG from Cygwin to w32 format.  Returns result in
-
 
3001
# func_to_host_file_result.
-
 
3002
func_convert_file_cygwin_to_w32 ()
-
 
3003
{
-
 
3004
  $debug_cmd
-
 
3005
 
-
 
3006
  func_to_host_file_result=$1
-
 
3007
  if test -n "$1"; then
-
 
3008
    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
-
 
3009
    # LT_CYGPATH in this case.
-
 
3010
    func_to_host_file_result=`cygpath -m "$1"`
-
 
3011
  fi
-
 
3012
  func_convert_file_check "$1" "$func_to_host_file_result"
-
 
3013
}
-
 
3014
# end func_convert_file_cygwin_to_w32
-
 
3015
 
-
 
3016
 
-
 
3017
# func_convert_file_nix_to_w32 ARG
-
 
3018
# Convert file name ARG from *nix to w32 format.  Requires a wine environment
-
 
3019
# and a working winepath. Returns result in func_to_host_file_result.
-
 
3020
func_convert_file_nix_to_w32 ()
-
 
3021
{
-
 
3022
  $debug_cmd
-
 
3023
 
-
 
3024
  func_to_host_file_result=$1
-
 
3025
  if test -n "$1"; then
-
 
3026
    func_convert_core_file_wine_to_w32 "$1"
-
 
3027
    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
-
 
3028
  fi
-
 
3029
  func_convert_file_check "$1" "$func_to_host_file_result"
-
 
3030
}
-
 
3031
# end func_convert_file_nix_to_w32
-
 
3032
 
-
 
3033
 
-
 
3034
# func_convert_file_msys_to_cygwin ARG
-
 
3035
# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-
 
3036
# Returns result in func_to_host_file_result.
-
 
3037
func_convert_file_msys_to_cygwin ()
-
 
3038
{
-
 
3039
  $debug_cmd
-
 
3040
 
-
 
3041
  func_to_host_file_result=$1
-
 
3042
  if test -n "$1"; then
-
 
3043
    func_convert_core_msys_to_w32 "$1"
-
 
3044
    func_cygpath -u "$func_convert_core_msys_to_w32_result"
-
 
3045
    func_to_host_file_result=$func_cygpath_result
-
 
3046
  fi
-
 
3047
  func_convert_file_check "$1" "$func_to_host_file_result"
-
 
3048
}
-
 
3049
# end func_convert_file_msys_to_cygwin
-
 
3050
 
-
 
3051
 
-
 
3052
# func_convert_file_nix_to_cygwin ARG
-
 
3053
# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
-
 
3054
# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
-
 
3055
# in func_to_host_file_result.
-
 
3056
func_convert_file_nix_to_cygwin ()
-
 
3057
{
-
 
3058
  $debug_cmd
-
 
3059
 
-
 
3060
  func_to_host_file_result=$1
-
 
3061
  if test -n "$1"; then
-
 
3062
    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
-
 
3063
    func_convert_core_file_wine_to_w32 "$1"
-
 
3064
    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-
 
3065
    func_to_host_file_result=$func_cygpath_result
-
 
3066
  fi
-
 
3067
  func_convert_file_check "$1" "$func_to_host_file_result"
-
 
3068
}
-
 
3069
# end func_convert_file_nix_to_cygwin
-
 
3070
 
-
 
3071
 
-
 
3072
#############################################
-
 
3073
# $build to $host PATH CONVERSION FUNCTIONS #
-
 
3074
#############################################
-
 
3075
# invoked via '$to_host_path_cmd ARG'
-
 
3076
#
-
 
3077
# In each case, ARG is the path to be converted from $build to $host format.
-
 
3078
# The result will be available in $func_to_host_path_result.
-
 
3079
#
-
 
3080
# Path separators are also converted from $build format to $host format.  If
-
 
3081
# ARG begins or ends with a path separator character, it is preserved (but
-
 
3082
# converted to $host format) on output.
-
 
3083
#
-
 
3084
# All path conversion functions are named using the following convention:
-
 
3085
#   file name conversion function    : func_convert_file_X_to_Y ()
-
 
3086
#   path conversion function         : func_convert_path_X_to_Y ()
-
 
3087
# where, for any given $build/$host combination the 'X_to_Y' value is the
-
 
3088
# same.  If conversion functions are added for new $build/$host combinations,
-
 
3089
# the two new functions must follow this pattern, or func_init_to_host_path_cmd
-
 
3090
# will break.
-
 
3091
 
-
 
3092
 
-
 
3093
# func_init_to_host_path_cmd
-
 
3094
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
-
 
3095
# appropriate value, based on the value of $to_host_file_cmd.
-
 
3096
to_host_path_cmd=
-
 
3097
func_init_to_host_path_cmd ()
-
 
3098
{
-
 
3099
  $debug_cmd
-
 
3100
 
-
 
3101
  if test -z "$to_host_path_cmd"; then
-
 
3102
    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-
 
3103
    to_host_path_cmd=func_convert_path_$func_stripname_result
-
 
3104
  fi
-
 
3105
}
-
 
3106
 
-
 
3107
 
-
 
3108
# func_to_host_path ARG
-
 
3109
# Converts the path ARG from $build format to $host format. Return result
-
 
3110
# in func_to_host_path_result.
-
 
3111
func_to_host_path ()
-
 
3112
{
-
 
3113
  $debug_cmd
-
 
3114
 
-
 
3115
  func_init_to_host_path_cmd
-
 
3116
  $to_host_path_cmd "$1"
-
 
3117
}
-
 
3118
# end func_to_host_path
-
 
3119
 
-
 
3120
 
-
 
3121
# func_convert_path_noop ARG
-
 
3122
# Copy ARG to func_to_host_path_result.
-
 
3123
func_convert_path_noop ()
-
 
3124
{
-
 
3125
  func_to_host_path_result=$1
-
 
3126
}
-
 
3127
# end func_convert_path_noop
-
 
3128
 
-
 
3129
 
-
 
3130
# func_convert_path_msys_to_w32 ARG
-
 
3131
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
-
 
3132
# conversion to w32 is not available inside the cwrapper.  Returns result in
-
 
3133
# func_to_host_path_result.
-
 
3134
func_convert_path_msys_to_w32 ()
-
 
3135
{
-
 
3136
  $debug_cmd
-
 
3137
 
-
 
3138
  func_to_host_path_result=$1
-
 
3139
  if test -n "$1"; then
-
 
3140
    # Remove leading and trailing path separator characters from ARG.  MSYS
-
 
3141
    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
-
 
3142
    # and winepath ignores them completely.
-
 
3143
    func_stripname : : "$1"
-
 
3144
    func_to_host_path_tmp1=$func_stripname_result
-
 
3145
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-
 
3146
    func_to_host_path_result=$func_convert_core_msys_to_w32_result
-
 
3147
    func_convert_path_check : ";" \
-
 
3148
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-
 
3149
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-
 
3150
  fi
-
 
3151
}
-
 
3152
# end func_convert_path_msys_to_w32
-
 
3153
 
-
 
3154
 
-
 
3155
# func_convert_path_cygwin_to_w32 ARG
-
 
3156
# Convert path ARG from Cygwin to w32 format.  Returns result in
-
 
3157
# func_to_host_file_result.
-
 
3158
func_convert_path_cygwin_to_w32 ()
-
 
3159
{
-
 
3160
  $debug_cmd
-
 
3161
 
-
 
3162
  func_to_host_path_result=$1
-
 
3163
  if test -n "$1"; then
-
 
3164
    # See func_convert_path_msys_to_w32:
-
 
3165
    func_stripname : : "$1"
-
 
3166
    func_to_host_path_tmp1=$func_stripname_result
-
 
3167
    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
-
 
3168
    func_convert_path_check : ";" \
-
 
3169
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-
 
3170
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-
 
3171
  fi
-
 
3172
}
-
 
3173
# end func_convert_path_cygwin_to_w32
-
 
3174
 
-
 
3175
 
-
 
3176
# func_convert_path_nix_to_w32 ARG
-
 
3177
# Convert path ARG from *nix to w32 format.  Requires a wine environment and
-
 
3178
# a working winepath.  Returns result in func_to_host_file_result.
-
 
3179
func_convert_path_nix_to_w32 ()
-
 
3180
{
-
 
3181
  $debug_cmd
-
 
3182
 
-
 
3183
  func_to_host_path_result=$1
-
 
3184
  if test -n "$1"; then
-
 
3185
    # See func_convert_path_msys_to_w32:
-
 
3186
    func_stripname : : "$1"
-
 
3187
    func_to_host_path_tmp1=$func_stripname_result
-
 
3188
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-
 
3189
    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
-
 
3190
    func_convert_path_check : ";" \
-
 
3191
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-
 
3192
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
-
 
3193
  fi
-
 
3194
}
-
 
3195
# end func_convert_path_nix_to_w32
-
 
3196
 
-
 
3197
 
-
 
3198
# func_convert_path_msys_to_cygwin ARG
-
 
3199
# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
-
 
3200
# Returns result in func_to_host_file_result.
-
 
3201
func_convert_path_msys_to_cygwin ()
-
 
3202
{
-
 
3203
  $debug_cmd
-
 
3204
 
-
 
3205
  func_to_host_path_result=$1
-
 
3206
  if test -n "$1"; then
-
 
3207
    # See func_convert_path_msys_to_w32:
-
 
3208
    func_stripname : : "$1"
-
 
3209
    func_to_host_path_tmp1=$func_stripname_result
-
 
3210
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-
 
3211
    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-
 
3212
    func_to_host_path_result=$func_cygpath_result
-
 
3213
    func_convert_path_check : : \
-
 
3214
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-
 
3215
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-
 
3216
  fi
-
 
3217
}
-
 
3218
# end func_convert_path_msys_to_cygwin
-
 
3219
 
-
 
3220
 
-
 
3221
# func_convert_path_nix_to_cygwin ARG
-
 
3222
# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
-
 
3223
# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
-
 
3224
# func_to_host_file_result.
-
 
3225
func_convert_path_nix_to_cygwin ()
-
 
3226
{
-
 
3227
  $debug_cmd
-
 
3228
 
-
 
3229
  func_to_host_path_result=$1
-
 
3230
  if test -n "$1"; then
-
 
3231
    # Remove leading and trailing path separator characters from
-
 
3232
    # ARG. msys behavior is inconsistent here, cygpath turns them
-
 
3233
    # into '.;' and ';.', and winepath ignores them completely.
-
 
3234
    func_stripname : : "$1"
-
 
3235
    func_to_host_path_tmp1=$func_stripname_result
-
 
3236
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-
 
3237
    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-
 
3238
    func_to_host_path_result=$func_cygpath_result
-
 
3239
    func_convert_path_check : : \
-
 
3240
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
-
 
3241
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
-
 
3242
  fi
-
 
3243
}
-
 
3244
# end func_convert_path_nix_to_cygwin
-
 
3245
 
-
 
3246
 
-
 
3247
# func_dll_def_p FILE
-
 
3248
# True iff FILE is a Windows DLL '.def' file.
-
 
3249
# Keep in sync with _LT_DLL_DEF_P in libtool.m4
-
 
3250
func_dll_def_p ()
-
 
3251
{
-
 
3252
  $debug_cmd
-
 
3253
 
-
 
3254
  func_dll_def_p_tmp=`$SED -n \
-
 
3255
    -e 's/^[	 ]*//' \
-
 
3256
    -e '/^\(;.*\)*$/d' \
-
 
3257
    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
-
 
3258
    -e q \
-
 
3259
    "$1"`
-
 
3260
  test DEF = "$func_dll_def_p_tmp"
-
 
3261
}
-
 
3262
 
-
 
3263
 
1100
# func_mode_compile arg...
3264
# func_mode_compile arg...
1101
func_mode_compile ()
3265
func_mode_compile ()
1102
{
3266
{
1103
    $opt_debug
3267
    $debug_cmd
-
 
3268
 
1104
    # Get the compilation command and the source file.
3269
    # Get the compilation command and the source file.
1105
    base_compile=
3270
    base_compile=
1106
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
3271
    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
1107
    suppress_opt=yes
3272
    suppress_opt=yes
1108
    suppress_output=
3273
    suppress_output=
1109
    arg_mode=normal
3274
    arg_mode=normal
1110
    libobj=
3275
    libobj=
1111
    later=
3276
    later=
Line 1114... Line 3279...
1114
    for arg
3279
    for arg
1115
    do
3280
    do
1116
      case $arg_mode in
3281
      case $arg_mode in
1117
      arg  )
3282
      arg  )
1118
	# do not "continue".  Instead, add this to base_compile
3283
	# do not "continue".  Instead, add this to base_compile
1119
	lastarg="$arg"
3284
	lastarg=$arg
1120
	arg_mode=normal
3285
	arg_mode=normal
1121
	;;
3286
	;;
1122
 
3287
 
1123
      target )
3288
      target )
1124
	libobj="$arg"
3289
	libobj=$arg
1125
	arg_mode=normal
3290
	arg_mode=normal
1126
	continue
3291
	continue
1127
	;;
3292
	;;
1128
 
3293
 
1129
      normal )
3294
      normal )
1130
	# Accept any command-line options.
3295
	# Accept any command-line options.
1131
	case $arg in
3296
	case $arg in
1132
	-o)
3297
	-o)
1133
	  test -n "$libobj" && \
3298
	  test -n "$libobj" && \
1134
	    func_fatal_error "you cannot specify \`-o' more than once"
3299
	    func_fatal_error "you cannot specify '-o' more than once"
1135
	  arg_mode=target
3300
	  arg_mode=target
1136
	  continue
3301
	  continue
1137
	  ;;
3302
	  ;;
1138
 
3303
 
1139
	-pie | -fpie | -fPIE)
3304
	-pie | -fpie | -fPIE)
1140
          pie_flag="$pie_flag $arg"
3305
          func_append pie_flag " $arg"
1141
	  continue
3306
	  continue
1142
	  ;;
3307
	  ;;
1143
 
3308
 
1144
	-shared | -static | -prefer-pic | -prefer-non-pic)
3309
	-shared | -static | -prefer-pic | -prefer-non-pic)
1145
	  later="$later $arg"
3310
	  func_append later " $arg"
1146
	  continue
3311
	  continue
1147
	  ;;
3312
	  ;;
1148
 
3313
 
1149
	-no-suppress)
3314
	-no-suppress)
1150
	  suppress_opt=no
3315
	  suppress_opt=no
Line 1158... Line 3323...
1158
 
3323
 
1159
	-Wc,*)
3324
	-Wc,*)
1160
	  func_stripname '-Wc,' '' "$arg"
3325
	  func_stripname '-Wc,' '' "$arg"
1161
	  args=$func_stripname_result
3326
	  args=$func_stripname_result
1162
	  lastarg=
3327
	  lastarg=
1163
	  save_ifs="$IFS"; IFS=','
3328
	  save_ifs=$IFS; IFS=,
1164
	  for arg in $args; do
3329
	  for arg in $args; do
1165
	    IFS="$save_ifs"
3330
	    IFS=$save_ifs
1166
	    func_quote_for_eval "$arg"
3331
	    func_append_quoted lastarg "$arg"
1167
	    lastarg="$lastarg $func_quote_for_eval_result"
-
 
1168
	  done
3332
	  done
1169
	  IFS="$save_ifs"
3333
	  IFS=$save_ifs
1170
	  func_stripname ' ' '' "$lastarg"
3334
	  func_stripname ' ' '' "$lastarg"
1171
	  lastarg=$func_stripname_result
3335
	  lastarg=$func_stripname_result
1172
 
3336
 
1173
	  # Add the arguments to base_compile.
3337
	  # Add the arguments to base_compile.
1174
	  base_compile="$base_compile $lastarg"
3338
	  func_append base_compile " $lastarg"
1175
	  continue
3339
	  continue
1176
	  ;;
3340
	  ;;
1177
 
3341
 
1178
	*)
3342
	*)
1179
	  # Accept the current argument as the source file.
3343
	  # Accept the current argument as the source file.
1180
	  # The previous "srcfile" becomes the current argument.
3344
	  # The previous "srcfile" becomes the current argument.
1181
	  #
3345
	  #
1182
	  lastarg="$srcfile"
3346
	  lastarg=$srcfile
1183
	  srcfile="$arg"
3347
	  srcfile=$arg
1184
	  ;;
3348
	  ;;
1185
	esac  #  case $arg
3349
	esac  #  case $arg
1186
	;;
3350
	;;
1187
      esac    #  case $arg_mode
3351
      esac    #  case $arg_mode
1188
 
3352
 
1189
      # Aesthetically quote the previous argument.
3353
      # Aesthetically quote the previous argument.
1190
      func_quote_for_eval "$lastarg"
3354
      func_append_quoted base_compile "$lastarg"
1191
      base_compile="$base_compile $func_quote_for_eval_result"
-
 
1192
    done # for arg
3355
    done # for arg
1193
 
3356
 
1194
    case $arg_mode in
3357
    case $arg_mode in
1195
    arg)
3358
    arg)
1196
      func_fatal_error "you must specify an argument for -Xcompile"
3359
      func_fatal_error "you must specify an argument for -Xcompile"
1197
      ;;
3360
      ;;
1198
    target)
3361
    target)
1199
      func_fatal_error "you must specify a target with \`-o'"
3362
      func_fatal_error "you must specify a target with '-o'"
1200
      ;;
3363
      ;;
1201
    *)
3364
    *)
1202
      # Get the name of the library object.
3365
      # Get the name of the library object.
1203
      test -z "$libobj" && {
3366
      test -z "$libobj" && {
1204
	func_basename "$srcfile"
3367
	func_basename "$srcfile"
1205
	libobj="$func_basename_result"
3368
	libobj=$func_basename_result
1206
      }
3369
      }
1207
      ;;
3370
      ;;
1208
    esac
3371
    esac
1209
 
3372
 
1210
    # Recognize several different file suffixes.
3373
    # Recognize several different file suffixes.
1211
    # If the user specifies -o file.o, it is replaced with file.lo
3374
    # If the user specifies -o file.o, it is replaced with file.lo
1212
    case $libobj in
3375
    case $libobj in
1213
    *.[cCFSifmso] | \
3376
    *.[cCFSifmso] | \
1214
    *.ada | *.adb | *.ads | *.asm | \
3377
    *.ada | *.adb | *.ads | *.asm | \
1215
    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
3378
    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1216
    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
3379
    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
1217
      func_xform "$libobj"
3380
      func_xform "$libobj"
1218
      libobj=$func_xform_result
3381
      libobj=$func_xform_result
1219
      ;;
3382
      ;;
1220
    esac
3383
    esac
1221
 
3384
 
1222
    case $libobj in
3385
    case $libobj in
1223
    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
3386
    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
1224
    *)
3387
    *)
1225
      func_fatal_error "cannot determine name of library object from \`$libobj'"
3388
      func_fatal_error "cannot determine name of library object from '$libobj'"
1226
      ;;
3389
      ;;
1227
    esac
3390
    esac
1228
 
3391
 
1229
    func_infer_tag $base_compile
3392
    func_infer_tag $base_compile
1230
 
3393
 
1231
    for arg in $later; do
3394
    for arg in $later; do
1232
      case $arg in
3395
      case $arg in
1233
      -shared)
3396
      -shared)
1234
	test "$build_libtool_libs" != yes && \
3397
	test yes = "$build_libtool_libs" \
1235
	  func_fatal_configuration "can not build a shared library"
3398
	  || func_fatal_configuration "cannot build a shared library"
1236
	build_old_libs=no
3399
	build_old_libs=no
1237
	continue
3400
	continue
1238
	;;
3401
	;;
1239
 
3402
 
1240
      -static)
3403
      -static)
Line 1256... Line 3419...
1256
    done
3419
    done
1257
 
3420
 
1258
    func_quote_for_eval "$libobj"
3421
    func_quote_for_eval "$libobj"
1259
    test "X$libobj" != "X$func_quote_for_eval_result" \
3422
    test "X$libobj" != "X$func_quote_for_eval_result" \
1260
      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
3423
      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
1261
      && func_warning "libobj name \`$libobj' may not contain shell special characters."
3424
      && func_warning "libobj name '$libobj' may not contain shell special characters."
1262
    func_dirname_and_basename "$obj" "/" ""
3425
    func_dirname_and_basename "$obj" "/" ""
1263
    objname="$func_basename_result"
3426
    objname=$func_basename_result
1264
    xdir="$func_dirname_result"
3427
    xdir=$func_dirname_result
1265
    lobj=${xdir}$objdir/$objname
3428
    lobj=$xdir$objdir/$objname
1266
 
3429
 
1267
    test -z "$base_compile" && \
3430
    test -z "$base_compile" && \
1268
      func_fatal_help "you must specify a compilation command"
3431
      func_fatal_help "you must specify a compilation command"
1269
 
3432
 
1270
    # Delete any leftover library objects.
3433
    # Delete any leftover library objects.
1271
    if test "$build_old_libs" = yes; then
3434
    if test yes = "$build_old_libs"; then
1272
      removelist="$obj $lobj $libobj ${libobj}T"
3435
      removelist="$obj $lobj $libobj ${libobj}T"
1273
    else
3436
    else
1274
      removelist="$lobj $libobj ${libobj}T"
3437
      removelist="$lobj $libobj ${libobj}T"
1275
    fi
3438
    fi
1276
 
3439
 
Line 1278... Line 3441...
1278
    case $host_os in
3441
    case $host_os in
1279
    cygwin* | mingw* | pw32* | os2* | cegcc*)
3442
    cygwin* | mingw* | pw32* | os2* | cegcc*)
1280
      pic_mode=default
3443
      pic_mode=default
1281
      ;;
3444
      ;;
1282
    esac
3445
    esac
1283
    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
3446
    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
1284
      # non-PIC code in shared libraries is not supported
3447
      # non-PIC code in shared libraries is not supported
1285
      pic_mode=default
3448
      pic_mode=default
1286
    fi
3449
    fi
1287
 
3450
 
1288
    # Calculate the filename of the output object if compiler does
3451
    # Calculate the filename of the output object if compiler does
1289
    # not support -o with -c
3452
    # not support -o with -c
1290
    if test "$compiler_c_o" = no; then
3453
    if test no = "$compiler_c_o"; then
1291
      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
3454
      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
1292
      lockfile="$output_obj.lock"
3455
      lockfile=$output_obj.lock
1293
    else
3456
    else
1294
      output_obj=
3457
      output_obj=
1295
      need_locks=no
3458
      need_locks=no
1296
      lockfile=
3459
      lockfile=
1297
    fi
3460
    fi
1298
 
3461
 
1299
    # Lock this critical section if it is needed
3462
    # Lock this critical section if it is needed
1300
    # We use this script file to make the link, it avoids creating a new file
3463
    # We use this script file to make the link, it avoids creating a new file
1301
    if test "$need_locks" = yes; then
3464
    if test yes = "$need_locks"; then
1302
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3465
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
1303
	func_echo "Waiting for $lockfile to be removed"
3466
	func_echo "Waiting for $lockfile to be removed"
1304
	sleep 2
3467
	sleep 2
1305
      done
3468
      done
1306
    elif test "$need_locks" = warn; then
3469
    elif test warn = "$need_locks"; then
1307
      if test -f "$lockfile"; then
3470
      if test -f "$lockfile"; then
1308
	$ECHO "\
3471
	$ECHO "\
1309
*** ERROR, $lockfile exists and contains:
3472
*** ERROR, $lockfile exists and contains:
1310
`cat $lockfile 2>/dev/null`
3473
`cat $lockfile 2>/dev/null`
1311
 
3474
 
1312
This indicates that another process is trying to use the same
3475
This indicates that another process is trying to use the same
1313
temporary object file, and libtool could not work around it because
3476
temporary object file, and libtool could not work around it because
1314
your compiler does not support \`-c' and \`-o' together.  If you
3477
your compiler does not support '-c' and '-o' together.  If you
1315
repeat this compilation, it may succeed, by chance, but you had better
3478
repeat this compilation, it may succeed, by chance, but you had better
1316
avoid parallel builds (make -j) in this platform, or get a better
3479
avoid parallel builds (make -j) in this platform, or get a better
1317
compiler."
3480
compiler."
1318
 
3481
 
1319
	$opt_dry_run || $RM $removelist
3482
	$opt_dry_run || $RM $removelist
1320
	exit $EXIT_FAILURE
3483
	exit $EXIT_FAILURE
1321
      fi
3484
      fi
1322
      removelist="$removelist $output_obj"
3485
      func_append removelist " $output_obj"
1323
      $ECHO "$srcfile" > "$lockfile"
3486
      $ECHO "$srcfile" > "$lockfile"
1324
    fi
3487
    fi
1325
 
3488
 
1326
    $opt_dry_run || $RM $removelist
3489
    $opt_dry_run || $RM $removelist
1327
    removelist="$removelist $lockfile"
3490
    func_append removelist " $lockfile"
1328
    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
3491
    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1329
 
3492
 
1330
    if test -n "$fix_srcfile_path"; then
3493
    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
1331
      eval srcfile=\"$fix_srcfile_path\"
3494
    srcfile=$func_to_tool_file_result
1332
    fi
-
 
1333
    func_quote_for_eval "$srcfile"
3495
    func_quote_for_eval "$srcfile"
1334
    qsrcfile=$func_quote_for_eval_result
3496
    qsrcfile=$func_quote_for_eval_result
1335
 
3497
 
1336
    # Only build a PIC object if we are building libtool libraries.
3498
    # Only build a PIC object if we are building libtool libraries.
1337
    if test "$build_libtool_libs" = yes; then
3499
    if test yes = "$build_libtool_libs"; then
1338
      # Without this assignment, base_compile gets emptied.
3500
      # Without this assignment, base_compile gets emptied.
1339
      fbsd_hideous_sh_bug=$base_compile
3501
      fbsd_hideous_sh_bug=$base_compile
1340
 
3502
 
1341
      if test "$pic_mode" != no; then
3503
      if test no != "$pic_mode"; then
1342
	command="$base_compile $qsrcfile $pic_flag"
3504
	command="$base_compile $qsrcfile $pic_flag"
1343
      else
3505
      else
1344
	# Don't build PIC code
3506
	# Don't build PIC code
1345
	command="$base_compile $qsrcfile"
3507
	command="$base_compile $qsrcfile"
1346
      fi
3508
      fi
1347
 
3509
 
1348
      func_mkdir_p "$xdir$objdir"
3510
      func_mkdir_p "$xdir$objdir"
1349
 
3511
 
1350
      if test -z "$output_obj"; then
3512
      if test -z "$output_obj"; then
1351
	# Place PIC objects in $objdir
3513
	# Place PIC objects in $objdir
1352
	command="$command -o $lobj"
3514
	func_append command " -o $lobj"
1353
      fi
3515
      fi
1354
 
3516
 
1355
      func_show_eval_locale "$command"	\
3517
      func_show_eval_locale "$command"	\
1356
          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
3518
          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1357
 
3519
 
1358
      if test "$need_locks" = warn &&
3520
      if test warn = "$need_locks" &&
1359
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
3521
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1360
	$ECHO "\
3522
	$ECHO "\
1361
*** ERROR, $lockfile contains:
3523
*** ERROR, $lockfile contains:
1362
`cat $lockfile 2>/dev/null`
3524
`cat $lockfile 2>/dev/null`
1363
 
3525
 
1364
but it should contain:
3526
but it should contain:
1365
$srcfile
3527
$srcfile
1366
 
3528
 
1367
This indicates that another process is trying to use the same
3529
This indicates that another process is trying to use the same
1368
temporary object file, and libtool could not work around it because
3530
temporary object file, and libtool could not work around it because
1369
your compiler does not support \`-c' and \`-o' together.  If you
3531
your compiler does not support '-c' and '-o' together.  If you
1370
repeat this compilation, it may succeed, by chance, but you had better
3532
repeat this compilation, it may succeed, by chance, but you had better
1371
avoid parallel builds (make -j) in this platform, or get a better
3533
avoid parallel builds (make -j) in this platform, or get a better
1372
compiler."
3534
compiler."
1373
 
3535
 
1374
	$opt_dry_run || $RM $removelist
3536
	$opt_dry_run || $RM $removelist
Line 1380... Line 3542...
1380
	func_show_eval '$MV "$output_obj" "$lobj"' \
3542
	func_show_eval '$MV "$output_obj" "$lobj"' \
1381
	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
3543
	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1382
      fi
3544
      fi
1383
 
3545
 
1384
      # Allow error messages only from the first compilation.
3546
      # Allow error messages only from the first compilation.
1385
      if test "$suppress_opt" = yes; then
3547
      if test yes = "$suppress_opt"; then
1386
	suppress_output=' >/dev/null 2>&1'
3548
	suppress_output=' >/dev/null 2>&1'
1387
      fi
3549
      fi
1388
    fi
3550
    fi
1389
 
3551
 
1390
    # Only build a position-dependent object if we build old libraries.
3552
    # Only build a position-dependent object if we build old libraries.
1391
    if test "$build_old_libs" = yes; then
3553
    if test yes = "$build_old_libs"; then
1392
      if test "$pic_mode" != yes; then
3554
      if test yes != "$pic_mode"; then
1393
	# Don't build PIC code
3555
	# Don't build PIC code
1394
	command="$base_compile $qsrcfile$pie_flag"
3556
	command="$base_compile $qsrcfile$pie_flag"
1395
      else
3557
      else
1396
	command="$base_compile $qsrcfile $pic_flag"
3558
	command="$base_compile $qsrcfile $pic_flag"
1397
      fi
3559
      fi
1398
      if test "$compiler_c_o" = yes; then
3560
      if test yes = "$compiler_c_o"; then
1399
	command="$command -o $obj"
3561
	func_append command " -o $obj"
1400
      fi
3562
      fi
1401
 
3563
 
1402
      # Suppress compiler output if we already did a PIC compilation.
3564
      # Suppress compiler output if we already did a PIC compilation.
1403
      command="$command$suppress_output"
3565
      func_append command "$suppress_output"
1404
      func_show_eval_locale "$command" \
3566
      func_show_eval_locale "$command" \
1405
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
3567
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1406
 
3568
 
1407
      if test "$need_locks" = warn &&
3569
      if test warn = "$need_locks" &&
1408
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
3570
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1409
	$ECHO "\
3571
	$ECHO "\
1410
*** ERROR, $lockfile contains:
3572
*** ERROR, $lockfile contains:
1411
`cat $lockfile 2>/dev/null`
3573
`cat $lockfile 2>/dev/null`
1412
 
3574
 
1413
but it should contain:
3575
but it should contain:
1414
$srcfile
3576
$srcfile
1415
 
3577
 
1416
This indicates that another process is trying to use the same
3578
This indicates that another process is trying to use the same
1417
temporary object file, and libtool could not work around it because
3579
temporary object file, and libtool could not work around it because
1418
your compiler does not support \`-c' and \`-o' together.  If you
3580
your compiler does not support '-c' and '-o' together.  If you
1419
repeat this compilation, it may succeed, by chance, but you had better
3581
repeat this compilation, it may succeed, by chance, but you had better
1420
avoid parallel builds (make -j) in this platform, or get a better
3582
avoid parallel builds (make -j) in this platform, or get a better
1421
compiler."
3583
compiler."
1422
 
3584
 
1423
	$opt_dry_run || $RM $removelist
3585
	$opt_dry_run || $RM $removelist
Line 1433... Line 3595...
1433
 
3595
 
1434
    $opt_dry_run || {
3596
    $opt_dry_run || {
1435
      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
3597
      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
1436
 
3598
 
1437
      # Unlock the critical section if it was locked
3599
      # Unlock the critical section if it was locked
1438
      if test "$need_locks" != no; then
3600
      if test no != "$need_locks"; then
1439
	removelist=$lockfile
3601
	removelist=$lockfile
1440
        $RM "$lockfile"
3602
        $RM "$lockfile"
1441
      fi
3603
      fi
1442
    }
3604
    }
1443
 
3605
 
1444
    exit $EXIT_SUCCESS
3606
    exit $EXIT_SUCCESS
1445
}
3607
}
1446
 
3608
 
1447
$opt_help || {
3609
$opt_help || {
1448
test "$mode" = compile && func_mode_compile ${1+"$@"}
3610
  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
1449
}
3611
}
1450
 
3612
 
1451
func_mode_help ()
3613
func_mode_help ()
1452
{
3614
{
1453
    # We need to display help for each of the modes.
3615
    # We need to display help for each of the modes.
1454
    case $mode in
3616
    case $opt_mode in
1455
      "")
3617
      "")
1456
        # Generic help is extracted from the usage comments
3618
        # Generic help is extracted from the usage comments
1457
        # at the start of this file.
3619
        # at the start of this file.
1458
        func_help
3620
        func_help
1459
        ;;
3621
        ;;
Line 1463... Line 3625...
1463
"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
3625
"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
1464
 
3626
 
1465
Remove files from the build directory.
3627
Remove files from the build directory.
1466
 
3628
 
1467
RM is the name of the program to use to delete files associated with each FILE
3629
RM is the name of the program to use to delete files associated with each FILE
1468
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
3630
(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
1469
to RM.
3631
to RM.
1470
 
3632
 
1471
If FILE is a libtool library, object or program, all the files associated
3633
If FILE is a libtool library, object or program, all the files associated
1472
with it are deleted. Otherwise, only FILE itself is deleted using RM."
3634
with it are deleted. Otherwise, only FILE itself is deleted using RM."
1473
        ;;
3635
        ;;
Line 1480... Line 3642...
1480
 
3642
 
1481
This mode accepts the following additional options:
3643
This mode accepts the following additional options:
1482
 
3644
 
1483
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
3645
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
1484
  -no-suppress      do not suppress compiler output for multiple passes
3646
  -no-suppress      do not suppress compiler output for multiple passes
1485
  -prefer-pic       try to building PIC objects only
3647
  -prefer-pic       try to build PIC objects only
1486
  -prefer-non-pic   try to building non-PIC objects only
3648
  -prefer-non-pic   try to build non-PIC objects only
1487
  -shared           do not build a \`.o' file suitable for static linking
3649
  -shared           do not build a '.o' file suitable for static linking
1488
  -static           only build a \`.o' file suitable for static linking
3650
  -static           only build a '.o' file suitable for static linking
-
 
3651
  -Wc,FLAG          pass FLAG directly to the compiler
1489
 
3652
 
1490
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
3653
COMPILE-COMMAND is a command to be used in creating a 'standard' object file
1491
from the given SOURCEFILE.
3654
from the given SOURCEFILE.
1492
 
3655
 
1493
The output file name is determined by removing the directory component from
3656
The output file name is determined by removing the directory component from
1494
SOURCEFILE, then substituting the C source code suffix \`.c' with the
3657
SOURCEFILE, then substituting the C source code suffix '.c' with the
1495
library object suffix, \`.lo'."
3658
library object suffix, '.lo'."
1496
        ;;
3659
        ;;
1497
 
3660
 
1498
      execute)
3661
      execute)
1499
        $ECHO \
3662
        $ECHO \
1500
"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
3663
"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
Line 1503... Line 3666...
1503
 
3666
 
1504
This mode accepts the following additional options:
3667
This mode accepts the following additional options:
1505
 
3668
 
1506
  -dlopen FILE      add the directory containing FILE to the library path
3669
  -dlopen FILE      add the directory containing FILE to the library path
1507
 
3670
 
1508
This mode sets the library path environment variable according to \`-dlopen'
3671
This mode sets the library path environment variable according to '-dlopen'
1509
flags.
3672
flags.
1510
 
3673
 
1511
If any of the ARGS are libtool executable wrappers, then they are translated
3674
If any of the ARGS are libtool executable wrappers, then they are translated
1512
into their corresponding uninstalled binary, and any of their required library
3675
into their corresponding uninstalled binary, and any of their required library
1513
directories are added to the library path.
3676
directories are added to the library path.
Line 1522... Line 3685...
1522
Complete the installation of libtool libraries.
3685
Complete the installation of libtool libraries.
1523
 
3686
 
1524
Each LIBDIR is a directory that contains libtool libraries.
3687
Each LIBDIR is a directory that contains libtool libraries.
1525
 
3688
 
1526
The commands that this mode executes may require superuser privileges.  Use
3689
The commands that this mode executes may require superuser privileges.  Use
1527
the \`--dry-run' option if you just want to see what would be executed."
3690
the '--dry-run' option if you just want to see what would be executed."
1528
        ;;
3691
        ;;
1529
 
3692
 
1530
      install)
3693
      install)
1531
        $ECHO \
3694
        $ECHO \
1532
"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
3695
"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
1533
 
3696
 
1534
Install executables or libraries.
3697
Install executables or libraries.
1535
 
3698
 
1536
INSTALL-COMMAND is the installation command.  The first component should be
3699
INSTALL-COMMAND is the installation command.  The first component should be
1537
either the \`install' or \`cp' program.
3700
either the 'install' or 'cp' program.
1538
 
3701
 
1539
The following components of INSTALL-COMMAND are treated specially:
3702
The following components of INSTALL-COMMAND are treated specially:
1540
 
3703
 
1541
  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
3704
  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
1542
 
3705
 
1543
The rest of the components are interpreted as arguments to that command (only
3706
The rest of the components are interpreted as arguments to that command (only
1544
BSD-compatible install options are recognized)."
3707
BSD-compatible install options are recognized)."
1545
        ;;
3708
        ;;
1546
 
3709
 
Line 1556... Line 3719...
1556
 
3719
 
1557
The following components of LINK-COMMAND are treated specially:
3720
The following components of LINK-COMMAND are treated specially:
1558
 
3721
 
1559
  -all-static       do not do any dynamic linking at all
3722
  -all-static       do not do any dynamic linking at all
1560
  -avoid-version    do not add a version suffix if possible
3723
  -avoid-version    do not add a version suffix if possible
-
 
3724
  -bindir BINDIR    specify path to binaries directory (for systems where
-
 
3725
                    libraries must be found in the PATH setting at runtime)
1561
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
3726
  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
1562
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
3727
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
1563
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3728
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
1564
  -export-symbols SYMFILE
3729
  -export-symbols SYMFILE
1565
                    try to export only the symbols listed in SYMFILE
3730
                    try to export only the symbols listed in SYMFILE
1566
  -export-symbols-regex REGEX
3731
  -export-symbols-regex REGEX
Line 1570... Line 3735...
1570
  -module           build a library that can dlopened
3735
  -module           build a library that can dlopened
1571
  -no-fast-install  disable the fast-install mode
3736
  -no-fast-install  disable the fast-install mode
1572
  -no-install       link a not-installable executable
3737
  -no-install       link a not-installable executable
1573
  -no-undefined     declare that a library does not refer to external symbols
3738
  -no-undefined     declare that a library does not refer to external symbols
1574
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
3739
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
1575
  -objectlist FILE  Use a list of object files found in FILE to specify objects
3740
  -objectlist FILE  use a list of object files found in FILE to specify objects
-
 
3741
  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
1576
  -precious-files-regex REGEX
3742
  -precious-files-regex REGEX
1577
                    don't remove output files matching REGEX
3743
                    don't remove output files matching REGEX
1578
  -release RELEASE  specify package release information
3744
  -release RELEASE  specify package release information
1579
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
3745
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
1580
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
3746
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
Line 1584... Line 3750...
1584
  -static-libtool-libs
3750
  -static-libtool-libs
1585
                    do not do any dynamic linking of libtool libraries
3751
                    do not do any dynamic linking of libtool libraries
1586
  -version-info CURRENT[:REVISION[:AGE]]
3752
  -version-info CURRENT[:REVISION[:AGE]]
1587
                    specify library version info [each variable defaults to 0]
3753
                    specify library version info [each variable defaults to 0]
1588
  -weak LIBNAME     declare that the target provides the LIBNAME interface
3754
  -weak LIBNAME     declare that the target provides the LIBNAME interface
-
 
3755
  -Wc,FLAG
-
 
3756
  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
-
 
3757
  -Wl,FLAG
-
 
3758
  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
-
 
3759
  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
1589
 
3760
 
1590
All other options (arguments beginning with \`-') are ignored.
3761
All other options (arguments beginning with '-') are ignored.
1591
 
3762
 
1592
Every other argument is treated as a filename.  Files ending in \`.la' are
3763
Every other argument is treated as a filename.  Files ending in '.la' are
1593
treated as uninstalled libtool libraries, other files are standard or library
3764
treated as uninstalled libtool libraries, other files are standard or library
1594
object files.
3765
object files.
1595
 
3766
 
1596
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
3767
If the OUTPUT-FILE ends in '.la', then a libtool library is created,
1597
only library objects (\`.lo' files) may be specified, and \`-rpath' is
3768
only library objects ('.lo' files) may be specified, and '-rpath' is
1598
required, except when creating a convenience library.
3769
required, except when creating a convenience library.
1599
 
3770
 
1600
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
3771
If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
1601
using \`ar' and \`ranlib', or on Windows using \`lib'.
3772
using 'ar' and 'ranlib', or on Windows using 'lib'.
1602
 
3773
 
1603
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
3774
If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
1604
is created, otherwise an executable program is created."
3775
is created, otherwise an executable program is created."
1605
        ;;
3776
        ;;
1606
 
3777
 
1607
      uninstall)
3778
      uninstall)
1608
        $ECHO \
3779
        $ECHO \
1609
"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
3780
"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
1610
 
3781
 
1611
Remove libraries from an installation directory.
3782
Remove libraries from an installation directory.
1612
 
3783
 
1613
RM is the name of the program to use to delete files associated with each FILE
3784
RM is the name of the program to use to delete files associated with each FILE
1614
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
3785
(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
1615
to RM.
3786
to RM.
1616
 
3787
 
1617
If FILE is a libtool library, all the files associated with it are deleted.
3788
If FILE is a libtool library, all the files associated with it are deleted.
1618
Otherwise, only FILE itself is deleted using RM."
3789
Otherwise, only FILE itself is deleted using RM."
1619
        ;;
3790
        ;;
1620
 
3791
 
1621
      *)
3792
      *)
1622
        func_fatal_help "invalid operation mode \`$mode'"
3793
        func_fatal_help "invalid operation mode '$opt_mode'"
1623
        ;;
3794
        ;;
1624
    esac
3795
    esac
1625
 
3796
 
1626
    $ECHO
3797
    echo
1627
    $ECHO "Try \`$progname --help' for more information about other modes."
3798
    $ECHO "Try '$progname --help' for more information about other modes."
1628
 
-
 
1629
    exit $?
-
 
1630
}
3799
}
1631
 
3800
 
1632
  # Now that we've collected a possible --mode arg, show help if necessary
3801
# Now that we've collected a possible --mode arg, show help if necessary
-
 
3802
if $opt_help; then
-
 
3803
  if test : = "$opt_help"; then
1633
  $opt_help && func_mode_help
3804
    func_mode_help
-
 
3805
  else
-
 
3806
    {
-
 
3807
      func_help noexit
-
 
3808
      for opt_mode in compile link execute install finish uninstall clean; do
-
 
3809
	func_mode_help
-
 
3810
      done
-
 
3811
    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
-
 
3812
    {
-
 
3813
      func_help noexit
-
 
3814
      for opt_mode in compile link execute install finish uninstall clean; do
-
 
3815
	echo
-
 
3816
	func_mode_help
-
 
3817
      done
-
 
3818
    } |
-
 
3819
    $SED '1d
-
 
3820
      /^When reporting/,/^Report/{
-
 
3821
	H
-
 
3822
	d
-
 
3823
      }
-
 
3824
      $x
-
 
3825
      /information about other modes/d
-
 
3826
      /more detailed .*MODE/d
-
 
3827
      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
-
 
3828
  fi
-
 
3829
  exit $?
-
 
3830
fi
1634
 
3831
 
1635
 
3832
 
1636
# func_mode_execute arg...
3833
# func_mode_execute arg...
1637
func_mode_execute ()
3834
func_mode_execute ()
1638
{
3835
{
1639
    $opt_debug
3836
    $debug_cmd
-
 
3837
 
1640
    # The first argument is the command name.
3838
    # The first argument is the command name.
1641
    cmd="$nonopt"
3839
    cmd=$nonopt
1642
    test -z "$cmd" && \
3840
    test -z "$cmd" && \
1643
      func_fatal_help "you must specify a COMMAND"
3841
      func_fatal_help "you must specify a COMMAND"
1644
 
3842
 
1645
    # Handle -dlopen flags immediately.
3843
    # Handle -dlopen flags immediately.
1646
    for file in $execute_dlfiles; do
3844
    for file in $opt_dlopen; do
1647
      test -f "$file" \
3845
      test -f "$file" \
1648
	|| func_fatal_help "\`$file' is not a file"
3846
	|| func_fatal_help "'$file' is not a file"
1649
 
3847
 
1650
      dir=
3848
      dir=
1651
      case $file in
3849
      case $file in
1652
      *.la)
3850
      *.la)
-
 
3851
	func_resolve_sysroot "$file"
-
 
3852
	file=$func_resolve_sysroot_result
-
 
3853
 
1653
	# Check to see that this really is a libtool archive.
3854
	# Check to see that this really is a libtool archive.
1654
	func_lalib_unsafe_p "$file" \
3855
	func_lalib_unsafe_p "$file" \
1655
	  || func_fatal_help "\`$lib' is not a valid libtool archive"
3856
	  || func_fatal_help "'$lib' is not a valid libtool archive"
1656
 
3857
 
1657
	# Read the libtool library.
3858
	# Read the libtool library.
1658
	dlname=
3859
	dlname=
1659
	library_names=
3860
	library_names=
1660
	func_source "$file"
3861
	func_source "$file"
1661
 
3862
 
1662
	# Skip this library if it cannot be dlopened.
3863
	# Skip this library if it cannot be dlopened.
1663
	if test -z "$dlname"; then
3864
	if test -z "$dlname"; then
1664
	  # Warn if it was a shared library.
3865
	  # Warn if it was a shared library.
1665
	  test -n "$library_names" && \
3866
	  test -n "$library_names" && \
1666
	    func_warning "\`$file' was not linked with \`-export-dynamic'"
3867
	    func_warning "'$file' was not linked with '-export-dynamic'"
1667
	  continue
3868
	  continue
1668
	fi
3869
	fi
1669
 
3870
 
1670
	func_dirname "$file" "" "."
3871
	func_dirname "$file" "" "."
1671
	dir="$func_dirname_result"
3872
	dir=$func_dirname_result
1672
 
3873
 
1673
	if test -f "$dir/$objdir/$dlname"; then
3874
	if test -f "$dir/$objdir/$dlname"; then
1674
	  dir="$dir/$objdir"
3875
	  func_append dir "/$objdir"
1675
	else
3876
	else
1676
	  if test ! -f "$dir/$dlname"; then
3877
	  if test ! -f "$dir/$dlname"; then
1677
	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
3878
	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
1678
	  fi
3879
	  fi
1679
	fi
3880
	fi
1680
	;;
3881
	;;
1681
 
3882
 
1682
      *.lo)
3883
      *.lo)
1683
	# Just add the directory containing the .lo file.
3884
	# Just add the directory containing the .lo file.
1684
	func_dirname "$file" "" "."
3885
	func_dirname "$file" "" "."
1685
	dir="$func_dirname_result"
3886
	dir=$func_dirname_result
1686
	;;
3887
	;;
1687
 
3888
 
1688
      *)
3889
      *)
1689
	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
3890
	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
1690
	continue
3891
	continue
1691
	;;
3892
	;;
1692
      esac
3893
      esac
1693
 
3894
 
1694
      # Get the absolute pathname.
3895
      # Get the absolute pathname.
1695
      absdir=`cd "$dir" && pwd`
3896
      absdir=`cd "$dir" && pwd`
1696
      test -n "$absdir" && dir="$absdir"
3897
      test -n "$absdir" && dir=$absdir
1697
 
3898
 
1698
      # Now add the directory to shlibpath_var.
3899
      # Now add the directory to shlibpath_var.
1699
      if eval "test -z \"\$$shlibpath_var\""; then
3900
      if eval "test -z \"\$$shlibpath_var\""; then
1700
	eval "$shlibpath_var=\"\$dir\""
3901
	eval "$shlibpath_var=\"\$dir\""
1701
      else
3902
      else
Line 1703... Line 3904...
1703
      fi
3904
      fi
1704
    done
3905
    done
1705
 
3906
 
1706
    # This variable tells wrapper scripts just to set shlibpath_var
3907
    # This variable tells wrapper scripts just to set shlibpath_var
1707
    # rather than running their programs.
3908
    # rather than running their programs.
1708
    libtool_execute_magic="$magic"
3909
    libtool_execute_magic=$magic
1709
 
3910
 
1710
    # Check if any of the arguments is a wrapper script.
3911
    # Check if any of the arguments is a wrapper script.
1711
    args=
3912
    args=
1712
    for file
3913
    for file
1713
    do
3914
    do
1714
      case $file in
3915
      case $file in
1715
      -*) ;;
3916
      -* | *.la | *.lo ) ;;
1716
      *)
3917
      *)
1717
	# Do a test to see if this is really a libtool program.
3918
	# Do a test to see if this is really a libtool program.
1718
	if func_ltwrapper_script_p "$file"; then
3919
	if func_ltwrapper_script_p "$file"; then
1719
	  func_source "$file"
3920
	  func_source "$file"
1720
	  # Transform arg to wrapped name.
3921
	  # Transform arg to wrapped name.
1721
	  file="$progdir/$program"
3922
	  file=$progdir/$program
1722
	elif func_ltwrapper_executable_p "$file"; then
3923
	elif func_ltwrapper_executable_p "$file"; then
1723
	  func_ltwrapper_scriptname "$file"
3924
	  func_ltwrapper_scriptname "$file"
1724
	  func_source "$func_ltwrapper_scriptname_result"
3925
	  func_source "$func_ltwrapper_scriptname_result"
1725
	  # Transform arg to wrapped name.
3926
	  # Transform arg to wrapped name.
1726
	  file="$progdir/$program"
3927
	  file=$progdir/$program
1727
	fi
3928
	fi
1728
	;;
3929
	;;
1729
      esac
3930
      esac
1730
      # Quote arguments (to preserve shell metacharacters).
3931
      # Quote arguments (to preserve shell metacharacters).
1731
      func_quote_for_eval "$file"
3932
      func_append_quoted args "$file"
1732
      args="$args $func_quote_for_eval_result"
-
 
1733
    done
3933
    done
1734
 
3934
 
1735
    if test "X$opt_dry_run" = Xfalse; then
3935
    if $opt_dry_run; then
-
 
3936
      # Display what would be done.
-
 
3937
      if test -n "$shlibpath_var"; then
-
 
3938
	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-
 
3939
	echo "export $shlibpath_var"
-
 
3940
      fi
-
 
3941
      $ECHO "$cmd$args"
-
 
3942
      exit $EXIT_SUCCESS
-
 
3943
    else
1736
      if test -n "$shlibpath_var"; then
3944
      if test -n "$shlibpath_var"; then
1737
	# Export the shlibpath_var.
3945
	# Export the shlibpath_var.
1738
	eval "export $shlibpath_var"
3946
	eval "export $shlibpath_var"
1739
      fi
3947
      fi
1740
 
3948
 
Line 1747... Line 3955...
1747
		$lt_unset $lt_var
3955
		$lt_unset $lt_var
1748
	      fi"
3956
	      fi"
1749
      done
3957
      done
1750
 
3958
 
1751
      # Now prepare to actually exec the command.
3959
      # Now prepare to actually exec the command.
1752
      exec_cmd="\$cmd$args"
3960
      exec_cmd=\$cmd$args
1753
    else
-
 
1754
      # Display what would be done.
-
 
1755
      if test -n "$shlibpath_var"; then
-
 
1756
	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-
 
1757
	$ECHO "export $shlibpath_var"
-
 
1758
      fi
-
 
1759
      $ECHO "$cmd$args"
-
 
1760
      exit $EXIT_SUCCESS
-
 
1761
    fi
3961
    fi
1762
}
3962
}
1763
 
3963
 
1764
test "$mode" = execute && func_mode_execute ${1+"$@"}
3964
test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
1765
 
3965
 
1766
 
3966
 
1767
# func_mode_finish arg...
3967
# func_mode_finish arg...
1768
func_mode_finish ()
3968
func_mode_finish ()
1769
{
3969
{
1770
    $opt_debug
3970
    $debug_cmd
-
 
3971
 
-
 
3972
    libs=
1771
    libdirs="$nonopt"
3973
    libdirs=
1772
    admincmds=
3974
    admincmds=
1773
 
3975
 
-
 
3976
    for opt in "$nonopt" ${1+"$@"}
-
 
3977
    do
-
 
3978
      if test -d "$opt"; then
-
 
3979
	func_append libdirs " $opt"
-
 
3980
 
1774
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3981
      elif test -f "$opt"; then
-
 
3982
	if func_lalib_unsafe_p "$opt"; then
-
 
3983
	  func_append libs " $opt"
-
 
3984
	else
-
 
3985
	  func_warning "'$opt' is not a valid libtool archive"
-
 
3986
	fi
-
 
3987
 
-
 
3988
      else
-
 
3989
	func_fatal_error "invalid argument '$opt'"
1775
      for dir
3990
      fi
-
 
3991
    done
-
 
3992
 
-
 
3993
    if test -n "$libs"; then
-
 
3994
      if test -n "$lt_sysroot"; then
-
 
3995
        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
-
 
3996
        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
-
 
3997
      else
-
 
3998
        sysroot_cmd=
1776
      do
3999
      fi
-
 
4000
 
-
 
4001
      # Remove sysroot references
-
 
4002
      if $opt_dry_run; then
1777
	libdirs="$libdirs $dir"
4003
        for lib in $libs; do
-
 
4004
          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
1778
      done
4005
        done
-
 
4006
      else
-
 
4007
        tmpdir=`func_mktempdir`
-
 
4008
        for lib in $libs; do
-
 
4009
	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
-
 
4010
	    > $tmpdir/tmp-la
-
 
4011
	  mv -f $tmpdir/tmp-la $lib
-
 
4012
	done
-
 
4013
        ${RM}r "$tmpdir"
-
 
4014
      fi
-
 
4015
    fi
1779
 
4016
 
-
 
4017
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
1780
      for libdir in $libdirs; do
4018
      for libdir in $libdirs; do
1781
	if test -n "$finish_cmds"; then
4019
	if test -n "$finish_cmds"; then
1782
	  # Do each command in the finish commands.
4020
	  # Do each command in the finish commands.
1783
	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
4021
	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
1784
'"$cmd"'"'
4022
'"$cmd"'"'
1785
	fi
4023
	fi
1786
	if test -n "$finish_eval"; then
4024
	if test -n "$finish_eval"; then
1787
	  # Do the single finish_eval.
4025
	  # Do the single finish_eval.
1788
	  eval cmds=\"$finish_eval\"
4026
	  eval cmds=\"$finish_eval\"
1789
	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
4027
	  $opt_dry_run || eval "$cmds" || func_append admincmds "
1790
       $cmds"
4028
       $cmds"
1791
	fi
4029
	fi
1792
      done
4030
      done
1793
    fi
4031
    fi
1794
 
4032
 
1795
    # Exit here if they wanted silent mode.
4033
    # Exit here if they wanted silent mode.
1796
    $opt_silent && exit $EXIT_SUCCESS
4034
    $opt_quiet && exit $EXIT_SUCCESS
1797
 
4035
 
-
 
4036
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
1798
    $ECHO "X----------------------------------------------------------------------" | $Xsed
4037
      echo "----------------------------------------------------------------------"
1799
    $ECHO "Libraries have been installed in:"
4038
      echo "Libraries have been installed in:"
1800
    for libdir in $libdirs; do
4039
      for libdir in $libdirs; do
1801
      $ECHO "   $libdir"
4040
	$ECHO "   $libdir"
1802
    done
4041
      done
1803
    $ECHO
4042
      echo
1804
    $ECHO "If you ever happen to want to link against installed libraries"
4043
      echo "If you ever happen to want to link against installed libraries"
1805
    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
4044
      echo "in a given directory, LIBDIR, you must either use libtool, and"
1806
    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
4045
      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
1807
    $ECHO "flag during linking and do at least one of the following:"
4046
      echo "flag during linking and do at least one of the following:"
1808
    if test -n "$shlibpath_var"; then
4047
      if test -n "$shlibpath_var"; then
1809
      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
4048
	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
1810
      $ECHO "     during execution"
4049
	echo "     during execution"
1811
    fi
4050
      fi
1812
    if test -n "$runpath_var"; then
4051
      if test -n "$runpath_var"; then
1813
      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
4052
	echo "   - add LIBDIR to the '$runpath_var' environment variable"
1814
      $ECHO "     during linking"
4053
	echo "     during linking"
1815
    fi
4054
      fi
1816
    if test -n "$hardcode_libdir_flag_spec"; then
4055
      if test -n "$hardcode_libdir_flag_spec"; then
1817
      libdir=LIBDIR
4056
	libdir=LIBDIR
1818
      eval flag=\"$hardcode_libdir_flag_spec\"
4057
	eval flag=\"$hardcode_libdir_flag_spec\"
1819
 
4058
 
1820
      $ECHO "   - use the \`$flag' linker flag"
4059
	$ECHO "   - use the '$flag' linker flag"
1821
    fi
4060
      fi
1822
    if test -n "$admincmds"; then
4061
      if test -n "$admincmds"; then
1823
      $ECHO "   - have your system administrator run these commands:$admincmds"
4062
	$ECHO "   - have your system administrator run these commands:$admincmds"
1824
    fi
4063
      fi
1825
    if test -f /etc/ld.so.conf; then
4064
      if test -f /etc/ld.so.conf; then
1826
      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4065
	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
1827
    fi
4066
      fi
1828
    $ECHO
4067
      echo
1829
 
4068
 
1830
    $ECHO "See any operating system documentation about shared libraries for"
4069
      echo "See any operating system documentation about shared libraries for"
1831
    case $host in
4070
      case $host in
1832
      solaris2.[6789]|solaris2.1[0-9])
4071
	solaris2.[6789]|solaris2.1[0-9])
1833
        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
4072
	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
1834
	$ECHO "pages."
4073
	  echo "pages."
1835
	;;
4074
	  ;;
1836
      *)
4075
	*)
1837
        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
4076
	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
1838
        ;;
4077
	  ;;
1839
    esac
4078
      esac
1840
    $ECHO "X----------------------------------------------------------------------" | $Xsed
4079
      echo "----------------------------------------------------------------------"
-
 
4080
    fi
1841
    exit $EXIT_SUCCESS
4081
    exit $EXIT_SUCCESS
1842
}
4082
}
1843
 
4083
 
1844
test "$mode" = finish && func_mode_finish ${1+"$@"}
4084
test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
1845
 
4085
 
1846
 
4086
 
1847
# func_mode_install arg...
4087
# func_mode_install arg...
1848
func_mode_install ()
4088
func_mode_install ()
1849
{
4089
{
1850
    $opt_debug
4090
    $debug_cmd
-
 
4091
 
1851
    # There may be an optional sh(1) argument at the beginning of
4092
    # There may be an optional sh(1) argument at the beginning of
1852
    # install_prog (especially on Windows NT).
4093
    # install_prog (especially on Windows NT).
1853
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4094
    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
1854
       # Allow the use of GNU shtool's install command.
4095
       # Allow the use of GNU shtool's install command.
1855
       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
4096
       case $nonopt in *shtool*) :;; *) false;; esac
-
 
4097
    then
1856
      # Aesthetically quote it.
4098
      # Aesthetically quote it.
1857
      func_quote_for_eval "$nonopt"
4099
      func_quote_for_eval "$nonopt"
1858
      install_prog="$func_quote_for_eval_result "
4100
      install_prog="$func_quote_for_eval_result "
1859
      arg=$1
4101
      arg=$1
1860
      shift
4102
      shift
Line 1864... Line 4106...
1864
    fi
4106
    fi
1865
 
4107
 
1866
    # The real first argument should be the name of the installation program.
4108
    # The real first argument should be the name of the installation program.
1867
    # Aesthetically quote it.
4109
    # Aesthetically quote it.
1868
    func_quote_for_eval "$arg"
4110
    func_quote_for_eval "$arg"
1869
    install_prog="$install_prog$func_quote_for_eval_result"
4111
    func_append install_prog "$func_quote_for_eval_result"
-
 
4112
    install_shared_prog=$install_prog
-
 
4113
    case " $install_prog " in
-
 
4114
      *[\\\ /]cp\ *) install_cp=: ;;
-
 
4115
      *) install_cp=false ;;
-
 
4116
    esac
1870
 
4117
 
1871
    # We need to accept at least all the BSD install flags.
4118
    # We need to accept at least all the BSD install flags.
1872
    dest=
4119
    dest=
1873
    files=
4120
    files=
1874
    opts=
4121
    opts=
1875
    prev=
4122
    prev=
1876
    install_type=
4123
    install_type=
1877
    isdir=no
4124
    isdir=false
1878
    stripme=
4125
    stripme=
-
 
4126
    no_mode=:
1879
    for arg
4127
    for arg
1880
    do
4128
    do
-
 
4129
      arg2=
1881
      if test -n "$dest"; then
4130
      if test -n "$dest"; then
1882
	files="$files $dest"
4131
	func_append files " $dest"
1883
	dest=$arg
4132
	dest=$arg
1884
	continue
4133
	continue
1885
      fi
4134
      fi
1886
 
4135
 
1887
      case $arg in
4136
      case $arg in
1888
      -d) isdir=yes ;;
4137
      -d) isdir=: ;;
1889
      -f)
4138
      -f)
1890
	case " $install_prog " in
4139
	if $install_cp; then :; else
1891
	*[\\\ /]cp\ *) ;;
-
 
1892
	*) prev=$arg ;;
4140
	  prev=$arg
1893
	esac
4141
	fi
1894
	;;
4142
	;;
1895
      -g | -m | -o)
4143
      -g | -m | -o)
1896
	prev=$arg
4144
	prev=$arg
1897
	;;
4145
	;;
1898
      -s)
4146
      -s)
Line 1902... Line 4150...
1902
      -*)
4150
      -*)
1903
	;;
4151
	;;
1904
      *)
4152
      *)
1905
	# If the previous option needed an argument, then skip it.
4153
	# If the previous option needed an argument, then skip it.
1906
	if test -n "$prev"; then
4154
	if test -n "$prev"; then
-
 
4155
	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
-
 
4156
	    arg2=$install_override_mode
-
 
4157
	    no_mode=false
-
 
4158
	  fi
1907
	  prev=
4159
	  prev=
1908
	else
4160
	else
1909
	  dest=$arg
4161
	  dest=$arg
1910
	  continue
4162
	  continue
1911
	fi
4163
	fi
1912
	;;
4164
	;;
1913
      esac
4165
      esac
1914
 
4166
 
1915
      # Aesthetically quote the argument.
4167
      # Aesthetically quote the argument.
1916
      func_quote_for_eval "$arg"
4168
      func_quote_for_eval "$arg"
1917
      install_prog="$install_prog $func_quote_for_eval_result"
4169
      func_append install_prog " $func_quote_for_eval_result"
-
 
4170
      if test -n "$arg2"; then
-
 
4171
	func_quote_for_eval "$arg2"
-
 
4172
      fi
-
 
4173
      func_append install_shared_prog " $func_quote_for_eval_result"
1918
    done
4174
    done
1919
 
4175
 
1920
    test -z "$install_prog" && \
4176
    test -z "$install_prog" && \
1921
      func_fatal_help "you must specify an install program"
4177
      func_fatal_help "you must specify an install program"
1922
 
4178
 
1923
    test -n "$prev" && \
4179
    test -n "$prev" && \
1924
      func_fatal_help "the \`$prev' option requires an argument"
4180
      func_fatal_help "the '$prev' option requires an argument"
-
 
4181
 
-
 
4182
    if test -n "$install_override_mode" && $no_mode; then
-
 
4183
      if $install_cp; then :; else
-
 
4184
	func_quote_for_eval "$install_override_mode"
-
 
4185
	func_append install_shared_prog " -m $func_quote_for_eval_result"
-
 
4186
      fi
-
 
4187
    fi
1925
 
4188
 
1926
    if test -z "$files"; then
4189
    if test -z "$files"; then
1927
      if test -z "$dest"; then
4190
      if test -z "$dest"; then
1928
	func_fatal_help "no file or destination specified"
4191
	func_fatal_help "no file or destination specified"
1929
      else
4192
      else
Line 1934... Line 4197...
1934
    # Strip any trailing slash from the destination.
4197
    # Strip any trailing slash from the destination.
1935
    func_stripname '' '/' "$dest"
4198
    func_stripname '' '/' "$dest"
1936
    dest=$func_stripname_result
4199
    dest=$func_stripname_result
1937
 
4200
 
1938
    # Check to see that the destination is a directory.
4201
    # Check to see that the destination is a directory.
1939
    test -d "$dest" && isdir=yes
4202
    test -d "$dest" && isdir=:
1940
    if test "$isdir" = yes; then
4203
    if $isdir; then
1941
      destdir="$dest"
4204
      destdir=$dest
1942
      destname=
4205
      destname=
1943
    else
4206
    else
1944
      func_dirname_and_basename "$dest" "" "."
4207
      func_dirname_and_basename "$dest" "" "."
1945
      destdir="$func_dirname_result"
4208
      destdir=$func_dirname_result
1946
      destname="$func_basename_result"
4209
      destname=$func_basename_result
1947
 
4210
 
1948
      # Not a directory, so check to see that there is only one file specified.
4211
      # Not a directory, so check to see that there is only one file specified.
1949
      set dummy $files; shift
4212
      set dummy $files; shift
1950
      test "$#" -gt 1 && \
4213
      test "$#" -gt 1 && \
1951
	func_fatal_help "\`$dest' is not a directory"
4214
	func_fatal_help "'$dest' is not a directory"
1952
    fi
4215
    fi
1953
    case $destdir in
4216
    case $destdir in
1954
    [\\/]* | [A-Za-z]:[\\/]*) ;;
4217
    [\\/]* | [A-Za-z]:[\\/]*) ;;
1955
    *)
4218
    *)
1956
      for file in $files; do
4219
      for file in $files; do
1957
	case $file in
4220
	case $file in
1958
	*.lo) ;;
4221
	*.lo) ;;
1959
	*)
4222
	*)
1960
	  func_fatal_help "\`$destdir' must be an absolute directory name"
4223
	  func_fatal_help "'$destdir' must be an absolute directory name"
1961
	  ;;
4224
	  ;;
1962
	esac
4225
	esac
1963
      done
4226
      done
1964
      ;;
4227
      ;;
1965
    esac
4228
    esac
1966
 
4229
 
1967
    # This variable tells wrapper scripts just to set variables rather
4230
    # This variable tells wrapper scripts just to set variables rather
1968
    # than running their programs.
4231
    # than running their programs.
1969
    libtool_install_magic="$magic"
4232
    libtool_install_magic=$magic
1970
 
4233
 
1971
    staticlibs=
4234
    staticlibs=
1972
    future_libdirs=
4235
    future_libdirs=
1973
    current_libdirs=
4236
    current_libdirs=
1974
    for file in $files; do
4237
    for file in $files; do
1975
 
4238
 
1976
      # Do each installation.
4239
      # Do each installation.
1977
      case $file in
4240
      case $file in
1978
      *.$libext)
4241
      *.$libext)
1979
	# Do the static libraries later.
4242
	# Do the static libraries later.
1980
	staticlibs="$staticlibs $file"
4243
	func_append staticlibs " $file"
1981
	;;
4244
	;;
1982
 
4245
 
1983
      *.la)
4246
      *.la)
-
 
4247
	func_resolve_sysroot "$file"
-
 
4248
	file=$func_resolve_sysroot_result
-
 
4249
 
1984
	# Check to see that this really is a libtool archive.
4250
	# Check to see that this really is a libtool archive.
1985
	func_lalib_unsafe_p "$file" \
4251
	func_lalib_unsafe_p "$file" \
1986
	  || func_fatal_help "\`$file' is not a valid libtool archive"
4252
	  || func_fatal_help "'$file' is not a valid libtool archive"
1987
 
4253
 
1988
	library_names=
4254
	library_names=
1989
	old_library=
4255
	old_library=
1990
	relink_command=
4256
	relink_command=
1991
	func_source "$file"
4257
	func_source "$file"
1992
 
4258
 
1993
	# Add the libdir to current_libdirs if it is the destination.
4259
	# Add the libdir to current_libdirs if it is the destination.
1994
	if test "X$destdir" = "X$libdir"; then
4260
	if test "X$destdir" = "X$libdir"; then
1995
	  case "$current_libdirs " in
4261
	  case "$current_libdirs " in
1996
	  *" $libdir "*) ;;
4262
	  *" $libdir "*) ;;
1997
	  *) current_libdirs="$current_libdirs $libdir" ;;
4263
	  *) func_append current_libdirs " $libdir" ;;
1998
	  esac
4264
	  esac
1999
	else
4265
	else
2000
	  # Note the libdir as a future libdir.
4266
	  # Note the libdir as a future libdir.
2001
	  case "$future_libdirs " in
4267
	  case "$future_libdirs " in
2002
	  *" $libdir "*) ;;
4268
	  *" $libdir "*) ;;
2003
	  *) future_libdirs="$future_libdirs $libdir" ;;
4269
	  *) func_append future_libdirs " $libdir" ;;
2004
	  esac
4270
	  esac
2005
	fi
4271
	fi
2006
 
4272
 
2007
	func_dirname "$file" "/" ""
4273
	func_dirname "$file" "/" ""
2008
	dir="$func_dirname_result"
4274
	dir=$func_dirname_result
2009
	dir="$dir$objdir"
4275
	func_append dir "$objdir"
2010
 
4276
 
2011
	if test -n "$relink_command"; then
4277
	if test -n "$relink_command"; then
2012
	  # Determine the prefix the user has applied to our future dir.
4278
	  # Determine the prefix the user has applied to our future dir.
2013
	  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
4279
	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2014
 
4280
 
2015
	  # Don't allow the user to place us outside of our expected
4281
	  # Don't allow the user to place us outside of our expected
2016
	  # location b/c this prevents finding dependent libraries that
4282
	  # location b/c this prevents finding dependent libraries that
2017
	  # are installed to the same prefix.
4283
	  # are installed to the same prefix.
2018
	  # At present, this check doesn't affect windows .dll's that
4284
	  # At present, this check doesn't affect windows .dll's that
2019
	  # are installed into $libdir/../bin (currently, that works fine)
4285
	  # are installed into $libdir/../bin (currently, that works fine)
2020
	  # but it's something to keep an eye on.
4286
	  # but it's something to keep an eye on.
2021
	  test "$inst_prefix_dir" = "$destdir" && \
4287
	  test "$inst_prefix_dir" = "$destdir" && \
2022
	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
4288
	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
2023
 
4289
 
2024
	  if test -n "$inst_prefix_dir"; then
4290
	  if test -n "$inst_prefix_dir"; then
2025
	    # Stick the inst_prefix_dir data into the link command.
4291
	    # Stick the inst_prefix_dir data into the link command.
2026
	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
4292
	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2027
	  else
4293
	  else
2028
	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
4294
	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2029
	  fi
4295
	  fi
2030
 
4296
 
2031
	  func_warning "relinking \`$file'"
4297
	  func_warning "relinking '$file'"
2032
	  func_show_eval "$relink_command" \
4298
	  func_show_eval "$relink_command" \
2033
	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
4299
	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
2034
	fi
4300
	fi
2035
 
4301
 
2036
	# See the names of the shared library.
4302
	# See the names of the shared library.
2037
	set dummy $library_names; shift
4303
	set dummy $library_names; shift
2038
	if test -n "$1"; then
4304
	if test -n "$1"; then
2039
	  realname="$1"
4305
	  realname=$1
2040
	  shift
4306
	  shift
2041
 
4307
 
2042
	  srcname="$realname"
4308
	  srcname=$realname
2043
	  test -n "$relink_command" && srcname="$realname"T
4309
	  test -n "$relink_command" && srcname=${realname}T
2044
 
4310
 
2045
	  # Install the shared library and build the symlinks.
4311
	  # Install the shared library and build the symlinks.
2046
	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
4312
	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
2047
	      'exit $?'
4313
	      'exit $?'
2048
	  tstripme="$stripme"
4314
	  tstripme=$stripme
2049
	  case $host_os in
4315
	  case $host_os in
2050
	  cygwin* | mingw* | pw32* | cegcc*)
4316
	  cygwin* | mingw* | pw32* | cegcc*)
2051
	    case $realname in
4317
	    case $realname in
2052
	    *.dll.a)
4318
	    *.dll.a)
2053
	      tstripme=""
4319
	      tstripme=
-
 
4320
	      ;;
-
 
4321
	    esac
-
 
4322
	    ;;
-
 
4323
	  os2*)
-
 
4324
	    case $realname in
-
 
4325
	    *_dll.a)
-
 
4326
	      tstripme=
2054
	      ;;
4327
	      ;;
2055
	    esac
4328
	    esac
2056
	    ;;
4329
	    ;;
2057
	  esac
4330
	  esac
2058
	  if test -n "$tstripme" && test -n "$striplib"; then
4331
	  if test -n "$tstripme" && test -n "$striplib"; then
2059
	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
4332
	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
2060
	  fi
4333
	  fi
2061
 
4334
 
2062
	  if test "$#" -gt 0; then
4335
	  if test "$#" -gt 0; then
2063
	    # Delete the old symlinks, and create new ones.
4336
	    # Delete the old symlinks, and create new ones.
2064
	    # Try `ln -sf' first, because the `ln' binary might depend on
4337
	    # Try 'ln -sf' first, because the 'ln' binary might depend on
2065
	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
4338
	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
2066
	    # so we also need to try rm && ln -s.
4339
	    # so we also need to try rm && ln -s.
2067
	    for linkname
4340
	    for linkname
2068
	    do
4341
	    do
2069
	      test "$linkname" != "$realname" \
4342
	      test "$linkname" != "$realname" \
2070
		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
4343
		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2071
	    done
4344
	    done
2072
	  fi
4345
	  fi
2073
 
4346
 
2074
	  # Do each command in the postinstall commands.
4347
	  # Do each command in the postinstall commands.
2075
	  lib="$destdir/$realname"
4348
	  lib=$destdir/$realname
2076
	  func_execute_cmds "$postinstall_cmds" 'exit $?'
4349
	  func_execute_cmds "$postinstall_cmds" 'exit $?'
2077
	fi
4350
	fi
2078
 
4351
 
2079
	# Install the pseudo-library for information purposes.
4352
	# Install the pseudo-library for information purposes.
2080
	func_basename "$file"
4353
	func_basename "$file"
2081
	name="$func_basename_result"
4354
	name=$func_basename_result
2082
	instname="$dir/$name"i
4355
	instname=$dir/${name}i
2083
	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
4356
	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
2084
 
4357
 
2085
	# Maybe install the static library, too.
4358
	# Maybe install the static library, too.
2086
	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4359
	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
2087
	;;
4360
	;;
2088
 
4361
 
2089
      *.lo)
4362
      *.lo)
2090
	# Install (i.e. copy) a libtool object.
4363
	# Install (i.e. copy) a libtool object.
2091
 
4364
 
2092
	# Figure out destination file name, if it wasn't already specified.
4365
	# Figure out destination file name, if it wasn't already specified.
2093
	if test -n "$destname"; then
4366
	if test -n "$destname"; then
2094
	  destfile="$destdir/$destname"
4367
	  destfile=$destdir/$destname
2095
	else
4368
	else
2096
	  func_basename "$file"
4369
	  func_basename "$file"
2097
	  destfile="$func_basename_result"
4370
	  destfile=$func_basename_result
2098
	  destfile="$destdir/$destfile"
4371
	  destfile=$destdir/$destfile
2099
	fi
4372
	fi
2100
 
4373
 
2101
	# Deduce the name of the destination old-style object file.
4374
	# Deduce the name of the destination old-style object file.
2102
	case $destfile in
4375
	case $destfile in
2103
	*.lo)
4376
	*.lo)
2104
	  func_lo2o "$destfile"
4377
	  func_lo2o "$destfile"
2105
	  staticdest=$func_lo2o_result
4378
	  staticdest=$func_lo2o_result
2106
	  ;;
4379
	  ;;
2107
	*.$objext)
4380
	*.$objext)
2108
	  staticdest="$destfile"
4381
	  staticdest=$destfile
2109
	  destfile=
4382
	  destfile=
2110
	  ;;
4383
	  ;;
2111
	*)
4384
	*)
2112
	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
4385
	  func_fatal_help "cannot copy a libtool object to '$destfile'"
2113
	  ;;
4386
	  ;;
2114
	esac
4387
	esac
2115
 
4388
 
2116
	# Install the libtool object if requested.
4389
	# Install the libtool object if requested.
2117
	test -n "$destfile" && \
4390
	test -n "$destfile" && \
2118
	  func_show_eval "$install_prog $file $destfile" 'exit $?'
4391
	  func_show_eval "$install_prog $file $destfile" 'exit $?'
2119
 
4392
 
2120
	# Install the old object if enabled.
4393
	# Install the old object if enabled.
2121
	if test "$build_old_libs" = yes; then
4394
	if test yes = "$build_old_libs"; then
2122
	  # Deduce the name of the old-style object file.
4395
	  # Deduce the name of the old-style object file.
2123
	  func_lo2o "$file"
4396
	  func_lo2o "$file"
2124
	  staticobj=$func_lo2o_result
4397
	  staticobj=$func_lo2o_result
2125
	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
4398
	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
2126
	fi
4399
	fi
Line 2128... Line 4401...
2128
	;;
4401
	;;
2129
 
4402
 
2130
      *)
4403
      *)
2131
	# Figure out destination file name, if it wasn't already specified.
4404
	# Figure out destination file name, if it wasn't already specified.
2132
	if test -n "$destname"; then
4405
	if test -n "$destname"; then
2133
	  destfile="$destdir/$destname"
4406
	  destfile=$destdir/$destname
2134
	else
4407
	else
2135
	  func_basename "$file"
4408
	  func_basename "$file"
2136
	  destfile="$func_basename_result"
4409
	  destfile=$func_basename_result
2137
	  destfile="$destdir/$destfile"
4410
	  destfile=$destdir/$destfile
2138
	fi
4411
	fi
2139
 
4412
 
2140
	# If the file is missing, and there is a .exe on the end, strip it
4413
	# If the file is missing, and there is a .exe on the end, strip it
2141
	# because it is most likely a libtool script we actually want to
4414
	# because it is most likely a libtool script we actually want to
2142
	# install
4415
	# install
2143
	stripped_ext=""
4416
	stripped_ext=
2144
	case $file in
4417
	case $file in
2145
	  *.exe)
4418
	  *.exe)
2146
	    if test ! -f "$file"; then
4419
	    if test ! -f "$file"; then
2147
	      func_stripname '' '.exe' "$file"
4420
	      func_stripname '' '.exe' "$file"
2148
	      file=$func_stripname_result
4421
	      file=$func_stripname_result
2149
	      stripped_ext=".exe"
4422
	      stripped_ext=.exe
2150
	    fi
4423
	    fi
2151
	    ;;
4424
	    ;;
2152
	esac
4425
	esac
2153
 
4426
 
2154
	# Do a test to see if this is really a libtool program.
4427
	# Do a test to see if this is really a libtool program.
Line 2172... Line 4445...
2172
 
4445
 
2173
	  func_source "$wrapper"
4446
	  func_source "$wrapper"
2174
 
4447
 
2175
	  # Check the variables that should have been set.
4448
	  # Check the variables that should have been set.
2176
	  test -z "$generated_by_libtool_version" && \
4449
	  test -z "$generated_by_libtool_version" && \
2177
	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
4450
	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
2178
 
4451
 
2179
	  finalize=yes
4452
	  finalize=:
2180
	  for lib in $notinst_deplibs; do
4453
	  for lib in $notinst_deplibs; do
2181
	    # Check to see that each library is installed.
4454
	    # Check to see that each library is installed.
2182
	    libdir=
4455
	    libdir=
2183
	    if test -f "$lib"; then
4456
	    if test -f "$lib"; then
2184
	      func_source "$lib"
4457
	      func_source "$lib"
2185
	    fi
4458
	    fi
2186
	    libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4459
	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
2187
	    if test -n "$libdir" && test ! -f "$libfile"; then
4460
	    if test -n "$libdir" && test ! -f "$libfile"; then
2188
	      func_warning "\`$lib' has not been installed in \`$libdir'"
4461
	      func_warning "'$lib' has not been installed in '$libdir'"
2189
	      finalize=no
4462
	      finalize=false
2190
	    fi
4463
	    fi
2191
	  done
4464
	  done
2192
 
4465
 
2193
	  relink_command=
4466
	  relink_command=
2194
	  func_source "$wrapper"
4467
	  func_source "$wrapper"
2195
 
4468
 
2196
	  outputname=
4469
	  outputname=
2197
	  if test "$fast_install" = no && test -n "$relink_command"; then
4470
	  if test no = "$fast_install" && test -n "$relink_command"; then
2198
	    $opt_dry_run || {
4471
	    $opt_dry_run || {
2199
	      if test "$finalize" = yes; then
4472
	      if $finalize; then
2200
	        tmpdir=`func_mktempdir`
4473
	        tmpdir=`func_mktempdir`
2201
		func_basename "$file$stripped_ext"
4474
		func_basename "$file$stripped_ext"
2202
		file="$func_basename_result"
4475
		file=$func_basename_result
2203
	        outputname="$tmpdir/$file"
4476
	        outputname=$tmpdir/$file
2204
	        # Replace the output file specification.
4477
	        # Replace the output file specification.
2205
	        relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4478
	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
2206
 
4479
 
2207
	        $opt_silent || {
4480
	        $opt_quiet || {
2208
	          func_quote_for_expand "$relink_command"
4481
	          func_quote_for_expand "$relink_command"
2209
		  eval "func_echo $func_quote_for_expand_result"
4482
		  eval "func_echo $func_quote_for_expand_result"
2210
	        }
4483
	        }
2211
	        if eval "$relink_command"; then :
4484
	        if eval "$relink_command"; then :
2212
	          else
4485
	          else
2213
		  func_error "error: relink \`$file' with the above command before installing it"
4486
		  func_error "error: relink '$file' with the above command before installing it"
2214
		  $opt_dry_run || ${RM}r "$tmpdir"
4487
		  $opt_dry_run || ${RM}r "$tmpdir"
2215
		  continue
4488
		  continue
2216
	        fi
4489
	        fi
2217
	        file="$outputname"
4490
	        file=$outputname
2218
	      else
4491
	      else
2219
	        func_warning "cannot relink \`$file'"
4492
	        func_warning "cannot relink '$file'"
2220
	      fi
4493
	      fi
2221
	    }
4494
	    }
2222
	  else
4495
	  else
2223
	    # Install the binary that we compiled earlier.
4496
	    # Install the binary that we compiled earlier.
2224
	    file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4497
	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
2225
	  fi
4498
	  fi
2226
	fi
4499
	fi
2227
 
4500
 
2228
	# remove .exe since cygwin /usr/bin/install will append another
4501
	# remove .exe since cygwin /usr/bin/install will append another
2229
	# one anyway
4502
	# one anyway
Line 2251... Line 4524...
2251
      esac
4524
      esac
2252
    done
4525
    done
2253
 
4526
 
2254
    for file in $staticlibs; do
4527
    for file in $staticlibs; do
2255
      func_basename "$file"
4528
      func_basename "$file"
2256
      name="$func_basename_result"
4529
      name=$func_basename_result
2257
 
4530
 
2258
      # Set up the ranlib parameters.
4531
      # Set up the ranlib parameters.
2259
      oldlib="$destdir/$name"
4532
      oldlib=$destdir/$name
-
 
4533
      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
-
 
4534
      tool_oldlib=$func_to_tool_file_result
2260
 
4535
 
2261
      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
4536
      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
2262
 
4537
 
2263
      if test -n "$stripme" && test -n "$old_striplib"; then
4538
      if test -n "$stripme" && test -n "$old_striplib"; then
2264
	func_show_eval "$old_striplib $oldlib" 'exit $?'
4539
	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
2265
      fi
4540
      fi
2266
 
4541
 
2267
      # Do each command in the postinstall commands.
4542
      # Do each command in the postinstall commands.
2268
      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
4543
      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
2269
    done
4544
    done
2270
 
4545
 
2271
    test -n "$future_libdirs" && \
4546
    test -n "$future_libdirs" && \
2272
      func_warning "remember to run \`$progname --finish$future_libdirs'"
4547
      func_warning "remember to run '$progname --finish$future_libdirs'"
2273
 
4548
 
2274
    if test -n "$current_libdirs"; then
4549
    if test -n "$current_libdirs"; then
2275
      # Maybe just do a dry run.
4550
      # Maybe just do a dry run.
2276
      $opt_dry_run && current_libdirs=" -n$current_libdirs"
4551
      $opt_dry_run && current_libdirs=" -n$current_libdirs"
2277
      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
4552
      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
2278
    else
4553
    else
2279
      exit $EXIT_SUCCESS
4554
      exit $EXIT_SUCCESS
2280
    fi
4555
    fi
2281
}
4556
}
2282
 
4557
 
2283
test "$mode" = install && func_mode_install ${1+"$@"}
4558
test install = "$opt_mode" && func_mode_install ${1+"$@"}
2284
 
4559
 
2285
 
4560
 
2286
# func_generate_dlsyms outputname originator pic_p
4561
# func_generate_dlsyms outputname originator pic_p
2287
# Extract symbols from dlprefiles and create ${outputname}S.o with
4562
# Extract symbols from dlprefiles and create ${outputname}S.o with
2288
# a dlpreopen symbol table.
4563
# a dlpreopen symbol table.
2289
func_generate_dlsyms ()
4564
func_generate_dlsyms ()
2290
{
4565
{
2291
    $opt_debug
4566
    $debug_cmd
-
 
4567
 
2292
    my_outputname="$1"
4568
    my_outputname=$1
2293
    my_originator="$2"
4569
    my_originator=$2
2294
    my_pic_p="${3-no}"
4570
    my_pic_p=${3-false}
2295
    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
4571
    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
2296
    my_dlsyms=
4572
    my_dlsyms=
2297
 
4573
 
2298
    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4574
    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
2299
      if test -n "$NM" && test -n "$global_symbol_pipe"; then
4575
      if test -n "$NM" && test -n "$global_symbol_pipe"; then
2300
	my_dlsyms="${my_outputname}S.c"
4576
	my_dlsyms=${my_outputname}S.c
2301
      else
4577
      else
2302
	func_error "not configured to extract global symbols from dlpreopened files"
4578
	func_error "not configured to extract global symbols from dlpreopened files"
2303
      fi
4579
      fi
2304
    fi
4580
    fi
2305
 
4581
 
2306
    if test -n "$my_dlsyms"; then
4582
    if test -n "$my_dlsyms"; then
2307
      case $my_dlsyms in
4583
      case $my_dlsyms in
2308
      "") ;;
4584
      "") ;;
2309
      *.c)
4585
      *.c)
2310
	# Discover the nlist of each of the dlfiles.
4586
	# Discover the nlist of each of the dlfiles.
2311
	nlist="$output_objdir/${my_outputname}.nm"
4587
	nlist=$output_objdir/$my_outputname.nm
2312
 
4588
 
2313
	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
4589
	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
2314
 
4590
 
2315
	# Parse the name list into a source file.
4591
	# Parse the name list into a source file.
2316
	func_verbose "creating $output_objdir/$my_dlsyms"
4592
	func_verbose "creating $output_objdir/$my_dlsyms"
2317
 
4593
 
2318
	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
4594
	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
2319
/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
4595
/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
2320
/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
4596
/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
2321
 
4597
 
2322
#ifdef __cplusplus
4598
#ifdef __cplusplus
2323
extern \"C\" {
4599
extern \"C\" {
2324
#endif
4600
#endif
2325
 
4601
 
-
 
4602
#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
-
 
4603
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
-
 
4604
#endif
-
 
4605
 
-
 
4606
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-
 
4607
#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
-
 
4608
/* DATA imports from DLLs on WIN32 can't be const, because runtime
-
 
4609
   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-
 
4610
# define LT_DLSYM_CONST
-
 
4611
#elif defined __osf__
-
 
4612
/* This system does not cope well with relocations in const data.  */
-
 
4613
# define LT_DLSYM_CONST
-
 
4614
#else
-
 
4615
# define LT_DLSYM_CONST const
-
 
4616
#endif
-
 
4617
 
-
 
4618
#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
-
 
4619
 
2326
/* External symbol declarations for the compiler. */\
4620
/* External symbol declarations for the compiler. */\
2327
"
4621
"
2328
 
4622
 
2329
	if test "$dlself" = yes; then
4623
	if test yes = "$dlself"; then
2330
	  func_verbose "generating symbol list for \`$output'"
4624
	  func_verbose "generating symbol list for '$output'"
2331
 
4625
 
2332
	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
4626
	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2333
 
4627
 
2334
	  # Add our own program objects to the symbol list.
4628
	  # Add our own program objects to the symbol list.
2335
	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
4629
	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
2336
	  for progfile in $progfiles; do
4630
	  for progfile in $progfiles; do
-
 
4631
	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
2337
	    func_verbose "extracting global C symbols from \`$progfile'"
4632
	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
2338
	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
4633
	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
2339
	  done
4634
	  done
2340
 
4635
 
2341
	  if test -n "$exclude_expsyms"; then
4636
	  if test -n "$exclude_expsyms"; then
2342
	    $opt_dry_run || {
4637
	    $opt_dry_run || {
2343
	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
4638
	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
Line 2352... Line 4647...
2352
	    }
4647
	    }
2353
	  fi
4648
	  fi
2354
 
4649
 
2355
	  # Prepare the list of exported symbols
4650
	  # Prepare the list of exported symbols
2356
	  if test -z "$export_symbols"; then
4651
	  if test -z "$export_symbols"; then
2357
	    export_symbols="$output_objdir/$outputname.exp"
4652
	    export_symbols=$output_objdir/$outputname.exp
2358
	    $opt_dry_run || {
4653
	    $opt_dry_run || {
2359
	      $RM $export_symbols
4654
	      $RM $export_symbols
2360
	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4655
	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2361
	      case $host in
4656
	      case $host in
2362
	      *cygwin* | *mingw* | *cegcc* )
4657
	      *cygwin* | *mingw* | *cegcc* )
2363
                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4658
                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2364
                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
4659
                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
2365
	        ;;
4660
	        ;;
2366
	      esac
4661
	      esac
2367
	    }
4662
	    }
2368
	  else
4663
	  else
2369
	    $opt_dry_run || {
4664
	    $opt_dry_run || {
2370
	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4665
	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
2371
	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4666
	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2372
	      eval '$MV "$nlist"T "$nlist"'
4667
	      eval '$MV "$nlist"T "$nlist"'
2373
	      case $host in
4668
	      case $host in
2374
	        *cygwin | *mingw* | *cegcc* )
4669
	        *cygwin* | *mingw* | *cegcc* )
2375
	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4670
	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2376
	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
4671
	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2377
	          ;;
4672
	          ;;
2378
	      esac
4673
	      esac
2379
	    }
4674
	    }
2380
	  fi
4675
	  fi
2381
	fi
4676
	fi
2382
 
4677
 
2383
	for dlprefile in $dlprefiles; do
4678
	for dlprefile in $dlprefiles; do
2384
	  func_verbose "extracting global C symbols from \`$dlprefile'"
4679
	  func_verbose "extracting global C symbols from '$dlprefile'"
2385
	  func_basename "$dlprefile"
4680
	  func_basename "$dlprefile"
2386
	  name="$func_basename_result"
4681
	  name=$func_basename_result
-
 
4682
          case $host in
-
 
4683
	    *cygwin* | *mingw* | *cegcc* )
-
 
4684
	      # if an import library, we need to obtain dlname
-
 
4685
	      if func_win32_import_lib_p "$dlprefile"; then
-
 
4686
	        func_tr_sh "$dlprefile"
-
 
4687
	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-
 
4688
	        dlprefile_dlbasename=
-
 
4689
	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
-
 
4690
	          # Use subshell, to avoid clobbering current variable values
-
 
4691
	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-
 
4692
	          if test -n "$dlprefile_dlname"; then
-
 
4693
	            func_basename "$dlprefile_dlname"
-
 
4694
	            dlprefile_dlbasename=$func_basename_result
-
 
4695
	          else
-
 
4696
	            # no lafile. user explicitly requested -dlpreopen <import library>.
-
 
4697
	            $sharedlib_from_linklib_cmd "$dlprefile"
-
 
4698
	            dlprefile_dlbasename=$sharedlib_from_linklib_result
-
 
4699
	          fi
-
 
4700
	        fi
-
 
4701
	        $opt_dry_run || {
-
 
4702
	          if test -n "$dlprefile_dlbasename"; then
-
 
4703
	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
-
 
4704
	          else
-
 
4705
	            func_warning "Could not compute DLL name from $name"
-
 
4706
	            eval '$ECHO ": $name " >> "$nlist"'
-
 
4707
	          fi
-
 
4708
	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-
 
4709
	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
-
 
4710
	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
-
 
4711
	        }
-
 
4712
	      else # not an import lib
-
 
4713
	        $opt_dry_run || {
-
 
4714
	          eval '$ECHO ": $name " >> "$nlist"'
-
 
4715
	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
-
 
4716
	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
-
 
4717
	        }
-
 
4718
	      fi
-
 
4719
	    ;;
-
 
4720
	    *)
2387
	  $opt_dry_run || {
4721
	      $opt_dry_run || {
2388
	    eval '$ECHO ": $name " >> "$nlist"'
4722
	        eval '$ECHO ": $name " >> "$nlist"'
-
 
4723
	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
2389
	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
4724
	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2390
	  }
4725
	      }
-
 
4726
	    ;;
-
 
4727
          esac
2391
	done
4728
	done
2392
 
4729
 
2393
	$opt_dry_run || {
4730
	$opt_dry_run || {
2394
	  # Make sure we have at least an empty file.
4731
	  # Make sure we have at least an empty file.
2395
	  test -f "$nlist" || : > "$nlist"
4732
	  test -f "$nlist" || : > "$nlist"
Line 2413... Line 4750...
2413
	  fi
4750
	  fi
2414
 
4751
 
2415
	  if test -f "$nlist"S; then
4752
	  if test -f "$nlist"S; then
2416
	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
4753
	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2417
	  else
4754
	  else
2418
	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
4755
	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
2419
	  fi
4756
	  fi
2420
 
4757
 
-
 
4758
	  func_show_eval '$RM "${nlist}I"'
-
 
4759
	  if test -n "$global_symbol_to_import"; then
-
 
4760
	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
-
 
4761
	  fi
-
 
4762
 
2421
	  $ECHO >> "$output_objdir/$my_dlsyms" "\
4763
	  echo >> "$output_objdir/$my_dlsyms" "\
2422
 
4764
 
2423
/* The mapping between symbol names and symbols.  */
4765
/* The mapping between symbol names and symbols.  */
2424
typedef struct {
4766
typedef struct {
2425
  const char *name;
4767
  const char *name;
2426
  void *address;
4768
  void *address;
2427
} lt_dlsymlist;
4769
} lt_dlsymlist;
-
 
4770
extern LT_DLSYM_CONST lt_dlsymlist
-
 
4771
lt_${my_prefix}_LTX_preloaded_symbols[];\
2428
"
4772
"
2429
	  case $host in
-
 
2430
	  *cygwin* | *mingw* | *cegcc* )
-
 
2431
	    $ECHO >> "$output_objdir/$my_dlsyms" "\
-
 
2432
/* DATA imports from DLLs on WIN32 con't be const, because
-
 
2433
   runtime relocations are performed -- see ld's documentation
-
 
2434
   on pseudo-relocs.  */"
-
 
2435
	    lt_dlsym_const= ;;
-
 
2436
	  *osf5*)
-
 
2437
	    echo >> "$output_objdir/$my_dlsyms" "\
-
 
2438
/* This system does not cope well with relocations in const data */"
-
 
2439
	    lt_dlsym_const= ;;
-
 
2440
	  *)
-
 
2441
	    lt_dlsym_const=const ;;
-
 
2442
	  esac
-
 
2443
 
4773
 
-
 
4774
	  if test -s "$nlist"I; then
2444
	  $ECHO >> "$output_objdir/$my_dlsyms" "\
4775
	    echo >> "$output_objdir/$my_dlsyms" "\
2445
extern $lt_dlsym_const lt_dlsymlist
4776
static void lt_syminit(void)
-
 
4777
{
2446
lt_${my_prefix}_LTX_preloaded_symbols[];
4778
  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
-
 
4779
  for (; symbol->name; ++symbol)
-
 
4780
    {"
-
 
4781
	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
-
 
4782
	    echo >> "$output_objdir/$my_dlsyms" "\
-
 
4783
    }
-
 
4784
}"
-
 
4785
	  fi
-
 
4786
	  echo >> "$output_objdir/$my_dlsyms" "\
2447
$lt_dlsym_const lt_dlsymlist
4787
LT_DLSYM_CONST lt_dlsymlist
2448
lt_${my_prefix}_LTX_preloaded_symbols[] =
4788
lt_${my_prefix}_LTX_preloaded_symbols[] =
-
 
4789
{ {\"$my_originator\", (void *) 0},"
2449
{\
4790
 
-
 
4791
	  if test -s "$nlist"I; then
-
 
4792
	    echo >> "$output_objdir/$my_dlsyms" "\
2450
  { \"$my_originator\", (void *) 0 },"
4793
  {\"@INIT@\", (void *) &lt_syminit},"
-
 
4794
	  fi
2451
 
4795
 
2452
	  case $need_lib_prefix in
4796
	  case $need_lib_prefix in
2453
	  no)
4797
	  no)
2454
	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
4798
	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
2455
	    ;;
4799
	    ;;
2456
	  *)
4800
	  *)
2457
	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
4801
	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2458
	    ;;
4802
	    ;;
2459
	  esac
4803
	  esac
2460
	  $ECHO >> "$output_objdir/$my_dlsyms" "\
4804
	  echo >> "$output_objdir/$my_dlsyms" "\
2461
  {0, (void *) 0}
4805
  {0, (void *) 0}
2462
};
4806
};
2463
 
4807
 
2464
/* This works around a problem in FreeBSD linker */
4808
/* This works around a problem in FreeBSD linker */
2465
#ifdef FREEBSD_WORKAROUND
4809
#ifdef FREEBSD_WORKAROUND
Line 2482... Line 4826...
2482
	  # compiling the symbol table file with pic_flag works around
4826
	  # compiling the symbol table file with pic_flag works around
2483
	  # a FreeBSD bug that causes programs to crash when -lm is
4827
	  # a FreeBSD bug that causes programs to crash when -lm is
2484
	  # linked before any other PIC object.  But we must not use
4828
	  # linked before any other PIC object.  But we must not use
2485
	  # pic_flag when linking with -static.  The problem exists in
4829
	  # pic_flag when linking with -static.  The problem exists in
2486
	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
4830
	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2487
	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
4831
	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2488
	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
4832
	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2489
	  *-*-hpux*)
4833
	  *-*-hpux*)
2490
	    pic_flag_for_symtable=" $pic_flag"  ;;
4834
	    pic_flag_for_symtable=" $pic_flag"  ;;
2491
	  *)
4835
	  *)
2492
	    if test "X$my_pic_p" != Xno; then
-
 
2493
	      pic_flag_for_symtable=" $pic_flag"
4836
	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
2494
	    fi
-
 
2495
	    ;;
4837
	    ;;
2496
	  esac
4838
	  esac
2497
	  ;;
4839
	  ;;
2498
	esac
4840
	esac
2499
	symtab_cflags=
4841
	symtab_cflags=
2500
	for arg in $LTCFLAGS; do
4842
	for arg in $LTCFLAGS; do
2501
	  case $arg in
4843
	  case $arg in
2502
	  -pie | -fpie | -fPIE) ;;
4844
	  -pie | -fpie | -fPIE) ;;
2503
	  *) symtab_cflags="$symtab_cflags $arg" ;;
4845
	  *) func_append symtab_cflags " $arg" ;;
2504
	  esac
4846
	  esac
2505
	done
4847
	done
2506
 
4848
 
2507
	# Now compile the dynamic symbol file.
4849
	# Now compile the dynamic symbol file.
2508
	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
4850
	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
2509
 
4851
 
2510
	# Clean up the generated files.
4852
	# Clean up the generated files.
2511
	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
4853
	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
2512
 
4854
 
2513
	# Transform the symbol file into the correct name.
4855
	# Transform the symbol file into the correct name.
2514
	symfileobj="$output_objdir/${my_outputname}S.$objext"
4856
	symfileobj=$output_objdir/${my_outputname}S.$objext
2515
	case $host in
4857
	case $host in
2516
	*cygwin* | *mingw* | *cegcc* )
4858
	*cygwin* | *mingw* | *cegcc* )
2517
	  if test -f "$output_objdir/$my_outputname.def"; then
4859
	  if test -f "$output_objdir/$my_outputname.def"; then
2518
	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
4860
	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2519
	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
4861
	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2520
	  else
4862
	  else
2521
	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
4863
	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2522
	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
4864
	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2523
	  fi
4865
	  fi
2524
	  ;;
4866
	  ;;
2525
	*)
4867
	*)
2526
	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
4868
	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2527
	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
4869
	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2528
	  ;;
4870
	  ;;
2529
	esac
4871
	esac
2530
	;;
4872
	;;
2531
      *)
4873
      *)
2532
	func_fatal_error "unknown suffix for \`$my_dlsyms'"
4874
	func_fatal_error "unknown suffix for '$my_dlsyms'"
2533
	;;
4875
	;;
2534
      esac
4876
      esac
2535
    else
4877
    else
2536
      # We keep going just in case the user didn't refer to
4878
      # We keep going just in case the user didn't refer to
2537
      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
4879
      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
2538
      # really was required.
4880
      # really was required.
2539
 
4881
 
2540
      # Nullify the symbol file.
4882
      # Nullify the symbol file.
2541
      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4883
      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
2542
      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
4884
      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
2543
    fi
4885
    fi
2544
}
4886
}
2545
 
4887
 
-
 
4888
# func_cygming_gnu_implib_p ARG
-
 
4889
# This predicate returns with zero status (TRUE) if
-
 
4890
# ARG is a GNU/binutils-style import library. Returns
-
 
4891
# with nonzero status (FALSE) otherwise.
-
 
4892
func_cygming_gnu_implib_p ()
-
 
4893
{
-
 
4894
  $debug_cmd
-
 
4895
 
-
 
4896
  func_to_tool_file "$1" func_convert_file_msys_to_w32
-
 
4897
  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-
 
4898
  test -n "$func_cygming_gnu_implib_tmp"
-
 
4899
}
-
 
4900
 
-
 
4901
# func_cygming_ms_implib_p ARG
-
 
4902
# This predicate returns with zero status (TRUE) if
-
 
4903
# ARG is an MS-style import library. Returns
-
 
4904
# with nonzero status (FALSE) otherwise.
-
 
4905
func_cygming_ms_implib_p ()
-
 
4906
{
-
 
4907
  $debug_cmd
-
 
4908
 
-
 
4909
  func_to_tool_file "$1" func_convert_file_msys_to_w32
-
 
4910
  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-
 
4911
  test -n "$func_cygming_ms_implib_tmp"
-
 
4912
}
-
 
4913
 
2546
# func_win32_libid arg
4914
# func_win32_libid arg
2547
# return the library type of file 'arg'
4915
# return the library type of file 'arg'
2548
#
4916
#
2549
# Need a lot of goo to handle *both* DLLs and import libs
4917
# Need a lot of goo to handle *both* DLLs and import libs
2550
# Has to be a shell function in order to 'eat' the argument
4918
# Has to be a shell function in order to 'eat' the argument
2551
# that is supplied when $file_magic_command is called.
4919
# that is supplied when $file_magic_command is called.
-
 
4920
# Despite the name, also deal with 64 bit binaries.
2552
func_win32_libid ()
4921
func_win32_libid ()
2553
{
4922
{
2554
  $opt_debug
4923
  $debug_cmd
-
 
4924
 
2555
  win32_libid_type="unknown"
4925
  win32_libid_type=unknown
2556
  win32_fileres=`file -L $1 2>/dev/null`
4926
  win32_fileres=`file -L $1 2>/dev/null`
2557
  case $win32_fileres in
4927
  case $win32_fileres in
2558
  *ar\ archive\ import\ library*) # definitely import
4928
  *ar\ archive\ import\ library*) # definitely import
2559
    win32_libid_type="x86 archive import"
4929
    win32_libid_type="x86 archive import"
2560
    ;;
4930
    ;;
2561
  *ar\ archive*) # could be an import, or static
4931
  *ar\ archive*) # could be an import, or static
-
 
4932
    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
2562
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
4933
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
2563
       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
4934
       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-
 
4935
      case $nm_interface in
-
 
4936
      "MS dumpbin")
-
 
4937
	if func_cygming_ms_implib_p "$1" ||
-
 
4938
	   func_cygming_gnu_implib_p "$1"
-
 
4939
	then
-
 
4940
	  win32_nmres=import
-
 
4941
	else
-
 
4942
	  win32_nmres=
-
 
4943
	fi
-
 
4944
	;;
-
 
4945
      *)
-
 
4946
	func_to_tool_file "$1" func_convert_file_msys_to_w32
2564
      win32_nmres=`eval $NM -f posix -A $1 |
4947
	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
2565
	$SED -n -e '
4948
	  $SED -n -e '
2566
	    1,100{
4949
	    1,100{
2567
		/ I /{
4950
		/ I /{
2568
		    s,.*,import,
4951
		    s|.*|import|
2569
		    p
4952
		    p
2570
		    q
4953
		    q
2571
		}
4954
		}
2572
	    }'`
4955
	    }'`
-
 
4956
	;;
-
 
4957
      esac
2573
      case $win32_nmres in
4958
      case $win32_nmres in
2574
      import*)  win32_libid_type="x86 archive import";;
4959
      import*)  win32_libid_type="x86 archive import";;
2575
      *)        win32_libid_type="x86 archive static";;
4960
      *)        win32_libid_type="x86 archive static";;
2576
      esac
4961
      esac
2577
    fi
4962
    fi
Line 2588... Line 4973...
2588
    ;;
4973
    ;;
2589
  esac
4974
  esac
2590
  $ECHO "$win32_libid_type"
4975
  $ECHO "$win32_libid_type"
2591
}
4976
}
2592
 
4977
 
-
 
4978
# func_cygming_dll_for_implib ARG
-
 
4979
#
-
 
4980
# Platform-specific function to extract the
-
 
4981
# name of the DLL associated with the specified
-
 
4982
# import library ARG.
-
 
4983
# Invoked by eval'ing the libtool variable
-
 
4984
#    $sharedlib_from_linklib_cmd
-
 
4985
# Result is available in the variable
-
 
4986
#    $sharedlib_from_linklib_result
-
 
4987
func_cygming_dll_for_implib ()
-
 
4988
{
-
 
4989
  $debug_cmd
-
 
4990
 
-
 
4991
  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
-
 
4992
}
-
 
4993
 
-
 
4994
# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
-
 
4995
#
-
 
4996
# The is the core of a fallback implementation of a
-
 
4997
# platform-specific function to extract the name of the
-
 
4998
# DLL associated with the specified import library LIBNAME.
-
 
4999
#
-
 
5000
# SECTION_NAME is either .idata$6 or .idata$7, depending
-
 
5001
# on the platform and compiler that created the implib.
-
 
5002
#
-
 
5003
# Echos the name of the DLL associated with the
-
 
5004
# specified import library.
-
 
5005
func_cygming_dll_for_implib_fallback_core ()
-
 
5006
{
-
 
5007
  $debug_cmd
-
 
5008
 
-
 
5009
  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
-
 
5010
  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
-
 
5011
    $SED '/^Contents of section '"$match_literal"':/{
-
 
5012
      # Place marker at beginning of archive member dllname section
-
 
5013
      s/.*/====MARK====/
-
 
5014
      p
-
 
5015
      d
-
 
5016
    }
-
 
5017
    # These lines can sometimes be longer than 43 characters, but
-
 
5018
    # are always uninteresting
-
 
5019
    /:[	 ]*file format pe[i]\{,1\}-/d
-
 
5020
    /^In archive [^:]*:/d
-
 
5021
    # Ensure marker is printed
-
 
5022
    /^====MARK====/p
-
 
5023
    # Remove all lines with less than 43 characters
-
 
5024
    /^.\{43\}/!d
-
 
5025
    # From remaining lines, remove first 43 characters
-
 
5026
    s/^.\{43\}//' |
-
 
5027
    $SED -n '
-
 
5028
      # Join marker and all lines until next marker into a single line
-
 
5029
      /^====MARK====/ b para
-
 
5030
      H
-
 
5031
      $ b para
-
 
5032
      b
-
 
5033
      :para
-
 
5034
      x
-
 
5035
      s/\n//g
-
 
5036
      # Remove the marker
-
 
5037
      s/^====MARK====//
-
 
5038
      # Remove trailing dots and whitespace
-
 
5039
      s/[\. \t]*$//
-
 
5040
      # Print
-
 
5041
      /./p' |
-
 
5042
    # we now have a list, one entry per line, of the stringified
-
 
5043
    # contents of the appropriate section of all members of the
-
 
5044
    # archive that possess that section. Heuristic: eliminate
-
 
5045
    # all those that have a first or second character that is
-
 
5046
    # a '.' (that is, objdump's representation of an unprintable
-
 
5047
    # character.) This should work for all archives with less than
-
 
5048
    # 0x302f exports -- but will fail for DLLs whose name actually
-
 
5049
    # begins with a literal '.' or a single character followed by
-
 
5050
    # a '.'.
-
 
5051
    #
-
 
5052
    # Of those that remain, print the first one.
-
 
5053
    $SED -e '/^\./d;/^.\./d;q'
-
 
5054
}
-
 
5055
 
-
 
5056
# func_cygming_dll_for_implib_fallback ARG
-
 
5057
# Platform-specific function to extract the
-
 
5058
# name of the DLL associated with the specified
-
 
5059
# import library ARG.
-
 
5060
#
-
 
5061
# This fallback implementation is for use when $DLLTOOL
-
 
5062
# does not support the --identify-strict option.
-
 
5063
# Invoked by eval'ing the libtool variable
-
 
5064
#    $sharedlib_from_linklib_cmd
-
 
5065
# Result is available in the variable
-
 
5066
#    $sharedlib_from_linklib_result
-
 
5067
func_cygming_dll_for_implib_fallback ()
-
 
5068
{
-
 
5069
  $debug_cmd
-
 
5070
 
-
 
5071
  if func_cygming_gnu_implib_p "$1"; then
-
 
5072
    # binutils import library
-
 
5073
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-
 
5074
  elif func_cygming_ms_implib_p "$1"; then
-
 
5075
    # ms-generated import library
-
 
5076
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
-
 
5077
  else
-
 
5078
    # unknown
-
 
5079
    sharedlib_from_linklib_result=
-
 
5080
  fi
-
 
5081
}
2593
 
5082
 
2594
 
5083
 
2595
# func_extract_an_archive dir oldlib
5084
# func_extract_an_archive dir oldlib
2596
func_extract_an_archive ()
5085
func_extract_an_archive ()
2597
{
5086
{
2598
    $opt_debug
5087
    $debug_cmd
-
 
5088
 
2599
    f_ex_an_ar_dir="$1"; shift
5089
    f_ex_an_ar_dir=$1; shift
2600
    f_ex_an_ar_oldlib="$1"
5090
    f_ex_an_ar_oldlib=$1
-
 
5091
    if test yes = "$lock_old_archive_extraction"; then
-
 
5092
      lockfile=$f_ex_an_ar_oldlib.lock
-
 
5093
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
-
 
5094
	func_echo "Waiting for $lockfile to be removed"
-
 
5095
	sleep 2
-
 
5096
      done
-
 
5097
    fi
2601
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
5098
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
-
 
5099
		   'stat=$?; rm -f "$lockfile"; exit $stat'
-
 
5100
    if test yes = "$lock_old_archive_extraction"; then
-
 
5101
      $opt_dry_run || rm -f "$lockfile"
-
 
5102
    fi
2602
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
5103
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
2603
     :
5104
     :
2604
    else
5105
    else
2605
      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
5106
      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
2606
    fi
5107
    fi
Line 2608... Line 5109...
2608
 
5109
 
2609
 
5110
 
2610
# func_extract_archives gentop oldlib ...
5111
# func_extract_archives gentop oldlib ...
2611
func_extract_archives ()
5112
func_extract_archives ()
2612
{
5113
{
2613
    $opt_debug
5114
    $debug_cmd
-
 
5115
 
2614
    my_gentop="$1"; shift
5116
    my_gentop=$1; shift
2615
    my_oldlibs=${1+"$@"}
5117
    my_oldlibs=${1+"$@"}
2616
    my_oldobjs=""
5118
    my_oldobjs=
2617
    my_xlib=""
5119
    my_xlib=
2618
    my_xabs=""
5120
    my_xabs=
2619
    my_xdir=""
5121
    my_xdir=
2620
 
5122
 
2621
    for my_xlib in $my_oldlibs; do
5123
    for my_xlib in $my_oldlibs; do
2622
      # Extract the objects.
5124
      # Extract the objects.
2623
      case $my_xlib in
5125
      case $my_xlib in
2624
	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
5126
	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
2625
	*) my_xabs=`pwd`"/$my_xlib" ;;
5127
	*) my_xabs=`pwd`"/$my_xlib" ;;
2626
      esac
5128
      esac
2627
      func_basename "$my_xlib"
5129
      func_basename "$my_xlib"
2628
      my_xlib="$func_basename_result"
5130
      my_xlib=$func_basename_result
2629
      my_xlib_u=$my_xlib
5131
      my_xlib_u=$my_xlib
2630
      while :; do
5132
      while :; do
2631
        case " $extracted_archives " in
5133
        case " $extracted_archives " in
2632
	*" $my_xlib_u "*)
5134
	*" $my_xlib_u "*)
2633
	  func_arith $extracted_serial + 1
5135
	  func_arith $extracted_serial + 1
Line 2635... Line 5137...
2635
	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
5137
	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
2636
	*) break ;;
5138
	*) break ;;
2637
	esac
5139
	esac
2638
      done
5140
      done
2639
      extracted_archives="$extracted_archives $my_xlib_u"
5141
      extracted_archives="$extracted_archives $my_xlib_u"
2640
      my_xdir="$my_gentop/$my_xlib_u"
5142
      my_xdir=$my_gentop/$my_xlib_u
2641
 
5143
 
2642
      func_mkdir_p "$my_xdir"
5144
      func_mkdir_p "$my_xdir"
2643
 
5145
 
2644
      case $host in
5146
      case $host in
2645
      *-darwin*)
5147
      *-darwin*)
Line 2648... Line 5150...
2648
	$opt_dry_run || {
5150
	$opt_dry_run || {
2649
	  darwin_orig_dir=`pwd`
5151
	  darwin_orig_dir=`pwd`
2650
	  cd $my_xdir || exit $?
5152
	  cd $my_xdir || exit $?
2651
	  darwin_archive=$my_xabs
5153
	  darwin_archive=$my_xabs
2652
	  darwin_curdir=`pwd`
5154
	  darwin_curdir=`pwd`
2653
	  darwin_base_archive=`basename "$darwin_archive"`
5155
	  func_basename "$darwin_archive"
-
 
5156
	  darwin_base_archive=$func_basename_result
2654
	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
5157
	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
2655
	  if test -n "$darwin_arches"; then
5158
	  if test -n "$darwin_arches"; then
2656
	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
5159
	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
2657
	    darwin_arch=
5160
	    darwin_arch=
2658
	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
5161
	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
2659
	    for darwin_arch in  $darwin_arches ; do
5162
	    for darwin_arch in  $darwin_arches; do
2660
	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
5163
	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
2661
	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
5164
	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
2662
	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
5165
	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
2663
	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
5166
	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
2664
	      cd "$darwin_curdir"
5167
	      cd "$darwin_curdir"
2665
	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
5168
	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
2666
	    done # $darwin_arches
5169
	    done # $darwin_arches
2667
            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
5170
            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
2668
	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
5171
	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
2669
	    darwin_file=
5172
	    darwin_file=
2670
	    darwin_files=
5173
	    darwin_files=
2671
	    for darwin_file in $darwin_filelist; do
5174
	    for darwin_file in $darwin_filelist; do
2672
	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
5175
	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
2673
	      $LIPO -create -output "$darwin_file" $darwin_files
5176
	      $LIPO -create -output "$darwin_file" $darwin_files
2674
	    done # $darwin_filelist
5177
	    done # $darwin_filelist
2675
	    $RM -rf unfat-$$
5178
	    $RM -rf unfat-$$
2676
	    cd "$darwin_orig_dir"
5179
	    cd "$darwin_orig_dir"
2677
	  else
5180
	  else
Line 2682... Line 5185...
2682
	;;
5185
	;;
2683
      *)
5186
      *)
2684
        func_extract_an_archive "$my_xdir" "$my_xabs"
5187
        func_extract_an_archive "$my_xdir" "$my_xabs"
2685
	;;
5188
	;;
2686
      esac
5189
      esac
2687
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
5190
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
2688
    done
5191
    done
2689
 
5192
 
2690
    func_extract_archives_result="$my_oldobjs"
5193
    func_extract_archives_result=$my_oldobjs
2691
}
5194
}
2692
 
5195
 
2693
 
5196
 
-
 
5197
# func_emit_wrapper [arg=no]
2694
 
5198
#
2695
# func_emit_wrapper_part1 [arg=no]
5199
# Emit a libtool wrapper script on stdout.
-
 
5200
# Don't directly open a file because we may want to
-
 
5201
# incorporate the script contents within a cygwin/mingw
-
 
5202
# wrapper executable.  Must ONLY be called from within
-
 
5203
# func_mode_link because it depends on a number of variables
-
 
5204
# set therein.
2696
#
5205
#
2697
# Emit the first part of a libtool wrapper script on stdout.
5206
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
2698
# For more information, see the description associated with
5207
# variable will take.  If 'yes', then the emitted script
2699
# func_emit_wrapper(), below.
5208
# will assume that the directory where it is stored is
-
 
5209
# the $objdir directory.  This is a cygwin/mingw-specific
-
 
5210
# behavior.
2700
func_emit_wrapper_part1 ()
5211
func_emit_wrapper ()
2701
{
5212
{
2702
	func_emit_wrapper_part1_arg1=no
5213
	func_emit_wrapper_arg1=${1-no}
2703
	if test -n "$1" ; then
-
 
2704
	  func_emit_wrapper_part1_arg1=$1
-
 
2705
	fi
-
 
2706
 
5214
 
2707
	$ECHO "\
5215
	$ECHO "\
2708
#! $SHELL
5216
#! $SHELL
2709
 
5217
 
2710
# $output - temporary wrapper script for $objdir/$outputname
5218
# $output - temporary wrapper script for $objdir/$outputname
2711
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
5219
# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
2712
#
5220
#
2713
# The $output program cannot be directly executed until all the libtool
5221
# The $output program cannot be directly executed until all the libtool
2714
# libraries that it depends on are installed.
5222
# libraries that it depends on are installed.
2715
#
5223
#
2716
# This wrapper script should never be moved out of the build directory.
5224
# This wrapper script should never be moved out of the build directory.
2717
# If it is, it will not operate correctly.
5225
# If it is, it will not operate correctly.
2718
 
5226
 
2719
# Sed substitution that helps us do robust quoting.  It backslashifies
5227
# Sed substitution that helps us do robust quoting.  It backslashifies
2720
# metacharacters that are still active within double-quoted strings.
5228
# metacharacters that are still active within double-quoted strings.
2721
Xsed='${SED} -e 1s/^X//'
-
 
2722
sed_quote_subst='$sed_quote_subst'
5229
sed_quote_subst='$sed_quote_subst'
2723
 
5230
 
2724
# Be Bourne compatible
5231
# Be Bourne compatible
2725
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
5232
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
2726
  emulate sh
5233
  emulate sh
Line 2747... Line 5254...
2747
  generated_by_libtool_version='$macro_version'
5254
  generated_by_libtool_version='$macro_version'
2748
  notinst_deplibs='$notinst_deplibs'
5255
  notinst_deplibs='$notinst_deplibs'
2749
else
5256
else
2750
  # When we are sourced in execute mode, \$file and \$ECHO are already set.
5257
  # When we are sourced in execute mode, \$file and \$ECHO are already set.
2751
  if test \"\$libtool_execute_magic\" != \"$magic\"; then
5258
  if test \"\$libtool_execute_magic\" != \"$magic\"; then
-
 
5259
    file=\"\$0\""
-
 
5260
 
-
 
5261
    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
-
 
5262
    $ECHO "\
-
 
5263
 
-
 
5264
# A function that is used when there is no print builtin or printf.
-
 
5265
func_fallback_echo ()
-
 
5266
{
-
 
5267
  eval 'cat <<_LTECHO_EOF
-
 
5268
\$1
-
 
5269
_LTECHO_EOF'
-
 
5270
}
2752
    ECHO=\"$qecho\"
5271
    ECHO=\"$qECHO\"
-
 
5272
  fi
-
 
5273
 
-
 
5274
# Very basic option parsing. These options are (a) specific to
-
 
5275
# the libtool wrapper, (b) are identical between the wrapper
-
 
5276
# /script/ and the wrapper /executable/ that is used only on
-
 
5277
# windows platforms, and (c) all begin with the string "--lt-"
-
 
5278
# (application programs are unlikely to have options that match
-
 
5279
# this pattern).
-
 
5280
#
-
 
5281
# There are only two supported options: --lt-debug and
-
 
5282
# --lt-dump-script. There is, deliberately, no --lt-help.
-
 
5283
#
-
 
5284
# The first argument to this parsing function should be the
-
 
5285
# script's $0 value, followed by "$@".
-
 
5286
lt_option_debug=
-
 
5287
func_parse_lt_options ()
-
 
5288
{
-
 
5289
  lt_script_arg0=\$0
-
 
5290
  shift
-
 
5291
  for lt_opt
-
 
5292
  do
2753
    file=\"\$0\"
5293
    case \"\$lt_opt\" in
-
 
5294
    --lt-debug) lt_option_debug=1 ;;
2754
    # Make sure echo works.
5295
    --lt-dump-script)
-
 
5296
        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
2755
    if test \"X\$1\" = X--no-reexec; then
5297
        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
-
 
5298
        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
2756
      # Discard the --no-reexec flag, and continue.
5299
        cat \"\$lt_dump_D/\$lt_dump_F\"
-
 
5300
        exit 0
2757
      shift
5301
      ;;
-
 
5302
    --lt-*)
2758
    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
5303
        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
2759
      # Yippee, \$ECHO works!
5304
        exit 1
2760
      :
5305
      ;;
2761
    else
5306
    esac
-
 
5307
  done
-
 
5308
 
2762
      # Restart under the correct shell, and then maybe \$ECHO will work.
5309
  # Print the debug banner immediately:
2763
      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
5310
  if test -n \"\$lt_option_debug\"; then
-
 
5311
    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
2764
    fi
5312
  fi
-
 
5313
}
-
 
5314
 
-
 
5315
# Used when --lt-debug. Prints its arguments to stdout
-
 
5316
# (redirection is the responsibility of the caller)
-
 
5317
func_lt_dump_args ()
-
 
5318
{
-
 
5319
  lt_dump_args_N=1;
-
 
5320
  for lt_arg
2765
  fi\
5321
  do
-
 
5322
    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
-
 
5323
    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
-
 
5324
  done
-
 
5325
}
-
 
5326
 
-
 
5327
# Core function for launching the target application
-
 
5328
func_exec_program_core ()
-
 
5329
{
2766
"
5330
"
-
 
5331
  case $host in
-
 
5332
  # Backslashes separate directories on plain windows
-
 
5333
  *-*-mingw | *-*-os2* | *-cegcc*)
-
 
5334
    $ECHO "\
-
 
5335
      if test -n \"\$lt_option_debug\"; then
-
 
5336
        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
-
 
5337
        func_lt_dump_args \${1+\"\$@\"} 1>&2
-
 
5338
      fi
-
 
5339
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-
 
5340
"
-
 
5341
    ;;
-
 
5342
 
-
 
5343
  *)
-
 
5344
    $ECHO "\
-
 
5345
      if test -n \"\$lt_option_debug\"; then
-
 
5346
        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
-
 
5347
        func_lt_dump_args \${1+\"\$@\"} 1>&2
-
 
5348
      fi
-
 
5349
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-
 
5350
"
-
 
5351
    ;;
-
 
5352
  esac
2767
	$ECHO "\
5353
  $ECHO "\
-
 
5354
      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
-
 
5355
      exit 1
-
 
5356
}
-
 
5357
 
-
 
5358
# A function to encapsulate launching the target application
-
 
5359
# Strips options in the --lt-* namespace from \$@ and
-
 
5360
# launches target application with the remaining arguments.
-
 
5361
func_exec_program ()
-
 
5362
{
-
 
5363
  case \" \$* \" in
-
 
5364
  *\\ --lt-*)
-
 
5365
    for lt_wr_arg
-
 
5366
    do
-
 
5367
      case \$lt_wr_arg in
-
 
5368
      --lt-*) ;;
-
 
5369
      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
-
 
5370
      esac
-
 
5371
      shift
-
 
5372
    done ;;
-
 
5373
  esac
-
 
5374
  func_exec_program_core \${1+\"\$@\"}
-
 
5375
}
-
 
5376
 
-
 
5377
  # Parse options
-
 
5378
  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
2768
 
5379
 
2769
  # Find the directory that this script lives in.
5380
  # Find the directory that this script lives in.
2770
  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
5381
  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
2771
  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
5382
  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2772
 
5383
 
2773
  # Follow symbolic links until we get to the real thisdir.
5384
  # Follow symbolic links until we get to the real thisdir.
2774
  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
5385
  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
2775
  while test -n \"\$file\"; do
5386
  while test -n \"\$file\"; do
2776
    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
5387
    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
2777
 
5388
 
2778
    # If there was a directory component, then change thisdir.
5389
    # If there was a directory component, then change thisdir.
2779
    if test \"x\$destdir\" != \"x\$file\"; then
5390
    if test \"x\$destdir\" != \"x\$file\"; then
2780
      case \"\$destdir\" in
5391
      case \"\$destdir\" in
2781
      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
5392
      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
2782
      *) thisdir=\"\$thisdir/\$destdir\" ;;
5393
      *) thisdir=\"\$thisdir/\$destdir\" ;;
2783
      esac
5394
      esac
2784
    fi
5395
    fi
2785
 
5396
 
2786
    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
5397
    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
2787
    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
5398
    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
2788
  done
5399
  done
2789
"
-
 
2790
}
-
 
2791
# end: func_emit_wrapper_part1
-
 
2792
 
-
 
2793
# func_emit_wrapper_part2 [arg=no]
-
 
2794
#
-
 
2795
# Emit the second part of a libtool wrapper script on stdout.
-
 
2796
# For more information, see the description associated with
-
 
2797
# func_emit_wrapper(), below.
-
 
2798
func_emit_wrapper_part2 ()
-
 
2799
{
-
 
2800
	func_emit_wrapper_part2_arg1=no
-
 
2801
	if test -n "$1" ; then
-
 
2802
	  func_emit_wrapper_part2_arg1=$1
-
 
2803
	fi
-
 
2804
 
-
 
2805
	$ECHO "\
-
 
2806
 
5400
 
2807
  # Usually 'no', except on cygwin/mingw when embedded into
5401
  # Usually 'no', except on cygwin/mingw when embedded into
2808
  # the cwrapper.
5402
  # the cwrapper.
2809
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
5403
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
2810
  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
5404
  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2811
    # special case for '.'
5405
    # special case for '.'
2812
    if test \"\$thisdir\" = \".\"; then
5406
    if test \"\$thisdir\" = \".\"; then
2813
      thisdir=\`pwd\`
5407
      thisdir=\`pwd\`
2814
    fi
5408
    fi
2815
    # remove .libs from thisdir
5409
    # remove .libs from thisdir
2816
    case \"\$thisdir\" in
5410
    case \"\$thisdir\" in
2817
    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
5411
    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
2818
    $objdir )   thisdir=. ;;
5412
    $objdir )   thisdir=. ;;
2819
    esac
5413
    esac
2820
  fi
5414
  fi
2821
 
5415
 
2822
  # Try to get the absolute directory name.
5416
  # Try to get the absolute directory name.
2823
  absdir=\`cd \"\$thisdir\" && pwd\`
5417
  absdir=\`cd \"\$thisdir\" && pwd\`
2824
  test -n \"\$absdir\" && thisdir=\"\$absdir\"
5418
  test -n \"\$absdir\" && thisdir=\"\$absdir\"
2825
"
5419
"
2826
 
5420
 
2827
	if test "$fast_install" = yes; then
5421
	if test yes = "$fast_install"; then
2828
	  $ECHO "\
5422
	  $ECHO "\
2829
  program=lt-'$outputname'$exeext
5423
  program=lt-'$outputname'$exeext
2830
  progdir=\"\$thisdir/$objdir\"
5424
  progdir=\"\$thisdir/$objdir\"
2831
 
5425
 
2832
  if test ! -f \"\$progdir/\$program\" ||
5426
  if test ! -f \"\$progdir/\$program\" ||
2833
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5427
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
2834
       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5428
       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2835
 
5429
 
2836
    file=\"\$\$-\$program\"
5430
    file=\"\$\$-\$program\"
2837
 
5431
 
2838
    if test ! -d \"\$progdir\"; then
5432
    if test ! -d \"\$progdir\"; then
Line 2845... Line 5439...
2845
 
5439
 
2846
    # relink executable if necessary
5440
    # relink executable if necessary
2847
    if test -n \"\$relink_command\"; then
5441
    if test -n \"\$relink_command\"; then
2848
      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5442
      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
2849
      else
5443
      else
2850
	$ECHO \"\$relink_command_output\" >&2
5444
	\$ECHO \"\$relink_command_output\" >&2
2851
	$RM \"\$progdir/\$file\"
5445
	$RM \"\$progdir/\$file\"
2852
	exit 1
5446
	exit 1
2853
      fi
5447
      fi
2854
    fi
5448
    fi
2855
 
5449
 
Line 2867... Line 5461...
2867
 
5461
 
2868
	$ECHO "\
5462
	$ECHO "\
2869
 
5463
 
2870
  if test -f \"\$progdir/\$program\"; then"
5464
  if test -f \"\$progdir/\$program\"; then"
2871
 
5465
 
-
 
5466
	# fixup the dll searchpath if we need to.
-
 
5467
	#
-
 
5468
	# Fix the DLL searchpath if we need to.  Do this before prepending
-
 
5469
	# to shlibpath, because on Windows, both are PATH and uninstalled
-
 
5470
	# libraries must come first.
-
 
5471
	if test -n "$dllsearchpath"; then
-
 
5472
	  $ECHO "\
-
 
5473
    # Add the dll search path components to the executable PATH
-
 
5474
    PATH=$dllsearchpath:\$PATH
-
 
5475
"
-
 
5476
	fi
-
 
5477
 
2872
	# Export our shlibpath_var if we have one.
5478
	# Export our shlibpath_var if we have one.
2873
	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5479
	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2874
	  $ECHO "\
5480
	  $ECHO "\
2875
    # Add our own library path to $shlibpath_var
5481
    # Add our own library path to $shlibpath_var
2876
    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5482
    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2877
 
5483
 
2878
    # Some systems cannot cope with colon-terminated $shlibpath_var
5484
    # Some systems cannot cope with colon-terminated $shlibpath_var
2879
    # The second colon is a workaround for a bug in BeOS R4 sed
5485
    # The second colon is a workaround for a bug in BeOS R4 sed
2880
    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
5486
    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
2881
 
5487
 
2882
    export $shlibpath_var
5488
    export $shlibpath_var
2883
"
5489
"
2884
	fi
5490
	fi
2885
 
5491
 
2886
	# fixup the dll searchpath if we need to.
-
 
2887
	if test -n "$dllsearchpath"; then
-
 
2888
	  $ECHO "\
-
 
2889
    # Add the dll search path components to the executable PATH
-
 
2890
    PATH=$dllsearchpath:\$PATH
-
 
2891
"
-
 
2892
	fi
-
 
2893
 
-
 
2894
	$ECHO "\
5492
	$ECHO "\
2895
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
5493
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
2896
      # Run the actual program with our arguments.
5494
      # Run the actual program with our arguments.
2897
"
-
 
2898
	case $host in
-
 
2899
	# Backslashes separate directories on plain windows
-
 
2900
	*-*-mingw | *-*-os2* | *-cegcc*)
-
 
2901
	  $ECHO "\
-
 
2902
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-
 
2903
"
-
 
2904
	  ;;
-
 
2905
 
-
 
2906
	*)
-
 
2907
	  $ECHO "\
-
 
2908
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
5495
      func_exec_program \${1+\"\$@\"}
2909
"
-
 
2910
	  ;;
-
 
2911
	esac
-
 
2912
	$ECHO "\
-
 
2913
      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
-
 
2914
      exit 1
-
 
2915
    fi
5496
    fi
2916
  else
5497
  else
2917
    # The program doesn't exist.
5498
    # The program doesn't exist.
2918
    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5499
    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
2919
    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
5500
    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2920
    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
5501
    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
2921
    exit 1
5502
    exit 1
2922
  fi
5503
  fi
2923
fi\
5504
fi\
2924
"
5505
"
2925
}
5506
}
2926
# end: func_emit_wrapper_part2
-
 
2927
 
-
 
2928
 
-
 
2929
# func_emit_wrapper [arg=no]
-
 
2930
#
-
 
2931
# Emit a libtool wrapper script on stdout.
-
 
2932
# Don't directly open a file because we may want to
-
 
2933
# incorporate the script contents within a cygwin/mingw
-
 
2934
# wrapper executable.  Must ONLY be called from within
-
 
2935
# func_mode_link because it depends on a number of variables
-
 
2936
# set therein.
-
 
2937
#
-
 
2938
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-
 
2939
# variable will take.  If 'yes', then the emitted script
-
 
2940
# will assume that the directory in which it is stored is
-
 
2941
# the $objdir directory.  This is a cygwin/mingw-specific
-
 
2942
# behavior.
-
 
2943
func_emit_wrapper ()
-
 
2944
{
-
 
2945
	func_emit_wrapper_arg1=no
-
 
2946
	if test -n "$1" ; then
-
 
2947
	  func_emit_wrapper_arg1=$1
-
 
2948
	fi
-
 
2949
 
-
 
2950
	# split this up so that func_emit_cwrapperexe_src
-
 
2951
	# can call each part independently.
-
 
2952
	func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
-
 
2953
	func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
-
 
2954
}
-
 
2955
 
-
 
2956
 
-
 
2957
# func_to_host_path arg
-
 
2958
#
-
 
2959
# Convert paths to host format when used with build tools.
-
 
2960
# Intended for use with "native" mingw (where libtool itself
-
 
2961
# is running under the msys shell), or in the following cross-
-
 
2962
# build environments:
-
 
2963
#    $build          $host
-
 
2964
#    mingw (msys)    mingw  [e.g. native]
-
 
2965
#    cygwin          mingw
-
 
2966
#    *nix + wine     mingw
-
 
2967
# where wine is equipped with the `winepath' executable.
-
 
2968
# In the native mingw case, the (msys) shell automatically
-
 
2969
# converts paths for any non-msys applications it launches,
-
 
2970
# but that facility isn't available from inside the cwrapper.
-
 
2971
# Similar accommodations are necessary for $host mingw and
-
 
2972
# $build cygwin.  Calling this function does no harm for other
-
 
2973
# $host/$build combinations not listed above.
-
 
2974
#
-
 
2975
# ARG is the path (on $build) that should be converted to
-
 
2976
# the proper representation for $host. The result is stored
-
 
2977
# in $func_to_host_path_result.
-
 
2978
func_to_host_path ()
-
 
2979
{
-
 
2980
  func_to_host_path_result="$1"
-
 
2981
  if test -n "$1" ; then
-
 
2982
    case $host in
-
 
2983
      *mingw* )
-
 
2984
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
 
2985
        case $build in
-
 
2986
          *mingw* ) # actually, msys
-
 
2987
            # awkward: cmd appends spaces to result
-
 
2988
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
-
 
2989
            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
-
 
2990
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
-
 
2991
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-
 
2992
              $SED -e "$lt_sed_naive_backslashify"`
-
 
2993
            ;;
-
 
2994
          *cygwin* )
-
 
2995
            func_to_host_path_tmp1=`cygpath -w "$1"`
-
 
2996
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-
 
2997
              $SED -e "$lt_sed_naive_backslashify"`
-
 
2998
            ;;
-
 
2999
          * )
-
 
3000
            # Unfortunately, winepath does not exit with a non-zero
-
 
3001
            # error code, so we are forced to check the contents of
-
 
3002
            # stdout. On the other hand, if the command is not
-
 
3003
            # found, the shell will set an exit code of 127 and print
-
 
3004
            # *an error message* to stdout. So we must check for both
-
 
3005
            # error code of zero AND non-empty stdout, which explains
-
 
3006
            # the odd construction:
-
 
3007
            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
-
 
3008
            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
-
 
3009
              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
-
 
3010
                $SED -e "$lt_sed_naive_backslashify"`
-
 
3011
            else
-
 
3012
              # Allow warning below.
-
 
3013
              func_to_host_path_result=""
-
 
3014
            fi
-
 
3015
            ;;
-
 
3016
        esac
-
 
3017
        if test -z "$func_to_host_path_result" ; then
-
 
3018
          func_error "Could not determine host path corresponding to"
-
 
3019
          func_error "  '$1'"
-
 
3020
          func_error "Continuing, but uninstalled executables may not work."
-
 
3021
          # Fallback:
-
 
3022
          func_to_host_path_result="$1"
-
 
3023
        fi
-
 
3024
        ;;
-
 
3025
    esac
-
 
3026
  fi
-
 
3027
}
-
 
3028
# end: func_to_host_path
-
 
3029
 
5507
 
3030
# func_to_host_pathlist arg
-
 
3031
#
-
 
3032
# Convert pathlists to host format when used with build tools.
-
 
3033
# See func_to_host_path(), above. This function supports the
-
 
3034
# following $build/$host combinations (but does no harm for
-
 
3035
# combinations not listed here):
-
 
3036
#    $build          $host
-
 
3037
#    mingw (msys)    mingw  [e.g. native]
-
 
3038
#    cygwin          mingw
-
 
3039
#    *nix + wine     mingw
-
 
3040
#
-
 
3041
# Path separators are also converted from $build format to
-
 
3042
# $host format. If ARG begins or ends with a path separator
-
 
3043
# character, it is preserved (but converted to $host format)
-
 
3044
# on output.
-
 
3045
#
-
 
3046
# ARG is a pathlist (on $build) that should be converted to
-
 
3047
# the proper representation on $host. The result is stored
-
 
3048
# in $func_to_host_pathlist_result.
-
 
3049
func_to_host_pathlist ()
-
 
3050
{
-
 
3051
  func_to_host_pathlist_result="$1"
-
 
3052
  if test -n "$1" ; then
-
 
3053
    case $host in
-
 
3054
      *mingw* )
-
 
3055
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
 
3056
        # Remove leading and trailing path separator characters from
-
 
3057
        # ARG. msys behavior is inconsistent here, cygpath turns them
-
 
3058
        # into '.;' and ';.', and winepath ignores them completely.
-
 
3059
        func_to_host_pathlist_tmp2="$1"
-
 
3060
        # Once set for this call, this variable should not be
-
 
3061
        # reassigned. It is used in tha fallback case.
-
 
3062
        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
-
 
3063
          $SED -e 's|^:*||' -e 's|:*$||'`
-
 
3064
        case $build in
-
 
3065
          *mingw* ) # Actually, msys.
-
 
3066
            # Awkward: cmd appends spaces to result.
-
 
3067
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
-
 
3068
            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
-
 
3069
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
-
 
3070
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
-
 
3071
              $SED -e "$lt_sed_naive_backslashify"`
-
 
3072
            ;;
-
 
3073
          *cygwin* )
-
 
3074
            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
-
 
3075
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
-
 
3076
              $SED -e "$lt_sed_naive_backslashify"`
-
 
3077
            ;;
-
 
3078
          * )
-
 
3079
            # unfortunately, winepath doesn't convert pathlists
-
 
3080
            func_to_host_pathlist_result=""
-
 
3081
            func_to_host_pathlist_oldIFS=$IFS
-
 
3082
            IFS=:
-
 
3083
            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
-
 
3084
              IFS=$func_to_host_pathlist_oldIFS
-
 
3085
              if test -n "$func_to_host_pathlist_f" ; then
-
 
3086
                func_to_host_path "$func_to_host_pathlist_f"
-
 
3087
                if test -n "$func_to_host_path_result" ; then
-
 
3088
                  if test -z "$func_to_host_pathlist_result" ; then
-
 
3089
                    func_to_host_pathlist_result="$func_to_host_path_result"
-
 
3090
                  else
-
 
3091
                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
-
 
3092
                  fi
-
 
3093
                fi
-
 
3094
              fi
-
 
3095
              IFS=:
-
 
3096
            done
-
 
3097
            IFS=$func_to_host_pathlist_oldIFS
-
 
3098
            ;;
-
 
3099
        esac
-
 
3100
        if test -z "$func_to_host_pathlist_result" ; then
-
 
3101
          func_error "Could not determine the host path(s) corresponding to"
-
 
3102
          func_error "  '$1'"
-
 
3103
          func_error "Continuing, but uninstalled executables may not work."
-
 
3104
          # Fallback. This may break if $1 contains DOS-style drive
-
 
3105
          # specifications. The fix is not to complicate the expression
-
 
3106
          # below, but for the user to provide a working wine installation
-
 
3107
          # with winepath so that path translation in the cross-to-mingw
-
 
3108
          # case works properly.
-
 
3109
          lt_replace_pathsep_nix_to_dos="s|:|;|g"
-
 
3110
          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
-
 
3111
            $SED -e "$lt_replace_pathsep_nix_to_dos"`
-
 
3112
        fi
-
 
3113
        # Now, add the leading and trailing path separators back
-
 
3114
        case "$1" in
-
 
3115
          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
-
 
3116
            ;;
-
 
3117
        esac
-
 
3118
        case "$1" in
-
 
3119
          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
-
 
3120
            ;;
-
 
3121
        esac
-
 
3122
        ;;
-
 
3123
    esac
-
 
3124
  fi
-
 
3125
}
-
 
3126
# end: func_to_host_pathlist
-
 
3127
 
5508
 
3128
# func_emit_cwrapperexe_src
5509
# func_emit_cwrapperexe_src
3129
# emit the source code for a wrapper executable on stdout
5510
# emit the source code for a wrapper executable on stdout
3130
# Must ONLY be called from within func_mode_link because
5511
# Must ONLY be called from within func_mode_link because
3131
# it depends on a number of variable set therein.
5512
# it depends on a number of variable set therein.
3132
func_emit_cwrapperexe_src ()
5513
func_emit_cwrapperexe_src ()
3133
{
5514
{
3134
	cat <<EOF
5515
	cat <<EOF
3135
 
5516
 
3136
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5517
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
3137
   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
5518
   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
3138
 
5519
 
3139
   The $output program cannot be directly executed until all the libtool
5520
   The $output program cannot be directly executed until all the libtool
3140
   libraries that it depends on are installed.
5521
   libraries that it depends on are installed.
3141
 
5522
 
3142
   This wrapper executable should never be moved out of the build directory.
5523
   This wrapper executable should never be moved out of the build directory.
3143
   If it is, it will not operate correctly.
5524
   If it is, it will not operate correctly.
3144
 
-
 
3145
   Currently, it simply execs the wrapper *script* "$SHELL $output",
-
 
3146
   but could eventually absorb all of the scripts functionality and
-
 
3147
   exec $objdir/$outputname directly.
-
 
3148
*/
5525
*/
3149
EOF
5526
EOF
3150
	    cat <<"EOF"
5527
	    cat <<"EOF"
-
 
5528
#ifdef _MSC_VER
-
 
5529
# define _CRT_SECURE_NO_DEPRECATE 1
-
 
5530
#endif
3151
#include <stdio.h>
5531
#include <stdio.h>
3152
#include <stdlib.h>
5532
#include <stdlib.h>
3153
#ifdef _MSC_VER
5533
#ifdef _MSC_VER
3154
# include <direct.h>
5534
# include <direct.h>
3155
# include <process.h>
5535
# include <process.h>
3156
# include <io.h>
5536
# include <io.h>
3157
# define setmode _setmode
-
 
3158
#else
5537
#else
3159
# include <unistd.h>
5538
# include <unistd.h>
3160
# include <stdint.h>
5539
# include <stdint.h>
3161
# ifdef __CYGWIN__
5540
# ifdef __CYGWIN__
3162
#  include <io.h>
5541
#  include <io.h>
3163
#  define HAVE_SETENV
-
 
3164
#  ifdef __STRICT_ANSI__
-
 
3165
char *realpath (const char *, char *);
-
 
3166
int putenv (char *);
-
 
3167
int setenv (const char *, const char *, int);
-
 
3168
#  endif
-
 
3169
# endif
5542
# endif
3170
#endif
5543
#endif
3171
#include <malloc.h>
5544
#include <malloc.h>
3172
#include <stdarg.h>
5545
#include <stdarg.h>
3173
#include <assert.h>
5546
#include <assert.h>
Line 3175... Line 5548...
3175
#include <ctype.h>
5548
#include <ctype.h>
3176
#include <errno.h>
5549
#include <errno.h>
3177
#include <fcntl.h>
5550
#include <fcntl.h>
3178
#include <sys/stat.h>
5551
#include <sys/stat.h>
3179
 
5552
 
-
 
5553
#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
-
 
5554
 
-
 
5555
/* declarations of non-ANSI functions */
-
 
5556
#if defined __MINGW32__
-
 
5557
# ifdef __STRICT_ANSI__
-
 
5558
int _putenv (const char *);
-
 
5559
# endif
-
 
5560
#elif defined __CYGWIN__
-
 
5561
# ifdef __STRICT_ANSI__
-
 
5562
char *realpath (const char *, char *);
-
 
5563
int putenv (char *);
-
 
5564
int setenv (const char *, const char *, int);
-
 
5565
# endif
-
 
5566
/* #elif defined other_platform || defined ... */
-
 
5567
#endif
-
 
5568
 
-
 
5569
/* portability defines, excluding path handling macros */
-
 
5570
#if defined _MSC_VER
-
 
5571
# define setmode _setmode
-
 
5572
# define stat    _stat
-
 
5573
# define chmod   _chmod
-
 
5574
# define getcwd  _getcwd
-
 
5575
# define putenv  _putenv
-
 
5576
# define S_IXUSR _S_IEXEC
-
 
5577
#elif defined __MINGW32__
-
 
5578
# define setmode _setmode
-
 
5579
# define stat    _stat
-
 
5580
# define chmod   _chmod
-
 
5581
# define getcwd  _getcwd
-
 
5582
# define putenv  _putenv
-
 
5583
#elif defined __CYGWIN__
-
 
5584
# define HAVE_SETENV
-
 
5585
# define FOPEN_WB "wb"
-
 
5586
/* #elif defined other platforms ... */
-
 
5587
#endif
-
 
5588
 
3180
#if defined(PATH_MAX)
5589
#if defined PATH_MAX
3181
# define LT_PATHMAX PATH_MAX
5590
# define LT_PATHMAX PATH_MAX
3182
#elif defined(MAXPATHLEN)
5591
#elif defined MAXPATHLEN
3183
# define LT_PATHMAX MAXPATHLEN
5592
# define LT_PATHMAX MAXPATHLEN
3184
#else
5593
#else
3185
# define LT_PATHMAX 1024
5594
# define LT_PATHMAX 1024
3186
#endif
5595
#endif
3187
 
5596
 
Line 3190... Line 5599...
3190
#endif
5599
#endif
3191
#ifndef S_IXGRP
5600
#ifndef S_IXGRP
3192
# define S_IXGRP 0
5601
# define S_IXGRP 0
3193
#endif
5602
#endif
3194
 
5603
 
3195
#ifdef _MSC_VER
-
 
3196
# define S_IXUSR _S_IEXEC
-
 
3197
# define stat _stat
-
 
3198
# ifndef _INTPTR_T_DEFINED
-
 
3199
#  define intptr_t int
5604
/* path handling portability macros */
3200
# endif
-
 
3201
#endif
-
 
3202
 
-
 
3203
#ifndef DIR_SEPARATOR
5605
#ifndef DIR_SEPARATOR
3204
# define DIR_SEPARATOR '/'
5606
# define DIR_SEPARATOR '/'
3205
# define PATH_SEPARATOR ':'
5607
# define PATH_SEPARATOR ':'
3206
#endif
5608
#endif
3207
 
5609
 
3208
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5610
#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
3209
  defined (__OS2__)
5611
  defined __OS2__
3210
# define HAVE_DOS_BASED_FILE_SYSTEM
5612
# define HAVE_DOS_BASED_FILE_SYSTEM
3211
# define FOPEN_WB "wb"
5613
# define FOPEN_WB "wb"
3212
# ifndef DIR_SEPARATOR_2
5614
# ifndef DIR_SEPARATOR_2
3213
#  define DIR_SEPARATOR_2 '\\'
5615
#  define DIR_SEPARATOR_2 '\\'
3214
# endif
5616
# endif
Line 3228... Line 5630...
3228
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
5630
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3229
#else /* PATH_SEPARATOR_2 */
5631
#else /* PATH_SEPARATOR_2 */
3230
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
5632
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3231
#endif /* PATH_SEPARATOR_2 */
5633
#endif /* PATH_SEPARATOR_2 */
3232
 
5634
 
3233
#ifdef __CYGWIN__
-
 
3234
# define FOPEN_WB "wb"
-
 
3235
#endif
-
 
3236
 
-
 
3237
#ifndef FOPEN_WB
5635
#ifndef FOPEN_WB
3238
# define FOPEN_WB "w"
5636
# define FOPEN_WB "w"
3239
#endif
5637
#endif
3240
#ifndef _O_BINARY
5638
#ifndef _O_BINARY
3241
# define _O_BINARY 0
5639
# define _O_BINARY 0
3242
#endif
5640
#endif
3243
 
5641
 
3244
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
5642
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
3245
#define XFREE(stale) do { \
5643
#define XFREE(stale) do { \
3246
  if (stale) { free ((void *) stale); stale = 0; } \
5644
  if (stale) { free (stale); stale = 0; } \
3247
} while (0)
5645
} while (0)
3248
 
5646
 
3249
#undef LTWRAPPER_DEBUGPRINTF
-
 
3250
#if defined DEBUGWRAPPER
5647
#if defined LT_DEBUGWRAPPER
3251
# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
-
 
3252
static void
5648
static int lt_debug = 1;
3253
ltwrapper_debugprintf (const char *fmt, ...)
-
 
3254
{
-
 
3255
    va_list args;
-
 
3256
    va_start (args, fmt);
-
 
3257
    (void) vfprintf (stderr, fmt, args);
-
 
3258
    va_end (args);
-
 
3259
}
-
 
3260
#else
5649
#else
3261
# define LTWRAPPER_DEBUGPRINTF(args)
5650
static int lt_debug = 0;
3262
#endif
5651
#endif
3263
 
5652
 
3264
const char *program_name = NULL;
5653
const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
3265
 
5654
 
3266
void *xmalloc (size_t num);
5655
void *xmalloc (size_t num);
3267
char *xstrdup (const char *string);
5656
char *xstrdup (const char *string);
3268
const char *base_name (const char *name);
5657
const char *base_name (const char *name);
3269
char *find_executable (const char *wrapper);
5658
char *find_executable (const char *wrapper);
3270
char *chase_symlinks (const char *pathspec);
5659
char *chase_symlinks (const char *pathspec);
3271
int make_executable (const char *path);
5660
int make_executable (const char *path);
3272
int check_executable (const char *path);
5661
int check_executable (const char *path);
3273
char *strendzap (char *str, const char *pat);
5662
char *strendzap (char *str, const char *pat);
-
 
5663
void lt_debugprintf (const char *file, int line, const char *fmt, ...);
3274
void lt_fatal (const char *message, ...);
5664
void lt_fatal (const char *file, int line, const char *message, ...);
-
 
5665
static const char *nonnull (const char *s);
-
 
5666
static const char *nonempty (const char *s);
3275
void lt_setenv (const char *name, const char *value);
5667
void lt_setenv (const char *name, const char *value);
3276
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
5668
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3277
void lt_opt_process_env_set (const char *arg);
-
 
3278
void lt_opt_process_env_prepend (const char *arg);
-
 
3279
void lt_opt_process_env_append (const char *arg);
-
 
3280
int lt_split_name_value (const char *arg, char** name, char** value);
-
 
3281
void lt_update_exe_path (const char *name, const char *value);
5669
void lt_update_exe_path (const char *name, const char *value);
3282
void lt_update_lib_path (const char *name, const char *value);
5670
void lt_update_lib_path (const char *name, const char *value);
3283
 
-
 
3284
static const char *script_text_part1 =
-
 
3285
EOF
-
 
3286
 
-
 
3287
	    func_emit_wrapper_part1 yes |
5671
char **prepare_spawn (char **argv);
3288
	        $SED -e 's/\([\\"]\)/\\\1/g' \
-
 
3289
	             -e 's/^/  "/' -e 's/$/\\n"/'
-
 
3290
	    echo ";"
-
 
3291
	    cat <<EOF
-
 
3292
 
-
 
3293
static const char *script_text_part2 =
5672
void lt_dump_script (FILE *f);
3294
EOF
5673
EOF
3295
	    func_emit_wrapper_part2 yes |
-
 
3296
	        $SED -e 's/\([\\"]\)/\\\1/g' \
-
 
3297
	             -e 's/^/  "/' -e 's/$/\\n"/'
-
 
3298
	    echo ";"
-
 
3299
 
5674
 
3300
	    cat <<EOF
5675
	    cat <<EOF
-
 
5676
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
-
 
5677
# define externally_visible volatile
-
 
5678
#else
-
 
5679
# define externally_visible __attribute__((externally_visible)) volatile
-
 
5680
#endif
3301
const char * MAGIC_EXE = "$magic_exe";
5681
externally_visible const char * MAGIC_EXE = "$magic_exe";
3302
const char * LIB_PATH_VARNAME = "$shlibpath_var";
5682
const char * LIB_PATH_VARNAME = "$shlibpath_var";
3303
EOF
5683
EOF
3304
 
5684
 
3305
	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5685
	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3306
              func_to_host_pathlist "$temp_rpath"
5686
              func_to_host_path "$temp_rpath"
3307
	      cat <<EOF
5687
	      cat <<EOF
3308
const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
5688
const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
3309
EOF
5689
EOF
3310
	    else
5690
	    else
3311
	      cat <<"EOF"
5691
	      cat <<"EOF"
3312
const char * LIB_PATH_VALUE   = "";
5692
const char * LIB_PATH_VALUE   = "";
3313
EOF
5693
EOF
3314
	    fi
5694
	    fi
3315
 
5695
 
3316
	    if test -n "$dllsearchpath"; then
5696
	    if test -n "$dllsearchpath"; then
3317
              func_to_host_pathlist "$dllsearchpath:"
5697
              func_to_host_path "$dllsearchpath:"
3318
	      cat <<EOF
5698
	      cat <<EOF
3319
const char * EXE_PATH_VARNAME = "PATH";
5699
const char * EXE_PATH_VARNAME = "PATH";
3320
const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
5700
const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
3321
EOF
5701
EOF
3322
	    else
5702
	    else
3323
	      cat <<"EOF"
5703
	      cat <<"EOF"
3324
const char * EXE_PATH_VARNAME = "";
5704
const char * EXE_PATH_VARNAME = "";
3325
const char * EXE_PATH_VALUE   = "";
5705
const char * EXE_PATH_VALUE   = "";
3326
EOF
5706
EOF
3327
	    fi
5707
	    fi
3328
 
5708
 
3329
	    if test "$fast_install" = yes; then
5709
	    if test yes = "$fast_install"; then
3330
	      cat <<EOF
5710
	      cat <<EOF
3331
const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
5711
const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
3332
EOF
5712
EOF
3333
	    else
5713
	    else
3334
	      cat <<EOF
5714
	      cat <<EOF
Line 3338... Line 5718...
3338
 
5718
 
3339
 
5719
 
3340
	    cat <<"EOF"
5720
	    cat <<"EOF"
3341
 
5721
 
3342
#define LTWRAPPER_OPTION_PREFIX         "--lt-"
5722
#define LTWRAPPER_OPTION_PREFIX         "--lt-"
3343
#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
-
 
3344
 
5723
 
3345
static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
-
 
3346
static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
5724
static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
3347
 
-
 
3348
static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
5725
static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
3349
 
-
 
3350
static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
-
 
3351
static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
5726
static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
3352
  /* argument is putenv-style "foo=bar", value of foo is set to bar */
-
 
3353
 
-
 
3354
static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
-
 
3355
static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
-
 
3356
  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
-
 
3357
 
-
 
3358
static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
-
 
3359
static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
-
 
3360
  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
-
 
3361
 
5727
 
3362
int
5728
int
3363
main (int argc, char *argv[])
5729
main (int argc, char *argv[])
3364
{
5730
{
3365
  char **newargz;
5731
  char **newargz;
Line 3367... Line 5733...
3367
  char *tmp_pathspec;
5733
  char *tmp_pathspec;
3368
  char *actual_cwrapper_path;
5734
  char *actual_cwrapper_path;
3369
  char *actual_cwrapper_name;
5735
  char *actual_cwrapper_name;
3370
  char *target_name;
5736
  char *target_name;
3371
  char *lt_argv_zero;
5737
  char *lt_argv_zero;
3372
  intptr_t rval = 127;
5738
  int rval = 127;
3373
 
5739
 
3374
  int i;
5740
  int i;
3375
 
5741
 
3376
  program_name = (char *) xstrdup (base_name (argv[0]));
5742
  program_name = (char *) xstrdup (base_name (argv[0]));
3377
  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
5743
  newargz = XMALLOC (char *, (size_t) argc + 1);
3378
  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
-
 
3379
 
5744
 
3380
  /* very simple arg parsing; don't want to rely on getopt */
5745
  /* very simple arg parsing; don't want to rely on getopt
-
 
5746
   * also, copy all non cwrapper options to newargz, except
-
 
5747
   * argz[0], which is handled differently
-
 
5748
   */
-
 
5749
  newargc=0;
3381
  for (i = 1; i < argc; i++)
5750
  for (i = 1; i < argc; i++)
3382
    {
5751
    {
3383
      if (strcmp (argv[i], dumpscript_opt) == 0)
5752
      if (STREQ (argv[i], dumpscript_opt))
3384
	{
5753
	{
3385
EOF
5754
EOF
3386
	    case "$host" in
5755
	    case $host in
3387
	      *mingw* | *cygwin* )
5756
	      *mingw* | *cygwin* )
3388
		# make stdout use "unix" line endings
5757
		# make stdout use "unix" line endings
3389
		echo "          setmode(1,_O_BINARY);"
5758
		echo "          setmode(1,_O_BINARY);"
3390
		;;
5759
		;;
3391
	      esac
5760
	      esac
3392
 
5761
 
3393
	    cat <<"EOF"
5762
	    cat <<"EOF"
3394
	  printf ("%s", script_text_part1);
-
 
3395
	  printf ("%s", script_text_part2);
5763
	  lt_dump_script (stdout);
3396
	  return 0;
5764
	  return 0;
3397
	}
5765
	}
-
 
5766
      if (STREQ (argv[i], debug_opt))
-
 
5767
	{
-
 
5768
          lt_debug = 1;
-
 
5769
          continue;
-
 
5770
	}
-
 
5771
      if (STREQ (argv[i], ltwrapper_option_prefix))
-
 
5772
        {
-
 
5773
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-
 
5774
             namespace, but it is not one of the ones we know about and
-
 
5775
             have already dealt with, above (inluding dump-script), then
-
 
5776
             report an error. Otherwise, targets might begin to believe
-
 
5777
             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-
 
5778
             namespace. The first time any user complains about this, we'll
-
 
5779
             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-
 
5780
             or a configure.ac-settable value.
-
 
5781
           */
-
 
5782
          lt_fatal (__FILE__, __LINE__,
-
 
5783
		    "unrecognized %s option: '%s'",
-
 
5784
                    ltwrapper_option_prefix, argv[i]);
-
 
5785
        }
-
 
5786
      /* otherwise ... */
-
 
5787
      newargz[++newargc] = xstrdup (argv[i]);
3398
    }
5788
    }
-
 
5789
  newargz[++newargc] = NULL;
-
 
5790
 
-
 
5791
EOF
-
 
5792
	    cat <<EOF
-
 
5793
  /* The GNU banner must be the first non-error debug message */
-
 
5794
  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
-
 
5795
EOF
-
 
5796
	    cat <<"EOF"
-
 
5797
  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
-
 
5798
  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
3399
 
5799
 
3400
  newargz = XMALLOC (char *, argc + 1);
-
 
3401
  tmp_pathspec = find_executable (argv[0]);
5800
  tmp_pathspec = find_executable (argv[0]);
3402
  if (tmp_pathspec == NULL)
5801
  if (tmp_pathspec == NULL)
3403
    lt_fatal ("Couldn't find %s", argv[0]);
5802
    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
-
 
5803
  lt_debugprintf (__FILE__, __LINE__,
3404
  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
5804
                  "(main) found exe (before symlink chase) at: %s\n",
3405
			  tmp_pathspec));
5805
		  tmp_pathspec);
3406
 
5806
 
3407
  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
5807
  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
-
 
5808
  lt_debugprintf (__FILE__, __LINE__,
3408
  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
5809
                  "(main) found exe (after symlink chase) at: %s\n",
3409
			  actual_cwrapper_path));
5810
		  actual_cwrapper_path);
3410
  XFREE (tmp_pathspec);
5811
  XFREE (tmp_pathspec);
3411
 
5812
 
3412
  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
5813
  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
3413
  strendzap (actual_cwrapper_path, actual_cwrapper_name);
5814
  strendzap (actual_cwrapper_path, actual_cwrapper_name);
3414
 
5815
 
3415
  /* wrapper name transforms */
5816
  /* wrapper name transforms */
3416
  strendzap (actual_cwrapper_name, ".exe");
5817
  strendzap (actual_cwrapper_name, ".exe");
3417
  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
5818
  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
Line 3425... Line 5826...
3425
  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
5826
  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
3426
  XFREE (target_name);
5827
  XFREE (target_name);
3427
  target_name = tmp_pathspec;
5828
  target_name = tmp_pathspec;
3428
  tmp_pathspec = 0;
5829
  tmp_pathspec = 0;
3429
 
5830
 
-
 
5831
  lt_debugprintf (__FILE__, __LINE__,
3430
  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
5832
		  "(main) libtool target name: %s\n",
3431
			  target_name));
5833
		  target_name);
3432
EOF
5834
EOF
3433
 
5835
 
3434
	    cat <<EOF
5836
	    cat <<EOF
3435
  newargz[0] =
5837
  newargz[0] =
3436
    XMALLOC (char, (strlen (actual_cwrapper_path) +
5838
    XMALLOC (char, (strlen (actual_cwrapper_path) +
Line 3476... Line 5878...
3476
  XFREE (actual_cwrapper_path);
5878
  XFREE (actual_cwrapper_path);
3477
  XFREE (actual_cwrapper_name);
5879
  XFREE (actual_cwrapper_name);
3478
 
5880
 
3479
  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
5881
  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3480
  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
5882
  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
3481
  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
5883
  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
-
 
5884
     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
-
 
5885
     because on Windows, both *_VARNAMEs are PATH but uninstalled
-
 
5886
     libraries must come first. */
3482
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
5887
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
-
 
5888
  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3483
 
5889
 
3484
  newargc=0;
-
 
3485
  for (i = 1; i < argc; i++)
-
 
3486
    {
-
 
3487
      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
5890
  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
3488
        {
-
 
3489
          if (argv[i][env_set_opt_len] == '=')
-
 
3490
            {
-
 
3491
              const char *p = argv[i] + env_set_opt_len + 1;
-
 
3492
              lt_opt_process_env_set (p);
-
 
3493
            }
-
 
3494
          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
-
 
3495
            {
-
 
3496
              lt_opt_process_env_set (argv[++i]); /* don't copy */
-
 
3497
            }
-
 
3498
          else
-
 
3499
            lt_fatal ("%s missing required argument", env_set_opt);
-
 
3500
          continue;
-
 
3501
        }
-
 
3502
      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
-
 
3503
        {
-
 
3504
          if (argv[i][env_prepend_opt_len] == '=')
-
 
3505
            {
-
 
3506
              const char *p = argv[i] + env_prepend_opt_len + 1;
-
 
3507
              lt_opt_process_env_prepend (p);
-
 
3508
            }
-
 
3509
          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
-
 
3510
            {
-
 
3511
              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
-
 
3512
            }
-
 
3513
          else
-
 
3514
            lt_fatal ("%s missing required argument", env_prepend_opt);
-
 
3515
          continue;
-
 
3516
        }
-
 
3517
      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
-
 
3518
        {
-
 
3519
          if (argv[i][env_append_opt_len] == '=')
-
 
3520
            {
-
 
3521
              const char *p = argv[i] + env_append_opt_len + 1;
-
 
3522
              lt_opt_process_env_append (p);
-
 
3523
            }
-
 
3524
          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
-
 
3525
            {
-
 
3526
              lt_opt_process_env_append (argv[++i]); /* don't copy */
-
 
3527
            }
-
 
3528
          else
-
 
3529
            lt_fatal ("%s missing required argument", env_append_opt);
-
 
3530
          continue;
-
 
3531
        }
-
 
3532
      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
-
 
3533
        {
-
 
3534
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-
 
3535
             namespace, but it is not one of the ones we know about and
-
 
3536
             have already dealt with, above (inluding dump-script), then
-
 
3537
             report an error. Otherwise, targets might begin to believe
-
 
3538
             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-
 
3539
             namespace. The first time any user complains about this, we'll
-
 
3540
             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-
 
3541
             or a configure.ac-settable value.
-
 
3542
           */
-
 
3543
          lt_fatal ("Unrecognized option in %s namespace: '%s'",
-
 
3544
                    ltwrapper_option_prefix, argv[i]);
-
 
3545
        }
-
 
3546
      /* otherwise ... */
-
 
3547
      newargz[++newargc] = xstrdup (argv[i]);
-
 
3548
    }
-
 
3549
  newargz[++newargc] = NULL;
5891
		  nonnull (lt_argv_zero));
3550
 
-
 
3551
  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
-
 
3552
  for (i = 0; i < newargc; i++)
5892
  for (i = 0; i < newargc; i++)
3553
    {
5893
    {
3554
      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
5894
      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
-
 
5895
		      i, nonnull (newargz[i]));
3555
    }
5896
    }
3556
 
5897
 
3557
EOF
5898
EOF
3558
 
5899
 
3559
	    case $host_os in
5900
	    case $host_os in
3560
	      mingw*)
5901
	      mingw*)
3561
		cat <<"EOF"
5902
		cat <<"EOF"
3562
  /* execv doesn't actually work on mingw as expected on unix */
5903
  /* execv doesn't actually work on mingw as expected on unix */
-
 
5904
  newargz = prepare_spawn (newargz);
3563
  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
5905
  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
3564
  if (rval == -1)
5906
  if (rval == -1)
3565
    {
5907
    {
3566
      /* failed to start process */
5908
      /* failed to start process */
-
 
5909
      lt_debugprintf (__FILE__, __LINE__,
3567
      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
5910
		      "(main) failed to launch target \"%s\": %s\n",
-
 
5911
		      lt_argv_zero, nonnull (strerror (errno)));
3568
      return 127;
5912
      return 127;
3569
    }
5913
    }
3570
  return rval;
5914
  return rval;
3571
EOF
5915
EOF
3572
		;;
5916
		;;
Line 3584... Line 5928...
3584
void *
5928
void *
3585
xmalloc (size_t num)
5929
xmalloc (size_t num)
3586
{
5930
{
3587
  void *p = (void *) malloc (num);
5931
  void *p = (void *) malloc (num);
3588
  if (!p)
5932
  if (!p)
3589
    lt_fatal ("Memory exhausted");
5933
    lt_fatal (__FILE__, __LINE__, "memory exhausted");
3590
 
5934
 
3591
  return p;
5935
  return p;
3592
}
5936
}
3593
 
5937
 
3594
char *
5938
char *
Line 3601... Line 5945...
3601
const char *
5945
const char *
3602
base_name (const char *name)
5946
base_name (const char *name)
3603
{
5947
{
3604
  const char *base;
5948
  const char *base;
3605
 
5949
 
3606
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5950
#if defined HAVE_DOS_BASED_FILE_SYSTEM
3607
  /* Skip over the disk name in MSDOS pathnames. */
5951
  /* Skip over the disk name in MSDOS pathnames. */
3608
  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
5952
  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
3609
    name += 2;
5953
    name += 2;
3610
#endif
5954
#endif
3611
 
5955
 
Line 3618... Line 5962...
3618
int
5962
int
3619
check_executable (const char *path)
5963
check_executable (const char *path)
3620
{
5964
{
3621
  struct stat st;
5965
  struct stat st;
3622
 
5966
 
3623
  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
5967
  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
3624
			  path ? (*path ? path : "EMPTY!") : "NULL!"));
5968
                  nonempty (path));
3625
  if ((!path) || (!*path))
5969
  if ((!path) || (!*path))
3626
    return 0;
5970
    return 0;
3627
 
5971
 
3628
  if ((stat (path, &st) >= 0)
5972
  if ((stat (path, &st) >= 0)
3629
      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
5973
      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
Line 3636... Line 5980...
3636
make_executable (const char *path)
5980
make_executable (const char *path)
3637
{
5981
{
3638
  int rval = 0;
5982
  int rval = 0;
3639
  struct stat st;
5983
  struct stat st;
3640
 
5984
 
3641
  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
5985
  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
3642
			  path ? (*path ? path : "EMPTY!") : "NULL!"));
5986
                  nonempty (path));
3643
  if ((!path) || (!*path))
5987
  if ((!path) || (!*path))
3644
    return 0;
5988
    return 0;
3645
 
5989
 
3646
  if (stat (path, &st) >= 0)
5990
  if (stat (path, &st) >= 0)
3647
    {
5991
    {
Line 3660... Line 6004...
3660
  int has_slash = 0;
6004
  int has_slash = 0;
3661
  const char *p;
6005
  const char *p;
3662
  const char *p_next;
6006
  const char *p_next;
3663
  /* static buffer for getcwd */
6007
  /* static buffer for getcwd */
3664
  char tmp[LT_PATHMAX + 1];
6008
  char tmp[LT_PATHMAX + 1];
3665
  int tmp_len;
6009
  size_t tmp_len;
3666
  char *concat_name;
6010
  char *concat_name;
3667
 
6011
 
3668
  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
6012
  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
3669
			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
6013
                  nonempty (wrapper));
3670
 
6014
 
3671
  if ((wrapper == NULL) || (*wrapper == '\0'))
6015
  if ((wrapper == NULL) || (*wrapper == '\0'))
3672
    return NULL;
6016
    return NULL;
3673
 
6017
 
3674
  /* Absolute path? */
6018
  /* Absolute path? */
3675
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
6019
#if defined HAVE_DOS_BASED_FILE_SYSTEM
3676
  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
6020
  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
3677
    {
6021
    {
3678
      concat_name = xstrdup (wrapper);
6022
      concat_name = xstrdup (wrapper);
3679
      if (check_executable (concat_name))
6023
      if (check_executable (concat_name))
3680
	return concat_name;
6024
	return concat_name;
Line 3688... Line 6032...
3688
	  concat_name = xstrdup (wrapper);
6032
	  concat_name = xstrdup (wrapper);
3689
	  if (check_executable (concat_name))
6033
	  if (check_executable (concat_name))
3690
	    return concat_name;
6034
	    return concat_name;
3691
	  XFREE (concat_name);
6035
	  XFREE (concat_name);
3692
	}
6036
	}
3693
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
6037
#if defined HAVE_DOS_BASED_FILE_SYSTEM
3694
    }
6038
    }
3695
#endif
6039
#endif
3696
 
6040
 
3697
  for (p = wrapper; *p; p++)
6041
  for (p = wrapper; *p; p++)
3698
    if (*p == '/')
6042
    if (*p == '/')
Line 3711... Line 6055...
3711
	      const char *q;
6055
	      const char *q;
3712
	      size_t p_len;
6056
	      size_t p_len;
3713
	      for (q = p; *q; q++)
6057
	      for (q = p; *q; q++)
3714
		if (IS_PATH_SEPARATOR (*q))
6058
		if (IS_PATH_SEPARATOR (*q))
3715
		  break;
6059
		  break;
3716
	      p_len = q - p;
6060
	      p_len = (size_t) (q - p);
3717
	      p_next = (*q == '\0' ? q : q + 1);
6061
	      p_next = (*q == '\0' ? q : q + 1);
3718
	      if (p_len == 0)
6062
	      if (p_len == 0)
3719
		{
6063
		{
3720
		  /* empty path: current directory */
6064
		  /* empty path: current directory */
3721
		  if (getcwd (tmp, LT_PATHMAX) == NULL)
6065
		  if (getcwd (tmp, LT_PATHMAX) == NULL)
3722
		    lt_fatal ("getcwd failed");
6066
		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-
 
6067
                              nonnull (strerror (errno)));
3723
		  tmp_len = strlen (tmp);
6068
		  tmp_len = strlen (tmp);
3724
		  concat_name =
6069
		  concat_name =
3725
		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
6070
		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3726
		  memcpy (concat_name, tmp, tmp_len);
6071
		  memcpy (concat_name, tmp, tmp_len);
3727
		  concat_name[tmp_len] = '/';
6072
		  concat_name[tmp_len] = '/';
Line 3742... Line 6087...
3742
	}
6087
	}
3743
      /* not found in PATH; assume curdir */
6088
      /* not found in PATH; assume curdir */
3744
    }
6089
    }
3745
  /* Relative path | not found in path: prepend cwd */
6090
  /* Relative path | not found in path: prepend cwd */
3746
  if (getcwd (tmp, LT_PATHMAX) == NULL)
6091
  if (getcwd (tmp, LT_PATHMAX) == NULL)
3747
    lt_fatal ("getcwd failed");
6092
    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-
 
6093
              nonnull (strerror (errno)));
3748
  tmp_len = strlen (tmp);
6094
  tmp_len = strlen (tmp);
3749
  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
6095
  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3750
  memcpy (concat_name, tmp, tmp_len);
6096
  memcpy (concat_name, tmp, tmp_len);
3751
  concat_name[tmp_len] = '/';
6097
  concat_name[tmp_len] = '/';
3752
  strcpy (concat_name + tmp_len + 1, wrapper);
6098
  strcpy (concat_name + tmp_len + 1, wrapper);
Line 3768... Line 6114...
3768
  char *tmp_pathspec = xstrdup (pathspec);
6114
  char *tmp_pathspec = xstrdup (pathspec);
3769
  char *p;
6115
  char *p;
3770
  int has_symlinks = 0;
6116
  int has_symlinks = 0;
3771
  while (strlen (tmp_pathspec) && !has_symlinks)
6117
  while (strlen (tmp_pathspec) && !has_symlinks)
3772
    {
6118
    {
-
 
6119
      lt_debugprintf (__FILE__, __LINE__,
3773
      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
6120
		      "checking path component for symlinks: %s\n",
3774
			      tmp_pathspec));
6121
		      tmp_pathspec);
3775
      if (lstat (tmp_pathspec, &s) == 0)
6122
      if (lstat (tmp_pathspec, &s) == 0)
3776
	{
6123
	{
3777
	  if (S_ISLNK (s.st_mode) != 0)
6124
	  if (S_ISLNK (s.st_mode) != 0)
3778
	    {
6125
	    {
3779
	      has_symlinks = 1;
6126
	      has_symlinks = 1;
Line 3791... Line 6138...
3791
	    }
6138
	    }
3792
	  *p = '\0';
6139
	  *p = '\0';
3793
	}
6140
	}
3794
      else
6141
      else
3795
	{
6142
	{
3796
	  char *errstr = strerror (errno);
6143
	  lt_fatal (__FILE__, __LINE__,
3797
	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
6144
		    "error accessing file \"%s\": %s",
-
 
6145
		    tmp_pathspec, nonnull (strerror (errno)));
3798
	}
6146
	}
3799
    }
6147
    }
3800
  XFREE (tmp_pathspec);
6148
  XFREE (tmp_pathspec);
3801
 
6149
 
3802
  if (!has_symlinks)
6150
  if (!has_symlinks)
Line 3805... Line 6153...
3805
    }
6153
    }
3806
 
6154
 
3807
  tmp_pathspec = realpath (pathspec, buf);
6155
  tmp_pathspec = realpath (pathspec, buf);
3808
  if (tmp_pathspec == 0)
6156
  if (tmp_pathspec == 0)
3809
    {
6157
    {
-
 
6158
      lt_fatal (__FILE__, __LINE__,
3810
      lt_fatal ("Could not follow symlinks for %s", pathspec);
6159
		"could not follow symlinks for %s", pathspec);
3811
    }
6160
    }
3812
  return xstrdup (tmp_pathspec);
6161
  return xstrdup (tmp_pathspec);
3813
#endif
6162
#endif
3814
}
6163
}
3815
 
6164
 
Line 3825... Line 6174...
3825
  patlen = strlen (pat);
6174
  patlen = strlen (pat);
3826
 
6175
 
3827
  if (patlen <= len)
6176
  if (patlen <= len)
3828
    {
6177
    {
3829
      str += len - patlen;
6178
      str += len - patlen;
3830
      if (strcmp (str, pat) == 0)
6179
      if (STREQ (str, pat))
3831
	*str = '\0';
6180
	*str = '\0';
3832
    }
6181
    }
3833
  return str;
6182
  return str;
3834
}
6183
}
3835
 
6184
 
-
 
6185
void
-
 
6186
lt_debugprintf (const char *file, int line, const char *fmt, ...)
-
 
6187
{
-
 
6188
  va_list args;
-
 
6189
  if (lt_debug)
-
 
6190
    {
-
 
6191
      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
-
 
6192
      va_start (args, fmt);
-
 
6193
      (void) vfprintf (stderr, fmt, args);
-
 
6194
      va_end (args);
-
 
6195
    }
-
 
6196
}
-
 
6197
 
3836
static void
6198
static void
3837
lt_error_core (int exit_status, const char *mode,
6199
lt_error_core (int exit_status, const char *file,
-
 
6200
	       int line, const char *mode,
3838
	       const char *message, va_list ap)
6201
	       const char *message, va_list ap)
3839
{
6202
{
3840
  fprintf (stderr, "%s: %s: ", program_name, mode);
6203
  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
3841
  vfprintf (stderr, message, ap);
6204
  vfprintf (stderr, message, ap);
3842
  fprintf (stderr, ".\n");
6205
  fprintf (stderr, ".\n");
3843
 
6206
 
3844
  if (exit_status >= 0)
6207
  if (exit_status >= 0)
3845
    exit (exit_status);
6208
    exit (exit_status);
3846
}
6209
}
3847
 
6210
 
3848
void
6211
void
3849
lt_fatal (const char *message, ...)
6212
lt_fatal (const char *file, int line, const char *message, ...)
3850
{
6213
{
3851
  va_list ap;
6214
  va_list ap;
3852
  va_start (ap, message);
6215
  va_start (ap, message);
3853
  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
6216
  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
3854
  va_end (ap);
6217
  va_end (ap);
3855
}
6218
}
3856
 
6219
 
-
 
6220
static const char *
-
 
6221
nonnull (const char *s)
-
 
6222
{
-
 
6223
  return s ? s : "(null)";
-
 
6224
}
-
 
6225
 
-
 
6226
static const char *
-
 
6227
nonempty (const char *s)
-
 
6228
{
-
 
6229
  return (s && !*s) ? "(empty)" : nonnull (s);
-
 
6230
}
-
 
6231
 
3857
void
6232
void
3858
lt_setenv (const char *name, const char *value)
6233
lt_setenv (const char *name, const char *value)
3859
{
6234
{
3860
  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
6235
  lt_debugprintf (__FILE__, __LINE__,
3861
                          (name ? name : "<NULL>"),
6236
		  "(lt_setenv) setting '%s' to '%s'\n",
3862
                          (value ? value : "<NULL>")));
6237
                  nonnull (name), nonnull (value));
3863
  {
6238
  {
3864
#ifdef HAVE_SETENV
6239
#ifdef HAVE_SETENV
3865
    /* always make a copy, for consistency with !HAVE_SETENV */
6240
    /* always make a copy, for consistency with !HAVE_SETENV */
3866
    char *str = xstrdup (value);
6241
    char *str = xstrdup (value);
3867
    setenv (name, str, 1);
6242
    setenv (name, str, 1);
3868
#else
6243
#else
3869
    int len = strlen (name) + 1 + strlen (value) + 1;
6244
    size_t len = strlen (name) + 1 + strlen (value) + 1;
3870
    char *str = XMALLOC (char, len);
6245
    char *str = XMALLOC (char, len);
3871
    sprintf (str, "%s=%s", name, value);
6246
    sprintf (str, "%s=%s", name, value);
3872
    if (putenv (str) != EXIT_SUCCESS)
6247
    if (putenv (str) != EXIT_SUCCESS)
3873
      {
6248
      {
3874
        XFREE (str);
6249
        XFREE (str);
Line 3881... Line 6256...
3881
lt_extend_str (const char *orig_value, const char *add, int to_end)
6256
lt_extend_str (const char *orig_value, const char *add, int to_end)
3882
{
6257
{
3883
  char *new_value;
6258
  char *new_value;
3884
  if (orig_value && *orig_value)
6259
  if (orig_value && *orig_value)
3885
    {
6260
    {
3886
      int orig_value_len = strlen (orig_value);
6261
      size_t orig_value_len = strlen (orig_value);
3887
      int add_len = strlen (add);
6262
      size_t add_len = strlen (add);
3888
      new_value = XMALLOC (char, add_len + orig_value_len + 1);
6263
      new_value = XMALLOC (char, add_len + orig_value_len + 1);
3889
      if (to_end)
6264
      if (to_end)
3890
        {
6265
        {
3891
          strcpy (new_value, orig_value);
6266
          strcpy (new_value, orig_value);
3892
          strcpy (new_value + orig_value_len, add);
6267
          strcpy (new_value + orig_value_len, add);
Line 3902... Line 6277...
3902
      new_value = xstrdup (add);
6277
      new_value = xstrdup (add);
3903
    }
6278
    }
3904
  return new_value;
6279
  return new_value;
3905
}
6280
}
3906
 
6281
 
3907
int
-
 
3908
lt_split_name_value (const char *arg, char** name, char** value)
-
 
3909
{
-
 
3910
  const char *p;
-
 
3911
  int len;
-
 
3912
  if (!arg || !*arg)
-
 
3913
    return 1;
-
 
3914
 
-
 
3915
  p = strchr (arg, (int)'=');
-
 
3916
 
-
 
3917
  if (!p)
-
 
3918
    return 1;
-
 
3919
 
-
 
3920
  *value = xstrdup (++p);
-
 
3921
 
-
 
3922
  len = strlen (arg) - strlen (*value);
-
 
3923
  *name = XMALLOC (char, len);
-
 
3924
  strncpy (*name, arg, len-1);
-
 
3925
  (*name)[len - 1] = '\0';
-
 
3926
 
-
 
3927
  return 0;
-
 
3928
}
-
 
3929
 
-
 
3930
void
-
 
3931
lt_opt_process_env_set (const char *arg)
-
 
3932
{
-
 
3933
  char *name = NULL;
-
 
3934
  char *value = NULL;
-
 
3935
 
-
 
3936
  if (lt_split_name_value (arg, &name, &value) != 0)
-
 
3937
    {
-
 
3938
      XFREE (name);
-
 
3939
      XFREE (value);
-
 
3940
      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
-
 
3941
    }
-
 
3942
 
-
 
3943
  lt_setenv (name, value);
-
 
3944
  XFREE (name);
-
 
3945
  XFREE (value);
-
 
3946
}
-
 
3947
 
-
 
3948
void
-
 
3949
lt_opt_process_env_prepend (const char *arg)
-
 
3950
{
-
 
3951
  char *name = NULL;
-
 
3952
  char *value = NULL;
-
 
3953
  char *new_value = NULL;
-
 
3954
 
-
 
3955
  if (lt_split_name_value (arg, &name, &value) != 0)
-
 
3956
    {
-
 
3957
      XFREE (name);
-
 
3958
      XFREE (value);
-
 
3959
      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
-
 
3960
    }
-
 
3961
 
-
 
3962
  new_value = lt_extend_str (getenv (name), value, 0);
-
 
3963
  lt_setenv (name, new_value);
-
 
3964
  XFREE (new_value);
-
 
3965
  XFREE (name);
-
 
3966
  XFREE (value);
-
 
3967
}
-
 
3968
 
-
 
3969
void
-
 
3970
lt_opt_process_env_append (const char *arg)
-
 
3971
{
-
 
3972
  char *name = NULL;
-
 
3973
  char *value = NULL;
-
 
3974
  char *new_value = NULL;
-
 
3975
 
-
 
3976
  if (lt_split_name_value (arg, &name, &value) != 0)
-
 
3977
    {
-
 
3978
      XFREE (name);
-
 
3979
      XFREE (value);
-
 
3980
      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
-
 
3981
    }
-
 
3982
 
-
 
3983
  new_value = lt_extend_str (getenv (name), value, 1);
-
 
3984
  lt_setenv (name, new_value);
-
 
3985
  XFREE (new_value);
-
 
3986
  XFREE (name);
-
 
3987
  XFREE (value);
-
 
3988
}
-
 
3989
 
-
 
3990
void
6282
void
3991
lt_update_exe_path (const char *name, const char *value)
6283
lt_update_exe_path (const char *name, const char *value)
3992
{
6284
{
-
 
6285
  lt_debugprintf (__FILE__, __LINE__,
3993
  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
6286
		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
3994
                          (name ? name : "<NULL>"),
6287
                  nonnull (name), nonnull (value));
3995
                          (value ? value : "<NULL>")));
-
 
3996
 
6288
 
3997
  if (name && *name && value && *value)
6289
  if (name && *name && value && *value)
3998
    {
6290
    {
3999
      char *new_value = lt_extend_str (getenv (name), value, 0);
6291
      char *new_value = lt_extend_str (getenv (name), value, 0);
4000
      /* some systems can't cope with a ':'-terminated path #' */
6292
      /* some systems can't cope with a ':'-terminated path #' */
4001
      int len = strlen (new_value);
6293
      size_t len = strlen (new_value);
4002
      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
6294
      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4003
        {
6295
        {
4004
          new_value[len-1] = '\0';
6296
          new_value[--len] = '\0';
4005
        }
6297
        }
4006
      lt_setenv (name, new_value);
6298
      lt_setenv (name, new_value);
4007
      XFREE (new_value);
6299
      XFREE (new_value);
4008
    }
6300
    }
4009
}
6301
}
4010
 
6302
 
4011
void
6303
void
4012
lt_update_lib_path (const char *name, const char *value)
6304
lt_update_lib_path (const char *name, const char *value)
4013
{
6305
{
-
 
6306
  lt_debugprintf (__FILE__, __LINE__,
4014
  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
6307
		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4015
                          (name ? name : "<NULL>"),
6308
                  nonnull (name), nonnull (value));
4016
                          (value ? value : "<NULL>")));
-
 
4017
 
6309
 
4018
  if (name && *name && value && *value)
6310
  if (name && *name && value && *value)
4019
    {
6311
    {
4020
      char *new_value = lt_extend_str (getenv (name), value, 0);
6312
      char *new_value = lt_extend_str (getenv (name), value, 0);
4021
      lt_setenv (name, new_value);
6313
      lt_setenv (name, new_value);
4022
      XFREE (new_value);
6314
      XFREE (new_value);
4023
    }
6315
    }
4024
}
6316
}
4025
 
6317
 
-
 
6318
EOF
-
 
6319
	    case $host_os in
-
 
6320
	      mingw*)
-
 
6321
		cat <<"EOF"
-
 
6322
 
-
 
6323
/* Prepares an argument vector before calling spawn().
-
 
6324
   Note that spawn() does not by itself call the command interpreter
-
 
6325
     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
-
 
6326
      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-
 
6327
         GetVersionEx(&v);
-
 
6328
         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
-
 
6329
      }) ? "cmd.exe" : "command.com").
-
 
6330
   Instead it simply concatenates the arguments, separated by ' ', and calls
-
 
6331
   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
-
 
6332
   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
-
 
6333
   special way:
-
 
6334
   - Space and tab are interpreted as delimiters. They are not treated as
-
 
6335
     delimiters if they are surrounded by double quotes: "...".
-
 
6336
   - Unescaped double quotes are removed from the input. Their only effect is
-
 
6337
     that within double quotes, space and tab are treated like normal
-
 
6338
     characters.
-
 
6339
   - Backslashes not followed by double quotes are not special.
-
 
6340
   - But 2*n+1 backslashes followed by a double quote become
-
 
6341
     n backslashes followed by a double quote (n >= 0):
-
 
6342
       \" -> "
-
 
6343
       \\\" -> \"
-
 
6344
       \\\\\" -> \\"
-
 
6345
 */
-
 
6346
#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"
-
 
6347
#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"
-
 
6348
char **
-
 
6349
prepare_spawn (char **argv)
-
 
6350
{
-
 
6351
  size_t argc;
-
 
6352
  char **new_argv;
-
 
6353
  size_t i;
-
 
6354
 
-
 
6355
  /* Count number of arguments.  */
-
 
6356
  for (argc = 0; argv[argc] != NULL; argc++)
-
 
6357
    ;
-
 
6358
 
-
 
6359
  /* Allocate new argument vector.  */
-
 
6360
  new_argv = XMALLOC (char *, argc + 1);
-
 
6361
 
-
 
6362
  /* Put quoted arguments into the new argument vector.  */
-
 
6363
  for (i = 0; i < argc; i++)
-
 
6364
    {
-
 
6365
      const char *string = argv[i];
-
 
6366
 
-
 
6367
      if (string[0] == '\0')
-
 
6368
	new_argv[i] = xstrdup ("\"\"");
-
 
6369
      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
-
 
6370
	{
-
 
6371
	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
-
 
6372
	  size_t length;
-
 
6373
	  unsigned int backslashes;
-
 
6374
	  const char *s;
-
 
6375
	  char *quoted_string;
-
 
6376
	  char *p;
-
 
6377
 
-
 
6378
	  length = 0;
-
 
6379
	  backslashes = 0;
-
 
6380
	  if (quote_around)
-
 
6381
	    length++;
-
 
6382
	  for (s = string; *s != '\0'; s++)
-
 
6383
	    {
-
 
6384
	      char c = *s;
-
 
6385
	      if (c == '"')
-
 
6386
		length += backslashes + 1;
-
 
6387
	      length++;
-
 
6388
	      if (c == '\\')
-
 
6389
		backslashes++;
-
 
6390
	      else
-
 
6391
		backslashes = 0;
-
 
6392
	    }
-
 
6393
	  if (quote_around)
-
 
6394
	    length += backslashes + 1;
-
 
6395
 
-
 
6396
	  quoted_string = XMALLOC (char, length + 1);
-
 
6397
 
-
 
6398
	  p = quoted_string;
-
 
6399
	  backslashes = 0;
-
 
6400
	  if (quote_around)
-
 
6401
	    *p++ = '"';
-
 
6402
	  for (s = string; *s != '\0'; s++)
-
 
6403
	    {
-
 
6404
	      char c = *s;
-
 
6405
	      if (c == '"')
-
 
6406
		{
-
 
6407
		  unsigned int j;
-
 
6408
		  for (j = backslashes + 1; j > 0; j--)
-
 
6409
		    *p++ = '\\';
-
 
6410
		}
-
 
6411
	      *p++ = c;
-
 
6412
	      if (c == '\\')
-
 
6413
		backslashes++;
-
 
6414
	      else
-
 
6415
		backslashes = 0;
-
 
6416
	    }
-
 
6417
	  if (quote_around)
-
 
6418
	    {
-
 
6419
	      unsigned int j;
-
 
6420
	      for (j = backslashes; j > 0; j--)
-
 
6421
		*p++ = '\\';
-
 
6422
	      *p++ = '"';
-
 
6423
	    }
-
 
6424
	  *p = '\0';
-
 
6425
 
-
 
6426
	  new_argv[i] = quoted_string;
-
 
6427
	}
-
 
6428
      else
-
 
6429
	new_argv[i] = (char *) string;
-
 
6430
    }
-
 
6431
  new_argv[argc] = NULL;
-
 
6432
 
-
 
6433
  return new_argv;
-
 
6434
}
-
 
6435
EOF
-
 
6436
		;;
-
 
6437
	    esac
4026
 
6438
 
-
 
6439
            cat <<"EOF"
-
 
6440
void lt_dump_script (FILE* f)
-
 
6441
{
-
 
6442
EOF
-
 
6443
	    func_emit_wrapper yes |
-
 
6444
	      $SED -n -e '
-
 
6445
s/^\(.\{79\}\)\(..*\)/\1\
-
 
6446
\2/
-
 
6447
h
-
 
6448
s/\([\\"]\)/\\\1/g
-
 
6449
s/$/\\n/
-
 
6450
s/\([^\n]*\).*/  fputs ("\1", f);/p
-
 
6451
g
-
 
6452
D'
-
 
6453
            cat <<"EOF"
-
 
6454
}
4027
EOF
6455
EOF
4028
}
6456
}
4029
# end: func_emit_cwrapperexe_src
6457
# end: func_emit_cwrapperexe_src
4030
 
6458
 
-
 
6459
# func_win32_import_lib_p ARG
-
 
6460
# True if ARG is an import lib, as indicated by $file_magic_cmd
-
 
6461
func_win32_import_lib_p ()
-
 
6462
{
-
 
6463
    $debug_cmd
-
 
6464
 
-
 
6465
    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
-
 
6466
    *import*) : ;;
-
 
6467
    *) false ;;
-
 
6468
    esac
-
 
6469
}
-
 
6470
 
-
 
6471
# func_suncc_cstd_abi
-
 
6472
# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
-
 
6473
# Several compiler flags select an ABI that is incompatible with the
-
 
6474
# Cstd library. Avoid specifying it if any are in CXXFLAGS.
-
 
6475
func_suncc_cstd_abi ()
-
 
6476
{
-
 
6477
    $debug_cmd
-
 
6478
 
-
 
6479
    case " $compile_command " in
-
 
6480
    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
-
 
6481
      suncc_use_cstd_abi=no
-
 
6482
      ;;
-
 
6483
    *)
-
 
6484
      suncc_use_cstd_abi=yes
-
 
6485
      ;;
-
 
6486
    esac
-
 
6487
}
-
 
6488
 
4031
# func_mode_link arg...
6489
# func_mode_link arg...
4032
func_mode_link ()
6490
func_mode_link ()
4033
{
6491
{
4034
    $opt_debug
6492
    $debug_cmd
-
 
6493
 
4035
    case $host in
6494
    case $host in
4036
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6495
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4037
      # It is impossible to link a dll without this setting, and
6496
      # It is impossible to link a dll without this setting, and
4038
      # we shouldn't force the makefile maintainer to figure out
6497
      # we shouldn't force the makefile maintainer to figure out
4039
      # which system we are compiling for in order to pass an extra
6498
      # what system we are compiling for in order to pass an extra
4040
      # flag for every libtool invocation.
6499
      # flag for every libtool invocation.
4041
      # allow_undefined=no
6500
      # allow_undefined=no
4042
 
6501
 
4043
      # FIXME: Unfortunately, there are problems with the above when trying
6502
      # FIXME: Unfortunately, there are problems with the above when trying
4044
      # to make a dll which has undefined symbols, in which case not
6503
      # to make a dll that has undefined symbols, in which case not
4045
      # even a static library is built.  For now, we need to specify
6504
      # even a static library is built.  For now, we need to specify
4046
      # -no-undefined on the libtool link line when we can be certain
6505
      # -no-undefined on the libtool link line when we can be certain
4047
      # that all symbols are satisfied, otherwise we get a static library.
6506
      # that all symbols are satisfied, otherwise we get a static library.
4048
      allow_undefined=yes
6507
      allow_undefined=yes
4049
      ;;
6508
      ;;
Line 4070... Line 6529...
4070
    lib_search_path=`pwd`
6529
    lib_search_path=`pwd`
4071
    inst_prefix_dir=
6530
    inst_prefix_dir=
4072
    new_inherited_linker_flags=
6531
    new_inherited_linker_flags=
4073
 
6532
 
4074
    avoid_version=no
6533
    avoid_version=no
-
 
6534
    bindir=
4075
    dlfiles=
6535
    dlfiles=
4076
    dlprefiles=
6536
    dlprefiles=
4077
    dlself=no
6537
    dlself=no
4078
    export_dynamic=no
6538
    export_dynamic=no
4079
    export_symbols=
6539
    export_symbols=
Line 4082... Line 6542...
4082
    libobjs=
6542
    libobjs=
4083
    ltlibs=
6543
    ltlibs=
4084
    module=no
6544
    module=no
4085
    no_install=no
6545
    no_install=no
4086
    objs=
6546
    objs=
-
 
6547
    os2dllname=
4087
    non_pic_objects=
6548
    non_pic_objects=
4088
    precious_files_regex=
6549
    precious_files_regex=
4089
    prefer_static_libs=no
6550
    prefer_static_libs=no
4090
    preload=no
6551
    preload=false
4091
    prev=
6552
    prev=
4092
    prevarg=
6553
    prevarg=
4093
    release=
6554
    release=
4094
    rpath=
6555
    rpath=
4095
    xrpath=
6556
    xrpath=
Line 4097... Line 6558...
4097
    temp_rpath=
6558
    temp_rpath=
4098
    thread_safe=no
6559
    thread_safe=no
4099
    vinfo=
6560
    vinfo=
4100
    vinfo_number=no
6561
    vinfo_number=no
4101
    weak_libs=
6562
    weak_libs=
4102
    single_module="${wl}-single_module"
6563
    single_module=$wl-single_module
4103
    func_infer_tag $base_compile
6564
    func_infer_tag $base_compile
4104
 
6565
 
4105
    # We need to know -static, to get the right output filenames.
6566
    # We need to know -static, to get the right output filenames.
4106
    for arg
6567
    for arg
4107
    do
6568
    do
4108
      case $arg in
6569
      case $arg in
4109
      -shared)
6570
      -shared)
4110
	test "$build_libtool_libs" != yes && \
6571
	test yes != "$build_libtool_libs" \
4111
	  func_fatal_configuration "can not build a shared library"
6572
	  && func_fatal_configuration "cannot build a shared library"
4112
	build_old_libs=no
6573
	build_old_libs=no
4113
	break
6574
	break
4114
	;;
6575
	;;
4115
      -all-static | -static | -static-libtool-libs)
6576
      -all-static | -static | -static-libtool-libs)
4116
	case $arg in
6577
	case $arg in
4117
	-all-static)
6578
	-all-static)
4118
	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
6579
	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
4119
	    func_warning "complete static linking is impossible in this configuration"
6580
	    func_warning "complete static linking is impossible in this configuration"
4120
	  fi
6581
	  fi
4121
	  if test -n "$link_static_flag"; then
6582
	  if test -n "$link_static_flag"; then
4122
	    dlopen_self=$dlopen_self_static
6583
	    dlopen_self=$dlopen_self_static
4123
	  fi
6584
	  fi
Line 4146... Line 6607...
4146
    # See if our shared archives depend on static archives.
6607
    # See if our shared archives depend on static archives.
4147
    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
6608
    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
4148
 
6609
 
4149
    # Go through the arguments, transforming them on the way.
6610
    # Go through the arguments, transforming them on the way.
4150
    while test "$#" -gt 0; do
6611
    while test "$#" -gt 0; do
4151
      arg="$1"
6612
      arg=$1
4152
      shift
6613
      shift
4153
      func_quote_for_eval "$arg"
6614
      func_quote_for_eval "$arg"
4154
      qarg=$func_quote_for_eval_unquoted_result
6615
      qarg=$func_quote_for_eval_unquoted_result
4155
      func_append libtool_args " $func_quote_for_eval_result"
6616
      func_append libtool_args " $func_quote_for_eval_result"
4156
 
6617
 
Line 4162... Line 6623...
4162
	  func_append finalize_command " @OUTPUT@"
6623
	  func_append finalize_command " @OUTPUT@"
4163
	  ;;
6624
	  ;;
4164
	esac
6625
	esac
4165
 
6626
 
4166
	case $prev in
6627
	case $prev in
-
 
6628
	bindir)
-
 
6629
	  bindir=$arg
-
 
6630
	  prev=
-
 
6631
	  continue
-
 
6632
	  ;;
4167
	dlfiles|dlprefiles)
6633
	dlfiles|dlprefiles)
4168
	  if test "$preload" = no; then
6634
	  $preload || {
4169
	    # Add the symbol object into the linking commands.
6635
	    # Add the symbol object into the linking commands.
4170
	    func_append compile_command " @SYMFILE@"
6636
	    func_append compile_command " @SYMFILE@"
4171
	    func_append finalize_command " @SYMFILE@"
6637
	    func_append finalize_command " @SYMFILE@"
4172
	    preload=yes
6638
	    preload=:
4173
	  fi
6639
	  }
4174
	  case $arg in
6640
	  case $arg in
4175
	  *.la | *.lo) ;;  # We handle these cases below.
6641
	  *.la | *.lo) ;;  # We handle these cases below.
4176
	  force)
6642
	  force)
4177
	    if test "$dlself" = no; then
6643
	    if test no = "$dlself"; then
4178
	      dlself=needless
6644
	      dlself=needless
4179
	      export_dynamic=yes
6645
	      export_dynamic=yes
4180
	    fi
6646
	    fi
4181
	    prev=
6647
	    prev=
4182
	    continue
6648
	    continue
4183
	    ;;
6649
	    ;;
4184
	  self)
6650
	  self)
4185
	    if test "$prev" = dlprefiles; then
6651
	    if test dlprefiles = "$prev"; then
4186
	      dlself=yes
6652
	      dlself=yes
4187
	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
6653
	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
4188
	      dlself=yes
6654
	      dlself=yes
4189
	    else
6655
	    else
4190
	      dlself=needless
6656
	      dlself=needless
4191
	      export_dynamic=yes
6657
	      export_dynamic=yes
4192
	    fi
6658
	    fi
4193
	    prev=
6659
	    prev=
4194
	    continue
6660
	    continue
4195
	    ;;
6661
	    ;;
4196
	  *)
6662
	  *)
4197
	    if test "$prev" = dlfiles; then
6663
	    if test dlfiles = "$prev"; then
4198
	      dlfiles="$dlfiles $arg"
6664
	      func_append dlfiles " $arg"
4199
	    else
6665
	    else
4200
	      dlprefiles="$dlprefiles $arg"
6666
	      func_append dlprefiles " $arg"
4201
	    fi
6667
	    fi
4202
	    prev=
6668
	    prev=
4203
	    continue
6669
	    continue
4204
	    ;;
6670
	    ;;
4205
	  esac
6671
	  esac
4206
	  ;;
6672
	  ;;
4207
	expsyms)
6673
	expsyms)
4208
	  export_symbols="$arg"
6674
	  export_symbols=$arg
4209
	  test -f "$arg" \
6675
	  test -f "$arg" \
4210
	    || func_fatal_error "symbol file \`$arg' does not exist"
6676
	    || func_fatal_error "symbol file '$arg' does not exist"
4211
	  prev=
6677
	  prev=
4212
	  continue
6678
	  continue
4213
	  ;;
6679
	  ;;
4214
	expsyms_regex)
6680
	expsyms_regex)
4215
	  export_symbols_regex="$arg"
6681
	  export_symbols_regex=$arg
4216
	  prev=
6682
	  prev=
4217
	  continue
6683
	  continue
4218
	  ;;
6684
	  ;;
4219
	framework)
6685
	framework)
4220
	  case $host in
6686
	  case $host in
4221
	    *-*-darwin*)
6687
	    *-*-darwin*)
4222
	      case "$deplibs " in
6688
	      case "$deplibs " in
4223
		*" $qarg.ltframework "*) ;;
6689
		*" $qarg.ltframework "*) ;;
4224
		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
6690
		*) func_append deplibs " $qarg.ltframework" # this is fixed later
4225
		   ;;
6691
		   ;;
4226
	      esac
6692
	      esac
4227
	      ;;
6693
	      ;;
4228
	  esac
6694
	  esac
4229
	  prev=
6695
	  prev=
4230
	  continue
6696
	  continue
4231
	  ;;
6697
	  ;;
4232
	inst_prefix)
6698
	inst_prefix)
4233
	  inst_prefix_dir="$arg"
6699
	  inst_prefix_dir=$arg
-
 
6700
	  prev=
-
 
6701
	  continue
-
 
6702
	  ;;
-
 
6703
	mllvm)
-
 
6704
	  # Clang does not use LLVM to link, so we can simply discard any
-
 
6705
	  # '-mllvm $arg' options when doing the link step.
4234
	  prev=
6706
	  prev=
4235
	  continue
6707
	  continue
4236
	  ;;
6708
	  ;;
4237
	objectlist)
6709
	objectlist)
4238
	  if test -f "$arg"; then
6710
	  if test -f "$arg"; then
4239
	    save_arg=$arg
6711
	    save_arg=$arg
4240
	    moreargs=
6712
	    moreargs=
4241
	    for fil in `cat "$save_arg"`
6713
	    for fil in `cat "$save_arg"`
4242
	    do
6714
	    do
4243
#	      moreargs="$moreargs $fil"
6715
#	      func_append moreargs " $fil"
4244
	      arg=$fil
6716
	      arg=$fil
4245
	      # A libtool-controlled object.
6717
	      # A libtool-controlled object.
4246
 
6718
 
4247
	      # Check to see that this really is a libtool object.
6719
	      # Check to see that this really is a libtool object.
4248
	      if func_lalib_unsafe_p "$arg"; then
6720
	      if func_lalib_unsafe_p "$arg"; then
Line 4252... Line 6724...
4252
		# Read the .lo file
6724
		# Read the .lo file
4253
		func_source "$arg"
6725
		func_source "$arg"
4254
 
6726
 
4255
		if test -z "$pic_object" ||
6727
		if test -z "$pic_object" ||
4256
		   test -z "$non_pic_object" ||
6728
		   test -z "$non_pic_object" ||
4257
		   test "$pic_object" = none &&
6729
		   test none = "$pic_object" &&
4258
		   test "$non_pic_object" = none; then
6730
		   test none = "$non_pic_object"; then
4259
		  func_fatal_error "cannot find name of object for \`$arg'"
6731
		  func_fatal_error "cannot find name of object for '$arg'"
4260
		fi
6732
		fi
4261
 
6733
 
4262
		# Extract subdirectory from the argument.
6734
		# Extract subdirectory from the argument.
4263
		func_dirname "$arg" "/" ""
6735
		func_dirname "$arg" "/" ""
4264
		xdir="$func_dirname_result"
6736
		xdir=$func_dirname_result
4265
 
6737
 
4266
		if test "$pic_object" != none; then
6738
		if test none != "$pic_object"; then
4267
		  # Prepend the subdirectory the object is found in.
6739
		  # Prepend the subdirectory the object is found in.
4268
		  pic_object="$xdir$pic_object"
6740
		  pic_object=$xdir$pic_object
4269
 
6741
 
4270
		  if test "$prev" = dlfiles; then
6742
		  if test dlfiles = "$prev"; then
4271
		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
6743
		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
4272
		      dlfiles="$dlfiles $pic_object"
6744
		      func_append dlfiles " $pic_object"
4273
		      prev=
6745
		      prev=
4274
		      continue
6746
		      continue
4275
		    else
6747
		    else
4276
		      # If libtool objects are unsupported, then we need to preload.
6748
		      # If libtool objects are unsupported, then we need to preload.
4277
		      prev=dlprefiles
6749
		      prev=dlprefiles
4278
		    fi
6750
		    fi
4279
		  fi
6751
		  fi
4280
 
6752
 
4281
		  # CHECK ME:  I think I busted this.  -Ossama
6753
		  # CHECK ME:  I think I busted this.  -Ossama
4282
		  if test "$prev" = dlprefiles; then
6754
		  if test dlprefiles = "$prev"; then
4283
		    # Preload the old-style object.
6755
		    # Preload the old-style object.
4284
		    dlprefiles="$dlprefiles $pic_object"
6756
		    func_append dlprefiles " $pic_object"
4285
		    prev=
6757
		    prev=
4286
		  fi
6758
		  fi
4287
 
6759
 
4288
		  # A PIC object.
6760
		  # A PIC object.
4289
		  func_append libobjs " $pic_object"
6761
		  func_append libobjs " $pic_object"
4290
		  arg="$pic_object"
6762
		  arg=$pic_object
4291
		fi
6763
		fi
4292
 
6764
 
4293
		# Non-PIC object.
6765
		# Non-PIC object.
4294
		if test "$non_pic_object" != none; then
6766
		if test none != "$non_pic_object"; then
4295
		  # Prepend the subdirectory the object is found in.
6767
		  # Prepend the subdirectory the object is found in.
4296
		  non_pic_object="$xdir$non_pic_object"
6768
		  non_pic_object=$xdir$non_pic_object
4297
 
6769
 
4298
		  # A standard non-PIC object
6770
		  # A standard non-PIC object
4299
		  func_append non_pic_objects " $non_pic_object"
6771
		  func_append non_pic_objects " $non_pic_object"
4300
		  if test -z "$pic_object" || test "$pic_object" = none ; then
6772
		  if test -z "$pic_object" || test none = "$pic_object"; then
4301
		    arg="$non_pic_object"
6773
		    arg=$non_pic_object
4302
		  fi
6774
		  fi
4303
		else
6775
		else
4304
		  # If the PIC object exists, use it instead.
6776
		  # If the PIC object exists, use it instead.
4305
		  # $xdir was prepended to $pic_object above.
6777
		  # $xdir was prepended to $pic_object above.
4306
		  non_pic_object="$pic_object"
6778
		  non_pic_object=$pic_object
4307
		  func_append non_pic_objects " $non_pic_object"
6779
		  func_append non_pic_objects " $non_pic_object"
4308
		fi
6780
		fi
4309
	      else
6781
	      else
4310
		# Only an error if not doing a dry-run.
6782
		# Only an error if not doing a dry-run.
4311
		if $opt_dry_run; then
6783
		if $opt_dry_run; then
4312
		  # Extract subdirectory from the argument.
6784
		  # Extract subdirectory from the argument.
4313
		  func_dirname "$arg" "/" ""
6785
		  func_dirname "$arg" "/" ""
4314
		  xdir="$func_dirname_result"
6786
		  xdir=$func_dirname_result
4315
 
6787
 
4316
		  func_lo2o "$arg"
6788
		  func_lo2o "$arg"
4317
		  pic_object=$xdir$objdir/$func_lo2o_result
6789
		  pic_object=$xdir$objdir/$func_lo2o_result
4318
		  non_pic_object=$xdir$func_lo2o_result
6790
		  non_pic_object=$xdir$func_lo2o_result
4319
		  func_append libobjs " $pic_object"
6791
		  func_append libobjs " $pic_object"
4320
		  func_append non_pic_objects " $non_pic_object"
6792
		  func_append non_pic_objects " $non_pic_object"
4321
	        else
6793
	        else
4322
		  func_fatal_error "\`$arg' is not a valid libtool object"
6794
		  func_fatal_error "'$arg' is not a valid libtool object"
4323
		fi
6795
		fi
4324
	      fi
6796
	      fi
4325
	    done
6797
	    done
4326
	  else
6798
	  else
4327
	    func_fatal_error "link input file \`$arg' does not exist"
6799
	    func_fatal_error "link input file '$arg' does not exist"
4328
	  fi
6800
	  fi
4329
	  arg=$save_arg
6801
	  arg=$save_arg
4330
	  prev=
6802
	  prev=
4331
	  continue
6803
	  continue
4332
	  ;;
6804
	  ;;
-
 
6805
	os2dllname)
-
 
6806
	  os2dllname=$arg
-
 
6807
	  prev=
-
 
6808
	  continue
-
 
6809
	  ;;
4333
	precious_regex)
6810
	precious_regex)
4334
	  precious_files_regex="$arg"
6811
	  precious_files_regex=$arg
4335
	  prev=
6812
	  prev=
4336
	  continue
6813
	  continue
4337
	  ;;
6814
	  ;;
4338
	release)
6815
	release)
4339
	  release="-$arg"
6816
	  release=-$arg
4340
	  prev=
6817
	  prev=
4341
	  continue
6818
	  continue
4342
	  ;;
6819
	  ;;
4343
	rpath | xrpath)
6820
	rpath | xrpath)
4344
	  # We need an absolute path.
6821
	  # We need an absolute path.
Line 4346... Line 6823...
4346
	  [\\/]* | [A-Za-z]:[\\/]*) ;;
6823
	  [\\/]* | [A-Za-z]:[\\/]*) ;;
4347
	  *)
6824
	  *)
4348
	    func_fatal_error "only absolute run-paths are allowed"
6825
	    func_fatal_error "only absolute run-paths are allowed"
4349
	    ;;
6826
	    ;;
4350
	  esac
6827
	  esac
4351
	  if test "$prev" = rpath; then
6828
	  if test rpath = "$prev"; then
4352
	    case "$rpath " in
6829
	    case "$rpath " in
4353
	    *" $arg "*) ;;
6830
	    *" $arg "*) ;;
4354
	    *) rpath="$rpath $arg" ;;
6831
	    *) func_append rpath " $arg" ;;
4355
	    esac
6832
	    esac
4356
	  else
6833
	  else
4357
	    case "$xrpath " in
6834
	    case "$xrpath " in
4358
	    *" $arg "*) ;;
6835
	    *" $arg "*) ;;
4359
	    *) xrpath="$xrpath $arg" ;;
6836
	    *) func_append xrpath " $arg" ;;
4360
	    esac
6837
	    esac
4361
	  fi
6838
	  fi
4362
	  prev=
6839
	  prev=
4363
	  continue
6840
	  continue
4364
	  ;;
6841
	  ;;
4365
	shrext)
6842
	shrext)
4366
	  shrext_cmds="$arg"
6843
	  shrext_cmds=$arg
4367
	  prev=
6844
	  prev=
4368
	  continue
6845
	  continue
4369
	  ;;
6846
	  ;;
4370
	weak)
6847
	weak)
4371
	  weak_libs="$weak_libs $arg"
6848
	  func_append weak_libs " $arg"
4372
	  prev=
6849
	  prev=
4373
	  continue
6850
	  continue
4374
	  ;;
6851
	  ;;
4375
	xcclinker)
6852
	xcclinker)
4376
	  linker_flags="$linker_flags $qarg"
6853
	  func_append linker_flags " $qarg"
4377
	  compiler_flags="$compiler_flags $qarg"
6854
	  func_append compiler_flags " $qarg"
4378
	  prev=
6855
	  prev=
4379
	  func_append compile_command " $qarg"
6856
	  func_append compile_command " $qarg"
4380
	  func_append finalize_command " $qarg"
6857
	  func_append finalize_command " $qarg"
4381
	  continue
6858
	  continue
4382
	  ;;
6859
	  ;;
4383
	xcompiler)
6860
	xcompiler)
4384
	  compiler_flags="$compiler_flags $qarg"
6861
	  func_append compiler_flags " $qarg"
4385
	  prev=
6862
	  prev=
4386
	  func_append compile_command " $qarg"
6863
	  func_append compile_command " $qarg"
4387
	  func_append finalize_command " $qarg"
6864
	  func_append finalize_command " $qarg"
4388
	  continue
6865
	  continue
4389
	  ;;
6866
	  ;;
4390
	xlinker)
6867
	xlinker)
4391
	  linker_flags="$linker_flags $qarg"
6868
	  func_append linker_flags " $qarg"
4392
	  compiler_flags="$compiler_flags $wl$qarg"
6869
	  func_append compiler_flags " $wl$qarg"
4393
	  prev=
6870
	  prev=
4394
	  func_append compile_command " $wl$qarg"
6871
	  func_append compile_command " $wl$qarg"
4395
	  func_append finalize_command " $wl$qarg"
6872
	  func_append finalize_command " $wl$qarg"
4396
	  continue
6873
	  continue
4397
	  ;;
6874
	  ;;
Line 4401... Line 6878...
4401
	  continue
6878
	  continue
4402
	  ;;
6879
	  ;;
4403
	esac
6880
	esac
4404
      fi # test -n "$prev"
6881
      fi # test -n "$prev"
4405
 
6882
 
4406
      prevarg="$arg"
6883
      prevarg=$arg
4407
 
6884
 
4408
      case $arg in
6885
      case $arg in
4409
      -all-static)
6886
      -all-static)
4410
	if test -n "$link_static_flag"; then
6887
	if test -n "$link_static_flag"; then
4411
	  # See comment for -static flag below, for more details.
6888
	  # See comment for -static flag below, for more details.
Line 4415... Line 6892...
4415
	continue
6892
	continue
4416
	;;
6893
	;;
4417
 
6894
 
4418
      -allow-undefined)
6895
      -allow-undefined)
4419
	# FIXME: remove this flag sometime in the future.
6896
	# FIXME: remove this flag sometime in the future.
4420
	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
6897
	func_fatal_error "'-allow-undefined' must not be used because it is the default"
4421
	;;
6898
	;;
4422
 
6899
 
4423
      -avoid-version)
6900
      -avoid-version)
4424
	avoid_version=yes
6901
	avoid_version=yes
4425
	continue
6902
	continue
4426
	;;
6903
	;;
4427
 
6904
 
-
 
6905
      -bindir)
-
 
6906
	prev=bindir
-
 
6907
	continue
-
 
6908
	;;
-
 
6909
 
4428
      -dlopen)
6910
      -dlopen)
4429
	prev=dlfiles
6911
	prev=dlfiles
4430
	continue
6912
	continue
4431
	;;
6913
	;;
4432
 
6914
 
Line 4442... Line 6924...
4442
 
6924
 
4443
      -export-symbols | -export-symbols-regex)
6925
      -export-symbols | -export-symbols-regex)
4444
	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
6926
	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
4445
	  func_fatal_error "more than one -exported-symbols argument is not allowed"
6927
	  func_fatal_error "more than one -exported-symbols argument is not allowed"
4446
	fi
6928
	fi
4447
	if test "X$arg" = "X-export-symbols"; then
6929
	if test X-export-symbols = "X$arg"; then
4448
	  prev=expsyms
6930
	  prev=expsyms
4449
	else
6931
	else
4450
	  prev=expsyms_regex
6932
	  prev=expsyms_regex
4451
	fi
6933
	fi
4452
	continue
6934
	continue
Line 4473... Line 6955...
4473
	esac
6955
	esac
4474
	continue
6956
	continue
4475
	;;
6957
	;;
4476
 
6958
 
4477
      -L*)
6959
      -L*)
4478
	func_stripname '-L' '' "$arg"
6960
	func_stripname "-L" '' "$arg"
4479
	dir=$func_stripname_result
6961
	if test -z "$func_stripname_result"; then
4480
	if test -z "$dir"; then
-
 
4481
	  if test "$#" -gt 0; then
6962
	  if test "$#" -gt 0; then
4482
	    func_fatal_error "require no space between \`-L' and \`$1'"
6963
	    func_fatal_error "require no space between '-L' and '$1'"
4483
	  else
6964
	  else
4484
	    func_fatal_error "need path for \`-L' option"
6965
	    func_fatal_error "need path for '-L' option"
4485
	  fi
6966
	  fi
4486
	fi
6967
	fi
-
 
6968
	func_resolve_sysroot "$func_stripname_result"
-
 
6969
	dir=$func_resolve_sysroot_result
4487
	# We need an absolute path.
6970
	# We need an absolute path.
4488
	case $dir in
6971
	case $dir in
4489
	[\\/]* | [A-Za-z]:[\\/]*) ;;
6972
	[\\/]* | [A-Za-z]:[\\/]*) ;;
4490
	*)
6973
	*)
4491
	  absdir=`cd "$dir" && pwd`
6974
	  absdir=`cd "$dir" && pwd`
4492
	  test -z "$absdir" && \
6975
	  test -z "$absdir" && \
4493
	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
6976
	    func_fatal_error "cannot determine absolute directory name of '$dir'"
4494
	  dir="$absdir"
6977
	  dir=$absdir
4495
	  ;;
6978
	  ;;
4496
	esac
6979
	esac
4497
	case "$deplibs " in
6980
	case "$deplibs " in
4498
	*" -L$dir "*) ;;
6981
	*" -L$dir "* | *" $arg "*)
-
 
6982
	  # Will only happen for absolute or sysroot arguments
-
 
6983
	  ;;
4499
	*)
6984
	*)
-
 
6985
	  # Preserve sysroot, but never include relative directories
-
 
6986
	  case $dir in
-
 
6987
	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
4500
	  deplibs="$deplibs -L$dir"
6988
	    *) func_append deplibs " -L$dir" ;;
-
 
6989
	  esac
4501
	  lib_search_path="$lib_search_path $dir"
6990
	  func_append lib_search_path " $dir"
4502
	  ;;
6991
	  ;;
4503
	esac
6992
	esac
4504
	case $host in
6993
	case $host in
4505
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6994
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4506
	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
6995
	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
4507
	  case :$dllsearchpath: in
6996
	  case :$dllsearchpath: in
4508
	  *":$dir:"*) ;;
6997
	  *":$dir:"*) ;;
4509
	  ::) dllsearchpath=$dir;;
6998
	  ::) dllsearchpath=$dir;;
4510
	  *) dllsearchpath="$dllsearchpath:$dir";;
6999
	  *) func_append dllsearchpath ":$dir";;
4511
	  esac
7000
	  esac
4512
	  case :$dllsearchpath: in
7001
	  case :$dllsearchpath: in
4513
	  *":$testbindir:"*) ;;
7002
	  *":$testbindir:"*) ;;
4514
	  ::) dllsearchpath=$testbindir;;
7003
	  ::) dllsearchpath=$testbindir;;
4515
	  *) dllsearchpath="$dllsearchpath:$testbindir";;
7004
	  *) func_append dllsearchpath ":$testbindir";;
4516
	  esac
7005
	  esac
4517
	  ;;
7006
	  ;;
4518
	esac
7007
	esac
4519
	continue
7008
	continue
4520
	;;
7009
	;;
4521
 
7010
 
4522
      -l*)
7011
      -l*)
4523
	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
7012
	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
4524
	  case $host in
7013
	  case $host in
4525
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
7014
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
4526
	    # These systems don't actually have a C or math library (as such)
7015
	    # These systems don't actually have a C or math library (as such)
4527
	    continue
7016
	    continue
4528
	    ;;
7017
	    ;;
4529
	  *-*-os2*)
7018
	  *-*-os2*)
4530
	    # These systems don't actually have a C library (as such)
7019
	    # These systems don't actually have a C library (as such)
4531
	    test "X$arg" = "X-lc" && continue
7020
	    test X-lc = "X$arg" && continue
4532
	    ;;
7021
	    ;;
4533
	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7022
	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
4534
	    # Do not include libc due to us having libc/libc_r.
7023
	    # Do not include libc due to us having libc/libc_r.
4535
	    test "X$arg" = "X-lc" && continue
7024
	    test X-lc = "X$arg" && continue
4536
	    ;;
7025
	    ;;
4537
	  *-*-rhapsody* | *-*-darwin1.[012])
7026
	  *-*-rhapsody* | *-*-darwin1.[012])
4538
	    # Rhapsody C and math libraries are in the System framework
7027
	    # Rhapsody C and math libraries are in the System framework
4539
	    deplibs="$deplibs System.ltframework"
7028
	    func_append deplibs " System.ltframework"
4540
	    continue
7029
	    continue
4541
	    ;;
7030
	    ;;
4542
	  *-*-sco3.2v5* | *-*-sco5v6*)
7031
	  *-*-sco3.2v5* | *-*-sco5v6*)
4543
	    # Causes problems with __ctype
7032
	    # Causes problems with __ctype
4544
	    test "X$arg" = "X-lc" && continue
7033
	    test X-lc = "X$arg" && continue
4545
	    ;;
7034
	    ;;
4546
	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
7035
	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
4547
	    # Compiler inserts libc in the correct place for threads to work
7036
	    # Compiler inserts libc in the correct place for threads to work
4548
	    test "X$arg" = "X-lc" && continue
7037
	    test X-lc = "X$arg" && continue
4549
	    ;;
7038
	    ;;
4550
	  esac
7039
	  esac
4551
	elif test "X$arg" = "X-lc_r"; then
7040
	elif test X-lc_r = "X$arg"; then
4552
	 case $host in
7041
	 case $host in
4553
	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7042
	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
4554
	   # Do not include libc_r directly, use -pthread flag.
7043
	   # Do not include libc_r directly, use -pthread flag.
4555
	   continue
7044
	   continue
4556
	   ;;
7045
	   ;;
4557
	 esac
7046
	 esac
4558
	fi
7047
	fi
4559
	deplibs="$deplibs $arg"
7048
	func_append deplibs " $arg"
-
 
7049
	continue
-
 
7050
	;;
-
 
7051
 
-
 
7052
      -mllvm)
-
 
7053
	prev=mllvm
4560
	continue
7054
	continue
4561
	;;
7055
	;;
4562
 
7056
 
4563
      -module)
7057
      -module)
4564
	module=yes
7058
	module=yes
Line 4566... Line 7060...
4566
	;;
7060
	;;
4567
 
7061
 
4568
      # Tru64 UNIX uses -model [arg] to determine the layout of C++
7062
      # Tru64 UNIX uses -model [arg] to determine the layout of C++
4569
      # classes, name mangling, and exception handling.
7063
      # classes, name mangling, and exception handling.
4570
      # Darwin uses the -arch flag to determine output architecture.
7064
      # Darwin uses the -arch flag to determine output architecture.
4571
      -model|-arch|-isysroot)
7065
      -model|-arch|-isysroot|--sysroot)
4572
	compiler_flags="$compiler_flags $arg"
7066
	func_append compiler_flags " $arg"
4573
	func_append compile_command " $arg"
7067
	func_append compile_command " $arg"
4574
	func_append finalize_command " $arg"
7068
	func_append finalize_command " $arg"
4575
	prev=xcompiler
7069
	prev=xcompiler
4576
	continue
7070
	continue
4577
	;;
7071
	;;
4578
 
7072
 
4579
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
7073
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
-
 
7074
      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
4580
	compiler_flags="$compiler_flags $arg"
7075
	func_append compiler_flags " $arg"
4581
	func_append compile_command " $arg"
7076
	func_append compile_command " $arg"
4582
	func_append finalize_command " $arg"
7077
	func_append finalize_command " $arg"
4583
	case "$new_inherited_linker_flags " in
7078
	case "$new_inherited_linker_flags " in
4584
	    *" $arg "*) ;;
7079
	    *" $arg "*) ;;
4585
	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
7080
	    * ) func_append new_inherited_linker_flags " $arg" ;;
4586
	esac
7081
	esac
4587
	continue
7082
	continue
4588
	;;
7083
	;;
4589
 
7084
 
4590
      -multi_module)
7085
      -multi_module)
4591
	single_module="${wl}-multi_module"
7086
	single_module=$wl-multi_module
4592
	continue
7087
	continue
4593
	;;
7088
	;;
4594
 
7089
 
4595
      -no-fast-install)
7090
      -no-fast-install)
4596
	fast_install=no
7091
	fast_install=no
Line 4600... Line 7095...
4600
      -no-install)
7095
      -no-install)
4601
	case $host in
7096
	case $host in
4602
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
7097
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
4603
	  # The PATH hackery in wrapper scripts is required on Windows
7098
	  # The PATH hackery in wrapper scripts is required on Windows
4604
	  # and Darwin in order for the loader to find any dlls it needs.
7099
	  # and Darwin in order for the loader to find any dlls it needs.
4605
	  func_warning "\`-no-install' is ignored for $host"
7100
	  func_warning "'-no-install' is ignored for $host"
4606
	  func_warning "assuming \`-no-fast-install' instead"
7101
	  func_warning "assuming '-no-fast-install' instead"
4607
	  fast_install=no
7102
	  fast_install=no
4608
	  ;;
7103
	  ;;
4609
	*) no_install=yes ;;
7104
	*) no_install=yes ;;
4610
	esac
7105
	esac
4611
	continue
7106
	continue
Line 4619... Line 7114...
4619
      -objectlist)
7114
      -objectlist)
4620
	prev=objectlist
7115
	prev=objectlist
4621
	continue
7116
	continue
4622
	;;
7117
	;;
4623
 
7118
 
-
 
7119
      -os2dllname)
-
 
7120
	prev=os2dllname
-
 
7121
	continue
-
 
7122
	;;
-
 
7123
 
4624
      -o) prev=output ;;
7124
      -o) prev=output ;;
4625
 
7125
 
4626
      -precious-files-regex)
7126
      -precious-files-regex)
4627
	prev=precious_regex
7127
	prev=precious_regex
4628
	continue
7128
	continue
Line 4647... Line 7147...
4647
	func_stripname '-R' '' "$arg"
7147
	func_stripname '-R' '' "$arg"
4648
	dir=$func_stripname_result
7148
	dir=$func_stripname_result
4649
	# We need an absolute path.
7149
	# We need an absolute path.
4650
	case $dir in
7150
	case $dir in
4651
	[\\/]* | [A-Za-z]:[\\/]*) ;;
7151
	[\\/]* | [A-Za-z]:[\\/]*) ;;
-
 
7152
	=*)
-
 
7153
	  func_stripname '=' '' "$dir"
-
 
7154
	  dir=$lt_sysroot$func_stripname_result
-
 
7155
	  ;;
4652
	*)
7156
	*)
4653
	  func_fatal_error "only absolute run-paths are allowed"
7157
	  func_fatal_error "only absolute run-paths are allowed"
4654
	  ;;
7158
	  ;;
4655
	esac
7159
	esac
4656
	case "$xrpath " in
7160
	case "$xrpath " in
4657
	*" $dir "*) ;;
7161
	*" $dir "*) ;;
4658
	*) xrpath="$xrpath $dir" ;;
7162
	*) func_append xrpath " $dir" ;;
4659
	esac
7163
	esac
4660
	continue
7164
	continue
4661
	;;
7165
	;;
4662
 
7166
 
4663
      -shared)
7167
      -shared)
Line 4702... Line 7206...
4702
 
7206
 
4703
      -Wc,*)
7207
      -Wc,*)
4704
	func_stripname '-Wc,' '' "$arg"
7208
	func_stripname '-Wc,' '' "$arg"
4705
	args=$func_stripname_result
7209
	args=$func_stripname_result
4706
	arg=
7210
	arg=
4707
	save_ifs="$IFS"; IFS=','
7211
	save_ifs=$IFS; IFS=,
4708
	for flag in $args; do
7212
	for flag in $args; do
4709
	  IFS="$save_ifs"
7213
	  IFS=$save_ifs
4710
          func_quote_for_eval "$flag"
7214
          func_quote_for_eval "$flag"
4711
	  arg="$arg $wl$func_quote_for_eval_result"
7215
	  func_append arg " $func_quote_for_eval_result"
4712
	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
7216
	  func_append compiler_flags " $func_quote_for_eval_result"
4713
	done
7217
	done
4714
	IFS="$save_ifs"
7218
	IFS=$save_ifs
4715
	func_stripname ' ' '' "$arg"
7219
	func_stripname ' ' '' "$arg"
4716
	arg=$func_stripname_result
7220
	arg=$func_stripname_result
4717
	;;
7221
	;;
4718
 
7222
 
4719
      -Wl,*)
7223
      -Wl,*)
4720
	func_stripname '-Wl,' '' "$arg"
7224
	func_stripname '-Wl,' '' "$arg"
4721
	args=$func_stripname_result
7225
	args=$func_stripname_result
4722
	arg=
7226
	arg=
4723
	save_ifs="$IFS"; IFS=','
7227
	save_ifs=$IFS; IFS=,
4724
	for flag in $args; do
7228
	for flag in $args; do
4725
	  IFS="$save_ifs"
7229
	  IFS=$save_ifs
4726
          func_quote_for_eval "$flag"
7230
          func_quote_for_eval "$flag"
4727
	  arg="$arg $wl$func_quote_for_eval_result"
7231
	  func_append arg " $wl$func_quote_for_eval_result"
4728
	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
7232
	  func_append compiler_flags " $wl$func_quote_for_eval_result"
4729
	  linker_flags="$linker_flags $func_quote_for_eval_result"
7233
	  func_append linker_flags " $func_quote_for_eval_result"
4730
	done
7234
	done
4731
	IFS="$save_ifs"
7235
	IFS=$save_ifs
4732
	func_stripname ' ' '' "$arg"
7236
	func_stripname ' ' '' "$arg"
4733
	arg=$func_stripname_result
7237
	arg=$func_stripname_result
4734
	;;
7238
	;;
4735
 
7239
 
4736
      -Xcompiler)
7240
      -Xcompiler)
Line 4749... Line 7253...
4749
	;;
7253
	;;
4750
 
7254
 
4751
      # -msg_* for osf cc
7255
      # -msg_* for osf cc
4752
      -msg_*)
7256
      -msg_*)
4753
	func_quote_for_eval "$arg"
7257
	func_quote_for_eval "$arg"
4754
	arg="$func_quote_for_eval_result"
7258
	arg=$func_quote_for_eval_result
4755
	;;
7259
	;;
4756
 
7260
 
-
 
7261
      # Flags to be passed through unchanged, with rationale:
4757
      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
7262
      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
4758
      # -r[0-9][0-9]* specifies the processor on the SGI compiler
7263
      # -r[0-9][0-9]*        specify processor for the SGI compiler
4759
      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
7264
      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
4760
      # +DA*, +DD* enable 64-bit mode on the HP compiler
7265
      # +DA*, +DD*           enable 64-bit mode for the HP compiler
4761
      # -q* pass through compiler args for the IBM compiler
7266
      # -q*                  compiler args for the IBM compiler
4762
      # -m*, -t[45]*, -txscale* pass through architecture-specific
7267
      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
4763
      # compiler args for GCC
-
 
4764
      # -F/path gives path to uninstalled frameworks, gcc on darwin
7268
      # -F/path              path to uninstalled frameworks, gcc on darwin
4765
      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
7269
      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
-
 
7270
      # -fstack-protector*   stack protector flags for GCC
4766
      # @file GCC response files
7271
      # @file                GCC response files
-
 
7272
      # -tp=*                Portland pgcc target processor selection
-
 
7273
      # --sysroot=*          for sysroot support
-
 
7274
      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-
 
7275
      # -stdlib=*            select c++ std lib with clang
4767
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
7276
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4768
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
7277
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-
 
7278
      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
4769
        func_quote_for_eval "$arg"
7279
        func_quote_for_eval "$arg"
4770
	arg="$func_quote_for_eval_result"
7280
	arg=$func_quote_for_eval_result
4771
        func_append compile_command " $arg"
7281
        func_append compile_command " $arg"
4772
        func_append finalize_command " $arg"
7282
        func_append finalize_command " $arg"
4773
        compiler_flags="$compiler_flags $arg"
7283
        func_append compiler_flags " $arg"
4774
        continue
7284
        continue
4775
        ;;
7285
        ;;
4776
 
7286
 
-
 
7287
      -Z*)
-
 
7288
        if test os2 = "`expr $host : '.*\(os2\)'`"; then
-
 
7289
          # OS/2 uses -Zxxx to specify OS/2-specific options
-
 
7290
	  compiler_flags="$compiler_flags $arg"
-
 
7291
	  func_append compile_command " $arg"
-
 
7292
	  func_append finalize_command " $arg"
-
 
7293
	  case $arg in
-
 
7294
	  -Zlinker | -Zstack)
-
 
7295
	    prev=xcompiler
-
 
7296
	    ;;
-
 
7297
	  esac
-
 
7298
	  continue
-
 
7299
        else
-
 
7300
	  # Otherwise treat like 'Some other compiler flag' below
-
 
7301
	  func_quote_for_eval "$arg"
-
 
7302
	  arg=$func_quote_for_eval_result
-
 
7303
        fi
-
 
7304
	;;
-
 
7305
 
4777
      # Some other compiler flag.
7306
      # Some other compiler flag.
4778
      -* | +*)
7307
      -* | +*)
4779
        func_quote_for_eval "$arg"
7308
        func_quote_for_eval "$arg"
4780
	arg="$func_quote_for_eval_result"
7309
	arg=$func_quote_for_eval_result
4781
	;;
7310
	;;
4782
 
7311
 
4783
      *.$objext)
7312
      *.$objext)
4784
	# A standard object.
7313
	# A standard object.
4785
	objs="$objs $arg"
7314
	func_append objs " $arg"
4786
	;;
7315
	;;
4787
 
7316
 
4788
      *.lo)
7317
      *.lo)
4789
	# A libtool-controlled object.
7318
	# A libtool-controlled object.
4790
 
7319
 
Line 4796... Line 7325...
4796
	  # Read the .lo file
7325
	  # Read the .lo file
4797
	  func_source "$arg"
7326
	  func_source "$arg"
4798
 
7327
 
4799
	  if test -z "$pic_object" ||
7328
	  if test -z "$pic_object" ||
4800
	     test -z "$non_pic_object" ||
7329
	     test -z "$non_pic_object" ||
4801
	     test "$pic_object" = none &&
7330
	     test none = "$pic_object" &&
4802
	     test "$non_pic_object" = none; then
7331
	     test none = "$non_pic_object"; then
4803
	    func_fatal_error "cannot find name of object for \`$arg'"
7332
	    func_fatal_error "cannot find name of object for '$arg'"
4804
	  fi
7333
	  fi
4805
 
7334
 
4806
	  # Extract subdirectory from the argument.
7335
	  # Extract subdirectory from the argument.
4807
	  func_dirname "$arg" "/" ""
7336
	  func_dirname "$arg" "/" ""
4808
	  xdir="$func_dirname_result"
7337
	  xdir=$func_dirname_result
4809
 
7338
 
4810
	  if test "$pic_object" != none; then
7339
	  test none = "$pic_object" || {
4811
	    # Prepend the subdirectory the object is found in.
7340
	    # Prepend the subdirectory the object is found in.
4812
	    pic_object="$xdir$pic_object"
7341
	    pic_object=$xdir$pic_object
4813
 
7342
 
4814
	    if test "$prev" = dlfiles; then
7343
	    if test dlfiles = "$prev"; then
4815
	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
7344
	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
4816
		dlfiles="$dlfiles $pic_object"
7345
		func_append dlfiles " $pic_object"
4817
		prev=
7346
		prev=
4818
		continue
7347
		continue
4819
	      else
7348
	      else
4820
		# If libtool objects are unsupported, then we need to preload.
7349
		# If libtool objects are unsupported, then we need to preload.
4821
		prev=dlprefiles
7350
		prev=dlprefiles
4822
	      fi
7351
	      fi
4823
	    fi
7352
	    fi
4824
 
7353
 
4825
	    # CHECK ME:  I think I busted this.  -Ossama
7354
	    # CHECK ME:  I think I busted this.  -Ossama
4826
	    if test "$prev" = dlprefiles; then
7355
	    if test dlprefiles = "$prev"; then
4827
	      # Preload the old-style object.
7356
	      # Preload the old-style object.
4828
	      dlprefiles="$dlprefiles $pic_object"
7357
	      func_append dlprefiles " $pic_object"
4829
	      prev=
7358
	      prev=
4830
	    fi
7359
	    fi
4831
 
7360
 
4832
	    # A PIC object.
7361
	    # A PIC object.
4833
	    func_append libobjs " $pic_object"
7362
	    func_append libobjs " $pic_object"
4834
	    arg="$pic_object"
7363
	    arg=$pic_object
4835
	  fi
7364
	  }
4836
 
7365
 
4837
	  # Non-PIC object.
7366
	  # Non-PIC object.
4838
	  if test "$non_pic_object" != none; then
7367
	  if test none != "$non_pic_object"; then
4839
	    # Prepend the subdirectory the object is found in.
7368
	    # Prepend the subdirectory the object is found in.
4840
	    non_pic_object="$xdir$non_pic_object"
7369
	    non_pic_object=$xdir$non_pic_object
4841
 
7370
 
4842
	    # A standard non-PIC object
7371
	    # A standard non-PIC object
4843
	    func_append non_pic_objects " $non_pic_object"
7372
	    func_append non_pic_objects " $non_pic_object"
4844
	    if test -z "$pic_object" || test "$pic_object" = none ; then
7373
	    if test -z "$pic_object" || test none = "$pic_object"; then
4845
	      arg="$non_pic_object"
7374
	      arg=$non_pic_object
4846
	    fi
7375
	    fi
4847
	  else
7376
	  else
4848
	    # If the PIC object exists, use it instead.
7377
	    # If the PIC object exists, use it instead.
4849
	    # $xdir was prepended to $pic_object above.
7378
	    # $xdir was prepended to $pic_object above.
4850
	    non_pic_object="$pic_object"
7379
	    non_pic_object=$pic_object
4851
	    func_append non_pic_objects " $non_pic_object"
7380
	    func_append non_pic_objects " $non_pic_object"
4852
	  fi
7381
	  fi
4853
	else
7382
	else
4854
	  # Only an error if not doing a dry-run.
7383
	  # Only an error if not doing a dry-run.
4855
	  if $opt_dry_run; then
7384
	  if $opt_dry_run; then
4856
	    # Extract subdirectory from the argument.
7385
	    # Extract subdirectory from the argument.
4857
	    func_dirname "$arg" "/" ""
7386
	    func_dirname "$arg" "/" ""
4858
	    xdir="$func_dirname_result"
7387
	    xdir=$func_dirname_result
4859
 
7388
 
4860
	    func_lo2o "$arg"
7389
	    func_lo2o "$arg"
4861
	    pic_object=$xdir$objdir/$func_lo2o_result
7390
	    pic_object=$xdir$objdir/$func_lo2o_result
4862
	    non_pic_object=$xdir$func_lo2o_result
7391
	    non_pic_object=$xdir$func_lo2o_result
4863
	    func_append libobjs " $pic_object"
7392
	    func_append libobjs " $pic_object"
4864
	    func_append non_pic_objects " $non_pic_object"
7393
	    func_append non_pic_objects " $non_pic_object"
4865
	  else
7394
	  else
4866
	    func_fatal_error "\`$arg' is not a valid libtool object"
7395
	    func_fatal_error "'$arg' is not a valid libtool object"
4867
	  fi
7396
	  fi
4868
	fi
7397
	fi
4869
	;;
7398
	;;
4870
 
7399
 
4871
      *.$libext)
7400
      *.$libext)
4872
	# An archive.
7401
	# An archive.
4873
	deplibs="$deplibs $arg"
7402
	func_append deplibs " $arg"
4874
	old_deplibs="$old_deplibs $arg"
7403
	func_append old_deplibs " $arg"
4875
	continue
7404
	continue
4876
	;;
7405
	;;
4877
 
7406
 
4878
      *.la)
7407
      *.la)
4879
	# A libtool-controlled library.
7408
	# A libtool-controlled library.
4880
 
7409
 
-
 
7410
	func_resolve_sysroot "$arg"
4881
	if test "$prev" = dlfiles; then
7411
	if test dlfiles = "$prev"; then
4882
	  # This library was specified with -dlopen.
7412
	  # This library was specified with -dlopen.
4883
	  dlfiles="$dlfiles $arg"
7413
	  func_append dlfiles " $func_resolve_sysroot_result"
4884
	  prev=
7414
	  prev=
4885
	elif test "$prev" = dlprefiles; then
7415
	elif test dlprefiles = "$prev"; then
4886
	  # The library was specified with -dlpreopen.
7416
	  # The library was specified with -dlpreopen.
4887
	  dlprefiles="$dlprefiles $arg"
7417
	  func_append dlprefiles " $func_resolve_sysroot_result"
4888
	  prev=
7418
	  prev=
4889
	else
7419
	else
4890
	  deplibs="$deplibs $arg"
7420
	  func_append deplibs " $func_resolve_sysroot_result"
4891
	fi
7421
	fi
4892
	continue
7422
	continue
4893
	;;
7423
	;;
4894
 
7424
 
4895
      # Some other compiler argument.
7425
      # Some other compiler argument.
4896
      *)
7426
      *)
4897
	# Unknown arguments in both finalize_command and compile_command need
7427
	# Unknown arguments in both finalize_command and compile_command need
4898
	# to be aesthetically quoted because they are evaled later.
7428
	# to be aesthetically quoted because they are evaled later.
4899
	func_quote_for_eval "$arg"
7429
	func_quote_for_eval "$arg"
4900
	arg="$func_quote_for_eval_result"
7430
	arg=$func_quote_for_eval_result
4901
	;;
7431
	;;
4902
      esac # arg
7432
      esac # arg
4903
 
7433
 
4904
      # Now actually substitute the argument into the commands.
7434
      # Now actually substitute the argument into the commands.
4905
      if test -n "$arg"; then
7435
      if test -n "$arg"; then
Line 4907... Line 7437...
4907
	func_append finalize_command " $arg"
7437
	func_append finalize_command " $arg"
4908
      fi
7438
      fi
4909
    done # argument parsing loop
7439
    done # argument parsing loop
4910
 
7440
 
4911
    test -n "$prev" && \
7441
    test -n "$prev" && \
4912
      func_fatal_help "the \`$prevarg' option requires an argument"
7442
      func_fatal_help "the '$prevarg' option requires an argument"
4913
 
7443
 
4914
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
7444
    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
4915
      eval arg=\"$export_dynamic_flag_spec\"
7445
      eval arg=\"$export_dynamic_flag_spec\"
4916
      func_append compile_command " $arg"
7446
      func_append compile_command " $arg"
4917
      func_append finalize_command " $arg"
7447
      func_append finalize_command " $arg"
4918
    fi
7448
    fi
4919
 
7449
 
4920
    oldlibs=
7450
    oldlibs=
4921
    # calculate the name of the file, without its directory
7451
    # calculate the name of the file, without its directory
4922
    func_basename "$output"
7452
    func_basename "$output"
4923
    outputname="$func_basename_result"
7453
    outputname=$func_basename_result
4924
    libobjs_save="$libobjs"
7454
    libobjs_save=$libobjs
4925
 
7455
 
4926
    if test -n "$shlibpath_var"; then
7456
    if test -n "$shlibpath_var"; then
4927
      # get the directories listed in $shlibpath_var
7457
      # get the directories listed in $shlibpath_var
4928
      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
7458
      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
4929
    else
7459
    else
4930
      shlib_search_path=
7460
      shlib_search_path=
4931
    fi
7461
    fi
4932
    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
7462
    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
4933
    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
7463
    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
4934
 
7464
 
-
 
7465
    # Definition is injected by LT_CONFIG during libtool generation.
-
 
7466
    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
-
 
7467
 
4935
    func_dirname "$output" "/" ""
7468
    func_dirname "$output" "/" ""
4936
    output_objdir="$func_dirname_result$objdir"
7469
    output_objdir=$func_dirname_result$objdir
-
 
7470
    func_to_tool_file "$output_objdir/"
-
 
7471
    tool_output_objdir=$func_to_tool_file_result
4937
    # Create the object directory.
7472
    # Create the object directory.
4938
    func_mkdir_p "$output_objdir"
7473
    func_mkdir_p "$output_objdir"
4939
 
7474
 
4940
    # Determine the type of output
7475
    # Determine the type of output
4941
    case $output in
7476
    case $output in
Line 4952... Line 7487...
4952
 
7487
 
4953
    libs=
7488
    libs=
4954
    # Find all interdependent deplibs by searching for libraries
7489
    # Find all interdependent deplibs by searching for libraries
4955
    # that are linked more than once (e.g. -la -lb -la)
7490
    # that are linked more than once (e.g. -la -lb -la)
4956
    for deplib in $deplibs; do
7491
    for deplib in $deplibs; do
4957
      if $opt_duplicate_deps ; then
7492
      if $opt_preserve_dup_deps; then
4958
	case "$libs " in
7493
	case "$libs " in
4959
	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
7494
	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
4960
	esac
7495
	esac
4961
      fi
7496
      fi
4962
      libs="$libs $deplib"
7497
      func_append libs " $deplib"
4963
    done
7498
    done
4964
 
7499
 
4965
    if test "$linkmode" = lib; then
7500
    if test lib = "$linkmode"; then
4966
      libs="$predeps $libs $compiler_lib_search_path $postdeps"
7501
      libs="$predeps $libs $compiler_lib_search_path $postdeps"
4967
 
7502
 
4968
      # Compute libraries that are listed more than once in $predeps
7503
      # Compute libraries that are listed more than once in $predeps
4969
      # $postdeps and mark them as special (i.e., whose duplicates are
7504
      # $postdeps and mark them as special (i.e., whose duplicates are
4970
      # not to be eliminated).
7505
      # not to be eliminated).
4971
      pre_post_deps=
7506
      pre_post_deps=
4972
      if $opt_duplicate_compiler_generated_deps; then
7507
      if $opt_duplicate_compiler_generated_deps; then
4973
	for pre_post_dep in $predeps $postdeps; do
7508
	for pre_post_dep in $predeps $postdeps; do
4974
	  case "$pre_post_deps " in
7509
	  case "$pre_post_deps " in
4975
	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
7510
	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
4976
	  esac
7511
	  esac
4977
	  pre_post_deps="$pre_post_deps $pre_post_dep"
7512
	  func_append pre_post_deps " $pre_post_dep"
4978
	done
7513
	done
4979
      fi
7514
      fi
4980
      pre_post_deps=
7515
      pre_post_deps=
4981
    fi
7516
    fi
4982
 
7517
 
Line 4992... Line 7527...
4992
	passes="conv dlpreopen link"
7527
	passes="conv dlpreopen link"
4993
	for file in $dlfiles $dlprefiles; do
7528
	for file in $dlfiles $dlprefiles; do
4994
	  case $file in
7529
	  case $file in
4995
	  *.la) ;;
7530
	  *.la) ;;
4996
	  *)
7531
	  *)
4997
	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
7532
	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
4998
	    ;;
7533
	    ;;
4999
	  esac
7534
	  esac
5000
	done
7535
	done
5001
	;;
7536
	;;
5002
    prog)
7537
    prog)
5003
	compile_deplibs=
7538
	compile_deplibs=
5004
	finalize_deplibs=
7539
	finalize_deplibs=
5005
	alldeplibs=no
7540
	alldeplibs=false
5006
	newdlfiles=
7541
	newdlfiles=
5007
	newdlprefiles=
7542
	newdlprefiles=
5008
	passes="conv scan dlopen dlpreopen link"
7543
	passes="conv scan dlopen dlpreopen link"
5009
	;;
7544
	;;
5010
    *)  passes="conv"
7545
    *)  passes="conv"
Line 5012... Line 7547...
5012
    esac
7547
    esac
5013
 
7548
 
5014
    for pass in $passes; do
7549
    for pass in $passes; do
5015
      # The preopen pass in lib mode reverses $deplibs; put it back here
7550
      # The preopen pass in lib mode reverses $deplibs; put it back here
5016
      # so that -L comes before libs that need it for instance...
7551
      # so that -L comes before libs that need it for instance...
5017
      if test "$linkmode,$pass" = "lib,link"; then
7552
      if test lib,link = "$linkmode,$pass"; then
5018
	## FIXME: Find the place where the list is rebuilt in the wrong
7553
	## FIXME: Find the place where the list is rebuilt in the wrong
5019
	##        order, and fix it there properly
7554
	##        order, and fix it there properly
5020
        tmp_deplibs=
7555
        tmp_deplibs=
5021
	for deplib in $deplibs; do
7556
	for deplib in $deplibs; do
5022
	  tmp_deplibs="$deplib $tmp_deplibs"
7557
	  tmp_deplibs="$deplib $tmp_deplibs"
5023
	done
7558
	done
5024
	deplibs="$tmp_deplibs"
7559
	deplibs=$tmp_deplibs
5025
      fi
7560
      fi
5026
 
7561
 
5027
      if test "$linkmode,$pass" = "lib,link" ||
7562
      if test lib,link = "$linkmode,$pass" ||
5028
	 test "$linkmode,$pass" = "prog,scan"; then
7563
	 test prog,scan = "$linkmode,$pass"; then
5029
	libs="$deplibs"
7564
	libs=$deplibs
5030
	deplibs=
7565
	deplibs=
5031
      fi
7566
      fi
5032
      if test "$linkmode" = prog; then
7567
      if test prog = "$linkmode"; then
5033
	case $pass in
7568
	case $pass in
5034
	dlopen) libs="$dlfiles" ;;
7569
	dlopen) libs=$dlfiles ;;
5035
	dlpreopen) libs="$dlprefiles" ;;
7570
	dlpreopen) libs=$dlprefiles ;;
5036
	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
7571
	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
5037
	esac
7572
	esac
5038
      fi
7573
      fi
5039
      if test "$linkmode,$pass" = "lib,dlpreopen"; then
7574
      if test lib,dlpreopen = "$linkmode,$pass"; then
5040
	# Collect and forward deplibs of preopened libtool libs
7575
	# Collect and forward deplibs of preopened libtool libs
5041
	for lib in $dlprefiles; do
7576
	for lib in $dlprefiles; do
5042
	  # Ignore non-libtool-libs
7577
	  # Ignore non-libtool-libs
5043
	  dependency_libs=
7578
	  dependency_libs=
-
 
7579
	  func_resolve_sysroot "$lib"
5044
	  case $lib in
7580
	  case $lib in
5045
	  *.la)	func_source "$lib" ;;
7581
	  *.la)	func_source "$func_resolve_sysroot_result" ;;
5046
	  esac
7582
	  esac
5047
 
7583
 
5048
	  # Collect preopened libtool deplibs, except any this library
7584
	  # Collect preopened libtool deplibs, except any this library
5049
	  # has declared as weak libs
7585
	  # has declared as weak libs
5050
	  for deplib in $dependency_libs; do
7586
	  for deplib in $dependency_libs; do
-
 
7587
	    func_basename "$deplib"
5051
            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
7588
            deplib_base=$func_basename_result
5052
	    case " $weak_libs " in
7589
	    case " $weak_libs " in
5053
	    *" $deplib_base "*) ;;
7590
	    *" $deplib_base "*) ;;
5054
	    *) deplibs="$deplibs $deplib" ;;
7591
	    *) func_append deplibs " $deplib" ;;
5055
	    esac
7592
	    esac
5056
	  done
7593
	  done
5057
	done
7594
	done
5058
	libs="$dlprefiles"
7595
	libs=$dlprefiles
5059
      fi
7596
      fi
5060
      if test "$pass" = dlopen; then
7597
      if test dlopen = "$pass"; then
5061
	# Collect dlpreopened libraries
7598
	# Collect dlpreopened libraries
5062
	save_deplibs="$deplibs"
7599
	save_deplibs=$deplibs
5063
	deplibs=
7600
	deplibs=
5064
      fi
7601
      fi
5065
 
7602
 
5066
      for deplib in $libs; do
7603
      for deplib in $libs; do
5067
	lib=
7604
	lib=
5068
	found=no
7605
	found=false
5069
	case $deplib in
7606
	case $deplib in
5070
	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
7607
	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
-
 
7608
        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
5071
	  if test "$linkmode,$pass" = "prog,link"; then
7609
	  if test prog,link = "$linkmode,$pass"; then
5072
	    compile_deplibs="$deplib $compile_deplibs"
7610
	    compile_deplibs="$deplib $compile_deplibs"
5073
	    finalize_deplibs="$deplib $finalize_deplibs"
7611
	    finalize_deplibs="$deplib $finalize_deplibs"
5074
	  else
7612
	  else
5075
	    compiler_flags="$compiler_flags $deplib"
7613
	    func_append compiler_flags " $deplib"
5076
	    if test "$linkmode" = lib ; then
7614
	    if test lib = "$linkmode"; then
5077
		case "$new_inherited_linker_flags " in
7615
		case "$new_inherited_linker_flags " in
5078
		    *" $deplib "*) ;;
7616
		    *" $deplib "*) ;;
5079
		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
7617
		    * ) func_append new_inherited_linker_flags " $deplib" ;;
5080
		esac
7618
		esac
5081
	    fi
7619
	    fi
5082
	  fi
7620
	  fi
5083
	  continue
7621
	  continue
5084
	  ;;
7622
	  ;;
5085
	-l*)
7623
	-l*)
5086
	  if test "$linkmode" != lib && test "$linkmode" != prog; then
7624
	  if test lib != "$linkmode" && test prog != "$linkmode"; then
5087
	    func_warning "\`-l' is ignored for archives/objects"
7625
	    func_warning "'-l' is ignored for archives/objects"
5088
	    continue
7626
	    continue
5089
	  fi
7627
	  fi
5090
	  func_stripname '-l' '' "$deplib"
7628
	  func_stripname '-l' '' "$deplib"
5091
	  name=$func_stripname_result
7629
	  name=$func_stripname_result
5092
	  if test "$linkmode" = lib; then
7630
	  if test lib = "$linkmode"; then
5093
	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
7631
	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
5094
	  else
7632
	  else
5095
	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
7633
	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
5096
	  fi
7634
	  fi
5097
	  for searchdir in $searchdirs; do
7635
	  for searchdir in $searchdirs; do
5098
	    for search_ext in .la $std_shrext .so .a; do
7636
	    for search_ext in .la $std_shrext .so .a; do
5099
	      # Search the libtool library
7637
	      # Search the libtool library
5100
	      lib="$searchdir/lib${name}${search_ext}"
7638
	      lib=$searchdir/lib$name$search_ext
5101
	      if test -f "$lib"; then
7639
	      if test -f "$lib"; then
5102
		if test "$search_ext" = ".la"; then
7640
		if test .la = "$search_ext"; then
5103
		  found=yes
7641
		  found=:
5104
		else
7642
		else
5105
		  found=no
7643
		  found=false
5106
		fi
7644
		fi
5107
		break 2
7645
		break 2
5108
	      fi
7646
	      fi
5109
	    done
7647
	    done
5110
	  done
7648
	  done
5111
	  if test "$found" != yes; then
7649
	  if $found; then
5112
	    # deplib doesn't seem to be a libtool library
-
 
5113
	    if test "$linkmode,$pass" = "prog,link"; then
-
 
5114
	      compile_deplibs="$deplib $compile_deplibs"
-
 
5115
	      finalize_deplibs="$deplib $finalize_deplibs"
-
 
5116
	    else
-
 
5117
	      deplibs="$deplib $deplibs"
-
 
5118
	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-
 
5119
	    fi
-
 
5120
	    continue
-
 
5121
	  else # deplib is a libtool library
7650
	    # deplib is a libtool library
5122
	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
7651
	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
5123
	    # We need to do some special things here, and not later.
7652
	    # We need to do some special things here, and not later.
5124
	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7653
	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
5125
	      case " $predeps $postdeps " in
7654
	      case " $predeps $postdeps " in
5126
	      *" $deplib "*)
7655
	      *" $deplib "*)
5127
		if func_lalib_p "$lib"; then
7656
		if func_lalib_p "$lib"; then
5128
		  library_names=
7657
		  library_names=
5129
		  old_library=
7658
		  old_library=
5130
		  func_source "$lib"
7659
		  func_source "$lib"
5131
		  for l in $old_library $library_names; do
7660
		  for l in $old_library $library_names; do
5132
		    ll="$l"
7661
		    ll=$l
5133
		  done
7662
		  done
5134
		  if test "X$ll" = "X$old_library" ; then # only static version available
7663
		  if test "X$ll" = "X$old_library"; then # only static version available
5135
		    found=no
7664
		    found=false
5136
		    func_dirname "$lib" "" "."
7665
		    func_dirname "$lib" "" "."
5137
		    ladir="$func_dirname_result"
7666
		    ladir=$func_dirname_result
5138
		    lib=$ladir/$old_library
7667
		    lib=$ladir/$old_library
5139
		    if test "$linkmode,$pass" = "prog,link"; then
7668
		    if test prog,link = "$linkmode,$pass"; then
5140
		      compile_deplibs="$deplib $compile_deplibs"
7669
		      compile_deplibs="$deplib $compile_deplibs"
5141
		      finalize_deplibs="$deplib $finalize_deplibs"
7670
		      finalize_deplibs="$deplib $finalize_deplibs"
5142
		    else
7671
		    else
5143
		      deplibs="$deplib $deplibs"
7672
		      deplibs="$deplib $deplibs"
5144
		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
7673
		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
5145
		    fi
7674
		    fi
5146
		    continue
7675
		    continue
5147
		  fi
7676
		  fi
5148
		fi
7677
		fi
5149
		;;
7678
		;;
5150
	      *) ;;
7679
	      *) ;;
5151
	      esac
7680
	      esac
5152
	    fi
7681
	    fi
-
 
7682
	  else
-
 
7683
	    # deplib doesn't seem to be a libtool library
-
 
7684
	    if test prog,link = "$linkmode,$pass"; then
-
 
7685
	      compile_deplibs="$deplib $compile_deplibs"
-
 
7686
	      finalize_deplibs="$deplib $finalize_deplibs"
-
 
7687
	    else
-
 
7688
	      deplibs="$deplib $deplibs"
-
 
7689
	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
-
 
7690
	    fi
-
 
7691
	    continue
5153
	  fi
7692
	  fi
5154
	  ;; # -l
7693
	  ;; # -l
5155
	*.ltframework)
7694
	*.ltframework)
5156
	  if test "$linkmode,$pass" = "prog,link"; then
7695
	  if test prog,link = "$linkmode,$pass"; then
5157
	    compile_deplibs="$deplib $compile_deplibs"
7696
	    compile_deplibs="$deplib $compile_deplibs"
5158
	    finalize_deplibs="$deplib $finalize_deplibs"
7697
	    finalize_deplibs="$deplib $finalize_deplibs"
5159
	  else
7698
	  else
5160
	    deplibs="$deplib $deplibs"
7699
	    deplibs="$deplib $deplibs"
5161
	    if test "$linkmode" = lib ; then
7700
	    if test lib = "$linkmode"; then
5162
		case "$new_inherited_linker_flags " in
7701
		case "$new_inherited_linker_flags " in
5163
		    *" $deplib "*) ;;
7702
		    *" $deplib "*) ;;
5164
		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
7703
		    * ) func_append new_inherited_linker_flags " $deplib" ;;
5165
		esac
7704
		esac
5166
	    fi
7705
	    fi
5167
	  fi
7706
	  fi
5168
	  continue
7707
	  continue
5169
	  ;;
7708
	  ;;
5170
	-L*)
7709
	-L*)
5171
	  case $linkmode in
7710
	  case $linkmode in
5172
	  lib)
7711
	  lib)
5173
	    deplibs="$deplib $deplibs"
7712
	    deplibs="$deplib $deplibs"
5174
	    test "$pass" = conv && continue
7713
	    test conv = "$pass" && continue
5175
	    newdependency_libs="$deplib $newdependency_libs"
7714
	    newdependency_libs="$deplib $newdependency_libs"
5176
	    func_stripname '-L' '' "$deplib"
7715
	    func_stripname '-L' '' "$deplib"
-
 
7716
	    func_resolve_sysroot "$func_stripname_result"
5177
	    newlib_search_path="$newlib_search_path $func_stripname_result"
7717
	    func_append newlib_search_path " $func_resolve_sysroot_result"
5178
	    ;;
7718
	    ;;
5179
	  prog)
7719
	  prog)
5180
	    if test "$pass" = conv; then
7720
	    if test conv = "$pass"; then
5181
	      deplibs="$deplib $deplibs"
7721
	      deplibs="$deplib $deplibs"
5182
	      continue
7722
	      continue
5183
	    fi
7723
	    fi
5184
	    if test "$pass" = scan; then
7724
	    if test scan = "$pass"; then
5185
	      deplibs="$deplib $deplibs"
7725
	      deplibs="$deplib $deplibs"
5186
	    else
7726
	    else
5187
	      compile_deplibs="$deplib $compile_deplibs"
7727
	      compile_deplibs="$deplib $compile_deplibs"
5188
	      finalize_deplibs="$deplib $finalize_deplibs"
7728
	      finalize_deplibs="$deplib $finalize_deplibs"
5189
	    fi
7729
	    fi
5190
	    func_stripname '-L' '' "$deplib"
7730
	    func_stripname '-L' '' "$deplib"
-
 
7731
	    func_resolve_sysroot "$func_stripname_result"
5191
	    newlib_search_path="$newlib_search_path $func_stripname_result"
7732
	    func_append newlib_search_path " $func_resolve_sysroot_result"
5192
	    ;;
7733
	    ;;
5193
	  *)
7734
	  *)
5194
	    func_warning "\`-L' is ignored for archives/objects"
7735
	    func_warning "'-L' is ignored for archives/objects"
5195
	    ;;
7736
	    ;;
5196
	  esac # linkmode
7737
	  esac # linkmode
5197
	  continue
7738
	  continue
5198
	  ;; # -L
7739
	  ;; # -L
5199
	-R*)
7740
	-R*)
5200
	  if test "$pass" = link; then
7741
	  if test link = "$pass"; then
5201
	    func_stripname '-R' '' "$deplib"
7742
	    func_stripname '-R' '' "$deplib"
-
 
7743
	    func_resolve_sysroot "$func_stripname_result"
5202
	    dir=$func_stripname_result
7744
	    dir=$func_resolve_sysroot_result
5203
	    # Make sure the xrpath contains only unique directories.
7745
	    # Make sure the xrpath contains only unique directories.
5204
	    case "$xrpath " in
7746
	    case "$xrpath " in
5205
	    *" $dir "*) ;;
7747
	    *" $dir "*) ;;
5206
	    *) xrpath="$xrpath $dir" ;;
7748
	    *) func_append xrpath " $dir" ;;
5207
	    esac
7749
	    esac
5208
	  fi
7750
	  fi
5209
	  deplibs="$deplib $deplibs"
7751
	  deplibs="$deplib $deplibs"
5210
	  continue
7752
	  continue
5211
	  ;;
7753
	  ;;
-
 
7754
	*.la)
5212
	*.la) lib="$deplib" ;;
7755
	  func_resolve_sysroot "$deplib"
-
 
7756
	  lib=$func_resolve_sysroot_result
-
 
7757
	  ;;
5213
	*.$libext)
7758
	*.$libext)
5214
	  if test "$pass" = conv; then
7759
	  if test conv = "$pass"; then
5215
	    deplibs="$deplib $deplibs"
7760
	    deplibs="$deplib $deplibs"
5216
	    continue
7761
	    continue
5217
	  fi
7762
	  fi
5218
	  case $linkmode in
7763
	  case $linkmode in
5219
	  lib)
7764
	  lib)
5220
	    # Linking convenience modules into shared libraries is allowed,
7765
	    # Linking convenience modules into shared libraries is allowed,
5221
	    # but linking other static libraries is non-portable.
7766
	    # but linking other static libraries is non-portable.
5222
	    case " $dlpreconveniencelibs " in
7767
	    case " $dlpreconveniencelibs " in
5223
	    *" $deplib "*) ;;
7768
	    *" $deplib "*) ;;
5224
	    *)
7769
	    *)
5225
	      valid_a_lib=no
7770
	      valid_a_lib=false
5226
	      case $deplibs_check_method in
7771
	      case $deplibs_check_method in
5227
		match_pattern*)
7772
		match_pattern*)
5228
		  set dummy $deplibs_check_method; shift
7773
		  set dummy $deplibs_check_method; shift
5229
		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7774
		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5230
		  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
7775
		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
5231
		    | $EGREP "$match_pattern_regex" > /dev/null; then
7776
		    | $EGREP "$match_pattern_regex" > /dev/null; then
5232
		    valid_a_lib=yes
7777
		    valid_a_lib=:
5233
		  fi
7778
		  fi
5234
		;;
7779
		;;
5235
		pass_all)
7780
		pass_all)
5236
		  valid_a_lib=yes
7781
		  valid_a_lib=:
5237
		;;
7782
		;;
5238
	      esac
7783
	      esac
5239
	      if test "$valid_a_lib" != yes; then
7784
	      if $valid_a_lib; then
5240
		$ECHO
-
 
5241
		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
-
 
5242
		$ECHO "*** I have the capability to make that library automatically link in when"
-
 
5243
		$ECHO "*** you link to this library.  But I can only do this if you have a"
-
 
5244
		$ECHO "*** shared version of the library, which you do not appear to have"
-
 
5245
		$ECHO "*** because the file extensions .$libext of this argument makes me believe"
-
 
5246
		$ECHO "*** that it is just a static archive that I should not use here."
-
 
5247
	      else
-
 
5248
		$ECHO
7785
		echo
5249
		$ECHO "*** Warning: Linking the shared library $output against the"
7786
		$ECHO "*** Warning: Linking the shared library $output against the"
5250
		$ECHO "*** static library $deplib is not portable!"
7787
		$ECHO "*** static library $deplib is not portable!"
5251
		deplibs="$deplib $deplibs"
7788
		deplibs="$deplib $deplibs"
-
 
7789
	      else
-
 
7790
		echo
-
 
7791
		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
-
 
7792
		echo "*** I have the capability to make that library automatically link in when"
-
 
7793
		echo "*** you link to this library.  But I can only do this if you have a"
-
 
7794
		echo "*** shared version of the library, which you do not appear to have"
-
 
7795
		echo "*** because the file extensions .$libext of this argument makes me believe"
-
 
7796
		echo "*** that it is just a static archive that I should not use here."
5252
	      fi
7797
	      fi
5253
	      ;;
7798
	      ;;
5254
	    esac
7799
	    esac
5255
	    continue
7800
	    continue
5256
	    ;;
7801
	    ;;
5257
	  prog)
7802
	  prog)
5258
	    if test "$pass" != link; then
7803
	    if test link != "$pass"; then
5259
	      deplibs="$deplib $deplibs"
7804
	      deplibs="$deplib $deplibs"
5260
	    else
7805
	    else
5261
	      compile_deplibs="$deplib $compile_deplibs"
7806
	      compile_deplibs="$deplib $compile_deplibs"
5262
	      finalize_deplibs="$deplib $finalize_deplibs"
7807
	      finalize_deplibs="$deplib $finalize_deplibs"
5263
	    fi
7808
	    fi
5264
	    continue
7809
	    continue
5265
	    ;;
7810
	    ;;
5266
	  esac # linkmode
7811
	  esac # linkmode
5267
	  ;; # *.$libext
7812
	  ;; # *.$libext
5268
	*.lo | *.$objext)
7813
	*.lo | *.$objext)
5269
	  if test "$pass" = conv; then
7814
	  if test conv = "$pass"; then
5270
	    deplibs="$deplib $deplibs"
7815
	    deplibs="$deplib $deplibs"
5271
	  elif test "$linkmode" = prog; then
7816
	  elif test prog = "$linkmode"; then
5272
	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
7817
	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
5273
	      # If there is no dlopen support or we're linking statically,
7818
	      # If there is no dlopen support or we're linking statically,
5274
	      # we need to preload.
7819
	      # we need to preload.
5275
	      newdlprefiles="$newdlprefiles $deplib"
7820
	      func_append newdlprefiles " $deplib"
5276
	      compile_deplibs="$deplib $compile_deplibs"
7821
	      compile_deplibs="$deplib $compile_deplibs"
5277
	      finalize_deplibs="$deplib $finalize_deplibs"
7822
	      finalize_deplibs="$deplib $finalize_deplibs"
5278
	    else
7823
	    else
5279
	      newdlfiles="$newdlfiles $deplib"
7824
	      func_append newdlfiles " $deplib"
5280
	    fi
7825
	    fi
5281
	  fi
7826
	  fi
5282
	  continue
7827
	  continue
5283
	  ;;
7828
	  ;;
5284
	%DEPLIBS%)
7829
	%DEPLIBS%)
5285
	  alldeplibs=yes
7830
	  alldeplibs=:
5286
	  continue
7831
	  continue
5287
	  ;;
7832
	  ;;
5288
	esac # case $deplib
7833
	esac # case $deplib
5289
 
7834
 
5290
	if test "$found" = yes || test -f "$lib"; then :
7835
	$found || test -f "$lib" \
5291
	else
-
 
5292
	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
7836
	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
5293
	fi
-
 
5294
 
7837
 
5295
	# Check to see that this really is a libtool archive.
7838
	# Check to see that this really is a libtool archive.
5296
	func_lalib_unsafe_p "$lib" \
7839
	func_lalib_unsafe_p "$lib" \
5297
	  || func_fatal_error "\`$lib' is not a valid libtool archive"
7840
	  || func_fatal_error "'$lib' is not a valid libtool archive"
5298
 
7841
 
5299
	func_dirname "$lib" "" "."
7842
	func_dirname "$lib" "" "."
5300
	ladir="$func_dirname_result"
7843
	ladir=$func_dirname_result
5301
 
7844
 
5302
	dlname=
7845
	dlname=
5303
	dlopen=
7846
	dlopen=
5304
	dlpreopen=
7847
	dlpreopen=
5305
	libdir=
7848
	libdir=
Line 5316... Line 7859...
5316
	# Read the .la file
7859
	# Read the .la file
5317
	func_source "$lib"
7860
	func_source "$lib"
5318
 
7861
 
5319
	# Convert "-framework foo" to "foo.ltframework"
7862
	# Convert "-framework foo" to "foo.ltframework"
5320
	if test -n "$inherited_linker_flags"; then
7863
	if test -n "$inherited_linker_flags"; then
5321
	  tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
7864
	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
5322
	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
7865
	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5323
	    case " $new_inherited_linker_flags " in
7866
	    case " $new_inherited_linker_flags " in
5324
	      *" $tmp_inherited_linker_flag "*) ;;
7867
	      *" $tmp_inherited_linker_flag "*) ;;
5325
	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
7868
	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
5326
	    esac
7869
	    esac
5327
	  done
7870
	  done
5328
	fi
7871
	fi
5329
	dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7872
	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
5330
	if test "$linkmode,$pass" = "lib,link" ||
7873
	if test lib,link = "$linkmode,$pass" ||
5331
	   test "$linkmode,$pass" = "prog,scan" ||
7874
	   test prog,scan = "$linkmode,$pass" ||
5332
	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
7875
	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
5333
	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
7876
	  test -n "$dlopen" && func_append dlfiles " $dlopen"
5334
	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
7877
	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
5335
	fi
7878
	fi
5336
 
7879
 
5337
	if test "$pass" = conv; then
7880
	if test conv = "$pass"; then
5338
	  # Only check for convenience libraries
7881
	  # Only check for convenience libraries
5339
	  deplibs="$lib $deplibs"
7882
	  deplibs="$lib $deplibs"
5340
	  if test -z "$libdir"; then
7883
	  if test -z "$libdir"; then
5341
	    if test -z "$old_library"; then
7884
	    if test -z "$old_library"; then
5342
	      func_fatal_error "cannot find name of link library for \`$lib'"
7885
	      func_fatal_error "cannot find name of link library for '$lib'"
5343
	    fi
7886
	    fi
5344
	    # It is a libtool convenience library, so add in its objects.
7887
	    # It is a libtool convenience library, so add in its objects.
5345
	    convenience="$convenience $ladir/$objdir/$old_library"
7888
	    func_append convenience " $ladir/$objdir/$old_library"
5346
	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
7889
	    func_append old_convenience " $ladir/$objdir/$old_library"
5347
	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
7890
	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
5348
	    func_fatal_error "\`$lib' is not a convenience library"
7891
	    func_fatal_error "'$lib' is not a convenience library"
5349
	  fi
7892
	  fi
5350
	  tmp_libs=
7893
	  tmp_libs=
5351
	  for deplib in $dependency_libs; do
7894
	  for deplib in $dependency_libs; do
5352
	    deplibs="$deplib $deplibs"
7895
	    deplibs="$deplib $deplibs"
5353
	    if $opt_duplicate_deps ; then
7896
	    if $opt_preserve_dup_deps; then
5354
	      case "$tmp_libs " in
7897
	      case "$tmp_libs " in
5355
	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
7898
	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
5356
	      esac
7899
	      esac
5357
	    fi
7900
	    fi
5358
	    tmp_libs="$tmp_libs $deplib"
7901
	    func_append tmp_libs " $deplib"
5359
	  done
7902
	  done
5360
	  continue
7903
	  continue
5361
	fi # $pass = conv
7904
	fi # $pass = conv
5362
 
7905
 
5363
 
7906
 
5364
	# Get the name of the library we link against.
7907
	# Get the name of the library we link against.
5365
	linklib=
7908
	linklib=
-
 
7909
	if test -n "$old_library" &&
-
 
7910
	   { test yes = "$prefer_static_libs" ||
-
 
7911
	     test built,no = "$prefer_static_libs,$installed"; }; then
-
 
7912
	  linklib=$old_library
-
 
7913
	else
5366
	for l in $old_library $library_names; do
7914
	  for l in $old_library $library_names; do
5367
	  linklib="$l"
7915
	    linklib=$l
5368
	done
7916
	  done
-
 
7917
	fi
5369
	if test -z "$linklib"; then
7918
	if test -z "$linklib"; then
5370
	  func_fatal_error "cannot find name of link library for \`$lib'"
7919
	  func_fatal_error "cannot find name of link library for '$lib'"
5371
	fi
7920
	fi
5372
 
7921
 
5373
	# This library was specified with -dlopen.
7922
	# This library was specified with -dlopen.
5374
	if test "$pass" = dlopen; then
7923
	if test dlopen = "$pass"; then
5375
	  if test -z "$libdir"; then
7924
	  test -z "$libdir" \
5376
	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
7925
	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
5377
	  fi
-
 
5378
	  if test -z "$dlname" ||
7926
	  if test -z "$dlname" ||
5379
	     test "$dlopen_support" != yes ||
7927
	     test yes != "$dlopen_support" ||
5380
	     test "$build_libtool_libs" = no; then
7928
	     test no = "$build_libtool_libs"
-
 
7929
	  then
5381
	    # If there is no dlname, no dlopen support or we're linking
7930
	    # If there is no dlname, no dlopen support or we're linking
5382
	    # statically, we need to preload.  We also need to preload any
7931
	    # statically, we need to preload.  We also need to preload any
5383
	    # dependent libraries so libltdl's deplib preloader doesn't
7932
	    # dependent libraries so libltdl's deplib preloader doesn't
5384
	    # bomb out in the load deplibs phase.
7933
	    # bomb out in the load deplibs phase.
5385
	    dlprefiles="$dlprefiles $lib $dependency_libs"
7934
	    func_append dlprefiles " $lib $dependency_libs"
5386
	  else
7935
	  else
5387
	    newdlfiles="$newdlfiles $lib"
7936
	    func_append newdlfiles " $lib"
5388
	  fi
7937
	  fi
5389
	  continue
7938
	  continue
5390
	fi # $pass = dlopen
7939
	fi # $pass = dlopen
5391
 
7940
 
5392
	# We need an absolute path.
7941
	# We need an absolute path.
5393
	case $ladir in
7942
	case $ladir in
5394
	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
7943
	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
5395
	*)
7944
	*)
5396
	  abs_ladir=`cd "$ladir" && pwd`
7945
	  abs_ladir=`cd "$ladir" && pwd`
5397
	  if test -z "$abs_ladir"; then
7946
	  if test -z "$abs_ladir"; then
5398
	    func_warning "cannot determine absolute directory name of \`$ladir'"
7947
	    func_warning "cannot determine absolute directory name of '$ladir'"
5399
	    func_warning "passing it literally to the linker, although it might fail"
7948
	    func_warning "passing it literally to the linker, although it might fail"
5400
	    abs_ladir="$ladir"
7949
	    abs_ladir=$ladir
5401
	  fi
7950
	  fi
5402
	  ;;
7951
	  ;;
5403
	esac
7952
	esac
5404
	func_basename "$lib"
7953
	func_basename "$lib"
5405
	laname="$func_basename_result"
7954
	laname=$func_basename_result
5406
 
7955
 
5407
	# Find the relevant object directory and library name.
7956
	# Find the relevant object directory and library name.
5408
	if test "X$installed" = Xyes; then
7957
	if test yes = "$installed"; then
5409
	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
7958
	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5410
	    func_warning "library \`$lib' was moved."
7959
	    func_warning "library '$lib' was moved."
5411
	    dir="$ladir"
7960
	    dir=$ladir
5412
	    absdir="$abs_ladir"
7961
	    absdir=$abs_ladir
5413
	    libdir="$abs_ladir"
7962
	    libdir=$abs_ladir
5414
	  else
7963
	  else
5415
	    dir="$libdir"
7964
	    dir=$lt_sysroot$libdir
5416
	    absdir="$libdir"
7965
	    absdir=$lt_sysroot$libdir
5417
	  fi
7966
	  fi
5418
	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
7967
	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
5419
	else
7968
	else
5420
	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
7969
	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5421
	    dir="$ladir"
7970
	    dir=$ladir
5422
	    absdir="$abs_ladir"
7971
	    absdir=$abs_ladir
5423
	    # Remove this search path later
7972
	    # Remove this search path later
5424
	    notinst_path="$notinst_path $abs_ladir"
7973
	    func_append notinst_path " $abs_ladir"
5425
	  else
7974
	  else
5426
	    dir="$ladir/$objdir"
7975
	    dir=$ladir/$objdir
5427
	    absdir="$abs_ladir/$objdir"
7976
	    absdir=$abs_ladir/$objdir
5428
	    # Remove this search path later
7977
	    # Remove this search path later
5429
	    notinst_path="$notinst_path $abs_ladir"
7978
	    func_append notinst_path " $abs_ladir"
5430
	  fi
7979
	  fi
5431
	fi # $installed = yes
7980
	fi # $installed = yes
5432
	func_stripname 'lib' '.la' "$laname"
7981
	func_stripname 'lib' '.la' "$laname"
5433
	name=$func_stripname_result
7982
	name=$func_stripname_result
5434
 
7983
 
5435
	# This library was specified with -dlpreopen.
7984
	# This library was specified with -dlpreopen.
5436
	if test "$pass" = dlpreopen; then
7985
	if test dlpreopen = "$pass"; then
5437
	  if test -z "$libdir" && test "$linkmode" = prog; then
7986
	  if test -z "$libdir" && test prog = "$linkmode"; then
5438
	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
7987
	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
5439
	  fi
-
 
5440
	  # Prefer using a static library (so that no silly _DYNAMIC symbols
-
 
5441
	  # are required to link).
-
 
5442
	  if test -n "$old_library"; then
-
 
5443
	    newdlprefiles="$newdlprefiles $dir/$old_library"
-
 
5444
	    # Keep a list of preopened convenience libraries to check
-
 
5445
	    # that they are being used correctly in the link pass.
-
 
5446
	    test -z "$libdir" && \
-
 
5447
		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
-
 
5448
	  # Otherwise, use the dlname, so that lt_dlopen finds it.
-
 
5449
	  elif test -n "$dlname"; then
-
 
5450
	    newdlprefiles="$newdlprefiles $dir/$dlname"
-
 
5451
	  else
-
 
5452
	    newdlprefiles="$newdlprefiles $dir/$linklib"
-
 
5453
	  fi
7988
	  fi
-
 
7989
	  case $host in
-
 
7990
	    # special handling for platforms with PE-DLLs.
-
 
7991
	    *cygwin* | *mingw* | *cegcc* )
-
 
7992
	      # Linker will automatically link against shared library if both
-
 
7993
	      # static and shared are present.  Therefore, ensure we extract
-
 
7994
	      # symbols from the import library if a shared library is present
-
 
7995
	      # (otherwise, the dlopen module name will be incorrect).  We do
-
 
7996
	      # this by putting the import library name into $newdlprefiles.
-
 
7997
	      # We recover the dlopen module name by 'saving' the la file
-
 
7998
	      # name in a special purpose variable, and (later) extracting the
-
 
7999
	      # dlname from the la file.
-
 
8000
	      if test -n "$dlname"; then
-
 
8001
	        func_tr_sh "$dir/$linklib"
-
 
8002
	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
-
 
8003
	        func_append newdlprefiles " $dir/$linklib"
-
 
8004
	      else
-
 
8005
	        func_append newdlprefiles " $dir/$old_library"
-
 
8006
	        # Keep a list of preopened convenience libraries to check
-
 
8007
	        # that they are being used correctly in the link pass.
-
 
8008
	        test -z "$libdir" && \
-
 
8009
	          func_append dlpreconveniencelibs " $dir/$old_library"
-
 
8010
	      fi
-
 
8011
	    ;;
-
 
8012
	    * )
-
 
8013
	      # Prefer using a static library (so that no silly _DYNAMIC symbols
-
 
8014
	      # are required to link).
-
 
8015
	      if test -n "$old_library"; then
-
 
8016
	        func_append newdlprefiles " $dir/$old_library"
-
 
8017
	        # Keep a list of preopened convenience libraries to check
-
 
8018
	        # that they are being used correctly in the link pass.
-
 
8019
	        test -z "$libdir" && \
-
 
8020
	          func_append dlpreconveniencelibs " $dir/$old_library"
-
 
8021
	      # Otherwise, use the dlname, so that lt_dlopen finds it.
-
 
8022
	      elif test -n "$dlname"; then
-
 
8023
	        func_append newdlprefiles " $dir/$dlname"
-
 
8024
	      else
-
 
8025
	        func_append newdlprefiles " $dir/$linklib"
-
 
8026
	      fi
-
 
8027
	    ;;
-
 
8028
	  esac
5454
	fi # $pass = dlpreopen
8029
	fi # $pass = dlpreopen
5455
 
8030
 
5456
	if test -z "$libdir"; then
8031
	if test -z "$libdir"; then
5457
	  # Link the convenience library
8032
	  # Link the convenience library
5458
	  if test "$linkmode" = lib; then
8033
	  if test lib = "$linkmode"; then
5459
	    deplibs="$dir/$old_library $deplibs"
8034
	    deplibs="$dir/$old_library $deplibs"
5460
	  elif test "$linkmode,$pass" = "prog,link"; then
8035
	  elif test prog,link = "$linkmode,$pass"; then
5461
	    compile_deplibs="$dir/$old_library $compile_deplibs"
8036
	    compile_deplibs="$dir/$old_library $compile_deplibs"
5462
	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
8037
	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
5463
	  else
8038
	  else
5464
	    deplibs="$lib $deplibs" # used for prog,scan pass
8039
	    deplibs="$lib $deplibs" # used for prog,scan pass
5465
	  fi
8040
	  fi
5466
	  continue
8041
	  continue
5467
	fi
8042
	fi
5468
 
8043
 
5469
 
8044
 
5470
	if test "$linkmode" = prog && test "$pass" != link; then
8045
	if test prog = "$linkmode" && test link != "$pass"; then
5471
	  newlib_search_path="$newlib_search_path $ladir"
8046
	  func_append newlib_search_path " $ladir"
5472
	  deplibs="$lib $deplibs"
8047
	  deplibs="$lib $deplibs"
5473
 
8048
 
5474
	  linkalldeplibs=no
8049
	  linkalldeplibs=false
5475
	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
8050
	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
5476
	     test "$build_libtool_libs" = no; then
8051
	     test no = "$build_libtool_libs"; then
5477
	    linkalldeplibs=yes
8052
	    linkalldeplibs=:
5478
	  fi
8053
	  fi
5479
 
8054
 
5480
	  tmp_libs=
8055
	  tmp_libs=
5481
	  for deplib in $dependency_libs; do
8056
	  for deplib in $dependency_libs; do
5482
	    case $deplib in
8057
	    case $deplib in
5483
	    -L*) func_stripname '-L' '' "$deplib"
8058
	    -L*) func_stripname '-L' '' "$deplib"
-
 
8059
	         func_resolve_sysroot "$func_stripname_result"
5484
	         newlib_search_path="$newlib_search_path $func_stripname_result"
8060
	         func_append newlib_search_path " $func_resolve_sysroot_result"
5485
		 ;;
8061
		 ;;
5486
	    esac
8062
	    esac
5487
	    # Need to link against all dependency_libs?
8063
	    # Need to link against all dependency_libs?
5488
	    if test "$linkalldeplibs" = yes; then
8064
	    if $linkalldeplibs; then
5489
	      deplibs="$deplib $deplibs"
8065
	      deplibs="$deplib $deplibs"
5490
	    else
8066
	    else
5491
	      # Need to hardcode shared library paths
8067
	      # Need to hardcode shared library paths
5492
	      # or/and link against static libraries
8068
	      # or/and link against static libraries
5493
	      newdependency_libs="$deplib $newdependency_libs"
8069
	      newdependency_libs="$deplib $newdependency_libs"
5494
	    fi
8070
	    fi
5495
	    if $opt_duplicate_deps ; then
8071
	    if $opt_preserve_dup_deps; then
5496
	      case "$tmp_libs " in
8072
	      case "$tmp_libs " in
5497
	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
8073
	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
5498
	      esac
8074
	      esac
5499
	    fi
8075
	    fi
5500
	    tmp_libs="$tmp_libs $deplib"
8076
	    func_append tmp_libs " $deplib"
5501
	  done # for deplib
8077
	  done # for deplib
5502
	  continue
8078
	  continue
5503
	fi # $linkmode = prog...
8079
	fi # $linkmode = prog...
5504
 
8080
 
5505
	if test "$linkmode,$pass" = "prog,link"; then
8081
	if test prog,link = "$linkmode,$pass"; then
5506
	  if test -n "$library_names" &&
8082
	  if test -n "$library_names" &&
5507
	     { { test "$prefer_static_libs" = no ||
8083
	     { { test no = "$prefer_static_libs" ||
5508
	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
8084
	         test built,yes = "$prefer_static_libs,$installed"; } ||
5509
	       test -z "$old_library"; }; then
8085
	       test -z "$old_library"; }; then
5510
	    # We need to hardcode the library path
8086
	    # We need to hardcode the library path
5511
	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
8087
	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
5512
	      # Make sure the rpath contains only unique directories.
8088
	      # Make sure the rpath contains only unique directories.
5513
	      case "$temp_rpath:" in
8089
	      case $temp_rpath: in
5514
	      *"$absdir:"*) ;;
8090
	      *"$absdir:"*) ;;
5515
	      *) temp_rpath="$temp_rpath$absdir:" ;;
8091
	      *) func_append temp_rpath "$absdir:" ;;
5516
	      esac
8092
	      esac
5517
	    fi
8093
	    fi
5518
 
8094
 
5519
	    # Hardcode the library path.
8095
	    # Hardcode the library path.
5520
	    # Skip directories that are in the system default run-time
8096
	    # Skip directories that are in the system default run-time
Line 5522... Line 8098...
5522
	    case " $sys_lib_dlsearch_path " in
8098
	    case " $sys_lib_dlsearch_path " in
5523
	    *" $absdir "*) ;;
8099
	    *" $absdir "*) ;;
5524
	    *)
8100
	    *)
5525
	      case "$compile_rpath " in
8101
	      case "$compile_rpath " in
5526
	      *" $absdir "*) ;;
8102
	      *" $absdir "*) ;;
5527
	      *) compile_rpath="$compile_rpath $absdir"
8103
	      *) func_append compile_rpath " $absdir" ;;
5528
	      esac
8104
	      esac
5529
	      ;;
8105
	      ;;
5530
	    esac
8106
	    esac
5531
	    case " $sys_lib_dlsearch_path " in
8107
	    case " $sys_lib_dlsearch_path " in
5532
	    *" $libdir "*) ;;
8108
	    *" $libdir "*) ;;
5533
	    *)
8109
	    *)
5534
	      case "$finalize_rpath " in
8110
	      case "$finalize_rpath " in
5535
	      *" $libdir "*) ;;
8111
	      *" $libdir "*) ;;
5536
	      *) finalize_rpath="$finalize_rpath $libdir"
8112
	      *) func_append finalize_rpath " $libdir" ;;
5537
	      esac
8113
	      esac
5538
	      ;;
8114
	      ;;
5539
	    esac
8115
	    esac
5540
	  fi # $linkmode,$pass = prog,link...
8116
	  fi # $linkmode,$pass = prog,link...
5541
 
8117
 
5542
	  if test "$alldeplibs" = yes &&
8118
	  if $alldeplibs &&
5543
	     { test "$deplibs_check_method" = pass_all ||
8119
	     { test pass_all = "$deplibs_check_method" ||
5544
	       { test "$build_libtool_libs" = yes &&
8120
	       { test yes = "$build_libtool_libs" &&
5545
		 test -n "$library_names"; }; }; then
8121
		 test -n "$library_names"; }; }; then
5546
	    # We only need to search for static libraries
8122
	    # We only need to search for static libraries
5547
	    continue
8123
	    continue
5548
	  fi
8124
	  fi
5549
	fi
8125
	fi
5550
 
8126
 
5551
	link_static=no # Whether the deplib will be linked statically
8127
	link_static=no # Whether the deplib will be linked statically
5552
	use_static_libs=$prefer_static_libs
8128
	use_static_libs=$prefer_static_libs
5553
	if test "$use_static_libs" = built && test "$installed" = yes; then
8129
	if test built = "$use_static_libs" && test yes = "$installed"; then
5554
	  use_static_libs=no
8130
	  use_static_libs=no
5555
	fi
8131
	fi
5556
	if test -n "$library_names" &&
8132
	if test -n "$library_names" &&
5557
	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
8133
	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
5558
	  case $host in
8134
	  case $host in
5559
	  *cygwin* | *mingw* | *cegcc*)
8135
	  *cygwin* | *mingw* | *cegcc* | *os2*)
5560
	      # No point in relinking DLLs because paths are not encoded
8136
	      # No point in relinking DLLs because paths are not encoded
5561
	      notinst_deplibs="$notinst_deplibs $lib"
8137
	      func_append notinst_deplibs " $lib"
5562
	      need_relink=no
8138
	      need_relink=no
5563
	    ;;
8139
	    ;;
5564
	  *)
8140
	  *)
5565
	    if test "$installed" = no; then
8141
	    if test no = "$installed"; then
5566
	      notinst_deplibs="$notinst_deplibs $lib"
8142
	      func_append notinst_deplibs " $lib"
5567
	      need_relink=yes
8143
	      need_relink=yes
5568
	    fi
8144
	    fi
5569
	    ;;
8145
	    ;;
5570
	  esac
8146
	  esac
5571
	  # This is a shared library
8147
	  # This is a shared library
5572
 
8148
 
5573
	  # Warn about portability, can't link against -module's on some
8149
	  # Warn about portability, can't link against -module's on some
5574
	  # systems (darwin).  Don't bleat about dlopened modules though!
8150
	  # systems (darwin).  Don't bleat about dlopened modules though!
5575
	  dlopenmodule=""
8151
	  dlopenmodule=
5576
	  for dlpremoduletest in $dlprefiles; do
8152
	  for dlpremoduletest in $dlprefiles; do
5577
	    if test "X$dlpremoduletest" = "X$lib"; then
8153
	    if test "X$dlpremoduletest" = "X$lib"; then
5578
	      dlopenmodule="$dlpremoduletest"
8154
	      dlopenmodule=$dlpremoduletest
5579
	      break
8155
	      break
5580
	    fi
8156
	    fi
5581
	  done
8157
	  done
5582
	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
8158
	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
5583
	    $ECHO
8159
	    echo
5584
	    if test "$linkmode" = prog; then
8160
	    if test prog = "$linkmode"; then
5585
	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
8161
	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
5586
	    else
8162
	    else
5587
	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
8163
	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
5588
	    fi
8164
	    fi
5589
	    $ECHO "*** $linklib is not portable!"
8165
	    $ECHO "*** $linklib is not portable!"
5590
	  fi
8166
	  fi
5591
	  if test "$linkmode" = lib &&
8167
	  if test lib = "$linkmode" &&
5592
	     test "$hardcode_into_libs" = yes; then
8168
	     test yes = "$hardcode_into_libs"; then
5593
	    # Hardcode the library path.
8169
	    # Hardcode the library path.
5594
	    # Skip directories that are in the system default run-time
8170
	    # Skip directories that are in the system default run-time
5595
	    # search path.
8171
	    # search path.
5596
	    case " $sys_lib_dlsearch_path " in
8172
	    case " $sys_lib_dlsearch_path " in
5597
	    *" $absdir "*) ;;
8173
	    *" $absdir "*) ;;
5598
	    *)
8174
	    *)
5599
	      case "$compile_rpath " in
8175
	      case "$compile_rpath " in
5600
	      *" $absdir "*) ;;
8176
	      *" $absdir "*) ;;
5601
	      *) compile_rpath="$compile_rpath $absdir"
8177
	      *) func_append compile_rpath " $absdir" ;;
5602
	      esac
8178
	      esac
5603
	      ;;
8179
	      ;;
5604
	    esac
8180
	    esac
5605
	    case " $sys_lib_dlsearch_path " in
8181
	    case " $sys_lib_dlsearch_path " in
5606
	    *" $libdir "*) ;;
8182
	    *" $libdir "*) ;;
5607
	    *)
8183
	    *)
5608
	      case "$finalize_rpath " in
8184
	      case "$finalize_rpath " in
5609
	      *" $libdir "*) ;;
8185
	      *" $libdir "*) ;;
5610
	      *) finalize_rpath="$finalize_rpath $libdir"
8186
	      *) func_append finalize_rpath " $libdir" ;;
5611
	      esac
8187
	      esac
5612
	      ;;
8188
	      ;;
5613
	    esac
8189
	    esac
5614
	  fi
8190
	  fi
5615
 
8191
 
5616
	  if test -n "$old_archive_from_expsyms_cmds"; then
8192
	  if test -n "$old_archive_from_expsyms_cmds"; then
5617
	    # figure out the soname
8193
	    # figure out the soname
5618
	    set dummy $library_names
8194
	    set dummy $library_names
5619
	    shift
8195
	    shift
5620
	    realname="$1"
8196
	    realname=$1
5621
	    shift
8197
	    shift
5622
	    libname=`eval "\\$ECHO \"$libname_spec\""`
8198
	    libname=`eval "\\$ECHO \"$libname_spec\""`
5623
	    # use dlname if we got it. it's perfectly good, no?
8199
	    # use dlname if we got it. it's perfectly good, no?
5624
	    if test -n "$dlname"; then
8200
	    if test -n "$dlname"; then
5625
	      soname="$dlname"
8201
	      soname=$dlname
5626
	    elif test -n "$soname_spec"; then
8202
	    elif test -n "$soname_spec"; then
5627
	      # bleh windows
8203
	      # bleh windows
5628
	      case $host in
8204
	      case $host in
5629
	      *cygwin* | mingw* | *cegcc*)
8205
	      *cygwin* | mingw* | *cegcc* | *os2*)
5630
	        func_arith $current - $age
8206
	        func_arith $current - $age
5631
		major=$func_arith_result
8207
		major=$func_arith_result
5632
		versuffix="-$major"
8208
		versuffix=-$major
5633
		;;
8209
		;;
5634
	      esac
8210
	      esac
5635
	      eval soname=\"$soname_spec\"
8211
	      eval soname=\"$soname_spec\"
5636
	    else
8212
	    else
5637
	      soname="$realname"
8213
	      soname=$realname
5638
	    fi
8214
	    fi
5639
 
8215
 
5640
	    # Make a new name for the extract_expsyms_cmds to use
8216
	    # Make a new name for the extract_expsyms_cmds to use
5641
	    soroot="$soname"
8217
	    soroot=$soname
5642
	    func_basename "$soroot"
8218
	    func_basename "$soroot"
5643
	    soname="$func_basename_result"
8219
	    soname=$func_basename_result
5644
	    func_stripname 'lib' '.dll' "$soname"
8220
	    func_stripname 'lib' '.dll' "$soname"
5645
	    newlib=libimp-$func_stripname_result.a
8221
	    newlib=libimp-$func_stripname_result.a
5646
 
8222
 
5647
	    # If the library has no export list, then create one now
8223
	    # If the library has no export list, then create one now
5648
	    if test -f "$output_objdir/$soname-def"; then :
8224
	    if test -f "$output_objdir/$soname-def"; then :
5649
	    else
8225
	    else
5650
	      func_verbose "extracting exported symbol list from \`$soname'"
8226
	      func_verbose "extracting exported symbol list from '$soname'"
5651
	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
8227
	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
5652
	    fi
8228
	    fi
5653
 
8229
 
5654
	    # Create $newlib
8230
	    # Create $newlib
5655
	    if test -f "$output_objdir/$newlib"; then :; else
8231
	    if test -f "$output_objdir/$newlib"; then :; else
5656
	      func_verbose "generating import library for \`$soname'"
8232
	      func_verbose "generating import library for '$soname'"
5657
	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
8233
	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
5658
	    fi
8234
	    fi
5659
	    # make sure the library variables are pointing to the new library
8235
	    # make sure the library variables are pointing to the new library
5660
	    dir=$output_objdir
8236
	    dir=$output_objdir
5661
	    linklib=$newlib
8237
	    linklib=$newlib
5662
	  fi # test -n "$old_archive_from_expsyms_cmds"
8238
	  fi # test -n "$old_archive_from_expsyms_cmds"
5663
 
8239
 
5664
	  if test "$linkmode" = prog || test "$mode" != relink; then
8240
	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
5665
	    add_shlibpath=
8241
	    add_shlibpath=
5666
	    add_dir=
8242
	    add_dir=
5667
	    add=
8243
	    add=
5668
	    lib_linked=yes
8244
	    lib_linked=yes
5669
	    case $hardcode_action in
8245
	    case $hardcode_action in
5670
	    immediate | unsupported)
8246
	    immediate | unsupported)
5671
	      if test "$hardcode_direct" = no; then
8247
	      if test no = "$hardcode_direct"; then
5672
		add="$dir/$linklib"
8248
		add=$dir/$linklib
5673
		case $host in
8249
		case $host in
5674
		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
8250
		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
5675
		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
8251
		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
5676
		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
8252
		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
5677
		    *-*-unixware7*) add_dir="-L$dir" ;;
8253
		    *-*-unixware7*) add_dir=-L$dir ;;
5678
		  *-*-darwin* )
8254
		  *-*-darwin* )
5679
		    # if the lib is a (non-dlopened) module then we can not
8255
		    # if the lib is a (non-dlopened) module then we cannot
5680
		    # link against it, someone is ignoring the earlier warnings
8256
		    # link against it, someone is ignoring the earlier warnings
5681
		    if /usr/bin/file -L $add 2> /dev/null |
8257
		    if /usr/bin/file -L $add 2> /dev/null |
5682
			 $GREP ": [^:]* bundle" >/dev/null ; then
8258
			 $GREP ": [^:]* bundle" >/dev/null; then
5683
		      if test "X$dlopenmodule" != "X$lib"; then
8259
		      if test "X$dlopenmodule" != "X$lib"; then
5684
			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
8260
			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
5685
			if test -z "$old_library" ; then
8261
			if test -z "$old_library"; then
5686
			  $ECHO
8262
			  echo
5687
			  $ECHO "*** And there doesn't seem to be a static archive available"
8263
			  echo "*** And there doesn't seem to be a static archive available"
5688
			  $ECHO "*** The link will probably fail, sorry"
8264
			  echo "*** The link will probably fail, sorry"
5689
			else
8265
			else
5690
			  add="$dir/$old_library"
8266
			  add=$dir/$old_library
5691
			fi
8267
			fi
5692
		      elif test -n "$old_library"; then
8268
		      elif test -n "$old_library"; then
5693
			add="$dir/$old_library"
8269
			add=$dir/$old_library
5694
		      fi
8270
		      fi
5695
		    fi
8271
		    fi
5696
		esac
8272
		esac
5697
	      elif test "$hardcode_minus_L" = no; then
8273
	      elif test no = "$hardcode_minus_L"; then
5698
		case $host in
8274
		case $host in
5699
		*-*-sunos*) add_shlibpath="$dir" ;;
8275
		*-*-sunos*) add_shlibpath=$dir ;;
5700
		esac
8276
		esac
5701
		add_dir="-L$dir"
8277
		add_dir=-L$dir
5702
		add="-l$name"
8278
		add=-l$name
5703
	      elif test "$hardcode_shlibpath_var" = no; then
8279
	      elif test no = "$hardcode_shlibpath_var"; then
5704
		add_shlibpath="$dir"
8280
		add_shlibpath=$dir
5705
		add="-l$name"
8281
		add=-l$name
5706
	      else
8282
	      else
5707
		lib_linked=no
8283
		lib_linked=no
5708
	      fi
8284
	      fi
5709
	      ;;
8285
	      ;;
5710
	    relink)
8286
	    relink)
5711
	      if test "$hardcode_direct" = yes &&
8287
	      if test yes = "$hardcode_direct" &&
5712
	         test "$hardcode_direct_absolute" = no; then
8288
	         test no = "$hardcode_direct_absolute"; then
5713
		add="$dir/$linklib"
8289
		add=$dir/$linklib
5714
	      elif test "$hardcode_minus_L" = yes; then
8290
	      elif test yes = "$hardcode_minus_L"; then
5715
		add_dir="-L$dir"
8291
		add_dir=-L$absdir
5716
		# Try looking first in the location we're being installed to.
8292
		# Try looking first in the location we're being installed to.
5717
		if test -n "$inst_prefix_dir"; then
8293
		if test -n "$inst_prefix_dir"; then
5718
		  case $libdir in
8294
		  case $libdir in
5719
		    [\\/]*)
8295
		    [\\/]*)
5720
		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
8296
		      func_append add_dir " -L$inst_prefix_dir$libdir"
5721
		      ;;
8297
		      ;;
5722
		  esac
8298
		  esac
5723
		fi
8299
		fi
5724
		add="-l$name"
8300
		add=-l$name
5725
	      elif test "$hardcode_shlibpath_var" = yes; then
8301
	      elif test yes = "$hardcode_shlibpath_var"; then
5726
		add_shlibpath="$dir"
8302
		add_shlibpath=$dir
5727
		add="-l$name"
8303
		add=-l$name
5728
	      else
8304
	      else
5729
		lib_linked=no
8305
		lib_linked=no
5730
	      fi
8306
	      fi
5731
	      ;;
8307
	      ;;
5732
	    *) lib_linked=no ;;
8308
	    *) lib_linked=no ;;
5733
	    esac
8309
	    esac
5734
 
8310
 
5735
	    if test "$lib_linked" != yes; then
8311
	    if test yes != "$lib_linked"; then
5736
	      func_fatal_configuration "unsupported hardcode properties"
8312
	      func_fatal_configuration "unsupported hardcode properties"
5737
	    fi
8313
	    fi
5738
 
8314
 
5739
	    if test -n "$add_shlibpath"; then
8315
	    if test -n "$add_shlibpath"; then
5740
	      case :$compile_shlibpath: in
8316
	      case :$compile_shlibpath: in
5741
	      *":$add_shlibpath:"*) ;;
8317
	      *":$add_shlibpath:"*) ;;
5742
	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
8318
	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
5743
	      esac
8319
	      esac
5744
	    fi
8320
	    fi
5745
	    if test "$linkmode" = prog; then
8321
	    if test prog = "$linkmode"; then
5746
	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
8322
	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
5747
	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
8323
	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
5748
	    else
8324
	    else
5749
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
8325
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
5750
	      test -n "$add" && deplibs="$add $deplibs"
8326
	      test -n "$add" && deplibs="$add $deplibs"
5751
	      if test "$hardcode_direct" != yes &&
8327
	      if test yes != "$hardcode_direct" &&
5752
		 test "$hardcode_minus_L" != yes &&
8328
		 test yes != "$hardcode_minus_L" &&
5753
		 test "$hardcode_shlibpath_var" = yes; then
8329
		 test yes = "$hardcode_shlibpath_var"; then
5754
		case :$finalize_shlibpath: in
8330
		case :$finalize_shlibpath: in
5755
		*":$libdir:"*) ;;
8331
		*":$libdir:"*) ;;
5756
		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
8332
		*) func_append finalize_shlibpath "$libdir:" ;;
5757
		esac
8333
		esac
5758
	      fi
8334
	      fi
5759
	    fi
8335
	    fi
5760
	  fi
8336
	  fi
5761
 
8337
 
5762
	  if test "$linkmode" = prog || test "$mode" = relink; then
8338
	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
5763
	    add_shlibpath=
8339
	    add_shlibpath=
5764
	    add_dir=
8340
	    add_dir=
5765
	    add=
8341
	    add=
5766
	    # Finalize command for both is simple: just hardcode it.
8342
	    # Finalize command for both is simple: just hardcode it.
5767
	    if test "$hardcode_direct" = yes &&
8343
	    if test yes = "$hardcode_direct" &&
5768
	       test "$hardcode_direct_absolute" = no; then
8344
	       test no = "$hardcode_direct_absolute"; then
5769
	      add="$libdir/$linklib"
8345
	      add=$libdir/$linklib
5770
	    elif test "$hardcode_minus_L" = yes; then
8346
	    elif test yes = "$hardcode_minus_L"; then
5771
	      add_dir="-L$libdir"
8347
	      add_dir=-L$libdir
5772
	      add="-l$name"
8348
	      add=-l$name
5773
	    elif test "$hardcode_shlibpath_var" = yes; then
8349
	    elif test yes = "$hardcode_shlibpath_var"; then
5774
	      case :$finalize_shlibpath: in
8350
	      case :$finalize_shlibpath: in
5775
	      *":$libdir:"*) ;;
8351
	      *":$libdir:"*) ;;
5776
	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
8352
	      *) func_append finalize_shlibpath "$libdir:" ;;
5777
	      esac
8353
	      esac
5778
	      add="-l$name"
8354
	      add=-l$name
5779
	    elif test "$hardcode_automatic" = yes; then
8355
	    elif test yes = "$hardcode_automatic"; then
5780
	      if test -n "$inst_prefix_dir" &&
8356
	      if test -n "$inst_prefix_dir" &&
5781
		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
8357
		 test -f "$inst_prefix_dir$libdir/$linklib"; then
5782
		add="$inst_prefix_dir$libdir/$linklib"
8358
		add=$inst_prefix_dir$libdir/$linklib
5783
	      else
8359
	      else
5784
		add="$libdir/$linklib"
8360
		add=$libdir/$linklib
5785
	      fi
8361
	      fi
5786
	    else
8362
	    else
5787
	      # We cannot seem to hardcode it, guess we'll fake it.
8363
	      # We cannot seem to hardcode it, guess we'll fake it.
5788
	      add_dir="-L$libdir"
8364
	      add_dir=-L$libdir
5789
	      # Try looking first in the location we're being installed to.
8365
	      # Try looking first in the location we're being installed to.
5790
	      if test -n "$inst_prefix_dir"; then
8366
	      if test -n "$inst_prefix_dir"; then
5791
		case $libdir in
8367
		case $libdir in
5792
		  [\\/]*)
8368
		  [\\/]*)
5793
		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
8369
		    func_append add_dir " -L$inst_prefix_dir$libdir"
5794
		    ;;
8370
		    ;;
5795
		esac
8371
		esac
5796
	      fi
8372
	      fi
5797
	      add="-l$name"
8373
	      add=-l$name
5798
	    fi
8374
	    fi
5799
 
8375
 
5800
	    if test "$linkmode" = prog; then
8376
	    if test prog = "$linkmode"; then
5801
	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
8377
	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
5802
	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
8378
	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
5803
	    else
8379
	    else
5804
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
8380
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
5805
	      test -n "$add" && deplibs="$add $deplibs"
8381
	      test -n "$add" && deplibs="$add $deplibs"
5806
	    fi
8382
	    fi
5807
	  fi
8383
	  fi
5808
	elif test "$linkmode" = prog; then
8384
	elif test prog = "$linkmode"; then
5809
	  # Here we assume that one of hardcode_direct or hardcode_minus_L
8385
	  # Here we assume that one of hardcode_direct or hardcode_minus_L
5810
	  # is not unsupported.  This is valid on all known static and
8386
	  # is not unsupported.  This is valid on all known static and
5811
	  # shared platforms.
8387
	  # shared platforms.
5812
	  if test "$hardcode_direct" != unsupported; then
8388
	  if test unsupported != "$hardcode_direct"; then
5813
	    test -n "$old_library" && linklib="$old_library"
8389
	    test -n "$old_library" && linklib=$old_library
5814
	    compile_deplibs="$dir/$linklib $compile_deplibs"
8390
	    compile_deplibs="$dir/$linklib $compile_deplibs"
5815
	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
8391
	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
5816
	  else
8392
	  else
5817
	    compile_deplibs="-l$name -L$dir $compile_deplibs"
8393
	    compile_deplibs="-l$name -L$dir $compile_deplibs"
5818
	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
8394
	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
5819
	  fi
8395
	  fi
5820
	elif test "$build_libtool_libs" = yes; then
8396
	elif test yes = "$build_libtool_libs"; then
5821
	  # Not a shared library
8397
	  # Not a shared library
5822
	  if test "$deplibs_check_method" != pass_all; then
8398
	  if test pass_all != "$deplibs_check_method"; then
5823
	    # We're trying link a shared library against a static one
8399
	    # We're trying link a shared library against a static one
5824
	    # but the system doesn't support it.
8400
	    # but the system doesn't support it.
5825
 
8401
 
5826
	    # Just print a warning and add the library to dependency_libs so
8402
	    # Just print a warning and add the library to dependency_libs so
5827
	    # that the program can be linked against the static library.
8403
	    # that the program can be linked against the static library.
5828
	    $ECHO
8404
	    echo
5829
	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
8405
	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
5830
	    $ECHO "*** I have the capability to make that library automatically link in when"
8406
	    echo "*** I have the capability to make that library automatically link in when"
5831
	    $ECHO "*** you link to this library.  But I can only do this if you have a"
8407
	    echo "*** you link to this library.  But I can only do this if you have a"
5832
	    $ECHO "*** shared version of the library, which you do not appear to have."
8408
	    echo "*** shared version of the library, which you do not appear to have."
5833
	    if test "$module" = yes; then
8409
	    if test yes = "$module"; then
5834
	      $ECHO "*** But as you try to build a module library, libtool will still create "
8410
	      echo "*** But as you try to build a module library, libtool will still create "
5835
	      $ECHO "*** a static module, that should work as long as the dlopening application"
8411
	      echo "*** a static module, that should work as long as the dlopening application"
5836
	      $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
8412
	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
5837
	      if test -z "$global_symbol_pipe"; then
8413
	      if test -z "$global_symbol_pipe"; then
5838
		$ECHO
8414
		echo
5839
		$ECHO "*** However, this would only work if libtool was able to extract symbol"
8415
		echo "*** However, this would only work if libtool was able to extract symbol"
5840
		$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
8416
		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
5841
		$ECHO "*** not find such a program.  So, this module is probably useless."
8417
		echo "*** not find such a program.  So, this module is probably useless."
5842
		$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
8418
		echo "*** 'nm' from GNU binutils and a full rebuild may help."
5843
	      fi
8419
	      fi
5844
	      if test "$build_old_libs" = no; then
8420
	      if test no = "$build_old_libs"; then
5845
		build_libtool_libs=module
8421
		build_libtool_libs=module
5846
		build_old_libs=yes
8422
		build_old_libs=yes
5847
	      else
8423
	      else
5848
		build_libtool_libs=no
8424
		build_libtool_libs=no
5849
	      fi
8425
	      fi
Line 5852... Line 8428...
5852
	    deplibs="$dir/$old_library $deplibs"
8428
	    deplibs="$dir/$old_library $deplibs"
5853
	    link_static=yes
8429
	    link_static=yes
5854
	  fi
8430
	  fi
5855
	fi # link shared/static library?
8431
	fi # link shared/static library?
5856
 
8432
 
5857
	if test "$linkmode" = lib; then
8433
	if test lib = "$linkmode"; then
5858
	  if test -n "$dependency_libs" &&
8434
	  if test -n "$dependency_libs" &&
5859
	     { test "$hardcode_into_libs" != yes ||
8435
	     { test yes != "$hardcode_into_libs" ||
5860
	       test "$build_old_libs" = yes ||
8436
	       test yes = "$build_old_libs" ||
5861
	       test "$link_static" = yes; }; then
8437
	       test yes = "$link_static"; }; then
5862
	    # Extract -R from dependency_libs
8438
	    # Extract -R from dependency_libs
5863
	    temp_deplibs=
8439
	    temp_deplibs=
5864
	    for libdir in $dependency_libs; do
8440
	    for libdir in $dependency_libs; do
5865
	      case $libdir in
8441
	      case $libdir in
5866
	      -R*) func_stripname '-R' '' "$libdir"
8442
	      -R*) func_stripname '-R' '' "$libdir"
5867
	           temp_xrpath=$func_stripname_result
8443
	           temp_xrpath=$func_stripname_result
5868
		   case " $xrpath " in
8444
		   case " $xrpath " in
5869
		   *" $temp_xrpath "*) ;;
8445
		   *" $temp_xrpath "*) ;;
5870
		   *) xrpath="$xrpath $temp_xrpath";;
8446
		   *) func_append xrpath " $temp_xrpath";;
5871
		   esac;;
8447
		   esac;;
5872
	      *) temp_deplibs="$temp_deplibs $libdir";;
8448
	      *) func_append temp_deplibs " $libdir";;
5873
	      esac
8449
	      esac
5874
	    done
8450
	    done
5875
	    dependency_libs="$temp_deplibs"
8451
	    dependency_libs=$temp_deplibs
5876
	  fi
8452
	  fi
5877
 
8453
 
5878
	  newlib_search_path="$newlib_search_path $absdir"
8454
	  func_append newlib_search_path " $absdir"
5879
	  # Link against this library
8455
	  # Link against this library
5880
	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
8456
	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
5881
	  # ... and its dependency_libs
8457
	  # ... and its dependency_libs
5882
	  tmp_libs=
8458
	  tmp_libs=
5883
	  for deplib in $dependency_libs; do
8459
	  for deplib in $dependency_libs; do
5884
	    newdependency_libs="$deplib $newdependency_libs"
8460
	    newdependency_libs="$deplib $newdependency_libs"
-
 
8461
	    case $deplib in
-
 
8462
              -L*) func_stripname '-L' '' "$deplib"
-
 
8463
                   func_resolve_sysroot "$func_stripname_result";;
-
 
8464
              *) func_resolve_sysroot "$deplib" ;;
-
 
8465
            esac
5885
	    if $opt_duplicate_deps ; then
8466
	    if $opt_preserve_dup_deps; then
5886
	      case "$tmp_libs " in
8467
	      case "$tmp_libs " in
-
 
8468
	      *" $func_resolve_sysroot_result "*)
5887
	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
8469
                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
5888
	      esac
8470
	      esac
5889
	    fi
8471
	    fi
5890
	    tmp_libs="$tmp_libs $deplib"
8472
	    func_append tmp_libs " $func_resolve_sysroot_result"
5891
	  done
8473
	  done
5892
 
8474
 
5893
	  if test "$link_all_deplibs" != no; then
8475
	  if test no != "$link_all_deplibs"; then
5894
	    # Add the search paths of all dependency libraries
8476
	    # Add the search paths of all dependency libraries
5895
	    for deplib in $dependency_libs; do
8477
	    for deplib in $dependency_libs; do
-
 
8478
	      path=
5896
	      case $deplib in
8479
	      case $deplib in
5897
	      -L*) path="$deplib" ;;
8480
	      -L*) path=$deplib ;;
5898
	      *.la)
8481
	      *.la)
-
 
8482
	        func_resolve_sysroot "$deplib"
-
 
8483
	        deplib=$func_resolve_sysroot_result
5899
	        func_dirname "$deplib" "" "."
8484
	        func_dirname "$deplib" "" "."
5900
		dir="$func_dirname_result"
8485
		dir=$func_dirname_result
5901
		# We need an absolute path.
8486
		# We need an absolute path.
5902
		case $dir in
8487
		case $dir in
5903
		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
8488
		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
5904
		*)
8489
		*)
5905
		  absdir=`cd "$dir" && pwd`
8490
		  absdir=`cd "$dir" && pwd`
5906
		  if test -z "$absdir"; then
8491
		  if test -z "$absdir"; then
5907
		    func_warning "cannot determine absolute directory name of \`$dir'"
8492
		    func_warning "cannot determine absolute directory name of '$dir'"
5908
		    absdir="$dir"
8493
		    absdir=$dir
5909
		  fi
8494
		  fi
5910
		  ;;
8495
		  ;;
5911
		esac
8496
		esac
5912
		if $GREP "^installed=no" $deplib > /dev/null; then
8497
		if $GREP "^installed=no" $deplib > /dev/null; then
5913
		case $host in
8498
		case $host in
5914
		*-*-darwin*)
8499
		*-*-darwin*)
5915
		  depdepl=
8500
		  depdepl=
5916
		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
8501
		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
5917
		  if test -n "$deplibrary_names" ; then
8502
		  if test -n "$deplibrary_names"; then
5918
		    for tmp in $deplibrary_names ; do
8503
		    for tmp in $deplibrary_names; do
5919
		      depdepl=$tmp
8504
		      depdepl=$tmp
5920
		    done
8505
		    done
5921
		    if test -f "$absdir/$objdir/$depdepl" ; then
8506
		    if test -f "$absdir/$objdir/$depdepl"; then
5922
		      depdepl="$absdir/$objdir/$depdepl"
8507
		      depdepl=$absdir/$objdir/$depdepl
5923
		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
8508
		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
5924
                      if test -z "$darwin_install_name"; then
8509
                      if test -z "$darwin_install_name"; then
5925
                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
8510
                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
5926
                      fi
8511
                      fi
5927
		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
8512
		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
5928
		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
8513
		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
5929
		      path=
8514
		      path=
5930
		    fi
8515
		    fi
5931
		  fi
8516
		  fi
5932
		  ;;
8517
		  ;;
5933
		*)
8518
		*)
5934
		  path="-L$absdir/$objdir"
8519
		  path=-L$absdir/$objdir
5935
		  ;;
8520
		  ;;
5936
		esac
8521
		esac
5937
		else
8522
		else
5938
		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8523
		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
5939
		  test -z "$libdir" && \
8524
		  test -z "$libdir" && \
5940
		    func_fatal_error "\`$deplib' is not a valid libtool archive"
8525
		    func_fatal_error "'$deplib' is not a valid libtool archive"
5941
		  test "$absdir" != "$libdir" && \
8526
		  test "$absdir" != "$libdir" && \
5942
		    func_warning "\`$deplib' seems to be moved"
8527
		    func_warning "'$deplib' seems to be moved"
5943
 
8528
 
5944
		  path="-L$absdir"
8529
		  path=-L$absdir
5945
		fi
8530
		fi
5946
		;;
8531
		;;
5947
	      esac
8532
	      esac
5948
	      case " $deplibs " in
8533
	      case " $deplibs " in
5949
	      *" $path "*) ;;
8534
	      *" $path "*) ;;
Line 5951... Line 8536...
5951
	      esac
8536
	      esac
5952
	    done
8537
	    done
5953
	  fi # link_all_deplibs != no
8538
	  fi # link_all_deplibs != no
5954
	fi # linkmode = lib
8539
	fi # linkmode = lib
5955
      done # for deplib in $libs
8540
      done # for deplib in $libs
5956
      if test "$pass" = link; then
8541
      if test link = "$pass"; then
5957
	if test "$linkmode" = "prog"; then
8542
	if test prog = "$linkmode"; then
5958
	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
8543
	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
5959
	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
8544
	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
5960
	else
8545
	else
5961
	  compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
8546
	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
5962
	fi
8547
	fi
5963
      fi
8548
      fi
5964
      dependency_libs="$newdependency_libs"
8549
      dependency_libs=$newdependency_libs
5965
      if test "$pass" = dlpreopen; then
8550
      if test dlpreopen = "$pass"; then
5966
	# Link the dlpreopened libraries before other libraries
8551
	# Link the dlpreopened libraries before other libraries
5967
	for deplib in $save_deplibs; do
8552
	for deplib in $save_deplibs; do
5968
	  deplibs="$deplib $deplibs"
8553
	  deplibs="$deplib $deplibs"
5969
	done
8554
	done
5970
      fi
8555
      fi
5971
      if test "$pass" != dlopen; then
8556
      if test dlopen != "$pass"; then
5972
	if test "$pass" != conv; then
8557
	test conv = "$pass" || {
5973
	  # Make sure lib_search_path contains only unique directories.
8558
	  # Make sure lib_search_path contains only unique directories.
5974
	  lib_search_path=
8559
	  lib_search_path=
5975
	  for dir in $newlib_search_path; do
8560
	  for dir in $newlib_search_path; do
5976
	    case "$lib_search_path " in
8561
	    case "$lib_search_path " in
5977
	    *" $dir "*) ;;
8562
	    *" $dir "*) ;;
5978
	    *) lib_search_path="$lib_search_path $dir" ;;
8563
	    *) func_append lib_search_path " $dir" ;;
5979
	    esac
8564
	    esac
5980
	  done
8565
	  done
5981
	  newlib_search_path=
8566
	  newlib_search_path=
5982
	fi
8567
	}
5983
 
8568
 
5984
	if test "$linkmode,$pass" != "prog,link"; then
8569
	if test prog,link = "$linkmode,$pass"; then
5985
	  vars="deplibs"
-
 
5986
	else
-
 
5987
	  vars="compile_deplibs finalize_deplibs"
8570
	  vars="compile_deplibs finalize_deplibs"
-
 
8571
	else
-
 
8572
	  vars=deplibs
5988
	fi
8573
	fi
5989
	for var in $vars dependency_libs; do
8574
	for var in $vars dependency_libs; do
5990
	  # Add libraries to $var in reverse order
8575
	  # Add libraries to $var in reverse order
5991
	  eval tmp_libs=\"\$$var\"
8576
	  eval tmp_libs=\"\$$var\"
5992
	  new_libs=
8577
	  new_libs=
Line 6031... Line 8616...
6031
	  for deplib in $new_libs; do
8616
	  for deplib in $new_libs; do
6032
	    case $deplib in
8617
	    case $deplib in
6033
	    -L*)
8618
	    -L*)
6034
	      case " $tmp_libs " in
8619
	      case " $tmp_libs " in
6035
	      *" $deplib "*) ;;
8620
	      *" $deplib "*) ;;
6036
	      *) tmp_libs="$tmp_libs $deplib" ;;
8621
	      *) func_append tmp_libs " $deplib" ;;
6037
	      esac
8622
	      esac
6038
	      ;;
8623
	      ;;
6039
	    *) tmp_libs="$tmp_libs $deplib" ;;
8624
	    *) func_append tmp_libs " $deplib" ;;
6040
	    esac
8625
	    esac
6041
	  done
8626
	  done
6042
	  eval $var=\"$tmp_libs\"
8627
	  eval $var=\"$tmp_libs\"
6043
	done # for var
8628
	done # for var
6044
      fi
8629
      fi
-
 
8630
 
-
 
8631
      # Add Sun CC postdeps if required:
-
 
8632
      test CXX = "$tagname" && {
-
 
8633
        case $host_os in
-
 
8634
        linux*)
-
 
8635
          case `$CC -V 2>&1 | sed 5q` in
-
 
8636
          *Sun\ C*) # Sun C++ 5.9
-
 
8637
            func_suncc_cstd_abi
-
 
8638
 
-
 
8639
            if test no != "$suncc_use_cstd_abi"; then
-
 
8640
              func_append postdeps ' -library=Cstd -library=Crun'
-
 
8641
            fi
-
 
8642
            ;;
-
 
8643
          esac
-
 
8644
          ;;
-
 
8645
 
-
 
8646
        solaris*)
-
 
8647
          func_cc_basename "$CC"
-
 
8648
          case $func_cc_basename_result in
-
 
8649
          CC* | sunCC*)
-
 
8650
            func_suncc_cstd_abi
-
 
8651
 
-
 
8652
            if test no != "$suncc_use_cstd_abi"; then
-
 
8653
              func_append postdeps ' -library=Cstd -library=Crun'
-
 
8654
            fi
-
 
8655
            ;;
-
 
8656
          esac
-
 
8657
          ;;
-
 
8658
        esac
-
 
8659
      }
-
 
8660
 
6045
      # Last step: remove runtime libs from dependency_libs
8661
      # Last step: remove runtime libs from dependency_libs
6046
      # (they stay in deplibs)
8662
      # (they stay in deplibs)
6047
      tmp_libs=
8663
      tmp_libs=
6048
      for i in $dependency_libs ; do
8664
      for i in $dependency_libs; do
6049
	case " $predeps $postdeps $compiler_lib_search_path " in
8665
	case " $predeps $postdeps $compiler_lib_search_path " in
6050
	*" $i "*)
8666
	*" $i "*)
6051
	  i=""
8667
	  i=
6052
	  ;;
8668
	  ;;
6053
	esac
8669
	esac
6054
	if test -n "$i" ; then
8670
	if test -n "$i"; then
6055
	  tmp_libs="$tmp_libs $i"
8671
	  func_append tmp_libs " $i"
6056
	fi
8672
	fi
6057
      done
8673
      done
6058
      dependency_libs=$tmp_libs
8674
      dependency_libs=$tmp_libs
6059
    done # for pass
8675
    done # for pass
6060
    if test "$linkmode" = prog; then
8676
    if test prog = "$linkmode"; then
6061
      dlfiles="$newdlfiles"
8677
      dlfiles=$newdlfiles
6062
    fi
8678
    fi
6063
    if test "$linkmode" = prog || test "$linkmode" = lib; then
8679
    if test prog = "$linkmode" || test lib = "$linkmode"; then
6064
      dlprefiles="$newdlprefiles"
8680
      dlprefiles=$newdlprefiles
6065
    fi
8681
    fi
6066
 
8682
 
6067
    case $linkmode in
8683
    case $linkmode in
6068
    oldlib)
8684
    oldlib)
6069
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
8685
      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
6070
	func_warning "\`-dlopen' is ignored for archives"
8686
	func_warning "'-dlopen' is ignored for archives"
6071
      fi
8687
      fi
6072
 
8688
 
6073
      case " $deplibs" in
8689
      case " $deplibs" in
6074
      *\ -l* | *\ -L*)
8690
      *\ -l* | *\ -L*)
6075
	func_warning "\`-l' and \`-L' are ignored for archives" ;;
8691
	func_warning "'-l' and '-L' are ignored for archives" ;;
6076
      esac
8692
      esac
6077
 
8693
 
6078
      test -n "$rpath" && \
8694
      test -n "$rpath" && \
6079
	func_warning "\`-rpath' is ignored for archives"
8695
	func_warning "'-rpath' is ignored for archives"
6080
 
8696
 
6081
      test -n "$xrpath" && \
8697
      test -n "$xrpath" && \
6082
	func_warning "\`-R' is ignored for archives"
8698
	func_warning "'-R' is ignored for archives"
6083
 
8699
 
6084
      test -n "$vinfo" && \
8700
      test -n "$vinfo" && \
6085
	func_warning "\`-version-info/-version-number' is ignored for archives"
8701
	func_warning "'-version-info/-version-number' is ignored for archives"
6086
 
8702
 
6087
      test -n "$release" && \
8703
      test -n "$release" && \
6088
	func_warning "\`-release' is ignored for archives"
8704
	func_warning "'-release' is ignored for archives"
6089
 
8705
 
6090
      test -n "$export_symbols$export_symbols_regex" && \
8706
      test -n "$export_symbols$export_symbols_regex" && \
6091
	func_warning "\`-export-symbols' is ignored for archives"
8707
	func_warning "'-export-symbols' is ignored for archives"
6092
 
8708
 
6093
      # Now set the variables for building old libraries.
8709
      # Now set the variables for building old libraries.
6094
      build_libtool_libs=no
8710
      build_libtool_libs=no
6095
      oldlibs="$output"
8711
      oldlibs=$output
6096
      objs="$objs$old_deplibs"
8712
      func_append objs "$old_deplibs"
6097
      ;;
8713
      ;;
6098
 
8714
 
6099
    lib)
8715
    lib)
6100
      # Make sure we only generate libraries of the form `libNAME.la'.
8716
      # Make sure we only generate libraries of the form 'libNAME.la'.
6101
      case $outputname in
8717
      case $outputname in
6102
      lib*)
8718
      lib*)
6103
	func_stripname 'lib' '.la' "$outputname"
8719
	func_stripname 'lib' '.la' "$outputname"
6104
	name=$func_stripname_result
8720
	name=$func_stripname_result
6105
	eval shared_ext=\"$shrext_cmds\"
8721
	eval shared_ext=\"$shrext_cmds\"
6106
	eval libname=\"$libname_spec\"
8722
	eval libname=\"$libname_spec\"
6107
	;;
8723
	;;
6108
      *)
8724
      *)
6109
	test "$module" = no && \
8725
	test no = "$module" \
6110
	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
8726
	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
6111
 
8727
 
6112
	if test "$need_lib_prefix" != no; then
8728
	if test no != "$need_lib_prefix"; then
6113
	  # Add the "lib" prefix for modules if required
8729
	  # Add the "lib" prefix for modules if required
6114
	  func_stripname '' '.la' "$outputname"
8730
	  func_stripname '' '.la' "$outputname"
6115
	  name=$func_stripname_result
8731
	  name=$func_stripname_result
6116
	  eval shared_ext=\"$shrext_cmds\"
8732
	  eval shared_ext=\"$shrext_cmds\"
6117
	  eval libname=\"$libname_spec\"
8733
	  eval libname=\"$libname_spec\"
Line 6121... Line 8737...
6121
	fi
8737
	fi
6122
	;;
8738
	;;
6123
      esac
8739
      esac
6124
 
8740
 
6125
      if test -n "$objs"; then
8741
      if test -n "$objs"; then
6126
	if test "$deplibs_check_method" != pass_all; then
8742
	if test pass_all != "$deplibs_check_method"; then
6127
	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
8743
	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
6128
	else
8744
	else
6129
	  $ECHO
8745
	  echo
6130
	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
8746
	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6131
	  $ECHO "*** objects $objs is not portable!"
8747
	  $ECHO "*** objects $objs is not portable!"
6132
	  libobjs="$libobjs $objs"
8748
	  func_append libobjs " $objs"
6133
	fi
8749
	fi
6134
      fi
8750
      fi
6135
 
8751
 
6136
      test "$dlself" != no && \
8752
      test no = "$dlself" \
6137
	func_warning "\`-dlopen self' is ignored for libtool libraries"
8753
	|| func_warning "'-dlopen self' is ignored for libtool libraries"
6138
 
8754
 
6139
      set dummy $rpath
8755
      set dummy $rpath
6140
      shift
8756
      shift
6141
      test "$#" -gt 1 && \
8757
      test 1 -lt "$#" \
6142
	func_warning "ignoring multiple \`-rpath's for a libtool library"
8758
	&& func_warning "ignoring multiple '-rpath's for a libtool library"
6143
 
8759
 
6144
      install_libdir="$1"
8760
      install_libdir=$1
6145
 
8761
 
6146
      oldlibs=
8762
      oldlibs=
6147
      if test -z "$rpath"; then
8763
      if test -z "$rpath"; then
6148
	if test "$build_libtool_libs" = yes; then
8764
	if test yes = "$build_libtool_libs"; then
6149
	  # Building a libtool convenience library.
8765
	  # Building a libtool convenience library.
6150
	  # Some compilers have problems with a `.al' extension so
8766
	  # Some compilers have problems with a '.al' extension so
6151
	  # convenience libraries should have the same extension an
8767
	  # convenience libraries should have the same extension an
6152
	  # archive normally would.
8768
	  # archive normally would.
6153
	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
8769
	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
6154
	  build_libtool_libs=convenience
8770
	  build_libtool_libs=convenience
6155
	  build_old_libs=yes
8771
	  build_old_libs=yes
6156
	fi
8772
	fi
6157
 
8773
 
6158
	test -n "$vinfo" && \
8774
	test -n "$vinfo" && \
6159
	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
8775
	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
6160
 
8776
 
6161
	test -n "$release" && \
8777
	test -n "$release" && \
6162
	  func_warning "\`-release' is ignored for convenience libraries"
8778
	  func_warning "'-release' is ignored for convenience libraries"
6163
      else
8779
      else
6164
 
8780
 
6165
	# Parse the version information argument.
8781
	# Parse the version information argument.
6166
	save_ifs="$IFS"; IFS=':'
8782
	save_ifs=$IFS; IFS=:
6167
	set dummy $vinfo 0 0 0
8783
	set dummy $vinfo 0 0 0
6168
	shift
8784
	shift
6169
	IFS="$save_ifs"
8785
	IFS=$save_ifs
6170
 
8786
 
6171
	test -n "$7" && \
8787
	test -n "$7" && \
6172
	  func_fatal_help "too many parameters to \`-version-info'"
8788
	  func_fatal_help "too many parameters to '-version-info'"
6173
 
8789
 
6174
	# convert absolute version numbers to libtool ages
8790
	# convert absolute version numbers to libtool ages
6175
	# this retains compatibility with .la files and attempts
8791
	# this retains compatibility with .la files and attempts
6176
	# to make the code below a bit more comprehensible
8792
	# to make the code below a bit more comprehensible
6177
 
8793
 
6178
	case $vinfo_number in
8794
	case $vinfo_number in
6179
	yes)
8795
	yes)
6180
	  number_major="$1"
8796
	  number_major=$1
6181
	  number_minor="$2"
8797
	  number_minor=$2
6182
	  number_revision="$3"
8798
	  number_revision=$3
6183
	  #
8799
	  #
6184
	  # There are really only two kinds -- those that
8800
	  # There are really only two kinds -- those that
6185
	  # use the current revision as the major version
8801
	  # use the current revision as the major version
6186
	  # and those that subtract age and use age as
8802
	  # and those that subtract age and use age as
6187
	  # a minor version.  But, then there is irix
8803
	  # a minor version.  But, then there is irix
6188
	  # which has an extra 1 added just for fun
8804
	  # that has an extra 1 added just for fun
6189
	  #
8805
	  #
6190
	  case $version_type in
8806
	  case $version_type in
-
 
8807
	  # correct linux to gnu/linux during the next big refactor
6191
	  darwin|linux|osf|windows|none)
8808
	  darwin|freebsd-elf|linux|osf|windows|none)
6192
	    func_arith $number_major + $number_minor
8809
	    func_arith $number_major + $number_minor
6193
	    current=$func_arith_result
8810
	    current=$func_arith_result
6194
	    age="$number_minor"
8811
	    age=$number_minor
6195
	    revision="$number_revision"
8812
	    revision=$number_revision
6196
	    ;;
8813
	    ;;
6197
	  freebsd-aout|freebsd-elf|sunos)
8814
	  freebsd-aout|qnx|sunos)
6198
	    current="$number_major"
8815
	    current=$number_major
6199
	    revision="$number_minor"
8816
	    revision=$number_minor
6200
	    age="0"
8817
	    age=0
6201
	    ;;
8818
	    ;;
6202
	  irix|nonstopux)
8819
	  irix|nonstopux)
6203
	    func_arith $number_major + $number_minor
8820
	    func_arith $number_major + $number_minor
6204
	    current=$func_arith_result
8821
	    current=$func_arith_result
6205
	    age="$number_minor"
8822
	    age=$number_minor
6206
	    revision="$number_minor"
8823
	    revision=$number_minor
6207
	    lt_irix_increment=no
8824
	    lt_irix_increment=no
6208
	    ;;
8825
	    ;;
6209
	  esac
8826
	  esac
6210
	  ;;
8827
	  ;;
6211
	no)
8828
	no)
6212
	  current="$1"
8829
	  current=$1
6213
	  revision="$2"
8830
	  revision=$2
6214
	  age="$3"
8831
	  age=$3
6215
	  ;;
8832
	  ;;
6216
	esac
8833
	esac
6217
 
8834
 
6218
	# Check that each of the things are valid numbers.
8835
	# Check that each of the things are valid numbers.
6219
	case $current in
8836
	case $current in
6220
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
8837
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
6221
	*)
8838
	*)
6222
	  func_error "CURRENT \`$current' must be a nonnegative integer"
8839
	  func_error "CURRENT '$current' must be a nonnegative integer"
6223
	  func_fatal_error "\`$vinfo' is not valid version information"
8840
	  func_fatal_error "'$vinfo' is not valid version information"
6224
	  ;;
8841
	  ;;
6225
	esac
8842
	esac
6226
 
8843
 
6227
	case $revision in
8844
	case $revision in
6228
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
8845
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
6229
	*)
8846
	*)
6230
	  func_error "REVISION \`$revision' must be a nonnegative integer"
8847
	  func_error "REVISION '$revision' must be a nonnegative integer"
6231
	  func_fatal_error "\`$vinfo' is not valid version information"
8848
	  func_fatal_error "'$vinfo' is not valid version information"
6232
	  ;;
8849
	  ;;
6233
	esac
8850
	esac
6234
 
8851
 
6235
	case $age in
8852
	case $age in
6236
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
8853
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
6237
	*)
8854
	*)
6238
	  func_error "AGE \`$age' must be a nonnegative integer"
8855
	  func_error "AGE '$age' must be a nonnegative integer"
6239
	  func_fatal_error "\`$vinfo' is not valid version information"
8856
	  func_fatal_error "'$vinfo' is not valid version information"
6240
	  ;;
8857
	  ;;
6241
	esac
8858
	esac
6242
 
8859
 
6243
	if test "$age" -gt "$current"; then
8860
	if test "$age" -gt "$current"; then
6244
	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
8861
	  func_error "AGE '$age' is greater than the current interface number '$current'"
6245
	  func_fatal_error "\`$vinfo' is not valid version information"
8862
	  func_fatal_error "'$vinfo' is not valid version information"
6246
	fi
8863
	fi
6247
 
8864
 
6248
	# Calculate the version variables.
8865
	# Calculate the version variables.
6249
	major=
8866
	major=
6250
	versuffix=
8867
	versuffix=
Line 6255... Line 8872...
6255
	darwin)
8872
	darwin)
6256
	  # Like Linux, but with the current version available in
8873
	  # Like Linux, but with the current version available in
6257
	  # verstring for coding it into the library header
8874
	  # verstring for coding it into the library header
6258
	  func_arith $current - $age
8875
	  func_arith $current - $age
6259
	  major=.$func_arith_result
8876
	  major=.$func_arith_result
6260
	  versuffix="$major.$age.$revision"
8877
	  versuffix=$major.$age.$revision
6261
	  # Darwin ld doesn't like 0 for these options...
8878
	  # Darwin ld doesn't like 0 for these options...
6262
	  func_arith $current + 1
8879
	  func_arith $current + 1
6263
	  minor_current=$func_arith_result
8880
	  minor_current=$func_arith_result
6264
	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
8881
	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
6265
	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
8882
	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
-
 
8883
          # On Darwin other compilers
-
 
8884
          case $CC in
-
 
8885
              nagfor*)
-
 
8886
                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
-
 
8887
                  ;;
-
 
8888
              *)
-
 
8889
                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
-
 
8890
                  ;;
-
 
8891
          esac
6266
	  ;;
8892
	  ;;
6267
 
8893
 
6268
	freebsd-aout)
8894
	freebsd-aout)
6269
	  major=".$current"
8895
	  major=.$current
6270
	  versuffix=".$current.$revision";
8896
	  versuffix=.$current.$revision
6271
	  ;;
8897
	  ;;
6272
 
8898
 
6273
	freebsd-elf)
8899
	freebsd-elf)
-
 
8900
	  func_arith $current - $age
6274
	  major=".$current"
8901
	  major=.$func_arith_result
6275
	  versuffix=".$current"
8902
	  versuffix=$major.$age.$revision
6276
	  ;;
8903
	  ;;
6277
 
8904
 
6278
	irix | nonstopux)
8905
	irix | nonstopux)
6279
	  if test "X$lt_irix_increment" = "Xno"; then
8906
	  if test no = "$lt_irix_increment"; then
6280
	    func_arith $current - $age
8907
	    func_arith $current - $age
6281
	  else
8908
	  else
6282
	    func_arith $current - $age + 1
8909
	    func_arith $current - $age + 1
6283
	  fi
8910
	  fi
6284
	  major=$func_arith_result
8911
	  major=$func_arith_result
6285
 
8912
 
6286
	  case $version_type in
8913
	  case $version_type in
6287
	    nonstopux) verstring_prefix=nonstopux ;;
8914
	    nonstopux) verstring_prefix=nonstopux ;;
6288
	    *)         verstring_prefix=sgi ;;
8915
	    *)         verstring_prefix=sgi ;;
6289
	  esac
8916
	  esac
6290
	  verstring="$verstring_prefix$major.$revision"
8917
	  verstring=$verstring_prefix$major.$revision
6291
 
8918
 
6292
	  # Add in all the interfaces that we are compatible with.
8919
	  # Add in all the interfaces that we are compatible with.
6293
	  loop=$revision
8920
	  loop=$revision
6294
	  while test "$loop" -ne 0; do
8921
	  while test 0 -ne "$loop"; do
6295
	    func_arith $revision - $loop
8922
	    func_arith $revision - $loop
6296
	    iface=$func_arith_result
8923
	    iface=$func_arith_result
6297
	    func_arith $loop - 1
8924
	    func_arith $loop - 1
6298
	    loop=$func_arith_result
8925
	    loop=$func_arith_result
6299
	    verstring="$verstring_prefix$major.$iface:$verstring"
8926
	    verstring=$verstring_prefix$major.$iface:$verstring
6300
	  done
8927
	  done
6301
 
8928
 
6302
	  # Before this point, $major must not contain `.'.
8929
	  # Before this point, $major must not contain '.'.
6303
	  major=.$major
8930
	  major=.$major
6304
	  versuffix="$major.$revision"
8931
	  versuffix=$major.$revision
6305
	  ;;
8932
	  ;;
6306
 
8933
 
6307
	linux)
8934
	linux) # correct to gnu/linux during the next big refactor
6308
	  func_arith $current - $age
8935
	  func_arith $current - $age
6309
	  major=.$func_arith_result
8936
	  major=.$func_arith_result
6310
	  versuffix="$major.$age.$revision"
8937
	  versuffix=$major.$age.$revision
6311
	  ;;
8938
	  ;;
6312
 
8939
 
6313
	osf)
8940
	osf)
6314
	  func_arith $current - $age
8941
	  func_arith $current - $age
6315
	  major=.$func_arith_result
8942
	  major=.$func_arith_result
6316
	  versuffix=".$current.$age.$revision"
8943
	  versuffix=.$current.$age.$revision
6317
	  verstring="$current.$age.$revision"
8944
	  verstring=$current.$age.$revision
6318
 
8945
 
6319
	  # Add in all the interfaces that we are compatible with.
8946
	  # Add in all the interfaces that we are compatible with.
6320
	  loop=$age
8947
	  loop=$age
6321
	  while test "$loop" -ne 0; do
8948
	  while test 0 -ne "$loop"; do
6322
	    func_arith $current - $loop
8949
	    func_arith $current - $loop
6323
	    iface=$func_arith_result
8950
	    iface=$func_arith_result
6324
	    func_arith $loop - 1
8951
	    func_arith $loop - 1
6325
	    loop=$func_arith_result
8952
	    loop=$func_arith_result
6326
	    verstring="$verstring:${iface}.0"
8953
	    verstring=$verstring:$iface.0
6327
	  done
8954
	  done
6328
 
8955
 
6329
	  # Make executables depend on our current version.
8956
	  # Make executables depend on our current version.
6330
	  verstring="$verstring:${current}.0"
8957
	  func_append verstring ":$current.0"
6331
	  ;;
8958
	  ;;
6332
 
8959
 
6333
	qnx)
8960
	qnx)
6334
	  major=".$current"
8961
	  major=.$current
-
 
8962
	  versuffix=.$current
-
 
8963
	  ;;
-
 
8964
 
-
 
8965
	sco)
-
 
8966
	  major=.$current
6335
	  versuffix=".$current"
8967
	  versuffix=.$current
6336
	  ;;
8968
	  ;;
6337
 
8969
 
6338
	sunos)
8970
	sunos)
6339
	  major=".$current"
8971
	  major=.$current
6340
	  versuffix=".$current.$revision"
8972
	  versuffix=.$current.$revision
6341
	  ;;
8973
	  ;;
6342
 
8974
 
6343
	windows)
8975
	windows)
6344
	  # Use '-' rather than '.', since we only want one
8976
	  # Use '-' rather than '.', since we only want one
6345
	  # extension on DOS 8.3 filesystems.
8977
	  # extension on DOS 8.3 file systems.
6346
	  func_arith $current - $age
8978
	  func_arith $current - $age
6347
	  major=$func_arith_result
8979
	  major=$func_arith_result
6348
	  versuffix="-$major"
8980
	  versuffix=-$major
6349
	  ;;
8981
	  ;;
6350
 
8982
 
6351
	*)
8983
	*)
6352
	  func_fatal_configuration "unknown library version type \`$version_type'"
8984
	  func_fatal_configuration "unknown library version type '$version_type'"
6353
	  ;;
8985
	  ;;
6354
	esac
8986
	esac
6355
 
8987
 
6356
	# Clear the version info if we defaulted, and they specified a release.
8988
	# Clear the version info if we defaulted, and they specified a release.
6357
	if test -z "$vinfo" && test -n "$release"; then
8989
	if test -z "$vinfo" && test -n "$release"; then
Line 6361... Line 8993...
6361
	    # we can't check for "0.0" in archive_cmds due to quoting
8993
	    # we can't check for "0.0" in archive_cmds due to quoting
6362
	    # problems, so we reset it completely
8994
	    # problems, so we reset it completely
6363
	    verstring=
8995
	    verstring=
6364
	    ;;
8996
	    ;;
6365
	  *)
8997
	  *)
6366
	    verstring="0.0"
8998
	    verstring=0.0
6367
	    ;;
8999
	    ;;
6368
	  esac
9000
	  esac
6369
	  if test "$need_version" = no; then
9001
	  if test no = "$need_version"; then
6370
	    versuffix=
9002
	    versuffix=
6371
	  else
9003
	  else
6372
	    versuffix=".0.0"
9004
	    versuffix=.0.0
6373
	  fi
9005
	  fi
6374
	fi
9006
	fi
6375
 
9007
 
6376
	# Remove version info from name if versioning should be avoided
9008
	# Remove version info from name if versioning should be avoided
6377
	if test "$avoid_version" = yes && test "$need_version" = no; then
9009
	if test yes,no = "$avoid_version,$need_version"; then
6378
	  major=
9010
	  major=
6379
	  versuffix=
9011
	  versuffix=
6380
	  verstring=""
9012
	  verstring=
6381
	fi
9013
	fi
6382
 
9014
 
6383
	# Check to see if the archive will have undefined symbols.
9015
	# Check to see if the archive will have undefined symbols.
6384
	if test "$allow_undefined" = yes; then
9016
	if test yes = "$allow_undefined"; then
6385
	  if test "$allow_undefined_flag" = unsupported; then
9017
	  if test unsupported = "$allow_undefined_flag"; then
-
 
9018
	    if test yes = "$build_old_libs"; then
6386
	    func_warning "undefined symbols not allowed in $host shared libraries"
9019
	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
6387
	    build_libtool_libs=no
9020
	      build_libtool_libs=no
6388
	    build_old_libs=yes
9021
	    else
-
 
9022
	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
-
 
9023
	    fi
6389
	  fi
9024
	  fi
6390
	else
9025
	else
6391
	  # Don't allow undefined symbols.
9026
	  # Don't allow undefined symbols.
6392
	  allow_undefined_flag="$no_undefined_flag"
9027
	  allow_undefined_flag=$no_undefined_flag
6393
	fi
9028
	fi
6394
 
9029
 
6395
      fi
9030
      fi
6396
 
9031
 
6397
      func_generate_dlsyms "$libname" "$libname" "yes"
9032
      func_generate_dlsyms "$libname" "$libname" :
6398
      libobjs="$libobjs $symfileobj"
9033
      func_append libobjs " $symfileobj"
6399
      test "X$libobjs" = "X " && libobjs=
9034
      test " " = "$libobjs" && libobjs=
6400
 
9035
 
6401
      if test "$mode" != relink; then
9036
      if test relink != "$opt_mode"; then
6402
	# Remove our outputs, but don't remove object files since they
9037
	# Remove our outputs, but don't remove object files since they
6403
	# may have been created when compiling PIC objects.
9038
	# may have been created when compiling PIC objects.
6404
	removelist=
9039
	removelist=
6405
	tempremovelist=`$ECHO "$output_objdir/*"`
9040
	tempremovelist=`$ECHO "$output_objdir/*"`
6406
	for p in $tempremovelist; do
9041
	for p in $tempremovelist; do
6407
	  case $p in
9042
	  case $p in
6408
	    *.$objext | *.gcno)
9043
	    *.$objext | *.gcno)
6409
	       ;;
9044
	       ;;
6410
	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
9045
	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
6411
	       if test "X$precious_files_regex" != "X"; then
9046
	       if test -n "$precious_files_regex"; then
6412
		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
9047
		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
6413
		 then
9048
		 then
6414
		   continue
9049
		   continue
6415
		 fi
9050
		 fi
6416
	       fi
9051
	       fi
6417
	       removelist="$removelist $p"
9052
	       func_append removelist " $p"
6418
	       ;;
9053
	       ;;
6419
	    *) ;;
9054
	    *) ;;
6420
	  esac
9055
	  esac
6421
	done
9056
	done
6422
	test -n "$removelist" && \
9057
	test -n "$removelist" && \
6423
	  func_show_eval "${RM}r \$removelist"
9058
	  func_show_eval "${RM}r \$removelist"
6424
      fi
9059
      fi
6425
 
9060
 
6426
      # Now set the variables for building old libraries.
9061
      # Now set the variables for building old libraries.
6427
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
9062
      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
6428
	oldlibs="$oldlibs $output_objdir/$libname.$libext"
9063
	func_append oldlibs " $output_objdir/$libname.$libext"
6429
 
9064
 
6430
	# Transform .lo files to .o files.
9065
	# Transform .lo files to .o files.
6431
	oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
9066
	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
6432
      fi
9067
      fi
6433
 
9068
 
6434
      # Eliminate all temporary directories.
9069
      # Eliminate all temporary directories.
6435
      #for path in $notinst_path; do
9070
      #for path in $notinst_path; do
6436
      #	lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
9071
      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
6437
      #	deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
9072
      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
6438
      #	dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
9073
      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
6439
      #done
9074
      #done
6440
 
9075
 
6441
      if test -n "$xrpath"; then
9076
      if test -n "$xrpath"; then
6442
	# If the user specified any rpath flags, then add them.
9077
	# If the user specified any rpath flags, then add them.
6443
	temp_xrpath=
9078
	temp_xrpath=
6444
	for libdir in $xrpath; do
9079
	for libdir in $xrpath; do
6445
	  temp_xrpath="$temp_xrpath -R$libdir"
9080
	  func_replace_sysroot "$libdir"
-
 
9081
	  func_append temp_xrpath " -R$func_replace_sysroot_result"
6446
	  case "$finalize_rpath " in
9082
	  case "$finalize_rpath " in
6447
	  *" $libdir "*) ;;
9083
	  *" $libdir "*) ;;
6448
	  *) finalize_rpath="$finalize_rpath $libdir" ;;
9084
	  *) func_append finalize_rpath " $libdir" ;;
6449
	  esac
9085
	  esac
6450
	done
9086
	done
6451
	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
9087
	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
6452
	  dependency_libs="$temp_xrpath $dependency_libs"
9088
	  dependency_libs="$temp_xrpath $dependency_libs"
6453
	fi
9089
	fi
6454
      fi
9090
      fi
6455
 
9091
 
6456
      # Make sure dlfiles contains only unique files that won't be dlpreopened
9092
      # Make sure dlfiles contains only unique files that won't be dlpreopened
6457
      old_dlfiles="$dlfiles"
9093
      old_dlfiles=$dlfiles
6458
      dlfiles=
9094
      dlfiles=
6459
      for lib in $old_dlfiles; do
9095
      for lib in $old_dlfiles; do
6460
	case " $dlprefiles $dlfiles " in
9096
	case " $dlprefiles $dlfiles " in
6461
	*" $lib "*) ;;
9097
	*" $lib "*) ;;
6462
	*) dlfiles="$dlfiles $lib" ;;
9098
	*) func_append dlfiles " $lib" ;;
6463
	esac
9099
	esac
6464
      done
9100
      done
6465
 
9101
 
6466
      # Make sure dlprefiles contains only unique files
9102
      # Make sure dlprefiles contains only unique files
6467
      old_dlprefiles="$dlprefiles"
9103
      old_dlprefiles=$dlprefiles
6468
      dlprefiles=
9104
      dlprefiles=
6469
      for lib in $old_dlprefiles; do
9105
      for lib in $old_dlprefiles; do
6470
	case "$dlprefiles " in
9106
	case "$dlprefiles " in
6471
	*" $lib "*) ;;
9107
	*" $lib "*) ;;
6472
	*) dlprefiles="$dlprefiles $lib" ;;
9108
	*) func_append dlprefiles " $lib" ;;
6473
	esac
9109
	esac
6474
      done
9110
      done
6475
 
9111
 
6476
      if test "$build_libtool_libs" = yes; then
9112
      if test yes = "$build_libtool_libs"; then
6477
	if test -n "$rpath"; then
9113
	if test -n "$rpath"; then
6478
	  case $host in
9114
	  case $host in
6479
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
9115
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
6480
	    # these systems don't actually have a c library (as such)!
9116
	    # these systems don't actually have a c library (as such)!
6481
	    ;;
9117
	    ;;
6482
	  *-*-rhapsody* | *-*-darwin1.[012])
9118
	  *-*-rhapsody* | *-*-darwin1.[012])
6483
	    # Rhapsody C library is in the System framework
9119
	    # Rhapsody C library is in the System framework
6484
	    deplibs="$deplibs System.ltframework"
9120
	    func_append deplibs " System.ltframework"
6485
	    ;;
9121
	    ;;
6486
	  *-*-netbsd*)
9122
	  *-*-netbsd*)
6487
	    # Don't link with libc until the a.out ld.so is fixed.
9123
	    # Don't link with libc until the a.out ld.so is fixed.
6488
	    ;;
9124
	    ;;
6489
	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
9125
	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
Line 6495... Line 9131...
6495
	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
9131
	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6496
	    # Compiler inserts libc in the correct place for threads to work
9132
	    # Compiler inserts libc in the correct place for threads to work
6497
	    ;;
9133
	    ;;
6498
	  *)
9134
	  *)
6499
	    # Add libc to deplibs on all other systems if necessary.
9135
	    # Add libc to deplibs on all other systems if necessary.
6500
	    if test "$build_libtool_need_lc" = "yes"; then
9136
	    if test yes = "$build_libtool_need_lc"; then
6501
	      deplibs="$deplibs -lc"
9137
	      func_append deplibs " -lc"
6502
	    fi
9138
	    fi
6503
	    ;;
9139
	    ;;
6504
	  esac
9140
	  esac
6505
	fi
9141
	fi
6506
 
9142
 
Line 6511... Line 9147...
6511
	versuffix_save=$versuffix
9147
	versuffix_save=$versuffix
6512
	major_save=$major
9148
	major_save=$major
6513
	# I'm not sure if I'm treating the release correctly.  I think
9149
	# I'm not sure if I'm treating the release correctly.  I think
6514
	# release should show up in the -l (ie -lgmp5) so we don't want to
9150
	# release should show up in the -l (ie -lgmp5) so we don't want to
6515
	# add it in twice.  Is that correct?
9151
	# add it in twice.  Is that correct?
6516
	release=""
9152
	release=
6517
	versuffix=""
9153
	versuffix=
6518
	major=""
9154
	major=
6519
	newdeplibs=
9155
	newdeplibs=
6520
	droppeddeps=no
9156
	droppeddeps=no
6521
	case $deplibs_check_method in
9157
	case $deplibs_check_method in
6522
	pass_all)
9158
	pass_all)
6523
	  # Don't check for shared/static.  Everything works.
9159
	  # Don't check for shared/static.  Everything works.
Line 6542... Line 9178...
6542
	    for i in $deplibs; do
9178
	    for i in $deplibs; do
6543
	      case $i in
9179
	      case $i in
6544
	      -l*)
9180
	      -l*)
6545
		func_stripname -l '' "$i"
9181
		func_stripname -l '' "$i"
6546
		name=$func_stripname_result
9182
		name=$func_stripname_result
6547
		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
9183
		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
6548
		  case " $predeps $postdeps " in
9184
		  case " $predeps $postdeps " in
6549
		  *" $i "*)
9185
		  *" $i "*)
6550
		    newdeplibs="$newdeplibs $i"
9186
		    func_append newdeplibs " $i"
6551
		    i=""
9187
		    i=
6552
		    ;;
9188
		    ;;
6553
		  esac
9189
		  esac
6554
		fi
9190
		fi
6555
		if test -n "$i" ; then
9191
		if test -n "$i"; then
6556
		  libname=`eval "\\$ECHO \"$libname_spec\""`
9192
		  libname=`eval "\\$ECHO \"$libname_spec\""`
6557
		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9193
		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6558
		  set dummy $deplib_matches; shift
9194
		  set dummy $deplib_matches; shift
6559
		  deplib_match=$1
9195
		  deplib_match=$1
6560
		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
9196
		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
6561
		    newdeplibs="$newdeplibs $i"
9197
		    func_append newdeplibs " $i"
6562
		  else
9198
		  else
6563
		    droppeddeps=yes
9199
		    droppeddeps=yes
6564
		    $ECHO
9200
		    echo
6565
		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
9201
		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6566
		    $ECHO "*** I have the capability to make that library automatically link in when"
9202
		    echo "*** I have the capability to make that library automatically link in when"
6567
		    $ECHO "*** you link to this library.  But I can only do this if you have a"
9203
		    echo "*** you link to this library.  But I can only do this if you have a"
6568
		    $ECHO "*** shared version of the library, which I believe you do not have"
9204
		    echo "*** shared version of the library, which I believe you do not have"
6569
		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
9205
		    echo "*** because a test_compile did reveal that the linker did not use it for"
6570
		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
9206
		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
6571
		  fi
9207
		  fi
6572
		fi
9208
		fi
6573
		;;
9209
		;;
6574
	      *)
9210
	      *)
6575
		newdeplibs="$newdeplibs $i"
9211
		func_append newdeplibs " $i"
6576
		;;
9212
		;;
6577
	      esac
9213
	      esac
6578
	    done
9214
	    done
6579
	  else
9215
	  else
6580
	    # Error occurred in the first compile.  Let's try to salvage
9216
	    # Error occurred in the first compile.  Let's try to salvage
Line 6585... Line 9221...
6585
		func_stripname -l '' "$i"
9221
		func_stripname -l '' "$i"
6586
		name=$func_stripname_result
9222
		name=$func_stripname_result
6587
		$opt_dry_run || $RM conftest
9223
		$opt_dry_run || $RM conftest
6588
		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
9224
		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
6589
		  ldd_output=`ldd conftest`
9225
		  ldd_output=`ldd conftest`
6590
		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
9226
		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
6591
		    case " $predeps $postdeps " in
9227
		    case " $predeps $postdeps " in
6592
		    *" $i "*)
9228
		    *" $i "*)
6593
		      newdeplibs="$newdeplibs $i"
9229
		      func_append newdeplibs " $i"
6594
		      i=""
9230
		      i=
6595
		      ;;
9231
		      ;;
6596
		    esac
9232
		    esac
6597
		  fi
9233
		  fi
6598
		  if test -n "$i" ; then
9234
		  if test -n "$i"; then
6599
		    libname=`eval "\\$ECHO \"$libname_spec\""`
9235
		    libname=`eval "\\$ECHO \"$libname_spec\""`
6600
		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9236
		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
6601
		    set dummy $deplib_matches; shift
9237
		    set dummy $deplib_matches; shift
6602
		    deplib_match=$1
9238
		    deplib_match=$1
6603
		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
9239
		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
6604
		      newdeplibs="$newdeplibs $i"
9240
		      func_append newdeplibs " $i"
6605
		    else
9241
		    else
6606
		      droppeddeps=yes
9242
		      droppeddeps=yes
6607
		      $ECHO
9243
		      echo
6608
		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
9244
		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6609
		      $ECHO "*** I have the capability to make that library automatically link in when"
9245
		      echo "*** I have the capability to make that library automatically link in when"
6610
		      $ECHO "*** you link to this library.  But I can only do this if you have a"
9246
		      echo "*** you link to this library.  But I can only do this if you have a"
6611
		      $ECHO "*** shared version of the library, which you do not appear to have"
9247
		      echo "*** shared version of the library, which you do not appear to have"
6612
		      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
9248
		      echo "*** because a test_compile did reveal that the linker did not use this one"
6613
		      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
9249
		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
6614
		    fi
9250
		    fi
6615
		  fi
9251
		  fi
6616
		else
9252
		else
6617
		  droppeddeps=yes
9253
		  droppeddeps=yes
6618
		  $ECHO
9254
		  echo
6619
		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
9255
		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
6620
		  $ECHO "*** make it link in!  You will probably need to install it or some"
9256
		  echo "*** make it link in!  You will probably need to install it or some"
6621
		  $ECHO "*** library that it depends on before this library will be fully"
9257
		  echo "*** library that it depends on before this library will be fully"
6622
		  $ECHO "*** functional.  Installing it before continuing would be even better."
9258
		  echo "*** functional.  Installing it before continuing would be even better."
6623
		fi
9259
		fi
6624
		;;
9260
		;;
6625
	      *)
9261
	      *)
6626
		newdeplibs="$newdeplibs $i"
9262
		func_append newdeplibs " $i"
6627
		;;
9263
		;;
6628
	      esac
9264
	      esac
6629
	    done
9265
	    done
6630
	  fi
9266
	  fi
6631
	  ;;
9267
	  ;;
Line 6635... Line 9271...
6635
	  for a_deplib in $deplibs; do
9271
	  for a_deplib in $deplibs; do
6636
	    case $a_deplib in
9272
	    case $a_deplib in
6637
	    -l*)
9273
	    -l*)
6638
	      func_stripname -l '' "$a_deplib"
9274
	      func_stripname -l '' "$a_deplib"
6639
	      name=$func_stripname_result
9275
	      name=$func_stripname_result
6640
	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
9276
	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
6641
		case " $predeps $postdeps " in
9277
		case " $predeps $postdeps " in
6642
		*" $a_deplib "*)
9278
		*" $a_deplib "*)
6643
		  newdeplibs="$newdeplibs $a_deplib"
9279
		  func_append newdeplibs " $a_deplib"
6644
		  a_deplib=""
9280
		  a_deplib=
6645
		  ;;
9281
		  ;;
6646
		esac
9282
		esac
6647
	      fi
9283
	      fi
6648
	      if test -n "$a_deplib" ; then
9284
	      if test -n "$a_deplib"; then
6649
		libname=`eval "\\$ECHO \"$libname_spec\""`
9285
		libname=`eval "\\$ECHO \"$libname_spec\""`
-
 
9286
		if test -n "$file_magic_glob"; then
-
 
9287
		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
-
 
9288
		else
-
 
9289
		  libnameglob=$libname
-
 
9290
		fi
-
 
9291
		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
6650
		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9292
		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-
 
9293
		  if test yes = "$want_nocaseglob"; then
-
 
9294
		    shopt -s nocaseglob
6651
		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
9295
		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-
 
9296
		    $nocaseglob
-
 
9297
		  else
-
 
9298
		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
-
 
9299
		  fi
6652
		  for potent_lib in $potential_libs; do
9300
		  for potent_lib in $potential_libs; do
6653
		      # Follow soft links.
9301
		      # Follow soft links.
6654
		      if ls -lLd "$potent_lib" 2>/dev/null |
9302
		      if ls -lLd "$potent_lib" 2>/dev/null |
6655
			 $GREP " -> " >/dev/null; then
9303
			 $GREP " -> " >/dev/null; then
6656
			continue
9304
			continue
Line 6658... Line 9306...
6658
		      # The statement above tries to avoid entering an
9306
		      # The statement above tries to avoid entering an
6659
		      # endless loop below, in case of cyclic links.
9307
		      # endless loop below, in case of cyclic links.
6660
		      # We might still enter an endless loop, since a link
9308
		      # We might still enter an endless loop, since a link
6661
		      # loop can be closed while we follow links,
9309
		      # loop can be closed while we follow links,
6662
		      # but so what?
9310
		      # but so what?
6663
		      potlib="$potent_lib"
9311
		      potlib=$potent_lib
6664
		      while test -h "$potlib" 2>/dev/null; do
9312
		      while test -h "$potlib" 2>/dev/null; do
6665
			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
9313
			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
6666
			case $potliblink in
9314
			case $potliblink in
6667
			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
9315
			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
6668
			*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
9316
			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
6669
			esac
9317
			esac
6670
		      done
9318
		      done
6671
		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
9319
		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
6672
			 $SED -e 10q |
9320
			 $SED -e 10q |
6673
			 $EGREP "$file_magic_regex" > /dev/null; then
9321
			 $EGREP "$file_magic_regex" > /dev/null; then
6674
			newdeplibs="$newdeplibs $a_deplib"
9322
			func_append newdeplibs " $a_deplib"
6675
			a_deplib=""
9323
			a_deplib=
6676
			break 2
9324
			break 2
6677
		      fi
9325
		      fi
6678
		  done
9326
		  done
6679
		done
9327
		done
6680
	      fi
9328
	      fi
6681
	      if test -n "$a_deplib" ; then
9329
	      if test -n "$a_deplib"; then
6682
		droppeddeps=yes
9330
		droppeddeps=yes
6683
		$ECHO
9331
		echo
6684
		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9332
		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6685
		$ECHO "*** I have the capability to make that library automatically link in when"
9333
		echo "*** I have the capability to make that library automatically link in when"
6686
		$ECHO "*** you link to this library.  But I can only do this if you have a"
9334
		echo "*** you link to this library.  But I can only do this if you have a"
6687
		$ECHO "*** shared version of the library, which you do not appear to have"
9335
		echo "*** shared version of the library, which you do not appear to have"
6688
		$ECHO "*** because I did check the linker path looking for a file starting"
9336
		echo "*** because I did check the linker path looking for a file starting"
6689
		if test -z "$potlib" ; then
9337
		if test -z "$potlib"; then
6690
		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
9338
		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
6691
		else
9339
		else
6692
		  $ECHO "*** with $libname and none of the candidates passed a file format test"
9340
		  $ECHO "*** with $libname and none of the candidates passed a file format test"
6693
		  $ECHO "*** using a file magic. Last file checked: $potlib"
9341
		  $ECHO "*** using a file magic. Last file checked: $potlib"
6694
		fi
9342
		fi
6695
	      fi
9343
	      fi
6696
	      ;;
9344
	      ;;
6697
	    *)
9345
	    *)
6698
	      # Add a -L argument.
9346
	      # Add a -L argument.
6699
	      newdeplibs="$newdeplibs $a_deplib"
9347
	      func_append newdeplibs " $a_deplib"
6700
	      ;;
9348
	      ;;
6701
	    esac
9349
	    esac
6702
	  done # Gone through all deplibs.
9350
	  done # Gone through all deplibs.
6703
	  ;;
9351
	  ;;
6704
	match_pattern*)
9352
	match_pattern*)
Line 6707... Line 9355...
6707
	  for a_deplib in $deplibs; do
9355
	  for a_deplib in $deplibs; do
6708
	    case $a_deplib in
9356
	    case $a_deplib in
6709
	    -l*)
9357
	    -l*)
6710
	      func_stripname -l '' "$a_deplib"
9358
	      func_stripname -l '' "$a_deplib"
6711
	      name=$func_stripname_result
9359
	      name=$func_stripname_result
6712
	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
9360
	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
6713
		case " $predeps $postdeps " in
9361
		case " $predeps $postdeps " in
6714
		*" $a_deplib "*)
9362
		*" $a_deplib "*)
6715
		  newdeplibs="$newdeplibs $a_deplib"
9363
		  func_append newdeplibs " $a_deplib"
6716
		  a_deplib=""
9364
		  a_deplib=
6717
		  ;;
9365
		  ;;
6718
		esac
9366
		esac
6719
	      fi
9367
	      fi
6720
	      if test -n "$a_deplib" ; then
9368
	      if test -n "$a_deplib"; then
6721
		libname=`eval "\\$ECHO \"$libname_spec\""`
9369
		libname=`eval "\\$ECHO \"$libname_spec\""`
6722
		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9370
		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6723
		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
9371
		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6724
		  for potent_lib in $potential_libs; do
9372
		  for potent_lib in $potential_libs; do
6725
		    potlib="$potent_lib" # see symlink-check above in file_magic test
9373
		    potlib=$potent_lib # see symlink-check above in file_magic test
6726
		    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
9374
		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
6727
		       $EGREP "$match_pattern_regex" > /dev/null; then
9375
		       $EGREP "$match_pattern_regex" > /dev/null; then
6728
		      newdeplibs="$newdeplibs $a_deplib"
9376
		      func_append newdeplibs " $a_deplib"
6729
		      a_deplib=""
9377
		      a_deplib=
6730
		      break 2
9378
		      break 2
6731
		    fi
9379
		    fi
6732
		  done
9380
		  done
6733
		done
9381
		done
6734
	      fi
9382
	      fi
6735
	      if test -n "$a_deplib" ; then
9383
	      if test -n "$a_deplib"; then
6736
		droppeddeps=yes
9384
		droppeddeps=yes
6737
		$ECHO
9385
		echo
6738
		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9386
		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6739
		$ECHO "*** I have the capability to make that library automatically link in when"
9387
		echo "*** I have the capability to make that library automatically link in when"
6740
		$ECHO "*** you link to this library.  But I can only do this if you have a"
9388
		echo "*** you link to this library.  But I can only do this if you have a"
6741
		$ECHO "*** shared version of the library, which you do not appear to have"
9389
		echo "*** shared version of the library, which you do not appear to have"
6742
		$ECHO "*** because I did check the linker path looking for a file starting"
9390
		echo "*** because I did check the linker path looking for a file starting"
6743
		if test -z "$potlib" ; then
9391
		if test -z "$potlib"; then
6744
		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
9392
		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
6745
		else
9393
		else
6746
		  $ECHO "*** with $libname and none of the candidates passed a file format test"
9394
		  $ECHO "*** with $libname and none of the candidates passed a file format test"
6747
		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
9395
		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
6748
		fi
9396
		fi
6749
	      fi
9397
	      fi
6750
	      ;;
9398
	      ;;
6751
	    *)
9399
	    *)
6752
	      # Add a -L argument.
9400
	      # Add a -L argument.
6753
	      newdeplibs="$newdeplibs $a_deplib"
9401
	      func_append newdeplibs " $a_deplib"
6754
	      ;;
9402
	      ;;
6755
	    esac
9403
	    esac
6756
	  done # Gone through all deplibs.
9404
	  done # Gone through all deplibs.
6757
	  ;;
9405
	  ;;
6758
	none | unknown | *)
9406
	none | unknown | *)
6759
	  newdeplibs=""
9407
	  newdeplibs=
6760
	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
9408
	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
6761
	      -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
-
 
6762
	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
9409
	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
6763
	    for i in $predeps $postdeps ; do
9410
	    for i in $predeps $postdeps; do
6764
	      # can't use Xsed below, because $i might contain '/'
9411
	      # can't use Xsed below, because $i might contain '/'
6765
	      tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
9412
	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
6766
	    done
9413
	    done
6767
	  fi
9414
	  fi
6768
	  if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[	 ]//g' |
9415
	  case $tmp_deplibs in
6769
	     $GREP . >/dev/null; then
9416
	  *[!\	\ ]*)
6770
	    $ECHO
9417
	    echo
6771
	    if test "X$deplibs_check_method" = "Xnone"; then
9418
	    if test none = "$deplibs_check_method"; then
6772
	      $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
9419
	      echo "*** Warning: inter-library dependencies are not supported in this platform."
6773
	    else
9420
	    else
6774
	      $ECHO "*** Warning: inter-library dependencies are not known to be supported."
9421
	      echo "*** Warning: inter-library dependencies are not known to be supported."
6775
	    fi
9422
	    fi
6776
	    $ECHO "*** All declared inter-library dependencies are being dropped."
9423
	    echo "*** All declared inter-library dependencies are being dropped."
6777
	    droppeddeps=yes
9424
	    droppeddeps=yes
-
 
9425
	    ;;
6778
	  fi
9426
	  esac
6779
	  ;;
9427
	  ;;
6780
	esac
9428
	esac
6781
	versuffix=$versuffix_save
9429
	versuffix=$versuffix_save
6782
	major=$major_save
9430
	major=$major_save
6783
	release=$release_save
9431
	release=$release_save
Line 6785... Line 9433...
6785
	name=$name_save
9433
	name=$name_save
6786
 
9434
 
6787
	case $host in
9435
	case $host in
6788
	*-*-rhapsody* | *-*-darwin1.[012])
9436
	*-*-rhapsody* | *-*-darwin1.[012])
6789
	  # On Rhapsody replace the C library with the System framework
9437
	  # On Rhapsody replace the C library with the System framework
6790
	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
9438
	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
6791
	  ;;
9439
	  ;;
6792
	esac
9440
	esac
6793
 
9441
 
6794
	if test "$droppeddeps" = yes; then
9442
	if test yes = "$droppeddeps"; then
6795
	  if test "$module" = yes; then
9443
	  if test yes = "$module"; then
6796
	    $ECHO
9444
	    echo
6797
	    $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
9445
	    echo "*** Warning: libtool could not satisfy all declared inter-library"
6798
	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
9446
	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
6799
	    $ECHO "*** a static module, that should work as long as the dlopening"
9447
	    echo "*** a static module, that should work as long as the dlopening"
6800
	    $ECHO "*** application is linked with the -dlopen flag."
9448
	    echo "*** application is linked with the -dlopen flag."
6801
	    if test -z "$global_symbol_pipe"; then
9449
	    if test -z "$global_symbol_pipe"; then
6802
	      $ECHO
9450
	      echo
6803
	      $ECHO "*** However, this would only work if libtool was able to extract symbol"
9451
	      echo "*** However, this would only work if libtool was able to extract symbol"
6804
	      $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
9452
	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
6805
	      $ECHO "*** not find such a program.  So, this module is probably useless."
9453
	      echo "*** not find such a program.  So, this module is probably useless."
6806
	      $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
9454
	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
6807
	    fi
9455
	    fi
6808
	    if test "$build_old_libs" = no; then
9456
	    if test no = "$build_old_libs"; then
6809
	      oldlibs="$output_objdir/$libname.$libext"
9457
	      oldlibs=$output_objdir/$libname.$libext
6810
	      build_libtool_libs=module
9458
	      build_libtool_libs=module
6811
	      build_old_libs=yes
9459
	      build_old_libs=yes
6812
	    else
9460
	    else
6813
	      build_libtool_libs=no
9461
	      build_libtool_libs=no
6814
	    fi
9462
	    fi
6815
	  else
9463
	  else
6816
	    $ECHO "*** The inter-library dependencies that have been dropped here will be"
9464
	    echo "*** The inter-library dependencies that have been dropped here will be"
6817
	    $ECHO "*** automatically added whenever a program is linked with this library"
9465
	    echo "*** automatically added whenever a program is linked with this library"
6818
	    $ECHO "*** or is declared to -dlopen it."
9466
	    echo "*** or is declared to -dlopen it."
6819
 
9467
 
6820
	    if test "$allow_undefined" = no; then
9468
	    if test no = "$allow_undefined"; then
6821
	      $ECHO
9469
	      echo
6822
	      $ECHO "*** Since this library must not contain undefined symbols,"
9470
	      echo "*** Since this library must not contain undefined symbols,"
6823
	      $ECHO "*** because either the platform does not support them or"
9471
	      echo "*** because either the platform does not support them or"
6824
	      $ECHO "*** it was explicitly requested with -no-undefined,"
9472
	      echo "*** it was explicitly requested with -no-undefined,"
6825
	      $ECHO "*** libtool will only create a static version of it."
9473
	      echo "*** libtool will only create a static version of it."
6826
	      if test "$build_old_libs" = no; then
9474
	      if test no = "$build_old_libs"; then
6827
		oldlibs="$output_objdir/$libname.$libext"
9475
		oldlibs=$output_objdir/$libname.$libext
6828
		build_libtool_libs=module
9476
		build_libtool_libs=module
6829
		build_old_libs=yes
9477
		build_old_libs=yes
6830
	      else
9478
	      else
6831
		build_libtool_libs=no
9479
		build_libtool_libs=no
6832
	      fi
9480
	      fi
Line 6837... Line 9485...
6837
	deplibs=$newdeplibs
9485
	deplibs=$newdeplibs
6838
      fi
9486
      fi
6839
      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
9487
      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
6840
      case $host in
9488
      case $host in
6841
	*-*-darwin*)
9489
	*-*-darwin*)
6842
	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
9490
	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6843
	  new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
9491
	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6844
	  deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
9492
	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6845
	  ;;
9493
	  ;;
6846
      esac
9494
      esac
6847
 
9495
 
6848
      # move library search paths that coincide with paths to not yet
9496
      # move library search paths that coincide with paths to not yet
6849
      # installed libraries to the beginning of the library search list
9497
      # installed libraries to the beginning of the library search list
Line 6852... Line 9500...
6852
	case " $new_libs " in
9500
	case " $new_libs " in
6853
	*" -L$path/$objdir "*) ;;
9501
	*" -L$path/$objdir "*) ;;
6854
	*)
9502
	*)
6855
	  case " $deplibs " in
9503
	  case " $deplibs " in
6856
	  *" -L$path/$objdir "*)
9504
	  *" -L$path/$objdir "*)
6857
	    new_libs="$new_libs -L$path/$objdir" ;;
9505
	    func_append new_libs " -L$path/$objdir" ;;
6858
	  esac
9506
	  esac
6859
	  ;;
9507
	  ;;
6860
	esac
9508
	esac
6861
      done
9509
      done
6862
      for deplib in $deplibs; do
9510
      for deplib in $deplibs; do
6863
	case $deplib in
9511
	case $deplib in
6864
	-L*)
9512
	-L*)
6865
	  case " $new_libs " in
9513
	  case " $new_libs " in
6866
	  *" $deplib "*) ;;
9514
	  *" $deplib "*) ;;
6867
	  *) new_libs="$new_libs $deplib" ;;
9515
	  *) func_append new_libs " $deplib" ;;
6868
	  esac
9516
	  esac
6869
	  ;;
9517
	  ;;
6870
	*) new_libs="$new_libs $deplib" ;;
9518
	*) func_append new_libs " $deplib" ;;
6871
	esac
9519
	esac
6872
      done
9520
      done
6873
      deplibs="$new_libs"
9521
      deplibs=$new_libs
6874
 
9522
 
6875
      # All the library-specific variables (install_libdir is set above).
9523
      # All the library-specific variables (install_libdir is set above).
6876
      library_names=
9524
      library_names=
6877
      old_library=
9525
      old_library=
6878
      dlname=
9526
      dlname=
6879
 
9527
 
6880
      # Test again, we may have decided not to build it any more
9528
      # Test again, we may have decided not to build it any more
6881
      if test "$build_libtool_libs" = yes; then
9529
      if test yes = "$build_libtool_libs"; then
-
 
9530
	# Remove $wl instances when linking with ld.
-
 
9531
	# FIXME: should test the right _cmds variable.
-
 
9532
	case $archive_cmds in
-
 
9533
	  *\$LD\ *) wl= ;;
-
 
9534
        esac
6882
	if test "$hardcode_into_libs" = yes; then
9535
	if test yes = "$hardcode_into_libs"; then
6883
	  # Hardcode the library paths
9536
	  # Hardcode the library paths
6884
	  hardcode_libdirs=
9537
	  hardcode_libdirs=
6885
	  dep_rpath=
9538
	  dep_rpath=
6886
	  rpath="$finalize_rpath"
9539
	  rpath=$finalize_rpath
6887
	  test "$mode" != relink && rpath="$compile_rpath$rpath"
9540
	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
6888
	  for libdir in $rpath; do
9541
	  for libdir in $rpath; do
6889
	    if test -n "$hardcode_libdir_flag_spec"; then
9542
	    if test -n "$hardcode_libdir_flag_spec"; then
6890
	      if test -n "$hardcode_libdir_separator"; then
9543
	      if test -n "$hardcode_libdir_separator"; then
-
 
9544
		func_replace_sysroot "$libdir"
-
 
9545
		libdir=$func_replace_sysroot_result
6891
		if test -z "$hardcode_libdirs"; then
9546
		if test -z "$hardcode_libdirs"; then
6892
		  hardcode_libdirs="$libdir"
9547
		  hardcode_libdirs=$libdir
6893
		else
9548
		else
6894
		  # Just accumulate the unique libdirs.
9549
		  # Just accumulate the unique libdirs.
6895
		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9550
		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
6896
		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9551
		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
6897
		    ;;
9552
		    ;;
6898
		  *)
9553
		  *)
6899
		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
9554
		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
6900
		    ;;
9555
		    ;;
6901
		  esac
9556
		  esac
6902
		fi
9557
		fi
6903
	      else
9558
	      else
6904
		eval flag=\"$hardcode_libdir_flag_spec\"
9559
		eval flag=\"$hardcode_libdir_flag_spec\"
6905
		dep_rpath="$dep_rpath $flag"
9560
		func_append dep_rpath " $flag"
6906
	      fi
9561
	      fi
6907
	    elif test -n "$runpath_var"; then
9562
	    elif test -n "$runpath_var"; then
6908
	      case "$perm_rpath " in
9563
	      case "$perm_rpath " in
6909
	      *" $libdir "*) ;;
9564
	      *" $libdir "*) ;;
6910
	      *) perm_rpath="$perm_rpath $libdir" ;;
9565
	      *) func_append perm_rpath " $libdir" ;;
6911
	      esac
9566
	      esac
6912
	    fi
9567
	    fi
6913
	  done
9568
	  done
6914
	  # Substitute the hardcoded libdirs into the rpath.
9569
	  # Substitute the hardcoded libdirs into the rpath.
6915
	  if test -n "$hardcode_libdir_separator" &&
9570
	  if test -n "$hardcode_libdir_separator" &&
6916
	     test -n "$hardcode_libdirs"; then
9571
	     test -n "$hardcode_libdirs"; then
6917
	    libdir="$hardcode_libdirs"
9572
	    libdir=$hardcode_libdirs
6918
	    if test -n "$hardcode_libdir_flag_spec_ld"; then
-
 
6919
	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
-
 
6920
	    else
-
 
6921
	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
9573
	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
6922
	    fi
-
 
6923
	  fi
9574
	  fi
6924
	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
9575
	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
6925
	    # We should set the runpath_var.
9576
	    # We should set the runpath_var.
6926
	    rpath=
9577
	    rpath=
6927
	    for dir in $perm_rpath; do
9578
	    for dir in $perm_rpath; do
6928
	      rpath="$rpath$dir:"
9579
	      func_append rpath "$dir:"
6929
	    done
9580
	    done
6930
	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
9581
	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
6931
	  fi
9582
	  fi
6932
	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
9583
	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
6933
	fi
9584
	fi
6934
 
9585
 
6935
	shlibpath="$finalize_shlibpath"
9586
	shlibpath=$finalize_shlibpath
6936
	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
9587
	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
6937
	if test -n "$shlibpath"; then
9588
	if test -n "$shlibpath"; then
6938
	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
9589
	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
6939
	fi
9590
	fi
6940
 
9591
 
6941
	# Get the real and link names of the library.
9592
	# Get the real and link names of the library.
6942
	eval shared_ext=\"$shrext_cmds\"
9593
	eval shared_ext=\"$shrext_cmds\"
6943
	eval library_names=\"$library_names_spec\"
9594
	eval library_names=\"$library_names_spec\"
6944
	set dummy $library_names
9595
	set dummy $library_names
6945
	shift
9596
	shift
6946
	realname="$1"
9597
	realname=$1
6947
	shift
9598
	shift
6948
 
9599
 
6949
	if test -n "$soname_spec"; then
9600
	if test -n "$soname_spec"; then
6950
	  eval soname=\"$soname_spec\"
9601
	  eval soname=\"$soname_spec\"
6951
	else
9602
	else
6952
	  soname="$realname"
9603
	  soname=$realname
6953
	fi
9604
	fi
6954
	if test -z "$dlname"; then
9605
	if test -z "$dlname"; then
6955
	  dlname=$soname
9606
	  dlname=$soname
6956
	fi
9607
	fi
6957
 
9608
 
6958
	lib="$output_objdir/$realname"
9609
	lib=$output_objdir/$realname
6959
	linknames=
9610
	linknames=
6960
	for link
9611
	for link
6961
	do
9612
	do
6962
	  linknames="$linknames $link"
9613
	  func_append linknames " $link"
6963
	done
9614
	done
6964
 
9615
 
6965
	# Use standard objects if they are pic
9616
	# Use standard objects if they are pic
6966
	test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
9617
	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
6967
	test "X$libobjs" = "X " && libobjs=
9618
	test "X$libobjs" = "X " && libobjs=
6968
 
9619
 
6969
	delfiles=
9620
	delfiles=
6970
	if test -n "$export_symbols" && test -n "$include_expsyms"; then
9621
	if test -n "$export_symbols" && test -n "$include_expsyms"; then
6971
	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
9622
	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
6972
	  export_symbols="$output_objdir/$libname.uexp"
9623
	  export_symbols=$output_objdir/$libname.uexp
6973
	  delfiles="$delfiles $export_symbols"
9624
	  func_append delfiles " $export_symbols"
6974
	fi
9625
	fi
6975
 
9626
 
6976
	orig_export_symbols=
9627
	orig_export_symbols=
6977
	case $host_os in
9628
	case $host_os in
6978
	cygwin* | mingw* | cegcc*)
9629
	cygwin* | mingw* | cegcc*)
6979
	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
9630
	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
6980
	    # exporting using user supplied symfile
9631
	    # exporting using user supplied symfile
6981
	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
9632
	    func_dll_def_p "$export_symbols" || {
6982
	      # and it's NOT already a .def file. Must figure out
9633
	      # and it's NOT already a .def file. Must figure out
6983
	      # which of the given symbols are data symbols and tag
9634
	      # which of the given symbols are data symbols and tag
6984
	      # them as such. So, trigger use of export_symbols_cmds.
9635
	      # them as such. So, trigger use of export_symbols_cmds.
6985
	      # export_symbols gets reassigned inside the "prepare
9636
	      # export_symbols gets reassigned inside the "prepare
6986
	      # the list of exported symbols" if statement, so the
9637
	      # the list of exported symbols" if statement, so the
6987
	      # include_expsyms logic still works.
9638
	      # include_expsyms logic still works.
6988
	      orig_export_symbols="$export_symbols"
9639
	      orig_export_symbols=$export_symbols
6989
	      export_symbols=
9640
	      export_symbols=
6990
	      always_export_symbols=yes
9641
	      always_export_symbols=yes
6991
	    fi
9642
	    }
6992
	  fi
9643
	  fi
6993
	  ;;
9644
	  ;;
6994
	esac
9645
	esac
6995
 
9646
 
6996
	# Prepare the list of exported symbols
9647
	# Prepare the list of exported symbols
6997
	if test -z "$export_symbols"; then
9648
	if test -z "$export_symbols"; then
6998
	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
9649
	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
6999
	    func_verbose "generating symbol list for \`$libname.la'"
9650
	    func_verbose "generating symbol list for '$libname.la'"
7000
	    export_symbols="$output_objdir/$libname.exp"
9651
	    export_symbols=$output_objdir/$libname.exp
7001
	    $opt_dry_run || $RM $export_symbols
9652
	    $opt_dry_run || $RM $export_symbols
7002
	    cmds=$export_symbols_cmds
9653
	    cmds=$export_symbols_cmds
7003
	    save_ifs="$IFS"; IFS='~'
9654
	    save_ifs=$IFS; IFS='~'
7004
	    for cmd in $cmds; do
9655
	    for cmd1 in $cmds; do
7005
	      IFS="$save_ifs"
9656
	      IFS=$save_ifs
-
 
9657
	      # Take the normal branch if the nm_file_list_spec branch
-
 
9658
	      # doesn't work or if tool conversion is not needed.
-
 
9659
	      case $nm_file_list_spec~$to_tool_file_cmd in
-
 
9660
		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
-
 
9661
		  try_normal_branch=yes
7006
	      eval cmd=\"$cmd\"
9662
		  eval cmd=\"$cmd1\"
7007
	      func_len " $cmd"
9663
		  func_len " $cmd"
7008
	      len=$func_len_result
9664
		  len=$func_len_result
-
 
9665
		  ;;
-
 
9666
		*)
-
 
9667
		  try_normal_branch=no
-
 
9668
		  ;;
-
 
9669
	      esac
-
 
9670
	      if test yes = "$try_normal_branch" \
-
 
9671
		 && { test "$len" -lt "$max_cmd_len" \
7009
	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9672
		      || test "$max_cmd_len" -le -1; }
-
 
9673
	      then
-
 
9674
		func_show_eval "$cmd" 'exit $?'
-
 
9675
		skipped_export=false
-
 
9676
	      elif test -n "$nm_file_list_spec"; then
-
 
9677
		func_basename "$output"
-
 
9678
		output_la=$func_basename_result
-
 
9679
		save_libobjs=$libobjs
-
 
9680
		save_output=$output
-
 
9681
		output=$output_objdir/$output_la.nm
-
 
9682
		func_to_tool_file "$output"
-
 
9683
		libobjs=$nm_file_list_spec$func_to_tool_file_result
-
 
9684
		func_append delfiles " $output"
-
 
9685
		func_verbose "creating $NM input file list: $output"
-
 
9686
		for obj in $save_libobjs; do
-
 
9687
		  func_to_tool_file "$obj"
-
 
9688
		  $ECHO "$func_to_tool_file_result"
-
 
9689
		done > "$output"
-
 
9690
		eval cmd=\"$cmd1\"
7010
		func_show_eval "$cmd" 'exit $?'
9691
		func_show_eval "$cmd" 'exit $?'
-
 
9692
		output=$save_output
-
 
9693
		libobjs=$save_libobjs
7011
		skipped_export=false
9694
		skipped_export=false
7012
	      else
9695
	      else
7013
		# The command line is too long to execute in one step.
9696
		# The command line is too long to execute in one step.
7014
		func_verbose "using reloadable object file for export list..."
9697
		func_verbose "using reloadable object file for export list..."
7015
		skipped_export=:
9698
		skipped_export=:
7016
		# Break out early, otherwise skipped_export may be
9699
		# Break out early, otherwise skipped_export may be
7017
		# set to false by a later but shorter cmd.
9700
		# set to false by a later but shorter cmd.
7018
		break
9701
		break
7019
	      fi
9702
	      fi
7020
	    done
9703
	    done
7021
	    IFS="$save_ifs"
9704
	    IFS=$save_ifs
7022
	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
9705
	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
7023
	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
9706
	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7024
	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
9707
	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7025
	    fi
9708
	    fi
7026
	  fi
9709
	  fi
7027
	fi
9710
	fi
7028
 
9711
 
7029
	if test -n "$export_symbols" && test -n "$include_expsyms"; then
9712
	if test -n "$export_symbols" && test -n "$include_expsyms"; then
7030
	  tmp_export_symbols="$export_symbols"
9713
	  tmp_export_symbols=$export_symbols
7031
	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
9714
	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
7032
	  $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
9715
	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
7033
	fi
9716
	fi
7034
 
9717
 
7035
	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
9718
	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
7036
	  # The given exports_symbols file has to be filtered, so filter it.
9719
	  # The given exports_symbols file has to be filtered, so filter it.
7037
	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
9720
	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
7038
	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
9721
	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
7039
	  # 's' commands which not all seds can handle. GNU sed should be fine
9722
	  # 's' commands, which not all seds can handle. GNU sed should be fine
7040
	  # though. Also, the filter scales superlinearly with the number of
9723
	  # though. Also, the filter scales superlinearly with the number of
7041
	  # global variables. join(1) would be nice here, but unfortunately
9724
	  # global variables. join(1) would be nice here, but unfortunately
7042
	  # isn't a blessed tool.
9725
	  # isn't a blessed tool.
7043
	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
9726
	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7044
	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
9727
	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
7045
	  export_symbols=$output_objdir/$libname.def
9728
	  export_symbols=$output_objdir/$libname.def
7046
	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
9729
	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7047
	fi
9730
	fi
7048
 
9731
 
7049
	tmp_deplibs=
9732
	tmp_deplibs=
7050
	for test_deplib in $deplibs; do
9733
	for test_deplib in $deplibs; do
7051
	  case " $convenience " in
9734
	  case " $convenience " in
7052
	  *" $test_deplib "*) ;;
9735
	  *" $test_deplib "*) ;;
7053
	  *)
9736
	  *)
7054
	    tmp_deplibs="$tmp_deplibs $test_deplib"
9737
	    func_append tmp_deplibs " $test_deplib"
7055
	    ;;
9738
	    ;;
7056
	  esac
9739
	  esac
7057
	done
9740
	done
7058
	deplibs="$tmp_deplibs"
9741
	deplibs=$tmp_deplibs
7059
 
9742
 
7060
	if test -n "$convenience"; then
9743
	if test -n "$convenience"; then
7061
	  if test -n "$whole_archive_flag_spec" &&
9744
	  if test -n "$whole_archive_flag_spec" &&
7062
	    test "$compiler_needs_object" = yes &&
9745
	    test yes = "$compiler_needs_object" &&
7063
	    test -z "$libobjs"; then
9746
	    test -z "$libobjs"; then
7064
	    # extract the archives, so we have objects to list.
9747
	    # extract the archives, so we have objects to list.
7065
	    # TODO: could optimize this to just extract one archive.
9748
	    # TODO: could optimize this to just extract one archive.
7066
	    whole_archive_flag_spec=
9749
	    whole_archive_flag_spec=
7067
	  fi
9750
	  fi
7068
	  if test -n "$whole_archive_flag_spec"; then
9751
	  if test -n "$whole_archive_flag_spec"; then
7069
	    save_libobjs=$libobjs
9752
	    save_libobjs=$libobjs
7070
	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
9753
	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
7071
	    test "X$libobjs" = "X " && libobjs=
9754
	    test "X$libobjs" = "X " && libobjs=
7072
	  else
9755
	  else
7073
	    gentop="$output_objdir/${outputname}x"
9756
	    gentop=$output_objdir/${outputname}x
7074
	    generated="$generated $gentop"
9757
	    func_append generated " $gentop"
7075
 
9758
 
7076
	    func_extract_archives $gentop $convenience
9759
	    func_extract_archives $gentop $convenience
7077
	    libobjs="$libobjs $func_extract_archives_result"
9760
	    func_append libobjs " $func_extract_archives_result"
7078
	    test "X$libobjs" = "X " && libobjs=
9761
	    test "X$libobjs" = "X " && libobjs=
7079
	  fi
9762
	  fi
7080
	fi
9763
	fi
7081
 
9764
 
7082
	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
9765
	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
7083
	  eval flag=\"$thread_safe_flag_spec\"
9766
	  eval flag=\"$thread_safe_flag_spec\"
7084
	  linker_flags="$linker_flags $flag"
9767
	  func_append linker_flags " $flag"
7085
	fi
9768
	fi
7086
 
9769
 
7087
	# Make a backup of the uninstalled library when relinking
9770
	# Make a backup of the uninstalled library when relinking
7088
	if test "$mode" = relink; then
9771
	if test relink = "$opt_mode"; then
7089
	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
9772
	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
7090
	fi
9773
	fi
7091
 
9774
 
7092
	# Do each of the archive commands.
9775
	# Do each of the archive commands.
7093
	if test "$module" = yes && test -n "$module_cmds" ; then
9776
	if test yes = "$module" && test -n "$module_cmds"; then
7094
	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
9777
	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7095
	    eval test_cmds=\"$module_expsym_cmds\"
9778
	    eval test_cmds=\"$module_expsym_cmds\"
7096
	    cmds=$module_expsym_cmds
9779
	    cmds=$module_expsym_cmds
7097
	  else
9780
	  else
7098
	    eval test_cmds=\"$module_cmds\"
9781
	    eval test_cmds=\"$module_cmds\"
Line 7106... Line 9789...
7106
	    eval test_cmds=\"$archive_cmds\"
9789
	    eval test_cmds=\"$archive_cmds\"
7107
	    cmds=$archive_cmds
9790
	    cmds=$archive_cmds
7108
	  fi
9791
	  fi
7109
	fi
9792
	fi
7110
 
9793
 
7111
	if test "X$skipped_export" != "X:" &&
9794
	if test : != "$skipped_export" &&
7112
	   func_len " $test_cmds" &&
9795
	   func_len " $test_cmds" &&
7113
	   len=$func_len_result &&
9796
	   len=$func_len_result &&
7114
	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9797
	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7115
	  :
9798
	  :
7116
	else
9799
	else
Line 7128... Line 9811...
7128
	  # the spec.
9811
	  # the spec.
7129
	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
9812
	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
7130
	    save_libobjs=$libobjs
9813
	    save_libobjs=$libobjs
7131
	  fi
9814
	  fi
7132
	  save_output=$output
9815
	  save_output=$output
-
 
9816
	  func_basename "$output"
7133
	  output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
9817
	  output_la=$func_basename_result
7134
 
9818
 
7135
	  # Clear the reloadable object creation command queue and
9819
	  # Clear the reloadable object creation command queue and
7136
	  # initialize k to one.
9820
	  # initialize k to one.
7137
	  test_cmds=
9821
	  test_cmds=
7138
	  concat_cmds=
9822
	  concat_cmds=
7139
	  objlist=
9823
	  objlist=
7140
	  last_robj=
9824
	  last_robj=
7141
	  k=1
9825
	  k=1
7142
 
9826
 
7143
	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
9827
	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
7144
	    output=${output_objdir}/${output_la}.lnkscript
9828
	    output=$output_objdir/$output_la.lnkscript
7145
	    func_verbose "creating GNU ld script: $output"
9829
	    func_verbose "creating GNU ld script: $output"
7146
	    $ECHO 'INPUT (' > $output
9830
	    echo 'INPUT (' > $output
7147
	    for obj in $save_libobjs
9831
	    for obj in $save_libobjs
7148
	    do
9832
	    do
-
 
9833
	      func_to_tool_file "$obj"
7149
	      $ECHO "$obj" >> $output
9834
	      $ECHO "$func_to_tool_file_result" >> $output
7150
	    done
9835
	    done
7151
	    $ECHO ')' >> $output
9836
	    echo ')' >> $output
7152
	    delfiles="$delfiles $output"
9837
	    func_append delfiles " $output"
-
 
9838
	    func_to_tool_file "$output"
-
 
9839
	    output=$func_to_tool_file_result
7153
	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
9840
	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
7154
	    output=${output_objdir}/${output_la}.lnk
9841
	    output=$output_objdir/$output_la.lnk
7155
	    func_verbose "creating linker input file list: $output"
9842
	    func_verbose "creating linker input file list: $output"
7156
	    : > $output
9843
	    : > $output
7157
	    set x $save_libobjs
9844
	    set x $save_libobjs
7158
	    shift
9845
	    shift
7159
	    firstobj=
9846
	    firstobj=
7160
	    if test "$compiler_needs_object" = yes; then
9847
	    if test yes = "$compiler_needs_object"; then
7161
	      firstobj="$1 "
9848
	      firstobj="$1 "
7162
	      shift
9849
	      shift
7163
	    fi
9850
	    fi
7164
	    for obj
9851
	    for obj
7165
	    do
9852
	    do
-
 
9853
	      func_to_tool_file "$obj"
7166
	      $ECHO "$obj" >> $output
9854
	      $ECHO "$func_to_tool_file_result" >> $output
7167
	    done
9855
	    done
7168
	    delfiles="$delfiles $output"
9856
	    func_append delfiles " $output"
-
 
9857
	    func_to_tool_file "$output"
7169
	    output=$firstobj\"$file_list_spec$output\"
9858
	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
7170
	  else
9859
	  else
7171
	    if test -n "$save_libobjs"; then
9860
	    if test -n "$save_libobjs"; then
7172
	      func_verbose "creating reloadable object files..."
9861
	      func_verbose "creating reloadable object files..."
7173
	      output=$output_objdir/$output_la-${k}.$objext
9862
	      output=$output_objdir/$output_la-$k.$objext
7174
	      eval test_cmds=\"$reload_cmds\"
9863
	      eval test_cmds=\"$reload_cmds\"
7175
	      func_len " $test_cmds"
9864
	      func_len " $test_cmds"
7176
	      len0=$func_len_result
9865
	      len0=$func_len_result
7177
	      len=$len0
9866
	      len=$len0
7178
 
9867
 
Line 7180... Line 9869...
7180
	      for obj in $save_libobjs
9869
	      for obj in $save_libobjs
7181
	      do
9870
	      do
7182
		func_len " $obj"
9871
		func_len " $obj"
7183
		func_arith $len + $func_len_result
9872
		func_arith $len + $func_len_result
7184
		len=$func_arith_result
9873
		len=$func_arith_result
7185
		if test "X$objlist" = X ||
9874
		if test -z "$objlist" ||
7186
		   test "$len" -lt "$max_cmd_len"; then
9875
		   test "$len" -lt "$max_cmd_len"; then
7187
		  func_append objlist " $obj"
9876
		  func_append objlist " $obj"
7188
		else
9877
		else
7189
		  # The command $test_cmds is almost too long, add a
9878
		  # The command $test_cmds is almost too long, add a
7190
		  # command to the queue.
9879
		  # command to the queue.
7191
		  if test "$k" -eq 1 ; then
9880
		  if test 1 -eq "$k"; then
7192
		    # The first file doesn't have a previous command to add.
9881
		    # The first file doesn't have a previous command to add.
-
 
9882
		    reload_objs=$objlist
7193
		    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
9883
		    eval concat_cmds=\"$reload_cmds\"
7194
		  else
9884
		  else
7195
		    # All subsequent reloadable object files will link in
9885
		    # All subsequent reloadable object files will link in
7196
		    # the last one created.
9886
		    # the last one created.
-
 
9887
		    reload_objs="$objlist $last_robj"
7197
		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
9888
		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
7198
		  fi
9889
		  fi
7199
		  last_robj=$output_objdir/$output_la-${k}.$objext
9890
		  last_robj=$output_objdir/$output_la-$k.$objext
7200
		  func_arith $k + 1
9891
		  func_arith $k + 1
7201
		  k=$func_arith_result
9892
		  k=$func_arith_result
7202
		  output=$output_objdir/$output_la-${k}.$objext
9893
		  output=$output_objdir/$output_la-$k.$objext
7203
		  objlist=$obj
9894
		  objlist=" $obj"
7204
		  func_len " $last_robj"
9895
		  func_len " $last_robj"
7205
		  func_arith $len0 + $func_len_result
9896
		  func_arith $len0 + $func_len_result
7206
		  len=$func_arith_result
9897
		  len=$func_arith_result
7207
		fi
9898
		fi
7208
	      done
9899
	      done
7209
	      # Handle the remaining objects by creating one last
9900
	      # Handle the remaining objects by creating one last
7210
	      # reloadable object file.  All subsequent reloadable object
9901
	      # reloadable object file.  All subsequent reloadable object
7211
	      # files will link in the last one created.
9902
	      # files will link in the last one created.
7212
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9903
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-
 
9904
	      reload_objs="$objlist $last_robj"
7213
	      eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
9905
	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
7214
	      if test -n "$last_robj"; then
9906
	      if test -n "$last_robj"; then
7215
	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
9907
	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
7216
	      fi
9908
	      fi
7217
	      delfiles="$delfiles $output"
9909
	      func_append delfiles " $output"
7218
 
9910
 
7219
	    else
9911
	    else
7220
	      output=
9912
	      output=
7221
	    fi
9913
	    fi
7222
 
9914
 
7223
	    if ${skipped_export-false}; then
9915
	    ${skipped_export-false} && {
7224
	      func_verbose "generating symbol list for \`$libname.la'"
9916
	      func_verbose "generating symbol list for '$libname.la'"
7225
	      export_symbols="$output_objdir/$libname.exp"
9917
	      export_symbols=$output_objdir/$libname.exp
7226
	      $opt_dry_run || $RM $export_symbols
9918
	      $opt_dry_run || $RM $export_symbols
7227
	      libobjs=$output
9919
	      libobjs=$output
7228
	      # Append the command to create the export file.
9920
	      # Append the command to create the export file.
7229
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9921
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7230
	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
9922
	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
7231
	      if test -n "$last_robj"; then
9923
	      if test -n "$last_robj"; then
7232
		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
9924
		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
7233
	      fi
9925
	      fi
7234
	    fi
9926
	    }
7235
 
9927
 
7236
	    test -n "$save_libobjs" &&
9928
	    test -n "$save_libobjs" &&
7237
	      func_verbose "creating a temporary reloadable object file: $output"
9929
	      func_verbose "creating a temporary reloadable object file: $output"
7238
 
9930
 
7239
	    # Loop through the commands generated above and execute them.
9931
	    # Loop through the commands generated above and execute them.
7240
	    save_ifs="$IFS"; IFS='~'
9932
	    save_ifs=$IFS; IFS='~'
7241
	    for cmd in $concat_cmds; do
9933
	    for cmd in $concat_cmds; do
7242
	      IFS="$save_ifs"
9934
	      IFS=$save_ifs
7243
	      $opt_silent || {
9935
	      $opt_quiet || {
7244
		  func_quote_for_expand "$cmd"
9936
		  func_quote_for_expand "$cmd"
7245
		  eval "func_echo $func_quote_for_expand_result"
9937
		  eval "func_echo $func_quote_for_expand_result"
7246
	      }
9938
	      }
7247
	      $opt_dry_run || eval "$cmd" || {
9939
	      $opt_dry_run || eval "$cmd" || {
7248
		lt_exit=$?
9940
		lt_exit=$?
7249
 
9941
 
7250
		# Restore the uninstalled library and exit
9942
		# Restore the uninstalled library and exit
7251
		if test "$mode" = relink; then
9943
		if test relink = "$opt_mode"; then
7252
		  ( cd "$output_objdir" && \
9944
		  ( cd "$output_objdir" && \
7253
		    $RM "${realname}T" && \
9945
		    $RM "${realname}T" && \
7254
		    $MV "${realname}U" "$realname" )
9946
		    $MV "${realname}U" "$realname" )
7255
		fi
9947
		fi
7256
 
9948
 
7257
		exit $lt_exit
9949
		exit $lt_exit
7258
	      }
9950
	      }
7259
	    done
9951
	    done
7260
	    IFS="$save_ifs"
9952
	    IFS=$save_ifs
7261
 
9953
 
7262
	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
9954
	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
7263
	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
9955
	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
7264
	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
9956
	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
7265
	    fi
9957
	    fi
7266
	  fi
9958
	  fi
7267
 
9959
 
7268
          if ${skipped_export-false}; then
9960
          ${skipped_export-false} && {
7269
	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
9961
	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
7270
	      tmp_export_symbols="$export_symbols"
9962
	      tmp_export_symbols=$export_symbols
7271
	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
9963
	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
7272
	      $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
9964
	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
7273
	    fi
9965
	    fi
7274
 
9966
 
7275
	    if test -n "$orig_export_symbols"; then
9967
	    if test -n "$orig_export_symbols"; then
7276
	      # The given exports_symbols file has to be filtered, so filter it.
9968
	      # The given exports_symbols file has to be filtered, so filter it.
7277
	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
9969
	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
7278
	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
9970
	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
7279
	      # 's' commands which not all seds can handle. GNU sed should be fine
9971
	      # 's' commands, which not all seds can handle. GNU sed should be fine
7280
	      # though. Also, the filter scales superlinearly with the number of
9972
	      # though. Also, the filter scales superlinearly with the number of
7281
	      # global variables. join(1) would be nice here, but unfortunately
9973
	      # global variables. join(1) would be nice here, but unfortunately
7282
	      # isn't a blessed tool.
9974
	      # isn't a blessed tool.
7283
	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
9975
	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7284
	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
9976
	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
7285
	      export_symbols=$output_objdir/$libname.def
9977
	      export_symbols=$output_objdir/$libname.def
7286
	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
9978
	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7287
	    fi
9979
	    fi
7288
	  fi
9980
	  }
7289
 
9981
 
7290
	  libobjs=$output
9982
	  libobjs=$output
7291
	  # Restore the value of output.
9983
	  # Restore the value of output.
7292
	  output=$save_output
9984
	  output=$save_output
7293
 
9985
 
Line 7297... Line 9989...
7297
	  fi
9989
	  fi
7298
	  # Expand the library linking commands again to reset the
9990
	  # Expand the library linking commands again to reset the
7299
	  # value of $libobjs for piecewise linking.
9991
	  # value of $libobjs for piecewise linking.
7300
 
9992
 
7301
	  # Do each of the archive commands.
9993
	  # Do each of the archive commands.
7302
	  if test "$module" = yes && test -n "$module_cmds" ; then
9994
	  if test yes = "$module" && test -n "$module_cmds"; then
7303
	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
9995
	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
7304
	      cmds=$module_expsym_cmds
9996
	      cmds=$module_expsym_cmds
7305
	    else
9997
	    else
7306
	      cmds=$module_cmds
9998
	      cmds=$module_cmds
7307
	    fi
9999
	    fi
Line 7319... Line 10011...
7319
	  eval cmds=\"\$cmds~\$RM $delfiles\"
10011
	  eval cmds=\"\$cmds~\$RM $delfiles\"
7320
	fi
10012
	fi
7321
 
10013
 
7322
	# Add any objects from preloaded convenience libraries
10014
	# Add any objects from preloaded convenience libraries
7323
	if test -n "$dlprefiles"; then
10015
	if test -n "$dlprefiles"; then
7324
	  gentop="$output_objdir/${outputname}x"
10016
	  gentop=$output_objdir/${outputname}x
7325
	  generated="$generated $gentop"
10017
	  func_append generated " $gentop"
7326
 
10018
 
7327
	  func_extract_archives $gentop $dlprefiles
10019
	  func_extract_archives $gentop $dlprefiles
7328
	  libobjs="$libobjs $func_extract_archives_result"
10020
	  func_append libobjs " $func_extract_archives_result"
7329
	  test "X$libobjs" = "X " && libobjs=
10021
	  test "X$libobjs" = "X " && libobjs=
7330
	fi
10022
	fi
7331
 
10023
 
7332
	save_ifs="$IFS"; IFS='~'
10024
	save_ifs=$IFS; IFS='~'
7333
	for cmd in $cmds; do
10025
	for cmd in $cmds; do
7334
	  IFS="$save_ifs"
10026
	  IFS=$sp$nl
7335
	  eval cmd=\"$cmd\"
10027
	  eval cmd=\"$cmd\"
-
 
10028
	  IFS=$save_ifs
7336
	  $opt_silent || {
10029
	  $opt_quiet || {
7337
	    func_quote_for_expand "$cmd"
10030
	    func_quote_for_expand "$cmd"
7338
	    eval "func_echo $func_quote_for_expand_result"
10031
	    eval "func_echo $func_quote_for_expand_result"
7339
	  }
10032
	  }
7340
	  $opt_dry_run || eval "$cmd" || {
10033
	  $opt_dry_run || eval "$cmd" || {
7341
	    lt_exit=$?
10034
	    lt_exit=$?
7342
 
10035
 
7343
	    # Restore the uninstalled library and exit
10036
	    # Restore the uninstalled library and exit
7344
	    if test "$mode" = relink; then
10037
	    if test relink = "$opt_mode"; then
7345
	      ( cd "$output_objdir" && \
10038
	      ( cd "$output_objdir" && \
7346
	        $RM "${realname}T" && \
10039
	        $RM "${realname}T" && \
7347
		$MV "${realname}U" "$realname" )
10040
		$MV "${realname}U" "$realname" )
7348
	    fi
10041
	    fi
7349
 
10042
 
7350
	    exit $lt_exit
10043
	    exit $lt_exit
7351
	  }
10044
	  }
7352
	done
10045
	done
7353
	IFS="$save_ifs"
10046
	IFS=$save_ifs
7354
 
10047
 
7355
	# Restore the uninstalled library and exit
10048
	# Restore the uninstalled library and exit
7356
	if test "$mode" = relink; then
10049
	if test relink = "$opt_mode"; then
7357
	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
10050
	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
7358
 
10051
 
7359
	  if test -n "$convenience"; then
10052
	  if test -n "$convenience"; then
7360
	    if test -z "$whole_archive_flag_spec"; then
10053
	    if test -z "$whole_archive_flag_spec"; then
7361
	      func_show_eval '${RM}r "$gentop"'
10054
	      func_show_eval '${RM}r "$gentop"'
Line 7371... Line 10064...
7371
	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
10064
	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
7372
	  fi
10065
	  fi
7373
	done
10066
	done
7374
 
10067
 
7375
	# If -module or -export-dynamic was specified, set the dlname.
10068
	# If -module or -export-dynamic was specified, set the dlname.
7376
	if test "$module" = yes || test "$export_dynamic" = yes; then
10069
	if test yes = "$module" || test yes = "$export_dynamic"; then
7377
	  # On all known operating systems, these are identical.
10070
	  # On all known operating systems, these are identical.
7378
	  dlname="$soname"
10071
	  dlname=$soname
7379
	fi
10072
	fi
7380
      fi
10073
      fi
7381
      ;;
10074
      ;;
7382
 
10075
 
7383
    obj)
10076
    obj)
7384
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
10077
      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
7385
	func_warning "\`-dlopen' is ignored for objects"
10078
	func_warning "'-dlopen' is ignored for objects"
7386
      fi
10079
      fi
7387
 
10080
 
7388
      case " $deplibs" in
10081
      case " $deplibs" in
7389
      *\ -l* | *\ -L*)
10082
      *\ -l* | *\ -L*)
7390
	func_warning "\`-l' and \`-L' are ignored for objects" ;;
10083
	func_warning "'-l' and '-L' are ignored for objects" ;;
7391
      esac
10084
      esac
7392
 
10085
 
7393
      test -n "$rpath" && \
10086
      test -n "$rpath" && \
7394
	func_warning "\`-rpath' is ignored for objects"
10087
	func_warning "'-rpath' is ignored for objects"
7395
 
10088
 
7396
      test -n "$xrpath" && \
10089
      test -n "$xrpath" && \
7397
	func_warning "\`-R' is ignored for objects"
10090
	func_warning "'-R' is ignored for objects"
7398
 
10091
 
7399
      test -n "$vinfo" && \
10092
      test -n "$vinfo" && \
7400
	func_warning "\`-version-info' is ignored for objects"
10093
	func_warning "'-version-info' is ignored for objects"
7401
 
10094
 
7402
      test -n "$release" && \
10095
      test -n "$release" && \
7403
	func_warning "\`-release' is ignored for objects"
10096
	func_warning "'-release' is ignored for objects"
7404
 
10097
 
7405
      case $output in
10098
      case $output in
7406
      *.lo)
10099
      *.lo)
7407
	test -n "$objs$old_deplibs" && \
10100
	test -n "$objs$old_deplibs" && \
7408
	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
10101
	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
7409
 
10102
 
7410
	libobj=$output
10103
	libobj=$output
7411
	func_lo2o "$libobj"
10104
	func_lo2o "$libobj"
7412
	obj=$func_lo2o_result
10105
	obj=$func_lo2o_result
7413
	;;
10106
	;;
7414
      *)
10107
      *)
7415
	libobj=
10108
	libobj=
7416
	obj="$output"
10109
	obj=$output
7417
	;;
10110
	;;
7418
      esac
10111
      esac
7419
 
10112
 
7420
      # Delete the old objects.
10113
      # Delete the old objects.
7421
      $opt_dry_run || $RM $obj $libobj
10114
      $opt_dry_run || $RM $obj $libobj
Line 7424... Line 10117...
7424
      # single-version convenience libraries.  Whenever we create
10117
      # single-version convenience libraries.  Whenever we create
7425
      # different ones for PIC/non-PIC, this we'll have to duplicate
10118
      # different ones for PIC/non-PIC, this we'll have to duplicate
7426
      # the extraction.
10119
      # the extraction.
7427
      reload_conv_objs=
10120
      reload_conv_objs=
7428
      gentop=
10121
      gentop=
7429
      # reload_cmds runs $LD directly, so let us get rid of
10122
      # if reload_cmds runs $LD directly, get rid of -Wl from
7430
      # -Wl from whole_archive_flag_spec and hope we can get by with
10123
      # whole_archive_flag_spec and hope we can get by with turning comma
7431
      # turning comma into space..
10124
      # into space.
-
 
10125
      case $reload_cmds in
-
 
10126
        *\$LD[\ \$]*) wl= ;;
7432
      wl=
10127
      esac
7433
 
-
 
7434
      if test -n "$convenience"; then
10128
      if test -n "$convenience"; then
7435
	if test -n "$whole_archive_flag_spec"; then
10129
	if test -n "$whole_archive_flag_spec"; then
7436
	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
10130
	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-
 
10131
	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
7437
	  reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
10132
	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
7438
	else
10133
	else
7439
	  gentop="$output_objdir/${obj}x"
10134
	  gentop=$output_objdir/${obj}x
7440
	  generated="$generated $gentop"
10135
	  func_append generated " $gentop"
7441
 
10136
 
7442
	  func_extract_archives $gentop $convenience
10137
	  func_extract_archives $gentop $convenience
7443
	  reload_conv_objs="$reload_objs $func_extract_archives_result"
10138
	  reload_conv_objs="$reload_objs $func_extract_archives_result"
7444
	fi
10139
	fi
7445
      fi
10140
      fi
7446
 
10141
 
-
 
10142
      # If we're not building shared, we need to use non_pic_objs
-
 
10143
      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
-
 
10144
 
7447
      # Create the old-style object.
10145
      # Create the old-style object.
7448
      reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
10146
      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
7449
 
10147
 
7450
      output="$obj"
10148
      output=$obj
7451
      func_execute_cmds "$reload_cmds" 'exit $?'
10149
      func_execute_cmds "$reload_cmds" 'exit $?'
7452
 
10150
 
7453
      # Exit if we aren't doing a library object file.
10151
      # Exit if we aren't doing a library object file.
7454
      if test -z "$libobj"; then
10152
      if test -z "$libobj"; then
7455
	if test -n "$gentop"; then
10153
	if test -n "$gentop"; then
Line 7457... Line 10155...
7457
	fi
10155
	fi
7458
 
10156
 
7459
	exit $EXIT_SUCCESS
10157
	exit $EXIT_SUCCESS
7460
      fi
10158
      fi
7461
 
10159
 
7462
      if test "$build_libtool_libs" != yes; then
10160
      test yes = "$build_libtool_libs" || {
7463
	if test -n "$gentop"; then
10161
	if test -n "$gentop"; then
7464
	  func_show_eval '${RM}r "$gentop"'
10162
	  func_show_eval '${RM}r "$gentop"'
7465
	fi
10163
	fi
7466
 
10164
 
7467
	# Create an invalid libtool object if no PIC, so that we don't
10165
	# Create an invalid libtool object if no PIC, so that we don't
7468
	# accidentally link it into a program.
10166
	# accidentally link it into a program.
7469
	# $show "echo timestamp > $libobj"
10167
	# $show "echo timestamp > $libobj"
7470
	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
10168
	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
7471
	exit $EXIT_SUCCESS
10169
	exit $EXIT_SUCCESS
7472
      fi
10170
      }
7473
 
10171
 
7474
      if test -n "$pic_flag" || test "$pic_mode" != default; then
10172
      if test -n "$pic_flag" || test default != "$pic_mode"; then
7475
	# Only do commands if we really have different PIC objects.
10173
	# Only do commands if we really have different PIC objects.
7476
	reload_objs="$libobjs $reload_conv_objs"
10174
	reload_objs="$libobjs $reload_conv_objs"
7477
	output="$libobj"
10175
	output=$libobj
7478
	func_execute_cmds "$reload_cmds" 'exit $?'
10176
	func_execute_cmds "$reload_cmds" 'exit $?'
7479
      fi
10177
      fi
7480
 
10178
 
7481
      if test -n "$gentop"; then
10179
      if test -n "$gentop"; then
7482
	func_show_eval '${RM}r "$gentop"'
10180
	func_show_eval '${RM}r "$gentop"'
Line 7489... Line 10187...
7489
      case $host in
10187
      case $host in
7490
	*cygwin*) func_stripname '' '.exe' "$output"
10188
	*cygwin*) func_stripname '' '.exe' "$output"
7491
	          output=$func_stripname_result.exe;;
10189
	          output=$func_stripname_result.exe;;
7492
      esac
10190
      esac
7493
      test -n "$vinfo" && \
10191
      test -n "$vinfo" && \
7494
	func_warning "\`-version-info' is ignored for programs"
10192
	func_warning "'-version-info' is ignored for programs"
7495
 
10193
 
7496
      test -n "$release" && \
10194
      test -n "$release" && \
7497
	func_warning "\`-release' is ignored for programs"
10195
	func_warning "'-release' is ignored for programs"
7498
 
10196
 
7499
      test "$preload" = yes \
10197
      $preload \
7500
        && test "$dlopen_support" = unknown \
-
 
7501
	&& test "$dlopen_self" = unknown \
-
 
7502
	&& test "$dlopen_self_static" = unknown && \
10198
	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
7503
	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
10199
	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
7504
 
10200
 
7505
      case $host in
10201
      case $host in
7506
      *-*-rhapsody* | *-*-darwin1.[012])
10202
      *-*-rhapsody* | *-*-darwin1.[012])
7507
	# On Rhapsody replace the C library is the System framework
10203
	# On Rhapsody replace the C library is the System framework
7508
	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
10204
	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
7509
	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
10205
	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
7510
	;;
10206
	;;
7511
      esac
10207
      esac
7512
 
10208
 
7513
      case $host in
10209
      case $host in
7514
      *-*-darwin*)
10210
      *-*-darwin*)
7515
	# Don't allow lazy linking, it breaks C++ global constructors
10211
	# Don't allow lazy linking, it breaks C++ global constructors
7516
	# But is supposedly fixed on 10.4 or later (yay!).
10212
	# But is supposedly fixed on 10.4 or later (yay!).
7517
	if test "$tagname" = CXX ; then
10213
	if test CXX = "$tagname"; then
7518
	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10214
	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
7519
	    10.[0123])
10215
	    10.[0123])
7520
	      compile_command="$compile_command ${wl}-bind_at_load"
10216
	      func_append compile_command " $wl-bind_at_load"
7521
	      finalize_command="$finalize_command ${wl}-bind_at_load"
10217
	      func_append finalize_command " $wl-bind_at_load"
7522
	    ;;
10218
	    ;;
7523
	  esac
10219
	  esac
7524
	fi
10220
	fi
7525
	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
10221
	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
7526
	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
10222
	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7527
	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
10223
	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7528
	;;
10224
	;;
7529
      esac
10225
      esac
7530
 
10226
 
7531
 
10227
 
7532
      # move library search paths that coincide with paths to not yet
10228
      # move library search paths that coincide with paths to not yet
Line 7536... Line 10232...
7536
	case " $new_libs " in
10232
	case " $new_libs " in
7537
	*" -L$path/$objdir "*) ;;
10233
	*" -L$path/$objdir "*) ;;
7538
	*)
10234
	*)
7539
	  case " $compile_deplibs " in
10235
	  case " $compile_deplibs " in
7540
	  *" -L$path/$objdir "*)
10236
	  *" -L$path/$objdir "*)
7541
	    new_libs="$new_libs -L$path/$objdir" ;;
10237
	    func_append new_libs " -L$path/$objdir" ;;
7542
	  esac
10238
	  esac
7543
	  ;;
10239
	  ;;
7544
	esac
10240
	esac
7545
      done
10241
      done
7546
      for deplib in $compile_deplibs; do
10242
      for deplib in $compile_deplibs; do
7547
	case $deplib in
10243
	case $deplib in
7548
	-L*)
10244
	-L*)
7549
	  case " $new_libs " in
10245
	  case " $new_libs " in
7550
	  *" $deplib "*) ;;
10246
	  *" $deplib "*) ;;
7551
	  *) new_libs="$new_libs $deplib" ;;
10247
	  *) func_append new_libs " $deplib" ;;
7552
	  esac
10248
	  esac
7553
	  ;;
10249
	  ;;
7554
	*) new_libs="$new_libs $deplib" ;;
10250
	*) func_append new_libs " $deplib" ;;
7555
	esac
10251
	esac
7556
      done
10252
      done
7557
      compile_deplibs="$new_libs"
10253
      compile_deplibs=$new_libs
7558
 
10254
 
7559
 
10255
 
7560
      compile_command="$compile_command $compile_deplibs"
10256
      func_append compile_command " $compile_deplibs"
7561
      finalize_command="$finalize_command $finalize_deplibs"
10257
      func_append finalize_command " $finalize_deplibs"
7562
 
10258
 
7563
      if test -n "$rpath$xrpath"; then
10259
      if test -n "$rpath$xrpath"; then
7564
	# If the user specified any rpath flags, then add them.
10260
	# If the user specified any rpath flags, then add them.
7565
	for libdir in $rpath $xrpath; do
10261
	for libdir in $rpath $xrpath; do
7566
	  # This is the magic to use -rpath.
10262
	  # This is the magic to use -rpath.
7567
	  case "$finalize_rpath " in
10263
	  case "$finalize_rpath " in
7568
	  *" $libdir "*) ;;
10264
	  *" $libdir "*) ;;
7569
	  *) finalize_rpath="$finalize_rpath $libdir" ;;
10265
	  *) func_append finalize_rpath " $libdir" ;;
7570
	  esac
10266
	  esac
7571
	done
10267
	done
7572
      fi
10268
      fi
7573
 
10269
 
7574
      # Now hardcode the library paths
10270
      # Now hardcode the library paths
Line 7576... Line 10272...
7576
      hardcode_libdirs=
10272
      hardcode_libdirs=
7577
      for libdir in $compile_rpath $finalize_rpath; do
10273
      for libdir in $compile_rpath $finalize_rpath; do
7578
	if test -n "$hardcode_libdir_flag_spec"; then
10274
	if test -n "$hardcode_libdir_flag_spec"; then
7579
	  if test -n "$hardcode_libdir_separator"; then
10275
	  if test -n "$hardcode_libdir_separator"; then
7580
	    if test -z "$hardcode_libdirs"; then
10276
	    if test -z "$hardcode_libdirs"; then
7581
	      hardcode_libdirs="$libdir"
10277
	      hardcode_libdirs=$libdir
7582
	    else
10278
	    else
7583
	      # Just accumulate the unique libdirs.
10279
	      # Just accumulate the unique libdirs.
7584
	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10280
	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7585
	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10281
	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7586
		;;
10282
		;;
7587
	      *)
10283
	      *)
7588
		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
10284
		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
7589
		;;
10285
		;;
7590
	      esac
10286
	      esac
7591
	    fi
10287
	    fi
7592
	  else
10288
	  else
7593
	    eval flag=\"$hardcode_libdir_flag_spec\"
10289
	    eval flag=\"$hardcode_libdir_flag_spec\"
7594
	    rpath="$rpath $flag"
10290
	    func_append rpath " $flag"
7595
	  fi
10291
	  fi
7596
	elif test -n "$runpath_var"; then
10292
	elif test -n "$runpath_var"; then
7597
	  case "$perm_rpath " in
10293
	  case "$perm_rpath " in
7598
	  *" $libdir "*) ;;
10294
	  *" $libdir "*) ;;
7599
	  *) perm_rpath="$perm_rpath $libdir" ;;
10295
	  *) func_append perm_rpath " $libdir" ;;
7600
	  esac
10296
	  esac
7601
	fi
10297
	fi
7602
	case $host in
10298
	case $host in
7603
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
10299
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
7604
	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
10300
	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
7605
	  case :$dllsearchpath: in
10301
	  case :$dllsearchpath: in
7606
	  *":$libdir:"*) ;;
10302
	  *":$libdir:"*) ;;
7607
	  ::) dllsearchpath=$libdir;;
10303
	  ::) dllsearchpath=$libdir;;
7608
	  *) dllsearchpath="$dllsearchpath:$libdir";;
10304
	  *) func_append dllsearchpath ":$libdir";;
7609
	  esac
10305
	  esac
7610
	  case :$dllsearchpath: in
10306
	  case :$dllsearchpath: in
7611
	  *":$testbindir:"*) ;;
10307
	  *":$testbindir:"*) ;;
7612
	  ::) dllsearchpath=$testbindir;;
10308
	  ::) dllsearchpath=$testbindir;;
7613
	  *) dllsearchpath="$dllsearchpath:$testbindir";;
10309
	  *) func_append dllsearchpath ":$testbindir";;
7614
	  esac
10310
	  esac
7615
	  ;;
10311
	  ;;
7616
	esac
10312
	esac
7617
      done
10313
      done
7618
      # Substitute the hardcoded libdirs into the rpath.
10314
      # Substitute the hardcoded libdirs into the rpath.
7619
      if test -n "$hardcode_libdir_separator" &&
10315
      if test -n "$hardcode_libdir_separator" &&
7620
	 test -n "$hardcode_libdirs"; then
10316
	 test -n "$hardcode_libdirs"; then
7621
	libdir="$hardcode_libdirs"
10317
	libdir=$hardcode_libdirs
7622
	eval rpath=\" $hardcode_libdir_flag_spec\"
10318
	eval rpath=\" $hardcode_libdir_flag_spec\"
7623
      fi
10319
      fi
7624
      compile_rpath="$rpath"
10320
      compile_rpath=$rpath
7625
 
10321
 
7626
      rpath=
10322
      rpath=
7627
      hardcode_libdirs=
10323
      hardcode_libdirs=
7628
      for libdir in $finalize_rpath; do
10324
      for libdir in $finalize_rpath; do
7629
	if test -n "$hardcode_libdir_flag_spec"; then
10325
	if test -n "$hardcode_libdir_flag_spec"; then
7630
	  if test -n "$hardcode_libdir_separator"; then
10326
	  if test -n "$hardcode_libdir_separator"; then
7631
	    if test -z "$hardcode_libdirs"; then
10327
	    if test -z "$hardcode_libdirs"; then
7632
	      hardcode_libdirs="$libdir"
10328
	      hardcode_libdirs=$libdir
7633
	    else
10329
	    else
7634
	      # Just accumulate the unique libdirs.
10330
	      # Just accumulate the unique libdirs.
7635
	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10331
	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
7636
	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
10332
	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7637
		;;
10333
		;;
7638
	      *)
10334
	      *)
7639
		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
10335
		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
7640
		;;
10336
		;;
7641
	      esac
10337
	      esac
7642
	    fi
10338
	    fi
7643
	  else
10339
	  else
7644
	    eval flag=\"$hardcode_libdir_flag_spec\"
10340
	    eval flag=\"$hardcode_libdir_flag_spec\"
7645
	    rpath="$rpath $flag"
10341
	    func_append rpath " $flag"
7646
	  fi
10342
	  fi
7647
	elif test -n "$runpath_var"; then
10343
	elif test -n "$runpath_var"; then
7648
	  case "$finalize_perm_rpath " in
10344
	  case "$finalize_perm_rpath " in
7649
	  *" $libdir "*) ;;
10345
	  *" $libdir "*) ;;
7650
	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
10346
	  *) func_append finalize_perm_rpath " $libdir" ;;
7651
	  esac
10347
	  esac
7652
	fi
10348
	fi
7653
      done
10349
      done
7654
      # Substitute the hardcoded libdirs into the rpath.
10350
      # Substitute the hardcoded libdirs into the rpath.
7655
      if test -n "$hardcode_libdir_separator" &&
10351
      if test -n "$hardcode_libdir_separator" &&
7656
	 test -n "$hardcode_libdirs"; then
10352
	 test -n "$hardcode_libdirs"; then
7657
	libdir="$hardcode_libdirs"
10353
	libdir=$hardcode_libdirs
7658
	eval rpath=\" $hardcode_libdir_flag_spec\"
10354
	eval rpath=\" $hardcode_libdir_flag_spec\"
7659
      fi
10355
      fi
7660
      finalize_rpath="$rpath"
10356
      finalize_rpath=$rpath
7661
 
10357
 
7662
      if test -n "$libobjs" && test "$build_old_libs" = yes; then
10358
      if test -n "$libobjs" && test yes = "$build_old_libs"; then
7663
	# Transform all the library objects into standard objects.
10359
	# Transform all the library objects into standard objects.
7664
	compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
10360
	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
7665
	finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
10361
	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
7666
      fi
10362
      fi
7667
 
10363
 
7668
      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
10364
      func_generate_dlsyms "$outputname" "@PROGRAM@" false
7669
 
10365
 
7670
      # template prelinking step
10366
      # template prelinking step
7671
      if test -n "$prelink_cmds"; then
10367
      if test -n "$prelink_cmds"; then
7672
	func_execute_cmds "$prelink_cmds" 'exit $?'
10368
	func_execute_cmds "$prelink_cmds" 'exit $?'
7673
      fi
10369
      fi
7674
 
10370
 
7675
      wrappers_required=yes
10371
      wrappers_required=:
7676
      case $host in
10372
      case $host in
7677
      *cygwin* | *mingw* )
10373
      *cegcc* | *mingw32ce*)
7678
        if test "$build_libtool_libs" != yes; then
10374
        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
7679
          wrappers_required=no
10375
        wrappers_required=false
7680
        fi
-
 
7681
        ;;
10376
        ;;
7682
      *cegcc)
10377
      *cygwin* | *mingw* )
7683
        # Disable wrappers for cegcc, we are cross compiling anyway.
10378
        test yes = "$build_libtool_libs" || wrappers_required=false
7684
        wrappers_required=no
-
 
7685
        ;;
10379
        ;;
7686
      *)
10380
      *)
7687
        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
10381
        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
7688
          wrappers_required=no
10382
          wrappers_required=false
7689
        fi
10383
        fi
7690
        ;;
10384
        ;;
7691
      esac
10385
      esac
7692
      if test "$wrappers_required" = no; then
10386
      $wrappers_required || {
7693
	# Replace the output file specification.
10387
	# Replace the output file specification.
7694
	compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
10388
	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
7695
	link_command="$compile_command$compile_rpath"
10389
	link_command=$compile_command$compile_rpath
7696
 
10390
 
7697
	# We have no uninstalled library dependencies, so finalize right now.
10391
	# We have no uninstalled library dependencies, so finalize right now.
7698
	exit_status=0
10392
	exit_status=0
7699
	func_show_eval "$link_command" 'exit_status=$?'
10393
	func_show_eval "$link_command" 'exit_status=$?'
7700
 
10394
 
-
 
10395
	if test -n "$postlink_cmds"; then
-
 
10396
	  func_to_tool_file "$output"
-
 
10397
	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
-
 
10398
	  func_execute_cmds "$postlink_cmds" 'exit $?'
-
 
10399
	fi
-
 
10400
 
7701
	# Delete the generated files.
10401
	# Delete the generated files.
7702
	if test -f "$output_objdir/${outputname}S.${objext}"; then
10402
	if test -f "$output_objdir/${outputname}S.$objext"; then
7703
	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
10403
	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
7704
	fi
10404
	fi
7705
 
10405
 
7706
	exit $exit_status
10406
	exit $exit_status
7707
      fi
10407
      }
7708
 
10408
 
7709
      if test -n "$compile_shlibpath$finalize_shlibpath"; then
10409
      if test -n "$compile_shlibpath$finalize_shlibpath"; then
7710
	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
10410
	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
7711
      fi
10411
      fi
7712
      if test -n "$finalize_shlibpath"; then
10412
      if test -n "$finalize_shlibpath"; then
Line 7718... Line 10418...
7718
      if test -n "$runpath_var"; then
10418
      if test -n "$runpath_var"; then
7719
	if test -n "$perm_rpath"; then
10419
	if test -n "$perm_rpath"; then
7720
	  # We should set the runpath_var.
10420
	  # We should set the runpath_var.
7721
	  rpath=
10421
	  rpath=
7722
	  for dir in $perm_rpath; do
10422
	  for dir in $perm_rpath; do
7723
	    rpath="$rpath$dir:"
10423
	    func_append rpath "$dir:"
7724
	  done
10424
	  done
7725
	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
10425
	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
7726
	fi
10426
	fi
7727
	if test -n "$finalize_perm_rpath"; then
10427
	if test -n "$finalize_perm_rpath"; then
7728
	  # We should set the runpath_var.
10428
	  # We should set the runpath_var.
7729
	  rpath=
10429
	  rpath=
7730
	  for dir in $finalize_perm_rpath; do
10430
	  for dir in $finalize_perm_rpath; do
7731
	    rpath="$rpath$dir:"
10431
	    func_append rpath "$dir:"
7732
	  done
10432
	  done
7733
	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
10433
	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
7734
	fi
10434
	fi
7735
      fi
10435
      fi
7736
 
10436
 
7737
      if test "$no_install" = yes; then
10437
      if test yes = "$no_install"; then
7738
	# We don't need to create a wrapper script.
10438
	# We don't need to create a wrapper script.
7739
	link_command="$compile_var$compile_command$compile_rpath"
10439
	link_command=$compile_var$compile_command$compile_rpath
7740
	# Replace the output file specification.
10440
	# Replace the output file specification.
7741
	link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
10441
	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
7742
	# Delete the old output file.
10442
	# Delete the old output file.
7743
	$opt_dry_run || $RM $output
10443
	$opt_dry_run || $RM $output
7744
	# Link the executable and exit
10444
	# Link the executable and exit
7745
	func_show_eval "$link_command" 'exit $?'
10445
	func_show_eval "$link_command" 'exit $?'
7746
	exit $EXIT_SUCCESS
-
 
7747
      fi
-
 
7748
 
-
 
7749
      if test "$hardcode_action" = relink; then
-
 
7750
	# Fast installation is not supported
-
 
7751
	link_command="$compile_var$compile_command$compile_rpath"
-
 
7752
	relink_command="$finalize_var$finalize_command$finalize_rpath"
-
 
7753
 
10446
 
7754
	func_warning "this platform does not like uninstalled shared libraries"
-
 
7755
	func_warning "\`$output' will be relinked during installation"
-
 
7756
      else
-
 
7757
	if test "$fast_install" != no; then
10447
	if test -n "$postlink_cmds"; then
7758
	  link_command="$finalize_var$compile_command$finalize_rpath"
-
 
7759
	  if test "$fast_install" = yes; then
10448
	  func_to_tool_file "$output"
7760
	    relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
10449
	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
7761
	  else
-
 
7762
	    # fast_install is set to needless
-
 
7763
	    relink_command=
-
 
7764
	  fi
-
 
7765
	else
-
 
7766
	  link_command="$compile_var$compile_command$compile_rpath"
10450
	  func_execute_cmds "$postlink_cmds" 'exit $?'
7767
	  relink_command="$finalize_var$finalize_command$finalize_rpath"
-
 
7768
	fi
10451
	fi
-
 
10452
 
-
 
10453
	exit $EXIT_SUCCESS
7769
      fi
10454
      fi
7770
 
10455
 
-
 
10456
      case $hardcode_action,$fast_install in
-
 
10457
        relink,*)
-
 
10458
	  # Fast installation is not supported
-
 
10459
	  link_command=$compile_var$compile_command$compile_rpath
-
 
10460
	  relink_command=$finalize_var$finalize_command$finalize_rpath
-
 
10461
 
-
 
10462
	  func_warning "this platform does not like uninstalled shared libraries"
-
 
10463
	  func_warning "'$output' will be relinked during installation"
-
 
10464
	  ;;
-
 
10465
        *,yes)
-
 
10466
	  link_command=$finalize_var$compile_command$finalize_rpath
-
 
10467
	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
-
 
10468
          ;;
-
 
10469
	*,no)
-
 
10470
	  link_command=$compile_var$compile_command$compile_rpath
-
 
10471
	  relink_command=$finalize_var$finalize_command$finalize_rpath
-
 
10472
          ;;
-
 
10473
	*,needless)
-
 
10474
	  link_command=$finalize_var$compile_command$finalize_rpath
-
 
10475
	  relink_command=
-
 
10476
          ;;
-
 
10477
      esac
-
 
10478
 
7771
      # Replace the output file specification.
10479
      # Replace the output file specification.
7772
      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
10480
      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
7773
 
10481
 
7774
      # Delete the old output files.
10482
      # Delete the old output files.
7775
      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
10483
      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
7776
 
10484
 
7777
      func_show_eval "$link_command" 'exit $?'
10485
      func_show_eval "$link_command" 'exit $?'
7778
 
10486
 
-
 
10487
      if test -n "$postlink_cmds"; then
-
 
10488
	func_to_tool_file "$output_objdir/$outputname"
-
 
10489
	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'`
-
 
10490
	func_execute_cmds "$postlink_cmds" 'exit $?'
-
 
10491
      fi
-
 
10492
 
7779
      # Now create the wrapper script.
10493
      # Now create the wrapper script.
7780
      func_verbose "creating $output"
10494
      func_verbose "creating $output"
7781
 
10495
 
7782
      # Quote the relink command for shipping.
10496
      # Quote the relink command for shipping.
7783
      if test -n "$relink_command"; then
10497
      if test -n "$relink_command"; then
Line 7791... Line 10505...
7791
	    func_quote_for_eval "$var_value"
10505
	    func_quote_for_eval "$var_value"
7792
	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
10506
	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
7793
	  fi
10507
	  fi
7794
	done
10508
	done
7795
	relink_command="(cd `pwd`; $relink_command)"
10509
	relink_command="(cd `pwd`; $relink_command)"
7796
	relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
10510
	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
7797
      fi
-
 
7798
 
-
 
7799
      # Quote $ECHO for shipping.
-
 
7800
      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
-
 
7801
	case $progpath in
-
 
7802
	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
-
 
7803
	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
-
 
7804
	esac
-
 
7805
	qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
-
 
7806
      else
-
 
7807
	qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
-
 
7808
      fi
10511
      fi
7809
 
10512
 
7810
      # Only actually do things if not in dry run mode.
10513
      # Only actually do things if not in dry run mode.
7811
      $opt_dry_run || {
10514
      $opt_dry_run || {
7812
	# win32 will think the script is a binary if it has
10515
	# win32 will think the script is a binary if it has
Line 7826... Line 10529...
7826
	case $host in
10529
	case $host in
7827
	  *cygwin* | *mingw* )
10530
	  *cygwin* | *mingw* )
7828
	    func_dirname_and_basename "$output" "" "."
10531
	    func_dirname_and_basename "$output" "" "."
7829
	    output_name=$func_basename_result
10532
	    output_name=$func_basename_result
7830
	    output_path=$func_dirname_result
10533
	    output_path=$func_dirname_result
7831
	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
10534
	    cwrappersource=$output_path/$objdir/lt-$output_name.c
7832
	    cwrapper="$output_path/$output_name.exe"
10535
	    cwrapper=$output_path/$output_name.exe
7833
	    $RM $cwrappersource $cwrapper
10536
	    $RM $cwrappersource $cwrapper
7834
	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
10537
	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
7835
 
10538
 
7836
	    func_emit_cwrapperexe_src > $cwrappersource
10539
	    func_emit_cwrapperexe_src > $cwrappersource
7837
 
10540
 
Line 7848... Line 10551...
7848
	    func_ltwrapper_scriptname $cwrapper
10551
	    func_ltwrapper_scriptname $cwrapper
7849
	    $RM $func_ltwrapper_scriptname_result
10552
	    $RM $func_ltwrapper_scriptname_result
7850
	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
10553
	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
7851
	    $opt_dry_run || {
10554
	    $opt_dry_run || {
7852
	      # note: this script will not be executed, so do not chmod.
10555
	      # note: this script will not be executed, so do not chmod.
7853
	      if test "x$build" = "x$host" ; then
10556
	      if test "x$build" = "x$host"; then
7854
		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
10557
		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
7855
	      else
10558
	      else
7856
		func_emit_wrapper no > $func_ltwrapper_scriptname_result
10559
		func_emit_wrapper no > $func_ltwrapper_scriptname_result
7857
	      fi
10560
	      fi
7858
	    }
10561
	    }
Line 7871... Line 10574...
7871
    esac
10574
    esac
7872
 
10575
 
7873
    # See if we need to build an old-fashioned archive.
10576
    # See if we need to build an old-fashioned archive.
7874
    for oldlib in $oldlibs; do
10577
    for oldlib in $oldlibs; do
7875
 
10578
 
7876
      if test "$build_libtool_libs" = convenience; then
10579
      case $build_libtool_libs in
-
 
10580
        convenience)
7877
	oldobjs="$libobjs_save $symfileobj"
10581
	  oldobjs="$libobjs_save $symfileobj"
7878
	addlibs="$convenience"
10582
	  addlibs=$convenience
7879
	build_libtool_libs=no
-
 
7880
      else
-
 
7881
	if test "$build_libtool_libs" = module; then
-
 
7882
	  oldobjs="$libobjs_save"
-
 
7883
	  build_libtool_libs=no
10583
	  build_libtool_libs=no
7884
	else
10584
	  ;;
-
 
10585
	module)
-
 
10586
	  oldobjs=$libobjs_save
-
 
10587
	  addlibs=$old_convenience
-
 
10588
	  build_libtool_libs=no
-
 
10589
          ;;
-
 
10590
	*)
7885
	  oldobjs="$old_deplibs $non_pic_objects"
10591
	  oldobjs="$old_deplibs $non_pic_objects"
7886
	  if test "$preload" = yes && test -f "$symfileobj"; then
10592
	  $preload && test -f "$symfileobj" \
7887
	    oldobjs="$oldobjs $symfileobj"
10593
	    && func_append oldobjs " $symfileobj"
7888
	  fi
-
 
7889
	fi
-
 
7890
	addlibs="$old_convenience"
10594
	  addlibs=$old_convenience
-
 
10595
	  ;;
7891
      fi
10596
      esac
7892
 
10597
 
7893
      if test -n "$addlibs"; then
10598
      if test -n "$addlibs"; then
7894
	gentop="$output_objdir/${outputname}x"
10599
	gentop=$output_objdir/${outputname}x
7895
	generated="$generated $gentop"
10600
	func_append generated " $gentop"
7896
 
10601
 
7897
	func_extract_archives $gentop $addlibs
10602
	func_extract_archives $gentop $addlibs
7898
	oldobjs="$oldobjs $func_extract_archives_result"
10603
	func_append oldobjs " $func_extract_archives_result"
7899
      fi
10604
      fi
7900
 
10605
 
7901
      # Do each command in the archive commands.
10606
      # Do each command in the archive commands.
7902
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
10607
      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
7903
	cmds=$old_archive_from_new_cmds
10608
	cmds=$old_archive_from_new_cmds
7904
      else
10609
      else
7905
 
10610
 
7906
	# Add any objects from preloaded convenience libraries
10611
	# Add any objects from preloaded convenience libraries
7907
	if test -n "$dlprefiles"; then
10612
	if test -n "$dlprefiles"; then
7908
	  gentop="$output_objdir/${outputname}x"
10613
	  gentop=$output_objdir/${outputname}x
7909
	  generated="$generated $gentop"
10614
	  func_append generated " $gentop"
7910
 
10615
 
7911
	  func_extract_archives $gentop $dlprefiles
10616
	  func_extract_archives $gentop $dlprefiles
7912
	  oldobjs="$oldobjs $func_extract_archives_result"
10617
	  func_append oldobjs " $func_extract_archives_result"
7913
	fi
10618
	fi
7914
 
10619
 
7915
	# POSIX demands no paths to be encoded in archives.  We have
10620
	# POSIX demands no paths to be encoded in archives.  We have
7916
	# to avoid creating archives with duplicate basenames if we
10621
	# to avoid creating archives with duplicate basenames if we
7917
	# might have to extract them afterwards, e.g., when creating a
10622
	# might have to extract them afterwards, e.g., when creating a
Line 7923... Line 10628...
7923
	      func_basename "$obj"
10628
	      func_basename "$obj"
7924
	      $ECHO "$func_basename_result"
10629
	      $ECHO "$func_basename_result"
7925
	    done | sort | sort -uc >/dev/null 2>&1); then
10630
	    done | sort | sort -uc >/dev/null 2>&1); then
7926
	  :
10631
	  :
7927
	else
10632
	else
7928
	  $ECHO "copying selected object files to avoid basename conflicts..."
10633
	  echo "copying selected object files to avoid basename conflicts..."
7929
	  gentop="$output_objdir/${outputname}x"
10634
	  gentop=$output_objdir/${outputname}x
7930
	  generated="$generated $gentop"
10635
	  func_append generated " $gentop"
7931
	  func_mkdir_p "$gentop"
10636
	  func_mkdir_p "$gentop"
7932
	  save_oldobjs=$oldobjs
10637
	  save_oldobjs=$oldobjs
7933
	  oldobjs=
10638
	  oldobjs=
7934
	  counter=1
10639
	  counter=1
7935
	  for obj in $save_oldobjs
10640
	  for obj in $save_oldobjs
7936
	  do
10641
	  do
7937
	    func_basename "$obj"
10642
	    func_basename "$obj"
7938
	    objbase="$func_basename_result"
10643
	    objbase=$func_basename_result
7939
	    case " $oldobjs " in
10644
	    case " $oldobjs " in
7940
	    " ") oldobjs=$obj ;;
10645
	    " ") oldobjs=$obj ;;
7941
	    *[\ /]"$objbase "*)
10646
	    *[\ /]"$objbase "*)
7942
	      while :; do
10647
	      while :; do
7943
		# Make sure we don't pick an alternate name that also
10648
		# Make sure we don't pick an alternate name that also
Line 7949... Line 10654...
7949
		*[\ /]"$newobj "*) ;;
10654
		*[\ /]"$newobj "*) ;;
7950
		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
10655
		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
7951
		esac
10656
		esac
7952
	      done
10657
	      done
7953
	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
10658
	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
7954
	      oldobjs="$oldobjs $gentop/$newobj"
10659
	      func_append oldobjs " $gentop/$newobj"
7955
	      ;;
10660
	      ;;
7956
	    *) oldobjs="$oldobjs $obj" ;;
10661
	    *) func_append oldobjs " $obj" ;;
7957
	    esac
10662
	    esac
7958
	  done
10663
	  done
7959
	fi
10664
	fi
-
 
10665
	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
-
 
10666
	tool_oldlib=$func_to_tool_file_result
7960
	eval cmds=\"$old_archive_cmds\"
10667
	eval cmds=\"$old_archive_cmds\"
7961
 
10668
 
7962
	func_len " $cmds"
10669
	func_len " $cmds"
7963
	len=$func_len_result
10670
	len=$func_len_result
7964
	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
10671
	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7965
	  cmds=$old_archive_cmds
10672
	  cmds=$old_archive_cmds
-
 
10673
	elif test -n "$archiver_list_spec"; then
-
 
10674
	  func_verbose "using command file archive linking..."
-
 
10675
	  for obj in $oldobjs
-
 
10676
	  do
-
 
10677
	    func_to_tool_file "$obj"
-
 
10678
	    $ECHO "$func_to_tool_file_result"
-
 
10679
	  done > $output_objdir/$libname.libcmd
-
 
10680
	  func_to_tool_file "$output_objdir/$libname.libcmd"
-
 
10681
	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
-
 
10682
	  cmds=$old_archive_cmds
7966
	else
10683
	else
7967
	  # the command line is too long to link in one step, link in parts
10684
	  # the command line is too long to link in one step, link in parts
7968
	  func_verbose "using piecewise archive linking..."
10685
	  func_verbose "using piecewise archive linking..."
7969
	  save_RANLIB=$RANLIB
10686
	  save_RANLIB=$RANLIB
7970
	  RANLIB=:
10687
	  RANLIB=:
Line 7990... Line 10707...
7990
	    if test "$len" -lt "$max_cmd_len"; then
10707
	    if test "$len" -lt "$max_cmd_len"; then
7991
	      :
10708
	      :
7992
	    else
10709
	    else
7993
	      # the above command should be used before it gets too long
10710
	      # the above command should be used before it gets too long
7994
	      oldobjs=$objlist
10711
	      oldobjs=$objlist
7995
	      if test "$obj" = "$last_oldobj" ; then
10712
	      if test "$obj" = "$last_oldobj"; then
7996
		RANLIB=$save_RANLIB
10713
		RANLIB=$save_RANLIB
7997
	      fi
10714
	      fi
7998
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
10715
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7999
	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
10716
	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
8000
	      objlist=
10717
	      objlist=
8001
	      len=$len0
10718
	      len=$len0
8002
	    fi
10719
	    fi
8003
	  done
10720
	  done
8004
	  RANLIB=$save_RANLIB
10721
	  RANLIB=$save_RANLIB
8005
	  oldobjs=$objlist
10722
	  oldobjs=$objlist
8006
	  if test "X$oldobjs" = "X" ; then
10723
	  if test -z "$oldobjs"; then
8007
	    eval cmds=\"\$concat_cmds\"
10724
	    eval cmds=\"\$concat_cmds\"
8008
	  else
10725
	  else
8009
	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
10726
	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
8010
	  fi
10727
	  fi
8011
	fi
10728
	fi
Line 8018... Line 10735...
8018
 
10735
 
8019
    # Now create the libtool archive.
10736
    # Now create the libtool archive.
8020
    case $output in
10737
    case $output in
8021
    *.la)
10738
    *.la)
8022
      old_library=
10739
      old_library=
8023
      test "$build_old_libs" = yes && old_library="$libname.$libext"
10740
      test yes = "$build_old_libs" && old_library=$libname.$libext
8024
      func_verbose "creating $output"
10741
      func_verbose "creating $output"
8025
 
10742
 
8026
      # Preserve any variables that may affect compiler behavior
10743
      # Preserve any variables that may affect compiler behavior
8027
      for var in $variables_saved_for_relink; do
10744
      for var in $variables_saved_for_relink; do
8028
	if eval test -z \"\${$var+set}\"; then
10745
	if eval test -z \"\${$var+set}\"; then
Line 8033... Line 10750...
8033
	  func_quote_for_eval "$var_value"
10750
	  func_quote_for_eval "$var_value"
8034
	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
10751
	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
8035
	fi
10752
	fi
8036
      done
10753
      done
8037
      # Quote the link command for shipping.
10754
      # Quote the link command for shipping.
8038
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
10755
      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8039
      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
10756
      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
8040
      if test "$hardcode_automatic" = yes ; then
10757
      if test yes = "$hardcode_automatic"; then
8041
	relink_command=
10758
	relink_command=
8042
      fi
10759
      fi
8043
 
10760
 
8044
      # Only create the output if not a dry run.
10761
      # Only create the output if not a dry run.
8045
      $opt_dry_run || {
10762
      $opt_dry_run || {
8046
	for installed in no yes; do
10763
	for installed in no yes; do
8047
	  if test "$installed" = yes; then
10764
	  if test yes = "$installed"; then
8048
	    if test -z "$install_libdir"; then
10765
	    if test -z "$install_libdir"; then
8049
	      break
10766
	      break
8050
	    fi
10767
	    fi
8051
	    output="$output_objdir/$outputname"i
10768
	    output=$output_objdir/${outputname}i
8052
	    # Replace all uninstalled libtool libraries with the installed ones
10769
	    # Replace all uninstalled libtool libraries with the installed ones
8053
	    newdependency_libs=
10770
	    newdependency_libs=
8054
	    for deplib in $dependency_libs; do
10771
	    for deplib in $dependency_libs; do
8055
	      case $deplib in
10772
	      case $deplib in
8056
	      *.la)
10773
	      *.la)
8057
		func_basename "$deplib"
10774
		func_basename "$deplib"
8058
		name="$func_basename_result"
10775
		name=$func_basename_result
-
 
10776
		func_resolve_sysroot "$deplib"
8059
		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
10777
		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
8060
		test -z "$libdir" && \
10778
		test -z "$libdir" && \
8061
		  func_fatal_error "\`$deplib' is not a valid libtool archive"
10779
		  func_fatal_error "'$deplib' is not a valid libtool archive"
8062
		newdependency_libs="$newdependency_libs $libdir/$name"
10780
		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
8063
		;;
10781
		;;
-
 
10782
	      -L*)
-
 
10783
		func_stripname -L '' "$deplib"
-
 
10784
		func_replace_sysroot "$func_stripname_result"
-
 
10785
		func_append newdependency_libs " -L$func_replace_sysroot_result"
-
 
10786
		;;
-
 
10787
	      -R*)
-
 
10788
		func_stripname -R '' "$deplib"
-
 
10789
		func_replace_sysroot "$func_stripname_result"
-
 
10790
		func_append newdependency_libs " -R$func_replace_sysroot_result"
-
 
10791
		;;
8064
	      *) newdependency_libs="$newdependency_libs $deplib" ;;
10792
	      *) func_append newdependency_libs " $deplib" ;;
8065
	      esac
10793
	      esac
8066
	    done
10794
	    done
8067
	    dependency_libs="$newdependency_libs"
10795
	    dependency_libs=$newdependency_libs
8068
	    newdlfiles=
10796
	    newdlfiles=
8069
 
10797
 
8070
	    for lib in $dlfiles; do
10798
	    for lib in $dlfiles; do
8071
	      case $lib in
10799
	      case $lib in
8072
	      *.la)
10800
	      *.la)
8073
	        func_basename "$lib"
10801
	        func_basename "$lib"
8074
		name="$func_basename_result"
10802
		name=$func_basename_result
8075
		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
10803
		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8076
		test -z "$libdir" && \
10804
		test -z "$libdir" && \
8077
		  func_fatal_error "\`$lib' is not a valid libtool archive"
10805
		  func_fatal_error "'$lib' is not a valid libtool archive"
8078
		newdlfiles="$newdlfiles $libdir/$name"
10806
		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
8079
		;;
10807
		;;
8080
	      *) newdlfiles="$newdlfiles $lib" ;;
10808
	      *) func_append newdlfiles " $lib" ;;
8081
	      esac
10809
	      esac
8082
	    done
10810
	    done
8083
	    dlfiles="$newdlfiles"
10811
	    dlfiles=$newdlfiles
8084
	    newdlprefiles=
10812
	    newdlprefiles=
8085
	    for lib in $dlprefiles; do
10813
	    for lib in $dlprefiles; do
8086
	      case $lib in
10814
	      case $lib in
8087
	      *.la)
10815
	      *.la)
8088
		# Only pass preopened files to the pseudo-archive (for
10816
		# Only pass preopened files to the pseudo-archive (for
8089
		# eventual linking with the app. that links it) if we
10817
		# eventual linking with the app. that links it) if we
8090
		# didn't already link the preopened objects directly into
10818
		# didn't already link the preopened objects directly into
8091
		# the library:
10819
		# the library:
8092
		func_basename "$lib"
10820
		func_basename "$lib"
8093
		name="$func_basename_result"
10821
		name=$func_basename_result
8094
		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
10822
		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8095
		test -z "$libdir" && \
10823
		test -z "$libdir" && \
8096
		  func_fatal_error "\`$lib' is not a valid libtool archive"
10824
		  func_fatal_error "'$lib' is not a valid libtool archive"
8097
		newdlprefiles="$newdlprefiles $libdir/$name"
10825
		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
8098
		;;
10826
		;;
8099
	      esac
10827
	      esac
8100
	    done
10828
	    done
8101
	    dlprefiles="$newdlprefiles"
10829
	    dlprefiles=$newdlprefiles
8102
	  else
10830
	  else
8103
	    newdlfiles=
10831
	    newdlfiles=
8104
	    for lib in $dlfiles; do
10832
	    for lib in $dlfiles; do
8105
	      case $lib in
10833
	      case $lib in
8106
		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
10834
		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
8107
		*) abs=`pwd`"/$lib" ;;
10835
		*) abs=`pwd`"/$lib" ;;
8108
	      esac
10836
	      esac
8109
	      newdlfiles="$newdlfiles $abs"
10837
	      func_append newdlfiles " $abs"
8110
	    done
10838
	    done
8111
	    dlfiles="$newdlfiles"
10839
	    dlfiles=$newdlfiles
8112
	    newdlprefiles=
10840
	    newdlprefiles=
8113
	    for lib in $dlprefiles; do
10841
	    for lib in $dlprefiles; do
8114
	      case $lib in
10842
	      case $lib in
8115
		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
10843
		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
8116
		*) abs=`pwd`"/$lib" ;;
10844
		*) abs=`pwd`"/$lib" ;;
8117
	      esac
10845
	      esac
8118
	      newdlprefiles="$newdlprefiles $abs"
10846
	      func_append newdlprefiles " $abs"
8119
	    done
10847
	    done
8120
	    dlprefiles="$newdlprefiles"
10848
	    dlprefiles=$newdlprefiles
8121
	  fi
10849
	  fi
8122
	  $RM $output
10850
	  $RM $output
8123
	  # place dlname in correct position for cygwin
10851
	  # place dlname in correct position for cygwin
-
 
10852
	  # In fact, it would be nice if we could use this code for all target
-
 
10853
	  # systems that can't hard-code library paths into their executables
-
 
10854
	  # and that have no shared library path variable independent of PATH,
-
 
10855
	  # but it turns out we can't easily determine that from inspecting
-
 
10856
	  # libtool variables, so we have to hard-code the OSs to which it
-
 
10857
	  # applies here; at the moment, that means platforms that use the PE
-
 
10858
	  # object format with DLL files.  See the long comment at the top of
-
 
10859
	  # tests/bindir.at for full details.
8124
	  tdlname=$dlname
10860
	  tdlname=$dlname
8125
	  case $host,$output,$installed,$module,$dlname in
10861
	  case $host,$output,$installed,$module,$dlname in
8126
	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
10862
	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
-
 
10863
	      # If a -bindir argument was supplied, place the dll there.
-
 
10864
	      if test -n "$bindir"; then
-
 
10865
		func_relative_path "$install_libdir" "$bindir"
-
 
10866
		tdlname=$func_relative_path_result/$dlname
-
 
10867
	      else
-
 
10868
		# Otherwise fall back on heuristic.
-
 
10869
		tdlname=../bin/$dlname
-
 
10870
	      fi
-
 
10871
	      ;;
8127
	  esac
10872
	  esac
8128
	  $ECHO > $output "\
10873
	  $ECHO > $output "\
8129
# $outputname - a libtool library file
10874
# $outputname - a libtool library file
8130
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
10875
# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
8131
#
10876
#
8132
# Please DO NOT delete this file!
10877
# Please DO NOT delete this file!
8133
# It is necessary for linking the library.
10878
# It is necessary for linking the library.
8134
 
10879
 
8135
# The name that we can dlopen(3).
10880
# The name that we can dlopen(3).
Line 8139... Line 10884...
8139
library_names='$library_names'
10884
library_names='$library_names'
8140
 
10885
 
8141
# The name of the static archive.
10886
# The name of the static archive.
8142
old_library='$old_library'
10887
old_library='$old_library'
8143
 
10888
 
8144
# Linker flags that can not go in dependency_libs.
10889
# Linker flags that cannot go in dependency_libs.
8145
inherited_linker_flags='$new_inherited_linker_flags'
10890
inherited_linker_flags='$new_inherited_linker_flags'
8146
 
10891
 
8147
# Libraries that this one depends upon.
10892
# Libraries that this one depends upon.
8148
dependency_libs='$dependency_libs'
10893
dependency_libs='$dependency_libs'
8149
 
10894
 
Line 8165... Line 10910...
8165
dlopen='$dlfiles'
10910
dlopen='$dlfiles'
8166
dlpreopen='$dlprefiles'
10911
dlpreopen='$dlprefiles'
8167
 
10912
 
8168
# Directory that this library needs to be installed in:
10913
# Directory that this library needs to be installed in:
8169
libdir='$install_libdir'"
10914
libdir='$install_libdir'"
8170
	  if test "$installed" = no && test "$need_relink" = yes; then
10915
	  if test no,yes = "$installed,$need_relink"; then
8171
	    $ECHO >> $output "\
10916
	    $ECHO >> $output "\
8172
relink_command=\"$relink_command\""
10917
relink_command=\"$relink_command\""
8173
	  fi
10918
	  fi
8174
	done
10919
	done
8175
      }
10920
      }
Line 8180... Line 10925...
8180
      ;;
10925
      ;;
8181
    esac
10926
    esac
8182
    exit $EXIT_SUCCESS
10927
    exit $EXIT_SUCCESS
8183
}
10928
}
8184
 
10929
 
8185
{ test "$mode" = link || test "$mode" = relink; } &&
10930
if test link = "$opt_mode" || test relink = "$opt_mode"; then
8186
    func_mode_link ${1+"$@"}
10931
  func_mode_link ${1+"$@"}
-
 
10932
fi
8187
 
10933
 
8188
 
10934
 
8189
# func_mode_uninstall arg...
10935
# func_mode_uninstall arg...
8190
func_mode_uninstall ()
10936
func_mode_uninstall ()
8191
{
10937
{
8192
    $opt_debug
10938
    $debug_cmd
-
 
10939
 
8193
    RM="$nonopt"
10940
    RM=$nonopt
8194
    files=
10941
    files=
8195
    rmforce=
10942
    rmforce=false
8196
    exit_status=0
10943
    exit_status=0
8197
 
10944
 
8198
    # This variable tells wrapper scripts just to set variables rather
10945
    # This variable tells wrapper scripts just to set variables rather
8199
    # than running their programs.
10946
    # than running their programs.
8200
    libtool_install_magic="$magic"
10947
    libtool_install_magic=$magic
8201
 
10948
 
8202
    for arg
10949
    for arg
8203
    do
10950
    do
8204
      case $arg in
10951
      case $arg in
8205
      -f) RM="$RM $arg"; rmforce=yes ;;
10952
      -f) func_append RM " $arg"; rmforce=: ;;
8206
      -*) RM="$RM $arg" ;;
10953
      -*) func_append RM " $arg" ;;
8207
      *) files="$files $arg" ;;
10954
      *) func_append files " $arg" ;;
8208
      esac
10955
      esac
8209
    done
10956
    done
8210
 
10957
 
8211
    test -z "$RM" && \
10958
    test -z "$RM" && \
8212
      func_fatal_help "you must specify an RM program"
10959
      func_fatal_help "you must specify an RM program"
8213
 
10960
 
8214
    rmdirs=
10961
    rmdirs=
8215
 
10962
 
8216
    origobjdir="$objdir"
-
 
8217
    for file in $files; do
10963
    for file in $files; do
8218
      func_dirname "$file" "" "."
10964
      func_dirname "$file" "" "."
8219
      dir="$func_dirname_result"
10965
      dir=$func_dirname_result
8220
      if test "X$dir" = X.; then
10966
      if test . = "$dir"; then
8221
	objdir="$origobjdir"
10967
	odir=$objdir
8222
      else
10968
      else
8223
	objdir="$dir/$origobjdir"
10969
	odir=$dir/$objdir
8224
      fi
10970
      fi
8225
      func_basename "$file"
10971
      func_basename "$file"
8226
      name="$func_basename_result"
10972
      name=$func_basename_result
8227
      test "$mode" = uninstall && objdir="$dir"
10973
      test uninstall = "$opt_mode" && odir=$dir
8228
 
10974
 
8229
      # Remember objdir for removal later, being careful to avoid duplicates
10975
      # Remember odir for removal later, being careful to avoid duplicates
8230
      if test "$mode" = clean; then
10976
      if test clean = "$opt_mode"; then
8231
	case " $rmdirs " in
10977
	case " $rmdirs " in
8232
	  *" $objdir "*) ;;
10978
	  *" $odir "*) ;;
8233
	  *) rmdirs="$rmdirs $objdir" ;;
10979
	  *) func_append rmdirs " $odir" ;;
8234
	esac
10980
	esac
8235
      fi
10981
      fi
8236
 
10982
 
8237
      # Don't error if the file doesn't exist and rm -f was used.
10983
      # Don't error if the file doesn't exist and rm -f was used.
8238
      if { test -L "$file"; } >/dev/null 2>&1 ||
10984
      if { test -L "$file"; } >/dev/null 2>&1 ||
Line 8240... Line 10986...
8240
	 test -f "$file"; then
10986
	 test -f "$file"; then
8241
	:
10987
	:
8242
      elif test -d "$file"; then
10988
      elif test -d "$file"; then
8243
	exit_status=1
10989
	exit_status=1
8244
	continue
10990
	continue
8245
      elif test "$rmforce" = yes; then
10991
      elif $rmforce; then
8246
	continue
10992
	continue
8247
      fi
10993
      fi
8248
 
10994
 
8249
      rmfiles="$file"
10995
      rmfiles=$file
8250
 
10996
 
8251
      case $name in
10997
      case $name in
8252
      *.la)
10998
      *.la)
8253
	# Possibly a libtool archive, so verify it.
10999
	# Possibly a libtool archive, so verify it.
8254
	if func_lalib_p "$file"; then
11000
	if func_lalib_p "$file"; then
8255
	  func_source $dir/$name
11001
	  func_source $dir/$name
8256
 
11002
 
8257
	  # Delete the libtool libraries and symlinks.
11003
	  # Delete the libtool libraries and symlinks.
8258
	  for n in $library_names; do
11004
	  for n in $library_names; do
8259
	    rmfiles="$rmfiles $objdir/$n"
11005
	    func_append rmfiles " $odir/$n"
8260
	  done
11006
	  done
8261
	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
11007
	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
8262
 
11008
 
8263
	  case "$mode" in
11009
	  case $opt_mode in
8264
	  clean)
11010
	  clean)
8265
	    case "  $library_names " in
11011
	    case " $library_names " in
8266
	    # "  " in the beginning catches empty $dlname
-
 
8267
	    *" $dlname "*) ;;
11012
	    *" $dlname "*) ;;
8268
	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
11013
	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
8269
	    esac
11014
	    esac
8270
	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
11015
	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
8271
	    ;;
11016
	    ;;
8272
	  uninstall)
11017
	  uninstall)
8273
	    if test -n "$library_names"; then
11018
	    if test -n "$library_names"; then
8274
	      # Do each command in the postuninstall commands.
11019
	      # Do each command in the postuninstall commands.
8275
	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
11020
	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
8276
	    fi
11021
	    fi
8277
 
11022
 
8278
	    if test -n "$old_library"; then
11023
	    if test -n "$old_library"; then
8279
	      # Do each command in the old_postuninstall commands.
11024
	      # Do each command in the old_postuninstall commands.
8280
	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
11025
	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
8281
	    fi
11026
	    fi
8282
	    # FIXME: should reinstall the best remaining shared library.
11027
	    # FIXME: should reinstall the best remaining shared library.
8283
	    ;;
11028
	    ;;
8284
	  esac
11029
	  esac
8285
	fi
11030
	fi
Line 8291... Line 11036...
8291
 
11036
 
8292
	  # Read the .lo file
11037
	  # Read the .lo file
8293
	  func_source $dir/$name
11038
	  func_source $dir/$name
8294
 
11039
 
8295
	  # Add PIC object to the list of files to remove.
11040
	  # Add PIC object to the list of files to remove.
8296
	  if test -n "$pic_object" &&
-
 
8297
	     test "$pic_object" != none; then
11041
	  if test -n "$pic_object" && test none != "$pic_object"; then
8298
	    rmfiles="$rmfiles $dir/$pic_object"
11042
	    func_append rmfiles " $dir/$pic_object"
8299
	  fi
11043
	  fi
8300
 
11044
 
8301
	  # Add non-PIC object to the list of files to remove.
11045
	  # Add non-PIC object to the list of files to remove.
8302
	  if test -n "$non_pic_object" &&
-
 
8303
	     test "$non_pic_object" != none; then
11046
	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
8304
	    rmfiles="$rmfiles $dir/$non_pic_object"
11047
	    func_append rmfiles " $dir/$non_pic_object"
8305
	  fi
11048
	  fi
8306
	fi
11049
	fi
8307
	;;
11050
	;;
8308
 
11051
 
8309
      *)
11052
      *)
8310
	if test "$mode" = clean ; then
11053
	if test clean = "$opt_mode"; then
8311
	  noexename=$name
11054
	  noexename=$name
8312
	  case $file in
11055
	  case $file in
8313
	  *.exe)
11056
	  *.exe)
8314
	    func_stripname '' '.exe' "$file"
11057
	    func_stripname '' '.exe' "$file"
8315
	    file=$func_stripname_result
11058
	    file=$func_stripname_result
8316
	    func_stripname '' '.exe' "$name"
11059
	    func_stripname '' '.exe' "$name"
8317
	    noexename=$func_stripname_result
11060
	    noexename=$func_stripname_result
8318
	    # $file with .exe has already been added to rmfiles,
11061
	    # $file with .exe has already been added to rmfiles,
8319
	    # add $file without .exe
11062
	    # add $file without .exe
8320
	    rmfiles="$rmfiles $file"
11063
	    func_append rmfiles " $file"
8321
	    ;;
11064
	    ;;
8322
	  esac
11065
	  esac
8323
	  # Do a test to see if this is a libtool program.
11066
	  # Do a test to see if this is a libtool program.
8324
	  if func_ltwrapper_p "$file"; then
11067
	  if func_ltwrapper_p "$file"; then
8325
	    if func_ltwrapper_executable_p "$file"; then
11068
	    if func_ltwrapper_executable_p "$file"; then
8326
	      func_ltwrapper_scriptname "$file"
11069
	      func_ltwrapper_scriptname "$file"
8327
	      relink_command=
11070
	      relink_command=
8328
	      func_source $func_ltwrapper_scriptname_result
11071
	      func_source $func_ltwrapper_scriptname_result
8329
	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
11072
	      func_append rmfiles " $func_ltwrapper_scriptname_result"
8330
	    else
11073
	    else
8331
	      relink_command=
11074
	      relink_command=
8332
	      func_source $dir/$noexename
11075
	      func_source $dir/$noexename
8333
	    fi
11076
	    fi
8334
 
11077
 
8335
	    # note $name still contains .exe if it was in $file originally
11078
	    # note $name still contains .exe if it was in $file originally
8336
	    # as does the version of $file that was added into $rmfiles
11079
	    # as does the version of $file that was added into $rmfiles
8337
	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
11080
	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
8338
	    if test "$fast_install" = yes && test -n "$relink_command"; then
11081
	    if test yes = "$fast_install" && test -n "$relink_command"; then
8339
	      rmfiles="$rmfiles $objdir/lt-$name"
11082
	      func_append rmfiles " $odir/lt-$name"
8340
	    fi
11083
	    fi
8341
	    if test "X$noexename" != "X$name" ; then
11084
	    if test "X$noexename" != "X$name"; then
8342
	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
11085
	      func_append rmfiles " $odir/lt-$noexename.c"
8343
	    fi
11086
	    fi
8344
	  fi
11087
	  fi
8345
	fi
11088
	fi
8346
	;;
11089
	;;
8347
      esac
11090
      esac
8348
      func_show_eval "$RM $rmfiles" 'exit_status=1'
11091
      func_show_eval "$RM $rmfiles" 'exit_status=1'
8349
    done
11092
    done
8350
    objdir="$origobjdir"
-
 
8351
 
11093
 
8352
    # Try to remove the ${objdir}s in the directories where we deleted files
11094
    # Try to remove the $objdir's in the directories where we deleted files
8353
    for dir in $rmdirs; do
11095
    for dir in $rmdirs; do
8354
      if test -d "$dir"; then
11096
      if test -d "$dir"; then
8355
	func_show_eval "rmdir $dir >/dev/null 2>&1"
11097
	func_show_eval "rmdir $dir >/dev/null 2>&1"
8356
      fi
11098
      fi
8357
    done
11099
    done
8358
 
11100
 
8359
    exit $exit_status
11101
    exit $exit_status
8360
}
11102
}
8361
 
11103
 
8362
{ test "$mode" = uninstall || test "$mode" = clean; } &&
11104
if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
8363
    func_mode_uninstall ${1+"$@"}
11105
  func_mode_uninstall ${1+"$@"}
-
 
11106
fi
8364
 
11107
 
8365
test -z "$mode" && {
11108
test -z "$opt_mode" && {
8366
  help="$generic_help"
11109
  help=$generic_help
8367
  func_fatal_help "you must specify a MODE"
11110
  func_fatal_help "you must specify a MODE"
8368
}
11111
}
8369
 
11112
 
8370
test -z "$exec_cmd" && \
11113
test -z "$exec_cmd" && \
8371
  func_fatal_help "invalid operation mode \`$mode'"
11114
  func_fatal_help "invalid operation mode '$opt_mode'"
8372
 
11115
 
8373
if test -n "$exec_cmd"; then
11116
if test -n "$exec_cmd"; then
8374
  eval exec "$exec_cmd"
11117
  eval exec "$exec_cmd"
8375
  exit $EXIT_FAILURE
11118
  exit $EXIT_FAILURE
8376
fi
11119
fi
8377
 
11120
 
8378
exit $exit_status
11121
exit $exit_status
8379
 
11122
 
8380
 
11123
 
8381
# The TAGs below are defined such that we never get into a situation
11124
# The TAGs below are defined such that we never get into a situation
8382
# in which we disable both kinds of libraries.  Given conflicting
11125
# where we disable both kinds of libraries.  Given conflicting
8383
# choices, we go for a static library, that is the most portable,
11126
# choices, we go for a static library, that is the most portable,
8384
# since we can't tell whether shared libraries were disabled because
11127
# since we can't tell whether shared libraries were disabled because
8385
# the user asked for that or because the platform doesn't support
11128
# the user asked for that or because the platform doesn't support
8386
# them.  This is particularly important on AIX, because we don't
11129
# them.  This is particularly important on AIX, because we don't
8387
# support having both static and shared libraries enabled at the same
11130
# support having both static and shared libraries enabled at the same
Line 8400... Line 11143...
8400
 
11143
 
8401
# Local Variables:
11144
# Local Variables:
8402
# mode:shell-script
11145
# mode:shell-script
8403
# sh-indentation:2
11146
# sh-indentation:2
8404
# End:
11147
# End:
8405
# vi:sw=2
-
 
8406
 
-