From 81f2cb6b3b124677c5313d408bc5331ef4822641 Mon Sep 17 00:00:00 2001 From: Giulio Benetti Date: Tue, 7 Jan 2020 09:22:45 -0700 Subject: [PATCH] Bug 1603438 - Fix native tools build failure due to lack of zlib include dir if external r=jcj Add ZLIB_INCLUDE_DIR variable On Linux platform[1], the build system forces to use zlib from the system instead of compiling the one located intree. The following error is raised when the zlib header is installed somewhere else than in the default system include path: ssl3con.c:39:18: fatal error: zlib.h: No such file or directory #include "zlib.h" The same trick setup for sqlite include directory is reproduced for zlib. The build system disallows in any manner to give arguments to the compiler explicity. The variable ZLIB_INCLUDE_DIR point to the directory where the zlib header is located. [1]: https://hg.mozilla.org/projects/nss/file/NSS_3_33_BRANCH/coreconf/Linux.mk#l180 [2]: https://hg.mozilla.org/projects/nss/file/NSS_3_33_BRANCH/lib/softoken/manifest.mn#l17 --HG-- extra : rebase_source : c44bcaeb505ac2df346e2f9886a3f6d0d9e4c43c extra : amend_source : a9cb45d7e7d48c1993b4eedceb4220865b9c2b13 --- cmd/signtool/manifest.mn | 4 ++++ lib/ssl/manifest.mn | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/cmd/signtool/manifest.mn b/cmd/signtool/manifest.mn index 40be262dba..d1b9d48c0a 100644 --- a/cmd/signtool/manifest.mn +++ b/cmd/signtool/manifest.mn @@ -6,6 +6,10 @@ CORE_DEPTH = ../.. MODULE = nss +ifdef ZLIB_INCLUDE_DIR +INCLUDES += -I$(ZLIB_INCLUDE_DIR) +endif + EXPORTS = CSRCS = signtool.c \ diff --git a/lib/ssl/manifest.mn b/lib/ssl/manifest.mn index 83df8c0b87..ac37c8648c 100644 --- a/lib/ssl/manifest.mn +++ b/lib/ssl/manifest.mn @@ -5,6 +5,10 @@ CORE_DEPTH = ../.. # DEFINES = -DTRACE +ifdef ZLIB_INCLUDE_DIR +INCLUDES += -I$(ZLIB_INCLUDE_DIR) +endif + EXPORTS = \ ssl.h \ sslt.h \