if test "$ac_cv_func_getopt" = no ; then
GETOPT_LO="wsgetopt.lo"
fi
+AM_CONDITIONAL(NEED_GETOPT_LO, test "x$ac_cv_func_getopt" = "xno")
AC_SUBST(GETOPT_LO)
AC_CHECK_FUNC(strerror, STRERROR_LO="",
if test "$ac_cv_func_strerror" = no ; then
STRERROR_LO="strerror.lo"
fi
+AM_CONDITIONAL(NEED_STRERROR_LO, test "x$ac_cv_func_strerror" = "xno")
AC_SUBST(STRERROR_LO)
AC_CHECK_FUNC(strncasecmp, STRNCASECMP_LO="",
if test "$ac_cv_func_strncasecmp" = no ; then
STRNCASECMP_LO="strncasecmp.lo"
fi
+AM_CONDITIONAL(NEED_STRNCASECMP_LO, test "x$ac_cv_func_strncasecmp" = "xno")
AC_SUBST(STRNCASECMP_LO)
AC_CHECK_FUNCS(mkstemp mkdtemp)
else
INET_ATON_LO=""
fi
+AM_CONDITIONAL(NEED_INET_ATON_LO, test "x$have_inet_aton" = "xno")
AC_SUBST(INET_ATON_LO)
AC_SEARCH_LIBS(inet_pton, [socket nsl], [
else
INET_PTON_LO=""
fi
+AM_CONDITIONAL(NEED_INET_PTON_LO, test "x$have_inet_pton" = "xno")
AC_SUBST(INET_PTON_LO)
AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
INET_NTOP_LO="inet_ntop.lo"
AC_DEFINE(NEED_INET_V6DEFS_H, 1,
[Define if inet/v6defs.h needs to be included])])
+AM_CONDITIONAL(NEED_INET_NTOP_LO, test "x$INET_NTOP_LO" != "x")
AC_SUBST(INET_NTOP_LO)
AC_CHECK_FUNC(strptime, STRPTIME_LO="",
STRPTIME_LO="strptime.lo"
fi
AC_SUBST(STRPTIME_C)
+AM_CONDITIONAL(NEED_STRPTIME_LO, test "x$ac_cv_func_strptime" = "no")
AC_SUBST(STRPTIME_LO)
AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
ACLOCAL_AMFLAGS = `../aclocal-flags`
+# Optional objects that I know how to build. These will be
+# linked into libwsutil.
+wsutil_optional_objects =
+
+# filters for symbols to be omitted from libwsutil.sym
+# symbols defined only on windows
+def_sym_filter_symbols = /^getenv_utf8/ || /^ws_stdio/ || /^ws_init_dll_search_path/ || /^ws_load_library/ || /^ws_module_open/
+
+if NEED_GETOPT_LO
+wsutil_optional_objects += @GETOPT_LO@
+else
+def_sym_filter_symbols += || /^getopt/ || /^optarg/ || /^optind/ || /^opterr/ || /^optopt/
+endif
+
+if NEED_INET_ATON_LO
+wsutil_optional_objects += @INET_ATON_LO@
+else
+def_sym_filter_symbols += || /^inet_aton/
+endif
+
+if NEED_INET_NTOP_LO
+wsutil_optional_objects += @INET_NTOP_LO@
+else
+def_sym_filter_symbols += || /^ws_inet_ntop/
+endif
+
+if NEED_INET_PTON_LO
+wsutil_optional_objects += @INET_PTON_LO@
+else
+def_sym_filter_symbols += || /^ws_inet_pton/
+endif
+
+if NEED_STRERROR_LO
+wsutil_optional_objects += @STRERROR_LO@
+else
+def_sym_filter_symbols += || /^strerror/
+endif
+
+if NEED_STRNCASECMP_LO
+wsutil_optional_objects += @STRNCASECMP_LO@
+else
+def_sym_filter_symbols += || /^strncasecmp/
+endif
+
+if NEED_STRPTIME_LO
+wsutil_optional_objects += @STRPTIME_LO@
+else
+def_sym_filter_symbols += || /^strptime/
+endif
+
+def_sym_filter_symbols += {next;};
+
+include ../Makefile.am.inc
+
include Makefile.common
if HAVE_WARNINGS_AS_ERRORS
AM_CFLAGS = -Werror
endif
-# Optional objects that I know how to build. These will be
-# linked into libwsutil.
-wsutil_optional_objects = \
- @GETOPT_LO@ \
- @INET_ATON_LO@ \
- @INET_NTOP_LO@ \
- @INET_PTON_LO@ \
- @STRERROR_LO@ \
- @STRNCASECMP_LO@ \
- @STRPTIME_LO@
-
lib_LTLIBRARIES = libwsutil.la
-libwsutil_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
+libwsutil_la_LDFLAGS = -version-info 0:0:0 -export-symbols libwsutil.sym @LDFLAGS_SHAREDLIB@
INCLUDES = -I$(srcdir)/..
wsgetopt.h
libwsutil_la_DEPENDENCIES= \
- $(wsutil_optional_objects)
+ $(wsutil_optional_objects) \
+ libwsutil.sym
libwsutil_la_LIBADD = \
@GLIB_LIBS@ \
CLEANFILES = \
libwsutil.a \
libwsutil.la \
+ libwsutil.sym \
*~
MAINTAINERCLEANFILES = \