Update tizen 2.0 beta source
[external/liboil.git] / configure.ac
1 AC_PREREQ([2.58])
2 AC_INIT(liboil,0.3.17)
3
4 AS_NANO(LIBOIL_CVS=no,LIBOIL_CVS=yes)
5
6 AC_CANONICAL_HOST([])
7 AM_INIT_AUTOMAKE(1.6)
8
9 AM_MAINTAINER_MODE
10
11 #LIBOIL_MAJORMINOR=0.3
12 #AC_SUBST(LIBOIL_MAJORMINOR)
13
14 AM_CONFIG_HEADER(config.h)
15
16 dnl CURRENT, REVISION, AGE
17 dnl - library source changed -> increment REVISION
18 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
19 dnl - interfaces added -> increment AGE
20 dnl - interfaces removed -> AGE = 0
21 LIBOIL_LIBVERSION="3:0:3"
22 AC_SUBST(LIBOIL_LIBVERSION)
23 AC_LIBTOOL_WIN32_DLL
24 AC_LIBTOOL_TAGS([])
25 AC_PROG_LIBTOOL
26 AM_PROG_AS
27
28 AC_CONFIG_SRCDIR([liboil/liboil.h])
29 AC_CONFIG_MACRO_DIR([m4])
30
31 PKG_CHECK_MODULES(GLIB, glib-2.0, HAVE_GLIB=yes, HAVE_GLIB=no)
32 AC_SUBST(GLIB_LIBS)
33 AC_SUBST(GLIB_CFLAGS)
34 AC_ARG_ENABLE(glib,
35 AC_HELP_STRING([--disable-glib],[disable usage of glib]),
36 [case "${enableval}" in
37   yes) HAVE_GLIB=yes ;;
38   no) HAVE_GLIB=no ;;
39   *) AC_MSG_ERROR(bad value ${enableval} for --disable-glib) ;;
40 esac])
41 AM_CONDITIONAL(HAVE_GLIB, test "x$HAVE_GLIB" = "xyes")
42
43 AC_ARG_ENABLE(prototype-checking,
44   AC_HELP_STRING([--enable-prototype-checking],[compile with strict prototype checking]),
45   enable_proto_check=$enableval,enable_proto_check=no)
46 if test "x$enable_proto_check" = xyes ; then
47   AC_DEFINE(LIBOIL_STRICT_PROTOTYPES,1,[Defined if prototype checking enabled])
48 fi
49
50 AC_ARG_WITH(alternate-optimization,
51   AC_HELP_STRING([--with-alternate-optimization=CFLAGS],[compile with alternate optimization flags]),
52   [enable_alt_opt=yes; LIBOIL_OPT_CFLAGS=$withval],enable_alt_opt=no)
53 if test "x$enable_alt_opt" = xyes ; then
54   LIBOIL_OPT_CFLAGS="$LIBOIL_OPT_CFLAGS -D'OIL_OPT_MANGLE(a)=a\#\#_alt' -D'OIL_OPT_SUFFIX=\"_alt\"'"
55 fi
56 AM_CONDITIONAL(USE_ALT_OPT, test "x$enable_alt_opt" = xyes)
57 AC_SUBST(LIBOIL_OPT_CFLAGS)
58
59 AC_ARG_ENABLE(broken-implementations,
60   AC_HELP_STRING([--enable-broken-implementations],[compile with broken implementations]),
61   enable_broken_implementations=$enableval,enable_broken_implementations=no)
62 if test "x$enable_broken_implementations" = xyes ; then
63   AC_DEFINE(ENABLE_BROKEN_IMPLS, 1, [Define if compiling broken implementations])
64 fi
65
66 #AC_ARG_ENABLE(new-abi,
67 #  AC_HELP_STRING([--enable-new-abi],[enable experimental 0.4 ABI]),
68 #  enable_new_abi=$enableval,enable_new_abi=no)
69 if test "x$enable_new_abi" = xyes ; then
70   AC_DEFINE(ENABLE_NEW_ABI, 1, [Define if compiling new ABI])
71 fi
72 AM_CONDITIONAL(USE_NEW_ABI, test "x$enable_new_abi" = xyes)
73 if test "x$enable_new_abi" = xyes ; then
74   LIBOIL_MAJORMINOR=0.4
75   LIBOIL_OLD_MAJORMINOR=0.3
76 else 
77   LIBOIL_MAJORMINOR=0.3
78   LIBOIL_OLD_MAJORMINOR=0.2
79 fi
80 AC_SUBST(LIBOIL_MAJORMINOR)
81 AC_SUBST(LIBOIL_OLD_MAJORMINOR)
82
83 ##################################################
84 # Check for gtk-doc.
85 ##################################################
86
87 if test "x$cross_compiling" = "xyes" ; then
88   enable_gtk_doc=no
89 fi
90 GTK_DOC_CHECK([1.0])
91
92
93 AS_GCC_INLINE_ASSEMBLY([HAVE_GCC_ASM=yes], [HAVE_GCC_ASM=no])
94 if test x$HAVE_GCC_ASM = xyes ; then
95   AC_DEFINE(HAVE_GCC_ASM, 1,
96     [Define if compiler supports gcc inline assembly])
97 fi
98 AM_CONDITIONAL(HAVE_GCC_ASM, test "x$HAVE_GCC_ASM" = "xyes")
99
100 AS_HOST_DEFINES()
101
102 AS_GCC_ASM_POWERPC_FPU([HAVE_GCC_ASM_POWERPC_FPU=yes],
103   [HAVE_GCC_ASM_POWERPC_FPU=no])
104 if test x$HAVE_GCC_ASM_POWERPC_FPU = xyes ; then
105   AC_DEFINE(HAVE_GCC_ASM_POWERPC_FPU, 1,
106     [Define if compiler supports PowerPC FPU instructions])
107 fi
108 AM_CONDITIONAL(HAVE_GCC_ASM_POWERPC_FPU,
109   test "x$HAVE_GCC_ASM_POWERPC" = "xyes")
110
111 AC_C_BIGENDIAN
112 AS_UNALIGNED_ACCESS
113
114 AC_LTDL_SYMBOL_USCORE
115 if test x${lt_cv_sys_symbol_underscore} = xyes ; then
116   AC_DEFINE(HAVE_SYMBOL_UNDERSCORE, 1, [Define if C symbols have leading underscore])
117 fi
118
119 AX_CREATE_STDINT_H([liboil/liboil-stdint.h])
120
121 AC_FUNC_MMAP()
122 AC_CHECK_LIB(m, rint,
123   AC_DEFINE(HAVE_RINT, 1, [Define if rint() is available]))
124 AC_CHECK_LIB(m, rintf,
125   AC_DEFINE(HAVE_RINTF, 1, [Define if rintf() is available]))
126 AC_CHECK_LIB(m, lrint,
127   AC_DEFINE(HAVE_LRINT, 1, [Define if lrint() is available]))
128 AC_CHECK_LIB(m, lrintf,
129   AC_DEFINE(HAVE_LRINTF, 1, [Define if lrintf() is available]))
130 AC_CHECK_LIB(m, sincos,
131   AC_DEFINE(HAVE_SINCOS, 1, [Define if sincos() is available]))
132
133 AC_CHECK_HEADER(ieee754.h,
134   AC_DEFINE(HAVE_IEEE754_H, 1, [Define if ieee754.h exists]))
135
136 AC_CHECK_HEADERS([inttypes.h])
137 AC_CHECK_HEADERS([sys/time.h])
138 AC_CHECK_HEADERS([unistd.h])
139
140 AC_CHECK_FUNCS([gettimeofday])
141 AC_CHECK_FUNCS([sigaction])
142 AC_CHECK_FUNCS([sigsetjmp])
143
144 AC_CHECK_LIBM
145 AC_SUBST(LIBM)
146
147 AC_CHECK_LIB(rt, clock_gettime,
148    AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Defined if we have clock_gettime()])
149    LIBRT=-lrt
150    )
151 AC_SUBST(LIBRT)
152
153 AC_CACHE_CHECK(for monotonic clocks,
154     oil_cv_monotonic_clock,AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
155 #include <time.h>
156 #include <unistd.h>
157 int main() {
158 #if !(defined(_POSIX_MONOTONIC_CLOCK) && _POSIX_MONOTONIC_CLOCK >= 0 && defined(CLOCK_MONOTONIC))
159         #error No monotonic clock
160 #endif
161         return 0;
162 }
163 ]])],oil_cv_monotonic_clock=yes,oil_cv_monotonic_clock=no))
164 if test "$oil_cv_monotonic_clock" = "yes"; then
165   AC_DEFINE(HAVE_MONOTONIC_CLOCK,1,[Defined if we have a monotonic clock])
166 fi
167
168 AS_COMPILER_FLAG(-Wall, LIBOIL_CFLAGS="$LIBOIL_CFLAGS -Wall")
169 if test "x$LIBOIL_CVS" = "xyes"
170 then
171   AS_COMPILER_FLAG(-Werror, LIBOIL_CFLAGS="$LIBOIL_CFLAGS -Werror")
172 fi
173 if test x$HAVE_GCC_ASM = xyes -a x$HAVE_POWERPC = xyes ; then
174   AS_COMPILER_FLAG(["-Wa,-maltivec"],
175     [LIBOIL_CFLAGS="$LIBOIL_CFLAGS -Wa,-maltivec"],
176     true)
177   AS_COMPILER_FLAG(["-Wa,-mregnames"],
178     [LIBOIL_CFLAGS="$LIBOIL_CFLAGS -Wa,-mregnames"],
179     true)
180   AS_COMPILER_FLAG(["-force_cpusubtype_ALL"],
181     [LIBOIL_CFLAGS="$LIBOIL_CFLAGS -force_cpusubtype_ALL"],
182     true)
183   AS_COMPILER_FLAG(["-fno-tree-vectorize"],
184     [LIBOIL_CFLAGS="$LIBOIL_CFLAGS -fno-tree-vectorize"],
185     true)
186 fi
187
188 AC_ARG_ENABLE(vfp,
189   AC_HELP_STRING([--enable-vfp],[compile with Vector Floating-point unit support]),
190   enable_vfp=$enableval,enable_vfp=yes)
191 if test "x$enable-vfp" = xyes -a x$HAVE_GCC_ASM = xyes -a x$HAVE_ARM = xyes; then
192   AS_COMPILER_FLAG(["-Wa,-mfpu=vfp"],
193     [VFP_CFLAGS="$VFP_CFLAGS -mfpu=vfp"],
194     true)
195   #AS_COMPILER_FLAG(["-Wa,-mfloat-abi=softfp"],
196   #  [VFP_CFLAGS="$VFP_CFLAGS -mfloat-abi=softfp"],
197   #  true)
198 fi
199 AC_SUBST(VFP_CFLAGS)
200
201 #AS_COMPILER_FLAG(["-fasm-blocks"], HAVE_ASM_BLOCKS=yes, HAVE_ASM_BLOCKS=no)
202 HAVE_ASM_BLOCKS=no
203 if test "x$HAVE_ASM_BLOCKS" = "xyes"
204 then
205   LIBOIL_CFLAGS="$LIBOIL_CFLAGS -fasm-blocks"
206 fi
207 AM_CONDITIONAL(HAVE_ASM_BLOCKS, test "x$HAVE_ASM_BLOCKS" = "xyes")
208
209 #if test "x$HAVE_I386" = "xyes"
210 #then
211 #  # I'd write a test for this, but as of 4.1.2, gcc is still broken
212 #  AC_DEFINE(USE_SSE_WRAPPER, 1, [Defined if SSE functions need stack alignment wrappers])
213 #fi
214
215 AS_MMX_INTRINSICS(MMX_CFLAGS, HAVE_MMX_INTRINSICS=yes, HAVE_MMX_INTRINSICS=no)
216 AS_SSE_INTRINSICS(SSE_CFLAGS, HAVE_SSE_INTRINSICS=yes, HAVE_SSE_INTRINSICS=no)
217 AS_SSE2_INTRINSICS(SSE2_CFLAGS, HAVE_SSE2_INTRINSICS=yes, HAVE_SSE2_INTRINSICS=no)
218 AS_SSE3_INTRINSICS(SSE3_CFLAGS, HAVE_SSE3_INTRINSICS=yes, HAVE_SSE3_INTRINSICS=no)
219 AS_3DNOW_INTRINSICS(_3DNOW_CFLAGS, HAVE_3DNOW_INTRINSICS=yes, HAVE_3DNOW_INTRINSICS=no)
220 AS_3DNOWEXT_INTRINSICS(_3DNOWEXT_CFLAGS, HAVE_3DNOWEXT_INTRINSICS=yes, HAVE_3DNOWEXT_INTRINSICS=no)
221 AS_ALTIVEC_INTRINSICS(ALTIVEC_CFLAGS, HAVE_ALTIVEC_INTRINSICS=yes, HAVE_ALTIVEC_INTRINSICS=no)
222
223 AM_CONDITIONAL(HAVE_MMX_INTRINSICS, test "x$HAVE_MMX_INTRINSICS" = "xyes")
224 AM_CONDITIONAL(HAVE_SSE_INTRINSICS, test "x$HAVE_SSE_INTRINSICS" = "xyes")
225 AM_CONDITIONAL(HAVE_SSE2_INTRINSICS, test "x$HAVE_SSE2_INTRINSICS" = "xyes")
226 AM_CONDITIONAL(HAVE_SSE3_INTRINSICS, test "x$HAVE_SSE3_INTRINSICS" = "xyes")
227 AM_CONDITIONAL(HAVE_3DNOW_INTRINSICS, test "x$HAVE_3DNOW_INTRINSICS" = "xyes")
228 AM_CONDITIONAL(HAVE_3DNOWEXT_INTRINSICS, test "x$HAVE_3DNOWEXT_INTRINSICS" = "xyes")
229 AM_CONDITIONAL(HAVE_ALTIVEC_INTRINSICS, test "x$HAVE_ALTIVEC_INTRINSICS" = "xyes")
230
231 AC_SUBST(MMX_CFLAGS)
232 AC_SUBST(SSE_CFLAGS)
233 AC_SUBST(SSE2_CFLAGS)
234 AC_SUBST(SSE3_CFLAGS)
235 AC_SUBST(_3DNOW_CFLAGS)
236 AC_SUBST(_3DNOWEXT_CFLAGS)
237 AC_SUBST(ALTIVEC_CFLAGS)
238
239 dnl binutils-2.18 required for this, but is too new for FreeBSD/Solaris
240 AS_GCC_INLINE_ASM_INSTRUCTION([pmaddubsw %%mm0, %%mm0], [HAVE_SSSE3_ASM=yes], [HAVE_SSSE3_ASM=no])
241 if test "x$HAVE_SSSE3_ASM" = xyes ; then
242   AC_DEFINE(HAVE_SSSE3_ASM, 1, [Defined if compiler/assembler can handle SSSE3 instructions])
243 fi
244
245 AC_DEFINE(OIL_EXPORTS, 1, [Defined for compiling internal code])
246
247 LIBOIL_CFLAGS="$LIBOIL_CFLAGS -D_BSD_SOURCE -D_GNU_SOURCE -I\$(top_srcdir) -DOIL_ENABLE_UNSTABLE_API"
248 AC_SUBST(LIBOIL_CFLAGS)
249
250 LIBOIL_LIBS="\$(top_builddir)/liboil/liboil-$LIBOIL_MAJORMINOR.la $LIBM $LIBRT"
251 AC_SUBST(LIBOIL_LIBS)
252
253 pkgconfigdir="\$(libdir)/pkgconfig"
254 AC_SUBST(pkgconfigdir)
255
256 AC_CONFIG_FILES([
257 Makefile 
258 doc/Makefile
259 liboil/Makefile
260 liboil/amd64/Makefile
261 liboil/3dnow/Makefile
262 liboil/c/Makefile
263 liboil/colorspace/Makefile
264 liboil/conv/Makefile
265 liboil/copy/Makefile
266 liboil/dct/Makefile
267 liboil/deprecated/Makefile
268 liboil/fb/Makefile
269 liboil/i386/Makefile
270 liboil/i386_amd64/Makefile
271 liboil/jpeg/Makefile
272 liboil/math/Makefile
273 liboil/md5/Makefile
274 liboil/mmx/Makefile
275 liboil/motovec/Makefile
276 liboil/powerpc/Makefile
277 liboil/powerpc_asm_blocks/Makefile
278 liboil/ref/Makefile
279 liboil/simdpack/Makefile
280 liboil/sse/Makefile
281 liboil/utf8/Makefile
282 liboil/arm/Makefile
283 testsuite/Makefile
284 testsuite/instruction/Makefile
285 examples/Makefile
286 examples/audioresample/Makefile
287 examples/huffman/Makefile
288 examples/jpeg/Makefile
289 examples/md5/Makefile
290 examples/taylor/Makefile
291 examples/uberopt/Makefile
292 examples/videoscale/Makefile
293 examples/work/Makefile
294 liboil-uninstalled.pc
295 liboil.pc
296 ])
297 AC_OUTPUT
298
299
300