From 99bf8ff0ed62bebb7e5c2e77308724ffda7aa0c6 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Sun, 9 Mar 2014 18:21:47 +0200 Subject: [PATCH] lua-5.2: build-sys: allow building against a specified Lua version. --- configure.ac | 22 ++++++++++++++++------ src/Makefile.am | 2 ++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 15e9cbc..9cd0085 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,9 @@ AC_PROG_YACC AM_PROG_LEX AC_SUBST(LEXLIB) +# Make first invocation of PKG_CHECK_MODULES 'if-then-else-fi'-safe. +PKG_PROG_PKG_CONFIG + # Don't require ctags (we keep linker scripts and debug files in the repo now). #AC_CHECK_PROG(CTAGS, ctags, "ctags") #if test "$CTAGS" != "ctags" ; then @@ -109,13 +112,17 @@ fi AC_SUBST(WARNING_CFLAGS) -# check for Lua -PKG_CHECK_MODULES(LUA, lua >= 5.1.1, [try_lua51=no], [try_lua51=yes]) +# By default use the system default Lua (assumed to be called lua(.pc). +# You can override this using the --with-lua option. For instance +# on Ubuntu you'd need to use --with-lua=lua5.1. +AC_ARG_WITH(lua, + [ --with-lua build with specified Lua (pkgconfig filename without .pc suffix)], + [with_lua=$withval], [with_lua=lua]) + +# Check for Lua. +AC_MSG_NOTICE([Compiling with Lua package $with_lua.]) +PKG_CHECK_MODULES(LUA, $with_lua >= 5.1.1) -# At least Ubuntu packages lua 5.1 as lua5.1... try that if needed. -if test "$try_lua51" = "yes"; then - PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1.1) -fi AC_SUBST(LUA_CFLAGS) AC_SUBST(LUA_LIBS) @@ -622,6 +629,9 @@ AC_OUTPUT # Display the configuration. echo "----- configuration -----" echo "Extra C warnings flags: $WARNING_CFLAGS" +echo "Lua (pkgconfig file) to use: $with_lua" +echo " * cflags: $LUA_CFLAGS" +echo " * libs: $LUA_LIBS" echo "D-Bus (libdbus) support: $enable_libdbus" echo "D-Bus (systemd-bus) support: $enable_sdbus" echo "PulseAudio mainloop support: $enable_pulse" diff --git a/src/Makefile.am b/src/Makefile.am index 8c6f684..3db6e44 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -157,6 +157,7 @@ libmurphy_lua_utils_ladir = \ $(includedir)/murphy/core/lua-utils libmurphy_lua_utils_la_HEADERS = \ + core/lua-utils/lua-utils.h \ core/lua-utils/strarray.h \ core/lua-utils/funcbridge.h \ core/lua-utils/object.h \ @@ -164,6 +165,7 @@ libmurphy_lua_utils_la_HEADERS = \ core/lua-utils/include.h libmurphy_lua_utils_la_REGULAR_SOURCES = \ + core/lua-utils/lua-utils.c \ core/lua-utils/strarray.c \ core/lua-utils/funcbridge.c \ core/lua-utils/object.c \ -- 2.7.4