summaryrefslogtreecommitdiff
path: root/multilib/lib32-libstdc++5/PKGBUILD
blob: 8d46308f910b2d8e72e0e590393ad31dacc6f8a5 (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
# $Id: PKGBUILD 64034 2012-02-08 19:14:10Z pschmitz $

pkgname=lib32-libstdc++5
pkgver=3.3.6
pkgrel=6
pkgdesc="Legacy GNU Standard C++ library version 3 (32 bit)"
arch=(x86_64)
url="http://gcc.gnu.org"
license=('GPL' 'LGPL')
depends=('lib32-gcc-libs')
makedepends=('gcc-multilib' 'binutils-multilib')
options=('!libtool' '!makeflags')
source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-{core,g++}-${pkgver}.tar.bz2
        gcc-3.4.3-no_multilib_amd64.patch)
md5sums=('18c52e6fb8966b7700665dca289d077f'
         '6b3d00b8d079805be1b895f7f6ce47a0'
         'b2a96584f4cee72362695ba44c911c40')

build(){
  export CFLAGS="-march=${CARCH/_/-} -O2 -pipe"
  export CXXFLAGS="-march=${CARCH/_/-} -O2 -pipe"
  cd ${srcdir}/gcc-${pkgver}

  patch -Np0 -i $srcdir/gcc-3.4.3-no_multilib_amd64.patch

  # fix build issue with recent gcc
  sed -i "s#O_CREAT#O_CREAT, 0666#" gcc/collect2.c
  # No fixincludes
  sed -i -e 's@\./fixinc\.sh@-c true@' gcc/Makefile.in

  mkdir ../gcc-build
  cd ../gcc-build
  # We build the full multilib libstdc++5 here, no idea how to restrict
  # the build process to the 32 bit version only.
  ../gcc-${pkgver}/configure --prefix=/usr --enable-shared \
      --enable-languages=c++ --enable-threads=posix --enable-__cxa_atexit \
      --enable-multilib
  make all-target-libstdc++-v3 BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O"
}

package() {
  cd ${srcdir}/gcc-build
  make DESTDIR=${pkgdir} install-target-libstdc++-v3

  # Only install the lib32 files
  rm -rf ${pkgdir}/usr/{include,share,lib}
  rm -f ${pkgdir}/usr/lib32/*.a
  rm -f ${pkgdir}/usr/lib32/libstdc++.so
}