Author: Reiner Herrmann <reiner@reiner-h.de>
Description: Fix build with GCC9
 Libraries need to be specified at the end of the command line.
 This is done automatically by appending it to LIBS instead of LDFLAGS.
 .
 This also fixes building with ld --as-needed (#631747).
Bug-Debian: https://bugs.debian.org/925636

--- a/configure.in
+++ b/configure.in
@@ -51,7 +51,7 @@
 CXXFLAGS="$CXXFLAGS $X_CFLAGS"
 LDFLAGS="$LDFLAGS $X_LIBS $X_PRE_LIBS"
 dnl Checks for X libraries.
-AC_CHECK_LIB(X11, XOpenDisplay, LDFLAGS="$LDFLAGS -lX11",
+AC_CHECK_LIB(X11, XOpenDisplay, LIBS="$LIBS -lX11",
              AC_MSG_ERROR(XOpenDisplay not found in -lX11))
 
 LDFLAGS="$LDFLAGS $X_EXTRA_LIBS"
