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

build: Check for declaration of glob() function

Don't rely on presence of glob.h.
This commit is contained in:
Nick Wellnhofer 2024-08-19 17:43:32 +02:00
parent 2191ccdf7b
commit 567f612d29
4 changed files with 14 additions and 7 deletions

View File

@ -141,6 +141,7 @@ check_c_source_compiles("
int main(void) { return 0; }
" HAVE_FUNC_ATTRIBUTE_DESTRUCTOR)
check_symbol_exists(getentropy "sys/random.h" HAVE_DECL_GETENTROPY)
check_symbol_exists(glob "glob.h" HAVE_DECL_GLOB)
check_symbol_exists(mmap "sys/mman.h" HAVE_DECL_MMAP)
check_include_files(stdint.h HAVE_STDINT_H)

View File

@ -2,6 +2,10 @@
don't. */
#cmakedefine01 HAVE_DECL_GETENTROPY
/* Define to 1 if you have the declaration of 'glob', and to 0 if you don't.
*/
#cmakedefine01 HAVE_DECL_GLOB
/* Define to 1 if you have the declaration of 'mmap', and to 0 if you don't.
*/
#cmakedefine01 HAVE_DECL_MMAP

View File

@ -298,12 +298,13 @@ dnl
dnl Checks for header files.
dnl
AC_CHECK_HEADERS([stdint.h])
AC_CHECK_HEADERS([glob.h])
AM_CONDITIONAL(WITH_GLOB, test "$ac_cv_header_glob_h" = "yes")
dnl Checks for library functions.
AC_CHECK_DECLS([mmap], [], [], [#include <sys/mman.h>])
AC_CHECK_DECLS([getentropy], [], [], [#include <sys/random.h>])
AC_CHECK_DECLS([glob], [], [], [#include <glob.h>])
AC_CHECK_DECLS([mmap], [], [], [#include <sys/mman.h>])
AM_CONDITIONAL(WITH_GLOB, test "$ac_cv_have_decl_glob" = "yes")
dnl
dnl Checks for inet libraries

View File

@ -235,7 +235,6 @@ config_h.set_quoted('LOCALEDIR', dir_locale)
# header files
xml_check_headers = [
[ 'stdint.h', true ],
[ 'glob.h', true ],
[ 'poll.h', want_http ],
]
@ -248,12 +247,14 @@ endforeach
# library functions
xml_check_functions = [
# fct | header
['getentropy', 'sys/random.h', 'HAVE_DECL_GETENTROPY'],
['mmap', 'sys/mman.h', 'HAVE_DECL_MMAP'],
['getentropy', 'sys/random.h'],
['glob', 'glob.h'],
['mmap', 'sys/mman.h'],
]
foreach function : xml_check_functions
config_h.set10(function[2], cc.has_header_symbol(function[1], function[0]))
config_h.set10('HAVE_DECL_' + function[0].underscorify().to_upper(),
cc.has_header_symbol(function[1], function[0]))
endforeach
# library