~ chicken-core (chicken-5) c3b84891ce083f91fe6e46285324b15d100daa7a
commit c3b84891ce083f91fe6e46285324b15d100daa7a Author: Evan Hanson <evhan@foldling.org> AuthorDate: Tue Feb 27 22:19:26 2018 +1300 Commit: Evan Hanson <evhan@foldling.org> CommitDate: Mon Mar 19 08:21:18 2018 +1300 Adjust `build-platform' and `software-version' values for Cygwin and MinGW This changes the platform reporting for Cygwin and MinGW as follows: (build-platform) ; => clang, gnu, or unknown (was cygwin/mingw32) (software-version) ; => cygwin or mingw32 (was unknown on both) These differences are intended to reflect the fact that Cygwin can build software with either the GNU compiler toolchain or Clang (and Mingw presumably too), and that the runtime platform is known to be Cygwin or Mingw. Signed-off-by: Peter Bex <peter@more-magic.net> diff --git a/NEWS b/NEWS index 9d254a5a..3ea766cf 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,11 @@ - Removed the deprecated C_locative_ref and C_mutate2 C functions. - The trace buffer no longer holds on to thread objects, allowing them to be garbage collected sooner (#1356, thanks to Kristian Lein-Mathisen) + - On Cygwin and MinGW, the "build-platform" now corresponds to the + tool chain used (gnu, clang, unknown) like on *nix, while the + software-version is now "cygwin" or "mingw32" instead of "unknown". + This also means the features list will now contain the tool chain + on all platforms. - Compiler - Fixed an off by one allocation problem in generated C code for (list ...). diff --git a/chicken-install.scm b/chicken-install.scm index f679d1f8..b247a635 100644 --- a/chicken-install.scm +++ b/chicken-install.scm @@ -95,7 +95,7 @@ (define cached-only #f) (define platform - (if (eq? 'mingw32 (build-platform)) + (if (eq? 'mingw32 (software-version)) 'windows 'unix)) diff --git a/chicken.h b/chicken.h index ea957998..604a5935 100644 --- a/chicken.h +++ b/chicken.h @@ -680,12 +680,8 @@ void *alloca (); # define C_SOFTWARE_TYPE "unknown" #endif -#if defined(__CYGWIN__) -# define C_BUILD_PLATFORM "cygwin" -#elif defined(__SUNPRO_C) +#if defined(__SUNPRO_C) # define C_BUILD_PLATFORM "sun" -#elif defined(__MINGW32__) -# define C_BUILD_PLATFORM "mingw32" #elif defined(__clang__) # define C_BUILD_PLATFORM "clang" #elif defined(_AIX) @@ -724,6 +720,10 @@ void *alloca (); # define C_SOFTWARE_VERSION "aix" #elif defined(__GNU__) # define C_SOFTWARE_VERSION "hurd" +#elif defined(__CYGWIN__) +# define C_SOFTWARE_VERSION "cygwin" +#elif defined(__MINGW32__) +# define C_SOFTWARE_VERSION "mingw32" #else # define C_SOFTWARE_VERSION "unknown" #endif diff --git a/csc.scm b/csc.scm index 333efcd5..25694f4a 100644 --- a/csc.scm +++ b/csc.scm @@ -63,9 +63,9 @@ ;;; Parameters: -(define mingw (eq? (build-platform) 'mingw32)) +(define mingw (eq? (software-version) 'mingw32)) (define osx (eq? (software-version) 'macosx)) -(define cygwin (eq? (build-platform) 'cygwin)) +(define cygwin (eq? (software-version) 'cygwin)) (define aix (eq? (build-platform) 'aix)) (define elf diff --git a/eval.scm b/eval.scm index b777c412..78a2c73a 100644 --- a/eval.scm +++ b/eval.scm @@ -947,7 +947,7 @@ srfi-16 srfi-17 srfi-26 srfi-31 srfi-55 srfi-88)) ; syntax cont (define default-dynamic-load-libraries - (case (build-platform) + (case (software-version) ((cygwin) cygwin-default-dynamic-load-libraries) (else `(,(string-append "lib" install-lib-name))))) diff --git a/library.scm b/library.scm index e2be1e22..27d9ffe8 100644 --- a/library.scm +++ b/library.scm @@ -6436,7 +6436,7 @@ static C_word C_fcall C_setenv(C_word x, C_word y) { (define ##sys#windows-platform (and (eq? 'windows (software-type)) ;; Still windows even if 'Linux-like' - (not (eq? 'cygwin (build-platform))))) + (not (eq? 'cygwin (software-version))))) (define (chicken-version #!optional full) (define (get-config) diff --git a/pathname.scm b/pathname.scm index d61a0eca..43a615d9 100644 --- a/pathname.scm +++ b/pathname.scm @@ -229,7 +229,7 @@ ;;; normalize pathname for a particular platform (define normalize-pathname - (let ((bldplt (if (eq? (build-platform) 'mingw32) 'windows 'unix))) + (let ((bldplt (if (eq? (software-version) 'mingw32) 'windows 'unix))) (define (addpart part parts) (cond ((string=? "." part) parts) ((string=? ".." part) diff --git a/posix.scm b/posix.scm index 4f969541..df9ef13b 100644 --- a/posix.scm +++ b/posix.scm @@ -203,7 +203,7 @@ ;;; Quote string for shell: -(define (qs str #!optional (platform (build-platform))) +(define (qs str #!optional (platform (software-version))) (let* ((delim (if (eq? platform 'mingw32) #\" #\')) (escaped (if (eq? platform 'mingw32) "\"\"" "'\\''")) (escaped-parts diff --git a/scripts/makedist.scm b/scripts/makedist.scm index 5c804690..bc601ada 100644 --- a/scripts/makedist.scm +++ b/scripts/makedist.scm @@ -22,14 +22,11 @@ (define *platform* (let ((sv (symbol->string (software-version)))) (cond ((irregex-match ".*bsd" sv) "bsd") - (else - (case (build-platform) - ((mingw32) - (if (equal? (get-environment-variable "MSYSTEM") "MINGW32") - "mingw-msys" - "mingw32")) - ((msvc) "msvc") - (else sv)))))) + ((string=? sv "mingw32") + (if (equal? (get-environment-variable "MSYSTEM") "MINGW32") + "mingw-msys" + "mingw32")) + (else sv)))) (define *make* (cond ((string=? "bsd" *platform*) "gmake")Trap