diff options
author | Tamas TEVESZ <ice@extreme.hu> | 2017-02-12 11:44:24 +0100 |
---|---|---|
committer | Tamas TEVESZ <ice@extreme.hu> | 2017-02-12 11:44:24 +0100 |
commit | b0bd0da696481fa7f6a97e1236e219e29b51b9e4 (patch) | |
tree | 4557207c5ec2ef3635cd4c2194c22dfff4f13b41 | |
parent | a25110b16c1f1bdf55e96c2ad4501f602bb47855 (diff) |
Autodetect XLSX support
Both libzip and libXML have pkg-config files. Exploit this fact
to autodetect whether XLSX support may be compiled.
-rw-r--r-- | src/Makefile | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile index 512b81c..5e98400 100644 --- a/src/Makefile +++ b/src/Makefile @@ -55,9 +55,10 @@ CFLAGS += -DUSELOCALE #CFLAGS += -DXLS #LDLIBS += -lxlsreader -# Uncomment for basic XLSX support. Requires libzip and libxml2 -#CFLAGS += -DXLSX -I/usr/include/libxml2 -#LDLIBS += -lzip -lxml2 +ifneq ($(shell pkg-config --exists libzip libxml-2.0 || echo 'no'),no) +CFLAGS += -DXLSX $(shell pkg-config --cflags libxml-2.0 libzip) +LDLIBS += $(shell pkg-config --libs libxml-2.0 libzip) +endif OBJS = $(patsubst %.c, %.o, $(wildcard *.c) $(wildcard utils/*.c)) gram.o |