3 # libtool - Provide generalized library-building support services.
4 # Generated automatically by ltconfig (GNU libtool 1.3.3 (1.385.2.181 1999/07/02 15:49:11))
5 # NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
7 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
8 # 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 "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
36 ### BEGIN LIBTOOL CONFIG
37 # Libtool was configured as follows, on host drwho:
39 # CC="gcc" CFLAGS="-g -O2" CPPFLAGS="" \
40 # LD="/usr/ccs/bin/ld" LDFLAGS="" LIBS="" \
41 # NM="/usr/ccs/bin/nm -p" RANLIB="ranlib" LN_S="ln -s" \
42 # DLLTOOL="" OBJDUMP="" AS="" \
43 # config/ltconfig --cache-file=./config.cache --disable-shared --with-gcc --no-verify config/ltmain.sh sparc-sun-solaris2.6
45 # Compiler and other test output produced by ltconfig, useful for
46 # debugging ltconfig, is in ./config.log if it exists.
48 # The version of ltconfig that generated this script.
49 LTCONFIG_VERSION="1.3.3"
51 # Shell to use when invoking shell scripts.
54 # Whether or not to build shared libraries.
57 # Whether or not to build static libraries.
60 # Whether or not to optimize for fast installation.
64 host_alias=sparc-sun-solaris2.6
65 host=sparc-sun-solaris2.6
67 # An echo program that does not interpret backslashes.
73 # The default C compiler.
76 # The linker used to build libraries.
79 # Whether we need hard or soft links.
82 # A BSD-compatible nm program.
83 NM="/usr/ccs/bin/nm -p"
85 # Used on cygwin: DLL creation program.
88 # Used on cygwin: object dumper.
91 # Used on cygwin: assembler.
94 # The name of the directory that contains temporary libtool files.
97 # How to create reloadable object files.
99 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
101 # How to pass a linker flag through the compiler.
104 # Object file suffix (normally "o").
107 # Old archive suffix (normally "a").
110 # Executable file suffix (normally "").
113 # Additional compiler flags for building library objects.
116 # Does compiler simultaneously support -c and -o options?
119 # Can we write directly to a .lo ?
122 # Must we lock files when doing compilation ?
125 # Do we need the lib prefix for modules?
128 # Do we need a version for libraries?
131 # Whether dlopen is supported.
134 # Whether dlopen of programs is supported.
137 # Whether dlopen of statically linked programs is supported.
138 dlopen_self_static=unknown
140 # Compiler flag to prevent dynamic linking.
141 link_static_flag="-static"
143 # Compiler flag to turn off builtin functions.
144 no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
146 # Compiler flag to allow reflexive dlopens.
147 export_dynamic_flag_spec=""
149 # Compiler flag to generate shared objects directly from archives.
150 whole_archive_flag_spec="-z allextract\$convenience -z defaultextract"
152 # Compiler flag to generate thread-safe objects.
153 thread_safe_flag_spec=""
155 # Library versioning type.
158 # Format of library name prefix.
159 libname_spec="lib\$name"
161 # List of archive names. First name is the real one, the rest are links.
162 # The last name is the one that the linker finds with -lNAME.
163 library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
165 # The coded name of the library, if different from the real name.
166 soname_spec="\${libname}\${release}.so\$major"
168 # Commands used to build and install an old-style archive.
170 old_archive_cmds="\$AR cru \$oldlib\$oldobjs~\$RANLIB \$oldlib"
171 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
172 old_postuninstall_cmds=""
174 # Create an old-style archive from a shared archive.
175 old_archive_from_new_cmds=""
177 # Commands used to build and install a shared archive.
178 archive_cmds="\$LD -G\${allow_undefined_flag} -h \$soname -o \$lib \$libobjs \$deplibs \$linkopts"
179 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$lib.exp~cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$lib.exp~\$echo \\\"local: *; };\\\" >> \$lib.exp~
180 \$LD -G\${allow_undefined_flag} -M \$lib.exp -h \$soname -o \$lib \$libobjs \$deplibs \$linkopts~\$rm \$lib.exp"
181 postinstall_cmds="chmod +x \$lib"
182 postuninstall_cmds=""
184 # Method to check whether dependent libraries are shared objects.
185 deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
187 # Command to use when deplibs_check_method == file_magic.
188 file_magic_cmd="/usr/bin/file"
190 # Flag that allows shared libraries with undefined symbols to be built.
191 allow_undefined_flag=""
193 # Flag that forces no undefined symbols.
194 no_undefined_flag=" -z text"
196 # Commands used to finish a libtool library installation in a directory.
199 # Same as above, but a single script fragment to be evaled but not shown.
202 # Take the output of nm and produce a listing of raw symbols and C names.
203 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([BDT]\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
205 # Transform the output of nm in a proper C declaration
206 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
208 # This is the shared library runtime path variable.
211 # This is the shared library path variable.
212 shlibpath_var=LD_LIBRARY_PATH
214 # Is shlibpath searched before the hard-coded library search path?
215 shlibpath_overrides_runpath=yes
217 # How to hardcode a shared library path into an executable.
218 hardcode_action=immediate
220 # Flag to hardcode $libdir into a binary during linking.
221 # This must work even if $libdir does not exist.
222 hardcode_libdir_flag_spec="-R\$libdir"
224 # Whether we need a single -rpath flag with a separated argument.
225 hardcode_libdir_separator=""
227 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
231 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
235 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
236 # the resulting binary.
237 hardcode_shlibpath_var=no
239 # Compile-time system search path for libraries
240 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
242 # Run-time system search path for libraries
243 sys_lib_dlsearch_path_spec="/lib /usr/lib"
245 # Fix the shell variable $srcfile for the compiler.
248 # Set to yes if exported symbols are required.
249 always_export_symbols=no
251 # The commands to list exported symbols.
252 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
254 # Symbols that should not be listed in the preloaded symbols.
255 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
257 # Symbols that must always be exported.
260 ### END LIBTOOL CONFIG
262 # ltmain.sh - Provide generalized library-building support services.
263 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
265 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
266 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
268 # This program is free software; you can redistribute it and/or modify
269 # it under the terms of the GNU General Public License as published by
270 # the Free Software Foundation; either version 2 of the License, or
271 # (at your option) any later version.
273 # This program is distributed in the hope that it will be useful, but
274 # WITHOUT ANY WARRANTY; without even the implied warranty of
275 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
276 # General Public License for more details.
278 # You should have received a copy of the GNU General Public License
279 # along with this program; if not, write to the Free Software
280 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
282 # As a special exception to the GNU General Public License, if you
283 # distribute this file as part of a program that contains a
284 # configuration script generated by Autoconf, you may include it under
285 # the same distribution terms that you use for the rest of that program.
287 # Check that we have a working $echo.
288 if test "X$1" = X--no-reexec; then
289 # Discard the --no-reexec flag, and continue.
291 elif test "X$1" = X--fallback-echo; then
292 # Avoid inline document here, it may be left over
294 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
295 # Yippee, $echo works!
298 # Restart under the correct shell, and then maybe $echo will work.
299 exec $SHELL "$0" --no-reexec ${1+"$@"}
302 if test "X$1" = X--fallback-echo; then
303 # used as fallback echo
311 # The name of this program.
312 progname=`$echo "$0" | sed 's%^.*/%%'`
319 TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
322 help="Try \`$progname --help' for more information."
323 magic="%%%MAGIC variable%%%"
328 # Sed substitution that helps us do robust quoting. It backslashifies
329 # metacharacters that are still active within double-quoted strings.
330 Xsed='sed -e 1s/^X//'
331 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
333 NL2SP='tr \015\012 \040\040'
336 # Only set LANG and LC_ALL to C if already set.
337 # These must not be set unconditionally because not all systems understand
338 # e.g. LANG=C (notably SCO).
339 # We save the old values to restore during execute mode.
340 if test "${LC_ALL+set}" = set; then
341 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
343 if test "${LANG+set}" = set; then
344 save_LANG="$LANG"; LANG=C; export LANG
347 if test "$LTCONFIG_VERSION" != "$VERSION"; then
348 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
349 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
353 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
354 echo "$modename: not configured to build any kind of library" 1>&2
355 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
368 lo2o="s/\\.lo\$/.${objext}/"
369 o2lo="s/\\.${objext}\$/.lo/"
371 # Parse our command line options once, thoroughly.
378 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
382 # If the previous option needs an argument, assign it.
383 if test -n "$prev"; then
386 eval "$prev=\"\$$prev \$arg\""
398 # Have we seen a non-optional argument yet?
405 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
410 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
415 echo "$progname: enabling shell trace mode"
425 if test "$build_libtool_libs" = yes; then
426 echo "enable shared libraries"
428 echo "disable shared libraries"
430 if test "$build_old_libs" = yes; then
431 echo "enable static libraries"
433 echo "disable static libraries"
438 --finish) mode="finish" ;;
440 --mode) prevopt="--mode" prev=mode ;;
441 --mode=*) mode="$optarg" ;;
453 $echo "$modename: unrecognized option \`$arg'" 1>&2
465 if test -n "$prevopt"; then
466 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
471 if test -z "$show_help"; then
473 # Infer the operation mode.
474 if test -z "$mode"; then
476 *cc | *++ | gcc* | *-gcc*)
488 *db | *dbx | *strace | *truss)
498 # If we have no mode, but dlfiles were specified, then do execute mode.
499 test -n "$execute_dlfiles" && mode=execute
501 # Just use the default operation mode.
502 if test -z "$mode"; then
503 if test -n "$nonopt"; then
504 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
506 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
513 # Only execute mode is allowed to have -dlopen flags.
514 if test -n "$execute_dlfiles" && test "$mode" != execute; then
515 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
520 # Change the help message to a mode-specific one.
522 help="Try \`$modename --help --mode=$mode' for more information."
524 # These modes are in order of execution frequency so that they run quickly.
526 # libtool compile mode
528 modename="$modename: compile"
529 # Get the compilation command and the source file.
538 # Accept any command-line options.
541 if test "$user_target" != "no"; then
542 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
554 case "$user_target" in
556 # The next one is the -o target name
561 # We got the output file
568 # Accept the current argument as the source file.
572 # Aesthetically quote the previous argument.
574 # Backslashify any backslashes, double quotes, and dollar signs.
575 # These are the only characters that are still specially
576 # interpreted inside of double-quoted scrings.
577 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
579 # Double-quote args containing other shell metacharacters.
580 # Many Bourne shells cannot handle close brackets correctly in scan
581 # sets, so we specify it separately.
583 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
584 lastarg="\"$lastarg\""
588 # Add the previous argument to base_compile.
589 if test -z "$base_compile"; then
590 base_compile="$lastarg"
592 base_compile="$base_compile $lastarg"
596 case "$user_target" in
600 # Get the name of the library object.
601 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
604 $echo "$modename: you must specify a target with \`-o'" 1>&2
609 # Recognize several different file suffixes.
610 # If the user specifies -o file.o, it is replaced with file.lo
625 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
628 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
630 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
635 if test -z "$base_compile"; then
636 $echo "$modename: you must specify a compilation command" 1>&2
641 # Delete any leftover library objects.
642 if test "$build_old_libs" = yes; then
643 removelist="$obj $libobj"
649 trap "$run $rm $removelist; exit 1" 1 2 15
651 # Calculate the filename of the output object if compiler does
652 # not support -o with -c
653 if test "$compiler_c_o" = no; then
654 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
655 lockfile="$output_obj.lock"
656 removelist="$removelist $output_obj $lockfile"
657 trap "$run $rm $removelist; exit 1" 1 2 15
663 # Lock this critical section if it is needed
664 # We use this script file to make the link, it avoids creating a new file
665 if test "$need_locks" = yes; then
666 until ln "$0" "$lockfile" 2>/dev/null; do
667 $show "Waiting for $lockfile to be removed"
670 elif test "$need_locks" = warn; then
671 if test -f "$lockfile"; then
673 *** ERROR, $lockfile exists and contains:
674 `cat $lockfile 2>/dev/null`
676 This indicates that another process is trying to use the same
677 temporary object file, and libtool could not work around it because
678 your compiler does not support \`-c' and \`-o' together. If you
679 repeat this compilation, it may succeed, by chance, but you had better
680 avoid parallel builds (make -j) in this platform, or get a better
686 echo $srcfile > "$lockfile"
689 if test -n "$fix_srcfile_path"; then
690 eval srcfile=\"$fix_srcfile_path\"
693 # Only build a PIC object if we are building libtool libraries.
694 if test "$build_libtool_libs" = yes; then
695 # Without this assignment, base_compile gets emptied.
696 fbsd_hideous_sh_bug=$base_compile
698 # All platforms use -DPIC, to notify preprocessed assembler code.
699 command="$base_compile $pic_flag -DPIC $srcfile"
700 if test "$build_old_libs" = yes; then
702 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
703 if test "X$dir" = "X$libobj"; then
708 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
710 if test -d "$dir"; then
717 if test $status -ne 0 && test ! -d $dir; then
722 if test "$compiler_o_lo" = yes; then
724 command="$command -o $output_obj"
725 elif test "$compiler_c_o" = yes; then
727 command="$command -o $output_obj"
730 $run $rm "$output_obj"
732 if $run eval "$command"; then :
734 test -n "$output_obj" && $run $rm $removelist
738 if test "$need_locks" = warn &&
739 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
741 *** ERROR, $lockfile contains:
742 `cat $lockfile 2>/dev/null`
744 but it should contain:
747 This indicates that another process is trying to use the same
748 temporary object file, and libtool could not work around it because
749 your compiler does not support \`-c' and \`-o' together. If you
750 repeat this compilation, it may succeed, by chance, but you had better
751 avoid parallel builds (make -j) in this platform, or get a better
758 # Just move the object if needed, then go on to compile the next one
759 if test x"$output_obj" != x"$libobj"; then
760 $show "$mv $output_obj $libobj"
761 if $run $mv $output_obj $libobj; then :
769 # If we have no pic_flag, then copy the object into place and finish.
770 if test -z "$pic_flag" && test "$build_old_libs" = yes; then
771 # Rename the .lo from within objdir to obj
772 if test -f $obj; then
777 $show "$mv $libobj $obj"
778 if $run $mv $libobj $obj; then :
785 # Now arrange that obj and lo_libobj become the same file
786 $show "$LN_S $obj $lo_libobj"
787 if $run $LN_S $obj $lo_libobj; then
796 # Allow error messages only from the first compilation.
797 suppress_output=' >/dev/null 2>&1'
800 # Only build a position-dependent object if we build old libraries.
801 if test "$build_old_libs" = yes; then
802 command="$base_compile $srcfile"
803 if test "$compiler_c_o" = yes; then
804 command="$command -o $obj"
808 # Suppress compiler output if we already did a PIC compilation.
809 command="$command$suppress_output"
810 $run $rm "$output_obj"
812 if $run eval "$command"; then :
818 if test "$need_locks" = warn &&
819 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
821 *** ERROR, $lockfile contains:
822 `cat $lockfile 2>/dev/null`
824 but it should contain:
827 This indicates that another process is trying to use the same
828 temporary object file, and libtool could not work around it because
829 your compiler does not support \`-c' and \`-o' together. If you
830 repeat this compilation, it may succeed, by chance, but you had better
831 avoid parallel builds (make -j) in this platform, or get a better
838 # Just move the object if needed
839 if test x"$output_obj" != x"$obj"; then
840 $show "$mv $output_obj $obj"
841 if $run $mv $output_obj $obj; then :
849 # Create an invalid libtool object if no PIC, so that we do not
850 # accidentally link it into a program.
851 if test "$build_libtool_libs" != yes; then
852 $show "echo timestamp > $libobj"
853 $run eval "echo timestamp > \$libobj" || exit $?
855 # Move the .lo from within objdir
856 $show "$mv $libobj $lo_libobj"
857 if $run $mv $libobj $lo_libobj; then :
866 # Unlock the critical section if it was locked
867 if test "$need_locks" != no; then
876 modename="$modename: link"
877 C_compiler="$CC" # save it, to compile generated C sources
880 *-*-cygwin* | *-*-mingw* | *-*-os2*)
881 # It is impossible to link a dll without this setting, and
882 # we shouldn't force the makefile maintainer to figure out
883 # which system we are compiling for in order to pass an extra
884 # flag for every libtool invokation.
887 # FIXME: Unfortunately, there are problems with the above when trying
888 # to make a dll which has undefined symbols, in which case not
889 # even a static library is built. For now, we need to specify
890 # -no-undefined on the libtool link line when we can be certain
891 # that all symbols are satisfied, otherwise we get a static library.
894 # This is a source program that is used to create dlls on Windows
895 # Don't remove nor modify the starting and closing comments
896 # /* ltdll.c starts here */
897 # #define WIN32_LEAN_AND_MEAN
898 # #include <windows.h>
899 # #undef WIN32_LEAN_AND_MEAN
903 # # ifdef __CYGWIN32__
904 # # define __CYGWIN__ __CYGWIN32__
911 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
917 # #include <cygwin/cygwin_dll.h>
918 # DECLARE_CYGWIN_DLL( DllMain );
920 # HINSTANCE __hDllInstance_base;
923 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
925 # __hDllInstance_base = hInst;
928 # /* ltdll.c ends here */
929 # This is a source program that is used to create import libraries
930 # on Windows for dlls which lack them. Don't remove nor modify the
931 # starting and closing comments
932 # /* impgen.c starts here */
933 # /* Copyright (C) 1999 Free Software Foundation, Inc.
935 # This file is part of GNU libtool.
937 # This program is free software; you can redistribute it and/or modify
938 # it under the terms of the GNU General Public License as published by
939 # the Free Software Foundation; either version 2 of the License, or
940 # (at your option) any later version.
942 # This program is distributed in the hope that it will be useful,
943 # but WITHOUT ANY WARRANTY; without even the implied warranty of
944 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
945 # GNU General Public License for more details.
947 # You should have received a copy of the GNU General Public License
948 # along with this program; if not, write to the Free Software
949 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
952 # #include <stdio.h> /* for printf() */
953 # #include <unistd.h> /* for open(), lseek(), read() */
954 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
955 # #include <string.h> /* for strdup() */
957 # static unsigned int
958 # pe_get16 (fd, offset)
962 # unsigned char b[2];
963 # lseek (fd, offset, SEEK_SET);
965 # return b[0] + (b[1]<<8);
968 # static unsigned int
969 # pe_get32 (fd, offset)
973 # unsigned char b[4];
974 # lseek (fd, offset, SEEK_SET);
976 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
979 # static unsigned int
983 # unsigned char *b = ptr;
984 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
993 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
994 # unsigned long export_rva, export_size, nsections, secptr, expptr;
995 # unsigned long name_rvas, nexp;
996 # unsigned char *expdata, *erva;
997 # char *filename, *dll_name;
999 # filename = argv[1];
1001 # dll = open(filename, O_RDONLY|O_BINARY);
1005 # dll_name = filename;
1007 # for (i=0; filename[i]; i++)
1008 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
1009 # dll_name = filename + i +1;
1011 # pe_header_offset = pe_get32 (dll, 0x3c);
1012 # opthdr_ofs = pe_header_offset + 4 + 20;
1013 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
1015 # if (num_entries < 1) /* no exports */
1018 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
1019 # export_size = pe_get32 (dll, opthdr_ofs + 100);
1020 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
1021 # secptr = (pe_header_offset + 4 + 20 +
1022 # pe_get16 (dll, pe_header_offset + 4 + 16));
1025 # for (i = 0; i < nsections; i++)
1028 # unsigned long secptr1 = secptr + 40 * i;
1029 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
1030 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
1031 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
1032 # lseek(dll, secptr1, SEEK_SET);
1033 # read(dll, sname, 8);
1034 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
1036 # expptr = fptr + (export_rva - vaddr);
1037 # if (export_rva + export_size > vaddr + vsize)
1038 # export_size = vsize - (export_rva - vaddr);
1043 # expdata = (unsigned char*)malloc(export_size);
1044 # lseek (dll, expptr, SEEK_SET);
1045 # read (dll, expdata, export_size);
1046 # erva = expdata - export_rva;
1048 # nexp = pe_as32 (expdata+24);
1049 # name_rvas = pe_as32 (expdata+32);
1051 # printf ("EXPORTS\n");
1052 # for (i = 0; i<nexp; i++)
1054 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
1055 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
1060 # /* impgen.c ends here */
1066 compile_command="$CC"
1067 finalize_command="$CC"
1078 if test -n "$shlibpath_var"; then
1079 # get the directories listed in $shlibpath_var
1080 eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1084 # now prepend the system-specific ones
1085 eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
1086 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1094 export_symbols_regex=
1097 link_against_libtool_libs=
1101 prefer_static_libs=no
1113 # We need to know -static, to get the right output filenames.
1117 -all-static | -static)
1118 if test "X$arg" = "X-all-static"; then
1119 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1120 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1122 if test -n "$link_static_flag"; then
1123 dlopen_self=$dlopen_self_static
1126 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1127 dlopen_self=$dlopen_self_static
1130 build_libtool_libs=no
1132 prefer_static_libs=yes
1138 # See if our shared archives depend on static archives.
1139 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1141 # Go through the arguments, transforming them on the way.
1142 while test $# -gt 0; do
1146 # If the previous option needs an argument, assign it.
1147 if test -n "$prev"; then
1150 compile_command="$compile_command @OUTPUT@"
1151 finalize_command="$finalize_command @OUTPUT@"
1157 if test "$preload" = no; then
1158 # Add the symbol object into the linking commands.
1159 compile_command="$compile_command @SYMFILE@"
1160 finalize_command="$finalize_command @SYMFILE@"
1164 *.la | *.lo) ;; # We handle these cases below.
1166 if test "$dlself" = no; then
1174 if test "$prev" = dlprefiles; then
1176 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1186 if test "$prev" = dlfiles; then
1187 dlfiles="$dlfiles $arg"
1189 dlprefiles="$dlprefiles $arg"
1196 export_symbols="$arg"
1197 if test ! -f "$arg"; then
1198 $echo "$modename: symbol file \`$arg' does not exist"
1205 export_symbols_regex="$arg"
1215 # We need an absolute path.
1217 [\\/]* | [A-Za-z]:[\\/]*) ;;
1219 $echo "$modename: only absolute run-paths are allowed" 1>&2
1223 if test "$prev" = rpath; then
1226 *) rpath="$rpath $arg" ;;
1231 *) xrpath="$xrpath $arg" ;;
1238 eval "$prev=\"\$arg\""
1249 if test -n "$link_static_flag"; then
1250 compile_command="$compile_command $link_static_flag"
1251 finalize_command="$finalize_command $link_static_flag"
1257 # FIXME: remove this flag sometime in the future.
1258 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1282 -export-symbols | -export-symbols-regex)
1283 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1284 $echo "$modename: not more than one -exported-symbols argument allowed"
1287 if test "X$arg" = "X-export-symbols"; then
1296 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1297 # We need an absolute path.
1299 [\\/]* | [A-Za-z]:[\\/]*) ;;
1301 absdir=`cd "$dir" && pwd`
1302 if test -z "$absdir"; then
1303 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1304 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1310 case " $deplibs " in
1312 *) deplibs="$deplibs $arg";;
1314 case " $lib_search_path " in
1316 *) lib_search_path="$lib_search_path $dir";;
1319 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1320 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1321 case ":$dllsearchpath:" in
1322 ::) dllsearchpath="$dllsearchdir";;
1323 *":$dllsearchdir:"*) ;;
1324 *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
1331 if test "$arg" = "-lc"; then
1333 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1334 # These systems don't actually have c library (as such)
1338 elif test "$arg" = "-lm"; then
1340 *-*-cygwin* | *-*-beos*)
1341 # These systems don't actually have math library (as such)
1346 deplibs="$deplibs $arg"
1377 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1378 # We need an absolute path.
1380 [\\/]* | [A-Za-z]:[\\/]*) ;;
1382 $echo "$modename: only absolute run-paths are allowed" 1>&2
1388 *) xrpath="$xrpath $dir" ;;
1394 # If we have no pic_flag, then this is the same as -all-static.
1395 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1396 compile_command="$compile_command $link_static_flag"
1397 finalize_command="$finalize_command $link_static_flag"
1412 # Some other compiler flag.
1414 # Unknown arguments in both finalize_command and compile_command need
1415 # to be aesthetically quoted because they are evaled later.
1416 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1418 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1424 *.o | *.obj | *.a | *.lib)
1425 # A standard object.
1431 if test "$prev" = dlfiles; then
1432 dlfiles="$dlfiles $arg"
1433 if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
1437 # If libtool objects are unsupported, then we need to preload.
1442 if test "$prev" = dlprefiles; then
1443 # Preload the old-style object.
1444 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1447 libobjs="$libobjs $arg"
1451 # A libtool-controlled library.
1458 # Check to see that this really is a libtool archive.
1459 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1461 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
1465 # If the library was installed with an old release of libtool,
1466 # it will not redefine variable installed.
1470 # If there is no directory component, then add one.
1472 */* | *\\*) . $arg ;;
1476 # Get the name of the library we link against.
1478 for l in $old_library $library_names; do
1482 if test -z "$linklib"; then
1483 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
1487 # Find the relevant object directory and library name.
1488 name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
1490 if test "X$installed" = Xyes; then
1493 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1494 if test "X$dir" = "X$arg"; then
1501 if test -n "$dependency_libs"; then
1502 # Extract -R and -L from dependency_libs
1504 for deplib in $dependency_libs; do
1506 -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1507 case " $rpath $xrpath " in
1508 *" $temp_xrpath "*) ;;
1509 *) xrpath="$xrpath $temp_xrpath";;
1511 -L*) case "$compile_command $temp_deplibs " in
1513 *) temp_deplibs="$temp_deplibs $deplib";;
1515 temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1516 case " $lib_search_path " in
1518 *) lib_search_path="$lib_search_path $temp_dir";;
1521 *) temp_deplibs="$temp_deplibs $deplib";;
1524 dependency_libs="$temp_deplibs"
1527 if test -z "$libdir"; then
1528 # It is a libtool convenience library, so add in its objects.
1529 convenience="$convenience $dir/$old_library"
1530 old_convenience="$old_convenience $dir/$old_library"
1531 deplibs="$deplibs$dependency_libs"
1532 compile_command="$compile_command $dir/$old_library$dependency_libs"
1533 finalize_command="$finalize_command $dir/$old_library$dependency_libs"
1537 # This library was specified with -dlopen.
1538 if test "$prev" = dlfiles; then
1539 dlfiles="$dlfiles $arg"
1540 if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
1541 # If there is no dlname, no dlopen support or we're linking statically,
1542 # we need to preload.
1545 # We should not create a dependency on this library, but we
1546 # may need any libraries it requires.
1547 compile_command="$compile_command$dependency_libs"
1548 finalize_command="$finalize_command$dependency_libs"
1554 # The library was specified with -dlpreopen.
1555 if test "$prev" = dlprefiles; then
1556 # Prefer using a static library (so that no silly _DYNAMIC symbols
1557 # are required to link).
1558 if test -n "$old_library"; then
1559 dlprefiles="$dlprefiles $dir/$old_library"
1561 dlprefiles="$dlprefiles $dir/$linklib"
1566 if test -n "$library_names" &&
1567 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1568 link_against_libtool_libs="$link_against_libtool_libs $arg"
1569 if test -n "$shlibpath_var"; then
1570 # Make sure the rpath contains only unique directories.
1571 case "$temp_rpath " in
1573 *) temp_rpath="$temp_rpath $dir" ;;
1577 # We need an absolute path.
1579 [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
1581 absdir=`cd "$dir" && pwd`
1582 if test -z "$absdir"; then
1583 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1584 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1590 # This is the magic to use -rpath.
1591 # Skip directories that are in the system default run-time
1592 # search path, unless they have been requested with -R.
1593 case " $sys_lib_dlsearch_path " in
1596 case "$compile_rpath " in
1598 *) compile_rpath="$compile_rpath $absdir"
1603 case " $sys_lib_dlsearch_path " in
1606 case "$finalize_rpath " in
1608 *) finalize_rpath="$finalize_rpath $libdir"
1614 case "$hardcode_action" in
1615 immediate | unsupported)
1616 if test "$hardcode_direct" = no; then
1617 compile_command="$compile_command $dir/$linklib"
1618 deplibs="$deplibs $dir/$linklib"
1620 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1621 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1622 if test -n "$dllsearchpath"; then
1623 dllsearchpath="$dllsearchpath:$dllsearchdir"
1625 dllsearchpath="$dllsearchdir"
1629 elif test "$hardcode_minus_L" = no; then
1632 compile_shlibpath="$compile_shlibpath$dir:"
1635 case "$compile_command " in
1637 *) compile_command="$compile_command -L$dir";;
1639 compile_command="$compile_command -l$name"
1640 deplibs="$deplibs -L$dir -l$name"
1641 elif test "$hardcode_shlibpath_var" = no; then
1642 case ":$compile_shlibpath:" in
1644 *) compile_shlibpath="$compile_shlibpath$dir:";;
1646 compile_command="$compile_command -l$name"
1647 deplibs="$deplibs -l$name"
1654 if test "$hardcode_direct" = yes; then
1655 compile_command="$compile_command $absdir/$linklib"
1656 deplibs="$deplibs $absdir/$linklib"
1657 elif test "$hardcode_minus_L" = yes; then
1658 case "$compile_command " in
1660 *) compile_command="$compile_command -L$absdir";;
1662 compile_command="$compile_command -l$name"
1663 deplibs="$deplibs -L$absdir -l$name"
1664 elif test "$hardcode_shlibpath_var" = yes; then
1665 case ":$compile_shlibpath:" in
1667 *) compile_shlibpath="$compile_shlibpath$absdir:";;
1669 compile_command="$compile_command -l$name"
1670 deplibs="$deplibs -l$name"
1681 if test "$lib_linked" != yes; then
1682 $echo "$modename: configuration error: unsupported hardcode properties"
1686 # Finalize command for both is simple: just hardcode it.
1687 if test "$hardcode_direct" = yes; then
1688 finalize_command="$finalize_command $libdir/$linklib"
1689 elif test "$hardcode_minus_L" = yes; then
1690 case "$finalize_command " in
1692 *) finalize_command="$finalize_command -L$libdir";;
1694 finalize_command="$finalize_command -l$name"
1695 elif test "$hardcode_shlibpath_var" = yes; then
1696 case ":$finalize_shlibpath:" in
1698 *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
1700 finalize_command="$finalize_command -l$name"
1702 # We cannot seem to hardcode it, guess we'll fake it.
1703 case "$finalize_command " in
1705 *) finalize_command="$finalize_command -L$libdir";;
1707 finalize_command="$finalize_command -l$name"
1710 # Transform directly to old archives if we don't build new libraries.
1711 if test -n "$pic_flag" && test -z "$old_library"; then
1712 $echo "$modename: cannot find static library for \`$arg'" 1>&2
1716 # Here we assume that one of hardcode_direct or hardcode_minus_L
1717 # is not unsupported. This is valid on all known static and
1719 if test "$hardcode_direct" != unsupported; then
1720 test -n "$old_library" && linklib="$old_library"
1721 compile_command="$compile_command $dir/$linklib"
1722 finalize_command="$finalize_command $dir/$linklib"
1724 case "$compile_command " in
1726 *) compile_command="$compile_command -L$dir";;
1728 compile_command="$compile_command -l$name"
1729 case "$finalize_command " in
1731 *) finalize_command="$finalize_command -L$dir";;
1733 finalize_command="$finalize_command -l$name"
1737 # Add in any libraries that this one depends upon.
1738 compile_command="$compile_command$dependency_libs"
1739 finalize_command="$finalize_command$dependency_libs"
1743 # Some other compiler argument.
1745 # Unknown arguments in both finalize_command and compile_command need
1746 # to be aesthetically quoted because they are evaled later.
1747 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1749 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1756 # Now actually substitute the argument into the commands.
1757 if test -n "$arg"; then
1758 compile_command="$compile_command $arg"
1759 finalize_command="$finalize_command $arg"
1763 if test -n "$prev"; then
1764 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1769 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1770 eval arg=\"$export_dynamic_flag_spec\"
1771 compile_command="$compile_command $arg"
1772 finalize_command="$finalize_command $arg"
1776 # calculate the name of the file, without its directory
1777 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1778 libobjs_save="$libobjs"
1782 $echo "$modename: you must specify an output file" 1>&2
1788 if test -n "$link_against_libtool_libs"; then
1789 $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
1793 if test -n "$deplibs"; then
1794 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1797 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1798 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1801 if test -n "$rpath"; then
1802 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
1805 if test -n "$xrpath"; then
1806 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
1809 if test -n "$vinfo"; then
1810 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1813 if test -n "$release"; then
1814 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
1817 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1818 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1821 # Now set the variables for building old libraries.
1822 build_libtool_libs=no
1827 # Make sure we only generate libraries of the form `libNAME.la'.
1828 case "$outputname" in
1830 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1831 eval libname=\"$libname_spec\"
1834 if test "$module" = no; then
1835 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
1839 if test "$need_lib_prefix" != no; then
1840 # Add the "lib" prefix for modules if required
1841 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1842 eval libname=\"$libname_spec\"
1844 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1849 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1850 if test "X$output_objdir" = "X$output"; then
1851 output_objdir="$objdir"
1853 output_objdir="$output_objdir/$objdir"
1856 if test -n "$objs"; then
1857 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1861 # How the heck are we supposed to write a wrapper for a shared library?
1862 if test -n "$link_against_libtool_libs"; then
1863 $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
1867 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1868 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1872 if test $# -gt 2; then
1873 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1878 if test -z "$rpath"; then
1879 if test "$build_libtool_libs" = yes; then
1880 # Building a libtool convenience library.
1882 oldlibs="$output_objdir/$libname.$libext $oldlibs"
1883 build_libtool_libs=convenience
1886 dependency_libs="$deplibs"
1888 if test -n "$vinfo"; then
1889 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1892 if test -n "$release"; then
1893 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1897 # Parse the version information argument.
1898 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
1899 set dummy $vinfo 0 0 0
1902 if test -n "$8"; then
1903 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1912 # Check that each of the things are valid numbers.
1914 0 | [1-9] | [1-9][0-9]*) ;;
1916 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1917 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1923 0 | [1-9] | [1-9][0-9]*) ;;
1925 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1926 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1932 0 | [1-9] | [1-9][0-9]*) ;;
1934 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1935 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1940 if test $age -gt $current; then
1941 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1942 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1946 # Calculate the version variables.
1950 case "$version_type" in
1954 major=`expr $current - $age + 1`
1955 versuffix="$major.$revision"
1956 verstring="sgi$major.$revision"
1958 # Add in all the interfaces that we are compatible with.
1960 while test $loop != 0; do
1961 iface=`expr $revision - $loop`
1962 loop=`expr $loop - 1`
1963 verstring="sgi$major.$iface:$verstring"
1968 major=.`expr $current - $age`
1969 versuffix="$major.$age.$revision"
1973 major=`expr $current - $age`
1974 versuffix=".$current.$age.$revision"
1975 verstring="$current.$age.$revision"
1977 # Add in all the interfaces that we are compatible with.
1979 while test $loop != 0; do
1980 iface=`expr $current - $loop`
1981 loop=`expr $loop - 1`
1982 verstring="$verstring:${iface}.0"
1985 # Make executables depend on our current version.
1986 verstring="$verstring:${current}.0"
1991 versuffix=".$current.$revision"
1996 versuffix=".$current.$revision";
2001 versuffix=".$current";
2005 # Like Linux, but with '-' rather than '.', since we only
2006 # want one extension on Windows 95.
2007 major=`expr $current - $age`
2008 versuffix="-$major-$age-$revision"
2012 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2013 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2018 # Clear the version info if we defaulted, and they specified a release.
2019 if test -z "$vinfo" && test -n "$release"; then
2022 if test "$need_version" = no; then
2029 # Remove version info from name if versioning should be avoided
2030 if test "$avoid_version" = yes && test "$need_version" = no; then
2036 # Check to see if the archive will have undefined symbols.
2037 if test "$allow_undefined" = yes; then
2038 if test "$allow_undefined_flag" = unsupported; then
2039 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2040 build_libtool_libs=no
2044 # Don't allow undefined symbols.
2045 allow_undefined_flag="$no_undefined_flag"
2048 dependency_libs="$deplibs"
2050 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
2051 # these systems don't actually have a c library (as such)!
2054 # Add libc to deplibs on all other systems.
2055 deplibs="$deplibs -lc"
2060 # Create the output directory, or remove our outputs if we need to.
2061 if test -d $output_objdir; then
2062 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2063 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2065 $show "$mkdir $output_objdir"
2066 $run $mkdir $output_objdir
2068 if test $status -ne 0 && test ! -d $output_objdir; then
2073 # Now set the variables for building old libraries.
2074 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2075 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2077 # Transform .lo files to .o files.
2078 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2081 if test "$build_libtool_libs" = yes; then
2082 # Transform deplibs into only deplibs that can be linked in shared.
2084 libname_save=$libname
2085 release_save=$release
2086 versuffix_save=$versuffix
2088 # I'm not sure if I'm treating the release correctly. I think
2089 # release should show up in the -l (ie -lgmp5) so we don't want to
2090 # add it in twice. Is that correct?
2096 case "$deplibs_check_method" in
2098 # Don't check for shared/static. Everything works.
2099 # This might be a little naive. We might want to check
2100 # whether the library exists or not. But this is on
2101 # osf3 & osf4 and I'm not really sure... Just
2102 # implementing what was already the behaviour.
2106 # This code stresses the "libraries are programs" paradigm to its
2107 # limits. Maybe even breaks it. We compile a program, linking it
2108 # against the deplibs as a proxy for the library. Then we can check
2109 # whether they linked in statically or dynamically with ldd.
2111 cat > conftest.c <<EOF
2112 int main() { return 0; }
2115 $C_compiler -o conftest conftest.c $deplibs
2116 if test $? -eq 0 ; then
2117 ldd_output=`ldd conftest`
2118 for i in $deplibs; do
2119 name="`expr $i : '-l\(.*\)'`"
2120 # If $name is empty we are operating on a -L argument.
2121 if test "$name" != "" ; then
2122 libname=`eval \\$echo \"$libname_spec\"`
2123 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2124 set dummy $deplib_matches
2126 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2127 newdeplibs="$newdeplibs $i"
2131 echo "*** Warning: This library needs some functionality provided by $i."
2132 echo "*** I have the capability to make that library automatically link in when"
2133 echo "*** you link to this library. But I can only do this if you have a"
2134 echo "*** shared version of the library, which you do not appear to have."
2137 newdeplibs="$newdeplibs $i"
2141 # Error occured in the first compile. Let's try to salvage the situation:
2142 # Compile a seperate program for each library.
2143 for i in $deplibs; do
2144 name="`expr $i : '-l\(.*\)'`"
2145 # If $name is empty we are operating on a -L argument.
2146 if test "$name" != "" ; then
2148 $C_compiler -o conftest conftest.c $i
2150 if test $? -eq 0 ; then
2151 ldd_output=`ldd conftest`
2152 libname=`eval \\$echo \"$libname_spec\"`
2153 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2154 set dummy $deplib_matches
2156 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2157 newdeplibs="$newdeplibs $i"
2161 echo "*** Warning: This library needs some functionality provided by $i."
2162 echo "*** I have the capability to make that library automatically link in when"
2163 echo "*** you link to this library. But I can only do this if you have a"
2164 echo "*** shared version of the library, which you do not appear to have."
2169 echo "*** Warning! Library $i is needed by this library but I was not able to"
2170 echo "*** make it link in! You will probably need to install it or some"
2171 echo "*** library that it depends on before this library will be fully"
2172 echo "*** functional. Installing it before continuing would be even better."
2175 newdeplibs="$newdeplibs $i"
2181 set dummy $deplibs_check_method
2182 file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
2183 for a_deplib in $deplibs; do
2184 name="`expr $a_deplib : '-l\(.*\)'`"
2185 # If $name is empty we are operating on a -L argument.
2186 if test "$name" != "" ; then
2187 libname=`eval \\$echo \"$libname_spec\"`
2188 for i in $lib_search_path; do
2189 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2190 for potent_lib in $potential_libs; do
2191 # Follow soft links.
2192 if ls -lLd "$potent_lib" 2>/dev/null \
2193 | grep " -> " >/dev/null; then
2196 # The statement above tries to avoid entering an
2197 # endless loop below, in case of cyclic links.
2198 # We might still enter an endless loop, since a link
2199 # loop can be closed while we follow links,
2201 potlib="$potent_lib"
2202 while test -h "$potlib" 2>/dev/null; do
2203 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2204 case "$potliblink" in
2205 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2206 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2209 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2211 | egrep "$file_magic_regex" > /dev/null; then
2212 newdeplibs="$newdeplibs $a_deplib"
2218 if test -n "$a_deplib" ; then
2221 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2222 echo "*** I have the capability to make that library automatically link in when"
2223 echo "*** you link to this library. But I can only do this if you have a"
2224 echo "*** shared version of the library, which you do not appear to have."
2227 # Add a -L argument.
2228 newdeplibs="$newdeplibs $a_deplib"
2230 done # Gone through all deplibs.
2234 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2235 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2236 grep . >/dev/null; then
2238 if test "X$deplibs_check_method" = "Xnone"; then
2239 echo "*** Warning: inter-library dependencies are not supported in this platform."
2241 echo "*** Warning: inter-library dependencies are not known to be supported."
2243 echo "*** All declared inter-library dependencies are being dropped."
2248 versuffix=$versuffix_save
2250 release=$release_save
2251 libname=$libname_save
2254 if test "$droppeddeps" = yes; then
2255 if test "$module" = yes; then
2257 echo "*** Warning: libtool could not satisfy all declared inter-library"
2258 echo "*** dependencies of module $libname. Therefore, libtool will create"
2259 echo "*** a static module, that should work as long as the dlopening"
2260 echo "*** application is linked with the -dlopen flag."
2261 if test -z "$global_symbol_pipe"; then
2263 echo "*** However, this would only work if libtool was able to extract symbol"
2264 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2265 echo "*** not find such a program. So, this module is probably useless."
2266 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2268 if test "$build_old_libs" = no; then
2269 oldlibs="$output_objdir/$libname.$libext"
2270 build_libtool_libs=module
2273 build_libtool_libs=no
2276 echo "*** The inter-library dependencies that have been dropped here will be"
2277 echo "*** automatically added whenever a program is linked with this library"
2278 echo "*** or is declared to -dlopen it."
2281 # Done checking deplibs!
2285 # All the library-specific variables (install_libdir is set above).
2290 # Test again, we may have decided not to build it any more
2291 if test "$build_libtool_libs" = yes; then
2292 # Get the real and link names of the library.
2293 eval library_names=\"$library_names_spec\"
2294 set dummy $library_names
2298 if test -n "$soname_spec"; then
2299 eval soname=\"$soname_spec\"
2304 lib="$output_objdir/$realname"
2307 linknames="$linknames $link"
2310 # Ensure that we have .o objects for linkers which dislike .lo
2311 # (e.g. aix) incase we are running --disable-static
2312 for obj in $libobjs; do
2313 oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
2314 if test ! -f $oldobj; then
2315 $show "${LN_S} $obj $oldobj"
2316 $run ${LN_S} $obj $oldobj || exit $?
2320 # Use standard objects if they are pic
2321 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2323 # Prepare the list of exported symbols
2324 if test -z "$export_symbols"; then
2325 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2326 $show "generating symbol list for \`$libname.la'"
2327 export_symbols="$output_objdir/$libname.exp"
2328 $run $rm $export_symbols
2329 eval cmds=\"$export_symbols_cmds\"
2330 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2331 for cmd in $cmds; do
2334 $run eval "$cmd" || exit $?
2337 if test -n "$export_symbols_regex"; then
2338 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2339 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2340 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2341 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2346 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2347 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2350 if test -n "$convenience"; then
2351 if test -n "$whole_archive_flag_spec"; then
2352 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2354 gentop="$output_objdir/${outputname}x"
2355 $show "${rm}r $gentop"
2356 $run ${rm}r "$gentop"
2357 $show "mkdir $gentop"
2358 $run mkdir "$gentop"
2360 if test $status -ne 0 && test ! -d "$gentop"; then
2363 generated="$generated $gentop"
2365 for xlib in $convenience; do
2366 # Extract the objects.
2368 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2369 *) xabs=`pwd`"/$xlib" ;;
2371 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2372 xdir="$gentop/$xlib"
2374 $show "${rm}r $xdir"
2379 if test $status -ne 0 && test ! -d "$xdir"; then
2382 $show "(cd $xdir && $AR x $xabs)"
2383 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2385 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2390 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2391 eval flag=\"$thread_safe_flag_spec\"
2392 linkopts="$linkopts $flag"
2395 # Do each of the archive commands.
2396 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2397 eval cmds=\"$archive_expsym_cmds\"
2399 eval cmds=\"$archive_cmds\"
2401 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2402 for cmd in $cmds; do
2405 $run eval "$cmd" || exit $?
2409 # Create links to the real library.
2410 for linkname in $linknames; do
2411 if test "$realname" != "$linkname"; then
2412 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2413 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2417 # If -module or -export-dynamic was specified, set the dlname.
2418 if test "$module" = yes || test "$export_dynamic" = yes; then
2419 # On all known operating systems, these are identical.
2426 if test -n "$link_against_libtool_libs"; then
2427 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
2431 if test -n "$deplibs"; then
2432 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2435 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2436 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2439 if test -n "$rpath"; then
2440 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2443 if test -n "$xrpath"; then
2444 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2447 if test -n "$vinfo"; then
2448 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2451 if test -n "$release"; then
2452 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2457 if test -n "$objs"; then
2458 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2462 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2470 # Delete the old objects.
2471 $run $rm $obj $libobj
2473 # Objects from convenience libraries. This assumes
2474 # single-version convenience libraries. Whenever we create
2475 # different ones for PIC/non-PIC, this we'll have to duplicate
2479 # reload_cmds runs $LD directly, so let us get rid of
2480 # -Wl from whole_archive_flag_spec
2483 if test -n "$convenience"; then
2484 if test -n "$whole_archive_flag_spec"; then
2485 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2487 gentop="$output_objdir/${obj}x"
2488 $show "${rm}r $gentop"
2489 $run ${rm}r "$gentop"
2490 $show "mkdir $gentop"
2491 $run mkdir "$gentop"
2493 if test $status -ne 0 && test ! -d "$gentop"; then
2496 generated="$generated $gentop"
2498 for xlib in $convenience; do
2499 # Extract the objects.
2501 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2502 *) xabs=`pwd`"/$xlib" ;;
2504 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2505 xdir="$gentop/$xlib"
2507 $show "${rm}r $xdir"
2512 if test $status -ne 0 && test ! -d "$xdir"; then
2515 $show "(cd $xdir && $AR x $xabs)"
2516 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2518 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2523 # Create the old-style object.
2524 reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
2527 eval cmds=\"$reload_cmds\"
2528 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2529 for cmd in $cmds; do
2532 $run eval "$cmd" || exit $?
2536 # Exit if we aren't doing a library object file.
2537 if test -z "$libobj"; then
2538 if test -n "$gentop"; then
2539 $show "${rm}r $gentop"
2546 if test "$build_libtool_libs" != yes; then
2547 if test -n "$gentop"; then
2548 $show "${rm}r $gentop"
2552 # Create an invalid libtool object if no PIC, so that we don't
2553 # accidentally link it into a program.
2554 $show "echo timestamp > $libobj"
2555 $run eval "echo timestamp > $libobj" || exit $?
2559 if test -n "$pic_flag"; then
2560 # Only do commands if we really have different PIC objects.
2561 reload_objs="$libobjs $reload_conv_objs"
2563 eval cmds=\"$reload_cmds\"
2564 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2565 for cmd in $cmds; do
2568 $run eval "$cmd" || exit $?
2572 # Just create a symlink.
2575 $show "$LN_S $obj $libobj"
2576 $run $LN_S $obj $libobj || exit $?
2579 if test -n "$gentop"; then
2580 $show "${rm}r $gentop"
2587 # Anything else should be a program.
2589 if test -n "$vinfo"; then
2590 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2593 if test -n "$release"; then
2594 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2597 if test "$preload" = yes; then
2598 if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
2599 test "$dlopen_self_static" = unknown; then
2600 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2604 if test -n "$rpath$xrpath"; then
2605 # If the user specified any rpath flags, then add them.
2606 for libdir in $rpath $xrpath; do
2607 # This is the magic to use -rpath.
2608 case "$compile_rpath " in
2610 *) compile_rpath="$compile_rpath $libdir" ;;
2612 case "$finalize_rpath " in
2614 *) finalize_rpath="$finalize_rpath $libdir" ;;
2619 # Now hardcode the library paths
2622 for libdir in $compile_rpath $finalize_rpath; do
2623 if test -n "$hardcode_libdir_flag_spec"; then
2624 if test -n "$hardcode_libdir_separator"; then
2625 if test -z "$hardcode_libdirs"; then
2626 hardcode_libdirs="$libdir"
2628 # Just accumulate the unique libdirs.
2629 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2630 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2633 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2638 eval flag=\"$hardcode_libdir_flag_spec\"
2639 rpath="$rpath $flag"
2641 elif test -n "$runpath_var"; then
2642 case "$perm_rpath " in
2644 *) perm_rpath="$perm_rpath $libdir" ;;
2648 # Substitute the hardcoded libdirs into the rpath.
2649 if test -n "$hardcode_libdir_separator" &&
2650 test -n "$hardcode_libdirs"; then
2651 libdir="$hardcode_libdirs"
2652 eval rpath=\" $hardcode_libdir_flag_spec\"
2654 compile_rpath="$rpath"
2658 for libdir in $finalize_rpath; do
2659 if test -n "$hardcode_libdir_flag_spec"; then
2660 if test -n "$hardcode_libdir_separator"; then
2661 if test -z "$hardcode_libdirs"; then
2662 hardcode_libdirs="$libdir"
2664 # Just accumulate the unique libdirs.
2665 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2666 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2669 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2674 eval flag=\"$hardcode_libdir_flag_spec\"
2675 rpath="$rpath $flag"
2677 elif test -n "$runpath_var"; then
2678 case "$finalize_perm_rpath " in
2680 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
2684 # Substitute the hardcoded libdirs into the rpath.
2685 if test -n "$hardcode_libdir_separator" &&
2686 test -n "$hardcode_libdirs"; then
2687 libdir="$hardcode_libdirs"
2688 eval rpath=\" $hardcode_libdir_flag_spec\"
2690 finalize_rpath="$rpath"
2692 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2693 if test "X$output_objdir" = "X$output"; then
2694 output_objdir="$objdir"
2696 output_objdir="$output_objdir/$objdir"
2699 # Create the binary in the object directory, then wrap it.
2700 if test ! -d $output_objdir; then
2701 $show "$mkdir $output_objdir"
2702 $run $mkdir $output_objdir
2704 if test $status -ne 0 && test ! -d $output_objdir; then
2709 if test -n "$libobjs" && test "$build_old_libs" = yes; then
2710 # Transform all the library objects into standard objects.
2711 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2712 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2716 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2717 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2718 dlsyms="${outputname}S.c"
2720 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
2724 if test -n "$dlsyms"; then
2728 # Discover the nlist of each of the dlfiles.
2729 nlist="$output_objdir/${outputname}.nm"
2731 $show "$rm $nlist ${nlist}S ${nlist}T"
2732 $run $rm "$nlist" "${nlist}S" "${nlist}T"
2734 # Parse the name list into a source file.
2735 $show "creating $output_objdir/$dlsyms"
2737 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
2738 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
2739 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
2745 /* Prevent the only kind of declaration conflicts we can make. */
2746 #define lt_preloaded_symbols some_other_symbol
2748 /* External symbol declarations for the compiler. */\
2751 if test "$dlself" = yes; then
2752 $show "generating symbol list for \`$output'"
2754 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
2756 # Add our own program objects to the symbol list.
2757 progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2758 for arg in $progfiles; do
2759 $show "extracting global C symbols from \`$arg'"
2760 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2763 if test -n "$exclude_expsyms"; then
2764 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2765 $run eval '$mv "$nlist"T "$nlist"'
2768 if test -n "$export_symbols_regex"; then
2769 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2770 $run eval '$mv "$nlist"T "$nlist"'
2773 # Prepare the list of exported symbols
2774 if test -z "$export_symbols"; then
2775 export_symbols="$output_objdir/$output.exp"
2776 $run $rm $export_symbols
2777 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2779 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
2780 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
2781 $run eval 'mv "$nlist"T "$nlist"'
2785 for arg in $dlprefiles; do
2786 $show "extracting global C symbols from \`$arg'"
2787 name=`echo "$arg" | sed -e 's%^.*/%%'`
2788 $run eval 'echo ": $name " >> "$nlist"'
2789 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2792 if test -z "$run"; then
2793 # Make sure we have at least an empty file.
2794 test -f "$nlist" || : > "$nlist"
2796 if test -n "$exclude_expsyms"; then
2797 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2798 $mv "$nlist"T "$nlist"
2801 # Try sorting and uniquifying the output.
2802 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
2805 grep -v "^: " < "$nlist" > "$nlist"S
2808 if test -f "$nlist"S; then
2809 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
2811 echo '/* NONE */' >> "$output_objdir/$dlsyms"
2814 $echo >> "$output_objdir/$dlsyms" "\
2816 #undef lt_preloaded_symbols
2818 #if defined (__STDC__) && __STDC__
2819 # define lt_ptr_t void *
2821 # define lt_ptr_t char *
2825 /* The mapping between symbol names and symbols. */
2830 lt_preloaded_symbols[] =
2834 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
2835 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
2836 < "$nlist" >> "$output_objdir/$dlsyms"
2838 $echo >> "$output_objdir/$dlsyms" "\
2842 /* This works around a problem in FreeBSD linker */
2843 #ifdef FREEBSD_WORKAROUND
2844 static const void *lt_preloaded_setup() {
2845 return lt_preloaded_symbols;
2855 pic_flag_for_symtable=
2857 # compiling the symbol table file with pic_flag works around
2858 # a FreeBSD bug that causes programs to crash when -lm is
2859 # linked before any other PIC object. But we must not use
2860 # pic_flag when linking with -static. The problem exists in
2861 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2862 *-*-freebsd2*|*-*-freebsd3.0*)
2863 case "$compile_command " in
2865 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
2869 # Now compile the dynamic symbol file.
2870 $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
2871 $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
2873 # Clean up the generated files.
2874 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
2875 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
2877 # Transform the symbol file into the correct name.
2878 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2879 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2882 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
2887 # We keep going just in case the user didn't refer to
2888 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2889 # really was required.
2891 # Nullify the symbol file.
2892 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2893 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2896 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
2897 # Replace the output file specification.
2898 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
2899 link_command="$compile_command$compile_rpath"
2901 # We have no uninstalled library dependencies, so finalize right now.
2902 $show "$link_command"
2903 $run eval "$link_command"
2906 # Delete the generated files.
2907 if test -n "$dlsyms"; then
2908 $show "$rm $output_objdir/${outputname}S.${objext}"
2909 $run $rm "$output_objdir/${outputname}S.${objext}"
2915 if test -n "$shlibpath_var"; then
2916 # We should set the shlibpath_var
2918 for dir in $temp_rpath; do
2920 [\\/]* | [A-Za-z]:[\\/]*)
2925 # Relative path: add a thisdir entry.
2926 rpath="$rpath\$thisdir/$dir:"
2933 if test -n "$compile_shlibpath$finalize_shlibpath"; then
2934 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
2936 if test -n "$finalize_shlibpath"; then
2937 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
2942 if test -n "$runpath_var"; then
2943 if test -n "$perm_rpath"; then
2944 # We should set the runpath_var.
2946 for dir in $perm_rpath; do
2949 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
2951 if test -n "$finalize_perm_rpath"; then
2952 # We should set the runpath_var.
2954 for dir in $finalize_perm_rpath; do
2957 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
2961 if test "$hardcode_action" = relink; then
2962 # Fast installation is not supported
2963 link_command="$compile_var$compile_command$compile_rpath"
2964 relink_command="$finalize_var$finalize_command$finalize_rpath"
2966 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
2967 $echo "$modename: \`$output' will be relinked during installation" 1>&2
2969 if test "$fast_install" != no; then
2970 link_command="$finalize_var$compile_command$finalize_rpath"
2971 if test "$fast_install" = yes; then
2972 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
2974 # fast_install is set to needless
2978 link_command="$compile_var$compile_command$compile_rpath"
2979 relink_command="$finalize_var$finalize_command$finalize_rpath"
2983 # Replace the output file specification.
2984 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
2986 # Delete the old output files.
2987 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
2989 $show "$link_command"
2990 $run eval "$link_command" || exit $?
2992 # Now create the wrapper script.
2993 $show "creating $output"
2995 # Quote the relink command for shipping.
2996 if test -n "$relink_command"; then
2997 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3000 # Quote $echo for shipping.
3001 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3003 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3004 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3006 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3008 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3011 # Only actually do things if our run command is non-null.
3012 if test -z "$run"; then
3013 # win32 will think the script is a binary if it has
3014 # a .exe suffix, so we strip it off here.
3016 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3019 trap "$rm $output; exit 1" 1 2 15
3024 # $output - temporary wrapper script for $objdir/$outputname
3025 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3027 # The $output program cannot be directly executed until all the libtool
3028 # libraries that it depends on are installed.
3030 # This wrapper script should never be moved out of the build directory.
3031 # If it is, it will not operate correctly.
3033 # Sed substitution that helps us do robust quoting. It backslashifies
3034 # metacharacters that are still active within double-quoted strings.
3035 Xsed='sed -e 1s/^X//'
3036 sed_quote_subst='$sed_quote_subst'
3038 # The HP-UX ksh and POSIX shell print the target directory to stdout
3040 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
3042 relink_command=\"$relink_command\"
3044 # This environment variable determines our operation mode.
3045 if test \"\$libtool_install_magic\" = \"$magic\"; then
3046 # install mode needs the following variable:
3047 link_against_libtool_libs='$link_against_libtool_libs'
3049 # When we are sourced in execute mode, \$file and \$echo are already set.
3050 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3053 # Make sure echo works.
3054 if test \"X\$1\" = X--no-reexec; then
3055 # Discard the --no-reexec flag, and continue.
3057 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3058 # Yippee, \$echo works!
3061 # Restart under the correct shell, and then maybe \$echo will work.
3062 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3068 # Find the directory that this script lives in.
3069 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3070 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3072 # Follow symbolic links until we get to the real thisdir.
3073 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3074 while test -n \"\$file\"; do
3075 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3077 # If there was a directory component, then change thisdir.
3078 if test \"x\$destdir\" != \"x\$file\"; then
3079 case \"\$destdir\" in
3080 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
3081 *) thisdir=\"\$thisdir/\$destdir\" ;;
3085 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3086 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3089 # Try to get the absolute directory name.
3090 absdir=\`cd \"\$thisdir\" && pwd\`
3091 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3094 if test "$fast_install" = yes; then
3096 program=lt-'$outputname'
3097 progdir=\"\$thisdir/$objdir\"
3099 if test ! -f \"\$progdir/\$program\" || \\
3100 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3101 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3103 file=\"\$\$-\$program\"
3105 if test ! -d \"\$progdir\"; then
3106 $mkdir \"\$progdir\"
3108 $rm \"\$progdir/\$file\"
3113 # relink executable if necessary
3114 if test -n \"\$relink_command\"; then
3115 if (cd \"\$thisdir\" && eval \$relink_command); then :
3117 $rm \"\$progdir/\$file\"
3122 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3123 { $rm \"\$progdir/\$program\";
3124 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3125 $rm \"\$progdir/\$file\"
3129 program='$outputname$exeext'
3130 progdir=\"\$thisdir/$objdir\"
3136 if test -f \"\$progdir/\$program\"; then"
3138 # Export our shlibpath_var if we have one.
3139 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3141 # Add our own library path to $shlibpath_var
3142 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3144 # Some systems cannot cope with colon-terminated $shlibpath_var
3145 # The second colon is a workaround for a bug in BeOS R4 sed
3146 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3148 export $shlibpath_var
3152 # fixup the dll searchpath if we need to.
3153 if test -n "$dllsearchpath"; then
3155 # Add the dll search path components to the executable PATH
3156 PATH=$dllsearchpath:\$PATH
3161 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3162 # Run the actual program with our arguments.
3165 *-*-cygwin* | *-*-mingw | *-*-os2*)
3166 # win32 systems need to use the prog path for dll
3169 exec \$progdir\\\\\$program \${1+\"\$@\"}
3174 # Export the path to the program.
3175 PATH=\"\$progdir:\$PATH\"
3178 exec \$program \${1+\"\$@\"}
3183 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3187 # The program doesn't exist.
3188 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3189 \$echo \"This script is just a wrapper for \$program.\" 1>&2
3190 echo \"See the $PACKAGE documentation for more information.\" 1>&2
3201 # See if we need to build an old-fashioned archive.
3202 for oldlib in $oldlibs; do
3204 if test "$build_libtool_libs" = convenience; then
3205 oldobjs="$libobjs_save"
3206 addlibs="$convenience"
3207 build_libtool_libs=no
3209 if test "$build_libtool_libs" = module; then
3210 oldobjs="$libobjs_save"
3211 build_libtool_libs=no
3213 oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3215 addlibs="$old_convenience"
3218 if test -n "$addlibs"; then
3219 gentop="$output_objdir/${outputname}x"
3220 $show "${rm}r $gentop"
3221 $run ${rm}r "$gentop"
3222 $show "mkdir $gentop"
3223 $run mkdir "$gentop"
3225 if test $status -ne 0 && test ! -d "$gentop"; then
3228 generated="$generated $gentop"
3230 # Add in members from convenience archives.
3231 for xlib in $addlibs; do
3232 # Extract the objects.
3234 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3235 *) xabs=`pwd`"/$xlib" ;;
3237 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3238 xdir="$gentop/$xlib"
3240 $show "${rm}r $xdir"
3245 if test $status -ne 0 && test ! -d "$xdir"; then
3248 $show "(cd $xdir && $AR x $xabs)"
3249 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3251 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3255 # Do each command in the archive commands.
3256 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3257 eval cmds=\"$old_archive_from_new_cmds\"
3259 # Ensure that we have .o objects in place incase we decided
3260 # not to build a shared library, and have fallen back to building
3261 # static libs even though --disable-static was passed!
3262 for oldobj in $oldobjs; do
3263 if test ! -f $oldobj; then
3264 obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
3265 $show "${LN_S} $obj $oldobj"
3266 $run ${LN_S} $obj $oldobj || exit $?
3270 eval cmds=\"$old_archive_cmds\"
3272 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3273 for cmd in $cmds; do
3276 $run eval "$cmd" || exit $?
3281 if test -n "$generated"; then
3282 $show "${rm}r$generated"
3283 $run ${rm}r$generated
3286 # Now create the libtool archive.
3290 test "$build_old_libs" = yes && old_library="$libname.$libext"
3291 $show "creating $output"
3293 if test -n "$xrpath"; then
3295 for libdir in $xrpath; do
3296 temp_xrpath="$temp_xrpath -R$libdir"
3298 dependency_libs="$temp_xrpath $dependency_libs"
3301 # Only create the output if not a dry run.
3302 if test -z "$run"; then
3303 for installed in no yes; do
3304 if test "$installed" = yes; then
3305 if test -z "$install_libdir"; then
3308 output="$output_objdir/$outputname"i
3312 # $outputname - a libtool library file
3313 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3315 # Please DO NOT delete this file!
3316 # It is necessary for linking the library.
3318 # The name that we can dlopen(3).
3321 # Names of this library.
3322 library_names='$library_names'
3324 # The name of the static archive.
3325 old_library='$old_library'
3327 # Libraries that this one depends upon.
3328 dependency_libs='$dependency_libs'
3330 # Version information for $libname.
3335 # Is this an already installed library?
3336 installed=$installed
3338 # Directory that this library needs to be installed in:
3339 libdir='$install_libdir'\
3344 # Do a symbolic link so that the libtool archive can be found in
3345 # LD_LIBRARY_PATH before the program is installed.
3346 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3347 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
3353 # libtool install mode
3355 modename="$modename: install"
3357 # There may be an optional sh(1) argument at the beginning of
3358 # install_prog (especially on Windows NT).
3359 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
3360 # Aesthetically quote it.
3361 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3363 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3367 install_prog="$arg "
3375 # The real first argument should be the name of the installation program.
3376 # Aesthetically quote it.
3377 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3379 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3383 install_prog="$install_prog$arg"
3385 # We need to accept at least all the BSD install flags.
3395 if test -n "$dest"; then
3396 files="$files $dest"
3414 # If the previous option needed an argument, then skip it.
3415 if test -n "$prev"; then
3424 # Aesthetically quote the argument.
3425 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3427 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3431 install_prog="$install_prog $arg"
3434 if test -z "$install_prog"; then
3435 $echo "$modename: you must specify an install program" 1>&2
3440 if test -n "$prev"; then
3441 $echo "$modename: the \`$prev' option requires an argument" 1>&2
3446 if test -z "$files"; then
3447 if test -z "$dest"; then
3448 $echo "$modename: no file or destination specified" 1>&2
3450 $echo "$modename: you must specify a destination" 1>&2
3456 # Strip any trailing slash from the destination.
3457 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3459 # Check to see that the destination is a directory.
3460 test -d "$dest" && isdir=yes
3461 if test "$isdir" = yes; then
3465 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3466 test "X$destdir" = "X$dest" && destdir=.
3467 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3469 # Not a directory, so check to see that there is only one file specified.
3471 if test $# -gt 2; then
3472 $echo "$modename: \`$dest' is not a directory" 1>&2
3478 [\\/]* | [A-Za-z]:[\\/]*) ;;
3480 for file in $files; do
3484 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3493 # This variable tells wrapper scripts just to set variables rather
3494 # than running their programs.
3495 libtool_install_magic="$magic"
3500 for file in $files; do
3502 # Do each installation.
3505 # Do the static libraries later.
3506 staticlibs="$staticlibs $file"
3510 # Check to see that this really is a libtool archive.
3511 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3513 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3520 # If there is no directory component, then add one.
3522 */* | *\\*) . $file ;;
3526 # Add the libdir to current_libdirs if it is the destination.
3527 if test "X$destdir" = "X$libdir"; then
3528 case "$current_libdirs " in
3530 *) current_libdirs="$current_libdirs $libdir" ;;
3533 # Note the libdir as a future libdir.
3534 case "$future_libdirs " in
3536 *) future_libdirs="$future_libdirs $libdir" ;;
3540 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
3541 test "X$dir" = "X$file/" && dir=
3544 # See the names of the shared library.
3545 set dummy $library_names
3546 if test -n "$2"; then
3551 # Install the shared library and build the symlinks.
3552 $show "$install_prog $dir/$realname $destdir/$realname"
3553 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
3555 if test $# -gt 0; then
3556 # Delete the old symlinks, and create new ones.
3559 if test "$linkname" != "$realname"; then
3560 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3561 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3566 # Do each command in the postinstall commands.
3567 lib="$destdir/$realname"
3568 eval cmds=\"$postinstall_cmds\"
3569 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3570 for cmd in $cmds; do
3573 $run eval "$cmd" || exit $?
3578 # Install the pseudo-library for information purposes.
3579 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3580 instname="$dir/$name"i
3581 $show "$install_prog $instname $destdir/$name"
3582 $run eval "$install_prog $instname $destdir/$name" || exit $?
3584 # Maybe install the static library, too.
3585 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
3589 # Install (i.e. copy) a libtool object.
3591 # Figure out destination file name, if it wasn't already specified.
3592 if test -n "$destname"; then
3593 destfile="$destdir/$destname"
3595 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3596 destfile="$destdir/$destfile"
3599 # Deduce the name of the destination old-style object file.
3602 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
3605 staticdest="$destfile"
3609 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
3615 # Install the libtool object if requested.
3616 if test -n "$destfile"; then
3617 $show "$install_prog $file $destfile"
3618 $run eval "$install_prog $file $destfile" || exit $?
3621 # Install the old object if enabled.
3622 if test "$build_old_libs" = yes; then
3623 # Deduce the name of the old-style object file.
3624 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
3626 $show "$install_prog $staticobj $staticdest"
3627 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
3633 # Figure out destination file name, if it wasn't already specified.
3634 if test -n "$destname"; then
3635 destfile="$destdir/$destname"
3637 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3638 destfile="$destdir/$destfile"
3641 # Do a test to see if this is really a libtool program.
3642 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3643 link_against_libtool_libs=
3646 # If there is no directory component, then add one.
3648 */* | *\\*) . $file ;;
3652 # Check the variables that should have been set.
3653 if test -z "$link_against_libtool_libs"; then
3654 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
3659 for lib in $link_against_libtool_libs; do
3660 # Check to see that each library is installed.
3662 if test -f "$lib"; then
3663 # If there is no directory component, then add one.
3665 */* | *\\*) . $lib ;;
3669 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
3670 if test -n "$libdir" && test ! -f "$libfile"; then
3671 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
3677 if test "$fast_install" = no && test -n "$relink_command"; then
3678 if test "$finalize" = yes && test -z "$run"; then
3680 test -n "$TMPDIR" && tmpdir="$TMPDIR"
3681 tmpdir="$tmpdir/libtool-$$"
3682 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
3684 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
3687 outputname="$tmpdir/$file"
3688 # Replace the output file specification.
3689 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
3691 $show "$relink_command"
3692 if $run eval "$relink_command"; then :
3694 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
3700 $echo "$modename: warning: cannot relink \`$file'" 1>&2
3703 # Install the binary that we compiled earlier.
3704 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
3708 $show "$install_prog$stripme $file $destfile"
3709 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
3710 test -n "$outputname" && ${rm}r "$tmpdir"
3715 for file in $staticlibs; do
3716 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3718 # Set up the ranlib parameters.
3719 oldlib="$destdir/$name"
3721 $show "$install_prog $file $oldlib"
3722 $run eval "$install_prog \$file \$oldlib" || exit $?
3724 # Do each command in the postinstall commands.
3725 eval cmds=\"$old_postinstall_cmds\"
3726 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3727 for cmd in $cmds; do
3730 $run eval "$cmd" || exit $?
3735 if test -n "$future_libdirs"; then
3736 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
3739 if test -n "$current_libdirs"; then
3740 # Maybe just do a dry run.
3741 test -n "$run" && current_libdirs=" -n$current_libdirs"
3742 exec $SHELL $0 --finish$current_libdirs
3749 # libtool finish mode
3751 modename="$modename: finish"
3755 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3758 libdirs="$libdirs $dir"
3761 for libdir in $libdirs; do
3762 if test -n "$finish_cmds"; then
3763 # Do each command in the finish commands.
3764 eval cmds=\"$finish_cmds\"
3765 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3766 for cmd in $cmds; do
3769 $run eval "$cmd" || admincmds="$admincmds
3774 if test -n "$finish_eval"; then
3775 # Do the single finish_eval.
3776 eval cmds=\"$finish_eval\"
3777 $run eval "$cmds" || admincmds="$admincmds
3783 # Exit here if they wanted silent mode.
3784 test "$show" = : && exit 0
3786 echo "----------------------------------------------------------------------"
3787 echo "Libraries have been installed in:"
3788 for libdir in $libdirs; do
3792 echo "If you ever happen to want to link against installed libraries"
3793 echo "in a given directory, LIBDIR, you must either use libtool, and"
3794 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
3795 echo "flag during linking and do at least one of the following:"
3796 if test -n "$shlibpath_var"; then
3797 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3798 echo " during execution"
3800 if test -n "$runpath_var"; then
3801 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3802 echo " during linking"
3804 if test -n "$hardcode_libdir_flag_spec"; then
3806 eval flag=\"$hardcode_libdir_flag_spec\"
3808 echo " - use the \`$flag' linker flag"
3810 if test -n "$admincmds"; then
3811 echo " - have your system administrator run these commands:$admincmds"
3813 if test -f /etc/ld.so.conf; then
3814 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3817 echo "See any operating system documentation about shared libraries for"
3818 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3819 echo "----------------------------------------------------------------------"
3823 # libtool execute mode
3825 modename="$modename: execute"
3827 # The first argument is the command name.
3829 if test -z "$cmd"; then
3830 $echo "$modename: you must specify a COMMAND" 1>&2
3835 # Handle -dlopen flags immediately.
3836 for file in $execute_dlfiles; do
3837 if test ! -f "$file"; then
3838 $echo "$modename: \`$file' is not a file" 1>&2
3846 # Check to see that this really is a libtool archive.
3847 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3849 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3854 # Read the libtool library.
3858 # If there is no directory component, then add one.
3860 */* | *\\*) . $file ;;
3864 # Skip this library if it cannot be dlopened.
3865 if test -z "$dlname"; then
3866 # Warn if it was a shared library.
3867 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
3871 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3872 test "X$dir" = "X$file" && dir=.
3874 if test -f "$dir/$objdir/$dlname"; then
3877 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
3883 # Just add the directory containing the .lo file.
3884 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3885 test "X$dir" = "X$file" && dir=.
3889 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
3894 # Get the absolute pathname.
3895 absdir=`cd "$dir" && pwd`
3896 test -n "$absdir" && dir="$absdir"
3898 # Now add the directory to shlibpath_var.
3899 if eval "test -z \"\$$shlibpath_var\""; then
3900 eval "$shlibpath_var=\"\$dir\""
3902 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3906 # This variable tells wrapper scripts just to set shlibpath_var
3907 # rather than running their programs.
3908 libtool_execute_magic="$magic"
3910 # Check if any of the arguments is a wrapper script.
3917 # Do a test to see if this is really a libtool program.
3918 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3919 # If there is no directory component, then add one.
3921 */* | *\\*) . $file ;;
3925 # Transform arg to wrapped name.
3926 file="$progdir/$program"
3930 # Quote arguments (to preserve shell metacharacters).
3931 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
3932 args="$args \"$file\""
3935 if test -z "$run"; then
3936 # Export the shlibpath_var.
3937 eval "export $shlibpath_var"
3939 # Restore saved enviroment variables
3940 if test "${save_LC_ALL+set}" = set; then
3941 LC_ALL="$save_LC_ALL"; export LC_ALL
3943 if test "${save_LANG+set}" = set; then
3944 LANG="$save_LANG"; export LANG
3947 # Now actually exec the command.
3948 eval "exec \$cmd$args"
3950 $echo "$modename: cannot exec \$cmd$args"
3953 # Display what would be done.
3954 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
3955 $echo "export $shlibpath_var"
3961 # libtool uninstall mode
3963 modename="$modename: uninstall"
3970 -*) rm="$rm $arg" ;;
3971 *) files="$files $arg" ;;
3975 if test -z "$rm"; then
3976 $echo "$modename: you must specify an RM program" 1>&2
3981 for file in $files; do
3982 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3983 test "X$dir" = "X$file" && dir=.
3984 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3990 # Possibly a libtool archive, so verify it.
3991 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3994 # Delete the libtool libraries and symlinks.
3995 for n in $library_names; do
3996 rmfiles="$rmfiles $dir/$n"
3998 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
4000 $show "$rm $rmfiles"
4003 if test -n "$library_names"; then
4004 # Do each command in the postuninstall commands.
4005 eval cmds=\"$postuninstall_cmds\"
4006 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4007 for cmd in $cmds; do
4015 if test -n "$old_library"; then
4016 # Do each command in the old_postuninstall commands.
4017 eval cmds=\"$old_postuninstall_cmds\"
4018 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4019 for cmd in $cmds; do
4027 # FIXME: should reinstall the best remaining shared library.
4032 if test "$build_old_libs" = yes; then
4033 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4034 rmfiles="$rmfiles $dir/$oldobj"
4036 $show "$rm $rmfiles"
4041 $show "$rm $rmfiles"
4050 $echo "$modename: you must specify a MODE" 1>&2
4051 $echo "$generic_help" 1>&2
4056 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4057 $echo "$generic_help" 1>&2
4059 fi # test -z "$show_help"
4061 # We need to display help for each of the modes.
4064 "Usage: $modename [OPTION]... [MODE-ARG]...
4066 Provide generalized library-building support services.
4068 --config show all configuration variables
4069 --debug enable verbose shell tracing
4070 -n, --dry-run display commands without modifying any files
4071 --features display basic configuration information and exit
4072 --finish same as \`--mode=finish'
4073 --help display this help message and exit
4074 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
4075 --quiet same as \`--silent'
4076 --silent don't print informational messages
4077 --version print version information
4079 MODE must be one of the following:
4081 compile compile a source file into a libtool object
4082 execute automatically set library path, then run a program
4083 finish complete the installation of libtool libraries
4084 install install libraries or executables
4085 link create a library or an executable
4086 uninstall remove libraries from an installed directory
4088 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
4089 a more detailed description of MODE."
4095 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4097 Compile a source file into a libtool library object.
4099 This mode accepts the following additional options:
4101 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
4102 -static always build a \`.o' file suitable for static linking
4104 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4105 from the given SOURCEFILE.
4107 The output file name is determined by removing the directory component from
4108 SOURCEFILE, then substituting the C source code suffix \`.c' with the
4109 library object suffix, \`.lo'."
4114 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4116 Automatically set library path, then run a program.
4118 This mode accepts the following additional options:
4120 -dlopen FILE add the directory containing FILE to the library path
4122 This mode sets the library path environment variable according to \`-dlopen'
4125 If any of the ARGS are libtool executable wrappers, then they are translated
4126 into their corresponding uninstalled binary, and any of their required library
4127 directories are added to the library path.
4129 Then, COMMAND is executed, with ARGS as arguments."
4134 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4136 Complete the installation of libtool libraries.
4138 Each LIBDIR is a directory that contains libtool libraries.
4140 The commands that this mode executes may require superuser privileges. Use
4141 the \`--dry-run' option if you just want to see what would be executed."
4146 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4148 Install executables or libraries.
4150 INSTALL-COMMAND is the installation command. The first component should be
4151 either the \`install' or \`cp' program.
4153 The rest of the components are interpreted as arguments to that command (only
4154 BSD-compatible install options are recognized)."
4159 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4161 Link object files or libraries together to form another library, or to
4162 create an executable program.
4164 LINK-COMMAND is a command using the C compiler that you would use to create
4165 a program from several object files.
4167 The following components of LINK-COMMAND are treated specially:
4169 -all-static do not do any dynamic linking at all
4170 -avoid-version do not add a version suffix if possible
4171 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
4172 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
4173 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4174 -export-symbols SYMFILE
4175 try to export only the symbols listed in SYMFILE
4176 -export-symbols-regex REGEX
4177 try to export only the symbols matching REGEX
4178 -LLIBDIR search LIBDIR for required installed libraries
4179 -lNAME OUTPUT-FILE requires the installed library libNAME
4180 -module build a library that can dlopened
4181 -no-undefined declare that a library does not refer to external symbols
4182 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
4183 -release RELEASE specify package release information
4184 -rpath LIBDIR the created library will eventually be installed in LIBDIR
4185 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
4186 -static do not do any dynamic linking of libtool libraries
4187 -version-info CURRENT[:REVISION[:AGE]]
4188 specify library version info [each variable defaults to 0]
4190 All other options (arguments beginning with \`-') are ignored.
4192 Every other argument is treated as a filename. Files ending in \`.la' are
4193 treated as uninstalled libtool libraries, other files are standard or library
4196 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4197 only library objects (\`.lo' files) may be specified, and \`-rpath' is
4198 required, except when creating a convenience library.
4200 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4201 using \`ar' and \`ranlib', or on Windows using \`lib'.
4203 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4204 is created, otherwise an executable program is created."
4209 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4211 Remove libraries from an installation directory.
4213 RM is the name of the program to use to delete files associated with each FILE
4214 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4217 If FILE is a libtool library, all the files associated with it are deleted.
4218 Otherwise, only FILE itself is deleted using RM."
4222 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4229 $echo "Try \`$modename --help' for more information about other modes."