libunwind-devel
[Top][All Lists]
Advanced

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

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


From: Alexander Toresson
Subject: [Libunwind-devel] [PATCH] Create and install pkg-config .pc files
Date: Sun, 26 Aug 2012 22:45:40 +0200

Hello all,

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.

Except for libunwind-ptrace, libunwind-coredump also appears to need
libunwind-$arch, while libunwind-setjmp does not. Is this correct?

I have only had the chance to test this patch on x86_64, I encourage
testing, comments and corrections!

Regards, Alexander


---
 configure.in                          |    4 ++++
 src/Makefile.am                       |    5 +++++
 src/coredump/libunwind-coredump.pc.in |   10 ++++++++++
 src/libunwind-arch.pc.in              |    9 +++++++++
 src/ptrace/libunwind-ptrace.pc.in     |   10 ++++++++++
 src/setjmp/libunwind-setjmp.pc.in     |    9 +++++++++
 src/unwind/libunwind.pc.in            |    9 +++++++++
 7 filer ändrade, 56 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..f26fdaa 100644
--- a/configure.in
+++ b/configure.in
@@ -20,6 +20,7 @@ AC_PROG_MAKE_SET
 LT_INIT
 AM_PROG_AS
 AM_PROG_CC_C_O
+PKG_PROG_PKG_CONFIG

 dnl Checks for libraries.
 AC_CHECK_LIB(uca, __uc_get_grs)
@@ -313,4 +314,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..dd7b866
--- /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@
+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..331463b
--- /dev/null
+++ b/src/libunwind-arch.pc.in
@@ -0,0 +1,9 @@
address@hidden@
address@hidden@
address@hidden@
address@hidden@
+
+Name: address@hidden@
+Description: libunwind @arch@ library
+Version: @VERSION@
+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..9134f42
--- /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@
+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..9453905
--- /dev/null
+++ b/src/setjmp/libunwind-setjmp.pc.in
@@ -0,0 +1,9 @@
address@hidden@
address@hidden@
address@hidden@
address@hidden@
+
+Name: libunwind-setjmp
+Description: libunwind setjmp library
+Version: @VERSION@
+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]