diff options
author | midipix <writeonce@midipix.org> | 2021-05-31 09:19:57 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2021-05-31 09:58:16 +0000 |
commit | db53aa819d39d0ec09d4439a40a81a3bcbcf7a9c (patch) | |
tree | e238bdddd4cc91b4f6040da15c07d0c914ad08df | |
parent | 9f7b0adb5c26f589dd21ee0b4b57baa29795d5f2 (diff) | |
download | mmglue-db53aa819d39d0ec09d4439a40a81a3bcbcf7a9c.tar.bz2 mmglue-db53aa819d39d0ec09d4439a40a81a3bcbcf7a9c.tar.xz |
build system: configure: config_host(): added freestanding environment support.
-rwxr-xr-x | configure | 18 |
1 files changed, 16 insertions, 2 deletions
@@ -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 |