aboutsummaryrefslogtreecommitdiffstats
path: root/main/motif/14-fix_ac_find_xft.patch
blob: 76c23183e82fb3c13b77b1cf2de9fcb366320ff4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Description: Fix ac_find_xft.m4
 ac_find_xft.m4 fails tests required to enable building with Xft anti-aliased fonts.
 We also need to add -lfontconfig to LIBS to prevent underlinking of libXm.
 .
 This patch fixes these.  Build-depends on libfontconfig1-dev, libfreetype6-dev and
 libxrender-dev can be dropped as they are all dependencies of libxft-dev.
Author: Graham Inggs <graham@nerve.org.za>
Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1591
Last-Update: 2013-03-13
--- a/ac_find_xft.m4
+++ b/ac_find_xft.m4
@@ -54,28 +54,28 @@
 
 case "$freetype_lib" in
 no)
-	freetype_lib=""
+	FREETYPE_LIBS=""
 	;;
 yes)
 	case "$ft_config" in
 	no)
-		freetype_lib=""
+		FREETYPE_LIBS="-lfreetype"
 		;;
 	*)
-		freetype_lib="`$ft_config --libs`"
+		FREETYPE_LIBS="`$ft_config --libs`"
 		;;
 	esac
 	;;
 *)
-	freetype_lib="-L$freetype_lib -lfreetype"
+	FREETYPE_LIBS="-L$freetype_lib -lfreetype"
 	;;
 esac
 
 saved_LIBS="$LIBS"
-LIBS="$LIBS $freetype_lib"
+LIBS="$LIBS $FREETYPE_LIBS"
 saved_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
-AC_CHECK_HEADERS(freetype/freetype.h)
+AC_CHECK_HEADERS(freetype/freetype.h,,,[#include <ft2build.h>])
 
 FINDXFT_HAVE_FREETYPE="no"
 case "$ac_cv_header_freetype_freetype_h" in
@@ -94,6 +94,7 @@
 		FINDXFT_HAVE_FREETYPE="yes"
 		AC_DEFINE(HAVE_FREETYPE, 1, Means we have discovered the FreeType library)
 		AC_SUBST(FREETYPE_CFLAGS)
+		AC_SUBST(FREETYPE_LIBS)
 		;;
 	esac
 	;;
@@ -134,8 +135,19 @@
 FINDXFT_HAVE_XRENDER="no"
 case "$have_x" in
 yes)
-	XRENDER_CFLAGS="-I$x_includes"
-	XRENDER_LIBS="-L$x_libraries -lXft -lXrender"
+	if test x$x_includes = x
+	then
+		XRENDER_CFLAGS=""
+	else
+		XRENDER_CFLAGS="-I$x_includes"
+	fi
+
+	if test x$x_libraries = x
+	then
+		XRENDER_LIBS="-lXft -lXrender"
+	else
+		XRENDER_LIBS="-I$x_libraries -lXft -lXrender"
+	fi
 
 	saved_LIBS="$LIBS"
 	LIBS="$LIBS $XRENDER_LIBS"
@@ -203,12 +215,12 @@
 
 case "$fontconfig_lib" in
 no)
-	fontconfig_lib=""
+	FONTCONFIG_LIBS=""
 	;;
 yes)
 	case "$fc_config" in
 	no)
-		fontconfig_lib=""
+		FONTCONFIG_LIBS="-lfontconfig"
 		;;
 	*)
 		FONTCONFIG_LIBS="`$fc_config --libs`"