• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash -eu
2
3# This script is called by the oss-fuzz main project when compiling the fuzz
4# targets. This script is regression tested by ci_oss.sh.
5
6# Save off the current folder as the build root.
7export BUILD_ROOT=$PWD
8
9echo "CC: ${CC:-}"
10echo "CXX: ${CXX:-}"
11echo "LIB_FUZZING_ENGINE: ${LIB_FUZZING_ENGINE:-}"
12echo "CFLAGS: ${CFLAGS:-}"
13echo "CXXFLAGS: ${CXXFLAGS:-}"
14echo "OUT: ${OUT:-}"
15
16export MAKEFLAGS+="-j$(nproc)"
17
18# Install dependencies
19apt-get -y install autoconf autogen automake libtool pkg-config python
20
21# For now, do not install the following libraries (as they won't be in the
22# final image):
23# libasound2-dev libflac-dev libogg-dev libopus-dev libvorbis-dev
24
25# Compile the fuzzer.
26./autogen.sh
27./configure --disable-shared --enable-ossfuzzers
28make V=1
29
30# Copy the fuzzer to the output directory.
31cp -v ossfuzz/sndfile_fuzzer $OUT/
32