toolchain modoifications
[hdw-linux/hdw-linux.git] / packages / base / gcc / gcc
1 # hdw - linux gcc package
2 #
3 # author: hackbard@hackdaworld.dyndns.org
4 #
5 # [V] 4.1.1
6 # [S] 2-5
7 # [D] gcc-4.1.1.tar.bz2 ftp://ftp.fu-berlin.de/unix/gnu/gcc/gcc-4.1.1/
8 # [D] gcc-g++-4.1.1.tar.bz2 ftp://ftp.fu-berlin.de/unix/gnu/gcc/gcc-4.1.1/
9 # [D] gcc-g77-4.1.1.tar.bz2 ftp://ftp.fu-berlin.de/unix/gnu/gcc/gcc-4.1.1/
10
11 extraver="-${ver}"
12 [ "$ver" = "cvs" ] && extraver=""
13
14 confopt="$confopt --enable-languages=c,c++,f77"
15 confopt="$confopt --enable-shared --enable-clocale=gnu"
16 confopt="$confopt --enable-threads=posix --enable-__cxa_atexit"
17 confopt="$confopt --libexecdir=$prefix/lib"
18
19 # unset CFLAGS CXXFLAGS
20
21 pre_install()   {
22         echo "extracting c++ and fortran sources ..."
23         tar --use-compress-program=$compress -xvf $archdir/gcc-g++-$ver.tar.bz2
24         tar --use-compress-program=$compress -xvf $archdir/gcc-g77-$ver.tar.bz2
25
26         echo "patching Makefile (libiberty) ..."
27         sed 's%install_to_$(INSTALL_DEST) %%' libiberty/Makefile.in > tmp~
28         mv tmp~ libiberty/Makefile.in
29
30         echo "patching Makefile (gcc) ..."
31         sed -e 's@^XCFLAGS =$@& -fomit-frame-pointer@' \
32             -e 's@\./fixincl\.sh@-c true@' gcc/Makefile.in > tmp~
33         mv tmp~ gcc/Makefile.in
34
35         echo "patching gccbug ..."
36         sed 's/@have_mktemp_command@/yes/' gcc/gccbug.in > tmp~
37         mv tmp~ gcc/gccbug.in
38                 }
39
40 post_install()  {
41         ln -sf ../usr/bin/cpp $root/lib &&
42         ln -sf gcc $root/usr/bin/cc
43                 }
44
45 build_main()    {
46         mkdir -p ../gcc-build && cd ../gcc-build
47         ../gcc${extraver}/configure $confopt
48         make
49         make install
50                 }