diff options
author | David 'Digit' Turner <digit@google.com> | 2011-10-07 16:14:56 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2011-10-07 18:06:52 +0200 |
commit | 2397ae759e7f575437625c5d905cba3eafacb42c (patch) | |
tree | ebedd4bf3fe06d8cee963af353dbfe47f375d272 | |
parent | 3806a2d17c66c8bbba7649e71c8c7d97f9267e17 (diff) | |
download | ndk-2397ae759e7f575437625c5d905cba3eafacb42c.tar.gz |
prebuilt-common.sh: add register_jobs_option
Change-Id: Ibed2026c0ff80041a4d024b7b15dc2c70240dc27
-rwxr-xr-x | build/tools/build-gabi++.sh | 8 | ||||
-rwxr-xr-x | build/tools/build-gcc.sh | 6 | ||||
-rwxr-xr-x | build/tools/build-gdbserver.sh | 9 | ||||
-rwxr-xr-x | build/tools/build-host-sed.sh | 4 | ||||
-rwxr-xr-x | build/tools/build-ndk-stack.sh | 3 | ||||
-rwxr-xr-x | build/tools/build-stlport.sh | 6 | ||||
-rw-r--r-- | build/tools/prebuilt-common.sh | 7 |
7 files changed, 18 insertions, 25 deletions
diff --git a/build/tools/build-gabi++.sh b/build/tools/build-gabi++.sh index f5c4a702b..a5c56d992 100755 --- a/build/tools/build-gabi++.sh +++ b/build/tools/build-gabi++.sh @@ -57,14 +57,10 @@ register_var_option "--out-dir=<path>" OUT_DIR "Specify output directory directl ABIS="$PREBUILT_ABIS" register_var_option "--abis=<list>" ABIS "Specify list of target ABIs." -JOBS="$BUILD_NUM_CPUS" -register_var_option "-j<number>" JOBS "Use <number> build jobs in parallel" - NO_MAKEFILE= register_var_option "--no-makefile" NO_MAKEFILE "Do not use makefile to speed-up build" -NUM_JOBS=$BUILD_NUM_CPUS -register_var_option "-j<number>" NUM_JOBS "Run <number> build jobs in parallel" +register_jobs_option extract_parameters "$@" @@ -113,7 +109,7 @@ fi build_gabixx_libs_for_abi () { - local ARCH BINPREFIX SYSROOT + local ARCH BINPREFIX local ABI=$1 local BUILDDIR="$2" local DSTDIR="$3" diff --git a/build/tools/build-gcc.sh b/build/tools/build-gcc.sh index eff5b46be..bb2736d38 100755 --- a/build/tools/build-gcc.sh +++ b/build/tools/build-gcc.sh @@ -54,15 +54,13 @@ register_var_option "--gmp-version=<version>" GMP_VERSION "Specify gmp version" MPFR_VERSION=2.4.1 register_var_option "--mpfr-version=<version>" MPFR_VERSION "Specify mpfr version" -JOBS=$BUILD_NUM_CPUS -register_var_option "-j<number>" JOBS "Use <number> parallel build jobs" - COPY_LIBSTDCXX=no register_var_option "--copy-libstdcxx" COPY_LIBSTDCXX "Copy libstdc++ to <ndk-dir>/$GNUSTL_SUBDIR" KEEP_LIBSTDCXX=no register_var_option "--keep-libstdcxx" KEEP_LIBSTDCXX "Experimental: keep libstdc++ inside toolchain" +register_jobs_option register_mingw_option register_try64_option @@ -218,7 +216,7 @@ dump "Building : $TOOLCHAIN toolchain [this can take a long time]." cd $BUILD_OUT && export CC CXX && export ABI=$HOST_GMP_ABI && -run make -j$JOBS +run make -j$NUM_JOBS if [ $? != 0 ] ; then # Unfortunately, there is a bug in the GCC build scripts that prevent # parallel mingw builds to work properly on some multi-core machines diff --git a/build/tools/build-gdbserver.sh b/build/tools/build-gdbserver.sh index af49038fe..d594d9cfb 100755 --- a/build/tools/build-gdbserver.sh +++ b/build/tools/build-gdbserver.sh @@ -55,12 +55,11 @@ register_var_option "--sysroot=<path>" SYSROOT "Specify sysroot directory direct NOTHREADS=no register_var_option "--disable-threads" NOTHREADS "Disable threads support" -JOBS=$HOST_NUM_CPUS -register_var_option "-j<number>" JOBS "Use <number> build jobs in parallel" - -GDB_VERSION=7.1.x +GDB_VERSION=$DEFAULT_GDB_VERSION register_var_option "--gdb-version=<name>" GDB_VERSION "Use specific gdb version." +register_jobs_option + extract_parameters "$@" setup_default_log_file @@ -214,7 +213,7 @@ LDFLAGS="$OLD_LDFLAGS" # build gdbserver dump "Building : $TOOLCHAIN gdbserver." cd $BUILD_OUT && -run make -j$JOBS +run make -j$NUM_JOBS if [ $? != 0 ] ; then dump "Could not build $TOOLCHAIN gdbserver. Use --verbose to see why." exit 1 diff --git a/build/tools/build-host-sed.sh b/build/tools/build-host-sed.sh index 8b21559ba..e8b271c0a 100755 --- a/build/tools/build-host-sed.sh +++ b/build/tools/build-host-sed.sh @@ -26,9 +26,7 @@ PROGRAM_DESCRIPTION=\ register_try64_option register_mingw_option - -NUM_JOBS=$BUILD_NUM_CPUS -register_var_option "-j<count>" NUM_JOBS "Specify parallel build jobs" +register_jobs_option OUT= CUSTOM_OUT= diff --git a/build/tools/build-ndk-stack.sh b/build/tools/build-ndk-stack.sh index 1964a3c7a..56d369933 100755 --- a/build/tools/build-ndk-stack.sh +++ b/build/tools/build-ndk-stack.sh @@ -32,8 +32,7 @@ CUSTOM_CC= register_option "--cc=<path>" do_cc "Specify host compiler" do_cc () { CC=$1; CUSTOM_CC=yes; } -NUM_JOBS=$HOST_NUM_CPUS -register_var_option "-j<number>" NUM_JOBS "Specify number of parallel builds" +register_jobs_option BUILD_DIR= register_var_option "--build-dir=<path>" BUILD_DIR "Specify build directory" diff --git a/build/tools/build-stlport.sh b/build/tools/build-stlport.sh index d5a04ef2a..70d8ca904 100755 --- a/build/tools/build-stlport.sh +++ b/build/tools/build-stlport.sh @@ -57,14 +57,10 @@ register_var_option "--out-dir=<path>" OUT_DIR "Specify output directory directl ABIS="$PREBUILT_ABIS" register_var_option "--abis=<list>" ABIS "Specify list of target ABIs." -JOBS="$BUILD_NUM_CPUS" -register_var_option "-j<number>" JOBS "Use <number> build jobs in parallel" - NO_MAKEFILE= register_var_option "--no-makefile" NO_MAKEFILE "Do not use makefile to speed-up build" -NUM_JOBS=$BUILD_NUM_CPUS -register_var_option "-j<number>" NUM_JOBS "Run <number> build jobs in parallel" +register_jobs_option extract_parameters "$@" diff --git a/build/tools/prebuilt-common.sh b/build/tools/prebuilt-common.sh index 7241ae750..5f6cc2fe8 100644 --- a/build/tools/prebuilt-common.sh +++ b/build/tools/prebuilt-common.sh @@ -279,6 +279,13 @@ register_try64_option () register_option "--try-64" do_try64_option "Generate 64-bit binaries." } + +register_jobs_option () +{ + NUM_JOBS=$BUILD_NUM_CPUS + register_var_option "-j<number>" NUM_JOBS "Use <number> parallel build jobs" +} + # Print the help, including a list of registered options for this program # Note: Assumes PROGRAM_PARAMETERS and PROGRAM_DESCRIPTION exist and # correspond to the parameters list and the program description |