1#
2# Copyright (c) 2016 Google, Inc.
3#
4# This code is released under the libpng license.
5# For conditions of distribution and use, see the disclaimer
6# and license in png.h
7#
8
9# In order to compile Intel SSE optimizations for libpng, please add
10# the following code to configure.ac under HOST SPECIFIC OPTIONS
11# directly beneath the section for ARM.
12
13# INTEL
14# ===
15#
16# INTEL SSE (SIMD) support.
17
18AC_ARG_ENABLE([intel-sse],
19   AS_HELP_STRING([[[--enable-intel-sse]]],
20      [Enable Intel SSE optimizations: =no/off, yes/on:]
21      [no/off: disable the optimizations;]
22      [yes/on: enable the optimizations.]
23      [If not specified: determined by the compiler.]),
24   [case "$enableval" in
25      no|off)
26         # disable the default enabling:
27         AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
28                   [Disable Intel SSE optimizations])
29         # Prevent inclusion of the assembler files below:
30         enable_intel_sse=no;;
31      yes|on)
32         AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
33                   [Enable Intel SSE optimizations]);;
34      *)
35         AC_MSG_ERROR([--enable-intel-sse=${enable_intel_sse}: invalid value])
36   esac])
37
38# Add Intel specific files to all builds where the host_cpu is Intel ('x86*')
39# or where Intel optimizations were explicitly requested (this allows a
40# fallback if a future host CPU does not match 'x86*')
41AM_CONDITIONAL([PNG_INTEL_SSE],
42   [test "$enable_intel_sse" != 'no' &&
43    case "$host_cpu" in
44      i?86|x86_64) :;;
45      *)    test "$enable_intel_sse" != '';;
46    esac])
47