]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - Makefile.tpl
libstdc++: Simplify constraints on <=> for std::reference_wrapper
[thirdparty/gcc.git] / Makefile.tpl
index 4fdca604eb0c045ed793d2667c420d832ec0e7e7..1d5813cd56957b46003c9ae18743d6fe5b6c3c5a 100644 (file)
@@ -6,7 +6,7 @@ in
 #
 # Makefile for directory with subdirs to build.
 #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2023
 #   Free Software Foundation
 #
 # This file is free software; you can redistribute it and/or modify
@@ -146,7 +146,8 @@ BASE_EXPORTS = \
        M4="$(M4)"; export M4; \
        SED="$(SED)"; export SED; \
        AWK="$(AWK)"; export AWK; \
-       MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
+       MAKEINFO="$(MAKEINFO)"; export MAKEINFO; \
+       GUILE="$(GUILE)"; export GUILE;
 
 # This is the list of variables to export in the environment when
 # configuring subdirectories for the build system.
@@ -224,6 +225,7 @@ HOST_EXPORTS = \
        OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
        OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
        OTOOL="$(OTOOL)"; export OTOOL; \
+       PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"; export PKG_CONFIG_PATH; \
        READELF="$(READELF)"; export READELF; \
        AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
        AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
@@ -323,6 +325,7 @@ BASE_TARGET_EXPORTS = \
        RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
        READELF="$(READELF_FOR_TARGET)"; export READELF; \
        STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
+       SYSROOT_CFLAGS_FOR_TARGET="$(SYSROOT_CFLAGS_FOR_TARGET)"; export SYSROOT_CFLAGS_FOR_TARGET; \
        WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
        WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
 @if gcc-bootstrap
@@ -420,7 +423,7 @@ MAKEINFOFLAGS = --split-size=5000000
 # ---------------------------------------------
 
 AS = @AS@
-AR = @AR@
+AR = @AR@ @AR_PLUGIN_OPTION@
 AR_FLAGS = rc
 CC = @CC@
 CXX = @CXX@
@@ -431,7 +434,7 @@ LIPO = @LIPO@
 NM = @NM@
 OBJDUMP = @OBJDUMP@
 OTOOL = @OTOOL@
-RANLIB = @RANLIB@
+RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@
 READELF = @READELF@
 STRIP = @STRIP@
 WINDRES = @WINDRES@
@@ -450,6 +453,10 @@ GOCFLAGS = $(CFLAGS)
 GDCFLAGS = @GDCFLAGS@
 GM2FLAGS = $(CFLAGS)
 
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+
+GUILE = guile
+
 # Pass additional PGO and LTO compiler options to the PGO build.
 BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS)
 override CFLAGS += $(BUILD_CFLAGS)
@@ -557,6 +564,10 @@ STAGEtrain_TFLAGS = $(filter-out -fchecking=1,$(STAGE3_TFLAGS))
 
 STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use -fprofile-reproducible=parallel-runs
 STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
+# Disable warnings as errors for a few reasons:
+# - sources for gen* binaries do not have .gcda files available
+# - inlining decisions generate extra warnings
+STAGEfeedback_CONFIGURE_FLAGS = $(filter-out --enable-werror-always,$(STAGE_CONFIGURE_FLAGS))
 
 STAGEautoprofile_CFLAGS = $(filter-out -gtoggle,$(STAGE2_CFLAGS)) -g
 STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
@@ -1631,9 +1642,17 @@ cross: all-build all-gas all-ld
 @endif gcc-no-bootstrap
 
 @if gcc
+
+.PHONY: gcc-site.exp
+gcc-site.exp:
+       r=`${PWD_COMMAND}`; export r; \
+       s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+       $(HOST_EXPORTS) \
+       (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) site.exp);
+
 [+ FOR languages +]
 .PHONY: check-gcc-[+language+] check-[+language+]
-check-gcc-[+language+]:
+check-gcc-[+language+]: gcc-site.exp
        r=`${PWD_COMMAND}`; export r; \
        s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
        $(HOST_EXPORTS) \
@@ -1957,7 +1976,7 @@ configure-target-[+module+]: maybe-all-gcc[+
    (define dep-maybe (lambda ()
       (if (exist? "hard") "" "maybe-")))
 
-   ;; dep-kind returns returns "prebootstrap" for configure or build
+   ;; dep-kind returns "prebootstrap" for configure or build
    ;; dependencies of bootstrapped modules on a build module
    ;; (e.g. all-gcc on all-build-bison); "normal" if the dependency is
    ;; on an "install" target, or if the dependence module is not
@@ -1994,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))
@@ -2026,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 "" "") +]
@@ -2106,6 +2149,7 @@ AUTOCONF = autoconf
 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \
        $(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 \
        $(srcdir)/config/elf.m4 $(srcdir)/config/isl.m4 \
+       $(srcdir)/config/gcc-plugin.m4 \
        $(srcdir)/libtool.m4 $(srcdir)/ltoptions.m4 $(srcdir)/ltsugar.m4 \
        $(srcdir)/ltversion.m4 $(srcdir)/lt~obsolete.m4
        cd $(srcdir) && $(AUTOCONF)