configure: fix libevent version check
authorMichael Wallner <mike@php.net>
Tue, 27 Feb 2018 10:04:19 +0000 (11:04 +0100)
committerMichael Wallner <mike@php.net>
Tue, 27 Feb 2018 10:04:19 +0000 (11:04 +0100)
autoconf/pecl/libevent.m4

index bd04296..e6f60e7 100644 (file)
@@ -1,17 +1,19 @@
 
 AC_DEFUN([PECL_CHECK_LIBEVENT], [
        PECL_CHECK_PKGCONFIG(libevent, [$1])
-       PECL_HAVE_VERSION(libevent, 2.0, [
-               PECL_DEFINE([HAVE_LIBEVENT2])
-       ])
-       ifelse([$2],,,[PECL_HAVE_VERSION(libevent, [$2])])
-       AC_CHECK_FUNC(event_base_new,,[
-               AC_DEFINE([event_base_new], [event_init], [missing event_base_new() in libevent1])
-       ])
-       AC_CHECK_FUNC(event_assign,,[
-               AC_DEFINE([event_assign(e, b, s, a, cb, d)], [do {\
-                       event_set(e, s, a, cb, d); \
-                       event_base_set(b, e);\
-               } while(0)], [missing event_assign() in libevent1])
-       ])
+       if test -n "$PECL_CHECKED_VERSION(libevent)"; then
+               PECL_HAVE_VERSION(libevent, 2.0, [
+                       PECL_DEFINE([HAVE_LIBEVENT2])
+               ]., [ ])
+               ifelse([$2],,,[PECL_HAVE_VERSION(libevent, [$2])])
+               AC_CHECK_FUNC(event_base_new,,[
+                       AC_DEFINE([event_base_new], [event_init], [missing event_base_new() in libevent1])
+               ])
+               AC_CHECK_FUNC(event_assign,,[
+                       AC_DEFINE([event_assign(e, b, s, a, cb, d)], [do {\
+                               event_set(e, s, a, cb, d); \
+                               event_base_set(b, e);\
+                       } while(0)], [missing event_assign() in libevent1])
+               ])
+       fi
 ])
\ No newline at end of file