Commit af535758 authored by Thaodan's avatar Thaodan

Merge branch 'jb52528' [#42]

parents cc1bcb98 2b572278
......@@ -9,6 +9,7 @@ Prefix: /usr
ExclusiveArch: %{ix86}
BuildRequires: make
BuildRequires: autoconf
BuildRequires: pkgconfig(lua)
Requires: fakeroot
Requires: libsb2 = %{version}-%{release}
......
......@@ -66,7 +66,6 @@ subdirs = preload luaif sblib pathmapping execs network rule_tree utils sb2d wra
CFLAGS += -O2 -g -Wall -W
CFLAGS += -I$(OBJDIR)/include -I$(SRCDIR)/include
CFLAGS += -I$(SRCDIR)/luaif/lua-5.1.4/src
CFLAGS += -D_GNU_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1
CFLAGS += $(MACH_CFLAG)
LDFLAGS += $(MACH_CFLAG)
......
......@@ -3,7 +3,7 @@
#automake_version=1.9
rm -rf configure autom4te.cache
#aclocal
aclocal
autoheader
autoconf
......@@ -5,6 +5,6 @@ CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@
LIBOBJS=@LIBOBJS@
#LUA51_LIBS=@LUA51_LIBS@
#LUA51_CFLAGS=@LUA51_CFLAGS@
LUA_LIBS=@LUA_LIBS@
LUA_CFLAGS=@LUA_CFLAGS@
......@@ -19,7 +19,7 @@ AC_PROG_MAKE_SET
# Checks for libraries.
AC_CHECK_LIB([dl], [dlsym])
#PKG_CHECK_MODULES(LUA51, lua5.1 >= 5.1.0)
PKG_CHECK_MODULES([LUA], lua >= 5.2.0)
# Checks for header files.
AC_HEADER_DIRENT
......@@ -222,7 +222,7 @@ AC_SUBST(CXX, ${CXX})
AC_SUBST(CFLAGS, ${CFLAGS})
AC_SUBST(LDFLAGS, ${LDFLAGS})
#AC_SUBST(LUA51_LIBS, ${LUA51_LIBS})
#AC_SUBST(LUA51_CFLAGS, ${LUA51_CFLAGS})
AC_SUBST(LUA_LIBS, ${LUA_LIBS})
AC_SUBST(LUA_CFLAGS, ${LUA_CFLAGS})
AC_OUTPUT
......@@ -664,7 +664,7 @@ int exec_postprocess_native_executable(
* if (updated_args == 1) then
* -- Add components from original argv[]
* local i
* for i = first_argv_element_to_copy, table.maxn(argv) do
* for i = first_argv_element_to_copy, #argv do
* table.insert(new_argv, argv[i])
* end
*
......@@ -849,7 +849,7 @@ static int exec_postprocess_qemu(
* table.insert(new_argv, conf_cputransparency.cmd)
* new_filename = conf_cputransparency.cmd
* else
* for i = 1, table.maxn(conf_cputransparency.qemu_argv) do
* for i = 1, #conf_cputransparency.qemu_argv do
* table.insert(new_argv, conf_cputransparency.qemu_argv[i])
* end
* new_filename = conf_cputransparency.qemu_argv[1]
......@@ -884,7 +884,7 @@ static int exec_postprocess_qemu(
}
/* if conf_cputransparency.qemu_env ~= nil then
* for i = 1, table.maxn(conf_cputransparency.qemu_env) do
* for i = 1, #conf_cputransparency.qemu_env do
* table.insert(new_envp, conf_cputransparency.qemu_env[i])
* end
* end
......
......@@ -72,14 +72,14 @@ function get_rule_tree_offset_for_union_dir_list(union_dir_list)
local union_dir_rule_list_index = ruletree.objectlist_create(#union_dir_list)
for n=1,table.maxn(union_dir_list) do
for n=1,#union_dir_list do
local component_path = union_dir_list[n]
local new_str_index = ruletree.new_string(component_path)
ruletree.objectlist_set(union_dir_rule_list_index, n-1, new_str_index)
end
if debug_messages_enabled then
print("-- Added union dir to rule db: ",table.maxn(union_dir_list),
print("-- Added union dir to rule db: ",#union_dir_list,
"rules, idx=", union_dir_rule_list_index)
end
return union_dir_rule_list_index
......@@ -280,12 +280,12 @@ function add_list_of_rules(rules, modename)
local rule_list_index = 0
if rules ~= nil then
local num_rules = table.maxn(rules)
local num_rules = #rules
if num_rules > 0 then
rule_list_index = ruletree.objectlist_create(num_rules)
for n=1,table.maxn(rules) do
for n=1,#rules do
local rule = rules[n]
local new_rule_index
......@@ -293,7 +293,7 @@ function add_list_of_rules(rules, modename)
ruletree.objectlist_set(rule_list_index, n-1, new_rule_index)
end
if debug_messages_enabled then
print("-- Added to rule db: ",table.maxn(rules),"rules, idx=", rule_list_index)
print("-- Added to rule db: ",#rules,"rules, idx=", rule_list_index)
end
end
end
......@@ -354,7 +354,7 @@ end
function add_all_exec_policies(modename_in_ruletree)
if (all_exec_policies ~= nil) then
for i = 1, table.maxn(all_exec_policies) do
for i = 1, #all_exec_policies do
local ep_name = all_exec_policies[i].name
if ep_name then
sblib.log("debug", "Adding Exec policy "..ep_name)
......
......@@ -124,7 +124,7 @@ function add_cross_compiler(gccrule, version)
if require_version == false then
-- Compiler tools without version suffix
for i = 1, table.maxn(gcc_compilers) do
for i = 1, #gcc_compilers do
local tmp = {}
local compiler_name = gcc_compilers[i]
tmp.name = prefix .. compiler_name
......@@ -144,7 +144,7 @@ function add_cross_compiler(gccrule, version)
end
-- Compiler tools with version suffix
for i = 1, table.maxn(gcc_compilers_with_version) do
for i = 1, #gcc_compilers_with_version do
local tmp = {}
tmp.name = prefix .. gcc_compilers_with_version[i] .. "-" ..
gccrule.cross_gcc_shortversion
......@@ -157,7 +157,7 @@ function add_cross_compiler(gccrule, version)
if require_version == false then
-- just map the filename for linkers and tools
for i = 1, table.maxn(gcc_linkers) do
for i = 1, #gcc_linkers do
local tmp = {}
tmp.name = prefix .. gcc_linkers[i]
tmp.new_filename = gccrule.cross_gcc_dir .. "/" .. gccrule.cross_gcc_subst_prefix .. gcc_linkers[i]
......@@ -175,7 +175,7 @@ function add_cross_compiler(gccrule, version)
end
register_gcc_component_path(tmp, gccrule)
end
for i = 1, table.maxn(gcc_tools) do
for i = 1, #gcc_tools do
local tmp = {}
tmp.name = prefix .. gcc_tools[i]
tmp.new_filename = gccrule.cross_gcc_dir .. "/" .. gccrule.cross_gcc_subst_prefix .. gcc_tools[i]
......@@ -188,7 +188,7 @@ end
if (sbox_host_gcc_prefix_list and sbox_host_gcc_prefix_list ~= "") then
-- deal with host-gcc functionality, disables mapping
for prefix in string.gmatch(sbox_host_gcc_prefix_list, "[^:]+") do
for i = 1, table.maxn(gcc_compilers) do
for i = 1, #gcc_compilers do
local tmp = {}
tmp.name = prefix .. gcc_compilers[i]
tmp.new_filename = sbox_host_gcc_dir .. "/" .. sbox_host_gcc_subst_prefix .. gcc_compilers[i]
......@@ -209,14 +209,14 @@ if (sbox_host_gcc_prefix_list and sbox_host_gcc_prefix_list ~= "") then
end
-- just map the filename for linkers and tools
for i = 1, table.maxn(gcc_linkers) do
for i = 1, #gcc_linkers do
local tmp = {}
tmp.name = prefix .. gcc_linkers[i]
tmp.new_filename = sbox_host_gcc_dir .. "/" .. sbox_host_gcc_subst_prefix .. gcc_linkers[i]
tmp.disable_mapping = 1
register_gcc_component_path(tmp, nil)
end
for i = 1, table.maxn(gcc_tools) do
for i = 1, #gcc_tools do
local tmp = {}
tmp.name = prefix .. gcc_tools[i]
tmp.new_filename = sbox_host_gcc_dir .. "/" .. sbox_host_gcc_subst_prefix .. gcc_tools[i]
......
......@@ -16,7 +16,7 @@ local reversing_disabled_message = ""
-- Order of reverse rules is not necessarily the same as order of forward rules
function test_rev_rule_position(output_rules, d_path)
local n
for n=1,table.maxn(output_rules) do
for n=1,#output_rules do
local rule = output_rules[n]
local cmp_result
cmp_result = sblib.test_path_match(d_path,
......@@ -46,7 +46,7 @@ function reverse_conditional_actions(output_rules, rev_rule_name, rule, n, forwa
end
local a
for a = 1, table.maxn(actions) do
for a = 1, #actions do
-- actions are only partial rules; the "selector" is in
-- "rule", but we must copy it temporarily to action[a],
-- otherwise reverse_one_rule_xxxx() won't be able to
......@@ -239,7 +239,7 @@ end
function reverse_rules(ofile, output_rules, input_rules, modename)
local n
for n=1,table.maxn(input_rules) do
for n=1,#input_rules do
local rule = input_rules[n]
if rule.virtual_path then
......@@ -260,13 +260,13 @@ end
function print_rules(ofile, rules)
local n
for n=1,table.maxn(rules) do
for n=1,#rules do
local rule = rules[n]
ofile:write(string.format("\t{name=\"%s\",\n", rule.name))
local k
for k=1,table.maxn(rule.comments) do
for k=1,#rule.comments do
ofile:write(rule.comments[k].."\n")
end
......@@ -322,7 +322,7 @@ function print_rules(ofile, rules)
end
ofile:write("\t},\n")
end
ofile:write(string.format("-- Printed\t%d\trules\n",table.maxn(rules)))
ofile:write(string.format("-- Printed\t%d\trules\n",#rules))
end
for m_index,m_name in pairs(all_modes) do
......
......@@ -39,7 +39,7 @@ function add_to_cputr_config(configsetname, key, t, val)
key, ruletree.new_boolean(val))
elseif t == "table" then
local list_index = ruletree.objectlist_create(#val)
for i = 1, table.maxn(val) do
for i = 1, #val do
local t2 = type(val[i])
if t2 == "string" then
local new_str_index = ruletree.new_string(val[i])
......
......@@ -44,7 +44,7 @@ end
function stringlist_to_ruletree(stringlist)
local stringlist_index = ruletree.objectlist_create(#stringlist)
for k = 1, table.maxn(stringlist) do
for k = 1, #stringlist do
local string_index = ruletree.new_string(stringlist[k])
ruletree.objectlist_set(stringlist_index, k-1, string_index)
end
......
......@@ -29,7 +29,7 @@ function argvmods_to_mapping_rules(rule_file, prefix)
if process_now and not rule.argvmods_processed then
rule.argvmods_processed = true
local k
for k=1,table.maxn(rule.path_prefixes) do
for k=1,#rule.path_prefixes do
if rule.path_prefixes[k] == "/usr/bin/" and
rule.new_filename ~= nil then
-- this rule maps "n" from /usr/bin to
......
......@@ -19,8 +19,8 @@ for m_index,m_name in pairs(all_modes) do
-- Exec policy selection table
if exec_policy_selection ~= nil then
local epsrule_list_index = ruletree.objectlist_create(table.maxn(exec_policy_selection))
for i = 1, table.maxn(exec_policy_selection) do
local epsrule_list_index = ruletree.objectlist_create(#exec_policy_selection)
for i = 1, #exec_policy_selection do
local epsrule = exec_policy_selection[i]
local ruletype = 0
local selectorstr = 0
......
......@@ -155,12 +155,12 @@ function add_net_rule_chain(net_modename, chain_name, rules)
local rule_list_index = 0
if rules ~= nil then
local num_rules = table.maxn(rules)
local num_rules = #rules
if num_rules > 0 then
rule_list_index = ruletree.objectlist_create(num_rules)
for n=1,table.maxn(rules) do
for n=1,#rules do
local rule = rules[n]
local new_rule_index
......@@ -173,7 +173,7 @@ function add_net_rule_chain(net_modename, chain_name, rules)
net_modename, chain_name, n))
end
end
print("-- Added to rule db: ",table.maxn(rules),"rules, idx=", rule_list_index)
print("-- Added to rule db: ",#rules,"rules, idx=", rule_list_index)
else
io.stderr:write(string.format(
"empty net rule chain (%s,%s)\n",
......
LUASRC = luaif/lua-5.1.4/src
# Not needed anymore, because Lua was dropped from libsb2:
# $(D)/luaif.o $(D)/argvenvp.o
......@@ -8,27 +6,14 @@ objs := $(D)/sblib_luaif.o
$(D)/sblib_luaif.o: preload/exported.h
luaif/libluaif.a: $(objs)
luaif/libluaif.a: override CFLAGS := $(CFLAGS) -O2 -g -fPIC -Wall -W -I$(SRCDIR)/$(LUASRC) -I$(OBJDIR)/preload -I$(SRCDIR)/preload \
$(WERROR) -Wmissing-prototypes -Wstrict-prototypes
luaif/libluaif.a: override CFLAGS := $(CFLAGS) -O2 -g -fPIC -Wall -W -I$(OBJDIR)/preload -I$(SRCDIR)/preload \
$(WERROR) -Wmissing-prototypes -Wstrict-prototypes $(LUA_CFLAGS)
luaif/libluaif.a: override LDFLAGS := $(LDFLAGS)
luaif/libluaif.a: override LIBS :=
lua_sources := loadlib.c lstate.c ldebug.c liolib.c llex.c lauxlib.c ldump.c \
ltablib.c lstrlib.c ldo.c lmathlib.c lapi.c lvm.c ltable.c lgc.c \
lbaselib.c lopcodes.c linit.c lfunc.c lparser.c lstring.c ldblib.c \
lzio.c loslib.c ltm.c lundump.c lobject.c lmem.c lcode.c
lua_sources_expanded = $(foreach v,$(lua_sources),$(LUASRC)/$(v))
luaif/libluaif.a: override LIBS := $(LUA_LIBS)
lua_objs := $(lua_sources_expanded:.c=.o)
luaif/sb_log.o: include/scratchbox2_version.h
luaif/liblua.a: $(lua_objs)
luaif/liblua.a: override CFLAGS := -O2 -Dfopen=fopen_nomap -g -fPIC -Wall -W $(CFLAGS)
luaif/liblua.a: override LDFLAGS := $(LDFLAGS)
luaif/liblua.a: override LIBS :=
targets := $(targets) $(D)/libluaif.a $(D)/liblua.a
targets := $(targets) $(D)/libluaif.a
Lua License
-----------
Lua is licensed under the terms of the MIT license reproduced below.
This means that Lua is free software and can be used for both academic
and commercial purposes at absolutely no cost.
For details and rationale, see http://www.lua.org/license.html .
===============================================================================
Copyright (C) 1994-2008 Lua.org, PUC-Rio.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
===============================================================================
(end of COPYRIGHT)
HISTORY for Lua 5.1
* Changes from version 5.0 to 5.1
-------------------------------
Language:
+ new module system.
+ new semantics for control variables of fors.
+ new semantics for setn/getn.
+ new syntax/semantics for varargs.
+ new long strings and comments.
+ new `mod' operator (`%')
+ new length operator #t
+ metatables for all types
API:
+ new functions: lua_createtable, lua_get(set)field, lua_push(to)integer.
+ user supplies memory allocator (lua_open becomes lua_newstate).
+ luaopen_* functions must be called through Lua.
Implementation:
+ new configuration scheme via luaconf.h.
+ incremental garbage collection.
+ better handling of end-of-line in the lexer.
+ fully reentrant parser (new Lua function `load')
+ better support for 64-bit machines.
+ native loadlib support for Mac OS X.
+ standard distribution in only one library (lualib.a merged into lua.a)
* Changes from version 4.0 to 5.0
-------------------------------
Language:
+ lexical scoping.
+ Lua coroutines.
+ standard libraries now packaged in tables.
+ tags replaced by metatables and tag methods replaced by metamethods,
stored in metatables.
+ proper tail calls.
+ each function can have its own global table, which can be shared.
+ new __newindex metamethod, called when we insert a new key into a table.
+ new block comments: --[[ ... ]].
+ new generic for.
+ new weak tables.
+ new boolean type.
+ new syntax "local function".
+ (f()) returns the first value returned by f.
+ {f()} fills a table with all values returned by f.
+ \n ignored in [[\n .
+ fixed and-or priorities.
+ more general syntax for function definition (e.g. function a.x.y:f()...end).
+ more general syntax for function calls (e.g. (print or write)(9)).
+ new functions (time/date, tmpfile, unpack, require, load*, etc.).
API:
+ chunks are loaded by using lua_load; new luaL_loadfile and luaL_loadbuffer.
+ introduced lightweight userdata, a simple "void*" without a metatable.
+ new error handling protocol: the core no longer prints error messages;
all errors are reported to the caller on the stack.
+ new lua_atpanic for host cleanup.
+ new, signal-safe, hook scheme.
Implementation:
+ new license: MIT.
+ new, faster, register-based virtual machine.
+ support for external multithreading and coroutines.
+ new and consistent error message format.
+ the core no longer needs "stdio.h" for anything (except for a single
use of sprintf to convert numbers to strings).
+ lua.c now runs the environment variable LUA_INIT, if present. It can
be "@filename", to run a file, or the chunk itself.
+ support for user extensions in lua.c.
sample implementation given for command line editing.
+ new dynamic loading library, active by default on several platforms.
+ safe garbage-collector metamethods.
+ precompiled bytecodes checked for integrity (secure binary dostring).
+ strings are fully aligned.
+ position capture in string.find.
+ read('*l') can read lines with embedded zeros.
* Changes from version 3.2 to 4.0
-------------------------------
Language:
+ new "break" and "for" statements (both numerical and for tables).
+ uniform treatment of globals: globals are now stored in a Lua table.
+ improved error messages.
+ no more '$debug': full speed *and* full debug information.
+ new read form: read(N) for next N bytes.
+ general read patterns now deprecated.
(still available with -DCOMPAT_READPATTERNS.)
+ all return values are passed as arguments for the last function
(old semantics still available with -DLUA_COMPAT_ARGRET)
+ garbage collection tag methods for tables now deprecated.
+ there is now only one tag method for order.
API:
+ New API: fully re-entrant, simpler, and more efficient.
+ New debug API.
Implementation:
+ faster than ever: cleaner virtual machine and new hashing algorithm.
+ non-recursive garbage-collector algorithm.
+ reduced memory usage for programs with many strings.
+ improved treatment for memory allocation errors.
+ improved support for 16-bit machines (we hope).
+ code now compiles unmodified as both ANSI C and C++.
+ numbers in bases other than 10 are converted using strtoul.
+ new -f option in Lua to support #! scripts.
+ luac can now combine text and binaries.
* Changes from version 3.1 to 3.2
-------------------------------
+ redirected all output in Lua's core to _ERRORMESSAGE and _ALERT.
+ increased limit on the number of constants and globals per function
(from 2^16 to 2^24).
+ debugging info (lua_debug and hooks) moved into lua_state and new API
functions provided to get and set this info.
+ new debug lib gives full debugging access within Lua.
+ new table functions "foreachi", "sort", "tinsert", "tremove", "getn".
+ new io functions "flush", "seek".
* Changes from version 3.0 to 3.1
-------------------------------
+ NEW FEATURE: anonymous functions with closures (via "upvalues").
+ new syntax:
- local variables in chunks.
- better scope control with DO block END.
- constructors can now be also written: { record-part; list-part }.
- more general syntax for function calls and lvalues, e.g.:
f(x).y=1
o:f(x,y):g(z)
f"string" is sugar for f("string")
+ strings may now contain arbitrary binary data (e.g., embedded zeros).
+ major code re-organization and clean-up; reduced module interdependecies.
+ no arbitrary limits on the total number of constants and globals.
+ support for multiple global contexts.
+ better syntax error messages.
+ new traversal functions "foreach" and "foreachvar".
+ the default for numbers is now double.
changing it to use floats or longs is easy.
+ complete debug information stored in pre-compiled chunks.
+ sample interpreter now prompts user when run interactively, and also
handles control-C interruptions gracefully.
* Changes from version 2.5 to 3.0
-------------------------------
+ NEW CONCEPT: "tag methods".
Tag methods replace fallbacks as the meta-mechanism for extending the
semantics of Lua. Whereas fallbacks had a global nature, tag methods
work on objects having the same tag (e.g., groups of tables).
Existing code that uses fallbacks should work without change.
+ new, general syntax for constructors {[exp] = exp, ... }.
+ support for handling variable number of arguments in functions (varargs).
+ support for conditional compilation ($if ... $else ... $end).
+ cleaner semantics in API simplifies host code.
+ better support for writing libraries (auxlib.h).
+ better type checking and error messages in the standard library.
+ luac can now also undump.
* Changes from version 2.4 to 2.5
-------------------------------
+ io and string libraries are now based on pattern matching;
the old libraries are still available for compatibility
+ dofile and dostring can now return values (via return statement)
+ better support for 16- and 64-bit machines
+ expanded documentation, with more examples
* Changes from version 2.2 to 2.4
-------------------------------
+ external compiler creates portable binary files that can be loaded faster
+ interface for debugging and profiling
+ new "getglobal" fallback
+ new functions for handling references to Lua objects
+ new functions in standard lib
+ only one copy of each string is stored
+ expanded documentation, with more examples
* Changes from version 2.1 to 2.2
-------------------------------
+ functions now may be declared with any "lvalue" as a name
+ garbage collection of functions
+ support for pipes
* Changes from version 1.1 to 2.1
-------------------------------
+ object-oriented support
+ fallbacks
+ simplified syntax for tables
+ many internal improvements
(end of HISTORY)
INSTALL for Lua 5.1
* Building Lua
------------
Lua is built in the src directory, but the build process can be
controlled from the top-level Makefile.
Building Lua on Unix systems should be very easy. First do "make" and
see if your platform is listed. If so, just do "make xxx", where xxx
is your platform name. The platforms currently supported are:
aix ansi bsd freebsd generic linux macosx mingw posix solaris
If your platform is not listed, try the closest one or posix, generic,
ansi, in this order.
See below for customization instructions and for instructions on how
to build with other Windows compilers.
If you want to check that Lua has been built correctly, do "make test"
after building Lua. Also, have a look at the example programs in test.
* Installing Lua
--------------
Once you have built Lua, you may want to install it in an official
place in your system. In this case, do "make install". The official
place and the way to install files are defined in Makefile. You must
have the right permissions to install files.
If you want to build and install Lua in one step, do "make xxx install",
where xxx is your platform name.
If you want to install Lua locally, then do "make local". This will
create directories bin, include, lib, man, and install Lua there as
follows:
bin: lua luac
include: lua.h luaconf.h lualib.h lauxlib.h lua.hpp
lib: liblua.a
man/man1: lua.1 luac.1
These are the only directories you need for development.
There are man pages for lua and luac, in both nroff and html, and a
reference manual in html in doc, some sample code in test, and some
useful stuff in etc. You don't need these directories for development.
If you want to install Lua locally, but in some other directory, do
"make install INSTALL_TOP=xxx", where xxx is your chosen directory.
See below for instructions for Windows and other systems.
* Customization
-------------
Three things can be customized by editing a file:
- Where and how to install Lua -- edit Makefile.
- How to build Lua -- edit src/Makefile.
- Lua features -- edit src/luaconf.h.
You don't actually need to edit the Makefiles because you may set the
relevant variables when invoking make.
On the other hand, if you need to select some Lua features, you'll need
to edit src/luaconf.h. The edited file will be the one installed, and
it will be used by any Lua clients that you build, to ensure consistency.
We strongly recommend that you enable dynamic loading. This is done
automatically for all platforms listed above that have this feature
(and also Windows). See src/luaconf.h and also src/Makefile.
* Building Lua on Windows and other systems
-----------------------------------------
If you're not using the usual Unix tools, then the instructions for
building Lua depend on the compiler you use. You'll need to create
projects (or whatever your compiler uses) for building the library,
the interpreter, and the compiler, as follows:
library: lapi.c lcode.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c
lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c
ltable.c ltm.c lundump.c lvm.c lzio.c
lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c loslib.c
ltablib.c lstrlib.c loadlib.c linit.c
interpreter: library, lua.c
compiler: library, luac.c print.c
If you use Visual Studio .NET, you can use etc/luavs.bat in its
"Command Prompt".
If all you want is to build the Lua interpreter, you may put all .c files
in a single project, except for luac.c and print.c. Or just use etc/all.c.
To use Lua as a library in your own programs, you'll need to know how to
create and use libraries with your compiler.
As mentioned above, you may edit luaconf.h to select some features before
building Lua.
(end of INSTALL)
# makefile for installing Lua
# see INSTALL for installation instructions
# see src/Makefile and src/luaconf.h for further customization
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
PLAT= none
# Where to install. The installation starts in the src and doc directories,
# so take care if INSTALL_TOP is not an absolute path.
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
#
# You probably want to make INSTALL_LMOD and INSTALL_CMOD consistent with
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V