option(ZLIB_DUAL_LINK "Dual link tests against system zlib" OFF)
option(WITH_FUZZERS "Build test/fuzz" OFF)
option(WITH_OPTIM "Build with optimisation" ON)
+option(WITH_REDUCED_MEM "Reduced memory usage for special cases (reduces performance)" ON)
option(WITH_NEW_STRATEGIES "Use new strategies" ON)
option(WITH_NATIVE_INSTRUCTIONS
"Instruct the compiler to use the full instruction set on this host (gcc/clang -march=native)" OFF)
mark_as_advanced(FORCE
ZLIB_DUAL_LINK
+ WITH_REDUCED_MEM
WITH_ACLE WITH_NEON
WITH_DFLTCC_DEFLATE
WITH_DFLTCC_INFLATE
add_definitions(-DINFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR)
message(STATUS "Inflate zero data for invalid distances enabled")
endif()
+#
+# Enable reduced memory configuration
+#
+if(WITH_REDUCED_MEM)
+ add_definitions(-DHASH_SIZE=32768u -DGZBUFSIZE=8192)
+ message(STATUS "Configured for reduced memory environment")
+endif()
set(ZLIB_ARCH_SRCS)
noltoflag="-fno-lto"
without_optimizations=0
without_new_strategies=0
+reducedmem=0
gcc=0
warn=0
debug=0
echo ' [--without-neon] Compiles without ARM Neon SIMD instruction set' | tee -a configure.log
echo ' [--with-dfltcc-deflate] Use DEFLATE CONVERSION CALL instruction for compression on IBM Z' | tee -a configure.log
echo ' [--with-dfltcc-inflate] Use DEFLATE CONVERSION CALL instruction for decompression on IBM Z' | tee -a configure.log
+ echo ' [--with-reduced-mem] Reduced memory usage for special cases (reduces performance)' | tee -a configure.log
echo ' [--force-sse2] Assume SSE2 instructions are always available (disabled by default on x86, enabled on x86_64)' | tee -a configure.log
echo ' [--with-sanitizer] Build with sanitizer (memory, address, undefined)' | tee -a configure.log
echo ' [--with-fuzzers] Build test/fuzz (disabled by default)' | tee -a configure.log
--without-neon) buildneon=0; shift ;;
--with-dfltcc-deflate) builddfltccdeflate=1; shift ;;
--with-dfltcc-inflate) builddfltccinflate=1; shift ;;
+ --with-reduced-mem) reducedmem=1; shift ;;
--force-sse2) forcesse2=1; shift ;;
-n | --native) native=1; shift ;;
-a*=* | --archs=*) ARCHS=$(echo $1 | sed 's/.*=//'); shift ;;
PIC_OBJC="${PIC_OBJC} \$(PIC_OBJG)"
fi
+# enable reduced memory configuration
+if test $reducedmem -eq 1; then
+ echo "Configuring for reduced memory environment." | tee -a configure.log
+ CFLAGS="${CFLAGS} -DHASH_SIZE=32768u -DGZBUFSIZE=8192"
+fi
+
# if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
if test $cover -eq 1; then
CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"