diff options
-rw-r--r-- | Makefile.in | 10 | ||||
-rw-r--r-- | configure.in | 42 |
2 files changed, 47 insertions, 5 deletions
diff --git a/Makefile.in b/Makefile.in index db9849b4e6f2..9ef54c60a687 100644 --- a/Makefile.in +++ b/Makefile.in @@ -5,7 +5,7 @@ SHELL=/bin/sh all: . ./*Env.Set.sh && \ ./bootstrap && \ - cd instsetoo_native && ../solenv/bin/build.pl --all + cd instsetoo_native && ../solenv/bin/build.pl -P@BUILD_NCPUS@ --all -P@BUILD_MAX_JOBS@ distclean: . ./*Env.Set.sh && \ @@ -17,8 +17,8 @@ clean: dev-install: . ./*Env.Set.sh && \ - cd @SRC_ROOT@/instsetoo_native/util && \ - LOCALINSTALLDIR=@SRC_ROOT@/install dmake openoffice_en-US PKGFORMAT=installed && \ - $SOLARENV/bin/linkoo @SRC_ROOT@/install @SRC_ROOT@ && \ + cd $$SRC_ROOT/instsetoo_native/util && \ + LOCALINSTALLDIR=$$SRC_ROOT/install dmake openoffice_en-US PKGFORMAT=installed && \ + $SOLARENV/bin/linkoo $$SRC_ROOT/install $$SRC_ROOT && \ echo && \ - echo "Developer installation finished in @SRC_ROOT@" + echo "Developer installation finished in $$SRC_ROOT" diff --git a/configure.in b/configure.in index 2d276e9ffde8..3c6a88ea0339 100644 --- a/configure.in +++ b/configure.in @@ -821,6 +821,19 @@ AC_ARG_ENABLE(verbose, AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Disables generation of dependency information. ],,) +AC_ARG_WITH(num-cpus, +[ --with-num-cpus Number of build processes/cpus to use (number of + projects that will build at the same time). + Multi-process/multi-cpu builds can save a lot of + time on multi-cpu machines. Defaults to the number + of CPUs on the machine +],,) +AC_ARG_WITH(max-jobs, +[ --with-max-jobs Maximum number of jobs per one CPU that will be + issued at the same time my dmake. The real number of + the jobs is affected by the --with-num-cpus too, it + can get up to CPUS*max_jobs. Defaults to 1.], +,) BUILD_TYPE="OOo" @@ -6970,6 +6983,35 @@ fi AC_SUBST(nodep) dnl =================================================================== +dnl Number of CPUs to use during the build +dnl =================================================================== +AC_MSG_CHECKING([for number of processors to use]) +BUILD_NCPUS=`grep $'^processor\t*:' /proc/cpuinfo | wc -l` +if test "z$with_num_cpus" != "z"; then + BUILD_NCPUS=$with_num_cpus +fi +if test "$BUILD_NCPUS" = "0" ; then + BUILD_NCPUS=1 +fi +AC_MSG_RESULT([$BUILD_NCPUS]) +AC_SUBST(BUILD_NCPUS) + +dnl =================================================================== +dnl Number of CPUs to use during the build +dnl =================================================================== +AC_MSG_CHECKING([for maximum of jobs per processor]) +BUILD_MAX_JOBS="1" +if test "z$with_max_jobs" != "z"; then + if test "$with_max_jobs" -gt "10"; then + AC_MSG_WARN([dmake is limited to 10 jobs, using --with-max-jobs=10 (instead of $with_num_jobs).]) + with_max_jobs="10" + fi + BUILD_MAX_JOBS="$with_max_jobs" +fi +AC_MSG_RESULT([$BUILD_MAX_JOBS]) +AC_SUBST(BUILD_MAX_JOBS) + +dnl =================================================================== dnl Setting up the environment. dnl =================================================================== echo "********************************************************************" |