<div dir="ltr">Hi,<div><br></div><div>It looks like this patch changed the default behavior and configure started to enable Lua even when it gets called without --enable-lua parameter.</div><div><br></div><div><div>./configure --prefix=/usr --sysconfdir=/etc --bindir=/usr/bin --libdir=/usr/lib/x86_64-linux-gnu/ --localstatedir=/var --includedir=/usr/include --disable-rpath --enable-python</div>

<div><br></div><div>checking for a BSD-compatible install... /usr/bin/install -c</div><div>checking whether build environment is sane... yes</div><div>checking for a thread-safe mkdir -p... /bin/mkdir -p</div><div>checking for gawk... gawk</div>

<div>checking whether make sets $(MAKE)... yes</div><div>checking build system type... x86_64-unknown-linux-gnu</div><div>checking host system type... x86_64-unknown-linux-gnu</div><div>checking for style of include used by make... GNU</div>

<div>checking for gcc... gcc</div><div>checking whether the C compiler works... yes</div><div>checking for C compiler default output file name... a.out</div><div>checking for suffix of executables...</div><div>checking whether we are cross compiling... no</div>

<div>checking for suffix of object files... o</div><div>checking whether we are using the GNU C compiler... yes</div><div>checking whether gcc accepts -g... yes</div><div>checking for gcc option to accept ISO C89... none needed</div>

<div>checking dependency style of gcc... gcc3</div><div>checking whether gcc and cc understand -c and -o together... yes</div><div>checking how to run the C preprocessor... gcc -E</div><div>checking for grep that handles long lines and -e... /bin/grep</div>

<div>checking for egrep... /bin/grep -E</div><div>checking for ANSI C header files... yes</div><div>checking for sys/types.h... yes</div><div>checking for sys/stat.h... yes</div><div>checking for stdlib.h... yes</div><div>

checking for string.h... yes</div><div>checking for memory.h... yes</div><div>checking for strings.h... yes</div><div>checking for inttypes.h... yes</div><div>checking for stdint.h... yes</div><div>checking for unistd.h... yes</div>

<div>checking minix/config.h usability... no</div><div>checking minix/config.h presence... no</div><div>checking for minix/config.h... no</div><div>checking whether it is safe to define __EXTENSIONS__... yes</div><div>checking host distribution... ubuntu</div>

<div>checking for newuidmap... no</div><div>checking for docbook2x-man... no</div><div>checking for aa_change_profile in -lapparmor... no</div><div>checking for gnutls_hash_fast in -lgnutls... no</div><div>checking for seccomp_init in -lseccomp... no</div>

<div>checking for scmp_filter_ctx... no</div><div>checking for pkg-config... /usr/bin/pkg-config</div><div>checking pkg-config is at least version 0.9.0... yes</div><div>checking for a Python interpreter with version >= 3.2... python3</div>

<div>checking for python3... /usr/bin/python3</div><div>checking for python3 version... 3.3</div><div>checking for python3 platform... linux</div><div>checking for python3 script directory... ${prefix}/lib/python3/dist-packages</div>

<div>checking for python3 extension module directory... ${exec_prefix}/lib/python3/dist-packages</div><div>checking for PYTHONDEV... yes</div><div>checking for LUA... no</div><div>checking for LUA... no</div><div>checking for LUA... no</div>

<div>configure: error: Package requirements (lua5.1) were not met:</div><div><br></div><div>No package 'lua5.1' found</div><div><br></div><div>Consider adjusting the PKG_CONFIG_PATH environment variable if you</div>

<div>installed software in a non-standard prefix.</div><div><br></div><div>Alternatively, you may set the environment variables LUA_CFLAGS</div><div>and LUA_LIBS to avoid the need to call pkg-config.</div><div>See the pkg-config man page for more details.</div>

</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 5, 2013 at 11:13 AM, Natanael Copa <span dir="ltr"><<a href="mailto:ncopa@alpinelinux.org" target="_blank">ncopa@alpinelinux.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Enable support for both Lua 5.1 and 5.2 by let user specify the Lua<br>
pkg-config package name. By default it will use 'lua' and try figure<br>
out which version it is.<br>
<br>
Signed-off-by: Natanael Copa <<a href="mailto:ncopa@alpinelinux.org">ncopa@alpinelinux.org</a>><br>
---<br>
</div>Changes v1 -> v2:<br>
 - define PKG_CHECK_VAR which was introduced in pkg-config 0.28. Ubuntu<br>
   ships 0.26.<br>
<br>
 <a href="http://configure.ac" target="_blank">configure.ac</a>            | 47 ++++++++++++++++++++++++++++++++++++++---------<br>
 src/lua-lxc/Makefile.am |  4 ++--<br>
 2 files changed, 40 insertions(+), 11 deletions(-)<br>
<br>
diff --git a/<a href="http://configure.ac" target="_blank">configure.ac</a> b/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
index 6b68703..1e2c713 100644<br>
--- a/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" target="_blank">configure.ac</a><br>
@@ -150,22 +150,51 @@ AM_COND_IF([ENABLE_PYTHON],<br>
        PKG_CHECK_MODULES([PYTHONDEV], [python3 >= 3.2],[],[AC_MSG_ERROR([You must install python3-dev])])<br>
<div class="im">        AC_DEFINE_UNQUOTED([ENABLE_PYTHON], 1, [Python3 is available])])<br>
<br>
</div>-# Lua module and scripts<br>
<div class="im">-if test x"$with_distro" = "xdebian" -o x"$with_distro" = "xubuntu" ; then<br>
-    LUAPKGCONFIG=lua5.1<br>
-else<br>
-    LUAPKGCONFIG=lua<br>
-fi<br>
</div>+dnl PKG_CHECK_VAR was introduced with pkg-config 0.28<br>
+m4_ifdef([PKG_CHECK_VAR], [],<br>
+[AC_DEFUN([PKG_CHECK_VAR],<br>
+    [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl<br>
+     AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl<br>
+     _PKG_CONFIG([$1], [variable="][$3]["], [$2])<br>
+     AS_VAR_COPY([$1], [pkg_cv_][$1])<br>
+     AS_VAR_IF([$1], [""], [$5], [$4])dnl<br>
+    ])# PKG_CHECK_VAR<br>
+])<br>
<br>
+# Lua module and scripts<br>
<div class="HOEnZb"><div class="h5"> AC_ARG_ENABLE([lua],<br>
        [AC_HELP_STRING([--enable-lua], [enable lua binding])],<br>
        [enable_lua=yes], [enable_lua=no])<br>
<br>
-AM_CONDITIONAL([ENABLE_LUA], [test "x$enable_lua" = "xyes"])<br>
+AC_ARG_WITH([lua-pc],<br>
+       [AS_HELP_STRING(<br>
+               [--with-lua-pc=PKG],<br>
+               [Specify pkg-config package name for lua]<br>
+       )],<br>
+       [LUAPKGCONFIG=$with_lua_pc<br>
+       enable_lua=yes], [with_lua_pc=auto])<br>
+<br>
+AM_CONDITIONAL([ENABLE_LUA],<br>
+       [test "x$enable_lua" = "xyes" -o "xwith_lua_pc != xno"])<br>
<br>
 AM_COND_IF([ENABLE_LUA],<br>
-       [PKG_CHECK_MODULES([LUA], [$LUAPKGCONFIG >= 5.1],[],[AC_MSG_ERROR([You must install lua-devel for lua 5.1])])<br>
-       AC_DEFINE_UNQUOTED([ENABLE_LUA], 1, [Lua is available])])<br>
+       [AS_IF([test "x$with_lua_pc" = "xauto"],<br>
+               [PKG_CHECK_MODULES([LUA], [lua],[LUAPKGCONFIG=lua],<br>
+                       [PKG_CHECK_MODULES([LUA], [lua5.2],[LUAPKGCONFIG=lua5.2],<br>
+                               [PKG_CHECK_MODULES([LUA], [lua5.1],<br>
+                                       [LUAPKGCONFIG=lua5.1])]<br>
+                       )]<br>
+               )],<br>
+               [PKG_CHECK_MODULES([LUA], [$with_lua_pc])])<br>
+       AC_MSG_CHECKING([Lua version])<br>
+       PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [V],,<br>
+               [PKG_CHECK_VAR([LUA_VERSION], [$LUAPKGCONFIG], [major_version])])<br>
+       AC_MSG_RESULT([$LUA_VERSION])<br>
+       PKG_CHECK_VAR([LUA_INSTALL_CMOD], [$LUAPKGCONFIG], [INSTALL_CMOD],,<br>
+               [LUA_INSTALL_CMOD=$libdir/lua/$LUA_VERSION])<br>
+       PKG_CHECK_VAR([LUA_INSTALL_LMOD], [$LUAPKGCONFIG], [INSTALL_LMOD],,<br>
+               [LUA_INSTALL_LMOD=$datadir/lua/$LUA_VERSION])<br>
+       ])<br>
<br>
 # Optional test binaries<br>
 AC_ARG_ENABLE([tests],<br>
diff --git a/src/lua-lxc/Makefile.am b/src/lua-lxc/Makefile.am<br>
index 82dbae8..11eabfd 100644<br>
--- a/src/lua-lxc/Makefile.am<br>
+++ b/src/lua-lxc/Makefile.am<br>
@@ -1,7 +1,7 @@<br>
 if ENABLE_LUA<br>
<br>
-luadir=$(datadir)/lua/5.1<br>
-sodir=$(libdir)/lua/5.1/lxc<br>
+luadir=$(LUA_INSTALL_LMOD)<br>
+sodir=$(LUA_INSTALL_CMOD)/lxc<br>
<br>
 lua_SCRIPTS=lxc.lua<br>
<br>
--<br>
1.8.4<br>
<br>
<br>
------------------------------------------------------------------------------<br>
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!<br>
Discover the easy way to master current and previous Microsoft technologies<br>
and advance your career. Get an incredible 1,500+ hours of step-by-step<br>
tutorial videos with LearnDevNow. Subscribe today and save!<br>
<a href="http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk" target="_blank">http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk</a><br>
_______________________________________________<br>
Lxc-devel mailing list<br>
<a href="mailto:Lxc-devel@lists.sourceforge.net">Lxc-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/lxc-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/lxc-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>S.Çağlar Onur <<a href="mailto:caglar@10ur.org">caglar@10ur.org</a>>
</div>