~ubuntu-branches/ubuntu/hoary/apt-spy/hoary

« back to all changes in this revision

Viewing changes to libtool

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Stafford
  • Date: 2004-12-09 12:45:08 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20041209124508-we5ajs683urbb3jg
Tags: 3.1-13
* Transition to libcurl3 (Closes: #279472)
* fix manpage (Closes: #281897)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
 
3
 
# libtool - Provide generalized library-building support services.
4
 
# Generated automatically by ltconfig (GNU libtool 1.3c (1.695 2000/02/24 02:15:35))
5
 
# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
6
 
#
7
 
# Copyright (C) 1996-2000 Free Software Foundation, Inc.
8
 
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
9
 
#
10
 
# This program is free software; you can redistribute it and/or modify
11
 
# it under the terms of the GNU General Public License as published by
12
 
# the Free Software Foundation; either version 2 of the License, or
13
 
# (at your option) any later version.
14
 
#
15
 
# This program is distributed in the hope that it will be useful, but
16
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
17
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18
 
# General Public License for more details.
19
 
#
20
 
# You should have received a copy of the GNU General Public License
21
 
# along with this program; if not, write to the Free Software
22
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
 
#
24
 
# As a special exception to the GNU General Public License, if you
25
 
# distribute this file as part of a program that contains a
26
 
# configuration script generated by Autoconf, you may include it under
27
 
# the same distribution terms that you use for the rest of that program.
28
 
 
29
 
# Sed that helps us avoid accidentally triggering echo(1) options like -n.
30
 
Xsed="sed -e s/^X//"
31
 
 
32
 
# The HP-UX ksh and POSIX shell print the target directory to stdout
33
 
# if CDPATH is set.
34
 
if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
35
 
 
36
 
### BEGIN LIBTOOL CONFIG
37
 
# Libtool was configured as follows, on host sagitta:
38
 
#
39
 
# AR="" CC="gcc" CFLAGS="-O2" CPPFLAGS="" \
40
 
# MAGIC="" LD="/usr/bin/ld" LDFLAGS="-s" LIBS="" \
41
 
# LN_S="ln -s" NM="/usr/bin/nm -B" RANLIB="ranlib" STRIP="strip" \
42
 
# AS="" DLLTOOL="" OBJDUMP="" \
43
 
# objext="" exeext="" reload_flag="" \
44
 
# deplibs_check_method="pass_all" file_magic_cmd="\${MAGIC}" \
45
 
#   ./ltconfig --cache-file=./config.cache --disable-static --with-gcc --with-gnu-ld --enable-dlopen --no-verify --build=i586-pc-linux-gnu ./ltmain.sh i586-pc-linux-gnu
46
 
#
47
 
# Compiler and other test output produced by ltconfig, useful for
48
 
# debugging ltconfig, is in ./config.log if it exists.
49
 
# The version of ltconfig that generated this script.
50
 
LTCONFIG_VERSION="1.3c"
51
 
 
52
 
# Shell to use when invoking shell scripts.
53
 
SHELL="/bin/sh"
54
 
 
55
 
# Whether or not to build shared libraries.
56
 
build_libtool_libs=yes
57
 
 
58
 
# Whether or not to build static libraries.
59
 
build_old_libs=no
60
 
 
61
 
# Whether or not to optimize for fast installation.
62
 
fast_install=yes
63
 
 
64
 
# The host system.
65
 
host_alias=i586-pc-linux-gnu
66
 
host=i586-pc-linux-gnu
67
 
 
68
 
# An echo program that does not interpret backslashes.
69
 
echo="echo"
70
 
 
71
 
# The archiver.
72
 
AR="ar"
73
 
 
74
 
# The default C compiler.
75
 
CC="gcc"
76
 
 
77
 
# The linker used to build libraries.
78
 
LD="/usr/bin/ld"
79
 
 
80
 
# Whether we need hard or soft links.
81
 
LN_S="ln -s"
82
 
 
83
 
# A BSD-compatible nm program.
84
 
NM="/usr/bin/nm -B"
85
 
 
86
 
# A symbol stripping program
87
 
STRIP=strip
88
 
 
89
 
# Used to examine libraries when file_magic_cmd begins "file"
90
 
MAGIC=file
91
 
 
92
 
# Used on cygwin: DLL creation program.
93
 
DLLTOOL="dlltool"
94
 
 
95
 
# Used on cygwin: object dumper.
96
 
OBJDUMP="objdump"
97
 
 
98
 
# Used on cygwin: assembler.
99
 
AS="as"
100
 
 
101
 
# The name of the directory that contains temporary libtool files.
102
 
objdir=.libs
103
 
 
104
 
# How to create reloadable object files.
105
 
reload_flag=" -r"
106
 
reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
107
 
 
108
 
# How to pass a linker flag through the compiler.
109
 
wl="-Wl,"
110
 
 
111
 
# Object file suffix (normally "o").
112
 
objext="o"
113
 
 
114
 
# Old archive suffix (normally "a").
115
 
libext="a"
116
 
 
117
 
# Executable file suffix (normally "").
118
 
exeext=""
119
 
 
120
 
# Additional compiler flags for building library objects.
121
 
pic_flag=" -fPIC"
122
 
pic_mode=default
123
 
 
124
 
# Does compiler simultaneously support -c and -o options?
125
 
compiler_c_o="yes"
126
 
 
127
 
# Can we write directly to a .lo ?
128
 
compiler_o_lo="yes"
129
 
 
130
 
# Must we lock files when doing compilation ?
131
 
need_locks="no"
132
 
 
133
 
# Do we need the lib prefix for modules?
134
 
need_lib_prefix=no
135
 
 
136
 
# Do we need a version for libraries?
137
 
need_version=no
138
 
 
139
 
# Whether dlopen is supported.
140
 
dlopen_support=yes
141
 
 
142
 
# Whether dlopen of programs is supported.
143
 
dlopen_self=yes
144
 
 
145
 
# Whether dlopen of statically linked programs is supported.
146
 
dlopen_self_static=no
147
 
 
148
 
# Compiler flag to prevent dynamic linking.
149
 
link_static_flag="-static"
150
 
 
151
 
# Compiler flag to turn off builtin functions.
152
 
no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
153
 
 
154
 
# Compiler flag to allow reflexive dlopens.
155
 
export_dynamic_flag_spec="\${wl}--export-dynamic"
156
 
 
157
 
# Compiler flag to generate shared objects directly from archives.
158
 
whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
159
 
 
160
 
# Compiler flag to generate thread-safe objects.
161
 
thread_safe_flag_spec=""
162
 
 
163
 
# Library versioning type.
164
 
version_type=linux
165
 
 
166
 
# Format of library name prefix.
167
 
libname_spec="lib\$name"
168
 
 
169
 
# List of archive names.  First name is the real one, the rest are links.
170
 
# The last name is the one that the linker finds with -lNAME.
171
 
library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
172
 
 
173
 
# The coded name of the library, if different from the real name.
174
 
soname_spec="\${libname}\${release}.so\$major"
175
 
 
176
 
# Commands used to build and install an old-style archive.
177
 
RANLIB="ranlib"
178
 
old_archive_cmds="\$AR cru \$oldlib\$oldobjs\$old_deplibs"
179
 
old_postinstall_cmds="chmod 644 \$oldlib"
180
 
old_postuninstall_cmds=""
181
 
 
182
 
# Create an old-style archive from a shared archive.
183
 
old_archive_from_new_cmds=""
184
 
 
185
 
# Create a temporary old-style archive to link instead of a shared archive.
186
 
old_archive_from_expsyms_cmds=""
187
 
 
188
 
# Commands used to build and install a shared archive.
189
 
archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
190
 
archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
191
 
postinstall_cmds=""
192
 
postuninstall_cmds=""
193
 
 
194
 
# Commands to strip libraries.
195
 
old_striplib="strip --strip-debug"
196
 
striplib="strip --strip-unneeded"
197
 
 
198
 
# Method to check whether dependent libraries are shared objects.
199
 
deplibs_check_method="pass_all"
200
 
 
201
 
# Command to use when deplibs_check_method == file_magic.
202
 
file_magic_cmd="\${MAGIC}"
203
 
 
204
 
# Flag that allows shared libraries with undefined symbols to be built.
205
 
allow_undefined_flag=""
206
 
 
207
 
# Flag that forces no undefined symbols.
208
 
no_undefined_flag=""
209
 
 
210
 
# Commands used to finish a libtool library installation in a directory.
211
 
finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
212
 
 
213
 
# Same as above, but a single script fragment to be evaled but not shown.
214
 
finish_eval=""
215
 
 
216
 
# Take the output of nm and produce a listing of raw symbols and C names.
217
 
global_symbol_pipe="sed -n -e 's/^.*[   ]\\([ABCDGISTW]\\)[     ][      ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
218
 
 
219
 
# Transform the output of nm in a proper C declaration
220
 
global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
221
 
 
222
 
# This is the shared library runtime path variable.
223
 
runpath_var=LD_RUN_PATH
224
 
 
225
 
# This is the shared library path variable.
226
 
shlibpath_var=LD_LIBRARY_PATH
227
 
 
228
 
# Is shlibpath searched before the hard-coded library search path?
229
 
shlibpath_overrides_runpath=no
230
 
 
231
 
# How to hardcode a shared library path into an executable.
232
 
hardcode_action=immediate
233
 
 
234
 
# Whether we should hardcode library paths into libraries.
235
 
hardcode_into_libs=yes
236
 
 
237
 
# Flag to hardcode $libdir into a binary during linking.
238
 
# This must work even if $libdir does not exist.
239
 
hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
240
 
 
241
 
# Whether we need a single -rpath flag with a separated argument.
242
 
hardcode_libdir_separator=""
243
 
 
244
 
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
245
 
# resulting binary.
246
 
hardcode_direct=no
247
 
 
248
 
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
249
 
# resulting binary.
250
 
hardcode_minus_L=no
251
 
 
252
 
# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
253
 
# the resulting binary.
254
 
hardcode_shlibpath_var=unsupported
255
 
 
256
 
# Whether libtool must link a program against all its dependency libraries.
257
 
link_all_deplibs=unknown
258
 
 
259
 
# Compile-time system search path for libraries
260
 
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
261
 
 
262
 
# Run-time system search path for libraries
263
 
sys_lib_dlsearch_path_spec="/lib /usr/lib"
264
 
 
265
 
# Fix the shell variable $srcfile for the compiler.
266
 
fix_srcfile_path=""
267
 
 
268
 
# Set to yes if exported symbols are required.
269
 
always_export_symbols=no
270
 
 
271
 
# The commands to list exported symbols.
272
 
export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
273
 
 
274
 
# The commands to extract the exported symbol list from a shared archive.
275
 
extract_expsyms_cmds=""
276
 
 
277
 
# Symbols that should not be listed in the preloaded symbols.
278
 
exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
279
 
 
280
 
# Symbols that must always be exported.
281
 
include_expsyms=""
282
 
 
283
 
### END LIBTOOL CONFIG
284
 
 
285
 
# ltmain.sh - Provide generalized library-building support services.
286
 
# NOTE: Changing this file will not affect anything until you rerun ltconfig.
287
 
#
288
 
# Copyright (C) 1996-2000 Free Software Foundation, Inc.
289
 
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
290
 
#
291
 
# This program is free software; you can redistribute it and/or modify
292
 
# it under the terms of the GNU General Public License as published by
293
 
# the Free Software Foundation; either version 2 of the License, or
294
 
# (at your option) any later version.
295
 
#
296
 
# This program is distributed in the hope that it will be useful, but
297
 
# WITHOUT ANY WARRANTY; without even the implied warranty of
298
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
299
 
# General Public License for more details.
300
 
#
301
 
# You should have received a copy of the GNU General Public License
302
 
# along with this program; if not, write to the Free Software
303
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
304
 
#
305
 
# As a special exception to the GNU General Public License, if you
306
 
# distribute this file as part of a program that contains a
307
 
# configuration script generated by Autoconf, you may include it under
308
 
# the same distribution terms that you use for the rest of that program.
309
 
 
310
 
# Check that we have a working $echo.
311
 
if test "X$1" = X--no-reexec; then
312
 
  # Discard the --no-reexec flag, and continue.
313
 
  shift
314
 
elif test "X$1" = X--fallback-echo; then
315
 
  # Avoid inline document here, it may be left over
316
 
  :
317
 
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
318
 
  # Yippee, $echo works!
319
 
  :
320
 
else
321
 
  # Restart under the correct shell, and then maybe $echo will work.
322
 
  exec $SHELL "$0" --no-reexec ${1+"$@"}
323
 
fi
324
 
 
325
 
if test "X$1" = X--fallback-echo; then
326
 
  # used as fallback echo
327
 
  shift
328
 
  cat <<EOF
329
 
$*
330
 
EOF
331
 
  exit 0
332
 
fi
333
 
 
334
 
# The name of this program.
335
 
progname=`$echo "$0" | sed 's%^.*/%%'`
336
 
modename="$progname"
337
 
 
338
 
# Constants.
339
 
PROGRAM=ltmain.sh
340
 
PACKAGE=libtool
341
 
VERSION=1.3c
342
 
TIMESTAMP=" (1.695 2000/02/24 02:15:35)"
343
 
 
344
 
default_mode=
345
 
help="Try \`$progname --help' for more information."
346
 
magic="%%%MAGIC variable%%%"
347
 
mkdir="mkdir"
348
 
mv="mv -f"
349
 
rm="rm -f"
350
 
 
351
 
# Sed substitution that helps us do robust quoting.  It backslashifies
352
 
# metacharacters that are still active within double-quoted strings.
353
 
Xsed='sed -e 1s/^X//'
354
 
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
355
 
SP2NL='tr \040 \012'
356
 
NL2SP='tr \015\012 \040\040'
357
 
 
358
 
# NLS nuisances.
359
 
# Only set LANG and LC_ALL to C if already set.
360
 
# These must not be set unconditionally because not all systems understand
361
 
# e.g. LANG=C (notably SCO).
362
 
# We save the old values to restore during execute mode.
363
 
if test "${LC_ALL+set}" = set; then
364
 
  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
365
 
fi
366
 
if test "${LANG+set}" = set; then
367
 
  save_LANG="$LANG"; LANG=C; export LANG
368
 
fi
369
 
 
370
 
if test "$LTCONFIG_VERSION" != "$VERSION"; then
371
 
  echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
372
 
  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
373
 
  exit 1
374
 
fi
375
 
 
376
 
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
377
 
  echo "$modename: not configured to build any kind of library" 1>&2
378
 
  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
379
 
  exit 1
380
 
fi
381
 
 
382
 
# Global variables.
383
 
mode=$default_mode
384
 
nonopt=
385
 
prev=
386
 
prevopt=
387
 
run=
388
 
show="$echo"
389
 
show_help=
390
 
execute_dlfiles=
391
 
lo2o="s/\\.lo\$/.${objext}/"
392
 
o2lo="s/\\.${objext}\$/.lo/"
393
 
 
394
 
# Parse our command line options once, thoroughly.
395
 
while test $# -gt 0
396
 
do
397
 
  arg="$1"
398
 
  shift
399
 
 
400
 
  case "$arg" in
401
 
  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
402
 
  *) optarg= ;;
403
 
  esac
404
 
 
405
 
  # If the previous option needs an argument, assign it.
406
 
  if test -n "$prev"; then
407
 
    case "$prev" in
408
 
    execute_dlfiles)
409
 
      eval "$prev=\"\$$prev \$arg\""
410
 
      ;;
411
 
    *)
412
 
      eval "$prev=\$arg"
413
 
      ;;
414
 
    esac
415
 
 
416
 
    prev=
417
 
    prevopt=
418
 
    continue
419
 
  fi
420
 
 
421
 
  # Have we seen a non-optional argument yet?
422
 
  case "$arg" in
423
 
  --help)
424
 
    show_help=yes
425
 
    ;;
426
 
 
427
 
  --version)
428
 
    echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
429
 
    exit 0
430
 
    ;;
431
 
 
432
 
  --config)
433
 
    sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
434
 
    exit 0
435
 
    ;;
436
 
 
437
 
  --debug)
438
 
    echo "$progname: enabling shell trace mode"
439
 
    set -x
440
 
    ;;
441
 
 
442
 
  --dry-run | -n)
443
 
    run=:
444
 
    ;;
445
 
 
446
 
  --features)
447
 
    echo "host: $host"
448
 
    if test "$build_libtool_libs" = yes; then
449
 
      echo "enable shared libraries"
450
 
    else
451
 
      echo "disable shared libraries"
452
 
    fi
453
 
    if test "$build_old_libs" = yes; then
454
 
      echo "enable static libraries"
455
 
    else
456
 
      echo "disable static libraries"
457
 
    fi
458
 
    exit 0
459
 
    ;;
460
 
 
461
 
  --finish) mode="finish" ;;
462
 
 
463
 
  --mode) prevopt="--mode" prev=mode ;;
464
 
  --mode=*) mode="$optarg" ;;
465
 
 
466
 
  --quiet | --silent)
467
 
    show=:
468
 
    ;;
469
 
 
470
 
  -dlopen)
471
 
    prevopt="-dlopen"
472
 
    prev=execute_dlfiles
473
 
    ;;
474
 
 
475
 
  -*)
476
 
    $echo "$modename: unrecognized option \`$arg'" 1>&2
477
 
    $echo "$help" 1>&2
478
 
    exit 1
479
 
    ;;
480
 
 
481
 
  *)
482
 
    nonopt="$arg"
483
 
    break
484
 
    ;;
485
 
  esac
486
 
done
487
 
 
488
 
if test -n "$prevopt"; then
489
 
  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
490
 
  $echo "$help" 1>&2
491
 
  exit 1
492
 
fi
493
 
 
494
 
if test -z "$show_help"; then
495
 
 
496
 
  # Infer the operation mode.
497
 
  if test -z "$mode"; then
498
 
    case "$nonopt" in
499
 
    *cc | *++ | gcc* | *-gcc*)
500
 
      mode=link
501
 
      for arg
502
 
      do
503
 
        case "$arg" in
504
 
        -c)
505
 
           mode=compile
506
 
           break
507
 
           ;;
508
 
        esac
509
 
      done
510
 
      ;;
511
 
    *db | *dbx | *strace | *truss)
512
 
      mode=execute
513
 
      ;;
514
 
    *install*|cp|mv)
515
 
      mode=install
516
 
      ;;
517
 
    *rm)
518
 
      mode=uninstall
519
 
      ;;
520
 
    *)
521
 
      # If we have no mode, but dlfiles were specified, then do execute mode.
522
 
      test -n "$execute_dlfiles" && mode=execute
523
 
 
524
 
      # Just use the default operation mode.
525
 
      if test -z "$mode"; then
526
 
        if test -n "$nonopt"; then
527
 
          $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
528
 
        else
529
 
          $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
530
 
        fi
531
 
      fi
532
 
      ;;
533
 
    esac
534
 
  fi
535
 
 
536
 
  # Only execute mode is allowed to have -dlopen flags.
537
 
  if test -n "$execute_dlfiles" && test "$mode" != execute; then
538
 
    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
539
 
    $echo "$help" 1>&2
540
 
    exit 1
541
 
  fi
542
 
 
543
 
  # Change the help message to a mode-specific one.
544
 
  generic_help="$help"
545
 
  help="Try \`$modename --help --mode=$mode' for more information."
546
 
 
547
 
  # These modes are in order of execution frequency so that they run quickly.
548
 
  case "$mode" in
549
 
  # libtool compile mode
550
 
  compile)
551
 
    modename="$modename: compile"
552
 
    # Get the compilation command and the source file.
553
 
    base_compile=
554
 
    prev=
555
 
    lastarg=
556
 
    srcfile="$nonopt"
557
 
    suppress_output=
558
 
 
559
 
    user_target=no
560
 
    for arg
561
 
    do
562
 
      case "$prev" in
563
 
      "") ;;
564
 
      xcompiler)
565
 
        # Aesthetically quote the previous argument.
566
 
        prev=
567
 
        lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
568
 
 
569
 
        case "$arg" in
570
 
        # Double-quote args containing other shell metacharacters.
571
 
        # Many Bourne shells cannot handle close brackets correctly
572
 
        # in scan sets, so we specify it separately.
573
 
        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
574
 
          arg="\"$arg\""
575
 
          ;;
576
 
        esac
577
 
 
578
 
        # Add the previous argument to base_compile.
579
 
        if test -z "$base_compile"; then
580
 
          base_compile="$lastarg"
581
 
        else
582
 
          base_compile="$base_compile $lastarg"
583
 
        fi
584
 
        continue
585
 
        ;;
586
 
      esac
587
 
 
588
 
      # Accept any command-line options.
589
 
      case "$arg" in
590
 
      -o)
591
 
        if test "$user_target" != "no"; then
592
 
          $echo "$modename: you cannot specify \`-o' more than once" 1>&2
593
 
          exit 1
594
 
        fi
595
 
        user_target=next
596
 
        ;;
597
 
 
598
 
      -static)
599
 
        build_old_libs=yes
600
 
        continue
601
 
        ;;
602
 
 
603
 
      -Xcompiler)
604
 
        prev=xcompiler
605
 
        continue
606
 
        ;;
607
 
 
608
 
      -Wc,*)
609
 
        args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
610
 
        lastarg=
611
 
        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
612
 
        for arg in $args; do
613
 
          IFS="$save_ifs"
614
 
 
615
 
          # Double-quote args containing other shell metacharacters.
616
 
          # Many Bourne shells cannot handle close brackets correctly
617
 
          # in scan sets, so we specify it separately.
618
 
          case "$arg" in
619
 
            *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
620
 
            arg="\"$arg\""
621
 
            ;;
622
 
          esac
623
 
          lastarg="$lastarg $arg"
624
 
        done
625
 
        IFS="$save_ifs"
626
 
        lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
627
 
 
628
 
        # Add the arguments to base_compile.
629
 
        if test -z "$base_compile"; then
630
 
          base_compile="$lastarg"
631
 
        else
632
 
          base_compile="$base_compile $lastarg"
633
 
        fi
634
 
        continue
635
 
        ;;
636
 
      esac
637
 
 
638
 
      case "$user_target" in
639
 
      next)
640
 
        # The next one is the -o target name
641
 
        user_target=yes
642
 
        continue
643
 
        ;;
644
 
      yes)
645
 
        # We got the output file
646
 
        user_target=set
647
 
        libobj="$arg"
648
 
        continue
649
 
        ;;
650
 
      esac
651
 
 
652
 
      # Accept the current argument as the source file.
653
 
      lastarg="$srcfile"
654
 
      srcfile="$arg"
655
 
 
656
 
      # Aesthetically quote the previous argument.
657
 
 
658
 
      # Backslashify any backslashes, double quotes, and dollar signs.
659
 
      # These are the only characters that are still specially
660
 
      # interpreted inside of double-quoted scrings.
661
 
      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
662
 
 
663
 
      # Double-quote args containing other shell metacharacters.
664
 
      # Many Bourne shells cannot handle close brackets correctly
665
 
      # in scan sets, so we specify it separately.
666
 
      case "$lastarg" in
667
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
668
 
        lastarg="\"$lastarg\""
669
 
        ;;
670
 
      esac
671
 
 
672
 
      # Add the previous argument to base_compile.
673
 
      if test -z "$base_compile"; then
674
 
        base_compile="$lastarg"
675
 
      else
676
 
        base_compile="$base_compile $lastarg"
677
 
      fi
678
 
    done
679
 
 
680
 
    case "$user_target" in
681
 
    set)
682
 
      ;;
683
 
    no)
684
 
      # Get the name of the library object.
685
 
      libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
686
 
      ;;
687
 
    *)
688
 
      $echo "$modename: you must specify a target with \`-o'" 1>&2
689
 
      exit 1
690
 
      ;;
691
 
    esac
692
 
 
693
 
    # Recognize several different file suffixes.
694
 
    # If the user specifies -o file.o, it is replaced with file.lo
695
 
    xform='[cCFSfmso]'
696
 
    case "$libobj" in
697
 
    *.ada) xform=ada ;;
698
 
    *.adb) xform=adb ;;
699
 
    *.ads) xform=ads ;;
700
 
    *.asm) xform=asm ;;
701
 
    *.c++) xform=c++ ;;
702
 
    *.cc) xform=cc ;;
703
 
    *.cpp) xform=cpp ;;
704
 
    *.cxx) xform=cxx ;;
705
 
    *.f90) xform=f90 ;;
706
 
    *.for) xform=for ;;
707
 
    esac
708
 
 
709
 
    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
710
 
 
711
 
    case "$libobj" in
712
 
    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
713
 
    *)
714
 
      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
715
 
      exit 1
716
 
      ;;
717
 
    esac
718
 
 
719
 
    if test -z "$base_compile"; then
720
 
      $echo "$modename: you must specify a compilation command" 1>&2
721
 
      $echo "$help" 1>&2
722
 
      exit 1
723
 
    fi
724
 
 
725
 
    # Delete any leftover library objects.
726
 
    if test "$build_old_libs" = yes; then
727
 
      removelist="$obj $libobj"
728
 
    else
729
 
      removelist="$libobj"
730
 
    fi
731
 
 
732
 
    $run $rm $removelist
733
 
    trap "$run $rm $removelist; exit 1" 1 2 15
734
 
 
735
 
    # Calculate the filename of the output object if compiler does
736
 
    # not support -o with -c
737
 
    if test "$compiler_c_o" = no; then
738
 
      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
739
 
      lockfile="$output_obj.lock"
740
 
      removelist="$removelist $output_obj $lockfile"
741
 
      trap "$run $rm $removelist; exit 1" 1 2 15
742
 
    else
743
 
      need_locks=no
744
 
      lockfile=
745
 
    fi
746
 
 
747
 
    # Lock this critical section if it is needed
748
 
    # We use this script file to make the link, it avoids creating a new file
749
 
    if test "$need_locks" = yes; then
750
 
      until ln "$0" "$lockfile" 2>/dev/null; do
751
 
        $show "Waiting for $lockfile to be removed"
752
 
        sleep 2
753
 
      done
754
 
    elif test "$need_locks" = warn; then
755
 
      if test -f "$lockfile"; then
756
 
        echo "\
757
 
*** ERROR, $lockfile exists and contains:
758
 
`cat $lockfile 2>/dev/null`
759
 
 
760
 
This indicates that another process is trying to use the same
761
 
temporary object file, and libtool could not work around it because
762
 
your compiler does not support \`-c' and \`-o' together.  If you
763
 
repeat this compilation, it may succeed, by chance, but you had better
764
 
avoid parallel builds (make -j) in this platform, or get a better
765
 
compiler."
766
 
 
767
 
        $run $rm $removelist
768
 
        exit 1
769
 
      fi
770
 
      echo $srcfile > "$lockfile"
771
 
    fi
772
 
 
773
 
    if test -n "$fix_srcfile_path"; then
774
 
      eval srcfile=\"$fix_srcfile_path\"
775
 
    fi
776
 
 
777
 
    # Only build a PIC object if we are building libtool libraries.
778
 
    if test "$build_libtool_libs" = yes; then
779
 
      # Without this assignment, base_compile gets emptied.
780
 
      fbsd_hideous_sh_bug=$base_compile
781
 
 
782
 
      if test "$pic_mode" != no; then
783
 
        # All platforms use -DPIC, to notify preprocessed assembler code.
784
 
        command="$base_compile $srcfile $pic_flag -DPIC"
785
 
      else
786
 
        # Don't build PIC code
787
 
        command="$base_compile $srcfile"
788
 
      fi
789
 
      if test "$build_old_libs" = yes; then
790
 
        lo_libobj="$libobj"
791
 
        dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
792
 
        if test "X$dir" = "X$libobj"; then
793
 
          dir="$objdir"
794
 
        else
795
 
          dir="$dir/$objdir"
796
 
        fi
797
 
        libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
798
 
 
799
 
        if test -d "$dir"; then
800
 
          $show "$rm $libobj"
801
 
          $run $rm $libobj
802
 
        else
803
 
          $show "$mkdir $dir"
804
 
          $run $mkdir $dir
805
 
          status=$?
806
 
          if test $status -ne 0 && test ! -d $dir; then
807
 
            exit $status
808
 
          fi
809
 
        fi
810
 
      fi
811
 
      if test "$compiler_o_lo" = yes; then
812
 
        output_obj="$libobj"
813
 
        command="$command -o $output_obj"
814
 
      elif test "$compiler_c_o" = yes; then
815
 
        output_obj="$obj"
816
 
        command="$command -o $output_obj"
817
 
      fi
818
 
 
819
 
      $run $rm "$output_obj"
820
 
      $show "$command"
821
 
      if $run eval "$command"; then :
822
 
      else
823
 
        test -n "$output_obj" && $run $rm $removelist
824
 
        exit 1
825
 
      fi
826
 
 
827
 
      if test "$need_locks" = warn &&
828
 
         test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
829
 
        echo "\
830
 
*** ERROR, $lockfile contains:
831
 
`cat $lockfile 2>/dev/null`
832
 
 
833
 
but it should contain:
834
 
$srcfile
835
 
 
836
 
This indicates that another process is trying to use the same
837
 
temporary object file, and libtool could not work around it because
838
 
your compiler does not support \`-c' and \`-o' together.  If you
839
 
repeat this compilation, it may succeed, by chance, but you had better
840
 
avoid parallel builds (make -j) in this platform, or get a better
841
 
compiler."
842
 
 
843
 
        $run $rm $removelist
844
 
        exit 1
845
 
      fi
846
 
 
847
 
      # Just move the object if needed, then go on to compile the next one
848
 
      if test x"$output_obj" != x"$libobj"; then
849
 
        $show "$mv $output_obj $libobj"
850
 
        if $run $mv $output_obj $libobj; then :
851
 
        else
852
 
          error=$?
853
 
          $run $rm $removelist
854
 
          exit $error
855
 
        fi
856
 
      fi
857
 
 
858
 
      # If we have no pic_flag, then copy the object into place and finish.
859
 
      if (test -z "$pic_flag" || test "$pic_mode" != default) &&
860
 
         test "$build_old_libs" = yes; then
861
 
        # Rename the .lo from within objdir to obj
862
 
        if test -f $obj; then
863
 
          $show $rm $obj
864
 
          $run $rm $obj
865
 
        fi
866
 
 
867
 
        $show "$mv $libobj $obj"
868
 
        if $run $mv $libobj $obj; then :
869
 
        else
870
 
          error=$?
871
 
          $run $rm $removelist
872
 
          exit $error
873
 
        fi
874
 
 
875
 
        xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
876
 
        if test "X$xdir" = "X$obj"; then
877
 
          xdir="."
878
 
        else
879
 
          xdir="$xdir"
880
 
        fi
881
 
        baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
882
 
        libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
883
 
        # Now arrange that obj and lo_libobj become the same file
884
 
        $show "(cd $xdir && $LN_S $baseobj $libobj)"
885
 
        if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
886
 
          exit 0
887
 
        else
888
 
          error=$?
889
 
          $run $rm $removelist
890
 
          exit $error
891
 
        fi
892
 
      fi
893
 
 
894
 
      # Allow error messages only from the first compilation.
895
 
      suppress_output=' >/dev/null 2>&1'
896
 
    fi
897
 
 
898
 
    # Only build a position-dependent object if we build old libraries.
899
 
    if test "$build_old_libs" = yes; then
900
 
      if test "$pic_mode" != yes; then
901
 
        # Don't build PIC code
902
 
        command="$base_compile $srcfile"
903
 
      else
904
 
        # All platforms use -DPIC, to notify preprocessed assembler code.
905
 
        command="$base_compile $srcfile $pic_flag -DPIC"
906
 
      fi
907
 
      if test "$compiler_c_o" = yes; then
908
 
        command="$command -o $obj"
909
 
        output_obj="$obj"
910
 
      fi
911
 
 
912
 
      # Suppress compiler output if we already did a PIC compilation.
913
 
      command="$command$suppress_output"
914
 
      $run $rm "$output_obj"
915
 
      $show "$command"
916
 
      if $run eval "$command"; then :
917
 
      else
918
 
        $run $rm $removelist
919
 
        exit 1
920
 
      fi
921
 
 
922
 
      if test "$need_locks" = warn &&
923
 
         test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
924
 
        echo "\
925
 
*** ERROR, $lockfile contains:
926
 
`cat $lockfile 2>/dev/null`
927
 
 
928
 
but it should contain:
929
 
$srcfile
930
 
 
931
 
This indicates that another process is trying to use the same
932
 
temporary object file, and libtool could not work around it because
933
 
your compiler does not support \`-c' and \`-o' together.  If you
934
 
repeat this compilation, it may succeed, by chance, but you had better
935
 
avoid parallel builds (make -j) in this platform, or get a better
936
 
compiler."
937
 
 
938
 
        $run $rm $removelist
939
 
        exit 1
940
 
      fi
941
 
 
942
 
      # Just move the object if needed
943
 
      if test x"$output_obj" != x"$obj"; then
944
 
        $show "$mv $output_obj $obj"
945
 
        if $run $mv $output_obj $obj; then :
946
 
        else
947
 
          error=$?
948
 
          $run $rm $removelist
949
 
          exit $error
950
 
        fi
951
 
      fi
952
 
 
953
 
      # Create an invalid libtool object if no PIC, so that we do not
954
 
      # accidentally link it into a program.
955
 
      if test "$build_libtool_libs" != yes; then
956
 
        $show "echo timestamp > $libobj"
957
 
        $run eval "echo timestamp > \$libobj" || exit $?
958
 
      else
959
 
        # Move the .lo from within objdir
960
 
        $show "$mv $libobj $lo_libobj"
961
 
        if $run $mv $libobj $lo_libobj; then :
962
 
        else
963
 
          error=$?
964
 
          $run $rm $removelist
965
 
          exit $error
966
 
        fi
967
 
      fi
968
 
    fi
969
 
 
970
 
    # Unlock the critical section if it was locked
971
 
    if test "$need_locks" != no; then
972
 
      $rm "$lockfile"
973
 
    fi
974
 
 
975
 
    exit 0
976
 
    ;;
977
 
 
978
 
  # libtool link mode
979
 
  link | relink)
980
 
    modename="$modename: link"
981
 
    case "$host" in
982
 
    *-*-cygwin* | *-*-mingw* | *-*-os2*)
983
 
      # It is impossible to link a dll without this setting, and
984
 
      # we shouldn't force the makefile maintainer to figure out
985
 
      # which system we are compiling for in order to pass an extra
986
 
      # flag for every libtool invokation.
987
 
      # allow_undefined=no
988
 
 
989
 
      # FIXME: Unfortunately, there are problems with the above when trying
990
 
      # to make a dll which has undefined symbols, in which case not
991
 
      # even a static library is built.  For now, we need to specify
992
 
      # -no-undefined on the libtool link line when we can be certain
993
 
      # that all symbols are satisfied, otherwise we get a static library.
994
 
      allow_undefined=yes
995
 
      ;;
996
 
    *)
997
 
      allow_undefined=yes
998
 
      ;;
999
 
    esac
1000
 
    libtool_args="$nonopt"
1001
 
    compile_command="$nonopt"
1002
 
    finalize_command="$nonopt"
1003
 
 
1004
 
    compile_rpath=
1005
 
    finalize_rpath=
1006
 
    compile_shlibpath=
1007
 
    finalize_shlibpath=
1008
 
    convenience=
1009
 
    old_convenience=
1010
 
    deplibs=
1011
 
    old_deplibs=
1012
 
    compiler_flags=
1013
 
    linker_flags=
1014
 
    dllsearchpath=
1015
 
    lib_search_path=`pwd`
1016
 
 
1017
 
    avoid_version=no
1018
 
    dlfiles=
1019
 
    dlprefiles=
1020
 
    dlself=no
1021
 
    export_dynamic=no
1022
 
    export_symbols=
1023
 
    export_symbols_regex=
1024
 
    generated=
1025
 
    libobjs=
1026
 
    ltlibs=
1027
 
    module=no
1028
 
    no_install=no
1029
 
    objs=
1030
 
    prefer_static_libs=no
1031
 
    preload=no
1032
 
    prev=
1033
 
    prevarg=
1034
 
    release=
1035
 
    rpath=
1036
 
    xrpath=
1037
 
    perm_rpath=
1038
 
    temp_rpath=
1039
 
    thread_safe=no
1040
 
    vinfo=
1041
 
 
1042
 
    # We need to know -static, to get the right output filenames.
1043
 
    for arg
1044
 
    do
1045
 
      case "$arg" in
1046
 
      -all-static | -static)
1047
 
        if test "X$arg" = "X-all-static"; then
1048
 
          if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1049
 
            $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1050
 
          fi
1051
 
          if test -n "$link_static_flag"; then
1052
 
            dlopen_self=$dlopen_self_static
1053
 
          fi
1054
 
        else
1055
 
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
1056
 
            dlopen_self=$dlopen_self_static
1057
 
          fi
1058
 
        fi
1059
 
        build_libtool_libs=no
1060
 
        build_old_libs=yes
1061
 
        prefer_static_libs=yes
1062
 
        break
1063
 
        ;;
1064
 
      esac
1065
 
    done
1066
 
 
1067
 
    # See if our shared archives depend on static archives.
1068
 
    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1069
 
 
1070
 
    # Go through the arguments, transforming them on the way.
1071
 
    while test $# -gt 0; do
1072
 
      arg="$1"
1073
 
      shift
1074
 
      case "$arg" in
1075
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
1076
 
        qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1077
 
        ;;
1078
 
      *) qarg=$arg ;;
1079
 
      esac
1080
 
      libtool_args="$libtool_args $qarg"
1081
 
 
1082
 
      # If the previous option needs an argument, assign it.
1083
 
      if test -n "$prev"; then
1084
 
        case "$prev" in
1085
 
        output)
1086
 
          compile_command="$compile_command @OUTPUT@"
1087
 
          finalize_command="$finalize_command @OUTPUT@"
1088
 
          ;;
1089
 
        esac
1090
 
 
1091
 
        case "$prev" in
1092
 
        dlfiles|dlprefiles)
1093
 
          if test "$preload" = no; then
1094
 
            # Add the symbol object into the linking commands.
1095
 
            compile_command="$compile_command @SYMFILE@"
1096
 
            finalize_command="$finalize_command @SYMFILE@"
1097
 
            preload=yes
1098
 
          fi
1099
 
          case "$arg" in
1100
 
          *.la | *.lo) ;;  # We handle these cases below.
1101
 
          force)
1102
 
            if test "$dlself" = no; then
1103
 
              dlself=needless
1104
 
              export_dynamic=yes
1105
 
            fi
1106
 
            prev=
1107
 
            continue
1108
 
            ;;
1109
 
          self)
1110
 
            if test "$prev" = dlprefiles; then
1111
 
              dlself=yes
1112
 
            elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1113
 
              dlself=yes
1114
 
            else
1115
 
              dlself=needless
1116
 
              export_dynamic=yes
1117
 
            fi
1118
 
            prev=
1119
 
            continue
1120
 
            ;;
1121
 
          *)
1122
 
            if test "$prev" = dlfiles; then
1123
 
              dlfiles="$dlfiles $arg"
1124
 
            else
1125
 
              dlprefiles="$dlprefiles $arg"
1126
 
            fi
1127
 
            prev=
1128
 
            continue
1129
 
            ;;
1130
 
          esac
1131
 
          ;;
1132
 
        expsyms)
1133
 
          export_symbols="$arg"
1134
 
          if test ! -f "$arg"; then
1135
 
            $echo "$modename: symbol file \`$arg' does not exist"
1136
 
            exit 1
1137
 
          fi
1138
 
          prev=
1139
 
          continue
1140
 
          ;;
1141
 
        expsyms_regex)
1142
 
          export_symbols_regex="$arg"
1143
 
          prev=
1144
 
          continue
1145
 
          ;;
1146
 
        release)
1147
 
          release="-$arg"
1148
 
          prev=
1149
 
          continue
1150
 
          ;;
1151
 
        rpath | xrpath)
1152
 
          # We need an absolute path.
1153
 
          case "$arg" in
1154
 
          [\\/]* | [A-Za-z]:[\\/]*) ;;
1155
 
          *)
1156
 
            $echo "$modename: only absolute run-paths are allowed" 1>&2
1157
 
            exit 1
1158
 
            ;;
1159
 
          esac
1160
 
          if test "$prev" = rpath; then
1161
 
            case "$rpath " in
1162
 
            *" $arg "*) ;;
1163
 
            *) rpath="$rpath $arg" ;;
1164
 
            esac
1165
 
          else
1166
 
            case "$xrpath " in
1167
 
            *" $arg "*) ;;
1168
 
            *) xrpath="$xrpath $arg" ;;
1169
 
            esac
1170
 
          fi
1171
 
          prev=
1172
 
          continue
1173
 
          ;;
1174
 
        xcompiler)
1175
 
          compiler_flags="$compiler_flags $qarg"
1176
 
          prev=
1177
 
          compile_command="$compile_command $qarg"
1178
 
          finalize_command="$finalize_command $qarg"
1179
 
          continue
1180
 
          ;;
1181
 
        xlinker)
1182
 
          linker_flags="$linker_flags $qarg"
1183
 
          compiler_flags="$compiler_flags $wl$qarg"
1184
 
          prev=
1185
 
          compile_command="$compile_command $wl$qarg"
1186
 
          finalize_command="$finalize_command $wl$qarg"
1187
 
          continue
1188
 
          ;;
1189
 
        *)
1190
 
          eval "$prev=\"\$arg\""
1191
 
          prev=
1192
 
          continue
1193
 
          ;;
1194
 
        esac
1195
 
      fi
1196
 
 
1197
 
      prevarg="$arg"
1198
 
 
1199
 
      case "$arg" in
1200
 
      -all-static)
1201
 
        if test -n "$link_static_flag"; then
1202
 
          compile_command="$compile_command $link_static_flag"
1203
 
          finalize_command="$finalize_command $link_static_flag"
1204
 
        fi
1205
 
        continue
1206
 
        ;;
1207
 
 
1208
 
      -allow-undefined)
1209
 
        # FIXME: remove this flag sometime in the future.
1210
 
        $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1211
 
        continue
1212
 
        ;;
1213
 
 
1214
 
      -avoid-version)
1215
 
        avoid_version=yes
1216
 
        continue
1217
 
        ;;
1218
 
 
1219
 
      -dlopen)
1220
 
        prev=dlfiles
1221
 
        continue
1222
 
        ;;
1223
 
 
1224
 
      -dlpreopen)
1225
 
        prev=dlprefiles
1226
 
        continue
1227
 
        ;;
1228
 
 
1229
 
      -export-dynamic)
1230
 
        export_dynamic=yes
1231
 
        continue
1232
 
        ;;
1233
 
 
1234
 
      -export-symbols | -export-symbols-regex)
1235
 
        if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1236
 
          $echo "$modename: not more than one -exported-symbols argument allowed"
1237
 
          exit 1
1238
 
        fi
1239
 
        if test "X$arg" = "X-export-symbols"; then
1240
 
          prev=expsyms
1241
 
        else
1242
 
          prev=expsyms_regex
1243
 
        fi
1244
 
        continue
1245
 
        ;;
1246
 
 
1247
 
      -L*)
1248
 
        dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1249
 
        # We need an absolute path.
1250
 
        case "$dir" in
1251
 
        [\\/]* | [A-Za-z]:[\\/]*) ;;
1252
 
        *)
1253
 
          absdir=`cd "$dir" && pwd`
1254
 
          if test -z "$absdir"; then
1255
 
            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1256
 
            exit 1
1257
 
          fi
1258
 
          dir="$absdir"
1259
 
          ;;
1260
 
        esac
1261
 
        case "$deplibs " in
1262
 
        *" -L$dir "*) ;;
1263
 
        *)
1264
 
          deplibs="$deplibs -L$dir"
1265
 
          lib_search_path="$lib_search_path $dir"
1266
 
          ;;
1267
 
        esac
1268
 
        case "$host" in
1269
 
        *-*-cygwin* | *-*-mingw* | *-*-os2*)
1270
 
          case ":$dllsearchpath:" in
1271
 
          *":$dir:"*) ;;
1272
 
          *) dllsearchpath="$dllsearchpath:$dir";;
1273
 
          esac
1274
 
          ;;
1275
 
        esac
1276
 
        continue
1277
 
        ;;
1278
 
 
1279
 
      -l*)
1280
 
        if test "$arg" = "-lc"; then
1281
 
          case "$host" in
1282
 
          *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1283
 
            # These systems don't actually have c library (as such)
1284
 
            continue
1285
 
            ;;
1286
 
          esac
1287
 
        elif test "$arg" = "-lm"; then
1288
 
          case "$host" in
1289
 
          *-*-cygwin* | *-*-beos*)
1290
 
            # These systems don't actually have math library (as such)
1291
 
            continue
1292
 
            ;;
1293
 
          esac
1294
 
        fi
1295
 
        deplibs="$deplibs $arg"
1296
 
        continue
1297
 
        ;;
1298
 
 
1299
 
      -module)
1300
 
        module=yes
1301
 
        continue
1302
 
        ;;
1303
 
 
1304
 
      -no-fast-install)
1305
 
        fast_install=no
1306
 
        continue
1307
 
        ;;
1308
 
 
1309
 
      -no-install)
1310
 
        case "$host" in
1311
 
        *-*-cygwin* | *-*-mingw* | *-*-os2*)
1312
 
          # The PATH hackery in wrapper scripts is required on Windows
1313
 
          # in order for the loader to find any dlls it needs.
1314
 
          $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1315
 
          $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1316
 
          fast_install=no
1317
 
          ;;
1318
 
        *)
1319
 
          no_install=yes
1320
 
          ;;
1321
 
        esac
1322
 
        continue
1323
 
        ;;
1324
 
 
1325
 
      -no-undefined)
1326
 
        allow_undefined=no
1327
 
        continue
1328
 
        ;;
1329
 
 
1330
 
      -o) prev=output ;;
1331
 
 
1332
 
      -release)
1333
 
        prev=release
1334
 
        continue
1335
 
        ;;
1336
 
 
1337
 
      -rpath)
1338
 
        prev=rpath
1339
 
        continue
1340
 
        ;;
1341
 
 
1342
 
      -R)
1343
 
        prev=xrpath
1344
 
        continue
1345
 
        ;;
1346
 
 
1347
 
      -R*)
1348
 
        dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1349
 
        # We need an absolute path.
1350
 
        case "$dir" in
1351
 
        [\\/]* | [A-Za-z]:[\\/]*) ;;
1352
 
        *)
1353
 
          $echo "$modename: only absolute run-paths are allowed" 1>&2
1354
 
          exit 1
1355
 
          ;;
1356
 
        esac
1357
 
        case "$xrpath " in
1358
 
        *" $dir "*) ;;
1359
 
        *) xrpath="$xrpath $dir" ;;
1360
 
        esac
1361
 
        continue
1362
 
        ;;
1363
 
 
1364
 
      -static)
1365
 
        # If we have no pic_flag, then this is the same as -all-static.
1366
 
        if test -z "$pic_flag" && test -n "$link_static_flag"; then
1367
 
          compile_command="$compile_command $link_static_flag"
1368
 
          finalize_command="$finalize_command $link_static_flag"
1369
 
        fi
1370
 
        continue
1371
 
        ;;
1372
 
 
1373
 
      -thread-safe)
1374
 
        thread_safe=yes
1375
 
        continue
1376
 
        ;;
1377
 
 
1378
 
      -version-info)
1379
 
        prev=vinfo
1380
 
        continue
1381
 
        ;;
1382
 
 
1383
 
      -Wc,*)
1384
 
        args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1385
 
        arg=
1386
 
        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
1387
 
        for flag in $args; do
1388
 
          IFS="$save_ifs"
1389
 
          case "$flag" in
1390
 
            *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
1391
 
            flag="\"$flag\""
1392
 
            ;;
1393
 
          esac
1394
 
          arg="$arg $wl$flag"
1395
 
          compiler_flags="$compiler_flags $flag"
1396
 
        done
1397
 
        IFS="$save_ifs"
1398
 
        arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1399
 
        ;;
1400
 
 
1401
 
      -Wl,*)
1402
 
        args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1403
 
        arg=
1404
 
        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=','
1405
 
        for flag in $args; do
1406
 
          IFS="$save_ifs"
1407
 
          case "$flag" in
1408
 
            *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
1409
 
            flag="\"$flag\""
1410
 
            ;;
1411
 
          esac
1412
 
          arg="$arg $wl$flag"
1413
 
          compiler_flags="$compiler_flags $wl$flag"
1414
 
          linker_flags="$linker_flags $flag"
1415
 
        done
1416
 
        IFS="$save_ifs"
1417
 
        arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1418
 
        ;;
1419
 
 
1420
 
      -Xcompiler)
1421
 
        prev=xcompiler
1422
 
        continue
1423
 
        ;;
1424
 
 
1425
 
      -Xlinker)
1426
 
        prev=xlinker
1427
 
        continue
1428
 
        ;;
1429
 
 
1430
 
      # Some other compiler flag.
1431
 
      -* | +*)
1432
 
        # Unknown arguments in both finalize_command and compile_command need
1433
 
        # to be aesthetically quoted because they are evaled later.
1434
 
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1435
 
        case "$arg" in
1436
 
        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
1437
 
          arg="\"$arg\""
1438
 
          ;;
1439
 
        esac
1440
 
        ;;
1441
 
 
1442
 
      *.$objext)
1443
 
        # A standard object.
1444
 
        objs="$objs $arg"
1445
 
        ;;
1446
 
 
1447
 
      *.lo)
1448
 
        # A library object.
1449
 
        if test "$prev" = dlfiles; then
1450
 
          # This file was specified with -dlopen.
1451
 
          if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
1452
 
            dlfiles="$dlfiles $arg"
1453
 
            prev=
1454
 
            continue
1455
 
          else
1456
 
            # If libtool objects are unsupported, then we need to preload.
1457
 
            prev=dlprefiles
1458
 
          fi
1459
 
        fi
1460
 
 
1461
 
        if test "$prev" = dlprefiles; then
1462
 
          # Preload the old-style object.
1463
 
          dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1464
 
          prev=
1465
 
        else
1466
 
          libobjs="$libobjs $arg"
1467
 
        fi
1468
 
        ;;
1469
 
 
1470
 
      *.$libext)
1471
 
        # An archive.
1472
 
        deplibs="$deplibs $arg"
1473
 
        old_deplibs="$old_deplibs $arg"
1474
 
        continue
1475
 
        ;;
1476
 
 
1477
 
      *.la)
1478
 
        # A libtool-controlled library.
1479
 
 
1480
 
        if test "$prev" = dlfiles; then
1481
 
          # This library was specified with -dlopen.
1482
 
          dlfiles="$dlfiles $arg"
1483
 
          prev=
1484
 
        elif test "$prev" = dlprefiles; then
1485
 
          # The library was specified with -dlpreopen.
1486
 
          dlprefiles="$dlprefiles $arg"
1487
 
          prev=
1488
 
        else
1489
 
          deplibs="$deplibs $arg"
1490
 
        fi
1491
 
        continue
1492
 
        ;;
1493
 
 
1494
 
      # Some other compiler argument.
1495
 
      *)
1496
 
        # Unknown arguments in both finalize_command and compile_command need
1497
 
        # to be aesthetically quoted because they are evaled later.
1498
 
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1499
 
        case "$arg" in
1500
 
        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \   ]*|*]*|"")
1501
 
          arg="\"$arg\""
1502
 
          ;;
1503
 
        esac
1504
 
        ;;
1505
 
      esac
1506
 
 
1507
 
      # Now actually substitute the argument into the commands.
1508
 
      if test -n "$arg"; then
1509
 
        compile_command="$compile_command $arg"
1510
 
        finalize_command="$finalize_command $arg"
1511
 
      fi
1512
 
    done
1513
 
 
1514
 
    if test -n "$prev"; then
1515
 
      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1516
 
      $echo "$help" 1>&2
1517
 
      exit 1
1518
 
    fi
1519
 
 
1520
 
    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1521
 
      eval arg=\"$export_dynamic_flag_spec\"
1522
 
      compile_command="$compile_command $arg"
1523
 
      finalize_command="$finalize_command $arg"
1524
 
    fi
1525
 
 
1526
 
    oldlibs=
1527
 
    # calculate the name of the file, without its directory
1528
 
    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1529
 
    libobjs_save="$libobjs"
1530
 
 
1531
 
    if test -n "$shlibpath_var"; then
1532
 
      # get the directories listed in $shlibpath_var
1533
 
      eval shlib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1534
 
    else
1535
 
      shlib_search_path=
1536
 
    fi
1537
 
    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1538
 
    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1539
 
    lib_search_path="$lib_search_path $sys_lib_search_path $shlib_search_path"
1540
 
 
1541
 
    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1542
 
    if test "X$output_objdir" = "X$output"; then
1543
 
      output_objdir="$objdir"
1544
 
    else
1545
 
      output_objdir="$output_objdir/$objdir"
1546
 
    fi
1547
 
    # Create the object directory.
1548
 
    if test ! -d $output_objdir; then
1549
 
      $show "$mkdir $output_objdir"
1550
 
      $run $mkdir $output_objdir
1551
 
      status=$?
1552
 
      if test $status -ne 0 && test ! -d $output_objdir; then
1553
 
        exit $status
1554
 
      fi
1555
 
    fi
1556
 
 
1557
 
    case "$output" in
1558
 
    "")
1559
 
      $echo "$modename: you must specify an output file" 1>&2
1560
 
      $echo "$help" 1>&2
1561
 
      exit 1
1562
 
      ;;
1563
 
    *.$libext)
1564
 
      linkmode=oldlib ;;
1565
 
    *.lo | *.$objext)
1566
 
      linkmode=obj ;;
1567
 
    *.la)
1568
 
      linkmode=lib ;;
1569
 
    *) # Anything else should be a program.
1570
 
      linkmode=prog ;;
1571
 
    esac
1572
 
 
1573
 
    specialdeplibs=
1574
 
    libs=
1575
 
    # Find all interdependent deplibs that
1576
 
    # are linked more than once (e.g. -la -lb -la)
1577
 
    for deplib in $deplibs; do
1578
 
      case "$libs " in
1579
 
      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1580
 
      esac
1581
 
      libs="$libs $deplib"
1582
 
    done
1583
 
    deplibs=
1584
 
    newdependency_libs=
1585
 
    uninst_path= # paths that contain uninstalled libtool libraries
1586
 
    new_lib_search_path=
1587
 
    need_relink=no # whether we're linking any uninstalled libtool libraries
1588
 
    case $linkmode in
1589
 
    lib)
1590
 
        passes="link"
1591
 
        for file in $dlfiles $dlprefiles; do
1592
 
          case "$file" in
1593
 
          *.la) ;;
1594
 
          *)
1595
 
            $echo "$modename: libraries can \`-dlopen' only libtool libraries" 1>&2
1596
 
            exit 1
1597
 
            ;;
1598
 
          esac
1599
 
        done
1600
 
        ;;
1601
 
    prog)
1602
 
        compile_deplibs=
1603
 
        finalize_deplibs=
1604
 
        alldeplibs=no
1605
 
        newdlfiles=
1606
 
        newdlprefiles=
1607
 
        link_against_libtool_libs=
1608
 
        passes="scan dlopen dlpreopen link"
1609
 
        ;;
1610
 
    *)  passes="link"
1611
 
        ;;
1612
 
    esac
1613
 
    for pass in $passes; do
1614
 
      if test $linkmode = prog; then
1615
 
        case $pass in
1616
 
        dlopen) libs="$dlfiles" ;;
1617
 
        dlpreopen) libs="$dlprefiles" ;;
1618
 
        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1619
 
        esac
1620
 
      fi
1621
 
      if test $pass = dlopen; then
1622
 
        # Collect dlpreopened libraries
1623
 
        save_deplibs="$deplibs"
1624
 
        deplibs=
1625
 
      fi
1626
 
      for deplib in $libs; do
1627
 
        lib=
1628
 
        found=no
1629
 
        case "$deplib" in
1630
 
        -l*)
1631
 
          if test $linkmode != lib && test $linkmode != prog; then
1632
 
            $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1633
 
            continue
1634
 
          fi
1635
 
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1636
 
          for searchdir in $lib_search_path; do
1637
 
            # Search the libtool library
1638
 
            lib="$searchdir/lib${name}.la"
1639
 
            if test -f "$lib"; then
1640
 
              found=yes
1641
 
              break
1642
 
            fi
1643
 
          done
1644
 
          if test "$found" != yes; then
1645
 
            if test "$linkmode,$pass" = "prog,link"; then
1646
 
              compile_deplibs="$deplib $compile_deplibs"
1647
 
              finalize_deplibs="$deplib $finalize_deplibs"
1648
 
            else
1649
 
              deplibs="$deplib $deplibs"
1650
 
              test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
1651
 
            fi
1652
 
            continue
1653
 
          fi
1654
 
          ;;
1655
 
        -L*)
1656
 
          case $linkmode in
1657
 
          lib)
1658
 
            deplibs="$deplib $deplibs"
1659
 
            newdependency_libs="$deplib $newdependency_libs"
1660
 
            new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1661
 
            ;;
1662
 
          prog)
1663
 
            if test $pass = scan; then
1664
 
              deplibs="$deplib $deplibs"
1665
 
              new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1666
 
            else
1667
 
              compile_deplibs="$deplib $compile_deplibs"
1668
 
              finalize_deplibs="$deplib $finalize_deplibs"
1669
 
            fi
1670
 
            ;;
1671
 
          *)
1672
 
            $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
1673
 
            ;;
1674
 
          esac
1675
 
          continue
1676
 
          ;;
1677
 
        -R*)
1678
 
          if test "$linkmode,$pass" = "prog,link"; then
1679
 
            dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1680
 
            # Make sure the xrpath contains only unique directories.
1681
 
            case "$xrpath " in
1682
 
            *" $dir "*) ;;
1683
 
            *) xrpath="$xrpath $dir" ;;
1684
 
            esac
1685
 
          fi
1686
 
          continue
1687
 
          ;;
1688
 
        *.la) lib="$deplib" ;;
1689
 
        *.$libext)
1690
 
          case $linkmode in
1691
 
          lib)
1692
 
            if test "$deplibs_check_method" != pass_all; then
1693
 
              echo
1694
 
              echo "*** Warning: This library needs some functionality provided by $deplib."
1695
 
              echo "*** I have the capability to make that library automatically link in when"
1696
 
              echo "*** you link to this library.  But I can only do this if you have a"
1697
 
              echo "*** shared version of the library, which you do not appear to have."
1698
 
            else
1699
 
              echo
1700
 
              echo "*** Warning: Linking the shared library $output against the"
1701
 
              echo "*** static library $deplib is not portable!"
1702
 
              deplibs="$deplib $deplibs"
1703
 
            fi
1704
 
            continue
1705
 
            ;;
1706
 
          prog)
1707
 
            if test $pass != link; then
1708
 
              deplibs="$deplib $deplibs"
1709
 
            else
1710
 
              compile_deplibs="$deplib $compile_deplibs"
1711
 
              finalize_deplibs="$deplib $finalize_deplibs"
1712
 
            fi
1713
 
            continue
1714
 
            ;;
1715
 
          esac
1716
 
          ;;
1717
 
        *.lo | *.$objext)
1718
 
          if test $linkmode = prog; then
1719
 
            if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1720
 
              # If there is no dlopen support or we're linking statically,
1721
 
              # we need to preload.
1722
 
              newdlprefiles="$newdlprefiles $deplib"
1723
 
              compile_deplibs="$deplib $compile_deplibs"
1724
 
              finalize_deplibs="$deplib $finalize_deplibs"
1725
 
            else
1726
 
              newdlfiles="$newdlfiles $deplib"
1727
 
            fi
1728
 
          fi
1729
 
          continue
1730
 
          ;;
1731
 
        %DEPLIBS%)
1732
 
          alldeplibs=yes
1733
 
          continue
1734
 
          ;;
1735
 
        esac
1736
 
        if test $found = yes || test -f "$lib"; then :
1737
 
        else
1738
 
          $echo "$modename: cannot find the library \`$lib'" 1>&2
1739
 
          exit 1
1740
 
        fi
1741
 
 
1742
 
        # Check to see that this really is a libtool archive.
1743
 
        if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1744
 
        else
1745
 
          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
1746
 
          exit 1
1747
 
        fi
1748
 
 
1749
 
        ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
1750
 
        test "X$ladir" = "X$lib" && ladir="."
1751
 
 
1752
 
        dlname=
1753
 
        dlopen=
1754
 
        dlpreopen=
1755
 
        libdir=
1756
 
        library_names=
1757
 
        old_library=
1758
 
        # If the library was installed with an old release of libtool,
1759
 
        # it will not redefine variable installed.
1760
 
        installed=yes
1761
 
 
1762
 
        # Read the .la file
1763
 
        case "$lib" in
1764
 
        */* | *\\*) . $lib ;;
1765
 
        *) . ./$lib ;;
1766
 
        esac
1767
 
 
1768
 
        if test $linkmode = lib || test "$linkmode,$pass" = "prog,scan"; then
1769
 
          test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
1770
 
          test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
1771
 
        fi
1772
 
 
1773
 
        if test $linkmode != lib && test $linkmode != prog; then
1774
 
          # only check for convenience libraries
1775
 
          if test -z "$old_library"; then
1776
 
            $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1777
 
            exit 1
1778
 
          fi
1779
 
          if test -n "$libdir"; then
1780
 
            $echo "$modename: \`$lib' is not a convenience library" 1>&2
1781
 
            exit 1
1782
 
          fi
1783
 
          # It is a libtool convenience library, so add in its objects.
1784
 
          convenience="$convenience $ladir/$objdir/$old_library"
1785
 
          old_convenience="$old_convenience $ladir/$objdir/$old_library"
1786
 
          continue
1787
 
        fi
1788
 
 
1789
 
        # Get the name of the library we link against.
1790
 
        linklib=
1791
 
        for l in $old_library $library_names; do
1792
 
          linklib="$l"
1793
 
        done
1794
 
        if test -z "$linklib"; then
1795
 
          $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
1796
 
          exit 1
1797
 
        fi
1798
 
 
1799
 
        # This library was specified with -dlopen.
1800
 
        if test $pass = dlopen; then
1801
 
          if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
1802
 
            # If there is no dlname, no dlopen support or we're linking statically,
1803
 
            # we need to preload.
1804
 
            dlprefiles="$dlprefiles $lib"
1805
 
          else
1806
 
            newdlfiles="$newdlfiles $lib"
1807
 
          fi
1808
 
          continue
1809
 
        fi
1810
 
 
1811
 
        # We need an absolute path.
1812
 
        case "$ladir" in
1813
 
        [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
1814
 
        *)
1815
 
          abs_ladir=`cd "$ladir" && pwd`
1816
 
          if test -z "$abs_ladir"; then
1817
 
            $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
1818
 
            $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1819
 
            abs_ladir="$ladir"
1820
 
          fi
1821
 
          ;;
1822
 
        esac
1823
 
        laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
1824
 
 
1825
 
        # Find the relevant object directory and library name.
1826
 
        if test "X$installed" = Xyes; then
1827
 
          if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
1828
 
            $echo "$modename: warning: library \`$lib' was moved." 1>&2
1829
 
            dir="$ladir"
1830
 
            absdir="$abs_ladir"
1831
 
            libdir="$abs_ladir"
1832
 
          else
1833
 
            dir="$libdir"
1834
 
            absdir="$libdir"
1835
 
          fi
1836
 
        else
1837
 
          dir="$ladir/$objdir"
1838
 
          absdir="$abs_ladir/$objdir"
1839
 
          # Remove this search path later
1840
 
          uninst_path="$uninst_path $abs_ladir"
1841
 
        fi
1842
 
        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1843
 
 
1844
 
        # This library was specified with -dlpreopen.
1845
 
        if test $pass = dlpreopen; then
1846
 
          # Prefer using a static library (so that no silly _DYNAMIC symbols
1847
 
          # are required to link).
1848
 
          if test -n "$old_library"; then
1849
 
            newdlprefiles="$newdlprefiles $dir/$old_library"
1850
 
          else
1851
 
            newdlprefiles="$newdlprefiles $dir/$linklib"
1852
 
          fi
1853
 
        fi
1854
 
 
1855
 
        if test $linkmode = prog && test $pass != link; then
1856
 
          new_lib_search_path="$new_lib_search_path $ladir"
1857
 
          deplibs="$lib $deplibs"
1858
 
 
1859
 
          linkalldeplibs=no
1860
 
          if test "$link_all_deplibs" != no || test "$fast_install" != no || \
1861
 
             test "$build_libtool_libs" = no || test -z "$library_names"; then
1862
 
            linkalldeplibs=yes
1863
 
          fi
1864
 
 
1865
 
          tmp_libs=
1866
 
          for deplib in $dependency_libs; do
1867
 
            case "$deplib" in
1868
 
            -L*) new_lib_search_path="$new_lib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
1869
 
            esac
1870
 
            # Need to link against all dependency_libs?
1871
 
            if test $linkalldeplibs = yes; then
1872
 
              deplibs="$deplib $deplibs"
1873
 
            else
1874
 
              # Need to hardcode shared library paths
1875
 
              # or/and link against static libraries
1876
 
              newdependency_libs="$deplib $newdependency_libs"
1877
 
            fi
1878
 
            case "$tmp_libs " in
1879
 
            *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1880
 
            esac
1881
 
            tmp_libs="$tmp_libs $deplib"
1882
 
          done
1883
 
          continue
1884
 
        fi
1885
 
 
1886
 
        if test -z "$libdir"; then
1887
 
          # It is a libtool convenience library, so add in its objects.
1888
 
          convenience="$convenience $dir/$old_library"
1889
 
          old_convenience="$old_convenience $dir/$old_library"
1890
 
          if test $linkmode = lib; then
1891
 
            deplibs="$dir/$old_library $deplibs"
1892
 
            tmp_libs=
1893
 
            for deplib in $dependency_libs; do
1894
 
              newdependency_libs="$deplib $newdependency_libs"
1895
 
              case "$tmp_libs " in
1896
 
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1897
 
              esac
1898
 
              tmp_libs="$tmp_libs $deplib"
1899
 
            done
1900
 
          elif test "$linkmode,$pass" = "prog,link"; then
1901
 
            compile_deplibs="$dir/$old_library $compile_deplibs"
1902
 
            finalize_deplibs="$dir/$old_library $finalize_deplibs"
1903
 
          fi
1904
 
          continue
1905
 
        fi
1906
 
 
1907
 
        if test "$linkmode,$pass" = "prog,link"; then
1908
 
          if test -n "$library_names" &&
1909
 
             { test "$hardcode_into_libs" != all || test "$alldeplibs" != yes; } &&
1910
 
             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1911
 
            # We need to hardcode the library path
1912
 
            if test -n "$shlibpath_var"; then
1913
 
              # Make sure the rpath contains only unique directories.
1914
 
              case "$temp_rpath " in
1915
 
              *" $dir "*) ;;
1916
 
              *" $absdir "*) ;;
1917
 
              *) temp_rpath="$temp_rpath $dir" ;;
1918
 
              esac
1919
 
            fi
1920
 
 
1921
 
            # Hardcode the library path.
1922
 
            # Skip directories that are in the system default run-time
1923
 
            # search path.
1924
 
            case " $sys_lib_dlsearch_path " in
1925
 
            *" $absdir "*) ;;
1926
 
            *)
1927
 
              case "$compile_rpath " in
1928
 
              *" $absdir "*) ;;
1929
 
              *) compile_rpath="$compile_rpath $absdir"
1930
 
              esac
1931
 
              ;;
1932
 
            esac
1933
 
 
1934
 
            case " $sys_lib_dlsearch_path " in
1935
 
            *" $libdir "*) ;;
1936
 
            *)
1937
 
              case "$finalize_rpath " in
1938
 
              *" $libdir "*) ;;
1939
 
              *) finalize_rpath="$finalize_rpath $libdir"
1940
 
              esac
1941
 
              ;;
1942
 
            esac
1943
 
          fi
1944
 
 
1945
 
          if test "$alldeplibs" = yes &&
1946
 
             { test "$deplibs_check_method" = pass_all ||
1947
 
               { test "$build_libtool_libs" = yes &&
1948
 
                 test -n "$library_names"; }; }; then
1949
 
            # Do we only need to link against static libraries?
1950
 
            continue
1951
 
          fi
1952
 
        fi
1953
 
 
1954
 
        link_static=no # Whether this library is linked statically
1955
 
        if test -n "$library_names" &&
1956
 
           { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1957
 
          link_against_libtool_libs="$link_against_libtool_libs $lib"
1958
 
          test "X$installed" = xno && need_relink=yes
1959
 
          # This is a shared library
1960
 
          if test $linkmode = lib && test "$hardcode_into_libs" = all; then
1961
 
            # Hardcode the library path.
1962
 
            # Skip directories that are in the system default run-time
1963
 
            # search path.
1964
 
            case " $sys_lib_dlsearch_path " in
1965
 
            *" $absdir "*) ;;
1966
 
            *)
1967
 
              case "$compile_rpath " in
1968
 
              *" $absdir "*) ;;
1969
 
              *) compile_rpath="$compile_rpath $absdir"
1970
 
              esac
1971
 
              ;;
1972
 
            esac
1973
 
            case " $sys_lib_dlsearch_path " in
1974
 
            *" $libdir "*) ;;
1975
 
            *)
1976
 
              case "$finalize_rpath " in
1977
 
              *" $libdir "*) ;;
1978
 
              *) finalize_rpath="$finalize_rpath $libdir"
1979
 
              esac
1980
 
              ;;
1981
 
            esac
1982
 
          fi
1983
 
 
1984
 
          if test -n "$old_archive_from_expsyms_cmds"; then
1985
 
            # figure out the soname
1986
 
            set dummy $library_names
1987
 
            realname="$2"
1988
 
            shift; shift
1989
 
            libname=`eval \\$echo \"$libname_spec\"`
1990
 
            if test -n "$soname_spec"; then
1991
 
              eval soname=\"$soname_spec\"
1992
 
            else
1993
 
              soname="$realname"
1994
 
            fi
1995
 
 
1996
 
            # Make a new name for the extract_expsyms_cmds to use
1997
 
            newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
1998
 
 
1999
 
            # If the library has no export list, then create one now
2000
 
            if test -f "$output_objdir/$soname-def"; then :
2001
 
            else
2002
 
              $show "extracting exported symbol list from \`$soname'"
2003
 
              IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
2004
 
              eval cmds=\"$extract_expsyms_cmds\"
2005
 
              for cmd in $cmds; do
2006
 
                IFS="$save_ifs"
2007
 
                $show "$cmd"
2008
 
                $run eval "$cmd" || exit $?
2009
 
              done
2010
 
              IFS="$save_ifs"
2011
 
            fi
2012
 
 
2013
 
            # Create $newlib
2014
 
            if test -f "$output_objdir/$newlib"; then :; else
2015
 
              $show "generating import library for \`$soname'"
2016
 
              IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
2017
 
              eval cmds=\"$old_archive_from_expsyms_cmds\"
2018
 
              for cmd in $cmds; do
2019
 
                IFS="$save_ifs"
2020
 
                $show "$cmd"
2021
 
                $run eval "$cmd" || exit $?
2022
 
              done
2023
 
              IFS="$save_ifs"
2024
 
            fi
2025
 
            # make sure the library variables are pointing to the new library
2026
 
            dir=$output_objdir
2027
 
            linklib=$newlib
2028
 
          fi
2029
 
 
2030
 
          if test $linkmode = prog || test "$mode" != relink; then
2031
 
            add_shlibpath=
2032
 
            add_dir=
2033
 
            add=
2034
 
            lib_linked=yes
2035
 
            case "$hardcode_action" in
2036
 
            immediate | unsupported)
2037
 
              if test "$hardcode_direct" = no; then
2038
 
                add="$dir/$linklib"
2039
 
              elif test "$hardcode_minus_L" = no; then
2040
 
                case "$host" in
2041
 
                *-*-sunos*) add_shlibpath="$dir" ;;
2042
 
                esac
2043
 
                add_dir="-L$dir"
2044
 
                add="-l$name"
2045
 
              elif test "$hardcode_shlibpath_var" = no; then
2046
 
                add_shlibpath="$dir"
2047
 
                add="-l$name"
2048
 
              else
2049
 
                lib_linked=no
2050
 
              fi
2051
 
              ;;
2052
 
            relink)
2053
 
              if test "$hardcode_direct" = yes; then
2054
 
                add="$dir/$linklib"
2055
 
              elif test "$hardcode_minus_L" = yes; then
2056
 
                add_dir="-L$dir"
2057
 
                add="-l$name"
2058
 
              elif test "$hardcode_shlibpath_var" = yes; then
2059
 
                add_shlibpath="$dir"
2060
 
                add="-l$name"
2061
 
              else
2062
 
                lib_linked=no
2063
 
              fi
2064
 
              ;;
2065
 
            *) lib_linked=no ;;
2066
 
            esac
2067
 
 
2068
 
            if test "$lib_linked" != yes; then
2069
 
              $echo "$modename: configuration error: unsupported hardcode properties"
2070
 
              exit 1
2071
 
            fi
2072
 
 
2073
 
            if test -n "$add_shlibpath"; then
2074
 
              case ":$compile_shlibpath:" in
2075
 
              *":$add_shlibpath:"*) ;;
2076
 
              *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
2077
 
              esac
2078
 
            fi
2079
 
            if test $linkmode = prog; then
2080
 
              test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
2081
 
              test -n "$add" && compile_deplibs="$add $compile_deplibs"
2082
 
            else
2083
 
              test -n "$add_dir" && deplibs="$add_dir $deplibs"
2084
 
              test -n "$add" && deplibs="$add $deplibs"
2085
 
              if test "$hardcode_direct" != yes && \
2086
 
                 test "$hardcode_minus_L" != yes && \
2087
 
                 test "$hardcode_shlibpath_var" = yes; then
2088
 
                case ":$finalize_shlibpath:" in
2089
 
                *":$libdir:"*) ;;
2090
 
                *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2091
 
                esac
2092
 
              fi
2093
 
            fi
2094
 
          fi
2095
 
 
2096
 
          if test $linkmode = prog || test "$mode" = relink; then
2097
 
            add_shlibpath=
2098
 
            add_dir=
2099
 
            add=
2100
 
            # Finalize command for both is simple: just hardcode it.
2101
 
            if test "$hardcode_direct" = yes; then
2102
 
              add="$libdir/$linklib"
2103
 
            elif test "$hardcode_minus_L" = yes; then
2104
 
              add_dir="-L$libdir"
2105
 
              add="-l$name"
2106
 
            elif test "$hardcode_shlibpath_var" = yes; then
2107
 
              case ":$finalize_shlibpath:" in
2108
 
              *":$libdir:"*) ;;
2109
 
              *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2110
 
              esac
2111
 
              add="-l$name"
2112
 
            else
2113
 
              # We cannot seem to hardcode it, guess we'll fake it.
2114
 
              add_dir="-L$libdir"
2115
 
              add="-l$name"
2116
 
            fi
2117
 
 
2118
 
            if test $linkmode = prog; then
2119
 
              test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
2120
 
              test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
2121
 
            else
2122
 
              test -n "$add_dir" && deplibs="$add_dir $deplibs"
2123
 
              test -n "$add" && deplibs="$add deplibs"
2124
 
            fi
2125
 
          fi
2126
 
        elif test $linkmode = prog; then
2127
 
          # Here we assume that one of hardcode_direct or hardcode_minus_L
2128
 
          # is not unsupported.  This is valid on all known static and
2129
 
          # shared platforms.
2130
 
          if test "$hardcode_direct" != unsupported; then
2131
 
            test -n "$old_library" && linklib="$old_library"
2132
 
            compile_deplibs="$dir/$linklib $compile_deplibs"
2133
 
            finalize_deplibs="$dir/$linklib $finalize_deplibs"
2134
 
          else
2135
 
            compile_deplibs="-l$name -L$dir $compile_deplibs"
2136
 
            finalize_deplibs="-l$name -L$dir $finalize_deplibs"
2137
 
          fi
2138
 
        elif test "$build_libtool_libs" = yes; then
2139
 
          # Not a shared library
2140
 
          if test "$deplibs_check_method" != pass_all; then
2141
 
            # We're trying link a shared library against a static one
2142
 
            # but the system doesn't support it.
2143
 
            # Just print a warning and add the library to dependency_libs so
2144
 
            # that the program can be linked against the static library.
2145
 
            echo
2146
 
            echo "*** Warning: This library needs some functionality provided by $lib."
2147
 
            echo "*** I have the capability to make that library automatically link in when"
2148
 
            echo "*** you link to this library.  But I can only do this if you have a"
2149
 
            echo "*** shared version of the library, which you do not appear to have."
2150
 
          else
2151
 
            convenience="$convenience $dir/$old_library"
2152
 
            old_convenience="$old_convenience $dir/$old_library"
2153
 
            deplibs="$dir/$old_library $deplibs"
2154
 
            link_static=yes
2155
 
          fi
2156
 
        fi
2157
 
 
2158
 
        if test $linkmode = lib; then
2159
 
          if test -n "$dependency_libs" &&
2160
 
             { test "$hardcode_into_libs" = no || test $build_old_libs = yes ||
2161
 
               test $link_static = yes; }; then
2162
 
            # Extract -R from dependency_libs
2163
 
            temp_deplibs=
2164
 
            for libdir in $dependency_libs; do
2165
 
              case "$libdir" in
2166
 
              -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2167
 
                   case " $xrpath " in
2168
 
                   *" $temp_xrpath "*) ;;
2169
 
                   *) xrpath="$xrpath $temp_xrpath";;
2170
 
                   esac;;
2171
 
              *) temp_deplibs="$temp_deplibs $libdir";;
2172
 
              esac
2173
 
            done
2174
 
            dependency_libs="$temp_deplibs"
2175
 
          fi
2176
 
 
2177
 
          new_lib_search_path="$new_lib_search_path $absdir"
2178
 
          # Link against this library
2179
 
          test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
2180
 
          # ... and its dependency_libs
2181
 
          tmp_libs=
2182
 
          for deplib in $dependency_libs; do
2183
 
            newdependency_libs="$deplib $newdependency_libs"
2184
 
            case "$tmp_libs " in
2185
 
            *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2186
 
            esac
2187
 
            tmp_libs="$tmp_libs $deplib"
2188
 
          done
2189
 
 
2190
 
          if test $link_all_deplibs != no; then
2191
 
            # Add the search paths of all dependency libraries
2192
 
            for deplib in $dependency_libs; do
2193
 
              case "$deplib" in
2194
 
              -L*) path="$deplib" ;;
2195
 
              *.la)
2196
 
                dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2197
 
                test "X$dir" = "X$deplib" && dir="."
2198
 
                # We need an absolute path.
2199
 
                case "$dir" in
2200
 
                [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2201
 
                *)
2202
 
                  absdir=`cd "$dir" && pwd`
2203
 
                  if test -z "$absdir"; then
2204
 
                    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2205
 
                    absdir="$dir"
2206
 
                  fi
2207
 
                  ;;
2208
 
                esac
2209
 
                if grep "^installed=no" $deplib > /dev/null; then
2210
 
                  path="-L$absdir/$objdir"
2211
 
                else
2212
 
                  eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2213
 
                  if test -z "$libdir"; then
2214
 
                    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
2215
 
                    exit 1
2216
 
                  fi
2217
 
                  if test "$absdir" != "$libdir"; then
2218
 
                    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2219
 
                  fi
2220
 
                  path="-L$absdir"
2221
 
                fi
2222
 
                ;;
2223
 
              *) continue ;;
2224
 
              esac
2225
 
              case " $deplibs " in
2226
 
              *" $path "*) ;;
2227
 
              *) deplibs="$deplibs $path" ;;
2228
 
              esac
2229
 
            done
2230
 
          fi
2231
 
        fi
2232
 
      done
2233
 
      dependency_libs="$newdependency_libs"
2234
 
      if test $pass = dlpreopen; then
2235
 
        # Link the dlpreopened libraries before other libraries
2236
 
        deplibs="$deplibs $save_deplibs"
2237
 
      elif test $pass != dlopen; then
2238
 
        # Make sure lib_search_path contains only unique directories.
2239
 
        lib_search_path=
2240
 
        for dir in $new_lib_search_path; do
2241
 
          case "$lib_search_path " in
2242
 
          *" $dir "*) ;;
2243
 
          *) lib_search_path="$lib_search_path $dir" ;;
2244
 
          esac
2245
 
        done
2246
 
        lib_search_path="$lib_search_path $sys_lib_search_path"
2247
 
 
2248
 
        if test "$linkmode,$pass" != "prog,link"; then
2249
 
          vars="deplibs"
2250
 
        else
2251
 
          vars="compile_deplibs finalize_deplibs"
2252
 
        fi
2253
 
        for var in $vars dependency_libs; do
2254
 
          # Make sure that $var contains only unique libraries
2255
 
          # and add them in reverse order
2256
 
          eval tmp_libs=\"\$$var\"
2257
 
          new_libs=
2258
 
          for deplib in $tmp_libs; do
2259
 
            case "$deplib" in
2260
 
            -L*) new_libs="$deplib $new_libs" ;;
2261
 
            *)
2262
 
              case " $specialdeplibs " in
2263
 
              *" $deplib "*) new_libs="$deplib $new_libs" ;;
2264
 
              *)
2265
 
                case " $new_libs " in
2266
 
                *" $deplib "*) ;;
2267
 
                *) new_libs="$deplib $new_libs" ;;
2268
 
                esac
2269
 
                ;;
2270
 
              esac
2271
 
              ;;
2272
 
            esac
2273
 
          done
2274
 
          tmp_libs=
2275
 
          for deplib in $new_libs; do
2276
 
            case "$deplib" in
2277
 
            -L*)
2278
 
              case " $tmp_libs " in
2279
 
              *" $deplib "*) ;;
2280
 
              *) tmp_libs="$tmp_libs $deplib" ;;
2281
 
              esac
2282
 
              ;;
2283
 
            *) tmp_libs="$tmp_libs $deplib" ;;
2284
 
            esac
2285
 
          done
2286
 
          eval $var=\"$tmp_libs\"
2287
 
        done
2288
 
      fi
2289
 
    done
2290
 
    if test $linkmode = prog; then
2291
 
      dlfiles="$newdlfiles"
2292
 
      dlprefiles="$newdlprefiles"
2293
 
    fi
2294
 
 
2295
 
    case $linkmode in
2296
 
    oldlib)
2297
 
      if test -n "$deplibs"; then
2298
 
        $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2299
 
      fi
2300
 
 
2301
 
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2302
 
        $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2303
 
      fi
2304
 
 
2305
 
      if test -n "$rpath"; then
2306
 
        $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2307
 
      fi
2308
 
 
2309
 
      if test -n "$xrpath"; then
2310
 
        $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2311
 
      fi
2312
 
 
2313
 
      if test -n "$vinfo"; then
2314
 
        $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2315
 
      fi
2316
 
 
2317
 
      if test -n "$release"; then
2318
 
        $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2319
 
      fi
2320
 
 
2321
 
      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2322
 
        $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2323
 
      fi
2324
 
 
2325
 
      # Now set the variables for building old libraries.
2326
 
      build_libtool_libs=no
2327
 
      oldlibs="$output"
2328
 
      objs="$objs$old_deplibs"
2329
 
      ;;
2330
 
 
2331
 
    lib)
2332
 
      # Make sure we only generate libraries of the form `libNAME.la'.
2333
 
      case "$outputname" in
2334
 
      lib*)
2335
 
        name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2336
 
        eval libname=\"$libname_spec\"
2337
 
        ;;
2338
 
      *)
2339
 
        if test "$module" = no; then
2340
 
          $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
2341
 
          $echo "$help" 1>&2
2342
 
          exit 1
2343
 
        fi
2344
 
        if test "$need_lib_prefix" != no; then
2345
 
          # Add the "lib" prefix for modules if required
2346
 
          name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2347
 
          eval libname=\"$libname_spec\"
2348
 
        else
2349
 
          libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
2350
 
        fi
2351
 
        ;;
2352
 
      esac
2353
 
 
2354
 
      if test -n "$objs"; then
2355
 
        if test "$deplibs_check_method" != pass_all; then
2356
 
          $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
2357
 
          exit 1
2358
 
        else
2359
 
          echo
2360
 
          echo "*** Warning: Linking the shared library $output against the non-libtool"
2361
 
          echo "*** objects $objs is not portable!"
2362
 
          libobjs="$libobjs $objs"
2363
 
        fi
2364
 
      fi
2365
 
 
2366
 
      if test "$dlself" != no; then
2367
 
        $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2368
 
      fi
2369
 
 
2370
 
      set dummy $rpath
2371
 
      if test $# -gt 2; then
2372
 
        $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2373
 
      fi
2374
 
      install_libdir="$2"
2375
 
 
2376
 
      oldlibs=
2377
 
      if test -z "$rpath"; then
2378
 
        if test "$build_libtool_libs" = yes; then
2379
 
          # Building a libtool convenience library.
2380
 
          libext=al
2381
 
          oldlibs="$output_objdir/$libname.$libext $oldlibs"
2382
 
          build_libtool_libs=convenience
2383
 
          build_old_libs=yes
2384
 
        fi
2385
 
 
2386
 
        if test -n "$vinfo"; then
2387
 
          $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2388
 
        fi
2389
 
 
2390
 
        if test -n "$release"; then
2391
 
          $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2392
 
        fi
2393
 
      else
2394
 
 
2395
 
        # Parse the version information argument.
2396
 
        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=':'
2397
 
        set dummy $vinfo 0 0 0
2398
 
        IFS="$save_ifs"
2399
 
 
2400
 
        if test -n "$8"; then
2401
 
          $echo "$modename: too many parameters to \`-version-info'" 1>&2
2402
 
          $echo "$help" 1>&2
2403
 
          exit 1
2404
 
        fi
2405
 
 
2406
 
        current="$2"
2407
 
        revision="$3"
2408
 
        age="$4"
2409
 
 
2410
 
        # Check that each of the things are valid numbers.
2411
 
        case "$current" in
2412
 
        0 | [1-9] | [1-9][0-9]*) ;;
2413
 
        *)
2414
 
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2415
 
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2416
 
          exit 1
2417
 
          ;;
2418
 
        esac
2419
 
 
2420
 
        case "$revision" in
2421
 
        0 | [1-9] | [1-9][0-9]*) ;;
2422
 
        *)
2423
 
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2424
 
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2425
 
          exit 1
2426
 
          ;;
2427
 
        esac
2428
 
 
2429
 
        case "$age" in
2430
 
        0 | [1-9] | [1-9][0-9]*) ;;
2431
 
        *)
2432
 
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2433
 
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2434
 
          exit 1
2435
 
          ;;
2436
 
        esac
2437
 
 
2438
 
        if test $age -gt $current; then
2439
 
          $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
2440
 
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2441
 
          exit 1
2442
 
        fi
2443
 
 
2444
 
        # Calculate the version variables.
2445
 
        major=
2446
 
        versuffix=
2447
 
        verstring=
2448
 
        case "$version_type" in
2449
 
        none) ;;
2450
 
 
2451
 
        irix)
2452
 
          major=`expr $current - $age + 1`
2453
 
          versuffix="$major.$revision"
2454
 
          verstring="sgi$major.$revision"
2455
 
 
2456
 
          # Add in all the interfaces that we are compatible with.
2457
 
          loop=$revision
2458
 
          while test $loop != 0; do
2459
 
            iface=`expr $revision - $loop`
2460
 
            loop=`expr $loop - 1`
2461
 
            verstring="sgi$major.$iface:$verstring"
2462
 
          done
2463
 
          ;;
2464
 
 
2465
 
        linux)
2466
 
          major=.`expr $current - $age`
2467
 
          versuffix="$major.$age.$revision"
2468
 
          ;;
2469
 
 
2470
 
        osf)
2471
 
          major=`expr $current - $age`
2472
 
          versuffix=".$current.$age.$revision"
2473
 
          verstring="$current.$age.$revision"
2474
 
 
2475
 
          # Add in all the interfaces that we are compatible with.
2476
 
          loop=$age
2477
 
          while test $loop != 0; do
2478
 
            iface=`expr $current - $loop`
2479
 
            loop=`expr $loop - 1`
2480
 
            verstring="$verstring:${iface}.0"
2481
 
          done
2482
 
 
2483
 
          # Make executables depend on our current version.
2484
 
          verstring="$verstring:${current}.0"
2485
 
          ;;
2486
 
 
2487
 
        sunos)
2488
 
          major=".$current"
2489
 
          versuffix=".$current.$revision"
2490
 
          ;;
2491
 
 
2492
 
        freebsd-aout)
2493
 
          major=".$current"
2494
 
          versuffix=".$current.$revision";
2495
 
          ;;
2496
 
 
2497
 
        freebsd-elf)
2498
 
          major=".$current"
2499
 
          versuffix=".$current";
2500
 
          ;;
2501
 
 
2502
 
        windows)
2503
 
          # Like Linux, but with '-' rather than '.', since we only
2504
 
          # want one extension on Windows 95.
2505
 
          major=`expr $current - $age`
2506
 
          versuffix="-$major-$age-$revision"
2507
 
          ;;
2508
 
 
2509
 
        *)
2510
 
          $echo "$modename: unknown library version type \`$version_type'" 1>&2
2511
 
          echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
2512
 
          exit 1
2513
 
          ;;
2514
 
        esac
2515
 
 
2516
 
        # Clear the version info if we defaulted, and they specified a release.
2517
 
        if test -z "$vinfo" && test -n "$release"; then
2518
 
          major=
2519
 
          verstring="0.0"
2520
 
          if test "$need_version" = no; then
2521
 
            versuffix=
2522
 
          else
2523
 
            versuffix=".0.0"
2524
 
          fi
2525
 
        fi
2526
 
 
2527
 
        # Remove version info from name if versioning should be avoided
2528
 
        if test "$avoid_version" = yes && test "$need_version" = no; then
2529
 
          major=
2530
 
          versuffix=
2531
 
          verstring=""
2532
 
        fi
2533
 
 
2534
 
        # Check to see if the archive will have undefined symbols.
2535
 
        if test "$allow_undefined" = yes; then
2536
 
          if test "$allow_undefined_flag" = unsupported; then
2537
 
            $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2538
 
            build_libtool_libs=no
2539
 
            build_old_libs=yes
2540
 
          fi
2541
 
        else
2542
 
          # Don't allow undefined symbols.
2543
 
          allow_undefined_flag="$no_undefined_flag"
2544
 
        fi
2545
 
      fi
2546
 
 
2547
 
      if test "$mode" != relink; then
2548
 
        # Remove our outputs.
2549
 
        $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2550
 
        $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2551
 
      fi
2552
 
 
2553
 
      # Now set the variables for building old libraries.
2554
 
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2555
 
        oldlibs="$oldlibs $output_objdir/$libname.$libext"
2556
 
 
2557
 
        # Transform .lo files to .o files.
2558
 
        oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2559
 
      fi
2560
 
 
2561
 
      # Eliminate all temporary directories.
2562
 
      for path in $uninst_path; do
2563
 
        lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
2564
 
        deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
2565
 
        dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
2566
 
      done
2567
 
 
2568
 
      if test -n "$xrpath"; then
2569
 
        # If the user specified any rpath flags, then add them.
2570
 
        temp_xrpath=
2571
 
        for libdir in $xrpath; do
2572
 
          temp_xrpath="$temp_xrpath -R$libdir"
2573
 
          case "$finalize_rpath " in
2574
 
          *" $libdir "*) ;;
2575
 
          *) finalize_rpath="$finalize_rpath $libdir" ;;
2576
 
          esac
2577
 
        done
2578
 
        if test "$hardcode_into_libs" = no || test $build_old_libs = yes; then
2579
 
          dependency_libs="$temp_xrpath $dependency_libs"
2580
 
        fi
2581
 
      fi
2582
 
 
2583
 
      # Make sure dlfiles contains only unique files that won't be dlpreopened
2584
 
      old_dlfiles="$dlfiles"
2585
 
      dlfiles=
2586
 
      for lib in $old_dlfiles; do
2587
 
        case " $dlprefiles $dlfiles " in
2588
 
        *" $lib "*) ;;
2589
 
        *) dlfiles="$dlfiles $lib" ;;
2590
 
        esac
2591
 
      done
2592
 
 
2593
 
      # Make sure dlprefiles contains only unique files
2594
 
      old_dlprefiles="$dlprefiles"
2595
 
      dlprefiles=
2596
 
      for lib in $old_dlprefiles; do
2597
 
        case "$dlprefiles " in
2598
 
        *" $lib "*) ;;
2599
 
        *) dlprefiles="$dlprefiles $lib" ;;
2600
 
        esac
2601
 
      done
2602
 
 
2603
 
      if test "$build_libtool_libs" = yes; then
2604
 
        if test -n "$rpath"; then
2605
 
          case "$host" in
2606
 
          *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
2607
 
            # these systems don't actually have a c library (as such)!
2608
 
            ;;
2609
 
          *)
2610
 
            # Add libc to deplibs on all other systems.
2611
 
            deplibs="$deplibs -lc"
2612
 
            ;;
2613
 
          esac
2614
 
        fi
2615
 
 
2616
 
        # Transform deplibs into only deplibs that can be linked in shared.
2617
 
        name_save=$name
2618
 
        libname_save=$libname
2619
 
        release_save=$release
2620
 
        versuffix_save=$versuffix
2621
 
        major_save=$major
2622
 
        # I'm not sure if I'm treating the release correctly.  I think
2623
 
        # release should show up in the -l (ie -lgmp5) so we don't want to
2624
 
        # add it in twice.  Is that correct?
2625
 
        release=""
2626
 
        versuffix=""
2627
 
        major=""
2628
 
        newdeplibs=
2629
 
        droppeddeps=no
2630
 
        case "$deplibs_check_method" in
2631
 
        pass_all)
2632
 
          # Don't check for shared/static.  Everything works.
2633
 
          # This might be a little naive.  We might want to check
2634
 
          # whether the library exists or not.  But this is on
2635
 
          # osf3 & osf4 and I'm not really sure... Just
2636
 
          # implementing what was already the behaviour.
2637
 
          newdeplibs=$deplibs
2638
 
          ;;
2639
 
        test_compile)
2640
 
          # This code stresses the "libraries are programs" paradigm to its
2641
 
          # limits. Maybe even breaks it.  We compile a program, linking it
2642
 
          # against the deplibs as a proxy for the library.  Then we can check
2643
 
          # whether they linked in statically or dynamically with ldd.
2644
 
          $rm conftest.c
2645
 
          cat > conftest.c <<EOF
2646
 
          int main() { return 0; }
2647
 
EOF
2648
 
          $rm conftest
2649
 
          $CC -o conftest conftest.c $deplibs
2650
 
          if test $? -eq 0 ; then
2651
 
            ldd_output=`ldd conftest`
2652
 
            for i in $deplibs; do
2653
 
              name="`expr $i : '-l\(.*\)'`"
2654
 
              # If $name is empty we are operating on a -L argument.
2655
 
              if test "$name" != "" ; then
2656
 
                libname=`eval \\$echo \"$libname_spec\"`
2657
 
                deplib_matches=`eval \\$echo \"$library_names_spec\"`
2658
 
                set dummy $deplib_matches
2659
 
                deplib_match=$2
2660
 
                if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2661
 
                  newdeplibs="$newdeplibs $i"
2662
 
                else
2663
 
                  droppeddeps=yes
2664
 
                  echo
2665
 
                  echo "*** Warning: This library needs some functionality provided by $i."
2666
 
                  echo "*** I have the capability to make that library automatically link in when"
2667
 
                  echo "*** you link to this library.  But I can only do this if you have a"
2668
 
                  echo "*** shared version of the library, which you do not appear to have."
2669
 
                fi
2670
 
              else
2671
 
                newdeplibs="$newdeplibs $i"
2672
 
              fi
2673
 
            done
2674
 
          else
2675
 
            # Error occured in the first compile.  Let's try to salvage the situation:
2676
 
            # Compile a seperate program for each library.
2677
 
            for i in $deplibs; do
2678
 
              name="`expr $i : '-l\(.*\)'`"
2679
 
             # If $name is empty we are operating on a -L argument.
2680
 
              if test "$name" != "" ; then
2681
 
                $rm conftest
2682
 
                $CC -o conftest conftest.c $i
2683
 
                # Did it work?
2684
 
                if test $? -eq 0 ; then
2685
 
                  ldd_output=`ldd conftest`
2686
 
                  libname=`eval \\$echo \"$libname_spec\"`
2687
 
                  deplib_matches=`eval \\$echo \"$library_names_spec\"`
2688
 
                  set dummy $deplib_matches
2689
 
                  deplib_match=$2
2690
 
                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2691
 
                    newdeplibs="$newdeplibs $i"
2692
 
                  else
2693
 
                    droppeddeps=yes
2694
 
                    echo
2695
 
                    echo "*** Warning: This library needs some functionality provided by $i."
2696
 
                    echo "*** I have the capability to make that library automatically link in when"
2697
 
                    echo "*** you link to this library.  But I can only do this if you have a"
2698
 
                    echo "*** shared version of the library, which you do not appear to have."
2699
 
                  fi
2700
 
                else
2701
 
                  droppeddeps=yes
2702
 
                  echo
2703
 
                  echo "*** Warning!  Library $i is needed by this library but I was not able to"
2704
 
                  echo "***  make it link in!  You will probably need to install it or some"
2705
 
                  echo "*** library that it depends on before this library will be fully"
2706
 
                  echo "*** functional.  Installing it before continuing would be even better."
2707
 
                fi
2708
 
              else
2709
 
                newdeplibs="$newdeplibs $i"
2710
 
              fi
2711
 
            done
2712
 
          fi
2713
 
          ;;
2714
 
        file_magic*)
2715
 
          set dummy $deplibs_check_method
2716
 
          file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
2717
 
          for a_deplib in $deplibs; do
2718
 
            name="`expr $a_deplib : '-l\(.*\)'`"
2719
 
            # If $name is empty we are operating on a -L argument.
2720
 
            if test "$name" != "" ; then
2721
 
              libname=`eval \\$echo \"$libname_spec\"`
2722
 
              for i in $lib_search_path; do
2723
 
                    potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2724
 
                    for potent_lib in $potential_libs; do
2725
 
                      # Follow soft links.
2726
 
                      if ls -lLd "$potent_lib" 2>/dev/null \
2727
 
                         | grep " -> " >/dev/null; then
2728
 
                        continue
2729
 
                      fi
2730
 
                      # The statement above tries to avoid entering an
2731
 
                      # endless loop below, in case of cyclic links.
2732
 
                      # We might still enter an endless loop, since a link
2733
 
                      # loop can be closed while we follow links,
2734
 
                      # but so what?
2735
 
                      potlib="$potent_lib"
2736
 
                      while test -h "$potlib" 2>/dev/null; do
2737
 
                        potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2738
 
                        case "$potliblink" in
2739
 
                        [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2740
 
                        *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2741
 
                        esac
2742
 
                      done
2743
 
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2744
 
                         | sed 10q \
2745
 
                         | egrep "$file_magic_regex" > /dev/null; then
2746
 
                        newdeplibs="$newdeplibs $a_deplib"
2747
 
                        a_deplib=""
2748
 
                        break 2
2749
 
                      fi
2750
 
                    done
2751
 
              done
2752
 
              if test -n "$a_deplib" ; then
2753
 
                droppeddeps=yes
2754
 
                echo
2755
 
                echo "*** Warning: This library needs some functionality provided by $a_deplib."
2756
 
                echo "*** I have the capability to make that library automatically link in when"
2757
 
                echo "*** you link to this library.  But I can only do this if you have a"
2758
 
                echo "*** shared version of the library, which you do not appear to have."
2759
 
              fi
2760
 
            else
2761
 
              # Add a -L argument.
2762
 
              newdeplibs="$newdeplibs $a_deplib"
2763
 
            fi
2764
 
          done # Gone through all deplibs.
2765
 
          ;;
2766
 
        none | unknown | *)
2767
 
          newdeplibs=""
2768
 
          if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2769
 
               -e 's/ -[LR][^ ]*//g' -e 's/[    ]//g' |
2770
 
             grep . >/dev/null; then
2771
 
            echo
2772
 
            if test "X$deplibs_check_method" = "Xnone"; then
2773
 
              echo "*** Warning: inter-library dependencies are not supported in this platform."
2774
 
            else
2775
 
              echo "*** Warning: inter-library dependencies are not known to be supported."
2776
 
            fi
2777
 
            echo "*** All declared inter-library dependencies are being dropped."
2778
 
            droppeddeps=yes
2779
 
          fi
2780
 
          ;;
2781
 
        esac
2782
 
        versuffix=$versuffix_save
2783
 
        major=$major_save
2784
 
        release=$release_save
2785
 
        libname=$libname_save
2786
 
        name=$name_save
2787
 
 
2788
 
        if test "$droppeddeps" = yes; then
2789
 
          if test "$module" = yes; then
2790
 
            echo
2791
 
            echo "*** Warning: libtool could not satisfy all declared inter-library"
2792
 
            echo "*** dependencies of module $libname.  Therefore, libtool will create"
2793
 
            echo "*** a static module, that should work as long as the dlopening"
2794
 
            echo "*** application is linked with the -dlopen flag."
2795
 
            if test -z "$global_symbol_pipe"; then
2796
 
              echo
2797
 
              echo "*** However, this would only work if libtool was able to extract symbol"
2798
 
              echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2799
 
              echo "*** not find such a program.  So, this module is probably useless."
2800
 
              echo "*** \`nm' from GNU binutils and a full rebuild may help."
2801
 
            fi
2802
 
            if test "$build_old_libs" = no; then
2803
 
              oldlibs="$output_objdir/$libname.$libext"
2804
 
              build_libtool_libs=module
2805
 
              build_old_libs=yes
2806
 
            else
2807
 
              build_libtool_libs=no
2808
 
            fi
2809
 
          else
2810
 
            echo "*** The inter-library dependencies that have been dropped here will be"
2811
 
            echo "*** automatically added whenever a program is linked with this library"
2812
 
            echo "*** or is declared to -dlopen it."
2813
 
          fi
2814
 
        fi
2815
 
        # Done checking deplibs!
2816
 
        deplibs=$newdeplibs
2817
 
      fi
2818
 
 
2819
 
      # All the library-specific variables (install_libdir is set above).
2820
 
      library_names=
2821
 
      old_library=
2822
 
      dlname=
2823
 
 
2824
 
      # Test again, we may have decided not to build it any more
2825
 
      if test "$build_libtool_libs" = yes; then
2826
 
        if test "$hardcode_into_libs" != no; then
2827
 
          # Hardcode the library paths
2828
 
          hardcode_libdirs=
2829
 
          dep_rpath=
2830
 
          rpath="$finalize_rpath"
2831
 
          test "$mode" != relink && rpath="$compile_rpath$rpath"
2832
 
          for libdir in $rpath; do
2833
 
            if test -n "$hardcode_libdir_flag_spec"; then
2834
 
              if test -n "$hardcode_libdir_separator"; then
2835
 
                if test -z "$hardcode_libdirs"; then
2836
 
                  hardcode_libdirs="$libdir"
2837
 
                else
2838
 
                  # Just accumulate the unique libdirs.
2839
 
                  case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2840
 
                  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2841
 
                    ;;
2842
 
                  *)
2843
 
                    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2844
 
                    ;;
2845
 
                  esac
2846
 
                fi
2847
 
              else
2848
 
                eval flag=\"$hardcode_libdir_flag_spec\"
2849
 
                dep_rpath="$dep_rpath $flag"
2850
 
              fi
2851
 
            elif test -n "$runpath_var"; then
2852
 
              case "$perm_rpath " in
2853
 
              *" $libdir "*) ;;
2854
 
              *) perm_rpath="$perm_rpath $libdir" ;;
2855
 
              esac
2856
 
            fi
2857
 
          done
2858
 
          # Substitute the hardcoded libdirs into the rpath.
2859
 
          if test -n "$hardcode_libdir_separator" &&
2860
 
             test -n "$hardcode_libdirs"; then
2861
 
            libdir="$hardcode_libdirs"
2862
 
            eval dep_rpath=\"$hardcode_libdir_flag_spec\"
2863
 
          fi
2864
 
          if test -n "$runpath_var" && test -n "$perm_rpath"; then
2865
 
            # We should set the runpath_var.
2866
 
            rpath=
2867
 
            for dir in $perm_rpath; do
2868
 
              rpath="$rpath$dir:"
2869
 
            done
2870
 
            eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
2871
 
          fi
2872
 
          test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
2873
 
        fi
2874
 
 
2875
 
        shlibpath="$finalize_shlibpath"
2876
 
        test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
2877
 
        if test -n "$shlibpath"; then
2878
 
          eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
2879
 
        fi
2880
 
 
2881
 
        # Get the real and link names of the library.
2882
 
        eval library_names=\"$library_names_spec\"
2883
 
        set dummy $library_names
2884
 
        realname="$2"
2885
 
        shift; shift
2886
 
 
2887
 
        if test -n "$soname_spec"; then
2888
 
          eval soname=\"$soname_spec\"
2889
 
        else
2890
 
          soname="$realname"
2891
 
        fi
2892
 
 
2893
 
        lib="$output_objdir/$realname"
2894
 
        for link
2895
 
        do
2896
 
          linknames="$linknames $link"
2897
 
        done
2898
 
 
2899
 
        # Ensure that we have .o objects for linkers which dislike .lo
2900
 
        # (e.g. aix) in case we are running --disable-static
2901
 
        for obj in $libobjs; do
2902
 
          xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
2903
 
          if test "X$xdir" = "X$obj"; then
2904
 
            xdir="."
2905
 
          else
2906
 
            xdir="$xdir"
2907
 
          fi
2908
 
          baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
2909
 
          oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
2910
 
          if test ! -f $xdir/$oldobj; then
2911
 
            $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
2912
 
            $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
2913
 
          fi
2914
 
        done
2915
 
 
2916
 
        # Use standard objects if they are pic
2917
 
        test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2918
 
 
2919
 
        # Prepare the list of exported symbols
2920
 
        if test -z "$export_symbols"; then
2921
 
          if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2922
 
            $show "generating symbol list for \`$libname.la'"
2923
 
            export_symbols="$output_objdir/$libname.exp"
2924
 
            $run $rm $export_symbols
2925
 
            eval cmds=\"$export_symbols_cmds\"
2926
 
            IFS="${IFS=         }"; save_ifs="$IFS"; IFS='~'
2927
 
            for cmd in $cmds; do
2928
 
              IFS="$save_ifs"
2929
 
              $show "$cmd"
2930
 
              $run eval "$cmd" || exit $?
2931
 
            done
2932
 
            IFS="$save_ifs"
2933
 
            if test -n "$export_symbols_regex"; then
2934
 
              $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2935
 
              $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2936
 
              $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2937
 
              $run eval '$mv "${export_symbols}T" "$export_symbols"'
2938
 
            fi
2939
 
          fi
2940
 
        fi
2941
 
 
2942
 
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
2943
 
          $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2944
 
        fi
2945
 
 
2946
 
        if test -n "$convenience"; then
2947
 
          if test -n "$whole_archive_flag_spec"; then
2948
 
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2949
 
          else
2950
 
            gentop="$output_objdir/${outputname}x"
2951
 
            $show "${rm}r $gentop"
2952
 
            $run ${rm}r "$gentop"
2953
 
            $show "mkdir $gentop"
2954
 
            $run mkdir "$gentop"
2955
 
            status=$?
2956
 
            if test $status -ne 0 && test ! -d "$gentop"; then
2957
 
              exit $status
2958
 
            fi
2959
 
            generated="$generated $gentop"
2960
 
 
2961
 
            for xlib in $convenience; do
2962
 
              # Extract the objects.
2963
 
              case "$xlib" in
2964
 
              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2965
 
              *) xabs=`pwd`"/$xlib" ;;
2966
 
              esac
2967
 
              xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2968
 
              xdir="$gentop/$xlib"
2969
 
 
2970
 
              $show "${rm}r $xdir"
2971
 
              $run ${rm}r "$xdir"
2972
 
              $show "mkdir $xdir"
2973
 
              $run mkdir "$xdir"
2974
 
              status=$?
2975
 
              if test $status -ne 0 && test ! -d "$xdir"; then
2976
 
                exit $status
2977
 
              fi
2978
 
              $show "(cd $xdir && $AR x $xabs)"
2979
 
              $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2980
 
 
2981
 
              libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2982
 
            done
2983
 
          fi
2984
 
        fi
2985
 
 
2986
 
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2987
 
          eval flag=\"$thread_safe_flag_spec\"
2988
 
          linker_flags="$linker_flags $flag"
2989
 
        fi
2990
 
 
2991
 
        # Make a backup of the uninstalled library when relinking
2992
 
        if test "$mode" = relink && test "$hardcode_into_libs" = all; then
2993
 
          $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
2994
 
        fi
2995
 
 
2996
 
        # Do each of the archive commands.
2997
 
        if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2998
 
          eval cmds=\"$archive_expsym_cmds\"
2999
 
        else
3000
 
          eval cmds=\"$archive_cmds\"
3001
 
        fi
3002
 
        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
3003
 
        for cmd in $cmds; do
3004
 
          IFS="$save_ifs"
3005
 
          $show "$cmd"
3006
 
          $run eval "$cmd" || exit $?
3007
 
        done
3008
 
        IFS="$save_ifs"
3009
 
 
3010
 
        # Restore the uninstalled library and exit
3011
 
        if test "$mode" = relink && test "$hardcode_into_libs" = all; then
3012
 
          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
3013
 
          exit 0
3014
 
        fi
3015
 
 
3016
 
        # Create links to the real library.
3017
 
        for linkname in $linknames; do
3018
 
          if test "$realname" != "$linkname"; then
3019
 
            $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
3020
 
            $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
3021
 
          fi
3022
 
        done
3023
 
 
3024
 
        # If -module or -export-dynamic was specified, set the dlname.
3025
 
        if test "$module" = yes || test "$export_dynamic" = yes; then
3026
 
          # On all known operating systems, these are identical.
3027
 
          dlname="$soname"
3028
 
        fi
3029
 
      fi
3030
 
      ;;
3031
 
 
3032
 
    obj)
3033
 
      if test -n "$deplibs"; then
3034
 
        $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3035
 
      fi
3036
 
 
3037
 
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3038
 
        $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3039
 
      fi
3040
 
 
3041
 
      if test -n "$rpath"; then
3042
 
        $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3043
 
      fi
3044
 
 
3045
 
      if test -n "$xrpath"; then
3046
 
        $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3047
 
      fi
3048
 
 
3049
 
      if test -n "$vinfo"; then
3050
 
        $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3051
 
      fi
3052
 
 
3053
 
      if test -n "$release"; then
3054
 
        $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3055
 
      fi
3056
 
 
3057
 
      case "$output" in
3058
 
      *.lo)
3059
 
        if test -n "$objs$old_deplibs"; then
3060
 
          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3061
 
          exit 1
3062
 
        fi
3063
 
        libobj="$output"
3064
 
        obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3065
 
        ;;
3066
 
      *)
3067
 
        libobj=
3068
 
        obj="$output"
3069
 
        ;;
3070
 
      esac
3071
 
 
3072
 
      # Delete the old objects.
3073
 
      $run $rm $obj $libobj
3074
 
 
3075
 
      # Objects from convenience libraries.  This assumes
3076
 
      # single-version convenience libraries.  Whenever we create
3077
 
      # different ones for PIC/non-PIC, this we'll have to duplicate
3078
 
      # the extraction.
3079
 
      reload_conv_objs=
3080
 
      gentop=
3081
 
      # reload_cmds runs $LD directly, so let us get rid of
3082
 
      # -Wl from whole_archive_flag_spec
3083
 
      wl=
3084
 
 
3085
 
      if test -n "$convenience"; then
3086
 
        if test -n "$whole_archive_flag_spec"; then
3087
 
          eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3088
 
        else
3089
 
          gentop="$output_objdir/${obj}x"
3090
 
          $show "${rm}r $gentop"
3091
 
          $run ${rm}r "$gentop"
3092
 
          $show "mkdir $gentop"
3093
 
          $run mkdir "$gentop"
3094
 
          status=$?
3095
 
          if test $status -ne 0 && test ! -d "$gentop"; then
3096
 
            exit $status
3097
 
          fi
3098
 
          generated="$generated $gentop"
3099
 
 
3100
 
          for xlib in $convenience; do
3101
 
            # Extract the objects.
3102
 
            case "$xlib" in
3103
 
            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3104
 
            *) xabs=`pwd`"/$xlib" ;;
3105
 
            esac
3106
 
            xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3107
 
            xdir="$gentop/$xlib"
3108
 
 
3109
 
            $show "${rm}r $xdir"
3110
 
            $run ${rm}r "$xdir"
3111
 
            $show "mkdir $xdir"
3112
 
            $run mkdir "$xdir"
3113
 
            status=$?
3114
 
            if test $status -ne 0 && test ! -d "$xdir"; then
3115
 
              exit $status
3116
 
            fi
3117
 
            $show "(cd $xdir && $AR x $xabs)"
3118
 
            $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3119
 
 
3120
 
            reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
3121
 
          done
3122
 
        fi
3123
 
      fi
3124
 
 
3125
 
      # Create the old-style object.
3126
 
      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
3127
 
 
3128
 
      output="$obj"
3129
 
      eval cmds=\"$reload_cmds\"
3130
 
      IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
3131
 
      for cmd in $cmds; do
3132
 
        IFS="$save_ifs"
3133
 
        $show "$cmd"
3134
 
        $run eval "$cmd" || exit $?
3135
 
      done
3136
 
      IFS="$save_ifs"
3137
 
 
3138
 
      # Exit if we aren't doing a library object file.
3139
 
      if test -z "$libobj"; then
3140
 
        if test -n "$gentop"; then
3141
 
          $show "${rm}r $gentop"
3142
 
          $run ${rm}r $gentop
3143
 
        fi
3144
 
 
3145
 
        exit 0
3146
 
      fi
3147
 
 
3148
 
      if test "$build_libtool_libs" != yes; then
3149
 
        if test -n "$gentop"; then
3150
 
          $show "${rm}r $gentop"
3151
 
          $run ${rm}r $gentop
3152
 
        fi
3153
 
 
3154
 
        # Create an invalid libtool object if no PIC, so that we don't
3155
 
        # accidentally link it into a program.
3156
 
        $show "echo timestamp > $libobj"
3157
 
        $run eval "echo timestamp > $libobj" || exit $?
3158
 
        exit 0
3159
 
      fi
3160
 
 
3161
 
      if test -n "$pic_flag" || test "$pic_mode" != default; then
3162
 
        # Only do commands if we really have different PIC objects.
3163
 
        reload_objs="$libobjs $reload_conv_objs"
3164
 
        output="$libobj"
3165
 
        eval cmds=\"$reload_cmds\"
3166
 
        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
3167
 
        for cmd in $cmds; do
3168
 
          IFS="$save_ifs"
3169
 
          $show "$cmd"
3170
 
          $run eval "$cmd" || exit $?
3171
 
        done
3172
 
        IFS="$save_ifs"
3173
 
      else
3174
 
        # Just create a symlink.
3175
 
        $show $rm $libobj
3176
 
        $run $rm $libobj
3177
 
        xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3178
 
        if test "X$xdir" = "X$libobj"; then
3179
 
          xdir="."
3180
 
        else
3181
 
          xdir="$xdir"
3182
 
        fi
3183
 
        baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
3184
 
        oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
3185
 
        $show "(cd $xdir && $LN_S $oldobj $baseobj)"
3186
 
        $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
3187
 
      fi
3188
 
 
3189
 
      if test -n "$gentop"; then
3190
 
        $show "${rm}r $gentop"
3191
 
        $run ${rm}r $gentop
3192
 
      fi
3193
 
 
3194
 
      exit 0
3195
 
      ;;
3196
 
 
3197
 
    prog)
3198
 
      if test -n "$vinfo"; then
3199
 
        $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3200
 
      fi
3201
 
 
3202
 
      if test -n "$release"; then
3203
 
        $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
3204
 
      fi
3205
 
 
3206
 
      if test "$preload" = yes; then
3207
 
        if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
3208
 
           test "$dlopen_self_static" = unknown; then
3209
 
          $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
3210
 
        fi
3211
 
      fi
3212
 
 
3213
 
      compile_command="$compile_command $compile_deplibs"
3214
 
      finalize_command="$finalize_command $finalize_deplibs"
3215
 
 
3216
 
      if test -n "$rpath$xrpath"; then
3217
 
        # If the user specified any rpath flags, then add them.
3218
 
        for libdir in $rpath $xrpath; do
3219
 
          # This is the magic to use -rpath.
3220
 
          case "$finalize_rpath " in
3221
 
          *" $libdir "*) ;;
3222
 
          *) finalize_rpath="$finalize_rpath $libdir" ;;
3223
 
          esac
3224
 
        done
3225
 
      fi
3226
 
 
3227
 
      # Now hardcode the library paths
3228
 
      rpath=
3229
 
      hardcode_libdirs=
3230
 
      for libdir in $compile_rpath $finalize_rpath; do
3231
 
        if test -n "$hardcode_libdir_flag_spec"; then
3232
 
          if test -n "$hardcode_libdir_separator"; then
3233
 
            if test -z "$hardcode_libdirs"; then
3234
 
              hardcode_libdirs="$libdir"
3235
 
            else
3236
 
              # Just accumulate the unique libdirs.
3237
 
              case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
3238
 
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3239
 
                ;;
3240
 
              *)
3241
 
                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3242
 
                ;;
3243
 
              esac
3244
 
            fi
3245
 
          else
3246
 
            eval flag=\"$hardcode_libdir_flag_spec\"
3247
 
            rpath="$rpath $flag"
3248
 
          fi
3249
 
        elif test -n "$runpath_var"; then
3250
 
          case "$perm_rpath " in
3251
 
          *" $libdir "*) ;;
3252
 
          *) perm_rpath="$perm_rpath $libdir" ;;
3253
 
          esac
3254
 
        fi
3255
 
        case "$host" in
3256
 
        *-*-cygwin* | *-*-mingw* | *-*-os2*)
3257
 
          case ":$dllsearchpath:" in
3258
 
          *":$libdir:"*) ;;
3259
 
          *) dllsearchpath="$dllsearchpath:$libdir";;
3260
 
          esac
3261
 
          ;;
3262
 
        esac
3263
 
      done
3264
 
      # Substitute the hardcoded libdirs into the rpath.
3265
 
      if test -n "$hardcode_libdir_separator" &&
3266
 
         test -n "$hardcode_libdirs"; then
3267
 
        libdir="$hardcode_libdirs"
3268
 
        eval rpath=\" $hardcode_libdir_flag_spec\"
3269
 
      fi
3270
 
      compile_rpath="$rpath"
3271
 
 
3272
 
      rpath=
3273
 
      hardcode_libdirs=
3274
 
      for libdir in $finalize_rpath; do
3275
 
        if test -n "$hardcode_libdir_flag_spec"; then
3276
 
          if test -n "$hardcode_libdir_separator"; then
3277
 
            if test -z "$hardcode_libdirs"; then
3278
 
              hardcode_libdirs="$libdir"
3279
 
            else
3280
 
              # Just accumulate the unique libdirs.
3281
 
              case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
3282
 
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
3283
 
                ;;
3284
 
              *)
3285
 
                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3286
 
                ;;
3287
 
              esac
3288
 
            fi
3289
 
          else
3290
 
            eval flag=\"$hardcode_libdir_flag_spec\"
3291
 
            rpath="$rpath $flag"
3292
 
          fi
3293
 
        elif test -n "$runpath_var"; then
3294
 
          case "$finalize_perm_rpath " in
3295
 
          *" $libdir "*) ;;
3296
 
          *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
3297
 
          esac
3298
 
        fi
3299
 
      done
3300
 
      # Substitute the hardcoded libdirs into the rpath.
3301
 
      if test -n "$hardcode_libdir_separator" &&
3302
 
         test -n "$hardcode_libdirs"; then
3303
 
        libdir="$hardcode_libdirs"
3304
 
        eval rpath=\" $hardcode_libdir_flag_spec\"
3305
 
      fi
3306
 
      finalize_rpath="$rpath"
3307
 
 
3308
 
      if test -n "$libobjs" && test "$build_old_libs" = yes; then
3309
 
        # Transform all the library objects into standard objects.
3310
 
        compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3311
 
        finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3312
 
      fi
3313
 
 
3314
 
      dlsyms=
3315
 
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3316
 
        if test -n "$NM" && test -n "$global_symbol_pipe"; then
3317
 
          dlsyms="${outputname}S.c"
3318
 
        else
3319
 
          $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3320
 
        fi
3321
 
      fi
3322
 
 
3323
 
      if test -n "$dlsyms"; then
3324
 
        case "$dlsyms" in
3325
 
        "") ;;
3326
 
        *.c)
3327
 
          # Discover the nlist of each of the dlfiles.
3328
 
          nlist="$output_objdir/${outputname}.nm"
3329
 
 
3330
 
          $show "$rm $nlist ${nlist}S ${nlist}T"
3331
 
          $run $rm "$nlist" "${nlist}S" "${nlist}T"
3332
 
 
3333
 
          # Parse the name list into a source file.
3334
 
          $show "creating $output_objdir/$dlsyms"
3335
 
 
3336
 
          test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
3337
 
/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
3338
 
/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
3339
 
 
3340
 
#ifdef __cplusplus
3341
 
extern \"C\" {
3342
 
#endif
3343
 
 
3344
 
/* Prevent the only kind of declaration conflicts we can make. */
3345
 
#define lt_preloaded_symbols some_other_symbol
3346
 
 
3347
 
/* External symbol declarations for the compiler. */\
3348
 
"
3349
 
 
3350
 
          if test "$dlself" = yes; then
3351
 
            $show "generating symbol list for \`$output'"
3352
 
 
3353
 
            test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
3354
 
 
3355
 
            # Add our own program objects to the symbol list.
3356
 
            progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
3357
 
            for arg in $progfiles; do
3358
 
              $show "extracting global C symbols from \`$arg'"
3359
 
              $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3360
 
            done
3361
 
 
3362
 
            if test -n "$exclude_expsyms"; then
3363
 
              $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3364
 
              $run eval '$mv "$nlist"T "$nlist"'
3365
 
            fi
3366
 
 
3367
 
            if test -n "$export_symbols_regex"; then
3368
 
              $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3369
 
              $run eval '$mv "$nlist"T "$nlist"'
3370
 
            fi
3371
 
 
3372
 
            # Prepare the list of exported symbols
3373
 
            if test -z "$export_symbols"; then
3374
 
              export_symbols="$output_objdir/$output.exp"
3375
 
              $run $rm $export_symbols
3376
 
              $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3377
 
            else
3378
 
              $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
3379
 
              $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
3380
 
              $run eval 'mv "$nlist"T "$nlist"'
3381
 
            fi
3382
 
          fi
3383
 
 
3384
 
          for arg in $dlprefiles; do
3385
 
            $show "extracting global C symbols from \`$arg'"
3386
 
            name=`echo "$arg" | sed -e 's%^.*/%%'`
3387
 
            $run eval 'echo ": $name " >> "$nlist"'
3388
 
            $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
3389
 
          done
3390
 
 
3391
 
          if test -z "$run"; then
3392
 
            # Make sure we have at least an empty file.
3393
 
            test -f "$nlist" || : > "$nlist"
3394
 
 
3395
 
            if test -n "$exclude_expsyms"; then
3396
 
              egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3397
 
              $mv "$nlist"T "$nlist"
3398
 
            fi
3399
 
 
3400
 
            # Try sorting and uniquifying the output.
3401
 
            if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3402
 
              :
3403
 
            else
3404
 
              grep -v "^: " < "$nlist" > "$nlist"S
3405
 
            fi
3406
 
 
3407
 
            if test -f "$nlist"S; then
3408
 
              eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3409
 
            else
3410
 
              echo '/* NONE */' >> "$output_objdir/$dlsyms"
3411
 
            fi
3412
 
 
3413
 
            $echo >> "$output_objdir/$dlsyms" "\
3414
 
 
3415
 
#undef lt_preloaded_symbols
3416
 
 
3417
 
#if defined (__STDC__) && __STDC__
3418
 
# define lt_ptr_t void *
3419
 
#else
3420
 
# define lt_ptr_t char *
3421
 
# define const
3422
 
#endif
3423
 
 
3424
 
/* The mapping between symbol names and symbols. */
3425
 
extern const struct {
3426
 
  const char *name;
3427
 
  lt_ptr_t address;
3428
 
}
3429
 
lt_preloaded_symbols[] =
3430
 
{\
3431
 
"
3432
 
 
3433
 
            sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \
3434
 
                -e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \
3435
 
                  < "$nlist" >> "$output_objdir/$dlsyms"
3436
 
 
3437
 
            $echo >> "$output_objdir/$dlsyms" "\
3438
 
  {0, (lt_ptr_t) 0}
3439
 
};
3440
 
 
3441
 
/* This works around a problem in FreeBSD linker */
3442
 
#ifdef FREEBSD_WORKAROUND
3443
 
static const void *lt_preloaded_setup() {
3444
 
  return lt_preloaded_symbols;
3445
 
}
3446
 
#endif
3447
 
 
3448
 
#ifdef __cplusplus
3449
 
}
3450
 
#endif\
3451
 
"
3452
 
          fi
3453
 
 
3454
 
          pic_flag_for_symtable=
3455
 
          case "$host" in
3456
 
          # compiling the symbol table file with pic_flag works around
3457
 
          # a FreeBSD bug that causes programs to crash when -lm is
3458
 
          # linked before any other PIC object.  But we must not use
3459
 
          # pic_flag when linking with -static.  The problem exists in
3460
 
          # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3461
 
          *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3462
 
            case "$compile_command " in
3463
 
            *" -static "*) ;;
3464
 
            *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3465
 
            esac;;
3466
 
          *-*-hpux*)
3467
 
            case "$compile_command " in
3468
 
            *" -static "*) ;;
3469
 
            *) pic_flag_for_symtable=" $pic_flag -DPIC";;
3470
 
            esac
3471
 
          esac
3472
 
 
3473
 
          # Now compile the dynamic symbol file.
3474
 
          $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
3475
 
          $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
3476
 
 
3477
 
          # Clean up the generated files.
3478
 
          $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
3479
 
          $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
3480
 
 
3481
 
          # Transform the symbol file into the correct name.
3482
 
          compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3483
 
          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
3484
 
          ;;
3485
 
        *)
3486
 
          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
3487
 
          exit 1
3488
 
          ;;
3489
 
        esac
3490
 
      else
3491
 
        # We keep going just in case the user didn't refer to
3492
 
        # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
3493
 
        # really was required.
3494
 
 
3495
 
        # Nullify the symbol file.
3496
 
        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
3497
 
        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
3498
 
      fi
3499
 
 
3500
 
      if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
3501
 
        # Replace the output file specification.
3502
 
        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3503
 
        link_command="$compile_command$compile_rpath"
3504
 
 
3505
 
        # We have no uninstalled library dependencies, so finalize right now.
3506
 
        $show "$link_command"
3507
 
        $run eval "$link_command"
3508
 
        status=$?
3509
 
 
3510
 
        # Delete the generated files.
3511
 
        if test -n "$dlsyms"; then
3512
 
          $show "$rm $output_objdir/${outputname}S.${objext}"
3513
 
          $run $rm "$output_objdir/${outputname}S.${objext}"
3514
 
        fi
3515
 
 
3516
 
        exit $status
3517
 
      fi
3518
 
 
3519
 
      if test -n "$shlibpath_var"; then
3520
 
        # We should set the shlibpath_var
3521
 
        rpath=
3522
 
        for dir in $temp_rpath; do
3523
 
          case "$dir" in
3524
 
          [\\/]* | [A-Za-z]:[\\/]*)
3525
 
            # Absolute path.
3526
 
            rpath="$rpath$dir:"
3527
 
            ;;
3528
 
          *)
3529
 
            # Relative path: add a thisdir entry.
3530
 
            rpath="$rpath\$thisdir/$dir:"
3531
 
            ;;
3532
 
          esac
3533
 
        done
3534
 
        temp_rpath="$rpath"
3535
 
      fi
3536
 
 
3537
 
      if test -n "$compile_shlibpath$finalize_shlibpath"; then
3538
 
        compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3539
 
      fi
3540
 
      if test -n "$finalize_shlibpath"; then
3541
 
        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3542
 
      fi
3543
 
 
3544
 
      compile_var=
3545
 
      finalize_var=
3546
 
      if test -n "$runpath_var"; then
3547
 
        if test -n "$perm_rpath"; then
3548
 
          # We should set the runpath_var.
3549
 
          rpath=
3550
 
          for dir in $perm_rpath; do
3551
 
            rpath="$rpath$dir:"
3552
 
          done
3553
 
          compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3554
 
        fi
3555
 
        if test -n "$finalize_perm_rpath"; then
3556
 
          # We should set the runpath_var.
3557
 
          rpath=
3558
 
          for dir in $finalize_perm_rpath; do
3559
 
            rpath="$rpath$dir:"
3560
 
          done
3561
 
          finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
3562
 
        fi
3563
 
      fi
3564
 
 
3565
 
      if test "$no_install" = yes; then
3566
 
        # We don't need to create a wrapper script.
3567
 
        link_command="$compile_var$compile_command$compile_rpath"
3568
 
        # Replace the output file specification.
3569
 
        link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
3570
 
        # Delete the old output file.
3571
 
        $run $rm $output
3572
 
        # Link the executable and exit
3573
 
        $show "$link_command"
3574
 
        $run eval "$link_command" || exit $?
3575
 
        exit 0
3576
 
      fi
3577
 
 
3578
 
      if test "$hardcode_action" = relink || test "$hardcode_into_libs" = all; then
3579
 
        # Fast installation is not supported
3580
 
        link_command="$compile_var$compile_command$compile_rpath"
3581
 
        relink_command="$finalize_var$finalize_command$finalize_rpath"
3582
 
 
3583
 
        $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
3584
 
        $echo "$modename: \`$output' will be relinked during installation" 1>&2
3585
 
      else
3586
 
        if test "$fast_install" != no; then
3587
 
          link_command="$finalize_var$compile_command$finalize_rpath"
3588
 
          if test "$fast_install" = yes; then
3589
 
            relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
3590
 
          else
3591
 
            # fast_install is set to needless
3592
 
            relink_command=
3593
 
          fi
3594
 
        else
3595
 
          link_command="$compile_var$compile_command$compile_rpath"
3596
 
          relink_command="$finalize_var$finalize_command$finalize_rpath"
3597
 
        fi
3598
 
      fi
3599
 
 
3600
 
      # Replace the output file specification.
3601
 
      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
3602
 
 
3603
 
      # Delete the old output files.
3604
 
      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
3605
 
 
3606
 
      $show "$link_command"
3607
 
      $run eval "$link_command" || exit $?
3608
 
 
3609
 
      # Now create the wrapper script.
3610
 
      $show "creating $output"
3611
 
 
3612
 
      # Quote the relink command for shipping.
3613
 
      if test -n "$relink_command"; then
3614
 
        relink_command="cd `pwd`; $relink_command"
3615
 
        relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3616
 
      fi
3617
 
 
3618
 
      # Quote $echo for shipping.
3619
 
      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3620
 
        case "$0" in
3621
 
        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3622
 
        *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3623
 
        esac
3624
 
        qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3625
 
      else
3626
 
        qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3627
 
      fi
3628
 
 
3629
 
      # Only actually do things if our run command is non-null.
3630
 
      if test -z "$run"; then
3631
 
        # win32 will think the script is a binary if it has
3632
 
        # a .exe suffix, so we strip it off here.
3633
 
        case $output in
3634
 
          *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3635
 
        esac
3636
 
        $rm $output
3637
 
        trap "$rm $output; exit 1" 1 2 15
3638
 
 
3639
 
        $echo > $output "\
3640
 
#! $SHELL
3641
 
 
3642
 
# $output - temporary wrapper script for $objdir/$outputname
3643
 
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3644
 
#
3645
 
# The $output program cannot be directly executed until all the libtool
3646
 
# libraries that it depends on are installed.
3647
 
#
3648
 
# This wrapper script should never be moved out of the build directory.
3649
 
# If it is, it will not operate correctly.
3650
 
 
3651
 
# Sed substitution that helps us do robust quoting.  It backslashifies
3652
 
# metacharacters that are still active within double-quoted strings.
3653
 
Xsed='sed -e 1s/^X//'
3654
 
sed_quote_subst='$sed_quote_subst'
3655
 
 
3656
 
# The HP-UX ksh and POSIX shell print the target directory to stdout
3657
 
# if CDPATH is set.
3658
 
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
3659
 
 
3660
 
relink_command=\"$relink_command\"
3661
 
 
3662
 
# This environment variable determines our operation mode.
3663
 
if test \"\$libtool_install_magic\" = \"$magic\"; then
3664
 
  # install mode needs the following variable:
3665
 
  link_against_libtool_libs='$link_against_libtool_libs'
3666
 
else
3667
 
  # When we are sourced in execute mode, \$file and \$echo are already set.
3668
 
  if test \"\$libtool_execute_magic\" != \"$magic\"; then
3669
 
    echo=\"$qecho\"
3670
 
    file=\"\$0\"
3671
 
    # Make sure echo works.
3672
 
    if test \"X\$1\" = X--no-reexec; then
3673
 
      # Discard the --no-reexec flag, and continue.
3674
 
      shift
3675
 
    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3676
 
      # Yippee, \$echo works!
3677
 
      :
3678
 
    else
3679
 
      # Restart under the correct shell, and then maybe \$echo will work.
3680
 
      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3681
 
    fi
3682
 
  fi\
3683
 
"
3684
 
        $echo >> $output "\
3685
 
 
3686
 
  # Find the directory that this script lives in.
3687
 
  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3688
 
  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3689
 
 
3690
 
  # Follow symbolic links until we get to the real thisdir.
3691
 
  file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3692
 
  while test -n \"\$file\"; do
3693
 
    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3694
 
 
3695
 
    # If there was a directory component, then change thisdir.
3696
 
    if test \"x\$destdir\" != \"x\$file\"; then
3697
 
      case \"\$destdir\" in
3698
 
      [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
3699
 
      *) thisdir=\"\$thisdir/\$destdir\" ;;
3700
 
      esac
3701
 
    fi
3702
 
 
3703
 
    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3704
 
    file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3705
 
  done
3706
 
 
3707
 
  # Try to get the absolute directory name.
3708
 
  absdir=\`cd \"\$thisdir\" && pwd\`
3709
 
  test -n \"\$absdir\" && thisdir=\"\$absdir\"
3710
 
"
3711
 
 
3712
 
        if test "$fast_install" = yes; then
3713
 
          echo >> $output "\
3714
 
  program=lt-'$outputname'
3715
 
  progdir=\"\$thisdir/$objdir\"
3716
 
 
3717
 
  if test ! -f \"\$progdir/\$program\" || \\
3718
 
     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3719
 
       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3720
 
 
3721
 
    file=\"\$\$-\$program\"
3722
 
 
3723
 
    if test ! -d \"\$progdir\"; then
3724
 
      $mkdir \"\$progdir\"
3725
 
    else
3726
 
      $rm \"\$progdir/\$file\"
3727
 
    fi"
3728
 
 
3729
 
          echo >> $output "\
3730
 
 
3731
 
    # relink executable if necessary
3732
 
    if test -n \"\$relink_command\"; then
3733
 
      if (eval \$relink_command); then :
3734
 
      else
3735
 
        $rm \"\$progdir/\$file\"
3736
 
        exit 1
3737
 
      fi
3738
 
    fi
3739
 
 
3740
 
    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3741
 
    { $rm \"\$progdir/\$program\";
3742
 
      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3743
 
    $rm \"\$progdir/\$file\"
3744
 
  fi"
3745
 
        else
3746
 
          echo >> $output "\
3747
 
  program='$outputname'
3748
 
  progdir=\"\$thisdir/$objdir\"
3749
 
"
3750
 
        fi
3751
 
 
3752
 
        echo >> $output "\
3753
 
 
3754
 
  if test -f \"\$progdir/\$program\"; then"
3755
 
 
3756
 
        # Export our shlibpath_var if we have one.
3757
 
        if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3758
 
          $echo >> $output "\
3759
 
    # Add our own library path to $shlibpath_var
3760
 
    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3761
 
 
3762
 
    # Some systems cannot cope with colon-terminated $shlibpath_var
3763
 
    # The second colon is a workaround for a bug in BeOS R4 sed
3764
 
    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3765
 
 
3766
 
    export $shlibpath_var
3767
 
"
3768
 
        fi
3769
 
 
3770
 
        # fixup the dll searchpath if we need to.
3771
 
        if test -n "$dllsearchpath"; then
3772
 
          $echo >> $output "\
3773
 
    # Add the dll search path components to the executable PATH
3774
 
    PATH=$dllsearchpath:\$PATH
3775
 
"
3776
 
        fi
3777
 
 
3778
 
        $echo >> $output "\
3779
 
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
3780
 
      # Run the actual program with our arguments.
3781
 
"
3782
 
        case $host in
3783
 
        *-*-cygwin* | *-*-mingw | *-*-os2*)
3784
 
          # win32 systems need to use the prog path for dll
3785
 
          # lookup to work
3786
 
          $echo >> $output "\
3787
 
      exec \$progdir\\\\\$program \${1+\"\$@\"}
3788
 
"
3789
 
          ;;
3790
 
        *)
3791
 
          $echo >> $output "\
3792
 
      # Export the path to the program.
3793
 
      PATH=\"\$progdir:\$PATH\"
3794
 
      export PATH
3795
 
 
3796
 
      exec \$program \${1+\"\$@\"}
3797
 
"
3798
 
          ;;
3799
 
        esac
3800
 
        $echo >> $output "\
3801
 
      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3802
 
      exit 1
3803
 
    fi
3804
 
  else
3805
 
    # The program doesn't exist.
3806
 
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3807
 
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
3808
 
    echo \"See the $PACKAGE documentation for more information.\" 1>&2
3809
 
    exit 1
3810
 
  fi
3811
 
fi\
3812
 
"
3813
 
        chmod +x $output
3814
 
      fi
3815
 
      exit 0
3816
 
      ;;
3817
 
    esac
3818
 
 
3819
 
    # See if we need to build an old-fashioned archive.
3820
 
    for oldlib in $oldlibs; do
3821
 
 
3822
 
      if test "$build_libtool_libs" = convenience; then
3823
 
        oldobjs="$libobjs_save"
3824
 
        addlibs="$convenience"
3825
 
        build_libtool_libs=no
3826
 
      else
3827
 
        if test "$build_libtool_libs" = module; then
3828
 
          oldobjs="$libobjs_save"
3829
 
          build_libtool_libs=no
3830
 
        else
3831
 
          oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3832
 
        fi
3833
 
        addlibs="$old_convenience"
3834
 
      fi
3835
 
 
3836
 
      if test -n "$addlibs"; then
3837
 
        gentop="$output_objdir/${outputname}x"
3838
 
        $show "${rm}r $gentop"
3839
 
        $run ${rm}r "$gentop"
3840
 
        $show "mkdir $gentop"
3841
 
        $run mkdir "$gentop"
3842
 
        status=$?
3843
 
        if test $status -ne 0 && test ! -d "$gentop"; then
3844
 
          exit $status
3845
 
        fi
3846
 
        generated="$generated $gentop"
3847
 
 
3848
 
        # Add in members from convenience archives.
3849
 
        for xlib in $addlibs; do
3850
 
          # Extract the objects.
3851
 
          case "$xlib" in
3852
 
          [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3853
 
          *) xabs=`pwd`"/$xlib" ;;
3854
 
          esac
3855
 
          xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3856
 
          xdir="$gentop/$xlib"
3857
 
 
3858
 
          $show "${rm}r $xdir"
3859
 
          $run ${rm}r "$xdir"
3860
 
          $show "mkdir $xdir"
3861
 
          $run mkdir "$xdir"
3862
 
          status=$?
3863
 
          if test $status -ne 0 && test ! -d "$xdir"; then
3864
 
            exit $status
3865
 
          fi
3866
 
          $show "(cd $xdir && $AR x $xabs)"
3867
 
          $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3868
 
 
3869
 
          oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3870
 
        done
3871
 
      fi
3872
 
 
3873
 
      # Do each command in the archive commands.
3874
 
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3875
 
        eval cmds=\"$old_archive_from_new_cmds\"
3876
 
      else
3877
 
        # Ensure that we have .o objects in place in case we decided
3878
 
        # not to build a shared library, and have fallen back to building
3879
 
        # static libs even though --disable-static was passed!
3880
 
        for oldobj in $oldobjs; do
3881
 
          if test ! -f $oldobj; then
3882
 
            xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
3883
 
            if test "X$xdir" = "X$oldobj"; then
3884
 
              xdir="."
3885
 
            else
3886
 
              xdir="$xdir"
3887
 
            fi
3888
 
            baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
3889
 
            obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
3890
 
            $show "(cd $xdir && ${LN_S} $obj $baseobj)"
3891
 
            $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
3892
 
          fi
3893
 
        done
3894
 
 
3895
 
        eval cmds=\"$old_archive_cmds\"
3896
 
      fi
3897
 
      IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
3898
 
      for cmd in $cmds; do
3899
 
        IFS="$save_ifs"
3900
 
        $show "$cmd"
3901
 
        $run eval "$cmd" || exit $?
3902
 
      done
3903
 
      IFS="$save_ifs"
3904
 
    done
3905
 
 
3906
 
    if test -n "$generated"; then
3907
 
      $show "${rm}r$generated"
3908
 
      $run ${rm}r$generated
3909
 
    fi
3910
 
 
3911
 
    # Now create the libtool archive.
3912
 
    case "$output" in
3913
 
    *.la)
3914
 
      old_library=
3915
 
      test "$build_old_libs" = yes && old_library="$libname.$libext"
3916
 
      $show "creating $output"
3917
 
 
3918
 
      # Quote the link command for shipping.
3919
 
      relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
3920
 
      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3921
 
 
3922
 
      # Only create the output if not a dry run.
3923
 
      if test -z "$run"; then
3924
 
        for installed in no yes; do
3925
 
          if test "$installed" = yes; then
3926
 
            if test -z "$install_libdir"; then
3927
 
              break
3928
 
            fi
3929
 
            output="$output_objdir/$outputname"i
3930
 
            # Replace all uninstalled libtool libraries with the installed ones
3931
 
            newdependency_libs=
3932
 
            for deplib in $dependency_libs; do
3933
 
              case "$deplib" in
3934
 
              *.la)
3935
 
                name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
3936
 
                eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
3937
 
                if test -z "$libdir"; then
3938
 
                  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
3939
 
                  exit 1
3940
 
                fi
3941
 
                newdependency_libs="$newdependency_libs $libdir/$name"
3942
 
                ;;
3943
 
              *) newdependency_libs="$newdependency_libs $deplib" ;;
3944
 
              esac
3945
 
            done
3946
 
            dependency_libs="$newdependency_libs"
3947
 
            newdlfiles=
3948
 
            for lib in $dlfiles; do
3949
 
              name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3950
 
              eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3951
 
              if test -z "$libdir"; then
3952
 
                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3953
 
                exit 1
3954
 
              fi
3955
 
              newdlfiles="$newdlfiles $libdir/$name"
3956
 
            done
3957
 
            dlfiles="$newdlfiles"
3958
 
            newdlprefiles=
3959
 
            for lib in $dlprefiles; do
3960
 
              name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
3961
 
              eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
3962
 
              if test -z "$libdir"; then
3963
 
                $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3964
 
                exit 1
3965
 
              fi
3966
 
              newdlprefiles="$newdlprefiles $libdir/$name"
3967
 
            done
3968
 
            dlprefiles="$newdlprefiles"
3969
 
          fi
3970
 
          $rm $output
3971
 
          $echo > $output "\
3972
 
# $outputname - a libtool library file
3973
 
# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3974
 
#
3975
 
# Please DO NOT delete this file!
3976
 
# It is necessary for linking the library.
3977
 
 
3978
 
# The name that we can dlopen(3).
3979
 
dlname='$dlname'
3980
 
 
3981
 
# Names of this library.
3982
 
library_names='$library_names'
3983
 
 
3984
 
# The name of the static archive.
3985
 
old_library='$old_library'
3986
 
 
3987
 
# Libraries that this one depends upon.
3988
 
dependency_libs='$dependency_libs'
3989
 
 
3990
 
# Version information for $libname.
3991
 
current=$current
3992
 
age=$age
3993
 
revision=$revision
3994
 
 
3995
 
# Is this an already installed library?
3996
 
installed=$installed
3997
 
 
3998
 
# Files to dlopen/dlpreopen
3999
 
dlopen='$dlfiles'
4000
 
dlpreopen='$dlprefiles'
4001
 
 
4002
 
# Directory that this library needs to be installed in:
4003
 
libdir='$install_libdir'"
4004
 
          if test "$installed" = no; then
4005
 
            $echo >> $output "\
4006
 
relink_command=\"$relink_command\""
4007
 
          fi
4008
 
        done
4009
 
      fi
4010
 
 
4011
 
      # Do a symbolic link so that the libtool archive can be found in
4012
 
      # LD_LIBRARY_PATH before the program is installed.
4013
 
      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
4014
 
      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
4015
 
      ;;
4016
 
    esac
4017
 
    exit 0
4018
 
    ;;
4019
 
 
4020
 
  # libtool install mode
4021
 
  install)
4022
 
    modename="$modename: install"
4023
 
 
4024
 
    # There may be an optional sh(1) argument at the beginning of
4025
 
    # install_prog (especially on Windows NT).
4026
 
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
4027
 
      # Aesthetically quote it.
4028
 
      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
4029
 
      case "$arg" in
4030
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
4031
 
        arg="\"$arg\""
4032
 
        ;;
4033
 
      esac
4034
 
      install_prog="$arg "
4035
 
      arg="$1"
4036
 
      shift
4037
 
    else
4038
 
      install_prog=
4039
 
      arg="$nonopt"
4040
 
    fi
4041
 
 
4042
 
    # The real first argument should be the name of the installation program.
4043
 
    # Aesthetically quote it.
4044
 
    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4045
 
    case "$arg" in
4046
 
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
4047
 
      arg="\"$arg\""
4048
 
      ;;
4049
 
    esac
4050
 
    install_prog="$install_prog$arg"
4051
 
 
4052
 
    # We need to accept at least all the BSD install flags.
4053
 
    dest=
4054
 
    files=
4055
 
    opts=
4056
 
    prev=
4057
 
    install_type=
4058
 
    isdir=no
4059
 
    stripme=
4060
 
    for arg
4061
 
    do
4062
 
      if test -n "$dest"; then
4063
 
        files="$files $dest"
4064
 
        dest="$arg"
4065
 
        continue
4066
 
      fi
4067
 
 
4068
 
      case "$arg" in
4069
 
      -d) isdir=yes ;;
4070
 
      -f) prev="-f" ;;
4071
 
      -g) prev="-g" ;;
4072
 
      -m) prev="-m" ;;
4073
 
      -o) prev="-o" ;;
4074
 
      -s)
4075
 
        stripme=" -s"
4076
 
        continue
4077
 
        ;;
4078
 
      -*) ;;
4079
 
 
4080
 
      *)
4081
 
        # If the previous option needed an argument, then skip it.
4082
 
        if test -n "$prev"; then
4083
 
          prev=
4084
 
        else
4085
 
          dest="$arg"
4086
 
          continue
4087
 
        fi
4088
 
        ;;
4089
 
      esac
4090
 
 
4091
 
      # Aesthetically quote the argument.
4092
 
      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4093
 
      case "$arg" in
4094
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
4095
 
        arg="\"$arg\""
4096
 
        ;;
4097
 
      esac
4098
 
      install_prog="$install_prog $arg"
4099
 
    done
4100
 
 
4101
 
    if test -z "$install_prog"; then
4102
 
      $echo "$modename: you must specify an install program" 1>&2
4103
 
      $echo "$help" 1>&2
4104
 
      exit 1
4105
 
    fi
4106
 
 
4107
 
    if test -n "$prev"; then
4108
 
      $echo "$modename: the \`$prev' option requires an argument" 1>&2
4109
 
      $echo "$help" 1>&2
4110
 
      exit 1
4111
 
    fi
4112
 
 
4113
 
    if test -z "$files"; then
4114
 
      if test -z "$dest"; then
4115
 
        $echo "$modename: no file or destination specified" 1>&2
4116
 
      else
4117
 
        $echo "$modename: you must specify a destination" 1>&2
4118
 
      fi
4119
 
      $echo "$help" 1>&2
4120
 
      exit 1
4121
 
    fi
4122
 
 
4123
 
    # Strip any trailing slash from the destination.
4124
 
    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4125
 
 
4126
 
    # Check to see that the destination is a directory.
4127
 
    test -d "$dest" && isdir=yes
4128
 
    if test "$isdir" = yes; then
4129
 
      destdir="$dest"
4130
 
      destname=
4131
 
    else
4132
 
      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4133
 
      test "X$destdir" = "X$dest" && destdir=.
4134
 
      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4135
 
 
4136
 
      # Not a directory, so check to see that there is only one file specified.
4137
 
      set dummy $files
4138
 
      if test $# -gt 2; then
4139
 
        $echo "$modename: \`$dest' is not a directory" 1>&2
4140
 
        $echo "$help" 1>&2
4141
 
        exit 1
4142
 
      fi
4143
 
    fi
4144
 
    case "$destdir" in
4145
 
    [\\/]* | [A-Za-z]:[\\/]*) ;;
4146
 
    *)
4147
 
      for file in $files; do
4148
 
        case "$file" in
4149
 
        *.lo) ;;
4150
 
        *)
4151
 
          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4152
 
          $echo "$help" 1>&2
4153
 
          exit 1
4154
 
          ;;
4155
 
        esac
4156
 
      done
4157
 
      ;;
4158
 
    esac
4159
 
 
4160
 
    # This variable tells wrapper scripts just to set variables rather
4161
 
    # than running their programs.
4162
 
    libtool_install_magic="$magic"
4163
 
 
4164
 
    staticlibs=
4165
 
    future_libdirs=
4166
 
    current_libdirs=
4167
 
    for file in $files; do
4168
 
 
4169
 
      # Do each installation.
4170
 
      case "$file" in
4171
 
      *.$libext)
4172
 
        # Do the static libraries later.
4173
 
        staticlibs="$staticlibs $file"
4174
 
        ;;
4175
 
 
4176
 
      *.la)
4177
 
        # Check to see that this really is a libtool archive.
4178
 
        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4179
 
        else
4180
 
          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4181
 
          $echo "$help" 1>&2
4182
 
          exit 1
4183
 
        fi
4184
 
 
4185
 
        library_names=
4186
 
        old_library=
4187
 
        relink_command=
4188
 
        # If there is no directory component, then add one.
4189
 
        case "$file" in
4190
 
        */* | *\\*) . $file ;;
4191
 
        *) . ./$file ;;
4192
 
        esac
4193
 
 
4194
 
        # Add the libdir to current_libdirs if it is the destination.
4195
 
        if test "X$destdir" = "X$libdir"; then
4196
 
          case "$current_libdirs " in
4197
 
          *" $libdir "*) ;;
4198
 
          *) current_libdirs="$current_libdirs $libdir" ;;
4199
 
          esac
4200
 
        else
4201
 
          # Note the libdir as a future libdir.
4202
 
          case "$future_libdirs " in
4203
 
          *" $libdir "*) ;;
4204
 
          *) future_libdirs="$future_libdirs $libdir" ;;
4205
 
          esac
4206
 
        fi
4207
 
 
4208
 
        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4209
 
        test "X$dir" = "X$file/" && dir=
4210
 
        dir="$dir$objdir"
4211
 
 
4212
 
        if test "$hardcode_into_libs" = all; then
4213
 
          if test -z "$relink_command"; then
4214
 
            $echo "$modename: invalid libtool pseudo library \`$file'" 1>&2
4215
 
            exit 1
4216
 
          fi
4217
 
          $echo "$modename: warning: relinking \`$file'" 1>&2
4218
 
          $show "$relink_command"
4219
 
          if $run eval "$relink_command"; then :
4220
 
          else
4221
 
            $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4222
 
            continue
4223
 
          fi
4224
 
        fi
4225
 
 
4226
 
        # See the names of the shared library.
4227
 
        set dummy $library_names
4228
 
        if test -n "$2"; then
4229
 
          realname="$2"
4230
 
          shift
4231
 
          shift
4232
 
 
4233
 
          srcname="$realname"
4234
 
          test "$hardcode_into_libs" = all && srcname="$realname"T
4235
 
 
4236
 
          # Install the shared library and build the symlinks.
4237
 
          $show "$install_prog $dir/$srcname $destdir/$realname"
4238
 
          $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
4239
 
          if test -n "$stripme" && test -n "$striplib"; then
4240
 
            $show "$striplib $destdir/$realname"
4241
 
            $run eval "$striplib $destdir/$realname" || exit $?
4242
 
          fi
4243
 
 
4244
 
          if test $# -gt 0; then
4245
 
            # Delete the old symlinks, and create new ones.
4246
 
            for linkname
4247
 
            do
4248
 
              if test "$linkname" != "$realname"; then
4249
 
                $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4250
 
                $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
4251
 
              fi
4252
 
            done
4253
 
          fi
4254
 
 
4255
 
          # Do each command in the postinstall commands.
4256
 
          lib="$destdir/$realname"
4257
 
          eval cmds=\"$postinstall_cmds\"
4258
 
          IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
4259
 
          for cmd in $cmds; do
4260
 
            IFS="$save_ifs"
4261
 
            $show "$cmd"
4262
 
            $run eval "$cmd" || exit $?
4263
 
          done
4264
 
          IFS="$save_ifs"
4265
 
        fi
4266
 
 
4267
 
        # Install the pseudo-library for information purposes.
4268
 
        name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4269
 
        instname="$dir/$name"i
4270
 
        $show "$install_prog $instname $destdir/$name"
4271
 
        $run eval "$install_prog $instname $destdir/$name" || exit $?
4272
 
 
4273
 
        # Maybe install the static library, too.
4274
 
        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4275
 
        ;;
4276
 
 
4277
 
      *.lo)
4278
 
        # Install (i.e. copy) a libtool object.
4279
 
 
4280
 
        # Figure out destination file name, if it wasn't already specified.
4281
 
        if test -n "$destname"; then
4282
 
          destfile="$destdir/$destname"
4283
 
        else
4284
 
          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4285
 
          destfile="$destdir/$destfile"
4286
 
        fi
4287
 
 
4288
 
        # Deduce the name of the destination old-style object file.
4289
 
        case "$destfile" in
4290
 
        *.lo)
4291
 
          staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4292
 
          ;;
4293
 
        *.$objext)
4294
 
          staticdest="$destfile"
4295
 
          destfile=
4296
 
          ;;
4297
 
        *)
4298
 
          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
4299
 
          $echo "$help" 1>&2
4300
 
          exit 1
4301
 
          ;;
4302
 
        esac
4303
 
 
4304
 
        # Install the libtool object if requested.
4305
 
        if test -n "$destfile"; then
4306
 
          $show "$install_prog $file $destfile"
4307
 
          $run eval "$install_prog $file $destfile" || exit $?
4308
 
        fi
4309
 
 
4310
 
        # Install the old object if enabled.
4311
 
        if test "$build_old_libs" = yes; then
4312
 
          # Deduce the name of the old-style object file.
4313
 
          staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
4314
 
 
4315
 
          $show "$install_prog $staticobj $staticdest"
4316
 
          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4317
 
        fi
4318
 
        exit 0
4319
 
        ;;
4320
 
 
4321
 
      *)
4322
 
        # Figure out destination file name, if it wasn't already specified.
4323
 
        if test -n "$destname"; then
4324
 
          destfile="$destdir/$destname"
4325
 
        else
4326
 
          destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4327
 
          destfile="$destdir/$destfile"
4328
 
        fi
4329
 
 
4330
 
        # Do a test to see if this is really a libtool program.
4331
 
        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4332
 
          link_against_libtool_libs=
4333
 
          relink_command=
4334
 
 
4335
 
          # If there is no directory component, then add one.
4336
 
          case "$file" in
4337
 
          */* | *\\*) . $file ;;
4338
 
          *) . ./$file ;;
4339
 
          esac
4340
 
 
4341
 
          # Check the variables that should have been set.
4342
 
          if test -z "$link_against_libtool_libs"; then
4343
 
            $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
4344
 
            exit 1
4345
 
          fi
4346
 
 
4347
 
          finalize=yes
4348
 
          for lib in $link_against_libtool_libs; do
4349
 
            # Check to see that each library is installed.
4350
 
            libdir=
4351
 
            if test -f "$lib"; then
4352
 
              # If there is no directory component, then add one.
4353
 
              case "$lib" in
4354
 
              */* | *\\*) . $lib ;;
4355
 
              *) . ./$lib ;;
4356
 
              esac
4357
 
            fi
4358
 
            libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
4359
 
            if test -n "$libdir" && test ! -f "$libfile"; then
4360
 
              $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
4361
 
              finalize=no
4362
 
            fi
4363
 
          done
4364
 
 
4365
 
          relink_command=
4366
 
          # If there is no directory component, then add one.
4367
 
          case "$file" in
4368
 
          */* | *\\*) . $file ;;
4369
 
          *) . ./$file ;;
4370
 
          esac
4371
 
 
4372
 
          outputname=
4373
 
          if test "$fast_install" = no && test -n "$relink_command"; then
4374
 
            if test "$finalize" = yes && test -z "$run"; then
4375
 
              tmpdir="/tmp"
4376
 
              test -n "$TMPDIR" && tmpdir="$TMPDIR"
4377
 
              tmpdir="$tmpdir/libtool-$$"
4378
 
              if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4379
 
              else
4380
 
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
4381
 
                continue
4382
 
              fi
4383
 
              outputname="$tmpdir/$file"
4384
 
              # Replace the output file specification.
4385
 
              relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
4386
 
 
4387
 
              $show "$relink_command"
4388
 
              if $run eval "$relink_command"; then :
4389
 
              else
4390
 
                $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4391
 
                ${rm}r "$tmpdir"
4392
 
                continue
4393
 
              fi
4394
 
              file="$outputname"
4395
 
            else
4396
 
              $echo "$modename: warning: cannot relink \`$file'" 1>&2
4397
 
            fi
4398
 
          else
4399
 
            # Install the binary that we compiled earlier.
4400
 
            file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4401
 
          fi
4402
 
        fi
4403
 
 
4404
 
        $show "$install_prog$stripme $file $destfile"
4405
 
        $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4406
 
        test -n "$outputname" && ${rm}r "$tmpdir"
4407
 
        ;;
4408
 
      esac
4409
 
    done
4410
 
 
4411
 
    for file in $staticlibs; do
4412
 
      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4413
 
 
4414
 
      # Set up the ranlib parameters.
4415
 
      oldlib="$destdir/$name"
4416
 
 
4417
 
      $show "$install_prog $file $oldlib"
4418
 
      $run eval "$install_prog \$file \$oldlib" || exit $?
4419
 
 
4420
 
      if test -n "$stripme" && test -n "$striplib"; then
4421
 
        $show "$old_striplib $oldlib"
4422
 
        $run eval "$old_striplib $oldlib" || exit $?
4423
 
      fi
4424
 
 
4425
 
      # Do each command in the postinstall commands.
4426
 
      eval cmds=\"$old_postinstall_cmds\"
4427
 
      IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
4428
 
      for cmd in $cmds; do
4429
 
        IFS="$save_ifs"
4430
 
        $show "$cmd"
4431
 
        $run eval "$cmd" || exit $?
4432
 
      done
4433
 
      IFS="$save_ifs"
4434
 
    done
4435
 
 
4436
 
    if test -n "$future_libdirs"; then
4437
 
      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
4438
 
    fi
4439
 
 
4440
 
    if test -n "$current_libdirs"; then
4441
 
      # Maybe just do a dry run.
4442
 
      test -n "$run" && current_libdirs=" -n$current_libdirs"
4443
 
      exec $SHELL $0 --finish$current_libdirs
4444
 
      exit 1
4445
 
    fi
4446
 
 
4447
 
    exit 0
4448
 
    ;;
4449
 
 
4450
 
  # libtool finish mode
4451
 
  finish)
4452
 
    modename="$modename: finish"
4453
 
    libdirs="$nonopt"
4454
 
    admincmds=
4455
 
 
4456
 
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4457
 
      for dir
4458
 
      do
4459
 
        libdirs="$libdirs $dir"
4460
 
      done
4461
 
 
4462
 
      for libdir in $libdirs; do
4463
 
        if test -n "$finish_cmds"; then
4464
 
          # Do each command in the finish commands.
4465
 
          eval cmds=\"$finish_cmds\"
4466
 
          IFS="${IFS=   }"; save_ifs="$IFS"; IFS='~'
4467
 
          for cmd in $cmds; do
4468
 
            IFS="$save_ifs"
4469
 
            $show "$cmd"
4470
 
            $run eval "$cmd" || admincmds="$admincmds
4471
 
       $cmd"
4472
 
          done
4473
 
          IFS="$save_ifs"
4474
 
        fi
4475
 
        if test -n "$finish_eval"; then
4476
 
          # Do the single finish_eval.
4477
 
          eval cmds=\"$finish_eval\"
4478
 
          $run eval "$cmds" || admincmds="$admincmds
4479
 
       $cmds"
4480
 
        fi
4481
 
      done
4482
 
    fi
4483
 
 
4484
 
    # Exit here if they wanted silent mode.
4485
 
    test "$show" = : && exit 0
4486
 
 
4487
 
    echo "----------------------------------------------------------------------"
4488
 
    echo "Libraries have been installed in:"
4489
 
    for libdir in $libdirs; do
4490
 
      echo "   $libdir"
4491
 
    done
4492
 
    echo
4493
 
    echo "If you ever happen to want to link against installed libraries"
4494
 
    echo "in a given directory, LIBDIR, you must either use libtool, and"
4495
 
    echo "specify the full pathname of the library, or use \`-LLIBDIR'"
4496
 
    echo "flag during linking and do at least one of the following:"
4497
 
    if test -n "$shlibpath_var"; then
4498
 
      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
4499
 
      echo "     during execution"
4500
 
    fi
4501
 
    if test -n "$runpath_var"; then
4502
 
      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
4503
 
      echo "     during linking"
4504
 
    fi
4505
 
    if test -n "$hardcode_libdir_flag_spec"; then
4506
 
      libdir=LIBDIR
4507
 
      eval flag=\"$hardcode_libdir_flag_spec\"
4508
 
 
4509
 
      echo "   - use the \`$flag' linker flag"
4510
 
    fi
4511
 
    if test -n "$admincmds"; then
4512
 
      echo "   - have your system administrator run these commands:$admincmds"
4513
 
    fi
4514
 
    if test -f /etc/ld.so.conf; then
4515
 
      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
4516
 
    fi
4517
 
    echo
4518
 
    echo "See any operating system documentation about shared libraries for"
4519
 
    echo "more information, such as the ld(1) and ld.so(8) manual pages."
4520
 
    echo "----------------------------------------------------------------------"
4521
 
    exit 0
4522
 
    ;;
4523
 
 
4524
 
  # libtool execute mode
4525
 
  execute)
4526
 
    modename="$modename: execute"
4527
 
 
4528
 
    # The first argument is the command name.
4529
 
    cmd="$nonopt"
4530
 
    if test -z "$cmd"; then
4531
 
      $echo "$modename: you must specify a COMMAND" 1>&2
4532
 
      $echo "$help"
4533
 
      exit 1
4534
 
    fi
4535
 
 
4536
 
    # Handle -dlopen flags immediately.
4537
 
    for file in $execute_dlfiles; do
4538
 
      if test ! -f "$file"; then
4539
 
        $echo "$modename: \`$file' is not a file" 1>&2
4540
 
        $echo "$help" 1>&2
4541
 
        exit 1
4542
 
      fi
4543
 
 
4544
 
      dir=
4545
 
      case "$file" in
4546
 
      *.la)
4547
 
        # Check to see that this really is a libtool archive.
4548
 
        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
4549
 
        else
4550
 
          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
4551
 
          $echo "$help" 1>&2
4552
 
          exit 1
4553
 
        fi
4554
 
 
4555
 
        # Read the libtool library.
4556
 
        dlname=
4557
 
        library_names=
4558
 
 
4559
 
        # If there is no directory component, then add one.
4560
 
        case "$file" in
4561
 
        */* | *\\*) . $file ;;
4562
 
        *) . ./$file ;;
4563
 
        esac
4564
 
 
4565
 
        # Skip this library if it cannot be dlopened.
4566
 
        if test -z "$dlname"; then
4567
 
          # Warn if it was a shared library.
4568
 
          test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
4569
 
          continue
4570
 
        fi
4571
 
 
4572
 
        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4573
 
        test "X$dir" = "X$file" && dir=.
4574
 
 
4575
 
        if test -f "$dir/$objdir/$dlname"; then
4576
 
          dir="$dir/$objdir"
4577
 
        else
4578
 
          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
4579
 
          exit 1
4580
 
        fi
4581
 
        ;;
4582
 
 
4583
 
      *.lo)
4584
 
        # Just add the directory containing the .lo file.
4585
 
        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4586
 
        test "X$dir" = "X$file" && dir=.
4587
 
        ;;
4588
 
 
4589
 
      *)
4590
 
        $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
4591
 
        continue
4592
 
        ;;
4593
 
      esac
4594
 
 
4595
 
      # Get the absolute pathname.
4596
 
      absdir=`cd "$dir" && pwd`
4597
 
      test -n "$absdir" && dir="$absdir"
4598
 
 
4599
 
      # Now add the directory to shlibpath_var.
4600
 
      if eval "test -z \"\$$shlibpath_var\""; then
4601
 
        eval "$shlibpath_var=\"\$dir\""
4602
 
      else
4603
 
        eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
4604
 
      fi
4605
 
    done
4606
 
 
4607
 
    # This variable tells wrapper scripts just to set shlibpath_var
4608
 
    # rather than running their programs.
4609
 
    libtool_execute_magic="$magic"
4610
 
 
4611
 
    # Check if any of the arguments is a wrapper script.
4612
 
    args=
4613
 
    for file
4614
 
    do
4615
 
      case "$file" in
4616
 
      -*) ;;
4617
 
      *)
4618
 
        # Do a test to see if this is really a libtool program.
4619
 
        if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4620
 
          # If there is no directory component, then add one.
4621
 
          case "$file" in
4622
 
          */* | *\\*) . $file ;;
4623
 
          *) . ./$file ;;
4624
 
          esac
4625
 
 
4626
 
          # Transform arg to wrapped name.
4627
 
          file="$progdir/$program"
4628
 
        fi
4629
 
        ;;
4630
 
      esac
4631
 
      # Quote arguments (to preserve shell metacharacters).
4632
 
      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
4633
 
      args="$args \"$file\""
4634
 
    done
4635
 
 
4636
 
    if test -z "$run"; then
4637
 
      if test -n "$shlibpath_var"; then
4638
 
        # Export the shlibpath_var.
4639
 
        eval "export $shlibpath_var"
4640
 
      fi
4641
 
 
4642
 
      # Restore saved enviroment variables
4643
 
      if test "${save_LC_ALL+set}" = set; then
4644
 
        LC_ALL="$save_LC_ALL"; export LC_ALL
4645
 
      fi
4646
 
      if test "${save_LANG+set}" = set; then
4647
 
        LANG="$save_LANG"; export LANG
4648
 
      fi
4649
 
 
4650
 
      # Now actually exec the command.
4651
 
      eval "exec \$cmd$args"
4652
 
 
4653
 
      $echo "$modename: cannot exec \$cmd$args"
4654
 
      exit 1
4655
 
    else
4656
 
      # Display what would be done.
4657
 
      if test -n "$shlibpath_var"; then
4658
 
        eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
4659
 
        $echo "export $shlibpath_var"
4660
 
      fi
4661
 
      $echo "$cmd$args"
4662
 
      exit 0
4663
 
    fi
4664
 
    ;;
4665
 
 
4666
 
  # libtool clean and uninstall mode
4667
 
  clean | uninstall)
4668
 
    modename="$modename: $mode"
4669
 
    rm="$nonopt"
4670
 
    files=
4671
 
 
4672
 
    # This variable tells wrapper scripts just to set variables rather
4673
 
    # than running their programs.
4674
 
    libtool_install_magic="$magic"
4675
 
 
4676
 
    for arg
4677
 
    do
4678
 
      case "$arg" in
4679
 
      -*) rm="$rm $arg" ;;
4680
 
      *) files="$files $arg" ;;
4681
 
      esac
4682
 
    done
4683
 
 
4684
 
    if test -z "$rm"; then
4685
 
      $echo "$modename: you must specify an RM program" 1>&2
4686
 
      $echo "$help" 1>&2
4687
 
      exit 1
4688
 
    fi
4689
 
 
4690
 
    for file in $files; do
4691
 
      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
4692
 
      if test "X$dir" = "X$file"; then
4693
 
        dir=.
4694
 
        objdir="$objdir"
4695
 
      else
4696
 
        objdir="$dir/$objdir"
4697
 
      fi
4698
 
      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4699
 
      test $mode = uninstall && objdir="$dir"
4700
 
 
4701
 
      rmfiles="$file"
4702
 
 
4703
 
      case "$name" in
4704
 
      *.la)
4705
 
        # Possibly a libtool archive, so verify it.
4706
 
        if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4707
 
          . $dir/$name
4708
 
 
4709
 
          # Delete the libtool libraries and symlinks.
4710
 
          for n in $library_names; do
4711
 
            rmfiles="$rmfiles $objdir/$n"
4712
 
          done
4713
 
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
4714
 
          test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
4715
 
 
4716
 
          if test $mode = uninstall; then
4717
 
            if test -n "$library_names"; then
4718
 
              # Do each command in the postuninstall commands.
4719
 
              eval cmds=\"$postuninstall_cmds\"
4720
 
              IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
4721
 
              for cmd in $cmds; do
4722
 
                IFS="$save_ifs"
4723
 
                $show "$cmd"
4724
 
                $run eval "$cmd"
4725
 
              done
4726
 
              IFS="$save_ifs"
4727
 
            fi
4728
 
 
4729
 
            if test -n "$old_library"; then
4730
 
              # Do each command in the old_postuninstall commands.
4731
 
              eval cmds=\"$old_postuninstall_cmds\"
4732
 
              IFS="${IFS=       }"; save_ifs="$IFS"; IFS='~'
4733
 
              for cmd in $cmds; do
4734
 
                IFS="$save_ifs"
4735
 
                $show "$cmd"
4736
 
                $run eval "$cmd"
4737
 
              done
4738
 
              IFS="$save_ifs"
4739
 
            fi
4740
 
            # FIXME: should reinstall the best remaining shared library.
4741
 
          fi
4742
 
        fi
4743
 
        ;;
4744
 
 
4745
 
      *.lo)
4746
 
        if test "$build_old_libs" = yes; then
4747
 
          oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4748
 
          rmfiles="$rmfiles $dir/$oldobj"
4749
 
        fi
4750
 
        ;;
4751
 
 
4752
 
      *)
4753
 
        # Do a test to see if this is a libtool program.
4754
 
        if test $mode = clean &&
4755
 
           (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
4756
 
          relink_command=
4757
 
          . $dir/$file
4758
 
 
4759
 
          rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
4760
 
          if test "$fast_install" = yes && test -n "$relink_command"; then
4761
 
            rmfiles="$rmfiles $objdir/lt-$name"
4762
 
          fi
4763
 
        fi
4764
 
        ;;
4765
 
      esac
4766
 
      $show "$rm $rmfiles"
4767
 
      $run $rm $rmfiles
4768
 
    done
4769
 
    exit 0
4770
 
    ;;
4771
 
 
4772
 
  "")
4773
 
    $echo "$modename: you must specify a MODE" 1>&2
4774
 
    $echo "$generic_help" 1>&2
4775
 
    exit 1
4776
 
    ;;
4777
 
  esac
4778
 
 
4779
 
  $echo "$modename: invalid operation mode \`$mode'" 1>&2
4780
 
  $echo "$generic_help" 1>&2
4781
 
  exit 1
4782
 
fi # test -z "$show_help"
4783
 
 
4784
 
# We need to display help for each of the modes.
4785
 
case "$mode" in
4786
 
"") $echo \
4787
 
"Usage: $modename [OPTION]... [MODE-ARG]...
4788
 
 
4789
 
Provide generalized library-building support services.
4790
 
 
4791
 
    --config          show all configuration variables
4792
 
    --debug           enable verbose shell tracing
4793
 
-n, --dry-run         display commands without modifying any files
4794
 
    --features        display basic configuration information and exit
4795
 
    --finish          same as \`--mode=finish'
4796
 
    --help            display this help message and exit
4797
 
    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
4798
 
    --quiet           same as \`--silent'
4799
 
    --silent          don't print informational messages
4800
 
    --version         print version information
4801
 
 
4802
 
MODE must be one of the following:
4803
 
 
4804
 
      clean           remove files from the build directory
4805
 
      compile         compile a source file into a libtool object
4806
 
      execute         automatically set library path, then run a program
4807
 
      finish          complete the installation of libtool libraries
4808
 
      install         install libraries or executables
4809
 
      link            create a library or an executable
4810
 
      uninstall       remove libraries from an installed directory
4811
 
 
4812
 
MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
4813
 
a more detailed description of MODE."
4814
 
  exit 0
4815
 
  ;;
4816
 
 
4817
 
clean)
4818
 
  $echo \
4819
 
"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
4820
 
 
4821
 
Remove files from the build directory.
4822
 
 
4823
 
RM is the name of the program to use to delete files associated with each FILE
4824
 
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
4825
 
to RM.
4826
 
 
4827
 
If FILE is a libtool library, object or program, all the files associated
4828
 
with it are deleted. Otherwise, only FILE itself is deleted using RM."
4829
 
  ;;
4830
 
 
4831
 
compile)
4832
 
  $echo \
4833
 
"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4834
 
 
4835
 
Compile a source file into a libtool library object.
4836
 
 
4837
 
This mode accepts the following additional options:
4838
 
 
4839
 
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
4840
 
  -static           always build a \`.o' file suitable for static linking
4841
 
 
4842
 
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4843
 
from the given SOURCEFILE.
4844
 
 
4845
 
The output file name is determined by removing the directory component from
4846
 
SOURCEFILE, then substituting the C source code suffix \`.c' with the
4847
 
library object suffix, \`.lo'."
4848
 
  ;;
4849
 
 
4850
 
execute)
4851
 
  $echo \
4852
 
"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4853
 
 
4854
 
Automatically set library path, then run a program.
4855
 
 
4856
 
This mode accepts the following additional options:
4857
 
 
4858
 
  -dlopen FILE      add the directory containing FILE to the library path
4859
 
 
4860
 
This mode sets the library path environment variable according to \`-dlopen'
4861
 
flags.
4862
 
 
4863
 
If any of the ARGS are libtool executable wrappers, then they are translated
4864
 
into their corresponding uninstalled binary, and any of their required library
4865
 
directories are added to the library path.
4866
 
 
4867
 
Then, COMMAND is executed, with ARGS as arguments."
4868
 
  ;;
4869
 
 
4870
 
finish)
4871
 
  $echo \
4872
 
"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4873
 
 
4874
 
Complete the installation of libtool libraries.
4875
 
 
4876
 
Each LIBDIR is a directory that contains libtool libraries.
4877
 
 
4878
 
The commands that this mode executes may require superuser privileges.  Use
4879
 
the \`--dry-run' option if you just want to see what would be executed."
4880
 
  ;;
4881
 
 
4882
 
install)
4883
 
  $echo \
4884
 
"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4885
 
 
4886
 
Install executables or libraries.
4887
 
 
4888
 
INSTALL-COMMAND is the installation command.  The first component should be
4889
 
either the \`install' or \`cp' program.
4890
 
 
4891
 
The rest of the components are interpreted as arguments to that command (only
4892
 
BSD-compatible install options are recognized)."
4893
 
  ;;
4894
 
 
4895
 
link)
4896
 
  $echo \
4897
 
"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4898
 
 
4899
 
Link object files or libraries together to form another library, or to
4900
 
create an executable program.
4901
 
 
4902
 
LINK-COMMAND is a command using the C compiler that you would use to create
4903
 
a program from several object files.
4904
 
 
4905
 
The following components of LINK-COMMAND are treated specially:
4906
 
 
4907
 
  -all-static       do not do any dynamic linking at all
4908
 
  -avoid-version    do not add a version suffix if possible
4909
 
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
4910
 
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
4911
 
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4912
 
  -export-symbols SYMFILE
4913
 
                    try to export only the symbols listed in SYMFILE
4914
 
  -export-symbols-regex REGEX
4915
 
                    try to export only the symbols matching REGEX
4916
 
  -LLIBDIR          search LIBDIR for required installed libraries
4917
 
  -lNAME            OUTPUT-FILE requires the installed library libNAME
4918
 
  -module           build a library that can dlopened
4919
 
  -no-fast-install  disable the fast-install mode
4920
 
  -no-install       link a not-installable executable
4921
 
  -no-undefined     declare that a library does not refer to external symbols
4922
 
  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
4923
 
  -release RELEASE  specify package release information
4924
 
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
4925
 
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
4926
 
  -static           do not do any dynamic linking of libtool libraries
4927
 
  -version-info CURRENT[:REVISION[:AGE]]
4928
 
                    specify library version info [each variable defaults to 0]
4929
 
 
4930
 
All other options (arguments beginning with \`-') are ignored.
4931
 
 
4932
 
Every other argument is treated as a filename.  Files ending in \`.la' are
4933
 
treated as uninstalled libtool libraries, other files are standard or library
4934
 
object files.
4935
 
 
4936
 
If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4937
 
only library objects (\`.lo' files) may be specified, and \`-rpath' is
4938
 
required, except when creating a convenience library.
4939
 
 
4940
 
If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4941
 
using \`ar' and \`ranlib', or on Windows using \`lib'.
4942
 
 
4943
 
If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4944
 
is created, otherwise an executable program is created."
4945
 
  ;;
4946
 
 
4947
 
uninstall)
4948
 
  $echo \
4949
 
"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4950
 
 
4951
 
Remove libraries from an installation directory.
4952
 
 
4953
 
RM is the name of the program to use to delete files associated with each FILE
4954
 
(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
4955
 
to RM.
4956
 
 
4957
 
If FILE is a libtool library, all the files associated with it are deleted.
4958
 
Otherwise, only FILE itself is deleted using RM."
4959
 
  ;;
4960
 
 
4961
 
*)
4962
 
  $echo "$modename: invalid operation mode \`$mode'" 1>&2
4963
 
  $echo "$help" 1>&2
4964
 
  exit 1
4965
 
  ;;
4966
 
esac
4967
 
 
4968
 
echo
4969
 
$echo "Try \`$modename --help' for more information about other modes."
4970
 
 
4971
 
exit 0
4972
 
 
4973
 
# Local Variables:
4974
 
# mode:shell-script
4975
 
# sh-indentation:2
4976
 
# End: