Skip to content
This repository
Browse code

build-toolchain.sh now makes use of all processors.

  • Loading branch information...
commit d0ebce95f6c09893544b0848456d083f66e35765 1 parent 811d93e
Christian Ziegenrücker authored April 28, 2010

Showing 1 changed file with 9 additions and 9 deletions. Show diff stats Hide diff stats

  1. 18  toolchain/build-toolchain.sh
18  toolchain/build-toolchain.sh
@@ -7,7 +7,7 @@
7 7
 
8 8
 #########  Setup Variables  ###########
9 9
 MYDIR="$PWD/`dirname $0`"
10  
-
  10
+declare -i CPU="$(cat /proc/cpuinfo | grep processor | wc -l) + 1"
11 11
 # Package URL
12 12
 PKG_MIRROR="http://www.gnuarm.com"
13 13
 
@@ -171,14 +171,14 @@ stage_binutils_configure() {
171 171
 stage_binutils_build() {
172 172
 	echo "- Building binutils"
173 173
 	cd $TOOLCHAIN_PATH/binutils-build
174  
-	log make all
  174
+	log make -j$CPU all
175 175
 	checkRet "Failed to build binutils"
176 176
 }
177 177
 
178 178
 stage_binutils_install() {
179 179
 	echo "- Installing binutils"
180 180
 	cd $TOOLCHAIN_PATH/binutils-build
181  
-	log make install
  181
+	log make -j$CPU install
182 182
 	checkRet "Failed to install binutils"
183 183
 }
184 184
 
@@ -216,14 +216,14 @@ stage_gcc_configure() {
216 216
 stage_gcc_build() {
217 217
 	echo "- Building GCC part 1"
218 218
 	cd $TOOLCHAIN_PATH/gcc-build
219  
-	log make all-gcc
  219
+	log make -j$CPU all-gcc
220 220
 	checkRet "Failed to build GCC part 1"
221 221
 }
222 222
 
223 223
 stage_gcc_install() {
224 224
 	echo "- Installing GCC part 1"
225 225
 	cd $TOOLCHAIN_PATH/gcc-build
226  
-	log make install-gcc
  226
+	log make -j$CPU install-gcc
227 227
 	checkRet "Failed to install GCC part 1"
228 228
 }
229 229
 
@@ -252,28 +252,28 @@ stage_makesymlink() {
252 252
 stage_newlib_build() {
253 253
 	echo "- Building Newlib"
254 254
 	cd $TOOLCHAIN_PATH/newlib-build
255  
-	log make all
  255
+	log make -j$CPU all
256 256
 	checkRet "Failed to build newlib"
257 257
 }
258 258
 
259 259
 stage_newlib_install() {
260 260
 	echo "- Installing NewLib"
261 261
 	cd $TOOLCHAIN_PATH/newlib-build
262  
-	log make install
  262
+	log make -j$CPU install
263 263
 	checkRet "Failed to install newlib"
264 264
 }
265 265
 
266 266
 stage_gcc_build2() {
267 267
 	echo "- Building GCC part 2"
268 268
 	cd $TOOLCHAIN_PATH/gcc-build
269  
-	log make all
  269
+	log make -j$CPU all
270 270
 	checkRet "Failed to build GCC part 2"
271 271
 }
272 272
 
273 273
 stage_gcc_install2() {
274 274
 	echo "- Installing GCC part 2"
275 275
 	cd $TOOLCHAIN_PATH/gcc-build
276  
-	log make install
  276
+	log make -j$CPU install
277 277
 	checkRet "Failed to install GCC part 2"
278 278
 }
279 279
 

0 notes on commit d0ebce9

Please sign in to comment.
Something went wrong with that request. Please try again.