Add girara version check.

This commit is contained in:
Sebastian Ramacher 2012-03-16 13:32:09 +01:00
parent 45dad09deb
commit 66d6b27c00
3 changed files with 16 additions and 3 deletions

1
.gitignore vendored
View file

@ -17,3 +17,4 @@ doc/
*.tmp
zathura.1
zathurarc.5
girara-version-check

View file

@ -25,6 +25,12 @@ DOBJECTS = $(patsubst %.c, %.do, $(SOURCE))
all: options ${PROJECT} po build-manpages
girara-version-check:
ifneq ($(GIRARA_VERSION_CHECK), 0)
$(error "The minimum required version of girara is ${GIRARA_MIN_VERSION}")
endif
$(QUIET)touch girara-version-check
options:
@echo ${PROJECT} build options:
@echo "CFLAGS = ${CFLAGS}"
@ -48,8 +54,8 @@ version.h: version.h.in config.mk
@mkdir -p .depend
$(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} ${DFLAGS} -o $@ $< -MMD -MF .depend/$@.dep
${OBJECTS}: config.mk version.h
${DOBJECTS}: config.mk version.h
${OBJECTS}: config.mk version.h girara-version-check
${DOBJECTS}: config.mk version.h girara-version-check
${PROJECT}: ${OBJECTS}
$(ECHO) CC -o $@
@ -58,7 +64,8 @@ ${PROJECT}: ${OBJECTS}
clean:
$(QUIET)rm -rf ${PROJECT} ${OBJECTS} ${PROJECT}-${VERSION}.tar.gz \
${DOBJECTS} ${PROJECT}-debug .depend ${PROJECT}.pc doc version.h \
*gcda *gcno $(PROJECT).info gcov *.tmp ${PROJECT}.1 ${PROJECT}rc.5
*gcda *gcno $(PROJECT).info gcov *.tmp ${PROJECT}.1 ${PROJECT}rc.5 \
girara-version-check
$(QUIET)make -C tests clean
$(QUIET)make -C po clean

View file

@ -11,6 +11,11 @@ VERSION = ${ZATHURA_VERSION_MAJOR}.${ZATHURA_VERSION_MINOR}.${ZATHURA_VERSION_RE
# note: zathura with GTK+ 3 is broken!
ZATHURA_GTK_VERSION ?= 2
# minimum required zathura version
# If you want to disable the check, set GIRARA_VERSION_CHECK to 0.
GIRARA_MIN_VERSION = 0.1.1
GIRARA_VERSION_CHECK ?= $(shell pkg-config --atleast-version=$(GIRARA_MIN_VERSION) girara-gtk${ZATHURA_GTK_VERSION}; echo $$?)
# database
# To disable support for the sqlite backend set WITH_SQLITE to 0.
WITH_SQLITE ?= $(shell (pkg-config --exists sqlite3 && echo 1) || echo 0)