From 2c9faa70ea36e40bd787915215e8165b9c7328d9 Mon Sep 17 00:00:00 2001 From: Anshul Maheshwari Date: Wed, 7 Jan 2015 19:57:57 +0100 Subject: [PATCH] give error message with ENABLE_OCR --- linux/Makefile | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/linux/Makefile b/linux/Makefile index 9471b4c5..6e2a7c1d 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -42,11 +42,31 @@ INSTLALL_PROGRAM = $(INSTLALL) DESTDIR = /usr/bin ifeq ($(ENABLE_OCR),yes) -CFLAGS+=-I/usr/local/include/tesseract -I/usr/local/include/leptonica CFLAGS+=-DENABLE_OCR -LDFLAGS+= $(shell pkg-config --libs tesseract) -LDFLAGS+= $(shell pkg-config --libs lept) +TESS_LDFLAGS+= $(shell pkg-config --libs tesseract) +LEPT_LDFLAGS+= $(shell pkg-config --libs lept) + +#error checking of library are there or not +ifeq ($(TESS_LDFLAGS),$(EMPTY)) +$(error **ERROR** "tesseract not found") +else +#TODO print the version of library found +$(info "tesseract found") endif +ifeq ($(LEPT_LDFLAGS),$(EMPTY)) +$(error **ERROR** "leptonica not found") +else +#TODO print the version of library found +$(info "Leptonica found") +endif + +CFLAGS += $(shell pkg-config --cflags tesseract) +CFLAGS += $(shell pkg-config --cflags lept) +LDFLAGS += $(TESS_LDFLAGS) +LDFLAGS += $(LEPT_LDFLAGS) +endif + + ifeq ($(ENABLE_FFMPEG),yes) CFLAGS+=-DENABLE_FFMPEG CFLAGS+= $(shell pkg-config --cflags libavcodec)