summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/zstd/build/single_file_libs/create_single_file_library.sh
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/zstd/build/single_file_libs/create_single_file_library.sh')
-rwxr-xr-x3rdparty/zstd/build/single_file_libs/create_single_file_library.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/3rdparty/zstd/build/single_file_libs/create_single_file_library.sh b/3rdparty/zstd/build/single_file_libs/create_single_file_library.sh
new file mode 100755
index 00000000000..a6f71f0f085
--- /dev/null
+++ b/3rdparty/zstd/build/single_file_libs/create_single_file_library.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# Where to find the sources
+ZSTD_SRC_ROOT="../../lib"
+
+# Amalgamate the sources
+echo "Amalgamating files..."
+# Using the faster Python script if we have 3.8 or higher
+if python3 -c 'import sys; assert sys.version_info >= (3,8)' 2>/dev/null; then
+ ./combine.py -r "$ZSTD_SRC_ROOT" -x legacy/zstd_legacy.h -o zstd.c zstd-in.c
+else
+ ./combine.sh -r "$ZSTD_SRC_ROOT" -x legacy/zstd_legacy.h -o zstd.c zstd-in.c
+fi
+# Did combining work?
+if [ $? -ne 0 ]; then
+ echo "Combine script: FAILED"
+ exit 1
+fi
+echo "Combine script: PASSED"