2005-01-17 17:51:18 +00:00
|
|
|
AC_DEFUN([SM_LUA], [
|
2004-02-14 22:05:09 +00:00
|
|
|
|
|
|
|
|
AC_CHECK_PROGS(LUA_CONFIG, [lua-config50 lua-config], "")
|
|
|
|
|
if test "$LUA_CONFIG" != ""; then
|
2004-06-04 20:32:38 +00:00
|
|
|
LUA_CFLAGS=`$LUA_CONFIG --include`
|
|
|
|
|
LUA_LIBS=`$LUA_CONFIG --static`
|
2005-01-12 14:24:44 +00:00
|
|
|
|
|
|
|
|
old_LIBS=$LIBS
|
|
|
|
|
LIBS="$LIBS $LUA_LIBS"
|
|
|
|
|
|
|
|
|
|
AC_CHECK_FUNC(lua_open, , LUA_MISSING=yes)
|
|
|
|
|
|
|
|
|
|
# If lua-config exists, we should at least have Lua; if it fails to build,
|
|
|
|
|
# something other than it not being installed is wrong.
|
|
|
|
|
if test "$LUA_MISSING" = "yes"; then
|
|
|
|
|
echo
|
|
|
|
|
echo "*** $LUA_CONFIG was found, but a Lua test program failed to build."
|
|
|
|
|
echo "*** Please check your installation."
|
|
|
|
|
exit 1;
|
|
|
|
|
fi
|
|
|
|
|
AC_CHECK_FUNC(luaopen_base, , LUA_LIB_MISSING=yes)
|
|
|
|
|
|
|
|
|
|
LIBS="$old_LIBS"
|
2004-02-14 22:05:09 +00:00
|
|
|
else
|
|
|
|
|
if test "$LIB_LUA" = ""; then
|
2004-02-16 04:49:06 +00:00
|
|
|
AC_CHECK_LIB(lua, lua_open, LIB_LUA=-llua)
|
2004-02-14 22:05:09 +00:00
|
|
|
fi
|
|
|
|
|
if test "$LIB_LUA" = ""; then
|
|
|
|
|
AC_CHECK_LIB(lua50, lua_open, LIB_LUA=-llua50)
|
|
|
|
|
fi
|
|
|
|
|
if test "$LIB_LUA_LIB" = ""; then
|
2004-06-13 18:43:21 +00:00
|
|
|
AC_CHECK_LIB(lualib, luaopen_base, LIB_LUA_LIB=-llualib, , [$LIB_LUA -ldl])
|
2004-02-14 22:05:09 +00:00
|
|
|
fi
|
|
|
|
|
if test "$LIB_LUA_LIB" = ""; then
|
2004-06-13 18:43:21 +00:00
|
|
|
AC_CHECK_LIB(lualib50, luaopen_base, LIB_LUA_LIB=-llualib50, , [$LIB_LUA -ldl])
|
2004-02-14 22:05:09 +00:00
|
|
|
fi
|
2004-06-04 20:35:05 +00:00
|
|
|
if test "$LIB_LUA" = ""; then
|
2005-01-12 14:24:44 +00:00
|
|
|
LUA_MISSING=yes
|
2004-06-04 20:35:05 +00:00
|
|
|
fi
|
|
|
|
|
if test "$LIB_LUA_LIB" = ""; then
|
2005-01-12 14:24:44 +00:00
|
|
|
LUA_LIB_MISSING=yes
|
2004-02-14 22:05:09 +00:00
|
|
|
fi
|
2004-02-15 01:39:34 +00:00
|
|
|
LUA_CFLAGS=
|
|
|
|
|
LUA_LIBS="$LIB_LUA $LIB_LUA_LIB"
|
2004-02-14 22:05:09 +00:00
|
|
|
fi
|
2005-01-12 14:24:44 +00:00
|
|
|
if test "$LUA_MISSING" = "yes"; then
|
|
|
|
|
echo
|
|
|
|
|
echo "*** liblua is required to build StepMania; please make sure that"
|
|
|
|
|
echo "*** it is installed to continue the installation process."
|
|
|
|
|
exit 1;
|
|
|
|
|
fi
|
|
|
|
|
if test "$LUA_LIB_MISSING" = "yes"; then
|
|
|
|
|
echo
|
|
|
|
|
echo "*** liblualib is required to build StepMania; please make sure that"
|
|
|
|
|
echo "*** it is installed to continue the installation process."
|
|
|
|
|
exit 1;
|
|
|
|
|
fi
|
|
|
|
|
|
2004-02-14 22:05:09 +00:00
|
|
|
AC_SUBST(LUA_CFLAGS)
|
|
|
|
|
AC_SUBST(LUA_LIBS)
|
|
|
|
|
|
|
|
|
|
])
|