Skip to content

Commit 9b19d62

Browse files
committed
Merge pull request #36 from baldwinmatt/master
Link binaries against -lrt
2 parents 8d1d22e + 6e86d93 commit 9b19d62

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

bin/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@
1616
all: s2nc s2nd
1717
include ../s2n.mk
1818

19-
LDFLAGS += -L../lib/ -ls2n -lcrypto
19+
ifeq ($(shell uname),Darwin)
20+
LIBS = -lcrypto
21+
else
22+
LIBS = -lcrypto -lrt
23+
endif
24+
25+
LDFLAGS += -L../lib/ -ls2n ${LIBS}
2026
CRUFT += s2nc s2nd
2127

2228
s2nc: s2nc.c echo.c

tests/unit/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ include ../../s2n.mk
2222

2323
CRUFT += $(wildcard *_test)
2424

25+
ifeq ($(shell uname),Darwin)
26+
LIBS = -lcrypto -lpthread -lm
27+
else
28+
LIBS = -lcrypto -lpthread -lm -lrt
29+
endif
30+
2531
# Suppress the unreachable code warning, because tests involve what should be
2632
# unreachable code
2733
CFLAGS += -Wno-unreachable-code -I../../ -I../../api/
28-
LDFLAGS += -L../../lib/ -L../testlib/ -ltests2n -ls2n -lcrypto -lpthread -lm
34+
LDFLAGS += -L../../lib/ -L../testlib/ -ltests2n -ls2n ${LIBS}
2935

3036
run_tests: build_tests
3137
(for test in *_test ; do DYLD_LIBRARY_PATH="../../lib/:../testlib/:$$DYLD_LIBRARY_PATH" LD_LIBRARY_PATH="../../lib/:../testlib/:$$LD_LIBRARY_PATH" ./$$test || exit 1 ; done )

0 commit comments

Comments
 (0)