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