@@ -86,6 +86,7 @@ option(WITH_BENCHMARK_APPS "Build application benchmarks" OFF)
8686option (WITH_OPTIM "Build with optimisation" ON )
8787option (WITH_REDUCED_MEM "Reduced memory usage for special cases (reduces performance)" OFF )
8888option (WITH_NEW_STRATEGIES "Use new strategies" ON )
89+ option (WITH_CRC32_CHORBA "Enable optimized CRC32 algorithm Chorba" ON )
8990option (WITH_NATIVE_INSTRUCTIONS
9091 "Instruct the compiler to use the full instruction set on this host (gcc/clang -march=native)" OFF )
9192option (WITH_RUNTIME_CPU_DETECTION "Build with runtime detection of CPU architecture" ON )
@@ -137,6 +138,7 @@ option(INSTALL_UTILS "Copy minigzip and minideflate during install" OFF)
137138mark_as_advanced (FORCE
138139 ZLIB_SYMBOL_PREFIX
139140 WITH_REDUCED_MEM
141+ WITH_CRC32_CHORBA
140142 WITH_ARMV8 WITH_NEON
141143 WITH_ARMV6
142144 WITH_DFLTCC_DEFLATE
@@ -170,6 +172,10 @@ if(WITH_GZFILEOP)
170172 add_definitions (-DWITH_GZFILEOP )
171173endif ()
172174
175+ if (NOT WITH_CRC32_CHORBA)
176+ add_definitions (-DWITHOUT_CHORBA )
177+ endif ()
178+
173179if (CMAKE_C_COMPILER_ID MATCHES "^Intel" )
174180 if (CMAKE_HOST_UNIX )
175181 set (WARNFLAGS -Wall)
@@ -1092,14 +1098,16 @@ set(ZLIB_PRIVATE_HDRS
10921098 arch/generic/compare256_p.h
10931099 arch/generic/generic_functions.h
10941100 adler32_p.h
1101+ arch_functions.h
10951102 chunkset_tpl.h
10961103 compare256_rle.h
1097- arch_functions .h
1104+ crc32 .h
10981105 crc32_braid_p.h
10991106 crc32_braid_comb_p.h
11001107 crc32_braid_tbl.h
11011108 deflate.h
11021109 deflate_p.h
1110+ fallback_builtins.h
11031111 functable.h
11041112 inffast_tpl.h
11051113 inffixed_tbl.h
@@ -1113,7 +1121,9 @@ set(ZLIB_PRIVATE_HDRS
11131121 trees_tbl.h
11141122 zbuild.h
11151123 zendian.h
1124+ zmemory.h
11161125 zutil.h
1126+ zutil_p.h
11171127)
11181128set (ZLIB_SRCS
11191129 arch/generic/adler32_c.c
@@ -1122,7 +1132,6 @@ set(ZLIB_SRCS
11221132 arch/generic/compare256_c.c
11231133 arch/generic/crc32_braid_c.c
11241134 arch/generic/crc32_c.c
1125- arch/generic/crc32_chorba_c.c
11261135 arch/generic/crc32_fold_c.c
11271136 arch/generic/slide_hash_c.c
11281137 adler32.c
@@ -1148,6 +1157,10 @@ set(ZLIB_SRCS
11481157 zutil.c
11491158)
11501159
1160+ if (WITH_CRC32_CHORBA)
1161+ list (APPEND ZLIB_SRCS arch/generic/crc32_chorba_c.c)
1162+ endif ()
1163+
11511164if (WITH_RUNTIME_CPU_DETECTION)
11521165 list (APPEND ZLIB_PRIVATE_HDRS cpu_features.h)
11531166 list (APPEND ZLIB_SRCS cpu_features.c)
@@ -1390,6 +1403,7 @@ add_feature_info(WITH_BENCHMARKS WITH_BENCHMARKS "Build test/benchmarks")
13901403add_feature_info (WITH_BENCHMARK_APPS WITH_BENCHMARK_APPS "Build application benchmarks" )
13911404add_feature_info (WITH_OPTIM WITH_OPTIM "Build with optimisation" )
13921405add_feature_info (WITH_NEW_STRATEGIES WITH_NEW_STRATEGIES "Use new strategies" )
1406+ add_feature_info (WITH_CRC32_CHORBA WITH_CRC32_CHORBA "Use optimized CRC32 algorithm Chorba" )
13931407add_feature_info (WITH_NATIVE_INSTRUCTIONS WITH_NATIVE_INSTRUCTIONS
13941408 "Instruct the compiler to use the full instruction set on this host (gcc/clang -march=native)" )
13951409add_feature_info (WITH_RUNTIME_CPU_DETECTION WITH_RUNTIME_CPU_DETECTION "Build with runtime CPU detection" )
0 commit comments