[DVDnav-discuss] [PATCH] pkgconfig support for libdvdread
Dan Nicholson
dbn.lists at gmail.com
Sun Jul 13 21:19:42 CEST 2008
On Sun, Jul 13, 2008 at 02:39:18PM +0200, Dominik 'Rathann' Mierzejewski wrote:
> Hi.
>
> This adds pkgconfig .pc file generation to the build system.
>
> Patch attached. OK to apply? Dan, could you add the corresponding autotools
> part?
Shoot. I'd done this about a month ago, but never committed it. Dominik,
one thing that would make the autotools much easier would be to have a
.pc.in file that we can substitute values in with sed. Then it can just
be another output from configure. Below is what I did before. Do you
think we can handle them this way?
--
Dan
>From 1f81ad3509a269638444276675ffbb0ce41ec3d3 Mon Sep 17 00:00:00 2001
From: Dan Nicholson <dbn.lists at gmail.com>
Date: Sun, 8 Jun 2008 17:04:11 -0700
Subject: [PATCH] pkg-config support for libdvdnav and libdvdnavmini
---
Makefile | 29 +++++++++++++++++++++++++----
configure.ac | 2 ++
misc/Makefile.am | 3 +++
misc/libdvdnav.pc.in | 12 ++++++++++++
misc/libdvdnavmini.pc.in | 11 +++++++++++
5 files changed, 53 insertions(+), 4 deletions(-)
create mode 100644 misc/libdvdnav.pc.in
create mode 100644 misc/libdvdnavmini.pc.in
diff --git a/Makefile b/Makefile
index 5595842..9c1f7bb 100644
--- a/Makefile
+++ b/Makefile
@@ -39,13 +39,13 @@ DEPS= ${OBJS:%.o=%.d}
BUILDDEPS = Makefile config.mak
ifeq ($(BUILD_SHARED),yes)
-all: $(SHLIB) $(MINI_SHLIB) dvdnav-config
-install: $(SHLIB) install-shared install-dvdnav-config
+all: $(SHLIB) $(MINI_SHLIB) dvdnav-config pkgconfig
+install: $(SHLIB) install-shared install-dvdnav-config install-pkgconfig
endif
ifeq ($(BUILD_STATIC),yes)
-all: $(LIB) dvdnav-config
-install: $(LIB) install-static install-dvdnav-config
+all: $(LIB) dvdnav-config pkgconfig
+install: $(LIB) install-static install-dvdnav-config install-pkgconfig
endif
install: install-headers
@@ -140,6 +140,27 @@ install-dvdnav-config: dvdnav-config
install -d $(DESTDIR)$(PREFIX)/bin
install -m 0755 $(.OBJDIR)/dvdnav-config $(DESTDIR)$(PREFIX)/bin/dvdnav-config
+pcedit = sed \
+ -e 's, at prefix@,$(PREFIX),' \
+ -e 's, at exec_prefix@,$(PREFIX),' \
+ -e 's, at libdir@,$(shlibdir),' \
+ -e 's, at includedir@,$(PREFIX)/include,' \
+ -e 's, at VERSION@,$(SHLIB_VERSION),' \
+ -e 's, at THREAD_CFLAGS@,,' \
+ -e 's, at THREAD_LIBS@,$(THREADLIB),' \
+ -e 's, at DVDREAD_CFLAGS@,$(DVDREAD_CFLAGS),'
+
+pkgconfig: $(.OBJDIR)/libdvdnav.pc $(.OBJDIR)/libdvdnavmini.pc
+$(.OBJDIR)/libdvdnav.pc: misc/libdvdnav.pc.in $(.OBJDIR)
+ $(pcedit) $< > $@
+$(.OBJDIR)/libdvdnavmini.pc: misc/libdvdnavmini.pc.in $(.OBJDIR)
+ $(pcedit) $< > $@
+
+install-pkgconfig: $(.OBJDIR)/libdvdnav.pc $(.OBJDIR)/libdvdnavmini.pc
+ install -d $(DESTDIR)$(libdir)/pkgconfig
+ install -m 0644 $(.OBJDIR)/libdvdnav.pc $(DESTDIR)$(libdir)/pkgconfig
+ install -m 0644 $(.OBJDIR)/libdvdnavmini.pc \
+ $(DESTDIR)$(libdir)/pkgconfig
vpath %.so ${.OBJDIR}
vpath %.o ${.OBJDIR}
diff --git a/configure.ac b/configure.ac
index 970827b..632ebca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -251,6 +251,8 @@ src/Makefile
src/vm/Makefile
misc/Makefile
misc/dvdnav-config
+misc/libdvdnav.pc
+misc/libdvdnavmini.pc
misc/libdvdnav.spec
misc/relchk.sh
m4/Makefile
diff --git a/misc/Makefile.am b/misc/Makefile.am
index 7047018..baf5fb9 100644
--- a/misc/Makefile.am
+++ b/misc/Makefile.am
@@ -3,3 +3,6 @@ include $(top_srcdir)/misc/Makefile.common
EXTRA_DIST = dvdnav-config.in libdvdnav.spec.in libdvdnav.spec Makefile.common relchk.sh relchk.sh.in
bin_SCRIPTS = dvdnav-config
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libdvdnav.pc libdvdnavmini.pc
diff --git a/misc/libdvdnav.pc.in b/misc/libdvdnav.pc.in
new file mode 100644
index 0000000..a15f908
--- /dev/null
+++ b/misc/libdvdnav.pc.in
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libdvdnav
+Description: DVD Navigation library
+Version: @VERSION@
+
+Requires: dvdread
+Cflags: -I${includedir} @THREAD_CFLAGS@
+Libs: -L${libdir} -ldvdnav @THREAD_LIBS@
diff --git a/misc/libdvdnavmini.pc.in b/misc/libdvdnavmini.pc.in
new file mode 100644
index 0000000..52945b3
--- /dev/null
+++ b/misc/libdvdnavmini.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libdvdnavmini
+Description: DVD Navigation mini library
+Version: @VERSION@
+
+Cflags: -I${includedir} @DVDREAD_CFLAGS@ @THREAD_CFLAGS@
+Libs: -L${libdir} -ldvdnav @THREAD_LIBS@
--
1.5.6.2
More information about the DVDnav-discuss
mailing list