summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-10-20 16:07:58 +0200
committerOliver Reiche <oliver.reiche@huawei.com>2023-10-20 16:07:58 +0200
commit060a0cf338d6024eee37cc344c224fe3bcb78e81 (patch)
tree3fea7c654b69ecf3490fe9c6cbc542aba0d5bd8f /src/tools
downloadbootstrappable-toolchain-060a0cf338d6024eee37cc344c224fe3bcb78e81.tar.gz
Initial commit
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/busybox-1.36.TARGETS21
-rw-r--r--src/tools/cmake-3.27.TARGETS43
-rw-r--r--src/tools/make-4.4.TARGETS20
-rw-r--r--src/tools/python-3.12.TARGETS36
4 files changed, 120 insertions, 0 deletions
diff --git a/src/tools/busybox-1.36.TARGETS b/src/tools/busybox-1.36.TARGETS
new file mode 100644
index 0000000..ab5d90b
--- /dev/null
+++ b/src/tools/busybox-1.36.TARGETS
@@ -0,0 +1,21 @@
+{ "toolchain":
+ { "type": "export"
+ , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"]
+ , "target": "busybox"
+ }
+, "busybox":
+ { "type": ["@", "rules", "CC/foreign/shell", "data"]
+ , "project": [["TREE", null, "."]]
+ , "cmds":
+ [ "NJOBS=$(nproc --all 2>/dev/null || echo 1)"
+ , "GCC_TOOLCHAIN=$(dirname ${CC})/.."
+ , "unset CFLAGS CXXFLAGS"
+ , "export LDFLAGS=\"-static\""
+ , "export SOURCE_DATE_EPOCH=0"
+ , "${MAKE} HOSTCC=\"${CC} -static\" HOSTCXX=\"${CXX} -static\" defconfig >configure.log 2>&1 || (cat configure.log && exit 1)"
+ , "${MAKE} -j${NJOBS} HOSTCC=\"${CC} -static\" HOSTCXX=\"${CXX} -static\" >build.log 2>&1 || (cat configure.log build.log && exit 1)"
+ , "${MAKE} -j${NJOBS} HOSTCC=\"${CC} -static\" HOSTCXX=\"${CXX} -static\" CONFIG_PREFIX=${DESTDIR} install >>build.log 2>&1 || (cat configure.log build.log && exit 1)"
+ ]
+ , "out_dirs": ["."]
+ }
+}
diff --git a/src/tools/cmake-3.27.TARGETS b/src/tools/cmake-3.27.TARGETS
new file mode 100644
index 0000000..69ef77a
--- /dev/null
+++ b/src/tools/cmake-3.27.TARGETS
@@ -0,0 +1,43 @@
+{ "toolchain":
+ { "type": "export"
+ , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"]
+ , "target": "cmake"
+ }
+, "patched_sources":
+ { "type": ["@", "rules", "CC/foreign/shell", "data"]
+ , "project": [["TREE", null, "."]]
+ , "cmds":
+ [ "cp -r . ${DESTDIR}/."
+ , "cd ${DESTDIR}"
+ , "mv Utilities/cmcurl/curltest.c Utilities/cmcurl/curltest.cpp"
+ , "sed -i 's/curltest\\.c)/curltest\\.cpp)/' Utilities/cmcurl/CMakeLists.txt"
+ ]
+ , "out_dirs": ["."]
+ }
+, "libssl":
+ { "type": "configure"
+ , "config":
+ { "type": "let*"
+ , "bindings": [["ADD_CFLAGS", ["-fPIE"]], ["ADD_CXXFLAGS", ["-fPIE"]]]
+ , "body": {"type": "env", "vars": ["ADD_CFLAGS", "ADD_CXXFLAGS"]}
+ }
+ , "target": ["@", "ssl", "", "ssl"]
+ }
+, "cmake":
+ { "type": ["@", "rules", "CC/foreign/shell", "data"]
+ , "project": ["patched_sources"]
+ , "deps": ["libssl"]
+ , "cmds":
+ [ "export NJOBS=$(nproc --all 2>/dev/null || echo 1)"
+ , "export PKG_CONFIG=false"
+ , "mkdir ${TMPDIR}/build"
+ , "cd ${TMPDIR}/build"
+ , "export LDFLAGS='-static'"
+ , "export CFLAGS='-D__FILE__=__FILE_NAME__ -Wno-builtin-macro-redefined'"
+ , "export CXXFLAGS='-D__FILE__=__FILE_NAME__ -Wno-builtin-macro-redefined'"
+ , "${WORKDIR}/bootstrap --parallel=${NJOBS} -- -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${LOCALBASE} -DCMAKE_INSTALL_PREFIX=/ >bootstrap.log 2>&1 || (cat bootstrap.log && exit 1)"
+ , "${MAKE} -j${NJOBS} install >build.log 2>&1 || (cat bootstrap.log && cat build.log && exit 1)"
+ ]
+ , "out_dirs": ["."]
+ }
+}
diff --git a/src/tools/make-4.4.TARGETS b/src/tools/make-4.4.TARGETS
new file mode 100644
index 0000000..e35fb08
--- /dev/null
+++ b/src/tools/make-4.4.TARGETS
@@ -0,0 +1,20 @@
+{ "toolchain":
+ { "type": "export"
+ , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"]
+ , "target": "make"
+ }
+, "make":
+ { "type": ["@", "rules", "CC/foreign/shell", "data"]
+ , "project": [["TREE", null, "."]]
+ , "cmds":
+ [ "export NJOBS=$(nproc --all 2>/dev/null || echo 1)"
+ , "unset CFLAGS"
+ , "export CXX=unused"
+ , "export LDFLAGS='-static'"
+ , "./configure --prefix=/ --disable-rpath --disable-load >configure.log 2>&1 || (cat configure.log && exit 1)"
+ , "${MAKE} -j${NJOBS} MAKEINFO=missing >build.log 2>&1 || (cat configure.log build.log && exit 1)"
+ , "${MAKE} -j${NJOBS} MAKEINFO=missing DESTDIR=${DESTDIR} install-strip >>build.log 2>&1 || (cat configure.log build.log && exit 1)"
+ ]
+ , "outs": ["bin/make"]
+ }
+}
diff --git a/src/tools/python-3.12.TARGETS b/src/tools/python-3.12.TARGETS
new file mode 100644
index 0000000..625bac4
--- /dev/null
+++ b/src/tools/python-3.12.TARGETS
@@ -0,0 +1,36 @@
+{ "toolchain":
+ { "type": "export"
+ , "flexible_config": ["ARCH", "TARGET_ARCH", "TOOLCHAIN_CONFIG", "ENV"]
+ , "target": "python"
+ }
+, "python":
+ { "type": ["@", "rules", "CC/foreign/shell", "data"]
+ , "project": [["TREE", null, "."]]
+ , "localbase": [["@", "zlib", "", "zlib"]]
+ , "cmds":
+ [ "export NJOBS=$(nproc --all 2>/dev/null || echo 1)"
+ , "export CFLAGS=\"-I${LOCALBASE}/include\""
+ , "export LDFLAGS=\"-static -L${LOCALBASE}/lib\""
+ , "export SOURCE_DATE_EPOCH=0"
+ , "./configure --disable-shared --disable-test-modules --prefix=/usr --with-pkg-config=no >configure.log 2>&1 || (cat configure.log && exit 1)"
+ , "rm Modules/Setup.local"
+ , "cp Modules/Setup.stdlib Modules/Setup.local"
+ , "sed -i 's/^\\*shared\\*/\\*static\\*/' Modules/Setup.local"
+ , "sed -i 's/^nis /#nis /' Modules/Setup.local"
+ , "sed -i 's/^_lzma /#_lzma /' Modules/Setup.local"
+ , "sed -i 's/^_uuid /#_uuid /' Modules/Setup.local"
+ , "${MAKE} -j${NJOBS} LINKFORSHARED=' ' >build.log 2>&1 || (cat configure.log build.log && exit 1)"
+ , "${MAKE} -j${NJOBS} LINKFORSHARED=' ' install >>build.log 2>&1 || (cat configure.log build.log && exit 1)"
+ , "cd ${DESTDIR}/usr"
+ , "find ./bin -type f -exec sh -c \"strip {} 2>/dev/null\" \\;"
+ , "find ./lib -type f -name '*.a' -exec strip -g {} \\;"
+ , "find ./lib -type f -name '*.o' -exec strip -g {} \\;"
+ , "find ./lib -depth -type d -name '__pycache__' -exec rm -rf {} \\;"
+ , "find ./bin -type f -name '*-config' -exec sh -c \"sed -i 's|${ACTION_DIR}|/build|g' {}\" \\;"
+ , "find ./lib -type f -name 'Makefile' -exec sh -c \"sed -i 's|${ACTION_DIR}|/build|g' {}\" \\;"
+ , "find ./lib -type f -name '_sysconfigdata_*' -exec sh -c \"sed -i 's|${ACTION_DIR}|/build|g' {}\" \\;"
+ , "cp -l bin/python3 bin/python"
+ ]
+ , "out_dirs": ["."]
+ }
+}