summaryrefslogtreecommitdiffhomepage
path: root/sofort/ccenv
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-05-26 16:21:10 +0000
committermidipix <writeonce@midipix.org>2021-05-26 16:48:08 +0000
commita50316b3ade0002d60528bc1e27424313130fa4e (patch)
tree486fff4aafa77b9637aab06d1bda126db4d1f8e4 /sofort/ccenv
parent2eaecf1f99e61ab679af6a975d85a7de016cdafe (diff)
downloadntux-a50316b3ade0002d60528bc1e27424313130fa4e.tar.bz2
ntux-a50316b3ade0002d60528bc1e27424313130fa4e.tar.xz
build system: ccenv heuristics: generate $ccenv_image using strict syntax.
Diffstat (limited to 'sofort/ccenv')
-rw-r--r--sofort/ccenv/ccenv.sh43
1 files changed, 29 insertions, 14 deletions
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh
index 433fec0..2ba9426 100644
--- a/sofort/ccenv/ccenv.sh
+++ b/sofort/ccenv/ccenv.sh
@@ -762,13 +762,20 @@ ccenv_create_framework_executable()
rm -f $ccenv_image.tmp
fi
+ ccenv_tmpname='ccenv/c3RyaWN0X21vZGUK.c'
+
printf 'int main(void){return 0;}' \
- | $ccenv_cc -xc - \
- -o $ccenv_image \
- 2>&3 \
- || return 1
+ > "$ccenv_tmpname"
- return 0
+ if $ccenv_cc "$ccenv_tmpname" -o $ccenv_image 2>&3; then
+ ccenv_ret=0
+ else
+ ccenv_ret=1
+ fi
+
+ rm "$ccenv_tmpname"
+
+ return $ccenv_ret
}
ccenv_create_freestanding_executable()
@@ -784,17 +791,25 @@ ccenv_create_freestanding_executable()
ccenv_start_fn='start'
fi
- printf 'int %s(void){return 0;}' "$ccenv_start_fn" \
- | $ccenv_cc -xc - \
- -ffreestanding \
- -nostdlib -nostartfiles \
- -o $ccenv_image \
- 2>&3 \
- || return 1
+ ccenv_tmpname='ccenv/c3RyaWN0X21vZGUK.c'
- ccenv_freestd=yes
+ printf 'int %s(void){return 0;}' "$ccenv_start_fn" \
+ > "$ccenv_tmpname"
- return 0
+ if $ccenv_cc "$ccenv_tmpname" \
+ -ffreestanding \
+ -nostdlib -nostartfiles \
+ -o $ccenv_image \
+ 2>&3; then
+ ccenv_ret=0
+ ccenv_freestd=yes
+ else
+ ccenv_ret=1
+ fi
+
+ rm "$ccenv_tmpname"
+
+ return $ccenv_ret
}
ccenv_set_cc_binfmt_error()