Subject: bug#2266 closed by Glenn Morris <[email-masked]> (Re: bug#2266: Superfluous linking against fontconfig)

From: [email-masked] (Emacs bug Tracking System)
Date: Fri, 27 Feb 2009 22:05:06 +0000

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#2266: Superfluous linking against fontconfig

It has been closed by Glenn Morris <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Glenn Morris <[email-masked]> by
replying to this email.

-- 
2266: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=2266
Emacs Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#2266: Superfluous linking against fontconfig
From: Glenn Morris <[email-masked]>
To: [email-masked]
Date: Fri, 27 Feb 2009 16:54:06 -0500

Yavor Doganov wrote:

> 2008-10-30  Emanuele Giaquinta  <[email-masked]>
>
> 	* configure.in: Check fontconfig always.
>
> causes unnecessary linking with libfontconfig when configured
> --without-x or --with-ns:

2009-02-23  Adrian Robert  <[email-masked]>

     * configure.in (HAVE_XFT, HAVE_FREETYPE, HAVE_LIBOTF)
     (HAVE_M17N_FLT): Don't check for these unless HAVE_X11.

Subject: Superfluous linking against fontconfig
From: Yavor Doganov <[email-masked]>
To: [email-masked]
Date: Tue, 10 Feb 2009 11:24:18 +0200

Tags: patch

This change

2008-10-30  Emanuele Giaquinta  <[email-masked]>

	* configure.in: Check fontconfig always.

causes unnecessary linking with libfontconfig when configured
--without-x or --with-ns:

$ ldd -u -r src/emacs
Unused direct dependencies:
	
	/usr/lib/libfontconfig.so.1

For Emacs.app, it can't be even removed with -Wl,--as-needed since
user-defined LDFLAGS do not propagate to the link rule (yet).  A
straightforward solution seems to be the following:

2009-02-10  Yavor Doganov  <[email-masked]>  (tiny change)

	* configure.in: Check for fontconfig only if HAVE_X11=yes.

--- configure.in	10 фев 2009 09:37:08 +0200	1.585
+++ configure.in	10 фев 2009 11:16:38 +0200	
@@ -1825,7 +1825,9 @@
 fi
 
 ### Start of font-backend section.
-PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2.0, HAVE_FC=yes, HAVE_FC=no)
+if test "${HAVE_X11}" = yes; then
+  PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2.0, HAVE_FC=yes, HAVE_FC=no)
+fi
 test "${HAVE_FC}" = "no" && with_freetype=no
 
 ## Use -lXft if available, unless `--with-freetype=no' nor `--with-xft=no'.