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 -rpath $(libdir) -set_version sgi1.0 -soname $@'
99 # since the library is using soname-style versioning, don't use
100 # internal versioning, via -set_version.
101 DSO_LDOPTS='-shared -rpath $(libdir) -soname $@'
105 # since the library is using soname-style versioning, don't use
106 # internal versioning, via -set_version.
107 DSO_LDOPTS='-shared -msym -rpath $(libdir) -soname $@'
111 DSO_LDOPTS='-shared -h $@'
119 AC_SUBST(DSO_PIC_CFLAGS)
122 # Using x libraries, set X font directory
127 X_FONT_DIR="$x_libraries/X11/fonts"
128 AC_DEFINE_UNQUOTED(X_FONT_DIR,$X_FONT_DIR)
134 # Check freetype configuration
136 case "$freetype_config" in
140 AC_CHECK_PROG(ft_config,freetype-config,freetype-config,no)
143 ft_config="$freetype_config"
147 case "$freetype_includes" in
157 FREETYPE_CFLAGS="`$ft_config --cflags`"
162 FREETYPE_CFLAGS="-I$freetype_includes"
166 case "$freetype_lib" in
176 freetype_lib="`$ft_config --libs`"
181 freetype_lib="-L$freetype_lib -lfreetype"
186 LIBS="$LIBS $freetype_lib"
187 saved_CPPFLAGS="$CPPFLAGS"
188 CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
189 AC_CHECK_HEADERS(freetype/freetype.h)
191 case "$ac_cv_header_freetype_freetype_h" in
193 CPPFLAGS="$saved_CPPFLAGS"
197 AC_CHECK_FUNCS(FT_Init_FreeType)
198 case "$ac_cv_func_FT_Init_FreeType" in
200 CPPFLAGS="$saved_CPPFLAGS"
204 AC_DEFINE(HAVE_FREETYPE)
205 AC_SUBST(FREETYPE_CFLAGS)
211 case "$default_fonts" in
213 FC_DEFAULT_FONTS="/usr/share/fonts"
214 AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "/usr/share/fonts")
217 FC_DEFAULT_FONTS="$default_fonts"
218 AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "$default_fonts")
222 AC_SUBST(FC_DEFAULT_FONTS)
225 # Set CONFDIR and FONTCONFIG_PATH
237 AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR")
241 # Check expat configuration
248 case "$expat_includes" in
250 expat_include_path=""
253 expat_include_path="-I$expat_includes"
260 expat_library="-lexpat"
263 expat_library="-L$expat/lib -lexpat"
270 expat_library="-L$expat_lib -lexpat"
274 saved_CPPFLAGS="$CPPFLAGS"
275 CPPFLAGS="$CPPFLAGS $expat_include_path"
277 LIBS="$LIBS $expat_library"
279 AC_CHECK_HEADER(expat.h)
280 case "$ac_cv_header_expat_h" in
282 AC_CHECK_HEADER(xmlparse.h)
283 case "$ac_cv_header_xmlparse_h" in
285 have_expat_header=no;
289 AC_SUBST(HAVE_XMLPARSE_H)
290 AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H)
291 have_expat_header=yes
296 have_expat_header=yes
299 case "$have_expat_header" in
301 CPPFLAGS="$saved_CPPFLAGS"
306 AC_CHECK_FUNCS(XML_ParserCreate)
307 case "$ac_cv_func_XML_ParserCreate" in
309 CPPFLAGS="$saved_CPPFLAGS"
316 AC_DEFINE_UNQUOTED(HAVE_EXPAT,$HAVE_EXPAT)
327 AC_MSG_ERROR([cannot find expat library])