From f501976babcc283c7d2ae4bea25e5feefc4b98c2 Mon Sep 17 00:00:00 2001
From: Tristan Van Berkom <tristan.vanberkom@codethink.co.uk>
Date: Wed, 22 Mar 2017 09:47:09 +0000
Subject: Moved all elements under the elements directory

---
 elements/gnu-toolchain/glibc.bst | 77 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 elements/gnu-toolchain/glibc.bst

(limited to 'elements/gnu-toolchain/glibc.bst')

diff --git a/elements/gnu-toolchain/glibc.bst b/elements/gnu-toolchain/glibc.bst
new file mode 100644
index 00000000..8621074e
--- /dev/null
+++ b/elements/gnu-toolchain/glibc.bst
@@ -0,0 +1,77 @@
+kind: manual
+
+sources:
+- kind: git
+  url: upstream:glibc
+  track: release/2.22/master
+  ref: b995d95a5943785be3ab862b2d3276f3b4a22481
+
+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"
-- 
cgit v1.2.1

