summaryrefslogtreecommitdiff
path: root/project/config
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-06-19 16:52:38 +0000
committermidipix <writeonce@midipix.org>2021-06-19 16:52:38 +0000
commit5d8f7ae2d3ea618fe88695572b08a43e8195a920 (patch)
tree9ac40c5c86377245ae3e20ec3a50b048b0dcaf30 /project/config
parente64c9dfb9a3e3c032b1cb4c011977ecc71452204 (diff)
downloadsbpython3-5d8f7ae2d3ea618fe88695572b08a43e8195a920.tar.bz2
sbpython3-5d8f7ae2d3ea618fe88695572b08a43e8195a920.tar.xz
project: pyext: _decimal extension: added refined host configuration.
Diffstat (limited to 'project/config')
-rw-r--r--project/config/cfgdefs.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index c04c86d..fc13f41 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -239,6 +239,11 @@ cfgdefs_perform_common_tests()
cfgtest_newline
cfgtest_comment 'toolchain'
+ # math configuration
+ cfghost_x87_asm=
+ cfghost_x64_asm=
+ cfghost_aarch64_types=
+
# x87
mb_code_snippet=''
mb_code_snippet="$mb_code_snippet "'void fn(void)'
@@ -247,6 +252,7 @@ cfgdefs_perform_common_tests()
if cfgtest_code_snippet_asm "$mb_code_snippet"; then
cfgtest_cflags_append '-DHAVE_GCC_ASM_FOR_X87'
+ cfghost_x87_asm='yes'
fi
# x64
@@ -256,6 +262,30 @@ cfgdefs_perform_common_tests()
if cfgtest_code_snippet_asm "$mb_code_snippet"; then
cfgtest_cflags_append '-DHAVE_GCC_ASM_FOR_X64'
+ cfghost_x64_asm='yes'
+ fi
+
+ # aarch64
+ mb_code_snippet='__uint128_t aarch64_dummy = 0;'
+
+ if cfgtest_code_snippet_asm "$mb_code_snippet"; then
+ cfgtest_cflags_append '-DHAVE_GCC_UINT128_T'
+ cfghost_aarch64_types='yes'
+ fi
+
+ # math configuration selection
+ if [ $cfghost_aarch64_types = 'yes' ]; then
+ cfgtest_cflags_append '-DCONFIG_64'
+ cfgtest_cflags_append '-DANSI'
+ cfgtest_cflags_append '-DHAVE_UINT128_T'
+
+ elif [ $cfghost_x64_asm = 'yes' ]; then
+ cfgtest_cflags_append '-DCONFIG_64'
+ cfgtest_cflags_append '-DASM'
+
+ elif [ $cfghost_x87_asm = 'yes' ]; then
+ cfgtest_cflags_append '-DCONFIG_32'
+ cfgtest_cflags_append '-DANSI'
fi
# IEEE 754: little endian / big endian