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