OSDN Git Service

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