Permalink
Browse files

linux build

  • Loading branch information...
1 parent 643ef59 commit 186ae0dbaaaf415073978e92bb81f37adb8ac3b6 @grrrwaaa committed May 2, 2012
Showing with 19 additions and 5 deletions.
  1. +14 −4 lakefile
  2. BIN linux64/lib/libuv.a
  3. +4 −1 lua_uv_fs.cpp
  4. +1 −0 luaopen_uv.cpp
View
@@ -1,14 +1,25 @@
+-- cd libuv
+-- make CFLAGS="-fPIC"
+-- cd ../
+-- mv libuv/uv.a <plat>/lib/libuv.a
+
UV_INCLUDE_DIR = "libuv/include"
UV_LIBS = "uv"
local libflags
+local needs = { "uv", "lua" }
+
if PLAT == "Darwin" then
UV_LIB_DIR = "osx/lib"
libflags = "-framework Cocoa"
else
- UV_LIB_DIR = "/usr/local/lib"
+ UV_LIB_DIR = "linux64/lib"
+
+ PTHREAD_DIR = '/usr/'
+ PTHREAD_LIBS = 'pthread rt'
+ needs[#needs+1] = "pthread"
end
cpp.shared{
@@ -23,8 +34,7 @@ cpp.shared{
"lua_uv_fs.cpp",
"lua_uv_dns.cpp",
},
- needs = { "uv", "lua" },
+ needs = needs,
+ flags = "-Wno-unknown-pragmas",
libflags = libflags,
}
-
-target('install', 'uv', 'sudo cp $(DEPENDS) /usr/local/lib/lua/5.1/$(DEPENDS)')
View
Binary file not shown.
View
@@ -1,5 +1,8 @@
#include "luaopen_uv.h"
#include <fcntl.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
int lua_uv_string_to_flags(lua_State* L, const char* string) {
if (strcmp(string, "r") == 0) return O_RDONLY;
@@ -333,4 +336,4 @@ void init_fs_metatable(lua_State * L, int loopidx) {
LUA_UV_CLOSURE(uv_fs, read);
LUA_UV_CLOSURE(uv_fs, write);
lua_pop(L, 1);
-}
+}
View
@@ -12,6 +12,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#include "luaopen_uv.h"
+#include <stdlib.h>
#include <string.h>
int lua_uv_loop___tostring(lua_State * L) {

0 comments on commit 186ae0d

Please sign in to comment.