Skip to content

Commit ea4eeb2

Browse files
committed
Basic Build Imrpovements:
- Remove Usage of System OpenSSL - Update OpenSSL to master from GitHub as Submodule - Update LuaJit to 2.1 from GitHub as Submodule - Fixes for gettimeofday() - Fixes to use x86 intrinsics only on x86 Integrate Improvements from GitHub: - Fixes to Script Copy Value Order - PR giltene#113 - Add Fixes for Mutual TLS Authentication - PR giltene#99 - Add Fixes for TLS Ciphers - PR giltene#107 - Add EOF Handling Error - PR giltene#33 - Add JSON Example - PR # 51 - Make Rate Optional (use UINT64_MAX) - PR giltene#130
1 parent 44a94c1 commit ea4eeb2

File tree

206 files changed

+209
-114041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+209
-114041
lines changed

Diff for: .gitmodules

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[submodule "deps/luajit"]
2+
path = deps/luajit
3+
url = https://github.com/LuaJIT/LuaJIT
4+
branch = v2.1
5+
[submodule "deps/openssl"]
6+
path = deps/openssl
7+
url = https://github.com/openssl/openssl
8+
branch = master

Diff for: Makefile

+18-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
CFLAGS := -std=c99 -Wall -O2 -D_REENTRANT
2-
LIBS := -lpthread -lm -lcrypto -lssl
1+
CFLAGS := -Wall -O2 -D_REENTRANT
2+
LIBS := -lpthread -lm
33

44
TARGET := $(shell uname -s | tr '[A-Z]' '[a-z]' 2>/dev/null || echo unknown)
55

@@ -11,12 +11,11 @@ else ifeq ($(TARGET), darwin)
1111
# is not set then it's forced to 10.4, which breaks compile on Mojave.
1212
export MACOSX_DEPLOYMENT_TARGET = $(shell sw_vers -productVersion)
1313
LDFLAGS += -pagezero_size 10000 -image_base 100000000
14-
LIBS += -L/usr/local/opt/openssl/lib
15-
CFLAGS += -I/usr/local/include -I/usr/local/opt/openssl/include
14+
CFLAGS += -I/usr/local/include
1615
else ifeq ($(TARGET), linux)
17-
CFLAGS += -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE
18-
LIBS += -ldl
19-
LDFLAGS += -Wl,-E
16+
CFLAGS += -D_POSIX_C_SOURCE=200809L -D_DEFAULT_SOURCE
17+
LIBS += -ldl -static -static-libgcc
18+
LDFLAGS += -Wl,-E -static -static-libgcc
2019
else ifeq ($(TARGET), freebsd)
2120
CFLAGS += -D_DECLARE_C99_LDBL_MATH
2221
LDFLAGS += -Wl,-E
@@ -30,21 +29,23 @@ ODIR := obj
3029
OBJ := $(patsubst %.c,$(ODIR)/%.o,$(SRC)) $(ODIR)/bytecode.o
3130

3231
LDIR = deps/luajit/src
33-
LIBS := -lluajit $(LIBS)
34-
CFLAGS += -I$(LDIR)
35-
LDFLAGS += -L$(LDIR)
32+
SDIR = deps/openssl
33+
LIBS := -lssl -lcrypto -lluajit ${LIBS}
34+
CFLAGS += -I$(LDIR) -I$(SDIR)/include/
35+
LDFLAGS += -L$(LDIR) -L$(SDIR)
3636

3737
all: $(BIN)
3838

3939
clean:
4040
$(RM) $(BIN) obj/*
4141
@$(MAKE) -C deps/luajit clean
42+
@$(MAKE) -C deps/openssl clean
4243

4344
$(BIN): $(OBJ)
4445
@echo LINK $(BIN)
4546
@$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
4647

47-
$(OBJ): config.h Makefile $(LDIR)/libluajit.a | $(ODIR)
48+
$(OBJ): config.h Makefile $(LDIR)/libluajit.a $(SDIR)/libssl.a $(SDIR)/libcrypto.a | $(ODIR)
4849

4950
$(ODIR):
5051
@mkdir -p $@
@@ -61,6 +62,12 @@ $(LDIR)/libluajit.a:
6162
@echo Building LuaJIT...
6263
@$(MAKE) -C $(LDIR) BUILDMODE=static
6364

65+
$(SDIR)/libcrypto.a:
66+
@echo Building OpenSSL...
67+
@cd $(SDIR) && ./config --static -static && $(MAKE)
68+
69+
$(SDIR)/libssl.a: $(SDIR)/libcrypto.a
70+
6471
.PHONY: all clean
6572
.SUFFIXES:
6673
.SUFFIXES: .c .o .lua

Diff for: deps/luajit

Submodule luajit added at 505e2c0

Diff for: deps/luajit/COPYRIGHT

-56
This file was deleted.

Diff for: deps/luajit/Makefile

-151
This file was deleted.

Diff for: deps/luajit/README

-16
This file was deleted.

0 commit comments

Comments
 (0)