changeset 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 fa9301959f02
children 6973e093955e
files ChangeLog configure configure.ac
diffstat 3 files changed, 64 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Aug 28 21:51:26 2007 +0000
+++ b/ChangeLog	Wed Aug 29 06:19:54 2007 +0000
@@ -1,3 +1,8 @@
+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.
+
 2007-08-12  Mike Sperber  <mike@xemacs.org>
 
 	* Makefile.in.in (datarootdir): Add.
--- a/configure	Tue Aug 28 21:51:26 2007 +0000
+++ b/configure	Wed Aug 29 06:19:54 2007 +0000
@@ -19603,6 +19603,15 @@
     { echo "$as_me:$LINENO: checking for Xrender, fontconfig, and Xft" >&5
 echo $ECHO_N "checking for Xrender, fontconfig, and Xft... $ECHO_C" >&6; }
     xft_includes_found=no
+        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
 
 for ac_header in freetype/config/ftheader.h
 do
@@ -19746,15 +19755,16 @@
  xft_includes_found=yes
 else
 
-                  for freetype_include_top in "/usr/X11R6/include/freetype2" \
-				  "/usr/include/freetype2"
-      do
-	if test -d $freetype_include_top; then
-	  { echo "$as_me:$LINENO: checking in ${freetype_include_top}/freetype2" >&5
-echo $ECHO_N "checking in ${freetype_include_top}/freetype2... $ECHO_C" >&6; }
-	  	  	  	  unset "$as_ac_Header"
-          save_c_switch_site="$c_switch_site"
-          c_switch_site="$c_switch_site -I${freetype_include_top}"
+			for freetype_include_top in "/usr/local/include/freetype2" \
+				    "/usr/X11R6/include/freetype2" \
+				    "/usr/include/freetype2"
+	do
+	  if test -d $freetype_include_top; then
+	    { echo "$as_me:$LINENO: checking in ${freetype_include_top}" >&5
+echo $ECHO_N "checking in ${freetype_include_top}... $ECHO_C" >&6; }
+	    	    	    	    unset "$as_ac_Header"
+	    save_c_switch_site="$c_switch_site"
+	    c_switch_site="$c_switch_site -I${freetype_include_top}"
 
 for ac_header in freetype/config/ftheader.h
 do
@@ -19902,12 +19912,13 @@
 
 done
 
-	fi
-      done
-fi
-
-done
-
+	  fi
+	done
+fi
+
+done
+
+    fi
     if test "$xft_includes_found" != "yes"; then
       { echo "Error:" "Unable to find headers for --with-xft" >&2; exit 1; }
     else
--- 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