lua-users home
lua-l archive

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


On Sat, Apr 6, 2013 at 8:45 AM, David Burgess <dburgess@gmail.com> wrote:
I have a simple request. Would it be possible to provide a simple
makefile and default config.h that can be used without
configure/automake/m4/rocks etc?

The configure logic needed to generate config.h is not very complicated. I've had success with this simple recipe from luabuild:

local libs
local cfg = {HAVE_CRYPT=true, HAVE_CRYPT_H=true, VERSION = "5.1.20"}
if PLAT~='Darwin' then
    libs = 'crypt '
else
    cfg.HAVE_CRYPT_H = false
end
if PLAT=='Linux' then
    libs = libs .. 'rt'
end

cfg.HAVE_SYS_STATVS_H = find.include_path 'sys/statvfs.h' ~= nil
cfg.HAVE_STATVS = cfg.HAVE_SYS_STATVS_H ~= nil

luabuild.write_config_header('config.h',cfg)

luabuild.lua 'posix'
luabuild.test 'tests-posix.lua'

return luabuild.library {'posix_c',src="">
 
I'm sure that a straightforward bash configure script would do the job.
 
My other question is about -fpic no longer required?

It will definitely be required on 64-bit Linux systems