diff -Naur lua-5.1.3.old/Makefile lua-5.1.3/Makefile
--- lua-5.1.3.old/Makefile	2008-01-17 18:53:37.000000000 +0100
+++ lua-5.1.3/Makefile	2008-05-01 21:29:51.000000000 +0100
@@ -38,7 +38,7 @@
 # What to install.
 TO_BIN= lua luac
 TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua.a liblua.so.$R
 TO_MAN= lua.1 luac.1
 
 # Lua version and release.
diff -Naur lua-5.1.3.old/src/Makefile lua-5.1.3/src/Makefile
--- lua-5.1.3.old/src/Makefile	2008-01-19 20:37:58.000000000 +0100
+++ lua-5.1.3/src/Makefile	2008-05-01 21:38:41.000000000 +0100
@@ -18,11 +18,16 @@
 MYLDFLAGS=
 MYLIBS=
 
+MAJOR= 5
+MINOR= 1
+REL= 3
+
 # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
 
 PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
 
 LUA_A=	liblua.a
+LUA_S=  liblua.so
 CORE_O=	lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
 	lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o  \
 	lundump.o lvm.o lzio.o
@@ -36,8 +41,9 @@
 LUAC_O=	luac.o print.o
 
 ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+ALL_T= $(LUA_A) $(LUA_S) $(LUA_T) $(LUAC_T)
 ALL_A= $(LUA_A)
+ALL_S= $(LUA_S)
 
 default: $(PLAT)
 
@@ -47,9 +53,17 @@
 
 a:	$(ALL_A)
 
+s:     $(ALL_S)
+
 $(LUA_A): $(CORE_O) $(LIB_O)
 	$(AR) $@ $?
 	$(RANLIB) $@
+	
+$(LUA_S): $(CORE_O) $(LIB_O)
+	gcc $(CFLAGS) -shared -Wl,-soname -Wl,$(LUA_S).$(MAJOR) \
+          -o $(LUA_S).$(MAJOR).$(MINOR).$(REL) $^ $(LIBS)
+	ln -s $(LUA_S).$(MAJOR).$(MINOR).$(REL) $(LUA_S)
+	
 
 $(LUA_T): $(LUA_O) $(LUA_A)
 	$(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
@@ -58,7 +72,7 @@
 	$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
 
 clean:
-	$(RM) $(ALL_T) $(ALL_O)
+	$(RM) $(ALL_T) $(ALL_O) $(LUA_S) $(LUA_S).$(MAJOR).$(MINOR).$(REL)
 
 depend:
 	@$(CC) $(CFLAGS) -MM l*.c print.c
