From 99cd38078e3865c4676bb2fb34f72f4957c948bb Mon Sep 17 00:00:00 2001 From: Oren Kladnitsky Date: Tue, 14 Jan 2014 14:42:27 +0200 Subject: [PATCH] Fix support of --disable-dc configure flag --- configure.ac | 6 +----- flint/Makefile.am | 9 ++++++++- flint/subcommands.cpp | 9 ++++++++- mlxfwops/lib/flint_base.h | 5 ----- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 0c7d2b5..cf6440c 100644 --- a/configure.ac +++ b/configure.ac @@ -27,13 +27,9 @@ AC_MSG_RESULT($enable_dc) if test "$enable_dc" = "yes"; then AC_CHECK_HEADER(zlib.h,,AC_MSG_ERROR([cannot find zlib.h . Use --disable-dc to remove this dependaency])) AC_CHECK_LIB(z, uncompress,, AC_MSG_ERROR([cannot find zlib uncompress() function. Use --disable-dc to remove this dependaency])) - mstflint_LIBS="-lz" -else - mstflint_CXXFLAGS="-DNO_ZLIB" fi -AC_SUBST(mstflint_LIBS) -AC_SUBST(mstflint_CXXFLAGS) +AM_CONDITIONAL(ENABLE_DC, [test "x$enable_dc" = "xyes"]) AC_MSG_CHECKING(--enable-inband argument) AC_ARG_ENABLE(inband, diff --git a/flint/Makefile.am b/flint/Makefile.am index 6d407bf..782c211 100755 --- a/flint/Makefile.am +++ b/flint/Makefile.am @@ -50,5 +50,12 @@ mstflint_LDADD = ../mlxfwops/lib/libmlxfwops.a \ ../mflash/libmflash.a \ ../mtcr_ul/libmtcr_ul.a \ ../tools_layouts/libtools_layouts.a \ - $(ZLIB_LIB) $(LAYOUTS_LIB) $(LIBSTD_CPP) -ldl + $(LAYOUTS_LIB) $(LIBSTD_CPP) -ldl + + +if ENABLE_DC +mstflint_LDADD += -lz +else +mstflint_CXXFLAGS += -DNO_ZLIB +endif diff --git a/flint/subcommands.cpp b/flint/subcommands.cpp index c36793b..1f47e6e 100644 --- a/flint/subcommands.cpp +++ b/flint/subcommands.cpp @@ -40,6 +40,10 @@ #include #include +#ifndef NO_ZLIB +#include +#endif + using namespace std; #define INDENT "\t\t\t\t\t " @@ -941,7 +945,10 @@ bool SubCommand::unzipDataFile (std::vector data, std::vector -#endif - - #include #include #include "compatibility.h" -- 2.46.0