lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, 2005-02-17 at 09:27, Luiz Henrique de Figueiredo wrote:
> > The only thing I (still) have against it, is that the lua_conf.h file
> > should imho be located elsewhere, separate from the source files.

> luaconf.h is supposed to be edited or replaced before building Lua. No
> big deal. 

Yeah, it is a big deal. Editing things that come in
the tarball is a nono because your customisations
are immediately lost when you upgrade, and if you make
a mess its hard to recover since the original is lost.

In Felix, I provide a default, and the make script
*copies* it if, and only if, the target does not exist.

The build then uses the copy, which is possibly edited.

This means when you upgrade, you get a new 'default'
to look at, but your customisations are not lost.

A client doing a fresh build gets the standard distro.
A client doing an upgrade keeps their customisation.
A client doing an upgrade who wants to redo their
customisation moves it out of the way before configuring.

In addition, the config needs to be checked, since major
upgrades will require new config stuff. To do all this
consider three files.

lua_conf.h:

#define LUA_VERSION 42
#include "lua_project.h"
#if PROJECT_VERSION != LUA_VERSION
#error "Project configuration requires upgrade"
#endif
....


lua_project.h.default
#define SITE_VERSION 42


makefile:
lua_project.h: lua_project.default:
  CP lua_project.h.default lua_project.h

This is only a rough outline of an idea.

Felix actually uses executable Python script
for config data, it would be nice for Lua
to use Lua for this, but this would
need a bootstrapped build.

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net