From: Ari Johnson Date: Thu, 28 Apr 2011 19:07:22 +0000 (-0400) Subject: Simplify check for lua.h and -llua X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=47b034d000276ec537795fae90465f48098667f2;p=cobramush.git Simplify check for lua.h and -llua --- diff --git a/m4/ax_lua.m4 b/m4/ax_lua.m4 index 8a5a771..e500855 100644 --- a/m4/ax_lua.m4 +++ b/m4/ax_lua.m4 @@ -118,39 +118,9 @@ dnl ]) 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],