summaryrefslogtreecommitdiff
path: root/chunks/stage2-gcc.morph
blob: f740fd332263631ef2e62c7395db0fbaf161e84a (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
name: stage2-gcc
kind: chunk
repo: upstream:gcc-tarball
ref: dd78b627480ed8d3c135271cd627096ae76fa5fc
configure-commands:
- mkdir o
- |
  export STAGE2_SYSROOT="$(dirname $(pwd))"
  export CC="$TARGET_STAGE1-gcc --sysroot=$STAGE2_SYSROOT"
  export LDFLAGS="-Wl,--sysroot=$STAGE2_SYSROOT"
  cd o && ../configure \
    $(../morph-arch-config) \
    `# [1]` --build=$(sh ../config.guess) \
            --host=$TARGET_STAGE1 \
            --target=$TARGET_STAGE1 \
    --prefix="$PREFIX" \
    `# [2]` --with-local-prefix=$PREFIX \
    `# [3]` --with-build-sysroot="$STAGE2_SYSROOT" \
    --disable-bootstrap \
    --enable-clocale=gnu --enable-shared --enable-threads=posix \
    `# [4]` --enable-languages=c \
    `# [5]` --libdir=$PREFIX/lib \
            --disable-libgomp --disable-multilib --disable-nls \
            --without-cloog --without-ppl \
            --with-mpfr-include="$(pwd)/../mpfr/src" \
            --with-mpfr-lib="$(pwd)/mpfr/src/.libs"
build-commands:
- |
  export STAGE2_SYSROOT="$(dirname $(pwd))"
  cd o && make
install-commands:
- cd o && make DESTDIR="$DESTDIR" install
- |
  if [ "$(echo $TARGET | cut -c -6)" = "x86_64" ]; then
    libdir=lib64
  else
    libdir=lib
  fi

  install -d "$DESTDIR/lib"
  ln -s "$PREFIX/$libdir/libgcc_s.so" "$DESTDIR/lib/"
  ln -s "$PREFIX/$libdir/libgcc_s.so.1" "$DESTDIR/lib/"