Config.w32 chack for both instances of event.h
authorJan Ehrhardt <github@ehrhardt.nl>
Thu, 31 Oct 2019 11:47:31 +0000 (12:47 +0100)
committerGitHub <noreply@github.com>
Thu, 31 Oct 2019 11:47:31 +0000 (12:47 +0100)
Fixes https://github.com/m6w6/ext-http/issues/97 when the libevent2 headers are not installed in the main include dir, for instance in c:/php-snap-build/dep-aux/vc15/x64/libevent/include

config.w32

index e7f265d..c37c61b 100644 (file)
@@ -144,7 +144,8 @@ if (PHP_HTTP != "no") {
                AC_DEFINE("PHP_HAVE_CURL_MULTI_TIMEOUT", 1, "");
                ADD_FLAG("CFLAGS_HTTP", "/I" + configure_module_dirname + " ");
 
-               if (CHECK_HEADER_ADD_INCLUDE("event2/event.h", "CFLAGS_HTTP") &&
+               if (CHECK_HEADER_ADD_INCLUDE("event.h", "CFLAGS_HTTP") &&
+                       CHECK_HEADER_ADD_INCLUDE("event2/event.h", "CFLAGS_HTTP") &&
                        CHECK_LIB("libevent.lib", "http", PHP_HTTP) &&
                        CHECK_LIB("libevent_core.lib", "http", PHP_HTTP) &&
                        CHECK_LIB("libevent_extras.lib", "http", PHP_HTTP)) {
@@ -152,6 +153,8 @@ if (PHP_HTTP != "no") {
                        AC_DEFINE("PHP_HTTP_HAVE_LIBEVENT", 1);
                        AC_DEFINE("PHP_HTTP_HAVE_LIBEVENT2", 1);
                        AC_DEFINE("PHP_HTTP_LIBEVENT_VERSION", "2.0.21 or greater");
+               } else {
+                       WARNING("http module: libevent not enabled; libraries or headers not found");
                }
        } else {
                WARNING("curl convenience functions not enabled; libraries and headers not found");