~ubuntu-branches/ubuntu/jaunty/stunnel4/jaunty

« back to all changes in this revision

Viewing changes to libtool

  • Committer: Bazaar Package Importer
  • Author(s): Julien Lemoine
  • Date: 2005-04-20 21:07:50 UTC
  • mfrom: (1.1.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050420210750-0vk5fj5vh75o4d00
Tags: 2:4.090-1
* New upstream release
* include better stunnel3 compability script from upstream, options 
  like -cd can now be use instead of -c -d ...
  (closes: #305259)
* Added depends on perl-modules to allow use of stunnel3 compatibilty script

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