From 350fa7f0dee4b2f6275bac0c9e8788da0df2efb7 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 8 Dec 2019 15:48:27 +0100 Subject: [PATCH] build: Oops, have configure honor --host. This allows ./configure --host=i686-unknown-linux-gnu instead of CC=i686-unknown-linux-gnu-gcc ./configure * configure (main): Honor --host. --- configure | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/configure b/configure index fe005f68..e45734ab 100755 --- a/configure +++ b/configure @@ -442,7 +442,8 @@ Some influential environment variables: mes-seed)) (tinycc-prefix (or (getenv "TINYCC_PREFIX") (string-append srcdest "../tinycc-prefix"))) - (gcc (or (getenv "CC") "gcc")) + (cross? (not (equal? host-type build-type))) + (gcc (or (getenv "CC") (if cross? (string-append host-type "-" "gcc") "gcc"))) (tcc (or (getenv "TCC") "tcc")) (mescc (or (getenv "MESCC") "mescc")) (deps (fold (lambda (program results) @@ -510,9 +511,9 @@ Some influential environment variables: deps) deps)) (system-libc? (and with-system-libc? (file-name "if cc can create executables" deps))) - (build-type (or (and cc (gulp-pipe* cc "-dumpmachine")) build-type)) - (build-type-list (string-split build-type #\-)) - (mes-cpu (car build-type-list)) + (host-type (or (and cc (gulp-pipe* cc "-dumpmachine")) host-type)) + (host-type-list (string-split host-type #\-)) + (mes-cpu (car host-type-list)) (mes-cpu (cond ((member mes-cpu '("i386" "i486" "i586" "i686")) "x86") ((member mes-cpu '("arm" "armv4" "armv7l")) "arm") (else mes-cpu))) @@ -520,7 +521,7 @@ Some influential environment variables: "32")) (mes-libc (if system-libc? "system" "mes")) - (kernel-list (filter (compose not (cut member <> '("pc" "unknown"))) (cdr build-type-list))) + (kernel-list (filter (compose not (cut member <> '("pc" "unknown"))) (cdr host-type-list))) (mes-kernel (cond ((or (equal? '("linux" "gnu") kernel-list) (equal? "linux" (car kernel-list))) "linux") ((equal? '( "gnu") kernel-list) "gnu")