1#!/bin/bash -eu
2# Copyright 2018 Google Inc.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16################################################################################
17
18#compile and link statically dependencies
19cd ..
20cd libgpg-error
21./autogen.sh
22./configure --disable-doc --enable-static --disable-shared
23make
24make install
25cd ..
26cd libgcrypt
27./autogen.sh
28./configure --disable-doc --enable-static --disable-shared
29make
30make install
31cd ..
32cd libassuan
33./autogen.sh
34./configure --disable-doc --enable-static --disable-shared
35make
36make install
37cd ..
38cd libksba
39./autogen.sh
40./configure --disable-doc --enable-static --disable-shared
41make
42make install
43cd ..
44cd npth
45./autogen.sh
46./configure --disable-doc --enable-static --disable-shared
47make
48make install
49cd ..
50
51
52# build project
53cd gnupg
54mkdir tests/fuzz
55cp ../fuzz_* tests/fuzz
56git apply ../fuzz.diff
57./autogen.sh
58./configure --disable-doc --enable-maintainer-mode
59make -j$(nproc) all
60
61# build fuzzers
62cd tests/fuzz
63# export fuzzers and other associated stuff
64cp fuzz_* $OUT/
65