aboutsummaryrefslogtreecommitdiff
path: root/projects/apache-httpd/build.sh
blob: 59cf786067cad34dc9c77abff7d8ddc6e5751c8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash -eu
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

unset CPP
unset CXX

git apply  --ignore-space-change --ignore-whitespace $SRC/patches.diff

# Download apr and place in httpd srclib folder. Apr-2.0 includes apr-utils
svn checkout https://svn.apache.org/repos/asf/apr/apr/trunk/ srclib/apr

# Build httpd
./buildconf
./configure --with-included-apr --enable-pool-debug
make

# Build the fuzzers
for fuzzname in utils parse tokenize addr_parse uri request preq; do
  $CC $CFLAGS $LIB_FUZZING_ENGINE \
    -I$SRC/fuzz-headers/lang/c -I./include -I./os/unix \
    -I./srclib/apr/include -I./srclib/apr-util/include/ \
    $SRC/fuzz_${fuzzname}.c -o $OUT/fuzz_${fuzzname} \
    ./modules.o buildmark.o \
    -Wl,--start-group ./server/.libs/libmain.a \
                      ./modules/core/.libs/libmod_so.a \
                      ./modules/http/.libs/libmod_http.a \
                      ./server/mpm/event/.libs/libevent.a \
                      ./os/unix/.libs/libos.a \
                      ./srclib/apr/.libs/libapr-2.a \
    -Wl,--end-group -luuid -lpcre -lcrypt -lexpat
done