])
AC_DEFUN([AX_FIND_LUA],[
-dnl First check if its int he normal spot.. /usr/include.. If it is.. forget the rest
- AC_MSG_CHECKING([for lua.h in /usr/include..])
- if test -f "/usr/include/lua.h"; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- AC_MSG_NOTICE([Checking other possible global loations...])
- lua_myincs="/opt/ports/include /usr/include/lua5.1"
- for thisincl in $lua_myincs
- do
- AC_MSG_CHECKING([for lua header in $thisincl])
- if test -f "$thisincl/lua.h"
- then
- lua_h_path="$thisincl"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
- done
- fi
- if test -z "$lua_h_path"; then
- AC_MSG_NOTICE([Unable to find global lua.h.])
- AX_CHECK_LOCAL_LUA()
- fi
- AC_SUBST([lua_h_path])
- dnl Now Lets look for our library
- LDFLAGS="$LDFLAGS $lua_ldflags"
- CFLAGS="$CFLAGS -I$lua_h_path"
- 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.]))
- ])
-])
+ AC_CHECK_HEADER([lua.h], [
+ AC_SEARCH_LIBS([lua_call], [lua lua5.1], , AC_MSG_ERROR([CobraMUSH requires lua]))], [
+ AX_CHECK_LOCAL_LUA()])])
dnl Helper function to declare extra options
AC_DEFUN([_AX_LUA_OPTS],