# # # rename "m4/netxx.m4" # to "Attic/netxx.m4" # # rename "netxx" # to "Attic/netxx" # # rename "netxx_pipe.cc" # to "Attic/netxx_pipe.cc" # # rename "netxx_pipe.hh" # to "Attic/netxx_pipe.hh" # # rename "unix/tester-check-net.cc" # to "Attic/unix-tester-check-net.cc" # # rename "win32/tester-check-net.cc" # to "Attic/win32-tester-check-net.cc" # # add_file "m4/asio.m4" # content [7fb989ca2f0c28eb21b92491a4412cfc0c6f0530] # # patch "Makefile.am" # from [c2a5a2f72d98a86acc2fc1b60399bb33bc2dfeed] # to [8c8ce705867949b31a1f7a2807c493e501c75ad5] # # patch "configure.ac" # from [46e0901df78937b2d44c1c0a356136f946d8954f] # to [72769799de86a8b8ce4d33e4950cb5a3d9e7761c] # # patch "lua-testsuite.lua" # from [60452657c3ea7dd8fd21e69928e739c666f90837] # to [5d69d9a2daa50397a20ad19be2a9cf7598df41aa] # # patch "rcs_file.cc" # from [ed67c5671b3697e609331ad14f952cfffde85d1f] # to [2b487020c2cc6888990ca22ca143d3d13028bf11] # ============================================================ --- m4/asio.m4 7fb989ca2f0c28eb21b92491a4412cfc0c6f0530 +++ m4/asio.m4 7fb989ca2f0c28eb21b92491a4412cfc0c6f0530 @@ -0,0 +1,29 @@ +dnl Grab-bag of checks related to asio. + +# Check for suitably new version of asio. +AC_DEFUN([ASIO_VERSION_CHECK], +[AC_LANG_ASSERT([C++]) + AC_CACHE_CHECK([for asio version 1.2.0 or newer], + ac_cv_asio_version_least_1_2_0, + [ + AC_COMPILE_IFELSE( + [#include + #if ASIO_VERSION >= 100200 + int main() { return 0; } + #else + #error asio version is too old + #endif + ], + ac_cv_asio_version_least_1_2_0=yes, + ac_cv_asio_version_least_1_2_0=no) + ]) + if test x$ac_cv_asio_version_least_1_2_0 = xno; then + AC_MSG_FAILURE([asio 1.2.0 or newer required]) + fi +]) + +# We currently don't need any checks for asio version-specific bugs, +# but we may in the future. They go in this macro. +AC_DEFUN([ASIO_VERSION_SPECIFIC_BUGS], +[AC_LANG_ASSERT([C++]) +]) ============================================================ --- Makefile.am c2a5a2f72d98a86acc2fc1b60399bb33bc2dfeed +++ Makefile.am 8c8ce705867949b31a1f7a2807c493e501c75ad5 @@ -47,7 +47,6 @@ MOST_SOURCES = \ refiner.cc refiner.hh \ enumerator.cc enumerator.hh \ netsync.cc \ - netxx_pipe.cc netxx_pipe.hh \ netcmd.cc netcmd.hh \ merkle_tree.cc merkle_tree.hh \ lcs.cc lcs.hh \ @@ -89,22 +88,6 @@ MOST_SOURCES = \ specialized_lexical_cast.cc lexical_cast.hh \ i18n.h parallel_iter.hh safe_map.hh pch.hh current_exception.hh -NETXX_SOURCES = \ - netxx/accept.cxx netxx/accept.h netxx/address.cxx \ - netxx/common.h netxx/compat.h netxx/datagram.cxx \ - netxx/datagramserver.cxx netxx/osutil.cxx netxx/osutil.h \ - netxx/peer.cxx netxx/probe.cxx netxx/probe_impl.h \ - netxx/probe_select.cxx netxx/recvfrom.cxx netxx/recvfrom.h \ - netxx/resolve.h netxx/serverbase.cxx netxx/serverbase.h \ - netxx/sockaddr.cxx netxx/sockaddr.h netxx/socket.cxx \ - netxx/socket.h netxx/sockopt.cxx netxx/stream.cxx \ - netxx/streambase.cxx netxx/streamserver.cxx \ - netxx/address.h netxx/datagram.h netxx/datagramserver.h \ - netxx/netbuf.h netxx/netxx.h netxx/peer.h netxx/probe.h \ - netxx/probeinfo.h netxx/sockopt.h netxx/stream.h \ - netxx/streambase.h netxx/streamserver.h netxx/timeout.h \ - netxx/types.h - UNIX_PLATFORM_SOURCES = \ unix/read_password.cc unix/get_system_flavour.cc \ unix/process.cc unix/terminal.cc unix/inodeprint.cc \ @@ -123,7 +106,7 @@ UNIT_TEST_SOURCES = \ UNIT_TEST_SOURCES = \ basic_io.cc charset.cc commands.cc crypto_tests.cc cset.cc \ dates.cc diff_patch.cc globish.cc graph.cc mkstemp.cc netcmd.cc \ - netxx_pipe.cc numeric_vocab.cc option.cc outdated_indicator.cc \ + numeric_vocab.cc option.cc outdated_indicator.cc \ packet.cc paths.cc refiner.cc restrictions.cc rev_height.cc \ revision.cc roster.cc roster_merge.cc simplestring_xform.cc \ string_queue.cc transforms.cc unit_tests.cc uri.cc vocab.cc \ @@ -177,10 +160,8 @@ txt2c_SOURCES = txt2c.cc txt2c_SOURCES = txt2c.cc -noinst_LIBRARIES = libplatform.a lib3rdparty.a +noinst_LIBRARIES = libplatform.a libplatform_a_SOURCES = platform.hh tester-plaf.hh -lib3rdparty_a_SOURCES = $(NETXX_SOURCES) -lib3rdparty_a_CPPFLAGS = # may be augmented in conditionals htmldir = $(datadir)/doc/monotone html_DATA = monotone.html @@ -226,50 +207,27 @@ mtn_CXXFLAGS = $(PCH_FLAGS) mtn_CPPFLAGS = $(EXTERNAL_CPPFLAGS) mtn_CXXFLAGS = $(PCH_FLAGS) -mtn_LDADD = libplatform.a lib3rdparty.a $(EXTERNAL_LIBS) +mtn_LDADD = libplatform.a $(EXTERNAL_LIBS) unit_tester_CPPFLAGS = -DBUILD_UNIT_TESTS $(EXTERNAL_CPPFLAGS) unit_tester_CXXFLAGS = $(PCH_FLAGS) -unit_tester_LDADD += libplatform.a lib3rdparty.a $(EXTERNAL_LIBS) +unit_tester_LDADD += libplatform.a $(EXTERNAL_LIBS) tester_CPPFLAGS = $(EXTERNAL_CPPFLAGS) -tester_LDADD += libplatform.a lib3rdparty.a $(EXTERNAL_LIBS) +tester_LDADD += libplatform.a $(EXTERNAL_LIBS) if WIN32_PLATFORM libplatform_a_SOURCES += $(WIN32_PLATFORM_SOURCES) mtn_SOURCES += win32/main.cc mtn_LDADD += -lshfolder -lws2_32 -lintl -liconv -liphlpapi unit_tester_LDADD += -lshfolder -lws2_32 -lintl -liconv -liphlpapi - lib3rdparty_a_CPPFLAGS += -DWIN32 tester_SOURCES += win32/tester-plaf.cc - check_net_SOURCES = win32/tester-check-net.cc else libplatform_a_SOURCES += $(UNIX_PLATFORM_SOURCES) mtn_SOURCES += unix/main.cc tester_SOURCES += unix/tester-plaf.cc - check_net_SOURCES = unix/tester-check-net.cc endif -if MISSING_INET_PTON - lib3rdparty_a_SOURCES += netxx/inet_pton.cxx netxx/inet_pton.h - lib3rdparty_a_CPPFLAGS += -DNETXX_NO_PTON -endif - -if MISSING_INET_NTOP - lib3rdparty_a_SOURCES += netxx/inet_ntop.cxx netxx/inet_ntop.h - lib3rdparty_a_CPPFLAGS += -DNETXX_NO_NTOP -endif - -if MISSING_GETADDRINFO - lib3rdparty_a_SOURCES += netxx/resolve_gethostbyname.cxx netxx/resolve_getservbyname.cxx -else - lib3rdparty_a_SOURCES += netxx/resolve_getaddrinfo.cxx -endif - -if MISSING_INET6 - lib3rdparty_a_CPPFLAGS += -DNETXX_NO_INET6 -endif - # extra files PDF_FIGURES= figures/branch-heads.pdf figures/cert.pdf \ @@ -511,8 +469,8 @@ unit_tests.status : unit_tester$(EXEEXT) +./run_$*_tests unit_tests.status : unit_tester$(EXEEXT) -lua_tests.status : mtn$(EXEEXT) check_net$(EXEEXT) -check_PROGRAMS = unit_tester tester check_net +lua_tests.status : mtn$(EXEEXT) +check_PROGRAMS = unit_tester tester # We want the tests re-run even if the .status files already exist. # .PHONY does not work for that (bad interaction with pattern rules), ============================================================ --- configure.ac 46e0901df78937b2d44c1c0a356136f946d8954f +++ configure.ac 72769799de86a8b8ce4d33e4950cb5a3d9e7761c @@ -77,14 +77,15 @@ BOOST_VERSION_SPECIFIC_BUGS BOOST_VERSION_CHECK BOOST_VERSION_SPECIFIC_BUGS +ASIO_VERSION_CHECK +ASIO_VERSION_SPECIFIC_BUGS + MTN_FIND_BOTAN MTN_FIND_IDNA MTN_FIND_LUA MTN_FIND_PCRE MTN_FIND_SQLITE -MTN_NETXX_DEPENDENCIES - # Checks for header files. dnl It's hard these days to get AC_CHECK_HEADERS to check for just one dnl header which should compile fine with no dependencies. @@ -92,7 +93,7 @@ dnl (A line with nothing but a # on it i dnl pointless nowadays. This is the best thing I can come up with. dnl (A line with nothing but a # on it is ignored by the preprocessor.) -AC_CHECK_HEADERS([cxxabi.h fcntl.h netinet/in.h],,, [#]) +AC_CHECK_HEADERS([cxxabi.h],,, [#]) # check for language features and compiler bugs AC_CXX_TYPEOF ============================================================ --- lua-testsuite.lua 60452657c3ea7dd8fd21e69928e739c666f90837 +++ lua-testsuite.lua 5d69d9a2daa50397a20ad19be2a9cf7598df41aa @@ -358,35 +358,14 @@ function prepare_to_run_tests (P) end unlogged_remove(d) - -- Several tests require the ability to run a network server on - -- the loopback interface, and connect to it from another process - -- on this computer. Unlike the above, we just skip those tests - -- (loudly) if we can't do that. Verifying that this is possible - -- requires a helper program. + -- Several tests require the ability to run a network server on the + -- loopback interface, and connect to it from another process on + -- this computer. Some environments don't permit that. Provide a + -- mechanism to skip those tests if necessary. - local checknet = getpathof("check_net") if os.getenv("DISABLE_NETWORK_TESTS") ~= nil then P("warning: DISABLE_NETWORK_TESTS set, skipping network server tests\n") no_network_tests = true - elseif checknet == nil then - P("warning: check_net helper is missing, skipping network server tests\n") - no_network_tests = true - else - writefile_q("in", nil) - prepare_redirect("in", "out", "err") - local status = execute(checknet) - local out = readfile_q("out") - local err = readfile_q("err") - - if status == 0 and err == "" and out == "" then - logfile:write("check_net: Can use the loopback interface.\n") - else - logfile:write(string.format("check_net: failed with status %d\n".. - "stdout:\n%s\nstderr:\n%s\n", - status, out, err)) - P("warning: network unavailable, skipping network server tests\n") - no_network_tests = true - end end -- Record the full version of monotone under test in the logfile. ============================================================ --- rcs_file.cc ed67c5671b3697e609331ad14f952cfffde85d1f +++ rcs_file.cc 2b487020c2cc6888990ca22ca143d3d13028bf11 @@ -9,10 +9,9 @@ #include "base.hh" -#include -#include "vector.hh" #ifdef WIN32 +#define WIN32_LEAN_AND_MEAN #include #endif @@ -26,11 +25,10 @@ #include #include #include - -#ifdef HAVE_FCNTL_H #include -#endif +#include +#include "vector.hh" #include "rcs_file.hh" #include "sanity.hh" #include "char_classifiers.hh"