This commit is contained in:
Ian Keane 2020-02-18 14:21:14 -05:00
parent 276853ba84
commit 1cb167b597
361 changed files with 77302 additions and 4 deletions

View file

@ -0,0 +1,46 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-abcl.lisp --- ABCL trivial-features implementation.
;;;
;;; Copyright (C) 2009, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
(pushnew (let ((order (jcall "toString"
(jstatic "nativeOrder" "java.nio.ByteOrder"))))
(cond ((string-equal order "LITTLE_ENDIAN")
:little-endian)
((string-equal order "BIG_ENDIAN")
:big-endian)
(t (error "Byte order ~A unknown" order))))
*features*)
;;;; OS
;;; ABCL already pushes :LINUX and :UNIX.
;;;; CPU
;;; ABCL already pushes :x86-64

View file

@ -0,0 +1,49 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-allegro.lisp --- Allegro implementation of trivial-features.
;;;
;;; Copyright (C) 2007, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
;;; Allegro already pushes :LITTLE-ENDIAN and :BIG-ENDIAN.
;;;; OS
;;; Allegro already pushes :LINUX and :UNIX.
#+mswindows (pushnew :windows *features*)
#+macosx (pushnew :darwin *features*)
;;; Pushing :BSD. (Make sure this list is complete.)
#+(or macosx darwin freebsd netbsd openbsd)
(pushnew :bsd *features*)
;;;; CPU
;;; Allegro already pushes :X86 and :X86-64.
;;; what about PPC64?
#+powerpc (pushnew :ppc *features*)

View file

@ -0,0 +1,36 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-clasp.lisp --- CLASP implementation of trivial-features.
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
;;; - Set by CLASP directly. Sets :LITTLE-ENDIAN or :BIG-ENDIAN
;;;; OS
;;; - Set by CLASP directly. Already pushes :DARWIN, :LINUX, :UNIX, :BSD
;;;; CPU
;;; - Set by CLASP directly. Already pushes :X86-64 (currently the only
;;; supported platform) - More will be added directly in CLASP as soon as
;;; porting is done.

View file

@ -0,0 +1,72 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-clisp.lisp --- CLISP trivial-features implementation.
;;;
;;; Copyright (C) 2007, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
(pushnew (intern (symbol-name (if sys::*big-endian*
'#:big-endian
'#:little-endian))
'#:keyword)
*features*)
;;;; OS
;;; CLISP already exports :UNIX.
#+win32 (pushnew :windows *features*)
#-win32
(eval-when (:compile-toplevel :load-toplevel :execute)
(pushnew (with-standard-io-syntax
(read-from-string
(format nil ":~(~A~)" (posix:uname-sysname (posix:uname)))))
*features*))
#+(or darwin freebsd netbsd openbsd)
(pushnew :bsd *features*)
;;;; CPU
;;; FIXME: not complete
(let ((cpu (cond
((or (member :pc386 *features*)
(member (machine-type) '("x86" "x86_64")
:test #'string-equal))
(if (member :word-size=64 *features*)
'#:x86-64
'#:x86))
((string= (machine-type) "POWER MACINTOSH")
'#:ppc)
((or (member (machine-type) '("SPARC" "SPARC64")
:test #'string-equal))
(if (member :word-size=64 *features*)
'#:sparc64
'#:sparc)))))
(when cpu
(pushnew (intern (symbol-name cpu) '#:keyword)
*features*)))

View file

@ -0,0 +1,44 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-cmucl.lisp --- CMUCL implementation of trivial-features.
;;;
;;; Copyright (C) 2007, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
(pushnew (alien:with-alien ((ptr (array (alien:unsigned 8) 2)))
(setf (sys:sap-ref-16 (alien:alien-sap ptr) 0) #xfeff)
(ecase (sys:sap-ref-8 (alien:alien-sap ptr) 0)
(#xfe (intern "BIG-ENDIAN" :keyword))
(#xff (intern "LITTLE-ENDIAN" :keyword))))
*features*)
;;;; OS
;;; CMUCL already pushes :UNIX, :BSD, :LINUX and :DARWIN.
;;;; CPU
;;; CMUCL already pushes :PPC and :X86.

View file

@ -0,0 +1,39 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-corman.lisp --- Corman Lisp implementation of trivial-features.
;;;
;;; Copyright (C) 2007, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
(pushnew :little-endian *features*)
;;;; OS
(pushnew :windows *features*)
;;;; CPU
(pushnew :x86 *features*)

View file

@ -0,0 +1,55 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-ecl.lisp --- ECL implementation of trivial-features.
;;;
;;; Copyright (C) 2007-2009, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
(pushnew (let ((ptr (ffi:allocate-foreign-object :unsigned-short)))
(unwind-protect
(progn
(setf (ffi:deref-pointer ptr :unsigned-short) #xfeff)
(ecase (ffi:deref-pointer ptr :unsigned-byte)
(#xfe (intern "BIG-ENDIAN" "KEYWORD"))
(#xff (intern "LITTLE-ENDIAN" "KEYWORD"))))
(ffi:free-foreign-object ptr)))
*features*)
;;;; OS
;;; ECL already pushes :DARWIN, :LINUX, :UNIX (except on Darwin) and :BSD.
#+darwin (pushnew :unix *features*)
#+win32 (pushnew :windows *features*)
;;;; CPU
;;; FIXME: add more
#+powerpc7450 (pushnew :ppc *features*)
#+x86_64 (pushnew :x86-64 *features*)
#+(or i386 i486 i586 i686) (pushnew :x86 *features*)
#+(or armv5l armv6l armv7l) (pushnew :arm *features*)
#+mipsel (pushnew :mips *features*)

View file

@ -0,0 +1,58 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-lispworks.lisp --- Lispworks implementation of trivial-features.
;;;
;;; Copyright (C) 2007, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
;;; Lispworks pushes :LITTLE-ENDIAN.
#-little-endian (pushnew :big-endian *features*)
#-(and)
(pushnew (fli:with-dynamic-foreign-objects ()
(let ((ptr (fli:alloca :type :byte :nelems 2)))
(setf (fli:dereference ptr :type '(:unsigned :short)) #xfeff)
(ecase (fli:dereference ptr :type '(:unsigned :byte))
(#xfe (intern "BIG-ENDIAN" :keyword))
(#xff (intern "LITTLE-ENDIAN" :keyword)))))
*features*)
;;;; OS
;;; Lispworks already pushes :DARWIN, :LINUX and :UNIX.
#+win32 (pushnew :windows *features*)
;;; Pushing :BSD. (Make sure this list is complete.)
#+(or darwin freebsd netbsd openbsd)
(pushnew :bsd *features*)
;;;; CPU
;;; Lispworks already pushes :X86.
#+powerpc (pushnew :ppc *features*)

View file

@ -0,0 +1,41 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-mcl.lisp --- Digitool MCL trivial-features implementation.
;;;
;;; Copyright (C) 2010, Chun Tian (binghe) <binghe.lisp@gmail.com>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
(pushnew :big-endian *features*)
;;;; OS
;;; MCL already pushes :UNIX and :DARWIN.
(pushnew :bsd *features*)
;;;; CPU
#+ppc-target (pushnew :ppc *features*)

View file

@ -0,0 +1,39 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-mezzano.lisp --- Mezzano trivial-features implementation.
;;;
;;; Copyright (C) 2009, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
;;; Mezzano already pushes :LITTLE-ENDIAN.
;;;; OS
;;; Mezzano already pushes :MEZZANO.
;;;; CPU
;;; Mezzano already pushes :X86-64.

View file

@ -0,0 +1,49 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-mkcl.lisp --- MKCL implementation of trivial-features.
;;;
;;; Copyright (C) 2007-2009, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
#-(or :little-endian :big-endian)
(pushnew (let ((ptr (ffi:allocate-foreign-object :unsigned-short)))
(unwind-protect
(progn
(setf (ffi:deref-pointer ptr :unsigned-short) #xfeff)
(ecase (ffi:deref-pointer ptr :unsigned-byte)
(#xfe (intern "BIG-ENDIAN" "KEYWORD"))
(#xff (intern "LITTLE-ENDIAN" "KEYWORD"))))
(ffi:free-foreign-object ptr)))
*features*)
;;;; OS
;;; MKCL conforms to SPEC
;;;; CPU
;;; MKCL conforms to SPEC

View file

@ -0,0 +1,40 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-mocl.lisp --- MOCL trivial-features implementation.
;;;
;;; Copyright (C) 2007, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
;;; MOCL already pushes :LITTLE-ENDIAN.
;;;; OS
;;; MOCL already pushes :IOS, :DARWIN, :BSD, and :UNIX for iOS,
;;; and :ANDROID, :LINUX, and :UNIX for Android.
;;;; CPU
;;; MOCL already pushes :ARM.

View file

@ -0,0 +1,47 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-openmcl.lisp --- OpenMCL trivial-features implementation.
;;;
;;; Copyright (C) 2007, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
(pushnew #+big-endian-target :big-endian
#+little-endian-target :little-endian
*features*)
;;;; OS
;;; OpenMCL already pushes :UNIX and :DARWIN.
#+linux-target (pushnew :linux *features*)
#+darwin (pushnew :bsd *features*)
;;;; CPU
;;; what about ppc64?
#+ppc-target (pushnew :ppc *features*)
#+x8664-target (pushnew :x86-64 *features*)

View file

@ -0,0 +1,51 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-sbcl.lisp --- SBCL trivial-features implementation.
;;;
;;; Copyright (C) 2007-2009, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
(pushnew (sb-alien:with-alien ((ptr (array (sb-alien:unsigned 8) 2)))
(setf (sb-sys:sap-ref-16 (sb-alien:alien-sap ptr) 0) #xfeff)
(ecase (sb-sys:sap-ref-8 (sb-alien:alien-sap ptr) 0)
(#xfe (intern "BIG-ENDIAN" :keyword))
(#xff (intern "LITTLE-ENDIAN" :keyword))))
*features*)
;;;; OS
;;; SBCL already pushes :DARWIN, :LINUX, :BSD and :UNIX.
#+win32
(progn
;; note: as of 2008 or so, SBCL doesn't push :UNIX and :WIN32
;; simultaneously anymore.
(setq *features* (remove :unix *features*))
(pushnew :windows *features*))
;;;; CPU
;;; SBCL already pushes: :X86, :X86-64, and :PPC

View file

@ -0,0 +1,47 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-scl.lisp --- SCL implementation of trivial-features.
;;;
;;; Copyright (C) 2007, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
(pushnew (alien:with-alien ((ptr (array (alien:unsigned 8) 2)))
(setf (sys:sap-ref-16 (alien:alien-sap ptr) 0) #xfeff)
(ecase (sys:sap-ref-8 (alien:alien-sap ptr) 0)
(#xfe (intern (symbol-name '#:big-endian) '#:keyword))
(#xff (intern (symbol-name '#:little-endian) '#:keyword))))
*features*)
;;;; OS
;;; SCL already pushes :unix, :bsd, :linux, :hpux, and :solaris
;;;; CPU
;;; SCL already pushes :amd64, :x86, :sparc, :sparc64, :hppa and :hppa64.
;;; For 64 bit CPUs the SCL pushes: :64bit
#+amd64 (pushnew :x86-64 *features*)

View file

@ -0,0 +1,39 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; tf-xcl.lisp --- XCL trivial-features implementation.
;;;
;;; Copyright (C) 2009, Luis Oliveira <loliveira@common-lisp.net>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
;;; files (the "Software"), to deal in the Software without
;;; restriction, including without limitation the rights to use, copy,
;;; modify, merge, publish, distribute, sublicense, and/or sell copies
;;; of the Software, and to permit persons to whom the Software is
;;; furnished to do so, subject to the following conditions:
;;;
;;; The above copyright notice and this permission notice shall be
;;; included in all copies or substantial portions of the Software.
;;;
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
;;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
;;; HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
;;; WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
;;; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;;; DEALINGS IN THE SOFTWARE.
(in-package :cl-user)
;;;; Endianness
;;; XCL already pushes :LITTLE-ENDIAN.
;;;; OS
;;; XCL already pushes :LINUX, :UNIX, :FREEBSD, :NETBSD, :BSD and :WINDOWS.
;;;; CPU
;;; XCL already pushes :X86 and :X86-64.