2
0
Fork 0

[waf] Fix pkg-config check for lua, needs different names on different platforms...

This commit is contained in:
Thomas Porzelt 2009-08-31 11:03:11 +02:00
parent 94e33528fe
commit 0c875742d1
1 changed files with 11 additions and 4 deletions

15
wscript
View File

@ -87,11 +87,18 @@ def configure(conf):
]
if opts.lua:
# lua has different names in pkg-config on different systems, we do trial and error
# debian
if not conf.check_cfg(package='lua5.1', uselib_store='lua', args='--cflags --libs'):
conf.env['LIB_lua'] = [ 'm' ]
conf.check(lib='lua', uselib_store='lua', mandatory=True)
conf.check(header_name='lua.h', uselib='lua', mandatory=True)
conf.check(function_name='lua_setfield', header_name='lua.h', uselib='lua', mandatory=True)
# freebsd
if not conf.check_cfg(package='lua-5.1', uselib_store='lua', args='--cflags --libs'):
# osx
if not conf.check_cfg(package='lua', uselib_store='lua', args='--cflags --libs'):
# no pkg-config, try by hand
conf.env['LIB_lua'] = [ 'm' ]
conf.check(lib='lua', uselib_store='lua', mandatory=True)
conf.check(header_name='lua.h', uselib='lua', mandatory=True)
conf.check(function_name='lua_setfield', header_name='lua.h', uselib='lua', mandatory=True)
conf.define('HAVE_LUA_H', 1)
conf.define('HAVE_LIBLUA', 1)