summaryrefslogtreecommitdiff
path: root/strata/build-essential/stage2-glibc.morph
blob: 9ca0d4c1219e6c4819444b75d366494fd9f30ae3 (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
name: stage2-glibc
kind: chunk
configure-commands:
- mkdir o
- |
  case "$MORPH_ARCH" in
      armv7*)
          ARCH_FLAGS="--without-fp" ;;
  esac

  export CFLAGS="-O2 $CFLAGS"; export CXX=false; \
  cd o && ../configure \
    $ARCH_FLAGS \
    --build=$(../scripts/config.guess) --host=$TARGET_STAGE1 \
    --prefix="$PREFIX" \
    `# [1]` --libdir="$PREFIX/lib" \
    `# [2]` --with-headers="$(pwd)/../../$PREFIX/include" \
    `# [3]` --disable-profile  --enable-kernel=2.6.25 \
    `# [4]` libc_cv_c_cleanup=yes libc_cv_ctors_header=yes \
            libc_cv_forced_unwind=yes libc_cv_ssp=no
build-commands:
- cd o && make localtime=UTC
install-commands:
- cd o && make install_root="$DESTDIR" localtime=UTC install
- mkdir -p "$DESTDIR/etc"
- |
  cat <<EOF > ld.so.conf
  /lib
  /usr/lib
  /usr/local/lib
  include /etc/ld.so.conf.d/*.conf
  EOF
- install -m 644 -o root -g root ld.so.conf "$DESTDIR/etc/ld.so.conf"
- sh stage2-glibc-fix-specs
- install -d $DESTDIR/lib
- |
  cpu=$(echo $TARGET | cut -d '-' -f 1)
  case "$cpu" in
  x86_64)
    install -d "$DESTDIR/lib64"
    ln -s "$PREFIX/lib/ld-linux-x86-64.so.2" \
          "$DESTDIR/lib64/ld-linux-x86-64.so.2" ;;
  ppc64)
    install -d "$DESTDIR/lib64"
    ln -s "$PREFIX/lib/ld64.so.1" \
          "$DESTDIR/lib64/ld64.so.1" ;;
  *)
    loader=$(basename $(ls "$DESTDIR$PREFIX"/lib/ld-linux*))
    ln -s "$PREFIX/lib/$loader" "$DESTDIR/lib/$loader"
  esac