From 602170fd016289cd0a4436fd9b381e91a19bb2d1 Mon Sep 17 00:00:00 2001
From: Michael Tuexen <tuexen@fh-muenster.de>
Date: Sat, 21 Apr 2018 00:33:40 +0200
Subject: [PATCH] Get binaries building on MacOS.

---
 gtests/net/packetdrill/Makefile.Darwin | 3 ++-
 gtests/net/packetdrill/Makefile.common | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gtests/net/packetdrill/Makefile.Darwin b/gtests/net/packetdrill/Makefile.Darwin
index 38284ca4..3f374222 100644
--- a/gtests/net/packetdrill/Makefile.Darwin
+++ b/gtests/net/packetdrill/Makefile.Darwin
@@ -1,2 +1,3 @@
-packetdrill-ext-libs := -lpthread -lpcap
+packetdrill-ext-libs := -pthread -lpcap
+LDFLAGS =
 include Makefile.common
diff --git a/gtests/net/packetdrill/Makefile.common b/gtests/net/packetdrill/Makefile.common
index 06a865db..cfd80e3d 100644
--- a/gtests/net/packetdrill/Makefile.common
+++ b/gtests/net/packetdrill/Makefile.common
@@ -1,6 +1,7 @@
 all: binaries
 
 CFLAGS = -g -Wall -Werror -Wno-unknown-warning-option -Wno-address-of-packed-member
+LDFLAGS ?= -static
 
 parser.o: parser.y
 	bison --output=parser.c --defines=parser.h --report=state parser.y
@@ -35,7 +36,7 @@ packetdrill-lib := \
 packetdrill-objs := packetdrill.o $(packetdrill-lib)
 
 packetdrill: $(packetdrill-objs)
-	$(CC) -o packetdrill -g -static $(packetdrill-objs) $(packetdrill-ext-libs)
+	$(CC) -o packetdrill -g $(LDFLAGS) $(packetdrill-objs) $(packetdrill-ext-libs)
 
 test-bins := checksum_test packet_parser_test packet_to_string_test
 tests: $(test-bins)
-- 
GitLab