Bug 52573 - patch required to build 2.10.x with oldish GNU C library headers
[platform/upstream/fontconfig.git] / configure.ac
1 dnl 
2 dnl  fontconfig/configure.in
3 dnl 
4 dnl  Copyright © 2003 Keith Packard
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 the author(s) not be used in
11 dnl  advertising or publicity pertaining to distribution of the software without
12 dnl  specific, written prior permission.  The authors make 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  THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17 dnl  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18 dnl  EVENT SHALL THE AUTHOR(S) 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.
23 dnl
24 dnl Process this file with autoconf to create configure.
25
26 AC_PREREQ(2.61)
27 AC_INIT(fonts.dtd)
28
29 dnl ==========================================================================
30 dnl                               Versioning              
31 dnl ==========================================================================
32
33 dnl This is the package version number, not the shared library
34 dnl version.  This same version number must appear in fontconfig/fontconfig.h
35 dnl Yes, it is a pain to synchronize version numbers.  Unfortunately, it's
36 dnl not possible to extract the version number here from fontconfig.h
37 AM_INIT_AUTOMAKE(fontconfig, 2.10.1)
38 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
39
40 dnl libtool versioning
41
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
45 LIBT_CURRENT=7
46 LIBT_REVISION=2
47 AC_SUBST(LIBT_CURRENT)
48 AC_SUBST(LIBT_REVISION)
49 LIBT_AGE=6
50
51 LIBT_VERSION_INFO="$LIBT_CURRENT:$LIBT_REVISION:$LIBT_AGE"
52 AC_SUBST(LIBT_VERSION_INFO)
53
54 LIBT_CURRENT_MINUS_AGE=`expr $LIBT_CURRENT - $LIBT_AGE`
55 AC_SUBST(LIBT_CURRENT_MINUS_AGE)
56
57 dnl ==========================================================================
58
59 AC_CONFIG_HEADERS(config.h)
60 AC_CONFIG_MACRO_DIR([m4])
61
62 AC_PROG_CC
63 AC_PROG_INSTALL
64 AC_PROG_LN_S
65 AC_LIBTOOL_WIN32_DLL
66 AM_PROG_LIBTOOL
67 AC_PROG_MAKE_SET
68 PKG_PROG_PKG_CONFIG
69
70 AC_MSG_CHECKING([for RM macro])
71 _predefined_rm=`make -p -f /dev/null 2>/dev/null|grep '^RM ='|sed -e 's/^RM = //'`
72 if test "x$_predefined_rm" = "x"; then
73         AC_MSG_RESULT([no predefined RM])
74         AC_CHECK_PROG(RM, rm, [rm -f])
75 else
76         AC_MSG_RESULT($_predefined_rm)
77 fi
78
79 dnl ==========================================================================
80
81 case "$host" in
82   *-*-mingw*)
83     os_win32=yes
84     ;;
85   *)
86     os_win32=no
87 esac
88 AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
89
90 if test "$os_win32" = "yes"; then
91   AC_CHECK_PROG(ms_librarian, lib.exe, yes, no)
92 fi
93 AM_CONDITIONAL(MS_LIB_AVAILABLE, test x$ms_librarian = xyes)
94
95 WARN_CFLAGS=""
96 if test "x$GCC" = "xyes"; then
97         WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
98         -Wmissing-prototypes -Wmissing-declarations \
99         -Wnested-externs -fno-strict-aliasing"
100         AC_DEFINE_UNQUOTED(HAVE_WARNING_CPP_DIRECTIVE,1,
101         [Can use #warning in C files])
102 fi
103 AC_SUBST(WARN_CFLAGS)
104
105
106 dnl ==========================================================================
107
108 AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
109 AM_CONDITIONAL(ENABLE_SHARED, test "$enable_shared" = "yes")
110
111 dnl ==========================================================================
112
113 AC_ARG_WITH(arch,
114         [AC_HELP_STRING([--with-arch=ARCH],
115                         [Force architecture to ARCH])],
116         arch="$withval", arch=auto)
117
118 if test "x$arch" != xauto; then
119         AC_DEFINE_UNQUOTED([FC_ARCHITECTURE], "$arch", [Architecture prefix to use for cache file names])
120 fi
121
122
123 dnl ==========================================================================
124
125 # Checks for header files.
126 AC_HEADER_DIRENT
127 AC_HEADER_STDC
128 AC_CHECK_HEADERS([fcntl.h regex.h stdlib.h string.h unistd.h sys/vfs.h sys/statfs.h sys/param.h sys/mount.h])
129
130 # Checks for typedefs, structures, and compiler characteristics.
131 AC_C_CONST
132 AC_C_INLINE
133 AC_C_FLEXIBLE_ARRAY_MEMBER
134 AC_TYPE_PID_T
135
136 # Checks for library functions.
137 AC_FUNC_VPRINTF
138 AC_FUNC_MMAP
139 AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr strtol getopt getopt_long sysconf ftruncate chsize rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs])
140
141 dnl AC_CHECK_FUNCS doesn't check for header files.
142 dnl posix_fadvise() may be not available in older libc.
143 AC_MSG_CHECKING([for posix_fadvise])
144 AC_LINK_IFELSE([AC_LANG_SOURCE([[
145         #include <fcntl.h>
146         int main(void) {
147             return posix_fadvise(0, 0, 0, 0);
148         }
149         ]])],[
150                 AC_MSG_RESULT([yes])
151                 AC_DEFINE([HAVE_POSIX_FADVISE], [1], [Define to 1 if you have the `posix_fadvise' function.])
152         ],[AC_MSG_RESULT([no])])
153
154 #
155 if test "x$ac_cv_func_fstatvfs" = "xyes"; then
156         AC_CHECK_MEMBERS([struct statvfs.f_basetype, struct statvfs.f_fstypename],,,
157                 [#include <sys/statvfs.h>])
158 fi
159 if test "x$ac_cv_func_fstatfs" = "xyes"; then
160         AC_CHECK_MEMBERS([struct statfs.f_flags, struct statfs.f_fstypename],,, [
161 #ifdef HAVE_SYS_VFS_H
162 #include <sys/vfs.h>
163 #endif
164 #ifdef HAVE_SYS_STATFS_H
165 #include <sys/statfs.h>
166 #endif
167 #ifdef HAVE_SYS_PARAM_H
168 #include <sys/param.h>
169 #endif
170 #ifdef HAVE_SYS_MOUNT_H
171 #include <sys/mount.h>
172 #endif])
173 fi
174 AC_CHECK_MEMBERS([struct dirent.d_type],,,
175         [#include <dirent.h>])
176 #
177 # regex
178 #
179 if test "x$ac_cv_func_regcomp" = "xyes" -a "x$ac_cv_func_regerror" = "xyes" -a "x$ac_cv_func_regexec" = "xyes" -a "x$ac_cv_func_regfree"; then
180         AC_DEFINE(USE_REGEX,,[Use regex])
181 fi
182
183 #
184 # Checks for iconv
185 #
186 AC_ARG_ENABLE(iconv,
187         [AC_HELP_STRING([--enable-iconv],
188                         [Use iconv to support non-Unicode SFNT name])],
189         ,enable_iconv=no)
190 AC_ARG_WITH(libiconv,
191         [AC_HELP_STRING([--with-libiconv=DIR],
192                         [Use libiconv in DIR])],
193         [if test "x$withval" = "xyes"; then
194                 libiconv_prefix=$prefix
195          else
196                 libiconv_prefix=$withval
197          fi],
198         [libiconv_prefix=auto])
199 AC_ARG_WITH(libiconv-includes,
200         [AC_HELP_STRING([--with-libiconv-includes=DIR],
201                         [Use libiconv includes in DIR])],
202         [libiconv_includes=$withval],
203         [libiconv_includes=auto])
204 AC_ARG_WITH(libiconv-lib,
205         [AC_HELP_STRING([--with-libiconv-lib=DIR],
206                         [Use libiconv library in DIR])],
207         [libiconv_lib=$withval],
208         [libiconv_lib=auto])
209
210 # if no libiconv,libiconv-includes,libiconv-lib are specified,
211 # libc's iconv has a priority.
212 if test "$libiconv_includes" != "auto" -a -r ${libiconv_includes}/iconv.h; then
213         libiconv_cflags="-I${libiconv_includes}"
214 elif test "$libiconv_prefix" != "auto" -a -r ${libiconv_prefix}/include/iconv.h; then
215         libiconv_cflags="-I${libiconv_prefix}/include"
216 else
217         libiconv_cflags=""
218 fi
219 libiconv_libs=""
220 if test "x$libiconv_cflags" != "x"; then
221         if test "$libiconv_lib" != "auto" -a -d ${libiconv_lib}; then
222                 libiconv_libs="-L${libiconv_lib} -liconv"
223         elif test "$libiconv_prefix" != "auto" -a -d ${libiconv_prefix}/lib; then
224                 libiconv_libs="-L${libiconv_prefix}/lib -liconv"
225         else
226                 libiconv_libs="-liconv"
227         fi
228 fi
229
230 use_iconv=0
231 if test "x$enable_iconv" != "xno"; then
232         AC_MSG_CHECKING([for a usable iconv])
233         if test "x$libiconv_cflags" != "x" -o "x$libiconv_libs" != "x"; then
234                 iconvsaved_CFLAGS="$CFLAGS"
235                 iconvsaved_LIBS="$LIBS"
236                 CFLAGS="$CFLAGS $libiconv_cflags"
237                 LIBS="$LIBS $libiconv_libs"
238
239                 AC_TRY_LINK([#include <iconv.h>],
240                         [iconv_open ("from", "to");],
241                         [iconv_type="libiconv"
242                          use_iconv=1],
243                         [use_iconv=0])
244
245                 CFLAGS="$iconvsaved_CFLAGS"
246                 LIBS="$iconvsaved_LIBS"
247                 ICONV_CFLAGS="$libiconv_cflags"
248                 ICONV_LIBS="$libiconv_libs"
249         fi
250         if test "x$use_iconv" = "x0"; then
251                 AC_TRY_LINK([#include <iconv.h>],
252                         [iconv_open ("from", "to");],
253                         [iconv_type="libc"
254                          use_iconv=1],
255                         [iconv_type="not found"
256                          use_iconv=0])
257         fi
258
259         AC_MSG_RESULT([$iconv_type])
260         AC_SUBST(ICONV_CFLAGS)
261         AC_SUBST(ICONV_LIBS)
262 fi
263 AC_DEFINE_UNQUOTED(USE_ICONV,$use_iconv,[Use iconv.])
264 #
265 # Checks for FreeType
266 #
267 PKG_CHECK_MODULES(FREETYPE, freetype2)
268
269 AC_SUBST(FREETYPE_LIBS)
270 AC_SUBST(FREETYPE_CFLAGS)
271
272 fontconfig_save_libs="$LIBS"
273 fontconfig_save_cflags="$CFLAGS"
274 LIBS="$LIBS $FREETYPE_LIBS"
275 CFLAGS="$CFLAGS $FREETYPE_CFLAGS"
276 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)
277 AC_CHECK_MEMBER(FT_Bitmap_Size.y_ppem,
278                 HAVE_FT_BITMAP_SIZE_Y_PPEM=1,
279                 HAVE_FT_BITMAP_SIZE_Y_PPEM=0,
280 [#include <ft2build.h>
281 #include FT_FREETYPE_H])
282 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,$HAVE_FT_BITMAP_SIZE_Y_PPEM,
283                    [FT_Bitmap_Size structure includes y_ppem field])
284 CFLAGS="$fontconfig_save_cflags"
285 LIBS="$fontconfig_save_libs"
286
287 #
288 # Check expat configuration
289 #
290 AC_ARG_WITH(expat,
291         [AC_HELP_STRING([--with-expat=DIR],
292                         [Use Expat in DIR])],
293         [expat_prefix=$withval],
294         [expat_prefix=auto])
295 AC_ARG_WITH(expat-includes,
296         [AC_HELP_STRING([--with-expat-includes=DIR],
297                         [Use Expat includes in DIR])],
298         [expat_includes=$withval],
299         [expat_includes=auto])
300 AC_ARG_WITH(expat-lib,
301         [AC_HELP_STRING([--with-expat-lib=DIR])],
302         [expat_lib=$withval],
303         [expat_lib=auto])
304
305 if test "$enable_libxml2" != "yes"; then
306         use_pkgconfig_for_expat=yes
307         if test "$expat_prefix" = "auto" -a "$expat_includes" = "auto" -a "$expat_lib" = "auto"; then
308                 PKG_CHECK_MODULES(EXPAT, expat,,use_pkgconfig_for_expat=no)
309         else
310                 use_pkgconfig_for_expat=no
311         fi
312         if test "x$use_pkgconfig_for_expat" = "xno"; then
313                 if test "$expat_includes" != "auto" -a -r ${expat_includes}/expat.h; then
314                         EXPAT_CFLAGS="-I${expat_includes}"
315                 elif test "$expat_prefix" != "auto" -a -r ${expat_prefix}/include/expat.h; then
316                         EXPAT_CFLAGS="-I${expat_prefix}/include"
317                 else
318                         EXPAT_CFLAGS=""
319                 fi
320                 if test "$expat_lib" != "auto"; then
321                         EXPAT_LIBS="-L${expat_lib} -lexpat"
322                 elif test "$expat_prefix" != "auto"; then
323                         EXPAT_LIBS="-L${expat_prefix}/lib -lexpat"
324                 else
325                         EXPAT_LIBS="-lexpat"
326                 fi
327         fi
328
329         expatsaved_CPPFLAGS="$CPPFLAGS"
330         expatsaved_LIBS="$LIBS"
331         CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS"
332         LIBS="$LIBS $EXPAT_LIBS"
333
334         AC_CHECK_HEADER(expat.h)
335         if test "$ac_cv_header_expat_h" = "no"; then
336                 AC_CHECK_HEADER(xmlparse.h)
337                 if test "$ac_cv_header_xmlparse_h" = "yes"; then
338                         HAVE_XMLPARSE_H=1
339                         AC_SUBST(HAVE_XMLPARSE_H)
340                         AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H,
341                                 [Use xmlparse.h instead of expat.h])
342                 else
343                         AC_MSG_ERROR([
344 *** expat is required. or try to use --enable-libxml2])
345                 fi
346         fi
347         AC_CHECK_FUNCS(XML_SetDoctypeDeclHandler)
348         if test "$ac_cv_func_XML_SetDoctypeDeclHandler" = "no"; then
349                 AC_MSG_ERROR([
350 *** expat is required. or try to use --enable-libxml2])
351         fi
352         CPPFLAGS="$expatsaved_CPPFLAGS"
353         LIBS="$expatsaved_LIBS"
354
355         AC_SUBST(EXPAT_CFLAGS)
356         AC_SUBST(EXPAT_LIBS)
357 fi
358
359 #
360 # Check libxml2 configuration
361 #
362 AC_ARG_ENABLE(libxml2,
363         [AC_HELP_STRING([--enable-libxml2],
364                         [Use libxml2 instead of Expat])])
365
366 if test "$enable_libxml2" = "yes"; then
367     PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.6])
368     AC_DEFINE_UNQUOTED(ENABLE_LIBXML2,1,[Use libxml2 instead of Expat])
369
370     AC_SUBST(LIBXML2_CFLAGS)
371     AC_SUBST(LIBXML2_LIBS)
372
373     fc_saved_CFLAGS="$CFLAGS"
374     CFLAGS="$CFLAGS $LIBXML2_CFLAGS"
375     AC_MSG_CHECKING([SAX1 support in libxml2])
376     AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
377         #include <libxml/xmlversion.h>
378         #if !defined(LIBXML_SAX1_ENABLED)
379         #  include "error: No SAX1 support in libxml2"
380         #endif
381         ]])], [AC_MSG_RESULT([found])], [AC_MSG_ERROR([
382 *** SAX1 support in libxml2 is required. enable it or use expat instead.])])
383     CFLAGS="$fc_saved_CFLAGS"
384 fi
385
386 #
387 # Set default font directory
388 #
389
390 AC_ARG_WITH(default-fonts,
391         [AC_HELP_STRING([--with-default-fonts=DIR],
392                         [Use fonts from DIR when config is busted])],
393         default_fonts="$withval", default_fonts=yes)
394
395 case "$default_fonts" in
396 yes)
397         if test "$os_win32" = "yes"; then
398                 FC_DEFAULT_FONTS="WINDOWSFONTDIR"
399                 AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "WINDOWSFONTDIR", 
400                                    [Windows font directory])
401         else
402                 FC_DEFAULT_FONTS="/usr/share/fonts"
403                 AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "/usr/share/fonts", 
404                                    [System font directory])
405         fi
406         ;;
407 *)
408         FC_DEFAULT_FONTS="$default_fonts"
409         AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "$default_fonts",
410                            [System font directory])
411         ;;
412 esac
413
414 AC_SUBST(FC_DEFAULT_FONTS)
415
416 #
417 # Add more fonts if available.  By default, add only the directories
418 # with outline fonts; those with bitmaps can be added as desired in
419 # local.conf or ~/.fonts.conf
420 #
421 AC_ARG_WITH(add-fonts,
422         [AC_HELP_STRING([--with-add-fonts=DIR1,DIR2,...],
423                         [Find additional fonts in DIR1,DIR2,... ])],
424         add_fonts="$withval", add_fonts=yes)
425
426 case "$add_fonts" in
427 yes)
428         FC_ADD_FONTS=""
429         for dir in /usr/X11R6/lib/X11 /usr/X11/lib/X11 /usr/lib/X11; do
430                 case x"$FC_ADD_FONTS" in
431                 x)
432                         sub="$dir/fonts"
433                         if test -d "$sub"; then
434                                 case x$FC_ADD_FONTS in
435                                 x)
436                                         FC_ADD_FONTS="$sub"
437                                         ;;
438                                 *)
439                                         FC_ADD_FONTS="$FC_ADD_FONTS,$sub"
440                                         ;;
441                                 esac
442                         fi
443                         ;;
444                 esac
445         done
446         AC_DEFINE_UNQUOTED(FC_ADD_FONTS,"$add_fonts",[Additional font directories])
447         ;;
448 no)
449         FC_ADD_FONTS=""
450         ;;
451 *)
452         FC_ADD_FONTS="$add_fonts"
453         AC_DEFINE_UNQUOTED(FC_ADD_FONTS,"$add_fonts",[Additional font directories])
454         ;;
455 esac
456
457 AC_SUBST(FC_ADD_FONTS)
458
459 FC_FONTPATH=""
460
461 case "$FC_ADD_FONTS" in
462 "")
463         ;;
464 *)
465         FC_FONTPATH=`echo $FC_ADD_FONTS | 
466                         sed -e 's/^/<dir>/' -e 's/$/<\/dir>/' -e 's/,/<\/dir> <dir>/g'`
467         ;;
468 esac
469
470 AC_SUBST(FC_FONTPATH)
471
472 #
473 # Set default cache directory path
474 #
475 AC_ARG_WITH(cache-dir,
476         [AC_HELP_STRING([--with-cache-dir=DIR],
477                         [Use DIR to store cache files [default=LOCALSTATEDIR/cache/fontconfig]])],
478         fc_cachedir="$withval", fc_cachedir=yes)
479
480 case $fc_cachedir in
481 no|yes)
482         if test "$os_win32" = "yes"; then
483                 fc_cachedir="WINDOWSTEMPDIR_FONTCONFIG_CACHE"
484         else
485                 fc_cachedir='${localstatedir}/cache/${PACKAGE}'
486         fi
487         ;;
488 *)
489         ;;
490 esac
491 AC_SUBST(fc_cachedir)
492 FC_CACHEDIR=${fc_cachedir}
493 AC_SUBST(FC_CACHEDIR)
494
495 FC_FONTDATE=`LC_ALL=C date`
496
497 AC_SUBST(FC_FONTDATE)
498
499 #
500 # Set configuration paths
501 #
502
503 AC_ARG_WITH(templatedir,
504         [AC_HELP_STRING([--with-templatedir=DIR],
505                         [Use DIR to store the configuration template files [default=DATADIR/fontconfig/conf.avail]])],
506         [templatedir="$withval"],
507         [templatedir=yes])
508 AC_ARG_WITH(baseconfigdir,
509         [AC_HELP_STRING([--with-baseconfigdir=DIR],
510                         [Use DIR to store the base configuration files [default=SYSCONFDIR/fonts]])],
511         [baseconfigdir="$withval"],
512         [baseconfigdir=yes])
513 AC_ARG_WITH(configdir,
514         [AC_HELP_STRING([--with-configdir=DIR],
515                         [Use DIR to store active configuration files [default=BASECONFIGDIR/conf.d]])],
516         [configdir="$withval"],
517         [configdir=yes])
518 AC_ARG_WITH(xmldir,
519         [AC_HELP_STRING([--with-xmldir=DIR],
520                         [Use DIR to store XML schema files [default=DATADIR/xml/fontconfig]])],
521         [xmldir="$withval"],
522         [xmldir=yes])
523
524 case "$templatedir" in
525 no|yes)
526         templatedir='${datadir}'/fontconfig/conf.avail
527         ;;
528 *)
529         ;;
530 esac
531 case "$baseconfigdir" in
532 no|yes)
533         baseconfigdir='${sysconfdir}'/fonts
534         ;;
535 *)
536         ;;
537 esac
538 case "$configdir" in
539 no|yes)
540         configdir='${baseconfigdir}'/conf.d
541         ;;
542 *)
543         ;;
544 esac
545 case "$xmldir" in
546 no|yes)
547         xmldir='${datadir}'/xml/fontconfig
548         ;;
549 *)
550         ;;
551 esac
552
553 TEMPLATEDIR=${templatedir}
554 BASECONFIGDIR=${baseconfigdir}
555 CONFIGDIR=${configdir}
556 XMLDIR=${xmldir}
557 AC_SUBST(templatedir)
558 AC_SUBST(TEMPLATEDIR)
559 AC_SUBST(baseconfigdir)
560 AC_SUBST(BASECONFIGDIR)
561 AC_SUBST(configdir)
562 AC_SUBST(CONFIGDIR)
563 AC_SUBST(xmldir)
564 AC_SUBST(XMLDIR)
565
566 #
567 # Let people not build/install docs if they don't have docbook
568 #
569
570 AC_CHECK_PROG(HASDOCBOOK, docbook2html, yes, no)
571
572 AM_CONDITIONAL(USEDOCBOOK, test "x$HASDOCBOOK" = xyes)
573
574 default_docs="yes"
575 #
576 # Check if docs exist or can be created
577 #
578 if test x$HASDOCBOOK = xno; then
579         if test -f $srcdir/doc/fonts-conf.5; then
580                 :
581         else
582                 default_docs="no"
583         fi
584 fi
585
586 AC_ARG_ENABLE(docs,
587         [AC_HELP_STRING([--disable-docs],
588                         [Don't build and install documentation])],
589         ,
590         enable_docs=$default_docs)
591
592 AM_CONDITIONAL(ENABLE_DOCS, test "x$enable_docs" = xyes)
593
594 if test "x$enable_docs" = xyes; then
595         DOCSRC="doc"
596         tmp=funcs.$$
597         cat $srcdir/doc/*.fncs | awk '
598         /^@TITLE@/      { if (!done) { printf ("%s\n", $2); done = 1; } }
599         /^@FUNC@/       { if (!done) { printf ("%s\n", $2); done = 1; } }
600         /^@@/           { done = 0; }' > $tmp
601         DOCMAN3=`cat $tmp | awk '{ printf ("%s.3 ", $1); }'`
602         echo DOCMAN3 $DOCMAN3
603         rm -f $tmp
604 else
605         DOCSRC=""
606         DOCMAN3=""
607 fi
608
609 AC_SUBST(DOCSRC)
610 AC_SUBST(DOCMAN3)
611
612
613 dnl Figure out what cache format suffix to use for this architecture
614 AC_C_BIGENDIAN
615 AC_CHECK_SIZEOF([void *])
616 AC_CHECK_ALIGNOF([double])
617
618 dnl include the header file for workaround of miscalculating size on autoconf
619 dnl particularly for fat binaries
620 AH_BOTTOM([#include "config-fixups.h"])
621
622 AC_OUTPUT([
623 Makefile
624 fontconfig/Makefile
625 fc-lang/Makefile
626 fc-glyphname/Makefile
627 fc-case/Makefile
628 src/Makefile
629 conf.d/Makefile
630 fc-cache/Makefile
631 fc-cat/Makefile
632 fc-list/Makefile
633 fc-match/Makefile
634 fc-pattern/Makefile
635 fc-query/Makefile
636 fc-scan/Makefile
637 doc/Makefile
638 doc/version.sgml
639 test/Makefile
640 fontconfig.spec
641 fontconfig.pc
642 fontconfig-zip
643 ])