Skip to content

Commit 062eafc

Browse files
committed
Add full instructions for building OpenSSL locally
LibreSSL and BoringSSL remain TBD, but we should be able to work with them in this framework.
1 parent 53522ec commit 062eafc

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

lib/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
#
1515

1616
ifeq ($(shell uname),Darwin)
17-
LIBS = -lc -lcrypto -lpthread
17+
LIBS = -lc -lpthread
1818
else
19-
LIBS = -lc -lcrypto -lpthread -lrt
19+
LIBS = -lc -lpthread -lrt
2020
endif
2121

22-
OBJS = $(wildcard ../utils/*.o ../stuffer/*.o ../tls/*.o ../iana/*.o ../crypto/*.o ../error/*.o)
22+
OBJS = $(wildcard ../utils/*.o ../stuffer/*.o ../tls/*.o ../iana/*.o ../crypto/*.o ../error/*.o ../libcrypto-root/lib/libcrypto.a)
2323
all: libs2n.a libs2n.so libs2n.dylib
2424

2525
include ../s2n.mk

libcrypto-build/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This directory is used to store build artifacts (tarballs and source) for a locally
2+
built copy of libcrypto, either from OpenSSL, LibreSSL or BoringSSL.
3+
4+
See the s2n [Usage Guide](https://github.com/awslabs/s2n/blob/master/docs/USAGE-GUIDE.md) for more details.

libcrypto-root/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This directory is used as the "prefix" target for a locally built copy
2+
of libcrypto. See the s2n [Usage Guide](https://github.com/awslabs/s2n/blob/master/docs/USAGE-GUIDE.md) for more details.
3+

s2n.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ INDENT = $(shell (if indent --version 2>&1 | grep GNU > /dev/null; then echo in
1919

2020
CFLAGS = -pedantic -Wall -Werror -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized \
2121
-Wshadow -Wcast-qual -Wcast-align -Wwrite-strings -Wstack-protector -fPIC \
22-
-std=c99 -D_POSIX_C_SOURCE=200112L -fstack-protector-all -O2 -I../api/ -I../ \
23-
-Wno-deprecated-declarations -Wno-unknown-pragmas -Wformat-security \
22+
-std=c99 -D_POSIX_C_SOURCE=200112L -fstack-protector-all -O2 -I../libcrypto-root/include/ \
23+
-I../api/ -I../ -Wno-deprecated-declarations -Wno-unknown-pragmas -Wformat-security \
2424
-D_FORTIFY_SOURCE=2
2525

2626
INDENTOPTS = -npro -kr -i4 -ts4 -nut -sob -l180 -ss -ncs -cp1

tests/unit/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ include ../../s2n.mk
2323
CRUFT += $(wildcard *_test)
2424

2525
ifeq ($(shell uname),Darwin)
26-
LIBS = -lcrypto -lpthread -lm
26+
LIBS = -lpthread -lm
2727
else
28-
LIBS = -lcrypto -lpthread -lm -lrt
28+
LIBS = -lpthread -lm -lrt
2929
endif
3030

3131
# Suppress the unreachable code warning, because tests involve what should be
3232
# unreachable code
33-
CFLAGS += -Wno-unreachable-code -I../../ -I../../api/
33+
CFLAGS += -Wno-unreachable-code -I../../libcrypto-root/include/ -I../../ -I../../api/
3434
LDFLAGS += -L../../lib/ -L../testlib/ -ltests2n -ls2n ${LIBS}
3535

3636
run_tests: build_tests

0 commit comments

Comments
 (0)