diff GNUmakefile @ 303:48a09c9d3d00

core: make zstd optional
author David Demelier <markand@malikania.fr>
date Thu, 24 Jun 2021 20:30:41 +0200
parents f09c166fd4d4
children 3ccf841ca1fe
line wrap: on
line diff
--- a/GNUmakefile	Thu Jun 24 20:22:47 2021 +0200
+++ b/GNUmakefile	Thu Jun 24 20:30:41 2021 +0200
@@ -30,6 +30,7 @@
 # Compile time options.
 NLS=                    1
 COMPRESS=               1
+ZSTD=                   1
 
 LIBMLK_SQLITE=          extern/libsqlite/libmlk-sqlite.a
 LIBMLK_SQLITE_SRCS=     extern/libsqlite/sqlite3.c
@@ -207,8 +208,10 @@
 JANSSON_INCS:=          $(shell pkg-config --cflags jansson)
 JANSSON_LIBS:=          $(shell pkg-config --libs jansson)
 
+ifeq (${ZSTD},1)
 ZSTD_INCS:=             $(shell pkg-config --cflags libzstd)
 ZSTD_LIBS:=             $(shell pkg-config --libs libzstd)
+endif
 
 INCS=                   -I. \
                         -Iextern/libsqlite \
@@ -231,6 +234,13 @@
 SED.nls=                /@define WITH_NLS@/d
 endif
 
+ifeq (${ZSTD},1)
+LIBS+=                  -lintl
+SED.zstd=               s/@define WITH_ZSTD@/\#define MOLKO_WITH_ZSTD/
+else
+SED.zstd=               /@define WITH_ZSTD@/d
+endif
+
 # Can't use standard input otherwise frame content size isn't available.
 ifeq (${COMPRESS},1)
 TILESET.cmd=            ${MLK_TILESET} < $< > $@.tmp && zstd -17 $@.tmp --rm -fqo $@
@@ -247,7 +257,8 @@
 
 config.h: config.h.in
 	@echo "SED  $<"
-	@sed -e "${SED.nls}" < $< > $@
+	@sed -e "${SED.nls}" \
+		-e "${SED.zstd}" < $< > $@
 
 .c.o:
 	@echo "CC   $<"