Commit 7e361dc2 authored by Elias Pipping's avatar Elias Pipping Committed by Robert Goldman

Clean up use of *features*

In particular:
 - clasp does not define :ecl
 - use :os-unix instead of :unix
 - use :os-windows instead of :mswindows or :windows
 - use :os-macosx instead of :darwin
 - use :lispworks7+ instead of :lispworks7
parent ae732541
......@@ -27,7 +27,7 @@
(with-upgradability ()
;; Hook into CL:REQUIRE.
#-clisp (pushnew 'module-provide-asdf *module-provider-functions*)
#+clisp (if-let (x (and #+clisp (find-symbol* '#:*module-provider-functions* :custom nil)))
#+clisp (if-let (x (find-symbol* '#:*module-provider-functions* :custom nil))
(eval `(pushnew 'module-provide-asdf ,x)))
#+(or clasp ecl mkcl)
......
......@@ -364,7 +364,7 @@
:direction :output
:if-exists :supersede :if-does-not-exist :create)
(setup-asdftest-logical-host :root root)
#+(and asdf-test-logical-pathname)
#+asdf-test-logical-pathname
(assert-pathname-equal
(make-pathname :host "ASDFTEST" :directory '(:absolute "system2" "module4")
:name nil :type nil)
......
(defpackage :test-asdf/dll-test (:use)) ;; dummy, for package-inferred-system dependencies.
#+(and ecl (not clasp))
#+ecl
(ffi:clines "
extern int sample_function();
......
......@@ -2,9 +2,9 @@
(in-package :test-package)
#+(and mkcl windows)
#+(and mkcl os-windows)
(ffi:clines "extern __declspec(dllimport) int sample_function(void);")
#-(and mkcl windows)
#-(and mkcl os-windows)
(ffi:clines "extern int sample_function(void);")
(ffi:def-function "sample_function" () :returning :int)
......@@ -7,7 +7,7 @@
:components ((:file "hello"))
#+mkcl
,@`(;;:prefix-lisp-object-files (,(namestring (truename (translate-logical-pathname #P"SYS:cmp.a"))))
:extra-build-args ,(or #-windows '(:use-mkcl-shared-libraries nil))
:extra-build-args ,(or #-os-windows '(:use-mkcl-shared-libraries nil))
:class program-system
:epilogue-code (progn
(setq uiop/image:*image-dumped-p* :executable)
......
......@@ -19,10 +19,10 @@
(defun add-mkcl-dll (pathname)
;; make sure mkcl-X.X.X.dll is the same directory as the executable
(let* ((dll-orig (subpathname (si::self-truename)
(strcat #-windows "../lib/"
(strcat #-os-windows "../lib/"
"mkcl_" (lisp-implementation-version)
"." (asdf/bundle:bundle-pathname-type :shared-library))))
(dll-dest (subpathname pathname (strcat #-windows "../lib/" (file-namestring dll-orig)))))
(dll-dest (subpathname pathname (strcat #-os-windows "../lib/" (file-namestring dll-orig)))))
(ensure-directories-exist dll-dest)
(copy-file dll-orig dll-dest)))
......
(defpackage :test-asdf/monodll-1 (:use)) ;; dummy, for package-inferred-system dependencies.
#+(and ecl (not clasp))
#+ecl
(ffi:clines "
extern int always_7();
......
(defpackage :test-asdf/monodll (:use :test-asdf/monodll-1)) ;; dummy, for package-inferred-system dependencies.
#+(and ecl (not clasp))
#+ecl
(ffi:clines "
extern int always_42();
......
......@@ -10,7 +10,7 @@
(clear-system :test-asdf/bundle-2)
(when (find-package :test-package) (delete-package :test-package))
#+(and darwin ecl)
#+(and os-macosx ecl)
(leave-test "Bundle test doesn't work on Mac on this lisp." 0)
#+abcl
......@@ -65,14 +65,14 @@
(let ((dll (first (output-files 'dll-op :test-asdf/dll-test))))
(si:load-foreign-module dll)
(DBG "Load a library that knows how to use the DLL")
(let* (#+(and mkcl windows) (compiler::*builder-default-libraries* (list (namestring dll))))
(let* (#+(and mkcl os-windows) (compiler::*builder-default-libraries* (list (namestring dll))))
(operate 'load-op :test-asdf/dll-user)))
(DBG "Test that the DLL works")
(assert-equal (test-package::sample-function) 42)
(DBG "Create a DLL via monolithic-dll-op")
(nest
#+(and mkcl windows)
#+(and mkcl os-windows)
(let* ((lib (first (output-files (operate 'lib-op :test-asdf/monodll-1) :test-asdf/monodll-1)))
(compiler::*builder-default-libraries* (list (namestring lib)))))
(operate 'monolithic-dll-op :test-asdf/monodll))
......@@ -80,7 +80,7 @@
(DBG "Use and test that DLL")
(let ((dll (first (output-files 'monolithic-dll-op :test-asdf/monodll))))
(si:load-foreign-module dll)
(let* (#+(and mkcl windows) (compiler::*builder-default-libraries* (list (namestring dll))))
(let* (#+(and mkcl os-windows) (compiler::*builder-default-libraries* (list (namestring dll))))
(operate 'load-op :test-asdf/monodll-user)))
(assert-equal (test-package::always-42) 42))
......
......@@ -393,13 +393,13 @@
(lambda-string (string lambda-char)))
(assert (= 1 (character-type-index lambda-char)))
(assert-equal (strings-common-element-type (list #\a nil (strcat "hello, " lambda-string "world")))
#-lispworks 'character #+lispworks7 'lw:bmp-char #+(and lispworks (not lispworks7)) 'lw:simple-char)
#-lispworks 'character #+lispworks7+ 'lw:bmp-char #+(and lispworks (not lispworks7+)) 'lw:simple-char)
(when (< 65536 char-code-limit)
(let* ((amagi (format nil "~a~a" (code-char #x120BC) (code-char #x12104))))
(assert (= #+lispworks7 2 #-lispworks7 1 (character-type-index (first-char amagi))))
(assert (= #+lispworks7+ 2 #-lispworks7+ 1 (character-type-index (first-char amagi))))
(assert-equal (strings-common-element-type (list #\a nil amagi lambda-string))
#+(or (not lispworks) lispworks7) 'character
#+(and lispworks (not lispworks7)) 'lw:simple-char))))))
#+(or (not lispworks) lispworks7+) 'character
#+(and lispworks (not lispworks7+)) 'lw:simple-char))))))
(assert-equal +crlf+ (map 'string 'code-char '(13 10)))
(assert-equal +lf+ (map 'string 'code-char '(10)))
......
......@@ -90,7 +90,7 @@
(setf p (pathname p))
(format nil "~@[~A~]~@[.~A~]" (pathname-name p) (pathname-type p))))
#+(and ecl (not clasp))
#+ecl
(eval-when (:load-toplevel :compile-toplevel :execute)
(setf *load-verbose* nil)
(defun use-ecl-byte-compiler-p () (and (member :ecl-bytecmp *features*) t))
......
......@@ -276,7 +276,7 @@ directive.")
this function tries to locate the Windows FOLDER for one of
:LOCAL-APPDATA, :APPDATA or :COMMON-APPDATA.
Returns NIL when the folder is not defined (e.g., not on Windows)."
(or #+(and lispworks mswindows) (sys:get-folder-path folder)
(or #+(and lispworks os-windows) (sys:get-folder-path folder)
;; read-windows-registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\AppData
(ecase folder
(:local-appdata (or (getenv-absolute-directory "LOCALAPPDATA")
......
......@@ -136,9 +136,9 @@ or the original (parsed) pathname if it is false (the default)."
(probe-file p)
(and
#+(or cmucl scl) (unix:unix-stat (ext:unix-namestring p))
#+(and lispworks unix) (system:get-file-stat p)
#+(and lispworks os-unix) (system:get-file-stat p)
#+sbcl (sb-unix:unix-stat (sb-ext:native-namestring p))
#-(or cmucl (and lispworks unix) sbcl scl) (file-write-date p)
#-(or cmucl (and lispworks os-unix) sbcl scl) (file-write-date p)
p))))))
(defun directory-exists-p (x)
......
......@@ -447,7 +447,7 @@ or COMPRESSION on SBCL, and APPLICATION-TYPE on SBCL/Windows."
(when forms `(progn ,@forms))))))
#+(or clasp ecl) (check-type kind (member :dll :lib :static-library :program :object :fasl))
(apply #+clasp 'cmp:builder #+clasp kind
#+(and ecl (not clasp)) 'c::builder #+(and ecl (not clasp)) kind
#+ecl 'c::builder #+ecl kind
#+mkcl (ecase kind
((:dll) 'compiler::build-shared-library)
((:lib :static-library) 'compiler::build-static-library)
......
......@@ -66,8 +66,8 @@ This can help you produce more deterministic output for FASLs."))
#+clozure '(ccl::*nx-speed* ccl::*nx-space* ccl::*nx-safety*
ccl::*nx-debug* ccl::*nx-cspeed*)
#+(or cmucl scl) '(c::*default-cookie*)
#+(and ecl (not clasp)) (unless (use-ecl-byte-compiler-p) '(c::*speed* c::*space* c::*safety* c::*debug*))
#+clasp '()
#+ecl (unless (use-ecl-byte-compiler-p) '(c::*speed* c::*space* c::*safety* c::*debug*))
#+gcl '(compiler::*speed* compiler::*space* compiler::*compiler-new-safety* compiler::*debug*)
#+lispworks '(compiler::*optimization-level*)
#+mkcl '(si::*speed* si::*space* si::*safety* si::*debug*)
......
......@@ -186,8 +186,8 @@ when merging, making or parsing pathnames"
;; MCL has issues with make-pathname, nil and defaulting
(declare (ignorable defaults))
#.`(make-pathname :directory nil :name nil :type nil :version nil
:device (or #+(and mkcl unix) :unspecific)
:host (or #+cmucl lisp::*unix-host* #+(and mkcl unix) "localhost")
:device (or #+(and mkcl os-unix) :unspecific)
:host (or #+cmucl lisp::*unix-host* #+(and mkcl os-unix) "localhost")
#+scl ,@'(:scheme nil :scheme-specific-part nil
:username nil :password nil :parameters nil :query nil :fragment nil)
;; the default shouldn't matter, but we really want something physical
......@@ -225,7 +225,7 @@ on ABCL, Genera and XCL, where it remains unchanged for it doubles as current-di
(or (and (null p1) (null p2))
(and (pathnamep p1) (pathnamep p2)
(and (=? pathname-host)
#-(and mkcl unix) (=? pathname-device)
#-(and mkcl os-unix) (=? pathname-device)
(=? normalize-pathname-directory-component pathname-directory)
(=? pathname-name)
(=? pathname-type)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment