1 #!/bin/sh 2 3 # Where to find the sources 4 ZSTD_SRC_ROOT="../../lib" 5 6 # Amalgamate the sources 7 echo "Amalgamating files..." 8 # Using the faster Python script if we have 3.8 or higher 9 if python3 -c 'import sys; assert sys.version_info >= (3,8)' 2>/dev/null; then 10 ./combine.py -r "$ZSTD_SRC_ROOT" -x legacy/zstd_legacy.h -o zstd.c zstd-in.c 11 else 12 ./combine.sh -r "$ZSTD_SRC_ROOT" -x legacy/zstd_legacy.h -o zstd.c zstd-in.c 13 fi 14 # Did combining work? 15 if [ $? -ne 0 ]; then 16 echo "Combine script: FAILED" 17 exit 1 18 fi 19 echo "Combine script: PASSED" 20