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 nexus:
39 # CC="gcc" CFLAGS="-g -O2" CPPFLAGS="" \
40 # LD="/usr/bin/ld" LDFLAGS="" LIBS="" \
41 # NM="/usr/bin/nm -B" RANLIB="ranlib" LN_S="ln -s" \
42 # DLLTOOL="" OBJDUMP="" AS="" \
43 # ./ltconfig --cache-file=./config.cache --with-gcc --with-gnu-ld --no-verify ./ltmain.sh i686-pc-linux-gnu
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.
55 build_libtool_libs=yes
57 # Whether or not to build static libraries.
60 # Whether or not to optimize for fast installation.
64 host_alias=i686-pc-linux-gnu
65 host=i686-pc-linux-gnu
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.
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="\${wl}--export-dynamic"
149 # Compiler flag to generate shared objects directly from archives.
150 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
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="\$CC -shared \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname -o \$lib"
179 archive_expsym_cmds="\$CC -shared \$libobjs \$deplibs \$linkopts \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
181 postuninstall_cmds=""
183 # Method to check whether dependent libraries are shared objects.
184 deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )"
186 # Command to use when deplibs_check_method == file_magic.
187 file_magic_cmd="/usr/bin/file"
189 # Flag that allows shared libraries with undefined symbols to be built.
190 allow_undefined_flag=""
192 # Flag that forces no undefined symbols.
195 # Commands used to finish a libtool library installation in a directory.
196 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
198 # Same as above, but a single script fragment to be evaled but not shown.
201 # Take the output of nm and produce a listing of raw symbols and C names.
202 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGISTW]\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
204 # Transform the output of nm in a proper C declaration
205 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
207 # This is the shared library runtime path variable.
208 runpath_var=LD_RUN_PATH
210 # This is the shared library path variable.
211 shlibpath_var=LD_LIBRARY_PATH
213 # Is shlibpath searched before the hard-coded library search path?
214 shlibpath_overrides_runpath=no
216 # How to hardcode a shared library path into an executable.
217 hardcode_action=immediate
219 # Flag to hardcode $libdir into a binary during linking.
220 # This must work even if $libdir does not exist.
221 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
222 if test -f /etc/debian_version; then
223 # Debian policy mandates that rpaths should not be encoded into a binary
224 # so it is overridden.
225 hardcode_libdir_flag_spec=" -D_DEBIAN_PATCHED_LIBTOOL_ "
228 # Whether we need a single -rpath flag with a separated argument.
229 hardcode_libdir_separator=""
231 # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
235 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
239 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
240 # the resulting binary.
241 hardcode_shlibpath_var=unsupported
243 # Compile-time system search path for libraries
244 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
246 # Run-time system search path for libraries
247 sys_lib_dlsearch_path_spec="/lib /usr/lib"
249 # Fix the shell variable $srcfile for the compiler.
252 # Set to yes if exported symbols are required.
253 always_export_symbols=no
255 # The commands to list exported symbols.
256 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
258 # Symbols that should not be listed in the preloaded symbols.
259 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
261 # Symbols that must always be exported.
264 ### END LIBTOOL CONFIG
266 # ltmain.sh - Provide generalized library-building support services.
267 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
269 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
270 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
272 # This program is free software; you can redistribute it and/or modify
273 # it under the terms of the GNU General Public License as published by
274 # the Free Software Foundation; either version 2 of the License, or
275 # (at your option) any later version.
277 # This program is distributed in the hope that it will be useful, but
278 # WITHOUT ANY WARRANTY; without even the implied warranty of
279 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
280 # General Public License for more details.
282 # You should have received a copy of the GNU General Public License
283 # along with this program; if not, write to the Free Software
284 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
286 # As a special exception to the GNU General Public License, if you
287 # distribute this file as part of a program that contains a
288 # configuration script generated by Autoconf, you may include it under
289 # the same distribution terms that you use for the rest of that program.
291 # Check that we have a working $echo.
292 if test "X$1" = X--no-reexec; then
293 # Discard the --no-reexec flag, and continue.
295 elif test "X$1" = X--fallback-echo; then
296 # Avoid inline document here, it may be left over
298 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
299 # Yippee, $echo works!
302 # Restart under the correct shell, and then maybe $echo will work.
303 exec $SHELL "$0" --no-reexec ${1+"$@"}
306 if test "X$1" = X--fallback-echo; then
307 # used as fallback echo
315 # The name of this program.
316 progname=`$echo "$0" | sed 's%^.*/%%'`
323 TIMESTAMP=" (1.385.2.181 1999/07/02 15:49:11)"
326 help="Try \`$progname --help' for more information."
327 magic="%%%MAGIC variable%%%"
332 # Sed substitution that helps us do robust quoting. It backslashifies
333 # metacharacters that are still active within double-quoted strings.
334 Xsed='sed -e 1s/^X//'
335 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
337 NL2SP='tr \015\012 \040\040'
340 # Only set LANG and LC_ALL to C if already set.
341 # These must not be set unconditionally because not all systems understand
342 # e.g. LANG=C (notably SCO).
343 # We save the old values to restore during execute mode.
344 if test "${LC_ALL+set}" = set; then
345 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
347 if test "${LANG+set}" = set; then
348 save_LANG="$LANG"; LANG=C; export LANG
351 if test "$LTCONFIG_VERSION" != "$VERSION"; then
352 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
353 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
357 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
358 echo "$modename: not configured to build any kind of library" 1>&2
359 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
372 lo2o="s/\\.lo\$/.${objext}/"
373 o2lo="s/\\.${objext}\$/.lo/"
375 # Parse our command line options once, thoroughly.
382 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
386 # If the previous option needs an argument, assign it.
387 if test -n "$prev"; then
390 eval "$prev=\"\$$prev \$arg\""
402 # Have we seen a non-optional argument yet?
409 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
414 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
419 echo "$progname: enabling shell trace mode"
429 if test "$build_libtool_libs" = yes; then
430 echo "enable shared libraries"
432 echo "disable shared libraries"
434 if test "$build_old_libs" = yes; then
435 echo "enable static libraries"
437 echo "disable static libraries"
442 --finish) mode="finish" ;;
444 --mode) prevopt="--mode" prev=mode ;;
445 --mode=*) mode="$optarg" ;;
457 $echo "$modename: unrecognized option \`$arg'" 1>&2
469 if test -n "$prevopt"; then
470 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
475 if test -z "$show_help"; then
477 # Infer the operation mode.
478 if test -z "$mode"; then
480 *cc | *++ | gcc* | *-gcc*)
492 *db | *dbx | *strace | *truss)
502 # If we have no mode, but dlfiles were specified, then do execute mode.
503 test -n "$execute_dlfiles" && mode=execute
505 # Just use the default operation mode.
506 if test -z "$mode"; then
507 if test -n "$nonopt"; then
508 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
510 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
517 # Only execute mode is allowed to have -dlopen flags.
518 if test -n "$execute_dlfiles" && test "$mode" != execute; then
519 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
524 # Change the help message to a mode-specific one.
526 help="Try \`$modename --help --mode=$mode' for more information."
528 # These modes are in order of execution frequency so that they run quickly.
530 # libtool compile mode
532 modename="$modename: compile"
533 # Get the compilation command and the source file.
542 # Accept any command-line options.
545 if test "$user_target" != "no"; then
546 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
558 case "$user_target" in
560 # The next one is the -o target name
565 # We got the output file
572 # Accept the current argument as the source file.
576 # Aesthetically quote the previous argument.
578 # Backslashify any backslashes, double quotes, and dollar signs.
579 # These are the only characters that are still specially
580 # interpreted inside of double-quoted scrings.
581 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
583 # Double-quote args containing other shell metacharacters.
584 # Many Bourne shells cannot handle close brackets correctly in scan
585 # sets, so we specify it separately.
587 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
588 lastarg="\"$lastarg\""
592 # Add the previous argument to base_compile.
593 if test -z "$base_compile"; then
594 base_compile="$lastarg"
596 base_compile="$base_compile $lastarg"
600 case "$user_target" in
604 # Get the name of the library object.
605 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
608 $echo "$modename: you must specify a target with \`-o'" 1>&2
613 # Recognize several different file suffixes.
614 # If the user specifies -o file.o, it is replaced with file.lo
629 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
632 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
634 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
639 if test -z "$base_compile"; then
640 $echo "$modename: you must specify a compilation command" 1>&2
645 # Delete any leftover library objects.
646 if test "$build_old_libs" = yes; then
647 removelist="$obj $libobj"
653 trap "$run $rm $removelist; exit 1" 1 2 15
655 # Calculate the filename of the output object if compiler does
656 # not support -o with -c
657 if test "$compiler_c_o" = no; then
658 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
659 lockfile="$output_obj.lock"
660 removelist="$removelist $output_obj $lockfile"
661 trap "$run $rm $removelist; exit 1" 1 2 15
667 # Lock this critical section if it is needed
668 # We use this script file to make the link, it avoids creating a new file
669 if test "$need_locks" = yes; then
670 until ln "$0" "$lockfile" 2>/dev/null; do
671 $show "Waiting for $lockfile to be removed"
674 elif test "$need_locks" = warn; then
675 if test -f "$lockfile"; then
677 *** ERROR, $lockfile exists and contains:
678 `cat $lockfile 2>/dev/null`
680 This indicates that another process is trying to use the same
681 temporary object file, and libtool could not work around it because
682 your compiler does not support \`-c' and \`-o' together. If you
683 repeat this compilation, it may succeed, by chance, but you had better
684 avoid parallel builds (make -j) in this platform, or get a better
690 echo $srcfile > "$lockfile"
693 if test -n "$fix_srcfile_path"; then
694 eval srcfile=\"$fix_srcfile_path\"
697 # Only build a PIC object if we are building libtool libraries.
698 if test "$build_libtool_libs" = yes; then
699 # Without this assignment, base_compile gets emptied.
700 fbsd_hideous_sh_bug=$base_compile
702 # All platforms use -DPIC, to notify preprocessed assembler code.
703 command="$base_compile $pic_flag -DPIC $srcfile"
704 if test "$build_old_libs" = yes; then
706 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
707 if test "X$dir" = "X$libobj"; then
712 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
714 if test -d "$dir"; then
721 if test $status -ne 0 && test ! -d $dir; then
726 if test "$compiler_o_lo" = yes; then
728 command="$command -o $output_obj"
729 elif test "$compiler_c_o" = yes; then
731 command="$command -o $output_obj"
734 $run $rm "$output_obj"
736 if $run eval "$command"; then :
738 test -n "$output_obj" && $run $rm $removelist
742 if test "$need_locks" = warn &&
743 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
745 *** ERROR, $lockfile contains:
746 `cat $lockfile 2>/dev/null`
748 but it should contain:
751 This indicates that another process is trying to use the same
752 temporary object file, and libtool could not work around it because
753 your compiler does not support \`-c' and \`-o' together. If you
754 repeat this compilation, it may succeed, by chance, but you had better
755 avoid parallel builds (make -j) in this platform, or get a better
762 # Just move the object if needed, then go on to compile the next one
763 if test x"$output_obj" != x"$libobj"; then
764 $show "$mv $output_obj $libobj"
765 if $run $mv $output_obj $libobj; then :
773 # If we have no pic_flag, then copy the object into place and finish.
774 if test -z "$pic_flag" && test "$build_old_libs" = yes; then
775 # Rename the .lo from within objdir to obj
776 if test -f $obj; then
781 $show "$mv $libobj $obj"
782 if $run $mv $libobj $obj; then :
789 # Now arrange that obj and lo_libobj become the same file
790 $show "$LN_S $obj $lo_libobj"
791 if $run $LN_S $obj $lo_libobj; then
800 # Allow error messages only from the first compilation.
801 suppress_output=' >/dev/null 2>&1'
804 # Only build a position-dependent object if we build old libraries.
805 if test "$build_old_libs" = yes; then
806 command="$base_compile $srcfile"
807 if test "$compiler_c_o" = yes; then
808 command="$command -o $obj"
812 # Suppress compiler output if we already did a PIC compilation.
813 command="$command$suppress_output"
814 $run $rm "$output_obj"
816 if $run eval "$command"; then :
822 if test "$need_locks" = warn &&
823 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
825 *** ERROR, $lockfile contains:
826 `cat $lockfile 2>/dev/null`
828 but it should contain:
831 This indicates that another process is trying to use the same
832 temporary object file, and libtool could not work around it because
833 your compiler does not support \`-c' and \`-o' together. If you
834 repeat this compilation, it may succeed, by chance, but you had better
835 avoid parallel builds (make -j) in this platform, or get a better
842 # Just move the object if needed
843 if test x"$output_obj" != x"$obj"; then
844 $show "$mv $output_obj $obj"
845 if $run $mv $output_obj $obj; then :
853 # Create an invalid libtool object if no PIC, so that we do not
854 # accidentally link it into a program.
855 if test "$build_libtool_libs" != yes; then
856 $show "echo timestamp > $libobj"
857 $run eval "echo timestamp > \$libobj" || exit $?
859 # Move the .lo from within objdir
860 $show "$mv $libobj $lo_libobj"
861 if $run $mv $libobj $lo_libobj; then :
870 # Unlock the critical section if it was locked
871 if test "$need_locks" != no; then
880 modename="$modename: link"
881 C_compiler="$CC" # save it, to compile generated C sources
884 *-*-cygwin* | *-*-mingw* | *-*-os2*)
885 # It is impossible to link a dll without this setting, and
886 # we shouldn't force the makefile maintainer to figure out
887 # which system we are compiling for in order to pass an extra
888 # flag for every libtool invokation.
891 # FIXME: Unfortunately, there are problems with the above when trying
892 # to make a dll which has undefined symbols, in which case not
893 # even a static library is built. For now, we need to specify
894 # -no-undefined on the libtool link line when we can be certain
895 # that all symbols are satisfied, otherwise we get a static library.
898 # This is a source program that is used to create dlls on Windows
899 # Don't remove nor modify the starting and closing comments
900 # /* ltdll.c starts here */
901 # #define WIN32_LEAN_AND_MEAN
902 # #include <windows.h>
903 # #undef WIN32_LEAN_AND_MEAN
907 # # ifdef __CYGWIN32__
908 # # define __CYGWIN__ __CYGWIN32__
915 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
921 # #include <cygwin/cygwin_dll.h>
922 # DECLARE_CYGWIN_DLL( DllMain );
924 # HINSTANCE __hDllInstance_base;
927 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
929 # __hDllInstance_base = hInst;
932 # /* ltdll.c ends here */
933 # This is a source program that is used to create import libraries
934 # on Windows for dlls which lack them. Don't remove nor modify the
935 # starting and closing comments
936 # /* impgen.c starts here */
937 # /* Copyright (C) 1999 Free Software Foundation, Inc.
939 # This file is part of GNU libtool.
941 # This program is free software; you can redistribute it and/or modify
942 # it under the terms of the GNU General Public License as published by
943 # the Free Software Foundation; either version 2 of the License, or
944 # (at your option) any later version.
946 # This program is distributed in the hope that it will be useful,
947 # but WITHOUT ANY WARRANTY; without even the implied warranty of
948 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
949 # GNU General Public License for more details.
951 # You should have received a copy of the GNU General Public License
952 # along with this program; if not, write to the Free Software
953 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
956 # #include <stdio.h> /* for printf() */
957 # #include <unistd.h> /* for open(), lseek(), read() */
958 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
959 # #include <string.h> /* for strdup() */
961 # static unsigned int
962 # pe_get16 (fd, offset)
966 # unsigned char b[2];
967 # lseek (fd, offset, SEEK_SET);
969 # return b[0] + (b[1]<<8);
972 # static unsigned int
973 # pe_get32 (fd, offset)
977 # unsigned char b[4];
978 # lseek (fd, offset, SEEK_SET);
980 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
983 # static unsigned int
987 # unsigned char *b = ptr;
988 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
997 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
998 # unsigned long export_rva, export_size, nsections, secptr, expptr;
999 # unsigned long name_rvas, nexp;
1000 # unsigned char *expdata, *erva;
1001 # char *filename, *dll_name;
1003 # filename = argv[1];
1005 # dll = open(filename, O_RDONLY|O_BINARY);
1009 # dll_name = filename;
1011 # for (i=0; filename[i]; i++)
1012 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
1013 # dll_name = filename + i +1;
1015 # pe_header_offset = pe_get32 (dll, 0x3c);
1016 # opthdr_ofs = pe_header_offset + 4 + 20;
1017 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
1019 # if (num_entries < 1) /* no exports */
1022 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
1023 # export_size = pe_get32 (dll, opthdr_ofs + 100);
1024 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
1025 # secptr = (pe_header_offset + 4 + 20 +
1026 # pe_get16 (dll, pe_header_offset + 4 + 16));
1029 # for (i = 0; i < nsections; i++)
1032 # unsigned long secptr1 = secptr + 40 * i;
1033 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
1034 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
1035 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
1036 # lseek(dll, secptr1, SEEK_SET);
1037 # read(dll, sname, 8);
1038 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
1040 # expptr = fptr + (export_rva - vaddr);
1041 # if (export_rva + export_size > vaddr + vsize)
1042 # export_size = vsize - (export_rva - vaddr);
1047 # expdata = (unsigned char*)malloc(export_size);
1048 # lseek (dll, expptr, SEEK_SET);
1049 # read (dll, expdata, export_size);
1050 # erva = expdata - export_rva;
1052 # nexp = pe_as32 (expdata+24);
1053 # name_rvas = pe_as32 (expdata+32);
1055 # printf ("EXPORTS\n");
1056 # for (i = 0; i<nexp; i++)
1058 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
1059 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
1064 # /* impgen.c ends here */
1070 compile_command="$CC"
1071 finalize_command="$CC"
1082 if test -n "$shlibpath_var"; then
1083 # get the directories listed in $shlibpath_var
1084 eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
1088 # now prepend the system-specific ones
1089 eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
1090 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
1098 export_symbols_regex=
1101 link_against_libtool_libs=
1105 prefer_static_libs=no
1117 # We need to know -static, to get the right output filenames.
1121 -all-static | -static)
1122 if test "X$arg" = "X-all-static"; then
1123 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
1124 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
1126 if test -n "$link_static_flag"; then
1127 dlopen_self=$dlopen_self_static
1130 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1131 dlopen_self=$dlopen_self_static
1134 build_libtool_libs=no
1136 prefer_static_libs=yes
1142 # See if our shared archives depend on static archives.
1143 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
1145 # Go through the arguments, transforming them on the way.
1146 while test $# -gt 0; do
1150 # If the previous option needs an argument, assign it.
1151 if test -n "$prev"; then
1154 compile_command="$compile_command @OUTPUT@"
1155 finalize_command="$finalize_command @OUTPUT@"
1161 if test "$preload" = no; then
1162 # Add the symbol object into the linking commands.
1163 compile_command="$compile_command @SYMFILE@"
1164 finalize_command="$finalize_command @SYMFILE@"
1168 *.la | *.lo) ;; # We handle these cases below.
1170 if test "$dlself" = no; then
1178 if test "$prev" = dlprefiles; then
1180 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
1190 if test "$prev" = dlfiles; then
1191 dlfiles="$dlfiles $arg"
1193 dlprefiles="$dlprefiles $arg"
1200 export_symbols="$arg"
1201 if test ! -f "$arg"; then
1202 $echo "$modename: symbol file \`$arg' does not exist"
1209 export_symbols_regex="$arg"
1219 # We need an absolute path.
1221 [\\/]* | [A-Za-z]:[\\/]*) ;;
1223 $echo "$modename: only absolute run-paths are allowed" 1>&2
1227 if test "$prev" = rpath; then
1230 *) rpath="$rpath $arg" ;;
1235 *) xrpath="$xrpath $arg" ;;
1242 eval "$prev=\"\$arg\""
1253 if test -n "$link_static_flag"; then
1254 compile_command="$compile_command $link_static_flag"
1255 finalize_command="$finalize_command $link_static_flag"
1261 # FIXME: remove this flag sometime in the future.
1262 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
1286 -export-symbols | -export-symbols-regex)
1287 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1288 $echo "$modename: not more than one -exported-symbols argument allowed"
1291 if test "X$arg" = "X-export-symbols"; then
1300 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
1301 # We need an absolute path.
1303 [\\/]* | [A-Za-z]:[\\/]*) ;;
1305 absdir=`cd "$dir" && pwd`
1306 if test -z "$absdir"; then
1307 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1308 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1314 case " $deplibs " in
1316 *) deplibs="$deplibs $arg";;
1318 case " $lib_search_path " in
1320 *) lib_search_path="$lib_search_path $dir";;
1323 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1324 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1325 case ":$dllsearchpath:" in
1326 ::) dllsearchpath="$dllsearchdir";;
1327 *":$dllsearchdir:"*) ;;
1328 *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
1335 if test "$arg" = "-lc"; then
1337 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
1338 # These systems don't actually have c library (as such)
1342 elif test "$arg" = "-lm"; then
1344 *-*-cygwin* | *-*-beos*)
1345 # These systems don't actually have math library (as such)
1350 deplibs="$deplibs $arg"
1381 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
1382 # We need an absolute path.
1384 [\\/]* | [A-Za-z]:[\\/]*) ;;
1386 $echo "$modename: only absolute run-paths are allowed" 1>&2
1392 *) xrpath="$xrpath $dir" ;;
1398 # If we have no pic_flag, then this is the same as -all-static.
1399 if test -z "$pic_flag" && test -n "$link_static_flag"; then
1400 compile_command="$compile_command $link_static_flag"
1401 finalize_command="$finalize_command $link_static_flag"
1416 # Some other compiler flag.
1418 # Unknown arguments in both finalize_command and compile_command need
1419 # to be aesthetically quoted because they are evaled later.
1420 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1422 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1428 *.o | *.obj | *.a | *.lib)
1429 # A standard object.
1435 if test "$prev" = dlfiles; then
1436 dlfiles="$dlfiles $arg"
1437 if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
1441 # If libtool objects are unsupported, then we need to preload.
1446 if test "$prev" = dlprefiles; then
1447 # Preload the old-style object.
1448 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
1451 libobjs="$libobjs $arg"
1455 # A libtool-controlled library.
1462 # Check to see that this really is a libtool archive.
1463 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
1465 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
1469 # If the library was installed with an old release of libtool,
1470 # it will not redefine variable installed.
1474 # If there is no directory component, then add one.
1476 */* | *\\*) . $arg ;;
1480 # Get the name of the library we link against.
1482 for l in $old_library $library_names; do
1486 if test -z "$linklib"; then
1487 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
1491 # Find the relevant object directory and library name.
1492 name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
1494 if test "X$installed" = Xyes; then
1497 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
1498 if test "X$dir" = "X$arg"; then
1505 if test -n "$dependency_libs"; then
1506 # Extract -R and -L from dependency_libs
1508 for deplib in $dependency_libs; do
1510 -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
1511 case " $rpath $xrpath " in
1512 *" $temp_xrpath "*) ;;
1513 *) xrpath="$xrpath $temp_xrpath";;
1515 -L*) case "$compile_command $temp_deplibs " in
1517 *) temp_deplibs="$temp_deplibs $deplib";;
1519 temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
1520 case " $lib_search_path " in
1522 *) lib_search_path="$lib_search_path $temp_dir";;
1525 *) temp_deplibs="$temp_deplibs $deplib";;
1528 dependency_libs="$temp_deplibs"
1531 if test -z "$libdir"; then
1532 # It is a libtool convenience library, so add in its objects.
1533 convenience="$convenience $dir/$old_library"
1534 old_convenience="$old_convenience $dir/$old_library"
1535 deplibs="$deplibs$dependency_libs"
1536 compile_command="$compile_command $dir/$old_library$dependency_libs"
1537 finalize_command="$finalize_command $dir/$old_library$dependency_libs"
1541 # This library was specified with -dlopen.
1542 if test "$prev" = dlfiles; then
1543 dlfiles="$dlfiles $arg"
1544 if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
1545 # If there is no dlname, no dlopen support or we're linking statically,
1546 # we need to preload.
1549 # We should not create a dependency on this library, but we
1550 # may need any libraries it requires.
1551 compile_command="$compile_command$dependency_libs"
1552 finalize_command="$finalize_command$dependency_libs"
1558 # The library was specified with -dlpreopen.
1559 if test "$prev" = dlprefiles; then
1560 # Prefer using a static library (so that no silly _DYNAMIC symbols
1561 # are required to link).
1562 if test -n "$old_library"; then
1563 dlprefiles="$dlprefiles $dir/$old_library"
1565 dlprefiles="$dlprefiles $dir/$linklib"
1570 if test -n "$library_names" &&
1571 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
1572 link_against_libtool_libs="$link_against_libtool_libs $arg"
1573 if test -n "$shlibpath_var"; then
1574 # Make sure the rpath contains only unique directories.
1575 case "$temp_rpath " in
1577 *) temp_rpath="$temp_rpath $dir" ;;
1581 # We need an absolute path.
1583 [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
1585 absdir=`cd "$dir" && pwd`
1586 if test -z "$absdir"; then
1587 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
1588 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
1594 # This is the magic to use -rpath.
1595 # Skip directories that are in the system default run-time
1596 # search path, unless they have been requested with -R.
1597 case " $sys_lib_dlsearch_path " in
1600 case "$compile_rpath " in
1602 *) compile_rpath="$compile_rpath $absdir"
1607 case " $sys_lib_dlsearch_path " in
1610 case "$finalize_rpath " in
1612 *) finalize_rpath="$finalize_rpath $libdir"
1618 case "$hardcode_action" in
1619 immediate | unsupported)
1620 if test "$hardcode_direct" = no; then
1621 compile_command="$compile_command $dir/$linklib"
1622 deplibs="$deplibs $dir/$linklib"
1624 *-*-cygwin* | *-*-mingw* | *-*-os2*)
1625 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
1626 if test -n "$dllsearchpath"; then
1627 dllsearchpath="$dllsearchpath:$dllsearchdir"
1629 dllsearchpath="$dllsearchdir"
1633 elif test "$hardcode_minus_L" = no; then
1636 compile_shlibpath="$compile_shlibpath$dir:"
1639 case "$compile_command " in
1641 *) compile_command="$compile_command -L$dir";;
1643 compile_command="$compile_command -l$name"
1644 deplibs="$deplibs -L$dir -l$name"
1645 elif test "$hardcode_shlibpath_var" = no; then
1646 case ":$compile_shlibpath:" in
1648 *) compile_shlibpath="$compile_shlibpath$dir:";;
1650 compile_command="$compile_command -l$name"
1651 deplibs="$deplibs -l$name"
1658 if test "$hardcode_direct" = yes; then
1659 compile_command="$compile_command $absdir/$linklib"
1660 deplibs="$deplibs $absdir/$linklib"
1661 elif test "$hardcode_minus_L" = yes; then
1662 case "$compile_command " in
1664 *) compile_command="$compile_command -L$absdir";;
1666 compile_command="$compile_command -l$name"
1667 deplibs="$deplibs -L$absdir -l$name"
1668 elif test "$hardcode_shlibpath_var" = yes; then
1669 case ":$compile_shlibpath:" in
1671 *) compile_shlibpath="$compile_shlibpath$absdir:";;
1673 compile_command="$compile_command -l$name"
1674 deplibs="$deplibs -l$name"
1685 if test "$lib_linked" != yes; then
1686 $echo "$modename: configuration error: unsupported hardcode properties"
1690 # Finalize command for both is simple: just hardcode it.
1691 if test "$hardcode_direct" = yes; then
1692 finalize_command="$finalize_command $libdir/$linklib"
1693 elif test "$hardcode_minus_L" = yes; then
1694 case "$finalize_command " in
1696 *) finalize_command="$finalize_command -L$libdir";;
1698 finalize_command="$finalize_command -l$name"
1699 elif test "$hardcode_shlibpath_var" = yes; then
1700 case ":$finalize_shlibpath:" in
1702 *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
1704 finalize_command="$finalize_command -l$name"
1706 # We cannot seem to hardcode it, guess we'll fake it.
1707 case "$finalize_command " in
1709 *) finalize_command="$finalize_command -L$libdir";;
1711 finalize_command="$finalize_command -l$name"
1714 # Transform directly to old archives if we don't build new libraries.
1715 if test -n "$pic_flag" && test -z "$old_library"; then
1716 $echo "$modename: cannot find static library for \`$arg'" 1>&2
1720 # Here we assume that one of hardcode_direct or hardcode_minus_L
1721 # is not unsupported. This is valid on all known static and
1723 if test "$hardcode_direct" != unsupported; then
1724 test -n "$old_library" && linklib="$old_library"
1725 compile_command="$compile_command $dir/$linklib"
1726 finalize_command="$finalize_command $dir/$linklib"
1728 case "$compile_command " in
1730 *) compile_command="$compile_command -L$dir";;
1732 compile_command="$compile_command -l$name"
1733 case "$finalize_command " in
1735 *) finalize_command="$finalize_command -L$dir";;
1737 finalize_command="$finalize_command -l$name"
1741 # Add in any libraries that this one depends upon.
1742 compile_command="$compile_command$dependency_libs"
1743 finalize_command="$finalize_command$dependency_libs"
1747 # Some other compiler argument.
1749 # Unknown arguments in both finalize_command and compile_command need
1750 # to be aesthetically quoted because they are evaled later.
1751 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1753 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
1760 # Now actually substitute the argument into the commands.
1761 if test -n "$arg"; then
1762 compile_command="$compile_command $arg"
1763 finalize_command="$finalize_command $arg"
1767 if test -n "$prev"; then
1768 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
1773 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
1774 eval arg=\"$export_dynamic_flag_spec\"
1775 compile_command="$compile_command $arg"
1776 finalize_command="$finalize_command $arg"
1780 # calculate the name of the file, without its directory
1781 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
1782 libobjs_save="$libobjs"
1786 $echo "$modename: you must specify an output file" 1>&2
1792 if test -n "$link_against_libtool_libs"; then
1793 $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
1797 if test -n "$deplibs"; then
1798 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
1801 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1802 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
1805 if test -n "$rpath"; then
1806 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
1809 if test -n "$xrpath"; then
1810 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
1813 if test -n "$vinfo"; then
1814 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
1817 if test -n "$release"; then
1818 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
1821 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
1822 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
1825 # Now set the variables for building old libraries.
1826 build_libtool_libs=no
1831 # Make sure we only generate libraries of the form `libNAME.la'.
1832 case "$outputname" in
1834 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
1835 eval libname=\"$libname_spec\"
1838 if test "$module" = no; then
1839 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
1843 if test "$need_lib_prefix" != no; then
1844 # Add the "lib" prefix for modules if required
1845 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1846 eval libname=\"$libname_spec\"
1848 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
1853 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
1854 if test "X$output_objdir" = "X$output"; then
1855 output_objdir="$objdir"
1857 output_objdir="$output_objdir/$objdir"
1860 if test -n "$objs"; then
1861 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
1865 # How the heck are we supposed to write a wrapper for a shared library?
1866 if test -n "$link_against_libtool_libs"; then
1867 $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
1871 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
1872 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
1876 if test $# -gt 2; then
1877 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
1882 if test -z "$rpath"; then
1883 if test "$build_libtool_libs" = yes; then
1884 # Building a libtool convenience library.
1886 oldlibs="$output_objdir/$libname.$libext $oldlibs"
1887 build_libtool_libs=convenience
1890 dependency_libs="$deplibs"
1892 if test -n "$vinfo"; then
1893 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
1896 if test -n "$release"; then
1897 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
1901 # Parse the version information argument.
1902 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
1903 set dummy $vinfo 0 0 0
1906 if test -n "$8"; then
1907 $echo "$modename: too many parameters to \`-version-info'" 1>&2
1916 # Check that each of the things are valid numbers.
1918 0 | [1-9] | [1-9][0-9]*) ;;
1920 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
1921 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1927 0 | [1-9] | [1-9][0-9]*) ;;
1929 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
1930 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1936 0 | [1-9] | [1-9][0-9]*) ;;
1938 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
1939 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1944 if test $age -gt $current; then
1945 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
1946 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
1950 # Calculate the version variables.
1954 case "$version_type" in
1958 major=`expr $current - $age + 1`
1959 versuffix="$major.$revision"
1960 verstring="sgi$major.$revision"
1962 # Add in all the interfaces that we are compatible with.
1964 while test $loop != 0; do
1965 iface=`expr $revision - $loop`
1966 loop=`expr $loop - 1`
1967 verstring="sgi$major.$iface:$verstring"
1972 major=.`expr $current - $age`
1973 versuffix="$major.$age.$revision"
1977 major=`expr $current - $age`
1978 versuffix=".$current.$age.$revision"
1979 verstring="$current.$age.$revision"
1981 # Add in all the interfaces that we are compatible with.
1983 while test $loop != 0; do
1984 iface=`expr $current - $loop`
1985 loop=`expr $loop - 1`
1986 verstring="$verstring:${iface}.0"
1989 # Make executables depend on our current version.
1990 verstring="$verstring:${current}.0"
1995 versuffix=".$current.$revision"
2000 versuffix=".$current.$revision";
2005 versuffix=".$current";
2009 # Like Linux, but with '-' rather than '.', since we only
2010 # want one extension on Windows 95.
2011 major=`expr $current - $age`
2012 versuffix="-$major-$age-$revision"
2016 $echo "$modename: unknown library version type \`$version_type'" 1>&2
2017 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
2022 # Clear the version info if we defaulted, and they specified a release.
2023 if test -z "$vinfo" && test -n "$release"; then
2026 if test "$need_version" = no; then
2033 # Remove version info from name if versioning should be avoided
2034 if test "$avoid_version" = yes && test "$need_version" = no; then
2040 # Check to see if the archive will have undefined symbols.
2041 if test "$allow_undefined" = yes; then
2042 if test "$allow_undefined_flag" = unsupported; then
2043 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
2044 build_libtool_libs=no
2048 # Don't allow undefined symbols.
2049 allow_undefined_flag="$no_undefined_flag"
2052 dependency_libs="$deplibs"
2054 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
2055 # these systems don't actually have a c library (as such)!
2058 # Add libc to deplibs on all other systems.
2059 deplibs="$deplibs -lc"
2064 # Create the output directory, or remove our outputs if we need to.
2065 if test -d $output_objdir; then
2066 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
2067 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
2069 $show "$mkdir $output_objdir"
2070 $run $mkdir $output_objdir
2072 if test $status -ne 0 && test ! -d $output_objdir; then
2077 # Now set the variables for building old libraries.
2078 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
2079 oldlibs="$oldlibs $output_objdir/$libname.$libext"
2081 # Transform .lo files to .o files.
2082 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
2085 if test "$build_libtool_libs" = yes; then
2086 # Transform deplibs into only deplibs that can be linked in shared.
2088 libname_save=$libname
2089 release_save=$release
2090 versuffix_save=$versuffix
2092 # I'm not sure if I'm treating the release correctly. I think
2093 # release should show up in the -l (ie -lgmp5) so we don't want to
2094 # add it in twice. Is that correct?
2100 case "$deplibs_check_method" in
2102 # Don't check for shared/static. Everything works.
2103 # This might be a little naive. We might want to check
2104 # whether the library exists or not. But this is on
2105 # osf3 & osf4 and I'm not really sure... Just
2106 # implementing what was already the behaviour.
2110 # This code stresses the "libraries are programs" paradigm to its
2111 # limits. Maybe even breaks it. We compile a program, linking it
2112 # against the deplibs as a proxy for the library. Then we can check
2113 # whether they linked in statically or dynamically with ldd.
2115 cat > conftest.c <<EOF
2116 int main() { return 0; }
2119 $C_compiler -o conftest conftest.c $deplibs
2120 if test $? -eq 0 ; then
2121 ldd_output=`ldd conftest`
2122 for i in $deplibs; do
2123 name="`expr $i : '-l\(.*\)'`"
2124 # If $name is empty we are operating on a -L argument.
2125 if test "$name" != "" ; then
2126 libname=`eval \\$echo \"$libname_spec\"`
2127 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2128 set dummy $deplib_matches
2130 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2131 newdeplibs="$newdeplibs $i"
2135 echo "*** Warning: This library needs some functionality provided by $i."
2136 echo "*** I have the capability to make that library automatically link in when"
2137 echo "*** you link to this library. But I can only do this if you have a"
2138 echo "*** shared version of the library, which you do not appear to have."
2141 newdeplibs="$newdeplibs $i"
2145 # Error occured in the first compile. Let's try to salvage the situation:
2146 # Compile a seperate program for each library.
2147 for i in $deplibs; do
2148 name="`expr $i : '-l\(.*\)'`"
2149 # If $name is empty we are operating on a -L argument.
2150 if test "$name" != "" ; then
2152 $C_compiler -o conftest conftest.c $i
2154 if test $? -eq 0 ; then
2155 ldd_output=`ldd conftest`
2156 libname=`eval \\$echo \"$libname_spec\"`
2157 deplib_matches=`eval \\$echo \"$library_names_spec\"`
2158 set dummy $deplib_matches
2160 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
2161 newdeplibs="$newdeplibs $i"
2165 echo "*** Warning: This library needs some functionality provided by $i."
2166 echo "*** I have the capability to make that library automatically link in when"
2167 echo "*** you link to this library. But I can only do this if you have a"
2168 echo "*** shared version of the library, which you do not appear to have."
2173 echo "*** Warning! Library $i is needed by this library but I was not able to"
2174 echo "*** make it link in! You will probably need to install it or some"
2175 echo "*** library that it depends on before this library will be fully"
2176 echo "*** functional. Installing it before continuing would be even better."
2179 newdeplibs="$newdeplibs $i"
2185 set dummy $deplibs_check_method
2186 file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
2187 for a_deplib in $deplibs; do
2188 name="`expr $a_deplib : '-l\(.*\)'`"
2189 # If $name is empty we are operating on a -L argument.
2190 if test "$name" != "" ; then
2191 libname=`eval \\$echo \"$libname_spec\"`
2192 for i in $lib_search_path; do
2193 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
2194 for potent_lib in $potential_libs; do
2195 # Follow soft links.
2196 if ls -lLd "$potent_lib" 2>/dev/null \
2197 | grep " -> " >/dev/null; then
2200 # The statement above tries to avoid entering an
2201 # endless loop below, in case of cyclic links.
2202 # We might still enter an endless loop, since a link
2203 # loop can be closed while we follow links,
2205 potlib="$potent_lib"
2206 while test -h "$potlib" 2>/dev/null; do
2207 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
2208 case "$potliblink" in
2209 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
2210 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
2213 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
2215 | egrep "$file_magic_regex" > /dev/null; then
2216 newdeplibs="$newdeplibs $a_deplib"
2222 if test -n "$a_deplib" ; then
2225 echo "*** Warning: This library needs some functionality provided by $a_deplib."
2226 echo "*** I have the capability to make that library automatically link in when"
2227 echo "*** you link to this library. But I can only do this if you have a"
2228 echo "*** shared version of the library, which you do not appear to have."
2231 # Add a -L argument.
2232 newdeplibs="$newdeplibs $a_deplib"
2234 done # Gone through all deplibs.
2238 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
2239 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
2240 grep . >/dev/null; then
2242 if test "X$deplibs_check_method" = "Xnone"; then
2243 echo "*** Warning: inter-library dependencies are not supported in this platform."
2245 echo "*** Warning: inter-library dependencies are not known to be supported."
2247 echo "*** All declared inter-library dependencies are being dropped."
2252 versuffix=$versuffix_save
2254 release=$release_save
2255 libname=$libname_save
2258 if test "$droppeddeps" = yes; then
2259 if test "$module" = yes; then
2261 echo "*** Warning: libtool could not satisfy all declared inter-library"
2262 echo "*** dependencies of module $libname. Therefore, libtool will create"
2263 echo "*** a static module, that should work as long as the dlopening"
2264 echo "*** application is linked with the -dlopen flag."
2265 if test -z "$global_symbol_pipe"; then
2267 echo "*** However, this would only work if libtool was able to extract symbol"
2268 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
2269 echo "*** not find such a program. So, this module is probably useless."
2270 echo "*** \`nm' from GNU binutils and a full rebuild may help."
2272 if test "$build_old_libs" = no; then
2273 oldlibs="$output_objdir/$libname.$libext"
2274 build_libtool_libs=module
2277 build_libtool_libs=no
2280 echo "*** The inter-library dependencies that have been dropped here will be"
2281 echo "*** automatically added whenever a program is linked with this library"
2282 echo "*** or is declared to -dlopen it."
2285 # Done checking deplibs!
2289 # All the library-specific variables (install_libdir is set above).
2294 # Test again, we may have decided not to build it any more
2295 if test "$build_libtool_libs" = yes; then
2296 # Get the real and link names of the library.
2297 eval library_names=\"$library_names_spec\"
2298 set dummy $library_names
2302 if test -n "$soname_spec"; then
2303 eval soname=\"$soname_spec\"
2308 lib="$output_objdir/$realname"
2311 linknames="$linknames $link"
2314 # Ensure that we have .o objects for linkers which dislike .lo
2315 # (e.g. aix) incase we are running --disable-static
2316 for obj in $libobjs; do
2317 oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
2318 if test ! -f $oldobj; then
2319 $show "${LN_S} $obj $oldobj"
2320 $run ${LN_S} $obj $oldobj || exit $?
2324 # Use standard objects if they are pic
2325 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2327 # Prepare the list of exported symbols
2328 if test -z "$export_symbols"; then
2329 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
2330 $show "generating symbol list for \`$libname.la'"
2331 export_symbols="$output_objdir/$libname.exp"
2332 $run $rm $export_symbols
2333 eval cmds=\"$export_symbols_cmds\"
2334 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2335 for cmd in $cmds; do
2338 $run eval "$cmd" || exit $?
2341 if test -n "$export_symbols_regex"; then
2342 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
2343 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
2344 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
2345 $run eval '$mv "${export_symbols}T" "$export_symbols"'
2350 if test -n "$export_symbols" && test -n "$include_expsyms"; then
2351 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
2354 if test -n "$convenience"; then
2355 if test -n "$whole_archive_flag_spec"; then
2356 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
2358 gentop="$output_objdir/${outputname}x"
2359 $show "${rm}r $gentop"
2360 $run ${rm}r "$gentop"
2361 $show "mkdir $gentop"
2362 $run mkdir "$gentop"
2364 if test $status -ne 0 && test ! -d "$gentop"; then
2367 generated="$generated $gentop"
2369 for xlib in $convenience; do
2370 # Extract the objects.
2372 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2373 *) xabs=`pwd`"/$xlib" ;;
2375 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2376 xdir="$gentop/$xlib"
2378 $show "${rm}r $xdir"
2383 if test $status -ne 0 && test ! -d "$xdir"; then
2386 $show "(cd $xdir && $AR x $xabs)"
2387 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2389 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2394 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
2395 eval flag=\"$thread_safe_flag_spec\"
2396 linkopts="$linkopts $flag"
2399 # Do each of the archive commands.
2400 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
2401 eval cmds=\"$archive_expsym_cmds\"
2403 eval cmds=\"$archive_cmds\"
2405 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2406 for cmd in $cmds; do
2409 $run eval "$cmd" || exit $?
2413 # Create links to the real library.
2414 for linkname in $linknames; do
2415 if test "$realname" != "$linkname"; then
2416 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
2417 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
2421 # If -module or -export-dynamic was specified, set the dlname.
2422 if test "$module" = yes || test "$export_dynamic" = yes; then
2423 # On all known operating systems, these are identical.
2430 if test -n "$link_against_libtool_libs"; then
2431 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
2435 if test -n "$deplibs"; then
2436 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
2439 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2440 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
2443 if test -n "$rpath"; then
2444 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
2447 if test -n "$xrpath"; then
2448 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
2451 if test -n "$vinfo"; then
2452 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
2455 if test -n "$release"; then
2456 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
2461 if test -n "$objs"; then
2462 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
2466 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
2474 # Delete the old objects.
2475 $run $rm $obj $libobj
2477 # Objects from convenience libraries. This assumes
2478 # single-version convenience libraries. Whenever we create
2479 # different ones for PIC/non-PIC, this we'll have to duplicate
2483 # reload_cmds runs $LD directly, so let us get rid of
2484 # -Wl from whole_archive_flag_spec
2487 if test -n "$convenience"; then
2488 if test -n "$whole_archive_flag_spec"; then
2489 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
2491 gentop="$output_objdir/${obj}x"
2492 $show "${rm}r $gentop"
2493 $run ${rm}r "$gentop"
2494 $show "mkdir $gentop"
2495 $run mkdir "$gentop"
2497 if test $status -ne 0 && test ! -d "$gentop"; then
2500 generated="$generated $gentop"
2502 for xlib in $convenience; do
2503 # Extract the objects.
2505 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
2506 *) xabs=`pwd`"/$xlib" ;;
2508 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
2509 xdir="$gentop/$xlib"
2511 $show "${rm}r $xdir"
2516 if test $status -ne 0 && test ! -d "$xdir"; then
2519 $show "(cd $xdir && $AR x $xabs)"
2520 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
2522 reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
2527 # Create the old-style object.
2528 reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs"
2531 eval cmds=\"$reload_cmds\"
2532 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2533 for cmd in $cmds; do
2536 $run eval "$cmd" || exit $?
2540 # Exit if we aren't doing a library object file.
2541 if test -z "$libobj"; then
2542 if test -n "$gentop"; then
2543 $show "${rm}r $gentop"
2550 if test "$build_libtool_libs" != yes; then
2551 if test -n "$gentop"; then
2552 $show "${rm}r $gentop"
2556 # Create an invalid libtool object if no PIC, so that we don't
2557 # accidentally link it into a program.
2558 $show "echo timestamp > $libobj"
2559 $run eval "echo timestamp > $libobj" || exit $?
2563 if test -n "$pic_flag"; then
2564 # Only do commands if we really have different PIC objects.
2565 reload_objs="$libobjs $reload_conv_objs"
2567 eval cmds=\"$reload_cmds\"
2568 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
2569 for cmd in $cmds; do
2572 $run eval "$cmd" || exit $?
2576 # Just create a symlink.
2579 $show "$LN_S $obj $libobj"
2580 $run $LN_S $obj $libobj || exit $?
2583 if test -n "$gentop"; then
2584 $show "${rm}r $gentop"
2591 # Anything else should be a program.
2593 if test -n "$vinfo"; then
2594 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
2597 if test -n "$release"; then
2598 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
2601 if test "$preload" = yes; then
2602 if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
2603 test "$dlopen_self_static" = unknown; then
2604 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
2608 if test -n "$rpath$xrpath"; then
2609 # If the user specified any rpath flags, then add them.
2610 for libdir in $rpath $xrpath; do
2611 # This is the magic to use -rpath.
2612 case "$compile_rpath " in
2614 *) compile_rpath="$compile_rpath $libdir" ;;
2616 case "$finalize_rpath " in
2618 *) finalize_rpath="$finalize_rpath $libdir" ;;
2623 # Now hardcode the library paths
2626 for libdir in $compile_rpath $finalize_rpath; do
2627 if test -n "$hardcode_libdir_flag_spec"; then
2628 if test -n "$hardcode_libdir_separator"; then
2629 if test -z "$hardcode_libdirs"; then
2630 hardcode_libdirs="$libdir"
2632 # Just accumulate the unique libdirs.
2633 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2634 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2637 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2642 eval flag=\"$hardcode_libdir_flag_spec\"
2643 rpath="$rpath $flag"
2645 elif test -n "$runpath_var"; then
2646 case "$perm_rpath " in
2648 *) perm_rpath="$perm_rpath $libdir" ;;
2652 # Substitute the hardcoded libdirs into the rpath.
2653 if test -n "$hardcode_libdir_separator" &&
2654 test -n "$hardcode_libdirs"; then
2655 libdir="$hardcode_libdirs"
2656 eval rpath=\" $hardcode_libdir_flag_spec\"
2658 compile_rpath="$rpath"
2662 for libdir in $finalize_rpath; do
2663 if test -n "$hardcode_libdir_flag_spec"; then
2664 if test -n "$hardcode_libdir_separator"; then
2665 if test -z "$hardcode_libdirs"; then
2666 hardcode_libdirs="$libdir"
2668 # Just accumulate the unique libdirs.
2669 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
2670 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
2673 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
2678 eval flag=\"$hardcode_libdir_flag_spec\"
2679 rpath="$rpath $flag"
2681 elif test -n "$runpath_var"; then
2682 case "$finalize_perm_rpath " in
2684 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
2688 # Substitute the hardcoded libdirs into the rpath.
2689 if test -n "$hardcode_libdir_separator" &&
2690 test -n "$hardcode_libdirs"; then
2691 libdir="$hardcode_libdirs"
2692 eval rpath=\" $hardcode_libdir_flag_spec\"
2694 finalize_rpath="$rpath"
2696 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
2697 if test "X$output_objdir" = "X$output"; then
2698 output_objdir="$objdir"
2700 output_objdir="$output_objdir/$objdir"
2703 # Create the binary in the object directory, then wrap it.
2704 if test ! -d $output_objdir; then
2705 $show "$mkdir $output_objdir"
2706 $run $mkdir $output_objdir
2708 if test $status -ne 0 && test ! -d $output_objdir; then
2713 if test -n "$libobjs" && test "$build_old_libs" = yes; then
2714 # Transform all the library objects into standard objects.
2715 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2716 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2720 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2721 if test -n "$NM" && test -n "$global_symbol_pipe"; then
2722 dlsyms="${outputname}S.c"
2724 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
2728 if test -n "$dlsyms"; then
2732 # Discover the nlist of each of the dlfiles.
2733 nlist="$output_objdir/${outputname}.nm"
2735 $show "$rm $nlist ${nlist}S ${nlist}T"
2736 $run $rm "$nlist" "${nlist}S" "${nlist}T"
2738 # Parse the name list into a source file.
2739 $show "creating $output_objdir/$dlsyms"
2741 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
2742 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
2743 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
2749 /* Prevent the only kind of declaration conflicts we can make. */
2750 #define lt_preloaded_symbols some_other_symbol
2752 /* External symbol declarations for the compiler. */\
2755 if test "$dlself" = yes; then
2756 $show "generating symbol list for \`$output'"
2758 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
2760 # Add our own program objects to the symbol list.
2761 progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2762 for arg in $progfiles; do
2763 $show "extracting global C symbols from \`$arg'"
2764 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2767 if test -n "$exclude_expsyms"; then
2768 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2769 $run eval '$mv "$nlist"T "$nlist"'
2772 if test -n "$export_symbols_regex"; then
2773 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2774 $run eval '$mv "$nlist"T "$nlist"'
2777 # Prepare the list of exported symbols
2778 if test -z "$export_symbols"; then
2779 export_symbols="$output_objdir/$output.exp"
2780 $run $rm $export_symbols
2781 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2783 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
2784 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
2785 $run eval 'mv "$nlist"T "$nlist"'
2789 for arg in $dlprefiles; do
2790 $show "extracting global C symbols from \`$arg'"
2791 name=`echo "$arg" | sed -e 's%^.*/%%'`
2792 $run eval 'echo ": $name " >> "$nlist"'
2793 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
2796 if test -z "$run"; then
2797 # Make sure we have at least an empty file.
2798 test -f "$nlist" || : > "$nlist"
2800 if test -n "$exclude_expsyms"; then
2801 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2802 $mv "$nlist"T "$nlist"
2805 # Try sorting and uniquifying the output.
2806 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
2809 grep -v "^: " < "$nlist" > "$nlist"S
2812 if test -f "$nlist"S; then
2813 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
2815 echo '/* NONE */' >> "$output_objdir/$dlsyms"
2818 $echo >> "$output_objdir/$dlsyms" "\
2820 #undef lt_preloaded_symbols
2822 #if defined (__STDC__) && __STDC__
2823 # define lt_ptr_t void *
2825 # define lt_ptr_t char *
2829 /* The mapping between symbol names and symbols. */
2834 lt_preloaded_symbols[] =
2838 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
2839 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
2840 < "$nlist" >> "$output_objdir/$dlsyms"
2842 $echo >> "$output_objdir/$dlsyms" "\
2846 /* This works around a problem in FreeBSD linker */
2847 #ifdef FREEBSD_WORKAROUND
2848 static const void *lt_preloaded_setup() {
2849 return lt_preloaded_symbols;
2859 pic_flag_for_symtable=
2861 # compiling the symbol table file with pic_flag works around
2862 # a FreeBSD bug that causes programs to crash when -lm is
2863 # linked before any other PIC object. But we must not use
2864 # pic_flag when linking with -static. The problem exists in
2865 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2866 *-*-freebsd2*|*-*-freebsd3.0*)
2867 case "$compile_command " in
2869 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
2873 # Now compile the dynamic symbol file.
2874 $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
2875 $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
2877 # Clean up the generated files.
2878 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
2879 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
2881 # Transform the symbol file into the correct name.
2882 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2883 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
2886 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
2891 # We keep going just in case the user didn't refer to
2892 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2893 # really was required.
2895 # Nullify the symbol file.
2896 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2897 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2900 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
2901 # Replace the output file specification.
2902 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
2903 link_command="$compile_command$compile_rpath"
2905 # We have no uninstalled library dependencies, so finalize right now.
2906 $show "$link_command"
2907 $run eval "$link_command"
2910 # Delete the generated files.
2911 if test -n "$dlsyms"; then
2912 $show "$rm $output_objdir/${outputname}S.${objext}"
2913 $run $rm "$output_objdir/${outputname}S.${objext}"
2919 if test -n "$shlibpath_var"; then
2920 # We should set the shlibpath_var
2922 for dir in $temp_rpath; do
2924 [\\/]* | [A-Za-z]:[\\/]*)
2929 # Relative path: add a thisdir entry.
2930 rpath="$rpath\$thisdir/$dir:"
2937 if test -n "$compile_shlibpath$finalize_shlibpath"; then
2938 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
2940 if test -n "$finalize_shlibpath"; then
2941 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
2946 if test -n "$runpath_var"; then
2947 if test -n "$perm_rpath"; then
2948 # We should set the runpath_var.
2950 for dir in $perm_rpath; do
2953 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
2955 if test -n "$finalize_perm_rpath"; then
2956 # We should set the runpath_var.
2958 for dir in $finalize_perm_rpath; do
2961 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
2965 if test "$hardcode_action" = relink; then
2966 # Fast installation is not supported
2967 link_command="$compile_var$compile_command$compile_rpath"
2968 relink_command="$finalize_var$finalize_command$finalize_rpath"
2970 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
2971 $echo "$modename: \`$output' will be relinked during installation" 1>&2
2973 if test "$fast_install" != no; then
2974 link_command="$finalize_var$compile_command$finalize_rpath"
2975 if test "$fast_install" = yes; then
2976 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
2978 # fast_install is set to needless
2982 link_command="$compile_var$compile_command$compile_rpath"
2983 relink_command="$finalize_var$finalize_command$finalize_rpath"
2987 # Replace the output file specification.
2988 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
2990 # Delete the old output files.
2991 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
2993 $show "$link_command"
2994 $run eval "$link_command" || exit $?
2996 # Now create the wrapper script.
2997 $show "creating $output"
2999 # Quote the relink command for shipping.
3000 if test -n "$relink_command"; then
3001 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
3004 # Quote $echo for shipping.
3005 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
3007 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
3008 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
3010 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
3012 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
3015 # Only actually do things if our run command is non-null.
3016 if test -z "$run"; then
3017 # win32 will think the script is a binary if it has
3018 # a .exe suffix, so we strip it off here.
3020 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
3023 trap "$rm $output; exit 1" 1 2 15
3028 # $output - temporary wrapper script for $objdir/$outputname
3029 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3031 # The $output program cannot be directly executed until all the libtool
3032 # libraries that it depends on are installed.
3034 # This wrapper script should never be moved out of the build directory.
3035 # If it is, it will not operate correctly.
3037 # Sed substitution that helps us do robust quoting. It backslashifies
3038 # metacharacters that are still active within double-quoted strings.
3039 Xsed='sed -e 1s/^X//'
3040 sed_quote_subst='$sed_quote_subst'
3042 # The HP-UX ksh and POSIX shell print the target directory to stdout
3044 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
3046 relink_command=\"$relink_command\"
3048 # This environment variable determines our operation mode.
3049 if test \"\$libtool_install_magic\" = \"$magic\"; then
3050 # install mode needs the following variable:
3051 link_against_libtool_libs='$link_against_libtool_libs'
3053 # When we are sourced in execute mode, \$file and \$echo are already set.
3054 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3057 # Make sure echo works.
3058 if test \"X\$1\" = X--no-reexec; then
3059 # Discard the --no-reexec flag, and continue.
3061 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
3062 # Yippee, \$echo works!
3065 # Restart under the correct shell, and then maybe \$echo will work.
3066 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
3072 # Find the directory that this script lives in.
3073 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
3074 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
3076 # Follow symbolic links until we get to the real thisdir.
3077 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
3078 while test -n \"\$file\"; do
3079 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
3081 # If there was a directory component, then change thisdir.
3082 if test \"x\$destdir\" != \"x\$file\"; then
3083 case \"\$destdir\" in
3084 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
3085 *) thisdir=\"\$thisdir/\$destdir\" ;;
3089 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
3090 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
3093 # Try to get the absolute directory name.
3094 absdir=\`cd \"\$thisdir\" && pwd\`
3095 test -n \"\$absdir\" && thisdir=\"\$absdir\"
3098 if test "$fast_install" = yes; then
3100 program=lt-'$outputname'
3101 progdir=\"\$thisdir/$objdir\"
3103 if test ! -f \"\$progdir/\$program\" || \\
3104 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
3105 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
3107 file=\"\$\$-\$program\"
3109 if test ! -d \"\$progdir\"; then
3110 $mkdir \"\$progdir\"
3112 $rm \"\$progdir/\$file\"
3117 # relink executable if necessary
3118 if test -n \"\$relink_command\"; then
3119 if (cd \"\$thisdir\" && eval \$relink_command); then :
3121 $rm \"\$progdir/\$file\"
3126 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
3127 { $rm \"\$progdir/\$program\";
3128 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
3129 $rm \"\$progdir/\$file\"
3133 program='$outputname$exeext'
3134 progdir=\"\$thisdir/$objdir\"
3140 if test -f \"\$progdir/\$program\"; then"
3142 # Export our shlibpath_var if we have one.
3143 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3145 # Add our own library path to $shlibpath_var
3146 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
3148 # Some systems cannot cope with colon-terminated $shlibpath_var
3149 # The second colon is a workaround for a bug in BeOS R4 sed
3150 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
3152 export $shlibpath_var
3156 # fixup the dll searchpath if we need to.
3157 if test -n "$dllsearchpath"; then
3159 # Add the dll search path components to the executable PATH
3160 PATH=$dllsearchpath:\$PATH
3165 if test \"\$libtool_execute_magic\" != \"$magic\"; then
3166 # Run the actual program with our arguments.
3169 *-*-cygwin* | *-*-mingw | *-*-os2*)
3170 # win32 systems need to use the prog path for dll
3173 exec \$progdir\\\\\$program \${1+\"\$@\"}
3178 # Export the path to the program.
3179 PATH=\"\$progdir:\$PATH\"
3182 exec \$program \${1+\"\$@\"}
3187 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
3191 # The program doesn't exist.
3192 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
3193 \$echo \"This script is just a wrapper for \$program.\" 1>&2
3194 echo \"See the $PACKAGE documentation for more information.\" 1>&2
3205 # See if we need to build an old-fashioned archive.
3206 for oldlib in $oldlibs; do
3208 if test "$build_libtool_libs" = convenience; then
3209 oldobjs="$libobjs_save"
3210 addlibs="$convenience"
3211 build_libtool_libs=no
3213 if test "$build_libtool_libs" = module; then
3214 oldobjs="$libobjs_save"
3215 build_libtool_libs=no
3217 oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
3219 addlibs="$old_convenience"
3222 if test -n "$addlibs"; then
3223 gentop="$output_objdir/${outputname}x"
3224 $show "${rm}r $gentop"
3225 $run ${rm}r "$gentop"
3226 $show "mkdir $gentop"
3227 $run mkdir "$gentop"
3229 if test $status -ne 0 && test ! -d "$gentop"; then
3232 generated="$generated $gentop"
3234 # Add in members from convenience archives.
3235 for xlib in $addlibs; do
3236 # Extract the objects.
3238 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3239 *) xabs=`pwd`"/$xlib" ;;
3241 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3242 xdir="$gentop/$xlib"
3244 $show "${rm}r $xdir"
3249 if test $status -ne 0 && test ! -d "$xdir"; then
3252 $show "(cd $xdir && $AR x $xabs)"
3253 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3255 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
3259 # Do each command in the archive commands.
3260 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
3261 eval cmds=\"$old_archive_from_new_cmds\"
3263 # Ensure that we have .o objects in place incase we decided
3264 # not to build a shared library, and have fallen back to building
3265 # static libs even though --disable-static was passed!
3266 for oldobj in $oldobjs; do
3267 if test ! -f $oldobj; then
3268 obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
3269 $show "${LN_S} $obj $oldobj"
3270 $run ${LN_S} $obj $oldobj || exit $?
3274 eval cmds=\"$old_archive_cmds\"
3276 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3277 for cmd in $cmds; do
3280 $run eval "$cmd" || exit $?
3285 if test -n "$generated"; then
3286 $show "${rm}r$generated"
3287 $run ${rm}r$generated
3290 # Now create the libtool archive.
3294 test "$build_old_libs" = yes && old_library="$libname.$libext"
3295 $show "creating $output"
3297 if test -n "$xrpath"; then
3299 for libdir in $xrpath; do
3300 temp_xrpath="$temp_xrpath -R$libdir"
3302 dependency_libs="$temp_xrpath $dependency_libs"
3305 # Only create the output if not a dry run.
3306 if test -z "$run"; then
3307 for installed in no yes; do
3308 if test "$installed" = yes; then
3309 if test -z "$install_libdir"; then
3312 output="$output_objdir/$outputname"i
3316 # $outputname - a libtool library file
3317 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
3319 # Please DO NOT delete this file!
3320 # It is necessary for linking the library.
3322 # The name that we can dlopen(3).
3325 # Names of this library.
3326 library_names='$library_names'
3328 # The name of the static archive.
3329 old_library='$old_library'
3331 # Libraries that this one depends upon.
3332 dependency_libs='$dependency_libs'
3334 # Version information for $libname.
3339 # Is this an already installed library?
3340 installed=$installed
3342 # Directory that this library needs to be installed in:
3343 libdir='$install_libdir'\
3348 # Do a symbolic link so that the libtool archive can be found in
3349 # LD_LIBRARY_PATH before the program is installed.
3350 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
3351 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
3357 # libtool install mode
3359 modename="$modename: install"
3361 # There may be an optional sh(1) argument at the beginning of
3362 # install_prog (especially on Windows NT).
3363 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
3364 # Aesthetically quote it.
3365 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
3367 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3371 install_prog="$arg "
3379 # The real first argument should be the name of the installation program.
3380 # Aesthetically quote it.
3381 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3383 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3387 install_prog="$install_prog$arg"
3389 # We need to accept at least all the BSD install flags.
3399 if test -n "$dest"; then
3400 files="$files $dest"
3418 # If the previous option needed an argument, then skip it.
3419 if test -n "$prev"; then
3428 # Aesthetically quote the argument.
3429 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
3431 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
3435 install_prog="$install_prog $arg"
3438 if test -z "$install_prog"; then
3439 $echo "$modename: you must specify an install program" 1>&2
3444 if test -n "$prev"; then
3445 $echo "$modename: the \`$prev' option requires an argument" 1>&2
3450 if test -z "$files"; then
3451 if test -z "$dest"; then
3452 $echo "$modename: no file or destination specified" 1>&2
3454 $echo "$modename: you must specify a destination" 1>&2
3460 # Strip any trailing slash from the destination.
3461 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
3463 # Check to see that the destination is a directory.
3464 test -d "$dest" && isdir=yes
3465 if test "$isdir" = yes; then
3469 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
3470 test "X$destdir" = "X$dest" && destdir=.
3471 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
3473 # Not a directory, so check to see that there is only one file specified.
3475 if test $# -gt 2; then
3476 $echo "$modename: \`$dest' is not a directory" 1>&2
3482 [\\/]* | [A-Za-z]:[\\/]*) ;;
3484 for file in $files; do
3488 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
3497 # This variable tells wrapper scripts just to set variables rather
3498 # than running their programs.
3499 libtool_install_magic="$magic"
3504 for file in $files; do
3506 # Do each installation.
3509 # Do the static libraries later.
3510 staticlibs="$staticlibs $file"
3514 # Check to see that this really is a libtool archive.
3515 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3517 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
3524 # If there is no directory component, then add one.
3526 */* | *\\*) . $file ;;
3530 # Add the libdir to current_libdirs if it is the destination.
3531 if test "X$destdir" = "X$libdir"; then
3532 case "$current_libdirs " in
3534 *) current_libdirs="$current_libdirs $libdir" ;;
3537 # Note the libdir as a future libdir.
3538 case "$future_libdirs " in
3540 *) future_libdirs="$future_libdirs $libdir" ;;
3544 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
3545 test "X$dir" = "X$file/" && dir=
3548 # See the names of the shared library.
3549 set dummy $library_names
3550 if test -n "$2"; then
3555 # Install the shared library and build the symlinks.
3556 $show "$install_prog $dir/$realname $destdir/$realname"
3557 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
3559 if test $# -gt 0; then
3560 # Delete the old symlinks, and create new ones.
3563 if test "$linkname" != "$realname"; then
3564 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3565 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
3570 # Do each command in the postinstall commands.
3571 lib="$destdir/$realname"
3572 eval cmds=\"$postinstall_cmds\"
3573 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3574 for cmd in $cmds; do
3577 $run eval "$cmd" || exit $?
3582 # Install the pseudo-library for information purposes.
3583 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3584 instname="$dir/$name"i
3585 $show "$install_prog $instname $destdir/$name"
3586 $run eval "$install_prog $instname $destdir/$name" || exit $?
3588 # Maybe install the static library, too.
3589 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
3593 # Install (i.e. copy) a libtool object.
3595 # Figure out destination file name, if it wasn't already specified.
3596 if test -n "$destname"; then
3597 destfile="$destdir/$destname"
3599 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3600 destfile="$destdir/$destfile"
3603 # Deduce the name of the destination old-style object file.
3606 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
3609 staticdest="$destfile"
3613 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
3619 # Install the libtool object if requested.
3620 if test -n "$destfile"; then
3621 $show "$install_prog $file $destfile"
3622 $run eval "$install_prog $file $destfile" || exit $?
3625 # Install the old object if enabled.
3626 if test "$build_old_libs" = yes; then
3627 # Deduce the name of the old-style object file.
3628 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
3630 $show "$install_prog $staticobj $staticdest"
3631 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
3637 # Figure out destination file name, if it wasn't already specified.
3638 if test -n "$destname"; then
3639 destfile="$destdir/$destname"
3641 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3642 destfile="$destdir/$destfile"
3645 # Do a test to see if this is really a libtool program.
3646 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3647 link_against_libtool_libs=
3650 # If there is no directory component, then add one.
3652 */* | *\\*) . $file ;;
3656 # Check the variables that should have been set.
3657 if test -z "$link_against_libtool_libs"; then
3658 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
3663 for lib in $link_against_libtool_libs; do
3664 # Check to see that each library is installed.
3666 if test -f "$lib"; then
3667 # If there is no directory component, then add one.
3669 */* | *\\*) . $lib ;;
3673 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
3674 if test -n "$libdir" && test ! -f "$libfile"; then
3675 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
3681 if test "$fast_install" = no && test -n "$relink_command"; then
3682 if test "$finalize" = yes && test -z "$run"; then
3684 test -n "$TMPDIR" && tmpdir="$TMPDIR"
3685 tmpdir="$tmpdir/libtool-$$"
3686 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
3688 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
3691 outputname="$tmpdir/$file"
3692 # Replace the output file specification.
3693 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
3695 $show "$relink_command"
3696 if $run eval "$relink_command"; then :
3698 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
3704 $echo "$modename: warning: cannot relink \`$file'" 1>&2
3707 # Install the binary that we compiled earlier.
3708 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
3712 $show "$install_prog$stripme $file $destfile"
3713 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
3714 test -n "$outputname" && ${rm}r "$tmpdir"
3719 for file in $staticlibs; do
3720 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3722 # Set up the ranlib parameters.
3723 oldlib="$destdir/$name"
3725 $show "$install_prog $file $oldlib"
3726 $run eval "$install_prog \$file \$oldlib" || exit $?
3728 # Do each command in the postinstall commands.
3729 eval cmds=\"$old_postinstall_cmds\"
3730 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3731 for cmd in $cmds; do
3734 $run eval "$cmd" || exit $?
3739 if test -n "$future_libdirs"; then
3740 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
3743 if test -n "$current_libdirs"; then
3744 # Maybe just do a dry run.
3745 test -n "$run" && current_libdirs=" -n$current_libdirs"
3746 exec $SHELL $0 --finish$current_libdirs
3753 # libtool finish mode
3755 modename="$modename: finish"
3759 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3762 libdirs="$libdirs $dir"
3765 for libdir in $libdirs; do
3766 if test -n "$finish_cmds"; then
3767 # Do each command in the finish commands.
3768 eval cmds=\"$finish_cmds\"
3769 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
3770 for cmd in $cmds; do
3773 $run eval "$cmd" || admincmds="$admincmds
3778 if test -n "$finish_eval"; then
3779 # Do the single finish_eval.
3780 eval cmds=\"$finish_eval\"
3781 $run eval "$cmds" || admincmds="$admincmds
3787 # Exit here if they wanted silent mode.
3788 test "$show" = : && exit 0
3790 echo "----------------------------------------------------------------------"
3791 echo "Libraries have been installed in:"
3792 for libdir in $libdirs; do
3796 echo "If you ever happen to want to link against installed libraries"
3797 echo "in a given directory, LIBDIR, you must either use libtool, and"
3798 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
3799 echo "flag during linking and do at least one of the following:"
3800 if test -n "$shlibpath_var"; then
3801 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3802 echo " during execution"
3804 if test -n "$runpath_var"; then
3805 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3806 echo " during linking"
3808 if test -n "$hardcode_libdir_flag_spec"; then
3810 eval flag=\"$hardcode_libdir_flag_spec\"
3812 echo " - use the \`$flag' linker flag"
3814 if test -n "$admincmds"; then
3815 echo " - have your system administrator run these commands:$admincmds"
3817 if test -f /etc/ld.so.conf; then
3818 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3821 echo "See any operating system documentation about shared libraries for"
3822 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3823 echo "----------------------------------------------------------------------"
3827 # libtool execute mode
3829 modename="$modename: execute"
3831 # The first argument is the command name.
3833 if test -z "$cmd"; then
3834 $echo "$modename: you must specify a COMMAND" 1>&2
3839 # Handle -dlopen flags immediately.
3840 for file in $execute_dlfiles; do
3841 if test ! -f "$file"; then
3842 $echo "$modename: \`$file' is not a file" 1>&2
3850 # Check to see that this really is a libtool archive.
3851 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
3853 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
3858 # Read the libtool library.
3862 # If there is no directory component, then add one.
3864 */* | *\\*) . $file ;;
3868 # Skip this library if it cannot be dlopened.
3869 if test -z "$dlname"; then
3870 # Warn if it was a shared library.
3871 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
3875 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3876 test "X$dir" = "X$file" && dir=.
3878 if test -f "$dir/$objdir/$dlname"; then
3881 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
3887 # Just add the directory containing the .lo file.
3888 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3889 test "X$dir" = "X$file" && dir=.
3893 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
3898 # Get the absolute pathname.
3899 absdir=`cd "$dir" && pwd`
3900 test -n "$absdir" && dir="$absdir"
3902 # Now add the directory to shlibpath_var.
3903 if eval "test -z \"\$$shlibpath_var\""; then
3904 eval "$shlibpath_var=\"\$dir\""
3906 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3910 # This variable tells wrapper scripts just to set shlibpath_var
3911 # rather than running their programs.
3912 libtool_execute_magic="$magic"
3914 # Check if any of the arguments is a wrapper script.
3921 # Do a test to see if this is really a libtool program.
3922 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3923 # If there is no directory component, then add one.
3925 */* | *\\*) . $file ;;
3929 # Transform arg to wrapped name.
3930 file="$progdir/$program"
3934 # Quote arguments (to preserve shell metacharacters).
3935 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
3936 args="$args \"$file\""
3939 if test -z "$run"; then
3940 # Export the shlibpath_var.
3941 eval "export $shlibpath_var"
3943 # Restore saved enviroment variables
3944 if test "${save_LC_ALL+set}" = set; then
3945 LC_ALL="$save_LC_ALL"; export LC_ALL
3947 if test "${save_LANG+set}" = set; then
3948 LANG="$save_LANG"; export LANG
3951 # Now actually exec the command.
3952 eval "exec \$cmd$args"
3954 $echo "$modename: cannot exec \$cmd$args"
3957 # Display what would be done.
3958 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
3959 $echo "export $shlibpath_var"
3965 # libtool uninstall mode
3967 modename="$modename: uninstall"
3974 -*) rm="$rm $arg" ;;
3975 *) files="$files $arg" ;;
3979 if test -z "$rm"; then
3980 $echo "$modename: you must specify an RM program" 1>&2
3985 for file in $files; do
3986 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
3987 test "X$dir" = "X$file" && dir=.
3988 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
3994 # Possibly a libtool archive, so verify it.
3995 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
3998 # Delete the libtool libraries and symlinks.
3999 for n in $library_names; do
4000 rmfiles="$rmfiles $dir/$n"
4002 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
4004 $show "$rm $rmfiles"
4007 if test -n "$library_names"; then
4008 # Do each command in the postuninstall commands.
4009 eval cmds=\"$postuninstall_cmds\"
4010 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4011 for cmd in $cmds; do
4019 if test -n "$old_library"; then
4020 # Do each command in the old_postuninstall commands.
4021 eval cmds=\"$old_postuninstall_cmds\"
4022 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4023 for cmd in $cmds; do
4031 # FIXME: should reinstall the best remaining shared library.
4036 if test "$build_old_libs" = yes; then
4037 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
4038 rmfiles="$rmfiles $dir/$oldobj"
4040 $show "$rm $rmfiles"
4045 $show "$rm $rmfiles"
4054 $echo "$modename: you must specify a MODE" 1>&2
4055 $echo "$generic_help" 1>&2
4060 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4061 $echo "$generic_help" 1>&2
4063 fi # test -z "$show_help"
4065 # We need to display help for each of the modes.
4068 "Usage: $modename [OPTION]... [MODE-ARG]...
4070 Provide generalized library-building support services.
4072 --config show all configuration variables
4073 --debug enable verbose shell tracing
4074 -n, --dry-run display commands without modifying any files
4075 --features display basic configuration information and exit
4076 --finish same as \`--mode=finish'
4077 --help display this help message and exit
4078 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
4079 --quiet same as \`--silent'
4080 --silent don't print informational messages
4081 --version print version information
4083 MODE must be one of the following:
4085 compile compile a source file into a libtool object
4086 execute automatically set library path, then run a program
4087 finish complete the installation of libtool libraries
4088 install install libraries or executables
4089 link create a library or an executable
4090 uninstall remove libraries from an installed directory
4092 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
4093 a more detailed description of MODE."
4099 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
4101 Compile a source file into a libtool library object.
4103 This mode accepts the following additional options:
4105 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
4106 -static always build a \`.o' file suitable for static linking
4108 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
4109 from the given SOURCEFILE.
4111 The output file name is determined by removing the directory component from
4112 SOURCEFILE, then substituting the C source code suffix \`.c' with the
4113 library object suffix, \`.lo'."
4118 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
4120 Automatically set library path, then run a program.
4122 This mode accepts the following additional options:
4124 -dlopen FILE add the directory containing FILE to the library path
4126 This mode sets the library path environment variable according to \`-dlopen'
4129 If any of the ARGS are libtool executable wrappers, then they are translated
4130 into their corresponding uninstalled binary, and any of their required library
4131 directories are added to the library path.
4133 Then, COMMAND is executed, with ARGS as arguments."
4138 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
4140 Complete the installation of libtool libraries.
4142 Each LIBDIR is a directory that contains libtool libraries.
4144 The commands that this mode executes may require superuser privileges. Use
4145 the \`--dry-run' option if you just want to see what would be executed."
4150 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
4152 Install executables or libraries.
4154 INSTALL-COMMAND is the installation command. The first component should be
4155 either the \`install' or \`cp' program.
4157 The rest of the components are interpreted as arguments to that command (only
4158 BSD-compatible install options are recognized)."
4163 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
4165 Link object files or libraries together to form another library, or to
4166 create an executable program.
4168 LINK-COMMAND is a command using the C compiler that you would use to create
4169 a program from several object files.
4171 The following components of LINK-COMMAND are treated specially:
4173 -all-static do not do any dynamic linking at all
4174 -avoid-version do not add a version suffix if possible
4175 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
4176 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
4177 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
4178 -export-symbols SYMFILE
4179 try to export only the symbols listed in SYMFILE
4180 -export-symbols-regex REGEX
4181 try to export only the symbols matching REGEX
4182 -LLIBDIR search LIBDIR for required installed libraries
4183 -lNAME OUTPUT-FILE requires the installed library libNAME
4184 -module build a library that can dlopened
4185 -no-undefined declare that a library does not refer to external symbols
4186 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
4187 -release RELEASE specify package release information
4188 -rpath LIBDIR the created library will eventually be installed in LIBDIR
4189 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
4190 -static do not do any dynamic linking of libtool libraries
4191 -version-info CURRENT[:REVISION[:AGE]]
4192 specify library version info [each variable defaults to 0]
4194 All other options (arguments beginning with \`-') are ignored.
4196 Every other argument is treated as a filename. Files ending in \`.la' are
4197 treated as uninstalled libtool libraries, other files are standard or library
4200 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
4201 only library objects (\`.lo' files) may be specified, and \`-rpath' is
4202 required, except when creating a convenience library.
4204 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
4205 using \`ar' and \`ranlib', or on Windows using \`lib'.
4207 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
4208 is created, otherwise an executable program is created."
4213 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
4215 Remove libraries from an installation directory.
4217 RM is the name of the program to use to delete files associated with each FILE
4218 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
4221 If FILE is a libtool library, all the files associated with it are deleted.
4222 Otherwise, only FILE itself is deleted using RM."
4226 $echo "$modename: invalid operation mode \`$mode'" 1>&2
4233 $echo "Try \`$modename --help' for more information about other modes."