trivial-features-0.6.orig/0002755000175100017510000000000011276007712016045 5ustar pvaneyndpvaneyndtrivial-features-0.6.orig/trivial-features-tests.asd0000644000175100017510000000361511276007712023167 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; trivial-features-tests.asd --- ASDF definition. ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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. (eval-when (:load-toplevel :execute) (oos 'load-op 'cffi-grovel) (oos 'load-op 'trivial-features)) (defsystem trivial-features-tests :description "Unit tests for TRIVIAL-FEATURES." :depends-on (trivial-features rt cffi alexandria) :components ((:module tests :serial t :components ((:file "package") #-windows (cffi-grovel:grovel-file "utsname") #+windows (:file "sysinfo") (:file "tests"))))) (defmethod perform ((o test-op) (c (eql (find-system 'trivial-features-tests)))) (let ((*package* (find-package 'trivial-features-tests))) (funcall (find-symbol (symbol-name '#:do-tests))))) ;; vim: ft=lisp et trivial-features-0.6.orig/COPYRIGHT0000644000175100017510000000210011276007712017327 0ustar pvaneyndpvaneyndCopyright (C) 2007, Luis Oliveira 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. trivial-features-0.6.orig/SPEC0000644000175100017510000000423511276007712016524 0ustar pvaneyndpvaneynd-*- Text -*- This is a first ***draft*** of a description of what symbols should be present in CL:*FEATURES* for various platforms. A possible future direction of this documentation might be a CDR document, if it turns out to be a good idea. (Making the language of this document much more precise will be necessary then.) We will start by limiting ourselves to OS, CPU and endianness features on Windows and POSIX platforms. There are various possible implementation strategies ranging from null implementations (when the host Lisp already pushes the wanted feature) to using FFI (e.g. calling uname() to grab system information. ============= Specification * ENDIANNESS Either :LITTLE-ENDIAN or :BIG-ENDIAN should present in *FEATURES*. For the time being, we will not concern ourselves with other orderings, switchable endianness, etc. * OPERATING SYSTEM On Windows, :WINDOWS should be present in *FEATURES*. On POSIX systems, the "sysname" information from uname(3) should be used to push the appropriate symbol to *FEATURES* by upcasing that string (or downcasing for the "modern" lisps) and interning it in the keyword package. Examples: :DARWIN :LINUX :NETBSD :OPENBSD :FREEBSD For convenience, :UNIX should be pushed when running on POSIX/UNIX-like operating system (that doesn't include Windows) and :BSD should be present when running on BSD-based systems (that includes Darwin) [add :MACH too?] * CPU These features should be mutually exclusive: :X86 :X86-64 :PPC :PPC64 :MIPS :ALPHA :SPARC :SPARC64 :HPPA :HPPA64 [add more ...] [note: it's debatable whether :X86 shouldn't also be exported on x86-64, and :PPC on ppc64. SBCL doesn't. Other ways to handle, for example, the x86/x86-64 case would be to export something like :PC386 in both cases or have an additional :X86-32. Or finally, have just :X86, :PPC, etc, and add :32-BIT-CPU and :64-BIT-CPU features.] ======================= Unreferenced References "CLHS: Variable *FEATURES*" "Maintaining Portable Lisp Programs", by Christophe Rhodes trivial-features-0.6.orig/trivial-features.asd0000644000175100017510000000433711276007712022031 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; trivial-features.asd --- ASDF system definition. ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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. #-(or sbcl clisp allegro openmcl lispworks ecl cmu scl cormanlisp abcl xcl) (error "Sorry, your Lisp is not supported. Patches welcome.") (defsystem trivial-features :description "Ensures consistent *FEATURES* across multiple CLs." :author "Luis Oliveira " :version "0.6" :licence "MIT" :components ((:module src :serial t :components (#+allegro (:file "tf-allegro") #+clisp (:file "tf-clisp") #+cmu (:file "tf-cmucl") #+cormanlisp (:file "tf-cormanlisp") #+ecl (:file "tf-ecl") #+lispworks (:file "tf-lispworks") #+openmcl (:file "tf-openmcl") #+sbcl (:file "tf-sbcl") #+scl (:file "tf-scl") #+abcl (:file "tf-abcl") #+xcl (:file "tf-xcl") )))) (defmethod perform ((o test-op) (c (eql (find-system 'trivial-features)))) (operate 'load-op 'trivial-features-tests) (operate 'test-op 'trivial-features-tests)) ;; vim: ft=lisp et trivial-features-0.6.orig/tests/0002755000175100017510000000000011276007712017207 5ustar pvaneyndpvaneyndtrivial-features-0.6.orig/tests/package.lisp0000644000175100017510000000262611276007712021477 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; package.lisp --- TRIVIAL-FEATURES-TESTS package definition. ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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) (defpackage :trivial-features-tests (:use :common-lisp :regression-test :alexandria :cffi)) trivial-features-0.6.orig/tests/utsname.lisp0000644000175100017510000000302711276007712021554 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; utsname.lisp --- Grovel definitions for uname(3). ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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 :trivial-features-tests) (include "sys/utsname.h") (cstruct utsname "struct utsname" (sysname "sysname" :type :char) (nodename "nodename" :type :char) (release "release" :type :char) (version "version" :type :char) (machine "machine" :type :char)) trivial-features-0.6.orig/tests/sysinfo.lisp0000644000175100017510000000350711276007712021575 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; sysinfo.lisp --- FFI definitions for GetSystemInfo(). ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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 :trivial-features-tests) (defctype word :unsigned-short) (defcenum (architecture word) (:amd64 9) (:ia64 6) (:intel 0) (:unknown #xffff)) (defcstruct (system-info :size 36) (processor-architecture architecture)) (load-foreign-library "kernel32.dll") (defcfun ("GetSystemInfo" %get-system-info :cconv :stdcall) :void (system-info :pointer)) ;;; only getting at the CPU architecture for now. (defun get-system-info () (with-foreign-object (si 'system-info) (%get-system-info si) (foreign-slot-value si 'system-info 'processor-architecture))) trivial-features-0.6.orig/tests/tests.lisp0000644000175100017510000000611311276007712021241 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; tests.lisp --- trivial-features tests. ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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 :trivial-features-tests) ;;;; Support Code #-windows (progn ;; Hmm, why not just use OSICAT-POSIX:UNAME? (defcfun ("uname" %uname) :int (buf :pointer)) ;; Get system identification. (defun uname () (with-foreign-object (buf 'utsname) (when (= (%uname buf) -1) (error "uname() returned -1")) (macrolet ((utsname-slot (name) `(foreign-string-to-lisp (foreign-slot-pointer buf 'utsname ',name)))) (values (utsname-slot sysname) ;; (utsname-slot nodename) ;; (utsname-slot release) ;; (utsname-slot version) (utsname-slot machine)))))) (defun mutually-exclusive-p (features) (= 1 (loop for feature in features when (featurep feature) count 1))) ;;;; Tests (deftest endianness.1 (with-foreign-object (p :uint16) (setf (mem-ref p :uint16) #xfeff) (ecase (mem-ref p :uint8) (#xfe (featurep :big-endian)) (#xff (featurep :little-endian)))) t) (defparameter *bsds* '(:darwin :netbsd :openbsd :freebsd)) (defparameter *unices* (list* :linux *bsds*)) #+windows (deftest os.1 (featurep (list* :or :unix *unices*)) nil) #-windows (deftest os.1 (featurep (make-keyword (string-upcase (uname)))) t) (deftest os.2 (if (featurep :bsd) (mutually-exclusive-p *bsds*) (featurep `(:not (:or ,@*bsds*)))) t) (deftest os.3 (if (featurep `(:or ,@*unices*)) (featurep :unix) t) t) (deftest os.4 (if (featurep :windows) (not (featurep :unix)) t) t) (deftest cpu.1 (mutually-exclusive-p '(:ppc :ppc64 :x86 :x86-64 :alpha :mips)) t) #+windows (deftest cpu.2 (case (get-system-info) (:intel (featurep :x86)) (:amd64 (featurep :x86-64)) (:ia64 nil) ; add this feature later! (t t)) t) trivial-features-0.6.orig/README0000644000175100017510000000167011276007712016727 0ustar pvaneyndpvaneyndtrivial-features ensures consistent *FEATURES* across multiple Common Lisp implementations. For example, on MacOS X platforms, while most Lisps push :DARWIN to *FEATURES*, CLISP and Allegro push :MACOS and :MACOSX instead, respectively. Some Lisps might not push any feature suggesting MacOS X at all. trivial-features will make sure all Lisps will have :DARWIN in the *FEATURES* list when running on MacOS X. This way, you can write #+darwin foo #-darwin bar instead of #+(or darwin macos macosx) foo #-(or darwin macos macosx) bar The included SPEC document describes the set of symbols that should or should not be present in CL:*FEATURES* on certain circumstances. This specification is implemented by the TRIVIAL-FEATURES system which supports a handful of Lisps. The test suite is, in effect, an implementation using CFFI that is checked against the various implementations in src/tf-*.lisp. trivial-features is MIT-licenced. trivial-features-0.6.orig/release.sh0000644000175100017510000000665111276007712020027 0ustar pvaneyndpvaneynd#!/bin/bash ### Configuration PROJECT_NAME='trivial-features' ASDF_FILE="$PROJECT_NAME.asd" HOST="common-lisp.net" RELEASE_DIR="public_html/tarballs/trivial-features/" VERSION_FILE="" #VERSION_FILE="VERSION" #VERSION_FILE_DIR="/project/$PROJECT_NAME/public_html" set -e ### Process options FORCE=0 VERSION="" while [ $# -gt 0 ]; do case "$1" in -h|--help) echo "No help, sorry. Read the source." exit 0 ;; -f|--force) FORCE=1 shift ;; -v|--version) VERSION="$2" shift 2 ;; *) echo "Unrecognized argument '$1'" exit 1 ;; esac done ### Check for unrecorded changes if darcs whatsnew; then echo -n "Unrecorded changes. " if [ "$FORCE" -ne 1 ]; then echo "Aborting." echo "Use -f or --force if you want to make a release anyway." exit 1 else echo "Continuing anyway." fi fi ### Determine new version number if [ -z "$VERSION" ]; then CURRENT_VERSION=$(grep :version $ASDF_FILE | cut -d\" -f2) dots=$(echo "$CURRENT_VERSION" | tr -cd '.') count=$(expr length "$dots" + 1) declare -a versions for i in $(seq $count); do new="" for j in $(seq $(expr $i - 1)); do p=$(echo "$CURRENT_VERSION" | cut -d. -f$j) new="$new$p." done part=$(expr 1 + $(echo "$CURRENT_VERSION" | cut -d. -f$i)) new="$new$part" for j in $(seq $(expr $i + 1) $count); do new="$new.0"; done versions[$i]=$new done while true; do echo "Current version is $CURRENT_VERSION. Which will be next one?" for i in $(seq $count); do echo " $i) ${versions[$i]}"; done echo -n "? " read choice if ((choice > 0)) && ((choice <= ${#versions[@]})); then VERSION=${versions[$choice]} break fi done fi ### Do it TARBALL_NAME="${PROJECT_NAME}_${VERSION}" TARBALL="$TARBALL_NAME.tar.gz" SIGNATURE="$TARBALL.asc" echo "Updating $ASDF_FILE with new version: $VERSION" sed -e "s/:version \"$CURRENT_VERSION\"/:version \"$VERSION\"/" \ "$ASDF_FILE" > "$ASDF_FILE.tmp" mv "$ASDF_FILE.tmp" "$ASDF_FILE" darcs record -m "update $ASDF_FILE for version $VERSION" echo "Tagging the tree..." darcs tag "$VERSION" echo "Creating distribution..." darcs dist -d "$TARBALL_NAME" echo "Signing tarball..." gpg -b -a "$TARBALL" echo "Copying tarball to web server..." scp "$TARBALL" "$SIGNATURE" "$HOST:$RELEASE_DIR" echo "Uploaded $TARBALL and $SIGNATURE." echo "Updating ${PROJECT_NAME}_latest links..." ssh $HOST ln -sf "$TARBALL" "$RELEASE_DIR/${PROJECT_NAME}_latest.tar.gz" ssh $HOST ln -sf "$SIGNATURE" "$RELEASE_DIR/${PROJECT_NAME}_latest.tar.gz.asc" if [ "$VERSION_FILE" ]; then echo "Uploading $VERSION_FILE..." echo -n "$VERSION" > "$VERSION_FILE" scp "$VERSION_FILE" "$HOST":"$VERSION_FILE_DIR" rm "$VERSION_FILE" fi while true; do echo -n "Clean local tarball and signature? [y] " read -n 1 response case "$response" in y|'') echo rm "$TARBALL" "$SIGNATURE" break ;; n) break ;; *) echo "Invalid response '$response'. Try again." ;; esac done #echo "Building and uploading documentation..." #make -C doc upload-docs echo "Pushing changes..." darcs push trivial-features-0.6.orig/src/0002755000175100017510000000000011276007712016634 5ustar pvaneyndpvaneyndtrivial-features-0.6.orig/src/tf-xcl.lisp0000644000175100017510000000273311276007712020725 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; tf-xcl.lisp --- XCL trivial-features implementation. ;;; ;;; Copyright (C) 2009, Luis Oliveira ;;; ;;; 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. trivial-features-0.6.orig/src/tf-ecl.lisp0000644000175100017510000000405711276007712020703 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; tf-ecl.lisp --- ECL implementation of trivial-features. ;;; ;;; Copyright (C) 2007-2009, Luis Oliveira ;;; ;;; 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*) trivial-features-0.6.orig/src/tf-allegro.lisp0000644000175100017510000000335011276007712021560 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; tf-allegro.lisp --- Allegro implementation of trivial-features. ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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*) trivial-features-0.6.orig/src/tf-sbcl.lisp0000644000175100017510000000367211276007712021065 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; tf-sbcl.lisp --- SBCL trivial-features implementation. ;;; ;;; Copyright (C) 2007-2009, Luis Oliveira ;;; ;;; 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 trivial-features-0.6.orig/src/tf-lispworks.lisp0000644000175100017510000000410611276007712022170 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; tf-lispworks.lisp --- Lispworks implementation of trivial-features. ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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*) trivial-features-0.6.orig/src/tf-cmucl.lisp0000644000175100017510000000334411276007712021241 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; tf-cmucl.lisp --- CMUCL implementation of trivial-features. ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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. trivial-features-0.6.orig/src/tf-openmcl.lisp0000644000175100017510000000323311276007712021570 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; tf-openmcl.lisp --- OpenMCL trivial-features implementation. ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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*) trivial-features-0.6.orig/src/tf-corman.lisp0000644000175100017510000000265111276007712021415 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; tf-corman.lisp --- Corman Lisp implementation of trivial-features. ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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*) trivial-features-0.6.orig/src/tf-clisp.lisp0000644000175100017510000000424711276007712021253 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; tf-clisp.lisp --- CLISP trivial-features implementation. ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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 (pushnew (intern (symbol-name (cond ((string= (machine-type) "X86_64") '#:x86-64) ((member :pc386 *features*) '#:x86) ((string= (machine-type) "POWER MACINTOSH") '#:ppc))) '#:keyword) *features*) trivial-features-0.6.orig/src/tf-scl.lisp0000644000175100017510000000357311276007712020723 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; tf-scl.lisp --- SCL implementation of trivial-features. ;;; ;;; Copyright (C) 2007, Luis Oliveira ;;; ;;; 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*) trivial-features-0.6.orig/src/tf-abcl.lisp0000644000175100017510000000262311276007712021036 0ustar pvaneyndpvaneynd;;;; -*- Mode: lisp; indent-tabs-mode: nil -*- ;;; ;;; tf-abcl.lisp --- ABCL trivial-features implementation. ;;; ;;; Copyright (C) 2009, Luis Oliveira ;;; ;;; 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 ;;; TODO ;;;; OS ;;; ABCL already pushes :LINUX and :UNIX. ;;;; CPU ;;; ABCL already pushes :x86-64