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.
This commit is contained in:
Jan Nieuwenhuizen 2019-12-08 15:48:27 +01:00
parent 65e223ff9b
commit 350fa7f0de
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 6 additions and 5 deletions

11
configure vendored
View File

@ -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")