Commit 8abe5cf1 authored by Dan Nicholson's avatar Dan Nicholson

autotools pkgconfig support.

parent 9c1171d7
......@@ -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
install-dvdread.pc: dvdread.pc
install -d $(DESTDIR)$(shlibdir)/pkgconfig
install -m 0644 $(.OBJDIR)/dvdread.pc $(DESTDIR)$(shlibdir)/pkgconfig/dvdread.pc
pcedit = sed \
-e 's,@prefix@,$(PREFIX),' \
-e 's,@exec_prefix@,$(PREFIX),' \
-e 's,@libdir@,$(shlibdir),' \
-e 's,@includedir@,$(PREFIX)/include,' \
-e 's,@VERSION@,$(SHLIB_VERSION),'
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}
......
......@@ -203,6 +203,7 @@ Makefile
src/Makefile
misc/Makefile
misc/dvdread-config
misc/dvdread.pc
misc/libdvdread.spec
misc/relchk.sh
m4/Makefile
......
......@@ -3,3 +3,6 @@ include $(top_srcdir)/misc/Makefile.common
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
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment