diff --git a/bundle.lisp b/bundle.lisp index c955655c..b4da4743 100644 --- a/bundle.lisp +++ b/bundle.lisp @@ -588,7 +588,7 @@ which is probably not what you want; you probably need to tweak your output tran :kind kind :prologue-code (when programp (prologue-code c)) :epilogue-code (when programp (epilogue-code c)) - :build-args (when programp (extra-build-args c)) + :build-args (extra-build-args c) :extra-object-files (when programp (extra-object-files c)) :no-uiop (no-uiop c) (when programp `(:entry-point ,(component-entry-point c)))))))) diff --git a/test/ecl-init-name.script b/test/ecl-init-name.script new file mode 100644 index 00000000..08863c45 --- /dev/null +++ b/test/ecl-init-name.script @@ -0,0 +1,8 @@ +;;; -*- Lisp -*- + +(DBG "Test :init-name in lib-op.") + +#+(and ecl (not ecl-bytecmp) (not os-macosx)) +(progn + (chdir (subpathname *test-directory* "ecl-init-name/")) + (load "readme.lisp")) diff --git a/test/ecl-init-name/hello-exe.lisp b/test/ecl-init-name/hello-exe.lisp new file mode 100644 index 00000000..bed48353 --- /dev/null +++ b/test/ecl-init-name/hello-exe.lisp @@ -0,0 +1,3 @@ +(in-package #:cl-user) + +(princ "Hello world!") diff --git a/test/ecl-init-name/hello.lisp b/test/ecl-init-name/hello.lisp new file mode 100644 index 00000000..72b97ae3 --- /dev/null +++ b/test/ecl-init-name/hello.lisp @@ -0,0 +1,4 @@ +(in-package #:cl-user) + +(princ "Good morning sunshine!") +(terpri) diff --git a/test/ecl-init-name/hellow-exe.asd b/test/ecl-init-name/hellow-exe.asd new file mode 100644 index 00000000..54d4ad21 --- /dev/null +++ b/test/ecl-init-name/hellow-exe.asd @@ -0,0 +1,10 @@ +(defsystem "hellow-exe" + :components ((:file "hello-exe")) + :class program-system + :build-operation program-op + :build-pathname "hellow" + :prologue-code "{extern void init_lib_HELLOW(cl_object);ecl_init_module(NULL, init_lib_HELLOW);}" + :epilogue-code (progn + (format t "~%Good bye sunshine.~%") + (ext:quit 0)) + :extra-build-args (:ld-flags #.(list (namestring (compile-file-pathname "hellow" :type :lib))))) diff --git a/test/ecl-init-name/hellow.asd b/test/ecl-init-name/hellow.asd new file mode 100644 index 00000000..6a07144f --- /dev/null +++ b/test/ecl-init-name/hellow.asd @@ -0,0 +1,6 @@ +(defsystem "hellow" + :components ((:file "hello")) + :class program-system + :build-operation lib-op + :extra-build-args (:init-name "init_lib_HELLOW") + :build-pathname "libhellow") diff --git a/test/ecl-init-name/readme.lisp b/test/ecl-init-name/readme.lisp new file mode 100644 index 00000000..8964d533 --- /dev/null +++ b/test/ecl-init-name/readme.lisp @@ -0,0 +1,44 @@ +(require 'asdf) + +(format t " +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; BUILDING A LIBRARY +;;; +") + +(defconstant +standalone-lib+ (compile-file-pathname "hellow" :type :lib)) +(defconstant +standalone-exe+ (compile-file-pathname "hellow" :type :program)) + +(push (make-pathname :name nil :type nil :version nil + :defaults *load-truename*) + asdf:*central-registry*) + +;; Create libhellow.a using lib-op +(delete-file-if-exists +standalone-lib+) +(delete-file-if-exists +standalone-exe+) +(asdf:make "hellow") +(asdf:make "hellow-exe") + +;; +;; * Test the program +;; +(format t " +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; TESTING LIBRARY +;;; + +") +(assert-equal + (uiop:run-program (format nil "./~A" +standalone-exe+) :output :lines) + '("Good morning sunshine!" "Hello world!" "Good bye sunshine.")) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; CLEAN UP +;;; + +(delete-file +standalone-lib+) +(delete-file +standalone-exe+) diff --git a/uiop/image.lisp b/uiop/image.lisp index 576764a5..786952e5 100644 --- a/uiop/image.lisp +++ b/uiop/image.lisp @@ -465,8 +465,6 @@ or COMPRESSION on SBCL, and APPLICATION-TYPE on SBCL/Windows." (pathname destination) #+(or clasp ecl) :lisp-files #+mkcl :lisp-object-files (append lisp-object-files #+(or clasp ecl) extra-object-files) - #+ecl :init-name - #+ecl (getf build-args :init-name) (append (when prologue-code `(:prologue-code ,prologue-code)) (when epilogue-code `(:epilogue-code ,epilogue-code))