Add flag to build compiler options with G++ on macOS.

Building with G++ on Darwin breaks when either AVX, AVX2, or SSE4.1
compiler option is set, unless G++ is actually CLANG.

This commit allows to build with G++, by asking G++ to delegate assembly
to the clang integrated assembler, instead of the GNU one.
This commit is contained in:
Eric Platon 2018-04-13 09:39:40 +09:00
parent 742a087507
commit 708f55423b

View File

@ -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],