Codebase list ipset / upstream/6.12
Imported Upstream version 6.12 Neutron Soutmun 12 years ago
89 changed file(s) with 18828 addition(s) and 7345 deletion(s). Raw diff Collapse all Expand all
2323 /configure
2424 /libtool
2525 /stamp-h1
26
27 /libltdl/
0 6.12
1 - Cleanup generated files by make tidy
2 - Add more CC warning option to debug mode
3 - Report syntax error messages immediately
4 - Suppress false syntax error messages
5 - Add configure summary for the ipset userspace tool
6 - Add dynamic module support to ipset userspace tool
7 (Neutron Soutmun)
8 - Move ipset_port_usage() into lib (Neutron Soutmun)
9 - Fix invalid assignment to const void pointer (bug reported by Seblu)
10 - Remove unused variables (warnings fixed)
11 - Fix timeout value overflow bug at large timeout parameters
12 (bug reported by Andreas Herz)
13 - Improve ipset help text messages (Mr Dash Four)
14
015 6.11
116 - Support hostnames and service names with dash
217 - Exceptions support added to hash:*net* types
6767 # as -version-info 2:0:0. This release has a new, but backwards incompatible
6868 # interface.
6969
70 LIBVERSION = 2:0:0
70 LIBVERSION = 2:1:0
7171
7272 AM_CPPFLAGS = $(kinclude_CFLAGS) $(all_includes) -I$(top_srcdir)/include \
7373 -I/usr/local/include
7171 rm -rf config.* configure compile depcomp install-sh libtool ltmain.sh
7272 rm -rf Makefile Makefile.in lib/Makefile lib/Makefile.in src/Makefile src/Makefile.in
7373 rm -rf missing stamp-h1 m4/libtool.m4 m4/lt*.m4
74 rm -rf lib/ipset_settype_check lib/types_init.c
7475 find . -name '*~' -delete
7576
7677 .PHONY: modules modules_instal modules_clean update_includes tests
112112 @ENABLE_DEBUG_FALSE@am__append_2 = -O2 -DNDEBUG
113113 subdir = .
114114 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
115 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \
116 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
117 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
118 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
115 am__aclocal_m4_deps = $(top_srcdir)/m4/argz.m4 \
116 $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \
117 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltdl.m4 \
118 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
119 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
120 $(top_srcdir)/configure.ac
119121 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
120122 $(ACLOCAL_M4)
121123 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
180182 ACLOCAL = @ACLOCAL@
181183 AMTAR = @AMTAR@
182184 AR = @AR@
185 ARGZ_H = @ARGZ_H@
183186 AUTOCONF = @AUTOCONF@
184187 AUTOHEADER = @AUTOHEADER@
185188 AUTOMAKE = @AUTOMAKE@
201204 EXEEXT = @EXEEXT@
202205 FGREP = @FGREP@
203206 GREP = @GREP@
207 INCLTDL = @INCLTDL@
204208 INSTALL = @INSTALL@
205209 INSTALL_DATA = @INSTALL_DATA@
206210 INSTALL_PROGRAM = @INSTALL_PROGRAM@
209213 KBUILDDIR = @KBUILDDIR@
210214 LD = @LD@
211215 LDFLAGS = @LDFLAGS@
216 LIBADD_DL = @LIBADD_DL@
217 LIBADD_DLD_LINK = @LIBADD_DLD_LINK@
218 LIBADD_DLOPEN = @LIBADD_DLOPEN@
219 LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@
220 LIBLTDL = @LIBLTDL@
212221 LIBOBJS = @LIBOBJS@
213222 LIBS = @LIBS@
214223 LIBTOOL = @LIBTOOL@
215224 LIPO = @LIPO@
216225 LN_S = @LN_S@
226 LTDLDEPS = @LTDLDEPS@
227 LTDLINCL = @LTDLINCL@
228 LTDLOPEN = @LTDLOPEN@
217229 LTLIBOBJS = @LTLIBOBJS@
230 LT_CONFIG_H = @LT_CONFIG_H@
231 LT_DLLOADERS = @LT_DLLOADERS@
232 LT_DLPREOPEN = @LT_DLPREOPEN@
218233 MAKEINFO = @MAKEINFO@
219234 MAXSETS = @MAXSETS@
220235 MKDIR_P = @MKDIR_P@
235250 PKG_CONFIG = @PKG_CONFIG@
236251 RANLIB = @RANLIB@
237252 SED = @SED@
253 SETTYPE_MODLIST = @SETTYPE_MODLIST@
238254 SET_MAKE = @SET_MAKE@
239255 SHELL = @SHELL@
240256 STRIP = @STRIP@
278294 localedir = @localedir@
279295 localstatedir = @localstatedir@
280296 lt_ECHO = @lt_ECHO@
297 ltdl_LIBOBJS = @ltdl_LIBOBJS@
298 ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@
281299 mandir = @mandir@
282300 mkdir_p = @mkdir_p@
283301 oldincludedir = @oldincludedir@
288306 sbindir = @sbindir@
289307 sharedstatedir = @sharedstatedir@
290308 srcdir = @srcdir@
309 sys_symbol_underscore = @sys_symbol_underscore@
291310 sysconfdir = @sysconfdir@
292311 target_alias = @target_alias@
293312 top_build_prefix = @top_build_prefix@
294313 top_builddir = @top_builddir@
295314 top_srcdir = @top_srcdir@
296315 ACLOCAL_AMFLAGS = -I m4
297 LIBVERSION = 2:0:0
316 LIBVERSION = 2:1:0
298317 AM_CPPFLAGS = $(kinclude_CFLAGS) $(all_includes) -I$(top_srcdir)/include \
299318 -I/usr/local/include
300319
842861 rm -rf config.* configure compile depcomp install-sh libtool ltmain.sh
843862 rm -rf Makefile Makefile.in lib/Makefile lib/Makefile.in src/Makefile src/Makefile.in
844863 rm -rf missing stamp-h1 m4/libtool.m4 m4/lt*.m4
864 rm -rf lib/ipset_settype_check lib/types_init.c
845865 find . -name '*~' -delete
846866
847867 .PHONY: modules modules_instal modules_clean update_includes tests
7070 ipset 5.x or 4.x.
7171 - The ipset 6.x kernel part can work together with the set match and SET
7272 target from iptables 1.4.7 and below, however if you need the IPv6 support
73 from ipset 6.x, then you have to use iptables 1.4.8 or above.
73 from ipset 6.x, then you have to use iptables 1.4.9 or above.
7474
7575 The ipset 6.x can interpret the commandline syntax of ipset 4.x, however
7676 some internal changes mean different behaviour:
11581158 AC_SUBST([am__untar])
11591159 ]) # _AM_PROG_TAR
11601160
1161 m4_include([m4/argz.m4])
11611162 m4_include([m4/ax_cflags_gcc_option.m4])
11621163 m4_include([m4/libtool.m4])
1164 m4_include([m4/ltdl.m4])
11631165 m4_include([m4/ltoptions.m4])
11641166 m4_include([m4/ltsugar.m4])
11651167 m4_include([m4/ltversion.m4])
00 /* config.h.in. Generated from configure.ac by autoheader. */
1
2 /* Define to 1 if you have the `argz_add' function. */
3 #undef HAVE_ARGZ_ADD
4
5 /* Define to 1 if you have the `argz_append' function. */
6 #undef HAVE_ARGZ_APPEND
7
8 /* Define to 1 if you have the `argz_count' function. */
9 #undef HAVE_ARGZ_COUNT
10
11 /* Define to 1 if you have the `argz_create_sep' function. */
12 #undef HAVE_ARGZ_CREATE_SEP
13
14 /* Define to 1 if you have the <argz.h> header file. */
15 #undef HAVE_ARGZ_H
16
17 /* Define to 1 if you have the `argz_insert' function. */
18 #undef HAVE_ARGZ_INSERT
19
20 /* Define to 1 if you have the `argz_next' function. */
21 #undef HAVE_ARGZ_NEXT
22
23 /* Define to 1 if you have the `argz_stringify' function. */
24 #undef HAVE_ARGZ_STRINGIFY
25
26 /* Define to 1 if you have the `closedir' function. */
27 #undef HAVE_CLOSEDIR
28
29 /* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if
30 you don't. */
31 #undef HAVE_DECL_CYGWIN_CONV_PATH
132
233 /* Define to 1 if you have the declaration of `NLA_F_NESTED', and to 0 if you
334 don't. */
1142 don't. */
1243 #undef HAVE_DECL_NLA_TYPE_MASK
1344
45 /* Define to 1 if you have the <dirent.h> header file. */
46 #undef HAVE_DIRENT_H
47
48 /* Define if you have the GNU dld library. */
49 #undef HAVE_DLD
50
51 /* Define to 1 if you have the <dld.h> header file. */
52 #undef HAVE_DLD_H
53
54 /* Define to 1 if you have the `dlerror' function. */
55 #undef HAVE_DLERROR
56
1457 /* Define to 1 if you have the <dlfcn.h> header file. */
1558 #undef HAVE_DLFCN_H
59
60 /* Define to 1 if you have the <dl.h> header file. */
61 #undef HAVE_DL_H
62
63 /* Define if you have the _dyld_func_lookup function. */
64 #undef HAVE_DYLD
65
66 /* Define to 1 if the system has the type `error_t'. */
67 #undef HAVE_ERROR_T
1668
1769 /* Define to 1 if you have the <inttypes.h> header file. */
1870 #undef HAVE_INTTYPES_H
1971
72 /* Define if you have the libdl library or equivalent. */
73 #undef HAVE_LIBDL
74
75 /* Define if libdlloader will be built on this platform */
76 #undef HAVE_LIBDLLOADER
77
78 /* Define this if a modern libltdl is already installed */
79 #undef HAVE_LTDL
80
81 /* Define to 1 if you have the <mach-o/dyld.h> header file. */
82 #undef HAVE_MACH_O_DYLD_H
83
2084 /* Define to 1 if you have the <memory.h> header file. */
2185 #undef HAVE_MEMORY_H
86
87 /* Define to 1 if you have the `opendir' function. */
88 #undef HAVE_OPENDIR
89
90 /* Define if libtool can extract symbol lists from object files. */
91 #undef HAVE_PRELOADED_SYMBOLS
92
93 /* Define to 1 if you have the `readdir' function. */
94 #undef HAVE_READDIR
95
96 /* Define if you have the shl_load function. */
97 #undef HAVE_SHL_LOAD
2298
2399 /* Define to 1 if you have the <stdint.h> header file. */
24100 #undef HAVE_STDINT_H
32108 /* Define to 1 if you have the <string.h> header file. */
33109 #undef HAVE_STRING_H
34110
111 /* Define to 1 if you have the `strlcat' function. */
112 #undef HAVE_STRLCAT
113
114 /* Define to 1 if you have the `strlcpy' function. */
115 #undef HAVE_STRLCPY
116
117 /* Define to 1 if you have the <sys/dl.h> header file. */
118 #undef HAVE_SYS_DL_H
119
35120 /* Define to 1 if you have the <sys/stat.h> header file. */
36121 #undef HAVE_SYS_STAT_H
37122
44129 /* Define to 1 if you have the <unistd.h> header file. */
45130 #undef HAVE_UNISTD_H
46131
132 /* This value is set to 1 to indicate that the system argz facility works */
133 #undef HAVE_WORKING_ARGZ
134
135 /* Define if the OS needs help to load dependent libraries for dlopen(). */
136 #undef LTDL_DLOPEN_DEPLIBS
137
138 /* Define to the system default library search path. */
139 #undef LT_DLSEARCH_PATH
140
141 /* The archive extension */
142 #undef LT_LIBEXT
143
144 /* Define to the extension used for runtime loadable modules, say, ".so". */
145 #undef LT_MODULE_EXT
146
147 /* Define to the name of the environment variable that determines the run-time
148 module search path. */
149 #undef LT_MODULE_PATH_VAR
150
47151 /* Define to the sub-directory in which libtool stores uninstalled libraries.
48152 */
49153 #undef LT_OBJDIR
154
155 /* Define if dlsym() requires a leading underscore in symbol names. */
156 #undef NEED_USCORE
50157
51158 /* Define to 1 if your C compiler doesn't accept -c and -o together. */
52159 #undef NO_MINUS_C_MINUS_O
77184
78185 /* Version number of package */
79186 #undef VERSION
187
188 /* Define so that glibc/gnulib argp.h does not typedef error_t. */
189 #undef __error_t_defined
190
191 /* Define to a type to use for `error_t' if it is not otherwise available. */
192 #undef error_t
+9165
-6796
configure less more
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.65 for ipset 6.11.
2 # Generated by GNU Autoconf 2.65 for ipset 6.12.
33 #
44 # Report bugs to <kadlec@blackhole.kfki.hu>.
55 #
677677
678678
679679
680 lt_ltdl_dir='libltdl'
681
682 lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"
683
680684 test -n "$DJDIR" || exec 7<&0 </dev/null
681685 exec 6>&1
682686
700704 # Identity of this package.
701705 PACKAGE_NAME='ipset'
702706 PACKAGE_TARNAME='ipset'
703 PACKAGE_VERSION='6.11'
704 PACKAGE_STRING='ipset 6.11'
707 PACKAGE_VERSION='6.12'
708 PACKAGE_STRING='ipset 6.12'
705709 PACKAGE_BUGREPORT='kadlec@blackhole.kfki.hu'
706710 PACKAGE_URL=''
707711
741745 # include <unistd.h>
742746 #endif"
743747
744 ac_subst_vars='am__EXEEXT_FALSE
748 ac_subst_vars='ltdl_LTLIBOBJS
749 ltdl_LIBOBJS
750 am__EXEEXT_FALSE
745751 am__EXEEXT_TRUE
746752 LTLIBOBJS
747753 LIBOBJS
748754 libmnl_LIBS
749755 libmnl_CFLAGS
750756 PKG_CONFIG
757 ENABLE_SHARED_FALSE
758 ENABLE_SHARED_TRUE
759 ENABLE_STATIC_FALSE
760 ENABLE_STATIC_TRUE
761 ENABLE_SETTYPE_MODULES_FALSE
762 ENABLE_SETTYPE_MODULES_TRUE
763 SETTYPE_MODLIST
764 ENABLE_DEBUG_FALSE
765 ENABLE_DEBUG_TRUE
766 ENABLE_VERBOSE_FALSE
767 ENABLE_VERBOSE_TRUE
768 MAXSETS
769 WITH_MAXSETS_FALSE
770 WITH_MAXSETS_TRUE
771 KBUILDDIR
772 WITH_KBUILDDIR_FALSE
773 WITH_KBUILDDIR_TRUE
774 WITH_KMOD_FALSE
775 WITH_KMOD_TRUE
776 LTDLOPEN
777 LT_CONFIG_H
778 CONVENIENCE_LTDL_FALSE
779 CONVENIENCE_LTDL_TRUE
780 INSTALL_LTDL_FALSE
781 INSTALL_LTDL_TRUE
782 ARGZ_H
783 sys_symbol_underscore
784 LIBADD_DL
785 LT_DLPREOPEN
786 LIBADD_DLD_LINK
787 LIBADD_SHL_LOAD
788 LIBADD_DLOPEN
789 LT_DLLOADERS
790 INCLTDL
791 LTDLINCL
792 LTDLDEPS
793 LIBLTDL
751794 CPP
752795 OTOOL64
753796 OTOOL
765808 LD
766809 FGREP
767810 EGREP
811 GREP
768812 SED
769 LIBTOOL
770813 am__fastdepCC_FALSE
771814 am__fastdepCC_TRUE
772815 CCDEPMODE
783826 LDFLAGS
784827 CFLAGS
785828 CC
786 ENABLE_DEBUG_FALSE
787 ENABLE_DEBUG_TRUE
788 ENABLE_VERBOSE_FALSE
789 ENABLE_VERBOSE_TRUE
790 MAXSETS
791 WITH_MAXSETS_FALSE
792 WITH_MAXSETS_TRUE
793 GREP
794 KBUILDDIR
795 WITH_KBUILDDIR_FALSE
796 WITH_KBUILDDIR_TRUE
797 WITH_KMOD_FALSE
798 WITH_KMOD_TRUE
829 LIBTOOL
799830 am__untar
800831 am__tar
801832 AMTAR
868899 ac_subst_files=''
869900 ac_user_opts='
870901 enable_option_checking
902 enable_static
903 enable_shared
904 with_pic
905 enable_fast_install
906 enable_dependency_tracking
907 with_gnu_ld
908 enable_libtool_lock
909 with_included_ltdl
910 with_ltdl_include
911 with_ltdl_lib
912 enable_ltdl_install
871913 with_kmod
872914 with_kbuild
873915 with_ksource
874916 with_maxsets
875917 enable_verbose
876918 enable_debug
877 enable_dependency_tracking
878 enable_shared
879 enable_static
880 with_pic
881 enable_fast_install
882 with_gnu_ld
883 enable_libtool_lock
919 enable_settype_modules
920 with_settype_modules_list
884921 '
885922 ac_precious_vars='build_alias
886923 host_alias
14351472 # Omit some internal or obsolete options to make the list less imposing.
14361473 # This message is too long to be a string in the A/UX 3.1 sh.
14371474 cat <<_ACEOF
1438 \`configure' configures ipset 6.11 to adapt to many kinds of systems.
1475 \`configure' configures ipset 6.12 to adapt to many kinds of systems.
14391476
14401477 Usage: $0 [OPTION]... [VAR=VALUE]...
14411478
15051542
15061543 if test -n "$ac_init_help"; then
15071544 case $ac_init_help in
1508 short | recursive ) echo "Configuration of ipset 6.11:";;
1545 short | recursive ) echo "Configuration of ipset 6.12:";;
15091546 esac
15101547 cat <<\_ACEOF
15111548
15131550 --disable-option-checking ignore unrecognized --enable/--with options
15141551 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
15151552 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
1553 --enable-static[=PKGS] build static libraries [default=yes]
1554 --enable-shared[=PKGS] build shared libraries [default=yes]
1555 --enable-fast-install[=PKGS]
1556 optimize for fast installation [default=yes]
1557 --disable-dependency-tracking speeds up one-time build
1558 --enable-dependency-tracking do not reject slow dependency extractors
1559 --disable-libtool-lock avoid locking (might break parallel builds)
1560 --enable-ltdl-install install libltdl
15161561 --enable-verbose Enable verbose mode at compiling/linking.
15171562 --enable-debug Enable compiling with debug support.
1518 --disable-dependency-tracking speeds up one-time build
1519 --enable-dependency-tracking do not reject slow dependency extractors
1520 --enable-shared[=PKGS] build shared libraries [default=yes]
1521 --enable-static[=PKGS] build static libraries [default=yes]
1522 --enable-fast-install[=PKGS]
1523 optimize for fast installation [default=yes]
1524 --disable-libtool-lock avoid locking (might break parallel builds)
1563 --enable-settype-modules
1564 Enable set type modules support
15251565
15261566 Optional Packages:
15271567 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
15281568 --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
1569 --with-pic try to use only PIC/non-PIC objects [default=use
1570 both]
1571 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
1572 --with-included-ltdl use the GNU ltdl sources included here
1573 --with-ltdl-include=DIR use the ltdl headers installed in DIR
1574 --with-ltdl-lib=DIR use the libltdl.la installed in DIR
15291575 --with-kmod=yes/no Build the kernel module (default: yes)
15301576 --with-kbuild=PATH Path to kernel build directory
15311577 --with-ksource=PATH Path to kernel source directory, if not the same as
15321578 the kernel build directory
15331579 --with-maxsets=256 Maximal numer of sets supported by the kernel
1534 --with-pic try to use only PIC/non-PIC objects [default=use
1535 both]
1536 --with-gnu-ld assume the C compiler uses GNU ld [default=no]
1580 --with-settype-modules-list="mod1 mod2 ..."
1581 List of dynamic loading modules, ignored if
1582 settype-modules is disabled. It could be "all" to
1583 build all available settypes as modules
15371584
15381585 Some influential environment variables:
15391586 CC C compiler command
16151662 test -n "$ac_init_help" && exit $ac_status
16161663 if $ac_init_version; then
16171664 cat <<\_ACEOF
1618 ipset configure 6.11
1665 ipset configure 6.12
16191666 generated by GNU Autoconf 2.65
16201667
16211668 Copyright (C) 2009 Free Software Foundation, Inc.
19862033 This file contains any messages produced by compilers while
19872034 running configure, to aid debugging if configure makes a mistake.
19882035
1989 It was created by ipset $as_me 6.11, which was
2036 It was created by ipset $as_me 6.12, which was
19902037 generated by GNU Autoconf 2.65. Invocation command line was
19912038
19922039 $ $0 $@
28682915
28692916 # Define the identity of the package.
28702917 PACKAGE='ipset'
2871 VERSION='6.11'
2918 VERSION='6.12'
28722919
28732920
28742921 cat >>confdefs.h <<_ACEOF
29903037
29913038
29923039
2993 case "$host" in
2994 *-*-linux*) ;;
2995 *) as_fn_error "Linux systems supported exclusively!" "$LINENO" 5;;
3040 # Check whether --enable-static was given.
3041 if test "${enable_static+set}" = set; then :
3042 enableval=$enable_static; p=${PACKAGE-default}
3043 case $enableval in
3044 yes) enable_static=yes ;;
3045 no) enable_static=no ;;
3046 *)
3047 enable_static=no
3048 # Look at the argument we got. We use all the common list separators.
3049 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
3050 for pkg in $enableval; do
3051 IFS="$lt_save_ifs"
3052 if test "X$pkg" = "X$p"; then
3053 enable_static=yes
3054 fi
3055 done
3056 IFS="$lt_save_ifs"
3057 ;;
3058 esac
3059 else
3060 enable_static=yes
3061 fi
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071 case `pwd` in
3072 *\ * | *\ *)
3073 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
3074 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
29963075 esac
29973076
29983077
2999 # Check whether --with-kmod was given.
3000 if test "${with_kmod+set}" = set; then :
3001 withval=$with_kmod; BUILDKMOD="$withval";
3002 else
3003 BUILDKMOD="yes";
3004 fi
3005
3006 if test "$BUILDKMOD" == "yes"; then
3007 WITH_KMOD_TRUE=
3008 WITH_KMOD_FALSE='#'
3009 else
3010 WITH_KMOD_TRUE='#'
3011 WITH_KMOD_FALSE=
3012 fi
3013
3014
3015
3016 # Check whether --with-kbuild was given.
3017 if test "${with_kbuild+set}" = set; then :
3018 withval=$with_kbuild; KBUILDDIR="$withval";
3019 fi
3020
3021
3022 # Check whether --with-ksource was given.
3023 if test "${with_ksource+set}" = set; then :
3024 withval=$with_ksource; KSOURCEDIR="$withval";
3025 fi
3026
3027 if test "$KBUILDDIR" != ""; then
3028 WITH_KBUILDDIR_TRUE=
3029 WITH_KBUILDDIR_FALSE='#'
3030 else
3031 WITH_KBUILDDIR_TRUE='#'
3032 WITH_KBUILDDIR_FALSE=
3033 fi
3034
3035
3036
3037 if test "$BUILDKMOD" == "yes"
3038 then
3039 if test "$KBUILDDIR" != ""
3040 then
3041 kbuilddir="$KBUILDDIR"
3042 else
3043 kbuilddir="/lib/modules/`uname -r`/build"
3044 fi
3045
3046 if test -n "$KSOURCEDIR"; then
3047 ksourcedir="$KSOURCEDIR"
3048 elif test -e "$kbuilddir/include/linux/netfilter/nfnetlink.h"; then
3049 ksourcedir="$kbuilddir"
3050 else
3051 ksourcedir="/lib/modules/$(uname -r)/source"
3052 fi
3053 if test ! -e "$ksourcedir/include/linux/netfilter/nfnetlink.h"
3054 then
3055 as_fn_error "Invalid kernel source directory $ksourcedir" "$LINENO" 5
3056 fi
3057
3058 if test ! -e "$kbuilddir/.config"
3059 then
3060 as_fn_error "The kernel build directory $kbuilddir is not configured" "$LINENO" 5
3061 fi
3062
3063 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
3064 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
3065 if test "${ac_cv_path_GREP+set}" = set; then :
3066 $as_echo_n "(cached) " >&6
3067 else
3068 if test -z "$GREP"; then
3069 ac_path_GREP_found=false
3070 # Loop through the user's path and test for each of PROGNAME-LIST
3071 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3072 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
3073 do
3074 IFS=$as_save_IFS
3075 test -z "$as_dir" && as_dir=.
3076 for ac_prog in grep ggrep; do
3077 for ac_exec_ext in '' $ac_executable_extensions; do
3078 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
3079 { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
3080 # Check for GNU ac_path_GREP and select it if it is found.
3081 # Check for GNU $ac_path_GREP
3082 case `"$ac_path_GREP" --version 2>&1` in
3083 *GNU*)
3084 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
3085 *)
3086 ac_count=0
3087 $as_echo_n 0123456789 >"conftest.in"
3088 while :
3089 do
3090 cat "conftest.in" "conftest.in" >"conftest.tmp"
3091 mv "conftest.tmp" "conftest.in"
3092 cp "conftest.in" "conftest.nl"
3093 $as_echo 'GREP' >> "conftest.nl"
3094 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
3095 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
3096 as_fn_arith $ac_count + 1 && ac_count=$as_val
3097 if test $ac_count -gt ${ac_path_GREP_max-0}; then
3098 # Best one so far, save it but keep looking for a better one
3099 ac_cv_path_GREP="$ac_path_GREP"
3100 ac_path_GREP_max=$ac_count
3101 fi
3102 # 10*(2^10) chars as input seems more than enough
3103 test $ac_count -gt 10 && break
3104 done
3105 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
3078
3079 macro_version='2.2.6b'
3080 macro_revision='1.3017'
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094 ltmain="$ac_aux_dir/ltmain.sh"
3095
3096 DEPDIR="${am__leading_dot}deps"
3097
3098 ac_config_commands="$ac_config_commands depfiles"
3099
3100
3101 am_make=${MAKE-make}
3102 cat > confinc << 'END'
3103 am__doit:
3104 @echo this is the am__doit target
3105 .PHONY: am__doit
3106 END
3107 # If we don't find an include directive, just comment out the code.
3108 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
3109 $as_echo_n "checking for style of include used by $am_make... " >&6; }
3110 am__include="#"
3111 am__quote=
3112 _am_result=none
3113 # First try GNU make style include.
3114 echo "include confinc" > confmf
3115 # Ignore all kinds of additional output from `make'.
3116 case `$am_make -s -f confmf 2> /dev/null` in #(
3117 *the\ am__doit\ target*)
3118 am__include=include
3119 am__quote=
3120 _am_result=GNU
3121 ;;
31063122 esac
3107
3108 $ac_path_GREP_found && break 3
3109 done
3110 done
3111 done
3112 IFS=$as_save_IFS
3113 if test -z "$ac_cv_path_GREP"; then
3114 as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
3115 fi
3116 else
3117 ac_cv_path_GREP=$GREP
3118 fi
3119
3120 fi
3121 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
3122 $as_echo "$ac_cv_path_GREP" >&6; }
3123 GREP="$ac_cv_path_GREP"
3124
3125
3126
3127 if test "X`$GREP 'NFNL_SUBSYS_IPSET' $ksourcedir/include/linux/netfilter/nfnetlink.h`" = "X"
3128 then
3129 as_fn_error "The kernel source directory $ksourcedir is not patched with netlink.patch to support ipset" "$LINENO" 5
3130 fi
3131 fi
3132
3133
3134 # Check whether --with-maxsets was given.
3135 if test "${with_maxsets+set}" = set; then :
3136 withval=$with_maxsets; MAXSETS="$withval";
3137 fi
3138
3139 if test "$MAXSETS" != ""; then
3140 WITH_MAXSETS_TRUE=
3141 WITH_MAXSETS_FALSE='#'
3142 else
3143 WITH_MAXSETS_TRUE='#'
3144 WITH_MAXSETS_FALSE=
3145 fi
3146
3147
3148
3149 # Check whether --enable-verbose was given.
3150 if test "${enable_verbose+set}" = set; then :
3151 enableval=$enable_verbose; case "${enableval}" in
3152 yes) enable_verbose=yes ;;
3153 no) enable_verbose=no ;;
3154 *) as_fn_error "bad value ${enableval} for --enable-verbose" "$LINENO" 5 ;;
3155 esac
3156 else
3157 enable_verbose=no
3158 fi
3159
3160
3161 if test "x$enable_verbose" = xyes; then
3162 ENABLE_VERBOSE_TRUE=
3163 ENABLE_VERBOSE_FALSE='#'
3164 else
3165 ENABLE_VERBOSE_TRUE='#'
3166 ENABLE_VERBOSE_FALSE=
3167 fi
3168
3169
3170 # Check whether --enable-debug was given.
3171 if test "${enable_debug+set}" = set; then :
3172 enableval=$enable_debug; case "${enableval}" in
3173 yes) enable_verbose=yes ;;
3174 no) enable_verbose=no ;;
3175 *) as_fn_error "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;;
3176 esac
3177 else
3178 enable_debug=no
3179 fi
3180
3181
3182 if test "x$enable_debug" = xyes; then
3183 ENABLE_DEBUG_TRUE=
3184 ENABLE_DEBUG_FALSE='#'
3185 else
3186 ENABLE_DEBUG_TRUE='#'
3187 ENABLE_DEBUG_FALSE=
3188 fi
3189
3190
3191 : ${CFLAGS=""}
3123 # Now try BSD make style include.
3124 if test "$am__include" = "#"; then
3125 echo '.include "confinc"' > confmf
3126 case `$am_make -s -f confmf 2> /dev/null` in #(
3127 *the\ am__doit\ target*)
3128 am__include=.include
3129 am__quote="\""
3130 _am_result=BSD
3131 ;;
3132 esac
3133 fi
3134
3135
3136 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
3137 $as_echo "$_am_result" >&6; }
3138 rm -f confinc confmf
3139
3140 # Check whether --enable-dependency-tracking was given.
3141 if test "${enable_dependency_tracking+set}" = set; then :
3142 enableval=$enable_dependency_tracking;
3143 fi
3144
3145 if test "x$enable_dependency_tracking" != xno; then
3146 am_depcomp="$ac_aux_dir/depcomp"
3147 AMDEPBACKSLASH='\'
3148 fi
3149 if test "x$enable_dependency_tracking" != xno; then
3150 AMDEP_TRUE=
3151 AMDEP_FALSE='#'
3152 else
3153 AMDEP_TRUE='#'
3154 AMDEP_FALSE=
3155 fi
3156
31923157
31933158 ac_ext=c
31943159 ac_cpp='$CPP $CPPFLAGS'
39803945 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
39813946 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
39823947 ac_compiler_gnu=$ac_cv_c_compiler_gnu
3983 DEPDIR="${am__leading_dot}deps"
3984
3985 ac_config_commands="$ac_config_commands depfiles"
3986
3987
3988 am_make=${MAKE-make}
3989 cat > confinc << 'END'
3990 am__doit:
3991 @echo this is the am__doit target
3992 .PHONY: am__doit
3993 END
3994 # If we don't find an include directive, just comment out the code.
3995 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
3996 $as_echo_n "checking for style of include used by $am_make... " >&6; }
3997 am__include="#"
3998 am__quote=
3999 _am_result=none
4000 # First try GNU make style include.
4001 echo "include confinc" > confmf
4002 # Ignore all kinds of additional output from `make'.
4003 case `$am_make -s -f confmf 2> /dev/null` in #(
4004 *the\ am__doit\ target*)
4005 am__include=include
4006 am__quote=
4007 _am_result=GNU
3948
3949 depcc="$CC" am_compiler_list=
3950
3951 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
3952 $as_echo_n "checking dependency style of $depcc... " >&6; }
3953 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then :
3954 $as_echo_n "(cached) " >&6
3955 else
3956 if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
3957 # We make a subdir and do the tests there. Otherwise we can end up
3958 # making bogus files that we don't know about and never remove. For
3959 # instance it was reported that on HP-UX the gcc test will end up
3960 # making a dummy file named `D' -- because `-MD' means `put the output
3961 # in D'.
3962 mkdir conftest.dir
3963 # Copy depcomp to subdir because otherwise we won't find it if we're
3964 # using a relative directory.
3965 cp "$am_depcomp" conftest.dir
3966 cd conftest.dir
3967 # We will build objects and dependencies in a subdirectory because
3968 # it helps to detect inapplicable dependency modes. For instance
3969 # both Tru64's cc and ICC support -MD to output dependencies as a
3970 # side effect of compilation, but ICC will put the dependencies in
3971 # the current directory while Tru64 will put them in the object
3972 # directory.
3973 mkdir sub
3974
3975 am_cv_CC_dependencies_compiler_type=none
3976 if test "$am_compiler_list" = ""; then
3977 am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
3978 fi
3979 am__universal=false
3980 case " $depcc " in #(
3981 *\ -arch\ *\ -arch\ *) am__universal=true ;;
3982 esac
3983
3984 for depmode in $am_compiler_list; do
3985 # Setup a source with many dependencies, because some compilers
3986 # like to wrap large dependency lists on column 80 (with \), and
3987 # we should not choose a depcomp mode which is confused by this.
3988 #
3989 # We need to recreate these files for each test, as the compiler may
3990 # overwrite some of them when testing with obscure command lines.
3991 # This happens at least with the AIX C compiler.
3992 : > sub/conftest.c
3993 for i in 1 2 3 4 5 6; do
3994 echo '#include "conftst'$i'.h"' >> sub/conftest.c
3995 # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
3996 # Solaris 8's {/usr,}/bin/sh.
3997 touch sub/conftst$i.h
3998 done
3999 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
4000
4001 # We check with `-c' and `-o' for the sake of the "dashmstdout"
4002 # mode. It turns out that the SunPro C++ compiler does not properly
4003 # handle `-M -o', and we need to detect this. Also, some Intel
4004 # versions had trouble with output in subdirs
4005 am__obj=sub/conftest.${OBJEXT-o}
4006 am__minus_obj="-o $am__obj"
4007 case $depmode in
4008 gcc)
4009 # This depmode causes a compiler race in universal mode.
4010 test "$am__universal" = false || continue
4011 ;;
4012 nosideeffect)
4013 # after this tag, mechanisms are not by side-effect, so they'll
4014 # only be used when explicitly requested
4015 if test "x$enable_dependency_tracking" = xyes; then
4016 continue
4017 else
4018 break
4019 fi
4020 ;;
4021 msvisualcpp | msvcmsys)
4022 # This compiler won't grok `-c -o', but also, the minuso test has
4023 # not run yet. These depmodes are late enough in the game, and
4024 # so weak that their functioning should not be impacted.
4025 am__obj=conftest.${OBJEXT-o}
4026 am__minus_obj=
4027 ;;
4028 none) break ;;
4029 esac
4030 if depmode=$depmode \
4031 source=sub/conftest.c object=$am__obj \
4032 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
4033 $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
4034 >/dev/null 2>conftest.err &&
4035 grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
4036 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
4037 grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
4038 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
4039 # icc doesn't choke on unknown options, it will just issue warnings
4040 # or remarks (even with -Werror). So we grep stderr for any message
4041 # that says an option was ignored or not supported.
4042 # When given -MP, icc 7.0 and 7.1 complain thusly:
4043 # icc: Command line warning: ignoring option '-M'; no argument required
4044 # The diagnosis changed in icc 8.0:
4045 # icc: Command line remark: option '-MP' not supported
4046 if (grep 'ignoring option' conftest.err ||
4047 grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
4048 am_cv_CC_dependencies_compiler_type=$depmode
4049 break
4050 fi
4051 fi
4052 done
4053
4054 cd ..
4055 rm -rf conftest.dir
4056 else
4057 am_cv_CC_dependencies_compiler_type=none
4058 fi
4059
4060 fi
4061 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
4062 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
4063 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
4064
4065 if
4066 test "x$enable_dependency_tracking" != xno \
4067 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
4068 am__fastdepCC_TRUE=
4069 am__fastdepCC_FALSE='#'
4070 else
4071 am__fastdepCC_TRUE='#'
4072 am__fastdepCC_FALSE=
4073 fi
4074
4075
4076 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
4077 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
4078 if test "${ac_cv_path_SED+set}" = set; then :
4079 $as_echo_n "(cached) " >&6
4080 else
4081 ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
4082 for ac_i in 1 2 3 4 5 6 7; do
4083 ac_script="$ac_script$as_nl$ac_script"
4084 done
4085 echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
4086 { ac_script=; unset ac_script;}
4087 if test -z "$SED"; then
4088 ac_path_SED_found=false
4089 # Loop through the user's path and test for each of PROGNAME-LIST
4090 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4091 for as_dir in $PATH
4092 do
4093 IFS=$as_save_IFS
4094 test -z "$as_dir" && as_dir=.
4095 for ac_prog in sed gsed; do
4096 for ac_exec_ext in '' $ac_executable_extensions; do
4097 ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
4098 { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
4099 # Check for GNU ac_path_SED and select it if it is found.
4100 # Check for GNU $ac_path_SED
4101 case `"$ac_path_SED" --version 2>&1` in
4102 *GNU*)
4103 ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
4104 *)
4105 ac_count=0
4106 $as_echo_n 0123456789 >"conftest.in"
4107 while :
4108 do
4109 cat "conftest.in" "conftest.in" >"conftest.tmp"
4110 mv "conftest.tmp" "conftest.in"
4111 cp "conftest.in" "conftest.nl"
4112 $as_echo '' >> "conftest.nl"
4113 "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
4114 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4115 as_fn_arith $ac_count + 1 && ac_count=$as_val
4116 if test $ac_count -gt ${ac_path_SED_max-0}; then
4117 # Best one so far, save it but keep looking for a better one
4118 ac_cv_path_SED="$ac_path_SED"
4119 ac_path_SED_max=$ac_count
4120 fi
4121 # 10*(2^10) chars as input seems more than enough
4122 test $ac_count -gt 10 && break
4123 done
4124 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4125 esac
4126
4127 $ac_path_SED_found && break 3
4128 done
4129 done
4130 done
4131 IFS=$as_save_IFS
4132 if test -z "$ac_cv_path_SED"; then
4133 as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5
4134 fi
4135 else
4136 ac_cv_path_SED=$SED
4137 fi
4138
4139 fi
4140 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
4141 $as_echo "$ac_cv_path_SED" >&6; }
4142 SED="$ac_cv_path_SED"
4143 rm -f conftest.sed
4144
4145 test -z "$SED" && SED=sed
4146 Xsed="$SED -e 1s/^X//"
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
4159 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4160 if test "${ac_cv_path_GREP+set}" = set; then :
4161 $as_echo_n "(cached) " >&6
4162 else
4163 if test -z "$GREP"; then
4164 ac_path_GREP_found=false
4165 # Loop through the user's path and test for each of PROGNAME-LIST
4166 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4167 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4168 do
4169 IFS=$as_save_IFS
4170 test -z "$as_dir" && as_dir=.
4171 for ac_prog in grep ggrep; do
4172 for ac_exec_ext in '' $ac_executable_extensions; do
4173 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4174 { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
4175 # Check for GNU ac_path_GREP and select it if it is found.
4176 # Check for GNU $ac_path_GREP
4177 case `"$ac_path_GREP" --version 2>&1` in
4178 *GNU*)
4179 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
4180 *)
4181 ac_count=0
4182 $as_echo_n 0123456789 >"conftest.in"
4183 while :
4184 do
4185 cat "conftest.in" "conftest.in" >"conftest.tmp"
4186 mv "conftest.tmp" "conftest.in"
4187 cp "conftest.in" "conftest.nl"
4188 $as_echo 'GREP' >> "conftest.nl"
4189 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4190 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4191 as_fn_arith $ac_count + 1 && ac_count=$as_val
4192 if test $ac_count -gt ${ac_path_GREP_max-0}; then
4193 # Best one so far, save it but keep looking for a better one
4194 ac_cv_path_GREP="$ac_path_GREP"
4195 ac_path_GREP_max=$ac_count
4196 fi
4197 # 10*(2^10) chars as input seems more than enough
4198 test $ac_count -gt 10 && break
4199 done
4200 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4201 esac
4202
4203 $ac_path_GREP_found && break 3
4204 done
4205 done
4206 done
4207 IFS=$as_save_IFS
4208 if test -z "$ac_cv_path_GREP"; then
4209 as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4210 fi
4211 else
4212 ac_cv_path_GREP=$GREP
4213 fi
4214
4215 fi
4216 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
4217 $as_echo "$ac_cv_path_GREP" >&6; }
4218 GREP="$ac_cv_path_GREP"
4219
4220
4221 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
4222 $as_echo_n "checking for egrep... " >&6; }
4223 if test "${ac_cv_path_EGREP+set}" = set; then :
4224 $as_echo_n "(cached) " >&6
4225 else
4226 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
4227 then ac_cv_path_EGREP="$GREP -E"
4228 else
4229 if test -z "$EGREP"; then
4230 ac_path_EGREP_found=false
4231 # Loop through the user's path and test for each of PROGNAME-LIST
4232 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4233 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4234 do
4235 IFS=$as_save_IFS
4236 test -z "$as_dir" && as_dir=.
4237 for ac_prog in egrep; do
4238 for ac_exec_ext in '' $ac_executable_extensions; do
4239 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4240 { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
4241 # Check for GNU ac_path_EGREP and select it if it is found.
4242 # Check for GNU $ac_path_EGREP
4243 case `"$ac_path_EGREP" --version 2>&1` in
4244 *GNU*)
4245 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4246 *)
4247 ac_count=0
4248 $as_echo_n 0123456789 >"conftest.in"
4249 while :
4250 do
4251 cat "conftest.in" "conftest.in" >"conftest.tmp"
4252 mv "conftest.tmp" "conftest.in"
4253 cp "conftest.in" "conftest.nl"
4254 $as_echo 'EGREP' >> "conftest.nl"
4255 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4256 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4257 as_fn_arith $ac_count + 1 && ac_count=$as_val
4258 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
4259 # Best one so far, save it but keep looking for a better one
4260 ac_cv_path_EGREP="$ac_path_EGREP"
4261 ac_path_EGREP_max=$ac_count
4262 fi
4263 # 10*(2^10) chars as input seems more than enough
4264 test $ac_count -gt 10 && break
4265 done
4266 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4267 esac
4268
4269 $ac_path_EGREP_found && break 3
4270 done
4271 done
4272 done
4273 IFS=$as_save_IFS
4274 if test -z "$ac_cv_path_EGREP"; then
4275 as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4276 fi
4277 else
4278 ac_cv_path_EGREP=$EGREP
4279 fi
4280
4281 fi
4282 fi
4283 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
4284 $as_echo "$ac_cv_path_EGREP" >&6; }
4285 EGREP="$ac_cv_path_EGREP"
4286
4287
4288 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
4289 $as_echo_n "checking for fgrep... " >&6; }
4290 if test "${ac_cv_path_FGREP+set}" = set; then :
4291 $as_echo_n "(cached) " >&6
4292 else
4293 if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
4294 then ac_cv_path_FGREP="$GREP -F"
4295 else
4296 if test -z "$FGREP"; then
4297 ac_path_FGREP_found=false
4298 # Loop through the user's path and test for each of PROGNAME-LIST
4299 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4300 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4301 do
4302 IFS=$as_save_IFS
4303 test -z "$as_dir" && as_dir=.
4304 for ac_prog in fgrep; do
4305 for ac_exec_ext in '' $ac_executable_extensions; do
4306 ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
4307 { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
4308 # Check for GNU ac_path_FGREP and select it if it is found.
4309 # Check for GNU $ac_path_FGREP
4310 case `"$ac_path_FGREP" --version 2>&1` in
4311 *GNU*)
4312 ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
4313 *)
4314 ac_count=0
4315 $as_echo_n 0123456789 >"conftest.in"
4316 while :
4317 do
4318 cat "conftest.in" "conftest.in" >"conftest.tmp"
4319 mv "conftest.tmp" "conftest.in"
4320 cp "conftest.in" "conftest.nl"
4321 $as_echo 'FGREP' >> "conftest.nl"
4322 "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
4323 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4324 as_fn_arith $ac_count + 1 && ac_count=$as_val
4325 if test $ac_count -gt ${ac_path_FGREP_max-0}; then
4326 # Best one so far, save it but keep looking for a better one
4327 ac_cv_path_FGREP="$ac_path_FGREP"
4328 ac_path_FGREP_max=$ac_count
4329 fi
4330 # 10*(2^10) chars as input seems more than enough
4331 test $ac_count -gt 10 && break
4332 done
4333 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4334 esac
4335
4336 $ac_path_FGREP_found && break 3
4337 done
4338 done
4339 done
4340 IFS=$as_save_IFS
4341 if test -z "$ac_cv_path_FGREP"; then
4342 as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4343 fi
4344 else
4345 ac_cv_path_FGREP=$FGREP
4346 fi
4347
4348 fi
4349 fi
4350 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
4351 $as_echo "$ac_cv_path_FGREP" >&6; }
4352 FGREP="$ac_cv_path_FGREP"
4353
4354
4355 test -z "$GREP" && GREP=grep
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375 # Check whether --with-gnu-ld was given.
4376 if test "${with_gnu_ld+set}" = set; then :
4377 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
4378 else
4379 with_gnu_ld=no
4380 fi
4381
4382 ac_prog=ld
4383 if test "$GCC" = yes; then
4384 # Check if gcc -print-prog-name=ld gives a path.
4385 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
4386 $as_echo_n "checking for ld used by $CC... " >&6; }
4387 case $host in
4388 *-*-mingw*)
4389 # gcc leaves a trailing carriage return which upsets mingw
4390 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4391 *)
4392 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4393 esac
4394 case $ac_prog in
4395 # Accept absolute paths.
4396 [\\/]* | ?:[\\/]*)
4397 re_direlt='/[^/][^/]*/\.\./'
4398 # Canonicalize the pathname of ld
4399 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4400 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4401 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4402 done
4403 test -z "$LD" && LD="$ac_prog"
4404 ;;
4405 "")
4406 # If it fails, then pretend we aren't using GCC.
4407 ac_prog=ld
4408 ;;
4409 *)
4410 # If it is relative, then search for the first ld in PATH.
4411 with_gnu_ld=unknown
4412 ;;
4413 esac
4414 elif test "$with_gnu_ld" = yes; then
4415 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
4416 $as_echo_n "checking for GNU ld... " >&6; }
4417 else
4418 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
4419 $as_echo_n "checking for non-GNU ld... " >&6; }
4420 fi
4421 if test "${lt_cv_path_LD+set}" = set; then :
4422 $as_echo_n "(cached) " >&6
4423 else
4424 if test -z "$LD"; then
4425 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4426 for ac_dir in $PATH; do
4427 IFS="$lt_save_ifs"
4428 test -z "$ac_dir" && ac_dir=.
4429 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4430 lt_cv_path_LD="$ac_dir/$ac_prog"
4431 # Check to see if the program is GNU ld. I'd rather use --version,
4432 # but apparently some variants of GNU ld only accept -v.
4433 # Break only if it was the GNU/non-GNU ld that we prefer.
4434 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4435 *GNU* | *'with BFD'*)
4436 test "$with_gnu_ld" != no && break
4437 ;;
4438 *)
4439 test "$with_gnu_ld" != yes && break
4440 ;;
4441 esac
4442 fi
4443 done
4444 IFS="$lt_save_ifs"
4445 else
4446 lt_cv_path_LD="$LD" # Let the user override the test with a path.
4447 fi
4448 fi
4449
4450 LD="$lt_cv_path_LD"
4451 if test -n "$LD"; then
4452 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
4453 $as_echo "$LD" >&6; }
4454 else
4455 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4456 $as_echo "no" >&6; }
4457 fi
4458 test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5
4459 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
4460 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
4461 if test "${lt_cv_prog_gnu_ld+set}" = set; then :
4462 $as_echo_n "(cached) " >&6
4463 else
4464 # I'd rather use --version here, but apparently some GNU lds only accept -v.
4465 case `$LD -v 2>&1 </dev/null` in
4466 *GNU* | *'with BFD'*)
4467 lt_cv_prog_gnu_ld=yes
4468 ;;
4469 *)
4470 lt_cv_prog_gnu_ld=no
40084471 ;;
40094472 esac
4010 # Now try BSD make style include.
4011 if test "$am__include" = "#"; then
4012 echo '.include "confinc"' > confmf
4013 case `$am_make -s -f confmf 2> /dev/null` in #(
4014 *the\ am__doit\ target*)
4015 am__include=.include
4016 am__quote="\""
4017 _am_result=BSD
4018 ;;
4019 esac
4020 fi
4021
4022
4023 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
4024 $as_echo "$_am_result" >&6; }
4025 rm -f confinc confmf
4026
4027 # Check whether --enable-dependency-tracking was given.
4028 if test "${enable_dependency_tracking+set}" = set; then :
4029 enableval=$enable_dependency_tracking;
4030 fi
4031
4032 if test "x$enable_dependency_tracking" != xno; then
4033 am_depcomp="$ac_aux_dir/depcomp"
4034 AMDEPBACKSLASH='\'
4035 fi
4036 if test "x$enable_dependency_tracking" != xno; then
4037 AMDEP_TRUE=
4038 AMDEP_FALSE='#'
4039 else
4040 AMDEP_TRUE='#'
4041 AMDEP_FALSE=
4042 fi
4043
4044
4473 fi
4474 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
4475 $as_echo "$lt_cv_prog_gnu_ld" >&6; }
4476 with_gnu_ld=$lt_cv_prog_gnu_ld
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
4487 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
4488 if test "${lt_cv_path_NM+set}" = set; then :
4489 $as_echo_n "(cached) " >&6
4490 else
4491 if test -n "$NM"; then
4492 # Let the user override the test.
4493 lt_cv_path_NM="$NM"
4494 else
4495 lt_nm_to_check="${ac_tool_prefix}nm"
4496 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4497 lt_nm_to_check="$lt_nm_to_check nm"
4498 fi
4499 for lt_tmp_nm in $lt_nm_to_check; do
4500 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4501 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4502 IFS="$lt_save_ifs"
4503 test -z "$ac_dir" && ac_dir=.
4504 tmp_nm="$ac_dir/$lt_tmp_nm"
4505 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4506 # Check to see if the nm accepts a BSD-compat flag.
4507 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4508 # nm: unknown option "B" ignored
4509 # Tru64's nm complains that /dev/null is an invalid object file
4510 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4511 */dev/null* | *'Invalid file or object type'*)
4512 lt_cv_path_NM="$tmp_nm -B"
4513 break
4514 ;;
4515 *)
4516 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4517 */dev/null*)
4518 lt_cv_path_NM="$tmp_nm -p"
4519 break
4520 ;;
4521 *)
4522 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4523 continue # so that we can try to find one that supports BSD flags
4524 ;;
4525 esac
4526 ;;
4527 esac
4528 fi
4529 done
4530 IFS="$lt_save_ifs"
4531 done
4532 : ${lt_cv_path_NM=no}
4533 fi
4534 fi
4535 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
4536 $as_echo "$lt_cv_path_NM" >&6; }
4537 if test "$lt_cv_path_NM" != "no"; then
4538 NM="$lt_cv_path_NM"
4539 else
4540 # Didn't find any BSD compatible name lister, look for dumpbin.
4541 if test -n "$ac_tool_prefix"; then
4542 for ac_prog in "dumpbin -symbols" "link -dump -symbols"
4543 do
4544 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4545 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4546 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4547 $as_echo_n "checking for $ac_word... " >&6; }
4548 if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
4549 $as_echo_n "(cached) " >&6
4550 else
4551 if test -n "$DUMPBIN"; then
4552 ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
4553 else
4554 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4555 for as_dir in $PATH
4556 do
4557 IFS=$as_save_IFS
4558 test -z "$as_dir" && as_dir=.
4559 for ac_exec_ext in '' $ac_executable_extensions; do
4560 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4561 ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
4562 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4563 break 2
4564 fi
4565 done
4566 done
4567 IFS=$as_save_IFS
4568
4569 fi
4570 fi
4571 DUMPBIN=$ac_cv_prog_DUMPBIN
4572 if test -n "$DUMPBIN"; then
4573 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
4574 $as_echo "$DUMPBIN" >&6; }
4575 else
4576 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4577 $as_echo "no" >&6; }
4578 fi
4579
4580
4581 test -n "$DUMPBIN" && break
4582 done
4583 fi
4584 if test -z "$DUMPBIN"; then
4585 ac_ct_DUMPBIN=$DUMPBIN
4586 for ac_prog in "dumpbin -symbols" "link -dump -symbols"
4587 do
4588 # Extract the first word of "$ac_prog", so it can be a program name with args.
4589 set dummy $ac_prog; ac_word=$2
4590 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4591 $as_echo_n "checking for $ac_word... " >&6; }
4592 if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
4593 $as_echo_n "(cached) " >&6
4594 else
4595 if test -n "$ac_ct_DUMPBIN"; then
4596 ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
4597 else
4598 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4599 for as_dir in $PATH
4600 do
4601 IFS=$as_save_IFS
4602 test -z "$as_dir" && as_dir=.
4603 for ac_exec_ext in '' $ac_executable_extensions; do
4604 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4605 ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
4606 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4607 break 2
4608 fi
4609 done
4610 done
4611 IFS=$as_save_IFS
4612
4613 fi
4614 fi
4615 ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
4616 if test -n "$ac_ct_DUMPBIN"; then
4617 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
4618 $as_echo "$ac_ct_DUMPBIN" >&6; }
4619 else
4620 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4621 $as_echo "no" >&6; }
4622 fi
4623
4624
4625 test -n "$ac_ct_DUMPBIN" && break
4626 done
4627
4628 if test "x$ac_ct_DUMPBIN" = x; then
4629 DUMPBIN=":"
4630 else
4631 case $cross_compiling:$ac_tool_warned in
4632 yes:)
4633 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4634 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4635 ac_tool_warned=yes ;;
4636 esac
4637 DUMPBIN=$ac_ct_DUMPBIN
4638 fi
4639 fi
4640
4641
4642 if test "$DUMPBIN" != ":"; then
4643 NM="$DUMPBIN"
4644 fi
4645 fi
4646 test -z "$NM" && NM=nm
4647
4648
4649
4650
4651
4652
4653 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
4654 $as_echo_n "checking the name lister ($NM) interface... " >&6; }
4655 if test "${lt_cv_nm_interface+set}" = set; then :
4656 $as_echo_n "(cached) " >&6
4657 else
4658 lt_cv_nm_interface="BSD nm"
4659 echo "int some_variable = 0;" > conftest.$ac_ext
4660 (eval echo "\"\$as_me:4661: $ac_compile\"" >&5)
4661 (eval "$ac_compile" 2>conftest.err)
4662 cat conftest.err >&5
4663 (eval echo "\"\$as_me:4664: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
4664 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4665 cat conftest.err >&5
4666 (eval echo "\"\$as_me:4667: output\"" >&5)
4667 cat conftest.out >&5
4668 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4669 lt_cv_nm_interface="MS dumpbin"
4670 fi
4671 rm -f conftest*
4672 fi
4673 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
4674 $as_echo "$lt_cv_nm_interface" >&6; }
4675
4676 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
4677 $as_echo_n "checking whether ln -s works... " >&6; }
4678 LN_S=$as_ln_s
4679 if test "$LN_S" = "ln -s"; then
4680 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4681 $as_echo "yes" >&6; }
4682 else
4683 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
4684 $as_echo "no, using $LN_S" >&6; }
4685 fi
4686
4687 # find the maximum length of command line arguments
4688 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
4689 $as_echo_n "checking the maximum length of command line arguments... " >&6; }
4690 if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
4691 $as_echo_n "(cached) " >&6
4692 else
4693 i=0
4694 teststring="ABCD"
4695
4696 case $build_os in
4697 msdosdjgpp*)
4698 # On DJGPP, this test can blow up pretty badly due to problems in libc
4699 # (any single argument exceeding 2000 bytes causes a buffer overrun
4700 # during glob expansion). Even if it were fixed, the result of this
4701 # check would be larger than it should be.
4702 lt_cv_sys_max_cmd_len=12288; # 12K is about right
4703 ;;
4704
4705 gnu*)
4706 # Under GNU Hurd, this test is not required because there is
4707 # no limit to the length of command line arguments.
4708 # Libtool will interpret -1 as no limit whatsoever
4709 lt_cv_sys_max_cmd_len=-1;
4710 ;;
4711
4712 cygwin* | mingw* | cegcc*)
4713 # On Win9x/ME, this test blows up -- it succeeds, but takes
4714 # about 5 minutes as the teststring grows exponentially.
4715 # Worse, since 9x/ME are not pre-emptively multitasking,
4716 # you end up with a "frozen" computer, even though with patience
4717 # the test eventually succeeds (with a max line length of 256k).
4718 # Instead, let's just punt: use the minimum linelength reported by
4719 # all of the supported platforms: 8192 (on NT/2K/XP).
4720 lt_cv_sys_max_cmd_len=8192;
4721 ;;
4722
4723 amigaos*)
4724 # On AmigaOS with pdksh, this test takes hours, literally.
4725 # So we just punt and use a minimum line length of 8192.
4726 lt_cv_sys_max_cmd_len=8192;
4727 ;;
4728
4729 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
4730 # This has been around since 386BSD, at least. Likely further.
4731 if test -x /sbin/sysctl; then
4732 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
4733 elif test -x /usr/sbin/sysctl; then
4734 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
4735 else
4736 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
4737 fi
4738 # And add a safety zone
4739 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4740 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4741 ;;
4742
4743 interix*)
4744 # We know the value 262144 and hardcode it with a safety zone (like BSD)
4745 lt_cv_sys_max_cmd_len=196608
4746 ;;
4747
4748 osf*)
4749 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
4750 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
4751 # nice to cause kernel panics so lets avoid the loop below.
4752 # First set a reasonable default.
4753 lt_cv_sys_max_cmd_len=16384
4754 #
4755 if test -x /sbin/sysconfig; then
4756 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
4757 *1*) lt_cv_sys_max_cmd_len=-1 ;;
4758 esac
4759 fi
4760 ;;
4761 sco3.2v5*)
4762 lt_cv_sys_max_cmd_len=102400
4763 ;;
4764 sysv5* | sco5v6* | sysv4.2uw2*)
4765 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
4766 if test -n "$kargmax"; then
4767 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
4768 else
4769 lt_cv_sys_max_cmd_len=32768
4770 fi
4771 ;;
4772 *)
4773 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
4774 if test -n "$lt_cv_sys_max_cmd_len"; then
4775 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4776 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4777 else
4778 # Make teststring a little bigger before we do anything with it.
4779 # a 1K string should be a reasonable start.
4780 for i in 1 2 3 4 5 6 7 8 ; do
4781 teststring=$teststring$teststring
4782 done
4783 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
4784 # If test is not a shell built-in, we'll probably end up computing a
4785 # maximum length that is only half of the actual maximum length, but
4786 # we can't tell.
4787 while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
4788 = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
4789 test $i != 17 # 1/2 MB should be enough
4790 do
4791 i=`expr $i + 1`
4792 teststring=$teststring$teststring
4793 done
4794 # Only check the string length outside the loop.
4795 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
4796 teststring=
4797 # Add a significant safety factor because C++ compilers can tack on
4798 # massive amounts of additional arguments before passing them to the
4799 # linker. It appears as though 1/2 is a usable value.
4800 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
4801 fi
4802 ;;
4803 esac
4804
4805 fi
4806
4807 if test -n $lt_cv_sys_max_cmd_len ; then
4808 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
4809 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
4810 else
4811 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
4812 $as_echo "none" >&6; }
4813 fi
4814 max_cmd_len=$lt_cv_sys_max_cmd_len
4815
4816
4817
4818
4819
4820
4821 : ${CP="cp -f"}
4822 : ${MV="mv -f"}
4823 : ${RM="rm -f"}
4824
4825 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
4826 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
4827 # Try some XSI features
4828 xsi_shell=no
4829 ( _lt_dummy="a/b/c"
4830 test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
4831 = c,a/b,, \
4832 && eval 'test $(( 1 + 1 )) -eq 2 \
4833 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
4834 && xsi_shell=yes
4835 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
4836 $as_echo "$xsi_shell" >&6; }
4837
4838
4839 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
4840 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
4841 lt_shell_append=no
4842 ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
4843 >/dev/null 2>&1 \
4844 && lt_shell_append=yes
4845 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
4846 $as_echo "$lt_shell_append" >&6; }
4847
4848
4849 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
4850 lt_unset=unset
4851 else
4852 lt_unset=false
4853 fi
4854
4855
4856
4857
4858
4859 # test EBCDIC or ASCII
4860 case `echo X|tr X '\101'` in
4861 A) # ASCII based system
4862 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
4863 lt_SP2NL='tr \040 \012'
4864 lt_NL2SP='tr \015\012 \040\040'
4865 ;;
4866 *) # EBCDIC based system
4867 lt_SP2NL='tr \100 \n'
4868 lt_NL2SP='tr \r\n \100\100'
4869 ;;
4870 esac
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
4881 $as_echo_n "checking for $LD option to reload object files... " >&6; }
4882 if test "${lt_cv_ld_reload_flag+set}" = set; then :
4883 $as_echo_n "(cached) " >&6
4884 else
4885 lt_cv_ld_reload_flag='-r'
4886 fi
4887 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
4888 $as_echo "$lt_cv_ld_reload_flag" >&6; }
4889 reload_flag=$lt_cv_ld_reload_flag
4890 case $reload_flag in
4891 "" | " "*) ;;
4892 *) reload_flag=" $reload_flag" ;;
4893 esac
4894 reload_cmds='$LD$reload_flag -o $output$reload_objs'
4895 case $host_os in
4896 darwin*)
4897 if test "$GCC" = yes; then
4898 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
4899 else
4900 reload_cmds='$LD$reload_flag -o $output$reload_objs'
4901 fi
4902 ;;
4903 esac
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913 if test -n "$ac_tool_prefix"; then
4914 # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
4915 set dummy ${ac_tool_prefix}objdump; ac_word=$2
4916 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4917 $as_echo_n "checking for $ac_word... " >&6; }
4918 if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
4919 $as_echo_n "(cached) " >&6
4920 else
4921 if test -n "$OBJDUMP"; then
4922 ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
4923 else
4924 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4925 for as_dir in $PATH
4926 do
4927 IFS=$as_save_IFS
4928 test -z "$as_dir" && as_dir=.
4929 for ac_exec_ext in '' $ac_executable_extensions; do
4930 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4931 ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
4932 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4933 break 2
4934 fi
4935 done
4936 done
4937 IFS=$as_save_IFS
4938
4939 fi
4940 fi
4941 OBJDUMP=$ac_cv_prog_OBJDUMP
4942 if test -n "$OBJDUMP"; then
4943 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
4944 $as_echo "$OBJDUMP" >&6; }
4945 else
4946 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4947 $as_echo "no" >&6; }
4948 fi
4949
4950
4951 fi
4952 if test -z "$ac_cv_prog_OBJDUMP"; then
4953 ac_ct_OBJDUMP=$OBJDUMP
4954 # Extract the first word of "objdump", so it can be a program name with args.
4955 set dummy objdump; ac_word=$2
4956 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4957 $as_echo_n "checking for $ac_word... " >&6; }
4958 if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
4959 $as_echo_n "(cached) " >&6
4960 else
4961 if test -n "$ac_ct_OBJDUMP"; then
4962 ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
4963 else
4964 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4965 for as_dir in $PATH
4966 do
4967 IFS=$as_save_IFS
4968 test -z "$as_dir" && as_dir=.
4969 for ac_exec_ext in '' $ac_executable_extensions; do
4970 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4971 ac_cv_prog_ac_ct_OBJDUMP="objdump"
4972 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4973 break 2
4974 fi
4975 done
4976 done
4977 IFS=$as_save_IFS
4978
4979 fi
4980 fi
4981 ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
4982 if test -n "$ac_ct_OBJDUMP"; then
4983 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
4984 $as_echo "$ac_ct_OBJDUMP" >&6; }
4985 else
4986 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4987 $as_echo "no" >&6; }
4988 fi
4989
4990 if test "x$ac_ct_OBJDUMP" = x; then
4991 OBJDUMP="false"
4992 else
4993 case $cross_compiling:$ac_tool_warned in
4994 yes:)
4995 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4996 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4997 ac_tool_warned=yes ;;
4998 esac
4999 OBJDUMP=$ac_ct_OBJDUMP
5000 fi
5001 else
5002 OBJDUMP="$ac_cv_prog_OBJDUMP"
5003 fi
5004
5005 test -z "$OBJDUMP" && OBJDUMP=objdump
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
5016 $as_echo_n "checking how to recognize dependent libraries... " >&6; }
5017 if test "${lt_cv_deplibs_check_method+set}" = set; then :
5018 $as_echo_n "(cached) " >&6
5019 else
5020 lt_cv_file_magic_cmd='$MAGIC_CMD'
5021 lt_cv_file_magic_test_file=
5022 lt_cv_deplibs_check_method='unknown'
5023 # Need to set the preceding variable on all platforms that support
5024 # interlibrary dependencies.
5025 # 'none' -- dependencies not supported.
5026 # `unknown' -- same as none, but documents that we really don't know.
5027 # 'pass_all' -- all dependencies passed with no checks.
5028 # 'test_compile' -- check by making test program.
5029 # 'file_magic [[regex]]' -- check by looking for files in library path
5030 # which responds to the $file_magic_cmd with a given extended regex.
5031 # If you have `file' or equivalent on your system and you're not sure
5032 # whether `pass_all' will *always* work, you probably want this one.
5033
5034 case $host_os in
5035 aix[4-9]*)
5036 lt_cv_deplibs_check_method=pass_all
5037 ;;
5038
5039 beos*)
5040 lt_cv_deplibs_check_method=pass_all
5041 ;;
5042
5043 bsdi[45]*)
5044 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
5045 lt_cv_file_magic_cmd='/usr/bin/file -L'
5046 lt_cv_file_magic_test_file=/shlib/libc.so
5047 ;;
5048
5049 cygwin*)
5050 # func_win32_libid is a shell function defined in ltmain.sh
5051 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5052 lt_cv_file_magic_cmd='func_win32_libid'
5053 ;;
5054
5055 mingw* | pw32*)
5056 # Base MSYS/MinGW do not provide the 'file' command needed by
5057 # func_win32_libid shell function, so use a weaker test based on 'objdump',
5058 # unless we find 'file', for example because we are cross-compiling.
5059 if ( file / ) >/dev/null 2>&1; then
5060 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5061 lt_cv_file_magic_cmd='func_win32_libid'
5062 else
5063 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
5064 lt_cv_file_magic_cmd='$OBJDUMP -f'
5065 fi
5066 ;;
5067
5068 cegcc)
5069 # use the weaker test based on 'objdump'. See mingw*.
5070 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
5071 lt_cv_file_magic_cmd='$OBJDUMP -f'
5072 ;;
5073
5074 darwin* | rhapsody*)
5075 lt_cv_deplibs_check_method=pass_all
5076 ;;
5077
5078 freebsd* | dragonfly*)
5079 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5080 case $host_cpu in
5081 i*86 )
5082 # Not sure whether the presence of OpenBSD here was a mistake.
5083 # Let's accept both of them until this is cleared up.
5084 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
5085 lt_cv_file_magic_cmd=/usr/bin/file
5086 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5087 ;;
5088 esac
5089 else
5090 lt_cv_deplibs_check_method=pass_all
5091 fi
5092 ;;
5093
5094 gnu*)
5095 lt_cv_deplibs_check_method=pass_all
5096 ;;
5097
5098 hpux10.20* | hpux11*)
5099 lt_cv_file_magic_cmd=/usr/bin/file
5100 case $host_cpu in
5101 ia64*)
5102 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
5103 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
5104 ;;
5105 hppa*64*)
5106 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
5107 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
5108 ;;
5109 *)
5110 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
5111 lt_cv_file_magic_test_file=/usr/lib/libc.sl
5112 ;;
5113 esac
5114 ;;
5115
5116 interix[3-9]*)
5117 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
5118 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
5119 ;;
5120
5121 irix5* | irix6* | nonstopux*)
5122 case $LD in
5123 *-32|*"-32 ") libmagic=32-bit;;
5124 *-n32|*"-n32 ") libmagic=N32;;
5125 *-64|*"-64 ") libmagic=64-bit;;
5126 *) libmagic=never-match;;
5127 esac
5128 lt_cv_deplibs_check_method=pass_all
5129 ;;
5130
5131 # This must be Linux ELF.
5132 linux* | k*bsd*-gnu | kopensolaris*-gnu)
5133 lt_cv_deplibs_check_method=pass_all
5134 ;;
5135
5136 netbsd* | netbsdelf*-gnu)
5137 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5138 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5139 else
5140 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
5141 fi
5142 ;;
5143
5144 newos6*)
5145 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
5146 lt_cv_file_magic_cmd=/usr/bin/file
5147 lt_cv_file_magic_test_file=/usr/lib/libnls.so
5148 ;;
5149
5150 *nto* | *qnx*)
5151 lt_cv_deplibs_check_method=pass_all
5152 ;;
5153
5154 openbsd*)
5155 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5156 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
5157 else
5158 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5159 fi
5160 ;;
5161
5162 osf3* | osf4* | osf5*)
5163 lt_cv_deplibs_check_method=pass_all
5164 ;;
5165
5166 rdos*)
5167 lt_cv_deplibs_check_method=pass_all
5168 ;;
5169
5170 solaris*)
5171 lt_cv_deplibs_check_method=pass_all
5172 ;;
5173
5174 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5175 lt_cv_deplibs_check_method=pass_all
5176 ;;
5177
5178 sysv4 | sysv4.3*)
5179 case $host_vendor in
5180 motorola)
5181 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
5182 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
5183 ;;
5184 ncr)
5185 lt_cv_deplibs_check_method=pass_all
5186 ;;
5187 sequent)
5188 lt_cv_file_magic_cmd='/bin/file'
5189 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
5190 ;;
5191 sni)
5192 lt_cv_file_magic_cmd='/bin/file'
5193 lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
5194 lt_cv_file_magic_test_file=/lib/libc.so
5195 ;;
5196 siemens)
5197 lt_cv_deplibs_check_method=pass_all
5198 ;;
5199 pc)
5200 lt_cv_deplibs_check_method=pass_all
5201 ;;
5202 esac
5203 ;;
5204
5205 tpf*)
5206 lt_cv_deplibs_check_method=pass_all
5207 ;;
5208 esac
5209
5210 fi
5211 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
5212 $as_echo "$lt_cv_deplibs_check_method" >&6; }
5213 file_magic_cmd=$lt_cv_file_magic_cmd
5214 deplibs_check_method=$lt_cv_deplibs_check_method
5215 test -z "$deplibs_check_method" && deplibs_check_method=unknown
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228 if test -n "$ac_tool_prefix"; then
5229 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
5230 set dummy ${ac_tool_prefix}ar; ac_word=$2
5231 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5232 $as_echo_n "checking for $ac_word... " >&6; }
5233 if test "${ac_cv_prog_AR+set}" = set; then :
5234 $as_echo_n "(cached) " >&6
5235 else
5236 if test -n "$AR"; then
5237 ac_cv_prog_AR="$AR" # Let the user override the test.
5238 else
5239 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5240 for as_dir in $PATH
5241 do
5242 IFS=$as_save_IFS
5243 test -z "$as_dir" && as_dir=.
5244 for ac_exec_ext in '' $ac_executable_extensions; do
5245 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5246 ac_cv_prog_AR="${ac_tool_prefix}ar"
5247 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5248 break 2
5249 fi
5250 done
5251 done
5252 IFS=$as_save_IFS
5253
5254 fi
5255 fi
5256 AR=$ac_cv_prog_AR
5257 if test -n "$AR"; then
5258 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
5259 $as_echo "$AR" >&6; }
5260 else
5261 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5262 $as_echo "no" >&6; }
5263 fi
5264
5265
5266 fi
5267 if test -z "$ac_cv_prog_AR"; then
5268 ac_ct_AR=$AR
5269 # Extract the first word of "ar", so it can be a program name with args.
5270 set dummy ar; ac_word=$2
5271 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5272 $as_echo_n "checking for $ac_word... " >&6; }
5273 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
5274 $as_echo_n "(cached) " >&6
5275 else
5276 if test -n "$ac_ct_AR"; then
5277 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5278 else
5279 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5280 for as_dir in $PATH
5281 do
5282 IFS=$as_save_IFS
5283 test -z "$as_dir" && as_dir=.
5284 for ac_exec_ext in '' $ac_executable_extensions; do
5285 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5286 ac_cv_prog_ac_ct_AR="ar"
5287 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5288 break 2
5289 fi
5290 done
5291 done
5292 IFS=$as_save_IFS
5293
5294 fi
5295 fi
5296 ac_ct_AR=$ac_cv_prog_ac_ct_AR
5297 if test -n "$ac_ct_AR"; then
5298 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
5299 $as_echo "$ac_ct_AR" >&6; }
5300 else
5301 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5302 $as_echo "no" >&6; }
5303 fi
5304
5305 if test "x$ac_ct_AR" = x; then
5306 AR="false"
5307 else
5308 case $cross_compiling:$ac_tool_warned in
5309 yes:)
5310 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5311 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5312 ac_tool_warned=yes ;;
5313 esac
5314 AR=$ac_ct_AR
5315 fi
5316 else
5317 AR="$ac_cv_prog_AR"
5318 fi
5319
5320 test -z "$AR" && AR=ar
5321 test -z "$AR_FLAGS" && AR_FLAGS=cru
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333 if test -n "$ac_tool_prefix"; then
5334 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
5335 set dummy ${ac_tool_prefix}strip; ac_word=$2
5336 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5337 $as_echo_n "checking for $ac_word... " >&6; }
5338 if test "${ac_cv_prog_STRIP+set}" = set; then :
5339 $as_echo_n "(cached) " >&6
5340 else
5341 if test -n "$STRIP"; then
5342 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
5343 else
5344 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5345 for as_dir in $PATH
5346 do
5347 IFS=$as_save_IFS
5348 test -z "$as_dir" && as_dir=.
5349 for ac_exec_ext in '' $ac_executable_extensions; do
5350 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5351 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
5352 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5353 break 2
5354 fi
5355 done
5356 done
5357 IFS=$as_save_IFS
5358
5359 fi
5360 fi
5361 STRIP=$ac_cv_prog_STRIP
5362 if test -n "$STRIP"; then
5363 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
5364 $as_echo "$STRIP" >&6; }
5365 else
5366 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5367 $as_echo "no" >&6; }
5368 fi
5369
5370
5371 fi
5372 if test -z "$ac_cv_prog_STRIP"; then
5373 ac_ct_STRIP=$STRIP
5374 # Extract the first word of "strip", so it can be a program name with args.
5375 set dummy strip; ac_word=$2
5376 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5377 $as_echo_n "checking for $ac_word... " >&6; }
5378 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
5379 $as_echo_n "(cached) " >&6
5380 else
5381 if test -n "$ac_ct_STRIP"; then
5382 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
5383 else
5384 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5385 for as_dir in $PATH
5386 do
5387 IFS=$as_save_IFS
5388 test -z "$as_dir" && as_dir=.
5389 for ac_exec_ext in '' $ac_executable_extensions; do
5390 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5391 ac_cv_prog_ac_ct_STRIP="strip"
5392 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5393 break 2
5394 fi
5395 done
5396 done
5397 IFS=$as_save_IFS
5398
5399 fi
5400 fi
5401 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
5402 if test -n "$ac_ct_STRIP"; then
5403 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
5404 $as_echo "$ac_ct_STRIP" >&6; }
5405 else
5406 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5407 $as_echo "no" >&6; }
5408 fi
5409
5410 if test "x$ac_ct_STRIP" = x; then
5411 STRIP=":"
5412 else
5413 case $cross_compiling:$ac_tool_warned in
5414 yes:)
5415 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5416 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5417 ac_tool_warned=yes ;;
5418 esac
5419 STRIP=$ac_ct_STRIP
5420 fi
5421 else
5422 STRIP="$ac_cv_prog_STRIP"
5423 fi
5424
5425 test -z "$STRIP" && STRIP=:
5426
5427
5428
5429
5430
5431
5432 if test -n "$ac_tool_prefix"; then
5433 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
5434 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
5435 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5436 $as_echo_n "checking for $ac_word... " >&6; }
5437 if test "${ac_cv_prog_RANLIB+set}" = set; then :
5438 $as_echo_n "(cached) " >&6
5439 else
5440 if test -n "$RANLIB"; then
5441 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
5442 else
5443 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5444 for as_dir in $PATH
5445 do
5446 IFS=$as_save_IFS
5447 test -z "$as_dir" && as_dir=.
5448 for ac_exec_ext in '' $ac_executable_extensions; do
5449 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5450 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
5451 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5452 break 2
5453 fi
5454 done
5455 done
5456 IFS=$as_save_IFS
5457
5458 fi
5459 fi
5460 RANLIB=$ac_cv_prog_RANLIB
5461 if test -n "$RANLIB"; then
5462 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
5463 $as_echo "$RANLIB" >&6; }
5464 else
5465 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5466 $as_echo "no" >&6; }
5467 fi
5468
5469
5470 fi
5471 if test -z "$ac_cv_prog_RANLIB"; then
5472 ac_ct_RANLIB=$RANLIB
5473 # Extract the first word of "ranlib", so it can be a program name with args.
5474 set dummy ranlib; ac_word=$2
5475 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5476 $as_echo_n "checking for $ac_word... " >&6; }
5477 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
5478 $as_echo_n "(cached) " >&6
5479 else
5480 if test -n "$ac_ct_RANLIB"; then
5481 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
5482 else
5483 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5484 for as_dir in $PATH
5485 do
5486 IFS=$as_save_IFS
5487 test -z "$as_dir" && as_dir=.
5488 for ac_exec_ext in '' $ac_executable_extensions; do
5489 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5490 ac_cv_prog_ac_ct_RANLIB="ranlib"
5491 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5492 break 2
5493 fi
5494 done
5495 done
5496 IFS=$as_save_IFS
5497
5498 fi
5499 fi
5500 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
5501 if test -n "$ac_ct_RANLIB"; then
5502 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
5503 $as_echo "$ac_ct_RANLIB" >&6; }
5504 else
5505 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5506 $as_echo "no" >&6; }
5507 fi
5508
5509 if test "x$ac_ct_RANLIB" = x; then
5510 RANLIB=":"
5511 else
5512 case $cross_compiling:$ac_tool_warned in
5513 yes:)
5514 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5515 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5516 ac_tool_warned=yes ;;
5517 esac
5518 RANLIB=$ac_ct_RANLIB
5519 fi
5520 else
5521 RANLIB="$ac_cv_prog_RANLIB"
5522 fi
5523
5524 test -z "$RANLIB" && RANLIB=:
5525
5526
5527
5528
5529
5530
5531 # Determine commands to create old-style static archives.
5532 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
5533 old_postinstall_cmds='chmod 644 $oldlib'
5534 old_postuninstall_cmds=
5535
5536 if test -n "$RANLIB"; then
5537 case $host_os in
5538 openbsd*)
5539 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
5540 ;;
5541 *)
5542 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
5543 ;;
5544 esac
5545 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
5546 fi
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581 # If no C compiler was specified, use CC.
5582 LTCC=${LTCC-"$CC"}
5583
5584 # If no C compiler flags were specified, use CFLAGS.
5585 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
5586
5587 # Allow CC to be a program name with arguments.
5588 compiler=$CC
5589
5590
5591 # Check for command to grab the raw symbol name followed by C symbol from nm.
5592 { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
5593 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
5594 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
5595 $as_echo_n "(cached) " >&6
5596 else
5597
5598 # These are sane defaults that work on at least a few old systems.
5599 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
5600
5601 # Character class describing NM global symbol codes.
5602 symcode='[BCDEGRST]'
5603
5604 # Regexp to match symbols that can be accessed directly from C.
5605 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
5606
5607 # Define system-specific variables.
5608 case $host_os in
5609 aix*)
5610 symcode='[BCDT]'
5611 ;;
5612 cygwin* | mingw* | pw32* | cegcc*)
5613 symcode='[ABCDGISTW]'
5614 ;;
5615 hpux*)
5616 if test "$host_cpu" = ia64; then
5617 symcode='[ABCDEGRST]'
5618 fi
5619 ;;
5620 irix* | nonstopux*)
5621 symcode='[BCDEGRST]'
5622 ;;
5623 osf*)
5624 symcode='[BCDEGQRST]'
5625 ;;
5626 solaris*)
5627 symcode='[BDRT]'
5628 ;;
5629 sco3.2v5*)
5630 symcode='[DT]'
5631 ;;
5632 sysv4.2uw2*)
5633 symcode='[DT]'
5634 ;;
5635 sysv5* | sco5v6* | unixware* | OpenUNIX*)
5636 symcode='[ABDT]'
5637 ;;
5638 sysv4)
5639 symcode='[DFNSTU]'
5640 ;;
5641 esac
5642
5643 # If we're using GNU nm, then use its standard symbol codes.
5644 case `$NM -V 2>&1` in
5645 *GNU* | *'with BFD'*)
5646 symcode='[ABCDGIRSTW]' ;;
5647 esac
5648
5649 # Transform an extracted symbol line into a proper C declaration.
5650 # Some systems (esp. on ia64) link data and code symbols differently,
5651 # so use this general approach.
5652 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
5653
5654 # Transform an extracted symbol line into symbol name and symbol address
5655 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
5656 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
5657
5658 # Handle CRLF in mingw tool chain
5659 opt_cr=
5660 case $build_os in
5661 mingw*)
5662 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
5663 ;;
5664 esac
5665
5666 # Try without a prefix underscore, then with it.
5667 for ac_symprfx in "" "_"; do
5668
5669 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
5670 symxfrm="\\1 $ac_symprfx\\2 \\2"
5671
5672 # Write the raw and C identifiers.
5673 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
5674 # Fake it for dumpbin and say T for any non-static function
5675 # and D for any global variable.
5676 # Also find C++ and __fastcall symbols from MSVC++,
5677 # which start with @ or ?.
5678 lt_cv_sys_global_symbol_pipe="$AWK '"\
5679 " {last_section=section; section=\$ 3};"\
5680 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
5681 " \$ 0!~/External *\|/{next};"\
5682 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
5683 " {if(hide[section]) next};"\
5684 " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
5685 " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
5686 " s[1]~/^[@?]/{print s[1], s[1]; next};"\
5687 " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
5688 " ' prfx=^$ac_symprfx"
5689 else
5690 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
5691 fi
5692
5693 # Check to see that the pipe works correctly.
5694 pipe_works=no
5695
5696 rm -f conftest*
5697 cat > conftest.$ac_ext <<_LT_EOF
5698 #ifdef __cplusplus
5699 extern "C" {
5700 #endif
5701 char nm_test_var;
5702 void nm_test_func(void);
5703 void nm_test_func(void){}
5704 #ifdef __cplusplus
5705 }
5706 #endif
5707 int main(){nm_test_var='a';nm_test_func();return(0);}
5708 _LT_EOF
5709
5710 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
5711 (eval $ac_compile) 2>&5
5712 ac_status=$?
5713 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5714 test $ac_status = 0; }; then
5715 # Now try to grab the symbols.
5716 nlist=conftest.nm
5717 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5
5718 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
5719 ac_status=$?
5720 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5721 test $ac_status = 0; } && test -s "$nlist"; then
5722 # Try sorting and uniquifying the output.
5723 if sort "$nlist" | uniq > "$nlist"T; then
5724 mv -f "$nlist"T "$nlist"
5725 else
5726 rm -f "$nlist"T
5727 fi
5728
5729 # Make sure that we snagged all the symbols we need.
5730 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
5731 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
5732 cat <<_LT_EOF > conftest.$ac_ext
5733 #ifdef __cplusplus
5734 extern "C" {
5735 #endif
5736
5737 _LT_EOF
5738 # Now generate the symbol file.
5739 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
5740
5741 cat <<_LT_EOF >> conftest.$ac_ext
5742
5743 /* The mapping between symbol names and symbols. */
5744 const struct {
5745 const char *name;
5746 void *address;
5747 }
5748 lt__PROGRAM__LTX_preloaded_symbols[] =
5749 {
5750 { "@PROGRAM@", (void *) 0 },
5751 _LT_EOF
5752 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
5753 cat <<\_LT_EOF >> conftest.$ac_ext
5754 {0, (void *) 0}
5755 };
5756
5757 /* This works around a problem in FreeBSD linker */
5758 #ifdef FREEBSD_WORKAROUND
5759 static const void *lt_preloaded_setup() {
5760 return lt__PROGRAM__LTX_preloaded_symbols;
5761 }
5762 #endif
5763
5764 #ifdef __cplusplus
5765 }
5766 #endif
5767 _LT_EOF
5768 # Now try linking the two files.
5769 mv conftest.$ac_objext conftstm.$ac_objext
5770 lt_save_LIBS="$LIBS"
5771 lt_save_CFLAGS="$CFLAGS"
5772 LIBS="conftstm.$ac_objext"
5773 CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
5774 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
5775 (eval $ac_link) 2>&5
5776 ac_status=$?
5777 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5778 test $ac_status = 0; } && test -s conftest${ac_exeext}; then
5779 pipe_works=yes
5780 fi
5781 LIBS="$lt_save_LIBS"
5782 CFLAGS="$lt_save_CFLAGS"
5783 else
5784 echo "cannot find nm_test_func in $nlist" >&5
5785 fi
5786 else
5787 echo "cannot find nm_test_var in $nlist" >&5
5788 fi
5789 else
5790 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
5791 fi
5792 else
5793 echo "$progname: failed program was:" >&5
5794 cat conftest.$ac_ext >&5
5795 fi
5796 rm -rf conftest* conftst*
5797
5798 # Do not use the global_symbol_pipe unless it works.
5799 if test "$pipe_works" = yes; then
5800 break
5801 else
5802 lt_cv_sys_global_symbol_pipe=
5803 fi
5804 done
5805
5806 fi
5807
5808 if test -z "$lt_cv_sys_global_symbol_pipe"; then
5809 lt_cv_sys_global_symbol_to_cdecl=
5810 fi
5811 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
5812 { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
5813 $as_echo "failed" >&6; }
5814 else
5815 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
5816 $as_echo "ok" >&6; }
5817 fi
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841 # Check whether --enable-libtool-lock was given.
5842 if test "${enable_libtool_lock+set}" = set; then :
5843 enableval=$enable_libtool_lock;
5844 fi
5845
5846 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
5847
5848 # Some flags need to be propagated to the compiler or linker for good
5849 # libtool support.
5850 case $host in
5851 ia64-*-hpux*)
5852 # Find out which ABI we are using.
5853 echo 'int i;' > conftest.$ac_ext
5854 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
5855 (eval $ac_compile) 2>&5
5856 ac_status=$?
5857 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5858 test $ac_status = 0; }; then
5859 case `/usr/bin/file conftest.$ac_objext` in
5860 *ELF-32*)
5861 HPUX_IA64_MODE="32"
5862 ;;
5863 *ELF-64*)
5864 HPUX_IA64_MODE="64"
5865 ;;
5866 esac
5867 fi
5868 rm -rf conftest*
5869 ;;
5870 *-*-irix6*)
5871 # Find out which ABI we are using.
5872 echo '#line 5873 "configure"' > conftest.$ac_ext
5873 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
5874 (eval $ac_compile) 2>&5
5875 ac_status=$?
5876 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5877 test $ac_status = 0; }; then
5878 if test "$lt_cv_prog_gnu_ld" = yes; then
5879 case `/usr/bin/file conftest.$ac_objext` in
5880 *32-bit*)
5881 LD="${LD-ld} -melf32bsmip"
5882 ;;
5883 *N32*)
5884 LD="${LD-ld} -melf32bmipn32"
5885 ;;
5886 *64-bit*)
5887 LD="${LD-ld} -melf64bmip"
5888 ;;
5889 esac
5890 else
5891 case `/usr/bin/file conftest.$ac_objext` in
5892 *32-bit*)
5893 LD="${LD-ld} -32"
5894 ;;
5895 *N32*)
5896 LD="${LD-ld} -n32"
5897 ;;
5898 *64-bit*)
5899 LD="${LD-ld} -64"
5900 ;;
5901 esac
5902 fi
5903 fi
5904 rm -rf conftest*
5905 ;;
5906
5907 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
5908 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
5909 # Find out which ABI we are using.
5910 echo 'int i;' > conftest.$ac_ext
5911 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
5912 (eval $ac_compile) 2>&5
5913 ac_status=$?
5914 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5915 test $ac_status = 0; }; then
5916 case `/usr/bin/file conftest.o` in
5917 *32-bit*)
5918 case $host in
5919 x86_64-*kfreebsd*-gnu)
5920 LD="${LD-ld} -m elf_i386_fbsd"
5921 ;;
5922 x86_64-*linux*)
5923 LD="${LD-ld} -m elf_i386"
5924 ;;
5925 ppc64-*linux*|powerpc64-*linux*)
5926 LD="${LD-ld} -m elf32ppclinux"
5927 ;;
5928 s390x-*linux*)
5929 LD="${LD-ld} -m elf_s390"
5930 ;;
5931 sparc64-*linux*)
5932 LD="${LD-ld} -m elf32_sparc"
5933 ;;
5934 esac
5935 ;;
5936 *64-bit*)
5937 case $host in
5938 x86_64-*kfreebsd*-gnu)
5939 LD="${LD-ld} -m elf_x86_64_fbsd"
5940 ;;
5941 x86_64-*linux*)
5942 LD="${LD-ld} -m elf_x86_64"
5943 ;;
5944 ppc*-*linux*|powerpc*-*linux*)
5945 LD="${LD-ld} -m elf64ppc"
5946 ;;
5947 s390*-*linux*|s390*-*tpf*)
5948 LD="${LD-ld} -m elf64_s390"
5949 ;;
5950 sparc*-*linux*)
5951 LD="${LD-ld} -m elf64_sparc"
5952 ;;
5953 esac
5954 ;;
5955 esac
5956 fi
5957 rm -rf conftest*
5958 ;;
5959
5960 *-*-sco3.2v5*)
5961 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
5962 SAVE_CFLAGS="$CFLAGS"
5963 CFLAGS="$CFLAGS -belf"
5964 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
5965 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
5966 if test "${lt_cv_cc_needs_belf+set}" = set; then :
5967 $as_echo_n "(cached) " >&6
5968 else
5969 ac_ext=c
5970 ac_cpp='$CPP $CPPFLAGS'
5971 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5972 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5973 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5974
5975 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
5976 /* end confdefs.h. */
5977
5978 int
5979 main ()
5980 {
5981
5982 ;
5983 return 0;
5984 }
5985 _ACEOF
5986 if ac_fn_c_try_link "$LINENO"; then :
5987 lt_cv_cc_needs_belf=yes
5988 else
5989 lt_cv_cc_needs_belf=no
5990 fi
5991 rm -f core conftest.err conftest.$ac_objext \
5992 conftest$ac_exeext conftest.$ac_ext
5993 ac_ext=c
5994 ac_cpp='$CPP $CPPFLAGS'
5995 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
5996 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
5997 ac_compiler_gnu=$ac_cv_c_compiler_gnu
5998
5999 fi
6000 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
6001 $as_echo "$lt_cv_cc_needs_belf" >&6; }
6002 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
6003 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6004 CFLAGS="$SAVE_CFLAGS"
6005 fi
6006 ;;
6007 sparc*-*solaris*)
6008 # Find out which ABI we are using.
6009 echo 'int i;' > conftest.$ac_ext
6010 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6011 (eval $ac_compile) 2>&5
6012 ac_status=$?
6013 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6014 test $ac_status = 0; }; then
6015 case `/usr/bin/file conftest.o` in
6016 *64-bit*)
6017 case $lt_cv_prog_gnu_ld in
6018 yes*) LD="${LD-ld} -m elf64_sparc" ;;
6019 *)
6020 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
6021 LD="${LD-ld} -64"
6022 fi
6023 ;;
6024 esac
6025 ;;
6026 esac
6027 fi
6028 rm -rf conftest*
6029 ;;
6030 esac
6031
6032 need_locks="$enable_libtool_lock"
6033
6034
6035 case $host_os in
6036 rhapsody* | darwin*)
6037 if test -n "$ac_tool_prefix"; then
6038 # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
6039 set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
6040 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6041 $as_echo_n "checking for $ac_word... " >&6; }
6042 if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
6043 $as_echo_n "(cached) " >&6
6044 else
6045 if test -n "$DSYMUTIL"; then
6046 ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
6047 else
6048 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6049 for as_dir in $PATH
6050 do
6051 IFS=$as_save_IFS
6052 test -z "$as_dir" && as_dir=.
6053 for ac_exec_ext in '' $ac_executable_extensions; do
6054 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6055 ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
6056 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6057 break 2
6058 fi
6059 done
6060 done
6061 IFS=$as_save_IFS
6062
6063 fi
6064 fi
6065 DSYMUTIL=$ac_cv_prog_DSYMUTIL
6066 if test -n "$DSYMUTIL"; then
6067 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
6068 $as_echo "$DSYMUTIL" >&6; }
6069 else
6070 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6071 $as_echo "no" >&6; }
6072 fi
6073
6074
6075 fi
6076 if test -z "$ac_cv_prog_DSYMUTIL"; then
6077 ac_ct_DSYMUTIL=$DSYMUTIL
6078 # Extract the first word of "dsymutil", so it can be a program name with args.
6079 set dummy dsymutil; ac_word=$2
6080 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6081 $as_echo_n "checking for $ac_word... " >&6; }
6082 if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
6083 $as_echo_n "(cached) " >&6
6084 else
6085 if test -n "$ac_ct_DSYMUTIL"; then
6086 ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
6087 else
6088 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6089 for as_dir in $PATH
6090 do
6091 IFS=$as_save_IFS
6092 test -z "$as_dir" && as_dir=.
6093 for ac_exec_ext in '' $ac_executable_extensions; do
6094 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6095 ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
6096 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6097 break 2
6098 fi
6099 done
6100 done
6101 IFS=$as_save_IFS
6102
6103 fi
6104 fi
6105 ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
6106 if test -n "$ac_ct_DSYMUTIL"; then
6107 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
6108 $as_echo "$ac_ct_DSYMUTIL" >&6; }
6109 else
6110 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6111 $as_echo "no" >&6; }
6112 fi
6113
6114 if test "x$ac_ct_DSYMUTIL" = x; then
6115 DSYMUTIL=":"
6116 else
6117 case $cross_compiling:$ac_tool_warned in
6118 yes:)
6119 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6120 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6121 ac_tool_warned=yes ;;
6122 esac
6123 DSYMUTIL=$ac_ct_DSYMUTIL
6124 fi
6125 else
6126 DSYMUTIL="$ac_cv_prog_DSYMUTIL"
6127 fi
6128
6129 if test -n "$ac_tool_prefix"; then
6130 # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
6131 set dummy ${ac_tool_prefix}nmedit; ac_word=$2
6132 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6133 $as_echo_n "checking for $ac_word... " >&6; }
6134 if test "${ac_cv_prog_NMEDIT+set}" = set; then :
6135 $as_echo_n "(cached) " >&6
6136 else
6137 if test -n "$NMEDIT"; then
6138 ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
6139 else
6140 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6141 for as_dir in $PATH
6142 do
6143 IFS=$as_save_IFS
6144 test -z "$as_dir" && as_dir=.
6145 for ac_exec_ext in '' $ac_executable_extensions; do
6146 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6147 ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
6148 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6149 break 2
6150 fi
6151 done
6152 done
6153 IFS=$as_save_IFS
6154
6155 fi
6156 fi
6157 NMEDIT=$ac_cv_prog_NMEDIT
6158 if test -n "$NMEDIT"; then
6159 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
6160 $as_echo "$NMEDIT" >&6; }
6161 else
6162 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6163 $as_echo "no" >&6; }
6164 fi
6165
6166
6167 fi
6168 if test -z "$ac_cv_prog_NMEDIT"; then
6169 ac_ct_NMEDIT=$NMEDIT
6170 # Extract the first word of "nmedit", so it can be a program name with args.
6171 set dummy nmedit; ac_word=$2
6172 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6173 $as_echo_n "checking for $ac_word... " >&6; }
6174 if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
6175 $as_echo_n "(cached) " >&6
6176 else
6177 if test -n "$ac_ct_NMEDIT"; then
6178 ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
6179 else
6180 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6181 for as_dir in $PATH
6182 do
6183 IFS=$as_save_IFS
6184 test -z "$as_dir" && as_dir=.
6185 for ac_exec_ext in '' $ac_executable_extensions; do
6186 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6187 ac_cv_prog_ac_ct_NMEDIT="nmedit"
6188 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6189 break 2
6190 fi
6191 done
6192 done
6193 IFS=$as_save_IFS
6194
6195 fi
6196 fi
6197 ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
6198 if test -n "$ac_ct_NMEDIT"; then
6199 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
6200 $as_echo "$ac_ct_NMEDIT" >&6; }
6201 else
6202 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6203 $as_echo "no" >&6; }
6204 fi
6205
6206 if test "x$ac_ct_NMEDIT" = x; then
6207 NMEDIT=":"
6208 else
6209 case $cross_compiling:$ac_tool_warned in
6210 yes:)
6211 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6212 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6213 ac_tool_warned=yes ;;
6214 esac
6215 NMEDIT=$ac_ct_NMEDIT
6216 fi
6217 else
6218 NMEDIT="$ac_cv_prog_NMEDIT"
6219 fi
6220
6221 if test -n "$ac_tool_prefix"; then
6222 # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
6223 set dummy ${ac_tool_prefix}lipo; ac_word=$2
6224 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6225 $as_echo_n "checking for $ac_word... " >&6; }
6226 if test "${ac_cv_prog_LIPO+set}" = set; then :
6227 $as_echo_n "(cached) " >&6
6228 else
6229 if test -n "$LIPO"; then
6230 ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
6231 else
6232 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6233 for as_dir in $PATH
6234 do
6235 IFS=$as_save_IFS
6236 test -z "$as_dir" && as_dir=.
6237 for ac_exec_ext in '' $ac_executable_extensions; do
6238 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6239 ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
6240 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6241 break 2
6242 fi
6243 done
6244 done
6245 IFS=$as_save_IFS
6246
6247 fi
6248 fi
6249 LIPO=$ac_cv_prog_LIPO
6250 if test -n "$LIPO"; then
6251 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
6252 $as_echo "$LIPO" >&6; }
6253 else
6254 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6255 $as_echo "no" >&6; }
6256 fi
6257
6258
6259 fi
6260 if test -z "$ac_cv_prog_LIPO"; then
6261 ac_ct_LIPO=$LIPO
6262 # Extract the first word of "lipo", so it can be a program name with args.
6263 set dummy lipo; ac_word=$2
6264 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6265 $as_echo_n "checking for $ac_word... " >&6; }
6266 if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
6267 $as_echo_n "(cached) " >&6
6268 else
6269 if test -n "$ac_ct_LIPO"; then
6270 ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
6271 else
6272 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6273 for as_dir in $PATH
6274 do
6275 IFS=$as_save_IFS
6276 test -z "$as_dir" && as_dir=.
6277 for ac_exec_ext in '' $ac_executable_extensions; do
6278 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6279 ac_cv_prog_ac_ct_LIPO="lipo"
6280 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6281 break 2
6282 fi
6283 done
6284 done
6285 IFS=$as_save_IFS
6286
6287 fi
6288 fi
6289 ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
6290 if test -n "$ac_ct_LIPO"; then
6291 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
6292 $as_echo "$ac_ct_LIPO" >&6; }
6293 else
6294 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6295 $as_echo "no" >&6; }
6296 fi
6297
6298 if test "x$ac_ct_LIPO" = x; then
6299 LIPO=":"
6300 else
6301 case $cross_compiling:$ac_tool_warned in
6302 yes:)
6303 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6304 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6305 ac_tool_warned=yes ;;
6306 esac
6307 LIPO=$ac_ct_LIPO
6308 fi
6309 else
6310 LIPO="$ac_cv_prog_LIPO"
6311 fi
6312
6313 if test -n "$ac_tool_prefix"; then
6314 # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
6315 set dummy ${ac_tool_prefix}otool; ac_word=$2
6316 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6317 $as_echo_n "checking for $ac_word... " >&6; }
6318 if test "${ac_cv_prog_OTOOL+set}" = set; then :
6319 $as_echo_n "(cached) " >&6
6320 else
6321 if test -n "$OTOOL"; then
6322 ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
6323 else
6324 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6325 for as_dir in $PATH
6326 do
6327 IFS=$as_save_IFS
6328 test -z "$as_dir" && as_dir=.
6329 for ac_exec_ext in '' $ac_executable_extensions; do
6330 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6331 ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
6332 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6333 break 2
6334 fi
6335 done
6336 done
6337 IFS=$as_save_IFS
6338
6339 fi
6340 fi
6341 OTOOL=$ac_cv_prog_OTOOL
6342 if test -n "$OTOOL"; then
6343 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
6344 $as_echo "$OTOOL" >&6; }
6345 else
6346 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6347 $as_echo "no" >&6; }
6348 fi
6349
6350
6351 fi
6352 if test -z "$ac_cv_prog_OTOOL"; then
6353 ac_ct_OTOOL=$OTOOL
6354 # Extract the first word of "otool", so it can be a program name with args.
6355 set dummy otool; ac_word=$2
6356 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6357 $as_echo_n "checking for $ac_word... " >&6; }
6358 if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
6359 $as_echo_n "(cached) " >&6
6360 else
6361 if test -n "$ac_ct_OTOOL"; then
6362 ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
6363 else
6364 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6365 for as_dir in $PATH
6366 do
6367 IFS=$as_save_IFS
6368 test -z "$as_dir" && as_dir=.
6369 for ac_exec_ext in '' $ac_executable_extensions; do
6370 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6371 ac_cv_prog_ac_ct_OTOOL="otool"
6372 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6373 break 2
6374 fi
6375 done
6376 done
6377 IFS=$as_save_IFS
6378
6379 fi
6380 fi
6381 ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
6382 if test -n "$ac_ct_OTOOL"; then
6383 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
6384 $as_echo "$ac_ct_OTOOL" >&6; }
6385 else
6386 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6387 $as_echo "no" >&6; }
6388 fi
6389
6390 if test "x$ac_ct_OTOOL" = x; then
6391 OTOOL=":"
6392 else
6393 case $cross_compiling:$ac_tool_warned in
6394 yes:)
6395 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6396 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6397 ac_tool_warned=yes ;;
6398 esac
6399 OTOOL=$ac_ct_OTOOL
6400 fi
6401 else
6402 OTOOL="$ac_cv_prog_OTOOL"
6403 fi
6404
6405 if test -n "$ac_tool_prefix"; then
6406 # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
6407 set dummy ${ac_tool_prefix}otool64; ac_word=$2
6408 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6409 $as_echo_n "checking for $ac_word... " >&6; }
6410 if test "${ac_cv_prog_OTOOL64+set}" = set; then :
6411 $as_echo_n "(cached) " >&6
6412 else
6413 if test -n "$OTOOL64"; then
6414 ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
6415 else
6416 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6417 for as_dir in $PATH
6418 do
6419 IFS=$as_save_IFS
6420 test -z "$as_dir" && as_dir=.
6421 for ac_exec_ext in '' $ac_executable_extensions; do
6422 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6423 ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
6424 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6425 break 2
6426 fi
6427 done
6428 done
6429 IFS=$as_save_IFS
6430
6431 fi
6432 fi
6433 OTOOL64=$ac_cv_prog_OTOOL64
6434 if test -n "$OTOOL64"; then
6435 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
6436 $as_echo "$OTOOL64" >&6; }
6437 else
6438 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6439 $as_echo "no" >&6; }
6440 fi
6441
6442
6443 fi
6444 if test -z "$ac_cv_prog_OTOOL64"; then
6445 ac_ct_OTOOL64=$OTOOL64
6446 # Extract the first word of "otool64", so it can be a program name with args.
6447 set dummy otool64; ac_word=$2
6448 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6449 $as_echo_n "checking for $ac_word... " >&6; }
6450 if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
6451 $as_echo_n "(cached) " >&6
6452 else
6453 if test -n "$ac_ct_OTOOL64"; then
6454 ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
6455 else
6456 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6457 for as_dir in $PATH
6458 do
6459 IFS=$as_save_IFS
6460 test -z "$as_dir" && as_dir=.
6461 for ac_exec_ext in '' $ac_executable_extensions; do
6462 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6463 ac_cv_prog_ac_ct_OTOOL64="otool64"
6464 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6465 break 2
6466 fi
6467 done
6468 done
6469 IFS=$as_save_IFS
6470
6471 fi
6472 fi
6473 ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
6474 if test -n "$ac_ct_OTOOL64"; then
6475 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
6476 $as_echo "$ac_ct_OTOOL64" >&6; }
6477 else
6478 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6479 $as_echo "no" >&6; }
6480 fi
6481
6482 if test "x$ac_ct_OTOOL64" = x; then
6483 OTOOL64=":"
6484 else
6485 case $cross_compiling:$ac_tool_warned in
6486 yes:)
6487 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6488 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6489 ac_tool_warned=yes ;;
6490 esac
6491 OTOOL64=$ac_ct_OTOOL64
6492 fi
6493 else
6494 OTOOL64="$ac_cv_prog_OTOOL64"
6495 fi
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
6524 $as_echo_n "checking for -single_module linker flag... " >&6; }
6525 if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
6526 $as_echo_n "(cached) " >&6
6527 else
6528 lt_cv_apple_cc_single_mod=no
6529 if test -z "${LT_MULTI_MODULE}"; then
6530 # By default we will add the -single_module flag. You can override
6531 # by either setting the environment variable LT_MULTI_MODULE
6532 # non-empty at configure time, or by adding -multi_module to the
6533 # link flags.
6534 rm -rf libconftest.dylib*
6535 echo "int foo(void){return 1;}" > conftest.c
6536 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
6537 -dynamiclib -Wl,-single_module conftest.c" >&5
6538 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
6539 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
6540 _lt_result=$?
6541 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
6542 lt_cv_apple_cc_single_mod=yes
6543 else
6544 cat conftest.err >&5
6545 fi
6546 rm -rf libconftest.dylib*
6547 rm -f conftest.*
6548 fi
6549 fi
6550 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
6551 $as_echo "$lt_cv_apple_cc_single_mod" >&6; }
6552 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
6553 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
6554 if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
6555 $as_echo_n "(cached) " >&6
6556 else
6557 lt_cv_ld_exported_symbols_list=no
6558 save_LDFLAGS=$LDFLAGS
6559 echo "_main" > conftest.sym
6560 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
6561 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6562 /* end confdefs.h. */
6563
6564 int
6565 main ()
6566 {
6567
6568 ;
6569 return 0;
6570 }
6571 _ACEOF
6572 if ac_fn_c_try_link "$LINENO"; then :
6573 lt_cv_ld_exported_symbols_list=yes
6574 else
6575 lt_cv_ld_exported_symbols_list=no
6576 fi
6577 rm -f core conftest.err conftest.$ac_objext \
6578 conftest$ac_exeext conftest.$ac_ext
6579 LDFLAGS="$save_LDFLAGS"
6580
6581 fi
6582 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
6583 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
6584 case $host_os in
6585 rhapsody* | darwin1.[012])
6586 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
6587 darwin1.*)
6588 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
6589 darwin*) # darwin 5.x on
6590 # if running on 10.5 or later, the deployment target defaults
6591 # to the OS version, if on x86, and 10.4, the deployment
6592 # target defaults to 10.4. Don't you love it?
6593 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
6594 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
6595 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
6596 10.[012]*)
6597 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
6598 10.*)
6599 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
6600 esac
6601 ;;
6602 esac
6603 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
6604 _lt_dar_single_mod='$single_module'
6605 fi
6606 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
6607 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
6608 else
6609 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
6610 fi
6611 if test "$DSYMUTIL" != ":"; then
6612 _lt_dsymutil='~$DSYMUTIL $lib || :'
6613 else
6614 _lt_dsymutil=
6615 fi
6616 ;;
6617 esac
6618
6619 ac_ext=c
6620 ac_cpp='$CPP $CPPFLAGS'
6621 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6622 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6623 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6624 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
6625 $as_echo_n "checking how to run the C preprocessor... " >&6; }
6626 # On Suns, sometimes $CPP names a directory.
6627 if test -n "$CPP" && test -d "$CPP"; then
6628 CPP=
6629 fi
6630 if test -z "$CPP"; then
6631 if test "${ac_cv_prog_CPP+set}" = set; then :
6632 $as_echo_n "(cached) " >&6
6633 else
6634 # Double quotes because CPP needs to be expanded
6635 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
6636 do
6637 ac_preproc_ok=false
6638 for ac_c_preproc_warn_flag in '' yes
6639 do
6640 # Use a header file that comes with gcc, so configuring glibc
6641 # with a fresh cross-compiler works.
6642 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6643 # <limits.h> exists even on freestanding compilers.
6644 # On the NeXT, cc -E runs the code through the compiler's parser,
6645 # not just through cpp. "Syntax error" is here to catch this case.
6646 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6647 /* end confdefs.h. */
6648 #ifdef __STDC__
6649 # include <limits.h>
6650 #else
6651 # include <assert.h>
6652 #endif
6653 Syntax error
6654 _ACEOF
6655 if ac_fn_c_try_cpp "$LINENO"; then :
6656
6657 else
6658 # Broken: fails on valid input.
6659 continue
6660 fi
6661 rm -f conftest.err conftest.$ac_ext
6662
6663 # OK, works on sane cases. Now check whether nonexistent headers
6664 # can be detected and how.
6665 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6666 /* end confdefs.h. */
6667 #include <ac_nonexistent.h>
6668 _ACEOF
6669 if ac_fn_c_try_cpp "$LINENO"; then :
6670 # Broken: success on invalid input.
6671 continue
6672 else
6673 # Passes both tests.
6674 ac_preproc_ok=:
6675 break
6676 fi
6677 rm -f conftest.err conftest.$ac_ext
6678
6679 done
6680 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6681 rm -f conftest.err conftest.$ac_ext
6682 if $ac_preproc_ok; then :
6683 break
6684 fi
6685
6686 done
6687 ac_cv_prog_CPP=$CPP
6688
6689 fi
6690 CPP=$ac_cv_prog_CPP
6691 else
6692 ac_cv_prog_CPP=$CPP
6693 fi
6694 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
6695 $as_echo "$CPP" >&6; }
6696 ac_preproc_ok=false
6697 for ac_c_preproc_warn_flag in '' yes
6698 do
6699 # Use a header file that comes with gcc, so configuring glibc
6700 # with a fresh cross-compiler works.
6701 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6702 # <limits.h> exists even on freestanding compilers.
6703 # On the NeXT, cc -E runs the code through the compiler's parser,
6704 # not just through cpp. "Syntax error" is here to catch this case.
6705 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6706 /* end confdefs.h. */
6707 #ifdef __STDC__
6708 # include <limits.h>
6709 #else
6710 # include <assert.h>
6711 #endif
6712 Syntax error
6713 _ACEOF
6714 if ac_fn_c_try_cpp "$LINENO"; then :
6715
6716 else
6717 # Broken: fails on valid input.
6718 continue
6719 fi
6720 rm -f conftest.err conftest.$ac_ext
6721
6722 # OK, works on sane cases. Now check whether nonexistent headers
6723 # can be detected and how.
6724 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6725 /* end confdefs.h. */
6726 #include <ac_nonexistent.h>
6727 _ACEOF
6728 if ac_fn_c_try_cpp "$LINENO"; then :
6729 # Broken: success on invalid input.
6730 continue
6731 else
6732 # Passes both tests.
6733 ac_preproc_ok=:
6734 break
6735 fi
6736 rm -f conftest.err conftest.$ac_ext
6737
6738 done
6739 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6740 rm -f conftest.err conftest.$ac_ext
6741 if $ac_preproc_ok; then :
6742
6743 else
6744 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6745 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6746 as_fn_error "C preprocessor \"$CPP\" fails sanity check
6747 See \`config.log' for more details." "$LINENO" 5; }
6748 fi
6749
6750 ac_ext=c
6751 ac_cpp='$CPP $CPPFLAGS'
6752 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6753 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6754 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6755
6756
6757 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
6758 $as_echo_n "checking for ANSI C header files... " >&6; }
6759 if test "${ac_cv_header_stdc+set}" = set; then :
6760 $as_echo_n "(cached) " >&6
6761 else
6762 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6763 /* end confdefs.h. */
6764 #include <stdlib.h>
6765 #include <stdarg.h>
6766 #include <string.h>
6767 #include <float.h>
6768
6769 int
6770 main ()
6771 {
6772
6773 ;
6774 return 0;
6775 }
6776 _ACEOF
6777 if ac_fn_c_try_compile "$LINENO"; then :
6778 ac_cv_header_stdc=yes
6779 else
6780 ac_cv_header_stdc=no
6781 fi
6782 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6783
6784 if test $ac_cv_header_stdc = yes; then
6785 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
6786 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6787 /* end confdefs.h. */
6788 #include <string.h>
6789
6790 _ACEOF
6791 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6792 $EGREP "memchr" >/dev/null 2>&1; then :
6793
6794 else
6795 ac_cv_header_stdc=no
6796 fi
6797 rm -f conftest*
6798
6799 fi
6800
6801 if test $ac_cv_header_stdc = yes; then
6802 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
6803 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6804 /* end confdefs.h. */
6805 #include <stdlib.h>
6806
6807 _ACEOF
6808 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6809 $EGREP "free" >/dev/null 2>&1; then :
6810
6811 else
6812 ac_cv_header_stdc=no
6813 fi
6814 rm -f conftest*
6815
6816 fi
6817
6818 if test $ac_cv_header_stdc = yes; then
6819 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
6820 if test "$cross_compiling" = yes; then :
6821 :
6822 else
6823 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6824 /* end confdefs.h. */
6825 #include <ctype.h>
6826 #include <stdlib.h>
6827 #if ((' ' & 0x0FF) == 0x020)
6828 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
6829 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
6830 #else
6831 # define ISLOWER(c) \
6832 (('a' <= (c) && (c) <= 'i') \
6833 || ('j' <= (c) && (c) <= 'r') \
6834 || ('s' <= (c) && (c) <= 'z'))
6835 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
6836 #endif
6837
6838 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
6839 int
6840 main ()
6841 {
6842 int i;
6843 for (i = 0; i < 256; i++)
6844 if (XOR (islower (i), ISLOWER (i))
6845 || toupper (i) != TOUPPER (i))
6846 return 2;
6847 return 0;
6848 }
6849 _ACEOF
6850 if ac_fn_c_try_run "$LINENO"; then :
6851
6852 else
6853 ac_cv_header_stdc=no
6854 fi
6855 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
6856 conftest.$ac_objext conftest.beam conftest.$ac_ext
6857 fi
6858
6859 fi
6860 fi
6861 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
6862 $as_echo "$ac_cv_header_stdc" >&6; }
6863 if test $ac_cv_header_stdc = yes; then
6864
6865 $as_echo "#define STDC_HEADERS 1" >>confdefs.h
6866
6867 fi
6868
6869 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
6870 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
6871 inttypes.h stdint.h unistd.h
6872 do :
6873 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
6874 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
6875 "
6876 eval as_val=\$$as_ac_Header
6877 if test "x$as_val" = x""yes; then :
6878 cat >>confdefs.h <<_ACEOF
6879 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
6880 _ACEOF
6881
6882 fi
6883
6884 done
6885
6886
6887 for ac_header in dlfcn.h
6888 do :
6889 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
6890 "
6891 if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
6892 cat >>confdefs.h <<_ACEOF
6893 #define HAVE_DLFCN_H 1
6894 _ACEOF
6895
6896 fi
6897
6898 done
6899
6900
6901
6902 # Set options
6903 enable_dlopen=yes
6904
6905
6906
6907
6908 enable_win32_dll=no
6909
6910
6911 # Check whether --enable-shared was given.
6912 if test "${enable_shared+set}" = set; then :
6913 enableval=$enable_shared; p=${PACKAGE-default}
6914 case $enableval in
6915 yes) enable_shared=yes ;;
6916 no) enable_shared=no ;;
6917 *)
6918 enable_shared=no
6919 # Look at the argument we got. We use all the common list separators.
6920 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
6921 for pkg in $enableval; do
6922 IFS="$lt_save_ifs"
6923 if test "X$pkg" = "X$p"; then
6924 enable_shared=yes
6925 fi
6926 done
6927 IFS="$lt_save_ifs"
6928 ;;
6929 esac
6930 else
6931 enable_shared=yes
6932 fi
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944 # Check whether --with-pic was given.
6945 if test "${with_pic+set}" = set; then :
6946 withval=$with_pic; pic_mode="$withval"
6947 else
6948 pic_mode=default
6949 fi
6950
6951
6952 test -z "$pic_mode" && pic_mode=default
6953
6954
6955
6956
6957
6958
6959
6960 # Check whether --enable-fast-install was given.
6961 if test "${enable_fast_install+set}" = set; then :
6962 enableval=$enable_fast_install; p=${PACKAGE-default}
6963 case $enableval in
6964 yes) enable_fast_install=yes ;;
6965 no) enable_fast_install=no ;;
6966 *)
6967 enable_fast_install=no
6968 # Look at the argument we got. We use all the common list separators.
6969 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
6970 for pkg in $enableval; do
6971 IFS="$lt_save_ifs"
6972 if test "X$pkg" = "X$p"; then
6973 enable_fast_install=yes
6974 fi
6975 done
6976 IFS="$lt_save_ifs"
6977 ;;
6978 esac
6979 else
6980 enable_fast_install=yes
6981 fi
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993 # This can be used to rebuild libtool when needed
6994 LIBTOOL_DEPS="$ltmain"
6995
6996 # Always use our own libtool.
6997 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023 test -z "$LN_S" && LN_S="ln -s"
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038 if test -n "${ZSH_VERSION+set}" ; then
7039 setopt NO_GLOB_SUBST
7040 fi
7041
7042 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
7043 $as_echo_n "checking for objdir... " >&6; }
7044 if test "${lt_cv_objdir+set}" = set; then :
7045 $as_echo_n "(cached) " >&6
7046 else
7047 rm -f .libs 2>/dev/null
7048 mkdir .libs 2>/dev/null
7049 if test -d .libs; then
7050 lt_cv_objdir=.libs
7051 else
7052 # MS-DOS does not allow filenames that begin with a dot.
7053 lt_cv_objdir=_libs
7054 fi
7055 rmdir .libs 2>/dev/null
7056 fi
7057 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
7058 $as_echo "$lt_cv_objdir" >&6; }
7059 objdir=$lt_cv_objdir
7060
7061
7062
7063
7064
7065 cat >>confdefs.h <<_ACEOF
7066 #define LT_OBJDIR "$lt_cv_objdir/"
7067 _ACEOF
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085 case $host_os in
7086 aix3*)
7087 # AIX sometimes has problems with the GCC collect2 program. For some
7088 # reason, if we set the COLLECT_NAMES environment variable, the problems
7089 # vanish in a puff of smoke.
7090 if test "X${COLLECT_NAMES+set}" != Xset; then
7091 COLLECT_NAMES=
7092 export COLLECT_NAMES
7093 fi
7094 ;;
7095 esac
7096
7097 # Sed substitution that helps us do robust quoting. It backslashifies
7098 # metacharacters that are still active within double-quoted strings.
7099 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
7100
7101 # Same as above, but do not quote variable references.
7102 double_quote_subst='s/\(["`\\]\)/\\\1/g'
7103
7104 # Sed substitution to delay expansion of an escaped shell variable in a
7105 # double_quote_subst'ed string.
7106 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
7107
7108 # Sed substitution to delay expansion of an escaped single quote.
7109 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
7110
7111 # Sed substitution to avoid accidental globbing in evaled expressions
7112 no_glob_subst='s/\*/\\\*/g'
7113
7114 # Global variables:
7115 ofile=libtool
7116 can_build_shared=yes
7117
7118 # All known linkers require a `.a' archive for static linking (except MSVC,
7119 # which needs '.lib').
7120 libext=a
7121
7122 with_gnu_ld="$lt_cv_prog_gnu_ld"
7123
7124 old_CC="$CC"
7125 old_CFLAGS="$CFLAGS"
7126
7127 # Set sane defaults for various variables
7128 test -z "$CC" && CC=cc
7129 test -z "$LTCC" && LTCC=$CC
7130 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
7131 test -z "$LD" && LD=ld
7132 test -z "$ac_objext" && ac_objext=o
7133
7134 for cc_temp in $compiler""; do
7135 case $cc_temp in
7136 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
7137 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
7138 \-*) ;;
7139 *) break;;
7140 esac
7141 done
7142 cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
7143
7144
7145 # Only perform the check for file, if the check method requires it
7146 test -z "$MAGIC_CMD" && MAGIC_CMD=file
7147 case $deplibs_check_method in
7148 file_magic*)
7149 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
7150 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
7151 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
7152 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
7153 $as_echo_n "(cached) " >&6
7154 else
7155 case $MAGIC_CMD in
7156 [\\/*] | ?:[\\/]*)
7157 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7158 ;;
7159 *)
7160 lt_save_MAGIC_CMD="$MAGIC_CMD"
7161 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7162 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
7163 for ac_dir in $ac_dummy; do
7164 IFS="$lt_save_ifs"
7165 test -z "$ac_dir" && ac_dir=.
7166 if test -f $ac_dir/${ac_tool_prefix}file; then
7167 lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
7168 if test -n "$file_magic_test_file"; then
7169 case $deplibs_check_method in
7170 "file_magic "*)
7171 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
7172 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7173 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7174 $EGREP "$file_magic_regex" > /dev/null; then
7175 :
7176 else
7177 cat <<_LT_EOF 1>&2
7178
7179 *** Warning: the command libtool uses to detect shared libraries,
7180 *** $file_magic_cmd, produces output that libtool cannot recognize.
7181 *** The result is that libtool may fail to recognize shared libraries
7182 *** as such. This will affect the creation of libtool libraries that
7183 *** depend on shared libraries, but programs linked with such libtool
7184 *** libraries will work regardless of this problem. Nevertheless, you
7185 *** may want to report the problem to your system manager and/or to
7186 *** bug-libtool@gnu.org
7187
7188 _LT_EOF
7189 fi ;;
7190 esac
7191 fi
7192 break
7193 fi
7194 done
7195 IFS="$lt_save_ifs"
7196 MAGIC_CMD="$lt_save_MAGIC_CMD"
7197 ;;
7198 esac
7199 fi
7200
7201 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7202 if test -n "$MAGIC_CMD"; then
7203 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
7204 $as_echo "$MAGIC_CMD" >&6; }
7205 else
7206 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7207 $as_echo "no" >&6; }
7208 fi
7209
7210
7211
7212
7213
7214 if test -z "$lt_cv_path_MAGIC_CMD"; then
7215 if test -n "$ac_tool_prefix"; then
7216 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
7217 $as_echo_n "checking for file... " >&6; }
7218 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
7219 $as_echo_n "(cached) " >&6
7220 else
7221 case $MAGIC_CMD in
7222 [\\/*] | ?:[\\/]*)
7223 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7224 ;;
7225 *)
7226 lt_save_MAGIC_CMD="$MAGIC_CMD"
7227 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7228 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
7229 for ac_dir in $ac_dummy; do
7230 IFS="$lt_save_ifs"
7231 test -z "$ac_dir" && ac_dir=.
7232 if test -f $ac_dir/file; then
7233 lt_cv_path_MAGIC_CMD="$ac_dir/file"
7234 if test -n "$file_magic_test_file"; then
7235 case $deplibs_check_method in
7236 "file_magic "*)
7237 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
7238 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7239 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7240 $EGREP "$file_magic_regex" > /dev/null; then
7241 :
7242 else
7243 cat <<_LT_EOF 1>&2
7244
7245 *** Warning: the command libtool uses to detect shared libraries,
7246 *** $file_magic_cmd, produces output that libtool cannot recognize.
7247 *** The result is that libtool may fail to recognize shared libraries
7248 *** as such. This will affect the creation of libtool libraries that
7249 *** depend on shared libraries, but programs linked with such libtool
7250 *** libraries will work regardless of this problem. Nevertheless, you
7251 *** may want to report the problem to your system manager and/or to
7252 *** bug-libtool@gnu.org
7253
7254 _LT_EOF
7255 fi ;;
7256 esac
7257 fi
7258 break
7259 fi
7260 done
7261 IFS="$lt_save_ifs"
7262 MAGIC_CMD="$lt_save_MAGIC_CMD"
7263 ;;
7264 esac
7265 fi
7266
7267 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7268 if test -n "$MAGIC_CMD"; then
7269 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
7270 $as_echo "$MAGIC_CMD" >&6; }
7271 else
7272 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7273 $as_echo "no" >&6; }
7274 fi
7275
7276
7277 else
7278 MAGIC_CMD=:
7279 fi
7280 fi
7281
7282 fi
7283 ;;
7284 esac
7285
7286 # Use C for the default configuration in the libtool script
7287
7288 lt_save_CC="$CC"
7289 ac_ext=c
7290 ac_cpp='$CPP $CPPFLAGS'
7291 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7292 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7293 ac_compiler_gnu=$ac_cv_c_compiler_gnu
7294
7295
7296 # Source file extension for C test sources.
7297 ac_ext=c
7298
7299 # Object file extension for compiled C test sources.
7300 objext=o
7301 objext=$objext
7302
7303 # Code to be used in simple compile tests
7304 lt_simple_compile_test_code="int some_variable = 0;"
7305
7306 # Code to be used in simple link tests
7307 lt_simple_link_test_code='int main(){return(0);}'
7308
7309
7310
7311
7312
7313
7314
7315 # If no C compiler was specified, use CC.
7316 LTCC=${LTCC-"$CC"}
7317
7318 # If no C compiler flags were specified, use CFLAGS.
7319 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
7320
7321 # Allow CC to be a program name with arguments.
7322 compiler=$CC
7323
7324 # Save the default compiler, since it gets overwritten when the other
7325 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
7326 compiler_DEFAULT=$CC
7327
7328 # save warnings/boilerplate of simple test code
7329 ac_outfile=conftest.$ac_objext
7330 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
7331 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
7332 _lt_compiler_boilerplate=`cat conftest.err`
7333 $RM conftest*
7334
7335 ac_outfile=conftest.$ac_objext
7336 echo "$lt_simple_link_test_code" >conftest.$ac_ext
7337 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
7338 _lt_linker_boilerplate=`cat conftest.err`
7339 $RM -r conftest*
7340
7341
7342 ## CAVEAT EMPTOR:
7343 ## There is no encapsulation within the following macros, do not change
7344 ## the running order or otherwise move them around unless you know exactly
7345 ## what you are doing...
7346 if test -n "$compiler"; then
7347
7348 lt_prog_compiler_no_builtin_flag=
7349
7350 if test "$GCC" = yes; then
7351 lt_prog_compiler_no_builtin_flag=' -fno-builtin'
7352
7353 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
7354 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
7355 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
7356 $as_echo_n "(cached) " >&6
7357 else
7358 lt_cv_prog_compiler_rtti_exceptions=no
7359 ac_outfile=conftest.$ac_objext
7360 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7361 lt_compiler_flag="-fno-rtti -fno-exceptions"
7362 # Insert the option either (1) after the last *FLAGS variable, or
7363 # (2) before a word containing "conftest.", or (3) at the end.
7364 # Note that $ac_compile itself does not contain backslashes and begins
7365 # with a dollar sign (not a hyphen), so the echo should work correctly.
7366 # The option is referenced via a variable to avoid confusing sed.
7367 lt_compile=`echo "$ac_compile" | $SED \
7368 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7369 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7370 -e 's:$: $lt_compiler_flag:'`
7371 (eval echo "\"\$as_me:7372: $lt_compile\"" >&5)
7372 (eval "$lt_compile" 2>conftest.err)
7373 ac_status=$?
7374 cat conftest.err >&5
7375 echo "$as_me:7376: \$? = $ac_status" >&5
7376 if (exit $ac_status) && test -s "$ac_outfile"; then
7377 # The compiler can only warn and ignore the option if not recognized
7378 # So say no if there are warnings other than the usual output.
7379 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
7380 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
7381 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
7382 lt_cv_prog_compiler_rtti_exceptions=yes
7383 fi
7384 fi
7385 $RM conftest*
7386
7387 fi
7388 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
7389 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
7390
7391 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
7392 lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
7393 else
7394 :
7395 fi
7396
7397 fi
7398
7399
7400
7401
7402
7403
7404 lt_prog_compiler_wl=
7405 lt_prog_compiler_pic=
7406 lt_prog_compiler_static=
7407
7408 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
7409 $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
7410
7411 if test "$GCC" = yes; then
7412 lt_prog_compiler_wl='-Wl,'
7413 lt_prog_compiler_static='-static'
7414
7415 case $host_os in
7416 aix*)
7417 # All AIX code is PIC.
7418 if test "$host_cpu" = ia64; then
7419 # AIX 5 now supports IA64 processor
7420 lt_prog_compiler_static='-Bstatic'
7421 fi
7422 ;;
7423
7424 amigaos*)
7425 case $host_cpu in
7426 powerpc)
7427 # see comment about AmigaOS4 .so support
7428 lt_prog_compiler_pic='-fPIC'
7429 ;;
7430 m68k)
7431 # FIXME: we need at least 68020 code to build shared libraries, but
7432 # adding the `-m68020' flag to GCC prevents building anything better,
7433 # like `-m68040'.
7434 lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
7435 ;;
7436 esac
7437 ;;
7438
7439 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7440 # PIC is the default for these OSes.
7441 ;;
7442
7443 mingw* | cygwin* | pw32* | os2* | cegcc*)
7444 # This hack is so that the source file can tell whether it is being
7445 # built for inclusion in a dll (and should export symbols for example).
7446 # Although the cygwin gcc ignores -fPIC, still need this for old-style
7447 # (--disable-auto-import) libraries
7448 lt_prog_compiler_pic='-DDLL_EXPORT'
7449 ;;
7450
7451 darwin* | rhapsody*)
7452 # PIC is the default on this platform
7453 # Common symbols not allowed in MH_DYLIB files
7454 lt_prog_compiler_pic='-fno-common'
7455 ;;
7456
7457 hpux*)
7458 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
7459 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
7460 # sets the default TLS model and affects inlining.
7461 case $host_cpu in
7462 hppa*64*)
7463 # +Z the default
7464 ;;
7465 *)
7466 lt_prog_compiler_pic='-fPIC'
7467 ;;
7468 esac
7469 ;;
7470
7471 interix[3-9]*)
7472 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7473 # Instead, we relocate shared libraries at runtime.
7474 ;;
7475
7476 msdosdjgpp*)
7477 # Just because we use GCC doesn't mean we suddenly get shared libraries
7478 # on systems that don't support them.
7479 lt_prog_compiler_can_build_shared=no
7480 enable_shared=no
7481 ;;
7482
7483 *nto* | *qnx*)
7484 # QNX uses GNU C++, but need to define -shared option too, otherwise
7485 # it will coredump.
7486 lt_prog_compiler_pic='-fPIC -shared'
7487 ;;
7488
7489 sysv4*MP*)
7490 if test -d /usr/nec; then
7491 lt_prog_compiler_pic=-Kconform_pic
7492 fi
7493 ;;
7494
7495 *)
7496 lt_prog_compiler_pic='-fPIC'
7497 ;;
7498 esac
7499 else
7500 # PORTME Check for flag to pass linker flags through the system compiler.
7501 case $host_os in
7502 aix*)
7503 lt_prog_compiler_wl='-Wl,'
7504 if test "$host_cpu" = ia64; then
7505 # AIX 5 now supports IA64 processor
7506 lt_prog_compiler_static='-Bstatic'
7507 else
7508 lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
7509 fi
7510 ;;
7511
7512 mingw* | cygwin* | pw32* | os2* | cegcc*)
7513 # This hack is so that the source file can tell whether it is being
7514 # built for inclusion in a dll (and should export symbols for example).
7515 lt_prog_compiler_pic='-DDLL_EXPORT'
7516 ;;
7517
7518 hpux9* | hpux10* | hpux11*)
7519 lt_prog_compiler_wl='-Wl,'
7520 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
7521 # not for PA HP-UX.
7522 case $host_cpu in
7523 hppa*64*|ia64*)
7524 # +Z the default
7525 ;;
7526 *)
7527 lt_prog_compiler_pic='+Z'
7528 ;;
7529 esac
7530 # Is there a better lt_prog_compiler_static that works with the bundled CC?
7531 lt_prog_compiler_static='${wl}-a ${wl}archive'
7532 ;;
7533
7534 irix5* | irix6* | nonstopux*)
7535 lt_prog_compiler_wl='-Wl,'
7536 # PIC (with -KPIC) is the default.
7537 lt_prog_compiler_static='-non_shared'
7538 ;;
7539
7540 linux* | k*bsd*-gnu | kopensolaris*-gnu)
7541 case $cc_basename in
7542 # old Intel for x86_64 which still supported -KPIC.
7543 ecc*)
7544 lt_prog_compiler_wl='-Wl,'
7545 lt_prog_compiler_pic='-KPIC'
7546 lt_prog_compiler_static='-static'
7547 ;;
7548 # icc used to be incompatible with GCC.
7549 # ICC 10 doesn't accept -KPIC any more.
7550 icc* | ifort*)
7551 lt_prog_compiler_wl='-Wl,'
7552 lt_prog_compiler_pic='-fPIC'
7553 lt_prog_compiler_static='-static'
7554 ;;
7555 # Lahey Fortran 8.1.
7556 lf95*)
7557 lt_prog_compiler_wl='-Wl,'
7558 lt_prog_compiler_pic='--shared'
7559 lt_prog_compiler_static='--static'
7560 ;;
7561 pgcc* | pgf77* | pgf90* | pgf95*)
7562 # Portland Group compilers (*not* the Pentium gcc compiler,
7563 # which looks to be a dead project)
7564 lt_prog_compiler_wl='-Wl,'
7565 lt_prog_compiler_pic='-fpic'
7566 lt_prog_compiler_static='-Bstatic'
7567 ;;
7568 ccc*)
7569 lt_prog_compiler_wl='-Wl,'
7570 # All Alpha code is PIC.
7571 lt_prog_compiler_static='-non_shared'
7572 ;;
7573 xl*)
7574 # IBM XL C 8.0/Fortran 10.1 on PPC
7575 lt_prog_compiler_wl='-Wl,'
7576 lt_prog_compiler_pic='-qpic'
7577 lt_prog_compiler_static='-qstaticlink'
7578 ;;
7579 *)
7580 case `$CC -V 2>&1 | sed 5q` in
7581 *Sun\ C*)
7582 # Sun C 5.9
7583 lt_prog_compiler_pic='-KPIC'
7584 lt_prog_compiler_static='-Bstatic'
7585 lt_prog_compiler_wl='-Wl,'
7586 ;;
7587 *Sun\ F*)
7588 # Sun Fortran 8.3 passes all unrecognized flags to the linker
7589 lt_prog_compiler_pic='-KPIC'
7590 lt_prog_compiler_static='-Bstatic'
7591 lt_prog_compiler_wl=''
7592 ;;
7593 esac
7594 ;;
7595 esac
7596 ;;
7597
7598 newsos6)
7599 lt_prog_compiler_pic='-KPIC'
7600 lt_prog_compiler_static='-Bstatic'
7601 ;;
7602
7603 *nto* | *qnx*)
7604 # QNX uses GNU C++, but need to define -shared option too, otherwise
7605 # it will coredump.
7606 lt_prog_compiler_pic='-fPIC -shared'
7607 ;;
7608
7609 osf3* | osf4* | osf5*)
7610 lt_prog_compiler_wl='-Wl,'
7611 # All OSF/1 code is PIC.
7612 lt_prog_compiler_static='-non_shared'
7613 ;;
7614
7615 rdos*)
7616 lt_prog_compiler_static='-non_shared'
7617 ;;
7618
7619 solaris*)
7620 lt_prog_compiler_pic='-KPIC'
7621 lt_prog_compiler_static='-Bstatic'
7622 case $cc_basename in
7623 f77* | f90* | f95*)
7624 lt_prog_compiler_wl='-Qoption ld ';;
7625 *)
7626 lt_prog_compiler_wl='-Wl,';;
7627 esac
7628 ;;
7629
7630 sunos4*)
7631 lt_prog_compiler_wl='-Qoption ld '
7632 lt_prog_compiler_pic='-PIC'
7633 lt_prog_compiler_static='-Bstatic'
7634 ;;
7635
7636 sysv4 | sysv4.2uw2* | sysv4.3*)
7637 lt_prog_compiler_wl='-Wl,'
7638 lt_prog_compiler_pic='-KPIC'
7639 lt_prog_compiler_static='-Bstatic'
7640 ;;
7641
7642 sysv4*MP*)
7643 if test -d /usr/nec ;then
7644 lt_prog_compiler_pic='-Kconform_pic'
7645 lt_prog_compiler_static='-Bstatic'
7646 fi
7647 ;;
7648
7649 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
7650 lt_prog_compiler_wl='-Wl,'
7651 lt_prog_compiler_pic='-KPIC'
7652 lt_prog_compiler_static='-Bstatic'
7653 ;;
7654
7655 unicos*)
7656 lt_prog_compiler_wl='-Wl,'
7657 lt_prog_compiler_can_build_shared=no
7658 ;;
7659
7660 uts4*)
7661 lt_prog_compiler_pic='-pic'
7662 lt_prog_compiler_static='-Bstatic'
7663 ;;
7664
7665 *)
7666 lt_prog_compiler_can_build_shared=no
7667 ;;
7668 esac
7669 fi
7670
7671 case $host_os in
7672 # For platforms which do not support PIC, -DPIC is meaningless:
7673 *djgpp*)
7674 lt_prog_compiler_pic=
7675 ;;
7676 *)
7677 lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
7678 ;;
7679 esac
7680 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
7681 $as_echo "$lt_prog_compiler_pic" >&6; }
7682
7683
7684
7685
7686
7687
7688 #
7689 # Check to make sure the PIC flag actually works.
7690 #
7691 if test -n "$lt_prog_compiler_pic"; then
7692 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
7693 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
7694 if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
7695 $as_echo_n "(cached) " >&6
7696 else
7697 lt_cv_prog_compiler_pic_works=no
7698 ac_outfile=conftest.$ac_objext
7699 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7700 lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
7701 # Insert the option either (1) after the last *FLAGS variable, or
7702 # (2) before a word containing "conftest.", or (3) at the end.
7703 # Note that $ac_compile itself does not contain backslashes and begins
7704 # with a dollar sign (not a hyphen), so the echo should work correctly.
7705 # The option is referenced via a variable to avoid confusing sed.
7706 lt_compile=`echo "$ac_compile" | $SED \
7707 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7708 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7709 -e 's:$: $lt_compiler_flag:'`
7710 (eval echo "\"\$as_me:7711: $lt_compile\"" >&5)
7711 (eval "$lt_compile" 2>conftest.err)
7712 ac_status=$?
7713 cat conftest.err >&5
7714 echo "$as_me:7715: \$? = $ac_status" >&5
7715 if (exit $ac_status) && test -s "$ac_outfile"; then
7716 # The compiler can only warn and ignore the option if not recognized
7717 # So say no if there are warnings other than the usual output.
7718 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
7719 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
7720 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
7721 lt_cv_prog_compiler_pic_works=yes
7722 fi
7723 fi
7724 $RM conftest*
7725
7726 fi
7727 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
7728 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
7729
7730 if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
7731 case $lt_prog_compiler_pic in
7732 "" | " "*) ;;
7733 *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
7734 esac
7735 else
7736 lt_prog_compiler_pic=
7737 lt_prog_compiler_can_build_shared=no
7738 fi
7739
7740 fi
7741
7742
7743
7744
7745
7746
7747 #
7748 # Check to make sure the static flag actually works.
7749 #
7750 wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
7751 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
7752 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
7753 if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
7754 $as_echo_n "(cached) " >&6
7755 else
7756 lt_cv_prog_compiler_static_works=no
7757 save_LDFLAGS="$LDFLAGS"
7758 LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
7759 echo "$lt_simple_link_test_code" > conftest.$ac_ext
7760 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
7761 # The linker can only warn and ignore the option if not recognized
7762 # So say no if there are warnings
7763 if test -s conftest.err; then
7764 # Append any errors to the config.log.
7765 cat conftest.err 1>&5
7766 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
7767 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
7768 if diff conftest.exp conftest.er2 >/dev/null; then
7769 lt_cv_prog_compiler_static_works=yes
7770 fi
7771 else
7772 lt_cv_prog_compiler_static_works=yes
7773 fi
7774 fi
7775 $RM -r conftest*
7776 LDFLAGS="$save_LDFLAGS"
7777
7778 fi
7779 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
7780 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
7781
7782 if test x"$lt_cv_prog_compiler_static_works" = xyes; then
7783 :
7784 else
7785 lt_prog_compiler_static=
7786 fi
7787
7788
7789
7790
7791
7792
7793
7794 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
7795 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
7796 if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
7797 $as_echo_n "(cached) " >&6
7798 else
7799 lt_cv_prog_compiler_c_o=no
7800 $RM -r conftest 2>/dev/null
7801 mkdir conftest
7802 cd conftest
7803 mkdir out
7804 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7805
7806 lt_compiler_flag="-o out/conftest2.$ac_objext"
7807 # Insert the option either (1) after the last *FLAGS variable, or
7808 # (2) before a word containing "conftest.", or (3) at the end.
7809 # Note that $ac_compile itself does not contain backslashes and begins
7810 # with a dollar sign (not a hyphen), so the echo should work correctly.
7811 lt_compile=`echo "$ac_compile" | $SED \
7812 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7813 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7814 -e 's:$: $lt_compiler_flag:'`
7815 (eval echo "\"\$as_me:7816: $lt_compile\"" >&5)
7816 (eval "$lt_compile" 2>out/conftest.err)
7817 ac_status=$?
7818 cat out/conftest.err >&5
7819 echo "$as_me:7820: \$? = $ac_status" >&5
7820 if (exit $ac_status) && test -s out/conftest2.$ac_objext
7821 then
7822 # The compiler can only warn and ignore the option if not recognized
7823 # So say no if there are warnings
7824 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
7825 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
7826 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
7827 lt_cv_prog_compiler_c_o=yes
7828 fi
7829 fi
7830 chmod u+w . 2>&5
7831 $RM conftest*
7832 # SGI C++ compiler will create directory out/ii_files/ for
7833 # template instantiation
7834 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
7835 $RM out/* && rmdir out
7836 cd ..
7837 $RM -r conftest
7838 $RM conftest*
7839
7840 fi
7841 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
7842 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
7843
7844
7845
7846
7847
7848
7849 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
7850 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
7851 if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
7852 $as_echo_n "(cached) " >&6
7853 else
7854 lt_cv_prog_compiler_c_o=no
7855 $RM -r conftest 2>/dev/null
7856 mkdir conftest
7857 cd conftest
7858 mkdir out
7859 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7860
7861 lt_compiler_flag="-o out/conftest2.$ac_objext"
7862 # Insert the option either (1) after the last *FLAGS variable, or
7863 # (2) before a word containing "conftest.", or (3) at the end.
7864 # Note that $ac_compile itself does not contain backslashes and begins
7865 # with a dollar sign (not a hyphen), so the echo should work correctly.
7866 lt_compile=`echo "$ac_compile" | $SED \
7867 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7868 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7869 -e 's:$: $lt_compiler_flag:'`
7870 (eval echo "\"\$as_me:7871: $lt_compile\"" >&5)
7871 (eval "$lt_compile" 2>out/conftest.err)
7872 ac_status=$?
7873 cat out/conftest.err >&5
7874 echo "$as_me:7875: \$? = $ac_status" >&5
7875 if (exit $ac_status) && test -s out/conftest2.$ac_objext
7876 then
7877 # The compiler can only warn and ignore the option if not recognized
7878 # So say no if there are warnings
7879 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
7880 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
7881 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
7882 lt_cv_prog_compiler_c_o=yes
7883 fi
7884 fi
7885 chmod u+w . 2>&5
7886 $RM conftest*
7887 # SGI C++ compiler will create directory out/ii_files/ for
7888 # template instantiation
7889 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
7890 $RM out/* && rmdir out
7891 cd ..
7892 $RM -r conftest
7893 $RM conftest*
7894
7895 fi
7896 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
7897 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
7898
7899
7900
7901
7902 hard_links="nottested"
7903 if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
7904 # do not overwrite the value of need_locks provided by the user
7905 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
7906 $as_echo_n "checking if we can lock with hard links... " >&6; }
7907 hard_links=yes
7908 $RM conftest*
7909 ln conftest.a conftest.b 2>/dev/null && hard_links=no
7910 touch conftest.a
7911 ln conftest.a conftest.b 2>&5 || hard_links=no
7912 ln conftest.a conftest.b 2>/dev/null && hard_links=no
7913 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
7914 $as_echo "$hard_links" >&6; }
7915 if test "$hard_links" = no; then
7916 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
7917 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
7918 need_locks=warn
7919 fi
7920 else
7921 need_locks=no
7922 fi
7923
7924
7925
7926
7927
7928
7929 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
7930 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
7931
7932 runpath_var=
7933 allow_undefined_flag=
7934 always_export_symbols=no
7935 archive_cmds=
7936 archive_expsym_cmds=
7937 compiler_needs_object=no
7938 enable_shared_with_static_runtimes=no
7939 export_dynamic_flag_spec=
7940 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
7941 hardcode_automatic=no
7942 hardcode_direct=no
7943 hardcode_direct_absolute=no
7944 hardcode_libdir_flag_spec=
7945 hardcode_libdir_flag_spec_ld=
7946 hardcode_libdir_separator=
7947 hardcode_minus_L=no
7948 hardcode_shlibpath_var=unsupported
7949 inherit_rpath=no
7950 link_all_deplibs=unknown
7951 module_cmds=
7952 module_expsym_cmds=
7953 old_archive_from_new_cmds=
7954 old_archive_from_expsyms_cmds=
7955 thread_safe_flag_spec=
7956 whole_archive_flag_spec=
7957 # include_expsyms should be a list of space-separated symbols to be *always*
7958 # included in the symbol list
7959 include_expsyms=
7960 # exclude_expsyms can be an extended regexp of symbols to exclude
7961 # it will be wrapped by ` (' and `)$', so one must not match beginning or
7962 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
7963 # as well as any symbol that contains `d'.
7964 exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
7965 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
7966 # platforms (ab)use it in PIC code, but their linkers get confused if
7967 # the symbol is explicitly referenced. Since portable code cannot
7968 # rely on this symbol name, it's probably fine to never include it in
7969 # preloaded symbol tables.
7970 # Exclude shared library initialization/finalization symbols.
7971 extract_expsyms_cmds=
7972
7973 case $host_os in
7974 cygwin* | mingw* | pw32* | cegcc*)
7975 # FIXME: the MSVC++ port hasn't been tested in a loooong time
7976 # When not using gcc, we currently assume that we are using
7977 # Microsoft Visual C++.
7978 if test "$GCC" != yes; then
7979 with_gnu_ld=no
7980 fi
7981 ;;
7982 interix*)
7983 # we just hope/assume this is gcc and not c89 (= MSVC++)
7984 with_gnu_ld=yes
7985 ;;
7986 openbsd*)
7987 with_gnu_ld=no
7988 ;;
7989 linux* | k*bsd*-gnu)
7990 link_all_deplibs=no
7991 ;;
7992 esac
7993
7994 ld_shlibs=yes
7995 if test "$with_gnu_ld" = yes; then
7996 # If archive_cmds runs LD, not CC, wlarc should be empty
7997 wlarc='${wl}'
7998
7999 # Set some defaults for GNU ld with shared library support. These
8000 # are reset later if shared libraries are not supported. Putting them
8001 # here allows them to be overridden if necessary.
8002 runpath_var=LD_RUN_PATH
8003 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8004 export_dynamic_flag_spec='${wl}--export-dynamic'
8005 # ancient GNU ld didn't support --whole-archive et. al.
8006 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
8007 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
8008 else
8009 whole_archive_flag_spec=
8010 fi
8011 supports_anon_versioning=no
8012 case `$LD -v 2>&1` in
8013 *GNU\ gold*) supports_anon_versioning=yes ;;
8014 *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
8015 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
8016 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
8017 *\ 2.11.*) ;; # other 2.11 versions
8018 *) supports_anon_versioning=yes ;;
8019 esac
8020
8021 # See if GNU ld supports shared libraries.
8022 case $host_os in
8023 aix[3-9]*)
8024 # On AIX/PPC, the GNU linker is very broken
8025 if test "$host_cpu" != ia64; then
8026 ld_shlibs=no
8027 cat <<_LT_EOF 1>&2
8028
8029 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
8030 *** to be unable to reliably create shared libraries on AIX.
8031 *** Therefore, libtool is disabling shared libraries support. If you
8032 *** really care for shared libraries, you may want to modify your PATH
8033 *** so that a non-GNU linker is found, and then restart.
8034
8035 _LT_EOF
8036 fi
8037 ;;
8038
8039 amigaos*)
8040 case $host_cpu in
8041 powerpc)
8042 # see comment about AmigaOS4 .so support
8043 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8044 archive_expsym_cmds=''
8045 ;;
8046 m68k)
8047 archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
8048 hardcode_libdir_flag_spec='-L$libdir'
8049 hardcode_minus_L=yes
8050 ;;
8051 esac
8052 ;;
8053
8054 beos*)
8055 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8056 allow_undefined_flag=unsupported
8057 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
8058 # support --undefined. This deserves some investigation. FIXME
8059 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8060 else
8061 ld_shlibs=no
8062 fi
8063 ;;
8064
8065 cygwin* | mingw* | pw32* | cegcc*)
8066 # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
8067 # as there is no search path for DLLs.
8068 hardcode_libdir_flag_spec='-L$libdir'
8069 allow_undefined_flag=unsupported
8070 always_export_symbols=no
8071 enable_shared_with_static_runtimes=yes
8072 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
8073
8074 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
8075 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8076 # If the export-symbols file already is a .def file (1st line
8077 # is EXPORTS), use it as is; otherwise, prepend...
8078 archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
8079 cp $export_symbols $output_objdir/$soname.def;
8080 else
8081 echo EXPORTS > $output_objdir/$soname.def;
8082 cat $export_symbols >> $output_objdir/$soname.def;
8083 fi~
8084 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8085 else
8086 ld_shlibs=no
8087 fi
8088 ;;
8089
8090 interix[3-9]*)
8091 hardcode_direct=no
8092 hardcode_shlibpath_var=no
8093 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8094 export_dynamic_flag_spec='${wl}-E'
8095 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
8096 # Instead, shared libraries are loaded at an image base (0x10000000 by
8097 # default) and relocated if they conflict, which is a slow very memory
8098 # consuming and fragmenting process. To avoid this, we pick a random,
8099 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
8100 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
8101 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8102 archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8103 ;;
8104
8105 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
8106 tmp_diet=no
8107 if test "$host_os" = linux-dietlibc; then
8108 case $cc_basename in
8109 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
8110 esac
8111 fi
8112 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
8113 && test "$tmp_diet" = no
8114 then
8115 tmp_addflag=
8116 tmp_sharedflag='-shared'
8117 case $cc_basename,$host_cpu in
8118 pgcc*) # Portland Group C compiler
8119 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8120 tmp_addflag=' $pic_flag'
8121 ;;
8122 pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
8123 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8124 tmp_addflag=' $pic_flag -Mnomain' ;;
8125 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
8126 tmp_addflag=' -i_dynamic' ;;
8127 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
8128 tmp_addflag=' -i_dynamic -nofor_main' ;;
8129 ifc* | ifort*) # Intel Fortran compiler
8130 tmp_addflag=' -nofor_main' ;;
8131 lf95*) # Lahey Fortran 8.1
8132 whole_archive_flag_spec=
8133 tmp_sharedflag='--shared' ;;
8134 xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
8135 tmp_sharedflag='-qmkshrobj'
8136 tmp_addflag= ;;
8137 esac
8138 case `$CC -V 2>&1 | sed 5q` in
8139 *Sun\ C*) # Sun C 5.9
8140 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8141 compiler_needs_object=yes
8142 tmp_sharedflag='-G' ;;
8143 *Sun\ F*) # Sun Fortran 8.3
8144 tmp_sharedflag='-G' ;;
8145 esac
8146 archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8147
8148 if test "x$supports_anon_versioning" = xyes; then
8149 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
8150 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8151 echo "local: *; };" >> $output_objdir/$libname.ver~
8152 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
8153 fi
8154
8155 case $cc_basename in
8156 xlf*)
8157 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
8158 whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
8159 hardcode_libdir_flag_spec=
8160 hardcode_libdir_flag_spec_ld='-rpath $libdir'
8161 archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
8162 if test "x$supports_anon_versioning" = xyes; then
8163 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
8164 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8165 echo "local: *; };" >> $output_objdir/$libname.ver~
8166 $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
8167 fi
8168 ;;
8169 esac
8170 else
8171 ld_shlibs=no
8172 fi
8173 ;;
8174
8175 netbsd* | netbsdelf*-gnu)
8176 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8177 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
8178 wlarc=
8179 else
8180 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8181 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8182 fi
8183 ;;
8184
8185 solaris*)
8186 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
8187 ld_shlibs=no
8188 cat <<_LT_EOF 1>&2
8189
8190 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
8191 *** create shared libraries on Solaris systems. Therefore, libtool
8192 *** is disabling shared libraries support. We urge you to upgrade GNU
8193 *** binutils to release 2.9.1 or newer. Another option is to modify
8194 *** your PATH or compiler configuration so that the native linker is
8195 *** used, and then restart.
8196
8197 _LT_EOF
8198 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8199 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8200 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8201 else
8202 ld_shlibs=no
8203 fi
8204 ;;
8205
8206 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
8207 case `$LD -v 2>&1` in
8208 *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
8209 ld_shlibs=no
8210 cat <<_LT_EOF 1>&2
8211
8212 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
8213 *** reliably create shared libraries on SCO systems. Therefore, libtool
8214 *** is disabling shared libraries support. We urge you to upgrade GNU
8215 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
8216 *** your PATH or compiler configuration so that the native linker is
8217 *** used, and then restart.
8218
8219 _LT_EOF
8220 ;;
8221 *)
8222 # For security reasons, it is highly recommended that you always
8223 # use absolute paths for naming shared libraries, and exclude the
8224 # DT_RUNPATH tag from executables and libraries. But doing so
8225 # requires that you compile everything twice, which is a pain.
8226 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8227 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8228 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8229 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8230 else
8231 ld_shlibs=no
8232 fi
8233 ;;
8234 esac
8235 ;;
8236
8237 sunos4*)
8238 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8239 wlarc=
8240 hardcode_direct=yes
8241 hardcode_shlibpath_var=no
8242 ;;
8243
8244 *)
8245 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8246 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8247 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8248 else
8249 ld_shlibs=no
8250 fi
8251 ;;
8252 esac
8253
8254 if test "$ld_shlibs" = no; then
8255 runpath_var=
8256 hardcode_libdir_flag_spec=
8257 export_dynamic_flag_spec=
8258 whole_archive_flag_spec=
8259 fi
8260 else
8261 # PORTME fill in a description of your system's linker (not GNU ld)
8262 case $host_os in
8263 aix3*)
8264 allow_undefined_flag=unsupported
8265 always_export_symbols=yes
8266 archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
8267 # Note: this linker hardcodes the directories in LIBPATH if there
8268 # are no directories specified by -L.
8269 hardcode_minus_L=yes
8270 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
8271 # Neither direct hardcoding nor static linking is supported with a
8272 # broken collect2.
8273 hardcode_direct=unsupported
8274 fi
8275 ;;
8276
8277 aix[4-9]*)
8278 if test "$host_cpu" = ia64; then
8279 # On IA64, the linker does run time linking by default, so we don't
8280 # have to do anything special.
8281 aix_use_runtimelinking=no
8282 exp_sym_flag='-Bexport'
8283 no_entry_flag=""
8284 else
8285 # If we're using GNU nm, then we don't want the "-C" option.
8286 # -C means demangle to AIX nm, but means don't demangle with GNU nm
8287 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8288 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
8289 else
8290 export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
8291 fi
8292 aix_use_runtimelinking=no
8293
8294 # Test if we are trying to use run time linking or normal
8295 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
8296 # need to do runtime linking.
8297 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
8298 for ld_flag in $LDFLAGS; do
8299 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
8300 aix_use_runtimelinking=yes
8301 break
8302 fi
8303 done
8304 ;;
8305 esac
8306
8307 exp_sym_flag='-bexport'
8308 no_entry_flag='-bnoentry'
8309 fi
8310
8311 # When large executables or shared objects are built, AIX ld can
8312 # have problems creating the table of contents. If linking a library
8313 # or program results in "error TOC overflow" add -mminimal-toc to
8314 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
8315 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8316
8317 archive_cmds=''
8318 hardcode_direct=yes
8319 hardcode_direct_absolute=yes
8320 hardcode_libdir_separator=':'
8321 link_all_deplibs=yes
8322 file_list_spec='${wl}-f,'
8323
8324 if test "$GCC" = yes; then
8325 case $host_os in aix4.[012]|aix4.[012].*)
8326 # We only want to do this on AIX 4.2 and lower, the check
8327 # below for broken collect2 doesn't work under 4.3+
8328 collect2name=`${CC} -print-prog-name=collect2`
8329 if test -f "$collect2name" &&
8330 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
8331 then
8332 # We have reworked collect2
8333 :
8334 else
8335 # We have old collect2
8336 hardcode_direct=unsupported
8337 # It fails to find uninstalled libraries when the uninstalled
8338 # path is not listed in the libpath. Setting hardcode_minus_L
8339 # to unsupported forces relinking
8340 hardcode_minus_L=yes
8341 hardcode_libdir_flag_spec='-L$libdir'
8342 hardcode_libdir_separator=
8343 fi
8344 ;;
8345 esac
8346 shared_flag='-shared'
8347 if test "$aix_use_runtimelinking" = yes; then
8348 shared_flag="$shared_flag "'${wl}-G'
8349 fi
8350 link_all_deplibs=no
8351 else
8352 # not using gcc
8353 if test "$host_cpu" = ia64; then
8354 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8355 # chokes on -Wl,-G. The following line is correct:
8356 shared_flag='-G'
8357 else
8358 if test "$aix_use_runtimelinking" = yes; then
8359 shared_flag='${wl}-G'
8360 else
8361 shared_flag='${wl}-bM:SRE'
8362 fi
8363 fi
8364 fi
8365
8366 export_dynamic_flag_spec='${wl}-bexpall'
8367 # It seems that -bexpall does not export symbols beginning with
8368 # underscore (_), so it is better to generate a list of symbols to export.
8369 always_export_symbols=yes
8370 if test "$aix_use_runtimelinking" = yes; then
8371 # Warning - without using the other runtime loading flags (-brtl),
8372 # -berok will link without error, but may produce a broken library.
8373 allow_undefined_flag='-berok'
8374 # Determine the default libpath from the value encoded in an
8375 # empty executable.
8376 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8377 /* end confdefs.h. */
8378
8379 int
8380 main ()
8381 {
8382
8383 ;
8384 return 0;
8385 }
8386 _ACEOF
8387 if ac_fn_c_try_link "$LINENO"; then :
8388
8389 lt_aix_libpath_sed='
8390 /Import File Strings/,/^$/ {
8391 /^0/ {
8392 s/^0 *\(.*\)$/\1/
8393 p
8394 }
8395 }'
8396 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8397 # Check for a 64-bit object if we didn't find anything.
8398 if test -z "$aix_libpath"; then
8399 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8400 fi
8401 fi
8402 rm -f core conftest.err conftest.$ac_objext \
8403 conftest$ac_exeext conftest.$ac_ext
8404 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8405
8406 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
8407 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
8408 else
8409 if test "$host_cpu" = ia64; then
8410 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
8411 allow_undefined_flag="-z nodefs"
8412 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
8413 else
8414 # Determine the default libpath from the value encoded in an
8415 # empty executable.
8416 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8417 /* end confdefs.h. */
8418
8419 int
8420 main ()
8421 {
8422
8423 ;
8424 return 0;
8425 }
8426 _ACEOF
8427 if ac_fn_c_try_link "$LINENO"; then :
8428
8429 lt_aix_libpath_sed='
8430 /Import File Strings/,/^$/ {
8431 /^0/ {
8432 s/^0 *\(.*\)$/\1/
8433 p
8434 }
8435 }'
8436 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8437 # Check for a 64-bit object if we didn't find anything.
8438 if test -z "$aix_libpath"; then
8439 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8440 fi
8441 fi
8442 rm -f core conftest.err conftest.$ac_objext \
8443 conftest$ac_exeext conftest.$ac_ext
8444 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8445
8446 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
8447 # Warning - without using the other run time loading flags,
8448 # -berok will link without error, but may produce a broken library.
8449 no_undefined_flag=' ${wl}-bernotok'
8450 allow_undefined_flag=' ${wl}-berok'
8451 # Exported symbols can be pulled into shared objects from archives
8452 whole_archive_flag_spec='$convenience'
8453 archive_cmds_need_lc=yes
8454 # This is similar to how AIX traditionally builds its shared libraries.
8455 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
8456 fi
8457 fi
8458 ;;
8459
8460 amigaos*)
8461 case $host_cpu in
8462 powerpc)
8463 # see comment about AmigaOS4 .so support
8464 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8465 archive_expsym_cmds=''
8466 ;;
8467 m68k)
8468 archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
8469 hardcode_libdir_flag_spec='-L$libdir'
8470 hardcode_minus_L=yes
8471 ;;
8472 esac
8473 ;;
8474
8475 bsdi[45]*)
8476 export_dynamic_flag_spec=-rdynamic
8477 ;;
8478
8479 cygwin* | mingw* | pw32* | cegcc*)
8480 # When not using gcc, we currently assume that we are using
8481 # Microsoft Visual C++.
8482 # hardcode_libdir_flag_spec is actually meaningless, as there is
8483 # no search path for DLLs.
8484 hardcode_libdir_flag_spec=' '
8485 allow_undefined_flag=unsupported
8486 # Tell ltmain to make .lib files, not .a files.
8487 libext=lib
8488 # Tell ltmain to make .dll files, not .so files.
8489 shrext_cmds=".dll"
8490 # FIXME: Setting linknames here is a bad hack.
8491 archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
8492 # The linker will automatically build a .lib file if we build a DLL.
8493 old_archive_from_new_cmds='true'
8494 # FIXME: Should let the user specify the lib program.
8495 old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
8496 fix_srcfile_path='`cygpath -w "$srcfile"`'
8497 enable_shared_with_static_runtimes=yes
8498 ;;
8499
8500 darwin* | rhapsody*)
8501
8502
8503 archive_cmds_need_lc=no
8504 hardcode_direct=no
8505 hardcode_automatic=yes
8506 hardcode_shlibpath_var=unsupported
8507 whole_archive_flag_spec=''
8508 link_all_deplibs=yes
8509 allow_undefined_flag="$_lt_dar_allow_undefined"
8510 case $cc_basename in
8511 ifort*) _lt_dar_can_shared=yes ;;
8512 *) _lt_dar_can_shared=$GCC ;;
8513 esac
8514 if test "$_lt_dar_can_shared" = "yes"; then
8515 output_verbose_link_cmd=echo
8516 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
8517 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
8518 archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
8519 module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
8520
8521 else
8522 ld_shlibs=no
8523 fi
8524
8525 ;;
8526
8527 dgux*)
8528 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8529 hardcode_libdir_flag_spec='-L$libdir'
8530 hardcode_shlibpath_var=no
8531 ;;
8532
8533 freebsd1*)
8534 ld_shlibs=no
8535 ;;
8536
8537 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
8538 # support. Future versions do this automatically, but an explicit c++rt0.o
8539 # does not break anything, and helps significantly (at the cost of a little
8540 # extra space).
8541 freebsd2.2*)
8542 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
8543 hardcode_libdir_flag_spec='-R$libdir'
8544 hardcode_direct=yes
8545 hardcode_shlibpath_var=no
8546 ;;
8547
8548 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
8549 freebsd2*)
8550 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8551 hardcode_direct=yes
8552 hardcode_minus_L=yes
8553 hardcode_shlibpath_var=no
8554 ;;
8555
8556 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
8557 freebsd* | dragonfly*)
8558 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
8559 hardcode_libdir_flag_spec='-R$libdir'
8560 hardcode_direct=yes
8561 hardcode_shlibpath_var=no
8562 ;;
8563
8564 hpux9*)
8565 if test "$GCC" = yes; then
8566 archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8567 else
8568 archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8569 fi
8570 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8571 hardcode_libdir_separator=:
8572 hardcode_direct=yes
8573
8574 # hardcode_minus_L: Not really in the search PATH,
8575 # but as the default location of the library.
8576 hardcode_minus_L=yes
8577 export_dynamic_flag_spec='${wl}-E'
8578 ;;
8579
8580 hpux10*)
8581 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
8582 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8583 else
8584 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
8585 fi
8586 if test "$with_gnu_ld" = no; then
8587 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8588 hardcode_libdir_flag_spec_ld='+b $libdir'
8589 hardcode_libdir_separator=:
8590 hardcode_direct=yes
8591 hardcode_direct_absolute=yes
8592 export_dynamic_flag_spec='${wl}-E'
8593 # hardcode_minus_L: Not really in the search PATH,
8594 # but as the default location of the library.
8595 hardcode_minus_L=yes
8596 fi
8597 ;;
8598
8599 hpux11*)
8600 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
8601 case $host_cpu in
8602 hppa*64*)
8603 archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8604 ;;
8605 ia64*)
8606 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
8607 ;;
8608 *)
8609 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8610 ;;
8611 esac
8612 else
8613 case $host_cpu in
8614 hppa*64*)
8615 archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8616 ;;
8617 ia64*)
8618 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
8619 ;;
8620 *)
8621 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8622 ;;
8623 esac
8624 fi
8625 if test "$with_gnu_ld" = no; then
8626 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8627 hardcode_libdir_separator=:
8628
8629 case $host_cpu in
8630 hppa*64*|ia64*)
8631 hardcode_direct=no
8632 hardcode_shlibpath_var=no
8633 ;;
8634 *)
8635 hardcode_direct=yes
8636 hardcode_direct_absolute=yes
8637 export_dynamic_flag_spec='${wl}-E'
8638
8639 # hardcode_minus_L: Not really in the search PATH,
8640 # but as the default location of the library.
8641 hardcode_minus_L=yes
8642 ;;
8643 esac
8644 fi
8645 ;;
8646
8647 irix5* | irix6* | nonstopux*)
8648 if test "$GCC" = yes; then
8649 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8650 # Try to use the -exported_symbol ld option, if it does not
8651 # work, assume that -exports_file does not work either and
8652 # implicitly export all symbols.
8653 save_LDFLAGS="$LDFLAGS"
8654 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
8655 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8656 /* end confdefs.h. */
8657 int foo(void) {}
8658 _ACEOF
8659 if ac_fn_c_try_link "$LINENO"; then :
8660 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
8661
8662 fi
8663 rm -f core conftest.err conftest.$ac_objext \
8664 conftest$ac_exeext conftest.$ac_ext
8665 LDFLAGS="$save_LDFLAGS"
8666 else
8667 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8668 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
8669 fi
8670 archive_cmds_need_lc='no'
8671 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8672 hardcode_libdir_separator=:
8673 inherit_rpath=yes
8674 link_all_deplibs=yes
8675 ;;
8676
8677 netbsd* | netbsdelf*-gnu)
8678 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8679 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
8680 else
8681 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
8682 fi
8683 hardcode_libdir_flag_spec='-R$libdir'
8684 hardcode_direct=yes
8685 hardcode_shlibpath_var=no
8686 ;;
8687
8688 newsos6)
8689 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8690 hardcode_direct=yes
8691 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8692 hardcode_libdir_separator=:
8693 hardcode_shlibpath_var=no
8694 ;;
8695
8696 *nto* | *qnx*)
8697 ;;
8698
8699 openbsd*)
8700 if test -f /usr/libexec/ld.so; then
8701 hardcode_direct=yes
8702 hardcode_shlibpath_var=no
8703 hardcode_direct_absolute=yes
8704 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8705 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8706 archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
8707 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8708 export_dynamic_flag_spec='${wl}-E'
8709 else
8710 case $host_os in
8711 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
8712 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8713 hardcode_libdir_flag_spec='-R$libdir'
8714 ;;
8715 *)
8716 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8717 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8718 ;;
8719 esac
8720 fi
8721 else
8722 ld_shlibs=no
8723 fi
8724 ;;
8725
8726 os2*)
8727 hardcode_libdir_flag_spec='-L$libdir'
8728 hardcode_minus_L=yes
8729 allow_undefined_flag=unsupported
8730 archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
8731 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
8732 ;;
8733
8734 osf3*)
8735 if test "$GCC" = yes; then
8736 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
8737 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8738 else
8739 allow_undefined_flag=' -expect_unresolved \*'
8740 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8741 fi
8742 archive_cmds_need_lc='no'
8743 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8744 hardcode_libdir_separator=:
8745 ;;
8746
8747 osf4* | osf5*) # as osf3* with the addition of -msym flag
8748 if test "$GCC" = yes; then
8749 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
8750 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8751 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8752 else
8753 allow_undefined_flag=' -expect_unresolved \*'
8754 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8755 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
8756 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
8757
8758 # Both c and cxx compiler support -rpath directly
8759 hardcode_libdir_flag_spec='-rpath $libdir'
8760 fi
8761 archive_cmds_need_lc='no'
8762 hardcode_libdir_separator=:
8763 ;;
8764
8765 solaris*)
8766 no_undefined_flag=' -z defs'
8767 if test "$GCC" = yes; then
8768 wlarc='${wl}'
8769 archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8770 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8771 $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
8772 else
8773 case `$CC -V 2>&1` in
8774 *"Compilers 5.0"*)
8775 wlarc=''
8776 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
8777 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8778 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
8779 ;;
8780 *)
8781 wlarc='${wl}'
8782 archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
8783 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8784 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
8785 ;;
8786 esac
8787 fi
8788 hardcode_libdir_flag_spec='-R$libdir'
8789 hardcode_shlibpath_var=no
8790 case $host_os in
8791 solaris2.[0-5] | solaris2.[0-5].*) ;;
8792 *)
8793 # The compiler driver will combine and reorder linker options,
8794 # but understands `-z linker_flag'. GCC discards it without `$wl',
8795 # but is careful enough not to reorder.
8796 # Supported since Solaris 2.6 (maybe 2.5.1?)
8797 if test "$GCC" = yes; then
8798 whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
8799 else
8800 whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
8801 fi
8802 ;;
8803 esac
8804 link_all_deplibs=yes
8805 ;;
8806
8807 sunos4*)
8808 if test "x$host_vendor" = xsequent; then
8809 # Use $CC to link under sequent, because it throws in some extra .o
8810 # files that make .init and .fini sections work.
8811 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
8812 else
8813 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
8814 fi
8815 hardcode_libdir_flag_spec='-L$libdir'
8816 hardcode_direct=yes
8817 hardcode_minus_L=yes
8818 hardcode_shlibpath_var=no
8819 ;;
8820
8821 sysv4)
8822 case $host_vendor in
8823 sni)
8824 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8825 hardcode_direct=yes # is this really true???
8826 ;;
8827 siemens)
8828 ## LD is ld it makes a PLAMLIB
8829 ## CC just makes a GrossModule.
8830 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
8831 reload_cmds='$CC -r -o $output$reload_objs'
8832 hardcode_direct=no
8833 ;;
8834 motorola)
8835 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8836 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
8837 ;;
8838 esac
8839 runpath_var='LD_RUN_PATH'
8840 hardcode_shlibpath_var=no
8841 ;;
8842
8843 sysv4.3*)
8844 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8845 hardcode_shlibpath_var=no
8846 export_dynamic_flag_spec='-Bexport'
8847 ;;
8848
8849 sysv4*MP*)
8850 if test -d /usr/nec; then
8851 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8852 hardcode_shlibpath_var=no
8853 runpath_var=LD_RUN_PATH
8854 hardcode_runpath_var=yes
8855 ld_shlibs=yes
8856 fi
8857 ;;
8858
8859 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
8860 no_undefined_flag='${wl}-z,text'
8861 archive_cmds_need_lc=no
8862 hardcode_shlibpath_var=no
8863 runpath_var='LD_RUN_PATH'
8864
8865 if test "$GCC" = yes; then
8866 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8867 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8868 else
8869 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8870 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8871 fi
8872 ;;
8873
8874 sysv5* | sco3.2v5* | sco5v6*)
8875 # Note: We can NOT use -z defs as we might desire, because we do not
8876 # link with -lc, and that would cause any symbols used from libc to
8877 # always be unresolved, which means just about no library would
8878 # ever link correctly. If we're not using GNU ld we use -z text
8879 # though, which does catch some bad symbols but isn't as heavy-handed
8880 # as -z defs.
8881 no_undefined_flag='${wl}-z,text'
8882 allow_undefined_flag='${wl}-z,nodefs'
8883 archive_cmds_need_lc=no
8884 hardcode_shlibpath_var=no
8885 hardcode_libdir_flag_spec='${wl}-R,$libdir'
8886 hardcode_libdir_separator=':'
8887 link_all_deplibs=yes
8888 export_dynamic_flag_spec='${wl}-Bexport'
8889 runpath_var='LD_RUN_PATH'
8890
8891 if test "$GCC" = yes; then
8892 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8893 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8894 else
8895 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8896 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
8897 fi
8898 ;;
8899
8900 uts4*)
8901 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8902 hardcode_libdir_flag_spec='-L$libdir'
8903 hardcode_shlibpath_var=no
8904 ;;
8905
8906 *)
8907 ld_shlibs=no
8908 ;;
8909 esac
8910
8911 if test x$host_vendor = xsni; then
8912 case $host in
8913 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
8914 export_dynamic_flag_spec='${wl}-Blargedynsym'
8915 ;;
8916 esac
8917 fi
8918 fi
8919
8920 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
8921 $as_echo "$ld_shlibs" >&6; }
8922 test "$ld_shlibs" = no && can_build_shared=no
8923
8924 with_gnu_ld=$with_gnu_ld
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940 #
8941 # Do we need to explicitly link libc?
8942 #
8943 case "x$archive_cmds_need_lc" in
8944 x|xyes)
8945 # Assume -lc should be added
8946 archive_cmds_need_lc=yes
8947
8948 if test "$enable_shared" = yes && test "$GCC" = yes; then
8949 case $archive_cmds in
8950 *'~'*)
8951 # FIXME: we may have to deal with multi-command sequences.
8952 ;;
8953 '$CC '*)
8954 # Test whether the compiler implicitly links with -lc since on some
8955 # systems, -lgcc has to come before -lc. If gcc already passes -lc
8956 # to ld, don't add -lc before -lgcc.
8957 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
8958 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
8959 $RM conftest*
8960 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8961
8962 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
8963 (eval $ac_compile) 2>&5
8964 ac_status=$?
8965 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
8966 test $ac_status = 0; } 2>conftest.err; then
8967 soname=conftest
8968 lib=conftest
8969 libobjs=conftest.$ac_objext
8970 deplibs=
8971 wl=$lt_prog_compiler_wl
8972 pic_flag=$lt_prog_compiler_pic
8973 compiler_flags=-v
8974 linker_flags=-v
8975 verstring=
8976 output_objdir=.
8977 libname=conftest
8978 lt_save_allow_undefined_flag=$allow_undefined_flag
8979 allow_undefined_flag=
8980 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
8981 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
8982 ac_status=$?
8983 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
8984 test $ac_status = 0; }
8985 then
8986 archive_cmds_need_lc=no
8987 else
8988 archive_cmds_need_lc=yes
8989 fi
8990 allow_undefined_flag=$lt_save_allow_undefined_flag
8991 else
8992 cat conftest.err 1>&5
8993 fi
8994 $RM conftest*
8995 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5
8996 $as_echo "$archive_cmds_need_lc" >&6; }
8997 ;;
8998 esac
8999 fi
9000 ;;
9001 esac
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
9160 $as_echo_n "checking dynamic linker characteristics... " >&6; }
9161
9162 if test "$GCC" = yes; then
9163 case $host_os in
9164 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
9165 *) lt_awk_arg="/^libraries:/" ;;
9166 esac
9167 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
9168 if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
9169 # if the path contains ";" then we assume it to be the separator
9170 # otherwise default to the standard path separator (i.e. ":") - it is
9171 # assumed that no part of a normal pathname contains ";" but that should
9172 # okay in the real world where ";" in dirpaths is itself problematic.
9173 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
9174 else
9175 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
9176 fi
9177 # Ok, now we have the path, separated by spaces, we can step through it
9178 # and add multilib dir if necessary.
9179 lt_tmp_lt_search_path_spec=
9180 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
9181 for lt_sys_path in $lt_search_path_spec; do
9182 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
9183 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
9184 else
9185 test -d "$lt_sys_path" && \
9186 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
9187 fi
9188 done
9189 lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
9190 BEGIN {RS=" "; FS="/|\n";} {
9191 lt_foo="";
9192 lt_count=0;
9193 for (lt_i = NF; lt_i > 0; lt_i--) {
9194 if ($lt_i != "" && $lt_i != ".") {
9195 if ($lt_i == "..") {
9196 lt_count++;
9197 } else {
9198 if (lt_count == 0) {
9199 lt_foo="/" $lt_i lt_foo;
9200 } else {
9201 lt_count--;
9202 }
9203 }
9204 }
9205 }
9206 if (lt_foo != "") { lt_freq[lt_foo]++; }
9207 if (lt_freq[lt_foo] == 1) { print lt_foo; }
9208 }'`
9209 sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
9210 else
9211 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
9212 fi
9213 library_names_spec=
9214 libname_spec='lib$name'
9215 soname_spec=
9216 shrext_cmds=".so"
9217 postinstall_cmds=
9218 postuninstall_cmds=
9219 finish_cmds=
9220 finish_eval=
9221 shlibpath_var=
9222 shlibpath_overrides_runpath=unknown
9223 version_type=none
9224 dynamic_linker="$host_os ld.so"
9225 sys_lib_dlsearch_path_spec="/lib /usr/lib"
9226 need_lib_prefix=unknown
9227 hardcode_into_libs=no
9228
9229 # when you set need_version to no, make sure it does not cause -set_version
9230 # flags to be left without arguments
9231 need_version=unknown
9232
9233 case $host_os in
9234 aix3*)
9235 version_type=linux
9236 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
9237 shlibpath_var=LIBPATH
9238
9239 # AIX 3 has no versioning support, so we append a major version to the name.
9240 soname_spec='${libname}${release}${shared_ext}$major'
9241 ;;
9242
9243 aix[4-9]*)
9244 version_type=linux
9245 need_lib_prefix=no
9246 need_version=no
9247 hardcode_into_libs=yes
9248 if test "$host_cpu" = ia64; then
9249 # AIX 5 supports IA64
9250 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
9251 shlibpath_var=LD_LIBRARY_PATH
9252 else
9253 # With GCC up to 2.95.x, collect2 would create an import file
9254 # for dependence libraries. The import file would start with
9255 # the line `#! .'. This would cause the generated library to
9256 # depend on `.', always an invalid library. This was fixed in
9257 # development snapshots of GCC prior to 3.0.
9258 case $host_os in
9259 aix4 | aix4.[01] | aix4.[01].*)
9260 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
9261 echo ' yes '
9262 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
9263 :
9264 else
9265 can_build_shared=no
9266 fi
9267 ;;
9268 esac
9269 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
9270 # soname into executable. Probably we can add versioning support to
9271 # collect2, so additional links can be useful in future.
9272 if test "$aix_use_runtimelinking" = yes; then
9273 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
9274 # instead of lib<name>.a to let people know that these are not
9275 # typical AIX shared libraries.
9276 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9277 else
9278 # We preserve .a as extension for shared libraries through AIX4.2
9279 # and later when we are not doing run time linking.
9280 library_names_spec='${libname}${release}.a $libname.a'
9281 soname_spec='${libname}${release}${shared_ext}$major'
9282 fi
9283 shlibpath_var=LIBPATH
9284 fi
9285 ;;
9286
9287 amigaos*)
9288 case $host_cpu in
9289 powerpc)
9290 # Since July 2007 AmigaOS4 officially supports .so libraries.
9291 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
9292 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9293 ;;
9294 m68k)
9295 library_names_spec='$libname.ixlibrary $libname.a'
9296 # Create ${libname}_ixlibrary.a entries in /sys/libs.
9297 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
9298 ;;
9299 esac
9300 ;;
9301
9302 beos*)
9303 library_names_spec='${libname}${shared_ext}'
9304 dynamic_linker="$host_os ld.so"
9305 shlibpath_var=LIBRARY_PATH
9306 ;;
9307
9308 bsdi[45]*)
9309 version_type=linux
9310 need_version=no
9311 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9312 soname_spec='${libname}${release}${shared_ext}$major'
9313 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
9314 shlibpath_var=LD_LIBRARY_PATH
9315 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
9316 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
9317 # the default ld.so.conf also contains /usr/contrib/lib and
9318 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
9319 # libtool to hard-code these into programs
9320 ;;
9321
9322 cygwin* | mingw* | pw32* | cegcc*)
9323 version_type=windows
9324 shrext_cmds=".dll"
9325 need_version=no
9326 need_lib_prefix=no
9327
9328 case $GCC,$host_os in
9329 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
9330 library_names_spec='$libname.dll.a'
9331 # DLL is installed to $(libdir)/../bin by postinstall_cmds
9332 postinstall_cmds='base_file=`basename \${file}`~
9333 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
9334 dldir=$destdir/`dirname \$dlpath`~
9335 test -d \$dldir || mkdir -p \$dldir~
9336 $install_prog $dir/$dlname \$dldir/$dlname~
9337 chmod a+x \$dldir/$dlname~
9338 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
9339 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
9340 fi'
9341 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
9342 dlpath=$dir/\$dldll~
9343 $RM \$dlpath'
9344 shlibpath_overrides_runpath=yes
9345
9346 case $host_os in
9347 cygwin*)
9348 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
9349 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9350 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
9351 ;;
9352 mingw* | cegcc*)
9353 # MinGW DLLs use traditional 'lib' prefix
9354 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9355 sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
9356 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
9357 # It is most probably a Windows format PATH printed by
9358 # mingw gcc, but we are running on Cygwin. Gcc prints its search
9359 # path with ; separators, and with drive letters. We can handle the
9360 # drive letters (cygwin fileutils understands them), so leave them,
9361 # especially as we might pass files found there to a mingw objdump,
9362 # which wouldn't understand a cygwinified path. Ahh.
9363 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
9364 else
9365 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
9366 fi
9367 ;;
9368 pw32*)
9369 # pw32 DLLs use 'pw' prefix rather than 'lib'
9370 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9371 ;;
9372 esac
9373 ;;
9374
9375 *)
9376 library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
9377 ;;
9378 esac
9379 dynamic_linker='Win32 ld.exe'
9380 # FIXME: first we should search . and the directory the executable is in
9381 shlibpath_var=PATH
9382 ;;
9383
9384 darwin* | rhapsody*)
9385 dynamic_linker="$host_os dyld"
9386 version_type=darwin
9387 need_lib_prefix=no
9388 need_version=no
9389 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
9390 soname_spec='${libname}${release}${major}$shared_ext'
9391 shlibpath_overrides_runpath=yes
9392 shlibpath_var=DYLD_LIBRARY_PATH
9393 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
9394
9395 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
9396 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
9397 ;;
9398
9399 dgux*)
9400 version_type=linux
9401 need_lib_prefix=no
9402 need_version=no
9403 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
9404 soname_spec='${libname}${release}${shared_ext}$major'
9405 shlibpath_var=LD_LIBRARY_PATH
9406 ;;
9407
9408 freebsd1*)
9409 dynamic_linker=no
9410 ;;
9411
9412 freebsd* | dragonfly*)
9413 # DragonFly does not have aout. When/if they implement a new
9414 # versioning mechanism, adjust this.
9415 if test -x /usr/bin/objformat; then
9416 objformat=`/usr/bin/objformat`
9417 else
9418 case $host_os in
9419 freebsd[123]*) objformat=aout ;;
9420 *) objformat=elf ;;
9421 esac
9422 fi
9423 version_type=freebsd-$objformat
9424 case $version_type in
9425 freebsd-elf*)
9426 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
9427 need_version=no
9428 need_lib_prefix=no
9429 ;;
9430 freebsd-*)
9431 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
9432 need_version=yes
9433 ;;
9434 esac
9435 shlibpath_var=LD_LIBRARY_PATH
9436 case $host_os in
9437 freebsd2*)
9438 shlibpath_overrides_runpath=yes
9439 ;;
9440 freebsd3.[01]* | freebsdelf3.[01]*)
9441 shlibpath_overrides_runpath=yes
9442 hardcode_into_libs=yes
9443 ;;
9444 freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
9445 freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
9446 shlibpath_overrides_runpath=no
9447 hardcode_into_libs=yes
9448 ;;
9449 *) # from 4.6 on, and DragonFly
9450 shlibpath_overrides_runpath=yes
9451 hardcode_into_libs=yes
9452 ;;
9453 esac
9454 ;;
9455
9456 gnu*)
9457 version_type=linux
9458 need_lib_prefix=no
9459 need_version=no
9460 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
9461 soname_spec='${libname}${release}${shared_ext}$major'
9462 shlibpath_var=LD_LIBRARY_PATH
9463 hardcode_into_libs=yes
9464 ;;
9465
9466 hpux9* | hpux10* | hpux11*)
9467 # Give a soname corresponding to the major version so that dld.sl refuses to
9468 # link against other versions.
9469 version_type=sunos
9470 need_lib_prefix=no
9471 need_version=no
9472 case $host_cpu in
9473 ia64*)
9474 shrext_cmds='.so'
9475 hardcode_into_libs=yes
9476 dynamic_linker="$host_os dld.so"
9477 shlibpath_var=LD_LIBRARY_PATH
9478 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
9479 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9480 soname_spec='${libname}${release}${shared_ext}$major'
9481 if test "X$HPUX_IA64_MODE" = X32; then
9482 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
9483 else
9484 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
9485 fi
9486 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
9487 ;;
9488 hppa*64*)
9489 shrext_cmds='.sl'
9490 hardcode_into_libs=yes
9491 dynamic_linker="$host_os dld.sl"
9492 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
9493 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
9494 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9495 soname_spec='${libname}${release}${shared_ext}$major'
9496 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
9497 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
9498 ;;
9499 *)
9500 shrext_cmds='.sl'
9501 dynamic_linker="$host_os dld.sl"
9502 shlibpath_var=SHLIB_PATH
9503 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
9504 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9505 soname_spec='${libname}${release}${shared_ext}$major'
9506 ;;
9507 esac
9508 # HP-UX runs *really* slowly unless shared libraries are mode 555.
9509 postinstall_cmds='chmod 555 $lib'
9510 ;;
9511
9512 interix[3-9]*)
9513 version_type=linux
9514 need_lib_prefix=no
9515 need_version=no
9516 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
9517 soname_spec='${libname}${release}${shared_ext}$major'
9518 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
9519 shlibpath_var=LD_LIBRARY_PATH
9520 shlibpath_overrides_runpath=no
9521 hardcode_into_libs=yes
9522 ;;
9523
9524 irix5* | irix6* | nonstopux*)
9525 case $host_os in
9526 nonstopux*) version_type=nonstopux ;;
9527 *)
9528 if test "$lt_cv_prog_gnu_ld" = yes; then
9529 version_type=linux
9530 else
9531 version_type=irix
9532 fi ;;
9533 esac
9534 need_lib_prefix=no
9535 need_version=no
9536 soname_spec='${libname}${release}${shared_ext}$major'
9537 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
9538 case $host_os in
9539 irix5* | nonstopux*)
9540 libsuff= shlibsuff=
9541 ;;
9542 *)
9543 case $LD in # libtool.m4 will add one of these switches to LD
9544 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
9545 libsuff= shlibsuff= libmagic=32-bit;;
9546 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
9547 libsuff=32 shlibsuff=N32 libmagic=N32;;
9548 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
9549 libsuff=64 shlibsuff=64 libmagic=64-bit;;
9550 *) libsuff= shlibsuff= libmagic=never-match;;
9551 esac
9552 ;;
9553 esac
9554 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
9555 shlibpath_overrides_runpath=no
9556 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
9557 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
9558 hardcode_into_libs=yes
9559 ;;
9560
9561 # No shared lib support for Linux oldld, aout, or coff.
9562 linux*oldld* | linux*aout* | linux*coff*)
9563 dynamic_linker=no
9564 ;;
9565
9566 # This must be Linux ELF.
9567 linux* | k*bsd*-gnu | kopensolaris*-gnu)
9568 version_type=linux
9569 need_lib_prefix=no
9570 need_version=no
9571 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9572 soname_spec='${libname}${release}${shared_ext}$major'
9573 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
9574 shlibpath_var=LD_LIBRARY_PATH
9575 shlibpath_overrides_runpath=no
9576 # Some binutils ld are patched to set DT_RUNPATH
9577 save_LDFLAGS=$LDFLAGS
9578 save_libdir=$libdir
9579 eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
9580 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
9581 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9582 /* end confdefs.h. */
9583
9584 int
9585 main ()
9586 {
9587
9588 ;
9589 return 0;
9590 }
9591 _ACEOF
9592 if ac_fn_c_try_link "$LINENO"; then :
9593 if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
9594 shlibpath_overrides_runpath=yes
9595 fi
9596 fi
9597 rm -f core conftest.err conftest.$ac_objext \
9598 conftest$ac_exeext conftest.$ac_ext
9599 LDFLAGS=$save_LDFLAGS
9600 libdir=$save_libdir
9601
9602 # This implies no fast_install, which is unacceptable.
9603 # Some rework will be needed to allow for fast_install
9604 # before this can be enabled.
9605 hardcode_into_libs=yes
9606
9607 # Append ld.so.conf contents to the search path
9608 if test -f /etc/ld.so.conf; then
9609 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
9610 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
9611 fi
9612
9613 # We used to test for /lib/ld.so.1 and disable shared libraries on
9614 # powerpc, because MkLinux only supported shared libraries with the
9615 # GNU dynamic linker. Since this was broken with cross compilers,
9616 # most powerpc-linux boxes support dynamic linking these days and
9617 # people can always --disable-shared, the test was removed, and we
9618 # assume the GNU/Linux dynamic linker is in use.
9619 dynamic_linker='GNU/Linux ld.so'
9620 ;;
9621
9622 netbsdelf*-gnu)
9623 version_type=linux
9624 need_lib_prefix=no
9625 need_version=no
9626 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
9627 soname_spec='${libname}${release}${shared_ext}$major'
9628 shlibpath_var=LD_LIBRARY_PATH
9629 shlibpath_overrides_runpath=no
9630 hardcode_into_libs=yes
9631 dynamic_linker='NetBSD ld.elf_so'
9632 ;;
9633
9634 netbsd*)
9635 version_type=sunos
9636 need_lib_prefix=no
9637 need_version=no
9638 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9639 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
9640 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
9641 dynamic_linker='NetBSD (a.out) ld.so'
9642 else
9643 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
9644 soname_spec='${libname}${release}${shared_ext}$major'
9645 dynamic_linker='NetBSD ld.elf_so'
9646 fi
9647 shlibpath_var=LD_LIBRARY_PATH
9648 shlibpath_overrides_runpath=yes
9649 hardcode_into_libs=yes
9650 ;;
9651
9652 newsos6)
9653 version_type=linux
9654 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9655 shlibpath_var=LD_LIBRARY_PATH
9656 shlibpath_overrides_runpath=yes
9657 ;;
9658
9659 *nto* | *qnx*)
9660 version_type=qnx
9661 need_lib_prefix=no
9662 need_version=no
9663 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9664 soname_spec='${libname}${release}${shared_ext}$major'
9665 shlibpath_var=LD_LIBRARY_PATH
9666 shlibpath_overrides_runpath=no
9667 hardcode_into_libs=yes
9668 dynamic_linker='ldqnx.so'
9669 ;;
9670
9671 openbsd*)
9672 version_type=sunos
9673 sys_lib_dlsearch_path_spec="/usr/lib"
9674 need_lib_prefix=no
9675 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
9676 case $host_os in
9677 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
9678 *) need_version=no ;;
9679 esac
9680 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
9681 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
9682 shlibpath_var=LD_LIBRARY_PATH
9683 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
9684 case $host_os in
9685 openbsd2.[89] | openbsd2.[89].*)
9686 shlibpath_overrides_runpath=no
9687 ;;
9688 *)
9689 shlibpath_overrides_runpath=yes
9690 ;;
9691 esac
9692 else
9693 shlibpath_overrides_runpath=yes
9694 fi
9695 ;;
9696
9697 os2*)
9698 libname_spec='$name'
9699 shrext_cmds=".dll"
9700 need_lib_prefix=no
9701 library_names_spec='$libname${shared_ext} $libname.a'
9702 dynamic_linker='OS/2 ld.exe'
9703 shlibpath_var=LIBPATH
9704 ;;
9705
9706 osf3* | osf4* | osf5*)
9707 version_type=osf
9708 need_lib_prefix=no
9709 need_version=no
9710 soname_spec='${libname}${release}${shared_ext}$major'
9711 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9712 shlibpath_var=LD_LIBRARY_PATH
9713 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
9714 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
9715 ;;
9716
9717 rdos*)
9718 dynamic_linker=no
9719 ;;
9720
9721 solaris*)
9722 version_type=linux
9723 need_lib_prefix=no
9724 need_version=no
9725 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9726 soname_spec='${libname}${release}${shared_ext}$major'
9727 shlibpath_var=LD_LIBRARY_PATH
9728 shlibpath_overrides_runpath=yes
9729 hardcode_into_libs=yes
9730 # ldd complains unless libraries are executable
9731 postinstall_cmds='chmod +x $lib'
9732 ;;
9733
9734 sunos4*)
9735 version_type=sunos
9736 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
9737 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
9738 shlibpath_var=LD_LIBRARY_PATH
9739 shlibpath_overrides_runpath=yes
9740 if test "$with_gnu_ld" = yes; then
9741 need_lib_prefix=no
9742 fi
9743 need_version=yes
9744 ;;
9745
9746 sysv4 | sysv4.3*)
9747 version_type=linux
9748 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9749 soname_spec='${libname}${release}${shared_ext}$major'
9750 shlibpath_var=LD_LIBRARY_PATH
9751 case $host_vendor in
9752 sni)
9753 shlibpath_overrides_runpath=no
9754 need_lib_prefix=no
9755 runpath_var=LD_RUN_PATH
9756 ;;
9757 siemens)
9758 need_lib_prefix=no
9759 ;;
9760 motorola)
9761 need_lib_prefix=no
9762 need_version=no
9763 shlibpath_overrides_runpath=no
9764 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
9765 ;;
9766 esac
9767 ;;
9768
9769 sysv4*MP*)
9770 if test -d /usr/nec ;then
9771 version_type=linux
9772 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
9773 soname_spec='$libname${shared_ext}.$major'
9774 shlibpath_var=LD_LIBRARY_PATH
9775 fi
9776 ;;
9777
9778 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
9779 version_type=freebsd-elf
9780 need_lib_prefix=no
9781 need_version=no
9782 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
9783 soname_spec='${libname}${release}${shared_ext}$major'
9784 shlibpath_var=LD_LIBRARY_PATH
9785 shlibpath_overrides_runpath=yes
9786 hardcode_into_libs=yes
9787 if test "$with_gnu_ld" = yes; then
9788 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
9789 else
9790 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
9791 case $host_os in
9792 sco3.2v5*)
9793 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
9794 ;;
9795 esac
9796 fi
9797 sys_lib_dlsearch_path_spec='/usr/lib'
9798 ;;
9799
9800 tpf*)
9801 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
9802 version_type=linux
9803 need_lib_prefix=no
9804 need_version=no
9805 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9806 shlibpath_var=LD_LIBRARY_PATH
9807 shlibpath_overrides_runpath=no
9808 hardcode_into_libs=yes
9809 ;;
9810
9811 uts4*)
9812 version_type=linux
9813 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9814 soname_spec='${libname}${release}${shared_ext}$major'
9815 shlibpath_var=LD_LIBRARY_PATH
9816 ;;
9817
9818 *)
9819 dynamic_linker=no
9820 ;;
9821 esac
9822 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
9823 $as_echo "$dynamic_linker" >&6; }
9824 test "$dynamic_linker" = no && can_build_shared=no
9825
9826 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
9827 if test "$GCC" = yes; then
9828 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
9829 fi
9830
9831 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
9832 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
9833 fi
9834 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
9835 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
9836 fi
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
9925 $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
9926 hardcode_action=
9927 if test -n "$hardcode_libdir_flag_spec" ||
9928 test -n "$runpath_var" ||
9929 test "X$hardcode_automatic" = "Xyes" ; then
9930
9931 # We can hardcode non-existent directories.
9932 if test "$hardcode_direct" != no &&
9933 # If the only mechanism to avoid hardcoding is shlibpath_var, we
9934 # have to relink, otherwise we might link with an installed library
9935 # when we should be linking with a yet-to-be-installed one
9936 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
9937 test "$hardcode_minus_L" != no; then
9938 # Linking always hardcodes the temporary library directory.
9939 hardcode_action=relink
9940 else
9941 # We can link without hardcoding, and we can hardcode nonexisting dirs.
9942 hardcode_action=immediate
9943 fi
9944 else
9945 # We cannot hardcode anything, or else we can only hardcode existing
9946 # directories.
9947 hardcode_action=unsupported
9948 fi
9949 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
9950 $as_echo "$hardcode_action" >&6; }
9951
9952 if test "$hardcode_action" = relink ||
9953 test "$inherit_rpath" = yes; then
9954 # Fast installation is not supported
9955 enable_fast_install=no
9956 elif test "$shlibpath_overrides_runpath" = yes ||
9957 test "$enable_shared" = no; then
9958 # Fast installation is not necessary
9959 enable_fast_install=needless
9960 fi
9961
9962
9963
9964
9965
9966
9967 if test "x$enable_dlopen" != xyes; then
9968 enable_dlopen=unknown
9969 enable_dlopen_self=unknown
9970 enable_dlopen_self_static=unknown
9971 else
9972 lt_cv_dlopen=no
9973 lt_cv_dlopen_libs=
9974
9975 case $host_os in
9976 beos*)
9977 lt_cv_dlopen="load_add_on"
9978 lt_cv_dlopen_libs=
9979 lt_cv_dlopen_self=yes
9980 ;;
9981
9982 mingw* | pw32* | cegcc*)
9983 lt_cv_dlopen="LoadLibrary"
9984 lt_cv_dlopen_libs=
9985 ;;
9986
9987 cygwin*)
9988 lt_cv_dlopen="dlopen"
9989 lt_cv_dlopen_libs=
9990 ;;
9991
9992 darwin*)
9993 # if libdl is installed we need to link against it
9994 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
9995 $as_echo_n "checking for dlopen in -ldl... " >&6; }
9996 if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
9997 $as_echo_n "(cached) " >&6
9998 else
9999 ac_check_lib_save_LIBS=$LIBS
10000 LIBS="-ldl $LIBS"
10001 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10002 /* end confdefs.h. */
10003
10004 /* Override any GCC internal prototype to avoid an error.
10005 Use char because int might match the return type of a GCC
10006 builtin and then its argument prototype would still apply. */
10007 #ifdef __cplusplus
10008 extern "C"
10009 #endif
10010 char dlopen ();
10011 int
10012 main ()
10013 {
10014 return dlopen ();
10015 ;
10016 return 0;
10017 }
10018 _ACEOF
10019 if ac_fn_c_try_link "$LINENO"; then :
10020 ac_cv_lib_dl_dlopen=yes
10021 else
10022 ac_cv_lib_dl_dlopen=no
10023 fi
10024 rm -f core conftest.err conftest.$ac_objext \
10025 conftest$ac_exeext conftest.$ac_ext
10026 LIBS=$ac_check_lib_save_LIBS
10027 fi
10028 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
10029 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
10030 if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
10031 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
10032 else
10033
10034 lt_cv_dlopen="dyld"
10035 lt_cv_dlopen_libs=
10036 lt_cv_dlopen_self=yes
10037
10038 fi
10039
10040 ;;
10041
10042 *)
10043 ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
10044 if test "x$ac_cv_func_shl_load" = x""yes; then :
10045 lt_cv_dlopen="shl_load"
10046 else
10047 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
10048 $as_echo_n "checking for shl_load in -ldld... " >&6; }
10049 if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
10050 $as_echo_n "(cached) " >&6
10051 else
10052 ac_check_lib_save_LIBS=$LIBS
10053 LIBS="-ldld $LIBS"
10054 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10055 /* end confdefs.h. */
10056
10057 /* Override any GCC internal prototype to avoid an error.
10058 Use char because int might match the return type of a GCC
10059 builtin and then its argument prototype would still apply. */
10060 #ifdef __cplusplus
10061 extern "C"
10062 #endif
10063 char shl_load ();
10064 int
10065 main ()
10066 {
10067 return shl_load ();
10068 ;
10069 return 0;
10070 }
10071 _ACEOF
10072 if ac_fn_c_try_link "$LINENO"; then :
10073 ac_cv_lib_dld_shl_load=yes
10074 else
10075 ac_cv_lib_dld_shl_load=no
10076 fi
10077 rm -f core conftest.err conftest.$ac_objext \
10078 conftest$ac_exeext conftest.$ac_ext
10079 LIBS=$ac_check_lib_save_LIBS
10080 fi
10081 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
10082 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
10083 if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
10084 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
10085 else
10086 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
10087 if test "x$ac_cv_func_dlopen" = x""yes; then :
10088 lt_cv_dlopen="dlopen"
10089 else
10090 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
10091 $as_echo_n "checking for dlopen in -ldl... " >&6; }
10092 if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
10093 $as_echo_n "(cached) " >&6
10094 else
10095 ac_check_lib_save_LIBS=$LIBS
10096 LIBS="-ldl $LIBS"
10097 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10098 /* end confdefs.h. */
10099
10100 /* Override any GCC internal prototype to avoid an error.
10101 Use char because int might match the return type of a GCC
10102 builtin and then its argument prototype would still apply. */
10103 #ifdef __cplusplus
10104 extern "C"
10105 #endif
10106 char dlopen ();
10107 int
10108 main ()
10109 {
10110 return dlopen ();
10111 ;
10112 return 0;
10113 }
10114 _ACEOF
10115 if ac_fn_c_try_link "$LINENO"; then :
10116 ac_cv_lib_dl_dlopen=yes
10117 else
10118 ac_cv_lib_dl_dlopen=no
10119 fi
10120 rm -f core conftest.err conftest.$ac_objext \
10121 conftest$ac_exeext conftest.$ac_ext
10122 LIBS=$ac_check_lib_save_LIBS
10123 fi
10124 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
10125 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
10126 if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
10127 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
10128 else
10129 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
10130 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
10131 if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
10132 $as_echo_n "(cached) " >&6
10133 else
10134 ac_check_lib_save_LIBS=$LIBS
10135 LIBS="-lsvld $LIBS"
10136 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10137 /* end confdefs.h. */
10138
10139 /* Override any GCC internal prototype to avoid an error.
10140 Use char because int might match the return type of a GCC
10141 builtin and then its argument prototype would still apply. */
10142 #ifdef __cplusplus
10143 extern "C"
10144 #endif
10145 char dlopen ();
10146 int
10147 main ()
10148 {
10149 return dlopen ();
10150 ;
10151 return 0;
10152 }
10153 _ACEOF
10154 if ac_fn_c_try_link "$LINENO"; then :
10155 ac_cv_lib_svld_dlopen=yes
10156 else
10157 ac_cv_lib_svld_dlopen=no
10158 fi
10159 rm -f core conftest.err conftest.$ac_objext \
10160 conftest$ac_exeext conftest.$ac_ext
10161 LIBS=$ac_check_lib_save_LIBS
10162 fi
10163 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
10164 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
10165 if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
10166 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
10167 else
10168 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
10169 $as_echo_n "checking for dld_link in -ldld... " >&6; }
10170 if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
10171 $as_echo_n "(cached) " >&6
10172 else
10173 ac_check_lib_save_LIBS=$LIBS
10174 LIBS="-ldld $LIBS"
10175 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10176 /* end confdefs.h. */
10177
10178 /* Override any GCC internal prototype to avoid an error.
10179 Use char because int might match the return type of a GCC
10180 builtin and then its argument prototype would still apply. */
10181 #ifdef __cplusplus
10182 extern "C"
10183 #endif
10184 char dld_link ();
10185 int
10186 main ()
10187 {
10188 return dld_link ();
10189 ;
10190 return 0;
10191 }
10192 _ACEOF
10193 if ac_fn_c_try_link "$LINENO"; then :
10194 ac_cv_lib_dld_dld_link=yes
10195 else
10196 ac_cv_lib_dld_dld_link=no
10197 fi
10198 rm -f core conftest.err conftest.$ac_objext \
10199 conftest$ac_exeext conftest.$ac_ext
10200 LIBS=$ac_check_lib_save_LIBS
10201 fi
10202 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
10203 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
10204 if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
10205 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
10206 fi
10207
10208
10209 fi
10210
10211
10212 fi
10213
10214
10215 fi
10216
10217
10218 fi
10219
10220
10221 fi
10222
10223 ;;
10224 esac
10225
10226 if test "x$lt_cv_dlopen" != xno; then
10227 enable_dlopen=yes
10228 else
10229 enable_dlopen=no
10230 fi
10231
10232 case $lt_cv_dlopen in
10233 dlopen)
10234 save_CPPFLAGS="$CPPFLAGS"
10235 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
10236
10237 save_LDFLAGS="$LDFLAGS"
10238 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
10239
10240 save_LIBS="$LIBS"
10241 LIBS="$lt_cv_dlopen_libs $LIBS"
10242
10243 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
10244 $as_echo_n "checking whether a program can dlopen itself... " >&6; }
10245 if test "${lt_cv_dlopen_self+set}" = set; then :
10246 $as_echo_n "(cached) " >&6
10247 else
10248 if test "$cross_compiling" = yes; then :
10249 lt_cv_dlopen_self=cross
10250 else
10251 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
10252 lt_status=$lt_dlunknown
10253 cat > conftest.$ac_ext <<_LT_EOF
10254 #line 10255 "configure"
10255 #include "confdefs.h"
10256
10257 #if HAVE_DLFCN_H
10258 #include <dlfcn.h>
10259 #endif
10260
10261 #include <stdio.h>
10262
10263 #ifdef RTLD_GLOBAL
10264 # define LT_DLGLOBAL RTLD_GLOBAL
10265 #else
10266 # ifdef DL_GLOBAL
10267 # define LT_DLGLOBAL DL_GLOBAL
10268 # else
10269 # define LT_DLGLOBAL 0
10270 # endif
10271 #endif
10272
10273 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
10274 find out it does not work in some platform. */
10275 #ifndef LT_DLLAZY_OR_NOW
10276 # ifdef RTLD_LAZY
10277 # define LT_DLLAZY_OR_NOW RTLD_LAZY
10278 # else
10279 # ifdef DL_LAZY
10280 # define LT_DLLAZY_OR_NOW DL_LAZY
10281 # else
10282 # ifdef RTLD_NOW
10283 # define LT_DLLAZY_OR_NOW RTLD_NOW
10284 # else
10285 # ifdef DL_NOW
10286 # define LT_DLLAZY_OR_NOW DL_NOW
10287 # else
10288 # define LT_DLLAZY_OR_NOW 0
10289 # endif
10290 # endif
10291 # endif
10292 # endif
10293 #endif
10294
10295 void fnord() { int i=42;}
10296 int main ()
10297 {
10298 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
10299 int status = $lt_dlunknown;
10300
10301 if (self)
10302 {
10303 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
10304 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
10305 /* dlclose (self); */
10306 }
10307 else
10308 puts (dlerror ());
10309
10310 return status;
10311 }
10312 _LT_EOF
10313 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
10314 (eval $ac_link) 2>&5
10315 ac_status=$?
10316 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10317 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
10318 (./conftest; exit; ) >&5 2>/dev/null
10319 lt_status=$?
10320 case x$lt_status in
10321 x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
10322 x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
10323 x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
10324 esac
10325 else :
10326 # compilation failed
10327 lt_cv_dlopen_self=no
10328 fi
10329 fi
10330 rm -fr conftest*
10331
10332
10333 fi
10334 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
10335 $as_echo "$lt_cv_dlopen_self" >&6; }
10336
10337 if test "x$lt_cv_dlopen_self" = xyes; then
10338 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
10339 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
10340 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
10341 if test "${lt_cv_dlopen_self_static+set}" = set; then :
10342 $as_echo_n "(cached) " >&6
10343 else
10344 if test "$cross_compiling" = yes; then :
10345 lt_cv_dlopen_self_static=cross
10346 else
10347 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
10348 lt_status=$lt_dlunknown
10349 cat > conftest.$ac_ext <<_LT_EOF
10350 #line 10351 "configure"
10351 #include "confdefs.h"
10352
10353 #if HAVE_DLFCN_H
10354 #include <dlfcn.h>
10355 #endif
10356
10357 #include <stdio.h>
10358
10359 #ifdef RTLD_GLOBAL
10360 # define LT_DLGLOBAL RTLD_GLOBAL
10361 #else
10362 # ifdef DL_GLOBAL
10363 # define LT_DLGLOBAL DL_GLOBAL
10364 # else
10365 # define LT_DLGLOBAL 0
10366 # endif
10367 #endif
10368
10369 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
10370 find out it does not work in some platform. */
10371 #ifndef LT_DLLAZY_OR_NOW
10372 # ifdef RTLD_LAZY
10373 # define LT_DLLAZY_OR_NOW RTLD_LAZY
10374 # else
10375 # ifdef DL_LAZY
10376 # define LT_DLLAZY_OR_NOW DL_LAZY
10377 # else
10378 # ifdef RTLD_NOW
10379 # define LT_DLLAZY_OR_NOW RTLD_NOW
10380 # else
10381 # ifdef DL_NOW
10382 # define LT_DLLAZY_OR_NOW DL_NOW
10383 # else
10384 # define LT_DLLAZY_OR_NOW 0
10385 # endif
10386 # endif
10387 # endif
10388 # endif
10389 #endif
10390
10391 void fnord() { int i=42;}
10392 int main ()
10393 {
10394 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
10395 int status = $lt_dlunknown;
10396
10397 if (self)
10398 {
10399 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
10400 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
10401 /* dlclose (self); */
10402 }
10403 else
10404 puts (dlerror ());
10405
10406 return status;
10407 }
10408 _LT_EOF
10409 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
10410 (eval $ac_link) 2>&5
10411 ac_status=$?
10412 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10413 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
10414 (./conftest; exit; ) >&5 2>/dev/null
10415 lt_status=$?
10416 case x$lt_status in
10417 x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
10418 x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
10419 x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
10420 esac
10421 else :
10422 # compilation failed
10423 lt_cv_dlopen_self_static=no
10424 fi
10425 fi
10426 rm -fr conftest*
10427
10428
10429 fi
10430 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
10431 $as_echo "$lt_cv_dlopen_self_static" >&6; }
10432 fi
10433
10434 CPPFLAGS="$save_CPPFLAGS"
10435 LDFLAGS="$save_LDFLAGS"
10436 LIBS="$save_LIBS"
10437 ;;
10438 esac
10439
10440 case $lt_cv_dlopen_self in
10441 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
10442 *) enable_dlopen_self=unknown ;;
10443 esac
10444
10445 case $lt_cv_dlopen_self_static in
10446 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
10447 *) enable_dlopen_self_static=unknown ;;
10448 esac
10449 fi
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467 striplib=
10468 old_striplib=
10469 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
10470 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
10471 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
10472 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
10473 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
10474 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
10475 $as_echo "yes" >&6; }
10476 else
10477 # FIXME - insert some real tests, host_os isn't really good enough
10478 case $host_os in
10479 darwin*)
10480 if test -n "$STRIP" ; then
10481 striplib="$STRIP -x"
10482 old_striplib="$STRIP -S"
10483 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
10484 $as_echo "yes" >&6; }
10485 else
10486 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10487 $as_echo "no" >&6; }
10488 fi
10489 ;;
10490 *)
10491 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10492 $as_echo "no" >&6; }
10493 ;;
10494 esac
10495 fi
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508 # Report which library types will actually be built
10509 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
10510 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
10511 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
10512 $as_echo "$can_build_shared" >&6; }
10513
10514 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
10515 $as_echo_n "checking whether to build shared libraries... " >&6; }
10516 test "$can_build_shared" = "no" && enable_shared=no
10517
10518 # On AIX, shared libraries and static libraries use the same namespace, and
10519 # are all built from PIC.
10520 case $host_os in
10521 aix3*)
10522 test "$enable_shared" = yes && enable_static=no
10523 if test -n "$RANLIB"; then
10524 archive_cmds="$archive_cmds~\$RANLIB \$lib"
10525 postinstall_cmds='$RANLIB $lib'
10526 fi
10527 ;;
10528
10529 aix[4-9]*)
10530 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
10531 test "$enable_shared" = yes && enable_static=no
10532 fi
10533 ;;
10534 esac
10535 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
10536 $as_echo "$enable_shared" >&6; }
10537
10538 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
10539 $as_echo_n "checking whether to build static libraries... " >&6; }
10540 # Make sure either enable_shared or enable_static is yes.
10541 test "$enable_shared" = yes || enable_static=yes
10542 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
10543 $as_echo "$enable_static" >&6; }
10544
10545
10546
10547
10548 fi
10549 ac_ext=c
10550 ac_cpp='$CPP $CPPFLAGS'
10551 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10552 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10553 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10554
10555 CC="$lt_save_CC"
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569 ac_config_commands="$ac_config_commands libtool"
10570
10571
10572
10573
10574 # Only expand once:
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which extension is used for runtime loadable modules" >&5
10586 $as_echo_n "checking which extension is used for runtime loadable modules... " >&6; }
10587 if test "${libltdl_cv_shlibext+set}" = set; then :
10588 $as_echo_n "(cached) " >&6
10589 else
10590
10591 module=yes
10592 eval libltdl_cv_shlibext=$shrext_cmds
10593
10594 fi
10595 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5
10596 $as_echo "$libltdl_cv_shlibext" >&6; }
10597 if test -n "$libltdl_cv_shlibext"; then
10598
10599 cat >>confdefs.h <<_ACEOF
10600 #define LT_MODULE_EXT "$libltdl_cv_shlibext"
10601 _ACEOF
10602
10603 fi
10604
10605 { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variable specifies run-time module search path" >&5
10606 $as_echo_n "checking which variable specifies run-time module search path... " >&6; }
10607 if test "${lt_cv_module_path_var+set}" = set; then :
10608 $as_echo_n "(cached) " >&6
10609 else
10610 lt_cv_module_path_var="$shlibpath_var"
10611 fi
10612 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5
10613 $as_echo "$lt_cv_module_path_var" >&6; }
10614 if test -n "$lt_cv_module_path_var"; then
10615
10616 cat >>confdefs.h <<_ACEOF
10617 #define LT_MODULE_PATH_VAR "$lt_cv_module_path_var"
10618 _ACEOF
10619
10620 fi
10621
10622 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5
10623 $as_echo_n "checking for the default library search path... " >&6; }
10624 if test "${lt_cv_sys_dlsearch_path+set}" = set; then :
10625 $as_echo_n "(cached) " >&6
10626 else
10627 lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"
10628 fi
10629 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5
10630 $as_echo "$lt_cv_sys_dlsearch_path" >&6; }
10631 if test -n "$lt_cv_sys_dlsearch_path"; then
10632 sys_dlsearch_path=
10633 for dir in $lt_cv_sys_dlsearch_path; do
10634 if test -z "$sys_dlsearch_path"; then
10635 sys_dlsearch_path="$dir"
10636 else
10637 sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir"
10638 fi
10639 done
10640
10641 cat >>confdefs.h <<_ACEOF
10642 #define LT_DLSEARCH_PATH "$sys_dlsearch_path"
10643 _ACEOF
10644
10645 fi
10646
10647
10648 LT_DLLOADERS=
10649
10650
10651 ac_ext=c
10652 ac_cpp='$CPP $CPPFLAGS'
10653 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10654 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10655 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10656
10657
10658 LIBADD_DLOPEN=
10659 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
10660 $as_echo_n "checking for library containing dlopen... " >&6; }
10661 if test "${ac_cv_search_dlopen+set}" = set; then :
10662 $as_echo_n "(cached) " >&6
10663 else
10664 ac_func_search_save_LIBS=$LIBS
10665 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10666 /* end confdefs.h. */
10667
10668 /* Override any GCC internal prototype to avoid an error.
10669 Use char because int might match the return type of a GCC
10670 builtin and then its argument prototype would still apply. */
10671 #ifdef __cplusplus
10672 extern "C"
10673 #endif
10674 char dlopen ();
10675 int
10676 main ()
10677 {
10678 return dlopen ();
10679 ;
10680 return 0;
10681 }
10682 _ACEOF
10683 for ac_lib in '' dl; do
10684 if test -z "$ac_lib"; then
10685 ac_res="none required"
10686 else
10687 ac_res=-l$ac_lib
10688 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
10689 fi
10690 if ac_fn_c_try_link "$LINENO"; then :
10691 ac_cv_search_dlopen=$ac_res
10692 fi
10693 rm -f core conftest.err conftest.$ac_objext \
10694 conftest$ac_exeext
10695 if test "${ac_cv_search_dlopen+set}" = set; then :
10696 break
10697 fi
10698 done
10699 if test "${ac_cv_search_dlopen+set}" = set; then :
10700
10701 else
10702 ac_cv_search_dlopen=no
10703 fi
10704 rm conftest.$ac_ext
10705 LIBS=$ac_func_search_save_LIBS
10706 fi
10707 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
10708 $as_echo "$ac_cv_search_dlopen" >&6; }
10709 ac_res=$ac_cv_search_dlopen
10710 if test "$ac_res" != no; then :
10711 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
10712
10713 $as_echo "#define HAVE_LIBDL 1" >>confdefs.h
10714
10715 if test "$ac_cv_search_dlopen" != "none required" ; then
10716 LIBADD_DLOPEN="-ldl"
10717 fi
10718 libltdl_cv_lib_dl_dlopen="yes"
10719 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"
10720 else
10721 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10722 /* end confdefs.h. */
10723 #if HAVE_DLFCN_H
10724 # include <dlfcn.h>
10725 #endif
10726
10727 int
10728 main ()
10729 {
10730 dlopen(0, 0);
10731 ;
10732 return 0;
10733 }
10734 _ACEOF
10735 if ac_fn_c_try_link "$LINENO"; then :
10736
10737 $as_echo "#define HAVE_LIBDL 1" >>confdefs.h
10738
10739 libltdl_cv_func_dlopen="yes"
10740 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"
10741 else
10742 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
10743 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
10744 if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
10745 $as_echo_n "(cached) " >&6
10746 else
10747 ac_check_lib_save_LIBS=$LIBS
10748 LIBS="-lsvld $LIBS"
10749 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10750 /* end confdefs.h. */
10751
10752 /* Override any GCC internal prototype to avoid an error.
10753 Use char because int might match the return type of a GCC
10754 builtin and then its argument prototype would still apply. */
10755 #ifdef __cplusplus
10756 extern "C"
10757 #endif
10758 char dlopen ();
10759 int
10760 main ()
10761 {
10762 return dlopen ();
10763 ;
10764 return 0;
10765 }
10766 _ACEOF
10767 if ac_fn_c_try_link "$LINENO"; then :
10768 ac_cv_lib_svld_dlopen=yes
10769 else
10770 ac_cv_lib_svld_dlopen=no
10771 fi
10772 rm -f core conftest.err conftest.$ac_objext \
10773 conftest$ac_exeext conftest.$ac_ext
10774 LIBS=$ac_check_lib_save_LIBS
10775 fi
10776 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
10777 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
10778 if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
10779
10780 $as_echo "#define HAVE_LIBDL 1" >>confdefs.h
10781
10782 LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes"
10783 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"
10784 fi
10785
10786 fi
10787 rm -f core conftest.err conftest.$ac_objext \
10788 conftest$ac_exeext conftest.$ac_ext
10789 fi
10790
10791 if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
10792 then
10793 lt_save_LIBS="$LIBS"
10794 LIBS="$LIBS $LIBADD_DLOPEN"
10795 for ac_func in dlerror
10796 do :
10797 ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror"
10798 if test "x$ac_cv_func_dlerror" = x""yes; then :
10799 cat >>confdefs.h <<_ACEOF
10800 #define HAVE_DLERROR 1
10801 _ACEOF
10802
10803 fi
10804 done
10805
10806 LIBS="$lt_save_LIBS"
10807 fi
10808
10809
10810 LIBADD_SHL_LOAD=
10811 ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
10812 if test "x$ac_cv_func_shl_load" = x""yes; then :
10813
10814 $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h
10815
10816 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"
10817 else
10818 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
10819 $as_echo_n "checking for shl_load in -ldld... " >&6; }
10820 if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
10821 $as_echo_n "(cached) " >&6
10822 else
10823 ac_check_lib_save_LIBS=$LIBS
10824 LIBS="-ldld $LIBS"
10825 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10826 /* end confdefs.h. */
10827
10828 /* Override any GCC internal prototype to avoid an error.
10829 Use char because int might match the return type of a GCC
10830 builtin and then its argument prototype would still apply. */
10831 #ifdef __cplusplus
10832 extern "C"
10833 #endif
10834 char shl_load ();
10835 int
10836 main ()
10837 {
10838 return shl_load ();
10839 ;
10840 return 0;
10841 }
10842 _ACEOF
10843 if ac_fn_c_try_link "$LINENO"; then :
10844 ac_cv_lib_dld_shl_load=yes
10845 else
10846 ac_cv_lib_dld_shl_load=no
10847 fi
10848 rm -f core conftest.err conftest.$ac_objext \
10849 conftest$ac_exeext conftest.$ac_ext
10850 LIBS=$ac_check_lib_save_LIBS
10851 fi
10852 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
10853 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
10854 if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
10855
10856 $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h
10857
10858 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"
10859 LIBADD_SHL_LOAD="-ldld"
10860 fi
10861
10862 fi
10863
10864
10865
10866 case $host_os in
10867 darwin[1567].*)
10868 # We only want this for pre-Mac OS X 10.4.
10869 ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup"
10870 if test "x$ac_cv_func__dyld_func_lookup" = x""yes; then :
10871
10872 $as_echo "#define HAVE_DYLD 1" >>confdefs.h
10873
10874 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"
10875 fi
10876
10877 ;;
10878 beos*)
10879 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la"
10880 ;;
10881 cygwin* | mingw* | os2* | pw32*)
10882 ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include <sys/cygwin.h>
10883 "
10884 if test "x$ac_cv_have_decl_cygwin_conv_path" = x""yes; then :
10885 ac_have_decl=1
10886 else
10887 ac_have_decl=0
10888 fi
10889
10890 cat >>confdefs.h <<_ACEOF
10891 #define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl
10892 _ACEOF
10893
10894 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la"
10895 ;;
10896 esac
10897
10898 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
10899 $as_echo_n "checking for dld_link in -ldld... " >&6; }
10900 if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
10901 $as_echo_n "(cached) " >&6
10902 else
10903 ac_check_lib_save_LIBS=$LIBS
10904 LIBS="-ldld $LIBS"
10905 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10906 /* end confdefs.h. */
10907
10908 /* Override any GCC internal prototype to avoid an error.
10909 Use char because int might match the return type of a GCC
10910 builtin and then its argument prototype would still apply. */
10911 #ifdef __cplusplus
10912 extern "C"
10913 #endif
10914 char dld_link ();
10915 int
10916 main ()
10917 {
10918 return dld_link ();
10919 ;
10920 return 0;
10921 }
10922 _ACEOF
10923 if ac_fn_c_try_link "$LINENO"; then :
10924 ac_cv_lib_dld_dld_link=yes
10925 else
10926 ac_cv_lib_dld_dld_link=no
10927 fi
10928 rm -f core conftest.err conftest.$ac_objext \
10929 conftest$ac_exeext conftest.$ac_ext
10930 LIBS=$ac_check_lib_save_LIBS
10931 fi
10932 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
10933 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
10934 if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
10935
10936 $as_echo "#define HAVE_DLD 1" >>confdefs.h
10937
10938 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"
10939 fi
10940
10941
10942
10943
10944 LT_DLPREOPEN=
10945 if test -n "$LT_DLLOADERS"
10946 then
10947 for lt_loader in $LT_DLLOADERS; do
10948 LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader "
10949 done
10950
10951 $as_echo "#define HAVE_LIBDLLOADER 1" >>confdefs.h
10952
10953 fi
10954
10955
10956 LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD"
10957
10958
10959 ac_ext=c
10960 ac_cpp='$CPP $CPPFLAGS'
10961 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10962 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10963 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10964
10965
10966 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5
10967 $as_echo_n "checking for _ prefix in compiled symbols... " >&6; }
10968 if test "${lt_cv_sys_symbol_underscore+set}" = set; then :
10969 $as_echo_n "(cached) " >&6
10970 else
10971 lt_cv_sys_symbol_underscore=no
10972 cat > conftest.$ac_ext <<_LT_EOF
10973 void nm_test_func(){}
10974 int main(){nm_test_func;return 0;}
10975 _LT_EOF
10976 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
10977 (eval $ac_compile) 2>&5
10978 ac_status=$?
10979 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10980 test $ac_status = 0; }; then
10981 # Now try to grab the symbols.
10982 ac_nlist=conftest.nm
10983 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5
10984 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5
10985 ac_status=$?
10986 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10987 test $ac_status = 0; } && test -s "$ac_nlist"; then
10988 # See whether the symbols have a leading underscore.
10989 if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
10990 lt_cv_sys_symbol_underscore=yes
10991 else
10992 if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
10993 :
10994 else
10995 echo "configure: cannot find nm_test_func in $ac_nlist" >&5
10996 fi
10997 fi
10998 else
10999 echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5
11000 fi
11001 else
11002 echo "configure: failed program was:" >&5
11003 cat conftest.c >&5
11004 fi
11005 rm -rf conftest*
11006
11007 fi
11008 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5
11009 $as_echo "$lt_cv_sys_symbol_underscore" >&6; }
11010 sys_symbol_underscore=$lt_cv_sys_symbol_underscore
11011
11012
11013 if test x"$lt_cv_sys_symbol_underscore" = xyes; then
11014 if test x"$libltdl_cv_func_dlopen" = xyes ||
11015 test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
11016 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5
11017 $as_echo_n "checking whether we have to add an underscore for dlsym... " >&6; }
11018 if test "${libltdl_cv_need_uscore+set}" = set; then :
11019 $as_echo_n "(cached) " >&6
11020 else
11021 libltdl_cv_need_uscore=unknown
11022 save_LIBS="$LIBS"
11023 LIBS="$LIBS $LIBADD_DLOPEN"
11024 if test "$cross_compiling" = yes; then :
11025 libltdl_cv_need_uscore=cross
11026 else
11027 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11028 lt_status=$lt_dlunknown
11029 cat > conftest.$ac_ext <<_LT_EOF
11030 #line 11031 "configure"
11031 #include "confdefs.h"
11032
11033 #if HAVE_DLFCN_H
11034 #include <dlfcn.h>
11035 #endif
11036
11037 #include <stdio.h>
11038
11039 #ifdef RTLD_GLOBAL
11040 # define LT_DLGLOBAL RTLD_GLOBAL
11041 #else
11042 # ifdef DL_GLOBAL
11043 # define LT_DLGLOBAL DL_GLOBAL
11044 # else
11045 # define LT_DLGLOBAL 0
11046 # endif
11047 #endif
11048
11049 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
11050 find out it does not work in some platform. */
11051 #ifndef LT_DLLAZY_OR_NOW
11052 # ifdef RTLD_LAZY
11053 # define LT_DLLAZY_OR_NOW RTLD_LAZY
11054 # else
11055 # ifdef DL_LAZY
11056 # define LT_DLLAZY_OR_NOW DL_LAZY
11057 # else
11058 # ifdef RTLD_NOW
11059 # define LT_DLLAZY_OR_NOW RTLD_NOW
11060 # else
11061 # ifdef DL_NOW
11062 # define LT_DLLAZY_OR_NOW DL_NOW
11063 # else
11064 # define LT_DLLAZY_OR_NOW 0
11065 # endif
11066 # endif
11067 # endif
11068 # endif
11069 #endif
11070
11071 void fnord() { int i=42;}
11072 int main ()
11073 {
11074 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
11075 int status = $lt_dlunknown;
11076
11077 if (self)
11078 {
11079 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
11080 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
11081 /* dlclose (self); */
11082 }
11083 else
11084 puts (dlerror ());
11085
11086 return status;
11087 }
11088 _LT_EOF
11089 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
11090 (eval $ac_link) 2>&5
11091 ac_status=$?
11092 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11093 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
11094 (./conftest; exit; ) >&5 2>/dev/null
11095 lt_status=$?
11096 case x$lt_status in
11097 x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;;
11098 x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;;
11099 x$lt_dlunknown|x*) ;;
11100 esac
11101 else :
11102 # compilation failed
11103
11104 fi
11105 fi
11106 rm -fr conftest*
11107
11108 LIBS="$save_LIBS"
11109
11110 fi
11111 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5
11112 $as_echo "$libltdl_cv_need_uscore" >&6; }
11113 fi
11114 fi
11115
11116 if test x"$libltdl_cv_need_uscore" = xyes; then
11117
11118 $as_echo "#define NEED_USCORE 1" >>confdefs.h
11119
11120 fi
11121
11122 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5
11123 $as_echo_n "checking whether deplibs are loaded by dlopen... " >&6; }
11124 if test "${lt_cv_sys_dlopen_deplibs+set}" = set; then :
11125 $as_echo_n "(cached) " >&6
11126 else
11127 # PORTME does your system automatically load deplibs for dlopen?
11128 # or its logical equivalent (e.g. shl_load for HP-UX < 11)
11129 # For now, we just catch OSes we know something about -- in the
11130 # future, we'll try test this programmatically.
11131 lt_cv_sys_dlopen_deplibs=unknown
11132 case $host_os in
11133 aix3*|aix4.1.*|aix4.2.*)
11134 # Unknown whether this is true for these versions of AIX, but
11135 # we want this `case' here to explicitly catch those versions.
11136 lt_cv_sys_dlopen_deplibs=unknown
11137 ;;
11138 aix[4-9]*)
11139 lt_cv_sys_dlopen_deplibs=yes
11140 ;;
11141 amigaos*)
11142 case $host_cpu in
11143 powerpc)
11144 lt_cv_sys_dlopen_deplibs=no
11145 ;;
11146 esac
11147 ;;
11148 darwin*)
11149 # Assuming the user has installed a libdl from somewhere, this is true
11150 # If you are looking for one http://www.opendarwin.org/projects/dlcompat
11151 lt_cv_sys_dlopen_deplibs=yes
11152 ;;
11153 freebsd* | dragonfly*)
11154 lt_cv_sys_dlopen_deplibs=yes
11155 ;;
11156 gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
11157 # GNU and its variants, using gnu ld.so (Glibc)
11158 lt_cv_sys_dlopen_deplibs=yes
11159 ;;
11160 hpux10*|hpux11*)
11161 lt_cv_sys_dlopen_deplibs=yes
11162 ;;
11163 interix*)
11164 lt_cv_sys_dlopen_deplibs=yes
11165 ;;
11166 irix[12345]*|irix6.[01]*)
11167 # Catch all versions of IRIX before 6.2, and indicate that we don't
11168 # know how it worked for any of those versions.
11169 lt_cv_sys_dlopen_deplibs=unknown
11170 ;;
11171 irix*)
11172 # The case above catches anything before 6.2, and it's known that
11173 # at 6.2 and later dlopen does load deplibs.
11174 lt_cv_sys_dlopen_deplibs=yes
11175 ;;
11176 netbsd* | netbsdelf*-gnu)
11177 lt_cv_sys_dlopen_deplibs=yes
11178 ;;
11179 openbsd*)
11180 lt_cv_sys_dlopen_deplibs=yes
11181 ;;
11182 osf[1234]*)
11183 # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
11184 # it did *not* use an RPATH in a shared library to find objects the
11185 # library depends on, so we explicitly say `no'.
11186 lt_cv_sys_dlopen_deplibs=no
11187 ;;
11188 osf5.0|osf5.0a|osf5.1)
11189 # dlopen *does* load deplibs and with the right loader patch applied
11190 # it even uses RPATH in a shared library to search for shared objects
11191 # that the library depends on, but there's no easy way to know if that
11192 # patch is installed. Since this is the case, all we can really
11193 # say is unknown -- it depends on the patch being installed. If
11194 # it is, this changes to `yes'. Without it, it would be `no'.
11195 lt_cv_sys_dlopen_deplibs=unknown
11196 ;;
11197 osf*)
11198 # the two cases above should catch all versions of osf <= 5.1. Read
11199 # the comments above for what we know about them.
11200 # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
11201 # is used to find them so we can finally say `yes'.
11202 lt_cv_sys_dlopen_deplibs=yes
11203 ;;
11204 qnx*)
11205 lt_cv_sys_dlopen_deplibs=yes
11206 ;;
11207 solaris*)
11208 lt_cv_sys_dlopen_deplibs=yes
11209 ;;
11210 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
11211 libltdl_cv_sys_dlopen_deplibs=yes
11212 ;;
11213 esac
11214
11215 fi
11216 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5
11217 $as_echo "$lt_cv_sys_dlopen_deplibs" >&6; }
11218 if test "$lt_cv_sys_dlopen_deplibs" != yes; then
11219
11220 $as_echo "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h
11221
11222 fi
11223
11224 :
11225
11226 for ac_header in argz.h
11227 do :
11228 ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default
11229 "
11230 if test "x$ac_cv_header_argz_h" = x""yes; then :
11231 cat >>confdefs.h <<_ACEOF
11232 #define HAVE_ARGZ_H 1
11233 _ACEOF
11234
11235 fi
11236
11237 done
11238
11239
11240 ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H)
11241 # include <argz.h>
11242 #endif
11243 "
11244 if test "x$ac_cv_type_error_t" = x""yes; then :
11245
11246 cat >>confdefs.h <<_ACEOF
11247 #define HAVE_ERROR_T 1
11248 _ACEOF
11249
11250
11251 else
11252
11253 $as_echo "#define error_t int" >>confdefs.h
11254
11255
11256 $as_echo "#define __error_t_defined 1" >>confdefs.h
11257
11258 fi
11259
11260
11261 ARGZ_H=
11262 for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert \
11263 argz_next argz_stringify
11264 do :
11265 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
11266 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
11267 eval as_val=\$$as_ac_var
11268 if test "x$as_val" = x""yes; then :
11269 cat >>confdefs.h <<_ACEOF
11270 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
11271 _ACEOF
11272
11273 else
11274 ARGZ_H=argz.h;
11275
11276 _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext"
11277
11278 fi
11279 done
11280
11281
11282 if test -z "$ARGZ_H"; then :
11283 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5
11284 $as_echo_n "checking if argz actually works... " >&6; }
11285 if test "${lt_cv_sys_argz_works+set}" = set; then :
11286 $as_echo_n "(cached) " >&6
11287 else
11288 case $host_os in #(
11289 *cygwin*)
11290 lt_cv_sys_argz_works=no
11291 if test "$cross_compiling" != no; then
11292 lt_cv_sys_argz_works="guessing no"
11293 else
11294 lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/'
11295 save_IFS=$IFS
11296 IFS=-.
11297 set x `uname -r | sed -e "$lt_sed_extract_leading_digits"`
11298 IFS=$save_IFS
11299 lt_os_major=${2-0}
11300 lt_os_minor=${3-0}
11301 lt_os_micro=${4-0}
11302 if test "$lt_os_major" -gt 1 \
11303 || { test "$lt_os_major" -eq 1 \
11304 && { test "$lt_os_minor" -gt 5 \
11305 || { test "$lt_os_minor" -eq 5 \
11306 && test "$lt_os_micro" -gt 24; }; }; }; then
11307 lt_cv_sys_argz_works=yes
11308 fi
11309 fi
11310 ;; #(
11311 *) lt_cv_sys_argz_works=yes ;;
11312 esac
11313 fi
11314 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5
11315 $as_echo "$lt_cv_sys_argz_works" >&6; }
11316 if test $lt_cv_sys_argz_works = yes; then :
11317
11318 $as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h
11319
11320 else
11321 ARGZ_H=argz.h
11322
11323
11324 _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext"
11325
11326 fi
11327 fi
11328
11329
11330
11331 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5
11332 $as_echo_n "checking whether libtool supports -dlopen/-dlpreopen... " >&6; }
11333 if test "${libltdl_cv_preloaded_symbols+set}" = set; then :
11334 $as_echo_n "(cached) " >&6
11335 else
11336 if test -n "$lt_cv_sys_global_symbol_pipe"; then
11337 libltdl_cv_preloaded_symbols=yes
11338 else
11339 libltdl_cv_preloaded_symbols=no
11340 fi
11341
11342 fi
11343 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5
11344 $as_echo "$libltdl_cv_preloaded_symbols" >&6; }
11345 if test x"$libltdl_cv_preloaded_symbols" = xyes; then
11346
11347 $as_echo "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h
11348
11349 fi
11350
11351 # Set options
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363 # Check whether --with-included_ltdl was given.
11364 if test "${with_included_ltdl+set}" = set; then :
11365 withval=$with_included_ltdl;
11366 fi
11367
11368
11369 if test "x$with_included_ltdl" != xyes; then
11370 # We are not being forced to use the included libltdl sources, so
11371 # decide whether there is a useful installed version we can use.
11372 ac_fn_c_check_header_compile "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default
11373
11374 "
11375 if test "x$ac_cv_header_ltdl_h" = x""yes; then :
11376 ac_fn_c_check_decl "$LINENO" "lt_dlinterface_register" "ac_cv_have_decl_lt_dlinterface_register" "$ac_includes_default
11377 #include <ltdl.h>
11378 "
11379 if test "x$ac_cv_have_decl_lt_dlinterface_register" = x""yes; then :
11380 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dladvise_preload in -lltdl" >&5
11381 $as_echo_n "checking for lt_dladvise_preload in -lltdl... " >&6; }
11382 if test "${ac_cv_lib_ltdl_lt_dladvise_preload+set}" = set; then :
11383 $as_echo_n "(cached) " >&6
11384 else
11385 ac_check_lib_save_LIBS=$LIBS
11386 LIBS="-lltdl $LIBS"
11387 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11388 /* end confdefs.h. */
11389
11390 /* Override any GCC internal prototype to avoid an error.
11391 Use char because int might match the return type of a GCC
11392 builtin and then its argument prototype would still apply. */
11393 #ifdef __cplusplus
11394 extern "C"
11395 #endif
11396 char lt_dladvise_preload ();
11397 int
11398 main ()
11399 {
11400 return lt_dladvise_preload ();
11401 ;
11402 return 0;
11403 }
11404 _ACEOF
11405 if ac_fn_c_try_link "$LINENO"; then :
11406 ac_cv_lib_ltdl_lt_dladvise_preload=yes
11407 else
11408 ac_cv_lib_ltdl_lt_dladvise_preload=no
11409 fi
11410 rm -f core conftest.err conftest.$ac_objext \
11411 conftest$ac_exeext conftest.$ac_ext
11412 LIBS=$ac_check_lib_save_LIBS
11413 fi
11414 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dladvise_preload" >&5
11415 $as_echo "$ac_cv_lib_ltdl_lt_dladvise_preload" >&6; }
11416 if test "x$ac_cv_lib_ltdl_lt_dladvise_preload" = x""yes; then :
11417 with_included_ltdl=no
11418 else
11419 with_included_ltdl=yes
11420 fi
11421
11422 else
11423 with_included_ltdl=yes
11424 fi
11425
11426 else
11427 with_included_ltdl=yes
11428 fi
11429
11430
11431 fi
11432
11433
11434
11435
11436 # Check whether --with-ltdl_include was given.
11437 if test "${with_ltdl_include+set}" = set; then :
11438 withval=$with_ltdl_include;
11439 fi
11440
11441
11442 if test -n "$with_ltdl_include"; then
11443 if test -f "$with_ltdl_include/ltdl.h"; then :
11444 else
11445 as_fn_error "invalid ltdl include directory: \`$with_ltdl_include'" "$LINENO" 5
11446 fi
11447 else
11448 with_ltdl_include=no
11449 fi
11450
11451
11452 # Check whether --with-ltdl_lib was given.
11453 if test "${with_ltdl_lib+set}" = set; then :
11454 withval=$with_ltdl_lib;
11455 fi
11456
11457
11458 if test -n "$with_ltdl_lib"; then
11459 if test -f "$with_ltdl_lib/libltdl.la"; then :
11460 else
11461 as_fn_error "invalid ltdl library directory: \`$with_ltdl_lib'" "$LINENO" 5
11462 fi
11463 else
11464 with_ltdl_lib=no
11465 fi
11466
11467 case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in
11468 ,yes,no,no,)
11469 case $enable_ltdl_convenience in
11470 no) as_fn_error "this package needs a convenience libltdl" "$LINENO" 5 ;;
11471 "") enable_ltdl_convenience=yes
11472 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
11473 esac
11474 LIBLTDL='${top_build_prefix}'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la"
11475 LTDLDEPS=$LIBLTDL
11476 LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
11477
11478
11479
11480
11481
11482 # For backwards non-gettext consistent compatibility...
11483 INCLTDL="$LTDLINCL"
11484
11485
11486 ;;
11487 ,no,no,no,)
11488 # If the included ltdl is not to be used, then use the
11489 # preinstalled libltdl we found.
11490
11491 $as_echo "#define HAVE_LTDL 1" >>confdefs.h
11492
11493 LIBLTDL=-lltdl
11494 LTDLDEPS=
11495 LTDLINCL=
11496 ;;
11497 ,no*,no,*)
11498 as_fn_error "\`--with-ltdl-include' and \`--with-ltdl-lib' options must be used together" "$LINENO" 5
11499 ;;
11500 *) with_included_ltdl=no
11501 LIBLTDL="-L$with_ltdl_lib -lltdl"
11502 LTDLDEPS=
11503 LTDLINCL="-I$with_ltdl_include"
11504 ;;
11505 esac
11506 INCLTDL="$LTDLINCL"
11507
11508 # Report our decision...
11509 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl headers" >&5
11510 $as_echo_n "checking where to find libltdl headers... " >&6; }
11511 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTDLINCL" >&5
11512 $as_echo "$LTDLINCL" >&6; }
11513 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl library" >&5
11514 $as_echo_n "checking where to find libltdl library... " >&6; }
11515 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBLTDL" >&5
11516 $as_echo "$LIBLTDL" >&6; }
11517
11518
11519
11520 # Check whether --enable-ltdl-install was given.
11521 if test "${enable_ltdl_install+set}" = set; then :
11522 enableval=$enable_ltdl_install;
11523 fi
11524
11525
11526 case ,${enable_ltdl_install},${enable_ltdl_convenience} in
11527 *yes*) ;;
11528 *) enable_ltdl_convenience=yes ;;
11529 esac
11530
11531 if test x"${enable_ltdl_install-no}" != xno; then
11532 INSTALL_LTDL_TRUE=
11533 INSTALL_LTDL_FALSE='#'
11534 else
11535 INSTALL_LTDL_TRUE='#'
11536 INSTALL_LTDL_FALSE=
11537 fi
11538
11539 if test x"${enable_ltdl_convenience-no}" != xno; then
11540 CONVENIENCE_LTDL_TRUE=
11541 CONVENIENCE_LTDL_FALSE='#'
11542 else
11543 CONVENIENCE_LTDL_TRUE='#'
11544 CONVENIENCE_LTDL_FALSE=
11545 fi
11546
11547
11548
11549
11550
11551
11552
11553 # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS
11554 # the user used. This is so that ltdl.h can pick up the parent projects
11555 # config.h file, The first file in AC_CONFIG_HEADERS must contain the
11556 # definitions required by ltdl.c.
11557 # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility).
11558
11559
11560
11561 for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h
11562 do :
11563 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
11564 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
11565 "
11566 eval as_val=\$$as_ac_Header
11567 if test "x$as_val" = x""yes; then :
11568 cat >>confdefs.h <<_ACEOF
11569 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
11570 _ACEOF
11571
11572 fi
11573
11574 done
11575
11576
11577 for ac_func in closedir opendir readdir
11578 do :
11579 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
11580 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
11581 eval as_val=\$$as_ac_var
11582 if test "x$as_val" = x""yes; then :
11583 cat >>confdefs.h <<_ACEOF
11584 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
11585 _ACEOF
11586
11587 else
11588
11589
11590 _LT_LIBOBJS="$_LT_LIBOBJS lt__dirent.$ac_objext"
11591
11592 fi
11593 done
11594
11595 for ac_func in strlcat strlcpy
11596 do :
11597 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
11598 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
11599 eval as_val=\$$as_ac_var
11600 if test "x$as_val" = x""yes; then :
11601 cat >>confdefs.h <<_ACEOF
11602 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
11603 _ACEOF
11604
11605 else
11606
11607
11608 _LT_LIBOBJS="$_LT_LIBOBJS lt__strl.$ac_objext"
11609
11610 fi
11611 done
11612
11613
11614
11615 cat >>confdefs.h <<_ACEOF
11616 #define LT_LIBEXT "$libext"
11617 _ACEOF
11618
11619
11620 name=ltdl
11621 LTDLOPEN=`eval "\\$ECHO \"$libname_spec\""`
11622
11623
11624
11625
11626
11627
11628
11629
11630 # Only expand once:
11631
11632
11633
11634 case "$host" in
11635 *-*-linux*) ;;
11636 *) as_fn_error "Linux systems supported exclusively!" "$LINENO" 5;;
11637 esac
11638
11639
11640 # Check whether --with-kmod was given.
11641 if test "${with_kmod+set}" = set; then :
11642 withval=$with_kmod; BUILDKMOD="$withval";
11643 else
11644 BUILDKMOD="yes";
11645 fi
11646
11647 if test "$BUILDKMOD" == "yes"; then
11648 WITH_KMOD_TRUE=
11649 WITH_KMOD_FALSE='#'
11650 else
11651 WITH_KMOD_TRUE='#'
11652 WITH_KMOD_FALSE=
11653 fi
11654
11655
11656
11657 # Check whether --with-kbuild was given.
11658 if test "${with_kbuild+set}" = set; then :
11659 withval=$with_kbuild; KBUILDDIR="$withval";
11660 fi
11661
11662
11663 # Check whether --with-ksource was given.
11664 if test "${with_ksource+set}" = set; then :
11665 withval=$with_ksource; KSOURCEDIR="$withval";
11666 fi
11667
11668 if test "$KBUILDDIR" != ""; then
11669 WITH_KBUILDDIR_TRUE=
11670 WITH_KBUILDDIR_FALSE='#'
11671 else
11672 WITH_KBUILDDIR_TRUE='#'
11673 WITH_KBUILDDIR_FALSE=
11674 fi
11675
11676
11677
11678 if test "$BUILDKMOD" == "yes"
11679 then
11680 if test "$KBUILDDIR" != ""
11681 then
11682 kbuilddir="$KBUILDDIR"
11683 else
11684 kbuilddir="/lib/modules/`uname -r`/build"
11685 fi
11686
11687 if test -n "$KSOURCEDIR"; then
11688 ksourcedir="$KSOURCEDIR"
11689 elif test -e "$kbuilddir/include/linux/netfilter/nfnetlink.h"; then
11690 ksourcedir="$kbuilddir"
11691 else
11692 ksourcedir="/lib/modules/$(uname -r)/source"
11693 fi
11694 if test ! -e "$ksourcedir/include/linux/netfilter/nfnetlink.h"
11695 then
11696 as_fn_error "Invalid kernel source directory $ksourcedir" "$LINENO" 5
11697 fi
11698
11699 if test ! -e "$kbuilddir/.config"
11700 then
11701 as_fn_error "The kernel build directory $kbuilddir is not configured" "$LINENO" 5
11702 fi
11703
11704 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
11705 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
11706 if test "${ac_cv_path_GREP+set}" = set; then :
11707 $as_echo_n "(cached) " >&6
11708 else
11709 if test -z "$GREP"; then
11710 ac_path_GREP_found=false
11711 # Loop through the user's path and test for each of PROGNAME-LIST
11712 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11713 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
11714 do
11715 IFS=$as_save_IFS
11716 test -z "$as_dir" && as_dir=.
11717 for ac_prog in grep ggrep; do
11718 for ac_exec_ext in '' $ac_executable_extensions; do
11719 ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
11720 { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
11721 # Check for GNU ac_path_GREP and select it if it is found.
11722 # Check for GNU $ac_path_GREP
11723 case `"$ac_path_GREP" --version 2>&1` in
11724 *GNU*)
11725 ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
11726 *)
11727 ac_count=0
11728 $as_echo_n 0123456789 >"conftest.in"
11729 while :
11730 do
11731 cat "conftest.in" "conftest.in" >"conftest.tmp"
11732 mv "conftest.tmp" "conftest.in"
11733 cp "conftest.in" "conftest.nl"
11734 $as_echo 'GREP' >> "conftest.nl"
11735 "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
11736 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
11737 as_fn_arith $ac_count + 1 && ac_count=$as_val
11738 if test $ac_count -gt ${ac_path_GREP_max-0}; then
11739 # Best one so far, save it but keep looking for a better one
11740 ac_cv_path_GREP="$ac_path_GREP"
11741 ac_path_GREP_max=$ac_count
11742 fi
11743 # 10*(2^10) chars as input seems more than enough
11744 test $ac_count -gt 10 && break
11745 done
11746 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
11747 esac
11748
11749 $ac_path_GREP_found && break 3
11750 done
11751 done
11752 done
11753 IFS=$as_save_IFS
11754 if test -z "$ac_cv_path_GREP"; then
11755 as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
11756 fi
11757 else
11758 ac_cv_path_GREP=$GREP
11759 fi
11760
11761 fi
11762 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
11763 $as_echo "$ac_cv_path_GREP" >&6; }
11764 GREP="$ac_cv_path_GREP"
11765
11766
11767
11768 if test "X`$GREP 'NFNL_SUBSYS_IPSET' $ksourcedir/include/linux/netfilter/nfnetlink.h`" = "X"
11769 then
11770 as_fn_error "The kernel source directory $ksourcedir is not patched with netlink.patch to support ipset" "$LINENO" 5
11771 fi
11772 fi
11773
11774
11775 # Check whether --with-maxsets was given.
11776 if test "${with_maxsets+set}" = set; then :
11777 withval=$with_maxsets; MAXSETS="$withval";
11778 fi
11779
11780 if test "$MAXSETS" != ""; then
11781 WITH_MAXSETS_TRUE=
11782 WITH_MAXSETS_FALSE='#'
11783 else
11784 WITH_MAXSETS_TRUE='#'
11785 WITH_MAXSETS_FALSE=
11786 fi
11787
11788
11789
11790 # Check whether --enable-verbose was given.
11791 if test "${enable_verbose+set}" = set; then :
11792 enableval=$enable_verbose; case "${enableval}" in
11793 yes) enable_verbose=yes ;;
11794 no) enable_verbose=no ;;
11795 *) as_fn_error "bad value ${enableval} for --enable-verbose" "$LINENO" 5 ;;
11796 esac
11797 else
11798 enable_verbose=no
11799 fi
11800
11801
11802 if test "x$enable_verbose" = xyes; then
11803 ENABLE_VERBOSE_TRUE=
11804 ENABLE_VERBOSE_FALSE='#'
11805 else
11806 ENABLE_VERBOSE_TRUE='#'
11807 ENABLE_VERBOSE_FALSE=
11808 fi
11809
11810
11811 # Check whether --enable-debug was given.
11812 if test "${enable_debug+set}" = set; then :
11813 enableval=$enable_debug; case "${enableval}" in
11814 yes) enable_verbose=yes ;;
11815 no) enable_verbose=no ;;
11816 *) as_fn_error "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;;
11817 esac
11818 else
11819 enable_debug=no
11820 fi
11821
11822
11823 if test "x$enable_debug" = xyes; then
11824 ENABLE_DEBUG_TRUE=
11825 ENABLE_DEBUG_FALSE='#'
11826 else
11827 ENABLE_DEBUG_TRUE='#'
11828 ENABLE_DEBUG_FALSE=
11829 fi
11830
11831
11832 # Check whether --enable-settype_modules was given.
11833 if test "${enable_settype_modules+set}" = set; then :
11834 enableval=$enable_settype_modules; enable_settype_modules="$enableval"
11835 else
11836 enable_settype_modules="no"
11837 fi
11838
11839
11840
11841 # Check whether --with-settype_modules_list was given.
11842 if test "${with_settype_modules_list+set}" = set; then :
11843 withval=$with_settype_modules_list; SETTYPE_MODLIST_RAW="$withval";
11844 fi
11845
11846
11847 SETTYPE_MODLIST=
11848 if test "x$enable_settype_modules" = "xyes"; then
11849 for mod in $SETTYPE_MODLIST_RAW; do
11850 if echo $mod | grep "all"; then
11851 m="${mod}"
11852 else
11853 if echo $mod | grep "ipset_"; then
11854 m="${mod}.c"
11855 else
11856 m="ipset_${mod}.c"
11857 fi
11858 fi
11859
11860 SETTYPE_MODLIST="${SETTYPE_MODLIST} $m"
11861 done
11862
11863 { $as_echo "$as_me:${as_lineno-$LINENO}: result: checking for configuration with dynamic loading modules... $SETTYPE_MODLIST_RAW" >&5
11864 $as_echo "checking for configuration with dynamic loading modules... $SETTYPE_MODLIST_RAW" >&6; }
11865 fi
11866
11867
11868 if test "x$enable_settype_modules" = xyes; then
11869 ENABLE_SETTYPE_MODULES_TRUE=
11870 ENABLE_SETTYPE_MODULES_FALSE='#'
11871 else
11872 ENABLE_SETTYPE_MODULES_TRUE='#'
11873 ENABLE_SETTYPE_MODULES_FALSE=
11874 fi
11875
11876
11877 if test "x$enable_static" = xyes; then
11878 ENABLE_STATIC_TRUE=
11879 ENABLE_STATIC_FALSE='#'
11880 else
11881 ENABLE_STATIC_TRUE='#'
11882 ENABLE_STATIC_FALSE=
11883 fi
11884
11885 if test "x$enable_shared" = xyes; then
11886 ENABLE_SHARED_TRUE=
11887 ENABLE_SHARED_FALSE='#'
11888 else
11889 ENABLE_SHARED_TRUE='#'
11890 ENABLE_SHARED_FALSE=
11891 fi
11892
11893
11894 : ${CFLAGS=""}
11895
11896 ac_ext=c
11897 ac_cpp='$CPP $CPPFLAGS'
11898 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
11899 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
11900 ac_compiler_gnu=$ac_cv_c_compiler_gnu
11901 if test -n "$ac_tool_prefix"; then
11902 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
11903 set dummy ${ac_tool_prefix}gcc; ac_word=$2
11904 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11905 $as_echo_n "checking for $ac_word... " >&6; }
11906 if test "${ac_cv_prog_CC+set}" = set; then :
11907 $as_echo_n "(cached) " >&6
11908 else
11909 if test -n "$CC"; then
11910 ac_cv_prog_CC="$CC" # Let the user override the test.
11911 else
11912 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11913 for as_dir in $PATH
11914 do
11915 IFS=$as_save_IFS
11916 test -z "$as_dir" && as_dir=.
11917 for ac_exec_ext in '' $ac_executable_extensions; do
11918 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11919 ac_cv_prog_CC="${ac_tool_prefix}gcc"
11920 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11921 break 2
11922 fi
11923 done
11924 done
11925 IFS=$as_save_IFS
11926
11927 fi
11928 fi
11929 CC=$ac_cv_prog_CC
11930 if test -n "$CC"; then
11931 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
11932 $as_echo "$CC" >&6; }
11933 else
11934 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11935 $as_echo "no" >&6; }
11936 fi
11937
11938
11939 fi
11940 if test -z "$ac_cv_prog_CC"; then
11941 ac_ct_CC=$CC
11942 # Extract the first word of "gcc", so it can be a program name with args.
11943 set dummy gcc; ac_word=$2
11944 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11945 $as_echo_n "checking for $ac_word... " >&6; }
11946 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
11947 $as_echo_n "(cached) " >&6
11948 else
11949 if test -n "$ac_ct_CC"; then
11950 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
11951 else
11952 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11953 for as_dir in $PATH
11954 do
11955 IFS=$as_save_IFS
11956 test -z "$as_dir" && as_dir=.
11957 for ac_exec_ext in '' $ac_executable_extensions; do
11958 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
11959 ac_cv_prog_ac_ct_CC="gcc"
11960 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11961 break 2
11962 fi
11963 done
11964 done
11965 IFS=$as_save_IFS
11966
11967 fi
11968 fi
11969 ac_ct_CC=$ac_cv_prog_ac_ct_CC
11970 if test -n "$ac_ct_CC"; then
11971 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
11972 $as_echo "$ac_ct_CC" >&6; }
11973 else
11974 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11975 $as_echo "no" >&6; }
11976 fi
11977
11978 if test "x$ac_ct_CC" = x; then
11979 CC=""
11980 else
11981 case $cross_compiling:$ac_tool_warned in
11982 yes:)
11983 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
11984 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
11985 ac_tool_warned=yes ;;
11986 esac
11987 CC=$ac_ct_CC
11988 fi
11989 else
11990 CC="$ac_cv_prog_CC"
11991 fi
11992
11993 if test -z "$CC"; then
11994 if test -n "$ac_tool_prefix"; then
11995 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
11996 set dummy ${ac_tool_prefix}cc; ac_word=$2
11997 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11998 $as_echo_n "checking for $ac_word... " >&6; }
11999 if test "${ac_cv_prog_CC+set}" = set; then :
12000 $as_echo_n "(cached) " >&6
12001 else
12002 if test -n "$CC"; then
12003 ac_cv_prog_CC="$CC" # Let the user override the test.
12004 else
12005 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12006 for as_dir in $PATH
12007 do
12008 IFS=$as_save_IFS
12009 test -z "$as_dir" && as_dir=.
12010 for ac_exec_ext in '' $ac_executable_extensions; do
12011 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
12012 ac_cv_prog_CC="${ac_tool_prefix}cc"
12013 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12014 break 2
12015 fi
12016 done
12017 done
12018 IFS=$as_save_IFS
12019
12020 fi
12021 fi
12022 CC=$ac_cv_prog_CC
12023 if test -n "$CC"; then
12024 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
12025 $as_echo "$CC" >&6; }
12026 else
12027 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12028 $as_echo "no" >&6; }
12029 fi
12030
12031
12032 fi
12033 fi
12034 if test -z "$CC"; then
12035 # Extract the first word of "cc", so it can be a program name with args.
12036 set dummy cc; ac_word=$2
12037 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12038 $as_echo_n "checking for $ac_word... " >&6; }
12039 if test "${ac_cv_prog_CC+set}" = set; then :
12040 $as_echo_n "(cached) " >&6
12041 else
12042 if test -n "$CC"; then
12043 ac_cv_prog_CC="$CC" # Let the user override the test.
12044 else
12045 ac_prog_rejected=no
12046 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12047 for as_dir in $PATH
12048 do
12049 IFS=$as_save_IFS
12050 test -z "$as_dir" && as_dir=.
12051 for ac_exec_ext in '' $ac_executable_extensions; do
12052 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
12053 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
12054 ac_prog_rejected=yes
12055 continue
12056 fi
12057 ac_cv_prog_CC="cc"
12058 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12059 break 2
12060 fi
12061 done
12062 done
12063 IFS=$as_save_IFS
12064
12065 if test $ac_prog_rejected = yes; then
12066 # We found a bogon in the path, so make sure we never use it.
12067 set dummy $ac_cv_prog_CC
12068 shift
12069 if test $# != 0; then
12070 # We chose a different compiler from the bogus one.
12071 # However, it has the same basename, so the bogon will be chosen
12072 # first if we set CC to just the basename; use the full file name.
12073 shift
12074 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
12075 fi
12076 fi
12077 fi
12078 fi
12079 CC=$ac_cv_prog_CC
12080 if test -n "$CC"; then
12081 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
12082 $as_echo "$CC" >&6; }
12083 else
12084 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12085 $as_echo "no" >&6; }
12086 fi
12087
12088
12089 fi
12090 if test -z "$CC"; then
12091 if test -n "$ac_tool_prefix"; then
12092 for ac_prog in cl.exe
12093 do
12094 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12095 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12096 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12097 $as_echo_n "checking for $ac_word... " >&6; }
12098 if test "${ac_cv_prog_CC+set}" = set; then :
12099 $as_echo_n "(cached) " >&6
12100 else
12101 if test -n "$CC"; then
12102 ac_cv_prog_CC="$CC" # Let the user override the test.
12103 else
12104 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12105 for as_dir in $PATH
12106 do
12107 IFS=$as_save_IFS
12108 test -z "$as_dir" && as_dir=.
12109 for ac_exec_ext in '' $ac_executable_extensions; do
12110 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
12111 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
12112 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12113 break 2
12114 fi
12115 done
12116 done
12117 IFS=$as_save_IFS
12118
12119 fi
12120 fi
12121 CC=$ac_cv_prog_CC
12122 if test -n "$CC"; then
12123 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
12124 $as_echo "$CC" >&6; }
12125 else
12126 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12127 $as_echo "no" >&6; }
12128 fi
12129
12130
12131 test -n "$CC" && break
12132 done
12133 fi
12134 if test -z "$CC"; then
12135 ac_ct_CC=$CC
12136 for ac_prog in cl.exe
12137 do
12138 # Extract the first word of "$ac_prog", so it can be a program name with args.
12139 set dummy $ac_prog; ac_word=$2
12140 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12141 $as_echo_n "checking for $ac_word... " >&6; }
12142 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
12143 $as_echo_n "(cached) " >&6
12144 else
12145 if test -n "$ac_ct_CC"; then
12146 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
12147 else
12148 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12149 for as_dir in $PATH
12150 do
12151 IFS=$as_save_IFS
12152 test -z "$as_dir" && as_dir=.
12153 for ac_exec_ext in '' $ac_executable_extensions; do
12154 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
12155 ac_cv_prog_ac_ct_CC="$ac_prog"
12156 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12157 break 2
12158 fi
12159 done
12160 done
12161 IFS=$as_save_IFS
12162
12163 fi
12164 fi
12165 ac_ct_CC=$ac_cv_prog_ac_ct_CC
12166 if test -n "$ac_ct_CC"; then
12167 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
12168 $as_echo "$ac_ct_CC" >&6; }
12169 else
12170 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12171 $as_echo "no" >&6; }
12172 fi
12173
12174
12175 test -n "$ac_ct_CC" && break
12176 done
12177
12178 if test "x$ac_ct_CC" = x; then
12179 CC=""
12180 else
12181 case $cross_compiling:$ac_tool_warned in
12182 yes:)
12183 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
12184 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
12185 ac_tool_warned=yes ;;
12186 esac
12187 CC=$ac_ct_CC
12188 fi
12189 fi
12190
12191 fi
12192
12193
12194 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
12195 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
12196 as_fn_error "no acceptable C compiler found in \$PATH
12197 See \`config.log' for more details." "$LINENO" 5; }
12198
12199 # Provide some information about the compiler.
12200 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
12201 set X $ac_compile
12202 ac_compiler=$2
12203 for ac_option in --version -v -V -qversion; do
12204 { { ac_try="$ac_compiler $ac_option >&5"
12205 case "(($ac_try" in
12206 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12207 *) ac_try_echo=$ac_try;;
12208 esac
12209 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
12210 $as_echo "$ac_try_echo"; } >&5
12211 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
12212 ac_status=$?
12213 if test -s conftest.err; then
12214 sed '10a\
12215 ... rest of stderr output deleted ...
12216 10q' conftest.err >conftest.er1
12217 cat conftest.er1 >&5
12218 fi
12219 rm -f conftest.er1 conftest.err
12220 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12221 test $ac_status = 0; }
12222 done
12223
12224 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
12225 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
12226 if test "${ac_cv_c_compiler_gnu+set}" = set; then :
12227 $as_echo_n "(cached) " >&6
12228 else
12229 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12230 /* end confdefs.h. */
12231
12232 int
12233 main ()
12234 {
12235 #ifndef __GNUC__
12236 choke me
12237 #endif
12238
12239 ;
12240 return 0;
12241 }
12242 _ACEOF
12243 if ac_fn_c_try_compile "$LINENO"; then :
12244 ac_compiler_gnu=yes
12245 else
12246 ac_compiler_gnu=no
12247 fi
12248 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12249 ac_cv_c_compiler_gnu=$ac_compiler_gnu
12250
12251 fi
12252 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
12253 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
12254 if test $ac_compiler_gnu = yes; then
12255 GCC=yes
12256 else
12257 GCC=
12258 fi
12259 ac_test_CFLAGS=${CFLAGS+set}
12260 ac_save_CFLAGS=$CFLAGS
12261 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
12262 $as_echo_n "checking whether $CC accepts -g... " >&6; }
12263 if test "${ac_cv_prog_cc_g+set}" = set; then :
12264 $as_echo_n "(cached) " >&6
12265 else
12266 ac_save_c_werror_flag=$ac_c_werror_flag
12267 ac_c_werror_flag=yes
12268 ac_cv_prog_cc_g=no
12269 CFLAGS="-g"
12270 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12271 /* end confdefs.h. */
12272
12273 int
12274 main ()
12275 {
12276
12277 ;
12278 return 0;
12279 }
12280 _ACEOF
12281 if ac_fn_c_try_compile "$LINENO"; then :
12282 ac_cv_prog_cc_g=yes
12283 else
12284 CFLAGS=""
12285 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12286 /* end confdefs.h. */
12287
12288 int
12289 main ()
12290 {
12291
12292 ;
12293 return 0;
12294 }
12295 _ACEOF
12296 if ac_fn_c_try_compile "$LINENO"; then :
12297
12298 else
12299 ac_c_werror_flag=$ac_save_c_werror_flag
12300 CFLAGS="-g"
12301 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12302 /* end confdefs.h. */
12303
12304 int
12305 main ()
12306 {
12307
12308 ;
12309 return 0;
12310 }
12311 _ACEOF
12312 if ac_fn_c_try_compile "$LINENO"; then :
12313 ac_cv_prog_cc_g=yes
12314 fi
12315 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12316 fi
12317 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12318 fi
12319 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12320 ac_c_werror_flag=$ac_save_c_werror_flag
12321 fi
12322 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
12323 $as_echo "$ac_cv_prog_cc_g" >&6; }
12324 if test "$ac_test_CFLAGS" = set; then
12325 CFLAGS=$ac_save_CFLAGS
12326 elif test $ac_cv_prog_cc_g = yes; then
12327 if test "$GCC" = yes; then
12328 CFLAGS="-g -O2"
12329 else
12330 CFLAGS="-g"
12331 fi
12332 else
12333 if test "$GCC" = yes; then
12334 CFLAGS="-O2"
12335 else
12336 CFLAGS=
12337 fi
12338 fi
12339 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
12340 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
12341 if test "${ac_cv_prog_cc_c89+set}" = set; then :
12342 $as_echo_n "(cached) " >&6
12343 else
12344 ac_cv_prog_cc_c89=no
12345 ac_save_CC=$CC
12346 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12347 /* end confdefs.h. */
12348 #include <stdarg.h>
12349 #include <stdio.h>
12350 #include <sys/types.h>
12351 #include <sys/stat.h>
12352 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
12353 struct buf { int x; };
12354 FILE * (*rcsopen) (struct buf *, struct stat *, int);
12355 static char *e (p, i)
12356 char **p;
12357 int i;
12358 {
12359 return p[i];
12360 }
12361 static char *f (char * (*g) (char **, int), char **p, ...)
12362 {
12363 char *s;
12364 va_list v;
12365 va_start (v,p);
12366 s = g (p, va_arg (v,int));
12367 va_end (v);
12368 return s;
12369 }
12370
12371 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
12372 function prototypes and stuff, but not '\xHH' hex character constants.
12373 These don't provoke an error unfortunately, instead are silently treated
12374 as 'x'. The following induces an error, until -std is added to get
12375 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
12376 array size at least. It's necessary to write '\x00'==0 to get something
12377 that's true only with -std. */
12378 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
12379
12380 /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
12381 inside strings and character constants. */
12382 #define FOO(x) 'x'
12383 int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
12384
12385 int test (int i, double x);
12386 struct s1 {int (*f) (int a);};
12387 struct s2 {int (*f) (double a);};
12388 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
12389 int argc;
12390 char **argv;
12391 int
12392 main ()
12393 {
12394 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
12395 ;
12396 return 0;
12397 }
12398 _ACEOF
12399 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
12400 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
12401 do
12402 CC="$ac_save_CC $ac_arg"
12403 if ac_fn_c_try_compile "$LINENO"; then :
12404 ac_cv_prog_cc_c89=$ac_arg
12405 fi
12406 rm -f core conftest.err conftest.$ac_objext
12407 test "x$ac_cv_prog_cc_c89" != "xno" && break
12408 done
12409 rm -f conftest.$ac_ext
12410 CC=$ac_save_CC
12411
12412 fi
12413 # AC_CACHE_VAL
12414 case "x$ac_cv_prog_cc_c89" in
12415 x)
12416 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
12417 $as_echo "none needed" >&6; } ;;
12418 xno)
12419 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
12420 $as_echo "unsupported" >&6; } ;;
12421 *)
12422 CC="$CC $ac_cv_prog_cc_c89"
12423 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
12424 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
12425 esac
12426 if test "x$ac_cv_prog_cc_c89" != xno; then :
12427
12428 fi
12429
12430 ac_ext=c
12431 ac_cpp='$CPP $CPPFLAGS'
12432 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12433 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12434 ac_compiler_gnu=$ac_cv_c_compiler_gnu
404512435
404612436 depcc="$CC" am_compiler_list=
404712437
429612686 fi
429712687
429812688
4299 case `pwd` in
4300 *\ * | *\ *)
4301 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
4302 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
4303 esac
4304
4305
4306
4307 macro_version='2.2.6b'
4308 macro_revision='1.3017'
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322 ltmain="$ac_aux_dir/ltmain.sh"
4323
4324 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
4325 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
4326 if test "${ac_cv_path_SED+set}" = set; then :
4327 $as_echo_n "(cached) " >&6
4328 else
4329 ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
4330 for ac_i in 1 2 3 4 5 6 7; do
4331 ac_script="$ac_script$as_nl$ac_script"
4332 done
4333 echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
4334 { ac_script=; unset ac_script;}
4335 if test -z "$SED"; then
4336 ac_path_SED_found=false
4337 # Loop through the user's path and test for each of PROGNAME-LIST
4338 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4339 for as_dir in $PATH
4340 do
4341 IFS=$as_save_IFS
4342 test -z "$as_dir" && as_dir=.
4343 for ac_prog in sed gsed; do
4344 for ac_exec_ext in '' $ac_executable_extensions; do
4345 ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
4346 { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
4347 # Check for GNU ac_path_SED and select it if it is found.
4348 # Check for GNU $ac_path_SED
4349 case `"$ac_path_SED" --version 2>&1` in
4350 *GNU*)
4351 ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
4352 *)
4353 ac_count=0
4354 $as_echo_n 0123456789 >"conftest.in"
4355 while :
4356 do
4357 cat "conftest.in" "conftest.in" >"conftest.tmp"
4358 mv "conftest.tmp" "conftest.in"
4359 cp "conftest.in" "conftest.nl"
4360 $as_echo '' >> "conftest.nl"
4361 "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
4362 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4363 as_fn_arith $ac_count + 1 && ac_count=$as_val
4364 if test $ac_count -gt ${ac_path_SED_max-0}; then
4365 # Best one so far, save it but keep looking for a better one
4366 ac_cv_path_SED="$ac_path_SED"
4367 ac_path_SED_max=$ac_count
4368 fi
4369 # 10*(2^10) chars as input seems more than enough
4370 test $ac_count -gt 10 && break
4371 done
4372 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4373 esac
4374
4375 $ac_path_SED_found && break 3
4376 done
4377 done
4378 done
4379 IFS=$as_save_IFS
4380 if test -z "$ac_cv_path_SED"; then
4381 as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5
4382 fi
4383 else
4384 ac_cv_path_SED=$SED
4385 fi
4386
4387 fi
4388 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
4389 $as_echo "$ac_cv_path_SED" >&6; }
4390 SED="$ac_cv_path_SED"
4391 rm -f conftest.sed
4392
4393 test -z "$SED" && SED=sed
4394 Xsed="$SED -e 1s/^X//"
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
4407 $as_echo_n "checking for egrep... " >&6; }
4408 if test "${ac_cv_path_EGREP+set}" = set; then :
4409 $as_echo_n "(cached) " >&6
4410 else
4411 if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
4412 then ac_cv_path_EGREP="$GREP -E"
4413 else
4414 if test -z "$EGREP"; then
4415 ac_path_EGREP_found=false
4416 # Loop through the user's path and test for each of PROGNAME-LIST
4417 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4418 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4419 do
4420 IFS=$as_save_IFS
4421 test -z "$as_dir" && as_dir=.
4422 for ac_prog in egrep; do
4423 for ac_exec_ext in '' $ac_executable_extensions; do
4424 ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4425 { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
4426 # Check for GNU ac_path_EGREP and select it if it is found.
4427 # Check for GNU $ac_path_EGREP
4428 case `"$ac_path_EGREP" --version 2>&1` in
4429 *GNU*)
4430 ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4431 *)
4432 ac_count=0
4433 $as_echo_n 0123456789 >"conftest.in"
4434 while :
4435 do
4436 cat "conftest.in" "conftest.in" >"conftest.tmp"
4437 mv "conftest.tmp" "conftest.in"
4438 cp "conftest.in" "conftest.nl"
4439 $as_echo 'EGREP' >> "conftest.nl"
4440 "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4441 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4442 as_fn_arith $ac_count + 1 && ac_count=$as_val
4443 if test $ac_count -gt ${ac_path_EGREP_max-0}; then
4444 # Best one so far, save it but keep looking for a better one
4445 ac_cv_path_EGREP="$ac_path_EGREP"
4446 ac_path_EGREP_max=$ac_count
4447 fi
4448 # 10*(2^10) chars as input seems more than enough
4449 test $ac_count -gt 10 && break
4450 done
4451 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4452 esac
4453
4454 $ac_path_EGREP_found && break 3
4455 done
4456 done
4457 done
4458 IFS=$as_save_IFS
4459 if test -z "$ac_cv_path_EGREP"; then
4460 as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4461 fi
4462 else
4463 ac_cv_path_EGREP=$EGREP
4464 fi
4465
4466 fi
4467 fi
4468 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
4469 $as_echo "$ac_cv_path_EGREP" >&6; }
4470 EGREP="$ac_cv_path_EGREP"
4471
4472
4473 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
4474 $as_echo_n "checking for fgrep... " >&6; }
4475 if test "${ac_cv_path_FGREP+set}" = set; then :
4476 $as_echo_n "(cached) " >&6
4477 else
4478 if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
4479 then ac_cv_path_FGREP="$GREP -F"
4480 else
4481 if test -z "$FGREP"; then
4482 ac_path_FGREP_found=false
4483 # Loop through the user's path and test for each of PROGNAME-LIST
4484 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4485 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4486 do
4487 IFS=$as_save_IFS
4488 test -z "$as_dir" && as_dir=.
4489 for ac_prog in fgrep; do
4490 for ac_exec_ext in '' $ac_executable_extensions; do
4491 ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
4492 { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
4493 # Check for GNU ac_path_FGREP and select it if it is found.
4494 # Check for GNU $ac_path_FGREP
4495 case `"$ac_path_FGREP" --version 2>&1` in
4496 *GNU*)
4497 ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
4498 *)
4499 ac_count=0
4500 $as_echo_n 0123456789 >"conftest.in"
4501 while :
4502 do
4503 cat "conftest.in" "conftest.in" >"conftest.tmp"
4504 mv "conftest.tmp" "conftest.in"
4505 cp "conftest.in" "conftest.nl"
4506 $as_echo 'FGREP' >> "conftest.nl"
4507 "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
4508 diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4509 as_fn_arith $ac_count + 1 && ac_count=$as_val
4510 if test $ac_count -gt ${ac_path_FGREP_max-0}; then
4511 # Best one so far, save it but keep looking for a better one
4512 ac_cv_path_FGREP="$ac_path_FGREP"
4513 ac_path_FGREP_max=$ac_count
4514 fi
4515 # 10*(2^10) chars as input seems more than enough
4516 test $ac_count -gt 10 && break
4517 done
4518 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4519 esac
4520
4521 $ac_path_FGREP_found && break 3
4522 done
4523 done
4524 done
4525 IFS=$as_save_IFS
4526 if test -z "$ac_cv_path_FGREP"; then
4527 as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4528 fi
4529 else
4530 ac_cv_path_FGREP=$FGREP
4531 fi
4532
4533 fi
4534 fi
4535 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
4536 $as_echo "$ac_cv_path_FGREP" >&6; }
4537 FGREP="$ac_cv_path_FGREP"
4538
4539
4540 test -z "$GREP" && GREP=grep
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560 # Check whether --with-gnu-ld was given.
4561 if test "${with_gnu_ld+set}" = set; then :
4562 withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
4563 else
4564 with_gnu_ld=no
4565 fi
4566
4567 ac_prog=ld
4568 if test "$GCC" = yes; then
4569 # Check if gcc -print-prog-name=ld gives a path.
4570 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
4571 $as_echo_n "checking for ld used by $CC... " >&6; }
4572 case $host in
4573 *-*-mingw*)
4574 # gcc leaves a trailing carriage return which upsets mingw
4575 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4576 *)
4577 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4578 esac
4579 case $ac_prog in
4580 # Accept absolute paths.
4581 [\\/]* | ?:[\\/]*)
4582 re_direlt='/[^/][^/]*/\.\./'
4583 # Canonicalize the pathname of ld
4584 ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4585 while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4586 ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4587 done
4588 test -z "$LD" && LD="$ac_prog"
4589 ;;
4590 "")
4591 # If it fails, then pretend we aren't using GCC.
4592 ac_prog=ld
4593 ;;
4594 *)
4595 # If it is relative, then search for the first ld in PATH.
4596 with_gnu_ld=unknown
4597 ;;
4598 esac
4599 elif test "$with_gnu_ld" = yes; then
4600 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
4601 $as_echo_n "checking for GNU ld... " >&6; }
4602 else
4603 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
4604 $as_echo_n "checking for non-GNU ld... " >&6; }
4605 fi
4606 if test "${lt_cv_path_LD+set}" = set; then :
4607 $as_echo_n "(cached) " >&6
4608 else
4609 if test -z "$LD"; then
4610 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4611 for ac_dir in $PATH; do
4612 IFS="$lt_save_ifs"
4613 test -z "$ac_dir" && ac_dir=.
4614 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4615 lt_cv_path_LD="$ac_dir/$ac_prog"
4616 # Check to see if the program is GNU ld. I'd rather use --version,
4617 # but apparently some variants of GNU ld only accept -v.
4618 # Break only if it was the GNU/non-GNU ld that we prefer.
4619 case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4620 *GNU* | *'with BFD'*)
4621 test "$with_gnu_ld" != no && break
4622 ;;
4623 *)
4624 test "$with_gnu_ld" != yes && break
4625 ;;
4626 esac
4627 fi
4628 done
4629 IFS="$lt_save_ifs"
4630 else
4631 lt_cv_path_LD="$LD" # Let the user override the test with a path.
4632 fi
4633 fi
4634
4635 LD="$lt_cv_path_LD"
4636 if test -n "$LD"; then
4637 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
4638 $as_echo "$LD" >&6; }
4639 else
4640 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4641 $as_echo "no" >&6; }
4642 fi
4643 test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5
4644 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
4645 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
4646 if test "${lt_cv_prog_gnu_ld+set}" = set; then :
4647 $as_echo_n "(cached) " >&6
4648 else
4649 # I'd rather use --version here, but apparently some GNU lds only accept -v.
4650 case `$LD -v 2>&1 </dev/null` in
4651 *GNU* | *'with BFD'*)
4652 lt_cv_prog_gnu_ld=yes
4653 ;;
4654 *)
4655 lt_cv_prog_gnu_ld=no
4656 ;;
4657 esac
4658 fi
4659 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
4660 $as_echo "$lt_cv_prog_gnu_ld" >&6; }
4661 with_gnu_ld=$lt_cv_prog_gnu_ld
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
4672 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
4673 if test "${lt_cv_path_NM+set}" = set; then :
4674 $as_echo_n "(cached) " >&6
4675 else
4676 if test -n "$NM"; then
4677 # Let the user override the test.
4678 lt_cv_path_NM="$NM"
4679 else
4680 lt_nm_to_check="${ac_tool_prefix}nm"
4681 if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4682 lt_nm_to_check="$lt_nm_to_check nm"
4683 fi
4684 for lt_tmp_nm in $lt_nm_to_check; do
4685 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4686 for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4687 IFS="$lt_save_ifs"
4688 test -z "$ac_dir" && ac_dir=.
4689 tmp_nm="$ac_dir/$lt_tmp_nm"
4690 if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4691 # Check to see if the nm accepts a BSD-compat flag.
4692 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
4693 # nm: unknown option "B" ignored
4694 # Tru64's nm complains that /dev/null is an invalid object file
4695 case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4696 */dev/null* | *'Invalid file or object type'*)
4697 lt_cv_path_NM="$tmp_nm -B"
4698 break
4699 ;;
4700 *)
4701 case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4702 */dev/null*)
4703 lt_cv_path_NM="$tmp_nm -p"
4704 break
4705 ;;
4706 *)
4707 lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4708 continue # so that we can try to find one that supports BSD flags
4709 ;;
4710 esac
4711 ;;
4712 esac
4713 fi
4714 done
4715 IFS="$lt_save_ifs"
4716 done
4717 : ${lt_cv_path_NM=no}
4718 fi
4719 fi
4720 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
4721 $as_echo "$lt_cv_path_NM" >&6; }
4722 if test "$lt_cv_path_NM" != "no"; then
4723 NM="$lt_cv_path_NM"
4724 else
4725 # Didn't find any BSD compatible name lister, look for dumpbin.
4726 if test -n "$ac_tool_prefix"; then
4727 for ac_prog in "dumpbin -symbols" "link -dump -symbols"
4728 do
4729 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4730 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4731 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4732 $as_echo_n "checking for $ac_word... " >&6; }
4733 if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
4734 $as_echo_n "(cached) " >&6
4735 else
4736 if test -n "$DUMPBIN"; then
4737 ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
4738 else
4739 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4740 for as_dir in $PATH
4741 do
4742 IFS=$as_save_IFS
4743 test -z "$as_dir" && as_dir=.
4744 for ac_exec_ext in '' $ac_executable_extensions; do
4745 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4746 ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
4747 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4748 break 2
4749 fi
4750 done
4751 done
4752 IFS=$as_save_IFS
4753
4754 fi
4755 fi
4756 DUMPBIN=$ac_cv_prog_DUMPBIN
4757 if test -n "$DUMPBIN"; then
4758 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
4759 $as_echo "$DUMPBIN" >&6; }
4760 else
4761 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4762 $as_echo "no" >&6; }
4763 fi
4764
4765
4766 test -n "$DUMPBIN" && break
4767 done
4768 fi
4769 if test -z "$DUMPBIN"; then
4770 ac_ct_DUMPBIN=$DUMPBIN
4771 for ac_prog in "dumpbin -symbols" "link -dump -symbols"
4772 do
4773 # Extract the first word of "$ac_prog", so it can be a program name with args.
4774 set dummy $ac_prog; ac_word=$2
4775 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4776 $as_echo_n "checking for $ac_word... " >&6; }
4777 if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then :
4778 $as_echo_n "(cached) " >&6
4779 else
4780 if test -n "$ac_ct_DUMPBIN"; then
4781 ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
4782 else
4783 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4784 for as_dir in $PATH
4785 do
4786 IFS=$as_save_IFS
4787 test -z "$as_dir" && as_dir=.
4788 for ac_exec_ext in '' $ac_executable_extensions; do
4789 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
4790 ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
4791 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4792 break 2
4793 fi
4794 done
4795 done
4796 IFS=$as_save_IFS
4797
4798 fi
4799 fi
4800 ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
4801 if test -n "$ac_ct_DUMPBIN"; then
4802 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
4803 $as_echo "$ac_ct_DUMPBIN" >&6; }
4804 else
4805 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4806 $as_echo "no" >&6; }
4807 fi
4808
4809
4810 test -n "$ac_ct_DUMPBIN" && break
4811 done
4812
4813 if test "x$ac_ct_DUMPBIN" = x; then
4814 DUMPBIN=":"
4815 else
4816 case $cross_compiling:$ac_tool_warned in
4817 yes:)
4818 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
4819 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
4820 ac_tool_warned=yes ;;
4821 esac
4822 DUMPBIN=$ac_ct_DUMPBIN
4823 fi
4824 fi
4825
4826
4827 if test "$DUMPBIN" != ":"; then
4828 NM="$DUMPBIN"
4829 fi
4830 fi
4831 test -z "$NM" && NM=nm
4832
4833
4834
4835
4836
4837
4838 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
4839 $as_echo_n "checking the name lister ($NM) interface... " >&6; }
4840 if test "${lt_cv_nm_interface+set}" = set; then :
4841 $as_echo_n "(cached) " >&6
4842 else
4843 lt_cv_nm_interface="BSD nm"
4844 echo "int some_variable = 0;" > conftest.$ac_ext
4845 (eval echo "\"\$as_me:4846: $ac_compile\"" >&5)
4846 (eval "$ac_compile" 2>conftest.err)
4847 cat conftest.err >&5
4848 (eval echo "\"\$as_me:4849: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
4849 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
4850 cat conftest.err >&5
4851 (eval echo "\"\$as_me:4852: output\"" >&5)
4852 cat conftest.out >&5
4853 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
4854 lt_cv_nm_interface="MS dumpbin"
4855 fi
4856 rm -f conftest*
4857 fi
4858 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
4859 $as_echo "$lt_cv_nm_interface" >&6; }
4860
4861 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
4862 $as_echo_n "checking whether ln -s works... " >&6; }
4863 LN_S=$as_ln_s
4864 if test "$LN_S" = "ln -s"; then
4865 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4866 $as_echo "yes" >&6; }
4867 else
4868 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
4869 $as_echo "no, using $LN_S" >&6; }
4870 fi
4871
4872 # find the maximum length of command line arguments
4873 { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
4874 $as_echo_n "checking the maximum length of command line arguments... " >&6; }
4875 if test "${lt_cv_sys_max_cmd_len+set}" = set; then :
4876 $as_echo_n "(cached) " >&6
4877 else
4878 i=0
4879 teststring="ABCD"
4880
4881 case $build_os in
4882 msdosdjgpp*)
4883 # On DJGPP, this test can blow up pretty badly due to problems in libc
4884 # (any single argument exceeding 2000 bytes causes a buffer overrun
4885 # during glob expansion). Even if it were fixed, the result of this
4886 # check would be larger than it should be.
4887 lt_cv_sys_max_cmd_len=12288; # 12K is about right
4888 ;;
4889
4890 gnu*)
4891 # Under GNU Hurd, this test is not required because there is
4892 # no limit to the length of command line arguments.
4893 # Libtool will interpret -1 as no limit whatsoever
4894 lt_cv_sys_max_cmd_len=-1;
4895 ;;
4896
4897 cygwin* | mingw* | cegcc*)
4898 # On Win9x/ME, this test blows up -- it succeeds, but takes
4899 # about 5 minutes as the teststring grows exponentially.
4900 # Worse, since 9x/ME are not pre-emptively multitasking,
4901 # you end up with a "frozen" computer, even though with patience
4902 # the test eventually succeeds (with a max line length of 256k).
4903 # Instead, let's just punt: use the minimum linelength reported by
4904 # all of the supported platforms: 8192 (on NT/2K/XP).
4905 lt_cv_sys_max_cmd_len=8192;
4906 ;;
4907
4908 amigaos*)
4909 # On AmigaOS with pdksh, this test takes hours, literally.
4910 # So we just punt and use a minimum line length of 8192.
4911 lt_cv_sys_max_cmd_len=8192;
4912 ;;
4913
4914 netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
4915 # This has been around since 386BSD, at least. Likely further.
4916 if test -x /sbin/sysctl; then
4917 lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
4918 elif test -x /usr/sbin/sysctl; then
4919 lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
4920 else
4921 lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
4922 fi
4923 # And add a safety zone
4924 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4925 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4926 ;;
4927
4928 interix*)
4929 # We know the value 262144 and hardcode it with a safety zone (like BSD)
4930 lt_cv_sys_max_cmd_len=196608
4931 ;;
4932
4933 osf*)
4934 # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
4935 # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
4936 # nice to cause kernel panics so lets avoid the loop below.
4937 # First set a reasonable default.
4938 lt_cv_sys_max_cmd_len=16384
4939 #
4940 if test -x /sbin/sysconfig; then
4941 case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
4942 *1*) lt_cv_sys_max_cmd_len=-1 ;;
4943 esac
4944 fi
4945 ;;
4946 sco3.2v5*)
4947 lt_cv_sys_max_cmd_len=102400
4948 ;;
4949 sysv5* | sco5v6* | sysv4.2uw2*)
4950 kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
4951 if test -n "$kargmax"; then
4952 lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
4953 else
4954 lt_cv_sys_max_cmd_len=32768
4955 fi
4956 ;;
4957 *)
4958 lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
4959 if test -n "$lt_cv_sys_max_cmd_len"; then
4960 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
4961 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
4962 else
4963 # Make teststring a little bigger before we do anything with it.
4964 # a 1K string should be a reasonable start.
4965 for i in 1 2 3 4 5 6 7 8 ; do
4966 teststring=$teststring$teststring
4967 done
4968 SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
4969 # If test is not a shell built-in, we'll probably end up computing a
4970 # maximum length that is only half of the actual maximum length, but
4971 # we can't tell.
4972 while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
4973 = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
4974 test $i != 17 # 1/2 MB should be enough
4975 do
4976 i=`expr $i + 1`
4977 teststring=$teststring$teststring
4978 done
4979 # Only check the string length outside the loop.
4980 lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
4981 teststring=
4982 # Add a significant safety factor because C++ compilers can tack on
4983 # massive amounts of additional arguments before passing them to the
4984 # linker. It appears as though 1/2 is a usable value.
4985 lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
4986 fi
4987 ;;
4988 esac
4989
4990 fi
4991
4992 if test -n $lt_cv_sys_max_cmd_len ; then
4993 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
4994 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
4995 else
4996 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
4997 $as_echo "none" >&6; }
4998 fi
4999 max_cmd_len=$lt_cv_sys_max_cmd_len
5000
5001
5002
5003
5004
5005
5006 : ${CP="cp -f"}
5007 : ${MV="mv -f"}
5008 : ${RM="rm -f"}
5009
5010 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
5011 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
5012 # Try some XSI features
5013 xsi_shell=no
5014 ( _lt_dummy="a/b/c"
5015 test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
5016 = c,a/b,, \
5017 && eval 'test $(( 1 + 1 )) -eq 2 \
5018 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
5019 && xsi_shell=yes
5020 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
5021 $as_echo "$xsi_shell" >&6; }
5022
5023
5024 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
5025 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
5026 lt_shell_append=no
5027 ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
5028 >/dev/null 2>&1 \
5029 && lt_shell_append=yes
5030 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
5031 $as_echo "$lt_shell_append" >&6; }
5032
5033
5034 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
5035 lt_unset=unset
5036 else
5037 lt_unset=false
5038 fi
5039
5040
5041
5042
5043
5044 # test EBCDIC or ASCII
5045 case `echo X|tr X '\101'` in
5046 A) # ASCII based system
5047 # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
5048 lt_SP2NL='tr \040 \012'
5049 lt_NL2SP='tr \015\012 \040\040'
5050 ;;
5051 *) # EBCDIC based system
5052 lt_SP2NL='tr \100 \n'
5053 lt_NL2SP='tr \r\n \100\100'
5054 ;;
5055 esac
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
5066 $as_echo_n "checking for $LD option to reload object files... " >&6; }
5067 if test "${lt_cv_ld_reload_flag+set}" = set; then :
5068 $as_echo_n "(cached) " >&6
5069 else
5070 lt_cv_ld_reload_flag='-r'
5071 fi
5072 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
5073 $as_echo "$lt_cv_ld_reload_flag" >&6; }
5074 reload_flag=$lt_cv_ld_reload_flag
5075 case $reload_flag in
5076 "" | " "*) ;;
5077 *) reload_flag=" $reload_flag" ;;
5078 esac
5079 reload_cmds='$LD$reload_flag -o $output$reload_objs'
5080 case $host_os in
5081 darwin*)
5082 if test "$GCC" = yes; then
5083 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
5084 else
5085 reload_cmds='$LD$reload_flag -o $output$reload_objs'
5086 fi
5087 ;;
5088 esac
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098 if test -n "$ac_tool_prefix"; then
5099 # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
5100 set dummy ${ac_tool_prefix}objdump; ac_word=$2
5101 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5102 $as_echo_n "checking for $ac_word... " >&6; }
5103 if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
5104 $as_echo_n "(cached) " >&6
5105 else
5106 if test -n "$OBJDUMP"; then
5107 ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
5108 else
5109 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5110 for as_dir in $PATH
5111 do
5112 IFS=$as_save_IFS
5113 test -z "$as_dir" && as_dir=.
5114 for ac_exec_ext in '' $ac_executable_extensions; do
5115 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5116 ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
5117 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5118 break 2
5119 fi
5120 done
5121 done
5122 IFS=$as_save_IFS
5123
5124 fi
5125 fi
5126 OBJDUMP=$ac_cv_prog_OBJDUMP
5127 if test -n "$OBJDUMP"; then
5128 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
5129 $as_echo "$OBJDUMP" >&6; }
5130 else
5131 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5132 $as_echo "no" >&6; }
5133 fi
5134
5135
5136 fi
5137 if test -z "$ac_cv_prog_OBJDUMP"; then
5138 ac_ct_OBJDUMP=$OBJDUMP
5139 # Extract the first word of "objdump", so it can be a program name with args.
5140 set dummy objdump; ac_word=$2
5141 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5142 $as_echo_n "checking for $ac_word... " >&6; }
5143 if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
5144 $as_echo_n "(cached) " >&6
5145 else
5146 if test -n "$ac_ct_OBJDUMP"; then
5147 ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
5148 else
5149 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5150 for as_dir in $PATH
5151 do
5152 IFS=$as_save_IFS
5153 test -z "$as_dir" && as_dir=.
5154 for ac_exec_ext in '' $ac_executable_extensions; do
5155 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5156 ac_cv_prog_ac_ct_OBJDUMP="objdump"
5157 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5158 break 2
5159 fi
5160 done
5161 done
5162 IFS=$as_save_IFS
5163
5164 fi
5165 fi
5166 ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
5167 if test -n "$ac_ct_OBJDUMP"; then
5168 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
5169 $as_echo "$ac_ct_OBJDUMP" >&6; }
5170 else
5171 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5172 $as_echo "no" >&6; }
5173 fi
5174
5175 if test "x$ac_ct_OBJDUMP" = x; then
5176 OBJDUMP="false"
5177 else
5178 case $cross_compiling:$ac_tool_warned in
5179 yes:)
5180 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5181 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5182 ac_tool_warned=yes ;;
5183 esac
5184 OBJDUMP=$ac_ct_OBJDUMP
5185 fi
5186 else
5187 OBJDUMP="$ac_cv_prog_OBJDUMP"
5188 fi
5189
5190 test -z "$OBJDUMP" && OBJDUMP=objdump
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
5201 $as_echo_n "checking how to recognize dependent libraries... " >&6; }
5202 if test "${lt_cv_deplibs_check_method+set}" = set; then :
5203 $as_echo_n "(cached) " >&6
5204 else
5205 lt_cv_file_magic_cmd='$MAGIC_CMD'
5206 lt_cv_file_magic_test_file=
5207 lt_cv_deplibs_check_method='unknown'
5208 # Need to set the preceding variable on all platforms that support
5209 # interlibrary dependencies.
5210 # 'none' -- dependencies not supported.
5211 # `unknown' -- same as none, but documents that we really don't know.
5212 # 'pass_all' -- all dependencies passed with no checks.
5213 # 'test_compile' -- check by making test program.
5214 # 'file_magic [[regex]]' -- check by looking for files in library path
5215 # which responds to the $file_magic_cmd with a given extended regex.
5216 # If you have `file' or equivalent on your system and you're not sure
5217 # whether `pass_all' will *always* work, you probably want this one.
5218
5219 case $host_os in
5220 aix[4-9]*)
5221 lt_cv_deplibs_check_method=pass_all
5222 ;;
5223
5224 beos*)
5225 lt_cv_deplibs_check_method=pass_all
5226 ;;
5227
5228 bsdi[45]*)
5229 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
5230 lt_cv_file_magic_cmd='/usr/bin/file -L'
5231 lt_cv_file_magic_test_file=/shlib/libc.so
5232 ;;
5233
5234 cygwin*)
5235 # func_win32_libid is a shell function defined in ltmain.sh
5236 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5237 lt_cv_file_magic_cmd='func_win32_libid'
5238 ;;
5239
5240 mingw* | pw32*)
5241 # Base MSYS/MinGW do not provide the 'file' command needed by
5242 # func_win32_libid shell function, so use a weaker test based on 'objdump',
5243 # unless we find 'file', for example because we are cross-compiling.
5244 if ( file / ) >/dev/null 2>&1; then
5245 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5246 lt_cv_file_magic_cmd='func_win32_libid'
5247 else
5248 lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
5249 lt_cv_file_magic_cmd='$OBJDUMP -f'
5250 fi
5251 ;;
5252
5253 cegcc)
5254 # use the weaker test based on 'objdump'. See mingw*.
5255 lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
5256 lt_cv_file_magic_cmd='$OBJDUMP -f'
5257 ;;
5258
5259 darwin* | rhapsody*)
5260 lt_cv_deplibs_check_method=pass_all
5261 ;;
5262
5263 freebsd* | dragonfly*)
5264 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5265 case $host_cpu in
5266 i*86 )
5267 # Not sure whether the presence of OpenBSD here was a mistake.
5268 # Let's accept both of them until this is cleared up.
5269 lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
5270 lt_cv_file_magic_cmd=/usr/bin/file
5271 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5272 ;;
5273 esac
5274 else
5275 lt_cv_deplibs_check_method=pass_all
5276 fi
5277 ;;
5278
5279 gnu*)
5280 lt_cv_deplibs_check_method=pass_all
5281 ;;
5282
5283 hpux10.20* | hpux11*)
5284 lt_cv_file_magic_cmd=/usr/bin/file
5285 case $host_cpu in
5286 ia64*)
5287 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
5288 lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
5289 ;;
5290 hppa*64*)
5291 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
5292 lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
5293 ;;
5294 *)
5295 lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
5296 lt_cv_file_magic_test_file=/usr/lib/libc.sl
5297 ;;
5298 esac
5299 ;;
5300
5301 interix[3-9]*)
5302 # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
5303 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
5304 ;;
5305
5306 irix5* | irix6* | nonstopux*)
5307 case $LD in
5308 *-32|*"-32 ") libmagic=32-bit;;
5309 *-n32|*"-n32 ") libmagic=N32;;
5310 *-64|*"-64 ") libmagic=64-bit;;
5311 *) libmagic=never-match;;
5312 esac
5313 lt_cv_deplibs_check_method=pass_all
5314 ;;
5315
5316 # This must be Linux ELF.
5317 linux* | k*bsd*-gnu | kopensolaris*-gnu)
5318 lt_cv_deplibs_check_method=pass_all
5319 ;;
5320
5321 netbsd* | netbsdelf*-gnu)
5322 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5323 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5324 else
5325 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
5326 fi
5327 ;;
5328
5329 newos6*)
5330 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
5331 lt_cv_file_magic_cmd=/usr/bin/file
5332 lt_cv_file_magic_test_file=/usr/lib/libnls.so
5333 ;;
5334
5335 *nto* | *qnx*)
5336 lt_cv_deplibs_check_method=pass_all
5337 ;;
5338
5339 openbsd*)
5340 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5341 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
5342 else
5343 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5344 fi
5345 ;;
5346
5347 osf3* | osf4* | osf5*)
5348 lt_cv_deplibs_check_method=pass_all
5349 ;;
5350
5351 rdos*)
5352 lt_cv_deplibs_check_method=pass_all
5353 ;;
5354
5355 solaris*)
5356 lt_cv_deplibs_check_method=pass_all
5357 ;;
5358
5359 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5360 lt_cv_deplibs_check_method=pass_all
5361 ;;
5362
5363 sysv4 | sysv4.3*)
5364 case $host_vendor in
5365 motorola)
5366 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
5367 lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
5368 ;;
5369 ncr)
5370 lt_cv_deplibs_check_method=pass_all
5371 ;;
5372 sequent)
5373 lt_cv_file_magic_cmd='/bin/file'
5374 lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
5375 ;;
5376 sni)
5377 lt_cv_file_magic_cmd='/bin/file'
5378 lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
5379 lt_cv_file_magic_test_file=/lib/libc.so
5380 ;;
5381 siemens)
5382 lt_cv_deplibs_check_method=pass_all
5383 ;;
5384 pc)
5385 lt_cv_deplibs_check_method=pass_all
5386 ;;
5387 esac
5388 ;;
5389
5390 tpf*)
5391 lt_cv_deplibs_check_method=pass_all
5392 ;;
5393 esac
5394
5395 fi
5396 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
5397 $as_echo "$lt_cv_deplibs_check_method" >&6; }
5398 file_magic_cmd=$lt_cv_file_magic_cmd
5399 deplibs_check_method=$lt_cv_deplibs_check_method
5400 test -z "$deplibs_check_method" && deplibs_check_method=unknown
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413 if test -n "$ac_tool_prefix"; then
5414 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
5415 set dummy ${ac_tool_prefix}ar; ac_word=$2
5416 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5417 $as_echo_n "checking for $ac_word... " >&6; }
5418 if test "${ac_cv_prog_AR+set}" = set; then :
5419 $as_echo_n "(cached) " >&6
5420 else
5421 if test -n "$AR"; then
5422 ac_cv_prog_AR="$AR" # Let the user override the test.
5423 else
5424 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5425 for as_dir in $PATH
5426 do
5427 IFS=$as_save_IFS
5428 test -z "$as_dir" && as_dir=.
5429 for ac_exec_ext in '' $ac_executable_extensions; do
5430 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5431 ac_cv_prog_AR="${ac_tool_prefix}ar"
5432 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5433 break 2
5434 fi
5435 done
5436 done
5437 IFS=$as_save_IFS
5438
5439 fi
5440 fi
5441 AR=$ac_cv_prog_AR
5442 if test -n "$AR"; then
5443 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
5444 $as_echo "$AR" >&6; }
5445 else
5446 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5447 $as_echo "no" >&6; }
5448 fi
5449
5450
5451 fi
5452 if test -z "$ac_cv_prog_AR"; then
5453 ac_ct_AR=$AR
5454 # Extract the first word of "ar", so it can be a program name with args.
5455 set dummy ar; ac_word=$2
5456 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5457 $as_echo_n "checking for $ac_word... " >&6; }
5458 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
5459 $as_echo_n "(cached) " >&6
5460 else
5461 if test -n "$ac_ct_AR"; then
5462 ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5463 else
5464 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5465 for as_dir in $PATH
5466 do
5467 IFS=$as_save_IFS
5468 test -z "$as_dir" && as_dir=.
5469 for ac_exec_ext in '' $ac_executable_extensions; do
5470 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5471 ac_cv_prog_ac_ct_AR="ar"
5472 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5473 break 2
5474 fi
5475 done
5476 done
5477 IFS=$as_save_IFS
5478
5479 fi
5480 fi
5481 ac_ct_AR=$ac_cv_prog_ac_ct_AR
5482 if test -n "$ac_ct_AR"; then
5483 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
5484 $as_echo "$ac_ct_AR" >&6; }
5485 else
5486 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5487 $as_echo "no" >&6; }
5488 fi
5489
5490 if test "x$ac_ct_AR" = x; then
5491 AR="false"
5492 else
5493 case $cross_compiling:$ac_tool_warned in
5494 yes:)
5495 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5496 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5497 ac_tool_warned=yes ;;
5498 esac
5499 AR=$ac_ct_AR
5500 fi
5501 else
5502 AR="$ac_cv_prog_AR"
5503 fi
5504
5505 test -z "$AR" && AR=ar
5506 test -z "$AR_FLAGS" && AR_FLAGS=cru
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518 if test -n "$ac_tool_prefix"; then
5519 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
5520 set dummy ${ac_tool_prefix}strip; ac_word=$2
5521 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5522 $as_echo_n "checking for $ac_word... " >&6; }
5523 if test "${ac_cv_prog_STRIP+set}" = set; then :
5524 $as_echo_n "(cached) " >&6
5525 else
5526 if test -n "$STRIP"; then
5527 ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
5528 else
5529 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5530 for as_dir in $PATH
5531 do
5532 IFS=$as_save_IFS
5533 test -z "$as_dir" && as_dir=.
5534 for ac_exec_ext in '' $ac_executable_extensions; do
5535 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5536 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
5537 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5538 break 2
5539 fi
5540 done
5541 done
5542 IFS=$as_save_IFS
5543
5544 fi
5545 fi
5546 STRIP=$ac_cv_prog_STRIP
5547 if test -n "$STRIP"; then
5548 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
5549 $as_echo "$STRIP" >&6; }
5550 else
5551 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5552 $as_echo "no" >&6; }
5553 fi
5554
5555
5556 fi
5557 if test -z "$ac_cv_prog_STRIP"; then
5558 ac_ct_STRIP=$STRIP
5559 # Extract the first word of "strip", so it can be a program name with args.
5560 set dummy strip; ac_word=$2
5561 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5562 $as_echo_n "checking for $ac_word... " >&6; }
5563 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
5564 $as_echo_n "(cached) " >&6
5565 else
5566 if test -n "$ac_ct_STRIP"; then
5567 ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
5568 else
5569 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5570 for as_dir in $PATH
5571 do
5572 IFS=$as_save_IFS
5573 test -z "$as_dir" && as_dir=.
5574 for ac_exec_ext in '' $ac_executable_extensions; do
5575 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5576 ac_cv_prog_ac_ct_STRIP="strip"
5577 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5578 break 2
5579 fi
5580 done
5581 done
5582 IFS=$as_save_IFS
5583
5584 fi
5585 fi
5586 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
5587 if test -n "$ac_ct_STRIP"; then
5588 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
5589 $as_echo "$ac_ct_STRIP" >&6; }
5590 else
5591 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5592 $as_echo "no" >&6; }
5593 fi
5594
5595 if test "x$ac_ct_STRIP" = x; then
5596 STRIP=":"
5597 else
5598 case $cross_compiling:$ac_tool_warned in
5599 yes:)
5600 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5601 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5602 ac_tool_warned=yes ;;
5603 esac
5604 STRIP=$ac_ct_STRIP
5605 fi
5606 else
5607 STRIP="$ac_cv_prog_STRIP"
5608 fi
5609
5610 test -z "$STRIP" && STRIP=:
5611
5612
5613
5614
5615
5616
5617 if test -n "$ac_tool_prefix"; then
5618 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
5619 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
5620 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5621 $as_echo_n "checking for $ac_word... " >&6; }
5622 if test "${ac_cv_prog_RANLIB+set}" = set; then :
5623 $as_echo_n "(cached) " >&6
5624 else
5625 if test -n "$RANLIB"; then
5626 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
5627 else
5628 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5629 for as_dir in $PATH
5630 do
5631 IFS=$as_save_IFS
5632 test -z "$as_dir" && as_dir=.
5633 for ac_exec_ext in '' $ac_executable_extensions; do
5634 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5635 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
5636 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5637 break 2
5638 fi
5639 done
5640 done
5641 IFS=$as_save_IFS
5642
5643 fi
5644 fi
5645 RANLIB=$ac_cv_prog_RANLIB
5646 if test -n "$RANLIB"; then
5647 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
5648 $as_echo "$RANLIB" >&6; }
5649 else
5650 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5651 $as_echo "no" >&6; }
5652 fi
5653
5654
5655 fi
5656 if test -z "$ac_cv_prog_RANLIB"; then
5657 ac_ct_RANLIB=$RANLIB
5658 # Extract the first word of "ranlib", so it can be a program name with args.
5659 set dummy ranlib; ac_word=$2
5660 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5661 $as_echo_n "checking for $ac_word... " >&6; }
5662 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then :
5663 $as_echo_n "(cached) " >&6
5664 else
5665 if test -n "$ac_ct_RANLIB"; then
5666 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
5667 else
5668 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5669 for as_dir in $PATH
5670 do
5671 IFS=$as_save_IFS
5672 test -z "$as_dir" && as_dir=.
5673 for ac_exec_ext in '' $ac_executable_extensions; do
5674 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5675 ac_cv_prog_ac_ct_RANLIB="ranlib"
5676 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5677 break 2
5678 fi
5679 done
5680 done
5681 IFS=$as_save_IFS
5682
5683 fi
5684 fi
5685 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
5686 if test -n "$ac_ct_RANLIB"; then
5687 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
5688 $as_echo "$ac_ct_RANLIB" >&6; }
5689 else
5690 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5691 $as_echo "no" >&6; }
5692 fi
5693
5694 if test "x$ac_ct_RANLIB" = x; then
5695 RANLIB=":"
5696 else
5697 case $cross_compiling:$ac_tool_warned in
5698 yes:)
5699 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5700 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5701 ac_tool_warned=yes ;;
5702 esac
5703 RANLIB=$ac_ct_RANLIB
5704 fi
5705 else
5706 RANLIB="$ac_cv_prog_RANLIB"
5707 fi
5708
5709 test -z "$RANLIB" && RANLIB=:
5710
5711
5712
5713
5714
5715
5716 # Determine commands to create old-style static archives.
5717 old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
5718 old_postinstall_cmds='chmod 644 $oldlib'
5719 old_postuninstall_cmds=
5720
5721 if test -n "$RANLIB"; then
5722 case $host_os in
5723 openbsd*)
5724 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
5725 ;;
5726 *)
5727 old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
5728 ;;
5729 esac
5730 old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
5731 fi
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766 # If no C compiler was specified, use CC.
5767 LTCC=${LTCC-"$CC"}
5768
5769 # If no C compiler flags were specified, use CFLAGS.
5770 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
5771
5772 # Allow CC to be a program name with arguments.
5773 compiler=$CC
5774
5775
5776 # Check for command to grab the raw symbol name followed by C symbol from nm.
5777 { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
5778 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
5779 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then :
5780 $as_echo_n "(cached) " >&6
5781 else
5782
5783 # These are sane defaults that work on at least a few old systems.
5784 # [They come from Ultrix. What could be older than Ultrix?!! ;)]
5785
5786 # Character class describing NM global symbol codes.
5787 symcode='[BCDEGRST]'
5788
5789 # Regexp to match symbols that can be accessed directly from C.
5790 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
5791
5792 # Define system-specific variables.
5793 case $host_os in
5794 aix*)
5795 symcode='[BCDT]'
5796 ;;
5797 cygwin* | mingw* | pw32* | cegcc*)
5798 symcode='[ABCDGISTW]'
5799 ;;
5800 hpux*)
5801 if test "$host_cpu" = ia64; then
5802 symcode='[ABCDEGRST]'
5803 fi
5804 ;;
5805 irix* | nonstopux*)
5806 symcode='[BCDEGRST]'
5807 ;;
5808 osf*)
5809 symcode='[BCDEGQRST]'
5810 ;;
5811 solaris*)
5812 symcode='[BDRT]'
5813 ;;
5814 sco3.2v5*)
5815 symcode='[DT]'
5816 ;;
5817 sysv4.2uw2*)
5818 symcode='[DT]'
5819 ;;
5820 sysv5* | sco5v6* | unixware* | OpenUNIX*)
5821 symcode='[ABDT]'
5822 ;;
5823 sysv4)
5824 symcode='[DFNSTU]'
5825 ;;
5826 esac
5827
5828 # If we're using GNU nm, then use its standard symbol codes.
5829 case `$NM -V 2>&1` in
5830 *GNU* | *'with BFD'*)
5831 symcode='[ABCDGIRSTW]' ;;
5832 esac
5833
5834 # Transform an extracted symbol line into a proper C declaration.
5835 # Some systems (esp. on ia64) link data and code symbols differently,
5836 # so use this general approach.
5837 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
5838
5839 # Transform an extracted symbol line into symbol name and symbol address
5840 lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
5841 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
5842
5843 # Handle CRLF in mingw tool chain
5844 opt_cr=
5845 case $build_os in
5846 mingw*)
5847 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
5848 ;;
5849 esac
5850
5851 # Try without a prefix underscore, then with it.
5852 for ac_symprfx in "" "_"; do
5853
5854 # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
5855 symxfrm="\\1 $ac_symprfx\\2 \\2"
5856
5857 # Write the raw and C identifiers.
5858 if test "$lt_cv_nm_interface" = "MS dumpbin"; then
5859 # Fake it for dumpbin and say T for any non-static function
5860 # and D for any global variable.
5861 # Also find C++ and __fastcall symbols from MSVC++,
5862 # which start with @ or ?.
5863 lt_cv_sys_global_symbol_pipe="$AWK '"\
5864 " {last_section=section; section=\$ 3};"\
5865 " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
5866 " \$ 0!~/External *\|/{next};"\
5867 " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
5868 " {if(hide[section]) next};"\
5869 " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
5870 " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
5871 " s[1]~/^[@?]/{print s[1], s[1]; next};"\
5872 " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
5873 " ' prfx=^$ac_symprfx"
5874 else
5875 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
5876 fi
5877
5878 # Check to see that the pipe works correctly.
5879 pipe_works=no
5880
5881 rm -f conftest*
5882 cat > conftest.$ac_ext <<_LT_EOF
5883 #ifdef __cplusplus
5884 extern "C" {
5885 #endif
5886 char nm_test_var;
5887 void nm_test_func(void);
5888 void nm_test_func(void){}
5889 #ifdef __cplusplus
5890 }
5891 #endif
5892 int main(){nm_test_var='a';nm_test_func();return(0);}
5893 _LT_EOF
5894
5895 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
5896 (eval $ac_compile) 2>&5
5897 ac_status=$?
5898 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5899 test $ac_status = 0; }; then
5900 # Now try to grab the symbols.
5901 nlist=conftest.nm
5902 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5
5903 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
5904 ac_status=$?
5905 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5906 test $ac_status = 0; } && test -s "$nlist"; then
5907 # Try sorting and uniquifying the output.
5908 if sort "$nlist" | uniq > "$nlist"T; then
5909 mv -f "$nlist"T "$nlist"
5910 else
5911 rm -f "$nlist"T
5912 fi
5913
5914 # Make sure that we snagged all the symbols we need.
5915 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
5916 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
5917 cat <<_LT_EOF > conftest.$ac_ext
5918 #ifdef __cplusplus
5919 extern "C" {
5920 #endif
5921
5922 _LT_EOF
5923 # Now generate the symbol file.
5924 eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
5925
5926 cat <<_LT_EOF >> conftest.$ac_ext
5927
5928 /* The mapping between symbol names and symbols. */
5929 const struct {
5930 const char *name;
5931 void *address;
5932 }
5933 lt__PROGRAM__LTX_preloaded_symbols[] =
5934 {
5935 { "@PROGRAM@", (void *) 0 },
5936 _LT_EOF
5937 $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
5938 cat <<\_LT_EOF >> conftest.$ac_ext
5939 {0, (void *) 0}
5940 };
5941
5942 /* This works around a problem in FreeBSD linker */
5943 #ifdef FREEBSD_WORKAROUND
5944 static const void *lt_preloaded_setup() {
5945 return lt__PROGRAM__LTX_preloaded_symbols;
5946 }
5947 #endif
5948
5949 #ifdef __cplusplus
5950 }
5951 #endif
5952 _LT_EOF
5953 # Now try linking the two files.
5954 mv conftest.$ac_objext conftstm.$ac_objext
5955 lt_save_LIBS="$LIBS"
5956 lt_save_CFLAGS="$CFLAGS"
5957 LIBS="conftstm.$ac_objext"
5958 CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
5959 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
5960 (eval $ac_link) 2>&5
5961 ac_status=$?
5962 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
5963 test $ac_status = 0; } && test -s conftest${ac_exeext}; then
5964 pipe_works=yes
5965 fi
5966 LIBS="$lt_save_LIBS"
5967 CFLAGS="$lt_save_CFLAGS"
5968 else
5969 echo "cannot find nm_test_func in $nlist" >&5
5970 fi
5971 else
5972 echo "cannot find nm_test_var in $nlist" >&5
5973 fi
5974 else
5975 echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
5976 fi
5977 else
5978 echo "$progname: failed program was:" >&5
5979 cat conftest.$ac_ext >&5
5980 fi
5981 rm -rf conftest* conftst*
5982
5983 # Do not use the global_symbol_pipe unless it works.
5984 if test "$pipe_works" = yes; then
5985 break
5986 else
5987 lt_cv_sys_global_symbol_pipe=
5988 fi
5989 done
5990
5991 fi
5992
5993 if test -z "$lt_cv_sys_global_symbol_pipe"; then
5994 lt_cv_sys_global_symbol_to_cdecl=
5995 fi
5996 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
5997 { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
5998 $as_echo "failed" >&6; }
5999 else
6000 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
6001 $as_echo "ok" >&6; }
6002 fi
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026 # Check whether --enable-libtool-lock was given.
6027 if test "${enable_libtool_lock+set}" = set; then :
6028 enableval=$enable_libtool_lock;
6029 fi
6030
6031 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
6032
6033 # Some flags need to be propagated to the compiler or linker for good
6034 # libtool support.
6035 case $host in
6036 ia64-*-hpux*)
6037 # Find out which ABI we are using.
6038 echo 'int i;' > conftest.$ac_ext
6039 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6040 (eval $ac_compile) 2>&5
6041 ac_status=$?
6042 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6043 test $ac_status = 0; }; then
6044 case `/usr/bin/file conftest.$ac_objext` in
6045 *ELF-32*)
6046 HPUX_IA64_MODE="32"
6047 ;;
6048 *ELF-64*)
6049 HPUX_IA64_MODE="64"
6050 ;;
6051 esac
6052 fi
6053 rm -rf conftest*
6054 ;;
6055 *-*-irix6*)
6056 # Find out which ABI we are using.
6057 echo '#line 6058 "configure"' > conftest.$ac_ext
6058 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6059 (eval $ac_compile) 2>&5
6060 ac_status=$?
6061 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6062 test $ac_status = 0; }; then
6063 if test "$lt_cv_prog_gnu_ld" = yes; then
6064 case `/usr/bin/file conftest.$ac_objext` in
6065 *32-bit*)
6066 LD="${LD-ld} -melf32bsmip"
6067 ;;
6068 *N32*)
6069 LD="${LD-ld} -melf32bmipn32"
6070 ;;
6071 *64-bit*)
6072 LD="${LD-ld} -melf64bmip"
6073 ;;
6074 esac
6075 else
6076 case `/usr/bin/file conftest.$ac_objext` in
6077 *32-bit*)
6078 LD="${LD-ld} -32"
6079 ;;
6080 *N32*)
6081 LD="${LD-ld} -n32"
6082 ;;
6083 *64-bit*)
6084 LD="${LD-ld} -64"
6085 ;;
6086 esac
6087 fi
6088 fi
6089 rm -rf conftest*
6090 ;;
6091
6092 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
6093 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
6094 # Find out which ABI we are using.
6095 echo 'int i;' > conftest.$ac_ext
6096 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6097 (eval $ac_compile) 2>&5
6098 ac_status=$?
6099 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6100 test $ac_status = 0; }; then
6101 case `/usr/bin/file conftest.o` in
6102 *32-bit*)
6103 case $host in
6104 x86_64-*kfreebsd*-gnu)
6105 LD="${LD-ld} -m elf_i386_fbsd"
6106 ;;
6107 x86_64-*linux*)
6108 LD="${LD-ld} -m elf_i386"
6109 ;;
6110 ppc64-*linux*|powerpc64-*linux*)
6111 LD="${LD-ld} -m elf32ppclinux"
6112 ;;
6113 s390x-*linux*)
6114 LD="${LD-ld} -m elf_s390"
6115 ;;
6116 sparc64-*linux*)
6117 LD="${LD-ld} -m elf32_sparc"
6118 ;;
6119 esac
6120 ;;
6121 *64-bit*)
6122 case $host in
6123 x86_64-*kfreebsd*-gnu)
6124 LD="${LD-ld} -m elf_x86_64_fbsd"
6125 ;;
6126 x86_64-*linux*)
6127 LD="${LD-ld} -m elf_x86_64"
6128 ;;
6129 ppc*-*linux*|powerpc*-*linux*)
6130 LD="${LD-ld} -m elf64ppc"
6131 ;;
6132 s390*-*linux*|s390*-*tpf*)
6133 LD="${LD-ld} -m elf64_s390"
6134 ;;
6135 sparc*-*linux*)
6136 LD="${LD-ld} -m elf64_sparc"
6137 ;;
6138 esac
6139 ;;
6140 esac
6141 fi
6142 rm -rf conftest*
6143 ;;
6144
6145 *-*-sco3.2v5*)
6146 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6147 SAVE_CFLAGS="$CFLAGS"
6148 CFLAGS="$CFLAGS -belf"
6149 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
6150 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
6151 if test "${lt_cv_cc_needs_belf+set}" = set; then :
6152 $as_echo_n "(cached) " >&6
6153 else
6154 ac_ext=c
6155 ac_cpp='$CPP $CPPFLAGS'
6156 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6157 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6158 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6159
6160 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6161 /* end confdefs.h. */
6162
6163 int
6164 main ()
6165 {
6166
6167 ;
6168 return 0;
6169 }
6170 _ACEOF
6171 if ac_fn_c_try_link "$LINENO"; then :
6172 lt_cv_cc_needs_belf=yes
6173 else
6174 lt_cv_cc_needs_belf=no
6175 fi
6176 rm -f core conftest.err conftest.$ac_objext \
6177 conftest$ac_exeext conftest.$ac_ext
6178 ac_ext=c
6179 ac_cpp='$CPP $CPPFLAGS'
6180 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6181 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6182 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6183
6184 fi
6185 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
6186 $as_echo "$lt_cv_cc_needs_belf" >&6; }
6187 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
6188 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6189 CFLAGS="$SAVE_CFLAGS"
6190 fi
6191 ;;
6192 sparc*-*solaris*)
6193 # Find out which ABI we are using.
6194 echo 'int i;' > conftest.$ac_ext
6195 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6196 (eval $ac_compile) 2>&5
6197 ac_status=$?
6198 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6199 test $ac_status = 0; }; then
6200 case `/usr/bin/file conftest.o` in
6201 *64-bit*)
6202 case $lt_cv_prog_gnu_ld in
6203 yes*) LD="${LD-ld} -m elf64_sparc" ;;
6204 *)
6205 if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
6206 LD="${LD-ld} -64"
6207 fi
6208 ;;
6209 esac
6210 ;;
6211 esac
6212 fi
6213 rm -rf conftest*
6214 ;;
6215 esac
6216
6217 need_locks="$enable_libtool_lock"
6218
6219
6220 case $host_os in
6221 rhapsody* | darwin*)
6222 if test -n "$ac_tool_prefix"; then
6223 # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
6224 set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
6225 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6226 $as_echo_n "checking for $ac_word... " >&6; }
6227 if test "${ac_cv_prog_DSYMUTIL+set}" = set; then :
6228 $as_echo_n "(cached) " >&6
6229 else
6230 if test -n "$DSYMUTIL"; then
6231 ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
6232 else
6233 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6234 for as_dir in $PATH
6235 do
6236 IFS=$as_save_IFS
6237 test -z "$as_dir" && as_dir=.
6238 for ac_exec_ext in '' $ac_executable_extensions; do
6239 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6240 ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
6241 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6242 break 2
6243 fi
6244 done
6245 done
6246 IFS=$as_save_IFS
6247
6248 fi
6249 fi
6250 DSYMUTIL=$ac_cv_prog_DSYMUTIL
6251 if test -n "$DSYMUTIL"; then
6252 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
6253 $as_echo "$DSYMUTIL" >&6; }
6254 else
6255 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6256 $as_echo "no" >&6; }
6257 fi
6258
6259
6260 fi
6261 if test -z "$ac_cv_prog_DSYMUTIL"; then
6262 ac_ct_DSYMUTIL=$DSYMUTIL
6263 # Extract the first word of "dsymutil", so it can be a program name with args.
6264 set dummy dsymutil; ac_word=$2
6265 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6266 $as_echo_n "checking for $ac_word... " >&6; }
6267 if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then :
6268 $as_echo_n "(cached) " >&6
6269 else
6270 if test -n "$ac_ct_DSYMUTIL"; then
6271 ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
6272 else
6273 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6274 for as_dir in $PATH
6275 do
6276 IFS=$as_save_IFS
6277 test -z "$as_dir" && as_dir=.
6278 for ac_exec_ext in '' $ac_executable_extensions; do
6279 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6280 ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
6281 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6282 break 2
6283 fi
6284 done
6285 done
6286 IFS=$as_save_IFS
6287
6288 fi
6289 fi
6290 ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
6291 if test -n "$ac_ct_DSYMUTIL"; then
6292 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
6293 $as_echo "$ac_ct_DSYMUTIL" >&6; }
6294 else
6295 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6296 $as_echo "no" >&6; }
6297 fi
6298
6299 if test "x$ac_ct_DSYMUTIL" = x; then
6300 DSYMUTIL=":"
6301 else
6302 case $cross_compiling:$ac_tool_warned in
6303 yes:)
6304 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6305 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6306 ac_tool_warned=yes ;;
6307 esac
6308 DSYMUTIL=$ac_ct_DSYMUTIL
6309 fi
6310 else
6311 DSYMUTIL="$ac_cv_prog_DSYMUTIL"
6312 fi
6313
6314 if test -n "$ac_tool_prefix"; then
6315 # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
6316 set dummy ${ac_tool_prefix}nmedit; ac_word=$2
6317 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6318 $as_echo_n "checking for $ac_word... " >&6; }
6319 if test "${ac_cv_prog_NMEDIT+set}" = set; then :
6320 $as_echo_n "(cached) " >&6
6321 else
6322 if test -n "$NMEDIT"; then
6323 ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
6324 else
6325 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6326 for as_dir in $PATH
6327 do
6328 IFS=$as_save_IFS
6329 test -z "$as_dir" && as_dir=.
6330 for ac_exec_ext in '' $ac_executable_extensions; do
6331 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6332 ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
6333 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6334 break 2
6335 fi
6336 done
6337 done
6338 IFS=$as_save_IFS
6339
6340 fi
6341 fi
6342 NMEDIT=$ac_cv_prog_NMEDIT
6343 if test -n "$NMEDIT"; then
6344 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
6345 $as_echo "$NMEDIT" >&6; }
6346 else
6347 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6348 $as_echo "no" >&6; }
6349 fi
6350
6351
6352 fi
6353 if test -z "$ac_cv_prog_NMEDIT"; then
6354 ac_ct_NMEDIT=$NMEDIT
6355 # Extract the first word of "nmedit", so it can be a program name with args.
6356 set dummy nmedit; ac_word=$2
6357 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6358 $as_echo_n "checking for $ac_word... " >&6; }
6359 if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then :
6360 $as_echo_n "(cached) " >&6
6361 else
6362 if test -n "$ac_ct_NMEDIT"; then
6363 ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
6364 else
6365 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6366 for as_dir in $PATH
6367 do
6368 IFS=$as_save_IFS
6369 test -z "$as_dir" && as_dir=.
6370 for ac_exec_ext in '' $ac_executable_extensions; do
6371 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6372 ac_cv_prog_ac_ct_NMEDIT="nmedit"
6373 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6374 break 2
6375 fi
6376 done
6377 done
6378 IFS=$as_save_IFS
6379
6380 fi
6381 fi
6382 ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
6383 if test -n "$ac_ct_NMEDIT"; then
6384 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
6385 $as_echo "$ac_ct_NMEDIT" >&6; }
6386 else
6387 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6388 $as_echo "no" >&6; }
6389 fi
6390
6391 if test "x$ac_ct_NMEDIT" = x; then
6392 NMEDIT=":"
6393 else
6394 case $cross_compiling:$ac_tool_warned in
6395 yes:)
6396 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6397 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6398 ac_tool_warned=yes ;;
6399 esac
6400 NMEDIT=$ac_ct_NMEDIT
6401 fi
6402 else
6403 NMEDIT="$ac_cv_prog_NMEDIT"
6404 fi
6405
6406 if test -n "$ac_tool_prefix"; then
6407 # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
6408 set dummy ${ac_tool_prefix}lipo; ac_word=$2
6409 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6410 $as_echo_n "checking for $ac_word... " >&6; }
6411 if test "${ac_cv_prog_LIPO+set}" = set; then :
6412 $as_echo_n "(cached) " >&6
6413 else
6414 if test -n "$LIPO"; then
6415 ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
6416 else
6417 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6418 for as_dir in $PATH
6419 do
6420 IFS=$as_save_IFS
6421 test -z "$as_dir" && as_dir=.
6422 for ac_exec_ext in '' $ac_executable_extensions; do
6423 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6424 ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
6425 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6426 break 2
6427 fi
6428 done
6429 done
6430 IFS=$as_save_IFS
6431
6432 fi
6433 fi
6434 LIPO=$ac_cv_prog_LIPO
6435 if test -n "$LIPO"; then
6436 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
6437 $as_echo "$LIPO" >&6; }
6438 else
6439 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6440 $as_echo "no" >&6; }
6441 fi
6442
6443
6444 fi
6445 if test -z "$ac_cv_prog_LIPO"; then
6446 ac_ct_LIPO=$LIPO
6447 # Extract the first word of "lipo", so it can be a program name with args.
6448 set dummy lipo; ac_word=$2
6449 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6450 $as_echo_n "checking for $ac_word... " >&6; }
6451 if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then :
6452 $as_echo_n "(cached) " >&6
6453 else
6454 if test -n "$ac_ct_LIPO"; then
6455 ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
6456 else
6457 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6458 for as_dir in $PATH
6459 do
6460 IFS=$as_save_IFS
6461 test -z "$as_dir" && as_dir=.
6462 for ac_exec_ext in '' $ac_executable_extensions; do
6463 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6464 ac_cv_prog_ac_ct_LIPO="lipo"
6465 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6466 break 2
6467 fi
6468 done
6469 done
6470 IFS=$as_save_IFS
6471
6472 fi
6473 fi
6474 ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
6475 if test -n "$ac_ct_LIPO"; then
6476 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
6477 $as_echo "$ac_ct_LIPO" >&6; }
6478 else
6479 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6480 $as_echo "no" >&6; }
6481 fi
6482
6483 if test "x$ac_ct_LIPO" = x; then
6484 LIPO=":"
6485 else
6486 case $cross_compiling:$ac_tool_warned in
6487 yes:)
6488 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6489 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6490 ac_tool_warned=yes ;;
6491 esac
6492 LIPO=$ac_ct_LIPO
6493 fi
6494 else
6495 LIPO="$ac_cv_prog_LIPO"
6496 fi
6497
6498 if test -n "$ac_tool_prefix"; then
6499 # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
6500 set dummy ${ac_tool_prefix}otool; ac_word=$2
6501 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6502 $as_echo_n "checking for $ac_word... " >&6; }
6503 if test "${ac_cv_prog_OTOOL+set}" = set; then :
6504 $as_echo_n "(cached) " >&6
6505 else
6506 if test -n "$OTOOL"; then
6507 ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
6508 else
6509 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6510 for as_dir in $PATH
6511 do
6512 IFS=$as_save_IFS
6513 test -z "$as_dir" && as_dir=.
6514 for ac_exec_ext in '' $ac_executable_extensions; do
6515 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6516 ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
6517 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6518 break 2
6519 fi
6520 done
6521 done
6522 IFS=$as_save_IFS
6523
6524 fi
6525 fi
6526 OTOOL=$ac_cv_prog_OTOOL
6527 if test -n "$OTOOL"; then
6528 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
6529 $as_echo "$OTOOL" >&6; }
6530 else
6531 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6532 $as_echo "no" >&6; }
6533 fi
6534
6535
6536 fi
6537 if test -z "$ac_cv_prog_OTOOL"; then
6538 ac_ct_OTOOL=$OTOOL
6539 # Extract the first word of "otool", so it can be a program name with args.
6540 set dummy otool; ac_word=$2
6541 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6542 $as_echo_n "checking for $ac_word... " >&6; }
6543 if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then :
6544 $as_echo_n "(cached) " >&6
6545 else
6546 if test -n "$ac_ct_OTOOL"; then
6547 ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
6548 else
6549 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6550 for as_dir in $PATH
6551 do
6552 IFS=$as_save_IFS
6553 test -z "$as_dir" && as_dir=.
6554 for ac_exec_ext in '' $ac_executable_extensions; do
6555 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6556 ac_cv_prog_ac_ct_OTOOL="otool"
6557 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6558 break 2
6559 fi
6560 done
6561 done
6562 IFS=$as_save_IFS
6563
6564 fi
6565 fi
6566 ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
6567 if test -n "$ac_ct_OTOOL"; then
6568 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
6569 $as_echo "$ac_ct_OTOOL" >&6; }
6570 else
6571 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6572 $as_echo "no" >&6; }
6573 fi
6574
6575 if test "x$ac_ct_OTOOL" = x; then
6576 OTOOL=":"
6577 else
6578 case $cross_compiling:$ac_tool_warned in
6579 yes:)
6580 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6581 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6582 ac_tool_warned=yes ;;
6583 esac
6584 OTOOL=$ac_ct_OTOOL
6585 fi
6586 else
6587 OTOOL="$ac_cv_prog_OTOOL"
6588 fi
6589
6590 if test -n "$ac_tool_prefix"; then
6591 # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
6592 set dummy ${ac_tool_prefix}otool64; ac_word=$2
6593 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6594 $as_echo_n "checking for $ac_word... " >&6; }
6595 if test "${ac_cv_prog_OTOOL64+set}" = set; then :
6596 $as_echo_n "(cached) " >&6
6597 else
6598 if test -n "$OTOOL64"; then
6599 ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
6600 else
6601 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6602 for as_dir in $PATH
6603 do
6604 IFS=$as_save_IFS
6605 test -z "$as_dir" && as_dir=.
6606 for ac_exec_ext in '' $ac_executable_extensions; do
6607 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6608 ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
6609 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6610 break 2
6611 fi
6612 done
6613 done
6614 IFS=$as_save_IFS
6615
6616 fi
6617 fi
6618 OTOOL64=$ac_cv_prog_OTOOL64
6619 if test -n "$OTOOL64"; then
6620 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
6621 $as_echo "$OTOOL64" >&6; }
6622 else
6623 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6624 $as_echo "no" >&6; }
6625 fi
6626
6627
6628 fi
6629 if test -z "$ac_cv_prog_OTOOL64"; then
6630 ac_ct_OTOOL64=$OTOOL64
6631 # Extract the first word of "otool64", so it can be a program name with args.
6632 set dummy otool64; ac_word=$2
6633 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6634 $as_echo_n "checking for $ac_word... " >&6; }
6635 if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then :
6636 $as_echo_n "(cached) " >&6
6637 else
6638 if test -n "$ac_ct_OTOOL64"; then
6639 ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
6640 else
6641 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6642 for as_dir in $PATH
6643 do
6644 IFS=$as_save_IFS
6645 test -z "$as_dir" && as_dir=.
6646 for ac_exec_ext in '' $ac_executable_extensions; do
6647 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
6648 ac_cv_prog_ac_ct_OTOOL64="otool64"
6649 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6650 break 2
6651 fi
6652 done
6653 done
6654 IFS=$as_save_IFS
6655
6656 fi
6657 fi
6658 ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
6659 if test -n "$ac_ct_OTOOL64"; then
6660 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
6661 $as_echo "$ac_ct_OTOOL64" >&6; }
6662 else
6663 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6664 $as_echo "no" >&6; }
6665 fi
6666
6667 if test "x$ac_ct_OTOOL64" = x; then
6668 OTOOL64=":"
6669 else
6670 case $cross_compiling:$ac_tool_warned in
6671 yes:)
6672 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6673 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6674 ac_tool_warned=yes ;;
6675 esac
6676 OTOOL64=$ac_ct_OTOOL64
6677 fi
6678 else
6679 OTOOL64="$ac_cv_prog_OTOOL64"
6680 fi
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
6709 $as_echo_n "checking for -single_module linker flag... " >&6; }
6710 if test "${lt_cv_apple_cc_single_mod+set}" = set; then :
6711 $as_echo_n "(cached) " >&6
6712 else
6713 lt_cv_apple_cc_single_mod=no
6714 if test -z "${LT_MULTI_MODULE}"; then
6715 # By default we will add the -single_module flag. You can override
6716 # by either setting the environment variable LT_MULTI_MODULE
6717 # non-empty at configure time, or by adding -multi_module to the
6718 # link flags.
6719 rm -rf libconftest.dylib*
6720 echo "int foo(void){return 1;}" > conftest.c
6721 echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
6722 -dynamiclib -Wl,-single_module conftest.c" >&5
6723 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
6724 -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
6725 _lt_result=$?
6726 if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
6727 lt_cv_apple_cc_single_mod=yes
6728 else
6729 cat conftest.err >&5
6730 fi
6731 rm -rf libconftest.dylib*
6732 rm -f conftest.*
6733 fi
6734 fi
6735 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
6736 $as_echo "$lt_cv_apple_cc_single_mod" >&6; }
6737 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
6738 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
6739 if test "${lt_cv_ld_exported_symbols_list+set}" = set; then :
6740 $as_echo_n "(cached) " >&6
6741 else
6742 lt_cv_ld_exported_symbols_list=no
6743 save_LDFLAGS=$LDFLAGS
6744 echo "_main" > conftest.sym
6745 LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
6746 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6747 /* end confdefs.h. */
6748
6749 int
6750 main ()
6751 {
6752
6753 ;
6754 return 0;
6755 }
6756 _ACEOF
6757 if ac_fn_c_try_link "$LINENO"; then :
6758 lt_cv_ld_exported_symbols_list=yes
6759 else
6760 lt_cv_ld_exported_symbols_list=no
6761 fi
6762 rm -f core conftest.err conftest.$ac_objext \
6763 conftest$ac_exeext conftest.$ac_ext
6764 LDFLAGS="$save_LDFLAGS"
6765
6766 fi
6767 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
6768 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
6769 case $host_os in
6770 rhapsody* | darwin1.[012])
6771 _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
6772 darwin1.*)
6773 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
6774 darwin*) # darwin 5.x on
6775 # if running on 10.5 or later, the deployment target defaults
6776 # to the OS version, if on x86, and 10.4, the deployment
6777 # target defaults to 10.4. Don't you love it?
6778 case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
6779 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
6780 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
6781 10.[012]*)
6782 _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
6783 10.*)
6784 _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
6785 esac
6786 ;;
6787 esac
6788 if test "$lt_cv_apple_cc_single_mod" = "yes"; then
6789 _lt_dar_single_mod='$single_module'
6790 fi
6791 if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
6792 _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
6793 else
6794 _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
6795 fi
6796 if test "$DSYMUTIL" != ":"; then
6797 _lt_dsymutil='~$DSYMUTIL $lib || :'
6798 else
6799 _lt_dsymutil=
6800 fi
6801 ;;
6802 esac
6803
6804 ac_ext=c
6805 ac_cpp='$CPP $CPPFLAGS'
6806 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6807 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6808 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6809 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
6810 $as_echo_n "checking how to run the C preprocessor... " >&6; }
6811 # On Suns, sometimes $CPP names a directory.
6812 if test -n "$CPP" && test -d "$CPP"; then
6813 CPP=
6814 fi
6815 if test -z "$CPP"; then
6816 if test "${ac_cv_prog_CPP+set}" = set; then :
6817 $as_echo_n "(cached) " >&6
6818 else
6819 # Double quotes because CPP needs to be expanded
6820 for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
6821 do
6822 ac_preproc_ok=false
6823 for ac_c_preproc_warn_flag in '' yes
6824 do
6825 # Use a header file that comes with gcc, so configuring glibc
6826 # with a fresh cross-compiler works.
6827 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6828 # <limits.h> exists even on freestanding compilers.
6829 # On the NeXT, cc -E runs the code through the compiler's parser,
6830 # not just through cpp. "Syntax error" is here to catch this case.
6831 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6832 /* end confdefs.h. */
6833 #ifdef __STDC__
6834 # include <limits.h>
6835 #else
6836 # include <assert.h>
6837 #endif
6838 Syntax error
6839 _ACEOF
6840 if ac_fn_c_try_cpp "$LINENO"; then :
6841
6842 else
6843 # Broken: fails on valid input.
6844 continue
6845 fi
6846 rm -f conftest.err conftest.$ac_ext
6847
6848 # OK, works on sane cases. Now check whether nonexistent headers
6849 # can be detected and how.
6850 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6851 /* end confdefs.h. */
6852 #include <ac_nonexistent.h>
6853 _ACEOF
6854 if ac_fn_c_try_cpp "$LINENO"; then :
6855 # Broken: success on invalid input.
6856 continue
6857 else
6858 # Passes both tests.
6859 ac_preproc_ok=:
6860 break
6861 fi
6862 rm -f conftest.err conftest.$ac_ext
6863
6864 done
6865 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6866 rm -f conftest.err conftest.$ac_ext
6867 if $ac_preproc_ok; then :
6868 break
6869 fi
6870
6871 done
6872 ac_cv_prog_CPP=$CPP
6873
6874 fi
6875 CPP=$ac_cv_prog_CPP
6876 else
6877 ac_cv_prog_CPP=$CPP
6878 fi
6879 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
6880 $as_echo "$CPP" >&6; }
6881 ac_preproc_ok=false
6882 for ac_c_preproc_warn_flag in '' yes
6883 do
6884 # Use a header file that comes with gcc, so configuring glibc
6885 # with a fresh cross-compiler works.
6886 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
6887 # <limits.h> exists even on freestanding compilers.
6888 # On the NeXT, cc -E runs the code through the compiler's parser,
6889 # not just through cpp. "Syntax error" is here to catch this case.
6890 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6891 /* end confdefs.h. */
6892 #ifdef __STDC__
6893 # include <limits.h>
6894 #else
6895 # include <assert.h>
6896 #endif
6897 Syntax error
6898 _ACEOF
6899 if ac_fn_c_try_cpp "$LINENO"; then :
6900
6901 else
6902 # Broken: fails on valid input.
6903 continue
6904 fi
6905 rm -f conftest.err conftest.$ac_ext
6906
6907 # OK, works on sane cases. Now check whether nonexistent headers
6908 # can be detected and how.
6909 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6910 /* end confdefs.h. */
6911 #include <ac_nonexistent.h>
6912 _ACEOF
6913 if ac_fn_c_try_cpp "$LINENO"; then :
6914 # Broken: success on invalid input.
6915 continue
6916 else
6917 # Passes both tests.
6918 ac_preproc_ok=:
6919 break
6920 fi
6921 rm -f conftest.err conftest.$ac_ext
6922
6923 done
6924 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
6925 rm -f conftest.err conftest.$ac_ext
6926 if $ac_preproc_ok; then :
6927
6928 else
6929 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6930 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6931 as_fn_error "C preprocessor \"$CPP\" fails sanity check
6932 See \`config.log' for more details." "$LINENO" 5; }
6933 fi
6934
6935 ac_ext=c
6936 ac_cpp='$CPP $CPPFLAGS'
6937 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6938 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6939 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6940
6941
6942 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
6943 $as_echo_n "checking for ANSI C header files... " >&6; }
6944 if test "${ac_cv_header_stdc+set}" = set; then :
6945 $as_echo_n "(cached) " >&6
6946 else
6947 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6948 /* end confdefs.h. */
6949 #include <stdlib.h>
6950 #include <stdarg.h>
6951 #include <string.h>
6952 #include <float.h>
6953
6954 int
6955 main ()
6956 {
6957
6958 ;
6959 return 0;
6960 }
6961 _ACEOF
6962 if ac_fn_c_try_compile "$LINENO"; then :
6963 ac_cv_header_stdc=yes
6964 else
6965 ac_cv_header_stdc=no
6966 fi
6967 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6968
6969 if test $ac_cv_header_stdc = yes; then
6970 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
6971 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6972 /* end confdefs.h. */
6973 #include <string.h>
6974
6975 _ACEOF
6976 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6977 $EGREP "memchr" >/dev/null 2>&1; then :
6978
6979 else
6980 ac_cv_header_stdc=no
6981 fi
6982 rm -f conftest*
6983
6984 fi
6985
6986 if test $ac_cv_header_stdc = yes; then
6987 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
6988 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6989 /* end confdefs.h. */
6990 #include <stdlib.h>
6991
6992 _ACEOF
6993 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6994 $EGREP "free" >/dev/null 2>&1; then :
6995
6996 else
6997 ac_cv_header_stdc=no
6998 fi
6999 rm -f conftest*
7000
7001 fi
7002
7003 if test $ac_cv_header_stdc = yes; then
7004 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
7005 if test "$cross_compiling" = yes; then :
7006 :
7007 else
7008 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7009 /* end confdefs.h. */
7010 #include <ctype.h>
7011 #include <stdlib.h>
7012 #if ((' ' & 0x0FF) == 0x020)
7013 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
7014 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
7015 #else
7016 # define ISLOWER(c) \
7017 (('a' <= (c) && (c) <= 'i') \
7018 || ('j' <= (c) && (c) <= 'r') \
7019 || ('s' <= (c) && (c) <= 'z'))
7020 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
7021 #endif
7022
7023 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
7024 int
7025 main ()
7026 {
7027 int i;
7028 for (i = 0; i < 256; i++)
7029 if (XOR (islower (i), ISLOWER (i))
7030 || toupper (i) != TOUPPER (i))
7031 return 2;
7032 return 0;
7033 }
7034 _ACEOF
7035 if ac_fn_c_try_run "$LINENO"; then :
7036
7037 else
7038 ac_cv_header_stdc=no
7039 fi
7040 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7041 conftest.$ac_objext conftest.beam conftest.$ac_ext
7042 fi
7043
7044 fi
7045 fi
7046 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
7047 $as_echo "$ac_cv_header_stdc" >&6; }
7048 if test $ac_cv_header_stdc = yes; then
7049
7050 $as_echo "#define STDC_HEADERS 1" >>confdefs.h
7051
7052 fi
7053
7054 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
7055 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
7056 inttypes.h stdint.h unistd.h
7057 do :
7058 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7059 ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
7060 "
7061 eval as_val=\$$as_ac_Header
7062 if test "x$as_val" = x""yes; then :
7063 cat >>confdefs.h <<_ACEOF
7064 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7065 _ACEOF
7066
7067 fi
7068
7069 done
7070
7071
7072 for ac_header in dlfcn.h
7073 do :
7074 ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
7075 "
7076 if test "x$ac_cv_header_dlfcn_h" = x""yes; then :
7077 cat >>confdefs.h <<_ACEOF
7078 #define HAVE_DLFCN_H 1
7079 _ACEOF
7080
7081 fi
7082
7083 done
7084
7085
7086
7087 # Set options
7088
7089
7090
7091 enable_dlopen=no
7092
7093
7094 enable_win32_dll=no
7095
7096
7097 # Check whether --enable-shared was given.
7098 if test "${enable_shared+set}" = set; then :
7099 enableval=$enable_shared; p=${PACKAGE-default}
7100 case $enableval in
7101 yes) enable_shared=yes ;;
7102 no) enable_shared=no ;;
7103 *)
7104 enable_shared=no
7105 # Look at the argument we got. We use all the common list separators.
7106 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7107 for pkg in $enableval; do
7108 IFS="$lt_save_ifs"
7109 if test "X$pkg" = "X$p"; then
7110 enable_shared=yes
7111 fi
7112 done
7113 IFS="$lt_save_ifs"
7114 ;;
7115 esac
7116 else
7117 enable_shared=yes
7118 fi
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128 # Check whether --enable-static was given.
7129 if test "${enable_static+set}" = set; then :
7130 enableval=$enable_static; p=${PACKAGE-default}
7131 case $enableval in
7132 yes) enable_static=yes ;;
7133 no) enable_static=no ;;
7134 *)
7135 enable_static=no
7136 # Look at the argument we got. We use all the common list separators.
7137 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7138 for pkg in $enableval; do
7139 IFS="$lt_save_ifs"
7140 if test "X$pkg" = "X$p"; then
7141 enable_static=yes
7142 fi
7143 done
7144 IFS="$lt_save_ifs"
7145 ;;
7146 esac
7147 else
7148 enable_static=yes
7149 fi
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160 # Check whether --with-pic was given.
7161 if test "${with_pic+set}" = set; then :
7162 withval=$with_pic; pic_mode="$withval"
7163 else
7164 pic_mode=default
7165 fi
7166
7167
7168 test -z "$pic_mode" && pic_mode=default
7169
7170
7171
7172
7173
7174
7175
7176 # Check whether --enable-fast-install was given.
7177 if test "${enable_fast_install+set}" = set; then :
7178 enableval=$enable_fast_install; p=${PACKAGE-default}
7179 case $enableval in
7180 yes) enable_fast_install=yes ;;
7181 no) enable_fast_install=no ;;
7182 *)
7183 enable_fast_install=no
7184 # Look at the argument we got. We use all the common list separators.
7185 lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7186 for pkg in $enableval; do
7187 IFS="$lt_save_ifs"
7188 if test "X$pkg" = "X$p"; then
7189 enable_fast_install=yes
7190 fi
7191 done
7192 IFS="$lt_save_ifs"
7193 ;;
7194 esac
7195 else
7196 enable_fast_install=yes
7197 fi
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209 # This can be used to rebuild libtool when needed
7210 LIBTOOL_DEPS="$ltmain"
7211
7212 # Always use our own libtool.
7213 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239 test -z "$LN_S" && LN_S="ln -s"
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254 if test -n "${ZSH_VERSION+set}" ; then
7255 setopt NO_GLOB_SUBST
7256 fi
7257
7258 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
7259 $as_echo_n "checking for objdir... " >&6; }
7260 if test "${lt_cv_objdir+set}" = set; then :
7261 $as_echo_n "(cached) " >&6
7262 else
7263 rm -f .libs 2>/dev/null
7264 mkdir .libs 2>/dev/null
7265 if test -d .libs; then
7266 lt_cv_objdir=.libs
7267 else
7268 # MS-DOS does not allow filenames that begin with a dot.
7269 lt_cv_objdir=_libs
7270 fi
7271 rmdir .libs 2>/dev/null
7272 fi
7273 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
7274 $as_echo "$lt_cv_objdir" >&6; }
7275 objdir=$lt_cv_objdir
7276
7277
7278
7279
7280
7281 cat >>confdefs.h <<_ACEOF
7282 #define LT_OBJDIR "$lt_cv_objdir/"
7283 _ACEOF
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301 case $host_os in
7302 aix3*)
7303 # AIX sometimes has problems with the GCC collect2 program. For some
7304 # reason, if we set the COLLECT_NAMES environment variable, the problems
7305 # vanish in a puff of smoke.
7306 if test "X${COLLECT_NAMES+set}" != Xset; then
7307 COLLECT_NAMES=
7308 export COLLECT_NAMES
7309 fi
7310 ;;
7311 esac
7312
7313 # Sed substitution that helps us do robust quoting. It backslashifies
7314 # metacharacters that are still active within double-quoted strings.
7315 sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
7316
7317 # Same as above, but do not quote variable references.
7318 double_quote_subst='s/\(["`\\]\)/\\\1/g'
7319
7320 # Sed substitution to delay expansion of an escaped shell variable in a
7321 # double_quote_subst'ed string.
7322 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
7323
7324 # Sed substitution to delay expansion of an escaped single quote.
7325 delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
7326
7327 # Sed substitution to avoid accidental globbing in evaled expressions
7328 no_glob_subst='s/\*/\\\*/g'
7329
7330 # Global variables:
7331 ofile=libtool
7332 can_build_shared=yes
7333
7334 # All known linkers require a `.a' archive for static linking (except MSVC,
7335 # which needs '.lib').
7336 libext=a
7337
7338 with_gnu_ld="$lt_cv_prog_gnu_ld"
7339
7340 old_CC="$CC"
7341 old_CFLAGS="$CFLAGS"
7342
7343 # Set sane defaults for various variables
7344 test -z "$CC" && CC=cc
7345 test -z "$LTCC" && LTCC=$CC
7346 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
7347 test -z "$LD" && LD=ld
7348 test -z "$ac_objext" && ac_objext=o
7349
7350 for cc_temp in $compiler""; do
7351 case $cc_temp in
7352 compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
7353 distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
7354 \-*) ;;
7355 *) break;;
7356 esac
7357 done
7358 cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
7359
7360
7361 # Only perform the check for file, if the check method requires it
7362 test -z "$MAGIC_CMD" && MAGIC_CMD=file
7363 case $deplibs_check_method in
7364 file_magic*)
7365 if test "$file_magic_cmd" = '$MAGIC_CMD'; then
7366 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
7367 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
7368 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
7369 $as_echo_n "(cached) " >&6
7370 else
7371 case $MAGIC_CMD in
7372 [\\/*] | ?:[\\/]*)
7373 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7374 ;;
7375 *)
7376 lt_save_MAGIC_CMD="$MAGIC_CMD"
7377 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7378 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
7379 for ac_dir in $ac_dummy; do
7380 IFS="$lt_save_ifs"
7381 test -z "$ac_dir" && ac_dir=.
7382 if test -f $ac_dir/${ac_tool_prefix}file; then
7383 lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
7384 if test -n "$file_magic_test_file"; then
7385 case $deplibs_check_method in
7386 "file_magic "*)
7387 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
7388 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7389 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7390 $EGREP "$file_magic_regex" > /dev/null; then
7391 :
7392 else
7393 cat <<_LT_EOF 1>&2
7394
7395 *** Warning: the command libtool uses to detect shared libraries,
7396 *** $file_magic_cmd, produces output that libtool cannot recognize.
7397 *** The result is that libtool may fail to recognize shared libraries
7398 *** as such. This will affect the creation of libtool libraries that
7399 *** depend on shared libraries, but programs linked with such libtool
7400 *** libraries will work regardless of this problem. Nevertheless, you
7401 *** may want to report the problem to your system manager and/or to
7402 *** bug-libtool@gnu.org
7403
7404 _LT_EOF
7405 fi ;;
7406 esac
7407 fi
7408 break
7409 fi
7410 done
7411 IFS="$lt_save_ifs"
7412 MAGIC_CMD="$lt_save_MAGIC_CMD"
7413 ;;
7414 esac
7415 fi
7416
7417 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7418 if test -n "$MAGIC_CMD"; then
7419 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
7420 $as_echo "$MAGIC_CMD" >&6; }
7421 else
7422 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7423 $as_echo "no" >&6; }
7424 fi
7425
7426
7427
7428
7429
7430 if test -z "$lt_cv_path_MAGIC_CMD"; then
7431 if test -n "$ac_tool_prefix"; then
7432 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
7433 $as_echo_n "checking for file... " >&6; }
7434 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then :
7435 $as_echo_n "(cached) " >&6
7436 else
7437 case $MAGIC_CMD in
7438 [\\/*] | ?:[\\/]*)
7439 lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
7440 ;;
7441 *)
7442 lt_save_MAGIC_CMD="$MAGIC_CMD"
7443 lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
7444 ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
7445 for ac_dir in $ac_dummy; do
7446 IFS="$lt_save_ifs"
7447 test -z "$ac_dir" && ac_dir=.
7448 if test -f $ac_dir/file; then
7449 lt_cv_path_MAGIC_CMD="$ac_dir/file"
7450 if test -n "$file_magic_test_file"; then
7451 case $deplibs_check_method in
7452 "file_magic "*)
7453 file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
7454 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7455 if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
7456 $EGREP "$file_magic_regex" > /dev/null; then
7457 :
7458 else
7459 cat <<_LT_EOF 1>&2
7460
7461 *** Warning: the command libtool uses to detect shared libraries,
7462 *** $file_magic_cmd, produces output that libtool cannot recognize.
7463 *** The result is that libtool may fail to recognize shared libraries
7464 *** as such. This will affect the creation of libtool libraries that
7465 *** depend on shared libraries, but programs linked with such libtool
7466 *** libraries will work regardless of this problem. Nevertheless, you
7467 *** may want to report the problem to your system manager and/or to
7468 *** bug-libtool@gnu.org
7469
7470 _LT_EOF
7471 fi ;;
7472 esac
7473 fi
7474 break
7475 fi
7476 done
7477 IFS="$lt_save_ifs"
7478 MAGIC_CMD="$lt_save_MAGIC_CMD"
7479 ;;
7480 esac
7481 fi
7482
7483 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
7484 if test -n "$MAGIC_CMD"; then
7485 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
7486 $as_echo "$MAGIC_CMD" >&6; }
7487 else
7488 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7489 $as_echo "no" >&6; }
7490 fi
7491
7492
7493 else
7494 MAGIC_CMD=:
7495 fi
7496 fi
7497
7498 fi
7499 ;;
7500 esac
7501
7502 # Use C for the default configuration in the libtool script
7503
7504 lt_save_CC="$CC"
7505 ac_ext=c
7506 ac_cpp='$CPP $CPPFLAGS'
7507 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7508 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7509 ac_compiler_gnu=$ac_cv_c_compiler_gnu
7510
7511
7512 # Source file extension for C test sources.
7513 ac_ext=c
7514
7515 # Object file extension for compiled C test sources.
7516 objext=o
7517 objext=$objext
7518
7519 # Code to be used in simple compile tests
7520 lt_simple_compile_test_code="int some_variable = 0;"
7521
7522 # Code to be used in simple link tests
7523 lt_simple_link_test_code='int main(){return(0);}'
7524
7525
7526
7527
7528
7529
7530
7531 # If no C compiler was specified, use CC.
7532 LTCC=${LTCC-"$CC"}
7533
7534 # If no C compiler flags were specified, use CFLAGS.
7535 LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
7536
7537 # Allow CC to be a program name with arguments.
7538 compiler=$CC
7539
7540 # Save the default compiler, since it gets overwritten when the other
7541 # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
7542 compiler_DEFAULT=$CC
7543
7544 # save warnings/boilerplate of simple test code
7545 ac_outfile=conftest.$ac_objext
7546 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
7547 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
7548 _lt_compiler_boilerplate=`cat conftest.err`
7549 $RM conftest*
7550
7551 ac_outfile=conftest.$ac_objext
7552 echo "$lt_simple_link_test_code" >conftest.$ac_ext
7553 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
7554 _lt_linker_boilerplate=`cat conftest.err`
7555 $RM -r conftest*
7556
7557
7558 ## CAVEAT EMPTOR:
7559 ## There is no encapsulation within the following macros, do not change
7560 ## the running order or otherwise move them around unless you know exactly
7561 ## what you are doing...
7562 if test -n "$compiler"; then
7563
7564 lt_prog_compiler_no_builtin_flag=
7565
7566 if test "$GCC" = yes; then
7567 lt_prog_compiler_no_builtin_flag=' -fno-builtin'
7568
7569 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
7570 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
7571 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then :
7572 $as_echo_n "(cached) " >&6
7573 else
7574 lt_cv_prog_compiler_rtti_exceptions=no
7575 ac_outfile=conftest.$ac_objext
7576 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7577 lt_compiler_flag="-fno-rtti -fno-exceptions"
7578 # Insert the option either (1) after the last *FLAGS variable, or
7579 # (2) before a word containing "conftest.", or (3) at the end.
7580 # Note that $ac_compile itself does not contain backslashes and begins
7581 # with a dollar sign (not a hyphen), so the echo should work correctly.
7582 # The option is referenced via a variable to avoid confusing sed.
7583 lt_compile=`echo "$ac_compile" | $SED \
7584 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7585 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7586 -e 's:$: $lt_compiler_flag:'`
7587 (eval echo "\"\$as_me:7588: $lt_compile\"" >&5)
7588 (eval "$lt_compile" 2>conftest.err)
7589 ac_status=$?
7590 cat conftest.err >&5
7591 echo "$as_me:7592: \$? = $ac_status" >&5
7592 if (exit $ac_status) && test -s "$ac_outfile"; then
7593 # The compiler can only warn and ignore the option if not recognized
7594 # So say no if there are warnings other than the usual output.
7595 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
7596 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
7597 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
7598 lt_cv_prog_compiler_rtti_exceptions=yes
7599 fi
7600 fi
7601 $RM conftest*
7602
7603 fi
7604 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
7605 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
7606
7607 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
7608 lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
7609 else
7610 :
7611 fi
7612
7613 fi
7614
7615
7616
7617
7618
7619
7620 lt_prog_compiler_wl=
7621 lt_prog_compiler_pic=
7622 lt_prog_compiler_static=
7623
7624 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
7625 $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
7626
7627 if test "$GCC" = yes; then
7628 lt_prog_compiler_wl='-Wl,'
7629 lt_prog_compiler_static='-static'
7630
7631 case $host_os in
7632 aix*)
7633 # All AIX code is PIC.
7634 if test "$host_cpu" = ia64; then
7635 # AIX 5 now supports IA64 processor
7636 lt_prog_compiler_static='-Bstatic'
7637 fi
7638 ;;
7639
7640 amigaos*)
7641 case $host_cpu in
7642 powerpc)
7643 # see comment about AmigaOS4 .so support
7644 lt_prog_compiler_pic='-fPIC'
7645 ;;
7646 m68k)
7647 # FIXME: we need at least 68020 code to build shared libraries, but
7648 # adding the `-m68020' flag to GCC prevents building anything better,
7649 # like `-m68040'.
7650 lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
7651 ;;
7652 esac
7653 ;;
7654
7655 beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
7656 # PIC is the default for these OSes.
7657 ;;
7658
7659 mingw* | cygwin* | pw32* | os2* | cegcc*)
7660 # This hack is so that the source file can tell whether it is being
7661 # built for inclusion in a dll (and should export symbols for example).
7662 # Although the cygwin gcc ignores -fPIC, still need this for old-style
7663 # (--disable-auto-import) libraries
7664 lt_prog_compiler_pic='-DDLL_EXPORT'
7665 ;;
7666
7667 darwin* | rhapsody*)
7668 # PIC is the default on this platform
7669 # Common symbols not allowed in MH_DYLIB files
7670 lt_prog_compiler_pic='-fno-common'
7671 ;;
7672
7673 hpux*)
7674 # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
7675 # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
7676 # sets the default TLS model and affects inlining.
7677 case $host_cpu in
7678 hppa*64*)
7679 # +Z the default
7680 ;;
7681 *)
7682 lt_prog_compiler_pic='-fPIC'
7683 ;;
7684 esac
7685 ;;
7686
7687 interix[3-9]*)
7688 # Interix 3.x gcc -fpic/-fPIC options generate broken code.
7689 # Instead, we relocate shared libraries at runtime.
7690 ;;
7691
7692 msdosdjgpp*)
7693 # Just because we use GCC doesn't mean we suddenly get shared libraries
7694 # on systems that don't support them.
7695 lt_prog_compiler_can_build_shared=no
7696 enable_shared=no
7697 ;;
7698
7699 *nto* | *qnx*)
7700 # QNX uses GNU C++, but need to define -shared option too, otherwise
7701 # it will coredump.
7702 lt_prog_compiler_pic='-fPIC -shared'
7703 ;;
7704
7705 sysv4*MP*)
7706 if test -d /usr/nec; then
7707 lt_prog_compiler_pic=-Kconform_pic
7708 fi
7709 ;;
7710
7711 *)
7712 lt_prog_compiler_pic='-fPIC'
7713 ;;
7714 esac
7715 else
7716 # PORTME Check for flag to pass linker flags through the system compiler.
7717 case $host_os in
7718 aix*)
7719 lt_prog_compiler_wl='-Wl,'
7720 if test "$host_cpu" = ia64; then
7721 # AIX 5 now supports IA64 processor
7722 lt_prog_compiler_static='-Bstatic'
7723 else
7724 lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
7725 fi
7726 ;;
7727
7728 mingw* | cygwin* | pw32* | os2* | cegcc*)
7729 # This hack is so that the source file can tell whether it is being
7730 # built for inclusion in a dll (and should export symbols for example).
7731 lt_prog_compiler_pic='-DDLL_EXPORT'
7732 ;;
7733
7734 hpux9* | hpux10* | hpux11*)
7735 lt_prog_compiler_wl='-Wl,'
7736 # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
7737 # not for PA HP-UX.
7738 case $host_cpu in
7739 hppa*64*|ia64*)
7740 # +Z the default
7741 ;;
7742 *)
7743 lt_prog_compiler_pic='+Z'
7744 ;;
7745 esac
7746 # Is there a better lt_prog_compiler_static that works with the bundled CC?
7747 lt_prog_compiler_static='${wl}-a ${wl}archive'
7748 ;;
7749
7750 irix5* | irix6* | nonstopux*)
7751 lt_prog_compiler_wl='-Wl,'
7752 # PIC (with -KPIC) is the default.
7753 lt_prog_compiler_static='-non_shared'
7754 ;;
7755
7756 linux* | k*bsd*-gnu | kopensolaris*-gnu)
7757 case $cc_basename in
7758 # old Intel for x86_64 which still supported -KPIC.
7759 ecc*)
7760 lt_prog_compiler_wl='-Wl,'
7761 lt_prog_compiler_pic='-KPIC'
7762 lt_prog_compiler_static='-static'
7763 ;;
7764 # icc used to be incompatible with GCC.
7765 # ICC 10 doesn't accept -KPIC any more.
7766 icc* | ifort*)
7767 lt_prog_compiler_wl='-Wl,'
7768 lt_prog_compiler_pic='-fPIC'
7769 lt_prog_compiler_static='-static'
7770 ;;
7771 # Lahey Fortran 8.1.
7772 lf95*)
7773 lt_prog_compiler_wl='-Wl,'
7774 lt_prog_compiler_pic='--shared'
7775 lt_prog_compiler_static='--static'
7776 ;;
7777 pgcc* | pgf77* | pgf90* | pgf95*)
7778 # Portland Group compilers (*not* the Pentium gcc compiler,
7779 # which looks to be a dead project)
7780 lt_prog_compiler_wl='-Wl,'
7781 lt_prog_compiler_pic='-fpic'
7782 lt_prog_compiler_static='-Bstatic'
7783 ;;
7784 ccc*)
7785 lt_prog_compiler_wl='-Wl,'
7786 # All Alpha code is PIC.
7787 lt_prog_compiler_static='-non_shared'
7788 ;;
7789 xl*)
7790 # IBM XL C 8.0/Fortran 10.1 on PPC
7791 lt_prog_compiler_wl='-Wl,'
7792 lt_prog_compiler_pic='-qpic'
7793 lt_prog_compiler_static='-qstaticlink'
7794 ;;
7795 *)
7796 case `$CC -V 2>&1 | sed 5q` in
7797 *Sun\ C*)
7798 # Sun C 5.9
7799 lt_prog_compiler_pic='-KPIC'
7800 lt_prog_compiler_static='-Bstatic'
7801 lt_prog_compiler_wl='-Wl,'
7802 ;;
7803 *Sun\ F*)
7804 # Sun Fortran 8.3 passes all unrecognized flags to the linker
7805 lt_prog_compiler_pic='-KPIC'
7806 lt_prog_compiler_static='-Bstatic'
7807 lt_prog_compiler_wl=''
7808 ;;
7809 esac
7810 ;;
7811 esac
7812 ;;
7813
7814 newsos6)
7815 lt_prog_compiler_pic='-KPIC'
7816 lt_prog_compiler_static='-Bstatic'
7817 ;;
7818
7819 *nto* | *qnx*)
7820 # QNX uses GNU C++, but need to define -shared option too, otherwise
7821 # it will coredump.
7822 lt_prog_compiler_pic='-fPIC -shared'
7823 ;;
7824
7825 osf3* | osf4* | osf5*)
7826 lt_prog_compiler_wl='-Wl,'
7827 # All OSF/1 code is PIC.
7828 lt_prog_compiler_static='-non_shared'
7829 ;;
7830
7831 rdos*)
7832 lt_prog_compiler_static='-non_shared'
7833 ;;
7834
7835 solaris*)
7836 lt_prog_compiler_pic='-KPIC'
7837 lt_prog_compiler_static='-Bstatic'
7838 case $cc_basename in
7839 f77* | f90* | f95*)
7840 lt_prog_compiler_wl='-Qoption ld ';;
7841 *)
7842 lt_prog_compiler_wl='-Wl,';;
7843 esac
7844 ;;
7845
7846 sunos4*)
7847 lt_prog_compiler_wl='-Qoption ld '
7848 lt_prog_compiler_pic='-PIC'
7849 lt_prog_compiler_static='-Bstatic'
7850 ;;
7851
7852 sysv4 | sysv4.2uw2* | sysv4.3*)
7853 lt_prog_compiler_wl='-Wl,'
7854 lt_prog_compiler_pic='-KPIC'
7855 lt_prog_compiler_static='-Bstatic'
7856 ;;
7857
7858 sysv4*MP*)
7859 if test -d /usr/nec ;then
7860 lt_prog_compiler_pic='-Kconform_pic'
7861 lt_prog_compiler_static='-Bstatic'
7862 fi
7863 ;;
7864
7865 sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
7866 lt_prog_compiler_wl='-Wl,'
7867 lt_prog_compiler_pic='-KPIC'
7868 lt_prog_compiler_static='-Bstatic'
7869 ;;
7870
7871 unicos*)
7872 lt_prog_compiler_wl='-Wl,'
7873 lt_prog_compiler_can_build_shared=no
7874 ;;
7875
7876 uts4*)
7877 lt_prog_compiler_pic='-pic'
7878 lt_prog_compiler_static='-Bstatic'
7879 ;;
7880
7881 *)
7882 lt_prog_compiler_can_build_shared=no
7883 ;;
7884 esac
7885 fi
7886
7887 case $host_os in
7888 # For platforms which do not support PIC, -DPIC is meaningless:
7889 *djgpp*)
7890 lt_prog_compiler_pic=
7891 ;;
7892 *)
7893 lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
7894 ;;
7895 esac
7896 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
7897 $as_echo "$lt_prog_compiler_pic" >&6; }
7898
7899
7900
7901
7902
7903
7904 #
7905 # Check to make sure the PIC flag actually works.
7906 #
7907 if test -n "$lt_prog_compiler_pic"; then
7908 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
7909 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
7910 if test "${lt_cv_prog_compiler_pic_works+set}" = set; then :
7911 $as_echo_n "(cached) " >&6
7912 else
7913 lt_cv_prog_compiler_pic_works=no
7914 ac_outfile=conftest.$ac_objext
7915 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
7916 lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
7917 # Insert the option either (1) after the last *FLAGS variable, or
7918 # (2) before a word containing "conftest.", or (3) at the end.
7919 # Note that $ac_compile itself does not contain backslashes and begins
7920 # with a dollar sign (not a hyphen), so the echo should work correctly.
7921 # The option is referenced via a variable to avoid confusing sed.
7922 lt_compile=`echo "$ac_compile" | $SED \
7923 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
7924 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
7925 -e 's:$: $lt_compiler_flag:'`
7926 (eval echo "\"\$as_me:7927: $lt_compile\"" >&5)
7927 (eval "$lt_compile" 2>conftest.err)
7928 ac_status=$?
7929 cat conftest.err >&5
7930 echo "$as_me:7931: \$? = $ac_status" >&5
7931 if (exit $ac_status) && test -s "$ac_outfile"; then
7932 # The compiler can only warn and ignore the option if not recognized
7933 # So say no if there are warnings other than the usual output.
7934 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
7935 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
7936 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
7937 lt_cv_prog_compiler_pic_works=yes
7938 fi
7939 fi
7940 $RM conftest*
7941
7942 fi
7943 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
7944 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
7945
7946 if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
7947 case $lt_prog_compiler_pic in
7948 "" | " "*) ;;
7949 *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
7950 esac
7951 else
7952 lt_prog_compiler_pic=
7953 lt_prog_compiler_can_build_shared=no
7954 fi
7955
7956 fi
7957
7958
7959
7960
7961
7962
7963 #
7964 # Check to make sure the static flag actually works.
7965 #
7966 wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
7967 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
7968 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
7969 if test "${lt_cv_prog_compiler_static_works+set}" = set; then :
7970 $as_echo_n "(cached) " >&6
7971 else
7972 lt_cv_prog_compiler_static_works=no
7973 save_LDFLAGS="$LDFLAGS"
7974 LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
7975 echo "$lt_simple_link_test_code" > conftest.$ac_ext
7976 if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
7977 # The linker can only warn and ignore the option if not recognized
7978 # So say no if there are warnings
7979 if test -s conftest.err; then
7980 # Append any errors to the config.log.
7981 cat conftest.err 1>&5
7982 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
7983 $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
7984 if diff conftest.exp conftest.er2 >/dev/null; then
7985 lt_cv_prog_compiler_static_works=yes
7986 fi
7987 else
7988 lt_cv_prog_compiler_static_works=yes
7989 fi
7990 fi
7991 $RM -r conftest*
7992 LDFLAGS="$save_LDFLAGS"
7993
7994 fi
7995 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
7996 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
7997
7998 if test x"$lt_cv_prog_compiler_static_works" = xyes; then
7999 :
8000 else
8001 lt_prog_compiler_static=
8002 fi
8003
8004
8005
8006
8007
8008
8009
8010 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
8011 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
8012 if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
8013 $as_echo_n "(cached) " >&6
8014 else
8015 lt_cv_prog_compiler_c_o=no
8016 $RM -r conftest 2>/dev/null
8017 mkdir conftest
8018 cd conftest
8019 mkdir out
8020 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8021
8022 lt_compiler_flag="-o out/conftest2.$ac_objext"
8023 # Insert the option either (1) after the last *FLAGS variable, or
8024 # (2) before a word containing "conftest.", or (3) at the end.
8025 # Note that $ac_compile itself does not contain backslashes and begins
8026 # with a dollar sign (not a hyphen), so the echo should work correctly.
8027 lt_compile=`echo "$ac_compile" | $SED \
8028 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8029 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8030 -e 's:$: $lt_compiler_flag:'`
8031 (eval echo "\"\$as_me:8032: $lt_compile\"" >&5)
8032 (eval "$lt_compile" 2>out/conftest.err)
8033 ac_status=$?
8034 cat out/conftest.err >&5
8035 echo "$as_me:8036: \$? = $ac_status" >&5
8036 if (exit $ac_status) && test -s out/conftest2.$ac_objext
8037 then
8038 # The compiler can only warn and ignore the option if not recognized
8039 # So say no if there are warnings
8040 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
8041 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
8042 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
8043 lt_cv_prog_compiler_c_o=yes
8044 fi
8045 fi
8046 chmod u+w . 2>&5
8047 $RM conftest*
8048 # SGI C++ compiler will create directory out/ii_files/ for
8049 # template instantiation
8050 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
8051 $RM out/* && rmdir out
8052 cd ..
8053 $RM -r conftest
8054 $RM conftest*
8055
8056 fi
8057 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
8058 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
8059
8060
8061
8062
8063
8064
8065 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
8066 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
8067 if test "${lt_cv_prog_compiler_c_o+set}" = set; then :
8068 $as_echo_n "(cached) " >&6
8069 else
8070 lt_cv_prog_compiler_c_o=no
8071 $RM -r conftest 2>/dev/null
8072 mkdir conftest
8073 cd conftest
8074 mkdir out
8075 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8076
8077 lt_compiler_flag="-o out/conftest2.$ac_objext"
8078 # Insert the option either (1) after the last *FLAGS variable, or
8079 # (2) before a word containing "conftest.", or (3) at the end.
8080 # Note that $ac_compile itself does not contain backslashes and begins
8081 # with a dollar sign (not a hyphen), so the echo should work correctly.
8082 lt_compile=`echo "$ac_compile" | $SED \
8083 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8084 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8085 -e 's:$: $lt_compiler_flag:'`
8086 (eval echo "\"\$as_me:8087: $lt_compile\"" >&5)
8087 (eval "$lt_compile" 2>out/conftest.err)
8088 ac_status=$?
8089 cat out/conftest.err >&5
8090 echo "$as_me:8091: \$? = $ac_status" >&5
8091 if (exit $ac_status) && test -s out/conftest2.$ac_objext
8092 then
8093 # The compiler can only warn and ignore the option if not recognized
8094 # So say no if there are warnings
8095 $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
8096 $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
8097 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
8098 lt_cv_prog_compiler_c_o=yes
8099 fi
8100 fi
8101 chmod u+w . 2>&5
8102 $RM conftest*
8103 # SGI C++ compiler will create directory out/ii_files/ for
8104 # template instantiation
8105 test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
8106 $RM out/* && rmdir out
8107 cd ..
8108 $RM -r conftest
8109 $RM conftest*
8110
8111 fi
8112 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
8113 $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
8114
8115
8116
8117
8118 hard_links="nottested"
8119 if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
8120 # do not overwrite the value of need_locks provided by the user
8121 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
8122 $as_echo_n "checking if we can lock with hard links... " >&6; }
8123 hard_links=yes
8124 $RM conftest*
8125 ln conftest.a conftest.b 2>/dev/null && hard_links=no
8126 touch conftest.a
8127 ln conftest.a conftest.b 2>&5 || hard_links=no
8128 ln conftest.a conftest.b 2>/dev/null && hard_links=no
8129 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
8130 $as_echo "$hard_links" >&6; }
8131 if test "$hard_links" = no; then
8132 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
8133 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
8134 need_locks=warn
8135 fi
8136 else
8137 need_locks=no
8138 fi
8139
8140
8141
8142
8143
8144
8145 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
8146 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
8147
8148 runpath_var=
8149 allow_undefined_flag=
8150 always_export_symbols=no
8151 archive_cmds=
8152 archive_expsym_cmds=
8153 compiler_needs_object=no
8154 enable_shared_with_static_runtimes=no
8155 export_dynamic_flag_spec=
8156 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8157 hardcode_automatic=no
8158 hardcode_direct=no
8159 hardcode_direct_absolute=no
8160 hardcode_libdir_flag_spec=
8161 hardcode_libdir_flag_spec_ld=
8162 hardcode_libdir_separator=
8163 hardcode_minus_L=no
8164 hardcode_shlibpath_var=unsupported
8165 inherit_rpath=no
8166 link_all_deplibs=unknown
8167 module_cmds=
8168 module_expsym_cmds=
8169 old_archive_from_new_cmds=
8170 old_archive_from_expsyms_cmds=
8171 thread_safe_flag_spec=
8172 whole_archive_flag_spec=
8173 # include_expsyms should be a list of space-separated symbols to be *always*
8174 # included in the symbol list
8175 include_expsyms=
8176 # exclude_expsyms can be an extended regexp of symbols to exclude
8177 # it will be wrapped by ` (' and `)$', so one must not match beginning or
8178 # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
8179 # as well as any symbol that contains `d'.
8180 exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
8181 # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
8182 # platforms (ab)use it in PIC code, but their linkers get confused if
8183 # the symbol is explicitly referenced. Since portable code cannot
8184 # rely on this symbol name, it's probably fine to never include it in
8185 # preloaded symbol tables.
8186 # Exclude shared library initialization/finalization symbols.
8187 extract_expsyms_cmds=
8188
8189 case $host_os in
8190 cygwin* | mingw* | pw32* | cegcc*)
8191 # FIXME: the MSVC++ port hasn't been tested in a loooong time
8192 # When not using gcc, we currently assume that we are using
8193 # Microsoft Visual C++.
8194 if test "$GCC" != yes; then
8195 with_gnu_ld=no
8196 fi
8197 ;;
8198 interix*)
8199 # we just hope/assume this is gcc and not c89 (= MSVC++)
8200 with_gnu_ld=yes
8201 ;;
8202 openbsd*)
8203 with_gnu_ld=no
8204 ;;
8205 linux* | k*bsd*-gnu)
8206 link_all_deplibs=no
8207 ;;
8208 esac
8209
8210 ld_shlibs=yes
8211 if test "$with_gnu_ld" = yes; then
8212 # If archive_cmds runs LD, not CC, wlarc should be empty
8213 wlarc='${wl}'
8214
8215 # Set some defaults for GNU ld with shared library support. These
8216 # are reset later if shared libraries are not supported. Putting them
8217 # here allows them to be overridden if necessary.
8218 runpath_var=LD_RUN_PATH
8219 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8220 export_dynamic_flag_spec='${wl}--export-dynamic'
8221 # ancient GNU ld didn't support --whole-archive et. al.
8222 if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
8223 whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
8224 else
8225 whole_archive_flag_spec=
8226 fi
8227 supports_anon_versioning=no
8228 case `$LD -v 2>&1` in
8229 *GNU\ gold*) supports_anon_versioning=yes ;;
8230 *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
8231 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
8232 *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
8233 *\ 2.11.*) ;; # other 2.11 versions
8234 *) supports_anon_versioning=yes ;;
8235 esac
8236
8237 # See if GNU ld supports shared libraries.
8238 case $host_os in
8239 aix[3-9]*)
8240 # On AIX/PPC, the GNU linker is very broken
8241 if test "$host_cpu" != ia64; then
8242 ld_shlibs=no
8243 cat <<_LT_EOF 1>&2
8244
8245 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
8246 *** to be unable to reliably create shared libraries on AIX.
8247 *** Therefore, libtool is disabling shared libraries support. If you
8248 *** really care for shared libraries, you may want to modify your PATH
8249 *** so that a non-GNU linker is found, and then restart.
8250
8251 _LT_EOF
8252 fi
8253 ;;
8254
8255 amigaos*)
8256 case $host_cpu in
8257 powerpc)
8258 # see comment about AmigaOS4 .so support
8259 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8260 archive_expsym_cmds=''
8261 ;;
8262 m68k)
8263 archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
8264 hardcode_libdir_flag_spec='-L$libdir'
8265 hardcode_minus_L=yes
8266 ;;
8267 esac
8268 ;;
8269
8270 beos*)
8271 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8272 allow_undefined_flag=unsupported
8273 # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
8274 # support --undefined. This deserves some investigation. FIXME
8275 archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8276 else
8277 ld_shlibs=no
8278 fi
8279 ;;
8280
8281 cygwin* | mingw* | pw32* | cegcc*)
8282 # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
8283 # as there is no search path for DLLs.
8284 hardcode_libdir_flag_spec='-L$libdir'
8285 allow_undefined_flag=unsupported
8286 always_export_symbols=no
8287 enable_shared_with_static_runtimes=yes
8288 export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
8289
8290 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
8291 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8292 # If the export-symbols file already is a .def file (1st line
8293 # is EXPORTS), use it as is; otherwise, prepend...
8294 archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
8295 cp $export_symbols $output_objdir/$soname.def;
8296 else
8297 echo EXPORTS > $output_objdir/$soname.def;
8298 cat $export_symbols >> $output_objdir/$soname.def;
8299 fi~
8300 $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
8301 else
8302 ld_shlibs=no
8303 fi
8304 ;;
8305
8306 interix[3-9]*)
8307 hardcode_direct=no
8308 hardcode_shlibpath_var=no
8309 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8310 export_dynamic_flag_spec='${wl}-E'
8311 # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
8312 # Instead, shared libraries are loaded at an image base (0x10000000 by
8313 # default) and relocated if they conflict, which is a slow very memory
8314 # consuming and fragmenting process. To avoid this, we pick a random,
8315 # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
8316 # time. Moving up from 0x10000000 also allows more sbrk(2) space.
8317 archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8318 archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
8319 ;;
8320
8321 gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
8322 tmp_diet=no
8323 if test "$host_os" = linux-dietlibc; then
8324 case $cc_basename in
8325 diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
8326 esac
8327 fi
8328 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
8329 && test "$tmp_diet" = no
8330 then
8331 tmp_addflag=
8332 tmp_sharedflag='-shared'
8333 case $cc_basename,$host_cpu in
8334 pgcc*) # Portland Group C compiler
8335 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8336 tmp_addflag=' $pic_flag'
8337 ;;
8338 pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
8339 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8340 tmp_addflag=' $pic_flag -Mnomain' ;;
8341 ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
8342 tmp_addflag=' -i_dynamic' ;;
8343 efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
8344 tmp_addflag=' -i_dynamic -nofor_main' ;;
8345 ifc* | ifort*) # Intel Fortran compiler
8346 tmp_addflag=' -nofor_main' ;;
8347 lf95*) # Lahey Fortran 8.1
8348 whole_archive_flag_spec=
8349 tmp_sharedflag='--shared' ;;
8350 xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
8351 tmp_sharedflag='-qmkshrobj'
8352 tmp_addflag= ;;
8353 esac
8354 case `$CC -V 2>&1 | sed 5q` in
8355 *Sun\ C*) # Sun C 5.9
8356 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
8357 compiler_needs_object=yes
8358 tmp_sharedflag='-G' ;;
8359 *Sun\ F*) # Sun Fortran 8.3
8360 tmp_sharedflag='-G' ;;
8361 esac
8362 archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8363
8364 if test "x$supports_anon_versioning" = xyes; then
8365 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
8366 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8367 echo "local: *; };" >> $output_objdir/$libname.ver~
8368 $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
8369 fi
8370
8371 case $cc_basename in
8372 xlf*)
8373 # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
8374 whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
8375 hardcode_libdir_flag_spec=
8376 hardcode_libdir_flag_spec_ld='-rpath $libdir'
8377 archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
8378 if test "x$supports_anon_versioning" = xyes; then
8379 archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
8380 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
8381 echo "local: *; };" >> $output_objdir/$libname.ver~
8382 $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
8383 fi
8384 ;;
8385 esac
8386 else
8387 ld_shlibs=no
8388 fi
8389 ;;
8390
8391 netbsd* | netbsdelf*-gnu)
8392 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8393 archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
8394 wlarc=
8395 else
8396 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8397 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8398 fi
8399 ;;
8400
8401 solaris*)
8402 if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
8403 ld_shlibs=no
8404 cat <<_LT_EOF 1>&2
8405
8406 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
8407 *** create shared libraries on Solaris systems. Therefore, libtool
8408 *** is disabling shared libraries support. We urge you to upgrade GNU
8409 *** binutils to release 2.9.1 or newer. Another option is to modify
8410 *** your PATH or compiler configuration so that the native linker is
8411 *** used, and then restart.
8412
8413 _LT_EOF
8414 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8415 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8416 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8417 else
8418 ld_shlibs=no
8419 fi
8420 ;;
8421
8422 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
8423 case `$LD -v 2>&1` in
8424 *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
8425 ld_shlibs=no
8426 cat <<_LT_EOF 1>&2
8427
8428 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
8429 *** reliably create shared libraries on SCO systems. Therefore, libtool
8430 *** is disabling shared libraries support. We urge you to upgrade GNU
8431 *** binutils to release 2.16.91.0.3 or newer. Another option is to modify
8432 *** your PATH or compiler configuration so that the native linker is
8433 *** used, and then restart.
8434
8435 _LT_EOF
8436 ;;
8437 *)
8438 # For security reasons, it is highly recommended that you always
8439 # use absolute paths for naming shared libraries, and exclude the
8440 # DT_RUNPATH tag from executables and libraries. But doing so
8441 # requires that you compile everything twice, which is a pain.
8442 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8443 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8444 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8445 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8446 else
8447 ld_shlibs=no
8448 fi
8449 ;;
8450 esac
8451 ;;
8452
8453 sunos4*)
8454 archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8455 wlarc=
8456 hardcode_direct=yes
8457 hardcode_shlibpath_var=no
8458 ;;
8459
8460 *)
8461 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
8462 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8463 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
8464 else
8465 ld_shlibs=no
8466 fi
8467 ;;
8468 esac
8469
8470 if test "$ld_shlibs" = no; then
8471 runpath_var=
8472 hardcode_libdir_flag_spec=
8473 export_dynamic_flag_spec=
8474 whole_archive_flag_spec=
8475 fi
8476 else
8477 # PORTME fill in a description of your system's linker (not GNU ld)
8478 case $host_os in
8479 aix3*)
8480 allow_undefined_flag=unsupported
8481 always_export_symbols=yes
8482 archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
8483 # Note: this linker hardcodes the directories in LIBPATH if there
8484 # are no directories specified by -L.
8485 hardcode_minus_L=yes
8486 if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
8487 # Neither direct hardcoding nor static linking is supported with a
8488 # broken collect2.
8489 hardcode_direct=unsupported
8490 fi
8491 ;;
8492
8493 aix[4-9]*)
8494 if test "$host_cpu" = ia64; then
8495 # On IA64, the linker does run time linking by default, so we don't
8496 # have to do anything special.
8497 aix_use_runtimelinking=no
8498 exp_sym_flag='-Bexport'
8499 no_entry_flag=""
8500 else
8501 # If we're using GNU nm, then we don't want the "-C" option.
8502 # -C means demangle to AIX nm, but means don't demangle with GNU nm
8503 if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
8504 export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
8505 else
8506 export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
8507 fi
8508 aix_use_runtimelinking=no
8509
8510 # Test if we are trying to use run time linking or normal
8511 # AIX style linking. If -brtl is somewhere in LDFLAGS, we
8512 # need to do runtime linking.
8513 case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
8514 for ld_flag in $LDFLAGS; do
8515 if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
8516 aix_use_runtimelinking=yes
8517 break
8518 fi
8519 done
8520 ;;
8521 esac
8522
8523 exp_sym_flag='-bexport'
8524 no_entry_flag='-bnoentry'
8525 fi
8526
8527 # When large executables or shared objects are built, AIX ld can
8528 # have problems creating the table of contents. If linking a library
8529 # or program results in "error TOC overflow" add -mminimal-toc to
8530 # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
8531 # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
8532
8533 archive_cmds=''
8534 hardcode_direct=yes
8535 hardcode_direct_absolute=yes
8536 hardcode_libdir_separator=':'
8537 link_all_deplibs=yes
8538 file_list_spec='${wl}-f,'
8539
8540 if test "$GCC" = yes; then
8541 case $host_os in aix4.[012]|aix4.[012].*)
8542 # We only want to do this on AIX 4.2 and lower, the check
8543 # below for broken collect2 doesn't work under 4.3+
8544 collect2name=`${CC} -print-prog-name=collect2`
8545 if test -f "$collect2name" &&
8546 strings "$collect2name" | $GREP resolve_lib_name >/dev/null
8547 then
8548 # We have reworked collect2
8549 :
8550 else
8551 # We have old collect2
8552 hardcode_direct=unsupported
8553 # It fails to find uninstalled libraries when the uninstalled
8554 # path is not listed in the libpath. Setting hardcode_minus_L
8555 # to unsupported forces relinking
8556 hardcode_minus_L=yes
8557 hardcode_libdir_flag_spec='-L$libdir'
8558 hardcode_libdir_separator=
8559 fi
8560 ;;
8561 esac
8562 shared_flag='-shared'
8563 if test "$aix_use_runtimelinking" = yes; then
8564 shared_flag="$shared_flag "'${wl}-G'
8565 fi
8566 link_all_deplibs=no
8567 else
8568 # not using gcc
8569 if test "$host_cpu" = ia64; then
8570 # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
8571 # chokes on -Wl,-G. The following line is correct:
8572 shared_flag='-G'
8573 else
8574 if test "$aix_use_runtimelinking" = yes; then
8575 shared_flag='${wl}-G'
8576 else
8577 shared_flag='${wl}-bM:SRE'
8578 fi
8579 fi
8580 fi
8581
8582 export_dynamic_flag_spec='${wl}-bexpall'
8583 # It seems that -bexpall does not export symbols beginning with
8584 # underscore (_), so it is better to generate a list of symbols to export.
8585 always_export_symbols=yes
8586 if test "$aix_use_runtimelinking" = yes; then
8587 # Warning - without using the other runtime loading flags (-brtl),
8588 # -berok will link without error, but may produce a broken library.
8589 allow_undefined_flag='-berok'
8590 # Determine the default libpath from the value encoded in an
8591 # empty executable.
8592 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8593 /* end confdefs.h. */
8594
8595 int
8596 main ()
8597 {
8598
8599 ;
8600 return 0;
8601 }
8602 _ACEOF
8603 if ac_fn_c_try_link "$LINENO"; then :
8604
8605 lt_aix_libpath_sed='
8606 /Import File Strings/,/^$/ {
8607 /^0/ {
8608 s/^0 *\(.*\)$/\1/
8609 p
8610 }
8611 }'
8612 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8613 # Check for a 64-bit object if we didn't find anything.
8614 if test -z "$aix_libpath"; then
8615 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8616 fi
8617 fi
8618 rm -f core conftest.err conftest.$ac_objext \
8619 conftest$ac_exeext conftest.$ac_ext
8620 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8621
8622 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
8623 archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
8624 else
8625 if test "$host_cpu" = ia64; then
8626 hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
8627 allow_undefined_flag="-z nodefs"
8628 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
8629 else
8630 # Determine the default libpath from the value encoded in an
8631 # empty executable.
8632 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8633 /* end confdefs.h. */
8634
8635 int
8636 main ()
8637 {
8638
8639 ;
8640 return 0;
8641 }
8642 _ACEOF
8643 if ac_fn_c_try_link "$LINENO"; then :
8644
8645 lt_aix_libpath_sed='
8646 /Import File Strings/,/^$/ {
8647 /^0/ {
8648 s/^0 *\(.*\)$/\1/
8649 p
8650 }
8651 }'
8652 aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8653 # Check for a 64-bit object if we didn't find anything.
8654 if test -z "$aix_libpath"; then
8655 aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
8656 fi
8657 fi
8658 rm -f core conftest.err conftest.$ac_objext \
8659 conftest$ac_exeext conftest.$ac_ext
8660 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
8661
8662 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
8663 # Warning - without using the other run time loading flags,
8664 # -berok will link without error, but may produce a broken library.
8665 no_undefined_flag=' ${wl}-bernotok'
8666 allow_undefined_flag=' ${wl}-berok'
8667 # Exported symbols can be pulled into shared objects from archives
8668 whole_archive_flag_spec='$convenience'
8669 archive_cmds_need_lc=yes
8670 # This is similar to how AIX traditionally builds its shared libraries.
8671 archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
8672 fi
8673 fi
8674 ;;
8675
8676 amigaos*)
8677 case $host_cpu in
8678 powerpc)
8679 # see comment about AmigaOS4 .so support
8680 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
8681 archive_expsym_cmds=''
8682 ;;
8683 m68k)
8684 archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
8685 hardcode_libdir_flag_spec='-L$libdir'
8686 hardcode_minus_L=yes
8687 ;;
8688 esac
8689 ;;
8690
8691 bsdi[45]*)
8692 export_dynamic_flag_spec=-rdynamic
8693 ;;
8694
8695 cygwin* | mingw* | pw32* | cegcc*)
8696 # When not using gcc, we currently assume that we are using
8697 # Microsoft Visual C++.
8698 # hardcode_libdir_flag_spec is actually meaningless, as there is
8699 # no search path for DLLs.
8700 hardcode_libdir_flag_spec=' '
8701 allow_undefined_flag=unsupported
8702 # Tell ltmain to make .lib files, not .a files.
8703 libext=lib
8704 # Tell ltmain to make .dll files, not .so files.
8705 shrext_cmds=".dll"
8706 # FIXME: Setting linknames here is a bad hack.
8707 archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
8708 # The linker will automatically build a .lib file if we build a DLL.
8709 old_archive_from_new_cmds='true'
8710 # FIXME: Should let the user specify the lib program.
8711 old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
8712 fix_srcfile_path='`cygpath -w "$srcfile"`'
8713 enable_shared_with_static_runtimes=yes
8714 ;;
8715
8716 darwin* | rhapsody*)
8717
8718
8719 archive_cmds_need_lc=no
8720 hardcode_direct=no
8721 hardcode_automatic=yes
8722 hardcode_shlibpath_var=unsupported
8723 whole_archive_flag_spec=''
8724 link_all_deplibs=yes
8725 allow_undefined_flag="$_lt_dar_allow_undefined"
8726 case $cc_basename in
8727 ifort*) _lt_dar_can_shared=yes ;;
8728 *) _lt_dar_can_shared=$GCC ;;
8729 esac
8730 if test "$_lt_dar_can_shared" = "yes"; then
8731 output_verbose_link_cmd=echo
8732 archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
8733 module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
8734 archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
8735 module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
8736
8737 else
8738 ld_shlibs=no
8739 fi
8740
8741 ;;
8742
8743 dgux*)
8744 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8745 hardcode_libdir_flag_spec='-L$libdir'
8746 hardcode_shlibpath_var=no
8747 ;;
8748
8749 freebsd1*)
8750 ld_shlibs=no
8751 ;;
8752
8753 # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
8754 # support. Future versions do this automatically, but an explicit c++rt0.o
8755 # does not break anything, and helps significantly (at the cost of a little
8756 # extra space).
8757 freebsd2.2*)
8758 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
8759 hardcode_libdir_flag_spec='-R$libdir'
8760 hardcode_direct=yes
8761 hardcode_shlibpath_var=no
8762 ;;
8763
8764 # Unfortunately, older versions of FreeBSD 2 do not have this feature.
8765 freebsd2*)
8766 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8767 hardcode_direct=yes
8768 hardcode_minus_L=yes
8769 hardcode_shlibpath_var=no
8770 ;;
8771
8772 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
8773 freebsd* | dragonfly*)
8774 archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
8775 hardcode_libdir_flag_spec='-R$libdir'
8776 hardcode_direct=yes
8777 hardcode_shlibpath_var=no
8778 ;;
8779
8780 hpux9*)
8781 if test "$GCC" = yes; then
8782 archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8783 else
8784 archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
8785 fi
8786 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8787 hardcode_libdir_separator=:
8788 hardcode_direct=yes
8789
8790 # hardcode_minus_L: Not really in the search PATH,
8791 # but as the default location of the library.
8792 hardcode_minus_L=yes
8793 export_dynamic_flag_spec='${wl}-E'
8794 ;;
8795
8796 hpux10*)
8797 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
8798 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8799 else
8800 archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
8801 fi
8802 if test "$with_gnu_ld" = no; then
8803 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8804 hardcode_libdir_flag_spec_ld='+b $libdir'
8805 hardcode_libdir_separator=:
8806 hardcode_direct=yes
8807 hardcode_direct_absolute=yes
8808 export_dynamic_flag_spec='${wl}-E'
8809 # hardcode_minus_L: Not really in the search PATH,
8810 # but as the default location of the library.
8811 hardcode_minus_L=yes
8812 fi
8813 ;;
8814
8815 hpux11*)
8816 if test "$GCC" = yes -a "$with_gnu_ld" = no; then
8817 case $host_cpu in
8818 hppa*64*)
8819 archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8820 ;;
8821 ia64*)
8822 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
8823 ;;
8824 *)
8825 archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8826 ;;
8827 esac
8828 else
8829 case $host_cpu in
8830 hppa*64*)
8831 archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8832 ;;
8833 ia64*)
8834 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
8835 ;;
8836 *)
8837 archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
8838 ;;
8839 esac
8840 fi
8841 if test "$with_gnu_ld" = no; then
8842 hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
8843 hardcode_libdir_separator=:
8844
8845 case $host_cpu in
8846 hppa*64*|ia64*)
8847 hardcode_direct=no
8848 hardcode_shlibpath_var=no
8849 ;;
8850 *)
8851 hardcode_direct=yes
8852 hardcode_direct_absolute=yes
8853 export_dynamic_flag_spec='${wl}-E'
8854
8855 # hardcode_minus_L: Not really in the search PATH,
8856 # but as the default location of the library.
8857 hardcode_minus_L=yes
8858 ;;
8859 esac
8860 fi
8861 ;;
8862
8863 irix5* | irix6* | nonstopux*)
8864 if test "$GCC" = yes; then
8865 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8866 # Try to use the -exported_symbol ld option, if it does not
8867 # work, assume that -exports_file does not work either and
8868 # implicitly export all symbols.
8869 save_LDFLAGS="$LDFLAGS"
8870 LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
8871 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
8872 /* end confdefs.h. */
8873 int foo(void) {}
8874 _ACEOF
8875 if ac_fn_c_try_link "$LINENO"; then :
8876 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
8877
8878 fi
8879 rm -f core conftest.err conftest.$ac_objext \
8880 conftest$ac_exeext conftest.$ac_ext
8881 LDFLAGS="$save_LDFLAGS"
8882 else
8883 archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8884 archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
8885 fi
8886 archive_cmds_need_lc='no'
8887 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8888 hardcode_libdir_separator=:
8889 inherit_rpath=yes
8890 link_all_deplibs=yes
8891 ;;
8892
8893 netbsd* | netbsdelf*-gnu)
8894 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
8895 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
8896 else
8897 archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
8898 fi
8899 hardcode_libdir_flag_spec='-R$libdir'
8900 hardcode_direct=yes
8901 hardcode_shlibpath_var=no
8902 ;;
8903
8904 newsos6)
8905 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
8906 hardcode_direct=yes
8907 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8908 hardcode_libdir_separator=:
8909 hardcode_shlibpath_var=no
8910 ;;
8911
8912 *nto* | *qnx*)
8913 ;;
8914
8915 openbsd*)
8916 if test -f /usr/libexec/ld.so; then
8917 hardcode_direct=yes
8918 hardcode_shlibpath_var=no
8919 hardcode_direct_absolute=yes
8920 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
8921 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8922 archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
8923 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8924 export_dynamic_flag_spec='${wl}-E'
8925 else
8926 case $host_os in
8927 openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
8928 archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
8929 hardcode_libdir_flag_spec='-R$libdir'
8930 ;;
8931 *)
8932 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
8933 hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
8934 ;;
8935 esac
8936 fi
8937 else
8938 ld_shlibs=no
8939 fi
8940 ;;
8941
8942 os2*)
8943 hardcode_libdir_flag_spec='-L$libdir'
8944 hardcode_minus_L=yes
8945 allow_undefined_flag=unsupported
8946 archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
8947 old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
8948 ;;
8949
8950 osf3*)
8951 if test "$GCC" = yes; then
8952 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
8953 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8954 else
8955 allow_undefined_flag=' -expect_unresolved \*'
8956 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8957 fi
8958 archive_cmds_need_lc='no'
8959 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8960 hardcode_libdir_separator=:
8961 ;;
8962
8963 osf4* | osf5*) # as osf3* with the addition of -msym flag
8964 if test "$GCC" = yes; then
8965 allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
8966 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
8967 hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
8968 else
8969 allow_undefined_flag=' -expect_unresolved \*'
8970 archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
8971 archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
8972 $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
8973
8974 # Both c and cxx compiler support -rpath directly
8975 hardcode_libdir_flag_spec='-rpath $libdir'
8976 fi
8977 archive_cmds_need_lc='no'
8978 hardcode_libdir_separator=:
8979 ;;
8980
8981 solaris*)
8982 no_undefined_flag=' -z defs'
8983 if test "$GCC" = yes; then
8984 wlarc='${wl}'
8985 archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
8986 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8987 $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
8988 else
8989 case `$CC -V 2>&1` in
8990 *"Compilers 5.0"*)
8991 wlarc=''
8992 archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
8993 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
8994 $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
8995 ;;
8996 *)
8997 wlarc='${wl}'
8998 archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
8999 archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9000 $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
9001 ;;
9002 esac
9003 fi
9004 hardcode_libdir_flag_spec='-R$libdir'
9005 hardcode_shlibpath_var=no
9006 case $host_os in
9007 solaris2.[0-5] | solaris2.[0-5].*) ;;
9008 *)
9009 # The compiler driver will combine and reorder linker options,
9010 # but understands `-z linker_flag'. GCC discards it without `$wl',
9011 # but is careful enough not to reorder.
9012 # Supported since Solaris 2.6 (maybe 2.5.1?)
9013 if test "$GCC" = yes; then
9014 whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
9015 else
9016 whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
9017 fi
9018 ;;
9019 esac
9020 link_all_deplibs=yes
9021 ;;
9022
9023 sunos4*)
9024 if test "x$host_vendor" = xsequent; then
9025 # Use $CC to link under sequent, because it throws in some extra .o
9026 # files that make .init and .fini sections work.
9027 archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
9028 else
9029 archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
9030 fi
9031 hardcode_libdir_flag_spec='-L$libdir'
9032 hardcode_direct=yes
9033 hardcode_minus_L=yes
9034 hardcode_shlibpath_var=no
9035 ;;
9036
9037 sysv4)
9038 case $host_vendor in
9039 sni)
9040 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9041 hardcode_direct=yes # is this really true???
9042 ;;
9043 siemens)
9044 ## LD is ld it makes a PLAMLIB
9045 ## CC just makes a GrossModule.
9046 archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
9047 reload_cmds='$CC -r -o $output$reload_objs'
9048 hardcode_direct=no
9049 ;;
9050 motorola)
9051 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9052 hardcode_direct=no #Motorola manual says yes, but my tests say they lie
9053 ;;
9054 esac
9055 runpath_var='LD_RUN_PATH'
9056 hardcode_shlibpath_var=no
9057 ;;
9058
9059 sysv4.3*)
9060 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9061 hardcode_shlibpath_var=no
9062 export_dynamic_flag_spec='-Bexport'
9063 ;;
9064
9065 sysv4*MP*)
9066 if test -d /usr/nec; then
9067 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9068 hardcode_shlibpath_var=no
9069 runpath_var=LD_RUN_PATH
9070 hardcode_runpath_var=yes
9071 ld_shlibs=yes
9072 fi
9073 ;;
9074
9075 sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
9076 no_undefined_flag='${wl}-z,text'
9077 archive_cmds_need_lc=no
9078 hardcode_shlibpath_var=no
9079 runpath_var='LD_RUN_PATH'
9080
9081 if test "$GCC" = yes; then
9082 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9083 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9084 else
9085 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9086 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9087 fi
9088 ;;
9089
9090 sysv5* | sco3.2v5* | sco5v6*)
9091 # Note: We can NOT use -z defs as we might desire, because we do not
9092 # link with -lc, and that would cause any symbols used from libc to
9093 # always be unresolved, which means just about no library would
9094 # ever link correctly. If we're not using GNU ld we use -z text
9095 # though, which does catch some bad symbols but isn't as heavy-handed
9096 # as -z defs.
9097 no_undefined_flag='${wl}-z,text'
9098 allow_undefined_flag='${wl}-z,nodefs'
9099 archive_cmds_need_lc=no
9100 hardcode_shlibpath_var=no
9101 hardcode_libdir_flag_spec='${wl}-R,$libdir'
9102 hardcode_libdir_separator=':'
9103 link_all_deplibs=yes
9104 export_dynamic_flag_spec='${wl}-Bexport'
9105 runpath_var='LD_RUN_PATH'
9106
9107 if test "$GCC" = yes; then
9108 archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9109 archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9110 else
9111 archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9112 archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
9113 fi
9114 ;;
9115
9116 uts4*)
9117 archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9118 hardcode_libdir_flag_spec='-L$libdir'
9119 hardcode_shlibpath_var=no
9120 ;;
9121
9122 *)
9123 ld_shlibs=no
9124 ;;
9125 esac
9126
9127 if test x$host_vendor = xsni; then
9128 case $host in
9129 sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
9130 export_dynamic_flag_spec='${wl}-Blargedynsym'
9131 ;;
9132 esac
9133 fi
9134 fi
9135
9136 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
9137 $as_echo "$ld_shlibs" >&6; }
9138 test "$ld_shlibs" = no && can_build_shared=no
9139
9140 with_gnu_ld=$with_gnu_ld
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156 #
9157 # Do we need to explicitly link libc?
9158 #
9159 case "x$archive_cmds_need_lc" in
9160 x|xyes)
9161 # Assume -lc should be added
9162 archive_cmds_need_lc=yes
9163
9164 if test "$enable_shared" = yes && test "$GCC" = yes; then
9165 case $archive_cmds in
9166 *'~'*)
9167 # FIXME: we may have to deal with multi-command sequences.
9168 ;;
9169 '$CC '*)
9170 # Test whether the compiler implicitly links with -lc since on some
9171 # systems, -lgcc has to come before -lc. If gcc already passes -lc
9172 # to ld, don't add -lc before -lgcc.
9173 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
9174 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
9175 $RM conftest*
9176 echo "$lt_simple_compile_test_code" > conftest.$ac_ext
9177
9178 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
9179 (eval $ac_compile) 2>&5
9180 ac_status=$?
9181 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9182 test $ac_status = 0; } 2>conftest.err; then
9183 soname=conftest
9184 lib=conftest
9185 libobjs=conftest.$ac_objext
9186 deplibs=
9187 wl=$lt_prog_compiler_wl
9188 pic_flag=$lt_prog_compiler_pic
9189 compiler_flags=-v
9190 linker_flags=-v
9191 verstring=
9192 output_objdir=.
9193 libname=conftest
9194 lt_save_allow_undefined_flag=$allow_undefined_flag
9195 allow_undefined_flag=
9196 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
9197 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
9198 ac_status=$?
9199 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
9200 test $ac_status = 0; }
9201 then
9202 archive_cmds_need_lc=no
9203 else
9204 archive_cmds_need_lc=yes
9205 fi
9206 allow_undefined_flag=$lt_save_allow_undefined_flag
9207 else
9208 cat conftest.err 1>&5
9209 fi
9210 $RM conftest*
9211 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5
9212 $as_echo "$archive_cmds_need_lc" >&6; }
9213 ;;
9214 esac
9215 fi
9216 ;;
9217 esac
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375 { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
9376 $as_echo_n "checking dynamic linker characteristics... " >&6; }
9377
9378 if test "$GCC" = yes; then
9379 case $host_os in
9380 darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
9381 *) lt_awk_arg="/^libraries:/" ;;
9382 esac
9383 lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
9384 if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
9385 # if the path contains ";" then we assume it to be the separator
9386 # otherwise default to the standard path separator (i.e. ":") - it is
9387 # assumed that no part of a normal pathname contains ";" but that should
9388 # okay in the real world where ";" in dirpaths is itself problematic.
9389 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
9390 else
9391 lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
9392 fi
9393 # Ok, now we have the path, separated by spaces, we can step through it
9394 # and add multilib dir if necessary.
9395 lt_tmp_lt_search_path_spec=
9396 lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
9397 for lt_sys_path in $lt_search_path_spec; do
9398 if test -d "$lt_sys_path/$lt_multi_os_dir"; then
9399 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
9400 else
9401 test -d "$lt_sys_path" && \
9402 lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
9403 fi
9404 done
9405 lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
9406 BEGIN {RS=" "; FS="/|\n";} {
9407 lt_foo="";
9408 lt_count=0;
9409 for (lt_i = NF; lt_i > 0; lt_i--) {
9410 if ($lt_i != "" && $lt_i != ".") {
9411 if ($lt_i == "..") {
9412 lt_count++;
9413 } else {
9414 if (lt_count == 0) {
9415 lt_foo="/" $lt_i lt_foo;
9416 } else {
9417 lt_count--;
9418 }
9419 }
9420 }
9421 }
9422 if (lt_foo != "") { lt_freq[lt_foo]++; }
9423 if (lt_freq[lt_foo] == 1) { print lt_foo; }
9424 }'`
9425 sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
9426 else
9427 sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
9428 fi
9429 library_names_spec=
9430 libname_spec='lib$name'
9431 soname_spec=
9432 shrext_cmds=".so"
9433 postinstall_cmds=
9434 postuninstall_cmds=
9435 finish_cmds=
9436 finish_eval=
9437 shlibpath_var=
9438 shlibpath_overrides_runpath=unknown
9439 version_type=none
9440 dynamic_linker="$host_os ld.so"
9441 sys_lib_dlsearch_path_spec="/lib /usr/lib"
9442 need_lib_prefix=unknown
9443 hardcode_into_libs=no
9444
9445 # when you set need_version to no, make sure it does not cause -set_version
9446 # flags to be left without arguments
9447 need_version=unknown
9448
9449 case $host_os in
9450 aix3*)
9451 version_type=linux
9452 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
9453 shlibpath_var=LIBPATH
9454
9455 # AIX 3 has no versioning support, so we append a major version to the name.
9456 soname_spec='${libname}${release}${shared_ext}$major'
9457 ;;
9458
9459 aix[4-9]*)
9460 version_type=linux
9461 need_lib_prefix=no
9462 need_version=no
9463 hardcode_into_libs=yes
9464 if test "$host_cpu" = ia64; then
9465 # AIX 5 supports IA64
9466 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
9467 shlibpath_var=LD_LIBRARY_PATH
9468 else
9469 # With GCC up to 2.95.x, collect2 would create an import file
9470 # for dependence libraries. The import file would start with
9471 # the line `#! .'. This would cause the generated library to
9472 # depend on `.', always an invalid library. This was fixed in
9473 # development snapshots of GCC prior to 3.0.
9474 case $host_os in
9475 aix4 | aix4.[01] | aix4.[01].*)
9476 if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
9477 echo ' yes '
9478 echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
9479 :
9480 else
9481 can_build_shared=no
9482 fi
9483 ;;
9484 esac
9485 # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
9486 # soname into executable. Probably we can add versioning support to
9487 # collect2, so additional links can be useful in future.
9488 if test "$aix_use_runtimelinking" = yes; then
9489 # If using run time linking (on AIX 4.2 or later) use lib<name>.so
9490 # instead of lib<name>.a to let people know that these are not
9491 # typical AIX shared libraries.
9492 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9493 else
9494 # We preserve .a as extension for shared libraries through AIX4.2
9495 # and later when we are not doing run time linking.
9496 library_names_spec='${libname}${release}.a $libname.a'
9497 soname_spec='${libname}${release}${shared_ext}$major'
9498 fi
9499 shlibpath_var=LIBPATH
9500 fi
9501 ;;
9502
9503 amigaos*)
9504 case $host_cpu in
9505 powerpc)
9506 # Since July 2007 AmigaOS4 officially supports .so libraries.
9507 # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
9508 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9509 ;;
9510 m68k)
9511 library_names_spec='$libname.ixlibrary $libname.a'
9512 # Create ${libname}_ixlibrary.a entries in /sys/libs.
9513 finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
9514 ;;
9515 esac
9516 ;;
9517
9518 beos*)
9519 library_names_spec='${libname}${shared_ext}'
9520 dynamic_linker="$host_os ld.so"
9521 shlibpath_var=LIBRARY_PATH
9522 ;;
9523
9524 bsdi[45]*)
9525 version_type=linux
9526 need_version=no
9527 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9528 soname_spec='${libname}${release}${shared_ext}$major'
9529 finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
9530 shlibpath_var=LD_LIBRARY_PATH
9531 sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
9532 sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
9533 # the default ld.so.conf also contains /usr/contrib/lib and
9534 # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
9535 # libtool to hard-code these into programs
9536 ;;
9537
9538 cygwin* | mingw* | pw32* | cegcc*)
9539 version_type=windows
9540 shrext_cmds=".dll"
9541 need_version=no
9542 need_lib_prefix=no
9543
9544 case $GCC,$host_os in
9545 yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
9546 library_names_spec='$libname.dll.a'
9547 # DLL is installed to $(libdir)/../bin by postinstall_cmds
9548 postinstall_cmds='base_file=`basename \${file}`~
9549 dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
9550 dldir=$destdir/`dirname \$dlpath`~
9551 test -d \$dldir || mkdir -p \$dldir~
9552 $install_prog $dir/$dlname \$dldir/$dlname~
9553 chmod a+x \$dldir/$dlname~
9554 if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
9555 eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
9556 fi'
9557 postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
9558 dlpath=$dir/\$dldll~
9559 $RM \$dlpath'
9560 shlibpath_overrides_runpath=yes
9561
9562 case $host_os in
9563 cygwin*)
9564 # Cygwin DLLs use 'cyg' prefix rather than 'lib'
9565 soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9566 sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
9567 ;;
9568 mingw* | cegcc*)
9569 # MinGW DLLs use traditional 'lib' prefix
9570 soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9571 sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
9572 if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
9573 # It is most probably a Windows format PATH printed by
9574 # mingw gcc, but we are running on Cygwin. Gcc prints its search
9575 # path with ; separators, and with drive letters. We can handle the
9576 # drive letters (cygwin fileutils understands them), so leave them,
9577 # especially as we might pass files found there to a mingw objdump,
9578 # which wouldn't understand a cygwinified path. Ahh.
9579 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
9580 else
9581 sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
9582 fi
9583 ;;
9584 pw32*)
9585 # pw32 DLLs use 'pw' prefix rather than 'lib'
9586 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
9587 ;;
9588 esac
9589 ;;
9590
9591 *)
9592 library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
9593 ;;
9594 esac
9595 dynamic_linker='Win32 ld.exe'
9596 # FIXME: first we should search . and the directory the executable is in
9597 shlibpath_var=PATH
9598 ;;
9599
9600 darwin* | rhapsody*)
9601 dynamic_linker="$host_os dyld"
9602 version_type=darwin
9603 need_lib_prefix=no
9604 need_version=no
9605 library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
9606 soname_spec='${libname}${release}${major}$shared_ext'
9607 shlibpath_overrides_runpath=yes
9608 shlibpath_var=DYLD_LIBRARY_PATH
9609 shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
9610
9611 sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
9612 sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
9613 ;;
9614
9615 dgux*)
9616 version_type=linux
9617 need_lib_prefix=no
9618 need_version=no
9619 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
9620 soname_spec='${libname}${release}${shared_ext}$major'
9621 shlibpath_var=LD_LIBRARY_PATH
9622 ;;
9623
9624 freebsd1*)
9625 dynamic_linker=no
9626 ;;
9627
9628 freebsd* | dragonfly*)
9629 # DragonFly does not have aout. When/if they implement a new
9630 # versioning mechanism, adjust this.
9631 if test -x /usr/bin/objformat; then
9632 objformat=`/usr/bin/objformat`
9633 else
9634 case $host_os in
9635 freebsd[123]*) objformat=aout ;;
9636 *) objformat=elf ;;
9637 esac
9638 fi
9639 version_type=freebsd-$objformat
9640 case $version_type in
9641 freebsd-elf*)
9642 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
9643 need_version=no
9644 need_lib_prefix=no
9645 ;;
9646 freebsd-*)
9647 library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
9648 need_version=yes
9649 ;;
9650 esac
9651 shlibpath_var=LD_LIBRARY_PATH
9652 case $host_os in
9653 freebsd2*)
9654 shlibpath_overrides_runpath=yes
9655 ;;
9656 freebsd3.[01]* | freebsdelf3.[01]*)
9657 shlibpath_overrides_runpath=yes
9658 hardcode_into_libs=yes
9659 ;;
9660 freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
9661 freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
9662 shlibpath_overrides_runpath=no
9663 hardcode_into_libs=yes
9664 ;;
9665 *) # from 4.6 on, and DragonFly
9666 shlibpath_overrides_runpath=yes
9667 hardcode_into_libs=yes
9668 ;;
9669 esac
9670 ;;
9671
9672 gnu*)
9673 version_type=linux
9674 need_lib_prefix=no
9675 need_version=no
9676 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
9677 soname_spec='${libname}${release}${shared_ext}$major'
9678 shlibpath_var=LD_LIBRARY_PATH
9679 hardcode_into_libs=yes
9680 ;;
9681
9682 hpux9* | hpux10* | hpux11*)
9683 # Give a soname corresponding to the major version so that dld.sl refuses to
9684 # link against other versions.
9685 version_type=sunos
9686 need_lib_prefix=no
9687 need_version=no
9688 case $host_cpu in
9689 ia64*)
9690 shrext_cmds='.so'
9691 hardcode_into_libs=yes
9692 dynamic_linker="$host_os dld.so"
9693 shlibpath_var=LD_LIBRARY_PATH
9694 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
9695 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9696 soname_spec='${libname}${release}${shared_ext}$major'
9697 if test "X$HPUX_IA64_MODE" = X32; then
9698 sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
9699 else
9700 sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
9701 fi
9702 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
9703 ;;
9704 hppa*64*)
9705 shrext_cmds='.sl'
9706 hardcode_into_libs=yes
9707 dynamic_linker="$host_os dld.sl"
9708 shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
9709 shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
9710 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9711 soname_spec='${libname}${release}${shared_ext}$major'
9712 sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
9713 sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
9714 ;;
9715 *)
9716 shrext_cmds='.sl'
9717 dynamic_linker="$host_os dld.sl"
9718 shlibpath_var=SHLIB_PATH
9719 shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
9720 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9721 soname_spec='${libname}${release}${shared_ext}$major'
9722 ;;
9723 esac
9724 # HP-UX runs *really* slowly unless shared libraries are mode 555.
9725 postinstall_cmds='chmod 555 $lib'
9726 ;;
9727
9728 interix[3-9]*)
9729 version_type=linux
9730 need_lib_prefix=no
9731 need_version=no
9732 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
9733 soname_spec='${libname}${release}${shared_ext}$major'
9734 dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
9735 shlibpath_var=LD_LIBRARY_PATH
9736 shlibpath_overrides_runpath=no
9737 hardcode_into_libs=yes
9738 ;;
9739
9740 irix5* | irix6* | nonstopux*)
9741 case $host_os in
9742 nonstopux*) version_type=nonstopux ;;
9743 *)
9744 if test "$lt_cv_prog_gnu_ld" = yes; then
9745 version_type=linux
9746 else
9747 version_type=irix
9748 fi ;;
9749 esac
9750 need_lib_prefix=no
9751 need_version=no
9752 soname_spec='${libname}${release}${shared_ext}$major'
9753 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
9754 case $host_os in
9755 irix5* | nonstopux*)
9756 libsuff= shlibsuff=
9757 ;;
9758 *)
9759 case $LD in # libtool.m4 will add one of these switches to LD
9760 *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
9761 libsuff= shlibsuff= libmagic=32-bit;;
9762 *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
9763 libsuff=32 shlibsuff=N32 libmagic=N32;;
9764 *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
9765 libsuff=64 shlibsuff=64 libmagic=64-bit;;
9766 *) libsuff= shlibsuff= libmagic=never-match;;
9767 esac
9768 ;;
9769 esac
9770 shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
9771 shlibpath_overrides_runpath=no
9772 sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
9773 sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
9774 hardcode_into_libs=yes
9775 ;;
9776
9777 # No shared lib support for Linux oldld, aout, or coff.
9778 linux*oldld* | linux*aout* | linux*coff*)
9779 dynamic_linker=no
9780 ;;
9781
9782 # This must be Linux ELF.
9783 linux* | k*bsd*-gnu | kopensolaris*-gnu)
9784 version_type=linux
9785 need_lib_prefix=no
9786 need_version=no
9787 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9788 soname_spec='${libname}${release}${shared_ext}$major'
9789 finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
9790 shlibpath_var=LD_LIBRARY_PATH
9791 shlibpath_overrides_runpath=no
9792 # Some binutils ld are patched to set DT_RUNPATH
9793 save_LDFLAGS=$LDFLAGS
9794 save_libdir=$libdir
9795 eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
9796 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
9797 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9798 /* end confdefs.h. */
9799
9800 int
9801 main ()
9802 {
9803
9804 ;
9805 return 0;
9806 }
9807 _ACEOF
9808 if ac_fn_c_try_link "$LINENO"; then :
9809 if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
9810 shlibpath_overrides_runpath=yes
9811 fi
9812 fi
9813 rm -f core conftest.err conftest.$ac_objext \
9814 conftest$ac_exeext conftest.$ac_ext
9815 LDFLAGS=$save_LDFLAGS
9816 libdir=$save_libdir
9817
9818 # This implies no fast_install, which is unacceptable.
9819 # Some rework will be needed to allow for fast_install
9820 # before this can be enabled.
9821 hardcode_into_libs=yes
9822
9823 # Append ld.so.conf contents to the search path
9824 if test -f /etc/ld.so.conf; then
9825 lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
9826 sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
9827 fi
9828
9829 # We used to test for /lib/ld.so.1 and disable shared libraries on
9830 # powerpc, because MkLinux only supported shared libraries with the
9831 # GNU dynamic linker. Since this was broken with cross compilers,
9832 # most powerpc-linux boxes support dynamic linking these days and
9833 # people can always --disable-shared, the test was removed, and we
9834 # assume the GNU/Linux dynamic linker is in use.
9835 dynamic_linker='GNU/Linux ld.so'
9836 ;;
9837
9838 netbsdelf*-gnu)
9839 version_type=linux
9840 need_lib_prefix=no
9841 need_version=no
9842 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
9843 soname_spec='${libname}${release}${shared_ext}$major'
9844 shlibpath_var=LD_LIBRARY_PATH
9845 shlibpath_overrides_runpath=no
9846 hardcode_into_libs=yes
9847 dynamic_linker='NetBSD ld.elf_so'
9848 ;;
9849
9850 netbsd*)
9851 version_type=sunos
9852 need_lib_prefix=no
9853 need_version=no
9854 if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9855 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
9856 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
9857 dynamic_linker='NetBSD (a.out) ld.so'
9858 else
9859 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
9860 soname_spec='${libname}${release}${shared_ext}$major'
9861 dynamic_linker='NetBSD ld.elf_so'
9862 fi
9863 shlibpath_var=LD_LIBRARY_PATH
9864 shlibpath_overrides_runpath=yes
9865 hardcode_into_libs=yes
9866 ;;
9867
9868 newsos6)
9869 version_type=linux
9870 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9871 shlibpath_var=LD_LIBRARY_PATH
9872 shlibpath_overrides_runpath=yes
9873 ;;
9874
9875 *nto* | *qnx*)
9876 version_type=qnx
9877 need_lib_prefix=no
9878 need_version=no
9879 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9880 soname_spec='${libname}${release}${shared_ext}$major'
9881 shlibpath_var=LD_LIBRARY_PATH
9882 shlibpath_overrides_runpath=no
9883 hardcode_into_libs=yes
9884 dynamic_linker='ldqnx.so'
9885 ;;
9886
9887 openbsd*)
9888 version_type=sunos
9889 sys_lib_dlsearch_path_spec="/usr/lib"
9890 need_lib_prefix=no
9891 # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
9892 case $host_os in
9893 openbsd3.3 | openbsd3.3.*) need_version=yes ;;
9894 *) need_version=no ;;
9895 esac
9896 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
9897 finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
9898 shlibpath_var=LD_LIBRARY_PATH
9899 if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
9900 case $host_os in
9901 openbsd2.[89] | openbsd2.[89].*)
9902 shlibpath_overrides_runpath=no
9903 ;;
9904 *)
9905 shlibpath_overrides_runpath=yes
9906 ;;
9907 esac
9908 else
9909 shlibpath_overrides_runpath=yes
9910 fi
9911 ;;
9912
9913 os2*)
9914 libname_spec='$name'
9915 shrext_cmds=".dll"
9916 need_lib_prefix=no
9917 library_names_spec='$libname${shared_ext} $libname.a'
9918 dynamic_linker='OS/2 ld.exe'
9919 shlibpath_var=LIBPATH
9920 ;;
9921
9922 osf3* | osf4* | osf5*)
9923 version_type=osf
9924 need_lib_prefix=no
9925 need_version=no
9926 soname_spec='${libname}${release}${shared_ext}$major'
9927 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9928 shlibpath_var=LD_LIBRARY_PATH
9929 sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
9930 sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
9931 ;;
9932
9933 rdos*)
9934 dynamic_linker=no
9935 ;;
9936
9937 solaris*)
9938 version_type=linux
9939 need_lib_prefix=no
9940 need_version=no
9941 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9942 soname_spec='${libname}${release}${shared_ext}$major'
9943 shlibpath_var=LD_LIBRARY_PATH
9944 shlibpath_overrides_runpath=yes
9945 hardcode_into_libs=yes
9946 # ldd complains unless libraries are executable
9947 postinstall_cmds='chmod +x $lib'
9948 ;;
9949
9950 sunos4*)
9951 version_type=sunos
9952 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
9953 finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
9954 shlibpath_var=LD_LIBRARY_PATH
9955 shlibpath_overrides_runpath=yes
9956 if test "$with_gnu_ld" = yes; then
9957 need_lib_prefix=no
9958 fi
9959 need_version=yes
9960 ;;
9961
9962 sysv4 | sysv4.3*)
9963 version_type=linux
9964 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
9965 soname_spec='${libname}${release}${shared_ext}$major'
9966 shlibpath_var=LD_LIBRARY_PATH
9967 case $host_vendor in
9968 sni)
9969 shlibpath_overrides_runpath=no
9970 need_lib_prefix=no
9971 runpath_var=LD_RUN_PATH
9972 ;;
9973 siemens)
9974 need_lib_prefix=no
9975 ;;
9976 motorola)
9977 need_lib_prefix=no
9978 need_version=no
9979 shlibpath_overrides_runpath=no
9980 sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
9981 ;;
9982 esac
9983 ;;
9984
9985 sysv4*MP*)
9986 if test -d /usr/nec ;then
9987 version_type=linux
9988 library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
9989 soname_spec='$libname${shared_ext}.$major'
9990 shlibpath_var=LD_LIBRARY_PATH
9991 fi
9992 ;;
9993
9994 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
9995 version_type=freebsd-elf
9996 need_lib_prefix=no
9997 need_version=no
9998 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
9999 soname_spec='${libname}${release}${shared_ext}$major'
10000 shlibpath_var=LD_LIBRARY_PATH
10001 shlibpath_overrides_runpath=yes
10002 hardcode_into_libs=yes
10003 if test "$with_gnu_ld" = yes; then
10004 sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
10005 else
10006 sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
10007 case $host_os in
10008 sco3.2v5*)
10009 sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
10010 ;;
10011 esac
10012 fi
10013 sys_lib_dlsearch_path_spec='/usr/lib'
10014 ;;
10015
10016 tpf*)
10017 # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
10018 version_type=linux
10019 need_lib_prefix=no
10020 need_version=no
10021 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10022 shlibpath_var=LD_LIBRARY_PATH
10023 shlibpath_overrides_runpath=no
10024 hardcode_into_libs=yes
10025 ;;
10026
10027 uts4*)
10028 version_type=linux
10029 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10030 soname_spec='${libname}${release}${shared_ext}$major'
10031 shlibpath_var=LD_LIBRARY_PATH
10032 ;;
10033
10034 *)
10035 dynamic_linker=no
10036 ;;
10037 esac
10038 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
10039 $as_echo "$dynamic_linker" >&6; }
10040 test "$dynamic_linker" = no && can_build_shared=no
10041
10042 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
10043 if test "$GCC" = yes; then
10044 variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
10045 fi
10046
10047 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
10048 sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
10049 fi
10050 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
10051 sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
10052 fi
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
10141 $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
10142 hardcode_action=
10143 if test -n "$hardcode_libdir_flag_spec" ||
10144 test -n "$runpath_var" ||
10145 test "X$hardcode_automatic" = "Xyes" ; then
10146
10147 # We can hardcode non-existent directories.
10148 if test "$hardcode_direct" != no &&
10149 # If the only mechanism to avoid hardcoding is shlibpath_var, we
10150 # have to relink, otherwise we might link with an installed library
10151 # when we should be linking with a yet-to-be-installed one
10152 ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
10153 test "$hardcode_minus_L" != no; then
10154 # Linking always hardcodes the temporary library directory.
10155 hardcode_action=relink
10156 else
10157 # We can link without hardcoding, and we can hardcode nonexisting dirs.
10158 hardcode_action=immediate
10159 fi
10160 else
10161 # We cannot hardcode anything, or else we can only hardcode existing
10162 # directories.
10163 hardcode_action=unsupported
10164 fi
10165 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
10166 $as_echo "$hardcode_action" >&6; }
10167
10168 if test "$hardcode_action" = relink ||
10169 test "$inherit_rpath" = yes; then
10170 # Fast installation is not supported
10171 enable_fast_install=no
10172 elif test "$shlibpath_overrides_runpath" = yes ||
10173 test "$enable_shared" = no; then
10174 # Fast installation is not necessary
10175 enable_fast_install=needless
10176 fi
10177
10178
10179
10180
10181
10182
10183 if test "x$enable_dlopen" != xyes; then
10184 enable_dlopen=unknown
10185 enable_dlopen_self=unknown
10186 enable_dlopen_self_static=unknown
10187 else
10188 lt_cv_dlopen=no
10189 lt_cv_dlopen_libs=
10190
10191 case $host_os in
10192 beos*)
10193 lt_cv_dlopen="load_add_on"
10194 lt_cv_dlopen_libs=
10195 lt_cv_dlopen_self=yes
10196 ;;
10197
10198 mingw* | pw32* | cegcc*)
10199 lt_cv_dlopen="LoadLibrary"
10200 lt_cv_dlopen_libs=
10201 ;;
10202
10203 cygwin*)
10204 lt_cv_dlopen="dlopen"
10205 lt_cv_dlopen_libs=
10206 ;;
10207
10208 darwin*)
10209 # if libdl is installed we need to link against it
10210 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
10211 $as_echo_n "checking for dlopen in -ldl... " >&6; }
10212 if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
10213 $as_echo_n "(cached) " >&6
10214 else
10215 ac_check_lib_save_LIBS=$LIBS
10216 LIBS="-ldl $LIBS"
10217 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10218 /* end confdefs.h. */
10219
10220 /* Override any GCC internal prototype to avoid an error.
10221 Use char because int might match the return type of a GCC
10222 builtin and then its argument prototype would still apply. */
10223 #ifdef __cplusplus
10224 extern "C"
10225 #endif
10226 char dlopen ();
10227 int
10228 main ()
10229 {
10230 return dlopen ();
10231 ;
10232 return 0;
10233 }
10234 _ACEOF
10235 if ac_fn_c_try_link "$LINENO"; then :
10236 ac_cv_lib_dl_dlopen=yes
10237 else
10238 ac_cv_lib_dl_dlopen=no
10239 fi
10240 rm -f core conftest.err conftest.$ac_objext \
10241 conftest$ac_exeext conftest.$ac_ext
10242 LIBS=$ac_check_lib_save_LIBS
10243 fi
10244 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
10245 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
10246 if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
10247 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
10248 else
10249
10250 lt_cv_dlopen="dyld"
10251 lt_cv_dlopen_libs=
10252 lt_cv_dlopen_self=yes
10253
10254 fi
10255
10256 ;;
10257
10258 *)
10259 ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
10260 if test "x$ac_cv_func_shl_load" = x""yes; then :
10261 lt_cv_dlopen="shl_load"
10262 else
10263 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
10264 $as_echo_n "checking for shl_load in -ldld... " >&6; }
10265 if test "${ac_cv_lib_dld_shl_load+set}" = set; then :
10266 $as_echo_n "(cached) " >&6
10267 else
10268 ac_check_lib_save_LIBS=$LIBS
10269 LIBS="-ldld $LIBS"
10270 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10271 /* end confdefs.h. */
10272
10273 /* Override any GCC internal prototype to avoid an error.
10274 Use char because int might match the return type of a GCC
10275 builtin and then its argument prototype would still apply. */
10276 #ifdef __cplusplus
10277 extern "C"
10278 #endif
10279 char shl_load ();
10280 int
10281 main ()
10282 {
10283 return shl_load ();
10284 ;
10285 return 0;
10286 }
10287 _ACEOF
10288 if ac_fn_c_try_link "$LINENO"; then :
10289 ac_cv_lib_dld_shl_load=yes
10290 else
10291 ac_cv_lib_dld_shl_load=no
10292 fi
10293 rm -f core conftest.err conftest.$ac_objext \
10294 conftest$ac_exeext conftest.$ac_ext
10295 LIBS=$ac_check_lib_save_LIBS
10296 fi
10297 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
10298 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
10299 if test "x$ac_cv_lib_dld_shl_load" = x""yes; then :
10300 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
10301 else
10302 ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
10303 if test "x$ac_cv_func_dlopen" = x""yes; then :
10304 lt_cv_dlopen="dlopen"
10305 else
10306 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
10307 $as_echo_n "checking for dlopen in -ldl... " >&6; }
10308 if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
10309 $as_echo_n "(cached) " >&6
10310 else
10311 ac_check_lib_save_LIBS=$LIBS
10312 LIBS="-ldl $LIBS"
10313 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10314 /* end confdefs.h. */
10315
10316 /* Override any GCC internal prototype to avoid an error.
10317 Use char because int might match the return type of a GCC
10318 builtin and then its argument prototype would still apply. */
10319 #ifdef __cplusplus
10320 extern "C"
10321 #endif
10322 char dlopen ();
10323 int
10324 main ()
10325 {
10326 return dlopen ();
10327 ;
10328 return 0;
10329 }
10330 _ACEOF
10331 if ac_fn_c_try_link "$LINENO"; then :
10332 ac_cv_lib_dl_dlopen=yes
10333 else
10334 ac_cv_lib_dl_dlopen=no
10335 fi
10336 rm -f core conftest.err conftest.$ac_objext \
10337 conftest$ac_exeext conftest.$ac_ext
10338 LIBS=$ac_check_lib_save_LIBS
10339 fi
10340 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
10341 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
10342 if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
10343 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
10344 else
10345 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
10346 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
10347 if test "${ac_cv_lib_svld_dlopen+set}" = set; then :
10348 $as_echo_n "(cached) " >&6
10349 else
10350 ac_check_lib_save_LIBS=$LIBS
10351 LIBS="-lsvld $LIBS"
10352 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10353 /* end confdefs.h. */
10354
10355 /* Override any GCC internal prototype to avoid an error.
10356 Use char because int might match the return type of a GCC
10357 builtin and then its argument prototype would still apply. */
10358 #ifdef __cplusplus
10359 extern "C"
10360 #endif
10361 char dlopen ();
10362 int
10363 main ()
10364 {
10365 return dlopen ();
10366 ;
10367 return 0;
10368 }
10369 _ACEOF
10370 if ac_fn_c_try_link "$LINENO"; then :
10371 ac_cv_lib_svld_dlopen=yes
10372 else
10373 ac_cv_lib_svld_dlopen=no
10374 fi
10375 rm -f core conftest.err conftest.$ac_objext \
10376 conftest$ac_exeext conftest.$ac_ext
10377 LIBS=$ac_check_lib_save_LIBS
10378 fi
10379 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
10380 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
10381 if test "x$ac_cv_lib_svld_dlopen" = x""yes; then :
10382 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
10383 else
10384 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
10385 $as_echo_n "checking for dld_link in -ldld... " >&6; }
10386 if test "${ac_cv_lib_dld_dld_link+set}" = set; then :
10387 $as_echo_n "(cached) " >&6
10388 else
10389 ac_check_lib_save_LIBS=$LIBS
10390 LIBS="-ldld $LIBS"
10391 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10392 /* end confdefs.h. */
10393
10394 /* Override any GCC internal prototype to avoid an error.
10395 Use char because int might match the return type of a GCC
10396 builtin and then its argument prototype would still apply. */
10397 #ifdef __cplusplus
10398 extern "C"
10399 #endif
10400 char dld_link ();
10401 int
10402 main ()
10403 {
10404 return dld_link ();
10405 ;
10406 return 0;
10407 }
10408 _ACEOF
10409 if ac_fn_c_try_link "$LINENO"; then :
10410 ac_cv_lib_dld_dld_link=yes
10411 else
10412 ac_cv_lib_dld_dld_link=no
10413 fi
10414 rm -f core conftest.err conftest.$ac_objext \
10415 conftest$ac_exeext conftest.$ac_ext
10416 LIBS=$ac_check_lib_save_LIBS
10417 fi
10418 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
10419 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
10420 if test "x$ac_cv_lib_dld_dld_link" = x""yes; then :
10421 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
10422 fi
10423
10424
10425 fi
10426
10427
10428 fi
10429
10430
10431 fi
10432
10433
10434 fi
10435
10436
10437 fi
10438
10439 ;;
10440 esac
10441
10442 if test "x$lt_cv_dlopen" != xno; then
10443 enable_dlopen=yes
10444 else
10445 enable_dlopen=no
10446 fi
10447
10448 case $lt_cv_dlopen in
10449 dlopen)
10450 save_CPPFLAGS="$CPPFLAGS"
10451 test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
10452
10453 save_LDFLAGS="$LDFLAGS"
10454 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
10455
10456 save_LIBS="$LIBS"
10457 LIBS="$lt_cv_dlopen_libs $LIBS"
10458
10459 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
10460 $as_echo_n "checking whether a program can dlopen itself... " >&6; }
10461 if test "${lt_cv_dlopen_self+set}" = set; then :
10462 $as_echo_n "(cached) " >&6
10463 else
10464 if test "$cross_compiling" = yes; then :
10465 lt_cv_dlopen_self=cross
10466 else
10467 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
10468 lt_status=$lt_dlunknown
10469 cat > conftest.$ac_ext <<_LT_EOF
10470 #line 10471 "configure"
10471 #include "confdefs.h"
10472
10473 #if HAVE_DLFCN_H
10474 #include <dlfcn.h>
10475 #endif
10476
10477 #include <stdio.h>
10478
10479 #ifdef RTLD_GLOBAL
10480 # define LT_DLGLOBAL RTLD_GLOBAL
10481 #else
10482 # ifdef DL_GLOBAL
10483 # define LT_DLGLOBAL DL_GLOBAL
10484 # else
10485 # define LT_DLGLOBAL 0
10486 # endif
10487 #endif
10488
10489 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
10490 find out it does not work in some platform. */
10491 #ifndef LT_DLLAZY_OR_NOW
10492 # ifdef RTLD_LAZY
10493 # define LT_DLLAZY_OR_NOW RTLD_LAZY
10494 # else
10495 # ifdef DL_LAZY
10496 # define LT_DLLAZY_OR_NOW DL_LAZY
10497 # else
10498 # ifdef RTLD_NOW
10499 # define LT_DLLAZY_OR_NOW RTLD_NOW
10500 # else
10501 # ifdef DL_NOW
10502 # define LT_DLLAZY_OR_NOW DL_NOW
10503 # else
10504 # define LT_DLLAZY_OR_NOW 0
10505 # endif
10506 # endif
10507 # endif
10508 # endif
10509 #endif
10510
10511 void fnord() { int i=42;}
10512 int main ()
10513 {
10514 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
10515 int status = $lt_dlunknown;
10516
10517 if (self)
10518 {
10519 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
10520 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
10521 /* dlclose (self); */
10522 }
10523 else
10524 puts (dlerror ());
10525
10526 return status;
10527 }
10528 _LT_EOF
10529 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
10530 (eval $ac_link) 2>&5
10531 ac_status=$?
10532 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10533 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
10534 (./conftest; exit; ) >&5 2>/dev/null
10535 lt_status=$?
10536 case x$lt_status in
10537 x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
10538 x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
10539 x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
10540 esac
10541 else :
10542 # compilation failed
10543 lt_cv_dlopen_self=no
10544 fi
10545 fi
10546 rm -fr conftest*
10547
10548
10549 fi
10550 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
10551 $as_echo "$lt_cv_dlopen_self" >&6; }
10552
10553 if test "x$lt_cv_dlopen_self" = xyes; then
10554 wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
10555 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
10556 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
10557 if test "${lt_cv_dlopen_self_static+set}" = set; then :
10558 $as_echo_n "(cached) " >&6
10559 else
10560 if test "$cross_compiling" = yes; then :
10561 lt_cv_dlopen_self_static=cross
10562 else
10563 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
10564 lt_status=$lt_dlunknown
10565 cat > conftest.$ac_ext <<_LT_EOF
10566 #line 10567 "configure"
10567 #include "confdefs.h"
10568
10569 #if HAVE_DLFCN_H
10570 #include <dlfcn.h>
10571 #endif
10572
10573 #include <stdio.h>
10574
10575 #ifdef RTLD_GLOBAL
10576 # define LT_DLGLOBAL RTLD_GLOBAL
10577 #else
10578 # ifdef DL_GLOBAL
10579 # define LT_DLGLOBAL DL_GLOBAL
10580 # else
10581 # define LT_DLGLOBAL 0
10582 # endif
10583 #endif
10584
10585 /* We may have to define LT_DLLAZY_OR_NOW in the command line if we
10586 find out it does not work in some platform. */
10587 #ifndef LT_DLLAZY_OR_NOW
10588 # ifdef RTLD_LAZY
10589 # define LT_DLLAZY_OR_NOW RTLD_LAZY
10590 # else
10591 # ifdef DL_LAZY
10592 # define LT_DLLAZY_OR_NOW DL_LAZY
10593 # else
10594 # ifdef RTLD_NOW
10595 # define LT_DLLAZY_OR_NOW RTLD_NOW
10596 # else
10597 # ifdef DL_NOW
10598 # define LT_DLLAZY_OR_NOW DL_NOW
10599 # else
10600 # define LT_DLLAZY_OR_NOW 0
10601 # endif
10602 # endif
10603 # endif
10604 # endif
10605 #endif
10606
10607 void fnord() { int i=42;}
10608 int main ()
10609 {
10610 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
10611 int status = $lt_dlunknown;
10612
10613 if (self)
10614 {
10615 if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
10616 else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
10617 /* dlclose (self); */
10618 }
10619 else
10620 puts (dlerror ());
10621
10622 return status;
10623 }
10624 _LT_EOF
10625 if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
10626 (eval $ac_link) 2>&5
10627 ac_status=$?
10628 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10629 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
10630 (./conftest; exit; ) >&5 2>/dev/null
10631 lt_status=$?
10632 case x$lt_status in
10633 x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
10634 x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
10635 x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
10636 esac
10637 else :
10638 # compilation failed
10639 lt_cv_dlopen_self_static=no
10640 fi
10641 fi
10642 rm -fr conftest*
10643
10644
10645 fi
10646 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
10647 $as_echo "$lt_cv_dlopen_self_static" >&6; }
10648 fi
10649
10650 CPPFLAGS="$save_CPPFLAGS"
10651 LDFLAGS="$save_LDFLAGS"
10652 LIBS="$save_LIBS"
10653 ;;
10654 esac
10655
10656 case $lt_cv_dlopen_self in
10657 yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
10658 *) enable_dlopen_self=unknown ;;
10659 esac
10660
10661 case $lt_cv_dlopen_self_static in
10662 yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
10663 *) enable_dlopen_self_static=unknown ;;
10664 esac
10665 fi
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683 striplib=
10684 old_striplib=
10685 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
10686 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
10687 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
10688 test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
10689 test -z "$striplib" && striplib="$STRIP --strip-unneeded"
10690 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
10691 $as_echo "yes" >&6; }
10692 else
10693 # FIXME - insert some real tests, host_os isn't really good enough
10694 case $host_os in
10695 darwin*)
10696 if test -n "$STRIP" ; then
10697 striplib="$STRIP -x"
10698 old_striplib="$STRIP -S"
10699 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
10700 $as_echo "yes" >&6; }
10701 else
10702 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10703 $as_echo "no" >&6; }
10704 fi
10705 ;;
10706 *)
10707 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
10708 $as_echo "no" >&6; }
10709 ;;
10710 esac
10711 fi
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724 # Report which library types will actually be built
10725 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
10726 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
10727 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
10728 $as_echo "$can_build_shared" >&6; }
10729
10730 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
10731 $as_echo_n "checking whether to build shared libraries... " >&6; }
10732 test "$can_build_shared" = "no" && enable_shared=no
10733
10734 # On AIX, shared libraries and static libraries use the same namespace, and
10735 # are all built from PIC.
10736 case $host_os in
10737 aix3*)
10738 test "$enable_shared" = yes && enable_static=no
10739 if test -n "$RANLIB"; then
10740 archive_cmds="$archive_cmds~\$RANLIB \$lib"
10741 postinstall_cmds='$RANLIB $lib'
10742 fi
10743 ;;
10744
10745 aix[4-9]*)
10746 if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
10747 test "$enable_shared" = yes && enable_static=no
10748 fi
10749 ;;
10750 esac
10751 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
10752 $as_echo "$enable_shared" >&6; }
10753
10754 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
10755 $as_echo_n "checking whether to build static libraries... " >&6; }
10756 # Make sure either enable_shared or enable_static is yes.
10757 test "$enable_shared" = yes || enable_static=yes
10758 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
10759 $as_echo "$enable_static" >&6; }
10760
10761
10762
10763
10764 fi
10765 ac_ext=c
10766 ac_cpp='$CPP $CPPFLAGS'
10767 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10768 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10769 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10770
10771 CC="$lt_save_CC"
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785 ac_config_commands="$ac_config_commands libtool"
10786
10787
10788
10789
10790 # Only expand once:
10791
1079212689
1079312690
1079412691 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
1159213489 ;;
1159313490 esac
1159413491
13492 { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Wjump-misses-init" >&5
13493 $as_echo_n "checking CFLAGS for gcc -Wjump-misses-init... " >&6; }
13494 if test "${ax_cv_cflags_gcc_option__Wjump_misses_init+set}" = set; then :
13495 $as_echo_n "(cached) " >&6
13496 else
13497 ax_cv_cflags_gcc_option__Wjump_misses_init="no, unknown"
13498
13499 ac_ext=c
13500 ac_cpp='$CPP $CPPFLAGS'
13501 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13502 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13503 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13504
13505 ac_save_CFLAGS="$CFLAGS"
13506 for ac_arg in "-pedantic -Werror % -Wjump-misses-init" "-pedantic % -Wjump-misses-init %% no, obsolete" #
13507 do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
13508 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13509 /* end confdefs.h. */
13510
13511 int
13512 main ()
13513 {
13514 return 0;
13515 ;
13516 return 0;
13517 }
13518 _ACEOF
13519 if ac_fn_c_try_compile "$LINENO"; then :
13520 ax_cv_cflags_gcc_option__Wjump_misses_init=`echo $ac_arg | sed -e 's,.*% *,,'`; break
13521 fi
13522 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13523 done
13524 CFLAGS="$ac_save_CFLAGS"
13525 ac_ext=c
13526 ac_cpp='$CPP $CPPFLAGS'
13527 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13528 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13529 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13530
13531
13532 fi
13533 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cflags_gcc_option__Wjump_misses_init" >&5
13534 $as_echo "$ax_cv_cflags_gcc_option__Wjump_misses_init" >&6; }
13535 var=$ax_cv_cflags_gcc_option__Wjump_misses_init
13536 case ".$var" in
13537 .ok|.ok,*) ;;
13538 .|.no|.no,*) ;;
13539 *)
13540 if echo " $CFLAGS " | grep " $var " 2>&1 >/dev/null
13541 then { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS does contain \$var"; } >&5
13542 (: CFLAGS does contain $var) 2>&5
13543 ac_status=$?
13544 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13545 test $ac_status = 0; }
13546 else { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$var\""; } >&5
13547 (: CFLAGS="$CFLAGS $var") 2>&5
13548 ac_status=$?
13549 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13550 test $ac_status = 0; }
13551 CFLAGS="$CFLAGS $var"
13552 fi
13553 ;;
13554 esac
13555
1159513556 { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Winit-self" >&5
1159613557 $as_echo_n "checking CFLAGS for gcc -Winit-self... " >&6; }
1159713558 if test "${ax_cv_cflags_gcc_option__Winit_self+set}" = set; then :
1172013681 ;;
1172113682 esac
1172213683
13684 { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Wlogical-op" >&5
13685 $as_echo_n "checking CFLAGS for gcc -Wlogical-op... " >&6; }
13686 if test "${ax_cv_cflags_gcc_option__Wlogical_op+set}" = set; then :
13687 $as_echo_n "(cached) " >&6
13688 else
13689 ax_cv_cflags_gcc_option__Wlogical_op="no, unknown"
13690
13691 ac_ext=c
13692 ac_cpp='$CPP $CPPFLAGS'
13693 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13694 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13695 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13696
13697 ac_save_CFLAGS="$CFLAGS"
13698 for ac_arg in "-pedantic -Werror % -Wlogical-op" "-pedantic % -Wlogical-op %% no, obsolete" #
13699 do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
13700 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13701 /* end confdefs.h. */
13702
13703 int
13704 main ()
13705 {
13706 return 0;
13707 ;
13708 return 0;
13709 }
13710 _ACEOF
13711 if ac_fn_c_try_compile "$LINENO"; then :
13712 ax_cv_cflags_gcc_option__Wlogical_op=`echo $ac_arg | sed -e 's,.*% *,,'`; break
13713 fi
13714 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13715 done
13716 CFLAGS="$ac_save_CFLAGS"
13717 ac_ext=c
13718 ac_cpp='$CPP $CPPFLAGS'
13719 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
13720 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
13721 ac_compiler_gnu=$ac_cv_c_compiler_gnu
13722
13723
13724 fi
13725 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cflags_gcc_option__Wlogical_op" >&5
13726 $as_echo "$ax_cv_cflags_gcc_option__Wlogical_op" >&6; }
13727 var=$ax_cv_cflags_gcc_option__Wlogical_op
13728 case ".$var" in
13729 .ok|.ok,*) ;;
13730 .|.no|.no,*) ;;
13731 *)
13732 if echo " $CFLAGS " | grep " $var " 2>&1 >/dev/null
13733 then { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS does contain \$var"; } >&5
13734 (: CFLAGS does contain $var) 2>&5
13735 ac_status=$?
13736 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13737 test $ac_status = 0; }
13738 else { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$var\""; } >&5
13739 (: CFLAGS="$CFLAGS $var") 2>&5
13740 ac_status=$?
13741 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
13742 test $ac_status = 0; }
13743 CFLAGS="$CFLAGS $var"
13744 fi
13745 ;;
13746 esac
13747
1172313748 { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Wmissing-declarations" >&5
1172413749 $as_echo_n "checking CFLAGS for gcc -Wmissing-declarations... " >&6; }
1172513750 if test "${ax_cv_cflags_gcc_option__Wmissing_declarations+set}" = set; then :
1204014065 ;;
1204114066 esac
1204214067
14068 { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Wold-style-definition" >&5
14069 $as_echo_n "checking CFLAGS for gcc -Wold-style-definition... " >&6; }
14070 if test "${ax_cv_cflags_gcc_option__Wold_style_definition+set}" = set; then :
14071 $as_echo_n "(cached) " >&6
14072 else
14073 ax_cv_cflags_gcc_option__Wold_style_definition="no, unknown"
14074
14075 ac_ext=c
14076 ac_cpp='$CPP $CPPFLAGS'
14077 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14078 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14079 ac_compiler_gnu=$ac_cv_c_compiler_gnu
14080
14081 ac_save_CFLAGS="$CFLAGS"
14082 for ac_arg in "-pedantic -Werror % -Wold-style-definition" "-pedantic % -Wold-style-definition %% no, obsolete" #
14083 do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
14084 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14085 /* end confdefs.h. */
14086
14087 int
14088 main ()
14089 {
14090 return 0;
14091 ;
14092 return 0;
14093 }
14094 _ACEOF
14095 if ac_fn_c_try_compile "$LINENO"; then :
14096 ax_cv_cflags_gcc_option__Wold_style_definition=`echo $ac_arg | sed -e 's,.*% *,,'`; break
14097 fi
14098 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14099 done
14100 CFLAGS="$ac_save_CFLAGS"
14101 ac_ext=c
14102 ac_cpp='$CPP $CPPFLAGS'
14103 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14104 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14105 ac_compiler_gnu=$ac_cv_c_compiler_gnu
14106
14107
14108 fi
14109 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cflags_gcc_option__Wold_style_definition" >&5
14110 $as_echo "$ax_cv_cflags_gcc_option__Wold_style_definition" >&6; }
14111 var=$ax_cv_cflags_gcc_option__Wold_style_definition
14112 case ".$var" in
14113 .ok|.ok,*) ;;
14114 .|.no|.no,*) ;;
14115 *)
14116 if echo " $CFLAGS " | grep " $var " 2>&1 >/dev/null
14117 then { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS does contain \$var"; } >&5
14118 (: CFLAGS does contain $var) 2>&5
14119 ac_status=$?
14120 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14121 test $ac_status = 0; }
14122 else { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$var\""; } >&5
14123 (: CFLAGS="$CFLAGS $var") 2>&5
14124 ac_status=$?
14125 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14126 test $ac_status = 0; }
14127 CFLAGS="$CFLAGS $var"
14128 fi
14129 ;;
14130 esac
14131
1204314132 { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Woverlength-strings" >&5
1204414133 $as_echo_n "checking CFLAGS for gcc -Woverlength-strings... " >&6; }
1204514134 if test "${ax_cv_cflags_gcc_option__Woverlength_strings+set}" = set; then :
1223214321 ;;
1223314322 esac
1223414323
14324 { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Wrwrite-strings" >&5
14325 $as_echo_n "checking CFLAGS for gcc -Wrwrite-strings... " >&6; }
14326 if test "${ax_cv_cflags_gcc_option__Wrwrite_strings+set}" = set; then :
14327 $as_echo_n "(cached) " >&6
14328 else
14329 ax_cv_cflags_gcc_option__Wrwrite_strings="no, unknown"
14330
14331 ac_ext=c
14332 ac_cpp='$CPP $CPPFLAGS'
14333 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14334 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14335 ac_compiler_gnu=$ac_cv_c_compiler_gnu
14336
14337 ac_save_CFLAGS="$CFLAGS"
14338 for ac_arg in "-pedantic -Werror % -Wrwrite-strings" "-pedantic % -Wrwrite-strings %% no, obsolete" #
14339 do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
14340 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14341 /* end confdefs.h. */
14342
14343 int
14344 main ()
14345 {
14346 return 0;
14347 ;
14348 return 0;
14349 }
14350 _ACEOF
14351 if ac_fn_c_try_compile "$LINENO"; then :
14352 ax_cv_cflags_gcc_option__Wrwrite_strings=`echo $ac_arg | sed -e 's,.*% *,,'`; break
14353 fi
14354 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14355 done
14356 CFLAGS="$ac_save_CFLAGS"
14357 ac_ext=c
14358 ac_cpp='$CPP $CPPFLAGS'
14359 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14360 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14361 ac_compiler_gnu=$ac_cv_c_compiler_gnu
14362
14363
14364 fi
14365 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cflags_gcc_option__Wrwrite_strings" >&5
14366 $as_echo "$ax_cv_cflags_gcc_option__Wrwrite_strings" >&6; }
14367 var=$ax_cv_cflags_gcc_option__Wrwrite_strings
14368 case ".$var" in
14369 .ok|.ok,*) ;;
14370 .|.no|.no,*) ;;
14371 *)
14372 if echo " $CFLAGS " | grep " $var " 2>&1 >/dev/null
14373 then { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS does contain \$var"; } >&5
14374 (: CFLAGS does contain $var) 2>&5
14375 ac_status=$?
14376 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14377 test $ac_status = 0; }
14378 else { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$var\""; } >&5
14379 (: CFLAGS="$CFLAGS $var") 2>&5
14380 ac_status=$?
14381 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14382 test $ac_status = 0; }
14383 CFLAGS="$CFLAGS $var"
14384 fi
14385 ;;
14386 esac
14387
1223514388 { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Wshadow" >&5
1223614389 $as_echo_n "checking CFLAGS for gcc -Wshadow... " >&6; }
1223714390 if test "${ax_cv_cflags_gcc_option__Wshadow+set}" = set; then :
1255214705 ;;
1255314706 esac
1255414707
14708 { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Wuninitialized" >&5
14709 $as_echo_n "checking CFLAGS for gcc -Wuninitialized... " >&6; }
14710 if test "${ax_cv_cflags_gcc_option__Wuninitialized+set}" = set; then :
14711 $as_echo_n "(cached) " >&6
14712 else
14713 ax_cv_cflags_gcc_option__Wuninitialized="no, unknown"
14714
14715 ac_ext=c
14716 ac_cpp='$CPP $CPPFLAGS'
14717 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14718 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14719 ac_compiler_gnu=$ac_cv_c_compiler_gnu
14720
14721 ac_save_CFLAGS="$CFLAGS"
14722 for ac_arg in "-pedantic -Werror % -Wuninitialized" "-pedantic % -Wuninitialized %% no, obsolete" #
14723 do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
14724 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14725 /* end confdefs.h. */
14726
14727 int
14728 main ()
14729 {
14730 return 0;
14731 ;
14732 return 0;
14733 }
14734 _ACEOF
14735 if ac_fn_c_try_compile "$LINENO"; then :
14736 ax_cv_cflags_gcc_option__Wuninitialized=`echo $ac_arg | sed -e 's,.*% *,,'`; break
14737 fi
14738 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14739 done
14740 CFLAGS="$ac_save_CFLAGS"
14741 ac_ext=c
14742 ac_cpp='$CPP $CPPFLAGS'
14743 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14744 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14745 ac_compiler_gnu=$ac_cv_c_compiler_gnu
14746
14747
14748 fi
14749 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cflags_gcc_option__Wuninitialized" >&5
14750 $as_echo "$ax_cv_cflags_gcc_option__Wuninitialized" >&6; }
14751 var=$ax_cv_cflags_gcc_option__Wuninitialized
14752 case ".$var" in
14753 .ok|.ok,*) ;;
14754 .|.no|.no,*) ;;
14755 *)
14756 if echo " $CFLAGS " | grep " $var " 2>&1 >/dev/null
14757 then { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS does contain \$var"; } >&5
14758 (: CFLAGS does contain $var) 2>&5
14759 ac_status=$?
14760 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14761 test $ac_status = 0; }
14762 else { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$var\""; } >&5
14763 (: CFLAGS="$CFLAGS $var") 2>&5
14764 ac_status=$?
14765 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14766 test $ac_status = 0; }
14767 CFLAGS="$CFLAGS $var"
14768 fi
14769 ;;
14770 esac
14771
1255514772 { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Wunused" >&5
1255614773 $as_echo_n "checking CFLAGS for gcc -Wunused... " >&6; }
1255714774 if test "${ax_cv_cflags_gcc_option__Wunused+set}" = set; then :
1259614813 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cflags_gcc_option__Wunused" >&5
1259714814 $as_echo "$ax_cv_cflags_gcc_option__Wunused" >&6; }
1259814815 var=$ax_cv_cflags_gcc_option__Wunused
14816 case ".$var" in
14817 .ok|.ok,*) ;;
14818 .|.no|.no,*) ;;
14819 *)
14820 if echo " $CFLAGS " | grep " $var " 2>&1 >/dev/null
14821 then { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS does contain \$var"; } >&5
14822 (: CFLAGS does contain $var) 2>&5
14823 ac_status=$?
14824 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14825 test $ac_status = 0; }
14826 else { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$var\""; } >&5
14827 (: CFLAGS="$CFLAGS $var") 2>&5
14828 ac_status=$?
14829 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
14830 test $ac_status = 0; }
14831 CFLAGS="$CFLAGS $var"
14832 fi
14833 ;;
14834 esac
14835
14836 { $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGS for gcc -Wvla" >&5
14837 $as_echo_n "checking CFLAGS for gcc -Wvla... " >&6; }
14838 if test "${ax_cv_cflags_gcc_option__Wvla+set}" = set; then :
14839 $as_echo_n "(cached) " >&6
14840 else
14841 ax_cv_cflags_gcc_option__Wvla="no, unknown"
14842
14843 ac_ext=c
14844 ac_cpp='$CPP $CPPFLAGS'
14845 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14846 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14847 ac_compiler_gnu=$ac_cv_c_compiler_gnu
14848
14849 ac_save_CFLAGS="$CFLAGS"
14850 for ac_arg in "-pedantic -Werror % -Wvla" "-pedantic % -Wvla %% no, obsolete" #
14851 do CFLAGS="$ac_save_CFLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'`
14852 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14853 /* end confdefs.h. */
14854
14855 int
14856 main ()
14857 {
14858 return 0;
14859 ;
14860 return 0;
14861 }
14862 _ACEOF
14863 if ac_fn_c_try_compile "$LINENO"; then :
14864 ax_cv_cflags_gcc_option__Wvla=`echo $ac_arg | sed -e 's,.*% *,,'`; break
14865 fi
14866 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14867 done
14868 CFLAGS="$ac_save_CFLAGS"
14869 ac_ext=c
14870 ac_cpp='$CPP $CPPFLAGS'
14871 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
14872 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
14873 ac_compiler_gnu=$ac_cv_c_compiler_gnu
14874
14875
14876 fi
14877 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cflags_gcc_option__Wvla" >&5
14878 $as_echo "$ax_cv_cflags_gcc_option__Wvla" >&6; }
14879 var=$ax_cv_cflags_gcc_option__Wvla
1259914880 case ".$var" in
1260014881 .ok|.ok,*) ;;
1260114882 .|.no|.no,*) ;;
1278915070 am__EXEEXT_FALSE=
1279015071 fi
1279115072
15073 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
15074 as_fn_error "conditional \"AMDEP\" was never defined.
15075 Usually this means the macro was only invoked conditionally." "$LINENO" 5
15076 fi
15077 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
15078 as_fn_error "conditional \"am__fastdepCC\" was never defined.
15079 Usually this means the macro was only invoked conditionally." "$LINENO" 5
15080 fi
15081 if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then
15082 as_fn_error "conditional \"INSTALL_LTDL\" was never defined.
15083 Usually this means the macro was only invoked conditionally." "$LINENO" 5
15084 fi
15085 if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then
15086 as_fn_error "conditional \"CONVENIENCE_LTDL\" was never defined.
15087 Usually this means the macro was only invoked conditionally." "$LINENO" 5
15088 fi
15089 LT_CONFIG_H=config.h
15090
15091 _ltdl_libobjs=
15092 _ltdl_ltlibobjs=
15093 if test -n "$_LT_LIBOBJS"; then
15094 # Remove the extension.
15095 _lt_sed_drop_objext='s/\.o$//;s/\.obj$//'
15096 for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do
15097 _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext"
15098 _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo"
15099 done
15100 fi
15101 ltdl_LIBOBJS=$_ltdl_libobjs
15102
15103 ltdl_LTLIBOBJS=$_ltdl_ltlibobjs
15104
15105
1279215106 if test -z "${WITH_KMOD_TRUE}" && test -z "${WITH_KMOD_FALSE}"; then
1279315107 as_fn_error "conditional \"WITH_KMOD\" was never defined.
1279415108 Usually this means the macro was only invoked conditionally." "$LINENO" 5
1280915123 as_fn_error "conditional \"ENABLE_DEBUG\" was never defined.
1281015124 Usually this means the macro was only invoked conditionally." "$LINENO" 5
1281115125 fi
12812 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
12813 as_fn_error "conditional \"AMDEP\" was never defined.
15126 if test -z "${ENABLE_SETTYPE_MODULES_TRUE}" && test -z "${ENABLE_SETTYPE_MODULES_FALSE}"; then
15127 as_fn_error "conditional \"ENABLE_SETTYPE_MODULES\" was never defined.
15128 Usually this means the macro was only invoked conditionally." "$LINENO" 5
15129 fi
15130 if test -z "${ENABLE_STATIC_TRUE}" && test -z "${ENABLE_STATIC_FALSE}"; then
15131 as_fn_error "conditional \"ENABLE_STATIC\" was never defined.
15132 Usually this means the macro was only invoked conditionally." "$LINENO" 5
15133 fi
15134 if test -z "${ENABLE_SHARED_TRUE}" && test -z "${ENABLE_SHARED_FALSE}"; then
15135 as_fn_error "conditional \"ENABLE_SHARED\" was never defined.
1281415136 Usually this means the macro was only invoked conditionally." "$LINENO" 5
1281515137 fi
1281615138 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
1322515547 # report actual input values of CONFIG_FILES etc. instead of their
1322615548 # values after options handling.
1322715549 ac_log="
13228 This file was extended by ipset $as_me 6.11, which was
15550 This file was extended by ipset $as_me 6.12, which was
1322915551 generated by GNU Autoconf 2.65. Invocation command line was
1323015552
1323115553 CONFIG_FILES = $CONFIG_FILES
1329115613 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1329215614 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1329315615 ac_cs_version="\\
13294 ipset config.status 6.11
15616 ipset config.status 6.12
1329515617 configured by $0, generated by GNU Autoconf 2.65,
1329615618 with options \\"\$ac_cs_config\\"
1329715619
1341415736 sed_quote_subst='$sed_quote_subst'
1341515737 double_quote_subst='$double_quote_subst'
1341615738 delay_variable_subst='$delay_variable_subst'
15739 enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
1341715740 macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
1341815741 macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
1341915742 enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
13420 enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
1342115743 pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
1342215744 enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
1342315745 host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
1440916731
1441016732 # ### BEGIN LIBTOOL CONFIG
1441116733
16734 # Whether or not to build static libraries.
16735 build_old_libs=$enable_static
16736
1441216737 # Which release of libtool.m4 was used?
1441316738 macro_version=$macro_version
1441416739 macro_revision=$macro_revision
1441516740
1441616741 # Whether or not to build shared libraries.
1441716742 build_libtool_libs=$enable_shared
14418
14419 # Whether or not to build static libraries.
14420 build_old_libs=$enable_static
1442116743
1442216744 # What type of objects to build.
1442316745 pic_mode=$pic_mode
1502917351 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
1503017352 fi
1503117353
17354
17355 { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
17356 $as_echo "" >&6; }
17357 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PACKAGE userspace tool configuration:" >&5
17358 $as_echo "$PACKAGE userspace tool configuration:" >&6; }
17359 if test "x$enable_settype_modules" != "xyes"; then
17360 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Dynamic module loading: disabled" >&5
17361 $as_echo " Dynamic module loading: disabled" >&6; }
17362 else
17363 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Dynamic module loading: enabled" >&5
17364 $as_echo " Dynamic module loading: enabled" >&6; }
17365 fi
17366 IPSET_ALL_MODULES="`ls lib/ipset_*.c|sed -e 's/lib\///' -e 's/\.c$//'`"
17367 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Static modules:" >&5
17368 $as_echo " Static modules:" >&6; }
17369 if test "x$SETTYPE_MODLIST" = "x"; then
17370 for mod in $IPSET_ALL_MODULES; do
17371 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${mod}" >&5
17372 $as_echo " ${mod}" >&6; }
17373 done
17374 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Dynamic modules:" >&5
17375 $as_echo " Dynamic modules:" >&6; }
17376 elif echo $SETTYPE_MODLIST | grep "all" >/dev/null; then
17377 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Dynamic modules:" >&5
17378 $as_echo " Dynamic modules:" >&6; }
17379 for mod in $IPSET_ALL_MODULES; do
17380 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${mod}" >&5
17381 $as_echo " ${mod}" >&6; }
17382 done
17383 else
17384 for mod in $IPSET_ALL_MODULES; do
17385 if echo $SETTYPE_MODLIST | grep $mod >/dev/null; then
17386 :
17387 else
17388 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${mod}" >&5
17389 $as_echo " ${mod}" >&6; }
17390 fi
17391 done
17392 { $as_echo "$as_me:${as_lineno-$LINENO}: result: Dynamic modules:" >&5
17393 $as_echo " Dynamic modules:" >&6; }
17394 for mod in $IPSET_ALL_MODULES; do
17395 if echo $SETTYPE_MODLIST | grep $mod >/dev/null; then
17396 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${mod}" >&5
17397 $as_echo " ${mod}" >&6; }
17398 fi
17399 done
17400 fi
00 dnl Boilerplate
1 AC_INIT([ipset], [6.11], [kadlec@blackhole.kfki.hu])
1 AC_INIT([ipset], [6.12], [kadlec@blackhole.kfki.hu])
22 AC_CONFIG_AUX_DIR([build-aux])
33 AC_CANONICAL_HOST
44 AC_CONFIG_MACRO_DIR([m4])
55 AC_CONFIG_HEADER([config.h])
66 AM_INIT_AUTOMAKE([foreign subdir-objects tar-pax])
7
8 AC_ENABLE_STATIC
9 LT_INIT([dlopen])
10 LT_CONFIG_LTDL_DIR([libltdl])
11 LTDL_INIT([nonrecursive])
712
813 dnl Shortcut: Linux supported alone
914 case "$host" in
99104
100105 AM_CONDITIONAL([ENABLE_DEBUG], [test "x$enable_debug" = xyes])
101106
107 dnl Enable type modules
108 AC_ARG_ENABLE([settype_modules],
109 AS_HELP_STRING([--enable-settype-modules],
110 [Enable set type modules support]),
111 [enable_settype_modules="$enableval"],
112 [enable_settype_modules="no"])
113
114 AC_ARG_WITH([settype_modules_list],
115 AS_HELP_STRING([--with-settype-modules-list="mod1 mod2 ..."],
116 [List of dynamic loading modules, ignored if settype-modules is disabled. It could be "all" to build all available settypes as modules]),
117 [SETTYPE_MODLIST_RAW="$withval";])
118
119 SETTYPE_MODLIST=
120 if test "x$enable_settype_modules" = "xyes"; then
121 for mod in $SETTYPE_MODLIST_RAW; do
122 if echo $mod | grep "all"; then
123 m="${mod}"
124 else
125 if echo $mod | grep "ipset_"; then
126 m="${mod}.c"
127 else
128 m="ipset_${mod}.c"
129 fi
130 fi
131
132 SETTYPE_MODLIST="${SETTYPE_MODLIST} $m"
133 done
134
135 AC_MSG_RESULT([checking for configuration with dynamic loading modules... $SETTYPE_MODLIST_RAW])
136 fi
137 AC_SUBST(SETTYPE_MODLIST)
138
139 AM_CONDITIONAL([ENABLE_SETTYPE_MODULES], [test "x$enable_settype_modules" = xyes])
140
141 AM_CONDITIONAL([ENABLE_STATIC], [test "x$enable_static" = xyes])
142 AM_CONDITIONAL([ENABLE_SHARED], [test "x$enable_shared" = xyes])
143
102144 dnl Checks for programs
103145 : ${CFLAGS=""}
104146
129171 dnl -Wconversion -> we need it
130172 dnl -Wunreachable-code -> fails with ntoh*
131173 dnl -Wpointer-arith -> limbnl uses it
174 dnl -Wsign-conversion -> libmnl
132175 if test "x$enable_debug" = "xyes"
133176 then
134177 AX_CFLAGS_GCC_OPTION(-Waggregate-return)
139182 AX_CFLAGS_GCC_OPTION(-Wextra)
140183 AX_CFLAGS_GCC_OPTION(-Wfloat-equal)
141184 AX_CFLAGS_GCC_OPTION(-Wformat=2)
185 AX_CFLAGS_GCC_OPTION(-Wjump-misses-init)
142186 AX_CFLAGS_GCC_OPTION(-Winit-self)
143187 AX_CFLAGS_GCC_OPTION(-Winline)
188 AX_CFLAGS_GCC_OPTION(-Wlogical-op)
144189 AX_CFLAGS_GCC_OPTION(-Wmissing-declarations)
145190 AX_CFLAGS_GCC_OPTION(-Wmissing-format-attribute)
146191 AX_CFLAGS_GCC_OPTION(-Wmissing-prototypes)
147192 AX_CFLAGS_GCC_OPTION(-Wnested-externs)
148193 AX_CFLAGS_GCC_OPTION(-Wno-missing-field-initializers)
194 AX_CFLAGS_GCC_OPTION(-Wold-style-definition)
149195 AX_CFLAGS_GCC_OPTION(-Woverlength-strings)
150196 AX_CFLAGS_GCC_OPTION(-Wpacked)
151197 AX_CFLAGS_GCC_OPTION(-Wredundant-decls)
198 AX_CFLAGS_GCC_OPTION(-Wrwrite-strings)
152199 AX_CFLAGS_GCC_OPTION(-Wshadow)
153200 AX_CFLAGS_GCC_OPTION(-Wsign-compare)
154201 AX_CFLAGS_GCC_OPTION(-Wstrict-prototypes)
155202 AX_CFLAGS_GCC_OPTION(-Wswitch-default)
156203 AX_CFLAGS_GCC_OPTION(-Wundef)
204 AX_CFLAGS_GCC_OPTION(-Wuninitialized)
157205 AX_CFLAGS_GCC_OPTION(-Wunused)
206 AX_CFLAGS_GCC_OPTION(-Wvla)
158207 AX_CFLAGS_GCC_OPTION(-Wwrite-strings)
159208 fi
160209 dnl Checks for library functions.
163212 AC_CONFIG_FILES([Makefile include/libipset/Makefile
164213 lib/Makefile lib/libipset.pc src/Makefile])
165214 AC_OUTPUT
215
216 dnl Summary
217 AC_MSG_RESULT([])
218 AC_MSG_RESULT([$PACKAGE userspace tool configuration:])
219 if test "x$enable_settype_modules" != "xyes"; then
220 AC_MSG_RESULT([ Dynamic module loading: disabled])
221 else
222 AC_MSG_RESULT([ Dynamic module loading: enabled])
223 fi
224 IPSET_ALL_MODULES="`ls lib/ipset_*.c|sed -e 's/lib\///' -e 's/\.c$//'`"
225 AC_MSG_RESULT([ Static modules:])
226 if test "x$SETTYPE_MODLIST" = "x"; then
227 for mod in $IPSET_ALL_MODULES; do
228 AC_MSG_RESULT([ ${mod}])
229 done
230 AC_MSG_RESULT([ Dynamic modules:])
231 elif echo $SETTYPE_MODLIST | grep "all" >/dev/null; then
232 AC_MSG_RESULT([ Dynamic modules:])
233 for mod in $IPSET_ALL_MODULES; do
234 AC_MSG_RESULT([ ${mod}])
235 done
236 else
237 for mod in $IPSET_ALL_MODULES; do
238 if echo $SETTYPE_MODLIST | grep $mod >/dev/null; then
239 :
240 else
241 AC_MSG_RESULT([ ${mod}])
242 fi
243 done
244 AC_MSG_RESULT([ Dynamic modules:])
245 for mod in $IPSET_ALL_MODULES; do
246 if echo $SETTYPE_MODLIST | grep $mod >/dev/null; then
247 AC_MSG_RESULT([ ${mod}])
248 fi
249 done
250 fi
3636 DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
3737 $(srcdir)/Makefile.in
3838 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \
40 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
41 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
42 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
39 am__aclocal_m4_deps = $(top_srcdir)/m4/argz.m4 \
40 $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \
41 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltdl.m4 \
42 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
43 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
44 $(top_srcdir)/configure.ac
4345 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
4446 $(ACLOCAL_M4)
4547 mkinstalldirs = $(install_sh) -d
7880 ACLOCAL = @ACLOCAL@
7981 AMTAR = @AMTAR@
8082 AR = @AR@
83 ARGZ_H = @ARGZ_H@
8184 AUTOCONF = @AUTOCONF@
8285 AUTOHEADER = @AUTOHEADER@
8386 AUTOMAKE = @AUTOMAKE@
99102 EXEEXT = @EXEEXT@
100103 FGREP = @FGREP@
101104 GREP = @GREP@
105 INCLTDL = @INCLTDL@
102106 INSTALL = @INSTALL@
103107 INSTALL_DATA = @INSTALL_DATA@
104108 INSTALL_PROGRAM = @INSTALL_PROGRAM@
107111 KBUILDDIR = @KBUILDDIR@
108112 LD = @LD@
109113 LDFLAGS = @LDFLAGS@
114 LIBADD_DL = @LIBADD_DL@
115 LIBADD_DLD_LINK = @LIBADD_DLD_LINK@
116 LIBADD_DLOPEN = @LIBADD_DLOPEN@
117 LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@
118 LIBLTDL = @LIBLTDL@
110119 LIBOBJS = @LIBOBJS@
111120 LIBS = @LIBS@
112121 LIBTOOL = @LIBTOOL@
113122 LIPO = @LIPO@
114123 LN_S = @LN_S@
124 LTDLDEPS = @LTDLDEPS@
125 LTDLINCL = @LTDLINCL@
126 LTDLOPEN = @LTDLOPEN@
115127 LTLIBOBJS = @LTLIBOBJS@
128 LT_CONFIG_H = @LT_CONFIG_H@
129 LT_DLLOADERS = @LT_DLLOADERS@
130 LT_DLPREOPEN = @LT_DLPREOPEN@
116131 MAKEINFO = @MAKEINFO@
117132 MAXSETS = @MAXSETS@
118133 MKDIR_P = @MKDIR_P@
133148 PKG_CONFIG = @PKG_CONFIG@
134149 RANLIB = @RANLIB@
135150 SED = @SED@
151 SETTYPE_MODLIST = @SETTYPE_MODLIST@
136152 SET_MAKE = @SET_MAKE@
137153 SHELL = @SHELL@
138154 STRIP = @STRIP@
176192 localedir = @localedir@
177193 localstatedir = @localstatedir@
178194 lt_ECHO = @lt_ECHO@
195 ltdl_LIBOBJS = @ltdl_LIBOBJS@
196 ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@
179197 mandir = @mandir@
180198 mkdir_p = @mkdir_p@
181199 oldincludedir = @oldincludedir@
186204 sbindir = @sbindir@
187205 sharedstatedir = @sharedstatedir@
188206 srcdir = @srcdir@
207 sys_symbol_underscore = @sys_symbol_underscore@
189208 sysconfdir = @sysconfdir@
190209 target_alias = @target_alias@
191210 top_build_prefix = @top_build_prefix@
6464 IPSET_OPT_MAX,
6565 };
6666
67 #define IPSET_FLAG(opt) (1LL << (opt))
68 #define IPSET_FLAGS_ALL (~0LL)
67 #define IPSET_FLAG(opt) (1ULL << (opt))
68 #define IPSET_FLAGS_ALL (~0ULL)
6969
7070 #define IPSET_CREATE_FLAGS \
7171 (IPSET_FLAG(IPSET_OPT_FAMILY) \
112112 extern void ipset_data_flags_set(struct ipset_data *data, uint64_t flags);
113113 extern void ipset_data_flags_unset(struct ipset_data *data, uint64_t flags);
114114 extern bool ipset_data_ignored(struct ipset_data *data, enum ipset_opt opt);
115 extern bool ipset_data_test_ignored(struct ipset_data *data, enum ipset_opt opt);
115116
116117 extern int ipset_data_set(struct ipset_data *data, enum ipset_opt opt,
117118 const void *value);
7171 enum ipset_opt opt, const char *str);
7272 extern int ipset_parse_setname(struct ipset_session *session,
7373 enum ipset_opt opt, const char *str);
74 extern int ipset_parse_timeout(struct ipset_session *session,
75 enum ipset_opt opt, const char *str);
7476 extern int ipset_parse_uint32(struct ipset_session *session,
7577 enum ipset_opt opt, const char *str);
7678 extern int ipset_parse_uint8(struct ipset_session *session,
106106 const struct ipset_type *t);
107107 extern void ipset_load_types(void);
108108
109 extern void ipset_types_init(void);
110
111 #ifdef TYPE_INCLUSIVE
112 # ifdef _INIT
113 # undef _init
114 # define _init _INIT
115 # endif
116 #else
117 # undef _init
118 # define _init __attribute__((constructor)) _INIT
119 #endif
120
109121 #endif /* LIBIPSET_TYPES_H */
66 #ifndef LIBIPSET_UI_H
77 #define LIBIPSET_UI_H
88
9 #include <stdbool.h> /* bool */
910 #include <libipset/linux_ip_set.h> /* enum ipset_cmd */
1011
1112 /* Commands in userspace */
0 6.12
1 - Backport nla_put_net* functions as NLA_PUT* were removed
2 - netlink: add netlink_dump_control structure for netlink_dump_start()
3 - ipset: Stop using NLA_PUT*().
4 - Fix hash size checking in kernel (bug reported by Seblu)
5 - Correct README file about minimal required iptables version
6 (Oskar Berggren)
7 - Sparse warnings "incorrect type in assignment" fixed
8 - Fix timeout value overflow bug at large timeout parameters
9 (bug reported by Andreas Herz)
10 - ipv6: Add fragment reporting to ipv6_skip_exthdr().
11 - net: remove ipv6_addr_copy()
12 - Fix the inclusion of linux/export.h (Henry Culver)
13
014 6.11
115 - hash:net,iface timeout bug fixed
216 - Exceptions support added to hash:*net* types
410410 #define ipset_nest_start(skb, attr) nla_nest_start(skb, attr | NLA_F_NESTED)
411411 #define ipset_nest_end(skb, start) nla_nest_end(skb, start)
412412
413 #define NLA_PUT_IPADDR4(skb, type, ipaddr) \
414 do { \
415 struct nlattr *__nested = ipset_nest_start(skb, type); \
416 \
417 if (!__nested) \
418 goto nla_put_failure; \
419 NLA_PUT_NET32(skb, IPSET_ATTR_IPADDR_IPV4, ipaddr); \
420 ipset_nest_end(skb, __nested); \
421 } while (0)
422
423 #define NLA_PUT_IPADDR6(skb, type, ipaddrptr) \
424 do { \
425 struct nlattr *__nested = ipset_nest_start(skb, type); \
426 \
427 if (!__nested) \
428 goto nla_put_failure; \
429 NLA_PUT(skb, IPSET_ATTR_IPADDR_IPV6, \
430 sizeof(struct in6_addr), ipaddrptr); \
431 ipset_nest_end(skb, __nested); \
432 } while (0)
413 #ifdef NLA_PUT_NET16
414 static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
415 {
416 return nla_put(skb, attrtype, sizeof(__be16), &value);
417 }
418
419 static inline int nla_put_net16(struct sk_buff *skb, int attrtype, __be16 value)
420 {
421 return nla_put_be16(skb, attrtype | NLA_F_NET_BYTEORDER, value);
422 }
423
424 static inline int nla_put_be32(struct sk_buff *skb, int attrtype, __be32 value)
425 {
426 return nla_put(skb, attrtype, sizeof(__be32), &value);
427 }
428
429 static inline int nla_put_net32(struct sk_buff *skb, int attrtype, __be32 value)
430 {
431 return nla_put_be32(skb, attrtype | NLA_F_NET_BYTEORDER, value);
432 }
433 #endif
434
435 static inline int nla_put_ipaddr4(struct sk_buff *skb, int type, __be32 ipaddr)
436 {
437 struct nlattr *__nested = ipset_nest_start(skb, type);
438 int ret;
439
440 if (!__nested)
441 return -EMSGSIZE;
442 ret = nla_put_net32(skb, IPSET_ATTR_IPADDR_IPV4, ipaddr);
443 if (!ret)
444 ipset_nest_end(skb, __nested);
445 return ret;
446 }
447
448 static inline int nla_put_ipaddr6(struct sk_buff *skb, int type, const struct in6_addr *ipaddrptr)
449 {
450 struct nlattr *__nested = ipset_nest_start(skb, type);
451 int ret;
452
453 if (!__nested)
454 return -EMSGSIZE;
455 ret = nla_put(skb, IPSET_ATTR_IPADDR_IPV6,
456 sizeof(struct in6_addr), ipaddrptr);
457 if (!ret)
458 ipset_nest_end(skb, __nested);
459 return ret;
460 }
433461
434462 /* Get address from skbuff */
435463 static inline __be32
9898 #endif
9999 };
100100
101 static size_t
102 htable_size(u8 hbits)
103 {
104 size_t hsize;
105
106 /* We must fit both into u32 in jhash and size_t */
107 if (hbits > 31)
108 return 0;
109 hsize = jhash_size(hbits);
110 if ((((size_t)-1) - sizeof(struct htable))/sizeof(struct hbucket)
111 < hsize)
112 return 0;
113
114 return hsize * sizeof(struct hbucket) + sizeof(struct htable);
115 }
116
101117 /* Compute htable_bits from the user input parameter hashsize */
102118 static u8
103119 htable_bits(u32 hashsize)
593609 nested = ipset_nest_start(skb, IPSET_ATTR_DATA);
594610 if (!nested)
595611 goto nla_put_failure;
596 NLA_PUT_NET32(skb, IPSET_ATTR_HASHSIZE,
597 htonl(jhash_size(h->table->htable_bits)));
598 NLA_PUT_NET32(skb, IPSET_ATTR_MAXELEM, htonl(h->maxelem));
612 if (nla_put_net32(skb, IPSET_ATTR_HASHSIZE,
613 htonl(jhash_size(h->table->htable_bits))) ||
614 nla_put_net32(skb, IPSET_ATTR_MAXELEM, htonl(h->maxelem)))
615 goto nla_put_failure;
599616 #ifdef IP_SET_HASH_WITH_NETMASK
600 if (h->netmask != HOST_MASK)
601 NLA_PUT_U8(skb, IPSET_ATTR_NETMASK, h->netmask);
602 #endif
603 NLA_PUT_NET32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1));
604 NLA_PUT_NET32(skb, IPSET_ATTR_MEMSIZE, htonl(memsize));
605 if (with_timeout(h->timeout))
606 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT, htonl(h->timeout));
617 if (h->netmask != HOST_MASK &&
618 nla_put_u8(skb, IPSET_ATTR_NETMASK, h->netmask))
619 goto nla_put_failure;
620 #endif
621 if (nla_put_net32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1)) ||
622 nla_put_net32(skb, IPSET_ATTR_MEMSIZE, htonl(memsize)) ||
623 (with_timeout(h->timeout) &&
624 nla_put_net32(skb, IPSET_ATTR_TIMEOUT, htonl(h->timeout))))
625 goto nla_put_failure;
607626 ipset_nest_end(skb, nested);
608627
609628 return 0;
2828 ip_set_timeout_uget(struct nlattr *tb)
2929 {
3030 unsigned int timeout = ip_set_get_h32(tb);
31
32 /* Normalize to fit into jiffies */
33 if (timeout > UINT_MAX/1000)
34 timeout = UINT_MAX/1000;
3135
3236 /* Userspace supplied TIMEOUT parameter: adjust crazy size */
3337 return timeout == IPSET_NO_TIMEOUT ? IPSET_NO_TIMEOUT - 1 : timeout;
108108 } else
109109 goto nla_put_failure;
110110 }
111 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP,
112 htonl(map->first_ip + id * map->hosts));
111 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP,
112 htonl(map->first_ip + id * map->hosts)))
113 goto nla_put_failure;
113114 ipset_nest_end(skb, nested);
114115 }
115116 ipset_nest_end(skb, atd);
193194 } else
194195 goto nla_put_failure;
195196 }
196 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP,
197 htonl(map->first_ip + id * map->hosts));
198 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
199 htonl(ip_set_timeout_get(members[id])));
197 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP,
198 htonl(map->first_ip + id * map->hosts)) ||
199 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
200 htonl(ip_set_timeout_get(members[id]))))
201 goto nla_put_failure;
200202 ipset_nest_end(skb, nested);
201203 }
202204 ipset_nest_end(skb, adt);
333335 nested = ipset_nest_start(skb, IPSET_ATTR_DATA);
334336 if (!nested)
335337 goto nla_put_failure;
336 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, htonl(map->first_ip));
337 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP_TO, htonl(map->last_ip));
338 if (map->netmask != 32)
339 NLA_PUT_U8(skb, IPSET_ATTR_NETMASK, map->netmask);
340 NLA_PUT_NET32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1));
341 NLA_PUT_NET32(skb, IPSET_ATTR_MEMSIZE,
342 htonl(sizeof(*map) + map->memsize));
343 if (with_timeout(map->timeout))
344 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT, htonl(map->timeout));
338 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, htonl(map->first_ip)) ||
339 nla_put_ipaddr4(skb, IPSET_ATTR_IP_TO, htonl(map->last_ip)) ||
340 (map->netmask != 32 &&
341 nla_put_u8(skb, IPSET_ATTR_NETMASK, map->netmask)) ||
342 nla_put_net32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1)) ||
343 nla_put_net32(skb, IPSET_ATTR_MEMSIZE,
344 htonl(sizeof(*map) + map->memsize)) ||
345 (with_timeout(map->timeout) &&
346 nla_put_net32(skb, IPSET_ATTR_TIMEOUT, htonl(map->timeout))))
347 goto nla_put_failure;
345348 ipset_nest_end(skb, nested);
346349
347350 return 0;
185185 } else
186186 goto nla_put_failure;
187187 }
188 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP,
189 htonl(map->first_ip + id));
190 if (elem->match == MAC_FILLED)
191 NLA_PUT(skb, IPSET_ATTR_ETHER, ETH_ALEN,
192 elem->ether);
188 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP,
189 htonl(map->first_ip + id)) ||
190 (elem->match == MAC_FILLED &&
191 nla_put(skb, IPSET_ATTR_ETHER, ETH_ALEN,
192 elem->ether)))
193 goto nla_put_failure;
193194 ipset_nest_end(skb, nested);
194195 }
195196 ipset_nest_end(skb, atd);
313314 } else
314315 goto nla_put_failure;
315316 }
316 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP,
317 htonl(map->first_ip + id));
318 if (elem->match == MAC_FILLED)
319 NLA_PUT(skb, IPSET_ATTR_ETHER, ETH_ALEN,
320 elem->ether);
317 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP,
318 htonl(map->first_ip + id)) ||
319 (elem->match == MAC_FILLED &&
320 nla_put(skb, IPSET_ATTR_ETHER, ETH_ALEN,
321 elem->ether)))
322 goto nla_put_failure;
321323 timeout = elem->match == MAC_UNSET ? elem->timeout
322324 : ip_set_timeout_get(elem->timeout);
323 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT, htonl(timeout));
325 if (nla_put_net32(skb, IPSET_ATTR_TIMEOUT, htonl(timeout)))
326 goto nla_put_failure;
324327 ipset_nest_end(skb, nested);
325328 }
326329 ipset_nest_end(skb, atd);
437440 nested = ipset_nest_start(skb, IPSET_ATTR_DATA);
438441 if (!nested)
439442 goto nla_put_failure;
440 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, htonl(map->first_ip));
441 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP_TO, htonl(map->last_ip));
442 NLA_PUT_NET32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1));
443 NLA_PUT_NET32(skb, IPSET_ATTR_MEMSIZE,
444 htonl(sizeof(*map)
445 + (map->last_ip - map->first_ip + 1) * map->dsize));
446 if (with_timeout(map->timeout))
447 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT, htonl(map->timeout));
443 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, htonl(map->first_ip)) ||
444 nla_put_ipaddr4(skb, IPSET_ATTR_IP_TO, htonl(map->last_ip)) ||
445 nla_put_net32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1)) ||
446 nla_put_net32(skb, IPSET_ATTR_MEMSIZE,
447 htonl(sizeof(*map) +
448 ((map->last_ip - map->first_ip + 1) *
449 map->dsize))) ||
450 (with_timeout(map->timeout) &&
451 nla_put_net32(skb, IPSET_ATTR_TIMEOUT, htonl(map->timeout))))
452 goto nla_put_failure;
448453 ipset_nest_end(skb, nested);
449454
450455 return 0;
9595 } else
9696 goto nla_put_failure;
9797 }
98 NLA_PUT_NET16(skb, IPSET_ATTR_PORT,
99 htons(map->first_port + id));
98 if (nla_put_net16(skb, IPSET_ATTR_PORT,
99 htons(map->first_port + id)))
100 goto nla_put_failure;
100101 ipset_nest_end(skb, nested);
101102 }
102103 ipset_nest_end(skb, atd);
182183 } else
183184 goto nla_put_failure;
184185 }
185 NLA_PUT_NET16(skb, IPSET_ATTR_PORT,
186 htons(map->first_port + id));
187 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
188 htonl(ip_set_timeout_get(members[id])));
186 if (nla_put_net16(skb, IPSET_ATTR_PORT,
187 htons(map->first_port + id)) ||
188 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
189 htonl(ip_set_timeout_get(members[id]))))
190 goto nla_put_failure;
189191 ipset_nest_end(skb, nested);
190192 }
191193 ipset_nest_end(skb, adt);
319321 nested = ipset_nest_start(skb, IPSET_ATTR_DATA);
320322 if (!nested)
321323 goto nla_put_failure;
322 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, htons(map->first_port));
323 NLA_PUT_NET16(skb, IPSET_ATTR_PORT_TO, htons(map->last_port));
324 NLA_PUT_NET32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1));
325 NLA_PUT_NET32(skb, IPSET_ATTR_MEMSIZE,
326 htonl(sizeof(*map) + map->memsize));
327 if (with_timeout(map->timeout))
328 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT, htonl(map->timeout));
324 if (nla_put_net16(skb, IPSET_ATTR_PORT, htons(map->first_port)) ||
325 nla_put_net16(skb, IPSET_ATTR_PORT_TO, htons(map->last_port)) ||
326 nla_put_net32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1)) ||
327 nla_put_net32(skb, IPSET_ATTR_MEMSIZE,
328 htonl(sizeof(*map) + map->memsize)) ||
329 (with_timeout(map->timeout) &&
330 nla_put_net32(skb, IPSET_ATTR_TIMEOUT, htonl(map->timeout))))
331 goto nla_put_failure;
329332 ipset_nest_end(skb, nested);
330333
331334 return 0;
10991099 ret = -EMSGSIZE;
11001100 goto release_refcount;
11011101 }
1102 NLA_PUT_U8(skb, IPSET_ATTR_PROTOCOL, IPSET_PROTOCOL);
1103 NLA_PUT_STRING(skb, IPSET_ATTR_SETNAME, set->name);
1102 if (nla_put_u8(skb, IPSET_ATTR_PROTOCOL, IPSET_PROTOCOL) ||
1103 nla_put_string(skb, IPSET_ATTR_SETNAME, set->name))
1104 goto nla_put_failure;
11041105 if (dump_flags & IPSET_FLAG_LIST_SETNAME)
11051106 goto next_set;
11061107 switch (cb->args[2]) {
11071108 case 0:
11081109 /* Core header data */
1109 NLA_PUT_STRING(skb, IPSET_ATTR_TYPENAME,
1110 set->type->name);
1111 NLA_PUT_U8(skb, IPSET_ATTR_FAMILY,
1112 set->family);
1113 NLA_PUT_U8(skb, IPSET_ATTR_REVISION,
1114 set->revision);
1110 if (nla_put_string(skb, IPSET_ATTR_TYPENAME,
1111 set->type->name) ||
1112 nla_put_u8(skb, IPSET_ATTR_FAMILY,
1113 set->family) ||
1114 nla_put_u8(skb, IPSET_ATTR_REVISION,
1115 set->revision))
1116 goto nla_put_failure;
11151117 ret = set->variant->head(set, skb);
11161118 if (ret < 0)
11171119 goto release_refcount;
11691171 if (unlikely(protocol_failed(attr)))
11701172 return -IPSET_ERR_PROTOCOL;
11711173
1174 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)
11721175 return netlink_dump_start(ctnl, skb, nlh,
11731176 ip_set_dump_start,
1174 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)
11751177 ip_set_dump_done);
1178 #elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
1179 return netlink_dump_start(ctnl, skb, nlh,
1180 ip_set_dump_start,
1181 ip_set_dump_done, 0);
11761182 #else
1177 ip_set_dump_done, 0);
1183 {
1184 struct netlink_dump_control c = {
1185 .dump = ip_set_dump_start,
1186 .done = ip_set_dump_done,
1187 };
1188 return netlink_dump_start(ctnl, skb, nlh, &c);
1189 }
11781190 #endif
11791191 }
11801192
14171429 IPSET_CMD_HEADER);
14181430 if (!nlh2)
14191431 goto nlmsg_failure;
1420 NLA_PUT_U8(skb2, IPSET_ATTR_PROTOCOL, IPSET_PROTOCOL);
1421 NLA_PUT_STRING(skb2, IPSET_ATTR_SETNAME, set->name);
1422 NLA_PUT_STRING(skb2, IPSET_ATTR_TYPENAME, set->type->name);
1423 NLA_PUT_U8(skb2, IPSET_ATTR_FAMILY, set->family);
1424 NLA_PUT_U8(skb2, IPSET_ATTR_REVISION, set->revision);
1432 if (nla_put_u8(skb2, IPSET_ATTR_PROTOCOL, IPSET_PROTOCOL) ||
1433 nla_put_string(skb2, IPSET_ATTR_SETNAME, set->name) ||
1434 nla_put_string(skb2, IPSET_ATTR_TYPENAME, set->type->name) ||
1435 nla_put_u8(skb2, IPSET_ATTR_FAMILY, set->family) ||
1436 nla_put_u8(skb2, IPSET_ATTR_REVISION, set->revision))
1437 goto nla_put_failure;
14251438 nlmsg_end(skb2, nlh2);
14261439
14271440 ret = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT);
14761489 IPSET_CMD_TYPE);
14771490 if (!nlh2)
14781491 goto nlmsg_failure;
1479 NLA_PUT_U8(skb2, IPSET_ATTR_PROTOCOL, IPSET_PROTOCOL);
1480 NLA_PUT_STRING(skb2, IPSET_ATTR_TYPENAME, typename);
1481 NLA_PUT_U8(skb2, IPSET_ATTR_FAMILY, family);
1482 NLA_PUT_U8(skb2, IPSET_ATTR_REVISION, max);
1483 NLA_PUT_U8(skb2, IPSET_ATTR_REVISION_MIN, min);
1492 if (nla_put_u8(skb2, IPSET_ATTR_PROTOCOL, IPSET_PROTOCOL) ||
1493 nla_put_string(skb2, IPSET_ATTR_TYPENAME, typename) ||
1494 nla_put_u8(skb2, IPSET_ATTR_FAMILY, family) ||
1495 nla_put_u8(skb2, IPSET_ATTR_REVISION, max) ||
1496 nla_put_u8(skb2, IPSET_ATTR_REVISION_MIN, min))
1497 goto nla_put_failure;
14841498 nlmsg_end(skb2, nlh2);
14851499
14861500 pr_debug("Send TYPE, nlmsg_len: %u\n", nlh2->nlmsg_len);
15241538 IPSET_CMD_PROTOCOL);
15251539 if (!nlh2)
15261540 goto nlmsg_failure;
1527 NLA_PUT_U8(skb2, IPSET_ATTR_PROTOCOL, IPSET_PROTOCOL);
1541 if (nla_put_u8(skb2, IPSET_ATTR_PROTOCOL, IPSET_PROTOCOL))
1542 goto nla_put_failure;
15281543 nlmsg_end(skb2, nlh2);
15291544
15301545 ret = netlink_unicast(ctnl, skb2, NETLINK_CB(skb).pid, MSG_DONTWAIT);
77 /* Get Layer-4 data from the packets */
88
99 #include <linux/version.h>
10 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)
10 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
1111 #include <linux/export.h>
1212 #endif
1313 #include <linux/ip.h>
118118 {
119119 int protoff;
120120 u8 nexthdr;
121 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
122 __be16 frag_off;
123 #endif
121124
122125 nexthdr = ipv6_hdr(skb)->nexthdr;
126 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
127 protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr,
128 &frag_off);
129 #else
123130 protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr);
131 #endif
124132 if (protoff < 0)
125133 return false;
126134
8080 static inline bool
8181 hash_ip4_data_list(struct sk_buff *skb, const struct hash_ip4_elem *data)
8282 {
83 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, data->ip);
83 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip))
84 goto nla_put_failure;
8485 return 0;
8586
8687 nla_put_failure:
9394 const struct hash_ip4_telem *tdata =
9495 (const struct hash_ip4_telem *)data;
9596
96 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, tdata->ip);
97 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
98 htonl(ip_set_timeout_get(tdata->timeout)));
97 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, tdata->ip) ||
98 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
99 htonl(ip_set_timeout_get(tdata->timeout))))
100 goto nla_put_failure;
99101
100102 return 0;
101103
111113 static inline void
112114 hash_ip4_data_next(struct ip_set_hash *h, const struct hash_ip4_elem *d)
113115 {
114 h->next.ip = ntohl(d->ip);
116 h->next.ip = d->ip;
115117 }
116118
117119 static int
185187 hosts = h->netmask == 32 ? 1 : 2 << (32 - h->netmask - 1);
186188
187189 if (retried)
188 ip = h->next.ip;
190 ip = ntohl(h->next.ip);
189191 for (; !before(ip_to, ip); ip += hosts) {
190192 nip = htonl(ip);
191193 if (nip == 0)
240242 static inline void
241243 hash_ip6_data_copy(struct hash_ip6_elem *dst, const struct hash_ip6_elem *src)
242244 {
243 ipv6_addr_copy(&dst->ip.in6, &src->ip.in6);
245 dst->ip.in6 = src->ip.in6;
244246 }
245247
246248 static inline void
261263 static bool
262264 hash_ip6_data_list(struct sk_buff *skb, const struct hash_ip6_elem *data)
263265 {
264 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &data->ip);
266 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &data->ip.in6))
267 goto nla_put_failure;
265268 return 0;
266269
267270 nla_put_failure:
274277 const struct hash_ip6_telem *e =
275278 (const struct hash_ip6_telem *)data;
276279
277 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &e->ip);
278 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
279 htonl(ip_set_timeout_get(e->timeout)));
280 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &e->ip.in6) ||
281 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
282 htonl(ip_set_timeout_get(e->timeout))))
283 goto nla_put_failure;
280284 return 0;
281285
282286 nla_put_failure:
363367 {
364368 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
365369 u8 netmask, hbits;
370 size_t hsize;
366371 struct ip_set_hash *h;
367372
368373 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
404409 h->timeout = IPSET_NO_TIMEOUT;
405410
406411 hbits = htable_bits(hashsize);
407 h->table = ip_set_alloc(
408 sizeof(struct htable)
409 + jhash_size(hbits) * sizeof(struct hbucket));
412 hsize = htable_size(hbits);
413 if (hsize == 0) {
414 kfree(h);
415 return -ENOMEM;
416 }
417 h->table = ip_set_alloc(hsize);
410418 if (!h->table) {
411419 kfree(h);
412420 return -ENOMEM;
9292 hash_ipport4_data_list(struct sk_buff *skb,
9393 const struct hash_ipport4_elem *data)
9494 {
95 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, data->ip);
96 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, data->port);
97 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
95 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) ||
96 nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
97 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto))
98 goto nla_put_failure;
9899 return 0;
99100
100101 nla_put_failure:
108109 const struct hash_ipport4_telem *tdata =
109110 (const struct hash_ipport4_telem *)data;
110111
111 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, tdata->ip);
112 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, tdata->port);
113 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
114 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
115 htonl(ip_set_timeout_get(tdata->timeout)));
116
112 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, tdata->ip) ||
113 nla_put_net16(skb, IPSET_ATTR_PORT, tdata->port) ||
114 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto) ||
115 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
116 htonl(ip_set_timeout_get(tdata->timeout))))
117 goto nla_put_failure;
117118 return 0;
118119
119120 nla_put_failure:
128129 hash_ipport4_data_next(struct ip_set_hash *h,
129130 const struct hash_ipport4_elem *d)
130131 {
131 h->next.ip = ntohl(d->ip);
132 h->next.port = ntohs(d->port);
132 h->next.ip = d->ip;
133 h->next.port = d->port;
133134 }
134135
135136 static int
229230 }
230231
231232 if (retried)
232 ip = h->next.ip;
233 ip = ntohl(h->next.ip);
233234 for (; !before(ip_to, ip); ip++) {
234 p = retried && ip == h->next.ip ? h->next.port : port;
235 p = retried && ip == ntohl(h->next.ip) ? ntohs(h->next.port)
236 : port;
235237 for (; p <= port_to; p++) {
236238 data.ip = htonl(ip);
237239 data.port = htons(p);
307309 hash_ipport6_data_list(struct sk_buff *skb,
308310 const struct hash_ipport6_elem *data)
309311 {
310 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &data->ip);
311 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, data->port);
312 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
312 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &data->ip.in6) ||
313 nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
314 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto))
315 goto nla_put_failure;
313316 return 0;
314317
315318 nla_put_failure:
323326 const struct hash_ipport6_telem *e =
324327 (const struct hash_ipport6_telem *)data;
325328
326 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &e->ip);
327 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, data->port);
328 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
329 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
330 htonl(ip_set_timeout_get(e->timeout)));
329 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &e->ip.in6) ||
330 nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
331 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto) ||
332 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
333 htonl(ip_set_timeout_get(e->timeout))))
334 goto nla_put_failure;
331335 return 0;
332336
333337 nla_put_failure:
345349 hash_ipport6_data_next(struct ip_set_hash *h,
346350 const struct hash_ipport6_elem *d)
347351 {
348 h->next.port = ntohs(d->port);
352 h->next.port = d->port;
349353 }
350354
351355 static int
427431 swap(port, port_to);
428432
429433 if (retried)
430 port = h->next.port;
434 port = ntohs(h->next.port);
431435 for (; port <= port_to; port++) {
432436 data.port = htons(port);
433437 ret = adtfn(set, &data, timeout, flags);
448452 struct ip_set_hash *h;
449453 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
450454 u8 hbits;
455 size_t hsize;
451456
452457 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
453458 return -IPSET_ERR_INVALID_FAMILY;
475480 h->timeout = IPSET_NO_TIMEOUT;
476481
477482 hbits = htable_bits(hashsize);
478 h->table = ip_set_alloc(
479 sizeof(struct htable)
480 + jhash_size(hbits) * sizeof(struct hbucket));
483 hsize = htable_size(hbits);
484 if (hsize == 0) {
485 kfree(h);
486 return -ENOMEM;
487 }
488 h->table = ip_set_alloc(hsize);
481489 if (!h->table) {
482490 kfree(h);
483491 return -ENOMEM;
9393 hash_ipportip4_data_list(struct sk_buff *skb,
9494 const struct hash_ipportip4_elem *data)
9595 {
96 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, data->ip);
97 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP2, data->ip2);
98 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, data->port);
99 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
96 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) ||
97 nla_put_ipaddr4(skb, IPSET_ATTR_IP2, data->ip2) ||
98 nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
99 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto))
100 goto nla_put_failure;
100101 return 0;
101102
102103 nla_put_failure:
110111 const struct hash_ipportip4_telem *tdata =
111112 (const struct hash_ipportip4_telem *)data;
112113
113 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, tdata->ip);
114 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP2, tdata->ip2);
115 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, tdata->port);
116 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
117 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
118 htonl(ip_set_timeout_get(tdata->timeout)));
119
114 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, tdata->ip) ||
115 nla_put_ipaddr4(skb, IPSET_ATTR_IP2, tdata->ip2) ||
116 nla_put_net16(skb, IPSET_ATTR_PORT, tdata->port) ||
117 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto) ||
118 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
119 htonl(ip_set_timeout_get(tdata->timeout))))
120 goto nla_put_failure;
120121 return 0;
121122
122123 nla_put_failure:
131132 hash_ipportip4_data_next(struct ip_set_hash *h,
132133 const struct hash_ipportip4_elem *d)
133134 {
134 h->next.ip = ntohl(d->ip);
135 h->next.port = ntohs(d->port);
135 h->next.ip = d->ip;
136 h->next.port = d->port;
136137 }
137138
138139 static int
237238 }
238239
239240 if (retried)
240 ip = h->next.ip;
241 ip = ntohl(h->next.ip);
241242 for (; !before(ip_to, ip); ip++) {
242 p = retried && ip == h->next.ip ? h->next.port : port;
243 p = retried && ip == ntohl(h->next.ip) ? ntohs(h->next.port)
244 : port;
243245 for (; p <= port_to; p++) {
244246 data.ip = htonl(ip);
245247 data.port = htons(p);
318320 hash_ipportip6_data_list(struct sk_buff *skb,
319321 const struct hash_ipportip6_elem *data)
320322 {
321 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &data->ip);
322 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP2, &data->ip2);
323 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, data->port);
324 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
323 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &data->ip.in6) ||
324 nla_put_ipaddr6(skb, IPSET_ATTR_IP2, &data->ip2.in6) ||
325 nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
326 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto))
327 goto nla_put_failure;
325328 return 0;
326329
327330 nla_put_failure:
335338 const struct hash_ipportip6_telem *e =
336339 (const struct hash_ipportip6_telem *)data;
337340
338 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &e->ip);
339 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP2, &data->ip2);
340 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, data->port);
341 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
342 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
343 htonl(ip_set_timeout_get(e->timeout)));
341 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &e->ip.in6) ||
342 nla_put_ipaddr6(skb, IPSET_ATTR_IP2, &data->ip2.in6) ||
343 nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
344 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto) ||
345 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
346 htonl(ip_set_timeout_get(e->timeout))))
347 goto nla_put_failure;
344348 return 0;
345349
346350 nla_put_failure:
358362 hash_ipportip6_data_next(struct ip_set_hash *h,
359363 const struct hash_ipportip6_elem *d)
360364 {
361 h->next.port = ntohs(d->port);
365 h->next.port = d->port;
362366 }
363367
364368 static int
445449 swap(port, port_to);
446450
447451 if (retried)
448 port = h->next.port;
452 port = ntohs(h->next.port);
449453 for (; port <= port_to; port++) {
450454 data.port = htons(port);
451455 ret = adtfn(set, &data, timeout, flags);
466470 struct ip_set_hash *h;
467471 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
468472 u8 hbits;
473 size_t hsize;
469474
470475 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
471476 return -IPSET_ERR_INVALID_FAMILY;
493498 h->timeout = IPSET_NO_TIMEOUT;
494499
495500 hbits = htable_bits(hashsize);
496 h->table = ip_set_alloc(
497 sizeof(struct htable)
498 + jhash_size(hbits) * sizeof(struct hbucket));
501 hsize = htable_size(hbits);
502 if (hsize == 0) {
503 kfree(h);
504 return -ENOMEM;
505 }
506 h->table = ip_set_alloc(hsize);
499507 if (!h->table) {
500508 kfree(h);
501509 return -ENOMEM;
123123 {
124124 u32 flags = data->nomatch ? IPSET_FLAG_NOMATCH : 0;
125125
126 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, data->ip);
127 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP2, data->ip2);
128 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, data->port);
129 NLA_PUT_U8(skb, IPSET_ATTR_CIDR2, data->cidr + 1);
130 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
131 if (flags)
132 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
126 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) ||
127 nla_put_ipaddr4(skb, IPSET_ATTR_IP2, data->ip2) ||
128 nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
129 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr + 1) ||
130 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto) ||
131 (flags &&
132 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
133 goto nla_put_failure;
133134 return 0;
134135
135136 nla_put_failure:
144145 (const struct hash_ipportnet4_telem *)data;
145146 u32 flags = data->nomatch ? IPSET_FLAG_NOMATCH : 0;
146147
147 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, tdata->ip);
148 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP2, tdata->ip2);
149 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, tdata->port);
150 NLA_PUT_U8(skb, IPSET_ATTR_CIDR2, data->cidr + 1);
151 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
152 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
153 htonl(ip_set_timeout_get(tdata->timeout)));
154 if (flags)
155 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
156
148 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, tdata->ip) ||
149 nla_put_ipaddr4(skb, IPSET_ATTR_IP2, tdata->ip2) ||
150 nla_put_net16(skb, IPSET_ATTR_PORT, tdata->port) ||
151 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr + 1) ||
152 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto) ||
153 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
154 htonl(ip_set_timeout_get(tdata->timeout))) ||
155 (flags &&
156 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
157 goto nla_put_failure;
157158 return 0;
158159
159160 nla_put_failure:
171172 hash_ipportnet4_data_next(struct ip_set_hash *h,
172173 const struct hash_ipportnet4_elem *d)
173174 {
174 h->next.ip = ntohl(d->ip);
175 h->next.port = ntohs(d->port);
176 h->next.ip2 = ntohl(d->ip2);
175 h->next.ip = d->ip;
176 h->next.port = d->port;
177 h->next.ip2 = d->ip2;
177178 }
178179
179180 static int
312313 }
313314
314315 if (retried)
315 ip = h->next.ip;
316 ip = ntohl(h->next.ip);
316317 for (; !before(ip_to, ip); ip++) {
317318 data.ip = htonl(ip);
318 p = retried && ip == h->next.ip ? h->next.port : port;
319 p = retried && ip == ntohl(h->next.ip) ? ntohs(h->next.port)
320 : port;
319321 for (; p <= port_to; p++) {
320322 data.port = htons(p);
321 ip2 = retried && ip == h->next.ip && p == h->next.port
322 ? h->next.ip2 : ip2_from;
323 ip2 = retried
324 && ip == ntohl(h->next.ip)
325 && p == ntohs(h->next.port)
326 ? ntohl(h->next.ip2) : ip2_from;
323327 while (!after(ip2, ip2_to)) {
324328 data.ip2 = htonl(ip2);
325329 ip2_last = ip_set_range_to_cidr(ip2, ip2_to,
435439 {
436440 u32 flags = data->nomatch ? IPSET_FLAG_NOMATCH : 0;
437441
438 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &data->ip);
439 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP2, &data->ip2);
440 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, data->port);
441 NLA_PUT_U8(skb, IPSET_ATTR_CIDR2, data->cidr + 1);
442 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
443 if (flags)
444 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
442 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &data->ip.in6) ||
443 nla_put_ipaddr6(skb, IPSET_ATTR_IP2, &data->ip2.in6) ||
444 nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
445 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr + 1) ||
446 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto) ||
447 (flags &&
448 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
449 goto nla_put_failure;
445450 return 0;
446451
447452 nla_put_failure:
456461 (const struct hash_ipportnet6_telem *)data;
457462 u32 flags = data->nomatch ? IPSET_FLAG_NOMATCH : 0;
458463
459 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &e->ip);
460 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP2, &data->ip2);
461 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, data->port);
462 NLA_PUT_U8(skb, IPSET_ATTR_CIDR2, data->cidr + 1);
463 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
464 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
465 htonl(ip_set_timeout_get(e->timeout)));
466 if (flags)
467 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
464 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &e->ip.in6) ||
465 nla_put_ipaddr6(skb, IPSET_ATTR_IP2, &data->ip2.in6) ||
466 nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
467 nla_put_u8(skb, IPSET_ATTR_CIDR2, data->cidr + 1) ||
468 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto) ||
469 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
470 htonl(ip_set_timeout_get(e->timeout))) ||
471 (flags &&
472 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
473 goto nla_put_failure;
468474 return 0;
469475
470476 nla_put_failure:
482488 hash_ipportnet6_data_next(struct ip_set_hash *h,
483489 const struct hash_ipportnet6_elem *d)
484490 {
485 h->next.port = ntohs(d->port);
491 h->next.port = d->port;
486492 }
487493
488494 static int
594600 swap(port, port_to);
595601
596602 if (retried)
597 port = h->next.port;
603 port = ntohs(h->next.port);
598604 for (; port <= port_to; port++) {
599605 data.port = htons(port);
600606 ret = adtfn(set, &data, timeout, flags);
615621 struct ip_set_hash *h;
616622 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
617623 u8 hbits;
624 size_t hsize;
618625
619626 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
620627 return -IPSET_ERR_INVALID_FAMILY;
644651 h->timeout = IPSET_NO_TIMEOUT;
645652
646653 hbits = htable_bits(hashsize);
647 h->table = ip_set_alloc(
648 sizeof(struct htable)
649 + jhash_size(hbits) * sizeof(struct hbucket));
654 hsize = htable_size(hbits);
655 if (hsize == 0) {
656 kfree(h);
657 return -ENOMEM;
658 }
659 h->table = ip_set_alloc(hsize);
650660 if (!h->table) {
651661 kfree(h);
652662 return -ENOMEM;
110110 {
111111 u32 flags = data->nomatch ? IPSET_FLAG_NOMATCH : 0;
112112
113 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, data->ip);
114 NLA_PUT_U8(skb, IPSET_ATTR_CIDR, data->cidr);
115 if (flags)
116 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
113 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) ||
114 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr) ||
115 (flags &&
116 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
117 goto nla_put_failure;
117118 return 0;
118119
119120 nla_put_failure:
127128 (const struct hash_net4_telem *)data;
128129 u32 flags = data->nomatch ? IPSET_FLAG_NOMATCH : 0;
129130
130 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, tdata->ip);
131 NLA_PUT_U8(skb, IPSET_ATTR_CIDR, tdata->cidr);
132 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
133 htonl(ip_set_timeout_get(tdata->timeout)));
134 if (flags)
135 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
136
131 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, tdata->ip) ||
132 nla_put_u8(skb, IPSET_ATTR_CIDR, tdata->cidr) ||
133 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
134 htonl(ip_set_timeout_get(tdata->timeout))) ||
135 (flags &&
136 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
137 goto nla_put_failure;
137138 return 0;
138139
139140 nla_put_failure:
150151 hash_net4_data_next(struct ip_set_hash *h,
151152 const struct hash_net4_elem *d)
152153 {
153 h->next.ip = ntohl(d->ip);
154 h->next.ip = d->ip;
154155 }
155156
156157 static int
233234 return -IPSET_ERR_HASH_RANGE;
234235 }
235236 if (retried)
236 ip = h->next.ip;
237 ip = ntohl(h->next.ip);
237238 while (!after(ip, ip_to)) {
238239 data.ip = htonl(ip);
239240 last = ip_set_range_to_cidr(ip, ip_to, &data.cidr);
294295 hash_net6_data_copy(struct hash_net6_elem *dst,
295296 const struct hash_net6_elem *src)
296297 {
297 ipv6_addr_copy(&dst->ip.in6, &src->ip.in6);
298 dst->ip.in6 = src->ip.in6;
298299 dst->cidr = src->cidr;
299300 dst->nomatch = src->nomatch;
300301 }
338339 {
339340 u32 flags = data->nomatch ? IPSET_FLAG_NOMATCH : 0;
340341
341 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &data->ip);
342 NLA_PUT_U8(skb, IPSET_ATTR_CIDR, data->cidr);
343 if (flags)
344 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
342 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &data->ip.in6) ||
343 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr) ||
344 (flags &&
345 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
346 goto nla_put_failure;
345347 return 0;
346348
347349 nla_put_failure:
355357 (const struct hash_net6_telem *)data;
356358 u32 flags = data->nomatch ? IPSET_FLAG_NOMATCH : 0;
357359
358 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &e->ip);
359 NLA_PUT_U8(skb, IPSET_ATTR_CIDR, e->cidr);
360 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
361 htonl(ip_set_timeout_get(e->timeout)));
362 if (flags)
363 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
360 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &e->ip.in6) ||
361 nla_put_u8(skb, IPSET_ATTR_CIDR, e->cidr) ||
362 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
363 htonl(ip_set_timeout_get(e->timeout))) ||
364 (flags &&
365 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
366 goto nla_put_failure;
364367 return 0;
365368
366369 nla_put_failure:
459462 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
460463 struct ip_set_hash *h;
461464 u8 hbits;
465 size_t hsize;
462466
463467 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
464468 return -IPSET_ERR_INVALID_FAMILY;
488492 h->timeout = IPSET_NO_TIMEOUT;
489493
490494 hbits = htable_bits(hashsize);
491 h->table = ip_set_alloc(
492 sizeof(struct htable)
493 + jhash_size(hbits) * sizeof(struct hbucket));
495 hsize = htable_size(hbits);
496 if (hsize == 0) {
497 kfree(h);
498 return -ENOMEM;
499 }
500 h->table = ip_set_alloc(hsize);
494501 if (!h->table) {
495502 kfree(h);
496503 return -ENOMEM;
251251
252252 if (data->nomatch)
253253 flags |= IPSET_FLAG_NOMATCH;
254 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, data->ip);
255 NLA_PUT_U8(skb, IPSET_ATTR_CIDR, data->cidr);
256 NLA_PUT_STRING(skb, IPSET_ATTR_IFACE, data->iface);
257 if (flags)
258 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
254 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) ||
255 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr) ||
256 nla_put_string(skb, IPSET_ATTR_IFACE, data->iface) ||
257 (flags &&
258 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
259 goto nla_put_failure;
259260 return 0;
260261
261262 nla_put_failure:
272273
273274 if (data->nomatch)
274275 flags |= IPSET_FLAG_NOMATCH;
275 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, data->ip);
276 NLA_PUT_U8(skb, IPSET_ATTR_CIDR, data->cidr);
277 NLA_PUT_STRING(skb, IPSET_ATTR_IFACE, data->iface);
278 if (flags)
279 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
280 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
281 htonl(ip_set_timeout_get(tdata->timeout)));
276 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) ||
277 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr) ||
278 nla_put_string(skb, IPSET_ATTR_IFACE, data->iface) ||
279 (flags &&
280 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))) ||
281 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
282 htonl(ip_set_timeout_get(tdata->timeout))))
283 goto nla_put_failure;
282284
283285 return 0;
284286
298300 hash_netiface4_data_next(struct ip_set_hash *h,
299301 const struct hash_netiface4_elem *d)
300302 {
301 h->next.ip = ntohl(d->ip);
303 h->next.ip = d->ip;
302304 }
303305
304306 static int
430432 }
431433
432434 if (retried)
433 ip = h->next.ip;
435 ip = ntohl(h->next.ip);
434436 while (!after(ip, ip_to)) {
435437 data.ip = htonl(ip);
436438 last = ip_set_range_to_cidr(ip, ip_to, &data.cidr);
554556
555557 if (data->nomatch)
556558 flags |= IPSET_FLAG_NOMATCH;
557 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &data->ip);
558 NLA_PUT_U8(skb, IPSET_ATTR_CIDR, data->cidr);
559 NLA_PUT_STRING(skb, IPSET_ATTR_IFACE, data->iface);
560 if (flags)
561 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
559 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &data->ip.in6) ||
560 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr) ||
561 nla_put_string(skb, IPSET_ATTR_IFACE, data->iface) ||
562 (flags &&
563 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
564 goto nla_put_failure;
562565 return 0;
563566
564567 nla_put_failure:
575578
576579 if (data->nomatch)
577580 flags |= IPSET_FLAG_NOMATCH;
578 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &e->ip);
579 NLA_PUT_U8(skb, IPSET_ATTR_CIDR, data->cidr);
580 NLA_PUT_STRING(skb, IPSET_ATTR_IFACE, data->iface);
581 if (flags)
582 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
583 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
584 htonl(ip_set_timeout_get(e->timeout)));
581 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &e->ip.in6) ||
582 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr) ||
583 nla_put_string(skb, IPSET_ATTR_IFACE, data->iface) ||
584 (flags &&
585 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))) ||
586 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
587 htonl(ip_set_timeout_get(e->timeout))))
588 goto nla_put_failure;
585589 return 0;
586590
587591 nla_put_failure:
721725 struct ip_set_hash *h;
722726 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
723727 u8 hbits;
728 size_t hsize;
724729
725730 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
726731 return -IPSET_ERR_INVALID_FAMILY;
751756 h->ahash_max = AHASH_MAX_SIZE;
752757
753758 hbits = htable_bits(hashsize);
754 h->table = ip_set_alloc(
755 sizeof(struct htable)
756 + jhash_size(hbits) * sizeof(struct hbucket));
759 hsize = htable_size(hbits);
760 if (hsize == 0) {
761 kfree(h);
762 return -ENOMEM;
763 }
764 h->table = ip_set_alloc(hsize);
757765 if (!h->table) {
758766 kfree(h);
759767 return -ENOMEM;
123123 {
124124 u32 flags = data->nomatch ? IPSET_FLAG_NOMATCH : 0;
125125
126 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, data->ip);
127 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, data->port);
128 NLA_PUT_U8(skb, IPSET_ATTR_CIDR, data->cidr + 1);
129 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
130 if (flags)
131 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
126 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, data->ip) ||
127 nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
128 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr + 1) ||
129 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto) ||
130 (flags &&
131 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
132 goto nla_put_failure;
132133 return 0;
133134
134135 nla_put_failure:
143144 (const struct hash_netport4_telem *)data;
144145 u32 flags = data->nomatch ? IPSET_FLAG_NOMATCH : 0;
145146
146 NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, tdata->ip);
147 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, tdata->port);
148 NLA_PUT_U8(skb, IPSET_ATTR_CIDR, data->cidr + 1);
149 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
150 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
151 htonl(ip_set_timeout_get(tdata->timeout)));
152 if (flags)
153 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
154
147 if (nla_put_ipaddr4(skb, IPSET_ATTR_IP, tdata->ip) ||
148 nla_put_net16(skb, IPSET_ATTR_PORT, tdata->port) ||
149 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr + 1) ||
150 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto) ||
151 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
152 htonl(ip_set_timeout_get(tdata->timeout))) ||
153 (flags &&
154 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
155 goto nla_put_failure;
155156 return 0;
156157
157158 nla_put_failure:
169170 hash_netport4_data_next(struct ip_set_hash *h,
170171 const struct hash_netport4_elem *d)
171172 {
172 h->next.ip = ntohl(d->ip);
173 h->next.port = ntohs(d->port);
173 h->next.ip = d->ip;
174 h->next.port = d->port;
174175 }
175176
176177 static int
287288 }
288289
289290 if (retried)
290 ip = h->next.ip;
291 ip = ntohl(h->next.ip);
291292 while (!after(ip, ip_to)) {
292293 data.ip = htonl(ip);
293294 last = ip_set_range_to_cidr(ip, ip_to, &cidr);
294295 data.cidr = cidr - 1;
295 p = retried && ip == h->next.ip ? h->next.port : port;
296 p = retried && ip == ntohl(h->next.ip) ? ntohs(h->next.port)
297 : port;
296298 for (; p <= port_to; p++) {
297299 data.port = htons(p);
298300 ret = adtfn(set, &data, timeout, flags);
401403 {
402404 u32 flags = data->nomatch ? IPSET_FLAG_NOMATCH : 0;
403405
404 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &data->ip);
405 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, data->port);
406 NLA_PUT_U8(skb, IPSET_ATTR_CIDR, data->cidr + 1);
407 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
408 if (flags)
409 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
406 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &data->ip.in6) ||
407 nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
408 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr + 1) ||
409 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto) ||
410 (flags &&
411 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
412 goto nla_put_failure;
410413 return 0;
411414
412415 nla_put_failure:
421424 (const struct hash_netport6_telem *)data;
422425 u32 flags = data->nomatch ? IPSET_FLAG_NOMATCH : 0;
423426
424 NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &e->ip);
425 NLA_PUT_NET16(skb, IPSET_ATTR_PORT, data->port);
426 NLA_PUT_U8(skb, IPSET_ATTR_CIDR, data->cidr + 1);
427 NLA_PUT_U8(skb, IPSET_ATTR_PROTO, data->proto);
428 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
429 htonl(ip_set_timeout_get(e->timeout)));
430 if (flags)
431 NLA_PUT_NET32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags));
427 if (nla_put_ipaddr6(skb, IPSET_ATTR_IP, &e->ip.in6) ||
428 nla_put_net16(skb, IPSET_ATTR_PORT, data->port) ||
429 nla_put_u8(skb, IPSET_ATTR_CIDR, data->cidr + 1) ||
430 nla_put_u8(skb, IPSET_ATTR_PROTO, data->proto) ||
431 nla_put_net32(skb, IPSET_ATTR_TIMEOUT,
432 htonl(ip_set_timeout_get(e->timeout))) ||
433 (flags &&
434 nla_put_net32(skb, IPSET_ATTR_CADT_FLAGS, htonl(flags))))
435 goto nla_put_failure;
432436 return 0;
433437
434438 nla_put_failure:
446450 hash_netport6_data_next(struct ip_set_hash *h,
447451 const struct hash_netport6_elem *d)
448452 {
449 h->next.port = ntohs(d->port);
453 h->next.port = d->port;
450454 }
451455
452456 static int
550554 swap(port, port_to);
551555
552556 if (retried)
553 port = h->next.port;
557 port = ntohs(h->next.port);
554558 for (; port <= port_to; port++) {
555559 data.port = htons(port);
556560 ret = adtfn(set, &data, timeout, flags);
571575 struct ip_set_hash *h;
572576 u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
573577 u8 hbits;
578 size_t hsize;
574579
575580 if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
576581 return -IPSET_ERR_INVALID_FAMILY;
600605 h->timeout = IPSET_NO_TIMEOUT;
601606
602607 hbits = htable_bits(hashsize);
603 h->table = ip_set_alloc(
604 sizeof(struct htable)
605 + jhash_size(hbits) * sizeof(struct hbucket));
608 hsize = htable_size(hbits);
609 if (hsize == 0) {
610 kfree(h);
611 return -ENOMEM;
612 }
613 h->table = ip_set_alloc(hsize);
606614 if (!h->table) {
607615 kfree(h);
608616 return -ENOMEM;
401401 nested = ipset_nest_start(skb, IPSET_ATTR_DATA);
402402 if (!nested)
403403 goto nla_put_failure;
404 NLA_PUT_NET32(skb, IPSET_ATTR_SIZE, htonl(map->size));
405 if (with_timeout(map->timeout))
406 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT, htonl(map->timeout));
407 NLA_PUT_NET32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1));
408 NLA_PUT_NET32(skb, IPSET_ATTR_MEMSIZE,
409 htonl(sizeof(*map) + map->size * map->dsize));
404 if (nla_put_net32(skb, IPSET_ATTR_SIZE, htonl(map->size)) ||
405 (with_timeout(map->timeout) &&
406 nla_put_net32(skb, IPSET_ATTR_TIMEOUT, htonl(map->timeout))) ||
407 nla_put_net32(skb, IPSET_ATTR_REFERENCES, htonl(set->ref - 1)) ||
408 nla_put_net32(skb, IPSET_ATTR_MEMSIZE,
409 htonl(sizeof(*map) + map->size * map->dsize)))
410 goto nla_put_failure;
410411 ipset_nest_end(skb, nested);
411412
412413 return 0;
441442 } else
442443 goto nla_put_failure;
443444 }
444 NLA_PUT_STRING(skb, IPSET_ATTR_NAME,
445 ip_set_name_byindex(e->id));
445 if (nla_put_string(skb, IPSET_ATTR_NAME,
446 ip_set_name_byindex(e->id)))
447 goto nla_put_failure;
446448 if (with_timeout(map->timeout)) {
447449 const struct set_telem *te =
448450 (const struct set_telem *) e;
449 NLA_PUT_NET32(skb, IPSET_ATTR_TIMEOUT,
450 htonl(ip_set_timeout_get(te->timeout)));
451 __be32 to = htonl(ip_set_timeout_get(te->timeout));
452 if (nla_put_net32(skb, IPSET_ATTR_TIMEOUT, to))
453 goto nla_put_failure;
451454 }
452455 ipset_nest_end(skb, nested);
453456 }
00 #include <linux/version.h>
1 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)
1 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
22 #include <linux/export.h>
33 #endif
44 #include <linux/netfilter/ipset/pfxlen.h>
4343 .cmdflags = cfs, \
4444 .timeout = t, \
4545 }
46 #define ADT_MOPT(n, f, d, fs, cfs, t) \
47 struct ip_set_adt_opt n = { \
48 .family = f, \
49 .dim = d, \
50 .flags = fs, \
51 .cmdflags = cfs, \
52 .timeout = t, \
53 }
4654
4755 /* Revision 0 interface: backward compatible with netfilter/iptables */
4856
295303 set_target_v2(struct sk_buff *skb, const struct xt_action_param *par)
296304 {
297305 const struct xt_set_info_target_v2 *info = par->targinfo;
298 ADT_OPT(add_opt, par->family, info->add_set.dim,
299 info->add_set.flags, info->flags, info->timeout);
306 ADT_MOPT(add_opt, par->family, info->add_set.dim,
307 info->add_set.flags, info->flags, info->timeout);
300308 ADT_OPT(del_opt, par->family, info->del_set.dim,
301309 info->del_set.flags, 0, UINT_MAX);
302310
311 /* Normalize to fit into jiffies */
312 if (add_opt.timeout > UINT_MAX/1000)
313 add_opt.timeout = UINT_MAX/1000;
303314 if (info->add_set.index != IPSET_INVALID_ID)
304315 ip_set_add(info->add_set.index, skb, par, &add_opt);
305316 if (info->del_set.index != IPSET_INVALID_ID)
0 IPSET_MODSDIR=${libdir}/ipset
1
2 if ENABLE_SETTYPE_MODULES
3 AM_CFLAGS += -DENABLE_SETTYPE_MODULES \
4 -DIPSET_MODSDIR="\"$(IPSET_MODSDIR)\""
5 IPSET_SETTYPE_MODULES = yes
6 IPSET_SETTYPE_DYN = $(if $(findstring all,$(SETTYPE_MODLIST)), \
7 $(IPSET_SETTYPE_LIST), $(SETTYPE_MODLIST))
8 else
9 IPSET_SETTYPE_DYN =
10 endif
11
12 IPSET_SETTYPE_STATIC = $(filter-out $(IPSET_SETTYPE_DYN), \
13 $(IPSET_SETTYPE_LIST))
14 IPSET_SETTYPE_DYNAMIC = $(filter $(IPSET_SETTYPE_LIST), \
15 $(IPSET_SETTYPE_DYN))
16 IPSET_SETTYPE_STATIC_OBJECTS = $(patsubst %.c, %.lo, $(IPSET_SETTYPE_STATIC))
17
18 IPSET_SETTYPE_DYNAMIC_OBJECTS = $(patsubst %.c, %.lo, $(IPSET_SETTYPE_DYNAMIC))
19 IPSET_SETTYPE_DYNAMIC_MODULES = $(patsubst %.c, %.la, $(IPSET_SETTYPE_DYNAMIC))
20 IPSET_SETTYPE_DYNAMIC_LTFLAGS = -shared -module -avoid-version
21 IPSET_SETTYPE_ALL_MODULES = $(patsubst %.c, %.la, $(IPSET_SETTYPE_STATIC)) \
22 $(IPSET_SETTYPE_DYNAMIC_MODULES)
23
24 BUILT_SOURCES = ipset_settype_check types_init.c ipset_settype_modules
25 CLEANFILES = ipset_settype_check types_init.c $(IPSET_SETTYPE_ALL_MODULES)
26
27 ipset_%.lo: ipset_%.c
28 depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`; \
29 $(LTCOMPILE) -D_INIT=ipset_$*_init \
30 $(if $(findstring ipset_$*.c,$(IPSET_SETTYPE_STATIC)), -DTYPE_INCLUSIVE,)\
31 -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< && \
32 $(am__mv) $$depbase.Tpo $$depbase.Plo
33
34 ipset_%.la: $(lib_LTLIBRARIES) ipset_%.lo
35 lobj="$(patsubst %.la, %.lo, $@)"; \
36 $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
37 $(CFLAGS) $(IPSET_SETTYPE_DYNAMIC_LTFLAGS) $(LDFLAGS) -o $@ \
38 -rpath $(IPSET_MODSDIR) $$lobj $(LIBS) $(top_builddir)/lib/libipset.la
39
40 types_init.c: $(IPSET_SETTYPE_STATIC_OBJECTS)
41 @( \
42 static_list=`echo $(patsubst %.c,%,$(IPSET_SETTYPE_STATIC))`; \
43 echo -n "" > $@; \
44 for i in $$static_list; do \
45 echo "extern void $${i}_init(void);" >> $@; \
46 done; \
47 echo "void ipset_types_init(void);" >> $@; \
48 echo "void ipset_types_init(void)" >> $@; \
49 echo "{" >> $@; \
50 for i in $$static_list; do \
51 echo " ""$${i}_init();" >> $@; \
52 done; \
53 echo "}" >> $@; \
54 );
55
56 ipset_settype_check:
57 @list="$(IPSET_SETTYPE_MODULES) $(IPSET_SETTYPE_STATIC_OBJECTS)"; \
58 test -f $@ || echo "$$list" > $@; \
59 if test "$$list" != "`cat $@`"; then \
60 $(MAKE) clean; \
61 echo "$$list" > $@; \
62 fi
63
64 ipset_settype_modules: $(lib_LTLIBRARIES) $(IPSET_SETTYPE_DYNAMIC_OBJECTS) \
65 $(IPSET_SETTYPE_DYNAMIC_MODULES)
66
67 install-data-local: install-settype-modules
68 uninstall-local: uninstall-settype-modules
69
70 install-settype-modules: ipset_settype_modules
71 @$(NORMAL_INSTALL)
72 @list='$(IPSET_SETTYPE_DYNAMIC_MODULES)'; \
73 test -n "$(IPSET_MODSDIR)" || list=; \
74 list2=; for p in $$list; do \
75 if test -f $$p; then \
76 list2="$$list2 $$p"; \
77 else :; fi; \
78 done; \
79 test -z "$$list2" || { \
80 echo " $(MKDIR_P) '$(DESTDIR)$(IPSET_MODSDIR)'"; \
81 $(MKDIR_P) "$(DESTDIR)$(IPSET_MODSDIR)" || exit 1; \
82 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(IPSET_MODSDIR)'"; \
83 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(IPSET_MODSDIR)"; \
84 }
85
86 uninstall-settype-modules:
87 @$(NORMAL_UNINSTALL)
88 @list='$(IPSET_SETTYPE_DYNAMIC_MODULES)'; \
89 test -n "$(IPSET_MODSDIR)" || list=; \
90 for p in $$list; do \
91 $(am__strip_dir) \
92 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(IPSET_MODSDIR)/$$f'"; \
93 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(IPSET_MODSDIR)/$$f"; \
94 done
95
96 .PHONY: ipset_settype_check ipset_settype_modules ipset_settype_modules-stamp \
97 install-settype-modules uninstall-settype-modules
00 include $(top_srcdir)/Make_global.am
11
2 AM_CFLAGS += ${libmnl_CFLAGS}
3
4 lib_LTLIBRARIES = libipset.la
5
6 libipset_la_LDFLAGS = -Wl,--version-script=$(top_srcdir)/lib/libipset.map -version-info $(LIBVERSION)
7 libipset_la_LIBADD = ${libmnl_LIBS}
8 libipset_la_SOURCES = \
9 data.c \
10 errcode.c \
11 icmp.c \
12 icmpv6.c \
13 mnl.c \
14 parse.c \
15 print.c \
16 session.c \
17 types.c \
2 IPSET_SETTYPE_LIST = \
183 ipset_bitmap_ip.c \
194 ipset_bitmap_ipmac.c \
205 ipset_bitmap_port.c \
2712 ipset_hash_netiface.c \
2813 ipset_list_set.c
2914
15 AM_CFLAGS += ${libmnl_CFLAGS}
16
17 lib_LTLIBRARIES = libipset.la
18
19 include $(top_srcdir)/lib/Make_extra.am
20
21 libipset_la_LDFLAGS = -Wl,--version-script=$(top_srcdir)/lib/libipset.map -version-info $(LIBVERSION)
22 libipset_la_LIBADD = ${libmnl_LIBS} $(IPSET_SETTYPE_STATIC_OBJECTS)
23 libipset_la_SOURCES = \
24 data.c \
25 errcode.c \
26 icmp.c \
27 icmpv6.c \
28 mnl.c \
29 parse.c \
30 print.c \
31 session.c \
32 types.c \
33 ui.c \
34 types_init.c
35
36 EXTRA_DIST = $(IPSET_SETTYPE_LIST) libipset.map
37
3038 #%.o: %.c
3139 # ${AM_VERBOSE_CC} ${CC} ${AM_DEPFLAGS} ${AM_CFLAGS} ${CFLAGS} -o $@ -c $<
104104 build_triplet = @build@
105105 host_triplet = @host@
106106 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
107 $(srcdir)/libipset.pc.in $(top_srcdir)/Make_global.am
107 $(srcdir)/libipset.pc.in $(top_srcdir)/Make_global.am \
108 $(top_srcdir)/lib/Make_extra.am
108109 @ENABLE_DEBUG_TRUE@am__append_1 = -g -g3 -ggdb -gdwarf-2 -DIPSET_DEBUG -Wall -Werror
109110 @ENABLE_DEBUG_FALSE@am__append_2 = -O2 -DNDEBUG
111 @ENABLE_SETTYPE_MODULES_TRUE@am__append_3 = -DENABLE_SETTYPE_MODULES \
112 @ENABLE_SETTYPE_MODULES_TRUE@ -DIPSET_MODSDIR="\"$(IPSET_MODSDIR)\""
113
110114 subdir = lib
111115 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
112 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \
113 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
114 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
115 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
116 am__aclocal_m4_deps = $(top_srcdir)/m4/argz.m4 \
117 $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \
118 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltdl.m4 \
119 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
120 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
121 $(top_srcdir)/configure.ac
116122 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
117123 $(ACLOCAL_M4)
118124 mkinstalldirs = $(install_sh) -d
143149 am__installdirs = "$(DESTDIR)$(libdir)"
144150 LTLIBRARIES = $(lib_LTLIBRARIES)
145151 am__DEPENDENCIES_1 =
146 libipset_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
152 libipset_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
153 $(IPSET_SETTYPE_STATIC_OBJECTS)
147154 am_libipset_la_OBJECTS = data.lo errcode.lo icmp.lo icmpv6.lo mnl.lo \
148 parse.lo print.lo session.lo types.lo ipset_bitmap_ip.lo \
149 ipset_bitmap_ipmac.lo ipset_bitmap_port.lo ipset_hash_ip.lo \
150 ipset_hash_ipport.lo ipset_hash_ipportip.lo \
151 ipset_hash_ipportnet.lo ipset_hash_net.lo \
152 ipset_hash_netport.lo ipset_hash_netiface.lo ipset_list_set.lo
155 parse.lo print.lo session.lo types.lo ui.lo types_init.lo
153156 libipset_la_OBJECTS = $(am_libipset_la_OBJECTS)
154157 libipset_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
155158 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
175178 ACLOCAL = @ACLOCAL@
176179 AMTAR = @AMTAR@
177180 AR = @AR@
181 ARGZ_H = @ARGZ_H@
178182 AUTOCONF = @AUTOCONF@
179183 AUTOHEADER = @AUTOHEADER@
180184 AUTOMAKE = @AUTOMAKE@
196200 EXEEXT = @EXEEXT@
197201 FGREP = @FGREP@
198202 GREP = @GREP@
203 INCLTDL = @INCLTDL@
199204 INSTALL = @INSTALL@
200205 INSTALL_DATA = @INSTALL_DATA@
201206 INSTALL_PROGRAM = @INSTALL_PROGRAM@
204209 KBUILDDIR = @KBUILDDIR@
205210 LD = @LD@
206211 LDFLAGS = @LDFLAGS@
212 LIBADD_DL = @LIBADD_DL@
213 LIBADD_DLD_LINK = @LIBADD_DLD_LINK@
214 LIBADD_DLOPEN = @LIBADD_DLOPEN@
215 LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@
216 LIBLTDL = @LIBLTDL@
207217 LIBOBJS = @LIBOBJS@
208218 LIBS = @LIBS@
209219 LIBTOOL = @LIBTOOL@
210220 LIPO = @LIPO@
211221 LN_S = @LN_S@
222 LTDLDEPS = @LTDLDEPS@
223 LTDLINCL = @LTDLINCL@
224 LTDLOPEN = @LTDLOPEN@
212225 LTLIBOBJS = @LTLIBOBJS@
226 LT_CONFIG_H = @LT_CONFIG_H@
227 LT_DLLOADERS = @LT_DLLOADERS@
228 LT_DLPREOPEN = @LT_DLPREOPEN@
213229 MAKEINFO = @MAKEINFO@
214230 MAXSETS = @MAXSETS@
215231 MKDIR_P = @MKDIR_P@
230246 PKG_CONFIG = @PKG_CONFIG@
231247 RANLIB = @RANLIB@
232248 SED = @SED@
249 SETTYPE_MODLIST = @SETTYPE_MODLIST@
233250 SET_MAKE = @SET_MAKE@
234251 SHELL = @SHELL@
235252 STRIP = @STRIP@
273290 localedir = @localedir@
274291 localstatedir = @localstatedir@
275292 lt_ECHO = @lt_ECHO@
293 ltdl_LIBOBJS = @ltdl_LIBOBJS@
294 ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@
276295 mandir = @mandir@
277296 mkdir_p = @mkdir_p@
278297 oldincludedir = @oldincludedir@
283302 sbindir = @sbindir@
284303 sharedstatedir = @sharedstatedir@
285304 srcdir = @srcdir@
305 sys_symbol_underscore = @sys_symbol_underscore@
286306 sysconfdir = @sysconfdir@
287307 target_alias = @target_alias@
288308 top_build_prefix = @top_build_prefix@
289309 top_builddir = @top_builddir@
290310 top_srcdir = @top_srcdir@
291 LIBVERSION = 2:0:0
311 LIBVERSION = 2:1:0
292312 AM_CPPFLAGS = $(kinclude_CFLAGS) $(all_includes) -I$(top_srcdir)/include \
293313 -I/usr/local/include
294314
295315 AM_CFLAGS = -std=gnu99 $(am__append_1) $(am__append_2) \
296 ${libmnl_CFLAGS}
316 ${libmnl_CFLAGS} $(am__append_3)
297317 @ENABLE_VERBOSE_FALSE@AM_LIBTOOL_SILENT = --silent
298318 @ENABLE_VERBOSE_FALSE@AM_VERBOSE_CC = @echo " CC " $@;
299319 @ENABLE_VERBOSE_FALSE@AM_VERBOSE_CCLD = @echo " CCLD " $@;
300 lib_LTLIBRARIES = libipset.la
301 libipset_la_LDFLAGS = -Wl,--version-script=$(top_srcdir)/lib/libipset.map -version-info $(LIBVERSION)
302 libipset_la_LIBADD = ${libmnl_LIBS}
303 libipset_la_SOURCES = \
304 data.c \
305 errcode.c \
306 icmp.c \
307 icmpv6.c \
308 mnl.c \
309 parse.c \
310 print.c \
311 session.c \
312 types.c \
320 IPSET_SETTYPE_LIST = \
313321 ipset_bitmap_ip.c \
314322 ipset_bitmap_ipmac.c \
315323 ipset_bitmap_port.c \
322330 ipset_hash_netiface.c \
323331 ipset_list_set.c
324332
325 all: all-am
333 lib_LTLIBRARIES = libipset.la
334 IPSET_MODSDIR = ${libdir}/ipset
335 @ENABLE_SETTYPE_MODULES_TRUE@IPSET_SETTYPE_MODULES = yes
336 @ENABLE_SETTYPE_MODULES_FALSE@IPSET_SETTYPE_DYN =
337 @ENABLE_SETTYPE_MODULES_TRUE@IPSET_SETTYPE_DYN = $(if $(findstring all,$(SETTYPE_MODLIST)), \
338 @ENABLE_SETTYPE_MODULES_TRUE@ $(IPSET_SETTYPE_LIST), $(SETTYPE_MODLIST))
339
340 IPSET_SETTYPE_STATIC = $(filter-out $(IPSET_SETTYPE_DYN), \
341 $(IPSET_SETTYPE_LIST))
342
343 IPSET_SETTYPE_DYNAMIC = $(filter $(IPSET_SETTYPE_LIST), \
344 $(IPSET_SETTYPE_DYN))
345
346 IPSET_SETTYPE_STATIC_OBJECTS = $(patsubst %.c, %.lo, $(IPSET_SETTYPE_STATIC))
347 IPSET_SETTYPE_DYNAMIC_OBJECTS = $(patsubst %.c, %.lo, $(IPSET_SETTYPE_DYNAMIC))
348 IPSET_SETTYPE_DYNAMIC_MODULES = $(patsubst %.c, %.la, $(IPSET_SETTYPE_DYNAMIC))
349 IPSET_SETTYPE_DYNAMIC_LTFLAGS = -shared -module -avoid-version
350 IPSET_SETTYPE_ALL_MODULES = $(patsubst %.c, %.la, $(IPSET_SETTYPE_STATIC)) \
351 $(IPSET_SETTYPE_DYNAMIC_MODULES)
352
353 BUILT_SOURCES = ipset_settype_check types_init.c ipset_settype_modules
354 CLEANFILES = ipset_settype_check types_init.c $(IPSET_SETTYPE_ALL_MODULES)
355 libipset_la_LDFLAGS = -Wl,--version-script=$(top_srcdir)/lib/libipset.map -version-info $(LIBVERSION)
356 libipset_la_LIBADD = ${libmnl_LIBS} $(IPSET_SETTYPE_STATIC_OBJECTS)
357 libipset_la_SOURCES = \
358 data.c \
359 errcode.c \
360 icmp.c \
361 icmpv6.c \
362 mnl.c \
363 parse.c \
364 print.c \
365 session.c \
366 types.c \
367 ui.c \
368 types_init.c
369
370 EXTRA_DIST = $(IPSET_SETTYPE_LIST) libipset.map
371 all: $(BUILT_SOURCES)
372 $(MAKE) $(AM_MAKEFLAGS) all-am
326373
327374 .SUFFIXES:
328375 .SUFFIXES: .c .lo .o .obj
329 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Make_global.am $(am__configure_deps)
376 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/Make_global.am $(top_srcdir)/lib/Make_extra.am $(am__configure_deps)
330377 @for dep in $?; do \
331378 case '$(am__configure_deps)' in \
332379 *$$dep*) \
402449 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errcode.Plo@am__quote@
403450 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icmp.Plo@am__quote@
404451 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icmpv6.Plo@am__quote@
405 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipset_bitmap_ip.Plo@am__quote@
406 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipset_bitmap_ipmac.Plo@am__quote@
407 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipset_bitmap_port.Plo@am__quote@
408 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipset_hash_ip.Plo@am__quote@
409 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipset_hash_ipport.Plo@am__quote@
410 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipset_hash_ipportip.Plo@am__quote@
411 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipset_hash_ipportnet.Plo@am__quote@
412 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipset_hash_net.Plo@am__quote@
413 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipset_hash_netiface.Plo@am__quote@
414 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipset_hash_netport.Plo@am__quote@
415 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipset_list_set.Plo@am__quote@
416452 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mnl.Plo@am__quote@
417453 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Plo@am__quote@
418454 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print.Plo@am__quote@
419455 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Plo@am__quote@
420456 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/types.Plo@am__quote@
457 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/types_init.Plo@am__quote@
458 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ui.Plo@am__quote@
421459
422460 .c.o:
423461 @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
532570 fi; \
533571 done
534572 check-am: all-am
535 check: check-am
573 check: $(BUILT_SOURCES)
574 $(MAKE) $(AM_MAKEFLAGS) check-am
536575 all-am: Makefile $(LTLIBRARIES)
537576 installdirs:
538577 for dir in "$(DESTDIR)$(libdir)"; do \
539578 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
540579 done
541 install: install-am
580 install: $(BUILT_SOURCES)
581 $(MAKE) $(AM_MAKEFLAGS) install-am
542582 install-exec: install-exec-am
543583 install-data: install-data-am
544584 uninstall: uninstall-am
555595 mostlyclean-generic:
556596
557597 clean-generic:
598 -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
558599
559600 distclean-generic:
560601 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
563604 maintainer-clean-generic:
564605 @echo "This command is intended for maintainers to use"
565606 @echo "it deletes files that may require special tools to rebuild."
607 -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
566608 clean: clean-am
567609
568610 clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
586628
587629 info-am:
588630
589 install-data-am:
631 install-data-am: install-data-local
590632
591633 install-dvi: install-dvi-am
592634
632674
633675 ps-am:
634676
635 uninstall-am: uninstall-libLTLIBRARIES
636
637 .MAKE: install-am install-strip
677 uninstall-am: uninstall-libLTLIBRARIES uninstall-local
678
679 .MAKE: all check install install-am install-strip
638680
639681 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
640682 clean-libLTLIBRARIES clean-libtool ctags distclean \
641683 distclean-compile distclean-generic distclean-libtool \
642684 distclean-tags distdir dvi dvi-am html html-am info info-am \
643 install install-am install-data install-data-am install-dvi \
644 install-dvi-am install-exec install-exec-am install-html \
645 install-html-am install-info install-info-am \
646 install-libLTLIBRARIES install-man install-pdf install-pdf-am \
647 install-ps install-ps-am install-strip installcheck \
648 installcheck-am installdirs maintainer-clean \
685 install install-am install-data install-data-am \
686 install-data-local install-dvi install-dvi-am install-exec \
687 install-exec-am install-html install-html-am install-info \
688 install-info-am install-libLTLIBRARIES install-man install-pdf \
689 install-pdf-am install-ps install-ps-am install-strip \
690 installcheck installcheck-am installdirs maintainer-clean \
649691 maintainer-clean-generic mostlyclean mostlyclean-compile \
650692 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
651 tags uninstall uninstall-am uninstall-libLTLIBRARIES
652
693 tags uninstall uninstall-am uninstall-libLTLIBRARIES \
694 uninstall-local
695
696
697 ipset_%.lo: ipset_%.c
698 depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`; \
699 $(LTCOMPILE) -D_INIT=ipset_$*_init \
700 $(if $(findstring ipset_$*.c,$(IPSET_SETTYPE_STATIC)), -DTYPE_INCLUSIVE,)\
701 -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< && \
702 $(am__mv) $$depbase.Tpo $$depbase.Plo
703
704 ipset_%.la: $(lib_LTLIBRARIES) ipset_%.lo
705 lobj="$(patsubst %.la, %.lo, $@)"; \
706 $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
707 $(CFLAGS) $(IPSET_SETTYPE_DYNAMIC_LTFLAGS) $(LDFLAGS) -o $@ \
708 -rpath $(IPSET_MODSDIR) $$lobj $(LIBS) $(top_builddir)/lib/libipset.la
709
710 types_init.c: $(IPSET_SETTYPE_STATIC_OBJECTS)
711 @( \
712 static_list=`echo $(patsubst %.c,%,$(IPSET_SETTYPE_STATIC))`; \
713 echo -n "" > $@; \
714 for i in $$static_list; do \
715 echo "extern void $${i}_init(void);" >> $@; \
716 done; \
717 echo "void ipset_types_init(void);" >> $@; \
718 echo "void ipset_types_init(void)" >> $@; \
719 echo "{" >> $@; \
720 for i in $$static_list; do \
721 echo " ""$${i}_init();" >> $@; \
722 done; \
723 echo "}" >> $@; \
724 );
725
726 ipset_settype_check:
727 @list="$(IPSET_SETTYPE_MODULES) $(IPSET_SETTYPE_STATIC_OBJECTS)"; \
728 test -f $@ || echo "$$list" > $@; \
729 if test "$$list" != "`cat $@`"; then \
730 $(MAKE) clean; \
731 echo "$$list" > $@; \
732 fi
733
734 ipset_settype_modules: $(lib_LTLIBRARIES) $(IPSET_SETTYPE_DYNAMIC_OBJECTS) \
735 $(IPSET_SETTYPE_DYNAMIC_MODULES)
736
737 install-data-local: install-settype-modules
738 uninstall-local: uninstall-settype-modules
739
740 install-settype-modules: ipset_settype_modules
741 @$(NORMAL_INSTALL)
742 @list='$(IPSET_SETTYPE_DYNAMIC_MODULES)'; \
743 test -n "$(IPSET_MODSDIR)" || list=; \
744 list2=; for p in $$list; do \
745 if test -f $$p; then \
746 list2="$$list2 $$p"; \
747 else :; fi; \
748 done; \
749 test -z "$$list2" || { \
750 echo " $(MKDIR_P) '$(DESTDIR)$(IPSET_MODSDIR)'"; \
751 $(MKDIR_P) "$(DESTDIR)$(IPSET_MODSDIR)" || exit 1; \
752 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(IPSET_MODSDIR)'"; \
753 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(IPSET_MODSDIR)"; \
754 }
755
756 uninstall-settype-modules:
757 @$(NORMAL_UNINSTALL)
758 @list='$(IPSET_SETTYPE_DYNAMIC_MODULES)'; \
759 test -n "$(IPSET_MODSDIR)" || list=; \
760 for p in $$list; do \
761 $(am__strip_dir) \
762 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(IPSET_MODSDIR)/$$f'"; \
763 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(IPSET_MODSDIR)/$$f"; \
764 done
765
766 .PHONY: ipset_settype_check ipset_settype_modules ipset_settype_modules-stamp \
767 install-settype-modules uninstall-settype-modules
653768
654769 #%.o: %.c
655770 # ${AM_VERBOSE_CC} ${CC} ${AM_DEPFLAGS} ${AM_CFLAGS} ${CFLAGS} -o $@ -c $<
165165 * @data: data blob
166166 * @flags: the option flag to be ignored
167167 *
168 * Returns true if the option was not already ignored.
168 * Returns true if the option was already ignored.
169169 */
170170 bool
171171 ipset_data_ignored(struct ipset_data *data, enum ipset_opt opt)
177177 data->ignored |= IPSET_FLAG(opt);
178178
179179 return ignored;
180 }
181
182 /**
183 * ipset_data_test_ignored - test ignored bits in the data blob
184 * @data: data blob
185 * @flags: the option flag to be tested
186 *
187 * Returns true if the option is ignored.
188 */
189 bool
190 ipset_data_test_ignored(struct ipset_data *data, enum ipset_opt opt)
191 {
192 assert(data);
193
194 return data->ignored & IPSET_FLAG(opt);
180195 }
181196
182197 /**
207222 break;
208223 case IPSET_OPT_FAMILY:
209224 data->family = *(const uint8_t *) value;
225 data->ignored &= ~IPSET_FLAG(IPSET_OPT_FAMILY);
210226 D("family set to %u", data->family);
211227 break;
212228 /* CADT options */
2020 },
2121 { .name = { "timeout", NULL },
2222 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
23 .parse = ipset_parse_uint32, .print = ipset_print_number,
23 .parse = ipset_parse_timeout, .print = ipset_print_number,
2424 },
2525 /* Backward compatibility */
2626 { .name = { "from", NULL },
4141 static const struct ipset_arg bitmap_ip_add_args[] = {
4242 { .name = { "timeout", NULL },
4343 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
44 .parse = ipset_parse_uint32, .print = ipset_print_number,
44 .parse = ipset_parse_timeout, .print = ipset_print_number,
4545 },
4646 { },
4747 };
5555 "where IP, FROM and TO are IPv4 addresses (or hostnames),\n"
5656 " CIDR is a valid IPv4 CIDR prefix.\n";
5757
58 struct ipset_type ipset_bitmap_ip0 = {
58 static struct ipset_type ipset_bitmap_ip0 = {
5959 .name = "bitmap:ip",
6060 .alias = { "ipmap", NULL },
6161 .revision = 0,
9494
9595 .usage = bitmap_ip_usage,
9696 };
97
98 void _init(void);
99 void _init(void)
100 {
101 ipset_type_add(&ipset_bitmap_ip0);
102 }
1616 },
1717 { .name = { "timeout", NULL },
1818 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
19 .parse = ipset_parse_uint32, .print = ipset_print_number,
19 .parse = ipset_parse_timeout, .print = ipset_print_number,
2020 },
2121 /* Backward compatibility */
2222 { .name = { "from", NULL },
3737 static const struct ipset_arg bitmap_ipmac_add_args[] = {
3838 { .name = { "timeout", NULL },
3939 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
40 .parse = ipset_parse_uint32, .print = ipset_print_number,
40 .parse = ipset_parse_timeout, .print = ipset_print_number,
4141 },
4242 { },
4343 };
5252 " CIDR is a valid IPv4 CIDR prefix,\n"
5353 " MAC is a valid MAC address.\n";
5454
55 struct ipset_type ipset_bitmap_ipmac0 = {
55 static struct ipset_type ipset_bitmap_ipmac0 = {
5656 .name = "bitmap:ip,mac",
5757 .alias = { "macipmap", NULL },
5858 .revision = 0,
9797
9898 .usage = bitmap_ipmac_usage,
9999 };
100
101 void _init(void);
102 void _init(void)
103 {
104 ipset_type_add(&ipset_bitmap_ipmac0);
105 }
1616 },
1717 { .name = { "timeout", NULL },
1818 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
19 .parse = ipset_parse_uint32, .print = ipset_print_number,
19 .parse = ipset_parse_timeout, .print = ipset_print_number,
2020 },
2121 /* Backward compatibility */
2222 { .name = { "from", NULL },
3333 static const struct ipset_arg bitmap_port_add_args[] = {
3434 { .name = { "timeout", NULL },
3535 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
36 .parse = ipset_parse_uint32, .print = ipset_print_number,
36 .parse = ipset_parse_timeout, .print = ipset_print_number,
3737 },
3838 { },
3939 };
4646 "test SETNAME PORT\n\n"
4747 "where PORT, FROM and TO are port numbers or port names from /etc/services.\n";
4848
49 struct ipset_type ipset_bitmap_port0 = {
49 static struct ipset_type ipset_bitmap_port0 = {
5050 .name = "bitmap:port",
5151 .alias = { "portmap", NULL },
5252 .revision = 0,
8484
8585 .usage = bitmap_port_usage,
8686 };
87
88 void _init(void);
89 void _init(void)
90 {
91 ipset_type_add(&ipset_bitmap_port0);
92 }
3838 },
3939 { .name = { "timeout", NULL },
4040 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
41 .parse = ipset_parse_uint32, .print = ipset_print_number,
41 .parse = ipset_parse_timeout, .print = ipset_print_number,
4242 },
4343 /* Ignored options: backward compatibilty */
4444 { .name = { "probes", NULL },
5959 static const struct ipset_arg hash_ip_add_args[] = {
6060 { .name = { "timeout", NULL },
6161 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
62 .parse = ipset_parse_uint32, .print = ipset_print_number,
62 .parse = ipset_parse_timeout, .print = ipset_print_number,
6363 },
6464 { },
6565 };
7878 " Adding/deleting multiple elements in IP/CIDR or FROM-TO form\n"
7979 " is supported for IPv4.\n";
8080
81 struct ipset_type ipset_hash_ip0 = {
81 static struct ipset_type ipset_hash_ip0 = {
8282 .name = "hash:ip",
8383 .alias = { "iphash", NULL },
8484 .revision = 0,
116116
117117 .usage = hash_ip_usage,
118118 };
119
120 void _init(void);
121 void _init(void)
122 {
123 ipset_type_add(&ipset_hash_ip0);
124 }
3535 },
3636 { .name = { "timeout", NULL },
3737 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
38 .parse = ipset_parse_uint32, .print = ipset_print_number,
38 .parse = ipset_parse_timeout, .print = ipset_print_number,
3939 },
4040 /* Backward compatibility */
4141 { .name = { "probes", NULL },
6464 static const struct ipset_arg hash_ipport_add_args[] = {
6565 { .name = { "timeout", NULL },
6666 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
67 .parse = ipset_parse_uint32, .print = ipset_print_number,
67 .parse = ipset_parse_timeout, .print = ipset_print_number,
6868 },
6969 { },
7070 };
8484 " Adding/deleting multiple elements with TCP/SCTP/UDP/UDPLITE\n"
8585 " port range is supported both for IPv4 and IPv6.\n";
8686
87 struct ipset_type ipset_hash_ipport1 = {
87 static struct ipset_type ipset_hash_ipport1 = {
8888 .name = "hash:ip,port",
8989 .alias = { "ipporthash", NULL },
9090 .revision = 1,
141141 .usage = hash_ipport1_usage,
142142 .usagefn = ipset_port_usage,
143143 };
144
145 void _init(void);
146 void _init(void)
147 {
148 ipset_type_add(&ipset_hash_ipport1);
149 }
3535 },
3636 { .name = { "timeout", NULL },
3737 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
38 .parse = ipset_parse_uint32, .print = ipset_print_number,
38 .parse = ipset_parse_timeout, .print = ipset_print_number,
3939 },
4040 /* Backward compatibility */
4141 { .name = { "probes", NULL },
6464 static const struct ipset_arg hash_ipportip_add_args[] = {
6565 { .name = { "timeout", NULL },
6666 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
67 .parse = ipset_parse_uint32, .print = ipset_print_number,
67 .parse = ipset_parse_timeout, .print = ipset_print_number,
6868 },
6969 { },
7070 };
8484 " Adding/deleting multiple elements with TCP/SCTP/UDP/UDPLITE\n"
8585 " port range is supported both for IPv4 and IPv6.\n";
8686
87 struct ipset_type ipset_hash_ipportip1 = {
87 static struct ipset_type ipset_hash_ipportip1 = {
8888 .name = "hash:ip,port,ip",
8989 .alias = { "ipportiphash", NULL },
9090 .revision = 1,
152152 .usage = hash_ipportip1_usage,
153153 .usagefn = ipset_port_usage,
154154 };
155
156 void _init(void);
157 void _init(void)
158 {
159 ipset_type_add(&ipset_hash_ipportip1);
160 }
3535 },
3636 { .name = { "timeout", NULL },
3737 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
38 .parse = ipset_parse_uint32, .print = ipset_print_number,
38 .parse = ipset_parse_timeout, .print = ipset_print_number,
3939 },
4040 /* Backward compatibility */
4141 { .name = { "probes", NULL },
6464 static const struct ipset_arg hash_ipportnet_add_args[] = {
6565 { .name = { "timeout", NULL },
6666 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
67 .parse = ipset_parse_uint32, .print = ipset_print_number,
67 .parse = ipset_parse_timeout, .print = ipset_print_number,
6868 },
6969 { },
7070 };
8585 " Adding/deleting multiple elements with TCP/SCTP/UDP/UDPLITE\n"
8686 " port range is supported both for IPv4 and IPv6.\n";
8787
88 struct ipset_type ipset_hash_ipportnet1 = {
88 static struct ipset_type ipset_hash_ipportnet1 = {
8989 .name = "hash:ip,port,net",
9090 .alias = { "ipportnethash", NULL },
9191 .revision = 1,
175175 " Adding/deleting multiple elements with TCP/SCTP/UDP/UDPLITE\n"
176176 " port range is supported both for IPv4 and IPv6.\n";
177177
178 struct ipset_type ipset_hash_ipportnet2 = {
178 static struct ipset_type ipset_hash_ipportnet2 = {
179179 .name = "hash:ip,port,net",
180180 .alias = { "ipportnethash", NULL },
181181 .revision = 2,
254254 static const struct ipset_arg hash_ipportnet3_add_args[] = {
255255 { .name = { "timeout", NULL },
256256 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
257 .parse = ipset_parse_uint32, .print = ipset_print_number,
257 .parse = ipset_parse_timeout, .print = ipset_print_number,
258258 },
259259 { .name = { "nomatch", NULL },
260260 .has_arg = IPSET_NO_ARG, .opt = IPSET_OPT_NOMATCH,
279279 " Adding/deleting multiple elements with TCP/SCTP/UDP/UDPLITE\n"
280280 " port range is supported both for IPv4 and IPv6.\n";
281281
282 struct ipset_type ipset_hash_ipportnet3 = {
282 static struct ipset_type ipset_hash_ipportnet3 = {
283283 .name = "hash:ip,port,net",
284284 .alias = { "ipportnethash", NULL },
285285 .revision = 3,
356356 .usagefn = ipset_port_usage,
357357 };
358358
359 void _init(void);
360 void _init(void)
361 {
362 ipset_type_add(&ipset_hash_ipportnet1);
363 ipset_type_add(&ipset_hash_ipportnet2);
364 ipset_type_add(&ipset_hash_ipportnet3);
365 }
3434 },
3535 { .name = { "timeout", NULL },
3636 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
37 .parse = ipset_parse_uint32, .print = ipset_print_number,
37 .parse = ipset_parse_timeout, .print = ipset_print_number,
3838 },
3939 /* Ignored options: backward compatibilty */
4040 { .name = { "probes", NULL },
5151 static const struct ipset_arg hash_net_add_args[] = {
5252 { .name = { "timeout", NULL },
5353 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
54 .parse = ipset_parse_uint32, .print = ipset_print_number,
54 .parse = ipset_parse_timeout, .print = ipset_print_number,
5555 },
5656 { },
5757 };
6868 " IP is an IPv4 or IPv6 address (or hostname),\n"
6969 " CIDR is a valid IPv4 or IPv6 CIDR prefix.\n";
7070
71 struct ipset_type ipset_hash_net0 = {
71 static struct ipset_type ipset_hash_net0 = {
7272 .name = "hash:net",
7373 .alias = { "nethash", NULL },
7474 .revision = 0,
120120 " CIDR is a valid IPv4 or IPv6 CIDR prefix.\n"
121121 " IP range is not supported with IPv6.\n";
122122
123 struct ipset_type ipset_hash_net1 = {
123 static struct ipset_type ipset_hash_net1 = {
124124 .name = "hash:net",
125125 .alias = { "nethash", NULL },
126126 .revision = 1,
164164 static const struct ipset_arg hash_net2_add_args[] = {
165165 { .name = { "timeout", NULL },
166166 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
167 .parse = ipset_parse_uint32, .print = ipset_print_number,
167 .parse = ipset_parse_timeout, .print = ipset_print_number,
168168 },
169169 { .name = { "nomatch", NULL },
170170 .has_arg = IPSET_NO_ARG, .opt = IPSET_OPT_NOMATCH,
186186 " CIDR is a valid IPv4 or IPv6 CIDR prefix.\n"
187187 " IP range is not supported with IPv6.\n";
188188
189 struct ipset_type ipset_hash_net2 = {
189 static struct ipset_type ipset_hash_net2 = {
190190 .name = "hash:net",
191191 .alias = { "nethash", NULL },
192192 .revision = 2,
228228 .usage = hash_net2_usage,
229229 };
230230
231 void _init(void);
232 void _init(void)
233 {
234 ipset_type_add(&ipset_hash_net0);
235 ipset_type_add(&ipset_hash_net1);
236 ipset_type_add(&ipset_hash_net2);
237 }
3535 },
3636 { .name = { "timeout", NULL },
3737 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
38 .parse = ipset_parse_uint32, .print = ipset_print_number,
38 .parse = ipset_parse_timeout, .print = ipset_print_number,
3939 },
4040 { },
4141 };
4343 static const struct ipset_arg hash_netiface_add_args[] = {
4444 { .name = { "timeout", NULL },
4545 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
46 .parse = ipset_parse_uint32, .print = ipset_print_number,
46 .parse = ipset_parse_timeout, .print = ipset_print_number,
4747 },
4848 { },
4949 };
6161 " CIDR is a valid IPv4 or IPv6 CIDR prefix.\n"
6262 " Adding/deleting multiple elements with IPv4 is supported.\n";
6363
64 struct ipset_type ipset_hash_netiface0 = {
64 static struct ipset_type ipset_hash_netiface0 = {
6565 .name = "hash:net,iface",
6666 .alias = { "netifacehash", NULL },
6767 .revision = 0,
120120 static const struct ipset_arg hash_netiface1_add_args[] = {
121121 { .name = { "timeout", NULL },
122122 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
123 .parse = ipset_parse_uint32, .print = ipset_print_number,
123 .parse = ipset_parse_timeout, .print = ipset_print_number,
124124 },
125125 { .name = { "nomatch", NULL },
126126 .has_arg = IPSET_NO_ARG, .opt = IPSET_OPT_NOMATCH,
142142 " CIDR is a valid IPv4 or IPv6 CIDR prefix.\n"
143143 " Adding/deleting multiple elements with IPv4 is supported.\n";
144144
145 struct ipset_type ipset_hash_netiface1 = {
145 static struct ipset_type ipset_hash_netiface1 = {
146146 .name = "hash:net,iface",
147147 .alias = { "netifacehash", NULL },
148148 .revision = 1,
199199 .usage = hash_netiface1_usage,
200200 };
201201
202 void _init(void);
203 void _init(void)
204 {
205 ipset_type_add(&ipset_hash_netiface0);
206 ipset_type_add(&ipset_hash_netiface1);
207 }
3535 },
3636 { .name = { "timeout", NULL },
3737 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
38 .parse = ipset_parse_uint32, .print = ipset_print_number,
38 .parse = ipset_parse_timeout, .print = ipset_print_number,
3939 },
4040 { },
4141 };
4343 static const struct ipset_arg hash_netport_add_args[] = {
4444 { .name = { "timeout", NULL },
4545 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
46 .parse = ipset_parse_uint32, .print = ipset_print_number,
46 .parse = ipset_parse_timeout, .print = ipset_print_number,
4747 },
4848 { },
4949 };
6262 " Adding/deleting multiple elements with TCP/SCTP/UDP/UDPLITE\n"
6363 " port range is supported both for IPv4 and IPv6.\n";
6464
65 struct ipset_type ipset_hash_netport1 = {
65 static struct ipset_type ipset_hash_netport1 = {
6666 .name = "hash:net,port",
6767 .alias = { "netporthash", NULL },
6868 .revision = 1,
136136 " Adding/deleting multiple elements with TCP/SCTP/UDP/UDPLITE\n"
137137 " port range is supported both for IPv4 and IPv6.\n";
138138
139 struct ipset_type ipset_hash_netport2 = {
139 static struct ipset_type ipset_hash_netport2 = {
140140 .name = "hash:net,port",
141141 .alias = { "netporthash", NULL },
142142 .revision = 2,
200200 static const struct ipset_arg hash_netport3_add_args[] = {
201201 { .name = { "timeout", NULL },
202202 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
203 .parse = ipset_parse_uint32, .print = ipset_print_number,
203 .parse = ipset_parse_timeout, .print = ipset_print_number,
204204 },
205205 { .name = { "nomatch", NULL },
206206 .has_arg = IPSET_NO_ARG, .opt = IPSET_OPT_NOMATCH,
224224 " Adding/deleting multiple elements with TCP/SCTP/UDP/UDPLITE\n"
225225 " port range is supported both for IPv4 and IPv6.\n";
226226
227 struct ipset_type ipset_hash_netport3 = {
227 static struct ipset_type ipset_hash_netport3 = {
228228 .name = "hash:net,port",
229229 .alias = { "netporthash", NULL },
230230 .revision = 3,
285285 .usage = hash_netport3_usage,
286286 .usagefn = ipset_port_usage,
287287 };
288
289 void _init(void);
290 void _init(void)
291 {
292 ipset_type_add(&ipset_hash_netport1);
293 ipset_type_add(&ipset_hash_netport2);
294 ipset_type_add(&ipset_hash_netport3);
295 }
1616 },
1717 { .name = { "timeout", NULL },
1818 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
19 .parse = ipset_parse_uint32, .print = ipset_print_number,
19 .parse = ipset_parse_timeout, .print = ipset_print_number,
2020 },
2121 { },
2222 };
2424 static const struct ipset_arg list_set_adt_args[] = {
2525 { .name = { "timeout", NULL },
2626 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_TIMEOUT,
27 .parse = ipset_parse_uint32, .print = ipset_print_number,
27 .parse = ipset_parse_timeout, .print = ipset_print_number,
2828 },
2929 { .name = { "before", NULL },
3030 .has_arg = IPSET_MANDATORY_ARG, .opt = IPSET_OPT_NAMEREF,
4545 "test SETNAME NAME [before|after NAME]\n\n"
4646 "where NAME are existing set names.\n";
4747
48 struct ipset_type ipset_list_set0 = {
48 static struct ipset_type ipset_list_set0 = {
4949 .name = "list:set",
5050 .alias = { "setlist", NULL },
5151 .revision = 0,
8888
8989 .usage = list_set_usage,
9090 };
91
92 void _init(void);
93 void _init(void)
94 {
95 ipset_type_add(&ipset_list_set0);
96 }
105105 ipset_match_option;
106106 ipset_match_envopt;
107107 ipset_shift_argv;
108 ipset_port_usage;
109108
110109 local: *;
111110 };
113112 LIBIPSET_2.0 {
114113 global:
115114 ipset_load_types;
115 ipset_port_usage;
116 ipset_parse_timeout;
117 ipset_data_test_ignored;
116118 } LIBIPSET_1.0;
650650 assert(str);
651651
652652 data = ipset_session_data(session);
653 if (ipset_data_flags_test(data, IPSET_FLAG(IPSET_OPT_FAMILY)))
653 if (ipset_data_flags_test(data, IPSET_FLAG(IPSET_OPT_FAMILY))
654 && !ipset_data_test_ignored(data, IPSET_OPT_FAMILY))
654655 syntax_err("protocol family may not be specified "
655656 "multiple times");
656657
11291130 }
11301131
11311132 /**
1133 * ipset_parse_timeout - parse timeout parameter
1134 * @session: session structure
1135 * @opt: option kind of the data
1136 * @str: string to parse
1137 *
1138 * Parse string as a timeout parameter. We have to take into account
1139 * the jiffies storage in kernel.
1140 *
1141 * Returns 0 on success or a negative error code.
1142 */
1143 int
1144 ipset_parse_timeout(struct ipset_session *session,
1145 enum ipset_opt opt, const char *str)
1146 {
1147 int err;
1148 unsigned long long num = 0;
1149
1150 assert(session);
1151 assert(opt == IPSET_OPT_TIMEOUT);
1152 assert(str);
1153
1154 err = string_to_number_ll(session, str, 0, UINT_MAX/1000, &num);
1155 if (err == 0)
1156 return ipset_session_data_set(session, opt, &num);
1157
1158 return err;
1159 }
1160
1161 /**
11321162 * ipset_parse_iptimeout - parse IPv4|IPv6 address and timeout
11331163 * @session: session structure
11341164 * @opt: option kind of the data
11701200 *a++ = '\0';
11711201 err = parse_ip(session, opt, tmp, IPADDR_ANY);
11721202 if (!err)
1173 err = ipset_parse_uint32(session, IPSET_OPT_TIMEOUT, a);
1203 err = ipset_parse_timeout(session, IPSET_OPT_TIMEOUT, a);
11741204
11751205 free(saved);
11761206 return err;
15241554 if (STREQ(str, "physdev:")) {
15251555 offset = 8;
15261556 err = ipset_data_set(data, IPSET_OPT_PHYSDEV, str);
1557 if (err < 0)
1558 return err;
15271559 }
15281560 if (strlen(str + offset) > IFNAMSIZ - 1)
15291561 return syntax_err("interface name '%s' is longer "
16051637 const struct ipset_arg *arg,
16061638 const char *str)
16071639 {
1608 if (ipset_data_flags_test(ipset_session_data(session),
1609 IPSET_FLAG(arg->opt)))
1610 syntax_err("%s already specified", arg->name[0]);
1640 struct ipset_data *data = ipset_session_data(session);
1641
1642 if (ipset_data_flags_test(data, IPSET_FLAG(arg->opt))
1643 && !(arg->opt == IPSET_OPT_FAMILY
1644 && ipset_data_test_ignored(data, IPSET_OPT_FAMILY)))
1645 return syntax_err("%s already specified", arg->name[0]);
16111646
16121647 return arg->parse(session, arg->opt, str);
16131648 }
737737 const struct ipset_data *data = session->data;
738738 const struct ipset_type *type;
739739 const struct ipset_arg *arg;
740 uint8_t family;
741740 int i, found = 0;
742741
743742 D("enter");
749748
750749 if (type == NULL)
751750 return MNL_CB_ERROR;
752 family = ipset_data_family(data);
753751
754752 for (i = IPSET_ATTR_UNSPEC + 1; i <= IPSET_ATTR_ADT_MAX; i++)
755753 if (nla[i]) {
14651463 return 1;
14661464
14671465 switch (attr->type) {
1466 case MNL_TYPE_U32: {
1467 uint32_t value = htonl(*(const uint32_t *)d);
1468
1469 mnl_attr_put(nlh, type | flags, alen, &value);
1470 return 0;
1471 }
1472 case MNL_TYPE_U16: {
1473 uint16_t value = htons(*(const uint16_t *)d);
1474
1475 mnl_attr_put(nlh, type | flags, alen, &value);
1476 return 0;
1477 }
14681478 case MNL_TYPE_NUL_STRING:
14691479 alen = strlen((const char *)d) + 1;
14701480 break;
1471 case MNL_TYPE_U32: {
1472 uint32_t value = htonl(*(const uint32_t *)d);
1473
1474 d = &value;
1475 break;
1476 }
1477 case MNL_TYPE_U16: {
1478 uint16_t value = htons(*(const uint16_t *)d);
1479
1480 d = &value;
1481 break;
1482 }
14831481 default:
14841482 break;
14851483 }
1818 #include <libipset/utils.h> /* STREQ */
1919 #include <libipset/types.h> /* prototypes */
2020
21 /* The known set types: (typename, revision, family) is unique */
22 extern struct ipset_type ipset_bitmap_ip0;
23 extern struct ipset_type ipset_bitmap_ipmac0;
24 extern struct ipset_type ipset_bitmap_port0;
25 extern struct ipset_type ipset_hash_ip0;
26 extern struct ipset_type ipset_hash_net0;
27 extern struct ipset_type ipset_hash_net1;
28 extern struct ipset_type ipset_hash_net2;
29 extern struct ipset_type ipset_hash_netport1;
30 extern struct ipset_type ipset_hash_netport2;
31 extern struct ipset_type ipset_hash_netport3;
32 extern struct ipset_type ipset_hash_netiface0;
33 extern struct ipset_type ipset_hash_netiface1;
34 extern struct ipset_type ipset_hash_ipport1;
35 extern struct ipset_type ipset_hash_ipportip1;
36 extern struct ipset_type ipset_hash_ipportnet1;
37 extern struct ipset_type ipset_hash_ipportnet2;
38 extern struct ipset_type ipset_hash_ipportnet3;
39 extern struct ipset_type ipset_list_set0;
21 #ifdef ENABLE_SETTYPE_MODULES
22 #include <dlfcn.h>
23 #include <sys/types.h>
24 #include <dirent.h>
25 #endif
4026
4127 /* Userspace cache of sets which exists in the kernel */
4228
220206 uint8_t family, tmin = 0, tmax = 0;
221207 uint8_t kmin, kmax;
222208 int ret;
209 bool ignore_family = false;
223210
224211 data = ipset_session_data(session);
225212 assert(data);
251238 family = match->family == NFPROTO_IPSET_IPV46 ?
252239 NFPROTO_IPV4 : match->family;
253240 ipset_data_set(data, IPSET_OPT_FAMILY, &family);
241 if (match->family == NFPROTO_IPSET_IPV46)
242 ignore_family = true;
254243 }
255244
256245 if (match->kernel_check == IPSET_KERNEL_OK)
307296 found:
308297 ipset_data_set(data, IPSET_OPT_TYPE, match);
309298
299 if (ignore_family) {
300 /* Overload ignored flag */
301 D("set ignored flag to FAMILY");
302 ipset_data_ignored(data, IPSET_OPT_FAMILY);
303 }
310304 return match;
311305 }
312306
403397
404398 switch (cmd) {
405399 case IPSET_CMD_CREATE:
406 return create_type_get(session);
400 return ipset_data_test(ipset_session_data(session),
401 IPSET_OPT_TYPE)
402 ? ipset_data_get(ipset_session_data(session),
403 IPSET_OPT_TYPE)
404 : create_type_get(session);
407405 case IPSET_CMD_ADD:
408406 case IPSET_CMD_DEL:
409407 case IPSET_CMD_TEST:
582580 void
583581 ipset_load_types(void)
584582 {
583 #ifdef ENABLE_SETTYPE_MODULES
584 const char *dir = IPSET_MODSDIR;
585 const char *next = NULL;
586 char path[256];
587 char file[256];
588 struct dirent **list = NULL;
589 int n;
590 int len;
591 #endif
592
585593 if (typelist != NULL)
586594 return;
587595
588 ipset_type_add(&ipset_bitmap_ip0);
589 ipset_type_add(&ipset_bitmap_ipmac0);
590 ipset_type_add(&ipset_bitmap_port0);
591 ipset_type_add(&ipset_hash_ip0);
592 ipset_type_add(&ipset_hash_net0);
593 ipset_type_add(&ipset_hash_net1);
594 ipset_type_add(&ipset_hash_net2);
595 ipset_type_add(&ipset_hash_netport1);
596 ipset_type_add(&ipset_hash_netport2);
597 ipset_type_add(&ipset_hash_netport3);
598 ipset_type_add(&ipset_hash_netiface0);
599 ipset_type_add(&ipset_hash_netiface1);
600 ipset_type_add(&ipset_hash_ipport1);
601 ipset_type_add(&ipset_hash_ipportip1);
602 ipset_type_add(&ipset_hash_ipportnet1);
603 ipset_type_add(&ipset_hash_ipportnet2);
604 ipset_type_add(&ipset_hash_ipportnet3);
605 ipset_type_add(&ipset_list_set0);
606 }
596 /* Initialize static types */
597 ipset_types_init();
598
599 #ifdef ENABLE_SETTYPE_MODULES
600 /* Initialize dynamic types */
601 do {
602 next = strchr(dir, ':');
603 if (next == NULL)
604 next = dir + strlen(dir);
605
606 len = snprintf(path, sizeof(path), "%.*s",
607 (unsigned int)(next - dir), dir);
608
609 if (len >= sizeof(path) || len < 0)
610 continue;
611
612 n = scandir(path, &list, NULL, alphasort);
613 if (n < 0)
614 continue;
615
616 while (n--) {
617 if (strstr(list[n]->d_name, ".so") == NULL)
618 goto nextf;
619
620 len = snprintf(file, sizeof(file), "%s/%s", path, list[n]->d_name);
621 if (len >= sizeof(file) || len < 0)
622 goto nextf;
623
624 if (dlopen(file, RTLD_NOW) == NULL) {
625 fprintf(stderr, "%s: %s\n", file, dlerror());
626 }
627
628 nextf:
629 free(list[n]);
630 }
631
632 free(list);
633
634 dir = next + 1;
635 } while (*next != '\0');
636 #endif // ENABLE_SETTYPE_MODULES
637 }
0 /* Copyright 2007-2010 Jozsef Kadlecsik (kadlec@blackhole.kfki.hu)
1 *
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation.
5 */
6
7 #include <stdio.h> /* printf */
8 #include <libipset/icmp.h> /* id_to_icmp */
9 #include <libipset/icmpv6.h> /* id_to_icmpv6 */
10 #include <libipset/ui.h> /* prototypes */
11
12 /**
13 * ipset_port_usage - prints the usage for the port parameter
14 *
15 * Print the usage for the port parameter to stdout.
16 */
17 void
18 ipset_port_usage(void)
19 {
20 int i;
21 const char *name;
22
23 printf(" [PROTO:]PORT is a valid pattern of the following:\n"
24 " PORTNAME TCP port name from /etc/services\n"
25 " PORTNUMBER TCP port number identifier\n"
26 " tcp|sctp|udp|udplite:PORTNAME|PORTNUMBER\n"
27 " icmp:CODENAME supported ICMP codename\n"
28 " icmp:TYPE/CODE ICMP type/code value\n"
29 " icmpv6:CODENAME supported ICMPv6 codename\n"
30 " icmpv6:TYPE/CODE ICMPv6 type/code value\n"
31 " PROTO:0 all other protocols\n\n");
32
33 printf(" Supported ICMP codenames:\n");
34 i = 0;
35 while ((name = id_to_icmp(i++)) != NULL)
36 printf(" %s\n", name);
37 printf(" Supported ICMPv6 codenames:\n");
38 i = 0;
39 while ((name = id_to_icmpv6(i++)) != NULL)
40 printf(" %s\n", name);
41 }
0
1 GNU LESSER GENERAL PUBLIC LICENSE
2 Version 2.1, February 1999
3
4 Copyright (C) 1991, 1999 Free Software Foundation, Inc.
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9 [This is the first released version of the Lesser GPL. It also counts
10 as the successor of the GNU Library Public License, version 2, hence
11 the version number 2.1.]
12
13 Preamble
14
15 The licenses for most software are designed to take away your
16 freedom to share and change it. By contrast, the GNU General Public
17 Licenses are intended to guarantee your freedom to share and change
18 free software--to make sure the software is free for all its users.
19
20 This license, the Lesser General Public License, applies to some
21 specially designated software packages--typically libraries--of the
22 Free Software Foundation and other authors who decide to use it. You
23 can use it too, but we suggest you first think carefully about whether
24 this license or the ordinary General Public License is the better
25 strategy to use in any particular case, based on the explanations
26 below.
27
28 When we speak of free software, we are referring to freedom of use,
29 not price. Our General Public Licenses are designed to make sure that
30 you have the freedom to distribute copies of free software (and charge
31 for this service if you wish); that you receive source code or can get
32 it if you want it; that you can change the software and use pieces of
33 it in new free programs; and that you are informed that you can do
34 these things.
35
36 To protect your rights, we need to make restrictions that forbid
37 distributors to deny you these rights or to ask you to surrender these
38 rights. These restrictions translate to certain responsibilities for
39 you if you distribute copies of the library or if you modify it.
40
41 For example, if you distribute copies of the library, whether gratis
42 or for a fee, you must give the recipients all the rights that we gave
43 you. You must make sure that they, too, receive or can get the source
44 code. If you link other code with the library, you must provide
45 complete object files to the recipients, so that they can relink them
46 with the library after making changes to the library and recompiling
47 it. And you must show them these terms so they know their rights.
48
49 We protect your rights with a two-step method: (1) we copyright the
50 library, and (2) we offer you this license, which gives you legal
51 permission to copy, distribute and/or modify the library.
52
53 To protect each distributor, we want to make it very clear that
54 there is no warranty for the free library. Also, if the library is
55 modified by someone else and passed on, the recipients should know
56 that what they have is not the original version, so that the original
57 author's reputation will not be affected by problems that might be
58 introduced by others.
59 ^L
60 Finally, software patents pose a constant threat to the existence of
61 any free program. We wish to make sure that a company cannot
62 effectively restrict the users of a free program by obtaining a
63 restrictive license from a patent holder. Therefore, we insist that
64 any patent license obtained for a version of the library must be
65 consistent with the full freedom of use specified in this license.
66
67 Most GNU software, including some libraries, is covered by the
68 ordinary GNU General Public License. This license, the GNU Lesser
69 General Public License, applies to certain designated libraries, and
70 is quite different from the ordinary General Public License. We use
71 this license for certain libraries in order to permit linking those
72 libraries into non-free programs.
73
74 When a program is linked with a library, whether statically or using
75 a shared library, the combination of the two is legally speaking a
76 combined work, a derivative of the original library. The ordinary
77 General Public License therefore permits such linking only if the
78 entire combination fits its criteria of freedom. The Lesser General
79 Public License permits more lax criteria for linking other code with
80 the library.
81
82 We call this license the "Lesser" General Public License because it
83 does Less to protect the user's freedom than the ordinary General
84 Public License. It also provides other free software developers Less
85 of an advantage over competing non-free programs. These disadvantages
86 are the reason we use the ordinary General Public License for many
87 libraries. However, the Lesser license provides advantages in certain
88 special circumstances.
89
90 For example, on rare occasions, there may be a special need to
91 encourage the widest possible use of a certain library, so that it
92 becomes
93 a de-facto standard. To achieve this, non-free programs must be
94 allowed to use the library. A more frequent case is that a free
95 library does the same job as widely used non-free libraries. In this
96 case, there is little to gain by limiting the free library to free
97 software only, so we use the Lesser General Public License.
98
99 In other cases, permission to use a particular library in non-free
100 programs enables a greater number of people to use a large body of
101 free software. For example, permission to use the GNU C Library in
102 non-free programs enables many more people to use the whole GNU
103 operating system, as well as its variant, the GNU/Linux operating
104 system.
105
106 Although the Lesser General Public License is Less protective of the
107 users' freedom, it does ensure that the user of a program that is
108 linked with the Library has the freedom and the wherewithal to run
109 that program using a modified version of the Library.
110
111 The precise terms and conditions for copying, distribution and
112 modification follow. Pay close attention to the difference between a
113 "work based on the library" and a "work that uses the library". The
114 former contains code derived from the library, whereas the latter must
115 be combined with the library in order to run.
116 ^L
117 GNU LESSER GENERAL PUBLIC LICENSE
118 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
119
120 0. This License Agreement applies to any software library or other
121 program which contains a notice placed by the copyright holder or
122 other authorized party saying it may be distributed under the terms of
123 this Lesser General Public License (also called "this License").
124 Each licensee is addressed as "you".
125
126 A "library" means a collection of software functions and/or data
127 prepared so as to be conveniently linked with application programs
128 (which use some of those functions and data) to form executables.
129
130 The "Library", below, refers to any such software library or work
131 which has been distributed under these terms. A "work based on the
132 Library" means either the Library or any derivative work under
133 copyright law: that is to say, a work containing the Library or a
134 portion of it, either verbatim or with modifications and/or translated
135 straightforwardly into another language. (Hereinafter, translation is
136 included without limitation in the term "modification".)
137
138 "Source code" for a work means the preferred form of the work for
139 making modifications to it. For a library, complete source code means
140 all the source code for all modules it contains, plus any associated
141 interface definition files, plus the scripts used to control
142 compilation
143 and installation of the library.
144
145 Activities other than copying, distribution and modification are not
146 covered by this License; they are outside its scope. The act of
147 running a program using the Library is not restricted, and output from
148 such a program is covered only if its contents constitute a work based
149 on the Library (independent of the use of the Library in a tool for
150 writing it). Whether that is true depends on what the Library does
151 and what the program that uses the Library does.
152
153 1. You may copy and distribute verbatim copies of the Library's
154 complete source code as you receive it, in any medium, provided that
155 you conspicuously and appropriately publish on each copy an
156 appropriate copyright notice and disclaimer of warranty; keep intact
157 all the notices that refer to this License and to the absence of any
158 warranty; and distribute a copy of this License along with the
159 Library.
160
161 You may charge a fee for the physical act of transferring a copy,
162 and you may at your option offer warranty protection in exchange for a
163 fee.
164
165 2. You may modify your copy or copies of the Library or any portion
166 of it, thus forming a work based on the Library, and copy and
167 distribute such modifications or work under the terms of Section 1
168 above, provided that you also meet all of these conditions:
169
170 a) The modified work must itself be a software library.
171
172 b) You must cause the files modified to carry prominent notices
173 stating that you changed the files and the date of any change.
174
175 c) You must cause the whole of the work to be licensed at no
176 charge to all third parties under the terms of this License.
177
178 d) If a facility in the modified Library refers to a function or a
179 table of data to be supplied by an application program that uses
180 the facility, other than as an argument passed when the facility
181 is invoked, then you must make a good faith effort to ensure that,
182 in the event an application does not supply such function or
183 table, the facility still operates, and performs whatever part of
184 its purpose remains meaningful.
185
186 (For example, a function in a library to compute square roots has
187 a purpose that is entirely well-defined independent of the
188 application. Therefore, Subsection 2d requires that any
189 application-supplied function or table used by this function must
190 be optional: if the application does not supply it, the square
191 root function must still compute square roots.)
192
193 These requirements apply to the modified work as a whole. If
194 identifiable sections of that work are not derived from the Library,
195 and can be reasonably considered independent and separate works in
196 themselves, then this License, and its terms, do not apply to those
197 sections when you distribute them as separate works. But when you
198 distribute the same sections as part of a whole which is a work based
199 on the Library, the distribution of the whole must be on the terms of
200 this License, whose permissions for other licensees extend to the
201 entire whole, and thus to each and every part regardless of who wrote
202 it.
203
204 Thus, it is not the intent of this section to claim rights or contest
205 your rights to work written entirely by you; rather, the intent is to
206 exercise the right to control the distribution of derivative or
207 collective works based on the Library.
208
209 In addition, mere aggregation of another work not based on the Library
210 with the Library (or with a work based on the Library) on a volume of
211 a storage or distribution medium does not bring the other work under
212 the scope of this License.
213
214 3. You may opt to apply the terms of the ordinary GNU General Public
215 License instead of this License to a given copy of the Library. To do
216 this, you must alter all the notices that refer to this License, so
217 that they refer to the ordinary GNU General Public License, version 2,
218 instead of to this License. (If a newer version than version 2 of the
219 ordinary GNU General Public License has appeared, then you can specify
220 that version instead if you wish.) Do not make any other change in
221 these notices.
222 ^L
223 Once this change is made in a given copy, it is irreversible for
224 that copy, so the ordinary GNU General Public License applies to all
225 subsequent copies and derivative works made from that copy.
226
227 This option is useful when you wish to copy part of the code of
228 the Library into a program that is not a library.
229
230 4. You may copy and distribute the Library (or a portion or
231 derivative of it, under Section 2) in object code or executable form
232 under the terms of Sections 1 and 2 above provided that you accompany
233 it with the complete corresponding machine-readable source code, which
234 must be distributed under the terms of Sections 1 and 2 above on a
235 medium customarily used for software interchange.
236
237 If distribution of object code is made by offering access to copy
238 from a designated place, then offering equivalent access to copy the
239 source code from the same place satisfies the requirement to
240 distribute the source code, even though third parties are not
241 compelled to copy the source along with the object code.
242
243 5. A program that contains no derivative of any portion of the
244 Library, but is designed to work with the Library by being compiled or
245 linked with it, is called a "work that uses the Library". Such a
246 work, in isolation, is not a derivative work of the Library, and
247 therefore falls outside the scope of this License.
248
249 However, linking a "work that uses the Library" with the Library
250 creates an executable that is a derivative of the Library (because it
251 contains portions of the Library), rather than a "work that uses the
252 library". The executable is therefore covered by this License.
253 Section 6 states terms for distribution of such executables.
254
255 When a "work that uses the Library" uses material from a header file
256 that is part of the Library, the object code for the work may be a
257 derivative work of the Library even though the source code is not.
258 Whether this is true is especially significant if the work can be
259 linked without the Library, or if the work is itself a library. The
260 threshold for this to be true is not precisely defined by law.
261
262 If such an object file uses only numerical parameters, data
263 structure layouts and accessors, and small macros and small inline
264 functions (ten lines or less in length), then the use of the object
265 file is unrestricted, regardless of whether it is legally a derivative
266 work. (Executables containing this object code plus portions of the
267 Library will still fall under Section 6.)
268
269 Otherwise, if the work is a derivative of the Library, you may
270 distribute the object code for the work under the terms of Section 6.
271 Any executables containing that work also fall under Section 6,
272 whether or not they are linked directly with the Library itself.
273 ^L
274 6. As an exception to the Sections above, you may also combine or
275 link a "work that uses the Library" with the Library to produce a
276 work containing portions of the Library, and distribute that work
277 under terms of your choice, provided that the terms permit
278 modification of the work for the customer's own use and reverse
279 engineering for debugging such modifications.
280
281 You must give prominent notice with each copy of the work that the
282 Library is used in it and that the Library and its use are covered by
283 this License. You must supply a copy of this License. If the work
284 during execution displays copyright notices, you must include the
285 copyright notice for the Library among them, as well as a reference
286 directing the user to the copy of this License. Also, you must do one
287 of these things:
288
289 a) Accompany the work with the complete corresponding
290 machine-readable source code for the Library including whatever
291 changes were used in the work (which must be distributed under
292 Sections 1 and 2 above); and, if the work is an executable linked
293 with the Library, with the complete machine-readable "work that
294 uses the Library", as object code and/or source code, so that the
295 user can modify the Library and then relink to produce a modified
296 executable containing the modified Library. (It is understood
297 that the user who changes the contents of definitions files in the
298 Library will not necessarily be able to recompile the application
299 to use the modified definitions.)
300
301 b) Use a suitable shared library mechanism for linking with the
302 Library. A suitable mechanism is one that (1) uses at run time a
303 copy of the library already present on the user's computer system,
304 rather than copying library functions into the executable, and (2)
305 will operate properly with a modified version of the library, if
306 the user installs one, as long as the modified version is
307 interface-compatible with the version that the work was made with.
308
309 c) Accompany the work with a written offer, valid for at
310 least three years, to give the same user the materials
311 specified in Subsection 6a, above, for a charge no more
312 than the cost of performing this distribution.
313
314 d) If distribution of the work is made by offering access to copy
315 from a designated place, offer equivalent access to copy the above
316 specified materials from the same place.
317
318 e) Verify that the user has already received a copy of these
319 materials or that you have already sent this user a copy.
320
321 For an executable, the required form of the "work that uses the
322 Library" must include any data and utility programs needed for
323 reproducing the executable from it. However, as a special exception,
324 the materials to be distributed need not include anything that is
325 normally distributed (in either source or binary form) with the major
326 components (compiler, kernel, and so on) of the operating system on
327 which the executable runs, unless that component itself accompanies
328 the executable.
329
330 It may happen that this requirement contradicts the license
331 restrictions of other proprietary libraries that do not normally
332 accompany the operating system. Such a contradiction means you cannot
333 use both them and the Library together in an executable that you
334 distribute.
335 ^L
336 7. You may place library facilities that are a work based on the
337 Library side-by-side in a single library together with other library
338 facilities not covered by this License, and distribute such a combined
339 library, provided that the separate distribution of the work based on
340 the Library and of the other library facilities is otherwise
341 permitted, and provided that you do these two things:
342
343 a) Accompany the combined library with a copy of the same work
344 based on the Library, uncombined with any other library
345 facilities. This must be distributed under the terms of the
346 Sections above.
347
348 b) Give prominent notice with the combined library of the fact
349 that part of it is a work based on the Library, and explaining
350 where to find the accompanying uncombined form of the same work.
351
352 8. You may not copy, modify, sublicense, link with, or distribute
353 the Library except as expressly provided under this License. Any
354 attempt otherwise to copy, modify, sublicense, link with, or
355 distribute the Library is void, and will automatically terminate your
356 rights under this License. However, parties who have received copies,
357 or rights, from you under this License will not have their licenses
358 terminated so long as such parties remain in full compliance.
359
360 9. You are not required to accept this License, since you have not
361 signed it. However, nothing else grants you permission to modify or
362 distribute the Library or its derivative works. These actions are
363 prohibited by law if you do not accept this License. Therefore, by
364 modifying or distributing the Library (or any work based on the
365 Library), you indicate your acceptance of this License to do so, and
366 all its terms and conditions for copying, distributing or modifying
367 the Library or works based on it.
368
369 10. Each time you redistribute the Library (or any work based on the
370 Library), the recipient automatically receives a license from the
371 original licensor to copy, distribute, link with or modify the Library
372 subject to these terms and conditions. You may not impose any further
373 restrictions on the recipients' exercise of the rights granted herein.
374 You are not responsible for enforcing compliance by third parties with
375 this License.
376 ^L
377 11. If, as a consequence of a court judgment or allegation of patent
378 infringement or for any other reason (not limited to patent issues),
379 conditions are imposed on you (whether by court order, agreement or
380 otherwise) that contradict the conditions of this License, they do not
381 excuse you from the conditions of this License. If you cannot
382 distribute so as to satisfy simultaneously your obligations under this
383 License and any other pertinent obligations, then as a consequence you
384 may not distribute the Library at all. For example, if a patent
385 license would not permit royalty-free redistribution of the Library by
386 all those who receive copies directly or indirectly through you, then
387 the only way you could satisfy both it and this License would be to
388 refrain entirely from distribution of the Library.
389
390 If any portion of this section is held invalid or unenforceable under
391 any particular circumstance, the balance of the section is intended to
392 apply, and the section as a whole is intended to apply in other
393 circumstances.
394
395 It is not the purpose of this section to induce you to infringe any
396 patents or other property right claims or to contest validity of any
397 such claims; this section has the sole purpose of protecting the
398 integrity of the free software distribution system which is
399 implemented by public license practices. Many people have made
400 generous contributions to the wide range of software distributed
401 through that system in reliance on consistent application of that
402 system; it is up to the author/donor to decide if he or she is willing
403 to distribute software through any other system and a licensee cannot
404 impose that choice.
405
406 This section is intended to make thoroughly clear what is believed to
407 be a consequence of the rest of this License.
408
409 12. If the distribution and/or use of the Library is restricted in
410 certain countries either by patents or by copyrighted interfaces, the
411 original copyright holder who places the Library under this License
412 may add an explicit geographical distribution limitation excluding those
413 countries, so that distribution is permitted only in or among
414 countries not thus excluded. In such case, this License incorporates
415 the limitation as if written in the body of this License.
416
417 13. The Free Software Foundation may publish revised and/or new
418 versions of the Lesser General Public License from time to time.
419 Such new versions will be similar in spirit to the present version,
420 but may differ in detail to address new problems or concerns.
421
422 Each version is given a distinguishing version number. If the Library
423 specifies a version number of this License which applies to it and
424 "any later version", you have the option of following the terms and
425 conditions either of that version or of any later version published by
426 the Free Software Foundation. If the Library does not specify a
427 license version number, you may choose any version ever published by
428 the Free Software Foundation.
429 ^L
430 14. If you wish to incorporate parts of the Library into other free
431 programs whose distribution conditions are incompatible with these,
432 write to the author to ask for permission. For software which is
433 copyrighted by the Free Software Foundation, write to the Free
434 Software Foundation; we sometimes make exceptions for this. Our
435 decision will be guided by the two goals of preserving the free status
436 of all derivatives of our free software and of promoting the sharing
437 and reuse of software generally.
438
439 NO WARRANTY
440
441 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
442 WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
443 EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
444 OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
445 KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
446 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
447 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
448 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
449 THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
450
451 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
452 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
453 AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
454 FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
455 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
456 LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
457 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
458 FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
459 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
460 DAMAGES.
461
462 END OF TERMS AND CONDITIONS
463 ^L
464 How to Apply These Terms to Your New Libraries
465
466 If you develop a new library, and you want it to be of the greatest
467 possible use to the public, we recommend making it free software that
468 everyone can redistribute and change. You can do so by permitting
469 redistribution under these terms (or, alternatively, under the terms
470 of the ordinary General Public License).
471
472 To apply these terms, attach the following notices to the library.
473 It is safest to attach them to the start of each source file to most
474 effectively convey the exclusion of warranty; and each file should
475 have at least the "copyright" line and a pointer to where the full
476 notice is found.
477
478
479 <one line to give the library's name and a brief idea of what it
480 does.>
481 Copyright (C) <year> <name of author>
482
483 This library is free software; you can redistribute it and/or
484 modify it under the terms of the GNU Lesser General Public
485 License as published by the Free Software Foundation; either
486 version 2 of the License, or (at your option) any later version.
487
488 This library is distributed in the hope that it will be useful,
489 but WITHOUT ANY WARRANTY; without even the implied warranty of
490 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
491 Lesser General Public License for more details.
492
493 You should have received a copy of the GNU Lesser General Public
494 License along with this library; if not, write to the Free Software
495 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
496
497 Also add information on how to contact you by electronic and paper
498 mail.
499
500 You should also get your employer (if you work as a programmer) or
501 your
502 school, if any, to sign a "copyright disclaimer" for the library, if
503 necessary. Here is a sample; alter the names:
504
505 Yoyodyne, Inc., hereby disclaims all copyright interest in the
506 library `Frob' (a library for tweaking knobs) written by James
507 Random Hacker.
508
509 <signature of Ty Coon>, 1 April 1990
510 Ty Coon, President of Vice
511
512 That's all there is to it!
513
514
0 ## Makefile.inc -- includable Makefile.am snippet
1 ##
2 ## Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
3 ## Written by Gary V. Vaughan, 2003
4 ##
5 ## NOTE: The canonical source of this file is maintained with the
6 ## GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7 ##
8 ## GNU Libltdl is free software; you can redistribute it and/or
9 ## modify it under the terms of the GNU Lesser General Public
10 ## License as published by the Free Software Foundation; either
11 ## version 2 of the License, or (at your option) any later version.
12 ##
13 ## As a special exception to the GNU Lesser General Public License,
14 ## if you distribute this file as part of a program or library that
15 ## is built using GNU libtool, you may include this file under the
16 ## same distribution terms that you use for the rest of that program.
17 ##
18 ## GNU Libltdl is distributed in the hope that it will be useful,
19 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ## GNU Lesser General Public License for more details.
22 ##
23 ## You should have received a copy of the GNU LesserGeneral Public
24 ## License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 ## copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 ## or obtained by writing to the Free Software Foundation, Inc.,
27 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #####
29
30 ## DO NOT REMOVE THIS LINE -- make depends on it
31
32 # -I$(srcdir) is needed for user that built libltdl with a sub-Automake
33 # (not as a sub-package!) using 'nostdinc':
34 AM_CPPFLAGS += -DLT_CONFIG_H='<$(LT_CONFIG_H)>' \
35 -DLTDL -I. -I$(srcdir) -Ilibltdl \
36 -I$(srcdir)/libltdl -I$(srcdir)/libltdl/libltdl
37 AM_LDFLAGS += -no-undefined
38 LTDL_VERSION_INFO = -version-info 9:1:2
39
40 noinst_LTLIBRARIES += $(LT_DLLOADERS)
41
42 if INSTALL_LTDL
43 ltdlincludedir = $(includedir)/libltdl
44 ltdlinclude_HEADERS = libltdl/libltdl/lt_system.h \
45 libltdl/libltdl/lt_error.h \
46 libltdl/libltdl/lt_dlloader.h
47 include_HEADERS += libltdl/ltdl.h
48 lib_LTLIBRARIES += libltdl/libltdl.la
49 endif
50
51 if CONVENIENCE_LTDL
52 noinst_LTLIBRARIES += libltdl/libltdlc.la
53 endif
54
55 libltdl_libltdl_la_SOURCES = libltdl/libltdl/lt__alloc.h \
56 libltdl/libltdl/lt__dirent.h \
57 libltdl/libltdl/lt__glibc.h \
58 libltdl/libltdl/lt__private.h \
59 libltdl/libltdl/lt__strl.h \
60 libltdl/libltdl/lt_dlloader.h \
61 libltdl/libltdl/lt_error.h \
62 libltdl/libltdl/lt_system.h \
63 libltdl/libltdl/slist.h \
64 libltdl/loaders/preopen.c \
65 libltdl/lt__alloc.c \
66 libltdl/lt_dlloader.c \
67 libltdl/lt_error.c \
68 libltdl/ltdl.c \
69 libltdl/ltdl.h \
70 libltdl/slist.c
71
72 EXTRA_DIST += libltdl/lt__dirent.c \
73 libltdl/lt__strl.c
74
75 libltdl_libltdl_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS)
76 libltdl_libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) $(LT_DLPREOPEN)
77 libltdl_libltdl_la_LIBADD = $(ltdl_LTLIBOBJS)
78 libltdl_libltdl_la_DEPENDENCIES = $(LT_DLLOADERS) $(ltdl_LTLIBOBJS)
79
80 libltdl_libltdlc_la_SOURCES = $(libltdl_libltdl_la_SOURCES)
81 libltdl_libltdlc_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS)
82 libltdl_libltdlc_la_LDFLAGS = $(AM_LDFLAGS) $(LT_DLPREOPEN)
83 libltdl_libltdlc_la_LIBADD = $(libltdl_libltdl_la_LIBADD)
84 libltdl_libltdlc_la_DEPENDENCIES= $(libltdl_libltdl_la_DEPENDENCIES)
85
86 ## The loaders are preopened by libltdl, itself always built from
87 ## pic-objects (either as a shared library, or a convenience library),
88 ## so the loaders themselves must be made from pic-objects too. We
89 ## use convenience libraries for that purpose:
90 EXTRA_LTLIBRARIES += libltdl/dlopen.la \
91 libltdl/dld_link.la \
92 libltdl/dyld.la \
93 libltdl/load_add_on.la \
94 libltdl/loadlibrary.la \
95 libltdl/shl_load.la
96
97 libltdl_dlopen_la_SOURCES = libltdl/loaders/dlopen.c
98 libltdl_dlopen_la_LDFLAGS = -module -avoid-version
99 libltdl_dlopen_la_LIBADD = $(LIBADD_DLOPEN)
100
101 libltdl_dld_link_la_SOURCES = libltdl/loaders/dld_link.c
102 libltdl_dld_link_la_LDFLAGS = -module -avoid-version
103 libltdl_dld_link_la_LIBADD = -ldld
104
105 libltdl_dyld_la_SOURCES = libltdl/loaders/dyld.c
106 libltdl_dyld_la_LDFLAGS = -module -avoid-version
107
108 libltdl_load_add_on_la_SOURCES = libltdl/loaders/load_add_on.c
109 libltdl_load_add_on_la_LDFLAGS = -module -avoid-version
110
111 libltdl_loadlibrary_la_SOURCES = libltdl/loaders/loadlibrary.c
112 libltdl_loadlibrary_la_LDFLAGS = -module -avoid-version
113
114 libltdl_shl_load_la_SOURCES = libltdl/loaders/shl_load.c
115 libltdl_shl_load_la_LDFLAGS = -module -avoid-version
116 libltdl_shl_load_la_LIBADD = $(LIBADD_SHL_LOAD)
117
118 ## Make sure these will be cleaned even when they're not built by default:
119 CLEANFILES += libltdl/libltdl.la \
120 libltdl/libltdlc.la \
121 libltdl/libdlloader.la
122
123 ## Automake-1.9.6 doesn't clean subdir AC_LIBOBJ compiled objects
124 ## automatically:
125 CLEANFILES += $(ltdl_LIBOBJS) $(ltdl_LTLIBOBJS)
126
127 EXTRA_DIST += libltdl/COPYING.LIB \
128 libltdl/README
129
130 ## --------------------------- ##
131 ## Gnulib Makefile.am snippets ##
132 ## --------------------------- ##
133
134 BUILT_SOURCES += libltdl/$(ARGZ_H)
135 EXTRA_DIST += libltdl/argz_.h \
136 libltdl/argz.c
137
138 # We need the following in order to create an <argz.h> when the system
139 # doesn't have one that works with the given compiler.
140 all-local $(lib_OBJECTS): libltdl/$(ARGZ_H)
141 libltdl/argz.h: libltdl/argz_.h
142 $(mkinstalldirs) . libltdl/
143 cp $(srcdir)/libltdl/argz_.h $@-t
144 mv $@-t $@
145 MOSTLYCLEANFILES += libltdl/argz.h \
146 libltdl/argz.h-t
0 This is GNU libltdl, a system independent dlopen wrapper for GNU libtool.
1
2 It supports the following dlopen interfaces:
3 * dlopen (Solaris, Linux and various BSD flavors)
4 * shl_load (HP-UX)
5 * LoadLibrary (Win16 and Win32)
6 * load_add_on (BeOS)
7 * GNU DLD (emulates dynamic linking for static libraries)
8 * dyld (darwin/Mac OS X)
9 * libtool's dlpreopen
10 --
11 Copyright (C) 1999, 2003 Free Software Foundation, Inc.
12 Written by Thomas Tanner, 1999
13
14 This file is part of GNU Libtool.
15
16 GNU Libtool is free software; you can redistribute it and/or
17 modify it under the terms of the GNU General Public License as
18 published by the Free Software Foundation; either version 2 of
19 the License, or (at your option) any later version.
20
21 As a special exception to the GNU General Public License,
22 if you distribute this file as part of a program or library that
23 is built using GNU Libtool, you may include this file under the
24 same distribution terms that you use for the rest of that program.
25
26 GNU Libtool is distributed in the hope that it will be useful,
27 but WITHOUT ANY WARRANTY; without even the implied warranty of
28 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 GNU General Public License for more details.
30
31 You should have received a copy of the GNU General Public License
32 along with GNU Libtool; see the file COPYING. If not, a copy
33 can be downloaded from http://www.gnu.org/licenses/gpl.html,
34 or obtained by writing to the Free Software Foundation, Inc.,
35 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
36
0 /* argz.c -- argz implementation for non-glibc systems
1
2 Copyright (C) 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
3 Written by Gary V. Vaughan, 2004
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29
30 #if defined(LTDL) && defined LT_CONFIG_H
31 # include LT_CONFIG_H
32 #else
33 # include <config.h>
34 #endif
35
36 #include <argz.h>
37
38 #include <assert.h>
39 #include <stddef.h>
40 #include <stdlib.h>
41 #include <sys/types.h>
42 #include <errno.h>
43 #include <string.h>
44
45 #define EOS_CHAR '\0'
46
47 error_t
48 argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len)
49 {
50 size_t argz_len;
51 char *argz;
52
53 assert (pargz);
54 assert (pargz_len);
55 assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len));
56
57 /* If nothing needs to be appended, no more work is required. */
58 if (buf_len == 0)
59 return 0;
60
61 /* Ensure there is enough room to append BUF_LEN. */
62 argz_len = *pargz_len + buf_len;
63 argz = (char *) realloc (*pargz, argz_len);
64 if (!argz)
65 return ENOMEM;
66
67 /* Copy characters from BUF after terminating '\0' in ARGZ. */
68 memcpy (argz + *pargz_len, buf, buf_len);
69
70 /* Assign new values. */
71 *pargz = argz;
72 *pargz_len = argz_len;
73
74 return 0;
75 }
76
77
78 error_t
79 argz_create_sep (const char *str, int delim, char **pargz, size_t *pargz_len)
80 {
81 size_t argz_len;
82 char *argz = 0;
83
84 assert (str);
85 assert (pargz);
86 assert (pargz_len);
87
88 /* Make a copy of STR, but replacing each occurrence of
89 DELIM with '\0'. */
90 argz_len = 1+ strlen (str);
91 if (argz_len)
92 {
93 const char *p;
94 char *q;
95
96 argz = (char *) malloc (argz_len);
97 if (!argz)
98 return ENOMEM;
99
100 for (p = str, q = argz; *p != EOS_CHAR; ++p)
101 {
102 if (*p == delim)
103 {
104 /* Ignore leading delimiters, and fold consecutive
105 delimiters in STR into a single '\0' in ARGZ. */
106 if ((q > argz) && (q[-1] != EOS_CHAR))
107 *q++ = EOS_CHAR;
108 else
109 --argz_len;
110 }
111 else
112 *q++ = *p;
113 }
114 /* Copy terminating EOS_CHAR. */
115 *q = *p;
116 }
117
118 /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */
119 if (!argz_len)
120 argz = (free (argz), (char *) 0);
121
122 /* Assign new values. */
123 *pargz = argz;
124 *pargz_len = argz_len;
125
126 return 0;
127 }
128
129
130 error_t
131 argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry)
132 {
133 assert (pargz);
134 assert (pargz_len);
135 assert (entry && *entry);
136
137 /* No BEFORE address indicates ENTRY should be inserted after the
138 current last element. */
139 if (!before)
140 return argz_append (pargz, pargz_len, entry, 1+ strlen (entry));
141
142 /* This probably indicates a programmer error, but to preserve
143 semantics, scan back to the start of an entry if BEFORE points
144 into the middle of it. */
145 while ((before > *pargz) && (before[-1] != EOS_CHAR))
146 --before;
147
148 {
149 size_t entry_len = 1+ strlen (entry);
150 size_t argz_len = *pargz_len + entry_len;
151 size_t offset = before - *pargz;
152 char *argz = (char *) realloc (*pargz, argz_len);
153
154 if (!argz)
155 return ENOMEM;
156
157 /* Make BEFORE point to the equivalent offset in ARGZ that it
158 used to have in *PARGZ incase realloc() moved the block. */
159 before = argz + offset;
160
161 /* Move the ARGZ entries starting at BEFORE up into the new
162 space at the end -- making room to copy ENTRY into the
163 resulting gap. */
164 memmove (before + entry_len, before, *pargz_len - offset);
165 memcpy (before, entry, entry_len);
166
167 /* Assign new values. */
168 *pargz = argz;
169 *pargz_len = argz_len;
170 }
171
172 return 0;
173 }
174
175
176 char *
177 argz_next (char *argz, size_t argz_len, const char *entry)
178 {
179 assert ((argz && argz_len) || (!argz && !argz_len));
180
181 if (entry)
182 {
183 /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address
184 within the ARGZ vector. */
185 assert ((!argz && !argz_len)
186 || ((argz <= entry) && (entry < (argz + argz_len))));
187
188 /* Move to the char immediately after the terminating
189 '\0' of ENTRY. */
190 entry = 1+ strchr (entry, EOS_CHAR);
191
192 /* Return either the new ENTRY, or else NULL if ARGZ is
193 exhausted. */
194 return (entry >= argz + argz_len) ? 0 : (char *) entry;
195 }
196 else
197 {
198 /* This should probably be flagged as a programmer error,
199 since starting an argz_next loop with the iterator set
200 to ARGZ is safer. To preserve semantics, handle the NULL
201 case by returning the start of ARGZ (if any). */
202 if (argz_len > 0)
203 return argz;
204 else
205 return 0;
206 }
207 }
208
209
210 void
211 argz_stringify (char *argz, size_t argz_len, int sep)
212 {
213 assert ((argz && argz_len) || (!argz && !argz_len));
214
215 if (sep)
216 {
217 --argz_len; /* don't stringify the terminating EOS */
218 while (--argz_len > 0)
219 {
220 if (argz[argz_len] == EOS_CHAR)
221 argz[argz_len] = sep;
222 }
223 }
224 }
225
0 /* lt__argz.h -- internal argz interface for non-glibc systems
1
2 Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc.
3 Written by Gary V. Vaughan, 2004
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30 #if !defined(LT__ARGZ_H)
31 #define LT__ARGZ_H 1
32
33 #include <stdlib.h>
34 #define __need_error_t
35 #include <errno.h>
36 #include <sys/types.h>
37
38 #if defined(LTDL)
39 # include "lt__glibc.h"
40 # include "lt_system.h"
41 #else
42 # define LT_SCOPE
43 #endif
44
45 #if defined(__cplusplus)
46 extern "C" {
47 #endif
48
49 LT_SCOPE error_t argz_append (char **pargz, size_t *pargz_len,
50 const char *buf, size_t buf_len);
51 LT_SCOPE error_t argz_create_sep(const char *str, int delim,
52 char **pargz, size_t *pargz_len);
53 LT_SCOPE error_t argz_insert (char **pargz, size_t *pargz_len,
54 char *before, const char *entry);
55 LT_SCOPE char * argz_next (char *argz, size_t argz_len,
56 const char *entry);
57 LT_SCOPE void argz_stringify (char *argz, size_t argz_len, int sep);
58
59 #if defined(__cplusplus)
60 }
61 #endif
62
63 #if !defined(LTDL)
64 # undef LT_SCOPE
65 #endif
66
67 #endif /*!defined(LT__ARGZ_H)*/
0 /* lt__alloc.h -- internal memory management interface
1
2 Copyright (C) 2004 Free Software Foundation, Inc.
3 Written by Gary V. Vaughan, 2004
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30 #if !defined(LT__ALLOC_H)
31 #define LT__ALLOC_H 1
32
33 #include "lt_system.h"
34
35 LT_BEGIN_C_DECLS
36
37 #define MALLOC(tp, n) (tp*) lt__malloc((n) * sizeof(tp))
38 #define REALLOC(tp, mem, n) (tp*) lt__realloc((mem), (n) * sizeof(tp))
39 #define FREE(mem) LT_STMT_START { \
40 if (mem) { free ((void *)mem); mem = NULL; } } LT_STMT_END
41 #define MEMREASSIGN(p, q) LT_STMT_START { \
42 if ((p) != (q)) { if (p) free (p); (p) = (q); (q) = 0; } \
43 } LT_STMT_END
44
45 /* If set, this function is called when memory allocation has failed. */
46 LT_SCOPE void (*lt__alloc_die) (void);
47
48 LT_SCOPE void *lt__malloc (size_t n);
49 LT_SCOPE void *lt__zalloc (size_t n);
50 LT_SCOPE void *lt__realloc (void *mem, size_t n);
51 LT_SCOPE void *lt__memdup (void const *mem, size_t n);
52
53 LT_SCOPE char *lt__strdup (const char *string);
54
55 LT_END_C_DECLS
56
57 #endif /*!defined(LT__ALLOC_H)*/
0 /* lt__dirent.h -- internal directory entry scanning interface
1
2 Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
3 Written by Bob Friesenhahn, 2001
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30 #if !defined(LT__DIRENT_H)
31 #define LT__DIRENT_H 1
32
33 #if defined(LT_CONFIG_H)
34 # include LT_CONFIG_H
35 #else
36 # include <config.h>
37 #endif
38
39 #include "lt_system.h"
40
41 #ifdef HAVE_DIRENT_H
42 /* We have a fully operational dirent subsystem. */
43 # include <dirent.h>
44 # define D_NAMLEN(dirent) (strlen((dirent)->d_name))
45
46 #elif defined __WINDOWS__
47 /* Use some wrapper code to emulate dirent on windows.. */
48 # define WINDOWS_DIRENT_EMULATION 1
49
50 # include <windows.h>
51
52 # define D_NAMLEN(dirent) (strlen((dirent)->d_name))
53 # define dirent lt__dirent
54 # define DIR lt__DIR
55 # define opendir lt__opendir
56 # define readdir lt__readdir
57 # define closedir lt__closedir
58
59 LT_BEGIN_C_DECLS
60
61 struct dirent
62 {
63 char d_name[LT_FILENAME_MAX];
64 int d_namlen;
65 };
66
67 typedef struct
68 {
69 HANDLE hSearch;
70 WIN32_FIND_DATA Win32FindData;
71 BOOL firsttime;
72 struct dirent file_info;
73 } DIR;
74
75
76 LT_SCOPE DIR * opendir (const char *path);
77 LT_SCOPE struct dirent *readdir (DIR *entry);
78 LT_SCOPE void closedir (DIR *entry);
79
80 LT_END_C_DECLS
81
82 #else /* !defined(__WINDOWS__)*/
83 ERROR - cannot find dirent
84 #endif /*!defined(__WINDOWS__)*/
85
86 #endif /*!defined(LT__DIRENT_H)*/
0 /* lt__glibc.h -- support for non glibc environments
1
2 Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
3 Written by Gary V. Vaughan, 2004
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30 #if !defined(LT__GLIBC_H)
31 #define LT__GLIBC_H 1
32
33 #if defined(LT_CONFIG_H)
34 # include LT_CONFIG_H
35 #else
36 # include <config.h>
37 #endif
38
39 #if !defined(HAVE_ARGZ_H) || !defined(HAVE_WORKING_ARGZ)
40 /* Redefine any glibc symbols we reimplement to import the
41 implementations into our lt__ namespace so we don't ever
42 clash with the system library if our clients use argz_*
43 from there in addition to libltdl. */
44 # undef argz_append
45 # define argz_append lt__argz_append
46 # undef argz_create_sep
47 # define argz_create_sep lt__argz_create_sep
48 # undef argz_insert
49 # define argz_insert lt__argz_insert
50 # undef argz_next
51 # define argz_next lt__argz_next
52 # undef argz_stringify
53 # define argz_stringify lt__argz_stringify
54 #endif
55
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59
60 #include <argz.h>
61
62 #ifdef __cplusplus
63 }
64 #endif
65
66 # define slist_concat lt__slist_concat
67 # define slist_cons lt__slist_cons
68 # define slist_delete lt__slist_delete
69 # define slist_remove lt__slist_remove
70 # define slist_reverse lt__slist_reverse
71 # define slist_sort lt__slist_sort
72 # define slist_tail lt__slist_tail
73 # define slist_nth lt__slist_nth
74 # define slist_find lt__slist_find
75 # define slist_length lt__slist_length
76 # define slist_foreach lt__slist_foreach
77 # define slist_box lt__slist_box
78 # define slist_unbox lt__slist_unbox
79
80 #include <slist.h>
81
82 #endif /*!defined(LT__GLIBC_H)*/
0 /* lt__private.h -- internal apis for libltdl
1
2 Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
3 Written by Gary V. Vaughan, 2004
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy con be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30 #if !defined(LT__PRIVATE_H)
31 #define LT__PRIVATE_H 1
32
33 #if defined(LT_CONFIG_H)
34 # include LT_CONFIG_H
35 #else
36 # include <config.h>
37 #endif
38
39 #include <stdio.h>
40 #include <ctype.h>
41 #include <assert.h>
42 #include <errno.h>
43 #include <string.h>
44
45 #if defined(HAVE_UNISTD_H)
46 # include <unistd.h>
47 #endif
48
49 /* Import internal interfaces... */
50 #include "lt__alloc.h"
51 #include "lt__dirent.h"
52 #include "lt__strl.h"
53 #include "lt__glibc.h"
54
55 /* ...and all exported interfaces. */
56 #include "ltdl.h"
57
58 #if defined(WITH_DMALLOC)
59 # include <dmalloc.h>
60 #endif
61
62 /* DLL building support on win32 hosts; mostly to workaround their
63 ridiculous implementation of data symbol exporting. */
64 #ifndef LT_GLOBAL_DATA
65 # if defined(__WINDOWS__) || defined(__CYGWIN__)
66 # if defined(DLL_EXPORT) /* defined by libtool (if required) */
67 # define LT_GLOBAL_DATA __declspec(dllexport)
68 # endif
69 # endif
70 # ifndef LT_GLOBAL_DATA
71 # define LT_GLOBAL_DATA /* static linking or !__WINDOWS__ */
72 # endif
73 #endif
74
75 #ifndef __attribute__
76 # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
77 # define __attribute__(x)
78 # endif
79 #endif
80
81 #ifndef LT__UNUSED
82 # define LT__UNUSED __attribute__ ((__unused__))
83 #endif
84
85
86 LT_BEGIN_C_DECLS
87
88 #if !defined(errno)
89 extern int errno;
90 #endif
91
92 LT_SCOPE void lt__alloc_die_callback (void);
93
94
95 /* For readability: */
96 #define strneq(s1, s2) (strcmp((s1), (s2)) != 0)
97 #define streq(s1, s2) (!strcmp((s1), (s2)))
98
99
100
101 /* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */
102
103 /* This type is used for the array of interface data sets in each handler. */
104 typedef struct {
105 lt_dlinterface_id key;
106 void * data;
107 } lt_interface_data;
108
109 struct lt__handle {
110 lt_dlhandle next;
111 const lt_dlvtable * vtable; /* dlopening interface */
112 lt_dlinfo info; /* user visible fields */
113 int depcount; /* number of dependencies */
114 lt_dlhandle * deplibs; /* dependencies */
115 lt_module module; /* system module handle */
116 void * system; /* system specific data */
117 lt_interface_data * interface_data; /* per caller associated data */
118 int flags; /* various boolean stats */
119 };
120
121 struct lt__advise {
122 unsigned int try_ext:1; /* try system library extensions. */
123 unsigned int is_resident:1; /* module can't be unloaded. */
124 unsigned int is_symglobal:1; /* module symbols can satisfy
125 subsequently loaded modules. */
126 unsigned int is_symlocal:1; /* module symbols are only available
127 locally. */
128 unsigned int try_preload_only:1;/* only preloaded modules will be tried. */
129 };
130
131 /* --- ERROR HANDLING --- */
132
133 /* Extract the diagnostic strings from the error table macro in the same
134 order as the enumerated indices in lt_error.h. */
135
136 #define LT__STRERROR(name) lt__error_string(LT_CONC(LT_ERROR_,name))
137
138 #define LT__GETERROR(lvalue) (lvalue) = lt__get_last_error()
139 #define LT__SETERRORSTR(errormsg) lt__set_last_error(errormsg)
140 #define LT__SETERROR(errorcode) LT__SETERRORSTR(LT__STRERROR(errorcode))
141
142 LT_SCOPE const char *lt__error_string (int errorcode);
143 LT_SCOPE const char *lt__get_last_error (void);
144 LT_SCOPE const char *lt__set_last_error (const char *errormsg);
145
146 LT_END_C_DECLS
147
148 #endif /*!defined(LT__PRIVATE_H)*/
0 /* lt__strl.h -- size-bounded string copying and concatenation
1
2 Copyright (C) 2004, 2006 Free Software Foundation, Inc.
3 Written by Bob Friesenhahn, 2004
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29
30 #if !defined(LT__STRL_H)
31 #define LT__STRL_H 1
32
33 #if defined(LT_CONFIG_H)
34 # include LT_CONFIG_H
35 #else
36 # include <config.h>
37 #endif
38
39 #include <string.h>
40 #include "lt_system.h"
41
42 #if !defined(HAVE_STRLCAT)
43 # define strlcat(dst,src,dstsize) lt_strlcat(dst,src,dstsize)
44 LT_SCOPE size_t lt_strlcat(char *dst, const char *src, const size_t dstsize);
45 #endif /* !defined(HAVE_STRLCAT) */
46
47 #if !defined(HAVE_STRLCPY)
48 # define strlcpy(dst,src,dstsize) lt_strlcpy(dst,src,dstsize)
49 LT_SCOPE size_t lt_strlcpy(char *dst, const char *src, const size_t dstsize);
50 #endif /* !defined(HAVE_STRLCPY) */
51
52 #endif /*!defined(LT__STRL_H)*/
0 /* lt_dlloader.h -- dynamic library loader interface
1
2 Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc.
3 Written by Gary V. Vaughan, 2004
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29
30 #if !defined(LT_DLLOADER_H)
31 #define LT_DLLOADER_H 1
32
33 #include <libltdl/lt_system.h>
34
35 LT_BEGIN_C_DECLS
36
37 typedef void * lt_dlloader;
38 typedef void * lt_module;
39 typedef void * lt_user_data;
40 typedef struct lt__advise * lt_dladvise;
41
42 /* Function pointer types for module loader vtable entries: */
43 typedef lt_module lt_module_open (lt_user_data data,
44 const char *filename,
45 lt_dladvise advise);
46 typedef int lt_module_close (lt_user_data data,
47 lt_module module);
48 typedef void * lt_find_sym (lt_user_data data, lt_module module,
49 const char *symbolname);
50 typedef int lt_dlloader_init (lt_user_data data);
51 typedef int lt_dlloader_exit (lt_user_data data);
52
53 /* Default priority is LT_DLLOADER_PREPEND if none is explicitly given. */
54 typedef enum {
55 LT_DLLOADER_PREPEND = 0, LT_DLLOADER_APPEND
56 } lt_dlloader_priority;
57
58 /* This structure defines a module loader, as populated by the get_vtable
59 entry point of each loader. */
60 typedef struct {
61 const char * name;
62 const char * sym_prefix;
63 lt_module_open * module_open;
64 lt_module_close * module_close;
65 lt_find_sym * find_sym;
66 lt_dlloader_init * dlloader_init;
67 lt_dlloader_exit * dlloader_exit;
68 lt_user_data dlloader_data;
69 lt_dlloader_priority priority;
70 } lt_dlvtable;
71
72 LT_SCOPE int lt_dlloader_add (const lt_dlvtable *vtable);
73 LT_SCOPE lt_dlloader lt_dlloader_next (const lt_dlloader loader);
74
75 LT_SCOPE lt_dlvtable * lt_dlloader_remove (char *name);
76 LT_SCOPE const lt_dlvtable *lt_dlloader_find (char *name);
77 LT_SCOPE const lt_dlvtable *lt_dlloader_get (lt_dlloader loader);
78
79
80 /* Type of a function to get a loader's vtable: */
81 typedef const lt_dlvtable *lt_get_vtable (lt_user_data data);
82
83 #ifdef LT_DEBUG_LOADERS
84 LT_SCOPE void lt_dlloader_dump (void);
85 #endif
86
87 LT_END_C_DECLS
88
89 #endif /*!defined(LT_DLLOADER_H)*/
0 /* lt_error.h -- error propogation interface
1
2 Copyright (C) 1999, 2000, 2001, 2004, 2007 Free Software Foundation, Inc.
3 Written by Thomas Tanner, 1999
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29
30 /* Only include this header file once. */
31 #if !defined(LT_ERROR_H)
32 #define LT_ERROR_H 1
33
34 #include <libltdl/lt_system.h>
35
36 LT_BEGIN_C_DECLS
37
38 /* Defining error strings alongside their symbolic names in a macro in
39 this way allows us to expand the macro in different contexts with
40 confidence that the enumeration of symbolic names will map correctly
41 onto the table of error strings. \0 is appended to the strings to
42 expilicitely initialize the string terminator. */
43 #define lt_dlerror_table \
44 LT_ERROR(UNKNOWN, "unknown error\0") \
45 LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available\0") \
46 LT_ERROR(INVALID_LOADER, "invalid loader\0") \
47 LT_ERROR(INIT_LOADER, "loader initialization failed\0") \
48 LT_ERROR(REMOVE_LOADER, "loader removal failed\0") \
49 LT_ERROR(FILE_NOT_FOUND, "file not found\0") \
50 LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found\0") \
51 LT_ERROR(NO_SYMBOLS, "no symbols defined\0") \
52 LT_ERROR(CANNOT_OPEN, "can't open the module\0") \
53 LT_ERROR(CANNOT_CLOSE, "can't close the module\0") \
54 LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found\0") \
55 LT_ERROR(NO_MEMORY, "not enough memory\0") \
56 LT_ERROR(INVALID_HANDLE, "invalid module handle\0") \
57 LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow\0") \
58 LT_ERROR(INVALID_ERRORCODE, "invalid errorcode\0") \
59 LT_ERROR(SHUTDOWN, "library already shutdown\0") \
60 LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module\0") \
61 LT_ERROR(INVALID_MUTEX_ARGS, "internal error (code withdrawn)\0")\
62 LT_ERROR(INVALID_POSITION, "invalid search path insert position\0")\
63 LT_ERROR(CONFLICTING_FLAGS, "symbol visibility can be global or local\0")
64
65 /* Enumerate the symbolic error names. */
66 enum {
67 #define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name),
68 lt_dlerror_table
69 #undef LT_ERROR
70
71 LT_ERROR_MAX
72 };
73
74 /* Should be max of the error string lengths above (plus one for C++) */
75 #define LT_ERROR_LEN_MAX (41)
76
77 /* These functions are only useful from inside custom module loaders. */
78 LT_SCOPE int lt_dladderror (const char *diagnostic);
79 LT_SCOPE int lt_dlseterror (int errorcode);
80
81
82 LT_END_C_DECLS
83
84 #endif /*!defined(LT_ERROR_H)*/
0 /* lt_system.h -- system portability abstraction layer
1
2 Copyright (C) 2004, 2007 Free Software Foundation, Inc.
3 Written by Gary V. Vaughan, 2004
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29
30 #if !defined(LT_SYSTEM_H)
31 #define LT_SYSTEM_H 1
32
33 #include <stddef.h>
34 #include <stdlib.h>
35 #include <sys/types.h>
36
37 /* Some systems do not define EXIT_*, even with STDC_HEADERS. */
38 #if !defined(EXIT_SUCCESS)
39 # define EXIT_SUCCESS 0
40 #endif
41 #if !defined(EXIT_FAILURE)
42 # define EXIT_FAILURE 1
43 #endif
44
45 /* Just pick a big number... */
46 #define LT_FILENAME_MAX 2048
47
48
49 /* Saves on those hard to debug '\0' typos.... */
50 #define LT_EOS_CHAR '\0'
51
52 /* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations,
53 so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at
54 the end of C declarations. */
55 #if defined(__cplusplus)
56 # define LT_BEGIN_C_DECLS extern "C" {
57 # define LT_END_C_DECLS }
58 #else
59 # define LT_BEGIN_C_DECLS /* empty */
60 # define LT_END_C_DECLS /* empty */
61 #endif
62
63 /* LT_STMT_START/END are used to create macros which expand to a
64 a single compound statement in a portable way. */
65 #if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus)
66 # define LT_STMT_START (void)(
67 # define LT_STMT_END )
68 #else
69 # if (defined (sun) || defined (__sun__))
70 # define LT_STMT_START if (1)
71 # define LT_STMT_END else (void)0
72 # else
73 # define LT_STMT_START do
74 # define LT_STMT_END while (0)
75 # endif
76 #endif
77
78 /* Canonicalise Windows and Cygwin recognition macros.
79 To match the values set by recent Cygwin compilers, make sure that if
80 __CYGWIN__ is defined (after canonicalisation), __WINDOWS__ is NOT! */
81 #if defined(__CYGWIN32__) && !defined(__CYGWIN__)
82 # define __CYGWIN__ __CYGWIN32__
83 #endif
84 #if defined(__CYGWIN__)
85 # if defined(__WINDOWS__)
86 # undef __WINDOWS__
87 # endif
88 #elif defined(_WIN32)
89 # define __WINDOWS__ _WIN32
90 #elif defined(WIN32)
91 # define __WINDOWS__ WIN32
92 #endif
93 #if defined(__CYGWIN__) && defined(__WINDOWS__)
94 # undef __WINDOWS__
95 #endif
96
97
98 /* DLL building support on win32 hosts; mostly to workaround their
99 ridiculous implementation of data symbol exporting. */
100 #if !defined(LT_SCOPE)
101 # if defined(__WINDOWS__) || defined(__CYGWIN__)
102 # if defined(DLL_EXPORT) /* defined by libtool (if required) */
103 # define LT_SCOPE extern __declspec(dllexport)
104 # endif
105 # if defined(LIBLTDL_DLL_IMPORT) /* define if linking with this dll */
106 /* note: cygwin/mingw compilers can rely instead on auto-import */
107 # define LT_SCOPE extern __declspec(dllimport)
108 # endif
109 # endif
110 # if !defined(LT_SCOPE) /* static linking or !__WINDOWS__ */
111 # define LT_SCOPE extern
112 # endif
113 #endif
114
115 #if defined(__WINDOWS__)
116 /* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory
117 separator when it is set. */
118 # define LT_DIRSEP_CHAR '\\'
119 # define LT_PATHSEP_CHAR ';'
120 #else
121 # define LT_PATHSEP_CHAR ':'
122 #endif
123
124 #if defined(_MSC_VER) /* Visual Studio */
125 # define R_OK 4
126 #endif
127
128 /* fopen() mode flags for reading a text file */
129 #undef LT_READTEXT_MODE
130 #if defined(__WINDOWS__) || defined(__CYGWIN__)
131 # define LT_READTEXT_MODE "rt"
132 #else
133 # define LT_READTEXT_MODE "r"
134 #endif
135
136 /* The extra indirection to the LT__STR and LT__CONC macros is required so
137 that if the arguments to LT_STR() (or LT_CONC()) are themselves macros,
138 they will be expanded before being quoted. */
139 #ifndef LT_STR
140 # define LT__STR(arg) #arg
141 # define LT_STR(arg) LT__STR(arg)
142 #endif
143
144 #ifndef LT_CONC
145 # define LT__CONC(a, b) a##b
146 # define LT_CONC(a, b) LT__CONC(a, b)
147 #endif
148 #ifndef LT_CONC3
149 # define LT__CONC3(a, b, c) a##b##c
150 # define LT_CONC3(a, b, c) LT__CONC3(a, b, c)
151 #endif
152
153 #endif /*!defined(LT_SYSTEM_H)*/
0 /* slist.h -- generalised singly linked lists
1
2 Copyright (C) 2000, 2004 Free Software Foundation, Inc.
3 Written by Gary V. Vaughan, 2000
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29
30 /* A generalised list. This is deliberately transparent so that you
31 can make the NEXT field of all your chained data structures first,
32 and then cast them to `(SList *)' so that they can be manipulated
33 by this API.
34
35 Alternatively, you can generate raw SList elements using slist_new(),
36 and put the element data in the USERDATA field. Either way you
37 get to manage the memory involved by yourself.
38 */
39
40 #if !defined(SLIST_H)
41 #define SLIST_H 1
42
43 #if defined(LTDL)
44 # include <libltdl/lt__glibc.h>
45 # include <libltdl/lt_system.h>
46 #else
47 # define LT_SCOPE
48 #endif
49
50 #if defined(__cplusplus)
51 extern "C" {
52 #endif
53
54 typedef struct slist {
55 struct slist *next; /* chain forward pointer*/
56 const void *userdata; /* for boxed `SList' item */
57 } SList;
58
59 typedef void * SListCallback (SList *item, void *userdata);
60 typedef int SListCompare (const SList *item1, const SList *item2,
61 void *userdata);
62
63 LT_SCOPE SList *slist_concat (SList *head, SList *tail);
64 LT_SCOPE SList *slist_cons (SList *item, SList *slist);
65
66 LT_SCOPE SList *slist_delete (SList *slist, void (*delete_fct) (void *item));
67 LT_SCOPE void * slist_remove (SList **phead, SListCallback *find,
68 void *matchdata);
69 LT_SCOPE SList *slist_reverse (SList *slist);
70 LT_SCOPE SList *slist_sort (SList *slist, SListCompare *compare,
71 void *userdata);
72
73 LT_SCOPE SList *slist_tail (SList *slist);
74 LT_SCOPE SList *slist_nth (SList *slist, size_t n);
75 LT_SCOPE void * slist_find (SList *slist, SListCallback *find,
76 void *matchdata);
77 LT_SCOPE size_t slist_length (SList *slist);
78
79 LT_SCOPE void * slist_foreach (SList *slist, SListCallback *foreach,
80 void *userdata);
81
82 LT_SCOPE SList *slist_box (const void *userdata);
83 LT_SCOPE void * slist_unbox (SList *item);
84
85 #if defined(__cplusplus)
86 }
87 #endif
88
89 #if !defined(LTDL)
90 # undef LT_SCOPE
91 #endif
92
93 #endif /*!defined(SLIST_H)*/
0 /* loader-dld_link.c -- dynamic linking with dld
1
2 Copyright (C) 1998, 1999, 2000, 2004, 2006,
3 2007, 2008 Free Software Foundation, Inc.
4 Written by Thomas Tanner, 1998
5
6 NOTE: The canonical source of this file is maintained with the
7 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
8
9 GNU Libltdl is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 As a special exception to the GNU Lesser General Public License,
15 if you distribute this file as part of a program or library that
16 is built using GNU Libtool, you may include this file under the
17 same distribution terms that you use for the rest of that program.
18
19 GNU Libltdl is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU Lesser General Public License for more details.
23
24 You should have received a copy of the GNU Lesser General Public
25 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
26 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
27 or obtained by writing to the Free Software Foundation, Inc.,
28 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 */
30
31 #include "lt__private.h"
32 #include "lt_dlloader.h"
33
34 /* Use the preprocessor to rename non-static symbols to avoid namespace
35 collisions when the loader code is statically linked into libltdl.
36 Use the "<module_name>_LTX_" prefix so that the symbol addresses can
37 be fetched from the preloaded symbol list by lt_dlsym(): */
38 #define get_vtable dld_link_LTX_get_vtable
39
40 LT_BEGIN_C_DECLS
41 LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data);
42 LT_END_C_DECLS
43
44
45 /* Boilerplate code to set up the vtable for hooking this loader into
46 libltdl's loader list: */
47 static int vl_exit (lt_user_data loader_data);
48 static lt_module vm_open (lt_user_data loader_data, const char *filename,
49 lt_dladvise advise);
50 static int vm_close (lt_user_data loader_data, lt_module module);
51 static void * vm_sym (lt_user_data loader_data, lt_module module,
52 const char *symbolname);
53
54 static lt_dlvtable *vtable = 0;
55
56 /* Return the vtable for this loader, only the name and sym_prefix
57 attributes (plus the virtual function implementations, obviously)
58 change between loaders. */
59 lt_dlvtable *
60 get_vtable (lt_user_data loader_data)
61 {
62 if (!vtable)
63 {
64 vtable = lt__zalloc (sizeof *vtable);
65 }
66
67 if (vtable && !vtable->name)
68 {
69 vtable->name = "lt_dld_link";
70 vtable->module_open = vm_open;
71 vtable->module_close = vm_close;
72 vtable->find_sym = vm_sym;
73 vtable->dlloader_exit = vl_exit;
74 vtable->dlloader_data = loader_data;
75 vtable->priority = LT_DLLOADER_APPEND;
76 }
77
78 if (vtable && (vtable->dlloader_data != loader_data))
79 {
80 LT__SETERROR (INIT_LOADER);
81 return 0;
82 }
83
84 return vtable;
85 }
86
87
88
89 /* --- IMPLEMENTATION --- */
90
91
92 #if defined(HAVE_DLD_H)
93 # include <dld.h>
94 #endif
95
96 /* A function called through the vtable when this loader is no
97 longer needed by the application. */
98 static int
99 vl_exit (lt_user_data LT__UNUSED loader_data)
100 {
101 vtable = NULL;
102 return 0;
103 }
104
105 /* A function called through the vtable to open a module with this
106 loader. Returns an opaque representation of the newly opened
107 module for processing with this loader's other vtable functions. */
108 static lt_module
109 vm_open (lt_user_data LT__UNUSED loader_data, const char *filename,
110 lt_dladvise LT__UNUSED advise)
111 {
112 lt_module module = lt__strdup (filename);
113
114 if (dld_link (filename) != 0)
115 {
116 LT__SETERROR (CANNOT_OPEN);
117 FREE (module);
118 }
119
120 return module;
121 }
122
123 /* A function called through the vtable when a particular module
124 should be unloaded. */
125 static int
126 vm_close (lt_user_data LT__UNUSED loader_data, lt_module module)
127 {
128 int errors = 0;
129
130 if (dld_unlink_by_file ((char*)(module), 1) != 0)
131 {
132 LT__SETERROR (CANNOT_CLOSE);
133 ++errors;
134 }
135 else
136 {
137 FREE (module);
138 }
139
140 return errors;
141 }
142
143 /* A function called through the vtable to get the address of
144 a symbol loaded from a particular module. */
145 static void *
146 vm_sym (lt_user_data LT__UNUSED loader_data, lt_module LT__UNUSED module,
147 const char *name)
148 {
149 void *address = dld_get_func (name);
150
151 if (!address)
152 {
153 LT__SETERROR (SYMBOL_NOT_FOUND);
154 }
155
156 return address;
157 }
0 /* loader-dlopen.c -- dynamic linking with dlopen/dlsym
1
2 Copyright (C) 1998, 1999, 2000, 2004, 2006,
3 2007, 2008 Free Software Foundation, Inc.
4 Written by Thomas Tanner, 1998
5
6 NOTE: The canonical source of this file is maintained with the
7 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
8
9 GNU Libltdl is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 As a special exception to the GNU Lesser General Public License,
15 if you distribute this file as part of a program or library that
16 is built using GNU Libtool, you may include this file under the
17 same distribution terms that you use for the rest of that program.
18
19 GNU Libltdl is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU Lesser General Public License for more details.
23
24 You should have received a copy of the GNU Lesser General Public
25 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
26 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
27 or obtained by writing to the Free Software Foundation, Inc.,
28 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 */
30
31 #include "lt__private.h"
32 #include "lt_dlloader.h"
33
34 /* Use the preprocessor to rename non-static symbols to avoid namespace
35 collisions when the loader code is statically linked into libltdl.
36 Use the "<module_name>_LTX_" prefix so that the symbol addresses can
37 be fetched from the preloaded symbol list by lt_dlsym(): */
38 #define get_vtable dlopen_LTX_get_vtable
39
40 LT_BEGIN_C_DECLS
41 LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data);
42 LT_END_C_DECLS
43
44
45 /* Boilerplate code to set up the vtable for hooking this loader into
46 libltdl's loader list: */
47 static int vl_exit (lt_user_data loader_data);
48 static lt_module vm_open (lt_user_data loader_data, const char *filename,
49 lt_dladvise advise);
50 static int vm_close (lt_user_data loader_data, lt_module module);
51 static void * vm_sym (lt_user_data loader_data, lt_module module,
52 const char *symbolname);
53
54 static lt_dlvtable *vtable = 0;
55
56 /* Return the vtable for this loader, only the name and sym_prefix
57 attributes (plus the virtual function implementations, obviously)
58 change between loaders. */
59 lt_dlvtable *
60 get_vtable (lt_user_data loader_data)
61 {
62 if (!vtable)
63 {
64 vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable);
65 }
66
67 if (vtable && !vtable->name)
68 {
69 vtable->name = "lt_dlopen";
70 #if defined(DLSYM_USCORE)
71 vtable->sym_prefix = "_";
72 #endif
73 vtable->module_open = vm_open;
74 vtable->module_close = vm_close;
75 vtable->find_sym = vm_sym;
76 vtable->dlloader_exit = vl_exit;
77 vtable->dlloader_data = loader_data;
78 vtable->priority = LT_DLLOADER_PREPEND;
79 }
80
81 if (vtable && (vtable->dlloader_data != loader_data))
82 {
83 LT__SETERROR (INIT_LOADER);
84 return 0;
85 }
86
87 return vtable;
88 }
89
90
91
92 /* --- IMPLEMENTATION --- */
93
94
95 #if defined(HAVE_DLFCN_H)
96 # include <dlfcn.h>
97 #endif
98
99 #if defined(HAVE_SYS_DL_H)
100 # include <sys/dl.h>
101 #endif
102
103
104 /* We may have to define LT_LAZY_OR_NOW in the command line if we
105 find out it does not work in some platform. */
106 #if !defined(LT_LAZY_OR_NOW)
107 # if defined(RTLD_LAZY)
108 # define LT_LAZY_OR_NOW RTLD_LAZY
109 # else
110 # if defined(DL_LAZY)
111 # define LT_LAZY_OR_NOW DL_LAZY
112 # endif
113 # endif /* !RTLD_LAZY */
114 #endif
115 #if !defined(LT_LAZY_OR_NOW)
116 # if defined(RTLD_NOW)
117 # define LT_LAZY_OR_NOW RTLD_NOW
118 # else
119 # if defined(DL_NOW)
120 # define LT_LAZY_OR_NOW DL_NOW
121 # endif
122 # endif /* !RTLD_NOW */
123 #endif
124 #if !defined(LT_LAZY_OR_NOW)
125 # define LT_LAZY_OR_NOW 0
126 #endif /* !LT_LAZY_OR_NOW */
127
128 /* We only support local and global symbols from modules for loaders
129 that provide such a thing, otherwise the system default is used. */
130 #if !defined(RTLD_GLOBAL)
131 # if defined(DL_GLOBAL)
132 # define RTLD_GLOBAL DL_GLOBAL
133 # endif
134 #endif /* !RTLD_GLOBAL */
135 #if !defined(RTLD_LOCAL)
136 # if defined(DL_LOCAL)
137 # define RTLD_LOCAL DL_LOCAL
138 # endif
139 #endif /* !RTLD_LOCAL */
140
141 #if defined(HAVE_DLERROR)
142 # define DLERROR(arg) dlerror ()
143 #else
144 # define DLERROR(arg) LT__STRERROR (arg)
145 #endif
146
147 #define DL__SETERROR(errorcode) \
148 LT__SETERRORSTR (DLERROR (errorcode))
149
150
151 /* A function called through the vtable when this loader is no
152 longer needed by the application. */
153 static int
154 vl_exit (lt_user_data LT__UNUSED loader_data)
155 {
156 vtable = NULL;
157 return 0;
158 }
159
160
161 /* A function called through the vtable to open a module with this
162 loader. Returns an opaque representation of the newly opened
163 module for processing with this loader's other vtable functions. */
164 static lt_module
165 vm_open (lt_user_data LT__UNUSED loader_data, const char *filename,
166 lt_dladvise advise)
167 {
168 int module_flags = LT_LAZY_OR_NOW;
169 lt_module module;
170
171 if (advise)
172 {
173 #ifdef RTLD_GLOBAL
174 /* If there is some means of asking for global symbol resolution,
175 do so. */
176 if (advise->is_symglobal)
177 module_flags |= RTLD_GLOBAL;
178 #else
179 /* Otherwise, reset that bit so the caller can tell it wasn't
180 acted on. */
181 advise->is_symglobal = 0;
182 #endif
183
184 /* And similarly for local only symbol resolution. */
185 #ifdef RTLD_LOCAL
186 if (advise->is_symlocal)
187 module_flags |= RTLD_LOCAL;
188 #else
189 advise->is_symlocal = 0;
190 #endif
191 }
192
193 module = dlopen (filename, module_flags);
194
195 if (!module)
196 {
197 DL__SETERROR (CANNOT_OPEN);
198 }
199
200 return module;
201 }
202
203
204 /* A function called through the vtable when a particular module
205 should be unloaded. */
206 static int
207 vm_close (lt_user_data LT__UNUSED loader_data, lt_module module)
208 {
209 int errors = 0;
210
211 if (dlclose (module) != 0)
212 {
213 DL__SETERROR (CANNOT_CLOSE);
214 ++errors;
215 }
216
217 return errors;
218 }
219
220
221 /* A function called through the vtable to get the address of
222 a symbol loaded from a particular module. */
223 static void *
224 vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name)
225 {
226 void *address = dlsym (module, name);
227
228 if (!address)
229 {
230 DL__SETERROR (SYMBOL_NOT_FOUND);
231 }
232
233 return address;
234 }
0 /* loader-dyld.c -- dynamic linking on darwin and OS X
1
2 Copyright (C) 1998, 1999, 2000, 2004, 2006,
3 2007, 2008 Free Software Foundation, Inc.
4 Written by Peter O'Gorman, 1998
5
6 NOTE: The canonical source of this file is maintained with the
7 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
8
9 GNU Libltdl is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 As a special exception to the GNU Lesser General Public License,
15 if you distribute this file as part of a program or library that
16 is built using GNU Libtool, you may include this file under the
17 same distribution terms that you use for the rest of that program.
18
19 GNU Libltdl is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU Lesser General Public License for more details.
23
24 You should have received a copy of the GNU Lesser General Public
25 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
26 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
27 or obtained by writing to the Free Software Foundation, Inc.,
28 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 */
30
31 #include "lt__private.h"
32 #include "lt_dlloader.h"
33
34 /* Use the preprocessor to rename non-static symbols to avoid namespace
35 collisions when the loader code is statically linked into libltdl.
36 Use the "<module_name>_LTX_" prefix so that the symbol addresses can
37 be fetched from the preloaded symbol list by lt_dlsym(): */
38 #define get_vtable dyld_LTX_get_vtable
39
40 LT_BEGIN_C_DECLS
41 LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data);
42 LT_END_C_DECLS
43
44
45 /* Boilerplate code to set up the vtable for hooking this loader into
46 libltdl's loader list: */
47 static int vl_init (lt_user_data loader_data);
48 static int vl_exit (lt_user_data loader_data);
49 static lt_module vm_open (lt_user_data loader_data, const char *filename,
50 lt_dladvise advise);
51 static int vm_close (lt_user_data loader_data, lt_module module);
52 static void * vm_sym (lt_user_data loader_data, lt_module module,
53 const char *symbolname);
54
55 static lt_dlvtable *vtable = 0;
56
57 /* Return the vtable for this loader, only the name and sym_prefix
58 attributes (plus the virtual function implementations, obviously)
59 change between loaders. */
60 lt_dlvtable *
61 get_vtable (lt_user_data loader_data)
62 {
63 if (!vtable)
64 {
65 vtable = lt__zalloc (sizeof *vtable);
66 }
67
68 if (vtable && !vtable->name)
69 {
70 vtable->name = "lt_dyld";
71 vtable->sym_prefix = "_";
72 vtable->dlloader_init = vl_init;
73 vtable->module_open = vm_open;
74 vtable->module_close = vm_close;
75 vtable->find_sym = vm_sym;
76 vtable->dlloader_exit = vl_exit;
77 vtable->dlloader_data = loader_data;
78 vtable->priority = LT_DLLOADER_APPEND;
79 }
80
81 if (vtable && (vtable->dlloader_data != loader_data))
82 {
83 LT__SETERROR (INIT_LOADER);
84 return 0;
85 }
86
87 return vtable;
88 }
89
90
91
92 /* --- IMPLEMENTATION --- */
93
94
95 #if defined(HAVE_MACH_O_DYLD_H)
96 # if !defined(__APPLE_CC__) && !defined(__MWERKS__) && !defined(__private_extern__)
97 /* Is this correct? Does it still function properly? */
98 # define __private_extern__ extern
99 # endif
100 # include <mach-o/dyld.h>
101 #endif
102
103 #include <mach-o/getsect.h>
104
105 /* We have to put some stuff here that isn't in older dyld.h files */
106 #if !defined(ENUM_DYLD_BOOL)
107 # define ENUM_DYLD_BOOL
108 # undef FALSE
109 # undef TRUE
110 enum DYLD_BOOL {
111 FALSE,
112 TRUE
113 };
114 #endif
115 #if !defined(LC_REQ_DYLD)
116 # define LC_REQ_DYLD 0x80000000
117 #endif
118 #if !defined(LC_LOAD_WEAK_DYLIB)
119 # define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
120 #endif
121
122 #if !defined(NSADDIMAGE_OPTION_NONE)
123 # define NSADDIMAGE_OPTION_NONE 0x0
124 #endif
125 #if !defined(NSADDIMAGE_OPTION_RETURN_ON_ERROR)
126 # define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1
127 #endif
128 #if !defined(NSADDIMAGE_OPTION_WITH_SEARCHING)
129 # define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2
130 #endif
131 #if !defined(NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED)
132 # define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4
133 #endif
134 #if !defined(NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME)
135 # define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8
136 #endif
137
138 #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND)
139 # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0
140 #endif
141 #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW)
142 # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1
143 #endif
144 #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY)
145 # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2
146 #endif
147 #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)
148 # define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4
149 #endif
150
151 #define LT__SYMLOOKUP_OPTS (NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW \
152 | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR)
153
154 #if defined(__BIG_ENDIAN__)
155 # define LT__MAGIC MH_MAGIC
156 #else
157 # define LT__MAGIC MH_CIGAM
158 #endif
159
160 #define DYLD__SETMYERROR(errmsg) LT__SETERRORSTR (dylderror (errmsg))
161 #define DYLD__SETERROR(errcode) DYLD__SETMYERROR (LT__STRERROR (errcode))
162
163 typedef struct mach_header mach_header;
164 typedef struct dylib_command dylib_command;
165
166 static const char *dylderror (const char *errmsg);
167 static const mach_header *lt__nsmodule_get_header (NSModule module);
168 static const char *lt__header_get_instnam (const mach_header *mh);
169 static const mach_header *lt__match_loadedlib (const char *name);
170 static NSSymbol lt__linkedlib_symbol (const char *symname, const mach_header *mh);
171
172 static const mach_header *(*lt__addimage) (const char *image_name,
173 unsigned long options) = 0;
174 static NSSymbol (*lt__image_symbol) (const mach_header *image,
175 const char *symbolName,
176 unsigned long options) = 0;
177 static enum DYLD_BOOL (*lt__image_symbol_p) (const mach_header *image,
178 const char *symbolName) = 0;
179 static enum DYLD_BOOL (*lt__module_export) (NSModule module) = 0;
180
181 static int dyld_cannot_close = 0;
182
183
184 /* A function called through the vtable when this loader is no
185 longer needed by the application. */
186 static int
187 vl_exit (lt_user_data LT__UNUSED loader_data)
188 {
189 vtable = NULL;
190 return 0;
191 }
192
193 /* A function called through the vtable to initialise this loader. */
194 static int
195 vl_init (lt_user_data loader_data)
196 {
197 int errors = 0;
198
199 if (! dyld_cannot_close)
200 {
201 if (!_dyld_present ())
202 {
203 ++errors;
204 }
205 else
206 {
207 (void) _dyld_func_lookup ("__dyld_NSAddImage",
208 (unsigned long*) &lt__addimage);
209 (void) _dyld_func_lookup ("__dyld_NSLookupSymbolInImage",
210 (unsigned long*)&lt__image_symbol);
211 (void) _dyld_func_lookup ("__dyld_NSIsSymbolNameDefinedInImage",
212 (unsigned long*) &lt__image_symbol_p);
213 (void) _dyld_func_lookup ("__dyld_NSMakePrivateModulePublic",
214 (unsigned long*) &lt__module_export);
215 dyld_cannot_close = lt_dladderror ("can't close a dylib");
216 }
217 }
218
219 return errors;
220 }
221
222
223 /* A function called through the vtable to open a module with this
224 loader. Returns an opaque representation of the newly opened
225 module for processing with this loader's other vtable functions. */
226 static lt_module
227 vm_open (lt_user_data loader_data, const char *filename,
228 lt_dladvise LT__UNUSED advise)
229 {
230 lt_module module = 0;
231 NSObjectFileImage ofi = 0;
232
233 if (!filename)
234 {
235 return (lt_module) -1;
236 }
237
238 switch (NSCreateObjectFileImageFromFile (filename, &ofi))
239 {
240 case NSObjectFileImageSuccess:
241 module = NSLinkModule (ofi, filename, NSLINKMODULE_OPTION_RETURN_ON_ERROR
242 | NSLINKMODULE_OPTION_PRIVATE
243 | NSLINKMODULE_OPTION_BINDNOW);
244 NSDestroyObjectFileImage (ofi);
245
246 if (module)
247 {
248 lt__module_export (module);
249 }
250 break;
251
252 case NSObjectFileImageInappropriateFile:
253 if (lt__image_symbol_p && lt__image_symbol)
254 {
255 module = (lt_module) lt__addimage(filename,
256 NSADDIMAGE_OPTION_RETURN_ON_ERROR);
257 }
258 break;
259
260 case NSObjectFileImageFailure:
261 case NSObjectFileImageArch:
262 case NSObjectFileImageFormat:
263 case NSObjectFileImageAccess:
264 /*NOWORK*/
265 break;
266 }
267
268 if (!module)
269 {
270 DYLD__SETERROR (CANNOT_OPEN);
271 }
272
273 return module;
274 }
275
276
277 /* A function called through the vtable when a particular module
278 should be unloaded. */
279 static int
280 vm_close (lt_user_data loader_data, lt_module module)
281 {
282 int errors = 0;
283
284 if (module != (lt_module) -1)
285 {
286 const mach_header *mh = (const mach_header *) module;
287 int flags = 0;
288 if (mh->magic == LT__MAGIC)
289 {
290 lt_dlseterror (dyld_cannot_close);
291 ++errors;
292 }
293 else
294 {
295 /* Currently, if a module contains c++ static destructors and it
296 is unloaded, we get a segfault in atexit(), due to compiler and
297 dynamic loader differences of opinion, this works around that. */
298 if ((const struct section *) NULL !=
299 getsectbynamefromheader (lt__nsmodule_get_header (module),
300 "__DATA", "__mod_term_func"))
301 {
302 flags |= NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED;
303 }
304 #if defined(__ppc__)
305 flags |= NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES;
306 #endif
307 if (!NSUnLinkModule (module, flags))
308 {
309 DYLD__SETERROR (CANNOT_CLOSE);
310 ++errors;
311 }
312 }
313 }
314
315 return errors;
316 }
317
318 /* A function called through the vtable to get the address of
319 a symbol loaded from a particular module. */
320 static void *
321 vm_sym (lt_user_data loader_data, lt_module module, const char *name)
322 {
323 NSSymbol *nssym = 0;
324 const mach_header *mh = (const mach_header *) module;
325 char saveError[256] = "Symbol not found";
326
327 if (module == (lt_module) -1)
328 {
329 void *address, *unused;
330 _dyld_lookup_and_bind (name, (unsigned long*) &address, &unused);
331 return address;
332 }
333
334 if (mh->magic == LT__MAGIC)
335 {
336 if (lt__image_symbol_p && lt__image_symbol)
337 {
338 if (lt__image_symbol_p (mh, name))
339 {
340 nssym = lt__image_symbol (mh, name, LT__SYMLOOKUP_OPTS);
341 }
342 }
343
344 }
345 else
346 {
347 nssym = NSLookupSymbolInModule (module, name);
348 }
349
350 if (!nssym)
351 {
352 strncpy (saveError, dylderror (LT__STRERROR (SYMBOL_NOT_FOUND)), 255);
353 saveError[255] = 0;
354 if (!mh)
355 {
356 mh = (mach_header *)lt__nsmodule_get_header (module);
357 }
358 nssym = lt__linkedlib_symbol (name, mh);
359 }
360
361 if (!nssym)
362 {
363 LT__SETERRORSTR (saveError);
364 }
365
366 return nssym ? NSAddressOfSymbol (nssym) : 0;
367 }
368
369
370
371
372 /* --- HELPER FUNCTIONS --- */
373
374
375 /* Return the dyld error string, or the passed in error string if none. */
376 static const char *
377 dylderror (const char *errmsg)
378 {
379 NSLinkEditErrors ler;
380 int lerno;
381 const char *file;
382 const char *errstr;
383
384 NSLinkEditError (&ler, &lerno, &file, &errstr);
385
386 if (! (errstr && *errstr))
387 {
388 errstr = errmsg;
389 }
390
391 return errstr;
392 }
393
394 /* There should probably be an apple dyld api for this. */
395 static const mach_header *
396 lt__nsmodule_get_header (NSModule module)
397 {
398 int i = _dyld_image_count();
399 const char *modname = NSNameOfModule (module);
400 const mach_header *mh = 0;
401
402 if (!modname)
403 return NULL;
404
405 while (i > 0)
406 {
407 --i;
408 if (strneq (_dyld_get_image_name (i), modname))
409 {
410 mh = _dyld_get_image_header (i);
411 break;
412 }
413 }
414
415 return mh;
416 }
417
418 /* NSAddImage is also used to get the loaded image, but it only works if
419 the lib is installed, for uninstalled libs we need to check the
420 install_names against each other. Note that this is still broken if
421 DYLD_IMAGE_SUFFIX is set and a different lib was loaded as a result. */
422 static const char *
423 lt__header_get_instnam (const mach_header *mh)
424 {
425 unsigned long offset = sizeof(mach_header);
426 const char* result = 0;
427 int j;
428
429 for (j = 0; j < mh->ncmds; j++)
430 {
431 struct load_command *lc;
432
433 lc = (struct load_command*) (((unsigned long) mh) + offset);
434 if (LC_ID_DYLIB == lc->cmd)
435 {
436 result=(char*)(((dylib_command*) lc)->dylib.name.offset +
437 (unsigned long) lc);
438 }
439 offset += lc->cmdsize;
440 }
441
442 return result;
443 }
444
445 static const mach_header *
446 lt__match_loadedlib (const char *name)
447 {
448 const mach_header *mh = 0;
449 int i = _dyld_image_count();
450
451 while (i > 0)
452 {
453 const char *id;
454
455 --i;
456 id = lt__header_get_instnam (_dyld_get_image_header (i));
457 if (id && strneq (id, name))
458 {
459 mh = _dyld_get_image_header (i);
460 break;
461 }
462 }
463
464 return mh;
465 }
466
467 /* Safe to assume our mh is good. */
468 static NSSymbol
469 lt__linkedlib_symbol (const char *symname, const mach_header *mh)
470 {
471 NSSymbol symbol = 0;
472
473 if (lt__image_symbol && NSIsSymbolNameDefined (symname))
474 {
475 unsigned long offset = sizeof(mach_header);
476 struct load_command *lc;
477 int j;
478
479 for (j = 0; j < mh->ncmds; j++)
480 {
481 lc = (struct load_command*) (((unsigned long) mh) + offset);
482 if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd))
483 {
484 unsigned long base = ((dylib_command *) lc)->dylib.name.offset;
485 char *name = (char *) (base + (unsigned long) lc);
486 const mach_header *mh1 = lt__match_loadedlib (name);
487
488 if (!mh1)
489 {
490 /* Maybe NSAddImage can find it */
491 mh1 = lt__addimage (name,
492 NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED
493 | NSADDIMAGE_OPTION_WITH_SEARCHING
494 | NSADDIMAGE_OPTION_RETURN_ON_ERROR);
495 }
496
497 if (mh1)
498 {
499 symbol = lt__image_symbol (mh1, symname, LT__SYMLOOKUP_OPTS);
500 if (symbol)
501 break;
502 }
503 }
504
505 offset += lc->cmdsize;
506 }
507 }
508
509 return symbol;
510 }
0 /* loader-load_add_on.c -- dynamic linking for BeOS
1
2 Copyright (C) 1998, 1999, 2000, 2004, 2006,
3 2007, 2008 Free Software Foundation, Inc.
4 Written by Thomas Tanner, 1998
5
6 NOTE: The canonical source of this file is maintained with the
7 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
8
9 GNU Libltdl is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 As a special exception to the GNU Lesser General Public License,
15 if you distribute this file as part of a program or library that
16 is built using GNU Libtool, you may include this file under the
17 same distribution terms that you use for the rest of that program.
18
19 GNU Libltdl is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU Lesser General Public License for more details.
23
24 You should have received a copy of the GNU Lesser General Public
25 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
26 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
27 or obtained by writing to the Free Software Foundation, Inc.,
28 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 */
30
31 #include "lt__private.h"
32 #include "lt_dlloader.h"
33
34 /* Use the preprocessor to rename non-static symbols to avoid namespace
35 collisions when the loader code is statically linked into libltdl.
36 Use the "<module_name>_LTX_" prefix so that the symbol addresses can
37 be fetched from the preloaded symbol list by lt_dlsym(): */
38 #define get_vtable load_add_on_LTX_get_vtable
39
40 LT_BEGIN_C_DECLS
41 LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data);
42 LT_END_C_DECLS
43
44
45 /* Boilerplate code to set up the vtable for hooking this loader into
46 libltdl's loader list: */
47 static int vl_exit (lt_user_data loader_data);
48 static lt_module vm_open (lt_user_data loader_data, const char *filename,
49 lt_dladvise advise);
50 static int vm_close (lt_user_data loader_data, lt_module module);
51 static void * vm_sym (lt_user_data loader_data, lt_module module,
52 const char *symbolname);
53
54 static lt_dlvtable *vtable = 0;
55
56 /* Return the vtable for this loader, only the name and sym_prefix
57 attributes (plus the virtual function implementations, obviously)
58 change between loaders. */
59 lt_dlvtable *
60 get_vtable (lt_user_data loader_data)
61 {
62 if (!vtable)
63 {
64 vtable = lt__zalloc (sizeof *vtable);
65 }
66
67 if (vtable && !vtable->name)
68 {
69 vtable->name = "lt_load_add_on";
70 vtable->module_open = vm_open;
71 vtable->module_close = vm_close;
72 vtable->find_sym = vm_sym;
73 vtable->dlloader_exit = vl_exit;
74 vtable->dlloader_data = loader_data;
75 vtable->priority = LT_DLLOADER_APPEND;
76 }
77
78 if (vtable && (vtable->dlloader_data != loader_data))
79 {
80 LT__SETERROR (INIT_LOADER);
81 return 0;
82 }
83
84 return vtable;
85 }
86
87
88
89 /* --- IMPLEMENTATION --- */
90
91
92 #include <kernel/image.h>
93
94 /* A function called through the vtable when this loader is no
95 longer needed by the application. */
96 static int
97 vl_exit (lt_user_data LT__UNUSED loader_data)
98 {
99 vtable = NULL;
100 return 0;
101 }
102
103 /* A function called through the vtable to open a module with this
104 loader. Returns an opaque representation of the newly opened
105 module for processing with this loader's other vtable functions. */
106 static lt_module
107 vm_open (lt_user_data LT__UNUSED loader_data, const char *filename,
108 lt_dladvise LT__UNUSED advise)
109 {
110 image_id image = 0;
111
112 if (filename)
113 {
114 image = load_add_on (filename);
115 }
116 else
117 {
118 image_info info;
119 int32 cookie = 0;
120 if (get_next_image_info (0, &cookie, &info) == B_OK)
121 image = load_add_on (info.name);
122 }
123
124 if (image <= 0)
125 {
126 LT__SETERROR (CANNOT_OPEN);
127 image = 0;
128 }
129
130 return (lt_module) image;
131 }
132
133
134 /* A function called through the vtable when a particular module
135 should be unloaded. */
136 static int
137 vm_close (lt_user_data LT__UNUSED loader_data, lt_module module)
138 {
139 int errors = 0;
140
141 if (unload_add_on ((image_id) module) != B_OK)
142 {
143 LT__SETERROR (CANNOT_CLOSE);
144 ++errors;
145 }
146
147 return errors;
148 }
149
150
151 /* A function called through the vtable to get the address of
152 a symbol loaded from a particular module. */
153 static void *
154 vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name)
155 {
156 void *address = 0;
157 image_id image = (image_id) module;
158
159 if (get_image_symbol (image, name, B_SYMBOL_TYPE_ANY, address) != B_OK)
160 {
161 LT__SETERROR (SYMBOL_NOT_FOUND);
162 address = 0;
163 }
164
165 return address;
166 }
0 /* loader-loadlibrary.c -- dynamic linking for Win32
1
2 Copyright (C) 1998, 1999, 2000, 2004, 2005, 2006,
3 2007, 2008 Free Software Foundation, Inc.
4 Written by Thomas Tanner, 1998
5
6 NOTE: The canonical source of this file is maintained with the
7 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
8
9 GNU Libltdl is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 As a special exception to the GNU Lesser General Public License,
15 if you distribute this file as part of a program or library that
16 is built using GNU Libtool, you may include this file under the
17 same distribution terms that you use for the rest of that program.
18
19 GNU Libltdl is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU Lesser General Public License for more details.
23
24 You should have received a copy of the GNU Lesser General Public
25 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
26 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
27 or obtained by writing to the Free Software Foundation, Inc.,
28 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 */
30
31 #include "lt__private.h"
32 #include "lt_dlloader.h"
33
34 #if defined(__CYGWIN__)
35 # include <sys/cygwin.h>
36 #endif
37
38 /* Use the preprocessor to rename non-static symbols to avoid namespace
39 collisions when the loader code is statically linked into libltdl.
40 Use the "<module_name>_LTX_" prefix so that the symbol addresses can
41 be fetched from the preloaded symbol list by lt_dlsym(): */
42 #define get_vtable loadlibrary_LTX_get_vtable
43
44 LT_BEGIN_C_DECLS
45 LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data);
46 LT_END_C_DECLS
47
48
49 /* Boilerplate code to set up the vtable for hooking this loader into
50 libltdl's loader list: */
51 static int vl_exit (lt_user_data loader_data);
52 static lt_module vm_open (lt_user_data loader_data, const char *filename,
53 lt_dladvise advise);
54 static int vm_close (lt_user_data loader_data, lt_module module);
55 static void * vm_sym (lt_user_data loader_data, lt_module module,
56 const char *symbolname);
57
58 static lt_dlinterface_id iface_id = 0;
59 static lt_dlvtable *vtable = 0;
60
61 /* Return the vtable for this loader, only the name and sym_prefix
62 attributes (plus the virtual function implementations, obviously)
63 change between loaders. */
64 lt_dlvtable *
65 get_vtable (lt_user_data loader_data)
66 {
67 if (!vtable)
68 {
69 vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable);
70 iface_id = lt_dlinterface_register ("ltdl loadlibrary", NULL);
71 }
72
73 if (vtable && !vtable->name)
74 {
75 vtable->name = "lt_loadlibrary";
76 vtable->module_open = vm_open;
77 vtable->module_close = vm_close;
78 vtable->find_sym = vm_sym;
79 vtable->dlloader_exit = vl_exit;
80 vtable->dlloader_data = loader_data;
81 vtable->priority = LT_DLLOADER_APPEND;
82 }
83
84 if (vtable && (vtable->dlloader_data != loader_data))
85 {
86 LT__SETERROR (INIT_LOADER);
87 return 0;
88 }
89
90 return vtable;
91 }
92
93
94
95 /* --- IMPLEMENTATION --- */
96
97
98 #include <windows.h>
99
100 /* A function called through the vtable when this loader is no
101 longer needed by the application. */
102 static int
103 vl_exit (lt_user_data LT__UNUSED loader_data)
104 {
105 vtable = NULL;
106 return 0;
107 }
108
109 /* A function called through the vtable to open a module with this
110 loader. Returns an opaque representation of the newly opened
111 module for processing with this loader's other vtable functions. */
112 static lt_module
113 vm_open (lt_user_data LT__UNUSED loader_data, const char *filename,
114 lt_dladvise LT__UNUSED advise)
115 {
116 lt_module module = 0;
117 char *ext;
118 char wpath[MAX_PATH];
119 size_t len;
120
121 if (!filename)
122 {
123 /* Get the name of main module */
124 *wpath = 0;
125 GetModuleFileName (NULL, wpath, sizeof (wpath));
126 filename = wpath;
127 }
128 else
129 {
130 len = LT_STRLEN (filename);
131
132 if (len >= MAX_PATH)
133 {
134 LT__SETERROR (CANNOT_OPEN);
135 return 0;
136 }
137
138 #if HAVE_DECL_CYGWIN_CONV_PATH
139 if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, filename, wpath, MAX_PATH))
140 {
141 LT__SETERROR (CANNOT_OPEN);
142 return 0;
143 }
144 len = 0;
145 #elif defined(__CYGWIN__)
146 cygwin_conv_to_full_win32_path (filename, wpath);
147 len = 0;
148 #else
149 strcpy(wpath, filename);
150 #endif
151
152 ext = strrchr (wpath, '.');
153 if (!ext)
154 {
155 /* Append a `.' to stop Windows from adding an
156 implicit `.dll' extension. */
157 if (!len)
158 len = LT_STRLEN (wpath);
159
160 if (len + 1 >= MAX_PATH)
161 {
162 LT__SETERROR (CANNOT_OPEN);
163 return 0;
164 }
165
166 wpath[len] = '.';
167 wpath[len+1] = '\0';
168 }
169 }
170
171 {
172 /* Silence dialog from LoadLibrary on some failures.
173 No way to get the error mode, but to set it,
174 so set it twice to preserve any previous flags. */
175 UINT errormode = SetErrorMode(SEM_FAILCRITICALERRORS);
176 SetErrorMode(errormode | SEM_FAILCRITICALERRORS);
177
178 module = LoadLibrary (wpath);
179
180 /* Restore the error mode. */
181 SetErrorMode(errormode);
182 }
183
184 /* libltdl expects this function to fail if it is unable
185 to physically load the library. Sadly, LoadLibrary
186 will search the loaded libraries for a match and return
187 one of them if the path search load fails.
188
189 We check whether LoadLibrary is returning a handle to
190 an already loaded module, and simulate failure if we
191 find one. */
192 {
193 lt_dlhandle cur = 0;
194
195 while ((cur = lt_dlhandle_iterate (iface_id, cur)))
196 {
197 if (!cur->module)
198 {
199 cur = 0;
200 break;
201 }
202
203 if (cur->module == module)
204 {
205 break;
206 }
207 }
208
209 if (cur || !module)
210 {
211 LT__SETERROR (CANNOT_OPEN);
212 module = 0;
213 }
214 }
215
216 return module;
217 }
218
219
220 /* A function called through the vtable when a particular module
221 should be unloaded. */
222 static int
223 vm_close (lt_user_data LT__UNUSED loader_data, lt_module module)
224 {
225 int errors = 0;
226
227 if (FreeLibrary((HMODULE) module) == 0)
228 {
229 LT__SETERROR (CANNOT_CLOSE);
230 ++errors;
231 }
232
233 return errors;
234 }
235
236
237 /* A function called through the vtable to get the address of
238 a symbol loaded from a particular module. */
239 static void *
240 vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name)
241 {
242 void *address = (void *) GetProcAddress ((HMODULE) module, name);
243
244 if (!address)
245 {
246 LT__SETERROR (SYMBOL_NOT_FOUND);
247 }
248
249 return address;
250 }
0 /* loader-preopen.c -- emulate dynamic linking using preloaded_symbols
1
2 Copyright (C) 1998, 1999, 2000, 2004, 2006,
3 2007, 2008 Free Software Foundation, Inc.
4 Written by Thomas Tanner, 1998
5
6 NOTE: The canonical source of this file is maintained with the
7 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
8
9 GNU Libltdl is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 As a special exception to the GNU Lesser General Public License,
15 if you distribute this file as part of a program or library that
16 is built using GNU Libtool, you may include this file under the
17 same distribution terms that you use for the rest of that program.
18
19 GNU Libltdl is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU Lesser General Public License for more details.
23
24 You should have received a copy of the GNU Lesser General Public
25 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
26 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
27 or obtained by writing to the Free Software Foundation, Inc.,
28 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 */
30
31 #include "lt__private.h"
32 #include "lt_dlloader.h"
33
34 /* Use the preprocessor to rename non-static symbols to avoid namespace
35 collisions when the loader code is statically linked into libltdl.
36 Use the "<module_name>_LTX_" prefix so that the symbol addresses can
37 be fetched from the preloaded symbol list by lt_dlsym(): */
38 #define get_vtable preopen_LTX_get_vtable
39
40 LT_BEGIN_C_DECLS
41 LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data);
42 LT_END_C_DECLS
43
44
45 /* Boilerplate code to set up the vtable for hooking this loader into
46 libltdl's loader list: */
47 static int vl_init (lt_user_data loader_data);
48 static int vl_exit (lt_user_data loader_data);
49 static lt_module vm_open (lt_user_data loader_data, const char *filename,
50 lt_dladvise advise);
51 static int vm_close (lt_user_data loader_data, lt_module module);
52 static void * vm_sym (lt_user_data loader_data, lt_module module,
53 const char *symbolname);
54
55 static lt_dlvtable *vtable = 0;
56
57 /* Return the vtable for this loader, only the name and sym_prefix
58 attributes (plus the virtual function implementations, obviously)
59 change between loaders. */
60 lt_dlvtable *
61 get_vtable (lt_user_data loader_data)
62 {
63 if (!vtable)
64 {
65 vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable);
66 }
67
68 if (vtable && !vtable->name)
69 {
70 vtable->name = "lt_preopen";
71 vtable->sym_prefix = 0;
72 vtable->module_open = vm_open;
73 vtable->module_close = vm_close;
74 vtable->find_sym = vm_sym;
75 vtable->dlloader_init = vl_init;
76 vtable->dlloader_exit = vl_exit;
77 vtable->dlloader_data = loader_data;
78 vtable->priority = LT_DLLOADER_PREPEND;
79 }
80
81 if (vtable && (vtable->dlloader_data != loader_data))
82 {
83 LT__SETERROR (INIT_LOADER);
84 return 0;
85 }
86
87 return vtable;
88 }
89
90
91
92 /* --- IMPLEMENTATION --- */
93
94
95 /* Wrapper type to chain together symbol lists of various origins. */
96 typedef struct symlist_chain
97 {
98 struct symlist_chain *next;
99 const lt_dlsymlist *symlist;
100 } symlist_chain;
101
102
103 static int add_symlist (const lt_dlsymlist *symlist);
104 static int free_symlists (void);
105
106 /* The start of the symbol lists chain. */
107 static symlist_chain *preloaded_symlists = 0;
108
109 /* A symbol list preloaded before lt_init() was called. */
110 static const lt_dlsymlist *default_preloaded_symbols = 0;
111
112
113 /* A function called through the vtable to initialise this loader. */
114 static int
115 vl_init (lt_user_data LT__UNUSED loader_data)
116 {
117 int errors = 0;
118
119 preloaded_symlists = 0;
120 if (default_preloaded_symbols)
121 {
122 errors = lt_dlpreload (default_preloaded_symbols);
123 }
124
125 return errors;
126 }
127
128
129 /* A function called through the vtable when this loader is no
130 longer needed by the application. */
131 static int
132 vl_exit (lt_user_data LT__UNUSED loader_data)
133 {
134 vtable = NULL;
135 free_symlists ();
136 return 0;
137 }
138
139
140 /* A function called through the vtable to open a module with this
141 loader. Returns an opaque representation of the newly opened
142 module for processing with this loader's other vtable functions. */
143 static lt_module
144 vm_open (lt_user_data LT__UNUSED loader_data, const char *filename,
145 lt_dladvise LT__UNUSED advise)
146 {
147 symlist_chain *lists;
148 lt_module module = 0;
149
150 if (!preloaded_symlists)
151 {
152 LT__SETERROR (NO_SYMBOLS);
153 goto done;
154 }
155
156 /* Can't use NULL as the reflective symbol header, as NULL is
157 used to mark the end of the entire symbol list. Self-dlpreopened
158 symbols follow this magic number, chosen to be an unlikely
159 clash with a real module name. */
160 if (!filename)
161 {
162 filename = "@PROGRAM@";
163 }
164
165 for (lists = preloaded_symlists; lists; lists = lists->next)
166 {
167 const lt_dlsymlist *symbol;
168 for (symbol= lists->symlist; symbol->name; ++symbol)
169 {
170 if (!symbol->address && streq (symbol->name, filename))
171 {
172 /* If the next symbol's name and address is 0, it means
173 the module just contains the originator and no symbols.
174 In this case we pretend that we never saw the module and
175 hope that some other loader will be able to load the module
176 and have access to its symbols */
177 const lt_dlsymlist *next_symbol = symbol +1;
178 if (next_symbol->address && next_symbol->name)
179 {
180 module = (lt_module) lists->symlist;
181 goto done;
182 }
183 }
184 }
185 }
186
187 LT__SETERROR (FILE_NOT_FOUND);
188
189 done:
190 return module;
191 }
192
193
194 /* A function called through the vtable when a particular module
195 should be unloaded. */
196 static int
197 vm_close (lt_user_data LT__UNUSED loader_data, lt_module LT__UNUSED module)
198 {
199 /* Just to silence gcc -Wall */
200 module = 0;
201 return 0;
202 }
203
204
205 /* A function called through the vtable to get the address of
206 a symbol loaded from a particular module. */
207 static void *
208 vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name)
209 {
210 lt_dlsymlist *symbol = (lt_dlsymlist*) module;
211
212 symbol +=2; /* Skip header (originator then libname). */
213
214 while (symbol->name)
215 {
216 if (streq (symbol->name, name))
217 {
218 return symbol->address;
219 }
220
221 ++symbol;
222 }
223
224 LT__SETERROR (SYMBOL_NOT_FOUND);
225
226 return 0;
227 }
228
229
230
231 /* --- HELPER FUNCTIONS --- */
232
233
234 /* The symbol lists themselves are not allocated from the heap, but
235 we can unhook them and free up the chain of links between them. */
236 static int
237 free_symlists (void)
238 {
239 symlist_chain *lists;
240
241 lists = preloaded_symlists;
242 while (lists)
243 {
244 symlist_chain *next = lists->next;
245 FREE (lists);
246 lists = next;
247 }
248 preloaded_symlists = 0;
249
250 return 0;
251 }
252
253 /* Add a new symbol list to the global chain. */
254 static int
255 add_symlist (const lt_dlsymlist *symlist)
256 {
257 symlist_chain *lists;
258 int errors = 0;
259
260 /* Search for duplicate entries: */
261 for (lists = preloaded_symlists;
262 lists && lists->symlist != symlist; lists = lists->next)
263 /*NOWORK*/;
264
265 /* Don't add the same list twice: */
266 if (!lists)
267 {
268 symlist_chain *tmp = (symlist_chain *) lt__zalloc (sizeof *tmp);
269
270 if (tmp)
271 {
272 tmp->symlist = symlist;
273 tmp->next = preloaded_symlists;
274 preloaded_symlists = tmp;
275 }
276 else
277 {
278 ++errors;
279 }
280 }
281
282 return errors;
283 }
284
285
286
287 /* --- PRELOADING API CALL IMPLEMENTATIONS --- */
288
289
290 /* Save a default symbol list for later. */
291 int
292 lt_dlpreload_default (const lt_dlsymlist *preloaded)
293 {
294 default_preloaded_symbols = preloaded;
295 return 0;
296 }
297
298
299 /* Add a symbol list to the global chain, or with a NULL argument,
300 revert to just the default list. */
301 int
302 lt_dlpreload (const lt_dlsymlist *preloaded)
303 {
304 int errors = 0;
305
306 if (preloaded)
307 {
308 errors = add_symlist (preloaded);
309 }
310 else
311 {
312 free_symlists();
313
314 if (default_preloaded_symbols)
315 {
316 errors = lt_dlpreload (default_preloaded_symbols);
317 }
318 }
319
320 return errors;
321 }
322
323
324 /* Open all the preloaded modules from the named originator, executing
325 a callback for each one. If ORIGINATOR is NULL, then call FUNC for
326 each preloaded module from the program itself. */
327 int
328 lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func)
329 {
330 symlist_chain *list;
331 int errors = 0;
332 int found = 0;
333
334 /* For each symlist in the chain... */
335 for (list = preloaded_symlists; list; list = list->next)
336 {
337 /* ...that was preloaded by the requesting ORIGINATOR... */
338 if ((originator && streq (list->symlist->name, originator))
339 || (!originator && streq (list->symlist->name, "@PROGRAM@")))
340 {
341 const lt_dlsymlist *symbol;
342 unsigned int idx = 0;
343
344 ++found;
345
346 /* ...load the symbols per source compilation unit:
347 (we preincrement the index to skip over the originator entry) */
348 while ((symbol = &list->symlist[++idx])->name != 0)
349 {
350 if ((symbol->address == 0)
351 && (strneq (symbol->name, "@PROGRAM@")))
352 {
353 lt_dlhandle handle = lt_dlopen (symbol->name);
354 if (handle == 0)
355 {
356 ++errors;
357 }
358 else
359 {
360 errors += (*func) (handle);
361 }
362 }
363 }
364 }
365 }
366
367 if (!found)
368 {
369 LT__SETERROR(CANNOT_OPEN);
370 ++errors;
371 }
372
373 return errors;
374 }
0 /* loader-shl_load.c -- dynamic linking with shl_load (HP-UX)
1
2 Copyright (C) 1998, 1999, 2000, 2004, 2006,
3 2007, 2008 Free Software Foundation, Inc.
4 Written by Thomas Tanner, 1998
5
6 NOTE: The canonical source of this file is maintained with the
7 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
8
9 GNU Libltdl is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 As a special exception to the GNU Lesser General Public License,
15 if you distribute this file as part of a program or library that
16 is built using GNU Libtool, you may include this file under the
17 same distribution terms that you use for the rest of that program.
18
19 GNU Libltdl is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU Lesser General Public License for more details.
23
24 You should have received a copy of the GNU Lesser General Public
25 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
26 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
27 or obtained by writing to the Free Software Foundation, Inc.,
28 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 */
30
31 #include "lt__private.h"
32 #include "lt_dlloader.h"
33
34 /* Use the preprocessor to rename non-static symbols to avoid namespace
35 collisions when the loader code is statically linked into libltdl.
36 Use the "<module_name>_LTX_" prefix so that the symbol addresses can
37 be fetched from the preloaded symbol list by lt_dlsym(): */
38 #define get_vtable shl_load_LTX_get_vtable
39
40 LT_BEGIN_C_DECLS
41 LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data);
42 LT_END_C_DECLS
43
44
45 /* Boilerplate code to set up the vtable for hooking this loader into
46 libltdl's loader list: */
47 static int vl_exit (lt_user_data loader_data);
48 static lt_module vm_open (lt_user_data loader_data, const char *filename,
49 lt_dladvise advise);
50 static int vm_close (lt_user_data loader_data, lt_module module);
51 static void * vm_sym (lt_user_data loader_data, lt_module module,
52 const char *symbolname);
53
54 static lt_dlvtable *vtable = 0;
55
56 /* Return the vtable for this loader, only the name and sym_prefix
57 attributes (plus the virtual function implementations, obviously)
58 change between loaders. */
59 lt_dlvtable *
60 get_vtable (lt_user_data loader_data)
61 {
62 if (!vtable)
63 {
64 vtable = lt__zalloc (sizeof *vtable);
65 }
66
67 if (vtable && !vtable->name)
68 {
69 vtable->name = "lt_shl_load";
70 vtable->module_open = vm_open;
71 vtable->module_close = vm_close;
72 vtable->find_sym = vm_sym;
73 vtable->dlloader_exit = vl_exit;
74 vtable->dlloader_data = loader_data;
75 vtable->priority = LT_DLLOADER_APPEND;
76 }
77
78 if (vtable && (vtable->dlloader_data != loader_data))
79 {
80 LT__SETERROR (INIT_LOADER);
81 return 0;
82 }
83
84 return vtable;
85 }
86
87
88
89 /* --- IMPLEMENTATION --- */
90
91
92 #if defined(HAVE_DL_H)
93 # include <dl.h>
94 #endif
95
96 /* some flags are missing on some systems, so we provide
97 * harmless defaults.
98 *
99 * Mandatory:
100 * BIND_IMMEDIATE - Resolve symbol references when the library is loaded.
101 * BIND_DEFERRED - Delay code symbol resolution until actual reference.
102 *
103 * Optionally:
104 * BIND_FIRST - Place the library at the head of the symbol search
105 * order.
106 * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all
107 * unsatisfied symbols as fatal. This flag allows
108 * binding of unsatisfied code symbols to be deferred
109 * until use.
110 * [Perl: For certain libraries, like DCE, deferred
111 * binding often causes run time problems. Adding
112 * BIND_NONFATAL to BIND_IMMEDIATE still allows
113 * unresolved references in situations like this.]
114 * BIND_NOSTART - Do not call the initializer for the shared library
115 * when the library is loaded, nor on a future call to
116 * shl_unload().
117 * BIND_VERBOSE - Print verbose messages concerning possible
118 * unsatisfied symbols.
119 *
120 * hp9000s700/hp9000s800:
121 * BIND_RESTRICTED - Restrict symbols visible by the library to those
122 * present at library load time.
123 * DYNAMIC_PATH - Allow the loader to dynamically search for the
124 * library specified by the path argument.
125 */
126
127 #if !defined(DYNAMIC_PATH)
128 # define DYNAMIC_PATH 0
129 #endif
130 #if !defined(BIND_RESTRICTED)
131 # define BIND_RESTRICTED 0
132 #endif
133
134 #define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH)
135
136
137 /* A function called through the vtable when this loader is no
138 longer needed by the application. */
139 static int
140 vl_exit (lt_user_data LT__UNUSED loader_data)
141 {
142 vtable = NULL;
143 return 0;
144 }
145
146 /* A function called through the vtable to open a module with this
147 loader. Returns an opaque representation of the newly opened
148 module for processing with this loader's other vtable functions. */
149 static lt_module
150 vm_open (lt_user_data LT__UNUSED loader_data, const char *filename,
151 lt_dladvise LT__UNUSED advise)
152 {
153 static shl_t self = (shl_t) 0;
154 lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L);
155
156 /* Since searching for a symbol against a NULL module handle will also
157 look in everything else that was already loaded and exported with
158 the -E compiler flag, we always cache a handle saved before any
159 modules are loaded. */
160 if (!self)
161 {
162 void *address;
163 shl_findsym (&self, "main", TYPE_UNDEFINED, &address);
164 }
165
166 if (!filename)
167 {
168 module = self;
169 }
170 else
171 {
172 module = shl_load (filename, LT_BIND_FLAGS, 0L);
173
174 if (!module)
175 {
176 LT__SETERROR (CANNOT_OPEN);
177 }
178 }
179
180 return module;
181 }
182
183 /* A function called through the vtable when a particular module
184 should be unloaded. */
185 static int
186 vm_close (lt_user_data LT__UNUSED loader_data, lt_module module)
187 {
188 int errors = 0;
189
190 if (module && (shl_unload ((shl_t) (module)) != 0))
191 {
192 LT__SETERROR (CANNOT_CLOSE);
193 ++errors;
194 }
195
196 return errors;
197 }
198
199
200 /* A function called through the vtable to get the address of
201 a symbol loaded from a particular module. */
202 static void *
203 vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name)
204 {
205 void *address = 0;
206
207 /* sys_shl_open should never return a NULL module handle */
208 if (module == (lt_module) 0)
209 {
210 LT__SETERROR (INVALID_HANDLE);
211 }
212 else if (!shl_findsym((shl_t*) &module, name, TYPE_UNDEFINED, &address))
213 {
214 if (!address)
215 {
216 LT__SETERROR (SYMBOL_NOT_FOUND);
217 }
218 }
219
220 return address;
221 }
0 /* lt__alloc.c -- internal memory management interface
1
2 Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
3 Written by Gary V. Vaughan, 2004
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29
30 #include "lt__private.h"
31
32 #include <stdio.h>
33
34 #include "lt__alloc.h"
35
36 static void alloc_die_default (void);
37
38 void (*lt__alloc_die) (void) = alloc_die_default;
39
40 /* Unless overridden, exit on memory failure. */
41 static void
42 alloc_die_default (void)
43 {
44 fprintf (stderr, "Out of memory.\n");
45 exit (EXIT_FAILURE);
46 }
47
48 void *
49 lt__malloc (size_t n)
50 {
51 void *mem;
52
53 if (! (mem = malloc (n)))
54 (*lt__alloc_die) ();
55
56 return mem;
57 }
58
59 void *
60 lt__zalloc (size_t n)
61 {
62 void *mem;
63
64 if ((mem = lt__malloc (n)))
65 memset (mem, 0, n);
66
67 return mem;
68 }
69
70 void *
71 lt__realloc (void *mem, size_t n)
72 {
73 if (! (mem = realloc (mem, n)))
74 (*lt__alloc_die) ();
75
76 return mem;
77 }
78
79 void *
80 lt__memdup (void const *mem, size_t n)
81 {
82 void *newmem;
83
84 if ((newmem = lt__malloc (n)))
85 return memcpy (newmem, mem, n);
86
87 return 0;
88 }
89
90 char *
91 lt__strdup (const char *string)
92 {
93 return (char *) lt__memdup (string, strlen (string) +1);
94 }
0 /* lt__dirent.c -- internal directory entry scanning interface
1
2 Copyright (C) 2001, 2004 Free Software Foundation, Inc.
3 Written by Bob Friesenhahn, 2001
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29
30 #include "lt__private.h"
31
32 #include <assert.h>
33 #include <stddef.h>
34
35 #include "lt__dirent.h"
36
37 #if defined(__WINDOWS__)
38
39 void
40 closedir (DIR *entry)
41 {
42 assert (entry != (DIR *) NULL);
43 FindClose (entry->hSearch);
44 free ((void *) entry);
45 }
46
47
48 DIR *
49 opendir (const char *path)
50 {
51 char file_spec[LT_FILENAME_MAX];
52 DIR *entry;
53
54 assert (path != (char *) 0);
55 if (lt_strlcpy (file_spec, path, sizeof file_spec) >= sizeof file_spec
56 || lt_strlcat (file_spec, "\\", sizeof file_spec) >= sizeof file_spec)
57 return (DIR *) 0;
58 entry = (DIR *) malloc (sizeof(DIR));
59 if (entry != (DIR *) 0)
60 {
61 entry->firsttime = TRUE;
62 entry->hSearch = FindFirstFile (file_spec, &entry->Win32FindData);
63
64 if (entry->hSearch == INVALID_HANDLE_VALUE)
65 {
66 if (lt_strlcat (file_spec, "\\*.*", sizeof file_spec) < sizeof file_spec)
67 {
68 entry->hSearch = FindFirstFile (file_spec, &entry->Win32FindData);
69 }
70
71 if (entry->hSearch == INVALID_HANDLE_VALUE)
72 {
73 entry = (free (entry), (DIR *) 0);
74 }
75 }
76 }
77
78 return entry;
79 }
80
81
82 struct dirent *
83 readdir (DIR *entry)
84 {
85 int status;
86
87 if (entry == (DIR *) 0)
88 return (struct dirent *) 0;
89
90 if (!entry->firsttime)
91 {
92 status = FindNextFile (entry->hSearch, &entry->Win32FindData);
93 if (status == 0)
94 return (struct dirent *) 0;
95 }
96
97 entry->firsttime = FALSE;
98 if (lt_strlcpy (entry->file_info.d_name, entry->Win32FindData.cFileName,
99 sizeof entry->file_info.d_name) >= sizeof entry->file_info.d_name)
100 return (struct dirent *) 0;
101 entry->file_info.d_namlen = strlen (entry->file_info.d_name);
102
103 return &entry->file_info;
104 }
105
106 #endif /*defined(__WINDOWS__)*/
0 /* lt__strl.c -- size-bounded string copying and concatenation
1
2 Copyright (C) 2004 Free Software Foundation, Inc.
3 Written by Bob Friesenhahn, 2004
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29
30 #include <assert.h>
31 #include <string.h>
32
33 #include "lt__strl.h"
34
35 /*
36 lt_strlcat appends the NULL-terminated string src to the end of dst.
37 It will append at most dstsize - strlen(dst) - 1 bytes,
38 NULL-terminating the result. The total length of the string which
39 would have been created given sufficient buffer size (may be longer
40 than dstsize) is returned. This function substitutes for strlcat()
41 which is available under NetBSD, FreeBSD and Solaris 9.
42
43 Buffer overflow can be checked as follows:
44
45 if (lt_strlcat(dst, src, dstsize) >= dstsize)
46 return -1;
47 */
48 #if !defined(HAVE_STRLCAT)
49 size_t
50 lt_strlcat(char *dst, const char *src, const size_t dstsize)
51 {
52 size_t length;
53 char *p;
54 const char *q;
55
56 assert(dst != NULL);
57 assert(src != (const char *) NULL);
58 assert(dstsize >= 1);
59
60 length=strlen(dst);
61
62 /*
63 Copy remaining characters from src while constraining length to
64 size - 1.
65 */
66 for ( p = dst + length, q = src;
67 (*q != 0) && (length < dstsize - 1) ;
68 length++, p++, q++ )
69 *p = *q;
70
71 dst[length]='\0';
72
73 /*
74 Add remaining length of src to length.
75 */
76 while (*q++)
77 length++;
78
79 return length;
80 }
81 #endif /* !defined(HAVE_STRLCAT) */
82
83 /*
84 lt_strlcpy copies up to dstsize - 1 characters from the NULL-terminated
85 string src to dst, NULL-terminating the result. The total length of
86 the string which would have been created given sufficient buffer
87 size (may be longer than dstsize) is returned. This function
88 substitutes for strlcpy() which is available under OpenBSD, FreeBSD
89 and Solaris 9.
90
91 Buffer overflow can be checked as follows:
92
93 if (lt_strlcpy(dst, src, dstsize) >= dstsize)
94 return -1;
95 */
96 #if !defined(HAVE_STRLCPY)
97 size_t
98 lt_strlcpy(char *dst, const char *src, const size_t dstsize)
99 {
100 size_t length=0;
101 char *p;
102 const char *q;
103
104 assert(dst != NULL);
105 assert(src != (const char *) NULL);
106 assert(dstsize >= 1);
107
108 /*
109 Copy src to dst within bounds of size-1.
110 */
111 for ( p=dst, q=src, length=0 ;
112 (*q != 0) && (length < dstsize-1) ;
113 length++, p++, q++ )
114 *p = *q;
115
116 dst[length]='\0';
117
118 /*
119 Add remaining length of src to length.
120 */
121 while (*q++)
122 length++;
123
124 return length;
125 }
126 #endif /* !defined(HAVE_STRLCPY) */
0 /* lt_dlloader.c -- dynamic library loader interface
1
2 Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc.
3 Written by Gary V. Vaughan, 2004
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29
30 #include "lt__private.h"
31 #include "lt_dlloader.h"
32
33 #define RETURN_SUCCESS 0
34 #define RETURN_FAILURE 1
35
36 static void * loader_callback (SList *item, void *userdata);
37
38 /* A list of all the dlloaders we know about, each stored as a boxed
39 SList item: */
40 static SList *loaders = 0;
41
42
43 /* Return NULL, unless the loader in this ITEM has a matching name,
44 in which case we return the matching item so that its address is
45 passed back out (for possible freeing) by slist_remove. */
46 static void *
47 loader_callback (SList *item, void *userdata)
48 {
49 const lt_dlvtable *vtable = (const lt_dlvtable *) item->userdata;
50 const char * name = (const char *) userdata;
51
52 assert (vtable);
53
54 return streq (vtable->name, name) ? (void *) item : NULL;
55 }
56
57
58 /* Hook VTABLE into our global LOADERS list according to its own
59 PRIORITY field value. */
60 int
61 lt_dlloader_add (const lt_dlvtable *vtable)
62 {
63 SList *item;
64
65 if ((vtable == 0) /* diagnose invalid vtable fields */
66 || (vtable->module_open == 0)
67 || (vtable->module_close == 0)
68 || (vtable->find_sym == 0)
69 || ((vtable->priority != LT_DLLOADER_PREPEND) &&
70 (vtable->priority != LT_DLLOADER_APPEND)))
71 {
72 LT__SETERROR (INVALID_LOADER);
73 return RETURN_FAILURE;
74 }
75
76 item = slist_box (vtable);
77 if (!item)
78 {
79 (*lt__alloc_die) ();
80
81 /* Let the caller know something went wrong if lt__alloc_die
82 doesn't abort. */
83 return RETURN_FAILURE;
84 }
85
86 if (vtable->priority == LT_DLLOADER_PREPEND)
87 {
88 loaders = slist_cons (item, loaders);
89 }
90 else
91 {
92 assert (vtable->priority == LT_DLLOADER_APPEND);
93 loaders = slist_concat (loaders, item);
94 }
95
96 return RETURN_SUCCESS;
97 }
98
99 #ifdef LT_DEBUG_LOADERS
100 static void *
101 loader_dump_callback (SList *item, void *userdata)
102 {
103 const lt_dlvtable *vtable = (const lt_dlvtable *) item->userdata;
104 fprintf (stderr, ", %s", (vtable && vtable->name) ? vtable->name : "(null)");
105 return 0;
106 }
107
108 void
109 lt_dlloader_dump (void)
110 {
111 fprintf (stderr, "loaders: ");
112 if (!loaders)
113 {
114 fprintf (stderr, "(empty)");
115 }
116 else
117 {
118 const lt_dlvtable *head = (const lt_dlvtable *) loaders->userdata;
119 fprintf (stderr, "%s", (head && head->name) ? head->name : "(null)");
120 if (slist_tail (loaders))
121 slist_foreach (slist_tail (loaders), loader_dump_callback, NULL);
122 }
123 fprintf (stderr, "\n");
124 }
125 #endif
126
127 /* An iterator for the global loader list: if LOADER is NULL, then
128 return the first element, otherwise the following element. */
129 lt_dlloader
130 lt_dlloader_next (lt_dlloader loader)
131 {
132 SList *item = (SList *) loader;
133 return (lt_dlloader) (item ? item->next : loaders);
134 }
135
136
137 /* Non-destructive unboxing of a loader. */
138 const lt_dlvtable *
139 lt_dlloader_get (lt_dlloader loader)
140 {
141 return (const lt_dlvtable *) (loader ? ((SList *) loader)->userdata : NULL);
142 }
143
144
145 /* Return the contents of the first item in the global loader list
146 with a matching NAME after removing it from that list. If there
147 was no match, return NULL; if there is an error, return NULL and
148 set an error for lt_dlerror; do not set an error if only resident
149 modules need this loader; in either case, the loader list is not
150 changed if NULL is returned. */
151 lt_dlvtable *
152 lt_dlloader_remove (char *name)
153 {
154 const lt_dlvtable * vtable = lt_dlloader_find (name);
155 static const char id_string[] = "lt_dlloader_remove";
156 lt_dlinterface_id iface;
157 lt_dlhandle handle = 0;
158 int in_use = 0;
159 int in_use_by_resident = 0;
160
161 if (!vtable)
162 {
163 LT__SETERROR (INVALID_LOADER);
164 return 0;
165 }
166
167 /* Fail if there are any open modules which use this loader. */
168 iface = lt_dlinterface_register (id_string, NULL);
169 while ((handle = lt_dlhandle_iterate (iface, handle)))
170 {
171 lt_dlhandle cur = handle;
172 if (cur->vtable == vtable)
173 {
174 in_use = 1;
175 if (lt_dlisresident (handle))
176 in_use_by_resident = 1;
177 }
178 }
179 lt_dlinterface_free (iface);
180 if (in_use)
181 {
182 if (!in_use_by_resident)
183 LT__SETERROR (REMOVE_LOADER);
184 return 0;
185 }
186
187 /* Call the loader finalisation function. */
188 if (vtable && vtable->dlloader_exit)
189 {
190 if ((*vtable->dlloader_exit) (vtable->dlloader_data) != 0)
191 {
192 /* If there is an exit function, and it returns non-zero
193 then it must set an error, and we will not remove it
194 from the list. */
195 return 0;
196 }
197 }
198
199 /* If we got this far, remove the loader from our global list. */
200 return (lt_dlvtable *)
201 slist_unbox ((SList *) slist_remove (&loaders, loader_callback, name));
202 }
203
204
205 const lt_dlvtable *
206 lt_dlloader_find (char *name)
207 {
208 return lt_dlloader_get (slist_find (loaders, loader_callback, name));
209 }
0 /* lt_error.c -- error propogation interface
1
2 Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007 Free Software Foundation, Inc.
3 Written by Thomas Tanner, 1999
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29
30 #include "lt__private.h"
31 #include "lt_error.h"
32
33 static const char *last_error = 0;
34 static const char error_strings[LT_ERROR_MAX][LT_ERROR_LEN_MAX + 1] =
35 {
36 #define LT_ERROR(name, diagnostic) diagnostic,
37 lt_dlerror_table
38 #undef LT_ERROR
39 };
40
41 static const char **user_error_strings = 0;
42 static int errorcount = LT_ERROR_MAX;
43
44 int
45 lt_dladderror (const char *diagnostic)
46 {
47 int errindex = 0;
48 int result = -1;
49 const char **temp = (const char **) 0;
50
51 assert (diagnostic);
52
53 errindex = errorcount - LT_ERROR_MAX;
54 temp = REALLOC (const char *, user_error_strings, 1 + errindex);
55 if (temp)
56 {
57 user_error_strings = temp;
58 user_error_strings[errindex] = diagnostic;
59 result = errorcount++;
60 }
61
62 return result;
63 }
64
65 int
66 lt_dlseterror (int errindex)
67 {
68 int errors = 0;
69
70 if (errindex >= errorcount || errindex < 0)
71 {
72 /* Ack! Error setting the error message! */
73 LT__SETERROR (INVALID_ERRORCODE);
74 ++errors;
75 }
76 else if (errindex < LT_ERROR_MAX)
77 {
78 /* No error setting the error message! */
79 LT__SETERRORSTR (error_strings[errindex]);
80 }
81 else
82 {
83 /* No error setting the error message! */
84 LT__SETERRORSTR (user_error_strings[errindex - LT_ERROR_MAX]);
85 }
86
87 return errors;
88 }
89
90 const char *
91 lt__error_string (int errorcode)
92 {
93 assert (errorcode >= 0);
94 assert (errorcode < LT_ERROR_MAX);
95
96 return error_strings[errorcode];
97 }
98
99 const char *
100 lt__get_last_error (void)
101 {
102 return last_error;
103 }
104
105 const char *
106 lt__set_last_error (const char *errormsg)
107 {
108 return last_error = errormsg;
109 }
0 /* ltdl.c -- system independent dlopen wrapper
1
2 Copyright (C) 1998, 1999, 2000, 2004, 2005, 2006,
3 2007, 2008 Free Software Foundation, Inc.
4 Written by Thomas Tanner, 1998
5
6 NOTE: The canonical source of this file is maintained with the
7 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
8
9 GNU Libltdl is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 As a special exception to the GNU Lesser General Public License,
15 if you distribute this file as part of a program or library that
16 is built using GNU Libtool, you may include this file under the
17 same distribution terms that you use for the rest of that program.
18
19 GNU Libltdl is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU Lesser General Public License for more details.
23
24 You should have received a copy of the GNU Lesser General Public
25 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
26 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
27 or obtained by writing to the Free Software Foundation, Inc.,
28 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 */
30
31 #include "lt__private.h"
32 #include "lt_system.h"
33 #include "lt_dlloader.h"
34
35
36 /* --- MANIFEST CONSTANTS --- */
37
38
39 /* Standard libltdl search path environment variable name */
40 #undef LTDL_SEARCHPATH_VAR
41 #define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH"
42
43 /* Standard libtool archive file extension. */
44 #undef LT_ARCHIVE_EXT
45 #define LT_ARCHIVE_EXT ".la"
46
47 /* max. filename length */
48 #if !defined(LT_FILENAME_MAX)
49 # define LT_FILENAME_MAX 1024
50 #endif
51
52 #if !defined(LT_LIBEXT)
53 # define LT_LIBEXT "a"
54 #endif
55
56 /* This is the maximum symbol size that won't require malloc/free */
57 #undef LT_SYMBOL_LENGTH
58 #define LT_SYMBOL_LENGTH 128
59
60 /* This accounts for the _LTX_ separator */
61 #undef LT_SYMBOL_OVERHEAD
62 #define LT_SYMBOL_OVERHEAD 5
63
64 /* Various boolean flags can be stored in the flags field of an
65 lt_dlhandle... */
66 #define LT_DLIS_RESIDENT(handle) ((handle)->info.is_resident)
67 #define LT_DLIS_SYMGLOBAL(handle) ((handle)->info.is_symglobal)
68 #define LT_DLIS_SYMLOCAL(handle) ((handle)->info.is_symlocal)
69
70
71 static const char objdir[] = LT_OBJDIR;
72 static const char archive_ext[] = LT_ARCHIVE_EXT;
73 static const char libext[] = LT_LIBEXT;
74 #if defined(LT_MODULE_EXT)
75 static const char shlib_ext[] = LT_MODULE_EXT;
76 #endif
77 #if defined(LT_DLSEARCH_PATH)
78 static const char sys_dlsearch_path[] = LT_DLSEARCH_PATH;
79 #endif
80
81
82
83
84 /* --- DYNAMIC MODULE LOADING --- */
85
86
87 /* The type of a function used at each iteration of foreach_dirinpath(). */
88 typedef int foreach_callback_func (char *filename, void *data1,
89 void *data2);
90 /* foreachfile_callback itself calls a function of this type: */
91 typedef int file_worker_func (const char *filename, void *data);
92
93
94 static int foreach_dirinpath (const char *search_path,
95 const char *base_name,
96 foreach_callback_func *func,
97 void *data1, void *data2);
98 static int find_file_callback (char *filename, void *data1,
99 void *data2);
100 static int find_handle_callback (char *filename, void *data,
101 void *ignored);
102 static int foreachfile_callback (char *filename, void *data1,
103 void *data2);
104
105
106 static int canonicalize_path (const char *path, char **pcanonical);
107 static int argzize_path (const char *path,
108 char **pargz, size_t *pargz_len);
109 static FILE *find_file (const char *search_path,
110 const char *base_name, char **pdir);
111 static lt_dlhandle *find_handle (const char *search_path,
112 const char *base_name,
113 lt_dlhandle *handle,
114 lt_dladvise advise);
115 static int find_module (lt_dlhandle *handle, const char *dir,
116 const char *libdir, const char *dlname,
117 const char *old_name, int installed,
118 lt_dladvise advise);
119 static int has_library_ext (const char *filename);
120 static int load_deplibs (lt_dlhandle handle, char *deplibs);
121 static int trim (char **dest, const char *str);
122 static int try_dlopen (lt_dlhandle *handle,
123 const char *filename, const char *ext,
124 lt_dladvise advise);
125 static int tryall_dlopen (lt_dlhandle *handle,
126 const char *filename,
127 lt_dladvise padvise,
128 const lt_dlvtable *vtable);
129 static int unload_deplibs (lt_dlhandle handle);
130 static int lt_argz_insert (char **pargz, size_t *pargz_len,
131 char *before, const char *entry);
132 static int lt_argz_insertinorder (char **pargz, size_t *pargz_len,
133 const char *entry);
134 static int lt_argz_insertdir (char **pargz, size_t *pargz_len,
135 const char *dirnam, struct dirent *dp);
136 static int lt_dlpath_insertdir (char **ppath, char *before,
137 const char *dir);
138 static int list_files_by_dir (const char *dirnam,
139 char **pargz, size_t *pargz_len);
140 static int file_not_found (void);
141
142 #ifdef HAVE_LIBDLLOADER
143 static int loader_init_callback (lt_dlhandle handle);
144 #endif /* HAVE_LIBDLLOADER */
145
146 static int loader_init (lt_get_vtable *vtable_func,
147 lt_user_data data);
148
149 static char *user_search_path= 0;
150 static lt_dlhandle handles = 0;
151 static int initialized = 0;
152
153 /* Our memory failure callback sets the error message to be passed back
154 up to the client, so we must be careful to return from mallocation
155 callers if allocation fails (as this callback returns!!). */
156 void
157 lt__alloc_die_callback (void)
158 {
159 LT__SETERROR (NO_MEMORY);
160 }
161
162 #ifdef HAVE_LIBDLLOADER
163 /* This function is called to initialise each preloaded module loader,
164 and hook it into the list of loaders to be used when attempting to
165 dlopen an application module. */
166 static int
167 loader_init_callback (lt_dlhandle handle)
168 {
169 lt_get_vtable *vtable_func = (lt_get_vtable *) lt_dlsym (handle, "get_vtable");
170 return loader_init (vtable_func, 0);
171 }
172 #endif /* HAVE_LIBDLLOADER */
173
174 static int
175 loader_init (lt_get_vtable *vtable_func, lt_user_data data)
176 {
177 const lt_dlvtable *vtable = 0;
178 int errors = 0;
179
180 if (vtable_func)
181 {
182 vtable = (*vtable_func) (data);
183 }
184
185 /* lt_dlloader_add will LT__SETERROR if it fails. */
186 errors += lt_dlloader_add (vtable);
187
188 assert (errors || vtable);
189
190 if ((!errors) && vtable->dlloader_init)
191 {
192 if ((*vtable->dlloader_init) (vtable->dlloader_data))
193 {
194 LT__SETERROR (INIT_LOADER);
195 ++errors;
196 }
197 }
198
199 return errors;
200 }
201
202 /* Bootstrap the loader loading with the preopening loader. */
203 #define get_vtable preopen_LTX_get_vtable
204 #define preloaded_symbols LT_CONC3(lt_, LTDLOPEN, _LTX_preloaded_symbols)
205
206 LT_BEGIN_C_DECLS
207 LT_SCOPE const lt_dlvtable * get_vtable (lt_user_data data);
208 LT_END_C_DECLS
209 #ifdef HAVE_LIBDLLOADER
210 extern lt_dlsymlist preloaded_symbols;
211 #endif
212
213 /* Initialize libltdl. */
214 int
215 lt_dlinit (void)
216 {
217 int errors = 0;
218
219 /* Initialize only at first call. */
220 if (++initialized == 1)
221 {
222 lt__alloc_die = lt__alloc_die_callback;
223 handles = 0;
224 user_search_path = 0; /* empty search path */
225
226 /* First set up the statically loaded preload module loader, so
227 we can use it to preopen the other loaders we linked in at
228 compile time. */
229 errors += loader_init (get_vtable, 0);
230
231 /* Now open all the preloaded module loaders, so the application
232 can use _them_ to lt_dlopen its own modules. */
233 #ifdef HAVE_LIBDLLOADER
234 if (!errors)
235 {
236 errors += lt_dlpreload (&preloaded_symbols);
237 }
238
239 if (!errors)
240 {
241 errors += lt_dlpreload_open (LT_STR(LTDLOPEN), loader_init_callback);
242 }
243 #endif /* HAVE_LIBDLLOADER */
244 }
245
246 #ifdef LT_DEBUG_LOADERS
247 lt_dlloader_dump();
248 #endif
249
250 return errors;
251 }
252
253 int
254 lt_dlexit (void)
255 {
256 /* shut down libltdl */
257 lt_dlloader *loader = 0;
258 lt_dlhandle handle = handles;
259 int errors = 0;
260
261 if (!initialized)
262 {
263 LT__SETERROR (SHUTDOWN);
264 ++errors;
265 goto done;
266 }
267
268 /* shut down only at last call. */
269 if (--initialized == 0)
270 {
271 int level;
272
273 while (handles && LT_DLIS_RESIDENT (handles))
274 {
275 handles = handles->next;
276 }
277
278 /* close all modules */
279 for (level = 1; handle; ++level)
280 {
281 lt_dlhandle cur = handles;
282 int saw_nonresident = 0;
283
284 while (cur)
285 {
286 lt_dlhandle tmp = cur;
287 cur = cur->next;
288 if (!LT_DLIS_RESIDENT (tmp))
289 {
290 saw_nonresident = 1;
291 if (tmp->info.ref_count <= level)
292 {
293 if (lt_dlclose (tmp))
294 {
295 ++errors;
296 }
297 /* Make sure that the handle pointed to by 'cur' still exists.
298 lt_dlclose recursively closes dependent libraries which removes
299 them from the linked list. One of these might be the one
300 pointed to by 'cur'. */
301 if (cur)
302 {
303 for (tmp = handles; tmp; tmp = tmp->next)
304 if (tmp == cur)
305 break;
306 if (! tmp)
307 cur = handles;
308 }
309 }
310 }
311 }
312 /* done if only resident modules are left */
313 if (!saw_nonresident)
314 break;
315 }
316
317 /* When removing loaders, we can only find out failure by testing
318 the error string, so avoid a spurious one from an earlier
319 failed command. */
320 if (!errors)
321 LT__SETERRORSTR (0);
322
323 /* close all loaders */
324 for (loader = (lt_dlloader *) lt_dlloader_next (NULL); loader;)
325 {
326 lt_dlloader *next = (lt_dlloader *) lt_dlloader_next (loader);
327 lt_dlvtable *vtable = (lt_dlvtable *) lt_dlloader_get (loader);
328
329 if ((vtable = lt_dlloader_remove ((char *) vtable->name)))
330 {
331 FREE (vtable);
332 }
333 else
334 {
335 /* ignore errors due to resident modules */
336 const char *err;
337 LT__GETERROR (err);
338 if (err)
339 ++errors;
340 }
341
342 loader = next;
343 }
344
345 FREE(user_search_path);
346 }
347
348 done:
349 return errors;
350 }
351
352
353 /* Try VTABLE or, if VTABLE is NULL, all available loaders for FILENAME.
354 If the library is not successfully loaded, return non-zero. Otherwise,
355 the dlhandle is stored at the address given in PHANDLE. */
356 static int
357 tryall_dlopen (lt_dlhandle *phandle, const char *filename,
358 lt_dladvise advise, const lt_dlvtable *vtable)
359 {
360 lt_dlhandle handle = handles;
361 const char * saved_error = 0;
362 int errors = 0;
363
364 #ifdef LT_DEBUG_LOADERS
365 fprintf (stderr, "tryall_dlopen (%s, %s)\n",
366 filename ? filename : "(null)",
367 vtable ? vtable->name : "(ALL)");
368 #endif
369
370 LT__GETERROR (saved_error);
371
372 /* check whether the module was already opened */
373 for (;handle; handle = handle->next)
374 {
375 if ((handle->info.filename == filename) /* dlopen self: 0 == 0 */
376 || (handle->info.filename && filename
377 && streq (handle->info.filename, filename)))
378 {
379 break;
380 }
381 }
382
383 if (handle)
384 {
385 ++handle->info.ref_count;
386 *phandle = handle;
387 goto done;
388 }
389
390 handle = *phandle;
391 if (filename)
392 {
393 /* Comment out the check of file permissions using access.
394 This call seems to always return -1 with error EACCES.
395 */
396 /* We need to catch missing file errors early so that
397 file_not_found() can detect what happened.
398 if (access (filename, R_OK) != 0)
399 {
400 LT__SETERROR (FILE_NOT_FOUND);
401 ++errors;
402 goto done;
403 } */
404
405 handle->info.filename = lt__strdup (filename);
406 if (!handle->info.filename)
407 {
408 ++errors;
409 goto done;
410 }
411 }
412 else
413 {
414 handle->info.filename = 0;
415 }
416
417 {
418 lt_dlloader loader = lt_dlloader_next (0);
419 const lt_dlvtable *loader_vtable;
420
421 do
422 {
423 if (vtable)
424 loader_vtable = vtable;
425 else
426 loader_vtable = lt_dlloader_get (loader);
427
428 #ifdef LT_DEBUG_LOADERS
429 fprintf (stderr, "Calling %s->module_open (%s)\n",
430 (loader_vtable && loader_vtable->name) ? loader_vtable->name : "(null)",
431 filename ? filename : "(null)");
432 #endif
433 handle->module = (*loader_vtable->module_open) (loader_vtable->dlloader_data,
434 filename, advise);
435 #ifdef LT_DEBUG_LOADERS
436 fprintf (stderr, " Result: %s\n",
437 handle->module ? "Success" : "Failed");
438 #endif
439
440 if (handle->module != 0)
441 {
442 if (advise)
443 {
444 handle->info.is_resident = advise->is_resident;
445 handle->info.is_symglobal = advise->is_symglobal;
446 handle->info.is_symlocal = advise->is_symlocal;
447 }
448 break;
449 }
450 }
451 while (!vtable && (loader = lt_dlloader_next (loader)));
452
453 /* If VTABLE was given but couldn't open the module, or VTABLE wasn't
454 given but we exhausted all loaders without opening the module, bail
455 out! */
456 if ((vtable && !handle->module)
457 || (!vtable && !loader))
458 {
459 FREE (handle->info.filename);
460 ++errors;
461 goto done;
462 }
463
464 handle->vtable = loader_vtable;
465 }
466
467 LT__SETERRORSTR (saved_error);
468
469 done:
470 return errors;
471 }
472
473
474 static int
475 tryall_dlopen_module (lt_dlhandle *handle, const char *prefix,
476 const char *dirname, const char *dlname,
477 lt_dladvise advise)
478 {
479 int error = 0;
480 char *filename = 0;
481 size_t filename_len = 0;
482 size_t dirname_len = LT_STRLEN (dirname);
483
484 assert (handle);
485 assert (dirname);
486 assert (dlname);
487 #if defined(LT_DIRSEP_CHAR)
488 /* Only canonicalized names (i.e. with DIRSEP chars already converted)
489 should make it into this function: */
490 assert (strchr (dirname, LT_DIRSEP_CHAR) == 0);
491 #endif
492
493 if (dirname_len > 0)
494 if (dirname[dirname_len -1] == '/')
495 --dirname_len;
496 filename_len = dirname_len + 1 + LT_STRLEN (dlname);
497
498 /* Allocate memory, and combine DIRNAME and MODULENAME into it.
499 The PREFIX (if any) is handled below. */
500 filename = MALLOC (char, filename_len + 1);
501 if (!filename)
502 return 1;
503
504 sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname);
505
506 /* Now that we have combined DIRNAME and MODULENAME, if there is
507 also a PREFIX to contend with, simply recurse with the arguments
508 shuffled. Otherwise, attempt to open FILENAME as a module. */
509 if (prefix)
510 {
511 error += tryall_dlopen_module (handle, (const char *) 0,
512 prefix, filename, advise);
513 }
514 else if (tryall_dlopen (handle, filename, advise, 0) != 0)
515 {
516 ++error;
517 }
518
519 FREE (filename);
520 return error;
521 }
522
523 static int
524 find_module (lt_dlhandle *handle, const char *dir, const char *libdir,
525 const char *dlname, const char *old_name, int installed,
526 lt_dladvise advise)
527 {
528 /* Try to open the old library first; if it was dlpreopened,
529 we want the preopened version of it, even if a dlopenable
530 module is available. */
531 if (old_name && tryall_dlopen (handle, old_name,
532 advise, lt_dlloader_find ("lt_preopen") ) == 0)
533 {
534 return 0;
535 }
536
537 /* Try to open the dynamic library. */
538 if (dlname)
539 {
540 /* try to open the installed module */
541 if (installed && libdir)
542 {
543 if (tryall_dlopen_module (handle, (const char *) 0,
544 libdir, dlname, advise) == 0)
545 return 0;
546 }
547
548 /* try to open the not-installed module */
549 if (!installed)
550 {
551 if (tryall_dlopen_module (handle, dir, objdir,
552 dlname, advise) == 0)
553 return 0;
554 }
555
556 /* maybe it was moved to another directory */
557 {
558 if (dir && (tryall_dlopen_module (handle, (const char *) 0,
559 dir, dlname, advise) == 0))
560 return 0;
561 }
562 }
563
564 return 1;
565 }
566
567
568 static int
569 canonicalize_path (const char *path, char **pcanonical)
570 {
571 char *canonical = 0;
572
573 assert (path && *path);
574 assert (pcanonical);
575
576 canonical = MALLOC (char, 1+ LT_STRLEN (path));
577 if (!canonical)
578 return 1;
579
580 {
581 size_t dest = 0;
582 size_t src;
583 for (src = 0; path[src] != LT_EOS_CHAR; ++src)
584 {
585 /* Path separators are not copied to the beginning or end of
586 the destination, or if another separator would follow
587 immediately. */
588 if (path[src] == LT_PATHSEP_CHAR)
589 {
590 if ((dest == 0)
591 || (path[1+ src] == LT_PATHSEP_CHAR)
592 || (path[1+ src] == LT_EOS_CHAR))
593 continue;
594 }
595
596 /* Anything other than a directory separator is copied verbatim. */
597 if ((path[src] != '/')
598 #if defined(LT_DIRSEP_CHAR)
599 && (path[src] != LT_DIRSEP_CHAR)
600 #endif
601 )
602 {
603 canonical[dest++] = path[src];
604 }
605 /* Directory separators are converted and copied only if they are
606 not at the end of a path -- i.e. before a path separator or
607 NULL terminator. */
608 else if ((path[1+ src] != LT_PATHSEP_CHAR)
609 && (path[1+ src] != LT_EOS_CHAR)
610 #if defined(LT_DIRSEP_CHAR)
611 && (path[1+ src] != LT_DIRSEP_CHAR)
612 #endif
613 && (path[1+ src] != '/'))
614 {
615 canonical[dest++] = '/';
616 }
617 }
618
619 /* Add an end-of-string marker at the end. */
620 canonical[dest] = LT_EOS_CHAR;
621 }
622
623 /* Assign new value. */
624 *pcanonical = canonical;
625
626 return 0;
627 }
628
629 static int
630 argzize_path (const char *path, char **pargz, size_t *pargz_len)
631 {
632 error_t error;
633
634 assert (path);
635 assert (pargz);
636 assert (pargz_len);
637
638 if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len)))
639 {
640 switch (error)
641 {
642 case ENOMEM:
643 LT__SETERROR (NO_MEMORY);
644 break;
645 default:
646 LT__SETERROR (UNKNOWN);
647 break;
648 }
649
650 return 1;
651 }
652
653 return 0;
654 }
655
656 /* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element
657 of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns
658 non-zero or all elements are exhausted. If BASE_NAME is non-NULL,
659 it is appended to each SEARCH_PATH element before FUNC is called. */
660 static int
661 foreach_dirinpath (const char *search_path, const char *base_name,
662 foreach_callback_func *func, void *data1, void *data2)
663 {
664 int result = 0;
665 size_t filenamesize = 0;
666 size_t lenbase = LT_STRLEN (base_name);
667 size_t argz_len = 0;
668 char *argz = 0;
669 char *filename = 0;
670 char *canonical = 0;
671
672 if (!search_path || !*search_path)
673 {
674 LT__SETERROR (FILE_NOT_FOUND);
675 goto cleanup;
676 }
677
678 if (canonicalize_path (search_path, &canonical) != 0)
679 goto cleanup;
680
681 if (argzize_path (canonical, &argz, &argz_len) != 0)
682 goto cleanup;
683
684 {
685 char *dir_name = 0;
686 while ((dir_name = argz_next (argz, argz_len, dir_name)))
687 {
688 size_t lendir = LT_STRLEN (dir_name);
689
690 if (1+ lendir + lenbase >= filenamesize)
691 {
692 FREE (filename);
693 filenamesize = 1+ lendir + 1+ lenbase; /* "/d" + '/' + "f" + '\0' */
694 filename = MALLOC (char, filenamesize);
695 if (!filename)
696 goto cleanup;
697 }
698
699 assert (filenamesize > lendir);
700 strcpy (filename, dir_name);
701
702 if (base_name && *base_name)
703 {
704 if (filename[lendir -1] != '/')
705 filename[lendir++] = '/';
706 strcpy (filename +lendir, base_name);
707 }
708
709 if ((result = (*func) (filename, data1, data2)))
710 {
711 break;
712 }
713 }
714 }
715
716 cleanup:
717 FREE (argz);
718 FREE (canonical);
719 FREE (filename);
720
721 return result;
722 }
723
724 /* If FILEPATH can be opened, store the name of the directory component
725 in DATA1, and the opened FILE* structure address in DATA2. Otherwise
726 DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */
727 static int
728 find_file_callback (char *filename, void *data1, void *data2)
729 {
730 char **pdir = (char **) data1;
731 FILE **pfile = (FILE **) data2;
732 int is_done = 0;
733
734 assert (filename && *filename);
735 assert (pdir);
736 assert (pfile);
737
738 if ((*pfile = fopen (filename, LT_READTEXT_MODE)))
739 {
740 char *dirend = strrchr (filename, '/');
741
742 if (dirend > filename)
743 *dirend = LT_EOS_CHAR;
744
745 FREE (*pdir);
746 *pdir = lt__strdup (filename);
747 is_done = (*pdir == 0) ? -1 : 1;
748 }
749
750 return is_done;
751 }
752
753 static FILE *
754 find_file (const char *search_path, const char *base_name, char **pdir)
755 {
756 FILE *file = 0;
757
758 foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file);
759
760 return file;
761 }
762
763 static int
764 find_handle_callback (char *filename, void *data, void *data2)
765 {
766 lt_dlhandle *phandle = (lt_dlhandle *) data;
767 int notfound = access (filename, R_OK);
768 lt_dladvise advise = (lt_dladvise) data2;
769
770 /* Bail out if file cannot be read... */
771 if (notfound)
772 return 0;
773
774 /* Try to dlopen the file, but do not continue searching in any
775 case. */
776 if (tryall_dlopen (phandle, filename, advise, 0) != 0)
777 *phandle = 0;
778
779 return 1;
780 }
781
782 /* If HANDLE was found return it, otherwise return 0. If HANDLE was
783 found but could not be opened, *HANDLE will be set to 0. */
784 static lt_dlhandle *
785 find_handle (const char *search_path, const char *base_name,
786 lt_dlhandle *phandle, lt_dladvise advise)
787 {
788 if (!search_path)
789 return 0;
790
791 if (!foreach_dirinpath (search_path, base_name, find_handle_callback,
792 phandle, advise))
793 return 0;
794
795 return phandle;
796 }
797
798 #if !defined(LTDL_DLOPEN_DEPLIBS)
799 static int
800 load_deplibs (lt_dlhandle handle, char * LT__UNUSED deplibs)
801 {
802 handle->depcount = 0;
803 return 0;
804 }
805
806 #else /* defined(LTDL_DLOPEN_DEPLIBS) */
807 static int
808 load_deplibs (lt_dlhandle handle, char *deplibs)
809 {
810 char *p, *save_search_path = 0;
811 int depcount = 0;
812 int i;
813 char **names = 0;
814 int errors = 0;
815
816 handle->depcount = 0;
817
818 if (!deplibs)
819 {
820 return errors;
821 }
822 ++errors;
823
824 if (user_search_path)
825 {
826 save_search_path = lt__strdup (user_search_path);
827 if (!save_search_path)
828 goto cleanup;
829 }
830
831 /* extract search paths and count deplibs */
832 p = deplibs;
833 while (*p)
834 {
835 if (!isspace ((unsigned char) *p))
836 {
837 char *end = p+1;
838 while (*end && !isspace((unsigned char) *end))
839 {
840 ++end;
841 }
842
843 if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0)
844 {
845 char save = *end;
846 *end = 0; /* set a temporary string terminator */
847 if (lt_dladdsearchdir(p+2))
848 {
849 goto cleanup;
850 }
851 *end = save;
852 }
853 else
854 {
855 ++depcount;
856 }
857
858 p = end;
859 }
860 else
861 {
862 ++p;
863 }
864 }
865
866
867 if (!depcount)
868 {
869 errors = 0;
870 goto cleanup;
871 }
872
873 names = MALLOC (char *, depcount);
874 if (!names)
875 goto cleanup;
876
877 /* now only extract the actual deplibs */
878 depcount = 0;
879 p = deplibs;
880 while (*p)
881 {
882 if (isspace ((unsigned char) *p))
883 {
884 ++p;
885 }
886 else
887 {
888 char *end = p+1;
889 while (*end && !isspace ((unsigned char) *end))
890 {
891 ++end;
892 }
893
894 if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0)
895 {
896 char *name;
897 char save = *end;
898 *end = 0; /* set a temporary string terminator */
899 if (strncmp(p, "-l", 2) == 0)
900 {
901 size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2);
902 name = MALLOC (char, 1+ name_len);
903 if (name)
904 sprintf (name, "lib%s", p+2);
905 }
906 else
907 name = lt__strdup(p);
908
909 if (!name)
910 goto cleanup_names;
911
912 names[depcount++] = name;
913 *end = save;
914 }
915 p = end;
916 }
917 }
918
919 /* load the deplibs (in reverse order)
920 At this stage, don't worry if the deplibs do not load correctly,
921 they may already be statically linked into the loading application
922 for instance. There will be a more enlightening error message
923 later on if the loaded module cannot resolve all of its symbols. */
924 if (depcount)
925 {
926 lt_dlhandle cur = handle;
927 int j = 0;
928
929 cur->deplibs = MALLOC (lt_dlhandle, depcount);
930 if (!cur->deplibs)
931 goto cleanup_names;
932
933 for (i = 0; i < depcount; ++i)
934 {
935 cur->deplibs[j] = lt_dlopenext(names[depcount-1-i]);
936 if (cur->deplibs[j])
937 {
938 ++j;
939 }
940 }
941
942 cur->depcount = j; /* Number of successfully loaded deplibs */
943 errors = 0;
944 }
945
946 cleanup_names:
947 for (i = 0; i < depcount; ++i)
948 {
949 FREE (names[i]);
950 }
951
952 cleanup:
953 FREE (names);
954 /* restore the old search path */
955 if (save_search_path) {
956 MEMREASSIGN (user_search_path, save_search_path);
957 }
958
959 return errors;
960 }
961 #endif /* defined(LTDL_DLOPEN_DEPLIBS) */
962
963 static int
964 unload_deplibs (lt_dlhandle handle)
965 {
966 int i;
967 int errors = 0;
968 lt_dlhandle cur = handle;
969
970 if (cur->depcount)
971 {
972 for (i = 0; i < cur->depcount; ++i)
973 {
974 if (!LT_DLIS_RESIDENT (cur->deplibs[i]))
975 {
976 errors += lt_dlclose (cur->deplibs[i]);
977 }
978 }
979 FREE (cur->deplibs);
980 }
981
982 return errors;
983 }
984
985 static int
986 trim (char **dest, const char *str)
987 {
988 /* remove the leading and trailing "'" from str
989 and store the result in dest */
990 const char *end = strrchr (str, '\'');
991 size_t len = LT_STRLEN (str);
992 char *tmp;
993
994 FREE (*dest);
995
996 if (!end)
997 return 1;
998
999 if (len > 3 && str[0] == '\'')
1000 {
1001 tmp = MALLOC (char, end - str);
1002 if (!tmp)
1003 return 1;
1004
1005 memcpy(tmp, &str[1], (end - str) - 1);
1006 tmp[(end - str) - 1] = LT_EOS_CHAR;
1007 *dest = tmp;
1008 }
1009 else
1010 {
1011 *dest = 0;
1012 }
1013
1014 return 0;
1015 }
1016
1017 /* Read the .la file FILE. */
1018 static int
1019 parse_dotla_file(FILE *file, char **dlname, char **libdir, char **deplibs,
1020 char **old_name, int *installed)
1021 {
1022 int errors = 0;
1023 size_t line_len = LT_FILENAME_MAX;
1024 char * line = MALLOC (char, line_len);
1025
1026 if (!line)
1027 {
1028 LT__SETERROR (FILE_NOT_FOUND);
1029 return 1;
1030 }
1031
1032 while (!feof (file))
1033 {
1034 line[line_len-2] = '\0';
1035 if (!fgets (line, (int) line_len, file))
1036 {
1037 break;
1038 }
1039
1040 /* Handle the case where we occasionally need to read a line
1041 that is longer than the initial buffer size.
1042 Behave even if the file contains NUL bytes due to corruption. */
1043 while (line[line_len-2] != '\0' && line[line_len-2] != '\n' && !feof (file))
1044 {
1045 line = REALLOC (char, line, line_len *2);
1046 if (!line)
1047 {
1048 ++errors;
1049 goto cleanup;
1050 }
1051 line[line_len * 2 - 2] = '\0';
1052 if (!fgets (&line[line_len -1], (int) line_len +1, file))
1053 {
1054 break;
1055 }
1056 line_len *= 2;
1057 }
1058
1059 if (line[0] == '\n' || line[0] == '#')
1060 {
1061 continue;
1062 }
1063
1064 #undef STR_DLNAME
1065 #define STR_DLNAME "dlname="
1066 if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0)
1067 {
1068 errors += trim (dlname, &line[sizeof (STR_DLNAME) - 1]);
1069 }
1070
1071 #undef STR_OLD_LIBRARY
1072 #define STR_OLD_LIBRARY "old_library="
1073 else if (strncmp (line, STR_OLD_LIBRARY,
1074 sizeof (STR_OLD_LIBRARY) - 1) == 0)
1075 {
1076 errors += trim (old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]);
1077 }
1078 #undef STR_LIBDIR
1079 #define STR_LIBDIR "libdir="
1080 else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0)
1081 {
1082 errors += trim (libdir, &line[sizeof(STR_LIBDIR) - 1]);
1083 }
1084
1085 #undef STR_DL_DEPLIBS
1086 #define STR_DL_DEPLIBS "dependency_libs="
1087 else if (strncmp (line, STR_DL_DEPLIBS,
1088 sizeof (STR_DL_DEPLIBS) - 1) == 0)
1089 {
1090 errors += trim (deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]);
1091 }
1092 else if (streq (line, "installed=yes\n"))
1093 {
1094 *installed = 1;
1095 }
1096 else if (streq (line, "installed=no\n"))
1097 {
1098 *installed = 0;
1099 }
1100
1101 #undef STR_LIBRARY_NAMES
1102 #define STR_LIBRARY_NAMES "library_names="
1103 else if (!*dlname && strncmp (line, STR_LIBRARY_NAMES,
1104 sizeof (STR_LIBRARY_NAMES) - 1) == 0)
1105 {
1106 char *last_libname;
1107 errors += trim (dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]);
1108 if (!errors
1109 && *dlname
1110 && (last_libname = strrchr (*dlname, ' ')) != 0)
1111 {
1112 last_libname = lt__strdup (last_libname + 1);
1113 if (!last_libname)
1114 {
1115 ++errors;
1116 goto cleanup;
1117 }
1118 MEMREASSIGN (*dlname, last_libname);
1119 }
1120 }
1121
1122 if (errors)
1123 break;
1124 }
1125 cleanup:
1126 FREE (line);
1127 return errors;
1128 }
1129
1130
1131 /* Try to open FILENAME as a module. */
1132 static int
1133 try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext,
1134 lt_dladvise advise)
1135 {
1136 const char * saved_error = 0;
1137 char * archive_name = 0;
1138 char * canonical = 0;
1139 char * base_name = 0;
1140 char * dir = 0;
1141 char * name = 0;
1142 char * attempt = 0;
1143 int errors = 0;
1144 lt_dlhandle newhandle;
1145
1146 assert (phandle);
1147 assert (*phandle == 0);
1148
1149 #ifdef LT_DEBUG_LOADERS
1150 fprintf (stderr, "try_dlopen (%s, %s)\n",
1151 filename ? filename : "(null)",
1152 ext ? ext : "(null)");
1153 #endif
1154
1155 LT__GETERROR (saved_error);
1156
1157 /* dlopen self? */
1158 if (!filename)
1159 {
1160 *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle));
1161 if (*phandle == 0)
1162 return 1;
1163
1164 newhandle = *phandle;
1165
1166 /* lt_dlclose()ing yourself is very bad! Disallow it. */
1167 newhandle->info.is_resident = 1;
1168
1169 if (tryall_dlopen (&newhandle, 0, advise, 0) != 0)
1170 {
1171 FREE (*phandle);
1172 return 1;
1173 }
1174
1175 goto register_handle;
1176 }
1177
1178 assert (filename && *filename);
1179
1180 if (ext)
1181 {
1182 attempt = MALLOC (char, LT_STRLEN (filename) + LT_STRLEN (ext) + 1);
1183 if (!attempt)
1184 return 1;
1185
1186 sprintf(attempt, "%s%s", filename, ext);
1187 }
1188 else
1189 {
1190 attempt = lt__strdup (filename);
1191 if (!attempt)
1192 return 1;
1193 }
1194
1195 /* Doing this immediately allows internal functions to safely
1196 assume only canonicalized paths are passed. */
1197 if (canonicalize_path (attempt, &canonical) != 0)
1198 {
1199 ++errors;
1200 goto cleanup;
1201 }
1202
1203 /* If the canonical module name is a path (relative or absolute)
1204 then split it into a directory part and a name part. */
1205 base_name = strrchr (canonical, '/');
1206 if (base_name)
1207 {
1208 size_t dirlen = (1+ base_name) - canonical;
1209
1210 dir = MALLOC (char, 1+ dirlen);
1211 if (!dir)
1212 {
1213 ++errors;
1214 goto cleanup;
1215 }
1216
1217 strncpy (dir, canonical, dirlen);
1218 dir[dirlen] = LT_EOS_CHAR;
1219
1220 ++base_name;
1221 }
1222 else
1223 MEMREASSIGN (base_name, canonical);
1224
1225 assert (base_name && *base_name);
1226
1227 ext = strrchr (base_name, '.');
1228 if (!ext)
1229 {
1230 ext = base_name + LT_STRLEN (base_name);
1231 }
1232
1233 /* extract the module name from the file name */
1234 name = MALLOC (char, ext - base_name + 1);
1235 if (!name)
1236 {
1237 ++errors;
1238 goto cleanup;
1239 }
1240
1241 /* canonicalize the module name */
1242 {
1243 int i;
1244 for (i = 0; i < ext - base_name; ++i)
1245 {
1246 if (isalnum ((unsigned char)(base_name[i])))
1247 {
1248 name[i] = base_name[i];
1249 }
1250 else
1251 {
1252 name[i] = '_';
1253 }
1254 }
1255 name[ext - base_name] = LT_EOS_CHAR;
1256 }
1257
1258 /* Before trawling through the filesystem in search of a module,
1259 check whether we are opening a preloaded module. */
1260 if (!dir)
1261 {
1262 const lt_dlvtable *vtable = lt_dlloader_find ("lt_preopen");
1263
1264 if (vtable)
1265 {
1266 /* name + "." + libext + NULL */
1267 archive_name = MALLOC (char, LT_STRLEN (name) + LT_STRLEN (libext) + 2);
1268 *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle));
1269
1270 if ((*phandle == NULL) || (archive_name == NULL))
1271 {
1272 ++errors;
1273 goto cleanup;
1274 }
1275 newhandle = *phandle;
1276
1277 /* Preloaded modules are always named according to their old
1278 archive name. */
1279 sprintf (archive_name, "%s.%s", name, libext);
1280
1281 if (tryall_dlopen (&newhandle, archive_name, advise, vtable) == 0)
1282 {
1283 goto register_handle;
1284 }
1285
1286 /* If we're still here, there was no matching preloaded module,
1287 so put things back as we found them, and continue searching. */
1288 FREE (*phandle);
1289 newhandle = NULL;
1290 }
1291 }
1292
1293 /* If we are allowing only preloaded modules, and we didn't find
1294 anything yet, give up on the search here. */
1295 if (advise && advise->try_preload_only)
1296 {
1297 goto cleanup;
1298 }
1299
1300 /* Check whether we are opening a libtool module (.la extension). */
1301 if (ext && streq (ext, archive_ext))
1302 {
1303 /* this seems to be a libtool module */
1304 FILE * file = 0;
1305 char * dlname = 0;
1306 char * old_name = 0;
1307 char * libdir = 0;
1308 char * deplibs = 0;
1309
1310 /* if we can't find the installed flag, it is probably an
1311 installed libtool archive, produced with an old version
1312 of libtool */
1313 int installed = 1;
1314
1315 /* Now try to open the .la file. If there is no directory name
1316 component, try to find it first in user_search_path and then other
1317 prescribed paths. Otherwise (or in any case if the module was not
1318 yet found) try opening just the module name as passed. */
1319 if (!dir)
1320 {
1321 const char *search_path = user_search_path;
1322
1323 if (search_path)
1324 file = find_file (user_search_path, base_name, &dir);
1325
1326 if (!file)
1327 {
1328 search_path = getenv (LTDL_SEARCHPATH_VAR);
1329 if (search_path)
1330 file = find_file (search_path, base_name, &dir);
1331 }
1332
1333 #if defined(LT_MODULE_PATH_VAR)
1334 if (!file)
1335 {
1336 search_path = getenv (LT_MODULE_PATH_VAR);
1337 if (search_path)
1338 file = find_file (search_path, base_name, &dir);
1339 }
1340 #endif
1341 #if defined(LT_DLSEARCH_PATH)
1342 if (!file && *sys_dlsearch_path)
1343 {
1344 file = find_file (sys_dlsearch_path, base_name, &dir);
1345 }
1346 #endif
1347 }
1348 else
1349 {
1350 file = fopen (attempt, LT_READTEXT_MODE);
1351 }
1352
1353 /* If we didn't find the file by now, it really isn't there. Set
1354 the status flag, and bail out. */
1355 if (!file)
1356 {
1357 LT__SETERROR (FILE_NOT_FOUND);
1358 ++errors;
1359 goto cleanup;
1360 }
1361
1362 /* read the .la file */
1363 if (parse_dotla_file(file, &dlname, &libdir, &deplibs,
1364 &old_name, &installed) != 0)
1365 ++errors;
1366
1367 fclose (file);
1368
1369 /* allocate the handle */
1370 *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle));
1371 if (*phandle == 0)
1372 ++errors;
1373
1374 if (errors)
1375 {
1376 FREE (dlname);
1377 FREE (old_name);
1378 FREE (libdir);
1379 FREE (deplibs);
1380 FREE (*phandle);
1381 goto cleanup;
1382 }
1383
1384 assert (*phandle);
1385
1386 if (load_deplibs (*phandle, deplibs) == 0)
1387 {
1388 newhandle = *phandle;
1389 /* find_module may replace newhandle */
1390 if (find_module (&newhandle, dir, libdir, dlname, old_name,
1391 installed, advise))
1392 {
1393 unload_deplibs (*phandle);
1394 ++errors;
1395 }
1396 }
1397 else
1398 {
1399 ++errors;
1400 }
1401
1402 FREE (dlname);
1403 FREE (old_name);
1404 FREE (libdir);
1405 FREE (deplibs);
1406
1407 if (errors)
1408 {
1409 FREE (*phandle);
1410 goto cleanup;
1411 }
1412
1413 if (*phandle != newhandle)
1414 {
1415 unload_deplibs (*phandle);
1416 }
1417 }
1418 else
1419 {
1420 /* not a libtool module */
1421 *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle));
1422 if (*phandle == 0)
1423 {
1424 ++errors;
1425 goto cleanup;
1426 }
1427
1428 newhandle = *phandle;
1429
1430 /* If the module has no directory name component, try to find it
1431 first in user_search_path and then other prescribed paths.
1432 Otherwise (or in any case if the module was not yet found) try
1433 opening just the module name as passed. */
1434 if ((dir || (!find_handle (user_search_path, base_name,
1435 &newhandle, advise)
1436 && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name,
1437 &newhandle, advise)
1438 #if defined(LT_MODULE_PATH_VAR)
1439 && !find_handle (getenv (LT_MODULE_PATH_VAR), base_name,
1440 &newhandle, advise)
1441 #endif
1442 #if defined(LT_DLSEARCH_PATH)
1443 && !find_handle (sys_dlsearch_path, base_name,
1444 &newhandle, advise)
1445 #endif
1446 )))
1447 {
1448 if (tryall_dlopen (&newhandle, attempt, advise, 0) != 0)
1449 {
1450 newhandle = NULL;
1451 }
1452 }
1453
1454 if (!newhandle)
1455 {
1456 FREE (*phandle);
1457 ++errors;
1458 goto cleanup;
1459 }
1460 }
1461
1462 register_handle:
1463 MEMREASSIGN (*phandle, newhandle);
1464
1465 if ((*phandle)->info.ref_count == 0)
1466 {
1467 (*phandle)->info.ref_count = 1;
1468 MEMREASSIGN ((*phandle)->info.name, name);
1469
1470 (*phandle)->next = handles;
1471 handles = *phandle;
1472 }
1473
1474 LT__SETERRORSTR (saved_error);
1475
1476 cleanup:
1477 FREE (dir);
1478 FREE (attempt);
1479 FREE (name);
1480 if (!canonical) /* was MEMREASSIGNed */
1481 FREE (base_name);
1482 FREE (canonical);
1483 FREE (archive_name);
1484
1485 return errors;
1486 }
1487
1488
1489 /* If the last error messge store was `FILE_NOT_FOUND', then return
1490 non-zero. */
1491 static int
1492 file_not_found (void)
1493 {
1494 const char *error = 0;
1495
1496 LT__GETERROR (error);
1497 if (error == LT__STRERROR (FILE_NOT_FOUND))
1498 return 1;
1499
1500 return 0;
1501 }
1502
1503
1504 /* Unless FILENAME already bears a suitable library extension, then
1505 return 0. */
1506 static int
1507 has_library_ext (const char *filename)
1508 {
1509 char * ext = 0;
1510
1511 assert (filename);
1512
1513 ext = strrchr (filename, '.');
1514
1515 if (ext && ((streq (ext, archive_ext))
1516 #if defined(LT_MODULE_EXT)
1517 || (streq (ext, shlib_ext))
1518 #endif
1519 ))
1520 {
1521 return 1;
1522 }
1523
1524 return 0;
1525 }
1526
1527
1528 /* Initialise and configure a user lt_dladvise opaque object. */
1529
1530 int
1531 lt_dladvise_init (lt_dladvise *padvise)
1532 {
1533 lt_dladvise advise = (lt_dladvise) lt__zalloc (sizeof (struct lt__advise));
1534 *padvise = advise;
1535 return (advise ? 0 : 1);
1536 }
1537
1538 int
1539 lt_dladvise_destroy (lt_dladvise *padvise)
1540 {
1541 if (padvise)
1542 FREE(*padvise);
1543 return 0;
1544 }
1545
1546 int
1547 lt_dladvise_ext (lt_dladvise *padvise)
1548 {
1549 assert (padvise && *padvise);
1550 (*padvise)->try_ext = 1;
1551 return 0;
1552 }
1553
1554 int
1555 lt_dladvise_resident (lt_dladvise *padvise)
1556 {
1557 assert (padvise && *padvise);
1558 (*padvise)->is_resident = 1;
1559 return 0;
1560 }
1561
1562 int
1563 lt_dladvise_local (lt_dladvise *padvise)
1564 {
1565 assert (padvise && *padvise);
1566 (*padvise)->is_symlocal = 1;
1567 return 0;
1568 }
1569
1570 int
1571 lt_dladvise_global (lt_dladvise *padvise)
1572 {
1573 assert (padvise && *padvise);
1574 (*padvise)->is_symglobal = 1;
1575 return 0;
1576 }
1577
1578 int
1579 lt_dladvise_preload (lt_dladvise *padvise)
1580 {
1581 assert (padvise && *padvise);
1582 (*padvise)->try_preload_only = 1;
1583 return 0;
1584 }
1585
1586 /* Libtool-1.5.x interface for loading a new module named FILENAME. */
1587 lt_dlhandle
1588 lt_dlopen (const char *filename)
1589 {
1590 return lt_dlopenadvise (filename, NULL);
1591 }
1592
1593
1594 /* If FILENAME has an ARCHIVE_EXT or MODULE_EXT extension, try to
1595 open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT,
1596 and if a file is still not found try again with MODULE_EXT appended
1597 instead. */
1598 lt_dlhandle
1599 lt_dlopenext (const char *filename)
1600 {
1601 lt_dlhandle handle = 0;
1602 lt_dladvise advise;
1603
1604 if (!lt_dladvise_init (&advise) && !lt_dladvise_ext (&advise))
1605 handle = lt_dlopenadvise (filename, advise);
1606
1607 lt_dladvise_destroy (&advise);
1608 return handle;
1609 }
1610
1611
1612 lt_dlhandle
1613 lt_dlopenadvise (const char *filename, lt_dladvise advise)
1614 {
1615 lt_dlhandle handle = 0;
1616 int errors = 0;
1617 const char * saved_error = 0;
1618
1619 LT__GETERROR (saved_error);
1620
1621 /* Can't have symbols hidden and visible at the same time! */
1622 if (advise && advise->is_symlocal && advise->is_symglobal)
1623 {
1624 LT__SETERROR (CONFLICTING_FLAGS);
1625 return 0;
1626 }
1627
1628 if (!filename
1629 || !advise
1630 || !advise->try_ext
1631 || has_library_ext (filename))
1632 {
1633 /* Just incase we missed a code path in try_dlopen() that reports
1634 an error, but forgot to reset handle... */
1635 if (try_dlopen (&handle, filename, NULL, advise) != 0)
1636 return 0;
1637
1638 return handle;
1639 }
1640 else if (filename && *filename)
1641 {
1642
1643 /* First try appending ARCHIVE_EXT. */
1644 errors += try_dlopen (&handle, filename, archive_ext, advise);
1645
1646 /* If we found FILENAME, stop searching -- whether we were able to
1647 load the file as a module or not. If the file exists but loading
1648 failed, it is better to return an error message here than to
1649 report FILE_NOT_FOUND when the alternatives (foo.so etc) are not
1650 in the module search path. */
1651 if (handle || ((errors > 0) && !file_not_found ()))
1652 return handle;
1653
1654 #if defined(LT_MODULE_EXT)
1655 /* Try appending SHLIB_EXT. */
1656 LT__SETERRORSTR (saved_error);
1657 errors = try_dlopen (&handle, filename, shlib_ext, advise);
1658
1659 /* As before, if the file was found but loading failed, return now
1660 with the current error message. */
1661 if (handle || ((errors > 0) && !file_not_found ()))
1662 return handle;
1663 #endif
1664 }
1665
1666 /* Still here? Then we really did fail to locate any of the file
1667 names we tried. */
1668 LT__SETERROR (FILE_NOT_FOUND);
1669 return 0;
1670 }
1671
1672
1673 static int
1674 lt_argz_insert (char **pargz, size_t *pargz_len, char *before,
1675 const char *entry)
1676 {
1677 error_t error;
1678
1679 /* Prior to Sep 8, 2005, newlib had a bug where argz_insert(pargz,
1680 pargz_len, NULL, entry) failed with EINVAL. */
1681 if (before)
1682 error = argz_insert (pargz, pargz_len, before, entry);
1683 else
1684 error = argz_append (pargz, pargz_len, entry, 1 + strlen (entry));
1685
1686 if (error)
1687 {
1688 switch (error)
1689 {
1690 case ENOMEM:
1691 LT__SETERROR (NO_MEMORY);
1692 break;
1693 default:
1694 LT__SETERROR (UNKNOWN);
1695 break;
1696 }
1697 return 1;
1698 }
1699
1700 return 0;
1701 }
1702
1703 static int
1704 lt_argz_insertinorder (char **pargz, size_t *pargz_len, const char *entry)
1705 {
1706 char *before = 0;
1707
1708 assert (pargz);
1709 assert (pargz_len);
1710 assert (entry && *entry);
1711
1712 if (*pargz)
1713 while ((before = argz_next (*pargz, *pargz_len, before)))
1714 {
1715 int cmp = strcmp (entry, before);
1716
1717 if (cmp < 0) break;
1718 if (cmp == 0) return 0; /* No duplicates! */
1719 }
1720
1721 return lt_argz_insert (pargz, pargz_len, before, entry);
1722 }
1723
1724 static int
1725 lt_argz_insertdir (char **pargz, size_t *pargz_len, const char *dirnam,
1726 struct dirent *dp)
1727 {
1728 char *buf = 0;
1729 size_t buf_len = 0;
1730 char *end = 0;
1731 size_t end_offset = 0;
1732 size_t dir_len = 0;
1733 int errors = 0;
1734
1735 assert (pargz);
1736 assert (pargz_len);
1737 assert (dp);
1738
1739 dir_len = LT_STRLEN (dirnam);
1740 end = dp->d_name + D_NAMLEN(dp);
1741
1742 /* Ignore version numbers. */
1743 {
1744 char *p;
1745 for (p = end; p -1 > dp->d_name; --p)
1746 if (strchr (".0123456789", p[-1]) == 0)
1747 break;
1748
1749 if (*p == '.')
1750 end = p;
1751 }
1752
1753 /* Ignore filename extension. */
1754 {
1755 char *p;
1756 for (p = end -1; p > dp->d_name; --p)
1757 if (*p == '.')
1758 {
1759 end = p;
1760 break;
1761 }
1762 }
1763
1764 /* Prepend the directory name. */
1765 end_offset = end - dp->d_name;
1766 buf_len = dir_len + 1+ end_offset;
1767 buf = MALLOC (char, 1+ buf_len);
1768 if (!buf)
1769 return ++errors;
1770
1771 assert (buf);
1772
1773 strcpy (buf, dirnam);
1774 strcat (buf, "/");
1775 strncat (buf, dp->d_name, end_offset);
1776 buf[buf_len] = LT_EOS_CHAR;
1777
1778 /* Try to insert (in order) into ARGZ/ARGZ_LEN. */
1779 if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0)
1780 ++errors;
1781
1782 FREE (buf);
1783
1784 return errors;
1785 }
1786
1787 static int
1788 list_files_by_dir (const char *dirnam, char **pargz, size_t *pargz_len)
1789 {
1790 DIR *dirp = 0;
1791 int errors = 0;
1792
1793 assert (dirnam && *dirnam);
1794 assert (pargz);
1795 assert (pargz_len);
1796 assert (dirnam[LT_STRLEN(dirnam) -1] != '/');
1797
1798 dirp = opendir (dirnam);
1799 if (dirp)
1800 {
1801 struct dirent *dp = 0;
1802
1803 while ((dp = readdir (dirp)))
1804 if (dp->d_name[0] != '.')
1805 if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp))
1806 {
1807 ++errors;
1808 break;
1809 }
1810
1811 closedir (dirp);
1812 }
1813 else
1814 ++errors;
1815
1816 return errors;
1817 }
1818
1819
1820 /* If there are any files in DIRNAME, call the function passed in
1821 DATA1 (with the name of each file and DATA2 as arguments). */
1822 static int
1823 foreachfile_callback (char *dirname, void *data1, void *data2)
1824 {
1825 file_worker_func *func = *(file_worker_func **) data1;
1826
1827 int is_done = 0;
1828 char *argz = 0;
1829 size_t argz_len = 0;
1830
1831 if (list_files_by_dir (dirname, &argz, &argz_len) != 0)
1832 goto cleanup;
1833 if (!argz)
1834 goto cleanup;
1835
1836 {
1837 char *filename = 0;
1838 while ((filename = argz_next (argz, argz_len, filename)))
1839 if ((is_done = (*func) (filename, data2)))
1840 break;
1841 }
1842
1843 cleanup:
1844 FREE (argz);
1845
1846 return is_done;
1847 }
1848
1849
1850 /* Call FUNC for each unique extensionless file in SEARCH_PATH, along
1851 with DATA. The filenames passed to FUNC would be suitable for
1852 passing to lt_dlopenext. The extensions are stripped so that
1853 individual modules do not generate several entries (e.g. libfoo.la,
1854 libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL,
1855 then the same directories that lt_dlopen would search are examined. */
1856 int
1857 lt_dlforeachfile (const char *search_path,
1858 int (*func) (const char *filename, void *data),
1859 void *data)
1860 {
1861 int is_done = 0;
1862 file_worker_func **fpptr = &func;
1863
1864 if (search_path)
1865 {
1866 /* If a specific path was passed, search only the directories
1867 listed in it. */
1868 is_done = foreach_dirinpath (search_path, 0,
1869 foreachfile_callback, fpptr, data);
1870 }
1871 else
1872 {
1873 /* Otherwise search the default paths. */
1874 is_done = foreach_dirinpath (user_search_path, 0,
1875 foreachfile_callback, fpptr, data);
1876 if (!is_done)
1877 {
1878 is_done = foreach_dirinpath (getenv(LTDL_SEARCHPATH_VAR), 0,
1879 foreachfile_callback, fpptr, data);
1880 }
1881
1882 #if defined(LT_MODULE_PATH_VAR)
1883 if (!is_done)
1884 {
1885 is_done = foreach_dirinpath (getenv(LT_MODULE_PATH_VAR), 0,
1886 foreachfile_callback, fpptr, data);
1887 }
1888 #endif
1889 #if defined(LT_DLSEARCH_PATH)
1890 if (!is_done && *sys_dlsearch_path)
1891 {
1892 is_done = foreach_dirinpath (sys_dlsearch_path, 0,
1893 foreachfile_callback, fpptr, data);
1894 }
1895 #endif
1896 }
1897
1898 return is_done;
1899 }
1900
1901 int
1902 lt_dlclose (lt_dlhandle handle)
1903 {
1904 lt_dlhandle cur, last;
1905 int errors = 0;
1906
1907 /* check whether the handle is valid */
1908 last = cur = handles;
1909 while (cur && handle != cur)
1910 {
1911 last = cur;
1912 cur = cur->next;
1913 }
1914
1915 if (!cur)
1916 {
1917 LT__SETERROR (INVALID_HANDLE);
1918 ++errors;
1919 goto done;
1920 }
1921
1922 cur = handle;
1923 cur->info.ref_count--;
1924
1925 /* Note that even with resident modules, we must track the ref_count
1926 correctly incase the user decides to reset the residency flag
1927 later (even though the API makes no provision for that at the
1928 moment). */
1929 if (cur->info.ref_count <= 0 && !LT_DLIS_RESIDENT (cur))
1930 {
1931 lt_user_data data = cur->vtable->dlloader_data;
1932
1933 if (cur != handles)
1934 {
1935 last->next = cur->next;
1936 }
1937 else
1938 {
1939 handles = cur->next;
1940 }
1941
1942 errors += cur->vtable->module_close (data, cur->module);
1943 errors += unload_deplibs (handle);
1944
1945 /* It is up to the callers to free the data itself. */
1946 FREE (cur->interface_data);
1947
1948 FREE (cur->info.filename);
1949 FREE (cur->info.name);
1950 FREE (cur);
1951
1952 goto done;
1953 }
1954
1955 if (LT_DLIS_RESIDENT (handle))
1956 {
1957 LT__SETERROR (CLOSE_RESIDENT_MODULE);
1958 ++errors;
1959 }
1960
1961 done:
1962 return errors;
1963 }
1964
1965 void *
1966 lt_dlsym (lt_dlhandle place, const char *symbol)
1967 {
1968 size_t lensym;
1969 char lsym[LT_SYMBOL_LENGTH];
1970 char *sym;
1971 void *address;
1972 lt_user_data data;
1973 lt_dlhandle handle;
1974
1975 if (!place)
1976 {
1977 LT__SETERROR (INVALID_HANDLE);
1978 return 0;
1979 }
1980
1981 handle = place;
1982
1983 if (!symbol)
1984 {
1985 LT__SETERROR (SYMBOL_NOT_FOUND);
1986 return 0;
1987 }
1988
1989 lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->vtable->sym_prefix)
1990 + LT_STRLEN (handle->info.name);
1991
1992 if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH)
1993 {
1994 sym = lsym;
1995 }
1996 else
1997 {
1998 sym = MALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1);
1999 if (!sym)
2000 {
2001 LT__SETERROR (BUFFER_OVERFLOW);
2002 return 0;
2003 }
2004 }
2005
2006 data = handle->vtable->dlloader_data;
2007 if (handle->info.name)
2008 {
2009 const char *saved_error;
2010
2011 LT__GETERROR (saved_error);
2012
2013 /* this is a libtool module */
2014 if (handle->vtable->sym_prefix)
2015 {
2016 strcpy(sym, handle->vtable->sym_prefix);
2017 strcat(sym, handle->info.name);
2018 }
2019 else
2020 {
2021 strcpy(sym, handle->info.name);
2022 }
2023
2024 strcat(sym, "_LTX_");
2025 strcat(sym, symbol);
2026
2027 /* try "modulename_LTX_symbol" */
2028 address = handle->vtable->find_sym (data, handle->module, sym);
2029 if (address)
2030 {
2031 if (sym != lsym)
2032 {
2033 FREE (sym);
2034 }
2035 return address;
2036 }
2037 LT__SETERRORSTR (saved_error);
2038 }
2039
2040 /* otherwise try "symbol" */
2041 if (handle->vtable->sym_prefix)
2042 {
2043 strcpy(sym, handle->vtable->sym_prefix);
2044 strcat(sym, symbol);
2045 }
2046 else
2047 {
2048 strcpy(sym, symbol);
2049 }
2050
2051 address = handle->vtable->find_sym (data, handle->module, sym);
2052 if (sym != lsym)
2053 {
2054 FREE (sym);
2055 }
2056
2057 return address;
2058 }
2059
2060 const char *
2061 lt_dlerror (void)
2062 {
2063 const char *error;
2064
2065 LT__GETERROR (error);
2066 LT__SETERRORSTR (0);
2067
2068 return error ? error : NULL;
2069 }
2070
2071 static int
2072 lt_dlpath_insertdir (char **ppath, char *before, const char *dir)
2073 {
2074 int errors = 0;
2075 char *canonical = 0;
2076 char *argz = 0;
2077 size_t argz_len = 0;
2078
2079 assert (ppath);
2080 assert (dir && *dir);
2081
2082 if (canonicalize_path (dir, &canonical) != 0)
2083 {
2084 ++errors;
2085 goto cleanup;
2086 }
2087
2088 assert (canonical && *canonical);
2089
2090 /* If *PPATH is empty, set it to DIR. */
2091 if (*ppath == 0)
2092 {
2093 assert (!before); /* BEFORE cannot be set without PPATH. */
2094 assert (dir); /* Without DIR, don't call this function! */
2095
2096 *ppath = lt__strdup (dir);
2097 if (*ppath == 0)
2098 ++errors;
2099
2100 goto cleanup;
2101 }
2102
2103 assert (ppath && *ppath);
2104
2105 if (argzize_path (*ppath, &argz, &argz_len) != 0)
2106 {
2107 ++errors;
2108 goto cleanup;
2109 }
2110
2111 /* Convert BEFORE into an equivalent offset into ARGZ. This only works
2112 if *PPATH is already canonicalized, and hence does not change length
2113 with respect to ARGZ. We canonicalize each entry as it is added to
2114 the search path, and don't call this function with (uncanonicalized)
2115 user paths, so this is a fair assumption. */
2116 if (before)
2117 {
2118 assert (*ppath <= before);
2119 assert ((int) (before - *ppath) <= (int) strlen (*ppath));
2120
2121 before = before - *ppath + argz;
2122 }
2123
2124 if (lt_argz_insert (&argz, &argz_len, before, dir) != 0)
2125 {
2126 ++errors;
2127 goto cleanup;
2128 }
2129
2130 argz_stringify (argz, argz_len, LT_PATHSEP_CHAR);
2131 MEMREASSIGN(*ppath, argz);
2132
2133 cleanup:
2134 FREE (argz);
2135 FREE (canonical);
2136
2137 return errors;
2138 }
2139
2140 int
2141 lt_dladdsearchdir (const char *search_dir)
2142 {
2143 int errors = 0;
2144
2145 if (search_dir && *search_dir)
2146 {
2147 if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0)
2148 ++errors;
2149 }
2150
2151 return errors;
2152 }
2153
2154 int
2155 lt_dlinsertsearchdir (const char *before, const char *search_dir)
2156 {
2157 int errors = 0;
2158
2159 if (before)
2160 {
2161 if ((before < user_search_path)
2162 || (before >= user_search_path + LT_STRLEN (user_search_path)))
2163 {
2164 LT__SETERROR (INVALID_POSITION);
2165 return 1;
2166 }
2167 }
2168
2169 if (search_dir && *search_dir)
2170 {
2171 if (lt_dlpath_insertdir (&user_search_path,
2172 (char *) before, search_dir) != 0)
2173 {
2174 ++errors;
2175 }
2176 }
2177
2178 return errors;
2179 }
2180
2181 int
2182 lt_dlsetsearchpath (const char *search_path)
2183 {
2184 int errors = 0;
2185
2186 FREE (user_search_path);
2187
2188 if (!search_path || !LT_STRLEN (search_path))
2189 {
2190 return errors;
2191 }
2192
2193 if (canonicalize_path (search_path, &user_search_path) != 0)
2194 ++errors;
2195
2196 return errors;
2197 }
2198
2199 const char *
2200 lt_dlgetsearchpath (void)
2201 {
2202 const char *saved_path;
2203
2204 saved_path = user_search_path;
2205
2206 return saved_path;
2207 }
2208
2209 int
2210 lt_dlmakeresident (lt_dlhandle handle)
2211 {
2212 int errors = 0;
2213
2214 if (!handle)
2215 {
2216 LT__SETERROR (INVALID_HANDLE);
2217 ++errors;
2218 }
2219 else
2220 {
2221 handle->info.is_resident = 1;
2222 }
2223
2224 return errors;
2225 }
2226
2227 int
2228 lt_dlisresident (lt_dlhandle handle)
2229 {
2230 if (!handle)
2231 {
2232 LT__SETERROR (INVALID_HANDLE);
2233 return -1;
2234 }
2235
2236 return LT_DLIS_RESIDENT (handle);
2237 }
2238
2239
2240
2241 /* --- MODULE INFORMATION --- */
2242
2243 typedef struct {
2244 const char *id_string;
2245 lt_dlhandle_interface *iface;
2246 } lt__interface_id;
2247
2248 lt_dlinterface_id
2249 lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface)
2250 {
2251 lt__interface_id *interface_id = (lt__interface_id *) lt__malloc (sizeof *interface_id);
2252
2253 /* If lt__malloc fails, it will LT__SETERROR (NO_MEMORY), which
2254 can then be detected with lt_dlerror() if we return 0. */
2255 if (interface_id)
2256 {
2257 interface_id->id_string = lt__strdup (id_string);
2258 if (!interface_id->id_string)
2259 FREE (interface_id);
2260 else
2261 interface_id->iface = iface;
2262 }
2263
2264 return (lt_dlinterface_id) interface_id;
2265 }
2266
2267 void lt_dlinterface_free (lt_dlinterface_id key)
2268 {
2269 lt__interface_id *interface_id = (lt__interface_id *)key;
2270 FREE (interface_id->id_string);
2271 FREE (interface_id);
2272 }
2273
2274 void *
2275 lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data)
2276 {
2277 int n_elements = 0;
2278 void *stale = (void *) 0;
2279 lt_dlhandle cur = handle;
2280 int i;
2281
2282 if (cur->interface_data)
2283 while (cur->interface_data[n_elements].key)
2284 ++n_elements;
2285
2286 for (i = 0; i < n_elements; ++i)
2287 {
2288 if (cur->interface_data[i].key == key)
2289 {
2290 stale = cur->interface_data[i].data;
2291 break;
2292 }
2293 }
2294
2295 /* Ensure that there is enough room in this handle's interface_data
2296 array to accept a new element (and an empty end marker). */
2297 if (i == n_elements)
2298 {
2299 lt_interface_data *temp
2300 = REALLOC (lt_interface_data, cur->interface_data, 2+ n_elements);
2301
2302 if (!temp)
2303 {
2304 stale = 0;
2305 goto done;
2306 }
2307
2308 cur->interface_data = temp;
2309
2310 /* We only need this if we needed to allocate a new interface_data. */
2311 cur->interface_data[i].key = key;
2312 cur->interface_data[1+ i].key = 0;
2313 }
2314
2315 cur->interface_data[i].data = data;
2316
2317 done:
2318 return stale;
2319 }
2320
2321 void *
2322 lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle)
2323 {
2324 void *result = (void *) 0;
2325 lt_dlhandle cur = handle;
2326
2327 /* Locate the index of the element with a matching KEY. */
2328 if (cur->interface_data)
2329 {
2330 int i;
2331 for (i = 0; cur->interface_data[i].key; ++i)
2332 {
2333 if (cur->interface_data[i].key == key)
2334 {
2335 result = cur->interface_data[i].data;
2336 break;
2337 }
2338 }
2339 }
2340
2341 return result;
2342 }
2343
2344 const lt_dlinfo *
2345 lt_dlgetinfo (lt_dlhandle handle)
2346 {
2347 if (!handle)
2348 {
2349 LT__SETERROR (INVALID_HANDLE);
2350 return 0;
2351 }
2352
2353 return &(handle->info);
2354 }
2355
2356
2357 lt_dlhandle
2358 lt_dlhandle_iterate (lt_dlinterface_id iface, lt_dlhandle place)
2359 {
2360 lt_dlhandle handle = place;
2361 lt__interface_id *iterator = (lt__interface_id *) iface;
2362
2363 assert (iface); /* iface is a required argument */
2364
2365 if (!handle)
2366 handle = handles;
2367 else
2368 handle = handle->next;
2369
2370 /* advance while the interface check fails */
2371 while (handle && iterator->iface
2372 && ((*iterator->iface) (handle, iterator->id_string) != 0))
2373 {
2374 handle = handle->next;
2375 }
2376
2377 return handle;
2378 }
2379
2380
2381 lt_dlhandle
2382 lt_dlhandle_fetch (lt_dlinterface_id iface, const char *module_name)
2383 {
2384 lt_dlhandle handle = 0;
2385
2386 assert (iface); /* iface is a required argument */
2387
2388 while ((handle = lt_dlhandle_iterate (iface, handle)))
2389 {
2390 lt_dlhandle cur = handle;
2391 if (cur && cur->info.name && streq (cur->info.name, module_name))
2392 break;
2393 }
2394
2395 return handle;
2396 }
2397
2398
2399 int
2400 lt_dlhandle_map (lt_dlinterface_id iface,
2401 int (*func) (lt_dlhandle handle, void *data), void *data)
2402 {
2403 lt__interface_id *iterator = (lt__interface_id *) iface;
2404 lt_dlhandle cur = handles;
2405
2406 assert (iface); /* iface is a required argument */
2407
2408 while (cur)
2409 {
2410 int errorcode = 0;
2411
2412 /* advance while the interface check fails */
2413 while (cur && iterator->iface
2414 && ((*iterator->iface) (cur, iterator->id_string) != 0))
2415 {
2416 cur = cur->next;
2417 }
2418
2419 if ((errorcode = (*func) (cur, data)) != 0)
2420 return errorcode;
2421 }
2422
2423 return 0;
2424 }
0 /* ltdl.h -- generic dlopen functions
1
2 Copyright (C) 1998-2000, 2004, 2005,
3 2007, 2008 Free Software Foundation, Inc.
4 Written by Thomas Tanner, 1998
5
6 NOTE: The canonical source of this file is maintained with the
7 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
8
9 GNU Libltdl is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
13
14 As a special exception to the GNU Lesser General Public License,
15 if you distribute this file as part of a program or library that
16 is built using GNU Libtool, you may include this file under the
17 same distribution terms that you use for the rest of that program.
18
19 GNU Libltdl is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU Lesser General Public License for more details.
23
24 You should have received a copy of the GNU Lesser General Public
25 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
26 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
27 or obtained by writing to the Free Software Foundation, Inc.,
28 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 */
30
31 /* Only include this header file once. */
32 #if !defined(LTDL_H)
33 #define LTDL_H 1
34
35 #include <libltdl/lt_system.h>
36 #include <libltdl/lt_error.h>
37 #include <libltdl/lt_dlloader.h>
38
39 LT_BEGIN_C_DECLS
40
41
42 /* LT_STRLEN can be used safely on NULL pointers. */
43 #define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0)
44
45
46 /* --- DYNAMIC MODULE LOADING API --- */
47
48
49 typedef struct lt__handle *lt_dlhandle; /* A loaded module. */
50
51 /* Initialisation and finalisation functions for libltdl. */
52 LT_SCOPE int lt_dlinit (void);
53 LT_SCOPE int lt_dlexit (void);
54
55 /* Module search path manipulation. */
56 LT_SCOPE int lt_dladdsearchdir (const char *search_dir);
57 LT_SCOPE int lt_dlinsertsearchdir (const char *before,
58 const char *search_dir);
59 LT_SCOPE int lt_dlsetsearchpath (const char *search_path);
60 LT_SCOPE const char *lt_dlgetsearchpath (void);
61 LT_SCOPE int lt_dlforeachfile (
62 const char *search_path,
63 int (*func) (const char *filename, void *data),
64 void *data);
65
66 /* User module loading advisors. */
67 LT_SCOPE int lt_dladvise_init (lt_dladvise *advise);
68 LT_SCOPE int lt_dladvise_destroy (lt_dladvise *advise);
69 LT_SCOPE int lt_dladvise_ext (lt_dladvise *advise);
70 LT_SCOPE int lt_dladvise_resident (lt_dladvise *advise);
71 LT_SCOPE int lt_dladvise_local (lt_dladvise *advise);
72 LT_SCOPE int lt_dladvise_global (lt_dladvise *advise);
73 LT_SCOPE int lt_dladvise_preload (lt_dladvise *advise);
74
75 /* Portable libltdl versions of the system dlopen() API. */
76 LT_SCOPE lt_dlhandle lt_dlopen (const char *filename);
77 LT_SCOPE lt_dlhandle lt_dlopenext (const char *filename);
78 LT_SCOPE lt_dlhandle lt_dlopenadvise (const char *filename,
79 lt_dladvise advise);
80 LT_SCOPE void * lt_dlsym (lt_dlhandle handle, const char *name);
81 LT_SCOPE const char *lt_dlerror (void);
82 LT_SCOPE int lt_dlclose (lt_dlhandle handle);
83
84
85
86 /* --- PRELOADED MODULE SUPPORT --- */
87
88
89 /* A preopened symbol. Arrays of this type comprise the exported
90 symbols for a dlpreopened module. */
91 typedef struct {
92 const char *name;
93 void *address;
94 } lt_dlsymlist;
95
96 typedef int lt_dlpreload_callback_func (lt_dlhandle handle);
97
98 LT_SCOPE int lt_dlpreload (const lt_dlsymlist *preloaded);
99 LT_SCOPE int lt_dlpreload_default (const lt_dlsymlist *preloaded);
100 LT_SCOPE int lt_dlpreload_open (const char *originator,
101 lt_dlpreload_callback_func *func);
102
103 #define lt_preloaded_symbols lt__PROGRAM__LTX_preloaded_symbols
104 #define LTDL_SET_PRELOADED_SYMBOLS() LT_STMT_START{ \
105 extern const lt_dlsymlist lt_preloaded_symbols[]; \
106 lt_dlpreload_default(lt_preloaded_symbols); \
107 }LT_STMT_END
108
109
110
111
112 /* --- MODULE INFORMATION --- */
113
114
115 /* Associating user data with loaded modules. */
116 typedef void * lt_dlinterface_id;
117 typedef int lt_dlhandle_interface (lt_dlhandle handle, const char *id_string);
118
119 LT_SCOPE lt_dlinterface_id lt_dlinterface_register (const char *id_string,
120 lt_dlhandle_interface *iface);
121 LT_SCOPE void lt_dlinterface_free (lt_dlinterface_id key);
122 LT_SCOPE void * lt_dlcaller_set_data (lt_dlinterface_id key,
123 lt_dlhandle handle, void *data);
124 LT_SCOPE void * lt_dlcaller_get_data (lt_dlinterface_id key,
125 lt_dlhandle handle);
126
127
128 /* Read only information pertaining to a loaded module. */
129 typedef struct {
130 char * filename; /* file name */
131 char * name; /* module name */
132 int ref_count; /* number of times lt_dlopened minus
133 number of times lt_dlclosed. */
134 unsigned int is_resident:1; /* module can't be unloaded. */
135 unsigned int is_symglobal:1; /* module symbols can satisfy
136 subsequently loaded modules. */
137 unsigned int is_symlocal:1; /* module symbols are only available
138 locally. */
139 } lt_dlinfo;
140
141 LT_SCOPE const lt_dlinfo *lt_dlgetinfo (lt_dlhandle handle);
142
143 LT_SCOPE lt_dlhandle lt_dlhandle_iterate (lt_dlinterface_id iface,
144 lt_dlhandle place);
145 LT_SCOPE lt_dlhandle lt_dlhandle_fetch (lt_dlinterface_id iface,
146 const char *module_name);
147 LT_SCOPE int lt_dlhandle_map (lt_dlinterface_id iface,
148 int (*func) (lt_dlhandle handle, void *data),
149 void *data);
150
151
152
153 /* Deprecated module residency management API. */
154 LT_SCOPE int lt_dlmakeresident (lt_dlhandle handle);
155 LT_SCOPE int lt_dlisresident (lt_dlhandle handle);
156
157 #define lt_ptr void *
158
159 LT_END_C_DECLS
160
161 #endif /*!defined(LTDL_H)*/
0 /* slist.c -- generalised singly linked lists
1
2 Copyright (C) 2000, 2004, 2007, 2008 Free Software Foundation, Inc.
3 Written by Gary V. Vaughan, 2000
4
5 NOTE: The canonical source of this file is maintained with the
6 GNU Libtool package. Report bugs to bug-libtool@gnu.org.
7
8 GNU Libltdl is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 As a special exception to the GNU Lesser General Public License,
14 if you distribute this file as part of a program or library that
15 is built using GNU Libtool, you may include this file under the
16 same distribution terms that you use for the rest of that program.
17
18 GNU Libltdl is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public
24 License along with GNU Libltdl; see the file COPYING.LIB. If not, a
25 copy can be downloaded from http://www.gnu.org/licenses/lgpl.html,
26 or obtained by writing to the Free Software Foundation, Inc.,
27 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29
30 #include <assert.h>
31
32 #include "slist.h"
33 #include <stddef.h>
34
35 static SList * slist_sort_merge (SList *left, SList *right,
36 SListCompare *compare, void *userdata);
37
38
39 /* Call DELETE repeatedly on each element of HEAD.
40
41 CAVEAT: If you call this when HEAD is the start of a list of boxed
42 items, you must remember that each item passed back to your
43 DELETE function will be a boxed item that must be slist_unbox()ed
44 before operating on its contents.
45
46 e.g. void boxed_delete (void *item) { item_free (slist_unbox (item)); }
47 ...
48 slist = slist_delete (slist, boxed_delete);
49 ...
50 */
51 SList *
52 slist_delete (SList *head, void (*delete_fct) (void *item))
53 {
54 assert (delete_fct);
55
56 while (head)
57 {
58 SList *next = head->next;
59 (*delete_fct) (head);
60 head = next;
61 }
62
63 return 0;
64 }
65
66 /* Call FIND repeatedly with MATCHDATA and each item of *PHEAD, until
67 FIND returns non-NULL, or the list is exhausted. If a match is found
68 the matching item is destructively removed from *PHEAD, and the value
69 returned by the matching call to FIND is returned.
70
71 CAVEAT: To avoid memory leaks, unless you already have the address of
72 the stale item, you should probably return that from FIND if
73 it makes a successful match. Don't forget to slist_unbox()
74 every item in a boxed list before operating on its contents. */
75 void *
76 slist_remove (SList **phead, SListCallback *find, void *matchdata)
77 {
78 SList *stale = 0;
79 void *result = 0;
80
81 assert (find);
82
83 if (!phead || !*phead)
84 return 0;
85
86 /* Does the head of the passed list match? */
87 result = (*find) (*phead, matchdata);
88 if (result)
89 {
90 stale = *phead;
91 *phead = stale->next;
92 }
93 /* what about the rest of the elements? */
94 else
95 {
96 SList *head;
97 for (head = *phead; head->next; head = head->next)
98 {
99 result = (*find) (head->next, matchdata);
100 if (result)
101 {
102 stale = head->next;
103 head->next = stale->next;
104 break;
105 }
106 }
107 }
108
109 return result;
110 }
111
112 /* Call FIND repeatedly with each element of SLIST and MATCHDATA, until
113 FIND returns non-NULL, or the list is exhausted. If a match is found
114 the value returned by the matching call to FIND is returned. */
115 void *
116 slist_find (SList *slist, SListCallback *find, void *matchdata)
117 {
118 void *result = 0;
119
120 assert (find);
121
122 for (; slist; slist = slist->next)
123 {
124 result = (*find) (slist, matchdata);
125 if (result)
126 break;
127 }
128
129 return result;
130 }
131
132 /* Return a single list, composed by destructively concatenating the
133 items in HEAD and TAIL. The values of HEAD and TAIL are undefined
134 after calling this function.
135
136 CAVEAT: Don't mix boxed and unboxed items in a single list.
137
138 e.g. slist1 = slist_concat (slist1, slist2); */
139 SList *
140 slist_concat (SList *head, SList *tail)
141 {
142 SList *last;
143
144 if (!head)
145 {
146 return tail;
147 }
148
149 last = head;
150 while (last->next)
151 last = last->next;
152
153 last->next = tail;
154
155 return head;
156 }
157
158 /* Return a single list, composed by destructively appending all of
159 the items in SLIST to ITEM. The values of ITEM and SLIST are undefined
160 after calling this function.
161
162 CAVEAT: Don't mix boxed and unboxed items in a single list.
163
164 e.g. slist1 = slist_cons (slist_box (data), slist1); */
165 SList *
166 slist_cons (SList *item, SList *slist)
167 {
168 if (!item)
169 {
170 return slist;
171 }
172
173 assert (!item->next);
174
175 item->next = slist;
176 return item;
177 }
178
179 /* Return a list starting at the second item of SLIST. */
180 SList *
181 slist_tail (SList *slist)
182 {
183 return slist ? slist->next : NULL;
184 }
185
186 /* Return a list starting at the Nth item of SLIST. If SLIST is less
187 than N items long, NULL is returned. Just to be confusing, list items
188 are counted from 1, to get the 2nd element of slist:
189
190 e.g. shared_list = slist_nth (slist, 2); */
191 SList *
192 slist_nth (SList *slist, size_t n)
193 {
194 for (;n > 1 && slist; n--)
195 slist = slist->next;
196
197 return slist;
198 }
199
200 /* Return the number of items in SLIST. We start counting from 1, so
201 the length of a list with no items is 0, and so on. */
202 size_t
203 slist_length (SList *slist)
204 {
205 size_t n;
206
207 for (n = 0; slist; ++n)
208 slist = slist->next;
209
210 return n;
211 }
212
213 /* Destructively reverse the order of items in SLIST. The value of SLIST
214 is undefined after calling this function.
215
216 CAVEAT: You must store the result of this function, or you might not
217 be able to get all the items except the first one back again.
218
219 e.g. slist = slist_reverse (slist); */
220 SList *
221 slist_reverse (SList *slist)
222 {
223 SList *result = 0;
224 SList *next;
225
226 while (slist)
227 {
228 next = slist->next;
229 slist->next = result;
230 result = slist;
231 slist = next;
232 }
233
234 return result;
235 }
236
237 /* Call FOREACH once for each item in SLIST, passing both the item and
238 USERDATA on each call. */
239 void *
240 slist_foreach (SList *slist, SListCallback *foreach, void *userdata)
241 {
242 void *result = 0;
243
244 assert (foreach);
245
246 while (slist)
247 {
248 SList *next = slist->next;
249 result = (*foreach) (slist, userdata);
250
251 if (result)
252 break;
253
254 slist = next;
255 }
256
257 return result;
258 }
259
260 /* Destructively merge the items of two ordered lists LEFT and RIGHT,
261 returning a single sorted list containing the items of both -- Part of
262 the quicksort algorithm. The values of LEFT and RIGHT are undefined
263 after calling this function.
264
265 At each iteration, add another item to the merged list by taking the
266 lowest valued item from the head of either LEFT or RIGHT, determined
267 by passing those items and USERDATA to COMPARE. COMPARE should return
268 less than 0 if the head of LEFT has the lower value, greater than 0 if
269 the head of RIGHT has the lower value, otherwise 0. */
270 static SList *
271 slist_sort_merge (SList *left, SList *right, SListCompare *compare,
272 void *userdata)
273 {
274 SList merged, *insert;
275
276 insert = &merged;
277
278 while (left && right)
279 {
280 if ((*compare) (left, right, userdata) <= 0)
281 {
282 insert = insert->next = left;
283 left = left->next;
284 }
285 else
286 {
287 insert = insert->next = right;
288 right = right->next;
289 }
290 }
291
292 insert->next = left ? left : right;
293
294 return merged.next;
295 }
296
297 /* Perform a destructive quicksort on the items in SLIST, by repeatedly
298 calling COMPARE with a pair of items from SLIST along with USERDATA
299 at every iteration. COMPARE is a function as defined above for
300 slist_sort_merge(). The value of SLIST is undefined after calling
301 this function.
302
303 e.g. slist = slist_sort (slist, compare, 0); */
304 SList *
305 slist_sort (SList *slist, SListCompare *compare, void *userdata)
306 {
307 SList *left, *right;
308
309 if (!slist)
310 return slist;
311
312 /* Be sure that LEFT and RIGHT never contain the same item. */
313 left = slist;
314 right = slist->next;
315
316 /* Skip two items with RIGHT and one with SLIST, until RIGHT falls off
317 the end. SLIST must be about half way along. */
318 while (right && (right = right->next))
319 {
320 if (!right || !(right = right->next))
321 break;
322 slist = slist->next;
323 }
324 right = slist->next;
325 slist->next = 0;
326
327 /* Sort LEFT and RIGHT, then merge the two. */
328 return slist_sort_merge (slist_sort (left, compare, userdata),
329 slist_sort (right, compare, userdata),
330 compare, userdata);
331 }
332
333
334 /* Aside from using the functions above to manage chained structures of
335 any type that has a NEXT pointer as its first field, SLISTs can
336 be comprised of boxed items. The boxes are chained together in
337 that case, so there is no need for a NEXT field in the item proper.
338 Some care must be taken to slist_box and slist_unbox each item in
339 a boxed list at the appropriate points to avoid leaking the memory
340 used for the boxes. It us usually a very bad idea to mix boxed and
341 non-boxed items in a single list. */
342
343 /* Return a `boxed' freshly mallocated 1 element list containing
344 USERDATA. */
345 SList *
346 slist_box (const void *userdata)
347 {
348 SList *item = (SList *) malloc (sizeof *item);
349
350 if (item)
351 {
352 item->next = 0;
353 item->userdata = userdata;
354 }
355
356 return item;
357 }
358
359 /* Return the contents of a `boxed' ITEM, recycling the box itself. */
360 void *
361 slist_unbox (SList *item)
362 {
363 void *userdata = 0;
364
365 if (item)
366 {
367 /* Strip the const, because responsibility for this memory
368 passes to the caller on return. */
369 userdata = (void *) item->userdata;
370 free (item);
371 }
372
373 return userdata;
374 }
00 /libtool.m4
11 /lt*.m4
2 /argz.m4
0 # Portability macros for glibc argz. -*- Autoconf -*-
1 #
2 # Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
3 # Written by Gary V. Vaughan <gary@gnu.org>
4 #
5 # This file is free software; the Free Software Foundation gives
6 # unlimited permission to copy and/or distribute it, with or without
7 # modifications, as long as this notice is preserved.
8
9 # serial 5 argz.m4
10
11 AC_DEFUN([gl_FUNC_ARGZ],
12 [gl_PREREQ_ARGZ
13
14 AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT])
15
16 AC_CHECK_TYPES([error_t],
17 [],
18 [AC_DEFINE([error_t], [int],
19 [Define to a type to use for `error_t' if it is not otherwise available.])
20 AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h
21 does not typedef error_t.])],
22 [#if defined(HAVE_ARGZ_H)
23 # include <argz.h>
24 #endif])
25
26 ARGZ_H=
27 AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \
28 argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])])
29
30 dnl if have system argz functions, allow forced use of
31 dnl libltdl-supplied implementation (and default to do so
32 dnl on "known bad" systems). Could use a runtime check, but
33 dnl (a) detecting malloc issues is notoriously unreliable
34 dnl (b) only known system that declares argz functions,
35 dnl provides them, yet they are broken, is cygwin
36 dnl releases prior to 16-Mar-2007 (1.5.24 and earlier)
37 dnl So, it's more straightforward simply to special case
38 dnl this for known bad systems.
39 AS_IF([test -z "$ARGZ_H"],
40 [AC_CACHE_CHECK(
41 [if argz actually works],
42 [lt_cv_sys_argz_works],
43 [[case $host_os in #(
44 *cygwin*)
45 lt_cv_sys_argz_works=no
46 if test "$cross_compiling" != no; then
47 lt_cv_sys_argz_works="guessing no"
48 else
49 lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/'
50 save_IFS=$IFS
51 IFS=-.
52 set x `uname -r | sed -e "$lt_sed_extract_leading_digits"`
53 IFS=$save_IFS
54 lt_os_major=${2-0}
55 lt_os_minor=${3-0}
56 lt_os_micro=${4-0}
57 if test "$lt_os_major" -gt 1 \
58 || { test "$lt_os_major" -eq 1 \
59 && { test "$lt_os_minor" -gt 5 \
60 || { test "$lt_os_minor" -eq 5 \
61 && test "$lt_os_micro" -gt 24; }; }; }; then
62 lt_cv_sys_argz_works=yes
63 fi
64 fi
65 ;; #(
66 *) lt_cv_sys_argz_works=yes ;;
67 esac]])
68 AS_IF([test $lt_cv_sys_argz_works = yes],
69 [AC_DEFINE([HAVE_WORKING_ARGZ], 1,
70 [This value is set to 1 to indicate that the system argz facility works])],
71 [ARGZ_H=argz.h
72 AC_LIBOBJ([argz])])])
73
74 AC_SUBST([ARGZ_H])
75 ])
76
77 # Prerequisites of lib/argz.c.
78 AC_DEFUN([gl_PREREQ_ARGZ], [:])
0 # ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
1 #
2 # Copyright (C) 1999-2006, 2007, 2008 Free Software Foundation, Inc.
3 # Written by Thomas Tanner, 1999
4 #
5 # This file is free software; the Free Software Foundation gives
6 # unlimited permission to copy and/or distribute it, with or without
7 # modifications, as long as this notice is preserved.
8
9 # serial 17 LTDL_INIT
10
11 # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE])
12 # ------------------------------------------
13 # DIRECTORY contains the libltdl sources. It is okay to call this
14 # function multiple times, as long as the same DIRECTORY is always given.
15 AC_DEFUN([LT_CONFIG_LTDL_DIR],
16 [AC_BEFORE([$0], [LTDL_INIT])
17 _$0($*)
18 ])# LT_CONFIG_LTDL_DIR
19
20 # We break this out into a separate macro, so that we can call it safely
21 # internally without being caught accidentally by the sed scan in libtoolize.
22 m4_defun([_LT_CONFIG_LTDL_DIR],
23 [dnl remove trailing slashes
24 m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$]))
25 m4_case(_LTDL_DIR,
26 [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.'
27 m4_if(_ARG_DIR, [.],
28 [],
29 [m4_define([_LTDL_DIR], _ARG_DIR)
30 _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])],
31 [m4_if(_ARG_DIR, _LTDL_DIR,
32 [],
33 [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])])
34 m4_popdef([_ARG_DIR])
35 ])# _LT_CONFIG_LTDL_DIR
36
37 # Initialise:
38 m4_define([_LTDL_DIR], [])
39
40
41 # _LT_BUILD_PREFIX
42 # ----------------
43 # If Autoconf is new enough, expand to `${top_build_prefix}', otherwise
44 # to `${top_builddir}/'.
45 m4_define([_LT_BUILD_PREFIX],
46 [m4_ifdef([AC_AUTOCONF_VERSION],
47 [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]),
48 [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX],
49 [${top_build_prefix}],
50 [${top_builddir}/])],
51 [${top_build_prefix}])],
52 [${top_builddir}/])[]dnl
53 ])
54
55
56 # LTDL_CONVENIENCE
57 # ----------------
58 # sets LIBLTDL to the link flags for the libltdl convenience library and
59 # LTDLINCL to the include flags for the libltdl header and adds
60 # --enable-ltdl-convenience to the configure arguments. Note that
61 # AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with
62 # '${top_build_prefix}' if available, otherwise with '${top_builddir}/',
63 # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
64 # quotes!). If your package is not flat and you're not using automake,
65 # define top_build_prefix, top_builddir, and top_srcdir appropriately
66 # in your Makefiles.
67 AC_DEFUN([LTDL_CONVENIENCE],
68 [AC_BEFORE([$0], [LTDL_INIT])dnl
69 dnl Although the argument is deprecated and no longer documented,
70 dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one
71 dnl here make sure it is the same as any other declaration of libltdl's
72 dnl location! This also ensures lt_ltdl_dir is set when configure.ac is
73 dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
74 m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
75 _$0()
76 ])# LTDL_CONVENIENCE
77
78 # AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools,
79 # now we have LT_CONFIG_LTDL_DIR:
80 AU_DEFUN([AC_LIBLTDL_CONVENIENCE],
81 [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
82 _LTDL_CONVENIENCE])
83
84 dnl aclocal-1.4 backwards compatibility:
85 dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [])
86
87
88 # _LTDL_CONVENIENCE
89 # -----------------
90 # Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]).
91 m4_defun([_LTDL_CONVENIENCE],
92 [case $enable_ltdl_convenience in
93 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
94 "") enable_ltdl_convenience=yes
95 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
96 esac
97 LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la"
98 LTDLDEPS=$LIBLTDL
99 LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
100
101 AC_SUBST([LIBLTDL])
102 AC_SUBST([LTDLDEPS])
103 AC_SUBST([LTDLINCL])
104
105 # For backwards non-gettext consistent compatibility...
106 INCLTDL="$LTDLINCL"
107 AC_SUBST([INCLTDL])
108 ])# _LTDL_CONVENIENCE
109
110
111 # LTDL_INSTALLABLE
112 # ----------------
113 # sets LIBLTDL to the link flags for the libltdl installable library
114 # and LTDLINCL to the include flags for the libltdl header and adds
115 # --enable-ltdl-install to the configure arguments. Note that
116 # AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl
117 # is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if
118 # available, otherwise with '${top_builddir}/', and LTDLINCL will be
119 # prefixed with '${top_srcdir}/' (note the single quotes!). If your
120 # package is not flat and you're not using automake, define top_build_prefix,
121 # top_builddir, and top_srcdir appropriately in your Makefiles.
122 # In the future, this macro may have to be called after LT_INIT.
123 AC_DEFUN([LTDL_INSTALLABLE],
124 [AC_BEFORE([$0], [LTDL_INIT])dnl
125 dnl Although the argument is deprecated and no longer documented,
126 dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one
127 dnl here make sure it is the same as any other declaration of libltdl's
128 dnl location! This also ensures lt_ltdl_dir is set when configure.ac is
129 dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
130 m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
131 _$0()
132 ])# LTDL_INSTALLABLE
133
134 # AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools,
135 # now we have LT_CONFIG_LTDL_DIR:
136 AU_DEFUN([AC_LIBLTDL_INSTALLABLE],
137 [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
138 _LTDL_INSTALLABLE])
139
140 dnl aclocal-1.4 backwards compatibility:
141 dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [])
142
143
144 # _LTDL_INSTALLABLE
145 # -----------------
146 # Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]).
147 m4_defun([_LTDL_INSTALLABLE],
148 [if test -f $prefix/lib/libltdl.la; then
149 lt_save_LDFLAGS="$LDFLAGS"
150 LDFLAGS="-L$prefix/lib $LDFLAGS"
151 AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes])
152 LDFLAGS="$lt_save_LDFLAGS"
153 if test x"${lt_lib_ltdl-no}" = xyes; then
154 if test x"$enable_ltdl_install" != xyes; then
155 # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install
156 AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install'])
157 enable_ltdl_install=no
158 fi
159 elif test x"$enable_ltdl_install" = xno; then
160 AC_MSG_WARN([libltdl not installed, but installation disabled])
161 fi
162 fi
163
164 # If configure.ac declared an installable ltdl, and the user didn't override
165 # with --disable-ltdl-install, we will install the shipped libltdl.
166 case $enable_ltdl_install in
167 no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
168 LIBLTDL="-lltdl"
169 LTDLDEPS=
170 LTDLINCL=
171 ;;
172 *) enable_ltdl_install=yes
173 ac_configure_args="$ac_configure_args --enable-ltdl-install"
174 LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la"
175 LTDLDEPS=$LIBLTDL
176 LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
177 ;;
178 esac
179
180 AC_SUBST([LIBLTDL])
181 AC_SUBST([LTDLDEPS])
182 AC_SUBST([LTDLINCL])
183
184 # For backwards non-gettext consistent compatibility...
185 INCLTDL="$LTDLINCL"
186 AC_SUBST([INCLTDL])
187 ])# LTDL_INSTALLABLE
188
189
190 # _LTDL_MODE_DISPATCH
191 # -------------------
192 m4_define([_LTDL_MODE_DISPATCH],
193 [dnl If _LTDL_DIR is `.', then we are configuring libltdl itself:
194 m4_if(_LTDL_DIR, [],
195 [],
196 dnl if _LTDL_MODE was not set already, the default value is `subproject':
197 [m4_case(m4_default(_LTDL_MODE, [subproject]),
198 [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR)
199 _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])],
200 [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])],
201 [recursive], [],
202 [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl
203 dnl Be careful not to expand twice:
204 m4_define([$0], [])
205 ])# _LTDL_MODE_DISPATCH
206
207
208 # _LT_LIBOBJ(MODULE_NAME)
209 # -----------------------
210 # Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead
211 # of into LIBOBJS.
212 AC_DEFUN([_LT_LIBOBJ], [
213 m4_pattern_allow([^_LT_LIBOBJS$])
214 _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext"
215 ])# _LT_LIBOBJS
216
217
218 # LTDL_INIT([OPTIONS])
219 # --------------------
220 # Clients of libltdl can use this macro to allow the installer to
221 # choose between a shipped copy of the ltdl sources or a preinstalled
222 # version of the library. If the shipped ltdl sources are not in a
223 # subdirectory named libltdl, the directory name must be given by
224 # LT_CONFIG_LTDL_DIR.
225 AC_DEFUN([LTDL_INIT],
226 [dnl Parse OPTIONS
227 _LT_SET_OPTIONS([$0], [$1])
228
229 dnl We need to keep our own list of libobjs separate from our parent project,
230 dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while
231 dnl we look for our own LIBOBJs.
232 m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ]))
233 m4_pushdef([AC_LIBSOURCES])
234
235 dnl If not otherwise defined, default to the 1.5.x compatible subproject mode:
236 m4_if(_LTDL_MODE, [],
237 [m4_define([_LTDL_MODE], m4_default([$2], [subproject]))
238 m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])],
239 [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])
240
241 AC_ARG_WITH([included_ltdl],
242 [AS_HELP_STRING([--with-included-ltdl],
243 [use the GNU ltdl sources included here])])
244
245 if test "x$with_included_ltdl" != xyes; then
246 # We are not being forced to use the included libltdl sources, so
247 # decide whether there is a useful installed version we can use.
248 AC_CHECK_HEADER([ltdl.h],
249 [AC_CHECK_DECL([lt_dlinterface_register],
250 [AC_CHECK_LIB([ltdl], [lt_dladvise_preload],
251 [with_included_ltdl=no],
252 [with_included_ltdl=yes])],
253 [with_included_ltdl=yes],
254 [AC_INCLUDES_DEFAULT
255 #include <ltdl.h>])],
256 [with_included_ltdl=yes],
257 [AC_INCLUDES_DEFAULT]
258 )
259 fi
260
261 dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE
262 dnl was called yet, then for old times' sake, we assume libltdl is in an
263 dnl eponymous directory:
264 AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])])
265
266 AC_ARG_WITH([ltdl_include],
267 [AS_HELP_STRING([--with-ltdl-include=DIR],
268 [use the ltdl headers installed in DIR])])
269
270 if test -n "$with_ltdl_include"; then
271 if test -f "$with_ltdl_include/ltdl.h"; then :
272 else
273 AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include'])
274 fi
275 else
276 with_ltdl_include=no
277 fi
278
279 AC_ARG_WITH([ltdl_lib],
280 [AS_HELP_STRING([--with-ltdl-lib=DIR],
281 [use the libltdl.la installed in DIR])])
282
283 if test -n "$with_ltdl_lib"; then
284 if test -f "$with_ltdl_lib/libltdl.la"; then :
285 else
286 AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib'])
287 fi
288 else
289 with_ltdl_lib=no
290 fi
291
292 case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in
293 ,yes,no,no,)
294 m4_case(m4_default(_LTDL_TYPE, [convenience]),
295 [convenience], [_LTDL_CONVENIENCE],
296 [installable], [_LTDL_INSTALLABLE],
297 [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)])
298 ;;
299 ,no,no,no,)
300 # If the included ltdl is not to be used, then use the
301 # preinstalled libltdl we found.
302 AC_DEFINE([HAVE_LTDL], [1],
303 [Define this if a modern libltdl is already installed])
304 LIBLTDL=-lltdl
305 LTDLDEPS=
306 LTDLINCL=
307 ;;
308 ,no*,no,*)
309 AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together])
310 ;;
311 *) with_included_ltdl=no
312 LIBLTDL="-L$with_ltdl_lib -lltdl"
313 LTDLDEPS=
314 LTDLINCL="-I$with_ltdl_include"
315 ;;
316 esac
317 INCLTDL="$LTDLINCL"
318
319 # Report our decision...
320 AC_MSG_CHECKING([where to find libltdl headers])
321 AC_MSG_RESULT([$LTDLINCL])
322 AC_MSG_CHECKING([where to find libltdl library])
323 AC_MSG_RESULT([$LIBLTDL])
324
325 _LTDL_SETUP
326
327 dnl restore autoconf definition.
328 m4_popdef([AC_LIBOBJ])
329 m4_popdef([AC_LIBSOURCES])
330
331 AC_CONFIG_COMMANDS_PRE([
332 _ltdl_libobjs=
333 _ltdl_ltlibobjs=
334 if test -n "$_LT_LIBOBJS"; then
335 # Remove the extension.
336 _lt_sed_drop_objext='s/\.o$//;s/\.obj$//'
337 for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do
338 _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext"
339 _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo"
340 done
341 fi
342 AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs])
343 AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs])
344 ])
345
346 # Only expand once:
347 m4_define([LTDL_INIT])
348 ])# LTDL_INIT
349
350 # Old names:
351 AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)])
352 AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)])
353 AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)])
354 dnl aclocal-1.4 backwards compatibility:
355 dnl AC_DEFUN([AC_LIB_LTDL], [])
356 dnl AC_DEFUN([AC_WITH_LTDL], [])
357 dnl AC_DEFUN([LT_WITH_LTDL], [])
358
359
360 # _LTDL_SETUP
361 # -----------
362 # Perform all the checks necessary for compilation of the ltdl objects
363 # -- including compiler checks and header checks. This is a public
364 # interface mainly for the benefit of libltdl's own configure.ac, most
365 # other users should call LTDL_INIT instead.
366 AC_DEFUN([_LTDL_SETUP],
367 [AC_REQUIRE([AC_PROG_CC])dnl
368 AC_REQUIRE([LT_SYS_MODULE_EXT])dnl
369 AC_REQUIRE([LT_SYS_MODULE_PATH])dnl
370 AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl
371 AC_REQUIRE([LT_LIB_DLLOAD])dnl
372 AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
373 AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl
374 AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl
375 AC_REQUIRE([gl_FUNC_ARGZ])dnl
376
377 m4_require([_LT_CHECK_OBJDIR])dnl
378 m4_require([_LT_HEADER_DLFCN])dnl
379 m4_require([_LT_CHECK_DLPREOPEN])dnl
380 m4_require([_LT_DECL_SED])dnl
381
382 dnl Don't require this, or it will be expanded earlier than the code
383 dnl that sets the variables it relies on:
384 _LT_ENABLE_INSTALL
385
386 dnl _LTDL_MODE specific code must be called at least once:
387 _LTDL_MODE_DISPATCH
388
389 # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS
390 # the user used. This is so that ltdl.h can pick up the parent projects
391 # config.h file, The first file in AC_CONFIG_HEADERS must contain the
392 # definitions required by ltdl.c.
393 # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility).
394 AC_CONFIG_COMMANDS_PRE([dnl
395 m4_pattern_allow([^LT_CONFIG_H$])dnl
396 m4_ifset([AH_HEADER],
397 [LT_CONFIG_H=AH_HEADER],
398 [m4_ifset([AC_LIST_HEADERS],
399 [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`],
400 [])])])
401 AC_SUBST([LT_CONFIG_H])
402
403 AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h],
404 [], [], [AC_INCLUDES_DEFAULT])
405
406 AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])])
407 AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])])
408
409 AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension])
410
411 name=ltdl
412 LTDLOPEN=`eval "\\$ECHO \"$libname_spec\""`
413 AC_SUBST([LTDLOPEN])
414 ])# _LTDL_SETUP
415
416
417 # _LT_ENABLE_INSTALL
418 # ------------------
419 m4_define([_LT_ENABLE_INSTALL],
420 [AC_ARG_ENABLE([ltdl-install],
421 [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])])
422
423 case ,${enable_ltdl_install},${enable_ltdl_convenience} in
424 *yes*) ;;
425 *) enable_ltdl_convenience=yes ;;
426 esac
427
428 m4_ifdef([AM_CONDITIONAL],
429 [AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
430 AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)])
431 ])# _LT_ENABLE_INSTALL
432
433
434 # LT_SYS_DLOPEN_DEPLIBS
435 # ---------------------
436 AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS],
437 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
438 AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
439 [lt_cv_sys_dlopen_deplibs],
440 [# PORTME does your system automatically load deplibs for dlopen?
441 # or its logical equivalent (e.g. shl_load for HP-UX < 11)
442 # For now, we just catch OSes we know something about -- in the
443 # future, we'll try test this programmatically.
444 lt_cv_sys_dlopen_deplibs=unknown
445 case $host_os in
446 aix3*|aix4.1.*|aix4.2.*)
447 # Unknown whether this is true for these versions of AIX, but
448 # we want this `case' here to explicitly catch those versions.
449 lt_cv_sys_dlopen_deplibs=unknown
450 ;;
451 aix[[4-9]]*)
452 lt_cv_sys_dlopen_deplibs=yes
453 ;;
454 amigaos*)
455 case $host_cpu in
456 powerpc)
457 lt_cv_sys_dlopen_deplibs=no
458 ;;
459 esac
460 ;;
461 darwin*)
462 # Assuming the user has installed a libdl from somewhere, this is true
463 # If you are looking for one http://www.opendarwin.org/projects/dlcompat
464 lt_cv_sys_dlopen_deplibs=yes
465 ;;
466 freebsd* | dragonfly*)
467 lt_cv_sys_dlopen_deplibs=yes
468 ;;
469 gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
470 # GNU and its variants, using gnu ld.so (Glibc)
471 lt_cv_sys_dlopen_deplibs=yes
472 ;;
473 hpux10*|hpux11*)
474 lt_cv_sys_dlopen_deplibs=yes
475 ;;
476 interix*)
477 lt_cv_sys_dlopen_deplibs=yes
478 ;;
479 irix[[12345]]*|irix6.[[01]]*)
480 # Catch all versions of IRIX before 6.2, and indicate that we don't
481 # know how it worked for any of those versions.
482 lt_cv_sys_dlopen_deplibs=unknown
483 ;;
484 irix*)
485 # The case above catches anything before 6.2, and it's known that
486 # at 6.2 and later dlopen does load deplibs.
487 lt_cv_sys_dlopen_deplibs=yes
488 ;;
489 netbsd* | netbsdelf*-gnu)
490 lt_cv_sys_dlopen_deplibs=yes
491 ;;
492 openbsd*)
493 lt_cv_sys_dlopen_deplibs=yes
494 ;;
495 osf[[1234]]*)
496 # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
497 # it did *not* use an RPATH in a shared library to find objects the
498 # library depends on, so we explicitly say `no'.
499 lt_cv_sys_dlopen_deplibs=no
500 ;;
501 osf5.0|osf5.0a|osf5.1)
502 # dlopen *does* load deplibs and with the right loader patch applied
503 # it even uses RPATH in a shared library to search for shared objects
504 # that the library depends on, but there's no easy way to know if that
505 # patch is installed. Since this is the case, all we can really
506 # say is unknown -- it depends on the patch being installed. If
507 # it is, this changes to `yes'. Without it, it would be `no'.
508 lt_cv_sys_dlopen_deplibs=unknown
509 ;;
510 osf*)
511 # the two cases above should catch all versions of osf <= 5.1. Read
512 # the comments above for what we know about them.
513 # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
514 # is used to find them so we can finally say `yes'.
515 lt_cv_sys_dlopen_deplibs=yes
516 ;;
517 qnx*)
518 lt_cv_sys_dlopen_deplibs=yes
519 ;;
520 solaris*)
521 lt_cv_sys_dlopen_deplibs=yes
522 ;;
523 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
524 libltdl_cv_sys_dlopen_deplibs=yes
525 ;;
526 esac
527 ])
528 if test "$lt_cv_sys_dlopen_deplibs" != yes; then
529 AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
530 [Define if the OS needs help to load dependent libraries for dlopen().])
531 fi
532 ])# LT_SYS_DLOPEN_DEPLIBS
533
534 # Old name:
535 AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS])
536 dnl aclocal-1.4 backwards compatibility:
537 dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [])
538
539
540 # LT_SYS_MODULE_EXT
541 # -----------------
542 AC_DEFUN([LT_SYS_MODULE_EXT],
543 [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
544 AC_CACHE_CHECK([which extension is used for runtime loadable modules],
545 [libltdl_cv_shlibext],
546 [
547 module=yes
548 eval libltdl_cv_shlibext=$shrext_cmds
549 ])
550 if test -n "$libltdl_cv_shlibext"; then
551 m4_pattern_allow([LT_MODULE_EXT])dnl
552 AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"],
553 [Define to the extension used for runtime loadable modules, say, ".so".])
554 fi
555 ])# LT_SYS_MODULE_EXT
556
557 # Old name:
558 AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT])
559 dnl aclocal-1.4 backwards compatibility:
560 dnl AC_DEFUN([AC_LTDL_SHLIBEXT], [])
561
562
563 # LT_SYS_MODULE_PATH
564 # ------------------
565 AC_DEFUN([LT_SYS_MODULE_PATH],
566 [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
567 AC_CACHE_CHECK([which variable specifies run-time module search path],
568 [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"])
569 if test -n "$lt_cv_module_path_var"; then
570 m4_pattern_allow([LT_MODULE_PATH_VAR])dnl
571 AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"],
572 [Define to the name of the environment variable that determines the run-time module search path.])
573 fi
574 ])# LT_SYS_MODULE_PATH
575
576 # Old name:
577 AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH])
578 dnl aclocal-1.4 backwards compatibility:
579 dnl AC_DEFUN([AC_LTDL_SHLIBPATH], [])
580
581
582 # LT_SYS_DLSEARCH_PATH
583 # --------------------
584 AC_DEFUN([LT_SYS_DLSEARCH_PATH],
585 [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
586 AC_CACHE_CHECK([for the default library search path],
587 [lt_cv_sys_dlsearch_path],
588 [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"])
589 if test -n "$lt_cv_sys_dlsearch_path"; then
590 sys_dlsearch_path=
591 for dir in $lt_cv_sys_dlsearch_path; do
592 if test -z "$sys_dlsearch_path"; then
593 sys_dlsearch_path="$dir"
594 else
595 sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir"
596 fi
597 done
598 m4_pattern_allow([LT_DLSEARCH_PATH])dnl
599 AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"],
600 [Define to the system default library search path.])
601 fi
602 ])# LT_SYS_DLSEARCH_PATH
603
604 # Old name:
605 AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH])
606 dnl aclocal-1.4 backwards compatibility:
607 dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [])
608
609
610 # _LT_CHECK_DLPREOPEN
611 # -------------------
612 m4_defun([_LT_CHECK_DLPREOPEN],
613 [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
614 AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
615 [libltdl_cv_preloaded_symbols],
616 [if test -n "$lt_cv_sys_global_symbol_pipe"; then
617 libltdl_cv_preloaded_symbols=yes
618 else
619 libltdl_cv_preloaded_symbols=no
620 fi
621 ])
622 if test x"$libltdl_cv_preloaded_symbols" = xyes; then
623 AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1],
624 [Define if libtool can extract symbol lists from object files.])
625 fi
626 ])# _LT_CHECK_DLPREOPEN
627
628
629 # LT_LIB_DLLOAD
630 # -------------
631 AC_DEFUN([LT_LIB_DLLOAD],
632 [m4_pattern_allow([^LT_DLLOADERS$])
633 LT_DLLOADERS=
634 AC_SUBST([LT_DLLOADERS])
635
636 AC_LANG_PUSH([C])
637
638 LIBADD_DLOPEN=
639 AC_SEARCH_LIBS([dlopen], [dl],
640 [AC_DEFINE([HAVE_LIBDL], [1],
641 [Define if you have the libdl library or equivalent.])
642 if test "$ac_cv_search_dlopen" != "none required" ; then
643 LIBADD_DLOPEN="-ldl"
644 fi
645 libltdl_cv_lib_dl_dlopen="yes"
646 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
647 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H
648 # include <dlfcn.h>
649 #endif
650 ]], [[dlopen(0, 0);]])],
651 [AC_DEFINE([HAVE_LIBDL], [1],
652 [Define if you have the libdl library or equivalent.])
653 libltdl_cv_func_dlopen="yes"
654 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
655 [AC_CHECK_LIB([svld], [dlopen],
656 [AC_DEFINE([HAVE_LIBDL], [1],
657 [Define if you have the libdl library or equivalent.])
658 LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes"
659 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])])
660 if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
661 then
662 lt_save_LIBS="$LIBS"
663 LIBS="$LIBS $LIBADD_DLOPEN"
664 AC_CHECK_FUNCS([dlerror])
665 LIBS="$lt_save_LIBS"
666 fi
667 AC_SUBST([LIBADD_DLOPEN])
668
669 LIBADD_SHL_LOAD=
670 AC_CHECK_FUNC([shl_load],
671 [AC_DEFINE([HAVE_SHL_LOAD], [1],
672 [Define if you have the shl_load function.])
673 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"],
674 [AC_CHECK_LIB([dld], [shl_load],
675 [AC_DEFINE([HAVE_SHL_LOAD], [1],
676 [Define if you have the shl_load function.])
677 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"
678 LIBADD_SHL_LOAD="-ldld"])])
679 AC_SUBST([LIBADD_SHL_LOAD])
680
681 case $host_os in
682 darwin[[1567]].*)
683 # We only want this for pre-Mac OS X 10.4.
684 AC_CHECK_FUNC([_dyld_func_lookup],
685 [AC_DEFINE([HAVE_DYLD], [1],
686 [Define if you have the _dyld_func_lookup function.])
687 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"])
688 ;;
689 beos*)
690 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la"
691 ;;
692 cygwin* | mingw* | os2* | pw32*)
693 AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include <sys/cygwin.h>]])
694 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la"
695 ;;
696 esac
697
698 AC_CHECK_LIB([dld], [dld_link],
699 [AC_DEFINE([HAVE_DLD], [1],
700 [Define if you have the GNU dld library.])
701 LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"])
702 AC_SUBST([LIBADD_DLD_LINK])
703
704 m4_pattern_allow([^LT_DLPREOPEN$])
705 LT_DLPREOPEN=
706 if test -n "$LT_DLLOADERS"
707 then
708 for lt_loader in $LT_DLLOADERS; do
709 LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader "
710 done
711 AC_DEFINE([HAVE_LIBDLLOADER], [1],
712 [Define if libdlloader will be built on this platform])
713 fi
714 AC_SUBST([LT_DLPREOPEN])
715
716 dnl This isn't used anymore, but set it for backwards compatibility
717 LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD"
718 AC_SUBST([LIBADD_DL])
719
720 AC_LANG_POP
721 ])# LT_LIB_DLLOAD
722
723 # Old name:
724 AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD])
725 dnl aclocal-1.4 backwards compatibility:
726 dnl AC_DEFUN([AC_LTDL_DLLIB], [])
727
728
729 # LT_SYS_SYMBOL_USCORE
730 # --------------------
731 # does the compiler prefix global symbols with an underscore?
732 AC_DEFUN([LT_SYS_SYMBOL_USCORE],
733 [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
734 AC_CACHE_CHECK([for _ prefix in compiled symbols],
735 [lt_cv_sys_symbol_underscore],
736 [lt_cv_sys_symbol_underscore=no
737 cat > conftest.$ac_ext <<_LT_EOF
738 void nm_test_func(){}
739 int main(){nm_test_func;return 0;}
740 _LT_EOF
741 if AC_TRY_EVAL(ac_compile); then
742 # Now try to grab the symbols.
743 ac_nlist=conftest.nm
744 if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
745 # See whether the symbols have a leading underscore.
746 if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
747 lt_cv_sys_symbol_underscore=yes
748 else
749 if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
750 :
751 else
752 echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
753 fi
754 fi
755 else
756 echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
757 fi
758 else
759 echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
760 cat conftest.c >&AS_MESSAGE_LOG_FD
761 fi
762 rm -rf conftest*
763 ])
764 sys_symbol_underscore=$lt_cv_sys_symbol_underscore
765 AC_SUBST([sys_symbol_underscore])
766 ])# LT_SYS_SYMBOL_USCORE
767
768 # Old name:
769 AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE])
770 dnl aclocal-1.4 backwards compatibility:
771 dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [])
772
773
774 # LT_FUNC_DLSYM_USCORE
775 # --------------------
776 AC_DEFUN([LT_FUNC_DLSYM_USCORE],
777 [AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
778 if test x"$lt_cv_sys_symbol_underscore" = xyes; then
779 if test x"$libltdl_cv_func_dlopen" = xyes ||
780 test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
781 AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
782 [libltdl_cv_need_uscore],
783 [libltdl_cv_need_uscore=unknown
784 save_LIBS="$LIBS"
785 LIBS="$LIBS $LIBADD_DLOPEN"
786 _LT_TRY_DLOPEN_SELF(
787 [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
788 [], [libltdl_cv_need_uscore=cross])
789 LIBS="$save_LIBS"
790 ])
791 fi
792 fi
793
794 if test x"$libltdl_cv_need_uscore" = xyes; then
795 AC_DEFINE([NEED_USCORE], [1],
796 [Define if dlsym() requires a leading underscore in symbol names.])
797 fi
798 ])# LT_FUNC_DLSYM_USCORE
799
800 # Old name:
801 AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE])
802 dnl aclocal-1.4 backwards compatibility:
803 dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], [])
22 sbin_PROGRAMS = ipset
33 ipset_SOURCES = ipset.c ui.c
44 ipset_LDADD = ../lib/libipset.la
5
6 if ENABLE_SETTYPE_MODULES
7 AM_LDFLAGS = -shared
8 else
9 if ENABLE_STATIC
510 AM_LDFLAGS = -static
11 endif
12 endif
613
714 dist_man_MANS = ipset.8
815
110110 sbin_PROGRAMS = ipset$(EXEEXT)
111111 subdir = src
112112 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
113 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \
114 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
115 $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
116 $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
113 am__aclocal_m4_deps = $(top_srcdir)/m4/argz.m4 \
114 $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \
115 $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltdl.m4 \
116 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
117 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
118 $(top_srcdir)/configure.ac
117119 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
118120 $(ACLOCAL_M4)
119121 mkinstalldirs = $(install_sh) -d
170172 ACLOCAL = @ACLOCAL@
171173 AMTAR = @AMTAR@
172174 AR = @AR@
175 ARGZ_H = @ARGZ_H@
173176 AUTOCONF = @AUTOCONF@
174177 AUTOHEADER = @AUTOHEADER@
175178 AUTOMAKE = @AUTOMAKE@
191194 EXEEXT = @EXEEXT@
192195 FGREP = @FGREP@
193196 GREP = @GREP@
197 INCLTDL = @INCLTDL@
194198 INSTALL = @INSTALL@
195199 INSTALL_DATA = @INSTALL_DATA@
196200 INSTALL_PROGRAM = @INSTALL_PROGRAM@
199203 KBUILDDIR = @KBUILDDIR@
200204 LD = @LD@
201205 LDFLAGS = @LDFLAGS@
206 LIBADD_DL = @LIBADD_DL@
207 LIBADD_DLD_LINK = @LIBADD_DLD_LINK@
208 LIBADD_DLOPEN = @LIBADD_DLOPEN@
209 LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@
210 LIBLTDL = @LIBLTDL@
202211 LIBOBJS = @LIBOBJS@
203212 LIBS = @LIBS@
204213 LIBTOOL = @LIBTOOL@
205214 LIPO = @LIPO@
206215 LN_S = @LN_S@
216 LTDLDEPS = @LTDLDEPS@
217 LTDLINCL = @LTDLINCL@
218 LTDLOPEN = @LTDLOPEN@
207219 LTLIBOBJS = @LTLIBOBJS@
220 LT_CONFIG_H = @LT_CONFIG_H@
221 LT_DLLOADERS = @LT_DLLOADERS@
222 LT_DLPREOPEN = @LT_DLPREOPEN@
208223 MAKEINFO = @MAKEINFO@
209224 MAXSETS = @MAXSETS@
210225 MKDIR_P = @MKDIR_P@
225240 PKG_CONFIG = @PKG_CONFIG@
226241 RANLIB = @RANLIB@
227242 SED = @SED@
243 SETTYPE_MODLIST = @SETTYPE_MODLIST@
228244 SET_MAKE = @SET_MAKE@
229245 SHELL = @SHELL@
230246 STRIP = @STRIP@
268284 localedir = @localedir@
269285 localstatedir = @localstatedir@
270286 lt_ECHO = @lt_ECHO@
287 ltdl_LIBOBJS = @ltdl_LIBOBJS@
288 ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@
271289 mandir = @mandir@
272290 mkdir_p = @mkdir_p@
273291 oldincludedir = @oldincludedir@
278296 sbindir = @sbindir@
279297 sharedstatedir = @sharedstatedir@
280298 srcdir = @srcdir@
299 sys_symbol_underscore = @sys_symbol_underscore@
281300 sysconfdir = @sysconfdir@
282301 target_alias = @target_alias@
283302 top_build_prefix = @top_build_prefix@
284303 top_builddir = @top_builddir@
285304 top_srcdir = @top_srcdir@
286 LIBVERSION = 2:0:0
305 LIBVERSION = 2:1:0
287306 AM_CPPFLAGS = $(kinclude_CFLAGS) $(all_includes) -I$(top_srcdir)/include \
288307 -I/usr/local/include
289308
293312 @ENABLE_VERBOSE_FALSE@AM_VERBOSE_CCLD = @echo " CCLD " $@;
294313 ipset_SOURCES = ipset.c ui.c
295314 ipset_LDADD = ../lib/libipset.la
296 AM_LDFLAGS = -static
315 @ENABLE_SETTYPE_MODULES_FALSE@@ENABLE_STATIC_TRUE@AM_LDFLAGS = -static
316 @ENABLE_SETTYPE_MODULES_TRUE@AM_LDFLAGS = -shared
297317 dist_man_MANS = ipset.8
298318 all: all-am
299319
184184 .parse = ipset_envopt_parse,
185185 .has_arg = IPSET_NO_ARG, .flag = IPSET_ENV_EXIST,
186186 .help = "\n"
187 " Ignore errors when creating already created sets,\n"
188 " when adding already existing elements\n"
189 " or when deleting non-existing elements.",
187 " Ignore errors when creating or adding sets or\n"
188 " elements that do exist or when deleting elements\n"
189 " that don't exist.",
190190 },
191191 { .name = { "-n", "-name" },
192192 .parse = ipset_envopt_parse,
193193 .has_arg = IPSET_NO_ARG, .flag = IPSET_ENV_LIST_SETNAME,
194194 .help = "\n"
195 " When listing, list just setnames from kernel.\n",
195 " When listing, just list setnames from the kernel.\n",
196196 },
197197 { .name = { "-t", "-terse" },
198198 .parse = ipset_envopt_parse,
255255 (*argc)--;
256256 return;
257257 }
258
259 /**
260 * ipset_port_usage - prints the usage for the port parameter
261 *
262 * Print the usage for the port parameter to stdout.
263 */
264 void
265 ipset_port_usage(void)
266 {
267 int i;
268 const char *name;
269
270 printf(" [PROTO:]PORT is a valid pattern of the following:\n"
271 " PORTNAME TCP port name from /etc/services\n"
272 " PORTNUMBER TCP port number identifier\n"
273 " tcp|sctp|udp|udplite:PORTNAME|PORTNUMBER\n"
274 " icmp:CODENAME supported ICMP codename\n"
275 " icmp:TYPE/CODE ICMP type/code value\n"
276 " icmpv6:CODENAME supported ICMPv6 codename\n"
277 " icmpv6:TYPE/CODE ICMPv6 type/code value\n"
278 " PROTO:0 all other protocols\n\n");
279
280 printf(" Supported ICMP codenames:\n");
281 i = 0;
282 while ((name = id_to_icmp(i++)) != NULL)
283 printf(" %s\n", name);
284 printf(" Supported ICMPv6 codenames:\n");
285 i = 0;
286 while ((name = id_to_icmpv6(i++)) != NULL)
287 printf(" %s\n", name);
288 }