1 dnl Copyright 2005 Red Hat, Inc.
3 dnl Permission to use, copy, modify, distribute, and sell this software and its
4 dnl documentation for any purpose is hereby granted without fee, provided that
5 dnl the above copyright notice appear in all copies and that both that
6 dnl copyright notice and this permission notice appear in supporting
7 dnl documentation, and that the name of Red Hat not be used in
8 dnl advertising or publicity pertaining to distribution of the software without
9 dnl specific, written prior permission. Red Hat makes no
10 dnl representations about the suitability of this software for any purpose. It
11 dnl is provided "as is" without express or implied warranty.
13 dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
14 dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
15 dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
16 dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
17 dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 dnl PERFORMANCE OF THIS SOFTWARE.
21 dnl Process this file with autoconf to create configure.
25 # Pixman versioning scheme
27 # - If the changes don't affect API or ABI, then increment pixman_micro
28 # - If API is added, then increment PIXMAN_MINOR, and set MICRO to 0
30 # - If you break ABI, then
31 # - In the first development release where you break ABI, find all instances of
32 # "pixman-n" and change it to pixman-(n+1)
34 # This needs to be done at least in
39 # This ensures that binary incompatible versions can be installed in parallel.
40 # See http://www106.pair.com/rhp/parallel.html for more information
43 m4_define([pixman_major], 0)
44 m4_define([pixman_minor], 9)
45 m4_define([pixman_micro], 6)
47 m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro])
49 AC_INIT(pixman, pixman_version, "sandmann@daimi.au.dk", pixman)
50 AM_INIT_AUTOMAKE([dist-bzip2])
52 AM_CONFIG_HEADER(config.h)
56 AC_CHECK_FUNCS([getisax])
60 # We ignore pixman_major in the version here because the major version should
61 # always be encoded in the actual library name. Ie., the soname is:
63 # pixman-$(pixman_major).0.minor.micro
65 m4_define([lt_current], [pixman_minor])
66 m4_define([lt_revision], [pixman_micro])
67 m4_define([lt_age], [pixman_minor])
69 LT_VERSION_INFO="lt_current:lt_revision:lt_age"
71 PIXMAN_MAJOR=pixman_major
72 AC_SUBST(PIXMAN_MAJOR)
74 AC_SUBST(LT_VERSION_INFO)
76 # Check for dependencies
77 #PKG_CHECK_MODULES(DEP, x11)
80 if test "x$GCC" = "xyes"; then
82 *[\ \ ]-Wall[\ \ ]*) ;;
83 *) CFLAGS="$CFLAGS -Wall" ;;
84 esac fi changequote([,])dnl
86 dnl ===========================================================================
89 MMX_CFLAGS="-mmmx -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
91 have_mmx_intrinsics=no
92 AC_MSG_CHECKING(whether to use MMX intrinsics)
93 xserver_save_CFLAGS=$CFLAGS
94 CFLAGS="$CFLAGS $MMX_CFLAGS"
96 #if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
97 #error "Need GCC >= 3.4 for MMX intrinsics"
101 __m64 v = _mm_cvtsi32_si64 (1);
102 return _mm_cvtsi64_si32 (v);
103 }], have_mmx_intrinsics=yes)
104 CFLAGS=$xserver_save_CFLAGS
105 AC_MSG_RESULT($have_mmx_intrinsics)
107 if test $have_mmx_intrinsics = yes ; then
108 AC_DEFINE(USE_MMX, 1, [use MMX compiler intrinsics])
113 AM_CONDITIONAL(USE_MMX, test $have_mmx_intrinsics = yes)
115 dnl =======================================================
117 dnl GCC 4.2 when compiling with -msse will generate SSE instructions
118 dnl on its own. This means anything compiled with -mss can only be
119 dnl run after a runtime check for SSE. Unfortunately, since we still
120 dnl need to support MMX-but-not-SSE (such as the OLPC), this means we
121 dnl can only use SSE when compiling for x86-64 (where SSE is always
124 have_sse_intrinsics=no
125 AC_MSG_CHECKING(whether to use SSE intrinsics)
126 xserver_save_CFLAGS=$CFLAGS
127 CFLAGS="$CFLAGS -msse $MMX_CFLAGS"
130 #if !defined(__amd64__) && !defined(__x86_64__)
131 #error "Need x86-64 for SSE"
133 #include <mmintrin.h>
134 #include <xmmintrin.h>
136 __m64 v = _mm_cvtsi32_si64 (1);
137 v = _mm_shuffle_pi16 (v, _MM_SHUFFLE(3, 3, 3, 3));
138 return _mm_cvtsi64_si32 (v);
139 }], have_sse_intrinsics=yes)
140 CFLAGS=$xserver_save_CFLAGS
141 AC_MSG_RESULT($have_sse_intrinsics)
143 if test $have_sse_intrinsics = yes ; then
144 AC_DEFINE(USE_SSE, 1, [use SSE compiler intrinsics])
145 MMX_CFLAGS="-msse $MMX_CFLAGS"
148 AM_CONDITIONAL(USE_SSE, test $have_sse_intrinsics = yes)
150 dnl ========================================================
153 PKG_CHECK_MODULES(GTK, [gtk+-2.0], [HAVE_GTK=yes], [HAVE_GTK=no])
154 AM_CONDITIONAL(HAVE_GTK, [test "x$HAVE_GTK" = xyes])
161 AC_OUTPUT([pixman-1.pc