~pdf-converter-dev/pdfconverter/pdf_converter

« back to all changes in this revision

Viewing changes to Debug/libtool

  • Committer: Paolo Rotolo
  • Date: 2011-08-27 19:55:51 UTC
  • Revision ID: paolorotolo@ubuntu-it.org-20110827195551-igc3drum7fu074z7
Traduzione in PyGI

Show diffs side-by-side

added added

removed removed

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