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