mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 04:28:20 +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
|
||||
# Relative paths will be inside the src tree
|
||||
#
|
||||
INSTALL_TOP_LUA=share
|
||||
INSTALL_TOP_SHARE=share
|
||||
INSTALL_TOP_LIB=lib
|
||||
|
||||
INSTALL_DATA=cp
|
||||
|
@ -69,22 +69,22 @@ independent files. Let's call these directories <tt><LIB></tt>
|
||||
and <tt><SHARE></tt>, respectively.
|
||||
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><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
|
||||
distribution directory structure:</p>
|
||||
|
||||
<pre class=example>
|
||||
<SHARE>/compat-5.1.lua
|
||||
<SHARE>/ltn12.lua
|
||||
<SHARE>/mime/mime.lua
|
||||
<LIB>/mime/core.dll
|
||||
<SHARE>/socket/socket.lua
|
||||
<SHARE>/socket.lua
|
||||
<LIB>/socket/core.dll
|
||||
<SHARE>/socket/http.lua
|
||||
<SHARE>/socket/tp.lua
|
||||
<SHARE>/socket/ftp.lua
|
||||
<SHARE>/socket/smtp.lua
|
||||
<SHARE>/socket/url.lua
|
||||
<SHARE>/mime.lua
|
||||
<LIB>/mime/core.dll
|
||||
</pre>
|
||||
|
||||
<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.
|
||||
</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 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
||||
|
||||
<p class=name id=sink>
|
||||
|
31
makefile
31
makefile
@ -6,9 +6,9 @@ include config
|
||||
#------
|
||||
# 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_MIME_LUA=$(INSTALL_TOP_LUA)/mime
|
||||
INSTALL_MIME_SHARE=$(INSTALL_TOP_SHARE)/mime
|
||||
INSTALL_MIME_LIB=$(INSTALL_TOP_LIB)/mime
|
||||
|
||||
all clean:
|
||||
@ -17,35 +17,34 @@ all clean:
|
||||
#------
|
||||
# Files to install
|
||||
#
|
||||
TO_SOCKET_LUA:= \
|
||||
socket.lua \
|
||||
TO_SOCKET_SHARE:= \
|
||||
http.lua \
|
||||
url.lua \
|
||||
tp.lua \
|
||||
ftp.lua \
|
||||
smtp.lua
|
||||
|
||||
TO_TOP_LUA:= \
|
||||
ltn12.lua
|
||||
|
||||
TO_MIME_LUA:= \
|
||||
TO_TOP_SHARE:= \
|
||||
$(COMPAT)/compat-5.1.lua \
|
||||
ltn12.lua \
|
||||
socket.lua \
|
||||
mime.lua
|
||||
|
||||
TO_MIME_SHARE:=
|
||||
|
||||
#------
|
||||
# Install LuaSocket according to recommendation
|
||||
#
|
||||
install: all
|
||||
cd src; mkdir -p $(INSTALL_TOP_LUA)
|
||||
cd src; mkdir -p $(INSTALL_TOP_LIB)
|
||||
cd src; $(INSTALL_DATA) $(COMPAT)/compat-5.1.lua $(INSTALL_TOP_LUA)
|
||||
cd src; $(INSTALL_DATA) ltn12.lua $(INSTALL_TOP_LUA)
|
||||
cd src; mkdir -p $(INSTALL_SOCKET_LUA)
|
||||
cd src; mkdir -p $(INSTALL_TOP_SHARE)
|
||||
cd src; $(INSTALL_DATA) $(TO_TOP_SHARE) $(INSTALL_TOP_SHARE)
|
||||
cd src; mkdir -p $(INSTALL_SOCKET_SHARE)
|
||||
cd src; $(INSTALL_DATA) $(TO_SOCKET_SHARE) $(INSTALL_SOCKET_SHARE)
|
||||
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; 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; $(INSTALL_DATA) $(TO_MIME_LUA) $(INSTALL_MIME_LUA)
|
||||
cd src; $(INSTALL_EXEC) $(MIME_SO) $(INSTALL_MIME_LIB)/core.$(EXT)
|
||||
|
||||
#------
|
||||
|
@ -1,13 +1,12 @@
|
||||
#--------------------------------------------------------------------------
|
||||
# Distribution makefile
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
DIST = luasocket-2.0
|
||||
|
||||
COMPAT = src/compat-5.1r4
|
||||
|
||||
|
||||
TEST = \
|
||||
test/README \
|
||||
test/testclnt.lua \
|
||||
test/testsrvr.lua \
|
||||
test/testsupport.lua
|
||||
@ -33,12 +32,12 @@ ETC = \
|
||||
etc/eol.lua \
|
||||
etc/forward.lua \
|
||||
etc/get.lua \
|
||||
etc/links \
|
||||
etc/lp.lua \
|
||||
etc/qp.lua \
|
||||
etc/tftp.lua
|
||||
|
||||
SRC = \
|
||||
src/makefile \
|
||||
src/auxiliar.c \
|
||||
src/auxiliar.h \
|
||||
src/buffer.c \
|
||||
@ -108,6 +107,7 @@ dist:
|
||||
mkdir -p $(DIST)
|
||||
cp -vf NEW $(DIST)
|
||||
cp -vf LICENSE $(DIST)
|
||||
cp -vf README $(DIST)
|
||||
cp -vf $(MAKE) $(DIST)
|
||||
|
||||
mkdir -p $(DIST)/etc
|
||||
|
@ -36,7 +36,8 @@ do
|
||||
return usage()
|
||||
end
|
||||
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')
|
||||
else
|
||||
r,e=lp.query(opt)
|
||||
|
@ -110,7 +110,8 @@ int socket_select(t_socket n, fd_set *rfds, fd_set *wfds, fd_set *efds,
|
||||
double t = timeout_getretry(tm);
|
||||
tv.tv_sec = (int) t;
|
||||
tv.tv_usec = (int) ((t - tv.tv_sec) * 1.0e6);
|
||||
ret = select(n, rfds, wfds, efds, t >= 0.0? &tv: NULL);
|
||||
/* timeout = 0 means no wait */
|
||||
ret = select(n, rfds, wfds, efds, t >= 0.0 ? &tv: NULL);
|
||||
} while (ret < 0 && errno == EINTR);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user