aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-01-21 11:44:55 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-01-21 11:44:55 -0800
commit3dca23aa0deb3d14ec97d998e1b37b3c2c403d65 (patch)
tree5040cc95bb2da2c4e13d202ebd6889822897051c /templates
parent65eb565e92914a3ccb19b8282421977ceda885b3 (diff)
Make zlib a first class build citizen
Diffstat (limited to 'templates')
-rw-r--r--templates/Makefile.template27
1 files changed, 14 insertions, 13 deletions
diff --git a/templates/Makefile.template b/templates/Makefile.template
index 4353a0de3a..ea9001c3b0 100644
--- a/templates/Makefile.template
+++ b/templates/Makefile.template
@@ -542,14 +542,21 @@
PC_LIBS_GRPC =
ifeq ($(HAS_SYSTEM_ZLIB),false)
- ifeq ($(HAS_EMBEDDED_ZLIB),true)
- ZLIB_DEP = $(LIBDIR)/$(CONFIG)/zlib/libz.a
- ZLIB_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/zlib/libz.a
- CPPFLAGS += -Ithird_party/zlib
- LDFLAGS += -L$(LIBDIR)/$(CONFIG)/zlib
+ ifeq ($(HAS_EMBEDDED_ZLIB), true)
+ EMBED_ZLIB ?= true
else
DEP_MISSING += zlib
+ EMBED_ZLIB ?= broken
+ endif
+ else
+ EMBED_ZLIB ?= false
endif
+
+ ifeq ($(EMBED_ZLIB),true)
+ ZLIB_DEP = $(LIBDIR)/$(CONFIG)/libz.a
+ ZLIB_MERGE_LIBS = $(LIBDIR)/$(CONFIG)/libz.a
+ CPPFLAGS += -Ithird_party/zlib
+ LDFLAGS += -L$(LIBDIR)/$(CONFIG)/zlib
else
ifeq ($(HAS_PKG_CONFIG),true)
CPPFLAGS += $(shell $(PKG_CONFIG) --cflags zlib)
@@ -849,14 +856,6 @@
$(PROTOC_CHECK_VERSION_CMD) || true
$(ZOOKEEPER_CHECK_CMD) || true
- $(LIBDIR)/$(CONFIG)/zlib/libz.a:
- $(E) "[MAKE] Building zlib"
- $(Q)(cd third_party/zlib ; CC="$(CC)" CFLAGS="$(CFLAGS_$(CONFIG)) $(PIC_CPPFLAGS) -fvisibility=hidden $(CPPFLAGS_$(CONFIG)) $(ZLIB_CFLAGS_EXTRA)" ./configure --static)
- $(Q)$(MAKE) -C third_party/zlib clean
- $(Q)$(MAKE) -C third_party/zlib
- $(Q)mkdir -p $(LIBDIR)/$(CONFIG)/zlib
- $(Q)cp third_party/zlib/libz.a $(LIBDIR)/$(CONFIG)/zlib
-
third_party/protobuf/configure:
$(E) "[AUTOGEN] Preparing protobuf"
$(Q)(cd third_party/protobuf ; autoreconf -f -i -Wall,no-obsolete)
@@ -1528,6 +1527,8 @@
$(LIB${lib.name.upper()}_OBJS): CFLAGS := -Ithird_party/boringssl/include $(CFLAGS) -Wno-sign-conversion -Wno-conversion -Wno-unused-value -fvisibility=hidden
$(LIB${lib.name.upper()}_OBJS): CXXFLAGS := -Ithird_party/boringssl/include $(CXXFLAGS) -fvisibility=hidden
$(LIB${lib.name.upper()}_OBJS): CPPFLAGS += -DOPENSSL_NO_ASM -D_GNU_SOURCE
+ % elif lib.zlib:
+ $(LIB${lib.name.upper()}_OBJS): CFLAGS := $(CFLAGS) -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-implicit-function-declaration -fvisibility=hidden
% else:
% endif