summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-05-31 09:19:57 +0000
committermidipix <writeonce@midipix.org>2021-05-31 09:58:18 +0000
commitde5f2c5c1636b66af13d16f104e47efe3e1a587c (patch)
tree2451af8078120f0195945364d1ebfc46b6ade477 /configure
parentbf7ba6b7e1a5658a1c38ba74df0086fa7306f1ba (diff)
downloadsbpython2-de5f2c5c1636b66af13d16f104e47efe3e1a587c.tar.bz2
sbpython2-de5f2c5c1636b66af13d16f104e47efe3e1a587c.tar.xz
build system: configure: config_host(): added freestanding environment support.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 16 insertions, 2 deletions
diff --git a/configure b/configure
index 725cd6f..f770ae1 100755
--- a/configure
+++ b/configure
@@ -859,8 +859,22 @@ config_host()
mb_cfghost_cflags="${mb_cfghost_cflags#*: }"
- printf 'int main(void){return 0;}' \
- > "$mb_cfghost_tmpname"
+ if [ $mb_cc_environment = 'freestanding' ]; then
+ if [ -z "mb_cc_underscore" ]; then
+ mb_cfghost_start_fn='_start'
+ else
+ mb_cfghost_start_fn='start'
+ fi
+
+ printf 'int %s(void){return 0;}' "$mb_cfghost_start_fn" \
+ > "$mb_cfghost_tmpname"
+
+ mb_cfghost_cflags="$mb_cfghost_cflags -ffreestanding"
+ mb_cfghost_cflags="$mb_cfghost_cflags -nostdlib"
+ else
+ printf 'int main(void){return 0;}' \
+ > "$mb_cfghost_tmpname"
+ fi
# log
printf '\n' >&3