[DVDnav-discuss] r1115 - in trunk/libdvdread: Makefile configure.ac misc/Makefile.am misc/dvdread.pc.in

rathann subversion at mplayerhq.hu
Sun Jul 13 23:11:09 CEST 2008


Author: rathann
Date: Sun Jul 13 23:11:08 2008
New Revision: 1115

Log:
Merge Dan's autotools pkgconfig support.


Added:
   trunk/libdvdread/misc/dvdread.pc.in
Modified:
   trunk/libdvdread/Makefile
   trunk/libdvdread/configure.ac
   trunk/libdvdread/misc/Makefile.am

Modified: trunk/libdvdread/Makefile
==============================================================================
--- trunk/libdvdread/Makefile	(original)
+++ trunk/libdvdread/Makefile	Sun Jul 13 23:11:08 2008
@@ -50,12 +50,12 @@ BUILDDEPS = Makefile config.mak
 
 ifeq ($(BUILD_SHARED),yes)
 all:	$(SHLIB) $(DVDREAD_SHLIB) dvdread-config
-install: $(SHLIB) $(DVDREAD_SHLIB) install-shared install-dvdread-config install-dvdread.pc
+install: $(SHLIB) $(DVDREAD_SHLIB) install-shared install-dvdread-config install-pkgconfig
 endif
 
 ifeq ($(BUILD_STATIC),yes)
 all:	$(LIB) $(DVDREAD_LIB) dvdread-config
-install: $(LIB) $(DVDREAD_LIB) install-static install-dvdread-config install-dvdread.pc
+install: $(LIB) $(DVDREAD_LIB) install-static install-dvdread-config install-pkgconfig
 endif
 
 install: install-headers
@@ -146,21 +146,20 @@ install-dvdread-config: dvdread-config
 	install -d $(DESTDIR)$(PREFIX)/bin
 	install -m 0755 $(.OBJDIR)/dvdread-config $(DESTDIR)$(PREFIX)/bin/dvdread-config
 
-dvdread.pc: $(.OBJDIR)
-	@echo 'prefix=$(PREFIX)' > $(.OBJDIR)/dvdread.pc
-	@echo 'libdir=$(shlibdir)' >> $(.OBJDIR)/dvdread.pc
-	@echo 'includedir=$(PREFIX)/include' >> $(.OBJDIR)/dvdread.pc
-	@echo >> $(.OBJDIR)/dvdread.pc
-	@echo 'Libs: -L$${libdir} -ldvdread' >> $(.OBJDIR)/dvdread.pc
-	@echo 'Cflags: -I$${includedir}' >> $(.OBJDIR)/dvdread.pc
-	@echo >> $(.OBJDIR)/dvdread.pc
-	@echo 'Name: dvdread' >> $(.OBJDIR)/dvdread.pc
-	@echo 'Description: Library for reading DVDs' >> $(.OBJDIR)/dvdread.pc
-	@echo 'Version: $(SHLIB_VERSION)' >> $(.OBJDIR)/dvdread.pc
+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),'
 
-install-dvdread.pc: dvdread.pc
-	install -d $(DESTDIR)$(shlibdir)/pkgconfig
-	install -m 0644 $(.OBJDIR)/dvdread.pc $(DESTDIR)$(shlibdir)/pkgconfig/dvdread.pc
+pkgconfig: $(.OBJDIR)/dvdread.pc
+$(.OBJDIR)/dvdread.pc: misc/dvdread.pc.in $(.OBJDIR)
+	$(pcedit) $< > $@
+
+install-pkgconfig: $(.OBJDIR)/dvdread.pc
+	install -d $(DESTDIR)$(libdir)/pkgconfig
+	install -m 0644 $(.OBJDIR)/dvdread.pc $(DESTDIR)$(libdir)/pkgconfig
 
 vpath %.so ${.OBJDIR}
 vpath %.o ${.OBJDIR}

Modified: trunk/libdvdread/configure.ac
==============================================================================
--- trunk/libdvdread/configure.ac	(original)
+++ trunk/libdvdread/configure.ac	Sun Jul 13 23:11:08 2008
@@ -203,6 +203,7 @@ Makefile 
 src/Makefile
 misc/Makefile
 misc/dvdread-config
+misc/dvdread.pc
 misc/libdvdread.spec
 misc/relchk.sh
 m4/Makefile

Modified: trunk/libdvdread/misc/Makefile.am
==============================================================================
--- trunk/libdvdread/misc/Makefile.am	(original)
+++ trunk/libdvdread/misc/Makefile.am	Sun Jul 13 23:11:08 2008
@@ -3,3 +3,6 @@ include $(top_srcdir)/misc/Makefile.comm
 EXTRA_DIST = libdvdread.spec.in libdvdread.spec Makefile.common relchk.sh relchk.sh.in
 
 bin_SCRIPTS = dvdread-config
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = dvdread.pc

Added: trunk/libdvdread/misc/dvdread.pc.in
==============================================================================
--- (empty file)
+++ trunk/libdvdread/misc/dvdread.pc.in	Sun Jul 13 23:11:08 2008
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libdvdread
+Description: Low level DVD access library
+Version: @VERSION@
+
+Cflags: -I${includedir}
+Libs: -L${libdir} -ldvdread



More information about the DVDnav-discuss mailing list