]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 265747 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 26 May 2010 00:33:49 +0000 (00:33 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 26 May 2010 00:33:49 +0000 (00:33 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@265748 65c4cc65-6c06-0410-ace0-fbb531ad65f3

configure
configure.ac
include/asterisk/autoconfig.h.in
pbx/pbx_lua.c

index aff6c096c2f325804d9b9f16c7d910718413c32f..2246def02f5b88bc63257ba1c7113f1d742ac507 100755 (executable)
--- 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.
 #
 
 
 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.
index 57913747c9ff674696daf1e3f5292637710bf5a6..d36db4195bbc18ac4dc2f7a2ce6d0af26def6b23 100644 (file)
@@ -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.
index 9bd4ca16bb858af0071999078c38074c9016831f..a6f108e82e21a4acdcb4a97b8ccd300b7edc91f9 100644 (file)
    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
 
index afa89de6a05c8d869d7aa4f27241b235dcec8036..2c84066c98202739d16444596a7aef75f7dd53ac 100644 (file)
@@ -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";