From de810b12050f2d0eb80cdd0d95de51c631cb0fe8 Mon Sep 17 00:00:00 2001 From: deva Date: Wed, 16 Aug 2006 13:57:10 +0000 Subject: Fixed some problems on Fedora Core 5 --- configure.in | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 72b8b96..6c78153 100644 --- a/configure.in +++ b/configure.in @@ -129,13 +129,18 @@ AC_HAVE_HEADERS(getopt.h) dnl ====================== dnl Check for the lua library dnl ====================== +LUADIR="/usr" + AC_ARG_WITH(luadir, [ --with-luadir=DIR The prefix to where LUA 5.1 is installed], - LDFLAGS="${LDFLAGS} -L${withval}/lib" - LIBS="${LIBS} -llua -lm" - CFLAGS="${CFLAGS} -I${withval}/include" - CXXFLAGS="${CXXFLAGS} -I${withval}/include" - CPPFLAGS="${CPPFLAGS} -I${withval}/include" + LUADIR=${withval} ) + +LDFLAGS="${LDFLAGS} -L${LUADIR}/lib" +LIBS="${LIBS} -llua -lm -ldl" +CFLAGS="${CFLAGS} -I${LUADIR}/include" +CXXFLAGS="${CXXFLAGS} -I${LUADIR}/include" +CPPFLAGS="${CPPFLAGS} -I${LUADIR}/include" + AC_SUBST(CFLAGS) AC_SUBST(CXXFLAGS) AC_SUBST(CPPFLAGS) @@ -144,17 +149,16 @@ AC_SUBST(LIBS) AC_CHECK_HEADER(lua.h, , AC_MSG_ERROR([*** lua headers not found!])) AC_CHECK_HEADER(lualib.h, , AC_MSG_ERROR([*** lualib header not found!])) AC_CHECK_HEADER(lauxlib.h, , AC_MSG_ERROR([*** lauxlib header not found!])) -#AC_CHECK_LIB(lua, lua_open, , AC_MSG_ERROR([*** lib lua not found!])) -AC_MSG_CHECKING([for lua_open in -llua]) +AC_MSG_CHECKING([for lua_open in -llua using LUADIR=${LUADIR}]) AC_TRY_RUN([ -#include - -int main(int argc, char *argv[]) -{ - lua_open(); - return 0; -} -],, AC_MSG_ERROR([*** lib lua not found!])) + #include + + int main(int argc, char *argv[]) + { + lua_open(); + return 0; + } +],AC_MSG_RESULT([yes]), AC_MSG_ERROR([*** lib lua not found!]) ) dnl ====================== dnl Check for pthread library -- cgit v1.2.3