summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac44
1 files changed, 9 insertions, 35 deletions
diff --git a/configure.ac b/configure.ac
index 74560c5..a854642 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,13 +40,6 @@ AC_DEFINE([_GNU_SOURCE], [], [Enable GNU Extensions])
dnl **************************************************************
-AC_ARG_WITH(lua-headers,
- [ --with-lua-headers=DIR lua include files location],
- [LUA_HDR_DIR="$withval"]
- [CFLAGS="$CFLAGS -I$withval"]
-)
-
-
dnl Checks for lua
luashell=false
@@ -54,36 +47,17 @@ luacshell=false
ac_report_have_lua=disabled
ac_report_bash_extensions=disabled
+AC_ARG_WITH([lua],
+ AS_HELP_STRING([--with-lua], [Specify lua pkg-config name (default is 'lua')]))
-AC_ARG_WITH(lua,
- AS_HELP_STRING([--with-lua[[=DIR]]],[use lua in DIR]),
-[ case "$withval" in
- no) ac_report_have_lua=disabled
- ;;
- *) AC_SEARCH_LIBS(dlopen, dl)
- # ubuntu has lua5.1 rather than just lua
- if pkg-config --exists lua5.1; then
- LUALIB=lua5.1
- else
- LUALIB=lua
- fi
- if test -z "$LUA_HDR_DIR"; then
- CFLAGS="$CFLAGS `pkg-config $LUALIB --cflags`"
- fi
- LIBS="$LIBS -lm"
- LDFLAGS="$LDFLAGS -Wl,-E -L$withval"
- AC_DEFINE(USE_LUA, , [Enable Lua])
-
- AC_CHECK_LIB($LUALIB, luaL_newstate, , [
- AC_MSG_ERROR([The Lua runtime library cannot be found!])
- ], $LIBS)
- luashell=true
- luacshell=true
- ac_report_have_lua=enabled
- ;;
- esac ], [
- ac_report_have_lua=disabled
+AS_IF([test "x$with_lua" = "xyes"], [with_lua=lua])
+AS_IF([test "x$with_lua" != "xno"], [
+ luashell=true
+ luacshell=true
+ ac_report_have_lua=enabled
+ PKG_CHECK_MODULES([LUA], [$with_lua])
])
+
AM_CONDITIONAL(USE_LUA, test x$ac_report_have_lua = xenabled)
# If Lua is enabled, the user can choose between two different shells