Use move semantics if possible to construct ConstantRanges.
[oota-llvm.git] / utils / buildit / build_llvm
index c7777f83383a077f12cb8f36d83346b1f3b0be6a..4ed25f2e67163798078fe25a8fbe09f95353cde5 100755 (executable)
@@ -103,7 +103,8 @@ COMMON_CONFIGURE_OPTS="\
   --prefix=$DEST_DIR$DEST_ROOT \
   --enable-assertions=$LLVM_ASSERTIONS \
   --enable-optimized=$LLVM_OPTIMIZED \
-  --disable-bindings"
+  --disable-bindings \
+  --disable-zlib"
 
 COMMON_MAKEFLAGS="\
   UNIVERSAL=1 \
@@ -154,6 +155,11 @@ if [ "$ARM_HOSTED_BUILD" = yes ]; then
     --program-prefix="" \
     || exit 1
 
+  if [ -n "$IPHONEOS_DEPLOYMENT_TARGET" ]; then
+    COMMON_MAKEFLAGS="$COMMON_MAKEFLAGS \
+      DEPLOYMENT_TARGET=-mios-version-min=$IPHONEOS_DEPLOYMENT_TARGET"
+  fi
+
   make $JOBS_FLAG $COMMON_MAKEFLAGS SDKROOT= UNIVERSAL_ARCH="$HOSTS" \
     CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'"
   if [ $? != 0 ] ; then
@@ -171,8 +177,16 @@ else
     # Use a non-standard "darwin_sim" host triple to trigger a cross-build.
     configure_opts="--enable-targets=x86 --host=i686-apple-darwin_sim \
                     --build=i686-apple-darwin10"
+    if [ -n "$IPHONEOS_DEPLOYMENT_TARGET" ]; then
+      COMMON_MAKEFLAGS="$COMMON_MAKEFLAGS \
+        DEPLOYMENT_TARGET=-mios-simulator-version-min=$IPHONEOS_DEPLOYMENT_TARGET"
+    fi
   else
     configure_opts="--enable-targets=arm,x86"
+    if [ -n "$MACOSX_DEPLOYMENT_TARGET" ]; then
+      COMMON_MAKEFLAGS="$COMMON_MAKEFLAGS \
+        DEPLOYMENT_TARGET=-mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
+    fi
   fi
 
   if [ $SDKROOT ]; then
@@ -221,6 +235,16 @@ RC_ProjectSourceSubversion=`printf "%d" $LLVM_MINOR_VERSION`
 echo "#define LLVM_VERSION ${RC_ProjectSourceVersion}" > $DEST_DIR$DEST_ROOT/include/llvm/Version.h
 echo "#define LLVM_MINOR_VERSION ${RC_ProjectSourceSubversion}" >> $DEST_DIR$DEST_ROOT/include/llvm/Version.h
 
+# Run unifdef to preprocess the installed headers to reflect whether this
+# was a debug or release build.
+for file in `find $DEST_DIR$DEST_ROOT/include -type f -print`; do
+  if [ "$LLVM_ASSERTIONS" = yes ]; then
+    unifdef -UNDEBUG -D_DEBUG -o $file $file
+  else
+    unifdef -DNDEBUG -U_DEBUG -ULLVM_ENABLE_DUMP -o $file $file
+  fi
+done
+
 # Find the right version of strip to use.
 STRIP=strip
 if [ -n "$SDKROOT" ]; then