diff options
author | daurnimator <quae@daurnimator.com> | 2017-09-01 14:20:21 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-09-01 14:20:21 +1000 |
commit | d06f504deb34bc49f7935f386508217270e1bcb7 (patch) | |
tree | 9bbc7982afcdff2878b3ecab9886e7211f2fe8e1 | |
parent | 068543e777a2a8cb2fea33e9569bfdd0593f7946 (diff) | |
download | luaossl-rel-20170901.tar.gz luaossl-rel-20170901.tar.bz2 luaossl-rel-20170901.zip |
Only use lua-compat-5.3 if running < 5.3rel-20170901
-rw-r--r-- | src/GNUmakefile | 14 | ||||
-rw-r--r-- | src/openssl.c | 2 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/GNUmakefile b/src/GNUmakefile index af6cbf9..dc8af36 100644 --- a/src/GNUmakefile +++ b/src/GNUmakefile | |||
@@ -25,7 +25,7 @@ LIBS_$(d) = $(ALL_LIBS) | |||
25 | # | 25 | # |
26 | # C O M P I L A T I O N R U L E S | 26 | # C O M P I L A T I O N R U L E S |
27 | # | 27 | # |
28 | OBJS_$(d) = openssl.o ../vendor/compat53/c-api/compat-5.3.o | 28 | OBJS_$(d) = openssl.o |
29 | 29 | ||
30 | $(d)/config.h: $(abspath $(d)/..)/config.h | 30 | $(d)/config.h: $(abspath $(d)/..)/config.h |
31 | $(CP) $< $@ | 31 | $(CP) $< $@ |
@@ -35,10 +35,20 @@ define BUILD_$(d) | |||
35 | $$(d)/$(1)/openssl.so: $$(addprefix $$(d)/$(1)/, $$(OBJS_$(d))) | 35 | $$(d)/$(1)/openssl.so: $$(addprefix $$(d)/$(1)/, $$(OBJS_$(d))) |
36 | $$(CC) -o $$@ $$^ $$(SOFLAGS_$$(abspath $$(@D)/..)) $$(LDFLAGS_$$(abspath $$(@D)/..)) $$(LIBS_$$(abspath $$(@D)/..)) | 36 | $$(CC) -o $$@ $$^ $$(SOFLAGS_$$(abspath $$(@D)/..)) $$(LDFLAGS_$$(abspath $$(@D)/..)) $$(LIBS_$$(abspath $$(@D)/..)) |
37 | 37 | ||
38 | $$(d)/$(1)/%.o: $$(d)/%.c $$(d)/../vendor/compat53/c-api/compat-5.3.h $$(d)/config.h | 38 | $$(d)/$(1)/%.o: $$(d)/%.c $$(d)/config.h |
39 | $$(MKDIR) -p $$(@D) | 39 | $$(MKDIR) -p $$(@D) |
40 | $$(CC) $$(CFLAGS_$$(<D)) $$(ALL_LUA$(subst .,,$(1))_CPPFLAGS) $$(CPPFLAGS_$$(<D)) -c -o $$@ $$< | 40 | $$(CC) $$(CFLAGS_$$(<D)) $$(ALL_LUA$(subst .,,$(1))_CPPFLAGS) $$(CPPFLAGS_$$(<D)) -c -o $$@ $$< |
41 | 41 | ||
42 | ifneq ($(1), 5.3) | ||
43 | $$(d)/$(1)/compat53.o: $$(d)/../vendor/compat53/c-api/compat-5.3.c $$(d)/../vendor/compat53/c-api/compat-5.3.h $$(d)/config.h | ||
44 | $$(MKDIR) -p $$(@D) | ||
45 | $$(CC) $$(CFLAGS_$$(<D)) $$(ALL_LUA$(subst .,,$(1))_CPPFLAGS) $$(CPPFLAGS_$$(<D)) -c -o $$@ $$< | ||
46 | |||
47 | $$(d)/$(1)/%.o: $$(d)/../vendor/compat53/c-api/compat-5.3.h | ||
48 | |||
49 | $$(d)/$(1)/openssl.so: $$(d)/$(1)/compat53.o | ||
50 | endif | ||
51 | |||
42 | .SECONDARY: liblua$(1)-openssl openssl$(1) openssl | 52 | .SECONDARY: liblua$(1)-openssl openssl$(1) openssl |
43 | 53 | ||
44 | liblua$(1)-openssl openssl$(1) openssl: $$(d)/$(1)/openssl.so | 54 | liblua$(1)-openssl openssl$(1) openssl: $$(d)/$(1)/openssl.so |
diff --git a/src/openssl.c b/src/openssl.c index cb4bd48..80d3dfe 100644 --- a/src/openssl.c +++ b/src/openssl.c | |||
@@ -75,7 +75,9 @@ | |||
75 | #include <lualib.h> | 75 | #include <lualib.h> |
76 | #include <lauxlib.h> | 76 | #include <lauxlib.h> |
77 | 77 | ||
78 | #if LUA_VERSION_NUM < 503 | ||
78 | #include "../vendor/compat53/c-api/compat-5.3.h" | 79 | #include "../vendor/compat53/c-api/compat-5.3.h" |
80 | #endif | ||
79 | 81 | ||
80 | #define GNUC_2VER(M, m, p) (((M) * 10000) + ((m) * 100) + (p)) | 82 | #define GNUC_2VER(M, m, p) (((M) * 10000) + ((m) * 100) + (p)) |
81 | #define GNUC_PREREQ(M, m, p) (__GNUC__ > 0 && GNUC_2VER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) >= GNUC_2VER((M), (m), (p))) | 83 | #define GNUC_PREREQ(M, m, p) (__GNUC__ > 0 && GNUC_2VER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) >= GNUC_2VER((M), (m), (p))) |