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