Added Delight "normal" mode restrictions
[delight/core.git] / patches / patch-build_gcc-4.0.x
blob5d353e79334aa497e1696c39c2603bfb758cc012
1 --- gcc-5363-orig/build_gcc     2006-06-27 03:29:34.000000000 -0400
2 +++ gcc-5363/build_gcc  2008-02-25 16:03:50.000000000 -0500
3 @@ -106,11 +106,12 @@
4  CONFIGFLAGS="--disable-checking -enable-werror \
5    --prefix=$DEST_ROOT \
6    --mandir=\${prefix}/share/man \
7 -  --enable-languages=c,objc,c++,obj-c++ \
8 +  --enable-languages=c,objc,c++,obj-c++,d \
9    --program-transform-name=/^[cg][^.-]*$/s/$/-$MAJ_VERS/ \
10    --with-gxx-include-dir=\${prefix}/include/c++/$LIBSTDCXX_VERSION \
11    --with-slibdir=/usr/lib \
12 -  --build=$BUILD-apple-darwin$DARWIN_VERS"
13 +  --build=$BUILD-apple-darwin$DARWIN_VERS \
14 +    $EXTRA_CONFIG_FLAGS"
16  # Figure out how many make processes to run.
17  SYSCTL=`sysctl -n hw.activecpu`
18 @@ -140,7 +141,7 @@
19     --host=$BUILD-apple-darwin$DARWIN_VERS --target=$BUILD-apple-darwin$DARWIN_VERS || exit 1
20  fi
21  make $MAKEFLAGS $BOOTSTRAP CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
22 -make $MAKEFLAGS html CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
23 +#make $MAKEFLAGS html CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
24  make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$BUILD install-gcc install-target \
25    CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
27 @@ -237,9 +238,9 @@
28  rm -rf * || exit 1
30  # HTML documentation
31 -HTMLDIR="/Developer/ADC Reference Library/documentation/DeveloperTools"
32 -mkdir -p ".$HTMLDIR" || exit 1
33 -cp -Rp $DIR/obj-$BUILD-$BUILD/gcc/HTML/* ".$HTMLDIR/" || exit 1
34 +#HTMLDIR="/Developer/ADC Reference Library/documentation/DeveloperTools"
35 +#mkdir -p ".$HTMLDIR" || exit 1
36 +#cp -Rp $DIR/obj-$BUILD-$BUILD/gcc/HTML/* ".$HTMLDIR/" || exit 1
38  # Manual pages
39  mkdir -p .$DEST_ROOT/share || exit 1
40 @@ -269,7 +270,7 @@
41  # bin
42  # The native drivers ('native' is different in different architectures).
43  BIN_FILES=`ls $DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin | grep '^[^-]*-[0-9.]*$' \
44 -  | grep -v gccbug | grep -v gcov || exit 1`
45 +  | grep -v gccbug | grep -v gcov | grep -v gdmd || exit 1`
46  mkdir .$DEST_ROOT/bin
47  for f in $BIN_FILES ; do
48    lipo -output .$DEST_ROOT/bin/$f -create $DIR/dst-*$DEST_ROOT/bin/$f || exit 1
49 @@ -285,6 +286,8 @@
50      $DIR/dst-*-$t$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$VERS || exit 1
51    lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++-$VERS -create \
52      $DIR/dst-*-$t$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++* || exit 1
53 +  lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gdc-$VERS -create \
54 +    $DIR/dst-*-$t$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gdc* || exit 1
55  done
57  # lib
58 @@ -358,6 +361,42 @@
59    fi
60  done
62 +# GDC: Phobos and gdmd
63 +if test -e $DIR/dst-$BUILD-$BUILD$DEST_ROOT/include/d2; then
64 +    phobos_sfx=2;
65 +else
66 +    phobos_sfx='';
67 +fi
68 +cp -p $DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin/gdmd-* $DEST_DIR$DEST_ROOT/bin
69 +cp -pR $DIR/dst-$BUILD-$BUILD$DEST_ROOT/include/d$phobos_sfx $DEST_DIR$DEST_ROOT/include \
70 +    || exit 1
71 +phobos_lib_list=
72 +for t in $TARGETS ; do
73 +    if test $t = $BUILD ; then
74 +       phobos_lib_dir="$DIR/dst-$BUILD-$t$DEST_ROOT/lib"
75 +    else
76 +       cp -pR $DIR/dst-$BUILD-$t$DEST_ROOT/include/d$phobos_sfx/$VERS/$t-apple-darwin$DARWIN_VERS \
77 +           $DEST_DIR$DEST_ROOT/include/d$phobos_sfx/$VERS || exit 1
78 +       phobos_lib_dir="$DIR/dst-$BUILD-$t$DEST_ROOT/$t-apple-darwin$DARWIN_VERS/lib"
79 +    fi
80 +    phobos_lib_list="$phobos_lib_list $phobos_lib_dir/libgphobos$phobos_sfx.a"
82 +    # Get 64-bit variants
83 +    other_libdir=''
84 +    if test "$t" = i686; then
85 +       other_libdir="x86_64"
86 +    elif test "$t" = powerpc; then
87 +       other_libdir="ppc64"
88 +    fi
89 +    if test -n "$other_libdir"; then
90 +       other_phobos="$phobos_lib_dir/$other_libdir/libgphobos$phobos_sfx.a"
91 +       if test -r "$other_phobos"; then
92 +           phobos_lib_list="$phobos_lib_list $other_phobos"
93 +       fi
94 +    fi
95 +done
96 +lipo -output $DEST_DIR$DEST_ROOT/lib/libgphobos$phobos_sfx.a -create $phobos_lib_list || exit 1
98  # Add extra man page symlinks for 'c++' and for arch-specific names.
99  MDIR=$DEST_DIR$DEST_ROOT/share/man/man1
100  ln -f $MDIR/g++-$MAJ_VERS.1 $MDIR/c++-$MAJ_VERS.1 || exit 1
101 @@ -389,6 +428,16 @@
102         -L$DIR/dst-$BUILD-$h$DEST_ROOT/$h-apple-darwin$DARWIN_VERS/lib/                    \
103          -L$DIR/obj-$h-$BUILD/libiberty/                                        \
104         -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-g++-$MAJ_VERS || exit 1
106 +    $DEST_DIR$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-gcc-$VERS                          \
107 +       $ORIG_SRC_DIR/gcc/config/darwin-driver.c                               \
108 +       -DPDN="\"-apple-darwin$DARWIN_VERS-gdc-$VERS\""                                    \
109 +       -DIL="\"$DEST_ROOT/bin/\"" -I  $ORIG_SRC_DIR/include                   \
110 +       -I  $ORIG_SRC_DIR/gcc -I  $ORIG_SRC_DIR/gcc/config                     \
111 +       -liberty -L$DIR/dst-$BUILD-$h$DEST_ROOT/lib/                           \
112 +       -L$DIR/dst-$BUILD-$h$DEST_ROOT/$h-apple-darwin$DARWIN_VERS/lib/                    \
113 +        -L$DIR/obj-$h-$BUILD/libiberty/                                        \
114 +       -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-gdc-$MAJ_VERS || exit 1
115  done
117  lipo -output $DEST_DIR/$DEST_ROOT/bin/gcc-$MAJ_VERS -create \
118 @@ -397,11 +446,24 @@
119  lipo -output $DEST_DIR/$DEST_ROOT/bin/g++-$MAJ_VERS -create \
120    $DEST_DIR/$DEST_ROOT/bin/tmp-*-g++-$MAJ_VERS || exit 1
122 +lipo -output $DEST_DIR/$DEST_ROOT/bin/gdc-$MAJ_VERS -create \
123 +  $DEST_DIR/$DEST_ROOT/bin/tmp-*-gdc-$MAJ_VERS || exit 1
125  ln -f $DEST_DIR/$DEST_ROOT/bin/g++-$MAJ_VERS $DEST_DIR/$DEST_ROOT/bin/c++-$MAJ_VERS || exit 1
127  rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-gcc-$MAJ_VERS || exit 1
128  rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-g++-$MAJ_VERS || exit 1
129 +rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-gdc-$MAJ_VERS || exit 1
131 +# Build rdmd
132 +for h in $HOSTS ; do
133 +    $DEST_DIR$DEST_ROOT/bin/$h-apple-darwin$DARWIN_VERS-gdc-$VERS                          \
134 +       $ORIG_SRC_DIR/gcc/d/rdmd.d      \
135 +       -o $DEST_DIR/$DEST_ROOT/bin/tmp-$h-rdmd || exit 1
136 +done
137 +lipo -output $DEST_DIR/$DEST_ROOT/bin/rdmd -create \
138 +  $DEST_DIR/$DEST_ROOT/bin/tmp-*-rdmd || exit 1
139 +rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-rdmd || exit 1
141  ########################################
142  # Save the source files and objects needed for debugging