X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=configure.ac;h=c3c711c8dda595ca51b08a93a79d96f66f83f27c;hb=bb5ff2687815eff20757612de965663ef3a2525b;hp=5242799bbbec7cfe0f280553939548971bc0b317;hpb=7dfe845786920d50c6f93165ef6f539e6f4d1b53;p=profile%2Fivi%2Fpixman.git diff --git a/configure.ac b/configure.ac index 5242799..c3c711c 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,8 @@ AC_PREREQ([2.57]) # # - The version in git has an odd MICRO version number # -# - Released versions both development and stable have an even MICRO -# version number +# - Released versions, both development and stable, have an +# even MICRO version number # # - Released development versions have an odd MINOR number # @@ -53,8 +53,8 @@ AC_PREREQ([2.57]) # m4_define([pixman_major], 0) -m4_define([pixman_minor], 21) -m4_define([pixman_micro], 5) +m4_define([pixman_minor], 25) +m4_define([pixman_micro], 3) m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro]) @@ -90,7 +90,7 @@ AC_DEFUN([PIXMAN_LINK_WITH_ENV],[dnl LIBS="" $1 AC_LINK_IFELSE( - [$2], + [AC_LANG_SOURCE([$2])], [pixman_cc_stderr=`test -f conftest.err && cat conftest.err` pixman_cc_flag=yes], [pixman_cc_stderr=`test -f conftest.err && cat conftest.err` @@ -119,7 +119,7 @@ for w in -Werror -errwarn; do [CFLAGS=$w], [int main(int c, char **v) { (void)c; (void)v; return 0; }], [WERROR=$w; yesno=yes], [yesno=no]) - AC_MSG_RESULT($_yesno) + AC_MSG_RESULT($yesno) fi done @@ -150,7 +150,7 @@ AC_CHECK_DECL([__amd64], [AMD64_ABI="yes"], [AMD64_ABI="no"]) # if we're using Sun Studio and neither the user nor a config.site # has set CFLAGS. if test $SUNCC = yes && \ - test "$test_CFLAGS" == "" && \ + test "x$test_CFLAGS" = "x" && \ test "$CFLAGS" = "-g" then CFLAGS="-O -g" @@ -192,35 +192,43 @@ dnl ========================================================================= dnl OpenMP for the test suite? dnl -# Check for OpenMP support (only supported by autoconf >=2.62) +# Check for OpenMP support only when autoconf support that (require autoconf >=2.62) OPENMP_CFLAGS= m4_ifdef([AC_OPENMP], [AC_OPENMP]) -m4_define([openmp_test_program],[dnl -#include +if test "x$enable_openmp" = "xyes" && test "x$ac_cv_prog_c_openmp" = "xunsupported" ; then + AC_MSG_WARN([OpenMP support requested but found unsupported]) +fi + +dnl May not fail to link without -Wall -Werror added +dnl So try to link only when openmp is supported +dnl ac_cv_prog_c_openmp is not defined when --disable-openmp is used +if test "x$ac_cv_prog_c_openmp" != "xunsupported" && test "x$ac_cv_prog_c_openmp" != "x"; then + m4_define([openmp_test_program],[dnl + #include -extern unsigned int lcg_seed; -#pragma omp threadprivate(lcg_seed) -unsigned int lcg_seed; + extern unsigned int lcg_seed; + #pragma omp threadprivate(lcg_seed) + unsigned int lcg_seed; -unsigned function(unsigned a, unsigned b) -{ + unsigned function(unsigned a, unsigned b) + { lcg_seed ^= b; return ((a + b) ^ a ) + lcg_seed; -} + } -int main(int argc, char **argv) -{ + int main(int argc, char **argv) + { int i; int n1 = 0, n2 = argc; unsigned checksum = 0; int verbose = argv != NULL; unsigned (*test_function)(unsigned, unsigned); test_function = function; - #pragma omp parallel for reduction(+:checksum) default(none) \ + #pragma omp parallel for reduction(+:checksum) default(none) \ shared(n1, n2, test_function, verbose) for (i = n1; i < n2; i++) - { + { unsigned crc = test_function (i, 0); if (verbose) printf ("%d: %08X\n", i, crc); @@ -228,18 +236,17 @@ int main(int argc, char **argv) } printf("%u\n", checksum); return 0; -} -]) + } + ]) -PIXMAN_LINK_WITH_ENV( + PIXMAN_LINK_WITH_ENV( [CFLAGS="$OPENMP_CFLAGS" LDFLAGS="$OPENMP_CFLAGS"], [openmp_test_program], [have_openmp=yes], [have_openmp=no]) -if test "x$have_openmp" = "xyes"; then - AC_DEFINE(USE_OPENMP, 1, [use OpenMP in the test suite]) -else - OPENMP_CFLAGS="" + if test "x$have_openmp" = "xyes" ; then + AC_DEFINE(USE_OPENMP, 1, [use OpenMP in the test suite]) + fi fi AC_SUBST(OPENMP_CFLAGS) @@ -252,14 +259,14 @@ PIXMAN_CHECK_CFLAG([-fvisibility=hidden], [dnl #error Have -fvisibility but it is ignored and generates a warning #endif #else -error Need GCC 4.0 for visibility +#error Need GCC 4.0 for visibility #endif ]) PIXMAN_CHECK_CFLAG([-xldscope=hidden], [dnl #if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) #else -error Need Sun Studio 8 for visibility +#error Need Sun Studio 8 for visibility #endif ]) @@ -283,20 +290,20 @@ have_mmx_intrinsics=no AC_MSG_CHECKING(whether to use MMX intrinsics) xserver_save_CFLAGS=$CFLAGS CFLAGS="$MMX_CFLAGS $CFLAGS" -AC_COMPILE_IFELSE([ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)) -error "Need GCC >= 3.4 for MMX intrinsics" +#error "Need GCC >= 3.4 for MMX intrinsics" #endif #include int main () { __m64 v = _mm_cvtsi32_si64 (1); return _mm_cvtsi64_si32 (v); -}], have_mmx_intrinsics=yes) +}]])], have_mmx_intrinsics=yes) CFLAGS=$xserver_save_CFLAGS AC_ARG_ENABLE(mmx, [AC_HELP_STRING([--disable-mmx], - [disable MMX fast paths])], + [disable x86 MMX fast paths])], [enable_mmx=$enableval], [enable_mmx=auto]) if test $enable_mmx = no ; then @@ -304,17 +311,17 @@ if test $enable_mmx = no ; then fi if test $have_mmx_intrinsics = yes ; then - AC_DEFINE(USE_MMX, 1, [use MMX compiler intrinsics]) + AC_DEFINE(USE_X86_MMX, 1, [use x86 MMX compiler intrinsics]) else MMX_CFLAGS= fi AC_MSG_RESULT($have_mmx_intrinsics) if test $enable_mmx = yes && test $have_mmx_intrinsics = no ; then - AC_MSG_ERROR([MMX intrinsics not detected]) + AC_MSG_ERROR([x86 MMX intrinsics not detected]) fi -AM_CONDITIONAL(USE_MMX, test $have_mmx_intrinsics = yes) +AM_CONDITIONAL(USE_X86_MMX, test $have_mmx_intrinsics = yes) dnl =========================================================================== dnl Check for SSE2 @@ -326,7 +333,7 @@ if test "x$SSE2_CFLAGS" = "x" ; then SSE2_CFLAGS="-xarch=sse2" fi else - SSE2_CFLAGS="-mmmx -msse2 -Winline" + SSE2_CFLAGS="-msse2 -Winline" fi fi @@ -335,7 +342,7 @@ AC_MSG_CHECKING(whether to use SSE2 intrinsics) xserver_save_CFLAGS=$CFLAGS CFLAGS="$SSE2_CFLAGS $CFLAGS" -AC_COMPILE_IFELSE([ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)) # if !defined(__amd64__) && !defined(__x86_64__) # error "Need GCC >= 4.2 for SSE2 intrinsics on x86" @@ -348,7 +355,7 @@ int main () { __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c; c = _mm_xor_si128 (a, b); return 0; -}], have_sse2_intrinsics=yes) +}]])], have_sse2_intrinsics=yes) CFLAGS=$xserver_save_CFLAGS AC_ARG_ENABLE(sse2, @@ -385,7 +392,7 @@ case $host_os in hwcap_save_LDFLAGS="$LDFLAGS" HWCAP_LDFLAGS='-Wl,-M,$(srcdir)/solaris-hwcap.mapfile' LDFLAGS="$LDFLAGS -Wl,-M,pixman/solaris-hwcap.mapfile" - AC_LINK_IFELSE([int main() { return 0; }], + AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])], use_hwcap_mapfile=yes, HWCAP_LDFLAGS="") LDFLAGS="$hwcap_save_LDFLAGS" @@ -400,6 +407,7 @@ case $host_os in ;; esac +AC_SUBST(IWMMXT_CFLAGS) AC_SUBST(MMX_CFLAGS) AC_SUBST(MMX_LDFLAGS) AC_SUBST(SSE2_CFLAGS) @@ -417,16 +425,16 @@ have_vmx_intrinsics=no AC_MSG_CHECKING(whether to use VMX/Altivec intrinsics) xserver_save_CFLAGS=$CFLAGS CFLAGS="$VMX_CFLAGS $CFLAGS" -AC_COMPILE_IFELSE([ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ #if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)) -error "Need GCC >= 3.4 for sane altivec support" +#error "Need GCC >= 3.4 for sane altivec support" #endif #include int main () { vector unsigned int v = vec_splat_u32 (1); v = vec_sub (v, v); return 0; -}], have_vmx_intrinsics=yes) +}]])], have_vmx_intrinsics=yes) CFLAGS=$xserver_save_CFLAGS AC_ARG_ENABLE(vmx, @@ -459,7 +467,7 @@ have_arm_simd=no AC_MSG_CHECKING(whether to use ARM SIMD assembler) xserver_save_CFLAGS=$CFLAGS CFLAGS="-x assembler-with-cpp $CFLAGS" -AC_COMPILE_IFELSE([[ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ .text .arch armv6 .object_arch armv4 @@ -469,7 +477,7 @@ AC_COMPILE_IFELSE([[ #error EABI is required (to be sure that calling conventions are compatible) #endif pld [r0] -uqadd8 r0, r0, r0]], have_arm_simd=yes) +uqadd8 r0, r0, r0]])], have_arm_simd=yes) CFLAGS=$xserver_save_CFLAGS AC_ARG_ENABLE(arm-simd, @@ -498,7 +506,7 @@ have_arm_neon=no AC_MSG_CHECKING(whether to use ARM NEON assembler) xserver_save_CFLAGS=$CFLAGS CFLAGS="-x assembler-with-cpp $CFLAGS" -AC_COMPILE_IFELSE([[ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ .text .fpu neon .arch armv7a @@ -510,7 +518,7 @@ AC_COMPILE_IFELSE([[ #error EABI is required (to be sure that calling conventions are compatible) #endif pld [r0] -vmovn.u16 d0, q0]], have_arm_neon=yes) +vmovn.u16 d0, q0]])], have_arm_neon=yes) CFLAGS=$xserver_save_CFLAGS AC_ARG_ENABLE(arm-neon, @@ -533,17 +541,113 @@ if test $enable_arm_neon = yes && test $have_arm_neon = no ; then AC_MSG_ERROR([ARM NEON intrinsics not detected]) fi +dnl =========================================================================== +dnl Check for IWMMXT + +if test "x$IWMMXT_CFLAGS" = "x" ; then + IWMMXT_CFLAGS="-march=iwmmxt -flax-vector-conversions -Winline" +fi + +have_iwmmxt_intrinsics=no +AC_MSG_CHECKING(whether to use ARM IWMMXT intrinsics) +xserver_save_CFLAGS=$CFLAGS +CFLAGS="$IWMMXT_CFLAGS $CFLAGS" +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#ifndef __arm__ +#error "IWMMXT is only available on ARM" +#endif +#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)) +#error "Need GCC >= 4.6 for IWMMXT intrinsics" +#endif +#include +int main () { + union { + __m64 v; + char c[8]; + } a = { .c = {1, 2, 3, 4, 5, 6, 7, 8} }; + int b = 4; + __m64 c = _mm_srli_si64 (a.v, b); +}]])], have_iwmmxt_intrinsics=yes) +CFLAGS=$xserver_save_CFLAGS + +AC_ARG_ENABLE(arm-iwmmxt, + [AC_HELP_STRING([--disable-arm-iwmmxt], + [disable ARM IWMMXT fast paths])], + [enable_iwmmxt=$enableval], [enable_iwmmxt=auto]) + +if test $enable_iwmmxt = no ; then + have_iwmmxt_intrinsics=disabled +fi + +if test $have_iwmmxt_intrinsics = yes ; then + AC_DEFINE(USE_ARM_IWMMXT, 1, [use ARM IWMMXT compiler intrinsics]) +else + IWMMXT_CFLAGS= +fi + +AC_MSG_RESULT($have_iwmmxt_intrinsics) +if test $enable_iwmmxt = yes && test $have_iwmmxt_intrinsics = no ; then + AC_MSG_ERROR([IWMMXT intrinsics not detected]) +fi + +AM_CONDITIONAL(USE_ARM_IWMMXT, test $have_iwmmxt_intrinsics = yes) + +dnl ========================================================================== +dnl Check if assembler is gas compatible and supports MIPS DSPr2 instructions + +have_mips_dspr2=no +AC_MSG_CHECKING(whether to use MIPS DSPr2 assembler) +xserver_save_CFLAGS=$CFLAGS +CFLAGS="-mdspr2 $CFLAGS" + +AC_COMPILE_IFELSE([[ +#if !(defined(__mips__) && __mips_isa_rev >= 2) +#error MIPS DSPr2 is currently only available on MIPS32r2 platforms. +#endif +int +main () +{ + int c = 0, a = 0, b = 0; + __asm__ __volatile__ ( + "precr.qb.ph %[c], %[a], %[b] \n\t" + : [c] "=r" (c) + : [a] "r" (a), [b] "r" (b) + ); + return c; +}]], have_mips_dspr2=yes) +CFLAGS=$xserver_save_CFLAGS + +AC_ARG_ENABLE(mips-dspr2, + [AC_HELP_STRING([--disable-mips-dspr2], + [disable MIPS DSPr2 fast paths])], + [enable_mips_dspr2=$enableval], [enable_mips_dspr2=auto]) + +if test $enable_mips_dspr2 = no ; then + have_mips_dspr2=disabled +fi + +if test $have_mips_dspr2 = yes ; then + AC_DEFINE(USE_MIPS_DSPR2, 1, [use MIPS DSPr2 assembly optimizations]) +fi + +AM_CONDITIONAL(USE_MIPS_DSPR2, test $have_mips_dspr2 = yes) + +AC_MSG_RESULT($have_mips_dspr2) +if test $enable_mips_dspr2 = yes && test $have_mips_dspr2 = no ; then + AC_MSG_ERROR([MIPS DSPr2 instructions not detected]) +fi + dnl ========================================================================================= dnl Check for GNU-style inline assembly support have_gcc_inline_asm=no AC_MSG_CHECKING(whether to use GNU-style inline assembler) -AC_COMPILE_IFELSE([ +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ int main () { /* Most modern architectures have a NOP instruction, so this is a fairly generic test. */ asm volatile ( "\tnop\n" : : : "cc", "memory" ); return 0; -}], have_gcc_inline_asm=yes) +}]])], have_gcc_inline_asm=yes) AC_ARG_ENABLE(gcc-inline-asm, [AC_HELP_STRING([--disable-gcc-inline-asm], @@ -643,6 +747,11 @@ fi AC_CHECK_HEADER([sys/mman.h], [AC_DEFINE(HAVE_SYS_MMAN_H, [1], [Define to 1 if we have ])]) +AC_CHECK_FUNC(mmap, have_mmap=yes, have_mmap=no) +if test x$have_mmap = xyes; then + AC_DEFINE(HAVE_MMAP, 1, [Whether we have mmap()]) +fi + AC_CHECK_FUNC(mprotect, have_mprotect=yes, have_mprotect=no) if test x$have_mprotect = xyes; then AC_DEFINE(HAVE_MPROTECT, 1, [Whether we have mprotect()]) @@ -673,7 +782,7 @@ dnl Thread local storage support_for__thread=no AC_MSG_CHECKING(for __thread) -AC_LINK_IFELSE([ +AC_LINK_IFELSE([AC_LANG_SOURCE([[ #if defined(__MINGW32__) && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) #error This MinGW version has broken __thread support #endif @@ -682,7 +791,7 @@ AC_LINK_IFELSE([ #endif static __thread int x ; int main () { x = 123; return x; } -], support_for__thread=yes) +]])], support_for__thread=yes) if test $support_for__thread = yes; then AC_DEFINE([TOOLCHAIN_SUPPORTS__THREAD],[],[Whether the tool chain supports __thread]) @@ -694,7 +803,7 @@ dnl dnl posix tls dnl -m4_define([pthread_test_program],[dnl +m4_define([pthread_test_program],AC_LANG_SOURCE([[dnl #include #include @@ -727,7 +836,7 @@ main () } return 0; } -]) +]])) AC_DEFUN([PIXMAN_CHECK_PTHREAD],[dnl if test "z$support_for_pthread_setspecific" != "zyes"; then @@ -768,7 +877,7 @@ dnl __attribute__((constructor)) support_for_attribute_constructor=no AC_MSG_CHECKING(for __attribute__((constructor))) -AC_LINK_IFELSE([ +AC_LINK_IFELSE([AC_LANG_SOURCE([[ #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) /* attribute 'constructor' is supported since gcc 2.7, but some compilers * may only pretend to be gcc, so let's try to actually use it @@ -779,7 +888,7 @@ int main (void) { return x; } #else #error not gcc or gcc version is older than 2.7 #endif -], support_for_attribute_constructor=yes) +]])], support_for_attribute_constructor=yes) if test x$support_for_attribute_constructor = xyes; then AC_DEFINE([TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR], @@ -789,6 +898,24 @@ fi AC_MSG_RESULT($support_for_attribute_constructor) AC_SUBST(TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR) +dnl ================== +dnl libpng + +AC_ARG_ENABLE(libpng, AS_HELP_STRING([--enable-libpng], [Build support for libpng (default: auto)]), + [have_libpng=$enableval], [have_libpng=auto]) + +case x$have_libpng in + xyes) PKG_CHECK_MODULES(PNG, [libpng]) ;; + xno) ;; + *) PKG_CHECK_MODULES(PNG, [libpng], have_libpng=yes, have_libpng=no) ;; +esac + +if test x$have_libpng = xyes; then + AC_DEFINE([HAVE_LIBPNG], [1], [Whether we have libpng]) +fi + +AC_SUBST(HAVE_LIBPNG) + AC_OUTPUT([pixman-1.pc pixman-1-uninstalled.pc Makefile