/rusxmms/librcc

To get this branch, use:
bzr branch http://suren.me/webbzr/rusxmms/librcc

« back to all changes in this revision

Viewing changes to libtool

  • Committer: Suren A. Chilingaryan
  • Date: 2005-06-28 23:44:19 UTC
  • Revision ID: Arch-1:ds@dside.dyndns.org--darksoft-2004%librcc--main--0.1--patch-2
29.06.2005

Show diffs side-by-side

added added

removed removed

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