summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorreed <reed>2006-10-05 23:35:23 +0000
committerreed <reed>2006-10-05 23:35:23 +0000
commit398497eafbb59ef231b748969db71a474a8f4aee (patch)
tree5af7e6ee6b35e946ece7549d76b2cf18b93b839c /mk
parent7a248a8ef47b3816254c29da92a6d946dbc7f511 (diff)
downloadpkgsrc-398497eafbb59ef231b748969db71a474a8f4aee.tar.gz
Add experimental support for -j jobs building in the build
target. MAKE_JOBS is undefined by default. You can test this by setting in mk.conf: MAKE_JOBS=5 for example. Some package just won't build correctly with this -- these individual packages can set MAKE_JOBS_SAFE=no to disable it. This is based on discussion from last December 2005. Some pkgsrc users are using ideas like this. Note I have been using this since December 2005 on various single processor and multiprocessor systems. (Once I kept some stats on performance but have misplaced that now.) I haved tested this with many packages (but not a bulk build) on Linux, NetBSD and DragonFly. This commit doesn't include the commits for the MAKE_JOB_SAFE. As this is experimental it needs more testing. Some examples of problems are: comms/lrzsz, databases/gramps2, editors/vim, graphics/MesaLib, graphics/netpbm, net/bind9, print/ghostscript-esp, textproc/libxml, and www/lynx.
Diffstat (limited to 'mk')
-rw-r--r--mk/build/build.mk12
-rw-r--r--mk/defaults/mk.conf10
2 files changed, 18 insertions, 4 deletions
diff --git a/mk/build/build.mk b/mk/build/build.mk
index 4bdb931f579..c16acd23eec 100644
--- a/mk/build/build.mk
+++ b/mk/build/build.mk
@@ -1,4 +1,4 @@
-# $NetBSD: build.mk,v 1.6 2006/09/09 02:35:13 obache Exp $
+# $NetBSD: build.mk,v 1.7 2006/10/05 23:35:23 reed Exp $
#
# BUILD_MAKE_FLAGS is the list of arguments that is passed to the make
# process.
@@ -9,6 +9,12 @@
BUILD_MAKE_FLAGS?= ${MAKE_FLAGS}
BUILD_TARGET?= all
+.if defined(MAKE_JOBS_SAFE) && !empty(MAKE_JOBS_SAFE:M[nN][oO])
+_MAKE_JOBS= # nothing
+.elif defined(MAKE_JOBS)
+_MAKE_JOBS= -j${MAKE_JOBS}
+.endif
+
######################################################################
### build (PUBLIC)
######################################################################
@@ -96,8 +102,8 @@ do-build:
. for _dir_ in ${BUILD_DIRS}
${_PKG_SILENT}${_PKG_DEBUG}${_ULIMIT_CMD} \
cd ${WRKSRC} && cd ${_dir_} && \
- ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${BUILD_MAKE_FLAGS} \
- -f ${MAKE_FILE} ${BUILD_TARGET}
+ ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${_MAKE_JOBS} \
+ ${BUILD_MAKE_FLAGS} -f ${MAKE_FILE} ${BUILD_TARGET}
. endfor
.endif
diff --git a/mk/defaults/mk.conf b/mk/defaults/mk.conf
index ebe7a1b0c53..68cd076ee5a 100644
--- a/mk/defaults/mk.conf
+++ b/mk/defaults/mk.conf
@@ -1,4 +1,4 @@
-# $NetBSD: mk.conf,v 1.131 2006/09/27 15:18:15 joerg Exp $
+# $NetBSD: mk.conf,v 1.132 2006/10/05 23:35:23 reed Exp $
#
# This file provides default values for variables that may be overridden
@@ -36,6 +36,14 @@ GZIP?= -9
# Possible: -[0-9], --fast, --best (see gzip(1))
# Default: -9
+#MAKE_JOBS= 3
+# Set to maximum number of jobs ("make -j") for make to run at one time.
+# Possible: a positive integer (e.g. 17)
+# Default: not defined
+# Note that this is in testing. Some packages will not build with this.
+# Disabling this for an individual package can be done by setting
+# MAKE_JOBS_SAFE=NO within the per package Makefile.
+
#MKCRYPTO= no
# If not YES or yes, don't fetch, build or install crypto packages.
# Possible: not defined, no