From 8cb3fb58937c233a8ccc75fb206b287c9816d701 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 3 Dec 2013 21:40:58 +0100 Subject: [PATCH] Allowed Linux builds to use LuaRocks. This works by exporting all the symbols for the dynamic loader so that LuaRocks' shared libraries may bind to them on load. Also allowed lua's dlopen(). --- GNUmakefile | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index e0e606d90..c8cdd35e1 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -47,8 +47,8 @@ ifeq ($(release),1) # release build - fastest run-time, no gdb support ################ -CC_OPTIONS = -O3 -DNDEBUG -CXX_OPTIONS = -O3 -DNDEBUG +CC_OPTIONS = -O3 -DNDEBUG -DLUA_USE_DLOPEN +CXX_OPTIONS = -O3 -DNDEBUG -DLUA_USE_DLOPEN LNK_OPTIONS = -pthread -O3 BUILDDIR = build/release/ @@ -59,8 +59,8 @@ ifeq ($(profile),1) # profile build - a release build with symbols and profiling engine built in ################ -CC_OPTIONS = -g -ggdb -O3 -pg -DNDEBUG -CXX_OPTIONS = -g -ggdb -O3 -pg -DNDEBUG +CC_OPTIONS = -g -ggdb -O3 -pg -DNDEBUG -DLUA_USE_DLOPEN +CXX_OPTIONS = -g -ggdb -O3 -pg -DNDEBUG -DLUA_USE_DLOPEN LNK_OPTIONS = -pthread -ggdb -O3 -pg BUILDDIR = build/profile/ @@ -71,8 +71,8 @@ else # Since C code is used only for supporting libraries (zlib, lua), it is still Ofast-optimized ################ -CC_OPTIONS = -ggdb -g -D_DEBUG -O3 -CXX_OPTIONS = -ggdb -g -D_DEBUG -O1 +CC_OPTIONS = -ggdb -g -D_DEBUG -O3 -DLUA_USE_DLOPEN +CXX_OPTIONS = -ggdb -g -D_DEBUG -O1 -DLUA_USE_DLOPEN LNK_OPTIONS = -pthread -g -ggdb -O1 BUILDDIR = build/debug/ @@ -111,6 +111,14 @@ endif +################################################### +# Export all symbols from the executable, so that LuaRocks may bind to Lua routines: +LNK_OPTIONS += -rdynamic + + + + + ################################################### # 32-bit build override in 64-bit build environments