diff --git a/.gitignore b/.gitignore index e397f08..f357c42 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ doc/ *.tmp zathura.1 zathurarc.5 +girara-version-check diff --git a/Makefile b/Makefile index 7e51369..5814feb 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/config.mk b/config.mk index bf4081f..d5535dd 100644 --- a/config.mk +++ b/config.mk @@ -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)