Ver código fonte

app_lua: fix cross-compilation

Ovidiu Sas 12 anos atrás
pai
commit
d41c9a91af
1 arquivos alterados com 12 adições e 5 exclusões
  1. 12 5
      modules/app_lua/Makefile

+ 12 - 5
modules/app_lua/Makefile

@@ -7,17 +7,24 @@ include ../../Makefile.defs
 auto_gen=
 auto_gen=
 NAME=app_lua.so
 NAME=app_lua.so
 
 
+ifeq ($(CROSS_COMPILE),)
 BUILDER = $(shell which lua-config)
 BUILDER = $(shell which lua-config)
+endif
+
 ifeq ($(BUILDER),)
 ifeq ($(BUILDER),)
+	ifeq ($(CROSS_COMPILE),)
 	BUILDER = $(shell which pkg-config)
 	BUILDER = $(shell which pkg-config)
+	endif
 	ifeq ($(BUILDER),)
 	ifeq ($(BUILDER),)
-		LUA51 = $(shell ls /usr/lib/liblua* | grep liblua5.1)
+		LUA51 = $(shell ls $(LOCALBASE)/lib/liblua* | grep liblua5.1)
+		DEFS+=-I$(LOCALBASE)/include
+		LIBS+=-L$(LOCALBASE)/lib -lm
 		ifeq ($(LUA51),)
 		ifeq ($(LUA51),)
-			DEFS+=-I/usr/include/lua
-			LIBS= -llua -lm
+			DEFS+=-I$(LOCALBASE)/include/lua
+			LIBS+=-llua
 		else
 		else
-			DEFS+=-I/usr/include/lua5.1
-			LIBS= -llua5.1 -lm
+			DEFS+=-I$(LOCALBASE)/include/lua5.1
+			LIBS+=-llua5.1
 		endif
 		endif
 	else
 	else
 		LUAVER=XX
 		LUAVER=XX