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.
7 # Copyright (C) 1996-2000 Free Software Foundation, Inc.
8 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
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.
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.
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.
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.
29 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
32 # The HP-UX ksh and POSIX shell print the target directory to stdout
34 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
36 # ### BEGIN LIBTOOL CONFIG
38 # Libtool was configured on host toto:
40 # Shell to use when invoking shell scripts.
43 # Whether or not to build shared libraries.
44 build_libtool_libs=yes
46 # Whether or not to build static libraries.
49 # Whether or not to add -lc for building shared libraries.
50 build_libtool_need_lc=yes
52 # Whether or not to optimize for fast installation.
59 # An echo program that does not interpret backslashes.
66 # The default C compiler.
69 # Is the compiler the GNU C compiler?
72 # The linker used to build libraries.
73 LD="/usr/i686-pc-cygwin/bin/ld.exe"
75 # Whether we need hard or soft links.
78 # A BSD-compatible nm program.
81 # A symbol stripping program
84 # Used to examine libraries when file_magic_cmd begins "file"
87 # Used on cygwin: DLL creation program.
90 # Used on cygwin: object dumper.
93 # Used on cygwin: assembler.
96 # The name of the directory that contains temporary libtool files.
99 # How to create reloadable object files.
101 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
103 # How to pass a linker flag through the compiler.
106 # Object file suffix (normally "o").
109 # Old archive suffix (normally "a").
112 # Executable file suffix (normally "").
115 # Additional compiler flags for building library objects.
116 pic_flag=" -DDLL_EXPORT"
119 # Does compiler simultaneously support -c and -o options?
122 # Can we write directly to a .lo ?
125 # Must we lock files when doing compilation ?
128 # Do we need the lib prefix for modules?
131 # Do we need a version for libraries?
134 # Whether dlopen is supported.
135 dlopen_support=unknown
137 # Whether dlopen of programs is supported.
140 # Whether dlopen of statically linked programs is supported.
141 dlopen_self_static=unknown
143 # Compiler flag to prevent dynamic linking.
144 link_static_flag="-static"
146 # Compiler flag to turn off builtin functions.
147 no_builtin_flag=" -fno-builtin"
149 # Compiler flag to allow reflexive dlopens.
150 export_dynamic_flag_spec="\${wl}--export-dynamic"
152 # Compiler flag to generate shared objects directly from archives.
153 whole_archive_flag_spec=""
155 # Compiler flag to generate thread-safe objects.
156 thread_safe_flag_spec=""
158 # Library versioning type.
161 # Format of library name prefix.
162 libname_spec="lib\$name"
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"
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"
171 # Commands used to build and install an old-style archive.
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=""
177 # Create an old-style archive from a shared archive.
178 old_archive_from_new_cmds=""
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"
183 # Commands used to build and install a shared archive.
185 archive_expsym_cmds="if test \\\"x\\\`head -1 \$export_symbols\\\`\\\" = xEXPORTS; then
186 cp \$export_symbols \$output_objdir/\$soname-def;
188 echo EXPORTS > \$output_objdir/\$soname-def;
190 cat \$export_symbols | while read symbol; do
191 set dummy \\\$symbol;
193 2) echo \\\" \\\$2 @ \\\$_lt_hint ; \\\" >> \$output_objdir/\$soname-def;;
194 *) echo \\\" \\\$2 @ \\\$_lt_hint \\\$3 ; \\\" >> \$output_objdir/\$soname-def;;
196 _lt_hint=\\\`expr 1 + \\\$_lt_hint\\\`;
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~
213 # Commands to strip libraries.
214 old_striplib="strip --strip-debug"
215 striplib="strip --strip-unneeded"
217 # Method to check whether dependent libraries are shared objects.
218 deplibs_check_method="file_magic file format pei*-i386(.*architecture: i386)?"
220 # Command to use when deplibs_check_method == file_magic.
221 file_magic_cmd="\$OBJDUMP -f"
223 # Flag that allows shared libraries with undefined symbols to be built.
224 allow_undefined_flag="unsupported"
226 # Flag that forces no undefined symbols.
229 # Commands used to finish a libtool library installation in a directory.
232 # Same as above, but a single script fragment to be evaled but not shown.
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'"
238 # Transform the output of nm in a proper C declaration
239 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
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'"
244 # This is the shared library runtime path variable.
245 runpath_var=LD_RUN_PATH
247 # This is the shared library path variable.
250 # Is shlibpath searched before the hard-coded library search path?
251 shlibpath_overrides_runpath=unknown
253 # How to hardcode a shared library path into an executable.
254 hardcode_action=immediate
256 # Whether we should hardcode library paths into libraries.
257 hardcode_into_libs=no
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"
263 # Whether we need a single -rpath flag with a separated argument.
264 hardcode_libdir_separator=""
266 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
270 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
274 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
275 # the resulting binary.
276 hardcode_shlibpath_var=unsupported
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"
282 # Whether libtool must link a program against all its dependency libraries.
283 link_all_deplibs=unknown
285 # Compile-time system search path for libraries
286 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
288 # Run-time system search path for libraries
289 sys_lib_dlsearch_path_spec="/lib /usr/lib"
291 # Fix the shell variable $srcfile for the compiler.
294 # Set to yes if exported symbols are required.
295 always_export_symbols=yes
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"
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"
310 # Symbols that should not be listed in the preloaded symbols.
311 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
313 # Symbols that must always be exported.
316 # ### END LIBTOOL CONFIG
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
327 # # ifdef __CYGWIN32__
328 # # define __CYGWIN__ __CYGWIN32__
335 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
341 # #include <cygwin/cygwin_dll.h>
342 # DECLARE_CYGWIN_DLL( DllMain );
344 # HINSTANCE __hDllInstance_base;
347 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
349 # __hDllInstance_base = hInst;
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.
359 # This file is part of GNU libtool.
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.
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.
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.
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() */
381 # /* O_BINARY isn't required (or even defined sometimes) under Unix */
386 # static unsigned int
387 # pe_get16 (fd, offset)
391 # unsigned char b[2];
392 # lseek (fd, offset, SEEK_SET);
394 # return b[0] + (b[1]<<8);
397 # static unsigned int
398 # pe_get32 (fd, offset)
402 # unsigned char b[4];
403 # lseek (fd, offset, SEEK_SET);
405 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
408 # static unsigned int
412 # unsigned char *b = ptr;
413 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
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;
428 # filename = argv[1];
430 # dll = open(filename, O_RDONLY|O_BINARY);
434 # dll_name = filename;
436 # for (i=0; filename[i]; i++)
437 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
438 # dll_name = filename + i +1;
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);
444 # if (num_entries < 1) /* no exports */
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));
454 # for (i = 0; i < nsections; i++)
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)
465 # expptr = fptr + (export_rva - vaddr);
466 # if (export_rva + export_size > vaddr + vsize)
467 # export_size = vsize - (export_rva - vaddr);
472 # expdata = (unsigned char*)malloc(export_size);
473 # lseek (dll, expptr, SEEK_SET);
474 # read (dll, expdata, export_size);
475 # erva = expdata - export_rva;
477 # nexp = pe_as32 (expdata+24);
478 # name_rvas = pe_as32 (expdata+32);
480 # printf ("EXPORTS\n");
481 # for (i = 0; i<nexp; i++)
483 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
484 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
489 # /* impgen.c ends here */
491 # ltmain.sh - Provide generalized library-building support services.
492 # NOTE: Changing this file will not affect anything until you rerun configure.
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
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.
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.
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.
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.
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.
521 elif test "X$1" = X--fallback-echo; then
522 # Avoid inline document here, it may be left over
524 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
525 # Yippee, $echo works!
528 # Restart under the correct shell, and then maybe $echo will work.
529 exec $SHELL "$0" --no-reexec ${1+"$@"}
532 if test "X$1" = X--fallback-echo; then
533 # used as fallback echo
541 # The name of this program.
542 progname=`$echo "$0" | sed 's%^.*/%%'`
549 TIMESTAMP=" (1.922.2.79 2001/11/28 21:50:31)"
552 help="Try \`$progname --help' for more information."
553 magic="%%%MAGIC variable%%%"
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'
563 NL2SP='tr \015\012 \040\040'
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
573 if test "${LANG+set}" = set; then
574 save_LANG="$LANG"; LANG=C; export LANG
577 # Make sure IFS has a sensible default
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
595 lo2o="s/\\.lo\$/.${objext}/"
596 o2lo="s/\\.${objext}\$/.lo/"
598 # Parse our command line options once, thoroughly.
605 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
609 # If the previous option needs an argument, assign it.
610 if test -n "$prev"; then
613 execute_dlfiles="$execute_dlfiles $arg"
625 # Have we seen a non-optional argument yet?
632 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
637 sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
642 echo "$progname: enabling shell trace mode"
652 if test "$build_libtool_libs" = yes; then
653 echo "enable shared libraries"
655 echo "disable shared libraries"
657 if test "$build_old_libs" = yes; then
658 echo "enable static libraries"
660 echo "disable static libraries"
665 --finish) mode="finish" ;;
667 --mode) prevopt="--mode" prev=mode ;;
668 --mode=*) mode="$optarg" ;;
670 --preserve-dup-deps) duplicate_deps="yes" ;;
682 $echo "$modename: unrecognized option \`$arg'" 1>&2
694 if test -n "$prevopt"; then
695 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
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.
705 if test -z "$show_help"; then
707 # Infer the operation mode.
708 if test -z "$mode"; then
710 *cc | *++ | gcc* | *-gcc*)
722 *db | *dbx | *strace | *truss)
732 # If we have no mode, but dlfiles were specified, then do execute mode.
733 test -n "$execute_dlfiles" && mode=execute
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
740 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
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
754 # Change the help message to a mode-specific one.
756 help="Try \`$modename --help --mode=$mode' for more information."
758 # These modes are in order of execution frequency so that they run quickly.
760 # libtool compile mode
762 modename="$modename: compile"
763 # Get the compilation command and the source file.
776 # Aesthetically quote the previous argument.
778 lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
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 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
789 # Add the previous argument to base_compile.
790 if test -z "$base_compile"; then
791 base_compile="$lastarg"
793 base_compile="$base_compile $lastarg"
799 # Accept any command-line options.
802 if test "$user_target" != "no"; then
803 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
830 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
832 save_ifs="$IFS"; IFS=','
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.
840 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
844 lastarg="$lastarg $arg"
847 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
849 # Add the arguments to base_compile.
850 if test -z "$base_compile"; then
851 base_compile="$lastarg"
853 base_compile="$base_compile $lastarg"
861 # The next one is the -o target name
866 # We got the output file
873 # Accept the current argument as the source file.
877 # Aesthetically quote the previous argument.
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"`
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.
888 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
889 lastarg="\"$lastarg\""
893 # Add the previous argument to base_compile.
894 if test -z "$base_compile"; then
895 base_compile="$lastarg"
897 base_compile="$base_compile $lastarg"
905 # Get the name of the library object.
906 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
909 $echo "$modename: you must specify a target with \`-o'" 1>&2
914 # Recognize several different file suffixes.
915 # If the user specifies -o file.o, it is replaced with file.lo
930 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
933 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
935 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
940 if test -z "$base_compile"; then
941 $echo "$modename: you must specify a compilation command" 1>&2
946 # Delete any leftover library objects.
947 if test "$build_old_libs" = yes; then
948 removelist="$obj $libobj"
954 trap "$run $rm $removelist; exit 1" 1 2 15
956 # On Cygwin there's no "real" PIC flag so we must build both object types
958 cygwin* | mingw* | pw32* | os2*)
962 if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
963 # non-PIC code in shared libraries is not supported
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
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"
986 elif test "$need_locks" = warn; then
987 if test -f "$lockfile"; then
989 *** ERROR, $lockfile exists and contains:
990 `cat $lockfile 2>/dev/null`
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
1002 echo $srcfile > "$lockfile"
1005 if test -n "$fix_srcfile_path"; then
1006 eval srcfile=\"$fix_srcfile_path\"
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
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"
1018 # Don't build PIC code
1019 command="$base_compile $srcfile"
1021 if test "$build_old_libs" = yes; then
1023 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
1024 if test "X$dir" = "X$libobj"; then
1029 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
1031 if test -d "$dir"; then
1038 if test $status -ne 0 && test ! -d $dir; then
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
1048 command="$command -o $output_obj"
1051 $run $rm "$output_obj"
1053 if $run eval "$command"; then :
1055 test -n "$output_obj" && $run $rm $removelist
1059 if test "$need_locks" = warn &&
1060 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
1062 *** ERROR, $lockfile contains:
1063 `cat $lockfile 2>/dev/null`
1065 but it should contain:
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
1075 $run $rm $removelist
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 :
1085 $run $rm $removelist
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
1099 $show "$mv $libobj $obj"
1100 if $run $mv $libobj $obj; then :
1103 $run $rm $removelist
1107 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
1108 if test "X$xdir" = "X$obj"; then
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"
1125 $run $rm $removelist
1130 # Allow error messages only from the first compilation.
1131 suppress_output=' >/dev/null 2>&1'
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"
1140 # All platforms use -DPIC, to notify preprocessed assembler code.
1141 command="$base_compile $srcfile $pic_flag -DPIC"
1143 if test "$compiler_c_o" = yes; then
1144 command="$command -o $obj"
1148 # Suppress compiler output if we already did a PIC compilation.
1149 command="$command$suppress_output"
1150 $run $rm "$output_obj"
1152 if $run eval "$command"; then :
1154 $run $rm $removelist
1158 if test "$need_locks" = warn &&
1159 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
1161 *** ERROR, $lockfile contains:
1162 `cat $lockfile 2>/dev/null`
1164 but it should contain:
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
1174 $run $rm $removelist
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 :
1184 $run $rm $removelist
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 $?
1195 # Move the .lo from within objdir
1196 $show "$mv $libobj $lo_libobj"
1197 if $run $mv $libobj $lo_libobj; then :
1200 $run $rm $removelist
1206 # Unlock the critical section if it was locked
1207 if test "$need_locks" != no; then
1208 $run $rm "$lockfile"
1216 modename="$modename: link"
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
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.
1236 libtool_args="$nonopt"
1237 compile_command="$nonopt"
1238 finalize_command="$nonopt"
1251 lib_search_path=`pwd`
1259 export_symbols_regex=
1266 prefer_static_libs=no
1278 # We need to know -static, to get the right output filenames.
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
1287 if test -n "$link_static_flag"; then
1288 dlopen_self=$dlopen_self_static
1291 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1292 dlopen_self=$dlopen_self_static
1295 build_libtool_libs=no
1297 prefer_static_libs=yes
1303 # See if our shared archives depend on static archives.
1304 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1306 # Go through the arguments, transforming them on the way.
1307 while test $# -gt 0; do
1311 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1312 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
1316 libtool_args="$libtool_args $qarg"
1318 # If the previous option needs an argument, assign it.
1319 if test -n "$prev"; then
1322 compile_command="$compile_command @OUTPUT@"
1323 finalize_command="$finalize_command @OUTPUT@"
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@"
1336 *.la | *.lo) ;; # We handle these cases below.
1338 if test "$dlself" = no; then
1346 if test "$prev" = dlprefiles; then
1348 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1358 if test "$prev" = dlfiles; then
1359 dlfiles="$dlfiles $arg"
1361 dlprefiles="$dlprefiles $arg"
1369 export_symbols="$arg"
1370 if test ! -f "$arg"; then
1371 $echo "$modename: symbol file \`$arg' does not exist"
1378 export_symbols_regex="$arg"
1388 # We need an absolute path.
1390 [\\/]* | [A-Za-z]:[\\/]*) ;;
1392 $echo "$modename: only absolute run-paths are allowed" 1>&2
1396 if test "$prev" = rpath; then
1399 *) rpath="$rpath $arg" ;;
1404 *) xrpath="$xrpath $arg" ;;
1411 compiler_flags="$compiler_flags $qarg"
1413 compile_command="$compile_command $qarg"
1414 finalize_command="$finalize_command $qarg"
1418 linker_flags="$linker_flags $qarg"
1419 compiler_flags="$compiler_flags $wl$qarg"
1421 compile_command="$compile_command $wl$qarg"
1422 finalize_command="$finalize_command $wl$qarg"
1426 eval "$prev=\"\$arg\""
1437 if test -n "$link_static_flag"; then
1438 compile_command="$compile_command $link_static_flag"
1439 finalize_command="$finalize_command $link_static_flag"
1445 # FIXME: remove this flag sometime in the future.
1446 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
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"
1475 if test "X$arg" = "X-export-symbols"; then
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
1486 case $with_gcc/$host in
1487 no/*-*-irix* | no/*-*-nonstopux*)
1488 compile_command="$compile_command $arg"
1489 finalize_command="$finalize_command $arg"
1496 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1497 # We need an absolute path.
1499 [\\/]* | [A-Za-z]:[\\/]*) ;;
1501 absdir=`cd "$dir" && pwd`
1502 if test -z "$absdir"; then
1503 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1512 deplibs="$deplibs -L$dir"
1513 lib_search_path="$lib_search_path $dir"
1517 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1518 case :$dllsearchpath: in
1520 *) dllsearchpath="$dllsearchpath:$dir";;
1528 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1530 *-*-cygwin* | *-*-pw32* | *-*-beos*)
1531 # These systems don't actually have a C or math library (as such)
1534 *-*-mingw* | *-*-os2*)
1535 # These systems don't actually have a C library (as such)
1536 test "X$arg" = "X-lc" && continue
1538 *-*-openbsd* | *-*-freebsd*)
1539 # Do not include libc due to us having libc/libc_r.
1540 test "X$arg" = "X-lc" && continue
1543 elif test "X$arg" = "X-lc_r"; then
1545 *-*-openbsd* | *-*-freebsd*)
1546 # Do not include libc_r directly, use -pthread flag.
1551 deplibs="$deplibs $arg"
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
1574 *) no_install=yes ;;
1602 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1603 # We need an absolute path.
1605 [\\/]* | [A-Za-z]:[\\/]*) ;;
1607 $echo "$modename: only absolute run-paths are allowed" 1>&2
1613 *) xrpath="$xrpath $dir" ;;
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.
1638 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
1640 save_ifs="$IFS"; IFS=','
1641 for flag in $args; do
1644 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1649 compiler_flags="$compiler_flags $flag"
1652 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1656 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
1658 save_ifs="$IFS"; IFS=','
1659 for flag in $args; do
1662 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1667 compiler_flags="$compiler_flags $wl$flag"
1668 linker_flags="$linker_flags $flag"
1671 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
1684 # Some other compiler flag.
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"`
1690 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
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"
1705 # If libtool objects are unsupported, then we need to preload.
1710 if test "$prev" = dlprefiles; then
1711 # Preload the old-style object.
1712 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1716 *.lo) libobjs="$libobjs $arg" ;;
1717 *) objs="$objs $arg" ;;
1724 deplibs="$deplibs $arg"
1725 old_deplibs="$old_deplibs $arg"
1730 # A libtool-controlled library.
1732 if test "$prev" = dlfiles; then
1733 # This library was specified with -dlopen.
1734 dlfiles="$dlfiles $arg"
1736 elif test "$prev" = dlprefiles; then
1737 # The library was specified with -dlpreopen.
1738 dlprefiles="$dlprefiles $arg"
1741 deplibs="$deplibs $arg"
1746 # Some other compiler argument.
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"`
1752 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
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"
1764 done # argument parsing loop
1766 if test -n "$prev"; then
1767 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
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"
1778 # calculate the name of the file, without its directory
1779 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1780 libobjs_save="$libobjs"
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\'\`
1788 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
1789 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1791 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1792 if test "X$output_objdir" = "X$output"; then
1793 output_objdir="$objdir"
1795 output_objdir="$output_objdir/$objdir"
1797 # Create the object directory.
1798 if test ! -d $output_objdir; then
1799 $show "$mkdir $output_objdir"
1800 $run $mkdir $output_objdir
1802 if test $status -ne 0 && test ! -d $output_objdir; then
1807 # Determine the type of output
1810 $echo "$modename: you must specify an output file" 1>&2
1814 *.$libext) linkmode=oldlib ;;
1815 *.lo | *.$objext) linkmode=obj ;;
1816 *.la) linkmode=lib ;;
1817 *) linkmode=prog ;; # Anything else should be a program.
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
1827 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
1830 libs="$libs $deplib"
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
1841 for file in $dlfiles $dlprefiles; do
1845 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
1857 passes="conv scan dlopen dlpreopen link"
1862 for pass in $passes; do
1863 if test $linkmode = prog; then
1864 # Determine which files to process
1868 save_deplibs="$deplibs" # Collect dlpreopened libraries
1871 dlpreopen) libs="$dlprefiles" ;;
1872 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
1875 for deplib in $libs; do
1880 if test $linkmode = oldlib && test $linkmode = obj; then
1881 $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
1884 if test $pass = conv; then
1885 deplibs="$deplib $deplibs"
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
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"
1903 deplibs="$deplib $deplibs"
1904 test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
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//'`
1918 if test $pass = conv; then
1919 deplibs="$deplib $deplibs"
1922 if test $pass = scan; then
1923 deplibs="$deplib $deplibs"
1924 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1926 compile_deplibs="$deplib $compile_deplibs"
1927 finalize_deplibs="$deplib $finalize_deplibs"
1931 $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
1937 if test $pass = link; then
1938 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1939 # Make sure the xrpath contains only unique directories.
1942 *) xrpath="$xrpath $dir" ;;
1945 deplibs="$deplib $deplibs"
1948 *.la) lib="$deplib" ;;
1950 if test $pass = conv; then
1951 deplibs="$deplib $deplibs"
1956 if test "$deplibs_check_method" != pass_all; then
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."
1966 echo "*** Warning: Linking the shared library $output against the"
1967 echo "*** static library $deplib is not portable!"
1968 deplibs="$deplib $deplibs"
1973 if test $pass != link; then
1974 deplibs="$deplib $deplibs"
1976 compile_deplibs="$deplib $compile_deplibs"
1977 finalize_deplibs="$deplib $finalize_deplibs"
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"
1991 newdlfiles="$newdlfiles $deplib"
2000 if test $found = yes || test -f "$lib"; then :
2002 $echo "$modename: cannot find the library \`$lib'" 1>&2
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 :
2009 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
2013 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
2014 test "X$ladir" = "X$lib" && ladir="."
2022 # If the library was installed with an old release of libtool,
2023 # it will not redefine variable installed.
2028 */* | *\\*) . $lib ;;
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"
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
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"
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" ;;
2059 tmp_libs="$tmp_libs $deplib"
2061 elif test $linkmode != prog && test $linkmode != lib; then
2062 $echo "$modename: \`$lib' is not a convenience library" 1>&2
2068 # Get the name of the library we link against.
2070 for l in $old_library $library_names; do
2073 if test -z "$linklib"; then
2074 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
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
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"
2089 newdlfiles="$newdlfiles $lib"
2094 # We need an absolute path.
2096 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
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
2106 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
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
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//'`
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
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"
2141 newdlprefiles="$newdlprefiles $dir/$linklib"
2143 fi # $pass = dlpreopen
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"
2153 deplibs="$lib $deplibs"
2158 if test $linkmode = prog && test $pass != link; then
2159 newlib_search_path="$newlib_search_path $ladir"
2160 deplibs="$lib $deplibs"
2163 if test "$link_all_deplibs" != no || test -z "$library_names" ||
2164 test "$build_libtool_libs" = no; then
2169 for deplib in $dependency_libs; do
2171 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
2173 # Need to link against all dependency_libs?
2174 if test $linkalldeplibs = yes; then
2175 deplibs="$deplib $deplibs"
2177 # Need to hardcode shared library paths
2178 # or/and link against static libraries
2179 newdependency_libs="$deplib $newdependency_libs"
2181 if test "X$duplicate_deps" = "Xyes" ; then
2182 case "$tmp_libs " in
2183 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
2186 tmp_libs="$tmp_libs $deplib"
2189 fi # $linkmode = prog...
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
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
2201 case " $sys_lib_dlsearch_path " in
2204 case "$compile_rpath " in
2206 *) compile_rpath="$compile_rpath $absdir"
2210 case " $sys_lib_dlsearch_path " in
2213 case "$finalize_rpath " in
2215 *) finalize_rpath="$finalize_rpath $libdir"
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
2226 *) temp_rpath="$temp_rpath $dir" ;;
2230 fi # $linkmode,$pass = prog,link...
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
2240 if test "$installed" = no; then
2241 notinst_deplibs="$notinst_deplibs $lib"
2245 if test -n "$old_archive_from_expsyms_cmds"; then
2246 # figure out the soname
2247 set dummy $library_names
2250 libname=`eval \\$echo \"$libname_spec\"`
2251 # use dlname if we got it. it's perfectly good, no?
2252 if test -n "$dlname"; then
2254 elif test -n "$soname_spec"; then
2258 major=`expr $current - $age`
2262 eval soname=\"$soname_spec\"
2267 # Make a new name for the extract_expsyms_cmds to use
2269 soname=`echo $soroot | sed -e 's/^.*\///'`
2270 newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
2272 # If the library has no export list, then create one now
2273 if test -f "$output_objdir/$soname-def"; then :
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
2281 $run eval "$cmd" || exit $?
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
2294 $run eval "$cmd" || exit $?
2298 # make sure the library variables are pointing to the new library
2301 fi # test -n $old_archive_from_expsyms_cmds
2303 if test $linkmode = prog || test "$mode" != relink; then
2308 case $hardcode_action in
2309 immediate | unsupported)
2310 if test "$hardcode_direct" = no; then
2312 elif test "$hardcode_minus_L" = no; then
2314 *-*-sunos*) add_shlibpath="$dir" ;;
2318 elif test "$hardcode_shlibpath_var" = no; then
2319 add_shlibpath="$dir"
2326 if test "$hardcode_direct" = yes; then
2328 elif test "$hardcode_minus_L" = yes; then
2331 elif test "$hardcode_shlibpath_var" = yes; then
2332 add_shlibpath="$dir"
2341 if test "$lib_linked" != yes; then
2342 $echo "$modename: configuration error: unsupported hardcode properties"
2346 if test -n "$add_shlibpath"; then
2347 case :$compile_shlibpath: in
2348 *":$add_shlibpath:"*) ;;
2349 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
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"
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
2363 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2369 if test $linkmode = prog || test "$mode" = relink; then
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
2379 elif test "$hardcode_shlibpath_var" = yes; then
2380 case :$finalize_shlibpath: in
2382 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
2386 # We cannot seem to hardcode it, guess we'll fake it.
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"
2395 test -n "$add_dir" && deplibs="$add_dir $deplibs"
2396 test -n "$add" && deplibs="$add $deplibs"
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
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
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"
2417 compile_deplibs="-l$name -L$dir $compile_deplibs"
2418 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
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.
2426 # Just print a warning and add the library to dependency_libs so
2427 # that the program can be linked against the static library.
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
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."
2444 if test "$build_old_libs" = no; then
2445 build_libtool_libs=module
2448 build_libtool_libs=no
2452 convenience="$convenience $dir/$old_library"
2453 old_convenience="$old_convenience $dir/$old_library"
2454 deplibs="$dir/$old_library $deplibs"
2457 fi # link shared/static library?
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
2465 for libdir in $dependency_libs; do
2467 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
2469 *" $temp_xrpath "*) ;;
2470 *) xrpath="$xrpath $temp_xrpath";;
2472 *) temp_deplibs="$temp_deplibs $libdir";;
2475 dependency_libs="$temp_deplibs"
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
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" ;;
2490 tmp_libs="$tmp_libs $deplib"
2493 if test $link_all_deplibs != no; then
2494 # Add the search paths of all dependency libraries
2495 for deplib in $dependency_libs; do
2497 -L*) path="$deplib" ;;
2499 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
2500 test "X$dir" = "X$deplib" && dir="."
2501 # We need an absolute path.
2503 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
2505 absdir=`cd "$dir" && pwd`
2506 if test -z "$absdir"; then
2507 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
2512 if grep "^installed=no" $deplib > /dev/null; then
2513 path="-L$absdir/$objdir"
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
2520 if test "$absdir" != "$libdir"; then
2521 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
2528 case " $deplibs " in
2530 *) deplibs="$deplibs $path" ;;
2533 fi # link_all_deplibs != no
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"
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.
2547 for dir in $newlib_search_path; do
2548 case "$lib_search_path " in
2550 *) lib_search_path="$lib_search_path $dir" ;;
2556 if test "$linkmode,$pass" != "prog,link"; then
2559 vars="compile_deplibs finalize_deplibs"
2561 for var in $vars dependency_libs; do
2562 # Add libraries to $var in reverse order
2563 eval tmp_libs=\"\$$var\"
2565 for deplib in $tmp_libs; do
2567 -L*) new_libs="$deplib $new_libs" ;;
2569 case " $specialdeplibs " in
2570 *" $deplib "*) new_libs="$deplib $new_libs" ;;
2572 case " $new_libs " in
2574 *) new_libs="$deplib $new_libs" ;;
2582 for deplib in $new_libs; do
2585 case " $tmp_libs " in
2587 *) tmp_libs="$tmp_libs $deplib" ;;
2590 *) tmp_libs="$tmp_libs $deplib" ;;
2593 eval $var=\"$tmp_libs\"
2596 if test "$pass" = "conv" &&
2597 { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
2598 libs="$deplibs" # reset libs
2602 if test $linkmode = prog; then
2603 dlfiles="$newdlfiles"
2604 dlprefiles="$newdlprefiles"
2609 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2610 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2613 if test -n "$rpath"; then
2614 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
2617 if test -n "$xrpath"; then
2618 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
2621 if test -n "$vinfo"; then
2622 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
2625 if test -n "$release"; then
2626 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
2629 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
2630 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
2633 # Now set the variables for building old libraries.
2634 build_libtool_libs=no
2636 objs="$objs$old_deplibs"
2640 # Make sure we only generate libraries of the form `libNAME.la'.
2643 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2644 eval libname=\"$libname_spec\"
2647 if test "$module" = no; then
2648 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
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\"
2657 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
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
2668 echo "*** Warning: Linking the shared library $output against the non-libtool"
2669 echo "*** objects $objs is not portable!"
2670 libobjs="$libobjs $objs"
2674 if test "$dlself" != no; then
2675 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
2679 if test $# -gt 2; then
2680 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
2685 if test -z "$rpath"; then
2686 if test "$build_libtool_libs" = yes; then
2687 # Building a libtool convenience library.
2689 oldlibs="$output_objdir/$libname.$libext $oldlibs"
2690 build_libtool_libs=convenience
2694 if test -n "$vinfo"; then
2695 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
2698 if test -n "$release"; then
2699 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
2703 # Parse the version information argument.
2704 save_ifs="$IFS"; IFS=':'
2705 set dummy $vinfo 0 0 0
2708 if test -n "$8"; then
2709 $echo "$modename: too many parameters to \`-version-info'" 1>&2
2718 # Check that each of the things are valid numbers.
2720 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2722 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
2723 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2729 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2731 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
2732 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2738 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
2740 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
2741 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
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
2752 # Calculate the version variables.
2756 case $version_type in
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"
2771 versuffix=".$current.$revision";
2776 versuffix=".$current";
2780 case $version_type in
2781 nonstopux) verstring_prefix=nonstopux ;;
2782 *) verstring_prefix=sgi ;;
2784 verstring="$verstring_prefix$major.$revision"
2786 major=`expr $current - $age + 1`
2788 # Add in all the interfaces that we are compatible with.
2790 while test $loop != 0; do
2791 iface=`expr $revision - $loop`
2792 loop=`expr $loop - 1`
2793 verstring="$verstring_prefix$major.$iface:$verstring"
2796 # Before this point, $major must not contain `.'.
2798 versuffix="$major.$revision"
2802 major=.`expr $current - $age`
2803 versuffix="$major.$age.$revision"
2807 major=`expr $current - $age`
2808 versuffix=".$current.$age.$revision"
2809 verstring="$current.$age.$revision"
2811 # Add in all the interfaces that we are compatible with.
2813 while test $loop != 0; do
2814 iface=`expr $current - $loop`
2815 loop=`expr $loop - 1`
2816 verstring="$verstring:${iface}.0"
2819 # Make executables depend on our current version.
2820 verstring="$verstring:${current}.0"
2825 versuffix=".$current.$revision"
2829 # Use '-' rather than '.', since we only want one
2830 # extension on DOS 8.3 filesystems.
2831 major=`expr $current - $age`
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
2842 # Clear the version info if we defaulted, and they specified a release.
2843 if test -z "$vinfo" && test -n "$release"; then
2846 case $version_type in
2848 # we can't check for "0.0" in archive_cmds due to quoting
2849 # problems, so we reset it completely
2856 if test "$need_version" = no; then
2863 # Remove version info from name if versioning should be avoided
2864 if test "$avoid_version" = yes && test "$need_version" = no; then
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
2878 # Don't allow undefined symbols.
2879 allow_undefined_flag="$no_undefined_flag"
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}.*
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"
2893 # Transform .lo files to .o files.
2894 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
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'`
2904 if test -n "$xrpath"; then
2905 # If the user specified any rpath flags, then add them.
2907 for libdir in $xrpath; do
2908 temp_xrpath="$temp_xrpath -R$libdir"
2909 case "$finalize_rpath " in
2911 *) finalize_rpath="$finalize_rpath $libdir" ;;
2914 if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
2915 dependency_libs="$temp_xrpath $dependency_libs"
2919 # Make sure dlfiles contains only unique files that won't be dlpreopened
2920 old_dlfiles="$dlfiles"
2922 for lib in $old_dlfiles; do
2923 case " $dlprefiles $dlfiles " in
2925 *) dlfiles="$dlfiles $lib" ;;
2929 # Make sure dlprefiles contains only unique files
2930 old_dlprefiles="$dlprefiles"
2932 for lib in $old_dlprefiles; do
2933 case "$dlprefiles " in
2935 *) dlprefiles="$dlprefiles $lib" ;;
2939 if test "$build_libtool_libs" = yes; then
2940 if test -n "$rpath"; then
2942 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
2943 # these systems don't actually have a c library (as such)!
2945 *-*-rhapsody* | *-*-darwin1.[012])
2946 # Rhapsody C library is in the System framework
2947 deplibs="$deplibs -framework System"
2950 # Don't link with libc until the a.out ld.so is fixed.
2952 *-*-openbsd* | *-*-freebsd*)
2953 # Do not include libc due to us having libc/libc_r.
2956 # Add libc to deplibs on all other systems if necessary.
2957 if test $build_libtool_need_lc = "yes"; then
2958 deplibs="$deplibs -lc"
2964 # Transform deplibs into only deplibs that can be linked in shared.
2966 libname_save=$libname
2967 release_save=$release
2968 versuffix_save=$versuffix
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?
2978 case $deplibs_check_method in
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.
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.
2993 cat > conftest.c <<EOF
2994 int main() { return 0; }
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
3008 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3009 newdeplibs="$newdeplibs $i"
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."
3021 newdeplibs="$newdeplibs $i"
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
3032 $CC -o conftest conftest.c $i
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
3040 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
3041 newdeplibs="$newdeplibs $i"
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."
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."
3061 newdeplibs="$newdeplibs $i"
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
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,
3087 potlib="$potent_lib"
3088 while test -h "$potlib" 2>/dev/null; do
3089 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
3091 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
3092 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
3095 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
3097 | egrep "$file_magic_regex" > /dev/null; then
3098 newdeplibs="$newdeplibs $a_deplib"
3104 if test -n "$a_deplib" ; then
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)"
3115 echo "*** with $libname and none of the candidates passed a file format test"
3116 echo "*** using a file magic. Last file checked: $potlib"
3120 # Add a -L argument.
3121 newdeplibs="$newdeplibs $a_deplib"
3123 done # Gone through all deplibs.
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 \
3139 | egrep "$match_pattern_regex" > /dev/null; then
3140 newdeplibs="$newdeplibs $a_deplib"
3146 if test -n "$a_deplib" ; then
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)"
3157 echo "*** with $libname and none of the candidates passed a file format test"
3158 echo "*** using a regex pattern. Last file checked: $potlib"
3162 # Add a -L argument.
3163 newdeplibs="$newdeplibs $a_deplib"
3165 done # Gone through all deplibs.
3169 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
3170 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
3171 grep . >/dev/null; then
3173 if test "X$deplibs_check_method" = "Xnone"; then
3174 echo "*** Warning: inter-library dependencies are not supported in this platform."
3176 echo "*** Warning: inter-library dependencies are not known to be supported."
3178 echo "*** All declared inter-library dependencies are being dropped."
3183 versuffix=$versuffix_save
3185 release=$release_save
3186 libname=$libname_save
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 /'`
3196 if test "$droppeddeps" = yes; then
3197 if test "$module" = yes; then
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
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."
3210 if test "$build_old_libs" = no; then
3211 oldlibs="$output_objdir/$libname.$libext"
3212 build_libtool_libs=module
3215 build_libtool_libs=no
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."
3222 if test $allow_undefined = no; then
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
3233 build_libtool_libs=no
3238 # Done checking deplibs!
3242 # All the library-specific variables (install_libdir is set above).
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
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"
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"*)
3266 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3271 eval flag=\"$hardcode_libdir_flag_spec\"
3272 dep_rpath="$dep_rpath $flag"
3274 elif test -n "$runpath_var"; then
3275 case "$perm_rpath " in
3277 *) perm_rpath="$perm_rpath $libdir" ;;
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\"
3287 if test -n "$runpath_var" && test -n "$perm_rpath"; then
3288 # We should set the runpath_var.
3290 for dir in $perm_rpath; do
3293 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
3295 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
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"
3304 # Get the real and link names of the library.
3305 eval library_names=\"$library_names_spec\"
3306 set dummy $library_names
3310 if test -n "$soname_spec"; then
3311 eval soname=\"$soname_spec\"
3315 test -z "$dlname" && dlname=$soname
3317 lib="$output_objdir/$realname"
3320 linknames="$linknames $link"
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
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 $?
3340 # Use standard objects if they are pic
3341 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
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
3354 $run eval "$cmd" || exit $?
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"'
3366 if test -n "$export_symbols" && test -n "$include_expsyms"; then
3367 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
3370 if test -n "$convenience"; then
3371 if test -n "$whole_archive_flag_spec"; then
3372 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3374 gentop="$output_objdir/${outputname}x"
3375 $show "${rm}r $gentop"
3376 $run ${rm}r "$gentop"
3377 $show "mkdir $gentop"
3378 $run mkdir "$gentop"
3380 if test $status -ne 0 && test ! -d "$gentop"; then
3383 generated="$generated $gentop"
3385 for xlib in $convenience; do
3386 # Extract the objects.
3388 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3389 *) xabs=`pwd`"/$xlib" ;;
3391 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3392 xdir="$gentop/$xlib"
3394 $show "${rm}r $xdir"
3399 if test $status -ne 0 && test ! -d "$xdir"; then
3402 $show "(cd $xdir && $AR x $xabs)"
3403 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3405 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
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"
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 $?
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\"
3424 eval cmds=\"$archive_cmds\"
3426 save_ifs="$IFS"; IFS='~'
3427 for cmd in $cmds; do
3430 $run eval "$cmd" || exit $?
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 $?
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 $?
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.
3457 if test -n "$deplibs"; then
3458 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3461 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3462 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3465 if test -n "$rpath"; then
3466 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
3469 if test -n "$xrpath"; then
3470 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
3473 if test -n "$vinfo"; then
3474 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
3477 if test -n "$release"; then
3478 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
3483 if test -n "$objs$old_deplibs"; then
3484 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
3488 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
3496 # Delete the old objects.
3497 $run $rm $obj $libobj
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
3505 # reload_cmds runs $LD directly, so let us get rid of
3506 # -Wl from whole_archive_flag_spec
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\"
3513 gentop="$output_objdir/${obj}x"
3514 $show "${rm}r $gentop"
3515 $run ${rm}r "$gentop"
3516 $show "mkdir $gentop"
3517 $run mkdir "$gentop"
3519 if test $status -ne 0 && test ! -d "$gentop"; then
3522 generated="$generated $gentop"
3524 for xlib in $convenience; do
3525 # Extract the objects.
3527 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3528 *) xabs=`pwd`"/$xlib" ;;
3530 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3531 xdir="$gentop/$xlib"
3533 $show "${rm}r $xdir"
3538 if test $status -ne 0 && test ! -d "$xdir"; then
3541 $show "(cd $xdir && $AR x $xabs)"
3542 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3544 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
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
3553 eval cmds=\"$reload_cmds\"
3554 save_ifs="$IFS"; IFS='~'
3555 for cmd in $cmds; do
3558 $run eval "$cmd" || exit $?
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"
3572 if test "$build_libtool_libs" != yes; then
3573 if test -n "$gentop"; then
3574 $show "${rm}r $gentop"
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 $?
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"
3589 eval cmds=\"$reload_cmds\"
3590 save_ifs="$IFS"; IFS='~'
3591 for cmd in $cmds; do
3594 $run eval "$cmd" || exit $?
3598 # Just create a symlink.
3601 xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
3602 if test "X$xdir" = "X$libobj"; then
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 $?
3613 if test -n "$gentop"; then
3614 $show "${rm}r $gentop"
3623 *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
3625 if test -n "$vinfo"; then
3626 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
3629 if test -n "$release"; then
3630 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
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."
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 /'`
3648 compile_command="$compile_command $compile_deplibs"
3649 finalize_command="$finalize_command $finalize_deplibs"
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
3657 *) finalize_rpath="$finalize_rpath $libdir" ;;
3662 # Now hardcode the library paths
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"
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"*)
3676 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3681 eval flag=\"$hardcode_libdir_flag_spec\"
3682 rpath="$rpath $flag"
3684 elif test -n "$runpath_var"; then
3685 case "$perm_rpath " in
3687 *) perm_rpath="$perm_rpath $libdir" ;;
3691 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
3692 case :$dllsearchpath: in
3694 *) dllsearchpath="$dllsearchpath:$libdir";;
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\"
3705 compile_rpath="$rpath"
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"
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"*)
3720 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
3725 eval flag=\"$hardcode_libdir_flag_spec\"
3726 rpath="$rpath $flag"
3728 elif test -n "$runpath_var"; then
3729 case "$finalize_perm_rpath " in
3731 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
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\"
3741 finalize_rpath="$rpath"
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`
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"
3754 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
3758 if test -n "$dlsyms"; then
3762 # Discover the nlist of each of the dlfiles.
3763 nlist="$output_objdir/${outputname}.nm"
3765 $show "$rm $nlist ${nlist}S ${nlist}T"
3766 $run $rm "$nlist" "${nlist}S" "${nlist}T"
3768 # Parse the name list into a source file.
3769 $show "creating $output_objdir/$dlsyms"
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 */
3779 /* Prevent the only kind of declaration conflicts we can make. */
3780 #define lt_preloaded_symbols some_other_symbol
3782 /* External symbol declarations for the compiler. */\
3785 if test "$dlself" = yes; then
3786 $show "generating symbol list for \`$output'"
3788 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
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'"
3797 if test -n "$exclude_expsyms"; then
3798 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3799 $run eval '$mv "$nlist"T "$nlist"'
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"'
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"'
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"'
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'"
3826 if test -z "$run"; then
3827 # Make sure we have at least an empty file.
3828 test -f "$nlist" || : > "$nlist"
3830 if test -n "$exclude_expsyms"; then
3831 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3832 $mv "$nlist"T "$nlist"
3835 # Try sorting and uniquifying the output.
3836 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
3839 grep -v "^: " < "$nlist" > "$nlist"S
3842 if test -f "$nlist"S; then
3843 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
3845 echo '/* NONE */' >> "$output_objdir/$dlsyms"
3848 $echo >> "$output_objdir/$dlsyms" "\
3850 #undef lt_preloaded_symbols
3852 #if defined (__STDC__) && __STDC__
3853 # define lt_ptr void *
3855 # define lt_ptr char *
3859 /* The mapping between symbol names and symbols. */
3864 lt_preloaded_symbols[] =
3868 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
3870 $echo >> "$output_objdir/$dlsyms" "\
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;
3887 pic_flag_for_symtable=
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
3897 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
3900 case "$compile_command " in
3902 *) pic_flag_for_symtable=" $pic_flag -DPIC";;
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 $?
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"
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}%"`
3919 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
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.
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@%%"`
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"
3938 # We have no uninstalled library dependencies, so finalize right now.
3939 $show "$link_command"
3940 $run eval "$link_command"
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}"
3952 if test -n "$shlibpath_var"; then
3953 # We should set the shlibpath_var
3955 for dir in $temp_rpath; do
3957 [\\/]* | [A-Za-z]:[\\/]*)
3962 # Relative path: add a thisdir entry.
3963 rpath="$rpath\$thisdir/$dir:"
3970 if test -n "$compile_shlibpath$finalize_shlibpath"; then
3971 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
3973 if test -n "$finalize_shlibpath"; then
3974 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
3979 if test -n "$runpath_var"; then
3980 if test -n "$perm_rpath"; then
3981 # We should set the runpath_var.
3983 for dir in $perm_rpath; do
3986 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
3988 if test -n "$finalize_perm_rpath"; then
3989 # We should set the runpath_var.
3991 for dir in $finalize_perm_rpath; do
3994 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
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.
4005 # Link the executable and exit
4006 $show "$link_command"
4007 $run eval "$link_command" || exit $?
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"
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
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'`
4024 # fast_install is set to needless
4028 link_command="$compile_var$compile_command$compile_rpath"
4029 relink_command="$finalize_var$finalize_command$finalize_rpath"
4033 # Replace the output file specification.
4034 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
4036 # Delete the old output files.
4037 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
4039 $show "$link_command"
4040 $run eval "$link_command" || exit $?
4042 # Now create the wrapper script.
4043 $show "creating $output"
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"
4054 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4055 relink_command="$var=\"$var_value\"; export $var; $relink_command"
4058 relink_command="(cd `pwd`; $relink_command)"
4059 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
4062 # Quote $echo for shipping.
4063 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
4065 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
4066 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
4068 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
4070 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
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.
4078 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
4080 # test for cygwin because mv fails w/o .exe extensions
4082 *cygwin*) exeext=.exe ;;
4086 trap "$rm $output; exit 1" 1 2 15
4091 # $output - temporary wrapper script for $objdir/$outputname
4092 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4094 # The $output program cannot be directly executed until all the libtool
4095 # libraries that it depends on are installed.
4097 # This wrapper script should never be moved out of the build directory.
4098 # If it is, it will not operate correctly.
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'
4105 # The HP-UX ksh and POSIX shell print the target directory to stdout
4107 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
4109 relink_command=\"$relink_command\"
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'
4116 # When we are sourced in execute mode, \$file and \$echo are already set.
4117 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4120 # Make sure echo works.
4121 if test \"X\$1\" = X--no-reexec; then
4122 # Discard the --no-reexec flag, and continue.
4124 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
4125 # Yippee, \$echo works!
4128 # Restart under the correct shell, and then maybe \$echo will work.
4129 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
4135 # Find the directory that this script lives in.
4136 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
4137 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
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%/[^/]*\$%%'\`
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\" ;;
4152 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
4153 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
4156 # Try to get the absolute directory name.
4157 absdir=\`cd \"\$thisdir\" && pwd\`
4158 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4161 if test "$fast_install" = yes; then
4163 program=lt-'$outputname'$exeext
4164 progdir=\"\$thisdir/$objdir\"
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
4170 file=\"\$\$-\$program\"
4172 if test ! -d \"\$progdir\"; then
4173 $mkdir \"\$progdir\"
4175 $rm \"\$progdir/\$file\"
4180 # relink executable if necessary
4181 if test -n \"\$relink_command\"; then
4182 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4184 $echo \"\$relink_command_output\" >&2
4185 $rm \"\$progdir/\$file\"
4190 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4191 { $rm \"\$progdir/\$program\";
4192 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4193 $rm \"\$progdir/\$file\"
4197 program='$outputname'
4198 progdir=\"\$thisdir/$objdir\"
4204 if test -f \"\$progdir/\$program\"; then"
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
4209 # Add our own library path to $shlibpath_var
4210 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
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/::*\$//'\`
4216 export $shlibpath_var
4220 # fixup the dll searchpath if we need to.
4221 if test -n "$dllsearchpath"; then
4223 # Add the dll search path components to the executable PATH
4224 PATH=$dllsearchpath:\$PATH
4229 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4230 # Run the actual program with our arguments.
4233 # win32 systems need to use the prog path for dll
4235 *-*-cygwin* | *-*-pw32*)
4237 exec \$progdir/\$program \${1+\"\$@\"}
4241 # Backslashes separate directories on plain windows
4242 *-*-mingw | *-*-os2*)
4244 exec \$progdir\\\\\$program \${1+\"\$@\"}
4250 # Export the path to the program.
4251 PATH=\"\$progdir:\$PATH\"
4254 exec \$program \${1+\"\$@\"}
4259 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
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
4277 # See if we need to build an old-fashioned archive.
4278 for oldlib in $oldlibs; do
4280 if test "$build_libtool_libs" = convenience; then
4281 oldobjs="$libobjs_save"
4282 addlibs="$convenience"
4283 build_libtool_libs=no
4285 if test "$build_libtool_libs" = module; then
4286 oldobjs="$libobjs_save"
4287 build_libtool_libs=no
4289 oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
4291 addlibs="$old_convenience"
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"
4301 if test $status -ne 0 && test ! -d "$gentop"; then
4304 generated="$generated $gentop"
4306 # Add in members from convenience archives.
4307 for xlib in $addlibs; do
4308 # Extract the objects.
4310 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
4311 *) xabs=`pwd`"/$xlib" ;;
4313 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4314 xdir="$gentop/$xlib"
4316 $show "${rm}r $xdir"
4321 if test $status -ne 0 && test ! -d "$xdir"; then
4324 $show "(cd $xdir && $AR x $xabs)"
4325 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4327 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
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\"
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
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 $?
4353 eval cmds=\"$old_archive_cmds\"
4355 save_ifs="$IFS"; IFS='~'
4356 for cmd in $cmds; do
4359 $run eval "$cmd" || exit $?
4364 if test -n "$generated"; then
4365 $show "${rm}r$generated"
4366 $run ${rm}r$generated
4369 # Now create the libtool archive.
4373 test "$build_old_libs" = yes && old_library="$libname.$libext"
4374 $show "creating $output"
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"
4383 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
4384 relink_command="$var=\"$var_value\"; export $var; $relink_command"
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"`
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
4398 output="$output_objdir/$outputname"i
4399 # Replace all uninstalled libtool libraries with the installed ones
4401 for deplib in $dependency_libs; do
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
4410 newdependency_libs="$newdependency_libs $libdir/$name"
4412 *) newdependency_libs="$newdependency_libs $deplib" ;;
4415 dependency_libs="$newdependency_libs"
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
4424 newdlfiles="$newdlfiles $libdir/$name"
4426 dlfiles="$newdlfiles"
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
4435 newdlprefiles="$newdlprefiles $libdir/$name"
4437 dlprefiles="$newdlprefiles"
4440 # place dlname in correct position for cygwin
4442 case $host,$output,$installed,$module,$dlname in
4443 *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
4446 # $outputname - a libtool library file
4447 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
4449 # Please DO NOT delete this file!
4450 # It is necessary for linking the library.
4452 # The name that we can dlopen(3).
4455 # Names of this library.
4456 library_names='$library_names'
4458 # The name of the static archive.
4459 old_library='$old_library'
4461 # Libraries that this one depends upon.
4462 dependency_libs='$dependency_libs'
4464 # Version information for $libname.
4469 # Is this an already installed library?
4470 installed=$installed
4472 # Files to dlopen/dlpreopen
4474 dlpreopen='$dlprefiles'
4476 # Directory that this library needs to be installed in:
4477 libdir='$install_libdir'"
4478 if test "$installed" = no && test $need_relink = yes; then
4480 relink_command=\"$relink_command\""
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 $?
4494 # libtool install mode
4496 modename="$modename: install"
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"`
4506 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4510 install_prog="$arg "
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"`
4522 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4526 install_prog="$install_prog$arg"
4528 # We need to accept at least all the BSD install flags.
4538 if test -n "$dest"; then
4539 files="$files $dest"
4557 # If the previous option needed an argument, then skip it.
4558 if test -n "$prev"; then
4567 # Aesthetically quote the argument.
4568 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
4570 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
4574 install_prog="$install_prog $arg"
4577 if test -z "$install_prog"; then
4578 $echo "$modename: you must specify an install program" 1>&2
4583 if test -n "$prev"; then
4584 $echo "$modename: the \`$prev' option requires an argument" 1>&2
4589 if test -z "$files"; then
4590 if test -z "$dest"; then
4591 $echo "$modename: no file or destination specified" 1>&2
4593 $echo "$modename: you must specify a destination" 1>&2
4599 # Strip any trailing slash from the destination.
4600 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
4602 # Check to see that the destination is a directory.
4603 test -d "$dest" && isdir=yes
4604 if test "$isdir" = yes; then
4608 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
4609 test "X$destdir" = "X$dest" && destdir=.
4610 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
4612 # Not a directory, so check to see that there is only one file specified.
4614 if test $# -gt 2; then
4615 $echo "$modename: \`$dest' is not a directory" 1>&2
4621 [\\/]* | [A-Za-z]:[\\/]*) ;;
4623 for file in $files; do
4627 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
4636 # This variable tells wrapper scripts just to set variables rather
4637 # than running their programs.
4638 libtool_install_magic="$magic"
4643 for file in $files; do
4645 # Do each installation.
4648 # Do the static libraries later.
4649 staticlibs="$staticlibs $file"
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 :
4656 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
4664 # If there is no directory component, then add one.
4666 */* | *\\*) . $file ;;
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
4674 *) current_libdirs="$current_libdirs $libdir" ;;
4677 # Note the libdir as a future libdir.
4678 case "$future_libdirs " in
4680 *) future_libdirs="$future_libdirs $libdir" ;;
4684 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
4685 test "X$dir" = "X$file/" && dir=
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 :
4693 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4698 # See the names of the shared library.
4699 set dummy $library_names
4700 if test -n "$2"; then
4706 test -n "$relink_command" && srcname="$realname"T
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 $?
4716 if test $# -gt 0; then
4717 # Delete the old symlinks, and create new ones.
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)"
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
4734 $run eval "$cmd" || exit $?
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 $?
4745 # Maybe install the static library, too.
4746 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
4750 # Install (i.e. copy) a libtool object.
4752 # Figure out destination file name, if it wasn't already specified.
4753 if test -n "$destname"; then
4754 destfile="$destdir/$destname"
4756 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4757 destfile="$destdir/$destfile"
4760 # Deduce the name of the destination old-style object file.
4763 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
4766 staticdest="$destfile"
4770 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
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 $?
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"`
4787 $show "$install_prog $staticobj $staticdest"
4788 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
4794 # Figure out destination file name, if it wasn't already specified.
4795 if test -n "$destname"; then
4796 destfile="$destdir/$destname"
4798 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4799 destfile="$destdir/$destfile"
4802 # Do a test to see if this is really a libtool program.
4805 wrapper=`echo $file | sed -e 's,.exe$,,'`
4811 if (sed -e '4q' $wrapper | egrep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
4815 # If there is no directory component, then add one.
4817 */* | *\\*) . $wrapper ;;
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
4828 for lib in $notinst_deplibs; do
4829 # Check to see that each library is installed.
4831 if test -f "$lib"; then
4832 # If there is no directory component, then add one.
4834 */* | *\\*) . $lib ;;
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
4846 # If there is no directory component, then add one.
4848 */* | *\\*) . $wrapper ;;
4853 if test "$fast_install" = no && test -n "$relink_command"; then
4854 if test "$finalize" = yes && test -z "$run"; then
4856 test -n "$TMPDIR" && tmpdir="$TMPDIR"
4857 tmpdir="$tmpdir/libtool-$$"
4858 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
4860 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
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'`
4868 $show "$relink_command"
4869 if $run eval "$relink_command"; then :
4871 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
4877 $echo "$modename: warning: cannot relink \`$file'" 1>&2
4880 # Install the binary that we compiled earlier.
4881 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
4885 # remove .exe since cygwin /usr/bin/install will append another
4887 case $install_prog,$host in
4888 /usr/bin/install*,*cygwin*)
4889 case $file:$destfile in
4894 destfile=$destfile.exe
4897 destfile=`echo $destfile | sed -e 's,.exe$,,'`
4902 $show "$install_prog$stripme $file $destfile"
4903 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
4904 test -n "$outputname" && ${rm}r "$tmpdir"
4909 for file in $staticlibs; do
4910 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
4912 # Set up the ranlib parameters.
4913 oldlib="$destdir/$name"
4915 $show "$install_prog $file $oldlib"
4916 $run eval "$install_prog \$file \$oldlib" || exit $?
4918 if test -n "$stripme" && test -n "$striplib"; then
4919 $show "$old_striplib $oldlib"
4920 $run eval "$old_striplib $oldlib" || exit $?
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
4929 $run eval "$cmd" || exit $?
4934 if test -n "$future_libdirs"; then
4935 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
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'
4947 # libtool finish mode
4949 modename="$modename: finish"
4953 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
4956 libdirs="$libdirs $dir"
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
4967 $run eval "$cmd" || admincmds="$admincmds
4972 if test -n "$finish_eval"; then
4973 # Do the single finish_eval.
4974 eval cmds=\"$finish_eval\"
4975 $run eval "$cmds" || admincmds="$admincmds
4981 # Exit here if they wanted silent mode.
4982 test "$show" = ":" && exit 0
4984 echo "----------------------------------------------------------------------"
4985 echo "Libraries have been installed in:"
4986 for libdir in $libdirs; do
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"
4998 if test -n "$runpath_var"; then
4999 echo " - add LIBDIR to the \`$runpath_var' environment variable"
5000 echo " during linking"
5002 if test -n "$hardcode_libdir_flag_spec"; then
5004 eval flag=\"$hardcode_libdir_flag_spec\"
5006 echo " - use the \`$flag' linker flag"
5008 if test -n "$admincmds"; then
5009 echo " - have your system administrator run these commands:$admincmds"
5011 if test -f /etc/ld.so.conf; then
5012 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
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 "----------------------------------------------------------------------"
5021 # libtool execute mode
5023 modename="$modename: execute"
5025 # The first argument is the command name.
5027 if test -z "$cmd"; then
5028 $echo "$modename: you must specify a COMMAND" 1>&2
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
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 :
5047 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
5052 # Read the libtool library.
5056 # If there is no directory component, then add one.
5058 */* | *\\*) . $file ;;
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'"
5069 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5070 test "X$dir" = "X$file" && dir=.
5072 if test -f "$dir/$objdir/$dlname"; then
5075 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5081 # Just add the directory containing the .lo file.
5082 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5083 test "X$dir" = "X$file" && dir=.
5087 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
5092 # Get the absolute pathname.
5093 absdir=`cd "$dir" && pwd`
5094 test -n "$absdir" && dir="$absdir"
5096 # Now add the directory to shlibpath_var.
5097 if eval "test -z \"\$$shlibpath_var\""; then
5098 eval "$shlibpath_var=\"\$dir\""
5100 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
5104 # This variable tells wrapper scripts just to set shlibpath_var
5105 # rather than running their programs.
5106 libtool_execute_magic="$magic"
5108 # Check if any of the arguments is a wrapper script.
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.
5119 */* | *\\*) . $file ;;
5123 # Transform arg to wrapped name.
5124 file="$progdir/$program"
5128 # Quote arguments (to preserve shell metacharacters).
5129 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
5130 args="$args \"$file\""
5133 if test -z "$run"; then
5134 if test -n "$shlibpath_var"; then
5135 # Export the shlibpath_var.
5136 eval "export $shlibpath_var"
5139 # Restore saved enviroment variables
5140 if test "${save_LC_ALL+set}" = set; then
5141 LC_ALL="$save_LC_ALL"; export LC_ALL
5143 if test "${save_LANG+set}" = set; then
5144 LANG="$save_LANG"; export LANG
5147 # Now prepare to actually exec the command.
5148 exec_cmd="\$cmd$args"
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"
5160 # libtool clean and uninstall mode
5162 modename="$modename: $mode"
5168 # This variable tells wrapper scripts just to set variables rather
5169 # than running their programs.
5170 libtool_install_magic="$magic"
5175 -f) rm="$rm $arg"; rmforce=yes ;;
5176 -*) rm="$rm $arg" ;;
5177 *) files="$files $arg" ;;
5181 if test -z "$rm"; then
5182 $echo "$modename: you must specify an RM program" 1>&2
5189 for file in $files; do
5190 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
5191 if test "X$dir" = "X$file"; then
5195 objdir="$dir/$objdir"
5197 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
5198 test $mode = uninstall && objdir="$dir"
5200 # Remember objdir for removal later, being careful to avoid duplicates
5201 if test $mode = clean; then
5204 *) rmdirs="$rmdirs $objdir" ;;
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
5213 elif test -d "$file"; then
5216 elif test "$rmforce" = yes; then
5224 # Possibly a libtool archive, so verify it.
5225 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
5228 # Delete the libtool libraries and symlinks.
5229 for n in $library_names; do
5230 rmfiles="$rmfiles $objdir/$n"
5232 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
5233 test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
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
5244 if test $? != 0 && test "$rmforce" != yes; then
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
5259 if test $? != 0 && test "$rmforce" != yes; then
5265 # FIXME: should reinstall the best remaining shared library.
5271 if test "$build_old_libs" = yes; then
5272 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
5273 rmfiles="$rmfiles $dir/$oldobj"
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
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"
5291 $show "$rm $rmfiles"
5292 $run $rm $rmfiles || exit_status=1
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
5299 $run rmdir $dir >/dev/null 2>&1
5307 $echo "$modename: you must specify a MODE" 1>&2
5308 $echo "$generic_help" 1>&2
5313 if test -z "$exec_cmd"; then
5314 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5315 $echo "$generic_help" 1>&2
5318 fi # test -z "$show_help"
5320 if test -n "$exec_cmd"; then
5325 # We need to display help for each of the modes.
5328 "Usage: $modename [OPTION]... [MODE-ARG]...
5330 Provide generalized library-building support services.
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
5343 MODE must be one of the following:
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
5353 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
5354 a more detailed description of MODE."
5360 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
5362 Remove files from the build directory.
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
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."
5374 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
5376 Compile a source file into a libtool library object.
5378 This mode accepts the following additional options:
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
5385 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
5386 from the given SOURCEFILE.
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'."
5395 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
5397 Automatically set library path, then run a program.
5399 This mode accepts the following additional options:
5401 -dlopen FILE add the directory containing FILE to the library path
5403 This mode sets the library path environment variable according to \`-dlopen'
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.
5410 Then, COMMAND is executed, with ARGS as arguments."
5415 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
5417 Complete the installation of libtool libraries.
5419 Each LIBDIR is a directory that contains libtool libraries.
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."
5427 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
5429 Install executables or libraries.
5431 INSTALL-COMMAND is the installation command. The first component should be
5432 either the \`install' or \`cp' program.
5434 The rest of the components are interpreted as arguments to that command (only
5435 BSD-compatible install options are recognized)."
5440 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
5442 Link object files or libraries together to form another library, or to
5443 create an executable program.
5445 LINK-COMMAND is a command using the C compiler that you would use to create
5446 a program from several object files.
5448 The following components of LINK-COMMAND are treated specially:
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]
5473 All other options (arguments beginning with \`-') are ignored.
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
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.
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'.
5486 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
5487 is created, otherwise an executable program is created."
5492 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
5494 Remove libraries from an installation directory.
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
5500 If FILE is a libtool library, all the files associated with it are deleted.
5501 Otherwise, only FILE itself is deleted using RM."
5505 $echo "$modename: invalid operation mode \`$mode'" 1>&2
5512 $echo "Try \`$modename --help' for more information about other modes."