summary refs log tree commit diff stats
path: root/configure.ac
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2016-04-03 10:28:11 -0400
committerPatrick Griffis <tingping@tingping.se>2016-04-03 10:30:01 -0400
commit2e478f1b5a8ffbc388652a28d17f374fc7a82145 (patch)
treefd05cbd2917232c781500aab4a2e7c2014a93e27 /configure.ac
parenta77c6df7e271dfaee8b27d73da380d1759593e07 (diff)
Import lua plugin
Written by @mniip
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac41
1 files changed, 41 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9c188fb1..744c96d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,6 +118,10 @@ AC_ARG_ENABLE(perl,
 	[AS_HELP_STRING([--disable-perl],[don\'t build the perl plugin])],
         perl=$enableval, perl=yes)
 
+AC_ARG_ENABLE(lua,
+	[AS_HELP_STRING([--disable-lua],[don\'t build the lua plugin])],
+        lua=$enableval, lua=yes)
+
 AC_ARG_ENABLE(perl_old,
 	[AS_HELP_STRING([--disable-perl_old],[no backwards compatibility for perl plugin])],
         perl_old=$enableval, perl_old=yes)
@@ -218,6 +222,40 @@ AS_IF([test "x$_gdk_tgt" = xquartz], [
 	])
 ])
 
+
+dnl *********************************************************************
+dnl ** Lua **************************************************************
+dnl *********************************************************************
+
+AS_IF([test "$lua" = yes], [
+	AC_MSG_CHECKING(for plugin interface used by lua)
+	AS_IF([test "$plugin" = yes], [
+		AC_MSG_RESULT([yes])
+
+		m4_define_default([_LUA_LIST], [luajit lua lua5.3 lua53 lua5.2 lua52 lua5.1 lua51])
+
+		AC_ARG_VAR([LUA], [The Lua pkgconfig name, e.g. luajit or lua5.2])
+		AS_IF([test "x$LUA" = 'x'], [
+			for lua_var in _LUA_LIST; do
+				$PKG_CONFIG --exists $lua_var || continue
+				LUA=$lua_var
+				break
+			done
+			AS_IF([test "x$LUA" = 'x'], [
+				AC_MSG_ERROR([Failed to find lua])
+			])
+		])
+
+		PKG_CHECK_MODULES([LUA], $LUA, [
+			AC_SUBST([LUA_CFLAGS])
+			AC_SUBST([LUA_LIBS])
+		])
+	], [
+		AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for lua])
+		lua=no
+	])
+])
+
 dnl *********************************************************************
 dnl ** PERL *************************************************************
 dnl *********************************************************************
@@ -564,6 +602,7 @@ AM_CONDITIONAL(USE_LIBCANBERRA, test "x$libcanberra" = "xyes")
 AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
 AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
 AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
+AM_CONDITIONAL(DO_LUA, test "x$lua" = "xyes")
 AM_CONDITIONAL(DO_PYTHON, test "x$python" != "xno")
 AM_CONDITIONAL(DO_PLUGIN, test "x$plugin" = "xyes")
 AM_CONDITIONAL(DO_CHECKSUM, test "x$checksum" = "xyes")
@@ -716,6 +755,7 @@ src/htm/Makefile
 src/htm/thememan
 osx/Info.plist
 plugins/Makefile
+plugins/lua/Makefile
 plugins/python/Makefile
 plugins/perl/Makefile
 plugins/checksum/Makefile
@@ -741,6 +781,7 @@ echo libcanberra support ... : $libcanberra
 echo Plugin interface ...... : $plugin
 echo libproxy support ...... : $libproxy
 echo
+echo Lua ................... : $lua \($LUA\)
 echo Perl .................. : $perl
 echo Python ................ : $python
 echo