1 dnl Copyright © 2003 Keith Packard
3 dnl Permission to use, copy, modify, distribute, and sell this software and its
4 dnl documentation for any purpose is hereby granted without fee, provided that
5 dnl the above copyright notice appear in all copies and that both that
6 dnl copyright notice and this permission notice appear in supporting
7 dnl documentation, and that the name of Keith Packard not be used in
8 dnl advertising or publicity pertaining to distribution of the software without
9 dnl specific, written prior permission. Keith Packard makes no
10 dnl representations about the suitability of this software for any purpose. It
11 dnl is provided "as is" without express or implied warranty.
13 dnl KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
14 dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
15 dnl EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
16 dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
17 dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 dnl PERFORMANCE OF THIS SOFTWARE.
21 dnl Process this file with autoconf to create configure.
27 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
29 # Autoheader generates config.h.in. No new lines allowed in the list.
30 AC_CONFIG_HEADERS([config.h include/X11/fonts/fontconf.h])
32 dnl This is the package version number, not the shared library
33 dnl version. This same version number must appear in Xfont.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 Xfont.h
37 AM_INIT_AUTOMAKE([foreign dist-bzip2])
40 # Require xorg-macros minimum of 1.10 for DocBook XML documentation
41 m4_ifndef([XORG_MACROS_VERSION],
42 [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
43 XORG_MACROS_VERSION(1.10)
45 XORG_ENABLE_DEVEL_DOCS
46 XORG_WITH_XMLTO(0.0.20)
48 XORG_CHECK_SGML_DOCTOOLS(1.5)
53 dnl If the first PKG_CHECK_MODULES appears inside a conditional, pkg-config
54 dnl must first be located explicitly.
58 AC_CHECK_HEADERS([endian.h poll.h sys/poll.h])
59 AC_CHECK_FUNCS([poll])
62 # select libraries to include
68 # Scalable fonts in files:
70 # Bitstream Speedo rasterizer
72 AC_ARG_ENABLE(freetype, [ --disable-freetype],[XFONT_FREETYPE=$enableval],[XFONT_FREETYPE=yes])
73 AM_CONDITIONAL(XFONT_FREETYPE, [test x$XFONT_FREETYPE = xyes])
74 if test x$XFONT_FREETYPE = xyes; then
75 AC_DEFINE(XFONT_FREETYPE,1,[Support FreeType rasterizer for nearly all font file formats])
76 AC_ARG_WITH(freetype-config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=auto)
78 if test "$freetype_config" = "auto" ; then
79 PKG_CHECK_MODULES(FREETYPE, freetype2,
80 freetype_config=no, freetype_config=yes)
83 if test "$freetype_config" = "yes"; then
84 AC_PATH_PROG(ft_config,freetype-config,no)
85 if test "$ft_config" = "no"; then
86 AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/])
89 ft_config="$freetype_config"
92 if test "$freetype_config" != "no"; then
93 FREETYPE_CFLAGS="`$ft_config --cflags`"
94 FREETYPE_LIBS="`$ft_config --libs`"
96 FREETYPE_REQUIRES="freetype2"
103 AC_SUBST(FREETYPE_LIBS)
104 AC_SUBST(FREETYPE_CFLAGS)
105 AC_SUBST(FREETYPE_REQUIRES)
108 # Bitmap fonts in files:
109 # Builtins (gzipped pcf format in .text segment)
115 AC_DEFINE(X_GZIP_FONT_COMPRESSION,1,[Support gzip for bitmap fonts])
116 X_GZIP_FONT_COMPRESSION=1
117 AC_SUBST(X_GZIP_FONT_COMPRESSION)
118 AC_CHECK_LIB(z, gzopen, [Z_LIBS=-lz], AC_MSG_ERROR([*** zlib is required]))
121 AS_HELP_STRING([--with-bzip2],
122 [Support bzip2 compressed bitmap fonts]),
124 if test "x$with_bzip2" = xyes; then
125 AC_CHECK_LIB(bz2, BZ2_bzopen, [Z_LIBS="$Z_LIBS -lbz2"],
126 AC_MSG_ERROR([*** libbz2 is required for bzip2 support]))
127 AC_DEFINE(X_BZIP2_FONT_COMPRESSION,1,[Support bzip2 for bitmap fonts])
129 AM_CONDITIONAL(X_BZIP2_FONT_COMPRESSION, [test "x$with_bzip2" = xyes ])
132 AC_ARG_ENABLE(builtins, [ --disable-builtins ], [XFONT_BUILTINS=$enableval], [XFONT_BUILTINS=yes])
133 AM_CONDITIONAL(XFONT_BUILTINS, [test "x$XFONT_BUILTINS" = xyes ])
134 if test "x$XFONT_BUILTINS" = xyes; then
135 AC_DEFINE(XFONT_BUILTINS,1,[Support built-in fonts])
139 AC_ARG_ENABLE(pcfformat, [ --disable-pcfformat ], [XFONT_PCFFORMAT=$enableval], [XFONT_PCFFORMAT=yes])
140 AM_CONDITIONAL(XFONT_PCFFORMAT, [test "x$XFONT_PCFFORMAT" = xyes])
141 if test "x$XFONT_PCFFORMAT" = xyes; then
142 AC_DEFINE(XFONT_PCFFORMAT,1,[Support pcf format bitmap font files])
146 AC_ARG_ENABLE(bdfformat, [ --disable-bdfformat ], [XFONT_BDFFORMAT=$enableval], [XFONT_BDFFORMAT=yes])
147 AM_CONDITIONAL(XFONT_BDFFORMAT, [test "x$XFONT_BDFFORMAT" = xyes])
148 if test "x$XFONT_BDFFORMAT" = xyes; then
149 AC_DEFINE(XFONT_BDFFORMAT,1,[Support bdf format bitmap font files])
153 AC_ARG_ENABLE(snfformat, [ --disable-snfformat ], [XFONT_SNFFORMAT=$enableval], [XFONT_SNFFORMAT=yes])
154 AM_CONDITIONAL(XFONT_SNFFORMAT, [test "x$XFONT_SNFFORMAT" = xyes])
155 if test "x$XFONT_SNFFORMAT" = xyes; then
156 AC_DEFINE(XFONT_SNFFORMAT,1,[Support snf format bitmap font files])
160 AM_CONDITIONAL(XFONT_BITMAP, [test "x$XFONT_BITMAP" = xyes ])
161 if test "x$XFONT_BITMAP" = xyes; then
162 AC_DEFINE(XFONT_BITMAP,1,[Support bitmap font files])
166 AM_CONDITIONAL(XFONT_FONTFILE, [test "x$XFONT_FONTFILE" = xyes])
167 if test "x$XFONT_FONTFILE" = xyes; then
168 AC_DEFINE(XFONT_FONTFILE,1,[Support fonts in files])
172 # Support connection to font servers?
175 AC_ARG_ENABLE(fc, [ --disable-fc ],[XFONT_FC=$enableval],[XFONT_FC=yes])
176 AM_CONDITIONAL(XFONT_FC, [test "x$XFONT_FC" = xyes])
177 if test "x$XFONT_FC" = xyes; then
178 AC_DEFINE(XFONT_FC,1,[Support the X Font Services Protocol])
182 AC_CHECK_LIB(m, hypot, [MATH_LIBS=-lm
183 AC_SUBST(MATH_LIBS)], AC_MSG_ERROR([*** libm is required]))
185 PKG_CHECK_MODULES(XFONT, xproto xtrans fontsproto fontenc)
187 # Transport selection macro from xtrans.m4
188 XTRANS_CONNECTION_FLAGS
192 OS_CFLAGS="-D_XOPEN_SOURCE"
195 OS_CFLAGS="-Wl,-flat_namespace"
201 AC_SUBST([OS_CFLAGS])
206 src/fontfile/Makefile
207 src/FreeType/Makefile
208 src/builtins/Makefile