~cairo-dock-team/cairo-dock-plug-ins/experimental

« back to all changes in this revision

Viewing changes to libtool

  • Committer: fabounet
  • Date: 2008-01-11 01:35:06 UTC
  • Revision ID: svn-v4:620951bb-bb42-0410-82c3-830e739ed170:trunk/plug-ins:294
enlevage fichiers indesirables

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