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