From 09685468dad6ecb15f99ae262dadff230614201b Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 27 Dec 2009 04:13:42 +0000 Subject: added --with-lua to build system --- src/anylike.c | 6 +++--- src/configure | 20 ++++++++++++++++++-- src/l_crypt.c | 4 ++-- src/l_crypt.h | 2 +- src/l_log.c | 4 ++-- src/l_log.h | 2 +- src/main_loop.lua | 1 - src/options.c | 4 ++-- src/options.h | 2 +- 9 files changed, 30 insertions(+), 15 deletions(-) (limited to 'src') 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 #include -#include -#include -#include +#include +#include +#include #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= 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= 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 . */ -#include -#include +#include +#include #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 +#include #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 . */ -#include -#include +#include +#include #include #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 +#include #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 . */ -#include -#include +#include +#include #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 +#include #include "string_list.h" #include "datatypes.h" -- cgit v1.2.3