From 1ef73876f8a289b733137471bc561502a7e44d39 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A4r=20Andersson?= <paran@nsc.liu.se>
Date: Tue, 15 Nov 2011 15:36:44 +0100
Subject: [PATCH] Fix Lua link order

Put -llua* in LIBS rather than LDFLAGS to get correct link order.
Without this the configure test for Lua fails when using GCC 4.6,
the default compiler on recent Linux distributions like Ubuntu
11.10.
---
 auxdir/x_ac_lua.m4 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/auxdir/x_ac_lua.m4 b/auxdir/x_ac_lua.m4
index a4efdbf8562..d5a7a2b7fc0 100644
--- a/auxdir/x_ac_lua.m4
+++ b/auxdir/x_ac_lua.m4
@@ -22,9 +22,9 @@ AC_DEFUN([X_AC_LUA],
 
 	if test "x$x_ac_have_lua" = "xyes"; then
 	  saved_CFLAGS="$CFLAGS"
-	  saved_LDFLAGS="$LDFLAGS"
+	  saved_LIBS="$LIBS"
 	  CFLAGS="$CFLAGS $lua_CFLAGS"
-	  LDFLAGS="$LDFLAGS $lua_LIBS"
+	  LIBS="$LIBS $lua_LIBS"
 	  AC_MSG_CHECKING([for whether we can link to liblua])
 	  AC_TRY_LINK(
 		[#include <lua.h>
@@ -37,7 +37,7 @@ AC_DEFUN([X_AC_LUA],
 
 	  AC_MSG_RESULT([$x_ac_have_lua])
 	  CFLAGS="$saved_CFLAGS"
-	  LDFLAGS="$saved_LDFLAGS"
+	  LIBS="$saved_LIBS"
 	fi
 
 	AM_CONDITIONAL(HAVE_LUA, test "x$x_ac_have_lua" = "xyes")
-- 
GitLab