Bump version number
[profile/ivi/pixman.git] / configure.ac
1 dnl  Copyright 2005 Red Hat, Inc.
2 dnl 
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.
12 dnl 
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.
20 dnl
21 dnl Process this file with autoconf to create configure.
22
23 AC_PREREQ([2.57])
24
25 #   Pixman versioning scheme
26 #
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
29 #
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)
33 #
34 #          This needs to be done at least in 
35 #                    configure.ac
36 #                    all Makefile.am's
37 #                    pixman-n.pc.in
38 #
39 #      This ensures that binary incompatible versions can be installed in parallel.
40 #      See http://www106.pair.com/rhp/parallel.html for more information
41 #
42
43 m4_define([pixman_major], 0)
44 m4_define([pixman_minor], 9)
45 m4_define([pixman_micro], 6)
46
47 m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro])
48
49 AC_INIT(pixman, pixman_version, "sandmann@daimi.au.dk", pixman)
50 AM_INIT_AUTOMAKE([dist-bzip2])
51
52 AM_CONFIG_HEADER(config.h)
53
54 AC_PROG_CC
55 AC_PROG_LIBTOOL
56 AC_CHECK_FUNCS([getisax])
57 AC_C_BIGENDIAN
58
59
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:
62 #
63 #      pixman-$(pixman_major).0.minor.micro
64 #
65 m4_define([lt_current], [pixman_minor])
66 m4_define([lt_revision], [pixman_micro])
67 m4_define([lt_age], [pixman_minor])
68
69 LT_VERSION_INFO="lt_current:lt_revision:lt_age"
70
71 PIXMAN_MAJOR=pixman_major
72 AC_SUBST(PIXMAN_MAJOR)
73
74 AC_SUBST(LT_VERSION_INFO)
75
76 # Check for dependencies
77 #PKG_CHECK_MODULES(DEP, x11)
78
79 changequote(,)dnl
80 if test "x$GCC" = "xyes"; then
81   case " $CFLAGS " in
82   *[\ \ ]-Wall[\ \      ]*) ;;
83   *) CFLAGS="$CFLAGS -Wall" ;;
84   esac fi changequote([,])dnl
85
86 dnl ===========================================================================
87 dnl Check for MMX
88
89 MMX_CFLAGS="-mmmx -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
90
91 have_mmx_intrinsics=no
92 AC_MSG_CHECKING(whether to use MMX intrinsics)
93 xserver_save_CFLAGS=$CFLAGS
94 CFLAGS="$CFLAGS $MMX_CFLAGS"
95 AC_COMPILE_IFELSE([
96 #if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
97 #error "Need GCC >= 3.4 for MMX intrinsics"
98 #endif
99 #include <mmintrin.h>
100 int main () {
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)
106
107 if test $have_mmx_intrinsics = yes ; then
108    AC_DEFINE(USE_MMX, 1, [use MMX compiler intrinsics])
109 else
110    MMX_CFLAGS=
111 fi
112
113 AM_CONDITIONAL(USE_MMX, test $have_mmx_intrinsics = yes)
114
115 dnl =======================================================
116
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
122 dnl supported).
123
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"
128
129 AC_COMPILE_IFELSE([
130 #if !defined(__amd64__) && !defined(__x86_64__)
131 #error "Need x86-64 for SSE"
132 #endif
133 #include <mmintrin.h>
134 #include <xmmintrin.h>
135 int main () {
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)
142
143 if test $have_sse_intrinsics = yes ; then
144    AC_DEFINE(USE_SSE, 1, [use SSE compiler intrinsics])
145    MMX_CFLAGS="-msse $MMX_CFLAGS"
146 fi
147
148 AM_CONDITIONAL(USE_SSE, test $have_sse_intrinsics = yes)
149
150 dnl ========================================================
151 AC_SUBST(MMX_CFLAGS)
152
153 PKG_CHECK_MODULES(GTK, [gtk+-2.0], [HAVE_GTK=yes], [HAVE_GTK=no])
154 AM_CONDITIONAL(HAVE_GTK, [test "x$HAVE_GTK" = xyes])
155
156 AC_SUBST(GTK_CFLAGS)
157 AC_SUBST(GTK_LIBS)
158 AC_SUBST(DEP_CFLAGS)
159 AC_SUBST(DEP_LIBS)
160                   
161 AC_OUTPUT([pixman-1.pc
162            Makefile
163            pixman/Makefile
164            test/Makefile])