summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2017-12-08 22:24:46 (GMT)
committerGitHub <noreply@github.com>2017-12-08 22:24:46 (GMT)
commit11151e7310ec61d17b78f5004d24aa5ad8153686 (patch)
tree66e4c491e0ca34c4241a09db679648b90c2f6558 /src
parentcb213793042b3c60d0c9b6ce8821854f570721ea (diff)
parentcb65fe1439de4be32b41d02f19f0a619a592d444 (diff)
downloadmxe-11151e7310ec61d17b78f5004d24aa5ad8153686.zip
mxe-11151e7310ec61d17b78f5004d24aa5ad8153686.tar.gz
mxe-11151e7310ec61d17b78f5004d24aa5ad8153686.tar.bz2
Merge pull request #2000 from tonytheodore/hyperscan-arch
hyperscan: fix build where native SSSE3 detection fails
Diffstat (limited to 'src')
-rw-r--r--src/hyperscan.mk14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/hyperscan.mk b/src/hyperscan.mk
index cbea2f0..5179b54 100644
--- a/src/hyperscan.mk
+++ b/src/hyperscan.mk
@@ -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