2008-01-11 14:04:56 +00:00
|
|
|
AC_PREREQ(2.58)
|
2005-01-27 15:46:16 +00:00
|
|
|
|
2006-10-25 16:06:42 -04:00
|
|
|
dnl cairo package version number, (as distinct from shared library version)
|
2007-09-04 11:35:40 -07:00
|
|
|
dnl For the minor number: odd => unstable series
|
|
|
|
|
dnl even => stable series
|
|
|
|
|
dnl For the micro number: odd => in-progress development (from git)
|
|
|
|
|
dnl even => tar-file snapshot or release
|
2005-08-24 09:29:39 +00:00
|
|
|
m4_define(cairo_version_major, 1)
|
2008-06-05 22:58:33 -04:00
|
|
|
m4_define(cairo_version_minor, 7)
|
|
|
|
|
m4_define(cairo_version_micro, 1)
|
2003-04-17 13:24:29 +00:00
|
|
|
|
2005-08-10 11:08:38 +00:00
|
|
|
AC_INIT([cairo],
|
|
|
|
|
cairo_version_major.cairo_version_minor.cairo_version_micro,
|
|
|
|
|
[http://bugs.freedesktop.org/enter_bug.cgi?product=cairo])
|
|
|
|
|
AC_CONFIG_SRCDIR(src/cairo.h)
|
|
|
|
|
AC_CONFIG_HEADERS(config.h)
|
2006-10-25 16:06:42 -04:00
|
|
|
|
|
|
|
|
dnl automake 1.8 requires autoconf 2.58
|
|
|
|
|
dnl automake 1.7 requires autoconf 2.54
|
2008-01-11 14:04:56 +00:00
|
|
|
dnl automake < 1.8 does not handle TESTS=some-test$(EXEXT) as used
|
|
|
|
|
dnl in test/Makefile.am and perf/Makefile.am
|
|
|
|
|
AM_INIT_AUTOMAKE([1.8])
|
2003-04-17 13:24:29 +00:00
|
|
|
|
2005-08-10 11:08:38 +00:00
|
|
|
dnl ===========================================================================
|
2003-04-17 13:24:29 +00:00
|
|
|
|
2003-04-25 13:34:00 +00:00
|
|
|
# libtool shared library version
|
2003-04-17 13:24:29 +00:00
|
|
|
|
2003-04-25 13:34:00 +00:00
|
|
|
# Increment if the interface has additions, changes, removals.
|
2008-06-05 22:58:33 -04:00
|
|
|
LT_CURRENT=20
|
2003-04-25 13:34:00 +00:00
|
|
|
|
|
|
|
|
# Increment any time the source changes; set to
|
|
|
|
|
# 0 if you increment CURRENT
|
2008-06-05 22:58:33 -04:00
|
|
|
LT_REVISION=0
|
2003-04-25 13:34:00 +00:00
|
|
|
|
|
|
|
|
# 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.
|
2008-06-05 22:58:33 -04:00
|
|
|
LT_AGE=18
|
2003-04-25 13:34:00 +00:00
|
|
|
|
2003-04-17 13:24:29 +00:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2005-08-10 11:08:38 +00:00
|
|
|
VERSION_INFO="$LT_CURRENT:$LT_REVISION:$LT_AGE"
|
|
|
|
|
AC_SUBST(VERSION_INFO)
|
2005-08-22 15:49:04 +00:00
|
|
|
|
|
|
|
|
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
|
|
|
|
|
AC_SUBST(LT_CURRENT_MINUS_AGE)
|
|
|
|
|
|
2005-08-10 11:08:38 +00:00
|
|
|
CAIRO_VERSION_MAJOR=cairo_version_major()
|
|
|
|
|
CAIRO_VERSION_MINOR=cairo_version_minor()
|
|
|
|
|
CAIRO_VERSION_MICRO=cairo_version_micro()
|
|
|
|
|
AC_SUBST(CAIRO_VERSION_MAJOR)
|
|
|
|
|
AC_SUBST(CAIRO_VERSION_MINOR)
|
|
|
|
|
AC_SUBST(CAIRO_VERSION_MICRO)
|
2003-04-17 13:24:29 +00:00
|
|
|
|
2007-04-12 02:29:33 +01:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2007-04-12 03:01:31 +01:00
|
|
|
AC_PATH_PROG(FIND, find)
|
|
|
|
|
AC_PATH_PROG(XARGS, xargs)
|
2007-04-12 02:29:33 +01:00
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2003-04-17 13:24:29 +00:00
|
|
|
AC_PROG_CC
|
|
|
|
|
AC_PROG_CPP
|
2007-04-16 02:48:14 -04:00
|
|
|
AC_LIBTOOL_WIN32_DLL
|
2006-10-25 16:06:42 -04:00
|
|
|
AC_PROG_LIBTOOL dnl required version (1.4) DON'T REMOVE!
|
2003-04-17 13:24:29 +00:00
|
|
|
AC_STDC_HEADERS
|
2006-12-17 14:09:15 -05:00
|
|
|
AC_C_INLINE
|
2008-03-13 17:45:25 -07:00
|
|
|
|
|
|
|
|
case $host_os in
|
2008-03-25 11:22:43 -07:00
|
|
|
darwin*)
|
2008-03-13 17:45:25 -07:00
|
|
|
AH_VERBATIM([X_BYTE_ORDER],[
|
|
|
|
|
/* Deal with multiple architecture compiles on Mac OS X */
|
|
|
|
|
#ifdef __APPLE_CC__
|
|
|
|
|
#ifdef __BIG_ENDIAN__
|
|
|
|
|
#define WORDS_BIGENDIAN 1
|
|
|
|
|
#define FLOAT_WORDS_BIGENDIAN 1
|
|
|
|
|
#else
|
|
|
|
|
#undef WORDS_BIGENDIAN
|
|
|
|
|
#undef FLOAT_WORDS_BIGENDIAN
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
])
|
2008-03-25 11:22:43 -07:00
|
|
|
;;
|
2008-03-13 17:45:25 -07:00
|
|
|
*)
|
2005-01-17 09:40:00 +00:00
|
|
|
AC_C_BIGENDIAN
|
2006-10-29 21:30:08 -08:00
|
|
|
AX_C_FLOAT_WORDS_BIGENDIAN
|
2008-03-13 17:45:25 -07:00
|
|
|
;;
|
|
|
|
|
esac
|
2003-04-17 13:24:29 +00:00
|
|
|
|
2005-08-03 10:32:50 +00:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
dnl === Local macros
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2006-10-25 16:06:42 -04:00
|
|
|
dnl _CHECK_FUNCS_WITH_FLAGS(FUNCTION..., CFLAGS, LIBS
|
|
|
|
|
dnl [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
|
|
|
dnl Like AC_CHECK_FUNCS but with additional CFLAGS and LIBS
|
|
|
|
|
dnl --------------------------------------------------------------------
|
2005-08-03 10:32:50 +00:00
|
|
|
AC_DEFUN([_CHECK_FUNCS_WITH_FLAGS],
|
|
|
|
|
[
|
|
|
|
|
save_cflags="$CFLAGS"
|
|
|
|
|
save_libs="$LIBS"
|
|
|
|
|
CFLAGS="$CFLAGS $2"
|
|
|
|
|
LIBS="$LIBS $3"
|
|
|
|
|
AC_CHECK_FUNCS($1, $4, $5)
|
|
|
|
|
CFLAGS="$save_cflags"
|
|
|
|
|
LIBS="$save_libs"
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2008-05-06 10:29:20 +01:00
|
|
|
AC_CHECK_LIBM
|
|
|
|
|
LIBS="$LIBS $LIBM"
|
|
|
|
|
|
2008-01-10 14:47:16 +00:00
|
|
|
AC_CHECK_FUNCS(vasnprintf ctime_r drand48)
|
2008-04-25 18:43:01 +01:00
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for Sun Solaris (non-POSIX ctime_r)])
|
|
|
|
|
case "$host" in
|
|
|
|
|
*-*-solaris*)
|
|
|
|
|
CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS"
|
|
|
|
|
solaris_posix_pthread=yes
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
solaris_posix_pthread=no
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
AC_MSG_RESULT([$solaris_posix_pthread])
|
|
|
|
|
|
2008-05-06 10:29:20 +01:00
|
|
|
# check for GNU-extensions to fenv
|
2008-05-06 11:31:14 +01:00
|
|
|
AC_CHECK_HEADER(fenv.h, [AC_CHECK_FUNCS(feenableexcept fedisableexcept)])
|
2008-05-06 10:29:20 +01:00
|
|
|
|
2007-09-21 10:45:55 +01:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
dnl
|
|
|
|
|
dnl Test for native atomic operations.
|
|
|
|
|
dnl
|
|
|
|
|
AC_MSG_CHECKING([for native atomic primitives])
|
|
|
|
|
cairo_atomic_primitives="none"
|
|
|
|
|
|
2007-09-25 21:58:24 +01:00
|
|
|
AC_TRY_LINK([int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); }], [],
|
2007-09-21 10:45:55 +01:00
|
|
|
AC_DEFINE(CAIRO_HAS_INTEL_ATOMIC_PRIMITIVES, 1, [Enable if your compiler supports the Intel __sync_* atomic primitives])
|
|
|
|
|
cairo_atomic_primitives="Intel"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
AC_MSG_RESULT([$cairo_atomic_primitives])
|
|
|
|
|
|
2007-10-25 10:24:01 +01:00
|
|
|
AC_MSG_CHECKING([whether atomic ops require a memory barrier])
|
|
|
|
|
case $host_cpu in
|
|
|
|
|
i?86)
|
|
|
|
|
cairo_atomic_op_needs_memory_barrier="no"
|
|
|
|
|
;;
|
2007-11-05 09:09:14 +00:00
|
|
|
x86_64)
|
|
|
|
|
cairo_atomic_op_needs_memory_barrier="no"
|
|
|
|
|
;;
|
|
|
|
|
arm*)
|
|
|
|
|
cairo_atomic_op_needs_memory_barrier="no"
|
|
|
|
|
;;
|
2007-10-25 10:24:01 +01:00
|
|
|
*)
|
|
|
|
|
cairo_atomic_op_needs_memory_barrier="yes"
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
if test "x$cairo_atomic_op_needs_memory_barrier" = "xyes"; then
|
|
|
|
|
AC_DEFINE_UNQUOTED(CAIRO_ATOMIC_OP_NEEDS_MEMORY_BARRIER, 1,
|
|
|
|
|
[whether Cairo needs memory barriers around atomic ops])
|
|
|
|
|
fi
|
|
|
|
|
AC_MSG_RESULT([$cairo_atomic_op_needs_memory_barrier])
|
|
|
|
|
|
2007-09-21 10:45:55 +01:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2006-08-10 13:10:24 -04:00
|
|
|
AC_CHECK_LIB(z, compress,
|
|
|
|
|
[AC_CHECK_HEADER(zlib.h, [have_libz=yes],
|
|
|
|
|
[have_libz="no (requires zlib http://www.gzip.org/zlib/)"])],
|
|
|
|
|
[have_libz="no (requires zlib http://www.gzip.org/zlib/)"])
|
|
|
|
|
|
2003-04-17 13:24:29 +00:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2006-11-28 19:41:52 -05:00
|
|
|
PKG_PROG_PKG_CONFIG()
|
2006-11-07 15:07:33 -05:00
|
|
|
if test "x$PKG_CONFIG" = x; then
|
|
|
|
|
AC_MSG_ERROR([pkg-config >= $PKGCONFIG_REQUIRED required but not found (http://pkgconfig.freedesktop.org/)])
|
|
|
|
|
fi
|
2005-10-04 13:48:25 +00:00
|
|
|
|
2007-06-13 00:15:34 -04:00
|
|
|
|
2006-08-10 12:44:35 -04:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
dnl
|
|
|
|
|
dnl cairo_cache_version should be increased every time that the backend
|
|
|
|
|
dnl detection stuff changes in a way that removing the config.cache file may be
|
2006-09-02 19:51:54 -04:00
|
|
|
dnl needed for correct operation. (this is only for the backend detection
|
|
|
|
|
dnl changes; it doesn't have any effect on any other cached thing.)
|
2006-08-10 12:44:35 -04:00
|
|
|
dnl
|
2006-08-28 18:54:35 -07:00
|
|
|
m4_define(cairo_cache_version, 4)
|
2006-08-10 12:44:35 -04:00
|
|
|
|
2005-10-04 13:48:25 +00:00
|
|
|
dnl ===========================================================================
|
2006-04-25 07:30:16 -04:00
|
|
|
dnl
|
|
|
|
|
dnl Define a macro to enable backends.
|
2006-06-25 17:43:27 +02:00
|
|
|
dnl - Macro: CAIRO_BACKEND_ENABLE (NAMESPACE, NAME, ARG, FEATURE_NAME, DEFAULT, COMMANDS)
|
2006-04-25 07:30:16 -04:00
|
|
|
dnl
|
2006-06-21 07:00:34 -04:00
|
|
|
dnl where:
|
2006-04-25 07:30:16 -04:00
|
|
|
dnl
|
2006-06-21 07:00:34 -04:00
|
|
|
dnl NAMESPACE is the sub-namespace in function names, eg. "ft" for cairo_ft_...
|
|
|
|
|
dnl NAME is the human-readable name of the backend, eg. "FreeType font"
|
|
|
|
|
dnl ARG is what enables the backend, eg. "freetype" for --enable-freetype
|
|
|
|
|
dnl FEATURE_NAME is what's used in cairo-features.h, eg. FT_FONT for CAIRO_HAS_FT_FONT
|
|
|
|
|
dnl DEFAULT is the default state of the backend:
|
|
|
|
|
dnl "no" for experimental backends, eg. your favorite new backend
|
|
|
|
|
dnl "yes" for mandatory backends, eg. png
|
|
|
|
|
dnl "auto" for other supported backends, eg. xlib
|
|
|
|
|
dnl COMMANDS are run to check whether the backend can be enabled. Their
|
|
|
|
|
dnl result may be cached, so user should not count on them being run.
|
|
|
|
|
dnl They should set use_$(NAMESPACE) to something other than yes if the
|
2006-07-31 16:05:34 -04:00
|
|
|
dnl backend cannot be built, eg. "no (requires SomeThing)". It then
|
|
|
|
|
dnl should also set $(NAMESPACE)_REQUIRES/CFLAGS/LIBS/...
|
|
|
|
|
dnl appropriately. Look at the macro definition for more details,
|
|
|
|
|
dnl or ask if in doubt.
|
2006-06-13 22:37:34 -04:00
|
|
|
dnl
|
2006-04-25 07:30:16 -04:00
|
|
|
AC_DEFUN([CAIRO_BACKEND_ENABLE],
|
2006-06-21 07:00:34 -04:00
|
|
|
[AC_ARG_ENABLE([$3],
|
|
|
|
|
AS_HELP_STRING([--enable-$3=@<:@no/auto/yes@:>@],
|
|
|
|
|
[Enable cairo's $2 backend @<:@default=$5@:>@]),
|
2006-06-25 17:43:27 +02:00
|
|
|
enable_$1=$enableval, enable_$1=$5)
|
|
|
|
|
if test "x$enable_$1" = xno; then
|
2006-06-21 07:00:34 -04:00
|
|
|
use_$1="no (disabled, use --enable-$3 to enable)"
|
2006-04-25 08:26:35 -04:00
|
|
|
else
|
2006-08-10 12:44:35 -04:00
|
|
|
if test "x$cairo_cv_backend_[]$1[]_cache_version" != "x[]cairo_cache_version"; then
|
|
|
|
|
# cached results for this backend (if any) are stale. force rechecking.
|
|
|
|
|
unset cairo_cv_backend_[]$1[]_use
|
|
|
|
|
fi
|
2006-06-25 17:43:27 +02:00
|
|
|
AC_CACHE_CHECK([for cairo's $2 backend], cairo_cv_backend_[]$1[]_use,
|
2006-04-25 07:30:16 -04:00
|
|
|
[echo
|
2006-06-25 17:43:27 +02:00
|
|
|
use_[]$1=yes
|
2006-08-11 13:06:37 -04:00
|
|
|
$1[]_REQUIRES=$ac_env_[]$1[]_REQUIRES_value
|
|
|
|
|
$1[]_CFLAGS=$ac_env_[]$1[]_CFLAGS_value
|
|
|
|
|
$1[]_LIBS=$ac_env_[]$1[]_LIBS_value
|
|
|
|
|
$1[]_NONPKGCONFIG_CFLAGS=$ac_env_[]$1[]_NONPKGCONFIG_CFLAGS_value
|
|
|
|
|
$1[]_NONPKGCONFIG_LIBS=$ac_env_[]$1[]_NONPKGCONFIG_LIBS_value
|
2006-07-12 04:27:55 -04:00
|
|
|
$1[]_BASE=cairo
|
2006-06-25 17:43:27 +02:00
|
|
|
$6
|
|
|
|
|
cairo_cv_backend_[]$1[]_use=$use_[]$1
|
2006-08-10 12:44:35 -04:00
|
|
|
cairo_cv_backend_[]$1[]_cache_version=cairo_cache_version
|
2006-06-25 17:43:27 +02:00
|
|
|
cairo_cv_backend_[]$1[]_requires=$[]$1[]_REQUIRES
|
|
|
|
|
cairo_cv_backend_[]$1[]_cflags=$[]$1[]_CFLAGS
|
|
|
|
|
cairo_cv_backend_[]$1[]_libs=$[]$1[]_LIBS
|
2006-06-29 16:09:46 +02:00
|
|
|
cairo_cv_backend_[]$1[]_nonpkgconfig_cflags=$[]$1[]_NONPKGCONFIG_CFLAGS
|
|
|
|
|
cairo_cv_backend_[]$1[]_nonpkgconfig_libs=$[]$1[]_NONPKGCONFIG_LIBS
|
2006-07-12 04:27:55 -04:00
|
|
|
cairo_cv_backend_[]$1[]_base=$[]$1[]_BASE
|
2006-06-21 07:00:34 -04:00
|
|
|
AC_MSG_CHECKING([whether cairo's $2 backend could be enabled])])
|
2006-06-25 17:43:27 +02:00
|
|
|
|
|
|
|
|
use_[]$1=$cairo_cv_backend_[]$1[]_use
|
2006-07-12 04:27:55 -04:00
|
|
|
$1[]_BASE=$cairo_cv_backend_[]$1[]_base
|
|
|
|
|
|
|
|
|
|
$1[]_REQUIRES="$cairo_cv_backend_[]$1[]_requires "
|
|
|
|
|
$1[]_CFLAGS="$cairo_cv_backend_[]$1[]_cflags "
|
|
|
|
|
$1[]_LIBS="$cairo_cv_backend_[]$1[]_libs "
|
|
|
|
|
$1[]_NONPKGCONFIG_CFLAGS="$cairo_cv_backend_[]$1[]_nonpkgconfig_cflags "
|
|
|
|
|
$1[]_NONPKGCONFIG_LIBS="$cairo_cv_backend_[]$1[]_nonpkgconfig_libs "
|
|
|
|
|
|
|
|
|
|
# null the ones that only have space
|
|
|
|
|
test "x$$1[]_REQUIRES" = "x " && $1[]_REQUIRES=""
|
|
|
|
|
test "x$$1[]_CFLAGS" = "x " && $1[]_CFLAGS=""
|
|
|
|
|
test "x$$1[]_LIBS" = "x " && $1[]_LIBS=""
|
|
|
|
|
test "x$$1[]_NONPKGCONFIG_CFLAGS" = "x " && $1[]_NONPKGCONFIG_CFLAGS=""
|
|
|
|
|
test "x$$1[]_NONPKGCONFIG_LIBS" = "x " && $1[]_NONPKGCONFIG_LIBS=""
|
2006-06-25 17:43:27 +02:00
|
|
|
|
|
|
|
|
case $enable_[]$1 in
|
2006-04-25 07:30:16 -04:00
|
|
|
yes)
|
2006-06-25 17:43:27 +02:00
|
|
|
AS_IF([test "x$use_[]$1" = xyes],,[
|
2006-06-13 22:37:34 -04:00
|
|
|
AC_MSG_ERROR([requested $2 backend could not be enabled])
|
2006-06-25 17:43:27 +02:00
|
|
|
])
|
2006-04-25 07:30:16 -04:00
|
|
|
;;
|
|
|
|
|
auto)
|
|
|
|
|
;;
|
|
|
|
|
*)
|
2006-06-21 07:00:34 -04:00
|
|
|
AC_MSG_ERROR([invalid argument passed to --enable-$3: $use_$1, should be one of @<:@no/auto/yes@:>@])
|
2006-04-25 07:30:16 -04:00
|
|
|
;;
|
|
|
|
|
esac
|
2006-06-25 17:43:27 +02:00
|
|
|
if test "x$use_[]$1" = xyes; then
|
2006-07-12 04:27:55 -04:00
|
|
|
CAIRO_FEATURES="$4 $CAIRO_FEATURES"
|
|
|
|
|
CAIRO_REQUIRES="$$1_REQUIRES$CAIRO_REQUIRES"
|
|
|
|
|
CAIRO_CFLAGS="$$1_NONPKGCONFIG_CFLAGS$$1_CFLAGS$CAIRO_CFLAGS"
|
|
|
|
|
CAIRO_LIBS="$$1_NONPKGCONFIG_LIBS$$1_LIBS$CAIRO_LIBS"
|
|
|
|
|
CAIRO_NONPKGCONFIG_CFLAGS="$$1_NONPKGCONFIG_CFLAGS$CAIRO_NONPKGCONFIG_CFLAGS"
|
|
|
|
|
CAIRO_NONPKGCONFIG_LIBS="$$1_NONPKGCONFIG_LIBS$CAIRO_NONPKGCONFIG_LIBS"
|
2006-06-21 07:00:34 -04:00
|
|
|
outfile=`echo src/cairo-$1.pc | sed -e s/_/-/g`
|
|
|
|
|
AC_MSG_NOTICE([creating $outfile])
|
2006-06-21 06:25:01 -04:00
|
|
|
mkdir -p src
|
2006-06-13 22:37:34 -04:00
|
|
|
AS_IF([sed \
|
2006-06-26 12:21:18 +02:00
|
|
|
-e "s,@backend_name@,$1,g" \
|
|
|
|
|
-e "s,@Backend_Name@,$2,g" \
|
2006-07-12 04:27:55 -04:00
|
|
|
-e "s,@BACKEND_BASE@,$$1_BASE,g" \
|
2006-06-26 12:21:18 +02:00
|
|
|
-e "s,@BACKEND_REQUIRES@,$$1_REQUIRES,g" \
|
2006-06-29 16:09:46 +02:00
|
|
|
-e "s%@BACKEND_NONPKGCONFIG_LIBS@%$$1_NONPKGCONFIG_LIBS%g" \
|
|
|
|
|
-e "s,@BACKEND_NONPKGCONFIG_CFLAGS@,$$1_NONPKGCONFIG_CFLAGS,g" \
|
2006-06-13 22:37:34 -04:00
|
|
|
-e "s,@prefix@,$prefix,g" \
|
|
|
|
|
-e "s,@exec_prefix@,$exec_prefix,g" \
|
|
|
|
|
-e "s,@libdir@,$libdir,g" \
|
|
|
|
|
-e "s,@includedir@,$includedir,g" \
|
|
|
|
|
-e "s,@VERSION@,$VERSION,g" \
|
2006-06-21 07:00:34 -04:00
|
|
|
$srcdir/src/cairo-backend.pc.in > $outfile],,[
|
|
|
|
|
rm -f "$outfile"
|
|
|
|
|
AC_MSG_ERROR([failed creating $outfile])
|
2006-06-13 22:37:34 -04:00
|
|
|
])
|
2008-01-28 23:05:00 -05:00
|
|
|
else
|
|
|
|
|
CAIRO_NO_FEATURES="$4 $CAIRO_NO_FEATURES"
|
2006-06-13 22:37:34 -04:00
|
|
|
fi
|
2006-06-21 06:25:01 -04:00
|
|
|
fi
|
|
|
|
|
AM_CONDITIONAL(CAIRO_HAS_$4, test "x$use_$1" = xyes)
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
CAIRO_FEATURES=""
|
2008-01-28 23:05:00 -05:00
|
|
|
CAIRO_NO_FEATURES=""
|
2006-06-25 17:43:27 +02:00
|
|
|
CAIRO_REQUIRES=""
|
2006-07-12 04:27:55 -04:00
|
|
|
CAIRO_NONPKGCONFIG_CFLAGS=""
|
2006-08-10 12:45:35 -04:00
|
|
|
CAIRO_NONPKGCONFIG_LIBS="$LIBM"
|
2007-04-04 10:13:13 +01:00
|
|
|
CAIRO_LDADD=""
|
2006-07-12 04:27:55 -04:00
|
|
|
CAIRO_CFLAGS=$CAIRO_NONPKGCONFIG_CFLAGS
|
|
|
|
|
CAIRO_LIBS=$CAIRO_NONPKGCONFIG_LIBS
|
2007-06-13 00:15:34 -04:00
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2008-03-31 12:17:39 -07:00
|
|
|
PIXMAN_VERSION="0.10.0"
|
2007-08-06 19:24:31 -04:00
|
|
|
PIXMAN_REQUIRES="pixman-1 >= $PIXMAN_VERSION"
|
|
|
|
|
PKG_CHECK_MODULES(pixman, $PIXMAN_REQUIRES, ,
|
|
|
|
|
[AC_MSG_ERROR([pixman >= $PIXMAN_VERSION is required
|
2007-10-30 13:13:29 -07:00
|
|
|
(http://cairographics.org/releases/)])])
|
2007-06-13 00:15:34 -04:00
|
|
|
|
2007-07-31 17:52:13 -04:00
|
|
|
CAIRO_REQUIRES="$PIXMAN_REQUIRES $CAIRO_REQUIRES"
|
2007-08-06 19:24:31 -04:00
|
|
|
CAIRO_CFLAGS="$pixman_CFLAGS $CAIRO_CFLAGS"
|
|
|
|
|
CAIRO_LIBS="$pixman_LIBS $CAIRO_LIBS"
|
2005-10-04 13:48:25 +00:00
|
|
|
|
2006-04-25 07:30:16 -04:00
|
|
|
dnl ===========================================================================
|
2003-04-17 13:24:29 +00:00
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
CAIRO_BACKEND_ENABLE(xlib, Xlib, xlib, XLIB_SURFACE, auto, [
|
2006-08-18 17:17:28 -04:00
|
|
|
xlib_REQUIRES="x11"
|
|
|
|
|
PKG_CHECK_MODULES(xlib, $xlib_REQUIRES, ,
|
2007-01-21 15:11:31 -05:00
|
|
|
[AC_MSG_RESULT(no)
|
|
|
|
|
xlib_REQUIRES=""
|
2006-08-18 17:17:28 -04:00
|
|
|
AC_PATH_XTRA
|
|
|
|
|
if test "x$no_x" = xyes; then
|
|
|
|
|
use_xlib="no (requires X development libraries)"
|
|
|
|
|
else
|
|
|
|
|
xlib_NONPKGCONFIG_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
|
|
|
|
|
xlib_NONPKGCONFIG_CFLAGS=$X_CFLAGS
|
|
|
|
|
fi])
|
2006-04-25 07:30:16 -04:00
|
|
|
])
|
2004-04-09 14:14:56 +00:00
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
CAIRO_BACKEND_ENABLE(xlib_xrender, Xlib Xrender, xlib-xrender, XLIB_XRENDER_SURFACE, auto, [
|
2006-08-18 17:02:24 -04:00
|
|
|
if test "x$use_xlib" != "xyes"; then
|
|
|
|
|
use_xlib_xrender="no (requires --enable-xlib)"
|
|
|
|
|
else
|
2006-06-26 12:21:18 +02:00
|
|
|
dnl Check for Xrender header files if the Xrender package is not installed:
|
2006-07-12 04:27:55 -04:00
|
|
|
xlib_xrender_BASE=cairo-xlib
|
2006-06-25 17:43:27 +02:00
|
|
|
xlib_xrender_REQUIRES="xrender >= 0.6"
|
|
|
|
|
PKG_CHECK_MODULES(xlib_xrender, $xlib_xrender_REQUIRES, ,
|
2007-01-21 15:11:31 -05:00
|
|
|
[AC_MSG_RESULT(no)
|
|
|
|
|
xlib_xrender_REQUIRES=""
|
2007-09-05 00:26:56 -04:00
|
|
|
old_CPPFLAGS=$CPPFLAGS
|
|
|
|
|
CPPFLAGS="$CPPFLAGS $xlib_CFLAGS $xlib_NONPKGCONFIG_CFLAGS"
|
2006-06-25 17:43:27 +02:00
|
|
|
AC_CHECK_HEADER(X11/extensions/Xrender.h,
|
2006-08-18 17:02:24 -04:00
|
|
|
[xlib_xrender_NONPKGCONFIG_LIBS="-lXrender"],
|
2007-09-05 00:26:56 -04:00
|
|
|
[use_xlib_xrender="no (requires Xrender http://freedesktop.org/Software/xlibs)"])
|
|
|
|
|
CPPFLAGS=$old_CPPFLAGS
|
|
|
|
|
])
|
2006-06-25 17:43:27 +02:00
|
|
|
fi
|
|
|
|
|
])
|
2004-10-26 14:38:43 +00:00
|
|
|
|
2006-06-21 06:25:01 -04:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2006-10-12 20:17:22 -07:00
|
|
|
CAIRO_BACKEND_ENABLE(xcb, XCB, xcb, XCB_SURFACE, no, [
|
|
|
|
|
xcb_REQUIRES="xcb >= 0.9.92 xcb-render >= 0.9.92 xcb-renderutil"
|
2007-01-21 15:11:31 -05:00
|
|
|
PKG_CHECK_MODULES(xcb, $xcb_REQUIRES, , [AC_MSG_RESULT(no)
|
2006-10-12 20:17:22 -07:00
|
|
|
use_xcb="no (requires XCB http://xcb.freedesktop.org)"])
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2008-04-01 15:24:48 -07:00
|
|
|
CAIRO_BACKEND_ENABLE(quartz, Quartz, quartz, QUARTZ_SURFACE, auto, [
|
2007-03-05 23:19:24 +00:00
|
|
|
dnl There is no pkgconfig for quartz; lets do a header check
|
2008-03-20 13:24:48 -07:00
|
|
|
AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h, , [use_quartz="no (ApplicationServices framework not found)"])
|
|
|
|
|
if test "x$use_quartz" != "xyes" ; then
|
|
|
|
|
dnl check for CoreGraphics as a separate framework
|
|
|
|
|
AC_CHECK_HEADER(CoreGraphics/CoreGraphics.h, , [use_quartz="no (CoreGraphics framework not found)"])
|
|
|
|
|
quartz_LIBS="-Xlinker -framework -Xlinker CoreGraphics"
|
|
|
|
|
else
|
|
|
|
|
quartz_LIBS="-Xlinker -framework -Xlinker ApplicationServices"
|
|
|
|
|
fi
|
2006-04-25 07:30:16 -04:00
|
|
|
])
|
2005-01-20 20:41:40 +00:00
|
|
|
|
2008-03-17 17:37:19 -07:00
|
|
|
CAIRO_BACKEND_ENABLE(quartz_font, Quartz font, quartz-font, QUARTZ_FONT, auto, [
|
|
|
|
|
use_quartz_font=$use_quartz
|
|
|
|
|
])
|
|
|
|
|
|
2008-03-07 14:49:15 -08:00
|
|
|
CAIRO_BACKEND_ENABLE(quartz_image, Quartz Image, quartz-image, QUARTZ_IMAGE_SURFACE, no, [
|
2008-03-17 17:37:19 -07:00
|
|
|
use_quartz_image=$use_quartz
|
2008-03-07 14:49:15 -08:00
|
|
|
])
|
|
|
|
|
|
2003-12-12 11:44:16 +00:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2007-02-20 00:57:25 -05:00
|
|
|
AC_MSG_CHECKING([for native Win32])
|
|
|
|
|
case "$host" in
|
|
|
|
|
*-*-mingw*)
|
|
|
|
|
cairo_os_win32=yes
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
cairo_os_win32=no
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
AC_MSG_RESULT([$cairo_os_win32])
|
|
|
|
|
AM_CONDITIONAL(OS_WIN32, test "$cairo_os_win32" = "yes")
|
|
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS([windows.h], have_windows=yes, have_windows=no)
|
|
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
CAIRO_BACKEND_ENABLE(win32, Microsoft Windows, win32, WIN32_SURFACE, auto, [
|
2007-02-20 00:57:25 -05:00
|
|
|
if test "x$have_windows" != xyes; then
|
|
|
|
|
use_win32="no (requires a Win32 platform)"
|
|
|
|
|
fi
|
2006-06-25 17:43:27 +02:00
|
|
|
win32_LIBS="-lgdi32 -lmsimg32"
|
2006-04-25 07:30:16 -04:00
|
|
|
])
|
2005-01-31 16:11:37 +00:00
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
CAIRO_BACKEND_ENABLE(win32_font, Microsoft Windows font, win32-font, WIN32_FONT, auto, [
|
2007-02-20 00:57:25 -05:00
|
|
|
use_win32_font=$use_win32
|
2006-06-21 06:25:01 -04:00
|
|
|
])
|
2005-01-31 16:11:37 +00:00
|
|
|
|
2008-01-10 15:30:42 +00:00
|
|
|
test_win32_printing=no
|
|
|
|
|
if test "x$use_win32" = "xyes"; then
|
|
|
|
|
AC_CHECK_PROG(GS, gs, gs)
|
|
|
|
|
if test "$GS"; then
|
|
|
|
|
AC_DEFINE([CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE], 1, [Define to 1 if the Win32 Printing backend can be tested (needs ghostscript)])
|
|
|
|
|
test_win32_printing="yes"
|
|
|
|
|
else
|
|
|
|
|
AC_MSG_WARN([Win32 Printing backend will not be tested since ghostscript is not available])
|
|
|
|
|
test_win32_printing="no (requires ghostscript)"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AM_CONDITIONAL(CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE, test "x$test_win32_printing" = "xyes")
|
|
|
|
|
|
2005-12-18 17:20:06 +00:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2006-09-15 11:18:47 +02:00
|
|
|
CAIRO_BACKEND_ENABLE(os2, OS/2, os2, OS2_SURFACE, no, [
|
|
|
|
|
case "$host" in
|
|
|
|
|
*-*-os2*)
|
|
|
|
|
:
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
use_os2="no (requires an OS/2 platform)"
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
CAIRO_BACKEND_ENABLE(beos, BeOS/Zeta, beos, BEOS_SURFACE, no, [
|
2006-04-25 07:30:16 -04:00
|
|
|
case "$host" in
|
|
|
|
|
*-*-beos)
|
2006-06-25 17:43:27 +02:00
|
|
|
dnl Add libbe and libzeta if available
|
|
|
|
|
AC_CHECK_LIB(be,main,beos_LIBS="$beos_LIBS -lbe")
|
|
|
|
|
AC_CHECK_LIB(zeta,main,beos_LIBS="$beos_LIBS -lzeta")
|
2006-04-25 07:30:16 -04:00
|
|
|
;;
|
|
|
|
|
*)
|
2006-06-21 07:00:34 -04:00
|
|
|
use_beos="no (requires a BeOS platform)"
|
2006-04-25 07:30:16 -04:00
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
])
|
2005-12-18 17:20:06 +00:00
|
|
|
|
|
|
|
|
if test "x$use_beos" = "xyes"; then
|
|
|
|
|
AC_PROG_CXX
|
|
|
|
|
fi
|
|
|
|
|
|
2005-01-31 16:11:37 +00:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
CAIRO_BACKEND_ENABLE(png, PNG, png, PNG_FUNCTIONS, yes, [
|
2005-01-31 16:11:37 +00:00
|
|
|
use_png=no
|
2006-08-11 13:06:37 -04:00
|
|
|
AC_ARG_VAR([png_REQUIRES], [module name for libpng to search for using pkg-config])
|
|
|
|
|
if test "x$png_REQUIRES" = x; then
|
|
|
|
|
# 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
|
|
|
|
|
else
|
|
|
|
|
use_png=yes
|
|
|
|
|
fi
|
2005-01-31 16:11:37 +00:00
|
|
|
|
|
|
|
|
if test "x$use_png" = "xyes" ; then
|
2007-01-21 15:11:31 -05:00
|
|
|
PKG_CHECK_MODULES(png, $png_REQUIRES, , AC_MSG_RESULT(no))
|
2005-01-31 16:11:37 +00:00
|
|
|
else
|
|
|
|
|
AC_MSG_WARN([Could not find libpng in the pkg-config search path])
|
|
|
|
|
fi
|
2006-04-25 07:30:16 -04:00
|
|
|
])
|
2004-02-24 12:27:52 +00:00
|
|
|
|
2005-05-06 21:33:22 +00:00
|
|
|
if test "x$use_png" = "xyes"; then
|
2006-06-21 06:25:01 -04:00
|
|
|
:
|
2005-07-28 10:43:27 +00:00
|
|
|
else
|
2005-10-08 10:50:08 +00:00
|
|
|
AC_MSG_WARN([*** To run the tests, cairo must be built with png support ***])
|
2004-02-24 12:27:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2006-06-21 07:00:34 -04:00
|
|
|
GLITZ_MIN_VERSION=0.5.1
|
2006-06-25 17:43:27 +02:00
|
|
|
CAIRO_BACKEND_ENABLE(glitz, glitz, glitz, GLITZ_SURFACE, no, [
|
|
|
|
|
glitz_REQUIRES="glitz >= $GLITZ_MIN_VERSION"
|
2007-01-21 15:11:31 -05:00
|
|
|
PKG_CHECK_MODULES(glitz, $glitz_REQUIRES, , [AC_MSG_RESULT(no)
|
2006-06-25 17:43:27 +02:00
|
|
|
use_glitz="no (requires glitz http://freedesktop.org/Software/glitz)"])
|
2006-04-25 07:30:16 -04:00
|
|
|
])
|
2004-04-09 14:19:47 +00:00
|
|
|
|
2005-12-12 11:56:40 +00:00
|
|
|
if test "x$use_glitz" = "xyes";then
|
2006-06-21 07:00:34 -04:00
|
|
|
PKG_CHECK_MODULES(GLITZ_AGL, glitz-agl >= $GLITZ_MIN_VERSION,
|
2007-01-21 15:11:31 -05:00
|
|
|
[have_glitz_agl=yes], [have_glitz_agl=no; AC_MSG_RESULT(no)])
|
2006-06-21 07:00:34 -04:00
|
|
|
PKG_CHECK_MODULES(GLITZ_EGL, glitz-egl >= $GLITZ_MIN_VERSION,
|
2007-01-21 15:11:31 -05:00
|
|
|
[have_glitz_egl=yes], [have_glitz_egl=no; AC_MSG_RESULT(no)])
|
2006-06-21 07:00:34 -04:00
|
|
|
PKG_CHECK_MODULES(GLITZ_GLX, glitz-glx >= $GLITZ_MIN_VERSION,
|
2007-01-21 15:11:31 -05:00
|
|
|
[have_glitz_glx=yes], [have_glitz_glx=no; AC_MSG_RESULT(no)])
|
2006-06-21 07:00:34 -04:00
|
|
|
PKG_CHECK_MODULES(GLITZ_WGL, glitz-wgl >= $GLITZ_MIN_VERSION,
|
2007-01-21 15:11:31 -05:00
|
|
|
[have_glitz_wgl=yes], [have_glitz_wgl=no; AC_MSG_RESULT(no)])
|
2005-12-12 11:56:40 +00:00
|
|
|
|
|
|
|
|
if test "x$have_glitz_agl" = "xyes";then
|
|
|
|
|
AC_DEFINE(CAIRO_CAN_TEST_GLITZ_AGL_SURFACE, 1, [define if glitz backend can be tested against agl])
|
|
|
|
|
fi
|
|
|
|
|
if test "x$have_glitz_egl" = "xyes";then
|
|
|
|
|
AC_DEFINE(CAIRO_CAN_TEST_GLITZ_EGL_SURFACE, 1, [define if glitz backend can be tested against egl])
|
|
|
|
|
fi
|
|
|
|
|
if test "x$have_glitz_glx" = "xyes";then
|
|
|
|
|
AC_DEFINE(CAIRO_CAN_TEST_GLITZ_GLX_SURFACE, 1, [define if glitz backend can be tested against glx])
|
|
|
|
|
fi
|
|
|
|
|
if test "x$have_glitz_wgl" = "xyes";then
|
|
|
|
|
AC_DEFINE(CAIRO_CAN_TEST_GLITZ_WGL_SURFACE, 1, [define if glitz backend can be tested against wgl])
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AM_CONDITIONAL(CAIRO_CAN_TEST_GLITZ_AGL_SURFACE, test "x$have_glitz_agl" = "xyes")
|
|
|
|
|
AM_CONDITIONAL(CAIRO_CAN_TEST_GLITZ_EGL_SURFACE, test "x$have_glitz_egl" = "xyes")
|
|
|
|
|
AM_CONDITIONAL(CAIRO_CAN_TEST_GLITZ_GLX_SURFACE, test "x$have_glitz_glx" = "xyes")
|
|
|
|
|
AM_CONDITIONAL(CAIRO_CAN_TEST_GLITZ_WGL_SURFACE, test "x$have_glitz_wgl" = "xyes")
|
|
|
|
|
|
2004-04-09 14:19:47 +00:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
CAIRO_BACKEND_ENABLE(directfb, directfb, directfb, DIRECTFB_SURFACE, no, [
|
|
|
|
|
directfb_REQUIRES=directfb
|
2007-01-21 15:11:31 -05:00
|
|
|
PKG_CHECK_MODULES(directfb, $directfb_REQUIRES, , AC_MSG_RESULT(no)
|
2006-06-25 17:43:27 +02:00
|
|
|
[use_directfb="no (requires directfb http://www.directfb.org)"])
|
2006-04-25 07:30:16 -04:00
|
|
|
])
|
2005-12-29 07:17:01 +00:00
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2005-08-17 15:57:45 +00:00
|
|
|
# We use pkg-config to look for freetype2, but fall back to
|
|
|
|
|
# freetype-config if it fails. We prefer pkg-config, since we can
|
|
|
|
|
# then just put freetype2 >= $FREETYPE_MIN_VERSION in
|
|
|
|
|
# Requires.private, but at least up to 2003-06-07, there was no
|
|
|
|
|
# freetype2.pc in the release.
|
2003-11-08 10:28:04 +00:00
|
|
|
#
|
2006-06-21 07:00:34 -04:00
|
|
|
# FreeType versions come in three forms:
|
2007-12-01 20:41:55 -05:00
|
|
|
# release (such as 2.1.9)
|
|
|
|
|
# libtool (such as 9.7.3) (returned by freetype-config and pkg-config)
|
2003-11-08 10:28:04 +00:00
|
|
|
# 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
|
2007-12-01 20:41:55 -05:00
|
|
|
FREETYPE_MIN_RELEASE=2.1.9
|
2003-11-18 13:21:29 +00:00
|
|
|
# libtool-specific version - this is what is checked
|
2007-12-01 20:41:55 -05:00
|
|
|
FREETYPE_MIN_VERSION=9.7.3
|
2003-11-08 10:28:04 +00:00
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
CAIRO_BACKEND_ENABLE(ft, FreeType font, freetype, FT_FONT, auto, [
|
|
|
|
|
ft_REQUIRES="fontconfig"
|
2008-05-28 12:01:38 -04:00
|
|
|
PKG_CHECK_MODULES(FONTCONFIG, $ft_REQUIRES,,
|
2008-01-10 17:23:56 +00:00
|
|
|
[AC_MSG_RESULT(no); use_ft="no (requires fontconfig)"])
|
2003-11-08 10:28:04 +00:00
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
if test "x$use_ft" = "xyes"; then
|
2008-05-28 12:01:38 -04:00
|
|
|
|
|
|
|
|
_CHECK_FUNCS_WITH_FLAGS(FcFini, [$FONTCONFIG_CFLAGS], [$FONTCONFIG_LIBS])
|
|
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
PKG_CHECK_MODULES(FREETYPE, freetype2 >= $FREETYPE_MIN_VERSION,
|
2007-01-21 15:11:31 -05:00
|
|
|
[freetype_pkgconfig=yes],
|
|
|
|
|
[AC_MSG_RESULT(no)
|
|
|
|
|
freetype_pkgconfig=no])
|
2005-08-17 15:57:45 +00:00
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
if test "x$freetype_pkgconfig" = "xyes"; then
|
|
|
|
|
ft_REQUIRES="freetype2 >= $FREETYPE_MIN_VERSION $ft_REQUIRES"
|
|
|
|
|
else
|
2005-08-17 15:57:45 +00:00
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
if test -z "$FREETYPE_CONFIG"; then
|
|
|
|
|
AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
|
|
|
|
|
fi
|
|
|
|
|
if test "x$FREETYPE_CONFIG" = "xno" ; then
|
|
|
|
|
use_ft='no (freetype-config not found in path or $FREETYPE_CONFIG)'
|
2005-08-18 17:22:23 +00:00
|
|
|
else
|
2006-06-25 17:43:27 +02:00
|
|
|
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_RESULT($FREETYPE_VERSION - Too old)
|
|
|
|
|
use_ft="no ($FREETYPE_VERSION found; version $FREETYPE_MIN_VERSION from release $FREETYPE_MIN_RELEASE required)"
|
|
|
|
|
else
|
|
|
|
|
AC_MSG_RESULT($FREETYPE_VERSION - OK)
|
|
|
|
|
|
2006-06-29 16:09:46 +02:00
|
|
|
ft_NONPKGCONFIG_CFLAGS=`$FREETYPE_CONFIG --cflags`
|
|
|
|
|
ft_NONPKGCONFIG_LIBS=`$FREETYPE_CONFIG --libs`
|
2006-06-25 17:43:27 +02:00
|
|
|
fi
|
2005-08-18 17:22:23 +00:00
|
|
|
fi
|
2005-08-17 15:57:45 +00:00
|
|
|
fi
|
2005-01-17 09:18:37 +00:00
|
|
|
fi
|
2006-06-25 17:43:27 +02:00
|
|
|
ft_CFLAGS="$FREETYPE_CFLAGS $FONTCONFIG_CFLAGS"
|
|
|
|
|
ft_LIBS="$FREETYPE_LIBS $FONTCONFIG_LIBS"
|
|
|
|
|
])
|
2003-11-08 10:28:04 +00:00
|
|
|
|
2006-06-21 07:00:34 -04:00
|
|
|
if test "x$use_ft" = "xyes"; then
|
2005-07-31 11:19:47 +00:00
|
|
|
temp_save_libs="$LIBS"
|
|
|
|
|
temp_save_cflags="$CFLAGS"
|
2006-06-25 17:43:27 +02:00
|
|
|
LIBS="$LIBS $ft_LIBS"
|
|
|
|
|
CFLAGS="$CFLAGS $ft_CFLAGS"
|
2005-07-31 11:19:47 +00:00
|
|
|
AC_CHECK_MEMBER(FT_Bitmap_Size.y_ppem,
|
|
|
|
|
HAVE_FT_BITMAP_SIZE_Y_PPEM=1,
|
|
|
|
|
HAVE_FT_BITMAP_SIZE_Y_PPEM=0,
|
2006-06-25 17:43:27 +02:00
|
|
|
[#include <ft2build.h>
|
2005-07-31 11:19:47 +00:00
|
|
|
#include FT_FREETYPE_H])
|
|
|
|
|
AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,$HAVE_FT_BITMAP_SIZE_Y_PPEM,
|
|
|
|
|
[FT_Bitmap_Size structure includes y_ppem field])
|
2005-08-21 09:27:52 +00:00
|
|
|
|
2006-08-10 13:05:26 -04:00
|
|
|
AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table)
|
2005-08-21 09:27:52 +00:00
|
|
|
|
2005-07-31 11:19:47 +00:00
|
|
|
LIBS="$temp_save_libs"
|
|
|
|
|
CFLAGS="$temp_save_cflags"
|
2005-01-17 09:18:37 +00:00
|
|
|
fi
|
2003-11-08 10:28:04 +00:00
|
|
|
|
2003-04-17 13:24:29 +00:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2007-04-19 16:49:35 -04:00
|
|
|
AC_ARG_ENABLE(pthread,
|
|
|
|
|
AS_HELP_STRING([--disable-pthread],
|
|
|
|
|
[Do not use pthread]),
|
|
|
|
|
[use_pthread=$enableval], [use_pthread=auto])
|
|
|
|
|
|
|
|
|
|
have_pthread=no
|
|
|
|
|
if test "x$use_pthread" != "xno"; then
|
|
|
|
|
AC_CHECK_HEADERS([pthread.h], have_pthread=yes, have_pthread=no)
|
|
|
|
|
fi
|
2005-08-13 03:26:18 +00:00
|
|
|
AM_CONDITIONAL(HAVE_PTHREAD, test "x$have_pthread" = "xyes")
|
2007-04-19 16:49:35 -04:00
|
|
|
if test "x$have_pthread" = xno -a "x$use_pthread" = xyes; then
|
|
|
|
|
AC_MSG_ERROR([pthread requested but not found])
|
|
|
|
|
fi
|
2005-06-25 23:24:19 +00:00
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2008-02-12 15:44:21 -05:00
|
|
|
CAIRO_BACKEND_ENABLE(ps, PostScript, ps, PS_SURFACE, yes, [
|
2007-08-29 12:18:16 -04:00
|
|
|
# The ps backend requires zlib.
|
|
|
|
|
use_ps=$have_libz
|
|
|
|
|
ps_NONPKGCONFIG_LIBS=-lz
|
|
|
|
|
])
|
|
|
|
|
|
2007-07-05 15:24:11 +01:00
|
|
|
test_ps=no
|
|
|
|
|
if test "x$use_ps" = "xyes"; then
|
|
|
|
|
AC_CHECK_PROG(GS, gs, gs)
|
|
|
|
|
if test "$GS"; then
|
|
|
|
|
AC_DEFINE([CAIRO_CAN_TEST_PS_SURFACE], 1, [Define to 1 if the PS backend can be tested (needs ghostscript)])
|
|
|
|
|
test_ps="yes"
|
|
|
|
|
else
|
|
|
|
|
AC_MSG_WARN([PS backend will not be tested since ghostscript is not available])
|
|
|
|
|
test_ps="no (requires ghostscript)"
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AM_CONDITIONAL(CAIRO_CAN_TEST_PS_SURFACE, test "x$test_ps" = "xyes")
|
2005-07-28 10:24:59 +00:00
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2008-02-12 15:44:21 -05:00
|
|
|
CAIRO_BACKEND_ENABLE(pdf, PDF, pdf, PDF_SURFACE, yes, [
|
2006-07-11 09:23:18 -04:00
|
|
|
# The pdf backend requires zlib.
|
2006-08-10 13:10:24 -04:00
|
|
|
use_pdf=$have_libz
|
2006-07-12 04:27:55 -04:00
|
|
|
pdf_NONPKGCONFIG_LIBS=-lz
|
2006-04-25 07:30:16 -04:00
|
|
|
])
|
2005-01-31 16:11:37 +00:00
|
|
|
|
2008-03-27 09:06:11 +10:30
|
|
|
POPPLER_VERSION_REQUIRED=0.8.0
|
2005-12-07 16:06:11 +00:00
|
|
|
test_pdf=no
|
2005-05-06 21:33:22 +00:00
|
|
|
if test "x$use_pdf" = "xyes"; then
|
2006-09-26 13:54:03 -04:00
|
|
|
poppler_DEPENDENCY="poppler-glib >= $POPPLER_VERSION_REQUIRED"
|
2007-01-21 15:11:31 -05:00
|
|
|
PKG_CHECK_MODULES(POPPLER, $poppler_DEPENDENCY pango gtk+-2.0,
|
2008-01-10 14:36:57 +00:00
|
|
|
[_CHECK_FUNCS_WITH_FLAGS(poppler_page_render_to_pixbuf, [$POPPLER_CFLAGS], [$POPPLER_LIBS],
|
2007-01-21 15:11:31 -05:00
|
|
|
[test_pdf=yes],
|
2008-01-10 17:23:56 +00:00
|
|
|
[AC_MSG_RESULT(no); test_pdf="no (requires $poppler_DEPENDENCY)"])],
|
|
|
|
|
[AC_MSG_RESULT(no); test_pdf="no (requires $poppler_DEPENDENCY)"])
|
2005-12-07 16:06:11 +00:00
|
|
|
if test "x$test_pdf" = "xyes"; then
|
|
|
|
|
AC_DEFINE([CAIRO_CAN_TEST_PDF_SURFACE], 1, [Define to 1 if the PDF backend can be tested (need poppler and other dependencies for pdf2png)])
|
|
|
|
|
else
|
2006-08-31 08:35:39 -07:00
|
|
|
AC_MSG_WARN([PDF backend will not be tested since poppler >= $POPPLER_VERSION_REQUIRED is not available])
|
2005-12-07 16:06:11 +00:00
|
|
|
fi
|
2005-01-31 16:11:37 +00:00
|
|
|
fi
|
|
|
|
|
|
2005-12-07 16:06:11 +00:00
|
|
|
AM_CONDITIONAL(CAIRO_CAN_TEST_PDF_SURFACE, test "x$test_pdf" = "xyes")
|
|
|
|
|
AC_SUBST(POPPLER_CFLAGS)
|
|
|
|
|
AC_SUBST(POPPLER_LIBS)
|
|
|
|
|
|
2006-01-12 16:35:12 +00:00
|
|
|
AM_CONDITIONAL(CAIRO_HAS_MULTI_PAGE_SURFACES, test "x$use_ps" = "xyes" -o "x$use_pdf" = "xyes")
|
|
|
|
|
|
2005-01-31 16:11:37 +00:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2008-02-12 15:44:21 -05:00
|
|
|
CAIRO_BACKEND_ENABLE(svg, SVG, svg, SVG_SURFACE, yes, [
|
2006-08-17 22:10:27 -04:00
|
|
|
if test "x$use_png" != "xyes"; then
|
|
|
|
|
use_svg="no (requires --enable-png)"
|
|
|
|
|
fi
|
2006-04-25 07:30:16 -04:00
|
|
|
])
|
2005-12-08 13:09:26 +00:00
|
|
|
|
2006-11-20 14:01:50 -08:00
|
|
|
LIBRSVG_VERSION_REQUIRED=2.15.0
|
2007-10-10 12:32:16 +01:00
|
|
|
test_svg=no
|
2005-12-08 13:09:26 +00:00
|
|
|
if test "x$use_svg" = "xyes"; then
|
2006-09-26 13:54:03 -04:00
|
|
|
librsvg_DEPENDENCY="librsvg-2.0 >= $LIBRSVG_VERSION_REQUIRED"
|
2007-01-21 15:11:31 -05:00
|
|
|
PKG_CHECK_MODULES(LIBRSVG, $librsvg_DEPENDENCY gdk-2.0,
|
2008-01-10 14:36:57 +00:00
|
|
|
[_CHECK_FUNCS_WITH_FLAGS(rsvg_pixbuf_from_file, [$LIBRSVG_CFLAGS], [$LIBRSVG_LIBS],
|
2007-01-21 15:11:31 -05:00
|
|
|
[test_svg=yes],
|
2008-01-10 17:23:56 +00:00
|
|
|
[AC_MSG_RESULT(no); test_svg="no (requires $librsvg_DEPENDENCY)"])],
|
|
|
|
|
[AC_MSG_RESULT(no); test_svg="no (requires $librsvg_DEPENDENCY)"])
|
2005-12-19 13:59:34 +00:00
|
|
|
if test "x$test_svg" = "xyes"; then
|
2006-08-31 08:35:39 -07:00
|
|
|
AC_DEFINE([CAIRO_CAN_TEST_SVG_SURFACE], 1, [Define to 1 if the SVG backend can be tested])
|
2005-12-19 13:59:34 +00:00
|
|
|
else
|
2006-08-31 08:35:39 -07:00
|
|
|
AC_MSG_WARN([SVG backend will not be tested since librsvg >= $LIBRSVG_VERSION_REQUIRED is not available])
|
2005-12-19 13:59:34 +00:00
|
|
|
fi
|
2005-12-08 13:09:26 +00:00
|
|
|
fi
|
|
|
|
|
|
2005-12-19 13:59:34 +00:00
|
|
|
AM_CONDITIONAL(CAIRO_CAN_TEST_SVG_SURFACE, test "x$test_svg" = "xyes")
|
|
|
|
|
AC_SUBST(LIBRSVG_CFLAGS)
|
|
|
|
|
AC_SUBST(LIBRSVG_LIBS)
|
|
|
|
|
|
2006-08-10 12:47:11 -04:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
dnl dump backend checking results
|
|
|
|
|
AC_CACHE_SAVE
|
|
|
|
|
|
2005-01-17 09:18:37 +00:00
|
|
|
dnl ===========================================================================
|
2004-05-28 12:37:15 +00:00
|
|
|
dnl Checks for precise integer types
|
2006-08-17 22:02:02 -04:00
|
|
|
AC_CHECK_HEADERS([stdint.h signal.h inttypes.h sys/int_types.h])
|
2004-05-28 12:37:15 +00:00
|
|
|
AC_CHECK_TYPES([uint64_t, uint128_t])
|
|
|
|
|
|
2007-03-16 20:43:29 +01:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
dnl check for CPU affinity support
|
|
|
|
|
AC_CHECK_HEADERS([sched.h], [
|
|
|
|
|
AC_CHECK_FUNCS([sched_getaffinity], [
|
|
|
|
|
AC_DEFINE([HAVE_SCHED_GETAFFINITY], [1],
|
|
|
|
|
[Define to 1 if you have Linux compatible sched_getaffinity])
|
|
|
|
|
])
|
|
|
|
|
])
|
|
|
|
|
|
2007-06-09 13:48:13 -04:00
|
|
|
AC_CHECK_LIB(rt, sched_yield, [RT_LIBS=-lrt], [RT_LIBS=])
|
|
|
|
|
CAIROPERF_LIBS=$RT_LIBS
|
|
|
|
|
|
2007-04-30 19:20:56 -04:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
dnl Checks for misc headers
|
2008-05-28 10:43:22 -04:00
|
|
|
AC_CHECK_HEADERS([libgen.h byteswap.h])
|
2007-04-30 19:20:56 -04:00
|
|
|
|
2007-03-16 20:43:29 +01:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
dnl check compiler flags
|
2006-08-11 11:51:10 -04:00
|
|
|
AC_DEFUN([CAIRO_CC_TRY_FLAG], [
|
|
|
|
|
AC_MSG_CHECKING([whether $CC supports $1])
|
2004-05-28 12:37:15 +00:00
|
|
|
|
2006-08-11 11:51:10 -04:00
|
|
|
cairo_save_CFLAGS="$CFLAGS"
|
|
|
|
|
CFLAGS="$CFLAGS $1"
|
2004-05-28 12:37:15 +00:00
|
|
|
|
2006-08-11 11:51:10 -04:00
|
|
|
AC_COMPILE_IFELSE([ ], [cairo_cc_flag=yes], [cairo_cc_flag=no])
|
|
|
|
|
CFLAGS="$cairo_save_CFLAGS"
|
2004-10-26 14:38:43 +00:00
|
|
|
|
2006-08-11 11:51:10 -04:00
|
|
|
if test "x$cairo_cc_flag" = "xyes"; then
|
|
|
|
|
ifelse([$2], , :, [$2])
|
|
|
|
|
else
|
|
|
|
|
ifelse([$3], , :, [$3])
|
|
|
|
|
fi
|
|
|
|
|
AC_MSG_RESULT([$cairo_cc_flag])
|
|
|
|
|
])
|
2006-05-15 10:07:57 -07:00
|
|
|
|
2006-09-02 19:51:54 -04:00
|
|
|
|
2006-08-11 11:51:10 -04:00
|
|
|
dnl Use lots of warning flags with with gcc and compatible compilers
|
2006-09-02 19:51:54 -04:00
|
|
|
|
|
|
|
|
dnl Note: if you change the following variable, the cache is automatically
|
|
|
|
|
dnl skipped and all flags rechecked. So there's no need to do anything
|
|
|
|
|
dnl else. If for any reason you need to force a recheck, just change
|
2006-10-22 12:47:43 +02:00
|
|
|
dnl MAYBE_WARN in an ignorable way (like adding whitespace)
|
2006-09-02 19:51:54 -04:00
|
|
|
|
|
|
|
|
MAYBE_WARN="-Wall -Wextra \
|
|
|
|
|
-Wsign-compare -Werror-implicit-function-declaration \
|
|
|
|
|
-Wpointer-arith -Wwrite-strings -Wstrict-prototypes \
|
|
|
|
|
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs \
|
|
|
|
|
-Wpacked -Wswitch-enum -Wmissing-format-attribute \
|
|
|
|
|
-Wstrict-aliasing=2 -Winit-self -Wunsafe-loop-optimizations \
|
|
|
|
|
-Wdeclaration-after-statement -Wold-style-definition \
|
2007-04-08 20:50:08 +01:00
|
|
|
-Wno-missing-field-initializers -Wno-unused-parameter \
|
2007-10-09 23:12:52 +01:00
|
|
|
-Wno-attributes -Wno-long-long -Winline"
|
2006-09-02 19:51:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# invalidate cached value if MAYBE_WARN has changed
|
|
|
|
|
if test "x$cairo_cv_warn_maybe" != "x$MAYBE_WARN"; then
|
|
|
|
|
unset cairo_cv_warn_cflags
|
|
|
|
|
fi
|
2006-08-11 11:51:10 -04:00
|
|
|
AC_CACHE_CHECK([for supported warning flags], cairo_cv_warn_cflags, [
|
|
|
|
|
echo
|
|
|
|
|
WARN_CFLAGS=""
|
|
|
|
|
|
2006-08-28 18:54:35 -07:00
|
|
|
# Some warning options are not supported by all versions of
|
|
|
|
|
# gcc, so test all desired options against the current
|
|
|
|
|
# compiler.
|
|
|
|
|
#
|
|
|
|
|
# Note that there are some order dependencies
|
|
|
|
|
# here. Specifically, an option that disables a warning will
|
|
|
|
|
# have no net effect if a later option then enables that
|
|
|
|
|
# warnings, (perhaps implicitly). So we put some grouped
|
|
|
|
|
# options (-Wall and -Wextra) up front and the -Wno options
|
|
|
|
|
# last.
|
|
|
|
|
|
2006-08-11 11:51:10 -04:00
|
|
|
for W in $MAYBE_WARN; do
|
|
|
|
|
CAIRO_CC_TRY_FLAG([$W], [WARN_CFLAGS="$WARN_CFLAGS $W"])
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
cairo_cv_warn_cflags=$WARN_CFLAGS
|
2006-09-02 19:51:54 -04:00
|
|
|
cairo_cv_warn_maybe=$MAYBE_WARN
|
2006-08-11 11:51:10 -04:00
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([which warning flags were supported])])
|
2007-04-10 23:09:13 +01:00
|
|
|
WARN_CFLAGS="$cairo_cv_warn_cflags"
|
2004-10-26 14:38:43 +00:00
|
|
|
CAIRO_CFLAGS="$CAIRO_CFLAGS $WARN_CFLAGS"
|
|
|
|
|
|
2007-04-10 23:09:13 +01:00
|
|
|
# We only wish to enable attribute(warn_unused_result) if we can prevent
|
|
|
|
|
# gcc from generating thousands of warnings about the misapplication of the
|
|
|
|
|
# attribute to void functions and variables.
|
|
|
|
|
AC_MSG_CHECKING([how to enable unused result warnings])
|
|
|
|
|
warn_unused_result=""
|
|
|
|
|
if echo $WARN_CFLAGS | grep -e '-Wno-attributes' >/dev/null; then
|
|
|
|
|
AC_TRY_COMPILE([__attribute__((__warn_unused_result__))
|
|
|
|
|
int f (int i) { return i; }], [],
|
|
|
|
|
[warn_unused_result="__attribute__((__warn_unused_result__))"])
|
|
|
|
|
fi
|
|
|
|
|
AC_DEFINE_UNQUOTED([WARN_UNUSED_RESULT], [$warn_unused_result],
|
|
|
|
|
[Define to the value your compiler uses to support the warn-unused-result attribute])
|
|
|
|
|
AC_MSG_RESULT([$warn_unused_result])
|
|
|
|
|
|
2007-03-20 08:47:45 -04:00
|
|
|
CAIRO_CC_TRY_FLAG([-fno-strict-aliasing],
|
2007-07-31 17:52:13 -04:00
|
|
|
[CAIRO_CFLAGS="$CAIRO_CFLAGS -fno-strict-aliasing"])
|
2006-08-11 11:51:10 -04:00
|
|
|
|
2006-06-25 17:43:27 +02:00
|
|
|
AC_SUBST(CAIRO_REQUIRES)
|
2006-07-12 04:27:55 -04:00
|
|
|
AC_SUBST(CAIRO_NONPKGCONFIG_CFLAGS)
|
|
|
|
|
AC_SUBST(CAIRO_NONPKGCONFIG_LIBS)
|
2004-10-26 14:38:43 +00:00
|
|
|
AC_SUBST(CAIRO_CFLAGS)
|
2007-04-04 10:13:13 +01:00
|
|
|
AC_SUBST(CAIRO_LDADD)
|
2004-10-26 14:38:43 +00:00
|
|
|
AC_SUBST(CAIRO_LIBS)
|
2007-06-09 13:48:13 -04:00
|
|
|
AC_SUBST(CAIROPERF_LIBS)
|
2004-05-28 12:37:15 +00:00
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
2005-01-27 11:35:25 +00:00
|
|
|
dnl Check for gtk-doc and docbook
|
|
|
|
|
|
2006-06-29 18:54:02 +02:00
|
|
|
GTK_DOC_CHECK([1.6])
|
2004-05-28 12:37:15 +00:00
|
|
|
|
2005-08-10 12:36:51 +00:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
dnl Check for recent pkg-config which supports Requires.private
|
|
|
|
|
|
|
|
|
|
case `$PKG_CONFIG --version` in
|
2006-06-14 04:51:27 -07:00
|
|
|
[0.?|0.?.?|0.1[0-7]|0.1[0-7].?]) PKGCONFIG_REQUIRES="Requires"; ;;
|
2005-08-10 12:36:51 +00:00
|
|
|
*) PKGCONFIG_REQUIRES="Requires.private"; ;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
AC_SUBST(PKGCONFIG_REQUIRES)
|
|
|
|
|
|
2005-08-16 16:52:35 +00:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
dnl Check for MMX
|
|
|
|
|
|
2005-09-18 19:37:44 +00:00
|
|
|
MMX_CFLAGS="-mmmx -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
|
2005-08-16 16:52:35 +00:00
|
|
|
|
|
|
|
|
have_mmx_intrinsics=no
|
2006-06-21 06:25:01 -04:00
|
|
|
AC_MSG_CHECKING(for MMX/SSE intrinsics in the compiler)
|
2005-08-16 16:52:35 +00:00
|
|
|
xserver_save_CFLAGS=$CFLAGS
|
|
|
|
|
CFLAGS="$CFLAGS $MMX_CFLAGS"
|
|
|
|
|
AC_COMPILE_IFELSE([
|
|
|
|
|
#if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
|
|
|
|
|
#error "Need GCC >= 3.4 for MMX intrinsics"
|
|
|
|
|
#endif
|
|
|
|
|
#include <mmintrin.h>
|
|
|
|
|
int main () {
|
|
|
|
|
__m64 v = _mm_cvtsi32_si64 (1);
|
2005-09-18 19:53:23 +00:00
|
|
|
__m64 w = _mm_slli_si64 (v, 1);
|
|
|
|
|
v = _mm_or_si64 (v, w);
|
2005-08-16 16:52:35 +00:00
|
|
|
return _mm_cvtsi64_si32 (v);
|
|
|
|
|
}], have_mmx_intrinsics=yes)
|
|
|
|
|
CFLAGS=$xserver_save_CFLAGS
|
|
|
|
|
AC_MSG_RESULT($have_mmx_intrinsics)
|
|
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2007-12-02 17:55:35 +00:00
|
|
|
cairo_has_lcov=no
|
2005-12-14 16:22:06 +00:00
|
|
|
AC_ARG_ENABLE(gcov,
|
2006-04-25 07:30:16 -04:00
|
|
|
AS_HELP_STRING([--enable-gcov],
|
|
|
|
|
[Enable gcov]),
|
2005-12-16 11:31:10 +00:00
|
|
|
[use_gcov=$enableval], [use_gcov=no])
|
2005-12-14 16:22:06 +00:00
|
|
|
|
|
|
|
|
if test "x$use_gcov" = "xyes"; then
|
|
|
|
|
dnl we need gcc:
|
|
|
|
|
if test "$GCC" != "yes"; then
|
|
|
|
|
AC_MSG_ERROR([GCC is required for --enable-gcov])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
dnl Check if ccache is being used
|
2007-04-04 10:13:13 +01:00
|
|
|
AC_CHECK_PROG(SHTOOL, shtool, shtool)
|
|
|
|
|
case `$SHTOOL path $CC` in
|
2005-12-14 16:22:06 +00:00
|
|
|
*ccache*[)] gcc_ccache=yes;;
|
|
|
|
|
*[)] gcc_ccache=no;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
|
|
|
|
|
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
|
|
|
|
|
fi
|
|
|
|
|
|
2008-05-06 10:19:59 +01:00
|
|
|
ltp_version_list="1.6 1.5 1.4"
|
2005-12-14 16:22:06 +00:00
|
|
|
AC_CHECK_PROG(LTP, lcov, lcov)
|
|
|
|
|
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
|
|
|
|
|
|
|
|
|
|
if test "$LTP"; then
|
|
|
|
|
AC_CACHE_CHECK([for ltp version], cairo_cv_ltp_version, [
|
|
|
|
|
cairo_cv_ltp_version=invalid
|
|
|
|
|
ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
|
|
|
|
|
for ltp_check_version in $ltp_version_list; do
|
|
|
|
|
if test "$ltp_version" = "$ltp_check_version"; then
|
|
|
|
|
cairo_cv_ltp_version="$ltp_check_version (ok)"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
case $cairo_cv_ltp_version in
|
|
|
|
|
""|invalid[)]
|
|
|
|
|
;;
|
2007-12-02 17:55:35 +00:00
|
|
|
*)
|
|
|
|
|
cairo_has_lcov=yes
|
2008-04-04 14:15:58 +01:00
|
|
|
;;
|
2005-12-14 16:22:06 +00:00
|
|
|
esac
|
|
|
|
|
|
2008-04-04 14:15:58 +01:00
|
|
|
if test "x$cairo_has_lcov" != "xyes"; then
|
|
|
|
|
AC_MSG_ERROR([[To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list.
|
|
|
|
|
Please install the Linux Test Project [http://ltp.sourceforge.net/], and try again.]])
|
|
|
|
|
fi
|
|
|
|
|
|
2005-12-14 16:22:06 +00:00
|
|
|
if test -z "$LTP_GENHTML"; then
|
2008-04-04 14:15:58 +01:00
|
|
|
AC_MSG_ERROR([[Could not find genhtml from the LTP package.
|
|
|
|
|
Please install the Linux Test Project [http://ltp.sourceforge.net/], and try again.]])
|
2005-12-14 16:22:06 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AC_DEFINE(HAVE_GCOV, 1, [Whether you have gcov])
|
|
|
|
|
dnl PHP_ADD_MAKEFILE_FRAGMENT($abs_srcdir/Makefile.gcov, $abs_srcdir)
|
|
|
|
|
|
|
|
|
|
dnl Remove all optimization flags from CFLAGS
|
|
|
|
|
changequote({,})
|
2007-04-04 10:13:13 +01:00
|
|
|
CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
|
2005-12-14 16:22:06 +00:00
|
|
|
CAIRO_CFLAGS=`echo "$CAIRO_CFLAGS" | $SED -e 's/-O[0-9]*//g'`
|
|
|
|
|
changequote([,])
|
|
|
|
|
|
|
|
|
|
dnl Add the special gcc flags
|
|
|
|
|
CAIRO_CFLAGS="$CAIRO_CFLAGS -O0 -fprofile-arcs -ftest-coverage"
|
2007-04-04 10:13:13 +01:00
|
|
|
CAIRO_LDADD="$CAIRO_LDADD -lgcov"
|
2005-12-14 16:22:06 +00:00
|
|
|
fi
|
2007-12-02 17:55:35 +00:00
|
|
|
AM_CONDITIONAL(CAIRO_HAS_LCOV, test "x$cairo_has_lcov" = "xyes")
|
2005-12-14 16:22:06 +00:00
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2005-12-16 11:31:10 +00:00
|
|
|
AC_ARG_ENABLE(test-surfaces,
|
2006-04-25 07:30:16 -04:00
|
|
|
AS_HELP_STRING([--enable-test-surfaces],
|
|
|
|
|
[Add backends for more test suite coverage (no additional public functionality)]),
|
2005-12-16 11:31:10 +00:00
|
|
|
[use_test_surfaces=$enableval], [use_test_surfaces=no])
|
|
|
|
|
|
|
|
|
|
AM_CONDITIONAL(CAIRO_HAS_TEST_SURFACES, test "x$use_test_surfaces" = "xyes")
|
|
|
|
|
if test "x$use_test_surfaces" = "xyes"; then
|
|
|
|
|
AC_DEFINE(CAIRO_HAS_TEST_SURFACES, 1, [define in the extra test surface have been built into cairo for the test suite])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2006-12-01 12:41:55 -08:00
|
|
|
AC_ARG_ENABLE(some-floating-point,
|
|
|
|
|
AS_HELP_STRING([--disable-some-floating-point],
|
|
|
|
|
[Disable certain code paths that rely heavily on double precision
|
|
|
|
|
floating-point calculation. This option can improve
|
|
|
|
|
performance on systems without a double precision floating-point
|
|
|
|
|
unit, but might degrade performance on those that do.]), [
|
|
|
|
|
if test "x$enableval" = "xno"; then
|
|
|
|
|
# A value of 'no' for $enableval means that they want to disable, which
|
|
|
|
|
# means 'yes' for $disable_some_floating_point.
|
|
|
|
|
disable_some_floating_point=yes
|
|
|
|
|
fi
|
2006-12-02 11:24:35 -08:00
|
|
|
], [disable_some_floating_point=no])
|
2006-12-01 12:41:55 -08:00
|
|
|
|
|
|
|
|
AM_CONDITIONAL(DISABLE_SOME_FLOATING_POINT,
|
|
|
|
|
test "x$disable_some_floating_point" = "xyes")
|
|
|
|
|
if test "x$disable_some_floating_point" = "xyes"; then
|
|
|
|
|
AC_DEFINE(DISABLE_SOME_FLOATING_POINT, 1,
|
|
|
|
|
[Define to 1 to disable certain code paths that rely heavily on
|
|
|
|
|
double precision floating-point calculation])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2006-06-21 06:25:01 -04:00
|
|
|
AC_CONFIG_COMMANDS([src/cairo-features.h],
|
|
|
|
|
[
|
|
|
|
|
featuresfile=src/cairo-features.h
|
|
|
|
|
outfile=$featuresfile.tmp
|
|
|
|
|
AC_MSG_NOTICE([creating $featuresfile])
|
|
|
|
|
cat > $outfile <<_EOF
|
|
|
|
|
/* Generated by configure. Do not edit */
|
|
|
|
|
#ifndef CAIRO_FEATURES_H
|
|
|
|
|
#define CAIRO_FEATURES_H
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
# define CAIRO_BEGIN_DECLS extern "C" {
|
|
|
|
|
# define CAIRO_END_DECLS }
|
|
|
|
|
#else
|
|
|
|
|
# define CAIRO_BEGIN_DECLS
|
|
|
|
|
# define CAIRO_END_DECLS
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef cairo_public
|
|
|
|
|
# define cairo_public
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#define CAIRO_VERSION_MAJOR $CAIRO_VERSION_MAJOR
|
|
|
|
|
#define CAIRO_VERSION_MINOR $CAIRO_VERSION_MINOR
|
|
|
|
|
#define CAIRO_VERSION_MICRO $CAIRO_VERSION_MICRO
|
|
|
|
|
|
|
|
|
|
#define CAIRO_VERSION_STRING "$CAIRO_VERSION_MAJOR.$CAIRO_VERSION_MINOR.$CAIRO_VERSION_MICRO"
|
|
|
|
|
|
|
|
|
|
_EOF
|
|
|
|
|
for FEATURE in $CAIRO_FEATURES; do
|
|
|
|
|
echo "#define CAIRO_HAS_$FEATURE 1" >> $outfile
|
|
|
|
|
done
|
2008-01-28 23:26:35 -05:00
|
|
|
echo '' >> $outfile
|
2008-01-28 23:05:00 -05:00
|
|
|
for FEATURE in $CAIRO_NO_FEATURES; do
|
2008-01-28 23:30:09 -05:00
|
|
|
echo "/*#undef CAIRO_HAS_$FEATURE */" >> $outfile
|
2008-01-28 23:05:00 -05:00
|
|
|
done
|
2006-06-21 06:25:01 -04:00
|
|
|
|
|
|
|
|
echo '' >> $outfile
|
|
|
|
|
echo '#endif' >> $outfile
|
|
|
|
|
|
|
|
|
|
if cmp -s $outfile $featuresfile; then
|
|
|
|
|
AC_MSG_NOTICE([$featuresfile is unchanged])
|
|
|
|
|
rm -f $outfile
|
|
|
|
|
else
|
|
|
|
|
mv $outfile $featuresfile
|
|
|
|
|
fi
|
|
|
|
|
],[
|
|
|
|
|
CAIRO_FEATURES='$CAIRO_FEATURES'
|
2008-01-28 23:05:00 -05:00
|
|
|
CAIRO_NO_FEATURES='$CAIRO_NO_FEATURES'
|
2006-06-21 06:25:01 -04:00
|
|
|
CAIRO_VERSION_MAJOR=$CAIRO_VERSION_MAJOR
|
|
|
|
|
CAIRO_VERSION_MINOR=$CAIRO_VERSION_MINOR
|
|
|
|
|
CAIRO_VERSION_MICRO=$CAIRO_VERSION_MICRO
|
|
|
|
|
])
|
2008-01-28 23:26:35 -05:00
|
|
|
AC_CONFIG_COMMANDS([src/cairo-no-features.h],
|
|
|
|
|
[
|
|
|
|
|
nofeaturesfile=src/cairo-no-features.h
|
|
|
|
|
outfile=$nofeaturesfile.tmp
|
|
|
|
|
AC_MSG_NOTICE([creating $nofeaturesfile])
|
|
|
|
|
cat > $outfile <<_EOF
|
|
|
|
|
/* Generated by configure. Do not edit */
|
|
|
|
|
#ifndef CAIRO_NO_FEATURES_H
|
|
|
|
|
#define CAIRO_NO_FEATURES_H
|
|
|
|
|
|
|
|
|
|
#include <cairo-features.h>
|
|
|
|
|
|
|
|
|
|
/* This is a dummy header, to trick gtk-doc only */
|
|
|
|
|
|
|
|
|
|
_EOF
|
|
|
|
|
for FEATURE in $CAIRO_NO_FEATURES; do
|
|
|
|
|
echo "#define CAIRO_HAS_$FEATURE 1" >> $outfile
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
echo '' >> $outfile
|
|
|
|
|
echo '#endif' >> $outfile
|
|
|
|
|
|
|
|
|
|
if cmp -s $outfile $nofeaturesfile; then
|
|
|
|
|
AC_MSG_NOTICE([$nofeaturesfile is unchanged])
|
|
|
|
|
rm -f $outfile
|
|
|
|
|
else
|
|
|
|
|
mv $outfile $nofeaturesfile
|
|
|
|
|
fi
|
|
|
|
|
],[
|
|
|
|
|
CAIRO_NO_FEATURES='$CAIRO_NO_FEATURES'
|
|
|
|
|
])
|
2006-06-21 06:25:01 -04:00
|
|
|
AC_CONFIG_FILES([
|
2003-04-17 13:24:29 +00:00
|
|
|
Makefile
|
2006-08-30 15:34:27 -07:00
|
|
|
boilerplate/Makefile
|
2003-04-17 13:24:29 +00:00
|
|
|
src/Makefile
|
2004-10-26 14:38:43 +00:00
|
|
|
test/Makefile
|
2006-11-21 14:19:35 -08:00
|
|
|
test/pdiff/Makefile
|
2006-08-31 07:19:05 -07:00
|
|
|
perf/Makefile
|
2007-04-21 07:48:10 -04:00
|
|
|
util/Makefile
|
2005-01-27 11:35:25 +00:00
|
|
|
doc/Makefile
|
|
|
|
|
doc/public/Makefile
|
2005-08-18 08:28:08 +00:00
|
|
|
doc/public/version.xml
|
2006-06-13 19:13:05 -04:00
|
|
|
src/cairo.pc
|
2003-04-17 13:24:29 +00:00
|
|
|
])
|
2004-04-09 14:14:56 +00:00
|
|
|
|
2006-06-21 06:25:01 -04:00
|
|
|
AC_OUTPUT
|
|
|
|
|
|
2004-04-09 14:14:56 +00:00
|
|
|
dnl ===========================================================================
|
|
|
|
|
|
2008-01-10 14:18:25 +00:00
|
|
|
V="$CAIRO_VERSION_MAJOR.$CAIRO_VERSION_MINOR.$CAIRO_VERSION_MICRO"
|
2004-04-09 14:14:56 +00:00
|
|
|
echo ""
|
2008-01-10 14:18:25 +00:00
|
|
|
echo "cairo (version $V) will be compiled with the following surface backends:"
|
2006-06-27 16:55:53 +02:00
|
|
|
echo " image: yes (always builtin)"
|
|
|
|
|
echo " Xlib: $use_xlib"
|
|
|
|
|
echo " Xlib Xrender: $use_xlib_xrender"
|
|
|
|
|
echo " Quartz: $use_quartz"
|
2008-03-07 14:49:15 -08:00
|
|
|
echo " Quartz-image: $use_quartz_image"
|
2006-06-27 16:55:53 +02:00
|
|
|
echo " XCB: $use_xcb"
|
|
|
|
|
echo " Win32: $use_win32"
|
2006-09-15 11:18:47 +02:00
|
|
|
echo " OS2: $use_os2"
|
2006-06-27 16:55:53 +02:00
|
|
|
echo " PostScript: $use_ps"
|
|
|
|
|
echo " PDF: $use_pdf"
|
|
|
|
|
echo " SVG: $use_svg"
|
|
|
|
|
echo " glitz: $use_glitz"
|
|
|
|
|
echo " BeOS: $use_beos"
|
|
|
|
|
echo " DirectFB: $use_directfb"
|
2004-04-09 14:14:56 +00:00
|
|
|
echo ""
|
2005-03-28 13:58:26 +00:00
|
|
|
echo "the following font backends:"
|
2006-06-27 16:55:53 +02:00
|
|
|
echo " FreeType: $use_ft"
|
|
|
|
|
echo " Win32: $use_win32_font"
|
2008-03-17 17:37:19 -07:00
|
|
|
echo " Quartz: $use_quartz_font"
|
2005-01-17 09:18:37 +00:00
|
|
|
echo ""
|
2005-12-14 16:22:06 +00:00
|
|
|
echo "the following features:"
|
2005-03-28 13:58:26 +00:00
|
|
|
echo " PNG functions: $use_png"
|
2005-12-14 16:22:06 +00:00
|
|
|
echo ""
|
|
|
|
|
echo "and the following debug options:"
|
|
|
|
|
echo " gcov support: $use_gcov"
|
2005-12-16 11:31:10 +00:00
|
|
|
echo " test surfaces: $use_test_surfaces"
|
2007-07-05 15:24:11 +01:00
|
|
|
echo " ps testing: $test_ps"
|
2006-09-26 13:54:03 -04:00
|
|
|
echo " pdf testing: $test_pdf"
|
|
|
|
|
echo " svg testing: $test_svg"
|
2008-01-10 15:30:42 +00:00
|
|
|
if test x"$use_win32" = "xyes"; then
|
|
|
|
|
echo " win32 printing testing: $test_win32_printing"
|
|
|
|
|
fi
|
2005-12-16 11:31:10 +00:00
|
|
|
echo ""
|
2005-12-14 16:22:06 +00:00
|
|
|
echo "using CFLAGS:"
|
|
|
|
|
echo $CAIRO_CFLAGS
|
2005-12-16 11:31:10 +00:00
|
|
|
echo ""
|
2004-04-09 14:14:56 +00:00
|
|
|
|
2008-03-17 17:37:19 -07:00
|
|
|
if test x"$use_ft" != "xyes" && \
|
|
|
|
|
test x"$use_win32_font" != "xyes" && \
|
|
|
|
|
test x"$use_quartz_font" != "xyes" ; then
|
2005-03-07 12:40:29 +00:00
|
|
|
|
|
|
|
|
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
|
2005-08-23 15:11:44 +00:00
|
|
|
|
|
|
|
|
WARNING_MESSAGE='
|
|
|
|
|
*** The @BACKEND@ backend is still under active development and
|
|
|
|
|
*** is included in this release only as a preview. It does not
|
|
|
|
|
*** fully work yet and incompatible changes may yet be made
|
|
|
|
|
*** to @BACKEND@-backend specific API.
|
|
|
|
|
'
|
|
|
|
|
|
2005-12-07 11:44:28 +00:00
|
|
|
if test x"$use_glitz" = "xyes" ; then
|
2005-08-24 06:48:02 +00:00
|
|
|
echo "$WARNING_MESSAGE" | sed 's/@BACKEND@/Glitz/'
|
|
|
|
|
fi
|
|
|
|
|
|
2005-12-07 11:44:28 +00:00
|
|
|
if test x"$use_xcb" = "xyes" ; then
|
2005-08-23 15:11:44 +00:00
|
|
|
echo "$WARNING_MESSAGE" | sed 's/@BACKEND@/XCB/'
|
|
|
|
|
fi
|
|
|
|
|
|
2008-03-07 14:49:15 -08:00
|
|
|
if test x"$use_quartz_image" = "xyes" ; then
|
|
|
|
|
echo "$WARNING_MESSAGE" | sed 's/@BACKEND@/Quartz Image/'
|
|
|
|
|
fi
|
|
|
|
|
|
2006-09-15 11:18:47 +02:00
|
|
|
if test x"$use_os2" = "xyes" ; then
|
|
|
|
|
echo "$WARNING_MESSAGE" | sed 's,@BACKEND@,OS/2,'
|
|
|
|
|
fi
|
|
|
|
|
|
2005-12-18 17:20:06 +00:00
|
|
|
if test x"$use_beos" = "xyes" ; then
|
|
|
|
|
echo "$WARNING_MESSAGE" | sed 's/@BACKEND@/BeOS/'
|
|
|
|
|
fi
|
2005-12-29 07:17:01 +00:00
|
|
|
|
2006-04-02 15:55:27 +02:00
|
|
|
if test x"$use_directfb" = "xyes" ; then
|
2005-12-29 07:17:01 +00:00
|
|
|
echo "$WARNING_MESSAGE" | sed 's/@BACKEND@/DirectFB/'
|
|
|
|
|
fi
|