diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b49e5f3..e38e6b48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/config.h.cmake.in b/config.h.cmake.in index 07e539e7..4da8c765 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -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 diff --git a/configure.ac b/configure.ac index 190482a6..c6dc93d5 100644 --- a/configure.ac +++ b/configure.ac @@ -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 ]) AC_CHECK_DECLS([getentropy], [], [], [#include ]) +AC_CHECK_DECLS([glob], [], [], [#include ]) +AC_CHECK_DECLS([mmap], [], [], [#include ]) + +AM_CONDITIONAL(WITH_GLOB, test "$ac_cv_have_decl_glob" = "yes") dnl dnl Checks for inet libraries diff --git a/meson.build b/meson.build index b44a3e10..7b5880e3 100644 --- a/meson.build +++ b/meson.build @@ -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