From: Rick L Bird Date: Thu, 28 Apr 2011 07:40:29 +0000 (-0400) Subject: Local liblua is detected and picked right now. X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=98de7dc61b5c7d3ebb1d9ff7c5dc6be1ba13a6cc;p=cobramush.git Local liblua is detected and picked right now. IssueID #240 --- diff --git a/config.h.in b/config.h.in index e054162..89844be 100644 --- a/config.h.in +++ b/config.h.in @@ -161,6 +161,12 @@ /* 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 @@ -176,12 +182,6 @@ /* Define to 1 if the system has the type `long long int'. */ #undef HAVE_LONG_LONG_INT -/* Define to 1 if you have the header file. */ -#undef HAVE_LUALIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LUA_H - /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H diff --git a/m4/ax_lua.m4 b/m4/ax_lua.m4 index f688ec3..c3d8943 100644 --- a/m4/ax_lua.m4 +++ b/m4/ax_lua.m4 @@ -86,31 +86,35 @@ dnl Helper function from previous metaconf methods 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],[ @@ -142,7 +146,10 @@ dnl First check if its int he normal spot.. /usr/include.. If it is.. forget the 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