From 75f51d5bc7367af6a52700db989499162e8525e8 Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Thu, 20 Apr 2006 04:16:23 +0000 Subject: [PATCH] Almost ready to release 2.0.1 --- config | 20 +++++++++++--------- doc/index.html | 30 ++++++++++++++++++++++++------ doc/installation.html | 30 ++++++++++++++++-------------- etc/README | 6 +++--- src/makefile | 7 ++++--- 5 files changed, 58 insertions(+), 35 deletions(-) diff --git a/config b/config index 6b779aa..b849b70 100644 --- a/config +++ b/config @@ -15,8 +15,8 @@ UNIX_SO=unix.$(EXT) #------ # Lua includes and libraries # -LUAINC=-Ilua-5.0.2/include -LUALIB=-Llua-5.0.2/lib +LUAINC=-I/usr/local/include/lua50 +#LUAINC=-I/usr/local/include/lua5.1 #------ # Compat-5.1 directory @@ -27,8 +27,10 @@ COMPAT=compat-5.1r5 # Top of your Lua installation # Relative paths will be inside the src tree # -INSTALL_TOP_SHARE=share -INSTALL_TOP_LIB=lib +INSTALL_TOP_SHARE=/usr/local/share/lua/5.0 +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_EXEC=cp @@ -46,11 +48,11 @@ INSTALL_EXEC=cp #------ # Compiler and linker settings # for Linux -CC=gcc -DEF=-DLUASOCKET_DEBUG -CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fpic -LDFLAGS=-O -shared -fpic -LD=gcc +#CC=gcc +#DEF=-DLUASOCKET_DEBUG +#CFLAGS= $(LUAINC) -I$(COMPAT) $(DEF) -pedantic -Wall -O2 -fpic +#LDFLAGS=-O -shared -fpic +#LD=gcc #------ # End of makefile configuration diff --git a/doc/index.html b/doc/index.html index 3c0bbce..387b874 100644 --- a/doc/index.html +++ b/doc/index.html @@ -88,8 +88,9 @@ Author: Diego Nehab

LuaSocket version 2.0.1 is now available for download! It is -compatible with Lua 5.0 and has been tested on -Windows XP, Linux, and Mac OS X. +compatible with Lua 5.0 and Lua 5.1, and has +been tested on Windows XP, Linux, and Mac OS X. Chances +are it works well on most UNIX systems.

@@ -103,13 +104,13 @@ contains several examples, this user's manual and basic test procedures.

Danilo Tuler is maintaining Win32 binaries for LuaSocket, which are also available from LuaForge. These are compatible with the -LuaBinaries -available from LuaForge. +LuaBinaries, +also available from LuaForge.

-For those that want to give LuaSocket a quick try, download the -stand-alone archive and unpack everything into +If you are using Lua 5.0, and want to give LuaSocket a quick +try, download the stand-alone archive and unpack everything into a directory, say c:\luasocket. Then set LUA_INIT to load the compat-5.1.lua and set LUA_PATH and LUA_CPATH to look for files in the current directory: @@ -135,6 +136,23 @@ Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio --> the source to this web page gets dumped to terminal +

+If you are using Lua 5.1, you shouldn't use +compat-5.1.lua. Just unpack the standalone +directory, set LUA_CPATH and LUA_PATH, and +you should be ready to run: +

+ +

+c:\luasocket\> set LUA_CPATH=?.dll
+c:\luasocket\> set LUA_PATH=?.lua
+c:\luasocket\> lua5.1
+Lua 5.1  Copyright (C) 1994-2006 Lua.org, PUC-Rio
+> http = require"socket.http"
+> print(http.request"http://www.cs.princeton.edu/~diego/professional/luasocket/"
+--> the source to this web page gets dumped to terminal
+
+

When you are done playing, take a look at the installation section of the manual to find out how to properly install the library.

diff --git a/doc/installation.html b/doc/installation.html index 725db42..dadfe72 100644 --- a/doc/installation.html +++ b/doc/installation.html @@ -39,27 +39,24 @@ Installation">

Installation

-

LuaSocket 2.0.1 uses the new package proposal for Lua 5.1. +

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 libraries can coexist peacefully and users can benefit from the standardization and flexibility of the standard.

-The proposal was considered important enough by some of us to justify -early adoption, even before release of Lua 5.1. -Thus, a compatibility module +Those stuck with Lua 5.0 will need the compat-5.1 -has been released in conjunction with Roberto Ierusalimschy and The Kepler Project team. -It implements the Lua 5.1 package proposal on top of Lua 5.0.

+module. It is maintained by +The Kepler +Project's team, and implements the Lua 5.1 package proposal +on top of Lua 5.0.

-

As far as LuaSocket is concerned, this means that whoever is -deploying a non-standard distribution of LuaSocket will probably -have no problems customizing it. Here we will only describe the standard distribution. If the standard doesn't meet your -needs, we refer you to the Lua discussion list, where any question about -the package scheme will likely already have been answered. -

+

Here we will only describe the standard distribution. +If the standard doesn't meet your needs, we refer you to the +Lua discussion list, where any question about the package +scheme will likely already have been answered.

Directory structure

@@ -88,7 +85,7 @@ distribution directory structure:

Naturally, on Unix systems, core.dll -would be replaced by core.so. +would be replaced by core.so.

In order for the interpreter to find all LuaSocket components, three @@ -99,6 +96,11 @@ the interpreter to load the compat-5.1.lua module at startup:

LUA_INIT=@<LDIR>/compat-5.1.lua +

+This is only need for Lua 5.0! Lua 5.1 comes with +the package system bult in, of course. +

+

The other two environment variables instruct the compatibility module to look for dynamic libraries and extension modules in the appropriate diff --git a/etc/README b/etc/README index 5a919cd..cfd3e37 100644 --- a/etc/README +++ b/etc/README @@ -64,9 +64,9 @@ work. Just run lua check-links.lua [-n] {} > output -and open the result to see a list of broken links. You can -also use the '-n' switch to run the same program in -non-blocking mode to see how much faster things can get. +and open the result to see a list of broken links. Make sure +you check the '-n' switch. It runs in non-blocking mode, +using coroutines, and is MUCH faster! forward.lua -- coroutine based forward server diff --git a/src/makefile b/src/makefile index 9a97dd3..a21a346 100644 --- a/src/makefile +++ b/src/makefile @@ -10,6 +10,7 @@ include ../config #------ # Modules belonging to socket-core # + SOCKET_OBJS:= \ $(COMPAT)/compat-5.1.o \ luasocket.o \ @@ -48,13 +49,13 @@ UNIX_OBJS:=\ all: $(SOCKET_SO) $(MIME_SO) $(SOCKET_SO): $(SOCKET_OBJS) - $(LD) $(LDFLAGS) -o $@ $^ + $(LD) $(LDFLAGS) -o $@ $(SOCKET_OBJS) $(MIME_SO): $(MIME_OBJS) - $(LD) $(LDFLAGS) -o $@ $^ + $(LD) $(LDFLAGS) -o $@ $(MIME_OBJS) $(UNIX_SO): $(UNIX_OBJS) - $(LD) $(LDFLAGS) -o $@ $^ + $(LD) $(LDFLAGS) -o $@ $(UNIX_OBJS) #------ # List of dependencies