All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] util/parse: Fix build error on ubuntu
@ 2022-03-15  6:04 Aneesh Kumar K.V
  2022-03-15  8:55 ` Vaibhav Jain
  0 siblings, 1 reply; 8+ messages in thread
From: Aneesh Kumar K.V @ 2022-03-15  6:04 UTC (permalink / raw)
  To: nvdimm, dan.j.williams, vishal.l.verma; +Cc: Aneesh Kumar K.V

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 <aneesh.kumar@linux.ibm.com>
---
 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-03-16  5:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-15  6:04 [PATCH] util/parse: Fix build error on ubuntu Aneesh Kumar K.V
2022-03-15  8:55 ` Vaibhav Jain
2022-03-15 10:15   ` Aneesh Kumar K.V
2022-03-15 16:46     ` Vaibhav Jain
2022-03-15 17:03       ` Verma, Vishal L
2022-03-15 17:19       ` Dan Williams
2022-03-16  3:50       ` Aneesh Kumar K V
2022-03-16  5:33         ` Vaibhav Jain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.