mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2024-11-23 18:49:08 +08:00
autotools: test if compiler support -mavx and -msse4.1
This commit is contained in:
parent
54611c1cc8
commit
02a6970cf3
@ -20,8 +20,13 @@ lib_LTLIBRARIES = libtesseract_avx.la libtesseract_sse.la
|
||||
libtesseract_avx_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
|
||||
libtesseract_sse_la_LDFLAGS = -version-info $(GENERIC_LIBRARY_VERSION)
|
||||
endif
|
||||
|
||||
if AVX_OPT
|
||||
libtesseract_avx_la_CXXFLAGS = -mavx
|
||||
endif
|
||||
if SSE41_OPT
|
||||
libtesseract_sse_la_CXXFLAGS = -msse4.1
|
||||
endif
|
||||
|
||||
libtesseract_avx_la_SOURCES = dotproductavx.cpp
|
||||
|
||||
|
12
configure.ac
12
configure.ac
@ -115,6 +115,18 @@ case "${host_os}" in
|
||||
;;
|
||||
esac
|
||||
|
||||
## Checks for supported compiler options.
|
||||
AM_CONDITIONAL([AVX_OPT], false)
|
||||
AM_CONDITIONAL([SSE41_OPT], false)
|
||||
AX_CHECK_COMPILE_FLAG([-mavx], [avx=1], [avx=0])
|
||||
AX_CHECK_COMPILE_FLAG([-msse4.1], [sse41=1], [sse41=0])
|
||||
if test x$avx = x1; then
|
||||
AM_CONDITIONAL([AVX_OPT], true)
|
||||
fi
|
||||
if test x$sse41 = x1; then
|
||||
AM_CONDITIONAL([SSE41_OPT], true)
|
||||
fi
|
||||
|
||||
includedir="${includedir}/tesseract"
|
||||
|
||||
AC_ARG_WITH([extra-includes],
|
||||
|
Loading…
Reference in New Issue
Block a user