commit 4d98468: [Minor] Cleanup unused cmake checks

Anton Yuzhaninov citrin+git at citrin.ru
Mon Sep 20 16:56:04 UTC 2021


Author: Anton Yuzhaninov
Date: 2021-09-20 17:37:06 +0100
URL: https://github.com/rspamd/rspamd/commit/4d9846823f89a2c64cf763fcc61d4c694eedba53 (refs/pull/3899/head)

[Minor] Cleanup unused cmake checks

---
 CMakeLists.txt         | 44 --------------------------------------------
 config.h.in            | 42 ------------------------------------------
 src/lua/lua_cfg_file.c |  3 ---
 3 files changed, 89 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ced49730d..816e403bd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -261,7 +261,6 @@ ADD_DEFINITIONS(-DU_CHARSET_IS_UTF8)
 
 # Check platform specific includes
 CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
-CHECK_INCLUDE_FILES(sys/time.h  HAVE_SYS_TIME_H)
 CHECK_INCLUDE_FILES(sys/uio.h   HAVE_SYS_UIO_H)
 
 CHECK_INCLUDE_FILES(fcntl.h     HAVE_FCNTL_H)
@@ -278,7 +277,6 @@ CHECK_INCLUDE_FILES(stdbool.h  HAVE_STDBOOL_H)
 CHECK_INCLUDE_FILES(endian.h  HAVE_ENDIAN_H)
 CHECK_INCLUDE_FILES(sys/endian.h  HAVE_SYS_ENDIAN_H)
 CHECK_INCLUDE_FILES(machine/endian.h  HAVE_MACHINE_ENDIAN_H)
-CHECK_INCLUDE_FILES(sys/queue.h  HAVE_SYS_QUEUE_H)
 CHECK_INCLUDE_FILES(sys/socket.h  HAVE_SYS_SOCKET_H)
 CHECK_INCLUDE_FILES(sys/mman.h  HAVE_SYS_MMAN_H)
 CHECK_INCLUDE_FILES(sys/un.h  HAVE_SYS_UN_H)
@@ -287,7 +285,6 @@ CHECK_INCLUDE_FILES(sys/wait.h  HAVE_SYS_WAIT_H)
 CHECK_INCLUDE_FILES(sys/param.h  HAVE_SYS_PARAM_H)
 CHECK_INCLUDE_FILES(sys/cdefs.h  HAVE_SYS_CDEFS_H)
 CHECK_INCLUDE_FILES(sys/file.h  HAVE_SYS_FILE_H)
-CHECK_INCLUDE_FILES(sys/utsname.h  HAVE_SYS_UTSNAME_H)
 CHECK_INCLUDE_FILES(sys/resource.h  HAVE_SYS_RESOURCE_H)
 CHECK_INCLUDE_FILES(netinet/in.h  HAVE_NETINET_IN_H)
 CHECK_INCLUDE_FILES(netinet/tcp.h  HAVE_NETINET_TCP_H)
@@ -297,7 +294,6 @@ CHECK_INCLUDE_FILES(syslog.h HAVE_SYSLOG_H)
 CHECK_INCLUDE_FILES(siginfo.h HAVE_SIGINFO_H)
 CHECK_INCLUDE_FILES(locale.h HAVE_LOCALE_H)
 CHECK_INCLUDE_FILES(libgen.h HAVE_LIBGEN_H)
-CHECK_INCLUDE_FILES(search.h HAVE_SEARCH_H)
 CHECK_INCLUDE_FILES(pwd.h HAVE_PWD_H)
 CHECK_INCLUDE_FILES(grp.h HAVE_GRP_H)
 CHECK_INCLUDE_FILES(glob.h HAVE_GLOB_H)
@@ -309,8 +305,6 @@ CHECK_INCLUDE_FILES(ctype.h HAVE_CTYPE_H)
 CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H)
 CHECK_INCLUDE_FILES(cpuid.h HAVE_CPUID_H)
 CHECK_INCLUDE_FILES(dirent.h HAVE_DIRENT_H)
-CHECK_INCLUDE_FILES(stropts.h HAVE_STROPS_H)
-CHECK_INCLUDE_FILES(sys/ioctl.h HAVE_SYS_IOCTL_H)
 CHECK_INCLUDE_FILES(ucontext.h HAVE_UCONTEXT_H)
 CHECK_INCLUDE_FILES(sys/ucontext.h HAVE_SYS_UCONTEXT_H) # OSX specific
 
@@ -318,46 +312,22 @@ CHECK_INCLUDE_FILES(sys/ucontext.h HAVE_SYS_UCONTEXT_H) # OSX specific
 CHECK_FUNCTION_EXISTS(setproctitle HAVE_SETPROCTITLE)
 CHECK_FUNCTION_EXISTS(getpagesize HAVE_GETPAGESIZE)
 CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP)
-CHECK_FUNCTION_EXISTS(vfork HAVE_VFORK)
-CHECK_FUNCTION_EXISTS(wait4 HAVE_WAIT4)
-CHECK_FUNCTION_EXISTS(waitpid HAVE_WAITPID)
 CHECK_FUNCTION_EXISTS(flock HAVE_FLOCK)
-CHECK_LIBRARY_EXISTS(m tanhl "" HAVE_TANHL)
 CHECK_LIBRARY_EXISTS(m tanh "" HAVE_TANH)
-CHECK_LIBRARY_EXISTS(m expl "" HAVE_EXPL)
-CHECK_LIBRARY_EXISTS(m exp2l "" HAVE_EXP2L)
-CHECK_FUNCTION_EXISTS(sendfile HAVE_SENDFILE)
 CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
-CHECK_FUNCTION_EXISTS(setitimer HAVE_SETITIMER)
-CHECK_FUNCTION_EXISTS(inet_pton HAVE_INET_PTON)
 CHECK_FUNCTION_EXISTS(clock_gettime HAVE_CLOCK_GETTIME)
-CHECK_C_SOURCE_COMPILES(
-		"#include <time.h>
-		extern char *tzname[2];
-		extern long timezone;
-		extern int daylight;
-	int main(int argc, char** argv) {
-		tzset();
-		return timezone;
-	}" HAVE_SANE_TZSET)
 
 # Check macros
 CHECK_SYMBOL_EXISTS(PATH_MAX limits.h HAVE_PATH_MAX)
 CHECK_SYMBOL_EXISTS(MAXPATHLEN sys/param.h HAVE_MAXPATHLEN)
-CHECK_SYMBOL_EXISTS(MAP_SHARED sys/mman.h HAVE_MMAP_SHARED)
 CHECK_SYMBOL_EXISTS(MAP_ANON sys/mman.h HAVE_MMAP_ANON)
-CHECK_SYMBOL_EXISTS(MAP_NOCORE sys/mman.h HAVE_MMAP_NOCORE)
-CHECK_SYMBOL_EXISTS(O_DIRECT fcntl.h HAVE_O_DIRECT)
 CHECK_SYMBOL_EXISTS(IPV6_V6ONLY "sys/socket.h;netinet/in.h" HAVE_IPV6_V6ONLY)
-CHECK_SYMBOL_EXISTS(posix_fadvise fcntl.h HAVE_FADVISE)
 CHECK_SYMBOL_EXISTS(posix_fallocate fcntl.h HAVE_POSIX_FALLOCATE)
 CHECK_SYMBOL_EXISTS(fallocate fcntl.h HAVE_FALLOCATE)
-CHECK_SYMBOL_EXISTS(fdatasync unistd.h HAVE_FDATASYNC)
 CHECK_SYMBOL_EXISTS(_SC_NPROCESSORS_ONLN unistd.h HAVE_SC_NPROCESSORS_ONLN)
 CHECK_SYMBOL_EXISTS(setbit sys/param.h PARAM_H_HAS_BITSET)
 CHECK_SYMBOL_EXISTS(getaddrinfo "sys/types.h;sys/socket.h;netdb.h" HAVE_GETADDRINFO)
 CHECK_SYMBOL_EXISTS(sched_yield "sched.h" HAVE_SCHED_YIELD)
-CHECK_SYMBOL_EXISTS(__get_cpuid "cpuid.h" HAVE_GET_CPUID)
 CHECK_SYMBOL_EXISTS(nftw "sys/types.h;ftw.h" HAVE_NFTW)
 CHECK_SYMBOL_EXISTS(memrchr "string.h" HAVE_MEMRCHR)
 IF(ENABLE_PCRE2 MATCHES "ON")
@@ -368,8 +338,6 @@ ELSE()
 	CHECK_SYMBOL_EXISTS(PCRE_CONFIG_JIT "pcre.h" HAVE_PCRE_JIT)
 ENDIF()
 CHECK_SYMBOL_EXISTS(SOCK_SEQPACKET "sys/types.h;sys/socket.h" HAVE_SOCK_SEQPACKET)
-CHECK_SYMBOL_EXISTS(I_SETSIG "sys/types.h;sys/ioctl.h" HAVE_SETSIG)
-CHECK_SYMBOL_EXISTS(O_ASYNC "sys/types.h;sys/fcntl.h" HAVE_OASYNC)
 CHECK_SYMBOL_EXISTS(O_NOFOLLOW "sys/types.h;sys/fcntl.h" HAVE_ONOFOLLOW)
 CHECK_SYMBOL_EXISTS(O_CLOEXEC "sys/types.h;sys/fcntl.h" HAVE_OCLOEXEC)
 
@@ -472,13 +440,6 @@ IF(HAVE_CLOCK_GETTIME)
 ELSE(HAVE_CLOCK_GETTIME)
 	CHECK_INCLUDE_FILES(sys/timeb.h HAVE_SYS_TIMEB_H)
 ENDIF(HAVE_CLOCK_GETTIME)
-
-# Check asm pause instruction
-CHECK_C_SOURCE_COMPILES ("#include <sys/types.h>
-						  int main (int argc, char **argv) {
-							__asm __volatile(\"pause\");
-							return 0;
-						  }" HAVE_ASM_PAUSE)
 ENDIF(NOT CMAKE_SYSTEM_NAME STREQUAL "SunOS")
 
 CHECK_C_SOURCE_RUNS("
@@ -569,11 +530,6 @@ ELSE()
 	ENDIF()
 ENDIF()
 
-# Check queue.h compatibility
-IF(NOT HAVE_COMPATIBLE_QUEUE_H)
-	INCLUDE_DIRECTORIES(compat)
-ENDIF(NOT HAVE_COMPATIBLE_QUEUE_H)
-
 IF(ENABLE_URL_INCLUDE MATCHES "ON")
 	FIND_LIBRARY(LIBFETCH_LIBRARY HINTS "${RSPAMD_SEARCH_PATH}"
 					NAMES fetch PATHS	PATH_SUFFIXES lib64 lib
diff --git a/config.h.in b/config.h.in
index 74f694f88..f83167463 100644
--- a/config.h.in
+++ b/config.h.in
@@ -10,42 +10,28 @@
 #cmakedefine GLIB_HASH_COMPAT		 1
 #cmakedefine GLIB_RE_COMPAT		 1
 #cmakedefine GLIB_UNISCRIPT_COMPAT		 1
-#cmakedefine HAVE_AIO_H          1
 #cmakedefine HAVE_ARPA_INET_H    1
-#cmakedefine HAVE_ASM_PAUSE      1
 #cmakedefine HAVE_ATOMIC_BUILTINS 1
 #cmakedefine HAVE_CLOCK_GETCPUCLOCKID 1
 #cmakedefine HAVE_CLOCK_GETTIME  1
 #cmakedefine HAVE_CLOCK_PROCESS_CPUTIME_ID  1
 #cmakedefine HAVE_CLOCK_VIRTUAL  1
-#cmakedefine HAVE_COMPATIBLE_QUEUE_H    1
 #cmakedefine HAVE_CPUID_H        1
 #cmakedefine HAVE_CTYPE_H        1
 #cmakedefine HAVE_DIRENT_H       1
 #cmakedefine HAVE_DIRFD          1
 #cmakedefine HAVE_ENDIAN_H       1
-#cmakedefine HAVE_EXP2L          1
-#cmakedefine HAVE_EXPL           1
-#cmakedefine HAVE_EXPLICIT_BZERO 1
-#cmakedefine HAVE_FADVISE        1
 #cmakedefine HAVE_FALLOCATE      1
 #cmakedefine HAVE_FCNTL_H        1
-#cmakedefine HAVE_FDATASYNC      1
 #cmakedefine HAVE_FETCH_H        1
 #cmakedefine HAVE_FIPS_MODE      1
 #cmakedefine HAVE_FLOCK          1
 #cmakedefine HAVE_FPATHCONF      1
 #cmakedefine HAVE_GETPAGESIZE    1
-#cmakedefine HAVE_GET_CPUID      1
 #cmakedefine HAVE_GLOB_H         1
 #cmakedefine HAVE_GRP_H          1
-#cmakedefine HAVE_INET_PTON      1
 #cmakedefine HAVE_INTTYPES_H     1
 #cmakedefine HAVE_IPV6_V6ONLY    1
-#cmakedefine HAVE_LIBAIO_H       1
-#cmakedefine HAVE_LIBEVENT2      1
-#cmakedefine HAVE_EVENT_NO_CACHE_TIME_FLAG 1
-#cmakedefine HAVE_EVENT_NO_CACHE_TIME_FUNC 1
 #cmakedefine HAVE_LIBGEN_H       1
 #cmakedefine HAVE_LIBUTIL_H      1
 #cmakedefine HAVE_LOCALE_H       1
@@ -53,21 +39,16 @@
 #cmakedefine HAVE_MAXPATHLEN     1
 #cmakedefine HAVE_FMEMOPEN       1
 #cmakedefine HAVE_MEMRCHR        1
-#cmakedefine HAVE_MEMSET_S       1
 #cmakedefine HAVE_MKSTEMP        1
 #cmakedefine HAVE_MMAP_ANON      1
-#cmakedefine HAVE_MMAP_NOCORE    1
-#cmakedefine HAVE_MMAP_SHARED    1
 #cmakedefine HAVE_NANOSLEEP      1
 #cmakedefine HAVE_NETDB_H        1
 #cmakedefine HAVE_NETINET_IN_H   1
 #cmakedefine HAVE_NETINET_TCP_H  1
 #cmakedefine HAVE_NFTW           1
-#cmakedefine HAVE_OASYNC         1
 #cmakedefine HAVE_OCLOEXEC       1
 #cmakedefine HAVE_ONOFOLLOW      1
 #cmakedefine HAVE_OPENMEMSTREAM  1
-#cmakedefine HAVE_O_DIRECT       1
 #cmakedefine HAVE_PATH_MAX       1
 
 /* OSX has broken JIT support in PCRE, disable it */
@@ -88,14 +69,9 @@
 #cmakedefine HAVE_RUSAGE_SELF    1
 #cmakedefine HAVE_SA_SIGINFO     1
 #cmakedefine HAVE_SANE_SHMEM     1
-#cmakedefine HAVE_SANE_TZSET     1
 #cmakedefine HAVE_SCHED_YIELD    1
 #cmakedefine HAVE_SC_NPROCESSORS_ONLN 1
-#cmakedefine HAVE_SEARCH_H       1
-#cmakedefine HAVE_SENDFILE       1
-#cmakedefine HAVE_SETITIMER      1
 #cmakedefine HAVE_SETPROCTITLE   1
-#cmakedefine HAVE_SETSIG         1
 #cmakedefine HAVE_SIGALTSTACK    1
 #cmakedefine HAVE_SIGINFO_H      1
 #cmakedefine HAVE_SOCK_SEQPACKET 1
@@ -106,39 +82,27 @@
 #cmakedefine HAVE_STDLIB_H       1
 #cmakedefine HAVE_STRINGS_H      1
 #cmakedefine HAVE_STRING_H       1
-#cmakedefine HAVE_STROPS_H       1
 #cmakedefine HAVE_SYSLOG_H       1
 #cmakedefine HAVE_SYS_CDEFS_H    1
 #cmakedefine HAVE_SYS_ENDIAN_H   1
 #cmakedefine HAVE_SYS_EVENTFD_H  1
 #cmakedefine HAVE_SYS_FILE_H     1
-#cmakedefine HAVE_SYS_IOCTL_H    1
 #cmakedefine HAVE_SYS_MMAN_H     1
 #cmakedefine HAVE_SYS_PARAM_H    1
-#cmakedefine HAVE_SYS_QUEUE_H    1
 #cmakedefine HAVE_SYS_RESOURCE_H 1
-#cmakedefine HAVE_SYS_SENDFILE_H 1
 #cmakedefine HAVE_SYS_SOCKET_H   1
 #cmakedefine HAVE_SYS_STAT_H     1
 #cmakedefine HAVE_SYS_TIMEB_H    1
-#cmakedefine HAVE_SYS_TIME_H     1
 #cmakedefine HAVE_SYS_TYPES_H    1
 #cmakedefine HAVE_SYS_UCONTEXT_H 1
 #cmakedefine HAVE_SYS_UIO_H      1
 #cmakedefine HAVE_SYS_UN_H       1
-#cmakedefine HAVE_SYS_UTSNAME_H  1
 #cmakedefine HAVE_SYS_WAIT_H     1
 #cmakedefine HAVE_TANH           1
-#cmakedefine HAVE_TANHL          1
 #cmakedefine HAVE_TERMIOS_H      1
 #cmakedefine HAVE_TIME_H         1
 #cmakedefine HAVE_UCONTEXT_H     1
 #cmakedefine HAVE_UNISTD_H       1
-#cmakedefine HAVE_VFORK          1
-#cmakedefine HAVE_WAIT4          1
-#cmakedefine HAVE_WAITPID        1
-#cmakedefine HAVE_WEAK_SYMBOLS   1
-#cmakedefine LIBEVENT_EVHTTP     1
 #cmakedefine PARAM_H_HAS_BITSET  1
 #cmakedefine WITH_DB             1
 #cmakedefine WITH_GPERF_TOOLS    1
@@ -150,8 +114,6 @@
 #cmakedefine WITH_PCRE2          1
 #cmakedefine WITH_SNOWBALL       1
 #cmakedefine WITH_SQLITE         1
-#cmakedefine WITH_SYSTEM_HIREDIS 1
-#cmakedefine WITH_TORCH          1
 #cmakedefine WITH_LIBUNWIND      1
 #cmakedefine WITH_LUA_TRACE      1
 #cmakedefine WITH_LUA_REPL       1
@@ -289,10 +251,6 @@
 #include <time.h>
 #endif
 
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
 /* string */
 #ifdef HAVE_STRING_H
 #include <string.h>
diff --git a/src/lua/lua_cfg_file.c b/src/lua/lua_cfg_file.c
index af8964b32..8de2628c6 100644
--- a/src/lua/lua_cfg_file.c
+++ b/src/lua/lua_cfg_file.c
@@ -17,9 +17,6 @@
 #include "expression.h"
 #include "src/libserver/composites/composites.h"
 
-#ifdef HAVE_SYS_UTSNAME_H
-#endif
-
 /*
  * This is implementation of lua routines to handle config file params
  */


More information about the Commits mailing list