--- config.orig	2003-04-12 00:00:41.000000000 +1000
+++ config	2011-05-04 07:24:39.000000000 +1000
@@ -25,8 +25,8 @@
 # interface (e.g., Linux, Solaris, IRIX, BSD, AIX, HPUX, and probably others),
 # uncomment the next two lines.
 #
-#LOADLIB= -DUSE_DLOPEN=1
-#DLLIB= -ldl
+LOADLIB= -DUSE_DLOPEN=1
+DLLIB= -ldl
 #
 # In Linux with gcc, you should also uncomment the next definition for
 # MYLDFLAGS, which passes -E (= -export-dynamic) to the linker. This option
@@ -45,7 +45,7 @@
 # If your system is not POSIX but has popen and pclose, define USE_POPEN=1.
 # If you don't want to support pipes, define USE_POPEN=0.
 #
-#POPEN= -DUSE_POPEN=1
+POPEN= -DUSE_POPEN=1
 #POPEN= -DUSE_POPEN=0
 #
 # The form below will probably work in (some) Windows systems.
@@ -92,7 +92,7 @@
 # or if you are using a modified interpreter that does not need them,
 # then comment the following line or add the appropriates libraries.
 #
-EXTRA_LIBS= -lm
+#EXTRA_LIBS= -lm
 
 # If you want to customize the stand-alone Lua interpreter, uncomment and
 # edit the following two lines; also edit etc/saconfig.c to suit your needs.
@@ -100,15 +100,16 @@
 # to add -lreadline (and perhaps also -lhistory and -lcurses or -lncurses)
 # to EXTRA_LIBS.
 #
-#USERCONF=-DLUA_USERCONFIG='"$(LUA)/etc/saconfig.c"' -DUSE_READLINE
-#EXTRA_LIBS= -lm -ldl -lreadline # -lhistory -lcurses -lncurses
+USERCONF=-DLUA_USERCONFIG='"$(LUA)/etc/saconfig.c"' -DUSE_READLINE
+EXTRA_INCS= -I@PREFIX@/include
+EXTRA_LIBS= -L@PREFIX@/lib -lm -ldl -lreadline # -lhistory -lcurses -lncurses
 
 # ------------------------------------------------------------------ C compiler
 
 # You need an ANSI C compiler. gcc is a popular one. We do not use -ansi in
 # WARN because it disables POSIX features used in the libraries.
 #
-CC= gcc
+CC= @CC@
 WARN= -Wall
 
 # ------------------------------------------------------------------ C options
@@ -119,11 +120,11 @@
 # debug information. If you only want the shared libraries, you may want to
 # add -fPIC to MYCFLAGS.
 #
-MYCFLAGS= -O2
+MYCFLAGS= @CFLAGS@
 #MYCFLAGS= -O3 -fomit-frame-pointer # -fPIC
 
 # Write here any options you may need for your C linker.
-#MYLDFLAGS=
+MYLDFLAGS= @LDFLAGS@
 
 # ------------------------------------------------------------------ librarian
 
@@ -148,19 +149,20 @@
 
 # Locations for "make install". You may need to be root do "make install".
 #
-INSTALL_ROOT= /usr/local
+DESTDIR= @DESTROOT@
+INSTALL_ROOT= @PREFIX@
 INSTALL_BIN= $(INSTALL_ROOT)/bin
 INSTALL_INC= $(INSTALL_ROOT)/include
 INSTALL_LIB= $(INSTALL_ROOT)/lib
-INSTALL_MAN= $(INSTALL_ROOT)/man/man1
+INSTALL_MAN= $(INSTALL_ROOT)/share/man/man1
 
 # You may prefer to use "install" instead of "cp" if you have it.
 # If you use "install", you may also want to change the permissions after -m.
 #
-INSTALL_EXEC= cp
-INSTALL_DATA= cp
-#INSTALL_EXEC= install -m 0755
-#INSTALL_DATA= install -m 0644
+#INSTALL_EXEC= cp
+#INSTALL_DATA= cp
+INSTALL_EXEC= install -m 0755
+INSTALL_DATA= install -m 0644
 
 # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========