2 dnl $XFree86: xc/lib/fontconfig/configure.in,v 1.7 2002/08/01 15:57:25 keithp Exp $
4 dnl Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
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.
25 # Process this file with autoconf to produce a configure script.
27 AC_INIT(fontconfig, 1.0.1, fonts@xfree86.org)
28 AC_CONFIG_AUX_DIR(config)
29 AC_CONFIG_HEADER(config.h)
31 AC_ARG_WITH(freetype_includes, [ --with-freetype-includes=DIR Use FreeType includes in DIR], freetype_includes=$withval, freetype_includes=yes)
32 AC_ARG_WITH(freetype_lib, [ --with-freetype-lib=DIR Use FreeType library in DIR], freetype_lib=$withval, freetype_lib=yes)
33 AC_ARG_WITH(freetype_config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes)
34 AC_ARG_WITH(expat, [ --with-expat=DIR Use Expat in DIR], expat=$withval, expat=yes)
35 AC_ARG_WITH(expat_includes, [ --with-expat-includes=DIR Use Expat includes in DIR], expat_includes=$withval, expat_includes=yes)
36 AC_ARG_WITH(expat_lib, [ --with-expat-lib=DIR Use Expat library in DIR], expat_lib=$withval, expat_lib=yes)
37 AC_ARG_WITH(default_fonts, [ --with-default-fonts=DIR Use fonts from DIR when config is busted], defaultfonts="$withval", default_fonts=yes)
38 AC_ARG_WITH(confdir, [ --with-confdir=DIR Use DIR to store configuration files (default /etc/fonts)], confdir="$withval", confdir=yes)
40 # Checks for programs.
49 PACKAGE_MAJOR=`echo $PACKAGE_VERSION | awk -F . '{ print $1 }'`
50 PACKAGE_MINOR=`echo $PACKAGE_VERSION | awk -F . '{ print $2 }'`
51 PACKAGE_REVISION=`echo $PACKAGE_VERSION | awk -F . '{ print $3 }'`
52 AC_SUBST(PACKAGE_VERSION)
53 AC_SUBST(PACKAGE_MAJOR)
54 AC_SUBST(PACKAGE_MINOR)
55 AC_SUBST(PACKAGE_REVISION)
60 AC_DEFINE_UNQUOTED(PACKAGE_MAJOR,$PACKAGE_MAJOR)
61 AC_DEFINE_UNQUOTED(PACKAGE_MINOR,$PACKAGE_MINOR)
62 AC_DEFINE_UNQUOTED(PACKAGE_REVISION,$PACKAGE_REVISION)
64 # Checks for header files.
67 AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
69 # Checks for typedefs, structures, and compiler characteristics.
73 # Checks for library functions.
75 AC_CHECK_FUNCS([memmove memset strchr strrchr strtol getopt getopt_long])
77 if test "$GCC" = "yes"; then
78 MKSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
79 DSO_LDOPTS='-shared -Wl,-h,`echo $@ | sed '"'s/\.so\.\([[0-9][0-9]]*\).*/.so.\1/'"'`'
81 DSO_PIC_CFLAGS='-fPIC -DPIC'
85 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
87 DSO_PIC_CFLAGS='-KPIC -DPIC'
91 DSO_LDOPTS='-G -z text -z defs -h $@'
95 DSO_LDOPTS='-shared -h $@'
103 AC_SUBST(DSO_PIC_CFLAGS)
106 # Using x libraries, set X font directory
111 X_FONT_DIR="$x_libraries/X11/fonts"
112 AC_DEFINE_UNQUOTED(X_FONT_DIR,$X_FONT_DIR)
118 # Check freetype configuration
120 case "$freetype_config" in
124 AC_CHECK_PROG(ft_config,freetype-config,freetype-config,no)
127 ft_config="$freetype_config"
131 case "$freetype_includes" in
141 FREETYPE_CFLAGS="`$ft_config --cflags`"
146 FREETYPE_CFLAGS="-I$freetype_includes"
150 case "$freetype_lib" in
160 freetype_lib="`$ft_config --libs`"
165 freetype_lib="-L$freetype_lib -lfreetype"
170 LIBS="$LIBS $freetype_lib"
171 saved_CPPFLAGS="$CPPFLAGS"
172 CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
173 AC_CHECK_HEADERS(freetype/freetype.h)
175 case "$ac_cv_header_freetype_freetype_h" in
177 CPPFLAGS="$saved_CPPFLAGS"
181 AC_CHECK_FUNCS(FT_Init_FreeType)
182 case "$ac_cv_func_FT_Init_FreeType" in
184 CPPFLAGS="$saved_CPPFLAGS"
188 AC_DEFINE(HAVE_FREETYPE)
189 AC_SUBST(FREETYPE_CFLAGS)
195 case "$default_fonts" in
197 FC_DEFAULT_FONTS="/usr/share/fonts"
198 AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "/usr/share/fonts")
201 FC_DEFAULT_FONTS="$default_fonts"
202 AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "$default_fonts")
206 AC_SUBST(FC_DEFAULT_FONTS)
209 # Set CONFDIR and FONTCONFIG_PATH
221 AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR")
225 # Check expat configuration
232 case "$expat_includes" in
234 expat_include_path=""
237 expat_include_path="-I$expat_includes"
244 expat_library="-lexpat"
247 expat_library="-L$expat/lib -lexpat"
254 expat_library="-L$expat_lib -lexpat"
258 saved_CPPFLAGS="$CPPFLAGS"
259 CPPFLAGS="$CPPFLAGS $expat_include_path"
261 LIBS="$LIBS $expat_library"
263 AC_CHECK_HEADER(expat.h)
264 case "$ac_cv_header_expat_h" in
266 AC_CHECK_HEADER(xmlparse.h)
267 case "$ac_cv_header_xmlparse_h" in
269 have_expat_header=no;
273 AC_SUBST(HAVE_XMLPARSE_H)
274 AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H)
275 have_expat_header=yes
280 have_expat_header=yes
283 case "$have_expat_header" in
285 CPPFLAGS="$saved_CPPFLAGS"
290 AC_CHECK_FUNCS(XML_ParserCreate)
291 case "$ac_cv_func_XML_ParserCreate" in
293 CPPFLAGS="$saved_CPPFLAGS"
300 AC_DEFINE_UNQUOTED(HAVE_EXPAT,$HAVE_EXPAT)
311 AC_MSG_ERROR([cannot find expat library])