~ chicken-core (chicken-5) 4b4931299261d47843374c1f500ab0040c1d43c1
commit 4b4931299261d47843374c1f500ab0040c1d43c1
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Sep 11 19:08:44 2017 +0200
Commit: Evan Hanson <evhan@foldling.org>
CommitDate: Tue Sep 12 17:07:32 2017 +1200
Fix handling of types-file + inline-file
Ensure paths to types- and inline-files are absolute, document optional
filenames for types-file/inline-file egg properties, pass proper options
to csc in these cases.
Thanks to Kooda for pointing out these omissions.
Signed-off-by: Evan Hanson <evhan@foldling.org>
diff --git a/egg-compile.scm b/egg-compile.scm
index 5ed16c46..ce931124 100644
--- a/egg-compile.scm
+++ b/egg-compile.scm
@@ -354,10 +354,17 @@
(append (if (memq 'dynamic link)
(list (apply compile-dynamic-extension data))
'())
- ;; static must come last, as *.o file will be overwritten
- ;; and removed by dynamic build (meh)
(if (memq 'static link)
- (list (apply compile-static-extension data))
+ ;; if compiling both static + dynamic, override
+ ;; types-file: + inline-file: properties to
+ ;; avoid generating things twice:
+ (list (apply compile-static-extension
+ (if (memq 'dynamic link)
+ (cons (car data)
+ (append '(types-file: #f
+ inline-file: #f)
+ (cdr data)))
+ data)))
'())
(if (uses-compiled-import-library? mode)
(map (lambda (mod)
@@ -417,16 +424,25 @@
;;; shell code generation - build operations
-(define ((compile-static-extension name #!key mode dependencies source
- (options '()) custom)
+(define ((compile-static-extension name #!key mode dependencies
+ source (options '())
+ custom types-file inline-file)
srcdir platform)
(let* ((cmd (or (and custom (prefix-custom-command custom))
default-csc))
(sname (prefix srcdir name))
(ssname (and source (prefix srcdir source)))
- (opts (if (null? options)
- default-static-compilation-options
- options))
+ (opts (append (if (null? options)
+ default-static-compilation-options
+ options)
+ (if types-file
+ (list "-emit-type-file"
+ (quotearg (prefix srcdir (conc types-file ".types"))))
+ '())
+ (if inline-file
+ (list "-emit-inline-file"
+ (quotearg (prefix srcdir (conc inline-file ".inline"))))
+ '())))
(out (quotearg (target-file (conc sname
".static"
(object-extension platform))
@@ -446,14 +462,22 @@
(define ((compile-dynamic-extension name #!key mode dependencies mode
source (options '()) (link-options '())
- custom)
+ custom types-file inline-file)
srcdir platform)
(let* ((cmd (or (and custom (prefix-custom-command custom))
default-csc))
(sname (prefix srcdir name))
- (opts (if (null? options)
- default-dynamic-compilation-options
- options))
+ (opts (append (if (null? options)
+ default-dynamic-compilation-options
+ options)
+ (if types-file
+ (list "-emit-type-file"
+ (quotearg (prefix srcdir (conc types-file ".types"))))
+ '())
+ (if inline-file
+ (list "-emit-inline-file"
+ (quotearg (prefix srcdir (conc inline-file ".inline"))))
+ '())))
(ssname (and source (prefix srcdir source)))
(out (quotearg (target-file (conc sname ".so") mode)))
(src (quotearg (or ssname (conc sname ".scm")))))
@@ -611,8 +635,7 @@
srcdir platform)
(let* ((cmd (install-file-command platform))
(mkdir (mkdir-command platform))
- (sname (prefix srcdir name))
- (out (quotearg (conc types-file ".types")))
+ (out (quotearg (prefix srcdir (conc types-file ".types"))))
(dest (destination-repository mode))
(dfile (quotearg (slashify dest platform)))
(ddir (shell-variable "DESTDIR" platform)))
@@ -626,7 +649,7 @@
(let* ((cmd (install-file-command platform))
(mkdir (mkdir-command platform))
(sname (prefix srcdir name))
- (out (quotearg (conc inline-file ".inline")))
+ (out (quotearg (prefix srcdir (conc inline-file ".inline"))))
(dest (destination-repository mode))
(dfile (quotearg (slashify dest platform)))
(ddir (shell-variable "DESTDIR" platform)))
diff --git a/manual/Extensions b/manual/Extensions
index 25bc75bb..9a397dee 100644
--- a/manual/Extensions
+++ b/manual/Extensions
@@ -290,19 +290,21 @@ property only makes sense for extension libraries.
====== types-file
-[egg property] (types-file NAME)
+[egg property] (types-file [NAME])
Specifies that a "type-database" file should be generated and
installed for this component. This property is only used for
-extension libraries.
+extension libraries. The name is optional and defaults to the
+name of the extensions (with the proper extension).
====== inline-file
-[egg property] (inline-file NAME)
+[egg property] (inline-file [NAME])
Specifies that an "inline" file should be generated and installed
for this component. This property is only used for extension
-libraries.
+libraries. The name is optional and defaults to the
+name of the extensions (with the proper extension).
====== custom-build
Trap