~ubuntu-branches/ubuntu/precise/libxfont/precise-security

« back to all changes in this revision

Viewing changes to libtool

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2007-07-18 16:46:59 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070718164659-h894n91b3dynfwi2
Tags: 1:1.3.0-0ubuntu1
* New upstream release.
* debian/control:
  - Maintainer field updated
* debian/copyright:
  - Added packaging copyright

Show diffs side-by-side

added added

removed removed

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