getdns: add optional support for libevent2
authorRui Salvaterra <rsalvaterra@gmail.com>
Mon, 9 Nov 2020 21:32:50 +0000 (21:32 +0000)
committerRosen Penev <rosenp@gmail.com>
Mon, 3 Jan 2022 10:18:57 +0000 (02:18 -0800)
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
libs/getdns/Config.in
libs/getdns/Makefile

index c09d232f45e1203201d864e2b056004d182eb1d7..10ee822e53445cee7dd06613413dfbb9e4d9d707 100644 (file)
@@ -1,6 +1,12 @@
 menu "Configuration"
        depends on PACKAGE_getdns
 
+config GETDNS_BUILD_LIBEVENT2
+       bool "Use libevent2-based event loop"
+       default n
+       help
+               "Use libevent2 for the event loop (requires libevent2 dependency)."
+
 config GETDNS_ENABLE_STUB_ONLY
        bool "Stub resolution mode only"
        default y
index 096841146c61ae663d3729e7073daafb8fbf3a38..d89b996f9faf6d5fb487ff6e7f75540ce7cca16c 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=getdns
 PKG_VERSION:=1.7.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
@@ -19,6 +19,7 @@ PKG_HASH:=ea8713ce5e077ac76b1418ceb6afd25e6d4e39e9600f6f5e81d3a3a13a60f652
 CMAKE_INSTALL:=1
 
 PKG_CONFIG_DEPENDS:= \
+       CONFIG_GETDNS_BUILD_LIBEVENT2 \
        CONFIG_GETDNS_ENABLE_STUB_ONLY \
        CONFIG_GETDNS_ENABLE_IDN_LIBIDN2
 
@@ -35,7 +36,7 @@ define Package/getdns
        SECTION:=libs
        CATEGORY:=Libraries
        TITLE+= (library)
-       DEPENDS+= +libopenssl +!GETDNS_ENABLE_STUB_ONLY:libunbound +GETDNS_ENABLE_IDN_LIBIDN2:libidn2
+       DEPENDS+= +libopenssl +GETDNS_BUILD_LIBEVENT2:libevent2 +!GETDNS_ENABLE_STUB_ONLY:libunbound +GETDNS_ENABLE_IDN_LIBIDN2:libidn2
        MENU:=1
 endef
 
@@ -51,9 +52,9 @@ endef
 # CMAKE options for GetDNS are described in this document:
 # https://getdnsapi.net/quick-start/cmake-quick-start/
 CMAKE_OPTIONS += -DBUILD_LIBEV=OFF
-CMAKE_OPTIONS += -DBUILD_LIBEVENT2=OFF
 CMAKE_OPTIONS += -DBUILD_LIBUV=OFF
 
+CMAKE_OPTIONS += -DBUILD_LIBEVENT2=$(if $(CONFIG_GETDNS_BUILD_LIBEVENT2),ON,OFF)
 CMAKE_OPTIONS += -DENABLE_STUB_ONLY=$(if $(CONFIG_GETDNS_ENABLE_STUB_ONLY),ON,OFF)
 CMAKE_OPTIONS += -DUSE_LIBIDN2=$(if $(CONFIG_GETDNS_ENABLE_IDN_LIBIDN2),ON,OFF)