Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Patch the build script and toolchain to allow passing through



details:   https://anonhg.NetBSD.org/src/rev/28d651df7f8f
branches:  trunk
changeset: 1023606:28d651df7f8f
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Sep 18 01:47:07 2021 +0000

description:
Patch the build script and toolchain to allow passing through
HOST_CPPFLAGS, HOST_CXXFLAGS, but not LIBRARY_PATH because it breaks
the build. These variables are necessary to support building NetBSD
from a GNU Guix or NixOS host, where /usr/include, /lib, and all
but /bin/sh do not exist.  In many cases, support for HOST_CPPFLAGS
was incomplete. From Ryan Sundberg

diffstat:

 build.sh                                          |   6 ++++--
 distrib/sets/maketars                             |   4 ++--
 external/gpl3/binutils/dist/bfd/doc/Makefile.in   |   3 ++-
 external/gpl3/binutils/dist/binutils/Makefile.in  |  10 +++++-----
 external/gpl3/gcc/lib/liblto_plugin/Makefile      |   3 ++-
 external/gpl3/gcc/usr.bin/Makefile.prog           |   3 ++-
 external/gpl3/gcc/usr.bin/backend/Makefile        |   3 ++-
 external/gpl3/gcc/usr.bin/common-target/Makefile  |   3 ++-
 external/gpl3/gcc/usr.bin/common/Makefile         |   3 ++-
 external/gpl3/gcc/usr.bin/frontend/Makefile       |   3 ++-
 external/gpl3/gcc/usr.bin/host-libiberty/Makefile |   6 ++++--
 external/gpl3/gcc/usr.bin/libcpp/Makefile         |   3 ++-
 external/gpl3/gcc/usr.bin/libdecnumber/Makefile   |   3 ++-
 external/gpl3/gdb/bin/gdb/Makefile                |   3 ++-
 external/gpl3/gdb/bin/gdbserver/Makefile          |   3 ++-
 external/gpl3/gdb/bin/gdbtui/Makefile             |   3 ++-
 external/gpl3/gdb/lib/libgdb/Makefile             |   3 ++-
 external/gpl3/gdb/lib/libgdbsupport/Makefile      |   3 ++-
 external/lgpl3/gmp/dist/Makefile.in               |  12 ++++++------
 external/lgpl3/gmp/lib/libgmp/Makefile            |  14 +++++++-------
 tools/binutils/Makefile                           |   3 ++-
 tools/compat/Makefile                             |  12 ++++++------
 tools/fdisk/Makefile                              |   4 ++--
 tools/gcc/Makefile                                |   5 +++--
 tools/gmp/Makefile                                |   4 +++-
 tools/sunlabel/Makefile                           |   4 ++--
 tools/uudecode/Makefile                           |   4 ++--
 tools/vgrind/Makefile                             |   4 ++--
 tools/xz-include/Makefile                         |   4 ++--
 29 files changed, 80 insertions(+), 58 deletions(-)

diffs (truncated from 614 to 300 lines):

diff -r ec1020639261 -r 28d651df7f8f build.sh
--- a/build.sh  Fri Sep 17 22:41:48 2021 +0000
+++ b/build.sh  Sat Sep 18 01:47:07 2021 +0000
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#      $NetBSD: build.sh,v 1.357 2021/09/17 21:22:38 joerg Exp $
+#      $NetBSD: build.sh,v 1.358 2021/09/18 01:47:07 christos Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -473,6 +473,8 @@
        # These variables can be overridden via "-V var=value" if
        # you know what you are doing.
        #
+       unsetmakeenv C_INCLUDE_PATH
+       unsetmakeenv CPLUS_INCLUDE_PATH
        unsetmakeenv INFODIR
        unsetmakeenv LESSCHARSET
        unsetmakeenv MAKEFLAGS
@@ -1972,7 +1974,7 @@
        eval cat <<EOF ${makewrapout}
 #! ${HOST_SH}
 # Set proper variables to allow easy "make" building of a NetBSD subtree.
-# Generated from:  \$NetBSD: build.sh,v 1.357 2021/09/17 21:22:38 joerg Exp $
+# Generated from:  \$NetBSD: build.sh,v 1.358 2021/09/18 01:47:07 christos Exp $
 # with these arguments: ${_args}
 #
 
diff -r ec1020639261 -r 28d651df7f8f distrib/sets/maketars
--- a/distrib/sets/maketars     Fri Sep 17 22:41:48 2021 +0000
+++ b/distrib/sets/maketars     Sat Sep 18 01:47:07 2021 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: maketars,v 1.91 2020/05/18 21:19:34 jmcneill Exp $
+# $NetBSD: maketars,v 1.92 2021/09/18 01:47:07 christos Exp $
 #
 # Make release tar files for some or all lists.  Usage:
 # maketars [-b] [-x] [-i installdir] [-a arch] [-m machine] [-s setsdir]
@@ -166,7 +166,7 @@
 cleanup()
 {
        es=$?
-       /bin/rm -rf "${SDIR}" ${TMPFILES}
+       rm -rf "${SDIR}" ${TMPFILES}
        trap - 0
        exit ${es}
 }
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/binutils/dist/bfd/doc/Makefile.in
--- a/external/gpl3/binutils/dist/bfd/doc/Makefile.in   Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/binutils/dist/bfd/doc/Makefile.in   Sat Sep 18 01:47:07 2021 +0000
@@ -934,7 +934,8 @@
 $(MKDOC): chew.stamp ; @true
 chew.stamp: $(srcdir)/chew.c
        $(CC_FOR_BUILD) -o chw$$$$$(EXEEXT_FOR_BUILD) $(CFLAGS_FOR_BUILD) \
-         $(LDFLAGS_FOR_BUILD) $(H_CFLAGS) $(AM_CPPFLAGS) $(srcdir)/chew.c; \
+         $(LDFLAGS_FOR_BUILD) $(H_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) \
+               $(srcdir)/chew.c; \
        $(SHELL) $(srcdir)/../../move-if-change \
          chw$$$$$(EXEEXT_FOR_BUILD) $(MKDOC); \
        touch $@
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/binutils/dist/binutils/Makefile.in
--- a/external/gpl3/binutils/dist/binutils/Makefile.in  Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/binutils/dist/binutils/Makefile.in  Sat Sep 18 01:47:07 2021 +0000
@@ -1477,20 +1477,20 @@
        ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
 
 sysinfo$(EXEEXT_FOR_BUILD): sysinfo.@OBJEXT@ syslex_wrap.@OBJEXT@
-       $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.@OBJEXT@ syslex_wrap.@OBJEXT@
+       $(CC_FOR_BUILD) $(CPPFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.@OBJEXT@ syslex_wrap.@OBJEXT@
 
 syslex_wrap.@OBJEXT@: syslex_wrap.c syslex.c sysinfo.h config.h
-       $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex_wrap.c
+       $(CC_FOR_BUILD) $(CPPFLAGS) -c -I. -I$(srcdir) $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex_wrap.c
 
 sysinfo.@OBJEXT@: sysinfo.c
        if [ -r sysinfo.c ]; then \
-         $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \
+         $(CC_FOR_BUILD) $(CPPFLAGS) -c -I. $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \
        else \
-         $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \
+         $(CC_FOR_BUILD) $(CPPFLAGS) -c -I. $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/sysinfo.c ; \
        fi
 
 bin2c$(EXEEXT_FOR_BUILD): bin2c.c
-       $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c
+       $(CC_FOR_BUILD) $(CPPFLAGS) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c
 
 embedspu: embedspu.sh Makefile
        awk '/^program_transform_name=/ {print "program_transform_name=\"$(program_transform_name)\""; next} {print}' < $< > $@
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gcc/lib/liblto_plugin/Makefile
--- a/external/gpl3/gcc/lib/liblto_plugin/Makefile      Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/gcc/lib/liblto_plugin/Makefile      Sat Sep 18 01:47:07 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.9 2017/11/14 09:04:17 mrg Exp $
+#      $NetBSD: Makefile,v 1.10 2021/09/18 01:47:07 christos Exp $
 
 .include <bsd.init.mk>
 .include <bsd.shlib.mk>
@@ -46,6 +46,7 @@
        (cd .ab && \
                AWK=${TOOL_AWK:Q} \
                CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} \
+               CPPFLAGS=${HOST_CPPFLAGS:Q} \
                MAKE=${MAKE:Q} \
                CONFIG_SHELL=${HOST_SH:Q} \
                ${HOST_SH} ${DIST}/libiberty/configure \
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gcc/usr.bin/Makefile.prog
--- a/external/gpl3/gcc/usr.bin/Makefile.prog   Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/gcc/usr.bin/Makefile.prog   Sat Sep 18 01:47:07 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.prog,v 1.1 2019/02/01 10:34:18 mrg Exp $
+#      $NetBSD: Makefile.prog,v 1.2 2021/09/18 01:47:08 christos Exp $
 
 # common fragment for any thing linking with C++
 
@@ -11,6 +11,7 @@
 
 # Force using C++ for this
 HOST_CC:=      ${HOST_CXX}
+HOST_CFLAGS:=  ${HOST_CXXFLAGS}
 CC:=           ${CXX}
 CFLAGS:=       ${CXXFLAGS}
 
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gcc/usr.bin/backend/Makefile
--- a/external/gpl3/gcc/usr.bin/backend/Makefile        Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/gcc/usr.bin/backend/Makefile        Sat Sep 18 01:47:07 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.65 2021/04/13 06:30:36 mrg Exp $
+#      $NetBSD: Makefile,v 1.66 2021/09/18 01:47:08 christos Exp $
 
 LIBISPRIVATE=  yes
 
@@ -222,6 +222,7 @@
        (cd .ab && \
                AWK=${TOOL_AWK:Q} \
                CC=${ORIGHOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} \
+               CPPFLAGS=${HOST_CPPFLAGS:Q} \
                CXX=${HOST_CXX:Q} CXXFLAGS=${HOST_CXXFLAGS:Q} \
                MAKE=${TOOL_GMAKE:Q} \
                CONFIG_SHELL=${HOST_SH:Q} \
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gcc/usr.bin/common-target/Makefile
--- a/external/gpl3/gcc/usr.bin/common-target/Makefile  Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/gcc/usr.bin/common-target/Makefile  Sat Sep 18 01:47:07 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.10 2020/09/15 05:19:35 mrg Exp $
+#      $NetBSD: Makefile,v 1.11 2021/09/18 01:47:08 christos Exp $
 
 LIBISPRIVATE=  yes
 
@@ -49,6 +49,7 @@
 
 # Force using C++ for this
 HOST_CC:=      ${HOST_CXX}
+HOST_CFLAGS:=  ${HOST_CXXFLAGS}
 CC:=           ${CXX}
 CFLAGS:=       ${CXXFLAGS}
 
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gcc/usr.bin/common/Makefile
--- a/external/gpl3/gcc/usr.bin/common/Makefile Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/gcc/usr.bin/common/Makefile Sat Sep 18 01:47:07 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.10 2020/09/05 14:24:26 mrg Exp $
+#      $NetBSD: Makefile,v 1.11 2021/09/18 01:47:08 christos Exp $
 
 LIBISPRIVATE=  yes
 
@@ -34,6 +34,7 @@
 
 # Force using C++ for this
 HOST_CC:=      ${HOST_CXX}
+HOST_CFLAGS:=  ${HOST_CXXFLAGS}
 CC:=           ${CXX}
 CFLAGS:=       ${CXXFLAGS}
 
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gcc/usr.bin/frontend/Makefile
--- a/external/gpl3/gcc/usr.bin/frontend/Makefile       Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/gcc/usr.bin/frontend/Makefile       Sat Sep 18 01:47:07 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.13 2019/02/01 10:32:32 mrg Exp $
+#      $NetBSD: Makefile,v 1.14 2021/09/18 01:47:08 christos Exp $
 
 LIBISPRIVATE=  yes
 
@@ -32,6 +32,7 @@
 
 # Force using C++ for this
 HOST_CC:=      ${HOST_CXX}
+HOST_CFLAGS:=  ${HOST_CXXFLAGS}
 CC:=           ${CXX}
 CFLAGS:=       ${CXXFLAGS}
 
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gcc/usr.bin/host-libiberty/Makefile
--- a/external/gpl3/gcc/usr.bin/host-libiberty/Makefile Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/gcc/usr.bin/host-libiberty/Makefile Sat Sep 18 01:47:07 2021 +0000
@@ -1,14 +1,16 @@
-#      $NetBSD: Makefile,v 1.3 2014/03/16 00:07:58 uwe Exp $
+#      $NetBSD: Makefile,v 1.4 2021/09/18 01:47:08 christos Exp $
 
 libiberty/libiberty.a:
        [ ! -d libiberty ] && mkdir libiberty || true
        (cd libiberty; \
                CC=${HOST_CC:Q} \
                CFLAGS=${HOST_CFLAGS:Q} \
+               CPPFLAGS=${HOST_CPPFLAGS:Q} \
                MAKE=${MAKE:Q} \
                CONFIG_SHELL=${HOST_SH:Q} \
                ${HOST_SH} ${DIST}/libiberty/configure \
-               && CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} ${MAKE})
+               && CC=${HOST_CC:Q} CFLAGS=${HOST_CFLAGS:Q} \
+               CPPFLAGS=${HOST_CPPFLAGS:Q} ${MAKE})
 
 cleandir:
        -rm -rf libiberty
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gcc/usr.bin/libcpp/Makefile
--- a/external/gpl3/gcc/usr.bin/libcpp/Makefile Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/gcc/usr.bin/libcpp/Makefile Sat Sep 18 01:47:07 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.8 2018/02/11 02:12:29 christos Exp $
+#      $NetBSD: Makefile,v 1.9 2021/09/18 01:47:08 christos Exp $
 
 LIBISPRIVATE=  yes
 
@@ -21,6 +21,7 @@
 
 # Force using C++ for this
 HOST_CC:=      ${HOST_CXX}
+HOST_CFLAGS:=  ${HOST_CXXFLAGS}
 CC:=           ${CXX}
 CFLAGS:=       ${CXXFLAGS}
 
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gcc/usr.bin/libdecnumber/Makefile
--- a/external/gpl3/gcc/usr.bin/libdecnumber/Makefile   Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/gcc/usr.bin/libdecnumber/Makefile   Sat Sep 18 01:47:07 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.7 2018/02/11 02:12:29 christos Exp $
+#      $NetBSD: Makefile,v 1.8 2021/09/18 01:47:09 christos Exp $
 
 DIST=          ${GCCDIST}
 GNUHOSTDIST=   ${DIST}
@@ -23,6 +23,7 @@
 
 # Force using C++ for this
 HOST_CC:=      ${HOST_CXX}
+HOST_CFLAGS:=  ${HOST_CXXFLAGS}
 CC:=           ${CXX}
 CFLAGS:=       ${CXXFLAGS}
 
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gdb/bin/gdb/Makefile
--- a/external/gpl3/gdb/bin/gdb/Makefile        Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/gdb/bin/gdb/Makefile        Sat Sep 18 01:47:07 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.20 2020/12/06 03:28:25 christos Exp $
+#      $NetBSD: Makefile,v 1.21 2021/09/18 01:47:09 christos Exp $
 
 NOCTF=
 .include <bsd.own.mk>
@@ -108,6 +108,7 @@
 # Force c++
 CWARNFLAGS.clang+=     -Wno-deprecated
 HOST_CC:=              ${HOST_CXX}
+HOST_CFLAGS+=          ${HOST_CXXFLAGS}
 CC:=                   ${CXX}
 CFLAGS:=               ${CXXFLAGS} -std=gnu++11 -Wno-error=stack-protector
 
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gdb/bin/gdbserver/Makefile
--- a/external/gpl3/gdb/bin/gdbserver/Makefile  Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/gdb/bin/gdbserver/Makefile  Sat Sep 18 01:47:07 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.4 2021/06/20 12:29:58 riastradh Exp $
+#      $NetBSD: Makefile,v 1.5 2021/09/18 01:47:09 christos Exp $
 
 NOCTF=
 NOMAN=
@@ -56,6 +56,7 @@
 # Force c++
 CWARNFLAGS.clang+=     -Wno-deprecated
 HOST_CC:=              ${HOST_CXX}
+HOST_CFLAGS+=          ${HOST_CXXFLAGS}
 CC:=                   ${CXX}
 CFLAGS:=               ${CXXFLAGS} -std=gnu++11 -Wno-error=stack-protector -pthread
 
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gdb/bin/gdbtui/Makefile
--- a/external/gpl3/gdb/bin/gdbtui/Makefile     Fri Sep 17 22:41:48 2021 +0000
+++ b/external/gpl3/gdb/bin/gdbtui/Makefile     Sat Sep 18 01:47:07 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.14 2020/12/06 03:28:26 christos Exp $
+#      $NetBSD: Makefile,v 1.15 2021/09/18 01:47:09 christos Exp $
 NOCTF=
 .include "../Makefile.inc"
 
@@ -33,6 +33,7 @@
 # Force c++
 CWARNFLAGS.clang+=     -Wno-deprecated
 HOST_CC:=              ${HOST_CXX}
+HOST_CFLAGS+=          ${HOST_CXXFLAGS}
 CC:=                   ${CXX}
 CFLAGS:=               ${CXXFLAGS} -std=gnu++11 -Wno-error=stack-protector
 
diff -r ec1020639261 -r 28d651df7f8f external/gpl3/gdb/lib/libgdb/Makefile



Home | Main Index | Thread Index | Old Index