spank-olm

WIP Do not look
git clone git://archive.git.mtrnord.blog/MTRNord/spank-olm.git
Log | Files | Refs | README | LICENSE

build.sh (1123B)


      1 #!/bin/bash -eu
      2 
      3 export PKG_CONFIG="pkg-config --static"
      4 export PKG_CONFIG_PATH="$WORK/lib/pkgconfig"
      5 export CPPFLAGS="-I$WORK/include"
      6 export LDFLAGS="-L$WORK/lib"
      7 
      8 # Run as many parallel jobs as there are available CPU cores
      9 export MAKEFLAGS="-j$(nproc)"
     10 
     11 # botan
     12 pushd ../botan
     13 ./configure.py --prefix="${WORK}" --without-documentation --enable-sanitizers="${SANITIZER}" --build-targets=static,shared
     14 make -j$(nproc) all
     15 make install
     16 cp build/botan-3.pc "${PKG_CONFIG_PATH}"
     17 popd
     18 
     19 # spank-olm
     20 meson setup build --prefix="${WORK}" --libdir=lib --prefer-static --default-library=static --buildtype=debugoptimized \
     21   -Dfuzzing_engine=oss-fuzz -Dfuzzer_ldflags="$LIB_FUZZING_ENGINE" -Db_lto=false -Db_thinlto_cache=false -Dbuild_tests=false
     22 meson install -C build --tag devel
     23 
     24 # Copy fuzz executables to $OUT
     25 find build/fuzz -maxdepth 1 -executable -type f -exec cp -v '{}' "${OUT}" \;
     26 
     27 # All shared libraries needed during fuzz target execution should be inside the $OUT/lib directory
     28 mkdir -p "${OUT}"
     29 cp ${WORK}/lib/*.so "${OUT}/lib"
     30 
     31 mv "${SRC}/spank-olm/fuzz/corpuses/sign.zip" "${OUT}/olm_sign_fuzzer_seed_corpus.zip"