aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-26 00:33:49 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-26 00:33:49 +0000
commit6be8ca8adc82f5475f53267a040637a26c76d4ed (patch)
tree30de789a55618e26c54888c7561337761ad12b51
parent0319d5c4d9d245a7711472254a8d1d47a54325b1 (diff)
Merged revisions 265747 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r265747 | tilghman | 2010-05-25 19:29:40 -0500 (Tue, 25 May 2010) | 8 lines Use configure to determine the prefixes and include directories properly. This ensures cross-platform compatibility, even among Linux distributions, which don't always put headers in the same place. (closes issue #17391) Reported by: loloski ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@265748 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xconfigure12
-rw-r--r--configure.ac6
-rw-r--r--include/asterisk/autoconfig.h.in3
-rw-r--r--pbx/pbx_lua.c6
4 files changed, 11 insertions, 16 deletions
diff --git a/configure b/configure
index aff6c096c..2246def02 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac Revision: 262051 .
+# From configure.ac Revision: 264250 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for asterisk 1.6.
#
@@ -34607,11 +34607,11 @@ fi
if test "x${PBX_LUA}" = "x1" ; then
-
-cat >>confdefs.h <<_ACEOF
-#define LUA51_PREFIX 1
-_ACEOF
-
+ if test x"${LUA_DIR}" = x; then
+ LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua5.1"
+ else
+ LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua5.1"
+ fi
fi
# Some distributions (like SuSE) remove the 5.1 suffix.
diff --git a/configure.ac b/configure.ac
index 57913747c..d36db4195 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1560,7 +1560,11 @@ fi
AST_EXT_LIB_CHECK([LUA], [lua5.1], [luaL_newstate], [lua5.1/lua.h], [-lm])
if test "x${PBX_LUA}" = "x1" ; then
- AC_DEFINE_UNQUOTED([LUA51_PREFIX], [1], [Define to 1 if lua is found with a lua5.1 prefix])
+ if test x"${LUA_DIR}" = x; then
+ LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua5.1"
+ else
+ LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua5.1"
+ fi
fi
# Some distributions (like SuSE) remove the 5.1 suffix.
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in
index 9bd4ca16b..a6f108e82 100644
--- a/include/asterisk/autoconfig.h.in
+++ b/include/asterisk/autoconfig.h.in
@@ -909,9 +909,6 @@
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
-/* Define to 1 if lua is found with a lua5.1 prefix */
-#undef LUA51_PREFIX
-
/* Build chan_misdn for mISDN 1.2 or later. */
#undef MISDN_1_2
diff --git a/pbx/pbx_lua.c b/pbx/pbx_lua.c
index afa89de6a..2c84066c9 100644
--- a/pbx/pbx_lua.c
+++ b/pbx/pbx_lua.c
@@ -42,15 +42,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/paths.h"
#include "asterisk/hashtab.h"
-#ifdef LUA51_PREFIX
-#include <lua5.1/lua.h>
-#include <lua5.1/lauxlib.h>
-#include <lua5.1/lualib.h>
-#else
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
-#endif
static char *config = "extensions.lua";
static char *registrar = "pbx_lua";