]>
Commit | Line | Data |
---|---|---|
20fa60c9 | 1 | dnl |
e690fbb2 | 2 | dnl fontconfig/configure.in |
20fa60c9 | 3 | dnl |
46b51147 | 4 | dnl Copyright © 2003 Keith Packard |
20fa60c9 KP |
5 | dnl |
6 | dnl Permission to use, copy, modify, distribute, and sell this software and its | |
7 | dnl documentation for any purpose is hereby granted without fee, provided that | |
8 | dnl the above copyright notice appear in all copies and that both that | |
9 | dnl copyright notice and this permission notice appear in supporting | |
10 | dnl documentation, and that the name of Keith Packard not be used in | |
11 | dnl advertising or publicity pertaining to distribution of the software without | |
12 | dnl specific, written prior permission. Keith Packard makes no | |
13 | dnl representations about the suitability of this software for any purpose. It | |
14 | dnl is provided "as is" without express or implied warranty. | |
15 | dnl | |
3074a73b | 16 | dnl THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, |
20fa60c9 | 17 | dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO |
3074a73b | 18 | dnl EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR |
20fa60c9 KP |
19 | dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, |
20 | dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER | |
21 | dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | |
22 | dnl PERFORMANCE OF THIS SOFTWARE. | |
fb9545b1 | 23 | dnl |
20fa60c9 | 24 | dnl Process this file with autoconf to create configure. |
24330d27 | 25 | |
8fc10a72 KP |
26 | AC_INIT(fonts.dtd) |
27 | ||
20fa60c9 KP |
28 | dnl ========================================================================== |
29 | dnl Versioning | |
30 | dnl ========================================================================== | |
fa244f3d | 31 | |
ff3f1f98 KP |
32 | dnl This is the package version number, not the shared library |
33 | dnl version. This same version number must appear in fontconfig/fontconfig.h | |
34 | dnl Yes, it is a pain to synchronize version numbers. Unfortunately, it's | |
35 | dnl not possible to extract the version number here from fontconfig.h | |
b322eb4d | 36 | AM_INIT_AUTOMAKE(fontconfig, 2.7.3) |
247c4f3d | 37 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) |
6ae6acf3 | 38 | AM_MAINTAINER_MODE |
24330d27 | 39 | |
20fa60c9 KP |
40 | dnl libtool versioning |
41 | ||
4984242e KP |
42 | dnl bump revision when fixing bugs |
43 | dnl bump current and age, reset revision to zero when adding APIs | |
44 | dnl bump current, leave age, reset revision to zero when changing/removing APIS | |
50d937b0 | 45 | LIBT_CURRENT=5 |
afc845d9 | 46 | LIBT_REVISION=3 |
19d124dc KP |
47 | AC_SUBST(LIBT_CURRENT) |
48 | AC_SUBST(LIBT_REVISION) | |
50d937b0 | 49 | LIBT_AGE=4 |
ff3f1f98 | 50 | |
19d124dc KP |
51 | LIBT_VERSION_INFO="$LIBT_CURRENT:$LIBT_REVISION:$LIBT_AGE" |
52 | AC_SUBST(LIBT_VERSION_INFO) | |
20fa60c9 | 53 | |
19d124dc KP |
54 | LIBT_CURRENT_MINUS_AGE=`expr $LIBT_CURRENT - $LIBT_AGE` |
55 | AC_SUBST(LIBT_CURRENT_MINUS_AGE) | |
daeed6e0 | 56 | |
20fa60c9 KP |
57 | dnl ========================================================================== |
58 | ||
20fa60c9 | 59 | AM_CONFIG_HEADER(config.h) |
fb9545b1 | 60 | |
24330d27 | 61 | AC_PROG_CC |
24330d27 | 62 | AC_PROG_INSTALL |
24330d27 | 63 | AC_PROG_LN_S |
daeed6e0 | 64 | AC_LIBTOOL_WIN32_DLL |
20fa60c9 | 65 | AM_PROG_LIBTOOL |
ef9db2e2 | 66 | DOLT |
20fa60c9 KP |
67 | AC_PROG_MAKE_SET |
68 | ||
daeed6e0 TL |
69 | dnl ========================================================================== |
70 | ||
71 | case "$host" in | |
72 | *-*-mingw*) | |
73 | os_win32=yes | |
74 | ;; | |
75 | *) | |
76 | os_win32=no | |
77 | esac | |
78 | AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes") | |
79 | ||
80 | if test "$os_win32" = "yes"; then | |
81 | AC_CHECK_PROG(ms_librarian, lib.exe, yes, no) | |
82 | fi | |
83 | AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes) | |
84 | ||
6ae6acf3 | 85 | WARN_CFLAGS="" |
6ae6acf3 KP |
86 | if test "x$GCC" = "xyes"; then |
87 | WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \ | |
88 | -Wmissing-prototypes -Wmissing-declarations \ | |
89 | -Wnested-externs -fno-strict-aliasing" | |
5b8e43a4 KP |
90 | AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1, |
91 | [Can use #warning in C files]) | |
6ae6acf3 KP |
92 | fi |
93 | AC_SUBST(WARN_CFLAGS) | |
94 | ||
5b8e43a4 | 95 | |
daeed6e0 TL |
96 | dnl ========================================================================== |
97 | ||
d8ae9c92 KP |
98 | AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes) |
99 | ||
100 | dnl ========================================================================== | |
101 | ||
102 | # Setup for compiling build tools (fc-glyphname, etc) | |
103 | AC_MSG_CHECKING([for a C compiler for build tools]) | |
104 | if test $cross_compiling = yes; then | |
105 | AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) | |
106 | else | |
107 | CC_FOR_BUILD=$CC | |
108 | fi | |
109 | AC_MSG_RESULT([$CC_FOR_BUILD]) | |
110 | AC_SUBST(CC_FOR_BUILD) | |
111 | ||
112 | AC_MSG_CHECKING([for suffix of executable build tools]) | |
113 | if test $cross_compiling = yes; then | |
114 | cat >conftest.c <<\_______EOF | |
115 | int | |
116 | main () | |
117 | { | |
118 | exit (0); | |
119 | } | |
120 | _______EOF | |
121 | for i in .exe ""; do | |
122 | compile="$CC_FOR_BUILD conftest.c -o conftest$i" | |
123 | if AC_TRY_EVAL(compile); then | |
124 | if (./conftest) 2>&AC_FD_CC; then | |
125 | EXEEXT_FOR_BUILD=$i | |
126 | break | |
127 | fi | |
128 | fi | |
129 | done | |
130 | rm -f conftest* | |
131 | if test "${EXEEXT_FOR_BUILD+set}" != set; then | |
132 | AC_MSG_ERROR([Cannot determine suffix of executable build tools]) | |
133 | fi | |
134 | else | |
135 | EXEEXT_FOR_BUILD=$EXEEXT | |
136 | fi | |
137 | AC_MSG_RESULT([$EXEEXT_FOR_BUILD]) | |
138 | AC_SUBST(EXEEXT_FOR_BUILD) | |
139 | ||
140 | dnl ========================================================================== | |
141 | ||
2b629781 KP |
142 | AC_ARG_WITH(arch, [ --with-arch=ARCH Force architecture to ARCH], arch="$withval", arch=auto) |
143 | ||
144 | if test $cross_compiling = yes; then | |
145 | case "$arch" in | |
146 | auto) | |
147 | AC_MSG_ERROR([Cannot autodetect architecture in cross compile environment] | |
148 | [Use --with-arch=ARCH to specify architecture]) | |
149 | ;; | |
150 | esac | |
151 | fi | |
152 | ||
153 | ARCHITECTURE=$arch | |
154 | AC_SUBST(ARCHITECTURE) | |
155 | ||
156 | dnl ========================================================================== | |
157 | ||
fb9545b1 KP |
158 | # Checks for header files. |
159 | AC_HEADER_DIRENT | |
160 | AC_HEADER_STDC | |
73775d8f | 161 | AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h]) |
fb9545b1 KP |
162 | |
163 | # Checks for typedefs, structures, and compiler characteristics. | |
164 | AC_C_CONST | |
44415a07 | 165 | AC_C_INLINE |
fb9545b1 KP |
166 | AC_TYPE_PID_T |
167 | ||
168 | # Checks for library functions. | |
fb9545b1 | 169 | AC_FUNC_VPRINTF |
d6217cc6 | 170 | AC_FUNC_MMAP |
cc104e6a | 171 | AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr strtol getopt getopt_long sysconf ftruncate chsize rand random lrand48]) |
73775d8f PL |
172 | |
173 | # | |
174 | # Checks for iconv | |
175 | # | |
176 | AC_MSG_CHECKING([for a usable iconv]) | |
177 | ICONV_LIBS="" | |
178 | AC_TRY_LINK([#include <iconv.h>], | |
179 | [iconv_open ("from", "to");], | |
180 | [use_iconv=1], | |
181 | [use_iconv=0]) | |
182 | if test x$use_iconv = x1; then | |
183 | AC_MSG_RESULT([libc]) | |
184 | else | |
185 | # try using libiconv | |
186 | fontconfig_save_libs="$LIBS" | |
187 | LIBS="$LIBS -liconv" | |
188 | ||
189 | AC_TRY_LINK([#include <iconv.h>], | |
190 | [iconv_open ("from", "to");], | |
34918278 KP |
191 | [use_iconv=1], |
192 | [use_iconv=0]) | |
73775d8f PL |
193 | |
194 | if test x$use_iconv = x1; then | |
195 | ICONV_LIBS="-liconv" | |
196 | AC_MSG_RESULT([libiconv]) | |
197 | else | |
198 | AC_MSG_RESULT([no]) | |
199 | fi | |
200 | ||
201 | LIBS="$fontconfig_save_libs" | |
202 | fi | |
203 | AC_SUBST(ICONV_LIBS) | |
204 | AC_DEFINE_UNQUOTED(USE_ICONV,$use_iconv,[Use iconv.]) | |
fb9545b1 | 205 | |
446bb9c9 | 206 | # |
20fa60c9 | 207 | # Checks for FreeType |
fb9545b1 | 208 | # |
24330d27 | 209 | |
3910f322 | 210 | AC_ARG_WITH(freetype-config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes) |
24330d27 | 211 | |
20fa60c9 KP |
212 | if test "$freetype_config" = "yes"; then |
213 | AC_PATH_PROG(ft_config,freetype-config,no) | |
214 | if test "$ft_config" = "no"; then | |
215 | AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/]) | |
216 | fi | |
217 | else | |
218 | ft_config="$freetype_config" | |
219 | fi | |
24330d27 | 220 | |
996580dc KP |
221 | FREETYPE_CFLAGS="`$ft_config --cflags`" |
222 | FREETYPE_LIBS="`$ft_config --libs`" | |
24330d27 | 223 | |
20fa60c9 KP |
224 | AC_SUBST(FREETYPE_LIBS) |
225 | AC_SUBST(FREETYPE_CFLAGS) | |
fb9545b1 | 226 | |
4f38fa81 KP |
227 | fontconfig_save_libs="$LIBS" |
228 | fontconfig_save_cflags="$CFLAGS" | |
20fa60c9 | 229 | LIBS="$LIBS $FREETYPE_LIBS" |
4f38fa81 | 230 | CFLAGS="$CFLAGS $FREETYPE_CFLAGS" |
00c0972a | 231 | AC_CHECK_FUNCS(FT_Get_Next_Char FT_Get_BDF_Property FT_Get_PS_Font_Info FT_Has_PS_Glyph_Names FT_Get_X11_Font_Format FT_Select_Size) |
208a720f KP |
232 | AC_CHECK_MEMBER(FT_Bitmap_Size.y_ppem, |
233 | HAVE_FT_BITMAP_SIZE_Y_PPEM=1, | |
234 | HAVE_FT_BITMAP_SIZE_Y_PPEM=0, | |
4f38fa81 KP |
235 | [#include <ft2build.h> |
236 | #include FT_FREETYPE_H]) | |
4f38fa81 KP |
237 | AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,$HAVE_FT_BITMAP_SIZE_Y_PPEM, |
238 | [FT_Bitmap_Size structure includes y_ppem field]) | |
6ae6acf3 KP |
239 | CFLAGS="$fontconfig_save_cflags" |
240 | LIBS="$fontconfig_save_libs" | |
fb9545b1 | 241 | |
fa244f3d KP |
242 | # |
243 | # Check expat configuration | |
244 | # | |
24330d27 | 245 | |
20fa60c9 | 246 | AC_ARG_WITH(expat, [ --with-expat=DIR Use Expat in DIR], expat=$withval, expat=yes) |
3910f322 KP |
247 | AC_ARG_WITH(expat-includes, [ --with-expat-includes=DIR Use Expat includes in DIR], expat_includes=$withval, expat_includes=yes) |
248 | AC_ARG_WITH(expat-lib, [ --with-expat-lib=DIR Use Expat library in DIR], expat_lib=$withval, expat_lib=yes) | |
20fa60c9 | 249 | |
e99f0f0a PL |
250 | if test "$enable_libxml2" != "yes"; then |
251 | case "$expat" in | |
252 | no) | |
24330d27 | 253 | ;; |
e99f0f0a PL |
254 | *) |
255 | case "$expat_includes" in | |
59e149e7 | 256 | yes) |
e99f0f0a PL |
257 | case "$expat" in |
258 | yes) | |
259 | ;; | |
260 | *) | |
261 | EXPAT_CFLAGS="-I$expat/include" | |
262 | ;; | |
263 | esac | |
264 | ;; | |
265 | no) | |
266 | EXPAT_CFLAGS="" | |
59e149e7 KP |
267 | ;; |
268 | *) | |
e99f0f0a | 269 | EXPAT_CFLAGS="-I$expat_includes" |
59e149e7 KP |
270 | ;; |
271 | esac | |
e99f0f0a | 272 | case "$expat_lib" in |
fa244f3d | 273 | yes) |
e99f0f0a PL |
274 | case "$expat" in |
275 | yes) | |
276 | EXPAT_LIBS="-lexpat" | |
277 | ;; | |
278 | *) | |
279 | EXPAT_LIBS="-L$expat/lib -lexpat" | |
280 | ;; | |
281 | esac | |
282 | ;; | |
283 | no) | |
fb9545b1 KP |
284 | ;; |
285 | *) | |
e99f0f0a | 286 | EXPAT_LIBS="-L$expat_lib -lexpat" |
fb9545b1 KP |
287 | ;; |
288 | esac | |
fb9545b1 | 289 | |
e99f0f0a PL |
290 | expatsaved_CPPFLAGS="$CPPFLAGS" |
291 | CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS" | |
292 | expatsaved_LIBS="$LIBS" | |
293 | LIBS="$LIBS $EXPAT_LIBS" | |
fb9545b1 | 294 | |
e99f0f0a PL |
295 | AC_CHECK_HEADER(expat.h) |
296 | case "$ac_cv_header_expat_h" in | |
fb9545b1 | 297 | no) |
e99f0f0a PL |
298 | AC_CHECK_HEADER(xmlparse.h) |
299 | case "$ac_cv_header_xmlparse_h" in | |
300 | no) | |
301 | have_expat_header=no; | |
302 | ;; | |
303 | yes) | |
304 | HAVE_XMLPARSE_H=1 | |
305 | AC_SUBST(HAVE_XMLPARSE_H) | |
306 | AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H, | |
307 | [Use xmlparse.h instead of expat.h]) | |
308 | have_expat_header=yes | |
309 | ;; | |
310 | esac | |
fb9545b1 KP |
311 | ;; |
312 | yes) | |
fb9545b1 KP |
313 | have_expat_header=yes |
314 | ;; | |
315 | esac | |
e99f0f0a PL |
316 | case "$have_expat_header" in |
317 | no) | |
a6a66da0 NL |
318 | expat=no |
319 | ;; | |
e99f0f0a PL |
320 | yes) |
321 | AC_CHECK_FUNCS(XML_SetDoctypeDeclHandler) | |
322 | case "$ac_cv_func_XML_SetDoctypeDeclHandler" in | |
323 | yes) | |
324 | HAVE_EXPAT=1 | |
325 | AC_SUBST(HAVE_EXPAT) | |
326 | AC_DEFINE_UNQUOTED(HAVE_EXPAT,$HAVE_EXPAT, | |
327 | [Found a useable expat library]) | |
328 | ;; | |
329 | *) | |
330 | expat=no | |
331 | ;; | |
332 | esac | |
333 | ;; | |
fb9545b1 | 334 | esac |
e99f0f0a PL |
335 | CPPFLAGS="$expatsaved_CPPFLAGS" |
336 | LIBS="$expatsaved_LIBS" | |
24330d27 KP |
337 | ;; |
338 | esac | |
fb9545b1 | 339 | |
e99f0f0a PL |
340 | AC_SUBST(EXPAT_CFLAGS) |
341 | AC_SUBST(EXPAT_LIBS) | |
342 | ||
343 | case "$expat" in | |
344 | no) | |
345 | EXPAT_CFLAGS="" | |
346 | EXPAT_LIBS="" | |
347 | ||
348 | AC_MSG_WARN([Cannot find usable expat library. Trying to use libxml2 as fallback.]) | |
349 | ;; | |
350 | esac | |
351 | fi | |
352 | ||
353 | # | |
354 | # Check libxml2 configuration | |
355 | # | |
356 | ||
357 | AC_ARG_ENABLE(libxml2, [ --enable-libxml2 Use libxml2 instead of Expat]) | |
358 | ||
b17cf498 PL |
359 | PKG_PROG_PKG_CONFIG |
360 | ||
e99f0f0a PL |
361 | if test "$enable_libxml2" = "yes" -o "$expat" = "no"; then |
362 | PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6]) | |
363 | AC_DEFINE_UNQUOTED(ENABLE_LIBXML2,1,[Use libxml2 instead of Expat]) | |
364 | ||
365 | AC_SUBST(LIBXML2_CFLAGS) | |
366 | AC_SUBST(LIBXML2_LIBS) | |
367 | fi | |
24330d27 | 368 | |
20fa60c9 KP |
369 | # |
370 | # Set default font directory | |
371 | # | |
372 | ||
3910f322 | 373 | AC_ARG_WITH(default-fonts, [ --with-default-fonts=DIR Use fonts from DIR when config is busted], default_fonts="$withval", default_fonts=yes) |
20fa60c9 KP |
374 | |
375 | case "$default_fonts" in | |
376 | yes) | |
ee1d8125 TL |
377 | if test "$os_win32" = "yes"; then |
378 | FC_DEFAULT_FONTS="WINDOWSFONTDIR" | |
379 | AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "WINDOWSFONTDIR", | |
380 | [Windows font directory]) | |
381 | else | |
382 | FC_DEFAULT_FONTS="/usr/share/fonts" | |
383 | AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "/usr/share/fonts", | |
384 | [System font directory]) | |
385 | fi | |
20fa60c9 KP |
386 | ;; |
387 | *) | |
388 | FC_DEFAULT_FONTS="$default_fonts" | |
389 | AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "$default_fonts", | |
390 | [System font directory]) | |
391 | ;; | |
392 | esac | |
393 | ||
394 | AC_SUBST(FC_DEFAULT_FONTS) | |
395 | ||
396 | # | |
af82b48c KP |
397 | # Add more fonts if available. By default, add only the directories |
398 | # with outline fonts; those with bitmaps can be added as desired in | |
399 | # local.conf or ~/.fonts.conf | |
20fa60c9 | 400 | # |
3910f322 | 401 | AC_ARG_WITH(add-fonts, [ --with-add-fonts=DIR1,DIR2,...Find additional fonts in DIR1,DIR2,... ], add_fonts="$withval", add_fonts=yes) |
20fa60c9 | 402 | |
af82b48c | 403 | case "$add_fonts" in |
20fa60c9 | 404 | yes) |
af82b48c | 405 | FC_ADD_FONTS="" |
bf0093b7 | 406 | for dir in /usr/X11R6/lib/X11 /usr/X11/lib/X11 /usr/lib/X11; do |
af82b48c | 407 | case x"$FC_ADD_FONTS" in |
20fa60c9 | 408 | x) |
2d9c79c0 KP |
409 | sub="$dir/fonts" |
410 | if test -d "$sub"; then | |
411 | case x$FC_ADD_FONTS in | |
412 | x) | |
413 | FC_ADD_FONTS="$sub" | |
414 | ;; | |
415 | *) | |
416 | FC_ADD_FONTS="$FC_ADD_FONTS,$sub" | |
417 | ;; | |
418 | esac | |
20fa60c9 KP |
419 | fi |
420 | ;; | |
421 | esac | |
422 | done | |
af82b48c | 423 | AC_DEFINE_UNQUOTED(FC_ADD_FONTS,"$add_fonts",[Additional font directories]) |
20fa60c9 KP |
424 | ;; |
425 | no) | |
af82b48c | 426 | FC_ADD_FONTS="" |
20fa60c9 KP |
427 | ;; |
428 | *) | |
af82b48c KP |
429 | FC_ADD_FONTS="$add_fonts" |
430 | AC_DEFINE_UNQUOTED(FC_ADD_FONTS,"$add_fonts",[Additional font directories]) | |
20fa60c9 KP |
431 | ;; |
432 | esac | |
433 | ||
af82b48c | 434 | AC_SUBST(FC_ADD_FONTS) |
20fa60c9 KP |
435 | |
436 | FC_FONTPATH="" | |
437 | ||
af82b48c | 438 | case "$FC_ADD_FONTS" in |
20fa60c9 KP |
439 | "") |
440 | ;; | |
441 | *) | |
af82b48c KP |
442 | FC_FONTPATH=`echo $FC_ADD_FONTS | |
443 | sed -e 's/^/<dir>/' -e 's/$/<\/dir>/' -e 's/,/<\/dir> <dir>/g'` | |
20fa60c9 KP |
444 | ;; |
445 | esac | |
446 | ||
447 | AC_SUBST(FC_FONTPATH) | |
448 | ||
7410e40b PL |
449 | # |
450 | # Set default cache directory path | |
451 | # | |
36ae1d95 | 452 | AC_ARG_WITH(cache-dir, [ --with-cache-dir=DIR Use DIR to store cache files (default LOCALSTATEDIR/cache/fontconfig)], fc_cachedir="$withval", fc_cachedir=yes) |
7410e40b PL |
453 | |
454 | case $fc_cachedir in | |
455 | no|yes) | |
8a3dc488 TL |
456 | if test "$os_win32" = "yes"; then |
457 | fc_cachedir="WINDOWSTEMPDIR_FONTCONFIG_CACHE" | |
458 | else | |
c08216c6 | 459 | fc_cachedir='${localstatedir}/cache/${PACKAGE}' |
8a3dc488 | 460 | fi |
7410e40b PL |
461 | ;; |
462 | *) | |
463 | ;; | |
464 | esac | |
465 | AC_SUBST(fc_cachedir) | |
466 | FC_CACHEDIR=${fc_cachedir} | |
467 | AC_SUBST(FC_CACHEDIR) | |
468 | ||
4f27c1c0 | 469 | FC_FONTDATE=`LC_ALL=C date` |
20fa60c9 KP |
470 | |
471 | AC_SUBST(FC_FONTDATE) | |
472 | ||
36ae1d95 | 473 | AC_ARG_WITH(confdir, [ --with-confdir=DIR Use DIR to store configuration files (default SYSCONFDIR/fonts)], confdir="$withval", confdir=yes) |
20fa60c9 KP |
474 | |
475 | # | |
476 | # Set CONFDIR and FONTCONFIG_PATH | |
477 | # | |
478 | ||
479 | case "$confdir" in | |
480 | no|yes) | |
ad9b233c | 481 | confdir='${sysconfdir}'/fonts |
20fa60c9 KP |
482 | ;; |
483 | *) | |
484 | ;; | |
485 | esac | |
486 | AC_SUBST(confdir) | |
ad9b233c | 487 | CONFDIR=${confdir} |
20fa60c9 KP |
488 | AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR",[Font configuration directory]) |
489 | AC_SUBST(CONFDIR) | |
490 | ||
9238fc06 KP |
491 | # |
492 | # Let people not build/install docs if they don't have docbook | |
493 | # | |
494 | ||
495 | AC_CHECK_PROG(HASDOCBOOK, docbook2html, yes, no) | |
496 | ||
2b45ef3a | 497 | AM_CONDITIONAL(USEDOCBOOK, test "x$HASDOCBOOK" = xyes) |
9238fc06 | 498 | |
2b45ef3a KP |
499 | default_docs="yes" |
500 | # | |
501 | # Check if docs exist or can be created | |
502 | # | |
503 | if test x$HASDOCBOOK = xno; then | |
2cae0512 | 504 | if test -f $srcdir/doc/fonts-conf.5; then |
2b45ef3a KP |
505 | : |
506 | else | |
507 | default_docs="no" | |
508 | fi | |
9238fc06 KP |
509 | fi |
510 | ||
2b45ef3a KP |
511 | AC_ARG_ENABLE(docs, [ --disable-docs Don't build and install documentation],,enable_docs=$default_docs) |
512 | ||
9238fc06 KP |
513 | AM_CONDITIONAL(ENABLE_DOCS, test "x$enable_docs" = xyes) |
514 | ||
2b45ef3a KP |
515 | if test "x$enable_docs" = xyes; then |
516 | DOCSRC="doc" | |
4cbc3ee8 KP |
517 | tmp=funcs.$$ |
518 | cat $srcdir/doc/*.fncs | awk ' | |
519 | /^@TITLE@/ { if (!done) { printf ("%s\n", $2); done = 1; } } | |
520 | /^@FUNC@/ { if (!done) { printf ("%s\n", $2); done = 1; } } | |
521 | /^@@/ { done = 0; }' > $tmp | |
522 | DOCMAN3=`cat $tmp | awk '{ printf ("%s.3 ", $1); }'` | |
523 | echo DOCMAN3 $DOCMAN3 | |
524 | rm -f $tmp | |
2b45ef3a KP |
525 | else |
526 | DOCSRC="" | |
4cbc3ee8 | 527 | DOCMAN3="" |
2b45ef3a KP |
528 | fi |
529 | ||
530 | AC_SUBST(DOCSRC) | |
4cbc3ee8 | 531 | AC_SUBST(DOCMAN3) |
2b45ef3a | 532 | |
20fa60c9 KP |
533 | AC_OUTPUT([ |
534 | Makefile | |
535 | fontconfig/Makefile | |
536 | fc-lang/Makefile | |
7769c321 | 537 | fc-glyphname/Makefile |
192296d8 | 538 | fc-case/Makefile |
2b629781 | 539 | fc-arch/Makefile |
20fa60c9 | 540 | src/Makefile |
414f7202 | 541 | conf.d/Makefile |
20fa60c9 | 542 | fc-cache/Makefile |
f28f090d | 543 | fc-cat/Makefile |
20fa60c9 | 544 | fc-list/Makefile |
440e7054 | 545 | fc-match/Makefile |
77c0d8bc | 546 | fc-query/Makefile |
6bffe1a9 | 547 | fc-scan/Makefile |
0da305f7 | 548 | doc/Makefile |
fddb839b | 549 | doc/version.sgml |
44d90378 | 550 | test/Makefile |
20fa60c9 KP |
551 | fontconfig.spec |
552 | fontconfig.pc | |
daeed6e0 | 553 | fontconfig-zip |
20fa60c9 | 554 | ]) |