upload tizen2.0 source
[framework/uifw/xorg/lib/libxfont.git] / configure.ac
1 #  Copyright © 2003 Keith Packard
2 #
3 #  Permission to use, copy, modify, distribute, and sell this software and its
4 #  documentation for any purpose is hereby granted without fee, provided that
5 #  the above copyright notice appear in all copies and that both that
6 #  copyright notice and this permission notice appear in supporting
7 #  documentation, and that the name of Keith Packard not be used in
8 #  advertising or publicity pertaining to distribution of the software without
9 #  specific, written prior permission.  Keith Packard makes no
10 #  representations about the suitability of this software for any purpose.  It
11 #  is provided "as is" without express or implied warranty.
12 #
13 #  KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
14 #  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
15 #  EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
16 #  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
17 #  DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 #  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 #  PERFORMANCE OF THIS SOFTWARE.
20 #
21
22 # Initialize Autoconf
23 AC_PREREQ([2.60])
24 AC_INIT([libXfont], [1.4.5],
25         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXfont])
26 AC_CONFIG_SRCDIR([Makefile.am])
27 AC_CONFIG_HEADERS([config.h include/X11/fonts/fontconf.h])
28
29 # Initialize Automake
30 AM_INIT_AUTOMAKE([foreign dist-bzip2])
31 AM_MAINTAINER_MODE
32
33 # Initialize libtool
34 AC_PROG_LIBTOOL
35
36 # Require xorg-macros minimum of 1.10 for DocBook XML documentation
37 m4_ifndef([XORG_MACROS_VERSION],
38           [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
39 XORG_MACROS_VERSION(1.10)
40 XORG_DEFAULT_OPTIONS
41 XORG_ENABLE_DEVEL_DOCS
42 XORG_WITH_XMLTO(0.0.22)
43 XORG_WITH_FOP
44 XORG_CHECK_SGML_DOCTOOLS(1.7)
45
46 # Checks for header files.
47 AC_CHECK_HEADERS([endian.h poll.h sys/poll.h])
48
49 # Checks for library functions.
50 AC_CHECK_FUNCS([poll])
51
52 # If the first PKG_CHECK_MODULES appears inside a conditional, pkg-config
53 # must first be located explicitly.
54 PKG_PROG_PKG_CONFIG
55
56 #
57 # select libraries to include
58 #
59
60 XFONT_FONTFILE=no
61
62 #
63 # Scalable fonts in files:
64 #       FreeType
65 #       Bitstream Speedo rasterizer
66 #
67 AC_ARG_ENABLE(freetype, [ --disable-freetype],[XFONT_FREETYPE=$enableval],[XFONT_FREETYPE=yes])
68 AM_CONDITIONAL(XFONT_FREETYPE, [test x$XFONT_FREETYPE = xyes])
69 if test x$XFONT_FREETYPE = xyes; then
70         AC_DEFINE(XFONT_FREETYPE,1,[Support FreeType rasterizer for nearly all font file formats])
71         AC_ARG_WITH(freetype-config, [  --with-freetype-config=PROG   Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=auto)
72
73         if test "$freetype_config" = "auto" ; then
74                 PKG_CHECK_MODULES(FREETYPE, freetype2,
75                         freetype_config=no, freetype_config=yes)
76         fi
77
78         if test "$freetype_config" = "yes"; then
79                 AC_PATH_PROG(ft_config,freetype-config,no)
80                 if test "$ft_config" = "no"; then
81                         AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/])
82                 fi
83         else
84                 ft_config="$freetype_config"
85         fi
86
87         if test "$freetype_config" != "no"; then
88                 FREETYPE_CFLAGS="`$ft_config --cflags`"
89                 FREETYPE_LIBS="`$ft_config --libs`"
90         fi
91         FREETYPE_REQUIRES="freetype2"
92         XFONT_FONTFILE=yes
93 else
94         FREETYPE_CFLAGS=""
95         FREETYPE_LIBS=""
96         FREETYPE_REQUIRES=""
97 fi
98 AC_SUBST(FREETYPE_LIBS)
99 AC_SUBST(FREETYPE_CFLAGS)
100 AC_SUBST(FREETYPE_REQUIRES)
101
102 #
103 # Bitmap fonts in files:
104 #       Builtins (gzipped pcf format in .text segment)
105 #       PCF
106 #       BDF
107 #       SNF
108 #
109
110 AC_DEFINE(X_GZIP_FONT_COMPRESSION,1,[Support gzip for bitmap fonts])
111 X_GZIP_FONT_COMPRESSION=1
112 AC_SUBST(X_GZIP_FONT_COMPRESSION)
113 AC_CHECK_LIB(z, gzopen, [Z_LIBS=-lz], AC_MSG_ERROR([*** zlib is required]))
114
115 AC_ARG_WITH(bzip2,
116         AS_HELP_STRING([--with-bzip2],
117                         [Support bzip2 compressed bitmap fonts]),
118         [], [with_bzip2=no])
119 if test "x$with_bzip2" = xyes; then
120         AC_CHECK_LIB(bz2, BZ2_bzopen, [Z_LIBS="$Z_LIBS -lbz2"],
121                 AC_MSG_ERROR([*** libbz2 is required for bzip2 support]))
122         AC_DEFINE(X_BZIP2_FONT_COMPRESSION,1,[Support bzip2 for bitmap fonts])
123 fi
124 AM_CONDITIONAL(X_BZIP2_FONT_COMPRESSION, [test "x$with_bzip2" = xyes ])
125 AC_SUBST(Z_LIBS)
126
127 AC_ARG_ENABLE(builtins, [ --disable-builtins ], [XFONT_BUILTINS=$enableval], [XFONT_BUILTINS=yes])
128 AM_CONDITIONAL(XFONT_BUILTINS, [test "x$XFONT_BUILTINS" = xyes ])
129 if test "x$XFONT_BUILTINS" = xyes; then
130         AC_DEFINE(XFONT_BUILTINS,1,[Support built-in fonts])
131         XFONT_BITMAP=yes
132 fi
133
134 AC_ARG_ENABLE(pcfformat, [ --disable-pcfformat ], [XFONT_PCFFORMAT=$enableval], [XFONT_PCFFORMAT=yes])
135 AM_CONDITIONAL(XFONT_PCFFORMAT, [test "x$XFONT_PCFFORMAT" = xyes])
136 if test "x$XFONT_PCFFORMAT" = xyes; then
137         AC_DEFINE(XFONT_PCFFORMAT,1,[Support pcf format bitmap font files])
138         XFONT_BITMAP=yes
139 fi
140
141 AC_ARG_ENABLE(bdfformat, [ --disable-bdfformat ], [XFONT_BDFFORMAT=$enableval], [XFONT_BDFFORMAT=yes])
142 AM_CONDITIONAL(XFONT_BDFFORMAT, [test "x$XFONT_BDFFORMAT" = xyes])
143 if test "x$XFONT_BDFFORMAT" = xyes; then
144         AC_DEFINE(XFONT_BDFFORMAT,1,[Support bdf format bitmap font files])
145         XFONT_BITMAP=yes
146 fi
147
148 AC_ARG_ENABLE(snfformat, [ --disable-snfformat ], [XFONT_SNFFORMAT=$enableval], [XFONT_SNFFORMAT=yes])
149 AM_CONDITIONAL(XFONT_SNFFORMAT, [test "x$XFONT_SNFFORMAT" = xyes])
150 if test "x$XFONT_SNFFORMAT" = xyes; then
151         AC_DEFINE(XFONT_SNFFORMAT,1,[Support snf format bitmap font files])
152         XFONT_BITMAP=yes
153 fi
154
155 AM_CONDITIONAL(XFONT_BITMAP, [test "x$XFONT_BITMAP" = xyes ])
156 if test "x$XFONT_BITMAP" = xyes; then
157         AC_DEFINE(XFONT_BITMAP,1,[Support bitmap font files])
158         XFONT_FONTFILE=yes
159 fi
160
161 AM_CONDITIONAL(XFONT_FONTFILE, [test "x$XFONT_FONTFILE" = xyes])
162 if test "x$XFONT_FONTFILE" = xyes; then
163         AC_DEFINE(XFONT_FONTFILE,1,[Support fonts in files])
164 fi
165
166 #
167 # Support connection to font servers?
168 #
169
170 AC_ARG_ENABLE(fc, [ --disable-fc ],[XFONT_FC=$enableval],[XFONT_FC=yes])
171 AM_CONDITIONAL(XFONT_FC, [test "x$XFONT_FC" = xyes])
172 if test "x$XFONT_FC" = xyes; then
173         AC_DEFINE(XFONT_FC,1,[Support the X Font Services Protocol])
174 fi
175
176
177 AC_CHECK_LIB(m, hypot, [MATH_LIBS=-lm
178 AC_SUBST(MATH_LIBS)], AC_MSG_ERROR([*** libm is required]))
179
180 PKG_CHECK_MODULES(XFONT, xproto xtrans fontsproto fontenc)
181
182 # Transport selection macro from xtrans.m4
183 XTRANS_CONNECTION_FLAGS
184
185 case $host_os in
186     linux*)
187         OS_CFLAGS="-D_XOPEN_SOURCE"
188         ;;
189     darwin*)
190         OS_CFLAGS="-Wl,-flat_namespace"
191         ;;
192     *)
193         OS_CFLAGS=
194         ;;
195 esac
196 AC_SUBST([OS_CFLAGS])
197
198 AC_CONFIG_FILES([Makefile
199                 doc/Makefile
200                 src/Makefile
201                 src/fontfile/Makefile
202                 src/FreeType/Makefile
203                 src/builtins/Makefile
204                 src/bitmap/Makefile
205                 src/fc/Makefile
206                 src/util/Makefile
207                 src/stubs/Makefile
208                 xfont.pc])
209 AC_OUTPUT