Merge pull request #2000 from tonytheodore/hyperscan-arch

hyperscan: fix build where native SSSE3 detection fails
This commit is contained in:
Tony Theodore 2017-12-09 09:24:46 +11:00 committed by GitHub
commit 11151e7310
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -10,12 +10,22 @@ $(PKG)_GH_CONF := 01org/hyperscan/tags, v
$(PKG)_DEPS := gcc boost
# $(PKG)_NATIVE_DEPS := ragel
# Add the following options to run on (virtual) machine without AVX2 or
# build on machine where native detection of SSSE3 may fail
# -DCMAKE_C_FLAGS="-march=core2" -DCMAKE_CXX_FLAGS="-march=core2"
$(PKG)_ARCH_FLAGS = \
$(TARGET)-gcc -xc /dev/null -o- -S -fverbose-asm \
-march=native | \
grep mssse3 >/dev/null 2>&1 || \
echo -march=core2
define $(PKG)_BUILD
# Add the following options to run on (virtual) machine without AVX2
# -DCMAKE_C_FLAGS="-march=core2" -DCMAKE_CXX_FLAGS="-march=core2"
cd '$(BUILD_DIR)' && $(TARGET)-cmake \
-DRAGEL='$(PREFIX)/$(BUILD)/bin/ragel' \
-DMXE_DISABLE_INCLUDE_SYSTEM_FLAG=TRUE \
-DCMAKE_C_FLAGS="`$($(PKG)_ARCH_FLAGS)`" \
-DCMAKE_CXX_FLAGS="`$($(PKG)_ARCH_FLAGS)`" \
'$(SOURCE_DIR)'
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)' -j 1 install