File mysql-gui-common-lua.patch of Package mysql-gui-tools

--- configure.in	2006/10/23 22:32:18	1.9
+++ configure.in	2006/10/23 22:34:37
@@ -172,7 +172,10 @@
   AC_CHECK_PROG(LUA_CFLAGS,lua-config,`lua-config --include`)
   AC_CHECK_PROG(LUA_LDFLAGS,lua-config,`lua-config --libs`)
 fi
-
+if test x"$LUA_CFLAGS$LUA_LDFLAGS" = "x"; then
+  PKG_CHECK_MODULES(LUA,lua >= 5.1,LUA_FOUND=yes,LUA_FOUND=no)
+  LUA_LDFLAGS="$LUA_LIBS"
+fi
 if test x"$LUA_LDFLAGS" = "x"; then
   AC_CHECK_LIB(lua, lua_open, ac_lua_found=yes, ac_lua_found=no, $LUA_LDFLAGS)
 
--- library/generic-runtime/source/myx_grt_lua.c	2006/10/23 23:09:30	1.1
+++ library/generic-runtime/source/myx_grt_lua.c	2006/10/23 23:10:14
@@ -39,7 +39,7 @@
         { "string",     luaopen_string },
         { "math",       luaopen_math },
         { "debug",      luaopen_debug },
-        { "loadlib",    luaopen_loadlib },
+        { "package",    luaopen_package },
         { "lxp",        luaopen_lxp },
         { NULL,         NULL }
 };
--- library/generic-runtime/source/lxp/lxplib.c	2006/10/23 23:30:17	1.1
+++ library/generic-runtime/source/lxp/lxplib.c	2006/10/23 23:34:06
@@ -322,6 +322,14 @@
   return res;
 }
 
+static int luaL_findstring_compat (const char *name, const char *const list[]) {
+  int i;
+  for (i=0; list[i]; i++)
+    if (strcmp(list[i], name) == 0)
+      return i;
+  return -1;  /* name not found */
+}
+
 
 static void checkcallbacks (lua_State *L) {
   static const char *const validkeys[] = {
@@ -335,7 +343,7 @@
   while (lua_next(L, 1)) {
     lua_pop(L, 1);  /* remove value */
     if (lua_type(L, -1) != LUA_TSTRING ||
-        luaL_findstring(lua_tostring(L, -1), validkeys) < 0)
+        luaL_findstring_compat(lua_tostring(L, -1), validkeys) < 0)
       luaL_error(L, "invalid key `%s' in callback table", lua_tostring(L, -1));
   }
 }