llvm.org GIT mirror llvm / ff140fa
Apple GCC 4.2 builds things differently. It no longer spawns a bunch of processes, but requires the project to use -j. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49744 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 11 years ago
1 changed file(s) with 33 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
9494 LLVM_VERSION="$LLVM_SUBMIT_VERSION-$LLVM_SUBMIT_SUBVERSION"
9595 fi
9696
97 # Note: Don't pass -jN here. Building universal already has parallelism and we
98 # don't want to make the builders hit swap by firing off too many gcc's at the
99 # same time.
100 make $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$TARGETS" \
97 GCC_VER=`cc --version 2>/dev/null | sed 1q`
98
99 if echo "$GCC_VER" | grep GCC > /dev/null; then
100 GCC_VER=`echo $GCC_VER | sed -e 's/.*(GCC) \([0-9.][0-9.]*\).*/\1/'`
101 MAJ_VER=`echo $GCC_VER | sed 's/\..*//'`
102 MIN_VER=`echo $GCC_VER | sed 's/[^.]*\.\([0-9]*\).*/\1/'`
103 fi
104
105 JOBS_FLAG=""
106
107 # Note: If compiling with GCC 4.0, don't pass the -jN flag. Building universal
108 # already has parallelism and we don't want to make the builders hit swap by
109 # firing off too many gccs at the same time.
110 if [ "x$MAJ_VER" != "x4" -o "x$MIN_VER" != "x0" ]; then
111 # Figure out how many make processes to run.
112 SYSCTL=`sysctl -n hw.activecpu`
113
114 # hw.activecpu only available in 10.2.6 and later
115 if [ -z "$SYSCTL" ]; then
116 SYSCTL=`sysctl -n hw.ncpu`
117 fi
118
119 # sysctl -n hw.* does not work when invoked via B&I chroot /BuildRoot.
120 # Builders can default to 2, since even if they are single processor,
121 # nothing else is running on the machine.
122 if [ -z "$SYSCTL" ]; then
123 SYSCTL=2
124 fi
125
126 JOBS_FLAG="-j $SYSCTL"
127 fi
128
129 make $JOBS_FLAG $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$TARGETS" \
101130 LLVM_SUBMIT_VERSION=$LLVM_SUBMIT_VERSION \
102131 LLVM_SUBMIT_SUBVERSION=$LLVM_SUBMIT_SUBVERSION \
103132 CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'"