[DVDnav-discuss] r1114 - in trunk/libdvdnav: Makefile configure2

rathann subversion at mplayerhq.hu
Sun Jul 13 21:05:45 CEST 2008


Author: rathann
Date: Sun Jul 13 21:05:44 2008
New Revision: 1114

Log:
pkgconfig support


Modified:
   trunk/libdvdnav/Makefile
   trunk/libdvdnav/configure2

Modified: trunk/libdvdnav/Makefile
==============================================================================
--- trunk/libdvdnav/Makefile	(original)
+++ trunk/libdvdnav/Makefile	Sun Jul 13 21:05:44 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: $(SHLIB) install-shared install-dvdnav-config install-dvdnav.pc
 endif
 
 ifeq ($(BUILD_STATIC),yes)
 all:	$(LIB) dvdnav-config
-install: $(LIB) install-static install-dvdnav-config
+install: $(LIB) install-static install-dvdnav-config install-dvdnav.pc
 endif
 
 install: install-headers
@@ -140,6 +140,23 @@ 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}

Modified: trunk/libdvdnav/configure2
==============================================================================
--- trunk/libdvdnav/configure2	(original)
+++ trunk/libdvdnav/configure2	Sun Jul 13 21:05:44 2008
@@ -103,13 +103,12 @@ test -z "$libdir" && libdir=$PREFIX/lib
 test -z "$shlibdir" && shlibdir=$PREFIX/lib
 test -z "$incdir" && incdir=$PREFIX/include/dvdnav
 
-DVDREAD=`$DVDREAD_CONFIG --prefix`
-if test -z "$DVDREAD" ; then
-  echo "dvdread-config --prefix returned an error. Can't proceed"
-  exit 1
-fi
 dvdread_cflags=`$DVDREAD_CONFIG --cflags`
 dvdread_libs=`$DVDREAD_CONFIG --libs`
+if test -z "$dvdread_cflags" ; then
+  echo "$DVDREAD_CONFIG --cflags returned an error. Can't proceed"
+  exit 1
+fi
 
 
 targetos=`uname -s`



More information about the DVDnav-discuss mailing list