Subject: bug#7936: 23.2; libfontconfig not used when linking temacs

From: Peter Dyballa <[email-masked]>
Date: Sat, 29 Jan 2011 21:23:02 +0100

Hello!

When compiling GNU Emacs 23.2 the first time in summer with Fink on  
Mac OS X 10.5.8 libfontconfig was linked. Trying to build GNU Emacs  
again, due to supposed problems with libXaw3d, now with MacPorts  
instead of Fink (configure script edited to reflect this),  
libfontconfig is not linked although found by configure:

	checking for fontconfig >= 2.2.0... yes
	checking FONTCONFIG_CFLAGS... -I/opt/local/include
	checking FONTCONFIG_LIBS... -L/opt/local/lib -lfontconfig

Config.log has:

	configure:13478: checking for pkg-config
	configure:13509: result: /opt/local/bin/pkg-config
	configure:13523: checking for fontconfig >= 2.2.0
	configure:13527: result: yes
	configure:13531: checking FONTCONFIG_CFLAGS
	configure:13534: result: -I/opt/local/include
	configure:13537: checking FONTCONFIG_LIBS
	configure:13540: result: -L/opt/local/lib -lfontconfig

A related C header file gets used later:

	configure:13759: checking X11/Xft/Xft.h usability
	configure:13776: gcc-4.2 -I/opt/local/include -L/opt/local/lib -c -I/ 
opt/local/include -g -H -pipe -fPIC -fno-common -mcpu=7450 -mtune=7450  
-faltivec -fast -D_REENTRANT -I/opt/local/include/librsvg-2.0 -I/opt/ 
local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/ 
include -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/cairo  
-I/opt/local/include/libpng14 -I/opt/local/include/pixman-1 -I/opt/ 
local/include/freetype2   -I/opt/local/include -I/opt/local/include/ 
freetype2   -I/opt/local/include    -I/opt/local/include -I/opt/local/ 
include/freetype2   conftest.c >&5
	. /usr/include/stdio.h
	.. /usr/include/_types.h
	... /usr/include/sys/_types.h
	.... /usr/include/sys/cdefs.h
	.... /usr/include/machine/_types.h
	..... /usr/include/ppc/_types.h
	. /usr/include/sys/types.h
	.. /usr/include/sys/appleapiopts.h
	.. /usr/include/machine/types.h
	... /usr/include/ppc/types.h
	.... /usr/include/ppc/_types.h
	.. /usr/include/machine/endian.h
	... /usr/include/ppc/endian.h
	.... /usr/include/sys/_endian.h
	.. /usr/include/sys/_structs.h
	. /usr/include/sys/stat.h
	.. /usr/include/sys/_structs.h
	. /usr/include/stdlib.h
	.. /usr/include/available.h
	.. /usr/include/sys/wait.h
	... /usr/include/sys/signal.h
	.... /usr/include/machine/signal.h
	..... /usr/include/ppc/signal.h
	...... /usr/include/ppc/_structs.h
	.... /usr/include/sys/_structs.h
	..... /usr/include/machine/_structs.h
	...... /usr/include/ppc/_structs.h
	....... /usr/include/mach/ppc/_structs.h
	... /usr/include/sys/resource.h
	.... /usr/include/sys/_structs.h
	.. /usr/include/alloca.h
	. /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin9/4.2.1/include/ 
stddef.h
	. /usr/include/string.h
	. /usr/include/strings.h
	. /usr/include/inttypes.h
	.. /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin9/4.2.1/include/ 
stdint.h
	. /usr/include/unistd.h
	.. /usr/include/sys/unistd.h
	.. /usr/include/sys/select.h
	... /usr/include/sys/_structs.h
	... /usr/include/sys/_select.h
	. /opt/local/include/X11/Xft/Xft.h
	.. /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin9/4.2.1/include/ 
stdarg.h
	.. /opt/local/include/ft2build.h
	... /opt/local/include/freetype2/freetype/config/ftheader.h
	.. /opt/local/include/freetype2/freetype/freetype.h
	... /opt/local/include/freetype2/freetype/config/ftconfig.h
	.... /opt/local/include/freetype2/freetype/config/ftoption.h
	.... /opt/local/include/freetype2/freetype/config/ftstdlib.h
	..... /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin9/4.2.1/ 
include/stddef.h
	..... /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin9/4.2.1/ 
include/limits.h
	...... /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin9/4.2.1/ 
include/syslimits.h
	...... /usr/lib/gcc/powerpc-apple-darwin9/4.2.1/include/limits.h
	....... /usr/lib/gcc/powerpc-apple-darwin9/4.2.1/include/syslimits.h
	....... /usr/include/limits.h
	........ /usr/include/machine/limits.h
	......... /usr/include/ppc/limits.h
	.......... /usr/include/ppc/_limits.h
	........ /usr/include/sys/syslimits.h
	..... /usr/include/setjmp.h
	...... /usr/include/machine/setjmp.h
	....... /usr/include/ppc/setjmp.h
	........ /usr/include/ppc/_structs.h
	.... /usr/include/AvailabilityMacros.h
	... /opt/local/include/freetype2/freetype/fterrors.h
	.... /opt/local/include/freetype2/freetype/ftmoderr.h
	.... /opt/local/include/freetype2/freetype/fterrdef.h
	... /opt/local/include/freetype2/freetype/fttypes.h
	.... /opt/local/include/freetype2/freetype/ftsystem.h
	.... /opt/local/include/freetype2/freetype/ftimage.h
	.... /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin9/4.2.1/ 
include/stddef.h
	.. /opt/local/include/fontconfig/fontconfig.h
	.. /opt/local/include/X11/extensions/Xrender.h
	... /opt/local/include/X11/Xlib.h
	.... /opt/local/include/X11/X.h
	.... /opt/local/include/X11/Xfuncproto.h
	.... /opt/local/include/X11/Xosdefs.h
	.... /Developer/usr/bin/../lib/gcc/powerpc-apple-darwin9/4.2.1/ 
include/stddef.h
	... /opt/local/include/X11/Xutil.h
	.... /opt/local/include/X11/keysym.h
	..... /opt/local/include/X11/keysymdef.h
	... /opt/local/include/X11/extensions/render.h
	.... /opt/local/include/X11/Xdefs.h
	.. /opt/local/include/X11/Xft/XftCompat.h
	configure:13783: $? = 0
	configure:13797: result: yes

But when linking temacs it's all forgotten:

	gcc-4.2 -I/opt/local/include -L/opt/local/lib  -prebind -Xlinker - 
headerpad -Xlinker 690 -Wl,-dead_strip_dylibs -Wl,-t  -L/opt/local/lib  
-o temacs pre-crt0.o dispnew.o frame.o scroll.o xdisp.o menu.o xmenu.o  
window.o charset.o coding.o category.o ccl.o character.o chartab.o  
cm.o term.o terminal.o xfaces.o xterm.o xfns.o xselect.o xrdb.o  
fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o   emacs.o  
keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o  
marker.o minibuf.o fileio.o dired.o filemode.o cmds.o casetab.o  
casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o  
editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o  
syntax.o unexmacosx.o bytecode.o process.o callproc.o region-cache.o  
sound.o atimer.o doprnt.o strftime.o intervals.o textprop.o  
composite.o md5.o    xfont.o ftfont.o xftfont.o ftxfont.o terminfo.o  
lastfile.o  widget.o    ../lwlib/liblw.a -L/opt/local/lib -lXaw3d - 
lXmu -lXt -lSM -lICE -lXext -ltiff -ljpeg -lpng -lz -lm -lgif -lXpm - 
lX11 -lXrender -L/opt/local/lib -lXft  -L/opt/local/lib -lrsvg-2 - 
lgio-2.0 -lgdk_pixbuf-2.0 -lm -lcairo -lgobject-2.0 -lgmodule-2.0 - 
lpng14 -lgthread-2.0 -lglib-2.0 -lintl -liconv  -lncurses   -L/opt/ 
local/lib -lz -lotf -lfreetype
	/usr/lib/crt1.10.5.o
	pre-crt0.o
	dispnew.o
	frame.o
	scroll.o
	xdisp.o
	menu.o
	xmenu.o
	window.o
	charset.o
	coding.o
	category.o
	ccl.o
	character.o
	chartab.o
	cm.o
	term.o
	terminal.o
	xfaces.o
	xterm.o
	xfns.o
	xselect.o
	xrdb.o
	fontset.o
	xsmfns.o
	fringe.o
	image.o
	xsettings.o
	xgselect.o
	emacs.o
	keyboard.o
	macros.o
	keymap.o
	sysdep.o
	buffer.o
	filelock.o
	insdel.o
	marker.o
	minibuf.o
	fileio.o
	dired.o
	filemode.o
	cmds.o
	casetab.o
	casefiddle.o
	indent.o
	search.o
	regex.o
	undo.o
	alloc.o
	data.o
	doc.o
	editfns.o
	callint.o
	eval.o
	floatfns.o
	fns.o
	font.o
	print.o
	lread.o
	syntax.o
	unexmacosx.o
	bytecode.o
	process.o
	callproc.o
	region-cache.o
	sound.o
	atimer.o
	doprnt.o
	strftime.o
	intervals.o
	textprop.o
	composite.o
	md5.o
	xfont.o
	ftfont.o
	xftfont.o
	ftxfont.o
	terminfo.o
	lastfile.o
	widget.o
	../lwlib/liblw.a
	/opt/local/lib/libXaw3d.dylib
	/opt/local/lib/libXmu.dylib
	/opt/local/lib/libXt.dylib
	/opt/local/lib/libSM.dylib
	/opt/local/lib/libICE.dylib
	/opt/local/lib/libXext.dylib
	/opt/local/lib/libtiff.dylib
	/opt/local/lib/libjpeg.dylib
	/opt/local/lib/libpng.dylib
	/opt/local/lib/libz.dylib
	/usr/lib/libm.dylib
	/opt/local/lib/libgif.dylib
	/opt/local/lib/libXpm.dylib
	/opt/local/lib/libX11.dylib
	/opt/local/lib/libXrender.dylib
	/opt/local/lib/libXft.dylib
	/opt/local/lib/librsvg-2.dylib
	/opt/local/lib/libgio-2.0.dylib
	/opt/local/lib/libgdk_pixbuf-2.0.dylib
	/opt/local/lib/libcairo.dylib
	/opt/local/lib/libgobject-2.0.dylib
	/opt/local/lib/libgmodule-2.0.dylib
	/opt/local/lib/libpng14.dylib
	/opt/local/lib/libgthread-2.0.dylib
	/opt/local/lib/libglib-2.0.dylib
	/opt/local/lib/libintl.dylib
	/opt/local/lib/libiconv.dylib
	/opt/local/lib/libncurses.dylib
	/opt/local/lib/libotf.dylib
	/opt/local/lib/libfreetype.dylib
	/usr/lib/libgcc_s.10.5.dylib
	/Developer/usr/lib/gcc/powerpc-apple-darwin9/4.2.1/libgcc.a
	/usr/lib/libSystemStubs.a
	/usr/lib/libSystem.dylib
	/usr/lib/system/libmathCommon.A.dylib
	../lwlib/liblw.a(lwlib.o)
	../lwlib/liblw.a(xlwmenu.o)
	../lwlib/liblw.a(lwlib-Xlw.o)
	../lwlib/liblw.a(lwlib-Xaw.o)
	../lwlib/liblw.a(lwlib-utils.o)
	Undefined symbols:
	  "_FcPatternBuild", referenced from:
	      _ftfont_lookup_cache in ftfont.o
	  "_FcPatternAddLangSet", referenced from:
	      _ftfont_spec_pattern in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcPatternAddDouble", referenced from:
	      _apply_xft_settings in xsettings.o
	      _ftfont_spec_pattern in ftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	  "_FcPatternGetMatrix", referenced from:
	      _xftfont_open in xftfont.o
	  "_FcCharSetCreate", referenced from:
	      _ftfont_lookup_cache in ftfont.o
	      _ftfont_get_charset in ftfont.o
	      _ftfont_spec_pattern in ftfont.o
	  "_FcPatternGetLangSet", referenced from:
	      _ftfont_list in ftfont.o
	  "_FcPatternAddString", referenced from:
	      _ftfont_spec_pattern in ftfont.o
	      _ftfont_spec_pattern in ftfont.o
	      _ftfont_list in ftfont.o
	      _ftfont_list in ftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	  "_FcDefaultSubstitute", referenced from:
	      _ftfont_match in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcPatternDestroy", referenced from:
	      _apply_xft_settings in xsettings.o
	      _ftfont_lookup_cache in ftfont.o
	      _ftfont_list_family in ftfont.o
	      _ftfont_spec_pattern in ftfont.o
	      _ftfont_match in ftfont.o
	      _ftfont_match in ftfont.o
	      _ftfont_list in ftfont.o
	      _ftfont_list in ftfont.o
	      _ftfont_list in ftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	  "_FcPatternAdd", referenced from:
	      _ftfont_match in ftfont.o
	  "_FcPatternDel", referenced from:
	      _apply_xft_settings in xsettings.o
	      _apply_xft_settings in xsettings.o
	      _apply_xft_settings in xsettings.o
	      _apply_xft_settings in xsettings.o
	      _apply_xft_settings in xsettings.o
	      _apply_xft_settings in xsettings.o
	      _ftfont_list in ftfont.o
	      _ftfont_list in ftfont.o
	      _ftfont_list in ftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	  "_FcFontList", referenced from:
	      _ftfont_lookup_cache in ftfont.o
	      _ftfont_list_family in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcCharSetHasChar", referenced from:
	      _ftfont_list in ftfont.o
	      _ftfont_has_char in ftfont.o
	  "_FcPatternCreate", referenced from:
	      _apply_xft_settings in xsettings.o
	      _ftfont_list_family in ftfont.o
	      _ftfont_spec_pattern in ftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_open in xftfont.o
	  "_FcPatternDuplicate", referenced from:
	      _ftfont_list in ftfont.o
	  "_FcCharSetAddChar", referenced from:
	      _ftfont_get_charset in ftfont.o
	      _ftfont_spec_pattern in ftfont.o
	  "_FcPatternGetDouble", referenced from:
	      _apply_xft_settings in xsettings.o
	      _ftfont_pattern_entity in ftfont.o
	      _ftfont_pattern_entity in ftfont.o
	      _xftfont_open in xftfont.o
	  "_FcPatternGetString", referenced from:
	      _ftfont_list_family in ftfont.o
	      _ftfont_font_format in ftfont.o
	      _get_adstyle_property in ftfont.o
	      _ftfont_pattern_entity in ftfont.o
	      _ftfont_pattern_entity in ftfont.o
	      _ftfont_pattern_entity in ftfont.o
	      _ftfont_list in ftfont.o
	      _ftfont_list in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcNameConstant", referenced from:
	      _xftfont_add_rendering_parameters in xftfont.o
	      _xftfont_add_rendering_parameters in xftfont.o
	      _xftfont_add_rendering_parameters in xftfont.o
	  "_FcPatternGetBool", referenced from:
	      _apply_xft_settings in xsettings.o
	      _apply_xft_settings in xsettings.o
	      _ftfont_pattern_entity in ftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	  "_FcFontSetDestroy", referenced from:
	      _ftfont_lookup_cache in ftfont.o
	      _ftfont_list_family in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcFontMatch", referenced from:
	      _ftfont_match in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcLangSetDestroy", referenced from:
	      _ftfont_spec_pattern in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcLangSetAdd", referenced from:
	      _ftfont_spec_pattern in ftfont.o
	      _ftfont_spec_pattern in ftfont.o
	      _ftfont_spec_pattern in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcInit", referenced from:
	      _ftfont_list_family in ftfont.o
	      _ftfont_match in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcLangSetCreate", referenced from:
	      _ftfont_spec_pattern in ftfont.o
	      _ftfont_spec_pattern in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcCharSetCopy", referenced from:
	      _ftfont_lookup_cache in ftfont.o
	  "_FcPatternAddCharSet", referenced from:
	      _ftfont_spec_pattern in ftfont.o
	      _xftfont_open in xftfont.o
	  "_FcCharSetDestroy", referenced from:
	      _ftfont_get_charset in ftfont.o
	      _ftfont_spec_pattern in ftfont.o
	  "_FcPatternAddInteger", referenced from:
	      _apply_xft_settings in xsettings.o
	      _apply_xft_settings in xsettings.o
	      _apply_xft_settings in xsettings.o
	      _xftfont_add_rendering_parameters in xftfont.o
	      _xftfont_add_rendering_parameters in xftfont.o
	      _xftfont_add_rendering_parameters in xftfont.o
	      _xftfont_add_rendering_parameters in xftfont.o
	      _xftfont_add_rendering_parameters in xftfont.o
	      _xftfont_add_rendering_parameters in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	  "_FcObjectSetDestroy", referenced from:
	      _ftfont_lookup_cache in ftfont.o
	      _ftfont_list_family in ftfont.o
	      _ftfont_list_family in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcPatternAddBool", referenced from:
	      _apply_xft_settings in xsettings.o
	      _apply_xft_settings in xsettings.o
	      _ftfont_spec_pattern in ftfont.o
	      _xftfont_add_rendering_parameters in xftfont.o
	      _xftfont_add_rendering_parameters in xftfont.o
	      _xftfont_add_rendering_parameters in xftfont.o
	      _xftfont_add_rendering_parameters in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	  "_FcObjectSetAdd", referenced from:
	      _ftfont_list in ftfont.o
	  "_FcObjectSetBuild", referenced from:
	      _ftfont_lookup_cache in ftfont.o
	      _ftfont_list_family in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcConfigSubstitute", referenced from:
	      _ftfont_match in ftfont.o
	      _ftfont_match in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcPatternGetCharSet", referenced from:
	      _ftfont_lookup_cache in ftfont.o
	      _ftfont_list in ftfont.o
	      _ftfont_list in ftfont.o
	  "_FcPatternGetInteger", referenced from:
	      _apply_xft_settings in xsettings.o
	      _apply_xft_settings in xsettings.o
	      _apply_xft_settings in xsettings.o
	      _ftfont_pattern_entity in ftfont.o
	      _ftfont_pattern_entity in ftfont.o
	      _ftfont_pattern_entity in ftfont.o
	      _ftfont_pattern_entity in ftfont.o
	      _ftfont_pattern_entity in ftfont.o
	      _ftfont_list in ftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_cached_font_ok in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	      _xftfont_open in xftfont.o
	ld: symbol(s) not found
	collect2: ld returned 1 exit status
	make[1]: *** [temacs] Error 1
	make: *** [src] Error 2

When configuring with GTK-2 linking succeeds, possibly because of:

	checking GTK_LIBS... -L/opt/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 - 
latk-1.0 -lpangocairo-1.0 -lXext -lXrender -lXinerama -lXi -lXrandr - 
lXcursor -lXcomposite -lXdamage -lgdk_pixbuf-2.0 -lpangoft2-1.0 - 
lgio-2.0 -lXfixes -lcairo -lX11 -lpng14 -lpango-1.0 -lm -lfreetype - 
lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 - 
lintl -liconv

GNU Emacs 23.2.92 seems to behave similarly.

--
Greetings

   Pete

Email is a wonderful thing for people whose role in life is to be on  
top of things. But not for me; my role is to be on the bottom of  
things. What I do takes long hours of studying and uninterruptible  
concentration.
				– Donald Knuth