Index: src/Makefile
--- src/Makefile.orig	2008-01-19 20:37:58.000000000 +0100
+++ src/Makefile	2010-12-09 16:31:50.000000000 +0100
@@ -14,9 +14,9 @@
 RM= rm -f
 LIBS= -lm $(MYLIBS)
 
-MYCFLAGS=
-MYLDFLAGS=
-MYLIBS=
+MYCFLAGS   ?=
+MYLDFLAGS  ?=
+MYLIBS     ?=
 
 # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
 
@@ -87,19 +87,19 @@
 	$(MAKE) all MYCFLAGS=-DLUA_ANSI
 
 bsd:
-	$(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-Wl,-E"
+	$(MAKE) all MYCFLAGS="$(MYCFLAGS) -DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="$(MYLIBS) -Wl,-E"
 
 freebsd:
-	$(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"
+	$(MAKE) all MYCFLAGS="$(MYCFLAGS) -DLUA_USE_LINUX" MYLIBS="$(MYLIBS) -Wl,-E"
 
 generic:
 	$(MAKE) all MYCFLAGS=
 
 linux:
-	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
+	$(MAKE) all MYCFLAGS="$(MYCFLAGS) -DLUA_USE_LINUX" MYLIBS="$(MYLIBS) -Wl,-E -ldl"
 
 macosx:
-	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
+	$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="$(MYLIBS)"
 # use this on Mac OS X 10.3-
 #	$(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
 
@@ -110,10 +110,10 @@
 	$(MAKE) "LUAC_T=luac.exe" luac.exe
 
 posix:
-	$(MAKE) all MYCFLAGS=-DLUA_USE_POSIX
+	$(MAKE) all MYCFLAGS="$(MYCFLAGS) -DLUA_USE_POSIX"
 
 solaris:
-	$(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl"
+	$(MAKE) all MYCFLAGS="$(MYCFLAGS) -DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="$(MYLIBS) -ldl"
 
 # list targets that do not create files (but not all makes understand .PHONY)
 .PHONY: all $(PLATS) default o a clean depend echo none
Index: src/luaconf.h
--- src/luaconf.h.orig	2008-01-18 18:07:48 +0100
+++ src/luaconf.h	2008-01-25 17:33:43 +0100
@@ -36,7 +36,6 @@
 #if defined(LUA_USE_LINUX)
 #define LUA_USE_POSIX
 #define LUA_USE_DLOPEN		/* needs an extra library: -ldl */
-#define LUA_USE_READLINE	/* needs some extra libraries */
 #endif
 
 #if defined(LUA_USE_MACOSX)
