Fix the below build error on ubuntu:
../util/parse-configs.c:7:10: fatal error: iniparser.h: No such file or
directory
7 | #include <iniparser.h>
| ^~~~~~~~~~~~~
The same error is not observed on other OS because they do create symlinks as
below
lrwxrwxrwx. 1 root root 21 Jul 22 2021 /usr/include/iniparser.h ->
iniparser/iniparser.h
the error can be avoided by using the correct include path. Also, catch the
error
during setup instead of the build by adding the check for meson.build
Signed-off-by: Aneesh Kumar K.V <[email protected]>
---
meson.build | 2 +-
util/parse-configs.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index 42e11aa25cba..a4c4c1cd3df3 100644
--- a/meson.build
+++ b/meson.build
@@ -160,7 +160,7 @@ cc = meson.get_compiler('c')
# keyutils and iniparser lack pkgconfig
keyutils = cc.find_library('keyutils', required : get_option('keyutils'))
-iniparser = cc.find_library('iniparser', required : true)
+iniparser = cc.find_library('iniparser', required : true, has_headers:
'iniparser/iniparser.h')
conf = configuration_data()
check_headers = [
diff --git a/util/parse-configs.c b/util/parse-configs.c
index c834a07011e5..1b7ffa69f05f 100644
--- a/util/parse-configs.c
+++ b/util/parse-configs.c
@@ -4,7 +4,7 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
-#include <iniparser.h>
+#include <iniparser/iniparser.h>
#include <sys/stat.h>
#include <util/parse-configs.h>
#include <util/strbuf.h>
--
2.35.1