# # # delete "netxx/netxx.h" # # rename "netxx/address.h" # to "netxx/netxx/address.h" # # rename "netxx/datagram.h" # to "netxx/netxx/datagram.h" # # rename "netxx/datagramserver.h" # to "netxx/netxx/datagramserver.h" # # rename "netxx/netbuf.h" # to "netxx/netxx/netbuf.h" # # rename "netxx/peer.h" # to "netxx/netxx/peer.h" # # rename "netxx/probe.h" # to "netxx/netxx/probe.h" # # rename "netxx/probeinfo.h" # to "netxx/netxx/probeinfo.h" # # rename "netxx/sockopt.h" # to "netxx/netxx/sockopt.h" # # rename "netxx/stream.h" # to "netxx/netxx/stream.h" # # rename "netxx/streambase.h" # to "netxx/netxx/streambase.h" # # rename "netxx/streamserver.h" # to "netxx/netxx/streamserver.h" # # rename "netxx/timeout.h" # to "netxx/netxx/timeout.h" # # rename "netxx/types.h" # to "netxx/netxx/types.h" # # add_dir "netxx/netxx" # # patch "netxx/Makefile.am" # from [d10129ca3a4af73548337d6d82fcc3acd55764c9] # to [c046679079caebbd76204edcd38a80a0d82f8b92] # # patch "netxx/common.h" # from [dff5379d05a5fd164e4bc374c4e2ef3c8206ee80] # to [653057dead74ee491f7d0fc8637c98f5dc326bf2] # # patch "netxx/configure.ac" # from [cd0be0962f79b2628b10d9739460595c1c3dacb6] # to [6f248348d51d4d4884b8667cf0a40372e9e30fdd] # ============================================================ --- netxx/Makefile.am d10129ca3a4af73548337d6d82fcc3acd55764c9 +++ netxx/Makefile.am c046679079caebbd76204edcd38a80a0d82f8b92 @@ -1,30 +1,27 @@ lib_LIBRARIES = libnetxx.a lib_LIBRARIES = libnetxx.a -include_HEADERS = -libnetxx_a_SOURCES = \ - accept.cxx accept.h address.cxx address.h common.h compat.h \ - datagram.cxx datagram.h datagramserver.cxx datagramserver.h \ - inet_ntop.cxx inet_ntop.h inet_pton.cxx inet_pton.h netbuf.h \ - netxx.h osutil.cxx osutil.h peer.cxx peer.h probe.cxx probe.h \ - probe_impl.h probeinfo.h probe_select.cxx recvfrom.cxx \ - recvfrom.h resolve_getaddrinfo.cxx resolve_gethostbyname.cxx \ - resolve_getservbyname.cxx resolve.h serverbase.cxx serverbase.h \ - sockaddr.cxx sockaddr.h socket.cxx socket.h sockopt.cxx \ - sockopt.h streambase.cxx streambase.h stream.cxx stream.h \ - streamserver.cxx streamserver.h timeout.h types.h +nobase_include_HEADERS = \ + netxx/address.h netxx/datagram.h netxx/datagramserver.h \ + netxx/netbuf.h netxx/peer.h netxx/probe.h netxx/probeinfo.h \ + netxx/sockopt.h netxx/streambase.h netxx/stream.h \ + netxx/streamserver.h netxx/timeout.h netxx/types.h -if MISSING_INET_PTON - libnetxx_a_SOURCES += inet_pton.cxx inet_pton.h -endif +libnetxx_a_SOURCES = \ + accept.cxx address.cxx datagram.cxx datagramserver.cxx \ + osutil.cxx peer.cxx probe.cxx probe_select.cxx recvfrom.cxx \ + serverbase.cxx sockaddr.cxx socket.cxx sockopt.cxx stream.cxx \ + streambase.cxx streamserver.cxx \ + accept.h common.h compat.h osutil.h probe_impl.h recvfrom.h \ + resolve.h serverbase.h sockaddr.h socket.h -if MISSING_INET_NTOP - libnetxx_a_SOURCES += inet_ntop.cxx inet_ntop.h -endif +# conditionally included +EXTRA_libnetxx_a_SOURCES = \ + inet_pton.cxx inet_pton.h \ + inet_ntop.cxx inet_ntop.h \ + resolve_gethostbyname.cxx resolve_getservbyname.cxx \ + resolve_getaddrinfo.cxx -if MISSING_GETADDRINFO - libnetxx_a_SOURCES += resolve_gethostbyname.cxx resolve_getservbyname.cxx -else - libnetxx_a_SOURCES += resolve_getaddrinfo.cxx -endif +libnetxx_a_LIBADD = $(PLAT_OBJS) +libnetxx_a_DEPENDENCIES = $(PLAT_OBJS) # This is necessary because autoreconf doesn't pay attention to # AC_CONFIG_MACRO_DIR. ============================================================ --- netxx/common.h dff5379d05a5fd164e4bc374c4e2ef3c8206ee80 +++ netxx/common.h 653057dead74ee491f7d0fc8637c98f5dc326bf2 @@ -37,6 +37,7 @@ #ifndef _netxx_common_h_ #define _netxx_common_h_ +#include "config.h" #include "compat.h" #include "osutil.h" ============================================================ --- netxx/configure.ac cd0be0962f79b2628b10d9739460595c1c3dacb6 +++ netxx/configure.ac 6f248348d51d4d4884b8667cf0a40372e9e30fdd @@ -22,8 +22,9 @@ AM_INIT_AUTOMAKE([1.7.1 foreign no-dist AC_CONFIG_MACRO_DIR([../m4]) AM_INIT_AUTOMAKE([1.7.1 foreign no-dist no-define]) -AC_CONFIG_SRCDIR([netxx.h]) +AC_CONFIG_SRCDIR([common.h]) AC_CONFIG_FILES([Makefile]) +AC_CONFIG_HEADERS([config.h]) AC_PROG_CXX AC_PROG_RANLIB @@ -34,22 +35,28 @@ fi AC_DEFINE(NETXX_NO_INET6, 1, [Define to suppress IPv6 support.]) fi +PLAT_OBJS= +AC_SUBST(PLAT_OBJS) + +AC_CHECK_FUNC(getaddrinfo, + [PLAT_OBJS="$PLAT_OBJS resolve_getaddrinfo.\$(OBJEXT)"] + , + [PLAT_OBJS="$PLAT_OBJS resolve_gethostbyname.\$(OBJEXT)" + PLAT_OBJS="$PLAT_OBJS resolve_getservbyname.\$(OBJEXT)"]) + + AC_CHECK_FUNC(inet_pton, - [AM_CONDITIONAL(MISSING_INET_PTON, false)], - [AM_CONDITIONAL(MISSING_INET_PTON, true) + [], + [PLAT_OBJS="$PLAT_OBJS inet_pton.\$(OBJEXT)" AC_DEFINE(NETXX_NO_PTON, 1, [Define if inet_pton is not available.]) ]) AC_CHECK_FUNC(inet_ntop, - [AM_CONDITIONAL(MISSING_INET_NTOP, false)], - [AM_CONDITIONAL(MISSING_INET_NTOP, true) - AC_DEFINE(NETXX_NO_PTON, 1, [Define if inet_pton is not available.]) + [], + [PLAT_OBJS="$PLAT_OBJS inet_ntop.\$(OBJEXT)" + AC_DEFINE(NETXX_NO_NTOP, 1, [Define if inet_ntop is not available.]) ]) -AC_CHECK_FUNC(getaddrinfo, - [AM_CONDITIONAL(MISSING_GETADDRINFO, false)], - [AM_CONDITIONAL(MISSING_GETADDRINFO, true)]) - AC_CHECK_TYPES([socklen_t],,,[ #include #include