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.
This commit is contained in:
Pierre Labastie 2023-11-17 15:57:55 +01:00
parent a9360e10a7
commit 04a608ba8e

View file

@ -131,18 +131,13 @@ chapter_targets() { #
*kernel*) ;; # No CFLAGS for kernel *kernel*) ;; # No CFLAGS for kernel
*) wrt_optimize "$name" ;; *) wrt_optimize "$name" ;;
esac esac
# MAKEFLAGS is set even if no optimization now. # There is no need to tweak MAKEFLAGS anymore, this is done
# For new books, the scripts contain the MAKEFLAGS, so no # by lfs.xsl. But still, NINJAJOBS needs to be set if
# need to set them in the envars except if binutils-pass1 # N_PARALLEL is defined.
# and REALSBU=y. For Old books, N_PARALLEL and JH_MAKEFLAGS if [ -n "N_PARALLEL" ]; then
# are set and we must set the envars. wrt_makeflags "$name" "$JH_MAKEFLAGS" "$N_PARALLEL"
case "${mkf_included}${this_script}${REALSBU}" in fi
*binutils-pass1y) fi # end of package specific instructions
wrt_makeflags "$name" "-j1" "1" ;;
n*)
wrt_makeflags "$name" "$JH_MAKEFLAGS" "$N_PARALLEL" ;;
esac
fi
# Some scriptlet have a special treatment; otherwise standard # Some scriptlet have a special treatment; otherwise standard
case "${this_script}" in case "${this_script}" in
@ -260,14 +255,6 @@ build_Makefile() { #
# echo nb_chaps: $nb_chaps # echo nb_chaps: $nb_chaps
# end DEBUG # 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 # Make a temporary file with all script targets
for (( i = 4; i < nb_chaps+4; i++ )); do for (( i = 4; i < nb_chaps+4; i++ )); do
chapter_targets $i chapter_targets $i