From 6f90dbc56abbbc9915420bcd4a03fdca3c313193 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 6 Apr 2010 23:30:14 +0000 Subject: don't link to luasocket library (fixed build on freebsd) --- README | 2 +- src/anylike.c | 3 +-- src/configure | 6 +++--- src/echo_server.lua | 2 ++ src/main_loop.lua | 2 ++ 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README b/README index ebb04a1..55411f2 100644 --- a/README +++ b/README @@ -24,7 +24,7 @@ common: build-essential lua5.1 liblua5.1-0-dev - liblua5.1-socket-dev + liblua5.1-socket2 using gnutls: libgnutls-dev diff --git a/src/anylike.c b/src/anylike.c index 826824a..dca1c54 100644 --- a/src/anylike.c +++ b/src/anylike.c @@ -36,7 +36,6 @@ #include #include #include -#include #include "datatypes.h" #include "options.h" @@ -99,13 +98,13 @@ extern const u_int32_t anylike_lua_bytecode_len; static const luaL_Reg anylike_lualibs[] = { {"", luaopen_base}, + {LUA_LOADLIBNAME, luaopen_package}, {LUA_TABLIBNAME, luaopen_table}, {LUA_STRLIBNAME, luaopen_string}, {LUA_MATHLIBNAME, luaopen_math}, {LUA_LOGLIBNAME, luaopen_log}, {LUA_SIGNALLIBNAME, luaopen_signal}, {LUA_CRYPTLIBNAME, luaopen_crypt}, - {"socket", luaopen_socket_core}, {NULL, NULL} }; diff --git a/src/configure b/src/configure index 3636e09..64de316 100755 --- a/src/configure +++ b/src/configure @@ -176,7 +176,7 @@ if [ -z "$LUA_DIR" ]; then if [ $? -eq 1 ]; then echo "using Lua $LUA_VERSION ($LUA_RELEASE) found at $prefix/include" CFLAGS="$CFLAGS -I$prefix/include" - LDFLAGS="$LDFLAGS -L$prefix/lib -llua -llua-socket" + LDFLAGS="$LDFLAGS -L$prefix/lib -llua" LUA=$prefix/lua LUAC=$prefix/luac break @@ -189,11 +189,11 @@ if [ -z "$LUA_DIR" ]; then echo "using Lua $LUA_VERSION ($LUA_RELEASE) found at $dir" CFLAGS="$CFLAGS -I$dir" if [ -x "$prefix/bin/lua$LUA_VERSION" ]; then - LDFLAGS="$LDFLAGS -L$prefix/lib -llua$LUA_VERSION -llua$LUA_VERSION-socket" + 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 -llua-$LUA_VERSION-socket" + LDFLAGS="$LDFLAGS -L$prefix/lib -llua-$LUA_VERSION" LUA=$prefix/bin/lua-$LUA_VERSION LUAC=$prefix/bin/luac-$LUA_VERSION else diff --git a/src/echo_server.lua b/src/echo_server.lua index 7ad206a..6770421 100644 --- a/src/echo_server.lua +++ b/src/echo_server.lua @@ -29,6 +29,8 @@ -- along with anylike. If not, see . -- +socket = require("socket") + echo_server = {} echo_server.init = function(host, port) diff --git a/src/main_loop.lua b/src/main_loop.lua index 9796d83..f7f09e9 100644 --- a/src/main_loop.lua +++ b/src/main_loop.lua @@ -29,6 +29,8 @@ -- along with anylike. If not, see . -- +socket = require("socket") + function main_loop(opt) log.printf(log.NOTICE, "main_loop started") local sig = signal.init() -- cgit v1.2.3