From aeadddcc93a0464f4b562a4fac4ec41b5aa6ab78 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 30 Dec 2009 16:56:34 +0000 Subject: builds now on freebsd --- src/anylike.c | 2 +- src/configure | 26 ++++++++++++++++++-------- src/l_log.c | 2 ++ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/anylike.c b/src/anylike.c index eb31e09..b154c45 100644 --- a/src/anylike.c +++ b/src/anylike.c @@ -53,7 +53,7 @@ #ifndef USE_OPENSSL -#define MIN_GNUTLS_VERSION "2.8.3" +#define MIN_GNUTLS_VERSION "2.6.4" void anylike_gnutls_log_func(int level, const char* msg) { diff --git a/src/configure b/src/configure index 944acd7..f5e7050 100755 --- a/src/configure +++ b/src/configure @@ -33,7 +33,7 @@ TARGET=`uname -s` EBUILD_COMPAT=0 CFLAGS='-g -O2' -LDFLAGS='-g -Wall -O2 -ldl -lm' +LDFLAGS='-g -Wall -O2 -lm' CRYPTO_LIB='gnutls' LUA_DIR='' @@ -121,6 +121,7 @@ rm -f version.h rm -f include.mk case $TARGET in Linux) + LDFLAGS=$LDFLAGS' -ldl' ;; OpenBSD|FreeBSD|NetBSD|GNU/kFreeBSD) CFLAGS=$CFLAGS' -I/usr/local/include' @@ -151,7 +152,7 @@ test_lua_version() LUA_VERSION_NUM=`cat $1 | grep "#define LUA_VERSION_NUM" | awk '{ print $3 }'` LUA_RELEASE=`cat $1 | grep "#define LUA_RELEASE[ ]" | cut -f2-` - if [ $LUA_VERSION_NUM -ge 500 ]; then + if [ $LUA_VERSION_NUM -ge 501 ]; then return 1; else return 0; @@ -171,26 +172,35 @@ if [ -z "$LUA_DIR" ]; then break fi else - for dir in $prefix/include/lua*; do + for dir in `ls -d $prefix/include/lua* 2> /dev/null`; do if [ -e $dir/lua.h ]; then test_lua_version $dir/lua.h if [ $? -eq 1 ]; then echo "using Lua $LUA_VERSION ($LUA_RELEASE) found at $dir" CFLAGS="$CFLAGS -I$dir" - LDFLAGS="$LDFLAGS -L$prefix/lib -llua$LUA_VERSION" - LUA=$prefix/bin/lua$LUA_VERSION - LUAC=$prefix/bin/luac$LUA_VERSION + if [ -x "$prefix/bin/lua$LUA_VERSION" ]; then + LDFLAGS="$LDFLAGS -L$prefix/lib -llua$LUA_VERSION" + LUA=$prefix/bin/lua$LUA_VERSION + LUAC=$prefix/bin/luac$LUA_VERSION + elif [ -x "$prefix/bin/lua-$LUA_VERSION" ]; then + LDFLAGS="$LDFLAGS -L$prefix/lib -llua-$LUA_VERSION" + LUA=$prefix/bin/lua-$LUA_VERSION + LUAC=$prefix/bin/luac-$LUA_VERSION + else + echo "ERROR: found lua.h at $dir/lua.h but no matching lua and luac" + return 1 + fi break fi fi done - if [ -n $LUAC ]; then + if [ -n "$LUAC" ]; then break fi fi done - if [ -z $LUAC ]; then + if [ -z "$LUAC" ]; then echo "ERROR: no suitable lua found .. please install lua 5.1 or higher or use --with-lua" return 1 fi diff --git a/src/l_log.c b/src/l_log.c index 4aa7ad5..528fe95 100644 --- a/src/l_log.c +++ b/src/l_log.c @@ -33,6 +33,8 @@ #include #include + +#include "datatypes.h" #include "log.h" #include "l_log.h" -- cgit v1.2.3