diff options
author | midipix <writeonce@midipix.org> | 2021-05-31 09:19:57 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2021-05-31 09:58:14 +0000 |
commit | 9938d58cdfe6e7a614cbc10f5d99cf0625edb4e9 (patch) | |
tree | 14026d1cf9dd400c865ef1937002d24bb3ccb5c8 /configure | |
parent | 7c3ae02059f68bd6c87f7eb8ef556eeafef28a9f (diff) | |
download | apimagic-9938d58cdfe6e7a614cbc10f5d99cf0625edb4e9.tar.bz2 apimagic-9938d58cdfe6e7a614cbc10f5d99cf0625edb4e9.tar.xz |
build system: configure: config_host(): added freestanding environment support.
Diffstat (limited to 'configure')
-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 |