Harish Mahendrakar | 36ea868 | 2019-08-16 16:45:54 -0700 | [diff] [blame] | 1 | #!/bin/bash -eu |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | # |
| 15 | ################################################################################ |
| 16 | # Ensure SRC and WORK are set |
| 17 | test "${SRC}" != "" || exit 1 |
| 18 | test "${WORK}" != "" || exit 1 |
| 19 | |
| 20 | # Build libxaac |
| 21 | build_dir=$WORK/build |
| 22 | rm -rf ${build_dir} |
| 23 | mkdir -p ${build_dir} |
| 24 | pushd ${build_dir} |
| 25 | |
| 26 | cmake $SRC/libxaac |
| 27 | make -j$(nproc) |
| 28 | popd |
| 29 | |
| 30 | # build fuzzers |
| 31 | $CXX $CXXFLAGS -std=c++11 \ |
| 32 | -I$SRC/libxaac \ |
| 33 | -I$SRC/libxaac/common \ |
| 34 | -I$SRC/libxaac/decoder \ |
| 35 | -I$SRC/libxaac/decoder/drc_src \ |
| 36 | -I${build_dir} \ |
| 37 | -Wl,--start-group \ |
| 38 | $LIB_FUZZING_ENGINE \ |
| 39 | $SRC/libxaac/fuzzer/xaac_dec_fuzzer.cpp -o $OUT/xaac_dec_fuzzer \ |
| 40 | ${build_dir}/libxaacdec.a \ |
| 41 | -Wl,--end-group |
| 42 | |
| 43 | cp $SRC/libxaac/fuzzer/xaac_dec_fuzzer.dict $OUT/xaacdec_fuzzer.dict |