2019-07-27 19:44:18 +00:00
|
|
|
#!/bin/bash -eu
|
|
|
|
|
|
|
|
# This script is called by the oss-fuzz main project when compiling the fuzz
|
|
|
|
# targets. This script is regression tested by ci_oss.sh.
|
|
|
|
|
|
|
|
# Save off the current folder as the build root.
|
|
|
|
export BUILD_ROOT=$PWD
|
|
|
|
|
|
|
|
echo "CC: ${CC:-}"
|
|
|
|
echo "CXX: ${CXX:-}"
|
|
|
|
echo "LIB_FUZZING_ENGINE: ${LIB_FUZZING_ENGINE:-}"
|
|
|
|
echo "CFLAGS: ${CFLAGS:-}"
|
|
|
|
echo "CXXFLAGS: ${CXXFLAGS:-}"
|
|
|
|
echo "OUT: ${OUT:-}"
|
|
|
|
|
|
|
|
export MAKEFLAGS+="-j$(nproc)"
|
|
|
|
|
|
|
|
# Install dependencies
|
2020-08-28 18:04:21 +00:00
|
|
|
apt-get -y install autoconf autogen automake libtool pkg-config python
|
|
|
|
|
|
|
|
# For now, do not install the following libraries (as they won't be in the
|
|
|
|
# final image):
|
|
|
|
# libasound2-dev libflac-dev libogg-dev libopus-dev libvorbis-dev
|
2019-07-27 19:44:18 +00:00
|
|
|
|
|
|
|
# Compile the fuzzer.
|
2022-09-24 10:51:49 +00:00
|
|
|
autoreconf -vif
|
2020-08-28 18:04:21 +00:00
|
|
|
./configure --disable-shared --enable-ossfuzzers
|
2019-07-27 19:44:18 +00:00
|
|
|
make V=1
|
|
|
|
|
|
|
|
# Copy the fuzzer to the output directory.
|
|
|
|
cp -v ossfuzz/sndfile_fuzzer $OUT/
|
2021-08-15 04:38:48 +00:00
|
|
|
cp -v ossfuzz/sndfile_alt_fuzzer $OUT/
|