[DVDnav-discuss] r1117 - in trunk/libdvdnav: Makefile configure.ac misc/Makefile.am misc/dvdnav.pc.in misc/dvdnavmini.pc.in

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


Author: rathann
Date: Sun Jul 13 23:13:40 2008
New Revision: 1117

Log:
Merge Dan's autotools pkgconfig support.


Added:
   trunk/libdvdnav/misc/dvdnav.pc.in
   trunk/libdvdnav/misc/dvdnavmini.pc.in
Modified:
   trunk/libdvdnav/Makefile
   trunk/libdvdnav/configure.ac
   trunk/libdvdnav/misc/Makefile.am

Modified: trunk/libdvdnav/Makefile
==============================================================================
--- trunk/libdvdnav/Makefile	(original)
+++ trunk/libdvdnav/Makefile	Sun Jul 13 23:13:40 2008
@@ -40,12 +40,12 @@ BUILDDEPS = Makefile config.mak
 
 ifeq ($(BUILD_SHARED),yes)
 all:	$(SHLIB) $(MINI_SHLIB) dvdnav-config
-install: $(SHLIB) install-shared install-dvdnav-config install-dvdnav.pc
+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 install-dvdnav.pc
+install: $(LIB) install-static install-dvdnav-config install-pkgconfig
 endif
 
 install: install-headers
@@ -119,6 +119,27 @@ install-static: $(LIB)
 clean:
 	rm -rf  *~ $(.OBJDIR) version.h
 
+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)/dvdnav.pc $(.OBJDIR)/dvdnavmini.pc
+$(.OBJDIR)/dvdnav.pc: misc/dvdnav.pc.in $(.OBJDIR)
+	$(pcedit) $< > $@
+$(.OBJDIR)/dvdnavmini.pc: misc/dvdnavmini.pc.in $(.OBJDIR)
+	$(pcedit) $< > $@
+
+install-pkgconfig: $(.OBJDIR)/dvdnav.pc $(.OBJDIR)/dvdnavmini.pc
+	install -d $(DESTDIR)$(libdir)/pkgconfig
+	install -m 0644 $(.OBJDIR)/dvdnav.pc $(DESTDIR)$(libdir)/pkgconfig
+	install -m 0644 $(.OBJDIR)/dvdnavmini.pc \
+	  $(DESTDIR)$(libdir)/pkgconfig
 
 distclean: clean
 	find . -name "*~" | xargs rm -rf
@@ -140,24 +161,6 @@ install-dvdnav-config: dvdnav-config
 	install -d $(DESTDIR)$(PREFIX)/bin
 	install -m 0755 $(.OBJDIR)/dvdnav-config $(DESTDIR)$(PREFIX)/bin/dvdnav-config
 
-dvdnav.pc: $(.OBJDIR)
-	@echo 'prefix=$(PREFIX)' > $(.OBJDIR)/dvdnav.pc
-	@echo 'libdir=$(shlibdir)' >> $(.OBJDIR)/dvdnav.pc
-	@echo 'includedir=$(PREFIX)/include' >> $(.OBJDIR)/dvdnav.pc
-	@echo 'minilibs=-L$${libdir} -ldvdnavmini $(THREADLIB)' >> $(.OBJDIR)/dvdnav.pc
-	@echo >> $(.OBJDIR)/dvdnav.pc
-	@echo 'Libs: -L$${libdir} -ldvdnav $(THREADLIB)' >> $(.OBJDIR)/dvdnav.pc
-	@echo 'Cflags: -I$${includedir}' >> $(.OBJDIR)/dvdnav.pc
-	@echo 'Requires.private: dvdread >= 4.1.2' >> $(.OBJDIR)/dvdnav.pc
-	@echo >> $(.OBJDIR)/dvdnav.pc
-	@echo 'Name: dvdnav' >> $(.OBJDIR)/dvdnav.pc
-	@echo 'Description: High-level library for reading DVDs' >> $(.OBJDIR)/dvdnav.pc
-	@echo 'Version: $(SHLIB_VERSION)' >> $(.OBJDIR)/dvdnav.pc
-
-install-dvdnav.pc: dvdnav.pc
-	install -d $(DESTDIR)$(shlibdir)/pkgconfig
-	install -m 0644 $(.OBJDIR)/dvdnav.pc $(DESTDIR)$(shlibdir)/pkgconfig/dvdnav.pc
-
 vpath %.so ${.OBJDIR}
 vpath %.o ${.OBJDIR}
 vpath ${LIB} ${.OBJDIR}

Modified: trunk/libdvdnav/configure.ac
==============================================================================
--- trunk/libdvdnav/configure.ac	(original)
+++ trunk/libdvdnav/configure.ac	Sun Jul 13 23:13:40 2008
@@ -243,6 +243,8 @@ src/Makefile
 src/vm/Makefile
 misc/Makefile
 misc/dvdnav-config
+misc/dvdnav.pc
+misc/dvdnavmini.pc
 misc/libdvdnav.spec
 misc/relchk.sh
 m4/Makefile

Modified: trunk/libdvdnav/misc/Makefile.am
==============================================================================
--- trunk/libdvdnav/misc/Makefile.am	(original)
+++ trunk/libdvdnav/misc/Makefile.am	Sun Jul 13 23:13:40 2008
@@ -3,3 +3,6 @@ include $(top_srcdir)/misc/Makefile.comm
 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 = dvdnav.pc dvdnavmini.pc

Added: trunk/libdvdnav/misc/dvdnav.pc.in
==============================================================================
--- (empty file)
+++ trunk/libdvdnav/misc/dvdnav.pc.in	Sun Jul 13 23:13:40 2008
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libdvdnav
+Description: DVD Navigation library
+Version: @VERSION@
+
+Requires.private: dvdread >= 4.1.2
+Cflags: -I${includedir} @THREAD_CFLAGS@
+Libs: -L${libdir} -ldvdnav @THREAD_LIBS@

Added: trunk/libdvdnav/misc/dvdnavmini.pc.in
==============================================================================
--- (empty file)
+++ trunk/libdvdnav/misc/dvdnavmini.pc.in	Sun Jul 13 23:13:40 2008
@@ -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@



More information about the DVDnav-discuss mailing list