xref: /aosp_15_r20/external/zstd/build/single_file_libs/create_single_file_library.sh (revision 01826a4963a0d8a59bc3812d29bdf0fb76416722)
1#!/bin/sh
2
3# Where to find the sources
4ZSTD_SRC_ROOT="../../lib"
5
6# Amalgamate the sources
7echo "Amalgamating files..."
8# Using the faster Python script if we have 3.8 or higher
9if 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
11else
12  ./combine.sh -r "$ZSTD_SRC_ROOT" -x legacy/zstd_legacy.h -o zstd.c zstd-in.c
13fi
14# Did combining work?
15if [ $? -ne 0 ]; then
16  echo "Combine script: FAILED"
17  exit 1
18fi
19echo "Combine script: PASSED"
20