Backport 2011-03-06T01:42:13Z!rgm@gnu.org from trunk.
authorGlenn Morris <rgm@gnu.org>
Sun, 13 Mar 2011 22:36:47 +0000 (18:36 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 13 Mar 2011 22:36:47 +0000 (18:36 -0400)
* configure.in (FREETYPE_LIBS): Actually set it to something.

* configure.in: Don't zero-out FONTCONFIG_CFLAGS and
FONTCONFIG_LIBS when building with XFT (doing so is incorrect, as
Emacs directly uses fontconfig, and breaks building when using a
strict linker).

ChangeLog
configure.in

index 4b3dcc3..b45615d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-03-13  Glenn Morris  <rgm@gnu.org>
+
+       * configure.in (FREETYPE_LIBS): Actually set it to something.
+
+2011-03-13  Miles Bader  <miles@gnu.org>
+
+       * configure.in: Don't zero-out FONTCONFIG_CFLAGS and
+       FONTCONFIG_LIBS when building with XFT (doing so is incorrect, as
+       Emacs directly uses fontconfig, and breaks building when using a
+       strict linker).
+
 2011-03-07  Chong Yidong  <cyd@stupidchicken.com>
 
        * Version 23.3 released.
index cfb2a2e..bc83bc6 100644 (file)
@@ -2034,21 +2034,21 @@ if test "${HAVE_X11}" = "yes"; then
       fi                          # "$HAVE_XFT" != no
     fi                            # "x${with_xft}" != "xno"
 
-    dnl For the "Does Emacs use" message at the end.
-    if test "$HAVE_XFT" != "yes"; then
-       HAVE_XFT=no
-    fi
-
-
-    HAVE_FREETYPE=no
     ## We used to allow building with FreeType and without Xft.
     ## However, the ftx font backend driver is not in good shape.
-    if test "${HAVE_XFT}" = "yes"; then
-      dnl As we use Xft, we anyway use freetype.
-      dnl There's no need for additional CFLAGS and LIBS.
-      HAVE_FREETYPE=yes
-      FONTCONFIG_CFLAGS=
-      FONTCONFIG_LIBS=
+    if test "$HAVE_XFT" != "yes"; then
+       dnl For the "Does Emacs use" message at the end.
+       HAVE_XFT=no
+       HAVE_FREETYPE=no
+    else
+       dnl Strict linkers fail with
+       dnl ftfont.o: undefined reference to symbol 'FT_New_Face'
+       dnl if -lfreetype is not specified.
+       dnl The following is needed to set FREETYPE_LIBS.
+       PKG_CHECK_MODULES(FREETYPE, freetype2, HAVE_FREETYPE=yes,
+                        HAVE_FREETYPE=no)
+
+       test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(libxft requires libfreetype)
     fi
 
     HAVE_LIBOTF=no