summaryrefslogtreecommitdiffstats
path: root/gcc43/PKGBUILD
blob: 63900ef8f5f5f5962ee868cd3e1bf8d67fd7ef20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Maintainer: Carson Reynolds <carson@k2.t.u-tokyo.ac.jp>

pkgname=gcc43
_ver=4.3
pkgver=4.3.4
pkgrel=3
pkgdesc="The GNU Compiler Collection"
arch=('i686' 'x86_64')
license=('GPL' 'LGPL')
url="http://gcc.gnu.org"
depends=('glibc' 'gmp' 'mpfr')
makedepends=('flex' 'bison')
options=('!libtool')

source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-{core,g++,fortran,objc,java}-${pkgver}.tar.bz2
	gcc_pure64.patch
	gcc-hash-style-both.patch
	buildfix_new_bison.patch)

md5sums=('575b3220bb8e7060939c429fc8608d22'
         'd526e34eec101b8c69254ed5215b6d41'
         '3e702a563d97bb2806dd81739c22806d'
         '37ba6440062ddf9bab43e6ae660c890b'
         'dd41be44634d39d145cdb715cde39be6'
         '4030ee1c08dd1e843c0225b772360e76'
         'bb420bc84b1104455b7230b1cd4b96c2'
         '6895f128e905bfcb26e328899235e553')

build() {
  cd ${srcdir}/gcc-${pkgver}
  # Don't install libiberty
  sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in

  if [ "${CARCH}" = "x86_64" ]; then
    patch -Np1 -i ../gcc_pure64.patch || return 1
  fi
  patch -Np0 -i ${srcdir}/gcc-hash-style-both.patch || return 1
  patch -Np0 -i ${srcdir}/buildfix_new_bison.patch || return 1

  echo ${pkgver} > gcc/BASE-VER

  # Don't run fixincludes
  sed -i -e 's@\./fixinc\.sh@-c true@' gcc/Makefile.in

  mkdir build
  cd build
  ../configure --prefix=/usr --enable-shared \
      --enable-languages=c,c++ \
      --enable-threads=posix --mandir=/usr/share/man --infodir=/usr/share/info \
      --enable-__cxa_atexit  --disable-multilib --libdir=/usr/lib \
      --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch \
      --with-tune=generic \
      --disable-werror --enable-checking=release \
      --program-suffix=-${_ver} --enable-version-specific-runtime-libs
  make || return 1
  make -j1 DESTDIR=${pkgdir} install || return 1

  # Lazy way of dealing with conflicting man and info pages...
  rm -rf ${pkgdir}/usr/share

  # Create links for gcc-4.3 build environment (useful for CUDA)
  mkdir -p $pkgdir/opt/gcc-4.3
  ln -s /usr/bin/gcc-4.3 $pkgdir/opt/gcc-4.3/gcc
  ln -s /usr/bin/g++-4.3 $pkgdir/opt/gcc-4.3/g++
}