Skip to content

Commit

Permalink
Add flag to build compiler options with G++ on macOS.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ic committed Apr 13, 2018
1 parent 742a087 commit 708f554
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions configure.ac
Expand Up @@ -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],
Expand Down

0 comments on commit 708f554

Please sign in to comment.