mirror of
				https://github.com/samba-team/samba.git
				synced 2025-10-31 12:23:52 +03:00 
			
		
		
		
	build: Detect libevent
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
		
				
					committed by
					
						 Günther Deschner
						Günther Deschner
					
				
			
			
				
	
			
			
			
						parent
						
							6d6531d0e2
						
					
				
				
					commit
					fe3bde8f62
				
			| @@ -47,7 +47,7 @@ variables: | ||||
|   # Set this to the contents of bootstrap/sha1sum.txt | ||||
|   # which is generated by bootstrap/template.py --render | ||||
|   # | ||||
|   SAMBA_CI_CONTAINER_TAG: d20548dec714e202867b593f5e19f3004f7a2457 | ||||
|   SAMBA_CI_CONTAINER_TAG: 26a734ea226b4fd32141ae950af16f75f290645f | ||||
|   # | ||||
|   # We use the ubuntu2204 image as default as | ||||
|   # it matches what we have on atb-devel-224 | ||||
|   | ||||
| @@ -116,6 +116,7 @@ PKGS = [ | ||||
|     ('libglib2.0-dev', 'glib2-devel'), | ||||
|     ('libicu-dev', 'libicu-devel'), | ||||
|     ('heimdal-multidev', ''), | ||||
|     ('libevent-dev', 'libevent-devel'), | ||||
|  | ||||
|     # NAME1, NAME2 | ||||
|     # for debian, locales provide locale support with language packs | ||||
|   | ||||
| @@ -64,6 +64,7 @@ dnf install -y \ | ||||
|     libblkid-devel \ | ||||
|     libbsd-devel \ | ||||
|     libcap-devel \ | ||||
|     libevent-devel \ | ||||
|     libicu-devel \ | ||||
|     libpcap-devel \ | ||||
|     libtasn1-devel \ | ||||
|   | ||||
| @@ -45,6 +45,7 @@ packages: | ||||
|   - libblkid-devel | ||||
|   - libbsd-devel | ||||
|   - libcap-devel | ||||
|   - libevent-devel | ||||
|   - libicu-devel | ||||
|   - libpcap-devel | ||||
|   - libtasn1-devel | ||||
|   | ||||
| @@ -53,6 +53,7 @@ apt-get -y install \ | ||||
|     libclang-dev \ | ||||
|     libcups2-dev \ | ||||
|     libdbus-1-dev \ | ||||
|     libevent-dev \ | ||||
|     libglib2.0-dev \ | ||||
|     libgnutls28-dev \ | ||||
|     libgpgme11-dev \ | ||||
|   | ||||
| @@ -42,6 +42,7 @@ packages: | ||||
|   - libclang-dev | ||||
|   - libcups2-dev | ||||
|   - libdbus-1-dev | ||||
|   - libevent-dev | ||||
|   - libglib2.0-dev | ||||
|   - libgnutls28-dev | ||||
|   - libgpgme11-dev | ||||
|   | ||||
| @@ -53,6 +53,7 @@ apt-get -y install \ | ||||
|     libclang-dev \ | ||||
|     libcups2-dev \ | ||||
|     libdbus-1-dev \ | ||||
|     libevent-dev \ | ||||
|     libglib2.0-dev \ | ||||
|     libgnutls28-dev \ | ||||
|     libgpgme11-dev \ | ||||
|   | ||||
| @@ -42,6 +42,7 @@ packages: | ||||
|   - libclang-dev | ||||
|   - libcups2-dev | ||||
|   - libdbus-1-dev | ||||
|   - libevent-dev | ||||
|   - libglib2.0-dev | ||||
|   - libgnutls28-dev | ||||
|   - libgpgme11-dev | ||||
|   | ||||
| @@ -53,6 +53,7 @@ apt-get -y install \ | ||||
|     libclang-dev \ | ||||
|     libcups2-dev \ | ||||
|     libdbus-1-dev \ | ||||
|     libevent-dev \ | ||||
|     libglib2.0-dev \ | ||||
|     libgnutls28-dev \ | ||||
|     libgpgme11-dev \ | ||||
|   | ||||
| @@ -42,6 +42,7 @@ packages: | ||||
|   - libclang-dev | ||||
|   - libcups2-dev | ||||
|   - libdbus-1-dev | ||||
|   - libevent-dev | ||||
|   - libglib2.0-dev | ||||
|   - libgnutls28-dev | ||||
|   - libgpgme11-dev | ||||
|   | ||||
| @@ -53,6 +53,7 @@ apt-get -y install \ | ||||
|     libclang-dev \ | ||||
|     libcups2-dev \ | ||||
|     libdbus-1-dev \ | ||||
|     libevent-dev \ | ||||
|     libglib2.0-dev \ | ||||
|     libgnutls28-dev \ | ||||
|     libgpgme11-dev \ | ||||
|   | ||||
| @@ -42,6 +42,7 @@ packages: | ||||
|   - libclang-dev | ||||
|   - libcups2-dev | ||||
|   - libdbus-1-dev | ||||
|   - libevent-dev | ||||
|   - libglib2.0-dev | ||||
|   - libgnutls28-dev | ||||
|   - libgpgme11-dev | ||||
|   | ||||
| @@ -61,6 +61,7 @@ dnf install -y \ | ||||
|     libbsd-devel \ | ||||
|     libcap-devel \ | ||||
|     libcephfs-devel \ | ||||
|     libevent-devel \ | ||||
|     libicu-devel \ | ||||
|     libpcap-devel \ | ||||
|     libtasn1-devel \ | ||||
|   | ||||
| @@ -50,6 +50,7 @@ packages: | ||||
|   - libbsd-devel | ||||
|   - libcap-devel | ||||
|   - libcephfs-devel | ||||
|   - libevent-devel | ||||
|   - libicu-devel | ||||
|   - libpcap-devel | ||||
|   - libtasn1-devel | ||||
|   | ||||
| @@ -58,6 +58,7 @@ zypper --non-interactive install \ | ||||
|     libbsd-devel \ | ||||
|     libcap-devel \ | ||||
|     libcephfs-devel \ | ||||
|     libevent-devel \ | ||||
|     libicu-devel \ | ||||
|     libjansson-devel \ | ||||
|     libpcap-devel \ | ||||
|   | ||||
| @@ -46,6 +46,7 @@ packages: | ||||
|   - libbsd-devel | ||||
|   - libcap-devel | ||||
|   - libcephfs-devel | ||||
|   - libevent-devel | ||||
|   - libicu-devel | ||||
|   - libjansson-devel | ||||
|   - libpcap-devel | ||||
|   | ||||
| @@ -71,6 +71,7 @@ yum install -y \ | ||||
|     libbsd-devel \ | ||||
|     libcap-devel \ | ||||
|     libcephfs-devel \ | ||||
|     libevent-devel \ | ||||
|     libicu-devel \ | ||||
|     libpcap-devel \ | ||||
|     libtasn1-devel \ | ||||
|   | ||||
| @@ -47,6 +47,7 @@ packages: | ||||
|   - libbsd-devel | ||||
|   - libcap-devel | ||||
|   - libcephfs-devel | ||||
|   - libevent-devel | ||||
|   - libicu-devel | ||||
|   - libpcap-devel | ||||
|   - libtasn1-devel | ||||
|   | ||||
| @@ -55,6 +55,7 @@ apt-get -y install \ | ||||
|     libclang-dev \ | ||||
|     libcups2-dev \ | ||||
|     libdbus-1-dev \ | ||||
|     libevent-dev \ | ||||
|     libglib2.0-dev \ | ||||
|     libgnutls28-dev \ | ||||
|     libgpgme11-dev \ | ||||
|   | ||||
| @@ -44,6 +44,7 @@ packages: | ||||
|   - libclang-dev | ||||
|   - libcups2-dev | ||||
|   - libdbus-1-dev | ||||
|   - libevent-dev | ||||
|   - libglib2.0-dev | ||||
|   - libgnutls28-dev | ||||
|   - libgpgme11-dev | ||||
|   | ||||
| @@ -55,6 +55,7 @@ apt-get -y install \ | ||||
|     libclang-dev \ | ||||
|     libcups2-dev \ | ||||
|     libdbus-1-dev \ | ||||
|     libevent-dev \ | ||||
|     libglib2.0-dev \ | ||||
|     libgnutls28-dev \ | ||||
|     libgpgme11-dev \ | ||||
|   | ||||
| @@ -44,6 +44,7 @@ packages: | ||||
|   - libclang-dev | ||||
|   - libcups2-dev | ||||
|   - libdbus-1-dev | ||||
|   - libevent-dev | ||||
|   - libglib2.0-dev | ||||
|   - libgnutls28-dev | ||||
|   - libgpgme11-dev | ||||
|   | ||||
| @@ -55,6 +55,7 @@ apt-get -y install \ | ||||
|     libclang-dev \ | ||||
|     libcups2-dev \ | ||||
|     libdbus-1-dev \ | ||||
|     libevent-dev \ | ||||
|     libglib2.0-dev \ | ||||
|     libgnutls28-dev \ | ||||
|     libgpgme11-dev \ | ||||
|   | ||||
| @@ -44,6 +44,7 @@ packages: | ||||
|   - libclang-dev | ||||
|   - libcups2-dev | ||||
|   - libdbus-1-dev | ||||
|   - libevent-dev | ||||
|   - libglib2.0-dev | ||||
|   - libgnutls28-dev | ||||
|   - libgpgme11-dev | ||||
|   | ||||
| @@ -55,6 +55,7 @@ apt-get -y install \ | ||||
|     libclang-dev \ | ||||
|     libcups2-dev \ | ||||
|     libdbus-1-dev \ | ||||
|     libevent-dev \ | ||||
|     libglib2.0-dev \ | ||||
|     libgnutls28-dev \ | ||||
|     libgpgme11-dev \ | ||||
|   | ||||
| @@ -44,6 +44,7 @@ packages: | ||||
|   - libclang-dev | ||||
|   - libcups2-dev | ||||
|   - libdbus-1-dev | ||||
|   - libevent-dev | ||||
|   - libglib2.0-dev | ||||
|   - libgnutls28-dev | ||||
|   - libgpgme11-dev | ||||
|   | ||||
| @@ -1 +1 @@ | ||||
| d20548dec714e202867b593f5e19f3004f7a2457 | ||||
| 26a734ea226b4fd32141ae950af16f75f290645f | ||||
|   | ||||
| @@ -176,7 +176,7 @@ builddirs = { | ||||
| } | ||||
|  | ||||
| ctdb_configure_params = " --enable-developer ${PREFIX}" | ||||
| samba_configure_params = " ${ENABLE_COVERAGE} ${PREFIX} --with-profiling-data" | ||||
| samba_configure_params = " ${ENABLE_COVERAGE} ${PREFIX} --with-profiling-data --with-libevent" | ||||
|  | ||||
| # We cannot configure himmelblau on old systems missing openssl 3, with glibc | ||||
| # older than version 2.32, or when cargo isn't available. | ||||
| @@ -879,6 +879,7 @@ tasks = { | ||||
|          "./configure.developer ${PREFIX} " | ||||
|          "--with-selftest-prefix=./bin/ab " | ||||
|          "--with-cluster-support " | ||||
|          "--with-libevent " | ||||
|          "--bundled-libraries=!tdb"), | ||||
|             ("samba-make", "make"), | ||||
|             ("samba-check", "./bin/smbd --configfile=/dev/null -b | grep CLUSTER_SUPPORT"), | ||||
| @@ -1039,7 +1040,7 @@ tasks = { | ||||
|         "sequence": [ | ||||
|         # build the fuzzers (static) via the oss-fuzz script | ||||
|             ("fuzzers-mkdir-prefix", "mkdir -p ${PREFIX_DIR}"), | ||||
|             ("fuzzers-build", "OUT=${PREFIX_DIR} LIB_FUZZING_ENGINE= SANITIZER=address CXX= CFLAGS= ADDITIONAL_LDFLAGS='-fuse-ld=bfd' ./lib/fuzzing/oss-fuzz/build_samba.sh --enable-afl-fuzzer"), | ||||
|             ("fuzzers-build", "OUT=${PREFIX_DIR} LIB_FUZZING_ENGINE= SANITIZER=address CXX= CFLAGS= ADDITIONAL_LDFLAGS='-fuse-ld=bfd' ./lib/fuzzing/oss-fuzz/build_samba.sh --enable-afl-fuzzer  --with-libevent"), | ||||
|         ], | ||||
|     }, | ||||
|  | ||||
| @@ -1118,7 +1119,7 @@ tasks = { | ||||
|         "sequence": [ | ||||
|             ("random-sleep", random_sleep(300, 900)), | ||||
|  | ||||
|             ("configure", "./configure.developer ${ENABLE_COVERAGE} ${PREFIX} --with-profiling-data --disable-python --without-ad-dc"), | ||||
|             ("configure", "./configure.developer ${ENABLE_COVERAGE} ${PREFIX} --with-profiling-data --disable-python --without-ad-dc  --with-libevent"), | ||||
|             ("make", "make -j"), | ||||
|             ("find-python", "script/find_python.sh ${PREFIX}"), | ||||
|             ("test", "make test-nopython"), | ||||
|   | ||||
| @@ -77,6 +77,7 @@ def options(opt): | ||||
|     opt.samba_add_onoff_option('fam', default=None) # None means autodetection | ||||
|     opt.samba_add_onoff_option('profiling-data', default=False) | ||||
|     opt.samba_add_onoff_option('libarchive', default=True) | ||||
|     opt.samba_add_onoff_option('libevent', default=False) | ||||
|  | ||||
|     opt.samba_add_onoff_option('cluster-support', default=False) | ||||
|  | ||||
| @@ -204,6 +205,20 @@ long ret = splice(0,0,1,0,400,SPLICE_F_MOVE); | ||||
|         raise Errors.WafError('libarchive library required for ' | ||||
|                              '--enable-selftest') | ||||
|  | ||||
|     # check for libevent, needed for prometheus http endpoint | ||||
|     conf.SET_TARGET_TYPE('event', 'EMPTY') | ||||
|     if Options.options.with_libevent is True: | ||||
|         Logs.info("Checking for libevent existence") | ||||
|         if conf.CHECK_HEADERS('event2/http.h') and conf.CHECK_LIB('event', shlib=True): | ||||
|             conf.CHECK_FUNCS_IN('evhttp_new', 'event') | ||||
|         if not conf.CONFIG_SET('HAVE_EVHTTP_NEW'): | ||||
|             conf.fatal("libevent support not found. " | ||||
|                        "Try installing libevent-dev or libevent-devel. " | ||||
|                        "libevent support is required for the prometheus " | ||||
|                        "endpoint") | ||||
|     elif conf.CONFIG_GET('ENABLE_SELFTEST'): | ||||
|         raise Errors.WafError('libevent library required for ' | ||||
|                              '--enable-selftest') | ||||
|  | ||||
|     # check for DMAPI libs | ||||
|     if Options.options.with_dmapi == False: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user