builder: normalize build target names

This commit is contained in:
Daniel Kochmański 2016-12-05 14:16:52 +01:00
parent aad95e1ea2
commit 03e934dd85
2 changed files with 18 additions and 4 deletions

View file

@ -366,9 +366,9 @@ or a loadable module."
(brief-namestring pathname))
((:fasl :fas)
nil)
((:static-library :lib :standalone-static-library :standalone-lib)
((:static-library :lib)
(brief-namestring pathname))
((:shared-library :dll :standalone-shared-library :standalone-dll)
((:shared-library :dll)
(brief-namestring pathname))
((:program)
nil)
@ -415,6 +415,7 @@ filesystem or in the database of ASDF modules."
&aux
(*suppress-compiler-messages* (or *suppress-compiler-messages*
(not *compile-verbose*)))
(target (normalize-build-target-name target))
(output-name (if (or (symbolp output-name) (stringp output-name))
(compile-file-pathname output-name :type target)
output-name))
@ -523,7 +524,7 @@ output = si_safe_eval(2, ecl_read_from_cstring(lisp_code), ECL_NIL);
(close c-file)
(compiler-cc c-name o-name)
(linker-cc output-name (list* (namestring o-name) ld-flags)))
((:library :static-library :lib)
(:static-library
(format c-file +lisp-program-init+
init-name init-tag prologue-code submodules epilogue-code)
(format c-file +lisp-init-wrapper+ wrap-init-name init-name)
@ -534,7 +535,7 @@ output = si_safe_eval(2, ecl_read_from_cstring(lisp_code), ECL_NIL);
(when (probe-file output-name) (delete-file output-name))
(linker-ar output-name o-name ld-flags))
#+dlopen
((:shared-library :dll)
(:shared-library
(format c-file +lisp-program-init+
init-name init-tag prologue-code submodules epilogue-code)
(format c-file +lisp-init-wrapper+ wrap-init-name init-name)

View file

@ -42,6 +42,19 @@
#-windows
(enough-namestring (si::coerce-to-filename path)))
(defun normalize-build-target-name (target)
(flet ((maybe-warn (expected-name)
(unless (eql target expected-name)
(cmpwarn-style "External use of internal interface C::BUILDER. Use one of:~%
C:BUILD-FASL, C:BUILD-PROGRAM, C:BUILD-STATIC-LIBRARY, C:BUILD-SHARED-LIBRARY~%"))
expected-name))
(ecase target
((:shared-library :dll :standalone-shared-library :standalone-dll)
(maybe-warn :shared-library))
((:static-library :lib :standalone-static-library :standalone-lib)
(maybe-warn :static-library))
((:fasl :program) target))))
(defun innermost-non-expanded-form (form)
(when (listp form)
(loop with output = nil