From 99462f508d48c5184937e042025870379ef637d3 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Mon, 3 Aug 2026 22:17:47 -0600 Subject: [PATCH 1/2] lib: monkey: upgrade to v1.8.9 Signed-off-by: Eduardo Silva --- lib/monkey/.github/workflows/build-pr.yaml | 81 +- lib/monkey/.gitignore | 1 + lib/monkey/AGENTS.md | 184 + lib/monkey/CMakeLists.txt | 40 +- lib/monkey/CONTRIBUTING.md | 20 +- lib/monkey/README.md | 166 +- lib/monkey/htdocs/index.html | 22 +- lib/monkey/include/monkey/mk_config.h | 5 + lib/monkey/include/monkey/mk_core/mk_list.h | 2 +- lib/monkey/include/monkey/mk_core/mk_rconf.h | 2 +- lib/monkey/include/monkey/mk_core/mk_string.h | 1 + .../monkey/mk_core/mk_win32_socketpair.h | 30 + lib/monkey/include/monkey/mk_http.h | 2 +- lib/monkey/include/monkey/mk_http_parser.h | 6 +- lib/monkey/include/monkey/mk_net.h | 4 + lib/monkey/include/monkey/mk_plugin_net.h | 1 + lib/monkey/include/monkey/mk_server.h | 3 +- lib/monkey/include/monkey/mk_tls_transport.h | 15 + lib/monkey/integration_tests/conftest.py | 18 + lib/monkey/integration_tests/pytest.ini | 7 + lib/monkey/integration_tests/requirements.txt | 1 + lib/monkey/integration_tests/run_tests.py | 103 + lib/monkey/integration_tests/src/__init__.py | 1 + .../integration_tests/src/monkey_manager.py | 338 + .../tests/test_network_layer.py | 655 + lib/monkey/mk_bin/monkey.c | 165 +- lib/monkey/mk_core/CMakeLists.txt | 20 + .../mk_core/deps/libevent/.clang-format | 63 - lib/monkey/mk_core/deps/libevent/.gitignore | 149 - lib/monkey/mk_core/deps/libevent/.travis.yml | 88 - lib/monkey/mk_core/deps/libevent/.uncrustify | 55 - .../mk_core/deps/libevent/CMakeLists.txt | 1551 +- .../mk_core/deps/libevent/CONTRIBUTING.md | 35 - lib/monkey/mk_core/deps/libevent/ChangeLog | 2188 +- .../mk_core/deps/libevent/ChangeLog-1.4 | 6 +- .../mk_core/deps/libevent/ChangeLog-2.0 | 10 +- .../mk_core/deps/libevent/ChangeLog-2.1 | 2162 ++ .../deps/libevent/Documentation/Building.md | 229 + lib/monkey/mk_core/deps/libevent/Doxyfile | 52 +- lib/monkey/mk_core/deps/libevent/LICENSE | 52 + lib/monkey/mk_core/deps/libevent/Makefile.am | 114 +- lib/monkey/mk_core/deps/libevent/Makefile.in | 3666 +++ .../mk_core/deps/libevent/Makefile.nmake | 82 - .../deps/libevent/PrivacyInfo.xcprivacy | 23 + lib/monkey/mk_core/deps/libevent/README.md | 417 +- lib/monkey/mk_core/deps/libevent/VERSION | 5 - lib/monkey/mk_core/deps/libevent/Vagrantfile | 400 - .../deps/libevent/WIN32-Code/getopt_long.c | 7 +- .../WIN32-Code/nmake/evconfig-private.h | 6 - .../WIN32-Code/nmake/event2/event-config.h | 360 - lib/monkey/mk_core/deps/libevent/aclocal.m4 | 1680 + lib/monkey/mk_core/deps/libevent/appveyor.yml | 59 - lib/monkey/mk_core/deps/libevent/arc4random.c | 106 +- lib/monkey/mk_core/deps/libevent/autogen.sh | 2 +- lib/monkey/mk_core/deps/libevent/buffer.c | 289 +- .../mk_core/deps/libevent/buffer_iocp.c | 3 +- .../deps/libevent/bufferevent-internal.h | 59 +- .../mk_core/deps/libevent/bufferevent.c | 150 +- .../mk_core/deps/libevent/bufferevent_async.c | 66 +- .../deps/libevent/bufferevent_filter.c | 17 +- .../deps/libevent/bufferevent_mbedtls.c | 423 + .../deps/libevent/bufferevent_openssl.c | 1222 +- .../mk_core/deps/libevent/bufferevent_pair.c | 11 +- .../deps/libevent/bufferevent_ratelim.c | 39 +- .../mk_core/deps/libevent/bufferevent_sock.c | 132 +- .../mk_core/deps/libevent/bufferevent_ssl.c | 1186 + .../mk_core/deps/libevent/build-aux/compile | 364 + .../deps/libevent/build-aux/config.guess | 1815 ++ .../deps/libevent/build-aux/config.sub | 2354 ++ .../mk_core/deps/libevent/build-aux/depcomp | 792 + .../deps/libevent/build-aux/install-sh | 541 + .../mk_core/deps/libevent/build-aux/ltmain.sh | 11517 +++++++ .../mk_core/deps/libevent/build-aux/missing | 236 + .../deps/libevent/build-aux/test-driver | 160 + .../mk_core/deps/libevent/checkpatch.sh | 299 - .../deps/libevent/cmake/AddEventLibrary.cmake | 181 + .../deps/libevent/cmake/AddLinkerFlags.cmake | 17 + .../libevent/cmake/CheckConstExists.cmake | 25 + .../libevent/cmake/CheckFileOffsetBits.cmake | 2 +- .../libevent/cmake/CheckFunctionExistsEx.c | 30 - .../cmake/CheckFunctionExistsEx.cmake | 69 - .../cmake/CheckWaitpidSupportWNOWAIT.cmake | 18 - .../libevent/cmake/CheckWorkingKqueue.cmake | 8 +- .../deps/libevent/cmake/CodeCoverage.cmake | 13 +- .../mk_core/deps/libevent/cmake/FindGit.cmake | 45 - .../deps/libevent/cmake/FindMbedTLS.cmake | 176 + .../libevent/cmake/LibeventConfig.cmake.in | 154 +- .../cmake/LibeventConfigBuildTree.cmake.in | 17 - .../mk_core/deps/libevent/cmake/Macros.cmake | 36 + .../deps/libevent/cmake/Uninstall.cmake.in | 23 + .../deps/libevent/cmake/UseDoxygen.cmake | 118 + .../deps/libevent/cmake/VersionViaGit.cmake | 4 +- .../mk_core/deps/libevent/compat/sys/tree.h | 677 + lib/monkey/mk_core/deps/libevent/config.h.in | 665 + lib/monkey/mk_core/deps/libevent/configure | 25774 ++++++++++++++++ lib/monkey/mk_core/deps/libevent/configure.ac | 822 +- .../mk_core/deps/libevent/defer-internal.h | 3 + lib/monkey/mk_core/deps/libevent/doxygen.am | 80 + lib/monkey/mk_core/deps/libevent/epoll.c | 110 +- .../deps/libevent/epolltable-internal.h | 2 +- .../mk_core/deps/libevent/evbuffer-internal.h | 4 +- .../deps/libevent/evconfig-private.h.cmake | 5 + .../deps/libevent/evconfig-private.h.in | 7 + .../mk_core/deps/libevent/evdns-internal.h | 22 + lib/monkey/mk_core/deps/libevent/evdns.3 | 322 - lib/monkey/mk_core/deps/libevent/evdns.c | 1723 +- .../deps/libevent/event-config.h.cmake | 397 +- .../mk_core/deps/libevent/event-internal.h | 62 +- lib/monkey/mk_core/deps/libevent/event.3 | 624 - lib/monkey/mk_core/deps/libevent/event.c | 671 +- lib/monkey/mk_core/deps/libevent/event_iocp.c | 6 +- .../mk_core/deps/libevent/event_rpcgen.py | 2063 +- .../mk_core/deps/libevent/event_tagging.c | 11 +- lib/monkey/mk_core/deps/libevent/evmap.c | 52 +- .../mk_core/deps/libevent/evrpc-internal.h | 6 +- lib/monkey/mk_core/deps/libevent/evrpc.c | 69 +- .../mk_core/deps/libevent/evsignal-internal.h | 13 + .../mk_core/deps/libevent/evthread-internal.h | 20 +- lib/monkey/mk_core/deps/libevent/evthread.c | 15 +- .../mk_core/deps/libevent/evthread_pthread.c | 46 +- .../mk_core/deps/libevent/evthread_win32.c | 11 +- lib/monkey/mk_core/deps/libevent/evutil.c | 933 +- .../mk_core/deps/libevent/evutil_rand.c | 12 +- .../mk_core/deps/libevent/evutil_time.c | 88 +- .../mk_core/deps/libevent/ht-internal.h | 4 +- .../mk_core/deps/libevent/http-internal.h | 75 +- lib/monkey/mk_core/deps/libevent/http.c | 1657 +- .../mk_core/deps/libevent/include/event.h | 2 +- .../deps/libevent/include/event2/buffer.h | 78 +- .../libevent/include/event2/buffer_compat.h | 6 +- .../libevent/include/event2/bufferevent.h | 80 +- .../include/event2/bufferevent_compat.h | 16 +- .../libevent/include/event2/bufferevent_ssl.h | 181 +- .../include/event2/bufferevent_struct.h | 2 +- .../deps/libevent/include/event2/dns.h | 262 +- .../deps/libevent/include/event2/dns_compat.h | 26 +- .../deps/libevent/include/event2/event.h | 176 +- .../libevent/include/event2/event_compat.h | 2 +- .../libevent/include/event2/event_struct.h | 8 +- .../deps/libevent/include/event2/http.h | 381 +- .../libevent/include/event2/http_compat.h | 8 +- .../libevent/include/event2/http_struct.h | 12 +- .../deps/libevent/include/event2/listener.h | 38 +- .../deps/libevent/include/event2/rpc.h | 61 +- .../deps/libevent/include/event2/rpc_compat.h | 2 +- .../deps/libevent/include/event2/rpc_struct.h | 14 + .../deps/libevent/include/event2/tag.h | 4 +- .../deps/libevent/include/event2/tag_compat.h | 2 +- .../deps/libevent/include/event2/thread.h | 25 +- .../deps/libevent/include/event2/util.h | 137 +- .../deps/libevent/include/event2/visibility.h | 32 +- .../deps/libevent/include/event2/watch.h | 136 + .../mk_core/deps/libevent/include/event2/ws.h | 74 + .../mk_core/deps/libevent/include/include.am | 13 +- .../mk_core/deps/libevent/iocp-internal.h | 14 + .../mk_core/deps/libevent/kqueue-internal.h | 2 +- lib/monkey/mk_core/deps/libevent/kqueue.c | 155 +- .../mk_core/deps/libevent/libevent.pc.in | 2 +- .../mk_core/deps/libevent/libevent_core.pc.in | 5 +- .../deps/libevent/libevent_extra.pc.in | 6 +- .../deps/libevent/libevent_mbedtls.pc.in | 14 + .../deps/libevent/libevent_openssl.pc.in | 11 +- .../deps/libevent/libevent_pthreads.pc.in | 10 +- lib/monkey/mk_core/deps/libevent/listener.c | 102 +- .../mk_core/deps/libevent/log-internal.h | 25 +- lib/monkey/mk_core/deps/libevent/log.c | 11 +- .../mk_core/deps/libevent/m4/acx_pthread.m4 | 279 - .../deps/libevent/m4/ax_check_compile_flag.m4 | 53 + .../deps/libevent/m4/ax_check_funcs_ex.m4 | 22 + .../deps/libevent/m4/ax_prog_doxygen.m4 | 601 + .../mk_core/deps/libevent/m4/ax_pthread.m4 | 522 + .../deps/libevent/m4/libevent_mbedtls.m4 | 40 + .../deps/libevent/m4/libevent_openssl.m4 | 64 +- .../mk_core/deps/libevent/m4/libtool.m4 | 8491 +++++ .../mk_core/deps/libevent/m4/ltoptions.m4 | 467 + .../mk_core/deps/libevent/m4/ltsugar.m4 | 124 + .../mk_core/deps/libevent/m4/ltversion.m4 | 24 + .../mk_core/deps/libevent/m4/lt~obsolete.m4 | 99 + .../deps/libevent/m4/ntp_pkg_config.m4 | 27 - .../deps/libevent/make-event-config.sed | 10 +- .../mk_core/deps/libevent/make_epoll_table.py | 63 - .../mk_core/deps/libevent/mbedtls-compat.h | 34 + .../mk_core/deps/libevent/minheap-internal.h | 48 +- .../mk_core/deps/libevent/mm-internal.h | 6 + .../mk_core/deps/libevent/openssl-compat.h | 17 +- lib/monkey/mk_core/deps/libevent/poll.c | 28 +- .../mk_core/deps/libevent/sample/becat.c | 675 + .../deps/libevent/sample/dns-example.c | 34 +- .../deps/libevent/sample/event-read-fifo.c | 41 +- .../deps/libevent/sample/hello-world.c | 5 +- .../deps/libevent/sample/http-connect.c | 87 +- .../deps/libevent/sample/http-server.c | 310 +- .../deps/libevent/sample/https-client.c | 248 +- .../mk_core/deps/libevent/sample/include.am | 37 +- .../mk_core/deps/libevent/sample/le-proxy.c | 32 +- .../sample/openssl_hostname_validation.c | 3 +- .../deps/libevent/sample/signal-test.c | 25 +- .../deps/libevent/sample/ssl-client-mbedtls.c | 316 + .../mk_core/deps/libevent/sample/time-test.c | 48 +- .../deps/libevent/sample/watch-timing.c | 359 + .../deps/libevent/sample/ws-chat-server.c | 265 + .../mk_core/deps/libevent/sample/ws-chat.html | 102 + lib/monkey/mk_core/deps/libevent/select.c | 5 +- lib/monkey/mk_core/deps/libevent/sha1.c | 301 + lib/monkey/mk_core/deps/libevent/sha1.h | 14 + lib/monkey/mk_core/deps/libevent/signal.c | 67 +- lib/monkey/mk_core/deps/libevent/signalfd.c | 214 + lib/monkey/mk_core/deps/libevent/ssl-compat.h | 101 + .../mk_core/deps/libevent/strlcpy-internal.h | 2 + lib/monkey/mk_core/deps/libevent/strlcpy.c | 6 +- .../mk_core/deps/libevent/test/Makefile.nmake | 79 - lib/monkey/mk_core/deps/libevent/test/bench.c | 62 +- .../deps/libevent/test/bench_cascade.c | 8 +- .../mk_core/deps/libevent/test/bench_http.c | 3 + .../deps/libevent/test/bench_httpclient.c | 16 +- .../deps/libevent/test/check-dumpevents.py | 10 +- .../mk_core/deps/libevent/test/include.am | 87 +- .../mk_core/deps/libevent/test/regress.c | 672 +- .../mk_core/deps/libevent/test/regress.gen.c | 1218 + .../mk_core/deps/libevent/test/regress.gen.h | 208 + .../mk_core/deps/libevent/test/regress.h | 21 +- .../deps/libevent/test/regress_buffer.c | 567 +- .../deps/libevent/test/regress_bufferevent.c | 281 +- .../mk_core/deps/libevent/test/regress_dns.c | 1560 +- .../mk_core/deps/libevent/test/regress_et.c | 148 +- .../deps/libevent/test/regress_finalize.c | 50 + .../mk_core/deps/libevent/test/regress_http.c | 2278 +- .../mk_core/deps/libevent/test/regress_http.h | 11 + .../deps/libevent/test/regress_listener.c | 373 +- .../mk_core/deps/libevent/test/regress_main.c | 144 +- .../deps/libevent/test/regress_mbedtls.c | 383 + .../deps/libevent/test/regress_openssl.c | 331 + .../mk_core/deps/libevent/test/regress_rpc.c | 51 +- .../mk_core/deps/libevent/test/regress_ssl.c | 659 +- .../deps/libevent/test/regress_testutils.c | 231 +- .../deps/libevent/test/regress_testutils.h | 22 +- .../deps/libevent/test/regress_thread.c | 51 +- .../deps/libevent/test/regress_thread.h | 35 +- .../libevent/test/regress_timer_timeout.c | 127 + .../mk_core/deps/libevent/test/regress_util.c | 460 +- .../deps/libevent/test/regress_watch.c | 243 + .../mk_core/deps/libevent/test/regress_ws.c | 683 + .../mk_core/deps/libevent/test/regress_ws.h | 9 + .../mk_core/deps/libevent/test/regress_zlib.c | 15 +- .../deps/libevent/test/rpcgen_wrapper.sh | 11 +- .../deps/libevent/test/test-changelist.c | 33 +- .../mk_core/deps/libevent/test/test-closed.c | 33 +- .../mk_core/deps/libevent/test/test-eof.c | 4 +- .../mk_core/deps/libevent/test/test-fdleak.c | 17 +- .../mk_core/deps/libevent/test/test-init.c | 2 +- .../deps/libevent/test/test-kq-collision.c | 204 + .../mk_core/deps/libevent/test/test-ratelim.c | 89 +- .../deps/libevent/test/test-ratelim.sh | 88 - .../mk_core/deps/libevent/test/test-time.c | 37 +- .../mk_core/deps/libevent/test/test-weof.c | 4 +- lib/monkey/mk_core/deps/libevent/test/test.sh | 100 +- .../mk_core/deps/libevent/test/tinytest.c | 875 +- .../mk_core/deps/libevent/test/tinytest.h | 7 +- .../deps/libevent/test/tinytest_demo.c | 262 - .../deps/libevent/test/tinytest_macros.h | 12 +- .../mk_core/deps/libevent/time-internal.h | 3 + .../mk_core/deps/libevent/util-internal.h | 110 +- lib/monkey/mk_core/deps/libevent/watch.c | 82 + lib/monkey/mk_core/deps/libevent/wepoll.c | 2218 ++ lib/monkey/mk_core/deps/libevent/wepoll.h | 111 + .../mk_core/deps/libevent/whatsnew-2.0.txt | 2 +- .../mk_core/deps/libevent/whatsnew-2.1.txt | 96 +- .../mk_core/deps/libevent/win32select.c | 3 +- lib/monkey/mk_core/deps/libevent/ws.c | 546 + lib/monkey/mk_core/mk_event_libevent.c | 48 +- lib/monkey/mk_core/mk_memory.c | 10 + lib/monkey/mk_core/mk_string.c | 70 + lib/monkey/mk_core/mk_win32_socketpair.c | 276 + lib/monkey/mk_server/CMakeLists.txt | 8 + lib/monkey/mk_server/mk_config.c | 61 +- lib/monkey/mk_server/mk_fifo.c | 24 +- lib/monkey/mk_server/mk_http.c | 70 +- lib/monkey/mk_server/mk_http_parser.c | 122 +- lib/monkey/mk_server/mk_lib.c | 2 + lib/monkey/mk_server/mk_mimetype.c | 7 +- lib/monkey/mk_server/mk_net.c | 157 +- lib/monkey/mk_server/mk_scheduler.c | 68 +- lib/monkey/mk_server/mk_server.c | 21 +- lib/monkey/mk_server/mk_stream.c | 5 +- lib/monkey/mk_server/mk_user.c | 2 +- lib/monkey/mk_server/monkey.c | 19 + lib/monkey/plugins/CMakeLists.txt | 14 +- lib/monkey/plugins/dirlisting/dirlisting.c | 27 +- lib/monkey/plugins/dirlisting/dirlisting.h | 1 + lib/monkey/plugins/tls/CMakeLists.txt | 19 +- lib/monkey/plugins/tls/tls_openssl.c | 605 + lib/monkey/test/CMakeLists.txt | 7 + lib/monkey/test/event_timeout.c | 70 +- lib/monkey/test/lib_server.c | 19 + lib/monkey/test/win32_socketpair.c | 49 + lib/monkey/tls/CMakeLists.txt | 106 + lib/monkey/tls/tls.conf | 25 + lib/monkey/tls/tls_mbedtls.c | 991 + lib/monkey/tls/tls_openssl.c | 872 + lib/monkey/tls/tls_stub.c | 29 + 300 files changed, 98515 insertions(+), 12907 deletions(-) create mode 100644 lib/monkey/AGENTS.md create mode 100644 lib/monkey/include/monkey/mk_core/mk_win32_socketpair.h create mode 100644 lib/monkey/include/monkey/mk_tls_transport.h create mode 100644 lib/monkey/integration_tests/conftest.py create mode 100644 lib/monkey/integration_tests/pytest.ini create mode 100644 lib/monkey/integration_tests/requirements.txt create mode 100644 lib/monkey/integration_tests/run_tests.py create mode 100644 lib/monkey/integration_tests/src/__init__.py create mode 100644 lib/monkey/integration_tests/src/monkey_manager.py create mode 100644 lib/monkey/integration_tests/tests/test_network_layer.py delete mode 100644 lib/monkey/mk_core/deps/libevent/.clang-format delete mode 100644 lib/monkey/mk_core/deps/libevent/.gitignore delete mode 100644 lib/monkey/mk_core/deps/libevent/.travis.yml delete mode 100644 lib/monkey/mk_core/deps/libevent/.uncrustify delete mode 100644 lib/monkey/mk_core/deps/libevent/CONTRIBUTING.md create mode 100644 lib/monkey/mk_core/deps/libevent/ChangeLog-2.1 create mode 100644 lib/monkey/mk_core/deps/libevent/Documentation/Building.md create mode 100644 lib/monkey/mk_core/deps/libevent/Makefile.in delete mode 100644 lib/monkey/mk_core/deps/libevent/Makefile.nmake create mode 100644 lib/monkey/mk_core/deps/libevent/PrivacyInfo.xcprivacy delete mode 100644 lib/monkey/mk_core/deps/libevent/VERSION delete mode 100644 lib/monkey/mk_core/deps/libevent/Vagrantfile delete mode 100644 lib/monkey/mk_core/deps/libevent/WIN32-Code/nmake/evconfig-private.h delete mode 100644 lib/monkey/mk_core/deps/libevent/WIN32-Code/nmake/event2/event-config.h create mode 100644 lib/monkey/mk_core/deps/libevent/aclocal.m4 delete mode 100644 lib/monkey/mk_core/deps/libevent/appveyor.yml create mode 100644 lib/monkey/mk_core/deps/libevent/bufferevent_mbedtls.c create mode 100644 lib/monkey/mk_core/deps/libevent/bufferevent_ssl.c create mode 100755 lib/monkey/mk_core/deps/libevent/build-aux/compile create mode 100755 lib/monkey/mk_core/deps/libevent/build-aux/config.guess create mode 100755 lib/monkey/mk_core/deps/libevent/build-aux/config.sub create mode 100755 lib/monkey/mk_core/deps/libevent/build-aux/depcomp create mode 100755 lib/monkey/mk_core/deps/libevent/build-aux/install-sh create mode 100644 lib/monkey/mk_core/deps/libevent/build-aux/ltmain.sh create mode 100755 lib/monkey/mk_core/deps/libevent/build-aux/missing create mode 100755 lib/monkey/mk_core/deps/libevent/build-aux/test-driver delete mode 100755 lib/monkey/mk_core/deps/libevent/checkpatch.sh create mode 100644 lib/monkey/mk_core/deps/libevent/cmake/AddEventLibrary.cmake create mode 100644 lib/monkey/mk_core/deps/libevent/cmake/AddLinkerFlags.cmake create mode 100644 lib/monkey/mk_core/deps/libevent/cmake/CheckConstExists.cmake delete mode 100644 lib/monkey/mk_core/deps/libevent/cmake/CheckFunctionExistsEx.c delete mode 100644 lib/monkey/mk_core/deps/libevent/cmake/CheckFunctionExistsEx.cmake delete mode 100644 lib/monkey/mk_core/deps/libevent/cmake/CheckWaitpidSupportWNOWAIT.cmake delete mode 100644 lib/monkey/mk_core/deps/libevent/cmake/FindGit.cmake create mode 100644 lib/monkey/mk_core/deps/libevent/cmake/FindMbedTLS.cmake delete mode 100644 lib/monkey/mk_core/deps/libevent/cmake/LibeventConfigBuildTree.cmake.in create mode 100644 lib/monkey/mk_core/deps/libevent/cmake/Macros.cmake create mode 100644 lib/monkey/mk_core/deps/libevent/cmake/Uninstall.cmake.in create mode 100644 lib/monkey/mk_core/deps/libevent/cmake/UseDoxygen.cmake create mode 100644 lib/monkey/mk_core/deps/libevent/compat/sys/tree.h create mode 100644 lib/monkey/mk_core/deps/libevent/config.h.in create mode 100755 lib/monkey/mk_core/deps/libevent/configure create mode 100644 lib/monkey/mk_core/deps/libevent/doxygen.am create mode 100644 lib/monkey/mk_core/deps/libevent/evdns-internal.h delete mode 100644 lib/monkey/mk_core/deps/libevent/evdns.3 delete mode 100644 lib/monkey/mk_core/deps/libevent/event.3 create mode 100644 lib/monkey/mk_core/deps/libevent/include/event2/watch.h create mode 100644 lib/monkey/mk_core/deps/libevent/include/event2/ws.h create mode 100644 lib/monkey/mk_core/deps/libevent/libevent_mbedtls.pc.in delete mode 100644 lib/monkey/mk_core/deps/libevent/m4/acx_pthread.m4 create mode 100644 lib/monkey/mk_core/deps/libevent/m4/ax_check_compile_flag.m4 create mode 100644 lib/monkey/mk_core/deps/libevent/m4/ax_check_funcs_ex.m4 create mode 100644 lib/monkey/mk_core/deps/libevent/m4/ax_prog_doxygen.m4 create mode 100644 lib/monkey/mk_core/deps/libevent/m4/ax_pthread.m4 create mode 100644 lib/monkey/mk_core/deps/libevent/m4/libevent_mbedtls.m4 create mode 100644 lib/monkey/mk_core/deps/libevent/m4/libtool.m4 create mode 100644 lib/monkey/mk_core/deps/libevent/m4/ltoptions.m4 create mode 100644 lib/monkey/mk_core/deps/libevent/m4/ltsugar.m4 create mode 100644 lib/monkey/mk_core/deps/libevent/m4/ltversion.m4 create mode 100644 lib/monkey/mk_core/deps/libevent/m4/lt~obsolete.m4 delete mode 100644 lib/monkey/mk_core/deps/libevent/m4/ntp_pkg_config.m4 delete mode 100755 lib/monkey/mk_core/deps/libevent/make_epoll_table.py create mode 100644 lib/monkey/mk_core/deps/libevent/mbedtls-compat.h create mode 100644 lib/monkey/mk_core/deps/libevent/sample/becat.c create mode 100644 lib/monkey/mk_core/deps/libevent/sample/ssl-client-mbedtls.c create mode 100644 lib/monkey/mk_core/deps/libevent/sample/watch-timing.c create mode 100644 lib/monkey/mk_core/deps/libevent/sample/ws-chat-server.c create mode 100644 lib/monkey/mk_core/deps/libevent/sample/ws-chat.html create mode 100644 lib/monkey/mk_core/deps/libevent/sha1.c create mode 100644 lib/monkey/mk_core/deps/libevent/sha1.h create mode 100644 lib/monkey/mk_core/deps/libevent/signalfd.c create mode 100644 lib/monkey/mk_core/deps/libevent/ssl-compat.h delete mode 100644 lib/monkey/mk_core/deps/libevent/test/Makefile.nmake create mode 100644 lib/monkey/mk_core/deps/libevent/test/regress.gen.c create mode 100644 lib/monkey/mk_core/deps/libevent/test/regress.gen.h create mode 100644 lib/monkey/mk_core/deps/libevent/test/regress_http.h create mode 100644 lib/monkey/mk_core/deps/libevent/test/regress_mbedtls.c create mode 100644 lib/monkey/mk_core/deps/libevent/test/regress_openssl.c create mode 100644 lib/monkey/mk_core/deps/libevent/test/regress_timer_timeout.c create mode 100644 lib/monkey/mk_core/deps/libevent/test/regress_watch.c create mode 100644 lib/monkey/mk_core/deps/libevent/test/regress_ws.c create mode 100644 lib/monkey/mk_core/deps/libevent/test/regress_ws.h create mode 100644 lib/monkey/mk_core/deps/libevent/test/test-kq-collision.c delete mode 100755 lib/monkey/mk_core/deps/libevent/test/test-ratelim.sh delete mode 100644 lib/monkey/mk_core/deps/libevent/test/tinytest_demo.c create mode 100644 lib/monkey/mk_core/deps/libevent/watch.c create mode 100644 lib/monkey/mk_core/deps/libevent/wepoll.c create mode 100644 lib/monkey/mk_core/deps/libevent/wepoll.h create mode 100644 lib/monkey/mk_core/deps/libevent/ws.c create mode 100644 lib/monkey/mk_core/mk_win32_socketpair.c create mode 100644 lib/monkey/plugins/tls/tls_openssl.c create mode 100644 lib/monkey/test/win32_socketpair.c create mode 100644 lib/monkey/tls/CMakeLists.txt create mode 100644 lib/monkey/tls/tls.conf create mode 100644 lib/monkey/tls/tls_mbedtls.c create mode 100644 lib/monkey/tls/tls_openssl.c create mode 100644 lib/monkey/tls/tls_stub.c diff --git a/lib/monkey/.github/workflows/build-pr.yaml b/lib/monkey/.github/workflows/build-pr.yaml index 2898d7eecae..121aff7fa35 100644 --- a/lib/monkey/.github/workflows/build-pr.yaml +++ b/lib/monkey/.github/workflows/build-pr.yaml @@ -20,10 +20,12 @@ jobs: arch: x64 cmake_additional_opt: "" os: windows-latest + cmake_version: "3.31.6" - name: "Windows 64bit (ARM)" arch: amd64_arm64 - cmake_additional_opt: "-G \"NMake Makefiles\" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_SYSTEM_PROCESSOR=ARM64" + cmake_additional_opt: "-G \"NMake Makefiles\" -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_SYSTEM_PROCESSOR=ARM64 -DMK_TLS_BACKEND=mbedtls" os: windows-latest + cmake_version: "3.31.6" steps: - name: Checkout repository uses: actions/checkout@v3 @@ -35,6 +37,83 @@ jobs: with: arch: ${{ matrix.config.arch }} + - name: Set up CMake + run: | + $cmakeVersion = "${{ matrix.config.cmake_version }}" + $cmakeArch = "x86_64" + $cmakeUrl = "https://github.com/Kitware/CMake/releases/download/v${cmakeVersion}/cmake-${cmakeVersion}-windows-${cmakeArch}.zip" + $cmakeZip = "$env:RUNNER_TEMP\cmake-${cmakeVersion}.zip" + $cmakeDir = "C:\Program Files\CMake" + + Write-Host "Downloading CMake ${cmakeVersion} from official GitHub releases: ${cmakeUrl}" + + # Download with retry logic + $maxRetries = 3 + $retryCount = 0 + $downloaded = $false + + while ($retryCount -lt $maxRetries -and -not $downloaded) { + try { + $retryCount++ + Write-Host "Attempt $retryCount of $maxRetries" + Invoke-WebRequest -Uri $cmakeUrl -OutFile $cmakeZip -UseBasicParsing -ErrorAction Stop + + # Verify file was downloaded and has content + if (Test-Path $cmakeZip) { + $fileInfo = Get-Item $cmakeZip + if ($fileInfo.Length -gt 0) { + Write-Host "Download successful. File size: $($fileInfo.Length) bytes" + $downloaded = $true + } else { + Write-Host "Downloaded file is empty, retrying..." + Remove-Item $cmakeZip -Force -ErrorAction SilentlyContinue + } + } + } catch { + Write-Host "Download attempt $retryCount failed: $_" + if ($retryCount -lt $maxRetries) { + Start-Sleep -Seconds 2 + Remove-Item $cmakeZip -Force -ErrorAction SilentlyContinue + } else { + throw "Failed to download CMake after $maxRetries attempts: $_" + } + } + } + + # Verify it's a valid ZIP file by checking the header (ZIP files start with PK) + $header = [System.IO.File]::ReadAllBytes($cmakeZip)[0..1] + if (-not ($header[0] -eq 0x50 -and $header[1] -eq 0x4B)) { + Write-Host "Warning: File may not be a valid ZIP. First bytes: $($header[0]), $($header[1])" + Write-Host "Expected: 80, 75 (PK in hex)" + throw "Downloaded file is not a valid ZIP archive" + } + Write-Host "ZIP file validation passed (PK header found)" + + Write-Host "Extracting CMake to C:\Program Files" + # Remove existing CMake directory if it exists + if (Test-Path $cmakeDir) { + Remove-Item $cmakeDir -Recurse -Force + } + + # Extract ZIP file + Expand-Archive -Path $cmakeZip -DestinationPath "C:\Program Files" -Force + + # Rename extracted folder to standard CMake directory name + $extractedDir = "C:\Program Files\cmake-${cmakeVersion}-windows-${cmakeArch}" + if (Test-Path $extractedDir) { + Rename-Item -Path $extractedDir -NewName "CMake" -Force + } + + # Verify installation + $cmakeExe = "$cmakeDir\bin\cmake.exe" + if (Test-Path $cmakeExe) { + Write-Host "CMake installed successfully" + & $cmakeExe --version + } else { + throw "CMake installation verification failed: $cmakeExe not found" + } + shell: pwsh + - name: Build on ${{ matrix.os }} with vs-2019 run: | mkdir build diff --git a/lib/monkey/.gitignore b/lib/monkey/.gitignore index 6708c67e177..931b68e5f4b 100644 --- a/lib/monkey/.gitignore +++ b/lib/monkey/.gitignore @@ -24,6 +24,7 @@ lib/python/conf/* lib/python/jemalloc.config src/include/ build/ +integration_tests/.venv/ include/monkey/mk_static_plugins.h include/monkey/mk_core/mk_core_info.h .vscode diff --git a/lib/monkey/AGENTS.md b/lib/monkey/AGENTS.md new file mode 100644 index 00000000000..110352cf173 --- /dev/null +++ b/lib/monkey/AGENTS.md @@ -0,0 +1,184 @@ +# AGENTS + +This file is the local operating guide for agents working in this repository. +It focuses on two things: + +- how the Monkey source tree is organized +- how commits are written in the existing Git history + +## Repository map + +Monkey is a small HTTP server written in C. The tree is split by subsystem. + +- `mk_core/` + Core utilities used by the server and plugins. + Includes memory helpers, strings, files, thread helpers, event loops, + I/O vectors, config parsing, and generic utilities. + +- `mk_server/` + The HTTP server implementation. + This is where connection handling, request parsing, header generation, + virtual hosts, MIME resolution, scheduler integration, streams, plugins, + and server lifecycle live. + +- `mk_bin/` + The standalone `monkey` executable entrypoints and signal handling. + +- `include/monkey/` + Public and internal headers for the core, server, parser, plugins, + config, events, streams, and API types. + +- `plugins/` + Optional server features. + Examples in this tree include `liana`, `mandril`, `dirlisting`, `cgi`, + `fastcgi`, `auth`, `logger`, `tls`, and `cheetah`. + +- `api/` + Small API-focused programs and tests. + +- `test/` + Native unit/integration-style test targets used by CMake. + +- `fuzz/` + Fuzzing entrypoints and helpers for parser and request handling. + +- `conf/` + Config templates installed or copied at build/install time. + +- `htdocs/` + Default static site content used by the standalone server. + +- `cmake/` + CMake helper modules and build logic. + +- `deps/` + Bundled third-party dependencies such as regex, rbtree, libco, + and mbedtls sources. + +- `qa/` + Extra request fixtures and local QA artifacts. + +## Main runtime flow + +When debugging behavior, the usual path is: + +1. `mk_bin/monkey.c` + Starts the binary. +2. `mk_server/monkey.c`, `mk_server/mk_server.c` + Initializes the server and worker threads. +3. `mk_server/mk_scheduler.c` + Drives socket events into protocol handlers. +4. `mk_server/mk_http.c` + Owns HTTP session lifecycle, request preparation, response handling, + range parsing, file serving, keepalive, and teardown. +5. `mk_server/mk_http_parser.c` + Parses the request line, headers, body state, and chunked transfer coding. +6. `mk_server/mk_header.c`, `mk_server/mk_stream.c` + Build and send responses. + +Useful supporting code: + +- `mk_server/mk_vhost.c` + Virtual host lookup, per-vhost file descriptor table. +- `mk_server/mk_mimetype.c` + File extension to MIME mapping. +- `mk_server/mk_user.c` + `~user` URI handling. +- `mk_server/mk_plugin.c` + Plugin registration and API exposure. +- `mk_core/mk_event_*.c` + Backend-specific event loop implementations. + +## Build and verification + +Typical local build entrypoint: + +```bash +cmake --build build +``` + +If a fresh build tree is needed, inspect `CMakeLists.txt` and the generated +`build/` layout before changing build flags. The project currently requires +CMake 3.20 and produces `build/bin/monkey`. + +## Commit style used in this repository + +Follow the existing Git history, not the older wording in `CONTRIBUTING.md`. + +### Subject format + +Use a short, lowercase, scope-prefixed subject. The common patterns are: + +- `build: bump to v1.8.7` +- `server: clean thread destroy on worker loop exit` +- `server: http: move initialization of request headers to request init` +- `core: event: Plug descriptor leaks in an error case.` +- `parser: fixed header loss issue caused by duplicated headers` +- `logger: set log file permissions to 0600, closes CVE-2013-1771 (#413)` + +### Prefix rules + +Pick the narrowest stable prefix that matches the area being changed. + +- `build:` for version bumps, CMake, workflows, packaging +- `core:` for `mk_core/` functionality +- `server:` for `mk_server/` functionality +- `server: http:` for `mk_server/mk_http.c` and closely related request flow +- `server: parser:` or `server: http_parser:` for parser-specific work +- `plugin:` or a plugin-specific prefix when the change is isolated there +- `test:` for tests +- `logger:`, `scheduler:`, `mimetype:`, `config:` when the change is clearly + isolated to that subsystem and history already uses that style +- backend-specific prefixes like `mk_event_kqueue:` are acceptable when the + change is narrow and entirely local to that backend + +### Subject style rules + +- keep it concise +- prefer lowercase after the prefix +- use colon-separated scopes, not bracket tags +- do not invent long marketing titles +- keep the subject under 80 characters +- match existing nouns already used in history where possible + +Good examples for this tree: + +- `server: http: reject malformed range delimiters` +- `server: http: avoid reusing invalid request state` +- `server: parser: validate chunk length tokens strictly` +- `core: memory: handle null mk_ptr_to_buf input` + +Bad examples for this tree: + +- `Fix CVEs` +- `Monkey: important security fixes` +- `HTTP: Add Various Improvements` +- `misc: cleanup` + +## Commit body rules + +The older contribution guide still applies well here. + +- include a body for non-trivial changes +- wrap body lines at about 80 columns +- explain the bug, the fix, and any verification done +- if the change is security-related, describe the faulty path precisely +- if multiple root causes exist, prefer separate commits + +When I am asked to commit in this repository, default behavior should be: + +1. split unrelated changes into separate commits +2. choose the narrowest prefix from the existing history +3. write a short lowercase subject +4. add a body for anything beyond trivial cleanup +5. use `git commit -s` unless the user explicitly asks otherwise + +## Working rules for this repository + +- Do not touch unrelated untracked files in the worktree. +- Be careful around parser and request lifecycle code. Many bugs surface later + in teardown, not at the first invalid input. +- Prefer minimal targeted fixes over broad refactors unless requested. +- When a bug crosses files, still group the commit by root cause, not by file. +- For security fixes, verify behavior on the built binary, not only by code + inspection. diff --git a/lib/monkey/CMakeLists.txt b/lib/monkey/CMakeLists.txt index 3dc1ef28a01..45f96d79735 100644 --- a/lib/monkey/CMakeLists.txt +++ b/lib/monkey/CMakeLists.txt @@ -23,7 +23,7 @@ endif() # Monkey Version set(MK_VERSION_MAJOR 1) set(MK_VERSION_MINOR 8) -set(MK_VERSION_PATCH 7) +set(MK_VERSION_PATCH 9) set(MK_VERSION_STR "${MK_VERSION_MAJOR}.${MK_VERSION_MINOR}.${MK_VERSION_PATCH}") # Output paths @@ -59,10 +59,15 @@ option(MK_PLUGIN_CGI "CGI support" No) option(MK_PLUGIN_CHEETAH "Cheetah Shell Interface" No) option(MK_PLUGIN_DIRLISTING "Directory Listing" Yes) option(MK_PLUGIN_FASTCGI "FastCGI" No) -option(MK_PLUGIN_LIANA "Basic network layer" Yes) option(MK_PLUGIN_LOGGER "Log Writer" No) option(MK_PLUGIN_MANDRIL "Security" Yes) -option(MK_PLUGIN_TLS "TLS/SSL support" No) +option(MK_TLS "TLS/SSL support" Yes) +set(MK_TLS_BACKEND "auto" CACHE STRING "TLS backend: auto, openssl, or mbedtls") +set_property(CACHE MK_TLS_BACKEND PROPERTY STRINGS auto openssl mbedtls) + +if(DEFINED MK_PLUGIN_TLS) + set(MK_TLS ${MK_PLUGIN_TLS}) +endif() # Options to build Monkey with/without binary and # static/dynamic library modes (default is always just @@ -101,12 +106,6 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") set(MK_SYSTEM_MALLOC 1) endif() -if(MK_STATIC_PLUGINS) - set(MK_STATIC_PLUGINS "${MK_STATIC_PLUGINS},liana") -else() - set(MK_STATIC_PLUGINS "liana") -endif() - # Variable to be populated by plugins/CMakeLists.txt. It will contain the # code required to initialize any static plugin. set(STATIC_PLUGINS_INIT "") @@ -133,6 +132,10 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows") MK_DEFINITION(_CRT_SECURE_NO_WARNINGS) endif() +if (MK_TLS) + MK_DEFINITION(MK_HAVE_TLS) +endif() + # Enable experimental (dev) HTTP/2 support if (MK_HTTP2) MK_DEFINITION(MK_HAVE_HTTP2) @@ -233,6 +236,23 @@ endif() # =========== CONFIGURATION FILES============= # ============================================ +# Build/runtime paths +# +# These defaults make an in-tree build immediately runnable via ./bin/monkey +# while still allowing packagers to override them with cache entries. +set(MK_PATH_CONF "${PROJECT_BINARY_DIR}/conf" CACHE PATH + "Default Monkey configuration directory") +set(MK_PATH_LOG "${PROJECT_BINARY_DIR}/logs" CACHE PATH + "Default Monkey log directory") +set(MK_PATH_PIDPATH "${PROJECT_BINARY_DIR}/run" CACHE PATH + "Default Monkey PID directory") +set(MK_PATH_WWW "${PROJECT_SOURCE_DIR}/htdocs" CACHE PATH + "Default Monkey document root") + +file(MAKE_DIRECTORY "${MK_PATH_CONF}") +file(MAKE_DIRECTORY "${MK_PATH_LOG}") +file(MAKE_DIRECTORY "${MK_PATH_PIDPATH}") + # Default values for conf/monkey.conf set(MK_CONF_LISTEN "2001") set(MK_CONF_WORKERS "0") @@ -251,6 +271,7 @@ set(MK_CONF_SYMLINK "Off") set(MK_CONF_DEFAULT_MIME "text/plain") set(MK_CONF_FDT "On") set(MK_CONF_OVERCAPACITY "Resist") +set(MK_PIDFILE "${MK_CONF_PIDFILE}") # Default values for conf/sites/default set(MK_VH_SERVERNAME "127.0.0.1") @@ -318,6 +339,7 @@ add_subdirectory(deps/rbtree) add_subdirectory(deps/regex) add_subdirectory(deps/flb_libco) add_subdirectory(mk_core) +add_subdirectory(tls) add_subdirectory(plugins) add_subdirectory(mk_server) diff --git a/lib/monkey/CONTRIBUTING.md b/lib/monkey/CONTRIBUTING.md index e82a8af7378..6f128a82e62 100644 --- a/lib/monkey/CONTRIBUTING.md +++ b/lib/monkey/CONTRIBUTING.md @@ -21,8 +21,10 @@ You have to pay attention to the code indentation, tabs are 4 spaces, spaces on When you commit your local changes in your repository (before to push to Github), we need you take care of the following: - - Your principal commit message (one line subject) must be prefixed with the core section name, e.g: If you are adding a new but missing protocol feature it could be __HTTP: add new XYZ method__. + - Your principal commit message (one line subject) must be prefixed with the affected area name. Follow the style used in the existing history, e.g: `build: ...`, `core: ...`, `server: ...`, `server: http: ...`, `server: parser: ...`. - The Subject of the commit must not be longer than 80 characters. + - Keep the subject short and prefer lowercase wording after the prefix. + - Use the narrowest practical scope prefix for the change. - On the commit body, each line should not be longer than 80 characters. - On most of cases we want full description about what your patch is doing, the patch description should be self descriptive.. like for dummies. Do not assume everybody knows what you are doing and on each like do not exceed 80 characters. - When running the __git commit__ command, make sure you are using the __-s__ flag, that will add a Signed-off comment in the patch description. @@ -31,19 +33,27 @@ Expanding a bit the example feature message we could use the following command: > $ git commit -a -s > -> HTTP: add new XYZ method +> server: http: add new xyz method > -> This patch adds the missing XYZ method described in RCF2616 in the +> This patch adds the missing XYZ method described in RFC2616 in the > section 12.4.x.a, it do not alter the core behavior but if the new > method is requested it will take care of the proper handling. > -> the patch have been tested using tools A & B. +> The patch has been tested using tools A & B. > > Signed-off-by: Your Name +Some recent examples from this repository are: + + - `server: clean thread destroy on worker loop exit` + - `server: http: move initialization of request headers to request init` + - `server: parser: remove unnecessary index updater` + - `build: bump to v1.8.7` + - `core: event: Plug descriptor leaks in an error case.` + If you want to see a real example, run the following command: -> $ git log 4efbc11bafeb56fbe2b4f0f6925671630ce84125 +> $ git log --oneline --no-merges -20 Your path/patches should be fully documented, that will make the review process faster for us, and a faster merge for you. diff --git a/lib/monkey/README.md b/lib/monkey/README.md index 26040a45ea6..c0e9c487259 100644 --- a/lib/monkey/README.md +++ b/lib/monkey/README.md @@ -1,59 +1,143 @@ -# Monkey Server +# Monkey HTTP Server -[Monkey](http://monkey-project.com) is a fast and lightweight Web Server for Linux. It has been designed to be very scalable with low memory and CPU consumption, the perfect solution for Embedded Linux and high end production environments. +Monkey is a lightweight HTTP server for Linux written in C. It keeps the core +small, favors predictable resource usage, and exposes a plugin-oriented +architecture that works both as a standalone web server and as a reusable +runtime foundation for HTTP-facing components. -Besides the common features as HTTP server, it expose a flexible C API which aims to behave as a fully HTTP development framework, so it can be extended as desired through the plugins interface. +The repository ships the `monkey` executable, the shared runtime in +`mk_core/`, the HTTP server implementation in `mk_server/`, optional plugins, +test targets, fuzzing entrypoints, and the default configuration and site +assets used by local builds. -For more details please refer to the [official documentation](http://monkey-project.com/documentation/). +## Why Monkey -## Features +- Small C codebase with a focused HTTP/1.1 server implementation +- Event-driven scheduler with worker threads +- Virtual hosts, keepalive, range requests, and static file serving +- Optional plugins for TLS, CGI, FastCGI, logging, auth, shell access, and + directory listing +- Build-time feature switches through CMake instead of a large external stack +- Suitable for direct server use or embedding-oriented integration work -- HTTP/1.1 Compliant -- Hybrid Networking Model: Asynchronous mode + fixed Threads -- Indented configuration style -- Versatile plugin subsystem / API -- x86, x86_64 & ARM compatible -- More features: - - SSL - - IPv6 - - Basic Auth - - Log writer - - Security - - Directory Listing - - CGI - - FastCGI - - Much more! -- Embeddable as a shared library +## Quick Start -## Requirements +Requirements: -When building Monkey it needs: +- Linux +- CMake 3.20 or newer +- A C compiler with GNU99 support +- POSIX threads -- CMake >= 2.8 -- Glibc >= 2.5 -- GNU C Compiler >= 3.2 +Build: -Monkey requires the following components on runtime: +```bash +cmake -S . -B build +cmake --build build +``` -- Linux Kernel >= 2.6.32 -- Pthreads support +Run from the source tree with the bundled configuration: -## Writing Scalable Web Services +```bash +./build/bin/monkey -c conf +``` -If you are interested into use [Monkey](http://monkey-project.com) as a base platform build scalable web services, we recommend you check our [Duda I/O](http://duda.io) project made for that purpose. +Serve a directory without editing config files: -## Join us! +```bash +./build/bin/monkey -o htdocs +``` -Monkey is an open organization so we want to hear about you, we continue growing and you can be part of it!, you can reach us at: +The generated binary is: -- Mailing list: http://lists.monkey-project.com -- IRC: irc.freenode.net #monkey -- Twitter: http://www.twitter.com/monkeywebserver -- Linkedin: http://www.linkedin.com/groups/Monkey-HTTP-Daemon-3211216 -- Freecode: http://freecode.com/projects/monkey (R.I.P) +```text +build/bin/monkey +``` -If you want to get involved, please also refer to our [Contributing](https://github.com/monkey/monkey/blob/master/CONTRIBUTING.md) guidelines. +## Build Options -## Author +Useful CMake toggles from the current build system: -Eduardo Silva +- `MK_TLS=On|Off` enable or disable TLS support +- `MK_TLS_BACKEND=auto|openssl|mbedtls` choose the TLS backend +- `MK_PLUGIN_CGI=On` +- `MK_PLUGIN_FASTCGI=On` +- `MK_PLUGIN_LOGGER=On` +- `MK_PLUGIN_CHEETAH=On` +- `MK_TESTS=On` build native test targets +- `MK_HTTP2=On` enable in-development HTTP/2 code paths +- `MK_DEBUG=On` build with debug symbols + +Example: + +```bash +cmake -S . -B build \ + -DMK_TESTS=On \ + -DMK_PLUGIN_LOGGER=On \ + -DMK_TLS=On +cmake --build build +``` + +## Runtime Notes + +Common command-line options: + +- `-c, --configdir` set the configuration directory +- `-s, --serverconf` choose the main server config file +- `-p, --port` override the listen port +- `-w, --workers` override the worker count +- `-D, --daemon` run in the background +- `--https` enable HTTPS on configured listeners +- `-b, --build` print build information +- `-h, --help` show the full command reference + +Configuration templates live under `conf/`. The default static site content for +local runs lives under `htdocs/`. + +## Repository Layout + +- `mk_core/` core utilities, memory, events, files, strings, and threading +- `mk_server/` HTTP server, scheduler, request lifecycle, headers, streams, + virtual hosts, and plugin integration +- `mk_bin/` executable entrypoints and signal handling +- `include/monkey/` public and internal headers +- `plugins/` optional runtime features +- `test/` native tests used by CMake +- `fuzz/` fuzzing entrypoints and helpers +- `qa/` request fixtures and QA material +- `conf/` configuration templates +- `htdocs/` default site assets + +## Development + +Build test targets: + +```bash +cmake -S . -B build -DMK_TESTS=On +cmake --build build +``` + +Additional notes: + +- Fuzzing notes live in [FUZZ.md](FUZZ.md) +- Arduino YUN cross-build notes live in [ARDUINO_YUN.md](ARDUINO_YUN.md) +- Contribution rules live in [CONTRIBUTING.md](CONTRIBUTING.md) +- Local repository conventions for agents live in [AGENTS.md](AGENTS.md) + +## Project Links + +- Repository: https://github.com/monkey/monkey +- Issues: https://github.com/monkey/monkey/issues +- Project site: https://monkeywebserver.com +- Documentation: https://monkeywebserver.com/documentation/ + +## Contributing + +Send changes through GitHub pull requests. Before opening one, read +[CONTRIBUTING.md](CONTRIBUTING.md) and follow the commit style already used in +the repository history: narrow scope prefixes, short lowercase subjects, and a +proper body for non-trivial changes. + +## License + +Monkey source files are licensed under the Apache License, Version 2.0. diff --git a/lib/monkey/htdocs/index.html b/lib/monkey/htdocs/index.html index a5b6e16c748..b939a29985f 100644 --- a/lib/monkey/htdocs/index.html +++ b/lib/monkey/htdocs/index.html @@ -9,7 +9,7 @@ - Monkey Server v1.6 + Monkey Server @@ -55,12 +55,12 @@
  • - + Documentation
  • - Blog + Website
  • Source Code @@ -78,11 +78,11 @@
    -

    Monkey Server v1.6

    +

    Monkey Server

    - Monkey is a high performance Open Source Web Server and + Monkey is a high performance Open Source Web Server and development stack. It has been designed to be scalable by nature through low memory and CPU consumption, the right choice for High-End production servers and Embedded devices.

    @@ -98,15 +98,15 @@

    Monkey Server v1.6

    -

    Release Notes

    -

    Monkey v1.6.0

    +

    Documentation

    +

    Get started and go deeper

    - This version is a major improvement since the previous series: improved TLS, add additional support for OSX and BSD, the scheduler is aware about protocol handlers (HTTP2 is coming!), a new HTTP parser have been implemented, the plugins can be static or dynamic, the build system is now based on CMake, general performance have been improved and much more. We invite you to read our official release notes: + Monkey ships as a compact event-driven web server focused on low resource usage, extensibility and predictable behavior. For installation, configuration and operational guidance, use the official documentation:

    @@ -115,7 +115,7 @@

    Release Notes

    Design, goals and Vision

    Performance & Innovation

    - Monkey is a complete event-driven HTTP framework. It have been designed as a + Monkey is a complete event-driven HTTP framework. It have been designed as a small core capable to extend it behavior through the plugin interface.

    diff --git a/lib/monkey/include/monkey/mk_config.h b/lib/monkey/include/monkey/mk_config.h index f6552815347..c65414fadd7 100644 --- a/lib/monkey/include/monkey/mk_config.h +++ b/lib/monkey/include/monkey/mk_config.h @@ -142,6 +142,11 @@ struct mk_server * is used when overriding the configuration from some caller */ char *transport_layer; + int tls_mode; + char *tls_cert_file; + char *tls_cert_chain_file; + char *tls_key_file; + char *tls_dh_param_file; /* Define the default mime type when is not possible to find the proper one */ struct mk_list mimetype_list; diff --git a/lib/monkey/include/monkey/mk_core/mk_list.h b/lib/monkey/include/monkey/mk_core/mk_list.h index 0a87381a8cd..74251f22ec4 100644 --- a/lib/monkey/include/monkey/mk_core/mk_list.h +++ b/lib/monkey/include/monkey/mk_core/mk_list.h @@ -225,7 +225,7 @@ static inline void mk_list_cat(struct mk_list *list, struct mk_list *head) */ #define mk_list_entry_first(ptr, type, member) container_of((ptr)->next, type, member) -/* First node of the list +/* Last node of the list * --------------------- * Be careful with this Macro, its intended to be used when some node is already linked * to the list (ptr). If the list is empty it will return the list address as it points diff --git a/lib/monkey/include/monkey/mk_core/mk_rconf.h b/lib/monkey/include/monkey/mk_core/mk_rconf.h index 800e0087cf4..66ac83890a4 100644 --- a/lib/monkey/include/monkey/mk_core/mk_rconf.h +++ b/lib/monkey/include/monkey/mk_core/mk_rconf.h @@ -62,7 +62,7 @@ struct mk_rconf_file struct mk_rconf { int level; - int created; + time_t created; char *file; char *root_path; diff --git a/lib/monkey/include/monkey/mk_core/mk_string.h b/lib/monkey/include/monkey/mk_core/mk_string.h index dddf9c6ce54..18281e7214c 100644 --- a/lib/monkey/include/monkey/mk_core/mk_string.h +++ b/lib/monkey/include/monkey/mk_core/mk_string.h @@ -76,6 +76,7 @@ void mk_string_split_free(struct mk_list *list); int mk_string_trim(char **str); char *mk_string_build(char **buffer, unsigned long *len, const char *format, ...) PRINTF_WARNINGS(3,4); +char *mk_string_html_escape(const char *str); #if defined (__GNUC__) || defined (_WIN32) int mk_string_itop(uint64_t value, mk_ptr_t *p); diff --git a/lib/monkey/include/monkey/mk_core/mk_win32_socketpair.h b/lib/monkey/include/monkey/mk_core/mk_win32_socketpair.h new file mode 100644 index 00000000000..2fd2190ca51 --- /dev/null +++ b/lib/monkey/include/monkey/mk_core/mk_win32_socketpair.h @@ -0,0 +1,30 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + +/* Monkey HTTP Server + * ================== + * Copyright 2001-2026 Eduardo Silva + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MK_WIN32_SOCKETPAIR_H +#define MK_WIN32_SOCKETPAIR_H + +#ifdef _WIN32 +#include +#include + +int mk_win32_socketpair(SOCKET pair[2]); +#endif + +#endif diff --git a/lib/monkey/include/monkey/mk_http.h b/lib/monkey/include/monkey/mk_http.h index 42204f9c6fe..b28db86a250 100644 --- a/lib/monkey/include/monkey/mk_http.h +++ b/lib/monkey/include/monkey/mk_http.h @@ -135,7 +135,7 @@ struct mk_http_session char *body; /* Initial fixed size buffer for small requests */ - char body_fixed[MK_REQUEST_CHUNK]; + char body_fixed[MK_REQUEST_CHUNK + 1]; /* * FIXME: in previous versions of Monkey we used to parse the complete request diff --git a/lib/monkey/include/monkey/mk_http_parser.h b/lib/monkey/include/monkey/mk_http_parser.h index 9e3b365eef7..465ea0e4962 100644 --- a/lib/monkey/include/monkey/mk_http_parser.h +++ b/lib/monkey/include/monkey/mk_http_parser.h @@ -389,7 +389,11 @@ int mk_http_parser_chunked_decode_buf(struct mk_http_parser *p, static inline int mk_http_parser_more(struct mk_http_parser *p, int len) { - if (abs(len - p->i) - 1 > 0) { + if (len <= 0 || p->i < 0) { + return MK_FALSE; + } + + if ((p->i + 1) < len) { return MK_TRUE; } diff --git a/lib/monkey/include/monkey/mk_net.h b/lib/monkey/include/monkey/mk_net.h index 1bcfac88f71..6e5c245afe4 100644 --- a/lib/monkey/include/monkey/mk_net.h +++ b/lib/monkey/include/monkey/mk_net.h @@ -22,6 +22,7 @@ #include #include +#include struct mk_net_connection { struct mk_event event; @@ -32,6 +33,9 @@ struct mk_net_connection { }; int mk_net_init(); +struct mk_plugin_network *mk_net_transport_default(); +int mk_net_transport_event_interest(struct mk_plugin_network *transport, + int fd, int fallback); struct mk_net_connection *mk_net_conn_create(char *addr, int port); int mk_net_conn_write(struct mk_channel *channel, diff --git a/lib/monkey/include/monkey/mk_plugin_net.h b/lib/monkey/include/monkey/mk_plugin_net.h index e60c74cf73b..9a7782044af 100644 --- a/lib/monkey/include/monkey/mk_plugin_net.h +++ b/lib/monkey/include/monkey/mk_plugin_net.h @@ -33,6 +33,7 @@ struct mk_plugin_network { int (*writev) (struct mk_plugin *, int, struct mk_iov *); int (*close) (struct mk_plugin *, int); int (*send_file) (struct mk_plugin *, int, int, off_t *, size_t); + int (*event_interest) (struct mk_plugin *, int, int); int buffer_size; struct mk_plugin *plugin; }; diff --git a/lib/monkey/include/monkey/mk_server.h b/lib/monkey/include/monkey/mk_server.h index f84a7d632e2..cc0500f1aa7 100644 --- a/lib/monkey/include/monkey/mk_server.h +++ b/lib/monkey/include/monkey/mk_server.h @@ -24,6 +24,7 @@ #include #include #include +#include #define MK_SERVER_SIGNAL_START 0xEEEEEEEE #define MK_SERVER_SIGNAL_STOP 0xDDDDDDDD @@ -33,7 +34,7 @@ struct mk_server_listen struct mk_event event; int server_fd; - struct mk_plugin *network; + struct mk_plugin_network *network; struct mk_sched_handler *protocol; struct mk_config_listener *listen; struct mk_list _head; diff --git a/lib/monkey/include/monkey/mk_tls_transport.h b/lib/monkey/include/monkey/mk_tls_transport.h new file mode 100644 index 00000000000..b18bd1cda80 --- /dev/null +++ b/lib/monkey/include/monkey/mk_tls_transport.h @@ -0,0 +1,15 @@ +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + +#ifndef MK_TLS_TRANSPORT_H +#define MK_TLS_TRANSPORT_H + +#include +#include + +int mk_tls_enabled(void); +int mk_tls_init(struct mk_server *server); +void mk_tls_thread_init(struct mk_server *server); +void mk_tls_exit(struct mk_server *server); +struct mk_plugin_network *mk_tls_transport(void); + +#endif diff --git a/lib/monkey/integration_tests/conftest.py b/lib/monkey/integration_tests/conftest.py new file mode 100644 index 00000000000..c2c78053b71 --- /dev/null +++ b/lib/monkey/integration_tests/conftest.py @@ -0,0 +1,18 @@ +import logging + + +def configure_logging(): + logger = logging.getLogger(__name__) + logger.setLevel(logging.INFO) + + if not logger.handlers: + handler = logging.StreamHandler() + handler.setLevel(logging.INFO) + formatter = logging.Formatter("%(asctime)s - %(levelname)s - %(message)s") + handler.setFormatter(formatter) + logger.addHandler(handler) + + return logger + + +logger = configure_logging() diff --git a/lib/monkey/integration_tests/pytest.ini b/lib/monkey/integration_tests/pytest.ini new file mode 100644 index 00000000000..7b6de672b5f --- /dev/null +++ b/lib/monkey/integration_tests/pytest.ini @@ -0,0 +1,7 @@ +[pytest] +testpaths = tests +pythonpath = . src +log_cli = 1 +log_cli_level = INFO +log_cli_format = %(asctime)s - %(levelname)s - %(message)s +log_cli_date_format = %Y-%m-%d %H:%M:%S diff --git a/lib/monkey/integration_tests/requirements.txt b/lib/monkey/integration_tests/requirements.txt new file mode 100644 index 00000000000..75b4ea88895 --- /dev/null +++ b/lib/monkey/integration_tests/requirements.txt @@ -0,0 +1 @@ +pytest>=8,<9 diff --git a/lib/monkey/integration_tests/run_tests.py b/lib/monkey/integration_tests/run_tests.py new file mode 100644 index 00000000000..f0858cd0bfc --- /dev/null +++ b/lib/monkey/integration_tests/run_tests.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python3 + +from __future__ import annotations + +import argparse +import os +import sys +from pathlib import Path + + +SUITE_ROOT = Path(__file__).resolve().parent +VENV_PYTHON = SUITE_ROOT / ".venv" / "bin" / "python3" +REEXEC_ENV = "MONKEY_INTEGRATION_REEXEC" + + +def _maybe_reexec_in_venv() -> None: + if os.environ.get(REEXEC_ENV) == "1": + return + + if not VENV_PYTHON.is_file(): + return + + current = Path(sys.executable).resolve() + target = VENV_PYTHON.resolve() + + if current == target: + return + + env = os.environ.copy() + env[REEXEC_ENV] = "1" + os.execve(str(target), [str(target), str(Path(__file__).resolve()), *sys.argv[1:]], env) + + +_maybe_reexec_in_venv() + +try: + import pytest # noqa: E402 +except ModuleNotFoundError: + if VENV_PYTHON.is_file() and os.environ.get(REEXEC_ENV) != "1": + env = os.environ.copy() + env[REEXEC_ENV] = "1" + os.execve(str(VENV_PYTHON), [str(VENV_PYTHON), str(Path(__file__).resolve()), *sys.argv[1:]], env) + raise + + +def parse_args(argv: list[str]) -> tuple[argparse.Namespace, list[str]]: + parser = argparse.ArgumentParser(description="Run Monkey integration tests.") + parser.add_argument("--plain-binary", help="Set MONKEY_BIN_PLAIN for this run.") + parser.add_argument("--openssl-binary", help="Set MONKEY_BIN_OPENSSL for this run.") + parser.add_argument("--mbedtls-binary", help="Set MONKEY_BIN_MBEDTLS for this run.") + parser.add_argument( + "--binaries", + choices=["all", "plain", "openssl", "mbedtls"], + default="all", + help="Limit the suite to a specific Monkey binary family.", + ) + parser.add_argument("--valgrind", action="store_true", help="Run Monkey under valgrind.") + parser.add_argument( + "--valgrind-strict", + action="store_true", + help="Run Monkey under valgrind and fail on reported leaks/errors.", + ) + parser.add_argument("--quiet", action="store_true", help="Run pytest with -q.") + return parser.parse_known_args(argv) + + +def build_pytest_args(args: argparse.Namespace, passthrough: list[str]) -> list[str]: + pytest_args = ["--rootdir", str(SUITE_ROOT)] + + if args.quiet: + pytest_args.append("-q") + else: + pytest_args.append("-vv") + + pytest_args.extend(passthrough) + if not passthrough: + pytest_args.append(str(SUITE_ROOT / "tests")) + + return pytest_args + + +def main(argv: list[str]) -> int: + args, passthrough = parse_args(argv) + + if args.plain_binary: + os.environ["MONKEY_BIN_PLAIN"] = args.plain_binary + if args.openssl_binary: + os.environ["MONKEY_BIN_OPENSSL"] = args.openssl_binary + if args.mbedtls_binary: + os.environ["MONKEY_BIN_MBEDTLS"] = args.mbedtls_binary + if args.binaries != "all": + os.environ["MONKEY_TEST_BINARIES"] = args.binaries + if args.valgrind: + os.environ["MONKEY_VALGRIND"] = "1" + if args.valgrind_strict: + os.environ["MONKEY_VALGRIND"] = "1" + os.environ["MONKEY_VALGRIND_STRICT"] = "1" + + return pytest.main(build_pytest_args(args, passthrough)) + + +if __name__ == "__main__": + raise SystemExit(main(sys.argv[1:])) diff --git a/lib/monkey/integration_tests/src/__init__.py b/lib/monkey/integration_tests/src/__init__.py new file mode 100644 index 00000000000..f7049ed1224 --- /dev/null +++ b/lib/monkey/integration_tests/src/__init__.py @@ -0,0 +1 @@ +# Monkey integration test helpers package. diff --git a/lib/monkey/integration_tests/src/monkey_manager.py b/lib/monkey/integration_tests/src/monkey_manager.py new file mode 100644 index 00000000000..259b2b5b070 --- /dev/null +++ b/lib/monkey/integration_tests/src/monkey_manager.py @@ -0,0 +1,338 @@ +from __future__ import annotations + +import http.client +import os +import re +import shutil +import socket +import ssl +import subprocess +import tempfile +import time +from dataclasses import dataclass +from pathlib import Path +ENV_MONKEY_BIN_PLAIN = "MONKEY_BIN_PLAIN" +ENV_MONKEY_BIN_OPENSSL = "MONKEY_BIN_OPENSSL" +ENV_MONKEY_BIN_MBEDTLS = "MONKEY_BIN_MBEDTLS" +ENV_MONKEY_VALGRIND = "MONKEY_VALGRIND" +ENV_MONKEY_VALGRIND_STRICT = "MONKEY_VALGRIND_STRICT" + + +def generate_tls_assets(directory: Path) -> None: + subprocess.run( + [ + "openssl", + "req", + "-x509", + "-newkey", + "rsa:2048", + "-keyout", + str(directory / "rsa_key.pem"), + "-out", + str(directory / "srv_cert.pem"), + "-sha256", + "-days", + "1", + "-nodes", + "-subj", + "/CN=127.0.0.1", + ], + check=True, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) + + subprocess.run( + [ + "openssl", + "dhparam", + "-out", + str(directory / "dhparam.pem"), + "512", + ], + check=True, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) + + shutil.copy2(directory / "rsa_key.pem", directory / "rsa.pem") + + +def find_available_port() -> int: + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: + sock.bind(("127.0.0.1", 0)) + return sock.getsockname()[1] + + +def wait_for_port(host: str, port: int, timeout: float = 10.0) -> None: + deadline = time.time() + timeout + + while time.time() < deadline: + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: + sock.settimeout(0.2) + if sock.connect_ex((host, port)) == 0: + return + time.sleep(0.1) + + raise TimeoutError(f"Timed out waiting for {host}:{port}") + + +def replace_config_value(config_text: str, key: str, value: str) -> str: + pattern = rf"^(\s*{re.escape(key)}\s+).*$" + updated, count = re.subn(pattern, rf"\g<1>{value}", config_text, count=1, flags=re.MULTILINE) + if count != 1: + raise AssertionError(f"Could not replace config key: {key}") + return updated + + +@dataclass +class MonkeyBinary: + label: str + env_var: str + tls: bool + + +@dataclass +class HttpResponse: + status: int + reason: str + headers: dict[str, str] + body: bytes + + +class MonkeyManager: + def __init__(self, binary_path: str, tls: bool = False) -> None: + self.binary_path = Path(binary_path).resolve() + self.tls = tls + self.host = "127.0.0.1" + self.port = find_available_port() + self.workdir_obj = tempfile.TemporaryDirectory(prefix="monkey-it-") + self.workdir = Path(self.workdir_obj.name) + self.confdir = self.workdir / "conf" + self.htdocs = self.workdir / "htdocs" + self.log_file = self.workdir / "monkey.log" + self.valgrind_log_file = self.workdir / "valgrind.log" + self.process: subprocess.Popen[str] | None = None + self.valgrind_enabled = os.environ.get(ENV_MONKEY_VALGRIND) == "1" + self.valgrind_strict = os.environ.get(ENV_MONKEY_VALGRIND_STRICT) == "1" + + def _read_log_file(self) -> str: + if not self.log_file.exists(): + return "" + return self.log_file.read_text(encoding="utf-8", errors="replace") + + @property + def build_root(self) -> Path: + return self.binary_path.parent.parent + + @property + def url(self) -> str: + scheme = "https" if self.tls else "http" + return f"{scheme}://{self.host}:{self.port}/" + + def _copy_build_conf(self, filename: str) -> None: + src = self.build_root / "conf" / filename + if not src.is_file(): + raise FileNotFoundError(f"Missing config asset: {src}") + shutil.copy2(src, self.confdir / filename) + + def _prepare_tls_assets(self) -> None: + self._copy_build_conf("tls.conf") + generate_tls_assets(self.confdir) + + def prepare(self) -> None: + self.confdir.mkdir(parents=True, exist_ok=True) + self.htdocs.mkdir(parents=True, exist_ok=True) + (self.htdocs / "index.html").write_text( + "Monkey integration test payload\n", + encoding="utf-8", + ) + + self._copy_build_conf("monkey.mime") + if self.tls: + self._prepare_tls_assets() + + listen_flags = " tls" if self.tls else "" + monkey_conf = ( + "[SERVER]\n" + f" Listen {self.host}:{self.port}{listen_flags}\n" + " Workers 1\n" + " Timeout 15\n" + f" PidFile {self.workdir / 'monkey.pid'}\n" + " User root\n" + " UserDir disabled\n" + " Indexfile index.html\n" + " HideVersion Off\n" + " Resume On\n" + " KeepAlive On\n" + " KeepAliveTimeout 5\n" + " MaxKeepAliveRequest 50\n" + " MaxRequestSize 32\n" + " SymLink Off\n" + " DefaultMimeType text/plain\n" + " FDT On\n" + " OverCapacity Resist\n" + ) + (self.confdir / "monkey.conf").write_text(monkey_conf, encoding="utf-8") + + def _build_command(self) -> list[str]: + command = [ + str(self.binary_path), + "-c", + str(self.confdir), + "-s", + "monkey.conf", + "-o", + str(self.htdocs), + ] + + if not self.valgrind_enabled: + return command + + valgrind_command = [ + "valgrind", + f"--log-file={self.valgrind_log_file}", + "--leak-check=full", + "--show-leak-kinds=all", + "--track-origins=yes", + "--error-exitcode=99", + ] + + if self.valgrind_strict: + valgrind_command.append("--errors-for-leak-kinds=definite,possible,indirect") + + valgrind_command.extend(command) + return valgrind_command + + def start(self) -> None: + self.prepare() + log_handle = self.log_file.open("w", encoding="utf-8") + self.process = subprocess.Popen( + self._build_command(), + stdout=log_handle, + stderr=subprocess.STDOUT, + text=True, + ) + try: + wait_for_port(self.host, self.port) + except TimeoutError as exc: + log_handle.flush() + if self.process.poll() is not None: + raise RuntimeError( + f"Monkey exited before listening.\n{self._read_log_file()}" + ) from exc + raise RuntimeError( + f"Monkey did not start listening in time.\n{self._read_log_file()}" + ) from exc + + def _validate_valgrind(self, return_code: int) -> None: + if not self.valgrind_enabled: + return + + if return_code == 99: + raise AssertionError(self.valgrind_log_file.read_text(encoding="utf-8")) + + def stop(self) -> None: + if self.process is not None: + self.process.terminate() + try: + return_code = self.process.wait(timeout=5) + except subprocess.TimeoutExpired: + self.process.kill() + return_code = self.process.wait(timeout=5) + + self._validate_valgrind(return_code) + self.process = None + + self.workdir_obj.cleanup() + + def fetch(self) -> tuple[int, bytes, dict[str, str]]: + response = self.request("GET", "/", headers={"Connection": "close"}) + return response.status, response.body, response.headers + + def open_http_connection(self) -> http.client.HTTPConnection: + if self.tls: + context = ssl._create_unverified_context() + return http.client.HTTPSConnection(self.host, self.port, timeout=5, context=context) + return http.client.HTTPConnection(self.host, self.port, timeout=5) + + def request( + self, + method: str, + path: str, + body: bytes | None = None, + headers: dict[str, str] | None = None, + ) -> HttpResponse: + connection = self.open_http_connection() + try: + connection.request(method, path, body=body, headers=headers or {}) + response = connection.getresponse() + payload = response.read() + response_headers = {k.lower(): v for k, v in response.getheaders()} + return HttpResponse(response.status, response.reason, response_headers, payload) + finally: + connection.close() + + def request_keepalive_sequence( + self, + requests_spec: list[tuple[str, str, dict[str, str] | None]], + ) -> list[HttpResponse]: + connection = self.open_http_connection() + responses = [] + + try: + for method, path, headers in requests_spec: + connection.request(method, path, headers=headers or {}) + response = connection.getresponse() + payload = response.read() + response_headers = {k.lower(): v for k, v in response.getheaders()} + responses.append(HttpResponse(response.status, response.reason, response_headers, payload)) + finally: + connection.close() + + return responses + + def raw_request(self, payload: bytes) -> bytes: + return self.raw_request_parts([payload]) + + def raw_request_parts( + self, + payloads: list[bytes], + pause_between_parts: float = 0.0, + shutdown_write: bool = False, + ) -> bytes: + sock = socket.create_connection((self.host, self.port), timeout=5) + sock.settimeout(5) + + if self.tls: + context = ssl._create_unverified_context() + sock = context.wrap_socket(sock, server_hostname=self.host) + + try: + for index, payload in enumerate(payloads): + sock.sendall(payload) + if pause_between_parts > 0 and index + 1 < len(payloads): + time.sleep(pause_between_parts) + + if shutdown_write: + try: + sock.shutdown(socket.SHUT_WR) + except OSError: + pass + + chunks = [] + while True: + try: + data = sock.recv(65535) + except ConnectionResetError: + break + except socket.timeout: + break + + if not data: + break + chunks.append(data) + + return b"".join(chunks) + finally: + sock.close() diff --git a/lib/monkey/integration_tests/tests/test_network_layer.py b/lib/monkey/integration_tests/tests/test_network_layer.py new file mode 100644 index 00000000000..9d32609e537 --- /dev/null +++ b/lib/monkey/integration_tests/tests/test_network_layer.py @@ -0,0 +1,655 @@ +from __future__ import annotations + +import shutil +import subprocess +import os +from pathlib import Path + +import pytest + +from src.monkey_manager import ENV_MONKEY_BIN_MBEDTLS +from src.monkey_manager import ENV_MONKEY_BIN_OPENSSL +from src.monkey_manager import ENV_MONKEY_BIN_PLAIN +from src.monkey_manager import find_available_port +from src.monkey_manager import generate_tls_assets +from src.monkey_manager import MonkeyBinary +from src.monkey_manager import MonkeyManager +from src.monkey_manager import replace_config_value +from src.monkey_manager import wait_for_port + + +BINARIES = [ + MonkeyBinary("plain", ENV_MONKEY_BIN_PLAIN, False), + MonkeyBinary("openssl", ENV_MONKEY_BIN_OPENSSL, True), + MonkeyBinary("mbedtls", ENV_MONKEY_BIN_MBEDTLS, True), +] + + +def resolve_binary(candidate: MonkeyBinary) -> str: + path = os.environ.get(candidate.env_var) + if not path: + defaults = { + ENV_MONKEY_BIN_PLAIN: "/tmp/monkey-build-default/bin/monkey", + ENV_MONKEY_BIN_OPENSSL: "/tmp/monkey-build-tls/bin/monkey", + ENV_MONKEY_BIN_MBEDTLS: "/tmp/monkey-build-mbedtls/bin/monkey", + } + path = defaults[candidate.env_var] + + if not Path(path).is_file(): + pytest.skip(f"{candidate.label} binary not available: {path}") + + return path + + +def selected_binaries() -> list[MonkeyBinary]: + selection = os.environ.get("MONKEY_TEST_BINARIES", "all") + if selection == "all": + return BINARIES + + return [candidate for candidate in BINARIES if candidate.label == selection] + + +@pytest.fixture(params=selected_binaries(), ids=lambda item: item.label) +def monkey_instance(request): + candidate = request.param + manager = MonkeyManager(resolve_binary(candidate), tls=candidate.tls) + manager.start() + try: + yield manager + finally: + manager.stop() + + +def test_serves_index_body(monkey_instance: MonkeyManager): + status, body, headers = monkey_instance.fetch() + + assert status == 200 + assert body == b"Monkey integration test payload\n" + assert headers["content-type"].startswith("text/html") + assert int(headers["content-length"]) == len(body) + + +def test_server_header_present(monkey_instance: MonkeyManager): + status, _, headers = monkey_instance.fetch() + + assert status == 200 + assert headers["server"].startswith("Monkey/") + + +def test_forbidden_error_page_escapes_reflected_uri(monkey_instance: MonkeyManager): + payload = b"GET /../\"> HTTP/1.1\r\n" + payload += f"Host: {monkey_instance.host}:{monkey_instance.port}\r\n".encode() + payload += b"Connection: close\r\n\r\n" + + response = monkey_instance.raw_request(payload) + + assert b"HTTP/1.1 403 Forbidden" in response + assert b"" not in response + assert b"/../"><script>alert(73541);</script>" in response + + +def test_server_restarts_cleanly(): + for candidate in selected_binaries(): + manager = MonkeyManager(resolve_binary(candidate), tls=candidate.tls) + manager.start() + try: + status, body, _ = manager.fetch() + assert status == 200 + assert body == b"Monkey integration test payload\n" + finally: + manager.stop() + + + manager = MonkeyManager(resolve_binary(candidate), tls=candidate.tls) + manager.start() + try: + status, body, _ = manager.fetch() + assert status == 200 + assert body == b"Monkey integration test payload\n" + finally: + manager.stop() + + +def test_binary_starts_with_no_arguments_from_build_tree(tmp_path: Path): + plain_binary = resolve_binary(MonkeyBinary("plain", ENV_MONKEY_BIN_PLAIN, False)) + build_root = Path(plain_binary).resolve().parent.parent + runtime_root = tmp_path / "runtime" + runtime_bin = runtime_root / "bin" + runtime_conf = runtime_root / "conf" + runtime_sites = runtime_conf / "sites" + runtime_htdocs = runtime_root / "htdocs" + runtime_run = runtime_root / "run" + runtime_logs = runtime_root / "logs" + port = find_available_port() + log_file = runtime_root / "monkey.log" + + runtime_bin.mkdir(parents=True) + runtime_sites.mkdir(parents=True) + runtime_htdocs.mkdir(parents=True) + runtime_run.mkdir(parents=True) + runtime_logs.mkdir(parents=True) + + shutil.copy2(build_root / "bin" / "monkey", runtime_bin / "monkey") + shutil.copy2(build_root / "conf" / "monkey.mime", runtime_conf / "monkey.mime") + shutil.copy2(build_root / "conf" / "plugins.load", runtime_conf / "plugins.load") + + monkey_conf = (build_root / "conf" / "monkey.conf").read_text(encoding="utf-8") + monkey_conf = replace_config_value(monkey_conf, "Listen", str(port)) + monkey_conf = replace_config_value( + monkey_conf, "PidFile", str((runtime_run / "monkey.pid").resolve()) + ) + (runtime_conf / "monkey.conf").write_text(monkey_conf, encoding="utf-8") + + site_conf = (build_root / "conf" / "sites" / "default").read_text(encoding="utf-8") + site_conf = replace_config_value( + site_conf, "DocumentRoot", str(runtime_htdocs.resolve()) + ) + site_conf = replace_config_value( + site_conf, "AccessLog", str((runtime_logs / "access.log").resolve()) + ) + site_conf = replace_config_value( + site_conf, "ErrorLog", str((runtime_logs / "error.log").resolve()) + ) + (runtime_sites / "default").write_text(site_conf, encoding="utf-8") + + (runtime_htdocs / "index.html").write_text( + "Monkey direct startup regression\n", + encoding="utf-8", + ) + + process = None + log_handle = log_file.open("w", encoding="utf-8") + try: + process = subprocess.Popen( + ["./bin/monkey"], + cwd=runtime_root, + stdout=log_handle, + stderr=subprocess.STDOUT, + text=True, + ) + wait_for_port("127.0.0.1", port) + + manager = MonkeyManager(plain_binary, tls=False) + manager.host = "127.0.0.1" + manager.port = port + response = manager.request("GET", "/") + assert response.status == 200 + assert response.body == b"Monkey direct startup regression\n" + finally: + log_handle.flush() + log_handle.close() + if process is not None: + process.terminate() + process.wait(timeout=5) + + +def test_binary_https_can_be_enabled_from_cli_without_tls_conf(tmp_path: Path): + plain_binary = resolve_binary(MonkeyBinary("plain", ENV_MONKEY_BIN_PLAIN, False)) + build_root = Path(plain_binary).resolve().parent.parent + runtime_root = tmp_path / "runtime-https" + runtime_bin = runtime_root / "bin" + runtime_conf = runtime_root / "conf" + runtime_sites = runtime_conf / "sites" + runtime_htdocs = runtime_root / "htdocs" + runtime_run = runtime_root / "run" + runtime_logs = runtime_root / "logs" + port = find_available_port() + log_file = runtime_root / "monkey.log" + + runtime_bin.mkdir(parents=True) + runtime_sites.mkdir(parents=True) + runtime_htdocs.mkdir(parents=True) + runtime_run.mkdir(parents=True) + runtime_logs.mkdir(parents=True) + + shutil.copy2(build_root / "bin" / "monkey", runtime_bin / "monkey") + shutil.copy2(build_root / "conf" / "monkey.mime", runtime_conf / "monkey.mime") + shutil.copy2(build_root / "conf" / "plugins.load", runtime_conf / "plugins.load") + + monkey_conf = (build_root / "conf" / "monkey.conf").read_text(encoding="utf-8") + monkey_conf = replace_config_value( + monkey_conf, "PidFile", str((runtime_run / "monkey.pid").resolve()) + ) + (runtime_conf / "monkey.conf").write_text(monkey_conf, encoding="utf-8") + + site_conf = (build_root / "conf" / "sites" / "default").read_text(encoding="utf-8") + site_conf = replace_config_value( + site_conf, "DocumentRoot", str(runtime_htdocs.resolve()) + ) + site_conf = replace_config_value( + site_conf, "AccessLog", str((runtime_logs / "access.log").resolve()) + ) + site_conf = replace_config_value( + site_conf, "ErrorLog", str((runtime_logs / "error.log").resolve()) + ) + (runtime_sites / "default").write_text(site_conf, encoding="utf-8") + + (runtime_htdocs / "index.html").write_text( + "Monkey CLI HTTPS regression\n", + encoding="utf-8", + ) + generate_tls_assets(runtime_root) + + process = None + log_handle = log_file.open("w", encoding="utf-8") + try: + process = subprocess.Popen( + [ + "./bin/monkey", + "--https", + "-p", + str(port), + "--tls-cert", + str((runtime_root / "srv_cert.pem").resolve()), + "--tls-key", + str((runtime_root / "rsa_key.pem").resolve()), + "--tls-dh", + str((runtime_root / "dhparam.pem").resolve()), + ], + cwd=runtime_root, + stdout=log_handle, + stderr=subprocess.STDOUT, + text=True, + ) + wait_for_port("127.0.0.1", port) + + manager = MonkeyManager(plain_binary, tls=True) + manager.host = "127.0.0.1" + manager.port = port + response = manager.request("GET", "/") + assert response.status == 200 + assert response.body == b"Monkey CLI HTTPS regression\n" + finally: + log_handle.flush() + log_handle.close() + if process is not None: + process.terminate() + process.wait(timeout=5) + + +def test_binary_https_without_explicit_certs_uses_builtin_fallback(tmp_path: Path): + plain_binary = resolve_binary(MonkeyBinary("plain", ENV_MONKEY_BIN_PLAIN, False)) + build_root = Path(plain_binary).resolve().parent.parent + runtime_root = tmp_path / "runtime-https-fallback" + runtime_bin = runtime_root / "bin" + runtime_conf = runtime_root / "conf" + runtime_sites = runtime_conf / "sites" + runtime_htdocs = runtime_root / "htdocs" + runtime_run = runtime_root / "run" + runtime_logs = runtime_root / "logs" + port = find_available_port() + log_file = runtime_root / "monkey.log" + + runtime_bin.mkdir(parents=True) + runtime_sites.mkdir(parents=True) + runtime_htdocs.mkdir(parents=True) + runtime_run.mkdir(parents=True) + runtime_logs.mkdir(parents=True) + + shutil.copy2(build_root / "bin" / "monkey", runtime_bin / "monkey") + shutil.copy2(build_root / "conf" / "monkey.mime", runtime_conf / "monkey.mime") + shutil.copy2(build_root / "conf" / "plugins.load", runtime_conf / "plugins.load") + shutil.copy2(build_root / "conf" / "tls.conf", runtime_conf / "tls.conf") + + monkey_conf = (build_root / "conf" / "monkey.conf").read_text(encoding="utf-8") + monkey_conf = replace_config_value( + monkey_conf, "PidFile", str((runtime_run / "monkey.pid").resolve()) + ) + (runtime_conf / "monkey.conf").write_text(monkey_conf, encoding="utf-8") + + site_conf = (build_root / "conf" / "sites" / "default").read_text(encoding="utf-8") + site_conf = replace_config_value( + site_conf, "DocumentRoot", str(runtime_htdocs.resolve()) + ) + site_conf = replace_config_value( + site_conf, "AccessLog", str((runtime_logs / "access.log").resolve()) + ) + site_conf = replace_config_value( + site_conf, "ErrorLog", str((runtime_logs / "error.log").resolve()) + ) + (runtime_sites / "default").write_text(site_conf, encoding="utf-8") + + (runtime_htdocs / "index.html").write_text( + "Monkey CLI HTTPS builtin fallback\n", + encoding="utf-8", + ) + + process = None + log_handle = log_file.open("w", encoding="utf-8") + try: + process = subprocess.Popen( + [ + "./bin/monkey", + "--https", + "-p", + str(port), + ], + cwd=runtime_root, + stdout=log_handle, + stderr=subprocess.STDOUT, + text=True, + ) + wait_for_port("127.0.0.1", port) + + manager = MonkeyManager(plain_binary, tls=True) + manager.host = "127.0.0.1" + manager.port = port + response = manager.request("GET", "/") + assert response.status == 200 + assert response.body == b"Monkey CLI HTTPS builtin fallback\n" + finally: + log_handle.flush() + log_handle.close() + if process is not None: + process.terminate() + process.wait(timeout=5) + + +def test_head_returns_headers_without_body(monkey_instance: MonkeyManager): + response = monkey_instance.request("HEAD", "/") + + assert response.status == 200 + assert response.body == b"" + assert int(response.headers["content-length"]) > 0 + assert response.headers["content-type"].startswith("text/html") + + +def test_missing_resource_returns_404(monkey_instance: MonkeyManager): + response = monkey_instance.request("GET", "/missing-file") + + assert response.status == 404 + assert b"Not Found" in response.body + + +def test_path_traversal_returns_403(monkey_instance: MonkeyManager): + response = monkey_instance.request("GET", "/../etc/passwd") + + assert response.status == 403 + + +def test_encoded_path_traversal_returns_403(monkey_instance: MonkeyManager): + response = monkey_instance.request("GET", "/%2e%2e/etc/passwd") + + assert response.status == 403 + + +def test_unknown_method_returns_501(monkey_instance: MonkeyManager): + payload = ( + b"BREW / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Connection: close\r\n" + b"\r\n" + ) + response = monkey_instance.raw_request(payload) + + assert b"HTTP/1.1 501" in response + + +def test_put_returns_405(monkey_instance: MonkeyManager): + response = monkey_instance.request("PUT", "/") + + assert response.status == 405 + + +def test_http11_without_host_returns_400(monkey_instance: MonkeyManager): + payload = ( + b"GET / HTTP/1.1\r\n" + b"Connection: close\r\n" + b"\r\n" + ) + response = monkey_instance.raw_request(payload) + + assert b"HTTP/1.1 400" in response + + +def test_http10_without_host_is_accepted(monkey_instance: MonkeyManager): + response = monkey_instance.raw_request( + b"GET / HTTP/1.0\r\n" + b"\r\n" + ) + + assert b"HTTP/1.1 200 OK" in response + + +def test_empty_generic_header_values_are_accepted(monkey_instance: MonkeyManager): + response = monkey_instance.raw_request( + b"GET / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"X-Empty:\r\n" + b"X-Empty-Whitespace: \t\r\n" + b"Connection: close\r\n" + b"\r\n" + ) + + assert b"HTTP/1.1 200 OK" in response + + +def test_post_with_body_and_empty_generic_header_is_accepted( + monkey_instance: MonkeyManager, +): + response = monkey_instance.raw_request( + b"POST / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Content-Type: application/json\r\n" + b"Content-Length: 2\r\n" + b"X-Empty:\r\n" + b"Connection: close\r\n" + b"\r\n" + b"{}" + ) + + assert b"HTTP/1.1 200 OK" in response + + +@pytest.mark.parametrize("header_value", [b"", b" \t"]) +def test_empty_content_length_before_numeric_header_returns_400( + monkey_instance: MonkeyManager, + header_value: bytes, +): + response = monkey_instance.raw_request( + b"POST / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Content-Length:" + header_value + b"\r\n" + b"1-X: value\r\n" + b"Connection: close\r\n" + b"\r\n" + b"1" + ) + + assert b"HTTP/1.1 400" in response + + +@pytest.mark.parametrize("header_value", [b"", b" \t"]) +def test_empty_content_length_before_numeric_body_returns_400( + monkey_instance: MonkeyManager, + header_value: bytes, +): + response = monkey_instance.raw_request( + b"POST / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Connection: close\r\n" + b"Content-Length:" + header_value + b"\r\n" + b"\r\n" + b"1" + ) + + assert b"HTTP/1.1 400" in response + + +@pytest.mark.parametrize("header_value", [b"2x", b"2 1", b"+2", b"-1"]) +def test_invalid_content_length_value_returns_400( + monkey_instance: MonkeyManager, + header_value: bytes, +): + response = monkey_instance.raw_request( + b"POST / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Content-Length: " + header_value + b"\r\n" + b"Connection: close\r\n" + b"\r\n" + b"{}" + ) + + assert b"HTTP/1.1 400" in response + + +def test_content_length_overflow_returns_413(monkey_instance: MonkeyManager): + response = monkey_instance.raw_request( + b"POST / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Content-Length: 9999999999999999999999999999999999999999\r\n" + b"Connection: close\r\n" + b"\r\n" + ) + + assert b"HTTP/1.1 413" in response + + +def test_content_length_with_trailing_whitespace_is_accepted( + monkey_instance: MonkeyManager, +): + response = monkey_instance.raw_request( + b"POST / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Content-Length: 2 \t\r\n" + b"Connection: close\r\n" + b"\r\n" + b"{}" + ) + + assert b"HTTP/1.1 200 OK" in response + + +def test_empty_connection_and_transfer_encoding_are_accepted( + monkey_instance: MonkeyManager, +): + response = monkey_instance.raw_request( + b"GET / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Connection:\r\n" + b"Transfer-Encoding: \t\r\n" + b"Connection: close\r\n" + b"\r\n" + ) + + assert b"HTTP/1.1 200 OK" in response + + +def test_fragmented_empty_header_value_is_accepted(monkey_instance: MonkeyManager): + response = monkey_instance.raw_request_parts( + [ + b"GET / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"X-Empty:", + b"\r", + b"\n" + b"Connection: close\r\n" + b"\r\n", + ], + pause_between_parts=0.01, + ) + + assert b"HTTP/1.1 200 OK" in response + + +def test_empty_host_header_returns_400(monkey_instance: MonkeyManager): + response = monkey_instance.raw_request( + b"GET / HTTP/1.1\r\n" + b"Host:\r\n" + b"Connection: close\r\n" + b"\r\n" + ) + + assert b"HTTP/1.1 400" in response + + +def test_empty_upgrade_header_returns_400(monkey_instance: MonkeyManager): + response = monkey_instance.raw_request( + b"GET / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Upgrade:\r\n" + b"Connection: close\r\n" + b"\r\n" + ) + + assert b"HTTP/1.1 400" in response + + +def test_absolute_form_request_target_returns_400(monkey_instance: MonkeyManager): + response = monkey_instance.raw_request( + b"GET http://localhost/ HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Connection: close\r\n" + b"\r\n" + ) + + assert b"HTTP/1.1 400" in response + + +def test_keepalive_supports_multiple_requests(monkey_instance: MonkeyManager): + responses = monkey_instance.request_keepalive_sequence( + [ + ("GET", "/", {"Connection": "keep-alive"}), + ("GET", "/", {"Connection": "close"}), + ] + ) + + assert len(responses) == 2 + assert responses[0].status == 200 + assert responses[1].status == 200 + assert responses[0].body == b"Monkey integration test payload\n" + assert responses[1].body == b"Monkey integration test payload\n" + + +def test_pipelined_requests_return_both_responses(monkey_instance: MonkeyManager): + response = monkey_instance.raw_request( + b"GET / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Connection: keep-alive\r\n" + b"\r\n" + b"GET /missing-file HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Connection: close\r\n" + b"\r\n" + ) + + assert response.count(b"HTTP/1.1 ") == 2 + assert b"HTTP/1.1 200 OK" in response + assert b"HTTP/1.1 404 Not Found" in response + + +def test_oversized_header_returns_413(monkey_instance: MonkeyManager): + response = monkey_instance.raw_request( + b"GET / HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"X-Fill: " + (b"a" * 40000) + b"\r\n" + b"Connection: close\r\n" + b"\r\n" + ) + + assert b"HTTP/1.1 413" in response + + +def test_split_request_across_tcp_chunks_is_parsed(monkey_instance: MonkeyManager): + response = monkey_instance.raw_request_parts( + [ + b"GET / HTTP/1.1\r\n" + b"Host: localhost\r\n", + b"Connection: close\r\n" + b"\r\n", + ], + pause_between_parts=0.01, + ) + + assert b"HTTP/1.1 200 OK" in response + + +def test_bad_request_line_returns_400(monkey_instance: MonkeyManager): + response = monkey_instance.raw_request( + b"GET noslash HTTP/1.1\r\n" + b"Host: localhost\r\n" + b"Connection: close\r\n" + b"\r\n" + ) + + assert b"HTTP/1.1 400" in response diff --git a/lib/monkey/mk_bin/monkey.c b/lib/monkey/mk_bin/monkey.c index 15d695ba6ce..46f52444e20 100644 --- a/lib/monkey/mk_bin/monkey.c +++ b/lib/monkey/mk_bin/monkey.c @@ -24,6 +24,9 @@ #include #include +#include +#include +#include #if defined(__DATE__) && defined(__TIME__) static const char MONKEY_BUILT[] = __DATE__ " " __TIME__; @@ -37,7 +40,7 @@ static void mk_version(void) printf("Monkey HTTP Server v%s\n", MK_VERSION_STR); printf("Built : %s (%s %i.%i.%i)\n", MONKEY_BUILT, CC, __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__); - printf("Home : http://monkey-project.com\n"); + printf("Home : https://monkeywebserver.com\n"); fflush(stdout); } @@ -83,6 +86,11 @@ static void mk_help(int rc) printf(" -I, --pid-file\t\t\tset full path for the PID file (override config)\n"); printf(" -p, --port=PORT\t\t\tset listener TCP port (override config)\n"); printf(" -o, --one-shot=DIR\t\t\tone-shot, serve a single directory\n"); + printf(" --https\t\t\t\tenable HTTPS on configured listeners\n"); + printf(" --tls-cert=FILE\t\t\tset TLS certificate file\n"); + printf(" --tls-key=FILE\t\t\tset TLS private key file\n"); + printf(" --tls-chain=FILE\t\t\tset TLS certificate chain file\n"); + printf(" --tls-dh=FILE\t\t\tset TLS DH parameters file\n"); printf(" -t, --transport=TRANSPORT\t\tspecify transport layer (override config)\n"); printf(" -w, --workers=N\t\t\tset number of workers (override config)\n"); printf(" -m, --mimes-conf-file=FILE\t\tspecify mimes configuration file\n"); @@ -98,15 +106,115 @@ static void mk_help(int rc) printf(" -h, --help\t\t\t\tprint this help\n\n"); printf("%sDocumentation%s\n", ANSI_BOLD, ANSI_RESET); - printf(" http://monkey-project.com/documentation\n\n"); + printf(" https://monkeywebserver.com/documentation\n\n"); exit(rc); } +static int mk_dir_exists(const char *path) +{ + struct stat st; + + if (path == NULL || path[0] == '\0') { + return MK_FALSE; + } + + if (stat(path, &st) == -1) { + return MK_FALSE; + } + + if (S_ISDIR(st.st_mode) == 0) { + return MK_FALSE; + } + + return MK_TRUE; +} + +static const char *mk_default_config_dir(char *buf, size_t size, const char *argv0) +{ + char exe_path[PATH_MAX]; + char candidate[PATH_MAX]; + char *last_slash; + int written; + ssize_t len; + + if (mk_dir_exists("conf") == MK_TRUE) { + if (realpath("conf", buf) != NULL) { + return buf; + } + + written = snprintf(buf, size, "%s", "conf"); + if (written < 0 || (size_t) written >= size) { + return NULL; + } + return buf; + } + + if (MK_PATH_CONF[0] != '\0' && mk_dir_exists(MK_PATH_CONF) == MK_TRUE) { + written = snprintf(buf, size, "%s", MK_PATH_CONF); + if (written < 0 || (size_t) written >= size) { + return NULL; + } + return buf; + } + + len = readlink("/proc/self/exe", exe_path, sizeof(exe_path) - 1); + if (len > 0) { + exe_path[len] = '\0'; + } + else if (argv0 != NULL && realpath(argv0, exe_path) != NULL) { + len = strlen(exe_path); + } + else { + return NULL; + } + + last_slash = strrchr(exe_path, '/'); + if (last_slash == NULL) { + return NULL; + } + *last_slash = '\0'; + + written = snprintf(candidate, sizeof(candidate), "%s/../conf", exe_path); + if (written < 0 || (size_t) written >= sizeof(candidate)) { + return NULL; + } + if (mk_dir_exists(candidate) == MK_TRUE) { + if (realpath(candidate, buf) != NULL) { + return buf; + } + + written = snprintf(buf, size, "%s", candidate); + if (written < 0 || (size_t) written >= size) { + return NULL; + } + return buf; + } + + written = snprintf(candidate, sizeof(candidate), "%s/conf", exe_path); + if (written < 0 || (size_t) written >= sizeof(candidate)) { + return NULL; + } + if (mk_dir_exists(candidate) == MK_TRUE) { + if (realpath(candidate, buf) != NULL) { + return buf; + } + + written = snprintf(buf, size, "%s", candidate); + if (written < 0 || (size_t) written >= size) { + return NULL; + } + return buf; + } + + return NULL; +} + /* MAIN */ int main(int argc, char **argv) { int opt; + int enable_https = MK_FALSE; char *port_override = NULL; int workers_override = -1; int run_daemon = 0; @@ -121,16 +229,35 @@ int main(int argc, char **argv) char *sites_conf_dir = NULL; char *plugins_conf_dir = NULL; char *mimes_conf_file = NULL; + char *tls_cert_file = NULL; + char *tls_key_file = NULL; + char *tls_chain_file = NULL; + char *tls_dh_file = NULL; + char default_config_dir[PATH_MAX]; + const char *resolved_config_dir; struct mk_server *server; + enum { + MK_OPT_HTTPS = 1000, + MK_OPT_TLS_CERT, + MK_OPT_TLS_KEY, + MK_OPT_TLS_CHAIN, + MK_OPT_TLS_DH + }; + static const struct option long_opts[] = { { "configdir", required_argument, NULL, 'c' }, { "serverconf", required_argument, NULL, 's' }, { "build", no_argument, NULL, 'b' }, { "daemon", no_argument, NULL, 'D' }, + { "https", no_argument, NULL, MK_OPT_HTTPS }, { "pid-file", required_argument, NULL, 'I' }, { "port", required_argument, NULL, 'p' }, { "one-shot", required_argument, NULL, 'o' }, + { "tls-cert", required_argument, NULL, MK_OPT_TLS_CERT }, + { "tls-key", required_argument, NULL, MK_OPT_TLS_KEY }, + { "tls-chain", required_argument, NULL, MK_OPT_TLS_CHAIN }, + { "tls-dh", required_argument, NULL, MK_OPT_TLS_DH }, { "transport", required_argument, NULL, 't' }, { "workers", required_argument, NULL, 'w' }, { "version", no_argument, NULL, 'v' }, @@ -159,6 +286,9 @@ int main(int argc, char **argv) case 'D': run_daemon = 1; break; + case MK_OPT_HTTPS: + enable_https = MK_TRUE; + break; case 'I': pid_file = optarg; break; @@ -168,6 +298,18 @@ int main(int argc, char **argv) case 'o': one_shot = optarg; break; + case MK_OPT_TLS_CERT: + tls_cert_file = mk_string_dup(optarg); + break; + case MK_OPT_TLS_KEY: + tls_key_file = mk_string_dup(optarg); + break; + case MK_OPT_TLS_CHAIN: + tls_chain_file = mk_string_dup(optarg); + break; + case MK_OPT_TLS_DH: + tls_dh_file = mk_string_dup(optarg); + break; case 't': transport_layer = mk_string_dup(optarg); break; @@ -211,11 +353,14 @@ int main(int argc, char **argv) server = mk_server_create(); /* set configuration path */ - if (!path_config) { - server->path_conf_root = MK_PATH_CONF; + if (path_config != NULL) { + server->path_conf_root = path_config; } else { - server->path_conf_root = path_config; + resolved_config_dir = mk_default_config_dir(default_config_dir, + sizeof(default_config_dir), + argv[0]); + server->path_conf_root = (char *) resolved_config_dir; } /* set target configuration file for the server */ @@ -272,6 +417,11 @@ int main(int argc, char **argv) server->one_shot = one_shot; server->port_override = port_override; server->transport_layer = transport_layer; + server->tls_mode = enable_https; + server->tls_cert_file = tls_cert_file; + server->tls_cert_chain_file = tls_chain_file; + server->tls_key_file = tls_key_file; + server->tls_dh_param_file = tls_dh_file; mk_version(); mk_signal_init(server); @@ -305,7 +455,10 @@ int main(int argc, char **argv) * Once the all configuration is set, let mk_server configure the * internals. Not accepting connections yet. */ - mk_server_setup(server); + if (mk_server_setup(server) != 0) { + mk_err("Startup aborted due to configuration/setup failure."); + return EXIT_FAILURE; + } /* Register PID of Monkey */ mk_utils_register_pid(server->path_conf_pidfile); diff --git a/lib/monkey/mk_core/CMakeLists.txt b/lib/monkey/mk_core/CMakeLists.txt index a1a32101783..1772830685c 100644 --- a/lib/monkey/mk_core/CMakeLists.txt +++ b/lib/monkey/mk_core/CMakeLists.txt @@ -24,6 +24,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows") set(src ${src} "external/winpthreads.c" + "mk_win32_socketpair.c" ) add_subdirectory(deps/) else() @@ -123,6 +124,21 @@ check_c_source_compiles(" return epoll_create(1); }" HAVE_EPOLL) +if (CMAKE_SYSTEM_NAME MATCHES "Windows") + check_c_source_compiles(" + #include + #include + int main() { + struct sockaddr_un addr; + addr.sun_family = AF_UNIX; + return 0; + }" MK_HAVE_AFUNIX_H) + + if (MK_HAVE_AFUNIX_H) + MK_DEFINITION(MK_HAVE_AFUNIX_H) + endif() +endif() + if (MK_EVENT_LOOP_SELECT) if (NOT HAVE_SELECT) message(FATAL_ERROR "Event loop backend > select(2) not available") @@ -210,6 +226,10 @@ configure_file( add_library(mk_core STATIC ${src}) target_link_libraries(mk_core ${CMAKE_THREAD_LIBS_INIT}) +if (CMAKE_SYSTEM_NAME MATCHES "Windows") + target_link_libraries(mk_core ws2_32) +endif() + if (MK_EVENT_LOOP_LIBEVENT) target_link_libraries(mk_core event) endif() diff --git a/lib/monkey/mk_core/deps/libevent/.clang-format b/lib/monkey/mk_core/deps/libevent/.clang-format deleted file mode 100644 index a9722db2862..00000000000 --- a/lib/monkey/mk_core/deps/libevent/.clang-format +++ /dev/null @@ -1,63 +0,0 @@ ---- -Language: Cpp -BasedOnStyle: LLVM - -AccessModifierOffset: -4 - -AlignAfterOpenBracket: DontAlign -AlignEscapedNewlinesLeft: true -# AlignOperands: true -AlignTrailingComments: true - -AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: false -AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: All -AllowShortIfStatementsOnASingleLine: false -AllowShortLoopsOnASingleLine: false - -AlwaysBreakAfterDefinitionReturnType: All -AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: false - -# BinPackArguments: false -# BinPackParameters: true - -BreakBeforeBinaryOperators: false -BreakBeforeBraces: Custom -BraceWrapping: { AfterFunction: true } -BreakBeforeTernaryOperators: true -BreakConstructorInitializersBeforeComma: true - -ColumnLimit: 80 - -ContinuationIndentWidth: 4 - -DerivePointerAlignment: false #XXX -DisableFormat: false -ExperimentalAutoDetectBinPacking: false #XXX -ForEachMacros: [ LIST_FOREACH, SIMPLEQ_FOREACH, CIRCLEQ_FOREACH, TAILQ_FOREACH, TAILQ_FOREACH_REVERSE, HT_FOREACH ] - -IndentCaseLabels: false -IndentFunctionDeclarationAfterType: false -IndentWidth: 4 -IndentWrappedFunctionNames: false - -KeepEmptyLinesAtTheStartOfBlocks: true -MaxEmptyLinesToKeep: 2 - -PointerAlignment: Right #XXX - -# SpaceAfterCStyleCast: false -SpaceBeforeAssignmentOperators: true -SpaceBeforeParens: ControlStatements -SpaceInEmptyParentheses: false -SpacesBeforeTrailingComments: 1 -SpacesInAngles: false -SpacesInCStyleCastParentheses: false -SpacesInParentheses: false -Standard: Cpp03 -TabWidth: 4 -UseTab: Always -SortIncludes: false -... diff --git a/lib/monkey/mk_core/deps/libevent/.gitignore b/lib/monkey/mk_core/deps/libevent/.gitignore deleted file mode 100644 index 99610045344..00000000000 --- a/lib/monkey/mk_core/deps/libevent/.gitignore +++ /dev/null @@ -1,149 +0,0 @@ -### These files should get ignored no matter where they appear. - -# Editors leave these lying around -\#*\# -.#* -*~ -*.swp - -# C stuff -*.o - -# Windows stuff -*.obj -*.exe -*.lib - -# Patch leaves these lying arround -*.orig -*.rej - -# gcov stuff -*.gcno -*.gcov -*.gcda - -# gdb stuff -.gdb_history - -# Autotools stuff -.deps -.dirstamp -Makefile -Makefile.in - -# Libtool stuff -.libs -*.lo -*.la - -# ctags stuff -TAGS -tags - -# cscope stuff -cscope* - -# Stuff made by our makefiles -*.pc -*.log -*.trs - -## The initial / makes these files only get ignored in particular directories. -/autom4te.cache - -# configure in progress -/.cyg* -/confdefs.* -/conftest.* - -# Libtool adds these, at least sometimes -/m4/libtool.m4 -/m4/ltoptions.m4 -/m4/ltsugar.m4 -/m4/ltversion.m4 -/m4/lt~obsolete.m4 - -/aclocal.m4 -/compile -/doxygen -/config.cache -/config.guess -/config.log -/config.status -/config.sub -/configure -/configure.lineno -/depcomp -/config.h -/config.h.in -/install-sh -/libtool -/ltmain.sh -/missing -/stamp-h1 -/stamp-h2 - -/include/event2/event-config.h -/evconfig-private.h - -/sample/dns-example -/sample/event-read-fifo -/sample/hello-world -/sample/http-server -/sample/http-connect -/sample/le-proxy -/sample/https-client -/sample/signal-test -/sample/time-test -/sample/event-test - -/test-driver -/test/bench -/test/bench_cascade -/test/bench_http -/test/bench_httpclient -/test/regress -/test/regress.gen.c -/test/regress.gen.h -/test/rpcgen-attempted -/test/test-dumpevents -/test/test-eof -/test/test-closed -/test/test-init -/test/test-ratelim -/test/test-script.sh -/test/test-time -/test/test-weof -/test/test-changelist -/test/test-fdleak - - -# Files generated by cmake -/CMakeCache.txt -/CMakeFiles/ -/CTestTestfile.cmake -/DartConfiguration.tcl -/LibeventConfig.cmake -/LibeventConfigVersion.cmake -/LibeventTargets.cmake -/bin/ -/cmake_install.cmake -/include/evconfig-private.h -/lib/ -/tmp/ -/verify_tests.sh -/verify_tests.bat -/event.dir -/event_core.dir -/event_extra.dir -*.vcxproj -*.sln -*.filters - -# make dist -/COPYING -/INSTALL -/*.tar.gz - -/.vagrant diff --git a/lib/monkey/mk_core/deps/libevent/.travis.yml b/lib/monkey/mk_core/deps/libevent/.travis.yml deleted file mode 100644 index acc85e6a783..00000000000 --- a/lib/monkey/mk_core/deps/libevent/.travis.yml +++ /dev/null @@ -1,88 +0,0 @@ -os: - - linux - - osx -sudo: false - -env: - matrix: - - EVENT_BUILD_METHOD=cmake EVENT_CMAKE_OPTIONS="-DEVENT__COVERAGE=ON -DCMAKE_BUILD_TYPE=debug" COVERALLS=yes - - EVENT_BUILD_METHOD=cmake EVENT_CMAKE_OPTIONS="" - - EVENT_BUILD_METHOD=cmake EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_OPENSSL=ON" - - EVENT_BUILD_METHOD=cmake EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_THREAD_SUPPORT=ON" - - EVENT_BUILD_METHOD=cmake EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_DEBUG_MODE=ON" - - EVENT_BUILD_METHOD=cmake EVENT_CMAKE_OPTIONS="-DEVENT__DISABLE_MM_REPLACEMENT=ON" - - EVENT_BUILD_METHOD=cmake EVENT_CMAKE_OPTIONS="-DEVENT__ENABLE_VERBOSE_DEBUG=ON" - - EVENT_BUILD_METHOD=autotools EVENT_CONFIGURE_OPTIONS="" - - EVENT_BUILD_METHOD=autotools EVENT_CONFIGURE_OPTIONS="--disable-openssl" - - EVENT_BUILD_METHOD=autotools EVENT_CONFIGURE_OPTIONS="--disable-thread-support" - - EVENT_BUILD_METHOD=autotools EVENT_CONFIGURE_OPTIONS="--disable-debug-mode" - - EVENT_BUILD_METHOD=autotools EVENT_CONFIGURE_OPTIONS="--disable-malloc-replacement" - -language: c -compiler: - - gcc - - clang - -before_install: - - if [ -n "$COVERALLS" ]; then - pip install --user cpp-coveralls; - fi - - if [ "$TRAVIS_OS_NAME" == "osx" ]; then - brew update; - brew uninstall libtool && brew install libtool; - brew install openssl; - brew install lcov; - if [ "$CC" == "gcc" ]; then - export CC=$(ls -t /usr/local/bin/gcc-?.?); - fi - - export OPENSSL_ROOT=$(echo /usr/local/Cellar/openssl/*); - export - CMAKE_INCLUDE_PATH=$OPENSSL_ROOT/include - CMAKE_LIBRARY_PATH=$OPENSSL_ROOT/lib; - export - CFLAGS=-I$CMAKE_INCLUDE_PATH - LDFLAGS=-L$CMAKE_LIBRARY_PATH; - fi - -addons: - apt: - packages: - - zlib1g-dev - - libssl-dev - - build-essential - - automake - - autoconf - - cmake - - lcov - -script: - - if [ "$EVENT_BUILD_METHOD" = "autotools" ]; then - ./autogen.sh && - ./configure $EVENT_CONFIGURE_OPTIONS && - make && - make verify; - fi - - if [ "$EVENT_BUILD_METHOD" = "cmake" ]; then - mkdir build && - cd build && - cmake .. $EVENT_CMAKE_OPTIONS && - cmake --build . && - CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --target verify; - fi - -after_script: - - if [ -n "$COVERALLS" ]; then - coveralls - --build-root . - --root .. - --exclude test - --exclude sample - --exclude cmake - --exclude build/CMakeFiles/CheckTypeSize - --exclude build/CMakeFiles/CompilerIdC - --gcov-options '\-lp'; - fi - -notifications: - irc: "irc.oftc.net#libevent" diff --git a/lib/monkey/mk_core/deps/libevent/.uncrustify b/lib/monkey/mk_core/deps/libevent/.uncrustify deleted file mode 100644 index da2daa13501..00000000000 --- a/lib/monkey/mk_core/deps/libevent/.uncrustify +++ /dev/null @@ -1,55 +0,0 @@ -input_tab_size = 8 -output_tab_size = 8 -indent_with_tabs = 2 -indent_cmt_with_tabs = false -indent_brace_parent = false -indent_func_call_param = true -indent_func_def_param = true -sp_enum_before_assign = add -sp_enum_after_assign = add -sp_inside_paren = remove -sp_paren_brace = add -sp_before_ptr_star = add -sp_before_unnamed_ptr_star = add -sp_between_ptr_star = remove -sp_after_ptr_star = remove -sp_after_ptr_star_func = add -sp_before_ptr_star_func = add -sp_before_sparen = add -sp_inside_sparen = remove -sp_inside_sparen_close = remove -sp_after_sparen = add -sp_sparen_brace = add -sp_special_semi = remove -sp_before_semi_for = remove -sp_after_comma = add -sp_after_cast = remove -sp_inside_braces_struct = add -sp_type_func = remove -sp_func_def_paren = remove -sp_inside_fparen = remove -sp_fparen_brace = add -sp_func_call_paren = remove -sp_else_brace = add -sp_after_oc_block_caret = remove -align_keep_tabs = true -align_with_tabs = true -align_on_tabstop = true -nl_fcall_brace = remove -nl_enum_brace = remove -nl_struct_brace = remove -nl_union_brace = remove -nl_if_brace = remove -nl_brace_else = remove -nl_elseif_brace = remove -nl_else_brace = remove -nl_else_if = remove -nl_for_brace = remove -sp_after_semi_for_empty = remove -nl_while_brace = remove -nl_do_brace = remove -nl_brace_while = remove -nl_switch_brace = remove -nl_func_type_name = add -nl_fdef_brace = add -mod_paren_on_return = ignore diff --git a/lib/monkey/mk_core/deps/libevent/CMakeLists.txt b/lib/monkey/mk_core/deps/libevent/CMakeLists.txt index 7a839decf14..d3d77770752 100644 --- a/lib/monkey/mk_core/deps/libevent/CMakeLists.txt +++ b/lib/monkey/mk_core/deps/libevent/CMakeLists.txt @@ -18,41 +18,47 @@ # cmake -G "Visual Studio 10" .. # start libevent.sln # -if (WIN32) - cmake_minimum_required(VERSION 3.1 FATAL_ERROR) -else() - cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR) + +cmake_minimum_required(VERSION 3.15 FATAL_ERROR) + +if (POLICY CMP0074) + cmake_policy(SET CMP0074 NEW) +endif() +if (POLICY CMP0075) + cmake_policy(SET CMP0075 NEW) +endif() +if (POLICY CMP0090) + cmake_policy(SET CMP0090 NEW) endif() if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release - CACHE STRING "Set build type to Debug o Release (default Release)" FORCE) + CACHE STRING "Set build type to Debug or Release (default Release)" FORCE) + message(STATUS "Set CMAKE_BUILD_TYPE to Release (default)") endif() string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER) -# get rid of the extra default configurations -# what? why would you get id of other useful build types? - Ellzey -set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Limited configurations" FORCE) +set(EVENT__LIBRARY_TYPE DEFAULT CACHE STRING + "Set library type to SHARED/STATIC/BOTH (default SHARED for MSVC, otherwise BOTH)") project(libevent C) -set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/") +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/") string(REGEX MATCH "SunOS" SOLARIS "${CMAKE_SYSTEM_NAME}") include(CheckTypeSize) -include(CheckFunctionExistsEx) include(CheckFileOffsetBits) -include(CheckFunctionExists) -include(CheckIncludeFile) -include(CheckIncludeFiles) +include(Macros) include(CheckVariableExists) include(CheckSymbolExists) include(CheckStructHasMember) include(CheckCSourceCompiles) include(CheckPrototypeDefinition) include(CheckFunctionKeywords) +include(CheckConstExists) include(AddCompilerFlags) +include(AddLinkerFlags) include(VersionViaGit) event_fuzzy_version_from_git() @@ -73,37 +79,43 @@ set(EVENT_ABI_LIBVERSION set(EVENT_PACKAGE_VERSION "${EVENT_VERSION_MAJOR}.${EVENT_VERSION_MINOR}.${EVENT_VERSION_PATCH}") -set(EVENT_NUMERIC_VERSION 0x02010700) +# equals to VERSION_INFO in Makefile.am +set(EVENT_ABI_LIBVERSION_CURRENT 1) +set(EVENT_ABI_LIBVERSION_REVISION 1) +set(EVENT_ABI_LIBVERSION_AGE 0) + +# equals to RELEASE in Makefile.am +set(EVENT_PACKAGE_RELEASE 2.2) + +# The last number is development version or not. +set(EVENT_NUMERIC_VERSION 0x02020200) # only a subset of names can be used, defaults to "beta" -set(EVENT_STAGE_NAME ${EVENT_VERSION_STAGE} - CACHE STRING "set the stage name (beta|alpha|release)") +set(EVENT_STAGE_NAME ${EVENT_VERSION_STAGE}) # a list that defines what can set for EVENT_STAGE_VERSION set(EVENT__ALLOWED_STAGE_NAMES - rc - beta - alpha - release) - -# attempt to find the EVENT__STAGE_VERSION in the allowed list -# of accepted stage names, the return value is stord in -# EVENT__STAGE_RET - -list(FIND EVENT__ALLOWED_STAGE_NAMES - ${EVENT_STAGE_NAME} - EVENT__STAGE_RET) - -if (EVENT__STAGE_RET EQUAL "-1") + rc + beta + alpha + alpha-dev + release + stable +) +list( + FIND EVENT__ALLOWED_STAGE_NAMES + "${EVENT_STAGE_NAME}" + EVENT__STAGE_RET +) +if (EVENT__STAGE_RET EQUAL -1) + message(WARNING + "stage ${EVENT_STAGE_NAME} is not allowed, reset to beta") set(EVENT_STAGE_NAME beta) endif() set(EVENT_VERSION "${EVENT_VERSION_MAJOR}.${EVENT_VERSION_MINOR}.${EVENT_VERSION_PATCH}-${EVENT_STAGE_NAME}") -option(EVENT__BUILD_SHARED_LIBRARIES - "Define if libevent should be built with shared libraries instead of archives" OFF) - option(EVENT__DISABLE_DEBUG_MODE "Define if libevent should build without support for a debug mode" OFF) @@ -116,11 +128,16 @@ option(EVENT__DISABLE_MM_REPLACEMENT option(EVENT__DISABLE_THREAD_SUPPORT "Define if libevent should not be compiled with thread support" OFF) -option(EVENT__DISABLE_OPENSSL - "Define if libevent should build without support for OpenSSL encrpytion" OFF) +set(EVENT__DISABLE_OPENSSL AUTO CACHE STRING + "OpenSSL library support: AUTO (use if present), ON (ignore), OFF (require presence)") +set_property(CACHE EVENT__DISABLE_OPENSSL PROPERTY STRINGS AUTO ON OFF) + +set(EVENT__DISABLE_MBEDTLS AUTO CACHE STRING + "Mbed TLS library support: AUTO (use if present), ON (ignore), OFF (require presence)") +set_property(CACHE EVENT__DISABLE_MBEDTLS PROPERTY STRINGS AUTO ON OFF) option(EVENT__DISABLE_BENCHMARK - "Defines if libevent should build without the benchmark exectuables" OFF) + "Defines if libevent should build without the benchmark executables" OFF) option(EVENT__DISABLE_TESTS "If tests should be compiled or not" OFF) @@ -135,7 +152,7 @@ option(EVENT__DISABLE_CLOCK_GETTIME "Do not use clock_gettime even if it is available" OFF) option(EVENT__FORCE_KQUEUE_CHECK - "When crosscompiling forces running a test program that verifies that Kqueue works with pipes. Note that this requires you to manually run the test program on the the cross compilation target to verify that it works. See cmake documentation for try_run for more details" OFF) + "When crosscompiling forces running a test program that verifies that Kqueue works with pipes. Note that this requires you to manually run the test program on the cross compilation target to verify that it works. See cmake documentation for try_run for more details" OFF) # TODO: Add --disable-largefile omit support for large files option(EVENT__COVERAGE @@ -143,14 +160,53 @@ option(EVENT__COVERAGE # Put the libaries and binaries that get built into directories at the # top of the build tree rather than in hard-to-find leaf directories. -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) +# +# But only if this variables are not defined yet +# (i.e. libevent is used via add_subdirectory()) +if (NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) +endif() +if (NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) +endif() +if (NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) +endif() + +include(GNUInstallDirs) + +# The RPATH to be used when installing, but only if it's not a system directory +# +# Refs: https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling +macro(Configure_RPATH) + # NOTE: that CMAKE_INSTALL_FULL_LIBDIR not always normalized correctly, i.e.: + # - "///" -> "/" + # - "/////usr///" -> "//usr" + # So it should be normalized again. + get_filename_component(CMAKE_INSTALL_LIBDIR_NORMALIZED "${CMAKE_INSTALL_FULL_LIBDIR}" REALPATH) + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_LIBDIR_NORMALIZED}" isSystemDir) + + if(DEFINED CMAKE_INSTALL_RPATH) + message(STATUS "CMAKE_INSTALL_RPATH already set") + elseif("${isSystemDir}" STREQUAL "-1") + set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR_NORMALIZED}") + else() + message(STATUS "Detected install to system directory") + endif() +endmacro() +Configure_RPATH() if (EVENT__ENABLE_VERBOSE_DEBUG) add_definitions(-DUSE_DEBUG=1) endif() +add_linker_flags(-Wl,-z,max-page-size=16384) + +# make it colorful under ninja-build +if ("${CMAKE_GENERATOR}" STREQUAL "Ninja") + add_compiler_flags(-fdiagnostics-color=always) +endif() + # Setup compiler flags for coverage. if (EVENT__COVERAGE) if (NOT "${CMAKE_BUILD_TYPE_LOWER}" STREQUAL "debug") @@ -159,19 +215,121 @@ if (EVENT__COVERAGE) message(STATUS "Setting coverage compiler flags") - set(CMAKE_REQUIRED_LIBRARIES "--coverage") + list(APPEND CMAKE_REQUIRED_LIBRARIES "--coverage") add_compiler_flags(-g -O0 --coverage) - set(CMAKE_REQUIRED_LIBRARIES "") + list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "--coverage") endif() -# GCC specific options. -if (CMAKE_COMPILER_IS_GNUCC) +set(GNUC 0) +set(CLANG 0) +set(MSVC 0) +if (("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") OR + ("${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")) + set(CLANG 1) +endif() +if (("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR (${CLANG})) + set(GNUC 1) +endif() +if (("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) + set(MSVC 1) +endif() + +# Detect library type +set(EVENT_LIBRARY_TYPE) +if ("${EVENT__LIBRARY_TYPE}" STREQUAL "DEFAULT") + if (${MSVC}) + set(EVENT_LIBRARY_TYPE SHARED) + else() + set(EVENT_LIBRARY_TYPE BOTH) + endif() +else() + string(TOUPPER "${EVENT__LIBRARY_TYPE}" EVENT_LIBRARY_TYPE) +endif() +if ((${MSVC}) AND ("${EVENT_LIBRARY_TYPE}" STREQUAL "BOTH")) + message(WARNING + "Building SHARED and STATIC is not supported for MSVC " + "(due to conflicts in library name" + " between STATIC library and IMPORTED library for SHARED libraries)") +endif() +set(EVENT_LIBRARY_STATIC OFF) +set(EVENT_LIBRARY_SHARED OFF) +if ("${EVENT_LIBRARY_TYPE}" STREQUAL "BOTH") + set(EVENT_LIBRARY_STATIC ON) + set(EVENT_LIBRARY_SHARED ON) +elseif ("${EVENT_LIBRARY_TYPE}" STREQUAL "STATIC") + set(EVENT_LIBRARY_STATIC ON) +elseif ("${EVENT_LIBRARY_TYPE}" STREQUAL "SHARED") + set(EVENT_LIBRARY_SHARED ON) +else() + message(FATAL_ERROR "${EVENT_LIBRARY_TYPE} is not supported") +endif() + +# brew support +if (APPLE) + find_program(BREW brew) +endif() + +if (${MSVC}) + set(msvc_static_runtime OFF) + if ("${EVENT_LIBRARY_TYPE}" STREQUAL "STATIC") + set(msvc_static_runtime ON) + endif() + + # For more info: + # - https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=vs-2017 + # - https://gitlab.kitware.com/cmake/community/wikis/FAQ#how-can-i-build-my-msvc-application-with-a-static-runtime + option(EVENT__MSVC_STATIC_RUNTIME + "Link static runtime libraries" + ${msvc_static_runtime}) + + if (EVENT__MSVC_STATIC_RUNTIME) + cmake_policy(SET CMP0091 NEW) + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + endif() +endif() + +# GNUC specific options. +if (${GNUC}) option(EVENT__DISABLE_GCC_WARNINGS "Disable verbose warnings with GCC" OFF) option(EVENT__ENABLE_GCC_HARDENING "Enable compiler security checks" OFF) option(EVENT__ENABLE_GCC_FUNCTION_SECTIONS "Enable gcc function sections" OFF) option(EVENT__ENABLE_GCC_WARNINGS "Make all GCC warnings into errors" OFF) - list(APPEND __FLAGS -Wall -Wswitch) + list(APPEND __FLAGS + -Wall -Wextra -Wno-unused-parameter -Wstrict-aliasing -Wstrict-prototypes + -Wundef + + -fno-strict-aliasing # gcc 2.9.5+ + -Wmissing-prototypes + + # gcc 4 + -Winit-self + -Wmissing-field-initializers + -Wdeclaration-after-statement + + # gcc 4.2 + -Waddress + -Wnormalized=id + -Woverride-init + + # gcc 4.5 + -Wlogical-op + + -Wwrite-strings + + # Disable unused-function warnings. These trigger for minheap-internal.h. + -Wno-unused-function + + -Wno-pragmas + + -Wvla + ) + + if (${CLANG}) + list(APPEND __FLAGS + # we use this hack in tests + -Wno-void-pointer-to-enum-cast) + endif() if (EVENT__DISABLE_GCC_WARNINGS) list(APPEND __FLAGS -w) @@ -185,7 +343,7 @@ if (CMAKE_COMPILER_IS_GNUCC) -Wstack-protector "--param ssp-buffer-size=1") - add_definitions(-D_FORTIFY_SOURCE=2) + add_definitions(-D_FORTIFY_SOURCE=3) endif() if (EVENT__ENABLE_GCC_FUNCTION_SECTIONS) @@ -197,161 +355,252 @@ if (CMAKE_COMPILER_IS_GNUCC) list(APPEND __FLAGS -Werror) endif() - # We need to test for at least gcc 2.95 here, because older versions don't - # have -fno-strict-aliasing - list(APPEND __FLAGS -fno-strict-aliasing) - add_compiler_flags(${__FLAGS}) endif() if (APPLE) - # Get rid of deprecated warnings for OpenSSL on OSX 10.7 and greater. + # Clang on macOS emits warnings for each directory specified which isn't used add_compiler_flags( - -Wno-error=deprecated-declarations -Qunused-arguments ) endif() +if (MINGW OR CYGWIN) + set(WIN32 TRUE) +endif() + # Winsock. if(WIN32) - set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h ws2tcpip.h) - set(CMAKE_REQUIRED_LIBRARIES ws2_32.lib) - set(CMAKE_REQUIRED_DEFINITIONS -FIwinsock2.h -FIws2tcpip.h) + list(APPEND CMAKE_REQUIRED_LIBRARIES + ws2_32 + shell32 + advapi32 + bcrypt + ) + set(CMAKE_REQUIRED_DEFINITIONS -FIwinsock2.h -FIws2tcpip.h -D_WIN32_WINNT=0x0600) endif() if (SOLARIS) - set(CMAKE_REQUIRED_LIBRARIES socket nsl) + list(APPEND CMAKE_REQUIRED_LIBRARIES + socket + nsl + ) endif() # Check if _GNU_SOURCE is available. -CHECK_SYMBOL_EXISTS(__GNU_LIBRARY__ "features.h" _GNU_SOURCE) +if (NOT DEFINED _GNU_SOURCE) + CHECK_SYMBOL_EXISTS(__GNU_LIBRARY__ "features.h" _GNU_SOURCE) + + if (NOT _GNU_SOURCE) + unset(_GNU_SOURCE CACHE) + CHECK_SYMBOL_EXISTS(_GNU_SOURCE "features.h" _GNU_SOURCE) + endif() + + if (ANDROID) + set(_GNU_SOURCE TRUE) + endif() +endif() if (_GNU_SOURCE) - add_definitions(-D_GNU_SOURCE) -endif() - -CHECK_INCLUDE_FILE(sys/types.h EVENT__HAVE_SYS_TYPES_H) -if(EVENT__HAVE_SYS_TYPES_H) - list(APPEND CMAKE_EXTRA_INCLUDE_FILES sys/types.h) -endif() - -CHECK_INCLUDE_FILE(sys/socket.h EVENT__HAVE_SYS_SOCKET_H) -if(EVENT__HAVE_SYS_SOCKET_H) - list(APPEND CMAKE_EXTRA_INCLUDE_FILES sys/socket.h) -endif() - -CHECK_INCLUDE_FILE(netinet/in.h EVENT__HAVE_NETINET_IN_H) -if(EVENT__HAVE_NETINET_IN_H) - list(APPEND CMAKE_EXTRA_INCLUDE_FILES netinet/in.h) -endif() - -CHECK_INCLUDE_FILE(netinet/in6.h EVENT__HAVE_NETINET_IN6_H) -if(EVENT__HAVE_NETINET_IN6_H) - list(APPEND CMAKE_EXTRA_INCLUDE_FILES netinet/in6.h) -endif() - -CHECK_INCLUDE_FILE(unistd.h EVENT__HAVE_UNISTD_H) -CHECK_INCLUDE_FILE(netdb.h EVENT__HAVE_NETDB_H) -CHECK_INCLUDE_FILE(dlfcn.h EVENT__HAVE_DLFCN_H) -CHECK_INCLUDE_FILE(arpa/inet.h EVENT__HAVE_ARPA_INET_H) -CHECK_INCLUDE_FILE(fcntl.h EVENT__HAVE_FCNTL_H) -if(EVENT__HAVE_FCNTL_H) - list(APPEND CMAKE_EXTRA_INCLUDE_FILES fcntl.h) -endif() -CHECK_INCLUDE_FILE(inttypes.h EVENT__HAVE_INTTYPES_H) -CHECK_INCLUDE_FILE(memory.h EVENT__HAVE_MEMORY_H) -CHECK_INCLUDE_FILE(poll.h EVENT__HAVE_POLL_H) -CHECK_INCLUDE_FILE(port.h EVENT__HAVE_PORT_H) -if(EVENT__HAVE_PORT_H) - list(APPEND CMAKE_EXTRA_INCLUDE_FILES port.h) -endif() -CHECK_INCLUDE_FILE(signal.h EVENT__HAVE_SIGNAL_H) -CHECK_INCLUDE_FILE(stdarg.h EVENT__HAVE_STDARG_H) -CHECK_INCLUDE_FILE(stddef.h EVENT__HAVE_STDDEF_H) -CHECK_INCLUDE_FILE(stdint.h EVENT__HAVE_STDINT_H) -CHECK_INCLUDE_FILE(stdlib.h EVENT__HAVE_STDLIB_H) -CHECK_INCLUDE_FILE(strings.h EVENT__HAVE_STRINGS_H) -CHECK_INCLUDE_FILE(string.h EVENT__HAVE_STRING_H) -CHECK_INCLUDE_FILE(sys/devpoll.h EVENT__HAVE_SYS_DEVPOLL_H) -CHECK_INCLUDE_FILE(sys/epoll.h EVENT__HAVE_SYS_EPOLL_H) -CHECK_INCLUDE_FILE(sys/eventfd.h EVENT__HAVE_SYS_EVENTFD_H) -CHECK_INCLUDE_FILE(sys/event.h EVENT__HAVE_SYS_EVENT_H) -CHECK_INCLUDE_FILE(sys/ioctl.h EVENT__HAVE_SYS_IOCTL_H) -CHECK_INCLUDE_FILE(sys/mman.h EVENT__HAVE_SYS_MMAN_H) -CHECK_INCLUDE_FILE(sys/param.h EVENT__HAVE_SYS_PARAM_H) -CHECK_INCLUDE_FILE(sys/queue.h EVENT__HAVE_SYS_QUEUE_H) -CHECK_INCLUDE_FILE(sys/select.h EVENT__HAVE_SYS_SELECT_H) -CHECK_INCLUDE_FILE(sys/sendfile.h EVENT__HAVE_SYS_SENDFILE_H) -CHECK_INCLUDE_FILE(sys/stat.h EVENT__HAVE_SYS_STAT_H) -CHECK_INCLUDE_FILE(sys/time.h EVENT__HAVE_SYS_TIME_H) -if(EVENT__HAVE_SYS_TIME_H) - list(APPEND CMAKE_EXTRA_INCLUDE_FILES sys/time.h) -endif() -CHECK_INCLUDE_FILE(sys/uio.h EVENT__HAVE_SYS_UIO_H) -CHECK_INCLUDE_FILES("sys/types.h;ifaddrs.h" EVENT__HAVE_IFADDRS_H) -CHECK_INCLUDE_FILE(mach/mach_time.h EVENT__HAVE_MACH_MACH_TIME_H) -CHECK_INCLUDE_FILE(netinet/tcp.h EVENT__HAVE_NETINET_TCP_H) -CHECK_INCLUDE_FILE(sys/wait.h EVENT__HAVE_SYS_WAIT_H) -CHECK_INCLUDE_FILE(sys/resource.h EVENT__HAVE_SYS_RESOURCE_H) -CHECK_INCLUDE_FILE(sys/sysctl.h EVENT__HAVE_SYS_SYSCTL_H) -CHECK_INCLUDE_FILE(sys/timerfd.h EVENT__HAVE_SYS_TIMERFD_H) -CHECK_INCLUDE_FILE(errno.h EVENT__HAVE_ERRNO_H) - - -CHECK_FUNCTION_EXISTS_EX(epoll_create EVENT__HAVE_EPOLL) -CHECK_FUNCTION_EXISTS_EX(epoll_ctl EVENT__HAVE_EPOLL_CTL) -CHECK_FUNCTION_EXISTS_EX(eventfd EVENT__HAVE_EVENTFD) -if(NOT EVENT__DISABLE_CLOCK_GETTIME) - CHECK_FUNCTION_EXISTS_EX(clock_gettime EVENT__HAVE_CLOCK_GETTIME) -endif() -CHECK_FUNCTION_EXISTS_EX(fcntl EVENT__HAVE_FCNTL) -CHECK_FUNCTION_EXISTS_EX(getaddrinfo EVENT__HAVE_GETADDRINFO) -CHECK_FUNCTION_EXISTS_EX(getnameinfo EVENT__HAVE_GETNAMEINFO) -CHECK_FUNCTION_EXISTS_EX(gettimeofday EVENT__HAVE_GETTIMEOFDAY) -CHECK_FUNCTION_EXISTS_EX(getprotobynumber EVENT__HAVE_GETPROTOBYNUMBER) -CHECK_FUNCTION_EXISTS_EX(getservbyname EVENT__HAVE_GETSERVBYNAME) -CHECK_FUNCTION_EXISTS_EX(inet_ntop EVENT__HAVE_INET_NTOP) -CHECK_FUNCTION_EXISTS_EX(inet_pton EVENT__HAVE_INET_PTON) -CHECK_FUNCTION_EXISTS_EX(kqueue EVENT__HAVE_KQUEUE) -CHECK_FUNCTION_EXISTS_EX(mmap EVENT__HAVE_MMAP) -CHECK_FUNCTION_EXISTS_EX(pipe EVENT__HAVE_PIPE) -CHECK_FUNCTION_EXISTS_EX(pipe2 EVENT__HAVE_PIPE2) -CHECK_FUNCTION_EXISTS_EX(poll EVENT__HAVE_POLL) -CHECK_FUNCTION_EXISTS_EX(port_create EVENT__HAVE_PORT_CREATE) -CHECK_FUNCTION_EXISTS_EX(sendfile EVENT__HAVE_SENDFILE) -CHECK_FUNCTION_EXISTS_EX(sigaction EVENT__HAVE_SIGACTION) -CHECK_FUNCTION_EXISTS_EX(signal EVENT__HAVE_SIGNAL) -CHECK_FUNCTION_EXISTS_EX(splice EVENT__HAVE_SPLICE) -CHECK_FUNCTION_EXISTS_EX(strlcpy EVENT__HAVE_STRLCPY) -CHECK_FUNCTION_EXISTS_EX(strsep EVENT__HAVE_STRSEP) -CHECK_FUNCTION_EXISTS_EX(strtok_r EVENT__HAVE_STRTOK_R) -CHECK_FUNCTION_EXISTS_EX(strtoll EVENT__HAVE_STRTOLL) -CHECK_FUNCTION_EXISTS_EX(vasprintf EVENT__HAVE_VASPRINTF) -CHECK_FUNCTION_EXISTS_EX(sysctl EVENT__HAVE_SYSCTL) -CHECK_FUNCTION_EXISTS_EX(accept4 EVENT__HAVE_ACCEPT4) -CHECK_FUNCTION_EXISTS_EX(arc4random EVENT__HAVE_ARC4RANDOM) -CHECK_FUNCTION_EXISTS_EX(arc4random_buf EVENT__HAVE_ARC4RANDOM_BUF) -CHECK_FUNCTION_EXISTS_EX(epoll_create1 EVENT__HAVE_EPOLL_CREATE1) -CHECK_FUNCTION_EXISTS_EX(getegid EVENT__HAVE_GETEGID) -CHECK_FUNCTION_EXISTS_EX(geteuid EVENT__HAVE_GETEUID) -CHECK_FUNCTION_EXISTS_EX(getifaddrs EVENT__HAVE_GETIFADDRS) -CHECK_FUNCTION_EXISTS_EX(issetugid EVENT__HAVE_ISSETUGID) -CHECK_FUNCTION_EXISTS_EX(mach_absolute_time EVENT__HAVE_MACH_ABSOLUTE_TIME) -CHECK_FUNCTION_EXISTS_EX(nanosleep EVENT__HAVE_NANOSLEEP) -CHECK_FUNCTION_EXISTS_EX(usleep EVENT__HAVE_USLEEP) -CHECK_FUNCTION_EXISTS_EX(timeradd EVENT__HAVE_TIMERADD) -CHECK_FUNCTION_EXISTS_EX(timerclear EVENT__HAVE_TIMERCLEAR) -CHECK_FUNCTION_EXISTS_EX(timercmp EVENT__HAVE_TIMERCMP) -CHECK_FUNCTION_EXISTS_EX(timerfd_create HAVE_TIMERFD_CREATE) -CHECK_FUNCTION_EXISTS_EX(timerisset EVENT__HAVE_TIMERISSET) -CHECK_FUNCTION_EXISTS_EX(putenv EVENT__HAVE_PUTENV) -CHECK_FUNCTION_EXISTS_EX(setenv EVENT__HAVE_SETENV) -CHECK_FUNCTION_EXISTS_EX(setrlimit EVENT__HAVE_SETRLIMIT) -CHECK_FUNCTION_EXISTS_EX(umask EVENT__HAVE_UMASK) -CHECK_FUNCTION_EXISTS_EX(unsetenv EVENT__HAVE_UNSETENV) + set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE) +endif() -# Get the gethostbyname_r prototype. -CHECK_FUNCTION_EXISTS_EX(gethostbyname_r EVENT__HAVE_GETHOSTBYNAME_R) +# Check if header files exist +list(APPEND FILES_TO_CHECK + fcntl.h + inttypes.h + memory.h + signal.h + stdarg.h + stddef.h + stdint.h + stdlib.h + string.h + errno.h + unistd.h + time.h + sys/types.h + sys/stat.h + sys/time.h + sys/param.h +) +if (WIN32) + list(APPEND FILES_TO_CHECK + io.h + winsock2.h + ws2tcpip.h + afunix.h + bcrypt.h + ) +else() + list(APPEND FILES_TO_CHECK + netdb.h + dlfcn.h + arpa/inet.h + poll.h + port.h + sys/auxv.h + sys/socket.h + sys/random.h + sys/un.h + sys/devpoll.h + sys/epoll.h + sys/eventfd.h + sys/event.h + sys/ioctl.h + sys/mman.h + sys/queue.h + sys/tree.h + sys/select.h + sys/sendfile.h + sys/uio.h + sys/wait.h + sys/resource.h + sys/timerfd.h + sys/signalfd.h + netinet/in.h + netinet/in6.h + netinet/tcp.h + ifaddrs.h + ) +endif() + +if (NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux") + list(APPEND FILES_TO_CHECK sys/sysctl.h) +endif() + +if (APPLE) + list(APPEND FILES_TO_CHECK + mach/mach_time.h + mach/mach.h + ) +endif() +if (NOT EVENT__DISABLE_THREAD_SUPPORT AND NOT WIN32) + list(APPEND FILES_TO_CHECK pthread.h) + # (Only `CHECK_TYPE_SIZE()' will use `CMAKE_EXTRA_INCLUDE_FILES') + list(APPEND CMAKE_EXTRA_INCLUDE_FILES pthread.h) +endif() + +# Fills EVENT_INCLUDES +foreach(FILE ${FILES_TO_CHECK}) + CHECK_INCLUDE_FILE_CONCAT(${FILE} "EVENT") +endforeach() +unset(FILES_TO_CHECK) + +# Check if functions exist +list(APPEND SYMBOLS_TO_CHECK + getaddrinfo + gethostbyname + getnameinfo + getprotobynumber + getservbyname + gettimeofday + inet_ntop + inet_pton + nanosleep + putenv + signal + socketpair + strlcpy + strndup + strsep + strtok_r + strtoll + timeradd + timerclear + timerisset + umask +) +if (NOT EVENT__DISABLE_CLOCK_GETTIME) + list(APPEND SYMBOLS_TO_CHECK clock_gettime) +endif() + +if (WIN32) + list(APPEND SYMBOLS_TO_CHECK + _gmtime64 + _gmtime64_s + BCryptGenRandom + ) +else() + list(APPEND SYMBOLS_TO_CHECK + accept4 + arc4random + arc4random_buf + arc4random_stir + epoll_create + epoll_create1 + epoll_ctl + epoll_pwait2 + eventfd + fcntl + getegid + geteuid + gethostbyname_r + getifaddrs + getrandom + issetugid + kqueue + mmap + mmap64 + pipe + pipe2 + poll + port_create + pread + select + sendfile + setenv + setrlimit + sigaction + strsignal + sysctl + timerfd_create + unsetenv + usleep + ) + if (APPLE) + list(APPEND SYMBOLS_TO_CHECK mach_absolute_time) + endif() +endif() + +set(PTHREADS_AVAILABLE OFF) +if (NOT EVENT__DISABLE_THREAD_SUPPORT) + if (WIN32) + list(APPEND SRC_CORE evthread_win32.c) + elseif(ANDROID) + # pthreads is built in to bionic + set(EVENT__HAVE_PTHREADS 1) + CHECK_TYPE_SIZE(pthread_t EVENT__SIZEOF_PTHREAD_T) + list(APPEND SYMBOLS_TO_CHECK pthread_mutexattr_setprotocol) + set(PTHREADS_AVAILABLE ON) + else() + find_package(Threads REQUIRED) + if (NOT CMAKE_USE_PTHREADS_INIT) + message(FATAL_ERROR + "Failed to find Pthreads, set EVENT__DISABLE_THREAD_SUPPORT to disable") + endif() + set(PTHREADS_AVAILABLE ON) + + set(EVENT__HAVE_PTHREADS 1) + # for CHECK_SYMBOLS_EXIST() + list(APPEND CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) + list(APPEND LIB_APPS Threads::Threads) + + CHECK_TYPE_SIZE(pthread_t EVENT__SIZEOF_PTHREAD_T) + list(APPEND SYMBOLS_TO_CHECK pthread_mutexattr_setprotocol) + endif() +endif() + +list(APPEND CMAKE_EXTRA_INCLUDE_FILES ${EVENT_INCLUDES} stdio.h) +CHECK_SYMBOLS_EXIST("${SYMBOLS_TO_CHECK}" "${CMAKE_EXTRA_INCLUDE_FILES}" "EVENT") +unset(SYMBOLS_TO_CHECK) +set(EVENT__HAVE_EPOLL ${EVENT__HAVE_EPOLL_CREATE}) +set(EVENT__HAVE_SIGNALFD ${EVENT__HAVE_SYS_SIGNALFD_H}) +if(WIN32 AND NOT CYGWIN) + set(EVENT__HAVE_WEPOLL 1) +endif() + +# Get the gethostbyname_r prototype. if(EVENT__HAVE_GETHOSTBYNAME_R) CHECK_PROTOTYPE_DEFINITION(gethostbyname_r "int gethostbyname_r(const char *name, struct hostent *hp, struct hostent_data *hdata)" @@ -376,10 +625,7 @@ if(HAVE_PORT_H AND HAVE_PORT_CREATE) set(EVENT__HAVE_EVENT_PORTS 1) endif() -if(NOT WIN32) - CHECK_FUNCTION_EXISTS_EX(select EVENT__HAVE_SELECT) -endif() - +CHECK_TYPE_SIZE("struct sockaddr_un" EVENT__HAVE_STRUCT_SOCKADDR_UN) CHECK_TYPE_SIZE("uint8_t" EVENT__HAVE_UINT8_T) CHECK_TYPE_SIZE("uint16_t" EVENT__HAVE_UINT16_T) CHECK_TYPE_SIZE("uint32_t" EVENT__HAVE_UINT32_T) @@ -402,7 +648,7 @@ endif() check_function_keywords("inline" "__inline" "__inline__") if (HAVE_INLINE) - set (EVENT__inline inline) + set(EVENT__inline inline) elseif (HAVE___INLINE) set(EVENT__inline __inline) elseif(HAVE___INLINE__) @@ -411,21 +657,19 @@ else() set(EVENT__inline) endif() -CHECK_SYMBOL_EXISTS(TAILQ_FOREACH sys/queue.h EVENT__HAVE_TAILQFOREACH) -CHECK_SYMBOL_EXISTS(CTL_KERN sys/sysctl.h EVENT__HAVE_DECL_CTL_KERN) -CHECK_SYMBOL_EXISTS(KERN_ARND sys/sysctl.h EVENT__HAVE_DECL_KERN_ARND) -CHECK_SYMBOL_EXISTS(KERN_RANDOM sys/sysctl.h EVENT__HAVE_DECL_KERN_RANDOM) -CHECK_SYMBOL_EXISTS(RANDOM_UUID sys/sysctl.h EVENT__HAVE_DECL_RANDOM_UUID) +# __func__/__FUNCTION__ is not a macros in general +CHECK_SYMBOL_EXISTS("__func__" "" EVENT__HAVE___func__) +CHECK_SYMBOL_EXISTS("__FUNCTION__" "" EVENT__HAVE___FUNCTION__) + +CHECK_CONST_EXISTS(CTL_KERN sys/sysctl.h EVENT__HAVE_DECL_CTL_KERN) +CHECK_CONST_EXISTS(KERN_ARND sys/sysctl.h EVENT__HAVE_DECL_KERN_ARND) CHECK_SYMBOL_EXISTS(F_SETFD fcntl.h EVENT__HAVE_SETFD) CHECK_TYPE_SIZE(fd_mask EVENT__HAVE_FD_MASK) -CHECK_TYPE_SIZE(size_t EVENT__SIZEOF_SIZEE_T) +CHECK_TYPE_SIZE(size_t EVENT__SIZEOF_SIZE_T) if(NOT EVENT__SIZEOF_SIZE_T) - set(EVENT__size_t "unsigned") set(EVENT__SIZEOF_SIZE_T ${EVENT__SIZEOF_UNSIGNED}) -else() - set(EVENT__size_t size_t) endif() CHECK_TYPE_SIZE("off_t" EVENT__SIZEOF_OFF_T LANGUAGE C) @@ -442,16 +686,12 @@ CHECK_TYPE_SIZE("SSIZE_T" EVENT__SIZEOF_SSIZE_T_UPPER LANGUAGE C) if (EVENT__SIZEOF_SSIZE_T_LOWER) set(EVENT__ssize_t "ssize_t") - set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_SSIZE_T_LOWER}) elseif (EVENT__SIZEOF_SSIZE_T_UPPER) set(EVENT__ssize_t "SSIZE_T") - set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_SSIZE_T_UPPER}) else() set(EVENT__ssize_t "int") - set(EVENT__SIZEOF_SSIZE_T ${EVENT__SIZEOF_INT}) endif() - CHECK_TYPE_SIZE(socklen_t EVENT__SIZEOF_SOCKLEN_T) if(NOT EVENT__SIZEOF_SOCKLEN_T) set(EVENT__socklen_t "unsigned int") @@ -462,24 +702,15 @@ endif() CHECK_TYPE_SIZE(pid_t EVENT__SIZEOF_PID_T) if(NOT EVENT__SIZEOF_PID_T) - set(EVENT__pid_t "int") set(EVENT__SIZEOF_PID_T ${EVENT__SIZEOF_INT}) else() - set(EVENT__pid_t "pid_t") set(EVENT__SIZEOF_PID_T EVENT__SIZEOF_PID_T) endif() -if (NOT EVENT__DISABLE_THREAD_SUPPORT) - CHECK_TYPE_SIZE(pthread_t EVENT__SIZEOF_PTHREAD_T) -endif() - -if(EVENT__HAVE_CLOCK_GETTIME) - set(EVENT__DNS_USE_CPU_CLOCK_FOR_ID 1) -endif() - # we're just getting lazy now. CHECK_TYPE_SIZE("uintptr_t" EVENT__HAVE_UINTPTR_T) CHECK_TYPE_SIZE("void *" EVENT__SIZEOF_VOID_P) +CHECK_TYPE_SIZE("time_t" EVENT__SIZEOF_TIME_T) # Tests file offset bits. # TODO: Add AIX test for if -D_LARGE_FILES is needed. @@ -490,14 +721,16 @@ CHECK_TYPE_SIZE("void *" EVENT__SIZEOF_VOID_P) # - ellzey #CHECK_FILE_OFFSET_BITS() -#set(EVENT___FILE_OFFSET_BITS _FILE_OFFSET_BITS) - -include(CheckWaitpidSupportWNOWAIT) # Verify kqueue works with pipes. if (EVENT__HAVE_KQUEUE) if (CMAKE_CROSSCOMPILING AND NOT EVENT__FORCE_KQUEUE_CHECK) - message(WARNING "Cannot check if kqueue works with pipes when crosscompiling, use EVENT__FORCE_KQUEUE_CHECK to be sure (this requires manually running a test program on the cross compilation target)") + message(WARNING "Cannot check if kqueue works with pipes when crosscompiling. + Use EVENT__FORCE_KQUEUE_CHECK to be sure (this requires running a test program on the cross compilation target)") + set(EVENT__HAVE_WORKING_KQUEUE 1) + elseif (APPLE AND NOT EVENT__FORCE_KQUEUE_CHECK) + message(WARNING "Cannot check if kqueue works with pipes on macOS. + Use EVENT__FORCE_KQUEUE_CHECK to be sure (this requires running a test program).") set(EVENT__HAVE_WORKING_KQUEUE 1) else() message(STATUS "Checking if kqueue works with pipes...") @@ -505,10 +738,6 @@ if (EVENT__HAVE_KQUEUE) endif() endif() -CHECK_SYMBOL_EXISTS(_MINIX "stdio.h" EVENT___MINIX) -CHECK_SYMBOL_EXISTS(_POSIX_1_SOURCE "stdio.h" EVENT___POSIX_1_SOURCE) -CHECK_SYMBOL_EXISTS(_POSIX_SOURCE "stdio.h" EVENT___POSIX_SOURCE) - if(EVENT__HAVE_NETDB_H) list(APPEND CMAKE_EXTRA_INCLUDE_FILES netdb.h) CHECK_TYPE_SIZE("struct addrinfo" EVENT__HAVE_STRUCT_ADDRINFO) @@ -545,15 +774,6 @@ else() endif() CHECK_TYPE_SIZE("struct in6_addr" EVENT__HAVE_STRUCT_IN6_ADDR) -if(EVENT__HAVE_STRUCT_IN6_ADDR) - CHECK_STRUCT_HAS_MEMBER("struct in6_addr" - s6_addr16 "${SOCKADDR_HEADERS}" - EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16) - - CHECK_STRUCT_HAS_MEMBER("struct in6_addr" - s6_addr32 "${SOCKADDR_HEADERS}" - EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32) -endif() CHECK_TYPE_SIZE("sa_family_t" EVENT__HAVE_SA_FAMILY_T) CHECK_TYPE_SIZE("struct sockaddr_in6" EVENT__HAVE_STRUCT_SOCKADDR_IN6) @@ -578,6 +798,8 @@ if(EVENT__HAVE_STRUCT_SOCKADDR_STORAGE) __ss_family "${SOCKADDR_HEADERS}" EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY) endif() +CHECK_TYPE_SIZE("struct linger" EVENT__HAVE_STRUCT_LINGER) + # Group the source files. set(HDR_PRIVATE bufferevent-internal.h @@ -590,6 +812,7 @@ set(HDR_PRIVATE evrpc-internal.h evsignal-internal.h evthread-internal.h + evdns-internal.h ht-internal.h http-internal.h iocp-internal.h @@ -600,8 +823,11 @@ set(HDR_PRIVATE ratelim-internal.h strlcpy-internal.h util-internal.h + openssl-compat.h evconfig-private.h - compat/sys/queue.h) + sha1.h + compat/sys/queue.h + compat/sys/tree.h) set(HDR_COMPAT include/evdns.h @@ -622,6 +848,7 @@ set(HDR_PUBLIC include/event2/event.h include/event2/event_compat.h include/event2/event_struct.h + include/event2/watch.h include/event2/http.h include/event2/http_compat.h include/event2/http_struct.h @@ -634,10 +861,11 @@ set(HDR_PUBLIC include/event2/tag_compat.h include/event2/thread.h include/event2/util.h + include/event2/ws.h include/event2/visibility.h ${PROJECT_BINARY_DIR}/include/event2/event-config.h) -set(SRC_CORE +list(APPEND SRC_CORE buffer.c bufferevent.c bufferevent_filter.c @@ -650,6 +878,7 @@ set(SRC_CORE evutil.c evutil_rand.c evutil_time.c + watch.c listener.c log.c signal.c @@ -672,42 +901,93 @@ if(EVENT__HAVE_DEVPOLL) endif() if(EVENT__HAVE_EPOLL) - list(APPEND SRC_CORE epoll_sub.c epoll.c) + list(APPEND SRC_CORE epoll.c) +endif() + +if(EVENT__HAVE_SIGNALFD) + list(APPEND SRC_CORE signalfd.c) +endif() + +if(EVENT__HAVE_WEPOLL) + list(APPEND SRC_CORE + epoll.c + wepoll.c) endif() if(EVENT__HAVE_EVENT_PORTS) list(APPEND SRC_CORE evport.c) endif() -if (NOT EVENT__DISABLE_OPENSSL) - find_package(OpenSSL REQUIRED) +if (EVENT__DISABLE_OPENSSL STREQUAL "OFF" OR EVENT__DISABLE_OPENSSL STREQUAL "AUTO") + # only if OPENSSL_ROOT_DIR is not set yet + if (BREW AND NOT OPENSSL_ROOT_DIR AND NOT "$ENV{OPENSSL_ROOT_DIR}") + execute_process(COMMAND ${BREW} --prefix openssl + OUTPUT_VARIABLE BREW_OPENSSL_PREFIX + RESULT_VARIABLE BREW_OPENSSL_RESULT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if (BREW_OPENSSL_RESULT EQUAL 0) + message(STATUS "Set OPENSSL_ROOT_DIR=${BREW_OPENSSL_PREFIX} (from brew)") + set(OPENSSL_ROOT_DIR "${BREW_OPENSSL_PREFIX}" CACHE PATH "") + endif() + endif() - set(EVENT__HAVE_OPENSSL 1) + find_package(OpenSSL) - message(STATUS "OpenSSL include: ${OPENSSL_INCLUDE_DIR}") - message(STATUS "OpenSSL lib: ${OPENSSL_LIBRARIES}") + if (OPENSSL_FOUND) + set(EVENT__HAVE_OPENSSL 1) + set(OPENSSL_TARGETS OpenSSL::SSL) - include_directories(${OPENSSL_INCLUDE_DIR}) + message(STATUS "OpenSSL include: ${OPENSSL_INCLUDE_DIR}") + message(STATUS "OpenSSL lib: ${OPENSSL_LIBRARIES}") - list(APPEND SRC_CORE bufferevent_openssl.c) - list(APPEND HDR_PUBLIC include/event2/bufferevent_ssl.h) - list(APPEND LIB_APPS ${OPENSSL_LIBRARIES}) + list(APPEND SRC_OPENSSL bufferevent_openssl.c bufferevent_ssl.c) + list(APPEND HDR_PUBLIC include/event2/bufferevent_ssl.h) + list(APPEND LIB_APPS ${OPENSSL_TARGETS}) + elseif (EVENT__DISABLE_OPENSSL STREQUAL "OFF") + message(FATAL_ERROR "OpenSSL required, but not found.") + endif() +elseif (EVENT__DISABLE_OPENSSL STREQUAL "ON") + message(STATUS "Disable OpenSSL support") +else() + message(FATAL_ERROR "EVENT__DISABLE_OPENSSL must be set to one of: AUTO, ON or OFF. Got: ${EVENT__DISABLE_OPENSSL}") endif() -if (NOT EVENT__DISABLE_THREAD_SUPPORT) - if (WIN32) - list(APPEND SRC_CORE evthread_win32.c) - else() - find_package(Threads REQUIRED) - if (NOT CMAKE_USE_PTHREADS_INIT) - message(FATAL_ERROR - "Failed to find Pthreads, set EVENT__DISABLE_THREAD_SUPPORT to disable") +if (EVENT__DISABLE_MBEDTLS STREQUAL "OFF" OR EVENT__DISABLE_MBEDTLS STREQUAL "AUTO") + # only if MBEDTLS_ROOT_DIR is not set yet + if (BREW AND NOT MBEDTLS_ROOT_DIR AND NOT "$ENV{MBEDTLS_ROOT_DIR}") + execute_process(COMMAND ${BREW} --prefix mbedtls + OUTPUT_VARIABLE BREW_MBEDTLS_PREFIX + RESULT_VARIABLE BREW_MBEDTLS_RESULT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if (BREW_MBEDTLS_RESULT EQUAL 0) + message(STATUS "Set MBEDTLS_ROOT_DIR=${BREW_MBEDTLS_PREFIX} (from brew)") + set(MBEDTLS_ROOT_DIR "${BREW_MBEDTLS_PREFIX}" CACHE PATH "") endif() + endif() - set(EVENT__HAVE_PTHREADS 1) - list(APPEND SRC_CORE evthread_pthread.c) - list(APPEND LIB_APPS ${CMAKE_THREAD_LIBS_INIT}) + find_package(MbedTLS) + + if (MBEDTLS_FOUND) + set(EVENT__HAVE_MBEDTLS 1) + set(MBEDTLS_TARGETS MbedTLS::mbedtls MbedTLS::mbedcrypto MbedTLS::mbedx509) + + message(STATUS "mbed TLS include: ${MBEDTLS_INCLUDE_DIR}") + message(STATUS "mbed TLS lib: ${MBEDTLS_LIBRARIES}") + + list(APPEND SRC_MBEDTLS bufferevent_mbedtls.c bufferevent_ssl.c) + list(APPEND HDR_PUBLIC include/event2/bufferevent_ssl.h) + list(APPEND LIB_APPS ${MBEDTLS_TARGETS}) + elseif (EVENT__DISABLE_MBEDTLS STREQUAL "OFF") + message(FATAL_ERROR "MbedTLS required, but not found.") endif() +elseif (EVENT__DISABLE_MBEDTLS STREQUAL "ON") + message(STATUS "Disable MbedTLS support") +else() + message(FATAL_ERROR "EVENT__DISABLE_MBEDTLS must be set to one of: AUTO, ON or OFF. Got: ${EVENT__DISABLE_MBEDTLS}") endif() if (NOT EVENT__DISABLE_TESTS) @@ -715,10 +995,8 @@ if (NOT EVENT__DISABLE_TESTS) find_package(ZLIB) if (ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR) - include_directories(${ZLIB_INCLUDE_DIRS}) - set(EVENT__HAVE_LIBZ 1) - list(APPEND LIB_APPS ${ZLIB_LIBRARIES}) + list(APPEND LIB_APPS ZLIB::ZLIB) endif() endif() @@ -726,8 +1004,21 @@ set(SRC_EXTRA event_tagging.c http.c evdns.c + ws.c + sha1.c evrpc.c) +if(${CMAKE_VERSION} VERSION_LESS "3.20") + include(TestBigEndian) + TEST_BIG_ENDIAN(IS_BIG_ENDIAN) + if(IS_BIG_ENDIAN) + set(CMAKE_C_BYTE_ORDER BIG_ENDIAN) + else() + set(CMAKE_C_BYTE_ORDER LITTLE_ENDIAN) + endif() +endif() +set_source_files_properties(sha1.c PROPERTIES COMPILE_FLAGS + -D${CMAKE_C_BYTE_ORDER}=1) add_definitions(-DHAVE_CONFIG_H) # We use BEFORE here so we don't accidentally look in system directories @@ -745,8 +1036,7 @@ if(WIN32) list(APPEND HDR_PRIVATE WIN32-Code/getopt.h) - set(EVENT__DNS_USE_FTIME_FOR_ID 1) - set(LIB_PLATFORM ws2_32) + set(LIB_PLATFORM ws2_32 shell32 advapi32 bcrypt iphlpapi) add_definitions( -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) @@ -754,10 +1044,6 @@ if(WIN32) include_directories(./WIN32-Code) endif() -if (UNIX) - list(APPEND LIB_PLATFORM m) -endif() - if (SOLARIS) list(APPEND LIB_PLATFORM socket nsl) endif() @@ -772,19 +1058,11 @@ source_group("Source Extra" FILES ${SRC_EXTRA}) # (Place them in the build dir so we don't polute the source tree with generated files). include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include) -if (EVENT__BUILD_SHARED_LIBRARIES) - set(EVENT__LIBRARY_TYPE SHARED) - - if ((CMAKE_COMPILER_IS_GNUCC) OR (${CMAKE_C_COMPILER_ID} STREQUAL "Clang")) - add_compiler_flags(-fvisibility=hidden) - elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "SunPro") - add_compiler_flags(-xldscope=hidden) - endif() - - set(EVENT__NEED_DLLIMPORT 1) -else (EVENT__BUILD_SHARED_LIBRARIES) - set(EVENT__LIBRARY_TYPE STATIC) -endif (EVENT__BUILD_SHARED_LIBRARIES) +if (${GNUC}) + set(EVENT_SHARED_FLAGS -fvisibility=hidden) +elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "SunPro") + set(EVENT_SHARED_FLAGS -xldscope=hidden) +endif() configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/event-config.h.cmake @@ -798,164 +1076,179 @@ configure_file( # # Create the libraries. # +include(AddEventLibrary) +add_event_library(event_core SOURCES ${SRC_CORE}) +add_event_library(event_extra + INNER_LIBRARIES event_core + SOURCES ${SRC_EXTRA}) + +if (EVENT__HAVE_OPENSSL) + add_event_library(event_openssl + INNER_LIBRARIES event_core + LIBRARIES ${OPENSSL_TARGETS} + SOURCES ${SRC_OPENSSL}) +endif() -# TODO: Add dynamic versions of the libraries as well. -add_library(event_core ${EVENT__LIBRARY_TYPE} - ${HDR_PRIVATE} - ${HDR_COMPAT} - ${HDR_PUBLIC} - ${SRC_CORE}) +if (EVENT__HAVE_MBEDTLS) + add_event_library(event_mbedtls + INNER_LIBRARIES event_core + LIBRARIES ${MBEDTLS_TARGETS} + SOURCES ${SRC_MBEDTLS}) +endif() -add_library(event_extra ${EVENT__LIBRARY_TYPE} - ${HDR_PRIVATE} - ${HDR_COMPAT} - ${HDR_PUBLIC} - ${SRC_CORE} - ${SRC_EXTRA}) +if (EVENT__HAVE_PTHREADS) + set(SRC_PTHREADS evthread_pthread.c) + if(ANDROID) + add_event_library(event_pthreads + INNER_LIBRARIES event_core + SOURCES ${SRC_PTHREADS}) + else() + add_event_library(event_pthreads + INNER_LIBRARIES event_core + LIBRARIES Threads::Threads + SOURCES ${SRC_PTHREADS}) + endif() +endif() # library exists for historical reasons; it contains the contents of # both libevent_core and libevent_extra. You shouldn’t use it; it may # go away in a future version of Libevent. -add_library(event ${EVENT__LIBRARY_TYPE} - ${HDR_PRIVATE} - ${HDR_COMPAT} - ${HDR_PUBLIC} - ${SRC_CORE} - ${SRC_EXTRA}) - -if (EVENT__BUILD_SHARED_LIBRARIES) - # Prepare static library to be linked to tests that need hidden symbols - add_library(event_extra_static STATIC - ${HDR_PRIVATE} - ${HDR_COMPAT} - ${HDR_PUBLIC} - ${SRC_CORE} - ${SRC_EXTRA}) - - set(EVENT_EXTRA_FOR_TEST event_extra_static) - - target_link_libraries(event_core ${OPENSSL_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} - ${LIB_PLATFORM}) - - target_link_libraries(event ${OPENSSL_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} - ${LIB_PLATFORM}) - - target_link_libraries(event_extra ${OPENSSL_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} - ${LIB_PLATFORM}) - - set_target_properties(event - PROPERTIES SOVERSION - ${EVENT_ABI_LIBVERSION}) - - set_target_properties(event_core - PROPERTIES SOVERSION - ${EVENT_ABI_LIBVERSION}) - - set_target_properties(event_extra - PROPERTIES SOVERSION - ${EVENT_ABI_LIBVERSION}) - -else (EVENT__BUILD_SHARED_LIBRARIES) - set(EVENT_EXTRA_FOR_TEST event_extra) -endif (EVENT__BUILD_SHARED_LIBRARIES) +add_event_library(event SOURCES ${SRC_CORE} ${SRC_EXTRA}) + +set(WIN32_GETOPT) +if (WIN32) + set(_TMPLIBS) + if (${EVENT_LIBRARY_STATIC}) + list(APPEND _TMPLIBS event_core_static event_static) + endif() + if (${EVENT_LIBRARY_SHARED}) + list(APPEND _TMPLIBS event_core_shared event_shared) + endif() + foreach(lib ${_TMPLIBS}) + target_link_libraries(${lib} iphlpapi) + endforeach() + unset(_TMPLIBS) + + list(APPEND WIN32_GETOPT + WIN32-Code/getopt.c + WIN32-Code/getopt_long.c) +endif() # # Samples. # - +macro(add_sample_prog ssl name) + add_executable(${name} ${ARGN}) + + target_link_libraries(${name} + event_extra + event_core + ${LIB_APPS} + ${LIB_PLATFORM}) + + if (TARGET ${ssl}) + target_link_libraries(${name} ${ssl}) + if(WIN32) + target_link_libraries(${name} crypt32) + endif() + endif() +endmacro() if (NOT EVENT__DISABLE_SAMPLES) set(SAMPLES - dns-example event-read-fifo hello-world signal-test - http-server http-connect - time-test) - - if (NOT EVENT__DISABLE_OPENSSL AND OPENSSL_LIBRARIES) - set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES}) - CHECK_FUNCTION_EXISTS_EX(ERR_remove_thread_state EVENT__HAVE_ERR_REMOVE_THREAD_STATE) - set(CMAKE_REQUIRED_LIBRARIES "") - - # Special sample with more than one file. - add_executable(https-client - sample/https-client.c - sample/openssl_hostname_validation.c - sample/hostcheck.c) - - target_link_libraries(https-client - event_extra - ${LIB_APPS} - ${LIB_PLATFORM}) + time-test + watch-timing) - add_dependencies(https-client event_extra) - - # Requires OpenSSL. - list(APPEND SAMPLES le-proxy) + foreach(SAMPLE ${SAMPLES}) + add_sample_prog(OFF ${SAMPLE} sample/${SAMPLE}.c) + endforeach() + if (NOT WIN32) + target_link_libraries(watch-timing m) endif() - foreach(SAMPLE ${SAMPLES}) - add_executable(${SAMPLE} - sample/${SAMPLE}.c) + if (EVENT__HAVE_OPENSSL) + add_sample_prog(event_openssl https-client + sample/https-client.c + sample/openssl_hostname_validation.c + sample/hostcheck.c) + add_sample_prog(event_openssl le-proxy + sample/le-proxy.c) + add_sample_prog(event_openssl becat sample/becat.c ${WIN32_GETOPT}) + endif() - target_link_libraries(${SAMPLE} - event_extra - ${LIB_APPS} - ${LIB_PLATFORM}) + if (EVENT__HAVE_MBEDTLS) + add_sample_prog(event_mbedtls https-client-mbedtls + sample/https-client.c) + target_compile_definitions(https-client-mbedtls PRIVATE USE_MBEDTLS) + add_sample_prog(event_mbedtls ssl-client-mbedtls + sample/ssl-client-mbedtls.c) + endif() - add_dependencies(${SAMPLE} event_extra) + set(SAMPLES_WOPT + dns-example + ws-chat-server + http-server + ) + foreach (SAMPLE ${SAMPLES_WOPT}) + add_sample_prog(OFF ${SAMPLE} sample/${SAMPLE}.c ${WIN32_GETOPT}) endforeach() - - if (WIN32) - target_sources(dns-example PUBLIC - WIN32-Code/getopt.c - WIN32-Code/getopt_long.c) - endif() endif() +# +# Benchmarks +# +macro(add_bench_prog prog) + add_executable(${prog} ${ARGN}) + target_link_libraries(${prog} + event_extra + event_core + ${LIB_APPS} + ${LIB_PLATFORM}) +endmacro() if (NOT EVENT__DISABLE_BENCHMARK) - foreach (BENCHMARK bench bench_cascade bench_http bench_httpclient) - set(BENCH_SRC test/${BENCHMARK}.c) - - if (WIN32) - list(APPEND BENCH_SRC - WIN32-Code/getopt.c - WIN32-Code/getopt_long.c) - endif() - - add_executable(${BENCHMARK} ${BENCH_SRC}) - - target_link_libraries(${BENCHMARK} - event_extra - ${LIB_PLATFORM}) - - add_dependencies(${BENCHMARK} event_extra) + foreach (BENCHMARK bench_http bench_httpclient) + add_bench_prog(${BENCHMARK} test/${BENCHMARK}.c) endforeach() + + add_bench_prog(bench test/bench.c ${WIN32_GETOPT}) + add_bench_prog(bench_cascade test/bench_cascade.c ${WIN32_GETOPT}) endif() +# +# Tests +# +macro(add_test_prog prog) + add_executable(${prog} test/${prog}.c) + target_link_libraries(${prog} + ${LIB_APPS} + ${LIB_PLATFORM} + event_core + event_extra + ${ARGN}) +endmacro() + if (NOT EVENT__DISABLE_TESTS) # # Generate Regress tests. # if (NOT EVENT__DISABLE_REGRESS) + # (We require python to generate the regress tests) + find_package(Python3 COMPONENTS Interpreter) - # (We require python2 to generate the regress tests) - foreach (PY python2.6 python2.7 python2) - unset(FIND_PYTHON2 CACHE) - find_program(FIND_PYTHON2 ${PY}) - if (FIND_PYTHON2) - set(PYTHON_EXECUTABLE "${PY}") - break() - endif() - endforeach() - find_package(PythonInterp) - - if (PYTHONINTERP_FOUND AND PYTHON_VERSION_STRING VERSION_LESS "3.0.0") + if (Python3_FOUND) set(__FOUND_USABLE_PYTHON 1) + set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) + else() + find_package(Python2 COMPONENTS Interpreter) + if (Python2_FOUND) + set(__FOUND_USABLE_PYTHON 1) + set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE}) + else() + message(ERROR "No suitable Python version found, bailing...") + endif() endif() if (__FOUND_USABLE_PYTHON) @@ -970,38 +1263,39 @@ if (NOT EVENT__DISABLE_TESTS) DEPENDS event_rpcgen.py test/regress.rpc - COMMAND ${PYTHON_EXECUTABLE} ../event_rpcgen.py regress.rpc + COMMAND ${PYTHON_EXECUTABLE} ../event_rpcgen.py --quiet regress.rpc WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test) list(APPEND SRC_REGRESS - test/regress.c - test/regress.gen.c - test/regress.gen.h - test/regress_buffer.c - test/regress_bufferevent.c - test/regress_dns.c - test/regress_et.c - test/regress_finalize.c - test/regress_http.c - test/regress_listener.c - test/regress_main.c - test/regress_minheap.c - test/regress_rpc.c - test/regress_testutils.c - test/regress_testutils.h - test/regress_util.c - test/tinytest.c - ${SRC_CORE} - ${SRC_EXTRA}) + test/regress.c + test/regress.gen.c + test/regress.gen.h + test/regress_buffer.c + test/regress_bufferevent.c + test/regress_dns.c + test/regress_et.c + test/regress_finalize.c + test/regress_http.c + test/regress_http.h + test/regress_listener.c + test/regress_main.c + test/regress_minheap.c + test/regress_rpc.c + test/regress_testutils.c + test/regress_testutils.h + test/regress_util.c + test/regress_watch.c + test/regress_timer_timeout.c + test/regress_ws.c + test/regress_ws.h + test/tinytest.c) if (WIN32) list(APPEND SRC_REGRESS test/regress_iocp.c) if (NOT EVENT__DISABLE_THREAD_SUPPORT) list(APPEND SRC_REGRESS test/regress_thread.c) endif() - endif() - - if (CMAKE_USE_PTHREADS_INIT) + elseif (EVENT__HAVE_PTHREADS) list(APPEND SRC_REGRESS test/regress_thread.c) endif() @@ -1009,23 +1303,30 @@ if (NOT EVENT__DISABLE_TESTS) list(APPEND SRC_REGRESS test/regress_zlib.c) endif() - if (OPENSSL_LIBRARIES) - list(APPEND SRC_REGRESS test/regress_ssl.c) + if (EVENT__HAVE_OPENSSL) + list(APPEND SRC_REGRESS test/regress_openssl.c) endif() - add_executable(regress ${SRC_REGRESS}) + if (EVENT__HAVE_MBEDTLS) + list(APPEND SRC_REGRESS test/regress_mbedtls.c) + endif() - # While building the test suite we don't want the visibility - # header trying to "dllimport" the symbols on windows (it - # generates a ton of warnings due to different link - # attributes for all of the symbols) - SET_TARGET_PROPERTIES(regress - PROPERTIES COMPILE_DEFINITIONS - "EVENT_BUILDING_REGRESS_TEST=1") + add_executable(regress ${SRC_REGRESS}) target_link_libraries(regress - ${LIB_APPS} - ${LIB_PLATFORM}) + ${LIB_APPS} + ${LIB_PLATFORM} + event_core + event_extra) + if (EVENT__HAVE_OPENSSL) + target_link_libraries(regress event_openssl) + endif() + if (EVENT__HAVE_MBEDTLS) + target_link_libraries(regress event_mbedtls) + endif() + if (PTHREADS_AVAILABLE) + target_link_libraries(regress event_pthreads) + endif() else() message(WARNING "No suitable Python interpreter found, cannot generate regress tests!") endif() @@ -1034,44 +1335,48 @@ if (NOT EVENT__DISABLE_TESTS) # # Test programs. # - # all of these, including the cmakelists.txt should be moved - # into the dirctory 'tests' first. - # - # doing this, we can remove all the DISABLE_TESTS stuff, and simply - # do something like: - # - # add_custom_targets(tests) - # add_executable(... EXCLUDE_FROM_ALL ...c) - # add_dependencis(tests testa testb testc) - # add_test(....) - # - # then you can just run 'make tests' instead of them all - # auto-compile|running - # - ellzey - set(TESTPROGS test-changelist - test-eof - test-fdleak - test-init - test-time - test-weof) + # all of these, including the cmakelists.txt should be moved + # into the directory 'tests' first. + # + # doing this, we can remove all the DISABLE_TESTS stuff, and simply + # do something like: + # + # add_custom_targets(tests) + # add_executable(... EXCLUDE_FROM_ALL ...c) + # add_dependencis(tests testa testb testc) + # add_test(....) + # + # then you can just run 'make tests' instead of them all + # auto-compile|running + # - ellzey + set(TESTPROGS test-changelist + test-eof + test-closed + test-fdleak + test-init + test-time + test-weof) + + foreach (TESTPROG ${TESTPROGS} test-dumpevents) + add_test_prog(${TESTPROG}) + endforeach() + if (UNIX) + add_test_prog(test-ratelim m) + else() + add_test_prog(test-ratelim) + endif() set(ALL_TESTPROGS - ${TESTPROGS} - test-dumpevents - test-ratelim) - - # Create test program executables. - foreach (TESTPROG ${ALL_TESTPROGS}) - add_executable(${TESTPROG} - test/${TESTPROG}.c) - - target_link_libraries(${TESTPROG} - ${EVENT_EXTRA_FOR_TEST} - ${LIB_PLATFORM}) + ${TESTPROGS} + test-dumpevents + test-ratelim + ) - add_dependencies(${TESTPROG} - ${EVENT_EXTRA_FOR_TEST}) - endforeach() + if(PTHREADS_AVAILABLE AND EVENT__HAVE_KQUEUE) + add_test_prog(test-kq-collision event_pthreads) + list(APPEND ALL_TESTPROGS test-kq-collision) + add_test(test-test-kq-collision ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-kq-collision) + endif() # # We run all tests with the different backends turned on one at a time. @@ -1104,6 +1409,10 @@ if (NOT EVENT__DISABLE_TESTS) list(APPEND BACKENDS DEVPOLL) endif() + if (EVENT__HAVE_WEPOLL) + list(APPEND BACKENDS WEPOLL) + endif() + if (WIN32) list(APPEND BACKENDS WIN32) endif() @@ -1111,7 +1420,7 @@ if (NOT EVENT__DISABLE_TESTS) # Default environment variables turns off all event systems, # then we enable each one, one at a time when creating the tests. - set(DEFAULT_TEST_ENV_VARS "EVENT_SHOW_METHOD=1;") + set(DEFAULT_TEST_ENV_VARS) foreach(BACKEND ${BACKENDS}) set(BACKEND_ENV_VAR "EVENT_NO${BACKEND}=1") list(APPEND DEFAULT_TEST_ENV_VARS "${BACKEND_ENV_VAR}") @@ -1125,12 +1434,12 @@ if (NOT EVENT__DISABLE_TESTS) set(TEST_NAME ${TESTPROG}__${BACKEND_TEST_NAME}) add_test(${TEST_NAME} - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTPROG}) + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTPROG}) list(APPEND TEST_NAMES ${TEST_NAME}) set_tests_properties(${TEST_NAME} - PROPERTIES ENVIRONMENT "${ENV_VARS}") + PROPERTIES ENVIRONMENT "${ENV_VARS}") endforeach() # Dump events test. @@ -1138,21 +1447,21 @@ if (NOT EVENT__DISABLE_TESTS) set(TEST_NAME test-dumpevents__${BACKEND_TEST_NAME}) add_test(${TEST_NAME} - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-dumpevents | - ${PYTHON_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/test/check-dumpevents.py) + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-dumpevents | + ${PYTHON_EXECUTABLE} + ${CMAKE_CURRENT_SOURCE_DIR}/test/check-dumpevents.py) set_tests_properties(${TEST_NAME} - PROPERTIES ENVIRONMENT "${ENV_VARS}") + PROPERTIES ENVIRONMENT "${ENV_VARS}") else() message(WARNING "test-dumpevents will be run without output check since python was not found!") set(TEST_NAME test-dumpevents__${BACKEND_TEST_NAME}_no_check) add_test(${TEST_NAME} - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-dumpevents) + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-dumpevents) set_tests_properties(${TEST_NAME} - PROPERTIES ENVIRONMENT "${ENV_VARS}") + PROPERTIES ENVIRONMENT "${ENV_VARS}") endif() # Regress tests. @@ -1160,16 +1469,16 @@ if (NOT EVENT__DISABLE_TESTS) set(TEST_NAME regress__${BACKEND_TEST_NAME}) add_test(${TEST_NAME} - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/regress) + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/regress --quiet) set_tests_properties(${TEST_NAME} - PROPERTIES ENVIRONMENT "${ENV_VARS}") + PROPERTIES ENVIRONMENT "${ENV_VARS}") add_test(${TEST_NAME}_debug - ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/regress) + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/regress --quiet) set_tests_properties(${TEST_NAME}_debug - PROPERTIES ENVIRONMENT "${ENV_VARS};EVENT_DEBUG_MODE=1") + PROPERTIES ENVIRONMENT "${ENV_VARS};EVENT_DEBUG_MODE=1") endif() endmacro() @@ -1192,6 +1501,7 @@ if (NOT EVENT__DISABLE_TESTS) else() add_backend_test(${BACKEND} "${BACKEND_ENV_VARS}") endif() + add_backend_test(signalfd_${BACKEND} "${BACKEND_ENV_VARS};EVENT_USE_SIGNALFD=1") endforeach() # @@ -1199,83 +1509,81 @@ if (NOT EVENT__DISABLE_TESTS) # # Group limits, no connection limit. - set(RL_BIN ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ratelim) + set(RL_BIN ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-ratelim) add_test(test-ratelim__group_lim - ${RL_BIN} - -g 30000 - -n 30 - -t 100 - --check-grouplimit 1000 - --check-stddev 100) + ${RL_BIN} + -g 30000 + -n 30 + -t 100 + --check-grouplimit 1000 + --check-stddev 150) # Connection limit, no group limit. add_test(test-ratelim__con_lim - ${RL_BIN} - -c 1000 - -n 30 - -t 100 - --check-connlimit 50 - --check-stddev 50) + ${RL_BIN} + -c 1000 + -n 30 + -t 100 + --check-connlimit 50 + --check-stddev 50) # Connection limit and group limit. add_test(test-ratelim__group_con_lim - ${RL_BIN} - -c 1000 - -g 30000 - -n 30 - -t 100 - --check-grouplimit 1000 - --check-connlimit 50 - --check-stddev 50) + ${RL_BIN} + -c 1000 + -g 30000 + -n 30 + -t 100 + --check-grouplimit 1000 + --check-connlimit 50 + --check-stddev 50) # Connection limit and group limit with independent drain. add_test(test-ratelim__group_con_lim_drain - ${RL_BIN} - -c 1000 - -g 35000 - -n 30 - -t 100 - -G 500 - --check-grouplimit 1000 - --check-connlimit 50 - --check-stddev 50) + ${RL_BIN} + -c 1000 + -g 35000 + -n 30 + -t 100 + -G 500 + --check-grouplimit 1000 + --check-connlimit 50 + --check-stddev 50) # Add a "make verify" target, same as for autoconf. # (Important! This will unset all EVENT_NO* environment variables. # If they are set in the shell the tests are running using simply "ctest" or "make test" will fail) if (WIN32) # Windows doesn't have "unset". But you can use "set VAR=" instead. - # We need to guard against the possibility taht EVENT_NOWIN32 is set, and all test failing - # since no event backend being available. file(TO_NATIVE_PATH ${CMAKE_CTEST_COMMAND} WINDOWS_CTEST_COMMAND) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.bat " set EVENT_NOWIN32= + set EVENT_NOWEPOLL= \"${WINDOWS_CTEST_COMMAND}\" ") message(STATUS "${WINDOWS_CTEST_COMMAND}") file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.bat - DESTINATION - ${CMAKE_CURRENT_BINARY_DIR} - FILE_PERMISSIONS - OWNER_READ - OWNER_WRITE - OWNER_EXECUTE - GROUP_READ - GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE) + DESTINATION ${CMAKE_CURRENT_BINARY_DIR} + FILE_PERMISSIONS + OWNER_READ + OWNER_WRITE + OWNER_EXECUTE + GROUP_READ + GROUP_EXECUTE + WORLD_READ WORLD_EXECUTE) file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/verify_tests.bat" VERIFY_PATH) add_custom_target(verify COMMAND "${VERIFY_PATH}" - DEPENDS event ${ALL_TESTPROGS}) + DEPENDS event ${ALL_TESTPROGS}) else() - # On some platforms doing exec(unset) as CMake does won't work, so make sure + # On some platforms doing exec(unset) as CMake doesn't work, so make sure # we run the unset command in a shell instead. # First we write the script contents. file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.sh @@ -1287,23 +1595,20 @@ if (NOT EVENT__DISABLE_TESTS) # Then we copy the file (this allows us to set execute permission on it) file(COPY ${CMAKE_CURRENT_BINARY_DIR}/tmp/verify_tests.sh - DESTINATION ${CMAKE_CURRENT_BINARY_DIR} - FILE_PERMISSIONS - OWNER_READ - OWNER_WRITE - OWNER_EXECUTE - GROUP_READ - GROUP_EXECUTE - WORLD_READ - WORLD_EXECUTE) + DESTINATION ${CMAKE_CURRENT_BINARY_DIR} + FILE_PERMISSIONS + OWNER_READ + OWNER_WRITE + OWNER_EXECUTE + GROUP_READ + GROUP_EXECUTE + WORLD_READ + WORLD_EXECUTE) # Create the target that runs the script. add_custom_target(verify - COMMAND - ${CMAKE_CURRENT_BINARY_DIR}/verify_tests.sh - DEPENDS - event - ${ALL_TESTPROGS}) + COMMAND ${CMAKE_CURRENT_BINARY_DIR}/verify_tests.sh + DEPENDS event ${ALL_TESTPROGS}) endif() if (NOT EVENT__DISABLE_REGRESS AND __FOUND_USABLE_PYTHON) @@ -1329,32 +1634,15 @@ endif() # Installation preparation. # -# Allow the user to override installation directories. -set(EVENT_INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries") -set(EVENT_INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables") -set(EVENT_INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files") +set(EVENT_INSTALL_CMAKE_DIR + "${CMAKE_INSTALL_LIBDIR}/cmake/libevent") -if(WIN32 AND NOT CYGWIN) - set(DEF_INSTALL_CMAKE_DIR cmake) -else() - set(DEF_INSTALL_CMAKE_DIR lib/cmake/libevent) -endif() - -set(EVENT_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files") - -# Make sure the paths are absolute. -foreach(p LIB BIN INCLUDE CMAKE) - set(var EVENT_INSTALL_${p}_DIR) - if(NOT IS_ABSOLUTE "${${var}}") - set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}") - endif() -endforeach() - -# Export targets (This is used for other CMake projects to easily find the libraries and include files). -export(TARGETS event event_extra event_core - FILE "${PROJECT_BINARY_DIR}/LibeventTargets.cmake") export(PACKAGE libevent) +configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfig.cmake.in + "${PROJECT_BINARY_DIR}/LibeventConfig.cmake" + @ONLY) + # Generate the config file for the build-tree. set(EVENT__INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" @@ -1364,95 +1652,98 @@ set(LIBEVENT_INCLUDE_DIRS ${EVENT__INCLUDE_DIRS} CACHE PATH "Libevent include directories") -configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigBuildTree.cmake.in - ${PROJECT_BINARY_DIR}/LibeventConfig.cmake - @ONLY) - -# Generate the config file for the installation tree. -file(RELATIVE_PATH - REL_INCLUDE_DIR - "${EVENT_INSTALL_CMAKE_DIR}" - "${EVENT_INSTALL_INCLUDE_DIR}") # Calculate the relative directory from the Cmake dir. - -# Note the EVENT_CMAKE_DIR is defined in LibeventConfig.cmake.in, -# we escape it here so it's evaluated when it is included instead -# so that the include dirs are givenrelative to where the -# config file is located. -set(EVENT__INCLUDE_DIRS - "\${EVENT_CMAKE_DIR}/${REL_INCLUDE_DIR}") - -configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfig.cmake.in - ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/LibeventConfig.cmake - @ONLY) - # Generate version info for both build-tree and install-tree. configure_file(${PROJECT_SOURCE_DIR}/cmake/LibeventConfigVersion.cmake.in - ${PROJECT_BINARY_DIR}/LibeventConfigVersion.cmake - @ONLY) - -# Define the public headers. -set_target_properties(event event_core event_extra - PROPERTIES PUBLIC_HEADER "${HDR_PUBLIC}") - -# -# Install targets. -# -install(TARGETS event event_core event_extra - EXPORT LibeventTargets - RUNTIME DESTINATION "${EVENT_INSTALL_BIN_DIR}" COMPONENT bin - LIBRARY DESTINATION "${EVENT_INSTALL_LIB_DIR}" COMPONENT lib - ARCHIVE DESTINATION "${EVENT_INSTALL_LIB_DIR}" COMPONENT lib - PUBLIC_HEADER DESTINATION "${EVENT_INSTALL_INCLUDE_DIR}/event2" COMPONENT dev) + ${PROJECT_BINARY_DIR}/LibeventConfigVersion.cmake + @ONLY) # Install compat headers install(FILES ${HDR_COMPAT} - DESTINATION - "${EVENT_INSTALL_INCLUDE_DIR}" - COMPONENT dev) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" + COMPONENT dev) + +# Install public headers +install(FILES ${HDR_PUBLIC} + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/event2" + COMPONENT dev) # Install the configs. install(FILES - ${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/LibeventConfig.cmake - ${PROJECT_BINARY_DIR}/LibeventConfigVersion.cmake - DESTINATION - "${EVENT_INSTALL_CMAKE_DIR}" + ${PROJECT_BINARY_DIR}/LibeventConfig.cmake + ${PROJECT_BINARY_DIR}/LibeventConfigVersion.cmake + DESTINATION "${EVENT_INSTALL_CMAKE_DIR}" COMPONENT dev) # Install exports for the install-tree. -install(EXPORT LibeventTargets - DESTINATION - "${EVENT_INSTALL_CMAKE_DIR}" - COMPONENT dev) +macro(install_export type) + install(EXPORT LibeventTargets-${type} + NAMESPACE ${PROJECT_NAME}:: + DESTINATION "${EVENT_INSTALL_CMAKE_DIR}" + COMPONENT dev) +endmacro() -set(LIBEVENT_LIBRARIES - event - event_core - event_extra - CACHE STRING "Libevent libraries") +if (${EVENT_LIBRARY_STATIC}) + install_export(static) +endif() +if (${EVENT_LIBRARY_SHARED}) + install_export(shared) +endif() + +# Install the scripts. +install(PROGRAMS + ${CMAKE_CURRENT_SOURCE_DIR}/event_rpcgen.py + DESTINATION "${CMAKE_INSTALL_BINDIR}" + COMPONENT runtime) + +# Create documents with doxygen. +option(EVENT__DOXYGEN + "Enables doxygen documentation" OFF) +if (EVENT__DOXYGEN) + include(UseDoxygen) + UseDoxygen() +endif() + + +if (NOT TARGET uninstall) + # Create the uninstall target. + # https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake + configure_file(${PROJECT_SOURCE_DIR}/cmake/Uninstall.cmake.in + ${PROJECT_BINARY_DIR}/Uninstall.cmake + @ONLY) + + add_custom_target(uninstall + COMMAND ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/Uninstall.cmake) +endif() message(STATUS "") message(STATUS " ---( Libevent " ${EVENT_VERSION} " )---") message(STATUS "") message(STATUS "Available event backends: ${BACKENDS}") -message(STATUS "CMAKE_BINARY_DIR: " ${CMAKE_BINARY_DIR}) -message(STATUS "CMAKE_CURRENT_BINARY_DIR: " ${CMAKE_CURRENT_BINARY_DIR}) -message(STATUS "CMAKE_SOURCE_DIR: " ${CMAKE_SOURCE_DIR}) -message(STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR}) -message(STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR}) -message(STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR}) -message(STATUS "CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH}) -message(STATUS "CMAKE_COMMAND: " ${CMAKE_COMMAND}) -message(STATUS "CMAKE_ROOT: " ${CMAKE_ROOT} ) -message(STATUS "CMAKE_SYSTEM: " ${CMAKE_SYSTEM} ) -message(STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME} ) -message(STATUS "CMAKE_SYSTEM_VERSION: " ${CMAKE_SYSTEM_VERSION} ) -message(STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR} ) -message(STATUS "CMAKE_SKIP_RPATH: " ${CMAKE_SKIP_RPATH} ) -message(STATUS "CMAKE_VERBOSE_MAKEFILE: " ${CMAKE_VERBOSE_MAKEFILE} ) -message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} ) -message(STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} ) -message(STATUS "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} ) -message(STATUS "CMAKE_AR: " ${CMAKE_AR} ) -message(STATUS "CMAKE_RANLIB: " ${CMAKE_RANLIB} ) +message(STATUS "CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}") +message(STATUS "CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}") +message(STATUS "CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}") +message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}") +message(STATUS "PROJECT_BINARY_DIR: ${PROJECT_BINARY_DIR}") +message(STATUS "PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}") +message(STATUS "CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}") +message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}") +message(STATUS "CMAKE_ROOT: ${CMAKE_ROOT}") +message(STATUS "CMAKE_SYSTEM: ${CMAKE_SYSTEM}") +message(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") +message(STATUS "CMAKE_SYSTEM_VERSION: ${CMAKE_SYSTEM_VERSION}") +message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") +message(STATUS "CMAKE_SKIP_RPATH: ${CMAKE_SKIP_RPATH}") +message(STATUS "CMAKE_SKIP_INSTALL_RPATH: ${CMAKE_SKIP_INSTALL_RPATH}") +message(STATUS "CMAKE_INSTALL_RPATH: ${CMAKE_INSTALL_RPATH}") +message(STATUS "CMAKE_VERBOSE_MAKEFILE: ${CMAKE_VERBOSE_MAKEFILE}") +message(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") +message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") +message(STATUS "CMAKE_C_COMPILER: ${CMAKE_C_COMPILER} (id ${CMAKE_C_COMPILER_ID}, clang ${CLANG}, GNUC ${GNUC}, version ${CMAKE_C_COMPILER_VERSION})") +message(STATUS "CMAKE_SHARED_LINKER_FLAGS:${CMAKE_SHARED_LINKER_FLAGS}") +message(STATUS "CMAKE_EXE_LINKER_FLAGS: ${CMAKE_EXE_LINKER_FLAGS}") +message(STATUS "CMAKE_AR: ${CMAKE_AR}") +message(STATUS "CMAKE_RANLIB: ${CMAKE_RANLIB}") +message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") +message(STATUS "CMAKE_DEBUG_POSTFIX: ${CMAKE_DEBUG_POSTFIX}") message(STATUS "") diff --git a/lib/monkey/mk_core/deps/libevent/CONTRIBUTING.md b/lib/monkey/mk_core/deps/libevent/CONTRIBUTING.md deleted file mode 100644 index 3875693978a..00000000000 --- a/lib/monkey/mk_core/deps/libevent/CONTRIBUTING.md +++ /dev/null @@ -1,35 +0,0 @@ -# Contributing to the libevent - -## Coding style - -First and most generic rule: **just look around**. - -But, we have a script for checking patches/files/git-refs: -```shell -# Chech HEAD git ref -./checkpatch.sh -r -./checkpatch.sh -r HEAD - -# Check patch -git format-patch --stdout -1 | ./checkpatch.sh -p -git show -1 | ./checkpatch.sh -p - -# Or via regular files -git format-patch --stdout -2 -./checkpatch.sh *.patch - -# Over a file -./checkpatch.sh -d event.c -./checkpatch.sh -d < event.c - -# And print the whole file not only summary -./checkpatch.sh -f event.c -./checkpatch.sh -f < event.c - -# See -./checkpatch.sh -h -``` - -## Testing -- Write new unit test in `test/regress_{MORE_SUITABLE_FOR_YOU}.c` -- `make verify` diff --git a/lib/monkey/mk_core/deps/libevent/ChangeLog b/lib/monkey/mk_core/deps/libevent/ChangeLog index 358dc22a9c2..0b7775b8fed 100644 --- a/lib/monkey/mk_core/deps/libevent/ChangeLog +++ b/lib/monkey/mk_core/deps/libevent/ChangeLog @@ -1,1811 +1,381 @@ -Changes in version 2.1.7-rc (2 Novemer 2016) - - Libevent 2.1.7-rc contains openssl 1.1 support, build fixes, CI improvements - and plus Vagrantfile for testing under multiple OS'es. - - - Continious Integration: - o Use coveralls.io via travis (9ac000c Azat Khuzhin) - o travis-ci: use container-based infrastructure (7e12e96 Azat Khuzhin) - o travis-ci/osx: fix compiling/linking openssl libraries (9d2f8d4 Azat Khuzhin) - o travis-ci: use gcc-5 (fixes osx|gcc failures) (d7ceae5 Azat Khuzhin) - o Testing with vagrant for 6 OS and cmake+autoconf (9585338 Azat Khuzhin) - o travis-ci/osx: install lcov (e4e099b Azat Khuzhin) - - Build Improvements/Fixes: - o Fix cmake -DEVENT__COVERAGE=ON (40fbffc Azat Khuzhin) - o autogen.sh: learn about gmake (9376ac4 Azat Khuzhin) - o autogen.sh: remove all autoconf/automake caches, if any (69cce25 Azat Khuzhin) - o cmake: fix finding python2, and check that it is really 2 (3453c08 Azat Khuzhin) - o cmake: fix CheckFunctionExistsEx/CheckPrototypeDefinition (CMP0054) (43b69b2 Azat Khuzhin) - o cmake: cleanup (dc624ad Zonr Chang) - o cmake/win32: fix running regress, but fixing finding python2 interpreter (bcb990a Azat Khuzhin) - o cmake: use PYTHON_EXECUTABLE to find python2 (a4d044c Azat Khuzhin) - o Merge branch 'force-disable-clockgettime' (83c7cdf Azat Khuzhin) - - Code Improvements (core) - o use ev_uint16_t instead of unsigned short for port (e983712 Thomas Bernard) - o Merge branch 'contrib-guide-v2' (b9c5077 Azat Khuzhin) - o poll: Prevent libevent from spinning if POLLNVAL occurs (675974c Tim Hentenaar) - - Testing: - o test/regress: cover a polling of invalid fd (cb0df5c Tim Hentenaar) - - Code Improvements (bufferevent_openssl) - o Make it build using OpenSSL 1.1.0 (3e9e0a0 Kurt Roeckx) - o Don't call BIO_number_{read|written} on NULL BIOs. (6702da1 Adam Langley) - o Switch from a 512 to 2048-bit RSA key. (f9803a6 Adam Langley) - - Trivial fixes: - o Ignore temporary configure files (8fb08ae Azat Khuzhin) - o README.md: fix typo: ar -> are (2361616 Simone Basso) - o be: just a simple mistake, reinclude the (7521664 Seven) - -Changes in version 2.1.6-beta (4 July 2016) - - Libevent 2.1.6-beta contains mostly bug fixes (evbuffers, evthread, evdns, - bufferevents, core, http, samples), improvements but mostly to fix some - possible issues (EVHTTP_CON_LINGERING_CLOSE), a lot of new unit tests and new - appveyor integration. - - Security Fixes (utils) - o evutil_parse_sockaddr_port(): fix buffer overflow (329acc1 Azat Khuzhin) - - Security Fixes (evdns) - o evdns: name_parse(): fix remote stack overread (96f64a0 Azat Khuzhin) - o evdns: fix searching empty hostnames (ec65c42 Azat Khuzhin) - - New APIs (evdns) - o New function to get address for nameserver. (537177d Nick Mathewson) - - New APIs (bufferevents) - o expose bufferevent_incref/decref (with fewer modifications) (1ed6718 Mark Ellzey) - - New APIs (internal) - o evdns: export cancel via callbacks in util (like async lib core/extra issues) (8cbe65d Azat Khuzhin) - - New APIs/Improvements (http) - o http: take EVHTTP_CON_LINGERING_CLOSE into account for "Expect: 100-Continue" (ac448a7 Azat Khuzhin) - o http: lingering close (like nginx have) for entity-too-large (9fde518 Azat Khuzhin) - o http: read server response even after server closed the connection (680742e Azat Khuzhin) - o http: export evhttp_connection_set_family() (714fc70 Azat Khuzhin) - o http: reuse connected address only with EVHTTP_CON_REUSE_CONNECTED_ADDR (a50f5f0 Azat Khuzhin) - o http: use IP address that we got before (if any) during retrying (54c887d Azat Khuzhin) - - Bugfixes (core) - o Fix getaddrinfo under solaris (for multiprotocol case) (40730ae Azat Khuzhin) - o Check for Mac OS X 10.4 kqueue bug properly (df6f99e Mark Mentovai) - o event_reinit: make signals works after fork() without evsig_add() (88640aa Nicholas Marriott) - o event_reinit: always re-init signal's socketpair (ad0c237 Nicholas Marriott) - o Free event queues even for recursive finalizers (7c8d015 Azat Khuzhin) - o Fix checking for make_base_notifiable() (f337296 Azat Khuzhin) - o Set correct socklen for PF_INET6 sockaddr len (3499ad9 Mark Ellzey) - o Fix garbage value in socketpair util function, stdint? (043ae74 Mark Ellzey) - o fix the return value of event_deferred_cb_schedule_ (38cef64 Greg Hazel) - o event_free_debug_globals_locks(): disable lock debugging (e5c87d1 Azat Khuzhin) - o event: call event_disable_debug_mode() in libevent_global_shutdown() (941faae Azat Khuzhin) - o ht-internal: don't reset hth_table_length explicitly in name_##HT_CLEAR (597c7b2 Azat Khuzhin) - - Bugfixes (evthread) - o evthread: fix evthread_setup_global_lock_() for debug-lock with a real-lock case (e4556fc Azat Khuzhin) - o evthread: evthreadimpl_disable_lock_debugging_() for libevent_global_shutdown() (ccc5593 Azat Khuzhin) - - Bugfixes (evdns) - o evdns: avoid double-free in evdns_base_free() for probing requests (4db15e0 Azat Khuzhin) - o evdns: evdns_base_free(): fix UAF of evdns_base with @fail_requests (00313c5 Azat Khuzhin) - o evdns: evdns_base_free(): free requests before namservers (14f84bb Azat Khuzhin) - o evdns: fix randomize-case by make case-insensitive as required (9c238de Azat Khuzhin) - - Bugfixes (bufferevents) - o be_sock: handle readv() returns ECONNREFUSED (freebsd 9.2) (3189eb0 Azat Khuzhin) - o be_filter: avoid data stuck under active watermarks (b627ad8 Eduardo Panisset) - o Fix bufferevent_pair to properly set BEV_EVENT_{READING,WRITING} on flush. (2851889 David Paschich) - o be_openssl: clear all pending errors before SSL_*() calls (38e0f4a Azat Khuzhin) - o be_sock: cancel in-progress dns requests (86dfd2c Azat Khuzhin) - o be_sock: unfreeze buffers on fd changing (255525d Azat Khuzhin) - o be_sock: bufferevent_socket_connect_hostname(): make it thread-safe (809bb39 Azat Khuzhin) - o be_openssl: don't call do_write() directly from outbuf_cb (da52933 Azat Khuzhin) - o be_openssl: use bufferevent_enable() instead of bufferevent_add_event_() (0c66d32 Azat Khuzhin) - o be_openssl: don't add events during bev creation (like be_sock) (f4b6284 Azat Khuzhin) - o Fix lock leak in be_pair_flush() if flush type is BEV_NORMAL (f45d39d Bill Vaughan) - o be_openssl: don't use *_auto() in do_handshake() we can't have fd == -1 there (877280d Azat Khuzhin) - o be_openssl: don't call set_open_callbacks() if fd == -1 (e8a2da9 Azat Khuzhin) - o be_openssl: get rid off hackish "fd_is_set", to fix some corner cases (40b0379 Azat Khuzhin) - o be: we don't need to use getpeername() we we have conn_address (2c271e2 Azat Khuzhin) - o Call underlying bev ctrl SET_FD on filtered bufferevents (c2aa7dc Mark Ellzey) - o be_pair: release shared lock with the latest of bufferevent_pair (92a359e Azat Khuzhin) - - Bugfixes (http) - o [Issue #313] set method to ASCII "NULL" if evhttp_method() returns NULL (17cc636 Mark Ellzey) - o evhttp_have_expect(): fix -Wlogical-not-parentheses (24b5214 Azat Khuzhin) - o http: set fd to -1 unconditioally, to avoid leaking of DNS requests (7a4b472 Azat Khuzhin) - o http: avoid leaking of fd in evhttp_connection_free() (f0e1341 Azat Khuzhin) - o http: get fd from be layer during connection reset (4a53c54 Azat Khuzhin) - o http: fix EVHTTP_CON_READ_ON_WRITE_ERROR when it doesn't supported by OS (2ff164a Azat Khuzhin) - o http: do not do function calls under EVUTIL_ASSERT() to fix NDEBUG builds (7c89999 Azat Khuzhin) - o http: fix leaking of response_code_line (8f18a62 Azat Khuzhin) - o http: fix "Expect: 100-continue" client side (0b46b39 Azat Khuzhin) - o http: fix conflicts EVHTTP_CON_AUTOFREE and EVHTTP_CON_REUSE_CONNECTED_ADDR (4dc0979 Azat Khuzhin) - o http: avoid epoll_ctl() on already closed fd (triggers by http/chunk_out) (ab3bc69 Azat Khuzhin) - o http: install timeout for read too during connect for ssl (040000d Azat Khuzhin) - o http: fix evhttp_request_own() by checking EVHTTP_USER_OWNED in more cases (b0d3964 Azat Khuzhin) - o http: fix detecting EOF without write (7ed02ac Azat Khuzhin) - o evhttp: Fix failure to send all output data for POST/PUT requests (24eea0d John Ohl) - o Fix evhttp_uriencode() regression. (c6b1ec1 Mark Ellzey) - o removed unused vars (e94250c Mark Ellzey) - o pointer overflow checks for evhttp_uriencode (72afe4c Zonr Chang) - - Bugfixes (evbuffers) - o buffer: fix overflow check in evbuffer_expand_singlechain() (a3f4ccd Azat Khuzhin) - o buffer: evbuffer_add_buffer(): clean empty chains from destination buffer (26fd932 Azat Khuzhin) - o Fix n_add_for_cb in evbuffer_prepend() in case of new buffer required (0abd039 Azat Khuzhin) - o be_filter: actually disable output_filter during processing output (c031215 Simon Perreault) - o evbuffer_add: Use last_with_datap if set, not last. (a8769ef Marcus Sundberg) - o EVBUFFER_PTR_SET -> EVBUFFER_PTR_ADD (8674e4f jer-gentoo) - - Bugfixes (evconnlistener) - o listener: unlock lev on error in listener_read_cb() (2a71b33 Azat Khuzhin) - o Fix potential fd leak in listener_read_cb() (a695a72 Mark Ellzey) - - Testing - o tests: use waitpid(..., WNOWAIT) to fix failing of main/fork under solaris (43eb56c Azat Khuzhin) - o test: replace sleeping with syncing pair in main/fork (16d220c Azat Khuzhin) - o test/http: do not run tests that based on backlog filling (freebsd) (500b6b7 Azat Khuzhin) - o test/bufferevent/iocp: fix test name for "bufferevent_connect_fail_eventcb" (4410e9d Azat Khuzhin) - o test/ssl: use send()/recv()/EVUTIL_ERR_RW_RETRIABLE()/EVUTIL_SOCKET_ERROR() to fix win32 (a9e8cd6 Azat Khuzhin) - o test/https_basic: increase timeout for complete write (fixes win32) (d5a2f2f Azat Khuzhin) - o test: fix building with --disable-thread-support under win32 (a487706 Azat Khuzhin) - o test/buffer: evbuffer_add_buffer() with empty chains (a272bc4 Azat Khuzhin) - o test/buffer: evbuffer_remove_buffer() with empty chains (prepend) (f0cfa14 Azat Khuzhin) - o test/buffer: evbuffer_remove_buffer() with empty chains (evbuffer_add_buffer()) (2880ce6 Azat Khuzhin) - o test/buffer: cover evbuffer_expand() for overflow (48dab7a Azat Khuzhin) - o test/be_filter: creating test case for data stuck with active watermarks (766194b Eduardo Panisset) - o test/http: avoid using conditionals with omitted operands (fixes VS2015) (2a4bf29 Azat Khuzhin) - o test/http: don't mix declarations and code (fixes -Wdeclaration-after-statement) (aabf1c2 Azat Khuzhin) - o test/buffer: fix leak in test_evbuffer_prepend() (c08d90b Azat Khuzhin) - o test/buffer: avoid errors with --no-fork (reinitialize static vars) (e7d1e39 Azat Khuzhin) - o test/buffer: cover n_add_for_cb when evbuffer_prepend() need to allocate buffer (e77ff41 Azat Khuzhin) - o test/tinytest_macros: add new one tt_nstr_op() (bd19a28 Azat Khuzhin) - o test/bufferevent: check that output_filter disabled during processing output (ae28812 Azat Khuzhin) - o test/listener: regression for missing unlock in listener_read_cb() (7d85651 Azat Khuzhin) - o test/regress: add tests for evbuffer_add() breakage on empty last chain (d5ee739 Marcus Sundberg) - o test/http: fix running some tests sequential (with --no-fork) (bddad71 Azat Khuzhin) - o test/http: localize evhttp server structure (cbc3209 Azat Khuzhin) - o test/dns: regression for empty hostname (d7348ba Azat Khuzhin) - o test/http: fix SERVER_TIMEOUT tests under win32 (d49a658 Azat Khuzhin) - o test/http: add a helper for creating timedout/failed request (376f107 Azat Khuzhin) - o test/http: adopt for C90 (mixed code and declarations) (d02a285 Azat Khuzhin) - o test/http: cover NS timed out during request cancellations separatelly (0c343af Azat Khuzhin) - o test/http: request cancellation with resolving/{conn,write}-timeouts in progress (334340d Azat Khuzhin) - o test/http: exit from the loop in the errorcb to wait cancellation (927ab33 Azat Khuzhin) - o regress_clean_dnsserver(): reset global port vars (351207f Azat Khuzhin) - o test/http: read_on_write_error: fix it for win32 (3b58169 Azat Khuzhin) - o test/http: separate coverage for EVHTTP_CON_READ_ON_WRITE_ERROR (5c2b4c1 Azat Khuzhin) - o test/http: cover "Expect: 100-continue" client-server interaction (31d8116 Azat Khuzhin) - o test/http: *lingering tests shouldn't have "Expect: 100-continue" (ed469ab Azat Khuzhin) - o test: use EVUTIL_SHUT_WR (04fc82f Azat Khuzhin) - o test/http: avoid huge stack allocations to fix win32 builds (3166765 Azat Khuzhin) - o test: http/lingering_close: cover EVHTTP_SERVER_LINGERING_CLOSE (e122ca1 Azat Khuzhin) - o test: http/non_lingering_close: cover ~EVHTTP_SERVER_LINGERING_CLOSE (f41e1b0 Azat Khuzhin) - o test: http/*: update expected HTTP codes for body exceeds `max_body_size` (addf2b9 Azat Khuzhin) - o test: http/data_length_constrains: set EVHTTP_CON_READ_ON_WRITE_ERROR (d38a723 Azat Khuzhin) - o test: increase buffer size for http/data_length_constraints to trigger EPIPE (0792e1e Azat Khuzhin) - o test/tinytest_demo: include for win32 to fix tdm-gcc (f062bbe Azat Khuzhin) - o test/regress: cover event_del() waiting mechanism (5b58b70 Azat Khuzhin) - o test/regress: cover existing signal callbacks and fork() + event_reinit() (ceddc60 Azat Khuzhin) - o test/regress: cover signals after fork() + event_reinit() (b075b81 Azat Khuzhin) - o test/regress: main/fork: rewrite assertions by just removing event in callback (088d8b3 Azat Khuzhin) - o test/dns: check exit code of evdns_getaddrinfo() (0b9d432 Azat Khuzhin) - o test/dns: cover evdns_getaddrinfo() and evdns_base_free() with @fail_requests (4ad3483 Azat Khuzhin) - o test/dns: cover @fail_requests for evdns_base_free() (d6c6fb4 Azat Khuzhin) - o test/dns: more graceful coverage of @fail_requests (123d372 Azat Khuzhin) - o test/ssl: cover busy-loop (i.e. {read,write}-blocked-on-{write,read} stuff) (da0ea7a Azat Khuzhin) - o test/http: write_during_read for https (23c77b6 Azat Khuzhin) - o test/http: connection_fail for https (7ea26f7 Azat Khuzhin) - o test/http: stream_out for https (ac04968 Azat Khuzhin) - o test/http: chunk_out for https (a71ffb9 Azat Khuzhin) - o test/regress: fix ssl-less builds (need to make this prettier) (3160716 Azat Khuzhin) - o test/http: allow dirty shutdown for ssl to fix https_incomplete (1ede326 Azat Khuzhin) - o test/http: https basic (59714b4 Azat Khuzhin) - o test/http: incomplete{,_timeout} for https (615490d Azat Khuzhin) - o test/http: add simplest test for http/https/https_dirty_shutdown (93b19dc Azat Khuzhin) - o test/http: https: retry coverage (7c2d24a Azat Khuzhin) - o test/http: https server support (plus some helpers) (a7088ad Azat Khuzhin) - o test/http: more sanity checks (a27c53c Azat Khuzhin) - o test/ssl: export getkey()/getcert()/get_ssl_ctx()/init_ssl() for https (0c4c387 Azat Khuzhin) - o test/regress_be: basic coverage bufferevent_flush() for pair/sock layers (ad52602 Azat Khuzhin) - o test/regress_be: socket_filter_inactive: check bufferevent after creation (f8081af Azat Khuzhin) - o test/regress_be: cover finalizers from inactive to active queue (337684b Azat Khuzhin) - o test/regress_buffer: fix clang compilation warnings (d8fd4c0 Azat Khuzhin) - o test/regress_http: fix compilation warnings (-Wmissing-field-initializers) (cd422e0 Azat Khuzhin) - o test/regress_dns: fix compilation warnings (-Wmissing-field-initializers/for) (f55db98 Azat Khuzhin) - o tests/regress_dns: cover that randomize-case works case-insensitive (1e8bfbc Azat Khuzhin) - o test: fix bufferevent/bufferevent_pair_release_lock in debug mode (3f749e9 Azat Khuzhin) - o test: fix bufferevent/bufferevent_pair_release_lock for freebsd (79f9ace Azat Khuzhin) - o test/regress_be: bufferevent_enable() shouldn't call eventcb by it's own (a0f308d Azat Khuzhin) - o test/regress_be: introduce fake_listener_create() (37dc9e0 Azat Khuzhin) - o test/regress_http: cover evhttp_request_own() (6f6fa0d Azat Khuzhin) - o test/regress_http: cover write during read (3d15aeb Azat Khuzhin) - o test/regress_http: verify that closecb will be called without multiple write (4be6c70 Azat Khuzhin) - o test/regress: fix bufferevent_pair_release_lock with EVENT_DEBUG_MODE (6ea6655 Azat Khuzhin) - o test/regress_ssl: check events fd/pending after timeout triggered (cdafdf0 Azat Khuzhin) - o test/regress_ssl: cover case when server didn't up (failed with timeout) (74845f1 Azat Khuzhin) - o test/regress_ssl: covert that we can't change fd with underlying (df507af Azat Khuzhin) - o test/regress_ssl: cover that events (read/write) at finish not pending (762edb4 Azat Khuzhin) - o test/regress_ssl: cover fd manipulations (b78a829 Azat Khuzhin) - o test/regress_ssl: convert open_ssl_bufevs() to mask (46bba73 Azat Khuzhin) - o test/regress_ssl: convert client/server to mask too (3455991 Azat Khuzhin) - o test/regress_ssl: cover "allow_dirty_shutdown" (0430327 Azat Khuzhin) - o test/regress_ssl: convert regress_bufferevent_openssl() to bitmask (342e116 Azat Khuzhin) - o tests/regress_ssl: drop duplicated assert (25e56fd Azat Khuzhin) - o test/regress_http: initialize "dns_base" to avoid reading trash (9f0bff3 Azat Khuzhin) - o test/http: cover retrying with saved conn_address by shutting down dns server (f4874d8 Azat Khuzhin) - o be_pair/regress: cover use of shared lock (lock/unlock/free) (a558fcd Azat Khuzhin) - o regress_dns: drop hack for event_debug_map_HT_GROW in leak tests (3540a19 Azat Khuzhin) - - Sample code - o Fix memory leak in signal-test.c (666db91 basavesh.as) - o sample/hello-world: exAmple, not eXMple (2d3cd35 kirillDanshin) - o dns-example: allow to set ns from args (df19a97 Azat Khuzhin) - o dns-example: convert to getopt() (32f8592 Azat Khuzhin) - o http-connect: make it win32 compilable (1bf7595 Azat Khuzhin) - o sample/https-client: allow to change path to ca-certificates (fdf713a Azat Khuzhin) - o sample/https-client: check for ERR_remove_thread_state() existence (c4e9d9b Azat Khuzhin) - o sample/https-client: replace ERR_remove_state() by ERR_remove_thread_state() (77ad68a Azat Khuzhin) - o sample/https-client: add -timeout option (4637aa8 Azat Khuzhin) - o sample/https-client: don't try to free uninitialized SSL (f3d7ff5 Azat Khuzhin) - o sample/https-client: graceful exit with freeing memory (to make valgrind happy) (24a1f25 Azat Khuzhin) - o https-client: correctly handle URLs with no path (like "https://host:port") (29a0482 Andrey Skriabin) - o sample/http-connect: don't use assert() to make it work with NDEBUG (6dc71e7 Azat Khuzhin) - o sample/http-connect: made it compatible with C90 (f976d43 Azat Khuzhin) - o sample: add HTTP CONNECT tunnelling example using libevent http layer (1d34498 Azat Khuzhin) - o Update dns-example. (620ff24 Mark Ellzey) - - Documentation - o Update README.md (b8ec70c Mark Ellzey) - o Update README.md (80faee9 Mark Ellzey) - o Update README.md (ad4a897 Mark Ellzey) - o Update README.md (a2b2e1e Mark Ellzey) - o Update README.md (0dfa5dc Mark Ellzey) - - Code Improvements (evthread) - o evthread: add evthread_get_{lock,condition}_callbacks() helpers (c0b34f6 Azat Khuzhin) - - Code Improvements (core) - o util: make @sa const for evutil_socket_connect_() (a8d32c2 Azat Khuzhin) - - Code Improvements (http) - o http: assert's that evbuffer_drain() success on connection reset (2185e63 Azat Khuzhin) - o http: introduce evhttp_request_free_() helper (22061ac Azat Khuzhin) - o http: introduce evhttp_is_request_connection_close() helper (6540da3 Azat Khuzhin) - - Code Improvements (bufferevents) - o be_sock: bufferevent_socket_set_conn_address(): assert instead of silent no-op (0ab88c2 Azat Khuzhin) - o be_sock: sanity check in bufferevent_socket_set_conn_address() (eedbeff Azat Khuzhin) - o be: replace sockaddr_storage with sockaddr_in6 for conn_address (3889612 Azat Khuzhin) - o be: replace conn_address by full struct instead of pointer (e5615aa Azat Khuzhin) - o bufferevent: move conn_address out from http into bufferevent (8bb3842 Azat Khuzhin) - o be: make @sa const for bufferevent_socket_connect() (dc33c78 Azat Khuzhin) - - Cleanups (core) - o Refactoring conditional directives that break parts of statements. (4b41eeb lzmths) - o epoll: introduce PRINT_CHANGES() macro to avoid copy-pasting (a1b142b Azat Khuzhin) - o tab (6e7a580 Greg Hazel) - - Cleanups (evbuffers) - o buffer_compat: fix comment -- we have EVBUFFER_EOL_ANY not EOL_STYLE_ANY (575ff67 Azat Khuzhin) - - Cleanups (bufferevents) - o be_sock: evutil_getaddrinfo_async_() always return 0 (dbff101 Azat Khuzhin) - o be_sock: drop be_sock_add() macro (useless and debug unfriendly) (fad5fe2 Azat Khuzhin) - o be: introduce bufferevent_generic_adj_existing_timeouts_() (3c1f58f Azat Khuzhin) - o be: add_event: use evutil_timerisset() (a96b73b Azat Khuzhin) - o be_openssl: introduce be_openssl_auto_fd() helper (2a8a711 Azat Khuzhin) - o be_openssl: introduce set_open_callbacks_auto() (510da71 Azat Khuzhin) - - Cleanups (http) - o http: make fallback for EVHTTP_CON_READ_ON_WRITE_ERROR more cleaner (d405492 Azat Khuzhin) - o http: coding style issue (365f181 Azat Khuzhin) - - Cleanups (evdns) - o evnds: inline TEST_NAME macro to make debuggin easier (0c615f4 Azat Khuzhin) - - Portability Fixes - o [#372] check for errno.h (3031617 Mark Ellzey) - o Fixed Unicode issue in error messages. (e8b7895 Mattes D) - o Assume that ke_udata is an integer type on CloudABI. (5602e45 Ed Schouten) - o Add missing include of . (b2c68bc Ed Schouten) - o Include , and optionally. (c1404b5 Ed Schouten) - o Test against SO_REUSEADDR (along with _WIN32). (ce1776c Ed Schouten) - o Always define missing TAILQ functions from sys/queue.h (2828bdb Christopher Wiley) - o Don't use BSD u_* types. (fd36647 Ed Schouten) - o Remove BSD-ism: TIMEVAL_TO_TIMESPEC(). (193c7de Ed Schouten) - o be: include all variations of headers for sockaddr_in6 struct (c212291 Azat Khuzhin) - o be: fix sockaddr_in6 type definition for win32 (c42bc6b Azat Khuzhin) - - Continious Integration: - o travis: split long lines, and make it cleaner (685a6a1 Azat Khuzhin) - o travis: fix autotools on osx by reinstalling libtool (088ea5e Azat Khuzhin) - o appveyor/autotools: link with openssl by passing LDFLAGS/CFLAGS (6fcfa25 Azat Khuzhin) - o appveyor: image already had openssl installed (4634b85 Azat Khuzhin) - o appveyor: check -DUNICODE -D_UNICODE according to ReleaseChecklist (cmake only) (e9acc44 Azat Khuzhin) - o appveyor: ignore failure of mingw-get (1810857 Azat Khuzhin) - o appveyor: drop shallow_clone, since we use tags for detecting version in cmake (ac90133 Azat Khuzhin) - o appveyor: support cmake & autotools using build matrix (like travis-ci has) (8f95015 Azat Khuzhin) - o travis-ci/osx: relink gcc/g++ instead of clang (481481d Azat Khuzhin) - o travis-ci: enable multi-os mode (osx, linux) (79917e4 Azat Khuzhin) - o travis-ci: increase matrix (--disable-foo) (59649f7 Azat Khuzhin) - o travis-ci: adjust alignment (c8be339 Azat Khuzhin) - o travis: add builds without debug mode into matrix (3e56da2 Azat Khuzhin) - o test: run regress with EVENT_DEBUG_MODE=1 and without (cf2cf2a Azat Khuzhin) - o Update travis config for status updates (37453ab Mark Ellzey) - o Use autotools for appveyor until cmake is fixed. (1cc2e29 Mark Ellzey) - o Fix the link for appveyor OpenSSL installer (WIN32) (107d565 Mark Ellzey) - o Forgot to install OpenSSL for appveyor (26164a5 Joakim Söderberg) - o Add support for appveyor.com windows CI (5f89c37 Joakim Söderberg) - - Build Improvements/Fixes: - o evutil: mark ai_find_protocol() static (prototype-less) (5a157c8 Azat Khuzhin) - o cmake/solaris: set CMAKE_REQUIRED_LIBRARIES to fix functions detections (dc95823 Azat Khuzhin) - o cmake/solaris: fix building (link with socket,nsl) (050bfc7 Azat Khuzhin) - o cmake: check for ZLIB_INCLUDE_DIR, since we can have only library without headers (c4dfb93 Azat Khuzhin) - o autotools/win32: fix searching ssl library (671a24f Azat Khuzhin) - o cmake/win32: do not compile regress_thread on -DEVENT__DISABLE_THREAD_SUPPORT=ON (de0c196 Azat Khuzhin) - o cmake/win32: do not compile evthread_win32 on -DEVENT__DISABLE_THREAD_SUPPORT=ON (ecb0ec8 Azat Khuzhin) - o cmake: fix -DEVENT__ENABLE_VERBOSE_DEBUG (typo on -DUSE_DEBUG) (e35f224 Azat Khuzhin) - o cmake: do not use stderr for notifications/version-info (38716c6 Azat Khuzhin) - o autoconf: fix --disable-thread-support build under win32 (bb09535 Azat Khuzhin) - o buffer: don't mix code and declarations (8892f4c Azat Khuzhin) - o Update gitignore file to ignore cscope gen'ed files (0aaa4fb Neeraj Badlani) - o For non GCC/clang on OSX the -Wno-deprecated-declarations may not be valid (b5ca365 Rainer Keller) - o automake: define serial-tests only if automake have this option (61179de Azat Khuzhin) - o test/automake: don't use paralell test harness (since automake 1.12) (44d755e Azat Khuzhin) - o Ignore all pkgconfig generated stuff (ce38993 Azat Khuzhin) - o libevent_core and libevent_extra also deserve a pkgconfig file (b8d7c62 Jan Heylen) - o Ignore verify_tests.bat (win32 version) (0f2de10 Azat Khuzhin) - o cmake: require 3.1 only for win32 to make it work under ubunty precise (87f7238 Azat Khuzhin) - o cmake: require at least 3.1 for target_sources() (c46ead5 Azat Khuzhin) - o cmake: fix adding of compiler flags, and now it will (36588e1 Azat Khuzhin) - o Replace -Wswitch-enum with -Wswitch, and add it into cmake rules too (f29f59e Azat Khuzhin) - o test/regress_ssl: Fix compile problems for win32 (73d0360 Trond Norbye) - o util: fix "%zu" format on TDM-gcc/MinGW-w64 (79b69d8 Azat Khuzhin) - o cmake: don't define EVENT__NEED_DLLIMPORT always (fixes VS2013 static build) (49bd790 Azat Khuzhin) - o Add missing return statement to del_wait_thread so libevent can build. (4f778ab Nick Mathewson) - o cmake: fix building dns-example under win32 (missing getopt) (a1609a8 Azat Khuzhin) - o visibility: align it to make it more readable (bb6b53d Azat Khuzhin) - o cmake: Fix detection of ssize_t/SSIZE_T (7707f6b Azat Khuzhin) - o Ignore more configure stuff (configure.lineno) (8d34302 Azat Khuzhin) - o Fixed issue with cmake version generation (d56efd9 Mark Ellzey) - o Cmake is now officially working. (7f9646d Mark Ellzey) - o More cmake updates, lot's of missing definitions (49a5381 Mark Ellzey) - o CMake syntax fixes fo .in files (6aad23d Mark Ellzey) - o Revert "The Windows socket type is defined as SOCKET." (a264da8 Mark Ellzey) - o CMAKE CMAKE CMAKE CLEANUPS (a9db46a Mark Ellzey) - o Lot's of cmake updates (8b228e2 Mark Ellzey) - o Provide a mechanism for building the library on Windows with different compiler flags. Add a batch file that builds it for the M[DT][d] options and performs a hunt and gather of the different output libraries. (ded8086 billsegall) - o The Windows socket type is defined as SOCKET. (c9e6c3d billsegall) - o autotools: fix getservbyname() detection (959a4c2 Azat Khuzhin) - o Add missing for openssl_hostname_validation module (3316a21 Azat Khuzhin) - o make test/regress_ssl.c compile without warnings (9f02a44 Thomas Bernard) - o test/regress_be: drop debug __asm__(int3) to fix arm build (8240379 Azat Khuzhin) - o event_debug_created_threadable_ctx_: fix compilation without debug mode (a068f2e Azat Khuzhin) - o Add a prototype for event_disable_debug_mode() (bfcedee Sebastian Hahn) - o http: eliminate warning about "socklen" in evhttp_connection_connect_() (dfad1a4 Azat Khuzhin) - o Updated gitignore (1dbb55d Mark Ellzey) - o Update bench_httpclient.c (cb96931 Seungmo Koo) - o *fix: bench_httpclient to support win32 (4e9325e zeliard) - o Commented out a WIN32 threading / timing test for now (e84e269 Mark Ellzey) - o Fix mixed declarations and code (forbidden by ISO C90) (0c7f217 Thomas Bernard) - o Fix "function declaration isn’t a prototype" (746d2c5 Thomas Bernard) - o This fixes a bug introduced in 27bd9faf498b91923296cc91643e03ec4055c230 (19ba454 Joakim Söderberg) - o changed strtotimeval signature as per #211 (bdbc823 Xiao Bao Clark) - o Added cmake-generated files to ignore list. (6c12bfe Matyas Dolak) - o Ignore `make dist` generated files (8a2c6c7 Azat Khuzhin) - - Debugging - o Debug mode option to error on evthread init AFTER other event calls. (dcfb19a Mark Ellzey) - - - -Changes in version 2.1.5-beta (5 January 2015) - - Security Fixes (evbuffers) - o Avoid integer overflow bugs in evbuffer_add() and related functions. See CVE-2014-6272 advisory for more information. (d49bc0e88b81a5812116074dc007f1db0ca1eecd) - - New APIs (evconnlistener) - o Provide support for SO_REUSEPORT through LEV_OPT_REUSABLE_PORT (b625361 Maciej Soltysiak) - - Bugfixes (core) - o Fix use-after-free error in EV_CLOSURE_EVENT callback (3cc0eac John Ohl) - o Fix race caused by event_active (3c7d6fc vjpai) - - Bugfixes (evbuffer) - o Fix evbuffer_peek() with len==-1 and start_at non-NULL. (ba59923) - o Consistently check for failure from evbuffer_pullup() (60f8f72) - o Fix evbuffer_peek() with len==-1 and start_at non-NULL. (fb7e76a) - - Bugfixes (windows, IOCP) - o be async: avoid double close() (f133b86 Azat Khuzhin) - - Bugfixes (bufferevents) - o Fix issue #127, double free for filterevents that use BEV_OPT_CLOSE_ON_FREE (2c82aa0 John Ohl) - o make bufferevent_getwatermark api more robust (a21e510 ufo2243) - o [Bugfix] fix bufferevent setwatermark suspend_read (b34e4ac ufo2243) - o bufferevent_openssl: reset fd_is_set when setfd with -1 is called (3da84c2 Azat Khuzhin) - o Fix compilation for older OpenSSL versions. (5c7282f Joakim Soderberg) - - New APIs (evhttp) - o Add evhttp_connection_set_family() to set addrinfo->family for DNS requests (12c29b0 Azat Khuzhin) - o Implement interface that provides the ability to have an outbound evhttp_connection free itself once all requests have completed (2b9ec4c,10fe4f John Ohl) - - New APIs (core) - o Implement new/free for struct evutil_monotonic_timer and export monotonic time functions (f2645f8 Andrea Shepard) - - Bugfixes (evdns) - o Load hosts file on Windows. (a0b247c Vilmos Nebehaj) - o Don't truncate hosts file path on Windows. (d0dc861 Vilmos Nebehaj) - o Fix a crash in evdns related to shutting down evdns (9f39c88,e8fe749) - o evdns: avoid read-after-free in evdns_request_timeout_callback() (61262a0 Azat Khuzhin) - o Correctly handle allocation failures in evdns_getaddrinfo (6a53d15) - o evdns: fix EVDNS_BASE_DISABLE_WHEN_INACTIVE in case retransmit/retry (74d0eee Azat Khuzhin) - o evdns: add retry/reissue tests for EVDNS_BASE_DISABLE_WHEN_INACTIVE (3ca9d43 Azat Khuzhin) - o evdns: fail ns after we are failing/retrasmitting request (97c750d Azat Khuzhin) - - Bugfixes (evhttp) - o http: reset connection before installing retry timer (fix http retries handling) (bc79cc5 Azat Khuzhin) - - - Testing - o regress_dns: fix leaks in getaddrinfo_async{,_cancel_stress} tests (2fdc5f2 Azat Khuzhin) - o test: add family argument for http_connection_test_() (177b8a7 Azat Khuzhin) - o test: add regress for evhttp_connection_set_family() with AF_INET and AF_UNSPEC (42aefeb Azat Khuzhin) - o test/http: add regress test for set family to AF_INET6 (3fbf3cc Azat Khuzhin) - o Update to a more recent tinytest_macros. (8da5a18) - o test/regress: add simplestsignal: to track reorder bugs separately (b897bef Azat Khuzhin) - o test/evbuffer_peek: add regress in case we have first buffer greater (e2d139d Azat Khuzhin) - o More evbuffer_peek() test cases (154006a) - o use correct tt macro for pointer compare (08c88ea) - o regress_buffer: fix 'memcmp' compare size (79800df Maks Naumov) - o Fix a use-after-free in unit tests. CID 752027 (3739057) - o Fix a dead-code warning in unit tests. CID 1193548 (c119f24) - o Use evutil_weakrand() in unit tests. (a677b72, 364c110) - o Use a more precise calculation for max in time-ratelim.c (ca5b5c7) - o Make a buffer larger in the tests to avoid a scary evbuffer_copyout_from() (fb57b8b) - o Fix several memory leaks in the unit tests. (89c1a3b) - o Add test for evhttp_connection_free_on_completion (b0e9924 John Ohl) - o Fix annoying heisenbug in test-time.c (cb73704) - - Sample code - o Make http-server.c output into good html5 (6d72bdc) - o Use FindClose for handle from FindFirstFile in http-server.c (6466e88) - o https-client: add -retries argument, for connection retries (d9da844 Azat Khuzhin) - - Bugfixes (build) - o Add missing headerfile for cmake (15d90cc Trond Norbye) - o ignore one more test binary (b6593aa Michael Richardson) - o ignore config.cache/test-driver files (c83f333 Mike Frysinger) - o add a --disable-samples configure flag (0c492b3 Mike Frysinger) - o Add a few files created by "make verify" to .gitignore. (1a8295a Pierre Phaneuf) - o updates in cmake build (27bd9fa Sergey Nikulov) - o Fix cmake error when the Module path has more than one entry. (befbd13 Acer Yang) - o Fix CMake shared library build (e69d910 Nobuaki Sukegawa) - o Fix warnings when compiling with clang 3.5 (f5b4765 John Ohl) - o Fix mixed declarations and code (forbidden by ISO C90) (8afbdbc Thomas Bernard) - - Bugfixes (miscellaneous) - o tree.h: drop duplicated content of tree.h (6193187 Azat Khuzhin) - o evdns: disable probing with EVDNS_BASE_DISABLE_WHEN_INACTIVE (610410b,ad0493e,fea86a6,d83b337,5ca9e97 Azat Khuzhin) - o [Bugfix] fix grammer error (3a4d249 ufo2243) - o Change return type of evutil_load_windows_system_library_ to HMODULE (f691389) - o Fix a c90 warning (76643dd) - o Fix a typo in a doxygen comment. Reported by 亦得. (be1aeff) - o remove trailing comma from enum (b361b8a Jean-Philippe Ouellet) - - Bugfixes (FreeBSD) - o Handle ENOTCAPABLE from FreeBSD - this is returned if an event in the changelist is for an FD that has been closed. (6fd7394 Adrian Chadd) - - - -Changes in version 2.1.4-alpha (21 Mar 2014) - - Libevent 2.1.4-alpha adds a number of new miscellaneous APIs to make - Libevent more useful, including support for early close detection with - epoll via EPOLLRDHUP, triggering bufferevent callbacks, adding more - evhttp callbacks, and more. There are also numerous bugfixes, including - a number for finalize-related issues from 2.1.3-alpha; and an - alternative (non-primary!) cmake-based build mechanism. - - New APIs (core) - o Added event_base_get_num_events() (0fa107d Mobai Zhang) - o New event_base_active_by_fd API (865a142 Greg Hazel, 5c9da9a, 87fa2b0) - o Add event_base_active_by_signal by analogy (4865943) - o Add access to max event count stats (5173bef, efbd3dc, 26230a2 - Andrew Sweeney) - o Implemented EV_CLOSED event for epoll backend - (EPOLLRDHUP). (b1b69ac Diego Giagio, 53d2793, 43ffcf6, dfe1e52 - Marcin Juszkiewicz, ff26633 Joakim Soderberg, 3908a5e) - - New APIs (evutil_secure_rng) - o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7) - - New APIs (bufferevents) - o Add function to fetch underlying ratelimit cfg (4b3d5af Mark Ellzey) - o Pass and return const for bufferevent_get_token_bucket_cfg (1c77fbb - Mark Ellzey) - o Add watermark introspection (4ce242b Ondřej Kuzník) - o Add an option to trigger bufferevent I/O callbacks (61ee18b Ondřej Kuzník) - o Add an option to trigger bufferevent event callbacks (a7384c7 - Ondřej Kuzník) - o Clarifications in response to merge req. comments (bd41947 Ondřej - Kuzník) - o Minor optimizations on bufferevent_trigger options (a3172a4) - - New APIs (evhttp) - o Add evhttp_connection_get_server(). (a7f82a3 Maxime Henrion) - o add a http default content type option (5a5acd9 Nicolas Martyanoff) - o http: implement new evhttp_connection_get_addr() api. (0c7f040 Azat - Khuzhin) - o Add a variant of evhttp_send_reply_chunk() with a callback on - evhttp_write_buffer() (8d8decf Julien BLACHE) - o Allow registering callback for parsing HTTP headers (b0bd7fe Balint Reczey) - o Provide on request complete callback facility (b083ca0 Andrew Sweeney) - o evhttp_request_set_on_complete_cb to be more specific about what - the function actually does and usage (da86dda Andrew Sweeney) - o Update unit test to make sure that the callback happens after the - output data is written (b85f398 Andrew Sweeney) - - Features (evdns) - o bug fix for issues #293 evdns_base_load_hosts doesn't remove - outdated addresses (954d2f9, f03d353, 45eba6f Kuldeep Gupta) - - Features: (cmake build support) - o Initial CMake commit. (e415196 Joakim Soderberg) - o Add all tests and benchmarks to CMake project. (e9fc014 Joakim Soderberg) - o More work on adding tests to CMake project (99c1dc3 Joakim Soderberg) - o Generate a dummy evconfig-private.h so things build - properly. (ce14def Joakim Soderberg) - o Link libm on unix platforms. (58fcd42 Joakim Soderberg) - o Added some GCC specific options. (19222e5 Joakim Soderberg) - o Use evutil_closesocket instead. (dbf2b51 Joakim Soderberg) - o Add copyright and licensing files for CMake modules. (c259d53 - Joakim Soderberg) - o Only include WIN32 getopt where it is used. (9bbce0b Joakim Soderberg) - o Fix bench_cascade program on Windows. (78da644 Joakim Soderberg) - o Don't segfault on no found event backend. (8f2af50 Joakim Soderberg) - o Only test the event backends available on the system. (7ea4159 - Joakim Soderberg) - o Added a "make verify" target. (e053c4f Joakim Soderberg) - o Fix the make "verify" target on Windows. (67e5d74 Joakim Soderberg) - o Get rid of deprecation warnings for OpenSSL on OSX 10.7+ (69c3516 - Joakim Söderberg) - o Fix kqueue support. (a831f2f Joakim Söderberg) - o Added a test for testing if kqueue works with pipes. (2799b35 - Joakim Söderberg) - o Change the BSD license from 4 to 3-clause. (86df3ed Joakim Soderberg) - o Minimum required python version is 2.4. (968e97b Joakim Soderberg) - o Get rid of unknown pragma warnings. (0ef1d04 Joakim Soderberg) - o Add a "make verify_coverage" target generation coverage - info. (f2483f8 Joakim Soderberg) - o Fix the "make verify" target on NetBSD (4ac086a Joakim Soderberg) - o Only look for ZLib when it is used (if tests are - included). (f780593 Joakim Soderberg) - o Added EVENT__ENABLE_GCC_WARNINGS, turns all warnings into - errors. (dd413bd Joakim Soderberg) - o Add CMake config and install targets. (f3446ed Joakim Soderberg) - o Fix typo (4b754df Joakim Soderberg) - o Some work on making it possible to simply do add_subdirectory() on - the project. (49ab363 Joakim Soderberg) - o Set USE_DEBUG=1 on EVENT__ENABLE_VERBOSE_DEBUG (fd42e70 Joakim Soderberg) - o Fix so that old nmake project still builds. (24d6466 Joakim - Soderberg) - o Rename README to README.md and use markdown to format. (d2bc39a - Joakim Soderberg) - o Update README with CMake build instructions. (604b8cc Joakim Soderberg) - o Clean up the README some. (8d4cb35 JoakimSoderberg) - o Forgotten headers for old nmake project compatability. (8697b99 - Joakim Soderberg) - o Change all uses of WIN32 to _WIN32 (4e14395 Joakim Söderberg) - o Fix include bug. (2024467 Joakim Söderberg) - o Check if we're on OSX before disabling deprecation in le-proxy - (8b40a5b Joakim Söderberg) - o Fix broken autotools build. (ae1bd82 Joakim Söderberg) - o Disclaimerize cmake a little in the README (d03b5bf) - o Fix CMake compile when OpenSSL is disabled. (e423d42 Joakim - Söderberg) - o CMake: Get rid of python not found warning when regress tests - turned off. (d38d798 Joakim Söderberg) - o Fix https-client compilation on Windows. (d7be788 Joakim Soderberg) - o Guard against EVENT_NOWIN32 being set during testing. (f1715b4 - Joakim Soderberg) - o Check for OSX when checking for clang. (e212c54 Joakim Soderberg) - o Added a Travis-CI configuration file. (8c0f0a9 Joakim Soderberg) - o Added -Qunused-arguments for clang on macosx (ed99d92 Trond Norbye) - o Rename event_extras to event_extra (a0dd5df Trond Norbye) - o Add option to build shared library (4545fa9 Trond Norbye) - o Add -Qunused-arguments for clang on macos (b56611d Trond Norbye) - o Add cmake-related files to .gitignore (e061321 Trond Norbye) - o Export event_extra not event_extras. (2b41bcf Joakim Söderberg) - - Bugfixes (core) - o If evsel->del() fails, don't leave the evmap in an inconsistent - state (9b5a527 Maxime Henrion) - o Move event_debug_note_teardown_ before mm_free. (69b5c64) - o Check CLOCK_MONOTONIC_* at runtime if needed. (911abf3) - o Fix reinit of fds with EV_WRITE but not EV_READ. (ebfd8a8 maksqwe) - o Tweaked callbacks to prevent race condition - (https://github.com/libevent/libevent/issues/104) (40830f1, 2ea15ed - John Ohl) - o Move assert(ev) to before we use ev in EV_CLOSURE_EVENT_FINALIZE - case (9805972) - - Bugfixes (evhttp) - o Fix a double close() bug in evhttp when the underlying bufferevent uses - BEV_OPT_CLOSE_ON_FREE. (31db8a0 Maxime Henrion) - o Fix an unlikely but possible error case for http connections (f22049e) - o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum) - - Bugfixes on 2.0 (Windows) - o Use windows vsnprintf fixup logic on all windows environments (e826f19) - o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) - (b8f5980 Frank Denis) - - Bugfixes (evutil_secure_rng) - o When we seed from /proc/sys/kernel/random/uuid, count it as success - (e35b540) - o We should return after arc4random_buf() (1ea1f26 Makoto Kato) - o Avoid other RNG initialization FS reads when urandom file is - specified (9695e9c) - o Really remove RNG seeds from the stack (f5ced88) - o Fix another arc4random_buf-related warning (e64a2b0) - - Bugfixes (bufferevents) - o Initialize async bufferevent timeout CBs unconditionally (af9b2a7) - - Bugfixes (evdns) - o Checking request nameserver for NULL, before using it. (5c710c0 - Belobrov Andrey) - o Fix SEGFAULT after evdns_base_resume if no nameservers - installed. (14971a8 Azat Khuzhin) - o Actually use the log facility for reporting evdns problems. (e1766a1) - o Fix SEGFAULT after evdns_base_resume if no nameservers - installed. (f8d7df8 Azat Khuzhin) - o fix for ServFail from RIPE Atlas release (62f596b Antony Antony) - - Bugfixes (compilation) - o Fix test compilation with nmake: add the gdi.lib dependency (5ba8ab7) - o Whoops. It is gdi.lib, not gdi32.lib. (github issue #61) (8ab612e) - o Don't use return since return type is void and build error occurs - using clang (838161d Makoto Kato) - o Use void casts to suppress some "unchecked return value" warns (7080d55) - o rpcgen: Generate regress.gen.[c,h] in build rather than src dir - (243386c Ross Lagerwall) - o Fix a compiler warning when checking for arc4random_buf linker - breakage. (5cb3865) - o Fix 'make distcheck' by adding regress.gen.[ch] to DISTCLEANFILES - (239d834) - - o Fix a c90 warning (c207682) - o Fix consts in WIN32-Code/getopt*.[ch] (57abb35) - - Bugfixes (locks, synchronization) - o Missed lock acquire/release in event_base_cancel_single_callback_() - (d3d999a Azat Khuzhin) - o Fix locking in bufferevent_get_options_(). (dbc9cd4 Maxime Henrion) - - Bugfixes (leaks) - o Avoid leaking segment mappings when offset is not a page multiple (d409514) - - Testing - o Add tests for evdns_base_resume(). (1cd9ff5 Azat Khuzhin) - o Fix dns/leak_resume_send_err test. (7e876df Azat Khuzhin) - o Add checks for evhttp_connection_get_server() in unit - tests. (fbc323b Maxime Henrion) - o Fix a (failure-only) null dereference in the unit tests (1104d0b) - o Fix a logic error in test_evbuffer_freeze (7765884) - o Add missing check to test_evbuffer_file_segment_add_cleanup_cb (eba4506) - o Fix some crash-on-fail cases in DNS regression tests (87cd6f0) - o DNS tests: add a missing check (f314900) - o Finalize tests: add a missing check (82b6956) - o test_evutil_rtrim: add another missing check. (e193c95) - o regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset - (611e28b Azat Khuzhin) - o regress_http: add tests for evhttp_connection_get_addr() (4dd500c - Azat Khuzhin) - o Update to the latest version of tinytest (7a80476) - o Heap-allocate zlib data structure in regress_zlib tests (4947c18) - - Performance tweaks (core) - o Avoid redundant syscall to make a nonblocking socket nonblocking - (42c03da Maxime Henrion) - o Avoid redundant syscall if making a socket cloexec twice (1f29b18) - o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62) - - Documentation - o Document that arc4random is not a great cryptographic PRNG. (6e49696) - o Small doxygen tweaks (6e67b51) - o Try another doxygen tweak (ccf432b) - o Clarify event_base_loop exit conditions (031a803) - o Fix a typo (be7bf2c Ondřej Kuzník) - o Document deferred eventcb behaviour (13a9a02 Ondřej Kuzník) - o Typo fixes from Linus Nordberg (cec62cb, 8cd695b) - o Fix duplicate paragraph in evbuffer_ptr documentation (58408ee) - - Code Improvements (coverity) - o Fix a pile of coverity warnings in the unit tests (867f401) - o Fix coverity warnings in benchmark tools. (ff7f739) - o Whoops; fix compilation in bench.c (544cf88) - o Remove spurious checks in evrpc.c error cases (coverity) (991b362) - o Fix a couple of compilation warnings in regress_http.c (860767e) - o Fix even more coverity warnings. (d240328) - o Stop checking for inet_aton; we don't use it. (f665d5c) - o Add an include to evrpc-internal to fix openbsd compilation warning - (5e161c6) - - Cleanups - o Remove an unreachable return statement in minheap-internal.h (e639a9e) - o Refactor evmap_{io,signal}_active_() to tolerate bad inputs (974c60e) - o Fix needless bufferevent includes in evdns.c (254c04e) - o Fix a couple of "#ifdef WIN32" instances (88ecda3) - o Remove unneeded declaration in bufferevent-internal.h (4c8ebcd) - - Sample code - o le-proxy: Fail more gracefully if opening listener fails (44b2491) - o http-server: drop uri_root from base_url in http-server. (6171e1c Azat Khuzhin) - o https-client: POST supported, args supported (c5887f7 Alexey Ozeritsky) - o https-client: code cleanup (29af65e Alexey Ozeritsky) - o https-client: Small tweaks to https-client.c (90786eb) - o https-client: Set hostname for SNI extension (by f69m) (d1976f8) - o https-client: add a cast to https-client.c (462e6b6) - - - -Changes in version 2.1.3-alpha (1 May 2013) - - Libevent 2.1.3-alpha fixes various bugs, adds new unit tests, and cleans - up the code in a couple of places. It has a new callback in evhttp for - reporting errors during a request, a new feature for allowing evdns to - not keep the event_base looping when there are no requests inflight, and - example code for writing an https client. - - Libevent 2.1.3-alpha also has an important new (experimental) event - finalization feature to allow safe event teardown in multithreaded - programs. This ought to fix the longstanding bug with deadlocks in - multithreaded use of SSL-based bufferevents that some people have been - experiencing since Libevent 2.0. - - - Core (event finalization) - o Implement event_finalize() and related functions to avoid certain - deadlocks (8eedeab) - o Use finalization feature so bufferevents can avoid deadlocks (02fbf68) - o Always run pending finalizers when event_base_free() is called (e9ebef8) - o Remove bufferevent_del_generic_timeout_cbs as now unused (4ea4c6a) - o More documentation for finalization feature (a800b91) - o Make the event_finalize* functions return an error code (5d11f4f) - o Mark the finalize stuff as experiemental in case it needs to - change (23e2e29) - - Evdns - o evdns: New flag to make evdns not prevent the event loop from - exiting (6b7fa62 Azat Khuzhin) - - Bugfixes (Core) - o Make event_remove_timer behave correctly with persistent timers (5623e80) - o Unit test for event_remove_timer with EV_PERSIST. (96150dd) - o Double-check next timeout when adding events (9443868 Nate Rosenblum) - o event_base_update_cache_time should be a no-op if the loop isn't - running (5e6fa2a) - - Bugfixes (evhttp, crash fix, from 2.0) - o fix #73 and fix http_connection_fail_test to catch it (b618204 Greg Hazel) - - Bugfixes (compilation and portability, from 2.0) - o Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled (7e45739) - o Fix missing AC_PROG_SED on older Autoconfs (9ab2b3f Tay Ray Chuan) - o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) - (74d4c44 Kevin Bowling) - o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake - 1.13 compat (817ea36) - o Rename configure.in to configure.ac to appease newer autoconfs (0c79787) - o Avoid using top_srcdir in TESTS: new automakes do not like this (a55514e) - - Bugfixes (resource leaks/lock errors on error, from 2.0) - o Avoid leaking fds on evconnlistener with no callback set (69db261) - o Avoid double-close on getsockname error in evutil_ersatz_socketpair - (0a822a6) - o Fix a locking error in bufferevent_socket_get_dns_error. (0a5eb2e) - - Documentation Fixes (from 2.0) - o Fix a mistake in evbuffer_remove() arguments in example http server code - (c322c20 Gyepi Sam) - o Fix a typo in a comment in buffer.h. Spotted by Alt_F4 (773b0a5) - - Documentation Fixes - o minor documentation typos (809586a Patrick Pelletier) - o Fix cut-and-paste err in whatsnew-2.1 (49905ac) - o Fix comment to refer to sample/include.am correctly (9e8cdf3 Sebastian - Hahn) - o Fix typo : Dispatching instead of Dispaching (0c2bacc Volker Lendecke) - o fix some hinky indentation in evhttp_make_request (80e220e Patrick - Pelletier) - o "buffer" spelling (a452811 Patrick Pelletier) - o Specify return behavior in header for evbuffer_pullup() in corner case - (cf8d1cd Dan Petro) - o Clarify an important point about event_base_foreach_event() (920a5e6) - - Compilation Fixes/Tool Support - o avoid valgrind false positive by zeroing epoll_event (1258614 Patrick - Pelletier) - o Fix harmless clang enum warning (b452a43 Sebastian Hahn) - o remove all exes on "make clean", not just regress.exe (974bfa0 Patrick - Pelletier) - o Make --disable-libevent-regress work again (787fd74) - o Do not build strlcpy.c when it will have no code. (4914620) - - Portability Fixes - o When EWOULDBLOCK is not EAGAIN, treat it as equivalent to it (bf7a0ff) - o Preliminary changes for Minix3. (0dda56a Nicholas Heath) - o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 1.13 - compat (bf278b) - o Avoid using $(top_srcdir) in TESTS. (2863c83) - o build test/test-script.sh on systems with a less-featureful $< (f935e21) - o Implement EVUTIL_ERR_IS_EAGAIN on windows. (42aaf4d) - - Evhttp changes: - o Fix ipv6 support for http. When URL contain domain, not IP - address. (71e709c Azat Khuzhin) - o uri decode: fix for warning "use of uninitialised value" (64b6ece Azat - Khuzhin) - o uri decode: changed the test for the existence of the next character - (e1903e3 Azat Khuzhin) - o Move prototype of evhttp_decode_uri_internal() to http-internal.h - (de8101a Azat Khuzhin) - o Test: decoding just part of string with evhttp_decode_uri_internal() - (1367653 Azat Khuzhin) - o Add new error_cb for actual reporting of HTTP request errors. (7b07719 - Azat Khuzhin) - o Add test for EVREQ_HTTP_REQUEST_CANCEL into http_cancel_test() (862c217 - Azat Khuzhin) - o Drop extra header http_struct.h from regress_http.c (54cc800 Azat Khuzhin) - - Testing - o Add regress test ipv6_for_domain. (9ec88bd Azat Khuzhin) - o Add an environment variable (EVENT_DEBUG_MODE) to run unit tests in debug - mode (2fad0f3) - o Add a test with an active_later event at event_base_free time. (1c3147f) - o Make all tests pass under EVENT_DEBUG_MODE=1 (b1b054f) - o Add some verbose notes to bufferevent unit tests (9d893c9) - o New test for active_later->active transition on event_active (a153874) - o New tests for event_base_foreach_event() (0b096ef) - o Unit tests for event_base_gettimeofday_cached() and - event_base_update_cache_time() (30ea291) - o A test for event_get_assignment() (f09629e) - o More unit tests for initializing common timeouts. (d596739) - o Fix a bug in the new main/event_foreach test (702c9aa) - - Windows: - o use FormatMessage for winsock errors (0c6ec5d, 2078e9b, 4ccdd53, c9ad3af - Patrick Pelletier) - o a program to print out the error strings for winsock errors (7296512 - Patrick Pelletier) - o Fix a warning introduced in 0c6ec5d8 (eeb700c) - o Fix another warning introduced in 0c6ec5d8 (ed26561) - - Examples (http) - o Add sample/https-client.c, an example of stacking evhttp as a client on - top of bufferevent_ssl. (be46c99 Catalin Patulea) - o use ${OPENSSL_LIBS} instead of -lssl -lcrypto (bf31fa5 Patrick Pelletier) - o https-client was putting newlines at 256-byte boundaries (42d7441 Patrick - Pelletier) - o better handling of OpenSSL errors (5754d96 Patrick Pelletier) - o use Debian's default root certificate location (aacd674 Patrick Pelletier) - o use iSECPartners code to validate hostname in certificate (64d9f16 - Patrick Pelletier) - o avoid sign mismatch warning in openssl_hostname_validation.c (6021cb5 - Patrick Pelletier) - o pull in wildcard matching code from cURL (4db9da6 Patrick Pelletier) - o Another tweak to https-client.c (95acdaa) - o Remove http_struct.h usage in sample/https-client.c (8a90a85) - - - -Changes in version 2.1.2-alpha (18 Nov 2012) - - Libevent 2.1.2-alpha includes more portable for monotonic timers, - refactors much of Libevent's internal and external infrastructure, - closes some longstanding gaps in the interface, makde other - improvements. Ths log below tries to organize features by rough area of - effect. It omits a few commits which were pure bugfixes on other commits - listed below. For more detail, see the git changelogs. For more - insight, see the "whatsnew-2.1.txt" document included in the Libevent - 2.1.2-alpha distribution. - - Libevent 2.1.2-alpha also includes all changes made in 2.0.19-stable - through 2.0.21-stable inclusive. - - Performance (core): - o Replace pipe-based notification with EVFILT_USER where possible. This - should make multithreaded programs on OSX and *BSD alert the main thread a - little faster. (53a07fe) - o Make th_base_lock nonrecursive. (9cd5acb) - - New/Changed API Functions: - o New event_get_priority() function to return an event's priority (f90e255) - o Add a bufferevent_get_priority() function (bd39554) - o Add an event_base_loopcontinue() to tell Libevent to rescan for more - events right away (7d6aa5e) - o Add a new callback to get called on evbuffer_file_segment free - (e9f8feb yangacer, 64051b9) - o Expose event_base_foreach_event() as a public API. (84fd6d7 Roman - Puls, 232055e, ffe1643) - o Add an event_remove_timer() to remove timer on an event without - deleting it (e3b2e08) - o Make bufferevent_set_timeouts(bev, NULL, NULL) have plausible - semantics (9dee36b) - o Rename event_enable_lock_debuging() to ..._debugging(). (The old name - should still work.) (07e132e) - o Add missing implementation for event_enable_debug_logging (3b3e21d) - - PORTABLE MONOTONIC TIMERS: - - Libevent 2.1.2 includes internal support for monotonic timers on - (nearly) all supported platforms, including Windows, and OSX. Libevent - applications should now be more resilient to jumps forwards or backwards - in the system clock. Also, on Linux systems with epoll, we now - optionally support microsecond-level timeouts (whereas epoll only - supports millisecond-precision timeouts). - - o Use mach_absolute_time() for monotonic clock support on OSX. (b8fd6f9) - o Do not track use_monotonic field when is no monotonic clock (cb653a0) - o EVENT_BASE_FLAG_PRECISE_TIMER indicates we want fine timer precision - (ddd69d3) - o On Linux, use CLOCK_MONOTONIC_COARSE by default (55780a7) - o Implement a GetTickCount-based monotonic timer for Windows (d5e1d5a) - o Refactor monotonic timer handling into a new type and set of - functions; add a gettimeofday-based ratcheting implementation (f5e4eb0) - o Add EVENT_PRECISE_TIMER environment var for selecting precise-but-slow - timer (a2598ec) - o Implement fast/precise monotonic clocks on Windows (2c47045) - o Simple unit tests for monotonic timers (630f077) - o Improve the monotonic-time unit test: make it check the step size (7428c78) - o When PRECISE_TIMERS is set with epoll, use timerfd for microsecond - precision (26c7582) - o Split out time-related evutil functions into a new evutil_time.c (c419485) - o Split out time-related prototypes into time-internal.h (71bca50) - o Add evutil_time.obj to Makefile.nmake (0ba0683) - o Avoid giving a spurious warning when timerfd support is unavailable - (1aaf9f0 Dave Hart) - o Make test_evutil_monotonic a little more tolerant (def3b83) - o Avoid unused-var warning on systems with clock_gettime but without - CLOCK_MONOTONIC_COARSE (9be5468) - -EVENT_BASE_ONCE LEAKS: - If a callback added by event_base_once() is never invoked, Libevent no - longer leaks internal memory. - - o Free dangling event_once objects on event_base_free() (c17dd59) - o Add a unit test in which an event is created with event_base_once() - but never fires (4343edf) - -TESTING SUPPORT, FIXES AND IMPROVEMENTS: - - Libevent now disables by default its unit tests that would touch the - network, or that tend to fail on heavily-loaded systems. To re-enable - them, invoke the ./test/regress program with the @all alias. - - o Simplify test.sh code significantly. (9b856fd Ross Lagerwall) - o Make all tests that hit the network disabled by default (f2cea87) - o Avoid a resource leak on error in http client benchmark (ea92fba) - o Update to latest tinytest (911b4f0349377) (ef7c4f7) - o Avoid (unlikely) overflow in bench_httpclient.c (5671033) - o Shave 700 msec off the persistent_timeout_jump test (21205b8) - o Check return value of write() in regress.c (c8009d2) - o Make load-dependent monotonic timer tests off-by-default (2b6fe8b) - o Add deferred_cb_skew to list of timing-dependent tests (34c8f31) - o Avoid test -e; older shs don't have one. (f1bd938) - o Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086) - o Fix a couple of compile warnings in the unit tests (5a9a014) - -MISC: - o Change evutil_weakrand_() to avoid platform random() (e86af4b Nicholas - Marriott, 3aa4415) - -INFRASTRUCTURE (Active-later events): - As a simplification and optimization to Libevent's "deferred callback" - logic (introduced in 2.0 to avoid callback recursion), Libevent now - treats all of its deferrable callback types using the same logic it uses - for active events. Now deferred events no longer cause priority - inversion, no longer require special code to cancel them, and so on. - - o Refactor the callback part of an event into its own event_callback - type (cba59e5) - o Add "active later" event_callbacks to supersede deferred (745a63d) - o event_base_assert_ok: check value of event_active_count for - correctness (fec8bae) - o Replace deferred_cbs with event_callback-based implementation. (ae2b84b) - o Replace more deferred_cb names with event_callback (a4079aa) - o Give event_base_process_active a single exit path (581b5be) - o Restore our priority-inversion-prevention code with deferreds (c0e425a) - o Refactor event_persist_closure: raise and extract some common logic - (bec22b4) - o Remove the unused bits from EVLIST_ALL (9889a3d) -||||||| merged common ancestors -Changes in version 2.0.22-stable (?? Dec 2013) - - (As of 3b77d62829c4393bda6f9105a5d3b73b48a64b71.) - -BUGFIXES (evhttp) - o fix #73 and fix http_connection_fail_test to catch it (crash fix) (b618204 Greg Hazel) - o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum) - -BUGFIXES (compilation and portability) - o Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled (7e45739) - o Fix missing AC_PROG_SED on older Autoconfs (9ab2b3f Tay Ray Chuan) - o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) (74d4c44 Kevin Bowling) - o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 1.13 compat (817ea36) - o Rename configure.in to configure.ac to appease newer autoconfs (0c79787) - o Avoid using top_srcdir in TESTS: new automakes do not like this (a55514e) - o Use windows vsnprintf fixup logic on all windows environments (e826f19) - o Fix a compiler warning when checking for arc4random_buf linker breakage. (5cb3865) - o Fix another arc4random_buf-related warning (e64a2b0) - -BUGFIXES (resource leaks/lock errors on error) - o Avoid leaking fds on evconnlistener with no callback set (69db261) - o Avoid double-close on getsockname error in evutil_ersatz_socketpair (0a822a6) - o Fix a locking error in bufferevent_socket_get_dns_error. (0a5eb2e) - o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) (b8f5980 Frank Denis) - -BUGFIXES (miscellaneous) - o Avoid other RNG initialization FS reads when urandom file is specified (9695e9c, bb52471) - o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62) - -BUFGIXES (evdns) - o Checking request nameserver for NULL, before using it. (5c710c0 Belobrov Andrey) - o Fix SEGFAULT after evdns_base_resume if no nameservers installed. (f8d7df8 Azat Khuzhin) - -BUGFIXES (evutil_secure_random) - o When we seed from /proc/sys/kernel/random/uuid, count it as success (e35b540) - o Document that arc4random is not a great cryptographic PRNG. (6e49696) - o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7) - o Really remove RNG seeds from the stack (f5ced88) - - -DOCUMENTATION FIXES - o Fix a mistake in evbuffer_remove() arguments in example http server code (c322c20 Gyepi Sam) - o Fix a typo in a comment in buffer.h. Spotted by Alt_F4 (773b0a5) - - - -Changes in version 2.0.21-stable (18 Nov 2012) -BUGFIXES: - o ssl: Don't discard SSL read event when timeout and read come close together (576b29f) - o ssl: Stop looping in "consider_reading" if reading is suspended. (f719b8a Joachim Bauch) - o ssl: No need to reserve space if reading is suspended. (1acf2eb Joachim Bauch) - o dns: Avoid a memory-leak on OOM in evdns. (73e85dd, f2bff75 George Danchev) - o build: Use python2 rather than python (0eb0109 Ross Lagerwall) - o build: Compile without warnings on mingw64 (94866c2) - o build: Fix compilation on mingw64 with -DUSE_DEBUG (62bd2c4) - o build: Make rpcgen_wrapper.sh work on systems without a "python2" binary (f3009e4) - o iocp: Close IOCP listener socket on free when LEV_OPT_CLOSE_ON_FREE is set (cb853ea Juan Pablo Fernandez) - o core: Avoid crash when event_pending() called with no event_base set on event (e3cccf3) - o misc: remove stray 'x' so print_err will compile when uncommented (ac35650 Patrick Pelletier) - o tests: Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086) - o tests: Warn when openssl version in unit test mismatches compiled version. (ac009f9) - - -Changes in version 2.0.20-stable (23 Aug 2012) -BUGFIXES: - o core: Make event_pending() threadsafe. (be7a95c Simon Liu) - o win32: avoid crash when waiting forever on zero fds. (160e58b) - o evhttp: Fix a memory leak on error in evhttp_uriencode (11c8b31) - o evbuffer: Avoid possible needless call to writev. Found by coverity. (6a4ec5c) - o evdns: memset sockaddr_in before using it. Found by coverity. (a1a0e67) - o evhttp: Check more setsockopt return values when binding sockets. Found by coverity (a0912e3) - o evdns: Avoid segfault on weird timeout during name lookup. (dc32077 Greg Hazel) - o bufferevent_ssl: Correctly invoke callbacks when a SSL bufferevent reads some and then blocks. (606ac43) - - -PORTABILITY FIXES: - o check for arc4random_buf at runtime, on OS X (bff5f94 Greg Hazel) - o Correctly check for arc4random_buf (fcec3e8 Sebastian Hahn) - o Add explicit AC_PROG_SED to configure.in so all autoconfs will expose $(SED) (ca80ea6) - -BUILD FIXES: - o Add GCC annotations so that the vsprintf functions get checked properly (117e327) - o Fix an unused variable warning on *BSD. (c0720c1) - -UNIT TEST FIXES: - o Fix a couple of memory leaks (found with Valgrind). (3b2529a Ross Lagerwall) - o Remove deadcode in http regression tests. Found by coverity. (5553346) - o Fix possible uninitialized read in dns regression tests. Found by coverity. (2259777) - o Set umask before calling mkstemp in unit tests. Found by coverity (f1ce15d) - o Fix various check-after-dereference issues in unit tests: found by coverity (4f3732d) - o Fix resource leaks in the unit tests; found by coverity (270f279) - o Add some missing null checks to unit tests; found by coverity (f021c3d) - o Avoid more crashes/bad calls in unit tests; found by coverity (3cde5bf) - o Remove unused variable; spotted by coverity (6355b2a) - o Add checks to various return values in unit tests. Found by coverity (b9e7329) - o Move assignment outside tt_assert in ssl unit tests. Appeases coverity. (a2006c0) - - - -Changes in version 2.0.19-stable (3 May 2012) -BUGFIXES (CORE): - o Refactor event_persist_closure: raise and extract some common logic (bec22b4) - o If time has jumped so we'd reschedule a periodic event in the past, schedule it for the future instead (dfd808c) - o If a higher-priority event becomes active, don't continue running events of the current priority. (2bfda40) - -BUGFIXES (SSL): - o Fixed potential double-readcb execution with openssl bufferevents. (4e62cd1 Mark Ellzey) - -BUGFIXES (DNS): - o Cancel a probe request when the server is freed, and ignore cancelled probe callbacks (94d2336 Greg Hazel) - o Remove redundant DNS_ERR_CANCEL check, move comment (46b8060 Greg Hazel) - o When retransmitting a timed-out DNS request, pick a fresh nameserver. (3d9e52a) - -DOCUMENTATION FIXES: - o Fix a typo in the bufferevent documentation (98e9119) - o Add missing ) to changelog; spotted by rransom (4c7ee6b) - o Fix the website URL in the readme (f775521) - -COMPILATION FIXES: - o Fix a compilation error with MSVC 2005 due to use of mode_t (336dcae) - o Configure with gcc older than 2.95 (4a6fd43 Sebastian Hahn) - o Generate event-config.h with a single sed script (30b6f88 Zack Weinberg) - -FORWARD-COMPATIBILITY: - o Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_* (d1a03b2) - -TESTING/DEBUGGING SUPPORT: - o dns-example.c can now take a resolv.conf file on the commandline (6610fa5) - o Make some evdns.c debug logs more verbose (d873d67) - o Work-around a stupid gcov-breaking bug in OSX 10.6 (b3887cd) - - - -Changes in version 2.0.18-stable (22 Mar 2012) -BUGFIXES (core): - o Make uses of open() close-on-exec safe by introducing an internal evutil_open_closeonexec. (d2b5f72 Ross Lagerwall, 03dce42) - -BUGFIXES (kqueue): - o Properly zero the kevent in kq_setup_kevent() (c2c7b39 Sebastian Hahn) - -BUILD FIXES: - o Added OPENSSL_LDFLAGS env variable which is appended to SSL checks. (9278196 Mark Ellzey) - o Changed OPENSSL_LDFLAGS to OPENSSL_LIBADD (2d67b63 Mark Ellzey) - o Don't do clang version detection when disabling some flags (083296b Sebastian Hahn) - -BUGFIXES (dns): - o Stop crashing in evdns when nameserver probes give a weird error (bec5068) - - -Changes in version 2.0.17-stable (10 Feb 2012) - -BUGFIXES (core): - o Be absolutely sure to clear pncalls before leaving event_signal_closure (11f36a5) - o check for sysctl before we use it (358c745 Mike Frysinger) - o Remove bogus casts of socket to int before calling ev_callback (f032516) - o Make evconnlistener work around bug in older Linux when getting nmapped (ecfc720) - o Fix a list corruption bug when using event_reinit() with signals present (6e41cdc) - o Fix a fd leak in event_reinit() (3f18ad1) - o Do a memberwise comparison of threading function tables (c94a5f2 Nate R) - o Use C-style comments in C source files (for compatibility with compilers such as xlc on AIX). (d84d917 Greg Hewgill) - o Avoid crash when freeing event_iocp and using event_set_mem_functions (19715a6) - o In the kqueue backend, do not report EBADF as an EV_READ (5d7bfa1 Nicholas Marriott) - -BUGFIXES (evbuffer and bufferevents): - o Fix behavior of evbuffer_peek(buf,-1,NULL,NULL,0) (c986f23 Zack Weinberg) - o Loop on filtering SSL reads until we are blocked or exhausted. (5b4b812) - -BUGFIXES (evhttp): - o Force strict validation of HTTP version in response. (790f6b3 Catalin Patulea) - -BUGFIXES (evdns): - o evdns: fix a bug in circular-queue implementation (d6094b1) - -BUILD FIXES: - o Fix a silly compilation error with the sun compiler (1927776 Colin Watt) - o Suppress a gcc warning from ignoring fwrite return in http-sample.c (7206e8c) - -DOCUMENTATION FIXES: - o Slightly clarify evbuffer_peek documentation (7bbf6ca) - o Update copyright notices to 2012 (e49e289) - -NEW APIS: - o Backport evhttp_connection_get_bufferevent to Libevent 2.0 (da70fa7 Arno Bakker) - -TESTS AND TEST FIXES: - o Fix a race condition in the dns/bufferevent_connect_hostname test. (cba48c7) - o Add function to check referential integrity of an event_base (27737d5) - o Check event_base correctness at end of each unit test (3312b02) - o Workaround in the unit tests for an apparent epoll bug in Linux 3.2 (dab9187) - o Better workaround for Linux 3.2 edge-triggered epoll bug (9f9e259) - -Changes in version 2.0.16-stable (18 Nov 2011) -BUGFIXES (core): - o More detailed message in case of libevent self-debugging failure. (9e6a4ef Leonid Evdokimov) - o epoll: close fd on alloc fail at initialization (1aee718 Jamie Iles) - o Fix compile warning from saying event2/*.h inside a comment (447b0ba) - o Warn when unable to construct base because of failing make_base_notifiable (4e797f3) - o Don't try to make notifiable event_base when no threading fns are configured (e787413) - -BUGFIXES (evbuffer): - o unit test for remove_buffer bug (90bd620 Greg Hazel) - o Fix an evbuffer crash in evbuffer_remove_buffer() (c37069c) - -BUGFIXES (bufferevent_openssl): - o Refactor amount-to-read calculations in buffervent_ssl consider_reading() (a186e73 Mark Ellzey) - o Move SSL rate-limit enforcement into bytes_to_read() (96c562f) - o Avoid spinning on OpenSSL reads (2aa036f Mark Ellzey) - -BUGFIXES (dns) - o Empty DNS reply with OK status is another way to say NODATA. (21a08d6 Leonid Evdokimov) - -TESTING: - o Tests for 94fba5b and f72e8f6 (d58c15e Leonid Evdokimov) - o Test for commit aff6ba1 (f7841bf Leonid Evdokimov) - o Style and comment tweaks for dns/leak* tests (5e42202) - o improve test to remove at least one buffer from src (7eb52eb Greg Hazel) - -DOCUMENTATION: - o Add note about evhttp_send_reply_end to its doxygen (724bfb5) - o Update copyright dates to 2011. (3c824bd) - o Fix typo in whatsnew-2.0.txt (674bc6a Mansour Moufid) - o Improve win32 behavior of dns-sample.c code (a3f320e Gisle Vanem) - - - -Changes in version 2.0.15-stable (12 Oct 2011) -BUGFIXES (DNS): - o DNS: add ttl for negative answers using RFC 2308 idea. (f72e8f6 Leonid Evdokimov) - o Add DNS_ERR_NODATA error code to handle empty replies. (94fba5b Leonid Evdokimov) - -BUFGIXES (bufferevents and evbuffers): - o Make evbuffer callbacks get the right n_added value after evbuffer_add (1ef1f68 Alex) - o Prefer mmap to sendfile unless a DRAINS_TO_FD flag is set. Allows add_file to work with SSL. (0ba0af9) - -BUGFIXES (event loop): - o When a signal callback is activated to run multiple times, allow event_base_loopbreak to work even before they all have run. (4e8eb6a) - -DOCUMENTATION FIXES: - o Fix docstring in dns.h (2b6eae5 Leonid Evdokimov) - o refer to non-deprecated evdns functions in comments (ba5c27d Greg Hazel) - -BUILD AND TESTING FIXES: - o le-proxy and regress depend on openssl directly (9ae061a Sergey Avseyev) - o Use _SOURCES, not _sources, in sample/Makefile.am (7f82382) - o Fixed compiler warnings for unchecked read/write calls. (c3b62fd Mark Ellzey) - o Make write-checking fixes use tt_fail_perror (2b76847) - o Fix some "value never used" warnings with gcc 4.6.1 (39c0cf7) - - - -Changes in version 2.0.14-stable (31 Aug 2011) -BUGFIXES (bufferevents and evbuffers): - o Propagate errors on the underlying bufferevent to the user. (4a34394 Joachim Bauch) - o Ignore OpenSSL deprecation warnings on OS X (5d1b255 Sebastian Hahn) - o Fix handling of group rate limits under 64 bytes of burst (6d5440e) - o Solaris sendfile: correctly detect amount of data sent (643922e Michael Herf) - o Make rate limiting work with common_timeout logic (5b18f13) - o clear read watermark on underlying bufferevent when creating filtering bev to fix potentially failing fragmented ssl handshakes (54f7e61 Joachim Bauch) - -BUGFIXES (IOCP): - o IOCP: don't launch reads or writes on an unconnected socket (495c227) - o Make IOCP rate-limiting group support stricter and less surprising. (a98da7b) - o Have test-ratelim.c support IOCP (0ff2c5a) - o Make overlapped reads result in evbuffer callbacks getting invoked (6acfbdd) - o Correctly terminate IO on an async bufferevent on bufferevent_free (e6af35d) - -BUGFIXES (other): - o Fix evsig_dealloc memory leak with debugging turned on. (9b724b2 Leonid Evdokimov) - o Fix request_finished memory leak with debugging turned on. (aff6ba1 Leonid Evdokimov) - -BUILD AND TESTING FIXES: - o Allow OS-neutral builds for platforms where some versions have arc4random_buf (b442302 Mitchell Livingston) - o Try to fix 'make distcheck' errors when building out-of-tree (04656ea Dave Hart) - o Clean up some problems identified by Coverity. (7c11e51 Harlan Stenn) - - -Changes in version 2.0.13-stable (18 Jul 2011) -BUGFIXES - o Avoid race-condition when initializing global locks (b683cae) - o Fix bug in SSL bufferevents backed by a bev with a write high-watermarks (e050703 Joachim Bauch) - o Speed up invoke_callbacks on evbuffers when there are no callbacks (f87f568 Mark Ellzey) - o Avoid a segfault when all methods are disabled or broken (27ce38b) - o Fix incorrect results from evbuffer_search_eol(EOL_LF) (4461f1a) - o Add some missing checks for mm_calloc failures (89d5e09) - o Replace an assertion for event_base_free(NULL) with a check-and-warn (09fe97d) - o Report kqueue ebadf, epipe, and eperm as EV_READ events (1fd34ab) - o Check if the `evhttp_new_object' function in `http.c' returns NULL. (446cc7a Mansour Moufid) - o Use the correct printf args when formatting size_t (3203f88) - o Complain if the caller tries to change threading cbs after setting them (cb6ecee) - -DOCUMENTATION FIXES AND IMPROVEMENTS - o Revise the event/evbuffer/bufferevent doxygen for clarity and accuracy (2888fac) - o Update Doxyfile to produce more useful output (aea0555) - -TEST FIXES - o Fix up test_evutil_snprintf (caf695a) - o Fix tinytest invocation from windows shell (57def34 Ed Day) - -BUILD FIXES - o Use AM_CPPFLAGS in sample/Makefile.am, not AM_CFLAGS (4a5c82d) - o Fix select.c compilation on systems with no NFDBITS (49d1136) - o Fix a few warnings on OpenBSD (8ee9f9c Nicholas Marriott) - o Don't break when building tests from git without python installed (b031adf) - o Don't install event_rpcgen.py when --disable-libevent-install is used (e23cda3 Harlan Stenn) - o Fix AIX build issue with TAILQ_FOREACH definition (e934096) - - -Changes in version 2.0.12-stable (4 Jun 2011) -BUGFIXES - o Fix a warn-and-fail bug in kqueue by providing kevent() room to report errors (28317a0) - o Fix an assert-inducing fencepost bug in the select backend (d90149d) - o Fix failing http assertion introducd in commit 0d6622e (0848814 Kevin Ko) - o Fix a bug that prevented us from configuring IPv6 nameservers. (74760f1) - o Prevent size_t overflow in evhttp_htmlescape. (06c51cd Mansour Moufid) - o Added several checks for under/overflow conditions in evhttp_handle_chunked_read (a279272 Mark Ellzey) - o Added overflow checks in evhttp_read_body and evhttp_get_body (84560fc Mark Ellzey) - -DOCUMENTATION: - o Add missing words to EVLOOP_NONBLOCK documentation (9556a7d) - -BUILD FIXES - o libssl depends on libcrypto, not the other way around. (274dd03 Peter Rosin) - o Libtool brings in the dependencies of libevent_openssl.la automatically (7b819f2 Peter Rosin) - o Use OPENSSL_LIBS in Makefile.am (292092e Sebastian Hahn) - o Move the win32 detection in configure.in (ceb03b9 Sebastian Hahn) - o Correctly detect openssl on windows (6619385 Sebastian Hahn) - o Fix a compile warning with zlib 1.2.4 and 1.2.5 (5786b91 Sebastian Hahn) - o Fix compilation with GCC 2, which had no __builtin_expect (09d39a1 Dave Hart) - o Fix new warnings from GCC 4.6 (06a714f) - o Link with -lshell32 and -ladvapi32 on Win32. (86090ee Peter Rosin) - o Make the tests build when OpenSSL is not available. (07c41be Peter Rosin) - o Bring in the compile script from automake, if needed. (f3c7a4c Peter Rosin) - o MSVC does not provide S_ISDIR, so provide it manually. (70be7d1 Peter Rosin) - o unistd.h and sys/time.h might not exist. (fe93022 Peter Rosin) - o Make sure TINYTEST_LOCAL is defined when building tinytest.c (8fa030c Peter Rosin) - o Fix winsock2.h #include issues with MSVC (3d768dc Peter Rosin) - o Use evutil_gettimeofday instead of relying on the system gettimeofday. (0de87fe Peter Rosin) - o Always use evutil_snprintf, even if OS provides it (d1b2d11 Sebastian Hahn) - o InitializeCriticalSectionAndSpinCount requires _WIN32_WINNT >= 0x0403. (816115a Peter Rosin) - o cygwin: make it possible to build DLLs (d54d3fc) - - - -Changes in version 2.0.11-stable (27 Apr 2011) - [Autogenerated from the Git log, sorted and cleaned by hand.] -BUGFIXES: - o Fix evport handling of POLLHUP and POLLERR (b42ce4b) - o Fix compilation on Windows with NDEBUG (cb8059d) - o Check for POLLERR, POLLHUP and POLLNVAL for Solaris event ports (0144886 Trond Norbye) - o Detect and handle more allocation failures. (666b096 Jardel Weyrich) - o Use event_err() only if the failure is truly unrecoverable. (3f8d22a Jardel Weyrich) - o Handle resize failures in the select backend better. (83e805a) - o Correctly free selectop fields when select_resize fails in select_init (0c0ec0b) - o Make --enable-gcc-warnings a no-op if not using gcc (3267703) - o Fix a type error in our (unused) arc4random_stir() (f736198) - o Correctly detect and stop non-chunked http requests when the body is too long (63a715e) - o Have event_base_gettimeofday_cached() always return wall-clock time (a459ef7) - o Workaround for http crash bug 3078187 (5dc5662 Tomash Brechko) - o Fix incorrect assertions and possible use-after-free in evrpc_free() (4b8f02f Christophe Fillot) - o Reset outgoing http connection when read data in idle state. (272823f Tomash Brechko) - o Fix subtle recursion in evhttp_connection_cb_cleanup(). (218cf19 Tomash Brechko) - o Fix the case when failed evhttp_make_request() leaved request in the queue. (0d6622e Tomash Brechko) - o Fix a crash bug in evdns server circular list code (00e91b3) - o Handle calloc failure in evdns. (Found by Dave Hart) (364291e) - o Fix a memory leak on win32 socket->event map. (b4f89f0) - o Add a forgotten NULL check to evhttp_parse_headers (12311ff Sebastian Hahn) - o Fix possible NULL-deref in evdns_cancel_request (5208544 Sebastian Hahn) - -PORTABILITY: - o Fall back to sscanf if we have no other way to implement strtoll (453317b) - o Build correctly on platforms without sockaddr_storage (9184563) - o Try to build correctly on platforms with no IPv6 support (713c254) - o Build on systems without AI_PASSIVE (cb92113) - o Fix http unit test on non-windows platforms without getaddrinfo (6092f12) - o Do not check for gethostbyname_r versions if we have getaddrinfo (c1260b0) - o Include arpa/inet.h as needed on HPUX (10c834c Harlan Stenn) - o Include util-internal.h as needed to build on platforms with no sockaddr_storage (bbf5515 Harlan Stenn) - o Check for getservbyname even if not on win32. (af08a94 Harlan Stenn) - o Add -D_OSF_SOURCE to fix hpux builds (0b33479 Harlan Stenn) - o Check for allocation failures in apply_socktype_protocol_hack (637d17a) - o Fix the check for multicast or broadcast addresses in evutil_check_interfaces (1a21d7b) - o Avoid a free(NULL) if out-of-memory in evdns_getaddrinfo. Found by Dave Hart (3417f68) - -DEFENSIVE PROGRAMMING: - o Add compile-time check for AF_UNSPEC==PF_UNSPEC (3c8f4e7) - -BUGS IN TESTS: - o Fix test.sh output on solaris (b4f89b6 Dave Hart) - o Make test-eof fail with a timeout if we never get an eof. (05a2c22 Harlan Stenn) - o Use %s with printf in test.sh (039b9bd) - o Add an assert to appease clang's static analyzer (b0ff7eb Sebastian Hahn) - o Add a forgotten return value check in the unit tests (3819b62 Sebastian Hahn) - o Actually send NULL request in http_bad_request_test (b693c32 Sebastian Hahn) - o add some (void) casts for unused variables (65707d7 Sebastian Hahn) - o Refactor test_getaddrinfo_async_cancel_stress() (48c44a6 Sebastian Hahn) - o Be nice and "handle" error return values in sample code (4bac793 Sebastian Hahn) - o Check return value of evbuffer_add_cb in tests (93a1abb Sebastian Hahn) - o Remote some dead code from dns-example.c (744c745 Sebastian Hahn) - o Zero a struct sockaddr_in before using it (646f9fe Sebastian Hahn) - -BUILD FIXES: - o Fix warnings about AC_LANG_PROGRAM usage (f663112 Sebastian Hahn) - o Skip check for zlib if we have no zlib.h (a317c06 Harlan Stenn) - o Fix autoconf bracket issues; make check for getaddrinfo include netdb.h (833e5e9 Harlan Stenn) - o Correct an AM_CFLAGS to an AM_CPPFLAGS in test/Makefile.am (9c469db Dave Hart) - o Fix make distcheck & installation of libevent 1 headers (b5a1f9f Dave Hart) - o Fix compilation under LLVM/clang with --enable-gcc-warnings (ad9ff58 Sebastian Hahn) - -FEATURES: - o Make URI parser able to tolerate nonconformant URIs. (95060b5) - -DOCUMENTATION: - o Clarify event_set_mem_functions doc (926f816) - o Correct evhttp_del_accept_socket documentation on whether socket is closed (f665924) - o fix spelling mistake in whatsnew-2.0.txt (deb2f73) - o Fix sample/http-server ipv6 fixes (eb692be) - o Comment internal headers used in sample code. (4eb281c) - o Be explicit about how long event loops run in event.h documentation (f95bafb) - o Add comment to configure.in to explain gc-sections test logic (c621359) - o Fix a couple of memory leaks in samples/http-server.c. Found by Dave Hart. (2e9f665) - - - -BUILD IMPROVEMENTS: - Libevent 2.1.2-alpha modernizes Libevent's use of autotools, and makes - numerous other build system. Parallel builds should be faster, and all - builds should be quieter. - - o Split long lists in Makefile.am into one-item-per-line (2711cda) - o Remove unnecessary code in configure.in. (e65914f Ross Lagerwall) - o attempt to support OpenSSL in Makefile.nmake (eba0eb2 Patrick Pelletier) - o Use newer syntax for autoconf/automake init (7d60ba8) - o Enable silent build rules by default. Override with V=1 (7b18e5c) - o Switch to non-recursive makefiles (7092f3b) - o Rename subordinate Makefile.ams to include.am (6cdfeeb) - o Make quiet build even quieter (371a123) - o New --quiet option for event_rpcgen.py (aa59c1e) - o Be quiet when making regress.gen.[ch] (607a8ff) - o Fix handling of no-python case for nonrecursive make (1e3123d) - o We now require automake 1.9 or later. Modernize! (b7f6e89) - o Rename configure.in to configure.ac. (b3fea67 Ross Lagerwall) - o Use correct openssl libs and includes in pkgconfig file (d70af27) - o Use the same CFLAGS for openssl when building unit tests as with - libevent (1d9d511) - -DOCUMENTATION - o Note that make_base_notifiable should not be necessary (26ee5f9) - o Be more clear that LEV_OPT_DEFERRED_ACCEPT has tricky prereqs (371efeb) - o Add caveat to docs about bufferevent_free() with data in outbuf (6fab9ee) - o Make it more clear that NOLOCK means "I promise, no multithreading" - (9444524) - o Fix a comment in test-fdleak after 077c7e949. (3881d8f Ross Lagerwall) - o Make the Makefile.nmake warning slightly less dire (e7bf4c8) - o Fix typo : events instead of evets (05f1aca Azat Khuzhin) - o Additional comments about OPENSSL_DIR variable, prompted by Dave Hart - (6bde2ef Patrick Pelletier) - -EVHTTP: - o ignore LWS after field-content in headers (370a2c0 Artem Germanov) - o Clean up rtrim implementation (aa59d80) - o Remove trailing tabs in HTTP headers as well. (ac42519) - o Remove internal ws from multiline http headers correctly (c6ff381) - o Move evutil_rtrim_lws_ to evutil.c where it belongs (61b93af) - o add evhttp_request_get_response_code_line (4f4d0c9 Jay R. Wren) - o Use EVUTIL_SOCKET_ERROR() wrapper to save/restore errno in - evhttp_connection_fail_ (7afbd60) - o preserve errno in evhttp_connection_fail_ for inspection by the - callback (36d0ee5 Patrick Pelletier) - -BUGFIXES: - o Correctly handle running on a system where accept4 doesn't work. (9fbfe9b) - o Avoid double-free on error in evbuffer_add_file. Found by - coverity. (6a81b1f) - o Fix another possible uninitialized read in dns regression tests. Found - by coverity. (13525c5) - o Add checks for functions in test-ratelim.c; found by Coverity (aa501e1) - o Avoid memory leak in test_event_calloc unit test; found by coverity - (92817a1) - o Fix a shadowed variable in addfile_test_readcb; found by coverity - (225344c) - o Check return value when using LEV_OPT_DEFERRED_ACCEPT. Found by - coverity (6487f63) - o Prevent reference leak of bufferevent if getaddrinfo fails. (b757786 - Joachim Bauch) - o Make event_base_getnpriorities work with old "implicit base" code - (c46cb9c) - o Simplify and correct evutil_open_closeonexec_ (0de587f) - o Fix event_dlist definition when sys/queue not included (81b6209 - Derrick Pallas) - - - -Changes in version 2.1.1-alpha (4 Apr 2012) - - Libevent 2.1.1-alpha includes a number of new features and performance - improvements. The log below tries to organize them by rough area of - effect. It omits some commits which were pure bugfixes on other commits - listed below. For more detail, see the git changelogs. For more - insight, see the "whatsnew-2.1.txt" document included in the Libevent - 2.1.1-alpha distribution. - - Performance: Core - o Replace several TAILQ users with LIST. LIST can be a little faster than - TAILQ for cases where we don't need queue-like behavior. (f9db33d, - 6494772, d313c29, 974d004) - o Disabled code to optimize the case where we reinsert an existing - timeout (e47042f, 09cbc3d) - o Remove a needless base-notify when rescheduling the first timeout (77a96fd) - o Save a needless comparison when removing/adjusting timeouts (dd5189b) - o Possible optimization: split event_queue_insert/remove into - separate functions. needs testing (efc4dc5) - o Make event_count maintenance branchless at the expense of an - extra shift. Needs benchmarking (d1cee3b) - o In the 2.1 branch, let's try out lazy gettimeofday/clock_gettime - comparison (2a83ecc) - o Optimization in event_process_active(): ignore maxcb & endtime - for highest priority events. (a9866aa Alexander Drozdov) - o Bypass event_add when using event_base_once() for a 0-sec timeout (35c5c95) - o Remove the eventqueue list and the ev_next pointers. (604569b 066775e) - - Performance: Evbuffers - o Roughly 20% speed increase when line-draining a buffer using - EVBUFFER_EOL_CRLF (5dde0f0 Mina Naguib) - o Try to squeeze a little more speed out of EVBUFFER_EOL_CRLF (7b9d139) - o Fix a bug in the improved EOL_CRLF code (d927965) - o Remove a needless branch in evbuffer_drain() (d19a326) - - Performance: Linux - o Infrastructure for using faster/fewer syscalls when creating - sockets (a1c042b) - o Minimize syscalls during socket creation in listener.c (7e9e289) - o Use a wrapper function to create the notification - pipe/socketpair/eventfd (ca76cd9) - o Use pipes for telling signals to main thread when possible (a35f396) - o Save syscalls when constructing listener sockets for evhttp (af6c9d8) - o Save some syscalls when creating evdns sockets (713e570) - o Save some syscalls when constructing a socket for a bufferevent (33fca62) - o Prefer epoll_create1 on Linuxen that have it (bac906c) - - Performance: Epoll backend - o Use current event set rather than current pending change when - deciding whether to no-op a del (04ba27e Mike Smellie) - o Replace big chain of if/thens in epoll.c with a table lookup (8c83eb6) - o Clean up error handling in epoll_apply_one_change() a little (2d55a19) - - Performance: Evport backend - o evport: use evmap_io to track fdinfo status. Should save time and - RAM. (4687ce4) - o evport: Remove a linear search over recent events when - reactivating them (0f77efe) - o evport: Use portev_user to remember fdinfo struct (276ec0e) - o evport: don't scan more events in ed_pending than needed (849a5cf) - o evport: Remove artificial low limit on max events per getn call (c04d927) - o Reenable main/many_events_slow_add for evport in 2.1 (e903db3) - - Performance: Windows - o Use GetSystemTimeAsFileTime to implement gettimeofday on - win32. It's faster and more accurate than our old - approach. (b8b8aa5) - - New functions and features: debugging - o Add event_enable_debug_logging() to control use of debug logs (e30a82f) - - New functions and features: core - o Add event_config function to limit time/callbacks between calls - to dispatch (fd4de1e, 9fa56bd, a37a0c0, 3c63edd) - o New EVLOOP_NO_EXIT_ON_EMPTY option to keep looping even when no - events are pending (084e68f) - o Add event_base_get_npriorities() function. (ee3a4ee Alexander Drozdov) - o Make evbase_priority_init() and evbase_get_npriorities() - threadsafe (3c55b5e) - o New event_base_update_cache_time() to set cached_tv to current - time (212533e Abel Mathew) - o Add event_self_cbarg() to be used in conjunction with - event_new(). (ed36e6a Ross Lagerwall, fa931bb, 09a1906, 1338e6c, - 33e43ef) - o Add a new libevent_global_shutdown() to free all globals before - exiting. (041ca00 Mark Ellzey, f98c158, 15296d0, 55e991b) - o Use getifaddrs to detect our interfaces if possible (7085a45) - o Add event_base_get_running_event() to get the event* whose cb we - are in (c5732fd, 13dad99) - - New functions and features: building - o Implement --enable-gcc-hardening configure option (7550267 Sebastian Hahn) - - New functions and features: evbuffers - o Add evbuffer_add_file_segment() so one fd can be used efficiently - in more than one evbuffer_add_file at a time (e72afae, c2d9884, - 3f405d2, 0aad014) - o Fix windows file segment mappings (8254de7) - o Allow evbuffer_ptr_set to yield a point just after the end of the - buffer. (e6fe1da) - o Allow evbuffer_ptr to point to position 0 in an empty evbuffer - (7aeb2fd Nir Soffer) - o Set the special "not found" evbuffer_ptr consistently. (e3e97ae Nir Soffer) - o support adding buffers to other buffers non-destructively - (9d7368a Joachim Bauch) - o prevent nested multicast references, reworked locking (26041a8 - Joachim Bauch) - o New EVBUFFER_EOL_NUL to read NUL-terminated strings from an - evbuffer (d7a8b36 Andrea Montefusco, 54142c9) - o Make evbuffer_file_segment_types adaptable (c6bbbf1) - o Added evbuffer_add_iovec and unit tests. (aaec5ac Mark Ellzey, 27b5398) - o Add evbuffer_copyout_from to copy data from the middle of a - buffer (27e2225) - - New functions and features: bufferevents - o Allow users to set allow_dirty_shutdown (099d27d Catalin Patulea) - o Tweak allow_dirty_shutdown documentation (a44cd2b) - o Fix two issues in the allow_dirty_shutdown code. (f3b89de) - o Add a bufferevent_getcb() to find a bufferevent's current - callbacks (a650394) - o bufferevent: Add functions to set/get max_single_read/write - values. (998c813 Alexander Drozdov) - o bev_ssl: Be more specific in event callbacks. evhttp in particular gets - confused without at least one of BEV_EVENT_{READING|WRITING}. (f7eb69a - Catalin Patulea) - - New functions and features: evconnlisteners - o Support TCP_DEFER_ACCEPT sockopts for listeners (5880e4a Mark Ellzey, - a270728) - o Add another caveat to the TCP_DEFER_ACCEPT documentation (a270728) - o Allow evconnlistener to be created in disabled state. (9593a33 - Alexander Drozdov) - o The LEV_OPT_CLOSE_ON_EXEC flag now applies to accepted listener - sockets too (4970329) - - Evhttp: - o Add new evhttp_{connection_}set_timeout_tv() functions to set - finger-grained http timeouts (6350e6c Constantine Verutin) - o Performance tweak to evhttp_parse_request_line. (aee1a97 Mark Ellzey) - o Add missing break to evhttp_parse_request_line (0fcc536) - o Add evhttp callback for bufferevent creation; this lets evhttp - support SSL. (8d3a850) - o Remove calls to deprecated bufferevent functions from evhttp.c (4d63758) - o evhttp: Add evhttp_foreach_bound_socket. (a2c48e3 Samy Al Bahra) - - Build improvements: - o Add AC_USE_SYSTEM_EXTENSIONS to configure.in. Requires follow on - patches for correctness and robustness. (1fa7dbe Kevin Bowling) - o Filter '# define' statements from autoconf and generate - event-private.h (321b558 Kevin Bowling) - o Remove internal usage of _GNU_SOURCE (3b26541 Kevin Bowling) - o Eliminate a couple more manual internal _GNU_SOURCE defines (c51ef93 - Kevin Bowling) - o Add AC_GNU_SOURCE to the fallback case. (ea8fa4c Kevin Bowling) - o Use a Configuration Header Template for evconfig-private.h (868f888 - Kevin Bowling) - o Fix a comment warning and add evconfig-private.h to .gitignore - (f6d66bc Kevin Bowling) - o Include evconfig-private.h in internal files for great good. (0915ca0 - Kevin Bowling) - o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) - (ad03952 Kevin Bowling) - o Prefer the ./configure evconfig-private.h in MinGW, just in - case. (f964b72 Kevin Bowling) - o Shell hack for weird mkdir -p commands (fd7b5a8 Kevin Bowling) - o Add evconfig-private to remaining files (ded0a09 Kevin Bowling) - o Allow use of --enable-silent-rules for quieter compilation with - automake 1.11 (f1f8514 Dave Hart) - o Use "_WIN32", not WIN32: it's standard and we don't need to fake it - (9f560b) - o In configure, test for _WIN32 not WIN32. (85078b1 Peter Rosin) - o Do not define WIN32 in Makefile.nmake (d41f3ea Peter Rosin) - o Provide the autoconf m4 macros for the new OpenSSL via pkg-config - stuff. (674dc3d Harlan Stenn) - o Use pkg-config (if available) to handle OpenSSL. (1c63860 Harlan Stenn) - o We need AM_CPPFLAGS when compiling bufferevent_openssl.c (6d2613b - Harlan Stenn) - o Fix OSX build: $(OPENSSL_INCS) needs to be after - $(AM_CPPFLAGS). (46f1769 Zack Weinberg) - o Make gcc warnings on by default, and --enable-gcc-warnings only add - -Werror (d46517e Sebastian Hahn) - o Split up extra-long AC_CHECK_FUNCS/HEADERS lines in configure.in (88a30ad) - o Move libevent 1.x headers to include/, to put all public headers in - one place. (bbea8d6) - o Put #ifdef around some files to support alternate build - systems. (76d4c92 Ross Lagerwall) - o Also make win32select.c conditional for IDE users (bf2c5a7) - - Debugging: - o Add a magic number to debug_locks to better catch lock-coding - errors. (b4a29c0 Dave Hart) - o munge the debug_lock signature before freeing it: it might help us - catch use-after-free (f28084d) - o Added --enable-event-debugging in configure (bc7b4e4, a9c2c9a Mark Ellzey) - o Debug addition for printing usec on TIMEOUT debugging. (ac43ce0 Mark Ellzey) - o Added usec debug in another area for debug (3baab0d Mark Ellzey) - o added timeout debug logs to include event ptr. (4b7d298 Mark Ellzey) - o more event dbg updates (6727543 Mark Ellzey) - o Clarify event_enable_debug_logging a little (6207826) - o Make --enable-verbose-debug option match its help text (10c3450) - o Add argument checks to some memory functions in `event.c'. (c8953d1 - Mansour Moufid) - - Testing: - o More abstraction in test.sh (cd74c4e) - o Add failing test for evbuffer_search_range. (8e26154 Nir Soffer) - o Tweaks to return types with end-of-buf ptrs (9ab8ab8) - o Add an (internal) usleep function for use by unit tests (f25d9d3) - o Synchronize with upstream tinytest (6c81be7) - o Make test-changelist faster (7622d26) - o Reduce the timeout in the main/fork test. (ab14f7c) - o New evhttp function to adjust initial retry timeout (350a3c4) - o Make regression tests run over 3x faster. (67a1763) - o Use test_timeval_diff_eq more consistently (b77b43f) - o Allow more slop in deferred_cb_skew test; freebsd needs it (b9f7e5f) - o When including an -internal.h header outside the main tree, do so - early (95e2455) - o Add a new test: test-fdleak which tests for fd leaks by creating many - sockets. (2ef9278 Ross Lagerwall, f7af194, 1c4288f, etc) - o Add a unit test for event_base_dump_events() (7afe48a, 8d08cce) - o Test more bufferevent_ratelim features (c24f91a) - - Documentation: - o Improve evbuffer_ptr documentation (261ba63) - o added comments to describe refcounting of multicast chains (ba24f61 - Joachim Bauch) - o Add doxygen for event_base_dump_events (cad5753) - - OSX: - o Use "unlimited select" on OSX so that we can have more than - FD_SETSIZE fds (1fb5cc6) - - KQueue: - o Use SIG_IGN instead of a do-nothing handler for signal events with - kqueue (148458e Zack Weinberg) - - evprc: - o event_rpcgen.py now prints status information to stdout and errors to - stderr. (ffb0ba0 Ross Lagerwall) - - Code improvement and refactoring: - o Make event_reinit() more robust and maintainable (272033e) - o Restore fast-path event_reinit() for slower backends (2c4b5de) - o Check changelist as part of checking representational integrity (39b3f38) - o Fix a compile warning in event_reinit (e4a56ed Sebastian Hahn) - o Refactor the functions that run over every event. (c89b4e6) - o Remove the last vestiges of _EVENT_USE_EVENTLIST (a3cec90) - o Make event-config.h depend on Makefile.am (2958a5c) +Changes in version 2.2.2-alpha (01 July 2026) + + This release contains several security fixes, affecting users of the + following modules: evbuffer, bufferevent, evtag, evrpc, evdns, evhttp, + and evws. + If you have a program that uses one of those modules, + or if you distribute libevent, you should upgrade. + + (Note: the latest stable release as of this writing is 2.1.13.) + + + Security fixes (evws): + - Fix a null dereference in the error path of + evws_new_session(). + (Found by @DarkaMaul. GHSA-3rpf-frgx-xq34) + - Prevent unbounded memory accumulation in websockets + via frame fragmentation. + (Found by @sectroyer. GHSA-qx89-wf2v-vgmx) + + Security Fixes, also in 2.1.13 (evtag, evrpc): + - Fix an out-of-bounds read in decode_tag_internal. + (Found by @Brubbish. GHSA-fj29-64w6-73h6) + - Fix an integer overflow in evtag_unmarshal_header. + (Found by @Brubbish. GHSA-45c6-qx49-89m8) + + Security Fixes, also in 2.1.13 (evhttp): + - Discard HTTP trailers, to prevent header smuggling attacks. + (Found by @sebastianosrt. GHSA-2gmv-p5m7-98p6) + - Restrict HTTP header parsing to prevent request smuggling. + (Originally reported by @xclow3n; and then by @kodareef5, + @nstaller0490, @AsafMeizneer, and @yaotushaozhu. + GHSA-q39v-w2g7-gr8j.) + - Treat CRLF and %00 more strictly in HTTP headers, to prevent + parser mismatch attacks. + (Reported by @xclow3n and @AsafMeizner. See GHSA-q39v-w2g7-gr8j, + GHSA-jcwh-pvf2-73p2.) + - Fix a heap out-of-bound write that could occur when using + AF_UNIX sockets and compiling libevent with -DNDEBUG. + (Found by @mat-mo. GHSA-cvq5-vrvr-j338) + + Security fixes, also in 2.1.13 (evbuffer, bufferevent): + - Fixed a dangling pointer in evbuffer_add_reference. + (Found by @DarkaMaul. GHSA-c2pj-cg4r-88c8) + + Security fixes, also in 2.1.13 (evdns): + - Fix an out-of-bounds write in dnsname_to_labels + when building a DNS response of 2^16 bytes. + (Found by @sectroyer. GHSA-58rx-7448-jw47) + + Security fixes, also in 2.1.13 (example code): + - Avoid using strcpy() in sample/http-server.c. + (Reported by @sectroyer. GHSA-5rgj-2c58-7jrc.) + + Other fixes: + - Enable a test for signalfd that had previously + been disabled by mistake. + - Fix compilation of some examples and tests, + and resolve several compiler warnings. + + + +Changes in version 2.2.1-alpha (21 May 2023) + + Libevent 2.2.1-alpha includes a number of new features and performance + improvements. + + The log below tries to organize them by rough area of effect. + + This release contains around 1000 patches (without merges) with 151 new + contributors! + + This changelog omits some commits which were pure bugfixes on other commits + listed below. typos, some minor CI changes and similar things. + + Some keywords highlights of this major release: + - wepoll backend (by Nick Grifka) + - signalfd backend (by Dmitry Antipov) + - DNS over TCP for evdns (by ayuseleznev) + - websockets layer (by Dmitry Ilyin) + - "prepare" and "check" watchers (by Dan Rosen) + - MbedTLS support (okhowang) + - unix domain sockets for HTTP + - cmake over autotools/automake + - extensive CI + + For more detail, see the git changelogs. For more insight, see the + "whatsnew-2.2.txt" document included in the Libevent 2.2.1-alpha + distribution. + + SSL layer gains MbedTLS support, and had been tested with LibreSSL too. And + of course with OpenSSL 1.1/3.0. + + From now on, the autotools is considered as deprecated, and you should use + cmake instead. + + And now we are using github actions for CI, previously we had travis-ci for + linux/macos and appveyor for win32 (removed in #951), and also I used testing + vagrant for some time, but it had been moved into a separate repository + (8c1838be). But actually this is not required anymore since github actions + supports: + - linux + - freebsd + - windows + - macos + - openbsd + - and also tests under Thread/Address/Undefined sanitizers + + Now documentation is automatically deployed to https://libevent.org/doc/ + + CI: + o Merge branch 'github-actions-v2' (#951) (0b6f29ac yuangongji, Azat Khuzhin) + o ci: add CIFuzz Github action (#1382) (d8ecb88f DavidKorczynski) + o Add CI checks for OpenBSD (#1326) (45c66e48 neil) + o ci/linux: add dist check (512c88ce Azat Khuzhin) + o Add API/ABI checker (using LVC) (735c891e, 448a478a, 889ad6d6, 15917b42, 1cea01d6 yuangongji, Azat Khuzhin) + o Merge branch 'tests-under-sanitizers' (d5aa783b Azat Khuzhin) + o Rework CI to keep everything in one workflow (by using reusable workflow) (587f26fb Azat Khuzhin) + + Samples: + o sample/https-client: use host SSL certificate store by default (e139cbac David Disseldorp) + o Improvements for internal http-server (9a4b8ec1 Azat Khuzhin) + o sample: add https-client-mbedtls (#1098) (b45a02ef okhowang(王沛文)) + o http-server: add cli argument for max body size (852af060 Azat Khuzhin) + o New utility becat (analog of ncat but uses bufferevents, useful for testing) (d5b24cc0 Azat Khuzhin) + o https-client: add -4/-6 switches (67180f8c Azat Khuzhin) + + SSL: + o Mbed-TLS support (#1028) (0e339b04 Jesse Fang, okhowang(王沛文), Azat Khuzhin) + o Introduce new BUFFEREVENT_SSL_BATCH_WRITE flag to avoid Nagle effect in SSL (a490172d Azat Khuzhin) + o Do not try to do SSL handshake if the connect() fails (59e31c96 Azat Khuzhin) + o Support disabled renegotiation in mbedTLS (f02fa339 Azat Khuzhin) + o Merge branch 'mbedtls-3' (#1299) (20977eae William Marlow, Azat Khuzhin) + o Initial OpenSSL 3.0 support (#1288) (69e9f7ee William Marlow, Azat Khuzhin) + o More SSL_read() to fill big buffer (ef51444f Thuan Tran) + o Make bufferevent_set_max_single_read() effect (4ab3242d Thuan Tran) + + SSL bugfixes: + o Explicitly call SSL_clear when reseting the fd. (#498) (c6c74ce2 David Benjamin) + o fix handling of close_notify (ssl) in http with openssl bufferevents (da3f2ba2 Azat Khuzhin) + o be_openssl: avoid leaking of SSL structure (acf09c00 Azat Khuzhin) + o Fix ssl/bufferevent_wm_filter when bev does not reach watermark on break (9d93fbe7 Azat Khuzhin) + o Don't loose top error in SSL (a30d6d85 Yury Korzhetsky) + o Use heap-bases contexts for MbedTLS handles (#1355) (285fc7cc Dmitry Ilyin) + o Deal with partial writes on SSL write (fc568ff0 zhenhaonong) + o Avoid EOF in rare (or not that rare) cases - #1451 (e8cbe7b6 Azat Khuzhin) + + HTTP (evhttp): + o http: add callback to allow server to decline (and thereby close) incoming connections. (727bcea1 John Fremlin) + o Add evhttp_parse_query_str_flags() (26ef859a Azat Khuzhin) + o http: implement separate timeouts for read/write/connect phase (5ee507c8 Azat Khuzhin) + o http: add WebDAV methods support (#789) (68eb526d Alexander Drozdov) + o Added http method extending (c80f6be1 Thomas Bernard) + o Make http-connect workth with pproxy (462f2e97 Azat Khuzhin) + o Add callback support for error pages (02905413 nntrab) + o Added evhttp max simultaneous connection limiting (#592) (7426a568 Joseph Coffland, Azat Khuzhin) + o http: add EVHTTP_URI_HOST_STRIP_BRACKETS (67180f8c Azat Khuzhin) + o http: eliminate redundant bev fd manipulating and caching (afa66ea4 Azat Khuzhin) + o http: support unix domain sockets (f446229b Sean Young) + o Add more HTTP_ response codes (05a03d4a Dmitry Ilyin) + o evhttp_bound_set_bevcb() (77a9b60e Leon M. George, Azat Khuzhin) + o Add minimal WebSocket server implementation for evhttp (#1322) (e8313084 Dmitry Ilyin) + + HTTP bugfixes (evhttp): + o Fix crashing http server when callback do not reply in place (5ff8eb26 Azat Khuzhin) + o Do not crash when evhttp_send_reply_start() is called after a timeout. (99d0a952 Andreas Gustafsson) + o Allow bodies for GET/DELETE/OPTIONS/CONNECT (db483e3b Azat Khuzhin) + o Fix crashing http server when callback do not reply in place from *gencb* (306747e5 Azat Khuzhin) + o CONNECT method only takes an authority (65eb529a Greg Hazel) + o http: fix leaks in evhttp_uriencode() (61c21492 Azat Khuzhin) + o Fix evhttp_connection_get_addr() for incoming http connections (367cd9e5 Greg Hazel, e4edc7fc Azat Khuzhin) + o Improve request line parsing (0ec12bc8 Azat Khuzhin) + o Fix conceivable UAF of the bufferevent in evhttp_connection_free() (5dc88b38 Azat Khuzhin) + o http: fix connection retries when there more then one request for connection (f3f7aa5a Azat Khuzhin) + o http: Preserve socket error from listen across closesocket cleanup (28d7221b Luke Dashjr) + o http: try to read existing data in buffer under EVHTTP_CON_READ_ON_WRITE_ERROR (7bfe9388 Azat Khuzhin) + o http: avoid use of uninitialized value for AF_UNIX/AF_LOCAL sockaddr (76eded24 Azat Khuzhin) + o http: make sure the other fields in ext_method are not changed by the callback (1c78451f yuangongji) + o http: fix EVHTTP_CON_AUTOFREE in case of connection error (083c6d54 Azat Khuzhin) + o http: fix EVHTTP_CON_AUTOFREE in case of timeout (and some else) (eee26dee Azat Khuzhin) + o Check error code of evhttp_add_header_internal() in evhttp_parse_query_impl() (4528d8e9 Azat Khuzhin) + o http: fix undefined-shift in EVUTIL_IS*_ helpers (37dbb350 Azat Khuzhin) + o http: fix invalid unsigned arithmetic (#1134) (d13b7bbf ihsinme) + o Fix the value is never actually read from 'argument' in evhttp_parse_query_impl() (#1424) (3bcc92cf Cœur) + + DNS (evdns): + o evdns: handle NULL filename explicitly (3e6553a1 Bogdan Harjoc) + o Added DNS header mask definitions. (fb134939 Nathan French) + o evdns: add DNS_OPTION_NAMESERVERS_NO_DEFAULT/EVDNS_BASE_NAMESERVERS_NO_DEFAULT (e5b8f4c1 Azat Khuzhin) + o evdns: add new options -- so-rcvbuf/so-sndbuf (538141eb Azat Khuzhin) + o evdns: Add additional validation for values of dns options (#1018) (8fe35c76 ayuseleznev) + o DNS over TCP (#1004) (028842aa ayuseleznev, Azat Khuzhin) + o evdns: Add support for setting maximum UDP DNS message size. (#1032) (83c58d49 seleznevae) + o evdns: add max-probe-timeout/probe-backoff-factor settings (#1128) (617ba838 chux0519) + o evdns: add ability to get CNAME (#1154) (19b3fd0b Sergey Matveychuk) + o feat: add `evdns_base_get_nameserver_fd` method (#1238) (cd6a41ec Yongsheng Xu) + o evdns: integrate deferred_response_callback into evdns_request (#1367) (8800b17a mkm) + o Allow evdns_base_new to succeed with no nameservers configured (#1389) (3d138bda Daniel Kempenich) + + DNS bugfixes (evdns): + o evdns: fix race condition in evdns_getaddrinfo() (ee12c516 Sergey Fionov, Sergey Fionov) + o evdns: fix lock/unlock mismatch in evdns_close_server_port() (8701d0d3 zhuizhuhaomeng) + o Fix checking return value of the evdns_base_resolv_conf_parse() (c3f35345 Azat Khuzhin) + o evdns: fix a crash when evdns_base with waiting requests is freed (#962) (4da9f87c ayuseleznev) + o recreate socket when udp failed (#1031) (efbe563b okhowang(王沛文)) + o evdns: do not pass NULL to memcpy() in evdns_server_request_format_response() (c424594b Azat Khuzhin) + o evdns: fix "Branch condition evaluates to a garbage value" in reply_parse (#1423) (e96e98ae Cœur) + + RPC (evrpc): + o evrpc: avoid NULL dereference on request is not EVHTTP_REQ_POST (8483c535 Azat Khuzhin) + + Core (events, buffers, utils, threads): + o Return from event_del() after the last event callback termination (0b4b0efd José Luis Millán, 5ff83989 Azat Khuzhin) + o Add convenience macros for user-triggered events (d2acf67e Philip Prindeville) + o Filter link-local IPv4 addresses in evutil_found_ifaddr() (b2667b76 Azat Khuzhin) + o assert that fds are nonblocking in debug mode (9d3a415a, 6f988ee1 Greg Hazel, Azat Khuzhin) + o buffer: make evbuffer_prepend() of zero-length array no-op (c4fbae3a Azat Khuzhin) + o Add support for EV_TIMEOUT to event_base_active_by_fd (62df1301 John Ohl) + o Maximum evbuffer read configuration (8c2001e9 Azat Khuzhin) + o evwatch: Add "prepare" and "check" watchers. (#793) (2f184f8b, 1cd8830d Dan Rosen) + o evutil: implement socketpair with unix domain socket on Win10 (#913) (dda8968c, 1ba94bdf yuangongji) + o Add support for priority inheritance (#934) (f76456b0 Andre Pereira Azevedo Pinto, 972289f3 Azat Khuzhin) + o evutil_time: Implements usleep() using wait function on Windows (#939) (6412f34f yuangongji) + o Add EVENT_BASE_FLAG_EPOLL_DISALLOW_TIMERFD flag (fixes: #958) (9a9b92ed Azat Khuzhin) + o evutil_time: improve evutil_gettimeofday on Windows (#1003) (f0b3160f Nick Grifka) + o Support EV_CLOSED on linux for poll(2) (4c13afae Azat Khuzhin) + o Add wepoll support to light up the epoll backend on Windows (#1006) (83ef3216 Nick Grifka, 45c3fc29 fanquake) + o Convert from WinCrypt to Windows BCrypt (eb7bed03 Gerry Garvey) + o Merge #1176 - make evthread_use_pthreads() a MT-Safe function (3d48c756 moonlightsh) + o buffer: do not round up allocation for reference-type chain objects (#1203) (b926af26 Pierce Lopez) + o Add check of mmap64 function and use it when available rather that mmap (#1320) (99fd68ab Dmitry Ilyin) + o Make rekey interval less predictable (#1331) (bb41229f Keelan Cannoo) + o epoll: use epoll_pwait2() if available (117ee9a0 Dmitry Antipov) + o signal: new signal handling backend based on signalfd (#1342) (1af745d0 Dmitry Antipov) + o Exclude arc4random_buf implementation if it's already present in the platform (#1375) (7a18af8c Srivatsan Iyer) + o buffer: use pread() for evbuffer_file_segment_materialize() (#1392) (0b79a002 Dmitry Antipov) + + Core bugfixes (events, buffers, utils): + o Fix wrong assert in evbuffer_drain() (b26996a0 Azat Khuzhin) + o Fix race in access to ev_res from event loop with event_active() (27934f0b James Synge) + o If precise_time is false, we should not set EVENT_BASE_FLAG_PRECISE_TIMER (6cce7458 yongqing.jiao) + o buffer: fix incorrect unlock of the buffer mutex (for deferred callbacks) (93913da1 Azat Khuzhin) + o Fix base unlocking in event_del() if event_base_set() runned in another thread (08a0d366 Azat Khuzhin) + o Fix assert() condition in evbuffer_drain() for IOCP (ab3224c3 SuckShit) + o Notify event base if there are no more events, so it can exit without delay (23c2914f Azat Khuzhin) + o Do not loose ET flag in case of multiple events for the same fd added (33053cdd Isidor Kouvelas, Azat Khuzhin) + o IOCP fixes (to make it possible to work with HTTP layer) (3d815cf2 Azat Khuzhin) + o Add error-handling routine for arc4_seed() #769 (8d5b14d4 Seong-Joong Kim) + o buffer: fix evbuffer_remove_buffer() with empty chain in front (fdfabbec Azat Khuzhin) + o buffer: do not rely on ->off in advance_last_with_data() (5b19c9f6 Azat Khuzhin) + o Protect min_heap_push_ against integer overflow. (176fd566 Tobias Stoeckmann) + o Prevent endless loop in evmap_make_space (#804) (c6becb26 Tobias Stoeckmann) + o Prevent integer overflow in kq_build_changes_list. (#811) (cf8acae3 Tobias Stoeckmann) + o kqueue: Avoid undefined behaviour. (2707a4ff Tobias Stoeckmann) + o evbuffer: fix last_with_datap after prepend with empty chain (401bd1c0 Azat Khuzhin) + o evutil: set the have_checked_interfaces in evutil_check_interfaces() (0de2b145 jeremyerb) + o buffer: fix possible NULL dereference in evbuffer_setcb() on ENOMEM (#856) (bdcade47 Azat Khuzhin) + o Fix memory corruption in EV_CLOSURE_EVENT_FINALIZE with debug enabled (#885) (445027a5 Jan Kasiak) + o arc4random: replace sysctl() with getrandom (on linux) (86f55b04, 194a5d82 Azat Khuzhin) + o evutil_time: detect and use _gmtime64_s()/_gmtime64() (#898) (148d12ad yuangongji) + o evbuffer_add_file: fix freeing of segment in the error path (4727150a Azat Khuzhin) + o Parse IPv6 scope IDs. (#923) (9fecb59a Philip Homburg) + o event_base_once: fix potential null pointer threat (#956) (968bbd5c chenguolong) + o increase segment refcnt only if evbuffer_add_file_segment() succeeds (#964) (114b3836 yuangongji) + o Avoid triggering wrong events with EV_ET set (9543f31a Azat Khuzhin) + o epoll: handle EV_ET for EV_CLOSED too (e703c034 Azat Khuzhin) + o Fix EV_CLOSED detection/reporting (epoll only) (972b456b Azat Khuzhin) + o There is typo in GetAdaptersAddresses windows library. It should be iphlpapi.dll (#1012) (61fc2bf2 Aleksandr-Melnikov) + o buffer: do not pass NULL to memcpy() from evbuffer_pullup() (a0c642ac Azat Khuzhin) + o Fix leaks of signal handlers for select/poll backends (f6bfa8b3 Azat Khuzhin) + o Handle return value from getrandom() (#1070) (efa57159 Gerry Garvey) + o Retry write on EINTR in signal handler (#1158) (4f8a6144 Mike Sharov) + o Properly initialize sockaddr length on systems with sin_len. (#1177) (5c0e75c3 Tobias Heider) + o buffer: fix CreateFileMapping() leak from evbuffer_add_file() (6f139b87 Azat Khuzhin) + o evutil: Fix evutil_freeaddrinfo (#1223) (9a38bc5f Tomas Gonzalez) + o Fix socketpair failure when temporary directory has non-latin character (f8bb9d84 zhenhaonong) + o fix: arc4_getword integer overflow, detected by -fsanitize=undefined (b5b4c7fe jackerli(李剑)) + o fixed missing check for null after strdup in evutil_inet_pton_scope (#1366) (ff99f67a Michael Madsen) + o Optimize arc4random_uniform() (by syncing with OpenBSD implementation) (#1422) (557990ca Cœur) + o Always have evutil_secure_rng_add_bytes available (#1427) (4e6375e8 Kurt Roeckx) + + Bufferevent: + o Adjust evbuffer max read for bufferevents (5357c3d6 Azat Khuzhin) + o Implement bufferevent_socket_connect_hostname_hints() (5e137f37 Joseph Spadavecchia) + o bufferevent: allow setting priority on socket and openssl type (#1011) (bdc5200a Nicolas J. Bouliane) + + Bufferevent bugfixes: + o Remove check against passed bufferevent in bufferevent_socket_connect() (a10a6f4e Ivan Maidanski, Azat Khuzhin) + o Call underlying bev ctrl GET_FD on filtered bufferevents (40550814 Greg Hazel) + o Fix timeout resets for filters (4ba48739 Greg Hazel) + o bufferevent_socket_connect{,_hostname}() missing event callback and use ret code (f7bc1337 Jesse Fang) + o Fix hangs due to watermarks overruns in bufferevents implementations (878bb2d3 Azat Khuzhin) + o Simplify bufferevent timeout tests to reduce CPU usage in between start/compare (6ac8e775 Azat Khuzhin) + o Fix leaks in error path of the bufferevent_init_common_() (6995b9a8 Azat Khuzhin) + o Check return value of evbuffer_remove() in bufferevent_read() (#1133) (bc25889f lilei) + + Listeners: + o Immediately stop trying to accept more connections if listener disabled (416b48ba John Fremlin, Azat Khuzhin) + o listener: ipv6only socket bind support (387d91f9 Murat Demirten) + o listener: Preserve last error in evconnlistener_new_bind() before close (#1269) (d96457e1 kenping) + o Add LEV_OPT_BIND_IPV4_AND_IPV6 flag (#1400) (f9134df7 Edoardo Lolletti) + + Listeners bugfixes: + o Fix evconnlistener_free() closes already established connections (bc65ffc1 Azat Khuzhin) + o Fix deadlock in case of evconnlistener_disable() in parallel with callback (#1226) (12cedc8a moonlightsh) + + Docs: + o Move list of contributors into separate file (56c9551e Sayan Nandan) + o doc: cmake command on Windows (b002f04f yuangongji (A)) + o Deploy documentation to https://libevent.org/doc/ (05467445 Azat Khuzhin) + o Doxygen documentation improvements (620a3fa1, 1d1c1909, f9c6a14e yuangongji) + o Add vcpkg installation instructions (#953) (ec775a96 JackBoosY) + o Remove man pages from repo (they can be generated via doxygen) (31a5cfd3 Azat Khuzhin) + o Various documentation improvements (#842) (cdeb3242 yuangongji) + o Merge pull request #1441 from fanquake/autoconf_doc_updates (612a74c7 fanquake) + + Tests: + o test: fix 32bit linux regress (#554) (63c4bf78 Carlo Marcelo Arenas Belón) + o test: avoid regress hanging in macOS (#757) (a86f89d3 Carlo Marcelo Arenas Belón) + o Avoid possible SEGVs in select() (in unit tests) (33baa4e5 Philip Prindeville) + o Introduce TT_RETRIABLE (4d2f013b Azat Khuzhin) + o test-ratelim: calculate timers bias (for slow CPUs) to avoid false-positive (8a348699 Azat Khuzhin) + o Merge branch 'osx-clock' (a6f81aa4 Azat Khuzhin) + o Fix some OpenSSL 3 test issues (#1291) (29032da6 Peter Edwards) + + Fixes for various OS: + o Enable kqueue for APPLE targets (#849) (0d7d85c2 Keith Smiley) + o Enable _GNU_SOURCE for Android (#850) (41c95abb Keith Smiley) + o Fix compat with NetBSD >= 10 (#909) (72e6eff0 Kamil Rytarowski) + o RTEMS has no SA_RESTART (#1172) (73ca1801 Michael Davidsaver) Build fixes: - o Don't do clang version detection when disabling some flags (083296b - Sebastian Hahn) - - C standards conformance: - o Check for NULL return on win32 mm_calloc, and set ENOMEM. (af7ba69) - o Convert event-config.h macros to avoid reserved identifiers (68120d9) - o Generate event-config.h using the correct macros. (f82c57e) - o Convert include-guard macro convention to avoid reserved identifiers - (3f8c7cd) - o Make event_rpcgen.py output conform to identifier conventions (372bff1) - o Stop referring to an obsolete include guard in bench_http.h (5c0f7e0) - o Make the generated event-config.h use correct include guards (639383a) - o Fix all identifiers with names beginning with underscore. (cb9da0b) - o Make event_rpcgen.py output conform to identifier conventions, more - (bcefd24) - o Fix some problems introduced by automated identifier cleanup script - (c963534) - o Have all visible internal function names end with an underscore. (8ac3c4c) - o Apply the naming convention to our EVUTIL_IS* functions (c7848fa) - o Clean up lingering _identifiers. (946b584) - o Fix doxygen to use new macro conventions (da455e9) - - Bugfixes: - o Do not use system EAI/AI values if we are not using the system - getaddrinfo. (7bcac07) - - Sample Code: - o Fix up sample/event-test.c to use newer interfaces and make it - actually work. (19bab4f Ross Lagerwall) - o On Unix, remove event.fifo left by sample/event-test.c. (c0dacd2 Ross - Lagerwall) - o Rename event-test.c to event-read-fifo.c. (a5b370a Ross Lagerwall) - o event-read-fifo: Use EV_PERSIST appropriately (24dab0b) - - - - + o Include openssl-compat.h into dist archive (7bc822ca Azat Khuzhin) + o Unbreak build with LibreSSL after openssl 1.1 support added (d057c45e Jan Beich) + o Fix RPATH for APPLE (cc0e04d7 Trond Norbye) + o Fixes for ERR_remove_*state() (98faf198 Pierce Lopez) + o Various cmake fixes (65870949 Shuo Chen) + o cmake: autotools compatibility (5aade2d3, 489991a2, 882f537c, 8348b413 Marek Sebera, Azat Khuzhin) + o Fixes win32 builds after some previous patches (d84f0205 Azat Khuzhin) + o Fix arc4random_addrandom() detecting and fallback (regression) (266f43af Azat Khuzhin) + o Add missing print-winsock-errors.c into dist archive (8d89c212 Azat Khuzhin) + o Fix visibility issues (mostly on win32) (fb866645, ce3af533, cd285e42 Azat Khuzhin) + o Add configure check for midipix (94e5cc84 Redfoxmoon) + o autotools: pass $(OPENSSL_INCS) for samples (FTBFS macOS) (0ec5edde Carlo Marcelo Arenas Belón) + o autotools: confirm openssl is working before using (506df426 Carlo Marcelo Arenas Belón) + o Port `event_rpcgen.py` and `test/check-dumpevents.py` to Python 3. (8b0aa7b3 Kiyoshi Aman) + o Fix generation of LibeventConfig.cmake for the installation tree (#576) (6ee73ea9 Andrey Okoshkin) + o Provide Makefile variables LIBEVENT_{CFLAGS,CPPFLAGS,LDFLAGS} (1a448088 stenn) + o Fix build with LibreSSL 2.7 (28b80754 Bernard Spil) + o cmake: ensure windows dll's are installed as well as lib files (0fa43c99 Philip Herron) + o Fix out-of-tree builds (a5f19422 Cristian Morales Vega) + o config.h can't be prefixed unconditionally (587e9f58 Philip Prindeville) + o Define __EXT_POSIX2 for QNX (99a3887d Maya Rashish) + o libevent.pc: link against core/extra (731469b3 Mike Frysinger) + o Merge branch 'win32-visibility-event_debug_logging_mask_' (fb866645, cd285e42 Azat Khuzhin) + o cmake: introduce EVENT__LIBRARY_TYPE option (c9a073ea Azat Khuzhin) + o cmake: do not build both (SHARED and STATIC) for MSVC/win32 (90d80ef4 Azat Khuzhin) + o cmake: support static runtime (MSVC) (246f4404 Azat Khuzhin) + o Eliminate fd conversion warnings and introduce EVUTIL_INVALID_SOCKET (windows) (b29207dc Azat Khuzhin) + o Define `_GNU_SOURCE` properly/consistently per autoconf (5f87be42 Enji Cooper) + o Fixes for uchex static analyzer (da33f768 Azat Khuzhin) + o cmake: add missing autotools targets (doxygen, uninstall, event_rpcgen.py) (7201062f yuangongji) + o cmake: set library names to be the same as with autotools (669a53f3 yuangongji) + o cmake: install shared library only if it was requested (55d1e20e Azat Khuzhin) + o Added uninstall target check to cmakelists (#948) (f0e79baf Dimo Markov) + o Build doxygen documentation via cmake (to fill variables) (095c8ae1 Azat Khuzhin) + o Merge #929 -- cmake package improvements (8be8ac46 yuangongji) + o cmake: do not link libevent with libevent_core (#1123) (657e1806 Loïc Yhuel) + o cmake: Fix generted pkgconfig files. (#1165) (1fe8b3d6 Biswapriyo Nath) + o cmake: don't override CMAKE_CONFIGURATION_TYPES. (#1166) (087bbc57 Paweł Wegner) + o CheckWorkingKqueue.cmake: fix missing headers (#1225) (89505f85 Christopher Chavez) + o cmake: Fix Android build. (8f47d8de Ryan Pavlik) + o cmake: do influence CMAKE_DEBUG_POSTFIX of the outer project (if any) (650d8619 Azat Khuzhin) + o cmake: remove redundant _GNU_SOURCE definition (82af0ea4 Azat Khuzhin) + o Various autotools build improvements (#1171) (6d800fd6 fanquake) + o Require libevent_core not libevent for pkg-config (#1257) (66861f88 moonlightsh) + o -Werror fixes andCI (#1297) (7aeecb60 Azat Khuzhin) + o Add postfix for Debug configuration. (dd610b77 Haowei Hsu) + o Fix ignoring return value of arc4random() warning (with _FORTIFY_SOURCE defined) (#1394) (c01cb1d6 liaotonglang) + o Merge pull request #1418 from fanquake/use_fortify_source_3 (bcefdbc6 fanquake) + o Use GNUInstallDirs - #1397 (4dee61c0 Tobias Mayer, Jonathan Ringer, Azat Khuzhin) + o Make dependency paths relocatable (#1385) (acfac7ae Ingo Bauersachs) diff --git a/lib/monkey/mk_core/deps/libevent/ChangeLog-1.4 b/lib/monkey/mk_core/deps/libevent/ChangeLog-1.4 index 166d30872f8..dd865135926 100644 --- a/lib/monkey/mk_core/deps/libevent/ChangeLog-1.4 +++ b/lib/monkey/mk_core/deps/libevent/ChangeLog-1.4 @@ -152,7 +152,7 @@ Changes in 1.4.2-rc: o remove NDEBUG ifdefs from evdns.c o update documentation of event_loop and event_base_loop; from Tani Hosokawa. o detect integer types properly on platforms without stdint.h - o Remove "AM_MAINTAINER_MODE" declaration in configure.in: now makefiles and configure should get re-generated automatically when Makefile.am or configure.in chanes. + o Remove "AM_MAINTAINER_MODE" declaration in configure.in: now makefiles and configure should get re-generated automatically when Makefile.am or configure.in changes. o do not insert event into list when evsel->add fails Changes in 1.4.1-beta: @@ -163,7 +163,7 @@ Changes in 1.4.1-beta: o better documentation for event_base_loopexit; from Scott Lamb. o Make kqueue have the same behavior as other backends when a signal is caught between event_add() and event_loop(). Previously, it would catch and ignore such signals. o Make kqueue restore signal handlers correctly when event_del() is called. - o provide event_reinit() to reintialize an event_base after fork + o provide event_reinit() to reinitialize an event_base after fork o small improvements to evhttp documentation o always generate Date and Content-Length headers for HTTP/1.1 replies o set the correct event base for HTTP close events @@ -175,7 +175,7 @@ Changes in 1.4.1-beta: o support for 32-bit tag numbers in rpc structures; this is wire compatible, but changes the API slightly. o prefix {encode,decode}_tag functions with evtag to avoid collisions o Correctly handle DNS replies with no answers set (Fixes bug 1846282) - o The configure script now takes an --enable-gcc-warnigns option that turns on many optional gcc warnings. (Nick has been building with these for a while, but they might be useful to other developers.) + o The configure script now takes an --enable-gcc-warnings option that turns on many optional gcc warnings. (Nick has been building with these for a while, but they might be useful to other developers.) o When building with GCC, use the "format" attribute to verify type correctness of calls to printf-like functions. o removed linger from http server socket; reported by Ilya Martynov o allow \r or \n individually to separate HTTP headers instead of the standard "\r\n"; from Charles Kerr. diff --git a/lib/monkey/mk_core/deps/libevent/ChangeLog-2.0 b/lib/monkey/mk_core/deps/libevent/ChangeLog-2.0 index a925d33b180..e58df8185df 100644 --- a/lib/monkey/mk_core/deps/libevent/ChangeLog-2.0 +++ b/lib/monkey/mk_core/deps/libevent/ChangeLog-2.0 @@ -263,7 +263,7 @@ Changes in version 2.0.12-stable (4 Jun 2011) BUGFIXES o Fix a warn-and-fail bug in kqueue by providing kevent() room to report errors (28317a0) o Fix an assert-inducing fencepost bug in the select backend (d90149d) - o Fix failing http assertion introducd in commit 0d6622e (0848814 Kevin Ko) + o Fix failing http assertion introduced in commit 0d6622e (0848814 Kevin Ko) o Fix a bug that prevented us from configuring IPv6 nameservers. (74760f1) o Prevent size_t overflow in evhttp_htmlescape. (06c51cd Mansour Moufid) o Added several checks for under/overflow conditions in evhttp_handle_chunked_read (a279272 Mark Ellzey) @@ -986,7 +986,7 @@ BUILD AND DISTRIBUTION CHANGES INTERNALS AND CODE CLEANUPS o Add a .gitignore file. (ba34071) o New EVTHREAD_TRY_LOCK function to try to grab a lock. (689fc09) - o Add the abilitity to mark some buffer callbacks as never-deferred. (438f9ed) + o Add the ability to mark some buffer callbacks as never-deferred. (438f9ed) o Refactor our 'suspend operation' logic on bufferevents. (0d744aa) o Simplify the read high-watermark checking. (5846bf6) o Improve readability of evutil_unparse_protoname() (5a43df8 Jardel Weyrich) @@ -994,7 +994,7 @@ INTERNALS AND CODE CLEANUPS o Whitespace fixes in test.sh (0b151a9) o Enable branch-prediction hints with EVUTIL_UNLIKELY. (eaaf27f) o Refactor code from evdns into a new internal "read a file" function. (0f7144f) - o Comestic changes in evconnlistener_new(), new_accepting_socket(), accepted_socket_invoke_user_cb() and iocp_listener_enable(). (510ab6b Jardel Weyrich) + o Cosmetic changes in evconnlistener_new(), new_accepting_socket(), accepted_socket_invoke_user_cb() and iocp_listener_enable(). (510ab6b Jardel Weyrich) o Add unit-test for bad_request bug fixed in 1.4 recently. (6cc79c6 Pavel Plesov) o Add a comment on evthread_enable_lock_debuging. (b9f43b2) o Fix test.sh on shells without echo -n (94131e9) o More unit tests for getaddrinfo_async: v4timeout and cancel. (a334b31) @@ -1082,7 +1082,7 @@ Changes in 2.0.2-alpha (25 Jul 2009): o Add a new flag to bufferevents to make all callbacks automatically deferred. o Make evdns functionality locked, and automatically defer dns callbacks. o Fix a possible free(NULL) when freeing an event_base with no signals. - o Add a flag to disable checking environment varibles when making an event_base + o Add a flag to disable checking environment variables when making an event_base o Disallow setting less than 1 priority. o Fix a bug when removing a timeout from the heap. [Patch from Marko Kreen] o Use signal.h, not sys/signal.h. [Patch from mmadia] @@ -1143,7 +1143,7 @@ Changes in 2.0.1-alpha (17 Apr 2009): o Check return value of event_add in signal.c o Add a more powerful evbuffer_readln as a replacement for evbuffer_readline. The new function handles more newline styles, and is more useful with buffers that may contain a nul characters. o Do not mangle socket handles on 64-bit windows. - o The configure script now takes an --enable-gcc-warnigns option that turns on many optional gcc warnings. (Nick has been building with these for a while, but they might be useful to other developers.) + o The configure script now takes an --enable-gcc-warnings option that turns on many optional gcc warnings. (Nick has been building with these for a while, but they might be useful to other developers.) o move EV_PERSIST handling out of the event backends o small improvements to evhttp documentation o always generate Date and Content-Length headers for HTTP/1.1 replies diff --git a/lib/monkey/mk_core/deps/libevent/ChangeLog-2.1 b/lib/monkey/mk_core/deps/libevent/ChangeLog-2.1 new file mode 100644 index 00000000000..9100f016218 --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/ChangeLog-2.1 @@ -0,0 +1,2162 @@ +Changes in version 2.1.12-stable (05 Jul 2020) + + This release contains mostly bug fixes (I decided not to port some features + that can be ported even without ABI breakage, if you cannot find feature that + you are interested in, please give us a note!) + + Since 2.1.12 libevent will use github actions as main CI, since + it recommends itself better then travis/appveyor (and had been removed from + upstream). + + Look carefully at "slightly touches the behaviour" section. + + Below you will find some of changes (this list has been cleaned up from the + patches that touches only tests and similar): + + CI: + o Backport github actions to 2.1 (be3acd7c Azat Khuzhin) + o Merge branch 'event_rpcgen.py-cleanup' (f0ded5f3, 48e04887 Enji Cooper) + o Add API/ABI checker (using LVC) (709210d4, 2af1f6cc yuangongji) + + test: + o tinytest: support timeout on Windows (794e8f75 yuangongji) + o Merge branch 'osx-clock' (e85afbe3 Azat Khuzhin) + o test-ratelim: calculate timers bias (for slow CPUs) to avoid false-positive (8ad26d0b Azat Khuzhin) + + fixes: + o buffer: do not pass NULL to memcpy() from evbuffer_pullup() (5b063049 Azat Khuzhin) + o http: fix undefined-shift in EVUTIL_IS*_ helpers (6b8d02a7 Azat Khuzhin) + o Check error code of evhttp_add_header_internal() in evhttp_parse_query_impl() (97e28f09 Azat Khuzhin) + o http: fix EVHTTP_CON_AUTOFREE in case of timeout (and some else) (1be25938 Azat Khuzhin) + o evdns: Add additional validation for values of dns options (c2972453 ayuseleznev) + o There is typo in GetAdaptersAddresses windows library. It should be iphlpapi.dll (891adda9 Aleksandr-Melnikov) + o Merge branch 'EV_CLOSED-and-EV_ET-fixes' (db2efdf5 Azat Khuzhin) + o Fix memory corruption in EV_CLOSURE_EVENT_FINALIZE with debug enabled (8ccd8f56 Jan Kasiak) + o increase segment refcnt only if evbuffer_add_file_segment() succeeds (30662a3c yuangongji) + o evdns: fix a crash when evdns_base with waiting requests is freed (6f8e0e97 ayuseleznev) + o event_base_once: fix potential null pointer threat (2e9ceb16 chenguolong) + o http: do not assume body for CONNECT (1b42270b Azat Khuzhin) + o evbuffer_add_file: fix freeing of segment in the error path (5f017bde Azat Khuzhin) + o Fix checking return value of the evdns_base_resolv_conf_parse() (fc51bf2c Azat Khuzhin) + o Merge branch 'fix-signal-leak' (poll/select now needs reinit) (1c9cc07b Azat Khuzhin) + + improvements: + o evutil_time: improve evutil_gettimeofday on Windows (a8219143 Nick Grifka) + o Support EV_CLOSED on linux for poll(2) (2530e7c6 Azat Khuzhin) + o Parse IPv6 scope IDs. (f602211f Philip Homburg) + o evutil_time: Implements usleep() using wait funtion on Windows (d42240d1 yuangongji) + o evutil_time: detect and use _gmtime64_s()/_gmtime64() (f4a6152c yuangongji) + + slightly touches the behaviour: + o bufferevent: allow setting priority on socket and openssl type (4dd3acdd Nicolas J. Bouliane) + o Fix EV_CLOSED detection/reporting (epoll only) (1df324d4 Azat Khuzhin) (XXX) + o Revert "Warn if forked from the event loop during event_reinit()" (71f5c0d3 Azat Khuzhin) + + samples: + o https-client: load certificates from the system cert store on Windows (e9478640 yuangongji) + + build fixes: + o Do not use sysctl.h on linux (it had been deprecated) (d2871a37 Azat Khuzhin) + o cmake: avoid problems from use of CMAKE_USE_PTHREADS_INIT (a62ec765 Paul Osborne) + o Update list of cmake files for autotools dist archive (2016f017 Azat Khuzhin) + o LibeventConfig.cmake: restore CMAKE_FIND_LIBRARY_SUFFIXES and LIBEVENT_STATIC_LINK default (640f9cf6 Mario Emmenlauer) + o cmake: fix getaddrinfo checking error (dea51c2e yuangongji) + o autoconf: fix getaddrinfo checking errors on mingw (b9bf7fa7 yuangongji) + o Do not use shared global structures on CYGWIN (8a9b5655 Azat Khuzhin) + o Added uninstall target check to cmakelists (3f1fb1f9 Dimo Markov) + o Fix compilation without OPENSSL_API_COMPAT (921bdcdd Azat Khuzhin) + o cmake: improve package config file (1c047618, baec84f2 yuangongji) + o Link with iphlpapi only on windows (976f7d34 Azat Khuzhin) + o autotools: fails build when need but can not find openssl (93174bb5 yuangongji) + o Merge branch 'http-connect' (e2424229 Azat Khuzhin) + o Fix compat with NetBSD >= 10 (5febb4e1 Kamil Rytarowski) + o cmake: fix getrandom() detection (e0e5f3bd Azat Khuzhin) + o arc4random: replace sysctl() with getrandom (on linux) (66ec78fd Azat Khuzhin) + o Upgrade autoconf (after upgrading minimum required to 2.67) (45da7d9d yuangongji) + o eliminate some C4267 warnings in Windows (9e468c77 yuangongji) + o autotools: attach doxygen target into all target (5d1e8570 yuangongji) + o cmake: attach doxygen target into all target (7a85300a yuangongji) + o Change the minimum version of automake to 1.13 and autoconf to 2.67 (fdb8fb66 ygj6) + o Add Uninstall.cmake.in into dist archive (877f2355 Azat Khuzhin) + +Changes in version 2.1.11-stable (01 Aug 2019) + + This release contains one ABI breakage fix (that had been introduced in + 2.1.10, and strictly speaking this release breaks ABI again to make it + compatible with 2.1.9 and less, please take a look at 18104973 for more + details). Apart from that it contains some bug fixes, that grouped below. + + And even though the return value for evbuffer_setcb() had been changed it + should ABI compatible (anyway that function is in -compat.h header). + + There is also one patch that introduce new functionality, this is 546a366c, + to tune SO_RCVBUF/SO_SNDBUF in evdns, but one can count it as a bug-fix on + the application level, since before you cannot tune this settings and hence + you could stumble on problems. + + ABI breakage: + o Protect min_heap_push_ against integer overflow. (8c899768 Tobias Stoeckmann) + o Revert "Protect min_heap_push_ against integer overflow." (18104973 Azat Khuzhin) + + functionality: + o evdns: add new options -- so-rcvbuf/so-sndbuf (546a366c Azat Khuzhin) + + build: + o Change autoconf version to 2.62 and automake version to 1.11.2 (2a333008 yuangongji) + o cmake: install shared library only if it was requested (596855f7 Azat Khuzhin) + o Missing on win7/MinGW(MINGW32_NT-6.1)/MSYS (9559349c yuangongji) + o cmake: set library names to be the same as with autotools (305251b9 yuangongji) + o Enable _GNU_SOURCE for Android (f013fc7d Keith Smiley) + o Enable kqueue for APPLE targets (3aa68a82 Keith Smiley) + o autotools: do not install bufferevent_ssl.h under --disable-openssl (5349a07e Azat Khuzhin) + o cmake: link against shell32.lib/advapi32.lib (c9ce638c Azat Khuzhin) + o Add README.md into dist archive (3660a4cc Azat Khuzhin) + o cmake: add missing autotools targets (doxygen, uninstall, event_rpcgen.py) (2d65071c yuangongji) + o m4/libevent_openssl.m4: fix detection of openssl (d4056e59 Fabrice Fontaine) + o Fix detection of the __has_attribute() for apple clang [ci skip] (7fd7c5ef Azat Khuzhin) + + lib: + o buffer: fix possible NULL dereference in evbuffer_setcb() on ENOMEM (598f247d Azat Khuzhin) + o Warn if forked from the event loop during event_reinit() (b75922ae Azat Khuzhin) + o evutil: set the have_checked_interfaces in evutil_check_interfaces() + (ef498aa2, a09265ac jeremyerb) + + samples: + o https-client: correction error checking (a8a04565 wenyg) + + +Changes in version 2.1.10-stable (26 May 2019) + + This release contains mostly fixes (some evbuffer oddity, AF_UNIX handling in + http server, some UB fixes and others) but also some new functionality + (without ABI breakage as usual) and now dist archive can be used for building + on windows (getopt had been added into it). + + Above you will find changelog for this particular release (but with some + trivial fixes pruned out from it - to make it a little bit more informative). + + To view full changelog please use git: + git log --format=' o %s (%h %aN)' release-2.1.9-beta...release-2.1.10-stable + + dist: + o Add getopt into dist archive (7042ff24 Azat Khuzhin) + + functionality: + o evdns: add DNS_OPTION_NAMESERVERS_NO_DEFAULT/EVDNS_BASE_NAMESERVERS_NO_DEFAULT + (58e81106 Azat Khuzhin) + o Add support for EV_TIMEOUT to event_base_active_by_fd (3f893f0a John Ohl) + + fixes: + o Merge branch 'evbuffer-fixes-806-v2' (2fea04b3 Azat Khuzhin) + o Merge branch 'issue-807-accept4-getnameinfo-AF_UNIX' (7c4da937, e2790a7f + Azat Khuzhin) + o kqueue: Avoid undefined behaviour. (e70e18e9 Tobias Stoeckmann) + o Prevent integer overflow in kq_build_changes_list. (43a55a23 Tobias Stoeckmann) + o evdns: fix lock/unlock mismatch in evdns_close_server_port() (54103883 zhuizhuhaomeng) + o Merge remote-tracking branch 'official/pr/804' -- Enforce limit of NSIG + signals (87fa93a8 Tobias Stoeckmann) + o Protect min_heap_push_ against integer overflow. (0b46bb8c Tobias Stoeckmann) + o le-proxy: initiate use of the Winsock DLL (2a1e1530 linxiaohui) + o Fix leaks in error path of the bufferevent_init_common_() (bb0f8fe7 Azat Khuzhin) + o buffer: make evbuffer_prepend() of zero-length array no-op (61fa7b7d Azat Khuzhin) + o Merge branch 'evbuffer-empty-chain-handling' (6a3dd717 Azat Khuzhin) + o Don't loose top error in SSL (3d1a7a1d Yury Korzhetsky) + o Remove needless check for arc4_seeded_ok (6602a97d Seong-Joong Kim) + o Merge pull request #769 from sungjungk/fix-return-handling (91084140 Nathan French) + + build: + o Define `_GNU_SOURCE` properly/consistently per autoconf (00ba9fa2 Enji Cooper) + o signal: guard __cdecl definition with #ifdef (d89045a6 Azat Khuzhin) + o Link test/regress with event_core/event_extra over event (22380996 Azat Khuzhin) + + tests: + o Use kill() over raise() for raising the signal (fixes osx 10.14 with + kqueue) (3db5296b, a45f6733 Azat Khuzhin) + o tinytest: implement per-test timeout (via alarm() under !win32 only) + (b64dbfb6, 75d7e1ff Azat Khuzhin) + +Changes in version 2.1.9-beta (10 February 2019) + + This changelog will differs from other releases in the next few clauses: + - contains only highlighted changes (so now it will not contains a lot of + patches that fixes some stuff in regression tests, typos, leaks fixes in + samples and so forth) + - no authors (since merge commits breaks them anyway, but AUTHORS sections in + README will be kept up to date) + - group name trimmed from commit subjects trimmed + - it's been 2 years since the previoius release, so it is pretty huge + + And I think that this is more useful, so from now on it will always has the + same look (until there will too many objections of course). + + To view full changelog please use git: + git log --format=' o %s (%h %aN)' release-2.1.8-stable...release-2.1.9-beta + + + dist archive: + o Add cmake rules into dist archive (bf3a67cf) + o Add missing print-winsock-errors.c into dist archive (822d6462) + o Include openssl-compat.h into dist archive (08658136) + + core: + o Merge branch 'check-O_NONBLOCK-in-debug' (a39898f3, a8155c62) + o Merge branch 'event-ET-#636-v2' (ca4b6404) + o Fix visibility issues under (mostly on win32) + (349081e1g, 802be13ag, a1f28e2f) + o Define __EXT_POSIX2 for QNX (a2176f2c) + o Cleanup __func__ detection (b3af7bdd) + o Add convenience macros for user-triggered events (06ec5de6) + o Notify event base if there are no more events, so it can exit without delay (d9d1c09e) + o Fix base unlocking in event_del() if event_base_set() runned in another thread (4f0f40e3) + o If precise_time is false, we should not set EVENT_BASE_FLAG_PRECISE_TIMER (27dee54d) + o Fix race in access to ev_res from event loop with event_active() (43d92a6d) + o Return from event_del() after the last event callback termination (876c7ac7) + + http: + o Merge branch 'http-EVHTTP_CON_READ_ON_WRITE_ERROR-fixes-v2' (eb7b472b) + o Preserve socket error from listen across closesocket cleanup (2ccd00a6) + o fix connection retries when there more then one request for connection (d30e7bba) + o improve error path for bufferevent_{setfd,enable,disable}() (a8cc449e) + o Fix conceivable UAF of the bufferevent in evhttp_connection_free() (6ac2ec25) + o Merge branch 'http-request-line-parsing' (cdcfbafe) + o Fix evhttp_connection_get_addr() fox incomming http connections (4215c003) + o fix leaks in evhttp_uriencode() (123362e9) + o CONNECT method only takes an authority (7d1ffe64) + o Allow bodies for GET/DELETE/OPTIONS/CONNECT (23eb38b9) + o Do not crash when evhttp_send_reply_start() is called after a timeout. (826f1134) + o Fix crashing http server when callback do not reply in place (5b40744d, b2581380) + o fix handling of close_notify (ssl) in http with openssl bufferevents (7e91622b) + + evrpc: + o use *_new_with_arg() to match function prototype (a95cc9e3) + o avoid NULL dereference on request is not EVHTTP_REQ_POST (e05136c7) + + regression tests: + o Merge branch 'TT_RETRIABLE' (6ea1ec68, f9b592aa) + + bufferevent: + o Merge branch 'iocp-fixes' (6bfac964) + o Merge branch 'be-wm-overrun-v2' (3f692fff) + o bufferevent_socket_connect{,_hostname}() missing event callback and use ret code (1dde74ef) + o don't fail be_null_filter if bytes are copied (b92b0792) + o Call underlying bev ctrl GET_FD on filtered bufferevents (ebfac517) + + bufferevent_openssl/openssl: + o Merge branch 'ssl_bufferevent_wm_filter-fix' (30020a35) + o be_openssl: avoid leaking of SSL structure (e86ccfe5) + o Fix build with LibreSSL 2.7 (894ca48a) + o Add missing includes into openssl-compat.h (01bc36c1) + o Explicitly call SSL_clear when reseting the fd. (29b7a516) + o Unbreak build with LibreSSL after openssl 1.1 support added (230af9f0) + + samples: + o Merge branch 'sample-http-server' (b6309bcc) + o sample/https-client: use host SSL certificate store by default (5c0132f3) + + listener: + o ipv6only socket bind support (ba148796) + o Merge branch 'listener-immediate-close' (df2ed13f) + o Merge branch 'evconnlistener-do-not-close-client-fd' (42e851bb) + + evdns: + o evdns: handle NULL filename explicitly (0033f5cc) + o Merge branch 'evdns_getaddrinfo-race-fix' (3237d697) + o Generating evdns_base_config_windows_nameservers docs on all platforms (3bd2ce43) + + utils: + o Merge branch 'evutil_found_ifaddr-dev' (b07e43e6) + o Avoid possible SEGVs in select() (in unit tests) (8818c86c) + o Port `event_rpcgen.py` and `test/check-dumpevents.py` to Python 3. (532a8cc3) + + buffer: + o Fix assert() condition in evbuffer_drain() for IOCP (d6326104) + o fix incorrect unlock of the buffer mutex (for deferred callbacks) (2b4d127d) + o Fix wrong assert in evbuffer_drain() (9f4d0dce) + + cmake: + o fix checking of devpoll backend (like in autotools, by devpoll.h existence) (7f161902) + o support static runtime (MSVC) (c8b3ec17, 61fb055a) + o do not build both (SHARED and STATIC) for MSVC/win32 (bc7f2fd9) + o introduce EVENT__LIBRARY_TYPE option (eb10a738) + o ensure windows dll's are installed as well as lib files (29590718) + o Fix generation of LibeventConfig.cmake for the installation tree (7fa08c4b) + o fix pkgconfig generation (copy-paste typo) (cc554d87) + o Merge branch 'cmake-missing-bits' (9806b126) + o Fix detection of timerfd_create() in CMake. (e50af331) + o Merge branch 'cmake-configure-fixes-v2' (a0bfe2c4) + o Do not add epoll_sub (syscall wrappers) for epoll in cmake (cea61de6) + o Fix RPATH for APPLE (45b1f379) + + autotools: + o include win32 specific headers for socklen_t detection on win32/mingw (d7579fb9) + o Ignore evconfig-private.h for autotools (37423849) + o config.h can't be prefixed unconditionally (63a054f8) + o Merge branch 'pull-628' (7e56c8b2) + o Provide Makefile variables LIBEVENT_{CFLAGS,CPPFLAGS,LDFLAGS} (2f060c5f) + o confirm openssl is working before using (b39ccf8e) + o pass $(OPENSSL_INCS) for samples (FTBFS macOS) (c2495265) + o Add configure check for midipix (d433201e) + o Fix tests with detached builds (c46ff439) + + build: + o Fix arc4random_addrandom() detecting and fallback (regression) (303d6d77) + o Merge branch 'win32-fixes' (ebd12e6d) + o Merge branch 'fix-openssl-linking' (e7bd9e03) + o Merge branch 'fix-struct-linger' (8567f2f5) + + CI: + o travis-ci/appveyor now uses fast_finish+allow_failures + (5e97b6e6, dd472e7d, dfb5fc167) + o Merge branch 'travis-ci-osx-fixes' (9f02b39c) + o Merge branch 'win64-fixes' (aee0fcd5) + + +Changes in version 2.1.8-stable (22 January 2017) + + Libevent 2.1.8-stable, it contains openssl fixes for resetting fd and using + bufferevent_openssl_filter_new(). vagrant fixes, some build fixes, increased + timeout for some tests (to reduce number of failures due to timing issues), + date in RFC1123 format and running tests in parallel. + + There are highlighted changes above. + + Build fixes: + o Fix _FILE_OFFSET_BITS redinition (solaris/autotools) (336f3b11 Azat Khuzhin) + o util-internal: fix __func__ redefinition (netbsd) (253e7fa9 Azat Khuzhin) + o Fix signedness differ for iov_base (solaris) (2c62062e Azat Khuzhin) + o evutil_time: include when there is only sleep()/usleep() (3e75194c Azat Khuzhin) + o http: fix formatter for pritnf for req->ntoread (osx) (1cbf26f6 Azat Khuzhin) + Testing environment: + o Merge branch 'automake-tests-parallel-v4' (*includes ci bits also*) (59e217df Azat Khuzhin) + Vagrant env fixes: + o vagrant/netbsd: missing libtool (9c9be399 Azat Khuzhin) + o vagrant/netbsd: more reliable way of installing packages (36da6877 Azat Khuzhin) + o vagrant/osx: use make instead of gmake (there is no gmake) (f7c70aef Azat Khuzhin) + o vagrant: add centos box (ca591c5b Azat Khuzhin) + Tests: + o test/dns: replace servname since solaris does not have "http" (d6bafbbe Azat Khuzhin) + o test/thread: netbsd is too slow, increase timeout for conditions_simple (3c7422fc Azat Khuzhin) + o test/dns: run async resolving after sync one (to avoid timeouts) (07862531 Azat Khuzhin) + o test/http: turn off some tests that based on backlog filling (falky) (26f416c1 Azat Khuzhin) + Bugfixes: + o Merge branch 'openssl-filter-fixes-v4' (83e0f43b Azat Khuzhin) + o Merge branch 'date-rfc1123' (68def435,4798de6c,4545807d Azat Khuzhin) + o Merge branch 'be-openssl-fd-reset-fix-v2' (86fa0070,32adf434 Azat Khuzhin) + o Merge branch 'openssl-1.1-init-fixes-v2' (18a161f0 Azat Khuzhin) + o Fix incorrect MIME type (23f9a20e johnsonlee) + Trivial fixes: + Documentation updates: + o Update README.md (3821cca1 Breaker) + + +Changes in version 2.1.7-rc (2 Novemer 2016) + + Libevent 2.1.7-rc contains openssl 1.1 support, build fixes, CI improvements + and plus Vagrantfile for testing under multiple OS'es. + + + Continuous Integration: + o Use coveralls.io via travis (9ac000c Azat Khuzhin) + o travis-ci: use container-based infrastructure (7e12e96 Azat Khuzhin) + o travis-ci/osx: fix compiling/linking openssl libraries (9d2f8d4 Azat Khuzhin) + o travis-ci: use gcc-5 (fixes osx|gcc failures) (d7ceae5 Azat Khuzhin) + o Testing with vagrant for 6 OS and cmake+autoconf (9585338 Azat Khuzhin) + o travis-ci/osx: install lcov (e4e099b Azat Khuzhin) + + Build Improvements/Fixes: + o Fix cmake -DEVENT__COVERAGE=ON (40fbffc Azat Khuzhin) + o autogen.sh: learn about gmake (9376ac4 Azat Khuzhin) + o autogen.sh: remove all autoconf/automake caches, if any (69cce25 Azat Khuzhin) + o cmake: fix finding python2, and check that it is really 2 (3453c08 Azat Khuzhin) + o cmake: fix CheckFunctionExistsEx/CheckPrototypeDefinition (CMP0054) (43b69b2 Azat Khuzhin) + o cmake: cleanup (dc624ad Zonr Chang) + o cmake/win32: fix running regress, but fixing finding python2 interpreter (bcb990a Azat Khuzhin) + o cmake: use PYTHON_EXECUTABLE to find python2 (a4d044c Azat Khuzhin) + o Merge branch 'force-disable-clockgettime' (83c7cdf Azat Khuzhin) + + Code Improvements (core) + o use ev_uint16_t instead of unsigned short for port (e983712 Thomas Bernard) + o Merge branch 'contrib-guide-v2' (b9c5077 Azat Khuzhin) + o poll: Prevent libevent from spinning if POLLNVAL occurs (675974c Tim Hentenaar) + + Testing: + o test/regress: cover a polling of invalid fd (cb0df5c Tim Hentenaar) + + Code Improvements (bufferevent_openssl) + o Make it build using OpenSSL 1.1.0 (3e9e0a0 Kurt Roeckx) + o Don't call BIO_number_{read|written} on NULL BIOs. (6702da1 Adam Langley) + o Switch from a 512 to 2048-bit RSA key. (f9803a6 Adam Langley) + + Trivial fixes: + o Ignore temporary configure files (8fb08ae Azat Khuzhin) + o README.md: fix typo: ar -> are (2361616 Simone Basso) + o be: just a simple mistake, reinclude the (7521664 Seven) + +Changes in version 2.1.6-beta (4 July 2016) + + Libevent 2.1.6-beta contains mostly bug fixes (evbuffers, evthread, evdns, + bufferevents, core, http, samples), improvements but mostly to fix some + possible issues (EVHTTP_CON_LINGERING_CLOSE), a lot of new unit tests and new + appveyor integration. + + Security Fixes (utils) + o evutil_parse_sockaddr_port(): fix buffer overflow (329acc1 Azat Khuzhin) + + Security Fixes (evdns) + o evdns: name_parse(): fix remote stack overread (96f64a0 Azat Khuzhin) + o evdns: fix searching empty hostnames (ec65c42 Azat Khuzhin) + + New APIs (evdns) + o New function to get address for nameserver. (537177d Nick Mathewson) + + New APIs (bufferevents) + o expose bufferevent_incref/decref (with fewer modifications) (1ed6718 Mark Ellzey) + + New APIs (internal) + o evdns: export cancel via callbacks in util (like async lib core/extra issues) (8cbe65d Azat Khuzhin) + + New APIs/Improvements (http) + o http: take EVHTTP_CON_LINGERING_CLOSE into account for "Expect: 100-Continue" (ac448a7 Azat Khuzhin) + o http: lingering close (like nginx have) for entity-too-large (9fde518 Azat Khuzhin) + o http: read server response even after server closed the connection (680742e Azat Khuzhin) + o http: export evhttp_connection_set_family() (714fc70 Azat Khuzhin) + o http: reuse connected address only with EVHTTP_CON_REUSE_CONNECTED_ADDR (a50f5f0 Azat Khuzhin) + o http: use IP address that we got before (if any) during retrying (54c887d Azat Khuzhin) + + Bugfixes (core) + o Fix getaddrinfo under solaris (for multiprotocol case) (40730ae Azat Khuzhin) + o Check for Mac OS X 10.4 kqueue bug properly (df6f99e Mark Mentovai) + o event_reinit: make signals works after fork() without evsig_add() (88640aa Nicholas Marriott) + o event_reinit: always re-init signal's socketpair (ad0c237 Nicholas Marriott) + o Free event queues even for recursive finalizers (7c8d015 Azat Khuzhin) + o Fix checking for make_base_notifiable() (f337296 Azat Khuzhin) + o Set correct socklen for PF_INET6 sockaddr len (3499ad9 Mark Ellzey) + o Fix garbage value in socketpair util function, stdint? (043ae74 Mark Ellzey) + o fix the return value of event_deferred_cb_schedule_ (38cef64 Greg Hazel) + o event_free_debug_globals_locks(): disable lock debugging (e5c87d1 Azat Khuzhin) + o event: call event_disable_debug_mode() in libevent_global_shutdown() (941faae Azat Khuzhin) + o ht-internal: don't reset hth_table_length explicitly in name_##HT_CLEAR (597c7b2 Azat Khuzhin) + + Bugfixes (evthread) + o evthread: fix evthread_setup_global_lock_() for debug-lock with a real-lock case (e4556fc Azat Khuzhin) + o evthread: evthreadimpl_disable_lock_debugging_() for libevent_global_shutdown() (ccc5593 Azat Khuzhin) + + Bugfixes (evdns) + o evdns: avoid double-free in evdns_base_free() for probing requests (4db15e0 Azat Khuzhin) + o evdns: evdns_base_free(): fix UAF of evdns_base with @fail_requests (00313c5 Azat Khuzhin) + o evdns: evdns_base_free(): free requests before namservers (14f84bb Azat Khuzhin) + o evdns: fix randomize-case by make case-insensitive as required (9c238de Azat Khuzhin) + + Bugfixes (bufferevents) + o be_sock: handle readv() returns ECONNREFUSED (freebsd 9.2) (3189eb0 Azat Khuzhin) + o be_filter: avoid data stuck under active watermarks (b627ad8 Eduardo Panisset) + o Fix bufferevent_pair to properly set BEV_EVENT_{READING,WRITING} on flush. (2851889 David Paschich) + o be_openssl: clear all pending errors before SSL_*() calls (38e0f4a Azat Khuzhin) + o be_sock: cancel in-progress dns requests (86dfd2c Azat Khuzhin) + o be_sock: unfreeze buffers on fd changing (255525d Azat Khuzhin) + o be_sock: bufferevent_socket_connect_hostname(): make it thread-safe (809bb39 Azat Khuzhin) + o be_openssl: don't call do_write() directly from outbuf_cb (da52933 Azat Khuzhin) + o be_openssl: use bufferevent_enable() instead of bufferevent_add_event_() (0c66d32 Azat Khuzhin) + o be_openssl: don't add events during bev creation (like be_sock) (f4b6284 Azat Khuzhin) + o Fix lock leak in be_pair_flush() if flush type is BEV_NORMAL (f45d39d Bill Vaughan) + o be_openssl: don't use *_auto() in do_handshake() we can't have fd == -1 there (877280d Azat Khuzhin) + o be_openssl: don't call set_open_callbacks() if fd == -1 (e8a2da9 Azat Khuzhin) + o be_openssl: get rid off hackish "fd_is_set", to fix some corner cases (40b0379 Azat Khuzhin) + o be: we don't need to use getpeername() we we have conn_address (2c271e2 Azat Khuzhin) + o Call underlying bev ctrl SET_FD on filtered bufferevents (c2aa7dc Mark Ellzey) + o be_pair: release shared lock with the latest of bufferevent_pair (92a359e Azat Khuzhin) + + Bugfixes (http) + o [Issue #313] set method to ASCII "NULL" if evhttp_method() returns NULL (17cc636 Mark Ellzey) + o evhttp_have_expect(): fix -Wlogical-not-parentheses (24b5214 Azat Khuzhin) + o http: set fd to -1 unconditioally, to avoid leaking of DNS requests (7a4b472 Azat Khuzhin) + o http: avoid leaking of fd in evhttp_connection_free() (f0e1341 Azat Khuzhin) + o http: get fd from be layer during connection reset (4a53c54 Azat Khuzhin) + o http: fix EVHTTP_CON_READ_ON_WRITE_ERROR when it doesn't supported by OS (2ff164a Azat Khuzhin) + o http: do not do function calls under EVUTIL_ASSERT() to fix NDEBUG builds (7c89999 Azat Khuzhin) + o http: fix leaking of response_code_line (8f18a62 Azat Khuzhin) + o http: fix "Expect: 100-continue" client side (0b46b39 Azat Khuzhin) + o http: fix conflicts EVHTTP_CON_AUTOFREE and EVHTTP_CON_REUSE_CONNECTED_ADDR (4dc0979 Azat Khuzhin) + o http: avoid epoll_ctl() on already closed fd (triggers by http/chunk_out) (ab3bc69 Azat Khuzhin) + o http: install timeout for read too during connect for ssl (040000d Azat Khuzhin) + o http: fix evhttp_request_own() by checking EVHTTP_USER_OWNED in more cases (b0d3964 Azat Khuzhin) + o http: fix detecting EOF without write (7ed02ac Azat Khuzhin) + o evhttp: Fix failure to send all output data for POST/PUT requests (24eea0d John Ohl) + o Fix evhttp_uriencode() regression. (c6b1ec1 Mark Ellzey) + o removed unused vars (e94250c Mark Ellzey) + o pointer overflow checks for evhttp_uriencode (72afe4c Zonr Chang) + + Bugfixes (evbuffers) + o buffer: fix overflow check in evbuffer_expand_singlechain() (a3f4ccd Azat Khuzhin) + o buffer: evbuffer_add_buffer(): clean empty chains from destination buffer (26fd932 Azat Khuzhin) + o Fix n_add_for_cb in evbuffer_prepend() in case of new buffer required (0abd039 Azat Khuzhin) + o be_filter: actually disable output_filter during processing output (c031215 Simon Perreault) + o evbuffer_add: Use last_with_datap if set, not last. (a8769ef Marcus Sundberg) + o EVBUFFER_PTR_SET -> EVBUFFER_PTR_ADD (8674e4f jer-gentoo) + + Bugfixes (evconnlistener) + o listener: unlock lev on error in listener_read_cb() (2a71b33 Azat Khuzhin) + o Fix potential fd leak in listener_read_cb() (a695a72 Mark Ellzey) + + Testing + o tests: use waitpid(..., WNOWAIT) to fix failing of main/fork under solaris (43eb56c Azat Khuzhin) + o test: replace sleeping with syncing pair in main/fork (16d220c Azat Khuzhin) + o test/http: do not run tests that based on backlog filling (freebsd) (500b6b7 Azat Khuzhin) + o test/bufferevent/iocp: fix test name for "bufferevent_connect_fail_eventcb" (4410e9d Azat Khuzhin) + o test/ssl: use send()/recv()/EVUTIL_ERR_RW_RETRIABLE()/EVUTIL_SOCKET_ERROR() to fix win32 (a9e8cd6 Azat Khuzhin) + o test/https_basic: increase timeout for complete write (fixes win32) (d5a2f2f Azat Khuzhin) + o test: fix building with --disable-thread-support under win32 (a487706 Azat Khuzhin) + o test/buffer: evbuffer_add_buffer() with empty chains (a272bc4 Azat Khuzhin) + o test/buffer: evbuffer_remove_buffer() with empty chains (prepend) (f0cfa14 Azat Khuzhin) + o test/buffer: evbuffer_remove_buffer() with empty chains (evbuffer_add_buffer()) (2880ce6 Azat Khuzhin) + o test/buffer: cover evbuffer_expand() for overflow (48dab7a Azat Khuzhin) + o test/be_filter: creating test case for data stuck with active watermarks (766194b Eduardo Panisset) + o test/http: avoid using conditionals with omitted operands (fixes VS2015) (2a4bf29 Azat Khuzhin) + o test/http: don't mix declarations and code (fixes -Wdeclaration-after-statement) (aabf1c2 Azat Khuzhin) + o test/buffer: fix leak in test_evbuffer_prepend() (c08d90b Azat Khuzhin) + o test/buffer: avoid errors with --no-fork (reinitialize static vars) (e7d1e39 Azat Khuzhin) + o test/buffer: cover n_add_for_cb when evbuffer_prepend() need to allocate buffer (e77ff41 Azat Khuzhin) + o test/tinytest_macros: add new one tt_nstr_op() (bd19a28 Azat Khuzhin) + o test/bufferevent: check that output_filter disabled during processing output (ae28812 Azat Khuzhin) + o test/listener: regression for missing unlock in listener_read_cb() (7d85651 Azat Khuzhin) + o test/regress: add tests for evbuffer_add() breakage on empty last chain (d5ee739 Marcus Sundberg) + o test/http: fix running some tests sequential (with --no-fork) (bddad71 Azat Khuzhin) + o test/http: localize evhttp server structure (cbc3209 Azat Khuzhin) + o test/dns: regression for empty hostname (d7348ba Azat Khuzhin) + o test/http: fix SERVER_TIMEOUT tests under win32 (d49a658 Azat Khuzhin) + o test/http: add a helper for creating timedout/failed request (376f107 Azat Khuzhin) + o test/http: adopt for C90 (mixed code and declarations) (d02a285 Azat Khuzhin) + o test/http: cover NS timed out during request cancellations separatelly (0c343af Azat Khuzhin) + o test/http: request cancellation with resolving/{conn,write}-timeouts in progress (334340d Azat Khuzhin) + o test/http: exit from the loop in the errorcb to wait cancellation (927ab33 Azat Khuzhin) + o regress_clean_dnsserver(): reset global port vars (351207f Azat Khuzhin) + o test/http: read_on_write_error: fix it for win32 (3b58169 Azat Khuzhin) + o test/http: separate coverage for EVHTTP_CON_READ_ON_WRITE_ERROR (5c2b4c1 Azat Khuzhin) + o test/http: cover "Expect: 100-continue" client-server interaction (31d8116 Azat Khuzhin) + o test/http: *lingering tests shouldn't have "Expect: 100-continue" (ed469ab Azat Khuzhin) + o test: use EVUTIL_SHUT_WR (04fc82f Azat Khuzhin) + o test/http: avoid huge stack allocations to fix win32 builds (3166765 Azat Khuzhin) + o test: http/lingering_close: cover EVHTTP_SERVER_LINGERING_CLOSE (e122ca1 Azat Khuzhin) + o test: http/non_lingering_close: cover ~EVHTTP_SERVER_LINGERING_CLOSE (f41e1b0 Azat Khuzhin) + o test: http/*: update expected HTTP codes for body exceeds `max_body_size` (addf2b9 Azat Khuzhin) + o test: http/data_length_constrains: set EVHTTP_CON_READ_ON_WRITE_ERROR (d38a723 Azat Khuzhin) + o test: increase buffer size for http/data_length_constraints to trigger EPIPE (0792e1e Azat Khuzhin) + o test/tinytest_demo: include for win32 to fix tdm-gcc (f062bbe Azat Khuzhin) + o test/regress: cover event_del() waiting mechanism (5b58b70 Azat Khuzhin) + o test/regress: cover existing signal callbacks and fork() + event_reinit() (ceddc60 Azat Khuzhin) + o test/regress: cover signals after fork() + event_reinit() (b075b81 Azat Khuzhin) + o test/regress: main/fork: rewrite assertions by just removing event in callback (088d8b3 Azat Khuzhin) + o test/dns: check exit code of evdns_getaddrinfo() (0b9d432 Azat Khuzhin) + o test/dns: cover evdns_getaddrinfo() and evdns_base_free() with @fail_requests (4ad3483 Azat Khuzhin) + o test/dns: cover @fail_requests for evdns_base_free() (d6c6fb4 Azat Khuzhin) + o test/dns: more graceful coverage of @fail_requests (123d372 Azat Khuzhin) + o test/ssl: cover busy-loop (i.e. {read,write}-blocked-on-{write,read} stuff) (da0ea7a Azat Khuzhin) + o test/http: write_during_read for https (23c77b6 Azat Khuzhin) + o test/http: connection_fail for https (7ea26f7 Azat Khuzhin) + o test/http: stream_out for https (ac04968 Azat Khuzhin) + o test/http: chunk_out for https (a71ffb9 Azat Khuzhin) + o test/regress: fix ssl-less builds (need to make this prettier) (3160716 Azat Khuzhin) + o test/http: allow dirty shutdown for ssl to fix https_incomplete (1ede326 Azat Khuzhin) + o test/http: https basic (59714b4 Azat Khuzhin) + o test/http: incomplete{,_timeout} for https (615490d Azat Khuzhin) + o test/http: add simplest test for http/https/https_dirty_shutdown (93b19dc Azat Khuzhin) + o test/http: https: retry coverage (7c2d24a Azat Khuzhin) + o test/http: https server support (plus some helpers) (a7088ad Azat Khuzhin) + o test/http: more sanity checks (a27c53c Azat Khuzhin) + o test/ssl: export getkey()/getcert()/get_ssl_ctx()/init_ssl() for https (0c4c387 Azat Khuzhin) + o test/regress_be: basic coverage bufferevent_flush() for pair/sock layers (ad52602 Azat Khuzhin) + o test/regress_be: socket_filter_inactive: check bufferevent after creation (f8081af Azat Khuzhin) + o test/regress_be: cover finalizers from inactive to active queue (337684b Azat Khuzhin) + o test/regress_buffer: fix clang compilation warnings (d8fd4c0 Azat Khuzhin) + o test/regress_http: fix compilation warnings (-Wmissing-field-initializers) (cd422e0 Azat Khuzhin) + o test/regress_dns: fix compilation warnings (-Wmissing-field-initializers/for) (f55db98 Azat Khuzhin) + o tests/regress_dns: cover that randomize-case works case-insensitive (1e8bfbc Azat Khuzhin) + o test: fix bufferevent/bufferevent_pair_release_lock in debug mode (3f749e9 Azat Khuzhin) + o test: fix bufferevent/bufferevent_pair_release_lock for freebsd (79f9ace Azat Khuzhin) + o test/regress_be: bufferevent_enable() shouldn't call eventcb by it's own (a0f308d Azat Khuzhin) + o test/regress_be: introduce fake_listener_create() (37dc9e0 Azat Khuzhin) + o test/regress_http: cover evhttp_request_own() (6f6fa0d Azat Khuzhin) + o test/regress_http: cover write during read (3d15aeb Azat Khuzhin) + o test/regress_http: verify that closecb will be called without multiple write (4be6c70 Azat Khuzhin) + o test/regress: fix bufferevent_pair_release_lock with EVENT_DEBUG_MODE (6ea6655 Azat Khuzhin) + o test/regress_ssl: check events fd/pending after timeout triggered (cdafdf0 Azat Khuzhin) + o test/regress_ssl: cover case when server didn't up (failed with timeout) (74845f1 Azat Khuzhin) + o test/regress_ssl: covert that we can't change fd with underlying (df507af Azat Khuzhin) + o test/regress_ssl: cover that events (read/write) at finish not pending (762edb4 Azat Khuzhin) + o test/regress_ssl: cover fd manipulations (b78a829 Azat Khuzhin) + o test/regress_ssl: convert open_ssl_bufevs() to mask (46bba73 Azat Khuzhin) + o test/regress_ssl: convert client/server to mask too (3455991 Azat Khuzhin) + o test/regress_ssl: cover "allow_dirty_shutdown" (0430327 Azat Khuzhin) + o test/regress_ssl: convert regress_bufferevent_openssl() to bitmask (342e116 Azat Khuzhin) + o tests/regress_ssl: drop duplicated assert (25e56fd Azat Khuzhin) + o test/regress_http: initialize "dns_base" to avoid reading trash (9f0bff3 Azat Khuzhin) + o test/http: cover retrying with saved conn_address by shutting down dns server (f4874d8 Azat Khuzhin) + o be_pair/regress: cover use of shared lock (lock/unlock/free) (a558fcd Azat Khuzhin) + o regress_dns: drop hack for event_debug_map_HT_GROW in leak tests (3540a19 Azat Khuzhin) + + Sample code + o Fix memory leak in signal-test.c (666db91 basavesh.as) + o sample/hello-world: exAmple, not eXMple (2d3cd35 kirillDanshin) + o dns-example: allow to set ns from args (df19a97 Azat Khuzhin) + o dns-example: convert to getopt() (32f8592 Azat Khuzhin) + o http-connect: make it win32 compilable (1bf7595 Azat Khuzhin) + o sample/https-client: allow to change path to ca-certificates (fdf713a Azat Khuzhin) + o sample/https-client: check for ERR_remove_thread_state() existence (c4e9d9b Azat Khuzhin) + o sample/https-client: replace ERR_remove_state() by ERR_remove_thread_state() (77ad68a Azat Khuzhin) + o sample/https-client: add -timeout option (4637aa8 Azat Khuzhin) + o sample/https-client: don't try to free uninitialized SSL (f3d7ff5 Azat Khuzhin) + o sample/https-client: graceful exit with freeing memory (to make valgrind happy) (24a1f25 Azat Khuzhin) + o https-client: correctly handle URLs with no path (like "https://host:port") (29a0482 Andrey Skriabin) + o sample/http-connect: don't use assert() to make it work with NDEBUG (6dc71e7 Azat Khuzhin) + o sample/http-connect: made it compatible with C90 (f976d43 Azat Khuzhin) + o sample: add HTTP CONNECT tunnelling example using libevent http layer (1d34498 Azat Khuzhin) + o Update dns-example. (620ff24 Mark Ellzey) + + Documentation + o Update README.md (b8ec70c Mark Ellzey) + o Update README.md (80faee9 Mark Ellzey) + o Update README.md (ad4a897 Mark Ellzey) + o Update README.md (a2b2e1e Mark Ellzey) + o Update README.md (0dfa5dc Mark Ellzey) + + Code Improvements (evthread) + o evthread: add evthread_get_{lock,condition}_callbacks() helpers (c0b34f6 Azat Khuzhin) + + Code Improvements (core) + o util: make @sa const for evutil_socket_connect_() (a8d32c2 Azat Khuzhin) + + Code Improvements (http) + o http: assert's that evbuffer_drain() success on connection reset (2185e63 Azat Khuzhin) + o http: introduce evhttp_request_free_() helper (22061ac Azat Khuzhin) + o http: introduce evhttp_is_request_connection_close() helper (6540da3 Azat Khuzhin) + + Code Improvements (bufferevents) + o be_sock: bufferevent_socket_set_conn_address(): assert instead of silent no-op (0ab88c2 Azat Khuzhin) + o be_sock: sanity check in bufferevent_socket_set_conn_address() (eedbeff Azat Khuzhin) + o be: replace sockaddr_storage with sockaddr_in6 for conn_address (3889612 Azat Khuzhin) + o be: replace conn_address by full struct instead of pointer (e5615aa Azat Khuzhin) + o bufferevent: move conn_address out from http into bufferevent (8bb3842 Azat Khuzhin) + o be: make @sa const for bufferevent_socket_connect() (dc33c78 Azat Khuzhin) + + Cleanups (core) + o Refactoring conditional directives that break parts of statements. (4b41eeb lzmths) + o epoll: introduce PRINT_CHANGES() macro to avoid copy-pasting (a1b142b Azat Khuzhin) + o tab (6e7a580 Greg Hazel) + + Cleanups (evbuffers) + o buffer_compat: fix comment -- we have EVBUFFER_EOL_ANY not EOL_STYLE_ANY (575ff67 Azat Khuzhin) + + Cleanups (bufferevents) + o be_sock: evutil_getaddrinfo_async_() always return 0 (dbff101 Azat Khuzhin) + o be_sock: drop be_sock_add() macro (useless and debug unfriendly) (fad5fe2 Azat Khuzhin) + o be: introduce bufferevent_generic_adj_existing_timeouts_() (3c1f58f Azat Khuzhin) + o be: add_event: use evutil_timerisset() (a96b73b Azat Khuzhin) + o be_openssl: introduce be_openssl_auto_fd() helper (2a8a711 Azat Khuzhin) + o be_openssl: introduce set_open_callbacks_auto() (510da71 Azat Khuzhin) + + Cleanups (http) + o http: make fallback for EVHTTP_CON_READ_ON_WRITE_ERROR more cleaner (d405492 Azat Khuzhin) + o http: coding style issue (365f181 Azat Khuzhin) + + Cleanups (evdns) + o evnds: inline TEST_NAME macro to make debuggin easier (0c615f4 Azat Khuzhin) + + Portability Fixes + o [#372] check for errno.h (3031617 Mark Ellzey) + o Fixed Unicode issue in error messages. (e8b7895 Mattes D) + o Assume that ke_udata is an integer type on CloudABI. (5602e45 Ed Schouten) + o Add missing include of . (b2c68bc Ed Schouten) + o Include , and optionally. (c1404b5 Ed Schouten) + o Test against SO_REUSEADDR (along with _WIN32). (ce1776c Ed Schouten) + o Always define missing TAILQ functions from sys/queue.h (2828bdb Christopher Wiley) + o Don't use BSD u_* types. (fd36647 Ed Schouten) + o Remove BSD-ism: TIMEVAL_TO_TIMESPEC(). (193c7de Ed Schouten) + o be: include all variations of headers for sockaddr_in6 struct (c212291 Azat Khuzhin) + o be: fix sockaddr_in6 type definition for win32 (c42bc6b Azat Khuzhin) + + Continuous Integration: + o travis: split long lines, and make it cleaner (685a6a1 Azat Khuzhin) + o travis: fix autotools on osx by reinstalling libtool (088ea5e Azat Khuzhin) + o appveyor/autotools: link with openssl by passing LDFLAGS/CFLAGS (6fcfa25 Azat Khuzhin) + o appveyor: image already had openssl installed (4634b85 Azat Khuzhin) + o appveyor: check -DUNICODE -D_UNICODE according to ReleaseChecklist (cmake only) (e9acc44 Azat Khuzhin) + o appveyor: ignore failure of mingw-get (1810857 Azat Khuzhin) + o appveyor: drop shallow_clone, since we use tags for detecting version in cmake (ac90133 Azat Khuzhin) + o appveyor: support cmake & autotools using build matrix (like travis-ci has) (8f95015 Azat Khuzhin) + o travis-ci/osx: relink gcc/g++ instead of clang (481481d Azat Khuzhin) + o travis-ci: enable multi-os mode (osx, linux) (79917e4 Azat Khuzhin) + o travis-ci: increase matrix (--disable-foo) (59649f7 Azat Khuzhin) + o travis-ci: adjust alignment (c8be339 Azat Khuzhin) + o travis: add builds without debug mode into matrix (3e56da2 Azat Khuzhin) + o test: run regress with EVENT_DEBUG_MODE=1 and without (cf2cf2a Azat Khuzhin) + o Update travis config for status updates (37453ab Mark Ellzey) + o Use autotools for appveyor until cmake is fixed. (1cc2e29 Mark Ellzey) + o Fix the link for appveyor OpenSSL installer (WIN32) (107d565 Mark Ellzey) + o Forgot to install OpenSSL for appveyor (26164a5 Joakim Söderberg) + o Add support for appveyor.com windows CI (5f89c37 Joakim Söderberg) + + Build Improvements/Fixes: + o evutil: mark ai_find_protocol() static (prototype-less) (5a157c8 Azat Khuzhin) + o cmake/solaris: set CMAKE_REQUIRED_LIBRARIES to fix functions detections (dc95823 Azat Khuzhin) + o cmake/solaris: fix building (link with socket,nsl) (050bfc7 Azat Khuzhin) + o cmake: check for ZLIB_INCLUDE_DIR, since we can have only library without headers (c4dfb93 Azat Khuzhin) + o autotools/win32: fix searching ssl library (671a24f Azat Khuzhin) + o cmake/win32: do not compile regress_thread on -DEVENT__DISABLE_THREAD_SUPPORT=ON (de0c196 Azat Khuzhin) + o cmake/win32: do not compile evthread_win32 on -DEVENT__DISABLE_THREAD_SUPPORT=ON (ecb0ec8 Azat Khuzhin) + o cmake: fix -DEVENT__ENABLE_VERBOSE_DEBUG (typo on -DUSE_DEBUG) (e35f224 Azat Khuzhin) + o cmake: do not use stderr for notifications/version-info (38716c6 Azat Khuzhin) + o autoconf: fix --disable-thread-support build under win32 (bb09535 Azat Khuzhin) + o buffer: don't mix code and declarations (8892f4c Azat Khuzhin) + o Update gitignore file to ignore cscope gen'ed files (0aaa4fb Neeraj Badlani) + o For non GCC/clang on OSX the -Wno-deprecated-declarations may not be valid (b5ca365 Rainer Keller) + o automake: define serial-tests only if automake have this option (61179de Azat Khuzhin) + o test/automake: don't use paralell test harness (since automake 1.12) (44d755e Azat Khuzhin) + o Ignore all pkgconfig generated stuff (ce38993 Azat Khuzhin) + o libevent_core and libevent_extra also deserve a pkgconfig file (b8d7c62 Jan Heylen) + o Ignore verify_tests.bat (win32 version) (0f2de10 Azat Khuzhin) + o cmake: require 3.1 only for win32 to make it work under ubunty precise (87f7238 Azat Khuzhin) + o cmake: require at least 3.1 for target_sources() (c46ead5 Azat Khuzhin) + o cmake: fix adding of compiler flags, and now it will (36588e1 Azat Khuzhin) + o Replace -Wswitch-enum with -Wswitch, and add it into cmake rules too (f29f59e Azat Khuzhin) + o test/regress_ssl: Fix compile problems for win32 (73d0360 Trond Norbye) + o util: fix "%zu" format on TDM-gcc/MinGW-w64 (79b69d8 Azat Khuzhin) + o cmake: don't define EVENT__NEED_DLLIMPORT always (fixes VS2013 static build) (49bd790 Azat Khuzhin) + o Add missing return statement to del_wait_thread so libevent can build. (4f778ab Nick Mathewson) + o cmake: fix building dns-example under win32 (missing getopt) (a1609a8 Azat Khuzhin) + o visibility: align it to make it more readable (bb6b53d Azat Khuzhin) + o cmake: Fix detection of ssize_t/SSIZE_T (7707f6b Azat Khuzhin) + o Ignore more configure stuff (configure.lineno) (8d34302 Azat Khuzhin) + o Fixed issue with cmake version generation (d56efd9 Mark Ellzey) + o Cmake is now officially working. (7f9646d Mark Ellzey) + o More cmake updates, lot's of missing definitions (49a5381 Mark Ellzey) + o CMake syntax fixes fo .in files (6aad23d Mark Ellzey) + o Revert "The Windows socket type is defined as SOCKET." (a264da8 Mark Ellzey) + o CMAKE CMAKE CMAKE CLEANUPS (a9db46a Mark Ellzey) + o Lot's of cmake updates (8b228e2 Mark Ellzey) + o Provide a mechanism for building the library on Windows with different compiler flags. Add a batch file that builds it for the M[DT][d] options and performs a hunt and gather of the different output libraries. (ded8086 billsegall) + o The Windows socket type is defined as SOCKET. (c9e6c3d billsegall) + o autotools: fix getservbyname() detection (959a4c2 Azat Khuzhin) + o Add missing for openssl_hostname_validation module (3316a21 Azat Khuzhin) + o make test/regress_ssl.c compile without warnings (9f02a44 Thomas Bernard) + o test/regress_be: drop debug __asm__(int3) to fix arm build (8240379 Azat Khuzhin) + o event_debug_created_threadable_ctx_: fix compilation without debug mode (a068f2e Azat Khuzhin) + o Add a prototype for event_disable_debug_mode() (bfcedee Sebastian Hahn) + o http: eliminate warning about "socklen" in evhttp_connection_connect_() (dfad1a4 Azat Khuzhin) + o Updated gitignore (1dbb55d Mark Ellzey) + o Update bench_httpclient.c (cb96931 Seungmo Koo) + o *fix: bench_httpclient to support win32 (4e9325e zeliard) + o Commented out a WIN32 threading / timing test for now (e84e269 Mark Ellzey) + o Fix mixed declarations and code (forbidden by ISO C90) (0c7f217 Thomas Bernard) + o Fix "function declaration isn’t a prototype" (746d2c5 Thomas Bernard) + o This fixes a bug introduced in 27bd9faf498b91923296cc91643e03ec4055c230 (19ba454 Joakim Söderberg) + o changed strtotimeval signature as per #211 (bdbc823 Xiao Bao Clark) + o Added cmake-generated files to ignore list. (6c12bfe Matyas Dolak) + o Ignore `make dist` generated files (8a2c6c7 Azat Khuzhin) + + Debugging + o Debug mode option to error on evthread init AFTER other event calls. (dcfb19a Mark Ellzey) + + + +Changes in version 2.1.5-beta (5 January 2015) + + Security Fixes (evbuffers) + o Avoid integer overflow bugs in evbuffer_add() and related functions. See CVE-2014-6272 advisory for more information. (d49bc0e88b81a5812116074dc007f1db0ca1eecd) + + New APIs (evconnlistener) + o Provide support for SO_REUSEPORT through LEV_OPT_REUSABLE_PORT (b625361 Maciej Soltysiak) + + Bugfixes (core) + o Fix use-after-free error in EV_CLOSURE_EVENT callback (3cc0eac John Ohl) + o Fix race caused by event_active (3c7d6fc vjpai) + + Bugfixes (evbuffer) + o Fix evbuffer_peek() with len==-1 and start_at non-NULL. (ba59923) + o Consistently check for failure from evbuffer_pullup() (60f8f72) + o Fix evbuffer_peek() with len==-1 and start_at non-NULL. (fb7e76a) + + Bugfixes (windows, IOCP) + o be async: avoid double close() (f133b86 Azat Khuzhin) + + Bugfixes (bufferevents) + o Fix issue #127, double free for filterevents that use BEV_OPT_CLOSE_ON_FREE (2c82aa0 John Ohl) + o make bufferevent_getwatermark api more robust (a21e510 ufo2243) + o [Bugfix] fix bufferevent setwatermark suspend_read (b34e4ac ufo2243) + o bufferevent_openssl: reset fd_is_set when setfd with -1 is called (3da84c2 Azat Khuzhin) + o Fix compilation for older OpenSSL versions. (5c7282f Joakim Soderberg) + + New APIs (evhttp) + o Add evhttp_connection_set_family() to set addrinfo->family for DNS requests (12c29b0 Azat Khuzhin) + o Implement interface that provides the ability to have an outbound evhttp_connection free itself once all requests have completed (2b9ec4c,10fe4f John Ohl) + + New APIs (core) + o Implement new/free for struct evutil_monotonic_timer and export monotonic time functions (f2645f8 Andrea Shepard) + + Bugfixes (evdns) + o Load hosts file on Windows. (a0b247c Vilmos Nebehaj) + o Don't truncate hosts file path on Windows. (d0dc861 Vilmos Nebehaj) + o Fix a crash in evdns related to shutting down evdns (9f39c88,e8fe749) + o evdns: avoid read-after-free in evdns_request_timeout_callback() (61262a0 Azat Khuzhin) + o Correctly handle allocation failures in evdns_getaddrinfo (6a53d15) + o evdns: fix EVDNS_BASE_DISABLE_WHEN_INACTIVE in case retransmit/retry (74d0eee Azat Khuzhin) + o evdns: add retry/reissue tests for EVDNS_BASE_DISABLE_WHEN_INACTIVE (3ca9d43 Azat Khuzhin) + o evdns: fail ns after we are failing/retrasmitting request (97c750d Azat Khuzhin) + + Bugfixes (evhttp) + o http: reset connection before installing retry timer (fix http retries handling) (bc79cc5 Azat Khuzhin) + + + Testing + o regress_dns: fix leaks in getaddrinfo_async{,_cancel_stress} tests (2fdc5f2 Azat Khuzhin) + o test: add family argument for http_connection_test_() (177b8a7 Azat Khuzhin) + o test: add regress for evhttp_connection_set_family() with AF_INET and AF_UNSPEC (42aefeb Azat Khuzhin) + o test/http: add regress test for set family to AF_INET6 (3fbf3cc Azat Khuzhin) + o Update to a more recent tinytest_macros. (8da5a18) + o test/regress: add simplestsignal: to track reorder bugs separately (b897bef Azat Khuzhin) + o test/evbuffer_peek: add regress in case we have first buffer greater (e2d139d Azat Khuzhin) + o More evbuffer_peek() test cases (154006a) + o use correct tt macro for pointer compare (08c88ea) + o regress_buffer: fix 'memcmp' compare size (79800df Maks Naumov) + o Fix a use-after-free in unit tests. CID 752027 (3739057) + o Fix a dead-code warning in unit tests. CID 1193548 (c119f24) + o Use evutil_weakrand() in unit tests. (a677b72, 364c110) + o Use a more precise calculation for max in time-ratelim.c (ca5b5c7) + o Make a buffer larger in the tests to avoid a scary evbuffer_copyout_from() (fb57b8b) + o Fix several memory leaks in the unit tests. (89c1a3b) + o Add test for evhttp_connection_free_on_completion (b0e9924 John Ohl) + o Fix annoying heisenbug in test-time.c (cb73704) + + Sample code + o Make http-server.c output into good html5 (6d72bdc) + o Use FindClose for handle from FindFirstFile in http-server.c (6466e88) + o https-client: add -retries argument, for connection retries (d9da844 Azat Khuzhin) + + Bugfixes (build) + o Add missing headerfile for cmake (15d90cc Trond Norbye) + o ignore one more test binary (b6593aa Michael Richardson) + o ignore config.cache/test-driver files (c83f333 Mike Frysinger) + o add a --disable-samples configure flag (0c492b3 Mike Frysinger) + o Add a few files created by "make verify" to .gitignore. (1a8295a Pierre Phaneuf) + o updates in cmake build (27bd9fa Sergey Nikulov) + o Fix cmake error when the Module path has more than one entry. (befbd13 Acer Yang) + o Fix CMake shared library build (e69d910 Nobuaki Sukegawa) + o Fix warnings when compiling with clang 3.5 (f5b4765 John Ohl) + o Fix mixed declarations and code (forbidden by ISO C90) (8afbdbc Thomas Bernard) + + Bugfixes (miscellaneous) + o tree.h: drop duplicated content of tree.h (6193187 Azat Khuzhin) + o evdns: disable probing with EVDNS_BASE_DISABLE_WHEN_INACTIVE (610410b,ad0493e,fea86a6,d83b337,5ca9e97 Azat Khuzhin) + o [Bugfix] fix grammer error (3a4d249 ufo2243) + o Change return type of evutil_load_windows_system_library_ to HMODULE (f691389) + o Fix a c90 warning (76643dd) + o Fix a typo in a doxygen comment. Reported by 亦得. (be1aeff) + o remove trailing comma from enum (b361b8a Jean-Philippe Ouellet) + + Bugfixes (FreeBSD) + o Handle ENOTCAPABLE from FreeBSD - this is returned if an event in the changelist is for an FD that has been closed. (6fd7394 Adrian Chadd) + + + +Changes in version 2.1.4-alpha (21 Mar 2014) + + Libevent 2.1.4-alpha adds a number of new miscellaneous APIs to make + Libevent more useful, including support for early close detection with + epoll via EPOLLRDHUP, triggering bufferevent callbacks, adding more + evhttp callbacks, and more. There are also numerous bugfixes, including + a number for finalize-related issues from 2.1.3-alpha; and an + alternative (non-primary!) cmake-based build mechanism. + + New APIs (core) + o Added event_base_get_num_events() (0fa107d Mobai Zhang) + o New event_base_active_by_fd API (865a142 Greg Hazel, 5c9da9a, 87fa2b0) + o Add event_base_active_by_signal by analogy (4865943) + o Add access to max event count stats (5173bef, efbd3dc, 26230a2 + Andrew Sweeney) + o Implemented EV_CLOSED event for epoll backend + (EPOLLRDHUP). (b1b69ac Diego Giagio, 53d2793, 43ffcf6, dfe1e52 + Marcin Juszkiewicz, ff26633 Joakim Soderberg, 3908a5e) + + New APIs (evutil_secure_rng) + o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7) + + New APIs (bufferevents) + o Add function to fetch underlying ratelimit cfg (4b3d5af Mark Ellzey) + o Pass and return const for bufferevent_get_token_bucket_cfg (1c77fbb + Mark Ellzey) + o Add watermark introspection (4ce242b Ondřej Kuzník) + o Add an option to trigger bufferevent I/O callbacks (61ee18b Ondřej Kuzník) + o Add an option to trigger bufferevent event callbacks (a7384c7 + Ondřej Kuzník) + o Clarifications in response to merge req. comments (bd41947 Ondřej + Kuzník) + o Minor optimizations on bufferevent_trigger options (a3172a4) + + New APIs (evhttp) + o Add evhttp_connection_get_server(). (a7f82a3 Maxime Henrion) + o add a http default content type option (5a5acd9 Nicolas Martyanoff) + o http: implement new evhttp_connection_get_addr() api. (0c7f040 Azat + Khuzhin) + o Add a variant of evhttp_send_reply_chunk() with a callback on + evhttp_write_buffer() (8d8decf Julien BLACHE) + o Allow registering callback for parsing HTTP headers (b0bd7fe Balint Reczey) + o Provide on request complete callback facility (b083ca0 Andrew Sweeney) + o evhttp_request_set_on_complete_cb to be more specific about what + the function actually does and usage (da86dda Andrew Sweeney) + o Update unit test to make sure that the callback happens after the + output data is written (b85f398 Andrew Sweeney) + + Features (evdns) + o bug fix for issues #293 evdns_base_load_hosts doesn't remove + outdated addresses (954d2f9, f03d353, 45eba6f Kuldeep Gupta) + + Features: (cmake build support) + o Initial CMake commit. (e415196 Joakim Soderberg) + o Add all tests and benchmarks to CMake project. (e9fc014 Joakim Soderberg) + o More work on adding tests to CMake project (99c1dc3 Joakim Soderberg) + o Generate a dummy evconfig-private.h so things build + properly. (ce14def Joakim Soderberg) + o Link libm on unix platforms. (58fcd42 Joakim Soderberg) + o Added some GCC specific options. (19222e5 Joakim Soderberg) + o Use evutil_closesocket instead. (dbf2b51 Joakim Soderberg) + o Add copyright and licensing files for CMake modules. (c259d53 + Joakim Soderberg) + o Only include WIN32 getopt where it is used. (9bbce0b Joakim Soderberg) + o Fix bench_cascade program on Windows. (78da644 Joakim Soderberg) + o Don't segfault on no found event backend. (8f2af50 Joakim Soderberg) + o Only test the event backends available on the system. (7ea4159 + Joakim Soderberg) + o Added a "make verify" target. (e053c4f Joakim Soderberg) + o Fix the make "verify" target on Windows. (67e5d74 Joakim Soderberg) + o Get rid of deprecation warnings for OpenSSL on OSX 10.7+ (69c3516 + Joakim Söderberg) + o Fix kqueue support. (a831f2f Joakim Söderberg) + o Added a test for testing if kqueue works with pipes. (2799b35 + Joakim Söderberg) + o Change the BSD license from 4 to 3-clause. (86df3ed Joakim Soderberg) + o Minimum required python version is 2.4. (968e97b Joakim Soderberg) + o Get rid of unknown pragma warnings. (0ef1d04 Joakim Soderberg) + o Add a "make verify_coverage" target generation coverage + info. (f2483f8 Joakim Soderberg) + o Fix the "make verify" target on NetBSD (4ac086a Joakim Soderberg) + o Only look for ZLib when it is used (if tests are + included). (f780593 Joakim Soderberg) + o Added EVENT__ENABLE_GCC_WARNINGS, turns all warnings into + errors. (dd413bd Joakim Soderberg) + o Add CMake config and install targets. (f3446ed Joakim Soderberg) + o Fix typo (4b754df Joakim Soderberg) + o Some work on making it possible to simply do add_subdirectory() on + the project. (49ab363 Joakim Soderberg) + o Set USE_DEBUG=1 on EVENT__ENABLE_VERBOSE_DEBUG (fd42e70 Joakim Soderberg) + o Fix so that old nmake project still builds. (24d6466 Joakim + Soderberg) + o Rename README to README.md and use markdown to format. (d2bc39a + Joakim Soderberg) + o Update README with CMake build instructions. (604b8cc Joakim Soderberg) + o Clean up the README some. (8d4cb35 JoakimSoderberg) + o Forgotten headers for old nmake project compatibility. (8697b99 + Joakim Soderberg) + o Change all uses of WIN32 to _WIN32 (4e14395 Joakim Söderberg) + o Fix include bug. (2024467 Joakim Söderberg) + o Check if we're on OSX before disabling deprecation in le-proxy + (8b40a5b Joakim Söderberg) + o Fix broken autotools build. (ae1bd82 Joakim Söderberg) + o Disclaimerize cmake a little in the README (d03b5bf) + o Fix CMake compile when OpenSSL is disabled. (e423d42 Joakim + Söderberg) + o CMake: Get rid of python not found warning when regress tests + turned off. (d38d798 Joakim Söderberg) + o Fix https-client compilation on Windows. (d7be788 Joakim Soderberg) + o Guard against EVENT_NOWIN32 being set during testing. (f1715b4 + Joakim Soderberg) + o Check for OSX when checking for clang. (e212c54 Joakim Soderberg) + o Added a Travis-CI configuration file. (8c0f0a9 Joakim Soderberg) + o Added -Qunused-arguments for clang on macosx (ed99d92 Trond Norbye) + o Rename event_extras to event_extra (a0dd5df Trond Norbye) + o Add option to build shared library (4545fa9 Trond Norbye) + o Add -Qunused-arguments for clang on macos (b56611d Trond Norbye) + o Add cmake-related files to .gitignore (e061321 Trond Norbye) + o Export event_extra not event_extras. (2b41bcf Joakim Söderberg) + + Bugfixes (core) + o If evsel->del() fails, don't leave the evmap in an inconsistent + state (9b5a527 Maxime Henrion) + o Move event_debug_note_teardown_ before mm_free. (69b5c64) + o Check CLOCK_MONOTONIC_* at runtime if needed. (911abf3) + o Fix reinit of fds with EV_WRITE but not EV_READ. (ebfd8a8 maksqwe) + o Tweaked callbacks to prevent race condition + (https://github.com/libevent/libevent/issues/104) (40830f1, 2ea15ed + John Ohl) + o Move assert(ev) to before we use ev in EV_CLOSURE_EVENT_FINALIZE + case (9805972) + + Bugfixes (evhttp) + o Fix a double close() bug in evhttp when the underlying bufferevent uses + BEV_OPT_CLOSE_ON_FREE. (31db8a0 Maxime Henrion) + o Fix an unlikely but possible error case for http connections (f22049e) + o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum) + + Bugfixes on 2.0 (Windows) + o Use windows vsnprintf fixup logic on all windows environments (e826f19) + o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) + (b8f5980 Frank Denis) + + Bugfixes (evutil_secure_rng) + o When we seed from /proc/sys/kernel/random/uuid, count it as success + (e35b540) + o We should return after arc4random_buf() (1ea1f26 Makoto Kato) + o Avoid other RNG initialization FS reads when urandom file is + specified (9695e9c) + o Really remove RNG seeds from the stack (f5ced88) + o Fix another arc4random_buf-related warning (e64a2b0) + + Bugfixes (bufferevents) + o Initialize async bufferevent timeout CBs unconditionally (af9b2a7) + + Bugfixes (evdns) + o Checking request nameserver for NULL, before using it. (5c710c0 + Belobrov Andrey) + o Fix SEGFAULT after evdns_base_resume if no nameservers + installed. (14971a8 Azat Khuzhin) + o Actually use the log facility for reporting evdns problems. (e1766a1) + o Fix SEGFAULT after evdns_base_resume if no nameservers + installed. (f8d7df8 Azat Khuzhin) + o fix for ServFail from RIPE Atlas release (62f596b Antony Antony) + + Bugfixes (compilation) + o Fix test compilation with nmake: add the gdi.lib dependency (5ba8ab7) + o Whoops. It is gdi.lib, not gdi32.lib. (github issue #61) (8ab612e) + o Don't use return since return type is void and build error occurs + using clang (838161d Makoto Kato) + o Use void casts to suppress some "unchecked return value" warns (7080d55) + o rpcgen: Generate regress.gen.[c,h] in build rather than src dir + (243386c Ross Lagerwall) + o Fix a compiler warning when checking for arc4random_buf linker + breakage. (5cb3865) + o Fix 'make distcheck' by adding regress.gen.[ch] to DISTCLEANFILES + (239d834) + + o Fix a c90 warning (c207682) + o Fix consts in WIN32-Code/getopt*.[ch] (57abb35) + + Bugfixes (locks, synchronization) + o Missed lock acquire/release in event_base_cancel_single_callback_() + (d3d999a Azat Khuzhin) + o Fix locking in bufferevent_get_options_(). (dbc9cd4 Maxime Henrion) + + Bugfixes (leaks) + o Avoid leaking segment mappings when offset is not a page multiple (d409514) + + Testing + o Add tests for evdns_base_resume(). (1cd9ff5 Azat Khuzhin) + o Fix dns/leak_resume_send_err test. (7e876df Azat Khuzhin) + o Add checks for evhttp_connection_get_server() in unit + tests. (fbc323b Maxime Henrion) + o Fix a (failure-only) null dereference in the unit tests (1104d0b) + o Fix a logic error in test_evbuffer_freeze (7765884) + o Add missing check to test_evbuffer_file_segment_add_cleanup_cb (eba4506) + o Fix some crash-on-fail cases in DNS regression tests (87cd6f0) + o DNS tests: add a missing check (f314900) + o Finalize tests: add a missing check (82b6956) + o test_evutil_rtrim: add another missing check. (e193c95) + o regress_main: logging all if env EVENT_DEBUG_LOGGING_ALL isset + (611e28b Azat Khuzhin) + o regress_http: add tests for evhttp_connection_get_addr() (4dd500c + Azat Khuzhin) + o Update to the latest version of tinytest (7a80476) + o Heap-allocate zlib data structure in regress_zlib tests (4947c18) + + Performance tweaks (core) + o Avoid redundant syscall to make a nonblocking socket nonblocking + (42c03da Maxime Henrion) + o Avoid redundant syscall if making a socket cloexec twice (1f29b18) + o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62) + + Documentation + o Document that arc4random is not a great cryptographic PRNG. (6e49696) + o Small doxygen tweaks (6e67b51) + o Try another doxygen tweak (ccf432b) + o Clarify event_base_loop exit conditions (031a803) + o Fix a typo (be7bf2c Ondřej Kuzník) + o Document deferred eventcb behaviour (13a9a02 Ondřej Kuzník) + o Typo fixes from Linus Nordberg (cec62cb, 8cd695b) + o Fix duplicate paragraph in evbuffer_ptr documentation (58408ee) + + Code Improvements (coverity) + o Fix a pile of coverity warnings in the unit tests (867f401) + o Fix coverity warnings in benchmark tools. (ff7f739) + o Whoops; fix compilation in bench.c (544cf88) + o Remove spurious checks in evrpc.c error cases (coverity) (991b362) + o Fix a couple of compilation warnings in regress_http.c (860767e) + o Fix even more coverity warnings. (d240328) + o Stop checking for inet_aton; we don't use it. (f665d5c) + o Add an include to evrpc-internal to fix openbsd compilation warning + (5e161c6) + + Cleanups + o Remove an unreachable return statement in minheap-internal.h (e639a9e) + o Refactor evmap_{io,signal}_active_() to tolerate bad inputs (974c60e) + o Fix needless bufferevent includes in evdns.c (254c04e) + o Fix a couple of "#ifdef WIN32" instances (88ecda3) + o Remove unneeded declaration in bufferevent-internal.h (4c8ebcd) + + Sample code + o le-proxy: Fail more gracefully if opening listener fails (44b2491) + o http-server: drop uri_root from base_url in http-server. (6171e1c Azat Khuzhin) + o https-client: POST supported, args supported (c5887f7 Alexey Ozeritsky) + o https-client: code cleanup (29af65e Alexey Ozeritsky) + o https-client: Small tweaks to https-client.c (90786eb) + o https-client: Set hostname for SNI extension (by f69m) (d1976f8) + o https-client: add a cast to https-client.c (462e6b6) + + + +Changes in version 2.1.3-alpha (1 May 2013) + + Libevent 2.1.3-alpha fixes various bugs, adds new unit tests, and cleans + up the code in a couple of places. It has a new callback in evhttp for + reporting errors during a request, a new feature for allowing evdns to + not keep the event_base looping when there are no requests inflight, and + example code for writing an https client. + + Libevent 2.1.3-alpha also has an important new (experimental) event + finalization feature to allow safe event teardown in multithreaded + programs. This ought to fix the longstanding bug with deadlocks in + multithreaded use of SSL-based bufferevents that some people have been + experiencing since Libevent 2.0. + + + Core (event finalization) + o Implement event_finalize() and related functions to avoid certain + deadlocks (8eedeab) + o Use finalization feature so bufferevents can avoid deadlocks (02fbf68) + o Always run pending finalizers when event_base_free() is called (e9ebef8) + o Remove bufferevent_del_generic_timeout_cbs as now unused (4ea4c6a) + o More documentation for finalization feature (a800b91) + o Make the event_finalize* functions return an error code (5d11f4f) + o Mark the finalize stuff as experimental in case it needs to + change (23e2e29) + + Evdns + o evdns: New flag to make evdns not prevent the event loop from + exiting (6b7fa62 Azat Khuzhin) + + Bugfixes (Core) + o Make event_remove_timer behave correctly with persistent timers (5623e80) + o Unit test for event_remove_timer with EV_PERSIST. (96150dd) + o Double-check next timeout when adding events (9443868 Nate Rosenblum) + o event_base_update_cache_time should be a no-op if the loop isn't + running (5e6fa2a) + + Bugfixes (evhttp, crash fix, from 2.0) + o fix #73 and fix http_connection_fail_test to catch it (b618204 Greg Hazel) + + Bugfixes (compilation and portability, from 2.0) + o Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled (7e45739) + o Fix missing AC_PROG_SED on older Autoconfs (9ab2b3f Tay Ray Chuan) + o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) + (74d4c44 Kevin Bowling) + o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake + 1.13 compat (817ea36) + o Rename configure.in to configure.ac to appease newer autoconfs (0c79787) + o Avoid using top_srcdir in TESTS: new automakes do not like this (a55514e) + + Bugfixes (resource leaks/lock errors on error, from 2.0) + o Avoid leaking fds on evconnlistener with no callback set (69db261) + o Avoid double-close on getsockname error in evutil_ersatz_socketpair + (0a822a6) + o Fix a locking error in bufferevent_socket_get_dns_error. (0a5eb2e) + + Documentation Fixes (from 2.0) + o Fix a mistake in evbuffer_remove() arguments in example http server code + (c322c20 Gyepi Sam) + o Fix a typo in a comment in buffer.h. Spotted by Alt_F4 (773b0a5) + + Documentation Fixes + o minor documentation typos (809586a Patrick Pelletier) + o Fix cut-and-paste err in whatsnew-2.1 (49905ac) + o Fix comment to refer to sample/include.am correctly (9e8cdf3 Sebastian + Hahn) + o Fix typo : Dispatching instead of Dispaching (0c2bacc Volker Lendecke) + o fix some hinky indentation in evhttp_make_request (80e220e Patrick + Pelletier) + o "buffer" spelling (a452811 Patrick Pelletier) + o Specify return behavior in header for evbuffer_pullup() in corner case + (cf8d1cd Dan Petro) + o Clarify an important point about event_base_foreach_event() (920a5e6) + + Compilation Fixes/Tool Support + o avoid valgrind false positive by zeroing epoll_event (1258614 Patrick + Pelletier) + o Fix harmless clang enum warning (b452a43 Sebastian Hahn) + o remove all exes on "make clean", not just regress.exe (974bfa0 Patrick + Pelletier) + o Make --disable-libevent-regress work again (787fd74) + o Do not build strlcpy.c when it will have no code. (4914620) + + Portability Fixes + o When EWOULDBLOCK is not EAGAIN, treat it as equivalent to it (bf7a0ff) + o Preliminary changes for Minix3. (0dda56a Nicholas Heath) + o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 1.13 + compat (bf278b) + o Avoid using $(top_srcdir) in TESTS. (2863c83) + o build test/test-script.sh on systems with a less-featureful $< (f935e21) + o Implement EVUTIL_ERR_IS_EAGAIN on windows. (42aaf4d) + + Evhttp changes: + o Fix ipv6 support for http. When URL contain domain, not IP + address. (71e709c Azat Khuzhin) + o uri decode: fix for warning "use of uninitialised value" (64b6ece Azat + Khuzhin) + o uri decode: changed the test for the existence of the next character + (e1903e3 Azat Khuzhin) + o Move prototype of evhttp_decode_uri_internal() to http-internal.h + (de8101a Azat Khuzhin) + o Test: decoding just part of string with evhttp_decode_uri_internal() + (1367653 Azat Khuzhin) + o Add new error_cb for actual reporting of HTTP request errors. (7b07719 + Azat Khuzhin) + o Add test for EVREQ_HTTP_REQUEST_CANCEL into http_cancel_test() (862c217 + Azat Khuzhin) + o Drop extra header http_struct.h from regress_http.c (54cc800 Azat Khuzhin) + + Testing + o Add regress test ipv6_for_domain. (9ec88bd Azat Khuzhin) + o Add an environment variable (EVENT_DEBUG_MODE) to run unit tests in debug + mode (2fad0f3) + o Add a test with an active_later event at event_base_free time. (1c3147f) + o Make all tests pass under EVENT_DEBUG_MODE=1 (b1b054f) + o Add some verbose notes to bufferevent unit tests (9d893c9) + o New test for active_later->active transition on event_active (a153874) + o New tests for event_base_foreach_event() (0b096ef) + o Unit tests for event_base_gettimeofday_cached() and + event_base_update_cache_time() (30ea291) + o A test for event_get_assignment() (f09629e) + o More unit tests for initializing common timeouts. (d596739) + o Fix a bug in the new main/event_foreach test (702c9aa) + + Windows: + o use FormatMessage for winsock errors (0c6ec5d, 2078e9b, 4ccdd53, c9ad3af + Patrick Pelletier) + o a program to print out the error strings for winsock errors (7296512 + Patrick Pelletier) + o Fix a warning introduced in 0c6ec5d8 (eeb700c) + o Fix another warning introduced in 0c6ec5d8 (ed26561) + + Examples (http) + o Add sample/https-client.c, an example of stacking evhttp as a client on + top of bufferevent_ssl. (be46c99 Catalin Patulea) + o use ${OPENSSL_LIBS} instead of -lssl -lcrypto (bf31fa5 Patrick Pelletier) + o https-client was putting newlines at 256-byte boundaries (42d7441 Patrick + Pelletier) + o better handling of OpenSSL errors (5754d96 Patrick Pelletier) + o use Debian's default root certificate location (aacd674 Patrick Pelletier) + o use iSECPartners code to validate hostname in certificate (64d9f16 + Patrick Pelletier) + o avoid sign mismatch warning in openssl_hostname_validation.c (6021cb5 + Patrick Pelletier) + o pull in wildcard matching code from cURL (4db9da6 Patrick Pelletier) + o Another tweak to https-client.c (95acdaa) + o Remove http_struct.h usage in sample/https-client.c (8a90a85) + + + +Changes in version 2.1.2-alpha (18 Nov 2012) + + Libevent 2.1.2-alpha includes more portable for monotonic timers, + refactors much of Libevent's internal and external infrastructure, + closes some longstanding gaps in the interface, makde other + improvements. Ths log below tries to organize features by rough area of + effect. It omits a few commits which were pure bugfixes on other commits + listed below. For more detail, see the git changelogs. For more + insight, see the "whatsnew-2.1.txt" document included in the Libevent + 2.1.2-alpha distribution. + + Libevent 2.1.2-alpha also includes all changes made in 2.0.19-stable + through 2.0.21-stable inclusive. + + Performance (core): + o Replace pipe-based notification with EVFILT_USER where possible. This + should make multithreaded programs on OSX and *BSD alert the main thread a + little faster. (53a07fe) + o Make th_base_lock nonrecursive. (9cd5acb) + + New/Changed API Functions: + o New event_get_priority() function to return an event's priority (f90e255) + o Add a bufferevent_get_priority() function (bd39554) + o Add an event_base_loopcontinue() to tell Libevent to rescan for more + events right away (7d6aa5e) + o Add a new callback to get called on evbuffer_file_segment free + (e9f8feb yangacer, 64051b9) + o Expose event_base_foreach_event() as a public API. (84fd6d7 Roman + Puls, 232055e, ffe1643) + o Add an event_remove_timer() to remove timer on an event without + deleting it (e3b2e08) + o Make bufferevent_set_timeouts(bev, NULL, NULL) have plausible + semantics (9dee36b) + o Rename event_enable_lock_debuging() to ..._debugging(). (The old name + should still work.) (07e132e) + o Add missing implementation for event_enable_debug_logging (3b3e21d) + + PORTABLE MONOTONIC TIMERS: + + Libevent 2.1.2 includes internal support for monotonic timers on + (nearly) all supported platforms, including Windows, and OSX. Libevent + applications should now be more resilient to jumps forwards or backwards + in the system clock. Also, on Linux systems with epoll, we now + optionally support microsecond-level timeouts (whereas epoll only + supports millisecond-precision timeouts). + + o Use mach_absolute_time() for monotonic clock support on OSX. (b8fd6f9) + o Do not track use_monotonic field when is no monotonic clock (cb653a0) + o EVENT_BASE_FLAG_PRECISE_TIMER indicates we want fine timer precision + (ddd69d3) + o On Linux, use CLOCK_MONOTONIC_COARSE by default (55780a7) + o Implement a GetTickCount-based monotonic timer for Windows (d5e1d5a) + o Refactor monotonic timer handling into a new type and set of + functions; add a gettimeofday-based ratcheting implementation (f5e4eb0) + o Add EVENT_PRECISE_TIMER environment var for selecting precise-but-slow + timer (a2598ec) + o Implement fast/precise monotonic clocks on Windows (2c47045) + o Simple unit tests for monotonic timers (630f077) + o Improve the monotonic-time unit test: make it check the step size (7428c78) + o When PRECISE_TIMERS is set with epoll, use timerfd for microsecond + precision (26c7582) + o Split out time-related evutil functions into a new evutil_time.c (c419485) + o Split out time-related prototypes into time-internal.h (71bca50) + o Add evutil_time.obj to Makefile.nmake (0ba0683) + o Avoid giving a spurious warning when timerfd support is unavailable + (1aaf9f0 Dave Hart) + o Make test_evutil_monotonic a little more tolerant (def3b83) + o Avoid unused-var warning on systems with clock_gettime but without + CLOCK_MONOTONIC_COARSE (9be5468) + +EVENT_BASE_ONCE LEAKS: + If a callback added by event_base_once() is never invoked, Libevent no + longer leaks internal memory. + + o Free dangling event_once objects on event_base_free() (c17dd59) + o Add a unit test in which an event is created with event_base_once() + but never fires (4343edf) + +TESTING SUPPORT, FIXES AND IMPROVEMENTS: + + Libevent now disables by default its unit tests that would touch the + network, or that tend to fail on heavily-loaded systems. To re-enable + them, invoke the ./test/regress program with the @all alias. + + o Simplify test.sh code significantly. (9b856fd Ross Lagerwall) + o Make all tests that hit the network disabled by default (f2cea87) + o Avoid a resource leak on error in http client benchmark (ea92fba) + o Update to latest tinytest (911b4f0349377) (ef7c4f7) + o Avoid (unlikely) overflow in bench_httpclient.c (5671033) + o Shave 700 msec off the persistent_timeout_jump test (21205b8) + o Check return value of write() in regress.c (c8009d2) + o Make load-dependent monotonic timer tests off-by-default (2b6fe8b) + o Add deferred_cb_skew to list of timing-dependent tests (34c8f31) + o Avoid test -e; older shs don't have one. (f1bd938) + o Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086) + o Fix a couple of compile warnings in the unit tests (5a9a014) + +MISC: + o Change evutil_weakrand_() to avoid platform random() (e86af4b Nicholas + Marriott, 3aa4415) + +INFRASTRUCTURE (Active-later events): + As a simplification and optimization to Libevent's "deferred callback" + logic (introduced in 2.0 to avoid callback recursion), Libevent now + treats all of its deferrable callback types using the same logic it uses + for active events. Now deferred events no longer cause priority + inversion, no longer require special code to cancel them, and so on. + + o Refactor the callback part of an event into its own event_callback + type (cba59e5) + o Add "active later" event_callbacks to supersede deferred (745a63d) + o event_base_assert_ok: check value of event_active_count for + correctness (fec8bae) + o Replace deferred_cbs with event_callback-based implementation. (ae2b84b) + o Replace more deferred_cb names with event_callback (a4079aa) + o Give event_base_process_active a single exit path (581b5be) + o Restore our priority-inversion-prevention code with deferreds (c0e425a) + o Refactor event_persist_closure: raise and extract some common logic + (bec22b4) + o Remove the unused bits from EVLIST_ALL (9889a3d) +||||||| merged common ancestors +Changes in version 2.0.22-stable (?? Dec 2013) + + (As of 3b77d62829c4393bda6f9105a5d3b73b48a64b71.) + +BUGFIXES (evhttp) + o fix #73 and fix http_connection_fail_test to catch it (crash fix) (b618204 Greg Hazel) + o Avoid racy bufferevent activation (5eb1788 Nate Rosenblum) + +BUGFIXES (compilation and portability) + o Fix compilation with WIN32_HAVE_CONDITION_VARIABLES enabled (7e45739) + o Fix missing AC_PROG_SED on older Autoconfs (9ab2b3f Tay Ray Chuan) + o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) (74d4c44 Kevin Bowling) + o Use AC_CONFIG_HEADERS in place of AM_CONFIG_HEADERS for autmake 1.13 compat (817ea36) + o Rename configure.in to configure.ac to appease newer autoconfs (0c79787) + o Avoid using top_srcdir in TESTS: new automakes do not like this (a55514e) + o Use windows vsnprintf fixup logic on all windows environments (e826f19) + o Fix a compiler warning when checking for arc4random_buf linker breakage. (5cb3865) + o Fix another arc4random_buf-related warning (e64a2b0) + +BUGFIXES (resource leaks/lock errors on error) + o Avoid leaking fds on evconnlistener with no callback set (69db261) + o Avoid double-close on getsockname error in evutil_ersatz_socketpair (0a822a6) + o Fix a locking error in bufferevent_socket_get_dns_error. (0a5eb2e) + o libevent/win32_dealloc() : fix sizeof(pointer) vs sizeof(*pointer) (b8f5980 Frank Denis) + +BUGFIXES (miscellaneous) + o Avoid other RNG initialization FS reads when urandom file is specified (9695e9c, bb52471) + o Avoid redundant invocations of init_extension_functions for IOCP (3b77d62) + +BUFGIXES (evdns) + o Checking request nameserver for NULL, before using it. (5c710c0 Belobrov Andrey) + o Fix SEGFAULT after evdns_base_resume if no nameservers installed. (f8d7df8 Azat Khuzhin) + +BUGFIXES (evutil_secure_random) + o When we seed from /proc/sys/kernel/random/uuid, count it as success (e35b540) + o Document that arc4random is not a great cryptographic PRNG. (6e49696) + o Add evutil_secure_rng_set_urandom_device_file (2bbb5d7) + o Really remove RNG seeds from the stack (f5ced88) + + +DOCUMENTATION FIXES + o Fix a mistake in evbuffer_remove() arguments in example http server code (c322c20 Gyepi Sam) + o Fix a typo in a comment in buffer.h. Spotted by Alt_F4 (773b0a5) + + + +Changes in version 2.0.21-stable (18 Nov 2012) +BUGFIXES: + o ssl: Don't discard SSL read event when timeout and read come close together (576b29f) + o ssl: Stop looping in "consider_reading" if reading is suspended. (f719b8a Joachim Bauch) + o ssl: No need to reserve space if reading is suspended. (1acf2eb Joachim Bauch) + o dns: Avoid a memory-leak on OOM in evdns. (73e85dd, f2bff75 George Danchev) + o build: Use python2 rather than python (0eb0109 Ross Lagerwall) + o build: Compile without warnings on mingw64 (94866c2) + o build: Fix compilation on mingw64 with -DUSE_DEBUG (62bd2c4) + o build: Make rpcgen_wrapper.sh work on systems without a "python2" binary (f3009e4) + o iocp: Close IOCP listener socket on free when LEV_OPT_CLOSE_ON_FREE is set (cb853ea Juan Pablo Fernandez) + o core: Avoid crash when event_pending() called with no event_base set on event (e3cccf3) + o misc: remove stray 'x' so print_err will compile when uncommented (ac35650 Patrick Pelletier) + o tests: Fix renegotiation test to work around openssl 1.0.1 bug (c2f3086) + o tests: Warn when openssl version in unit test mismatches compiled version. (ac009f9) + + +Changes in version 2.0.20-stable (23 Aug 2012) +BUGFIXES: + o core: Make event_pending() threadsafe. (be7a95c Simon Liu) + o win32: avoid crash when waiting forever on zero fds. (160e58b) + o evhttp: Fix a memory leak on error in evhttp_uriencode (11c8b31) + o evbuffer: Avoid possible needless call to writev. Found by coverity. (6a4ec5c) + o evdns: memset sockaddr_in before using it. Found by coverity. (a1a0e67) + o evhttp: Check more setsockopt return values when binding sockets. Found by coverity (a0912e3) + o evdns: Avoid segfault on weird timeout during name lookup. (dc32077 Greg Hazel) + o bufferevent_ssl: Correctly invoke callbacks when a SSL bufferevent reads some and then blocks. (606ac43) + + +PORTABILITY FIXES: + o check for arc4random_buf at runtime, on OS X (bff5f94 Greg Hazel) + o Correctly check for arc4random_buf (fcec3e8 Sebastian Hahn) + o Add explicit AC_PROG_SED to configure.in so all autoconfs will expose $(SED) (ca80ea6) + +BUILD FIXES: + o Add GCC annotations so that the vsprintf functions get checked properly (117e327) + o Fix an unused variable warning on *BSD. (c0720c1) + +UNIT TEST FIXES: + o Fix a couple of memory leaks (found with Valgrind). (3b2529a Ross Lagerwall) + o Remove deadcode in http regression tests. Found by coverity. (5553346) + o Fix possible uninitialized read in dns regression tests. Found by coverity. (2259777) + o Set umask before calling mkstemp in unit tests. Found by coverity (f1ce15d) + o Fix various check-after-dereference issues in unit tests: found by coverity (4f3732d) + o Fix resource leaks in the unit tests; found by coverity (270f279) + o Add some missing null checks to unit tests; found by coverity (f021c3d) + o Avoid more crashes/bad calls in unit tests; found by coverity (3cde5bf) + o Remove unused variable; spotted by coverity (6355b2a) + o Add checks to various return values in unit tests. Found by coverity (b9e7329) + o Move assignment outside tt_assert in ssl unit tests. Appeases coverity. (a2006c0) + + + +Changes in version 2.0.19-stable (3 May 2012) +BUGFIXES (CORE): + o Refactor event_persist_closure: raise and extract some common logic (bec22b4) + o If time has jumped so we'd reschedule a periodic event in the past, schedule it for the future instead (dfd808c) + o If a higher-priority event becomes active, don't continue running events of the current priority. (2bfda40) + +BUGFIXES (SSL): + o Fixed potential double-readcb execution with openssl bufferevents. (4e62cd1 Mark Ellzey) + +BUGFIXES (DNS): + o Cancel a probe request when the server is freed, and ignore cancelled probe callbacks (94d2336 Greg Hazel) + o Remove redundant DNS_ERR_CANCEL check, move comment (46b8060 Greg Hazel) + o When retransmitting a timed-out DNS request, pick a fresh nameserver. (3d9e52a) + +DOCUMENTATION FIXES: + o Fix a typo in the bufferevent documentation (98e9119) + o Add missing ) to changelog; spotted by rransom (4c7ee6b) + o Fix the website URL in the readme (f775521) + +COMPILATION FIXES: + o Fix a compilation error with MSVC 2005 due to use of mode_t (336dcae) + o Configure with gcc older than 2.95 (4a6fd43 Sebastian Hahn) + o Generate event-config.h with a single sed script (30b6f88 Zack Weinberg) + +FORWARD-COMPATIBILITY: + o Backport: provide EVENT_LOG_* names, and deprecate _EVENT_LOG_* (d1a03b2) + +TESTING/DEBUGGING SUPPORT: + o dns-example.c can now take a resolv.conf file on the commandline (6610fa5) + o Make some evdns.c debug logs more verbose (d873d67) + o Work-around a stupid gcov-breaking bug in OSX 10.6 (b3887cd) + + + +Changes in version 2.0.18-stable (22 Mar 2012) +BUGFIXES (core): + o Make uses of open() close-on-exec safe by introducing an internal evutil_open_closeonexec. (d2b5f72 Ross Lagerwall, 03dce42) + +BUGFIXES (kqueue): + o Properly zero the kevent in kq_setup_kevent() (c2c7b39 Sebastian Hahn) + +BUILD FIXES: + o Added OPENSSL_LDFLAGS env variable which is appended to SSL checks. (9278196 Mark Ellzey) + o Changed OPENSSL_LDFLAGS to OPENSSL_LIBADD (2d67b63 Mark Ellzey) + o Don't do clang version detection when disabling some flags (083296b Sebastian Hahn) + +BUGFIXES (dns): + o Stop crashing in evdns when nameserver probes give a weird error (bec5068) + + +Changes in version 2.0.17-stable (10 Feb 2012) + +BUGFIXES (core): + o Be absolutely sure to clear pncalls before leaving event_signal_closure (11f36a5) + o check for sysctl before we use it (358c745 Mike Frysinger) + o Remove bogus casts of socket to int before calling ev_callback (f032516) + o Make evconnlistener work around bug in older Linux when getting nmapped (ecfc720) + o Fix a list corruption bug when using event_reinit() with signals present (6e41cdc) + o Fix a fd leak in event_reinit() (3f18ad1) + o Do a memberwise comparison of threading function tables (c94a5f2 Nate R) + o Use C-style comments in C source files (for compatibility with compilers such as xlc on AIX). (d84d917 Greg Hewgill) + o Avoid crash when freeing event_iocp and using event_set_mem_functions (19715a6) + o In the kqueue backend, do not report EBADF as an EV_READ (5d7bfa1 Nicholas Marriott) + +BUGFIXES (evbuffer and bufferevents): + o Fix behavior of evbuffer_peek(buf,-1,NULL,NULL,0) (c986f23 Zack Weinberg) + o Loop on filtering SSL reads until we are blocked or exhausted. (5b4b812) + +BUGFIXES (evhttp): + o Force strict validation of HTTP version in response. (790f6b3 Catalin Patulea) + +BUGFIXES (evdns): + o evdns: fix a bug in circular-queue implementation (d6094b1) + +BUILD FIXES: + o Fix a silly compilation error with the sun compiler (1927776 Colin Watt) + o Suppress a gcc warning from ignoring fwrite return in http-sample.c (7206e8c) + +DOCUMENTATION FIXES: + o Slightly clarify evbuffer_peek documentation (7bbf6ca) + o Update copyright notices to 2012 (e49e289) + +NEW APIS: + o Backport evhttp_connection_get_bufferevent to Libevent 2.0 (da70fa7 Arno Bakker) + +TESTS AND TEST FIXES: + o Fix a race condition in the dns/bufferevent_connect_hostname test. (cba48c7) + o Add function to check referential integrity of an event_base (27737d5) + o Check event_base correctness at end of each unit test (3312b02) + o Workaround in the unit tests for an apparent epoll bug in Linux 3.2 (dab9187) + o Better workaround for Linux 3.2 edge-triggered epoll bug (9f9e259) + +Changes in version 2.0.16-stable (18 Nov 2011) +BUGFIXES (core): + o More detailed message in case of libevent self-debugging failure. (9e6a4ef Leonid Evdokimov) + o epoll: close fd on alloc fail at initialization (1aee718 Jamie Iles) + o Fix compile warning from saying event2/*.h inside a comment (447b0ba) + o Warn when unable to construct base because of failing make_base_notifiable (4e797f3) + o Don't try to make notifiable event_base when no threading fns are configured (e787413) + +BUGFIXES (evbuffer): + o unit test for remove_buffer bug (90bd620 Greg Hazel) + o Fix an evbuffer crash in evbuffer_remove_buffer() (c37069c) + +BUGFIXES (bufferevent_openssl): + o Refactor amount-to-read calculations in buffervent_ssl consider_reading() (a186e73 Mark Ellzey) + o Move SSL rate-limit enforcement into bytes_to_read() (96c562f) + o Avoid spinning on OpenSSL reads (2aa036f Mark Ellzey) + +BUGFIXES (dns) + o Empty DNS reply with OK status is another way to say NODATA. (21a08d6 Leonid Evdokimov) + +TESTING: + o Tests for 94fba5b and f72e8f6 (d58c15e Leonid Evdokimov) + o Test for commit aff6ba1 (f7841bf Leonid Evdokimov) + o Style and comment tweaks for dns/leak* tests (5e42202) + o improve test to remove at least one buffer from src (7eb52eb Greg Hazel) + +DOCUMENTATION: + o Add note about evhttp_send_reply_end to its doxygen (724bfb5) + o Update copyright dates to 2011. (3c824bd) + o Fix typo in whatsnew-2.0.txt (674bc6a Mansour Moufid) + o Improve win32 behavior of dns-sample.c code (a3f320e Gisle Vanem) + + + +Changes in version 2.0.15-stable (12 Oct 2011) +BUGFIXES (DNS): + o DNS: add ttl for negative answers using RFC 2308 idea. (f72e8f6 Leonid Evdokimov) + o Add DNS_ERR_NODATA error code to handle empty replies. (94fba5b Leonid Evdokimov) + +BUFGIXES (bufferevents and evbuffers): + o Make evbuffer callbacks get the right n_added value after evbuffer_add (1ef1f68 Alex) + o Prefer mmap to sendfile unless a DRAINS_TO_FD flag is set. Allows add_file to work with SSL. (0ba0af9) + +BUGFIXES (event loop): + o When a signal callback is activated to run multiple times, allow event_base_loopbreak to work even before they all have run. (4e8eb6a) + +DOCUMENTATION FIXES: + o Fix docstring in dns.h (2b6eae5 Leonid Evdokimov) + o refer to non-deprecated evdns functions in comments (ba5c27d Greg Hazel) + +BUILD AND TESTING FIXES: + o le-proxy and regress depend on openssl directly (9ae061a Sergey Avseyev) + o Use _SOURCES, not _sources, in sample/Makefile.am (7f82382) + o Fixed compiler warnings for unchecked read/write calls. (c3b62fd Mark Ellzey) + o Make write-checking fixes use tt_fail_perror (2b76847) + o Fix some "value never used" warnings with gcc 4.6.1 (39c0cf7) + + + +Changes in version 2.0.14-stable (31 Aug 2011) +BUGFIXES (bufferevents and evbuffers): + o Propagate errors on the underlying bufferevent to the user. (4a34394 Joachim Bauch) + o Ignore OpenSSL deprecation warnings on OS X (5d1b255 Sebastian Hahn) + o Fix handling of group rate limits under 64 bytes of burst (6d5440e) + o Solaris sendfile: correctly detect amount of data sent (643922e Michael Herf) + o Make rate limiting work with common_timeout logic (5b18f13) + o clear read watermark on underlying bufferevent when creating filtering bev to fix potentially failing fragmented ssl handshakes (54f7e61 Joachim Bauch) + +BUGFIXES (IOCP): + o IOCP: don't launch reads or writes on an unconnected socket (495c227) + o Make IOCP rate-limiting group support stricter and less surprising. (a98da7b) + o Have test-ratelim.c support IOCP (0ff2c5a) + o Make overlapped reads result in evbuffer callbacks getting invoked (6acfbdd) + o Correctly terminate IO on an async bufferevent on bufferevent_free (e6af35d) + +BUGFIXES (other): + o Fix evsig_dealloc memory leak with debugging turned on. (9b724b2 Leonid Evdokimov) + o Fix request_finished memory leak with debugging turned on. (aff6ba1 Leonid Evdokimov) + +BUILD AND TESTING FIXES: + o Allow OS-neutral builds for platforms where some versions have arc4random_buf (b442302 Mitchell Livingston) + o Try to fix 'make distcheck' errors when building out-of-tree (04656ea Dave Hart) + o Clean up some problems identified by Coverity. (7c11e51 Harlan Stenn) + + +Changes in version 2.0.13-stable (18 Jul 2011) +BUGFIXES + o Avoid race-condition when initializing global locks (b683cae) + o Fix bug in SSL bufferevents backed by a bev with a write high-watermarks (e050703 Joachim Bauch) + o Speed up invoke_callbacks on evbuffers when there are no callbacks (f87f568 Mark Ellzey) + o Avoid a segfault when all methods are disabled or broken (27ce38b) + o Fix incorrect results from evbuffer_search_eol(EOL_LF) (4461f1a) + o Add some missing checks for mm_calloc failures (89d5e09) + o Replace an assertion for event_base_free(NULL) with a check-and-warn (09fe97d) + o Report kqueue ebadf, epipe, and eperm as EV_READ events (1fd34ab) + o Check if the `evhttp_new_object' function in `http.c' returns NULL. (446cc7a Mansour Moufid) + o Use the correct printf args when formatting size_t (3203f88) + o Complain if the caller tries to change threading cbs after setting them (cb6ecee) + +DOCUMENTATION FIXES AND IMPROVEMENTS + o Revise the event/evbuffer/bufferevent doxygen for clarity and accuracy (2888fac) + o Update Doxyfile to produce more useful output (aea0555) + +TEST FIXES + o Fix up test_evutil_snprintf (caf695a) + o Fix tinytest invocation from windows shell (57def34 Ed Day) + +BUILD FIXES + o Use AM_CPPFLAGS in sample/Makefile.am, not AM_CFLAGS (4a5c82d) + o Fix select.c compilation on systems with no NFDBITS (49d1136) + o Fix a few warnings on OpenBSD (8ee9f9c Nicholas Marriott) + o Don't break when building tests from git without python installed (b031adf) + o Don't install event_rpcgen.py when --disable-libevent-install is used (e23cda3 Harlan Stenn) + o Fix AIX build issue with TAILQ_FOREACH definition (e934096) + + +Changes in version 2.0.12-stable (4 Jun 2011) +BUGFIXES + o Fix a warn-and-fail bug in kqueue by providing kevent() room to report errors (28317a0) + o Fix an assert-inducing fencepost bug in the select backend (d90149d) + o Fix failing http assertion introduced in commit 0d6622e (0848814 Kevin Ko) + o Fix a bug that prevented us from configuring IPv6 nameservers. (74760f1) + o Prevent size_t overflow in evhttp_htmlescape. (06c51cd Mansour Moufid) + o Added several checks for under/overflow conditions in evhttp_handle_chunked_read (a279272 Mark Ellzey) + o Added overflow checks in evhttp_read_body and evhttp_get_body (84560fc Mark Ellzey) + +DOCUMENTATION: + o Add missing words to EVLOOP_NONBLOCK documentation (9556a7d) + +BUILD FIXES + o libssl depends on libcrypto, not the other way around. (274dd03 Peter Rosin) + o Libtool brings in the dependencies of libevent_openssl.la automatically (7b819f2 Peter Rosin) + o Use OPENSSL_LIBS in Makefile.am (292092e Sebastian Hahn) + o Move the win32 detection in configure.in (ceb03b9 Sebastian Hahn) + o Correctly detect openssl on windows (6619385 Sebastian Hahn) + o Fix a compile warning with zlib 1.2.4 and 1.2.5 (5786b91 Sebastian Hahn) + o Fix compilation with GCC 2, which had no __builtin_expect (09d39a1 Dave Hart) + o Fix new warnings from GCC 4.6 (06a714f) + o Link with -lshell32 and -ladvapi32 on Win32. (86090ee Peter Rosin) + o Make the tests build when OpenSSL is not available. (07c41be Peter Rosin) + o Bring in the compile script from automake, if needed. (f3c7a4c Peter Rosin) + o MSVC does not provide S_ISDIR, so provide it manually. (70be7d1 Peter Rosin) + o unistd.h and sys/time.h might not exist. (fe93022 Peter Rosin) + o Make sure TINYTEST_LOCAL is defined when building tinytest.c (8fa030c Peter Rosin) + o Fix winsock2.h #include issues with MSVC (3d768dc Peter Rosin) + o Use evutil_gettimeofday instead of relying on the system gettimeofday. (0de87fe Peter Rosin) + o Always use evutil_snprintf, even if OS provides it (d1b2d11 Sebastian Hahn) + o InitializeCriticalSectionAndSpinCount requires _WIN32_WINNT >= 0x0403. (816115a Peter Rosin) + o cygwin: make it possible to build DLLs (d54d3fc) + + + +Changes in version 2.0.11-stable (27 Apr 2011) + [Autogenerated from the Git log, sorted and cleaned by hand.] +BUGFIXES: + o Fix evport handling of POLLHUP and POLLERR (b42ce4b) + o Fix compilation on Windows with NDEBUG (cb8059d) + o Check for POLLERR, POLLHUP and POLLNVAL for Solaris event ports (0144886 Trond Norbye) + o Detect and handle more allocation failures. (666b096 Jardel Weyrich) + o Use event_err() only if the failure is truly unrecoverable. (3f8d22a Jardel Weyrich) + o Handle resize failures in the select backend better. (83e805a) + o Correctly free selectop fields when select_resize fails in select_init (0c0ec0b) + o Make --enable-gcc-warnings a no-op if not using gcc (3267703) + o Fix a type error in our (unused) arc4random_stir() (f736198) + o Correctly detect and stop non-chunked http requests when the body is too long (63a715e) + o Have event_base_gettimeofday_cached() always return wall-clock time (a459ef7) + o Workaround for http crash bug 3078187 (5dc5662 Tomash Brechko) + o Fix incorrect assertions and possible use-after-free in evrpc_free() (4b8f02f Christophe Fillot) + o Reset outgoing http connection when read data in idle state. (272823f Tomash Brechko) + o Fix subtle recursion in evhttp_connection_cb_cleanup(). (218cf19 Tomash Brechko) + o Fix the case when failed evhttp_make_request() leaved request in the queue. (0d6622e Tomash Brechko) + o Fix a crash bug in evdns server circular list code (00e91b3) + o Handle calloc failure in evdns. (Found by Dave Hart) (364291e) + o Fix a memory leak on win32 socket->event map. (b4f89f0) + o Add a forgotten NULL check to evhttp_parse_headers (12311ff Sebastian Hahn) + o Fix possible NULL-deref in evdns_cancel_request (5208544 Sebastian Hahn) + +PORTABILITY: + o Fall back to sscanf if we have no other way to implement strtoll (453317b) + o Build correctly on platforms without sockaddr_storage (9184563) + o Try to build correctly on platforms with no IPv6 support (713c254) + o Build on systems without AI_PASSIVE (cb92113) + o Fix http unit test on non-windows platforms without getaddrinfo (6092f12) + o Do not check for gethostbyname_r versions if we have getaddrinfo (c1260b0) + o Include arpa/inet.h as needed on HPUX (10c834c Harlan Stenn) + o Include util-internal.h as needed to build on platforms with no sockaddr_storage (bbf5515 Harlan Stenn) + o Check for getservbyname even if not on win32. (af08a94 Harlan Stenn) + o Add -D_OSF_SOURCE to fix hpux builds (0b33479 Harlan Stenn) + o Check for allocation failures in apply_socktype_protocol_hack (637d17a) + o Fix the check for multicast or broadcast addresses in evutil_check_interfaces (1a21d7b) + o Avoid a free(NULL) if out-of-memory in evdns_getaddrinfo. Found by Dave Hart (3417f68) + +DEFENSIVE PROGRAMMING: + o Add compile-time check for AF_UNSPEC==PF_UNSPEC (3c8f4e7) + +BUGS IN TESTS: + o Fix test.sh output on solaris (b4f89b6 Dave Hart) + o Make test-eof fail with a timeout if we never get an eof. (05a2c22 Harlan Stenn) + o Use %s with printf in test.sh (039b9bd) + o Add an assert to appease clang's static analyzer (b0ff7eb Sebastian Hahn) + o Add a forgotten return value check in the unit tests (3819b62 Sebastian Hahn) + o Actually send NULL request in http_bad_request_test (b693c32 Sebastian Hahn) + o add some (void) casts for unused variables (65707d7 Sebastian Hahn) + o Refactor test_getaddrinfo_async_cancel_stress() (48c44a6 Sebastian Hahn) + o Be nice and "handle" error return values in sample code (4bac793 Sebastian Hahn) + o Check return value of evbuffer_add_cb in tests (93a1abb Sebastian Hahn) + o Remote some dead code from dns-example.c (744c745 Sebastian Hahn) + o Zero a struct sockaddr_in before using it (646f9fe Sebastian Hahn) + +BUILD FIXES: + o Fix warnings about AC_LANG_PROGRAM usage (f663112 Sebastian Hahn) + o Skip check for zlib if we have no zlib.h (a317c06 Harlan Stenn) + o Fix autoconf bracket issues; make check for getaddrinfo include netdb.h (833e5e9 Harlan Stenn) + o Correct an AM_CFLAGS to an AM_CPPFLAGS in test/Makefile.am (9c469db Dave Hart) + o Fix make distcheck & installation of libevent 1 headers (b5a1f9f Dave Hart) + o Fix compilation under LLVM/clang with --enable-gcc-warnings (ad9ff58 Sebastian Hahn) + +FEATURES: + o Make URI parser able to tolerate nonconformant URIs. (95060b5) + +DOCUMENTATION: + o Clarify event_set_mem_functions doc (926f816) + o Correct evhttp_del_accept_socket documentation on whether socket is closed (f665924) + o fix spelling mistake in whatsnew-2.0.txt (deb2f73) + o Fix sample/http-server ipv6 fixes (eb692be) + o Comment internal headers used in sample code. (4eb281c) + o Be explicit about how long event loops run in event.h documentation (f95bafb) + o Add comment to configure.in to explain gc-sections test logic (c621359) + o Fix a couple of memory leaks in samples/http-server.c. Found by Dave Hart. (2e9f665) + + + +BUILD IMPROVEMENTS: + Libevent 2.1.2-alpha modernizes Libevent's use of autotools, and makes + numerous other build system. Parallel builds should be faster, and all + builds should be quieter. + + o Split long lists in Makefile.am into one-item-per-line (2711cda) + o Remove unnecessary code in configure.in. (e65914f Ross Lagerwall) + o attempt to support OpenSSL in Makefile.nmake (eba0eb2 Patrick Pelletier) + o Use newer syntax for autoconf/automake init (7d60ba8) + o Enable silent build rules by default. Override with V=1 (7b18e5c) + o Switch to non-recursive makefiles (7092f3b) + o Rename subordinate Makefile.ams to include.am (6cdfeeb) + o Make quiet build even quieter (371a123) + o New --quiet option for event_rpcgen.py (aa59c1e) + o Be quiet when making regress.gen.[ch] (607a8ff) + o Fix handling of no-python case for nonrecursive make (1e3123d) + o We now require automake 1.9 or later. Modernize! (b7f6e89) + o Rename configure.in to configure.ac. (b3fea67 Ross Lagerwall) + o Use correct openssl libs and includes in pkgconfig file (d70af27) + o Use the same CFLAGS for openssl when building unit tests as with + libevent (1d9d511) + +DOCUMENTATION + o Note that make_base_notifiable should not be necessary (26ee5f9) + o Be more clear that LEV_OPT_DEFERRED_ACCEPT has tricky prereqs (371efeb) + o Add caveat to docs about bufferevent_free() with data in outbuf (6fab9ee) + o Make it more clear that NOLOCK means "I promise, no multithreading" + (9444524) + o Fix a comment in test-fdleak after 077c7e949. (3881d8f Ross Lagerwall) + o Make the Makefile.nmake warning slightly less dire (e7bf4c8) + o Fix typo : events instead of evets (05f1aca Azat Khuzhin) + o Additional comments about OPENSSL_DIR variable, prompted by Dave Hart + (6bde2ef Patrick Pelletier) + +EVHTTP: + o ignore LWS after field-content in headers (370a2c0 Artem Germanov) + o Clean up rtrim implementation (aa59d80) + o Remove trailing tabs in HTTP headers as well. (ac42519) + o Remove internal ws from multiline http headers correctly (c6ff381) + o Move evutil_rtrim_lws_ to evutil.c where it belongs (61b93af) + o add evhttp_request_get_response_code_line (4f4d0c9 Jay R. Wren) + o Use EVUTIL_SOCKET_ERROR() wrapper to save/restore errno in + evhttp_connection_fail_ (7afbd60) + o preserve errno in evhttp_connection_fail_ for inspection by the + callback (36d0ee5 Patrick Pelletier) + +BUGFIXES: + o Correctly handle running on a system where accept4 doesn't work. (9fbfe9b) + o Avoid double-free on error in evbuffer_add_file. Found by + coverity. (6a81b1f) + o Fix another possible uninitialized read in dns regression tests. Found + by coverity. (13525c5) + o Add checks for functions in test-ratelim.c; found by Coverity (aa501e1) + o Avoid memory leak in test_event_calloc unit test; found by coverity + (92817a1) + o Fix a shadowed variable in addfile_test_readcb; found by coverity + (225344c) + o Check return value when using LEV_OPT_DEFERRED_ACCEPT. Found by + coverity (6487f63) + o Prevent reference leak of bufferevent if getaddrinfo fails. (b757786 + Joachim Bauch) + o Make event_base_getnpriorities work with old "implicit base" code + (c46cb9c) + o Simplify and correct evutil_open_closeonexec_ (0de587f) + o Fix event_dlist definition when sys/queue not included (81b6209 + Derrick Pallas) + + + +Changes in version 2.1.1-alpha (4 Apr 2012) + + Libevent 2.1.1-alpha includes a number of new features and performance + improvements. The log below tries to organize them by rough area of + effect. It omits some commits which were pure bugfixes on other commits + listed below. For more detail, see the git changelogs. For more + insight, see the "whatsnew-2.1.txt" document included in the Libevent + 2.1.1-alpha distribution. + + Performance: Core + o Replace several TAILQ users with LIST. LIST can be a little faster than + TAILQ for cases where we don't need queue-like behavior. (f9db33d, + 6494772, d313c29, 974d004) + o Disabled code to optimize the case where we reinsert an existing + timeout (e47042f, 09cbc3d) + o Remove a needless base-notify when rescheduling the first timeout (77a96fd) + o Save a needless comparison when removing/adjusting timeouts (dd5189b) + o Possible optimization: split event_queue_insert/remove into + separate functions. needs testing (efc4dc5) + o Make event_count maintenance branchless at the expense of an + extra shift. Needs benchmarking (d1cee3b) + o In the 2.1 branch, let's try out lazy gettimeofday/clock_gettime + comparison (2a83ecc) + o Optimization in event_process_active(): ignore maxcb & endtime + for highest priority events. (a9866aa Alexander Drozdov) + o Bypass event_add when using event_base_once() for a 0-sec timeout (35c5c95) + o Remove the eventqueue list and the ev_next pointers. (604569b 066775e) + + Performance: Evbuffers + o Roughly 20% speed increase when line-draining a buffer using + EVBUFFER_EOL_CRLF (5dde0f0 Mina Naguib) + o Try to squeeze a little more speed out of EVBUFFER_EOL_CRLF (7b9d139) + o Fix a bug in the improved EOL_CRLF code (d927965) + o Remove a needless branch in evbuffer_drain() (d19a326) + + Performance: Linux + o Infrastructure for using faster/fewer syscalls when creating + sockets (a1c042b) + o Minimize syscalls during socket creation in listener.c (7e9e289) + o Use a wrapper function to create the notification + pipe/socketpair/eventfd (ca76cd9) + o Use pipes for telling signals to main thread when possible (a35f396) + o Save syscalls when constructing listener sockets for evhttp (af6c9d8) + o Save some syscalls when creating evdns sockets (713e570) + o Save some syscalls when constructing a socket for a bufferevent (33fca62) + o Prefer epoll_create1 on Linuxen that have it (bac906c) + + Performance: Epoll backend + o Use current event set rather than current pending change when + deciding whether to no-op a del (04ba27e Mike Smellie) + o Replace big chain of if/thens in epoll.c with a table lookup (8c83eb6) + o Clean up error handling in epoll_apply_one_change() a little (2d55a19) + + Performance: Evport backend + o evport: use evmap_io to track fdinfo status. Should save time and + RAM. (4687ce4) + o evport: Remove a linear search over recent events when + reactivating them (0f77efe) + o evport: Use portev_user to remember fdinfo struct (276ec0e) + o evport: don't scan more events in ed_pending than needed (849a5cf) + o evport: Remove artificial low limit on max events per getn call (c04d927) + o Reenable main/many_events_slow_add for evport in 2.1 (e903db3) + + Performance: Windows + o Use GetSystemTimeAsFileTime to implement gettimeofday on + win32. It's faster and more accurate than our old + approach. (b8b8aa5) + + New functions and features: debugging + o Add event_enable_debug_logging() to control use of debug logs (e30a82f) + + New functions and features: core + o Add event_config function to limit time/callbacks between calls + to dispatch (fd4de1e, 9fa56bd, a37a0c0, 3c63edd) + o New EVLOOP_NO_EXIT_ON_EMPTY option to keep looping even when no + events are pending (084e68f) + o Add event_base_get_npriorities() function. (ee3a4ee Alexander Drozdov) + o Make evbase_priority_init() and evbase_get_npriorities() + threadsafe (3c55b5e) + o New event_base_update_cache_time() to set cached_tv to current + time (212533e Abel Mathew) + o Add event_self_cbarg() to be used in conjunction with + event_new(). (ed36e6a Ross Lagerwall, fa931bb, 09a1906, 1338e6c, + 33e43ef) + o Add a new libevent_global_shutdown() to free all globals before + exiting. (041ca00 Mark Ellzey, f98c158, 15296d0, 55e991b) + o Use getifaddrs to detect our interfaces if possible (7085a45) + o Add event_base_get_running_event() to get the event* whose cb we + are in (c5732fd, 13dad99) + + New functions and features: building + o Implement --enable-gcc-hardening configure option (7550267 Sebastian Hahn) + + New functions and features: evbuffers + o Add evbuffer_add_file_segment() so one fd can be used efficiently + in more than one evbuffer_add_file at a time (e72afae, c2d9884, + 3f405d2, 0aad014) + o Fix windows file segment mappings (8254de7) + o Allow evbuffer_ptr_set to yield a point just after the end of the + buffer. (e6fe1da) + o Allow evbuffer_ptr to point to position 0 in an empty evbuffer + (7aeb2fd Nir Soffer) + o Set the special "not found" evbuffer_ptr consistently. (e3e97ae Nir Soffer) + o support adding buffers to other buffers non-destructively + (9d7368a Joachim Bauch) + o prevent nested multicast references, reworked locking (26041a8 + Joachim Bauch) + o New EVBUFFER_EOL_NUL to read NUL-terminated strings from an + evbuffer (d7a8b36 Andrea Montefusco, 54142c9) + o Make evbuffer_file_segment_types adaptable (c6bbbf1) + o Added evbuffer_add_iovec and unit tests. (aaec5ac Mark Ellzey, 27b5398) + o Add evbuffer_copyout_from to copy data from the middle of a + buffer (27e2225) + + New functions and features: bufferevents + o Allow users to set allow_dirty_shutdown (099d27d Catalin Patulea) + o Tweak allow_dirty_shutdown documentation (a44cd2b) + o Fix two issues in the allow_dirty_shutdown code. (f3b89de) + o Add a bufferevent_getcb() to find a bufferevent's current + callbacks (a650394) + o bufferevent: Add functions to set/get max_single_read/write + values. (998c813 Alexander Drozdov) + o bev_ssl: Be more specific in event callbacks. evhttp in particular gets + confused without at least one of BEV_EVENT_{READING|WRITING}. (f7eb69a + Catalin Patulea) + + New functions and features: evconnlisteners + o Support TCP_DEFER_ACCEPT sockopts for listeners (5880e4a Mark Ellzey, + a270728) + o Add another caveat to the TCP_DEFER_ACCEPT documentation (a270728) + o Allow evconnlistener to be created in disabled state. (9593a33 + Alexander Drozdov) + o The LEV_OPT_CLOSE_ON_EXEC flag now applies to accepted listener + sockets too (4970329) + + Evhttp: + o Add new evhttp_{connection_}set_timeout_tv() functions to set + finger-grained http timeouts (6350e6c Constantine Verutin) + o Performance tweak to evhttp_parse_request_line. (aee1a97 Mark Ellzey) + o Add missing break to evhttp_parse_request_line (0fcc536) + o Add evhttp callback for bufferevent creation; this lets evhttp + support SSL. (8d3a850) + o Remove calls to deprecated bufferevent functions from evhttp.c (4d63758) + o evhttp: Add evhttp_foreach_bound_socket. (a2c48e3 Samy Al Bahra) + + Build improvements: + o Add AC_USE_SYSTEM_EXTENSIONS to configure.in. Requires follow on + patches for correctness and robustness. (1fa7dbe Kevin Bowling) + o Filter '# define' statements from autoconf and generate + event-private.h (321b558 Kevin Bowling) + o Remove internal usage of _GNU_SOURCE (3b26541 Kevin Bowling) + o Eliminate a couple more manual internal _GNU_SOURCE defines (c51ef93 + Kevin Bowling) + o Add AC_GNU_SOURCE to the fallback case. (ea8fa4c Kevin Bowling) + o Use a Configuration Header Template for evconfig-private.h (868f888 + Kevin Bowling) + o Fix a comment warning and add evconfig-private.h to .gitignore + (f6d66bc Kevin Bowling) + o Include evconfig-private.h in internal files for great good. (0915ca0 + Kevin Bowling) + o Backport libevent to vanilla Autoconf 2.59 (as used in RHEL5) + (ad03952 Kevin Bowling) + o Prefer the ./configure evconfig-private.h in MinGW, just in + case. (f964b72 Kevin Bowling) + o Shell hack for weird mkdir -p commands (fd7b5a8 Kevin Bowling) + o Add evconfig-private to remaining files (ded0a09 Kevin Bowling) + o Allow use of --enable-silent-rules for quieter compilation with + automake 1.11 (f1f8514 Dave Hart) + o Use "_WIN32", not WIN32: it's standard and we don't need to fake it + (9f560b) + o In configure, test for _WIN32 not WIN32. (85078b1 Peter Rosin) + o Do not define WIN32 in Makefile.nmake (d41f3ea Peter Rosin) + o Provide the autoconf m4 macros for the new OpenSSL via pkg-config + stuff. (674dc3d Harlan Stenn) + o Use pkg-config (if available) to handle OpenSSL. (1c63860 Harlan Stenn) + o We need AM_CPPFLAGS when compiling bufferevent_openssl.c (6d2613b + Harlan Stenn) + o Fix OSX build: $(OPENSSL_INCS) needs to be after + $(AM_CPPFLAGS). (46f1769 Zack Weinberg) + o Make gcc warnings on by default, and --enable-gcc-warnings only add + -Werror (d46517e Sebastian Hahn) + o Split up extra-long AC_CHECK_FUNCS/HEADERS lines in configure.in (88a30ad) + o Move libevent 1.x headers to include/, to put all public headers in + one place. (bbea8d6) + o Put #ifdef around some files to support alternate build + systems. (76d4c92 Ross Lagerwall) + o Also make win32select.c conditional for IDE users (bf2c5a7) + + Debugging: + o Add a magic number to debug_locks to better catch lock-coding + errors. (b4a29c0 Dave Hart) + o munge the debug_lock signature before freeing it: it might help us + catch use-after-free (f28084d) + o Added --enable-event-debugging in configure (bc7b4e4, a9c2c9a Mark Ellzey) + o Debug addition for printing usec on TIMEOUT debugging. (ac43ce0 Mark Ellzey) + o Added usec debug in another area for debug (3baab0d Mark Ellzey) + o added timeout debug logs to include event ptr. (4b7d298 Mark Ellzey) + o more event dbg updates (6727543 Mark Ellzey) + o Clarify event_enable_debug_logging a little (6207826) + o Make --enable-verbose-debug option match its help text (10c3450) + o Add argument checks to some memory functions in `event.c'. (c8953d1 + Mansour Moufid) + + Testing: + o More abstraction in test.sh (cd74c4e) + o Add failing test for evbuffer_search_range. (8e26154 Nir Soffer) + o Tweaks to return types with end-of-buf ptrs (9ab8ab8) + o Add an (internal) usleep function for use by unit tests (f25d9d3) + o Synchronize with upstream tinytest (6c81be7) + o Make test-changelist faster (7622d26) + o Reduce the timeout in the main/fork test. (ab14f7c) + o New evhttp function to adjust initial retry timeout (350a3c4) + o Make regression tests run over 3x faster. (67a1763) + o Use test_timeval_diff_eq more consistently (b77b43f) + o Allow more slop in deferred_cb_skew test; freebsd needs it (b9f7e5f) + o When including an -internal.h header outside the main tree, do so + early (95e2455) + o Add a new test: test-fdleak which tests for fd leaks by creating many + sockets. (2ef9278 Ross Lagerwall, f7af194, 1c4288f, etc) + o Add a unit test for event_base_dump_events() (7afe48a, 8d08cce) + o Test more bufferevent_ratelim features (c24f91a) + + Documentation: + o Improve evbuffer_ptr documentation (261ba63) + o added comments to describe refcounting of multicast chains (ba24f61 + Joachim Bauch) + o Add doxygen for event_base_dump_events (cad5753) + + OSX: + o Use "unlimited select" on OSX so that we can have more than + FD_SETSIZE fds (1fb5cc6) + + KQueue: + o Use SIG_IGN instead of a do-nothing handler for signal events with + kqueue (148458e Zack Weinberg) + + evprc: + o event_rpcgen.py now prints status information to stdout and errors to + stderr. (ffb0ba0 Ross Lagerwall) + + Code improvement and refactoring: + o Make event_reinit() more robust and maintainable (272033e) + o Restore fast-path event_reinit() for slower backends (2c4b5de) + o Check changelist as part of checking representational integrity (39b3f38) + o Fix a compile warning in event_reinit (e4a56ed Sebastian Hahn) + o Refactor the functions that run over every event. (c89b4e6) + o Remove the last vestiges of _EVENT_USE_EVENTLIST (a3cec90) + o Make event-config.h depend on Makefile.am (2958a5c) + + Build fixes: + o Don't do clang version detection when disabling some flags (083296b + Sebastian Hahn) + + C standards conformance: + o Check for NULL return on win32 mm_calloc, and set ENOMEM. (af7ba69) + o Convert event-config.h macros to avoid reserved identifiers (68120d9) + o Generate event-config.h using the correct macros. (f82c57e) + o Convert include-guard macro convention to avoid reserved identifiers + (3f8c7cd) + o Make event_rpcgen.py output conform to identifier conventions (372bff1) + o Stop referring to an obsolete include guard in bench_http.h (5c0f7e0) + o Make the generated event-config.h use correct include guards (639383a) + o Fix all identifiers with names beginning with underscore. (cb9da0b) + o Make event_rpcgen.py output conform to identifier conventions, more + (bcefd24) + o Fix some problems introduced by automated identifier cleanup script + (c963534) + o Have all visible internal function names end with an underscore. (8ac3c4c) + o Apply the naming convention to our EVUTIL_IS* functions (c7848fa) + o Clean up lingering _identifiers. (946b584) + o Fix doxygen to use new macro conventions (da455e9) + + Bugfixes: + o Do not use system EAI/AI values if we are not using the system + getaddrinfo. (7bcac07) + + Sample Code: + o Fix up sample/event-test.c to use newer interfaces and make it + actually work. (19bab4f Ross Lagerwall) + o On Unix, remove event.fifo left by sample/event-test.c. (c0dacd2 Ross + Lagerwall) + o Rename event-test.c to event-read-fifo.c. (a5b370a Ross Lagerwall) + o event-read-fifo: Use EV_PERSIST appropriately (24dab0b) + + + + diff --git a/lib/monkey/mk_core/deps/libevent/Documentation/Building.md b/lib/monkey/mk_core/deps/libevent/Documentation/Building.md new file mode 100644 index 00000000000..cf07c6e88f6 --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/Documentation/Building.md @@ -0,0 +1,229 @@ +# Building and installing Libevent + +### Jump to: + +- [Prerequisites](#Prerequisites) +- [Building on Unix using CMake](#building-on-unix-cmake) +- [Autotools (deprecated)](#autotools-deprecated) + - [Flags](#autotools-flags) +- [Building on Windows](#building-on-windows) +- [CMake Variables](#cmake-variables) + +## Prerequisites + +### Linux deb-like (ubuntu/debian/...) + +Install build tools using your preferred package manager. For CMake: + +```sh +sudo apt-get install cmake +``` + +or using Autotools (deprecated): + +```sh +sudo apt-get install automake autoconf libtool pkg-config +``` + +Doxygen is used for generating documentation. +Git is used to fetch the package version. +Install them if needed: + +```sh +sudo apt-get install doxygen git +``` + +libevent has encryption layer, you need OpenSSL or MbedTLS for it, you can +install one of this using: + +```sh +sudo apt-get install libssl-dev libmbedtls-dev +``` + +To support multithreaded environments, libpthread is a must, and it already exists in the system. + +To run the tests, you should install zlib: + +```sh +sudo apt-get install zlib1g-dev +``` + +Finally, a python interpreter should be installed if you want to run regression tests: +```sh +sudo apt-get install python3 +``` + +### MacOS + +On MacOS you can use `brew` to manage packages. + +The installation process on MacOS is roughly the same as on Linux, +the difference is installation of openssl and zlib: + +```sh +brew install openssl zlib +``` + +### Windows + +To install it, there are two choices: installer and zip file. + +If using zip file, you should set the PATH variable in the Environment +Variables for your User to include the installation path of cmake. + +Install Visual Studio which is the true compiler that will be used. + +Install OpenSSL to support for encryption, then add the installation path into the PATH variable in the Environment Variables, +or set OPENSSL_ROOT_DIR in command prompt: + +```sh +set "OPENSSL_ROOT_DIR=C:\path\to\OpenSSL" +``` + +or add `OPENSSL_ROOT_DIR` definition to the cmake command: + +```sh +cmake -DOPENSSL_ROOT_DIR=C:/path/to/OpenSSL ... +``` + +## Building on Unix (CMake) +```sh +mkdir build && cd build +cmake .. # Default to Unix Makefiles +make +make verify # Optional +``` + +## Autotools (deprecated) + +```sh +./configure +make +``` + +**Note: If you had downloaded libevent from the Git repository, then you have to run `./autogen.sh` first!** + +You can run the regression tests by running +```sh +make verify +``` +*Before reporting any problems, please run the regression tests.* + +Install as root via +```sh +make install +``` + +To enable low-level tracing, build the library as: +```sh +CFLAGS=-DUSE_DEBUG ./configure [...] +``` + +### Autotools flags + +Standard configure flags should work. In particular, see: +```sh + --disable-shared Only build static libraries. + --prefix Install all files relative to this directory. +``` + +The configure script also supports the following flags: +```sh + --enable-gcc-warnings Enable extra compiler checking with GCC. + --disable-malloc-replacement + Don't let applications replace our memory + management functions. + --disable-openssl Disable support for OpenSSL encryption. + --disable-thread-support Don't support multithreaded environments. + --enable-doxygen-doc Build doxygen documentation +``` + +## Building on Windows +__Download CMake for Windows [here](https://cmake.org/download/)__ +```sh +md build && cd build +cmake -G "Visual Studio 10" .. # Or use any generator you want to use. Run cmake --help for a list +cmake --build . --config Release # Or "start libevent.sln" and build with menu in Visual Studio. +``` +In the above, the ".." refers to the dir containing the Libevent source code. You can build multiple versions (with different compile time settings) from the same source tree by creating other build directories. + +It is highly recommended to build "out of source" when using CMake instead of "in source" like the normal behaviour of autoconf for this reason. + +The "NMake Makefiles" CMake generator can be used to build entirely via the command line: +```sh +cmake -LH .. +``` + +## CMake Variables +General options: +```sh +# Type of the library to build (SHARED or STATIC) +# Default is: SHARED for MSVC, otherwise BOTH +EVENT__LIBRARY_TYPE:STRING=DEFAULT + +# Installation directory for CMake files +EVENT_INSTALL_CMAKE_DIR:PATH=lib/cmake/libevent + +# Enable running gcov to get a test coverage report (only works with +# GCC/CLang). Make sure to enable -DCMAKE_BUILD_TYPE=Debug as well. +EVENT__COVERAGE:BOOL=OFF + +# Defines if Libevent should build without the benchmark executables +EVENT__DISABLE_BENCHMARK:BOOL=OFF + +# Define if Libevent should build without support for a debug mode +EVENT__DISABLE_DEBUG_MODE:BOOL=OFF + +# Define if Libevent should not allow replacing the mm functions +EVENT__DISABLE_MM_REPLACEMENT:BOOL=OFF + +# Define if Libevent should build without support for OpenSSL encryption +EVENT__DISABLE_OPENSSL:BOOL=OFF + +# Disable the regress tests +EVENT__DISABLE_REGRESS:BOOL=OFF + +# Disable sample files +EVENT__DISABLE_SAMPLES:BOOL=OFF + +# If tests should be compiled or not +EVENT__DISABLE_TESTS:BOOL=OFF + +# Define if Libevent should not be compiled with thread support +EVENT__DISABLE_THREAD_SUPPORT:BOOL=OFF + +# Enables verbose debugging +EVENT__ENABLE_VERBOSE_DEBUG:BOOL=OFF + +# When cross compiling, forces running a test program that verifies that Kqueue +# works with pipes. Note that this requires you to manually run the test program +# on the cross compilation target to verify that it works. See CMake +# documentation for try_run for more details +EVENT__FORCE_KQUEUE_CHECK:BOOL=OFF + +# Build documentation with doxygen +EVENT__DOXYGEN:BOOL=OFF +``` +MSVC specific options: +```sh +# Link static runtime libraries. +# Defaults to ON if EVENT_LIBRARY_TYPE is equal to "STATIC", otherwise OFF +EVENT__MSVC_STATIC_RUNTIME:BOOL +``` +GNUC specific options: +```sh +# Disable verbose warnings with GCC +EVENT__DISABLE_GCC_WARNINGS:BOOL=OFF + +# Enable compiler security checks +EVENT__ENABLE_GCC_HARDENING:BOOL=OFF + +# Enable gcc function sections +EVENT__ENABLE_GCC_FUNCTION_SECTIONS:BOOL=OFF + +# Make all GCC warnings into errors +EVENT__ENABLE_GCC_WARNINGS:BOOL=OFF +``` +__More variables can be found by running `cmake -LAH `__ + +[Back to top ↑](#jump-to) diff --git a/lib/monkey/mk_core/deps/libevent/Doxyfile b/lib/monkey/mk_core/deps/libevent/Doxyfile index d9d6603459c..3e4e96aec4b 100644 --- a/lib/monkey/mk_core/deps/libevent/Doxyfile +++ b/lib/monkey/mk_core/deps/libevent/Doxyfile @@ -17,11 +17,11 @@ # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. -PROJECT_NAME = libevent +PROJECT_NAME = $(PROJECT)-$(VERSION) # Place all output under 'doxygen/' -OUTPUT_DIRECTORY = doxygen/ +OUTPUT_DIRECTORY = $(DOCDIR) # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style @@ -52,7 +52,7 @@ SORT_BRIEF_DOCS = YES # If left blank the directory from which doxygen is run is used as the # path to strip. -STRIP_FROM_PATH = include/ +STRIP_FROM_PATH = $(SRCDIR)/include/ #--------------------------------------------------------------------------- # configuration options related to the input files @@ -64,24 +64,26 @@ STRIP_FROM_PATH = include/ # with spaces. INPUT = \ - include/event2/buffer.h \ - include/event2/buffer_compat.h \ - include/event2/bufferevent.h \ - include/event2/bufferevent_compat.h \ - include/event2/bufferevent_ssl.h \ - include/event2/dns.h \ - include/event2/dns_compat.h \ - include/event2/event.h \ - include/event2/event_compat.h \ - include/event2/http.h \ - include/event2/http_compat.h \ - include/event2/listener.h \ - include/event2/rpc.h \ - include/event2/rpc_compat.h \ - include/event2/tag.h \ - include/event2/tag_compat.h \ - include/event2/thread.h \ - include/event2/util.h + $(SRCDIR)/include/event2/buffer.h \ + $(SRCDIR)/include/event2/buffer_compat.h \ + $(SRCDIR)/include/event2/bufferevent.h \ + $(SRCDIR)/include/event2/bufferevent_compat.h \ + $(SRCDIR)/include/event2/bufferevent_ssl.h \ + $(SRCDIR)/include/event2/dns.h \ + $(SRCDIR)/include/event2/dns_compat.h \ + $(SRCDIR)/include/event2/event.h \ + $(SRCDIR)/include/event2/event_compat.h \ + $(SRCDIR)/include/event2/http.h \ + $(SRCDIR)/include/event2/http_compat.h \ + $(SRCDIR)/include/event2/listener.h \ + $(SRCDIR)/include/event2/rpc.h \ + $(SRCDIR)/include/event2/rpc_compat.h \ + $(SRCDIR)/include/event2/tag.h \ + $(SRCDIR)/include/event2/tag_compat.h \ + $(SRCDIR)/include/event2/thread.h \ + $(SRCDIR)/include/event2/ws.h \ + $(SRCDIR)/include/event2/util.h \ + $(SRCDIR)/include/event2/watch.h #--------------------------------------------------------------------------- # configuration options related to the HTML output @@ -90,7 +92,7 @@ INPUT = \ # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. -GENERATE_HTML = YES +GENERATE_HTML = $(GENERATE_HTML) #--------------------------------------------------------------------------- # configuration options related to the LaTeX output @@ -99,7 +101,7 @@ GENERATE_HTML = YES # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. -GENERATE_LATEX = YES +GENERATE_LATEX = $(GENERATE_LATEX) # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be @@ -175,7 +177,7 @@ LATEX_HIDE_INDICES = NO # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages -GENERATE_MAN = NO +GENERATE_MAN = $(GENERATE_MAN) # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) @@ -188,7 +190,7 @@ MAN_EXTENSION = .3 # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. -MAN_LINKS = YES +MAN_LINKS = NO #--------------------------------------------------------------------------- # Configuration options related to the preprocessor diff --git a/lib/monkey/mk_core/deps/libevent/LICENSE b/lib/monkey/mk_core/deps/libevent/LICENSE index 402ca50896c..e86a5551294 100644 --- a/lib/monkey/mk_core/deps/libevent/LICENSE +++ b/lib/monkey/mk_core/deps/libevent/LICENSE @@ -97,3 +97,55 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +============================== + +The wepoll module is available under the following, sometimes called the +"FreeBSD" license: + +Copyright 2012-2020, Bert Belder +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +============================== + +The ssl-client-mbedtls.c is available under the following license: + +Copyright (C) 2006-2015, ARM Limited, All Rights Reserved +SPDX-License-Identifier: Apache-2.0 + +Licensed under the Apache License, Version 2.0 (the "License"); you may +not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +This file is part of mbed TLS (https://tls.mbed.org) diff --git a/lib/monkey/mk_core/deps/libevent/Makefile.am b/lib/monkey/mk_core/deps/libevent/Makefile.am index c7f1d19a1ea..9588f35081d 100644 --- a/lib/monkey/mk_core/deps/libevent/Makefile.am +++ b/lib/monkey/mk_core/deps/libevent/Makefile.am @@ -14,7 +14,7 @@ ACLOCAL_AMFLAGS = -I m4 # will increment for each series until we revise our interfaces enough # that we can seriously expect ABI compatibility between series. # -RELEASE = -release 2.1 +RELEASE = -release 2.2 # This is the version info for the libevent binary API. It has three # numbers: @@ -34,7 +34,7 @@ RELEASE = -release 2.1 # # Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES # UNLESS YOU REALLY REALLY HAVE TO. -VERSION_INFO = 6:1:0 +VERSION_INFO = 1:1:0 # History: RELEASE VERSION_INFO # 2.0.1-alpha -- 2.0 1:0:0 @@ -67,6 +67,11 @@ VERSION_INFO = 6:1:0 # 2.1.5-beta -- 2.1 5:0:0 (ABI changed slightly) # 2.1.6-beta -- 2.1 6:0:0 (ABI changed slightly) # 2.1.7-beta -- 2.1 6:1:0 (ABI changed slightly) +# 2.1.8-stable-- 2.1 6:2:0 (ABI changed slightly) +# +# For Libevent 2.2: +# 2.2.1-alpha -- 2.2 1:0:0 +# 2.2.2-alpha -- 2.2 1:1:0 (No ABI change) # ABI version history for this package effectively restarts every time # we change RELEASE. Version 1.4.x had RELEASE of 1.4. @@ -97,20 +102,55 @@ LIBEVENT_PKGCONFIG=libevent.pc libevent_core.pc libevent_extra.pc # included from other files. PLATFORM_DEPENDENT_SRC = \ arc4random.c \ - epoll_sub.c + bufferevent_ssl.c \ + epoll_sub.c \ + PrivacyInfo.xcprivacy \ + test/regress_ssl.c + +CMAKE_FILES = \ + cmake/AddCompilerFlags.cmake \ + cmake/AddLinkerFlags.cmake \ + cmake/AddEventLibrary.cmake \ + cmake/CheckConstExists.cmake \ + cmake/CheckFileOffsetBits.c \ + cmake/CheckFileOffsetBits.cmake \ + cmake/CheckFunctionKeywords.cmake \ + cmake/CheckPrototypeDefinition.c.in \ + cmake/CheckPrototypeDefinition.cmake \ + cmake/CheckWorkingKqueue.cmake \ + cmake/CodeCoverage.cmake \ + cmake/COPYING-CMAKE-SCRIPTS \ + cmake/Copyright.txt \ + cmake/FindMbedTLS.cmake \ + cmake/LibeventConfig.cmake.in \ + cmake/LibeventConfigVersion.cmake.in \ + cmake/Macros.cmake \ + cmake/Uninstall.cmake.in \ + cmake/UseDoxygen.cmake \ + cmake/VersionViaGit.cmake \ + event-config.h.cmake \ + evconfig-private.h.cmake \ + CMakeLists.txt + +DOCUMENTATION_FILES = \ + Documentation/Building.md EXTRA_DIST = \ ChangeLog-1.4 \ ChangeLog-2.0 \ + ChangeLog-2.1 \ + ChangeLog \ Doxyfile \ LICENSE \ - Makefile.nmake test/Makefile.nmake \ autogen.sh \ event_rpcgen.py \ libevent.pc.in \ make-event-config.sed \ whatsnew-2.0.txt \ whatsnew-2.1.txt \ + README.md \ + $(CMAKE_FILES) \ + $(DOCUMENTATION_FILES) \ $(PLATFORM_DEPENDENT_SRC) LIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la @@ -122,6 +162,10 @@ if OPENSSL LIBEVENT_LIBS_LA += libevent_openssl.la LIBEVENT_PKGCONFIG += libevent_openssl.pc endif +if MBEDTLS +LIBEVENT_LIBS_LA += libevent_mbedtls.la +LIBEVENT_PKGCONFIG += libevent_mbedtls.pc +endif if INSTALL_LIBEVENT lib_LTLIBRARIES = $(LIBEVENT_LIBS_LA) @@ -143,10 +187,11 @@ include test/include.am if BUILD_WIN32 -SYS_LIBS = -lws2_32 -lshell32 -ladvapi32 +SYS_CORE_LIBS = -liphlpapi +SYS_LIBS = -lws2_32 -lshell32 -ladvapi32 -lbcrypt SYS_SRC = win32select.c buffer_iocp.c event_iocp.c \ bufferevent_async.c -SYS_INCLUDES = -IWIN32-Code -IWIN32-Code/nmake +SYS_INCLUDES = -IWIN32-Code if THREADS SYS_SRC += evthread_win32.c @@ -154,6 +199,7 @@ endif else +SYS_CORE_LIBS = SYS_LIBS = SYS_SRC = SYS_INCLUDES = @@ -181,9 +227,16 @@ endif if EVPORT_BACKEND SYS_SRC += evport.c endif +if WEPOLL_BACKEND +SYS_SRC += epoll.c +SYS_SRC += wepoll.c +endif if SIGNAL_SUPPORT SYS_SRC += signal.c endif +if SIGNALFD_SUPPORT +SYS_SRC += signalfd.c +endif BUILT_SOURCES += include/event2/event-config.h @@ -205,6 +258,7 @@ CORE_SRC = \ evutil.c \ evutil_rand.c \ evutil_time.c \ + watch.c \ listener.c \ log.c \ $(SYS_SRC) @@ -213,6 +267,8 @@ EXTRAS_SRC = \ evdns.c \ event_tagging.c \ evrpc.c \ + sha1.c \ + ws.c \ http.c if BUILD_WITH_NO_UNDEFINED @@ -223,14 +279,18 @@ NO_UNDEFINED = MAYBE_CORE = endif -GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED) +AM_CFLAGS = $(LIBEVENT_CFLAGS) +AM_CPPFLAGS = -I$(srcdir)/compat -I./include -I$(srcdir)/include $(SYS_INCLUDES) $(LIBEVENT_CPPFLAGS) +AM_LDFLAGS = $(LIBEVENT_LDFLAGS) + +GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED) $(AM_LDFLAGS) libevent_la_SOURCES = $(CORE_SRC) $(EXTRAS_SRC) -libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS) +libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS) $(SYS_CORE_LIBS) libevent_la_LDFLAGS = $(GENERIC_LDFLAGS) libevent_core_la_SOURCES = $(CORE_SRC) -libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS) +libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS) $(SYS_CORE_LIBS) libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS) if PTHREADS @@ -244,28 +304,37 @@ libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS) libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS) if OPENSSL -libevent_openssl_la_SOURCES = bufferevent_openssl.c +libevent_openssl_la_SOURCES = bufferevent_openssl.c bufferevent_ssl.c libevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS) libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS) libevent_openssl_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS) endif +if MBEDTLS +libevent_mbedtls_la_SOURCES = bufferevent_mbedtls.c bufferevent_ssl.c +libevent_mbedtls_la_LIBADD = $(MAYBE_CORE) $(MBEDTLS_LIBS) +libevent_mbedtls_la_LDFLAGS = $(GENERIC_LDFLAGS) +libevent_mbedtls_la_CPPFLAGS = $(AM_CPPFLAGS) $(MBEDTLS_INCS) +endif + noinst_HEADERS += \ - WIN32-Code/nmake/evconfig-private.h \ - WIN32-Code/nmake/event2/event-config.h \ + WIN32-Code/getopt.h \ + WIN32-Code/getopt.c \ + WIN32-Code/getopt_long.c \ WIN32-Code/tree.h \ - bufferevent-internal.h \ - changelist-internal.h \ + bufferevent-internal.h \ + changelist-internal.h \ compat/sys/queue.h \ + compat/sys/tree.h \ defer-internal.h \ - epolltable-internal.h \ + epolltable-internal.h \ evbuffer-internal.h \ - evconfig-private.h \ event-internal.h \ evmap-internal.h \ evrpc-internal.h \ evsignal-internal.h \ evthread-internal.h \ + evdns-internal.h \ ht-internal.h \ http-internal.h \ iocp-internal.h \ @@ -278,7 +347,12 @@ noinst_HEADERS += \ ratelim-internal.h \ strlcpy-internal.h \ time-internal.h \ - util-internal.h + util-internal.h \ + openssl-compat.h \ + mbedtls-compat.h \ + sha1.h \ + ssl-compat.h \ + wepoll.h EVENT1_HDRS = \ include/evdns.h \ @@ -293,13 +367,9 @@ else noinst_HEADERS += $(EVENT1_HDRS) endif -AM_CPPFLAGS = -I$(srcdir)/compat -I$(srcdir)/include -I./include $(SYS_INCLUDES) - verify: check -doxygen: FORCE - doxygen $(srcdir)/Doxyfile -FORCE: +include doxygen.am DISTCLEANFILES += *~ libevent.pc libevent_core.pc libevent_extra.pc ./include/event2/event-config.h diff --git a/lib/monkey/mk_core/deps/libevent/Makefile.in b/lib/monkey/mk_core/deps/libevent/Makefile.in new file mode 100644 index 00000000000..d62a54ab213 --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/Makefile.in @@ -0,0 +1,3666 @@ +# Makefile.in generated by automake 1.18.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2025 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile.am for libevent +# Copyright 2000-2007 Niels Provos +# Copyright 2007-2012 Niels Provos and Nick Mathewson +# +# See LICENSE for copying information. + +# include/include.am for libevent +# Copyright 2000-2007 Niels Provos +# Copyright 2007-2012 Niels Provos and Nick Mathewson +# +# See LICENSE for copying information. + +# sample/include.am for libevent +# Copyright 2000-2007 Niels Provos +# Copyright 2007-2012 Niels Provos and Nick Mathewson +# +# See LICENSE for copying information. + +# test/Makefile.am for libevent +# Copyright 2000-2007 Niels Provos +# Copyright 2007-2012 Niels Provos and Nick Mathewson +# +# See LICENSE for copying information. + +# Doxygen documentation will not be generated with default configuration, +# unless '--enable-doxygen-doc' is configured. +# The following targets are all about doxygen: +# make # 'make doxygen' would be auto executed +# make doxygen # generating doxygen documentation +# make doxygen-doc # same as 'make doxygen' +# make clean # clean docs generated by doxygen +# make install # install doxygen documentation +# make uninstall # uninstall doxygen documentation + + + + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +am__rm_f = rm -f $(am__rm_f_notfound) +am__rm_rf = rm -rf $(am__rm_f_notfound) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@PTHREADS_TRUE@am__append_1 = libevent_pthreads.la +@PTHREADS_TRUE@am__append_2 = libevent_pthreads.pc +@OPENSSL_TRUE@am__append_3 = libevent_openssl.la +@OPENSSL_TRUE@am__append_4 = libevent_openssl.pc +@MBEDTLS_TRUE@am__append_5 = libevent_mbedtls.la +@MBEDTLS_TRUE@am__append_6 = libevent_mbedtls.pc +noinst_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_8) +EXTRA_PROGRAMS = $(am__EXEEXT_1) +@OPENSSL_TRUE@am__append_7 = include/event2/bufferevent_ssl.h +@MBEDTLS_TRUE@@OPENSSL_FALSE@am__append_8 = include/event2/bufferevent_ssl.h +@INSTALL_LIBEVENT_FALSE@am__append_9 = $(EVENT2_EXPORT) +@OPENSSL_TRUE@am__append_10 = sample/le-proxy sample/becat \ +@OPENSSL_TRUE@ sample/https-client +@BUILD_WIN32_TRUE@@OPENSSL_TRUE@am__append_11 = -lcrypt32 +@OPENSSL_TRUE@am__append_12 = \ +@OPENSSL_TRUE@ sample/hostcheck.h \ +@OPENSSL_TRUE@ sample/openssl_hostname_validation.h + +@MBEDTLS_TRUE@am__append_13 = sample/ssl-client-mbedtls \ +@MBEDTLS_TRUE@ sample/https-client-mbedtls +@BUILD_SAMPLES_TRUE@am__append_14 = $(SAMPLES) +@KQUEUE_BACKEND_TRUE@@PTHREADS_TRUE@am__append_15 = test/test-kq-collision +@BUILD_REGRESS_TRUE@am__append_16 = $(TESTPROGRAMS) +@BUILD_REGRESS_TRUE@am__append_17 = test/regress +@BUILD_REGRESS_TRUE@am__append_18 = test/regress.gen.c test/regress.gen.h +@PTHREADS_TRUE@am__append_19 = libevent_pthreads.la +@BUILD_WIN32_TRUE@am__append_20 = test/regress_iocp.c +@OPENSSL_TRUE@am__append_21 = test/regress_openssl.c +@OPENSSL_TRUE@am__append_22 = $(OPENSSL_INCS) +@OPENSSL_TRUE@am__append_23 = libevent_openssl.la $(OPENSSL_LIBS) ${OPENSSL_LIBADD} +@MBEDTLS_TRUE@am__append_24 = test/regress_mbedtls.c +@MBEDTLS_TRUE@am__append_25 = $(MBEDTLS_INCS) +@MBEDTLS_TRUE@am__append_26 = libevent_mbedtls.la $(MBEDTLS_LIBS) +@BUILD_WIN32_TRUE@@THREADS_TRUE@am__append_27 = evthread_win32.c +@STRLCPY_IMPL_TRUE@am__append_28 = strlcpy.c +@SELECT_BACKEND_TRUE@am__append_29 = select.c +@POLL_BACKEND_TRUE@am__append_30 = poll.c +@DEVPOLL_BACKEND_TRUE@am__append_31 = devpoll.c +@KQUEUE_BACKEND_TRUE@am__append_32 = kqueue.c +@EPOLL_BACKEND_TRUE@am__append_33 = epoll.c +@EVPORT_BACKEND_TRUE@am__append_34 = evport.c +@WEPOLL_BACKEND_TRUE@am__append_35 = epoll.c wepoll.c +@SIGNAL_SUPPORT_TRUE@am__append_36 = signal.c +@SIGNALFD_SUPPORT_TRUE@am__append_37 = signalfd.c +@INSTALL_LIBEVENT_FALSE@am__append_38 = $(EVENT1_HDRS) +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_backport_259_ssizet.m4 \ + $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_check_funcs_ex.m4 \ + $(top_srcdir)/m4/ax_prog_doxygen.m4 \ + $(top_srcdir)/m4/ax_pthread.m4 \ + $(top_srcdir)/m4/libevent_mbedtls.m4 \ + $(top_srcdir)/m4/libevent_openssl.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__dist_bin_SCRIPTS_DIST) \ + $(am__include_HEADERS_DIST) $(am__include_event2_HEADERS_DIST) \ + $(am__noinst_HEADERS_DIST) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h evconfig-private.h +CONFIG_CLEAN_FILES = libevent.pc libevent_mbedtls.pc \ + libevent_openssl.pc libevent_pthreads.pc libevent_core.pc \ + libevent_extra.pc +CONFIG_CLEAN_VPATH_FILES = +@BUILD_REGRESS_TRUE@am__EXEEXT_1 = test/regress$(EXEEXT) +@OPENSSL_TRUE@am__EXEEXT_2 = sample/le-proxy$(EXEEXT) \ +@OPENSSL_TRUE@ sample/becat$(EXEEXT) \ +@OPENSSL_TRUE@ sample/https-client$(EXEEXT) +@MBEDTLS_TRUE@am__EXEEXT_3 = sample/ssl-client-mbedtls$(EXEEXT) \ +@MBEDTLS_TRUE@ sample/https-client-mbedtls$(EXEEXT) +am__EXEEXT_4 = sample/dns-example$(EXEEXT) \ + sample/event-read-fifo$(EXEEXT) sample/hello-world$(EXEEXT) \ + sample/http-server$(EXEEXT) sample/http-connect$(EXEEXT) \ + sample/signal-test$(EXEEXT) sample/time-test$(EXEEXT) \ + sample/ws-chat-server$(EXEEXT) sample/watch-timing$(EXEEXT) \ + $(am__EXEEXT_2) $(am__EXEEXT_3) +@BUILD_SAMPLES_TRUE@am__EXEEXT_5 = $(am__EXEEXT_4) +@KQUEUE_BACKEND_TRUE@@PTHREADS_TRUE@am__EXEEXT_6 = test/test-kq-collision$(EXEEXT) +am__EXEEXT_7 = test/bench$(EXEEXT) test/bench_cascade$(EXEEXT) \ + test/bench_http$(EXEEXT) test/bench_httpclient$(EXEEXT) \ + test/test-changelist$(EXEEXT) test/test-dumpevents$(EXEEXT) \ + test/test-eof$(EXEEXT) test/test-closed$(EXEEXT) \ + test/test-fdleak$(EXEEXT) test/test-init$(EXEEXT) \ + test/test-ratelim$(EXEEXT) test/test-time$(EXEEXT) \ + test/test-weof$(EXEEXT) $(am__EXEEXT_6) test/regress$(EXEEXT) +@BUILD_REGRESS_TRUE@am__EXEEXT_8 = $(am__EXEEXT_7) +PROGRAMS = $(noinst_PROGRAMS) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && echo $$files | $(am__xargs_n) 40 $(am__rm_f); }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(pkgconfigdir)" \ + "$(DESTDIR)$(includedir)" "$(DESTDIR)$(include_event2dir)" \ + "$(DESTDIR)$(include_event2dir)" +LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) +am__DEPENDENCIES_1 = +libevent_la_DEPENDENCIES = @LTLIBOBJS@ $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__libevent_la_SOURCES_DIST = buffer.c bufferevent.c \ + bufferevent_filter.c bufferevent_pair.c bufferevent_ratelim.c \ + bufferevent_sock.c event.c evmap.c evthread.c evutil.c \ + evutil_rand.c evutil_time.c watch.c listener.c log.c strlcpy.c \ + select.c poll.c devpoll.c kqueue.c epoll.c evport.c wepoll.c \ + signal.c signalfd.c win32select.c buffer_iocp.c event_iocp.c \ + bufferevent_async.c evthread_win32.c evdns.c event_tagging.c \ + evrpc.c sha1.c ws.c http.c +@STRLCPY_IMPL_TRUE@am__objects_1 = strlcpy.lo +@SELECT_BACKEND_TRUE@am__objects_2 = select.lo +@POLL_BACKEND_TRUE@am__objects_3 = poll.lo +@DEVPOLL_BACKEND_TRUE@am__objects_4 = devpoll.lo +@KQUEUE_BACKEND_TRUE@am__objects_5 = kqueue.lo +@EPOLL_BACKEND_TRUE@am__objects_6 = epoll.lo +@EVPORT_BACKEND_TRUE@am__objects_7 = evport.lo +@WEPOLL_BACKEND_TRUE@am__objects_8 = epoll.lo wepoll.lo +@SIGNAL_SUPPORT_TRUE@am__objects_9 = signal.lo +@SIGNALFD_SUPPORT_TRUE@am__objects_10 = signalfd.lo +@BUILD_WIN32_TRUE@@THREADS_TRUE@am__objects_11 = evthread_win32.lo +@BUILD_WIN32_FALSE@am__objects_12 = $(am__objects_1) $(am__objects_2) \ +@BUILD_WIN32_FALSE@ $(am__objects_3) $(am__objects_4) \ +@BUILD_WIN32_FALSE@ $(am__objects_5) $(am__objects_6) \ +@BUILD_WIN32_FALSE@ $(am__objects_7) $(am__objects_8) \ +@BUILD_WIN32_FALSE@ $(am__objects_9) $(am__objects_10) +@BUILD_WIN32_TRUE@am__objects_12 = win32select.lo buffer_iocp.lo \ +@BUILD_WIN32_TRUE@ event_iocp.lo bufferevent_async.lo \ +@BUILD_WIN32_TRUE@ $(am__objects_11) $(am__objects_1) \ +@BUILD_WIN32_TRUE@ $(am__objects_2) $(am__objects_3) \ +@BUILD_WIN32_TRUE@ $(am__objects_4) $(am__objects_5) \ +@BUILD_WIN32_TRUE@ $(am__objects_6) $(am__objects_7) \ +@BUILD_WIN32_TRUE@ $(am__objects_8) $(am__objects_9) \ +@BUILD_WIN32_TRUE@ $(am__objects_10) +am__objects_13 = buffer.lo bufferevent.lo bufferevent_filter.lo \ + bufferevent_pair.lo bufferevent_ratelim.lo bufferevent_sock.lo \ + event.lo evmap.lo evthread.lo evutil.lo evutil_rand.lo \ + evutil_time.lo watch.lo listener.lo log.lo $(am__objects_12) +am__objects_14 = evdns.lo event_tagging.lo evrpc.lo sha1.lo ws.lo \ + http.lo +am_libevent_la_OBJECTS = $(am__objects_13) $(am__objects_14) +libevent_la_OBJECTS = $(am_libevent_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libevent_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libevent_la_LDFLAGS) $(LDFLAGS) -o $@ +@INSTALL_LIBEVENT_FALSE@am_libevent_la_rpath = +@INSTALL_LIBEVENT_TRUE@am_libevent_la_rpath = -rpath $(libdir) +libevent_core_la_DEPENDENCIES = @LTLIBOBJS@ $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +am__libevent_core_la_SOURCES_DIST = buffer.c bufferevent.c \ + bufferevent_filter.c bufferevent_pair.c bufferevent_ratelim.c \ + bufferevent_sock.c event.c evmap.c evthread.c evutil.c \ + evutil_rand.c evutil_time.c watch.c listener.c log.c strlcpy.c \ + select.c poll.c devpoll.c kqueue.c epoll.c evport.c wepoll.c \ + signal.c signalfd.c win32select.c buffer_iocp.c event_iocp.c \ + bufferevent_async.c evthread_win32.c +am_libevent_core_la_OBJECTS = $(am__objects_13) +libevent_core_la_OBJECTS = $(am_libevent_core_la_OBJECTS) +libevent_core_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libevent_core_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@INSTALL_LIBEVENT_FALSE@am_libevent_core_la_rpath = +@INSTALL_LIBEVENT_TRUE@am_libevent_core_la_rpath = -rpath $(libdir) +@BUILD_WITH_NO_UNDEFINED_TRUE@am__DEPENDENCIES_2 = libevent_core.la +libevent_extra_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_1) +am_libevent_extra_la_OBJECTS = $(am__objects_14) +libevent_extra_la_OBJECTS = $(am_libevent_extra_la_OBJECTS) +libevent_extra_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libevent_extra_la_LDFLAGS) $(LDFLAGS) \ + -o $@ +@INSTALL_LIBEVENT_FALSE@am_libevent_extra_la_rpath = +@INSTALL_LIBEVENT_TRUE@am_libevent_extra_la_rpath = -rpath $(libdir) +@MBEDTLS_TRUE@libevent_mbedtls_la_DEPENDENCIES = \ +@MBEDTLS_TRUE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +am__libevent_mbedtls_la_SOURCES_DIST = bufferevent_mbedtls.c \ + bufferevent_ssl.c +@MBEDTLS_TRUE@am_libevent_mbedtls_la_OBJECTS = \ +@MBEDTLS_TRUE@ libevent_mbedtls_la-bufferevent_mbedtls.lo \ +@MBEDTLS_TRUE@ libevent_mbedtls_la-bufferevent_ssl.lo +libevent_mbedtls_la_OBJECTS = $(am_libevent_mbedtls_la_OBJECTS) +libevent_mbedtls_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libevent_mbedtls_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@INSTALL_LIBEVENT_FALSE@@MBEDTLS_TRUE@am_libevent_mbedtls_la_rpath = +@INSTALL_LIBEVENT_TRUE@@MBEDTLS_TRUE@am_libevent_mbedtls_la_rpath = \ +@INSTALL_LIBEVENT_TRUE@@MBEDTLS_TRUE@ -rpath $(libdir) +@OPENSSL_TRUE@libevent_openssl_la_DEPENDENCIES = \ +@OPENSSL_TRUE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) +am__libevent_openssl_la_SOURCES_DIST = bufferevent_openssl.c \ + bufferevent_ssl.c +@OPENSSL_TRUE@am_libevent_openssl_la_OBJECTS = \ +@OPENSSL_TRUE@ libevent_openssl_la-bufferevent_openssl.lo \ +@OPENSSL_TRUE@ libevent_openssl_la-bufferevent_ssl.lo +libevent_openssl_la_OBJECTS = $(am_libevent_openssl_la_OBJECTS) +libevent_openssl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libevent_openssl_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@INSTALL_LIBEVENT_FALSE@@OPENSSL_TRUE@am_libevent_openssl_la_rpath = +@INSTALL_LIBEVENT_TRUE@@OPENSSL_TRUE@am_libevent_openssl_la_rpath = \ +@INSTALL_LIBEVENT_TRUE@@OPENSSL_TRUE@ -rpath $(libdir) +@PTHREADS_TRUE@libevent_pthreads_la_DEPENDENCIES = \ +@PTHREADS_TRUE@ $(am__DEPENDENCIES_2) +am__libevent_pthreads_la_SOURCES_DIST = evthread_pthread.c +@PTHREADS_TRUE@am_libevent_pthreads_la_OBJECTS = evthread_pthread.lo +libevent_pthreads_la_OBJECTS = $(am_libevent_pthreads_la_OBJECTS) +libevent_pthreads_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(libevent_pthreads_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@INSTALL_LIBEVENT_FALSE@@PTHREADS_TRUE@am_libevent_pthreads_la_rpath = +@INSTALL_LIBEVENT_TRUE@@PTHREADS_TRUE@am_libevent_pthreads_la_rpath = \ +@INSTALL_LIBEVENT_TRUE@@PTHREADS_TRUE@ -rpath $(libdir) +am__sample_becat_SOURCES_DIST = sample/becat.c +am__dirstamp = $(am__leading_dot)dirstamp +@OPENSSL_TRUE@am_sample_becat_OBJECTS = sample/becat-becat.$(OBJEXT) +sample_becat_OBJECTS = $(am_sample_becat_OBJECTS) +@OPENSSL_TRUE@sample_becat_DEPENDENCIES = libevent.la \ +@OPENSSL_TRUE@ libevent_openssl.la $(am__DEPENDENCIES_1) \ +@OPENSSL_TRUE@ $(am__DEPENDENCIES_1) +am_sample_dns_example_OBJECTS = sample/dns-example.$(OBJEXT) +sample_dns_example_OBJECTS = $(am_sample_dns_example_OBJECTS) +sample_dns_example_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la +am_sample_event_read_fifo_OBJECTS = sample/event-read-fifo.$(OBJEXT) +sample_event_read_fifo_OBJECTS = $(am_sample_event_read_fifo_OBJECTS) +sample_event_read_fifo_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + libevent.la +am_sample_hello_world_OBJECTS = sample/hello-world.$(OBJEXT) +sample_hello_world_OBJECTS = $(am_sample_hello_world_OBJECTS) +sample_hello_world_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la +am_sample_http_connect_OBJECTS = sample/http-connect.$(OBJEXT) +sample_http_connect_OBJECTS = $(am_sample_http_connect_OBJECTS) +sample_http_connect_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la +am_sample_http_server_OBJECTS = sample/http-server.$(OBJEXT) +sample_http_server_OBJECTS = $(am_sample_http_server_OBJECTS) +sample_http_server_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la +am__sample_https_client_SOURCES_DIST = sample/https-client.c \ + sample/hostcheck.c sample/openssl_hostname_validation.c +@OPENSSL_TRUE@am_sample_https_client_OBJECTS = \ +@OPENSSL_TRUE@ sample/https_client-https-client.$(OBJEXT) \ +@OPENSSL_TRUE@ sample/https_client-hostcheck.$(OBJEXT) \ +@OPENSSL_TRUE@ sample/https_client-openssl_hostname_validation.$(OBJEXT) +sample_https_client_OBJECTS = $(am_sample_https_client_OBJECTS) +@OPENSSL_TRUE@sample_https_client_DEPENDENCIES = libevent.la \ +@OPENSSL_TRUE@ libevent_openssl.la $(am__DEPENDENCIES_1) \ +@OPENSSL_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +am__sample_https_client_mbedtls_SOURCES_DIST = sample/https-client.c +@MBEDTLS_TRUE@am_sample_https_client_mbedtls_OBJECTS = sample/https_client_mbedtls-https-client.$(OBJEXT) +sample_https_client_mbedtls_OBJECTS = \ + $(am_sample_https_client_mbedtls_OBJECTS) +@MBEDTLS_TRUE@sample_https_client_mbedtls_DEPENDENCIES = libevent.la \ +@MBEDTLS_TRUE@ libevent_mbedtls.la $(am__DEPENDENCIES_1) +am__sample_le_proxy_SOURCES_DIST = sample/le-proxy.c +@OPENSSL_TRUE@am_sample_le_proxy_OBJECTS = \ +@OPENSSL_TRUE@ sample/le_proxy-le-proxy.$(OBJEXT) +sample_le_proxy_OBJECTS = $(am_sample_le_proxy_OBJECTS) +@OPENSSL_TRUE@sample_le_proxy_DEPENDENCIES = libevent.la \ +@OPENSSL_TRUE@ libevent_openssl.la $(am__DEPENDENCIES_1) \ +@OPENSSL_TRUE@ $(am__DEPENDENCIES_1) +am_sample_signal_test_OBJECTS = sample/signal-test.$(OBJEXT) +sample_signal_test_OBJECTS = $(am_sample_signal_test_OBJECTS) +sample_signal_test_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la +am__sample_ssl_client_mbedtls_SOURCES_DIST = \ + sample/ssl-client-mbedtls.c +@MBEDTLS_TRUE@am_sample_ssl_client_mbedtls_OBJECTS = sample/ssl_client_mbedtls-ssl-client-mbedtls.$(OBJEXT) +sample_ssl_client_mbedtls_OBJECTS = \ + $(am_sample_ssl_client_mbedtls_OBJECTS) +@MBEDTLS_TRUE@sample_ssl_client_mbedtls_DEPENDENCIES = libevent.la \ +@MBEDTLS_TRUE@ libevent_mbedtls.la $(am__DEPENDENCIES_1) +am_sample_time_test_OBJECTS = sample/time-test.$(OBJEXT) +sample_time_test_OBJECTS = $(am_sample_time_test_OBJECTS) +sample_time_test_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la +am_sample_watch_timing_OBJECTS = sample/watch-timing.$(OBJEXT) +sample_watch_timing_OBJECTS = $(am_sample_watch_timing_OBJECTS) +sample_watch_timing_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la +am_sample_ws_chat_server_OBJECTS = sample/ws-chat-server.$(OBJEXT) +sample_ws_chat_server_OBJECTS = $(am_sample_ws_chat_server_OBJECTS) +sample_ws_chat_server_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la +am_test_bench_OBJECTS = test/bench.$(OBJEXT) +test_bench_OBJECTS = $(am_test_bench_OBJECTS) +test_bench_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la +am_test_bench_cascade_OBJECTS = test/bench_cascade.$(OBJEXT) +test_bench_cascade_OBJECTS = $(am_test_bench_cascade_OBJECTS) +test_bench_cascade_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la +am_test_bench_http_OBJECTS = test/bench_http.$(OBJEXT) +test_bench_http_OBJECTS = $(am_test_bench_http_OBJECTS) +test_bench_http_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent.la +am_test_bench_httpclient_OBJECTS = test/bench_httpclient.$(OBJEXT) +test_bench_httpclient_OBJECTS = $(am_test_bench_httpclient_OBJECTS) +test_bench_httpclient_DEPENDENCIES = $(am__DEPENDENCIES_1) \ + libevent_core.la +am__test_regress_SOURCES_DIST = test/regress.c test/regress.gen.c \ + test/regress.gen.h test/regress_buffer.c \ + test/regress_bufferevent.c test/regress_dns.c \ + test/regress_et.c test/regress_finalize.c test/regress_http.c \ + test/regress_http.h test/regress_listener.c \ + test/regress_main.c test/regress_minheap.c test/regress_rpc.c \ + test/regress_testutils.c test/regress_testutils.h \ + test/regress_util.c test/regress_watch.c test/regress_ws.c \ + test/regress_ws.h test/regress_timer_timeout.c test/tinytest.c \ + test/regress_thread.c test/regress_zlib.c test/regress_iocp.c \ + test/regress_openssl.c test/regress_mbedtls.c +@BUILD_WIN32_FALSE@@PTHREADS_TRUE@am__objects_15 = test/regress-regress_thread.$(OBJEXT) +@BUILD_WIN32_TRUE@@THREADS_TRUE@am__objects_15 = test/regress-regress_thread.$(OBJEXT) +@PTHREADS_TRUE@@THREADS_FALSE@am__objects_15 = test/regress-regress_thread.$(OBJEXT) +@ZLIB_REGRESS_TRUE@am__objects_16 = \ +@ZLIB_REGRESS_TRUE@ test/regress-regress_zlib.$(OBJEXT) +@BUILD_WIN32_TRUE@am__objects_17 = \ +@BUILD_WIN32_TRUE@ test/regress-regress_iocp.$(OBJEXT) +@OPENSSL_TRUE@am__objects_18 = test/regress-regress_openssl.$(OBJEXT) +@MBEDTLS_TRUE@am__objects_19 = test/regress-regress_mbedtls.$(OBJEXT) +am_test_regress_OBJECTS = test/regress-regress.$(OBJEXT) \ + test/regress-regress.gen.$(OBJEXT) \ + test/regress-regress_buffer.$(OBJEXT) \ + test/regress-regress_bufferevent.$(OBJEXT) \ + test/regress-regress_dns.$(OBJEXT) \ + test/regress-regress_et.$(OBJEXT) \ + test/regress-regress_finalize.$(OBJEXT) \ + test/regress-regress_http.$(OBJEXT) \ + test/regress-regress_listener.$(OBJEXT) \ + test/regress-regress_main.$(OBJEXT) \ + test/regress-regress_minheap.$(OBJEXT) \ + test/regress-regress_rpc.$(OBJEXT) \ + test/regress-regress_testutils.$(OBJEXT) \ + test/regress-regress_util.$(OBJEXT) \ + test/regress-regress_watch.$(OBJEXT) \ + test/regress-regress_ws.$(OBJEXT) \ + test/regress-regress_timer_timeout.$(OBJEXT) \ + test/regress-tinytest.$(OBJEXT) $(am__objects_15) \ + $(am__objects_16) $(am__objects_17) $(am__objects_18) \ + $(am__objects_19) +test_regress_OBJECTS = $(am_test_regress_OBJECTS) +am__DEPENDENCIES_3 = $(am__append_19) +@OPENSSL_TRUE@am__DEPENDENCIES_4 = libevent_openssl.la \ +@OPENSSL_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +@MBEDTLS_TRUE@am__DEPENDENCIES_5 = libevent_mbedtls.la \ +@MBEDTLS_TRUE@ $(am__DEPENDENCIES_1) +test_regress_DEPENDENCIES = $(am__DEPENDENCIES_1) libevent_core.la \ + libevent_extra.la $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) +test_regress_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(test_regress_LDFLAGS) $(LDFLAGS) -o $@ +am_test_test_changelist_OBJECTS = test/test-changelist.$(OBJEXT) +test_test_changelist_OBJECTS = $(am_test_test_changelist_OBJECTS) +test_test_changelist_DEPENDENCIES = libevent_core.la +am_test_test_closed_OBJECTS = test/test-closed.$(OBJEXT) +test_test_closed_OBJECTS = $(am_test_test_closed_OBJECTS) +test_test_closed_DEPENDENCIES = libevent_core.la +am_test_test_dumpevents_OBJECTS = test/test-dumpevents.$(OBJEXT) +test_test_dumpevents_OBJECTS = $(am_test_test_dumpevents_OBJECTS) +test_test_dumpevents_DEPENDENCIES = libevent_core.la +am_test_test_eof_OBJECTS = test/test-eof.$(OBJEXT) +test_test_eof_OBJECTS = $(am_test_test_eof_OBJECTS) +test_test_eof_DEPENDENCIES = libevent_core.la +am_test_test_fdleak_OBJECTS = test/test-fdleak.$(OBJEXT) +test_test_fdleak_OBJECTS = $(am_test_test_fdleak_OBJECTS) +test_test_fdleak_DEPENDENCIES = libevent_core.la +am_test_test_init_OBJECTS = test/test-init.$(OBJEXT) +test_test_init_OBJECTS = $(am_test_test_init_OBJECTS) +test_test_init_DEPENDENCIES = libevent_core.la +am__test_test_kq_collision_SOURCES_DIST = test/test-kq-collision.c +@KQUEUE_BACKEND_TRUE@@PTHREADS_TRUE@am_test_test_kq_collision_OBJECTS = test/test_kq_collision-test-kq-collision.$(OBJEXT) +test_test_kq_collision_OBJECTS = $(am_test_test_kq_collision_OBJECTS) +@KQUEUE_BACKEND_TRUE@@PTHREADS_TRUE@test_test_kq_collision_DEPENDENCIES = \ +@KQUEUE_BACKEND_TRUE@@PTHREADS_TRUE@ libevent_core.la \ +@KQUEUE_BACKEND_TRUE@@PTHREADS_TRUE@ libevent_pthreads.la +test_test_kq_collision_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(AM_CFLAGS) $(CFLAGS) $(test_test_kq_collision_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_test_test_ratelim_OBJECTS = test/test-ratelim.$(OBJEXT) +test_test_ratelim_OBJECTS = $(am_test_test_ratelim_OBJECTS) +test_test_ratelim_DEPENDENCIES = libevent_core.la +am_test_test_time_OBJECTS = test/test-time.$(OBJEXT) +test_test_time_OBJECTS = $(am_test_test_time_OBJECTS) +test_test_time_DEPENDENCIES = libevent_core.la +am_test_test_weof_OBJECTS = test/test-weof.$(OBJEXT) +test_test_weof_OBJECTS = $(am_test_test_weof_OBJECTS) +test_test_weof_DEPENDENCIES = libevent_core.la +am__dist_bin_SCRIPTS_DIST = event_rpcgen.py +SCRIPTS = $(dist_bin_SCRIPTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(DEPDIR)/epoll_sub.Plo ./$(DEPDIR)/buffer.Plo \ + ./$(DEPDIR)/buffer_iocp.Plo ./$(DEPDIR)/bufferevent.Plo \ + ./$(DEPDIR)/bufferevent_async.Plo \ + ./$(DEPDIR)/bufferevent_filter.Plo \ + ./$(DEPDIR)/bufferevent_pair.Plo \ + ./$(DEPDIR)/bufferevent_ratelim.Plo \ + ./$(DEPDIR)/bufferevent_sock.Plo ./$(DEPDIR)/devpoll.Plo \ + ./$(DEPDIR)/epoll.Plo ./$(DEPDIR)/evdns.Plo \ + ./$(DEPDIR)/event.Plo ./$(DEPDIR)/event_iocp.Plo \ + ./$(DEPDIR)/event_tagging.Plo ./$(DEPDIR)/evmap.Plo \ + ./$(DEPDIR)/evport.Plo ./$(DEPDIR)/evrpc.Plo \ + ./$(DEPDIR)/evthread.Plo ./$(DEPDIR)/evthread_pthread.Plo \ + ./$(DEPDIR)/evthread_win32.Plo ./$(DEPDIR)/evutil.Plo \ + ./$(DEPDIR)/evutil_rand.Plo ./$(DEPDIR)/evutil_time.Plo \ + ./$(DEPDIR)/http.Plo ./$(DEPDIR)/kqueue.Plo \ + ./$(DEPDIR)/libevent_mbedtls_la-bufferevent_mbedtls.Plo \ + ./$(DEPDIR)/libevent_mbedtls_la-bufferevent_ssl.Plo \ + ./$(DEPDIR)/libevent_openssl_la-bufferevent_openssl.Plo \ + ./$(DEPDIR)/libevent_openssl_la-bufferevent_ssl.Plo \ + ./$(DEPDIR)/listener.Plo ./$(DEPDIR)/log.Plo \ + ./$(DEPDIR)/poll.Plo ./$(DEPDIR)/select.Plo \ + ./$(DEPDIR)/sha1.Plo ./$(DEPDIR)/signal.Plo \ + ./$(DEPDIR)/signalfd.Plo ./$(DEPDIR)/strlcpy.Plo \ + ./$(DEPDIR)/watch.Plo ./$(DEPDIR)/wepoll.Plo \ + ./$(DEPDIR)/win32select.Plo ./$(DEPDIR)/ws.Plo \ + sample/$(DEPDIR)/becat-becat.Po \ + sample/$(DEPDIR)/dns-example.Po \ + sample/$(DEPDIR)/event-read-fifo.Po \ + sample/$(DEPDIR)/hello-world.Po \ + sample/$(DEPDIR)/http-connect.Po \ + sample/$(DEPDIR)/http-server.Po \ + sample/$(DEPDIR)/https_client-hostcheck.Po \ + sample/$(DEPDIR)/https_client-https-client.Po \ + sample/$(DEPDIR)/https_client-openssl_hostname_validation.Po \ + sample/$(DEPDIR)/https_client_mbedtls-https-client.Po \ + sample/$(DEPDIR)/le_proxy-le-proxy.Po \ + sample/$(DEPDIR)/signal-test.Po \ + sample/$(DEPDIR)/ssl_client_mbedtls-ssl-client-mbedtls.Po \ + sample/$(DEPDIR)/time-test.Po sample/$(DEPDIR)/watch-timing.Po \ + sample/$(DEPDIR)/ws-chat-server.Po test/$(DEPDIR)/bench.Po \ + test/$(DEPDIR)/bench_cascade.Po test/$(DEPDIR)/bench_http.Po \ + test/$(DEPDIR)/bench_httpclient.Po \ + test/$(DEPDIR)/regress-regress.Po \ + test/$(DEPDIR)/regress-regress.gen.Po \ + test/$(DEPDIR)/regress-regress_buffer.Po \ + test/$(DEPDIR)/regress-regress_bufferevent.Po \ + test/$(DEPDIR)/regress-regress_dns.Po \ + test/$(DEPDIR)/regress-regress_et.Po \ + test/$(DEPDIR)/regress-regress_finalize.Po \ + test/$(DEPDIR)/regress-regress_http.Po \ + test/$(DEPDIR)/regress-regress_iocp.Po \ + test/$(DEPDIR)/regress-regress_listener.Po \ + test/$(DEPDIR)/regress-regress_main.Po \ + test/$(DEPDIR)/regress-regress_mbedtls.Po \ + test/$(DEPDIR)/regress-regress_minheap.Po \ + test/$(DEPDIR)/regress-regress_openssl.Po \ + test/$(DEPDIR)/regress-regress_rpc.Po \ + test/$(DEPDIR)/regress-regress_testutils.Po \ + test/$(DEPDIR)/regress-regress_thread.Po \ + test/$(DEPDIR)/regress-regress_timer_timeout.Po \ + test/$(DEPDIR)/regress-regress_util.Po \ + test/$(DEPDIR)/regress-regress_watch.Po \ + test/$(DEPDIR)/regress-regress_ws.Po \ + test/$(DEPDIR)/regress-regress_zlib.Po \ + test/$(DEPDIR)/regress-tinytest.Po \ + test/$(DEPDIR)/test-changelist.Po \ + test/$(DEPDIR)/test-closed.Po \ + test/$(DEPDIR)/test-dumpevents.Po test/$(DEPDIR)/test-eof.Po \ + test/$(DEPDIR)/test-fdleak.Po test/$(DEPDIR)/test-init.Po \ + test/$(DEPDIR)/test-ratelim.Po test/$(DEPDIR)/test-time.Po \ + test/$(DEPDIR)/test-weof.Po \ + test/$(DEPDIR)/test_kq_collision-test-kq-collision.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libevent_la_SOURCES) $(libevent_core_la_SOURCES) \ + $(libevent_extra_la_SOURCES) $(libevent_mbedtls_la_SOURCES) \ + $(libevent_openssl_la_SOURCES) $(libevent_pthreads_la_SOURCES) \ + $(sample_becat_SOURCES) $(sample_dns_example_SOURCES) \ + $(sample_event_read_fifo_SOURCES) \ + $(sample_hello_world_SOURCES) $(sample_http_connect_SOURCES) \ + $(sample_http_server_SOURCES) $(sample_https_client_SOURCES) \ + $(sample_https_client_mbedtls_SOURCES) \ + $(sample_le_proxy_SOURCES) $(sample_signal_test_SOURCES) \ + $(sample_ssl_client_mbedtls_SOURCES) \ + $(sample_time_test_SOURCES) $(sample_watch_timing_SOURCES) \ + $(sample_ws_chat_server_SOURCES) $(test_bench_SOURCES) \ + $(test_bench_cascade_SOURCES) $(test_bench_http_SOURCES) \ + $(test_bench_httpclient_SOURCES) $(test_regress_SOURCES) \ + $(test_test_changelist_SOURCES) $(test_test_closed_SOURCES) \ + $(test_test_dumpevents_SOURCES) $(test_test_eof_SOURCES) \ + $(test_test_fdleak_SOURCES) $(test_test_init_SOURCES) \ + $(test_test_kq_collision_SOURCES) $(test_test_ratelim_SOURCES) \ + $(test_test_time_SOURCES) $(test_test_weof_SOURCES) +DIST_SOURCES = $(am__libevent_la_SOURCES_DIST) \ + $(am__libevent_core_la_SOURCES_DIST) \ + $(libevent_extra_la_SOURCES) \ + $(am__libevent_mbedtls_la_SOURCES_DIST) \ + $(am__libevent_openssl_la_SOURCES_DIST) \ + $(am__libevent_pthreads_la_SOURCES_DIST) \ + $(am__sample_becat_SOURCES_DIST) $(sample_dns_example_SOURCES) \ + $(sample_event_read_fifo_SOURCES) \ + $(sample_hello_world_SOURCES) $(sample_http_connect_SOURCES) \ + $(sample_http_server_SOURCES) \ + $(am__sample_https_client_SOURCES_DIST) \ + $(am__sample_https_client_mbedtls_SOURCES_DIST) \ + $(am__sample_le_proxy_SOURCES_DIST) \ + $(sample_signal_test_SOURCES) \ + $(am__sample_ssl_client_mbedtls_SOURCES_DIST) \ + $(sample_time_test_SOURCES) $(sample_watch_timing_SOURCES) \ + $(sample_ws_chat_server_SOURCES) $(test_bench_SOURCES) \ + $(test_bench_cascade_SOURCES) $(test_bench_http_SOURCES) \ + $(test_bench_httpclient_SOURCES) \ + $(am__test_regress_SOURCES_DIST) \ + $(test_test_changelist_SOURCES) $(test_test_closed_SOURCES) \ + $(test_test_dumpevents_SOURCES) $(test_test_eof_SOURCES) \ + $(test_test_fdleak_SOURCES) $(test_test_init_SOURCES) \ + $(am__test_test_kq_collision_SOURCES_DIST) \ + $(test_test_ratelim_SOURCES) $(test_test_time_SOURCES) \ + $(test_test_weof_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +man3dir = $(mandir)/man3 +NROFF = nroff +MANS = $(man3_MANS) +DATA = $(pkgconfig_DATA) +am__include_HEADERS_DIST = include/evdns.h include/event.h \ + include/evhttp.h include/evrpc.h include/evutil.h +am__include_event2_HEADERS_DIST = include/event2/buffer.h \ + include/event2/buffer_compat.h include/event2/bufferevent.h \ + include/event2/bufferevent_compat.h \ + include/event2/bufferevent_struct.h include/event2/dns.h \ + include/event2/dns_compat.h include/event2/dns_struct.h \ + include/event2/event.h include/event2/event_compat.h \ + include/event2/event_struct.h include/event2/watch.h \ + include/event2/http.h include/event2/http_compat.h \ + include/event2/http_struct.h include/event2/keyvalq_struct.h \ + include/event2/listener.h include/event2/rpc.h \ + include/event2/rpc_compat.h include/event2/rpc_struct.h \ + include/event2/tag.h include/event2/tag_compat.h \ + include/event2/thread.h include/event2/util.h \ + include/event2/ws.h include/event2/visibility.h \ + include/event2/bufferevent_ssl.h +am__noinst_HEADERS_DIST = include/event2/buffer.h \ + include/event2/buffer_compat.h include/event2/bufferevent.h \ + include/event2/bufferevent_compat.h \ + include/event2/bufferevent_struct.h include/event2/dns.h \ + include/event2/dns_compat.h include/event2/dns_struct.h \ + include/event2/event.h include/event2/event_compat.h \ + include/event2/event_struct.h include/event2/watch.h \ + include/event2/http.h include/event2/http_compat.h \ + include/event2/http_struct.h include/event2/keyvalq_struct.h \ + include/event2/listener.h include/event2/rpc.h \ + include/event2/rpc_compat.h include/event2/rpc_struct.h \ + include/event2/tag.h include/event2/tag_compat.h \ + include/event2/thread.h include/event2/util.h \ + include/event2/ws.h include/event2/visibility.h \ + include/event2/bufferevent_ssl.h sample/hostcheck.h \ + sample/openssl_hostname_validation.h test/regress.h \ + test/regress_thread.h test/tinytest.h test/tinytest_local.h \ + test/tinytest_macros.h WIN32-Code/getopt.h WIN32-Code/getopt.c \ + WIN32-Code/getopt_long.c WIN32-Code/tree.h \ + bufferevent-internal.h changelist-internal.h \ + compat/sys/queue.h compat/sys/tree.h defer-internal.h \ + epolltable-internal.h evbuffer-internal.h event-internal.h \ + evmap-internal.h evrpc-internal.h evsignal-internal.h \ + evthread-internal.h evdns-internal.h ht-internal.h \ + http-internal.h iocp-internal.h ipv6-internal.h \ + kqueue-internal.h log-internal.h minheap-internal.h \ + mm-internal.h ratelim-internal.h strlcpy-internal.h \ + time-internal.h util-internal.h openssl-compat.h \ + mbedtls-compat.h sha1.h ssl-compat.h wepoll.h include/evdns.h \ + include/event.h include/evhttp.h include/evrpc.h \ + include/evutil.h +HEADERS = $(include_HEADERS) $(include_event2_HEADERS) \ + $(nodist_include_event2_HEADERS) $(nodist_noinst_HEADERS) \ + $(noinst_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + config.h.in evconfig-private.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +AM_RECURSIVE_TARGETS = cscope check recheck +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + $$am__collect_skipped_logs \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer-defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(IGNORE_SKIPPED_LOGS)'; then \ + am__collect_skipped_logs='--collect-skipped-logs no'; \ +else \ + am__collect_skipped_logs=''; \ +fi; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/doxygen.am $(srcdir)/evconfig-private.h.in \ + $(srcdir)/include/include.am $(srcdir)/libevent.pc.in \ + $(srcdir)/libevent_core.pc.in $(srcdir)/libevent_extra.pc.in \ + $(srcdir)/libevent_mbedtls.pc.in \ + $(srcdir)/libevent_openssl.pc.in \ + $(srcdir)/libevent_pthreads.pc.in $(srcdir)/sample/include.am \ + $(srcdir)/test/include.am $(top_srcdir)/build-aux/compile \ + $(top_srcdir)/build-aux/config.guess \ + $(top_srcdir)/build-aux/config.sub \ + $(top_srcdir)/build-aux/depcomp \ + $(top_srcdir)/build-aux/install-sh \ + $(top_srcdir)/build-aux/ltmain.sh \ + $(top_srcdir)/build-aux/missing \ + $(top_srcdir)/build-aux/test-driver ChangeLog README.md \ + build-aux/compile build-aux/config.guess build-aux/config.sub \ + build-aux/depcomp build-aux/install-sh build-aux/ltmain.sh \ + build-aux/missing epoll_sub.c +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -700 -exec chmod u+rwx {} ';' \ + ; rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = -9 +DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = \ + find . \( -type f -a \! \ + \( -name .nfs* -o -name .smb* -o -name .__afs* \) \) -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BREW = @BREW@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CMAKE_DEBUG_POSTFIX = @CMAKE_DEBUG_POSTFIX@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOXYGEN_PAPER_SIZE = @DOXYGEN_PAPER_SIZE@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +DX_CONFIG = @DX_CONFIG@ +DX_DOCDIR = @DX_DOCDIR@ +DX_DOT = @DX_DOT@ +DX_DOXYGEN = @DX_DOXYGEN@ +DX_DVIPS = @DX_DVIPS@ +DX_EGREP = @DX_EGREP@ +DX_ENV = @DX_ENV@ +DX_FLAG_chi = @DX_FLAG_chi@ +DX_FLAG_chm = @DX_FLAG_chm@ +DX_FLAG_doc = @DX_FLAG_doc@ +DX_FLAG_dot = @DX_FLAG_dot@ +DX_FLAG_html = @DX_FLAG_html@ +DX_FLAG_man = @DX_FLAG_man@ +DX_FLAG_pdf = @DX_FLAG_pdf@ +DX_FLAG_ps = @DX_FLAG_ps@ +DX_FLAG_rtf = @DX_FLAG_rtf@ +DX_FLAG_xml = @DX_FLAG_xml@ +DX_HHC = @DX_HHC@ +DX_LATEX = @DX_LATEX@ +DX_MAKEINDEX = @DX_MAKEINDEX@ +DX_PDFLATEX = @DX_PDFLATEX@ +DX_PERL = @DX_PERL@ +DX_PROJECT = @DX_PROJECT@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EV_LIB_GDI = @EV_LIB_GDI@ +EV_LIB_WS32 = @EV_LIB_WS32@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBEVENT_CFLAGS = @LIBEVENT_CFLAGS@ +LIBEVENT_CPPFLAGS = @LIBEVENT_CPPFLAGS@ +LIBEVENT_GC_SECTIONS = @LIBEVENT_GC_SECTIONS@ +LIBEVENT_LDFLAGS = @LIBEVENT_LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MBEDTLS_INCS = @MBEDTLS_INCS@ +MBEDTLS_LIBS = @MBEDTLS_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OPENSSL_INCS = @OPENSSL_INCS@ +OPENSSL_LIBADD = @OPENSSL_LIBADD@ +OPENSSL_LIBS = @OPENSSL_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CXX = @PTHREAD_CXX@ +PTHREAD_LIBS = @PTHREAD_LIBS@ $(am__append_19) +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__rm_f_notfound = @am__rm_f_notfound@ +am__tar = @am__tar@ +am__untar = @am__untar@ +am__xargs_n = @am__xargs_n@ +ax_pthread_config = @ax_pthread_config@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +ACLOCAL_AMFLAGS = -I m4 + +# This is the "Release" of the Libevent ABI. It takes precedence over +# the VERSION_INFO, so that two versions of Libevent with the same +# "Release" are never binary-compatible. +# +# This number incremented once for the 2.0 release candidate, and +# will increment for each series until we revise our interfaces enough +# that we can seriously expect ABI compatibility between series. +# +RELEASE = -release 2.2 + +# This is the version info for the libevent binary API. It has three +# numbers: +# Current -- the number of the binary API that we're implementing +# Revision -- which iteration of the implementation of the binary +# API are we supplying? +# Age -- How many previous binary API versions do we also +# support? +# +# To increment a VERSION_INFO (current:revision:age): +# If the ABI didn't change: +# Return (current:revision+1:age) +# If the ABI changed, but it's backward-compatible: +# Return (current+1:0:age+1) +# If the ABI changed and it isn't backward-compatible: +# Return (current+1:0:0) +# +# Once an RC is out, DO NOT MAKE ANY ABI-BREAKING CHANGES IN THAT SERIES +# UNLESS YOU REALLY REALLY HAVE TO. +VERSION_INFO = 1:1:0 + +# History: RELEASE VERSION_INFO +# 2.0.1-alpha -- 2.0 1:0:0 +# 2.0.2-alpha -- 2:0:0 +# 2.0.3-alpha -- 2:0:0 (should have incremented; didn't.) +# 2.0.4-alpha -- 3:0:0 +# 2.0.5-beta -- 4:0:0 +# 2.0.6-rc -- 2.0 2:0:0 +# 2.0.7-rc -- 2.0 3:0:1 +# 2.0.8-rc -- 2.0 4:0:2 +# 2.0.9-rc -- 2.0 5:0:0 (ABI changed slightly) +# 2.0.10-stable-- 2.0 5:1:0 (No ABI change) +# 2.0.11-stable-- 2.0 6:0:1 (ABI changed, backward-compatible) +# 2.0.12-stable-- 2.0 6:1:1 (No ABI change) +# 2.0.13-stable-- 2.0 6:2:1 (No ABI change) +# 2.0.14-stable-- 2.0 6:3:1 (No ABI change) +# 2.0.15-stable-- 2.0 6:3:1 (Forgot to update :( ) +# 2.0.16-stable-- 2.0 6:4:1 (No ABI change) +# 2.0.17-stable-- 2.0 6:5:1 (No ABI change) +# 2.0.18-stable-- 2.0 6:6:1 (No ABI change) +# 2.0.19-stable-- 2.0 6:7:1 (No ABI change) +# 2.0.20-stable-- 2.0 6:8:1 (No ABI change) +# 2.0.21-stable-- 2.0 6:9:1 (No ABI change) +# +# For Libevent 2.1: +# 2.1.1-alpha -- 2.1 1:0:0 +# 2.1.2-alpha -- 2.1 1:0:0 (should have been 2:0:1) +# 2.1.3-alpha -- 2.1 3:0:0 (ABI changed slightly) +# 2.1.4-alpha -- 2.1 4:0:0 (ABI changed slightly) +# 2.1.5-beta -- 2.1 5:0:0 (ABI changed slightly) +# 2.1.6-beta -- 2.1 6:0:0 (ABI changed slightly) +# 2.1.7-beta -- 2.1 6:1:0 (ABI changed slightly) +# 2.1.8-stable-- 2.1 6:2:0 (ABI changed slightly) +# +# For Libevent 2.2: +# 2.2.1-alpha -- 2.2 1:0:0 +# 2.2.2-alpha -- 2.2 1:1:0 (No ABI change) + +# ABI version history for this package effectively restarts every time +# we change RELEASE. Version 1.4.x had RELEASE of 1.4. +# +# Ideally, we would not be using RELEASE at all; instead we could just +# use the VERSION_INFO field to label our backward-incompatible ABI +# changes, and those would be few and far between. Unfortunately, +# Libevent still exposes far too many volatile structures in its +# headers, so we pretty much have to assume that most development +# series will break ABI compatibility. For now, it's simplest just to +# keep incrementing the RELEASE between series and resetting VERSION_INFO. +# +# Eventually, when we get to the point where the structures in the +# headers are all non-changing (or not there at all!), we can shift to +# a more normal worldview where backward-incompatible ABI changes are +# nice and rare. For the next couple of years, though, 'struct event' +# is user-visible, and so we can pretty much guarantee that release +# series won't be binary-compatible. +@INSTALL_LIBEVENT_TRUE@dist_bin_SCRIPTS = event_rpcgen.py +pkgconfigdir = $(libdir)/pkgconfig +LIBEVENT_PKGCONFIG = libevent.pc libevent_core.pc libevent_extra.pc \ + $(am__append_2) $(am__append_4) $(am__append_6) + +# These sources are conditionally added by configure.ac or conditionally +# included from other files. +PLATFORM_DEPENDENT_SRC = \ + arc4random.c \ + bufferevent_ssl.c \ + epoll_sub.c \ + PrivacyInfo.xcprivacy \ + test/regress_ssl.c + +CMAKE_FILES = \ + cmake/AddCompilerFlags.cmake \ + cmake/AddLinkerFlags.cmake \ + cmake/AddEventLibrary.cmake \ + cmake/CheckConstExists.cmake \ + cmake/CheckFileOffsetBits.c \ + cmake/CheckFileOffsetBits.cmake \ + cmake/CheckFunctionKeywords.cmake \ + cmake/CheckPrototypeDefinition.c.in \ + cmake/CheckPrototypeDefinition.cmake \ + cmake/CheckWorkingKqueue.cmake \ + cmake/CodeCoverage.cmake \ + cmake/COPYING-CMAKE-SCRIPTS \ + cmake/Copyright.txt \ + cmake/FindMbedTLS.cmake \ + cmake/LibeventConfig.cmake.in \ + cmake/LibeventConfigVersion.cmake.in \ + cmake/Macros.cmake \ + cmake/Uninstall.cmake.in \ + cmake/UseDoxygen.cmake \ + cmake/VersionViaGit.cmake \ + event-config.h.cmake \ + evconfig-private.h.cmake \ + CMakeLists.txt + +DOCUMENTATION_FILES = \ + Documentation/Building.md + +EXTRA_DIST = ChangeLog-1.4 ChangeLog-2.0 ChangeLog-2.1 ChangeLog \ + Doxyfile LICENSE autogen.sh event_rpcgen.py libevent.pc.in \ + make-event-config.sed whatsnew-2.0.txt whatsnew-2.1.txt \ + README.md $(CMAKE_FILES) $(DOCUMENTATION_FILES) \ + $(PLATFORM_DEPENDENT_SRC) sample/ws-chat.html \ + test/check-dumpevents.py test/regress.gen.c test/regress.gen.h \ + test/regress.rpc test/rpcgen_wrapper.sh \ + test/print-winsock-errors.c test/test.sh +LIBEVENT_LIBS_LA = libevent.la libevent_core.la libevent_extra.la \ + $(am__append_1) $(am__append_3) $(am__append_5) +@INSTALL_LIBEVENT_TRUE@lib_LTLIBRARIES = $(LIBEVENT_LIBS_LA) +@INSTALL_LIBEVENT_TRUE@pkgconfig_DATA = $(LIBEVENT_PKGCONFIG) +@INSTALL_LIBEVENT_FALSE@noinst_LTLIBRARIES = $(LIBEVENT_LIBS_LA) +EXTRA_SOURCE = +noinst_HEADERS = $(am__append_9) $(am__append_12) test/regress.h \ + test/regress_thread.h test/tinytest.h test/tinytest_local.h \ + test/tinytest_macros.h WIN32-Code/getopt.h WIN32-Code/getopt.c \ + WIN32-Code/getopt_long.c WIN32-Code/tree.h \ + bufferevent-internal.h changelist-internal.h \ + compat/sys/queue.h compat/sys/tree.h defer-internal.h \ + epolltable-internal.h evbuffer-internal.h event-internal.h \ + evmap-internal.h evrpc-internal.h evsignal-internal.h \ + evthread-internal.h evdns-internal.h ht-internal.h \ + http-internal.h iocp-internal.h ipv6-internal.h \ + kqueue-internal.h log-internal.h minheap-internal.h \ + mm-internal.h ratelim-internal.h ratelim-internal.h \ + strlcpy-internal.h time-internal.h util-internal.h \ + openssl-compat.h mbedtls-compat.h sha1.h ssl-compat.h wepoll.h \ + $(am__append_38) +CLEANFILES = test/rpcgen-attempted +DISTCLEANFILES = test/regress.gen.c test/regress.gen.h *~ libevent.pc \ + libevent_core.pc libevent_extra.pc \ + ./include/event2/event-config.h +BUILT_SOURCES = $(am__append_18) include/event2/event-config.h +include_event2dir = $(includedir)/event2 +EVENT2_EXPORT = include/event2/buffer.h include/event2/buffer_compat.h \ + include/event2/bufferevent.h \ + include/event2/bufferevent_compat.h \ + include/event2/bufferevent_struct.h include/event2/dns.h \ + include/event2/dns_compat.h include/event2/dns_struct.h \ + include/event2/event.h include/event2/event_compat.h \ + include/event2/event_struct.h include/event2/watch.h \ + include/event2/http.h include/event2/http_compat.h \ + include/event2/http_struct.h include/event2/keyvalq_struct.h \ + include/event2/listener.h include/event2/rpc.h \ + include/event2/rpc_compat.h include/event2/rpc_struct.h \ + include/event2/tag.h include/event2/tag_compat.h \ + include/event2/thread.h include/event2/util.h \ + include/event2/ws.h include/event2/visibility.h \ + $(am__append_7) $(am__append_8) +@INSTALL_LIBEVENT_TRUE@include_event2_HEADERS = $(EVENT2_EXPORT) +@INSTALL_LIBEVENT_TRUE@nodist_include_event2_HEADERS = include/event2/event-config.h +@INSTALL_LIBEVENT_FALSE@nodist_noinst_HEADERS = include/event2/event-config.h +SAMPLES = sample/dns-example sample/event-read-fifo sample/hello-world \ + sample/http-server sample/http-connect sample/signal-test \ + sample/time-test sample/ws-chat-server sample/watch-timing \ + $(am__append_10) $(am__append_13) +@OPENSSL_TRUE@sample_le_proxy_SOURCES = sample/le-proxy.c +@OPENSSL_TRUE@sample_le_proxy_LDADD = libevent.la libevent_openssl.la $(OPENSSL_LIBS) $(OPENSSL_LIBADD) +@OPENSSL_TRUE@sample_le_proxy_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS) +@OPENSSL_TRUE@sample_becat_SOURCES = sample/becat.c +@OPENSSL_TRUE@sample_becat_LDADD = libevent.la libevent_openssl.la $(OPENSSL_LIBS) $(OPENSSL_LIBADD) +@OPENSSL_TRUE@sample_becat_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS) +@OPENSSL_TRUE@sample_https_client_SOURCES = \ +@OPENSSL_TRUE@ sample/https-client.c \ +@OPENSSL_TRUE@ sample/hostcheck.c \ +@OPENSSL_TRUE@ sample/openssl_hostname_validation.c + +@OPENSSL_TRUE@sample_https_client_LDADD = libevent.la \ +@OPENSSL_TRUE@ libevent_openssl.la $(OPENSSL_LIBS) \ +@OPENSSL_TRUE@ $(OPENSSL_LIBADD) $(am__append_11) +@OPENSSL_TRUE@sample_https_client_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS) +@MBEDTLS_TRUE@sample_ssl_client_mbedtls_SOURCES = sample/ssl-client-mbedtls.c +@MBEDTLS_TRUE@sample_ssl_client_mbedtls_LDADD = libevent.la libevent_mbedtls.la $(MBEDTLS_LIBS) $(MBEDTLS_LIBADD) +@MBEDTLS_TRUE@sample_ssl_client_mbedtls_CPPFLAGS = $(AM_CPPFLAGS) $(MBEDTLS_INCS) +@MBEDTLS_TRUE@sample_https_client_mbedtls_SOURCES = sample/https-client.c +@MBEDTLS_TRUE@sample_https_client_mbedtls_LDADD = libevent.la libevent_mbedtls.la $(MBEDTLS_LIBS) $(MBEDTLS_LIBADD) +@MBEDTLS_TRUE@sample_https_client_mbedtls_CPPFLAGS = $(AM_CPPFLAGS) $(MBEDTLS_INCS) -DUSE_MBEDTLS +sample_event_read_fifo_SOURCES = sample/event-read-fifo.c +sample_event_read_fifo_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la +sample_time_test_SOURCES = sample/time-test.c +sample_time_test_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la +sample_signal_test_SOURCES = sample/signal-test.c +sample_signal_test_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la +sample_dns_example_SOURCES = sample/dns-example.c +sample_dns_example_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la +sample_hello_world_SOURCES = sample/hello-world.c +sample_hello_world_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la +sample_http_server_SOURCES = sample/http-server.c +sample_http_server_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la +sample_http_connect_SOURCES = sample/http-connect.c +sample_http_connect_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la +sample_watch_timing_SOURCES = sample/watch-timing.c +sample_watch_timing_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la -lm +sample_ws_chat_server_SOURCES = sample/ws-chat-server.c +sample_ws_chat_server_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la -lm +TESTPROGRAMS = test/bench test/bench_cascade test/bench_http \ + test/bench_httpclient test/test-changelist \ + test/test-dumpevents test/test-eof test/test-closed \ + test/test-fdleak test/test-init test/test-ratelim \ + test/test-time test/test-weof $(am__append_15) test/regress +TESTS = \ + test_runner_epoll \ + test_runner_select \ + test_runner_kqueue \ + test_runner_evport \ + test_runner_devpoll \ + test_runner_poll \ + test_runner_win32 \ + test_runner_wepoll \ + test_runner_timerfd \ + test_runner_changelist \ + test_runner_timerfd_changelist \ + test_runner_signalfd + +LOG_COMPILER = true +TESTS_COMPILER = true +test_test_init_SOURCES = test/test-init.c +test_test_init_LDADD = libevent_core.la +test_test_dumpevents_SOURCES = test/test-dumpevents.c +test_test_dumpevents_LDADD = libevent_core.la +test_test_eof_SOURCES = test/test-eof.c +test_test_eof_LDADD = libevent_core.la +test_test_closed_SOURCES = test/test-closed.c +test_test_closed_LDADD = libevent_core.la +test_test_changelist_SOURCES = test/test-changelist.c +test_test_changelist_LDADD = libevent_core.la +test_test_weof_SOURCES = test/test-weof.c +test_test_weof_LDADD = libevent_core.la +test_test_time_SOURCES = test/test-time.c +test_test_time_LDADD = libevent_core.la +test_test_ratelim_SOURCES = test/test-ratelim.c +test_test_ratelim_LDADD = libevent_core.la -lm +test_test_fdleak_SOURCES = test/test-fdleak.c +test_test_fdleak_LDADD = libevent_core.la +@KQUEUE_BACKEND_TRUE@@PTHREADS_TRUE@test_test_kq_collision_SOURCES = test/test-kq-collision.c +@KQUEUE_BACKEND_TRUE@@PTHREADS_TRUE@test_test_kq_collision_LDADD = libevent_core.la libevent_pthreads.la +@KQUEUE_BACKEND_TRUE@@PTHREADS_TRUE@test_test_kq_collision_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) -Itest +@KQUEUE_BACKEND_TRUE@@PTHREADS_TRUE@test_test_kq_collision_LDFLAGS = $(PTHREAD_CFLAGS) +test_regress_SOURCES = test/regress.c test/regress.gen.c \ + test/regress.gen.h test/regress_buffer.c \ + test/regress_bufferevent.c test/regress_dns.c \ + test/regress_et.c test/regress_finalize.c test/regress_http.c \ + test/regress_http.h test/regress_listener.c \ + test/regress_main.c test/regress_minheap.c test/regress_rpc.c \ + test/regress_testutils.c test/regress_testutils.h \ + test/regress_util.c test/regress_watch.c test/regress_ws.c \ + test/regress_ws.h test/regress_timer_timeout.c test/tinytest.c \ + $(regress_thread_SOURCES) $(regress_zlib_SOURCES) \ + $(am__append_20) $(am__append_21) $(am__append_24) +@BUILD_WIN32_TRUE@@THREADS_TRUE@regress_thread_SOURCES = test/regress_thread.c +@PTHREADS_TRUE@regress_thread_SOURCES = test/regress_thread.c +@ZLIB_REGRESS_TRUE@regress_zlib_SOURCES = test/regress_zlib.c +test_regress_LDADD = $(LIBEVENT_GC_SECTIONS) libevent_core.la \ + libevent_extra.la $(PTHREAD_LIBS) $(ZLIB_LIBS) \ + $(am__append_23) $(am__append_26) +test_regress_CPPFLAGS = $(AM_CPPFLAGS) $(PTHREAD_CFLAGS) \ + $(ZLIB_CFLAGS) -DTINYTEST_LOCAL -Itest $(am__append_22) \ + $(am__append_25) +test_regress_LDFLAGS = $(PTHREAD_CFLAGS) +test_bench_SOURCES = test/bench.c +test_bench_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la +test_bench_cascade_SOURCES = test/bench_cascade.c +test_bench_cascade_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la +test_bench_http_SOURCES = test/bench_http.c +test_bench_http_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la +test_bench_httpclient_SOURCES = test/bench_httpclient.c +test_bench_httpclient_LDADD = $(LIBEVENT_GC_SECTIONS) libevent_core.la +@BUILD_WIN32_FALSE@SYS_CORE_LIBS = +@BUILD_WIN32_TRUE@SYS_CORE_LIBS = -liphlpapi +@BUILD_WIN32_FALSE@SYS_LIBS = +@BUILD_WIN32_TRUE@SYS_LIBS = -lws2_32 -lshell32 -ladvapi32 -lbcrypt +@BUILD_WIN32_FALSE@SYS_SRC = $(am__append_28) $(am__append_29) \ +@BUILD_WIN32_FALSE@ $(am__append_30) $(am__append_31) \ +@BUILD_WIN32_FALSE@ $(am__append_32) $(am__append_33) \ +@BUILD_WIN32_FALSE@ $(am__append_34) $(am__append_35) \ +@BUILD_WIN32_FALSE@ $(am__append_36) $(am__append_37) +@BUILD_WIN32_TRUE@SYS_SRC = win32select.c buffer_iocp.c event_iocp.c \ +@BUILD_WIN32_TRUE@ bufferevent_async.c $(am__append_27) \ +@BUILD_WIN32_TRUE@ $(am__append_28) $(am__append_29) \ +@BUILD_WIN32_TRUE@ $(am__append_30) $(am__append_31) \ +@BUILD_WIN32_TRUE@ $(am__append_32) $(am__append_33) \ +@BUILD_WIN32_TRUE@ $(am__append_34) $(am__append_35) \ +@BUILD_WIN32_TRUE@ $(am__append_36) $(am__append_37) +@BUILD_WIN32_FALSE@SYS_INCLUDES = +@BUILD_WIN32_TRUE@SYS_INCLUDES = -IWIN32-Code +CORE_SRC = \ + buffer.c \ + bufferevent.c \ + bufferevent_filter.c \ + bufferevent_pair.c \ + bufferevent_ratelim.c \ + bufferevent_sock.c \ + event.c \ + evmap.c \ + evthread.c \ + evutil.c \ + evutil_rand.c \ + evutil_time.c \ + watch.c \ + listener.c \ + log.c \ + $(SYS_SRC) + +EXTRAS_SRC = \ + evdns.c \ + event_tagging.c \ + evrpc.c \ + sha1.c \ + ws.c \ + http.c + +@BUILD_WITH_NO_UNDEFINED_FALSE@NO_UNDEFINED = +@BUILD_WITH_NO_UNDEFINED_TRUE@NO_UNDEFINED = -no-undefined +@BUILD_WITH_NO_UNDEFINED_FALSE@MAYBE_CORE = +@BUILD_WITH_NO_UNDEFINED_TRUE@MAYBE_CORE = libevent_core.la +AM_CFLAGS = $(LIBEVENT_CFLAGS) +AM_CPPFLAGS = -I$(srcdir)/compat -I./include -I$(srcdir)/include $(SYS_INCLUDES) $(LIBEVENT_CPPFLAGS) +AM_LDFLAGS = $(LIBEVENT_LDFLAGS) +GENERIC_LDFLAGS = -version-info $(VERSION_INFO) $(RELEASE) $(NO_UNDEFINED) $(AM_LDFLAGS) +libevent_la_SOURCES = $(CORE_SRC) $(EXTRAS_SRC) +libevent_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS) $(SYS_CORE_LIBS) +libevent_la_LDFLAGS = $(GENERIC_LDFLAGS) +libevent_core_la_SOURCES = $(CORE_SRC) +libevent_core_la_LIBADD = @LTLIBOBJS@ $(SYS_LIBS) $(SYS_CORE_LIBS) +libevent_core_la_LDFLAGS = $(GENERIC_LDFLAGS) +@PTHREADS_TRUE@libevent_pthreads_la_SOURCES = evthread_pthread.c +@PTHREADS_TRUE@libevent_pthreads_la_LIBADD = $(MAYBE_CORE) +@PTHREADS_TRUE@libevent_pthreads_la_LDFLAGS = $(GENERIC_LDFLAGS) +libevent_extra_la_SOURCES = $(EXTRAS_SRC) +libevent_extra_la_LIBADD = $(MAYBE_CORE) $(SYS_LIBS) +libevent_extra_la_LDFLAGS = $(GENERIC_LDFLAGS) +@OPENSSL_TRUE@libevent_openssl_la_SOURCES = bufferevent_openssl.c bufferevent_ssl.c +@OPENSSL_TRUE@libevent_openssl_la_LIBADD = $(MAYBE_CORE) $(OPENSSL_LIBS) +@OPENSSL_TRUE@libevent_openssl_la_LDFLAGS = $(GENERIC_LDFLAGS) +@OPENSSL_TRUE@libevent_openssl_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENSSL_INCS) +@MBEDTLS_TRUE@libevent_mbedtls_la_SOURCES = bufferevent_mbedtls.c bufferevent_ssl.c +@MBEDTLS_TRUE@libevent_mbedtls_la_LIBADD = $(MAYBE_CORE) $(MBEDTLS_LIBS) +@MBEDTLS_TRUE@libevent_mbedtls_la_LDFLAGS = $(GENERIC_LDFLAGS) +@MBEDTLS_TRUE@libevent_mbedtls_la_CPPFLAGS = $(AM_CPPFLAGS) $(MBEDTLS_INCS) +EVENT1_HDRS = \ + include/evdns.h \ + include/event.h \ + include/evhttp.h \ + include/evrpc.h \ + include/evutil.h + +@INSTALL_LIBEVENT_TRUE@include_HEADERS = $(EVENT1_HDRS) +@ENABLE_DOXYGEN_MAN_TRUE@@ENABLE_DOXYGEN_TRUE@man3_MAN_DIR = @DX_DOCDIR@/man/man3 + +# integrate doxygen with automake targets +@ENABLE_DOXYGEN_MAN_TRUE@@ENABLE_DOXYGEN_TRUE@man3_MANS = $(man3_MAN_DIR)/* + +# Docs will be installed. It may be one or more docs supported +# by doxygen, but does not include 'man'. +@ENABLE_DOXYGEN_TRUE@docdirs = $(DX_INSTALL_DOCS) +all: $(BUILT_SOURCES) config.h evconfig-private.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/include/include.am $(srcdir)/sample/include.am $(srcdir)/test/include.am $(srcdir)/doxygen.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; +$(srcdir)/include/include.am $(srcdir)/sample/include.am $(srcdir)/test/include.am $(srcdir)/doxygen.am $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + $(AM_V_at)rm -f stamp-h1 + $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + $(AM_V_GEN)($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + $(AM_V_at)rm -f stamp-h1 + $(AM_V_at)touch $@ + +evconfig-private.h: stamp-h2 + @test -f $@ || rm -f stamp-h2 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2 + +stamp-h2: $(srcdir)/evconfig-private.h.in $(top_builddir)/config.status + $(AM_V_at)rm -f stamp-h2 + $(AM_V_GEN)cd $(top_builddir) && $(SHELL) ./config.status evconfig-private.h + +distclean-hdr: + -rm -f config.h stamp-h1 evconfig-private.h stamp-h2 +libevent.pc: $(top_builddir)/config.status $(srcdir)/libevent.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +libevent_mbedtls.pc: $(top_builddir)/config.status $(srcdir)/libevent_mbedtls.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +libevent_openssl.pc: $(top_builddir)/config.status $(srcdir)/libevent_openssl.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +libevent_pthreads.pc: $(top_builddir)/config.status $(srcdir)/libevent_pthreads.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +libevent_core.pc: $(top_builddir)/config.status $(srcdir)/libevent_core.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +libevent_extra.pc: $(top_builddir)/config.status $(srcdir)/libevent_extra.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +clean-noinstPROGRAMS: + $(am__rm_f) $(noinst_PROGRAMS) + test -z "$(EXEEXT)" || $(am__rm_f) $(noinst_PROGRAMS:$(EXEEXT)=) + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -$(am__rm_f) $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + echo rm -f $${locs}; \ + $(am__rm_f) $${locs} + +clean-noinstLTLIBRARIES: + -$(am__rm_f) $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + echo rm -f $${locs}; \ + $(am__rm_f) $${locs} + +libevent.la: $(libevent_la_OBJECTS) $(libevent_la_DEPENDENCIES) $(EXTRA_libevent_la_DEPENDENCIES) + $(AM_V_CCLD)$(libevent_la_LINK) $(am_libevent_la_rpath) $(libevent_la_OBJECTS) $(libevent_la_LIBADD) $(LIBS) + +libevent_core.la: $(libevent_core_la_OBJECTS) $(libevent_core_la_DEPENDENCIES) $(EXTRA_libevent_core_la_DEPENDENCIES) + $(AM_V_CCLD)$(libevent_core_la_LINK) $(am_libevent_core_la_rpath) $(libevent_core_la_OBJECTS) $(libevent_core_la_LIBADD) $(LIBS) + +libevent_extra.la: $(libevent_extra_la_OBJECTS) $(libevent_extra_la_DEPENDENCIES) $(EXTRA_libevent_extra_la_DEPENDENCIES) + $(AM_V_CCLD)$(libevent_extra_la_LINK) $(am_libevent_extra_la_rpath) $(libevent_extra_la_OBJECTS) $(libevent_extra_la_LIBADD) $(LIBS) + +libevent_mbedtls.la: $(libevent_mbedtls_la_OBJECTS) $(libevent_mbedtls_la_DEPENDENCIES) $(EXTRA_libevent_mbedtls_la_DEPENDENCIES) + $(AM_V_CCLD)$(libevent_mbedtls_la_LINK) $(am_libevent_mbedtls_la_rpath) $(libevent_mbedtls_la_OBJECTS) $(libevent_mbedtls_la_LIBADD) $(LIBS) + +libevent_openssl.la: $(libevent_openssl_la_OBJECTS) $(libevent_openssl_la_DEPENDENCIES) $(EXTRA_libevent_openssl_la_DEPENDENCIES) + $(AM_V_CCLD)$(libevent_openssl_la_LINK) $(am_libevent_openssl_la_rpath) $(libevent_openssl_la_OBJECTS) $(libevent_openssl_la_LIBADD) $(LIBS) + +libevent_pthreads.la: $(libevent_pthreads_la_OBJECTS) $(libevent_pthreads_la_DEPENDENCIES) $(EXTRA_libevent_pthreads_la_DEPENDENCIES) + $(AM_V_CCLD)$(libevent_pthreads_la_LINK) $(am_libevent_pthreads_la_rpath) $(libevent_pthreads_la_OBJECTS) $(libevent_pthreads_la_LIBADD) $(LIBS) +sample/$(am__dirstamp): + @$(MKDIR_P) sample + @: >>sample/$(am__dirstamp) +sample/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) sample/$(DEPDIR) + @: >>sample/$(DEPDIR)/$(am__dirstamp) +sample/becat-becat.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) + +sample/becat$(EXEEXT): $(sample_becat_OBJECTS) $(sample_becat_DEPENDENCIES) $(EXTRA_sample_becat_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/becat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_becat_OBJECTS) $(sample_becat_LDADD) $(LIBS) +sample/dns-example.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) + +sample/dns-example$(EXEEXT): $(sample_dns_example_OBJECTS) $(sample_dns_example_DEPENDENCIES) $(EXTRA_sample_dns_example_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/dns-example$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_dns_example_OBJECTS) $(sample_dns_example_LDADD) $(LIBS) +sample/event-read-fifo.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) + +sample/event-read-fifo$(EXEEXT): $(sample_event_read_fifo_OBJECTS) $(sample_event_read_fifo_DEPENDENCIES) $(EXTRA_sample_event_read_fifo_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/event-read-fifo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_event_read_fifo_OBJECTS) $(sample_event_read_fifo_LDADD) $(LIBS) +sample/hello-world.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) + +sample/hello-world$(EXEEXT): $(sample_hello_world_OBJECTS) $(sample_hello_world_DEPENDENCIES) $(EXTRA_sample_hello_world_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/hello-world$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_hello_world_OBJECTS) $(sample_hello_world_LDADD) $(LIBS) +sample/http-connect.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) + +sample/http-connect$(EXEEXT): $(sample_http_connect_OBJECTS) $(sample_http_connect_DEPENDENCIES) $(EXTRA_sample_http_connect_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/http-connect$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_http_connect_OBJECTS) $(sample_http_connect_LDADD) $(LIBS) +sample/http-server.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) + +sample/http-server$(EXEEXT): $(sample_http_server_OBJECTS) $(sample_http_server_DEPENDENCIES) $(EXTRA_sample_http_server_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/http-server$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_http_server_OBJECTS) $(sample_http_server_LDADD) $(LIBS) +sample/https_client-https-client.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) +sample/https_client-hostcheck.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) +sample/https_client-openssl_hostname_validation.$(OBJEXT): \ + sample/$(am__dirstamp) sample/$(DEPDIR)/$(am__dirstamp) + +sample/https-client$(EXEEXT): $(sample_https_client_OBJECTS) $(sample_https_client_DEPENDENCIES) $(EXTRA_sample_https_client_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/https-client$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_https_client_OBJECTS) $(sample_https_client_LDADD) $(LIBS) +sample/https_client_mbedtls-https-client.$(OBJEXT): \ + sample/$(am__dirstamp) sample/$(DEPDIR)/$(am__dirstamp) + +sample/https-client-mbedtls$(EXEEXT): $(sample_https_client_mbedtls_OBJECTS) $(sample_https_client_mbedtls_DEPENDENCIES) $(EXTRA_sample_https_client_mbedtls_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/https-client-mbedtls$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_https_client_mbedtls_OBJECTS) $(sample_https_client_mbedtls_LDADD) $(LIBS) +sample/le_proxy-le-proxy.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) + +sample/le-proxy$(EXEEXT): $(sample_le_proxy_OBJECTS) $(sample_le_proxy_DEPENDENCIES) $(EXTRA_sample_le_proxy_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/le-proxy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_le_proxy_OBJECTS) $(sample_le_proxy_LDADD) $(LIBS) +sample/signal-test.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) + +sample/signal-test$(EXEEXT): $(sample_signal_test_OBJECTS) $(sample_signal_test_DEPENDENCIES) $(EXTRA_sample_signal_test_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/signal-test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_signal_test_OBJECTS) $(sample_signal_test_LDADD) $(LIBS) +sample/ssl_client_mbedtls-ssl-client-mbedtls.$(OBJEXT): \ + sample/$(am__dirstamp) sample/$(DEPDIR)/$(am__dirstamp) + +sample/ssl-client-mbedtls$(EXEEXT): $(sample_ssl_client_mbedtls_OBJECTS) $(sample_ssl_client_mbedtls_DEPENDENCIES) $(EXTRA_sample_ssl_client_mbedtls_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/ssl-client-mbedtls$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_ssl_client_mbedtls_OBJECTS) $(sample_ssl_client_mbedtls_LDADD) $(LIBS) +sample/time-test.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) + +sample/time-test$(EXEEXT): $(sample_time_test_OBJECTS) $(sample_time_test_DEPENDENCIES) $(EXTRA_sample_time_test_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/time-test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_time_test_OBJECTS) $(sample_time_test_LDADD) $(LIBS) +sample/watch-timing.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) + +sample/watch-timing$(EXEEXT): $(sample_watch_timing_OBJECTS) $(sample_watch_timing_DEPENDENCIES) $(EXTRA_sample_watch_timing_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/watch-timing$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_watch_timing_OBJECTS) $(sample_watch_timing_LDADD) $(LIBS) +sample/ws-chat-server.$(OBJEXT): sample/$(am__dirstamp) \ + sample/$(DEPDIR)/$(am__dirstamp) + +sample/ws-chat-server$(EXEEXT): $(sample_ws_chat_server_OBJECTS) $(sample_ws_chat_server_DEPENDENCIES) $(EXTRA_sample_ws_chat_server_DEPENDENCIES) sample/$(am__dirstamp) + @rm -f sample/ws-chat-server$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sample_ws_chat_server_OBJECTS) $(sample_ws_chat_server_LDADD) $(LIBS) +test/$(am__dirstamp): + @$(MKDIR_P) test + @: >>test/$(am__dirstamp) +test/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) test/$(DEPDIR) + @: >>test/$(DEPDIR)/$(am__dirstamp) +test/bench.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/bench$(EXEEXT): $(test_bench_OBJECTS) $(test_bench_DEPENDENCIES) $(EXTRA_test_bench_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/bench$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_bench_OBJECTS) $(test_bench_LDADD) $(LIBS) +test/bench_cascade.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/bench_cascade$(EXEEXT): $(test_bench_cascade_OBJECTS) $(test_bench_cascade_DEPENDENCIES) $(EXTRA_test_bench_cascade_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/bench_cascade$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_bench_cascade_OBJECTS) $(test_bench_cascade_LDADD) $(LIBS) +test/bench_http.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/bench_http$(EXEEXT): $(test_bench_http_OBJECTS) $(test_bench_http_DEPENDENCIES) $(EXTRA_test_bench_http_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/bench_http$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_bench_http_OBJECTS) $(test_bench_http_LDADD) $(LIBS) +test/bench_httpclient.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/bench_httpclient$(EXEEXT): $(test_bench_httpclient_OBJECTS) $(test_bench_httpclient_DEPENDENCIES) $(EXTRA_test_bench_httpclient_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/bench_httpclient$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_bench_httpclient_OBJECTS) $(test_bench_httpclient_LDADD) $(LIBS) +test/regress-regress.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress.gen.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_buffer.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_bufferevent.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_dns.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_et.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_finalize.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_http.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_listener.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_main.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_minheap.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_rpc.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_testutils.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_util.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_watch.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_ws.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_timer_timeout.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-tinytest.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_thread.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_zlib.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_iocp.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_openssl.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) +test/regress-regress_mbedtls.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/regress$(EXEEXT): $(test_regress_OBJECTS) $(test_regress_DEPENDENCIES) $(EXTRA_test_regress_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/regress$(EXEEXT) + $(AM_V_CCLD)$(test_regress_LINK) $(test_regress_OBJECTS) $(test_regress_LDADD) $(LIBS) +test/test-changelist.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/test-changelist$(EXEEXT): $(test_test_changelist_OBJECTS) $(test_test_changelist_DEPENDENCIES) $(EXTRA_test_test_changelist_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/test-changelist$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_test_changelist_OBJECTS) $(test_test_changelist_LDADD) $(LIBS) +test/test-closed.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/test-closed$(EXEEXT): $(test_test_closed_OBJECTS) $(test_test_closed_DEPENDENCIES) $(EXTRA_test_test_closed_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/test-closed$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_test_closed_OBJECTS) $(test_test_closed_LDADD) $(LIBS) +test/test-dumpevents.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/test-dumpevents$(EXEEXT): $(test_test_dumpevents_OBJECTS) $(test_test_dumpevents_DEPENDENCIES) $(EXTRA_test_test_dumpevents_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/test-dumpevents$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_test_dumpevents_OBJECTS) $(test_test_dumpevents_LDADD) $(LIBS) +test/test-eof.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/test-eof$(EXEEXT): $(test_test_eof_OBJECTS) $(test_test_eof_DEPENDENCIES) $(EXTRA_test_test_eof_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/test-eof$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_test_eof_OBJECTS) $(test_test_eof_LDADD) $(LIBS) +test/test-fdleak.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/test-fdleak$(EXEEXT): $(test_test_fdleak_OBJECTS) $(test_test_fdleak_DEPENDENCIES) $(EXTRA_test_test_fdleak_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/test-fdleak$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_test_fdleak_OBJECTS) $(test_test_fdleak_LDADD) $(LIBS) +test/test-init.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/test-init$(EXEEXT): $(test_test_init_OBJECTS) $(test_test_init_DEPENDENCIES) $(EXTRA_test_test_init_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/test-init$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_test_init_OBJECTS) $(test_test_init_LDADD) $(LIBS) +test/test_kq_collision-test-kq-collision.$(OBJEXT): \ + test/$(am__dirstamp) test/$(DEPDIR)/$(am__dirstamp) + +test/test-kq-collision$(EXEEXT): $(test_test_kq_collision_OBJECTS) $(test_test_kq_collision_DEPENDENCIES) $(EXTRA_test_test_kq_collision_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/test-kq-collision$(EXEEXT) + $(AM_V_CCLD)$(test_test_kq_collision_LINK) $(test_test_kq_collision_OBJECTS) $(test_test_kq_collision_LDADD) $(LIBS) +test/test-ratelim.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/test-ratelim$(EXEEXT): $(test_test_ratelim_OBJECTS) $(test_test_ratelim_DEPENDENCIES) $(EXTRA_test_test_ratelim_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/test-ratelim$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_test_ratelim_OBJECTS) $(test_test_ratelim_LDADD) $(LIBS) +test/test-time.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/test-time$(EXEEXT): $(test_test_time_OBJECTS) $(test_test_time_DEPENDENCIES) $(EXTRA_test_test_time_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/test-time$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_test_time_OBJECTS) $(test_test_time_LDADD) $(LIBS) +test/test-weof.$(OBJEXT): test/$(am__dirstamp) \ + test/$(DEPDIR)/$(am__dirstamp) + +test/test-weof$(EXEEXT): $(test_test_weof_OBJECTS) $(test_test_weof_DEPENDENCIES) $(EXTRA_test_test_weof_DEPENDENCIES) test/$(am__dirstamp) + @rm -f test/test-weof$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_test_weof_OBJECTS) $(test_test_weof_LDADD) $(LIBS) +install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n' \ + -e 'h;s|.*|.|' \ + -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) { files[d] = files[d] " " $$1; \ + if (++n[d] == $(am__install_max)) { \ + print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ + else { print "f", d "/" $$4, $$1 } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-dist_binSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 's,.*/,,;$(transform)'`; \ + dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f sample/*.$(OBJEXT) + -rm -f test/*.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/epoll_sub.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer_iocp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufferevent.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufferevent_async.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufferevent_filter.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufferevent_pair.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufferevent_ratelim.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bufferevent_sock.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devpoll.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evdns.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event_iocp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event_tagging.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evmap.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evport.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evrpc.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evthread.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evthread_pthread.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evthread_win32.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evutil.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evutil_rand.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evutil_time.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/http.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kqueue.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libevent_mbedtls_la-bufferevent_mbedtls.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libevent_mbedtls_la-bufferevent_ssl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libevent_openssl_la-bufferevent_openssl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libevent_openssl_la-bufferevent_ssl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listener.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sha1.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalfd.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strlcpy.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/watch.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wepoll.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/win32select.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ws.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/becat-becat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/dns-example.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/event-read-fifo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/hello-world.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/http-connect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/http-server.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/https_client-hostcheck.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/https_client-https-client.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/https_client-openssl_hostname_validation.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/https_client_mbedtls-https-client.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/le_proxy-le-proxy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/signal-test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/ssl_client_mbedtls-ssl-client-mbedtls.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/time-test.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/watch-timing.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@sample/$(DEPDIR)/ws-chat-server.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/bench.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/bench_cascade.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/bench_http.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/bench_httpclient.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress.gen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_buffer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_bufferevent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_dns.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_et.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_finalize.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_http.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_iocp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_listener.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_main.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_mbedtls.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_minheap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_openssl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_rpc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_testutils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_thread.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_timer_timeout.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_util.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_watch.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_ws.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-regress_zlib.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/regress-tinytest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-changelist.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-closed.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-dumpevents.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-eof.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-fdleak.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-init.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-ratelim.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-weof.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_kq_collision-test-kq-collision.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @: >>$@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +libevent_mbedtls_la-bufferevent_mbedtls.lo: bufferevent_mbedtls.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libevent_mbedtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libevent_mbedtls_la-bufferevent_mbedtls.lo -MD -MP -MF $(DEPDIR)/libevent_mbedtls_la-bufferevent_mbedtls.Tpo -c -o libevent_mbedtls_la-bufferevent_mbedtls.lo `test -f 'bufferevent_mbedtls.c' || echo '$(srcdir)/'`bufferevent_mbedtls.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libevent_mbedtls_la-bufferevent_mbedtls.Tpo $(DEPDIR)/libevent_mbedtls_la-bufferevent_mbedtls.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bufferevent_mbedtls.c' object='libevent_mbedtls_la-bufferevent_mbedtls.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libevent_mbedtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libevent_mbedtls_la-bufferevent_mbedtls.lo `test -f 'bufferevent_mbedtls.c' || echo '$(srcdir)/'`bufferevent_mbedtls.c + +libevent_mbedtls_la-bufferevent_ssl.lo: bufferevent_ssl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libevent_mbedtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libevent_mbedtls_la-bufferevent_ssl.lo -MD -MP -MF $(DEPDIR)/libevent_mbedtls_la-bufferevent_ssl.Tpo -c -o libevent_mbedtls_la-bufferevent_ssl.lo `test -f 'bufferevent_ssl.c' || echo '$(srcdir)/'`bufferevent_ssl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libevent_mbedtls_la-bufferevent_ssl.Tpo $(DEPDIR)/libevent_mbedtls_la-bufferevent_ssl.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bufferevent_ssl.c' object='libevent_mbedtls_la-bufferevent_ssl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libevent_mbedtls_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libevent_mbedtls_la-bufferevent_ssl.lo `test -f 'bufferevent_ssl.c' || echo '$(srcdir)/'`bufferevent_ssl.c + +libevent_openssl_la-bufferevent_openssl.lo: bufferevent_openssl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libevent_openssl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libevent_openssl_la-bufferevent_openssl.lo -MD -MP -MF $(DEPDIR)/libevent_openssl_la-bufferevent_openssl.Tpo -c -o libevent_openssl_la-bufferevent_openssl.lo `test -f 'bufferevent_openssl.c' || echo '$(srcdir)/'`bufferevent_openssl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libevent_openssl_la-bufferevent_openssl.Tpo $(DEPDIR)/libevent_openssl_la-bufferevent_openssl.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bufferevent_openssl.c' object='libevent_openssl_la-bufferevent_openssl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libevent_openssl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libevent_openssl_la-bufferevent_openssl.lo `test -f 'bufferevent_openssl.c' || echo '$(srcdir)/'`bufferevent_openssl.c + +libevent_openssl_la-bufferevent_ssl.lo: bufferevent_ssl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libevent_openssl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libevent_openssl_la-bufferevent_ssl.lo -MD -MP -MF $(DEPDIR)/libevent_openssl_la-bufferevent_ssl.Tpo -c -o libevent_openssl_la-bufferevent_ssl.lo `test -f 'bufferevent_ssl.c' || echo '$(srcdir)/'`bufferevent_ssl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libevent_openssl_la-bufferevent_ssl.Tpo $(DEPDIR)/libevent_openssl_la-bufferevent_ssl.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bufferevent_ssl.c' object='libevent_openssl_la-bufferevent_ssl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libevent_openssl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libevent_openssl_la-bufferevent_ssl.lo `test -f 'bufferevent_ssl.c' || echo '$(srcdir)/'`bufferevent_ssl.c + +sample/becat-becat.o: sample/becat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_becat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/becat-becat.o -MD -MP -MF sample/$(DEPDIR)/becat-becat.Tpo -c -o sample/becat-becat.o `test -f 'sample/becat.c' || echo '$(srcdir)/'`sample/becat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/becat-becat.Tpo sample/$(DEPDIR)/becat-becat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/becat.c' object='sample/becat-becat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_becat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/becat-becat.o `test -f 'sample/becat.c' || echo '$(srcdir)/'`sample/becat.c + +sample/becat-becat.obj: sample/becat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_becat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/becat-becat.obj -MD -MP -MF sample/$(DEPDIR)/becat-becat.Tpo -c -o sample/becat-becat.obj `if test -f 'sample/becat.c'; then $(CYGPATH_W) 'sample/becat.c'; else $(CYGPATH_W) '$(srcdir)/sample/becat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/becat-becat.Tpo sample/$(DEPDIR)/becat-becat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/becat.c' object='sample/becat-becat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_becat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/becat-becat.obj `if test -f 'sample/becat.c'; then $(CYGPATH_W) 'sample/becat.c'; else $(CYGPATH_W) '$(srcdir)/sample/becat.c'; fi` + +sample/https_client-https-client.o: sample/https-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/https_client-https-client.o -MD -MP -MF sample/$(DEPDIR)/https_client-https-client.Tpo -c -o sample/https_client-https-client.o `test -f 'sample/https-client.c' || echo '$(srcdir)/'`sample/https-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/https_client-https-client.Tpo sample/$(DEPDIR)/https_client-https-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/https-client.c' object='sample/https_client-https-client.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/https_client-https-client.o `test -f 'sample/https-client.c' || echo '$(srcdir)/'`sample/https-client.c + +sample/https_client-https-client.obj: sample/https-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/https_client-https-client.obj -MD -MP -MF sample/$(DEPDIR)/https_client-https-client.Tpo -c -o sample/https_client-https-client.obj `if test -f 'sample/https-client.c'; then $(CYGPATH_W) 'sample/https-client.c'; else $(CYGPATH_W) '$(srcdir)/sample/https-client.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/https_client-https-client.Tpo sample/$(DEPDIR)/https_client-https-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/https-client.c' object='sample/https_client-https-client.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/https_client-https-client.obj `if test -f 'sample/https-client.c'; then $(CYGPATH_W) 'sample/https-client.c'; else $(CYGPATH_W) '$(srcdir)/sample/https-client.c'; fi` + +sample/https_client-hostcheck.o: sample/hostcheck.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/https_client-hostcheck.o -MD -MP -MF sample/$(DEPDIR)/https_client-hostcheck.Tpo -c -o sample/https_client-hostcheck.o `test -f 'sample/hostcheck.c' || echo '$(srcdir)/'`sample/hostcheck.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/https_client-hostcheck.Tpo sample/$(DEPDIR)/https_client-hostcheck.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/hostcheck.c' object='sample/https_client-hostcheck.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/https_client-hostcheck.o `test -f 'sample/hostcheck.c' || echo '$(srcdir)/'`sample/hostcheck.c + +sample/https_client-hostcheck.obj: sample/hostcheck.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/https_client-hostcheck.obj -MD -MP -MF sample/$(DEPDIR)/https_client-hostcheck.Tpo -c -o sample/https_client-hostcheck.obj `if test -f 'sample/hostcheck.c'; then $(CYGPATH_W) 'sample/hostcheck.c'; else $(CYGPATH_W) '$(srcdir)/sample/hostcheck.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/https_client-hostcheck.Tpo sample/$(DEPDIR)/https_client-hostcheck.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/hostcheck.c' object='sample/https_client-hostcheck.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/https_client-hostcheck.obj `if test -f 'sample/hostcheck.c'; then $(CYGPATH_W) 'sample/hostcheck.c'; else $(CYGPATH_W) '$(srcdir)/sample/hostcheck.c'; fi` + +sample/https_client-openssl_hostname_validation.o: sample/openssl_hostname_validation.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/https_client-openssl_hostname_validation.o -MD -MP -MF sample/$(DEPDIR)/https_client-openssl_hostname_validation.Tpo -c -o sample/https_client-openssl_hostname_validation.o `test -f 'sample/openssl_hostname_validation.c' || echo '$(srcdir)/'`sample/openssl_hostname_validation.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/https_client-openssl_hostname_validation.Tpo sample/$(DEPDIR)/https_client-openssl_hostname_validation.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/openssl_hostname_validation.c' object='sample/https_client-openssl_hostname_validation.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/https_client-openssl_hostname_validation.o `test -f 'sample/openssl_hostname_validation.c' || echo '$(srcdir)/'`sample/openssl_hostname_validation.c + +sample/https_client-openssl_hostname_validation.obj: sample/openssl_hostname_validation.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/https_client-openssl_hostname_validation.obj -MD -MP -MF sample/$(DEPDIR)/https_client-openssl_hostname_validation.Tpo -c -o sample/https_client-openssl_hostname_validation.obj `if test -f 'sample/openssl_hostname_validation.c'; then $(CYGPATH_W) 'sample/openssl_hostname_validation.c'; else $(CYGPATH_W) '$(srcdir)/sample/openssl_hostname_validation.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/https_client-openssl_hostname_validation.Tpo sample/$(DEPDIR)/https_client-openssl_hostname_validation.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/openssl_hostname_validation.c' object='sample/https_client-openssl_hostname_validation.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/https_client-openssl_hostname_validation.obj `if test -f 'sample/openssl_hostname_validation.c'; then $(CYGPATH_W) 'sample/openssl_hostname_validation.c'; else $(CYGPATH_W) '$(srcdir)/sample/openssl_hostname_validation.c'; fi` + +sample/https_client_mbedtls-https-client.o: sample/https-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_mbedtls_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/https_client_mbedtls-https-client.o -MD -MP -MF sample/$(DEPDIR)/https_client_mbedtls-https-client.Tpo -c -o sample/https_client_mbedtls-https-client.o `test -f 'sample/https-client.c' || echo '$(srcdir)/'`sample/https-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/https_client_mbedtls-https-client.Tpo sample/$(DEPDIR)/https_client_mbedtls-https-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/https-client.c' object='sample/https_client_mbedtls-https-client.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_mbedtls_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/https_client_mbedtls-https-client.o `test -f 'sample/https-client.c' || echo '$(srcdir)/'`sample/https-client.c + +sample/https_client_mbedtls-https-client.obj: sample/https-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_mbedtls_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/https_client_mbedtls-https-client.obj -MD -MP -MF sample/$(DEPDIR)/https_client_mbedtls-https-client.Tpo -c -o sample/https_client_mbedtls-https-client.obj `if test -f 'sample/https-client.c'; then $(CYGPATH_W) 'sample/https-client.c'; else $(CYGPATH_W) '$(srcdir)/sample/https-client.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/https_client_mbedtls-https-client.Tpo sample/$(DEPDIR)/https_client_mbedtls-https-client.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/https-client.c' object='sample/https_client_mbedtls-https-client.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_https_client_mbedtls_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/https_client_mbedtls-https-client.obj `if test -f 'sample/https-client.c'; then $(CYGPATH_W) 'sample/https-client.c'; else $(CYGPATH_W) '$(srcdir)/sample/https-client.c'; fi` + +sample/le_proxy-le-proxy.o: sample/le-proxy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_le_proxy_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/le_proxy-le-proxy.o -MD -MP -MF sample/$(DEPDIR)/le_proxy-le-proxy.Tpo -c -o sample/le_proxy-le-proxy.o `test -f 'sample/le-proxy.c' || echo '$(srcdir)/'`sample/le-proxy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/le_proxy-le-proxy.Tpo sample/$(DEPDIR)/le_proxy-le-proxy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/le-proxy.c' object='sample/le_proxy-le-proxy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_le_proxy_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/le_proxy-le-proxy.o `test -f 'sample/le-proxy.c' || echo '$(srcdir)/'`sample/le-proxy.c + +sample/le_proxy-le-proxy.obj: sample/le-proxy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_le_proxy_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/le_proxy-le-proxy.obj -MD -MP -MF sample/$(DEPDIR)/le_proxy-le-proxy.Tpo -c -o sample/le_proxy-le-proxy.obj `if test -f 'sample/le-proxy.c'; then $(CYGPATH_W) 'sample/le-proxy.c'; else $(CYGPATH_W) '$(srcdir)/sample/le-proxy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/le_proxy-le-proxy.Tpo sample/$(DEPDIR)/le_proxy-le-proxy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/le-proxy.c' object='sample/le_proxy-le-proxy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_le_proxy_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/le_proxy-le-proxy.obj `if test -f 'sample/le-proxy.c'; then $(CYGPATH_W) 'sample/le-proxy.c'; else $(CYGPATH_W) '$(srcdir)/sample/le-proxy.c'; fi` + +sample/ssl_client_mbedtls-ssl-client-mbedtls.o: sample/ssl-client-mbedtls.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_ssl_client_mbedtls_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/ssl_client_mbedtls-ssl-client-mbedtls.o -MD -MP -MF sample/$(DEPDIR)/ssl_client_mbedtls-ssl-client-mbedtls.Tpo -c -o sample/ssl_client_mbedtls-ssl-client-mbedtls.o `test -f 'sample/ssl-client-mbedtls.c' || echo '$(srcdir)/'`sample/ssl-client-mbedtls.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/ssl_client_mbedtls-ssl-client-mbedtls.Tpo sample/$(DEPDIR)/ssl_client_mbedtls-ssl-client-mbedtls.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/ssl-client-mbedtls.c' object='sample/ssl_client_mbedtls-ssl-client-mbedtls.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_ssl_client_mbedtls_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/ssl_client_mbedtls-ssl-client-mbedtls.o `test -f 'sample/ssl-client-mbedtls.c' || echo '$(srcdir)/'`sample/ssl-client-mbedtls.c + +sample/ssl_client_mbedtls-ssl-client-mbedtls.obj: sample/ssl-client-mbedtls.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_ssl_client_mbedtls_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sample/ssl_client_mbedtls-ssl-client-mbedtls.obj -MD -MP -MF sample/$(DEPDIR)/ssl_client_mbedtls-ssl-client-mbedtls.Tpo -c -o sample/ssl_client_mbedtls-ssl-client-mbedtls.obj `if test -f 'sample/ssl-client-mbedtls.c'; then $(CYGPATH_W) 'sample/ssl-client-mbedtls.c'; else $(CYGPATH_W) '$(srcdir)/sample/ssl-client-mbedtls.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) sample/$(DEPDIR)/ssl_client_mbedtls-ssl-client-mbedtls.Tpo sample/$(DEPDIR)/ssl_client_mbedtls-ssl-client-mbedtls.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sample/ssl-client-mbedtls.c' object='sample/ssl_client_mbedtls-ssl-client-mbedtls.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(sample_ssl_client_mbedtls_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sample/ssl_client_mbedtls-ssl-client-mbedtls.obj `if test -f 'sample/ssl-client-mbedtls.c'; then $(CYGPATH_W) 'sample/ssl-client-mbedtls.c'; else $(CYGPATH_W) '$(srcdir)/sample/ssl-client-mbedtls.c'; fi` + +test/regress-regress.o: test/regress.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress.o -MD -MP -MF test/$(DEPDIR)/regress-regress.Tpo -c -o test/regress-regress.o `test -f 'test/regress.c' || echo '$(srcdir)/'`test/regress.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress.Tpo test/$(DEPDIR)/regress-regress.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress.c' object='test/regress-regress.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress.o `test -f 'test/regress.c' || echo '$(srcdir)/'`test/regress.c + +test/regress-regress.obj: test/regress.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress.obj -MD -MP -MF test/$(DEPDIR)/regress-regress.Tpo -c -o test/regress-regress.obj `if test -f 'test/regress.c'; then $(CYGPATH_W) 'test/regress.c'; else $(CYGPATH_W) '$(srcdir)/test/regress.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress.Tpo test/$(DEPDIR)/regress-regress.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress.c' object='test/regress-regress.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress.obj `if test -f 'test/regress.c'; then $(CYGPATH_W) 'test/regress.c'; else $(CYGPATH_W) '$(srcdir)/test/regress.c'; fi` + +test/regress-regress.gen.o: test/regress.gen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress.gen.o -MD -MP -MF test/$(DEPDIR)/regress-regress.gen.Tpo -c -o test/regress-regress.gen.o `test -f 'test/regress.gen.c' || echo '$(srcdir)/'`test/regress.gen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress.gen.Tpo test/$(DEPDIR)/regress-regress.gen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress.gen.c' object='test/regress-regress.gen.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress.gen.o `test -f 'test/regress.gen.c' || echo '$(srcdir)/'`test/regress.gen.c + +test/regress-regress.gen.obj: test/regress.gen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress.gen.obj -MD -MP -MF test/$(DEPDIR)/regress-regress.gen.Tpo -c -o test/regress-regress.gen.obj `if test -f 'test/regress.gen.c'; then $(CYGPATH_W) 'test/regress.gen.c'; else $(CYGPATH_W) '$(srcdir)/test/regress.gen.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress.gen.Tpo test/$(DEPDIR)/regress-regress.gen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress.gen.c' object='test/regress-regress.gen.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress.gen.obj `if test -f 'test/regress.gen.c'; then $(CYGPATH_W) 'test/regress.gen.c'; else $(CYGPATH_W) '$(srcdir)/test/regress.gen.c'; fi` + +test/regress-regress_buffer.o: test/regress_buffer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_buffer.o -MD -MP -MF test/$(DEPDIR)/regress-regress_buffer.Tpo -c -o test/regress-regress_buffer.o `test -f 'test/regress_buffer.c' || echo '$(srcdir)/'`test/regress_buffer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_buffer.Tpo test/$(DEPDIR)/regress-regress_buffer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_buffer.c' object='test/regress-regress_buffer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_buffer.o `test -f 'test/regress_buffer.c' || echo '$(srcdir)/'`test/regress_buffer.c + +test/regress-regress_buffer.obj: test/regress_buffer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_buffer.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_buffer.Tpo -c -o test/regress-regress_buffer.obj `if test -f 'test/regress_buffer.c'; then $(CYGPATH_W) 'test/regress_buffer.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_buffer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_buffer.Tpo test/$(DEPDIR)/regress-regress_buffer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_buffer.c' object='test/regress-regress_buffer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_buffer.obj `if test -f 'test/regress_buffer.c'; then $(CYGPATH_W) 'test/regress_buffer.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_buffer.c'; fi` + +test/regress-regress_bufferevent.o: test/regress_bufferevent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_bufferevent.o -MD -MP -MF test/$(DEPDIR)/regress-regress_bufferevent.Tpo -c -o test/regress-regress_bufferevent.o `test -f 'test/regress_bufferevent.c' || echo '$(srcdir)/'`test/regress_bufferevent.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_bufferevent.Tpo test/$(DEPDIR)/regress-regress_bufferevent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_bufferevent.c' object='test/regress-regress_bufferevent.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_bufferevent.o `test -f 'test/regress_bufferevent.c' || echo '$(srcdir)/'`test/regress_bufferevent.c + +test/regress-regress_bufferevent.obj: test/regress_bufferevent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_bufferevent.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_bufferevent.Tpo -c -o test/regress-regress_bufferevent.obj `if test -f 'test/regress_bufferevent.c'; then $(CYGPATH_W) 'test/regress_bufferevent.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_bufferevent.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_bufferevent.Tpo test/$(DEPDIR)/regress-regress_bufferevent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_bufferevent.c' object='test/regress-regress_bufferevent.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_bufferevent.obj `if test -f 'test/regress_bufferevent.c'; then $(CYGPATH_W) 'test/regress_bufferevent.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_bufferevent.c'; fi` + +test/regress-regress_dns.o: test/regress_dns.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_dns.o -MD -MP -MF test/$(DEPDIR)/regress-regress_dns.Tpo -c -o test/regress-regress_dns.o `test -f 'test/regress_dns.c' || echo '$(srcdir)/'`test/regress_dns.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_dns.Tpo test/$(DEPDIR)/regress-regress_dns.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_dns.c' object='test/regress-regress_dns.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_dns.o `test -f 'test/regress_dns.c' || echo '$(srcdir)/'`test/regress_dns.c + +test/regress-regress_dns.obj: test/regress_dns.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_dns.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_dns.Tpo -c -o test/regress-regress_dns.obj `if test -f 'test/regress_dns.c'; then $(CYGPATH_W) 'test/regress_dns.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_dns.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_dns.Tpo test/$(DEPDIR)/regress-regress_dns.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_dns.c' object='test/regress-regress_dns.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_dns.obj `if test -f 'test/regress_dns.c'; then $(CYGPATH_W) 'test/regress_dns.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_dns.c'; fi` + +test/regress-regress_et.o: test/regress_et.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_et.o -MD -MP -MF test/$(DEPDIR)/regress-regress_et.Tpo -c -o test/regress-regress_et.o `test -f 'test/regress_et.c' || echo '$(srcdir)/'`test/regress_et.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_et.Tpo test/$(DEPDIR)/regress-regress_et.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_et.c' object='test/regress-regress_et.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_et.o `test -f 'test/regress_et.c' || echo '$(srcdir)/'`test/regress_et.c + +test/regress-regress_et.obj: test/regress_et.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_et.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_et.Tpo -c -o test/regress-regress_et.obj `if test -f 'test/regress_et.c'; then $(CYGPATH_W) 'test/regress_et.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_et.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_et.Tpo test/$(DEPDIR)/regress-regress_et.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_et.c' object='test/regress-regress_et.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_et.obj `if test -f 'test/regress_et.c'; then $(CYGPATH_W) 'test/regress_et.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_et.c'; fi` + +test/regress-regress_finalize.o: test/regress_finalize.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_finalize.o -MD -MP -MF test/$(DEPDIR)/regress-regress_finalize.Tpo -c -o test/regress-regress_finalize.o `test -f 'test/regress_finalize.c' || echo '$(srcdir)/'`test/regress_finalize.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_finalize.Tpo test/$(DEPDIR)/regress-regress_finalize.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_finalize.c' object='test/regress-regress_finalize.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_finalize.o `test -f 'test/regress_finalize.c' || echo '$(srcdir)/'`test/regress_finalize.c + +test/regress-regress_finalize.obj: test/regress_finalize.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_finalize.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_finalize.Tpo -c -o test/regress-regress_finalize.obj `if test -f 'test/regress_finalize.c'; then $(CYGPATH_W) 'test/regress_finalize.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_finalize.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_finalize.Tpo test/$(DEPDIR)/regress-regress_finalize.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_finalize.c' object='test/regress-regress_finalize.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_finalize.obj `if test -f 'test/regress_finalize.c'; then $(CYGPATH_W) 'test/regress_finalize.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_finalize.c'; fi` + +test/regress-regress_http.o: test/regress_http.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_http.o -MD -MP -MF test/$(DEPDIR)/regress-regress_http.Tpo -c -o test/regress-regress_http.o `test -f 'test/regress_http.c' || echo '$(srcdir)/'`test/regress_http.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_http.Tpo test/$(DEPDIR)/regress-regress_http.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_http.c' object='test/regress-regress_http.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_http.o `test -f 'test/regress_http.c' || echo '$(srcdir)/'`test/regress_http.c + +test/regress-regress_http.obj: test/regress_http.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_http.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_http.Tpo -c -o test/regress-regress_http.obj `if test -f 'test/regress_http.c'; then $(CYGPATH_W) 'test/regress_http.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_http.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_http.Tpo test/$(DEPDIR)/regress-regress_http.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_http.c' object='test/regress-regress_http.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_http.obj `if test -f 'test/regress_http.c'; then $(CYGPATH_W) 'test/regress_http.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_http.c'; fi` + +test/regress-regress_listener.o: test/regress_listener.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_listener.o -MD -MP -MF test/$(DEPDIR)/regress-regress_listener.Tpo -c -o test/regress-regress_listener.o `test -f 'test/regress_listener.c' || echo '$(srcdir)/'`test/regress_listener.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_listener.Tpo test/$(DEPDIR)/regress-regress_listener.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_listener.c' object='test/regress-regress_listener.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_listener.o `test -f 'test/regress_listener.c' || echo '$(srcdir)/'`test/regress_listener.c + +test/regress-regress_listener.obj: test/regress_listener.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_listener.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_listener.Tpo -c -o test/regress-regress_listener.obj `if test -f 'test/regress_listener.c'; then $(CYGPATH_W) 'test/regress_listener.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_listener.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_listener.Tpo test/$(DEPDIR)/regress-regress_listener.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_listener.c' object='test/regress-regress_listener.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_listener.obj `if test -f 'test/regress_listener.c'; then $(CYGPATH_W) 'test/regress_listener.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_listener.c'; fi` + +test/regress-regress_main.o: test/regress_main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_main.o -MD -MP -MF test/$(DEPDIR)/regress-regress_main.Tpo -c -o test/regress-regress_main.o `test -f 'test/regress_main.c' || echo '$(srcdir)/'`test/regress_main.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_main.Tpo test/$(DEPDIR)/regress-regress_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_main.c' object='test/regress-regress_main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_main.o `test -f 'test/regress_main.c' || echo '$(srcdir)/'`test/regress_main.c + +test/regress-regress_main.obj: test/regress_main.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_main.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_main.Tpo -c -o test/regress-regress_main.obj `if test -f 'test/regress_main.c'; then $(CYGPATH_W) 'test/regress_main.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_main.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_main.Tpo test/$(DEPDIR)/regress-regress_main.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_main.c' object='test/regress-regress_main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_main.obj `if test -f 'test/regress_main.c'; then $(CYGPATH_W) 'test/regress_main.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_main.c'; fi` + +test/regress-regress_minheap.o: test/regress_minheap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_minheap.o -MD -MP -MF test/$(DEPDIR)/regress-regress_minheap.Tpo -c -o test/regress-regress_minheap.o `test -f 'test/regress_minheap.c' || echo '$(srcdir)/'`test/regress_minheap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_minheap.Tpo test/$(DEPDIR)/regress-regress_minheap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_minheap.c' object='test/regress-regress_minheap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_minheap.o `test -f 'test/regress_minheap.c' || echo '$(srcdir)/'`test/regress_minheap.c + +test/regress-regress_minheap.obj: test/regress_minheap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_minheap.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_minheap.Tpo -c -o test/regress-regress_minheap.obj `if test -f 'test/regress_minheap.c'; then $(CYGPATH_W) 'test/regress_minheap.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_minheap.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_minheap.Tpo test/$(DEPDIR)/regress-regress_minheap.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_minheap.c' object='test/regress-regress_minheap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_minheap.obj `if test -f 'test/regress_minheap.c'; then $(CYGPATH_W) 'test/regress_minheap.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_minheap.c'; fi` + +test/regress-regress_rpc.o: test/regress_rpc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_rpc.o -MD -MP -MF test/$(DEPDIR)/regress-regress_rpc.Tpo -c -o test/regress-regress_rpc.o `test -f 'test/regress_rpc.c' || echo '$(srcdir)/'`test/regress_rpc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_rpc.Tpo test/$(DEPDIR)/regress-regress_rpc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_rpc.c' object='test/regress-regress_rpc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_rpc.o `test -f 'test/regress_rpc.c' || echo '$(srcdir)/'`test/regress_rpc.c + +test/regress-regress_rpc.obj: test/regress_rpc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_rpc.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_rpc.Tpo -c -o test/regress-regress_rpc.obj `if test -f 'test/regress_rpc.c'; then $(CYGPATH_W) 'test/regress_rpc.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_rpc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_rpc.Tpo test/$(DEPDIR)/regress-regress_rpc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_rpc.c' object='test/regress-regress_rpc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_rpc.obj `if test -f 'test/regress_rpc.c'; then $(CYGPATH_W) 'test/regress_rpc.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_rpc.c'; fi` + +test/regress-regress_testutils.o: test/regress_testutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_testutils.o -MD -MP -MF test/$(DEPDIR)/regress-regress_testutils.Tpo -c -o test/regress-regress_testutils.o `test -f 'test/regress_testutils.c' || echo '$(srcdir)/'`test/regress_testutils.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_testutils.Tpo test/$(DEPDIR)/regress-regress_testutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_testutils.c' object='test/regress-regress_testutils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_testutils.o `test -f 'test/regress_testutils.c' || echo '$(srcdir)/'`test/regress_testutils.c + +test/regress-regress_testutils.obj: test/regress_testutils.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_testutils.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_testutils.Tpo -c -o test/regress-regress_testutils.obj `if test -f 'test/regress_testutils.c'; then $(CYGPATH_W) 'test/regress_testutils.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_testutils.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_testutils.Tpo test/$(DEPDIR)/regress-regress_testutils.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_testutils.c' object='test/regress-regress_testutils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_testutils.obj `if test -f 'test/regress_testutils.c'; then $(CYGPATH_W) 'test/regress_testutils.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_testutils.c'; fi` + +test/regress-regress_util.o: test/regress_util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_util.o -MD -MP -MF test/$(DEPDIR)/regress-regress_util.Tpo -c -o test/regress-regress_util.o `test -f 'test/regress_util.c' || echo '$(srcdir)/'`test/regress_util.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_util.Tpo test/$(DEPDIR)/regress-regress_util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_util.c' object='test/regress-regress_util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_util.o `test -f 'test/regress_util.c' || echo '$(srcdir)/'`test/regress_util.c + +test/regress-regress_util.obj: test/regress_util.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_util.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_util.Tpo -c -o test/regress-regress_util.obj `if test -f 'test/regress_util.c'; then $(CYGPATH_W) 'test/regress_util.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_util.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_util.Tpo test/$(DEPDIR)/regress-regress_util.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_util.c' object='test/regress-regress_util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_util.obj `if test -f 'test/regress_util.c'; then $(CYGPATH_W) 'test/regress_util.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_util.c'; fi` + +test/regress-regress_watch.o: test/regress_watch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_watch.o -MD -MP -MF test/$(DEPDIR)/regress-regress_watch.Tpo -c -o test/regress-regress_watch.o `test -f 'test/regress_watch.c' || echo '$(srcdir)/'`test/regress_watch.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_watch.Tpo test/$(DEPDIR)/regress-regress_watch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_watch.c' object='test/regress-regress_watch.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_watch.o `test -f 'test/regress_watch.c' || echo '$(srcdir)/'`test/regress_watch.c + +test/regress-regress_watch.obj: test/regress_watch.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_watch.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_watch.Tpo -c -o test/regress-regress_watch.obj `if test -f 'test/regress_watch.c'; then $(CYGPATH_W) 'test/regress_watch.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_watch.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_watch.Tpo test/$(DEPDIR)/regress-regress_watch.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_watch.c' object='test/regress-regress_watch.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_watch.obj `if test -f 'test/regress_watch.c'; then $(CYGPATH_W) 'test/regress_watch.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_watch.c'; fi` + +test/regress-regress_ws.o: test/regress_ws.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_ws.o -MD -MP -MF test/$(DEPDIR)/regress-regress_ws.Tpo -c -o test/regress-regress_ws.o `test -f 'test/regress_ws.c' || echo '$(srcdir)/'`test/regress_ws.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_ws.Tpo test/$(DEPDIR)/regress-regress_ws.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_ws.c' object='test/regress-regress_ws.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_ws.o `test -f 'test/regress_ws.c' || echo '$(srcdir)/'`test/regress_ws.c + +test/regress-regress_ws.obj: test/regress_ws.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_ws.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_ws.Tpo -c -o test/regress-regress_ws.obj `if test -f 'test/regress_ws.c'; then $(CYGPATH_W) 'test/regress_ws.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_ws.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_ws.Tpo test/$(DEPDIR)/regress-regress_ws.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_ws.c' object='test/regress-regress_ws.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_ws.obj `if test -f 'test/regress_ws.c'; then $(CYGPATH_W) 'test/regress_ws.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_ws.c'; fi` + +test/regress-regress_timer_timeout.o: test/regress_timer_timeout.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_timer_timeout.o -MD -MP -MF test/$(DEPDIR)/regress-regress_timer_timeout.Tpo -c -o test/regress-regress_timer_timeout.o `test -f 'test/regress_timer_timeout.c' || echo '$(srcdir)/'`test/regress_timer_timeout.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_timer_timeout.Tpo test/$(DEPDIR)/regress-regress_timer_timeout.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_timer_timeout.c' object='test/regress-regress_timer_timeout.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_timer_timeout.o `test -f 'test/regress_timer_timeout.c' || echo '$(srcdir)/'`test/regress_timer_timeout.c + +test/regress-regress_timer_timeout.obj: test/regress_timer_timeout.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_timer_timeout.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_timer_timeout.Tpo -c -o test/regress-regress_timer_timeout.obj `if test -f 'test/regress_timer_timeout.c'; then $(CYGPATH_W) 'test/regress_timer_timeout.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_timer_timeout.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_timer_timeout.Tpo test/$(DEPDIR)/regress-regress_timer_timeout.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_timer_timeout.c' object='test/regress-regress_timer_timeout.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_timer_timeout.obj `if test -f 'test/regress_timer_timeout.c'; then $(CYGPATH_W) 'test/regress_timer_timeout.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_timer_timeout.c'; fi` + +test/regress-tinytest.o: test/tinytest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-tinytest.o -MD -MP -MF test/$(DEPDIR)/regress-tinytest.Tpo -c -o test/regress-tinytest.o `test -f 'test/tinytest.c' || echo '$(srcdir)/'`test/tinytest.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-tinytest.Tpo test/$(DEPDIR)/regress-tinytest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/tinytest.c' object='test/regress-tinytest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-tinytest.o `test -f 'test/tinytest.c' || echo '$(srcdir)/'`test/tinytest.c + +test/regress-tinytest.obj: test/tinytest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-tinytest.obj -MD -MP -MF test/$(DEPDIR)/regress-tinytest.Tpo -c -o test/regress-tinytest.obj `if test -f 'test/tinytest.c'; then $(CYGPATH_W) 'test/tinytest.c'; else $(CYGPATH_W) '$(srcdir)/test/tinytest.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-tinytest.Tpo test/$(DEPDIR)/regress-tinytest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/tinytest.c' object='test/regress-tinytest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-tinytest.obj `if test -f 'test/tinytest.c'; then $(CYGPATH_W) 'test/tinytest.c'; else $(CYGPATH_W) '$(srcdir)/test/tinytest.c'; fi` + +test/regress-regress_thread.o: test/regress_thread.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_thread.o -MD -MP -MF test/$(DEPDIR)/regress-regress_thread.Tpo -c -o test/regress-regress_thread.o `test -f 'test/regress_thread.c' || echo '$(srcdir)/'`test/regress_thread.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_thread.Tpo test/$(DEPDIR)/regress-regress_thread.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_thread.c' object='test/regress-regress_thread.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_thread.o `test -f 'test/regress_thread.c' || echo '$(srcdir)/'`test/regress_thread.c + +test/regress-regress_thread.obj: test/regress_thread.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_thread.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_thread.Tpo -c -o test/regress-regress_thread.obj `if test -f 'test/regress_thread.c'; then $(CYGPATH_W) 'test/regress_thread.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_thread.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_thread.Tpo test/$(DEPDIR)/regress-regress_thread.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_thread.c' object='test/regress-regress_thread.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_thread.obj `if test -f 'test/regress_thread.c'; then $(CYGPATH_W) 'test/regress_thread.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_thread.c'; fi` + +test/regress-regress_zlib.o: test/regress_zlib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_zlib.o -MD -MP -MF test/$(DEPDIR)/regress-regress_zlib.Tpo -c -o test/regress-regress_zlib.o `test -f 'test/regress_zlib.c' || echo '$(srcdir)/'`test/regress_zlib.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_zlib.Tpo test/$(DEPDIR)/regress-regress_zlib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_zlib.c' object='test/regress-regress_zlib.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_zlib.o `test -f 'test/regress_zlib.c' || echo '$(srcdir)/'`test/regress_zlib.c + +test/regress-regress_zlib.obj: test/regress_zlib.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_zlib.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_zlib.Tpo -c -o test/regress-regress_zlib.obj `if test -f 'test/regress_zlib.c'; then $(CYGPATH_W) 'test/regress_zlib.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_zlib.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_zlib.Tpo test/$(DEPDIR)/regress-regress_zlib.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_zlib.c' object='test/regress-regress_zlib.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_zlib.obj `if test -f 'test/regress_zlib.c'; then $(CYGPATH_W) 'test/regress_zlib.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_zlib.c'; fi` + +test/regress-regress_iocp.o: test/regress_iocp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_iocp.o -MD -MP -MF test/$(DEPDIR)/regress-regress_iocp.Tpo -c -o test/regress-regress_iocp.o `test -f 'test/regress_iocp.c' || echo '$(srcdir)/'`test/regress_iocp.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_iocp.Tpo test/$(DEPDIR)/regress-regress_iocp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_iocp.c' object='test/regress-regress_iocp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_iocp.o `test -f 'test/regress_iocp.c' || echo '$(srcdir)/'`test/regress_iocp.c + +test/regress-regress_iocp.obj: test/regress_iocp.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_iocp.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_iocp.Tpo -c -o test/regress-regress_iocp.obj `if test -f 'test/regress_iocp.c'; then $(CYGPATH_W) 'test/regress_iocp.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_iocp.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_iocp.Tpo test/$(DEPDIR)/regress-regress_iocp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_iocp.c' object='test/regress-regress_iocp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_iocp.obj `if test -f 'test/regress_iocp.c'; then $(CYGPATH_W) 'test/regress_iocp.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_iocp.c'; fi` + +test/regress-regress_openssl.o: test/regress_openssl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_openssl.o -MD -MP -MF test/$(DEPDIR)/regress-regress_openssl.Tpo -c -o test/regress-regress_openssl.o `test -f 'test/regress_openssl.c' || echo '$(srcdir)/'`test/regress_openssl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_openssl.Tpo test/$(DEPDIR)/regress-regress_openssl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_openssl.c' object='test/regress-regress_openssl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_openssl.o `test -f 'test/regress_openssl.c' || echo '$(srcdir)/'`test/regress_openssl.c + +test/regress-regress_openssl.obj: test/regress_openssl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_openssl.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_openssl.Tpo -c -o test/regress-regress_openssl.obj `if test -f 'test/regress_openssl.c'; then $(CYGPATH_W) 'test/regress_openssl.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_openssl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_openssl.Tpo test/$(DEPDIR)/regress-regress_openssl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_openssl.c' object='test/regress-regress_openssl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_openssl.obj `if test -f 'test/regress_openssl.c'; then $(CYGPATH_W) 'test/regress_openssl.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_openssl.c'; fi` + +test/regress-regress_mbedtls.o: test/regress_mbedtls.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_mbedtls.o -MD -MP -MF test/$(DEPDIR)/regress-regress_mbedtls.Tpo -c -o test/regress-regress_mbedtls.o `test -f 'test/regress_mbedtls.c' || echo '$(srcdir)/'`test/regress_mbedtls.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_mbedtls.Tpo test/$(DEPDIR)/regress-regress_mbedtls.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_mbedtls.c' object='test/regress-regress_mbedtls.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_mbedtls.o `test -f 'test/regress_mbedtls.c' || echo '$(srcdir)/'`test/regress_mbedtls.c + +test/regress-regress_mbedtls.obj: test/regress_mbedtls.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/regress-regress_mbedtls.obj -MD -MP -MF test/$(DEPDIR)/regress-regress_mbedtls.Tpo -c -o test/regress-regress_mbedtls.obj `if test -f 'test/regress_mbedtls.c'; then $(CYGPATH_W) 'test/regress_mbedtls.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_mbedtls.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/regress-regress_mbedtls.Tpo test/$(DEPDIR)/regress-regress_mbedtls.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/regress_mbedtls.c' object='test/regress-regress_mbedtls.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_regress_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/regress-regress_mbedtls.obj `if test -f 'test/regress_mbedtls.c'; then $(CYGPATH_W) 'test/regress_mbedtls.c'; else $(CYGPATH_W) '$(srcdir)/test/regress_mbedtls.c'; fi` + +test/test_kq_collision-test-kq-collision.o: test/test-kq-collision.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_kq_collision_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_kq_collision-test-kq-collision.o -MD -MP -MF test/$(DEPDIR)/test_kq_collision-test-kq-collision.Tpo -c -o test/test_kq_collision-test-kq-collision.o `test -f 'test/test-kq-collision.c' || echo '$(srcdir)/'`test/test-kq-collision.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_kq_collision-test-kq-collision.Tpo test/$(DEPDIR)/test_kq_collision-test-kq-collision.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/test-kq-collision.c' object='test/test_kq_collision-test-kq-collision.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_kq_collision_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_kq_collision-test-kq-collision.o `test -f 'test/test-kq-collision.c' || echo '$(srcdir)/'`test/test-kq-collision.c + +test/test_kq_collision-test-kq-collision.obj: test/test-kq-collision.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_kq_collision_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_kq_collision-test-kq-collision.obj -MD -MP -MF test/$(DEPDIR)/test_kq_collision-test-kq-collision.Tpo -c -o test/test_kq_collision-test-kq-collision.obj `if test -f 'test/test-kq-collision.c'; then $(CYGPATH_W) 'test/test-kq-collision.c'; else $(CYGPATH_W) '$(srcdir)/test/test-kq-collision.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test/$(DEPDIR)/test_kq_collision-test-kq-collision.Tpo test/$(DEPDIR)/test_kq_collision-test-kq-collision.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test/test-kq-collision.c' object='test/test_kq_collision-test-kq-collision.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_kq_collision_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_kq_collision-test-kq-collision.obj `if test -f 'test/test-kq-collision.c'; then $(CYGPATH_W) 'test/test-kq-collision.c'; else $(CYGPATH_W) '$(srcdir)/test/test-kq-collision.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf sample/.libs sample/_libs + -rm -rf test/.libs test/_libs + +distclean-libtool: + -rm -f libtool config.lt +install-man3: $(man3_MANS) + @$(NORMAL_INSTALL) + @list1='$(man3_MANS)'; \ + list2=''; \ + test -n "$(man3dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.3[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ + done; } + +uninstall-man3: + @$(NORMAL_UNINSTALL) + @list='$(man3_MANS)'; test -n "$(man3dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) +install-include_event2HEADERS: $(include_event2_HEADERS) + @$(NORMAL_INSTALL) + @list='$(include_event2_HEADERS)'; test -n "$(include_event2dir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(include_event2dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(include_event2dir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(include_event2dir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(include_event2dir)" || exit $$?; \ + done + +uninstall-include_event2HEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_event2_HEADERS)'; test -n "$(include_event2dir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(include_event2dir)'; $(am__uninstall_files_from_dir) +install-nodist_include_event2HEADERS: $(nodist_include_event2_HEADERS) + @$(NORMAL_INSTALL) + @list='$(nodist_include_event2_HEADERS)'; test -n "$(include_event2dir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(include_event2dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(include_event2dir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(include_event2dir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(include_event2dir)" || exit $$?; \ + done + +uninstall-nodist_include_event2HEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_include_event2_HEADERS)'; test -n "$(include_event2dir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(include_event2dir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + output_system_information () \ + { \ + echo; \ + { uname -a | $(AWK) '{ \ + printf "System information (uname -a):"; \ + for (i = 1; i < NF; ++i) \ + { \ + if (i != 2) \ + printf " %s", $$i; \ + } \ + printf "\n"; \ +}'; } 2>&1; \ + if test -r /etc/os-release; then \ + echo "Distribution information (/etc/os-release):"; \ + sed 8q /etc/os-release; \ + elif test -r /etc/issue; then \ + echo "Distribution information (/etc/issue):"; \ + cat /etc/issue; \ + fi; \ + }; \ + please_report () \ + { \ +echo "Some test(s) failed. Please report this to $(PACKAGE_BUGREPORT),"; \ +echo "together with the test-suite.log file (gzipped) and your system"; \ +echo "information. Thanks."; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + output_system_information; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG) for debugging.$${std}";\ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + please_report | sed -e "s/^/$${col}/" -e s/'$$'/"$${std}"/; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @$(am__rm_f) $(RECHECK_LOGS) + @$(am__rm_f) $(RECHECK_LOGS:.log=.trs) + @$(am__rm_f) $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @$(am__rm_f) $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +test_runner_epoll.log: test_runner_epoll + @p='test_runner_epoll'; \ + b='test_runner_epoll'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test_runner_select.log: test_runner_select + @p='test_runner_select'; \ + b='test_runner_select'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test_runner_kqueue.log: test_runner_kqueue + @p='test_runner_kqueue'; \ + b='test_runner_kqueue'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test_runner_evport.log: test_runner_evport + @p='test_runner_evport'; \ + b='test_runner_evport'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test_runner_devpoll.log: test_runner_devpoll + @p='test_runner_devpoll'; \ + b='test_runner_devpoll'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test_runner_poll.log: test_runner_poll + @p='test_runner_poll'; \ + b='test_runner_poll'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test_runner_win32.log: test_runner_win32 + @p='test_runner_win32'; \ + b='test_runner_win32'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test_runner_wepoll.log: test_runner_wepoll + @p='test_runner_wepoll'; \ + b='test_runner_wepoll'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test_runner_timerfd.log: test_runner_timerfd + @p='test_runner_timerfd'; \ + b='test_runner_timerfd'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test_runner_changelist.log: test_runner_changelist + @p='test_runner_changelist'; \ + b='test_runner_changelist'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test_runner_timerfd_changelist.log: test_runner_timerfd_changelist + @p='test_runner_timerfd_changelist'; \ + b='test_runner_timerfd_changelist'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +test_runner_signalfd.log: test_runner_signalfd + @p='test_runner_signalfd'; \ + b='test_runner_signalfd'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + $(am__remove_distdir) + $(AM_V_at)$(MKDIR_P) "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-bzip3: distdir + tardir=$(distdir) && $(am__tar) | bzip3 -c >$(distdir).tar.bz3 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.bz3*) \ + bzip3 -dc $(distdir).tar.bz3 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \ + $(HEADERS) config.h evconfig-private.h +install-EXTRAPROGRAMS: install-libLTLIBRARIES + +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(include_event2dir)" "$(DESTDIR)$(include_event2dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -$(am__rm_f) $(TEST_LOGS) + -$(am__rm_f) $(TEST_LOGS:.log=.trs) + -$(am__rm_f) $(TEST_SUITE_LOG) + +clean-generic: + -$(am__rm_f) $(CLEANFILES) + +distclean-generic: + -$(am__rm_f) $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) + -$(am__rm_f) $(DISTCLEANFILES) + -$(am__rm_f) sample/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) sample/$(am__dirstamp) + -$(am__rm_f) test/$(DEPDIR)/$(am__dirstamp) + -$(am__rm_f) test/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -$(am__rm_f) $(BUILT_SOURCES) +@ENABLE_DOXYGEN_FALSE@clean-local: +@ENABLE_DOXYGEN_FALSE@install-data-local: +@ENABLE_DOXYGEN_FALSE@uninstall-local: +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ + clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f $(DEPDIR)/epoll_sub.Plo + -rm -f ./$(DEPDIR)/buffer.Plo + -rm -f ./$(DEPDIR)/buffer_iocp.Plo + -rm -f ./$(DEPDIR)/bufferevent.Plo + -rm -f ./$(DEPDIR)/bufferevent_async.Plo + -rm -f ./$(DEPDIR)/bufferevent_filter.Plo + -rm -f ./$(DEPDIR)/bufferevent_pair.Plo + -rm -f ./$(DEPDIR)/bufferevent_ratelim.Plo + -rm -f ./$(DEPDIR)/bufferevent_sock.Plo + -rm -f ./$(DEPDIR)/devpoll.Plo + -rm -f ./$(DEPDIR)/epoll.Plo + -rm -f ./$(DEPDIR)/evdns.Plo + -rm -f ./$(DEPDIR)/event.Plo + -rm -f ./$(DEPDIR)/event_iocp.Plo + -rm -f ./$(DEPDIR)/event_tagging.Plo + -rm -f ./$(DEPDIR)/evmap.Plo + -rm -f ./$(DEPDIR)/evport.Plo + -rm -f ./$(DEPDIR)/evrpc.Plo + -rm -f ./$(DEPDIR)/evthread.Plo + -rm -f ./$(DEPDIR)/evthread_pthread.Plo + -rm -f ./$(DEPDIR)/evthread_win32.Plo + -rm -f ./$(DEPDIR)/evutil.Plo + -rm -f ./$(DEPDIR)/evutil_rand.Plo + -rm -f ./$(DEPDIR)/evutil_time.Plo + -rm -f ./$(DEPDIR)/http.Plo + -rm -f ./$(DEPDIR)/kqueue.Plo + -rm -f ./$(DEPDIR)/libevent_mbedtls_la-bufferevent_mbedtls.Plo + -rm -f ./$(DEPDIR)/libevent_mbedtls_la-bufferevent_ssl.Plo + -rm -f ./$(DEPDIR)/libevent_openssl_la-bufferevent_openssl.Plo + -rm -f ./$(DEPDIR)/libevent_openssl_la-bufferevent_ssl.Plo + -rm -f ./$(DEPDIR)/listener.Plo + -rm -f ./$(DEPDIR)/log.Plo + -rm -f ./$(DEPDIR)/poll.Plo + -rm -f ./$(DEPDIR)/select.Plo + -rm -f ./$(DEPDIR)/sha1.Plo + -rm -f ./$(DEPDIR)/signal.Plo + -rm -f ./$(DEPDIR)/signalfd.Plo + -rm -f ./$(DEPDIR)/strlcpy.Plo + -rm -f ./$(DEPDIR)/watch.Plo + -rm -f ./$(DEPDIR)/wepoll.Plo + -rm -f ./$(DEPDIR)/win32select.Plo + -rm -f ./$(DEPDIR)/ws.Plo + -rm -f sample/$(DEPDIR)/becat-becat.Po + -rm -f sample/$(DEPDIR)/dns-example.Po + -rm -f sample/$(DEPDIR)/event-read-fifo.Po + -rm -f sample/$(DEPDIR)/hello-world.Po + -rm -f sample/$(DEPDIR)/http-connect.Po + -rm -f sample/$(DEPDIR)/http-server.Po + -rm -f sample/$(DEPDIR)/https_client-hostcheck.Po + -rm -f sample/$(DEPDIR)/https_client-https-client.Po + -rm -f sample/$(DEPDIR)/https_client-openssl_hostname_validation.Po + -rm -f sample/$(DEPDIR)/https_client_mbedtls-https-client.Po + -rm -f sample/$(DEPDIR)/le_proxy-le-proxy.Po + -rm -f sample/$(DEPDIR)/signal-test.Po + -rm -f sample/$(DEPDIR)/ssl_client_mbedtls-ssl-client-mbedtls.Po + -rm -f sample/$(DEPDIR)/time-test.Po + -rm -f sample/$(DEPDIR)/watch-timing.Po + -rm -f sample/$(DEPDIR)/ws-chat-server.Po + -rm -f test/$(DEPDIR)/bench.Po + -rm -f test/$(DEPDIR)/bench_cascade.Po + -rm -f test/$(DEPDIR)/bench_http.Po + -rm -f test/$(DEPDIR)/bench_httpclient.Po + -rm -f test/$(DEPDIR)/regress-regress.Po + -rm -f test/$(DEPDIR)/regress-regress.gen.Po + -rm -f test/$(DEPDIR)/regress-regress_buffer.Po + -rm -f test/$(DEPDIR)/regress-regress_bufferevent.Po + -rm -f test/$(DEPDIR)/regress-regress_dns.Po + -rm -f test/$(DEPDIR)/regress-regress_et.Po + -rm -f test/$(DEPDIR)/regress-regress_finalize.Po + -rm -f test/$(DEPDIR)/regress-regress_http.Po + -rm -f test/$(DEPDIR)/regress-regress_iocp.Po + -rm -f test/$(DEPDIR)/regress-regress_listener.Po + -rm -f test/$(DEPDIR)/regress-regress_main.Po + -rm -f test/$(DEPDIR)/regress-regress_mbedtls.Po + -rm -f test/$(DEPDIR)/regress-regress_minheap.Po + -rm -f test/$(DEPDIR)/regress-regress_openssl.Po + -rm -f test/$(DEPDIR)/regress-regress_rpc.Po + -rm -f test/$(DEPDIR)/regress-regress_testutils.Po + -rm -f test/$(DEPDIR)/regress-regress_thread.Po + -rm -f test/$(DEPDIR)/regress-regress_timer_timeout.Po + -rm -f test/$(DEPDIR)/regress-regress_util.Po + -rm -f test/$(DEPDIR)/regress-regress_watch.Po + -rm -f test/$(DEPDIR)/regress-regress_ws.Po + -rm -f test/$(DEPDIR)/regress-regress_zlib.Po + -rm -f test/$(DEPDIR)/regress-tinytest.Po + -rm -f test/$(DEPDIR)/test-changelist.Po + -rm -f test/$(DEPDIR)/test-closed.Po + -rm -f test/$(DEPDIR)/test-dumpevents.Po + -rm -f test/$(DEPDIR)/test-eof.Po + -rm -f test/$(DEPDIR)/test-fdleak.Po + -rm -f test/$(DEPDIR)/test-init.Po + -rm -f test/$(DEPDIR)/test-ratelim.Po + -rm -f test/$(DEPDIR)/test-time.Po + -rm -f test/$(DEPDIR)/test-weof.Po + -rm -f test/$(DEPDIR)/test_kq_collision-test-kq-collision.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local install-includeHEADERS \ + install-include_event2HEADERS install-man \ + install-nodist_include_event2HEADERS install-pkgconfigDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-dist_binSCRIPTS install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man3 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f $(DEPDIR)/epoll_sub.Plo + -rm -f ./$(DEPDIR)/buffer.Plo + -rm -f ./$(DEPDIR)/buffer_iocp.Plo + -rm -f ./$(DEPDIR)/bufferevent.Plo + -rm -f ./$(DEPDIR)/bufferevent_async.Plo + -rm -f ./$(DEPDIR)/bufferevent_filter.Plo + -rm -f ./$(DEPDIR)/bufferevent_pair.Plo + -rm -f ./$(DEPDIR)/bufferevent_ratelim.Plo + -rm -f ./$(DEPDIR)/bufferevent_sock.Plo + -rm -f ./$(DEPDIR)/devpoll.Plo + -rm -f ./$(DEPDIR)/epoll.Plo + -rm -f ./$(DEPDIR)/evdns.Plo + -rm -f ./$(DEPDIR)/event.Plo + -rm -f ./$(DEPDIR)/event_iocp.Plo + -rm -f ./$(DEPDIR)/event_tagging.Plo + -rm -f ./$(DEPDIR)/evmap.Plo + -rm -f ./$(DEPDIR)/evport.Plo + -rm -f ./$(DEPDIR)/evrpc.Plo + -rm -f ./$(DEPDIR)/evthread.Plo + -rm -f ./$(DEPDIR)/evthread_pthread.Plo + -rm -f ./$(DEPDIR)/evthread_win32.Plo + -rm -f ./$(DEPDIR)/evutil.Plo + -rm -f ./$(DEPDIR)/evutil_rand.Plo + -rm -f ./$(DEPDIR)/evutil_time.Plo + -rm -f ./$(DEPDIR)/http.Plo + -rm -f ./$(DEPDIR)/kqueue.Plo + -rm -f ./$(DEPDIR)/libevent_mbedtls_la-bufferevent_mbedtls.Plo + -rm -f ./$(DEPDIR)/libevent_mbedtls_la-bufferevent_ssl.Plo + -rm -f ./$(DEPDIR)/libevent_openssl_la-bufferevent_openssl.Plo + -rm -f ./$(DEPDIR)/libevent_openssl_la-bufferevent_ssl.Plo + -rm -f ./$(DEPDIR)/listener.Plo + -rm -f ./$(DEPDIR)/log.Plo + -rm -f ./$(DEPDIR)/poll.Plo + -rm -f ./$(DEPDIR)/select.Plo + -rm -f ./$(DEPDIR)/sha1.Plo + -rm -f ./$(DEPDIR)/signal.Plo + -rm -f ./$(DEPDIR)/signalfd.Plo + -rm -f ./$(DEPDIR)/strlcpy.Plo + -rm -f ./$(DEPDIR)/watch.Plo + -rm -f ./$(DEPDIR)/wepoll.Plo + -rm -f ./$(DEPDIR)/win32select.Plo + -rm -f ./$(DEPDIR)/ws.Plo + -rm -f sample/$(DEPDIR)/becat-becat.Po + -rm -f sample/$(DEPDIR)/dns-example.Po + -rm -f sample/$(DEPDIR)/event-read-fifo.Po + -rm -f sample/$(DEPDIR)/hello-world.Po + -rm -f sample/$(DEPDIR)/http-connect.Po + -rm -f sample/$(DEPDIR)/http-server.Po + -rm -f sample/$(DEPDIR)/https_client-hostcheck.Po + -rm -f sample/$(DEPDIR)/https_client-https-client.Po + -rm -f sample/$(DEPDIR)/https_client-openssl_hostname_validation.Po + -rm -f sample/$(DEPDIR)/https_client_mbedtls-https-client.Po + -rm -f sample/$(DEPDIR)/le_proxy-le-proxy.Po + -rm -f sample/$(DEPDIR)/signal-test.Po + -rm -f sample/$(DEPDIR)/ssl_client_mbedtls-ssl-client-mbedtls.Po + -rm -f sample/$(DEPDIR)/time-test.Po + -rm -f sample/$(DEPDIR)/watch-timing.Po + -rm -f sample/$(DEPDIR)/ws-chat-server.Po + -rm -f test/$(DEPDIR)/bench.Po + -rm -f test/$(DEPDIR)/bench_cascade.Po + -rm -f test/$(DEPDIR)/bench_http.Po + -rm -f test/$(DEPDIR)/bench_httpclient.Po + -rm -f test/$(DEPDIR)/regress-regress.Po + -rm -f test/$(DEPDIR)/regress-regress.gen.Po + -rm -f test/$(DEPDIR)/regress-regress_buffer.Po + -rm -f test/$(DEPDIR)/regress-regress_bufferevent.Po + -rm -f test/$(DEPDIR)/regress-regress_dns.Po + -rm -f test/$(DEPDIR)/regress-regress_et.Po + -rm -f test/$(DEPDIR)/regress-regress_finalize.Po + -rm -f test/$(DEPDIR)/regress-regress_http.Po + -rm -f test/$(DEPDIR)/regress-regress_iocp.Po + -rm -f test/$(DEPDIR)/regress-regress_listener.Po + -rm -f test/$(DEPDIR)/regress-regress_main.Po + -rm -f test/$(DEPDIR)/regress-regress_mbedtls.Po + -rm -f test/$(DEPDIR)/regress-regress_minheap.Po + -rm -f test/$(DEPDIR)/regress-regress_openssl.Po + -rm -f test/$(DEPDIR)/regress-regress_rpc.Po + -rm -f test/$(DEPDIR)/regress-regress_testutils.Po + -rm -f test/$(DEPDIR)/regress-regress_thread.Po + -rm -f test/$(DEPDIR)/regress-regress_timer_timeout.Po + -rm -f test/$(DEPDIR)/regress-regress_util.Po + -rm -f test/$(DEPDIR)/regress-regress_watch.Po + -rm -f test/$(DEPDIR)/regress-regress_ws.Po + -rm -f test/$(DEPDIR)/regress-regress_zlib.Po + -rm -f test/$(DEPDIR)/regress-tinytest.Po + -rm -f test/$(DEPDIR)/test-changelist.Po + -rm -f test/$(DEPDIR)/test-closed.Po + -rm -f test/$(DEPDIR)/test-dumpevents.Po + -rm -f test/$(DEPDIR)/test-eof.Po + -rm -f test/$(DEPDIR)/test-fdleak.Po + -rm -f test/$(DEPDIR)/test-init.Po + -rm -f test/$(DEPDIR)/test-ratelim.Po + -rm -f test/$(DEPDIR)/test-time.Po + -rm -f test/$(DEPDIR)/test-weof.Po + -rm -f test/$(DEPDIR)/test_kq_collision-test-kq-collision.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-dist_binSCRIPTS uninstall-includeHEADERS \ + uninstall-include_event2HEADERS uninstall-libLTLIBRARIES \ + uninstall-local uninstall-man \ + uninstall-nodist_include_event2HEADERS uninstall-pkgconfigDATA + +uninstall-man: uninstall-man3 + +.MAKE: all check check-am install install-am install-exec \ + install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ + check-TESTS check-am clean clean-cscope clean-generic \ + clean-libLTLIBRARIES clean-libtool clean-local \ + clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscope \ + cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-bzip3 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ + dist-zip dist-zstd distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-data-local \ + install-dist_binSCRIPTS install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-includeHEADERS install-include_event2HEADERS \ + install-info install-info-am install-libLTLIBRARIES \ + install-man install-man3 install-nodist_include_event2HEADERS \ + install-pdf install-pdf-am install-pkgconfigDATA install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \ + uninstall uninstall-am uninstall-dist_binSCRIPTS \ + uninstall-includeHEADERS uninstall-include_event2HEADERS \ + uninstall-libLTLIBRARIES uninstall-local uninstall-man \ + uninstall-man3 uninstall-nodist_include_event2HEADERS \ + uninstall-pkgconfigDATA + +.PRECIOUS: Makefile + + +$(SAMPLES) : libevent.la + +test_runner_epoll: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b EPOLL +test_runner_select: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b SELECT +test_runner_kqueue: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b KQUEUE +test_runner_evport: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b EVPORT +test_runner_devpoll: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b DEVPOLL +test_runner_poll: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b POLL +test_runner_win32: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b WIN32 +test_runner_wepoll: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b WEPOLL +test_runner_timerfd: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b "" -t +test_runner_changelist: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b "" -c +test_runner_timerfd_changelist: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b "" -T +test_runner_signalfd: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b "" -S + +test/regress.gen.c test/regress.gen.h: test/rpcgen-attempted + +test/rpcgen-attempted: test/regress.rpc event_rpcgen.py test/rpcgen_wrapper.sh + $(AM_V_GEN)date -u > $@ + $(AM_V_at)if $(srcdir)/test/rpcgen_wrapper.sh $(srcdir)/test; then \ + true; \ + else \ + echo "No Python installed; stubbing out RPC test." >&2; \ + echo " "> test/regress.gen.c; \ + echo "#define NO_PYTHON_EXISTS" > test/regress.gen.h; \ + fi + +$(TESTPROGRAMS) : libevent.la + +include/event2/event-config.h: config.h make-event-config.sed + $(AM_V_GEN)test -d include/event2 || $(MKDIR_P) include/event2 + $(AM_V_at)$(SED) -f $(srcdir)/make-event-config.sed < config.h > $@T + $(AM_V_at)mv -f $@T $@ + +verify: check + +# Add all needed rules defined in ax_prog_doxygen.m4 +@ENABLE_DOXYGEN_TRUE@@DX_RULES@ + +# Use 'make clean' to clean docs generated by doxygen. +@ENABLE_DOXYGEN_TRUE@clean-local: +@ENABLE_DOXYGEN_TRUE@ -rm -rf $(DX_CLEANFILES) + +# add "libevent_" prefix for man pages +# +# XXX: we cannot clean old man pages here since +# doxygen-rename-man-pages will be called twice: +# - for make +# - for make install +# (cmake works differently) +# +# Once this will be solved add the following to the target: +# +# -rm -fr $(man3_MAN_DIR)/libevent_* +@ENABLE_DOXYGEN_MAN_TRUE@@ENABLE_DOXYGEN_TRUE@doxygen-rename-man-pages: doxygen-doc +@ENABLE_DOXYGEN_MAN_TRUE@@ENABLE_DOXYGEN_TRUE@ echo "Rename man pages in $(man3_MAN_DIR)" +@ENABLE_DOXYGEN_MAN_TRUE@@ENABLE_DOXYGEN_TRUE@ @for p in $(man3_MAN_DIR)/*; do \ +@ENABLE_DOXYGEN_MAN_TRUE@@ENABLE_DOXYGEN_TRUE@ p=`basename $$p`; \ +@ENABLE_DOXYGEN_MAN_TRUE@@ENABLE_DOXYGEN_TRUE@ p_strip=$${p/libevent_/}; \ +@ENABLE_DOXYGEN_MAN_TRUE@@ENABLE_DOXYGEN_TRUE@ if [ ! "$$p_strip" = "$$p" ]; then continue; fi; \ +@ENABLE_DOXYGEN_MAN_TRUE@@ENABLE_DOXYGEN_TRUE@ mv '$(man3_MAN_DIR)/'$$p '$(man3_MAN_DIR)/'libevent_$$p; \ +@ENABLE_DOXYGEN_MAN_TRUE@@ENABLE_DOXYGEN_TRUE@ done +@ENABLE_DOXYGEN_MAN_TRUE@@ENABLE_DOXYGEN_TRUE@$(man3_MANS): doxygen-doc doxygen-rename-man-pages + +# Rules for installing docs generated by doxygen into $(htmldir), +# The typical value of $(htmldir) is '/usr/local/share/doc/$(PACKAGE)' +@ENABLE_DOXYGEN_TRUE@install-data-local: +@ENABLE_DOXYGEN_TRUE@ @if ! test -d "$(DESTDIR)$(htmldir)"; then \ +@ENABLE_DOXYGEN_TRUE@ echo "$(mkinstalldirs) '$(DESTDIR)$(htmldir)'"; \ +@ENABLE_DOXYGEN_TRUE@ $(mkinstalldirs) '$(DESTDIR)$(htmldir)'; \ +@ENABLE_DOXYGEN_TRUE@ fi +@ENABLE_DOXYGEN_TRUE@ @for d in $(docdirs); do \ +@ENABLE_DOXYGEN_TRUE@ echo "cp -pR $$d '$(DESTDIR)$(htmldir)/'"; \ +@ENABLE_DOXYGEN_TRUE@ cp -pR $$d '$(DESTDIR)$(htmldir)/'; \ +@ENABLE_DOXYGEN_TRUE@ done + +# Rules for uninstalling docs generated by doxygen from $(htmldir) +@ENABLE_DOXYGEN_TRUE@uninstall-local: +@ENABLE_DOXYGEN_TRUE@ @for d in $(docdirs); do \ +@ENABLE_DOXYGEN_TRUE@ d=`basename $$d`; \ +@ENABLE_DOXYGEN_TRUE@ echo "test ! -d '$(DESTDIR)$(htmldir)/'$$d || \ +@ENABLE_DOXYGEN_TRUE@ { find '$(DESTDIR)$(htmldir)/'$$d -type d ! -perm -200 -exec chmod u+w '{}' ';' && \ +@ENABLE_DOXYGEN_TRUE@ rm -rf '$(DESTDIR)$(htmldir)/'$$d; }"; \ +@ENABLE_DOXYGEN_TRUE@ test ! -d '$(DESTDIR)$(htmldir)/'$$d || \ +@ENABLE_DOXYGEN_TRUE@ { find '$(DESTDIR)$(htmldir)/'$$d -type d ! -perm -200 -exec chmod u+w '{}' ';' && \ +@ENABLE_DOXYGEN_TRUE@ rm -rf '$(DESTDIR)$(htmldir)/'$$d; }; \ +@ENABLE_DOXYGEN_TRUE@ done +@ENABLE_DOXYGEN_TRUE@ rmdir "$(DESTDIR)$(htmldir)/" || true + +@ENABLE_DOXYGEN_TRUE@doxygen: doxygen-doc +@ENABLE_DOXYGEN_TRUE@all: doxygen + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +# Tell GNU make to disable its built-in pattern rules. +%:: %,v +%:: RCS/%,v +%:: RCS/% +%:: s.% +%:: SCCS/s.% diff --git a/lib/monkey/mk_core/deps/libevent/Makefile.nmake b/lib/monkey/mk_core/deps/libevent/Makefile.nmake deleted file mode 100644 index f27cd61949a..00000000000 --- a/lib/monkey/mk_core/deps/libevent/Makefile.nmake +++ /dev/null @@ -1,82 +0,0 @@ -# WATCH OUT! This makefile is a work in progress. -*- makefile -*- -# -# I'm not very knowledgeable about MSVC and nmake beyond their most basic -# aspects. If anything here looks wrong to you, please let me know. - -# If OPENSSL_DIR is not set, builds without OpenSSL support. If you want -# OpenSSL support, you can set the OPENSSL_DIR variable to where you -# installed OpenSSL. This can be done in the environment: -# set OPENSSL_DIR=c:\openssl -# Or on the nmake command line: -# nmake OPENSSL_DIR=C:\openssl -f Makefile.nmake -# Or by uncommenting the following line here in the makefile... - -# OPENSSL_DIR=c:\openssl - -!IFDEF OPENSSL_DIR -SSL_CFLAGS=/I$(OPENSSL_DIR)\include /DEVENT__HAVE_OPENSSL -!ELSE -SSL_CFLAGS= -!ENDIF - -# Needed for correctness -CFLAGS=/IWIN32-Code /IWIN32-Code/nmake /Iinclude /Icompat /DHAVE_CONFIG_H /I. $(SSL_CFLAGS) - -# For optimization and warnings -CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo - -# XXXX have a debug mode - -LIBFLAGS=/nologo - -CORE_OBJS=event.obj buffer.obj bufferevent.obj bufferevent_sock.obj \ - bufferevent_pair.obj listener.obj evmap.obj log.obj evutil.obj \ - strlcpy.obj signal.obj bufferevent_filter.obj evthread.obj \ - bufferevent_ratelim.obj evutil_rand.obj evutil_time.obj -WIN_OBJS=win32select.obj evthread_win32.obj buffer_iocp.obj \ - event_iocp.obj bufferevent_async.obj -EXTRA_OBJS=event_tagging.obj http.obj evdns.obj evrpc.obj - -!IFDEF OPENSSL_DIR -SSL_OBJS=bufferevent_openssl.obj -SSL_LIBS=libevent_openssl.lib -!ELSE -SSL_OBJS= -SSL_LIBS= -!ENDIF - -ALL_OBJS=$(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS) $(SSL_OBJS) -STATIC_LIBS=libevent_core.lib libevent_extras.lib libevent.lib $(SSL_LIBS) - - -all: static_libs tests - -static_libs: $(STATIC_LIBS) - -libevent_core.lib: $(CORE_OBJS) $(WIN_OBJS) - lib $(LIBFLAGS) $(CORE_OBJS) $(WIN_OBJS) /out:libevent_core.lib - -libevent_extras.lib: $(EXTRA_OBJS) - lib $(LIBFLAGS) $(EXTRA_OBJS) /out:libevent_extras.lib - -libevent.lib: $(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS) - lib $(LIBFLAGS) $(CORE_OBJS) $(EXTRA_OBJS) $(WIN_OBJS) /out:libevent.lib - -libevent_openssl.lib: $(SSL_OBJS) - lib $(LIBFLAGS) $(SSL_OBJS) /out:libevent_openssl.lib - -clean: - del $(ALL_OBJS) - del $(STATIC_LIBS) - cd test - $(MAKE) /F Makefile.nmake clean - cd .. - -tests: - cd test -!IFDEF OPENSSL_DIR - $(MAKE) OPENSSL_DIR=$(OPENSSL_DIR) /F Makefile.nmake -!ELSE - $(MAKE) /F Makefile.nmake -!ENDIF - cd .. diff --git a/lib/monkey/mk_core/deps/libevent/PrivacyInfo.xcprivacy b/lib/monkey/mk_core/deps/libevent/PrivacyInfo.xcprivacy new file mode 100644 index 00000000000..2ed80999130 --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/PrivacyInfo.xcprivacy @@ -0,0 +1,23 @@ + + + + + NSPrivacyTracking + + NSPrivacyCollectedDataTypes + + NSPrivacyTrackingDomains + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + 0A2A.1 + + + + + diff --git a/lib/monkey/mk_core/deps/libevent/README.md b/lib/monkey/mk_core/deps/libevent/README.md index fd91087a509..8bfb01883e7 100644 --- a/lib/monkey/mk_core/deps/libevent/README.md +++ b/lib/monkey/mk_core/deps/libevent/README.md @@ -1,197 +1,72 @@

    - libevent logo + libevent logo

    -[![Appveyor Win32 Build Status](https://ci.appveyor.com/api/projects/status/github/libevent/libevent?branch=master&svg=true)](https://ci.appveyor.com/project/nmathewson/libevent) -[![Travis Build Status](https://travis-ci.org/libevent/libevent.svg?branch=master)](https://travis-ci.org/libevent/libevent) +[![CI](https://github.com/libevent/libevent/actions/workflows/build.yml/badge.svg)](https://github.com/libevent/libevent/actions/workflows/build.yml) [![Coverage Status](https://coveralls.io/repos/github/libevent/libevent/badge.svg)](https://coveralls.io/github/libevent/libevent) +[![Join the chat at https://gitter.im/libevent/libevent](https://badges.gitter.im/libevent/libevent.svg)](https://gitter.im/libevent/libevent?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![doxygen](https://img.shields.io/badge/doxygen-documentation-blue.svg)](https://libevent.org/doc) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/libevent/libevent/badge)](https://securityscorecards.dev/viewer/?uri=github.com/libevent/libevent) -# 0. BUILDING AND INSTALLATION (Briefly) +# 1. BUILDING AND INSTALLATION -## Autoconf - - $ ./configure - $ make - $ make verify # (optional) - $ sudo make install - -## Cmake (General) - - -The following Libevent specific Cmake variables are as follows (the values being -the default). - -``` -# Installation directory for executables -EVENT_INSTALL_BIN_DIR:PATH=bin - -# Installation directory for CMake files -EVENT_INSTALL_CMAKE_DIR:PATH=lib/cmake/libevent - -## Installation directory for header files -EVENT_INSTALL_INCLUDE_DIR:PATH=include - -## Installation directory for libraries -EVENT_INSTALL_LIB_DIR:PATH=lib - -## Define if libevent should be built with shared libraries instead of archives -EVENT__BUILD_SHARED_LIBRARIES:BOOL=OFF - -# Enable running gcov to get a test coverage report (only works with -# GCC/CLang). Make sure to enable -DCMAKE_BUILD_TYPE=Debug as well. -EVENT__COVERAGE:BOOL=OFF - -# Defines if libevent should build without the benchmark exectuables -EVENT__DISABLE_BENCHMARK:BOOL=OFF - -# Define if libevent should build without support for a debug mode -EVENT__DISABLE_DEBUG_MODE:BOOL=OFF - -# Define if libevent should not allow replacing the mm functions -EVENT__DISABLE_MM_REPLACEMENT:BOOL=OFF - -# Define if libevent should build without support for OpenSSL encrpytion -EVENT__DISABLE_OPENSSL:BOOL=ON - -# Disable the regress tests -EVENT__DISABLE_REGRESS:BOOL=OFF - -# Disable sample files -EVENT__DISABLE_SAMPLES:BOOL=OFF - -# If tests should be compiled or not -EVENT__DISABLE_TESTS:BOOL=OFF - -# Define if libevent should not be compiled with thread support -EVENT__DISABLE_THREAD_SUPPORT:BOOL=OFF - -# Enables verbose debugging -EVENT__ENABLE_VERBOSE_DEBUG:BOOL=OFF - -# When crosscompiling forces running a test program that verifies that Kqueue -# works with pipes. Note that this requires you to manually run the test program -# on the the cross compilation target to verify that it works. See cmake -# documentation for try_run for more details -EVENT__FORCE_KQUEUE_CHECK:BOOL=OFF +## CMake (Unix) -# set EVENT_STAGE_VERSION -EVENT__STAGE_VERSION:STRING=beta +```sh +mkdir build && cd build +cmake .. # Default to Unix Makefiles. +make +make verify # (optional) ``` -__More variables can be found by running `cmake -LAH `__ - +See [Documentation/Building#Building on Unix using CMake](/Documentation/Building.md#building-on-unix-cmake) for more information. ## CMake (Windows) -Install CMake: - - - $ md build && cd build - $ cmake -G "Visual Studio 10" .. # Or whatever generator you want to use cmake --help for a list. - $ start libevent.sln - -## CMake (Unix) - - $ mkdir build && cd build - $ cmake .. # Default to Unix Makefiles. - $ make - $ make verify # (optional) - +Install CMake: -# 1. BUILDING AND INSTALLATION (In Depth) - -## Autoconf - -To build libevent, type - - $ ./configure && make - - - (If you got libevent from the git repository, you will - first need to run the included "autogen.sh" script in order to - generate the configure script.) - -You can run the regression tests by running - - $ make verify - -Install as root via - - $ make install - -Before reporting any problems, please run the regression tests. - -To enable the low-level tracing build the library as: - - $ CFLAGS=-DUSE_DEBUG ./configure [...] - -Standard configure flags should work. In particular, see: - - --disable-shared Only build static libraries - --prefix Install all files relative to this directory. - - -The configure script also supports the following flags: - - --enable-gcc-warnings Enable extra compiler checking with GCC. - --disable-malloc-replacement - Don't let applications replace our memory - management functions - --disable-openssl Disable support for OpenSSL encryption. - --disable-thread-support Don't support multithreaded environments. - -## CMake (Windows) - -(Note that autoconf is currently the most mature and supported build -enviroment for libevent; the cmake instructions here are new and -experimental, though they _should_ be solid. We hope that cmake will -still be supported in future versions of Libevent, and will try to -make sure that happens.) +```sh +md build && cd build +cmake -G "Visual Studio 10" .. # Or use any generator you want to use. Run cmake --help for a list +cmake --build . --config Release # Or "start libevent.sln" and build with menu in Visual Studio. +``` -First of all install . +See [Documentation/Building#Building on Windows](/Documentation/Building.md#building-on-windows) for more information. -To build libevent using Microsoft Visual studio open the "Visual Studio Command prompt" and type: +## Package Managers -``` -$ cd -$ mkdir build && cd build -$ cmake -G "Visual Studio 10" .. # Or whatever generator you want to use cmake --help for a list. -$ start libevent.sln +You can download and install libevent using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager: +```sh +git clone https://github.com/Microsoft/vcpkg.git +cd vcpkg +./bootstrap-vcpkg.sh +./vcpkg integrate install +./vcpkg install libevent ``` -In the above, the ".." refers to the dir containing the Libevent source code. -You can build multiple versions (with different compile time settings) from the same source tree -by creating other build directories. +The libevent port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. -It is highly recommended to build "out of source" when using -CMake instead of "in source" like the normal behaviour of autoconf for this reason. - -The "NMake Makefiles" CMake generator can be used to build entirely via the command line. +## Autoconf -To get a list of settings available for the project you can type: +*Note, since 2.2 it is deprecated* +```sh +./configure +make +make verify # (optional) +sudo make install ``` -$ cmake -LH .. -``` - -### GUI -CMake also provides a GUI that lets you specify the source directory and output (binary) directory -that the build should be placed in. - -### OpenSSL support - -To build Libevent with OpenSSL support you will need to have OpenSSL binaries available when building, -these can be found here: +See [Documentation/Building#Autoconf](/Documentation/Building.md#autotools-deprecated) for more information. # 2. USEFUL LINKS: For the latest released version of Libevent, see the official website at - . + . There's a pretty good work-in-progress manual up at . @@ -199,229 +74,29 @@ There's a pretty good work-in-progress manual up at For the latest development versions of Libevent, access our Git repository via -``` +```sh $ git clone https://github.com/libevent/libevent.git ``` You can browse the git repository online at: - + To report bugs, issues, or ask for new features: __Patches__: https://github.com/libevent/libevent/pulls -> OK, those are not really _patches_ You fork, modify, and hit the "Create Pull Request" button. -> You can still submit normal git patchs via the mailing list. +> OK, those are not really _patches_. You fork, modify, and hit the "Create Pull Request" button. +> You can still submit normal git patches via the mailing list. -__Bugs, Features [RFC], and Issus__: https://github.com/libevent/libevent/issues +__Bugs, Features [RFC], and Issues__: https://github.com/libevent/libevent/issues > Or you can do it via the mailing list. There's also a libevent-users mailing list for talking about Libevent use and development: - + # 3. ACKNOWLEDGMENTS -The following people have helped with suggestions, ideas, code or -fixing bugs: - - * Samy Al Bahra - * Antony Antony - * Jacob Appelbaum - * Arno Bakker - * Weston Andros Adamson - * William Ahern - * Ivan Andropov - * Sergey Avseyev - * Avi Bab - * Joachim Bauch - * Andrey Belobrov - * Gilad Benjamini - * Stas Bekman - * Denis Bilenko - * Julien Blache - * Kevin Bowling - * Tomash Brechko - * Kelly Brock - * Ralph Castain - * Adrian Chadd - * Lawnstein Chan - * Shuo Chen - * Ka-Hing Cheung - * Andrew Cox - * Paul Croome - * George Danchev - * Andrew Danforth - * Ed Day - * Christopher Davis - * Mike Davis - * Frank Denis - * Antony Dovgal - * Mihai Draghicioiu - * Alexander Drozdov - * Mark Ellzey - * Shie Erlich - * Leonid Evdokimov - * Juan Pablo Fernandez - * Christophe Fillot - * Mike Frysinger - * Remi Gacogne - * Artem Germanov - * Alexander von Gernler - * Diego Giagio - * Artur Grabowski - * Diwaker Gupta - * Kuldeep Gupta - * Sebastian Hahn - * Dave Hart - * Greg Hazel - * Nicholas Heath - * Michael Herf - * Savg He - * Mark Heily - * Maxime Henrion - * Michael Herf - * Greg Hewgill - * Andrew Hochhaus - * Aaron Hopkins - * Tani Hosokawa - * Jamie Iles - * Xiuqiang Jiang - * Claudio Jeker - * Evan Jones - * Marcin Juszkiewicz - * George Kadianakis - * Makoto Kato - * Phua Keat - * Azat Khuzhin - * Alexander Klauer - * Kevin Ko - * Brian Koehmstedt - * Marko Kreen - * Ondřej Kuzník - * Valery Kyholodov - * Ross Lagerwall - * Scott Lamb - * Christopher Layne - * Adam Langley - * Graham Leggett - * Volker Lendecke - * Philip Lewis - * Zhou Li - * David Libenzi - * Yan Lin - * Moshe Litvin - * Simon Liu - * Mitchell Livingston - * Hagne Mahre - * Lubomir Marinov - * Abilio Marques - * Nicolas Martyanoff - * Abel Mathew - * Nick Mathewson - * James Mansion - * Nicholas Marriott - * Andrey Matveev - * Caitlin Mercer - * Dagobert Michelsen - * Andrea Montefusco - * Mansour Moufid - * Mina Naguib - * Felix Nawothnig - * Trond Norbye - * Linus Nordberg - * Richard Nyberg - * Jon Oberheide - * John Ohl - * Phil Oleson - * Alexey Ozeritsky - * Dave Pacheco - * Derrick Pallas - * Tassilo von Parseval - * Catalin Patulea - * Patrick Pelletier - * Simon Perreault - * Dan Petro - * Pierre Phaneuf - * Amarin Phaosawasdi - * Ryan Phillips - * Dimitre Piskyulev - * Pavel Plesov - * Jon Poland - * Roman Puls - * Nate R - * Robert Ransom - * Balint Reczey - * Bert JW Regeer - * Nate Rosenblum - * Peter Rosin - * Maseeb Abdul Qadir - * Wang Qin - * Alex S - * Gyepi Sam - * Hanna Schroeter - * Ralf Schmitt - * Mike Smellie - * Steve Snyder - * Nir Soffer - * Dug Song - * Dongsheng Song - * Hannes Sowa - * Joakim Soderberg - * Joseph Spadavecchia - * Kevin Springborn - * Harlan Stenn - * Andrew Sweeney - * Ferenc Szalai - * Brodie Thiesfield - * Jason Toffaletti - * Brian Utterback - * Gisle Vanem - * Bas Verhoeven - * Constantine Verutin - * Colin Watt - * Zack Weinberg - * Jardel Weyrich - * Jay R. Wren - * Zack Weinberg - * Mobai Zhang - * Alejo - * Alex - * Taral - * propanbutan - * masksqwe - * mmadia - * yangacer - * Andrey Skriabin - * basavesh.as - * billsegall - * Bill Vaughan - * Christopher Wiley - * David Paschich - * Ed Schouten - * Eduardo Panisset - * Jan Heylen - * jer-gentoo - * Joakim Söderberg - * kirillDanshin - * lzmths - * Marcus Sundberg - * Mark Mentovai - * Mattes D - * Matyas Dolak - * Neeraj Badlani - * Nick Mathewson - * Rainer Keller - * Seungmo Koo - * Thomas Bernard - * Xiao Bao Clark - * zeliard - * Zonr Chang - * Kurt Roeckx - * Seven - * Simone Basso - * Vlad Shcherban - * Tim Hentenaar - -If we have forgotten your name, please contact us. +The [following people](/CONTRIBUTORS.md) have helped with suggestions, ideas, +code or fixing bugs. diff --git a/lib/monkey/mk_core/deps/libevent/VERSION b/lib/monkey/mk_core/deps/libevent/VERSION deleted file mode 100644 index 3774b6ba9b9..00000000000 --- a/lib/monkey/mk_core/deps/libevent/VERSION +++ /dev/null @@ -1,5 +0,0 @@ -commit 68def4352c270fe597d3253b3e20cbe974e2f7d5 -Merge: 23f9a20 360aa23 -Author: Azat Khuzhin -Date: Mon Dec 19 01:26:43 2016 +0300 - diff --git a/lib/monkey/mk_core/deps/libevent/Vagrantfile b/lib/monkey/mk_core/deps/libevent/Vagrantfile deleted file mode 100644 index 94b2831b053..00000000000 --- a/lib/monkey/mk_core/deps/libevent/Vagrantfile +++ /dev/null @@ -1,400 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# DESCRIPTION: -# ============ -# Vagrant for running libevent tests with: -# - timeout 30min, to avoid hungs -# - run tests in parallel under ctest (10 concurency) -# - if you have uncommited changes, you should commit them first to check -# - unix only, because of some tar'ing to avoid one vm affect another -# -# ENVIRONMENT: -# ============ -# - NO_PKG -- do not install packages -# - NO_CMAKE -- do not run with cmake -# - NO_AUTOTOOLS -- do not run with autoconf/automake - -Vagrant.configure("2") do |config| - # to allow running boxes provisions in parallel, we can't share the same dirs - # via virtualbox, however sometimes it is the only way, so instead let's - # create an archive of HEAD (this way we will not have any trash there) and - # extract it for every box to the separate folder. - # - # P.S. we will change this --prefix with tar(1) --trasnform - system('git archive --prefix=libevent/ --output=.vagrant/libevent.tar HEAD') - - config.vm.provider "virtualbox" do |vb| - vb.memory = "512" - - # otherwise osx fails, anyway we do not need this - vb.customize ["modifyvm", :id, "--usb", "off"] - vb.customize ["modifyvm", :id, "--usbehci", "off"] - end - - # disable /vagrant share, in case we will not use default mount - config.vm.synced_folder ".", "/vagrant", disabled: true - - config.vm.define "ubuntu" do |ubuntu| - system('tar --overwrite --transform=s/libevent/libevent-linux/ -xf .vagrant/libevent.tar -C .vagrant/') - - ubuntu.vm.box = "ubuntu/xenial64" - ubuntu.vm.synced_folder ".vagrant/libevent-linux", "/vagrant", - type: "rsync" - - if ENV['NO_PKG'] != "true" - ubuntu.vm.provision "shell", inline: <<-SHELL - apt-get update - apt-get install -y zlib1g-dev libssl-dev python2.7 - apt-get install -y build-essential cmake ninja-build - apt-get install -y autoconf automake libtool - SHELL - end - - if ENV['NO_CMAKE'] != "true" - ubuntu.vm.provision "shell", privileged: false, inline: <<-SHELL - cd /vagrant - rm -fr .cmake-vagrant - mkdir -p .cmake-vagrant - cd .cmake-vagrant - cmake -G Ninja .. - - export CTEST_TEST_TIMEOUT=1800 - export CTEST_OUTPUT_ON_FAILURE=1 - export CTEST_PARALLEL_LEVEL=10 - cmake --build . --target verify - SHELL - end - - if ENV['NO_AUTOTOOLS'] != "true" - ubuntu.vm.provision "shell", privileged: false, inline: <<-SHELL - cd /vagrant - ./autogen.sh - ./configure - make -j4 verify - SHELL - end - end - - config.vm.define "freebsd" do |freebsd| - system('tar --overwrite --transform=s/libevent/libevent-freebsd/ -xf .vagrant/libevent.tar -C .vagrant/') - - freebsd.vm.box = "freebsd/FreeBSD-11.0-STABLE" - freebsd.vm.synced_folder ".vagrant/libevent-freebsd", "/vagrant", - type: "rsync", group: "wheel" - - # otherwise reports error - freebsd.ssh.shell = "sh" - - if ENV['NO_PKG'] != "true" - freebsd.vm.provision "shell", inline: <<-SHELL - pkg install --yes openssl cmake ninja automake autotools - SHELL - end - - if ENV['NO_CMAKE'] != "true" - freebsd.vm.provision "shell", privileged: false, inline: <<-SHELL - cd /vagrant - rm -fr .cmake-vagrant - mkdir -p .cmake-vagrant - cd .cmake-vagrant - cmake -G Ninja .. - - export CTEST_TEST_TIMEOUT=1800 - export CTEST_OUTPUT_ON_FAILURE=1 - export CTEST_PARALLEL_LEVEL=10 - cmake --build . --target verify - SHELL - end - - if ENV['NO_AUTOTOOLS'] != "true" - freebsd.vm.provision "shell", privileged: false, inline: <<-SHELL - cd /vagrant - ./autogen.sh - ./configure - make -j4 verify - SHELL - end - end - - config.vm.define "netbsd" do |netbsd| - system('tar --overwrite --transform=s/libevent/libevent-netbsd/ -xf .vagrant/libevent.tar -C .vagrant/') - - netbsd.vm.box = "kja/netbsd-7-amd64" - netbsd.vm.synced_folder ".vagrant/libevent-netbsd", "/vagrant", - type: "rsync", group: "wheel" - - # TODO: more reliable way to install packages - if ENV['NO_PKG'] != "true" - netbsd.vm.provision "shell", inline: <<-SHELL - pkg_add ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/x86_64/7.0_2016Q2/All/ncurses-6.0nb1.tgz - pkg_add ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/x86_64/7.0_2016Q2/All/ninja-build-1.7.1.tgz - pkg_add ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/x86_64/7.0_2016Q2/All/automake-1.15nb3.tgz - pkg_add ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/x86_64/7.0_2016Q2/All/cmake-3.5.2.tgz - SHELL - end - - if ENV['NO_CMAKE'] != "true" - netbsd.vm.provision "shell", privileged: false, inline: <<-SHELL - cd /vagrant - rm -fr .cmake-vagrant - mkdir -p .cmake-vagrant - cd .cmake-vagrant - cmake -G Ninja .. - - export CTEST_TEST_TIMEOUT=1800 - export CTEST_OUTPUT_ON_FAILURE=1 - export CTEST_PARALLEL_LEVEL=10 - cmake --build . --target verify - SHELL - end - - if ENV['NO_AUTOTOOLS'] != "true" - netbsd.vm.provision "shell", privileged: false, inline: <<-SHELL - cd /vagrant - ./autogen.sh - ./configure - make -j4 verify - SHELL - end - end - - config.vm.define "solaris" do |solaris| - system('tar --overwrite --transform=s/libevent/libevent-solaris/ -xf .vagrant/libevent.tar -C .vagrant/') - - # XXX: - # - solaris do not have '-or' it only has '-o' for find(1), so we can't use - # rsync - # - and autoconf(1) doesn't work on virtualbox share, ugh - solaris.vm.synced_folder ".vagrant/libevent-solaris", "/vagrant-vbox", - type: "virtualbox" - - solaris.vm.box = "tnarik/solaris10-minimal" - if ENV['NO_PKG'] != "true" - # TODO: opencsw does not include ninja(1) - solaris.vm.provision "shell", inline: <<-SHELL - pkgadd -d http://get.opencsw.org/now - pkgutil -U - pkgutil -y -i libssl_dev cmake rsync python gmake gcc5core automake autoconf libtool - SHELL - end - - # copy from virtualbox mount to newly created folder - solaris.vm.provision "shell", privileged: false, inline: <<-SHELL - rm -fr ~/vagrant - cp -r /vagrant-vbox ~/vagrant - SHELL - - if ENV['NO_CMAKE'] != "true" - # builtin compiler cc(1) is a wrapper, so we should use gcc5 manually, - # otherwise it will not work. - # Plus we should set some paths so that cmake/compiler can find tham. - solaris.vm.provision "shell", privileged: false, inline: <<-SHELL - export CMAKE_INCLUDE_PATH=/opt/csw/include - export CMAKE_LIBRARY_PATH=/opt/csw/lib - export CFLAGS=-I$CMAKE_INCLUDE_PATH - export LDFLAGS=-L$CMAKE_LIBRARY_PATH - - cd ~/vagrant - rm -rf .cmake-vagrant - mkdir -p .cmake-vagrant - cd .cmake-vagrant - cmake -DCMAKE_C_COMPILER=gcc .. - - export CTEST_TEST_TIMEOUT=1800 - export CTEST_OUTPUT_ON_FAILURE=1 - export CTEST_PARALLEL_LEVEL=10 - cmake --build . --target verify - SHELL - end - - if ENV['NO_AUTOTOOLS'] != "true" - # and we should set MAKE for `configure` otherwise it will try to use - # `make` - solaris.vm.provision "shell", privileged: false, inline: <<-SHELL - cd ~/vagrant - ./autogen.sh - MAKE=gmake ./configure - gmake -j4 verify - SHELL - end - end - - # known failures: - # - sometimes vm hangs - config.vm.define "osx" do |osx| - system('tar --overwrite --transform=s/libevent/libevent-osx/ -xf .vagrant/libevent.tar -C .vagrant/') - - osx.vm.synced_folder ".vagrant/libevent-osx", "/vagrant", - type: "rsync", group: "wheel" - - osx.vm.box = "jhcook/osx-elcapitan-10.11" - if ENV['NO_PKG'] != "true" - osx.vm.provision "shell", privileged: false, inline: <<-SHELL - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - - brew uninstall libtool - brew install libtool openssl ninja cmake autoconf automake - SHELL - end - - if ENV['NO_CMAKE'] != "true" - # we should set some paths so that cmake/compiler can find tham - osx.vm.provision "shell", privileged: false, inline: <<-SHELL - export OPENSSL_ROOT=$(echo /usr/local/Cellar/openssl/*) - export CMAKE_INCLUDE_PATH=$OPENSSL_ROOT/include - export CMAKE_LIBRARY_PATH=$OPENSSL_ROOT/lib - - cd /vagrant - mkdir -p .cmake-vagrant - cd .cmake-vagrant - cmake -G Ninja .. - - export CTEST_TEST_TIMEOUT=1800 - export CTEST_OUTPUT_ON_FAILURE=1 - export CTEST_PARALLEL_LEVEL=10 - cmake --build . --target verify - SHELL - end - - if ENV['NO_AUTOTOOLS'] != "true" - osx.vm.provision "shell", privileged: false, inline: <<-SHELL - export OPENSSL_ROOT=$(echo /usr/local/Cellar/openssl/*) - export CFLAGS=-I$OPENSSL_ROOT/include - export LDFLAGS=-L$OPENSSL_ROOT/lib - - cd /vagrant - ./autogen.sh - ./configure - make -j4 verify - SHELL - end - end - - config.vm.define "centos" do |centos| - system('tar --overwrite --transform=s/libevent/libevent-centos/ -xf .vagrant/libevent.tar -C .vagrant/') - - centos.vm.synced_folder ".vagrant/libevent-centos", "/vagrant", - type: "rsync", group: "wheel" - - centos.vm.box = "centos/7" - if ENV['NO_PKG'] != "true" - centos.vm.provision "shell", inline: <<-SHELL - echo "[russianfedora]" > /etc/yum.repos.d/russianfedora.repo - echo name=russianfedora >> /etc/yum.repos.d/russianfedora.repo - echo baseurl=http://mirror.yandex.ru/fedora/russianfedora/russianfedora/free/el/releases/7/Everything/x86_64/os/ >> /etc/yum.repos.d/russianfedora.repo - echo enabled=1 >> /etc/yum.repos.d/russianfedora.repo - echo gpgcheck=0 >> /etc/yum.repos.d/russianfedora.repo - SHELL - centos.vm.provision "shell", inline: <<-SHELL - yum -y install zlib-devel openssl-devel python - yum -y install gcc cmake ninja-build - yum -y install autoconf automake libtool - SHELL - end - - if ENV['NO_CMAKE'] != "true" - centos.vm.provision "shell", privileged: false, inline: <<-SHELL - cd /vagrant - rm -fr .cmake-vagrant - mkdir -p .cmake-vagrant - cd .cmake-vagrant - cmake -G Ninja .. - - export CTEST_TEST_TIMEOUT=1800 - export CTEST_OUTPUT_ON_FAILURE=1 - export CTEST_PARALLEL_LEVEL=10 - cmake --build . --target verify - SHELL - end - - if ENV['NO_AUTOTOOLS'] != "true" - centos.vm.provision "shell", privileged: false, inline: <<-SHELL - cd /vagrant - ./autogen.sh - ./configure - make -j4 verify - SHELL - end - end - - # known failures: - # - issues with timers (not enough allowed error) - config.vm.define "win" do |win| - system('tar --overwrite --transform=s/libevent/libevent-win/ -xf .vagrant/libevent.tar -C .vagrant/') - - # 512MB not enough after libtool install, huh - win.vm.provider "virtualbox" do |vb| - vb.memory = "1024" - end - - # windows does not have rsync builtin, let's use virtualbox for now - win.vm.synced_folder ".vagrant/libevent-win", "/vagrant", - type: "virtualbox" - - win.vm.box = "senglin/win-10-enterprise-vs2015community" - if ENV['NO_PKG'] != "true" - # box with vs2015 does not have C++ support, so let's install it manually - # plus chocolatey that includes in this box, can't handle sha1 checksum for - # cmake.install, so let's update it< - win.vm.provision "shell", inline: <<-SHELL - choco upgrade -y chocolatey -pre -f - choco install -y VisualStudioCommunity2013 - choco install -y openssl.light - choco install -y cygwin cyg-get - choco install -y cmake - choco install -y cmake.install - choco install -y python2 - SHELL - - # chocolatey openssl.light package does not contains headers - win.vm.provision "shell", inline: <<-SHELL - (new-object System.Net.WebClient).DownloadFile('http://strcpy.net/packages/Win32OpenSSL-1_0_2a.exe', '/openssl.exe') - /openssl.exe /silent /verysilent /sp- /suppressmsgboxes - SHELL - - # XXX: - # - cyg-get depends from cygwinsetup.exe - # https://github.com/chocolatey/chocolatey-coreteampackages/issues/200 - # - cyg-get only downloads, do not installs them, ugh. so let's do not use - # it - win.vm.provision "shell", privileged: false, inline: <<-SHELL - (new-object System.Net.WebClient).DownloadFile('https://cygwin.com/setup-x86_64.exe', '/tools/cygwin/cygwinsetup.exe') - - $env:PATH="/tools/cygwin/bin;$($env:PATH);/tools/cygwin" - - cygwinsetup --root c:/tools/cygwin/ --local-package-dir c:/tools/cygwin/packages/ --no-desktop --no-startmenu --verbose --quiet-mode --download --packages automake,autoconf,gcc-core,libtool,make,python,openssl-devel - cygwinsetup --root c:/tools/cygwin/ --local-package-dir c:/tools/cygwin/packages/ --no-desktop --no-startmenu --verbose --quiet-mode --local-install --packages automake,autoconf,gcc-core,libtool,make,python,openssl-devel - SHELL - end - - if ENV['NO_CMAKE'] != "true" - win.vm.provision "shell", privileged: false, inline: <<-SHELL - $env:PATH="/Program Files/CMake/bin;/tools/python2;$($env:PATH)" - - cd /vagrant - Remove-Item -Recurse -Force .cmake-vagrant - mkdir -p .cmake-vagrant - cd .cmake-vagrant - cmake -G "Visual Studio 12" .. - - $env:CTEST_TEST_TIMEOUT = "1800" - $env:CTEST_OUTPUT_ON_FAILURE = "1" - $env:CTEST_PARALLEL_LEVEL = "10" - cmake --build . --target verify - SHELL - end - - if ENV['NO_AUTOTOOLS'] != "true" - win.vm.provision "shell", privileged: false, inline: <<-SHELL - $env:PATH="/tools/cygwin/bin;$($env:PATH)" - - bash -lc "echo 'C:/tools/mingw64 /mingw ntfs binary 0 0' > /etc/fstab" - bash -lc "echo 'C:/OpenSSL-Win32 /ssl ntfs binary 0 0' >> /etc/fstab" - bash -lc "echo 'C:/vagrant /vagrant ntfs binary 0 0' >> /etc/fstab" - - bash -lc "exec 0&1; cd /vagrant; bash -x ./autogen.sh && ./configure LDFLAGS='-L/ssl -L/ssl/lib -L/ssl/lib/MinGW' CFLAGS=-I/ssl/include && make -j4 verify" - SHELL - end - end -end diff --git a/lib/monkey/mk_core/deps/libevent/WIN32-Code/getopt_long.c b/lib/monkey/mk_core/deps/libevent/WIN32-Code/getopt_long.c index 03f0c01a15e..092defbc4be 100644 --- a/lib/monkey/mk_core/deps/libevent/WIN32-Code/getopt_long.c +++ b/lib/monkey/mk_core/deps/libevent/WIN32-Code/getopt_long.c @@ -173,7 +173,8 @@ getopt_long(nargc, nargv, options, long_options, index) if ((retval = getopt_internal(nargc, nargv, options)) == -2) { char *current_argv = nargv[optind++] + 2, *has_equal; - int i, current_argv_len, match = -1; + int i, match = -1; + size_t current_argv_len; if (*current_argv == '\0') { return(-1); @@ -184,11 +185,11 @@ getopt_long(nargc, nargv, options, long_options, index) } else current_argv_len = strlen(current_argv); - for (i = 0; long_options[i].name; i++) { + for (i = 0; long_options[i].name; i++) { if (strncmp(current_argv, long_options[i].name, current_argv_len)) continue; - if (strlen(long_options[i].name) == (unsigned)current_argv_len) { + if (strlen(long_options[i].name) == current_argv_len) { match = i; break; } diff --git a/lib/monkey/mk_core/deps/libevent/WIN32-Code/nmake/evconfig-private.h b/lib/monkey/mk_core/deps/libevent/WIN32-Code/nmake/evconfig-private.h deleted file mode 100644 index 88e206272bf..00000000000 --- a/lib/monkey/mk_core/deps/libevent/WIN32-Code/nmake/evconfig-private.h +++ /dev/null @@ -1,6 +0,0 @@ -#if !defined(EVENT_EVCONFIG__PRIVATE_H_) && !defined(__MINGW32__) -#define EVENT_EVCONFIG__PRIVATE_H_ - -/* Nothing to see here. Move along. */ - -#endif diff --git a/lib/monkey/mk_core/deps/libevent/WIN32-Code/nmake/event2/event-config.h b/lib/monkey/mk_core/deps/libevent/WIN32-Code/nmake/event2/event-config.h deleted file mode 100644 index d96dfba1d74..00000000000 --- a/lib/monkey/mk_core/deps/libevent/WIN32-Code/nmake/event2/event-config.h +++ /dev/null @@ -1,360 +0,0 @@ -/* event2/event-config.h - * - * This file was generated by autoconf when libevent was built, and post- - * processed by Libevent so that its macros would have a uniform prefix. - * - * DO NOT EDIT THIS FILE. - * - * Do not rely on macros in this file existing in later versions. - */ -#ifndef EVENT_CONFIG_H__ -#define EVENT_CONFIG_H__ -/* config.h. Generated by configure. */ -/* config.h.in. Generated from configure.in by autoheader. */ - -/* Define if libevent should not allow replacing the mm functions */ -/* #undef EVENT__DISABLE_MM_REPLACEMENT */ - -/* Define if libevent should not be compiled with thread support */ -/* #undef EVENT__DISABLE_THREAD_SUPPORT */ - -/* Define if clock_gettime is available in libc */ -/* #undef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID */ - -/* Define is no secure id variant is available */ -/* #define _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID 1 */ -#define EVENT_DNS_USE_FTIME_FOR_ID_ 1 - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_ARPA_INET_H */ - -/* Define to 1 if you have the `clock_gettime' function. */ -/* #undef EVENT__HAVE_CLOCK_GETTIME */ - -/* Define if /dev/poll is available */ -/* #undef EVENT__HAVE_DEVPOLL */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_DLFCN_H */ - -/* Define if your system supports the epoll system calls */ -/* #undef EVENT__HAVE_EPOLL */ - -/* Define to 1 if you have the `epoll_ctl' function. */ -/* #undef EVENT__HAVE_EPOLL_CTL */ - -/* Define to 1 if you have the `eventfd' function. */ -/* #undef EVENT__HAVE_EVENTFD */ - -/* Define if your system supports event ports */ -/* #undef EVENT__HAVE_EVENT_PORTS */ - -/* Define to 1 if you have the `fcntl' function. */ -/* #undef EVENT__HAVE_FCNTL */ - -/* Define to 1 if you have the header file. */ -#define EVENT__HAVE_FCNTL_H 1 - -/* Define to 1 if you have the `getaddrinfo' function. */ -#define EVENT__HAVE_GETADDRINFO 1 - -/* Define to 1 if you have the `getnameinfo' function. */ -#define EVENT__HAVE_GETNAMEINFO 1 - -/* Define to 1 if you have the `getprotobynumber' function. */ -#define EVENT__HAVE_GETPROTOBYNUMBER 1 - -/* Define to 1 if you have the `getservbyname' function. */ -#define EVENT__HAVE_GETSERVBYNAME 1 - -/* Define to 1 if you have the `gettimeofday' function. */ -/* #define EVENT__HAVE_GETTIMEOFDAY 1 */ - -/* Define to 1 if you have the `inet_ntop' function. */ -/* #undef EVENT__HAVE_INET_NTOP */ - -/* Define to 1 if you have the `inet_pton' function. */ -/* #undef EVENT__HAVE_INET_PTON */ - -/* Define to 1 if you have the header file. */ -/* #define EVENT__HAVE_INTTYPES_H 1 */ - -/* Define to 1 if you have the `kqueue' function. */ -/* #undef EVENT__HAVE_KQUEUE */ - -/* Define if the system has zlib */ -/* #undef EVENT__HAVE_LIBZ */ - -/* Define to 1 if you have the header file. */ -#define EVENT__HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `mmap' function. */ -/* #undef EVENT__HAVE_MMAP */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_NETINET_IN6_H */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_NETINET_IN_H */ - -/* Define to 1 if you have the `pipe' function. */ -/* #undef EVENT__HAVE_PIPE */ - -/* Define to 1 if you have the `poll' function. */ -/* #undef EVENT__HAVE_POLL */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_POLL_H */ - -/* Define to 1 if you have the `port_create' function. */ -/* #undef EVENT__HAVE_PORT_CREATE */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_PORT_H */ - -/* Define if you have POSIX threads libraries and header files. */ -/* #undef EVENT__HAVE_PTHREAD */ - -/* Define if we have pthreads on this system */ -/* #undef EVENT__HAVE_PTHREADS */ - -/* Define to 1 if the system has the type `sa_family_t'. */ -/* #undef EVENT__HAVE_SA_FAMILY_T */ - -/* Define to 1 if you have the `select' function. */ -/* #undef EVENT__HAVE_SELECT */ - -/* Define to 1 if you have the `sendfile' function. */ -/* #undef EVENT__HAVE_SENDFILE */ - -/* Define if F_SETFD is defined in */ -/* #undef EVENT__HAVE_SETFD */ - -/* Define to 1 if you have the `sigaction' function. */ -/* #undef EVENT__HAVE_SIGACTION */ - -/* Define to 1 if you have the `signal' function. */ -#define EVENT__HAVE_SIGNAL 1 - -/* Define to 1 if you have the `splice' function. */ -/* #undef EVENT__HAVE_SPLICE */ - -/* Define to 1 if you have the header file. */ -#define EVENT__HAVE_STDARG_H 1 - -/* Define to 1 if you have the header file. */ -#define EVENT__HAVE_STDDEF_H 1 - -/* Define to 1 if you have the header file. */ -/* #define EVENT__HAVE_STDINT_H 1 */ - -/* Define to 1 if you have the header file. */ -#define EVENT__HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define EVENT__HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define EVENT__HAVE_STRING_H 1 - -/* Define to 1 if you have the `strlcpy' function. */ -/* #undef EVENT__HAVE_STRLCPY */ - -/* Define to 1 if you have the `strsep' function. */ -/* #undef EVENT__HAVE_STRSEP */ - -/* Define to 1 if you have the `strtok_r' function. */ -/* #undef EVENT__HAVE_STRTOK_R */ - -/* Define to 1 if you have the `strtoll' function. */ -/* #define EVENT__HAVE_STRTOLL 1 */ - -#define EVENT__HAVE_STRUCT_ADDRINFO 1 - -/* Define to 1 if the system has the type `struct in6_addr'. */ -#define EVENT__HAVE_STRUCT_IN6_ADDR 1 - -/* Define to 1 if `s6_addr16' is member of `struct in6_addr'. */ -#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16 1 - -/* Define to 1 if `s6_addr32' is member of `struct in6_addr'. */ -#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32 1 - -/* Define to 1 if the system has the type `struct sockaddr_in6'. */ -#define EVENT__HAVE_STRUCT_SOCKADDR_IN6 1 - -/* Define to 1 if `sin6_len' is member of `struct sockaddr_in6'. */ -/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */ - -/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */ -/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ - -/* Define to 1 if the system has the type `struct sockaddr_storage'. */ -#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE 1 - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_SYS_DEVPOLL_H */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_SYS_EPOLL_H */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_SYS_EVENTFD_H */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_SYS_EVENT_H */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_SYS_IOCTL_H */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_SYS_MMAN_H */ - -/* Define to 1 if you have the header file. */ -/* #define EVENT__HAVE_SYS_PARAM_H 1 */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_SYS_QUEUE_H */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_SYS_SELECT_H */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_SYS_SENDFILE_H */ - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_SYS_SOCKET_H */ - -/* Define to 1 if you have the header file. */ -#define EVENT__HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -/* #define EVENT__HAVE_SYS_TIME_H 1 */ - -/* Define to 1 if you have the header file. */ -#define EVENT__HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef EVENT__HAVE_SYS_UIO_H */ - -/* Define if TAILQ_FOREACH is defined in */ -/* #undef EVENT__HAVE_TAILQFOREACH */ - -/* Define if timeradd is defined in */ -/* #undef EVENT__HAVE_TIMERADD */ - -/* Define if timerclear is defined in */ -#define EVENT__HAVE_TIMERCLEAR 1 - -/* Define if timercmp is defined in */ -#define EVENT__HAVE_TIMERCMP 1 - -/* Define if timerisset is defined in */ -#define EVENT__HAVE_TIMERISSET 1 - -/* Define to 1 if the system has the type `uint16_t'. */ -/* #define EVENT__HAVE_UINT16_T 1 */ - -/* Define to 1 if the system has the type `uint32_t'. */ -/* #define EVENT__HAVE_UINT32_T 1 */ - -/* Define to 1 if the system has the type `uint64_t'. */ -/* #define EVENT__HAVE_UINT64_T 1 */ - -/* Define to 1 if the system has the type `uint8_t'. */ -/* #define EVENT__HAVE_UINT8_T 1 */ - -/* Define to 1 if you have the header file. */ -/* #define EVENT__HAVE_UNISTD_H 1 */ - -/* Define to 1 if you have the `vasprintf' function. */ -/* #undef EVENT__HAVE_VASPRINTF */ - -/* Define if kqueue works correctly with pipes */ -/* #undef EVENT__HAVE_WORKING_KQUEUE */ - -/* Numeric representation of the version */ -#define EVENT__NUMERIC_VERSION 0x02010700 - -/* Name of package */ -#define EVENT__PACKAGE "libevent" - -/* Define to the address where bug reports for this package should be sent. */ -#define EVENT__PACKAGE_BUGREPORT "" - -/* Define to the full name of this package. */ -#define EVENT__PACKAGE_NAME "" - -/* Define to the full name and version of this package. */ -#define EVENT__PACKAGE_STRING "" - -/* Define to the one symbol short name of this package. */ -#define EVENT__PACKAGE_TARNAME "" - -/* Define to the version of this package. */ -#define EVENT__PACKAGE_VERSION "" - -/* Define to necessary symbol if this constant uses a non-standard name on - your system. */ -/* #undef EVENT__PTHREAD_CREATE_JOINABLE */ - -/* The size of a `int', as computed by sizeof. */ -#define EVENT__SIZEOF_INT 4 - -/* The size of a `long', as computed by sizeof. */ -#define EVENT__SIZEOF_LONG 4 - -/* The size of a `long long', as computed by sizeof. */ -#define EVENT__SIZEOF_LONG_LONG 8 - -/* The size of a `short', as computed by sizeof. */ -#define EVENT__SIZEOF_SHORT 2 - -/* The size of `size_t', as computed by sizeof. */ -#ifdef _WIN64 -#define EVENT__SIZEOF_SIZE_T 8 -#else -#define EVENT__SIZEOF_SIZE_T 4 -#endif - -/* The size of `void *', as computed by sizeof. */ -#ifdef _WIN64 -#define EVENT__SIZEOF_VOID_P 8 -#else -#define EVENT__SIZEOF_VOID_P 4 -#endif - -/* Define to 1 if you have the ANSI C header files. */ -#define EVENT__STDC_HEADERS 1 - -/* Define to 1 if you can safely include both and . */ -#define EVENT__TIME_WITH_SYS_TIME 1 - -/* Version number of package */ -#define EVENT__VERSION "2.1.7-beta" - -/* Define to appropriate substitue if compiler doesnt have __func__ */ -#define EVENT____func__ __FUNCTION__ - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef EVENT__const */ - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef _EVENT___cplusplus -#define EVENT__inline __inline -#endif - -/* Define to `int' if does not define. */ -/* #undef EVENT__pid_t */ - -/* Define to `unsigned' if does not define. */ -/* #undef EVENT__size_t */ - -/* Define to unsigned int if you dont have it */ -#define EVENT__socklen_t unsigned int - -/* Define to `int' if does not define. */ -#define EVENT__ssize_t SSIZE_T - -#endif diff --git a/lib/monkey/mk_core/deps/libevent/aclocal.m4 b/lib/monkey/mk_core/deps/libevent/aclocal.m4 new file mode 100644 index 00000000000..f2b8a0a9f4c --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/aclocal.m4 @@ -0,0 +1,1680 @@ +# generated automatically by aclocal 1.18.1 -*- Autoconf -*- + +# Copyright (C) 1996-2025 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, +[m4_warning([this file was generated for autoconf 2.72. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*- +# serial 13 (pkgconf) + +dnl Copyright © 2004 Scott James Remnant . +dnl Copyright © 2012-2015 Dan Nicholson +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, but +dnl WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, see . +dnl +dnl As a special exception to the GNU General Public License, if you +dnl distribute this file as part of a program that contains a +dnl configuration script generated by Autoconf, you may include it under +dnl the same distribution terms that you use for the rest of that +dnl program. + +dnl PKG_PREREQ(MIN-VERSION) +dnl ----------------------- +dnl Since: 0.29 +dnl +dnl Verify that the version of the pkg-config macros are at least +dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's +dnl installed version of pkg-config, this checks the developer's version +dnl of pkg.m4 when generating configure. +dnl +dnl To ensure that this macro is defined, also add: +dnl m4_ifndef([PKG_PREREQ], +dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) +dnl +dnl See the "Since" comment for each macro you use to see what version +dnl of the macros you require. +m4_defun([PKG_PREREQ], +[m4_define([PKG_MACROS_VERSION], [0.29.2]) +m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, + [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) +])dnl PKG_PREREQ + +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION], [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------- +dnl Since: 0.16 +dnl +dnl Search for the pkg-config tool and set the PKG_CONFIG variable to +dnl first found in the path. Checks that the version of pkg-config found +dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is +dnl used since that's the first version where most current features of +dnl pkg-config existed. +dnl +dnl If pkg-config is not found or older than specified, it will result +dnl in an empty PKG_CONFIG variable. To avoid widespread issues with +dnl scripts not checking it, ACTION-IF-NOT-FOUND defaults to aborting. +dnl You can specify [PKG_CONFIG=false] as an action instead, which would +dnl result in pkg-config tests failing, but no bogus error messages. +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi +if test -z "$PKG_CONFIG"; then + m4_default([$2], [AC_MSG_ERROR([pkg-config not found])]) +fi[]dnl +])dnl PKG_PROG_PKG_CONFIG + +dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------------------------------- +dnl Since: 0.18 +dnl +dnl Check to see whether a particular set of modules exists. Similar to +dnl PKG_CHECK_MODULES(), but does not set variables or print errors. +dnl +dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +dnl only at the first occurrence in configure.ac, so if the first place +dnl it's called might be skipped (such as if it is within an "if", you +dnl have to call PKG_CHECK_EXISTS manually +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +dnl --------------------------------------------- +dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting +dnl pkg_failed based on the result. +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])dnl _PKG_CONFIG + +dnl _PKG_SHORT_ERRORS_SUPPORTED +dnl --------------------------- +dnl Internal check to see if pkg-config supports short errors. +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])dnl _PKG_SHORT_ERRORS_SUPPORTED + + +dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl -------------------------------------------------------------- +dnl Since: 0.4.0 +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES might not happen, you should be sure to include an +dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $2]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])dnl PKG_CHECK_MODULES + + +dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +dnl [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------------------- +dnl Since: 0.29 +dnl +dnl Checks for existence of MODULES and gathers its build flags with +dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags +dnl and VARIABLE-PREFIX_LIBS from --libs. +dnl +dnl Note that if there is a possibility the first call to +dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to +dnl include an explicit call to PKG_PROG_PKG_CONFIG in your +dnl configure.ac. +AC_DEFUN([PKG_CHECK_MODULES_STATIC], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +_save_PKG_CONFIG=$PKG_CONFIG +PKG_CONFIG="$PKG_CONFIG --static" +PKG_CHECK_MODULES($@) +PKG_CONFIG=$_save_PKG_CONFIG[]dnl +])dnl PKG_CHECK_MODULES_STATIC + + +dnl PKG_INSTALLDIR([DIRECTORY]) +dnl ------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable pkgconfigdir as the location where a module +dnl should install pkg-config .pc files. By default the directory is +dnl $libdir/pkgconfig, but the default can be changed by passing +dnl DIRECTORY. The user can override through the --with-pkgconfigdir +dnl parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_INSTALLDIR + + +dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) +dnl -------------------------------- +dnl Since: 0.27 +dnl +dnl Substitutes the variable noarch_pkgconfigdir as the location where a +dnl module should install arch-independent pkg-config .pc files. By +dnl default the directory is $datadir/pkgconfig, but the default can be +dnl changed by passing DIRECTORY. The user can override through the +dnl --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +])dnl PKG_NOARCH_INSTALLDIR + + +dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +dnl ------------------------------------------- +dnl Since: 0.28 +dnl +dnl Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])dnl PKG_CHECK_VAR + +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------ +dnl +dnl Prepare a "--with-" configure option using the lowercase +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and +dnl PKG_CHECK_MODULES in a single macro. +AC_DEFUN([PKG_WITH_MODULES], +[ +m4_pushdef([with_arg], m4_tolower([$1])) + +m4_pushdef([description], + [m4_default([$5], [build with ]with_arg[ support])]) + +m4_pushdef([def_arg], [m4_default([$6], [auto])]) +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) + +m4_case(def_arg, + [yes],[m4_pushdef([with_without], [--without-]with_arg)], + [m4_pushdef([with_without],[--with-]with_arg)]) + +AC_ARG_WITH(with_arg, + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, + [AS_TR_SH([with_]with_arg)=def_arg]) + +AS_CASE([$AS_TR_SH([with_]with_arg)], + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], + [auto],[PKG_CHECK_MODULES([$1],[$2], + [m4_n([def_action_if_found]) $3], + [m4_n([def_action_if_not_found]) $4])]) + +m4_popdef([with_arg]) +m4_popdef([description]) +m4_popdef([def_arg]) + +])dnl PKG_WITH_MODULES + +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ----------------------------------------------- +dnl +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES +dnl check._[VARIABLE-PREFIX] is exported as make variable. +AC_DEFUN([PKG_HAVE_WITH_MODULES], +[ +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) + +AM_CONDITIONAL([HAVE_][$1], + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) +])dnl PKG_HAVE_WITH_MODULES + +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, +dnl [DESCRIPTION], [DEFAULT]) +dnl ------------------------------------------------------ +dnl +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make +dnl and preprocessor variable. +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], +[ +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) + +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) +])dnl PKG_HAVE_DEFINE_WITH_MODULES + +# Copyright (C) 2002-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.18' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.18.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.18.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thus: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_IF_OPTION([tar-v7], [_AM_PROG_TAR([v7])], + [_AM_PROG_TAR([ustar])])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + +AC_REQUIRE([_AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +AC_REQUIRE([_AM_PROG_RM_F]) +AC_REQUIRE([_AM_PROG_XARGS_N]) + +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + # aligned with autoconf, so not including core; see bug#72225. + rm -f -r a.out a.exe b.out conftest.$ac_ext conftest.$ac_objext \ + conftest.dSYM conftest1.$ac_ext conftest1.$ac_objext conftest1.dSYM \ + conftest2.$ac_ext conftest2.$ac_objext conftest2.dSYM + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2022-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_RM_F +# --------------- +# Check whether 'rm -f' without any arguments works. +# https://bugs.gnu.org/10828 +AC_DEFUN([_AM_PROG_RM_F], +[am__rm_f_notfound= +AS_IF([(rm -f && rm -fr && rm -rf) 2>/dev/null], [], [am__rm_f_notfound='""']) +AC_SUBST(am__rm_f_notfound) +]) + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SLEEP_FRACTIONAL_SECONDS +# ---------------------------- +AC_DEFUN([_AM_SLEEP_FRACTIONAL_SECONDS], [dnl +AC_CACHE_CHECK([whether sleep supports fractional seconds], + am_cv_sleep_fractional_seconds, [dnl +AS_IF([sleep 0.001 2>/dev/null], [am_cv_sleep_fractional_seconds=yes], + [am_cv_sleep_fractional_seconds=no]) +])]) + +# _AM_FILESYSTEM_TIMESTAMP_RESOLUTION +# ----------------------------------- +# Determine the filesystem's resolution for file modification +# timestamps. The coarsest we know of is FAT, with a resolution +# of only two seconds, even with the most recent "exFAT" extensions. +# The finest (e.g. ext4 with large inodes, XFS, ZFS) is one +# nanosecond, matching clock_gettime. However, it is probably not +# possible to delay execution of a shell script for less than one +# millisecond, due to process creation overhead and scheduling +# granularity, so we don't check for anything finer than that. (See below.) +AC_DEFUN([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION], [dnl +AC_REQUIRE([_AM_SLEEP_FRACTIONAL_SECONDS]) +AC_CACHE_CHECK([filesystem timestamp resolution], + am_cv_filesystem_timestamp_resolution, [dnl +# Default to the worst case. +am_cv_filesystem_timestamp_resolution=2 + +# Only try to go finer than 1 sec if sleep can do it. +# Don't try 1 sec, because if 0.01 sec and 0.1 sec don't work, +# - 1 sec is not much of a win compared to 2 sec, and +# - it takes 2 seconds to perform the test whether 1 sec works. +# +# Instead, just use the default 2s on platforms that have 1s resolution, +# accept the extra 1s delay when using $sleep in the Automake tests, in +# exchange for not incurring the 2s delay for running the test for all +# packages. +# +am_try_resolutions= +if test "$am_cv_sleep_fractional_seconds" = yes; then + # Even a millisecond often causes a bunch of false positives, + # so just try a hundredth of a second. The time saved between .001 and + # .01 is not terribly consequential. + am_try_resolutions="0.01 0.1 $am_try_resolutions" +fi + +# In order to catch current-generation FAT out, we must *modify* files +# that already exist; the *creation* timestamp is finer. Use names +# that make ls -t sort them differently when they have equal +# timestamps than when they have distinct timestamps, keeping +# in mind that ls -t prints the *newest* file first. +rm -f conftest.ts? +: > conftest.ts1 +: > conftest.ts2 +: > conftest.ts3 + +# Make sure ls -t actually works. Do 'set' in a subshell so we don't +# clobber the current shell's arguments. (Outer-level square brackets +# are removed by m4; they're present so that m4 does not expand +# ; be careful, easy to get confused.) +if ( + set X `[ls -t conftest.ts[12]]` && + { + test "$[]*" != "X conftest.ts1 conftest.ts2" || + test "$[]*" != "X conftest.ts2 conftest.ts1"; + } +); then :; else + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + _AS_ECHO_UNQUOTED( + ["Bad output from ls -t: \"`[ls -t conftest.ts[12]]`\""], + [AS_MESSAGE_LOG_FD]) + AC_MSG_FAILURE([ls -t produces unexpected output. +Make sure there is not a broken ls alias in your environment.]) +fi + +for am_try_res in $am_try_resolutions; do + # Any one fine-grained sleep might happen to cross the boundary + # between two values of a coarser actual resolution, but if we do + # two fine-grained sleeps in a row, at least one of them will fall + # entirely within a coarse interval. + echo alpha > conftest.ts1 + sleep $am_try_res + echo beta > conftest.ts2 + sleep $am_try_res + echo gamma > conftest.ts3 + + # We assume that 'ls -t' will make use of high-resolution + # timestamps if the operating system supports them at all. + if (set X `ls -t conftest.ts?` && + test "$[]2" = conftest.ts3 && + test "$[]3" = conftest.ts2 && + test "$[]4" = conftest.ts1); then + # + # Ok, ls -t worked. If we're at a resolution of 1 second, we're done, + # because we don't need to test make. + make_ok=true + if test $am_try_res != 1; then + # But if we've succeeded so far with a subsecond resolution, we + # have one more thing to check: make. It can happen that + # everything else supports the subsecond mtimes, but make doesn't; + # notably on macOS, which ships make 3.81 from 2006 (the last one + # released under GPLv2). https://bugs.gnu.org/68808 + # + # We test $MAKE if it is defined in the environment, else "make". + # It might get overridden later, but our hope is that in practice + # it does not matter: it is the system "make" which is (by far) + # the most likely to be broken, whereas if the user overrides it, + # probably they did so with a better, or at least not worse, make. + # https://lists.gnu.org/archive/html/automake/2024-06/msg00051.html + # + # Create a Makefile (real tab character here): + rm -f conftest.mk + echo 'conftest.ts1: conftest.ts2' >conftest.mk + echo ' touch conftest.ts2' >>conftest.mk + # + # Now, running + # touch conftest.ts1; touch conftest.ts2; make + # should touch ts1 because ts2 is newer. This could happen by luck, + # but most often, it will fail if make's support is insufficient. So + # test for several consecutive successes. + # + # (We reuse conftest.ts[12] because we still want to modify existing + # files, not create new ones, per above.) + n=0 + make=${MAKE-make} + until test $n -eq 3; do + echo one > conftest.ts1 + sleep $am_try_res + echo two > conftest.ts2 # ts2 should now be newer than ts1 + if $make -f conftest.mk | grep 'up to date' >/dev/null; then + make_ok=false + break # out of $n loop + fi + n=`expr $n + 1` + done + fi + # + if $make_ok; then + # Everything we know to check worked out, so call this resolution good. + am_cv_filesystem_timestamp_resolution=$am_try_res + break # out of $am_try_res loop + fi + # Otherwise, we'll go on to check the next resolution. + fi +done +rm -f conftest.ts? +# (end _am_filesystem_timestamp_resolution) +])]) + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_REQUIRE([_AM_FILESYSTEM_TIMESTAMP_RESOLUTION]) +# This check should not be cached, as it may vary across builds of +# different projects. +AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_RESULT([no]) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_RESULT([no]) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +am_build_env_is_sane=no +am_has_slept=no +rm -f conftest.file +for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[]*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + test "$[]2" = conftest.file + ); then + am_build_env_is_sane=yes + break + fi + # Just in case. + sleep "$am_cv_filesystem_timestamp_resolution" + am_has_slept=yes +done + +AC_MSG_RESULT([$am_build_env_is_sane]) +if test "$am_build_env_is_sane" = no; then + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi + +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +AS_IF([test -e conftest.file || grep 'slept: no' conftest.file >/dev/null 2>&1],, [dnl + ( sleep "$am_cv_filesystem_timestamp_resolution" ) & + am_sleep_pid=$! +]) +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SILENT_RULES +# ---------------- +# Enable less verbose build rules support. +AC_DEFUN([_AM_SILENT_RULES], +[AM_DEFAULT_VERBOSITY=1 +AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls +dnl to AM_SILENT_RULES to change the default value. +AC_CONFIG_COMMANDS_PRE([dnl +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; +esac +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +])dnl +]) + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or +# empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_REQUIRE([_AM_SILENT_RULES]) +AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])m4_newline +dnl We intentionally force a newline after the assignment, since a) nothing +dnl good can come of more text following, and b) that was the behavior +dnl before 1.17. See https://bugs.gnu.org/72267. +]) + +# Copyright (C) 2001-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test x$am_uid = xunknown; then + AC_MSG_WARN([ancient id detected; assuming current UID is ok, but dist-ustar might not work]) + elif test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test x$gm_gid = xunknown; then + AC_MSG_WARN([ancient id detected; assuming current GID is ok, but dist-ustar might not work]) + elif test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +# Copyright (C) 2022-2025 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_XARGS_N +# ---------------- +# Check whether 'xargs -n' works. It should work everywhere, so the fallback +# is not optimized at all as we never expect to use it. +AC_DEFUN([_AM_PROG_XARGS_N], +[AC_CACHE_CHECK([xargs -n works], am_cv_xargs_n_works, [dnl +AS_IF([test "`echo 1 2 3 | xargs -n2 echo`" = "1 2 +3"], [am_cv_xargs_n_works=yes], [am_cv_xargs_n_works=no])]) +AS_IF([test "$am_cv_xargs_n_works" = yes], [am__xargs_n='xargs -n'], [dnl + am__xargs_n='am__xargs_n () { shift; sed "s/ /\\n/g" | while read am__xargs_n_arg; do "$@" "$am__xargs_n_arg"; done; }' +])dnl +AC_SUBST(am__xargs_n) +]) + +m4_include([m4/ac_backport_259_ssizet.m4]) +m4_include([m4/ax_check_compile_flag.m4]) +m4_include([m4/ax_check_funcs_ex.m4]) +m4_include([m4/ax_prog_doxygen.m4]) +m4_include([m4/ax_pthread.m4]) +m4_include([m4/libevent_mbedtls.m4]) +m4_include([m4/libevent_openssl.m4]) +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) diff --git a/lib/monkey/mk_core/deps/libevent/appveyor.yml b/lib/monkey/mk_core/deps/libevent/appveyor.yml deleted file mode 100644 index 2b56b63330f..00000000000 --- a/lib/monkey/mk_core/deps/libevent/appveyor.yml +++ /dev/null @@ -1,59 +0,0 @@ -version: 2.1.7.{build} - -os: Visual Studio 2015 - -build: - verbosity: detailed - -environment: - global: - CYG_ROOT: C:/MinGW/msys/1.0 - matrix: - - EVENT_BUILD_METHOD: "autotools" - EVENT_CONFIGURE_OPTIONS: "" - - EVENT_BUILD_METHOD: "autotools" - EVENT_CONFIGURE_OPTIONS: "--disable-openssl" - - EVENT_BUILD_METHOD: "autotools" - EVENT_CONFIGURE_OPTIONS: "--disable-thread-support" - - EVENT_BUILD_METHOD: "autotools" - EVENT_CONFIGURE_OPTIONS: "--disable-debug-mode" - - EVENT_BUILD_METHOD: "autotools" - EVENT_CONFIGURE_OPTIONS: "--disable-malloc-replacement" - - EVENT_BUILD_METHOD: "cmake" - EVENT_CMAKE_OPTIONS: "" - - EVENT_BUILD_METHOD: "cmake" - EVENT_CMAKE_OPTIONS: "-DEVENT__DISABLE_OPENSSL=ON" - - EVENT_BUILD_METHOD: "cmake" - EVENT_CMAKE_OPTIONS: "-DEVENT__DISABLE_THREAD_SUPPORT=ON" - - EVENT_BUILD_METHOD: "cmake" - EVENT_CMAKE_OPTIONS: "-DEVENT__DISABLE_DEBUG_MODE=ON" - - EVENT_BUILD_METHOD: "cmake" - EVENT_CMAKE_OPTIONS: "-DEVENT__DISABLE_MM_REPLACEMENT=ON" - - EVENT_BUILD_METHOD: "cmake" - EVENT_CMAKE_OPTIONS: "-DEVENT__ENABLE_VERBOSE_DEBUG=ON" - - EVENT_BUILD_METHOD: "cmake" - EVENT_CMAKE_OPTIONS: "-DCMAKE_C_FLAGS='-DUNICODE -D_UNICODE'" -init: - - 'echo Building libevent %version% for Windows' - - 'echo System architecture: %PLATFORM%' - - 'echo Repo build branch is: %APPVEYOR_REPO_BRANCH%' - - 'echo Build folder is: %APPVEYOR_BUILD_FOLDER%' - - 'echo Repo build commit is: %APPVEYOR_REPO_COMMIT%' - - 'echo Cygwin root is: %CYG_ROOT%' -install: - - C:\MinGW\bin\mingw-get install autotools autoconf automake -build_script: - - ps: | - if ($env:EVENT_BUILD_METHOD -eq 'autotools') { - $env:PATH="$env:CYG_ROOT\bin;C:\MinGW\bin;$($env:PATH)" - bash -lc "echo 'C:\MinGW /mingw' > /etc/fstab" - bash -lc "echo 'C:\OpenSSL-Win32 /ssl' >> /etc/fstab" - $env:APPVEYOR_BUILD_FOLDER = $env:APPVEYOR_BUILD_FOLDER -replace "\\", "/" - bash -lc "exec 0&1; cd $env:APPVEYOR_BUILD_FOLDER; bash -x ./autogen.sh && ./configure LDFLAGS='-L/ssl -L/ssl/lib -L/ssl/lib/MinGW' CFLAGS=-I/ssl/include $env:EVENT_CONFIGURE_OPTIONS && make && make verify" - } else { - md build - cd build - cmake .. $env:EVENT_CMAKE_OPTIONS - cmake --build . - ctest --output-on-failure - } diff --git a/lib/monkey/mk_core/deps/libevent/arc4random.c b/lib/monkey/mk_core/deps/libevent/arc4random.c index a2338e692a1..3ff68340498 100644 --- a/lib/monkey/mk_core/deps/libevent/arc4random.c +++ b/lib/monkey/mk_core/deps/libevent/arc4random.c @@ -52,8 +52,13 @@ #ifndef ARC4RANDOM_NO_INCLUDES #include "evconfig-private.h" #ifdef _WIN32 +#ifndef EVENT__HAVE_BCRYPTGENRANDOM #include +#else +#include +#endif #include +#include #else #include #include @@ -62,6 +67,9 @@ #ifdef EVENT__HAVE_SYS_SYSCTL_H #include #endif +#ifdef EVENT__HAVE_SYS_RANDOM_H +#include +#endif #endif #include #include @@ -71,8 +79,7 @@ /* Add platform entropy 32 bytes (256 bits) at a time. */ #define ADD_ENTROPY 32 -/* Re-seed from the platform RNG after generating this many bytes. */ -#define BYTES_BEFORE_RESEED 1600000 +#define REKEY_BASE (1024*1024) /* NB. should be a power of 2 */ struct arc4_stream { unsigned char i; @@ -85,11 +92,14 @@ struct arc4_stream { #define pid_t int #endif +#ifndef O_RDONLY +#define O_RDONLY _O_RDONLY +#endif + static int rs_initialized; static struct arc4_stream rs; static pid_t arc4_stir_pid; static int arc4_count; -static int arc4_seeded_ok; static inline unsigned char arc4_getbyte(void); @@ -146,66 +156,54 @@ read_all(int fd, unsigned char *buf, size_t count) static int arc4_seed_win32(void) { + unsigned char buf[ADD_ENTROPY]; +#ifndef EVENT__HAVE_BCRYPTGENRANDOM /* This is adapted from Tor's crypto_seed_rng() */ static int provider_set = 0; static HCRYPTPROV provider; - unsigned char buf[ADD_ENTROPY]; if (!provider_set) { if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, - CRYPT_VERIFYCONTEXT)) { + CRYPT_VERIFYCONTEXT)) { if (GetLastError() != (DWORD)NTE_BAD_KEYSET) return -1; } provider_set = 1; } if (!CryptGenRandom(provider, sizeof(buf), buf)) +#else + + if (BCryptGenRandom(NULL, buf, sizeof(buf), + BCRYPT_USE_SYSTEM_PREFERRED_RNG)) +#endif return -1; arc4_addrandom(buf, sizeof(buf)); evutil_memclear_(buf, sizeof(buf)); - arc4_seeded_ok = 1; return 0; } #endif -#if defined(EVENT__HAVE_SYS_SYSCTL_H) && defined(EVENT__HAVE_SYSCTL) -#if EVENT__HAVE_DECL_CTL_KERN && EVENT__HAVE_DECL_KERN_RANDOM && EVENT__HAVE_DECL_RANDOM_UUID -#define TRY_SEED_SYSCTL_LINUX +#if defined(EVENT__HAVE_GETRANDOM) +#define TRY_SEED_GETRANDOM static int -arc4_seed_sysctl_linux(void) +arc4_seed_getrandom(void) { - /* Based on code by William Ahern, this function tries to use the - * RANDOM_UUID sysctl to get entropy from the kernel. This can work - * even if /dev/urandom is inaccessible for some reason (e.g., we're - * running in a chroot). */ - int mib[] = { CTL_KERN, KERN_RANDOM, RANDOM_UUID }; unsigned char buf[ADD_ENTROPY]; - size_t len, n; - unsigned i; - int any_set; - - memset(buf, 0, sizeof(buf)); + size_t len; + ssize_t n = 0; for (len = 0; len < sizeof(buf); len += n) { - n = sizeof(buf) - len; - - if (0 != sysctl(mib, 3, &buf[len], &n, NULL, 0)) + n = getrandom(&buf[len], sizeof(buf) - len, 0); + if (n < 0) return -1; } - /* make sure that the buffer actually got set. */ - for (i=0,any_set=0; i 0xffffffffUL) - min = 0x100000000UL % upper_bound; -#else - /* Calculate (2**32 % upper_bound) avoiding 64-bit math */ - if (upper_bound > 0x80000000) - min = 1 + ~upper_bound; /* 2**32 - upper_bound */ - else { - /* (2**32 - (x * 2)) % x == 2**32 % x when x <= 2**31 */ - min = ((0xffffffff - (upper_bound * 2)) + 1) % upper_bound; - } -#endif + /* 2**32 % x == (2**32 - x) % x */ + min = -upper_bound % upper_bound; /* * This could theoretically loop forever but each retry has diff --git a/lib/monkey/mk_core/deps/libevent/autogen.sh b/lib/monkey/mk_core/deps/libevent/autogen.sh index bcfe937a60c..35916cefee0 100755 --- a/lib/monkey/mk_core/deps/libevent/autogen.sh +++ b/lib/monkey/mk_core/deps/libevent/autogen.sh @@ -12,7 +12,7 @@ fi LIBTOOLIZE=libtoolize SYSNAME=`uname` -if [ "x$SYSNAME" = "xDarwin" ] ; then +if [ "$SYSNAME" = "Darwin" ] ; then LIBTOOLIZE=glibtoolize fi aclocal -I m4 && \ diff --git a/lib/monkey/mk_core/deps/libevent/buffer.c b/lib/monkey/mk_core/deps/libevent/buffer.c index b7e3a69f4b2..2af45a708f7 100644 --- a/lib/monkey/mk_core/deps/libevent/buffer.c +++ b/lib/monkey/mk_core/deps/libevent/buffer.c @@ -34,12 +34,6 @@ #include #endif -#ifdef EVENT__HAVE_VASPRINTF -/* If we have vasprintf, we need to define _GNU_SOURCE before we include - * stdio.h. This comes from evconfig-private.h. - */ -#endif - #include #ifdef EVENT__HAVE_SYS_TIME_H @@ -95,6 +89,7 @@ #include "evthread-internal.h" #include "evbuffer-internal.h" #include "bufferevent-internal.h" +#include "event-internal.h" /* some systems do not have MAP_FAILED */ #ifndef MAP_FAILED @@ -139,6 +134,8 @@ (ptr)->internal_.pos_in_chain = 0; \ } while (0) +#define EVBUFFER_MAX_READ_DEFAULT 4096 + static void evbuffer_chain_align(struct evbuffer_chain *chain); static int evbuffer_chain_should_realign(struct evbuffer_chain *chain, size_t datalen); @@ -161,17 +158,7 @@ evbuffer_chain_new(size_t size) if (size > EVBUFFER_CHAIN_MAX - EVBUFFER_CHAIN_SIZE) return (NULL); - size += EVBUFFER_CHAIN_SIZE; - - /* get the next largest memory that can hold the buffer */ - if (size < EVBUFFER_CHAIN_MAX / 2) { - to_alloc = MIN_BUFFER_SIZE; - while (to_alloc < size) { - to_alloc <<= 1; - } - } else { - to_alloc = size; - } + to_alloc = size + EVBUFFER_CHAIN_SIZE; /* we get everything in one chunk */ if ((chain = mm_malloc(to_alloc)) == NULL) @@ -191,6 +178,29 @@ evbuffer_chain_new(size_t size) return (chain); } +static struct evbuffer_chain * +evbuffer_chain_new_membuf(size_t size) +{ + size_t to_alloc; + + if (size > EVBUFFER_CHAIN_MAX - EVBUFFER_CHAIN_SIZE) + return (NULL); + + size += EVBUFFER_CHAIN_SIZE; + + /* get the next largest memory that can hold the buffer */ + if (size < EVBUFFER_CHAIN_MAX / 2) { + to_alloc = MIN_BUFFER_SIZE; + while (to_alloc < size) { + to_alloc <<= 1; + } + } else { + to_alloc = size; + } + + return evbuffer_chain_new(to_alloc - EVBUFFER_CHAIN_SIZE); +} + static inline void evbuffer_chain_free(struct evbuffer_chain *chain) { @@ -329,7 +339,7 @@ static inline struct evbuffer_chain * evbuffer_chain_insert_new(struct evbuffer *buf, size_t datlen) { struct evbuffer_chain *chain; - if ((chain = evbuffer_chain_new(datlen)) == NULL) + if ((chain = evbuffer_chain_new_membuf(datlen)) == NULL) return NULL; evbuffer_chain_insert(buf, chain); return chain; @@ -369,6 +379,7 @@ evbuffer_new(void) LIST_INIT(&buffer->callbacks); buffer->refcnt = 1; buffer->last_with_datap = &buffer->first; + buffer->max_read = EVBUFFER_MAX_READ_DEFAULT; return (buffer); } @@ -522,8 +533,8 @@ evbuffer_invoke_callbacks_(struct evbuffer *buffer) evbuffer_incref_and_lock_(buffer); if (buffer->parent) bufferevent_incref_(buffer->parent); + EVBUFFER_UNLOCK(buffer); } - EVBUFFER_UNLOCK(buffer); } evbuffer_run_callbacks(buffer, 0); @@ -590,6 +601,26 @@ evbuffer_free(struct evbuffer *buffer) evbuffer_decref_and_unlock_(buffer); } +int evbuffer_set_max_read(struct evbuffer *buf, size_t max) +{ + if (max > INT_MAX) { + return -1; + } + + EVBUFFER_LOCK(buf); + buf->max_read = max; + EVBUFFER_UNLOCK(buf); + return 0; +} +size_t evbuffer_get_max_read(struct evbuffer *buf) +{ + size_t result; + EVBUFFER_LOCK(buf); + result = buf->max_read; + EVBUFFER_UNLOCK(buf); + return result; +} + void evbuffer_lock(struct evbuffer *buf) { @@ -606,13 +637,9 @@ size_t evbuffer_get_length(const struct evbuffer *buffer) { size_t result; - EVBUFFER_LOCK(buffer); - - result = (buffer->total_len); - + result = buffer->total_len; EVBUFFER_UNLOCK(buffer); - return result; } @@ -703,13 +730,17 @@ static int advance_last_with_data(struct evbuffer *buf) { int n = 0; + struct evbuffer_chain **chainp = buf->last_with_datap; + ASSERT_EVBUFFER_LOCKED(buf); - if (!*buf->last_with_datap) + if (!*chainp) return 0; - while ((*buf->last_with_datap)->next && (*buf->last_with_datap)->next->off) { - buf->last_with_datap = &(*buf->last_with_datap)->next; + while ((*chainp)->next) { + chainp = &(*chainp)->next; + if ((*chainp)->off) + buf->last_with_datap = chainp; ++n; } return n; @@ -831,7 +862,7 @@ PRESERVE_PINNED(struct evbuffer *src, struct evbuffer_chain **first, struct evbuffer_chain *tmp; EVUTIL_ASSERT(pinned == src->last_with_datap); - tmp = evbuffer_chain_new(chain->off); + tmp = evbuffer_chain_new_membuf(chain->off); if (!tmp) return -1; memcpy(tmp->buffer, chain->buffer + chain->misalign, @@ -1033,8 +1064,13 @@ evbuffer_add_buffer_reference(struct evbuffer *outbuf, struct evbuffer *inbuf) if (out_total_len == 0) { /* There might be an empty chain at the start of outbuf; free - * it. */ + * it. Reset the chain pointers afterwards so the subsequent + * APPEND_CHAIN_MULTICAST does not dereference the freed chain + * through outbuf->first / last_with_datap. */ evbuffer_free_all_chains(outbuf->first); + outbuf->first = NULL; + outbuf->last = NULL; + outbuf->last_with_datap = &outbuf->first; } APPEND_CHAIN_MULTICAST(outbuf, inbuf); @@ -1146,7 +1182,7 @@ evbuffer_drain(struct evbuffer *buf, size_t len) } buf->first = chain; - EVUTIL_ASSERT(chain && remaining <= chain->off); + EVUTIL_ASSERT(remaining <= chain->off); chain->misalign += remaining; chain->off -= remaining; } @@ -1298,7 +1334,7 @@ evbuffer_remove_buffer(struct evbuffer *src, struct evbuffer *dst, chain = chain->next; } - if (nread) { + if (chain != src->first) { /* we can remove the chain */ struct evbuffer_chain **chp; chp = evbuffer_free_trailing_empty_chains(dst); @@ -1400,7 +1436,7 @@ evbuffer_pullup(struct evbuffer *buf, ev_ssize_t size) size -= old_off; chain = chain->next; } else { - if ((tmp = evbuffer_chain_new(size)) == NULL) { + if ((tmp = evbuffer_chain_new_membuf(size)) == NULL) { event_warn("%s: out of memory", __func__); goto done; } @@ -1416,9 +1452,11 @@ evbuffer_pullup(struct evbuffer *buf, ev_ssize_t size) for (; chain != NULL && (size_t)size >= chain->off; chain = next) { next = chain->next; - memcpy(buffer, chain->buffer + chain->misalign, chain->off); - size -= chain->off; - buffer += chain->off; + if (chain->buffer) { + memcpy(buffer, chain->buffer + chain->misalign, chain->off); + size -= chain->off; + buffer += chain->off; + } if (chain == last_with_data) removed_last_with_data = 1; if (&chain->next == buf->last_with_datap) @@ -1534,11 +1572,11 @@ evbuffer_find_eol_char(struct evbuffer_ptr *it) return (-1); } -static inline int +static inline size_t evbuffer_strspn( struct evbuffer_ptr *ptr, const char *chrset) { - int count = 0; + size_t count = 0; struct evbuffer_chain *chain = ptr->internal_.chain; size_t i = ptr->internal_.pos_in_chain; @@ -1635,7 +1673,7 @@ evbuffer_search_eol(struct evbuffer *buffer, if (evbuffer_strchr(&it, '\n') < 0) goto done; extra_drain = 1; - /* ... optionally preceeded by a CR. */ + /* ... optionally preceded by a CR. */ if (it.pos == start_pos) break; /* If the first character is \n, don't back up */ /* This potentially does an extra linear walk over the first @@ -1746,10 +1784,9 @@ evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen) /* If there are no chains allocated for this buffer, allocate one * big enough to hold all the data. */ if (chain == NULL) { - chain = evbuffer_chain_new(datlen); + chain = evbuffer_chain_insert_new(buf, datlen); if (!chain) goto done; - evbuffer_chain_insert(buf, chain); } if ((chain->flags & EVBUFFER_IMMUTABLE) == 0) { @@ -1788,7 +1825,7 @@ evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen) to_alloc <<= 1; if (datlen > to_alloc) to_alloc = datlen; - tmp = evbuffer_chain_new(to_alloc); + tmp = evbuffer_chain_new_membuf(to_alloc); if (tmp == NULL) goto done; @@ -1824,6 +1861,10 @@ evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen) EVBUFFER_LOCK(buf); + if (datlen == 0) { + result = 0; + goto done; + } if (buf->freeze_start) { goto done; } @@ -1834,10 +1875,9 @@ evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen) chain = buf->first; if (chain == NULL) { - chain = evbuffer_chain_new(datlen); + chain = evbuffer_chain_insert_new(buf, datlen); if (!chain) goto done; - evbuffer_chain_insert(buf, chain); } /* we cannot touch immutable buffers */ @@ -1874,10 +1914,10 @@ evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen) } /* we need to add another chain */ - if ((tmp = evbuffer_chain_new(datlen)) == NULL) + if ((tmp = evbuffer_chain_new_membuf(datlen)) == NULL) goto done; buf->first = tmp; - if (buf->last_with_datap == &buf->first) + if (buf->last_with_datap == &buf->first && chain->off) buf->last_with_datap = &tmp->next; tmp->next = chain; @@ -2003,7 +2043,7 @@ evbuffer_expand_singlechain(struct evbuffer *buf, size_t datlen) * MAX_TO_COPY_IN_EXPAND bytes. */ /* figure out how much space we need */ size_t length = chain->off + datlen; - struct evbuffer_chain *tmp = evbuffer_chain_new(length); + struct evbuffer_chain *tmp = evbuffer_chain_new_membuf(length); if (tmp == NULL) goto err; @@ -2049,12 +2089,11 @@ evbuffer_expand_fast_(struct evbuffer *buf, size_t datlen, int n) if (chain == NULL || (chain->flags & EVBUFFER_IMMUTABLE)) { /* There is no last chunk, or we can't touch the last chunk. * Just add a new chunk. */ - chain = evbuffer_chain_new(datlen); + chain = evbuffer_chain_insert_new(buf, datlen); if (chain == NULL) return (-1); - - evbuffer_chain_insert(buf, chain); - return (0); + else + return (0); } used = 0; /* number of chains we're using space in. */ @@ -2092,7 +2131,7 @@ evbuffer_expand_fast_(struct evbuffer *buf, size_t datlen, int n) * chains; we can add another. */ EVUTIL_ASSERT(chain == NULL); - tmp = evbuffer_chain_new(datlen - avail); + tmp = evbuffer_chain_new_membuf(datlen - avail); if (tmp == NULL) return (-1); @@ -2124,7 +2163,7 @@ evbuffer_expand_fast_(struct evbuffer *buf, size_t datlen, int n) evbuffer_chain_free(chain); } EVUTIL_ASSERT(datlen >= avail); - tmp = evbuffer_chain_new(datlen - avail); + tmp = evbuffer_chain_new_membuf(datlen - avail); if (tmp == NULL) { if (rmv_all) { ZERO_CHAIN(buf); @@ -2195,8 +2234,6 @@ evbuffer_expand(struct evbuffer *buf, size_t datlen) #endif #define NUM_READ_IOVEC 4 -#define EVBUFFER_MAX_READ 4096 - /** Helper function to figure out which space to use for reading data into an evbuffer. Internal use only. @@ -2227,11 +2264,13 @@ evbuffer_read_setup_vecs_(struct evbuffer *buf, ev_ssize_t howmuch, so_far = 0; /* Let firstchain be the first chain with any space on it */ firstchainp = buf->last_with_datap; + EVUTIL_ASSERT(*firstchainp); if (CHAIN_SPACE_LEN(*firstchainp) == 0) { firstchainp = &(*firstchainp)->next; } chain = *firstchainp; + EVUTIL_ASSERT(chain); for (i = 0; i < n_vecs_avail && so_far < (size_t)howmuch; ++i) { size_t avail = (size_t) CHAIN_SPACE_LEN(chain); if (avail > (howmuch - so_far) && exact) @@ -2250,18 +2289,18 @@ static int get_n_bytes_readable_on_socket(evutil_socket_t fd) { #if defined(FIONREAD) && defined(_WIN32) - unsigned long lng = EVBUFFER_MAX_READ; + unsigned long lng = EVBUFFER_MAX_READ_DEFAULT; if (ioctlsocket(fd, FIONREAD, &lng) < 0) return -1; /* Can overflow, but mostly harmlessly. XXXX */ return (int)lng; #elif defined(FIONREAD) - int n = EVBUFFER_MAX_READ; + int n = EVBUFFER_MAX_READ_DEFAULT; if (ioctl(fd, FIONREAD, &n) < 0) return -1; return n; #else - return EVBUFFER_MAX_READ; + return EVBUFFER_MAX_READ_DEFAULT; #endif } @@ -2270,11 +2309,11 @@ get_n_bytes_readable_on_socket(evutil_socket_t fd) int evbuffer_read(struct evbuffer *buf, evutil_socket_t fd, int howmuch) { - struct evbuffer_chain **chainp; int n; int result; #ifdef USE_IOVEC_IMPL + struct evbuffer_chain **chainp; int nvecs, i, remaining; #else struct evbuffer_chain *chain; @@ -2289,8 +2328,8 @@ evbuffer_read(struct evbuffer *buf, evutil_socket_t fd, int howmuch) } n = get_n_bytes_readable_on_socket(fd); - if (n <= 0 || n > EVBUFFER_MAX_READ) - n = EVBUFFER_MAX_READ; + if (n <= 0 || n > (int)buf->max_read) + n = (int)buf->max_read; if (howmuch < 0 || howmuch > n) howmuch = n; @@ -2331,11 +2370,15 @@ evbuffer_read(struct evbuffer *buf, evutil_socket_t fd, int howmuch) n = bytesRead; } #else - n = readv(fd, vecs, nvecs); + /* TODO(panjf2000): wrap it with `unlikely` as compiler hint? */ + if (nvecs == 1) + n = read(fd, vecs[0].IOV_PTR_FIELD, vecs[0].IOV_LEN_FIELD); + else + n = readv(fd, vecs, nvecs); #endif } -#else /*!USE_IOVEC_IMPL*/ +#else /* !USE_IOVEC_IMPL */ /* If we don't have FIONREAD, we might waste some space here */ /* XXX we _will_ waste some space here if there is any space left * over on buf->last. */ @@ -2444,7 +2487,11 @@ evbuffer_write_iovec(struct evbuffer *buffer, evutil_socket_t fd, n = bytesSent; } #else - n = writev(fd, iov, i); + /* TODO(panjf2000): wrap it with `unlikely` as compiler hint? */ + if (i == 1) + n = write(fd, iov[0].IOV_PTR_FIELD, iov[0].IOV_LEN_FIELD); + else + n = writev(fd, iov, i); #endif return (n); } @@ -2465,7 +2512,7 @@ evbuffer_write_sendfile(struct evbuffer *buffer, evutil_socket_t dest_fd, ev_off_t len = chain->off; #elif defined(SENDFILE_IS_LINUX) || defined(SENDFILE_IS_SOLARIS) ev_ssize_t res; - ev_off_t offset = chain->misalign; + off_t offset = chain->misalign; #endif ASSERT_EVBUFFER_LOCKED(buffer); @@ -2483,7 +2530,6 @@ evbuffer_write_sendfile(struct evbuffer *buffer, evutil_socket_t dest_fd, return (len); #elif defined(SENDFILE_IS_LINUX) - /* TODO(niels): implement splice */ res = sendfile(dest_fd, source_fd, &offset, chain->off); if (res == -1 && EVUTIL_ERR_RW_RETRIABLE(errno)) { /* if this is EAGAIN or EINTR return 0; otherwise, -1 */ @@ -2581,7 +2627,7 @@ evbuffer_find(struct evbuffer *buffer, const unsigned char *what, size_t len) return search; } -/* Subract howfar from the position of pos within +/* Subtract howfar from the position of pos within * buf. Returns 0 on success, -1 on failure. * * This isn't exposed yet, because of potential inefficiency issues. @@ -2908,6 +2954,14 @@ int evbuffer_add_reference(struct evbuffer *outbuf, const void *data, size_t datlen, evbuffer_ref_cleanup_cb cleanupfn, void *extra) +{ + return evbuffer_add_reference_with_offset(outbuf, data, /* offset= */ 0, datlen, cleanupfn, extra); +} + +int +evbuffer_add_reference_with_offset(struct evbuffer *outbuf, const void *data, + size_t offset, size_t datlen, evbuffer_ref_cleanup_cb cleanupfn, + void *extra) { struct evbuffer_chain *chain; struct evbuffer_chain_reference *info; @@ -2918,7 +2972,8 @@ evbuffer_add_reference(struct evbuffer *outbuf, return (-1); chain->flags |= EVBUFFER_REFERENCE | EVBUFFER_IMMUTABLE; chain->buffer = (unsigned char *)data; - chain->buffer_len = datlen; + chain->misalign = offset; + chain->buffer_len = offset + datlen; chain->off = datlen; info = EVBUFFER_CHAIN_EXTRA(struct evbuffer_chain_reference, chain); @@ -2952,7 +3007,7 @@ evbuffer_file_segment_new( int fd, ev_off_t offset, ev_off_t length, unsigned flags) { struct evbuffer_file_segment *seg = - mm_calloc(sizeof(struct evbuffer_file_segment), 1); + mm_calloc(1, sizeof(struct evbuffer_file_segment)); if (!seg) return NULL; seg->refcnt = 1; @@ -2961,22 +3016,10 @@ evbuffer_file_segment_new( seg->file_offset = offset; seg->cleanup_cb = NULL; seg->cleanup_cb_arg = NULL; -#ifdef _WIN32 -#ifndef lseek -#define lseek _lseeki64 -#endif -#ifndef fstat -#define fstat _fstat -#endif -#ifndef stat -#define stat _stat -#endif -#endif if (length == -1) { - struct stat st; - if (fstat(fd, &st) < 0) + length = evutil_fd_filesize(fd); + if (length == -1) goto err; - length = st.st_size; } seg->length = length; @@ -3026,17 +3069,27 @@ get_page_size(void) static int evbuffer_file_segment_materialize(struct evbuffer_file_segment *seg) { +#if defined(EVENT__HAVE_MMAP) || defined(_WIN32) const unsigned flags = seg->flags; +#endif const int fd = seg->fd; const ev_off_t length = seg->length; const ev_off_t offset = seg->file_offset; - if (seg->contents) + if (seg->contents || seg->is_mapping) return 0; /* already materialized */ #if defined(EVENT__HAVE_MMAP) if (!(flags & EVBUF_FS_DISABLE_MMAP)) { off_t offset_rounded = 0, offset_leftover = 0; + int mmap_flags = +#ifdef MAP_NOCACHE + MAP_NOCACHE | /* ??? */ +#endif +#ifdef MAP_FILE + MAP_FILE | +#endif + MAP_PRIVATE; void *mapped; if (offset) { /* mmap implementations don't generally like us @@ -3047,19 +3100,16 @@ evbuffer_file_segment_materialize(struct evbuffer_file_segment *seg) offset_leftover = offset % page_size; offset_rounded = offset - offset_leftover; } +#if defined(EVENT__HAVE_MMAP64) + mapped = mmap64(NULL, length + offset_leftover, +#else mapped = mmap(NULL, length + offset_leftover, - PROT_READ, -#ifdef MAP_NOCACHE - MAP_NOCACHE | /* ??? */ -#endif -#ifdef MAP_FILE - MAP_FILE | #endif - MAP_PRIVATE, - fd, offset_rounded); + PROT_READ, mmap_flags, fd, offset_rounded); if (mapped == MAP_FAILED) { - event_warn("%s: mmap(%d, %d, %zu) failed", - __func__, fd, 0, (size_t)(offset + length)); + event_warn("%s: mmap(NULL, %zu, %d, %d, %d, %lld) failed", __func__, + (size_t)(length + offset_leftover), PROT_READ, mmap_flags, fd, + (long long)offset_rounded); } else { seg->mapping = mapped; seg->contents = (char*)mapped+offset_leftover; @@ -3088,13 +3138,34 @@ evbuffer_file_segment_materialize(struct evbuffer_file_segment *seg) } #endif { - ev_off_t start_pos = lseek(fd, 0, SEEK_CUR), pos; ev_off_t read_so_far = 0; + ev_ssize_t n = 0; char *mem; +#ifndef EVENT__HAVE_PREAD +#ifdef _WIN32 +#ifndef lseek +#define lseek _lseeki64 +#endif +#endif + ev_off_t start_pos = lseek(fd, 0, SEEK_CUR); + ev_off_t pos; int e; - ev_ssize_t n = 0; +#endif /* no pread() */ if (!(mem = mm_malloc(length))) goto err; +#ifdef EVENT__HAVE_PREAD + while (read_so_far < length) { + n = pread(fd, mem + read_so_far, length - read_so_far, + offset + read_so_far); + if (n <= 0) + break; + read_so_far += n; + } + if (n < 0 || (n == 0 && length > read_so_far)) { + mm_free(mem); + goto err; + } +#else /* fallback to seek() and read() */ if (start_pos < 0) { mm_free(mem); goto err; @@ -3120,11 +3191,13 @@ evbuffer_file_segment_materialize(struct evbuffer_file_segment *seg) mm_free(mem); goto err; } +#endif /* pread */ seg->contents = mem; } - +#if defined(EVENT__HAVE_MMAP) || defined(_WIN32) done: +#endif return 0; err: return -1; @@ -3165,9 +3238,9 @@ evbuffer_file_segment_free(struct evbuffer_file_segment *seg) if ((seg->flags & EVBUF_FS_CLOSE_ON_FREE) && seg->fd >= 0) { close(seg->fd); } - + if (seg->cleanup_cb) { - (*seg->cleanup_cb)((struct evbuffer_file_segment const*)seg, + (*seg->cleanup_cb)((struct evbuffer_file_segment const*)seg, seg->flags, seg->cleanup_cb_arg); seg->cleanup_cb = NULL; seg->cleanup_cb_arg = NULL; @@ -3190,15 +3263,11 @@ evbuffer_add_file_segment(struct evbuffer *buf, if (buf->flags & EVBUFFER_FLAG_DRAINS_TO_FD) { can_use_sendfile = 1; } else { - if (!seg->contents) { - if (evbuffer_file_segment_materialize(seg)<0) { - EVLOCK_UNLOCK(seg->lock, 0); - EVBUFFER_UNLOCK(buf); - return -1; - } + if (evbuffer_file_segment_materialize(seg)<0) { + EVLOCK_UNLOCK(seg->lock, 0); + goto err; } } - ++seg->refcnt; EVLOCK_UNLOCK(seg->lock, 0); if (buf->freeze_end) @@ -3262,6 +3331,9 @@ evbuffer_add_file_segment(struct evbuffer *buf, chain->off = length; } + EVLOCK_LOCK(seg->lock, 0); + ++seg->refcnt; + EVLOCK_UNLOCK(seg->lock, 0); extra->segment = seg; buf->n_add_for_cb += length; evbuffer_chain_insert(buf, chain); @@ -3293,7 +3365,7 @@ evbuffer_add_file(struct evbuffer *buf, int fd, ev_off_t offset, ev_off_t length return r; } -void +int evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg) { EVBUFFER_LOCK(buffer); @@ -3304,10 +3376,15 @@ evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg) if (cb) { struct evbuffer_cb_entry *ent = evbuffer_add_cb(buffer, NULL, cbarg); + if (!ent) { + EVBUFFER_UNLOCK(buffer); + return -1; + } ent->cb.cb_obsolete = cb; ent->flags |= EVBUFFER_CB_OBSOLETE; } EVBUFFER_UNLOCK(buffer); + return 0; } struct evbuffer_cb_entry * diff --git a/lib/monkey/mk_core/deps/libevent/buffer_iocp.c b/lib/monkey/mk_core/deps/libevent/buffer_iocp.c index 2d76a90e770..77619760ccf 100644 --- a/lib/monkey/mk_core/deps/libevent/buffer_iocp.c +++ b/lib/monkey/mk_core/deps/libevent/buffer_iocp.c @@ -44,6 +44,7 @@ #include "mm-internal.h" #include +#include #include #include @@ -68,7 +69,7 @@ struct evbuffer_overlapped { WSABUF buffers[MAX_WSABUFS]; }; -/** Given an evbuffer, return the correponding evbuffer structure, or NULL if +/** Given an evbuffer, return the corresponding evbuffer structure, or NULL if * the evbuffer isn't overlapped. */ static inline struct evbuffer_overlapped * upcast_evbuffer(struct evbuffer *buf) diff --git a/lib/monkey/mk_core/deps/libevent/bufferevent-internal.h b/lib/monkey/mk_core/deps/libevent/bufferevent-internal.h index 9960aefa5d1..4e6b3e88e2f 100644 --- a/lib/monkey/mk_core/deps/libevent/bufferevent-internal.h +++ b/lib/monkey/mk_core/deps/libevent/bufferevent-internal.h @@ -34,11 +34,13 @@ extern "C" { #include "event2/event_struct.h" #include "evconfig-private.h" #include "event2/util.h" +#include "util-internal.h" #include "defer-internal.h" #include "evthread-internal.h" #include "event2/thread.h" #include "ratelim-internal.h" #include "event2/bufferevent_struct.h" +#include "event2/event.h" #include "ipv6-internal.h" #ifdef _WIN32 @@ -224,10 +226,10 @@ struct bufferevent_private { * So we need to save it, just after we connected to remote server, or * after resolving (to avoid extra dns requests during retrying, since UDP * is slow) */ - union { - struct sockaddr_in6 in6; - struct sockaddr_in in; - } conn_address; + /* NOTE: it might be nice to use fewer bytes here, but we need to store + * sockaddr_un sometimes in order to make AF_UNIX sockets work as expected + * with http.c. */ + struct sockaddr_storage conn_address; struct evdns_getaddrinfo_request *dns_request; }; @@ -277,7 +279,7 @@ struct bufferevent_ops { */ int (*disable)(struct bufferevent *, short); - /** Detatches the bufferevent from related data structures. Called as + /** Detaches the bufferevent from related data structures. Called as * soon as its reference count reaches 0. */ void (*unlink)(struct bufferevent *); @@ -306,6 +308,20 @@ extern const struct bufferevent_ops bufferevent_ops_pair; #define BEV_IS_FILTER(bevp) ((bevp)->be_ops == &bufferevent_ops_filter) #define BEV_IS_PAIR(bevp) ((bevp)->be_ops == &bufferevent_ops_pair) +#if defined(EVENT__HAVE_OPENSSL) || defined(EVENT__HAVE_MBEDTLS) +/* We cannot use the same trick with external declaration, + * since there are copy of bufferevent_ops_ssl in each library: + * - openssl + * - mbedlts + * + * However we can just compare the name of the bufferevent type for now. + * (It is totally fine to use memcmp() here since it will be optimized by the compiler). + */ +#define BEV_IS_SSL(bevp) (!memcmp((bevp)->be_ops->type, "ssl", 3)) +#else +#define BEV_IS_SSL(bevp) 0 +#endif + #ifdef _WIN32 extern const struct bufferevent_ops bufferevent_ops_async; #define BEV_IS_ASYNC(bevp) ((bevp)->be_ops == &bufferevent_ops_async) @@ -314,13 +330,16 @@ extern const struct bufferevent_ops bufferevent_ops_async; #endif /** Initialize the shared parts of a bufferevent. */ +EVENT2_EXPORT_SYMBOL int bufferevent_init_common_(struct bufferevent_private *, struct event_base *, const struct bufferevent_ops *, enum bufferevent_options options); /** For internal use: temporarily stop all reads on bufev, until the conditions * in 'what' are over. */ +EVENT2_EXPORT_SYMBOL void bufferevent_suspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags what); /** For internal use: clear the conditions 'what' on bufev, and re-enable * reading if there are no conditions left. */ +EVENT2_EXPORT_SYMBOL void bufferevent_unsuspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags what); /** For internal use: temporarily stop all writes on bufev, until the conditions @@ -347,16 +366,19 @@ void bufferevent_unsuspend_write_(struct bufferevent *bufev, bufferevent_suspend @return 0 if successful, or -1 if an error occurred @see bufferevent_disable() */ +EVENT2_EXPORT_SYMBOL int bufferevent_disable_hard_(struct bufferevent *bufev, short event); /** Internal: Set up locking on a bufferevent. If lock is set, use it. * Otherwise, use a new lock. */ +EVENT2_EXPORT_SYMBOL int bufferevent_enable_locking_(struct bufferevent *bufev, void *lock); /** Internal: backwards compat macro for the now public function * Increment the reference count on bufev. */ #define bufferevent_incref_(bufev) bufferevent_incref(bufev) /** Internal: Lock bufev and increase its reference count. * unlocking it otherwise. */ +EVENT2_EXPORT_SYMBOL void bufferevent_incref_and_lock_(struct bufferevent *bufev); /** Internal: backwards compat macro for the now public function * Decrement the reference count on bufev. Returns 1 if it freed @@ -365,17 +387,21 @@ void bufferevent_incref_and_lock_(struct bufferevent *bufev); /** Internal: Drop the reference count on bufev, freeing as necessary, and * unlocking it otherwise. Returns 1 if it freed the bufferevent. */ +EVENT2_EXPORT_SYMBOL int bufferevent_decref_and_unlock_(struct bufferevent *bufev); /** Internal: If callbacks are deferred and we have a read callback, schedule * a readcb. Otherwise just run the readcb. Ignores watermarks. */ +EVENT2_EXPORT_SYMBOL void bufferevent_run_readcb_(struct bufferevent *bufev, int options); /** Internal: If callbacks are deferred and we have a write callback, schedule * a writecb. Otherwise just run the writecb. Ignores watermarks. */ +EVENT2_EXPORT_SYMBOL void bufferevent_run_writecb_(struct bufferevent *bufev, int options); /** Internal: If callbacks are deferred and we have an eventcb, schedule * it to run with events "what". Otherwise just run the eventcb. * See bufferevent_trigger_event for meaning of "options". */ +EVENT2_EXPORT_SYMBOL void bufferevent_run_eventcb_(struct bufferevent *bufev, short what, int options); /** Internal: Run or schedule (if deferred or options contain @@ -399,6 +425,7 @@ bufferevent_trigger_nolock_(struct bufferevent *bufev, short iotype, int options /** Internal: Add the event 'ev' with timeout tv, unless tv is set to 0, in * which case add ev with no timeout. */ +EVENT2_EXPORT_SYMBOL int bufferevent_add_event_(struct event *ev, const struct timeval *tv); /* ========= @@ -408,19 +435,33 @@ int bufferevent_add_event_(struct event *ev, const struct timeval *tv); /** Internal use: Set up the ev_read and ev_write callbacks so that * the other "generic_timeout" functions will work on it. Call this from * the constructor function. */ +EVENT2_EXPORT_SYMBOL void bufferevent_init_generic_timeout_cbs_(struct bufferevent *bev); /** Internal use: Add or delete the generic timeout events as appropriate. * (If an event is enabled and a timeout is set, we add the event. Otherwise * we delete it.) Call this from anything that changes the timeout values, * that enabled EV_READ or EV_WRITE, or that disables EV_READ or EV_WRITE. */ +EVENT2_EXPORT_SYMBOL int bufferevent_generic_adj_timeouts_(struct bufferevent *bev); +EVENT2_EXPORT_SYMBOL int bufferevent_generic_adj_existing_timeouts_(struct bufferevent *bev); +EVENT2_EXPORT_SYMBOL enum bufferevent_options bufferevent_get_options_(struct bufferevent *bev); +EVENT2_EXPORT_SYMBOL const struct sockaddr* bufferevent_socket_get_conn_address_(struct bufferevent *bev); +EVENT2_EXPORT_SYMBOL +void +bufferevent_socket_set_conn_address_fd_(struct bufferevent *bev, evutil_socket_t fd); + +EVENT2_EXPORT_SYMBOL +int +bufferevent_socket_set_conn_address_(struct bufferevent *bev, struct sockaddr *addr, size_t addrlen); + + /** Internal use: We have just successfully read data into an inbuf, so * reset the read timeout (if any). */ #define BEV_RESET_GENERIC_READ_TIMEOUT(bev) \ @@ -446,8 +487,8 @@ bufferevent_socket_get_conn_address_(struct bufferevent *bev); #define BEV_UPCAST(b) EVUTIL_UPCAST((b), struct bufferevent_private, bev) #ifdef EVENT__DISABLE_THREAD_SUPPORT -#define BEV_LOCK(b) EVUTIL_NIL_STMT_ -#define BEV_UNLOCK(b) EVUTIL_NIL_STMT_ +#define BEV_LOCK(b) (void)(b) +#define BEV_UNLOCK(b) (void)(b) #else /** Internal: Grab the lock (if any) on a bufferevent */ #define BEV_LOCK(b) do { \ @@ -465,11 +506,15 @@ bufferevent_socket_get_conn_address_(struct bufferevent *bev); /* ==== For rate-limiting. */ +EVENT2_EXPORT_SYMBOL int bufferevent_decrement_write_buckets_(struct bufferevent_private *bev, ev_ssize_t bytes); +EVENT2_EXPORT_SYMBOL int bufferevent_decrement_read_buckets_(struct bufferevent_private *bev, ev_ssize_t bytes); +EVENT2_EXPORT_SYMBOL ev_ssize_t bufferevent_get_read_max_(struct bufferevent_private *bev); +EVENT2_EXPORT_SYMBOL ev_ssize_t bufferevent_get_write_max_(struct bufferevent_private *bev); int bufferevent_ratelim_init_(struct bufferevent_private *bev); diff --git a/lib/monkey/mk_core/deps/libevent/bufferevent.c b/lib/monkey/mk_core/deps/libevent/bufferevent.c index 490b59839cc..79f76f4e79b 100644 --- a/lib/monkey/mk_core/deps/libevent/bufferevent.c +++ b/lib/monkey/mk_core/deps/libevent/bufferevent.c @@ -66,8 +66,7 @@ static void bufferevent_finalize_cb_(struct event_callback *evcb, void *arg_); void bufferevent_suspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags what) { - struct bufferevent_private *bufev_private = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_private = BEV_UPCAST(bufev); BEV_LOCK(bufev); if (!bufev_private->read_suspended) bufev->be_ops->disable(bufev, EV_READ); @@ -78,8 +77,7 @@ bufferevent_suspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags w void bufferevent_unsuspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags what) { - struct bufferevent_private *bufev_private = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_private = BEV_UPCAST(bufev); BEV_LOCK(bufev); bufev_private->read_suspended &= ~what; if (!bufev_private->read_suspended && (bufev->enabled & EV_READ)) @@ -90,8 +88,7 @@ bufferevent_unsuspend_read_(struct bufferevent *bufev, bufferevent_suspend_flags void bufferevent_suspend_write_(struct bufferevent *bufev, bufferevent_suspend_flags what) { - struct bufferevent_private *bufev_private = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_private = BEV_UPCAST(bufev); BEV_LOCK(bufev); if (!bufev_private->write_suspended) bufev->be_ops->disable(bufev, EV_WRITE); @@ -102,8 +99,7 @@ bufferevent_suspend_write_(struct bufferevent *bufev, bufferevent_suspend_flags void bufferevent_unsuspend_write_(struct bufferevent *bufev, bufferevent_suspend_flags what) { - struct bufferevent_private *bufev_private = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_private = BEV_UPCAST(bufev); BEV_LOCK(bufev); bufev_private->write_suspended &= ~what; if (!bufev_private->write_suspended && (bufev->enabled & EV_WRITE)) @@ -111,6 +107,28 @@ bufferevent_unsuspend_write_(struct bufferevent *bufev, bufferevent_suspend_flag BEV_UNLOCK(bufev); } +/** + * Sometimes bufferevent's implementation can overrun high watermarks + * (one of examples is openssl) and in this case if the read callback + * will not handle enough data do over condition above the read + * callback will never be called again (due to suspend above). + * + * To avoid this we are scheduling read callback again here, but only + * from the user callback to avoid multiple scheduling: + * - when the data had been added to it + * - when the data had been drained from it (user specified read callback) + */ +static void bufferevent_inbuf_wm_check(struct bufferevent *bev) +{ + if (!bev->wm_read.high) + return; + if (!(bev->enabled & EV_READ)) + return; + if (evbuffer_get_length(bev->input) < bev->wm_read.high) + return; + + bufferevent_trigger(bev, EV_READ, BEV_OPT_DEFER_CALLBACKS); +} /* Callback to implement watermarks on the input buffer. Only enabled * if the watermark is set. */ @@ -147,6 +165,7 @@ bufferevent_run_deferred_callbacks_locked(struct event_callback *cb, void *arg) if (bufev_private->readcb_pending && bufev->readcb) { bufev_private->readcb_pending = 0; bufev->readcb(bufev, bufev->cbarg); + bufferevent_inbuf_wm_check(bufev); } if (bufev_private->writecb_pending && bufev->writecb) { bufev_private->writecb_pending = 0; @@ -187,6 +206,7 @@ bufferevent_run_deferred_callbacks_unlocked(struct event_callback *cb, void *arg void *cbarg = bufev->cbarg; bufev_private->readcb_pending = 0; UNLOCKED(readcb(bufev, cbarg)); + bufferevent_inbuf_wm_check(bufev); } if (bufev_private->writecb_pending && bufev->writecb) { bufferevent_data_cb writecb = bufev->writecb; @@ -221,8 +241,7 @@ void bufferevent_run_readcb_(struct bufferevent *bufev, int options) { /* Requires that we hold the lock and a reference */ - struct bufferevent_private *p = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *p = BEV_UPCAST(bufev); if (bufev->readcb == NULL) return; if ((p->options|options) & BEV_OPT_DEFER_CALLBACKS) { @@ -230,6 +249,7 @@ bufferevent_run_readcb_(struct bufferevent *bufev, int options) SCHEDULE_DEFERRED(p); } else { bufev->readcb(bufev, bufev->cbarg); + bufferevent_inbuf_wm_check(bufev); } } @@ -237,8 +257,7 @@ void bufferevent_run_writecb_(struct bufferevent *bufev, int options) { /* Requires that we hold the lock and a reference */ - struct bufferevent_private *p = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *p = BEV_UPCAST(bufev); if (bufev->writecb == NULL) return; if ((p->options|options) & BEV_OPT_DEFER_CALLBACKS) { @@ -266,8 +285,7 @@ void bufferevent_run_eventcb_(struct bufferevent *bufev, short what, int options) { /* Requires that we hold the lock and a reference */ - struct bufferevent_private *p = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *p = BEV_UPCAST(bufev); if (bufev->errorcb == NULL) return; if ((p->options|options) & BEV_OPT_DEFER_CALLBACKS) { @@ -297,14 +315,12 @@ bufferevent_init_common_(struct bufferevent_private *bufev_private, if (!bufev->input) { if ((bufev->input = evbuffer_new()) == NULL) - return -1; + goto err; } if (!bufev->output) { - if ((bufev->output = evbuffer_new()) == NULL) { - evbuffer_free(bufev->input); - return -1; - } + if ((bufev->output = evbuffer_new()) == NULL) + goto err; } bufev_private->refcnt = 1; @@ -316,7 +332,8 @@ bufferevent_init_common_(struct bufferevent_private *bufev_private, bufev->be_ops = ops; - bufferevent_ratelim_init_(bufev_private); + if (bufferevent_ratelim_init_(bufev_private)) + goto err; /* * Set to EV_WRITE so that using bufferevent_write is going to @@ -327,20 +344,14 @@ bufferevent_init_common_(struct bufferevent_private *bufev_private, #ifndef EVENT__DISABLE_THREAD_SUPPORT if (options & BEV_OPT_THREADSAFE) { - if (bufferevent_enable_locking_(bufev, NULL) < 0) { - /* cleanup */ - evbuffer_free(bufev->input); - evbuffer_free(bufev->output); - bufev->input = NULL; - bufev->output = NULL; - return -1; - } + if (bufferevent_enable_locking_(bufev, NULL) < 0) + goto err; } #endif if ((options & (BEV_OPT_DEFER_CALLBACKS|BEV_OPT_UNLOCK_CALLBACKS)) == BEV_OPT_UNLOCK_CALLBACKS) { event_warnx("UNLOCK_CALLBACKS requires DEFER_CALLBACKS"); - return -1; + goto err; } if (options & BEV_OPT_UNLOCK_CALLBACKS) event_deferred_cb_init_( @@ -361,6 +372,17 @@ bufferevent_init_common_(struct bufferevent_private *bufev_private, evbuffer_set_parent_(bufev->output, bufev); return 0; + +err: + if (bufev->input) { + evbuffer_free(bufev->input); + bufev->input = NULL; + } + if (bufev->output) { + evbuffer_free(bufev->output); + bufev->output = NULL; + } + return -1; } void @@ -447,7 +469,12 @@ bufferevent_write_buffer(struct bufferevent *bufev, struct evbuffer *buf) size_t bufferevent_read(struct bufferevent *bufev, void *data, size_t size) { - return (evbuffer_remove(bufev->input, data, size)); + int r = evbuffer_remove(bufev->input, data, size); + + if (r == -1) + return 0; + + return r; } int @@ -459,8 +486,7 @@ bufferevent_read_buffer(struct bufferevent *bufev, struct evbuffer *buf) int bufferevent_enable(struct bufferevent *bufev, short event) { - struct bufferevent_private *bufev_private = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_private = BEV_UPCAST(bufev); short impl_events = event; int r = 0; @@ -474,6 +500,8 @@ bufferevent_enable(struct bufferevent *bufev, short event) if (impl_events && bufev->be_ops->enable(bufev, impl_events) < 0) r = -1; + if (r) + event_debug(("%s: cannot enable 0x%hx on %p", __func__, event, (void *)bufev)); bufferevent_decref_and_unlock_(bufev); return r; @@ -533,8 +561,7 @@ int bufferevent_disable_hard_(struct bufferevent *bufev, short event) { int r = 0; - struct bufferevent_private *bufev_private = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_private = BEV_UPCAST(bufev); BEV_LOCK(bufev); bufev->enabled &= ~event; @@ -557,6 +584,8 @@ bufferevent_disable(struct bufferevent *bufev, short event) if (bufev->be_ops->disable(bufev, event) < 0) r = -1; + if (r) + event_debug(("%s: cannot disable 0x%hx on %p", __func__, event, (void *)bufev)); BEV_UNLOCK(bufev); return r; @@ -570,8 +599,7 @@ void bufferevent_setwatermark(struct bufferevent *bufev, short events, size_t lowmark, size_t highmark) { - struct bufferevent_private *bufev_private = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_private = BEV_UPCAST(bufev); BEV_LOCK(bufev); if (events & EV_WRITE) { @@ -656,8 +684,7 @@ bufferevent_flush(struct bufferevent *bufev, void bufferevent_incref_and_lock_(struct bufferevent *bufev) { - struct bufferevent_private *bufev_private = - BEV_UPCAST(bufev); + struct bufferevent_private *bufev_private = BEV_UPCAST(bufev); BEV_LOCK(bufev); ++bufev_private->refcnt; } @@ -683,8 +710,7 @@ bufferevent_transfer_lock_ownership_(struct bufferevent *donor, int bufferevent_decref_and_unlock_(struct bufferevent *bufev) { - struct bufferevent_private *bufev_private = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_private = BEV_UPCAST(bufev); int n_cbs = 0; #define MAX_CBS 16 struct event_callback *cbs[MAX_CBS]; @@ -727,8 +753,7 @@ bufferevent_finalize_cb_(struct event_callback *evcb, void *arg_) { struct bufferevent *bufev = arg_; struct bufferevent *underlying; - struct bufferevent_private *bufev_private = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_private = BEV_UPCAST(bufev); BEV_LOCK(bufev); underlying = bufferevent_get_underlying(bufev); @@ -794,8 +819,7 @@ bufferevent_free(struct bufferevent *bufev) void bufferevent_incref(struct bufferevent *bufev) { - struct bufferevent_private *bufev_private = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_private = BEV_UPCAST(bufev); /* XXX: now that this function is public, we might want to * - return the count from this function @@ -851,10 +875,40 @@ bufferevent_setfd(struct bufferevent *bev, evutil_socket_t fd) BEV_LOCK(bev); if (bev->be_ops->ctrl) res = bev->be_ops->ctrl(bev, BEV_CTRL_SET_FD, &d); + if (res) + event_debug(("%s: cannot set fd for %p to "EV_SOCK_FMT, __func__, (void *)bev, fd)); BEV_UNLOCK(bev); return res; } +int +bufferevent_replacefd(struct bufferevent *bev, evutil_socket_t fd) +{ + union bufferevent_ctrl_data d; + int err = -1; + evutil_socket_t old_fd = EVUTIL_INVALID_SOCKET; + + BEV_LOCK(bev); + if (bev->be_ops->ctrl) { + err = bev->be_ops->ctrl(bev, BEV_CTRL_GET_FD, &d); + if (!err) { + old_fd = d.fd; + if (old_fd != EVUTIL_INVALID_SOCKET) { + err = evutil_closesocket(old_fd); + } + } + if (!err) { + d.fd = fd; + err = bev->be_ops->ctrl(bev, BEV_CTRL_SET_FD, &d); + } + } + if (err) + event_debug(("%s: cannot replace fd for %p from "EV_SOCK_FMT" to "EV_SOCK_FMT, __func__, (void *)bev, old_fd, fd)); + BEV_UNLOCK(bev); + + return err; +} + evutil_socket_t bufferevent_getfd(struct bufferevent *bev) { @@ -864,6 +918,8 @@ bufferevent_getfd(struct bufferevent *bev) BEV_LOCK(bev); if (bev->be_ops->ctrl) res = bev->be_ops->ctrl(bev, BEV_CTRL_GET_FD, &d); + if (res) + event_debug(("%s: cannot get fd for %p", __func__, (void *)bev)); BEV_UNLOCK(bev); return (res<0) ? -1 : d.fd; } @@ -871,8 +927,7 @@ bufferevent_getfd(struct bufferevent *bev) enum bufferevent_options bufferevent_get_options_(struct bufferevent *bev) { - struct bufferevent_private *bev_p = - EVUTIL_UPCAST(bev, struct bufferevent_private, bev); + struct bufferevent_private *bev_p = BEV_UPCAST(bev); enum bufferevent_options options; BEV_LOCK(bev); @@ -948,8 +1003,7 @@ int bufferevent_generic_adj_timeouts_(struct bufferevent *bev) { const short enabled = bev->enabled; - struct bufferevent_private *bev_p = - EVUTIL_UPCAST(bev, struct bufferevent_private, bev); + struct bufferevent_private *bev_p = BEV_UPCAST(bev); int r1=0, r2=0; if ((enabled & EV_READ) && !bev_p->read_suspended && evutil_timerisset(&bev->timeout_read)) diff --git a/lib/monkey/mk_core/deps/libevent/bufferevent_async.c b/lib/monkey/mk_core/deps/libevent/bufferevent_async.c index 6395e57a9f0..40c7c5e8d0d 100644 --- a/lib/monkey/mk_core/deps/libevent/bufferevent_async.c +++ b/lib/monkey/mk_core/deps/libevent/bufferevent_async.c @@ -46,6 +46,7 @@ #ifdef _WIN32 #include +#include #include #endif @@ -100,11 +101,32 @@ const struct bufferevent_ops bufferevent_ops_async = { be_async_ctrl, }; +static inline void +be_async_run_eventcb(struct bufferevent *bev, short what, int options) +{ bufferevent_run_eventcb_(bev, what, options|BEV_TRIG_DEFER_CALLBACKS); } + +static inline void +be_async_trigger_nolock(struct bufferevent *bev, short what, int options) +{ bufferevent_trigger_nolock_(bev, what, options|BEV_TRIG_DEFER_CALLBACKS); } + +static inline int +fatal_error(int err) +{ + switch (err) { + /* We may have already associated this fd with a port. + * Let's hope it's this port, and that the error code + * for doing this neer changes. */ + case ERROR_INVALID_PARAMETER: + return 0; + } + return 1; +} + static inline struct bufferevent_async * upcast(struct bufferevent *bev) { struct bufferevent_async *bev_a; - if (bev->be_ops != &bufferevent_ops_async) + if (!BEV_IS_ASYNC(bev)) return NULL; bev_a = EVUTIL_UPCAST(bev, struct bufferevent_async, bev.bev); return bev_a; @@ -217,7 +239,7 @@ bev_async_consider_writing(struct bufferevent_async *beva) &beva->write_overlapped)) { bufferevent_decref_(bev); beva->ok = 0; - bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0); + be_async_run_eventcb(bev, BEV_EVENT_ERROR, 0); } else { beva->write_in_progress = at_most; bufferevent_decrement_write_buckets_(&beva->bev, at_most); @@ -270,7 +292,7 @@ bev_async_consider_reading(struct bufferevent_async *beva) bufferevent_incref_(bev); if (evbuffer_launch_read_(bev->input, at_most, &beva->read_overlapped)) { beva->ok = 0; - bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0); + be_async_run_eventcb(bev, BEV_EVENT_ERROR, 0); bufferevent_decref_(bev); } else { beva->read_in_progress = at_most; @@ -381,10 +403,10 @@ be_async_destruct(struct bufferevent *bev) bev_async_del_write(bev_async); fd = evbuffer_overlapped_get_fd_(bev->input); - if (fd != (evutil_socket_t)INVALID_SOCKET && + if (fd != (evutil_socket_t)EVUTIL_INVALID_SOCKET && (bev_p->options & BEV_OPT_CLOSE_ON_FREE)) { evutil_closesocket(fd); - evbuffer_overlapped_set_fd_(bev->input, INVALID_SOCKET); + evbuffer_overlapped_set_fd_(bev->input, EVUTIL_INVALID_SOCKET); } } @@ -428,8 +450,7 @@ connect_complete(struct event_overlapped *eo, ev_uintptr_t key, else bev_async_set_wsa_error(bev, eo); - bufferevent_run_eventcb_(bev, - ok? BEV_EVENT_CONNECTED : BEV_EVENT_ERROR, 0); + be_async_run_eventcb(bev, ok ? BEV_EVENT_CONNECTED : BEV_EVENT_ERROR, 0); event_base_del_virtual_(bev->ev_base); @@ -459,16 +480,16 @@ read_complete(struct event_overlapped *eo, ev_uintptr_t key, if (bev_a->ok) { if (ok && nbytes) { BEV_RESET_GENERIC_READ_TIMEOUT(bev); - bufferevent_trigger_nolock_(bev, EV_READ, 0); + be_async_trigger_nolock(bev, EV_READ, 0); bev_async_consider_reading(bev_a); } else if (!ok) { what |= BEV_EVENT_ERROR; bev_a->ok = 0; - bufferevent_run_eventcb_(bev, what, 0); + be_async_run_eventcb(bev, what, 0); } else if (!nbytes) { what |= BEV_EVENT_EOF; bev_a->ok = 0; - bufferevent_run_eventcb_(bev, what, 0); + be_async_run_eventcb(bev, what, 0); } } @@ -502,16 +523,16 @@ write_complete(struct event_overlapped *eo, ev_uintptr_t key, if (bev_a->ok) { if (ok && nbytes) { BEV_RESET_GENERIC_WRITE_TIMEOUT(bev); - bufferevent_trigger_nolock_(bev, EV_WRITE, 0); + be_async_trigger_nolock(bev, EV_WRITE, 0); bev_async_consider_writing(bev_a); } else if (!ok) { what |= BEV_EVENT_ERROR; bev_a->ok = 0; - bufferevent_run_eventcb_(bev, what, 0); + be_async_run_eventcb(bev, what, 0); } else if (!nbytes) { what |= BEV_EVENT_EOF; bev_a->ok = 0; - bufferevent_run_eventcb_(bev, what, 0); + be_async_run_eventcb(bev, what, 0); } } @@ -532,11 +553,7 @@ bufferevent_async_new_(struct event_base *base, return NULL; if (fd >= 0 && event_iocp_port_associate_(iocp, fd, 1)<0) { - int err = GetLastError(); - /* We may have alrady associated this fd with a port. - * Let's hope it's this port, and that the error code - * for doing this neer changes. */ - if (err != ERROR_INVALID_PARAMETER) + if (fatal_error(GetLastError())) return NULL; } @@ -580,7 +597,6 @@ bufferevent_async_set_connected_(struct bufferevent *bev) { struct bufferevent_async *bev_async = upcast(bev); bev_async->ok = 1; - bufferevent_init_generic_timeout_cbs_(bev); /* Now's a good time to consider reading/writing */ be_async_enable(bev, bev->enabled); } @@ -654,25 +670,29 @@ be_async_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op, data->fd = evbuffer_overlapped_get_fd_(bev->input); return 0; case BEV_CTRL_SET_FD: { + struct bufferevent_async *bev_a = upcast(bev); struct event_iocp_port *iocp; if (data->fd == evbuffer_overlapped_get_fd_(bev->input)) return 0; if (!(iocp = event_base_get_iocp_(bev->ev_base))) return -1; - if (event_iocp_port_associate_(iocp, data->fd, 1) < 0) - return -1; + if (event_iocp_port_associate_(iocp, data->fd, 1) < 0) { + if (fatal_error(GetLastError())) + return -1; + } evbuffer_overlapped_set_fd_(bev->input, data->fd); evbuffer_overlapped_set_fd_(bev->output, data->fd); + bev_a->ok = data->fd >= 0; return 0; } case BEV_CTRL_CANCEL_ALL: { struct bufferevent_async *bev_a = upcast(bev); evutil_socket_t fd = evbuffer_overlapped_get_fd_(bev->input); - if (fd != (evutil_socket_t)INVALID_SOCKET && + if (fd != (evutil_socket_t)EVUTIL_INVALID_SOCKET && (bev_a->bev.options & BEV_OPT_CLOSE_ON_FREE)) { closesocket(fd); - evbuffer_overlapped_set_fd_(bev->input, INVALID_SOCKET); + evbuffer_overlapped_set_fd_(bev->input, EVUTIL_INVALID_SOCKET); } bev_a->ok = 0; return 0; diff --git a/lib/monkey/mk_core/deps/libevent/bufferevent_filter.c b/lib/monkey/mk_core/deps/libevent/bufferevent_filter.c index d47f9452bbd..52a0e2715c0 100644 --- a/lib/monkey/mk_core/deps/libevent/bufferevent_filter.c +++ b/lib/monkey/mk_core/deps/libevent/bufferevent_filter.c @@ -82,7 +82,7 @@ struct bufferevent_filtered { /** The bufferevent that we read/write filtered data from/to. */ struct bufferevent *underlying; - /** A callback on our inbuf to notice somebory removes data */ + /** A callback on our inbuf to notice somebody removes data */ struct evbuffer_cb_entry *inbuf_cb; /** A callback on our outbuf to notice when somebody adds data */ struct evbuffer_cb_entry *outbuf_cb; @@ -118,11 +118,10 @@ static inline struct bufferevent_filtered * upcast(struct bufferevent *bev) { struct bufferevent_filtered *bev_f; - if (bev->be_ops != &bufferevent_ops_filter) - return NULL; + EVUTIL_ASSERT(BEV_IS_FILTER(bev)); bev_f = (void*)( ((char*)bev) - evutil_offsetof(struct bufferevent_filtered, bev.bev)); - EVUTIL_ASSERT(bev_f->bev.bev.be_ops == &bufferevent_ops_filter); + EVUTIL_ASSERT(BEV_IS_FILTER(&bev_f->bev.bev)); return bev_f; } @@ -160,7 +159,7 @@ be_null_filter(struct evbuffer *src, struct evbuffer *dst, ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx) { (void)state; - if (evbuffer_remove_buffer(src, dst, lim) == 0) + if (evbuffer_remove_buffer(src, dst, lim) >= 0) return BEV_OK; else return BEV_ERROR; @@ -229,8 +228,6 @@ static void be_filter_unlink(struct bufferevent *bev) { struct bufferevent_filtered *bevf = upcast(bev); - EVUTIL_ASSERT(bevf); - if (bevf->bev.options & BEV_OPT_CLOSE_ON_FREE) { /* Yes, there is also a decref in bufferevent_decref_. * That decref corresponds to the incref when we set @@ -258,7 +255,6 @@ static void be_filter_destruct(struct bufferevent *bev) { struct bufferevent_filtered *bevf = upcast(bev); - EVUTIL_ASSERT(bevf); if (bevf->free_context) bevf->free_context(bevf->context); @@ -575,7 +571,6 @@ be_filter_flush(struct bufferevent *bufev, { struct bufferevent_filtered *bevf = upcast(bufev); int processed_any = 0; - EVUTIL_ASSERT(bevf); bufferevent_incref_and_lock_(bufev); @@ -605,6 +600,7 @@ be_filter_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op, data->ptr = bevf->underlying; return 0; case BEV_CTRL_SET_FD: + case BEV_CTRL_GET_FD: bevf = upcast(bev); if (bevf->underlying && @@ -612,9 +608,10 @@ be_filter_ctrl(struct bufferevent *bev, enum bufferevent_ctrl_op op, bevf->underlying->be_ops->ctrl) { return (bevf->underlying->be_ops->ctrl)(bevf->underlying, op, data); } + EVUTIL_FALLTHROUGH; - case BEV_CTRL_GET_FD: case BEV_CTRL_CANCEL_ALL: + EVUTIL_FALLTHROUGH; default: return -1; } diff --git a/lib/monkey/mk_core/deps/libevent/bufferevent_mbedtls.c b/lib/monkey/mk_core/deps/libevent/bufferevent_mbedtls.c new file mode 100644 index 00000000000..58a038dcea9 --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/bufferevent_mbedtls.c @@ -0,0 +1,423 @@ +/* + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +/* Mbed-TLS 3.x does not currently expose a function to retrieve + the bio parameters from the SSL object. When the above issue has been + fixed, remove the MBEDTLS_ALLOW_PRIVATE_ACCESS define and use the + appropriate getter function in bufferevent_mbedtls_socket_new rather than + accessing the struct fields directly. */ +#define MBEDTLS_ALLOW_PRIVATE_ACCESS +#include "mbedtls-compat.h" +#include +#include +#include + +#include "event2/util.h" +#include "util-internal.h" +#include "event2/buffer.h" +#include "event2/bufferevent.h" +#include "event2/bufferevent_struct.h" +#include "event2/bufferevent_ssl.h" + +#include "ssl-compat.h" +#include "mm-internal.h" + +struct mbedtls_context { + mbedtls_dyncontext *ssl; + mbedtls_net_context net; +}; +static void * +mbedtls_context_init(void *ssl) +{ + struct mbedtls_context *ctx = mm_malloc(sizeof(*ctx)); + if (ctx) { + ctx->ssl = ssl; + ctx->net.fd = -1; + } + return ctx; +} +static void +mbedtls_context_free(void *ssl, int flags) +{ + struct mbedtls_context *ctx = ssl; + if (flags & BEV_OPT_CLOSE_ON_FREE) + bufferevent_mbedtls_dyncontext_free(ctx->ssl); + mm_free(ctx); +} +static int +mbedtls_context_renegotiate(void *ssl) +{ +#ifdef MBEDTLS_SSL_RENEGOTIATION + struct mbedtls_context *ctx = ssl; + return mbedtls_ssl_renegotiate(ctx->ssl); +#else + return MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE; +#endif +} +static int +mbedtls_context_write(void *ssl, const unsigned char *buf, size_t len) +{ + struct mbedtls_context *ctx = ssl; + return mbedtls_ssl_write(ctx->ssl, buf, len); +} +static int +mbedtls_context_read(void *ssl, unsigned char *buf, size_t len) +{ + struct mbedtls_context *ctx = ssl; + return mbedtls_ssl_read(ctx->ssl, buf, len); +} +static size_t +mbedtls_context_pending(void *ssl) +{ + struct mbedtls_context *ctx = ssl; + return mbedtls_ssl_get_bytes_avail(ctx->ssl); +} +static int +mbedtls_context_handshake(void *ssl) +{ + struct mbedtls_context *ctx = ssl; + return mbedtls_ssl_handshake(ctx->ssl); +} +static int +mbedtls_get_error(void *ssl, int ret) +{ + return ret; +} +static void +mbedtls_clear_error(void) +{ +} +static int +mbedtls_clear(void *ssl) +{ + return 1; +} +static void +mbedtls_set_ssl_noops(void *ssl) +{ +} +static int +mbedtls_handshake_is_ok(int err) +{ + /* What mbedtls_ssl_handshake() return on success */ + return err == 0; +} +static int +mbedtls_is_want_read(int err) +{ + return err == MBEDTLS_ERR_SSL_WANT_READ; +} +static int +mbedtls_is_want_write(int err) +{ + return err == MBEDTLS_ERR_SSL_WANT_WRITE; +} + +static evutil_socket_t +be_mbedtls_get_fd(void *ssl) +{ + struct bufferevent_ssl *bev = ssl; + struct mbedtls_context *ctx = bev->ssl; + return ctx->net.fd; +} + +static int be_mbedtls_bio_set_fd( + struct bufferevent_ssl *bev_ssl, evutil_socket_t fd); + +#if 0 +static void +print_err(int val) +{ + char buf[1024]; + mbedtls_strerror(val, buf, sizeof(buf)); + printf("Error was %d:%s\n", val, buf); +} +#else +static void +print_err(int val) +{ +} +#endif + +/* Called to extract data from the BIO. */ +static int +bio_bufferevent_read(void *ctx, unsigned char *out, size_t outlen) +{ + struct bufferevent *bufev = (struct bufferevent *)ctx; + int r = 0; + struct evbuffer *input; + + if (!out) + return 0; + if (!bufev) + return MBEDTLS_ERR_NET_INVALID_CONTEXT; + + input = bufferevent_get_input(bufev); + if (evbuffer_get_length(input) == 0) { + /* If there's no data to read, say so. */ + return MBEDTLS_ERR_SSL_WANT_READ; + } else { + r = evbuffer_remove(input, out, outlen); + } + + return r; +} + +/* Called to write data into the BIO */ +static int +bio_bufferevent_write(void *ctx, const unsigned char *in, size_t inlen) +{ + struct bufferevent *bufev = (struct bufferevent *)ctx; + struct evbuffer *output; + size_t outlen; + + if (!bufev) + return MBEDTLS_ERR_NET_INVALID_CONTEXT; + + output = bufferevent_get_output(bufev); + outlen = evbuffer_get_length(output); + + /* Copy only as much data onto the output buffer as can fit under the + * high-water mark. */ + if (bufev->wm_write.high && bufev->wm_write.high <= (outlen + inlen)) { + if (bufev->wm_write.high <= outlen) { + /* If no data can fit, we'll need to retry later. */ + return MBEDTLS_ERR_SSL_WANT_WRITE; + } + inlen = bufev->wm_write.high - outlen; + } + + EVUTIL_ASSERT(inlen > 0); + evbuffer_add(output, in, inlen); + return inlen; +} + +static void +conn_closed(struct bufferevent_ssl *bev_ssl, int when, int errcode, int ret) +{ + int event = BEV_EVENT_ERROR; + char buf[100]; + + if (when & BEV_EVENT_READING && ret == 0) { + if (bev_ssl->flags & BUFFEREVENT_SSL_DIRTY_SHUTDOWN) + event = BEV_EVENT_EOF; + } else { + mbedtls_strerror(errcode, buf, sizeof(buf)); + switch (errcode) { + case MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY: + event = BEV_EVENT_EOF; + break; + case MBEDTLS_ERR_SSL_CLIENT_RECONNECT: + event_warnx("BUG: Unsupported feature %d: %s", errcode, buf); + break; + default: + /* should be impossible; treat as normal error. */ + event_warnx( + "BUG: Unexpected mbedtls error code %d: %s", errcode, buf); + break; + } + + bufferevent_ssl_put_error(bev_ssl, errcode); + } + + bufferevent_ssl_stop_reading(bev_ssl); + bufferevent_ssl_stop_writing(bev_ssl); + + bufferevent_run_eventcb_(&bev_ssl->bev.bev, when | event, 0); +} + +static int +be_mbedtls_bio_set_fd(struct bufferevent_ssl *bev_ssl, evutil_socket_t fd) +{ + struct mbedtls_context *ctx = bev_ssl->ssl; + if (!bev_ssl->underlying) { + ctx->net.fd = fd; + mbedtls_ssl_set_bio( + ctx->ssl, &ctx->net, mbedtls_net_send, mbedtls_net_recv, NULL); + } else { + mbedtls_ssl_set_bio(ctx->ssl, bev_ssl->underlying, + bio_bufferevent_write, bio_bufferevent_read, NULL); + } + return 0; +} + +int +bufferevent_mbedtls_get_allow_dirty_shutdown(struct bufferevent *bev) +{ + return bufferevent_ssl_get_allow_dirty_shutdown(bev); +} + +void +bufferevent_mbedtls_set_allow_dirty_shutdown( + struct bufferevent *bev, int allow_dirty_shutdown) +{ + bufferevent_ssl_set_allow_dirty_shutdown(bev, allow_dirty_shutdown); +} + +mbedtls_ssl_context * +bufferevent_mbedtls_get_ssl(struct bufferevent *bufev) +{ + struct mbedtls_context *ctx = NULL; + struct bufferevent_ssl *bev_ssl = bufferevent_ssl_upcast(bufev); + if (!bev_ssl) + return NULL; + ctx = bev_ssl->ssl; + return ctx->ssl; +} + +int +bufferevent_mbedtls_renegotiate(struct bufferevent *bufev) +{ + return bufferevent_ssl_renegotiate_impl(bufev); +} + +unsigned long +bufferevent_get_mbedtls_error(struct bufferevent *bufev) +{ + struct bufferevent_ssl *bev_ssl = bufferevent_ssl_upcast(bufev); + if (!bev_ssl) + return 0; + return bufferevent_get_ssl_error(bufev); +} + +static struct le_ssl_ops le_mbedtls_ops = { + mbedtls_context_init, + mbedtls_context_free, + (void (*)(void *))bufferevent_mbedtls_dyncontext_free, + mbedtls_context_renegotiate, + mbedtls_context_write, + mbedtls_context_read, + mbedtls_context_pending, + mbedtls_context_handshake, + mbedtls_get_error, + mbedtls_clear_error, + mbedtls_clear, + mbedtls_set_ssl_noops, + mbedtls_set_ssl_noops, + mbedtls_handshake_is_ok, + mbedtls_is_want_read, + mbedtls_is_want_write, + be_mbedtls_get_fd, + be_mbedtls_bio_set_fd, + (void (*)(struct bufferevent_ssl *))mbedtls_set_ssl_noops, + (void (*)(struct bufferevent_ssl *))mbedtls_set_ssl_noops, + conn_closed, + print_err, +}; + +struct bufferevent * +bufferevent_mbedtls_filter_new(struct event_base *base, + struct bufferevent *underlying, mbedtls_ssl_context *ssl, + enum bufferevent_ssl_state state, int options) +{ + struct bufferevent *bev; + + if (!underlying) + goto err; + + bev = bufferevent_ssl_new_impl( + base, underlying, -1, ssl, state, options, &le_mbedtls_ops); + + if (bev) { + be_mbedtls_bio_set_fd(bufferevent_ssl_upcast(bev), -1); + } + + return bev; + +err: + if (options & BEV_OPT_CLOSE_ON_FREE) + bufferevent_mbedtls_dyncontext_free(ssl); + return NULL; +} + +struct bufferevent * +bufferevent_mbedtls_socket_new(struct event_base *base, evutil_socket_t fd, + mbedtls_ssl_context *ssl, enum bufferevent_ssl_state state, int options) +{ + long have_fd = -1; + struct bufferevent *bev; + + if (ssl->p_bio) { + /* The SSL is already configured with bio. */ + if (ssl->f_send == mbedtls_net_send && + ssl->f_recv == mbedtls_net_recv) { + have_fd = ((mbedtls_net_context *)ssl->p_bio)->fd; + } else if (ssl->f_send == bio_bufferevent_write && + ssl->f_recv == bio_bufferevent_read) { + have_fd = bufferevent_getfd(ssl->p_bio); + } else { + /* We don't known the fd. */ + have_fd = LONG_MAX; + } + } + + if (have_fd >= 0) { + if (fd < 0) { + /* We should learn the fd from the SSL. */ + fd = (evutil_socket_t)have_fd; + } else if (have_fd == (long)fd) { + /* We already know the fd from the SSL; do nothing */ + } else { + /* We specified an fd different from that of the SSL. + This is probably an error on our part. Fail. */ + goto err; + } + } else { + if (fd >= 0) { + /* ... and we have an fd we want to use. */ + } else { + /* Leave the fd unset. */ + } + } + + bev = bufferevent_ssl_new_impl( + base, NULL, fd, ssl, state, options, &le_mbedtls_ops); + + if (bev) { + be_mbedtls_bio_set_fd(bufferevent_ssl_upcast(bev), fd); + } + + return bev; +err: + return NULL; +} + +mbedtls_dyncontext * +bufferevent_mbedtls_dyncontext_new(struct mbedtls_ssl_config *conf) +{ + mbedtls_dyncontext *ctx = mm_calloc(1, sizeof(*ctx)); + mbedtls_ssl_init(ctx); + mbedtls_ssl_setup(ctx, conf); + return ctx; +} + +void +bufferevent_mbedtls_dyncontext_free(mbedtls_dyncontext *ctx) +{ + mbedtls_ssl_free(ctx); + mm_free(ctx); +} diff --git a/lib/monkey/mk_core/deps/libevent/bufferevent_openssl.c b/lib/monkey/mk_core/deps/libevent/bufferevent_openssl.c index cbb7f8a50b6..627532566d8 100644 --- a/lib/monkey/mk_core/deps/libevent/bufferevent_openssl.c +++ b/lib/monkey/mk_core/deps/libevent/bufferevent_openssl.c @@ -24,49 +24,24 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -// Get rid of OSX 10.7 and greater deprecation warnings. -#if defined(__APPLE__) && defined(__clang__) -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif - #include "event2/event-config.h" #include "evconfig-private.h" -#include - -#ifdef EVENT__HAVE_SYS_TIME_H -#include +#ifdef _WIN32 +# include #endif -#include -#include -#include #include -#ifdef EVENT__HAVE_STDARG_H -#include -#endif -#ifdef EVENT__HAVE_UNISTD_H -#include -#endif -#ifdef _WIN32 -#include -#endif +#include +#include +#include "openssl-compat.h" #include "event2/bufferevent.h" #include "event2/bufferevent_struct.h" -#include "event2/bufferevent_ssl.h" #include "event2/buffer.h" -#include "event2/event.h" -#include "mm-internal.h" -#include "bufferevent-internal.h" -#include "log-internal.h" - -#include -#include -#include -#include "openssl-compat.h" +#include "ssl-compat.h" /* * Define an OpenSSL bio that targets a bufferevent. @@ -103,7 +78,10 @@ print_err(int val) } } #else -#define print_err(v) ((void)0) +static void +print_err(int val) +{ +} #endif /* Called to initialize a new BIO */ @@ -155,7 +133,7 @@ bio_bufferevent_read(BIO *b, char *out, int outlen) return r; } -/* Called to write data info the BIO */ +/* Called to write data into the BIO */ static int bio_bufferevent_write(BIO *b, const char *in, int inlen) { @@ -165,7 +143,7 @@ bio_bufferevent_write(BIO *b, const char *in, int inlen) BIO_clear_retry_flags(b); - if (!BIO_get_data(b)) + if (!bufev) return -1; output = bufferevent_get_output(bufev); @@ -173,7 +151,7 @@ bio_bufferevent_write(BIO *b, const char *in, int inlen) /* Copy only as much data onto the output buffer as can fit under the * high-water mark. */ - if (bufev->wm_write.high && bufev->wm_write.high <= (outlen+inlen)) { + if (bufev->wm_write.high && bufev->wm_write.high <= (outlen + inlen)) { if (bufev->wm_write.high <= outlen) { /* If no data can fit, we'll need to retry later. */ BIO_set_retry_write(b); @@ -251,7 +229,7 @@ BIO_s_bufferevent(void) /* Create a new BIO to wrap communication around a bufferevent. If close_flag * is true, the bufferevent will be freed when the BIO is closed. */ static BIO * -BIO_new_bufferevent(struct bufferevent *bufferevent, int close_flag) +BIO_new_bufferevent(struct bufferevent *bufferevent) { BIO *result; if (!bufferevent) @@ -260,235 +238,14 @@ BIO_new_bufferevent(struct bufferevent *bufferevent, int close_flag) return NULL; BIO_set_init(result, 1); BIO_set_data(result, bufferevent); - BIO_set_shutdown(result, close_flag ? 1 : 0); + /* We don't tell the BIO to close the bufferevent; we do it ourselves on + * be_openssl_destruct() */ + BIO_set_shutdown(result, 0); return result; } -/* -------------------- - Now, here's the OpenSSL-based implementation of bufferevent. - - The implementation comes in two flavors: one that connects its SSL object - to an underlying bufferevent using a BIO_bufferevent, and one that has the - SSL object connect to a socket directly. The latter should generally be - faster, except on Windows, where your best bet is using a - bufferevent_async. - - (OpenSSL supports many other BIO types, too. But we can't use any unless - we have a good way to get notified when they become readable/writable.) - -------------------- */ - -struct bio_data_counts { - unsigned long n_written; - unsigned long n_read; -}; - -struct bufferevent_openssl { - /* Shared fields with common bufferevent implementation code. - If we were set up with an underlying bufferevent, we use the - events here as timers only. If we have an SSL, then we use - the events as socket events. - */ - struct bufferevent_private bev; - /* An underlying bufferevent that we're directing our output to. - If it's NULL, then we're connected to an fd, not an evbuffer. */ - struct bufferevent *underlying; - /* The SSL object doing our encryption. */ - SSL *ssl; - - /* A callback that's invoked when data arrives on our outbuf so we - know to write data to the SSL. */ - struct evbuffer_cb_entry *outbuf_cb; - - /* A count of how much data the bios have read/written total. Used - for rate-limiting. */ - struct bio_data_counts counts; - - /* If this value is greater than 0, then the last SSL_write blocked, - * and we need to try it again with this many bytes. */ - ev_ssize_t last_write; - -#define NUM_ERRORS 3 - ev_uint32_t errors[NUM_ERRORS]; - - /* When we next get available space, we should say "read" instead of - "write". This can happen if there's a renegotiation during a read - operation. */ - unsigned read_blocked_on_write : 1; - /* When we next get data, we should say "write" instead of "read". */ - unsigned write_blocked_on_read : 1; - /* Treat TCP close before SSL close on SSL >= v3 as clean EOF. */ - unsigned allow_dirty_shutdown : 1; - /* XXX */ - unsigned n_errors : 2; - - /* Are we currently connecting, accepting, or doing IO? */ - unsigned state : 2; - /* If we reset fd, we sould reset state too */ - unsigned old_state : 2; -}; - -static int be_openssl_enable(struct bufferevent *, short); -static int be_openssl_disable(struct bufferevent *, short); -static void be_openssl_unlink(struct bufferevent *); -static void be_openssl_destruct(struct bufferevent *); -static int be_openssl_adj_timeouts(struct bufferevent *); -static int be_openssl_flush(struct bufferevent *bufev, - short iotype, enum bufferevent_flush_mode mode); -static int be_openssl_ctrl(struct bufferevent *, enum bufferevent_ctrl_op, union bufferevent_ctrl_data *); - -const struct bufferevent_ops bufferevent_ops_openssl = { - "ssl", - evutil_offsetof(struct bufferevent_openssl, bev.bev), - be_openssl_enable, - be_openssl_disable, - be_openssl_unlink, - be_openssl_destruct, - be_openssl_adj_timeouts, - be_openssl_flush, - be_openssl_ctrl, -}; - -/* Given a bufferevent, return a pointer to the bufferevent_openssl that - * contains it, if any. */ -static inline struct bufferevent_openssl * -upcast(struct bufferevent *bev) -{ - struct bufferevent_openssl *bev_o; - if (bev->be_ops != &bufferevent_ops_openssl) - return NULL; - bev_o = (void*)( ((char*)bev) - - evutil_offsetof(struct bufferevent_openssl, bev.bev)); - EVUTIL_ASSERT(bev_o->bev.bev.be_ops == &bufferevent_ops_openssl); - return bev_o; -} - -static inline void -put_error(struct bufferevent_openssl *bev_ssl, unsigned long err) -{ - if (bev_ssl->n_errors == NUM_ERRORS) - return; - /* The error type according to openssl is "unsigned long", but - openssl never uses more than 32 bits of it. It _can't_ use more - than 32 bits of it, since it needs to report errors on systems - where long is only 32 bits. - */ - bev_ssl->errors[bev_ssl->n_errors++] = (ev_uint32_t) err; -} - -/* Have the base communications channel (either the underlying bufferevent or - * ev_read and ev_write) start reading. Take the read-blocked-on-write flag - * into account. */ -static int -start_reading(struct bufferevent_openssl *bev_ssl) -{ - if (bev_ssl->underlying) { - bufferevent_unsuspend_read_(bev_ssl->underlying, - BEV_SUSPEND_FILT_READ); - return 0; - } else { - struct bufferevent *bev = &bev_ssl->bev.bev; - int r; - r = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read); - if (r == 0 && bev_ssl->read_blocked_on_write) - r = bufferevent_add_event_(&bev->ev_write, - &bev->timeout_write); - return r; - } -} - -/* Have the base communications channel (either the underlying bufferevent or - * ev_read and ev_write) start writing. Take the write-blocked-on-read flag - * into account. */ -static int -start_writing(struct bufferevent_openssl *bev_ssl) -{ - int r = 0; - if (bev_ssl->underlying) { - ; - } else { - struct bufferevent *bev = &bev_ssl->bev.bev; - r = bufferevent_add_event_(&bev->ev_write, &bev->timeout_write); - if (!r && bev_ssl->write_blocked_on_read) - r = bufferevent_add_event_(&bev->ev_read, - &bev->timeout_read); - } - return r; -} - static void -stop_reading(struct bufferevent_openssl *bev_ssl) -{ - if (bev_ssl->write_blocked_on_read) - return; - if (bev_ssl->underlying) { - bufferevent_suspend_read_(bev_ssl->underlying, - BEV_SUSPEND_FILT_READ); - } else { - struct bufferevent *bev = &bev_ssl->bev.bev; - event_del(&bev->ev_read); - } -} - -static void -stop_writing(struct bufferevent_openssl *bev_ssl) -{ - if (bev_ssl->read_blocked_on_write) - return; - if (bev_ssl->underlying) { - ; - } else { - struct bufferevent *bev = &bev_ssl->bev.bev; - event_del(&bev->ev_write); - } -} - -static int -set_rbow(struct bufferevent_openssl *bev_ssl) -{ - if (!bev_ssl->underlying) - stop_reading(bev_ssl); - bev_ssl->read_blocked_on_write = 1; - return start_writing(bev_ssl); -} - -static int -set_wbor(struct bufferevent_openssl *bev_ssl) -{ - if (!bev_ssl->underlying) - stop_writing(bev_ssl); - bev_ssl->write_blocked_on_read = 1; - return start_reading(bev_ssl); -} - -static int -clear_rbow(struct bufferevent_openssl *bev_ssl) -{ - struct bufferevent *bev = &bev_ssl->bev.bev; - int r = 0; - bev_ssl->read_blocked_on_write = 0; - if (!(bev->enabled & EV_WRITE)) - stop_writing(bev_ssl); - if (bev->enabled & EV_READ) - r = start_reading(bev_ssl); - return r; -} - - -static int -clear_wbor(struct bufferevent_openssl *bev_ssl) -{ - struct bufferevent *bev = &bev_ssl->bev.bev; - int r = 0; - bev_ssl->write_blocked_on_read = 0; - if (!(bev->enabled & EV_READ)) - stop_reading(bev_ssl); - if (bev->enabled & EV_WRITE) - r = start_writing(bev_ssl); - return r; -} - -static void -conn_closed(struct bufferevent_openssl *bev_ssl, int when, int errcode, int ret) +conn_closed(struct bufferevent_ssl *bev_ssl, int when, int errcode, int ret) { int event = BEV_EVENT_ERROR; int dirty_shutdown = 0; @@ -506,12 +263,17 @@ conn_closed(struct bufferevent_openssl *bev_ssl, int when, int errcode, int ret) /* IO error; possibly a dirty shutdown. */ if ((ret == 0 || ret == -1) && ERR_peek_error() == 0) dirty_shutdown = 1; + bufferevent_ssl_put_error(bev_ssl, errcode); break; case SSL_ERROR_SSL: - /* Protocol error. */ + /* Protocol error; possibly a dirty shutdown. */ + if (ret == 0 && SSL_is_init_finished(bev_ssl->ssl) == 0) + dirty_shutdown = 1; + bufferevent_ssl_put_error(bev_ssl, errcode); break; case SSL_ERROR_WANT_X509_LOOKUP: /* XXXX handle this. */ + bufferevent_ssl_put_error(bev_ssl, errcode); break; case SSL_ERROR_NONE: case SSL_ERROR_WANT_READ: @@ -525,14 +287,14 @@ conn_closed(struct bufferevent_openssl *bev_ssl, int when, int errcode, int ret) } while ((err = ERR_get_error())) { - put_error(bev_ssl, err); + bufferevent_ssl_put_error(bev_ssl, err); } - if (dirty_shutdown && bev_ssl->allow_dirty_shutdown) + if (dirty_shutdown && bev_ssl->flags & BUFFEREVENT_SSL_DIRTY_SHUTDOWN) event = BEV_EVENT_EOF; - stop_reading(bev_ssl); - stop_writing(bev_ssl); + bufferevent_ssl_stop_reading(bev_ssl); + bufferevent_ssl_stop_writing(bev_ssl); /* when is BEV_EVENT_{READING|WRITING} */ event = when | event; @@ -540,7 +302,7 @@ conn_closed(struct bufferevent_openssl *bev_ssl, int when, int errcode, int ret) } static void -init_bio_counts(struct bufferevent_openssl *bev_ssl) +init_bio_counts(struct bufferevent_ssl *bev_ssl) { BIO *rbio, *wbio; @@ -551,7 +313,7 @@ init_bio_counts(struct bufferevent_openssl *bev_ssl) } static inline void -decrement_buckets(struct bufferevent_openssl *bev_ssl) +decrement_buckets(struct bufferevent_ssl *bev_ssl) { unsigned long num_w = BIO_number_written(SSL_get_wbio(bev_ssl->ssl)); unsigned long num_r = BIO_number_read(SSL_get_rbio(bev_ssl->ssl)); @@ -566,844 +328,137 @@ decrement_buckets(struct bufferevent_openssl *bev_ssl) bev_ssl->counts.n_read = num_r; } -#define OP_MADE_PROGRESS 1 -#define OP_BLOCKED 2 -#define OP_ERR 4 - -/* Return a bitmask of OP_MADE_PROGRESS (if we read anything); OP_BLOCKED (if - we're now blocked); and OP_ERR (if an error occurred). */ -static int -do_read(struct bufferevent_openssl *bev_ssl, int n_to_read) { - /* Requires lock */ - struct bufferevent *bev = &bev_ssl->bev.bev; - struct evbuffer *input = bev->input; - int r, n, i, n_used = 0, atmost; - struct evbuffer_iovec space[2]; - int result = 0; - - if (bev_ssl->bev.read_suspended) - return 0; - - atmost = bufferevent_get_read_max_(&bev_ssl->bev); - if (n_to_read > atmost) - n_to_read = atmost; - - n = evbuffer_reserve_space(input, n_to_read, space, 2); - if (n < 0) - return OP_ERR; - - for (i=0; ibev.read_suspended) - break; - ERR_clear_error(); - r = SSL_read(bev_ssl->ssl, space[i].iov_base, space[i].iov_len); - if (r>0) { - result |= OP_MADE_PROGRESS; - if (bev_ssl->read_blocked_on_write) - if (clear_rbow(bev_ssl) < 0) - return OP_ERR | result; - ++n_used; - space[i].iov_len = r; - decrement_buckets(bev_ssl); - } else { - int err = SSL_get_error(bev_ssl->ssl, r); - print_err(err); - switch (err) { - case SSL_ERROR_WANT_READ: - /* Can't read until underlying has more data. */ - if (bev_ssl->read_blocked_on_write) - if (clear_rbow(bev_ssl) < 0) - return OP_ERR | result; - break; - case SSL_ERROR_WANT_WRITE: - /* This read operation requires a write, and the - * underlying is full */ - if (!bev_ssl->read_blocked_on_write) - if (set_rbow(bev_ssl) < 0) - return OP_ERR | result; - break; - default: - conn_closed(bev_ssl, BEV_EVENT_READING, err, r); - break; - } - result |= OP_BLOCKED; - break; /* out of the loop */ - } - } - - if (n_used) { - evbuffer_commit_space(input, space, n_used); - if (bev_ssl->underlying) - BEV_RESET_GENERIC_READ_TIMEOUT(bev); - } - - return result; -} - -/* Return a bitmask of OP_MADE_PROGRESS (if we wrote anything); OP_BLOCKED (if - we're now blocked); and OP_ERR (if an error occurred). */ -static int -do_write(struct bufferevent_openssl *bev_ssl, int atmost) -{ - int i, r, n, n_written = 0; - struct bufferevent *bev = &bev_ssl->bev.bev; - struct evbuffer *output = bev->output; - struct evbuffer_iovec space[8]; - int result = 0; - - if (bev_ssl->last_write > 0) - atmost = bev_ssl->last_write; - else - atmost = bufferevent_get_write_max_(&bev_ssl->bev); - - n = evbuffer_peek(output, atmost, NULL, space, 8); - if (n < 0) - return OP_ERR | result; - - if (n > 8) - n = 8; - for (i=0; i < n; ++i) { - if (bev_ssl->bev.write_suspended) - break; - - /* SSL_write will (reasonably) return 0 if we tell it to - send 0 data. Skip this case so we don't interpret the - result as an error */ - if (space[i].iov_len == 0) - continue; - - ERR_clear_error(); - r = SSL_write(bev_ssl->ssl, space[i].iov_base, - space[i].iov_len); - if (r > 0) { - result |= OP_MADE_PROGRESS; - if (bev_ssl->write_blocked_on_read) - if (clear_wbor(bev_ssl) < 0) - return OP_ERR | result; - n_written += r; - bev_ssl->last_write = -1; - decrement_buckets(bev_ssl); - } else { - int err = SSL_get_error(bev_ssl->ssl, r); - print_err(err); - switch (err) { - case SSL_ERROR_WANT_WRITE: - /* Can't read until underlying has more data. */ - if (bev_ssl->write_blocked_on_read) - if (clear_wbor(bev_ssl) < 0) - return OP_ERR | result; - bev_ssl->last_write = space[i].iov_len; - break; - case SSL_ERROR_WANT_READ: - /* This read operation requires a write, and the - * underlying is full */ - if (!bev_ssl->write_blocked_on_read) - if (set_wbor(bev_ssl) < 0) - return OP_ERR | result; - bev_ssl->last_write = space[i].iov_len; - break; - default: - conn_closed(bev_ssl, BEV_EVENT_WRITING, err, r); - bev_ssl->last_write = -1; - break; - } - result |= OP_BLOCKED; - break; - } - } - if (n_written) { - evbuffer_drain(output, n_written); - if (bev_ssl->underlying) - BEV_RESET_GENERIC_WRITE_TIMEOUT(bev); - - bufferevent_trigger_nolock_(bev, EV_WRITE, 0); - } - return result; -} - -#define WRITE_FRAME 15000 - -#define READ_DEFAULT 4096 - -/* Try to figure out how many bytes to read; return 0 if we shouldn't be - * reading. */ -static int -bytes_to_read(struct bufferevent_openssl *bev) -{ - struct evbuffer *input = bev->bev.bev.input; - struct event_watermark *wm = &bev->bev.bev.wm_read; - int result = READ_DEFAULT; - ev_ssize_t limit; - /* XXX 99% of this is generic code that nearly all bufferevents will - * want. */ - - if (bev->write_blocked_on_read) { - return 0; - } - - if (! (bev->bev.bev.enabled & EV_READ)) { - return 0; - } - - if (bev->bev.read_suspended) { - return 0; - } - - if (wm->high) { - if (evbuffer_get_length(input) >= wm->high) { - return 0; - } - - result = wm->high - evbuffer_get_length(input); - } else { - result = READ_DEFAULT; - } - - /* Respect the rate limit */ - limit = bufferevent_get_read_max_(&bev->bev); - if (result > limit) { - result = limit; - } - - return result; -} - - -/* Things look readable. If write is blocked on read, write till it isn't. - * Read from the underlying buffer until we block or we hit our high-water - * mark. - */ -static void -consider_reading(struct bufferevent_openssl *bev_ssl) -{ - int r; - int n_to_read; - int all_result_flags = 0; - - while (bev_ssl->write_blocked_on_read) { - r = do_write(bev_ssl, WRITE_FRAME); - if (r & (OP_BLOCKED|OP_ERR)) - break; - } - if (bev_ssl->write_blocked_on_read) - return; - - n_to_read = bytes_to_read(bev_ssl); - - while (n_to_read) { - r = do_read(bev_ssl, n_to_read); - all_result_flags |= r; - - if (r & (OP_BLOCKED|OP_ERR)) - break; - - if (bev_ssl->bev.read_suspended) - break; - - /* Read all pending data. This won't hit the network - * again, and will (most importantly) put us in a state - * where we don't need to read anything else until the - * socket is readable again. It'll potentially make us - * overrun our read high-watermark (somewhat - * regrettable). The damage to the rate-limit has - * already been done, since OpenSSL went and read a - * whole SSL record anyway. */ - n_to_read = SSL_pending(bev_ssl->ssl); - - /* XXX This if statement is actually a bad bug, added to avoid - * XXX a worse bug. - * - * The bad bug: It can potentially cause resource unfairness - * by reading too much data from the underlying bufferevent; - * it can potentially cause read looping if the underlying - * bufferevent is a bufferevent_pair and deferred callbacks - * aren't used. - * - * The worse bug: If we didn't do this, then we would - * potentially not read any more from bev_ssl->underlying - * until more data arrived there, which could lead to us - * waiting forever. - */ - if (!n_to_read && bev_ssl->underlying) - n_to_read = bytes_to_read(bev_ssl); - } - - if (all_result_flags & OP_MADE_PROGRESS) { - struct bufferevent *bev = &bev_ssl->bev.bev; - - bufferevent_trigger_nolock_(bev, EV_READ, 0); - } - - if (!bev_ssl->underlying) { - /* Should be redundant, but let's avoid busy-looping */ - if (bev_ssl->bev.read_suspended || - !(bev_ssl->bev.bev.enabled & EV_READ)) { - event_del(&bev_ssl->bev.bev.ev_read); - } - } -} - -static void -consider_writing(struct bufferevent_openssl *bev_ssl) +static void * +SSL_init(void *ssl) { - int r; - struct evbuffer *output = bev_ssl->bev.bev.output; - struct evbuffer *target = NULL; - struct event_watermark *wm = NULL; - - while (bev_ssl->read_blocked_on_write) { - r = do_read(bev_ssl, 1024); /* XXXX 1024 is a hack */ - if (r & OP_MADE_PROGRESS) { - struct bufferevent *bev = &bev_ssl->bev.bev; - - bufferevent_trigger_nolock_(bev, EV_READ, 0); - } - if (r & (OP_ERR|OP_BLOCKED)) - break; - } - if (bev_ssl->read_blocked_on_write) - return; - if (bev_ssl->underlying) { - target = bev_ssl->underlying->output; - wm = &bev_ssl->underlying->wm_write; - } - while ((bev_ssl->bev.bev.enabled & EV_WRITE) && - (! bev_ssl->bev.write_suspended) && - evbuffer_get_length(output) && - (!target || (! wm->high || evbuffer_get_length(target) < wm->high))) { - int n_to_write; - if (wm && wm->high) - n_to_write = wm->high - evbuffer_get_length(target); - else - n_to_write = WRITE_FRAME; - r = do_write(bev_ssl, n_to_write); - if (r & (OP_BLOCKED|OP_ERR)) - break; - } - - if (!bev_ssl->underlying) { - if (evbuffer_get_length(output) == 0) { - event_del(&bev_ssl->bev.bev.ev_write); - } else if (bev_ssl->bev.write_suspended || - !(bev_ssl->bev.bev.enabled & EV_WRITE)) { - /* Should be redundant, but let's avoid busy-looping */ - event_del(&bev_ssl->bev.bev.ev_write); - } - } -} - -static void -be_openssl_readcb(struct bufferevent *bev_base, void *ctx) -{ - struct bufferevent_openssl *bev_ssl = ctx; - consider_reading(bev_ssl); -} - -static void -be_openssl_writecb(struct bufferevent *bev_base, void *ctx) -{ - struct bufferevent_openssl *bev_ssl = ctx; - consider_writing(bev_ssl); -} - -static void -be_openssl_eventcb(struct bufferevent *bev_base, short what, void *ctx) -{ - struct bufferevent_openssl *bev_ssl = ctx; - int event = 0; - - if (what & BEV_EVENT_EOF) { - if (bev_ssl->allow_dirty_shutdown) - event = BEV_EVENT_EOF; - else - event = BEV_EVENT_ERROR; - } else if (what & BEV_EVENT_TIMEOUT) { - /* We sure didn't set this. Propagate it to the user. */ - event = what; - } else if (what & BEV_EVENT_ERROR) { - /* An error occurred on the connection. Propagate it to the user. */ - event = what; - } else if (what & BEV_EVENT_CONNECTED) { - /* Ignore it. We're saying SSL_connect() already, which will - eat it. */ - } - if (event) - bufferevent_run_eventcb_(&bev_ssl->bev.bev, event, 0); -} + /* Don't explode if we decide to realloc a chunk we're writing from in + * the output buffer. */ + SSL_set_mode(ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); -static void -be_openssl_readeventcb(evutil_socket_t fd, short what, void *ptr) -{ - struct bufferevent_openssl *bev_ssl = ptr; - bufferevent_incref_and_lock_(&bev_ssl->bev.bev); - if (what == EV_TIMEOUT) { - bufferevent_run_eventcb_(&bev_ssl->bev.bev, - BEV_EVENT_TIMEOUT|BEV_EVENT_READING, 0); - } else { - consider_reading(bev_ssl); - } - bufferevent_decref_and_unlock_(&bev_ssl->bev.bev); + return ssl; } static void -be_openssl_writeeventcb(evutil_socket_t fd, short what, void *ptr) +SSL_context_free(void *ssl, int flags) { - struct bufferevent_openssl *bev_ssl = ptr; - bufferevent_incref_and_lock_(&bev_ssl->bev.bev); - if (what == EV_TIMEOUT) { - bufferevent_run_eventcb_(&bev_ssl->bev.bev, - BEV_EVENT_TIMEOUT|BEV_EVENT_WRITING, 0); - } else { - consider_writing(bev_ssl); - } - bufferevent_decref_and_unlock_(&bev_ssl->bev.bev); + if (flags & BEV_OPT_CLOSE_ON_FREE) + SSL_free(ssl); } static int -be_openssl_auto_fd(struct bufferevent_openssl *bev_ssl, int fd) +SSL_handshake_is_ok(int err) { - if (!bev_ssl->underlying) { - struct bufferevent *bev = &bev_ssl->bev.bev; - if (event_initialized(&bev->ev_read) && fd < 0) { - fd = event_get_fd(&bev->ev_read); - } - } - return fd; + /* What SSL_do_handshake() return on success */ + return err == 1; } static int -set_open_callbacks(struct bufferevent_openssl *bev_ssl, evutil_socket_t fd) +SSL_is_want_read(int err) { - if (bev_ssl->underlying) { - bufferevent_setcb(bev_ssl->underlying, - be_openssl_readcb, be_openssl_writecb, be_openssl_eventcb, - bev_ssl); - return 0; - } else { - struct bufferevent *bev = &bev_ssl->bev.bev; - int rpending=0, wpending=0, r1=0, r2=0; - - if (event_initialized(&bev->ev_read)) { - rpending = event_pending(&bev->ev_read, EV_READ, NULL); - wpending = event_pending(&bev->ev_write, EV_WRITE, NULL); - - event_del(&bev->ev_read); - event_del(&bev->ev_write); - } - - event_assign(&bev->ev_read, bev->ev_base, fd, - EV_READ|EV_PERSIST|EV_FINALIZE, - be_openssl_readeventcb, bev_ssl); - event_assign(&bev->ev_write, bev->ev_base, fd, - EV_WRITE|EV_PERSIST|EV_FINALIZE, - be_openssl_writeeventcb, bev_ssl); - - if (rpending) - r1 = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read); - if (wpending) - r2 = bufferevent_add_event_(&bev->ev_write, &bev->timeout_write); - - return (r1<0 || r2<0) ? -1 : 0; - } + return err == SSL_ERROR_WANT_READ; } static int -do_handshake(struct bufferevent_openssl *bev_ssl) -{ - int r; - - switch (bev_ssl->state) { - default: - case BUFFEREVENT_SSL_OPEN: - EVUTIL_ASSERT(0); - return -1; - case BUFFEREVENT_SSL_CONNECTING: - case BUFFEREVENT_SSL_ACCEPTING: - ERR_clear_error(); - r = SSL_do_handshake(bev_ssl->ssl); - break; - } - decrement_buckets(bev_ssl); - - if (r==1) { - int fd = event_get_fd(&bev_ssl->bev.bev.ev_read); - /* We're done! */ - bev_ssl->state = BUFFEREVENT_SSL_OPEN; - set_open_callbacks(bev_ssl, fd); /* XXXX handle failure */ - /* Call do_read and do_write as needed */ - bufferevent_enable(&bev_ssl->bev.bev, bev_ssl->bev.bev.enabled); - bufferevent_run_eventcb_(&bev_ssl->bev.bev, - BEV_EVENT_CONNECTED, 0); - return 1; - } else { - int err = SSL_get_error(bev_ssl->ssl, r); - print_err(err); - switch (err) { - case SSL_ERROR_WANT_WRITE: - if (!bev_ssl->underlying) { - stop_reading(bev_ssl); - return start_writing(bev_ssl); - } - return 0; - case SSL_ERROR_WANT_READ: - if (!bev_ssl->underlying) { - stop_writing(bev_ssl); - return start_reading(bev_ssl); - } - return 0; - default: - conn_closed(bev_ssl, BEV_EVENT_READING, err, r); - return -1; - } - } -} - -static void -be_openssl_handshakecb(struct bufferevent *bev_base, void *ctx) -{ - struct bufferevent_openssl *bev_ssl = ctx; - do_handshake(bev_ssl);/* XXX handle failure */ -} - -static void -be_openssl_handshakeeventcb(evutil_socket_t fd, short what, void *ptr) -{ - struct bufferevent_openssl *bev_ssl = ptr; - - bufferevent_incref_and_lock_(&bev_ssl->bev.bev); - if (what & EV_TIMEOUT) { - bufferevent_run_eventcb_(&bev_ssl->bev.bev, BEV_EVENT_TIMEOUT, 0); - } else - do_handshake(bev_ssl);/* XXX handle failure */ - bufferevent_decref_and_unlock_(&bev_ssl->bev.bev); -} - -static int -set_handshake_callbacks(struct bufferevent_openssl *bev_ssl, evutil_socket_t fd) -{ - if (bev_ssl->underlying) { - bufferevent_setcb(bev_ssl->underlying, - be_openssl_handshakecb, be_openssl_handshakecb, - be_openssl_eventcb, - bev_ssl); - return do_handshake(bev_ssl); - } else { - struct bufferevent *bev = &bev_ssl->bev.bev; - - if (event_initialized(&bev->ev_read)) { - event_del(&bev->ev_read); - event_del(&bev->ev_write); - } - - event_assign(&bev->ev_read, bev->ev_base, fd, - EV_READ|EV_PERSIST|EV_FINALIZE, - be_openssl_handshakeeventcb, bev_ssl); - event_assign(&bev->ev_write, bev->ev_base, fd, - EV_WRITE|EV_PERSIST|EV_FINALIZE, - be_openssl_handshakeeventcb, bev_ssl); - if (fd >= 0) - bufferevent_enable(bev, bev->enabled); - return 0; - } -} - -int -bufferevent_ssl_renegotiate(struct bufferevent *bev) +SSL_is_want_write(int err) { - struct bufferevent_openssl *bev_ssl = upcast(bev); - if (!bev_ssl) - return -1; - if (SSL_renegotiate(bev_ssl->ssl) < 0) - return -1; - bev_ssl->state = BUFFEREVENT_SSL_CONNECTING; - if (set_handshake_callbacks(bev_ssl, be_openssl_auto_fd(bev_ssl, -1)) < 0) - return -1; - if (!bev_ssl->underlying) - return do_handshake(bev_ssl); - return 0; + return err == SSL_ERROR_WANT_WRITE; } -static void -be_openssl_outbuf_cb(struct evbuffer *buf, - const struct evbuffer_cb_info *cbinfo, void *arg) -{ - struct bufferevent_openssl *bev_ssl = arg; - int r = 0; - /* XXX need to hold a reference here. */ - - if (cbinfo->n_added && bev_ssl->state == BUFFEREVENT_SSL_OPEN && - cbinfo->orig_size == 0) { - r = bufferevent_add_event_(&bev_ssl->bev.bev.ev_write, - &bev_ssl->bev.bev.timeout_write); - } - /* XXX Handle r < 0 */ - (void)r; -} - - static int -be_openssl_enable(struct bufferevent *bev, short events) +openssl_read(void *ssl, unsigned char *buf, size_t len) { - struct bufferevent_openssl *bev_ssl = upcast(bev); - int r1 = 0, r2 = 0; - - if (events & EV_READ) - r1 = start_reading(bev_ssl); - if (events & EV_WRITE) - r2 = start_writing(bev_ssl); - - if (bev_ssl->underlying) { - if (events & EV_READ) - BEV_RESET_GENERIC_READ_TIMEOUT(bev); - if (events & EV_WRITE) - BEV_RESET_GENERIC_WRITE_TIMEOUT(bev); - - if (events & EV_READ) - consider_reading(bev_ssl); - if (events & EV_WRITE) - consider_writing(bev_ssl); - } - return (r1 < 0 || r2 < 0) ? -1 : 0; + return SSL_read(ssl, buf, len); } static int -be_openssl_disable(struct bufferevent *bev, short events) +openssl_write(void *ssl, const unsigned char *buf, size_t len) { - struct bufferevent_openssl *bev_ssl = upcast(bev); - - if (events & EV_READ) - stop_reading(bev_ssl); - if (events & EV_WRITE) - stop_writing(bev_ssl); - - if (bev_ssl->underlying) { - if (events & EV_READ) - BEV_DEL_GENERIC_READ_TIMEOUT(bev); - if (events & EV_WRITE) - BEV_DEL_GENERIC_WRITE_TIMEOUT(bev); - } - return 0; + return SSL_write(ssl, buf, len); } -static void -be_openssl_unlink(struct bufferevent *bev) +static evutil_socket_t +be_openssl_get_fd(struct bufferevent_ssl *bev_ssl) { - struct bufferevent_openssl *bev_ssl = upcast(bev); - - if (bev_ssl->bev.options & BEV_OPT_CLOSE_ON_FREE) { - if (bev_ssl->underlying) { - if (BEV_UPCAST(bev_ssl->underlying)->refcnt < 2) { - event_warnx("BEV_OPT_CLOSE_ON_FREE set on an " - "bufferevent with too few references"); - } else { - bufferevent_free(bev_ssl->underlying); - /* We still have a reference to it, via our - * BIO. So we don't drop this. */ - // bev_ssl->underlying = NULL; - } - } - } else { - if (bev_ssl->underlying) { - if (bev_ssl->underlying->errorcb == be_openssl_eventcb) - bufferevent_setcb(bev_ssl->underlying, - NULL,NULL,NULL,NULL); - bufferevent_unsuspend_read_(bev_ssl->underlying, - BEV_SUSPEND_FILT_READ); - } - } -} - -static void -be_openssl_destruct(struct bufferevent *bev) -{ - struct bufferevent_openssl *bev_ssl = upcast(bev); - - if (bev_ssl->bev.options & BEV_OPT_CLOSE_ON_FREE) { - if (! bev_ssl->underlying) { - evutil_socket_t fd = -1; - BIO *bio = SSL_get_wbio(bev_ssl->ssl); - if (bio) - fd = BIO_get_fd(bio, NULL); - if (fd >= 0) - evutil_closesocket(fd); - } - SSL_free(bev_ssl->ssl); - } + evutil_socket_t fd = EVUTIL_INVALID_SOCKET; + BIO *bio = SSL_get_wbio(bev_ssl->ssl); + if (bio) + fd = BIO_get_fd(bio, NULL); + return fd; } static int -be_openssl_adj_timeouts(struct bufferevent *bev) +be_openssl_bio_set_fd(struct bufferevent_ssl *bev_ssl, evutil_socket_t fd) { - struct bufferevent_openssl *bev_ssl = upcast(bev); - - if (bev_ssl->underlying) { - return bufferevent_generic_adj_timeouts_(bev); + if (!bev_ssl->underlying) { + BIO *bio; + bio = BIO_new_socket((int)fd, 0); + SSL_set_bio(bev_ssl->ssl, bio, bio); } else { - return bufferevent_generic_adj_existing_timeouts_(bev); - } -} - -static int -be_openssl_flush(struct bufferevent *bufev, - short iotype, enum bufferevent_flush_mode mode) -{ - /* XXXX Implement this. */ - return 0; -} - -static int -be_openssl_set_fd(struct bufferevent_openssl *bev_ssl, - enum bufferevent_ssl_state state, int fd) -{ - bev_ssl->state = state; - - switch (state) { - case BUFFEREVENT_SSL_ACCEPTING: - SSL_set_accept_state(bev_ssl->ssl); - if (set_handshake_callbacks(bev_ssl, fd) < 0) - return -1; - break; - case BUFFEREVENT_SSL_CONNECTING: - SSL_set_connect_state(bev_ssl->ssl); - if (set_handshake_callbacks(bev_ssl, fd) < 0) + BIO *bio; + if (!(bio = BIO_new_bufferevent(bev_ssl->underlying))) return -1; - break; - case BUFFEREVENT_SSL_OPEN: - if (set_open_callbacks(bev_ssl, fd) < 0) - return -1; - break; - default: - return -1; + SSL_set_bio(bev_ssl->ssl, bio, bio); } - return 0; } -static int -be_openssl_ctrl(struct bufferevent *bev, - enum bufferevent_ctrl_op op, union bufferevent_ctrl_data *data) -{ - struct bufferevent_openssl *bev_ssl = upcast(bev); - switch (op) { - case BEV_CTRL_SET_FD: - if (bev_ssl->underlying) - return -1; - { - BIO *bio; - bio = BIO_new_socket(data->fd, 0); - SSL_set_bio(bev_ssl->ssl, bio, bio); - } - - return be_openssl_set_fd(bev_ssl, bev_ssl->old_state, data->fd); - case BEV_CTRL_GET_FD: - data->fd = event_get_fd(&bev->ev_read); - return 0; - case BEV_CTRL_GET_UNDERLYING: - data->ptr = bev_ssl->underlying; - return 0; - case BEV_CTRL_CANCEL_ALL: - default: - return -1; - } -} - -SSL * -bufferevent_openssl_get_ssl(struct bufferevent *bufev) -{ - struct bufferevent_openssl *bev_ssl = upcast(bufev); - if (!bev_ssl) - return NULL; - return bev_ssl->ssl; -} +static size_t SSL_pending_wrap(void *ssl) +{ + return SSL_pending(ssl); +} + +static struct le_ssl_ops le_openssl_ops = { + SSL_init, + SSL_context_free, + (void (*)(void *))SSL_free, + (int (*)(void *))SSL_renegotiate, + openssl_write, + openssl_read, + SSL_pending_wrap, + (int (*)(void *))SSL_do_handshake, + (int (*)(void *, int))SSL_get_error, + ERR_clear_error, + (int (*)(void *))SSL_clear, + (void (*)(void *))SSL_set_connect_state, + (void (*)(void *))SSL_set_accept_state, + SSL_handshake_is_ok, + SSL_is_want_read, + SSL_is_want_write, + (evutil_socket_t (*)(void *))be_openssl_get_fd, + be_openssl_bio_set_fd, + init_bio_counts, + decrement_buckets, + conn_closed, + print_err, +}; -static struct bufferevent * -bufferevent_openssl_new_impl(struct event_base *base, +struct bufferevent * +bufferevent_openssl_filter_new(struct event_base *base, struct bufferevent *underlying, - evutil_socket_t fd, SSL *ssl, enum bufferevent_ssl_state state, int options) { - struct bufferevent_openssl *bev_ssl = NULL; - struct bufferevent_private *bev_p = NULL; - int tmp_options = options & ~BEV_OPT_THREADSAFE; - - if (underlying != NULL && fd >= 0) - return NULL; /* Only one can be set. */ + BIO *bio; + struct bufferevent *bev; - if (!(bev_ssl = mm_calloc(1, sizeof(struct bufferevent_openssl)))) + if (!underlying) goto err; - - bev_p = &bev_ssl->bev; - - if (bufferevent_init_common_(bev_p, base, - &bufferevent_ops_openssl, tmp_options) < 0) + if (!(bio = BIO_new_bufferevent(underlying))) goto err; - /* Don't explode if we decide to realloc a chunk we're writing from in - * the output buffer. */ - SSL_set_mode(ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER); - - bev_ssl->underlying = underlying; - bev_ssl->ssl = ssl; - - bev_ssl->outbuf_cb = evbuffer_add_cb(bev_p->bev.output, - be_openssl_outbuf_cb, bev_ssl); - - if (options & BEV_OPT_THREADSAFE) - bufferevent_enable_locking_(&bev_ssl->bev.bev, NULL); - - if (underlying) { - bufferevent_init_generic_timeout_cbs_(&bev_ssl->bev.bev); - bufferevent_incref_(underlying); - } - - bev_ssl->old_state = state; - bev_ssl->last_write = -1; - - init_bio_counts(bev_ssl); - - fd = be_openssl_auto_fd(bev_ssl, fd); - if (be_openssl_set_fd(bev_ssl, state, fd)) - goto err; + SSL_set_bio(ssl, bio, bio); - if (underlying) { - bufferevent_setwatermark(underlying, EV_READ, 0, 0); - bufferevent_enable(underlying, EV_READ|EV_WRITE); - if (state == BUFFEREVENT_SSL_OPEN) - bufferevent_suspend_read_(underlying, - BEV_SUSPEND_FILT_READ); - } + bev = bufferevent_ssl_new_impl( + base, underlying, -1, ssl, state, options, &le_openssl_ops); + return bev; - return &bev_ssl->bev.bev; err: - if (bev_ssl) - bufferevent_free(&bev_ssl->bev.bev); + if (options & BEV_OPT_CLOSE_ON_FREE) + SSL_free(ssl); return NULL; } -struct bufferevent * -bufferevent_openssl_filter_new(struct event_base *base, - struct bufferevent *underlying, - SSL *ssl, - enum bufferevent_ssl_state state, - int options) -{ - /* We don't tell the BIO to close the bufferevent; we do it ourselves - * on be_openssl_destruct */ - int close_flag = 0; /* options & BEV_OPT_CLOSE_ON_FREE; */ - BIO *bio; - if (!underlying) - return NULL; - if (!(bio = BIO_new_bufferevent(underlying, close_flag))) - return NULL; - - SSL_set_bio(ssl, bio, bio); - - return bufferevent_openssl_new_impl( - base, underlying, -1, ssl, state, options); -} - struct bufferevent * bufferevent_openssl_socket_new(struct event_base *base, evutil_socket_t fd, @@ -1428,59 +483,62 @@ bufferevent_openssl_socket_new(struct event_base *base, } else { /* We specified an fd different from that of the SSL. This is probably an error on our part. Fail. */ - return NULL; + goto err; } - (void) BIO_set_close(bio, 0); + (void)BIO_set_close(bio, 0); } else { /* The SSL isn't configured with a BIO with an fd. */ if (fd >= 0) { /* ... and we have an fd we want to use. */ - bio = BIO_new_socket(fd, 0); + bio = BIO_new_socket((int)fd, 0); SSL_set_bio(ssl, bio, bio); } else { /* Leave the fd unset. */ } } - return bufferevent_openssl_new_impl( - base, NULL, fd, ssl, state, options); + return bufferevent_ssl_new_impl( + base, NULL, fd, ssl, state, options, &le_openssl_ops); + +err: + if (options & BEV_OPT_CLOSE_ON_FREE) + SSL_free(ssl); + return NULL; +} + +int +bufferevent_ssl_renegotiate(struct bufferevent *bev) +{ + return bufferevent_ssl_renegotiate_impl(bev); +} + +SSL * +bufferevent_openssl_get_ssl(struct bufferevent *bufev) +{ + struct bufferevent_ssl *bev_ssl = bufferevent_ssl_upcast(bufev); + if (!bev_ssl) + return NULL; + return bev_ssl->ssl; } int bufferevent_openssl_get_allow_dirty_shutdown(struct bufferevent *bev) { - int allow_dirty_shutdown = -1; - struct bufferevent_openssl *bev_ssl; - BEV_LOCK(bev); - bev_ssl = upcast(bev); - if (bev_ssl) - allow_dirty_shutdown = bev_ssl->allow_dirty_shutdown; - BEV_UNLOCK(bev); - return allow_dirty_shutdown; + return bufferevent_ssl_get_allow_dirty_shutdown(bev); } void -bufferevent_openssl_set_allow_dirty_shutdown(struct bufferevent *bev, - int allow_dirty_shutdown) +bufferevent_openssl_set_allow_dirty_shutdown( + struct bufferevent *bev, int allow_dirty_shutdown) { - struct bufferevent_openssl *bev_ssl; - BEV_LOCK(bev); - bev_ssl = upcast(bev); - if (bev_ssl) - bev_ssl->allow_dirty_shutdown = !!allow_dirty_shutdown; - BEV_UNLOCK(bev); + bufferevent_ssl_set_allow_dirty_shutdown(bev, allow_dirty_shutdown); } unsigned long -bufferevent_get_openssl_error(struct bufferevent *bev) +bufferevent_get_openssl_error(struct bufferevent *bufev) { - unsigned long err = 0; - struct bufferevent_openssl *bev_ssl; - BEV_LOCK(bev); - bev_ssl = upcast(bev); - if (bev_ssl && bev_ssl->n_errors) { - err = bev_ssl->errors[--bev_ssl->n_errors]; - } - BEV_UNLOCK(bev); - return err; + struct bufferevent_ssl *bev_ssl = bufferevent_ssl_upcast(bufev); + if (!bev_ssl) + return 0; + return bufferevent_get_ssl_error(bufev); } diff --git a/lib/monkey/mk_core/deps/libevent/bufferevent_pair.c b/lib/monkey/mk_core/deps/libevent/bufferevent_pair.c index 1e93f57293d..543fb45ea26 100644 --- a/lib/monkey/mk_core/deps/libevent/bufferevent_pair.c +++ b/lib/monkey/mk_core/deps/libevent/bufferevent_pair.c @@ -56,10 +56,8 @@ static inline struct bufferevent_pair * upcast(struct bufferevent *bev) { struct bufferevent_pair *bev_p; - if (bev->be_ops != &bufferevent_ops_pair) - return NULL; bev_p = EVUTIL_UPCAST(bev, struct bufferevent_pair, bev.bev); - EVUTIL_ASSERT(bev_p->bev.bev.be_ops == &bufferevent_ops_pair); + EVUTIL_ASSERT(BEV_IS_PAIR(&bev_p->bev.bev)); return bev_p; } @@ -289,7 +287,7 @@ be_pair_destruct(struct bufferevent *bev) * bufferevent_free(bev1) # refcnt == 0 -> unlink * bufferevent_free(bev2) # refcnt == 0 -> unlink * - * event_base_free() -> finilizers -> EVTHREAD_FREE_LOCK(bev1->lock) + * event_base_free() -> finalizers -> EVTHREAD_FREE_LOCK(bev1->lock) * -> BEV_LOCK(bev2->lock) <-- already freed * * Where bev1 == pair[0], bev2 == pair[1]. @@ -341,10 +339,9 @@ bufferevent_pair_get_partner(struct bufferevent *bev) { struct bufferevent_pair *bev_p; struct bufferevent *partner = NULL; - bev_p = upcast(bev); - if (! bev_p) + if (!BEV_IS_PAIR(bev)) return NULL; - + bev_p = upcast(bev); incref_and_lock(bev); if (bev_p->partner) partner = downcast(bev_p->partner); diff --git a/lib/monkey/mk_core/deps/libevent/bufferevent_ratelim.c b/lib/monkey/mk_core/deps/libevent/bufferevent_ratelim.c index bde192021be..d04662ce84a 100644 --- a/lib/monkey/mk_core/deps/libevent/bufferevent_ratelim.c +++ b/lib/monkey/mk_core/deps/libevent/bufferevent_ratelim.c @@ -76,7 +76,7 @@ ev_token_bucket_update_(struct ev_token_bucket *bucket, ev_uint32_t current_tick) { /* It's okay if the tick number overflows, since we'll just - * wrap around when we do the unsigned substraction. */ + * wrap around when we do the unsigned subtraction. */ unsigned n_ticks = current_tick - bucket->last_updated; /* Make sure some ticks actually happened, and that time didn't @@ -146,11 +146,29 @@ ev_token_bucket_cfg_new(size_t read_rate, size_t read_burst, { struct ev_token_bucket_cfg *r; struct timeval g; + unsigned msec_per_tick; + if (! tick_len) { g.tv_sec = 1; g.tv_usec = 0; tick_len = &g; } + + /* Avoid possible overflow. + * - there is no point in accepting values larger then INT_MAX/1000 anyway + * - on windows tv_sec (tv_usec) is long, which is int, which has upper value limit INT_MAX + * - and also negative values does not make any sense + */ + if (tick_len->tv_sec < 0 || tick_len->tv_sec > INT_MAX/1000) + return NULL; + + /* Note, overflow with tv_usec is not possible since tv_sec is limited to + * INT_MAX/1000 anyway */ + msec_per_tick = (unsigned)(tick_len->tv_sec * 1000) + + (tick_len->tv_usec & COMMON_TIMEOUT_MICROSECONDS_MASK)/1000; + if (!msec_per_tick) + return NULL; + if (read_rate > read_burst || write_rate > write_burst || read_rate < 1 || write_rate < 1) return NULL; @@ -167,8 +185,7 @@ ev_token_bucket_cfg_new(size_t read_rate, size_t read_burst, r->read_maximum = read_burst; r->write_maximum = write_burst; memcpy(&r->tick_timeout, tick_len, sizeof(struct timeval)); - r->msec_per_tick = (tick_len->tv_sec * 1000) + - (tick_len->tv_usec & COMMON_TIMEOUT_MICROSECONDS_MASK)/1000; + r->msec_per_tick = msec_per_tick; return r; } @@ -560,8 +577,7 @@ int bufferevent_set_rate_limit(struct bufferevent *bev, struct ev_token_bucket_cfg *cfg) { - struct bufferevent_private *bevp = - EVUTIL_UPCAST(bev, struct bufferevent_private, bev); + struct bufferevent_private *bevp = BEV_UPCAST(bev); int r = -1; struct bufferevent_rate_limit *rlim; struct timeval now; @@ -737,8 +753,7 @@ bufferevent_add_to_rate_limit_group(struct bufferevent *bev, struct bufferevent_rate_limit_group *g) { int wsuspend, rsuspend; - struct bufferevent_private *bevp = - EVUTIL_UPCAST(bev, struct bufferevent_private, bev); + struct bufferevent_private *bevp = BEV_UPCAST(bev); BEV_LOCK(bev); if (!bevp->rate_limiting) { @@ -789,8 +804,7 @@ int bufferevent_remove_from_rate_limit_group_internal_(struct bufferevent *bev, int unsuspend) { - struct bufferevent_private *bevp = - EVUTIL_UPCAST(bev, struct bufferevent_private, bev); + struct bufferevent_private *bevp = BEV_UPCAST(bev); BEV_LOCK(bev); if (bevp->rate_limiting && bevp->rate_limiting->group) { struct bufferevent_rate_limit_group *g = @@ -858,14 +872,16 @@ int bufferevent_set_max_single_read(struct bufferevent *bev, size_t size) { struct bufferevent_private *bevp; + int ret = 0; BEV_LOCK(bev); bevp = BEV_UPCAST(bev); if (size == 0 || size > EV_SSIZE_MAX) bevp->max_single_read = MAX_SINGLE_READ_DEFAULT; else bevp->max_single_read = size; + ret = evbuffer_set_max_read(bev->input, bevp->max_single_read); BEV_UNLOCK(bev); - return 0; + return ret; } int @@ -1088,5 +1104,8 @@ bufferevent_ratelim_init_(struct bufferevent_private *bev) bev->max_single_read = MAX_SINGLE_READ_DEFAULT; bev->max_single_write = MAX_SINGLE_WRITE_DEFAULT; + if (evbuffer_set_max_read(bev->bev.input, bev->max_single_read)) + return -1; + return 0; } diff --git a/lib/monkey/mk_core/deps/libevent/bufferevent_sock.c b/lib/monkey/mk_core/deps/libevent/bufferevent_sock.c index 58095f37de7..64ce5a5a775 100644 --- a/lib/monkey/mk_core/deps/libevent/bufferevent_sock.c +++ b/lib/monkey/mk_core/deps/libevent/bufferevent_sock.c @@ -99,26 +99,34 @@ const struct bufferevent_ops bufferevent_ops_socket = { const struct sockaddr* bufferevent_socket_get_conn_address_(struct bufferevent *bev) { - struct bufferevent_private *bev_p = - EVUTIL_UPCAST(bev, struct bufferevent_private, bev); - + struct bufferevent_private *bev_p = BEV_UPCAST(bev); return (struct sockaddr *)&bev_p->conn_address; } -static void -bufferevent_socket_set_conn_address_fd(struct bufferevent_private *bev_p, int fd) + +void +bufferevent_socket_set_conn_address_fd_(struct bufferevent *bev, + evutil_socket_t fd) { + struct bufferevent_private *bev_p = BEV_UPCAST(bev); + socklen_t len = sizeof(bev_p->conn_address); struct sockaddr *addr = (struct sockaddr *)&bev_p->conn_address; if (addr->sa_family != AF_UNSPEC) getpeername(fd, addr, &len); } -static void -bufferevent_socket_set_conn_address(struct bufferevent_private *bev_p, + +int +bufferevent_socket_set_conn_address_(struct bufferevent *bev, struct sockaddr *addr, size_t addrlen) { - EVUTIL_ASSERT(addrlen <= sizeof(bev_p->conn_address)); - memcpy(&bev_p->conn_address, addr, addrlen); + struct bufferevent_private *bev_p = BEV_UPCAST(bev); + if (addrlen <= sizeof(bev_p->conn_address)) { + memcpy(&bev_p->conn_address, addr, addrlen); + return 0; + } else { + return EVUTIL_EAI_FAIL; + } } static void @@ -127,8 +135,7 @@ bufferevent_socket_outbuf_cb(struct evbuffer *buf, void *arg) { struct bufferevent *bufev = arg; - struct bufferevent_private *bufev_p = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_p = BEV_UPCAST(bufev); if (cbinfo->n_added && (bufev->enabled & EV_WRITE) && @@ -146,8 +153,7 @@ static void bufferevent_readcb(evutil_socket_t fd, short event, void *arg) { struct bufferevent *bufev = arg; - struct bufferevent_private *bufev_p = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_p = BEV_UPCAST(bufev); struct evbuffer *input; int res = 0; short what = BEV_EVENT_READING; @@ -192,6 +198,8 @@ bufferevent_readcb(evutil_socket_t fd, short event, void *arg) int err = evutil_socket_geterror(fd); if (EVUTIL_ERR_RW_RETRIABLE(err)) goto reschedule; + /* NOTE: sometimes on FreeBSD 9.2 the connect() does not returns an + * error, and instead, first readv() will */ if (EVUTIL_ERR_CONNECT_REFUSED(err)) { bufev_p->connection_refused = 1; goto done; @@ -228,8 +236,7 @@ static void bufferevent_writecb(evutil_socket_t fd, short event, void *arg) { struct bufferevent *bufev = arg; - struct bufferevent_private *bufev_p = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_p = BEV_UPCAST(bufev); int res = 0; short what = BEV_EVENT_WRITING; int connected = 0; @@ -249,8 +256,8 @@ bufferevent_writecb(evutil_socket_t fd, short event, void *arg) /* we need to fake the error if the connection was refused * immediately - usually connection to localhost on BSD */ if (bufev_p->connection_refused) { - bufev_p->connection_refused = 0; - c = -1; + bufev_p->connection_refused = 0; + c = -1; } if (c == 0) @@ -264,7 +271,7 @@ bufferevent_writecb(evutil_socket_t fd, short event, void *arg) goto done; } else { connected = 1; - bufferevent_socket_set_conn_address_fd(bufev_p, fd); + bufferevent_socket_set_conn_address_fd_(bufev, fd); #ifdef _WIN32 if (BEV_IS_ASYNC(bufev)) { event_del(&bufev->ev_write); @@ -379,8 +386,7 @@ int bufferevent_socket_connect(struct bufferevent *bev, const struct sockaddr *sa, int socklen) { - struct bufferevent_private *bufev_p = - EVUTIL_UPCAST(bev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_p = BEV_UPCAST(bev); evutil_socket_t fd; int r = 0; @@ -389,9 +395,6 @@ bufferevent_socket_connect(struct bufferevent *bev, bufferevent_incref_and_lock_(bev); - if (!bufev_p) - goto done; - fd = bufferevent_getfd(bev); if (fd < 0) { if (!sa) @@ -412,11 +415,14 @@ bufferevent_socket_connect(struct bufferevent *bev, bufev_p->connecting = 1; result = 0; goto done; - } else + } else { #endif r = evutil_socket_connect_(&fd, sa, socklen); if (r < 0) goto freesock; +#ifdef _WIN32 + } +#endif } #ifdef _WIN32 /* ConnectEx() isn't always around, even when IOCP is enabled. @@ -438,22 +444,19 @@ bufferevent_socket_connect(struct bufferevent *bev, /* The connect succeeded already. How very BSD of it. */ result = 0; bufev_p->connecting = 1; - event_active(&bev->ev_write, EV_WRITE, 1); + bufferevent_trigger_nolock_(bev, EV_WRITE, BEV_OPT_DEFER_CALLBACKS); } else { - /* The connect failed already. How very BSD of it. */ - bufev_p->connection_refused = 1; - bufev_p->connecting = 1; + /* The connect failed already (only ECONNREFUSED case). How very BSD of it. */ result = 0; - event_active(&bev->ev_write, EV_WRITE, 1); + bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, BEV_OPT_DEFER_CALLBACKS); + bufferevent_disable(bev, EV_WRITE|EV_READ); } goto done; freesock: - bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0); if (ownfd) evutil_closesocket(fd); - /* do something about the error? */ done: bufferevent_decref_and_unlock_(bev); return result; @@ -464,8 +467,7 @@ bufferevent_connect_getaddrinfo_cb(int result, struct evutil_addrinfo *ai, void *arg) { struct bufferevent *bev = arg; - struct bufferevent_private *bev_p = - EVUTIL_UPCAST(bev, struct bufferevent_private, bev); + struct bufferevent_private *bev_p = BEV_UPCAST(bev); int r; BEV_LOCK(bev); @@ -479,6 +481,11 @@ bufferevent_connect_getaddrinfo_cb(int result, struct evutil_addrinfo *ai, bufferevent_decref_and_unlock_(bev); return; } + if (result == 0) { + /* XXX use the other addrinfos? */ + result = bufferevent_socket_set_conn_address_( + bev, ai->ai_addr, (int)ai->ai_addrlen); + } if (result != 0) { bev_p->dns_error = result; bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0); @@ -488,11 +495,9 @@ bufferevent_connect_getaddrinfo_cb(int result, struct evutil_addrinfo *ai, return; } - /* XXX use the other addrinfos? */ - /* XXX use this return value */ - bufferevent_socket_set_conn_address(bev_p, ai->ai_addr, (int)ai->ai_addrlen); r = bufferevent_socket_connect(bev, ai->ai_addr, (int)ai->ai_addrlen); - (void)r; + if (r < 0) + bufferevent_run_eventcb_(bev, BEV_EVENT_ERROR, 0); bufferevent_decref_and_unlock_(bev); evutil_freeaddrinfo(ai); } @@ -501,32 +506,42 @@ int bufferevent_socket_connect_hostname(struct bufferevent *bev, struct evdns_base *evdns_base, int family, const char *hostname, int port) { - char portbuf[10]; struct evutil_addrinfo hint; + memset(&hint, 0, sizeof(hint)); + hint.ai_family = family; + hint.ai_protocol = IPPROTO_TCP; + hint.ai_socktype = SOCK_STREAM; + + return bufferevent_socket_connect_hostname_hints(bev, evdns_base, &hint, hostname, port); +} + +int +bufferevent_socket_connect_hostname_hints(struct bufferevent *bev, + struct evdns_base *evdns_base, const struct evutil_addrinfo *hints_in, + const char *hostname, int port) +{ + char portbuf[10]; struct bufferevent_private *bev_p = EVUTIL_UPCAST(bev, struct bufferevent_private, bev); - if (family != AF_INET && family != AF_INET6 && family != AF_UNSPEC) + if (hints_in->ai_family != AF_INET && hints_in->ai_family != AF_INET6 && + hints_in->ai_family != AF_UNSPEC) return -1; if (port < 1 || port > 65535) return -1; - memset(&hint, 0, sizeof(hint)); - hint.ai_family = family; - hint.ai_protocol = IPPROTO_TCP; - hint.ai_socktype = SOCK_STREAM; - - evutil_snprintf(portbuf, sizeof(portbuf), "%d", port); - BEV_LOCK(bev); bev_p->dns_error = 0; + evutil_snprintf(portbuf, sizeof(portbuf), "%d", port); + bufferevent_suspend_write_(bev, BEV_SUSPEND_LOOKUP); bufferevent_suspend_read_(bev, BEV_SUSPEND_LOOKUP); bufferevent_incref_(bev); bev_p->dns_request = evutil_getaddrinfo_async_(evdns_base, hostname, - portbuf, &hint, bufferevent_connect_getaddrinfo_cb, bev); + portbuf, hints_in, bufferevent_connect_getaddrinfo_cb, bev); + BEV_UNLOCK(bev); return 0; @@ -536,8 +551,7 @@ int bufferevent_socket_get_dns_error(struct bufferevent *bev) { int rv; - struct bufferevent_private *bev_p = - EVUTIL_UPCAST(bev, struct bufferevent_private, bev); + struct bufferevent_private *bev_p = BEV_UPCAST(bev); BEV_LOCK(bev); rv = bev_p->dns_error; @@ -588,8 +602,7 @@ be_socket_enable(struct bufferevent *bufev, short event) static int be_socket_disable(struct bufferevent *bufev, short event) { - struct bufferevent_private *bufev_p = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_p = BEV_UPCAST(bufev); if (event & EV_READ) { if (event_del(&bufev->ev_read) == -1) return -1; @@ -605,10 +618,9 @@ be_socket_disable(struct bufferevent *bufev, short event) static void be_socket_destruct(struct bufferevent *bufev) { - struct bufferevent_private *bufev_p = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_p = BEV_UPCAST(bufev); evutil_socket_t fd; - EVUTIL_ASSERT(bufev->be_ops == &bufferevent_ops_socket); + EVUTIL_ASSERT(BEV_IS_SOCKET(bufev)); fd = event_get_fd(&bufev->ev_read); @@ -629,11 +641,10 @@ be_socket_flush(struct bufferevent *bev, short iotype, static void be_socket_setfd(struct bufferevent *bufev, evutil_socket_t fd) { - struct bufferevent_private *bufev_p = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_p = BEV_UPCAST(bufev); BEV_LOCK(bufev); - EVUTIL_ASSERT(bufev->be_ops == &bufferevent_ops_socket); + EVUTIL_ASSERT(BEV_IS_SOCKET(bufev)); event_del(&bufev->ev_read); event_del(&bufev->ev_write); @@ -659,11 +670,10 @@ int bufferevent_priority_set(struct bufferevent *bufev, int priority) { int r = -1; - struct bufferevent_private *bufev_p = - EVUTIL_UPCAST(bufev, struct bufferevent_private, bev); + struct bufferevent_private *bufev_p = BEV_UPCAST(bufev); BEV_LOCK(bufev); - if (bufev->be_ops != &bufferevent_ops_socket) + if (BEV_IS_ASYNC(bufev) || BEV_IS_FILTER(bufev) || BEV_IS_PAIR(bufev)) goto done; if (event_priority_set(&bufev->ev_read, priority) == -1) @@ -686,7 +696,7 @@ bufferevent_base_set(struct event_base *base, struct bufferevent *bufev) int res = -1; BEV_LOCK(bufev); - if (bufev->be_ops != &bufferevent_ops_socket) + if (!BEV_IS_SOCKET(bufev)) goto done; bufev->ev_base = base; diff --git a/lib/monkey/mk_core/deps/libevent/bufferevent_ssl.c b/lib/monkey/mk_core/deps/libevent/bufferevent_ssl.c new file mode 100644 index 00000000000..da56deaabe1 --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/bufferevent_ssl.c @@ -0,0 +1,1186 @@ +/* + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +// Get rid of OSX 10.7 and greater deprecation warnings. +#if defined(__APPLE__) && defined(__clang__) +#pragma clang diagnostic ignored "-Wdeprecated-declarations" +#endif + +#include "event2/event-config.h" +#include "evconfig-private.h" + +#include + +#ifdef EVENT__HAVE_SYS_TIME_H +#include +#endif + +#include +#include +#include +#include +#ifdef EVENT__HAVE_STDARG_H +#include +#endif +#ifdef EVENT__HAVE_UNISTD_H +#include +#endif + +#ifdef _WIN32 +#include +#endif + +#include "event2/bufferevent.h" +#include "event2/bufferevent_struct.h" +#include "event2/bufferevent_ssl.h" +#include "event2/buffer.h" +#include "event2/event.h" + +#include "mm-internal.h" +#include "bufferevent-internal.h" +#include "log-internal.h" +#include "ssl-compat.h" + +/* -------------------- + Now, here's the OpenSSL-based implementation of bufferevent. + + The implementation comes in two flavors: one that connects its SSL object + to an underlying bufferevent using a BIO_bufferevent, and one that has the + SSL object connect to a socket directly. The latter should generally be + faster, except on Windows, where your best bet is using a + bufferevent_async. + + (OpenSSL supports many other BIO types, too. But we can't use any unless + we have a good way to get notified when they become readable/writable.) + -------------------- */ + + +static int be_ssl_enable(struct bufferevent *, short); +static int be_ssl_disable(struct bufferevent *, short); +static void be_ssl_unlink(struct bufferevent *); +static void be_ssl_destruct(struct bufferevent *); +static int be_ssl_adj_timeouts(struct bufferevent *); +static int be_ssl_flush(struct bufferevent *bufev, + short iotype, enum bufferevent_flush_mode mode); +static int be_ssl_ctrl(struct bufferevent *, enum bufferevent_ctrl_op, union bufferevent_ctrl_data *); + +const struct bufferevent_ops bufferevent_ops_ssl = { + "ssl", + evutil_offsetof(struct bufferevent_ssl, bev.bev), + be_ssl_enable, + be_ssl_disable, + be_ssl_unlink, + be_ssl_destruct, + be_ssl_adj_timeouts, + be_ssl_flush, + be_ssl_ctrl, +}; + +/* Given a bufferevent, return a pointer to the bufferevent_ssl that + * contains it, if any. */ +struct bufferevent_ssl * +bufferevent_ssl_upcast(struct bufferevent *bev) +{ + struct bufferevent_ssl *bev_o; + EVUTIL_ASSERT(BEV_IS_SSL(bev)); + bev_o = (void*)( ((char*)bev) - + evutil_offsetof(struct bufferevent_ssl, bev.bev)); + EVUTIL_ASSERT(BEV_IS_SSL(&bev_o->bev.bev)); + return bev_o; +} + +void +bufferevent_ssl_put_error(struct bufferevent_ssl *bev_ssl, unsigned long err) +{ + if (bev_ssl->n_errors == NUM_ERRORS) + return; + /* The error type according to openssl is "unsigned long", but + openssl never uses more than 32 bits of it. It _can't_ use more + than 32 bits of it, since it needs to report errors on systems + where long is only 32 bits. + */ + bev_ssl->errors[bev_ssl->n_errors++] = (ev_uint32_t) err; +} + +/* Have the base communications channel (either the underlying bufferevent or + * ev_read and ev_write) start reading. Take the read-blocked-on-write flag + * into account. */ +static int +start_reading(struct bufferevent_ssl *bev_ssl) +{ + if (bev_ssl->underlying) { + bufferevent_unsuspend_read_(bev_ssl->underlying, + BEV_SUSPEND_FILT_READ); + return 0; + } else { + struct bufferevent *bev = &bev_ssl->bev.bev; + int r; + r = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read); + if (r == 0 && bev_ssl->read_blocked_on_write) + r = bufferevent_add_event_(&bev->ev_write, + &bev->timeout_write); + return r; + } +} + +/* Have the base communications channel (either the underlying bufferevent or + * ev_read and ev_write) start writing. Take the write-blocked-on-read flag + * into account. */ +static int +start_writing(struct bufferevent_ssl *bev_ssl) +{ + int r = 0; + if (bev_ssl->underlying) { + if (bev_ssl->write_blocked_on_read) { + bufferevent_unsuspend_read_(bev_ssl->underlying, + BEV_SUSPEND_FILT_READ); + } + } else { + struct bufferevent *bev = &bev_ssl->bev.bev; + r = bufferevent_add_event_(&bev->ev_write, &bev->timeout_write); + if (!r && bev_ssl->write_blocked_on_read) + r = bufferevent_add_event_(&bev->ev_read, + &bev->timeout_read); + } + return r; +} + +void +bufferevent_ssl_stop_reading(struct bufferevent_ssl *bev_ssl) +{ + if (bev_ssl->write_blocked_on_read) + return; + if (bev_ssl->underlying) { + bufferevent_suspend_read_(bev_ssl->underlying, + BEV_SUSPEND_FILT_READ); + } else { + struct bufferevent *bev = &bev_ssl->bev.bev; + event_del(&bev->ev_read); + } +} + +void +bufferevent_ssl_stop_writing(struct bufferevent_ssl *bev_ssl) +{ + if (bev_ssl->read_blocked_on_write) + return; + if (bev_ssl->underlying) { + bufferevent_unsuspend_read_(bev_ssl->underlying, + BEV_SUSPEND_FILT_READ); + } else { + struct bufferevent *bev = &bev_ssl->bev.bev; + event_del(&bev->ev_write); + } +} + +static int +set_rbow(struct bufferevent_ssl *bev_ssl) +{ + if (!bev_ssl->underlying) + bufferevent_ssl_stop_reading(bev_ssl); + bev_ssl->read_blocked_on_write = 1; + return start_writing(bev_ssl); +} + +static int +set_wbor(struct bufferevent_ssl *bev_ssl) +{ + if (!bev_ssl->underlying) + bufferevent_ssl_stop_writing(bev_ssl); + bev_ssl->write_blocked_on_read = 1; + return start_reading(bev_ssl); +} + +static int +clear_rbow(struct bufferevent_ssl *bev_ssl) +{ + struct bufferevent *bev = &bev_ssl->bev.bev; + int r = 0; + bev_ssl->read_blocked_on_write = 0; + if (!(bev->enabled & EV_WRITE)) + bufferevent_ssl_stop_writing(bev_ssl); + if (bev->enabled & EV_READ) + r = start_reading(bev_ssl); + return r; +} + + +static int +clear_wbor(struct bufferevent_ssl *bev_ssl) +{ + struct bufferevent *bev = &bev_ssl->bev.bev; + int r = 0; + bev_ssl->write_blocked_on_read = 0; + if (!(bev->enabled & EV_READ)) + bufferevent_ssl_stop_reading(bev_ssl); + if (bev->enabled & EV_WRITE) + r = start_writing(bev_ssl); + return r; +} + +#define OP_MADE_PROGRESS 1 +#define OP_BLOCKED 2 +#define OP_ERR 4 + +/* Return a bitmask of OP_MADE_PROGRESS (if we read anything); OP_BLOCKED (if + we're now blocked); and OP_ERR (if an error occurred). */ +static int +do_read(struct bufferevent_ssl *bev_ssl, int n_to_read) { + /* Requires lock */ + struct bufferevent *bev = &bev_ssl->bev.bev; + struct evbuffer *input = bev->input; + int r, n, i = 0, atmost; + struct evbuffer_iovec space[2]; + int result = 0; + size_t len = 0; + + if (bev_ssl->bev.read_suspended) + return 0; + + atmost = bufferevent_get_read_max_(&bev_ssl->bev); + if (n_to_read > atmost) + n_to_read = atmost; + + n = evbuffer_reserve_space(input, n_to_read, space, 2); + if (n < 0) + return OP_ERR; + + for (i = 0; i < n;) { + if (bev_ssl->bev.read_suspended) + break; + bev_ssl->ssl_ops->clear_error(); + r = bev_ssl->ssl_ops->read( + bev_ssl->ssl, (unsigned char *)space[i].iov_base + len, space[i].iov_len - len); + if (r > 0) { + result |= OP_MADE_PROGRESS; + if (bev_ssl->read_blocked_on_write) + if (clear_rbow(bev_ssl) < 0) + return OP_ERR | result; + bev_ssl->ssl_ops->decrement_buckets(bev_ssl); + len += r; + if (space[i].iov_len - len > 0) { + continue; + } else { + space[i].iov_len = len; + len = 0; + ++i; + } + } else { + int err = bev_ssl->ssl_ops->get_error(bev_ssl->ssl, r); + bev_ssl->ssl_ops->print_err(err); + /* NOTE: we ignore the error in case of some progress was done, + * because currently we do not send close_notify, and this will + * lead to error from SSL_read() (it will return 0, and + * SSL_get_error() will return SSL_ERROR_SSL), and this is because + * of lack of close_notify + * + * But AFAICS some code uses it the same way (i.e. nginx) */ + if (result & OP_MADE_PROGRESS) { + /* Process existing data */ + break; + } else if (bev_ssl->ssl_ops->err_is_want_read(err)) { + /* Can't read until underlying has more data. */ + if (bev_ssl->read_blocked_on_write) + if (clear_rbow(bev_ssl) < 0) + return OP_ERR | result; + } else if (bev_ssl->ssl_ops->err_is_want_write(err)) { + /* This read operation requires a write, and the + * underlying is full */ + if (!bev_ssl->read_blocked_on_write) + if (set_rbow(bev_ssl) < 0) + return OP_ERR | result; + } else { + bev_ssl->ssl_ops->conn_closed(bev_ssl, BEV_EVENT_READING, err, r); + } + result |= OP_BLOCKED; + break; /* out of the loop */ + } + } + + if (len > 0) { + space[i].iov_len = len; + ++i; + } + + if (i) { + evbuffer_commit_space(input, space, i); + if (bev_ssl->underlying) + BEV_RESET_GENERIC_READ_TIMEOUT(bev); + } + + return result; +} + +/* Return a bitmask of OP_MADE_PROGRESS (if we wrote anything); OP_BLOCKED (if + we're now blocked); and OP_ERR (if an error occurred). */ +static int +do_write(struct bufferevent_ssl *bev_ssl, int atmost) +{ + int i, r, n, n_written = 0; + struct bufferevent *bev = &bev_ssl->bev.bev; + struct evbuffer *output = bev->output; + struct evbuffer_iovec space[8]; + int result = 0; + + if (bev_ssl->last_write > 0) + atmost = bev_ssl->last_write; + else + atmost = bufferevent_get_write_max_(&bev_ssl->bev); + + if (bev_ssl->flags & BUFFEREVENT_SSL_BATCH_WRITE) { + /* Try to send as many as we can to avoid Nagle effect */ + evbuffer_pullup(output, -1); + } + + n = evbuffer_peek(output, atmost, NULL, space, 8); + if (n < 0) + return OP_ERR | result; + + if (n > 8) + n = 8; + for (i=0; i < n;) { + if (bev_ssl->bev.write_suspended) + break; + + /* SSL_write will (reasonably) return 0 if we tell it to + send 0 data. Skip this case so we don't interpret the + result as an error */ + if (space[i].iov_len == 0) { + ++i; + continue; + } + + bev_ssl->ssl_ops->clear_error(); + r = bev_ssl->ssl_ops->write(bev_ssl->ssl, space[i].iov_base, + space[i].iov_len); + if (r > 0) { + result |= OP_MADE_PROGRESS; + if (bev_ssl->write_blocked_on_read) + if (clear_wbor(bev_ssl) < 0) + return OP_ERR | result; + n_written += r; + bev_ssl->last_write = -1; + bev_ssl->ssl_ops->decrement_buckets(bev_ssl); + space[i].iov_base = (unsigned char *)space[i].iov_base + r; + space[i].iov_len -= r; + if (space[i].iov_len == 0) + ++i; + } else { + int err = bev_ssl->ssl_ops->get_error(bev_ssl->ssl, r); + bev_ssl->ssl_ops->print_err(err); + if (bev_ssl->ssl_ops->err_is_want_write(err)) { + /* Can't read until underlying has more data. */ + if (bev_ssl->write_blocked_on_read) + if (clear_wbor(bev_ssl) < 0) + return OP_ERR | result; + bev_ssl->last_write = space[i].iov_len; + } else if (bev_ssl->ssl_ops->err_is_want_read(err)) { + /* This read operation requires a write, and the + * underlying is full */ + if (!bev_ssl->write_blocked_on_read) + if (set_wbor(bev_ssl) < 0) + return OP_ERR | result; + bev_ssl->last_write = space[i].iov_len; + } else { + bev_ssl->ssl_ops->conn_closed(bev_ssl, BEV_EVENT_WRITING, err, r); + bev_ssl->last_write = -1; + } + result |= OP_BLOCKED; + break; + } + } + if (n_written) { + if (evbuffer_drain(output, n_written)) + return OP_ERR | result; + + if (bev_ssl->underlying) + BEV_RESET_GENERIC_WRITE_TIMEOUT(bev); + + bufferevent_trigger_nolock_(bev, EV_WRITE, BEV_OPT_DEFER_CALLBACKS); + } + return result; +} + +#define WRITE_FRAME 15000 + +/* Try to figure out how many bytes to read; return 0 if we shouldn't be + * reading. */ +static int +bytes_to_read(struct bufferevent_ssl *bev) +{ + struct evbuffer *input = bev->bev.bev.input; + struct event_watermark *wm = &bev->bev.bev.wm_read; + int result = 0; + ev_ssize_t limit; + /* XXX 99% of this is generic code that nearly all bufferevents will + * want. */ + + if (bev->write_blocked_on_read) { + return 0; + } + + if (! (bev->bev.bev.enabled & EV_READ)) { + return 0; + } + + if (bev->bev.read_suspended) { + return 0; + } + + if (wm->high) { + if (evbuffer_get_length(input) >= wm->high) { + return 0; + } + + result = wm->high - evbuffer_get_length(input); + } + + /* Respect the rate limit */ + limit = bufferevent_get_read_max_(&bev->bev); + if (result == 0 || result > limit) { + result = limit; + } + + return result; +} + + +/* Things look readable. If write is blocked on read, write till it isn't. + * Read from the underlying buffer until we block or we hit our high-water + * mark. + */ +static void +consider_reading(struct bufferevent_ssl *bev_ssl) +{ + int r; + int n_to_read; + int all_result_flags = 0; + + while (bev_ssl->write_blocked_on_read) { + r = do_write(bev_ssl, WRITE_FRAME); + if (r & (OP_BLOCKED|OP_ERR)) + break; + } + if (bev_ssl->write_blocked_on_read) + return; + + n_to_read = bytes_to_read(bev_ssl); + + while (n_to_read) { + r = do_read(bev_ssl, n_to_read); + all_result_flags |= r; + + if (r & (OP_BLOCKED|OP_ERR)) + break; + + if (bev_ssl->bev.read_suspended) + break; + + /* Read all pending data. This won't hit the network + * again, and will (most importantly) put us in a state + * where we don't need to read anything else until the + * socket is readable again. It'll potentially make us + * overrun our read high-watermark (somewhat + * regrettable). The damage to the rate-limit has + * already been done, since OpenSSL went and read a + * whole SSL record anyway. */ + n_to_read = bev_ssl->ssl_ops->pending(bev_ssl->ssl); + + /* XXX This if statement is actually a bad bug, added to avoid + * XXX a worse bug. + * + * The bad bug: It can potentially cause resource unfairness + * by reading too much data from the underlying bufferevent; + * it can potentially cause read looping if the underlying + * bufferevent is a bufferevent_pair and deferred callbacks + * aren't used. + * + * The worse bug: If we didn't do this, then we would + * potentially not read any more from bev_ssl->underlying + * until more data arrived there, which could lead to us + * waiting forever. + */ + if (!n_to_read && bev_ssl->underlying) + n_to_read = bytes_to_read(bev_ssl); + } + + if (all_result_flags & OP_MADE_PROGRESS) { + struct bufferevent *bev = &bev_ssl->bev.bev; + + bufferevent_trigger_nolock_(bev, EV_READ, 0); + } + + if (!bev_ssl->underlying) { + /* Should be redundant, but let's avoid busy-looping */ + if (bev_ssl->bev.read_suspended || + !(bev_ssl->bev.bev.enabled & EV_READ)) { + event_del(&bev_ssl->bev.bev.ev_read); + } + } +} + +static void +consider_writing(struct bufferevent_ssl *bev_ssl) +{ + int r; + struct evbuffer *output = bev_ssl->bev.bev.output; + struct evbuffer *target = NULL; + struct event_watermark *wm = NULL; + + while (bev_ssl->read_blocked_on_write) { + r = do_read(bev_ssl, 1024); /* XXXX 1024 is a hack */ + if (r & OP_MADE_PROGRESS) { + struct bufferevent *bev = &bev_ssl->bev.bev; + + bufferevent_trigger_nolock_(bev, EV_READ, 0); + } + if (r & (OP_ERR|OP_BLOCKED)) + break; + } + if (bev_ssl->read_blocked_on_write) + return; + if (bev_ssl->underlying) { + target = bev_ssl->underlying->output; + wm = &bev_ssl->underlying->wm_write; + } + while ((bev_ssl->bev.bev.enabled & EV_WRITE) && + (! bev_ssl->bev.write_suspended) && + evbuffer_get_length(output) && + (!target || (! wm->high || evbuffer_get_length(target) < wm->high))) { + int n_to_write; + if (wm && wm->high) + n_to_write = wm->high - evbuffer_get_length(target); + else + n_to_write = WRITE_FRAME; + r = do_write(bev_ssl, n_to_write); + if (r & (OP_BLOCKED|OP_ERR)) + break; + } + + if (!bev_ssl->underlying) { + if (evbuffer_get_length(output) == 0) { + event_del(&bev_ssl->bev.bev.ev_write); + } else if (bev_ssl->bev.write_suspended || + !(bev_ssl->bev.bev.enabled & EV_WRITE)) { + /* Should be redundant, but let's avoid busy-looping */ + event_del(&bev_ssl->bev.bev.ev_write); + } + } +} + +static void +be_ssl_readcb(struct bufferevent *bev_base, void *ctx) +{ + struct bufferevent_ssl *bev_ssl = ctx; + consider_reading(bev_ssl); +} + +static void +be_ssl_writecb(struct bufferevent *bev_base, void *ctx) +{ + struct bufferevent_ssl *bev_ssl = ctx; + consider_writing(bev_ssl); +} + +static void +be_ssl_eventcb(struct bufferevent *bev_base, short what, void *ctx) +{ + struct bufferevent_ssl *bev_ssl = ctx; + int event = 0; + + if (what & BEV_EVENT_EOF) { + if (bev_ssl->flags & BUFFEREVENT_SSL_DIRTY_SHUTDOWN) + event = BEV_EVENT_EOF; + else + event = BEV_EVENT_ERROR; + } else if (what & BEV_EVENT_TIMEOUT) { + /* We sure didn't set this. Propagate it to the user. */ + event = what; + } else if (what & BEV_EVENT_ERROR) { + /* An error occurred on the connection. Propagate it to the user. */ + event = what; + } else if (what & BEV_EVENT_CONNECTED) { + /* Ignore it. We're saying SSL_connect() already, which will + eat it. */ + } + if (event) + bufferevent_run_eventcb_(&bev_ssl->bev.bev, event, 0); +} + +static void +be_ssl_readeventcb(evutil_socket_t fd, short what, void *ptr) +{ + struct bufferevent_ssl *bev_ssl = ptr; + bufferevent_incref_and_lock_(&bev_ssl->bev.bev); + if (what == EV_TIMEOUT) { + bufferevent_run_eventcb_(&bev_ssl->bev.bev, + BEV_EVENT_TIMEOUT|BEV_EVENT_READING, 0); + } else { + consider_reading(bev_ssl); + } + bufferevent_decref_and_unlock_(&bev_ssl->bev.bev); +} + +static void +be_ssl_writeeventcb(evutil_socket_t fd, short what, void *ptr) +{ + struct bufferevent_ssl *bev_ssl = ptr; + bufferevent_incref_and_lock_(&bev_ssl->bev.bev); + if (what == EV_TIMEOUT) { + bufferevent_run_eventcb_(&bev_ssl->bev.bev, + BEV_EVENT_TIMEOUT|BEV_EVENT_WRITING, 0); + } else { + consider_writing(bev_ssl); + } + bufferevent_decref_and_unlock_(&bev_ssl->bev.bev); +} + +static evutil_socket_t +be_ssl_auto_fd(struct bufferevent_ssl *bev_ssl, evutil_socket_t fd) +{ + if (!bev_ssl->underlying) { + struct bufferevent *bev = &bev_ssl->bev.bev; + if (event_initialized(&bev->ev_read) && fd < 0) { + fd = event_get_fd(&bev->ev_read); + } + } + return fd; +} + +static int +set_open_callbacks(struct bufferevent_ssl *bev_ssl, evutil_socket_t fd) +{ + if (bev_ssl->underlying) { + bufferevent_setcb(bev_ssl->underlying, + be_ssl_readcb, be_ssl_writecb, be_ssl_eventcb, + bev_ssl); + return 0; + } else { + struct bufferevent *bev = &bev_ssl->bev.bev; + int rpending=0, wpending=0, r1=0, r2=0; + + if (event_initialized(&bev->ev_read)) { + rpending = event_pending(&bev->ev_read, EV_READ, NULL); + wpending = event_pending(&bev->ev_write, EV_WRITE, NULL); + + event_del(&bev->ev_read); + event_del(&bev->ev_write); + } + + event_assign(&bev->ev_read, bev->ev_base, fd, + EV_READ|EV_PERSIST|EV_FINALIZE, + be_ssl_readeventcb, bev_ssl); + event_assign(&bev->ev_write, bev->ev_base, fd, + EV_WRITE|EV_PERSIST|EV_FINALIZE, + be_ssl_writeeventcb, bev_ssl); + + if (rpending) + r1 = bufferevent_add_event_(&bev->ev_read, &bev->timeout_read); + if (wpending) + r2 = bufferevent_add_event_(&bev->ev_write, &bev->timeout_write); + + return (r1<0 || r2<0) ? -1 : 0; + } +} + +static int +do_handshake(struct bufferevent_ssl *bev_ssl) +{ + int r; + + switch (bev_ssl->state) { + default: + case BUFFEREVENT_SSL_OPEN: + EVUTIL_ASSERT(0); + return -1; + case BUFFEREVENT_SSL_CONNECTING: + case BUFFEREVENT_SSL_ACCEPTING: + bev_ssl->ssl_ops->clear_error(); + r = bev_ssl->ssl_ops->handshake(bev_ssl->ssl); + break; + } + bev_ssl->ssl_ops->decrement_buckets(bev_ssl); + + if (bev_ssl->ssl_ops->handshake_is_ok(r)) { + evutil_socket_t fd = event_get_fd(&bev_ssl->bev.bev.ev_read); + /* We're done! */ + bev_ssl->state = BUFFEREVENT_SSL_OPEN; + set_open_callbacks(bev_ssl, fd); /* XXXX handle failure */ + /* Call do_read and do_write as needed */ + bufferevent_enable(&bev_ssl->bev.bev, bev_ssl->bev.bev.enabled); + bufferevent_run_eventcb_(&bev_ssl->bev.bev, + BEV_EVENT_CONNECTED, 0); + return 1; + } else { + int err = bev_ssl->ssl_ops->get_error(bev_ssl->ssl, r); + bev_ssl->ssl_ops->print_err(err); + if (bev_ssl->ssl_ops->err_is_want_write(err)) { + bufferevent_ssl_stop_reading(bev_ssl); + return start_writing(bev_ssl); + } else if (bev_ssl->ssl_ops->err_is_want_read(err)) { + bufferevent_ssl_stop_writing(bev_ssl); + return start_reading(bev_ssl); + } else { + bev_ssl->ssl_ops->conn_closed(bev_ssl, BEV_EVENT_READING, err, r); + return -1; + } + } +} + +static void +be_ssl_handshakecb(struct bufferevent *bev_base, void *ctx) +{ + struct bufferevent_ssl *bev_ssl = ctx; + do_handshake(bev_ssl);/* XXX handle failure */ +} + +static void +be_ssl_handshakeeventcb(evutil_socket_t fd, short what, void *ptr) +{ + struct bufferevent_ssl *bev_ssl = ptr; + + bufferevent_incref_and_lock_(&bev_ssl->bev.bev); + if (what & EV_TIMEOUT) { + bufferevent_run_eventcb_(&bev_ssl->bev.bev, BEV_EVENT_TIMEOUT, 0); + } else { + int c = evutil_socket_finished_connecting_(fd); + if (c < 0) + bufferevent_run_eventcb_(&bev_ssl->bev.bev, BEV_EVENT_ERROR, 0); + else + do_handshake(bev_ssl);/* XXX handle failure */ + } + bufferevent_decref_and_unlock_(&bev_ssl->bev.bev); +} + +static int +set_handshake_callbacks(struct bufferevent_ssl *bev_ssl, evutil_socket_t fd) +{ + if (bev_ssl->underlying) { + bufferevent_setcb(bev_ssl->underlying, + be_ssl_handshakecb, be_ssl_handshakecb, + be_ssl_eventcb, + bev_ssl); + + if (fd < 0) + return 0; + + if (bufferevent_setfd(bev_ssl->underlying, fd)) + return 1; + + return do_handshake(bev_ssl); + } else { + struct bufferevent *bev = &bev_ssl->bev.bev; + + if (event_initialized(&bev->ev_read)) { + event_del(&bev->ev_read); + event_del(&bev->ev_write); + } + + event_assign(&bev->ev_read, bev->ev_base, fd, + EV_READ|EV_PERSIST|EV_FINALIZE, + be_ssl_handshakeeventcb, bev_ssl); + event_assign(&bev->ev_write, bev->ev_base, fd, + EV_WRITE|EV_PERSIST|EV_FINALIZE, + be_ssl_handshakeeventcb, bev_ssl); + if (fd >= 0) + bufferevent_enable(bev, bev->enabled); + return 0; + } +} + +int +bufferevent_ssl_renegotiate_impl(struct bufferevent *bev) +{ + struct bufferevent_ssl *bev_ssl; + if (!BEV_IS_SSL(bev)) + return -1; + + bev_ssl = bufferevent_ssl_upcast(bev); + if (bev_ssl->ssl_ops->renegotiate(bev_ssl->ssl) < 0) + return -1; + bev_ssl->state = BUFFEREVENT_SSL_CONNECTING; + if (set_handshake_callbacks(bev_ssl, be_ssl_auto_fd(bev_ssl, -1)) < 0) + return -1; + if (!bev_ssl->underlying) + return do_handshake(bev_ssl); + return 0; +} + +static void +be_ssl_outbuf_cb(struct evbuffer *buf, + const struct evbuffer_cb_info *cbinfo, void *arg) +{ + struct bufferevent_ssl *bev_ssl = arg; + int r = 0; + /* XXX need to hold a reference here. */ + + if (cbinfo->n_added && bev_ssl->state == BUFFEREVENT_SSL_OPEN) { + if (cbinfo->orig_size == 0) + r = bufferevent_add_event_(&bev_ssl->bev.bev.ev_write, + &bev_ssl->bev.bev.timeout_write); + + if (bev_ssl->underlying) + consider_writing(bev_ssl); + } + /* XXX Handle r < 0 */ + (void)r; +} + + +static int +be_ssl_enable(struct bufferevent *bev, short events) +{ + struct bufferevent_ssl *bev_ssl = bufferevent_ssl_upcast(bev); + int r1 = 0, r2 = 0; + + if (events & EV_READ) + r1 = start_reading(bev_ssl); + if (events & EV_WRITE) + r2 = start_writing(bev_ssl); + + if (bev_ssl->underlying) { + if (events & EV_READ) + BEV_RESET_GENERIC_READ_TIMEOUT(bev); + if (events & EV_WRITE) + BEV_RESET_GENERIC_WRITE_TIMEOUT(bev); + + if (events & EV_READ) + consider_reading(bev_ssl); + if (events & EV_WRITE) + consider_writing(bev_ssl); + } + return (r1 < 0 || r2 < 0) ? -1 : 0; +} + +static int +be_ssl_disable(struct bufferevent *bev, short events) +{ + struct bufferevent_ssl *bev_ssl = bufferevent_ssl_upcast(bev); + + if (events & EV_READ) + bufferevent_ssl_stop_reading(bev_ssl); + if (events & EV_WRITE) + bufferevent_ssl_stop_writing(bev_ssl); + + if (bev_ssl->underlying) { + if (events & EV_READ) + BEV_DEL_GENERIC_READ_TIMEOUT(bev); + if (events & EV_WRITE) + BEV_DEL_GENERIC_WRITE_TIMEOUT(bev); + } + return 0; +} + +static void +be_ssl_unlink(struct bufferevent *bev) +{ + struct bufferevent_ssl *bev_ssl = bufferevent_ssl_upcast(bev); + + if (bev_ssl->bev.options & BEV_OPT_CLOSE_ON_FREE) { + if (bev_ssl->underlying) { + if (BEV_UPCAST(bev_ssl->underlying)->refcnt < 2) { + event_warnx("BEV_OPT_CLOSE_ON_FREE set on an " + "bufferevent with too few references"); + } else { + bufferevent_free(bev_ssl->underlying); + /* We still have a reference to it, via our + * BIO. So we don't drop this. */ + // bev_ssl->underlying = NULL; + } + } + } else { + if (bev_ssl->underlying) { + if (bev_ssl->underlying->errorcb == be_ssl_eventcb) + bufferevent_setcb(bev_ssl->underlying, + NULL,NULL,NULL,NULL); + bufferevent_unsuspend_read_(bev_ssl->underlying, + BEV_SUSPEND_FILT_READ); + } + } +} + +static void +be_ssl_destruct(struct bufferevent *bev) +{ + struct bufferevent_ssl *bev_ssl = bufferevent_ssl_upcast(bev); + + if (bev_ssl->bev.options & BEV_OPT_CLOSE_ON_FREE) { + if (! bev_ssl->underlying) { + evutil_socket_t fd = bev_ssl->ssl_ops->get_fd(bev_ssl); + /* NOTE: This is dirty shutdown, to send close_notify one of the + * following should be used: + * - SSL_shutdown() + * - mbedtls_ssl_close_notify() */ + if (fd >= 0) + evutil_closesocket(fd); + } + } + bev_ssl->ssl_ops->free(bev_ssl->ssl, bev_ssl->bev.options); +} + +static int +be_ssl_adj_timeouts(struct bufferevent *bev) +{ + struct bufferevent_ssl *bev_ssl = bufferevent_ssl_upcast(bev); + + if (bev_ssl->underlying) { + return bufferevent_generic_adj_timeouts_(bev); + } else { + return bufferevent_generic_adj_existing_timeouts_(bev); + } +} + +static int +be_ssl_flush(struct bufferevent *bufev, + short iotype, enum bufferevent_flush_mode mode) +{ + /* XXXX Implement this. */ + return 0; +} + +static int +be_ssl_set_fd(struct bufferevent_ssl *bev_ssl, + enum bufferevent_ssl_state state, evutil_socket_t fd) +{ + bev_ssl->state = state; + + switch (state) { + case BUFFEREVENT_SSL_ACCEPTING: + if (!bev_ssl->ssl_ops->clear(bev_ssl->ssl)) + return -1; + bev_ssl->ssl_ops->set_accept_state(bev_ssl->ssl); + if (set_handshake_callbacks(bev_ssl, fd) < 0) + return -1; + break; + case BUFFEREVENT_SSL_CONNECTING: + if (!bev_ssl->ssl_ops->clear(bev_ssl->ssl)) + return -1; + bev_ssl->ssl_ops->set_connect_state(bev_ssl->ssl); + if (set_handshake_callbacks(bev_ssl, fd) < 0) + return -1; + break; + case BUFFEREVENT_SSL_OPEN: + if (set_open_callbacks(bev_ssl, fd) < 0) + return -1; + break; + default: + return -1; + } + + return 0; +} + +static int +be_ssl_ctrl(struct bufferevent *bev, + enum bufferevent_ctrl_op op, union bufferevent_ctrl_data *data) +{ + int ret = 0; + struct bufferevent_ssl *bev_ssl = bufferevent_ssl_upcast(bev); + switch (op) { + case BEV_CTRL_SET_FD: + if ((ret = bev_ssl->ssl_ops->bio_set_fd(bev_ssl, data->fd)) != 0) + return ret; + return be_ssl_set_fd(bev_ssl, bev_ssl->old_state, data->fd); + case BEV_CTRL_GET_FD: + if (bev_ssl->underlying) { + data->fd = event_get_fd(&bev_ssl->underlying->ev_read); + } else { + data->fd = event_get_fd(&bev->ev_read); + } + return 0; + case BEV_CTRL_GET_UNDERLYING: + data->ptr = bev_ssl->underlying; + return 0; + case BEV_CTRL_CANCEL_ALL: + default: + return -1; + } +} + +struct bufferevent * +bufferevent_ssl_new_impl(struct event_base *base, + struct bufferevent *underlying, + evutil_socket_t fd, + void *ssl, + enum bufferevent_ssl_state state, + int options, + struct le_ssl_ops *ssl_ops) +{ + struct bufferevent_ssl *bev_ssl = NULL; + struct bufferevent_private *bev_p = NULL; + int tmp_options = options & ~BEV_OPT_THREADSAFE; + + /* Only one can be set. */ + if (underlying != NULL && fd >= 0) + goto err; + + if (!(bev_ssl = mm_calloc(1, sizeof(struct bufferevent_ssl)))) + goto err; + + bev_p = &bev_ssl->bev; + + if (bufferevent_init_common_(bev_p, base, + &bufferevent_ops_ssl, tmp_options) < 0) + goto err; + + bev_ssl->ssl_ops = ssl_ops; + + bev_ssl->ssl = bev_ssl->ssl_ops->init(ssl); + + bev_ssl->underlying = underlying; + + bev_ssl->outbuf_cb = evbuffer_add_cb(bev_p->bev.output, + be_ssl_outbuf_cb, bev_ssl); + + if (options & BEV_OPT_THREADSAFE) + bufferevent_enable_locking_(&bev_ssl->bev.bev, NULL); + + if (underlying) { + bufferevent_init_generic_timeout_cbs_(&bev_ssl->bev.bev); + bufferevent_incref_(underlying); + } + + bev_ssl->old_state = state; + bev_ssl->last_write = -1; + + bev_ssl->ssl_ops->init_bio_counts(bev_ssl); + + fd = be_ssl_auto_fd(bev_ssl, fd); + if (be_ssl_set_fd(bev_ssl, state, fd)) + goto err; + + if (underlying) { + bufferevent_setwatermark(underlying, EV_READ, 0, 0); + bufferevent_enable(underlying, EV_READ|EV_WRITE); + if (state == BUFFEREVENT_SSL_OPEN) + bufferevent_suspend_read_(underlying, + BEV_SUSPEND_FILT_READ); + } + + return &bev_ssl->bev.bev; +err: + if (bev_ssl) { + if (bev_ssl->ssl && bev_ssl->ssl_ops && options & BEV_OPT_CLOSE_ON_FREE) + bev_ssl->ssl_ops->free(bev_ssl->ssl, options); + bev_ssl->ssl = NULL; + bufferevent_free(&bev_ssl->bev.bev); + } else { + if (ssl && options & BEV_OPT_CLOSE_ON_FREE) + ssl_ops->free_raw(ssl); + } + return NULL; +} + +unsigned long +bufferevent_get_ssl_error(struct bufferevent *bev) +{ + unsigned long err = 0; + struct bufferevent_ssl *bev_ssl; + + if (BEV_IS_SSL(bev)) + return err; + + BEV_LOCK(bev); + bev_ssl = bufferevent_ssl_upcast(bev); + if (bev_ssl->n_errors) { + err = bev_ssl->errors[--bev_ssl->n_errors]; + } + BEV_UNLOCK(bev); + return err; +} + +ev_uint64_t bufferevent_ssl_get_flags(struct bufferevent *bev) +{ + ev_uint64_t flags = EV_UINT64_MAX; + struct bufferevent_ssl *bev_ssl; + + if (!BEV_IS_SSL(bev)) + return flags; + + BEV_LOCK(bev); + bev_ssl = bufferevent_ssl_upcast(bev); + flags = bev_ssl->flags; + BEV_UNLOCK(bev); + + return flags; +} +ev_uint64_t bufferevent_ssl_set_flags(struct bufferevent *bev, ev_uint64_t flags) +{ + ev_uint64_t old_flags = EV_UINT64_MAX; + struct bufferevent_ssl *bev_ssl; + + flags &= (BUFFEREVENT_SSL_DIRTY_SHUTDOWN|BUFFEREVENT_SSL_BATCH_WRITE); + if (!flags || !BEV_IS_SSL(bev)) + return old_flags; + + BEV_LOCK(bev); + bev_ssl = bufferevent_ssl_upcast(bev); + old_flags = bev_ssl->flags; + bev_ssl->flags |= flags; + BEV_UNLOCK(bev); + + return old_flags; +} +ev_uint64_t bufferevent_ssl_clear_flags(struct bufferevent *bev, ev_uint64_t flags) +{ + ev_uint64_t old_flags = EV_UINT64_MAX; + struct bufferevent_ssl *bev_ssl; + + flags &= (BUFFEREVENT_SSL_DIRTY_SHUTDOWN|BUFFEREVENT_SSL_BATCH_WRITE); + if (!flags || !BEV_IS_SSL(bev)) + return old_flags; + + BEV_LOCK(bev); + bev_ssl = bufferevent_ssl_upcast(bev); + old_flags = bev_ssl->flags; + bev_ssl->flags &= ~flags; + BEV_UNLOCK(bev); + + return old_flags; +} + +int +bufferevent_ssl_get_allow_dirty_shutdown(struct bufferevent *bev) +{ + ev_uint64_t flags = bufferevent_ssl_get_flags(bev); + if (flags == EV_UINT64_MAX) + return flags; + return !!(flags & BUFFEREVENT_SSL_DIRTY_SHUTDOWN); +} + +void +bufferevent_ssl_set_allow_dirty_shutdown( + struct bufferevent *bev, int allow_dirty_shutdown) +{ + BEV_LOCK(bev); + + if (allow_dirty_shutdown) + bufferevent_ssl_set_flags(bev, BUFFEREVENT_SSL_DIRTY_SHUTDOWN); + else + bufferevent_ssl_clear_flags(bev, BUFFEREVENT_SSL_DIRTY_SHUTDOWN); + + BEV_UNLOCK(bev); +} diff --git a/lib/monkey/mk_core/deps/libevent/build-aux/compile b/lib/monkey/mk_core/deps/libevent/build-aux/compile new file mode 100755 index 00000000000..02ff093c33c --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/build-aux/compile @@ -0,0 +1,364 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2025-06-18.21; # UTC + +# Copyright (C) 1999-2025 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file unneeded_conversions +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) UNNEEDED_CONVERSIONS, no +# conversion will take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + if test -n "$MSYSTEM" && (cygpath --version) >/dev/null 2>&1; then + # MSYS2 environment. + file_conv=cygwin + else + # Original MinGW environment. + file_conv=mingw + fi + ;; + MSYS*) + # Old MSYS environment, or MSYS2 with 32-bit MSYS2 shell. + file_conv=cygwin + ;; + CYGWIN*) + # Cygwin environment. + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + # This is the optimization mentioned above: + # If UNNEEDED_CONVERSIONS contains $file_conv, don't convert. + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -w "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.lo | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +GNU Automake home page: . +General help using GNU software: . +EOF + exit $? + ;; + -v | --v*) + echo "compile (GNU Automake) $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + clang-cl | *[/\\]clang-cl | clang-cl.exe | *[/\\]clang-cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp nil t) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%Y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/lib/monkey/mk_core/deps/libevent/build-aux/config.guess b/lib/monkey/mk_core/deps/libevent/build-aux/config.guess new file mode 100755 index 00000000000..b790fcbe360 --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/build-aux/config.guess @@ -0,0 +1,1815 @@ +#!/usr/bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2024 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2024-07-27' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess +# +# Please send patches to . + + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system '$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2024 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try '$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +# Just in case it came from the environment. +GUESS= + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still +# use 'HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c17 c99 c89 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if test -f /.attbin/uname ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case $UNAME_SYSTEM in +Linux|GNU|GNU/*) + LIBC=unknown + + set_cc_for_build + cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #elif defined(__GLIBC__) + LIBC=gnu + #elif defined(__LLVM_LIBC__) + LIBC=llvm + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif + #endif + #endif + EOF + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + echo unknown)` + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case $UNAME_MACHINE_ARCH in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case $UNAME_MACHINE_ARCH in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case $UNAME_VERSION in + Debian*) + release='-gnu' + ;; + *) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + GUESS=$machine-${os}${release}${abi-} + ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; + *:ekkoBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; + *:SolidBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; + macppc:MirBSD:*:*) + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; + *:MirBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; + *:Sortix:*:*) + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; + alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case $ALPHA_CPU_TYPE in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; + Amiga*:UNIX_System_V:4.0:*) + GUESS=m68k-unknown-sysv4 + ;; + *:[Aa]miga[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; + *:[Mm]orph[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-morphos + ;; + *:OS/390:*:*) + GUESS=i370-ibm-openedition + ;; + *:z/VM:*:*) + GUESS=s390-ibm-zvmoe + ;; + *:OS400:*:*) + GUESS=powerpc-ibm-os400 + ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + GUESS=arm-unknown-riscos + ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + GUESS=hppa1.1-hitachi-hiuxmpp + ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; + NILE*:*:*:dcosx) + GUESS=pyramid-pyramid-svr4 + ;; + DRS?6000:unix:4.0:6*) + GUESS=sparc-icl-nx6 + ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; + s390x:SunOS:*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; + sun4H:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; + sun4*:SunOS:*:*) + case `/usr/bin/arch -k` in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like '4.1.3-JL'. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; + sun3*:SunOS:*:*) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case `/bin/arch` in + sun3) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + sun4) + GUESS=sparc-sun-sunos$UNAME_RELEASE + ;; + esac + ;; + aushp:SunOS:*:*) + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; + m68k:machten:*:*) + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; + powerpc:machten:*:*) + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; + RISC*:Mach:*:*) + GUESS=mips-dec-mach_bsd4.3 + ;; + RISC*:ULTRIX:*:*) + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; + VAX*:ULTRIX*:*:*) + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; + Motorola:PowerMAX_OS:*:*) + GUESS=powerpc-motorola-powermax + ;; + Motorola:*:4.3:PL8-*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:Power_UNIX:*:*) + GUESS=powerpc-harris-powerunix + ;; + m88k:CX/UX:7*:*) + GUESS=m88k-harris-cxux7 + ;; + m88k:*:4*:R4*) + GUESS=m88k-motorola-sysv4 + ;; + m88k:*:3*:R3*) + GUESS=m88k-motorola-sysv3 + ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 + then + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x + then + GUESS=m88k-dg-dgux$UNAME_RELEASE + else + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE + fi + else + GUESS=i586-dg-dgux$UNAME_RELEASE + fi + ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + GUESS=m88k-dolphin-sysv3 + ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + GUESS=m88k-motorola-sysv3 + ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + GUESS=m88k-tektronix-sysv3 + ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + GUESS=m68k-tektronix-bsd + ;; + *:IRIX*:*:*) + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + GUESS=i386-ibm-aix + ;; + ia64:AIX:*:*) + if test -x /usr/bin/oslevel ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + + int + main () + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + GUESS=$SYSTEM_NAME + else + GUESS=rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + GUESS=rs6000-ibm-aix3.2.4 + else + GUESS=rs6000-ibm-aix3.2 + fi + ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; + *:AIX:*:*) + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + GUESS=rs6000-bull-bosx + ;; + DPX/2?00:B.O.S.:*:*) + GUESS=m68k-bull-sysv3 + ;; + 9000/[34]??:4.3bsd:1.*:*) + GUESS=m68k-hp-bsd + ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + GUESS=m68k-hp-bsd4.4 + ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if test -x /usr/bin/getconf; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case $sc_cpu_version in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case $sc_kernel_bits in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int + main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if test "$HP_ARCH" = hppa2.0w + then + set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; + 3050*:HI-UX:*:*) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; + 9000/8??:4.3bsd:*:*) + GUESS=hppa1.0-hp-bsd + ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; + hp8??:OSF1:*:*) + GUESS=hppa1.0-hp-osf + ;; + i*86:OSF1:*:*) + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk + else + GUESS=$UNAME_MACHINE-unknown-osf1 + fi + ;; + parisc*:Lites*:*:*) + GUESS=hppa1.1-hp-lites + ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + GUESS=c1-convex-bsd + ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + GUESS=c34-convex-bsd + ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + GUESS=c38-convex-bsd + ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + GUESS=c4-convex-bsd + ;; + CRAY*Y-MP:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; + CRAY*T3E:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; + CRAY*SV1:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; + *:UNICOS/mp:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; + sparc*:BSD/OS:*:*) + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; + *:BSD/OS:*:*) + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; + i*:CYGWIN*:*) + GUESS=$UNAME_MACHINE-pc-cygwin + ;; + *:MINGW64*:*) + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; + *:MINGW*:*) + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; + *:MSYS*:*) + GUESS=$UNAME_MACHINE-pc-msys + ;; + i*:PW*:*) + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; + *:Interix*:*) + case $UNAME_MACHINE in + x86) + GUESS=i586-pc-interix$UNAME_RELEASE + ;; + authenticamd | genuineintel | EM64T) + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; + IA64) + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; + esac ;; + i*:UWIN*:*) + GUESS=$UNAME_MACHINE-pc-uwin + ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + GUESS=x86_64-pc-cygwin + ;; + prep*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; + *:GNU:*:*) + # the GNU system + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-pc-managarm-mlibc" + ;; + *:[Mm]anagarm:*:*) + GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; + aarch64:Linux:*:*) + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __ARM_EABI__ + #ifdef __ARM_PCS_VFP + ABI=eabihf + #else + ABI=eabi + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; + esac + fi + GUESS=$CPU-unknown-linux-$LIBCABI + ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arm*:Linux:*:*) + set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi + else + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf + fi + fi + ;; + avr32*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + cris:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + crisv32:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + e2k:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + frv:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + hexagon:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + i*86:Linux:*:*) + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; + ia64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + k1om:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:cos:*:*) + GUESS=$UNAME_MACHINE-unknown-cos + ;; + kvx:mbr:*:*) + GUESS=$UNAME_MACHINE-unknown-mbr + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m32r*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m68*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + mips:Linux:*:* | mips64:Linux:*:*) + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + MIPS_ENDIAN=el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + MIPS_ENDIAN= + #else + MIPS_ENDIAN= + #endif + #endif +EOF + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + openrisc*:Linux:*:*) + GUESS=or1k-unknown-linux-$LIBC + ;; + or32:Linux:*:* | or1k*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + padre:Linux:*:*) + GUESS=sparc-unknown-linux-$LIBC + ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + GUESS=hppa64-unknown-linux-$LIBC + ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; + esac + ;; + ppc64:Linux:*:*) + GUESS=powerpc64-unknown-linux-$LIBC + ;; + ppc:Linux:*:*) + GUESS=powerpc-unknown-linux-$LIBC + ;; + ppc64le:Linux:*:*) + GUESS=powerpc64le-unknown-linux-$LIBC + ;; + ppcle:Linux:*:*) + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + s390:Linux:*:* | s390x:Linux:*:*) + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; + sh64*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sh*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + tile*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + vax:Linux:*:*) + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; + x86_64:Linux:*:*) + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __i386__ + ABI=x86 + #else + #ifdef __ILP32__ + ABI=x32 + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + x86) CPU=i686 ;; + x32) LIBCABI=${LIBC}x32 ;; + esac + fi + GUESS=$CPU-pc-linux-$LIBCABI + ;; + xtensa*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + GUESS=i386-sequent-sysv4 + ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; + i*86:OS/2:*:*) + # If we were able to find 'uname', then EMX Unix compatibility + # is probably installed. + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; + i*86:XTS-300:*:STOP) + GUESS=$UNAME_MACHINE-unknown-stop + ;; + i*86:atheos:*:*) + GUESS=$UNAME_MACHINE-unknown-atheos + ;; + i*86:syllable:*:*) + GUESS=$UNAME_MACHINE-pc-syllable + ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; + i*86:*DOS:*:*) + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL + fi + ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv32 + fi + ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + GUESS=i586-pc-msdosdjgpp + ;; + Intel:Mach:3*:*) + GUESS=i386-pc-mach3 + ;; + paragon:*:*:*) + GUESS=i860-intel-osf1 + ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 + fi + ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + GUESS=m68010-convergent-sysv + ;; + mc68k:UNIX:SYSTEM5:3.51m) + GUESS=m68k-convergent-sysv + ;; + M680?0:D-NIX:5.3:*) + GUESS=m68k-diab-dnix + ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; + mc68030:UNIX_System_V:4.*:*) + GUESS=m68k-atari-sysv4 + ;; + TSUNAMI:LynxOS:2.*:*) + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; + rs6000:LynxOS:2.*:*) + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; + SM[BE]S:UNIX_SV:*:*) + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; + RM*:ReliantUNIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + RM*:SINIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + GUESS=$UNAME_MACHINE-sni-sysv4 + else + GUESS=ns32k-sni-sysv + fi + ;; + PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort + # says + GUESS=i586-unisys-sysv4 + ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + GUESS=hppa1.1-stratus-sysv4 + ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + GUESS=i860-stratus-sysv4 + ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=$UNAME_MACHINE-stratus-vos + ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=hppa1.1-stratus-vos + ;; + mc68*:A/UX:*:*) + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; + news*:NEWS-OS:6*:*) + GUESS=mips-sony-newsos6 + ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE + else + GUESS=mips-unknown-sysv$UNAME_RELEASE + fi + ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + GUESS=powerpc-be-beos + ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + GUESS=powerpc-apple-beos + ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + GUESS=i586-pc-beos + ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + GUESS=i586-pc-haiku + ;; + ppc:Haiku:*:*) # Haiku running on Apple PowerPC + GUESS=powerpc-apple-haiku + ;; + *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) + GUESS=$UNAME_MACHINE-unknown-haiku + ;; + SX-4:SUPER-UX:*:*) + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; + SX-5:SUPER-UX:*:*) + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; + SX-6:SUPER-UX:*:*) + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; + SX-7:SUPER-UX:*:*) + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; + SX-8:SUPER-UX:*:*) + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; + SX-8R:SUPER-UX:*:*) + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; + SX-ACE:SUPER-UX:*:*) + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; + Power*:Rhapsody:*:*) + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; + *:Rhapsody:*:*) + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build + fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE + fi + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; + *:QNX:*:4*) + GUESS=i386-pc-qnx + ;; + NEO-*:NONSTOP_KERNEL:*:*) + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; + NSE-*:NONSTOP_KERNEL:*:*) + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; + NSR-*:NONSTOP_KERNEL:*:*) + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; + NSX-*:NONSTOP_KERNEL:*:*) + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; + *:NonStop-UX:*:*) + GUESS=mips-compaq-nonstopux + ;; + BS2000:POSIX*:*:*) + GUESS=bs2000-siemens-sysv + ;; + DS/*:UNIX_System_V:*:*) + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "${cputype-}" = 386; then + UNAME_MACHINE=i386 + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype + fi + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; + *:TOPS-10:*:*) + GUESS=pdp10-unknown-tops10 + ;; + *:TENEX:*:*) + GUESS=pdp10-unknown-tenex + ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + GUESS=pdp10-dec-tops20 + ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + GUESS=pdp10-xkl-tops20 + ;; + *:TOPS-20:*:*) + GUESS=pdp10-unknown-tops20 + ;; + *:ITS:*:*) + GUESS=pdp10-unknown-its + ;; + SEI:*:*:SEIUX) + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; + *:DragonFly:*:*) + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; + esac ;; + *:XENIX:*:SysV) + GUESS=i386-pc-xenix + ;; + i*86:skyos:*:*) + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; + i*86:rdos:*:*) + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; + x86_64:VMkernel:*:*) + GUESS=$UNAME_MACHINE-unknown-esx + ;; + amd64:Isilon\ OneFS:*:*) + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; + *:Ironclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +int +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF +fi + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/lib/monkey/mk_core/deps/libevent/build-aux/config.sub b/lib/monkey/mk_core/deps/libevent/build-aux/config.sub new file mode 100755 index 00000000000..743b8c28eef --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/build-aux/config.sub @@ -0,0 +1,2354 @@ +#!/usr/bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2024 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale + +timestamp='2024-05-27' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2024 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try '$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Split fields of configuration type +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 + ;; + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 + ;; + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + cloudabi*-eabi* \ + | kfreebsd*-gnu* \ + | knetbsd*-gnu* \ + | kopensolaris*-gnu* \ + | linux-* \ + | managarm-* \ + | netbsd*-eabi* \ + | netbsd*-gnu* \ + | nto-qnx* \ + | os2-emx* \ + | rtmk-nova* \ + | storm-chaos* \ + | uclinux-gnu* \ + | uclinux-uclibc* \ + | windows-* ) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac + ;; + *-*) + case $field1-$field2 in + # Shorthands that happen to contain a single dash + convex-c[12] | convex-c3[248]) + basic_machine=$field2-convex + basic_os= + ;; + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Do not treat sunos as a manufacturer + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + # Manufacturers + 3100* \ + | 32* \ + | 3300* \ + | 3600* \ + | 7300* \ + | acorn \ + | altos* \ + | apollo \ + | apple \ + | atari \ + | att* \ + | axis \ + | be \ + | bull \ + | cbm \ + | ccur \ + | cisco \ + | commodore \ + | convergent* \ + | convex* \ + | cray \ + | crds \ + | dec* \ + | delta* \ + | dg \ + | digital \ + | dolphin \ + | encore* \ + | gould \ + | harris \ + | highlevel \ + | hitachi* \ + | hp \ + | ibm* \ + | intergraph \ + | isi* \ + | knuth \ + | masscomp \ + | microblaze* \ + | mips* \ + | motorola* \ + | ncr* \ + | news \ + | next \ + | ns \ + | oki \ + | omron* \ + | pc533* \ + | rebel \ + | rom68k \ + | rombug \ + | semi \ + | sequent* \ + | siemens \ + | sgi* \ + | siemens \ + | sim \ + | sni \ + | sony* \ + | stratus \ + | sun \ + | sun[234]* \ + | tektronix \ + | tti* \ + | ultra \ + | unicom* \ + | wec \ + | winbond \ + | wrs) + basic_machine=$field1-$field2 + basic_os= + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac + ;; + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac + ;; +esac + +# Decode 1-component or ad-hoc basic machines +case $basic_machine in + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond + ;; + op50n) + cpu=hppa1.1 + vendor=oki + ;; + op60c) + cpu=hppa1.1 + vendor=oki + ;; + ibm*) + cpu=i370 + vendor=ibm + ;; + orion105) + cpu=clipper + vendor=highlevel + ;; + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple + ;; + pmac | pmac-mpw) + cpu=powerpc + vendor=apple + ;; + + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att + ;; + 3b*) + cpu=we32k + vendor=att + ;; + bluegene*) + cpu=powerpc + vendor=ibm + basic_os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + basic_os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + basic_os=tops20 + ;; + delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300) + cpu=m68k + vendor=motorola + ;; + # This used to be dpx2*, but that gets the RS6000-based + # DPX/20 and the x86-based DPX/2-100 wrong. See + # https://oldskool.silicium.org/stations/bull_dpx20.htm + # https://www.feb-patrimoine.com/english/bull_dpx2.htm + # https://www.feb-patrimoine.com/english/unix_and_bull.htm + dpx2 | dpx2[23]00 | dpx2[23]xx) + cpu=m68k + vendor=bull + ;; + dpx2100 | dpx21xx) + cpu=i386 + vendor=bull + ;; + dpx20) + cpu=rs6000 + vendor=bull + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 + ;; + i*86v4*) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 + ;; + i*86v) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv + ;; + i*86sol2) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $basic_os in + irix*) + ;; + *) + basic_os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + basic_os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf + ;; + none) + cpu=none + vendor=none + ;; + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine + ;; + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` + ;; + + *-*) + saved_IFS=$IFS + IFS="-" read cpu vendor <&2 + exit 1 + ;; + esac + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $vendor in + digital*) + vendor=dec + ;; + commodore*) + vendor=cbm + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if test x"$basic_os" != x +then + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +obj= +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + saved_IFS=$IFS + IFS="-" read kernel os <&2 + fi + ;; + *) + echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + exit 1 + ;; +esac + +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; + *) + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os-$obj in + linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ + | linux-mlibc*- | linux-musl*- | linux-newlib*- \ + | linux-relibc*- | linux-uclibc*- | linux-ohos*- ) + ;; + uclinux-uclibc*- | uclinux-gnu*- ) + ;; + managarm-mlibc*- | managarm-kernel*- ) + ;; + windows*-msvc*-) + ;; + -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ + | -uclibc*- ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 + exit 1 + ;; + -kernel*- ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 + exit 1 + ;; + *-kernel*- ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 + exit 1 + ;; + *-msvc*- ) + echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 + exit 1 + ;; + kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) + ;; + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) + ;; + nto-qnx*-) + ;; + os2-emx-) + ;; + rtmk-nova-) + ;; + *-eabi*- | *-gnueabi*-) + ;; + none--*) + # None (no kernel, i.e. freestanding / bare metal), + # can be paired with an machine code file format + ;; + -*-) + # Blank kernel with real OS is always fine. + ;; + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 + exit 1 + ;; +esac + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) + vendor=acorn + ;; + *-sunos* | *-solaris*) + vendor=sun + ;; + *-cnk* | *-aix*) + vendor=ibm + ;; + *-beos*) + vendor=be + ;; + *-hpux*) + vendor=hp + ;; + *-mpeix*) + vendor=hp + ;; + *-hiux*) + vendor=hitachi + ;; + *-unos*) + vendor=crds + ;; + *-dgux*) + vendor=dg + ;; + *-luna*) + vendor=omron + ;; + *-genix*) + vendor=ns + ;; + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) + vendor=ibm + ;; + s390-* | s390x-*) + vendor=ibm + ;; + *-ptx*) + vendor=sequent + ;; + *-tpf*) + vendor=ibm + ;; + *-vxsim* | *-vxworks* | *-windiss*) + vendor=wrs + ;; + *-aux*) + vendor=apple + ;; + *-hms*) + vendor=hitachi + ;; + *-mpw* | *-macos*) + vendor=apple + ;; + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) + vendor=atari + ;; + *-vos*) + vendor=stratus + ;; + esac + ;; +esac + +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/lib/monkey/mk_core/deps/libevent/build-aux/depcomp b/lib/monkey/mk_core/deps/libevent/build-aux/depcomp new file mode 100755 index 00000000000..9f6725b9e0f --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/build-aux/depcomp @@ -0,0 +1,792 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2025-06-18.21; # UTC + +# Copyright (C) 1999-2025 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +GNU Automake home page: . +General help using GNU software: . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp (GNU Automake) $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interference from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsolete pre-3.x GCC compilers. +## but also to in-use compilers like IBM xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp nil t) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%Y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/lib/monkey/mk_core/deps/libevent/build-aux/install-sh b/lib/monkey/mk_core/deps/libevent/build-aux/install-sh new file mode 100755 index 00000000000..1d8d9669646 --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/build-aux/install-sh @@ -0,0 +1,541 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2025-06-18.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. + -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Report bugs to . +GNU Automake home page: . +General help using GNU software: ." + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -p) cpprog="$cpprog -p";; + + -s) stripcmd=$stripprog;; + + -S) backupsuffix="$2" + shift;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 (GNU Automake) $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibility with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp nil t) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%Y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/lib/monkey/mk_core/deps/libevent/build-aux/ltmain.sh b/lib/monkey/mk_core/deps/libevent/build-aux/ltmain.sh new file mode 100644 index 00000000000..ff2d73a6588 --- /dev/null +++ b/lib/monkey/mk_core/deps/libevent/build-aux/ltmain.sh @@ -0,0 +1,11517 @@ +#! /usr/bin/env sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2019-02-19.15 + +# libtool (GNU libtool) 2.5.4 +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.5.4 +package_revision=2.5.4 + + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. + +# Please report bugs or propose patches to: +# + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac +fi + +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + fi" +done +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" + +# There are apparently some systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. + +: ${CP="cp -f"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} + + +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## + +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' + +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' + +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_double_quote_subst, that '$' was protected from +# expansion. Since each input '\' is now two '\'s, look for any number +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" + +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + + +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: + +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath=$0 + +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` + +# Make sure we have an absolute progpath for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` + progdir=`cd "$progdir" && pwd` + progpath=$progdir/$progname + ;; + *) + _G_IFS=$IFS + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS=$_G_IFS + test -x "$progdir/$progname" && break + done + IFS=$_G_IFS + test -n "$progdir" || progdir=`pwd` + progpath=$progdir/$progname + ;; +esac + + +## ----------------- ## +## Standard options. ## +## ----------------- ## + +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. + +opt_dry_run=false +opt_quiet=false +opt_verbose=false + +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= + +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue + +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } + + require_term_colors=: +} + + +## ----------------- ## +## Function library. ## +## ----------------- ## + +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. + + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # usable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd + + '"$_d"' +}' + + +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT +# -------------------------------------------------------- +# Perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value returned in "$func_basename_result" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $debug_cmd + + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= + + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then + + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$_G_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list in case some portion of path contains whitespace. + _G_dir_list=$_G_directory_path:$_G_dir_list + + # If the last portion added has no slash in it, the list is done + case $_G_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` + done + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` + + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_mkdir_p_IFS + # mkdir can fail with a 'File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$_G_dir" 2>/dev/null || : + done + IFS=$func_mkdir_p_IFS + + # Bail out if we (or some other process) failed to create a directory. + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" + fi +} + + +# func_mktempdir [BASENAME] +# ------------------------- +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, BASENAME is the basename for that directory. +func_mktempdir () +{ + $debug_cmd + + _G_template=${TMPDIR-/tmp}/${1-$progname} + + if test : = "$opt_dry_run"; then + # Return a directory name, but don't create it in dry-run mode + _G_tmpdir=$_G_template-$$ + else + + # If mktemp works, use that first and foremost + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` + + if test ! -d "$_G_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + _G_tmpdir=$_G_template-${RANDOM-0}$$ + + func_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} + + +# func_normal_abspath PATH +# ------------------------ +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + + +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + + +# func_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () +{ + $debug_cmd + + $require_check_ifs_backslash + + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break + fi + + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS + ;; + *) ;; + esac + break + done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac +} + + +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi + + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; + esac + + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result + ;; + esac +} + + +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done +} + + +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_tr_sh +# ---------- +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. + +# Please report bugs or propose patches to: +# + +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# Copyright'. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug in processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# in the main code. A hook is just a list of function names that can be +# run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It's assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook functions." ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi + done +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: +# args_changed=: +# ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# args_changed=: +# ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; +# esac +# done +# +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll also need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + _G_options_quoted=false + + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done + + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } +} + + +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. +func_hookable func_options_prep +func_options_prep () +{ + $debug_cmd + + # Option defaults: + opt_verbose=false + opt_warning_types= + + func_run_hooks func_options_prep ${1+"$@"} + func_propagate_result func_run_hooks func_options_prep +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + _G_parse_options_requote=false + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" >&2 + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) _G_parse_options_requote=: ; break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; + esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi + done + + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi +} + + +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () +{ + $debug_cmd + + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + + func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE +} + + + +## ----------------- ## +## Helper functions. ## +## ----------------- ## + +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + + +# func_help +# --------- +# Echo long help message to standard output and exit. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message" + exit 0 +} + + +# func_missing_arg ARGNAME +# ------------------------ +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $debug_cmd + + func_error "Missing argument for '$1'." + exit_cmd=exit +} + + +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs=" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () +{ + $debug_cmd + + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} + + +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} + + +# func_version +# ------------ +# Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. +func_version () +{ + $debug_cmd + + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk + } + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt + } + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" + + exit $? +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: + +# Set a version string. +scriptversion='(GNU libtool) 2.5.4' + +# func_version +# ------------ +# Echo version message to standard output and exit. +func_version () +{ + $debug_cmd + + year=`date +%Y` + + cat < +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +Originally written by Gordon Matzigkeit, 1996 +(See AUTHORS for complete contributor listing) +EOF + + exit $? +} + + +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} + + +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information + --finish use operation '--mode=finish' + --mode=MODE use operation mode MODE + --no-finish don't update shared library cache + --no-quiet, --no-silent print default informational messages + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --reorder-cache=DIRS reorder shared library cache for preferred DIRS + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" + +# Additional text appended to 'usage_message' in response to '--help'. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +Try '$progname --help --mode=MODE' for a more detailed description of MODE. + +When reporting a bug, please describe a test case to reproduce it and +include the following information: + + host-triplet: $host + shell: $SHELL + compiler: $LTCC + compiler flags: $LTCFLAGS + linker: $LD (gnu? $with_gnu_ld) + version: $progname $scriptversion + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to . +GNU libtool home page: . +General help using GNU software: ." + exit 0 +} + + +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi + + +# func_fatal_configuration ARG... +# ------------------------------- +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." +} + + +# func_config +# ----------- +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + + +# func_features +# ------------- +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test yes = "$build_libtool_libs"; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test yes = "$build_old_libs"; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + + +# func_enable_tag TAGNAME +# ----------------------- +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname=$1 + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=/$re_begincf/,/$re_endcf/p + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + + +# func_check_version_match +# ------------------------ +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_reorder_cache=false + opt_preserve_dup_deps=false + opt_quiet=false + opt_finishing=true + opt_warning= + + nonopt= + preserve_args= + + _G_rc_lt_options_prep=: + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + *) + _G_rc_lt_options_prep=false + ;; + esac + + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi +} +func_add_hook func_options_prep libtool_options_prep + + +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd + + _G_rc_lt_parse_options=false + + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_match_lt_parse_options=: + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument '$1' for $_G_opt" + exit_cmd=exit + ;; + esac + shift + ;; + + --no-finish) + opt_finishing=false + func_append preserve_args " $_G_opt" + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --reorder-cache) + opt_reorder_cache=true + shared_lib_dirs=$1 + if test -n "$shared_lib_dirs"; then + case $1 in + # Must begin with /: + /*) ;; + + # Catch anything else as an error (relative paths) + *) func_error "invalid argument '$1' for $_G_opt" + func_error "absolute paths are required for $_G_opt" + exit_cmd=exit + ;; + esac + fi + shift + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; + + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; + esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: + done + + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi +} +func_add_hook func_parse_options libtool_parse_options + + +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () +{ + if $opt_warning; then + $debug_cmd + $warning_func ${1+"$@"} + fi +} + + +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift + fi + + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + # Keeping compiler generated duplicates in $postdeps and $predeps is not + # harmful, and is necessary in a majority of systems that use it to satisfy + # symbol dependencies. + opt_duplicate_compiler_generated_deps=: + + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then + func_error "unrecognized option '-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help=$help + help="Try '$progname --help --mode=$opt_mode' for more information." + } + + # Pass back the unparsed argument list + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result +} +func_add_hook func_validate_options libtool_validate_options + + +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + + + +## ----------- ## +## Main. ## +## ----------- ## + +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if 'file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case $lalib_p_line in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test yes = "$lalib_p" +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $debug_cmd + + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# 'FILE.' does not work on cygwin managed mounts. +func_source () +{ + $debug_cmd + + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case $lt_sysroot:$1 in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result='='$func_stripname_result + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $debug_cmd + + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with '--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' + else + write_lobj=none + fi + + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, windows, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. Assumes ARG has no leading or trailing path separator +# characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $debug_cmd + + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result= + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $debug_cmd + + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $debug_cmd + + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $debug_cmd + + if test -z "$2" && test -n "$1"; then + func_error "Could not determine host file name corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result=$1 + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $debug_cmd + + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " '$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result=$3 + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $debug_cmd + + case $4 in + $1 ) func_to_host_path_result=$3$func_to_host_path_result + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +# func_convert_delimited_path PATH ORIG_DELIMITER NEW_DELIMITER +# Replaces a delimiter for a given path. +func_convert_delimited_path () +{ + converted_path=`$ECHO "$1" | $SED "s#$2#$3#g"` +} +# end func_convert_delimited_path + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via '$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $debug_cmd + + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $debug_cmd + + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result=$1 +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result=$func_convert_core_msys_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via '$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $debug_cmd + + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd=func_convert_path_$func_stripname_result + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $debug_cmd + + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result=$1 +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + +# func_reorder_shared_lib_cache DIRS +# Reorder the shared library cache by unconfiguring previous shared library cache +# and configuring preferred search directories before previous search directories. +# Previous shared library cache: /usr/lib /usr/local/lib +# Preferred search directories: /tmp/testing +# Reordered shared library cache: /tmp/testing /usr/lib /usr/local/lib +func_reorder_shared_lib_cache () +{ + $debug_cmd + + case $host_os in + openbsd*) + get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` + func_convert_delimited_path "$get_search_directories" ':' '\ ' + save_search_directories=$converted_path + func_convert_delimited_path "$1" ':' '\ ' + + # Ensure directories exist + for dir in $converted_path; do + # Ensure each directory is an absolute path + case $dir in + /*) ;; + *) func_error "Directory '$dir' is not an absolute path" + exit $EXIT_FAILURE ;; + esac + # Ensure no trailing slashes + func_stripname '' '/' "$dir" + dir=$func_stripname_result + if test -d "$dir"; then + if test -n "$preferred_search_directories"; then + preferred_search_directories="$preferred_search_directories $dir" + else + preferred_search_directories=$dir + fi + else + func_error "Directory '$dir' does not exist" + exit $EXIT_FAILURE + fi + done + + PATH="$PATH:/sbin" ldconfig -U $save_search_directories + PATH="$PATH:/sbin" ldconfig -m $preferred_search_directories $save_search_directories + get_search_directories=`PATH="$PATH:/sbin" ldconfig -r | $GREP "search directories" | $SED "s#.*search directories:\ ##g"` + func_convert_delimited_path "$get_search_directories" ':' '\ ' + reordered_search_directories=$converted_path + + $ECHO "Original: $save_search_directories" + $ECHO "Reordered: $reordered_search_directories" + exit $EXIT_SUCCESS + ;; + *) + func_error "--reorder-cache is not supported for host_os=$host_os." + exit $EXIT_FAILURE + ;; + esac +} +# end func_reorder_shared_lib_cache + + +# func_mode_compile arg... +func_mode_compile () +{ + $debug_cmd + + # Get the compilation command and the source file. + base_compile= + srcfile=$nonopt # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg=$arg + arg_mode=normal + ;; + + target ) + libobj=$arg + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify '-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs=$IFS; IFS=, + for arg in $args; do + IFS=$save_ifs + func_append_quoted lastarg "$arg" + done + IFS=$save_ifs + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg=$srcfile + srcfile=$arg + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with '-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj=$func_basename_result + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from '$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name '$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname=$func_basename_result + xdir=$func_dirname_result + lobj=$xdir$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test yes = "$build_old_libs"; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | windows* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test yes = "$need_locks"; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test warn = "$need_locks"; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result + + # Only build a PIC object if we are building libtool libraries. + if test yes = "$build_libtool_libs"; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test no != "$pic_mode"; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test yes = "$suppress_opt"; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test yes = "$compiler_c_o"; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test no != "$need_locks"; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a '.o' file suitable for static linking + -static only build a '.o' file suitable for static linking + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a 'standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to '-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the '--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the 'install' or 'cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with '-') are ignored. + +Every other argument is treated as a filename. Files ending in '.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in '.la', then a libtool library is created, +only library objects ('.lo' files) may be specified, and '-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created +using 'ar' and 'ranlib', or on Windows using 'lib'. + +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode '$opt_mode'" + ;; + esac + + echo + $ECHO "Try '$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test : = "$opt_help"; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + $SED '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# If option '--reorder-cache', reorder the shared library cache and exit. +if $opt_reorder_cache; then + func_reorder_shared_lib_cache $shared_lib_dirs +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $debug_cmd + + # The first argument is the command name. + cmd=$nonopt + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "'$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "'$file' was not linked with '-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir=$func_dirname_result + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir=$func_dirname_result + ;; + + *) + func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir=$absdir + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic=$magic + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file=$progdir/$program + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file=$progdir/$program + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if $opt_dry_run; then + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + else + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd=\$cmd$args + fi +} + +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $debug_cmd + + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "'$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument '$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and '=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs" && $opt_finishing; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_quiet && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + if test "false" = "$opt_finishing"; then + echo + echo "NOTE: finish_cmds were not executed during testing, so you must" + echo "manually run ldconfig to add a given test directory, LIBDIR, to" + echo "the search path for generated executables." + fi + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the '-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the '$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the '$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the '$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $debug_cmd + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac + then + # Aesthetically quote it. + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=false + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=: ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" + if test -n "$arg2"; then + func_quote_arg pretty "$arg2" + fi + func_append install_shared_prog " $func_quote_arg_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the '$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir=$func_dirname_result + destname=$func_basename_result + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "'$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "'$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir=$func_dirname_result + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Strip any trailing slash from the destination. + func_stripname '' '/' "$libdir" + destlibdir=$func_stripname_result + + func_stripname '' '/' "$destdir" + s_destdir=$func_stripname_result + + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking '$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname=$1 + shift + + srcname=$realname + test -n "$relink_command" && srcname=${realname}T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme=$stripme + case $host_os in + cygwin* | mingw* | windows* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try 'ln -sf' first, because the 'ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib=$destdir/$realname + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name=$func_basename_result + instname=$dir/${name}i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest=$destfile + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to '$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test yes = "$build_old_libs"; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext= + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=.exe + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw* | *windows*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script '$wrapper'" + + finalize=: + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test no = "$fast_install" && test -n "$relink_command"; then + $opt_dry_run || { + if $finalize; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file=$func_basename_result + outputname=$tmpdir/$file + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_quiet || { + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink '$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file=$outputname + else + func_warning "cannot relink '$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name=$func_basename_result + + # Set up the ranlib parameters. + oldlib=$destdir/$name + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run '$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test install = "$opt_mode" && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms=${my_outputname}S.c + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist=$output_objdir/$my_outputname.nm + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* External symbol declarations for the compiler. */\ +" + + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols=$output_objdir/$outputname.exp + $opt_dry_run || { + $RM $export_symbols + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *windows* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *windows* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from '$dlprefile'" + func_basename "$dlprefile" + name=$func_basename_result + case $host in + *cygwin* | *mingw* | *windows* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename= + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname"; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename=$func_basename_result + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename"; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + case $host in + i[3456]86-*-mingw32*) + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + ;; + *) + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/__nm_//' >> '$nlist'" + ;; + esac + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + $my_pic_p && pic_flag_for_symtable=" $pic_flag" + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + + # Transform the symbol file into the correct name. + symfileobj=$output_objdir/${my_outputname}S.$objext + case $host in + *cygwin* | *mingw* | *windows* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for '$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $debug_cmd + + win32_libid_type=unknown + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s|.*|import| + p + q + } + }'` + ;; + esac + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $debug_cmd + + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $debug_cmd + + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1"; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result= + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test yes = "$lock_old_archive_extraction"; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $debug_cmd + + my_gentop=$1; shift + my_oldlibs=${1+"$@"} + my_oldobjs= + my_xlib= + my_xabs= + my_xdir= + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib=$func_basename_result + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches; do + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" + cd "unfat-$$/$darwin_base_archive-$darwin_arch" + func_extract_an_archive "`pwd`" "$darwin_base_archive" + cd "$darwin_curdir" + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result=$my_oldobjs +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw/windows +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory where it is stored is +# the $objdir directory. This is a cygwin/mingw/windows-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=$qECHO + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ that is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options that match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw* | *-*-windows* | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw/windows when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test yes = "$fast_install"; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + \$ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#if defined _WIN32 && !defined __GNUC__ +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* declarations of non-ANSI functions */ +#if defined __MINGW32__ +# ifdef __STRICT_ANSI__ +_CRTIMP int __cdecl _putenv (const char *); +# endif +#elif defined __CYGWIN__ +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined other_platform || defined ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined _MSC_VER +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +#elif defined __MINGW32__ +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined __CYGWIN__ +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined other platforms ... */ +#endif + +#if defined PATH_MAX +# define LT_PATHMAX PATH_MAX +#elif defined MAXPATHLEN +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free (stale); stale = 0; } \ +} while (0) + +#if defined LT_DEBUGWRAPPER +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + size_t tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined HAVE_DOS_BASED_FILE_SYSTEM + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined HAVE_DOS_BASED_FILE_SYSTEM + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = (size_t) (q - p); + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (STREQ (str, pat)) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + size_t len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + size_t orig_value_len = strlen (orig_value); + size_t add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[--len] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw* | windows*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $debug_cmd + + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $debug_cmd + + case $host in + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # what system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll that has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + compile_rpath_tail= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + os2dllname= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=false + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + temp_rpath_tail= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + rpath_arg= + single_module=$wl-single_module + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg=$1 + shift + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir=$arg + prev= + continue + ;; + dlfiles|dlprefiles) + $preload || { + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=: + } + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test no = "$dlself"; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test dlprefiles = "$prev"; then + dlself=yes + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test dlfiles = "$prev"; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols=$arg + test -f "$arg" \ + || func_fatal_error "symbol file '$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex=$arg + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + if test none != "$pic_object"; then + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + fi + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file '$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; + precious_regex) + precious_files_regex=$arg + prev= + continue + ;; + release) + release=-$arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "argument to -rpath is not absolute: $arg" + ;; + esac + if test rpath = "$prev"; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds=$arg + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg=$arg + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "'-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test X-export-symbols = "X$arg"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between '-L' and '$1'" + else + func_fatal_error "need path for '-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test X-lc = "X$arg" || test X-lm = "X$arg"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test X-lc = "X$arg" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) + # Do not include libc due to us having libc/libc_r. + test X-lc = "X$arg" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test X-lc = "X$arg" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test X-lc = "X$arg" && continue + ;; + esac + elif test X-lc_r = "X$arg"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -mllvm) + prev=mllvm + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + # -q