xenocara/lib/libXfont/configure.ac

237 lines
7.2 KiB
Plaintext
Raw Normal View History

2011-09-10 03:31:51 -06:00
# Copyright © 2003 Keith Packard
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Keith Packard not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. Keith Packard makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
2006-11-25 09:46:32 -07:00
2011-09-10 03:31:51 -06:00
# Initialize Autoconf
2010-09-04 04:37:30 -06:00
AC_PREREQ([2.60])
AC_INIT([libXfont], [1.5.1],
2011-09-10 03:31:51 -06:00
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXfont])
AC_CONFIG_SRCDIR([Makefile.am])
2010-09-04 04:37:30 -06:00
AC_CONFIG_HEADERS([config.h include/X11/fonts/fontconf.h])
2011-09-10 03:31:51 -06:00
# Initialize Automake
2006-11-25 09:46:32 -07:00
AM_INIT_AUTOMAKE([foreign dist-bzip2])
# Set common system defines for POSIX extensions, such as _GNU_SOURCE
# Must be called before any macros that run the compiler (like
# AC_PROG_LIBTOOL) to avoid autoconf errors.
AC_USE_SYSTEM_EXTENSIONS
2011-09-10 03:31:51 -06:00
# Initialize libtool
AC_PROG_LIBTOOL
# Require xorg-macros minimum of 1.10 for DocBook XML documentation
2010-09-04 04:37:30 -06:00
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.10)
2010-09-04 04:37:30 -06:00
XORG_DEFAULT_OPTIONS
XORG_ENABLE_DEVEL_DOCS
2011-09-10 03:31:51 -06:00
XORG_WITH_XMLTO(0.0.22)
2010-09-04 04:37:30 -06:00
XORG_WITH_FOP
2011-09-10 03:31:51 -06:00
XORG_CHECK_SGML_DOCTOOLS(1.7)
2006-11-25 09:46:32 -07:00
2011-09-10 03:31:51 -06:00
# Checks for header files.
2006-11-25 09:46:32 -07:00
AC_CHECK_HEADERS([endian.h poll.h sys/poll.h])
2011-09-10 03:31:51 -06:00
# Checks for library functions.
2013-08-18 04:36:20 -06:00
AC_CHECK_FUNCS([poll readlink])
2006-11-25 09:46:32 -07:00
2011-09-10 03:31:51 -06:00
# If the first PKG_CHECK_MODULES appears inside a conditional, pkg-config
# must first be located explicitly.
PKG_PROG_PKG_CONFIG
2006-11-25 09:46:32 -07:00
#
# select libraries to include
#
XFONT_FONTFILE=no
#
2014-05-18 06:13:54 -06:00
# FreeType for all scalable (OpenType, TrueType, PostScript) and
# some bitmap formats (BDF & PCF)
2006-11-25 09:46:32 -07:00
#
AC_ARG_ENABLE(freetype,
AS_HELP_STRING([--disable-freetype],
[Build freetype backend (default: enabled)]),
[XFONT_FREETYPE=$enableval],[XFONT_FREETYPE=yes])
2006-11-25 09:46:32 -07:00
AM_CONDITIONAL(XFONT_FREETYPE, [test x$XFONT_FREETYPE = xyes])
if test x$XFONT_FREETYPE = xyes; then
AC_DEFINE(XFONT_FREETYPE,1,[Support FreeType rasterizer for nearly all font file formats])
AC_ARG_WITH(freetype-config,
AS_HELP_STRING([--with-freetype-config=PROG],
[Use FreeType configuration program PROG]),
[freetype_config=$withval], [freetype_config=auto])
2012-03-04 11:13:46 -07:00
2006-11-25 09:46:32 -07:00
if test "$freetype_config" = "auto" ; then
2012-03-04 11:13:46 -07:00
PKG_CHECK_MODULES(FREETYPE, freetype2,
2006-11-25 09:46:32 -07:00
freetype_config=no, freetype_config=yes)
fi
2012-03-04 11:13:46 -07:00
if test "$freetype_config" = "yes"; then
2006-11-25 09:46:32 -07:00
AC_PATH_PROG(ft_config,freetype-config,no)
if test "$ft_config" = "no"; then
AC_MSG_ERROR([You must have freetype installed; see http://www.freetype.org/])
fi
else
ft_config="$freetype_config"
fi
2012-03-04 11:13:46 -07:00
if test "$freetype_config" != "no"; then
2006-11-25 09:46:32 -07:00
FREETYPE_CFLAGS="`$ft_config --cflags`"
FREETYPE_LIBS="`$ft_config --libs`"
fi
FREETYPE_REQUIRES="freetype2"
XFONT_FONTFILE=yes
else
FREETYPE_CFLAGS=""
FREETYPE_LIBS=""
FREETYPE_REQUIRES=""
fi
AC_SUBST(FREETYPE_LIBS)
AC_SUBST(FREETYPE_CFLAGS)
AC_SUBST(FREETYPE_REQUIRES)
#
# Bitmap fonts in files:
# Builtins (gzipped pcf format in .text segment)
# PCF
# BDF
# SNF
#
AC_DEFINE(X_GZIP_FONT_COMPRESSION,1,[Support gzip for bitmap fonts])
X_GZIP_FONT_COMPRESSION=1
AC_SUBST(X_GZIP_FONT_COMPRESSION)
2009-10-31 11:57:11 -06:00
AC_CHECK_LIB(z, gzopen, [Z_LIBS=-lz], AC_MSG_ERROR([*** zlib is required]))
2012-03-04 11:13:46 -07:00
AC_ARG_WITH(bzip2,
AS_HELP_STRING([--with-bzip2],
[Use libbz2 to support bzip2 compressed bitmap fonts (default: no)]),
2009-10-31 11:57:11 -06:00
[], [with_bzip2=no])
if test "x$with_bzip2" = xyes; then
AC_CHECK_LIB(bz2, BZ2_bzopen, [Z_LIBS="$Z_LIBS -lbz2"],
AC_MSG_ERROR([*** libbz2 is required for bzip2 support]))
AC_DEFINE(X_BZIP2_FONT_COMPRESSION,1,[Support bzip2 for bitmap fonts])
fi
AM_CONDITIONAL(X_BZIP2_FONT_COMPRESSION, [test "x$with_bzip2" = xyes ])
AC_SUBST(Z_LIBS)
2006-11-25 09:46:32 -07:00
AC_ARG_ENABLE(builtins,
AS_HELP_STRING([--disable-builtins],
[Support builtin fonts (default: enabled)]),
[XFONT_BUILTINS=$enableval], [XFONT_BUILTINS=yes])
2006-11-25 09:46:32 -07:00
AM_CONDITIONAL(XFONT_BUILTINS, [test "x$XFONT_BUILTINS" = xyes ])
if test "x$XFONT_BUILTINS" = xyes; then
AC_DEFINE(XFONT_BUILTINS,1,[Support built-in fonts])
XFONT_BITMAP=yes
fi
AC_ARG_ENABLE(pcfformat,
AS_HELP_STRING([--disable-pcfformat],
[Support PCF format bitmap fonts (default: enabled)]),
[XFONT_PCFFORMAT=$enableval], [XFONT_PCFFORMAT=yes])
2006-11-25 09:46:32 -07:00
AM_CONDITIONAL(XFONT_PCFFORMAT, [test "x$XFONT_PCFFORMAT" = xyes])
if test "x$XFONT_PCFFORMAT" = xyes; then
AC_DEFINE(XFONT_PCFFORMAT,1,[Support pcf format bitmap font files])
XFONT_BITMAP=yes
fi
AM_CONDITIONAL(XFONT_PCF_OR_BUILTIN,
[test "x$XFONT_PCFFORMAT" = xyes -o "x$XFONT_BUILTINS" = xyes])
AC_ARG_ENABLE(bdfformat,
AS_HELP_STRING([--disable-bdfformat],
[Support BDF format bitmap fonts (default: enabled)]),
[XFONT_BDFFORMAT=$enableval], [XFONT_BDFFORMAT=yes])
2006-11-25 09:46:32 -07:00
AM_CONDITIONAL(XFONT_BDFFORMAT, [test "x$XFONT_BDFFORMAT" = xyes])
if test "x$XFONT_BDFFORMAT" = xyes; then
AC_DEFINE(XFONT_BDFFORMAT,1,[Support bdf format bitmap font files])
XFONT_BITMAP=yes
fi
AC_ARG_ENABLE(snfformat,
AS_HELP_STRING([--enable-snfformat],
[Support SNF format bitmap fonts (default: disabled)]),
[XFONT_SNFFORMAT=$enableval], [XFONT_SNFFORMAT=no])
2006-11-25 09:46:32 -07:00
AM_CONDITIONAL(XFONT_SNFFORMAT, [test "x$XFONT_SNFFORMAT" = xyes])
if test "x$XFONT_SNFFORMAT" = xyes; then
AC_DEFINE(XFONT_SNFFORMAT,1,[Support snf format bitmap font files])
XFONT_BITMAP=yes
fi
AM_CONDITIONAL(XFONT_BITMAP, [test "x$XFONT_BITMAP" = xyes ])
if test "x$XFONT_BITMAP" = xyes; then
AC_DEFINE(XFONT_BITMAP,1,[Support bitmap font files])
XFONT_FONTFILE=yes
fi
AM_CONDITIONAL(XFONT_FONTFILE, [test "x$XFONT_FONTFILE" = xyes])
if test "x$XFONT_FONTFILE" = xyes; then
AC_DEFINE(XFONT_FONTFILE,1,[Support fonts in files])
fi
#
# Support connection to font servers?
#
AC_ARG_ENABLE(fc,
AS_HELP_STRING([--disable-fc],
[Support connections to xfs servers (default: enabled)]),
[XFONT_FC=$enableval],[XFONT_FC=yes])
2006-11-25 09:46:32 -07:00
AM_CONDITIONAL(XFONT_FC, [test "x$XFONT_FC" = xyes])
if test "x$XFONT_FC" = xyes; then
AC_DEFINE(XFONT_FC,1,[Support the X Font Services Protocol])
fi
AC_CHECK_LIB(m, hypot, [MATH_LIBS=-lm
AC_SUBST(MATH_LIBS)], AC_MSG_ERROR([*** libm is required]))
PKG_CHECK_MODULES(XFONT, [xproto xtrans fontsproto >= 2.1.3 fontenc])
2006-11-25 09:46:32 -07:00
# Transport selection macro from xtrans.m4
XTRANS_CONNECTION_FLAGS
case $host_os in
linux*)
OS_CFLAGS="-D_XOPEN_SOURCE"
;;
2007-04-08 11:56:34 -06:00
darwin*)
OS_CFLAGS="-Wl,-flat_namespace"
;;
2006-11-25 09:46:32 -07:00
*)
OS_CFLAGS=
;;
esac
2009-10-31 11:57:11 -06:00
AC_SUBST([OS_CFLAGS])
2006-11-25 09:46:32 -07:00
2011-09-10 03:31:51 -06:00
AC_CONFIG_FILES([Makefile
doc/Makefile
src/Makefile
src/fontfile/Makefile
src/FreeType/Makefile
src/builtins/Makefile
src/bitmap/Makefile
src/fc/Makefile
src/util/Makefile
src/stubs/Makefile
xfont.pc])
AC_OUTPUT