mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 12:28:21 +01:00
Few tweaks in installation, some missing files, etc.
This commit is contained in:
parent
a2b780bf7a
commit
d55a5826e8
2
config
2
config
@ -27,7 +27,7 @@ COMPAT=compat-5.1r4
|
|||||||
# Top of your Lua installation
|
# Top of your Lua installation
|
||||||
# Relative paths will be inside the src tree
|
# Relative paths will be inside the src tree
|
||||||
#
|
#
|
||||||
INSTALL_TOP_LUA=share
|
INSTALL_TOP_SHARE=share
|
||||||
INSTALL_TOP_LIB=lib
|
INSTALL_TOP_LIB=lib
|
||||||
|
|
||||||
INSTALL_DATA=cp
|
INSTALL_DATA=cp
|
||||||
|
@ -69,22 +69,22 @@ independent files. Let's call these directories <tt><LIB></tt>
|
|||||||
and <tt><SHARE></tt>, respectively.
|
and <tt><SHARE></tt>, respectively.
|
||||||
For instance, in my laptop, I use '<tt>/usr/local/lib/lua/5.0</tt>' for
|
For instance, in my laptop, I use '<tt>/usr/local/lib/lua/5.0</tt>' for
|
||||||
<tt><LIB></tt> and '<tt>/usr/local/share/lua/5.0</tt>' for
|
<tt><LIB></tt> and '<tt>/usr/local/share/lua/5.0</tt>' for
|
||||||
<tt><SHARE></tt>. On Windows, only one directory is used, say
|
<tt><SHARE></tt>. On Windows, sometimes only one directory is used, say
|
||||||
'<tt>c:\program files\lua\5.0</tt>'. Here is the standard LuaSocket
|
'<tt>c:\program files\lua\5.0</tt>'. Here is the standard LuaSocket
|
||||||
distribution directory structure:</p>
|
distribution directory structure:</p>
|
||||||
|
|
||||||
<pre class=example>
|
<pre class=example>
|
||||||
<SHARE>/compat-5.1.lua
|
<SHARE>/compat-5.1.lua
|
||||||
<SHARE>/ltn12.lua
|
<SHARE>/ltn12.lua
|
||||||
<SHARE>/mime/mime.lua
|
<SHARE>/socket.lua
|
||||||
<LIB>/mime/core.dll
|
|
||||||
<SHARE>/socket/socket.lua
|
|
||||||
<LIB>/socket/core.dll
|
<LIB>/socket/core.dll
|
||||||
<SHARE>/socket/http.lua
|
<SHARE>/socket/http.lua
|
||||||
<SHARE>/socket/tp.lua
|
<SHARE>/socket/tp.lua
|
||||||
<SHARE>/socket/ftp.lua
|
<SHARE>/socket/ftp.lua
|
||||||
<SHARE>/socket/smtp.lua
|
<SHARE>/socket/smtp.lua
|
||||||
<SHARE>/socket/url.lua
|
<SHARE>/socket/url.lua
|
||||||
|
<SHARE>/mime.lua
|
||||||
|
<LIB>/mime/core.dll
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p> Naturally, on Unix systems, <tt>core.dll</tt>
|
<p> Naturally, on Unix systems, <tt>core.dll</tt>
|
||||||
|
@ -210,13 +210,6 @@ Use the <a href=tcp.html#settimeout><tt>settimeout</tt></a>
|
|||||||
method or <tt>accept</tt> might block forever.
|
method or <tt>accept</tt> might block forever.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class=note>
|
|
||||||
Interesting note: as mentioned in some Unix manuals, calling select with both
|
|
||||||
sets empty and a non-null timeout is a fairly portable way to sleep with
|
|
||||||
sub-second precision (<b>except it doesn't work on Windows</b>).
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- sink ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
<!-- sink ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
||||||
|
|
||||||
<p class=name id=sink>
|
<p class=name id=sink>
|
||||||
|
31
makefile
31
makefile
@ -6,9 +6,9 @@ include config
|
|||||||
#------
|
#------
|
||||||
# Hopefully no need to change anything below this line
|
# Hopefully no need to change anything below this line
|
||||||
#
|
#
|
||||||
INSTALL_SOCKET_LUA=$(INSTALL_TOP_LUA)/socket
|
INSTALL_SOCKET_SHARE=$(INSTALL_TOP_SHARE)/socket
|
||||||
INSTALL_SOCKET_LIB=$(INSTALL_TOP_LIB)/socket
|
INSTALL_SOCKET_LIB=$(INSTALL_TOP_LIB)/socket
|
||||||
INSTALL_MIME_LUA=$(INSTALL_TOP_LUA)/mime
|
INSTALL_MIME_SHARE=$(INSTALL_TOP_SHARE)/mime
|
||||||
INSTALL_MIME_LIB=$(INSTALL_TOP_LIB)/mime
|
INSTALL_MIME_LIB=$(INSTALL_TOP_LIB)/mime
|
||||||
|
|
||||||
all clean:
|
all clean:
|
||||||
@ -17,35 +17,34 @@ all clean:
|
|||||||
#------
|
#------
|
||||||
# Files to install
|
# Files to install
|
||||||
#
|
#
|
||||||
TO_SOCKET_LUA:= \
|
TO_SOCKET_SHARE:= \
|
||||||
socket.lua \
|
|
||||||
http.lua \
|
http.lua \
|
||||||
url.lua \
|
url.lua \
|
||||||
tp.lua \
|
tp.lua \
|
||||||
ftp.lua \
|
ftp.lua \
|
||||||
smtp.lua
|
smtp.lua
|
||||||
|
|
||||||
TO_TOP_LUA:= \
|
TO_TOP_SHARE:= \
|
||||||
ltn12.lua
|
$(COMPAT)/compat-5.1.lua \
|
||||||
|
ltn12.lua \
|
||||||
TO_MIME_LUA:= \
|
socket.lua \
|
||||||
mime.lua
|
mime.lua
|
||||||
|
|
||||||
|
TO_MIME_SHARE:=
|
||||||
|
|
||||||
#------
|
#------
|
||||||
# Install LuaSocket according to recommendation
|
# Install LuaSocket according to recommendation
|
||||||
#
|
#
|
||||||
install: all
|
install: all
|
||||||
cd src; mkdir -p $(INSTALL_TOP_LUA)
|
cd src; mkdir -p $(INSTALL_TOP_SHARE)
|
||||||
cd src; mkdir -p $(INSTALL_TOP_LIB)
|
cd src; $(INSTALL_DATA) $(TO_TOP_SHARE) $(INSTALL_TOP_SHARE)
|
||||||
cd src; $(INSTALL_DATA) $(COMPAT)/compat-5.1.lua $(INSTALL_TOP_LUA)
|
cd src; mkdir -p $(INSTALL_SOCKET_SHARE)
|
||||||
cd src; $(INSTALL_DATA) ltn12.lua $(INSTALL_TOP_LUA)
|
cd src; $(INSTALL_DATA) $(TO_SOCKET_SHARE) $(INSTALL_SOCKET_SHARE)
|
||||||
cd src; mkdir -p $(INSTALL_SOCKET_LUA)
|
|
||||||
cd src; mkdir -p $(INSTALL_SOCKET_LIB)
|
cd src; mkdir -p $(INSTALL_SOCKET_LIB)
|
||||||
cd src; $(INSTALL_DATA) $(TO_SOCKET_LUA) $(INSTALL_SOCKET_LUA)
|
|
||||||
cd src; $(INSTALL_EXEC) $(SOCKET_SO) $(INSTALL_SOCKET_LIB)/core.$(EXT)
|
cd src; $(INSTALL_EXEC) $(SOCKET_SO) $(INSTALL_SOCKET_LIB)/core.$(EXT)
|
||||||
cd src; mkdir -p $(INSTALL_MIME_LUA)
|
#cd src; mkdir -p $(INSTALL_MIME_SHARE)
|
||||||
|
#cd src; $(INSTALL_DATA) $(TO_MIME_SHARE) $(INSTALL_MIME_SHARE)
|
||||||
cd src; mkdir -p $(INSTALL_MIME_LIB)
|
cd src; mkdir -p $(INSTALL_MIME_LIB)
|
||||||
cd src; $(INSTALL_DATA) $(TO_MIME_LUA) $(INSTALL_MIME_LUA)
|
|
||||||
cd src; $(INSTALL_EXEC) $(MIME_SO) $(INSTALL_MIME_LIB)/core.$(EXT)
|
cd src; $(INSTALL_EXEC) $(MIME_SO) $(INSTALL_MIME_LIB)/core.$(EXT)
|
||||||
|
|
||||||
#------
|
#------
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# Distribution makefile
|
# Distribution makefile
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|
|
||||||
DIST = luasocket-2.0
|
DIST = luasocket-2.0
|
||||||
|
|
||||||
COMPAT = src/compat-5.1r4
|
COMPAT = src/compat-5.1r4
|
||||||
|
|
||||||
|
|
||||||
TEST = \
|
TEST = \
|
||||||
|
test/README \
|
||||||
test/testclnt.lua \
|
test/testclnt.lua \
|
||||||
test/testsrvr.lua \
|
test/testsrvr.lua \
|
||||||
test/testsupport.lua
|
test/testsupport.lua
|
||||||
@ -33,12 +32,12 @@ ETC = \
|
|||||||
etc/eol.lua \
|
etc/eol.lua \
|
||||||
etc/forward.lua \
|
etc/forward.lua \
|
||||||
etc/get.lua \
|
etc/get.lua \
|
||||||
etc/links \
|
|
||||||
etc/lp.lua \
|
etc/lp.lua \
|
||||||
etc/qp.lua \
|
etc/qp.lua \
|
||||||
etc/tftp.lua
|
etc/tftp.lua
|
||||||
|
|
||||||
SRC = \
|
SRC = \
|
||||||
|
src/makefile \
|
||||||
src/auxiliar.c \
|
src/auxiliar.c \
|
||||||
src/auxiliar.h \
|
src/auxiliar.h \
|
||||||
src/buffer.c \
|
src/buffer.c \
|
||||||
@ -108,6 +107,7 @@ dist:
|
|||||||
mkdir -p $(DIST)
|
mkdir -p $(DIST)
|
||||||
cp -vf NEW $(DIST)
|
cp -vf NEW $(DIST)
|
||||||
cp -vf LICENSE $(DIST)
|
cp -vf LICENSE $(DIST)
|
||||||
|
cp -vf README $(DIST)
|
||||||
cp -vf $(MAKE) $(DIST)
|
cp -vf $(MAKE) $(DIST)
|
||||||
|
|
||||||
mkdir -p $(DIST)/etc
|
mkdir -p $(DIST)/etc
|
||||||
|
@ -36,7 +36,8 @@ do
|
|||||||
return usage()
|
return usage()
|
||||||
end
|
end
|
||||||
if arg[1] ~= "query" then
|
if arg[1] ~= "query" then
|
||||||
r,e=lp.send(arg[1],opt)
|
opt.file = arg[1]
|
||||||
|
r,e=lp.send(opt)
|
||||||
io.stdout:write(tostring(r or e),'\n')
|
io.stdout:write(tostring(r or e),'\n')
|
||||||
else
|
else
|
||||||
r,e=lp.query(opt)
|
r,e=lp.query(opt)
|
||||||
|
@ -110,6 +110,7 @@ int socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds,
|
|||||||
double t = timeout_getretry(tm);
|
double t = timeout_getretry(tm);
|
||||||
tv.tv_sec = (int) t;
|
tv.tv_sec = (int) t;
|
||||||
tv.tv_usec = (int) ((t - tv.tv_sec) * 1.0e6);
|
tv.tv_usec = (int) ((t - tv.tv_sec) * 1.0e6);
|
||||||
|
/* timeout = 0 means no wait */
|
||||||
ret = select(n, rfds, wfds, efds, t >= 0.0 ? &tv: NULL);
|
ret = select(n, rfds, wfds, efds, t >= 0.0 ? &tv: NULL);
|
||||||
} while (ret < 0 && errno == EINTR);
|
} while (ret < 0 && errno == EINTR);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user