From 4eb08611f064ea9f5d9b73e45c9efbc45e88ac49 Mon Sep 17 00:00:00 2001 From: MIlutinovic Date: Tue, 13 Nov 2018 17:05:25 +0100 Subject: [PATCH] Checking xmlsec as well as gdal --- check_libs.mk | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 check_libs.mk diff --git a/check_libs.mk b/check_libs.mk new file mode 100644 index 0000000..66258b7 --- /dev/null +++ b/check_libs.mk @@ -0,0 +1,86 @@ +GDAL_AVAILABLE := $(shell which gdalinfo) +SWIG_AVAILABLE := $(shell which swig) +XMLSEC_AVAILABLE := $(shell which xmlsec1) + +ifeq ($(OS),Windows_NT) + CCFLAGS += WIN32 +else + UNAME_S := $(shell uname -s) + ifeq ($(UNAME_S),Linux) + CCFLAGS += LINUX + endif + ifeq ($(UNAME_S),Darwin) + CCFLAGS += OSX + endif +endif + +.PHONY: gdal xmlsec + +check_libs: gdal xmlsec + +gdal: +ifeq ($(GDAL_AVAILABLE),) + @echo "${RED}--------------------------------------------------------------------------------------------${NC}" + @echo "---> ${RED}GDAL not found. Please use the command below to install it. ${NC}\n" +ifeq ($(CCFLAGS),OSX) + @echo "\t${RED}brew install gdal --HEAD${NC}" +endif +ifeq ($(CCFLAGS),LINUX) + @echo "\t${RED}sudo add-apt-repository ppa:ubuntugis/ppa; sudo apt-get update; sudo apt-get install gdal-bin && sudo apt-get -y install python-gdal${NC}" +endif + @echo "" + @echo "${RED}--------------------------------------------------------------------------------------------${NC}" + exit 1 +else + @echo "Found GDAL version: $(shell gdalinfo --version), Skipping" +endif + +xmlsec: +ifeq ($(CCFLAGS),OSX) +ifeq ($(shell brew ls --versions libxmlsec1),) + @echo "${RED}--------------------------------------------------------------------------------------------${NC}" + @echo "---> ${RED}XMLSEC not found. Please use the command below to install it. ${NC}\n" + @echo "\t${RED}brew install libxmlsec1${NC}" + @echo "" + @echo "${RED}--------------------------------------------------------------------------------------------${NC}" + exit 1 +else + @echo "Found xmlsec. Skipping" +endif +endif +ifeq ($(CCFLAGS),LINUX) +ifeq ($(XMLSEC_AVAILABLE),) + @echo "${RED}--------------------------------------------------------------------------------------------${NC}" + @echo "---> ${RED}XMLSEC not found. Please use the command below to install it. ${NC}\n" + @echo "\t${RED}apt-get install xmlsec1${NC}" + @echo "" + @echo "${RED}--------------------------------------------------------------------------------------------${NC}" + exit 1 +endif +ifeq ($(SWIG_AVAILABLE),) + @echo "${RED}--------------------------------------------------------------------------------------------${NC}" + @echo "---> ${RED}SWIG not found. Please use the command below to install it. ${NC}\n" + @echo "\t${RED}apt-get install swig${NC}" + @echo "" + @echo "${RED}--------------------------------------------------------------------------------------------${NC}" + exit 1 +endif +ifeq ($(shell dpkg-query --list | grep libxmlsec1-openssl),) + @echo "${RED}--------------------------------------------------------------------------------------------${NC}" + @echo "---> ${RED}libxmlsec1-openssl not found. Please use the command below to install it. ${NC}\n" + @echo "\t${RED}apt-get install libxmlsec1-openssl${NC}" + @echo "" + @echo "${RED}--------------------------------------------------------------------------------------------${NC}" + exit 1 +endif +ifeq ($(shell dpkg-query --list | grep libxmlsec1-dev),) + @echo "${RED}--------------------------------------------------------------------------------------------${NC}" + @echo "---> ${RED}libxmlsec1-openssl not found. Please use the command below to install it. ${NC}\n" + @echo "\t${RED}apt-get install libxmlsec1-dev${NC}" + @echo "" + @echo "${RED}--------------------------------------------------------------------------------------------${NC}" + exit 1 +else + @echo "Found xmlsec. Skipping" +endif +endif \ No newline at end of file -- GitLab