several changes to toolchain packages
[hdw-linux/hdw-linux.git] / packages / toolchain / gcc / gcc
1 # hdw - linux toolchain gcc package
2 #
3 # author: hackbard@hackdaworld.dyndns.org
4 #
5 # [V] 4.1.1
6 # [S] 0-1 0-4
7 # [D] gcc-4.1.1.tar.bz2 ftp://ftp.fu-berlin.de/unix/gnu/gcc/gcc-4.1.1/
8
9
10 extraver="-$ver"
11 [ "$ver" = "cvs" ] && extraver=""
12
13 confopt="$confopt --enable-shared --with-local-prefix=$prefix"
14 confopt="$confopt --libexecdir=$prefix/lib"
15
16 if [ "$priority" = "1" ] ; then
17         confopt="$confopt --enable-languages=c --disable-nls"
18
19         post_install()  {
20                 ln -vsf gcc $prefix/bin/cc
21                         }
22 fi
23
24 if [ "$priority" = "4" ] ; then
25         confopt="$confopt --enable-clocale=gnu --enable-threads=posix"
26         confopt="$confopt --enable-__cxa_atexit --enable-languages=c,c++"
27         confopt="$confopt --disable-libstdcxx-pch"
28         make_conf=""
29
30         pre_install()   {
31                 # no fix includes
32                 echo "patching (no fixincludes)"
33                 sed -e 's@\./fixinc\.sh@-c true@' \
34                     -e 's@^XCFLAGS =$@/& -fomit-frame-pointer@' \
35                          gcc/Makefile.in > tmp~
36                 mv tmp~ gcc/Makefile.in
37
38                 # specs
39                 echo "patching gcc specs now"
40                 for i in `grep -l dynamic-linker gcc/config/*/*.h`; do
41                         echo "patching $i ..."
42                         mv $i $i.orig
43         sed -e "s%-dynamic-linker /lib%-dynamic-linker $prefix/lib%g" \
44             -e "s%\(^#define LINK.* -Y P,\)\(/usr\)\(.*\)%\1$prefix\3%g" \
45                         $i.orig > $i
46                 done
47                 
48                 # general linux.h / remove default include search path
49                 echo "patching gcc/config/linux.h ..."
50                 echo "#undef STANDARD_INCLUDE_DIR" >> gcc/config/linux.h
51                 echo "#define STANDARD_INCLUDE_DIR 0" >> gcc/config/linux.h
52                         }
53 fi
54
55 build_main()    {
56         mkdir -p ../gcc-build && cd ../gcc-build
57         ../gcc${extraver}/configure $confopt &&
58         make $make_conf &&
59         make install
60                 }