From e1291059aff76248ddb459d27b3307c48fe1bb37 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Mon, 22 Jul 2024 22:22:48 +0200 Subject: [PATCH] build: Don't check for pthread.h The Autotools build still checks for pthread.h (and zlib.h and lzma.h) but the result isn't needed in config.h. --- CMakeLists.txt | 6 ------ config.h.cmake.in | 3 --- configure.ac | 4 +--- meson.build | 1 - runtest.c | 11 +---------- win32/Makefile.bcb | 2 -- win32/Makefile.mingw | 3 --- win32/Makefile.msvc | 2 -- 8 files changed, 2 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c942246c..82e6c80c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -293,12 +293,6 @@ add_library(LibXml2::LibXml2 ALIAS LibXml2) target_compile_definitions(LibXml2 PRIVATE SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}") -if(LIBXML2_WITH_THREADS) - if(NOT WIN32) - check_include_files(pthread.h HAVE_PTHREAD_H) - endif() -endif() - target_include_directories( LibXml2 PUBLIC diff --git a/config.h.cmake.in b/config.h.cmake.in index 81850900..07e539e7 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -21,9 +21,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_POLL_H 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_PTHREAD_H 1 - /* Have shl_load based dso */ #cmakedefine HAVE_SHLLOAD 1 diff --git a/configure.ac b/configure.ac index 771e3d0a..1d3a52ba 100644 --- a/configure.ac +++ b/configure.ac @@ -711,9 +711,7 @@ else WITH_THREADS="1" if test "$ac_cv_search_pthread_create" != "none required"; then THREAD_LIBS=$ac_cv_search_pthread_create - fi - AC_DEFINE([HAVE_PTHREAD_H], [], - [Define if is there])])) + fi])) LIBS=$_libs ;; esac diff --git a/meson.build b/meson.build index 427fb945..5dc3c7ad 100644 --- a/meson.build +++ b/meson.build @@ -310,7 +310,6 @@ endif ### threads if want_threads threads_dep = dependency('threads') - config_h.set10(sys_windows ? 'HAVE_WIN32_THREADS' : 'HAVE_PTHREAD_H', true) xml_deps += threads_dep else threads_dep = dependency('', required: false) diff --git a/runtest.c b/runtest.c index 6f50303b..7bfbfc7b 100644 --- a/runtest.c +++ b/runtest.c @@ -4420,7 +4420,7 @@ testThread(void) return (res); } -#elif defined HAVE_PTHREAD_H +#else #include static pthread_t tid[MAX_ARGC]; @@ -4469,15 +4469,6 @@ testThread(void) } return (res); } - -#else -static int -testThread(void) -{ - fprintf(stderr, - "Specific platform thread support not detected\n"); - return (-1); -} #endif static int threadsTest(const char *filename ATTRIBUTE_UNUSED, diff --git a/win32/Makefile.bcb b/win32/Makefile.bcb index a7718f22..b9c3233e 100644 --- a/win32/Makefile.bcb +++ b/win32/Makefile.bcb @@ -59,8 +59,6 @@ CFLAGS = $(CFLAGS) -tWR !endif !if "$(WITH_THREADS)" == "ctls" CFLAGS = $(CFLAGS) "-DXML_THREAD_LOCAL=__declspec(thread)" -!else if "$(WITH_THREADS)" == "posix" -CFLAGS = $(CFLAGS) -DHAVE_PTHREAD_H !endif # The linker and its options. diff --git a/win32/Makefile.mingw b/win32/Makefile.mingw index e1f3f07d..1eb058b6 100644 --- a/win32/Makefile.mingw +++ b/win32/Makefile.mingw @@ -42,9 +42,6 @@ CFLAGS += -I$(XML_SRCDIR) -I$(XML_SRCDIR)/include -I$(INCPREFIX) $(INCLUDE) ifeq ($(WITH_THREADS),ctls) CFLAGS += "-DXML_THREAD_LOCAL=__declspec(thread)" endif -ifeq ($(WITH_THREADS),posix) -CFLAGS += -DHAVE_PTHREAD_H -endif # The linker and its options. LD = gcc.exe diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc index 24ee9738..2b2e6ca8 100644 --- a/win32/Makefile.msvc +++ b/win32/Makefile.msvc @@ -44,8 +44,6 @@ CFLAGS = /nologo /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W3 /wd4244 /wd4267 $(C CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX) !if "$(WITH_THREADS)" == "ctls" CFLAGS = $(CFLAGS) /D "XML_THREAD_LOCAL=__declspec(thread)" -!else if "$(WITH_THREADS)" == "posix" -CFLAGS = $(CFLAGS) /D "HAVE_PTHREAD_H" !endif CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE