summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2005-05-20 12:00:00 +0000
committerrepogen <>2005-05-20 12:00:00 +0000
commitbf6b5550cdfbc0c4a3a4577776ad76628d80718e (patch)
treed714ef8ac5581536c0f8bb2c8e90e2b8207799b1 /etc
parente6ddfd3b09c0a3727afc773029c323a3defe50fa (diff)
downloadlua-github-bf6b5550cdfbc0c4a3a4577776ad76628d80718e.tar.gz
Lua 5.1-work65.1-work6
Diffstat (limited to 'etc')
-rw-r--r--etc/Makefile4
-rw-r--r--etc/README6
-rw-r--r--etc/all.c4
-rw-r--r--etc/lua.pc24
-rw-r--r--etc/saconfig.c65
5 files changed, 30 insertions, 73 deletions
diff --git a/etc/Makefile b/etc/Makefile
index 51bbb407..fc3d1468 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -20,10 +20,10 @@ all:
@echo 'choose a target:' $(ALL)
min: min.c
- $(CC) $(CFLAGS) -o $@ $@.c -L$(LIB) -llua -llualib
+ $(CC) $(CFLAGS) -o $@ $@.c -L$(LIB) -llua $(MYLIBS)
noparser: noparser.o
- $(CC) noparser.o $(SRC)/lua.o -L$(LIB) -llua -llualib $(MYLIBS)
+ $(CC) noparser.o $(SRC)/lua.o -L$(LIB) -llua $(MYLIBS)
$(BIN)/luac $(TST)/hello.lua
-./a.out luac.out
-./a.out -e'a=1'
diff --git a/etc/README b/etc/README
index 77b6f19a..47626769 100644
--- a/etc/README
+++ b/etc/README
@@ -13,6 +13,9 @@ lua.ico
A Lua icon for Windows (and web sites, as favicon.ico).
Drawn by hand by Markus Gritsch <gritsch@iue.tuwien.ac.at>.
+lua.pc
+ pkg-config data for Lua
+
min.c
A minimal Lua interpreter.
Good for learning and for starting your own.
@@ -20,6 +23,3 @@ min.c
noparser.c
Linking with noparser.o avoids loading the parsing modules in lualib.a.
Do "make noparser" to see a demo.
-
-saconfig.c
- Configuration for Lua interpreter.
diff --git a/etc/all.c b/etc/all.c
index 720be1b2..dab68fac 100644
--- a/etc/all.c
+++ b/etc/all.c
@@ -2,9 +2,7 @@
* all.c -- Lua core, libraries and interpreter in a single file
*/
-#define LUA_CORE
-#define LUA_LIB
-#define lua_c
+#define luaall_c
#include "lapi.c"
#include "lcode.c"
diff --git a/etc/lua.pc b/etc/lua.pc
new file mode 100644
index 00000000..c476f7e4
--- /dev/null
+++ b/etc/lua.pc
@@ -0,0 +1,24 @@
+# lua.pc -- pkg-config data for Lua
+
+# vars from install Makefile
+# grep ^INSTALL_...= ../Makefile
+INSTALL_TOP= /usr/local
+INSTALL_BIN= $(INSTALL_TOP)/bin
+INSTALL_INC= $(INSTALL_TOP)/include
+INSTALL_LIB= $(INSTALL_TOP)/lib
+INSTALL_MAN= $(INSTALL_TOP)/man/man1
+# grep ^V= ../Makefile
+V= 5.1
+
+prefix=${INSTALL_TOP}
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: ${V}
+Requires:
+Libs: -L${libdir} -llua -lm
+Cflags: -I${includedir}
+
diff --git a/etc/saconfig.c b/etc/saconfig.c
deleted file mode 100644
index 676b38e1..00000000
--- a/etc/saconfig.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* saconfig.c -- configuration for stand-alone Lua interpreter
-*
-* #define LUA_USERCONFIG to this file
-*
-* Here are the features that can be customized using #define:
-*
-*** Line editing and history:
-* #define USE_READLINE to use the GNU readline library.
-* Add "-lreadline -ltermcap" to MYLIBS.
-*
-* To use another library for this, use the code below as a start.
-* Make sure you #define lua_readline and lua_saveline accordingly.
-*
-* If you do not #define lua_readline, you'll get a version based on fgets
-* that uses a static buffer of size MAXINPUT.
-*/
-
-#define USE_READLINE
-
-#ifdef USE_READLINE
-/*
-* This section implements of lua_readline and lua_saveline for lua.c using
-* the GNU readline and history libraries. It should also work with drop-in
-* replacements such as editline and libedit (you may have to include
-* different headers, though).
-*
-*/
-
-#define lua_readline myreadline
-#define lua_saveline mysaveline
-
-#include <ctype.h>
-#include <readline/readline.h>
-#include <readline/history.h>
-
-static int myreadline (lua_State *L, const char *prompt) {
- char *s=readline(prompt);
- if (s==NULL)
- return 0;
- else {
- lua_pushstring(L,s);
- lua_pushliteral(L,"\n");
- lua_concat(L,2);
- free(s);
- return 1;
- }
-}
-
-static void mysaveline (lua_State *L, const char *s) {
- const char *p;
- for (p=s; isspace(*p); p++)
- ;
- if (*p!=0) {
- size_t n=strlen(s)-1;
- if (s[n]!='\n')
- add_history(s);
- else {
- lua_pushlstring(L,s,n);
- s=lua_tostring(L,-1);
- add_history(s);
- lua_remove(L,-1);
- }
- }
-}
-#endif