[sr-dev] git:master: app_lua: try to locate liblua for centos

Daniel-Constantin Mierla miconda at gmail.com
Tue Mar 29 12:17:55 CEST 2011


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Mar 29 12:16:13 2011 +0200

app_lua: try to locate liblua for centos

- centos has liblua instead of liblua5.1 and does not provide lua-config
  or pkg-config to discover the name of lua library
- in this case use shell to figure out whether is liblua5.1 or liblua

---

 modules/app_lua/Makefile |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/modules/app_lua/Makefile b/modules/app_lua/Makefile
index 89fc8d6..1ba3237 100644
--- a/modules/app_lua/Makefile
+++ b/modules/app_lua/Makefile
@@ -13,13 +13,25 @@ BUILDER = $(shell which lua-config)
 ifeq ($(BUILDER),)
 	BUILDER = $(shell which pkg-config)
 	ifeq ($(BUILDER),)
-		DEFS+=-I/usr/include/lua5.1
-		LIBS= -llua5.1
+		LUA51 = $(shell ls /usr/lib/liblua* | grep 5.1)
+		ifeq ($(LUA51),)
+			DEFS+=-I/usr/include/lua
+			LIBS= -llua
+		else
+			DEFS+=-I/usr/include/lua5.1
+			LIBS= -llua5.1
+		endif
 	else
 		LUALIBS = $(shell pkg-config --silence-errors --libs lua)
 		ifeq ($(LUALIBS),)
-			DEFS+=-I/usr/include/lua5.1
-			LIBS= -llua5.1
+			LUA51 = $(shell ls /usr/lib/liblua* | grep 5.1)
+			ifeq ($(LUA51),)
+				DEFS+=-I/usr/include/lua
+				LIBS= -llua
+			else
+				DEFS+=-I/usr/include/lua5.1
+				LIBS= -llua5.1
+			endif
 		else
 			DEFS+ = $(shell pkg-config --cflags lua)
 			LIBS = $(shell pkg-config --libs lua)




More information about the sr-dev mailing list