From 6bbd8e1686fc5a9f5c8d14081a026a24bb4ab33a Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Thu, 5 Jul 2007 14:34:06 +0200 Subject: [PATCH] configure.in: X11 - try link an executable using -lX11. [ For bug 959. --KON ] --- configure.in | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 8f53f8ad..724f7da5 100644 --- a/configure.in +++ b/configure.in @@ -1146,15 +1146,27 @@ dnl =================================================================== AC_PATH_X if test x"$no_x" != xyes; then + EL_SAVE_FLAGS if test -n "$x_includes"; then X_CFLAGS="-I$x_includes" + CPPFLAGS="$CPPLAGS $X_CFLAGS" + CFLAGS="$CFLAGS $X_CFLAGS" fi if test -n "$x_libraries"; then LDFLAGS="$LDFLAGS -L$x_libraries" fi LIBS="-lX11 $LIBS" - EL_DEFINE(HAVE_X11, [X11 for restoring window titles]) - AC_SUBST(X_CFLAGS) + AC_TRY_LINK([#include ],[XrmInitialize()], + cf_result=yes, cf_result=no) + EL_RESTORE_FLAGS + if test "$cf_result" = yes; then + if test -n "$x_libraries"; then + LDFLAGS="$LDFLAGS -L$x_libraries" + fi + LIBS="-lX11 $LIBS" + EL_DEFINE(HAVE_X11, [X11 for restoring window titles]) + AC_SUBST(X_CFLAGS) + fi fi