libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] [PATCH] Create and install pkg-config .pc files


From: Alexander Toresson
Subject: Re: [Libunwind-devel] [PATCH] Create and install pkg-config .pc files
Date: Mon, 27 Aug 2012 20:47:47 +0200

On Mon, Aug 27, 2012 at 5:11 AM, Mike Frysinger <address@hidden> wrote:
> On Sunday 26 August 2012 16:45:40 Alexander Toresson wrote:
>> I've made a patch for creating pkg-config .pc files for libunwind. For
>> example for libunwind-ptrace, you seem to need to also link to
>> libunwind-$arch (for example libunwind-x86_64), or at least this is
>> the case on x86_64 (please correct me if this is not the case for the
>> other architectures). So I thought that this could be automated with
>> pkg-config. For example, with this patch on x86_64, pkg-config --libs
>> libunwind-ptrace outputs "-lunwind-ptrace -lunwind-x86_64". For
>> completeness, this patch adds .pc files for all the libunwind
>> libraries.
>
> i think the fringe libraries should still Require libunwind since they use
> symbols from it

I was a bit confused by this. Yes, they do seem to use symbols from
it, but I managed to build a test program without explicitly linking
against libunwind. I've updated the patch to do this, though.

>> --- a/configure.in
>> +++ b/configure.in
>>
>> +PKG_PROG_PKG_CONFIG
>
> you don't need pkg-config in order to install a .pc file
> -mike

Thank you! Here's an updated patch:


---
 configure.in                          |    3 +++
 src/Makefile.am                       |    5 +++++
 src/coredump/libunwind-coredump.pc.in |   10 ++++++++++
 src/libunwind-arch.pc.in              |   10 ++++++++++
 src/ptrace/libunwind-ptrace.pc.in     |   10 ++++++++++
 src/setjmp/libunwind-setjmp.pc.in     |   10 ++++++++++
 src/unwind/libunwind.pc.in            |    9 +++++++++
 7 filer ändrade, 57 tillägg(+)
 create mode 100644 src/coredump/libunwind-coredump.pc.in
 create mode 100644 src/libunwind-arch.pc.in
 create mode 100644 src/ptrace/libunwind-ptrace.pc.in
 create mode 100644 src/setjmp/libunwind-setjmp.pc.in
 create mode 100644 src/unwind/libunwind.pc.in

diff --git a/configure.in b/configure.in
index 081ccee..cf01cbe 100644
--- a/configure.in
+++ b/configure.in
@@ -313,4 +313,7 @@ AC_SUBST(BACKTRACELIB)
 AC_CONFIG_FILES(Makefile src/Makefile tests/Makefile tests/check-namespace.sh
                doc/Makefile doc/common.tex include/libunwind-common.h
                 include/libunwind.h include/tdep/libunwind_i.h)
+AC_CONFIG_FILES(src/unwind/libunwind.pc src/coredump/libunwind-coredump.pc
+                src/ptrace/libunwind-ptrace.pc src/setjmp/libunwind-setjmp.pc
+                src/libunwind-$target_arch.pc:src/libunwind-arch.pc.in)
 AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index ab850df..ca66623 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -15,6 +15,11 @@ endif
 noinst_HEADERS =
 noinst_LTLIBRARIES =

+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = unwind/libunwind.pc coredump/libunwind-coredump.pc \
+                 ptrace/libunwind-ptrace.pc setjmp/libunwind-setjmp.pc \
+                 libunwind-$(arch).pc
+
 ### libunwind-ptrace:
 libunwind_ptrace_la_SOURCES =                                            \
        ptrace/_UPT_elf.c                                                 \
diff --git a/src/coredump/libunwind-coredump.pc.in
b/src/coredump/libunwind-coredump.pc.in
new file mode 100644
index 0000000..9205c41
--- /dev/null
+++ b/src/coredump/libunwind-coredump.pc.in
@@ -0,0 +1,10 @@
address@hidden@
address@hidden@
address@hidden@
address@hidden@
+
+Name: libunwind-coredump
+Description: libunwind coredump library
+Version: @VERSION@
+Requires: address@hidden@ libunwind
+Libs: -L${libdir} -lunwind-coredump
diff --git a/src/libunwind-arch.pc.in b/src/libunwind-arch.pc.in
new file mode 100644
index 0000000..65269ae
--- /dev/null
+++ b/src/libunwind-arch.pc.in
@@ -0,0 +1,10 @@
address@hidden@
address@hidden@
address@hidden@
address@hidden@
+
+Name: address@hidden@
+Description: libunwind @arch@ library
+Version: @VERSION@
+Requires: libunwind
+Libs: -L${libdir} address@hidden@
diff --git a/src/ptrace/libunwind-ptrace.pc.in
b/src/ptrace/libunwind-ptrace.pc.in
new file mode 100644
index 0000000..15ce82b
--- /dev/null
+++ b/src/ptrace/libunwind-ptrace.pc.in
@@ -0,0 +1,10 @@
address@hidden@
address@hidden@
address@hidden@
address@hidden@
+
+Name: libunwind-ptrace
+Description: libunwind ptrace library
+Version: @VERSION@
+Requires: address@hidden@ libunwind
+Libs: -L${libdir} -lunwind-ptrace
diff --git a/src/setjmp/libunwind-setjmp.pc.in
b/src/setjmp/libunwind-setjmp.pc.in
new file mode 100644
index 0000000..aa34b7b
--- /dev/null
+++ b/src/setjmp/libunwind-setjmp.pc.in
@@ -0,0 +1,10 @@
address@hidden@
address@hidden@
address@hidden@
address@hidden@
+
+Name: libunwind-setjmp
+Description: libunwind setjmp library
+Version: @VERSION@
+Requires: libunwind
+Libs: -L${libdir} -lunwind-setjmp
diff --git a/src/unwind/libunwind.pc.in b/src/unwind/libunwind.pc.in
new file mode 100644
index 0000000..c2799ea
--- /dev/null
+++ b/src/unwind/libunwind.pc.in
@@ -0,0 +1,9 @@
address@hidden@
address@hidden@
address@hidden@
address@hidden@
+
+Name: libunwind
+Description: libunwind base library
+Version: @VERSION@
+Libs: -L${libdir} -lunwind
--
1.7.10.4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]