aboutsummaryrefslogtreecommitdiff
path: root/Makefile.tpl
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.tpl')
-rw-r--r--Makefile.tpl24
1 files changed, 24 insertions, 0 deletions
diff --git a/Makefile.tpl b/Makefile.tpl
index 0d5f0a1..1d5813c 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -2013,6 +2013,25 @@ configure-target-[+module+]: maybe-all-gcc[+
(unless (=* target "target-")
(string-append "configure-" target ": " dep "\n"))))))
+ ;; Dependencies in between target modules if the dependencies
+ ;; are bootstrap target modules and the target modules which
+ ;; depend on them are emitted inside of @unless gcc-bootstrap.
+ ;; Unfortunately, some target modules like libatomic or libbacktrace
+ ;; have bootstrap flag set, but whether they are actually built
+ ;; during bootstrap or after bootstrap depends on e.g. enabled languages;
+ ;; if d is enabled, libphobos is built as target module and depends
+ ;; on libatomic and libbacktrace, which are therefore also built as
+ ;; bootstrap modules. If d is not enabled but go is, libatomic and
+ ;; libbacktrace are just dependencies of libgo which is not a bootstrap
+ ;; target module, but we need dependencies on libatomic and libbacktrace
+ ;; in that case even when gcc-bootstrap. This lambda emits those.
+ (define make-postboot-target-dep (lambda ()
+ (let ((target (dep-module "module")) (on (dep-module "on")))
+ (when (=* on "target-")
+ (when (=* target "target-")
+ (string-append "@unless " on "-bootstrap\n" (make-dep "" "")
+ "\n@endunless " on "-bootstrap\n"))))))
+
;; We now build the hash table that is used by dep-kind.
(define boot-modules (make-hash-table 113))
(define postboot-targets (make-hash-table 113))
@@ -2045,6 +2064,11 @@ configure-target-[+module+]: maybe-all-gcc[+
[+ == "postbootstrap" +][+ (make-postboot-dep) +][+ ESAC +][+
ENDFOR dependencies +]@endif gcc-bootstrap
+@if gcc-bootstrap
+[+ FOR dependencies +][+ CASE (dep-kind) +]
+[+ == "postbootstrap" +][+ (make-postboot-target-dep) +][+ ESAC +][+
+ENDFOR dependencies +]@endif gcc-bootstrap
+
@unless gcc-bootstrap
[+ FOR dependencies +][+ CASE (dep-kind) +]
[+ == "postbootstrap" +][+ (make-dep "" "") +]