summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2014-01-08 16:34:24 +0000
committerKinsey Moore <kmoore@digium.com>2014-01-08 16:34:24 +0000
commit537f4a9dacc066893dad17a8a96c450de48abbdb (patch)
treeec14ea88c330d9b0f7ef967d139c24c1f5944b34 /configure
parent522593f901baff3f1ba334ecaad9eefd6a9c9316 (diff)
pbx_lua: Add support for Lua 5.2
This adds support for Lua 5.2 in pbx_lua which is available on newer operating systems. (closes issue ASTERISK-23011) Review: https://reviewboard.asterisk.org/r/3075/ Reported by: George Joseph Patch by: George Joseph ........ Merged revisions 405090 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 405091 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 405124 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@405130 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure116
1 files changed, 114 insertions, 2 deletions
diff --git a/configure b/configure
index a18565645..815bb64c0 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac Revision: 403161 .
+# From configure.ac Revision: 403330 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for asterisk trunk.
#
@@ -27445,6 +27445,118 @@ if test "x${PBX_LUA}" != "x1" -a "${USE_LUA}" != "no"; then
else
ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} "
+ as_ac_Lib=`$as_echo "ac_cv_lib_lua5.2_${pbxfuncname}" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -llua5.2" >&5
+$as_echo_n "checking for ${pbxfuncname} in -llua5.2... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-llua5.2 ${pbxlibdir} -lm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ${pbxfuncname} ();
+int
+main ()
+{
+return ${pbxfuncname} ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$as_ac_Lib=yes"
+else
+ eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+ AST_LUA_FOUND=yes
+else
+ AST_LUA_FOUND=no
+fi
+
+ CFLAGS="${ast_ext_lib_check_save_CFLAGS}"
+ fi
+
+ # now check for the header.
+ if test "${AST_LUA_FOUND}" = "yes"; then
+ LUA_LIB="${pbxlibdir} -llua5.2 -lm"
+ # if --with-LUA=DIR has been specified, use it.
+ if test "x${LUA_DIR}" != "x"; then
+ LUA_INCLUDE="-I${LUA_DIR}/include"
+ fi
+ LUA_INCLUDE="${LUA_INCLUDE} "
+ if test "xlua5.2/lua.h" = "x" ; then # no header, assume found
+ LUA_HEADER_FOUND="1"
+ else # check for the header
+ ast_ext_lib_check_saved_CPPFLAGS="${CPPFLAGS}"
+ CPPFLAGS="${CPPFLAGS} ${LUA_INCLUDE}"
+ ac_fn_c_check_header_mongrel "$LINENO" "lua5.2/lua.h" "ac_cv_header_lua5_2_lua_h" "$ac_includes_default"
+if test "x$ac_cv_header_lua5_2_lua_h" = xyes; then :
+ LUA_HEADER_FOUND=1
+else
+ LUA_HEADER_FOUND=0
+fi
+
+
+ CPPFLAGS="${ast_ext_lib_check_saved_CPPFLAGS}"
+ fi
+ if test "x${LUA_HEADER_FOUND}" = "x0" ; then
+ LUA_LIB=""
+ LUA_INCLUDE=""
+ else
+ if test "x${pbxfuncname}" = "x" ; then # only checking headers -> no library
+ LUA_LIB=""
+ fi
+ PBX_LUA=1
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LUA 1
+_ACEOF
+
+ fi
+ fi
+fi
+
+
+if test "x${PBX_LUA}" = "x1" ; then
+ if test x"${LUA_DIR}" = x; then
+ LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua5.2"
+ else
+ LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua5.2"
+ fi
+fi
+
+
+if test "x${PBX_LUA}" != "x1" -a "${USE_LUA}" != "no"; then
+ pbxlibdir=""
+ # if --with-LUA=DIR has been specified, use it.
+ if test "x${LUA_DIR}" != "x"; then
+ if test -d ${LUA_DIR}/lib; then
+ pbxlibdir="-L${LUA_DIR}/lib"
+ else
+ pbxlibdir="-L${LUA_DIR}"
+ fi
+ fi
+ pbxfuncname="luaL_newstate"
+ if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
+ AST_LUA_FOUND=yes
+ else
+ ast_ext_lib_check_save_CFLAGS="${CFLAGS}"
+ CFLAGS="${CFLAGS} "
as_ac_Lib=`$as_echo "ac_cv_lib_lua5.1_${pbxfuncname}" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${pbxfuncname} in -llua5.1" >&5
$as_echo_n "checking for ${pbxfuncname} in -llua5.1... " >&6; }
@@ -27552,7 +27664,7 @@ if test "x${PBX_LUA}" != "x1" -a "${USE_LUA}" != "no"; then
pbxlibdir="-L${LUA_DIR}"
fi
fi
- pbxfuncname="luaL_register"
+ pbxfuncname="luaL_openlib"
if test "x${pbxfuncname}" = "x" ; then # empty lib, assume only headers
AST_LUA_FOUND=yes
else