Module: sip-router
Branch: 4.1
Commit: a0d8ea1c69e01b90d57a2352f94a0aca691a245a
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a0d8ea1c69e01b90d57a2352f94a0aca691a245a

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date:   Mon Sep  1 18:29:20 2014 +0200

app_lua: search for for lua 5.1 compilation flags

- lua 5.2 embedded api is not compatible with 5.1
- an upgrade to c code in app_lua is required, till then, lua-5.1 has to
  be installed (can co-exist with lua 5.2)

(cherry picked from commit 04da8d891cdf1314e24cf025b64ed1cc70ce7b5e)

---

 modules/app_lua/Makefile |   24 +++++++++++++++++-------
 1 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/modules/app_lua/Makefile b/modules/app_lua/Makefile
index af30c4a..864e6d9 100644
--- a/modules/app_lua/Makefile
+++ b/modules/app_lua/Makefile
@@ -8,12 +8,12 @@ auto_gen=
 NAME=app_lua.so
 
 ifeq ($(CROSS_COMPILE),)
-BUILDER = $(shell which lua-config)
+       BUILDER = $(shell which lua-config)
 endif
 
 ifeq ($(BUILDER),)
        ifeq ($(CROSS_COMPILE),)
-       BUILDER = $(shell which pkg-config)
+               BUILDER = $(shell which pkg-config)
        endif
        ifeq ($(BUILDER),)
                LUA51 = $(shell ls $(LOCALBASE)/lib/liblua* | grep liblua5.1)
@@ -28,14 +28,19 @@ ifeq ($(BUILDER),)
                endif
        else
                LUAVER=XX
-               LUALIBS = $(shell pkg-config --silence-errors --libs lua)
+               LUALIBS = $(shell pkg-config --silence-errors --libs lua-5.1)
                ifeq ($(LUALIBS),)
                        LUALIBS = $(shell pkg-config --silence-errors --libs 
lua5.1)
-                       ifneq ($(LUALIBS),)
+                       ifeq ($(LUALIBS),)
+                               LUALIBS = $(shell pkg-config --silence-errors 
--libs lua)
+                               ifneq ($(LUALIBS),)
+                                       LUAVER=5X
+                               endif
+                       else
                                LUAVER=51
                        endif
                else
-                       LUAVER=5X
+                       LUAVER=51X
                endif
                ifeq ($(LUAVER),XX)
                        LUA51 = $(shell ls /usr/lib/liblua* | grep liblua5.1)
@@ -51,8 +56,13 @@ ifeq ($(BUILDER),)
                                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)
+                               ifeq ($(LUAVER),51X)
+                                       DEFS+= $(shell pkg-config --cflags 
lua-5.1)
+                                       LIBS = $(shell pkg-config --libs 
lua-5.1)
+                               else
+                                       DEFS+= $(shell pkg-config --cflags lua)
+                                       LIBS = $(shell pkg-config --libs lua)
+                               endif
                        endif
                endif
        endif


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to