[llvm-commits] [llvm-gcc-4.0] r42361 - /llvm-gcc-4.0/trunk/build_gcc

Bill Wendling isanbard at gmail.com
Wed Sep 26 11:27:56 PDT 2007


Author: void
Date: Wed Sep 26 13:27:56 2007
New Revision: 42361

URL: http://llvm.org/viewvc/llvm-project?rev=42361&view=rev
Log:
The environment variable "LLVM_DEBUG=1" can now be used to create an Apple-style "debug" build.

Modified:
    llvm-gcc-4.0/trunk/build_gcc

Modified: llvm-gcc-4.0/trunk/build_gcc
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/build_gcc?rev=42361&r1=42360&r2=42361&view=diff

==============================================================================
--- llvm-gcc-4.0/trunk/build_gcc (original)
+++ llvm-gcc-4.0/trunk/build_gcc Wed Sep 26 13:27:56 2007
@@ -35,14 +35,24 @@
 #APPLE LOCAL end LLVM
 
 # The GNU makefile target ('bootstrap' by default).
-BOOTSTRAP=${BOOTSTRAP-bootstrap}
+if [ "x$LLVM_DEBUG" == "x" ]; then
+    BOOTSTRAP=${BOOTSTRAP-bootstrap}
+else
+    BOOTSTRAP=
+fi
 
 # The B&I build srcript (~rc/bin/buildit) accepts an '-othercflags'
 # command-line flag, and captures the argument to that flag in
 # $RC_NONARCH_CFLAGS (and mysteriously prepends '-pipe' thereto).
 # We will allow this to override the default $CFLAGS and $CXXFLAGS.
 
-CFLAGS="-g -O2 ${RC_NONARCH_CFLAGS/-pipe/}"
+if [ "x$LLVM_DEBUG" == "x" ]; then
+    CFLAGS="-g -O2 ${RC_NONARCH_CFLAGS/-pipe/}"
+    OPTIMIZE_OPTS="ENABLE_OPTIMIZED=1"
+else
+    CFLAGS="-g"
+    OPTIMIZE_OPTS=
+fi
 
 # This isn't a parameter; it is the architecture of the current machine.
 BUILD=`arch | $TRANSLATE_ARCH`
@@ -194,9 +204,9 @@
   # we don't want to make the builders hit swap by firing off too many gcc's at
   # the same time.
   ## FIXME: Remove -O2 when rdar://4560645 is fixed.
-  make ENABLE_OPTIMIZED=1 UNIVERSAL=1 UNIVERSAL_ARCH="$LLVM_ARCHS" \
-       OPTIMIZE_OPTION='-O2' \
-       CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'"
+  make $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$LLVM_ARCHS" \
+      OPTIMIZE_OPTION='-O2' \
+      CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'"
 
   if ! test $? == 0 ; then
       echo "error: LLVM 'make' failed!"
@@ -246,7 +256,7 @@
 fi
 # Unset RC_DEBUG_OPTIONS because it causes the bootstrap to fail.
 RC_DEBUG_OPTIONS= \
-  make $MAKEFLAGS $BOOTSTRAP CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
+    make $MAKEFLAGS $BOOTSTRAP CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
 make $MAKEFLAGS html CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
 make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$BUILD install-gcc install-target \
   CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
@@ -541,7 +551,7 @@
   cd $DIR/obj-llvm || exit 1
 
   ## Install the tree into the destination directory.
-  make $MAKEFLAGS ENABLE_OPTIMIZED=1 UNIVERSAL=1 OPTIMIZE_OPTION='-O2' install
+  make $MAKEFLAGS $OPTIMIZE_OPTS UNIVERSAL=1 OPTIMIZE_OPTION='-O2' install
 
   if ! test $? == 0 ; then
       echo "error: LLVM 'make install' failed!"





More information about the llvm-commits mailing list