From c5d321c1b50ad5de2b2dbaafe28b64a042493005 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 8 May 2022 13:59:24 +0200 Subject: [PATCH] [configure] Check for libgen.h --- configure.ac | 1 + meson.build | 4 ++++ src/document/html/parser/link.c | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/configure.ac b/configure.ac index 2bf90e5e..41188f79 100644 --- a/configure.ac +++ b/configure.ac @@ -207,6 +207,7 @@ AC_HEADER_TIME AC_CHECK_HEADERS(wchar.h wctype.h) AC_CHECK_HEADERS(fcntl.h limits.h time.h unistd.h) +AC_CHECK_HEADERS(libgen.h) AC_CHECK_HEADERS(sigaction.h) AC_CHECK_HEADERS(arpa/inet.h) AC_CHECK_HEADERS(netinet/in_systm.h netinet/in_system.h netinet/ip.h) diff --git a/meson.build b/meson.build index e1fa0eda..9b5229d9 100644 --- a/meson.build +++ b/meson.build @@ -153,6 +153,10 @@ if compiler.has_header('fcntl.h') conf_data.set('HAVE_FCNTL_H', 1) endif +if compiler.has_header('libgen.h') + conf_data.set('HAVE_LIBGEN_H', 1) +endif + if compiler.has_header('unistd.h') conf_data.set('HAVE_UNISTD_H', 1) endif diff --git a/src/document/html/parser/link.c b/src/document/html/parser/link.c index 4f1418be..5e82043f 100644 --- a/src/document/html/parser/link.c +++ b/src/document/html/parser/link.c @@ -8,7 +8,13 @@ #define _GNU_SOURCE /* strcasestr() */ #endif +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef HAVE_LIBGEN_H #include /* basename() */ +#endif #include #include