cairo/configure.in

430 lines
12 KiB
Text
Raw Normal View History

AC_PREREQ(2.54)
2003-07-18 11:34:19 +00:00
AC_INIT(src/cairo.h)
dnl ===========================================================================
2003-04-25 13:34:00 +00:00
# Package version number, (as distinct from shared library version)
CAIRO_VERSION=0.6.0-head
2003-04-25 13:34:00 +00:00
# libtool shared library version
2003-04-25 13:34:00 +00:00
# Increment if the interface has additions, changes, removals.
LT_CURRENT=1
# Increment any time the source changes; set to
# 0 if you increment CURRENT
LT_REVISION=0
# Increment if any interfaces have been added; set to 0
# if any interfaces have been removed. removal has
# precedence over adding, so set to 0 if both happened.
LT_AGE=0
VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE"
AC_SUBST(VERSION_INFO)
dnl ===========================================================================
2003-07-18 11:34:19 +00:00
AM_INIT_AUTOMAKE(cairo, $CAIRO_VERSION)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_PROG_CC
AC_PROG_CPP
AM_PROG_LIBTOOL
AC_STDC_HEADERS
AC_C_BIGENDIAN
AC_CHECK_FUNCS(vasnprintf)
AC_CHECK_LIBM
LIBS="$LIBS $LIBM"
AC_CHECK_FUNCS(sincos)
dnl ===========================================================================
AC_ARG_ENABLE(xlib,
[ --disable-xlib Disable cairo's Xlib backend],
[use_xlib=$enableval], [use_xlib=yes])
if test "x$use_xlib" = "xyes"; then
dnl Check for Xrender header files if the Xrender package is not installed:
PKG_CHECK_MODULES(XRENDER, xrender >= 0.6, [
XRENDER_REQUIRES=xrender
use_xlib=yes], [
AC_CHECK_HEADER(X11/extensions/Xrender.h, [
AC_PATH_XTRA
XRENDER_LIBS="$X_LIBS -lXrender -lXext -lX11 $X_EXTRA_LIBS"
use_xlib=yes], [
use_xlib="no (requires Xrender http://freedesktop.org/Software/xlibs)"])])
fi
AM_CONDITIONAL(CAIRO_HAS_XLIB_SURFACE, test "x$use_xlib" = "xyes")
if test "x$use_xlib" = "xyes"; then
XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
fi
AC_SUBST(XLIB_SURFACE_FEATURE)
AC_SUBST(XRENDER_REQUIRES)
CAIRO_CFLAGS="$CAIRO_CFLAGS $XRENDER_CFLAGS"
CAIRO_LIBS="$CAIRO_LIBS $XRENDER_LIBS"
AC_ARG_ENABLE(quartz,
[ --disable-quartz Disable cairo's quartz backend],
[use_quartz=$enableval], [use_quartz=yes])
if test "x$use_quartz" = "xyes"; then
dnl There is no pkgconfig for quartz; lets do a header check
AC_CHECK_HEADER(Carbon/Carbon.h, [use_quartz=yes], [use_quartz=no])
fi
AM_CONDITIONAL(CAIRO_HAS_QUARTZ_SURFACE, test "x$use_quartz" = "xyes")
if test "x$use_quartz" = "xyes"; then
QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
QUARTZ_LIBS="-Xlinker -framework -Xlinker Carbon"
fi
AC_SUBST(QUARTZ_SURFACE_FEATURE)
CAIRO_LIBS="$CAIRO_LIBS $QUARTZ_LIBS"
dnl ===========================================================================
AC_ARG_ENABLE(xcb,
[ --disable-xcb Disable cairo's XCB backend],
2005-03-03 20:16:23 +00:00
[use_xcb=$enableval], [use_xcb=yes])
if test "x$use_xcb" = "xyes"; then
PKG_CHECK_MODULES(XCB, xcb, [use_xcb=yes], [
use_xcb="no (requires XCB http://xcb.freedesktop.org)"])
fi
AM_CONDITIONAL(CAIRO_HAS_XCB_SURFACE, test "x$use_xcb" = "xyes")
if test "x$use_xcb" = "xyes"; then
XCB_SURFACE_FEATURE="#define CAIRO_HAS_XCB_SURFACE 1"
fi
AC_SUBST(XCB_SURFACE_FEATURE)
CAIRO_CFLAGS="$CAIRO_CFLAGS $XCB_CFLAGS"
CAIRO_LIBS="$CAIRO_LIBS $XCB_LIBS"
dnl ===========================================================================
AC_MSG_CHECKING([for some Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
cairo_platform_win32=yes
;;
*)
cairo_platform_win32=no
;;
esac
AC_MSG_RESULT([$cairo_platform_win32])
AC_ARG_ENABLE(win32,
[ --disable-win32 Disable cairo's Microsoft Windows backend],
[use_win32=$enableval], [use_win32="yes"])
if test "x$cairo_platform_win32" != "xyes" ; then
use_win32=no
fi
if test "x$use_win32" = "xyes"; then
CAIRO_LIBS="$CAIRO_LIBS -lgdi32 -lmsimg32"
fi
AM_CONDITIONAL(CAIRO_HAS_WIN32_SURFACE, test "x$use_win32" = "xyes")
if test "x$use_win32" = "xyes"; then
WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
fi
AC_SUBST(WIN32_SURFACE_FEATURE)
AM_CONDITIONAL(CAIRO_HAS_WIN32_FONT, test "x$use_win32" = "xyes")
if test "x$use_win32" = "xyes"; then
WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
fi
AC_SUBST(WIN32_FONT_FEATURE)
dnl ===========================================================================
AC_ARG_ENABLE(png,
[ --disable-png Disable cairo's PNG functions],
[use_png=$enableval], [use_png=yes])
if test "x$use_png" = "xyes"; then
use_png=no
# libpng13 is GnuWin32's libpng-1.2.8 :-(
for l in libpng12 libpng13 libpng10 ; do
if $PKG_CONFIG --exists $l ; then
PNG_REQUIRES=$l
use_png=yes
break
fi
done
if test "x$use_png" = "xyes" ; then
# Sets PNG_CFLAGS, PNG_LIBS
PKG_CHECK_MODULES(PNG, $PNG_REQUIRES)
else
AC_MSG_WARN([Could not find libpng in the pkg-config search path])
fi
fi
AM_CONDITIONAL(CAIRO_HAS_PNG_FUNCTIONS, test "x$use_png" = "xyes")
if test "x$use_png" = "xyes"; then
PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
else
AC_MSG_WARN("*** To run the tests, cairo must be built with png support ***)
fi
AC_SUBST(PNG_FUNCTIONS_FEATURE)
CAIRO_CFLAGS="$CAIRO_CFLAGS $PNG_CFLAGS"
CAIRO_LIBS="$CAIRO_LIBS $PNG_LIBS"
2004-02-24 12:39:29 +00:00
AC_SUBST(PNG_REQUIRES)
dnl ===========================================================================
AC_ARG_ENABLE(glitz,
[ --disable-glitz Disable cairo's glitz backend],
2005-03-03 20:16:23 +00:00
[use_glitz=$enableval], [use_glitz=yes])
if test "x$use_glitz" = "xyes"; then
PKG_CHECK_MODULES(GLITZ, glitz >= 0.4.4, [
GLITZ_REQUIRES=glitz
use_glitz=yes], [use_glitz="no (requires glitz http://freedesktop.org/Software/glitz)"])
2004-04-09 14:19:47 +00:00
fi
AM_CONDITIONAL(CAIRO_HAS_GLITZ_SURFACE, test "x$use_glitz" = "xyes")
if test "x$use_glitz" = "xyes"; then
GLITZ_SURFACE_FEATURE="#define CAIRO_HAS_GLITZ_SURFACE 1"
2004-04-09 14:19:47 +00:00
fi
AC_SUBST(GLITZ_SURFACE_FEATURE)
2004-04-09 14:19:47 +00:00
CAIRO_CFLAGS="$CAIRO_CFLAGS $GLITZ_CFLAGS"
CAIRO_LIBS="$CAIRO_LIBS $GLITZ_LIBS"
AC_SUBST(GLITZ_REQUIRES)
2004-04-09 14:19:47 +00:00
dnl ===========================================================================
PKG_CHECK_MODULES(PIXMAN, libpixman >= 0.1.5)
CAIRO_CFLAGS="$CAIRO_CFLAGS $PIXMAN_CFLAGS"
CAIRO_LIBS="$CAIRO_LIBS $PIXMAN_LIBS"
dnl ===========================================================================
AC_ARG_ENABLE(freetype,
[ --disable-freetype Disable cairo's freetype font backend],
[use_freetype=$enableval], [use_freetype=yes])
if test "x$use_freetype" = "xyes"; then
PKG_CHECK_MODULES(FONTCONFIG, fontconfig,
[use_freetype=yes], [use_freetype=no])
fi
CAIRO_CFLAGS="$CAIRO_CFLAGS $FONTCONFIG_CFLAGS"
CAIRO_LIBS="$CAIRO_LIBS $FONTCONFIG_LIBS"
# Test for freetype2 separate from pkg-config since at least up to
# 2003-06-07, there was no freetype2.pc in the release.
#
# Freetype versions come in three forms:
# release (such as 2.1.5)
# libtool (such as 9.4.3) (returned by freetype-config)
# platform-specific/soname (such as 6.3.4)
# and they recommend you never use the platform-specific version
# (see docs/VERSION.DLL in freetype2 sources)
#
# Set these as appropriate:
# release number - for information only
FREETYPE_MIN_RELEASE=2.1.0
# libtool-specific version - this is what is checked
FREETYPE_MIN_VERSION=8.0.2
if test "x$use_freetype" = "xyes"; then
if test -z "$FREETYPE_CONFIG"; then
AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
fi
if test "$FREETYPE_CONFIG" = "no" ; then
AC_MSG_ERROR(No freetype-config script found in path or FREETYPE_CONFIG)
fi
AC_MSG_CHECKING(freetype2 libtool version)
FREETYPE_VERSION=`$FREETYPE_CONFIG --version`
VERSION_DEC=`echo $FREETYPE_VERSION | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
MIN_VERSION_DEC=`echo $FREETYPE_MIN_VERSION | awk -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'`
if test $VERSION_DEC -lt $MIN_VERSION_DEC; then
AC_MSG_ERROR($FREETYPE_VERSION - version $FREETYPE_MIN_VERSION from release $FREETYPE_MIN_RELEASE required)
fi
AC_MSG_RESULT($FREETYPE_VERSION - OK)
FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
FREETYPE_REQUIRES=fontconfig
AC_SUBST(FREETYPE_CFLAGS)
AC_SUBST(FREETYPE_LIBS)
AC_SUBST(FREETYPE_REQUIRES)
fi
CAIRO_CFLAGS="$CAIRO_CFLAGS $FREETYPE_CFLAGS"
CAIRO_LIBS="$CAIRO_LIBS $FREETYPE_LIBS"
AM_CONDITIONAL(CAIRO_HAS_FT_FONT, test "x$use_freetype" = "xyes")
if test "x$use_freetype" = "xyes"; then
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
fi
AC_SUBST(FT_FONT_FEATURE)
dnl ===========================================================================
#
# The FreeType backend uses pthread locking when avaialble
#
AC_CHECK_HEADERS([pthread.h])
dnl ===========================================================================
2005-07-28 10:24:59 +00:00
AC_ARG_ENABLE(ps,
[ --disable-ps Disable cairo's PostScript backend],
[use_ps=$enableval], [use_ps=yes])
if test x"$use_freetype" != "xyes" ; then
AC_MSG_WARN([PS backend requires FreeType, disabling])
use_ps=no
fi
# The postscript module requires zlib.
AC_CHECK_LIB(z, compress,
[AC_CHECK_HEADER(zlib.h, [],
[use_ps="no (requires zlib http://www.gzip.org/zlib/)"])],
[use_ps="no (requires zlib http://www.gzip.org/zlib/)"])
AM_CONDITIONAL(CAIRO_HAS_PS_SURFACE, test "x$use_ps" = "xyes")
if test "x$use_ps" = "xyes"; then
PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
PS_LIBS=-lz
fi
AC_SUBST(PS_SURFACE_FEATURE)
CAIRO_LIBS="$CAIRO_LIBS $PS_LIBS"
AC_SUBST(PS_LIBS)
dnl ===========================================================================
AC_ARG_ENABLE(pdf,
[ --disable-pdf Disable cairo's PDF backend],
[use_pdf=$enableval], [use_pdf=yes])
if test x"$use_freetype" != "xyes" ; then
AC_MSG_WARN([PDF backend requires FreeType, disabling])
use_pdf=no
fi
AM_CONDITIONAL(CAIRO_HAS_PDF_SURFACE, test "x$use_pdf" = "xyes")
if test "x$use_pdf" = "xyes"; then
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
PDF_LIBS=-lz
fi
AC_SUBST(PDF_SURFACE_FEATURE)
CAIRO_LIBS="$CAIRO_LIBS $PDF_LIBS"
AC_SUBST(PDF_LIBS)
dnl ===========================================================================
dnl This check should default to 'yes' once we have code to actually
dnl check for the atsui font backend.
AC_ARG_ENABLE(atsui,
[ --disable-atsui Disable cairo's atsui font backend],
[use_atsui=$enableval], [use_atsui=yes])
if test "x$use_atsui" = "xyes"; then
dnl There is no pkgconfig for atsui; lets do a header check
AC_CHECK_HEADER(Carbon/Carbon.h, [use_atsui=yes], [use_atsui=no])
fi
AM_CONDITIONAL(CAIRO_HAS_ATSUI_FONT, test "x$use_atsui" = "xyes")
if test "x$use_atsui" = "xyes"; then
ATSUI_FONT_FEATURE="#define CAIRO_HAS_ATSUI_FONT 1"
fi
AC_SUBST(ATSUI_FONT_FEATURE)
dnl ===========================================================================
dnl Checks for precise integer types
AC_CHECK_HEADERS([stdint.h inttypes.h sys/int_types.h])
AC_CHECK_TYPES([uint64_t, uint128_t])
dnl Use lots of warning flags with GCC
WARN_CFLAGS=""
if test "x$GCC" = "xyes"; then
WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations \
-Wnested-externs -fno-strict-aliasing"
fi
CAIRO_CFLAGS="$CAIRO_CFLAGS $WARN_CFLAGS"
CAIRO_LIBS="$CAIRO_LIBS"
AC_SUBST(CAIRO_CFLAGS)
AC_SUBST(CAIRO_LIBS)
dnl ===========================================================================
dnl Check for gtk-doc and docbook
GTK_DOC_CHECK([1.3])
AC_OUTPUT([
2003-07-18 11:34:19 +00:00
cairo.pc
Makefile
src/Makefile
src/cairo-features.h
test/Makefile
doc/Makefile
doc/public/Makefile
])
dnl ===========================================================================
echo ""
echo "cairo will be compiled with the following surface backends:"
echo " Xlib: $use_xlib"
echo " Quartz: $use_quartz"
echo " XCB: $use_xcb"
echo " Win32: $use_win32"
echo " PostScript: $use_ps"
echo " PDF: $use_pdf"
echo " glitz: $use_glitz"
echo ""
echo "the following font backends:"
echo " FreeType: $use_freetype"
echo " Win32: $use_win32"
echo " ATSUI: $use_atsui"
echo ""
echo "and the following features:"
echo " PNG functions: $use_png"
if test x"$use_freetype" != "xyes" && \
test x"$use_win32" != "xyes" && \
test x"$use_atsui" != "xyes" ; then
AC_MSG_ERROR([Cairo requires at least one font backend.
Please install freetype and fontconfig, then try again:
http://freetype.org/ http://fontconfig.org/
])
fi