X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=build-hc-pkg;h=e0e55f512c25a98bf8c50d4f1277339c5d036d27;hb=c733c44f3636fccd086bcbef8b3bc81602a8fa49;hp=87e34ef9ef0b63e70f6ca1993ff8d25a14b0810a;hpb=a3d4e6a453a70d4321fb469538a108c98f850ab1;p=build-hc-pkg.git diff --git a/build-hc-pkg b/build-hc-pkg index 87e34ef..e0e55f5 100755 --- a/build-hc-pkg +++ b/build-hc-pkg @@ -4,26 +4,19 @@ set -e function detect_platform_type () { local -r canon_name="canon-name/src/canon-name" - if [[ ! -x "$canon_name" ]]; then - gmake -f mk/canon-name.mk + if ! gmake --question --file="mk/canon-name.mk" >/dev/null 2>&1; then + gmake --file="mk/canon-name.mk" >&2 fi "$canon_name" } function detect_number_of_cpus () { - local -r platform=$(detect_platform_type) - - case "$platform" in - *-*-darwin) - ioreg -r -c IOCPU | fgrep -c IOCPUNumber - ;; - *) - echo "WARNING: I don't know how to detect the number of processors on this platform." >&2 - echo "WARNING: GHC will be built using only 1 processor. Expect some slowdown." >&2 - echo 1 - ;; - esac + if ! sysctl -n hw.ncpu; then + echo "WARNING: I don't know how to detect the number of processors on this platform." >&2 + echo "WARNING: GHC will be built using only 1 processor. Expect some slowdown." >&2 + echo 1 + fi } function detect_gnu_tar () {