diff options
| -rw-r--r-- | onelua.c | 20 |
1 files changed, 17 insertions, 3 deletions
| @@ -1,5 +1,14 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * one.c -- Lua core, libraries, and interpreter in a single file | 2 | ** Lua core, libraries, and interpreter in a single file. |
| 3 | ** Compiling just this file generates a complete Lua stand-alone | ||
| 4 | ** program: | ||
| 5 | ** | ||
| 6 | ** $ gcc -O2 -std=c99 -o lua onelua.c -lm | ||
| 7 | ** | ||
| 8 | ** or | ||
| 9 | ** | ||
| 10 | ** $ gcc -O2 -std=c89 -DLUA_USE_C89 -o lua onelua.c -lm | ||
| 11 | ** | ||
| 3 | */ | 12 | */ |
| 4 | 13 | ||
| 5 | /* default is to build the full interpreter */ | 14 | /* default is to build the full interpreter */ |
| @@ -11,8 +20,12 @@ | |||
| 11 | #endif | 20 | #endif |
| 12 | #endif | 21 | #endif |
| 13 | 22 | ||
| 14 | /* choose suitable platform-specific features */ | 23 | |
| 15 | /* some of these may need extra libraries such as -ldl -lreadline -lncurses */ | 24 | /* |
| 25 | ** Choose suitable platform-specific features. Default is no | ||
| 26 | ** platform-specific features. Some of these options may need extra | ||
| 27 | ** libraries such as -ldl -lreadline -lncurses | ||
| 28 | */ | ||
| 16 | #if 0 | 29 | #if 0 |
| 17 | #define LUA_USE_LINUX | 30 | #define LUA_USE_LINUX |
| 18 | #define LUA_USE_MACOSX | 31 | #define LUA_USE_MACOSX |
| @@ -20,6 +33,7 @@ | |||
| 20 | #define LUA_ANSI | 33 | #define LUA_ANSI |
| 21 | #endif | 34 | #endif |
| 22 | 35 | ||
| 36 | |||
| 23 | /* no need to change anything below this line ----------------------------- */ | 37 | /* no need to change anything below this line ----------------------------- */ |
| 24 | 38 | ||
| 25 | #include "lprefix.h" | 39 | #include "lprefix.h" |
