diff --git a/configure.ac b/configure.ac index a9345eb28f..66b9fec860 100644 --- a/configure.ac +++ b/configure.ac @@ -131,6 +131,21 @@ if $sse41; then AM_CONDITIONAL([SSE41_OPT], true) fi +# Add platform-specific flags for the supported compiler options. +if $avx -o $avx2 -o $sse41; then + case "${host_os}" in + *darwin* | *-macos10*) + if test -z "$CLANG"; then + echo "MODIFYING FLAGS" + # When using AVX, AVX2, or SSE4.1: + # Must tell AS to use clang integrated assembler, + # instead of the GNU based system assembler. + CXXFLAGS="$CXXFLAGS -Wa,-q" + fi + ;; + esac +fi + includedir="${includedir}/tesseract" AC_ARG_WITH([extra-includes],