4 dnl Copyright © 2003 Keith Packard
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.
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.
24 dnl Process this file with autoconf to create configure.
26 dnl ==========================================================================
28 dnl ==========================================================================
30 dnl The version number is also in fontconfig/fontconfig.h
31 AC_INIT(ChangeLog,1.0.3,fontconfig@fontconfig.org)
33 FONTCONFIG_HEADER=fontconfig/fontconfig.h
34 FONTCONFIG_MAJOR=`awk '/^#define FC_MAJOR/ { print $3 }' $FONTCONFIG_HEADER`
35 FONTCONFIG_MINOR=`awk '/^#define FC_MINOR/ { print $3 }' $FONTCONFIG_HEADER`
36 FONTCONFIG_REVISION=`awk '/^#define FC_REVISION/ { print $3 }' $FONTCONFIG_HEADER`
37 FONTCONFIG_VERSION="$FONTCONFIG_MAJOR.$FONTCONFIG_MINOR.$FONTCONFIG_REVISION"
39 AC_SUBST(FONTCONFIG_MAJOR)
40 AC_SUBST(FONTCONFIG_MINOR)
41 AC_SUBST(FONTCONFIG_REVISION)
42 AC_SUBST(FONTCONFIG_VERSION)
44 dnl libtool versioning
46 LT_VERSION_NUMBER="$FONTCONFIG_MAJOR:$FONTCONFIG_MINOR:$FONTCONFIG_REVISION"
47 AC_SUBST(LT_VERSION_NUMBER)
49 dnl ==========================================================================
51 AM_INIT_AUTOMAKE(fontconfig, $FONTCONFIG_VERSION)
53 AM_CONFIG_HEADER(config.h)
61 # Checks for header files.
64 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
66 # Checks for typedefs, structures, and compiler characteristics.
70 # Checks for library functions.
72 AC_CHECK_FUNCS([memmove memset strchr strrchr strtol getopt getopt_long])
78 AC_ARG_WITH(freetype_config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes)
80 if test "$freetype_config" = "yes"; then
81 AC_PATH_PROG(ft_config,freetype-config,no)
82 if test "$ft_config" = "no"; then
83 AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/])
86 ft_config="$freetype_config"
89 FREETYPE_CFLAGS="$($ft_config --cflags)"
90 FREETYPE_LIBS="$($ft_config --libs)"
92 AC_SUBST(FREETYPE_LIBS)
93 AC_SUBST(FREETYPE_CFLAGS)
96 # Check to see whether we have FT_Get_First_Char(), new in 2.0.9
99 fontconfig_save_libs=$LIBS
100 LIBS="$LIBS $FREETYPE_LIBS"
101 AC_CHECK_FUNCS(FT_Get_First_Char)
102 LIBS=$fontconfig_save_libs
105 # Check expat configuration
108 AC_ARG_WITH(expat, [ --with-expat=DIR Use Expat in DIR], expat=$withval, expat=yes)
109 AC_ARG_WITH(expat_includes, [ --with-expat-includes=DIR Use Expat includes in DIR], expat_includes=$withval, expat_includes=yes)
110 AC_ARG_WITH(expat_lib, [ --with-expat-lib=DIR Use Expat library in DIR], expat_lib=$withval, expat_lib=yes)
116 case "$expat_includes" in
121 EXPAT_CFLAGS="-I$expat_includes"
131 EXPAT_LIBS="-L$expat/lib -lexpat"
138 EXPAT_LIBS="-L$expat_lib -lexpat"
142 expatsaved_CPPFLAGS="$CPPFLAGS"
143 CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS"
144 expatsaved_LIBS="$LIBS"
145 LIBS="$LIBS $EXPAT_LIBS"
147 AC_CHECK_HEADER(expat.h)
148 case "$ac_cv_header_expat_h" in
150 AC_CHECK_HEADER(xmlparse.h)
151 case "$ac_cv_header_xmlparse_h" in
153 have_expat_header=no;
157 AC_SUBST(HAVE_XMLPARSE_H)
158 AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H,
159 [Use xmlparse.h instead of expat.h])
160 have_expat_header=yes
165 have_expat_header=yes
168 case "$have_expat_header" in
173 AC_CHECK_FUNCS(XML_ParserCreate)
174 case "$ac_cv_func_XML_ParserCreate" in
181 AC_DEFINE_UNQUOTED(HAVE_EXPAT,$HAVE_EXPAT,
182 [Found a useable expat library])
187 CPPFLAGS="$saved_CPPFLAGS"
192 AC_SUBST(EXPAT_CFLAGS)
196 AC_MSG_ERROR([cannot find expat library])
201 # Set default font directory
204 AC_ARG_WITH(default_fonts, [ --with-default-fonts=DIR Use fonts from DIR when config is busted], defaultfonts="$withval", default_fonts=yes)
206 case "$default_fonts" in
208 FC_DEFAULT_FONTS="/usr/share/fonts"
209 AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "/usr/share/fonts",
210 [System font directory])
213 FC_DEFAULT_FONTS="$default_fonts"
214 AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "$default_fonts",
215 [System font directory])
219 AC_SUBST(FC_DEFAULT_FONTS)
222 # Add X fonts if available
224 AC_ARG_WITH(x_fonts, [ --with-x-fonts=DIR Find X fonts in DIR ], x_fonts="$withval", x_fonts=yes)
229 for dir in /usr/X11R6/lib /usr/X11/lib /usr/lib/X11; do
230 case x"$FC_X_FONTS" in
232 if test -d "$dir/fonts"; then
233 FC_X_FONTS="$dir/fonts"
238 AC_DEFINE_UNQUOTED(FC_X_FONTS,"$x_fonts",[X font directory])
244 FC_X_FONTS="$x_fonts"
245 AC_DEFINE_UNQUOTED(FC_X_FONTS,"$x_fonts",[X font directory])
253 case "$FC_X_FONTS" in
257 FC_FONTPATH="<dir>$FC_X_FONTS</dir>"
261 AC_SUBST(FC_FONTPATH)
265 AC_SUBST(FC_FONTDATE)
267 AC_ARG_WITH(confdir, [ --with-confdir=DIR Use DIR to store configuration files (default /etc/fonts)], confdir="$withval", confdir=yes)
270 # Set CONFDIR and FONTCONFIG_PATH
282 AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR",[Font configuration directory])
286 # Find out what language orthographies are included
289 ORTH_FILES=`cd fc-lang && echo *.orth`