aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-02-07 15:07:14 -0500
committerJack Lloyd <[email protected]>2018-02-07 15:07:14 -0500
commit7604dd4702ae61f74f37a91ab8f5177f04db8108 (patch)
tree7038d9d15007cd55b4287bd708061d7c5a1f6814 /src
parentd4ef204878ed7c675c16531a482cd373b8fa8b0b (diff)
parent5f55f0eac95cd6f1c2962aef261af285bf37bfb6 (diff)
Merge GH #1443 Detect compiler target arch at configure time fixes #1442
Diffstat (limited to 'src')
-rw-r--r--src/build-data/detect_arch.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/build-data/detect_arch.cpp b/src/build-data/detect_arch.cpp
new file mode 100644
index 000000000..aa5054093
--- /dev/null
+++ b/src/build-data/detect_arch.cpp
@@ -0,0 +1,50 @@
+
+#if defined(__x86_64__) || defined(_M_X64)
+ X86_64
+
+#elif defined(__i386__) || defined(__i386) || defined(_M_IX86)
+ X86_32
+
+#elif defined(__aarch64__) || defined(__ARM_ARCH_ISA_A64)
+ ARM64
+
+#elif defined(__arm__) || defined(_M_ARM) || defined(__ARM_ARCH_7A__)
+ ARM32
+
+#elif defined(__powerpc64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
+ PPC64
+
+#elif defined(__powerpc__) || defined(__ppc__) || defined(_ARCH_PPC)
+ PPC32
+
+#elif defined(__mips__) || defined(__mips)
+ MIPS32
+
+#elif defined(__sparc__)
+ SPARC32
+
+#elif defined(__alpha__)
+ ALPHA
+
+#elif defined(__hppa__) || defined(__hppa)
+ HPPA
+
+#elif defined(__ia64__)
+ IA64
+
+#elif defined(__m68k__)
+ M68K
+
+#elif defined(__sh__)
+ SH
+
+#elif defined(__s390x__)
+ S390X
+
+#elif defined(__s390__)
+ S390
+
+#else
+ UNKNOWN
+
+#endif