1#!/bin/sh 2 3# this script builds libpcap and tcpdump using the matrix of compilers and architectures 4# that travis also buildsd. 5 6if [ -f Makefile.in ]; then cd ..; fi 7here=`pwd` 8mkdir -p builds 9cd builds 10 11export CFLAGS='-fno-omit-frame-pointer -fsanitize=address -fno-optimize-sibling-calls -fPIC -Wextra -g3 -ggdb3 -O0 -Werror' 12for arch in i386 x86_64 13do 14 case $arch in 15 i386) CFLAGS="-m32 $CFLAGS"; export LDFLAGS="-m32"; export CXXFLAGS=-m32; target="i686-pc-linux-gnu" ;; 16 esac 17 ( 18 for compiler in clang-6.0 gcc 19 do 20 mkdir -p $arch/$compiler 21 set -x 22 (cd $arch/$compiler && mkdir -p libpcap tcpdump && 23 (cd libpcap && CC=$compiler $here/libpcap/configure --target=$target && make ) && 24 (cd tcpdump && CC=$compiler $here/tcpdump/configure --target=$target && make && make check)) 25 done 26 ) 27done 28 29