diff configure.ac @ 4152:80b3f12490a3

[xemacs-hg @ 2007-08-29 06:19:44 by michaels] 2007-08-27 Mike Sperber <mike@xemacs.org> * configure.ac: Try to use pkg-config for finding Xft includes and libraries. If that fails, search also in /usr/local.
author michaels
date Wed, 29 Aug 2007 06:19:54 +0000
parents 9aa33376bb5e
children dfd878799ef0
line wrap: on
line diff
--- a/configure.ac	Tue Aug 28 21:51:26 2007 +0000
+++ b/configure.ac	Wed Aug 29 06:19:54 2007 +0000
@@ -3490,27 +3490,39 @@
   if test "$with_xft_emacs" = "yes"; then
     AC_MSG_CHECKING([for Xrender, fontconfig, and Xft])
     xft_includes_found=no
-    AC_CHECK_HEADERS([freetype/config/ftheader.h],
-		     [xft_includes_found=yes],
-		     [
-      dnl #### How about /sw/include, and /opt/local/include?
-      dnl these directories need to be the parent of the freetype directory
-      for freetype_include_top in "/usr/X11R6/include/freetype2" \
-				  "/usr/include/freetype2"
-      do
-	if test -d $freetype_include_top; then
-	  AC_MSG_CHECKING([in ${freetype_include_top}/freetype2])
-	  dnl disable autoconf's fucking cache; why these fuckheads think it
-	  dnl is better to be broken than to be slow, I don't know!
-	  dnl #### there's gotta be a better-looking way to do this!!
-	  unset "$as_ac_Header"
-          save_c_switch_site="$c_switch_site"
-          c_switch_site="$c_switch_site -I${freetype_include_top}"
-          AC_CHECK_HEADERS([freetype/config/ftheader.h],
-			   [xft_includes_found=yes],
-			   [c_switch_site=$save_c_switch_site])
-	fi
-      done])
+    dnl try pkg-config
+    xft_config_prog="pkg-config xft"
+    xft_config_ok=`$xft_config_prog --cflags 2>/dev/null`
+    if test "$?" = 0 ; then
+	xft_cflags=`$xft_config_prog --cflags`
+	xft_libs=`$xft_config_prog --libs`
+	c_switch_site="$c_switch_site $xft_cflags"
+	ld_switch_site="$ld_switch_site $xft_libs"
+	xft_includes_found=yes
+    else
+      AC_CHECK_HEADERS([freetype/config/ftheader.h],
+		       [xft_includes_found=yes],
+		       [
+	dnl #### How about /sw/include, and /opt/local/include?
+	dnl these directories need to be the parent of the freetype directory
+	for freetype_include_top in "/usr/local/include/freetype2" \
+				    "/usr/X11R6/include/freetype2" \
+				    "/usr/include/freetype2"
+	do
+	  if test -d $freetype_include_top; then
+	    AC_MSG_CHECKING([in ${freetype_include_top}])
+	    dnl disable autoconf's fucking cache; why these fuckheads think it
+	    dnl is better to be broken than to be slow, I don't know!
+	    dnl #### there's gotta be a better-looking way to do this!!
+	    unset "$as_ac_Header"
+	    save_c_switch_site="$c_switch_site"
+	    c_switch_site="$c_switch_site -I${freetype_include_top}"
+	    AC_CHECK_HEADERS([freetype/config/ftheader.h],
+			     [xft_includes_found=yes],
+			     [c_switch_site=$save_c_switch_site])
+	  fi
+	done])
+    fi
     if test "$xft_includes_found" != "yes"; then
       XE_DIE(["Unable to find headers for --with-xft"])
     else