Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 527506 | Differences between
and this patch

Collapse All | Expand All

(-)apr-1.5.1.old/build/ltmain.sh (-2044 / +3433 lines)
Lines 1-9 Link Here
1
#! /bin/sh
2
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
3
##               by inline-source v2014-01-03.01
1
4
2
# libtool (GNU libtool) 2.4.2
5
# libtool (GNU libtool) 2.4.3
6
# Provide generalized library-building support services.
3
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
4
8
5
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
9
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
6
# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
7
# This is free software; see the source for copying conditions.  There is NO
10
# This is free software; see the source for copying conditions.  There is NO
8
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
12
Lines 23-903 Link Here
23
# General Public License for more details.
26
# General Public License for more details.
24
#
27
#
25
# You should have received a copy of the GNU General Public License
28
# You should have received a copy of the GNU General Public License
26
# along with GNU Libtool; see the file COPYING.  If not, a copy
29
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
27
# can be downloaded from http://www.gnu.org/licenses/gpl.html,
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
# Usage: $progname [OPTION]... [MODE-ARG]...
32
#
33
# Provide generalized library-building support services.
34
#
35
#       --config             show all configuration variables
36
#       --debug              enable verbose shell tracing
37
#   -n, --dry-run            display commands without modifying any files
38
#       --features           display basic configuration information and exit
39
#       --mode=MODE          use operation mode MODE
40
#       --preserve-dup-deps  don't remove duplicate dependency libraries
41
#       --quiet, --silent    don't print informational messages
42
#       --no-quiet, --no-silent
43
#                            print informational messages (default)
44
#       --no-warn            don't display warning messages
45
#       --tag=TAG            use configuration variables from tag TAG
46
#   -v, --verbose            print more informational messages than default
47
#       --no-verbose         don't print the extra informational messages
48
#       --version            print version information
49
#   -h, --help, --help-all   print short, long, or detailed help message
50
#
51
# MODE must be one of the following:
52
#
53
#         clean              remove files from the build directory
54
#         compile            compile a source file into a libtool object
55
#         execute            automatically set library path, then run a program
56
#         finish             complete the installation of libtool libraries
57
#         install            install libraries or executables
58
#         link               create a library or an executable
59
#         uninstall          remove libraries from an installed directory
60
#
61
# MODE-ARGS vary depending on the MODE.  When passed as first option,
62
# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
63
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
64
#
65
# When reporting a bug, please describe a test case to reproduce it and
66
# include the following information:
67
#
68
#         host-triplet:	$host
69
#         shell:		$SHELL
70
#         compiler:		$LTCC
71
#         compiler flags:		$LTCFLAGS
72
#         linker:		$LD (gnu? $with_gnu_ld)
73
#         $progname:	(GNU libtool) 2.4.2
74
#         automake:	$automake_version
75
#         autoconf:	$autoconf_version
76
#
77
# Report bugs to <bug-libtool@gnu.org>.
78
# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
79
# General help using GNU software: <http://www.gnu.org/gethelp/>.
80
31
81
PROGRAM=libtool
32
PROGRAM=libtool
82
PACKAGE=libtool
33
PACKAGE=libtool
83
VERSION=2.4.2
34
VERSION=2.4.3
84
TIMESTAMP=""
35
package_revision=2.4.3
85
package_revision=1.3337
86
36
87
# Be Bourne compatible
37
88
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
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
64
# libraries, which are installed to $pkgauxdir.
65
66
# Set a version string for this script.
67
scriptversion=2014-01-03.01; # UTC
68
69
# General shell script boiler plate, and helper functions.
70
# Written by Gary V. Vaughan, 2004
71
72
# Copyright (C) 2004-2014 Free Software Foundation, Inc.
73
# This is free software; see the source for copying conditions.  There is NO
74
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
75
76
# This program is free software; you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
78
# the Free Software Foundation; either version 3 of the License, or
79
# (at your option) any later version.
80
81
# As a special exception to the GNU General Public License, if you distribute
82
# this file as part of a program or library that is built using GNU Libtool,
83
# you may include this file under the same distribution terms that you use
84
# for the rest of that program.
85
86
# This program is distributed in the hope that it will be useful,
87
# but WITHOUT ANY WARRANTY; without even the implied warranty of
88
# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
89
# General Public License for more details.
90
91
# You should have received a copy of the GNU General Public License
92
# along with this program. If not, see <http://www.gnu.org/licenses/>.
93
94
# Please report bugs or propose patches to gary@gnu.org.
95
96
97
## ------ ##
98
## Usage. ##
99
## ------ ##
100
101
# Evaluate this file near the top of your script to gain access to
102
# the functions and variables defined here:
103
#
104
#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
105
#
106
# If you need to override any of the default environment variable
107
# settings, do that before evaluating this file.
108
109
110
## -------------------- ##
111
## Shell normalisation. ##
112
## -------------------- ##
113
114
# Some shells need a little help to be as Bourne compatible as possible.
115
# Before doing anything else, make sure all that help has been provided!
116
117
DUALCASE=1; export DUALCASE # for MKS sh
118
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
89
  emulate sh
119
  emulate sh
90
  NULLCMD=:
120
  NULLCMD=:
91
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
121
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
92
  # is contrary to our usage.  Disable this feature.
122
  # is contrary to our usage.  Disable this feature.
93
  alias -g '${1+"$@"}'='"$@"'
123
  alias -g '${1+"$@"}'='"$@"'
94
  setopt NO_GLOB_SUBST
124
  setopt NO_GLOB_SUBST
95
else
125
else
96
  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
126
  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
97
fi
127
fi
98
BIN_SH=xpg4; export BIN_SH # for Tru64
99
DUALCASE=1; export DUALCASE # for MKS sh
100
101
# A function that is used when there is no print builtin or printf.
102
func_fallback_echo ()
103
{
104
  eval 'cat <<_LTECHO_EOF
105
$1
106
_LTECHO_EOF'
107
}
108
128
109
# 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.
110
lt_user_locale=
130
_G_user_locale=
111
lt_safe_locale=
131
_G_safe_locale=
112
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
113
do
133
do
114
  eval "if test \"\${$lt_var+set}\" = set; then
134
  eval "if test set = \"\${$_G_var+set}\"; then
115
          save_$lt_var=\$$lt_var
135
          save_$_G_var=\$$_G_var
116
          $lt_var=C
136
          $_G_var=C
117
	  export $lt_var
137
	  export $_G_var
118
	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
138
	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
119
	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
139
	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
120
	fi"
140
	fi"
121
done
141
done
122
LC_ALL=C
123
LANGUAGE=C
124
export LANGUAGE LC_ALL
125
142
126
$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"
127
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
128
160
129
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
130
# is ksh but when the shell is invoked as "sh" and the current value of
131
# the _XPG environment variable is not equal to 1 (one), the special
132
# positional parameter $0, within a function call, is the name of the
133
# function.
134
progpath="$0"
135
161
136
162
163
## ------------------------- ##
164
## Locate command utilities. ##
165
## ------------------------- ##
166
167
168
# func_executable_p FILE
169
# ----------------------
170
# Check that FILE is an executable regular file.
171
func_executable_p ()
172
{
173
    test -f "$1" && test -x "$1"
174
}
175
176
177
# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
178
# --------------------------------------------
179
# Search for either a program that responds to --version with output
180
# containing "GNU", or else returned by CHECK_FUNC otherwise, by
181
# trying all the directories in PATH with each of the elements of
182
# PROGS_LIST.
183
#
184
# CHECK_FUNC should accept the path to a candidate program, and
185
# set $func_check_prog_result if it truncates its output less than
186
# $_G_path_prog_max characters.
187
func_path_progs ()
188
{
189
    _G_progs_list=$1
190
    _G_check_func=$2
191
    _G_PATH=${3-"$PATH"}
192
193
    _G_path_prog_max=0
194
    _G_path_prog_found=false
195
    _G_save_IFS=$IFS; IFS=$PATH_SEPARATOR
196
    for _G_dir in $_G_PATH; do
197
      IFS=$_G_save_IFS
198
      test -z "$_G_dir" && _G_dir=.
199
      for _G_prog_name in $_G_progs_list; do
200
        for _exeext in '' .EXE; do
201
          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
202
          func_executable_p "$_G_path_prog" || continue
203
          case `"$_G_path_prog" --version 2>&1` in
204
            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
205
            *)     $_G_check_func $_G_path_prog
206
		   func_path_progs_result=$func_check_prog_result
207
		   ;;
208
          esac
209
          $_G_path_prog_found && break 3
210
        done
211
      done
212
    done
213
    IFS=$_G_save_IFS
214
    test -z "$func_path_progs_result" && {
215
      echo "no acceptable sed could be found in \$PATH" >&2
216
      exit 1
217
    }
218
}
219
220
221
# We want to be able to use the functions in this file before configure
222
# has figured out where the best binaries are kept, which means we have
223
# to search for them ourselves - except when the results are already set
224
# where we skip the searches.
225
226
# Unless the user overrides by setting SED, search the path for either GNU
227
# sed, or the sed that truncates its output the least.
228
test -z "$SED" && {
229
  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/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.
137
311
138
: ${CP="cp -f"}
312
: ${CP="cp -f"}
139
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
313
: ${ECHO="printf %s\n"}
314
: ${EGREP="$GREP -E"}
315
: ${FGREP="$GREP -F"}
316
: ${LN_S="ln -s"}
140
: ${MAKE="make"}
317
: ${MAKE="make"}
141
: ${MKDIR="mkdir"}
318
: ${MKDIR="mkdir"}
142
: ${MV="mv -f"}
319
: ${MV="mv -f"}
143
: ${RM="rm -f"}
320
: ${RM="rm -f"}
144
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
321
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
145
: ${Xsed="$SED -e 1s/^X//"}
146
147
# Global variables:
148
EXIT_SUCCESS=0
149
EXIT_FAILURE=1
150
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
151
EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
152
153
exit_status=$EXIT_SUCCESS
154
155
# Make sure IFS has a sensible default
156
lt_nl='
157
'
158
IFS=" 	$lt_nl"
159
322
160
dirname="s,/[^/]*$,,"
161
basename="s,^.*/,,"
162
323
163
# func_dirname file append nondir_replacement
324
## -------------------- ##
164
# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
325
## Useful sed snippets. ##
165
# otherwise set result to NONDIR_REPLACEMENT.
326
## -------------------- ##
166
func_dirname ()
167
{
168
    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
169
    if test "X$func_dirname_result" = "X${1}"; then
170
      func_dirname_result="${3}"
171
    else
172
      func_dirname_result="$func_dirname_result${2}"
173
    fi
174
} # func_dirname may be replaced by extended shell implementation
175
327
328
sed_dirname='s|/[^/]*$||'
329
sed_basename='s|^.*/||'
176
330
177
# func_basename file
331
# Sed substitution that helps us do robust quoting.  It backslashifies
178
func_basename ()
332
# metacharacters that are still active within double-quoted strings.
179
{
333
sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
180
    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
181
} # func_basename may be replaced by extended shell implementation
182
334
335
# Same as above, but do not quote variable references.
336
sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
183
337
184
# func_dirname_and_basename file append nondir_replacement
338
# Sed substitution that turns a string into a regex matching for the
185
# perform func_basename and func_dirname in a single function
339
# string literally.
186
# call:
340
sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
187
#   dirname:  Compute the dirname of FILE.  If nonempty,
188
#             add APPEND to the result, otherwise set result
189
#             to NONDIR_REPLACEMENT.
190
#             value returned in "$func_dirname_result"
191
#   basename: Compute filename of FILE.
192
#             value retuned in "$func_basename_result"
193
# Implementation must be kept synchronized with func_dirname
194
# and func_basename. For efficiency, we do not delegate to
195
# those functions but instead duplicate the functionality here.
196
func_dirname_and_basename ()
197
{
198
    # Extract subdirectory from the argument.
199
    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
200
    if test "X$func_dirname_result" = "X${1}"; then
201
      func_dirname_result="${3}"
202
    else
203
      func_dirname_result="$func_dirname_result${2}"
204
    fi
205
    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
206
} # func_dirname_and_basename may be replaced by extended shell implementation
207
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'
208
346
209
# func_stripname prefix suffix name
347
# Re-'\' parameter expansions in output of sed_double_quote_subst that
210
# strip PREFIX and SUFFIX off of NAME.
348
# were '\'-ed in input to the same.  If an odd number of '\' preceded a
211
# PREFIX and SUFFIX must not contain globbing or regex special
349
# '$' in input to sed_double_quote_subst, that '$' was protected from
212
# characters, hashes, percent signs, but SUFFIX may contain a leading
350
# expansion.  Since each input '\' is now two '\'s, look for any number
213
# dot (in which case that matches only a dot).
351
# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
214
# func_strip_suffix prefix name
352
_G_bs='\\'
215
func_stripname ()
353
_G_bs2='\\\\'
216
{
354
_G_bs4='\\\\\\\\'
217
    case ${2} in
355
_G_dollar='\$'
218
      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
356
sed_double_backslash="\
219
      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
357
  s/$_G_bs4/&\\
220
    esac
358
/g
221
} # func_stripname may be replaced by extended shell implementation
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"
222
362
223
363
224
# These SED scripts presuppose an absolute path with a trailing slash.
364
## ----------------- ##
225
pathcar='s,^/\([^/]*\).*$,\1,'
365
## Global variables. ##
226
pathcdr='s,^/[^/]*,,'
366
## ----------------- ##
227
removedotparts=':dotsl
367
228
		s@/\./@/@g
368
# Except for the global variables explicitly listed below, the following
229
		t dotsl
369
# functions in the '^func_' namespace, and the '^require_' namespace
230
		s,/\.$,/,'
370
# variables initialised in the 'Resource management' section, sourcing
231
collapseslashes='s@/\{1,\}@/@g'
371
# this file will not pollute your global namespace with anything
232
finalslash='s,/*$,/,'
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.
233
380
234
# func_normal_abspath PATH
381
EXIT_SUCCESS=0
235
# Remove doubled-up and trailing slashes, "." path components,
382
EXIT_FAILURE=1
236
# and cancel out any ".." path components in PATH after making
383
EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
237
# it an absolute path.
384
EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
238
#             value returned in "$func_normal_abspath_result"
239
func_normal_abspath ()
240
{
241
  # Start from root dir and reassemble the path.
242
  func_normal_abspath_result=
243
  func_normal_abspath_tpath=$1
244
  func_normal_abspath_altnamespace=
245
  case $func_normal_abspath_tpath in
246
    "")
247
      # Empty path, that just means $cwd.
248
      func_stripname '' '/' "`pwd`"
249
      func_normal_abspath_result=$func_stripname_result
250
      return
251
    ;;
252
    # The next three entries are used to spot a run of precisely
253
    # two leading slashes without using negated character classes;
254
    # we take advantage of case's first-match behaviour.
255
    ///*)
256
      # Unusual form of absolute path, do nothing.
257
    ;;
258
    //*)
259
      # Not necessarily an ordinary path; POSIX reserves leading '//'
260
      # and for example Cygwin uses it to access remote file shares
261
      # over CIFS/SMB, so we conserve a leading double slash if found.
262
      func_normal_abspath_altnamespace=/
263
    ;;
264
    /*)
265
      # Absolute path, do nothing.
266
    ;;
267
    *)
268
      # Relative path, prepend $cwd.
269
      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
270
    ;;
271
  esac
272
  # Cancel out all the simple stuff to save iterations.  We also want
273
  # the path to end with a slash for ease of parsing, so make sure
274
  # there is one (and only one) here.
275
  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
276
        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
277
  while :; do
278
    # Processed it all yet?
279
    if test "$func_normal_abspath_tpath" = / ; then
280
      # If we ascended to the root using ".." the result may be empty now.
281
      if test -z "$func_normal_abspath_result" ; then
282
        func_normal_abspath_result=/
283
      fi
284
      break
285
    fi
286
    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
287
        -e "$pathcar"`
288
    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
289
        -e "$pathcdr"`
290
    # Figure out what to do with it
291
    case $func_normal_abspath_tcomponent in
292
      "")
293
        # Trailing empty path component, ignore it.
294
      ;;
295
      ..)
296
        # Parent dir; strip last assembled component from result.
297
        func_dirname "$func_normal_abspath_result"
298
        func_normal_abspath_result=$func_dirname_result
299
      ;;
300
      *)
301
        # Actual path component, append it.
302
        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
303
      ;;
304
    esac
305
  done
306
  # Restore leading double-slash if one was found on entry.
307
  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
308
}
309
385
310
# func_relative_path SRCDIR DSTDIR
386
# Allow overriding, eg assuming that you follow the convention of
311
# generates a relative path from SRCDIR to DSTDIR, with a trailing
387
# putting '$debug_cmd' at the start of all your functions, you can get
312
# slash if non-empty, suitable for immediately appending a filename
388
# bash to show function call trace with:
313
# without needing to append a separator.
389
#
314
#             value returned in "$func_relative_path_result"
390
#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
315
func_relative_path ()
391
debug_cmd=${debug_cmd-":"}
316
{
392
exit_cmd=:
317
  func_relative_path_result=
318
  func_normal_abspath "$1"
319
  func_relative_path_tlibdir=$func_normal_abspath_result
320
  func_normal_abspath "$2"
321
  func_relative_path_tbindir=$func_normal_abspath_result
322
323
  # Ascend the tree starting from libdir
324
  while :; do
325
    # check if we have found a prefix of bindir
326
    case $func_relative_path_tbindir in
327
      $func_relative_path_tlibdir)
328
        # found an exact match
329
        func_relative_path_tcancelled=
330
        break
331
        ;;
332
      $func_relative_path_tlibdir*)
333
        # found a matching prefix
334
        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
335
        func_relative_path_tcancelled=$func_stripname_result
336
        if test -z "$func_relative_path_result"; then
337
          func_relative_path_result=.
338
        fi
339
        break
340
        ;;
341
      *)
342
        func_dirname $func_relative_path_tlibdir
343
        func_relative_path_tlibdir=${func_dirname_result}
344
        if test "x$func_relative_path_tlibdir" = x ; then
345
          # Have to descend all the way to the root!
346
          func_relative_path_result=../$func_relative_path_result
347
          func_relative_path_tcancelled=$func_relative_path_tbindir
348
          break
349
        fi
350
        func_relative_path_result=../$func_relative_path_result
351
        ;;
352
    esac
353
  done
354
393
355
  # Now calculate path; take care to avoid doubling-up slashes.
394
# By convention, finish your script with:
356
  func_stripname '' '/' "$func_relative_path_result"
395
#
357
  func_relative_path_result=$func_stripname_result
396
#    exit $exit_status
358
  func_stripname '/' '/' "$func_relative_path_tcancelled"
397
#
359
  if test "x$func_stripname_result" != x ; then
398
# so that you can set exit_status to non-zero if you want to indicate
360
    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
399
# something went wrong during execution without actually bailing out at
361
  fi
400
# the point of failure.
401
exit_status=$EXIT_SUCCESS
362
402
363
  # Normalisation. If bindir is libdir, return empty string,
403
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
364
  # else relative path ending with a slash; either way, target
404
# is ksh but when the shell is invoked as "sh" and the current value of
365
  # file name can be directly appended.
405
# the _XPG environment variable is not equal to 1 (one), the special
366
  if test ! -z "$func_relative_path_result"; then
406
# positional parameter $0, within a function call, is the name of the
367
    func_stripname './' '' "$func_relative_path_result/"
407
# function.
368
    func_relative_path_result=$func_stripname_result
408
progpath=$0
369
  fi
370
}
371
409
372
# The name of this program:
410
# The name of this program.
373
func_dirname_and_basename "$progpath"
411
progname=`$ECHO "$progpath" |$SED "$sed_basename"`
374
progname=$func_basename_result
375
412
376
# Make sure we have an absolute path for reexecution:
413
# Make sure we have an absolute progpath for reexecution:
377
case $progpath in
414
case $progpath in
378
  [\\/]*|[A-Za-z]:\\*) ;;
415
  [\\/]*|[A-Za-z]:\\*) ;;
379
  *[\\/]*)
416
  *[\\/]*)
380
     progdir=$func_dirname_result
417
     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
381
     progdir=`cd "$progdir" && pwd`
418
     progdir=`cd "$progdir" && pwd`
382
     progpath="$progdir/$progname"
419
     progpath=$progdir/$progname
383
     ;;
420
     ;;
384
  *)
421
  *)
385
     save_IFS="$IFS"
422
     _G_IFS=$IFS
386
     IFS=${PATH_SEPARATOR-:}
423
     IFS=${PATH_SEPARATOR-:}
387
     for progdir in $PATH; do
424
     for progdir in $PATH; do
388
       IFS="$save_IFS"
425
       IFS=$_G_IFS
389
       test -x "$progdir/$progname" && break
426
       test -x "$progdir/$progname" && break
390
     done
427
     done
391
     IFS="$save_IFS"
428
     IFS=$_G_IFS
392
     test -n "$progdir" || progdir=`pwd`
429
     test -n "$progdir" || progdir=`pwd`
393
     progpath="$progdir/$progname"
430
     progpath=$progdir/$progname
394
     ;;
431
     ;;
395
esac
432
esac
396
433
397
# Sed substitution that helps us do robust quoting.  It backslashifies
398
# metacharacters that are still active within double-quoted strings.
399
Xsed="${SED}"' -e 1s/^X//'
400
sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
401
402
# Same as above, but do not quote variable references.
403
double_quote_subst='s/\(["`\\]\)/\\\1/g'
404
405
# Sed substitution that turns a string into a regex matching for the
406
# string literally.
407
sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
408
434
409
# Sed substitution that converts a w32 file name or path
435
## ----------------- ##
410
# which contains forward slashes, into one that contains
436
## Standard options. ##
411
# (escaped) backslashes.  A very naive implementation.
437
## ----------------- ##
412
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
438
413
439
# The following options affect the operation of the functions defined
414
# Re-`\' parameter expansions in output of double_quote_subst that were
440
# below, and should be set appropriately depending on run-time para-
415
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
441
# meters passed on the command line.
416
# in input to double_quote_subst, that '$' was protected from expansion.
417
# Since each input `\' is now two `\'s, look for any number of runs of
418
# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
419
bs='\\'
420
bs2='\\\\'
421
bs4='\\\\\\\\'
422
dollar='\$'
423
sed_double_backslash="\
424
  s/$bs4/&\\
425
/g
426
  s/^$bs2$dollar/$bs&/
427
  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
428
  s/\n//g"
429
442
430
# Standard options:
431
opt_dry_run=false
443
opt_dry_run=false
432
opt_help=false
433
opt_quiet=false
444
opt_quiet=false
434
opt_verbose=false
445
opt_verbose=false
435
opt_warning=:
436
437
# func_echo arg...
438
# Echo program name prefixed message, along with the current mode
439
# name if it has been set yet.
440
func_echo ()
441
{
442
    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
443
}
444
446
445
# func_verbose arg...
447
# Categories 'all' and 'none' are always available.  Append any others
446
# Echo program name prefixed message in verbose mode only.
448
# you will pass as the first argument to func_warning from your own
447
func_verbose ()
449
# code.
448
{
450
warning_categories=
449
    $opt_verbose && func_echo ${1+"$@"}
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='[0m'
496
        tc_bold='[1m';   tc_standout='[7m'
497
        tc_red='[31m';   tc_green='[32m'
498
        tc_blue='[34m';  tc_cyan='[36m'
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
    }
450
513
451
    # A bug in bash halts the script if the last line of a function
514
    require_term_colors=:
452
    # fails when set -e is in force, so we need another command to
453
    # work around that:
454
    :
455
}
515
}
456
516
457
# func_echo_all arg...
458
# Invoke $ECHO with all args, space-separated.
459
func_echo_all ()
460
{
461
    $ECHO "$*"
462
}
463
517
464
# func_error arg...
518
## ----------------- ##
465
# Echo program name prefixed message to standard error.
519
## Function library. ##
466
func_error ()
520
## ----------------- ##
467
{
468
    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
469
}
470
521
471
# func_warning arg...
522
# This section contains a variety of useful functions to call in your
472
# Echo program name prefixed warning message to standard error.
523
# scripts. Take note of the portable wrappers for features provided by
473
func_warning ()
524
# some modern shells, which will fall back to slower equivalents on
474
{
525
# less featureful shells.
475
    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
476
526
477
    # bash bug again:
478
    :
479
}
480
527
481
# func_fatal_error arg...
528
# func_append VAR VALUE
482
# Echo program name prefixed message to standard error, and exit.
529
# ---------------------
483
func_fatal_error ()
530
# Append VALUE onto the existing contents of VAR.
484
{
485
    func_error ${1+"$@"}
486
    exit $EXIT_FAILURE
487
}
488
531
489
# func_fatal_help arg...
532
  # We should try to minimise forks, especially on Windows where they are
490
# Echo program name prefixed message to standard error, followed by
533
  # unreasonably slow, so skip the feature probes when bash or zsh are
491
# a help hint, and exit.
534
  # being used:
492
func_fatal_help ()
535
  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
493
{
536
    : ${_G_HAVE_ARITH_OP="yes"}
494
    func_error ${1+"$@"}
537
    : ${_G_HAVE_XSI_OPS="yes"}
495
    func_fatal_error "$help"
538
    # The += operator was introduced in bash 3.1
496
}
539
    case $BASH_VERSION in
497
help="Try \`$progname --help' for more information."  ## default
540
      [12].* | 3.0 | 3.0*) ;;
541
      *)
542
        : ${_G_HAVE_PLUSEQ_OP="yes"}
543
        ;;
544
    esac
545
  fi
498
546
547
  # _G_HAVE_PLUSEQ_OP
548
  # Can be empty, in which case the shell is probed, "yes" if += is
549
  # useable or anything else if it does not work.
550
  test -z "$_G_HAVE_PLUSEQ_OP" \
551
    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
552
    && _G_HAVE_PLUSEQ_OP=yes
553
554
if test yes = "$_G_HAVE_PLUSEQ_OP"
555
then
556
  # This is an XSI compatible shell, allowing a faster implementation...
557
  eval 'func_append ()
558
  {
559
    $debug_cmd
560
561
    eval "$1+=\$2"
562
  }'
563
else
564
  # ...otherwise fall back to using expr, which is often a shell builtin.
565
  func_append ()
566
  {
567
    $debug_cmd
568
569
    eval "$1=\$$1\$2"
570
  }
571
fi
572
573
574
# func_append_quoted VAR VALUE
575
# ----------------------------
576
# Quote VALUE and append to the end of shell variable VAR, separated
577
# by a space.
578
if test yes = "$_G_HAVE_PLUSEQ_OP"; then
579
  eval 'func_append_quoted ()
580
  {
581
    $debug_cmd
582
583
    func_quote_for_eval "$2"
584
    eval "$1+=\\ \$func_quote_for_eval_result"
585
  }'
586
else
587
  func_append_quoted ()
588
  {
589
    $debug_cmd
590
591
    func_quote_for_eval "$2"
592
    eval "$1=\$$1\\ \$func_quote_for_eval_result"
593
  }
594
fi
595
596
597
# func_append_uniq VAR VALUE
598
# --------------------------
599
# Append unique VALUE onto the existing contents of VAR, assuming
600
# entries are delimited by the first character of VALUE.  For example:
601
#
602
#   func_append_uniq options " --another-option option-argument"
603
#
604
# will only append to $options if " --another-option option-argument "
605
# is not already present somewhere in $options already (note spaces at
606
# each end implied by leading space in second argument).
607
func_append_uniq ()
608
{
609
    $debug_cmd
610
611
    eval _G_current_value='`$ECHO $'$1'`'
612
    _G_delim=`expr "$2" : '\(.\)'`
613
614
    case $_G_delim$_G_current_value$_G_delim in
615
      *"$2$_G_delim"*) ;;
616
      *) func_append "$@" ;;
617
    esac
618
}
619
620
621
# func_arith TERM...
622
# ------------------
623
# Set func_arith_result to the result of evaluating TERMs.
624
  test -z "$_G_HAVE_ARITH_OP" \
625
    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
626
    && _G_HAVE_ARITH_OP=yes
627
628
if test yes = "$_G_HAVE_ARITH_OP"; then
629
  eval 'func_arith ()
630
  {
631
    $debug_cmd
632
633
    func_arith_result=$(( $* ))
634
  }'
635
else
636
  func_arith ()
637
  {
638
    $debug_cmd
639
640
    func_arith_result=`expr "$@"`
641
  }
642
fi
643
644
645
# func_basename FILE
646
# ------------------
647
# Set func_basename_result to FILE with everything up to and including
648
# the last / stripped.
649
if test yes = "$_G_HAVE_XSI_OPS"; then
650
  # If this shell supports suffix pattern removal, then use it to avoid
651
  # forking. Hide the definitions single quotes in case the shell chokes
652
  # on unsupported syntax...
653
  _b='func_basename_result=${1##*/}'
654
  _d='case $1 in
655
        */*) func_dirname_result=${1%/*}$2 ;;
656
        *  ) func_dirname_result=$3        ;;
657
      esac'
658
659
else
660
  # ...otherwise fall back to using sed.
661
  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
662
  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
663
      if test "X$func_dirname_result" = "X$1"; then
664
        func_dirname_result=$3
665
      else
666
        func_append func_dirname_result "$2"
667
      fi'
668
fi
669
670
eval 'func_basename ()
671
{
672
    $debug_cmd
673
674
    '"$_b"'
675
}'
676
677
678
# func_dirname FILE APPEND NONDIR_REPLACEMENT
679
# -------------------------------------------
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
# ----------------
713
# Echo program name prefixed message.
714
func_echo ()
715
{
716
    $debug_cmd
717
718
    _G_message=$*
719
720
    func_echo_IFS=$IFS
721
    IFS=$nl
722
    for _G_line in $_G_message; do
723
      IFS=$func_echo_IFS
724
      $ECHO "$progname: $_G_line"
725
    done
726
    IFS=$func_echo_IFS
727
}
728
729
730
# func_echo_all ARG...
731
# --------------------
732
# Invoke $ECHO with all args, space-separated.
733
func_echo_all ()
734
{
735
    $ECHO "$*"
736
}
737
738
739
# func_echo_infix_1 INFIX ARG...
740
# ------------------------------
741
# Echo program name, followed by INFIX on the first line, with any
742
# additional lines not showing INFIX.
743
func_echo_infix_1 ()
744
{
745
    $debug_cmd
746
747
    $require_term_colors
748
749
    _G_infix=$1; shift
750
    _G_indent=$_G_infix
751
    _G_prefix="$progname: $_G_infix: "
752
    _G_message=$*
753
754
    # Strip color escape sequences before counting printable length
755
    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
756
    do
757
      test -n "$_G_tc" && {
758
        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
759
        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
760
      }
761
    done
762
    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude 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
772
}
773
774
775
# func_error ARG...
776
# -----------------
777
# Echo program name prefixed message to standard error.
778
func_error ()
779
{
780
    $debug_cmd
781
782
    $require_term_colors
783
784
    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
785
}
786
787
788
# func_fatal_error ARG...
789
# -----------------------
790
# Echo program name prefixed message to standard error, and exit.
791
func_fatal_error ()
792
{
793
    $debug_cmd
499
794
500
# func_grep expression filename
795
    func_error "$*"
796
    exit $EXIT_FAILURE
797
}
798
799
800
# func_grep EXPRESSION FILENAME
801
# -----------------------------
501
# Check whether EXPRESSION matches any line of FILENAME, without output.
802
# Check whether EXPRESSION matches any line of FILENAME, without output.
502
func_grep ()
803
func_grep ()
503
{
804
{
805
    $debug_cmd
806
504
    $GREP "$1" "$2" >/dev/null 2>&1
807
    $GREP "$1" "$2" >/dev/null 2>&1
505
}
808
}
506
809
507
810
508
# func_mkdir_p directory-path
811
# func_len STRING
509
# Make sure the entire path to DIRECTORY-PATH is available.
812
# ---------------
510
func_mkdir_p ()
813
# Set func_len_result to the length of STRING. STRING may not
814
# start with a hyphen.
815
  test -z "$_G_HAVE_XSI_OPS" \
816
    && (eval 'x=a/b/c;
817
      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
818
    && _G_HAVE_XSI_OPS=yes
819
820
if test yes = "$_G_HAVE_XSI_OPS"; then
821
  eval 'func_len ()
822
  {
823
    $debug_cmd
824
825
    func_len_result=${#1}
826
  }'
827
else
828
  func_len ()
829
  {
830
    $debug_cmd
831
832
    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
833
  }
834
fi
835
836
837
# func_mkdir_p DIRECTORY-PATH
838
# ---------------------------
839
# Make sure the entire path to DIRECTORY-PATH is available.
840
func_mkdir_p ()
841
{
842
    $debug_cmd
843
844
    _G_directory_path=$1
845
    _G_dir_list=
846
847
    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
848
849
      # Protect directory names starting with '-'
850
      case $_G_directory_path in
851
        -*) _G_directory_path=./$_G_directory_path ;;
852
      esac
853
854
      # While some portion of DIR does not yet exist...
855
      while test ! -d "$_G_directory_path"; do
856
        # ...make a list in topmost first order.  Use a colon delimited
857
	# list incase some portion of path contains whitespace.
858
        _G_dir_list=$_G_directory_path:$_G_dir_list
859
860
        # If the last portion added has no slash in it, the list is done
861
        case $_G_directory_path in */*) ;; *) break ;; esac
862
863
        # ...otherwise throw away the child directory and loop
864
        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
865
      done
866
      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
867
868
      func_mkdir_p_IFS=$IFS; IFS=:
869
      for _G_dir in $_G_dir_list; do
870
	IFS=$func_mkdir_p_IFS
871
        # mkdir can fail with a 'File exist' error if two processes
872
        # try to create one of the directories concurrently.  Don't
873
        # stop in that case!
874
        $MKDIR "$_G_dir" 2>/dev/null || :
875
      done
876
      IFS=$func_mkdir_p_IFS
877
878
      # Bail out if we (or some other process) failed to create a directory.
879
      test -d "$_G_directory_path" || \
880
        func_fatal_error "Failed to create '$1'"
881
    fi
882
}
883
884
885
# func_mktempdir [BASENAME]
886
# -------------------------
887
# Make a temporary directory that won't clash with other running
888
# libtool processes, and avoids race conditions if possible.  If
889
# given, BASENAME is the basename for that directory.
890
func_mktempdir ()
891
{
892
    $debug_cmd
893
894
    _G_template=${TMPDIR-/tmp}/${1-$progname}
895
896
    if test : = "$opt_dry_run"; then
897
      # Return a directory name, but don't create it in dry-run mode
898
      _G_tmpdir=$_G_template-$$
899
    else
900
901
      # If mktemp works, use that first and foremost
902
      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
903
904
      if test ! -d "$_G_tmpdir"; then
905
        # Failing that, at least try and use $RANDOM to avoid a race
906
        _G_tmpdir=$_G_template-${RANDOM-0}$$
907
908
        func_mktempdir_umask=`umask`
909
        umask 0077
910
        $MKDIR "$_G_tmpdir"
911
        umask $func_mktempdir_umask
912
      fi
913
914
      # If we're not in dry-run mode, bomb out on failure
915
      test -d "$_G_tmpdir" || \
916
        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
917
    fi
918
919
    $ECHO "$_G_tmpdir"
920
}
921
922
923
# func_normal_abspath PATH
924
# ------------------------
925
# Remove doubled-up and trailing slashes, "." path components,
926
# and cancel out any ".." path components in PATH after making
927
# it an absolute path.
928
func_normal_abspath ()
929
{
930
    $debug_cmd
931
932
    # These SED scripts presuppose an absolute path with a trailing slash.
933
    _G_pathcar='s|^/\([^/]*\).*$|\1|'
934
    _G_pathcdr='s|^/[^/]*||'
935
    _G_removedotparts=':dotsl
936
		s|/\./|/|g
937
		t dotsl
938
		s|/\.$|/|'
939
    _G_collapseslashes='s|/\{1,\}|/|g'
940
    _G_finalslash='s|/*$|/|'
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=
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
954
      # two leading slashes without using negated character classes;
955
      # we take advantage of case's first-match behaviour.
956
      ///*)
957
        # Unusual form of absolute path, do nothing.
958
        ;;
959
      //*)
960
        # Not necessarily an ordinary path; POSIX reserves leading '//'
961
        # and for example Cygwin uses it to access remote file shares
962
        # over CIFS/SMB, so we conserve a leading double slash if found.
963
        func_normal_abspath_altnamespace=/
964
        ;;
965
      /*)
966
        # Absolute path, do nothing.
967
        ;;
968
      *)
969
        # Relative path, prepend $cwd.
970
        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
971
        ;;
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
    :
1026
}
1027
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
1146
# func_quote_for_expand ARG
1147
# -------------------------
1148
# Aesthetically quote ARG to be evaled later; same as above,
1149
# but do not quote variable references.
1150
func_quote_for_expand ()
1151
{
1152
    $debug_cmd
1153
1154
    case $1 in
1155
      *[\\\`\"]*)
1156
	_G_arg=`$ECHO "$1" | $SED \
1157
	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
1158
      *)
1159
        _G_arg=$1 ;;
1160
    esac
1161
1162
    case $_G_arg in
1163
      # Double-quote args containing shell metacharacters to delay
1164
      # word splitting and command substitution for a subsequent eval.
1165
      # Many Bourne shells cannot handle close brackets correctly
1166
      # in scan sets, so we specify it separately.
1167
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1168
        _G_arg=\"$_G_arg\"
1169
        ;;
1170
    esac
1171
1172
    func_quote_for_expand_result=$_G_arg
1173
}
1174
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
1206
# func_show_eval CMD [FAIL_EXP]
1207
# -----------------------------
1208
# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
1209
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
1210
# is given, then evaluate it.
1211
func_show_eval ()
1212
{
1213
    $debug_cmd
1214
1215
    _G_cmd=$1
1216
    _G_fail_exp=${2-':'}
1217
1218
    func_quote_for_expand "$_G_cmd"
1219
    eval "func_notquiet $func_quote_for_expand_result"
1220
1221
    $opt_dry_run || {
1222
      eval "$_G_cmd"
1223
      _G_status=$?
1224
      if test 0 -ne "$_G_status"; then
1225
	eval "(exit $_G_status); $_G_fail_exp"
1226
      fi
1227
    }
1228
}
1229
1230
1231
# func_show_eval_locale CMD [FAIL_EXP]
1232
# ------------------------------------
1233
# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
1234
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
1235
# is given, then evaluate it.  Use the saved locale for evaluation.
1236
func_show_eval_locale ()
1237
{
1238
    $debug_cmd
1239
1240
    _G_cmd=$1
1241
    _G_fail_exp=${2-':'}
1242
1243
    $opt_quiet || {
1244
      func_quote_for_expand "$_G_cmd"
1245
      eval "func_echo $func_quote_for_expand_result"
1246
    }
1247
1248
    $opt_dry_run || {
1249
      eval "$_G_user_locale
1250
	    $_G_cmd"
1251
      _G_status=$?
1252
      eval "$_G_safe_locale"
1253
      if test 0 -ne "$_G_status"; then
1254
	eval "(exit $_G_status); $_G_fail_exp"
1255
      fi
1256
    }
1257
}
1258
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
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
}
1279
1280
1281
# func_verbose ARG...
1282
# -------------------
1283
# Echo program name prefixed message in verbose mode only.
1284
func_verbose ()
1285
{
1286
    $debug_cmd
1287
1288
    $opt_verbose && func_echo "$*"
1289
1290
    :
1291
}
1292
1293
1294
# func_warn_and_continue ARG...
1295
# -----------------------------
1296
# Echo program name prefixed warning message to standard error.
1297
func_warn_and_continue ()
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!
1318
    case " $warning_categories " in
1319
      *" $1 "*) ;;
1320
      *) func_internal_error "invalid warning category '$1'" ;;
1321
    esac
1322
1323
    _G_category=$1
1324
    shift
1325
1326
    case " $opt_warning_types " in
1327
      *" $_G_category "*) $warning_func ${1+"$@"} ;;
1328
    esac
1329
}
1330
1331
1332
# func_sort_ver VER1 VER2
1333
# -----------------------
1334
# 'sort -V' is not generally available.
1335
# Note this deviates from the version comparison in automake
1336
# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
1337
# but this should suffice as we won't be specifying old
1338
# version formats or redundant trailing .0 in bootstrap.conf.
1339
# If we did want full compatibility then we should probably
1340
# use m4_version_compare from autoconf.
1341
func_sort_ver ()
1342
{
1343
    $debug_cmd
1344
1345
    printf '%s\n%s\n' "$1" "$2" \
1346
      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
1347
}
1348
1349
# func_lt_ver PREV CURR
1350
# ---------------------
1351
# Return true if PREV and CURR are in the correct order according to
1352
# func_sort_ver, otherwise false.  Use it like this:
1353
#
1354
#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
1355
func_lt_ver ()
1356
{
1357
    $debug_cmd
1358
1359
    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
1360
}
1361
1362
1363
# Local variables:
1364
# mode: shell-script
1365
# sh-indentation: 2
1366
# eval: (add-hook 'before-save-hook 'time-stamp)
1367
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
1368
# time-stamp-time-zone: "UTC"
1369
# End:
1370
#! /bin/sh
1371
1372
# Set a version string for this script.
1373
scriptversion=2014-01-07.03; # UTC
1374
1375
# A portable, pluggable option parser for Bourne shell.
1376
# Written by Gary V. Vaughan, 2010
1377
1378
# Copyright (C) 2010-2014 Free Software Foundation, Inc.
1379
# This is free software; see the source for copying conditions.  There is NO
1380
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
1381
1382
# This program is free software: you can redistribute it and/or modify
1383
# it under the terms of the GNU General Public License as published by
1384
# the Free Software Foundation, either version 3 of the License, or
1385
# (at your option) any later version.
1386
1387
# This program is distributed in the hope that it will be useful,
1388
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1389
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1390
# GNU General Public License for more details.
1391
1392
# You should have received a copy of the GNU General Public License
1393
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
1394
1395
# Please report bugs or propose patches to gary@gnu.org.
1396
1397
1398
## ------ ##
1399
## Usage. ##
1400
## ------ ##
1401
1402
# This file is a library for parsing options in your shell scripts along
1403
# with assorted other useful supporting features that you can make use
1404
# of too.
1405
#
1406
# For the simplest scripts you might need only:
1407
#
1408
#   #!/bin/sh
1409
#   . relative/path/to/funclib.sh
1410
#   . relative/path/to/options-parser
1411
#   scriptversion=1.0
1412
#   func_options ${1+"$@"}
1413
#   eval set dummy "$func_options_result"; shift
1414
#   ...rest of your script...
1415
#
1416
# In order for the '--version' option to work, you will need to have a
1417
# suitably formatted comment like the one at the top of this file
1418
# starting with '# Written by ' and ending with '# warranty; '.
1419
#
1420
# For '-h' and '--help' to work, you will also need a one line
1421
# description of your script's purpose in a comment directly above the
1422
# '# Written by ' line, like the one at the top of this file.
1423
#
1424
# The default options also support '--debug', which will turn on shell
1425
# execution tracing (see the comment above debug_cmd below for another
1426
# use), and '--verbose' and the func_verbose function to allow your script
1427
# to display verbose messages only when your user has specified
1428
# '--verbose'.
1429
#
1430
# After sourcing this file, you can plug processing for additional
1431
# options by amending the variables from the 'Configuration' section
1432
# below, and following the instructions in the 'Option parsing'
1433
# section further down.
1434
1435
## -------------- ##
1436
## Configuration. ##
1437
## -------------- ##
1438
1439
# You should override these variables in your script after sourcing this
1440
# file so that they reflect the customisations you have added to the
1441
# option parser.
1442
1443
# The usage line for option parsing errors and the start of '-h' and
1444
# '--help' output messages. You can embed shell variables for delayed
1445
# expansion at the time the message is displayed, but you will need to
1446
# quote other shell meta-characters carefully to prevent them being
1447
# expanded when the contents are evaled.
1448
usage='$progpath [OPTION]...'
1449
1450
# Short help message in response to '-h' and '--help'.  Add to this or
1451
# override it after sourcing this library to reflect the full set of
1452
# options your script accepts.
1453
usage_message="\
1454
       --debug        enable verbose shell tracing
1455
   -W, --warnings=CATEGORY
1456
                      report the warnings falling in CATEGORY [all]
1457
   -v, --verbose      verbosely report processing
1458
       --version      print version information and exit
1459
   -h, --help         print short or long help message and exit
1460
"
1461
1462
# Additional text appended to 'usage_message' in response to '--help'.
1463
long_help_message="
1464
Warning categories include:
1465
       'all'          show all warnings
1466
       'none'         turn off all the warnings
1467
       'error'        warnings are treated as fatal errors"
1468
1469
# Help message printed before fatal option parsing errors.
1470
fatal_help="Try '\$progname --help' for more information."
1471
1472
1473
1474
## ------------------------- ##
1475
## Hook function management. ##
1476
## ------------------------- ##
1477
1478
# This section contains functions for adding, removing, and running hooks
1479
# to the main code.  A hook is just a named list of of function, that can
1480
# be run in order later on.
1481
1482
# func_hookable FUNC_NAME
1483
# -----------------------
1484
# Declare that FUNC_NAME will run hooks added with
1485
# 'func_add_hook FUNC_NAME ...'.
1486
func_hookable ()
1487
{
1488
    $debug_cmd
1489
1490
    func_append hookable_fns " $1"
1491
}
1492
1493
1494
# func_add_hook FUNC_NAME HOOK_FUNC
1495
# ---------------------------------
1496
# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
1497
# first have been declared "hookable" by a call to 'func_hookable'.
1498
func_add_hook ()
1499
{
1500
    $debug_cmd
1501
1502
    case " $hookable_fns " in
1503
      *" $1 "*) ;;
1504
      *) func_fatal_error "'$1' does not accept hook functions." ;;
1505
    esac
1506
1507
    eval func_append ${1}_hooks '" $2"'
1508
}
1509
1510
1511
# func_remove_hook FUNC_NAME HOOK_FUNC
1512
# ------------------------------------
1513
# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
1514
func_remove_hook ()
511
{
1515
{
512
    my_directory_path="$1"
1516
    $debug_cmd
513
    my_dir_list=
514
1517
515
    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
1518
    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
1519
}
516
1520
517
      # Protect directory names starting with `-'
518
      case $my_directory_path in
519
        -*) my_directory_path="./$my_directory_path" ;;
520
      esac
521
1521
522
      # While some portion of DIR does not yet exist...
1522
# func_run_hooks FUNC_NAME [ARG]...
523
      while test ! -d "$my_directory_path"; do
1523
# ---------------------------------
524
        # ...make a list in topmost first order.  Use a colon delimited
1524
# Run all hook functions registered to FUNC_NAME.
525
	# list incase some portion of path contains whitespace.
1525
# It is assumed that the list of hook functions contains nothing more
526
        my_dir_list="$my_directory_path:$my_dir_list"
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
527
1532
528
        # If the last portion added has no slash in it, the list is done
1533
    case " $hookable_fns " in
529
        case $my_directory_path in */*) ;; *) break ;; esac
1534
      *" $1 "*) ;;
1535
      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
1536
    esac
530
1537
531
        # ...otherwise throw away the child directory and loop
1538
    eval _G_hook_fns=\$$1_hooks; shift
532
        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
533
      done
534
      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
535
1539
536
      save_mkdir_p_IFS="$IFS"; IFS=':'
1540
    for _G_hook in $_G_hook_fns; do
537
      for my_dir in $my_dir_list; do
1541
      eval $_G_hook '"$@"'
538
	IFS="$save_mkdir_p_IFS"
539
        # mkdir can fail with a `File exist' error if two processes
540
        # try to create one of the directories concurrently.  Don't
541
        # stop in that case!
542
        $MKDIR "$my_dir" 2>/dev/null || :
543
      done
544
      IFS="$save_mkdir_p_IFS"
545
1542
546
      # Bail out if we (or some other process) failed to create a directory.
1543
      # store returned options list back into positional
547
      test -d "$my_directory_path" || \
1544
      # parameters for next 'cmd' execution.
548
        func_fatal_error "Failed to create \`$1'"
1545
      eval _G_hook_result=\$${_G_hook}_result
549
    fi
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
550
}
1551
}
551
1552
552
1553
553
# func_mktempdir [string]
554
# Make a temporary directory that won't clash with other running
555
# libtool processes, and avoids race conditions if possible.  If
556
# given, STRING is the basename for that directory.
557
func_mktempdir ()
558
{
559
    my_template="${TMPDIR-/tmp}/${1-$progname}"
560
1554
561
    if test "$opt_dry_run" = ":"; then
1555
## --------------- ##
562
      # Return a directory name, but don't create it in dry-run mode
1556
## Option parsing. ##
563
      my_tmpdir="${my_template}-$$"
1557
## --------------- ##
564
    else
565
1558
566
      # If mktemp works, use that first and foremost
1559
# In order to add your own option parsing hooks, you must accept the
567
      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
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.
568
1622
569
      if test ! -d "$my_tmpdir"; then
570
        # Failing that, at least try and use $RANDOM to avoid a race
571
        my_tmpdir="${my_template}-${RANDOM-0}$$"
572
1623
573
        save_mktempdir_umask=`umask`
1624
# func_options [ARG]...
574
        umask 0077
1625
# ---------------------
575
        $MKDIR "$my_tmpdir"
1626
# All the functions called inside func_options are hookable. See the
576
        umask $save_mktempdir_umask
1627
# individual implementations for details.
577
      fi
1628
func_hookable func_options
1629
func_options ()
1630
{
1631
    $debug_cmd
578
1632
579
      # If we're not in dry-run mode, bomb out on failure
1633
    func_options_prep ${1+"$@"}
580
      test -d "$my_tmpdir" || \
1634
    eval func_parse_options \
581
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
1635
        ${func_options_prep_result+"$func_options_prep_result"}
582
    fi
1636
    eval func_validate_options \
1637
        ${func_parse_options_result+"$func_parse_options_result"}
583
1638
584
    $ECHO "$my_tmpdir"
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
585
}
1644
}
586
1645
587
1646
588
# func_quote_for_eval arg
1647
# func_options_prep [ARG]...
589
# Aesthetically quote ARG to be evaled later.
1648
# --------------------------
590
# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
1649
# All initialisations required before starting the option parse loop.
591
# is double-quoted, suitable for a subsequent eval, whereas
1650
# Note that when calling hook functions, we pass through the list of
592
# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
1651
# positional parameters.  If a hook function modifies that list, and
593
# which are still active within double quotes backslashified.
1652
# needs to propogate that back to rest of this script, then the complete
594
func_quote_for_eval ()
1653
# modified list must be put in 'func_run_hooks_result' before
1654
# returning.
1655
func_hookable func_options_prep
1656
func_options_prep ()
595
{
1657
{
596
    case $1 in
1658
    $debug_cmd
597
      *[\\\`\"\$]*)
598
	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
599
      *)
600
        func_quote_for_eval_unquoted_result="$1" ;;
601
    esac
602
1659
603
    case $func_quote_for_eval_unquoted_result in
1660
    # Option defaults:
604
      # Double-quote args containing shell metacharacters to delay
1661
    opt_verbose=false
605
      # word splitting, command substitution and and variable
1662
    opt_warning_types=
606
      # expansion for a subsequent eval.
1663
607
      # Many Bourne shells cannot handle close brackets correctly
1664
    func_run_hooks func_options_prep ${1+"$@"}
608
      # in scan sets, so we specify it separately.
1665
609
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
1666
    # save modified positional parameters for caller
610
        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
1667
    func_options_prep_result=$func_run_hooks_result
611
        ;;
612
      *)
613
        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
614
    esac
615
}
1668
}
616
1669
617
1670
618
# func_quote_for_expand arg
1671
# func_parse_options [ARG]...
619
# Aesthetically quote ARG to be evaled later; same as above,
1672
# ---------------------------
620
# but do not quote variable references.
1673
# The main option parsing loop.
621
func_quote_for_expand ()
1674
func_hookable func_parse_options
1675
func_parse_options ()
622
{
1676
{
623
    case $1 in
1677
    $debug_cmd
624
      *[\\\`\"]*)
625
	my_arg=`$ECHO "$1" | $SED \
626
	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
627
      *)
628
        my_arg="$1" ;;
629
    esac
630
1678
631
    case $my_arg in
1679
    func_parse_options_result=
632
      # Double-quote args containing shell metacharacters to delay
633
      # word splitting and command substitution for a subsequent eval.
634
      # Many Bourne shells cannot handle close brackets correctly
635
      # in scan sets, so we specify it separately.
636
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
637
        my_arg="\"$my_arg\""
638
        ;;
639
    esac
640
1680
641
    func_quote_for_expand_result="$my_arg"
1681
    # this just eases exit handling
642
}
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+"$@"}
643
1686
1687
      # Adjust func_parse_options positional parameters to match
1688
      eval set dummy "$func_run_hooks_result"; shift
644
1689
645
# func_show_eval cmd [fail_exp]
1690
      # Break out of the loop if we already parsed every option.
646
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
1691
      test $# -gt 0 || break
647
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
648
# is given, then evaluate it.
649
func_show_eval ()
650
{
651
    my_cmd="$1"
652
    my_fail_exp="${2-:}"
653
1692
654
    ${opt_silent-false} || {
1693
      _G_opt=$1
655
      func_quote_for_expand "$my_cmd"
1694
      shift
656
      eval "func_echo $func_quote_for_expand_result"
1695
      case $_G_opt in
657
    }
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
		      ;;
658
1705
659
    if ${opt_dry_run-false}; then :; else
1706
        --warnings|--warning|-W)
660
      eval "$my_cmd"
1707
                      test $# = 0 && func_missing_arg $_G_opt && break
661
      my_status=$?
1708
                      case " $warning_categories $1" in
662
      if test "$my_status" -eq 0; then :; else
1709
                        *" $1 "*)
663
	eval "(exit $my_status); $my_fail_exp"
1710
                          # trailing space prevents matching last $1 above
664
      fi
1711
                          func_append_uniq opt_warning_types " $1"
665
    fi
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
666
}
1769
}
667
1770
668
1771
669
# func_show_eval_locale cmd [fail_exp]
1772
# func_validate_options [ARG]...
670
# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
1773
# ------------------------------
671
# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
1774
# Perform any sanity checks on option settings and/or unconsumed
672
# is given, then evaluate it.  Use the saved locale for evaluation.
1775
# arguments.
673
func_show_eval_locale ()
1776
func_hookable func_validate_options
1777
func_validate_options ()
674
{
1778
{
675
    my_cmd="$1"
1779
    $debug_cmd
676
    my_fail_exp="${2-:}"
677
1780
678
    ${opt_silent-false} || {
1781
    # Display all warnings if -W was not given.
679
      func_quote_for_expand "$my_cmd"
1782
    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
680
      eval "func_echo $func_quote_for_expand_result"
681
    }
682
1783
683
    if ${opt_dry_run-false}; then :; else
1784
    func_run_hooks func_validate_options ${1+"$@"}
684
      eval "$lt_user_locale
685
	    $my_cmd"
686
      my_status=$?
687
      eval "$lt_safe_locale"
688
      if test "$my_status" -eq 0; then :; else
689
	eval "(exit $my_status); $my_fail_exp"
690
      fi
691
    fi
692
}
693
1785
694
# func_tr_sh
1786
    # Bail if the options were screwed!
695
# Turn $1 into a string suitable for a shell variable name.
1787
    $exit_cmd $EXIT_FAILURE
696
# Result is stored in $func_tr_sh_result.  All characters
1788
697
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1789
    # save modified positional parameters for caller
698
# if $1 begins with a digit, a '_' is prepended as well.
1790
    func_validate_options_result=$func_run_hooks_result
699
func_tr_sh ()
700
{
701
  case $1 in
702
  [0-9]* | *[!a-zA-Z0-9_]*)
703
    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
704
    ;;
705
  * )
706
    func_tr_sh_result=$1
707
    ;;
708
  esac
709
}
1791
}
710
1792
711
1793
712
# func_version
713
# Echo version message to standard output and exit.
714
func_version ()
715
{
716
    $opt_debug
717
1794
718
    $SED -n '/(C)/!b go
1795
## ----------------- ##
719
	:more
1796
## Helper functions. ##
720
	/\./!{
1797
## ----------------- ##
721
	  N
722
	  s/\n# / /
723
	  b more
724
	}
725
	:go
726
	/^# '$PROGRAM' (GNU /,/# warranty; / {
727
        s/^# //
728
	s/^# *$//
729
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
730
        p
731
     }' < "$progpath"
732
     exit $?
733
}
734
1798
735
# func_usage
1799
# This section contains the helper functions used by the rest of the
736
# Echo short help message to standard output and exit.
1800
# hookable option parser framework in ascii-betical order.
737
func_usage ()
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 ()
738
{
1808
{
739
    $opt_debug
1809
    $debug_cmd
740
1810
741
    $SED -n '/^# Usage:/,/^#  *.*--help/ {
1811
    eval \$ECHO \""Usage: $usage"\"
742
        s/^# //
1812
    eval \$ECHO \""$fatal_help"\"
743
	s/^# *$//
1813
    func_error ${1+"$@"}
744
	s/\$progname/'$progname'/
1814
    exit $EXIT_FAILURE
745
	p
746
    }' < "$progpath"
747
    echo
748
    $ECHO "run \`$progname --help | more' for full usage"
749
    exit $?
750
}
1815
}
751
1816
752
# func_help [NOEXIT]
1817
753
# Echo long help message to standard output and exit,
1818
# func_help
754
# unless 'noexit' is passed as argument.
1819
# ---------
1820
# Echo long help message to standard output and exit.
755
func_help ()
1821
func_help ()
756
{
1822
{
757
    $opt_debug
1823
    $debug_cmd
758
1824
759
    $SED -n '/^# Usage:/,/# Report bugs to/ {
1825
    func_usage_message
760
	:print
1826
    $ECHO "$long_help_message"
761
        s/^# //
1827
    exit 0
762
	s/^# *$//
763
	s*\$progname*'$progname'*
764
	s*\$host*'"$host"'*
765
	s*\$SHELL*'"$SHELL"'*
766
	s*\$LTCC*'"$LTCC"'*
767
	s*\$LTCFLAGS*'"$LTCFLAGS"'*
768
	s*\$LD*'"$LD"'*
769
	s/\$with_gnu_ld/'"$with_gnu_ld"'/
770
	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
771
	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
772
	p
773
	d
774
     }
775
     /^# .* home page:/b print
776
     /^# General help using/b print
777
     ' < "$progpath"
778
    ret=$?
779
    if test -z "$1"; then
780
      exit $ret
781
    fi
782
}
1828
}
783
1829
784
# func_missing_arg argname
1830
1831
# func_missing_arg ARGNAME
1832
# ------------------------
785
# Echo program name prefixed message to standard error and set global
1833
# Echo program name prefixed message to standard error and set global
786
# exit_cmd.
1834
# exit_cmd.
787
func_missing_arg ()
1835
func_missing_arg ()
788
{
1836
{
789
    $opt_debug
1837
    $debug_cmd
790
1838
791
    func_error "missing argument for $1."
1839
    func_error "Missing argument for '$1'."
792
    exit_cmd=exit
1840
    exit_cmd=exit
793
}
1841
}
794
1842
795
1843
796
# func_split_short_opt shortopt
1844
# func_split_equals STRING
1845
# ------------------------
1846
# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
1847
# splitting STRING at the '=' sign.
1848
test -z "$_G_HAVE_XSI_OPS" \
1849
    && (eval 'x=a/b/c;
1850
      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
1851
    && _G_HAVE_XSI_OPS=yes
1852
1853
if test yes = "$_G_HAVE_XSI_OPS"
1854
then
1855
  # This is an XSI compatible shell, allowing a faster implementation...
1856
  eval 'func_split_equals ()
1857
  {
1858
      $debug_cmd
1859
1860
      func_split_equals_lhs=${1%%=*}
1861
      func_split_equals_rhs=${1#*=}
1862
      test "x$func_split_equals_lhs" = "x$1" \
1863
        && func_split_equals_rhs=
1864
  }'
1865
else
1866
  # ...otherwise fall back to using expr, which is often a shell builtin.
1867
  func_split_equals ()
1868
  {
1869
      $debug_cmd
1870
1871
      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
1872
      func_split_equals_rhs=
1873
      test "x$func_split_equals_lhs" = "x$1" \
1874
        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
1875
  }
1876
fi #func_split_equals
1877
1878
1879
# func_split_short_opt SHORTOPT
1880
# -----------------------------
797
# Set func_split_short_opt_name and func_split_short_opt_arg shell
1881
# Set func_split_short_opt_name and func_split_short_opt_arg shell
798
# variables after splitting SHORTOPT after the 2nd character.
1882
# variables after splitting SHORTOPT after the 2nd character.
799
func_split_short_opt ()
1883
if test yes = "$_G_HAVE_XSI_OPS"
1884
then
1885
  # This is an XSI compatible shell, allowing a faster implementation...
1886
  eval 'func_split_short_opt ()
1887
  {
1888
      $debug_cmd
1889
1890
      func_split_short_opt_arg=${1#??}
1891
      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
1892
  }'
1893
else
1894
  # ...otherwise fall back to using expr, which is often a shell builtin.
1895
  func_split_short_opt ()
1896
  {
1897
      $debug_cmd
1898
1899
      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
1900
      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
1901
  }
1902
fi #func_split_short_opt
1903
1904
1905
# func_usage
1906
# ----------
1907
# Echo short help message to standard output and exit.
1908
func_usage ()
800
{
1909
{
801
    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
1910
    $debug_cmd
802
    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
803
1911
804
    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
1912
    func_usage_message
805
    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
1913
    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
806
} # func_split_short_opt may be replaced by extended shell implementation
1914
    exit 0
1915
}
807
1916
808
1917
809
# func_split_long_opt longopt
1918
# func_usage_message
810
# Set func_split_long_opt_name and func_split_long_opt_arg shell
1919
# ------------------
811
# variables after splitting LONGOPT at the `=' sign.
1920
# Echo short help message to standard output.
812
func_split_long_opt ()
1921
func_usage_message ()
813
{
1922
{
814
    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
1923
    $debug_cmd
815
    my_sed_long_arg='1s/^--[^=]*=//'
816
1924
817
    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
1925
    eval \$ECHO \""Usage: $usage"\"
818
    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
1926
    echo
819
} # func_split_long_opt may be replaced by extended shell implementation
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
}
820
1936
821
exit_cmd=:
822
1937
1938
# func_version
1939
# ------------
1940
# Echo version message to standard output and exit.
1941
func_version ()
1942
{
1943
    $debug_cmd
823
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"
824
1966
1967
    exit $?
1968
}
825
1969
826
1970
827
magic="%%%MAGIC variable%%%"
1971
# Local variables:
828
magic_exe="%%%MAGIC EXE variable%%%"
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:
829
1978
830
# Global variables.
1979
# Set a version string.
831
nonopt=
1980
scriptversion='(GNU libtool) 2.4.3'
832
preserve_args=
833
lo2o="s/\\.lo\$/.${objext}/"
834
o2lo="s/\\.${objext}\$/.lo/"
835
extracted_archives=
836
extracted_serial=0
837
1981
838
# If this variable is set in any of the actions, the command in it
839
# will be execed at the end.  This prevents here-documents from being
840
# left over by shells.
841
exec_cmd=
842
1982
843
# func_append var value
1983
# func_echo ARG...
844
# Append VALUE to the end of shell variable VAR.
1984
# ----------------
845
func_append ()
1985
# Libtool also displays the current mode in messages, so override
1986
# funclib.sh func_echo with this custom definition.
1987
func_echo ()
846
{
1988
{
847
    eval "${1}=\$${1}\${2}"
1989
    $debug_cmd
848
} # func_append may be replaced by extended shell implementation
849
1990
850
# func_append_quoted var value
1991
    _G_message=$*
851
# Quote VALUE and append to the end of shell variable VAR, separated
1992
852
# by a space.
1993
    func_echo_IFS=$IFS
853
func_append_quoted ()
1994
    IFS=$nl
854
{
1995
    for _G_line in $_G_message; do
855
    func_quote_for_eval "${2}"
1996
      IFS=$func_echo_IFS
856
    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
1997
      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
857
} # func_append_quoted may be replaced by extended shell implementation
1998
    done
1999
    IFS=$func_echo_IFS
2000
}
858
2001
859
2002
860
# func_arith arithmetic-term...
2003
# func_warning ARG...
861
func_arith ()
2004
# -------------------
2005
# Libtool warnings are not categorized, so override funclib.sh
2006
# func_warning with this simpler definition.
2007
func_warning ()
862
{
2008
{
863
    func_arith_result=`expr "${@}"`
2009
    $debug_cmd
864
} # func_arith may be replaced by extended shell implementation
865
2010
2011
    $warning_func ${1+"$@"}
2012
}
866
2013
867
# func_len string
868
# STRING may not start with a hyphen.
869
func_len ()
870
{
871
    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
872
} # func_len may be replaced by extended shell implementation
873
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
"
874
2040
875
# func_lo2o object
2041
# Additional text appended to 'usage_message' in response to '--help'.
876
func_lo2o ()
2042
long_help_message=$long_help_message"
877
{
878
    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
879
} # func_lo2o may be replaced by extended shell implementation
880
2043
2044
MODE must be one of the following:
881
2045
882
# func_xform libobj-or-source
2046
       clean           remove files from the build directory
883
func_xform ()
2047
       compile         compile a source file into a libtool object
884
{
2048
       execute         automatically set library path, then run a program
885
    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
2049
       finish          complete the installation of libtool libraries
886
} # func_xform may be replaced by extended shell implementation
2050
       install         install libraries or executables
2051
       link            create a library or an executable
2052
       uninstall       remove libraries from an installed directory
2053
2054
MODE-ARGS vary depending on the MODE.  When passed as first option,
2055
'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
2056
Try '$progname --help --mode=MODE' for a more detailed description of MODE.
2057
2058
When reporting a bug, please describe a test case to reproduce it and
2059
include the following information:
2060
2061
       host-triplet:   $host
2062
       shell:          $SHELL
2063
       compiler:       $LTCC
2064
       compiler flags: $LTCFLAGS
2065
       linker:         $LD (gnu? $with_gnu_ld)
2066
       version:        $progname (GNU libtool) 2.4.3
2067
       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
2068
       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
2069
2070
Report bugs to <bug-libtool@gnu.org>.
2071
GNU libtool home page: <http://www.gnu.org/software/libtool/>.
2072
General help using GNU software: <http://www.gnu.org/gethelp/>."
2073
2074
2075
# func_lo2o OBJECT-NAME
2076
# ---------------------
2077
# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
2078
# object suffix.
2079
2080
lo2o=s/\\.lo\$/.$objext/
2081
o2lo=s/\\.$objext\$/.lo/
2082
2083
if test yes = "$_G_HAVE_XSI_OPS"; then
2084
  eval 'func_lo2o ()
2085
  {
2086
    case $1 in
2087
      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
2088
      *   ) func_lo2o_result=$1               ;;
2089
    esac
2090
  }'
2091
2092
  # func_xform LIBOBJ-OR-SOURCE
2093
  # ---------------------------
2094
  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
2095
  # suffix to a '.lo' libtool-object suffix.
2096
  eval 'func_xform ()
2097
  {
2098
    func_xform_result=${1%.*}.lo
2099
  }'
2100
else
2101
  # ...otherwise fall back to using sed.
2102
  func_lo2o ()
2103
  {
2104
    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
2105
  }
2106
2107
  func_xform ()
2108
  {
2109
    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
2110
  }
2111
fi
887
2112
888
2113
889
# func_fatal_configuration arg...
2114
# func_fatal_configuration ARG...
2115
# -------------------------------
890
# Echo program name prefixed message to standard error, followed by
2116
# Echo program name prefixed message to standard error, followed by
891
# a configuration failure hint, and exit.
2117
# a configuration failure hint, and exit.
892
func_fatal_configuration ()
2118
func_fatal_configuration ()
893
{
2119
{
894
    func_error ${1+"$@"}
2120
    func__fatal_error ${1+"$@"} \
895
    func_error "See the $PACKAGE documentation for more information."
2121
      "See the $PACKAGE documentation for more information." \
896
    func_fatal_error "Fatal configuration error."
2122
      "Fatal configuration error."
897
}
2123
}
898
2124
899
2125
900
# func_config
2126
# func_config
2127
# -----------
901
# Display the configuration for all the tags in this script.
2128
# Display the configuration for all the tags in this script.
902
func_config ()
2129
func_config ()
903
{
2130
{
Lines 915-931 Link Here
915
    exit $?
2142
    exit $?
916
}
2143
}
917
2144
2145
918
# func_features
2146
# func_features
2147
# -------------
919
# Display the features supported by this script.
2148
# Display the features supported by this script.
920
func_features ()
2149
func_features ()
921
{
2150
{
922
    echo "host: $host"
2151
    echo "host: $host"
923
    if test "$build_libtool_libs" = yes; then
2152
    if test yes = "$build_libtool_libs"; then
924
      echo "enable shared libraries"
2153
      echo "enable shared libraries"
925
    else
2154
    else
926
      echo "disable shared libraries"
2155
      echo "disable shared libraries"
927
    fi
2156
    fi
928
    if test "$build_old_libs" = yes; then
2157
    if test yes = "$build_old_libs"; then
929
      echo "enable static libraries"
2158
      echo "enable static libraries"
930
    else
2159
    else
931
      echo "disable static libraries"
2160
      echo "disable static libraries"
Lines 934-1222 Link Here
934
    exit $?
2163
    exit $?
935
}
2164
}
936
2165
937
# func_enable_tag tagname
2166
2167
# func_enable_tag TAGNAME
2168
# -----------------------
938
# Verify that TAGNAME is valid, and either flag an error and exit, or
2169
# Verify that TAGNAME is valid, and either flag an error and exit, or
939
# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
2170
# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
940
# variable here.
2171
# variable here.
941
func_enable_tag ()
2172
func_enable_tag ()
942
{
2173
{
943
  # Global variable:
2174
    # Global variable:
944
  tagname="$1"
2175
    tagname=$1
945
2176
946
  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
2177
    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
947
  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
2178
    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
948
  sed_extractcf="/$re_begincf/,/$re_endcf/p"
2179
    sed_extractcf=/$re_begincf/,/$re_endcf/p
949
2180
950
  # Validate tagname.
2181
    # Validate tagname.
951
  case $tagname in
2182
    case $tagname in
952
    *[!-_A-Za-z0-9,/]*)
2183
      *[!-_A-Za-z0-9,/]*)
953
      func_fatal_error "invalid tag name: $tagname"
2184
        func_fatal_error "invalid tag name: $tagname"
954
      ;;
2185
        ;;
955
  esac
2186
    esac
956
2187
957
  # Don't test for the "default" C tag, as we know it's
2188
    # Don't test for the "default" C tag, as we know it's
958
  # there but not specially marked.
2189
    # there but not specially marked.
959
  case $tagname in
2190
    case $tagname in
960
    CC) ;;
2191
        CC) ;;
961
    *)
2192
    *)
962
      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
2193
        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
963
	taglist="$taglist $tagname"
2194
	  taglist="$taglist $tagname"
964
2195
965
	# Evaluate the configuration.  Be careful to quote the path
2196
	  # Evaluate the configuration.  Be careful to quote the path
966
	# and the sed script, to avoid splitting on whitespace, but
2197
	  # and the sed script, to avoid splitting on whitespace, but
967
	# also don't use non-portable quotes within backquotes within
2198
	  # also don't use non-portable quotes within backquotes within
968
	# quotes we have to do it in 2 steps:
2199
	  # quotes we have to do it in 2 steps:
969
	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
2200
	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
970
	eval "$extractedcf"
2201
	  eval "$extractedcf"
971
      else
2202
        else
972
	func_error "ignoring unknown tag $tagname"
2203
	  func_error "ignoring unknown tag $tagname"
973
      fi
2204
        fi
974
      ;;
2205
        ;;
975
  esac
2206
    esac
976
}
2207
}
977
2208
2209
978
# func_check_version_match
2210
# func_check_version_match
2211
# ------------------------
979
# Ensure that we are using m4 macros, and libtool script from the same
2212
# Ensure that we are using m4 macros, and libtool script from the same
980
# release of libtool.
2213
# release of libtool.
981
func_check_version_match ()
2214
func_check_version_match ()
982
{
2215
{
983
  if test "$package_revision" != "$macro_revision"; then
2216
    if test "$package_revision" != "$macro_revision"; then
984
    if test "$VERSION" != "$macro_version"; then
2217
      if test "$VERSION" != "$macro_version"; then
985
      if test -z "$macro_version"; then
2218
        if test -z "$macro_version"; then
986
        cat >&2 <<_LT_EOF
2219
          cat >&2 <<_LT_EOF
987
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
2220
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
988
$progname: definition of this LT_INIT comes from an older release.
2221
$progname: definition of this LT_INIT comes from an older release.
989
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2222
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
990
$progname: and run autoconf again.
2223
$progname: and run autoconf again.
991
_LT_EOF
2224
_LT_EOF
992
      else
2225
        else
993
        cat >&2 <<_LT_EOF
2226
          cat >&2 <<_LT_EOF
994
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
2227
$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
995
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
2228
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
996
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
2229
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
997
$progname: and run autoconf again.
2230
$progname: and run autoconf again.
998
_LT_EOF
2231
_LT_EOF
999
      fi
2232
        fi
1000
    else
2233
      else
1001
      cat >&2 <<_LT_EOF
2234
        cat >&2 <<_LT_EOF
1002
$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
2235
$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
1003
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
2236
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
1004
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
2237
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
1005
$progname: of $PACKAGE $VERSION and run autoconf again.
2238
$progname: of $PACKAGE $VERSION and run autoconf again.
1006
_LT_EOF
2239
_LT_EOF
1007
    fi
2240
      fi
1008
2241
1009
    exit $EXIT_MISMATCH
2242
      exit $EXIT_MISMATCH
1010
  fi
2243
    fi
1011
}
2244
}
1012
2245
1013
2246
1014
# Shorthand for --mode=foo, only valid as the first argument
2247
# libtool_options_prep [ARG]...
1015
case $1 in
2248
# -----------------------------
1016
clean|clea|cle|cl)
2249
# Preparation for options parsed by libtool.
1017
  shift; set dummy --mode clean ${1+"$@"}; shift
2250
libtool_options_prep ()
1018
  ;;
2251
{
1019
compile|compil|compi|comp|com|co|c)
2252
    $debug_mode
1020
  shift; set dummy --mode compile ${1+"$@"}; shift
1021
  ;;
1022
execute|execut|execu|exec|exe|ex|e)
1023
  shift; set dummy --mode execute ${1+"$@"}; shift
1024
  ;;
1025
finish|finis|fini|fin|fi|f)
1026
  shift; set dummy --mode finish ${1+"$@"}; shift
1027
  ;;
1028
install|instal|insta|inst|ins|in|i)
1029
  shift; set dummy --mode install ${1+"$@"}; shift
1030
  ;;
1031
link|lin|li|l)
1032
  shift; set dummy --mode link ${1+"$@"}; shift
1033
  ;;
1034
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1035
  shift; set dummy --mode uninstall ${1+"$@"}; shift
1036
  ;;
1037
esac
1038
1039
1040
2253
1041
# Option defaults:
2254
    # Option defaults:
1042
opt_debug=:
2255
    opt_config=false
1043
opt_dry_run=false
2256
    opt_dlopen=
1044
opt_config=false
2257
    opt_dry_run=false
1045
opt_preserve_dup_deps=false
2258
    opt_help=false
1046
opt_features=false
2259
    opt_mode=
1047
opt_finish=false
2260
    opt_preserve_dup_deps=false
1048
opt_help=false
2261
    opt_quiet=false
1049
opt_help_all=false
1050
opt_silent=:
1051
opt_warning=:
1052
opt_verbose=:
1053
opt_silent=false
1054
opt_verbose=false
1055
2262
2263
    nonopt=
2264
    preserve_args=
1056
2265
1057
# Parse options once, thoroughly.  This comes as soon as possible in the
2266
    # Shorthand for --mode=foo, only valid as the first argument
1058
# script to make things like `--version' happen as quickly as we can.
2267
    case $1 in
1059
{
2268
    clean|clea|cle|cl)
1060
  # this just eases exit handling
2269
      shift; set dummy --mode clean ${1+"$@"}; shift
1061
  while test $# -gt 0; do
2270
      ;;
1062
    opt="$1"
2271
    compile|compil|compi|comp|com|co|c)
1063
    shift
2272
      shift; set dummy --mode compile ${1+"$@"}; shift
1064
    case $opt in
2273
      ;;
1065
      --debug|-x)	opt_debug='set -x'
2274
    execute|execut|execu|exec|exe|ex|e)
1066
			func_echo "enabling shell trace mode"
2275
      shift; set dummy --mode execute ${1+"$@"}; shift
1067
			$opt_debug
2276
      ;;
1068
			;;
2277
    finish|finis|fini|fin|fi|f)
1069
      --dry-run|--dryrun|-n)
2278
      shift; set dummy --mode finish ${1+"$@"}; shift
1070
			opt_dry_run=:
2279
      ;;
1071
			;;
2280
    install|instal|insta|inst|ins|in|i)
1072
      --config)
2281
      shift; set dummy --mode install ${1+"$@"}; shift
1073
			opt_config=:
2282
      ;;
1074
func_config
2283
    link|lin|li|l)
1075
			;;
2284
      shift; set dummy --mode link ${1+"$@"}; shift
1076
      --dlopen|-dlopen)
2285
      ;;
1077
			optarg="$1"
2286
    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1078
			opt_dlopen="${opt_dlopen+$opt_dlopen
2287
      shift; set dummy --mode uninstall ${1+"$@"}; shift
1079
}$optarg"
2288
      ;;
1080
			shift
1081
			;;
1082
      --preserve-dup-deps)
1083
			opt_preserve_dup_deps=:
1084
			;;
1085
      --features)
1086
			opt_features=:
1087
func_features
1088
			;;
1089
      --finish)
1090
			opt_finish=:
1091
set dummy --mode finish ${1+"$@"}; shift
1092
			;;
1093
      --help)
1094
			opt_help=:
1095
			;;
1096
      --help-all)
1097
			opt_help_all=:
1098
opt_help=': help-all'
1099
			;;
1100
      --mode)
1101
			test $# = 0 && func_missing_arg $opt && break
1102
			optarg="$1"
1103
			opt_mode="$optarg"
1104
case $optarg in
1105
  # Valid mode arguments:
1106
  clean|compile|execute|finish|install|link|relink|uninstall) ;;
1107
1108
  # Catch anything else as an error
1109
  *) func_error "invalid argument for $opt"
1110
     exit_cmd=exit
1111
     break
1112
     ;;
1113
esac
1114
			shift
1115
			;;
1116
      --no-silent|--no-quiet)
1117
			opt_silent=false
1118
func_append preserve_args " $opt"
1119
			;;
1120
      --no-warning|--no-warn)
1121
			opt_warning=false
1122
func_append preserve_args " $opt"
1123
			;;
1124
      --no-verbose)
1125
			opt_verbose=false
1126
func_append preserve_args " $opt"
1127
			;;
1128
      --silent|--quiet)
1129
			opt_silent=:
1130
func_append preserve_args " $opt"
1131
        opt_verbose=false
1132
			;;
1133
      --verbose|-v)
1134
			opt_verbose=:
1135
func_append preserve_args " $opt"
1136
opt_silent=false
1137
			;;
1138
      --tag)
1139
			test $# = 0 && func_missing_arg $opt && break
1140
			optarg="$1"
1141
			opt_tag="$optarg"
1142
func_append preserve_args " $opt $optarg"
1143
func_enable_tag "$optarg"
1144
			shift
1145
			;;
1146
1147
      -\?|-h)		func_usage				;;
1148
      --help)		func_help				;;
1149
      --version)	func_version				;;
1150
1151
      # Separate optargs to long options:
1152
      --*=*)
1153
			func_split_long_opt "$opt"
1154
			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1155
			shift
1156
			;;
1157
1158
      # Separate non-argument short options:
1159
      -\?*|-h*|-n*|-v*)
1160
			func_split_short_opt "$opt"
1161
			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1162
			shift
1163
			;;
1164
1165
      --)		break					;;
1166
      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
1167
      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
1168
    esac
2289
    esac
1169
  done
1170
2290
1171
  # Validate options:
2291
    # Pass back the list of options.
2292
    func_quote_for_eval ${1+"$@"}
2293
    libtool_options_prep_result=$func_quote_for_eval_result
2294
}
2295
func_add_hook func_options_prep libtool_options_prep
1172
2296
1173
  # save first non-option argument
1174
  if test "$#" -gt 0; then
1175
    nonopt="$opt"
1176
    shift
1177
  fi
1178
2297
1179
  # preserve --debug
2298
# libtool_parse_options [ARG]...
1180
  test "$opt_debug" = : || func_append preserve_args " --debug"
2299
# ---------------------------------
2300
# Provide handling for libtool specific options.
2301
libtool_parse_options ()
2302
{
2303
    $debug_cmd
1181
2304
1182
  case $host in
2305
    # Perform our own loop to consume as many options as possible in
1183
    *cygwin* | *mingw* | *pw32* | *cegcc*)
2306
    # each iteration.
1184
      # don't eliminate duplications in $postdeps and $predeps
2307
    while test $# -gt 0; do
1185
      opt_duplicate_compiler_generated_deps=:
2308
      _G_opt=$1
1186
      ;;
2309
      shift
1187
    *)
2310
      case $_G_opt in
1188
      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
2311
        --dry-run|--dryrun|-n)
1189
      ;;
2312
                        opt_dry_run=:
1190
  esac
2313
                        ;;
2314
2315
        --config)       func_config ;;
2316
2317
        --dlopen|-dlopen)
2318
                        opt_dlopen="${opt_dlopen+$opt_dlopen
2319
}$1"
2320
                        shift
2321
                        ;;
2322
2323
        --preserve-dup-deps)
2324
                        opt_preserve_dup_deps=: ;;
2325
2326
        --features)     func_features ;;
2327
2328
        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
2329
2330
        --help)         opt_help=: ;;
2331
2332
        --help-all)     opt_help=': help-all' ;;
2333
2334
        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
2335
                        opt_mode=$1
2336
                        case $1 in
2337
                          # Valid mode arguments:
2338
                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
2339
2340
                          # Catch anything else as an error
2341
                          *) func_error "invalid argument for $_G_opt"
2342
                             exit_cmd=exit
2343
                             break
2344
                             ;;
2345
                        esac
2346
                        shift
2347
                        ;;
2348
2349
        --no-silent|--no-quiet)
2350
                        opt_quiet=false
2351
                        func_append preserve_args " $_G_opt"
2352
                        ;;
2353
2354
        --no-warnings|--no-warning|--no-warn)
2355
                        opt_warning=false
2356
                        func_append preserve_args " $_G_opt"
2357
                        ;;
2358
2359
        --no-verbose)
2360
                        opt_verbose=false
2361
                        func_append preserve_args " $_G_opt"
2362
                        ;;
2363
2364
        --silent|--quiet)
2365
                        opt_quiet=:
2366
                        opt_verbose=false
2367
                        func_append preserve_args " $_G_opt"
2368
                        ;;
2369
2370
        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
2371
                        opt_tag=$1
2372
                        func_append preserve_args " $_G_opt $1"
2373
                        func_enable_tag "$1"
2374
                        shift
2375
                        ;;
2376
2377
        --verbose|-v)   opt_quiet=false
2378
                        opt_verbose=:
2379
                        func_append preserve_args " $_G_opt"
2380
                        ;;
2381
2382
	# An option not handled by this hook function:
2383
        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
2384
      esac
2385
    done
1191
2386
1192
  $opt_help || {
1193
    # Sanity checks first:
1194
    func_check_version_match
1195
2387
1196
    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
2388
    # save modified positional parameters for caller
1197
      func_fatal_configuration "not configured to build any kind of library"
2389
    func_quote_for_eval ${1+"$@"}
1198
    fi
2390
    libtool_parse_options_result=$func_quote_for_eval_result
2391
}
2392
func_add_hook func_parse_options libtool_parse_options
1199
2393
1200
    # Darwin sucks
1201
    eval std_shrext=\"$shrext_cmds\"
1202
2394
1203
    # Only execute mode is allowed to have -dlopen flags.
2395
1204
    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
2396
# libtool_validate_options [ARG]...
1205
      func_error "unrecognized option \`-dlopen'"
2397
# ---------------------------------
1206
      $ECHO "$help" 1>&2
2398
# Perform any sanity checks on option settings and/or unconsumed
1207
      exit $EXIT_FAILURE
2399
# arguments.
2400
libtool_validate_options ()
2401
{
2402
    # save first non-option argument
2403
    if test 0 -lt $#; then
2404
      nonopt=$1
2405
      shift
1208
    fi
2406
    fi
1209
2407
1210
    # Change the help message to a mode-specific one.
2408
    # preserve --debug
1211
    generic_help="$help"
2409
    test : = "$debug_cmd" || func_append preserve_args " --debug"
1212
    help="Try \`$progname --help --mode=$opt_mode' for more information."
1213
  }
1214
2410
2411
    case $host in
2412
      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
2413
      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
2414
      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2*)
2415
        # don't eliminate duplications in $postdeps and $predeps
2416
        opt_duplicate_compiler_generated_deps=:
2417
        ;;
2418
      *)
2419
        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
2420
        ;;
2421
    esac
2422
2423
    $opt_help || {
2424
      # Sanity checks first:
2425
      func_check_version_match
2426
2427
      test yes != "$build_libtool_libs" \
2428
        && test yes != "$build_old_libs" \
2429
        && func_fatal_configuration "not configured to build any kind of library"
2430
2431
      # Darwin sucks
2432
      eval std_shrext=\"$shrext_cmds\"
2433
2434
      # Only execute mode is allowed to have -dlopen flags.
2435
      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
2436
        func_error "unrecognized option '-dlopen'"
2437
        $ECHO "$help" 1>&2
2438
        exit $EXIT_FAILURE
2439
      fi
2440
2441
      # Change the help message to a mode-specific one.
2442
      generic_help=$help
2443
      help="Try '$progname --help --mode=$opt_mode' for more information."
2444
    }
1215
2445
1216
  # Bail if the options were screwed
2446
    # Pass back the unparsed argument list
1217
  $exit_cmd $EXIT_FAILURE
2447
    func_quote_for_eval ${1+"$@"}
2448
    libtool_validate_options_result=$func_quote_for_eval_result
1218
}
2449
}
2450
func_add_hook func_validate_options libtool_validate_options
2451
1219
2452
2453
# Process options as early as possible so that --help and --version
2454
# can return quickly.
2455
func_options ${1+"$@"}
2456
eval set dummy "$func_options_result"; shift
1220
2457
1221
2458
1222
2459
Lines 1224-1247 Link Here
1224
##    Main.    ##
2461
##    Main.    ##
1225
## ----------- ##
2462
## ----------- ##
1226
2463
2464
magic='%%%MAGIC variable%%%'
2465
magic_exe='%%%MAGIC EXE variable%%%'
2466
2467
# Global variables.
2468
extracted_archives=
2469
extracted_serial=0
2470
2471
# If this variable is set in any of the actions, the command in it
2472
# will be execed at the end.  This prevents here-documents from being
2473
# left over by shells.
2474
exec_cmd=
2475
2476
2477
# A function that is used when there is no print builtin or printf.
2478
func_fallback_echo ()
2479
{
2480
  eval 'cat <<_LTECHO_EOF
2481
$1
2482
_LTECHO_EOF'
2483
}
2484
2485
# func_generated_by_libtool
2486
# True iff stdin has been generated by Libtool. This function is only
2487
# a basic sanity check; it will hardly flush out determined imposters.
2488
func_generated_by_libtool_p ()
2489
{
2490
  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
2491
}
2492
1227
# func_lalib_p file
2493
# func_lalib_p file
1228
# True iff FILE is a libtool `.la' library or `.lo' object file.
2494
# True iff FILE is a libtool '.la' library or '.lo' object file.
1229
# This function is only a basic sanity check; it will hardly flush out
2495
# This function is only a basic sanity check; it will hardly flush out
1230
# determined imposters.
2496
# determined imposters.
1231
func_lalib_p ()
2497
func_lalib_p ()
1232
{
2498
{
1233
    test -f "$1" &&
2499
    test -f "$1" &&
1234
      $SED -e 4q "$1" 2>/dev/null \
2500
      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
1235
        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1236
}
2501
}
1237
2502
1238
# func_lalib_unsafe_p file
2503
# func_lalib_unsafe_p file
1239
# True iff FILE is a libtool `.la' library or `.lo' object file.
2504
# True iff FILE is a libtool '.la' library or '.lo' object file.
1240
# This function implements the same check as func_lalib_p without
2505
# This function implements the same check as func_lalib_p without
1241
# resorting to external programs.  To this end, it redirects stdin and
2506
# resorting to external programs.  To this end, it redirects stdin and
1242
# closes it afterwards, without saving the original file descriptor.
2507
# closes it afterwards, without saving the original file descriptor.
1243
# As a safety measure, use it only where a negative result would be
2508
# As a safety measure, use it only where a negative result would be
1244
# fatal anyway.  Works if `file' does not exist.
2509
# fatal anyway.  Works if 'file' does not exist.
1245
func_lalib_unsafe_p ()
2510
func_lalib_unsafe_p ()
1246
{
2511
{
1247
    lalib_p=no
2512
    lalib_p=no
Lines 1249-1261 Link Here
1249
	for lalib_p_l in 1 2 3 4
2514
	for lalib_p_l in 1 2 3 4
1250
	do
2515
	do
1251
	    read lalib_p_line
2516
	    read lalib_p_line
1252
	    case "$lalib_p_line" in
2517
	    case $lalib_p_line in
1253
		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
2518
		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1254
	    esac
2519
	    esac
1255
	done
2520
	done
1256
	exec 0<&5 5<&-
2521
	exec 0<&5 5<&-
1257
    fi
2522
    fi
1258
    test "$lalib_p" = yes
2523
    test yes = "$lalib_p"
1259
}
2524
}
1260
2525
1261
# func_ltwrapper_script_p file
2526
# func_ltwrapper_script_p file
Lines 1264-1270 Link Here
1264
# determined imposters.
2529
# determined imposters.
1265
func_ltwrapper_script_p ()
2530
func_ltwrapper_script_p ()
1266
{
2531
{
1267
    func_lalib_p "$1"
2532
    test -f "$1" &&
2533
      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
1268
}
2534
}
1269
2535
1270
# func_ltwrapper_executable_p file
2536
# func_ltwrapper_executable_p file
Lines 1289-1295 Link Here
1289
{
2555
{
1290
    func_dirname_and_basename "$1" "" "."
2556
    func_dirname_and_basename "$1" "" "."
1291
    func_stripname '' '.exe' "$func_basename_result"
2557
    func_stripname '' '.exe' "$func_basename_result"
1292
    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
2558
    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
1293
}
2559
}
1294
2560
1295
# func_ltwrapper_p file
2561
# func_ltwrapper_p file
Lines 1308-1318 Link Here
1308
# FAIL_CMD may read-access the current command in variable CMD!
2574
# FAIL_CMD may read-access the current command in variable CMD!
1309
func_execute_cmds ()
2575
func_execute_cmds ()
1310
{
2576
{
1311
    $opt_debug
2577
    $debug_cmd
2578
1312
    save_ifs=$IFS; IFS='~'
2579
    save_ifs=$IFS; IFS='~'
1313
    for cmd in $1; do
2580
    for cmd in $1; do
1314
      IFS=$save_ifs
2581
      IFS=$sp$nl
1315
      eval cmd=\"$cmd\"
2582
      eval cmd=\"$cmd\"
2583
      IFS=$save_ifs
1316
      func_show_eval "$cmd" "${2-:}"
2584
      func_show_eval "$cmd" "${2-:}"
1317
    done
2585
    done
1318
    IFS=$save_ifs
2586
    IFS=$save_ifs
Lines 1324-1333 Link Here
1324
# Note that it is not necessary on cygwin/mingw to append a dot to
2592
# Note that it is not necessary on cygwin/mingw to append a dot to
1325
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
2593
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1326
# behavior happens only for exec(3), not for open(2)!  Also, sourcing
2594
# behavior happens only for exec(3), not for open(2)!  Also, sourcing
1327
# `FILE.' does not work on cygwin managed mounts.
2595
# 'FILE.' does not work on cygwin managed mounts.
1328
func_source ()
2596
func_source ()
1329
{
2597
{
1330
    $opt_debug
2598
    $debug_cmd
2599
1331
    case $1 in
2600
    case $1 in
1332
    */* | *\\*)	. "$1" ;;
2601
    */* | *\\*)	. "$1" ;;
1333
    *)		. "./$1" ;;
2602
    *)		. "./$1" ;;
Lines 1354-1363 Link Here
1354
# store the result into func_replace_sysroot_result.
2623
# store the result into func_replace_sysroot_result.
1355
func_replace_sysroot ()
2624
func_replace_sysroot ()
1356
{
2625
{
1357
  case "$lt_sysroot:$1" in
2626
  case $lt_sysroot:$1 in
1358
  ?*:"$lt_sysroot"*)
2627
  ?*:"$lt_sysroot"*)
1359
    func_stripname "$lt_sysroot" '' "$1"
2628
    func_stripname "$lt_sysroot" '' "$1"
1360
    func_replace_sysroot_result="=$func_stripname_result"
2629
    func_replace_sysroot_result='='$func_stripname_result
1361
    ;;
2630
    ;;
1362
  *)
2631
  *)
1363
    # Including no sysroot.
2632
    # Including no sysroot.
Lines 1374-1380 Link Here
1374
# arg is usually of the form 'gcc ...'
2643
# arg is usually of the form 'gcc ...'
1375
func_infer_tag ()
2644
func_infer_tag ()
1376
{
2645
{
1377
    $opt_debug
2646
    $debug_cmd
2647
1378
    if test -n "$available_tags" && test -z "$tagname"; then
2648
    if test -n "$available_tags" && test -z "$tagname"; then
1379
      CC_quoted=
2649
      CC_quoted=
1380
      for arg in $CC; do
2650
      for arg in $CC; do
Lines 1393-1399 Link Here
1393
	for z in $available_tags; do
2663
	for z in $available_tags; do
1394
	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
2664
	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1395
	    # Evaluate the configuration.
2665
	    # Evaluate the configuration.
1396
	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
2666
	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1397
	    CC_quoted=
2667
	    CC_quoted=
1398
	    for arg in $CC; do
2668
	    for arg in $CC; do
1399
	      # Double-quote args containing other shell metacharacters.
2669
	      # Double-quote args containing other shell metacharacters.
Lines 1418-1424 Link Here
1418
	# line option must be used.
2688
	# line option must be used.
1419
	if test -z "$tagname"; then
2689
	if test -z "$tagname"; then
1420
	  func_echo "unable to infer tagged configuration"
2690
	  func_echo "unable to infer tagged configuration"
1421
	  func_fatal_error "specify a tag with \`--tag'"
2691
	  func_fatal_error "specify a tag with '--tag'"
1422
#	else
2692
#	else
1423
#	  func_verbose "using $tagname tagged configuration"
2693
#	  func_verbose "using $tagname tagged configuration"
1424
	fi
2694
	fi
Lines 1434-1448 Link Here
1434
# but don't create it if we're doing a dry run.
2704
# but don't create it if we're doing a dry run.
1435
func_write_libtool_object ()
2705
func_write_libtool_object ()
1436
{
2706
{
1437
    write_libobj=${1}
2707
    write_libobj=$1
1438
    if test "$build_libtool_libs" = yes; then
2708
    if test yes = "$build_libtool_libs"; then
1439
      write_lobj=\'${2}\'
2709
      write_lobj=\'$2\'
1440
    else
2710
    else
1441
      write_lobj=none
2711
      write_lobj=none
1442
    fi
2712
    fi
1443
2713
1444
    if test "$build_old_libs" = yes; then
2714
    if test yes = "$build_old_libs"; then
1445
      write_oldobj=\'${3}\'
2715
      write_oldobj=\'$3\'
1446
    else
2716
    else
1447
      write_oldobj=none
2717
      write_oldobj=none
1448
    fi
2718
    fi
Lines 1450-1456 Link Here
1450
    $opt_dry_run || {
2720
    $opt_dry_run || {
1451
      cat >${write_libobj}T <<EOF
2721
      cat >${write_libobj}T <<EOF
1452
# $write_libobj - a libtool object file
2722
# $write_libobj - a libtool object file
1453
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
2723
# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
1454
#
2724
#
1455
# Please DO NOT delete this file!
2725
# Please DO NOT delete this file!
1456
# It is necessary for linking the library.
2726
# It is necessary for linking the library.
Lines 1462-1468 Link Here
1462
non_pic_object=$write_oldobj
2732
non_pic_object=$write_oldobj
1463
2733
1464
EOF
2734
EOF
1465
      $MV "${write_libobj}T" "${write_libobj}"
2735
      $MV "${write_libobj}T" "$write_libobj"
1466
    }
2736
    }
1467
}
2737
}
1468
2738
Lines 1482-1489 Link Here
1482
# be empty on error (or when ARG is empty)
2752
# be empty on error (or when ARG is empty)
1483
func_convert_core_file_wine_to_w32 ()
2753
func_convert_core_file_wine_to_w32 ()
1484
{
2754
{
1485
  $opt_debug
2755
  $debug_cmd
1486
  func_convert_core_file_wine_to_w32_result="$1"
2756
2757
  func_convert_core_file_wine_to_w32_result=$1
1487
  if test -n "$1"; then
2758
  if test -n "$1"; then
1488
    # Unfortunately, winepath does not exit with a non-zero error code, so we
2759
    # Unfortunately, winepath does not exit with a non-zero error code, so we
1489
    # are forced to check the contents of stdout. On the other hand, if the
2760
    # are forced to check the contents of stdout. On the other hand, if the
Lines 1491-1499 Link Here
1491
    # *an error message* to stdout. So we must check for both error code of
2762
    # *an error message* to stdout. So we must check for both error code of
1492
    # zero AND non-empty stdout, which explains the odd construction:
2763
    # zero AND non-empty stdout, which explains the odd construction:
1493
    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
2764
    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1494
    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
2765
    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
1495
      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
2766
      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1496
        $SED -e "$lt_sed_naive_backslashify"`
2767
        $SED -e "$sed_naive_backslashify"`
1497
    else
2768
    else
1498
      func_convert_core_file_wine_to_w32_result=
2769
      func_convert_core_file_wine_to_w32_result=
1499
    fi
2770
    fi
Lines 1514-1531 Link Here
1514
# are convertible, then the result may be empty.
2785
# are convertible, then the result may be empty.
1515
func_convert_core_path_wine_to_w32 ()
2786
func_convert_core_path_wine_to_w32 ()
1516
{
2787
{
1517
  $opt_debug
2788
  $debug_cmd
2789
1518
  # unfortunately, winepath doesn't convert paths, only file names
2790
  # unfortunately, winepath doesn't convert paths, only file names
1519
  func_convert_core_path_wine_to_w32_result=""
2791
  func_convert_core_path_wine_to_w32_result=
1520
  if test -n "$1"; then
2792
  if test -n "$1"; then
1521
    oldIFS=$IFS
2793
    oldIFS=$IFS
1522
    IFS=:
2794
    IFS=:
1523
    for func_convert_core_path_wine_to_w32_f in $1; do
2795
    for func_convert_core_path_wine_to_w32_f in $1; do
1524
      IFS=$oldIFS
2796
      IFS=$oldIFS
1525
      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
2797
      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1526
      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
2798
      if test -n "$func_convert_core_file_wine_to_w32_result"; then
1527
        if test -z "$func_convert_core_path_wine_to_w32_result"; then
2799
        if test -z "$func_convert_core_path_wine_to_w32_result"; then
1528
          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
2800
          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
1529
        else
2801
        else
1530
          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
2802
          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1531
        fi
2803
        fi
Lines 1554-1560 Link Here
1554
# environment variable; do not put it in $PATH.
2826
# environment variable; do not put it in $PATH.
1555
func_cygpath ()
2827
func_cygpath ()
1556
{
2828
{
1557
  $opt_debug
2829
  $debug_cmd
2830
1558
  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
2831
  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1559
    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
2832
    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1560
    if test "$?" -ne 0; then
2833
    if test "$?" -ne 0; then
Lines 1563-1569 Link Here
1563
    fi
2836
    fi
1564
  else
2837
  else
1565
    func_cygpath_result=
2838
    func_cygpath_result=
1566
    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
2839
    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
1567
  fi
2840
  fi
1568
}
2841
}
1569
#end: func_cygpath
2842
#end: func_cygpath
Lines 1574-1583 Link Here
1574
# result in func_convert_core_msys_to_w32_result.
2847
# result in func_convert_core_msys_to_w32_result.
1575
func_convert_core_msys_to_w32 ()
2848
func_convert_core_msys_to_w32 ()
1576
{
2849
{
1577
  $opt_debug
2850
  $debug_cmd
2851
1578
  # awkward: cmd appends spaces to result
2852
  # awkward: cmd appends spaces to result
1579
  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
2853
  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
1580
    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
2854
    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
1581
}
2855
}
1582
#end: func_convert_core_msys_to_w32
2856
#end: func_convert_core_msys_to_w32
1583
2857
Lines 1588-1600 Link Here
1588
# func_to_host_file_result to ARG1).
2862
# func_to_host_file_result to ARG1).
1589
func_convert_file_check ()
2863
func_convert_file_check ()
1590
{
2864
{
1591
  $opt_debug
2865
  $debug_cmd
1592
  if test -z "$2" && test -n "$1" ; then
2866
2867
  if test -z "$2" && test -n "$1"; then
1593
    func_error "Could not determine host file name corresponding to"
2868
    func_error "Could not determine host file name corresponding to"
1594
    func_error "  \`$1'"
2869
    func_error "  '$1'"
1595
    func_error "Continuing, but uninstalled executables may not work."
2870
    func_error "Continuing, but uninstalled executables may not work."
1596
    # Fallback:
2871
    # Fallback:
1597
    func_to_host_file_result="$1"
2872
    func_to_host_file_result=$1
1598
  fi
2873
  fi
1599
}
2874
}
1600
# end func_convert_file_check
2875
# end func_convert_file_check
Lines 1606-1615 Link Here
1606
# func_to_host_file_result to a simplistic fallback value (see below).
2881
# func_to_host_file_result to a simplistic fallback value (see below).
1607
func_convert_path_check ()
2882
func_convert_path_check ()
1608
{
2883
{
1609
  $opt_debug
2884
  $debug_cmd
2885
1610
  if test -z "$4" && test -n "$3"; then
2886
  if test -z "$4" && test -n "$3"; then
1611
    func_error "Could not determine the host path corresponding to"
2887
    func_error "Could not determine the host path corresponding to"
1612
    func_error "  \`$3'"
2888
    func_error "  '$3'"
1613
    func_error "Continuing, but uninstalled executables may not work."
2889
    func_error "Continuing, but uninstalled executables may not work."
1614
    # Fallback.  This is a deliberately simplistic "conversion" and
2890
    # Fallback.  This is a deliberately simplistic "conversion" and
1615
    # should not be "improved".  See libtool.info.
2891
    # should not be "improved".  See libtool.info.
Lines 1618-1624 Link Here
1618
      func_to_host_path_result=`echo "$3" |
2894
      func_to_host_path_result=`echo "$3" |
1619
        $SED -e "$lt_replace_pathsep_chars"`
2895
        $SED -e "$lt_replace_pathsep_chars"`
1620
    else
2896
    else
1621
      func_to_host_path_result="$3"
2897
      func_to_host_path_result=$3
1622
    fi
2898
    fi
1623
  fi
2899
  fi
1624
}
2900
}
Lines 1630-1638 Link Here
1630
# and appending REPL if ORIG matches BACKPAT.
2906
# and appending REPL if ORIG matches BACKPAT.
1631
func_convert_path_front_back_pathsep ()
2907
func_convert_path_front_back_pathsep ()
1632
{
2908
{
1633
  $opt_debug
2909
  $debug_cmd
2910
1634
  case $4 in
2911
  case $4 in
1635
  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
2912
  $1 ) func_to_host_path_result=$3$func_to_host_path_result
1636
    ;;
2913
    ;;
1637
  esac
2914
  esac
1638
  case $4 in
2915
  case $4 in
Lines 1646-1652 Link Here
1646
##################################################
2923
##################################################
1647
# $build to $host FILE NAME CONVERSION FUNCTIONS #
2924
# $build to $host FILE NAME CONVERSION FUNCTIONS #
1648
##################################################
2925
##################################################
1649
# invoked via `$to_host_file_cmd ARG'
2926
# invoked via '$to_host_file_cmd ARG'
1650
#
2927
#
1651
# In each case, ARG is the path to be converted from $build to $host format.
2928
# In each case, ARG is the path to be converted from $build to $host format.
1652
# Result will be available in $func_to_host_file_result.
2929
# Result will be available in $func_to_host_file_result.
Lines 1657-1663 Link Here
1657
# in func_to_host_file_result.
2934
# in func_to_host_file_result.
1658
func_to_host_file ()
2935
func_to_host_file ()
1659
{
2936
{
1660
  $opt_debug
2937
  $debug_cmd
2938
1661
  $to_host_file_cmd "$1"
2939
  $to_host_file_cmd "$1"
1662
}
2940
}
1663
# end func_to_host_file
2941
# end func_to_host_file
Lines 1669-1675 Link Here
1669
# in (the comma separated) LAZY, no conversion takes place.
2947
# in (the comma separated) LAZY, no conversion takes place.
1670
func_to_tool_file ()
2948
func_to_tool_file ()
1671
{
2949
{
1672
  $opt_debug
2950
  $debug_cmd
2951
1673
  case ,$2, in
2952
  case ,$2, in
1674
    *,"$to_tool_file_cmd",*)
2953
    *,"$to_tool_file_cmd",*)
1675
      func_to_tool_file_result=$1
2954
      func_to_tool_file_result=$1
Lines 1687-1693 Link Here
1687
# Copy ARG to func_to_host_file_result.
2966
# Copy ARG to func_to_host_file_result.
1688
func_convert_file_noop ()
2967
func_convert_file_noop ()
1689
{
2968
{
1690
  func_to_host_file_result="$1"
2969
  func_to_host_file_result=$1
1691
}
2970
}
1692
# end func_convert_file_noop
2971
# end func_convert_file_noop
1693
2972
Lines 1698-1708 Link Here
1698
# func_to_host_file_result.
2977
# func_to_host_file_result.
1699
func_convert_file_msys_to_w32 ()
2978
func_convert_file_msys_to_w32 ()
1700
{
2979
{
1701
  $opt_debug
2980
  $debug_cmd
1702
  func_to_host_file_result="$1"
2981
2982
  func_to_host_file_result=$1
1703
  if test -n "$1"; then
2983
  if test -n "$1"; then
1704
    func_convert_core_msys_to_w32 "$1"
2984
    func_convert_core_msys_to_w32 "$1"
1705
    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
2985
    func_to_host_file_result=$func_convert_core_msys_to_w32_result
1706
  fi
2986
  fi
1707
  func_convert_file_check "$1" "$func_to_host_file_result"
2987
  func_convert_file_check "$1" "$func_to_host_file_result"
1708
}
2988
}
Lines 1714-1721 Link Here
1714
# func_to_host_file_result.
2994
# func_to_host_file_result.
1715
func_convert_file_cygwin_to_w32 ()
2995
func_convert_file_cygwin_to_w32 ()
1716
{
2996
{
1717
  $opt_debug
2997
  $debug_cmd
1718
  func_to_host_file_result="$1"
2998
2999
  func_to_host_file_result=$1
1719
  if test -n "$1"; then
3000
  if test -n "$1"; then
1720
    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
3001
    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
1721
    # LT_CYGPATH in this case.
3002
    # LT_CYGPATH in this case.
Lines 1731-1741 Link Here
1731
# and a working winepath. Returns result in func_to_host_file_result.
3012
# and a working winepath. Returns result in func_to_host_file_result.
1732
func_convert_file_nix_to_w32 ()
3013
func_convert_file_nix_to_w32 ()
1733
{
3014
{
1734
  $opt_debug
3015
  $debug_cmd
1735
  func_to_host_file_result="$1"
3016
3017
  func_to_host_file_result=$1
1736
  if test -n "$1"; then
3018
  if test -n "$1"; then
1737
    func_convert_core_file_wine_to_w32 "$1"
3019
    func_convert_core_file_wine_to_w32 "$1"
1738
    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
3020
    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
1739
  fi
3021
  fi
1740
  func_convert_file_check "$1" "$func_to_host_file_result"
3022
  func_convert_file_check "$1" "$func_to_host_file_result"
1741
}
3023
}
Lines 1747-1758 Link Here
1747
# Returns result in func_to_host_file_result.
3029
# Returns result in func_to_host_file_result.
1748
func_convert_file_msys_to_cygwin ()
3030
func_convert_file_msys_to_cygwin ()
1749
{
3031
{
1750
  $opt_debug
3032
  $debug_cmd
1751
  func_to_host_file_result="$1"
3033
3034
  func_to_host_file_result=$1
1752
  if test -n "$1"; then
3035
  if test -n "$1"; then
1753
    func_convert_core_msys_to_w32 "$1"
3036
    func_convert_core_msys_to_w32 "$1"
1754
    func_cygpath -u "$func_convert_core_msys_to_w32_result"
3037
    func_cygpath -u "$func_convert_core_msys_to_w32_result"
1755
    func_to_host_file_result="$func_cygpath_result"
3038
    func_to_host_file_result=$func_cygpath_result
1756
  fi
3039
  fi
1757
  func_convert_file_check "$1" "$func_to_host_file_result"
3040
  func_convert_file_check "$1" "$func_to_host_file_result"
1758
}
3041
}
Lines 1765-1777 Link Here
1765
# in func_to_host_file_result.
3048
# in func_to_host_file_result.
1766
func_convert_file_nix_to_cygwin ()
3049
func_convert_file_nix_to_cygwin ()
1767
{
3050
{
1768
  $opt_debug
3051
  $debug_cmd
1769
  func_to_host_file_result="$1"
3052
3053
  func_to_host_file_result=$1
1770
  if test -n "$1"; then
3054
  if test -n "$1"; then
1771
    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
3055
    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
1772
    func_convert_core_file_wine_to_w32 "$1"
3056
    func_convert_core_file_wine_to_w32 "$1"
1773
    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
3057
    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
1774
    func_to_host_file_result="$func_cygpath_result"
3058
    func_to_host_file_result=$func_cygpath_result
1775
  fi
3059
  fi
1776
  func_convert_file_check "$1" "$func_to_host_file_result"
3060
  func_convert_file_check "$1" "$func_to_host_file_result"
1777
}
3061
}
Lines 1781-1787 Link Here
1781
#############################################
3065
#############################################
1782
# $build to $host PATH CONVERSION FUNCTIONS #
3066
# $build to $host PATH CONVERSION FUNCTIONS #
1783
#############################################
3067
#############################################
1784
# invoked via `$to_host_path_cmd ARG'
3068
# invoked via '$to_host_path_cmd ARG'
1785
#
3069
#
1786
# In each case, ARG is the path to be converted from $build to $host format.
3070
# In each case, ARG is the path to be converted from $build to $host format.
1787
# The result will be available in $func_to_host_path_result.
3071
# The result will be available in $func_to_host_path_result.
Lines 1805-1814 Link Here
1805
to_host_path_cmd=
3089
to_host_path_cmd=
1806
func_init_to_host_path_cmd ()
3090
func_init_to_host_path_cmd ()
1807
{
3091
{
1808
  $opt_debug
3092
  $debug_cmd
3093
1809
  if test -z "$to_host_path_cmd"; then
3094
  if test -z "$to_host_path_cmd"; then
1810
    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
3095
    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
1811
    to_host_path_cmd="func_convert_path_${func_stripname_result}"
3096
    to_host_path_cmd=func_convert_path_$func_stripname_result
1812
  fi
3097
  fi
1813
}
3098
}
1814
3099
Lines 1818-1824 Link Here
1818
# in func_to_host_path_result.
3103
# in func_to_host_path_result.
1819
func_to_host_path ()
3104
func_to_host_path ()
1820
{
3105
{
1821
  $opt_debug
3106
  $debug_cmd
3107
1822
  func_init_to_host_path_cmd
3108
  func_init_to_host_path_cmd
1823
  $to_host_path_cmd "$1"
3109
  $to_host_path_cmd "$1"
1824
}
3110
}
Lines 1829-1835 Link Here
1829
# Copy ARG to func_to_host_path_result.
3115
# Copy ARG to func_to_host_path_result.
1830
func_convert_path_noop ()
3116
func_convert_path_noop ()
1831
{
3117
{
1832
  func_to_host_path_result="$1"
3118
  func_to_host_path_result=$1
1833
}
3119
}
1834
# end func_convert_path_noop
3120
# end func_convert_path_noop
1835
3121
Lines 1840-1847 Link Here
1840
# func_to_host_path_result.
3126
# func_to_host_path_result.
1841
func_convert_path_msys_to_w32 ()
3127
func_convert_path_msys_to_w32 ()
1842
{
3128
{
1843
  $opt_debug
3129
  $debug_cmd
1844
  func_to_host_path_result="$1"
3130
3131
  func_to_host_path_result=$1
1845
  if test -n "$1"; then
3132
  if test -n "$1"; then
1846
    # Remove leading and trailing path separator characters from ARG.  MSYS
3133
    # Remove leading and trailing path separator characters from ARG.  MSYS
1847
    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
3134
    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
Lines 1849-1855 Link Here
1849
    func_stripname : : "$1"
3136
    func_stripname : : "$1"
1850
    func_to_host_path_tmp1=$func_stripname_result
3137
    func_to_host_path_tmp1=$func_stripname_result
1851
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3138
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1852
    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
3139
    func_to_host_path_result=$func_convert_core_msys_to_w32_result
1853
    func_convert_path_check : ";" \
3140
    func_convert_path_check : ";" \
1854
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
3141
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1855
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3142
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
Lines 1863-1870 Link Here
1863
# func_to_host_file_result.
3150
# func_to_host_file_result.
1864
func_convert_path_cygwin_to_w32 ()
3151
func_convert_path_cygwin_to_w32 ()
1865
{
3152
{
1866
  $opt_debug
3153
  $debug_cmd
1867
  func_to_host_path_result="$1"
3154
3155
  func_to_host_path_result=$1
1868
  if test -n "$1"; then
3156
  if test -n "$1"; then
1869
    # See func_convert_path_msys_to_w32:
3157
    # See func_convert_path_msys_to_w32:
1870
    func_stripname : : "$1"
3158
    func_stripname : : "$1"
Lines 1883-1896 Link Here
1883
# a working winepath.  Returns result in func_to_host_file_result.
3171
# a working winepath.  Returns result in func_to_host_file_result.
1884
func_convert_path_nix_to_w32 ()
3172
func_convert_path_nix_to_w32 ()
1885
{
3173
{
1886
  $opt_debug
3174
  $debug_cmd
1887
  func_to_host_path_result="$1"
3175
3176
  func_to_host_path_result=$1
1888
  if test -n "$1"; then
3177
  if test -n "$1"; then
1889
    # See func_convert_path_msys_to_w32:
3178
    # See func_convert_path_msys_to_w32:
1890
    func_stripname : : "$1"
3179
    func_stripname : : "$1"
1891
    func_to_host_path_tmp1=$func_stripname_result
3180
    func_to_host_path_tmp1=$func_stripname_result
1892
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3181
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1893
    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
3182
    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
1894
    func_convert_path_check : ";" \
3183
    func_convert_path_check : ";" \
1895
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
3184
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1896
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
3185
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
Lines 1904-1918 Link Here
1904
# Returns result in func_to_host_file_result.
3193
# Returns result in func_to_host_file_result.
1905
func_convert_path_msys_to_cygwin ()
3194
func_convert_path_msys_to_cygwin ()
1906
{
3195
{
1907
  $opt_debug
3196
  $debug_cmd
1908
  func_to_host_path_result="$1"
3197
3198
  func_to_host_path_result=$1
1909
  if test -n "$1"; then
3199
  if test -n "$1"; then
1910
    # See func_convert_path_msys_to_w32:
3200
    # See func_convert_path_msys_to_w32:
1911
    func_stripname : : "$1"
3201
    func_stripname : : "$1"
1912
    func_to_host_path_tmp1=$func_stripname_result
3202
    func_to_host_path_tmp1=$func_stripname_result
1913
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
3203
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
1914
    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
3204
    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
1915
    func_to_host_path_result="$func_cygpath_result"
3205
    func_to_host_path_result=$func_cygpath_result
1916
    func_convert_path_check : : \
3206
    func_convert_path_check : : \
1917
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
3207
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1918
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
3208
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
Lines 1927-1934 Link Here
1927
# func_to_host_file_result.
3217
# func_to_host_file_result.
1928
func_convert_path_nix_to_cygwin ()
3218
func_convert_path_nix_to_cygwin ()
1929
{
3219
{
1930
  $opt_debug
3220
  $debug_cmd
1931
  func_to_host_path_result="$1"
3221
3222
  func_to_host_path_result=$1
1932
  if test -n "$1"; then
3223
  if test -n "$1"; then
1933
    # Remove leading and trailing path separator characters from
3224
    # Remove leading and trailing path separator characters from
1934
    # ARG. msys behavior is inconsistent here, cygpath turns them
3225
    # ARG. msys behavior is inconsistent here, cygpath turns them
Lines 1937-1943 Link Here
1937
    func_to_host_path_tmp1=$func_stripname_result
3228
    func_to_host_path_tmp1=$func_stripname_result
1938
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
3229
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
1939
    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
3230
    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
1940
    func_to_host_path_result="$func_cygpath_result"
3231
    func_to_host_path_result=$func_cygpath_result
1941
    func_convert_path_check : : \
3232
    func_convert_path_check : : \
1942
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
3233
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
1943
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
3234
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
Lines 1946-1958 Link Here
1946
# end func_convert_path_nix_to_cygwin
3237
# end func_convert_path_nix_to_cygwin
1947
3238
1948
3239
3240
# func_dll_def_p FILE
3241
# True iff FILE is a Windows DLL '.def' file.
3242
# Keep in sync with _LT_DLL_DEF_P in libtool.m4
3243
func_dll_def_p ()
3244
{
3245
  $debug_cmd
3246
3247
  func_dll_def_p_tmp=`$SED -n \
3248
    -e 's/^[	 ]*//' \
3249
    -e '/^\(;.*\)*$/d' \
3250
    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
3251
    -e q \
3252
    "$1"`
3253
  test DEF = "$func_dll_def_p_tmp"
3254
}
3255
3256
1949
# func_mode_compile arg...
3257
# func_mode_compile arg...
1950
func_mode_compile ()
3258
func_mode_compile ()
1951
{
3259
{
1952
    $opt_debug
3260
    $debug_cmd
3261
1953
    # Get the compilation command and the source file.
3262
    # Get the compilation command and the source file.
1954
    base_compile=
3263
    base_compile=
1955
    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
3264
    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
1956
    suppress_opt=yes
3265
    suppress_opt=yes
1957
    suppress_output=
3266
    suppress_output=
1958
    arg_mode=normal
3267
    arg_mode=normal
Lines 1965-1976 Link Here
1965
      case $arg_mode in
3274
      case $arg_mode in
1966
      arg  )
3275
      arg  )
1967
	# do not "continue".  Instead, add this to base_compile
3276
	# do not "continue".  Instead, add this to base_compile
1968
	lastarg="$arg"
3277
	lastarg=$arg
1969
	arg_mode=normal
3278
	arg_mode=normal
1970
	;;
3279
	;;
1971
3280
1972
      target )
3281
      target )
1973
	libobj="$arg"
3282
	libobj=$arg
1974
	arg_mode=normal
3283
	arg_mode=normal
1975
	continue
3284
	continue
1976
	;;
3285
	;;
Lines 1980-1986 Link Here
1980
	case $arg in
3289
	case $arg in
1981
	-o)
3290
	-o)
1982
	  test -n "$libobj" && \
3291
	  test -n "$libobj" && \
1983
	    func_fatal_error "you cannot specify \`-o' more than once"
3292
	    func_fatal_error "you cannot specify '-o' more than once"
1984
	  arg_mode=target
3293
	  arg_mode=target
1985
	  continue
3294
	  continue
1986
	  ;;
3295
	  ;;
Lines 2009-2020 Link Here
2009
	  func_stripname '-Wc,' '' "$arg"
3318
	  func_stripname '-Wc,' '' "$arg"
2010
	  args=$func_stripname_result
3319
	  args=$func_stripname_result
2011
	  lastarg=
3320
	  lastarg=
2012
	  save_ifs="$IFS"; IFS=','
3321
	  save_ifs=$IFS; IFS=,
2013
	  for arg in $args; do
3322
	  for arg in $args; do
2014
	    IFS="$save_ifs"
3323
	    IFS=$save_ifs
2015
	    func_append_quoted lastarg "$arg"
3324
	    func_append_quoted lastarg "$arg"
2016
	  done
3325
	  done
2017
	  IFS="$save_ifs"
3326
	  IFS=$save_ifs
2018
	  func_stripname ' ' '' "$lastarg"
3327
	  func_stripname ' ' '' "$lastarg"
2019
	  lastarg=$func_stripname_result
3328
	  lastarg=$func_stripname_result
2020
3329
Lines 2027-2034 Link Here
2027
	  # Accept the current argument as the source file.
3336
	  # Accept the current argument as the source file.
2028
	  # The previous "srcfile" becomes the current argument.
3337
	  # The previous "srcfile" becomes the current argument.
2029
	  #
3338
	  #
2030
	  lastarg="$srcfile"
3339
	  lastarg=$srcfile
2031
	  srcfile="$arg"
3340
	  srcfile=$arg
2032
	  ;;
3341
	  ;;
2033
	esac  #  case $arg
3342
	esac  #  case $arg
2034
	;;
3343
	;;
Lines 2043-2055 Link Here
2043
      func_fatal_error "you must specify an argument for -Xcompile"
3352
      func_fatal_error "you must specify an argument for -Xcompile"
2044
      ;;
3353
      ;;
2045
    target)
3354
    target)
2046
      func_fatal_error "you must specify a target with \`-o'"
3355
      func_fatal_error "you must specify a target with '-o'"
2047
      ;;
3356
      ;;
2048
    *)
3357
    *)
2049
      # Get the name of the library object.
3358
      # Get the name of the library object.
2050
      test -z "$libobj" && {
3359
      test -z "$libobj" && {
2051
	func_basename "$srcfile"
3360
	func_basename "$srcfile"
2052
	libobj="$func_basename_result"
3361
	libobj=$func_basename_result
2053
      }
3362
      }
2054
      ;;
3363
      ;;
2055
    esac
3364
    esac
Lines 2069-2075 Link Here
2069
    case $libobj in
3378
    case $libobj in
2070
    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
3379
    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2071
    *)
3380
    *)
2072
      func_fatal_error "cannot determine name of library object from \`$libobj'"
3381
      func_fatal_error "cannot determine name of library object from '$libobj'"
2073
      ;;
3382
      ;;
2074
    esac
3383
    esac
2075
3384
Lines 2078-2085 Link Here
2078
    for arg in $later; do
3387
    for arg in $later; do
2079
      case $arg in
3388
      case $arg in
2080
      -shared)
3389
      -shared)
2081
	test "$build_libtool_libs" != yes && \
3390
	test yes = "$build_libtool_libs" \
2082
	  func_fatal_configuration "can not build a shared library"
3391
	  || func_fatal_configuration "cannot build a shared library"
2083
	build_old_libs=no
3392
	build_old_libs=no
2084
	continue
3393
	continue
2085
	;;
3394
	;;
Lines 2105-2121 Link Here
2105
    func_quote_for_eval "$libobj"
3414
    func_quote_for_eval "$libobj"
2106
    test "X$libobj" != "X$func_quote_for_eval_result" \
3415
    test "X$libobj" != "X$func_quote_for_eval_result" \
2107
      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
3416
      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
2108
      && func_warning "libobj name \`$libobj' may not contain shell special characters."
3417
      && func_warning "libobj name '$libobj' may not contain shell special characters."
2109
    func_dirname_and_basename "$obj" "/" ""
3418
    func_dirname_and_basename "$obj" "/" ""
2110
    objname="$func_basename_result"
3419
    objname=$func_basename_result
2111
    xdir="$func_dirname_result"
3420
    xdir=$func_dirname_result
2112
    lobj=${xdir}$objdir/$objname
3421
    lobj=$xdir$objdir/$objname
2113
3422
2114
    test -z "$base_compile" && \
3423
    test -z "$base_compile" && \
2115
      func_fatal_help "you must specify a compilation command"
3424
      func_fatal_help "you must specify a compilation command"
2116
3425
2117
    # Delete any leftover library objects.
3426
    # Delete any leftover library objects.
2118
    if test "$build_old_libs" = yes; then
3427
    if test yes = "$build_old_libs"; then
2119
      removelist="$obj $lobj $libobj ${libobj}T"
3428
      removelist="$obj $lobj $libobj ${libobj}T"
2120
    else
3429
    else
2121
      removelist="$lobj $libobj ${libobj}T"
3430
      removelist="$lobj $libobj ${libobj}T"
Lines 2127-2142 Link Here
2127
      pic_mode=default
3436
      pic_mode=default
2128
      ;;
3437
      ;;
2129
    esac
3438
    esac
2130
    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
3439
    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
2131
      # non-PIC code in shared libraries is not supported
3440
      # non-PIC code in shared libraries is not supported
2132
      pic_mode=default
3441
      pic_mode=default
2133
    fi
3442
    fi
2134
3443
2135
    # Calculate the filename of the output object if compiler does
3444
    # Calculate the filename of the output object if compiler does
2136
    # not support -o with -c
3445
    # not support -o with -c
2137
    if test "$compiler_c_o" = no; then
3446
    if test no = "$compiler_c_o"; then
2138
      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
3447
      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
2139
      lockfile="$output_obj.lock"
3448
      lockfile=$output_obj.lock
2140
    else
3449
    else
2141
      output_obj=
3450
      output_obj=
2142
      need_locks=no
3451
      need_locks=no
Lines 2145-2156 Link Here
2145
3454
2146
    # Lock this critical section if it is needed
3455
    # Lock this critical section if it is needed
2147
    # We use this script file to make the link, it avoids creating a new file
3456
    # We use this script file to make the link, it avoids creating a new file
2148
    if test "$need_locks" = yes; then
3457
    if test yes = "$need_locks"; then
2149
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3458
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2150
	func_echo "Waiting for $lockfile to be removed"
3459
	func_echo "Waiting for $lockfile to be removed"
2151
	sleep 2
3460
	sleep 2
2152
      done
3461
      done
2153
    elif test "$need_locks" = warn; then
3462
    elif test warn = "$need_locks"; then
2154
      if test -f "$lockfile"; then
3463
      if test -f "$lockfile"; then
2155
	$ECHO "\
3464
	$ECHO "\
2156
*** ERROR, $lockfile exists and contains:
3465
*** ERROR, $lockfile exists and contains:
Lines 2158-2164 Link Here
2158
3467
2159
This indicates that another process is trying to use the same
3468
This indicates that another process is trying to use the same
2160
temporary object file, and libtool could not work around it because
3469
temporary object file, and libtool could not work around it because
2161
your compiler does not support \`-c' and \`-o' together.  If you
3470
your compiler does not support '-c' and '-o' together.  If you
2162
repeat this compilation, it may succeed, by chance, but you had better
3471
repeat this compilation, it may succeed, by chance, but you had better
2163
avoid parallel builds (make -j) in this platform, or get a better
3472
avoid parallel builds (make -j) in this platform, or get a better
2164
compiler."
3473
compiler."
Lines 2180-2190 Link Here
2180
    qsrcfile=$func_quote_for_eval_result
3489
    qsrcfile=$func_quote_for_eval_result
2181
3490
2182
    # Only build a PIC object if we are building libtool libraries.
3491
    # Only build a PIC object if we are building libtool libraries.
2183
    if test "$build_libtool_libs" = yes; then
3492
    if test yes = "$build_libtool_libs"; then
2184
      # Without this assignment, base_compile gets emptied.
3493
      # Without this assignment, base_compile gets emptied.
2185
      fbsd_hideous_sh_bug=$base_compile
3494
      fbsd_hideous_sh_bug=$base_compile
2186
3495
2187
      if test "$pic_mode" != no; then
3496
      if test no != "$pic_mode"; then
2188
	command="$base_compile $qsrcfile $pic_flag"
3497
	command="$base_compile $qsrcfile $pic_flag"
2189
      else
3498
      else
2190
	# Don't build PIC code
3499
	# Don't build PIC code
Lines 2201-2207 Link Here
2201
      func_show_eval_locale "$command"	\
3510
      func_show_eval_locale "$command"	\
2202
          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
3511
          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2203
3512
2204
      if test "$need_locks" = warn &&
3513
      if test warn = "$need_locks" &&
2205
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
3514
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2206
	$ECHO "\
3515
	$ECHO "\
2207
*** ERROR, $lockfile contains:
3516
*** ERROR, $lockfile contains:
Lines 2212-2218 Link Here
2212
3521
2213
This indicates that another process is trying to use the same
3522
This indicates that another process is trying to use the same
2214
temporary object file, and libtool could not work around it because
3523
temporary object file, and libtool could not work around it because
2215
your compiler does not support \`-c' and \`-o' together.  If you
3524
your compiler does not support '-c' and '-o' together.  If you
2216
repeat this compilation, it may succeed, by chance, but you had better
3525
repeat this compilation, it may succeed, by chance, but you had better
2217
avoid parallel builds (make -j) in this platform, or get a better
3526
avoid parallel builds (make -j) in this platform, or get a better
2218
compiler."
3527
compiler."
Lines 2228-2247 Link Here
2228
      fi
3537
      fi
2229
3538
2230
      # Allow error messages only from the first compilation.
3539
      # Allow error messages only from the first compilation.
2231
      if test "$suppress_opt" = yes; then
3540
      if test yes = "$suppress_opt"; then
2232
	suppress_output=' >/dev/null 2>&1'
3541
	suppress_output=' >/dev/null 2>&1'
2233
      fi
3542
      fi
2234
    fi
3543
    fi
2235
3544
2236
    # Only build a position-dependent object if we build old libraries.
3545
    # Only build a position-dependent object if we build old libraries.
2237
    if test "$build_old_libs" = yes; then
3546
    if test yes = "$build_old_libs"; then
2238
      if test "$pic_mode" != yes; then
3547
      if test yes != "$pic_mode"; then
2239
	# Don't build PIC code
3548
	# Don't build PIC code
2240
	command="$base_compile $qsrcfile$pie_flag"
3549
	command="$base_compile $qsrcfile$pie_flag"
2241
      else
3550
      else
2242
	command="$base_compile $qsrcfile $pic_flag"
3551
	command="$base_compile $qsrcfile $pic_flag"
2243
      fi
3552
      fi
2244
      if test "$compiler_c_o" = yes; then
3553
      if test yes = "$compiler_c_o"; then
2245
	func_append command " -o $obj"
3554
	func_append command " -o $obj"
2246
      fi
3555
      fi
2247
3556
Lines 2250-2256 Link Here
2250
      func_show_eval_locale "$command" \
3559
      func_show_eval_locale "$command" \
2251
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
3560
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2252
3561
2253
      if test "$need_locks" = warn &&
3562
      if test warn = "$need_locks" &&
2254
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
3563
	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2255
	$ECHO "\
3564
	$ECHO "\
2256
*** ERROR, $lockfile contains:
3565
*** ERROR, $lockfile contains:
Lines 2261-2267 Link Here
2261
3570
2262
This indicates that another process is trying to use the same
3571
This indicates that another process is trying to use the same
2263
temporary object file, and libtool could not work around it because
3572
temporary object file, and libtool could not work around it because
2264
your compiler does not support \`-c' and \`-o' together.  If you
3573
your compiler does not support '-c' and '-o' together.  If you
2265
repeat this compilation, it may succeed, by chance, but you had better
3574
repeat this compilation, it may succeed, by chance, but you had better
2266
avoid parallel builds (make -j) in this platform, or get a better
3575
avoid parallel builds (make -j) in this platform, or get a better
2267
compiler."
3576
compiler."
Lines 2281-2287 Link Here
2281
      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
3590
      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2282
3591
2283
      # Unlock the critical section if it was locked
3592
      # Unlock the critical section if it was locked
2284
      if test "$need_locks" != no; then
3593
      if test no != "$need_locks"; then
2285
	removelist=$lockfile
3594
	removelist=$lockfile
2286
        $RM "$lockfile"
3595
        $RM "$lockfile"
2287
      fi
3596
      fi
Lines 2291-2297 Link Here
2291
}
3600
}
2292
3601
2293
$opt_help || {
3602
$opt_help || {
2294
  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
3603
  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
2295
}
3604
}
2296
3605
2297
func_mode_help ()
3606
func_mode_help ()
Lines 2311-2317 Link Here
2311
Remove files from the build directory.
3620
Remove files from the build directory.
2312
3621
2313
RM is the name of the program to use to delete files associated with each FILE
3622
RM is the name of the program to use to delete files associated with each FILE
2314
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
3623
(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
2315
to RM.
3624
to RM.
2316
3625
2317
If FILE is a libtool library, object or program, all the files associated
3626
If FILE is a libtool library, object or program, all the files associated
Lines 2330-2345 Link Here
2330
  -no-suppress      do not suppress compiler output for multiple passes
3639
  -no-suppress      do not suppress compiler output for multiple passes
2331
  -prefer-pic       try to build PIC objects only
3640
  -prefer-pic       try to build PIC objects only
2332
  -prefer-non-pic   try to build non-PIC objects only
3641
  -prefer-non-pic   try to build non-PIC objects only
2333
  -shared           do not build a \`.o' file suitable for static linking
3642
  -shared           do not build a '.o' file suitable for static linking
2334
  -static           only build a \`.o' file suitable for static linking
3643
  -static           only build a '.o' file suitable for static linking
2335
  -Wc,FLAG          pass FLAG directly to the compiler
3644
  -Wc,FLAG          pass FLAG directly to the compiler
2336
3645
2337
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
3646
COMPILE-COMMAND is a command to be used in creating a 'standard' object file
2338
from the given SOURCEFILE.
3647
from the given SOURCEFILE.
2339
3648
2340
The output file name is determined by removing the directory component from
3649
The output file name is determined by removing the directory component from
2341
SOURCEFILE, then substituting the C source code suffix \`.c' with the
3650
SOURCEFILE, then substituting the C source code suffix '.c' with the
2342
library object suffix, \`.lo'."
3651
library object suffix, '.lo'."
2343
        ;;
3652
        ;;
2344
3653
2345
      execute)
3654
      execute)
Lines 2352-2358 Link Here
2352
3661
2353
  -dlopen FILE      add the directory containing FILE to the library path
3662
  -dlopen FILE      add the directory containing FILE to the library path
2354
3663
2355
This mode sets the library path environment variable according to \`-dlopen'
3664
This mode sets the library path environment variable according to '-dlopen'
2356
flags.
3665
flags.
2357
3666
2358
If any of the ARGS are libtool executable wrappers, then they are translated
3667
If any of the ARGS are libtool executable wrappers, then they are translated
Lines 2371-2377 Link Here
2371
Each LIBDIR is a directory that contains libtool libraries.
3680
Each LIBDIR is a directory that contains libtool libraries.
2372
3681
2373
The commands that this mode executes may require superuser privileges.  Use
3682
The commands that this mode executes may require superuser privileges.  Use
2374
the \`--dry-run' option if you just want to see what would be executed."
3683
the '--dry-run' option if you just want to see what would be executed."
2375
        ;;
3684
        ;;
2376
3685
2377
      install)
3686
      install)
Lines 2381-2387 Link Here
2381
Install executables or libraries.
3690
Install executables or libraries.
2382
3691
2383
INSTALL-COMMAND is the installation command.  The first component should be
3692
INSTALL-COMMAND is the installation command.  The first component should be
2384
either the \`install' or \`cp' program.
3693
either the 'install' or 'cp' program.
2385
3694
2386
The following components of INSTALL-COMMAND are treated specially:
3695
The following components of INSTALL-COMMAND are treated specially:
2387
3696
Lines 2407-2413 Link Here
2407
  -avoid-version    do not add a version suffix if possible
3716
  -avoid-version    do not add a version suffix if possible
2408
  -bindir BINDIR    specify path to binaries directory (for systems where
3717
  -bindir BINDIR    specify path to binaries directory (for systems where
2409
                    libraries must be found in the PATH setting at runtime)
3718
                    libraries must be found in the PATH setting at runtime)
2410
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
3719
  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
2411
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
3720
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
2412
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
3721
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2413
  -export-symbols SYMFILE
3722
  -export-symbols SYMFILE
Lines 2441-2460 Link Here
2441
  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
3750
  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
2442
  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
3751
  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
2443
3752
2444
All other options (arguments beginning with \`-') are ignored.
3753
All other options (arguments beginning with '-') are ignored.
2445
3754
2446
Every other argument is treated as a filename.  Files ending in \`.la' are
3755
Every other argument is treated as a filename.  Files ending in '.la' are
2447
treated as uninstalled libtool libraries, other files are standard or library
3756
treated as uninstalled libtool libraries, other files are standard or library
2448
object files.
3757
object files.
2449
3758
2450
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
3759
If the OUTPUT-FILE ends in '.la', then a libtool library is created,
2451
only library objects (\`.lo' files) may be specified, and \`-rpath' is
3760
only library objects ('.lo' files) may be specified, and '-rpath' is
2452
required, except when creating a convenience library.
3761
required, except when creating a convenience library.
2453
3762
2454
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
3763
If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
2455
using \`ar' and \`ranlib', or on Windows using \`lib'.
3764
using 'ar' and 'ranlib', or on Windows using 'lib'.
2456
3765
2457
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
3766
If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
2458
is created, otherwise an executable program is created."
3767
is created, otherwise an executable program is created."
2459
        ;;
3768
        ;;
2460
3769
Lines 2465-2471 Link Here
2465
Remove libraries from an installation directory.
3774
Remove libraries from an installation directory.
2466
3775
2467
RM is the name of the program to use to delete files associated with each FILE
3776
RM is the name of the program to use to delete files associated with each FILE
2468
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
3777
(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
2469
to RM.
3778
to RM.
2470
3779
2471
If FILE is a libtool library, all the files associated with it are deleted.
3780
If FILE is a libtool library, all the files associated with it are deleted.
Lines 2473-2489 Link Here
2473
        ;;
3782
        ;;
2474
3783
2475
      *)
3784
      *)
2476
        func_fatal_help "invalid operation mode \`$opt_mode'"
3785
        func_fatal_help "invalid operation mode '$opt_mode'"
2477
        ;;
3786
        ;;
2478
    esac
3787
    esac
2479
3788
2480
    echo
3789
    echo
2481
    $ECHO "Try \`$progname --help' for more information about other modes."
3790
    $ECHO "Try '$progname --help' for more information about other modes."
2482
}
3791
}
2483
3792
2484
# Now that we've collected a possible --mode arg, show help if necessary
3793
# Now that we've collected a possible --mode arg, show help if necessary
2485
if $opt_help; then
3794
if $opt_help; then
2486
  if test "$opt_help" = :; then
3795
  if test : = "$opt_help"; then
2487
    func_mode_help
3796
    func_mode_help
2488
  else
3797
  else
2489
    {
3798
    {
Lines 2491-2497 Link Here
2491
      for opt_mode in compile link execute install finish uninstall clean; do
3800
      for opt_mode in compile link execute install finish uninstall clean; do
2492
	func_mode_help
3801
	func_mode_help
2493
      done
3802
      done
2494
    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
3803
    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
2495
    {
3804
    {
2496
      func_help noexit
3805
      func_help noexit
2497
      for opt_mode in compile link execute install finish uninstall clean; do
3806
      for opt_mode in compile link execute install finish uninstall clean; do
Lines 2499-2505 Link Here
2499
	func_mode_help
3808
	func_mode_help
2500
      done
3809
      done
2501
    } |
3810
    } |
2502
    sed '1d
3811
    $SED '1d
2503
      /^When reporting/,/^Report/{
3812
      /^When reporting/,/^Report/{
2504
	H
3813
	H
2505
	d
3814
	d
Lines 2516-2531 Link Here
2516
# func_mode_execute arg...
3825
# func_mode_execute arg...
2517
func_mode_execute ()
3826
func_mode_execute ()
2518
{
3827
{
2519
    $opt_debug
3828
    $debug_cmd
3829
2520
    # The first argument is the command name.
3830
    # The first argument is the command name.
2521
    cmd="$nonopt"
3831
    cmd=$nonopt
2522
    test -z "$cmd" && \
3832
    test -z "$cmd" && \
2523
      func_fatal_help "you must specify a COMMAND"
3833
      func_fatal_help "you must specify a COMMAND"
2524
3834
2525
    # Handle -dlopen flags immediately.
3835
    # Handle -dlopen flags immediately.
2526
    for file in $opt_dlopen; do
3836
    for file in $opt_dlopen; do
2527
      test -f "$file" \
3837
      test -f "$file" \
2528
	|| func_fatal_help "\`$file' is not a file"
3838
	|| func_fatal_help "'$file' is not a file"
2529
3839
2530
      dir=
3840
      dir=
2531
      case $file in
3841
      case $file in
Lines 2535-2541 Link Here
2535
3845
2536
	# Check to see that this really is a libtool archive.
3846
	# Check to see that this really is a libtool archive.
2537
	func_lalib_unsafe_p "$file" \
3847
	func_lalib_unsafe_p "$file" \
2538
	  || func_fatal_help "\`$lib' is not a valid libtool archive"
3848
	  || func_fatal_help "'$lib' is not a valid libtool archive"
2539
3849
2540
	# Read the libtool library.
3850
	# Read the libtool library.
2541
	dlname=
3851
	dlname=
Lines 2546-2563 Link Here
2546
	if test -z "$dlname"; then
3856
	if test -z "$dlname"; then
2547
	  # Warn if it was a shared library.
3857
	  # Warn if it was a shared library.
2548
	  test -n "$library_names" && \
3858
	  test -n "$library_names" && \
2549
	    func_warning "\`$file' was not linked with \`-export-dynamic'"
3859
	    func_warning "'$file' was not linked with '-export-dynamic'"
2550
	  continue
3860
	  continue
2551
	fi
3861
	fi
2552
3862
2553
	func_dirname "$file" "" "."
3863
	func_dirname "$file" "" "."
2554
	dir="$func_dirname_result"
3864
	dir=$func_dirname_result
2555
3865
2556
	if test -f "$dir/$objdir/$dlname"; then
3866
	if test -f "$dir/$objdir/$dlname"; then
2557
	  func_append dir "/$objdir"
3867
	  func_append dir "/$objdir"
2558
	else
3868
	else
2559
	  if test ! -f "$dir/$dlname"; then
3869
	  if test ! -f "$dir/$dlname"; then
2560
	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
3870
	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
2561
	  fi
3871
	  fi
2562
	fi
3872
	fi
2563
	;;
3873
	;;
Lines 2565-2582 Link Here
2565
      *.lo)
3875
      *.lo)
2566
	# Just add the directory containing the .lo file.
3876
	# Just add the directory containing the .lo file.
2567
	func_dirname "$file" "" "."
3877
	func_dirname "$file" "" "."
2568
	dir="$func_dirname_result"
3878
	dir=$func_dirname_result
2569
	;;
3879
	;;
2570
3880
2571
      *)
3881
      *)
2572
	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
3882
	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
2573
	continue
3883
	continue
2574
	;;
3884
	;;
2575
      esac
3885
      esac
2576
3886
2577
      # Get the absolute pathname.
3887
      # Get the absolute pathname.
2578
      absdir=`cd "$dir" && pwd`
3888
      absdir=`cd "$dir" && pwd`
2579
      test -n "$absdir" && dir="$absdir"
3889
      test -n "$absdir" && dir=$absdir
2580
3890
2581
      # Now add the directory to shlibpath_var.
3891
      # Now add the directory to shlibpath_var.
2582
      if eval "test -z \"\$$shlibpath_var\""; then
3892
      if eval "test -z \"\$$shlibpath_var\""; then
Lines 2588-2594 Link Here
2588
3898
2589
    # This variable tells wrapper scripts just to set shlibpath_var
3899
    # This variable tells wrapper scripts just to set shlibpath_var
2590
    # rather than running their programs.
3900
    # rather than running their programs.
2591
    libtool_execute_magic="$magic"
3901
    libtool_execute_magic=$magic
2592
3902
2593
    # Check if any of the arguments is a wrapper script.
3903
    # Check if any of the arguments is a wrapper script.
2594
    args=
3904
    args=
Lines 2601-2612 Link Here
2601
	if func_ltwrapper_script_p "$file"; then
3911
	if func_ltwrapper_script_p "$file"; then
2602
	  func_source "$file"
3912
	  func_source "$file"
2603
	  # Transform arg to wrapped name.
3913
	  # Transform arg to wrapped name.
2604
	  file="$progdir/$program"
3914
	  file=$progdir/$program
2605
	elif func_ltwrapper_executable_p "$file"; then
3915
	elif func_ltwrapper_executable_p "$file"; then
2606
	  func_ltwrapper_scriptname "$file"
3916
	  func_ltwrapper_scriptname "$file"
2607
	  func_source "$func_ltwrapper_scriptname_result"
3917
	  func_source "$func_ltwrapper_scriptname_result"
2608
	  # Transform arg to wrapped name.
3918
	  # Transform arg to wrapped name.
2609
	  file="$progdir/$program"
3919
	  file=$progdir/$program
2610
	fi
3920
	fi
2611
	;;
3921
	;;
2612
      esac
3922
      esac
Lines 2614-2620 Link Here
2614
      func_append_quoted args "$file"
3924
      func_append_quoted args "$file"
2615
    done
3925
    done
2616
3926
2617
    if test "X$opt_dry_run" = Xfalse; then
3927
    if $opt_dry_run; then
3928
      # Display what would be done.
3929
      if test -n "$shlibpath_var"; then
3930
	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3931
	echo "export $shlibpath_var"
3932
      fi
3933
      $ECHO "$cmd$args"
3934
      exit $EXIT_SUCCESS
3935
    else
2618
      if test -n "$shlibpath_var"; then
3936
      if test -n "$shlibpath_var"; then
2619
	# Export the shlibpath_var.
3937
	# Export the shlibpath_var.
2620
	eval "export $shlibpath_var"
3938
	eval "export $shlibpath_var"
Lines 2631-2655 Link Here
2631
      done
3949
      done
2632
3950
2633
      # Now prepare to actually exec the command.
3951
      # Now prepare to actually exec the command.
2634
      exec_cmd="\$cmd$args"
3952
      exec_cmd=\$cmd$args
2635
    else
2636
      # Display what would be done.
2637
      if test -n "$shlibpath_var"; then
2638
	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
2639
	echo "export $shlibpath_var"
2640
      fi
2641
      $ECHO "$cmd$args"
2642
      exit $EXIT_SUCCESS
2643
    fi
3953
    fi
2644
}
3954
}
2645
3955
2646
test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
3956
test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
2647
3957
2648
3958
2649
# func_mode_finish arg...
3959
# func_mode_finish arg...
2650
func_mode_finish ()
3960
func_mode_finish ()
2651
{
3961
{
2652
    $opt_debug
3962
    $debug_cmd
3963
2653
    libs=
3964
    libs=
2654
    libdirs=
3965
    libdirs=
2655
    admincmds=
3966
    admincmds=
Lines 2663-2673 Link Here
2663
	if func_lalib_unsafe_p "$opt"; then
3974
	if func_lalib_unsafe_p "$opt"; then
2664
	  func_append libs " $opt"
3975
	  func_append libs " $opt"
2665
	else
3976
	else
2666
	  func_warning "\`$opt' is not a valid libtool archive"
3977
	  func_warning "'$opt' is not a valid libtool archive"
2667
	fi
3978
	fi
2668
3979
2669
      else
3980
      else
2670
	func_fatal_error "invalid argument \`$opt'"
3981
	func_fatal_error "invalid argument '$opt'"
2671
      fi
3982
      fi
2672
    done
3983
    done
2673
3984
Lines 2682-2693 Link Here
2682
      # Remove sysroot references
3993
      # Remove sysroot references
2683
      if $opt_dry_run; then
3994
      if $opt_dry_run; then
2684
        for lib in $libs; do
3995
        for lib in $libs; do
2685
          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
3996
          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
2686
        done
3997
        done
2687
      else
3998
      else
2688
        tmpdir=`func_mktempdir`
3999
        tmpdir=`func_mktempdir`
2689
        for lib in $libs; do
4000
        for lib in $libs; do
2690
	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
4001
	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
2691
	    > $tmpdir/tmp-la
4002
	    > $tmpdir/tmp-la
2692
	  mv -f $tmpdir/tmp-la $lib
4003
	  mv -f $tmpdir/tmp-la $lib
2693
	done
4004
	done
Lines 2712-2718 Link Here
2712
    fi
4023
    fi
2713
4024
2714
    # Exit here if they wanted silent mode.
4025
    # Exit here if they wanted silent mode.
2715
    $opt_silent && exit $EXIT_SUCCESS
4026
    $opt_quiet && exit $EXIT_SUCCESS
2716
4027
2717
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4028
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
2718
      echo "----------------------------------------------------------------------"
4029
      echo "----------------------------------------------------------------------"
Lines 2723-2749 Link Here
2723
      echo
4034
      echo
2724
      echo "If you ever happen to want to link against installed libraries"
4035
      echo "If you ever happen to want to link against installed libraries"
2725
      echo "in a given directory, LIBDIR, you must either use libtool, and"
4036
      echo "in a given directory, LIBDIR, you must either use libtool, and"
2726
      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
4037
      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
2727
      echo "flag during linking and do at least one of the following:"
4038
      echo "flag during linking and do at least one of the following:"
2728
      if test -n "$shlibpath_var"; then
4039
      if test -n "$shlibpath_var"; then
2729
	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
4040
	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
2730
	echo "     during execution"
4041
	echo "     during execution"
2731
      fi
4042
      fi
2732
      if test -n "$runpath_var"; then
4043
      if test -n "$runpath_var"; then
2733
	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
4044
	echo "   - add LIBDIR to the '$runpath_var' environment variable"
2734
	echo "     during linking"
4045
	echo "     during linking"
2735
      fi
4046
      fi
2736
      if test -n "$hardcode_libdir_flag_spec"; then
4047
      if test -n "$hardcode_libdir_flag_spec"; then
2737
	libdir=LIBDIR
4048
	libdir=LIBDIR
2738
	eval flag=\"$hardcode_libdir_flag_spec\"
4049
	eval flag=\"$hardcode_libdir_flag_spec\"
2739
4050
2740
	$ECHO "   - use the \`$flag' linker flag"
4051
	$ECHO "   - use the '$flag' linker flag"
2741
      fi
4052
      fi
2742
      if test -n "$admincmds"; then
4053
      if test -n "$admincmds"; then
2743
	$ECHO "   - have your system administrator run these commands:$admincmds"
4054
	$ECHO "   - have your system administrator run these commands:$admincmds"
2744
      fi
4055
      fi
2745
      if test -f /etc/ld.so.conf; then
4056
      if test -f /etc/ld.so.conf; then
2746
	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4057
	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
2747
      fi
4058
      fi
2748
      echo
4059
      echo
2749
4060
Lines 2762-2779 Link Here
2762
    exit $EXIT_SUCCESS
4073
    exit $EXIT_SUCCESS
2763
}
4074
}
2764
4075
2765
test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
4076
test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
2766
4077
2767
4078
2768
# func_mode_install arg...
4079
# func_mode_install arg...
2769
func_mode_install ()
4080
func_mode_install ()
2770
{
4081
{
2771
    $opt_debug
4082
    $debug_cmd
4083
2772
    # There may be an optional sh(1) argument at the beginning of
4084
    # There may be an optional sh(1) argument at the beginning of
2773
    # install_prog (especially on Windows NT).
4085
    # install_prog (especially on Windows NT).
2774
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
4086
    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
2775
       # Allow the use of GNU shtool's install command.
4087
       # Allow the use of GNU shtool's install command.
2776
       case $nonopt in *shtool*) :;; *) false;; esac; then
4088
       case $nonopt in *shtool*) :;; *) false;; esac
4089
    then
2777
      # Aesthetically quote it.
4090
      # Aesthetically quote it.
2778
      func_quote_for_eval "$nonopt"
4091
      func_quote_for_eval "$nonopt"
2779
      install_prog="$func_quote_for_eval_result "
4092
      install_prog="$func_quote_for_eval_result "
Lines 2800-2806 Link Here
2800
    opts=
4113
    opts=
2801
    prev=
4114
    prev=
2802
    install_type=
4115
    install_type=
2803
    isdir=no
4116
    isdir=false
2804
    stripme=
4117
    stripme=
2805
    no_mode=:
4118
    no_mode=:
2806
    for arg
4119
    for arg
Lines 2813-2819 Link Here
2813
      fi
4126
      fi
2814
4127
2815
      case $arg in
4128
      case $arg in
2816
      -d) isdir=yes ;;
4129
      -d) isdir=: ;;
2817
      -f)
4130
      -f)
2818
	if $install_cp; then :; else
4131
	if $install_cp; then :; else
2819
	  prev=$arg
4132
	  prev=$arg
Lines 2831-2837 Link Here
2831
      *)
4144
      *)
2832
	# If the previous option needed an argument, then skip it.
4145
	# If the previous option needed an argument, then skip it.
2833
	if test -n "$prev"; then
4146
	if test -n "$prev"; then
2834
	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
4147
	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
2835
	    arg2=$install_override_mode
4148
	    arg2=$install_override_mode
2836
	    no_mode=false
4149
	    no_mode=false
2837
	  fi
4150
	  fi
Lines 2856-2862 Link Here
2856
      func_fatal_help "you must specify an install program"
4169
      func_fatal_help "you must specify an install program"
2857
4170
2858
    test -n "$prev" && \
4171
    test -n "$prev" && \
2859
      func_fatal_help "the \`$prev' option requires an argument"
4172
      func_fatal_help "the '$prev' option requires an argument"
2860
4173
2861
    if test -n "$install_override_mode" && $no_mode; then
4174
    if test -n "$install_override_mode" && $no_mode; then
2862
      if $install_cp; then :; else
4175
      if $install_cp; then :; else
Lines 2878-2896 Link Here
2878
    dest=$func_stripname_result
4191
    dest=$func_stripname_result
2879
4192
2880
    # Check to see that the destination is a directory.
4193
    # Check to see that the destination is a directory.
2881
    test -d "$dest" && isdir=yes
4194
    test -d "$dest" && isdir=:
2882
    if test "$isdir" = yes; then
4195
    if $isdir; then
2883
      destdir="$dest"
4196
      destdir=$dest
2884
      destname=
4197
      destname=
2885
    else
4198
    else
2886
      func_dirname_and_basename "$dest" "" "."
4199
      func_dirname_and_basename "$dest" "" "."
2887
      destdir="$func_dirname_result"
4200
      destdir=$func_dirname_result
2888
      destname="$func_basename_result"
4201
      destname=$func_basename_result
2889
4202
2890
      # Not a directory, so check to see that there is only one file specified.
4203
      # Not a directory, so check to see that there is only one file specified.
2891
      set dummy $files; shift
4204
      set dummy $files; shift
2892
      test "$#" -gt 1 && \
4205
      test "$#" -gt 1 && \
2893
	func_fatal_help "\`$dest' is not a directory"
4206
	func_fatal_help "'$dest' is not a directory"
2894
    fi
4207
    fi
2895
    case $destdir in
4208
    case $destdir in
2896
    [\\/]* | [A-Za-z]:[\\/]*) ;;
4209
    [\\/]* | [A-Za-z]:[\\/]*) ;;
Lines 2899-2905 Link Here
2899
	case $file in
4212
	case $file in
2900
	*.lo) ;;
4213
	*.lo) ;;
2901
	*)
4214
	*)
2902
	  func_fatal_help "\`$destdir' must be an absolute directory name"
4215
	  func_fatal_help "'$destdir' must be an absolute directory name"
2903
	  ;;
4216
	  ;;
2904
	esac
4217
	esac
2905
      done
4218
      done
Lines 2908-2914 Link Here
2908
4221
2909
    # This variable tells wrapper scripts just to set variables rather
4222
    # This variable tells wrapper scripts just to set variables rather
2910
    # than running their programs.
4223
    # than running their programs.
2911
    libtool_install_magic="$magic"
4224
    libtool_install_magic=$magic
2912
4225
2913
    staticlibs=
4226
    staticlibs=
2914
    future_libdirs=
4227
    future_libdirs=
Lines 2928-2934 Link Here
2928
4241
2929
	# Check to see that this really is a libtool archive.
4242
	# Check to see that this really is a libtool archive.
2930
	func_lalib_unsafe_p "$file" \
4243
	func_lalib_unsafe_p "$file" \
2931
	  || func_fatal_help "\`$file' is not a valid libtool archive"
4244
	  || func_fatal_help "'$file' is not a valid libtool archive"
2932
4245
2933
	library_names=
4246
	library_names=
2934
	old_library=
4247
	old_library=
Lines 2950-2956 Link Here
2950
	fi
4263
	fi
2951
4264
2952
	func_dirname "$file" "/" ""
4265
	func_dirname "$file" "/" ""
2953
	dir="$func_dirname_result"
4266
	dir=$func_dirname_result
2954
	func_append dir "$objdir"
4267
	func_append dir "$objdir"
2955
4268
2956
	if test -n "$relink_command"; then
4269
	if test -n "$relink_command"; then
Lines 2964-2970 Link Here
2964
	  # are installed into $libdir/../bin (currently, that works fine)
4277
	  # are installed into $libdir/../bin (currently, that works fine)
2965
	  # but it's something to keep an eye on.
4278
	  # but it's something to keep an eye on.
2966
	  test "$inst_prefix_dir" = "$destdir" && \
4279
	  test "$inst_prefix_dir" = "$destdir" && \
2967
	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
4280
	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
2968
4281
2969
	  if test -n "$inst_prefix_dir"; then
4282
	  if test -n "$inst_prefix_dir"; then
2970
	    # Stick the inst_prefix_dir data into the link command.
4283
	    # Stick the inst_prefix_dir data into the link command.
Lines 2973-3001 Link Here
2973
	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
4286
	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2974
	  fi
4287
	  fi
2975
4288
2976
	  func_warning "relinking \`$file'"
4289
	  func_warning "relinking '$file'"
2977
	  func_show_eval "$relink_command" \
4290
	  func_show_eval "$relink_command" \
2978
	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
4291
	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
2979
	fi
4292
	fi
2980
4293
2981
	# See the names of the shared library.
4294
	# See the names of the shared library.
2982
	set dummy $library_names; shift
4295
	set dummy $library_names; shift
2983
	if test -n "$1"; then
4296
	if test -n "$1"; then
2984
	  realname="$1"
4297
	  realname=$1
2985
	  shift
4298
	  shift
2986
4299
2987
	  srcname="$realname"
4300
	  srcname=$realname
2988
	  test -n "$relink_command" && srcname="$realname"T
4301
	  test -n "$relink_command" && srcname=${realname}T
2989
4302
2990
	  # Install the shared library and build the symlinks.
4303
	  # Install the shared library and build the symlinks.
2991
	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
4304
	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
2992
	      'exit $?'
4305
	      'exit $?'
2993
	  tstripme="$stripme"
4306
	  tstripme=$stripme
2994
	  case $host_os in
4307
	  case $host_os in
2995
	  cygwin* | mingw* | pw32* | cegcc*)
4308
	  cygwin* | mingw* | pw32* | cegcc*)
2996
	    case $realname in
4309
	    case $realname in
2997
	    *.dll.a)
4310
	    *.dll.a)
2998
	      tstripme=""
4311
	      tstripme=
2999
	      ;;
4312
	      ;;
3000
	    esac
4313
	    esac
3001
	    ;;
4314
	    ;;
Lines 3006-3012 Link Here
3006
4319
3007
	  if test "$#" -gt 0; then
4320
	  if test "$#" -gt 0; then
3008
	    # Delete the old symlinks, and create new ones.
4321
	    # Delete the old symlinks, and create new ones.
3009
	    # Try `ln -sf' first, because the `ln' binary might depend on
4322
	    # Try 'ln -sf' first, because the 'ln' binary might depend on
3010
	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
4323
	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
3011
	    # so we also need to try rm && ln -s.
4324
	    # so we also need to try rm && ln -s.
3012
	    for linkname
4325
	    for linkname
Lines 3017-3030 Link Here
3017
	  fi
4330
	  fi
3018
4331
3019
	  # Do each command in the postinstall commands.
4332
	  # Do each command in the postinstall commands.
3020
	  lib="$destdir/$realname"
4333
	  lib=$destdir/$realname
3021
	  func_execute_cmds "$postinstall_cmds" 'exit $?'
4334
	  func_execute_cmds "$postinstall_cmds" 'exit $?'
3022
	fi
4335
	fi
3023
4336
3024
	# Install the pseudo-library for information purposes.
4337
	# Install the pseudo-library for information purposes.
3025
	func_basename "$file"
4338
	func_basename "$file"
3026
	name="$func_basename_result"
4339
	name=$func_basename_result
3027
	instname="$dir/$name"i
4340
	instname=$dir/${name}i
3028
	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
4341
	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3029
4342
3030
	# Maybe install the static library, too.
4343
	# Maybe install the static library, too.
Lines 3036-3046 Link Here
3036
4349
3037
	# Figure out destination file name, if it wasn't already specified.
4350
	# Figure out destination file name, if it wasn't already specified.
3038
	if test -n "$destname"; then
4351
	if test -n "$destname"; then
3039
	  destfile="$destdir/$destname"
4352
	  destfile=$destdir/$destname
3040
	else
4353
	else
3041
	  func_basename "$file"
4354
	  func_basename "$file"
3042
	  destfile="$func_basename_result"
4355
	  destfile=$func_basename_result
3043
	  destfile="$destdir/$destfile"
4356
	  destfile=$destdir/$destfile
3044
	fi
4357
	fi
3045
4358
3046
	# Deduce the name of the destination old-style object file.
4359
	# Deduce the name of the destination old-style object file.
Lines 3050-3060 Link Here
3050
	  staticdest=$func_lo2o_result
4363
	  staticdest=$func_lo2o_result
3051
	  ;;
4364
	  ;;
3052
	*.$objext)
4365
	*.$objext)
3053
	  staticdest="$destfile"
4366
	  staticdest=$destfile
3054
	  destfile=
4367
	  destfile=
3055
	  ;;
4368
	  ;;
3056
	*)
4369
	*)
3057
	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
4370
	  func_fatal_help "cannot copy a libtool object to '$destfile'"
3058
	  ;;
4371
	  ;;
3059
	esac
4372
	esac
3060
4373
Lines 3063-3069 Link Here
3063
	  func_show_eval "$install_prog $file $destfile" 'exit $?'
4376
	  func_show_eval "$install_prog $file $destfile" 'exit $?'
3064
4377
3065
	# Install the old object if enabled.
4378
	# Install the old object if enabled.
3066
	if test "$build_old_libs" = yes; then
4379
	if test yes = "$build_old_libs"; then
3067
	  # Deduce the name of the old-style object file.
4380
	  # Deduce the name of the old-style object file.
3068
	  func_lo2o "$file"
4381
	  func_lo2o "$file"
3069
	  staticobj=$func_lo2o_result
4382
	  staticobj=$func_lo2o_result
Lines 3075-3097 Link Here
3075
      *)
4388
      *)
3076
	# Figure out destination file name, if it wasn't already specified.
4389
	# Figure out destination file name, if it wasn't already specified.
3077
	if test -n "$destname"; then
4390
	if test -n "$destname"; then
3078
	  destfile="$destdir/$destname"
4391
	  destfile=$destdir/$destname
3079
	else
4392
	else
3080
	  func_basename "$file"
4393
	  func_basename "$file"
3081
	  destfile="$func_basename_result"
4394
	  destfile=$func_basename_result
3082
	  destfile="$destdir/$destfile"
4395
	  destfile=$destdir/$destfile
3083
	fi
4396
	fi
3084
4397
3085
	# If the file is missing, and there is a .exe on the end, strip it
4398
	# If the file is missing, and there is a .exe on the end, strip it
3086
	# because it is most likely a libtool script we actually want to
4399
	# because it is most likely a libtool script we actually want to
3087
	# install
4400
	# install
3088
	stripped_ext=""
4401
	stripped_ext=
3089
	case $file in
4402
	case $file in
3090
	  *.exe)
4403
	  *.exe)
3091
	    if test ! -f "$file"; then
4404
	    if test ! -f "$file"; then
3092
	      func_stripname '' '.exe' "$file"
4405
	      func_stripname '' '.exe' "$file"
3093
	      file=$func_stripname_result
4406
	      file=$func_stripname_result
3094
	      stripped_ext=".exe"
4407
	      stripped_ext=.exe
3095
	    fi
4408
	    fi
3096
	    ;;
4409
	    ;;
3097
	esac
4410
	esac
Lines 3119-3137 Link Here
3119
4432
3120
	  # Check the variables that should have been set.
4433
	  # Check the variables that should have been set.
3121
	  test -z "$generated_by_libtool_version" && \
4434
	  test -z "$generated_by_libtool_version" && \
3122
	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
4435
	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
3123
4436
3124
	  finalize=yes
4437
	  finalize=:
3125
	  for lib in $notinst_deplibs; do
4438
	  for lib in $notinst_deplibs; do
3126
	    # Check to see that each library is installed.
4439
	    # Check to see that each library is installed.
3127
	    libdir=
4440
	    libdir=
3128
	    if test -f "$lib"; then
4441
	    if test -f "$lib"; then
3129
	      func_source "$lib"
4442
	      func_source "$lib"
3130
	    fi
4443
	    fi
3131
	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
4444
	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
3132
	    if test -n "$libdir" && test ! -f "$libfile"; then
4445
	    if test -n "$libdir" && test ! -f "$libfile"; then
3133
	      func_warning "\`$lib' has not been installed in \`$libdir'"
4446
	      func_warning "'$lib' has not been installed in '$libdir'"
3134
	      finalize=no
4447
	      finalize=false
3135
	    fi
4448
	    fi
3136
	  done
4449
	  done
3137
4450
Lines 3139-3167 Link Here
3139
	  func_source "$wrapper"
4452
	  func_source "$wrapper"
3140
4453
3141
	  outputname=
4454
	  outputname=
3142
	  if test "$fast_install" = no && test -n "$relink_command"; then
4455
	  if test no = "$fast_install" && test -n "$relink_command"; then
3143
	    $opt_dry_run || {
4456
	    $opt_dry_run || {
3144
	      if test "$finalize" = yes; then
4457
	      if $finalize; then
3145
	        tmpdir=`func_mktempdir`
4458
	        tmpdir=`func_mktempdir`
3146
		func_basename "$file$stripped_ext"
4459
		func_basename "$file$stripped_ext"
3147
		file="$func_basename_result"
4460
		file=$func_basename_result
3148
	        outputname="$tmpdir/$file"
4461
	        outputname=$tmpdir/$file
3149
	        # Replace the output file specification.
4462
	        # Replace the output file specification.
3150
	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
4463
	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3151
4464
3152
	        $opt_silent || {
4465
	        $opt_quiet || {
3153
	          func_quote_for_expand "$relink_command"
4466
	          func_quote_for_expand "$relink_command"
3154
		  eval "func_echo $func_quote_for_expand_result"
4467
		  eval "func_echo $func_quote_for_expand_result"
3155
	        }
4468
	        }
3156
	        if eval "$relink_command"; then :
4469
	        if eval "$relink_command"; then :
3157
	          else
4470
	          else
3158
		  func_error "error: relink \`$file' with the above command before installing it"
4471
		  func_error "error: relink '$file' with the above command before installing it"
3159
		  $opt_dry_run || ${RM}r "$tmpdir"
4472
		  $opt_dry_run || ${RM}r "$tmpdir"
3160
		  continue
4473
		  continue
3161
	        fi
4474
	        fi
3162
	        file="$outputname"
4475
	        file=$outputname
3163
	      else
4476
	      else
3164
	        func_warning "cannot relink \`$file'"
4477
	        func_warning "cannot relink '$file'"
3165
	      fi
4478
	      fi
3166
	    }
4479
	    }
3167
	  else
4480
	  else
Lines 3198-3207 Link Here
3198
4511
3199
    for file in $staticlibs; do
4512
    for file in $staticlibs; do
3200
      func_basename "$file"
4513
      func_basename "$file"
3201
      name="$func_basename_result"
4514
      name=$func_basename_result
3202
4515
3203
      # Set up the ranlib parameters.
4516
      # Set up the ranlib parameters.
3204
      oldlib="$destdir/$name"
4517
      oldlib=$destdir/$name
3205
      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
4518
      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
3206
      tool_oldlib=$func_to_tool_file_result
4519
      tool_oldlib=$func_to_tool_file_result
3207
4520
Lines 3216-3233 Link Here
3216
    done
4529
    done
3217
4530
3218
    test -n "$future_libdirs" && \
4531
    test -n "$future_libdirs" && \
3219
      func_warning "remember to run \`$progname --finish$future_libdirs'"
4532
      func_warning "remember to run '$progname --finish$future_libdirs'"
3220
4533
3221
    if test -n "$current_libdirs"; then
4534
    if test -n "$current_libdirs"; then
3222
      # Maybe just do a dry run.
4535
      # Maybe just do a dry run.
3223
      $opt_dry_run && current_libdirs=" -n$current_libdirs"
4536
      $opt_dry_run && current_libdirs=" -n$current_libdirs"
3224
      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
4537
      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
3225
    else
4538
    else
3226
      exit $EXIT_SUCCESS
4539
      exit $EXIT_SUCCESS
3227
    fi
4540
    fi
3228
}
4541
}
3229
4542
3230
test "$opt_mode" = install && func_mode_install ${1+"$@"}
4543
test install = "$opt_mode" && func_mode_install ${1+"$@"}
3231
4544
3232
4545
3233
# func_generate_dlsyms outputname originator pic_p
4546
# func_generate_dlsyms outputname originator pic_p
Lines 3235-3250 Link Here
3235
# a dlpreopen symbol table.
4548
# a dlpreopen symbol table.
3236
func_generate_dlsyms ()
4549
func_generate_dlsyms ()
3237
{
4550
{
3238
    $opt_debug
4551
    $debug_cmd
3239
    my_outputname="$1"
4552
3240
    my_originator="$2"
4553
    my_outputname=$1
3241
    my_pic_p="${3-no}"
4554
    my_originator=$2
3242
    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
4555
    my_pic_p=${3-false}
4556
    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
3243
    my_dlsyms=
4557
    my_dlsyms=
3244
4558
3245
    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
4559
    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
3246
      if test -n "$NM" && test -n "$global_symbol_pipe"; then
4560
      if test -n "$NM" && test -n "$global_symbol_pipe"; then
3247
	my_dlsyms="${my_outputname}S.c"
4561
	my_dlsyms=${my_outputname}S.c
3248
      else
4562
      else
3249
	func_error "not configured to extract global symbols from dlpreopened files"
4563
	func_error "not configured to extract global symbols from dlpreopened files"
3250
      fi
4564
      fi
Lines 3255-3261 Link Here
3255
      "") ;;
4569
      "") ;;
3256
      *.c)
4570
      *.c)
3257
	# Discover the nlist of each of the dlfiles.
4571
	# Discover the nlist of each of the dlfiles.
3258
	nlist="$output_objdir/${my_outputname}.nm"
4572
	nlist=$output_objdir/$my_outputname.nm
3259
4573
3260
	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
4574
	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3261
4575
Lines 3263-3296 Link Here
3263
	func_verbose "creating $output_objdir/$my_dlsyms"
4577
	func_verbose "creating $output_objdir/$my_dlsyms"
3264
4578
3265
	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
4579
	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3266
/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
4580
/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
3267
/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
4581
/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
3268
4582
3269
#ifdef __cplusplus
4583
#ifdef __cplusplus
3270
extern \"C\" {
4584
extern \"C\" {
3271
#endif
4585
#endif
3272
4586
3273
#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
4587
#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3274
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
4588
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3275
#endif
4589
#endif
3276
4590
3277
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4591
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3278
#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
4592
#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
3279
/* DATA imports from DLLs on WIN32 con't be const, because runtime
4593
/* DATA imports from DLLs on WIN32 can't be const, because runtime
3280
   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4594
   relocations are performed -- see ld's documentation on pseudo-relocs.  */
3281
# define LT_DLSYM_CONST
4595
# define LT_DLSYM_CONST
3282
#elif defined(__osf__)
4596
#elif defined __osf__
3283
/* This system does not cope well with relocations in const data.  */
4597
/* This system does not cope well with relocations in const data.  */
3284
# define LT_DLSYM_CONST
4598
# define LT_DLSYM_CONST
3285
#else
4599
#else
3286
# define LT_DLSYM_CONST const
4600
# define LT_DLSYM_CONST const
3287
#endif
4601
#endif
3288
4602
4603
#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
4604
3289
/* External symbol declarations for the compiler. */\
4605
/* External symbol declarations for the compiler. */\
3290
"
4606
"
3291
4607
3292
	if test "$dlself" = yes; then
4608
	if test yes = "$dlself"; then
3293
	  func_verbose "generating symbol list for \`$output'"
4609
	  func_verbose "generating symbol list for '$output'"
3294
4610
3295
	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
4611
	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3296
4612
Lines 3298-3304 Link Here
3298
	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
4614
	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3299
	  for progfile in $progfiles; do
4615
	  for progfile in $progfiles; do
3300
	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
4616
	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3301
	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
4617
	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
3302
	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
4618
	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3303
	  done
4619
	  done
3304
4620
Lines 3318-3327 Link Here
3318
4634
3319
	  # Prepare the list of exported symbols
4635
	  # Prepare the list of exported symbols
3320
	  if test -z "$export_symbols"; then
4636
	  if test -z "$export_symbols"; then
3321
	    export_symbols="$output_objdir/$outputname.exp"
4637
	    export_symbols=$output_objdir/$outputname.exp
3322
	    $opt_dry_run || {
4638
	    $opt_dry_run || {
3323
	      $RM $export_symbols
4639
	      $RM $export_symbols
3324
	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4640
	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3325
	      case $host in
4641
	      case $host in
3326
	      *cygwin* | *mingw* | *cegcc* )
4642
	      *cygwin* | *mingw* | *cegcc* )
3327
                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
4643
                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
Lines 3331-3337 Link Here
3331
	    }
4647
	    }
3332
	  else
4648
	  else
3333
	    $opt_dry_run || {
4649
	    $opt_dry_run || {
3334
	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
4650
	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3335
	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4651
	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3336
	      eval '$MV "$nlist"T "$nlist"'
4652
	      eval '$MV "$nlist"T "$nlist"'
3337
	      case $host in
4653
	      case $host in
Lines 3345-3366 Link Here
3345
	fi
4661
	fi
3346
4662
3347
	for dlprefile in $dlprefiles; do
4663
	for dlprefile in $dlprefiles; do
3348
	  func_verbose "extracting global C symbols from \`$dlprefile'"
4664
	  func_verbose "extracting global C symbols from '$dlprefile'"
3349
	  func_basename "$dlprefile"
4665
	  func_basename "$dlprefile"
3350
	  name="$func_basename_result"
4666
	  name=$func_basename_result
3351
          case $host in
4667
          case $host in
3352
	    *cygwin* | *mingw* | *cegcc* )
4668
	    *cygwin* | *mingw* | *cegcc* )
3353
	      # if an import library, we need to obtain dlname
4669
	      # if an import library, we need to obtain dlname
3354
	      if func_win32_import_lib_p "$dlprefile"; then
4670
	      if func_win32_import_lib_p "$dlprefile"; then
3355
	        func_tr_sh "$dlprefile"
4671
	        func_tr_sh "$dlprefile"
3356
	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
4672
	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
3357
	        dlprefile_dlbasename=""
4673
	        dlprefile_dlbasename=
3358
	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
4674
	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3359
	          # Use subshell, to avoid clobbering current variable values
4675
	          # Use subshell, to avoid clobbering current variable values
3360
	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
4676
	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3361
	          if test -n "$dlprefile_dlname" ; then
4677
	          if test -n "$dlprefile_dlname"; then
3362
	            func_basename "$dlprefile_dlname"
4678
	            func_basename "$dlprefile_dlname"
3363
	            dlprefile_dlbasename="$func_basename_result"
4679
	            dlprefile_dlbasename=$func_basename_result
3364
	          else
4680
	          else
3365
	            # no lafile. user explicitly requested -dlpreopen <import library>.
4681
	            # no lafile. user explicitly requested -dlpreopen <import library>.
3366
	            $sharedlib_from_linklib_cmd "$dlprefile"
4682
	            $sharedlib_from_linklib_cmd "$dlprefile"
Lines 3368-3374 Link Here
3368
	          fi
4684
	          fi
3369
	        fi
4685
	        fi
3370
	        $opt_dry_run || {
4686
	        $opt_dry_run || {
3371
	          if test -n "$dlprefile_dlbasename" ; then
4687
	          if test -n "$dlprefile_dlbasename"; then
3372
	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
4688
	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3373
	          else
4689
	          else
3374
	            func_warning "Could not compute DLL name from $name"
4690
	            func_warning "Could not compute DLL name from $name"
Lines 3424-3429 Link Here
3424
	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
4740
	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3425
	  fi
4741
	  fi
3426
4742
4743
	  func_show_eval '$RM "${nlist}I"'
4744
	  if test -n "$global_symbol_to_import"; then
4745
	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
4746
	  fi
4747
3427
	  echo >> "$output_objdir/$my_dlsyms" "\
4748
	  echo >> "$output_objdir/$my_dlsyms" "\
3428
4749
3429
/* The mapping between symbol names and symbols.  */
4750
/* The mapping between symbol names and symbols.  */
Lines 3432-3442 Link Here
3432
  void *address;
4753
  void *address;
3433
} lt_dlsymlist;
4754
} lt_dlsymlist;
3434
extern LT_DLSYM_CONST lt_dlsymlist
4755
extern LT_DLSYM_CONST lt_dlsymlist
3435
lt_${my_prefix}_LTX_preloaded_symbols[];
4756
lt_${my_prefix}_LTX_preloaded_symbols[];\
4757
"
4758
4759
	  if test -s "$nlist"I; then
4760
	    echo >> "$output_objdir/$my_dlsyms" "\
4761
static void lt_syminit(void)
4762
{
4763
  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
4764
  for (; symbol->name; ++symbol)
4765
    {"
4766
	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
4767
	    echo >> "$output_objdir/$my_dlsyms" "\
4768
    }
4769
}"
4770
	  fi
4771
	  echo >> "$output_objdir/$my_dlsyms" "\
3436
LT_DLSYM_CONST lt_dlsymlist
4772
LT_DLSYM_CONST lt_dlsymlist
3437
lt_${my_prefix}_LTX_preloaded_symbols[] =
4773
lt_${my_prefix}_LTX_preloaded_symbols[] =
3438
{\
4774
{ {\"$my_originator\", (void *) 0},"
3439
  { \"$my_originator\", (void *) 0 },"
4775
4776
	  if test -s "$nlist"I; then
4777
	    echo >> "$output_objdir/$my_dlsyms" "\
4778
  {\"@INIT@\", (void *) &lt_syminit},"
4779
	  fi
3440
4780
3441
	  case $need_lib_prefix in
4781
	  case $need_lib_prefix in
3442
	  no)
4782
	  no)
Lines 3478-3486 Link Here
3478
	  *-*-hpux*)
4818
	  *-*-hpux*)
3479
	    pic_flag_for_symtable=" $pic_flag"  ;;
4819
	    pic_flag_for_symtable=" $pic_flag"  ;;
3480
	  *)
4820
	  *)
3481
	    if test "X$my_pic_p" != Xno; then
4821
	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
3482
	      pic_flag_for_symtable=" $pic_flag"
3483
	    fi
3484
	    ;;
4822
	    ;;
3485
	  esac
4823
	  esac
3486
	  ;;
4824
	  ;;
Lines 3497-3506 Link Here
3497
	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
4835
	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3498
4836
3499
	# Clean up the generated files.
4837
	# Clean up the generated files.
3500
	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
4838
	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
3501
4839
3502
	# Transform the symbol file into the correct name.
4840
	# Transform the symbol file into the correct name.
3503
	symfileobj="$output_objdir/${my_outputname}S.$objext"
4841
	symfileobj=$output_objdir/${my_outputname}S.$objext
3504
	case $host in
4842
	case $host in
3505
	*cygwin* | *mingw* | *cegcc* )
4843
	*cygwin* | *mingw* | *cegcc* )
3506
	  if test -f "$output_objdir/$my_outputname.def"; then
4844
	  if test -f "$output_objdir/$my_outputname.def"; then
Lines 3518-3524 Link Here
3518
	esac
4856
	esac
3519
	;;
4857
	;;
3520
      *)
4858
      *)
3521
	func_fatal_error "unknown suffix for \`$my_dlsyms'"
4859
	func_fatal_error "unknown suffix for '$my_dlsyms'"
3522
	;;
4860
	;;
3523
      esac
4861
      esac
3524
    else
4862
    else
Lines 3532-3537 Link Here
3532
    fi
4870
    fi
3533
}
4871
}
3534
4872
4873
# func_cygming_gnu_implib_p ARG
4874
# This predicate returns with zero status (TRUE) if
4875
# ARG is a GNU/binutils-style import library. Returns
4876
# with nonzero status (FALSE) otherwise.
4877
func_cygming_gnu_implib_p ()
4878
{
4879
  $debug_cmd
4880
4881
  func_to_tool_file "$1" func_convert_file_msys_to_w32
4882
  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)$'`
4883
  test -n "$func_cygming_gnu_implib_tmp"
4884
}
4885
4886
# func_cygming_ms_implib_p ARG
4887
# This predicate returns with zero status (TRUE) if
4888
# ARG is an MS-style import library. Returns
4889
# with nonzero status (FALSE) otherwise.
4890
func_cygming_ms_implib_p ()
4891
{
4892
  $debug_cmd
4893
4894
  func_to_tool_file "$1" func_convert_file_msys_to_w32
4895
  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4896
  test -n "$func_cygming_ms_implib_tmp"
4897
}
4898
3535
# func_win32_libid arg
4899
# func_win32_libid arg
3536
# return the library type of file 'arg'
4900
# return the library type of file 'arg'
3537
#
4901
#
Lines 3541-3548 Link Here
3541
# Despite the name, also deal with 64 bit binaries.
4905
# Despite the name, also deal with 64 bit binaries.
3542
func_win32_libid ()
4906
func_win32_libid ()
3543
{
4907
{
3544
  $opt_debug
4908
  $debug_cmd
3545
  win32_libid_type="unknown"
4909
4910
  win32_libid_type=unknown
3546
  win32_fileres=`file -L $1 2>/dev/null`
4911
  win32_fileres=`file -L $1 2>/dev/null`
3547
  case $win32_fileres in
4912
  case $win32_fileres in
3548
  *ar\ archive\ import\ library*) # definitely import
4913
  *ar\ archive\ import\ library*) # definitely import
Lines 3552-3567 Link Here
3552
    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
4917
    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3553
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
4918
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3554
       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
4919
       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3555
      func_to_tool_file "$1" func_convert_file_msys_to_w32
4920
      case $nm_interface in
3556
      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
4921
      "MS dumpbin")
3557
	$SED -n -e '
4922
	if func_cygming_ms_implib_p "$1" ||
4923
	   func_cygming_gnu_implib_p "$1"
4924
	then
4925
	  win32_nmres=import
4926
	else
4927
	  win32_nmres=
4928
	fi
4929
	;;
4930
      *)
4931
	func_to_tool_file "$1" func_convert_file_msys_to_w32
4932
	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
4933
	  $SED -n -e '
3558
	    1,100{
4934
	    1,100{
3559
		/ I /{
4935
		/ I /{
3560
		    s,.*,import,
4936
		    s|.*|import|
3561
		    p
4937
		    p
3562
		    q
4938
		    q
3563
		}
4939
		}
3564
	    }'`
4940
	    }'`
4941
	;;
4942
      esac
3565
      case $win32_nmres in
4943
      case $win32_nmres in
3566
      import*)  win32_libid_type="x86 archive import";;
4944
      import*)  win32_libid_type="x86 archive import";;
3567
      *)        win32_libid_type="x86 archive static";;
4945
      *)        win32_libid_type="x86 archive static";;
Lines 3593-3599 Link Here
3593
#    $sharedlib_from_linklib_result
4971
#    $sharedlib_from_linklib_result
3594
func_cygming_dll_for_implib ()
4972
func_cygming_dll_for_implib ()
3595
{
4973
{
3596
  $opt_debug
4974
  $debug_cmd
4975
3597
  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
4976
  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
3598
}
4977
}
3599
4978
Lines 3610-3616 Link Here
3610
# specified import library.
4989
# specified import library.
3611
func_cygming_dll_for_implib_fallback_core ()
4990
func_cygming_dll_for_implib_fallback_core ()
3612
{
4991
{
3613
  $opt_debug
4992
  $debug_cmd
4993
3614
  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
4994
  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
3615
  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
4995
  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
3616
    $SED '/^Contents of section '"$match_literal"':/{
4996
    $SED '/^Contents of section '"$match_literal"':/{
Lines 3646-3653 Link Here
3646
      /./p' |
5026
      /./p' |
3647
    # we now have a list, one entry per line, of the stringified
5027
    # we now have a list, one entry per line, of the stringified
3648
    # contents of the appropriate section of all members of the
5028
    # contents of the appropriate section of all members of the
3649
    # archive which possess that section. Heuristic: eliminate
5029
    # archive that possess that section. Heuristic: eliminate
3650
    # all those which have a first or second character that is
5030
    # all those that have a first or second character that is
3651
    # a '.' (that is, objdump's representation of an unprintable
5031
    # a '.' (that is, objdump's representation of an unprintable
3652
    # character.) This should work for all archives with less than
5032
    # character.) This should work for all archives with less than
3653
    # 0x302f exports -- but will fail for DLLs whose name actually
5033
    # 0x302f exports -- but will fail for DLLs whose name actually
Lines 3658-3687 Link Here
3658
    $SED -e '/^\./d;/^.\./d;q'
5038
    $SED -e '/^\./d;/^.\./d;q'
3659
}
5039
}
3660
5040
3661
# func_cygming_gnu_implib_p ARG
3662
# This predicate returns with zero status (TRUE) if
3663
# ARG is a GNU/binutils-style import library. Returns
3664
# with nonzero status (FALSE) otherwise.
3665
func_cygming_gnu_implib_p ()
3666
{
3667
  $opt_debug
3668
  func_to_tool_file "$1" func_convert_file_msys_to_w32
3669
  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
3670
  test -n "$func_cygming_gnu_implib_tmp"
3671
}
3672
3673
# func_cygming_ms_implib_p ARG
3674
# This predicate returns with zero status (TRUE) if
3675
# ARG is an MS-style import library. Returns
3676
# with nonzero status (FALSE) otherwise.
3677
func_cygming_ms_implib_p ()
3678
{
3679
  $opt_debug
3680
  func_to_tool_file "$1" func_convert_file_msys_to_w32
3681
  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
3682
  test -n "$func_cygming_ms_implib_tmp"
3683
}
3684
3685
# func_cygming_dll_for_implib_fallback ARG
5041
# func_cygming_dll_for_implib_fallback ARG
3686
# Platform-specific function to extract the
5042
# Platform-specific function to extract the
3687
# name of the DLL associated with the specified
5043
# name of the DLL associated with the specified
Lines 3695-3710 Link Here
3695
#    $sharedlib_from_linklib_result
5051
#    $sharedlib_from_linklib_result
3696
func_cygming_dll_for_implib_fallback ()
5052
func_cygming_dll_for_implib_fallback ()
3697
{
5053
{
3698
  $opt_debug
5054
  $debug_cmd
3699
  if func_cygming_gnu_implib_p "$1" ; then
5055
5056
  if func_cygming_gnu_implib_p "$1"; then
3700
    # binutils import library
5057
    # binutils import library
3701
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
5058
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
3702
  elif func_cygming_ms_implib_p "$1" ; then
5059
  elif func_cygming_ms_implib_p "$1"; then
3703
    # ms-generated import library
5060
    # ms-generated import library
3704
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
5061
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
3705
  else
5062
  else
3706
    # unknown
5063
    # unknown
3707
    sharedlib_from_linklib_result=""
5064
    sharedlib_from_linklib_result=
3708
  fi
5065
  fi
3709
}
5066
}
3710
5067
Lines 3712-3721 Link Here
3712
# func_extract_an_archive dir oldlib
5069
# func_extract_an_archive dir oldlib
3713
func_extract_an_archive ()
5070
func_extract_an_archive ()
3714
{
5071
{
3715
    $opt_debug
5072
    $debug_cmd
3716
    f_ex_an_ar_dir="$1"; shift
5073
3717
    f_ex_an_ar_oldlib="$1"
5074
    f_ex_an_ar_dir=$1; shift
3718
    if test "$lock_old_archive_extraction" = yes; then
5075
    f_ex_an_ar_oldlib=$1
5076
    if test yes = "$lock_old_archive_extraction"; then
3719
      lockfile=$f_ex_an_ar_oldlib.lock
5077
      lockfile=$f_ex_an_ar_oldlib.lock
3720
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
5078
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
3721
	func_echo "Waiting for $lockfile to be removed"
5079
	func_echo "Waiting for $lockfile to be removed"
Lines 3724-3730 Link Here
3724
    fi
5082
    fi
3725
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
5083
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
3726
		   'stat=$?; rm -f "$lockfile"; exit $stat'
5084
		   'stat=$?; rm -f "$lockfile"; exit $stat'
3727
    if test "$lock_old_archive_extraction" = yes; then
5085
    if test yes = "$lock_old_archive_extraction"; then
3728
      $opt_dry_run || rm -f "$lockfile"
5086
      $opt_dry_run || rm -f "$lockfile"
3729
    fi
5087
    fi
3730
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
5088
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
Lines 3738-3759 Link Here
3738
# func_extract_archives gentop oldlib ...
5096
# func_extract_archives gentop oldlib ...
3739
func_extract_archives ()
5097
func_extract_archives ()
3740
{
5098
{
3741
    $opt_debug
5099
    $debug_cmd
3742
    my_gentop="$1"; shift
5100
5101
    my_gentop=$1; shift
3743
    my_oldlibs=${1+"$@"}
5102
    my_oldlibs=${1+"$@"}
3744
    my_oldobjs=""
5103
    my_oldobjs=
3745
    my_xlib=""
5104
    my_xlib=
3746
    my_xabs=""
5105
    my_xabs=
3747
    my_xdir=""
5106
    my_xdir=
3748
5107
3749
    for my_xlib in $my_oldlibs; do
5108
    for my_xlib in $my_oldlibs; do
3750
      # Extract the objects.
5109
      # Extract the objects.
3751
      case $my_xlib in
5110
      case $my_xlib in
3752
	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
5111
	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
3753
	*) my_xabs=`pwd`"/$my_xlib" ;;
5112
	*) my_xabs=`pwd`"/$my_xlib" ;;
3754
      esac
5113
      esac
3755
      func_basename "$my_xlib"
5114
      func_basename "$my_xlib"
3756
      my_xlib="$func_basename_result"
5115
      my_xlib=$func_basename_result
3757
      my_xlib_u=$my_xlib
5116
      my_xlib_u=$my_xlib
3758
      while :; do
5117
      while :; do
3759
        case " $extracted_archives " in
5118
        case " $extracted_archives " in
Lines 3765-3771 Link Here
3765
	esac
5124
	esac
3766
      done
5125
      done
3767
      extracted_archives="$extracted_archives $my_xlib_u"
5126
      extracted_archives="$extracted_archives $my_xlib_u"
3768
      my_xdir="$my_gentop/$my_xlib_u"
5127
      my_xdir=$my_gentop/$my_xlib_u
3769
5128
3770
      func_mkdir_p "$my_xdir"
5129
      func_mkdir_p "$my_xdir"
3771
5130
Lines 3778-3796 Link Here
3778
	  cd $my_xdir || exit $?
5137
	  cd $my_xdir || exit $?
3779
	  darwin_archive=$my_xabs
5138
	  darwin_archive=$my_xabs
3780
	  darwin_curdir=`pwd`
5139
	  darwin_curdir=`pwd`
3781
	  darwin_base_archive=`basename "$darwin_archive"`
5140
	  func_basename "$darwin_archive"
5141
	  darwin_base_archive=$func_basename_result
3782
	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
5142
	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
3783
	  if test -n "$darwin_arches"; then
5143
	  if test -n "$darwin_arches"; then
3784
	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
5144
	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
3785
	    darwin_arch=
5145
	    darwin_arch=
3786
	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
5146
	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
3787
	    for darwin_arch in  $darwin_arches ; do
5147
	    for darwin_arch in  $darwin_arches; do
3788
	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
5148
	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
3789
	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
5149
	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
3790
	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
5150
	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
3791
	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
5151
	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
3792
	      cd "$darwin_curdir"
5152
	      cd "$darwin_curdir"
3793
	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
5153
	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
3794
	    done # $darwin_arches
5154
	    done # $darwin_arches
3795
            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
5155
            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
3796
	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
5156
	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
Lines 3815-3821 Link Here
3815
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
5175
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
3816
    done
5176
    done
3817
5177
3818
    func_extract_archives_result="$my_oldobjs"
5178
    func_extract_archives_result=$my_oldobjs
3819
}
5179
}
3820
5180
3821
5181
Lines 3830-3836 Link Here
3830
#
5190
#
3831
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
5191
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
3832
# variable will take.  If 'yes', then the emitted script
5192
# variable will take.  If 'yes', then the emitted script
3833
# will assume that the directory in which it is stored is
5193
# will assume that the directory where it is stored is
3834
# the $objdir directory.  This is a cygwin/mingw-specific
5194
# the $objdir directory.  This is a cygwin/mingw-specific
3835
# behavior.
5195
# behavior.
3836
func_emit_wrapper ()
5196
func_emit_wrapper ()
Lines 3841-3847 Link Here
3841
#! $SHELL
5201
#! $SHELL
3842
5202
3843
# $output - temporary wrapper script for $objdir/$outputname
5203
# $output - temporary wrapper script for $objdir/$outputname
3844
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
5204
# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
3845
#
5205
#
3846
# The $output program cannot be directly executed until all the libtool
5206
# The $output program cannot be directly executed until all the libtool
3847
# libraries that it depends on are installed.
5207
# libraries that it depends on are installed.
Lines 3898-3906 Link Here
3898
5258
3899
# Very basic option parsing. These options are (a) specific to
5259
# Very basic option parsing. These options are (a) specific to
3900
# the libtool wrapper, (b) are identical between the wrapper
5260
# the libtool wrapper, (b) are identical between the wrapper
3901
# /script/ and the wrapper /executable/ which is used only on
5261
# /script/ and the wrapper /executable/ that is used only on
3902
# windows platforms, and (c) all begin with the string "--lt-"
5262
# windows platforms, and (c) all begin with the string "--lt-"
3903
# (application programs are unlikely to have options which match
5263
# (application programs are unlikely to have options that match
3904
# this pattern).
5264
# this pattern).
3905
#
5265
#
3906
# There are only two supported options: --lt-debug and
5266
# There are only two supported options: --lt-debug and
Lines 3933-3939 Link Here
3933
5293
3934
  # Print the debug banner immediately:
5294
  # Print the debug banner immediately:
3935
  if test -n \"\$lt_option_debug\"; then
5295
  if test -n \"\$lt_option_debug\"; then
3936
    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
5296
    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
3937
  fi
5297
  fi
3938
}
5298
}
3939
5299
Lines 3944-3950 Link Here
3944
  lt_dump_args_N=1;
5304
  lt_dump_args_N=1;
3945
  for lt_arg
5305
  for lt_arg
3946
  do
5306
  do
3947
    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
5307
    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
3948
    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
5308
    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
3949
  done
5309
  done
3950
}
5310
}
Lines 3958-3964 Link Here
3958
  *-*-mingw | *-*-os2* | *-cegcc*)
5318
  *-*-mingw | *-*-os2* | *-cegcc*)
3959
    $ECHO "\
5319
    $ECHO "\
3960
      if test -n \"\$lt_option_debug\"; then
5320
      if test -n \"\$lt_option_debug\"; then
3961
        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
5321
        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
3962
        func_lt_dump_args \${1+\"\$@\"} 1>&2
5322
        func_lt_dump_args \${1+\"\$@\"} 1>&2
3963
      fi
5323
      fi
3964
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
5324
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
Lines 3968-3974 Link Here
3968
  *)
5328
  *)
3969
    $ECHO "\
5329
    $ECHO "\
3970
      if test -n \"\$lt_option_debug\"; then
5330
      if test -n \"\$lt_option_debug\"; then
3971
        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
5331
        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
3972
        func_lt_dump_args \${1+\"\$@\"} 1>&2
5332
        func_lt_dump_args \${1+\"\$@\"} 1>&2
3973
      fi
5333
      fi
3974
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
5334
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
Lines 4043-4055 Link Here
4043
  test -n \"\$absdir\" && thisdir=\"\$absdir\"
5403
  test -n \"\$absdir\" && thisdir=\"\$absdir\"
4044
"
5404
"
4045
5405
4046
	if test "$fast_install" = yes; then
5406
	if test yes = "$fast_install"; then
4047
	  $ECHO "\
5407
	  $ECHO "\
4048
  program=lt-'$outputname'$exeext
5408
  program=lt-'$outputname'$exeext
4049
  progdir=\"\$thisdir/$objdir\"
5409
  progdir=\"\$thisdir/$objdir\"
4050
5410
4051
  if test ! -f \"\$progdir/\$program\" ||
5411
  if test ! -f \"\$progdir/\$program\" ||
4052
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
5412
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
4053
       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
5413
       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4054
5414
4055
    file=\"\$\$-\$program\"
5415
    file=\"\$\$-\$program\"
Lines 4066-4072 Link Here
4066
    if test -n \"\$relink_command\"; then
5426
    if test -n \"\$relink_command\"; then
4067
      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
5427
      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4068
      else
5428
      else
4069
	$ECHO \"\$relink_command_output\" >&2
5429
	\$ECHO \"\$relink_command_output\" >&2
4070
	$RM \"\$progdir/\$file\"
5430
	$RM \"\$progdir/\$file\"
4071
	exit 1
5431
	exit 1
4072
      fi
5432
      fi
Lines 4101-4107 Link Here
4101
	fi
5461
	fi
4102
5462
4103
	# Export our shlibpath_var if we have one.
5463
	# Export our shlibpath_var if we have one.
4104
	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5464
	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4105
	  $ECHO "\
5465
	  $ECHO "\
4106
    # Add our own library path to $shlibpath_var
5466
    # Add our own library path to $shlibpath_var
4107
    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
5467
    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
Lines 4121-4127 Link Here
4121
    fi
5481
    fi
4122
  else
5482
  else
4123
    # The program doesn't exist.
5483
    # The program doesn't exist.
4124
    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
5484
    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
4125
    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
5485
    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4126
    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
5486
    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4127
    exit 1
5487
    exit 1
Lines 4140-4146 Link Here
4140
	cat <<EOF
5500
	cat <<EOF
4141
5501
4142
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
5502
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4143
   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
5503
   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
4144
5504
4145
   The $output program cannot be directly executed until all the libtool
5505
   The $output program cannot be directly executed until all the libtool
4146
   libraries that it depends on are installed.
5506
   libraries that it depends on are installed.
Lines 4175-4221 Link Here
4175
#include <fcntl.h>
5535
#include <fcntl.h>
4176
#include <sys/stat.h>
5536
#include <sys/stat.h>
4177
5537
5538
#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
5539
4178
/* declarations of non-ANSI functions */
5540
/* declarations of non-ANSI functions */
4179
#if defined(__MINGW32__)
5541
#if defined __MINGW32__
4180
# ifdef __STRICT_ANSI__
5542
# ifdef __STRICT_ANSI__
4181
int _putenv (const char *);
5543
int _putenv (const char *);
4182
# endif
5544
# endif
4183
#elif defined(__CYGWIN__)
5545
#elif defined __CYGWIN__
4184
# ifdef __STRICT_ANSI__
5546
# ifdef __STRICT_ANSI__
4185
char *realpath (const char *, char *);
5547
char *realpath (const char *, char *);
4186
int putenv (char *);
5548
int putenv (char *);
4187
int setenv (const char *, const char *, int);
5549
int setenv (const char *, const char *, int);
4188
# endif
5550
# endif
4189
/* #elif defined (other platforms) ... */
5551
/* #elif defined other_platform || defined ... */
4190
#endif
5552
#endif
4191
5553
4192
/* portability defines, excluding path handling macros */
5554
/* portability defines, excluding path handling macros */
4193
#if defined(_MSC_VER)
5555
#if defined _MSC_VER
4194
# define setmode _setmode
5556
# define setmode _setmode
4195
# define stat    _stat
5557
# define stat    _stat
4196
# define chmod   _chmod
5558
# define chmod   _chmod
4197
# define getcwd  _getcwd
5559
# define getcwd  _getcwd
4198
# define putenv  _putenv
5560
# define putenv  _putenv
4199
# define S_IXUSR _S_IEXEC
5561
# define S_IXUSR _S_IEXEC
4200
# ifndef _INTPTR_T_DEFINED
5562
#elif defined __MINGW32__
4201
#  define _INTPTR_T_DEFINED
4202
#  define intptr_t int
4203
# endif
4204
#elif defined(__MINGW32__)
4205
# define setmode _setmode
5563
# define setmode _setmode
4206
# define stat    _stat
5564
# define stat    _stat
4207
# define chmod   _chmod
5565
# define chmod   _chmod
4208
# define getcwd  _getcwd
5566
# define getcwd  _getcwd
4209
# define putenv  _putenv
5567
# define putenv  _putenv
4210
#elif defined(__CYGWIN__)
5568
#elif defined __CYGWIN__
4211
# define HAVE_SETENV
5569
# define HAVE_SETENV
4212
# define FOPEN_WB "wb"
5570
# define FOPEN_WB "wb"
4213
/* #elif defined (other platforms) ... */
5571
/* #elif defined other platforms ... */
4214
#endif
5572
#endif
4215
5573
4216
#if defined(PATH_MAX)
5574
#if defined PATH_MAX
4217
# define LT_PATHMAX PATH_MAX
5575
# define LT_PATHMAX PATH_MAX
4218
#elif defined(MAXPATHLEN)
5576
#elif defined MAXPATHLEN
4219
# define LT_PATHMAX MAXPATHLEN
5577
# define LT_PATHMAX MAXPATHLEN
4220
#else
5578
#else
4221
# define LT_PATHMAX 1024
5579
# define LT_PATHMAX 1024
Lines 4234-4241 Link Here
4234
# define PATH_SEPARATOR ':'
5592
# define PATH_SEPARATOR ':'
4235
#endif
5593
#endif
4236
5594
4237
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
5595
#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
4238
  defined (__OS2__)
5596
  defined __OS2__
4239
# define HAVE_DOS_BASED_FILE_SYSTEM
5597
# define HAVE_DOS_BASED_FILE_SYSTEM
4240
# define FOPEN_WB "wb"
5598
# define FOPEN_WB "wb"
4241
# ifndef DIR_SEPARATOR_2
5599
# ifndef DIR_SEPARATOR_2
Lines 4268-4277 Link Here
4268
5626
4269
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
5627
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
4270
#define XFREE(stale) do { \
5628
#define XFREE(stale) do { \
4271
  if (stale) { free ((void *) stale); stale = 0; } \
5629
  if (stale) { free (stale); stale = 0; } \
4272
} while (0)
5630
} while (0)
4273
5631
4274
#if defined(LT_DEBUGWRAPPER)
5632
#if defined LT_DEBUGWRAPPER
4275
static int lt_debug = 1;
5633
static int lt_debug = 1;
4276
#else
5634
#else
4277
static int lt_debug = 0;
5635
static int lt_debug = 0;
Lines 4300-4310 Link Here
4300
EOF
5658
EOF
4301
5659
4302
	    cat <<EOF
5660
	    cat <<EOF
4303
volatile const char * MAGIC_EXE = "$magic_exe";
5661
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
5662
# define externally_visible volatile
5663
#else
5664
# define externally_visible __attribute__((externally_visible)) volatile
5665
#endif
5666
externally_visible const char * MAGIC_EXE = "$magic_exe";
4304
const char * LIB_PATH_VARNAME = "$shlibpath_var";
5667
const char * LIB_PATH_VARNAME = "$shlibpath_var";
4305
EOF
5668
EOF
4306
5669
4307
	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
5670
	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4308
              func_to_host_path "$temp_rpath"
5671
              func_to_host_path "$temp_rpath"
4309
	      cat <<EOF
5672
	      cat <<EOF
4310
const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
5673
const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
Lines 4328-4334 Link Here
4328
EOF
5691
EOF
4329
	    fi
5692
	    fi
4330
5693
4331
	    if test "$fast_install" = yes; then
5694
	    if test yes = "$fast_install"; then
4332
	      cat <<EOF
5695
	      cat <<EOF
4333
const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
5696
const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4334
EOF
5697
EOF
Lines 4357-4368 Link Here
4357
  char *actual_cwrapper_name;
5720
  char *actual_cwrapper_name;
4358
  char *target_name;
5721
  char *target_name;
4359
  char *lt_argv_zero;
5722
  char *lt_argv_zero;
4360
  intptr_t rval = 127;
5723
  int rval = 127;
4361
5724
4362
  int i;
5725
  int i;
4363
5726
4364
  program_name = (char *) xstrdup (base_name (argv[0]));
5727
  program_name = (char *) xstrdup (base_name (argv[0]));
4365
  newargz = XMALLOC (char *, argc + 1);
5728
  newargz = XMALLOC (char *, (size_t) argc + 1);
4366
5729
4367
  /* very simple arg parsing; don't want to rely on getopt
5730
  /* very simple arg parsing; don't want to rely on getopt
4368
   * also, copy all non cwrapper options to newargz, except
5731
   * also, copy all non cwrapper options to newargz, except
Lines 4371-4380 Link Here
4371
  newargc=0;
5734
  newargc=0;
4372
  for (i = 1; i < argc; i++)
5735
  for (i = 1; i < argc; i++)
4373
    {
5736
    {
4374
      if (strcmp (argv[i], dumpscript_opt) == 0)
5737
      if (STREQ (argv[i], dumpscript_opt))
4375
	{
5738
	{
4376
EOF
5739
EOF
4377
	    case "$host" in
5740
	    case $host in
4378
	      *mingw* | *cygwin* )
5741
	      *mingw* | *cygwin* )
4379
		# make stdout use "unix" line endings
5742
		# make stdout use "unix" line endings
4380
		echo "          setmode(1,_O_BINARY);"
5743
		echo "          setmode(1,_O_BINARY);"
Lines 4385-4396 Link Here
4385
	  lt_dump_script (stdout);
5748
	  lt_dump_script (stdout);
4386
	  return 0;
5749
	  return 0;
4387
	}
5750
	}
4388
      if (strcmp (argv[i], debug_opt) == 0)
5751
      if (STREQ (argv[i], debug_opt))
4389
	{
5752
	{
4390
          lt_debug = 1;
5753
          lt_debug = 1;
4391
          continue;
5754
          continue;
4392
	}
5755
	}
4393
      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
5756
      if (STREQ (argv[i], ltwrapper_option_prefix))
4394
        {
5757
        {
4395
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
5758
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4396
             namespace, but it is not one of the ones we know about and
5759
             namespace, but it is not one of the ones we know about and
Lines 4413-4419 Link Here
4413
EOF
5776
EOF
4414
	    cat <<EOF
5777
	    cat <<EOF
4415
  /* The GNU banner must be the first non-error debug message */
5778
  /* The GNU banner must be the first non-error debug message */
4416
  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
5779
  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
4417
EOF
5780
EOF
4418
	    cat <<"EOF"
5781
	    cat <<"EOF"
4419
  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
5782
  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
Lines 4524-4530 Link Here
4524
		cat <<"EOF"
5887
		cat <<"EOF"
4525
  /* execv doesn't actually work on mingw as expected on unix */
5888
  /* execv doesn't actually work on mingw as expected on unix */
4526
  newargz = prepare_spawn (newargz);
5889
  newargz = prepare_spawn (newargz);
4527
  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
5890
  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4528
  if (rval == -1)
5891
  if (rval == -1)
4529
    {
5892
    {
4530
      /* failed to start process */
5893
      /* failed to start process */
Lines 4569-4575 Link Here
4569
{
5932
{
4570
  const char *base;
5933
  const char *base;
4571
5934
4572
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5935
#if defined HAVE_DOS_BASED_FILE_SYSTEM
4573
  /* Skip over the disk name in MSDOS pathnames. */
5936
  /* Skip over the disk name in MSDOS pathnames. */
4574
  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
5937
  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
4575
    name += 2;
5938
    name += 2;
Lines 4628-4634 Link Here
4628
  const char *p_next;
5991
  const char *p_next;
4629
  /* static buffer for getcwd */
5992
  /* static buffer for getcwd */
4630
  char tmp[LT_PATHMAX + 1];
5993
  char tmp[LT_PATHMAX + 1];
4631
  int tmp_len;
5994
  size_t tmp_len;
4632
  char *concat_name;
5995
  char *concat_name;
4633
5996
4634
  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
5997
  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
Lines 4638-4644 Link Here
4638
    return NULL;
6001
    return NULL;
4639
6002
4640
  /* Absolute path? */
6003
  /* Absolute path? */
4641
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
6004
#if defined HAVE_DOS_BASED_FILE_SYSTEM
4642
  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
6005
  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
4643
    {
6006
    {
4644
      concat_name = xstrdup (wrapper);
6007
      concat_name = xstrdup (wrapper);
Lines 4656-4662 Link Here
4656
	    return concat_name;
6019
	    return concat_name;
4657
	  XFREE (concat_name);
6020
	  XFREE (concat_name);
4658
	}
6021
	}
4659
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
6022
#if defined HAVE_DOS_BASED_FILE_SYSTEM
4660
    }
6023
    }
4661
#endif
6024
#endif
4662
6025
Lines 4679-4685 Link Here
4679
	      for (q = p; *q; q++)
6042
	      for (q = p; *q; q++)
4680
		if (IS_PATH_SEPARATOR (*q))
6043
		if (IS_PATH_SEPARATOR (*q))
4681
		  break;
6044
		  break;
4682
	      p_len = q - p;
6045
	      p_len = (size_t) (q - p);
4683
	      p_next = (*q == '\0' ? q : q + 1);
6046
	      p_next = (*q == '\0' ? q : q + 1);
4684
	      if (p_len == 0)
6047
	      if (p_len == 0)
4685
		{
6048
		{
Lines 4798-4804 Link Here
4798
  if (patlen <= len)
6161
  if (patlen <= len)
4799
    {
6162
    {
4800
      str += len - patlen;
6163
      str += len - patlen;
4801
      if (strcmp (str, pat) == 0)
6164
      if (STREQ (str, pat))
4802
	*str = '\0';
6165
	*str = '\0';
4803
    }
6166
    }
4804
  return str;
6167
  return str;
Lines 4863-4869 Link Here
4863
    char *str = xstrdup (value);
6226
    char *str = xstrdup (value);
4864
    setenv (name, str, 1);
6227
    setenv (name, str, 1);
4865
#else
6228
#else
4866
    int len = strlen (name) + 1 + strlen (value) + 1;
6229
    size_t len = strlen (name) + 1 + strlen (value) + 1;
4867
    char *str = XMALLOC (char, len);
6230
    char *str = XMALLOC (char, len);
4868
    sprintf (str, "%s=%s", name, value);
6231
    sprintf (str, "%s=%s", name, value);
4869
    if (putenv (str) != EXIT_SUCCESS)
6232
    if (putenv (str) != EXIT_SUCCESS)
Lines 4880-4887 Link Here
4880
  char *new_value;
6243
  char *new_value;
4881
  if (orig_value && *orig_value)
6244
  if (orig_value && *orig_value)
4882
    {
6245
    {
4883
      int orig_value_len = strlen (orig_value);
6246
      size_t orig_value_len = strlen (orig_value);
4884
      int add_len = strlen (add);
6247
      size_t add_len = strlen (add);
4885
      new_value = XMALLOC (char, add_len + orig_value_len + 1);
6248
      new_value = XMALLOC (char, add_len + orig_value_len + 1);
4886
      if (to_end)
6249
      if (to_end)
4887
        {
6250
        {
Lines 4912-4921 Link Here
4912
    {
6275
    {
4913
      char *new_value = lt_extend_str (getenv (name), value, 0);
6276
      char *new_value = lt_extend_str (getenv (name), value, 0);
4914
      /* some systems can't cope with a ':'-terminated path #' */
6277
      /* some systems can't cope with a ':'-terminated path #' */
4915
      int len = strlen (new_value);
6278
      size_t len = strlen (new_value);
4916
      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
6279
      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4917
        {
6280
        {
4918
          new_value[len-1] = '\0';
6281
          new_value[--len] = '\0';
4919
        }
6282
        }
4920
      lt_setenv (name, new_value);
6283
      lt_setenv (name, new_value);
4921
      XFREE (new_value);
6284
      XFREE (new_value);
Lines 5082-5088 Link Here
5082
# True if ARG is an import lib, as indicated by $file_magic_cmd
6445
# True if ARG is an import lib, as indicated by $file_magic_cmd
5083
func_win32_import_lib_p ()
6446
func_win32_import_lib_p ()
5084
{
6447
{
5085
    $opt_debug
6448
    $debug_cmd
6449
5086
    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
6450
    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
5087
    *import*) : ;;
6451
    *import*) : ;;
5088
    *) false ;;
6452
    *) false ;;
Lines 5092-5108 Link Here
5092
# func_mode_link arg...
6456
# func_mode_link arg...
5093
func_mode_link ()
6457
func_mode_link ()
5094
{
6458
{
5095
    $opt_debug
6459
    $debug_cmd
6460
5096
    case $host in
6461
    case $host in
5097
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6462
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5098
      # It is impossible to link a dll without this setting, and
6463
      # It is impossible to link a dll without this setting, and
5099
      # we shouldn't force the makefile maintainer to figure out
6464
      # we shouldn't force the makefile maintainer to figure out
5100
      # which system we are compiling for in order to pass an extra
6465
      # what system we are compiling for in order to pass an extra
5101
      # flag for every libtool invocation.
6466
      # flag for every libtool invocation.
5102
      # allow_undefined=no
6467
      # allow_undefined=no
5103
6468
5104
      # FIXME: Unfortunately, there are problems with the above when trying
6469
      # FIXME: Unfortunately, there are problems with the above when trying
5105
      # to make a dll which has undefined symbols, in which case not
6470
      # to make a dll that has undefined symbols, in which case not
5106
      # even a static library is built.  For now, we need to specify
6471
      # even a static library is built.  For now, we need to specify
5107
      # -no-undefined on the libtool link line when we can be certain
6472
      # -no-undefined on the libtool link line when we can be certain
5108
      # that all symbols are satisfied, otherwise we get a static library.
6473
      # that all symbols are satisfied, otherwise we get a static library.
Lines 5149-5155 Link Here
5149
    non_pic_objects=
6514
    non_pic_objects=
5150
    precious_files_regex=
6515
    precious_files_regex=
5151
    prefer_static_libs=no
6516
    prefer_static_libs=no
5152
    preload=no
6517
    preload=false
5153
    prev=
6518
    prev=
5154
    prevarg=
6519
    prevarg=
5155
    release=
6520
    release=
Lines 5161-5167 Link Here
5161
    vinfo=
6526
    vinfo=
5162
    vinfo_number=no
6527
    vinfo_number=no
5163
    weak_libs=
6528
    weak_libs=
5164
    single_module="${wl}-single_module"
6529
    single_module=$wl-single_module
5165
    func_infer_tag $base_compile
6530
    func_infer_tag $base_compile
5166
6531
5167
    # We need to know -static, to get the right output filenames.
6532
    # We need to know -static, to get the right output filenames.
Lines 5169-5183 Link Here
5169
    do
6534
    do
5170
      case $arg in
6535
      case $arg in
5171
      -shared)
6536
      -shared)
5172
	test "$build_libtool_libs" != yes && \
6537
	test yes != "$build_libtool_libs" \
5173
	  func_fatal_configuration "can not build a shared library"
6538
	  && func_fatal_configuration "cannot build a shared library"
5174
	build_old_libs=no
6539
	build_old_libs=no
5175
	break
6540
	break
5176
	;;
6541
	;;
5177
      -all-static | -static | -static-libtool-libs)
6542
      -all-static | -static | -static-libtool-libs)
5178
	case $arg in
6543
	case $arg in
5179
	-all-static)
6544
	-all-static)
5180
	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
6545
	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
5181
	    func_warning "complete static linking is impossible in this configuration"
6546
	    func_warning "complete static linking is impossible in this configuration"
5182
	  fi
6547
	  fi
5183
	  if test -n "$link_static_flag"; then
6548
	  if test -n "$link_static_flag"; then
Lines 5210-5216 Link Here
5210
6575
5211
    # Go through the arguments, transforming them on the way.
6576
    # Go through the arguments, transforming them on the way.
5212
    while test "$#" -gt 0; do
6577
    while test "$#" -gt 0; do
5213
      arg="$1"
6578
      arg=$1
5214
      shift
6579
      shift
5215
      func_quote_for_eval "$arg"
6580
      func_quote_for_eval "$arg"
5216
      qarg=$func_quote_for_eval_unquoted_result
6581
      qarg=$func_quote_for_eval_unquoted_result
Lines 5227-5247 Link Here
5227
6592
5228
	case $prev in
6593
	case $prev in
5229
	bindir)
6594
	bindir)
5230
	  bindir="$arg"
6595
	  bindir=$arg
5231
	  prev=
6596
	  prev=
5232
	  continue
6597
	  continue
5233
	  ;;
6598
	  ;;
5234
	dlfiles|dlprefiles)
6599
	dlfiles|dlprefiles)
5235
	  if test "$preload" = no; then
6600
	  $preload || {
5236
	    # Add the symbol object into the linking commands.
6601
	    # Add the symbol object into the linking commands.
5237
	    func_append compile_command " @SYMFILE@"
6602
	    func_append compile_command " @SYMFILE@"
5238
	    func_append finalize_command " @SYMFILE@"
6603
	    func_append finalize_command " @SYMFILE@"
5239
	    preload=yes
6604
	    preload=:
5240
	  fi
6605
	  }
5241
	  case $arg in
6606
	  case $arg in
5242
	  *.la | *.lo) ;;  # We handle these cases below.
6607
	  *.la | *.lo) ;;  # We handle these cases below.
5243
	  force)
6608
	  force)
5244
	    if test "$dlself" = no; then
6609
	    if test no = "$dlself"; then
5245
	      dlself=needless
6610
	      dlself=needless
5246
	      export_dynamic=yes
6611
	      export_dynamic=yes
5247
	    fi
6612
	    fi
Lines 5249-5257 Link Here
5249
	    continue
6614
	    continue
5250
	    ;;
6615
	    ;;
5251
	  self)
6616
	  self)
5252
	    if test "$prev" = dlprefiles; then
6617
	    if test dlprefiles = "$prev"; then
5253
	      dlself=yes
6618
	      dlself=yes
5254
	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
6619
	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
5255
	      dlself=yes
6620
	      dlself=yes
5256
	    else
6621
	    else
5257
	      dlself=needless
6622
	      dlself=needless
Lines 5261-5267 Link Here
5261
	    continue
6626
	    continue
5262
	    ;;
6627
	    ;;
5263
	  *)
6628
	  *)
5264
	    if test "$prev" = dlfiles; then
6629
	    if test dlfiles = "$prev"; then
5265
	      func_append dlfiles " $arg"
6630
	      func_append dlfiles " $arg"
5266
	    else
6631
	    else
5267
	      func_append dlprefiles " $arg"
6632
	      func_append dlprefiles " $arg"
Lines 5272-5285 Link Here
5272
	  esac
6637
	  esac
5273
	  ;;
6638
	  ;;
5274
	expsyms)
6639
	expsyms)
5275
	  export_symbols="$arg"
6640
	  export_symbols=$arg
5276
	  test -f "$arg" \
6641
	  test -f "$arg" \
5277
	    || func_fatal_error "symbol file \`$arg' does not exist"
6642
	    || func_fatal_error "symbol file '$arg' does not exist"
5278
	  prev=
6643
	  prev=
5279
	  continue
6644
	  continue
5280
	  ;;
6645
	  ;;
5281
	expsyms_regex)
6646
	expsyms_regex)
5282
	  export_symbols_regex="$arg"
6647
	  export_symbols_regex=$arg
5283
	  prev=
6648
	  prev=
5284
	  continue
6649
	  continue
5285
	  ;;
6650
	  ;;
Lines 5297-5303 Link Here
5297
	  continue
6662
	  continue
5298
	  ;;
6663
	  ;;
5299
	inst_prefix)
6664
	inst_prefix)
5300
	  inst_prefix_dir="$arg"
6665
	  inst_prefix_dir=$arg
6666
	  prev=
6667
	  continue
6668
	  ;;
6669
	mllvm)
6670
	  # Clang does not use LLVM to link, so we can simply discard any
6671
	  # '-mllvm $arg' options when doing the link step.
5301
	  prev=
6672
	  prev=
5302
	  continue
6673
	  continue
5303
	  ;;
6674
	  ;;
Lines 5321-5341 Link Here
5321
6692
5322
		if test -z "$pic_object" ||
6693
		if test -z "$pic_object" ||
5323
		   test -z "$non_pic_object" ||
6694
		   test -z "$non_pic_object" ||
5324
		   test "$pic_object" = none &&
6695
		   test none = "$pic_object" &&
5325
		   test "$non_pic_object" = none; then
6696
		   test none = "$non_pic_object"; then
5326
		  func_fatal_error "cannot find name of object for \`$arg'"
6697
		  func_fatal_error "cannot find name of object for '$arg'"
5327
		fi
6698
		fi
5328
6699
5329
		# Extract subdirectory from the argument.
6700
		# Extract subdirectory from the argument.
5330
		func_dirname "$arg" "/" ""
6701
		func_dirname "$arg" "/" ""
5331
		xdir="$func_dirname_result"
6702
		xdir=$func_dirname_result
5332
6703
5333
		if test "$pic_object" != none; then
6704
		if test none != "$pic_object"; then
5334
		  # Prepend the subdirectory the object is found in.
6705
		  # Prepend the subdirectory the object is found in.
5335
		  pic_object="$xdir$pic_object"
6706
		  pic_object=$xdir$pic_object
5336
6707
5337
		  if test "$prev" = dlfiles; then
6708
		  if test dlfiles = "$prev"; then
5338
		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
6709
		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
5339
		      func_append dlfiles " $pic_object"
6710
		      func_append dlfiles " $pic_object"
5340
		      prev=
6711
		      prev=
5341
		      continue
6712
		      continue
Lines 5346-5352 Link Here
5346
		  fi
6717
		  fi
5347
6718
5348
		  # CHECK ME:  I think I busted this.  -Ossama
6719
		  # CHECK ME:  I think I busted this.  -Ossama
5349
		  if test "$prev" = dlprefiles; then
6720
		  if test dlprefiles = "$prev"; then
5350
		    # Preload the old-style object.
6721
		    # Preload the old-style object.
5351
		    func_append dlprefiles " $pic_object"
6722
		    func_append dlprefiles " $pic_object"
5352
		    prev=
6723
		    prev=
Lines 5354-5376 Link Here
5354
6725
5355
		  # A PIC object.
6726
		  # A PIC object.
5356
		  func_append libobjs " $pic_object"
6727
		  func_append libobjs " $pic_object"
5357
		  arg="$pic_object"
6728
		  arg=$pic_object
5358
		fi
6729
		fi
5359
6730
5360
		# Non-PIC object.
6731
		# Non-PIC object.
5361
		if test "$non_pic_object" != none; then
6732
		if test none != "$non_pic_object"; then
5362
		  # Prepend the subdirectory the object is found in.
6733
		  # Prepend the subdirectory the object is found in.
5363
		  non_pic_object="$xdir$non_pic_object"
6734
		  non_pic_object=$xdir$non_pic_object
5364
6735
5365
		  # A standard non-PIC object
6736
		  # A standard non-PIC object
5366
		  func_append non_pic_objects " $non_pic_object"
6737
		  func_append non_pic_objects " $non_pic_object"
5367
		  if test -z "$pic_object" || test "$pic_object" = none ; then
6738
		  if test -z "$pic_object" || test none = "$pic_object"; then
5368
		    arg="$non_pic_object"
6739
		    arg=$non_pic_object
5369
		  fi
6740
		  fi
5370
		else
6741
		else
5371
		  # If the PIC object exists, use it instead.
6742
		  # If the PIC object exists, use it instead.
5372
		  # $xdir was prepended to $pic_object above.
6743
		  # $xdir was prepended to $pic_object above.
5373
		  non_pic_object="$pic_object"
6744
		  non_pic_object=$pic_object
5374
		  func_append non_pic_objects " $non_pic_object"
6745
		  func_append non_pic_objects " $non_pic_object"
5375
		fi
6746
		fi
5376
	      else
6747
	      else
Lines 5378-5384 Link Here
5378
		if $opt_dry_run; then
6749
		if $opt_dry_run; then
5379
		  # Extract subdirectory from the argument.
6750
		  # Extract subdirectory from the argument.
5380
		  func_dirname "$arg" "/" ""
6751
		  func_dirname "$arg" "/" ""
5381
		  xdir="$func_dirname_result"
6752
		  xdir=$func_dirname_result
5382
6753
5383
		  func_lo2o "$arg"
6754
		  func_lo2o "$arg"
5384
		  pic_object=$xdir$objdir/$func_lo2o_result
6755
		  pic_object=$xdir$objdir/$func_lo2o_result
Lines 5386-5409 Link Here
5386
		  func_append libobjs " $pic_object"
6757
		  func_append libobjs " $pic_object"
5387
		  func_append non_pic_objects " $non_pic_object"
6758
		  func_append non_pic_objects " $non_pic_object"
5388
	        else
6759
	        else
5389
		  func_fatal_error "\`$arg' is not a valid libtool object"
6760
		  func_fatal_error "'$arg' is not a valid libtool object"
5390
		fi
6761
		fi
5391
	      fi
6762
	      fi
5392
	    done
6763
	    done
5393
	  else
6764
	  else
5394
	    func_fatal_error "link input file \`$arg' does not exist"
6765
	    func_fatal_error "link input file '$arg' does not exist"
5395
	  fi
6766
	  fi
5396
	  arg=$save_arg
6767
	  arg=$save_arg
5397
	  prev=
6768
	  prev=
5398
	  continue
6769
	  continue
5399
	  ;;
6770
	  ;;
5400
	precious_regex)
6771
	precious_regex)
5401
	  precious_files_regex="$arg"
6772
	  precious_files_regex=$arg
5402
	  prev=
6773
	  prev=
5403
	  continue
6774
	  continue
5404
	  ;;
6775
	  ;;
5405
	release)
6776
	release)
5406
	  release="-$arg"
6777
	  release=-$arg
5407
	  prev=
6778
	  prev=
5408
	  continue
6779
	  continue
5409
	  ;;
6780
	  ;;
Lines 5415-5421 Link Here
5415
	    func_fatal_error "only absolute run-paths are allowed"
6786
	    func_fatal_error "only absolute run-paths are allowed"
5416
	    ;;
6787
	    ;;
5417
	  esac
6788
	  esac
5418
	  if test "$prev" = rpath; then
6789
	  if test rpath = "$prev"; then
5419
	    case "$rpath " in
6790
	    case "$rpath " in
5420
	    *" $arg "*) ;;
6791
	    *" $arg "*) ;;
5421
	    *) func_append rpath " $arg" ;;
6792
	    *) func_append rpath " $arg" ;;
Lines 5430-5436 Link Here
5430
	  continue
6801
	  continue
5431
	  ;;
6802
	  ;;
5432
	shrext)
6803
	shrext)
5433
	  shrext_cmds="$arg"
6804
	  shrext_cmds=$arg
5434
	  prev=
6805
	  prev=
5435
	  continue
6806
	  continue
5436
	  ;;
6807
	  ;;
Lines 5470-5476 Link Here
5470
	esac
6841
	esac
5471
      fi # test -n "$prev"
6842
      fi # test -n "$prev"
5472
6843
5473
      prevarg="$arg"
6844
      prevarg=$arg
5474
6845
5475
      case $arg in
6846
      case $arg in
5476
      -all-static)
6847
      -all-static)
Lines 5484-5490 Link Here
5484
6855
5485
      -allow-undefined)
6856
      -allow-undefined)
5486
	# FIXME: remove this flag sometime in the future.
6857
	# FIXME: remove this flag sometime in the future.
5487
	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
6858
	func_fatal_error "'-allow-undefined' must not be used because it is the default"
5488
	;;
6859
	;;
5489
6860
5490
      -avoid-version)
6861
      -avoid-version)
Lines 5516-5522 Link Here
5516
	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
6887
	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5517
	  func_fatal_error "more than one -exported-symbols argument is not allowed"
6888
	  func_fatal_error "more than one -exported-symbols argument is not allowed"
5518
	fi
6889
	fi
5519
	if test "X$arg" = "X-export-symbols"; then
6890
	if test X-export-symbols = "X$arg"; then
5520
	  prev=expsyms
6891
	  prev=expsyms
5521
	else
6892
	else
5522
	  prev=expsyms_regex
6893
	  prev=expsyms_regex
Lines 5550-5558 Link Here
5550
	func_stripname "-L" '' "$arg"
6921
	func_stripname "-L" '' "$arg"
5551
	if test -z "$func_stripname_result"; then
6922
	if test -z "$func_stripname_result"; then
5552
	  if test "$#" -gt 0; then
6923
	  if test "$#" -gt 0; then
5553
	    func_fatal_error "require no space between \`-L' and \`$1'"
6924
	    func_fatal_error "require no space between '-L' and '$1'"
5554
	  else
6925
	  else
5555
	    func_fatal_error "need path for \`-L' option"
6926
	    func_fatal_error "need path for '-L' option"
5556
	  fi
6927
	  fi
5557
	fi
6928
	fi
5558
	func_resolve_sysroot "$func_stripname_result"
6929
	func_resolve_sysroot "$func_stripname_result"
Lines 5563-5570 Link Here
5563
	*)
6934
	*)
5564
	  absdir=`cd "$dir" && pwd`
6935
	  absdir=`cd "$dir" && pwd`
5565
	  test -z "$absdir" && \
6936
	  test -z "$absdir" && \
5566
	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
6937
	    func_fatal_error "cannot determine absolute directory name of '$dir'"
5567
	  dir="$absdir"
6938
	  dir=$absdir
5568
	  ;;
6939
	  ;;
5569
	esac
6940
	esac
5570
	case "$deplibs " in
6941
	case "$deplibs " in
Lines 5599-5605 Link Here
5599
	;;
6970
	;;
5600
6971
5601
      -l*)
6972
      -l*)
5602
	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
6973
	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
5603
	  case $host in
6974
	  case $host in
5604
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
6975
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
5605
	    # These systems don't actually have a C or math library (as such)
6976
	    # These systems don't actually have a C or math library (as such)
Lines 5607-5617 Link Here
5607
	    ;;
6978
	    ;;
5608
	  *-*-os2*)
6979
	  *-*-os2*)
5609
	    # These systems don't actually have a C library (as such)
6980
	    # These systems don't actually have a C library (as such)
5610
	    test "X$arg" = "X-lc" && continue
6981
	    test X-lc = "X$arg" && continue
5611
	    ;;
6982
	    ;;
5612
	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6983
	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
5613
	    # Do not include libc due to us having libc/libc_r.
6984
	    # Do not include libc due to us having libc/libc_r.
5614
	    test "X$arg" = "X-lc" && continue
6985
	    test X-lc = "X$arg" && continue
5615
	    ;;
6986
	    ;;
5616
	  *-*-rhapsody* | *-*-darwin1.[012])
6987
	  *-*-rhapsody* | *-*-darwin1.[012])
5617
	    # Rhapsody C and math libraries are in the System framework
6988
	    # Rhapsody C and math libraries are in the System framework
Lines 5620-5635 Link Here
5620
	    ;;
6991
	    ;;
5621
	  *-*-sco3.2v5* | *-*-sco5v6*)
6992
	  *-*-sco3.2v5* | *-*-sco5v6*)
5622
	    # Causes problems with __ctype
6993
	    # Causes problems with __ctype
5623
	    test "X$arg" = "X-lc" && continue
6994
	    test X-lc = "X$arg" && continue
5624
	    ;;
6995
	    ;;
5625
	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6996
	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
5626
	    # Compiler inserts libc in the correct place for threads to work
6997
	    # Compiler inserts libc in the correct place for threads to work
5627
	    test "X$arg" = "X-lc" && continue
6998
	    test X-lc = "X$arg" && continue
5628
	    ;;
6999
	    ;;
5629
	  esac
7000
	  esac
5630
	elif test "X$arg" = "X-lc_r"; then
7001
	elif test X-lc_r = "X$arg"; then
5631
	 case $host in
7002
	 case $host in
5632
	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
7003
	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
5633
	   # Do not include libc_r directly, use -pthread flag.
7004
	   # Do not include libc_r directly, use -pthread flag.
5634
	   continue
7005
	   continue
5635
	   ;;
7006
	   ;;
Lines 5639-5644 Link Here
5639
	continue
7010
	continue
5640
	;;
7011
	;;
5641
7012
7013
      -mllvm)
7014
	prev=mllvm
7015
	continue
7016
	;;
7017
5642
      -module)
7018
      -module)
5643
	module=yes
7019
	module=yes
5644
	continue
7020
	continue
Lines 5668-5674 Link Here
5668
	;;
7044
	;;
5669
7045
5670
      -multi_module)
7046
      -multi_module)
5671
	single_module="${wl}-multi_module"
7047
	single_module=$wl-multi_module
5672
	continue
7048
	continue
5673
	;;
7049
	;;
5674
7050
Lines 5682-5689 Link Here
5682
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
7058
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
5683
	  # The PATH hackery in wrapper scripts is required on Windows
7059
	  # The PATH hackery in wrapper scripts is required on Windows
5684
	  # and Darwin in order for the loader to find any dlls it needs.
7060
	  # and Darwin in order for the loader to find any dlls it needs.
5685
	  func_warning "\`-no-install' is ignored for $host"
7061
	  func_warning "'-no-install' is ignored for $host"
5686
	  func_warning "assuming \`-no-fast-install' instead"
7062
	  func_warning "assuming '-no-fast-install' instead"
5687
	  fast_install=no
7063
	  fast_install=no
5688
	  ;;
7064
	  ;;
5689
	*) no_install=yes ;;
7065
	*) no_install=yes ;;
Lines 5788-5801 Link Here
5788
	func_stripname '-Wc,' '' "$arg"
7164
	func_stripname '-Wc,' '' "$arg"
5789
	args=$func_stripname_result
7165
	args=$func_stripname_result
5790
	arg=
7166
	arg=
5791
	save_ifs="$IFS"; IFS=','
7167
	save_ifs=$IFS; IFS=,
5792
	for flag in $args; do
7168
	for flag in $args; do
5793
	  IFS="$save_ifs"
7169
	  IFS=$save_ifs
5794
          func_quote_for_eval "$flag"
7170
          func_quote_for_eval "$flag"
5795
	  func_append arg " $func_quote_for_eval_result"
7171
	  func_append arg " $func_quote_for_eval_result"
5796
	  func_append compiler_flags " $func_quote_for_eval_result"
7172
	  func_append compiler_flags " $func_quote_for_eval_result"
5797
	done
7173
	done
5798
	IFS="$save_ifs"
7174
	IFS=$save_ifs
5799
	func_stripname ' ' '' "$arg"
7175
	func_stripname ' ' '' "$arg"
5800
	arg=$func_stripname_result
7176
	arg=$func_stripname_result
5801
	;;
7177
	;;
Lines 5804-5818 Link Here
5804
	func_stripname '-Wl,' '' "$arg"
7180
	func_stripname '-Wl,' '' "$arg"
5805
	args=$func_stripname_result
7181
	args=$func_stripname_result
5806
	arg=
7182
	arg=
5807
	save_ifs="$IFS"; IFS=','
7183
	save_ifs=$IFS; IFS=,
5808
	for flag in $args; do
7184
	for flag in $args; do
5809
	  IFS="$save_ifs"
7185
	  IFS=$save_ifs
5810
          func_quote_for_eval "$flag"
7186
          func_quote_for_eval "$flag"
5811
	  func_append arg " $wl$func_quote_for_eval_result"
7187
	  func_append arg " $wl$func_quote_for_eval_result"
5812
	  func_append compiler_flags " $wl$func_quote_for_eval_result"
7188
	  func_append compiler_flags " $wl$func_quote_for_eval_result"
5813
	  func_append linker_flags " $func_quote_for_eval_result"
7189
	  func_append linker_flags " $func_quote_for_eval_result"
5814
	done
7190
	done
5815
	IFS="$save_ifs"
7191
	IFS=$save_ifs
5816
	func_stripname ' ' '' "$arg"
7192
	func_stripname ' ' '' "$arg"
5817
	arg=$func_stripname_result
7193
	arg=$func_stripname_result
5818
	;;
7194
	;;
Lines 5835-5841 Link Here
5835
      # -msg_* for osf cc
7211
      # -msg_* for osf cc
5836
      -msg_*)
7212
      -msg_*)
5837
	func_quote_for_eval "$arg"
7213
	func_quote_for_eval "$arg"
5838
	arg="$func_quote_for_eval_result"
7214
	arg=$func_quote_for_eval_result
5839
	;;
7215
	;;
5840
7216
5841
      # Flags to be passed through unchanged, with rationale:
7217
      # Flags to be passed through unchanged, with rationale:
Lines 5847-5861 Link Here
5847
      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
7223
      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
5848
      # -F/path              path to uninstalled frameworks, gcc on darwin
7224
      # -F/path              path to uninstalled frameworks, gcc on darwin
5849
      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
7225
      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
7226
      # -fstack-protector*   stack protector flags for GCC
5850
      # @file                GCC response files
7227
      # @file                GCC response files
5851
      # -tp=*                Portland pgcc target processor selection
7228
      # -tp=*                Portland pgcc target processor selection
5852
      # --sysroot=*          for sysroot support
7229
      # --sysroot=*          for sysroot support
5853
      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7230
      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
7231
      # -stdlib=*            select c++ std lib with clang
5854
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
7232
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
5855
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
7233
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
5856
      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
7234
      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
5857
        func_quote_for_eval "$arg"
7235
        func_quote_for_eval "$arg"
5858
	arg="$func_quote_for_eval_result"
7236
	arg=$func_quote_for_eval_result
5859
        func_append compile_command " $arg"
7237
        func_append compile_command " $arg"
5860
        func_append finalize_command " $arg"
7238
        func_append finalize_command " $arg"
5861
        func_append compiler_flags " $arg"
7239
        func_append compiler_flags " $arg"
Lines 5865-5871 Link Here
5865
      # Some other compiler flag.
7243
      # Some other compiler flag.
5866
      -* | +*)
7244
      -* | +*)
5867
        func_quote_for_eval "$arg"
7245
        func_quote_for_eval "$arg"
5868
	arg="$func_quote_for_eval_result"
7246
	arg=$func_quote_for_eval_result
5869
	;;
7247
	;;
5870
7248
5871
      *.$objext)
7249
      *.$objext)
Lines 5886-5906 Link Here
5886
7264
5887
	  if test -z "$pic_object" ||
7265
	  if test -z "$pic_object" ||
5888
	     test -z "$non_pic_object" ||
7266
	     test -z "$non_pic_object" ||
5889
	     test "$pic_object" = none &&
7267
	     test none = "$pic_object" &&
5890
	     test "$non_pic_object" = none; then
7268
	     test none = "$non_pic_object"; then
5891
	    func_fatal_error "cannot find name of object for \`$arg'"
7269
	    func_fatal_error "cannot find name of object for '$arg'"
5892
	  fi
7270
	  fi
5893
7271
5894
	  # Extract subdirectory from the argument.
7272
	  # Extract subdirectory from the argument.
5895
	  func_dirname "$arg" "/" ""
7273
	  func_dirname "$arg" "/" ""
5896
	  xdir="$func_dirname_result"
7274
	  xdir=$func_dirname_result
5897
7275
5898
	  if test "$pic_object" != none; then
7276
	  test none = "$pic_object" || {
5899
	    # Prepend the subdirectory the object is found in.
7277
	    # Prepend the subdirectory the object is found in.
5900
	    pic_object="$xdir$pic_object"
7278
	    pic_object=$xdir$pic_object
5901
7279
5902
	    if test "$prev" = dlfiles; then
7280
	    if test dlfiles = "$prev"; then
5903
	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
7281
	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
5904
		func_append dlfiles " $pic_object"
7282
		func_append dlfiles " $pic_object"
5905
		prev=
7283
		prev=
5906
		continue
7284
		continue
Lines 5911-5917 Link Here
5911
	    fi
7289
	    fi
5912
7290
5913
	    # CHECK ME:  I think I busted this.  -Ossama
7291
	    # CHECK ME:  I think I busted this.  -Ossama
5914
	    if test "$prev" = dlprefiles; then
7292
	    if test dlprefiles = "$prev"; then
5915
	      # Preload the old-style object.
7293
	      # Preload the old-style object.
5916
	      func_append dlprefiles " $pic_object"
7294
	      func_append dlprefiles " $pic_object"
5917
	      prev=
7295
	      prev=
Lines 5919-5941 Link Here
5919
7297
5920
	    # A PIC object.
7298
	    # A PIC object.
5921
	    func_append libobjs " $pic_object"
7299
	    func_append libobjs " $pic_object"
5922
	    arg="$pic_object"
7300
	    arg=$pic_object
5923
	  fi
7301
	  }
5924
7302
5925
	  # Non-PIC object.
7303
	  # Non-PIC object.
5926
	  if test "$non_pic_object" != none; then
7304
	  if test none != "$non_pic_object"; then
5927
	    # Prepend the subdirectory the object is found in.
7305
	    # Prepend the subdirectory the object is found in.
5928
	    non_pic_object="$xdir$non_pic_object"
7306
	    non_pic_object=$xdir$non_pic_object
5929
7307
5930
	    # A standard non-PIC object
7308
	    # A standard non-PIC object
5931
	    func_append non_pic_objects " $non_pic_object"
7309
	    func_append non_pic_objects " $non_pic_object"
5932
	    if test -z "$pic_object" || test "$pic_object" = none ; then
7310
	    if test -z "$pic_object" || test none = "$pic_object"; then
5933
	      arg="$non_pic_object"
7311
	      arg=$non_pic_object
5934
	    fi
7312
	    fi
5935
	  else
7313
	  else
5936
	    # If the PIC object exists, use it instead.
7314
	    # If the PIC object exists, use it instead.
5937
	    # $xdir was prepended to $pic_object above.
7315
	    # $xdir was prepended to $pic_object above.
5938
	    non_pic_object="$pic_object"
7316
	    non_pic_object=$pic_object
5939
	    func_append non_pic_objects " $non_pic_object"
7317
	    func_append non_pic_objects " $non_pic_object"
5940
	  fi
7318
	  fi
5941
	else
7319
	else
Lines 5943-5949 Link Here
5943
	  if $opt_dry_run; then
7321
	  if $opt_dry_run; then
5944
	    # Extract subdirectory from the argument.
7322
	    # Extract subdirectory from the argument.
5945
	    func_dirname "$arg" "/" ""
7323
	    func_dirname "$arg" "/" ""
5946
	    xdir="$func_dirname_result"
7324
	    xdir=$func_dirname_result
5947
7325
5948
	    func_lo2o "$arg"
7326
	    func_lo2o "$arg"
5949
	    pic_object=$xdir$objdir/$func_lo2o_result
7327
	    pic_object=$xdir$objdir/$func_lo2o_result
Lines 5951-5957 Link Here
5951
	    func_append libobjs " $pic_object"
7329
	    func_append libobjs " $pic_object"
5952
	    func_append non_pic_objects " $non_pic_object"
7330
	    func_append non_pic_objects " $non_pic_object"
5953
	  else
7331
	  else
5954
	    func_fatal_error "\`$arg' is not a valid libtool object"
7332
	    func_fatal_error "'$arg' is not a valid libtool object"
5955
	  fi
7333
	  fi
5956
	fi
7334
	fi
5957
	;;
7335
	;;
Lines 5967-5977 Link Here
5967
	# A libtool-controlled library.
7345
	# A libtool-controlled library.
5968
7346
5969
	func_resolve_sysroot "$arg"
7347
	func_resolve_sysroot "$arg"
5970
	if test "$prev" = dlfiles; then
7348
	if test dlfiles = "$prev"; then
5971
	  # This library was specified with -dlopen.
7349
	  # This library was specified with -dlopen.
5972
	  func_append dlfiles " $func_resolve_sysroot_result"
7350
	  func_append dlfiles " $func_resolve_sysroot_result"
5973
	  prev=
7351
	  prev=
5974
	elif test "$prev" = dlprefiles; then
7352
	elif test dlprefiles = "$prev"; then
5975
	  # The library was specified with -dlpreopen.
7353
	  # The library was specified with -dlpreopen.
5976
	  func_append dlprefiles " $func_resolve_sysroot_result"
7354
	  func_append dlprefiles " $func_resolve_sysroot_result"
5977
	  prev=
7355
	  prev=
Lines 5986-5992 Link Here
5986
	# Unknown arguments in both finalize_command and compile_command need
7364
	# Unknown arguments in both finalize_command and compile_command need
5987
	# to be aesthetically quoted because they are evaled later.
7365
	# to be aesthetically quoted because they are evaled later.
5988
	func_quote_for_eval "$arg"
7366
	func_quote_for_eval "$arg"
5989
	arg="$func_quote_for_eval_result"
7367
	arg=$func_quote_for_eval_result
5990
	;;
7368
	;;
5991
      esac # arg
7369
      esac # arg
5992
7370
Lines 5998-6006 Link Here
5998
    done # argument parsing loop
7376
    done # argument parsing loop
5999
7377
6000
    test -n "$prev" && \
7378
    test -n "$prev" && \
6001
      func_fatal_help "the \`$prevarg' option requires an argument"
7379
      func_fatal_help "the '$prevarg' option requires an argument"
6002
7380
6003
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
7381
    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
6004
      eval arg=\"$export_dynamic_flag_spec\"
7382
      eval arg=\"$export_dynamic_flag_spec\"
6005
      func_append compile_command " $arg"
7383
      func_append compile_command " $arg"
6006
      func_append finalize_command " $arg"
7384
      func_append finalize_command " $arg"
Lines 6009-6020 Link Here
6009
    oldlibs=
7387
    oldlibs=
6010
    # calculate the name of the file, without its directory
7388
    # calculate the name of the file, without its directory
6011
    func_basename "$output"
7389
    func_basename "$output"
6012
    outputname="$func_basename_result"
7390
    outputname=$func_basename_result
6013
    libobjs_save="$libobjs"
7391
    libobjs_save=$libobjs
6014
7392
6015
    if test -n "$shlibpath_var"; then
7393
    if test -n "$shlibpath_var"; then
6016
      # get the directories listed in $shlibpath_var
7394
      # get the directories listed in $shlibpath_var
6017
      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
7395
      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
6018
    else
7396
    else
6019
      shlib_search_path=
7397
      shlib_search_path=
6020
    fi
7398
    fi
Lines 6022-6028 Link Here
6022
    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
7400
    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
6023
7401
6024
    func_dirname "$output" "/" ""
7402
    func_dirname "$output" "/" ""
6025
    output_objdir="$func_dirname_result$objdir"
7403
    output_objdir=$func_dirname_result$objdir
6026
    func_to_tool_file "$output_objdir/"
7404
    func_to_tool_file "$output_objdir/"
6027
    tool_output_objdir=$func_to_tool_file_result
7405
    tool_output_objdir=$func_to_tool_file_result
6028
    # Create the object directory.
7406
    # Create the object directory.
Lines 6045-6051 Link Here
6045
    # Find all interdependent deplibs by searching for libraries
7423
    # Find all interdependent deplibs by searching for libraries
6046
    # that are linked more than once (e.g. -la -lb -la)
7424
    # that are linked more than once (e.g. -la -lb -la)
6047
    for deplib in $deplibs; do
7425
    for deplib in $deplibs; do
6048
      if $opt_preserve_dup_deps ; then
7426
      if $opt_preserve_dup_deps; then
6049
	case "$libs " in
7427
	case "$libs " in
6050
	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
7428
	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
6051
	esac
7429
	esac
Lines 6053-6059 Link Here
6053
      func_append libs " $deplib"
7431
      func_append libs " $deplib"
6054
    done
7432
    done
6055
7433
6056
    if test "$linkmode" = lib; then
7434
    if test lib = "$linkmode"; then
6057
      libs="$predeps $libs $compiler_lib_search_path $postdeps"
7435
      libs="$predeps $libs $compiler_lib_search_path $postdeps"
6058
7436
6059
      # Compute libraries that are listed more than once in $predeps
7437
      # Compute libraries that are listed more than once in $predeps
Lines 6085-6091 Link Here
6085
	  case $file in
7463
	  case $file in
6086
	  *.la) ;;
7464
	  *.la) ;;
6087
	  *)
7465
	  *)
6088
	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
7466
	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
6089
	    ;;
7467
	    ;;
6090
	  esac
7468
	  esac
6091
	done
7469
	done
Lines 6093-6099 Link Here
6093
    prog)
7471
    prog)
6094
	compile_deplibs=
7472
	compile_deplibs=
6095
	finalize_deplibs=
7473
	finalize_deplibs=
6096
	alldeplibs=no
7474
	alldeplibs=false
6097
	newdlfiles=
7475
	newdlfiles=
6098
	newdlprefiles=
7476
	newdlprefiles=
6099
	passes="conv scan dlopen dlpreopen link"
7477
	passes="conv scan dlopen dlpreopen link"
Lines 6105-6133 Link Here
6105
    for pass in $passes; do
7483
    for pass in $passes; do
6106
      # The preopen pass in lib mode reverses $deplibs; put it back here
7484
      # The preopen pass in lib mode reverses $deplibs; put it back here
6107
      # so that -L comes before libs that need it for instance...
7485
      # so that -L comes before libs that need it for instance...
6108
      if test "$linkmode,$pass" = "lib,link"; then
7486
      if test lib,link = "$linkmode,$pass"; then
6109
	## FIXME: Find the place where the list is rebuilt in the wrong
7487
	## FIXME: Find the place where the list is rebuilt in the wrong
6110
	##        order, and fix it there properly
7488
	##        order, and fix it there properly
6111
        tmp_deplibs=
7489
        tmp_deplibs=
6112
	for deplib in $deplibs; do
7490
	for deplib in $deplibs; do
6113
	  tmp_deplibs="$deplib $tmp_deplibs"
7491
	  tmp_deplibs="$deplib $tmp_deplibs"
6114
	done
7492
	done
6115
	deplibs="$tmp_deplibs"
7493
	deplibs=$tmp_deplibs
6116
      fi
7494
      fi
6117
7495
6118
      if test "$linkmode,$pass" = "lib,link" ||
7496
      if test lib,link = "$linkmode,$pass" ||
6119
	 test "$linkmode,$pass" = "prog,scan"; then
7497
	 test prog,scan = "$linkmode,$pass"; then
6120
	libs="$deplibs"
7498
	libs=$deplibs
6121
	deplibs=
7499
	deplibs=
6122
      fi
7500
      fi
6123
      if test "$linkmode" = prog; then
7501
      if test prog = "$linkmode"; then
6124
	case $pass in
7502
	case $pass in
6125
	dlopen) libs="$dlfiles" ;;
7503
	dlopen) libs=$dlfiles ;;
6126
	dlpreopen) libs="$dlprefiles" ;;
7504
	dlpreopen) libs=$dlprefiles ;;
6127
	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
7505
	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
6128
	esac
7506
	esac
6129
      fi
7507
      fi
6130
      if test "$linkmode,$pass" = "lib,dlpreopen"; then
7508
      if test lib,dlpreopen = "$linkmode,$pass"; then
6131
	# Collect and forward deplibs of preopened libtool libs
7509
	# Collect and forward deplibs of preopened libtool libs
6132
	for lib in $dlprefiles; do
7510
	for lib in $dlprefiles; do
6133
	  # Ignore non-libtool-libs
7511
	  # Ignore non-libtool-libs
Lines 6148-6173 Link Here
6148
	    esac
7526
	    esac
6149
	  done
7527
	  done
6150
	done
7528
	done
6151
	libs="$dlprefiles"
7529
	libs=$dlprefiles
6152
      fi
7530
      fi
6153
      if test "$pass" = dlopen; then
7531
      if test dlopen = "$pass"; then
6154
	# Collect dlpreopened libraries
7532
	# Collect dlpreopened libraries
6155
	save_deplibs="$deplibs"
7533
	save_deplibs=$deplibs
6156
	deplibs=
7534
	deplibs=
6157
      fi
7535
      fi
6158
7536
6159
      for deplib in $libs; do
7537
      for deplib in $libs; do
6160
	lib=
7538
	lib=
6161
	found=no
7539
	found=false
6162
	case $deplib in
7540
	case $deplib in
6163
	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
7541
	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
6164
        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
7542
        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6165
	  if test "$linkmode,$pass" = "prog,link"; then
7543
	  if test prog,link = "$linkmode,$pass"; then
6166
	    compile_deplibs="$deplib $compile_deplibs"
7544
	    compile_deplibs="$deplib $compile_deplibs"
6167
	    finalize_deplibs="$deplib $finalize_deplibs"
7545
	    finalize_deplibs="$deplib $finalize_deplibs"
6168
	  else
7546
	  else
6169
	    func_append compiler_flags " $deplib"
7547
	    func_append compiler_flags " $deplib"
6170
	    if test "$linkmode" = lib ; then
7548
	    if test lib = "$linkmode"; then
6171
		case "$new_inherited_linker_flags " in
7549
		case "$new_inherited_linker_flags " in
6172
		    *" $deplib "*) ;;
7550
		    *" $deplib "*) ;;
6173
		    * ) func_append new_inherited_linker_flags " $deplib" ;;
7551
		    * ) func_append new_inherited_linker_flags " $deplib" ;;
Lines 6177-6189 Link Here
6177
	  continue
7555
	  continue
6178
	  ;;
7556
	  ;;
6179
	-l*)
7557
	-l*)
6180
	  if test "$linkmode" != lib && test "$linkmode" != prog; then
7558
	  if test lib != "$linkmode" && test prog != "$linkmode"; then
6181
	    func_warning "\`-l' is ignored for archives/objects"
7559
	    func_warning "'-l' is ignored for archives/objects"
6182
	    continue
7560
	    continue
6183
	  fi
7561
	  fi
6184
	  func_stripname '-l' '' "$deplib"
7562
	  func_stripname '-l' '' "$deplib"
6185
	  name=$func_stripname_result
7563
	  name=$func_stripname_result
6186
	  if test "$linkmode" = lib; then
7564
	  if test lib = "$linkmode"; then
6187
	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
7565
	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
6188
	  else
7566
	  else
6189
	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
7567
	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
Lines 6191-6221 Link Here
6191
	  for searchdir in $searchdirs; do
7569
	  for searchdir in $searchdirs; do
6192
	    for search_ext in .la $std_shrext .so .a; do
7570
	    for search_ext in .la $std_shrext .so .a; do
6193
	      # Search the libtool library
7571
	      # Search the libtool library
6194
	      lib="$searchdir/lib${name}${search_ext}"
7572
	      lib=$searchdir/lib$name$search_ext
6195
	      if test -f "$lib"; then
7573
	      if test -f "$lib"; then
6196
		if test "$search_ext" = ".la"; then
7574
		if test .la = "$search_ext"; then
6197
		  found=yes
7575
		  found=:
6198
		else
7576
		else
6199
		  found=no
7577
		  found=false
6200
		fi
7578
		fi
6201
		break 2
7579
		break 2
6202
	      fi
7580
	      fi
6203
	    done
7581
	    done
6204
	  done
7582
	  done
6205
	  if test "$found" != yes; then
7583
	  if $found; then
6206
	    # deplib doesn't seem to be a libtool library
7584
	    # deplib is a libtool library
6207
	    if test "$linkmode,$pass" = "prog,link"; then
6208
	      compile_deplibs="$deplib $compile_deplibs"
6209
	      finalize_deplibs="$deplib $finalize_deplibs"
6210
	    else
6211
	      deplibs="$deplib $deplibs"
6212
	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6213
	    fi
6214
	    continue
6215
	  else # deplib is a libtool library
6216
	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
7585
	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
6217
	    # We need to do some special things here, and not later.
7586
	    # We need to do some special things here, and not later.
6218
	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
7587
	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
6219
	      case " $predeps $postdeps " in
7588
	      case " $predeps $postdeps " in
6220
	      *" $deplib "*)
7589
	      *" $deplib "*)
6221
		if func_lalib_p "$lib"; then
7590
		if func_lalib_p "$lib"; then
Lines 6223-6241 Link Here
6223
		  old_library=
7592
		  old_library=
6224
		  func_source "$lib"
7593
		  func_source "$lib"
6225
		  for l in $old_library $library_names; do
7594
		  for l in $old_library $library_names; do
6226
		    ll="$l"
7595
		    ll=$l
6227
		  done
7596
		  done
6228
		  if test "X$ll" = "X$old_library" ; then # only static version available
7597
		  if test "X$ll" = "X$old_library"; then # only static version available
6229
		    found=no
7598
		    found=false
6230
		    func_dirname "$lib" "" "."
7599
		    func_dirname "$lib" "" "."
6231
		    ladir="$func_dirname_result"
7600
		    ladir=$func_dirname_result
6232
		    lib=$ladir/$old_library
7601
		    lib=$ladir/$old_library
6233
		    if test "$linkmode,$pass" = "prog,link"; then
7602
		    if test prog,link = "$linkmode,$pass"; then
6234
		      compile_deplibs="$deplib $compile_deplibs"
7603
		      compile_deplibs="$deplib $compile_deplibs"
6235
		      finalize_deplibs="$deplib $finalize_deplibs"
7604
		      finalize_deplibs="$deplib $finalize_deplibs"
6236
		    else
7605
		    else
6237
		      deplibs="$deplib $deplibs"
7606
		      deplibs="$deplib $deplibs"
6238
		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
7607
		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
6239
		    fi
7608
		    fi
6240
		    continue
7609
		    continue
6241
		  fi
7610
		  fi
Lines 6244-6258 Link Here
6244
	      *) ;;
7613
	      *) ;;
6245
	      esac
7614
	      esac
6246
	    fi
7615
	    fi
7616
	  else
7617
	    # deplib doesn't seem to be a libtool library
7618
	    if test prog,link = "$linkmode,$pass"; then
7619
	      compile_deplibs="$deplib $compile_deplibs"
7620
	      finalize_deplibs="$deplib $finalize_deplibs"
7621
	    else
7622
	      deplibs="$deplib $deplibs"
7623
	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
7624
	    fi
7625
	    continue
6247
	  fi
7626
	  fi
6248
	  ;; # -l
7627
	  ;; # -l
6249
	*.ltframework)
7628
	*.ltframework)
6250
	  if test "$linkmode,$pass" = "prog,link"; then
7629
	  if test prog,link = "$linkmode,$pass"; then
6251
	    compile_deplibs="$deplib $compile_deplibs"
7630
	    compile_deplibs="$deplib $compile_deplibs"
6252
	    finalize_deplibs="$deplib $finalize_deplibs"
7631
	    finalize_deplibs="$deplib $finalize_deplibs"
6253
	  else
7632
	  else
6254
	    deplibs="$deplib $deplibs"
7633
	    deplibs="$deplib $deplibs"
6255
	    if test "$linkmode" = lib ; then
7634
	    if test lib = "$linkmode"; then
6256
		case "$new_inherited_linker_flags " in
7635
		case "$new_inherited_linker_flags " in
6257
		    *" $deplib "*) ;;
7636
		    *" $deplib "*) ;;
6258
		    * ) func_append new_inherited_linker_flags " $deplib" ;;
7637
		    * ) func_append new_inherited_linker_flags " $deplib" ;;
Lines 6265-6282 Link Here
6265
	  case $linkmode in
7644
	  case $linkmode in
6266
	  lib)
7645
	  lib)
6267
	    deplibs="$deplib $deplibs"
7646
	    deplibs="$deplib $deplibs"
6268
	    test "$pass" = conv && continue
7647
	    test conv = "$pass" && continue
6269
	    newdependency_libs="$deplib $newdependency_libs"
7648
	    newdependency_libs="$deplib $newdependency_libs"
6270
	    func_stripname '-L' '' "$deplib"
7649
	    func_stripname '-L' '' "$deplib"
6271
	    func_resolve_sysroot "$func_stripname_result"
7650
	    func_resolve_sysroot "$func_stripname_result"
6272
	    func_append newlib_search_path " $func_resolve_sysroot_result"
7651
	    func_append newlib_search_path " $func_resolve_sysroot_result"
6273
	    ;;
7652
	    ;;
6274
	  prog)
7653
	  prog)
6275
	    if test "$pass" = conv; then
7654
	    if test conv = "$pass"; then
6276
	      deplibs="$deplib $deplibs"
7655
	      deplibs="$deplib $deplibs"
6277
	      continue
7656
	      continue
6278
	    fi
7657
	    fi
6279
	    if test "$pass" = scan; then
7658
	    if test scan = "$pass"; then
6280
	      deplibs="$deplib $deplibs"
7659
	      deplibs="$deplib $deplibs"
6281
	    else
7660
	    else
6282
	      compile_deplibs="$deplib $compile_deplibs"
7661
	      compile_deplibs="$deplib $compile_deplibs"
Lines 6287-6299 Link Here
6287
	    func_append newlib_search_path " $func_resolve_sysroot_result"
7666
	    func_append newlib_search_path " $func_resolve_sysroot_result"
6288
	    ;;
7667
	    ;;
6289
	  *)
7668
	  *)
6290
	    func_warning "\`-L' is ignored for archives/objects"
7669
	    func_warning "'-L' is ignored for archives/objects"
6291
	    ;;
7670
	    ;;
6292
	  esac # linkmode
7671
	  esac # linkmode
6293
	  continue
7672
	  continue
6294
	  ;; # -L
7673
	  ;; # -L
6295
	-R*)
7674
	-R*)
6296
	  if test "$pass" = link; then
7675
	  if test link = "$pass"; then
6297
	    func_stripname '-R' '' "$deplib"
7676
	    func_stripname '-R' '' "$deplib"
6298
	    func_resolve_sysroot "$func_stripname_result"
7677
	    func_resolve_sysroot "$func_stripname_result"
6299
	    dir=$func_resolve_sysroot_result
7678
	    dir=$func_resolve_sysroot_result
Lines 6311-6317 Link Here
6311
	  lib=$func_resolve_sysroot_result
7690
	  lib=$func_resolve_sysroot_result
6312
	  ;;
7691
	  ;;
6313
	*.$libext)
7692
	*.$libext)
6314
	  if test "$pass" = conv; then
7693
	  if test conv = "$pass"; then
6315
	    deplibs="$deplib $deplibs"
7694
	    deplibs="$deplib $deplibs"
6316
	    continue
7695
	    continue
6317
	  fi
7696
	  fi
Lines 6322-6342 Link Here
6322
	    case " $dlpreconveniencelibs " in
7701
	    case " $dlpreconveniencelibs " in
6323
	    *" $deplib "*) ;;
7702
	    *" $deplib "*) ;;
6324
	    *)
7703
	    *)
6325
	      valid_a_lib=no
7704
	      valid_a_lib=false
6326
	      case $deplibs_check_method in
7705
	      case $deplibs_check_method in
6327
		match_pattern*)
7706
		match_pattern*)
6328
		  set dummy $deplibs_check_method; shift
7707
		  set dummy $deplibs_check_method; shift
6329
		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
7708
		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6330
		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
7709
		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6331
		    | $EGREP "$match_pattern_regex" > /dev/null; then
7710
		    | $EGREP "$match_pattern_regex" > /dev/null; then
6332
		    valid_a_lib=yes
7711
		    valid_a_lib=:
6333
		  fi
7712
		  fi
6334
		;;
7713
		;;
6335
		pass_all)
7714
		pass_all)
6336
		  valid_a_lib=yes
7715
		  valid_a_lib=:
6337
		;;
7716
		;;
6338
	      esac
7717
	      esac
6339
	      if test "$valid_a_lib" != yes; then
7718
	      if $valid_a_lib; then
7719
		echo
7720
		$ECHO "*** Warning: Linking the shared library $output against the"
7721
		$ECHO "*** static library $deplib is not portable!"
7722
		deplibs="$deplib $deplibs"
7723
	      else
6340
		echo
7724
		echo
6341
		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
7725
		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
6342
		echo "*** I have the capability to make that library automatically link in when"
7726
		echo "*** I have the capability to make that library automatically link in when"
Lines 6344-6361 Link Here
6344
		echo "*** shared version of the library, which you do not appear to have"
7728
		echo "*** shared version of the library, which you do not appear to have"
6345
		echo "*** because the file extensions .$libext of this argument makes me believe"
7729
		echo "*** because the file extensions .$libext of this argument makes me believe"
6346
		echo "*** that it is just a static archive that I should not use here."
7730
		echo "*** that it is just a static archive that I should not use here."
6347
	      else
6348
		echo
6349
		$ECHO "*** Warning: Linking the shared library $output against the"
6350
		$ECHO "*** static library $deplib is not portable!"
6351
		deplibs="$deplib $deplibs"
6352
	      fi
7731
	      fi
6353
	      ;;
7732
	      ;;
6354
	    esac
7733
	    esac
6355
	    continue
7734
	    continue
6356
	    ;;
7735
	    ;;
6357
	  prog)
7736
	  prog)
6358
	    if test "$pass" != link; then
7737
	    if test link != "$pass"; then
6359
	      deplibs="$deplib $deplibs"
7738
	      deplibs="$deplib $deplibs"
6360
	    else
7739
	    else
6361
	      compile_deplibs="$deplib $compile_deplibs"
7740
	      compile_deplibs="$deplib $compile_deplibs"
Lines 6366-6375 Link Here
6366
	  esac # linkmode
7745
	  esac # linkmode
6367
	  ;; # *.$libext
7746
	  ;; # *.$libext
6368
	*.lo | *.$objext)
7747
	*.lo | *.$objext)
6369
	  if test "$pass" = conv; then
7748
	  if test conv = "$pass"; then
6370
	    deplibs="$deplib $deplibs"
7749
	    deplibs="$deplib $deplibs"
6371
	  elif test "$linkmode" = prog; then
7750
	  elif test prog = "$linkmode"; then
6372
	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
7751
	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
6373
	      # If there is no dlopen support or we're linking statically,
7752
	      # If there is no dlopen support or we're linking statically,
6374
	      # we need to preload.
7753
	      # we need to preload.
6375
	      func_append newdlprefiles " $deplib"
7754
	      func_append newdlprefiles " $deplib"
Lines 6382-6403 Link Here
6382
	  continue
7761
	  continue
6383
	  ;;
7762
	  ;;
6384
	%DEPLIBS%)
7763
	%DEPLIBS%)
6385
	  alldeplibs=yes
7764
	  alldeplibs=:
6386
	  continue
7765
	  continue
6387
	  ;;
7766
	  ;;
6388
	esac # case $deplib
7767
	esac # case $deplib
6389
7768
6390
	if test "$found" = yes || test -f "$lib"; then :
7769
	$found || test -f "$lib" \
6391
	else
7770
	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
6392
	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6393
	fi
6394
7771
6395
	# Check to see that this really is a libtool archive.
7772
	# Check to see that this really is a libtool archive.
6396
	func_lalib_unsafe_p "$lib" \
7773
	func_lalib_unsafe_p "$lib" \
6397
	  || func_fatal_error "\`$lib' is not a valid libtool archive"
7774
	  || func_fatal_error "'$lib' is not a valid libtool archive"
6398
7775
6399
	func_dirname "$lib" "" "."
7776
	func_dirname "$lib" "" "."
6400
	ladir="$func_dirname_result"
7777
	ladir=$func_dirname_result
6401
7778
6402
	dlname=
7779
	dlname=
6403
	dlopen=
7780
	dlopen=
Lines 6427-6456 Link Here
6427
	  done
7804
	  done
6428
	fi
7805
	fi
6429
	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7806
	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6430
	if test "$linkmode,$pass" = "lib,link" ||
7807
	if test lib,link = "$linkmode,$pass" ||
6431
	   test "$linkmode,$pass" = "prog,scan" ||
7808
	   test prog,scan = "$linkmode,$pass" ||
6432
	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
7809
	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
6433
	  test -n "$dlopen" && func_append dlfiles " $dlopen"
7810
	  test -n "$dlopen" && func_append dlfiles " $dlopen"
6434
	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
7811
	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
6435
	fi
7812
	fi
6436
7813
6437
	if test "$pass" = conv; then
7814
	if test conv = "$pass"; then
6438
	  # Only check for convenience libraries
7815
	  # Only check for convenience libraries
6439
	  deplibs="$lib $deplibs"
7816
	  deplibs="$lib $deplibs"
6440
	  if test -z "$libdir"; then
7817
	  if test -z "$libdir"; then
6441
	    if test -z "$old_library"; then
7818
	    if test -z "$old_library"; then
6442
	      func_fatal_error "cannot find name of link library for \`$lib'"
7819
	      func_fatal_error "cannot find name of link library for '$lib'"
6443
	    fi
7820
	    fi
6444
	    # It is a libtool convenience library, so add in its objects.
7821
	    # It is a libtool convenience library, so add in its objects.
6445
	    func_append convenience " $ladir/$objdir/$old_library"
7822
	    func_append convenience " $ladir/$objdir/$old_library"
6446
	    func_append old_convenience " $ladir/$objdir/$old_library"
7823
	    func_append old_convenience " $ladir/$objdir/$old_library"
6447
	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
7824
	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
6448
	    func_fatal_error "\`$lib' is not a convenience library"
7825
	    func_fatal_error "'$lib' is not a convenience library"
6449
	  fi
7826
	  fi
6450
	  tmp_libs=
7827
	  tmp_libs=
6451
	  for deplib in $dependency_libs; do
7828
	  for deplib in $dependency_libs; do
6452
	    deplibs="$deplib $deplibs"
7829
	    deplibs="$deplib $deplibs"
6453
	    if $opt_preserve_dup_deps ; then
7830
	    if $opt_preserve_dup_deps; then
6454
	      case "$tmp_libs " in
7831
	      case "$tmp_libs " in
6455
	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
7832
	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6456
	      esac
7833
	      esac
Lines 6464-6489 Link Here
6464
	# Get the name of the library we link against.
7841
	# Get the name of the library we link against.
6465
	linklib=
7842
	linklib=
6466
	if test -n "$old_library" &&
7843
	if test -n "$old_library" &&
6467
	   { test "$prefer_static_libs" = yes ||
7844
	   { test yes = "$prefer_static_libs" ||
6468
	     test "$prefer_static_libs,$installed" = "built,no"; }; then
7845
	     test built,no = "$prefer_static_libs,$installed"; }; then
6469
	  linklib=$old_library
7846
	  linklib=$old_library
6470
	else
7847
	else
6471
	  for l in $old_library $library_names; do
7848
	  for l in $old_library $library_names; do
6472
	    linklib="$l"
7849
	    linklib=$l
6473
	  done
7850
	  done
6474
	fi
7851
	fi
6475
	if test -z "$linklib"; then
7852
	if test -z "$linklib"; then
6476
	  func_fatal_error "cannot find name of link library for \`$lib'"
7853
	  func_fatal_error "cannot find name of link library for '$lib'"
6477
	fi
7854
	fi
6478
7855
6479
	# This library was specified with -dlopen.
7856
	# This library was specified with -dlopen.
6480
	if test "$pass" = dlopen; then
7857
	if test dlopen = "$pass"; then
6481
	  if test -z "$libdir"; then
7858
	  test -z "$libdir" \
6482
	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
7859
	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
6483
	  fi
6484
	  if test -z "$dlname" ||
7860
	  if test -z "$dlname" ||
6485
	     test "$dlopen_support" != yes ||
7861
	     test yes != "$dlopen_support" ||
6486
	     test "$build_libtool_libs" = no; then
7862
	     test no = "$build_libtool_libs"
7863
	  then
6487
	    # If there is no dlname, no dlopen support or we're linking
7864
	    # If there is no dlname, no dlopen support or we're linking
6488
	    # statically, we need to preload.  We also need to preload any
7865
	    # statically, we need to preload.  We also need to preload any
6489
	    # dependent libraries so libltdl's deplib preloader doesn't
7866
	    # dependent libraries so libltdl's deplib preloader doesn't
Lines 6497-6536 Link Here
6497
7874
6498
	# We need an absolute path.
7875
	# We need an absolute path.
6499
	case $ladir in
7876
	case $ladir in
6500
	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
7877
	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
6501
	*)
7878
	*)
6502
	  abs_ladir=`cd "$ladir" && pwd`
7879
	  abs_ladir=`cd "$ladir" && pwd`
6503
	  if test -z "$abs_ladir"; then
7880
	  if test -z "$abs_ladir"; then
6504
	    func_warning "cannot determine absolute directory name of \`$ladir'"
7881
	    func_warning "cannot determine absolute directory name of '$ladir'"
6505
	    func_warning "passing it literally to the linker, although it might fail"
7882
	    func_warning "passing it literally to the linker, although it might fail"
6506
	    abs_ladir="$ladir"
7883
	    abs_ladir=$ladir
6507
	  fi
7884
	  fi
6508
	  ;;
7885
	  ;;
6509
	esac
7886
	esac
6510
	func_basename "$lib"
7887
	func_basename "$lib"
6511
	laname="$func_basename_result"
7888
	laname=$func_basename_result
6512
7889
6513
	# Find the relevant object directory and library name.
7890
	# Find the relevant object directory and library name.
6514
	if test "X$installed" = Xyes; then
7891
	if test yes = "$installed"; then
6515
	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
7892
	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6516
	    func_warning "library \`$lib' was moved."
7893
	    func_warning "library '$lib' was moved."
6517
	    dir="$ladir"
7894
	    dir=$ladir
6518
	    absdir="$abs_ladir"
7895
	    absdir=$abs_ladir
6519
	    libdir="$abs_ladir"
7896
	    libdir=$abs_ladir
6520
	  else
7897
	  else
6521
	    dir="$lt_sysroot$libdir"
7898
	    dir=$lt_sysroot$libdir
6522
	    absdir="$lt_sysroot$libdir"
7899
	    absdir=$lt_sysroot$libdir
6523
	  fi
7900
	  fi
6524
	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
7901
	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
6525
	else
7902
	else
6526
	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
7903
	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6527
	    dir="$ladir"
7904
	    dir=$ladir
6528
	    absdir="$abs_ladir"
7905
	    absdir=$abs_ladir
6529
	    # Remove this search path later
7906
	    # Remove this search path later
6530
	    func_append notinst_path " $abs_ladir"
7907
	    func_append notinst_path " $abs_ladir"
6531
	  else
7908
	  else
6532
	    dir="$ladir/$objdir"
7909
	    dir=$ladir/$objdir
6533
	    absdir="$abs_ladir/$objdir"
7910
	    absdir=$abs_ladir/$objdir
6534
	    # Remove this search path later
7911
	    # Remove this search path later
6535
	    func_append notinst_path " $abs_ladir"
7912
	    func_append notinst_path " $abs_ladir"
6536
	  fi
7913
	  fi
Lines 6539-6549 Link Here
6539
	name=$func_stripname_result
7916
	name=$func_stripname_result
6540
7917
6541
	# This library was specified with -dlpreopen.
7918
	# This library was specified with -dlpreopen.
6542
	if test "$pass" = dlpreopen; then
7919
	if test dlpreopen = "$pass"; then
6543
	  if test -z "$libdir" && test "$linkmode" = prog; then
7920
	  if test -z "$libdir" && test prog = "$linkmode"; then
6544
	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
7921
	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
6545
	  fi
7922
	  fi
6546
	  case "$host" in
7923
	  case $host in
6547
	    # special handling for platforms with PE-DLLs.
7924
	    # special handling for platforms with PE-DLLs.
6548
	    *cygwin* | *mingw* | *cegcc* )
7925
	    *cygwin* | *mingw* | *cegcc* )
6549
	      # Linker will automatically link against shared library if both
7926
	      # Linker will automatically link against shared library if both
Lines 6587-6595 Link Here
6587
7964
6588
	if test -z "$libdir"; then
7965
	if test -z "$libdir"; then
6589
	  # Link the convenience library
7966
	  # Link the convenience library
6590
	  if test "$linkmode" = lib; then
7967
	  if test lib = "$linkmode"; then
6591
	    deplibs="$dir/$old_library $deplibs"
7968
	    deplibs="$dir/$old_library $deplibs"
6592
	  elif test "$linkmode,$pass" = "prog,link"; then
7969
	  elif test prog,link = "$linkmode,$pass"; then
6593
	    compile_deplibs="$dir/$old_library $compile_deplibs"
7970
	    compile_deplibs="$dir/$old_library $compile_deplibs"
6594
	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
7971
	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
6595
	  else
7972
	  else
Lines 6599-6612 Link Here
6599
	fi
7976
	fi
6600
7977
6601
7978
6602
	if test "$linkmode" = prog && test "$pass" != link; then
7979
	if test prog = "$linkmode" && test link != "$pass"; then
6603
	  func_append newlib_search_path " $ladir"
7980
	  func_append newlib_search_path " $ladir"
6604
	  deplibs="$lib $deplibs"
7981
	  deplibs="$lib $deplibs"
6605
7982
6606
	  linkalldeplibs=no
7983
	  linkalldeplibs=false
6607
	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
7984
	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
6608
	     test "$build_libtool_libs" = no; then
7985
	     test no = "$build_libtool_libs"; then
6609
	    linkalldeplibs=yes
7986
	    linkalldeplibs=:
6610
	  fi
7987
	  fi
6611
7988
6612
	  tmp_libs=
7989
	  tmp_libs=
Lines 6618-6631 Link Here
6618
		 ;;
7995
		 ;;
6619
	    esac
7996
	    esac
6620
	    # Need to link against all dependency_libs?
7997
	    # Need to link against all dependency_libs?
6621
	    if test "$linkalldeplibs" = yes; then
7998
	    if $linkalldeplibs; then
6622
	      deplibs="$deplib $deplibs"
7999
	      deplibs="$deplib $deplibs"
6623
	    else
8000
	    else
6624
	      # Need to hardcode shared library paths
8001
	      # Need to hardcode shared library paths
6625
	      # or/and link against static libraries
8002
	      # or/and link against static libraries
6626
	      newdependency_libs="$deplib $newdependency_libs"
8003
	      newdependency_libs="$deplib $newdependency_libs"
6627
	    fi
8004
	    fi
6628
	    if $opt_preserve_dup_deps ; then
8005
	    if $opt_preserve_dup_deps; then
6629
	      case "$tmp_libs " in
8006
	      case "$tmp_libs " in
6630
	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
8007
	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
6631
	      esac
8008
	      esac
Lines 6635-6649 Link Here
6635
	  continue
8012
	  continue
6636
	fi # $linkmode = prog...
8013
	fi # $linkmode = prog...
6637
8014
6638
	if test "$linkmode,$pass" = "prog,link"; then
8015
	if test prog,link = "$linkmode,$pass"; then
6639
	  if test -n "$library_names" &&
8016
	  if test -n "$library_names" &&
6640
	     { { test "$prefer_static_libs" = no ||
8017
	     { { test no = "$prefer_static_libs" ||
6641
	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
8018
	         test built,yes = "$prefer_static_libs,$installed"; } ||
6642
	       test -z "$old_library"; }; then
8019
	       test -z "$old_library"; }; then
6643
	    # We need to hardcode the library path
8020
	    # We need to hardcode the library path
6644
	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
8021
	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
6645
	      # Make sure the rpath contains only unique directories.
8022
	      # Make sure the rpath contains only unique directories.
6646
	      case "$temp_rpath:" in
8023
	      case $temp_rpath: in
6647
	      *"$absdir:"*) ;;
8024
	      *"$absdir:"*) ;;
6648
	      *) func_append temp_rpath "$absdir:" ;;
8025
	      *) func_append temp_rpath "$absdir:" ;;
6649
	      esac
8026
	      esac
Lines 6672-6680 Link Here
6672
	    esac
8049
	    esac
6673
	  fi # $linkmode,$pass = prog,link...
8050
	  fi # $linkmode,$pass = prog,link...
6674
8051
6675
	  if test "$alldeplibs" = yes &&
8052
	  if $alldeplibs &&
6676
	     { test "$deplibs_check_method" = pass_all ||
8053
	     { test pass_all = "$deplibs_check_method" ||
6677
	       { test "$build_libtool_libs" = yes &&
8054
	       { test yes = "$build_libtool_libs" &&
6678
		 test -n "$library_names"; }; }; then
8055
		 test -n "$library_names"; }; }; then
6679
	    # We only need to search for static libraries
8056
	    # We only need to search for static libraries
6680
	    continue
8057
	    continue
Lines 6683-6693 Link Here
6683
8060
6684
	link_static=no # Whether the deplib will be linked statically
8061
	link_static=no # Whether the deplib will be linked statically
6685
	use_static_libs=$prefer_static_libs
8062
	use_static_libs=$prefer_static_libs
6686
	if test "$use_static_libs" = built && test "$installed" = yes; then
8063
	if test built = "$use_static_libs" && test yes = "$installed"; then
6687
	  use_static_libs=no
8064
	  use_static_libs=no
6688
	fi
8065
	fi
6689
	if test -n "$library_names" &&
8066
	if test -n "$library_names" &&
6690
	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
8067
	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
6691
	  case $host in
8068
	  case $host in
6692
	  *cygwin* | *mingw* | *cegcc*)
8069
	  *cygwin* | *mingw* | *cegcc*)
6693
	      # No point in relinking DLLs because paths are not encoded
8070
	      # No point in relinking DLLs because paths are not encoded
Lines 6695-6701 Link Here
6695
	      need_relink=no
8072
	      need_relink=no
6696
	    ;;
8073
	    ;;
6697
	  *)
8074
	  *)
6698
	    if test "$installed" = no; then
8075
	    if test no = "$installed"; then
6699
	      func_append notinst_deplibs " $lib"
8076
	      func_append notinst_deplibs " $lib"
6700
	      need_relink=yes
8077
	      need_relink=yes
6701
	    fi
8078
	    fi
Lines 6705-6728 Link Here
6705
8082
6706
	  # Warn about portability, can't link against -module's on some
8083
	  # Warn about portability, can't link against -module's on some
6707
	  # systems (darwin).  Don't bleat about dlopened modules though!
8084
	  # systems (darwin).  Don't bleat about dlopened modules though!
6708
	  dlopenmodule=""
8085
	  dlopenmodule=
6709
	  for dlpremoduletest in $dlprefiles; do
8086
	  for dlpremoduletest in $dlprefiles; do
6710
	    if test "X$dlpremoduletest" = "X$lib"; then
8087
	    if test "X$dlpremoduletest" = "X$lib"; then
6711
	      dlopenmodule="$dlpremoduletest"
8088
	      dlopenmodule=$dlpremoduletest
6712
	      break
8089
	      break
6713
	    fi
8090
	    fi
6714
	  done
8091
	  done
6715
	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
8092
	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
6716
	    echo
8093
	    echo
6717
	    if test "$linkmode" = prog; then
8094
	    if test prog = "$linkmode"; then
6718
	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
8095
	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
6719
	    else
8096
	    else
6720
	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
8097
	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
6721
	    fi
8098
	    fi
6722
	    $ECHO "*** $linklib is not portable!"
8099
	    $ECHO "*** $linklib is not portable!"
6723
	  fi
8100
	  fi
6724
	  if test "$linkmode" = lib &&
8101
	  if test lib = "$linkmode" &&
6725
	     test "$hardcode_into_libs" = yes; then
8102
	     test yes = "$hardcode_into_libs"; then
6726
	    # Hardcode the library path.
8103
	    # Hardcode the library path.
6727
	    # Skip directories that are in the system default run-time
8104
	    # Skip directories that are in the system default run-time
6728
	    # search path.
8105
	    # search path.
Lines 6750-6792 Link Here
6750
	    # figure out the soname
8127
	    # figure out the soname
6751
	    set dummy $library_names
8128
	    set dummy $library_names
6752
	    shift
8129
	    shift
6753
	    realname="$1"
8130
	    realname=$1
6754
	    shift
8131
	    shift
6755
	    libname=`eval "\\$ECHO \"$libname_spec\""`
8132
	    libname=`eval "\\$ECHO \"$libname_spec\""`
6756
	    # use dlname if we got it. it's perfectly good, no?
8133
	    # use dlname if we got it. it's perfectly good, no?
6757
	    if test -n "$dlname"; then
8134
	    if test -n "$dlname"; then
6758
	      soname="$dlname"
8135
	      soname=$dlname
6759
	    elif test -n "$soname_spec"; then
8136
	    elif test -n "$soname_spec"; then
6760
	      # bleh windows
8137
	      # bleh windows
6761
	      case $host in
8138
	      case $host in
6762
	      *cygwin* | mingw* | *cegcc*)
8139
	      *cygwin* | mingw* | *cegcc*)
6763
	        func_arith $current - $age
8140
	        func_arith $current - $age
6764
		major=$func_arith_result
8141
		major=$func_arith_result
6765
		versuffix="-$major"
8142
		versuffix=-$major
6766
		;;
8143
		;;
6767
	      esac
8144
	      esac
6768
	      eval soname=\"$soname_spec\"
8145
	      eval soname=\"$soname_spec\"
6769
	    else
8146
	    else
6770
	      soname="$realname"
8147
	      soname=$realname
6771
	    fi
8148
	    fi
6772
8149
6773
	    # Make a new name for the extract_expsyms_cmds to use
8150
	    # Make a new name for the extract_expsyms_cmds to use
6774
	    soroot="$soname"
8151
	    soroot=$soname
6775
	    func_basename "$soroot"
8152
	    func_basename "$soroot"
6776
	    soname="$func_basename_result"
8153
	    soname=$func_basename_result
6777
	    func_stripname 'lib' '.dll' "$soname"
8154
	    func_stripname 'lib' '.dll' "$soname"
6778
	    newlib=libimp-$func_stripname_result.a
8155
	    newlib=libimp-$func_stripname_result.a
6779
8156
6780
	    # If the library has no export list, then create one now
8157
	    # If the library has no export list, then create one now
6781
	    if test -f "$output_objdir/$soname-def"; then :
8158
	    if test -f "$output_objdir/$soname-def"; then :
6782
	    else
8159
	    else
6783
	      func_verbose "extracting exported symbol list from \`$soname'"
8160
	      func_verbose "extracting exported symbol list from '$soname'"
6784
	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
8161
	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
6785
	    fi
8162
	    fi
6786
8163
6787
	    # Create $newlib
8164
	    # Create $newlib
6788
	    if test -f "$output_objdir/$newlib"; then :; else
8165
	    if test -f "$output_objdir/$newlib"; then :; else
6789
	      func_verbose "generating import library for \`$soname'"
8166
	      func_verbose "generating import library for '$soname'"
6790
	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
8167
	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
6791
	    fi
8168
	    fi
6792
	    # make sure the library variables are pointing to the new library
8169
	    # make sure the library variables are pointing to the new library
Lines 6794-6851 Link Here
6794
	    linklib=$newlib
8171
	    linklib=$newlib
6795
	  fi # test -n "$old_archive_from_expsyms_cmds"
8172
	  fi # test -n "$old_archive_from_expsyms_cmds"
6796
8173
6797
	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
8174
	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
6798
	    add_shlibpath=
8175
	    add_shlibpath=
6799
	    add_dir=
8176
	    add_dir=
6800
	    add=
8177
	    add=
6801
	    lib_linked=yes
8178
	    lib_linked=yes
6802
	    case $hardcode_action in
8179
	    case $hardcode_action in
6803
	    immediate | unsupported)
8180
	    immediate | unsupported)
6804
	      if test "$hardcode_direct" = no; then
8181
	      if test no = "$hardcode_direct"; then
6805
		add="$dir/$linklib"
8182
		add=$dir/$linklib
6806
		case $host in
8183
		case $host in
6807
		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
8184
		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
6808
		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
8185
		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
6809
		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
8186
		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
6810
		    *-*-unixware7*) add_dir="-L$dir" ;;
8187
		    *-*-unixware7*) add_dir=-L$dir ;;
6811
		  *-*-darwin* )
8188
		  *-*-darwin* )
6812
		    # if the lib is a (non-dlopened) module then we can not
8189
		    # if the lib is a (non-dlopened) module then we cannot
6813
		    # link against it, someone is ignoring the earlier warnings
8190
		    # link against it, someone is ignoring the earlier warnings
6814
		    if /usr/bin/file -L $add 2> /dev/null |
8191
		    if /usr/bin/file -L $add 2> /dev/null |
6815
			 $GREP ": [^:]* bundle" >/dev/null ; then
8192
			 $GREP ": [^:]* bundle" >/dev/null; then
6816
		      if test "X$dlopenmodule" != "X$lib"; then
8193
		      if test "X$dlopenmodule" != "X$lib"; then
6817
			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
8194
			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
6818
			if test -z "$old_library" ; then
8195
			if test -z "$old_library"; then
6819
			  echo
8196
			  echo
6820
			  echo "*** And there doesn't seem to be a static archive available"
8197
			  echo "*** And there doesn't seem to be a static archive available"
6821
			  echo "*** The link will probably fail, sorry"
8198
			  echo "*** The link will probably fail, sorry"
6822
			else
8199
			else
6823
			  add="$dir/$old_library"
8200
			  add=$dir/$old_library
6824
			fi
8201
			fi
6825
		      elif test -n "$old_library"; then
8202
		      elif test -n "$old_library"; then
6826
			add="$dir/$old_library"
8203
			add=$dir/$old_library
6827
		      fi
8204
		      fi
6828
		    fi
8205
		    fi
6829
		esac
8206
		esac
6830
	      elif test "$hardcode_minus_L" = no; then
8207
	      elif test no = "$hardcode_minus_L"; then
6831
		case $host in
8208
		case $host in
6832
		*-*-sunos*) add_shlibpath="$dir" ;;
8209
		*-*-sunos*) add_shlibpath=$dir ;;
6833
		esac
8210
		esac
6834
		add_dir="-L$dir"
8211
		add_dir=-L$dir
6835
		add="-l$name"
8212
		add=-l$name
6836
	      elif test "$hardcode_shlibpath_var" = no; then
8213
	      elif test no = "$hardcode_shlibpath_var"; then
6837
		add_shlibpath="$dir"
8214
		add_shlibpath=$dir
6838
		add="-l$name"
8215
		add=-l$name
6839
	      else
8216
	      else
6840
		lib_linked=no
8217
		lib_linked=no
6841
	      fi
8218
	      fi
6842
	      ;;
8219
	      ;;
6843
	    relink)
8220
	    relink)
6844
	      if test "$hardcode_direct" = yes &&
8221
	      if test yes = "$hardcode_direct" &&
6845
	         test "$hardcode_direct_absolute" = no; then
8222
	         test no = "$hardcode_direct_absolute"; then
6846
		add="$dir/$linklib"
8223
		add=$dir/$linklib
6847
	      elif test "$hardcode_minus_L" = yes; then
8224
	      elif test yes = "$hardcode_minus_L"; then
6848
		add_dir="-L$absdir"
8225
		add_dir=-L$absdir
6849
		# Try looking first in the location we're being installed to.
8226
		# Try looking first in the location we're being installed to.
6850
		if test -n "$inst_prefix_dir"; then
8227
		if test -n "$inst_prefix_dir"; then
6851
		  case $libdir in
8228
		  case $libdir in
Lines 6854-6863 Link Here
6854
		      ;;
8231
		      ;;
6855
		  esac
8232
		  esac
6856
		fi
8233
		fi
6857
		add="-l$name"
8234
		add=-l$name
6858
	      elif test "$hardcode_shlibpath_var" = yes; then
8235
	      elif test yes = "$hardcode_shlibpath_var"; then
6859
		add_shlibpath="$dir"
8236
		add_shlibpath=$dir
6860
		add="-l$name"
8237
		add=-l$name
6861
	      else
8238
	      else
6862
		lib_linked=no
8239
		lib_linked=no
6863
	      fi
8240
	      fi
Lines 6865-6871 Link Here
6865
	    *) lib_linked=no ;;
8242
	    *) lib_linked=no ;;
6866
	    esac
8243
	    esac
6867
8244
6868
	    if test "$lib_linked" != yes; then
8245
	    if test yes != "$lib_linked"; then
6869
	      func_fatal_configuration "unsupported hardcode properties"
8246
	      func_fatal_configuration "unsupported hardcode properties"
6870
	    fi
8247
	    fi
6871
8248
Lines 6875-6889 Link Here
6875
	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
8252
	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
6876
	      esac
8253
	      esac
6877
	    fi
8254
	    fi
6878
	    if test "$linkmode" = prog; then
8255
	    if test prog = "$linkmode"; then
6879
	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
8256
	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
6880
	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
8257
	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
6881
	    else
8258
	    else
6882
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
8259
	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
6883
	      test -n "$add" && deplibs="$add $deplibs"
8260
	      test -n "$add" && deplibs="$add $deplibs"
6884
	      if test "$hardcode_direct" != yes &&
8261
	      if test yes != "$hardcode_direct" &&
6885
		 test "$hardcode_minus_L" != yes &&
8262
		 test yes != "$hardcode_minus_L" &&
6886
		 test "$hardcode_shlibpath_var" = yes; then
8263
		 test yes = "$hardcode_shlibpath_var"; then
6887
		case :$finalize_shlibpath: in
8264
		case :$finalize_shlibpath: in
6888
		*":$libdir:"*) ;;
8265
		*":$libdir:"*) ;;
6889
		*) func_append finalize_shlibpath "$libdir:" ;;
8266
		*) func_append finalize_shlibpath "$libdir:" ;;
Lines 6892-6924 Link Here
6892
	    fi
8269
	    fi
6893
	  fi
8270
	  fi
6894
8271
6895
	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
8272
	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
6896
	    add_shlibpath=
8273
	    add_shlibpath=
6897
	    add_dir=
8274
	    add_dir=
6898
	    add=
8275
	    add=
6899
	    # Finalize command for both is simple: just hardcode it.
8276
	    # Finalize command for both is simple: just hardcode it.
6900
	    if test "$hardcode_direct" = yes &&
8277
	    if test yes = "$hardcode_direct" &&
6901
	       test "$hardcode_direct_absolute" = no; then
8278
	       test no = "$hardcode_direct_absolute"; then
6902
	      add="$libdir/$linklib"
8279
	      add=$libdir/$linklib
6903
	    elif test "$hardcode_minus_L" = yes; then
8280
	    elif test yes = "$hardcode_minus_L"; then
6904
	      add_dir="-L$libdir"
8281
	      add_dir=-L$libdir
6905
	      add="-l$name"
8282
	      add=-l$name
6906
	    elif test "$hardcode_shlibpath_var" = yes; then
8283
	    elif test yes = "$hardcode_shlibpath_var"; then
6907
	      case :$finalize_shlibpath: in
8284
	      case :$finalize_shlibpath: in
6908
	      *":$libdir:"*) ;;
8285
	      *":$libdir:"*) ;;
6909
	      *) func_append finalize_shlibpath "$libdir:" ;;
8286
	      *) func_append finalize_shlibpath "$libdir:" ;;
6910
	      esac
8287
	      esac
6911
	      add="-l$name"
8288
	      add=-l$name
6912
	    elif test "$hardcode_automatic" = yes; then
8289
	    elif test yes = "$hardcode_automatic"; then
6913
	      if test -n "$inst_prefix_dir" &&
8290
	      if test -n "$inst_prefix_dir" &&
6914
		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
8291
		 test -f "$inst_prefix_dir$libdir/$linklib"; then
6915
		add="$inst_prefix_dir$libdir/$linklib"
8292
		add=$inst_prefix_dir$libdir/$linklib
6916
	      else
8293
	      else
6917
		add="$libdir/$linklib"
8294
		add=$libdir/$linklib
6918
	      fi
8295
	      fi
6919
	    else
8296
	    else
6920
	      # We cannot seem to hardcode it, guess we'll fake it.
8297
	      # We cannot seem to hardcode it, guess we'll fake it.
6921
	      add_dir="-L$libdir"
8298
	      add_dir=-L$libdir
6922
	      # Try looking first in the location we're being installed to.
8299
	      # Try looking first in the location we're being installed to.
6923
	      if test -n "$inst_prefix_dir"; then
8300
	      if test -n "$inst_prefix_dir"; then
6924
		case $libdir in
8301
		case $libdir in
Lines 6927-6936 Link Here
6927
		    ;;
8304
		    ;;
6928
		esac
8305
		esac
6929
	      fi
8306
	      fi
6930
	      add="-l$name"
8307
	      add=-l$name
6931
	    fi
8308
	    fi
6932
8309
6933
	    if test "$linkmode" = prog; then
8310
	    if test prog = "$linkmode"; then
6934
	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
8311
	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
6935
	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
8312
	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
6936
	    else
8313
	    else
Lines 6938-6980 Link Here
6938
	      test -n "$add" && deplibs="$add $deplibs"
8315
	      test -n "$add" && deplibs="$add $deplibs"
6939
	    fi
8316
	    fi
6940
	  fi
8317
	  fi
6941
	elif test "$linkmode" = prog; then
8318
	elif test prog = "$linkmode"; then
6942
	  # Here we assume that one of hardcode_direct or hardcode_minus_L
8319
	  # Here we assume that one of hardcode_direct or hardcode_minus_L
6943
	  # is not unsupported.  This is valid on all known static and
8320
	  # is not unsupported.  This is valid on all known static and
6944
	  # shared platforms.
8321
	  # shared platforms.
6945
	  if test "$hardcode_direct" != unsupported; then
8322
	  if test unsupported != "$hardcode_direct"; then
6946
	    test -n "$old_library" && linklib="$old_library"
8323
	    test -n "$old_library" && linklib=$old_library
6947
	    compile_deplibs="$dir/$linklib $compile_deplibs"
8324
	    compile_deplibs="$dir/$linklib $compile_deplibs"
6948
	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
8325
	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
6949
	  else
8326
	  else
6950
	    compile_deplibs="-l$name -L$dir $compile_deplibs"
8327
	    compile_deplibs="-l$name -L$dir $compile_deplibs"
6951
	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
8328
	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
6952
	  fi
8329
	  fi
6953
	elif test "$build_libtool_libs" = yes; then
8330
	elif test yes = "$build_libtool_libs"; then
6954
	  # Not a shared library
8331
	  # Not a shared library
6955
	  if test "$deplibs_check_method" != pass_all; then
8332
	  if test pass_all != "$deplibs_check_method"; then
6956
	    # We're trying link a shared library against a static one
8333
	    # We're trying link a shared library against a static one
6957
	    # but the system doesn't support it.
8334
	    # but the system doesn't support it.
6958
8335
6959
	    # Just print a warning and add the library to dependency_libs so
8336
	    # Just print a warning and add the library to dependency_libs so
6960
	    # that the program can be linked against the static library.
8337
	    # that the program can be linked against the static library.
6961
	    echo
8338
	    echo
6962
	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
8339
	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
6963
	    echo "*** I have the capability to make that library automatically link in when"
8340
	    echo "*** I have the capability to make that library automatically link in when"
6964
	    echo "*** you link to this library.  But I can only do this if you have a"
8341
	    echo "*** you link to this library.  But I can only do this if you have a"
6965
	    echo "*** shared version of the library, which you do not appear to have."
8342
	    echo "*** shared version of the library, which you do not appear to have."
6966
	    if test "$module" = yes; then
8343
	    if test yes = "$module"; then
6967
	      echo "*** But as you try to build a module library, libtool will still create "
8344
	      echo "*** But as you try to build a module library, libtool will still create "
6968
	      echo "*** a static module, that should work as long as the dlopening application"
8345
	      echo "*** a static module, that should work as long as the dlopening application"
6969
	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
8346
	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
6970
	      if test -z "$global_symbol_pipe"; then
8347
	      if test -z "$global_symbol_pipe"; then
6971
		echo
8348
		echo
6972
		echo "*** However, this would only work if libtool was able to extract symbol"
8349
		echo "*** However, this would only work if libtool was able to extract symbol"
6973
		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
8350
		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
6974
		echo "*** not find such a program.  So, this module is probably useless."
8351
		echo "*** not find such a program.  So, this module is probably useless."
6975
		echo "*** \`nm' from GNU binutils and a full rebuild may help."
8352
		echo "*** 'nm' from GNU binutils and a full rebuild may help."
6976
	      fi
8353
	      fi
6977
	      if test "$build_old_libs" = no; then
8354
	      if test no = "$build_old_libs"; then
6978
		build_libtool_libs=module
8355
		build_libtool_libs=module
6979
		build_old_libs=yes
8356
		build_old_libs=yes
6980
	      else
8357
	      else
Lines 6987-6997 Link Here
6987
	  fi
8364
	  fi
6988
	fi # link shared/static library?
8365
	fi # link shared/static library?
6989
8366
6990
	if test "$linkmode" = lib; then
8367
	if test lib = "$linkmode"; then
6991
	  if test -n "$dependency_libs" &&
8368
	  if test -n "$dependency_libs" &&
6992
	     { test "$hardcode_into_libs" != yes ||
8369
	     { test yes != "$hardcode_into_libs" ||
6993
	       test "$build_old_libs" = yes ||
8370
	       test yes = "$build_old_libs" ||
6994
	       test "$link_static" = yes; }; then
8371
	       test yes = "$link_static"; }; then
6995
	    # Extract -R from dependency_libs
8372
	    # Extract -R from dependency_libs
6996
	    temp_deplibs=
8373
	    temp_deplibs=
6997
	    for libdir in $dependency_libs; do
8374
	    for libdir in $dependency_libs; do
Lines 7005-7016 Link Here
7005
	      *) func_append temp_deplibs " $libdir";;
8382
	      *) func_append temp_deplibs " $libdir";;
7006
	      esac
8383
	      esac
7007
	    done
8384
	    done
7008
	    dependency_libs="$temp_deplibs"
8385
	    dependency_libs=$temp_deplibs
7009
	  fi
8386
	  fi
7010
8387
7011
	  func_append newlib_search_path " $absdir"
8388
	  func_append newlib_search_path " $absdir"
7012
	  # Link against this library
8389
	  # Link against this library
7013
	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
8390
	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7014
	  # ... and its dependency_libs
8391
	  # ... and its dependency_libs
7015
	  tmp_libs=
8392
	  tmp_libs=
7016
	  for deplib in $dependency_libs; do
8393
	  for deplib in $dependency_libs; do
Lines 7020-7026 Link Here
7020
                   func_resolve_sysroot "$func_stripname_result";;
8397
                   func_resolve_sysroot "$func_stripname_result";;
7021
              *) func_resolve_sysroot "$deplib" ;;
8398
              *) func_resolve_sysroot "$deplib" ;;
7022
            esac
8399
            esac
7023
	    if $opt_preserve_dup_deps ; then
8400
	    if $opt_preserve_dup_deps; then
7024
	      case "$tmp_libs " in
8401
	      case "$tmp_libs " in
7025
	      *" $func_resolve_sysroot_result "*)
8402
	      *" $func_resolve_sysroot_result "*)
7026
                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
8403
                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
Lines 7029-7040 Link Here
7029
	    func_append tmp_libs " $func_resolve_sysroot_result"
8406
	    func_append tmp_libs " $func_resolve_sysroot_result"
7030
	  done
8407
	  done
7031
8408
7032
	  if test "$link_all_deplibs" != no; then
8409
	  if test no != "$link_all_deplibs"; then
7033
	    # Add the search paths of all dependency libraries
8410
	    # Add the search paths of all dependency libraries
7034
	    for deplib in $dependency_libs; do
8411
	    for deplib in $dependency_libs; do
7035
	      path=
8412
	      path=
7036
	      case $deplib in
8413
	      case $deplib in
7037
	      -L*) path="$deplib" ;;
8414
	      -L*) path=$deplib ;;
7038
	      *.la)
8415
	      *.la)
7039
	        func_resolve_sysroot "$deplib"
8416
	        func_resolve_sysroot "$deplib"
7040
	        deplib=$func_resolve_sysroot_result
8417
	        deplib=$func_resolve_sysroot_result
Lines 7042-7053 Link Here
7042
		dir=$func_dirname_result
8419
		dir=$func_dirname_result
7043
		# We need an absolute path.
8420
		# We need an absolute path.
7044
		case $dir in
8421
		case $dir in
7045
		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
8422
		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
7046
		*)
8423
		*)
7047
		  absdir=`cd "$dir" && pwd`
8424
		  absdir=`cd "$dir" && pwd`
7048
		  if test -z "$absdir"; then
8425
		  if test -z "$absdir"; then
7049
		    func_warning "cannot determine absolute directory name of \`$dir'"
8426
		    func_warning "cannot determine absolute directory name of '$dir'"
7050
		    absdir="$dir"
8427
		    absdir=$dir
7051
		  fi
8428
		  fi
7052
		  ;;
8429
		  ;;
7053
		esac
8430
		esac
Lines 7055-7089 Link Here
7055
		case $host in
8432
		case $host in
7056
		*-*-darwin*)
8433
		*-*-darwin*)
7057
		  depdepl=
8434
		  depdepl=
7058
		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
8435
		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7059
		  if test -n "$deplibrary_names" ; then
8436
		  if test -n "$deplibrary_names"; then
7060
		    for tmp in $deplibrary_names ; do
8437
		    for tmp in $deplibrary_names; do
7061
		      depdepl=$tmp
8438
		      depdepl=$tmp
7062
		    done
8439
		    done
7063
		    if test -f "$absdir/$objdir/$depdepl" ; then
8440
		    if test -f "$absdir/$objdir/$depdepl"; then
7064
		      depdepl="$absdir/$objdir/$depdepl"
8441
		      depdepl=$absdir/$objdir/$depdepl
7065
		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
8442
		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7066
                      if test -z "$darwin_install_name"; then
8443
                      if test -z "$darwin_install_name"; then
7067
                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
8444
                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
7068
                      fi
8445
                      fi
7069
		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
8446
		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
7070
		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
8447
		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
7071
		      path=
8448
		      path=
7072
		    fi
8449
		    fi
7073
		  fi
8450
		  fi
7074
		  ;;
8451
		  ;;
7075
		*)
8452
		*)
7076
		  path="-L$absdir/$objdir"
8453
		  path=-L$absdir/$objdir
7077
		  ;;
8454
		  ;;
7078
		esac
8455
		esac
7079
		else
8456
		else
7080
		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
8457
		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7081
		  test -z "$libdir" && \
8458
		  test -z "$libdir" && \
7082
		    func_fatal_error "\`$deplib' is not a valid libtool archive"
8459
		    func_fatal_error "'$deplib' is not a valid libtool archive"
7083
		  test "$absdir" != "$libdir" && \
8460
		  test "$absdir" != "$libdir" && \
7084
		    func_warning "\`$deplib' seems to be moved"
8461
		    func_warning "'$deplib' seems to be moved"
7085
8462
7086
		  path="-L$absdir"
8463
		  path=-L$absdir
7087
		fi
8464
		fi
7088
		;;
8465
		;;
7089
	      esac
8466
	      esac
Lines 7095-7117 Link Here
7095
	  fi # link_all_deplibs != no
8472
	  fi # link_all_deplibs != no
7096
	fi # linkmode = lib
8473
	fi # linkmode = lib
7097
      done # for deplib in $libs
8474
      done # for deplib in $libs
7098
      if test "$pass" = link; then
8475
      if test link = "$pass"; then
7099
	if test "$linkmode" = "prog"; then
8476
	if test prog = "$linkmode"; then
7100
	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
8477
	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
7101
	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
8478
	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
7102
	else
8479
	else
7103
	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8480
	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7104
	fi
8481
	fi
7105
      fi
8482
      fi
7106
      dependency_libs="$newdependency_libs"
8483
      dependency_libs=$newdependency_libs
7107
      if test "$pass" = dlpreopen; then
8484
      if test dlpreopen = "$pass"; then
7108
	# Link the dlpreopened libraries before other libraries
8485
	# Link the dlpreopened libraries before other libraries
7109
	for deplib in $save_deplibs; do
8486
	for deplib in $save_deplibs; do
7110
	  deplibs="$deplib $deplibs"
8487
	  deplibs="$deplib $deplibs"
7111
	done
8488
	done
7112
      fi
8489
      fi
7113
      if test "$pass" != dlopen; then
8490
      if test dlopen != "$pass"; then
7114
	if test "$pass" != conv; then
8491
	test conv = "$pass" || {
7115
	  # Make sure lib_search_path contains only unique directories.
8492
	  # Make sure lib_search_path contains only unique directories.
7116
	  lib_search_path=
8493
	  lib_search_path=
7117
	  for dir in $newlib_search_path; do
8494
	  for dir in $newlib_search_path; do
Lines 7121-7132 Link Here
7121
	    esac
8498
	    esac
7122
	  done
8499
	  done
7123
	  newlib_search_path=
8500
	  newlib_search_path=
7124
	fi
8501
	}
7125
8502
7126
	if test "$linkmode,$pass" != "prog,link"; then
8503
	if test prog,link = "$linkmode,$pass"; then
7127
	  vars="deplibs"
7128
	else
7129
	  vars="compile_deplibs finalize_deplibs"
8504
	  vars="compile_deplibs finalize_deplibs"
8505
	else
8506
	  vars=deplibs
7130
	fi
8507
	fi
7131
	for var in $vars dependency_libs; do
8508
	for var in $vars dependency_libs; do
7132
	  # Add libraries to $var in reverse order
8509
	  # Add libraries to $var in reverse order
Lines 7187-7245 Link Here
7187
      # Last step: remove runtime libs from dependency_libs
8564
      # Last step: remove runtime libs from dependency_libs
7188
      # (they stay in deplibs)
8565
      # (they stay in deplibs)
7189
      tmp_libs=
8566
      tmp_libs=
7190
      for i in $dependency_libs ; do
8567
      for i in $dependency_libs; do
7191
	case " $predeps $postdeps $compiler_lib_search_path " in
8568
	case " $predeps $postdeps $compiler_lib_search_path " in
7192
	*" $i "*)
8569
	*" $i "*)
7193
	  i=""
8570
	  i=
7194
	  ;;
8571
	  ;;
7195
	esac
8572
	esac
7196
	if test -n "$i" ; then
8573
	if test -n "$i"; then
7197
	  func_append tmp_libs " $i"
8574
	  func_append tmp_libs " $i"
7198
	fi
8575
	fi
7199
      done
8576
      done
7200
      dependency_libs=$tmp_libs
8577
      dependency_libs=$tmp_libs
7201
    done # for pass
8578
    done # for pass
7202
    if test "$linkmode" = prog; then
8579
    if test prog = "$linkmode"; then
7203
      dlfiles="$newdlfiles"
8580
      dlfiles=$newdlfiles
7204
    fi
8581
    fi
7205
    if test "$linkmode" = prog || test "$linkmode" = lib; then
8582
    if test prog = "$linkmode" || test lib = "$linkmode"; then
7206
      dlprefiles="$newdlprefiles"
8583
      dlprefiles=$newdlprefiles
7207
    fi
8584
    fi
7208
8585
7209
    case $linkmode in
8586
    case $linkmode in
7210
    oldlib)
8587
    oldlib)
7211
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
8588
      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
7212
	func_warning "\`-dlopen' is ignored for archives"
8589
	func_warning "'-dlopen' is ignored for archives"
7213
      fi
8590
      fi
7214
8591
7215
      case " $deplibs" in
8592
      case " $deplibs" in
7216
      *\ -l* | *\ -L*)
8593
      *\ -l* | *\ -L*)
7217
	func_warning "\`-l' and \`-L' are ignored for archives" ;;
8594
	func_warning "'-l' and '-L' are ignored for archives" ;;
7218
      esac
8595
      esac
7219
8596
7220
      test -n "$rpath" && \
8597
      test -n "$rpath" && \
7221
	func_warning "\`-rpath' is ignored for archives"
8598
	func_warning "'-rpath' is ignored for archives"
7222
8599
7223
      test -n "$xrpath" && \
8600
      test -n "$xrpath" && \
7224
	func_warning "\`-R' is ignored for archives"
8601
	func_warning "'-R' is ignored for archives"
7225
8602
7226
      test -n "$vinfo" && \
8603
      test -n "$vinfo" && \
7227
	func_warning "\`-version-info/-version-number' is ignored for archives"
8604
	func_warning "'-version-info/-version-number' is ignored for archives"
7228
8605
7229
      test -n "$release" && \
8606
      test -n "$release" && \
7230
	func_warning "\`-release' is ignored for archives"
8607
	func_warning "'-release' is ignored for archives"
7231
8608
7232
      test -n "$export_symbols$export_symbols_regex" && \
8609
      test -n "$export_symbols$export_symbols_regex" && \
7233
	func_warning "\`-export-symbols' is ignored for archives"
8610
	func_warning "'-export-symbols' is ignored for archives"
7234
8611
7235
      # Now set the variables for building old libraries.
8612
      # Now set the variables for building old libraries.
7236
      build_libtool_libs=no
8613
      build_libtool_libs=no
7237
      oldlibs="$output"
8614
      oldlibs=$output
7238
      func_append objs "$old_deplibs"
8615
      func_append objs "$old_deplibs"
7239
      ;;
8616
      ;;
7240
8617
7241
    lib)
8618
    lib)
7242
      # Make sure we only generate libraries of the form `libNAME.la'.
8619
      # Make sure we only generate libraries of the form 'libNAME.la'.
7243
      case $outputname in
8620
      case $outputname in
7244
      lib*)
8621
      lib*)
7245
	func_stripname 'lib' '.la' "$outputname"
8622
	func_stripname 'lib' '.la' "$outputname"
Lines 7248-7257 Link Here
7248
	eval libname=\"$libname_spec\"
8625
	eval libname=\"$libname_spec\"
7249
	;;
8626
	;;
7250
      *)
8627
      *)
7251
	test "$module" = no && \
8628
	test no = "$module" \
7252
	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
8629
	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
7253
8630
7254
	if test "$need_lib_prefix" != no; then
8631
	if test no != "$need_lib_prefix"; then
7255
	  # Add the "lib" prefix for modules if required
8632
	  # Add the "lib" prefix for modules if required
7256
	  func_stripname '' '.la' "$outputname"
8633
	  func_stripname '' '.la' "$outputname"
7257
	  name=$func_stripname_result
8634
	  name=$func_stripname_result
Lines 7265-7272 Link Here
7265
      esac
8642
      esac
7266
8643
7267
      if test -n "$objs"; then
8644
      if test -n "$objs"; then
7268
	if test "$deplibs_check_method" != pass_all; then
8645
	if test pass_all != "$deplibs_check_method"; then
7269
	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
8646
	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
7270
	else
8647
	else
7271
	  echo
8648
	  echo
7272
	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
8649
	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
Lines 7275-7295 Link Here
7275
	fi
8652
	fi
7276
      fi
8653
      fi
7277
8654
7278
      test "$dlself" != no && \
8655
      test no = "$dlself" \
7279
	func_warning "\`-dlopen self' is ignored for libtool libraries"
8656
	|| func_warning "'-dlopen self' is ignored for libtool libraries"
7280
8657
7281
      set dummy $rpath
8658
      set dummy $rpath
7282
      shift
8659
      shift
7283
      test "$#" -gt 1 && \
8660
      test 1 -lt "$#" \
7284
	func_warning "ignoring multiple \`-rpath's for a libtool library"
8661
	&& func_warning "ignoring multiple '-rpath's for a libtool library"
7285
8662
7286
      install_libdir="$1"
8663
      install_libdir=$1
7287
8664
7288
      oldlibs=
8665
      oldlibs=
7289
      if test -z "$rpath"; then
8666
      if test -z "$rpath"; then
7290
	if test "$build_libtool_libs" = yes; then
8667
	if test yes = "$build_libtool_libs"; then
7291
	  # Building a libtool convenience library.
8668
	  # Building a libtool convenience library.
7292
	  # Some compilers have problems with a `.al' extension so
8669
	  # Some compilers have problems with a '.al' extension so
7293
	  # convenience libraries should have the same extension an
8670
	  # convenience libraries should have the same extension an
7294
	  # archive normally would.
8671
	  # archive normally would.
7295
	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
8672
	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
Lines 7298-7317 Link Here
7298
	fi
8675
	fi
7299
8676
7300
	test -n "$vinfo" && \
8677
	test -n "$vinfo" && \
7301
	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
8678
	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
7302
8679
7303
	test -n "$release" && \
8680
	test -n "$release" && \
7304
	  func_warning "\`-release' is ignored for convenience libraries"
8681
	  func_warning "'-release' is ignored for convenience libraries"
7305
      else
8682
      else
7306
8683
7307
	# Parse the version information argument.
8684
	# Parse the version information argument.
7308
	save_ifs="$IFS"; IFS=':'
8685
	save_ifs=$IFS; IFS=:
7309
	set dummy $vinfo 0 0 0
8686
	set dummy $vinfo 0 0 0
7310
	shift
8687
	shift
7311
	IFS="$save_ifs"
8688
	IFS=$save_ifs
7312
8689
7313
	test -n "$7" && \
8690
	test -n "$7" && \
7314
	  func_fatal_help "too many parameters to \`-version-info'"
8691
	  func_fatal_help "too many parameters to '-version-info'"
7315
8692
7316
	# convert absolute version numbers to libtool ages
8693
	# convert absolute version numbers to libtool ages
7317
	# this retains compatibility with .la files and attempts
8694
	# this retains compatibility with .la files and attempts
Lines 7319-7360 Link Here
7319
8696
7320
	case $vinfo_number in
8697
	case $vinfo_number in
7321
	yes)
8698
	yes)
7322
	  number_major="$1"
8699
	  number_major=$1
7323
	  number_minor="$2"
8700
	  number_minor=$2
7324
	  number_revision="$3"
8701
	  number_revision=$3
7325
	  #
8702
	  #
7326
	  # There are really only two kinds -- those that
8703
	  # There are really only two kinds -- those that
7327
	  # use the current revision as the major version
8704
	  # use the current revision as the major version
7328
	  # and those that subtract age and use age as
8705
	  # and those that subtract age and use age as
7329
	  # a minor version.  But, then there is irix
8706
	  # a minor version.  But, then there is irix
7330
	  # which has an extra 1 added just for fun
8707
	  # that has an extra 1 added just for fun
7331
	  #
8708
	  #
7332
	  case $version_type in
8709
	  case $version_type in
7333
	  # correct linux to gnu/linux during the next big refactor
8710
	  # correct linux to gnu/linux during the next big refactor
7334
	  darwin|linux|osf|windows|none)
8711
	  darwin|linux|osf|windows|none)
7335
	    func_arith $number_major + $number_minor
8712
	    func_arith $number_major + $number_minor
7336
	    current=$func_arith_result
8713
	    current=$func_arith_result
7337
	    age="$number_minor"
8714
	    age=$number_minor
7338
	    revision="$number_revision"
8715
	    revision=$number_revision
7339
	    ;;
8716
	    ;;
7340
	  freebsd-aout|freebsd-elf|qnx|sunos)
8717
	  freebsd-aout|freebsd-elf|qnx|sunos)
7341
	    current="$number_major"
8718
	    current=$number_major
7342
	    revision="$number_minor"
8719
	    revision=$number_minor
7343
	    age="0"
8720
	    age=0
7344
	    ;;
8721
	    ;;
7345
	  irix|nonstopux)
8722
	  irix|nonstopux)
7346
	    func_arith $number_major + $number_minor
8723
	    func_arith $number_major + $number_minor
7347
	    current=$func_arith_result
8724
	    current=$func_arith_result
7348
	    age="$number_minor"
8725
	    age=$number_minor
7349
	    revision="$number_minor"
8726
	    revision=$number_minor
7350
	    lt_irix_increment=no
8727
	    lt_irix_increment=no
7351
	    ;;
8728
	    ;;
7352
	  esac
8729
	  esac
7353
	  ;;
8730
	  ;;
7354
	no)
8731
	no)
7355
	  current="$1"
8732
	  current=$1
7356
	  revision="$2"
8733
	  revision=$2
7357
	  age="$3"
8734
	  age=$3
7358
	  ;;
8735
	  ;;
7359
	esac
8736
	esac
7360
8737
Lines 7362-7391 Link Here
7362
	case $current in
8739
	case $current in
7363
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
8740
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7364
	*)
8741
	*)
7365
	  func_error "CURRENT \`$current' must be a nonnegative integer"
8742
	  func_error "CURRENT '$current' must be a nonnegative integer"
7366
	  func_fatal_error "\`$vinfo' is not valid version information"
8743
	  func_fatal_error "'$vinfo' is not valid version information"
7367
	  ;;
8744
	  ;;
7368
	esac
8745
	esac
7369
8746
7370
	case $revision in
8747
	case $revision in
7371
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
8748
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7372
	*)
8749
	*)
7373
	  func_error "REVISION \`$revision' must be a nonnegative integer"
8750
	  func_error "REVISION '$revision' must be a nonnegative integer"
7374
	  func_fatal_error "\`$vinfo' is not valid version information"
8751
	  func_fatal_error "'$vinfo' is not valid version information"
7375
	  ;;
8752
	  ;;
7376
	esac
8753
	esac
7377
8754
7378
	case $age in
8755
	case $age in
7379
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
8756
	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7380
	*)
8757
	*)
7381
	  func_error "AGE \`$age' must be a nonnegative integer"
8758
	  func_error "AGE '$age' must be a nonnegative integer"
7382
	  func_fatal_error "\`$vinfo' is not valid version information"
8759
	  func_fatal_error "'$vinfo' is not valid version information"
7383
	  ;;
8760
	  ;;
7384
	esac
8761
	esac
7385
8762
7386
	if test "$age" -gt "$current"; then
8763
	if test "$age" -gt "$current"; then
7387
	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
8764
	  func_error "AGE '$age' is greater than the current interface number '$current'"
7388
	  func_fatal_error "\`$vinfo' is not valid version information"
8765
	  func_fatal_error "'$vinfo' is not valid version information"
7389
	fi
8766
	fi
7390
8767
7391
	# Calculate the version variables.
8768
	# Calculate the version variables.
Lines 7400-7425 Link Here
7400
	  # verstring for coding it into the library header
8777
	  # verstring for coding it into the library header
7401
	  func_arith $current - $age
8778
	  func_arith $current - $age
7402
	  major=.$func_arith_result
8779
	  major=.$func_arith_result
7403
	  versuffix="$major.$age.$revision"
8780
	  versuffix=$major.$age.$revision
7404
	  # Darwin ld doesn't like 0 for these options...
8781
	  # Darwin ld doesn't like 0 for these options...
7405
	  func_arith $current + 1
8782
	  func_arith $current + 1
7406
	  minor_current=$func_arith_result
8783
	  minor_current=$func_arith_result
7407
	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
8784
	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
7408
	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
8785
	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
8786
          # On Darwin other compilers
8787
          case $CC in
8788
              nagfor*)
8789
                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
8790
                  ;;
8791
              *)
8792
                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
8793
                  ;;
8794
          esac
7409
	  ;;
8795
	  ;;
7410
8796
7411
	freebsd-aout)
8797
	freebsd-aout)
7412
	  major=".$current"
8798
	  major=.$current
7413
	  versuffix=".$current.$revision";
8799
	  versuffix=.$current.$revision
7414
	  ;;
8800
	  ;;
7415
8801
7416
	freebsd-elf)
8802
	freebsd-elf)
7417
	  major=".$current"
8803
	  major=.$current
7418
	  versuffix=".$current"
8804
	  versuffix=.$current
7419
	  ;;
8805
	  ;;
7420
8806
7421
	irix | nonstopux)
8807
	irix | nonstopux)
7422
	  if test "X$lt_irix_increment" = "Xno"; then
8808
	  if test no = "$lt_irix_increment"; then
7423
	    func_arith $current - $age
8809
	    func_arith $current - $age
7424
	  else
8810
	  else
7425
	    func_arith $current - $age + 1
8811
	    func_arith $current - $age + 1
Lines 7430-7498 Link Here
7430
	    nonstopux) verstring_prefix=nonstopux ;;
8816
	    nonstopux) verstring_prefix=nonstopux ;;
7431
	    *)         verstring_prefix=sgi ;;
8817
	    *)         verstring_prefix=sgi ;;
7432
	  esac
8818
	  esac
7433
	  verstring="$verstring_prefix$major.$revision"
8819
	  verstring=$verstring_prefix$major.$revision
7434
8820
7435
	  # Add in all the interfaces that we are compatible with.
8821
	  # Add in all the interfaces that we are compatible with.
7436
	  loop=$revision
8822
	  loop=$revision
7437
	  while test "$loop" -ne 0; do
8823
	  while test 0 -ne "$loop"; do
7438
	    func_arith $revision - $loop
8824
	    func_arith $revision - $loop
7439
	    iface=$func_arith_result
8825
	    iface=$func_arith_result
7440
	    func_arith $loop - 1
8826
	    func_arith $loop - 1
7441
	    loop=$func_arith_result
8827
	    loop=$func_arith_result
7442
	    verstring="$verstring_prefix$major.$iface:$verstring"
8828
	    verstring=$verstring_prefix$major.$iface:$verstring
7443
	  done
8829
	  done
7444
8830
7445
	  # Before this point, $major must not contain `.'.
8831
	  # Before this point, $major must not contain '.'.
7446
	  major=.$major
8832
	  major=.$major
7447
	  versuffix="$major.$revision"
8833
	  versuffix=$major.$revision
7448
	  ;;
8834
	  ;;
7449
8835
7450
	linux) # correct to gnu/linux during the next big refactor
8836
	linux) # correct to gnu/linux during the next big refactor
7451
	  func_arith $current - $age
8837
	  func_arith $current - $age
7452
	  major=.$func_arith_result
8838
	  major=.$func_arith_result
7453
	  versuffix="$major.$age.$revision"
8839
	  versuffix=$major.$age.$revision
7454
	  ;;
8840
	  ;;
7455
8841
7456
	osf)
8842
	osf)
7457
	  func_arith $current - $age
8843
	  func_arith $current - $age
7458
	  major=.$func_arith_result
8844
	  major=.$func_arith_result
7459
	  versuffix=".$current.$age.$revision"
8845
	  versuffix=.$current.$age.$revision
7460
	  verstring="$current.$age.$revision"
8846
	  verstring=$current.$age.$revision
7461
8847
7462
	  # Add in all the interfaces that we are compatible with.
8848
	  # Add in all the interfaces that we are compatible with.
7463
	  loop=$age
8849
	  loop=$age
7464
	  while test "$loop" -ne 0; do
8850
	  while test 0 -ne "$loop"; do
7465
	    func_arith $current - $loop
8851
	    func_arith $current - $loop
7466
	    iface=$func_arith_result
8852
	    iface=$func_arith_result
7467
	    func_arith $loop - 1
8853
	    func_arith $loop - 1
7468
	    loop=$func_arith_result
8854
	    loop=$func_arith_result
7469
	    verstring="$verstring:${iface}.0"
8855
	    verstring=$verstring:$iface.0
7470
	  done
8856
	  done
7471
8857
7472
	  # Make executables depend on our current version.
8858
	  # Make executables depend on our current version.
7473
	  func_append verstring ":${current}.0"
8859
	  func_append verstring ":$current.0"
7474
	  ;;
8860
	  ;;
7475
8861
7476
	qnx)
8862
	qnx)
7477
	  major=".$current"
8863
	  major=.$current
7478
	  versuffix=".$current"
8864
	  versuffix=.$current
7479
	  ;;
8865
	  ;;
7480
8866
7481
	sunos)
8867
	sunos)
7482
	  major=".$current"
8868
	  major=.$current
7483
	  versuffix=".$current.$revision"
8869
	  versuffix=.$current.$revision
7484
	  ;;
8870
	  ;;
7485
8871
7486
	windows)
8872
	windows)
7487
	  # Use '-' rather than '.', since we only want one
8873
	  # Use '-' rather than '.', since we only want one
7488
	  # extension on DOS 8.3 filesystems.
8874
	  # extension on DOS 8.3 file systems.
7489
	  func_arith $current - $age
8875
	  func_arith $current - $age
7490
	  major=$func_arith_result
8876
	  major=$func_arith_result
7491
	  versuffix="-$major"
8877
	  versuffix=-$major
7492
	  ;;
8878
	  ;;
7493
8879
7494
	*)
8880
	*)
7495
	  func_fatal_configuration "unknown library version type \`$version_type'"
8881
	  func_fatal_configuration "unknown library version type '$version_type'"
7496
	  ;;
8882
	  ;;
7497
	esac
8883
	esac
7498
8884
Lines 7506-7547 Link Here
7506
	    verstring=
8892
	    verstring=
7507
	    ;;
8893
	    ;;
7508
	  *)
8894
	  *)
7509
	    verstring="0.0"
8895
	    verstring=0.0
7510
	    ;;
8896
	    ;;
7511
	  esac
8897
	  esac
7512
	  if test "$need_version" = no; then
8898
	  if test no = "$need_version"; then
7513
	    versuffix=
8899
	    versuffix=
7514
	  else
8900
	  else
7515
	    versuffix=".0.0"
8901
	    versuffix=.0.0
7516
	  fi
8902
	  fi
7517
	fi
8903
	fi
7518
8904
7519
	# Remove version info from name if versioning should be avoided
8905
	# Remove version info from name if versioning should be avoided
7520
	if test "$avoid_version" = yes && test "$need_version" = no; then
8906
	if test yes,no = "$avoid_version,$need_version"; then
7521
	  major=
8907
	  major=
7522
	  versuffix=
8908
	  versuffix=
7523
	  verstring=""
8909
	  verstring=
7524
	fi
8910
	fi
7525
8911
7526
	# Check to see if the archive will have undefined symbols.
8912
	# Check to see if the archive will have undefined symbols.
7527
	if test "$allow_undefined" = yes; then
8913
	if test yes = "$allow_undefined"; then
7528
	  if test "$allow_undefined_flag" = unsupported; then
8914
	  if test unsupported = "$allow_undefined_flag"; then
7529
	    func_warning "undefined symbols not allowed in $host shared libraries"
8915
	    if test yes = "$build_old_libs"; then
7530
	    build_libtool_libs=no
8916
	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
7531
	    build_old_libs=yes
8917
	      build_libtool_libs=no
8918
	    else
8919
	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
8920
	    fi
7532
	  fi
8921
	  fi
7533
	else
8922
	else
7534
	  # Don't allow undefined symbols.
8923
	  # Don't allow undefined symbols.
7535
	  allow_undefined_flag="$no_undefined_flag"
8924
	  allow_undefined_flag=$no_undefined_flag
7536
	fi
8925
	fi
7537
8926
7538
      fi
8927
      fi
7539
8928
7540
      func_generate_dlsyms "$libname" "$libname" "yes"
8929
      func_generate_dlsyms "$libname" "$libname" :
7541
      func_append libobjs " $symfileobj"
8930
      func_append libobjs " $symfileobj"
7542
      test "X$libobjs" = "X " && libobjs=
8931
      test " " = "$libobjs" && libobjs=
7543
8932
7544
      if test "$opt_mode" != relink; then
8933
      if test relink != "$opt_mode"; then
7545
	# Remove our outputs, but don't remove object files since they
8934
	# Remove our outputs, but don't remove object files since they
7546
	# may have been created when compiling PIC objects.
8935
	# may have been created when compiling PIC objects.
7547
	removelist=
8936
	removelist=
Lines 7550-7557 Link Here
7550
	  case $p in
8939
	  case $p in
7551
	    *.$objext | *.gcno)
8940
	    *.$objext | *.gcno)
7552
	       ;;
8941
	       ;;
7553
	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
8942
	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
7554
	       if test "X$precious_files_regex" != "X"; then
8943
	       if test -n "$precious_files_regex"; then
7555
		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
8944
		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
7556
		 then
8945
		 then
7557
		   continue
8946
		   continue
Lines 7567-7577 Link Here
7567
      fi
8956
      fi
7568
8957
7569
      # Now set the variables for building old libraries.
8958
      # Now set the variables for building old libraries.
7570
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
8959
      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
7571
	func_append oldlibs " $output_objdir/$libname.$libext"
8960
	func_append oldlibs " $output_objdir/$libname.$libext"
7572
8961
7573
	# Transform .lo files to .o files.
8962
	# Transform .lo files to .o files.
7574
	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
8963
	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
7575
      fi
8964
      fi
7576
8965
7577
      # Eliminate all temporary directories.
8966
      # Eliminate all temporary directories.
Lines 7592-7604 Link Here
7592
	  *) func_append finalize_rpath " $libdir" ;;
8981
	  *) func_append finalize_rpath " $libdir" ;;
7593
	  esac
8982
	  esac
7594
	done
8983
	done
7595
	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
8984
	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
7596
	  dependency_libs="$temp_xrpath $dependency_libs"
8985
	  dependency_libs="$temp_xrpath $dependency_libs"
7597
	fi
8986
	fi
7598
      fi
8987
      fi
7599
8988
7600
      # Make sure dlfiles contains only unique files that won't be dlpreopened
8989
      # Make sure dlfiles contains only unique files that won't be dlpreopened
7601
      old_dlfiles="$dlfiles"
8990
      old_dlfiles=$dlfiles
7602
      dlfiles=
8991
      dlfiles=
7603
      for lib in $old_dlfiles; do
8992
      for lib in $old_dlfiles; do
7604
	case " $dlprefiles $dlfiles " in
8993
	case " $dlprefiles $dlfiles " in
Lines 7608-7614 Link Here
7608
      done
8997
      done
7609
8998
7610
      # Make sure dlprefiles contains only unique files
8999
      # Make sure dlprefiles contains only unique files
7611
      old_dlprefiles="$dlprefiles"
9000
      old_dlprefiles=$dlprefiles
7612
      dlprefiles=
9001
      dlprefiles=
7613
      for lib in $old_dlprefiles; do
9002
      for lib in $old_dlprefiles; do
7614
	case "$dlprefiles " in
9003
	case "$dlprefiles " in
Lines 7617-7623 Link Here
7617
	esac
9006
	esac
7618
      done
9007
      done
7619
9008
7620
      if test "$build_libtool_libs" = yes; then
9009
      if test yes = "$build_libtool_libs"; then
7621
	if test -n "$rpath"; then
9010
	if test -n "$rpath"; then
7622
	  case $host in
9011
	  case $host in
7623
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
9012
	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
Lines 7641-7647 Link Here
7641
	    ;;
9030
	    ;;
7642
	  *)
9031
	  *)
7643
	    # Add libc to deplibs on all other systems if necessary.
9032
	    # Add libc to deplibs on all other systems if necessary.
7644
	    if test "$build_libtool_need_lc" = "yes"; then
9033
	    if test yes = "$build_libtool_need_lc"; then
7645
	      func_append deplibs " -lc"
9034
	      func_append deplibs " -lc"
7646
	    fi
9035
	    fi
7647
	    ;;
9036
	    ;;
Lines 7657-7665 Link Here
7657
	# I'm not sure if I'm treating the release correctly.  I think
9046
	# I'm not sure if I'm treating the release correctly.  I think
7658
	# release should show up in the -l (ie -lgmp5) so we don't want to
9047
	# release should show up in the -l (ie -lgmp5) so we don't want to
7659
	# add it in twice.  Is that correct?
9048
	# add it in twice.  Is that correct?
7660
	release=""
9049
	release=
7661
	versuffix=""
9050
	versuffix=
7662
	major=""
9051
	major=
7663
	newdeplibs=
9052
	newdeplibs=
7664
	droppeddeps=no
9053
	droppeddeps=no
7665
	case $deplibs_check_method in
9054
	case $deplibs_check_method in
Lines 7688-7707 Link Here
7688
	      -l*)
9077
	      -l*)
7689
		func_stripname -l '' "$i"
9078
		func_stripname -l '' "$i"
7690
		name=$func_stripname_result
9079
		name=$func_stripname_result
7691
		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
9080
		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7692
		  case " $predeps $postdeps " in
9081
		  case " $predeps $postdeps " in
7693
		  *" $i "*)
9082
		  *" $i "*)
7694
		    func_append newdeplibs " $i"
9083
		    func_append newdeplibs " $i"
7695
		    i=""
9084
		    i=
7696
		    ;;
9085
		    ;;
7697
		  esac
9086
		  esac
7698
		fi
9087
		fi
7699
		if test -n "$i" ; then
9088
		if test -n "$i"; then
7700
		  libname=`eval "\\$ECHO \"$libname_spec\""`
9089
		  libname=`eval "\\$ECHO \"$libname_spec\""`
7701
		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9090
		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7702
		  set dummy $deplib_matches; shift
9091
		  set dummy $deplib_matches; shift
7703
		  deplib_match=$1
9092
		  deplib_match=$1
7704
		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
9093
		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
7705
		    func_append newdeplibs " $i"
9094
		    func_append newdeplibs " $i"
7706
		  else
9095
		  else
7707
		    droppeddeps=yes
9096
		    droppeddeps=yes
Lines 7731-7750 Link Here
7731
		$opt_dry_run || $RM conftest
9120
		$opt_dry_run || $RM conftest
7732
		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
9121
		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
7733
		  ldd_output=`ldd conftest`
9122
		  ldd_output=`ldd conftest`
7734
		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
9123
		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7735
		    case " $predeps $postdeps " in
9124
		    case " $predeps $postdeps " in
7736
		    *" $i "*)
9125
		    *" $i "*)
7737
		      func_append newdeplibs " $i"
9126
		      func_append newdeplibs " $i"
7738
		      i=""
9127
		      i=
7739
		      ;;
9128
		      ;;
7740
		    esac
9129
		    esac
7741
		  fi
9130
		  fi
7742
		  if test -n "$i" ; then
9131
		  if test -n "$i"; then
7743
		    libname=`eval "\\$ECHO \"$libname_spec\""`
9132
		    libname=`eval "\\$ECHO \"$libname_spec\""`
7744
		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
9133
		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
7745
		    set dummy $deplib_matches; shift
9134
		    set dummy $deplib_matches; shift
7746
		    deplib_match=$1
9135
		    deplib_match=$1
7747
		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
9136
		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
7748
		      func_append newdeplibs " $i"
9137
		      func_append newdeplibs " $i"
7749
		    else
9138
		    else
7750
		      droppeddeps=yes
9139
		      droppeddeps=yes
Lines 7781-7804 Link Here
7781
	    -l*)
9170
	    -l*)
7782
	      func_stripname -l '' "$a_deplib"
9171
	      func_stripname -l '' "$a_deplib"
7783
	      name=$func_stripname_result
9172
	      name=$func_stripname_result
7784
	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
9173
	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7785
		case " $predeps $postdeps " in
9174
		case " $predeps $postdeps " in
7786
		*" $a_deplib "*)
9175
		*" $a_deplib "*)
7787
		  func_append newdeplibs " $a_deplib"
9176
		  func_append newdeplibs " $a_deplib"
7788
		  a_deplib=""
9177
		  a_deplib=
7789
		  ;;
9178
		  ;;
7790
		esac
9179
		esac
7791
	      fi
9180
	      fi
7792
	      if test -n "$a_deplib" ; then
9181
	      if test -n "$a_deplib"; then
7793
		libname=`eval "\\$ECHO \"$libname_spec\""`
9182
		libname=`eval "\\$ECHO \"$libname_spec\""`
7794
		if test -n "$file_magic_glob"; then
9183
		if test -n "$file_magic_glob"; then
7795
		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
9184
		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
7796
		else
9185
		else
7797
		  libnameglob=$libname
9186
		  libnameglob=$libname
7798
		fi
9187
		fi
7799
		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
9188
		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
7800
		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9189
		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7801
		  if test "$want_nocaseglob" = yes; then
9190
		  if test yes = "$want_nocaseglob"; then
7802
		    shopt -s nocaseglob
9191
		    shopt -s nocaseglob
7803
		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
9192
		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
7804
		    $nocaseglob
9193
		    $nocaseglob
Lines 7816-7840 Link Here
7816
		      # We might still enter an endless loop, since a link
9205
		      # We might still enter an endless loop, since a link
7817
		      # loop can be closed while we follow links,
9206
		      # loop can be closed while we follow links,
7818
		      # but so what?
9207
		      # but so what?
7819
		      potlib="$potent_lib"
9208
		      potlib=$potent_lib
7820
		      while test -h "$potlib" 2>/dev/null; do
9209
		      while test -h "$potlib" 2>/dev/null; do
7821
			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
9210
			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
7822
			case $potliblink in
9211
			case $potliblink in
7823
			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
9212
			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
7824
			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
9213
			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
7825
			esac
9214
			esac
7826
		      done
9215
		      done
7827
		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
9216
		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
7828
			 $SED -e 10q |
9217
			 $SED -e 10q |
7829
			 $EGREP "$file_magic_regex" > /dev/null; then
9218
			 $EGREP "$file_magic_regex" > /dev/null; then
7830
			func_append newdeplibs " $a_deplib"
9219
			func_append newdeplibs " $a_deplib"
7831
			a_deplib=""
9220
			a_deplib=
7832
			break 2
9221
			break 2
7833
		      fi
9222
		      fi
7834
		  done
9223
		  done
7835
		done
9224
		done
7836
	      fi
9225
	      fi
7837
	      if test -n "$a_deplib" ; then
9226
	      if test -n "$a_deplib"; then
7838
		droppeddeps=yes
9227
		droppeddeps=yes
7839
		echo
9228
		echo
7840
		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9229
		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
Lines 7842-7848 Link Here
7842
		echo "*** you link to this library.  But I can only do this if you have a"
9231
		echo "*** you link to this library.  But I can only do this if you have a"
7843
		echo "*** shared version of the library, which you do not appear to have"
9232
		echo "*** shared version of the library, which you do not appear to have"
7844
		echo "*** because I did check the linker path looking for a file starting"
9233
		echo "*** because I did check the linker path looking for a file starting"
7845
		if test -z "$potlib" ; then
9234
		if test -z "$potlib"; then
7846
		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
9235
		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
7847
		else
9236
		else
7848
		  $ECHO "*** with $libname and none of the candidates passed a file format test"
9237
		  $ECHO "*** with $libname and none of the candidates passed a file format test"
Lines 7865-7894 Link Here
7865
	    -l*)
9254
	    -l*)
7866
	      func_stripname -l '' "$a_deplib"
9255
	      func_stripname -l '' "$a_deplib"
7867
	      name=$func_stripname_result
9256
	      name=$func_stripname_result
7868
	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
9257
	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7869
		case " $predeps $postdeps " in
9258
		case " $predeps $postdeps " in
7870
		*" $a_deplib "*)
9259
		*" $a_deplib "*)
7871
		  func_append newdeplibs " $a_deplib"
9260
		  func_append newdeplibs " $a_deplib"
7872
		  a_deplib=""
9261
		  a_deplib=
7873
		  ;;
9262
		  ;;
7874
		esac
9263
		esac
7875
	      fi
9264
	      fi
7876
	      if test -n "$a_deplib" ; then
9265
	      if test -n "$a_deplib"; then
7877
		libname=`eval "\\$ECHO \"$libname_spec\""`
9266
		libname=`eval "\\$ECHO \"$libname_spec\""`
7878
		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
9267
		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
7879
		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
9268
		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
7880
		  for potent_lib in $potential_libs; do
9269
		  for potent_lib in $potential_libs; do
7881
		    potlib="$potent_lib" # see symlink-check above in file_magic test
9270
		    potlib=$potent_lib # see symlink-check above in file_magic test
7882
		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
9271
		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
7883
		       $EGREP "$match_pattern_regex" > /dev/null; then
9272
		       $EGREP "$match_pattern_regex" > /dev/null; then
7884
		      func_append newdeplibs " $a_deplib"
9273
		      func_append newdeplibs " $a_deplib"
7885
		      a_deplib=""
9274
		      a_deplib=
7886
		      break 2
9275
		      break 2
7887
		    fi
9276
		    fi
7888
		  done
9277
		  done
7889
		done
9278
		done
7890
	      fi
9279
	      fi
7891
	      if test -n "$a_deplib" ; then
9280
	      if test -n "$a_deplib"; then
7892
		droppeddeps=yes
9281
		droppeddeps=yes
7893
		echo
9282
		echo
7894
		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
9283
		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
Lines 7896-7902 Link Here
7896
		echo "*** you link to this library.  But I can only do this if you have a"
9285
		echo "*** you link to this library.  But I can only do this if you have a"
7897
		echo "*** shared version of the library, which you do not appear to have"
9286
		echo "*** shared version of the library, which you do not appear to have"
7898
		echo "*** because I did check the linker path looking for a file starting"
9287
		echo "*** because I did check the linker path looking for a file starting"
7899
		if test -z "$potlib" ; then
9288
		if test -z "$potlib"; then
7900
		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
9289
		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
7901
		else
9290
		else
7902
		  $ECHO "*** with $libname and none of the candidates passed a file format test"
9291
		  $ECHO "*** with $libname and none of the candidates passed a file format test"
Lines 7912-7929 Link Here
7912
	  done # Gone through all deplibs.
9301
	  done # Gone through all deplibs.
7913
	  ;;
9302
	  ;;
7914
	none | unknown | *)
9303
	none | unknown | *)
7915
	  newdeplibs=""
9304
	  newdeplibs=
7916
	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
9305
	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
7917
	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
9306
	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
7918
	    for i in $predeps $postdeps ; do
9307
	    for i in $predeps $postdeps; do
7919
	      # can't use Xsed below, because $i might contain '/'
9308
	      # can't use Xsed below, because $i might contain '/'
7920
	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
9309
	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
7921
	    done
9310
	    done
7922
	  fi
9311
	  fi
7923
	  case $tmp_deplibs in
9312
	  case $tmp_deplibs in
7924
	  *[!\	\ ]*)
9313
	  *[!\	\ ]*)
7925
	    echo
9314
	    echo
7926
	    if test "X$deplibs_check_method" = "Xnone"; then
9315
	    if test none = "$deplibs_check_method"; then
7927
	      echo "*** Warning: inter-library dependencies are not supported in this platform."
9316
	      echo "*** Warning: inter-library dependencies are not supported in this platform."
7928
	    else
9317
	    else
7929
	      echo "*** Warning: inter-library dependencies are not known to be supported."
9318
	      echo "*** Warning: inter-library dependencies are not known to be supported."
Lines 7947-7954 Link Here
7947
	  ;;
9336
	  ;;
7948
	esac
9337
	esac
7949
9338
7950
	if test "$droppeddeps" = yes; then
9339
	if test yes = "$droppeddeps"; then
7951
	  if test "$module" = yes; then
9340
	  if test yes = "$module"; then
7952
	    echo
9341
	    echo
7953
	    echo "*** Warning: libtool could not satisfy all declared inter-library"
9342
	    echo "*** Warning: libtool could not satisfy all declared inter-library"
7954
	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
9343
	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
Lines 7957-7968 Link Here
7957
	    if test -z "$global_symbol_pipe"; then
9346
	    if test -z "$global_symbol_pipe"; then
7958
	      echo
9347
	      echo
7959
	      echo "*** However, this would only work if libtool was able to extract symbol"
9348
	      echo "*** However, this would only work if libtool was able to extract symbol"
7960
	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
9349
	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
7961
	      echo "*** not find such a program.  So, this module is probably useless."
9350
	      echo "*** not find such a program.  So, this module is probably useless."
7962
	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
9351
	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
7963
	    fi
9352
	    fi
7964
	    if test "$build_old_libs" = no; then
9353
	    if test no = "$build_old_libs"; then
7965
	      oldlibs="$output_objdir/$libname.$libext"
9354
	      oldlibs=$output_objdir/$libname.$libext
7966
	      build_libtool_libs=module
9355
	      build_libtool_libs=module
7967
	      build_old_libs=yes
9356
	      build_old_libs=yes
7968
	    else
9357
	    else
Lines 7973-7986 Link Here
7973
	    echo "*** automatically added whenever a program is linked with this library"
9362
	    echo "*** automatically added whenever a program is linked with this library"
7974
	    echo "*** or is declared to -dlopen it."
9363
	    echo "*** or is declared to -dlopen it."
7975
9364
7976
	    if test "$allow_undefined" = no; then
9365
	    if test no = "$allow_undefined"; then
7977
	      echo
9366
	      echo
7978
	      echo "*** Since this library must not contain undefined symbols,"
9367
	      echo "*** Since this library must not contain undefined symbols,"
7979
	      echo "*** because either the platform does not support them or"
9368
	      echo "*** because either the platform does not support them or"
7980
	      echo "*** it was explicitly requested with -no-undefined,"
9369
	      echo "*** it was explicitly requested with -no-undefined,"
7981
	      echo "*** libtool will only create a static version of it."
9370
	      echo "*** libtool will only create a static version of it."
7982
	      if test "$build_old_libs" = no; then
9371
	      if test no = "$build_old_libs"; then
7983
		oldlibs="$output_objdir/$libname.$libext"
9372
		oldlibs=$output_objdir/$libname.$libext
7984
		build_libtool_libs=module
9373
		build_libtool_libs=module
7985
		build_old_libs=yes
9374
		build_old_libs=yes
7986
	      else
9375
	      else
Lines 8026-8032 Link Here
8026
	*) func_append new_libs " $deplib" ;;
9415
	*) func_append new_libs " $deplib" ;;
8027
	esac
9416
	esac
8028
      done
9417
      done
8029
      deplibs="$new_libs"
9418
      deplibs=$new_libs
8030
9419
8031
      # All the library-specific variables (install_libdir is set above).
9420
      # All the library-specific variables (install_libdir is set above).
8032
      library_names=
9421
      library_names=
Lines 8034-8058 Link Here
8034
      dlname=
9423
      dlname=
8035
9424
8036
      # Test again, we may have decided not to build it any more
9425
      # Test again, we may have decided not to build it any more
8037
      if test "$build_libtool_libs" = yes; then
9426
      if test yes = "$build_libtool_libs"; then
8038
	# Remove ${wl} instances when linking with ld.
9427
	# Remove $wl instances when linking with ld.
8039
	# FIXME: should test the right _cmds variable.
9428
	# FIXME: should test the right _cmds variable.
8040
	case $archive_cmds in
9429
	case $archive_cmds in
8041
	  *\$LD\ *) wl= ;;
9430
	  *\$LD\ *) wl= ;;
8042
        esac
9431
        esac
8043
	if test "$hardcode_into_libs" = yes; then
9432
	if test yes = "$hardcode_into_libs"; then
8044
	  # Hardcode the library paths
9433
	  # Hardcode the library paths
8045
	  hardcode_libdirs=
9434
	  hardcode_libdirs=
8046
	  dep_rpath=
9435
	  dep_rpath=
8047
	  rpath="$finalize_rpath"
9436
	  rpath=$finalize_rpath
8048
	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
9437
	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
8049
	  for libdir in $rpath; do
9438
	  for libdir in $rpath; do
8050
	    if test -n "$hardcode_libdir_flag_spec"; then
9439
	    if test -n "$hardcode_libdir_flag_spec"; then
8051
	      if test -n "$hardcode_libdir_separator"; then
9440
	      if test -n "$hardcode_libdir_separator"; then
8052
		func_replace_sysroot "$libdir"
9441
		func_replace_sysroot "$libdir"
8053
		libdir=$func_replace_sysroot_result
9442
		libdir=$func_replace_sysroot_result
8054
		if test -z "$hardcode_libdirs"; then
9443
		if test -z "$hardcode_libdirs"; then
8055
		  hardcode_libdirs="$libdir"
9444
		  hardcode_libdirs=$libdir
8056
		else
9445
		else
8057
		  # Just accumulate the unique libdirs.
9446
		  # Just accumulate the unique libdirs.
8058
		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9447
		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
Lines 8077-8083 Link Here
8077
	  # Substitute the hardcoded libdirs into the rpath.
9466
	  # Substitute the hardcoded libdirs into the rpath.
8078
	  if test -n "$hardcode_libdir_separator" &&
9467
	  if test -n "$hardcode_libdir_separator" &&
8079
	     test -n "$hardcode_libdirs"; then
9468
	     test -n "$hardcode_libdirs"; then
8080
	    libdir="$hardcode_libdirs"
9469
	    libdir=$hardcode_libdirs
8081
	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
9470
	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
8082
	  fi
9471
	  fi
8083
	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
9472
	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
Lines 8091-8098 Link Here
8091
	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
9480
	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
8092
	fi
9481
	fi
8093
9482
8094
	shlibpath="$finalize_shlibpath"
9483
	shlibpath=$finalize_shlibpath
8095
	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
9484
	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
8096
	if test -n "$shlibpath"; then
9485
	if test -n "$shlibpath"; then
8097
	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
9486
	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
8098
	fi
9487
	fi
Lines 8102-8120 Link Here
8102
	eval library_names=\"$library_names_spec\"
9491
	eval library_names=\"$library_names_spec\"
8103
	set dummy $library_names
9492
	set dummy $library_names
8104
	shift
9493
	shift
8105
	realname="$1"
9494
	realname=$1
8106
	shift
9495
	shift
8107
9496
8108
	if test -n "$soname_spec"; then
9497
	if test -n "$soname_spec"; then
8109
	  eval soname=\"$soname_spec\"
9498
	  eval soname=\"$soname_spec\"
8110
	else
9499
	else
8111
	  soname="$realname"
9500
	  soname=$realname
8112
	fi
9501
	fi
8113
	if test -z "$dlname"; then
9502
	if test -z "$dlname"; then
8114
	  dlname=$soname
9503
	  dlname=$soname
8115
	fi
9504
	fi
8116
9505
8117
	lib="$output_objdir/$realname"
9506
	lib=$output_objdir/$realname
8118
	linknames=
9507
	linknames=
8119
	for link
9508
	for link
8120
	do
9509
	do
Lines 8128-8134 Link Here
8128
	delfiles=
9517
	delfiles=
8129
	if test -n "$export_symbols" && test -n "$include_expsyms"; then
9518
	if test -n "$export_symbols" && test -n "$include_expsyms"; then
8130
	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
9519
	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8131
	  export_symbols="$output_objdir/$libname.uexp"
9520
	  export_symbols=$output_objdir/$libname.uexp
8132
	  func_append delfiles " $export_symbols"
9521
	  func_append delfiles " $export_symbols"
8133
	fi
9522
	fi
8134
9523
Lines 8137-8167 Link Here
8137
	cygwin* | mingw* | cegcc*)
9526
	cygwin* | mingw* | cegcc*)
8138
	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
9527
	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
8139
	    # exporting using user supplied symfile
9528
	    # exporting using user supplied symfile
8140
	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
9529
	    func_dll_def_p "$export_symbols" || {
8141
	      # and it's NOT already a .def file. Must figure out
9530
	      # and it's NOT already a .def file. Must figure out
8142
	      # which of the given symbols are data symbols and tag
9531
	      # which of the given symbols are data symbols and tag
8143
	      # them as such. So, trigger use of export_symbols_cmds.
9532
	      # them as such. So, trigger use of export_symbols_cmds.
8144
	      # export_symbols gets reassigned inside the "prepare
9533
	      # export_symbols gets reassigned inside the "prepare
8145
	      # the list of exported symbols" if statement, so the
9534
	      # the list of exported symbols" if statement, so the
8146
	      # include_expsyms logic still works.
9535
	      # include_expsyms logic still works.
8147
	      orig_export_symbols="$export_symbols"
9536
	      orig_export_symbols=$export_symbols
8148
	      export_symbols=
9537
	      export_symbols=
8149
	      always_export_symbols=yes
9538
	      always_export_symbols=yes
8150
	    fi
9539
	    }
8151
	  fi
9540
	  fi
8152
	  ;;
9541
	  ;;
8153
	esac
9542
	esac
8154
9543
8155
	# Prepare the list of exported symbols
9544
	# Prepare the list of exported symbols
8156
	if test -z "$export_symbols"; then
9545
	if test -z "$export_symbols"; then
8157
	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
9546
	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
8158
	    func_verbose "generating symbol list for \`$libname.la'"
9547
	    func_verbose "generating symbol list for '$libname.la'"
8159
	    export_symbols="$output_objdir/$libname.exp"
9548
	    export_symbols=$output_objdir/$libname.exp
8160
	    $opt_dry_run || $RM $export_symbols
9549
	    $opt_dry_run || $RM $export_symbols
8161
	    cmds=$export_symbols_cmds
9550
	    cmds=$export_symbols_cmds
8162
	    save_ifs="$IFS"; IFS='~'
9551
	    save_ifs=$IFS; IFS='~'
8163
	    for cmd1 in $cmds; do
9552
	    for cmd1 in $cmds; do
8164
	      IFS="$save_ifs"
9553
	      IFS=$save_ifs
8165
	      # Take the normal branch if the nm_file_list_spec branch
9554
	      # Take the normal branch if the nm_file_list_spec branch
8166
	      # doesn't work or if tool conversion is not needed.
9555
	      # doesn't work or if tool conversion is not needed.
8167
	      case $nm_file_list_spec~$to_tool_file_cmd in
9556
	      case $nm_file_list_spec~$to_tool_file_cmd in
Lines 8175-8181 Link Here
8175
		  try_normal_branch=no
9564
		  try_normal_branch=no
8176
		  ;;
9565
		  ;;
8177
	      esac
9566
	      esac
8178
	      if test "$try_normal_branch" = yes \
9567
	      if test yes = "$try_normal_branch" \
8179
		 && { test "$len" -lt "$max_cmd_len" \
9568
		 && { test "$len" -lt "$max_cmd_len" \
8180
		      || test "$max_cmd_len" -le -1; }
9569
		      || test "$max_cmd_len" -le -1; }
8181
	      then
9570
	      then
Lines 8186-8192 Link Here
8186
		output_la=$func_basename_result
9575
		output_la=$func_basename_result
8187
		save_libobjs=$libobjs
9576
		save_libobjs=$libobjs
8188
		save_output=$output
9577
		save_output=$output
8189
		output=${output_objdir}/${output_la}.nm
9578
		output=$output_objdir/$output_la.nm
8190
		func_to_tool_file "$output"
9579
		func_to_tool_file "$output"
8191
		libobjs=$nm_file_list_spec$func_to_tool_file_result
9580
		libobjs=$nm_file_list_spec$func_to_tool_file_result
8192
		func_append delfiles " $output"
9581
		func_append delfiles " $output"
Lines 8209-8216 Link Here
8209
		break
9598
		break
8210
	      fi
9599
	      fi
8211
	    done
9600
	    done
8212
	    IFS="$save_ifs"
9601
	    IFS=$save_ifs
8213
	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
9602
	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
8214
	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
9603
	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8215
	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
9604
	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8216
	    fi
9605
	    fi
Lines 8218-8233 Link Here
8218
	fi
9607
	fi
8219
9608
8220
	if test -n "$export_symbols" && test -n "$include_expsyms"; then
9609
	if test -n "$export_symbols" && test -n "$include_expsyms"; then
8221
	  tmp_export_symbols="$export_symbols"
9610
	  tmp_export_symbols=$export_symbols
8222
	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
9611
	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
8223
	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
9612
	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8224
	fi
9613
	fi
8225
9614
8226
	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
9615
	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
8227
	  # The given exports_symbols file has to be filtered, so filter it.
9616
	  # The given exports_symbols file has to be filtered, so filter it.
8228
	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
9617
	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
8229
	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
9618
	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
8230
	  # 's' commands which not all seds can handle. GNU sed should be fine
9619
	  # 's' commands, which not all seds can handle. GNU sed should be fine
8231
	  # though. Also, the filter scales superlinearly with the number of
9620
	  # though. Also, the filter scales superlinearly with the number of
8232
	  # global variables. join(1) would be nice here, but unfortunately
9621
	  # global variables. join(1) would be nice here, but unfortunately
8233
	  # isn't a blessed tool.
9622
	  # isn't a blessed tool.
Lines 8246-8256 Link Here
8246
	    ;;
9635
	    ;;
8247
	  esac
9636
	  esac
8248
	done
9637
	done
8249
	deplibs="$tmp_deplibs"
9638
	deplibs=$tmp_deplibs
8250
9639
8251
	if test -n "$convenience"; then
9640
	if test -n "$convenience"; then
8252
	  if test -n "$whole_archive_flag_spec" &&
9641
	  if test -n "$whole_archive_flag_spec" &&
8253
	    test "$compiler_needs_object" = yes &&
9642
	    test yes = "$compiler_needs_object" &&
8254
	    test -z "$libobjs"; then
9643
	    test -z "$libobjs"; then
8255
	    # extract the archives, so we have objects to list.
9644
	    # extract the archives, so we have objects to list.
8256
	    # TODO: could optimize this to just extract one archive.
9645
	    # TODO: could optimize this to just extract one archive.
Lines 8261-8267 Link Here
8261
	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
9650
	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8262
	    test "X$libobjs" = "X " && libobjs=
9651
	    test "X$libobjs" = "X " && libobjs=
8263
	  else
9652
	  else
8264
	    gentop="$output_objdir/${outputname}x"
9653
	    gentop=$output_objdir/${outputname}x
8265
	    func_append generated " $gentop"
9654
	    func_append generated " $gentop"
8266
9655
8267
	    func_extract_archives $gentop $convenience
9656
	    func_extract_archives $gentop $convenience
Lines 8270-8287 Link Here
8270
	  fi
9659
	  fi
8271
	fi
9660
	fi
8272
9661
8273
	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
9662
	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
8274
	  eval flag=\"$thread_safe_flag_spec\"
9663
	  eval flag=\"$thread_safe_flag_spec\"
8275
	  func_append linker_flags " $flag"
9664
	  func_append linker_flags " $flag"
8276
	fi
9665
	fi
8277
9666
8278
	# Make a backup of the uninstalled library when relinking
9667
	# Make a backup of the uninstalled library when relinking
8279
	if test "$opt_mode" = relink; then
9668
	if test relink = "$opt_mode"; then
8280
	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
9669
	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
8281
	fi
9670
	fi
8282
9671
8283
	# Do each of the archive commands.
9672
	# Do each of the archive commands.
8284
	if test "$module" = yes && test -n "$module_cmds" ; then
9673
	if test yes = "$module" && test -n "$module_cmds"; then
8285
	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
9674
	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8286
	    eval test_cmds=\"$module_expsym_cmds\"
9675
	    eval test_cmds=\"$module_expsym_cmds\"
8287
	    cmds=$module_expsym_cmds
9676
	    cmds=$module_expsym_cmds
Lines 8299-8305 Link Here
8299
	  fi
9688
	  fi
8300
	fi
9689
	fi
8301
9690
8302
	if test "X$skipped_export" != "X:" &&
9691
	if test : != "$skipped_export" &&
8303
	   func_len " $test_cmds" &&
9692
	   func_len " $test_cmds" &&
8304
	   len=$func_len_result &&
9693
	   len=$func_len_result &&
8305
	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9694
	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
Lines 8332-8339 Link Here
8332
	  last_robj=
9721
	  last_robj=
8333
	  k=1
9722
	  k=1
8334
9723
8335
	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
9724
	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
8336
	    output=${output_objdir}/${output_la}.lnkscript
9725
	    output=$output_objdir/$output_la.lnkscript
8337
	    func_verbose "creating GNU ld script: $output"
9726
	    func_verbose "creating GNU ld script: $output"
8338
	    echo 'INPUT (' > $output
9727
	    echo 'INPUT (' > $output
8339
	    for obj in $save_libobjs
9728
	    for obj in $save_libobjs
Lines 8345-8358 Link Here
8345
	    func_append delfiles " $output"
9734
	    func_append delfiles " $output"
8346
	    func_to_tool_file "$output"
9735
	    func_to_tool_file "$output"
8347
	    output=$func_to_tool_file_result
9736
	    output=$func_to_tool_file_result
8348
	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
9737
	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
8349
	    output=${output_objdir}/${output_la}.lnk
9738
	    output=$output_objdir/$output_la.lnk
8350
	    func_verbose "creating linker input file list: $output"
9739
	    func_verbose "creating linker input file list: $output"
8351
	    : > $output
9740
	    : > $output
8352
	    set x $save_libobjs
9741
	    set x $save_libobjs
8353
	    shift
9742
	    shift
8354
	    firstobj=
9743
	    firstobj=
8355
	    if test "$compiler_needs_object" = yes; then
9744
	    if test yes = "$compiler_needs_object"; then
8356
	      firstobj="$1 "
9745
	      firstobj="$1 "
8357
	      shift
9746
	      shift
8358
	    fi
9747
	    fi
Lines 8367-8373 Link Here
8367
	  else
9756
	  else
8368
	    if test -n "$save_libobjs"; then
9757
	    if test -n "$save_libobjs"; then
8369
	      func_verbose "creating reloadable object files..."
9758
	      func_verbose "creating reloadable object files..."
8370
	      output=$output_objdir/$output_la-${k}.$objext
9759
	      output=$output_objdir/$output_la-$k.$objext
8371
	      eval test_cmds=\"$reload_cmds\"
9760
	      eval test_cmds=\"$reload_cmds\"
8372
	      func_len " $test_cmds"
9761
	      func_len " $test_cmds"
8373
	      len0=$func_len_result
9762
	      len0=$func_len_result
Lines 8379-8391 Link Here
8379
		func_len " $obj"
9768
		func_len " $obj"
8380
		func_arith $len + $func_len_result
9769
		func_arith $len + $func_len_result
8381
		len=$func_arith_result
9770
		len=$func_arith_result
8382
		if test "X$objlist" = X ||
9771
		if test -z "$objlist" ||
8383
		   test "$len" -lt "$max_cmd_len"; then
9772
		   test "$len" -lt "$max_cmd_len"; then
8384
		  func_append objlist " $obj"
9773
		  func_append objlist " $obj"
8385
		else
9774
		else
8386
		  # The command $test_cmds is almost too long, add a
9775
		  # The command $test_cmds is almost too long, add a
8387
		  # command to the queue.
9776
		  # command to the queue.
8388
		  if test "$k" -eq 1 ; then
9777
		  if test 1 -eq "$k"; then
8389
		    # The first file doesn't have a previous command to add.
9778
		    # The first file doesn't have a previous command to add.
8390
		    reload_objs=$objlist
9779
		    reload_objs=$objlist
8391
		    eval concat_cmds=\"$reload_cmds\"
9780
		    eval concat_cmds=\"$reload_cmds\"
Lines 8395-8404 Link Here
8395
		    reload_objs="$objlist $last_robj"
9784
		    reload_objs="$objlist $last_robj"
8396
		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
9785
		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
8397
		  fi
9786
		  fi
8398
		  last_robj=$output_objdir/$output_la-${k}.$objext
9787
		  last_robj=$output_objdir/$output_la-$k.$objext
8399
		  func_arith $k + 1
9788
		  func_arith $k + 1
8400
		  k=$func_arith_result
9789
		  k=$func_arith_result
8401
		  output=$output_objdir/$output_la-${k}.$objext
9790
		  output=$output_objdir/$output_la-$k.$objext
8402
		  objlist=" $obj"
9791
		  objlist=" $obj"
8403
		  func_len " $last_robj"
9792
		  func_len " $last_robj"
8404
		  func_arith $len0 + $func_len_result
9793
		  func_arith $len0 + $func_len_result
Lines 8410-8418 Link Here
8410
	      # files will link in the last one created.
9799
	      # files will link in the last one created.
8411
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9800
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8412
	      reload_objs="$objlist $last_robj"
9801
	      reload_objs="$objlist $last_robj"
8413
	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
9802
	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
8414
	      if test -n "$last_robj"; then
9803
	      if test -n "$last_robj"; then
8415
	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
9804
	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8416
	      fi
9805
	      fi
8417
	      func_append delfiles " $output"
9806
	      func_append delfiles " $output"
8418
9807
Lines 8420-8428 Link Here
8420
	      output=
9809
	      output=
8421
	    fi
9810
	    fi
8422
9811
8423
	    if ${skipped_export-false}; then
9812
	    ${skipped_export-false} && {
8424
	      func_verbose "generating symbol list for \`$libname.la'"
9813
	      func_verbose "generating symbol list for '$libname.la'"
8425
	      export_symbols="$output_objdir/$libname.exp"
9814
	      export_symbols=$output_objdir/$libname.exp
8426
	      $opt_dry_run || $RM $export_symbols
9815
	      $opt_dry_run || $RM $export_symbols
8427
	      libobjs=$output
9816
	      libobjs=$output
8428
	      # Append the command to create the export file.
9817
	      # Append the command to create the export file.
Lines 8431-8446 Link Here
8431
	      if test -n "$last_robj"; then
9820
	      if test -n "$last_robj"; then
8432
		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
9821
		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8433
	      fi
9822
	      fi
8434
	    fi
9823
	    }
8435
9824
8436
	    test -n "$save_libobjs" &&
9825
	    test -n "$save_libobjs" &&
8437
	      func_verbose "creating a temporary reloadable object file: $output"
9826
	      func_verbose "creating a temporary reloadable object file: $output"
8438
9827
8439
	    # Loop through the commands generated above and execute them.
9828
	    # Loop through the commands generated above and execute them.
8440
	    save_ifs="$IFS"; IFS='~'
9829
	    save_ifs=$IFS; IFS='~'
8441
	    for cmd in $concat_cmds; do
9830
	    for cmd in $concat_cmds; do
8442
	      IFS="$save_ifs"
9831
	      IFS=$save_ifs
8443
	      $opt_silent || {
9832
	      $opt_quiet || {
8444
		  func_quote_for_expand "$cmd"
9833
		  func_quote_for_expand "$cmd"
8445
		  eval "func_echo $func_quote_for_expand_result"
9834
		  eval "func_echo $func_quote_for_expand_result"
8446
	      }
9835
	      }
Lines 8448-8454 Link Here
8448
		lt_exit=$?
9837
		lt_exit=$?
8449
9838
8450
		# Restore the uninstalled library and exit
9839
		# Restore the uninstalled library and exit
8451
		if test "$opt_mode" = relink; then
9840
		if test relink = "$opt_mode"; then
8452
		  ( cd "$output_objdir" && \
9841
		  ( cd "$output_objdir" && \
8453
		    $RM "${realname}T" && \
9842
		    $RM "${realname}T" && \
8454
		    $MV "${realname}U" "$realname" )
9843
		    $MV "${realname}U" "$realname" )
Lines 8457-8463 Link Here
8457
		exit $lt_exit
9846
		exit $lt_exit
8458
	      }
9847
	      }
8459
	    done
9848
	    done
8460
	    IFS="$save_ifs"
9849
	    IFS=$save_ifs
8461
9850
8462
	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
9851
	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8463
	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
9852
	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
Lines 8465-8482 Link Here
8465
	    fi
9854
	    fi
8466
	  fi
9855
	  fi
8467
9856
8468
          if ${skipped_export-false}; then
9857
          ${skipped_export-false} && {
8469
	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
9858
	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
8470
	      tmp_export_symbols="$export_symbols"
9859
	      tmp_export_symbols=$export_symbols
8471
	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
9860
	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
8472
	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
9861
	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8473
	    fi
9862
	    fi
8474
9863
8475
	    if test -n "$orig_export_symbols"; then
9864
	    if test -n "$orig_export_symbols"; then
8476
	      # The given exports_symbols file has to be filtered, so filter it.
9865
	      # The given exports_symbols file has to be filtered, so filter it.
8477
	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
9866
	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
8478
	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
9867
	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
8479
	      # 's' commands which not all seds can handle. GNU sed should be fine
9868
	      # 's' commands, which not all seds can handle. GNU sed should be fine
8480
	      # though. Also, the filter scales superlinearly with the number of
9869
	      # though. Also, the filter scales superlinearly with the number of
8481
	      # global variables. join(1) would be nice here, but unfortunately
9870
	      # global variables. join(1) would be nice here, but unfortunately
8482
	      # isn't a blessed tool.
9871
	      # isn't a blessed tool.
Lines 8485-8491 Link Here
8485
	      export_symbols=$output_objdir/$libname.def
9874
	      export_symbols=$output_objdir/$libname.def
8486
	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
9875
	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8487
	    fi
9876
	    fi
8488
	  fi
9877
	  }
8489
9878
8490
	  libobjs=$output
9879
	  libobjs=$output
8491
	  # Restore the value of output.
9880
	  # Restore the value of output.
Lines 8499-8505 Link Here
8499
	  # value of $libobjs for piecewise linking.
9888
	  # value of $libobjs for piecewise linking.
8500
9889
8501
	  # Do each of the archive commands.
9890
	  # Do each of the archive commands.
8502
	  if test "$module" = yes && test -n "$module_cmds" ; then
9891
	  if test yes = "$module" && test -n "$module_cmds"; then
8503
	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
9892
	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8504
	      cmds=$module_expsym_cmds
9893
	      cmds=$module_expsym_cmds
8505
	    else
9894
	    else
Lines 8521-8527 Link Here
8521
9910
8522
	# Add any objects from preloaded convenience libraries
9911
	# Add any objects from preloaded convenience libraries
8523
	if test -n "$dlprefiles"; then
9912
	if test -n "$dlprefiles"; then
8524
	  gentop="$output_objdir/${outputname}x"
9913
	  gentop=$output_objdir/${outputname}x
8525
	  func_append generated " $gentop"
9914
	  func_append generated " $gentop"
8526
9915
8527
	  func_extract_archives $gentop $dlprefiles
9916
	  func_extract_archives $gentop $dlprefiles
Lines 8529-8539 Link Here
8529
	  test "X$libobjs" = "X " && libobjs=
9918
	  test "X$libobjs" = "X " && libobjs=
8530
	fi
9919
	fi
8531
9920
8532
	save_ifs="$IFS"; IFS='~'
9921
	save_ifs=$IFS; IFS='~'
8533
	for cmd in $cmds; do
9922
	for cmd in $cmds; do
8534
	  IFS="$save_ifs"
9923
	  IFS=$sp$nl
8535
	  eval cmd=\"$cmd\"
9924
	  eval cmd=\"$cmd\"
8536
	  $opt_silent || {
9925
	  IFS=$save_ifs
9926
	  $opt_quiet || {
8537
	    func_quote_for_expand "$cmd"
9927
	    func_quote_for_expand "$cmd"
8538
	    eval "func_echo $func_quote_for_expand_result"
9928
	    eval "func_echo $func_quote_for_expand_result"
8539
	  }
9929
	  }
Lines 8541-8547 Link Here
8541
	    lt_exit=$?
9931
	    lt_exit=$?
8542
9932
8543
	    # Restore the uninstalled library and exit
9933
	    # Restore the uninstalled library and exit
8544
	    if test "$opt_mode" = relink; then
9934
	    if test relink = "$opt_mode"; then
8545
	      ( cd "$output_objdir" && \
9935
	      ( cd "$output_objdir" && \
8546
	        $RM "${realname}T" && \
9936
	        $RM "${realname}T" && \
8547
		$MV "${realname}U" "$realname" )
9937
		$MV "${realname}U" "$realname" )
Lines 8550-8559 Link Here
8550
	    exit $lt_exit
9940
	    exit $lt_exit
8551
	  }
9941
	  }
8552
	done
9942
	done
8553
	IFS="$save_ifs"
9943
	IFS=$save_ifs
8554
9944
8555
	# Restore the uninstalled library and exit
9945
	# Restore the uninstalled library and exit
8556
	if test "$opt_mode" = relink; then
9946
	if test relink = "$opt_mode"; then
8557
	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
9947
	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
8558
9948
8559
	  if test -n "$convenience"; then
9949
	  if test -n "$convenience"; then
Lines 8573-8611 Link Here
8573
	done
9963
	done
8574
9964
8575
	# If -module or -export-dynamic was specified, set the dlname.
9965
	# If -module or -export-dynamic was specified, set the dlname.
8576
	if test "$module" = yes || test "$export_dynamic" = yes; then
9966
	if test yes = "$module" || test yes = "$export_dynamic"; then
8577
	  # On all known operating systems, these are identical.
9967
	  # On all known operating systems, these are identical.
8578
	  dlname="$soname"
9968
	  dlname=$soname
8579
	fi
9969
	fi
8580
      fi
9970
      fi
8581
      ;;
9971
      ;;
8582
9972
8583
    obj)
9973
    obj)
8584
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
9974
      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
8585
	func_warning "\`-dlopen' is ignored for objects"
9975
	func_warning "'-dlopen' is ignored for objects"
8586
      fi
9976
      fi
8587
9977
8588
      case " $deplibs" in
9978
      case " $deplibs" in
8589
      *\ -l* | *\ -L*)
9979
      *\ -l* | *\ -L*)
8590
	func_warning "\`-l' and \`-L' are ignored for objects" ;;
9980
	func_warning "'-l' and '-L' are ignored for objects" ;;
8591
      esac
9981
      esac
8592
9982
8593
      test -n "$rpath" && \
9983
      test -n "$rpath" && \
8594
	func_warning "\`-rpath' is ignored for objects"
9984
	func_warning "'-rpath' is ignored for objects"
8595
9985
8596
      test -n "$xrpath" && \
9986
      test -n "$xrpath" && \
8597
	func_warning "\`-R' is ignored for objects"
9987
	func_warning "'-R' is ignored for objects"
8598
9988
8599
      test -n "$vinfo" && \
9989
      test -n "$vinfo" && \
8600
	func_warning "\`-version-info' is ignored for objects"
9990
	func_warning "'-version-info' is ignored for objects"
8601
9991
8602
      test -n "$release" && \
9992
      test -n "$release" && \
8603
	func_warning "\`-release' is ignored for objects"
9993
	func_warning "'-release' is ignored for objects"
8604
9994
8605
      case $output in
9995
      case $output in
8606
      *.lo)
9996
      *.lo)
8607
	test -n "$objs$old_deplibs" && \
9997
	test -n "$objs$old_deplibs" && \
8608
	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
9998
	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
8609
9999
8610
	libobj=$output
10000
	libobj=$output
8611
	func_lo2o "$libobj"
10001
	func_lo2o "$libobj"
Lines 8613-8619 Link Here
8613
	;;
10003
	;;
8614
      *)
10004
      *)
8615
	libobj=
10005
	libobj=
8616
	obj="$output"
10006
	obj=$output
8617
	;;
10007
	;;
8618
      esac
10008
      esac
8619
10009
Lines 8626-8642 Link Here
8626
      # the extraction.
10016
      # the extraction.
8627
      reload_conv_objs=
10017
      reload_conv_objs=
8628
      gentop=
10018
      gentop=
8629
      # reload_cmds runs $LD directly, so let us get rid of
10019
      # if reload_cmds runs $LD directly, get rid of -Wl from
8630
      # -Wl from whole_archive_flag_spec and hope we can get by with
10020
      # whole_archive_flag_spec and hope we can get by with turning comma
8631
      # turning comma into space..
10021
      # into space.
8632
      wl=
10022
      case $reload_cmds in
8633
10023
        *\$LD[\ \$]*) wl= ;;
10024
      esac
8634
      if test -n "$convenience"; then
10025
      if test -n "$convenience"; then
8635
	if test -n "$whole_archive_flag_spec"; then
10026
	if test -n "$whole_archive_flag_spec"; then
8636
	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
10027
	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
8637
	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
10028
	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
10029
	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
8638
	else
10030
	else
8639
	  gentop="$output_objdir/${obj}x"
10031
	  gentop=$output_objdir/${obj}x
8640
	  func_append generated " $gentop"
10032
	  func_append generated " $gentop"
8641
10033
8642
	  func_extract_archives $gentop $convenience
10034
	  func_extract_archives $gentop $convenience
Lines 8645-8656 Link Here
8645
      fi
10037
      fi
8646
10038
8647
      # If we're not building shared, we need to use non_pic_objs
10039
      # If we're not building shared, we need to use non_pic_objs
8648
      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
10040
      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
8649
10041
8650
      # Create the old-style object.
10042
      # Create the old-style object.
8651
      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
10043
      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
8652
10044
8653
      output="$obj"
10045
      output=$obj
8654
      func_execute_cmds "$reload_cmds" 'exit $?'
10046
      func_execute_cmds "$reload_cmds" 'exit $?'
8655
10047
8656
      # Exit if we aren't doing a library object file.
10048
      # Exit if we aren't doing a library object file.
Lines 8662-8668 Link Here
8662
	exit $EXIT_SUCCESS
10054
	exit $EXIT_SUCCESS
8663
      fi
10055
      fi
8664
10056
8665
      if test "$build_libtool_libs" != yes; then
10057
      test yes = "$build_libtool_libs" || {
8666
	if test -n "$gentop"; then
10058
	if test -n "$gentop"; then
8667
	  func_show_eval '${RM}r "$gentop"'
10059
	  func_show_eval '${RM}r "$gentop"'
8668
	fi
10060
	fi
Lines 8672-8683 Link Here
8672
	# $show "echo timestamp > $libobj"
10064
	# $show "echo timestamp > $libobj"
8673
	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
10065
	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
8674
	exit $EXIT_SUCCESS
10066
	exit $EXIT_SUCCESS
8675
      fi
10067
      }
8676
10068
8677
      if test -n "$pic_flag" || test "$pic_mode" != default; then
10069
      if test -n "$pic_flag" || test default != "$pic_mode"; then
8678
	# Only do commands if we really have different PIC objects.
10070
	# Only do commands if we really have different PIC objects.
8679
	reload_objs="$libobjs $reload_conv_objs"
10071
	reload_objs="$libobjs $reload_conv_objs"
8680
	output="$libobj"
10072
	output=$libobj
8681
	func_execute_cmds "$reload_cmds" 'exit $?'
10073
	func_execute_cmds "$reload_cmds" 'exit $?'
8682
      fi
10074
      fi
8683
10075
Lines 8694-8709 Link Here
8694
	          output=$func_stripname_result.exe;;
10086
	          output=$func_stripname_result.exe;;
8695
      esac
10087
      esac
8696
      test -n "$vinfo" && \
10088
      test -n "$vinfo" && \
8697
	func_warning "\`-version-info' is ignored for programs"
10089
	func_warning "'-version-info' is ignored for programs"
8698
10090
8699
      test -n "$release" && \
10091
      test -n "$release" && \
8700
	func_warning "\`-release' is ignored for programs"
10092
	func_warning "'-release' is ignored for programs"
8701
10093
8702
      test "$preload" = yes \
10094
      $preload \
8703
        && test "$dlopen_support" = unknown \
10095
	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
8704
	&& test "$dlopen_self" = unknown \
10096
	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
8705
	&& test "$dlopen_self_static" = unknown && \
8706
	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
8707
10097
8708
      case $host in
10098
      case $host in
8709
      *-*-rhapsody* | *-*-darwin1.[012])
10099
      *-*-rhapsody* | *-*-darwin1.[012])
Lines 8717-8727 Link Here
8717
      *-*-darwin*)
10107
      *-*-darwin*)
8718
	# Don't allow lazy linking, it breaks C++ global constructors
10108
	# Don't allow lazy linking, it breaks C++ global constructors
8719
	# But is supposedly fixed on 10.4 or later (yay!).
10109
	# But is supposedly fixed on 10.4 or later (yay!).
8720
	if test "$tagname" = CXX ; then
10110
	if test CXX = "$tagname"; then
8721
	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10111
	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
8722
	    10.[0123])
10112
	    10.[0123])
8723
	      func_append compile_command " ${wl}-bind_at_load"
10113
	      func_append compile_command " $wl-bind_at_load"
8724
	      func_append finalize_command " ${wl}-bind_at_load"
10114
	      func_append finalize_command " $wl-bind_at_load"
8725
	    ;;
10115
	    ;;
8726
	  esac
10116
	  esac
8727
	fi
10117
	fi
Lines 8757-8763 Link Here
8757
	*) func_append new_libs " $deplib" ;;
10147
	*) func_append new_libs " $deplib" ;;
8758
	esac
10148
	esac
8759
      done
10149
      done
8760
      compile_deplibs="$new_libs"
10150
      compile_deplibs=$new_libs
8761
10151
8762
10152
8763
      func_append compile_command " $compile_deplibs"
10153
      func_append compile_command " $compile_deplibs"
Lines 8781-8787 Link Here
8781
	if test -n "$hardcode_libdir_flag_spec"; then
10171
	if test -n "$hardcode_libdir_flag_spec"; then
8782
	  if test -n "$hardcode_libdir_separator"; then
10172
	  if test -n "$hardcode_libdir_separator"; then
8783
	    if test -z "$hardcode_libdirs"; then
10173
	    if test -z "$hardcode_libdirs"; then
8784
	      hardcode_libdirs="$libdir"
10174
	      hardcode_libdirs=$libdir
8785
	    else
10175
	    else
8786
	      # Just accumulate the unique libdirs.
10176
	      # Just accumulate the unique libdirs.
8787
	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10177
	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
Lines 8804-8810 Link Here
8804
	fi
10194
	fi
8805
	case $host in
10195
	case $host in
8806
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
10196
	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
8807
	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
10197
	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
8808
	  case :$dllsearchpath: in
10198
	  case :$dllsearchpath: in
8809
	  *":$libdir:"*) ;;
10199
	  *":$libdir:"*) ;;
8810
	  ::) dllsearchpath=$libdir;;
10200
	  ::) dllsearchpath=$libdir;;
Lines 8821-8830 Link Here
8821
      # Substitute the hardcoded libdirs into the rpath.
10211
      # Substitute the hardcoded libdirs into the rpath.
8822
      if test -n "$hardcode_libdir_separator" &&
10212
      if test -n "$hardcode_libdir_separator" &&
8823
	 test -n "$hardcode_libdirs"; then
10213
	 test -n "$hardcode_libdirs"; then
8824
	libdir="$hardcode_libdirs"
10214
	libdir=$hardcode_libdirs
8825
	eval rpath=\" $hardcode_libdir_flag_spec\"
10215
	eval rpath=\" $hardcode_libdir_flag_spec\"
8826
      fi
10216
      fi
8827
      compile_rpath="$rpath"
10217
      compile_rpath=$rpath
8828
10218
8829
      rpath=
10219
      rpath=
8830
      hardcode_libdirs=
10220
      hardcode_libdirs=
Lines 8832-8838 Link Here
8832
	if test -n "$hardcode_libdir_flag_spec"; then
10222
	if test -n "$hardcode_libdir_flag_spec"; then
8833
	  if test -n "$hardcode_libdir_separator"; then
10223
	  if test -n "$hardcode_libdir_separator"; then
8834
	    if test -z "$hardcode_libdirs"; then
10224
	    if test -z "$hardcode_libdirs"; then
8835
	      hardcode_libdirs="$libdir"
10225
	      hardcode_libdirs=$libdir
8836
	    else
10226
	    else
8837
	      # Just accumulate the unique libdirs.
10227
	      # Just accumulate the unique libdirs.
8838
	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
10228
	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
Lines 8857-8901 Link Here
8857
      # Substitute the hardcoded libdirs into the rpath.
10247
      # Substitute the hardcoded libdirs into the rpath.
8858
      if test -n "$hardcode_libdir_separator" &&
10248
      if test -n "$hardcode_libdir_separator" &&
8859
	 test -n "$hardcode_libdirs"; then
10249
	 test -n "$hardcode_libdirs"; then
8860
	libdir="$hardcode_libdirs"
10250
	libdir=$hardcode_libdirs
8861
	eval rpath=\" $hardcode_libdir_flag_spec\"
10251
	eval rpath=\" $hardcode_libdir_flag_spec\"
8862
      fi
10252
      fi
8863
      finalize_rpath="$rpath"
10253
      finalize_rpath=$rpath
8864
10254
8865
      if test -n "$libobjs" && test "$build_old_libs" = yes; then
10255
      if test -n "$libobjs" && test yes = "$build_old_libs"; then
8866
	# Transform all the library objects into standard objects.
10256
	# Transform all the library objects into standard objects.
8867
	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
10257
	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8868
	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
10258
	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
8869
      fi
10259
      fi
8870
10260
8871
      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
10261
      func_generate_dlsyms "$outputname" "@PROGRAM@" false
8872
10262
8873
      # template prelinking step
10263
      # template prelinking step
8874
      if test -n "$prelink_cmds"; then
10264
      if test -n "$prelink_cmds"; then
8875
	func_execute_cmds "$prelink_cmds" 'exit $?'
10265
	func_execute_cmds "$prelink_cmds" 'exit $?'
8876
      fi
10266
      fi
8877
10267
8878
      wrappers_required=yes
10268
      wrappers_required=:
8879
      case $host in
10269
      case $host in
8880
      *cegcc* | *mingw32ce*)
10270
      *cegcc* | *mingw32ce*)
8881
        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
10271
        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
8882
        wrappers_required=no
10272
        wrappers_required=false
8883
        ;;
10273
        ;;
8884
      *cygwin* | *mingw* )
10274
      *cygwin* | *mingw* )
8885
        if test "$build_libtool_libs" != yes; then
10275
        test yes = "$build_libtool_libs" || wrappers_required=false
8886
          wrappers_required=no
8887
        fi
8888
        ;;
10276
        ;;
8889
      *)
10277
      *)
8890
        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
10278
        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
8891
          wrappers_required=no
10279
          wrappers_required=false
8892
        fi
10280
        fi
8893
        ;;
10281
        ;;
8894
      esac
10282
      esac
8895
      if test "$wrappers_required" = no; then
10283
      $wrappers_required || {
8896
	# Replace the output file specification.
10284
	# Replace the output file specification.
8897
	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10285
	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8898
	link_command="$compile_command$compile_rpath"
10286
	link_command=$compile_command$compile_rpath
8899
10287
8900
	# We have no uninstalled library dependencies, so finalize right now.
10288
	# We have no uninstalled library dependencies, so finalize right now.
8901
	exit_status=0
10289
	exit_status=0
Lines 8908-8919 Link Here
8908
	fi
10296
	fi
8909
10297
8910
	# Delete the generated files.
10298
	# Delete the generated files.
8911
	if test -f "$output_objdir/${outputname}S.${objext}"; then
10299
	if test -f "$output_objdir/${outputname}S.$objext"; then
8912
	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
10300
	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
8913
	fi
10301
	fi
8914
10302
8915
	exit $exit_status
10303
	exit $exit_status
8916
      fi
10304
      }
8917
10305
8918
      if test -n "$compile_shlibpath$finalize_shlibpath"; then
10306
      if test -n "$compile_shlibpath$finalize_shlibpath"; then
8919
	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
10307
	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
Lines 8943-8951 Link Here
8943
	fi
10331
	fi
8944
      fi
10332
      fi
8945
10333
8946
      if test "$no_install" = yes; then
10334
      if test yes = "$no_install"; then
8947
	# We don't need to create a wrapper script.
10335
	# We don't need to create a wrapper script.
8948
	link_command="$compile_var$compile_command$compile_rpath"
10336
	link_command=$compile_var$compile_command$compile_rpath
8949
	# Replace the output file specification.
10337
	# Replace the output file specification.
8950
	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
10338
	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
8951
	# Delete the old output file.
10339
	# Delete the old output file.
Lines 8962-8988 Link Here
8962
	exit $EXIT_SUCCESS
10350
	exit $EXIT_SUCCESS
8963
      fi
10351
      fi
8964
10352
8965
      if test "$hardcode_action" = relink; then
10353
      case $hardcode_action,$fast_install in
8966
	# Fast installation is not supported
10354
        relink,*)
8967
	link_command="$compile_var$compile_command$compile_rpath"
10355
	  # Fast installation is not supported
8968
	relink_command="$finalize_var$finalize_command$finalize_rpath"
10356
	  link_command=$compile_var$compile_command$compile_rpath
8969
10357
	  relink_command=$finalize_var$finalize_command$finalize_rpath
8970
	func_warning "this platform does not like uninstalled shared libraries"
10358
8971
	func_warning "\`$output' will be relinked during installation"
10359
	  func_warning "this platform does not like uninstalled shared libraries"
8972
      else
10360
	  func_warning "'$output' will be relinked during installation"
8973
	if test "$fast_install" != no; then
10361
	  ;;
8974
	  link_command="$finalize_var$compile_command$finalize_rpath"
10362
        *,yes)
8975
	  if test "$fast_install" = yes; then
10363
	  link_command=$finalize_var$compile_command$finalize_rpath
8976
	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
10364
	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
8977
	  else
10365
          ;;
8978
	    # fast_install is set to needless
10366
	*,no)
8979
	    relink_command=
10367
	  link_command=$compile_var$compile_command$compile_rpath
8980
	  fi
10368
	  relink_command=$finalize_var$finalize_command$finalize_rpath
8981
	else
10369
          ;;
8982
	  link_command="$compile_var$compile_command$compile_rpath"
10370
	*,needless)
8983
	  relink_command="$finalize_var$finalize_command$finalize_rpath"
10371
	  link_command=$finalize_var$compile_command$finalize_rpath
8984
	fi
10372
	  relink_command=
8985
      fi
10373
          ;;
10374
      esac
8986
10375
8987
      # Replace the output file specification.
10376
      # Replace the output file specification.
8988
      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
10377
      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
Lines 9039-9046 Link Here
9039
	    func_dirname_and_basename "$output" "" "."
10428
	    func_dirname_and_basename "$output" "" "."
9040
	    output_name=$func_basename_result
10429
	    output_name=$func_basename_result
9041
	    output_path=$func_dirname_result
10430
	    output_path=$func_dirname_result
9042
	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
10431
	    cwrappersource=$output_path/$objdir/lt-$output_name.c
9043
	    cwrapper="$output_path/$output_name.exe"
10432
	    cwrapper=$output_path/$output_name.exe
9044
	    $RM $cwrappersource $cwrapper
10433
	    $RM $cwrappersource $cwrapper
9045
	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
10434
	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
9046
10435
Lines 9061-9067 Link Here
9061
	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
10450
	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
9062
	    $opt_dry_run || {
10451
	    $opt_dry_run || {
9063
	      # note: this script will not be executed, so do not chmod.
10452
	      # note: this script will not be executed, so do not chmod.
9064
	      if test "x$build" = "x$host" ; then
10453
	      if test "x$build" = "x$host"; then
9065
		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
10454
		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
9066
	      else
10455
	      else
9067
		func_emit_wrapper no > $func_ltwrapper_scriptname_result
10456
		func_emit_wrapper no > $func_ltwrapper_scriptname_result
Lines 9084-9108 Link Here
9084
    # See if we need to build an old-fashioned archive.
10473
    # See if we need to build an old-fashioned archive.
9085
    for oldlib in $oldlibs; do
10474
    for oldlib in $oldlibs; do
9086
10475
9087
      if test "$build_libtool_libs" = convenience; then
10476
      case $build_libtool_libs in
9088
	oldobjs="$libobjs_save $symfileobj"
10477
        convenience)
9089
	addlibs="$convenience"
10478
	  oldobjs="$libobjs_save $symfileobj"
9090
	build_libtool_libs=no
10479
	  addlibs=$convenience
9091
      else
9092
	if test "$build_libtool_libs" = module; then
9093
	  oldobjs="$libobjs_save"
9094
	  build_libtool_libs=no
10480
	  build_libtool_libs=no
9095
	else
10481
	  ;;
10482
	module)
10483
	  oldobjs=$libobjs_save
10484
	  addlibs=$old_convenience
10485
	  build_libtool_libs=no
10486
          ;;
10487
	*)
9096
	  oldobjs="$old_deplibs $non_pic_objects"
10488
	  oldobjs="$old_deplibs $non_pic_objects"
9097
	  if test "$preload" = yes && test -f "$symfileobj"; then
10489
	  $preload && test -f "$symfileobj" \
9098
	    func_append oldobjs " $symfileobj"
10490
	    && func_append oldobjs " $symfileobj"
9099
	  fi
10491
	  addlibs=$old_convenience
9100
	fi
10492
	  ;;
9101
	addlibs="$old_convenience"
10493
      esac
9102
      fi
9103
10494
9104
      if test -n "$addlibs"; then
10495
      if test -n "$addlibs"; then
9105
	gentop="$output_objdir/${outputname}x"
10496
	gentop=$output_objdir/${outputname}x
9106
	func_append generated " $gentop"
10497
	func_append generated " $gentop"
9107
10498
9108
	func_extract_archives $gentop $addlibs
10499
	func_extract_archives $gentop $addlibs
Lines 9110-9122 Link Here
9110
      fi
10501
      fi
9111
10502
9112
      # Do each command in the archive commands.
10503
      # Do each command in the archive commands.
9113
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
10504
      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
9114
	cmds=$old_archive_from_new_cmds
10505
	cmds=$old_archive_from_new_cmds
9115
      else
10506
      else
9116
10507
9117
	# Add any objects from preloaded convenience libraries
10508
	# Add any objects from preloaded convenience libraries
9118
	if test -n "$dlprefiles"; then
10509
	if test -n "$dlprefiles"; then
9119
	  gentop="$output_objdir/${outputname}x"
10510
	  gentop=$output_objdir/${outputname}x
9120
	  func_append generated " $gentop"
10511
	  func_append generated " $gentop"
9121
10512
9122
	  func_extract_archives $gentop $dlprefiles
10513
	  func_extract_archives $gentop $dlprefiles
Lines 9137-9143 Link Here
9137
	  :
10528
	  :
9138
	else
10529
	else
9139
	  echo "copying selected object files to avoid basename conflicts..."
10530
	  echo "copying selected object files to avoid basename conflicts..."
9140
	  gentop="$output_objdir/${outputname}x"
10531
	  gentop=$output_objdir/${outputname}x
9141
	  func_append generated " $gentop"
10532
	  func_append generated " $gentop"
9142
	  func_mkdir_p "$gentop"
10533
	  func_mkdir_p "$gentop"
9143
	  save_oldobjs=$oldobjs
10534
	  save_oldobjs=$oldobjs
Lines 9146-9152 Link Here
9146
	  for obj in $save_oldobjs
10537
	  for obj in $save_oldobjs
9147
	  do
10538
	  do
9148
	    func_basename "$obj"
10539
	    func_basename "$obj"
9149
	    objbase="$func_basename_result"
10540
	    objbase=$func_basename_result
9150
	    case " $oldobjs " in
10541
	    case " $oldobjs " in
9151
	    " ") oldobjs=$obj ;;
10542
	    " ") oldobjs=$obj ;;
9152
	    *[\ /]"$objbase "*)
10543
	    *[\ /]"$objbase "*)
Lines 9215-9232 Link Here
9215
	    else
10606
	    else
9216
	      # the above command should be used before it gets too long
10607
	      # the above command should be used before it gets too long
9217
	      oldobjs=$objlist
10608
	      oldobjs=$objlist
9218
	      if test "$obj" = "$last_oldobj" ; then
10609
	      if test "$obj" = "$last_oldobj"; then
9219
		RANLIB=$save_RANLIB
10610
		RANLIB=$save_RANLIB
9220
	      fi
10611
	      fi
9221
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
10612
	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9222
	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
10613
	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
9223
	      objlist=
10614
	      objlist=
9224
	      len=$len0
10615
	      len=$len0
9225
	    fi
10616
	    fi
9226
	  done
10617
	  done
9227
	  RANLIB=$save_RANLIB
10618
	  RANLIB=$save_RANLIB
9228
	  oldobjs=$objlist
10619
	  oldobjs=$objlist
9229
	  if test "X$oldobjs" = "X" ; then
10620
	  if test -z "$oldobjs"; then
9230
	    eval cmds=\"\$concat_cmds\"
10621
	    eval cmds=\"\$concat_cmds\"
9231
	  else
10622
	  else
9232
	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
10623
	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
Lines 9243-9249 Link Here
9243
    case $output in
10634
    case $output in
9244
    *.la)
10635
    *.la)
9245
      old_library=
10636
      old_library=
9246
      test "$build_old_libs" = yes && old_library="$libname.$libext"
10637
      test yes = "$build_old_libs" && old_library=$libname.$libext
9247
      func_verbose "creating $output"
10638
      func_verbose "creating $output"
9248
10639
9249
      # Preserve any variables that may affect compiler behavior
10640
      # Preserve any variables that may affect compiler behavior
Lines 9258-9288 Link Here
9258
	fi
10649
	fi
9259
      done
10650
      done
9260
      # Quote the link command for shipping.
10651
      # Quote the link command for shipping.
9261
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
10652
      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9262
      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
10653
      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9263
      if test "$hardcode_automatic" = yes ; then
10654
      if test yes = "$hardcode_automatic"; then
9264
	relink_command=
10655
	relink_command=
9265
      fi
10656
      fi
9266
10657
9267
      # Only create the output if not a dry run.
10658
      # Only create the output if not a dry run.
9268
      $opt_dry_run || {
10659
      $opt_dry_run || {
9269
	for installed in no yes; do
10660
	for installed in no yes; do
9270
	  if test "$installed" = yes; then
10661
	  if test yes = "$installed"; then
9271
	    if test -z "$install_libdir"; then
10662
	    if test -z "$install_libdir"; then
9272
	      break
10663
	      break
9273
	    fi
10664
	    fi
9274
	    output="$output_objdir/$outputname"i
10665
	    output=$output_objdir/${outputname}i
9275
	    # Replace all uninstalled libtool libraries with the installed ones
10666
	    # Replace all uninstalled libtool libraries with the installed ones
9276
	    newdependency_libs=
10667
	    newdependency_libs=
9277
	    for deplib in $dependency_libs; do
10668
	    for deplib in $dependency_libs; do
9278
	      case $deplib in
10669
	      case $deplib in
9279
	      *.la)
10670
	      *.la)
9280
		func_basename "$deplib"
10671
		func_basename "$deplib"
9281
		name="$func_basename_result"
10672
		name=$func_basename_result
9282
		func_resolve_sysroot "$deplib"
10673
		func_resolve_sysroot "$deplib"
9283
		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
10674
		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
9284
		test -z "$libdir" && \
10675
		test -z "$libdir" && \
9285
		  func_fatal_error "\`$deplib' is not a valid libtool archive"
10676
		  func_fatal_error "'$deplib' is not a valid libtool archive"
9286
		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
10677
		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
9287
		;;
10678
		;;
9288
	      -L*)
10679
	      -L*)
Lines 9298-9320 Link Here
9298
	      *) func_append newdependency_libs " $deplib" ;;
10689
	      *) func_append newdependency_libs " $deplib" ;;
9299
	      esac
10690
	      esac
9300
	    done
10691
	    done
9301
	    dependency_libs="$newdependency_libs"
10692
	    dependency_libs=$newdependency_libs
9302
	    newdlfiles=
10693
	    newdlfiles=
9303
10694
9304
	    for lib in $dlfiles; do
10695
	    for lib in $dlfiles; do
9305
	      case $lib in
10696
	      case $lib in
9306
	      *.la)
10697
	      *.la)
9307
	        func_basename "$lib"
10698
	        func_basename "$lib"
9308
		name="$func_basename_result"
10699
		name=$func_basename_result
9309
		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
10700
		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9310
		test -z "$libdir" && \
10701
		test -z "$libdir" && \
9311
		  func_fatal_error "\`$lib' is not a valid libtool archive"
10702
		  func_fatal_error "'$lib' is not a valid libtool archive"
9312
		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
10703
		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
9313
		;;
10704
		;;
9314
	      *) func_append newdlfiles " $lib" ;;
10705
	      *) func_append newdlfiles " $lib" ;;
9315
	      esac
10706
	      esac
9316
	    done
10707
	    done
9317
	    dlfiles="$newdlfiles"
10708
	    dlfiles=$newdlfiles
9318
	    newdlprefiles=
10709
	    newdlprefiles=
9319
	    for lib in $dlprefiles; do
10710
	    for lib in $dlprefiles; do
9320
	      case $lib in
10711
	      case $lib in
Lines 9324-9357 Link Here
9324
		# didn't already link the preopened objects directly into
10715
		# didn't already link the preopened objects directly into
9325
		# the library:
10716
		# the library:
9326
		func_basename "$lib"
10717
		func_basename "$lib"
9327
		name="$func_basename_result"
10718
		name=$func_basename_result
9328
		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
10719
		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9329
		test -z "$libdir" && \
10720
		test -z "$libdir" && \
9330
		  func_fatal_error "\`$lib' is not a valid libtool archive"
10721
		  func_fatal_error "'$lib' is not a valid libtool archive"
9331
		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
10722
		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
9332
		;;
10723
		;;
9333
	      esac
10724
	      esac
9334
	    done
10725
	    done
9335
	    dlprefiles="$newdlprefiles"
10726
	    dlprefiles=$newdlprefiles
9336
	  else
10727
	  else
9337
	    newdlfiles=
10728
	    newdlfiles=
9338
	    for lib in $dlfiles; do
10729
	    for lib in $dlfiles; do
9339
	      case $lib in
10730
	      case $lib in
9340
		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
10731
		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
9341
		*) abs=`pwd`"/$lib" ;;
10732
		*) abs=`pwd`"/$lib" ;;
9342
	      esac
10733
	      esac
9343
	      func_append newdlfiles " $abs"
10734
	      func_append newdlfiles " $abs"
9344
	    done
10735
	    done
9345
	    dlfiles="$newdlfiles"
10736
	    dlfiles=$newdlfiles
9346
	    newdlprefiles=
10737
	    newdlprefiles=
9347
	    for lib in $dlprefiles; do
10738
	    for lib in $dlprefiles; do
9348
	      case $lib in
10739
	      case $lib in
9349
		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
10740
		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
9350
		*) abs=`pwd`"/$lib" ;;
10741
		*) abs=`pwd`"/$lib" ;;
9351
	      esac
10742
	      esac
9352
	      func_append newdlprefiles " $abs"
10743
	      func_append newdlprefiles " $abs"
9353
	    done
10744
	    done
9354
	    dlprefiles="$newdlprefiles"
10745
	    dlprefiles=$newdlprefiles
9355
	  fi
10746
	  fi
9356
	  $RM $output
10747
	  $RM $output
9357
	  # place dlname in correct position for cygwin
10748
	  # place dlname in correct position for cygwin
Lines 9367-9376 Link Here
9367
	  case $host,$output,$installed,$module,$dlname in
10758
	  case $host,$output,$installed,$module,$dlname in
9368
	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
10759
	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
9369
	      # If a -bindir argument was supplied, place the dll there.
10760
	      # If a -bindir argument was supplied, place the dll there.
9370
	      if test "x$bindir" != x ;
10761
	      if test -n "$bindir"; then
9371
	      then
9372
		func_relative_path "$install_libdir" "$bindir"
10762
		func_relative_path "$install_libdir" "$bindir"
9373
		tdlname=$func_relative_path_result$dlname
10763
		tdlname=$func_relative_path_result/$dlname
9374
	      else
10764
	      else
9375
		# Otherwise fall back on heuristic.
10765
		# Otherwise fall back on heuristic.
9376
		tdlname=../bin/$dlname
10766
		tdlname=../bin/$dlname
Lines 9379-9385 Link Here
9379
	  esac
10769
	  esac
9380
	  $ECHO > $output "\
10770
	  $ECHO > $output "\
9381
# $outputname - a libtool library file
10771
# $outputname - a libtool library file
9382
# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
10772
# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
9383
#
10773
#
9384
# Please DO NOT delete this file!
10774
# Please DO NOT delete this file!
9385
# It is necessary for linking the library.
10775
# It is necessary for linking the library.
Lines 9393-9399 Link Here
9393
# The name of the static archive.
10783
# The name of the static archive.
9394
old_library='$old_library'
10784
old_library='$old_library'
9395
10785
9396
# Linker flags that can not go in dependency_libs.
10786
# Linker flags that cannot go in dependency_libs.
9397
inherited_linker_flags='$new_inherited_linker_flags'
10787
inherited_linker_flags='$new_inherited_linker_flags'
9398
10788
9399
# Libraries that this one depends upon.
10789
# Libraries that this one depends upon.
Lines 9419-9425 Link Here
9419
10809
9420
# Directory that this library needs to be installed in:
10810
# Directory that this library needs to be installed in:
9421
libdir='$install_libdir'"
10811
libdir='$install_libdir'"
9422
	  if test "$installed" = no && test "$need_relink" = yes; then
10812
	  if test no,yes = "$installed,$need_relink"; then
9423
	    $ECHO >> $output "\
10813
	    $ECHO >> $output "\
9424
relink_command=\"$relink_command\""
10814
relink_command=\"$relink_command\""
9425
	  fi
10815
	  fi
Lines 9434-9460 Link Here
9434
    exit $EXIT_SUCCESS
10824
    exit $EXIT_SUCCESS
9435
}
10825
}
9436
10826
9437
{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
10827
if test link = "$opt_mode" || test relink = "$opt_mode"; then
9438
    func_mode_link ${1+"$@"}
10828
  func_mode_link ${1+"$@"}
10829
fi
9439
10830
9440
10831
9441
# func_mode_uninstall arg...
10832
# func_mode_uninstall arg...
9442
func_mode_uninstall ()
10833
func_mode_uninstall ()
9443
{
10834
{
9444
    $opt_debug
10835
    $debug_cmd
9445
    RM="$nonopt"
10836
10837
    RM=$nonopt
9446
    files=
10838
    files=
9447
    rmforce=
10839
    rmforce=false
9448
    exit_status=0
10840
    exit_status=0
9449
10841
9450
    # This variable tells wrapper scripts just to set variables rather
10842
    # This variable tells wrapper scripts just to set variables rather
9451
    # than running their programs.
10843
    # than running their programs.
9452
    libtool_install_magic="$magic"
10844
    libtool_install_magic=$magic
9453
10845
9454
    for arg
10846
    for arg
9455
    do
10847
    do
9456
      case $arg in
10848
      case $arg in
9457
      -f) func_append RM " $arg"; rmforce=yes ;;
10849
      -f) func_append RM " $arg"; rmforce=: ;;
9458
      -*) func_append RM " $arg" ;;
10850
      -*) func_append RM " $arg" ;;
9459
      *) func_append files " $arg" ;;
10851
      *) func_append files " $arg" ;;
9460
      esac
10852
      esac
Lines 9467-9484 Link Here
9467
10859
9468
    for file in $files; do
10860
    for file in $files; do
9469
      func_dirname "$file" "" "."
10861
      func_dirname "$file" "" "."
9470
      dir="$func_dirname_result"
10862
      dir=$func_dirname_result
9471
      if test "X$dir" = X.; then
10863
      if test . = "$dir"; then
9472
	odir="$objdir"
10864
	odir=$objdir
9473
      else
10865
      else
9474
	odir="$dir/$objdir"
10866
	odir=$dir/$objdir
9475
      fi
10867
      fi
9476
      func_basename "$file"
10868
      func_basename "$file"
9477
      name="$func_basename_result"
10869
      name=$func_basename_result
9478
      test "$opt_mode" = uninstall && odir="$dir"
10870
      test uninstall = "$opt_mode" && odir=$dir
9479
10871
9480
      # Remember odir for removal later, being careful to avoid duplicates
10872
      # Remember odir for removal later, being careful to avoid duplicates
9481
      if test "$opt_mode" = clean; then
10873
      if test clean = "$opt_mode"; then
9482
	case " $rmdirs " in
10874
	case " $rmdirs " in
9483
	  *" $odir "*) ;;
10875
	  *" $odir "*) ;;
9484
	  *) func_append rmdirs " $odir" ;;
10876
	  *) func_append rmdirs " $odir" ;;
Lines 9493-9503 Link Here
9493
      elif test -d "$file"; then
10885
      elif test -d "$file"; then
9494
	exit_status=1
10886
	exit_status=1
9495
	continue
10887
	continue
9496
      elif test "$rmforce" = yes; then
10888
      elif $rmforce; then
9497
	continue
10889
	continue
9498
      fi
10890
      fi
9499
10891
9500
      rmfiles="$file"
10892
      rmfiles=$file
9501
10893
9502
      case $name in
10894
      case $name in
9503
      *.la)
10895
      *.la)
Lines 9511-9517 Link Here
9511
	  done
10903
	  done
9512
	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
10904
	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
9513
10905
9514
	  case "$opt_mode" in
10906
	  case $opt_mode in
9515
	  clean)
10907
	  clean)
9516
	    case " $library_names " in
10908
	    case " $library_names " in
9517
	    *" $dlname "*) ;;
10909
	    *" $dlname "*) ;;
Lines 9522-9533 Link Here
9522
	  uninstall)
10914
	  uninstall)
9523
	    if test -n "$library_names"; then
10915
	    if test -n "$library_names"; then
9524
	      # Do each command in the postuninstall commands.
10916
	      # Do each command in the postuninstall commands.
9525
	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
10917
	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
9526
	    fi
10918
	    fi
9527
10919
9528
	    if test -n "$old_library"; then
10920
	    if test -n "$old_library"; then
9529
	      # Do each command in the old_postuninstall commands.
10921
	      # Do each command in the old_postuninstall commands.
9530
	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
10922
	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
9531
	    fi
10923
	    fi
9532
	    # FIXME: should reinstall the best remaining shared library.
10924
	    # FIXME: should reinstall the best remaining shared library.
9533
	    ;;
10925
	    ;;
Lines 9543-9563 Link Here
9543
	  func_source $dir/$name
10935
	  func_source $dir/$name
9544
10936
9545
	  # Add PIC object to the list of files to remove.
10937
	  # Add PIC object to the list of files to remove.
9546
	  if test -n "$pic_object" &&
10938
	  if test -n "$pic_object" && test none != "$pic_object"; then
9547
	     test "$pic_object" != none; then
9548
	    func_append rmfiles " $dir/$pic_object"
10939
	    func_append rmfiles " $dir/$pic_object"
9549
	  fi
10940
	  fi
9550
10941
9551
	  # Add non-PIC object to the list of files to remove.
10942
	  # Add non-PIC object to the list of files to remove.
9552
	  if test -n "$non_pic_object" &&
10943
	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
9553
	     test "$non_pic_object" != none; then
9554
	    func_append rmfiles " $dir/$non_pic_object"
10944
	    func_append rmfiles " $dir/$non_pic_object"
9555
	  fi
10945
	  fi
9556
	fi
10946
	fi
9557
	;;
10947
	;;
9558
10948
9559
      *)
10949
      *)
9560
	if test "$opt_mode" = clean ; then
10950
	if test clean = "$opt_mode"; then
9561
	  noexename=$name
10951
	  noexename=$name
9562
	  case $file in
10952
	  case $file in
9563
	  *.exe)
10953
	  *.exe)
Lines 9584-9595 Link Here
9584
10974
9585
	    # note $name still contains .exe if it was in $file originally
10975
	    # note $name still contains .exe if it was in $file originally
9586
	    # as does the version of $file that was added into $rmfiles
10976
	    # as does the version of $file that was added into $rmfiles
9587
	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
10977
	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
9588
	    if test "$fast_install" = yes && test -n "$relink_command"; then
10978
	    if test yes = "$fast_install" && test -n "$relink_command"; then
9589
	      func_append rmfiles " $odir/lt-$name"
10979
	      func_append rmfiles " $odir/lt-$name"
9590
	    fi
10980
	    fi
9591
	    if test "X$noexename" != "X$name" ; then
10981
	    if test "X$noexename" != "X$name"; then
9592
	      func_append rmfiles " $odir/lt-${noexename}.c"
10982
	      func_append rmfiles " $odir/lt-$noexename.c"
9593
	    fi
10983
	    fi
9594
	  fi
10984
	  fi
9595
	fi
10985
	fi
Lines 9598-9604 Link Here
9598
      func_show_eval "$RM $rmfiles" 'exit_status=1'
10988
      func_show_eval "$RM $rmfiles" 'exit_status=1'
9599
    done
10989
    done
9600
10990
9601
    # Try to remove the ${objdir}s in the directories where we deleted files
10991
    # Try to remove the $objdir's in the directories where we deleted files
9602
    for dir in $rmdirs; do
10992
    for dir in $rmdirs; do
9603
      if test -d "$dir"; then
10993
      if test -d "$dir"; then
9604
	func_show_eval "rmdir $dir >/dev/null 2>&1"
10994
	func_show_eval "rmdir $dir >/dev/null 2>&1"
Lines 9608-9623 Link Here
9608
    exit $exit_status
10998
    exit $exit_status
9609
}
10999
}
9610
11000
9611
{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
11001
if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
9612
    func_mode_uninstall ${1+"$@"}
11002
  func_mode_uninstall ${1+"$@"}
11003
fi
9613
11004
9614
test -z "$opt_mode" && {
11005
test -z "$opt_mode" && {
9615
  help="$generic_help"
11006
  help=$generic_help
9616
  func_fatal_help "you must specify a MODE"
11007
  func_fatal_help "you must specify a MODE"
9617
}
11008
}
9618
11009
9619
test -z "$exec_cmd" && \
11010
test -z "$exec_cmd" && \
9620
  func_fatal_help "invalid operation mode \`$opt_mode'"
11011
  func_fatal_help "invalid operation mode '$opt_mode'"
9621
11012
9622
if test -n "$exec_cmd"; then
11013
if test -n "$exec_cmd"; then
9623
  eval exec "$exec_cmd"
11014
  eval exec "$exec_cmd"
Lines 9628-9634 Link Here
9628
11019
9629
11020
9630
# The TAGs below are defined such that we never get into a situation
11021
# The TAGs below are defined such that we never get into a situation
9631
# in which we disable both kinds of libraries.  Given conflicting
11022
# where we disable both kinds of libraries.  Given conflicting
9632
# choices, we go for a static library, that is the most portable,
11023
# choices, we go for a static library, that is the most portable,
9633
# since we can't tell whether shared libraries were disabled because
11024
# since we can't tell whether shared libraries were disabled because
9634
# the user asked for that or because the platform doesn't support
11025
# the user asked for that or because the platform doesn't support
Lines 9651-9655 Link Here
9651
# mode:shell-script
11042
# mode:shell-script
9652
# sh-indentation:2
11043
# sh-indentation:2
9653
# End:
11044
# End:
9654
# vi:sw=2
9655
(-)apr-1.5.1.old/build/ltversion.m4 (-6 / +6 lines)
Lines 1-6 Link Here
1
# ltversion.m4 -- version numbers			-*- Autoconf -*-
1
# ltversion.m4 -- version numbers			-*- Autoconf -*-
2
#
2
#
3
#   Copyright (C) 2004 Free Software Foundation, Inc.
3
#   Copyright (C) 2004, 2011-2014 Free Software Foundation, Inc.
4
#   Written by Scott James Remnant, 2004
4
#   Written by Scott James Remnant, 2004
5
#
5
#
6
# This file is free software; the Free Software Foundation gives
6
# This file is free software; the Free Software Foundation gives
Lines 9-23 Link Here
9
9
10
# @configure_input@
10
# @configure_input@
11
11
12
# serial 3337 ltversion.m4
12
# serial 4105 ltversion.m4
13
# This file is part of GNU Libtool
13
# This file is part of GNU Libtool
14
14
15
m4_define([LT_PACKAGE_VERSION], [2.4.2])
15
m4_define([LT_PACKAGE_VERSION], [2.4.2.458.26-92994])
16
m4_define([LT_PACKAGE_REVISION], [1.3337])
16
m4_define([LT_PACKAGE_REVISION], [2.4.3])
17
17
18
AC_DEFUN([LTVERSION_VERSION],
18
AC_DEFUN([LTVERSION_VERSION],
19
[macro_version='2.4.2'
19
[macro_version='2.4.2.458.26-92994'
20
macro_revision='1.3337'
20
macro_revision='2.4.3'
21
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
21
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
22
_LT_DECL(, macro_revision, 0)
22
_LT_DECL(, macro_revision, 0)
23
])
23
])
(-)apr-1.5.1.old/configure (-2 / +2 lines)
Lines 10657-10664 Link Here
10657
10657
10658
10658
10659
10659
10660
macro_version='2.4.2'
10660
macro_version='2.4.2.458.26-92994'
10661
macro_revision='1.3337'
10661
macro_revision='2.4.3'
10662
10662
10663
10663
10664
10664

Return to bug 527506