summaryrefslogtreecommitdiff
path: root/build-essential/stage2-libstdcxx.bst
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-02-01 20:37:29 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-02-03 19:48:45 +0900
commitd85382e41efbe3f3f9012a08851f93bb4919de65 (patch)
treebdcdac1cd8463f6847b2b30a6b643e715144372d /build-essential/stage2-libstdcxx.bst
parent7d6dc7242598361009ab492db2367e545fc53189 (diff)
downloaddefinitions-d85382e41efbe3f3f9012a08851f93bb4919de65.tar.gz
Manual conversion of Baserock's build-essential stratum
This huge commit is a manual conversion, notes on what was needed: o project.conf defines the arch specific stuff which was previously hardcoded into YBD, so the stage1 target and target etc are all defined by the build-essential project.conf o Direct and easy changes for git source representation o Added stage1.bst & stage2.bst "stacks", everything built in stage2 build-depends on stage1.bst, and the final build-essential products build-depend on stage2.bst (note build-depend means to depend _only_ for building, not propagated forward). o Instead of using host tools we build on the GNOME flatpak sdk/platform bundles o Some build-essential morph files use $(dirname $(pwd)) for a sysroot, which is weird, it means the morph files rely on building at one directory below the slash sysroot - in buildstream we build in /buildstream/build which is two - had to replace these with $(dirname $(dirname $(pwd))) instead o Remove the devices sections from the fhs-dirs elements, not allowed to create static device nodes in buildstream.
Diffstat (limited to 'build-essential/stage2-libstdcxx.bst')
-rw-r--r--build-essential/stage2-libstdcxx.bst55
1 files changed, 55 insertions, 0 deletions
diff --git a/build-essential/stage2-libstdcxx.bst b/build-essential/stage2-libstdcxx.bst
new file mode 100644
index 00000000..f8a75a23
--- /dev/null
+++ b/build-essential/stage2-libstdcxx.bst
@@ -0,0 +1,55 @@
+kind: manual
+
+sources:
+- kind: git
+ url: upstream:gcc-tarball
+ track: baserock/build-essential
+ ref: b3c9b176c1f10ebeff5700eb3760e9511f23fa06
+
+depends:
+- filename: build-essential/stage1.bst
+ type: build
+- build-essential/stage2-linux-api-headers.bst
+- build-essential/stage2-glibc.bst
+
+variables:
+ prefix: /tools
+
+environment:
+ PATH: /tools/bin:/usr/bin:/bin:/usr/sbin:/sbin
+
+config:
+ configure-commands:
+ - mkdir o
+
+ # Configure flag notes:
+ # 1. The thread C++ library cannot be built, as the thread C library
+ # was not build in stage1-gcc.
+ # 2. Prevents the installation of precompiled include files, which are
+ # not needed at this stage.
+ # 3. From LFS: the header location of C++ needs to be explicitly given
+ # as we are running the configure script from the top-level
+ # directory.
+ - |
+ export STAGE2_SYSROOT="$(dirname $(dirname $(pwd)))"
+ # -fPIC must be given, otherwise it will not be possible to create
+ # shared libraries linked to libstdc++
+ export CPPFLAGS="--sysroot=$STAGE2_SYSROOT -fPIC"
+ export LDFLAGS="--sysroot=$STAGE2_SYSROOT"
+ cd o && ../libstdc++-v3/configure \
+ --build=$(sh ../config.guess) \
+ --host="%{target-stage1}" \
+ --target="%{target-stage1}" \
+ --prefix="%{prefix}" \
+ --disable-nls \
+ --disable-shared \
+ --disable-multilib \
+ `# [1]` --disable-libstdcxx-threads \
+ `# [2]` --disable-libstdcxx-pch \
+ `# [3]` --with-gxx-include-dir=/tools/%{target-stage1}/include/c++/4.9.2
+
+ build-commands:
+ - cd o && make
+
+ install-commands:
+ - cd o && make DESTDIR="%{install-root}" install