* [PATCH] config: Add pkgincludedir to Cflags
@ 2017-12-08 6:20 Namhyung Kim
2017-12-11 23:13 ` Mark Wielaard
0 siblings, 1 reply; 3+ messages in thread
From: Namhyung Kim @ 2017-12-08 6:20 UTC (permalink / raw)
To: elfutils-devel
The libelf and libdw uses pkginclude_HEADERS but the pkg-config file
misses to have it the Cflags. This was a problem for libdw users since
it gave nothing to include, but one needs to add /usr/include/elfutils
directory to use the libdw.h header file.
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
config/ChangeLog | 4 ++++
config/libdw.pc.in | 2 +-
config/libelf.pc.in | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/config/ChangeLog b/config/ChangeLog
index ae40cc07..be3f87fb 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2017-12-08 Namhyung Kim <namhyung@gmail.com>
+ * libelf.pc.in: Add pkgincludedir to Cflags.
+ * libdw.pc.in: Likewise
+
2017-11-02 Mark Wielaard <mark@klomp.org>
* elfutils.spec.in: Config files under /usr/lib/sysctl.d (_sysctldir)
diff --git a/config/libdw.pc.in b/config/libdw.pc.in
index 3fc283db..e2a083e9 100644
--- a/config/libdw.pc.in
+++ b/config/libdw.pc.in
@@ -9,7 +9,7 @@ Version: @VERSION@
URL: http://elfutils.org/
Libs: -L${libdir} -ldw
-Cflags: -I${includedir}
+Cflags: -I${includedir} -I${includedir}/elfutils
# We need the exact matching elfutils libelf version since internal data
# structures are used.
diff --git a/config/libelf.pc.in b/config/libelf.pc.in
index 48f3f021..5455577c 100644
--- a/config/libelf.pc.in
+++ b/config/libelf.pc.in
@@ -9,6 +9,6 @@ Version: @VERSION@
URL: http://elfutils.org/
Libs: -L${libdir} -lelf
-Cflags: -I${includedir}
+Cflags: -I${includedir} -I${includedir}/elfutils
Requires.private: zlib
--
2.15.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] config: Add pkgincludedir to Cflags
2017-12-08 6:20 [PATCH] config: Add pkgincludedir to Cflags Namhyung Kim
@ 2017-12-11 23:13 ` Mark Wielaard
2017-12-12 14:51 ` Namhyung Kim
0 siblings, 1 reply; 3+ messages in thread
From: Mark Wielaard @ 2017-12-11 23:13 UTC (permalink / raw)
To: Namhyung Kim, elfutils-devel
On Fri, 2017-12-08 at 15:17 +0900, Namhyung Kim wrote:
> The libelf and libdw uses pkginclude_HEADERS but the pkg-config file
> misses to have it the Cflags. This was a problem for libdw users since
> it gave nothing to include, but one needs to add /usr/include/elfutils
> directory to use the libdw.h header file.
I this really an issue?
libelf has two public headers which are placed in the includedir and so
should be simply included as #include <libelf.h> and #include <gelf.h>.
libdw does indeed put its headers in includdir/elfutils, but as far as
I know everybody includes them using that subdir, so #include
<elfutils/libdw.h> and #include <elfutils/libdwfl.h>, etc.
Wouldn't this change how people include the headers?
Do we want to change it?
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] config: Add pkgincludedir to Cflags
2017-12-11 23:13 ` Mark Wielaard
@ 2017-12-12 14:51 ` Namhyung Kim
0 siblings, 0 replies; 3+ messages in thread
From: Namhyung Kim @ 2017-12-12 14:51 UTC (permalink / raw)
To: Mark Wielaard; +Cc: elfutils-devel
Hello,
On Tue, Dec 12, 2017 at 8:13 AM, Mark Wielaard <mark@klomp.org> wrote:
> On Fri, 2017-12-08 at 15:17 +0900, Namhyung Kim wrote:
>> The libelf and libdw uses pkginclude_HEADERS but the pkg-config file
>> misses to have it the Cflags. This was a problem for libdw users since
>> it gave nothing to include, but one needs to add /usr/include/elfutils
>> directory to use the libdw.h header file.
>
> I this really an issue?
>
> libelf has two public headers which are placed in the includedir and so
> should be simply included as #include <libelf.h> and #include <gelf.h>.
>
> libdw does indeed put its headers in includdir/elfutils, but as far as
> I know everybody includes them using that subdir, so #include
> <elfutils/libdw.h> and #include <elfutils/libdwfl.h>, etc.
>
> Wouldn't this change how people include the headers?
> Do we want to change it?
Oh, I wasn't aware of the (preferred) way of including libdw headers.
Will change my code to use that pattern. Sorry for the noise.
Thanks,
Namhyung
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-12 14:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 6:20 [PATCH] config: Add pkgincludedir to Cflags Namhyung Kim
2017-12-11 23:13 ` Mark Wielaard
2017-12-12 14:51 ` Namhyung Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).