summaryrefslogtreecommitdiff
path: root/contrib/oss-fuzz/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/oss-fuzz/build.sh')
-rwxr-xr-xcontrib/oss-fuzz/build.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/contrib/oss-fuzz/build.sh b/contrib/oss-fuzz/build.sh
index d2137b13e..300a7e83e 100755
--- a/contrib/oss-fuzz/build.sh
+++ b/contrib/oss-fuzz/build.sh
@@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-# Last changed in libpng 1.6.33 [September 28, 2017]
+# Last changed in libpng 1.6.35 [October 1, 2017]
#
-# Revisions by Glenn Randers-Pehson, 2017:
+# Revisions by Glenn Randers-Pehrson, 2017:
# 1. Build only the library, not the tools (changed "make -j$(nproc) all" to
# "make -j$(nproc) libpng16.la").
# 2. Disabled WARNING and WRITE options in pnglibconf.dfa.
+# 3. Build zlib alongside libpng
################################################################################
# Disable logging via library build configuration control.
@@ -30,14 +31,17 @@ cat scripts/pnglibconf.dfa | \
> scripts/pnglibconf.dfa.temp
mv scripts/pnglibconf.dfa.temp scripts/pnglibconf.dfa
-# build the library.
+# build zlib library.
+(cd ../zlib; ./configure; make -j$(nproc) clean; make -j$(nproc) all)
+
+# build the libpng library.
autoreconf -f -i
-./configure
+CPPFLAGS="-I../zlib" LDFLAGS="-L../zlib" ./configure
make -j$(nproc) clean
make -j$(nproc) libpng16.la
# build libpng_read_fuzzer.
-$CXX $CXXFLAGS -std=c++11 -I. \
+$CXX $CXXFLAGS -std=c++11 -I. -I../zlib -L../zlib \
$SRC/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc \
-o $OUT/libpng_read_fuzzer \
-lFuzzingEngine .libs/libpng16.a -lz