From 03e934dd85ce570bc25bbfeda453577e71eb9abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Mon, 5 Dec 2016 14:16:52 +0100 Subject: [PATCH] builder: normalize build target names --- src/cmp/cmpmain.lsp | 9 +++++---- src/cmp/cmputil.lsp | 13 +++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/cmp/cmpmain.lsp b/src/cmp/cmpmain.lsp index e708dc066..a0d2b2155 100755 --- a/src/cmp/cmpmain.lsp +++ b/src/cmp/cmpmain.lsp @@ -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) diff --git a/src/cmp/cmputil.lsp b/src/cmp/cmputil.lsp index 2a4ed720a..ea16a9537 100644 --- a/src/cmp/cmputil.lsp +++ b/src/cmp/cmputil.lsp @@ -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