>From c86d7fd63a0bc416944f2b000021c337de0da099 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Sun, 20 Jul 2008 14:37:30 -0700 Subject: [PATCH] Prefer pkg-config when searching for the X installation Add a new internal subroutine for _AC_PATH_X, _AC_PATH_X_PKGCONFIG, which sets the X installation directories by searching for the x11 package through pkg-config. If pkg-config is not available, or the x11 package is not found, then it will fall back to using the same checks in _AC_PATH_XMKMF and _AC_PATH_X_DIRECT. --- xorg-path.m4 | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/xorg-path.m4 b/xorg-path.m4 index 41ba6b7..87476ba 100644 --- a/xorg-path.m4 +++ b/xorg-path.m4 @@ -59,6 +59,24 @@ # --------------------- # +# _AC_PATH_X_PKGCONFIG +# -------------------- +# Internal subroutine of _AC_PATH_X. +# Set ac_x_includes and/or ac_x_libraries. +m4_define([_AC_PATH_X_PKGCONFIG], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +PKG_CHECK_EXISTS([x11], +[case `$PKG_CONFIG --cflags-only-I x11 2>/dev/null` in + '') ac_x_includes= ;; + *) ac_x_includes=`$PKG_CONFIG --variable=includedir x11 2>/dev/null` ;; +esac +case `$PKG_CONFIG --libs-only-L x11 2>/dev/null` in + '') ac_x_libraries= ;; + *) ac_x_libraries=`$PKG_CONFIG --variable=libdir x11 2>/dev/null` ;; +esac]) +])# _AC_PATH_X_PKGCONFIG + + # _AC_PATH_X_XMKMF # ---------------- # Internal subroutine of _AC_PATH_X. @@ -195,6 +213,7 @@ AC_DEFUN([_AC_PATH_X], [AC_CACHE_VAL(ac_cv_have_x, [# One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no +_AC_PATH_X_PKGCONFIG _AC_PATH_X_XMKMF _AC_PATH_X_DIRECT case $ac_x_includes,$ac_x_libraries in #( -- 1.5.6.2