From cd738d4daa0f36f37d1f73c84991c0ccf4433394 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Fri, 27 Aug 2021 01:15:59 -0400 Subject: [PATCH] [build] propagate HAVE_DLFCN_H in builds --- SConstruct | 1 + src/config.h.cmake | 1 + src/meson.build | 1 + src/plugin.c | 6 ++++-- src/stat_cache.c | 2 ++ 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 0b0e64ef..379c94fb 100644 --- a/SConstruct +++ b/SConstruct @@ -367,6 +367,7 @@ if 1: autoconf.haveCHeaders([ 'arpa/inet.h', 'crypt.h', + 'dlfcn.h', 'fcntl.h', 'getopt.h', 'inttypes.h', diff --git a/src/config.h.cmake b/src/config.h.cmake index c59192f3..cb1773c9 100644 --- a/src/config.h.cmake +++ b/src/config.h.cmake @@ -13,6 +13,7 @@ #endif /* System */ +#cmakedefine HAVE_DLFCN_H #cmakedefine HAVE_PORT_H #cmakedefine HAVE_SYS_DEVPOLL_H #cmakedefine HAVE_SYS_EPOLL_H diff --git a/src/meson.build b/src/meson.build index 3afc949d..73f3f81d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -46,6 +46,7 @@ conf_data.set('HAVE_SYS_WAIT_H', compiler.has_header('sys/wait.h')) conf_data.set('HAVE_SYS_TIME_H', compiler.has_header('sys/time.h')) conf_data.set('HAVE_UNISTD_H', compiler.has_header('unistd.h')) conf_data.set('HAVE_PTHREAD_H', compiler.has_header('pthread.h')) +conf_data.set('HAVE_DLFCN_H', compiler.has_header('dlfcn.h')) conf_data.set('HAVE_GETOPT_H', compiler.has_header('getopt.h')) conf_data.set('HAVE_INTTYPES_H', compiler.has_header('inttypes.h')) conf_data.set('HAVE_MALLOC_H', compiler.has_header('malloc.h')) diff --git a/src/plugin.c b/src/plugin.c index 2f348efe..5ef95b1d 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -14,8 +14,10 @@ array plugin_stats; /* global */ # include #endif -#if !defined(__WIN32) && !defined(LIGHTTPD_STATIC) -# include +#ifndef LIGHTTPD_STATIC +#ifdef HAVE_DLFCN_H +#include +#endif #endif /* * diff --git a/src/stat_cache.c b/src/stat_cache.c index eb2f82a2..d4fe3c8b 100644 --- a/src/stat_cache.c +++ b/src/stat_cache.c @@ -205,9 +205,11 @@ typedef enum FAMCodes { /*(copied from fam.h to define arbitrary enum values)*/ #ifdef HAVE_FAMNOEXISTS #ifndef LIGHTTPD_STATIC +#ifdef HAVE_DLFCN_H #include #endif #endif +#endif #endif