1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 03:55:04 +03:00

build: Don't check for dlfcn.h and dl.h

It's enough to check for symbols.
This commit is contained in:
Nick Wellnhofer 2024-07-22 21:39:54 +02:00
parent 7c10393fc0
commit d7dc2eaf06
5 changed files with 6 additions and 24 deletions

View File

@ -313,19 +313,16 @@ target_include_directories(
)
if(LIBXML2_WITH_MODULES)
check_include_files(dlfcn.h HAVE_DLFCN_H)
check_library_exists(dl dlopen "" HAVE_DLOPEN)
check_include_files(dl.h HAVE_DL_H)
check_library_exists(dld shl_load "" HAVE_SHLLOAD)
if(HAVE_DLOPEN)
target_link_libraries(LibXml2 PRIVATE dl)
set(MODULE_LIBS "-ldl")
endif()
if(HAVE_SHLLOAD)
target_link_libraries(LibXml2 PRIVATE dld)
set(MODULE_LIBS "-ldld")
else()
check_library_exists(dld shl_load "" HAVE_SHLLOAD)
if(HAVE_SHLLOAD)
target_link_libraries(LibXml2 PRIVATE dld)
set(MODULE_LIBS "-ldld")
endif()
endif()
endif()

View File

@ -12,15 +12,9 @@
/* Define if __attribute__((destructor)) is accepted */
#cmakedefine HAVE_FUNC_ATTRIBUTE_DESTRUCTOR 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine HAVE_DLFCN_H 1
/* Have dlopen based dso */
#cmakedefine HAVE_DLOPEN 1
/* Define to 1 if you have the <dl.h> header file. */
#cmakedefine HAVE_DL_H 1
/* Define if history library is there (-lhistory) */
#cmakedefine HAVE_LIBHISTORY 1

View File

@ -661,8 +661,6 @@ if test "$with_modules" != "no" ; then
esac
if test "$WITH_MODULES" = "0"; then
AC_CHECK_HEADERS([dl.h dlfcn.h])
_libs=$LIBS
AC_SEARCH_LIBS([dlopen], [dl], [
WITH_MODULES=1

View File

@ -236,9 +236,6 @@ xml_check_headers = [
[ 'stdint.h', true ],
[ 'glob.h', true ],
[ 'dl.h', want_modules ],
[ 'dlfcn.h', want_modules ],
[ 'sys/socket.h', want_http ],
[ 'netinet/in.h', want_http ],
[ 'arpa/inet.h', want_http ],

View File

@ -157,9 +157,7 @@ xmlModuleFree(xmlModulePtr module)
}
#if defined(HAVE_DLOPEN) && !defined(_WIN32)
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
#ifndef RTLD_GLOBAL /* For Tru64 UNIX 4.0 */
#define RTLD_GLOBAL 0
@ -210,9 +208,7 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
#else /* ! HAVE_DLOPEN */
#ifdef HAVE_SHLLOAD /* HAVE_SHLLOAD */
#ifdef HAVE_DL_H
#include <dl.h>
#endif
/*
* xmlModulePlatformOpen:
* returns a handle on success, and zero on error.