tech-toolchain archive

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

Re: MAKEFLAGS and build.sh



On Tue, 14 Oct 2008, Alan Barrett wrote:
> At present, build.sh ignores any MAKEFLAGS passed in the environment,
> and also ignores any MAKEFLAGS set via "-V MAKEFLAGS=value".  The
> appended patch makes build.sh ignore any MAKEFLAGS passed in the
> environment (as at present), but makes it accept "-V MAKEFLAGS=value".
> Does this address everybody's concerns?

Sorry, with the patch this time.

--apb (Alan Barrett)

Index: build.sh
===================================================================
--- build.sh    22 Aug 2008 23:41:24 -0000      1.197
+++ build.sh    14 Oct 2008 21:19:42 -0000
@@ -162,6 +162,17 @@
        [ -f share/mk/bsd.own.mk ] ||
            bomb "src/share/mk is missing; please re-fetch the source tree"
 
+       # Set various environment variables to known defaults,
+       # to minimize (cross-)build problems observed "in the field".
+       #
+       # These variables can be overridden via "-V var=value" if
+       # you know what you are doing.
+       #
+       unsetmakeenv INFODIR
+       unsetmakeenv LESSCHARSET
+       setmakeenv LC_ALL C
+       unsetmakeenv MAKEFLAGS
+
        # Find information about the build platform.  Note that "uname -p"
        # is not part of POSIX, but NetBSD's uname -p prints MACHINE_ARCH,
        # while uname -m prints MACHINE.
@@ -199,10 +210,7 @@
        #
        case "${uname_s}" in
        Darwin | FreeBSD | CYGWIN*)
-               MAKEFLAGS=-X
-               ;;
-       *)
-               MAKEFLAGS=
+               MAKEFLAGS="-X ${MAKEFLAGS}"
                ;;
        esac
 
@@ -258,13 +266,6 @@
        # Set the BUILDSEED to NetBSD-"N"
        #
        setmakeenv BUILDSEED "NetBSD-$(${HOST_SH} ${TOP}/sys/conf/osrelease.sh 
-m)"
-
-       # Set various environment variables to known defaults,
-       # to minimize (cross-)build problems observed "in the field".
-       #
-       unsetmakeenv INFODIR
-       unsetmakeenv LESSCHARSET
-       setmakeenv LC_ALL C
 }
 
 getarch()
Index: BUILDING
===================================================================
--- BUILDING    24 Sep 2008 07:38:04 -0000      1.78
+++ BUILDING    14 Oct 2008 21:19:43 -0000
@@ -104,7 +104,9 @@
 
      MAKE              Path name to invoke make(1) as.
 
-     MAKEFLAGS         Flags to invoke make(1) with.
+     MAKEFLAGS         Flags to invoke make(1) with.  Note that build.sh
+                       ignores the value of MAKEFLAGS passed in the environ-
+                       ment, but allows MAKEFLAGS to be set via the -V option.
 
      MAKEOBJDIR        Directory to use as the .OBJDIR for the current direc-
                        tory.  The value is subjected to variable expansion by
Index: doc/BUILDING.mdoc
===================================================================
--- doc/BUILDING.mdoc   24 Sep 2008 07:36:52 -0000      1.67
+++ doc/BUILDING.mdoc   14 Oct 2008 21:19:45 -0000
@@ -213,6 +213,15 @@
 Flags to invoke
 .Xr make 1
 with.
+Note that
+.Sy build.sh
+ignores the value of
+.Sy MAKEFLAGS
+passed in the environment, but allows
+.Sy MAKEFLAGS
+to be set via the
+.Fl V
+option.
 .
 .It Sy MAKEOBJDIR
 Directory to use as the


Home | Main Index | Thread Index | Old Index