Almost ready to release 2.0.1

This commit is contained in:
Diego Nehab 2006-04-20 04:16:23 +00:00
parent 316e205cd4
commit 75f51d5bc7
5 changed files with 58 additions and 35 deletions

20
config
View File

@ -15,8 +15,8 @@ UNIX_SO=unix.$(EXT)
#------ #------
# Lua includes and libraries # Lua includes and libraries
# #
LUAINC=-Ilua-5.0.2/include LUAINC=-I/usr/local/include/lua50
LUALIB=-Llua-5.0.2/lib #LUAINC=-I/usr/local/include/lua5.1
#------ #------
# Compat-5.1 directory # Compat-5.1 directory
@ -27,8 +27,10 @@ COMPAT=compat-5.1r5
# 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_SHARE=share INSTALL_TOP_SHARE=/usr/local/share/lua/5.0
INSTALL_TOP_LIB=lib INSTALL_TOP_LIB=/usr/local/lib/lua/5.0
#INSTALL_TOP_SHARE=/usr/local/share/lua/5.1
#INSTALL_TOP_LIB=/usr/local/lib/lua/5.1
INSTALL_DATA=cp INSTALL_DATA=cp
INSTALL_EXEC=cp INSTALL_EXEC=cp
@ -46,11 +48,11 @@ INSTALL_EXEC=cp
#------ #------
# Compiler and linker settings # Compiler and linker settings
# for Linux # for Linux
CC=gcc #CC=gcc
DEF=-DLUASOCKET_DEBUG #DEF=-DLUASOCKET_DEBUG
CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fpic #CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fpic
LDFLAGS=-O -shared -fpic #LDFLAGS=-O -shared -fpic
LD=gcc #LD=gcc
#------ #------
# End of makefile configuration # End of makefile configuration

View File

@ -88,8 +88,9 @@ Author: <A href="http://www.cs.princeton.edu/~diego">Diego Nehab</a>
<p> <p>
LuaSocket version 2.0.1 is now available for download! It is LuaSocket version 2.0.1 is now available for download! It is
compatible with Lua&nbsp;5.0 and has been tested on compatible with Lua&nbsp;5.0 and Lua&nbsp;5.1, and has
Windows&nbsp;XP, Linux, and Mac OS X. been tested on Windows&nbsp;XP, Linux, and Mac OS X. Chances
are it works well on most UNIX systems.
</p> </p>
<p> <p>
@ -103,13 +104,13 @@ contains several examples, this user's manual and basic test procedures.
<p> <p>
Danilo Tuler is maintaining Win32 binaries for LuaSocket, which are also Danilo Tuler is maintaining Win32 binaries for LuaSocket, which are also
available from LuaForge. These are compatible with the available from LuaForge. These are compatible with the
<a href=http://luaforge.net/projects/luabinaries>LuaBinaries</a> <a href=http://luaforge.net/projects/luabinaries>LuaBinaries</a>,
available from LuaForge. also available from LuaForge.
</p> </p>
<p> <p>
For those that want to give LuaSocket a quick try, download the If you are using Lua 5.0, and want to give LuaSocket a quick
stand-alone archive and unpack everything into try, download the stand-alone archive and unpack everything into
a directory, say <tt>c:\luasocket</tt>. Then set <tt>LUA_INIT</tt> to load a directory, say <tt>c:\luasocket</tt>. Then set <tt>LUA_INIT</tt> to load
the <tt>compat-5.1.lua</tt> and set <tt>LUA_PATH</tt> and the <tt>compat-5.1.lua</tt> and set <tt>LUA_PATH</tt> and
<tt>LUA_CPATH</tt> to look for files in the current directory: <tt>LUA_CPATH</tt> to look for files in the current directory:
@ -135,6 +136,23 @@ Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
--&gt; the source to this web page gets dumped to terminal --&gt; the source to this web page gets dumped to terminal
</pre> </pre>
<p>
If you are using Lua 5.1, you shouldn't use
<tt>compat-5.1.lua</tt>. Just unpack the standalone
directory, set <tt>LUA_CPATH</tt> and <tt>LUA_PATH</tt>, and
you should be ready to run:
<p>
<pre class=example>
c:\luasocket\&gt; set LUA_CPATH=?.dll
c:\luasocket\&gt; set LUA_PATH=?.lua
c:\luasocket\&gt; lua5.1
Lua 5.1 Copyright (C) 1994-2006 Lua.org, PUC-Rio
&gt; http = require"socket.http"
&gt; print(http.request"http://www.cs.princeton.edu/~diego/professional/luasocket/"
--&gt; the source to this web page gets dumped to terminal
</pre>
<p> When you are done playing, take a look at the <p> When you are done playing, take a look at the
<a href=installation.html>installation</a> section of the manual to find out <a href=installation.html>installation</a> section of the manual to find out
how to properly install the library. </p> how to properly install the library. </p>

View File

@ -39,27 +39,24 @@ Installation">
<h2>Installation</h2> <h2>Installation</h2>
<p> LuaSocket 2.0.1 uses the new package proposal for Lua 5.1. <p> LuaSocket 2.0.1 uses the new package system for Lua 5.1.
All Lua library developers are encouraged to update their libraries so that All Lua library developers are encouraged to update their libraries so that
all libraries can coexist peacefully and users can benefit from the all libraries can coexist peacefully and users can benefit from the
standardization and flexibility of the standard. standardization and flexibility of the standard.
</p> </p>
<p> <p>
The proposal was considered important enough by some of us to justify Those stuck with Lua 5.0 will need the
early adoption, even before release of Lua 5.1.
Thus, a compatibility module
<a href=http://www.keplerproject.org/compat/>compat-5.1</a> <a href=http://www.keplerproject.org/compat/>compat-5.1</a>
has been released in conjunction with Roberto Ierusalimschy and <a module. It is maintained by
href=http://www.keplerproject.org/>The Kepler Project</a> team. <a href=http://www.keplerproject.org/>The Kepler
It implements the Lua 5.1 package proposal on top of Lua 5.0. </p> Project</a>'s team, and implements the Lua 5.1 package proposal
on top of Lua 5.0. </p>
<p> As far as LuaSocket is concerned, this means that whoever is <p> Here we will only describe the standard distribution.
deploying a non-standard distribution of LuaSocket will probably If the standard doesn't meet your needs, we refer you to the
have no problems customizing it. Here we will only describe the standard distribution. If the standard doesn't meet your Lua discussion list, where any question about the package
needs, we refer you to the Lua discussion list, where any question about scheme will likely already have been answered. </p>
the package scheme will likely already have been answered.
</p>
<h3>Directory structure</h3> <h3>Directory structure</h3>
@ -88,7 +85,7 @@ distribution directory structure:</p>
</pre> </pre>
<p> Naturally, on Unix systems, <tt>core.dll</tt> <p> Naturally, on Unix systems, <tt>core.dll</tt>
would be replaced by <tt>core.so</tt>. would be replaced by <tt>core.so</tt>.
</p> </p>
<p> In order for the interpreter to find all LuaSocket components, three <p> In order for the interpreter to find all LuaSocket components, three
@ -99,6 +96,11 @@ the interpreter to load the <tt>compat-5.1.lua</tt> module at startup: </p>
LUA_INIT=@&lt;LDIR&gt;/compat-5.1.lua LUA_INIT=@&lt;LDIR&gt;/compat-5.1.lua
</pre> </pre>
<p>
This is only need for Lua&nbsp;5.0! Lua&nbsp;5.1 comes with
the package system bult in, of course.
</p>
<p> <p>
The other two environment variables instruct the compatibility module to The other two environment variables instruct the compatibility module to
look for dynamic libraries and extension modules in the appropriate look for dynamic libraries and extension modules in the appropriate

View File

@ -64,9 +64,9 @@ work. Just run
lua check-links.lua [-n] {<url>} > output lua check-links.lua [-n] {<url>} > output
and open the result to see a list of broken links. You can and open the result to see a list of broken links. Make sure
also use the '-n' switch to run the same program in you check the '-n' switch. It runs in non-blocking mode,
non-blocking mode to see how much faster things can get. using coroutines, and is MUCH faster!
forward.lua -- coroutine based forward server forward.lua -- coroutine based forward server

View File

@ -10,6 +10,7 @@ include ../config
#------ #------
# Modules belonging to socket-core # Modules belonging to socket-core
# #
SOCKET_OBJS:= \ SOCKET_OBJS:= \
$(COMPAT)/compat-5.1.o \ $(COMPAT)/compat-5.1.o \
luasocket.o \ luasocket.o \
@ -48,13 +49,13 @@ UNIX_OBJS:=\
all: $(SOCKET_SO) $(MIME_SO) all: $(SOCKET_SO) $(MIME_SO)
$(SOCKET_SO): $(SOCKET_OBJS) $(SOCKET_SO): $(SOCKET_OBJS)
$(LD) $(LDFLAGS) -o $@ $^ $(LD) $(LDFLAGS) -o $@ $(SOCKET_OBJS)
$(MIME_SO): $(MIME_OBJS) $(MIME_SO): $(MIME_OBJS)
$(LD) $(LDFLAGS) -o $@ $^ $(LD) $(LDFLAGS) -o $@ $(MIME_OBJS)
$(UNIX_SO): $(UNIX_OBJS) $(UNIX_SO): $(UNIX_OBJS)
$(LD) $(LDFLAGS) -o $@ $^ $(LD) $(LDFLAGS) -o $@ $(UNIX_OBJS)
#------ #------
# List of dependencies # List of dependencies