summaryrefslogtreecommitdiff
path: root/elements/gnu-toolchain/glibc.bst
blob: 41eb5b71c741234d068909e61fb8eab0d51f9556 (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
66
67
68
69
70
71
72
73
74
75
76
77
kind: manual

sources:
- kind: git
  url: upstream:glibc
  track: release/2.25/master
  ref: db0242e3023436757bbc7c488a779e6e3343db04

depends:
- filename: gnu-toolchain/stage2.bst
  type: build
- gnu-toolchain/fhs-dirs.bst
- gnu-toolchain/linux-api-headers.bst

environment:
  PATH: /usr/bin:/bin:/usr/sbin:/sbin:/tools/bin:/tools/sbin

config:

  configure-commands:
  - mkdir o

  - |
    case "%{bst-arch}" in
        armv7*)
            ARCH_FLAGS="--without-fp" ;;
    esac

    # We override the PATH here to remove /tools/bin from it.
    # Thanks to this glibc finds bash in /bin/bash through the /bin
    # symlink. This is important because glibc changes the path to bash
    # of the shebang in some scripts and these scripts will be broken if
    # they point to bash in /tools/bin/bash.
    export PATH="/usr/bin:/sbin:/bin";
    export CFLAGS="-O2 $CFLAGS";
    cd o && ../configure \
      $ARCH_FLAGS \
      --prefix="%{prefix}" \
      --disable-profile \
      --enable-kernel=3.0.0 \
      --without-cvs \
      --without-selinux \
      --enable-obsolete-rpc

  build-commands:
  - cd o && make localtime=UTC

  install-commands:
  - cd o && make install_root="%{install-root}" localtime=UTC install
  - cd o && make install_root="%{install-root}" localtime=UTC localedata/install-locales
  - mkdir -p "%{install-root}/etc"
  - mkdir -p "%{install-root}/etc/ld.so.conf.d"
  - |
    cat <<EOF > nsswitch.conf
    passwd: compat
    group: compat
    shadow: compat

    hosts: files myhostname mdns4_minimal [NOTFOUND=return] dns mdns4
    networks: files

    protocols: db files
    services: db files
    ethers: db files
    rpc: db files

    netgroup: nis
    EOF
  - install -m 644 -o root -g root nsswitch.conf "%{install-root}/etc/nsswitch.conf"
  - |
    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 "%{install-root}/etc/ld.so.conf"