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