]>
Commit | Line | Data |
---|---|---|
24330d27 KP |
1 | AC_INIT(fontconfig/fontconfig.h) |
2 | ||
3 | AC_PREREQ(2.13) | |
4 | ||
5 | FC_MAJOR=1 | |
6 | FC_MINOR=0 | |
7 | FC_SUB=1 | |
8 | FC_PRE= | |
9 | FC_IFACE_AGE=0 | |
10 | FC_BIN_AGE=0 | |
11 | ||
12 | AC_SUBST(FC_MAJOR) | |
13 | AC_SUBST(FC_MINOR) | |
14 | AC_SUBST(FC_SUB) | |
15 | AC_SUBST(FC_IFACE_AGE) | |
16 | AC_SUBST(FC_BIN_AGE) | |
17 | ||
18 | LT_RELEASE=$FC_MAJOR.$FC_MINOR | |
19 | LT_CURRENT=`expr $FC_SUB - $FC_IFACE_AGE` | |
20 | LT_REVISION=$FC_IFACE_AGE | |
21 | LT_AGE=`expr $FC_BIN_AGE - $FC_IFACE_AGE` | |
22 | AC_SUBST(LT_RELEASE) | |
23 | AC_SUBST(LT_CURRENT) | |
24 | AC_SUBST(LT_REVISION) | |
25 | AC_SUBST(LT_AGE) | |
26 | ||
27 | AM_INIT_AUTOMAKE("fontconfig", $FC_MAJOR.$FC_MINOR.$FC_SUB$FC_PRE) | |
28 | ||
29 | AC_CANONICAL_HOST | |
30 | AM_CONFIG_HEADER(config.h) | |
31 | ||
32 | AC_ARG_WITH(freetype_includes, [ --with-freetype-includes=DIR Use FreeType includes in DIR], freetype_includes=$withval, freetype_includes=yes) | |
33 | AC_ARG_WITH(freetype_lib, [ --with-freetype-lib=DIR Use FreeType library in DIR], freetype_lib=$withval, freetype_lib=yes) | |
34 | AC_ARG_WITH(freetype_config, [ --with-freeetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes) | |
35 | AC_ARG_WITH(xml2_includes, [ --with-xml2-includes=DIR Use xml2 includes in DIR], xml2_includes=$withval, xml2_includes=yes) | |
36 | AC_ARG_WITH(xml2_lib, [ --with-xml2-lib=DIR Use xml2 library in DIR], xml2_lib=$withval, xml2_lib=yes) | |
37 | AC_ARG_WITH(xml2_config, [ --with-freeetype-config=PROG Use FreeType configuration program PROG], xml2_config=$withval, xml2_config=yes) | |
38 | AC_ARG_WITH(fallback_fonts, [ --with-fallback-fonts=DIR Use fonts from DIR when config is busted], fallback_fonts="$withval", fallback_fonts=yes) | |
39 | AC_ISC_POSIX | |
40 | AC_PROG_CC | |
41 | AC_STDC_HEADERS | |
42 | AC_PROG_MAKE_SET | |
43 | AC_PROG_INSTALL | |
44 | ||
45 | AC_PROG_LN_S | |
46 | ||
47 | dnl | |
48 | dnl Libtool | |
49 | dnl | |
50 | AM_DISABLE_STATIC | |
51 | AM_PROG_LIBTOOL | |
52 | AC_SUBST(LIBTOOL_DEPS) | |
53 | if libtool --features | grep "enable static" >/dev/null; then | |
54 | STATIC="-static" | |
55 | else | |
56 | STATIC= | |
57 | fi | |
58 | AC_SUBST(STATIC) | |
59 | ||
60 | AC_SUBST(DEBUG_CFLAGS) | |
61 | AC_SUBST(GLOBAL_CFLAGS) | |
62 | ||
63 | AC_CHECK_FUNCS(getopt_long getopt) | |
64 | ||
65 | case "$freetype_config" in | |
66 | no) | |
67 | ;; | |
68 | yes) | |
69 | AC_CHECK_PROG(ft_config, freetype-config, freetype-config, no) | |
70 | ;; | |
71 | *) | |
72 | ft_config="$freetype_config" | |
73 | ;; | |
74 | esac | |
75 | ||
76 | case "$freetype_includes" in | |
77 | no) | |
78 | freetype_includes="" | |
79 | ;; | |
80 | yes) | |
81 | case "$ft_config" in | |
82 | no) | |
83 | freetype_includes="" | |
84 | ;; | |
85 | *) | |
86 | freetype_includes="`$ft_config --cflags`" | |
87 | ;; | |
88 | esac | |
89 | ;; | |
90 | *) | |
91 | freetype_includes="-I$freetype_includes" | |
92 | ;; | |
93 | esac | |
94 | ||
95 | case "$freetype_lib" in | |
96 | no) | |
97 | freetype_lib="" | |
98 | ;; | |
99 | yes) | |
100 | case "$ft_config" in | |
101 | no) | |
102 | freetype_lib="" | |
103 | ;; | |
104 | *) | |
105 | freetype_lib="`$ft_config --libs`" | |
106 | ;; | |
107 | esac | |
108 | ;; | |
109 | *) | |
110 | freetype_lib="-L$freetype_lib -lfreetype" | |
111 | ;; | |
112 | esac | |
113 | ||
114 | case "$fallback_fonts" in | |
115 | yes) | |
116 | AC_DEFINE_UNQUOTED(FC_FALLBACK_FONTS, "/usr/X11R6/lib/X11/fonts/Type1") | |
117 | ;; | |
118 | *) | |
119 | AC_DEFINE_UNQUOTED(FC_FALLBACK_FONTS, "$fallback_fonts") | |
120 | ;; | |
121 | esac | |
122 | ||
123 | saved_LIBS="$LIBS" | |
124 | LIBS="$LIBS $freetype_lib" | |
125 | saved_CPPFLAGS="$CPPFLAGS" | |
126 | CPPFLAGS="$CPPFLAGS $freetype_includes" | |
127 | AC_CHECK_HEADERS(ft2build.h) | |
128 | ||
129 | case "$ac_cv_header_ft2build_h" in | |
130 | no) | |
131 | CPPFLAGS="$saved_CPPFLAGS" | |
132 | LIBS="$saved_LIBS" | |
133 | ;; | |
134 | yes) | |
135 | AC_CHECK_FUNCS(FT_Init_FreeType) | |
136 | case "$ac_cv_func_FT_Init_FreeType" in | |
137 | no) | |
138 | CPPFLAGS="$saved_CPPFLAGS" | |
139 | LIBS="$saved_LIBS" | |
140 | ;; | |
141 | yes) | |
142 | AC_DEFINE(HAVE_FREETYPE) | |
143 | ;; | |
144 | esac | |
145 | ;; | |
146 | esac | |
147 | ||
148 | case "$xml2_config" in | |
149 | no) | |
150 | ;; | |
151 | yes) | |
152 | AC_CHECK_PROG(xml2_config_prog, xml2-config, xml2-config, no) | |
153 | ;; | |
154 | *) | |
155 | ;; | |
156 | esac | |
157 | ||
158 | case "$xml2_includes" in | |
159 | no) | |
160 | xml2_includes="" | |
161 | ;; | |
162 | yes) | |
163 | case "$xml2_config_prog" in | |
164 | no) | |
165 | xml2_includes="" | |
166 | ;; | |
167 | *) | |
168 | xml2_includes="`$xml2_config_prog --cflags`" | |
169 | ;; | |
170 | esac | |
171 | ;; | |
172 | *) | |
173 | xml2_includes="-I$xml2_includes" | |
174 | ;; | |
175 | esac | |
176 | ||
177 | case "$xml2_lib" in | |
178 | no) | |
179 | xml2_lib="" | |
180 | ;; | |
181 | yes) | |
182 | case "$xml2_config_prog" in | |
183 | no) | |
184 | xml2_lib="" | |
185 | ;; | |
186 | *) | |
187 | xml2_lib="`$xml2_config_prog --libs`" | |
188 | ;; | |
189 | esac | |
190 | ;; | |
191 | *) | |
192 | xml2_lib="-L$xml2_lib -lxml2" | |
193 | ;; | |
194 | esac | |
195 | ||
196 | saved_LIBS="$LIBS" | |
197 | LIBS="$LIBS $xml2_lib" | |
198 | saved_CPPFLAGS="$CPPFLAGS" | |
199 | CPPFLAGS="$CPPFLAGS $xml2_includes" | |
200 | AC_CHECK_HEADERS(xmlversion.h) | |
201 | ||
202 | AC_OUTPUT(Makefile src/Makefile fontconfig/Makefile fc-cache/Makefile fc-list/Makefile) |