]> The Tcpdump Group git mirrors - tcpdump/commitdiff
build on a combination of compilers and build options
authorMichael Richardson <[email protected]>
Fri, 16 Aug 2019 20:38:58 +0000 (16:38 -0400)
committerMichael Richardson <[email protected]>
Sun, 18 Aug 2019 17:32:07 +0000 (13:32 -0400)
buildem [new file with mode: 0755]

diff --git a/buildem b/buildem
new file mode 100755 (executable)
index 0000000..c8c3ebb
--- /dev/null
+++ b/buildem
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# this script builds libpcap and tcpdump using the matrix of compilers and architectures
+# that travis also buildsd.
+
+if [ -f Makefile.in ]; then cd ..; fi
+here=`pwd`
+mkdir -p builds
+cd builds
+
+export CFLAGS='-fno-omit-frame-pointer -fsanitize=address -fno-optimize-sibling-calls -fPIC -Wextra -g3 -ggdb3 -O0'
+for arch in i386 x86_64
+do
+        case $arch in
+        i386) CFLAGS="-m32 $CFLAGS"; export LDFLAGS="-m32"; export CXXFLAGS=-m32; target="i686-pc-linux-gnu" ;;
+        esac
+        (
+        for compiler in clang-6.0 gcc
+        do
+                mkdir -p $arch/$compiler
+                set -x
+                (cd $arch/$compiler && mkdir -p libpcap tcpdump &&
+                  (cd libpcap && CC=$compiler $here/libpcap/configure --target=$target && make ) &&
+                  (cd tcpdump && CC=$compiler $here/tcpdump/configure --target=$target && make && make check))
+        done
+        )
+done
+