fontconfig/configure.in

340 lines
7.7 KiB
Plaintext
Raw Normal View History

2002-05-21 19:08:42 +02:00
dnl
dnl $XFree86: xc/lib/fontconfig/configure.in,v 1.7 2002/08/01 15:57:25 keithp Exp $
2002-05-21 19:08:42 +02:00
dnl
dnl Copyright <20> 2002 Keith Packard, member of The XFree86 Project, Inc.
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
dnl documentation for any purpose is hereby granted without fee, provided that
dnl the above copyright notice appear in all copies and that both that
dnl copyright notice and this permission notice appear in supporting
dnl documentation, and that the name of Keith Packard not be used in
dnl advertising or publicity pertaining to distribution of the software without
dnl specific, written prior permission. Keith Packard makes no
dnl representations about the suitability of this software for any purpose. It
dnl is provided "as is" without express or implied warranty.
dnl
dnl KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
dnl EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dnl PERFORMANCE OF THIS SOFTWARE.
dnl
2002-02-15 00:34:13 +01:00
2002-05-21 19:08:42 +02:00
# Process this file with autoconf to produce a configure script.
2002-05-21 19:08:42 +02:00
AC_INIT(fontconfig, 1.0.1, fonts@xfree86.org)
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_HEADER(config.h)
2002-02-15 00:34:13 +01:00
AC_ARG_WITH(freetype_includes, [ --with-freetype-includes=DIR Use FreeType includes in DIR], freetype_includes=$withval, freetype_includes=yes)
AC_ARG_WITH(freetype_lib, [ --with-freetype-lib=DIR Use FreeType library in DIR], freetype_lib=$withval, freetype_lib=yes)
2002-05-24 07:19:30 +02:00
AC_ARG_WITH(freetype_config, [ --with-freetype-config=PROG Use FreeType configuration program PROG], freetype_config=$withval, freetype_config=yes)
AC_ARG_WITH(expat, [ --with-expat=DIR Use Expat in DIR], expat=$withval, expat=yes)
2002-05-21 19:08:42 +02:00
AC_ARG_WITH(expat_includes, [ --with-expat-includes=DIR Use Expat includes in DIR], expat_includes=$withval, expat_includes=yes)
AC_ARG_WITH(expat_lib, [ --with-expat-lib=DIR Use Expat library in DIR], expat_lib=$withval, expat_lib=yes)
2002-05-21 19:48:15 +02:00
AC_ARG_WITH(default_fonts, [ --with-default-fonts=DIR Use fonts from DIR when config is busted], defaultfonts="$withval", default_fonts=yes)
AC_ARG_WITH(confdir, [ --with-confdir=DIR Use DIR to store configuration files (default /etc/fonts)], confdir="$withval", confdir=yes)
2002-05-21 19:08:42 +02:00
# Checks for programs.
2002-02-15 00:34:13 +01:00
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
2002-05-21 19:48:15 +02:00
AC_PATH_X
2002-02-15 00:34:13 +01:00
2002-05-21 19:08:42 +02:00
PACKAGE_VERSION=1.0.1
# Set major version
PACKAGE_MAJOR=`echo $PACKAGE_VERSION | awk -F . '{ print $1 }'`
PACKAGE_MINOR=`echo $PACKAGE_VERSION | awk -F . '{ print $2 }'`
PACKAGE_REVISION=`echo $PACKAGE_VERSION | awk -F . '{ print $3 }'`
AC_SUBST(PACKAGE_VERSION)
2002-05-21 19:08:42 +02:00
AC_SUBST(PACKAGE_MAJOR)
AC_SUBST(PACKAGE_MINOR)
AC_SUBST(PACKAGE_REVISION)
OBJEXT="o"
AC_SUBST(OBJEXT)
AC_DEFINE_UNQUOTED(PACKAGE_MAJOR,$PACKAGE_MAJOR)
AC_DEFINE_UNQUOTED(PACKAGE_MINOR,$PACKAGE_MINOR)
AC_DEFINE_UNQUOTED(PACKAGE_REVISION,$PACKAGE_REVISION)
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
# Checks for library functions.
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([memmove memset strchr strrchr strtol getopt getopt_long])
if test "$GCC" = "yes"; then
MKSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
DSO_LDOPTS='-shared -Wl,-h,`echo $@ | sed '"'s/\.so\.\([[0-9][0-9]]*\).*/.so.\1/'"'`'
DSO_CFLAGS=''
DSO_PIC_CFLAGS='-fPIC -DPIC'
2002-02-15 00:34:13 +01:00
else
AC_CANONICAL_HOST
2002-05-21 19:08:42 +02:00
MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=''
DSO_PIC_CFLAGS='-KPIC -DPIC'
case "$host" in
*solaris*)
DSO_LDOPTS='-G -z text -z defs -h $@'
LIBS="$LIBS -lc"
;;
*irix6*)
DSO_LDOPTS='-shared -rpath $(libdir) -set_version sgi1.0 -soname $@'
LIBS="$LIBS -lc"
;;
*osf[[123]]*)
# since the library is using soname-style versioning, don't use
# internal versioning, via -set_version.
DSO_LDOPTS='-shared -rpath $(libdir) -soname $@'
LIBS="$LIBS -lc"
;;
*osf[[45]]*)
# since the library is using soname-style versioning, don't use
# internal versioning, via -set_version.
DSO_LDOPTS='-shared -msym -rpath $(libdir) -soname $@'
LIBS="$LIBS -lc"
;;
*)
DSO_LDOPTS='-shared -h $@'
;;
esac
2002-02-15 00:34:13 +01:00
fi
2002-05-21 19:08:42 +02:00
AC_SUBST(MKSHLIB)
AC_SUBST(DSO_LDOPTS)
AC_SUBST(DSO_CFLAGS)
AC_SUBST(DSO_PIC_CFLAGS)
2002-02-15 00:34:13 +01:00
2002-05-21 19:48:15 +02:00
#
# Using x libraries, set X font directory
case "$no_x" in
yes)
;;
*)
X_FONT_DIR="$x_libraries/X11/fonts"
AC_DEFINE_UNQUOTED(X_FONT_DIR,$X_FONT_DIR)
;;
esac
AC_SUBST(X_FONT_DIR)
2002-05-21 19:08:42 +02:00
#
# Check freetype configuration
#
2002-02-15 00:34:13 +01:00
case "$freetype_config" in
no)
;;
yes)
2002-05-21 19:08:42 +02:00
AC_CHECK_PROG(ft_config,freetype-config,freetype-config,no)
2002-02-15 00:34:13 +01:00
;;
*)
ft_config="$freetype_config"
;;
esac
case "$freetype_includes" in
no)
FREETYPE_CFLAGS=""
2002-02-15 00:34:13 +01:00
;;
yes)
case "$ft_config" in
no)
FREETYPE_CFLAGS=""
2002-02-15 00:34:13 +01:00
;;
*)
FREETYPE_CFLAGS="`$ft_config --cflags`"
2002-02-15 00:34:13 +01:00
;;
esac
;;
*)
FREETYPE_CFLAGS="-I$freetype_includes"
2002-02-15 00:34:13 +01:00
;;
esac
case "$freetype_lib" in
no)
freetype_lib=""
;;
yes)
case "$ft_config" in
no)
freetype_lib=""
;;
*)
freetype_lib="`$ft_config --libs`"
;;
esac
;;
*)
freetype_lib="-L$freetype_lib -lfreetype"
;;
esac
saved_LIBS="$LIBS"
LIBS="$LIBS $freetype_lib"
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS"
2002-05-21 19:08:42 +02:00
AC_CHECK_HEADERS(freetype/freetype.h)
2002-02-15 00:34:13 +01:00
2002-05-21 19:08:42 +02:00
case "$ac_cv_header_freetype_freetype_h" in
2002-02-15 00:34:13 +01:00
no)
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
;;
yes)
AC_CHECK_FUNCS(FT_Init_FreeType)
case "$ac_cv_func_FT_Init_FreeType" in
no)
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
;;
yes)
AC_DEFINE(HAVE_FREETYPE)
AC_SUBST(FREETYPE_CFLAGS)
2002-02-15 00:34:13 +01:00
;;
esac
;;
esac
2002-05-21 19:08:42 +02:00
2002-05-21 19:48:15 +02:00
case "$default_fonts" in
2002-05-21 19:08:42 +02:00
yes)
2002-05-21 19:48:15 +02:00
FC_DEFAULT_FONTS="/usr/share/fonts"
AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "/usr/share/fonts")
2002-05-21 19:08:42 +02:00
;;
*)
2002-05-21 19:48:15 +02:00
FC_DEFAULT_FONTS="$default_fonts"
AC_DEFINE_UNQUOTED(FC_DEFAULT_FONTS, "$default_fonts")
2002-05-21 19:08:42 +02:00
;;
esac
2002-05-21 19:48:15 +02:00
AC_SUBST(FC_DEFAULT_FONTS)
2002-05-21 19:08:42 +02:00
#
# Set CONFDIR and FONTCONFIG_PATH
#
case "$confdir" in
no|yes)
confdir=/etc/fonts
2002-02-15 00:34:13 +01:00
;;
2002-05-21 19:08:42 +02:00
*)
;;
esac
AC_SUBST(confdir)
CONFDIR='${confdir}'
AC_DEFINE_UNQUOTED(CONFDIR, "$CONFDIR")
AC_SUBST(CONFDIR)
2002-05-21 19:08:42 +02:00
#
# Check expat configuration
#
2002-02-15 00:34:13 +01:00
2002-05-21 19:08:42 +02:00
case "$expat" in
2002-02-15 00:34:13 +01:00
no)
;;
2002-05-21 19:08:42 +02:00
*)
case "$expat_includes" in
yes|no)
expat_include_path=""
;;
*)
expat_include_path="-I$expat_includes"
;;
esac
case "$expat_lib" in
yes)
case "$expat" in
yes)
2002-05-21 19:08:42 +02:00
expat_library="-lexpat"
;;
*)
expat_library="-L$expat/lib -lexpat"
;;
esac
;;
2002-02-15 00:34:13 +01:00
no)
;;
*)
2002-05-21 19:08:42 +02:00
expat_library="-L$expat_lib -lexpat"
;;
esac
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $expat_include_path"
saved_LIBS="$LIBS"
LIBS="$LIBS $expat_library"
AC_CHECK_HEADER(expat.h)
case "$ac_cv_header_expat_h" in
no)
AC_CHECK_HEADER(xmlparse.h)
case "$ac_cv_header_xmlparse_h" in
no)
have_expat_header=no;
;;
yes)
HAVE_XMLPARSE_H=1
AC_SUBST(HAVE_XMLPARSE_H)
AC_DEFINE_UNQUOTED(HAVE_XMLPARSE_H,$HAVE_XMLPARSE_H)
have_expat_header=yes
;;
esac
;;
yes)
have_expat_header=yes
;;
esac
case "$have_expat_header" in
no)
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
expat=no
;;
yes)
AC_CHECK_FUNCS(XML_ParserCreate)
case "$ac_cv_func_XML_ParserCreate" in
no)
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
expat=no
;;
yes)
HAVE_EXPAT=1
AC_SUBST(HAVE_EXPAT)
AC_DEFINE_UNQUOTED(HAVE_EXPAT,$HAVE_EXPAT)
;;
esac
2002-02-15 00:34:13 +01:00
;;
esac
;;
esac
2002-05-21 19:08:42 +02:00
case "$expat" in
no)
AC_MSG_ERROR([cannot find expat library])
2002-05-21 19:08:42 +02:00
;;
esac
2002-02-15 00:34:13 +01:00
2002-05-21 19:08:42 +02:00
AC_OUTPUT([Makefile
config/Makedefs
fc-lang/Makefile
2002-05-21 19:08:42 +02:00
src/Makefile
fc-cache/Makefile
2002-05-21 19:48:15 +02:00
fc-list/Makefile
fontconfig/Makefile
2003-02-17 18:35:28 +01:00
fontconfig.pc])
2002-05-21 19:48:15 +02:00