From 3c5e1e8bf0fc008901131bcbaaaf85b01c549836 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 23 Feb 2005 03:27:41 +0000 Subject: [PATCH] imlib2 configure.in patch SVN revision: 13473 --- configure.in | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/configure.in b/configure.in index d154fc2..59ae326 100644 --- a/configure.in +++ b/configure.in @@ -144,35 +144,28 @@ AC_ARG_WITH(freetype-config, [ --with-freetype-config=FREETYPE_CONFIG use fr freetype_cflags=`$FREETYPE_CONFIG --cflags` freetype_libs=`$FREETYPE_CONFIG --libs` -x11=no -AC_ARG_ENABLE(x11,[ --disable-x11 attempt to build with X11 support [default=yes]], -[ - if test x$enableval = xyes; then - have_x=yes - else - have_x=no - fi -], -[ - AC_CHECK_HEADER(X11/X.h, - [ have_x="yes" ], - [ have_x="no" ] - ) -] -) -AC_MSG_CHECKING(whether X11 support is to be enabled) +AC_PATH_X([X], [X11/Xlib.h], [XOpenDisplay(NULL)]) + +if test "x$have_x" = "xno"; then + # If --without-x was passed, this will be "disabled" instead of "no" -- + # so always treat "no" as an error + AC_MSG_ERROR( +[no X support found. Use --x-includes and --x-libraries to specify the X +path on your system, or --without-x to disable X support.]) +fi + if test "x$have_x" = "xyes"; then - x_dir="/usr/X11R6"; - x_cflags="-I"$x_dir"/include" - x_libs="-L"$x_dir"/lib -lX11 -lXext" - AC_MSG_RESULT(enabling X11 support) + if test "x$x_includes" != "x"; then + x_cflags="-I$x_includes" + fi + if test "x$x_libraries" != "x"; then + x_libs="-L$x_libraries -lX11 -lXext" + fi AM_CONDITIONAL(BUILD_X11, true) AC_DEFINE(BUILD_X11, 1, [enabling X11 support]) else - x_dir="" x_cflags="" x_libs="" - AC_MSG_RESULT(disabling X11 support) AM_CONDITIONAL(BUILD_X11, false) fi