summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anylike.org>2009-12-27 04:13:42 +0000
committerChristian Pointner <equinox@anylike.org>2009-12-27 04:13:42 +0000
commit09685468dad6ecb15f99ae262dadff230614201b (patch)
treedd60f9e2594cea54ffadd8eff64360240dff174f
parentuse single lua object file now (diff)
added --with-lua to build system
-rw-r--r--src/anylike.c6
-rwxr-xr-xsrc/configure20
-rw-r--r--src/l_crypt.c4
-rw-r--r--src/l_crypt.h2
-rw-r--r--src/l_log.c4
-rw-r--r--src/l_log.h2
-rw-r--r--src/main_loop.lua1
-rw-r--r--src/options.c4
-rw-r--r--src/options.h2
9 files changed, 30 insertions, 15 deletions
diff --git a/src/anylike.c b/src/anylike.c
index 504f10f..bd5ed4b 100644
--- a/src/anylike.c
+++ b/src/anylike.c
@@ -27,9 +27,9 @@
#include <stdio.h>
#include <errno.h>
-#include <lua5.1/lua.h>
-#include <lua5.1/lualib.h>
-#include <lua5.1/lauxlib.h>
+#include <lua.h>
+#include <lualib.h>
+#include <lauxlib.h>
#include "datatypes.h"
#include "options.h"
diff --git a/src/configure b/src/configure
index c4c0f81..fdc1e0c 100755
--- a/src/configure
+++ b/src/configure
@@ -27,9 +27,11 @@ TARGET=`uname -s`
EBUILD_COMPAT=0
CFLAGS='-g -O2'
-LDFLAGS='-g -Wall -O2 -ldl -llua5.1'
+LDFLAGS='-g -Wall -O2 -ldl -lm'
CRYPTO_LIB='gcrypt'
+LUA_DIR=''
+LUAC=''
PREFIX='/usr/local'
SBINDIR=''
@@ -50,6 +52,7 @@ print_usage() {
echo " --examplesdir=<DIR> the path to the examples files (default: $PREFIX/share/examples)"
echo " --no-examples dont't install example files"
echo " --use-ssl-crypto use ssl crypto library instead of libgcrypt"
+ echo " --with-lua=<DIR> use this lua tree instead of system default"
}
for arg
@@ -82,6 +85,9 @@ do
--use-ssl-crypto)
CRYPTO_LIB='ssl'
;;
+ --with-lua=*)
+ LUA_DIR=${arg#--with-lua=}
+ ;;
--ebuild-compat)
EBUILD_COMPAT=1
;;
@@ -132,6 +138,16 @@ case $CRYPTO_LIB in
;;
esac
+if [ -z "$LUA_DIR" ]; then
+ CFLAGS="$CFLAGS -I/usr/include/lua5.1"
+ LDFLAGS="$LDFLAGS -llua5.1"
+ LUAC=luac5.1
+else
+ CFLAGS="$CFLAGS -I$LUA_DIR/include"
+ LDFLAGS="$LDFLAGS $LUA_DIR/lib/liblua.a"
+ LUAC=$LUA_DIR/bin/luac
+fi
+
if [ -z "$SBINDIR" ]; then
SBINDIR=$PREFIX/sbin
fi
@@ -157,7 +173,7 @@ TARGET := $TARGET
CC := gcc
CFLAGS := $CFLAGS
LDFLAGS := $LDFLAGS
-LUAC := luac
+LUAC := $LUAC
STRIP := strip
INSTALL := install
diff --git a/src/l_crypt.c b/src/l_crypt.c
index d2d551c..42aea59 100644
--- a/src/l_crypt.c
+++ b/src/l_crypt.c
@@ -23,8 +23,8 @@
* along with anylike. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <lua5.1/lua.h>
-#include <lua5.1/lauxlib.h>
+#include <lua.h>
+#include <lauxlib.h>
#include "l_crypt.h"
diff --git a/src/l_crypt.h b/src/l_crypt.h
index 39784aa..bfe0377 100644
--- a/src/l_crypt.h
+++ b/src/l_crypt.h
@@ -26,7 +26,7 @@
#ifndef ANYLIKE_l_crypt_h_INCLUDED
#define ANYLIKE_l_crypt_h_INCLUDED
-#include <lua5.1/lua.h>
+#include <lua.h>
#define LUA_CRYPTLIBNAME "crypt"
LUALIB_API int luaopen_crypt(lua_State *L);
diff --git a/src/l_log.c b/src/l_log.c
index 219d843..45dcac4 100644
--- a/src/l_log.c
+++ b/src/l_log.c
@@ -23,8 +23,8 @@
* along with anylike. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <lua5.1/lua.h>
-#include <lua5.1/lauxlib.h>
+#include <lua.h>
+#include <lauxlib.h>
#include <stdlib.h>
#include "log.h"
diff --git a/src/l_log.h b/src/l_log.h
index 483e08b..d257023 100644
--- a/src/l_log.h
+++ b/src/l_log.h
@@ -26,7 +26,7 @@
#ifndef ANYLIKE_l_log_h_INCLUDED
#define ANYLIKE_l_log_h_INCLUDED
-#include <lua5.1/lua.h>
+#include <lua.h>
#define LUA_LOGLIBNAME "log"
LUALIB_API int luaopen_log(lua_State *L);
diff --git a/src/main_loop.lua b/src/main_loop.lua
index b78ec89..4002f22 100644
--- a/src/main_loop.lua
+++ b/src/main_loop.lua
@@ -65,7 +65,6 @@ function main_loop(opt)
if(string.gsub(dgrm, "^(%w+)%s*%c$", "%1") == "quit") then
return 0
end
-
end
return 0 -- =0 -> OK, <0 -> error, >0 -> signal
diff --git a/src/options.c b/src/options.c
index dde60da..4728d87 100644
--- a/src/options.c
+++ b/src/options.c
@@ -23,8 +23,8 @@
* along with anylike. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <lua5.1/lua.h>
-#include <lua5.1/lauxlib.h>
+#include <lua.h>
+#include <lauxlib.h>
#include "datatypes.h"
#include "version.h"
diff --git a/src/options.h b/src/options.h
index a2c5597..d0ff83a 100644
--- a/src/options.h
+++ b/src/options.h
@@ -26,7 +26,7 @@
#ifndef ANYLIKE_options_h_INCLUDED
#define ANYLIKE_options_h_INCLUDED
-#include <lua5.1/lua.h>
+#include <lua.h>
#include "string_list.h"
#include "datatypes.h"