summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anylike.org>2010-01-11 17:44:07 +0000
committerChristian Pointner <equinox@anylike.org>2010-01-11 17:44:07 +0000
commitbdecf0cda3282e8f5ea8ab16aae3ef9cc0b0a1fd (patch)
tree6911bd9b7501b558e3d48da54d6b1b22dec945a2
parentadded info for build with gnutls on windows (diff)
cleaned up lua libs (no require socket anymore)
-rw-r--r--src/anylike.c3
-rwxr-xr-xsrc/configure6
-rw-r--r--src/echo_server.lua2
-rw-r--r--src/main_loop.lua2
4 files changed, 5 insertions, 8 deletions
diff --git a/src/anylike.c b/src/anylike.c
index 637c527..427477f 100644
--- a/src/anylike.c
+++ b/src/anylike.c
@@ -36,6 +36,7 @@
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
+#include <luasocket.h>
#include "datatypes.h"
#include "options.h"
@@ -98,13 +99,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 f6faa48..c1528e6 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"
+ LDFLAGS="$LDFLAGS -L$prefix/lib -llua -llua-socket"
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"
+ LDFLAGS="$LDFLAGS -L$prefix/lib -llua$LUA_VERSION -llua$LUA_VERSION-socket"
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"
+ LDFLAGS="$LDFLAGS -L$prefix/lib -llua-$LUA_VERSION -llua-$LUA_VERSION-socket"
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 6770421..7ad206a 100644
--- a/src/echo_server.lua
+++ b/src/echo_server.lua
@@ -29,8 +29,6 @@
-- along with anylike. If not, see <http://www.gnu.org/licenses/>.
--
-socket = require("socket")
-
echo_server = {}
echo_server.init = function(host, port)
diff --git a/src/main_loop.lua b/src/main_loop.lua
index f7f09e9..9796d83 100644
--- a/src/main_loop.lua
+++ b/src/main_loop.lua
@@ -29,8 +29,6 @@
-- along with anylike. If not, see <http://www.gnu.org/licenses/>.
--
-socket = require("socket")
-
function main_loop(opt)
log.printf(log.NOTICE, "main_loop started")
local sig = signal.init()