[jhalfs] 02/03: Pass NINJAJOBS if N_PARALLEL is defined

"Git Owner" ([email protected] via alfs-discuss Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.automated
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch xry111/parallelism
in repository jhalfs.

commit 04a608ba8e512fc2458dd2be1d5f75b4e92e0ea6
Author: Pierre Labastie <[email protected]>
AuthorDate: Fri Nov 17 15:57:55 2023 +0100

    Pass NINJAJOBS if N_PARALLEL is defined
    
    Now that MAKEFLAGS is defined at the beginning of the scriptlet,
    there is no need to pass MAKEFLAGS as an envar to the scriptlet.
    But still NINJAJOBS is not defined. In most cases, when we want
    to use all cores, this is not a problem. But if N_PARALLEL is
    defined, it needs to be passed. Note that we also pass
    MAKEFLAGS in this case, because we use the old "wrt_xxx" function,
    but it is not used.
---
 LFS/master.sh | 27 +++++++--------------------
 1 file changed, 7 insertions(+), 20 deletions(-)

diff --git a/LFS/master.sh b/LFS/master.sh
index a7f4429..e3334d0 100644
--- a/LFS/master.sh
+++ b/LFS/master.sh
@@ -131,18 +131,13 @@ chapter_targets() {       #
           *kernel*) ;; # No CFLAGS for kernel
           *)  wrt_optimize "$name" ;;
       esac
-      # MAKEFLAGS is set even if no optimization now.
-      # For new books, the scripts contain the MAKEFLAGS, so no
-      # need to set them in the envars except if binutils-pass1
-      # and REALSBU=y. For Old books, N_PARALLEL and JH_MAKEFLAGS
-      # are set and we must set the envars.
-      case "${mkf_included}${this_script}${REALSBU}" in
-          *binutils-pass1y)
-              wrt_makeflags "$name" "-j1" "1" ;;
-          n*)
-              wrt_makeflags "$name" "$JH_MAKEFLAGS" "$N_PARALLEL" ;;
-      esac
-    fi
+      # There is no need to tweak MAKEFLAGS anymore, this is done
+      # by lfs.xsl. But still, NINJAJOBS needs to be set if
+      # N_PARALLEL is defined.
+      if [ -n "N_PARALLEL" ]; then
+         wrt_makeflags "$name" "$JH_MAKEFLAGS" "$N_PARALLEL"
+      fi
+    fi # end of package specific instructions
 
 # Some scriptlet have a special treatment; otherwise standard
     case "${this_script}" in
@@ -260,14 +255,6 @@ build_Makefile() {           #
 #  echo nb_chaps: $nb_chaps
 # end DEBUG
 
-  # We need to know if we have an old or a new book (with included MAKEFLAGS)
-  # we grep for MAKEFLAGS in chapter04 to find out.
-  if grep -q MAKEFLAGS chapter04/*; then
-	  mkf_included=y
-  else
-	  mkf_included=n
-  fi
-
   # Make a temporary file with all script targets
   for (( i = 4; i < nb_chaps+4; i++ )); do
     chapter_targets $i

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.