X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=configure.ac;h=5ca062a32d1d784d2282c970b219250ae75c21e0;hb=f73f7985318bf0e7446941d9bea9a94b35580342;hp=0d51bd086f3a5394c9af676d9193d27db1968066;hpb=89868e93bd8d66f0fac0f0b42cf7718756992e4e;p=profile%2Fivi%2Fpixman.git diff --git a/configure.ac b/configure.ac index 0d51bd0..5ca062a 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], 8) +m4_define([pixman_minor], 25) +m4_define([pixman_micro], 2) 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` @@ -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" @@ -259,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 ]) @@ -290,20 +290,23 @@ 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 +#if defined(__clang__) +#error "clang chokes on the inline assembly in pixman-mmx.c" #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 @@ -311,17 +314,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 @@ -342,7 +345,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" @@ -355,7 +358,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, @@ -392,7 +395,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" @@ -407,6 +410,7 @@ case $host_os in ;; esac +AC_SUBST(IWMMXT_CFLAGS) AC_SUBST(MMX_CFLAGS) AC_SUBST(MMX_LDFLAGS) AC_SUBST(SSE2_CFLAGS) @@ -424,16 +428,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, @@ -466,7 +470,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 @@ -476,7 +480,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, @@ -505,7 +509,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 @@ -517,7 +521,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, @@ -540,17 +544,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], @@ -650,6 +750,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()]) @@ -680,7 +785,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 @@ -689,7 +794,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]) @@ -701,7 +806,7 @@ dnl dnl posix tls dnl -m4_define([pthread_test_program],[dnl +m4_define([pthread_test_program],AC_LANG_SOURCE([[dnl #include #include @@ -734,7 +839,7 @@ main () } return 0; } -]) +]])) AC_DEFUN([PIXMAN_CHECK_PTHREAD],[dnl if test "z$support_for_pthread_setspecific" != "zyes"; then @@ -775,7 +880,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 @@ -786,7 +891,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], @@ -796,6 +901,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