DLL working under mingw

This commit is contained in:
2023-02-21 16:11:03 -05:00
parent 98c1b2d599
commit 03f89ec922
2 changed files with 8 additions and 12 deletions

View File

@@ -9,8 +9,9 @@ ifneq "" "$(findstring -linux-,$(MAKE_HOST))"
OS=linux
EXE=luprex
DLL=luprex.so
LIBS=-L./ext/openssl-mingw -lssl -lcrypto -ldl
LIBS=-L./ext/openssl-linux -lssl -lcrypto -ldl
LUAFLAGS=-DLUA_USE_APICHECK -DLUA_USE_POSIX
LINKDLL=-export-dynamic -Wl,--no-allow-shlib-undefined -Wl,-z,defs -shared
OPT=-g -O0
else ifneq "" "$(findstring cmd.exe,$(COMSPEC))"
@@ -20,6 +21,7 @@ else ifneq "" "$(findstring cmd.exe,$(COMSPEC))"
DLL=luprex.dll
LIBS=-L./ext/openssl-mingw -lssl -lcrypto -lws2_32 -lcrypt32 -lcryptui
LUAFLAGS=-DLUA_USE_APICHECK -DLUA_COMPAT_ALL
LINKDLL=-Wl,--no-allow-shlib-undefined -shared
OPT=-g -O0
else
@@ -125,10 +127,10 @@ GPP=g++ -Wall -fvisibility=hidden $(OPT) -std=c++17 -MMD
all: $(EXE) $(DLL)
$(EXE): $(OBJ_DRV)
$(GPP) -o $@ $(OBJ_DRV) -L./ext/openssl-linux -lssl -lcrypto -ldl
$(GPP) -o $@ $(OBJ_DRV) $(LIBS)
$(DLL): $(OBJ_ERIS) $(OBJ_CORE)
$(GPP) -export-dynamic -Wl,--no-allow-shlib-undefined -Wl,-z,defs -shared -o $@ $^
$(GPP) $(LINKDLL) -o $@ $^
obj/eris/%.o: ext/eris-master/src/%.c
$(GPP) -fPIC $(LUAFLAGS) -o $@ -c $<