7186
7226
if test "x$enable_cairo" = "xyes"; then
7227
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
7228
$as_echo_n "checking for X... " >&6; }
7231
# Check whether --with-x was given.
7232
if test "${with_x+set}" = set; then :
7236
# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
7237
if test "x$with_x" = xno; then
7238
# The user explicitly disabled X.
7241
case $x_includes,$x_libraries in #(
7242
*\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #(
7243
*,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then :
7244
$as_echo_n "(cached) " >&6
7246
# One or both of the vars are not set, and there is no cached value.
7247
ac_x_includes=no ac_x_libraries=no
7248
rm -f -r conftest.dir
7249
if mkdir conftest.dir; then
7251
cat >Imakefile <<'_ACEOF'
7253
@echo incroot='${INCROOT}'
7255
@echo usrlibdir='${USRLIBDIR}'
7257
@echo libdir='${LIBDIR}'
7259
if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
7260
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
7261
for ac_var in incroot usrlibdir libdir; do
7262
eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
7264
# Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
7265
for ac_extension in a so sl dylib la dll; do
7266
if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
7267
test -f "$ac_im_libdir/libX11.$ac_extension"; then
7268
ac_im_usrlibdir=$ac_im_libdir; break
7271
# Screen out bogus values from the imake configuration. They are
7272
# bogus both because they are the default anyway, and because
7273
# using them would break gcc on systems where it needs fixed includes.
7274
case $ac_im_incroot in
7275
/usr/include) ac_x_includes= ;;
7276
*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
7278
case $ac_im_usrlibdir in
7279
/usr/lib | /usr/lib64 | /lib | /lib64) ;;
7280
*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
7284
rm -f -r conftest.dir
7287
# Standard set of common directories for X headers.
7288
# Check X11 before X11Rn because it is often a symlink to the current release.
7302
/usr/local/X11/include
7303
/usr/local/X11R7/include
7304
/usr/local/X11R6/include
7305
/usr/local/X11R5/include
7306
/usr/local/X11R4/include
7308
/usr/local/include/X11
7309
/usr/local/include/X11R7
7310
/usr/local/include/X11R6
7311
/usr/local/include/X11R5
7312
/usr/local/include/X11R4
7316
/usr/XFree86/include/X11
7320
/usr/unsupported/include
7322
/usr/local/x11r5/include
7323
/usr/lpp/Xamples/include
7325
/usr/openwin/include
7326
/usr/openwin/share/include'
7328
if test "$ac_x_includes" = no; then
7329
# Guess where to find include files, by looking for Xlib.h.
7330
# First, try using that file with no special directory specified.
7331
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7332
/* end confdefs.h. */
7333
#include <X11/Xlib.h>
7335
if ac_fn_c_try_cpp "$LINENO"; then :
7336
# We can compile using X headers with no special include directory.
7339
for ac_dir in $ac_x_header_dirs; do
7340
if test -r "$ac_dir/X11/Xlib.h"; then
7341
ac_x_includes=$ac_dir
7346
rm -f conftest.err conftest.$ac_ext
7347
fi # $ac_x_includes = no
7349
if test "$ac_x_libraries" = no; then
7350
# Check for the libraries.
7351
# See if we find them without any special options.
7352
# Don't add to $LIBS permanently.
7355
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7356
/* end confdefs.h. */
7357
#include <X11/Xlib.h>
7366
if ac_fn_c_try_link "$LINENO"; then :
7368
# We can link X programs with no special library path.
7372
for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
7374
# Don't even attempt the hair of trying to link an X program!
7375
for ac_extension in a so sl dylib la dll; do
7376
if test -r "$ac_dir/libX11.$ac_extension"; then
7377
ac_x_libraries=$ac_dir
7383
rm -f core conftest.err conftest.$ac_objext \
7384
conftest$ac_exeext conftest.$ac_ext
7385
fi # $ac_x_libraries = no
7387
case $ac_x_includes,$ac_x_libraries in #(
7389
# Didn't find X, or a directory has "'" in its name.
7390
ac_cv_have_x="have_x=no";; #(
7392
# Record where we found X for the cache.
7393
ac_cv_have_x="have_x=yes\
7394
ac_x_includes='$ac_x_includes'\
7395
ac_x_libraries='$ac_x_libraries'"
7401
eval "$ac_cv_have_x"
7404
if test "$have_x" != yes; then
7405
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
7406
$as_echo "$have_x" >&6; }
7409
# If each of the values was on the command line, it overrides each guess.
7410
test "x$x_includes" = xNONE && x_includes=$ac_x_includes
7411
test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
7412
# Update the cache value to reflect the command line values.
7413
ac_cv_have_x="have_x=yes\
7414
ac_x_includes='$x_includes'\
7415
ac_x_libraries='$x_libraries'"
7416
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
7417
$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
7187
7420
for ac_header in X11/Xlib.h
7189
ac_fn_c_check_header_mongrel "$LINENO" "X11/Xlib.h" "ac_cv_header_X11_Xlib_h" "$ac_includes_default"
7422
ac_fn_c_check_header_compile "$LINENO" "X11/Xlib.h" "ac_cv_header_X11_Xlib_h" "#include <X11/Xlib.h>
7190
7425
if test "x$ac_cv_header_X11_Xlib_h" = x""yes; then :
7191
7426
cat >>confdefs.h <<_ACEOF
7192
7427
#define HAVE_X11_XLIB_H 1
7194
for ac_header in X11/Xutil.h X11/keysym.h
7430
for ac_header in X11/Xutil.h X11/keysym.h
7196
7432
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7197
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include <X11/Xlib.h>
7433
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
7199
7434
eval as_val=\$$as_ac_Header
7200
7435
if test "x$as_val" = x""yes; then :
7201
7436
cat >>confdefs.h <<_ACEOF
7202
7437
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7440
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5
7441
$as_echo_n "checking for XOpenDisplay in -lX11... " >&6; }
7442
if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then :
7443
$as_echo_n "(cached) " >&6
7445
ac_check_lib_save_LIBS=$LIBS
7447
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7448
/* end confdefs.h. */
7450
/* Override any GCC internal prototype to avoid an error.
7451
Use char because int might match the return type of a GCC
7452
builtin and then its argument prototype would still apply. */
7456
char XOpenDisplay ();
7460
return XOpenDisplay ();
7465
if ac_fn_c_try_link "$LINENO"; then :
7466
ac_cv_lib_X11_XOpenDisplay=yes
7468
ac_cv_lib_X11_XOpenDisplay=no
7470
rm -f core conftest.err conftest.$ac_objext \
7471
conftest$ac_exeext conftest.$ac_ext
7472
LIBS=$ac_check_lib_save_LIBS
7474
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5
7475
$as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; }
7476
if test "x$ac_cv_lib_X11_XOpenDisplay" = x""yes; then :
7479
HWLOC_X11_LIBS="-lX11"
7206
7482
$as_echo "#define HAVE_X11 1" >>confdefs.h