/* Define to 1 if you have the `intl' library (-lintl). */
#undef HAVE_LIBINTL
+/* Define to 1 if you have the `lua' library (-llua). */
+#undef HAVE_LIBLUA
+
+/* Define to 1 if you have the `lua5.1' library (-llua5.1). */
+#undef HAVE_LIBLUA5_1
+
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
/* Define to 1 if the system has the type `long long int'. */
#undef HAVE_LONG_LONG_INT
-/* Define to 1 if you have the <lualib.h> header file. */
-#undef HAVE_LUALIB_H
-
-/* Define to 1 if you have the <lua.h> header file. */
-#undef HAVE_LUA_H
-
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
dnl
AC_DEFUN([AX_CHECK_LOCAL_LUA],
[
- AC_MSG_CHECKING([Looking for lua in lua5.1 or lua-5.1.4])
+ AC_MSG_NOTICE([Checking lua in local directories...])
lua_myincs="lua5.1 lua-5.1.4"
lua_otherincs=""
lua_thisincl=""
- for lua_thisincl in $myincs; do
- if test -r "`pwd`/$lua_thisincl/src/lua.h"; then
- lua_h_path="`pwd`/$lua_thisincl/src"
- elif test -r "`pwd`/$lua_thisincl/lua.h"; then
- lua_h_path="`pwd`/$lua_thisincl"
+ for lua_thisincl in $lua_myincs; do
+ thispath=`pwd`
+ AC_MSG_CHECKING([Checking in $thispath/$lua_thisincl])
+ if test -f "$thispath/$lua_thisincl/src/lua.h"; then
+ lua_h_path="$thispath/$lua_thisincl/src"
+ AC_MSG_RESULT([yes.. found in sub src direcctory])
+ break
+ elif test -r "$thispath/$lua_thisincl/lua.h"; then
+ lua_h_path="$thispath/$lua_thisincl"
+ AC_MSG_RESULT([yes])
+ break
else
lua_otherincs="$lua_otherincs $thisincl $thisincl/src"
+ AC_MSG_RESULT([no])
fi
done
- if test -r "$lua_h_path" ; then
- AC_MSG_RESULT([found at $lua_h_path])
- AC_MSG_CHECKING([Checking for local lua lib])
- if test -f "$lua_h_path/liblua.a"; then
- AC_MSG_RESULT([found])
- lua_ldflags="-L$lua_h_path"
- lua_libs="$libs"
- else
- AC_MSG_NOTICE([Could not locate local LUA library.])
- AC_MSG_ERROR([Either install LUA development global libraries or compile your local LUA installation])
- fi
- fi
+
+ AC_MSG_CHECKING([Checking for local lua lib at $lua_h_path])
+ if test -f "$lua_h_path/liblua.a"; then
+ AC_MSG_RESULT([found])
+ lua_ldflags="-L$lua_h_path"
+ else
+ AC_MSG_NOTICE([Could not locate local LUA library.])
+ AC_MSG_ERROR([Either install LUA development global libraries or compile your local LUA installation])
+ fi
])
AC_DEFUN([AX_FIND_LUA],[
dnl Now Lets look for our library
LDFLAGS="$LDFLAGS $lua_ldflags"
CFLAGS="$CFLAGS -I$lua_h_path"
- AC_CHECK_LIB([lua5.1], [lua_call], , AC_MSG_ERROR([CobraMUSH requires lua libraries.]))
+ AC_MSG_NOTICE([CFLAGS = $cflags and LDFLAGS = $LDFLAGS])
+ AC_CHECK_LIB([lua], [lua_call], ,[
+ AC_CHECK_LIB([lua5.1], [lua_call], , AC_MSG_ERROR([CobraMUSH requires lua libraries.]))
+ ])
])
dnl Helper function to declare extra options