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.
28 dnl ==========================================================================
30 dnl ==========================================================================
32 dnl This is the package version number, not the shared library version number
33 dnl The shared library version lives in fontconfig/fontconfig.h
34 AM_INIT_AUTOMAKE(fontconfig, 2.1.90)
36 FONTCONFIG_HEADER=fontconfig/fontconfig.h
37 FONTCONFIG_MAJOR=`awk '/^#define FC_MAJOR/ { print $3 }' $FONTCONFIG_HEADER`
38 FONTCONFIG_MINOR=`awk '/^#define FC_MINOR/ { print $3 }' $FONTCONFIG_HEADER`
39 FONTCONFIG_REVISION=`awk '/^#define FC_REVISION/ { print $3 }' $FONTCONFIG_HEADER`
41 AC_SUBST(FONTCONFIG_MAJOR)
42 AC_SUBST(FONTCONFIG_MINOR)
43 AC_SUBST(FONTCONFIG_REVISION)
45 dnl libtool versioning
47 LT_VERSION_NUMBER="$FONTCONFIG_MAJOR:$FONTCONFIG_MINOR:$FONTCONFIG_REVISION"
48 AC_SUBST(LT_VERSION_NUMBER)
50 dnl ==========================================================================
52 AM_CONFIG_HEADER(config.h)
60 # Checks for header files.
63 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
65 # Checks for typedefs, structures, and compiler characteristics.
69 # Checks for library functions.
71 AC_CHECK_FUNCS([memmove memset strchr strrchr strtol getopt getopt_long])
77 AC_ARG_WITH(freetype_config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes)
79 if test "$freetype_config" = "yes"; then
80 AC_PATH_PROG(ft_config,freetype-config,no)
81 if test "$ft_config" = "no"; then
82 AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/])
85 ft_config="$freetype_config"
88 FREETYPE_CFLAGS="$($ft_config --cflags)"
89 FREETYPE_LIBS="$($ft_config --libs)"
91 AC_SUBST(FREETYPE_LIBS)
92 AC_SUBST(FREETYPE_CFLAGS)
95 # Check to see whether we have FT_Get_First_Char(), new in 2.0.9
98 fontconfig_save_libs=$LIBS
99 LIBS="$LIBS $FREETYPE_LIBS"
100 AC_CHECK_FUNCS(FT_Get_First_Char)
101 LIBS=$fontconfig_save_libs
104 # Check expat configuration
107 AC_ARG_WITH(expat, [ --with-expat=DIR Use Expat in DIR], expat=$withval, expat=yes)
108 AC_ARG_WITH(expat_includes, [ --with-expat-includes=DIR Use Expat includes in DIR], expat_includes=$withval, expat_includes=yes)
109 AC_ARG_WITH(expat_lib, [ --with-expat-lib=DIR Use Expat library in DIR], expat_lib=$withval, expat_lib=yes)
115 case "$expat_includes" in
120 EXPAT_CFLAGS="-I$expat_includes"
130 EXPAT_LIBS="-L$expat/lib -lexpat"
137 EXPAT_LIBS="-L$expat_lib -lexpat"
141 expatsaved_CPPFLAGS="$CPPFLAGS"
142 CPPFLAGS="$CPPFLAGS $EXPAT_CFLAGS"
143 expatsaved_LIBS="$LIBS"
144 LIBS="$LIBS $EXPAT_LIBS"
146 AC_CHECK_HEADER(expat.h)
147 case "$ac_cv_header_expat_h" in
149 AC_CHECK_HEADER(xmlparse.h)
150 case "$ac_cv_header_xmlparse_h" in
152 have_expat_header=no;
156 AC_SUBST(HAVE_XMLPARSE_H)
157 AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H,
158 [Use xmlparse.h instead of expat.h])
159 have_expat_header=yes
164 have_expat_header=yes
167 case "$have_expat_header" in
172 AC_CHECK_FUNCS(XML_ParserCreate)
173 case "$ac_cv_func_XML_ParserCreate" in
180 AC_DEFINE_UNQUOTED(HAVE_EXPAT,$HAVE_EXPAT,
181 [Found a useable expat library])
186 CPPFLAGS="$saved_CPPFLAGS"
191 AC_SUBST(EXPAT_CFLAGS)
195 AC_MSG_ERROR([cannot find expat library])
200 # Set default font directory
203 AC_ARG_WITH(default_fonts, [ --with-default-fonts=DIR Use fonts from DIR when config is busted], defaultfonts="$withval", default_fonts=yes)
205 case "$default_fonts" in
207 FC_DEFAULT_FONTS="/usr/share/fonts"
208 AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "/usr/share/fonts",
209 [System font directory])
212 FC_DEFAULT_FONTS="$default_fonts"
213 AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "$default_fonts",
214 [System font directory])
218 AC_SUBST(FC_DEFAULT_FONTS)
221 # Add X fonts if available
223 AC_ARG_WITH(x_fonts, [ --with-x-fonts=DIR Find X fonts in DIR ], x_fonts="$withval", x_fonts=yes)
228 for dir in /usr/X11R6/lib/X11 /usr/X11/lib/X11 /usr/lib/X11; do
229 case x"$FC_X_FONTS" in
231 if test -d "$dir/fonts"; then
232 FC_X_FONTS="$dir/fonts"
237 AC_DEFINE_UNQUOTED(FC_X_FONTS,"$x_fonts",[X font directory])
243 FC_X_FONTS="$x_fonts"
244 AC_DEFINE_UNQUOTED(FC_X_FONTS,"$x_fonts",[X font directory])
252 case "$FC_X_FONTS" in
256 FC_FONTPATH="<dir>$FC_X_FONTS</dir>"
260 AC_SUBST(FC_FONTPATH)
264 AC_SUBST(FC_FONTDATE)
266 AC_ARG_WITH(confdir, [ --with-confdir=DIR Use DIR to store configuration files (default /etc/fonts)], confdir="$withval", confdir=yes)
269 # Set CONFDIR and FONTCONFIG_PATH
274 confdir='${sysconfdir}'/fonts
281 AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR",[Font configuration directory])
285 # Find out what language orthographies are included
288 ORTH_FILES=`cd fc-lang && echo *.orth`
292 # Let people not build/install docs if they don't have docbook
295 AC_CHECK_PROG(HASDOCBOOK, docbook2html, yes, no)
297 AC_ARG_ENABLE(docs, [ --disable-docs Don't build and install documentation],,enable_docs=yes)
299 if test "x$enable_docs" = xyes; then
300 if test "x$HASDOCBOOK" != xyes; then
305 AM_CONDITIONAL(ENABLE_DOCS, test "x$enable_docs" = xyes)
308 # Figure out where to install documentation
311 AC_ARG_WITH(docdir, [ --with-docdir=DIR Use DIR to store documentation files (default ${datadir}/doc/fontconfig)], confdir="$withval")
313 if test "x$with_docdir" = "x" ; then
314 DOCDIR='${datadir}/doc/fontconfig'