This patch adds a "component-options" egg specification item to specify global
csc- or link-options for all components. These options are combined with
component-specific options.
This fixes #1484.
felixFrom 8b490adeeb9b5e98d0ceccc40757d7992af6384e Mon Sep 17 00:00:00 2001
From: felix
Date: Thu, 26 Jul 2018 10:18:38 +0200
Subject: [PATCH] Add component-options egg specification item
---
chicken-install.scm |1 +
egg-compile.scm | 15 +++
manual/Egg specification format |7 +++
3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/chicken-install.scm b/chicken-install.scm
index 8593745..b455f13 100644
--- a/chicken-install.scm
+++ b/chicken-install.scm
@@ -192,6 +192,7 @@
(program #f #t #t)
(data #f #t #t)
(modules #f #f #f)
+(component-options #t #f #f)
(c-include #f #f #t)
(scheme-include #f #f #t)))
diff --git a/egg-compile.scm b/egg-compile.scm
index 91edd3b..4b6c3ce 100644
--- a/egg-compile.scm
+++ b/egg-compile.scm
@@ -165,10 +165,10 @@
(tfile #f)
(ptfile #f)
(ifile #f)
- (lopts '())
+ (lopts lopts)
(oname #f)
(mods #f)
- (opts '()))
+ (opts opts))
(for-each compile-extension/program (cddr info))
(let ((dest (destination-repository mode #t))
;; Respect install-name if specified
@@ -263,9 +263,9 @@
(cbuild #f)
(src #f)
(link default-program-linkage)
- (lopts '())
+ (lopts lopts)
(oname #f)
- (opts '()))
+ (opts opts))
(for-each compile-extension/program (cddr info))
(let ((dest (if (eq? mode 'target)
default-bindir ; XXX wrong!
@@ -331,11 +331,18 @@
((files)
(set! files (append files (map ->string (cdr info)
(else (compile-common info compile-data/include
+(define (compile-options info)
+ (case (car info)
+((csc-options) (set! opts (append opts (cdr info
+((link-options) (set! lopts (append lopts (cdr info
+(else (error "invalid option specification" info
(define (->dep x)
(if (name? x) x (error "invalid dependency" x)))
(define (compile info)
(case (car info)
((components) (for-each compile-component (cdr info)))
+((component-options)
+ (for-each compile-options (cdr info)))
(else (compile-common info compile
(define (arg info n #!optional (pred (constantly #t)))
(when (< (length info) n)
diff --git a/manual/Egg specification format b/manual/Egg specification format
index 4602515..a80b63c 100644
--- a/manual/Egg specification format
+++ b/manual/Egg specification format
@@ -129,6 +129,13 @@ Recursively process {{PROP ...}}, but only for the target
platform, in case this is a "cross-chicken", a CHICKEN installation
intended for cross compilation.
+ component-options
+
+[egg property] (component-options OPTIONSPEC ...)
+
+Specifies global options for all programs and extensions compiled for this egg.
+{{OPTIONSPEC}} may be {{csc-options}} or {{link-options}} specifications.
+
Components
extension
--
1.7.9.5
___
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers