trying include luajit into embebbed application that already uses lua5.1

  • From: José Seabra <joseseabra4@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 24 Oct 2014 11:56:29 +0100

Hi there,
I'm trying compile a luajit as embebbed c application, this application
already uses lua5.1, the makefile is the following:


# $Id$
#
#
# WARNING: do not run this directly, it should be run by the master Makefile

include ../../Makefile.defs
auto_gen=
NAME=app_lua.so

ifeq ($(CROSS_COMPILE),)
BUILDER = $(shell which lua-config)
endif

ifeq ($(BUILDER),)
        ifeq ($(CROSS_COMPILE),)
        BUILDER = $(shell which pkg-config)
        endif
        ifeq ($(BUILDER),)
                LUA51 = $(shell ls $(LOCALBASE)/lib/liblua* | grep
liblua5.1)
                DEFS+=-I$(LOCALBASE)/include
                LIBS+=-L$(LOCALBASE)/lib -lm
                ifeq ($(LUA51),)
                        DEFS+=-I$(LOCALBASE)/include/lua
                        LIBS+=-llua
                else
                        DEFS+=-I$(LOCALBASE)/include/lua5.1
                        LIBS+=-llua5.1
                endif
        else
                LUAVER=XX
                LUALIBS = $(shell pkg-config --silence-errors --libs lua)
                ifeq ($(LUALIBS),)
                        LUALIBS = $(shell pkg-config --silence-errors
--libs lua5.1)
                        ifneq ($(LUALIBS),)
                                LUAVER=51
                        endif
                else
                        LUAVER=5X
                endif
                ifeq ($(LUAVER),XX)
                        LUA51 = $(shell ls /usr/lib/liblua* | grep
liblua5.1)
                        ifeq ($(LUA51),)
                                DEFS+=-I/usr/include/lua
                                LIBS= -llua -lm
                        else
                                DEFS+=-I/usr/include/lua5.1
                                LIBS= -llua5.1 -lm
                        endif
                else
                        ifeq ($(LUAVER),51)
                                DEFS+= $(shell pkg-config --cflags lua5.1 |
sed -e "s/\\\\/'/" -e "s/\\\\\"/\"'/")
                                LIBS = $(shell pkg-config --libs lua5.1)
                        else
                                DEFS+= $(shell pkg-config --cflags lua)
                                LIBS = $(shell pkg-config --libs lua)
                        endif
                endif
        endif
else
        DEFS+= $(shell lua-config --include)
        LIBS = $(shell lua-config --libs)
endif

DEFS+=-DKAMAILIO_MOD_INTERFACE

SERLIBPATH=../../lib
SER_LIBS+=$(SERLIBPATH)/kcore/kcore

include ../../Makefile.modules

What i need change in this Makefile in order to compile it with luajit
instead of lua5.1?

Thank you

-- 
Cumprimentos
José Seabra

Other related posts: