All pastes #240800 Raw Edit

jMCg

public text v1 · immutable
·published 2006-11-05 22:12 UTC
rendered paste body
--- configure.in	2006-11-05 23:05:34.000000000 +0100
+++ /configure.in	2006-01-29 14:10:33.000000000 +0100
@@ -739,31 +739,28 @@ if test -z "$disable_lua"; then
 	for luadir in "$withval" "" /usr /usr/local; do
 		for suffix in "" 50 51; do
 			if test "$cf_result" = no; then
-				for lualib in "" "-llualib$suffix"; do
-					LUA_LIBS="-llua$suffix $lualib -lm"
+				LUA_LIBS="-llua$suffix -llualib$suffix -lm"
 
-					if test ! -z "$luadir"; then
-						LUA_LIBS="-L$luadir/lib $LUA_LIBS"
-						LUA_CFLAGS="-I$luadir/include -I$luadir/include/lua$suffix"
-					fi
-
-					LIBS="$LUA_LIBS $LIBS_X"
-					CFLAGS="$CFLAGS_X $LUA_CFLAGS"
-					CPPFLAGS="$CPPFLAGS_X $LUA_CFLAGS"
-
-					# Check that it is a compatible Lua version
-					AC_TRY_LINK([	#include <lua.h>
-							#include <lualib.h>],
-							[	lua_State *L = lua_open();
-							luaopen_base(L);
-							luaopen_table(L);
-							luaopen_io(L);
-							luaopen_string(L);
-							luaopen_math(L);
-							lua_pushboolean(L, 1);
-							lua_close(L);],
-							cf_result=yes, cf_result=no)
-				done
+				if test ! -z "$luadir"; then
+					LUA_LIBS="-L$luadir/lib $LUA_LIBS"
+					LUA_CFLAGS="-I$luadir/include -I$luadir/include/lua$suffix"
+				fi
+
+				LIBS="$LUA_LIBS $LIBS_X"
+				CFLAGS="$CFLAGS_X $LUA_CFLAGS"
+				CPPFLAGS="$CPPFLAGS_X $LUA_CFLAGS"
+
+				# Check that it is a compatible Lua version
+				AC_TRY_LINK([	#include <lua.h>
+						#include <lualib.h>],
+					    [	lua_State *L = lua_open();
+						lua_baselibopen(L);
+						lua_mathlibopen(L);
+						lua_strlibopen(L);
+						lua_tablibopen(L);
+						lua_pushboolean(L, 1);
+						lua_close(L);],
+					    cf_result=yes, cf_result=no)
 			fi
 		done
 	done