diff options
author | truckman <truckman@FreeBSD.org> | 2015-05-15 07:07:17 +0800 |
---|---|---|
committer | truckman <truckman@FreeBSD.org> | 2015-05-15 07:07:17 +0800 |
commit | 83c7293aacbc4e10dc95712dbb19f4df5cfe52a3 (patch) | |
tree | eb2f9f6b0d3ecfd8a1aeb8baf65a72e5400ed313 /editors/openoffice-4 | |
parent | 6a9ee3f385e226040b8abc6720c0bc59c7972c12 (diff) | |
download | freebsd-ports-gnome-83c7293aacbc4e10dc95712dbb19f4df5cfe52a3.tar.gz freebsd-ports-gnome-83c7293aacbc4e10dc95712dbb19f4df5cfe52a3.tar.zst freebsd-ports-gnome-83c7293aacbc4e10dc95712dbb19f4df5cfe52a3.zip |
Do not attempt to override the intent of DISABLE_MAKE_JOBS, which
does not succeed in any case.
The do-build target does not need to use bash, or even an extra
level of shell.
There are two levels of parallelism in the openoffice build framework.
Split MAKE_JOBS_NUMBER between the two levels instead of potentially
running MAKE_JOBS_NUMBER^2 compilations in parallel.
PR: 199930
Approved by: mat (mentor, implicit)
Diffstat (limited to 'editors/openoffice-4')
-rw-r--r-- | editors/openoffice-4/Makefile | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/editors/openoffice-4/Makefile b/editors/openoffice-4/Makefile index d81822ac42f5..4fa0d8a908da 100644 --- a/editors/openoffice-4/Makefile +++ b/editors/openoffice-4/Makefile @@ -178,14 +178,9 @@ CONFIGURE_ENV+= CC="${OOOCC}" CXX="${OOOCXX}" \ GNU_CONFIGURE= yes WRKSUBDIR= ${WRKDIR}/aoo-${AOOVERSION} WRKSRC?= ${WRKSUBDIR}/main -BASH?= ${PREFIX}/bin/bash SUB_FILES= pkg-message SUB_LIST= EXECBASE=${EXECBASE} AOOTAG=${AOOTAG} AOOUDIR=${AOOUDIR} -.if defined(DISABLE_MAKE_JOBS) -MAKE_JOBS_NUMBER= 4 -.endif - CONFIGURE_ARGS+= \ --with-system-apache-commons=yes \ --with-commons-codec-jar=${JAVALIBDIR}/commons-codec.jar \ @@ -300,7 +295,42 @@ do-build: cd ${WRKSUBDIR} ; ${PRINTF} "main=active\n" >> source_config cd ${WRKSUBDIR} ; ${PRINTF} "extras=active\n" >> source_config cd ${WRKSRC} ; ./bootstrap - cd ${WRKSRC} ; ${SETENV} "LANG=C" "LC_ALL=C" FBSD_LDFLAGS="${LDFLAGS}" ${BASH} -c "source ${FREEBSD_ENV_SET} ; cd instsetoo_native/util ; build.pl --all -P${MAKE_JOBS_NUMBER} -- -P${MAKE_JOBS_NUMBER}" + # + # numproc controls the number of parallel makes. + # + # dmproc is passed to dmake and controls parallelization at that + # level. + # + # dmproc > numproc seems to give shorter build times than + # numproc > dmproc. + # + # Select values for numproc and dmproc such that: + # * numproc*dmproc >= MAKE_JOBS_NUMBER + # * minimize numproc*dmproc-MAKE_JOBS_NUMBER + # * dmproc >= numproc + # * dmproc <= 2*numproc if MAKE_JOBS_NUMBER <= 3 + # + cd ${WRKSRC} ; . ${FREEBSD_ENV_SET} ; cd instsetoo_native/util ; \ + export LANG=C LC_ALL=C FBSD_LDFLAGS="${LDFLAGS}" ; \ + if [ ${MAKE_JOBS_NUMBER} -le 3 ] ; then \ + numproc=1 ; dmproc=${MAKE_JOBS_NUMBER} ; \ + else \ + a=1 ; \ + while [ $$(( 2 * $${a} * $${a} )) -lt ${MAKE_JOBS_NUMBER} ]; do \ + a=$$(( $${a} + 1 )) ; \ + done ; \ + b=$$(( $${a} + 1 )) ; \ + ad=$$(( ( ${MAKE_JOBS_NUMBER} + $${a} - 1 ) / $${a} )) ; \ + ap=$$(( $${a} * $${ad} )) ; \ + bd=$$(( ( ${MAKE_JOBS_NUMBER} + $${b} - 1 ) / $${b} )) ; \ + bp=$$(( $${b} * $${bd} )) ; \ + if [ $${ap} -le $${bp} ]; then \ + numproc=$${a} ; dmproc=$${ad} ; \ + else \ + numproc=$${b} ; dmproc=$${bd} ; \ + fi ; \ + fi ; \ + build.pl --all -P$${numproc} -- -P$${dmproc} do-install: cd ${WRKSRC}/instsetoo_native/unxfbsd?.pro/Apache_OpenOffice/archive/install/${LOCALIZED_LANG}/ ; ${LS} *.tar.?z > ${WRKDIR}/INSTALLFILES |