~ubuntu-branches/ubuntu/quantal/sawfish/quantal

« back to all changes in this revision

Viewing changes to libtool

  • Committer: Bazaar Package Importer
  • Author(s): Luis Rodrigo Gallardo Cruz
  • Date: 2009-05-02 15:03:53 UTC
  • mfrom: (1.2.9 upstream) (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090502150353-36w2jyk0si2s0tqa
Tags: 1:1.3.5.2-1
* New Upstream Release. Adds assorted bugfixes and updates from community
  reviewed patches and updates the build infrastructure to the new
  librep and rep-gtk releases.

  - theme/Crux/theme.jl: Added two new button layouts:
    Complete and Complete-Inverse (Closes: #101164).

  - debian/patches/integration.jl, debian/patches/menus.jl,
    debian/patches/sawfish-menus.jl have been integrated upstream.

  - config.h.in cherry picked from upstream 5b22f0c28 to define some macros.

* debian/control: Bump build depends on librep and rep-gtk and add libtool.
* Expand package descriptions.
* sawfish-dbg is Section: debug and Recommends: sawfish-lisp-source.
* Update debian/watch for the new upstream tarball names.
* Remove unused quilt version lintian override.
* Bump Standards-Version to 3.8.1. No changes needed.

Show diffs side-by-side

added added

removed removed

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