Browse Source

update sysroot builds and toolchains

* add 'libcurl' to sysroots
* include 'filesystem' to boost
* upgrade boost to 1.80.0 (as it is cheap)
* make clang version parametrized for toolchains
alexey 3 years ago
parent
commit
723494bb07
38 changed files with 277 additions and 196 deletions
  1. 5 1
      dist/build_dockers/cross/freebsd.cmake
  2. 5 1
      dist/build_dockers/cross/linux.cmake
  3. 5 1
      dist/build_dockers/cross/osx.cmake
  4. 7 0
      dist/build_dockers/cross/sysroots/boost_library.sh
  5. 33 63
      dist/build_dockers/cross/sysroots/boost_macos__.tar.xz.md
  6. 5 1
      dist/build_dockers/cross/sysroots/boost_windows_x64.tar.xz.md
  7. 6 10
      dist/build_dockers/cross/sysroots/build_alma9.sh
  8. 6 2
      dist/build_dockers/cross/sysroots/build_bionic.sh
  9. 8 0
      dist/build_dockers/cross/sysroots/build_bookworm.sh
  10. 5 1
      dist/build_dockers/cross/sysroots/build_bullseye.sh
  11. 5 1
      dist/build_dockers/cross/sysroots/build_buster.sh
  12. 5 9
      dist/build_dockers/cross/sysroots/build_centos7.sh
  13. 5 9
      dist/build_dockers/cross/sysroots/build_centos8.sh
  14. 6 2
      dist/build_dockers/cross/sysroots/build_focal.sh
  15. 6 2
      dist/build_dockers/cross/sysroots/build_jammy.sh
  16. 4 12
      dist/build_dockers/cross/sysroots/debian.sh
  17. 14 0
      dist/build_dockers/cross/sysroots/finalize.sh
  18. 16 3
      dist/build_dockers/cross/sysroots/in_debian.sh
  19. 3 10
      dist/build_dockers/cross/sysroots/in_rhel7.sh
  20. 4 11
      dist/build_dockers/cross/sysroots/in_rhel8.sh
  21. 3 9
      dist/build_dockers/cross/sysroots/in_rhel9.sh
  22. 0 18
      dist/build_dockers/cross/sysroots/in_ubuntu.sh
  23. 11 4
      dist/build_dockers/cross/sysroots/mkboost.sh
  24. 3 0
      dist/build_dockers/cross/sysroots/mksysroot.sh
  25. 4 1
      dist/build_dockers/cross/sysroots/mksysrootrhel.sh
  26. 12 0
      dist/build_dockers/cross/sysroots/packages_bionic.txt
  27. 5 1
      dist/build_dockers/cross/sysroots/packages_bookworm.txt
  28. 12 0
      dist/build_dockers/cross/sysroots/packages_bullseye.txt
  29. 5 1
      dist/build_dockers/cross/sysroots/packages_buster.txt
  30. 5 1
      dist/build_dockers/cross/sysroots/packages_focal.txt
  31. 12 0
      dist/build_dockers/cross/sysroots/packages_jammy.txt
  32. 12 0
      dist/build_dockers/cross/sysroots/packages_rhel7.txt
  33. 12 0
      dist/build_dockers/cross/sysroots/packages_rhel8.txt
  34. 11 0
      dist/build_dockers/cross/sysroots/packages_rhel9.txt
  35. 9 0
      dist/build_dockers/cross/sysroots/redhat.sh
  36. 0 16
      dist/build_dockers/cross/sysroots/ubuntu.sh
  37. 4 3
      dist/build_dockers/cross/windows-cl.cmake
  38. 4 3
      dist/build_dockers/cross/windows.cmake

+ 5 - 1
dist/build_dockers/cross/freebsd.cmake

@@ -1,7 +1,11 @@
 # Freebsd-13 toolchain
 
 set ( arch $ENV{arch} )
-set ( LLVM /usr/lib/llvm-13 )
+if ($ENV{llvm})
+	set ( LLVM /usr/lib/llvm-$ENV{llvm} )
+else ()
+	set ( LLVM /usr/lib/llvm-13 )
+endif ()
 
 set ( CMAKE_SYSTEM_NAME "FreeBSD" )
 set ( CMAKE_SYSTEM_PROCESSOR "${arch}" )

+ 5 - 1
dist/build_dockers/cross/linux.cmake

@@ -1,7 +1,11 @@
 # Generic (linux) toolchain
 
 set ( arch $ENV{arch} )
-set ( LLVM /usr/lib/llvm-13 )
+if ($ENV{llvm})
+	set ( LLVM /usr/lib/llvm-$ENV{llvm} )
+else ()
+	set ( LLVM /usr/lib/llvm-13 )
+endif ()
 
 set ( CMAKE_SYSTEM_NAME Linux )
 set ( CMAKE_SYSTEM_PROCESSOR ${arch} )

+ 5 - 1
dist/build_dockers/cross/osx.cmake

@@ -6,7 +6,11 @@ set ( root /sysroot/root )
 set ( ssldir /opt/openssl )
 
 set ( arch $ENV{arch} )
-set ( LLVM /usr/lib/llvm-13 )
+if ($ENV{llvm})
+	set ( LLVM /usr/lib/llvm-$ENV{llvm} )
+else ()
+	set ( LLVM /usr/lib/llvm-13 )
+endif ()
 
 set ( CMAKE_SYSTEM_NAME "Darwin" )
 set ( CMAKE_SYSTEM_PROCESSOR "${arch}" )

+ 7 - 0
dist/build_dockers/cross/sysroots/boost_library.sh

@@ -0,0 +1,7 @@
+# this file included from mkboost.sh
+
+# which boost is to use. 1_80_0 will use file boost_1_80_0.tar.gz
+boostver=1_80_0
+
+# which libraries to build. Line passed directly bo './b2 install'
+boostlibs="--with-context --with-system --with-fiber --with-program_options --with-stacktrace --with-filesystem"

+ 33 - 63
dist/build_dockers/cross/sysroots/boost_macos__.tar.xz.md

@@ -2,8 +2,7 @@
 
 This file will be named `boost_macos_x86_64.tar.xz`, and `boost_macos_arm64.tar.xz`, however it includes all need subset of homebrew, not just only Boost. That is because such naming scheme is used by build docker's entry point.
 
-First, make full copy of homebrew (that is located in `/opt/homebrew` folder on arm (M1), or in `/usr/local` on intel
-systems)
+First, make full copy of homebrew (that is located in `/opt/homebrew` folder on arm (M1), or in `/usr/local` on intel systems).
 
 Go to `Cellar` folder, and cleanup it from non-necessary packages.
 You need:
@@ -15,81 +14,52 @@ You need:
 * unixodbc
 * zstd
 
-You can go deeper and cleanup boost libraries. Leave `context`, `coroutine`, `fiber`, `program_options`, `stacktrace` and `system`; also `headers` (it doesn't has binary lib, but `boost_headers-*` in `lib/cmake` folder is necessary).
-Also, remove folder `Cellar/boost/1.78.0_1/include`, and replace it with symlink to `../../../../cache/common/boost/include`.
+In each package we need only `lib` and `include` subfolders, all the rest (like `bin`, `share`, and free files) we can safety drop.
+
+You can go deeper and cleanup boost libraries. Leave `context`, `coroutine`, `fiber`, `filesystem`, `program_options`, `stacktrace` and `system`; also `headers` (it doesn't have binary lib, but `boost_headers-*` in `lib/cmake` folder is necessary). You can drop all lib/*.dylib, as we use only statically linked boost libraries.
 
 Just keep folders with these names (or, starting with these names). Openssl could be `[email protected]`, or `openssl@3` - first
 one is dependency for mysql-client, second one is standalone. It has sense to keep [email protected] to avoid duplicates of
 the same lib with two different versions.
 
 The walk thorough 'include', 'lib', and 'opt' folders; cleanup all dead symlinks (as you remove folders from Cellar -
-references from these folders will became dead). Finally inspect content of `Cellar`; you may remove `bin` and `share` folders in the packages; we need only `lib`, and `include`. 
+references from these folders will became dead).
+
+Finally, go to folder `Cellar/boost/1.80.0/` and replace `include`, with symlink to `../../../../cache/common/boost/include`.
+
+Below is the example how final folder tree may look. Notice, that is not necessary actual tree, but just provides you the idea how it should look.
 
 ```
 .
 ├── Cellar
 │   ├── boost
-│   │   └── 1.78.0_1
+│   │   └── 1.80.0
 │   │       ├── include -> ../../../../cache/common/boost/include
-│   │       ├── INSTALL_RECEIPT.json
-│   │       ├── lib
-│   │       └── README.md
+│   │       └── lib
 │   ├── mysql-client
 │   │   └── 8.0.28
 │   │       ├── include
-│   │       ├── INSTALL_RECEIPT.json
-│   │       ├── lib
-│   │       ├── LICENSE
-│   │       └── README
+│   │       └── lib
 │   ├── [email protected]
 │   │   └── 1.1.1n
-│   │       ├── AUTHORS
-│   │       ├── CHANGES
 │   │       ├── include
-│   │       ├── INSTALL_RECEIPT.json
-│   │       ├── lib
-│   │       ├── LICENSE
-│   │       ├── NEWS
-│   │       └── README
+│   │       └── lib
 │   ├── openssl@3
 │   │   └── 3.0.2
-│   │       ├── AUTHORS.md
-│   │       ├── CHANGES.md
 │   │       ├── include
-│   │       ├── INSTALL_RECEIPT.json
-│   │       ├── lib
-│   │       ├── LICENSE.txt
-│   │       ├── NEWS.md
-│   │       └── README.md
+│   │       └── lib
 │   ├── postgresql
 │   │   └── 14.2_1
-│   │       ├── COPYRIGHT
-│   │       ├── HISTORY
-│   │       ├── homebrew.mxcl.postgresql.plist
-│   │       ├── homebrew.postgresql.service
 │   │       ├── include
-│   │       ├── INSTALL_RECEIPT.json
-│   │       ├── lib
-│   │       └── README
+│   │       └── lib
 │   ├── unixodbc
 │   │   └── 2.3.9_1
-│   │       ├── AUTHORS
-│   │       ├── ChangeLog
-│   │       ├── COPYING
 │   │       ├── include
-│   │       ├── INSTALL_RECEIPT.json
-│   │       ├── lib
-│   │       ├── NEWS
-│   │       └── README
+│   │       └── lib
 │   └── zstd
 │       └── 1.5.2
-│           ├── CHANGELOG
-│           ├── COPYING
 │           ├── include
-│           ├── INSTALL_RECEIPT.json
-│           ├── lib
-│           ├── LICENSE
-│           └── README.md
+│           └── lib
 ├── include
 │   ├── autotest.h -> ../Cellar/unixodbc/2.3.9_1/include/autotest.h
 │   ├── boost -> ../Cellar/boost/1.78.0_1/include/boost
@@ -102,27 +72,27 @@ references from these folders will became dead). Finally inspect content of `Cel
 │   └── zstd.h -> ../Cellar/zstd/1.5.2/include/zstd.h
 ├── lib
 │   ├── cmake
-│   │   ├── Boost-1.78.0
-│   │   ├── boost_context-1.78.0
-│   │   ├── boost_coroutine-1.78.0
-│   │   ├── BoostDetectToolset-1.78.0.cmake -> ../../Cellar/boost/1.78.0_1/lib/cmake/BoostDetectToolset-1.78.0.cmake
-│   │   ├── boost_fiber-1.78.0
-│   │   ├── boost_headers-1.78.0
-│   │   ├── boost_program_options-1.78.0
-│   │   ├── boost_stacktrace_addr2line-1.78.0
-│   │   ├── boost_stacktrace_basic-1.78.0
-│   │   ├── boost_stacktrace_noop-1.78.0
-│   │   ├── boost_system-1.78.0
+│   │   ├── Boost-1.80.0
+│   │   ├── boost_context-1.80.0
+│   │   ├── boost_coroutine-1.80.0
+│   │   ├── BoostDetectToolset-1.80.0.cmake -> ../../Cellar/boost/1.80.0/lib/cmake/BoostDetectToolset-1.80.0.cmake
+│   │   ├── boost_fiber-1.80.0
+│   │   ├── boost_headers-1.80.0
+│   │   ├── boost_program_options-1.80.0
+│   │   ├── boost_stacktrace_addr2line-1.80.0
+│   │   ├── boost_stacktrace_basic-1.80.0
+│   │   ├── boost_stacktrace_noop-1.80.0
+│   │   ├── boost_system-1.80.0
 │   │   └── zstd -> ../../Cellar/zstd/1.5.2/lib/cmake/zstd
-│   ├── libboost_context-mt.a -> ../Cellar/boost/1.78.0_1/lib/libboost_context-mt.a
-│   ├── libboost_context-mt.dylib -> ../Cellar/boost/1.78.0_1/lib/libboost_context-mt.dylib
+│   ├── libboost_context-mt.a -> ../Cellar/boost/1.80.0/lib/libboost_context-mt.a
+│   ├── libboost_context-mt.dylib -> ../Cellar/boost/1.80.0/lib/libboost_context-mt.dylib
 ...
 │   ├── libzstd.dylib -> ../Cellar/zstd/1.5.2/lib/libzstd.dylib
 │   ├── pkgconfig
 │   └── postgresql -> ../Cellar/postgresql/14.2_1/lib/postgresql
 └── opt
-    ├── boost -> ../Cellar/boost/1.78.0_1
-    ├── [email protected] -> ../Cellar/boost/1.78.0_1
+    ├── boost -> ../Cellar/boost/1.80.0
+    ├── [email protected] -> ../Cellar/boost/1.80.0
     ├── mysql-client -> ../Cellar/mysql-client/8.0.28
     ├── [email protected] -> ../Cellar/mysql-client/8.0.28
     ├── openssl -> ../Cellar/openssl@3/3.0.2
@@ -144,5 +114,5 @@ tar -cf - Cellar include lib opt | xz -9 -f > boost_macos_ARCH.tar.xz
 ```
 ( where `ARCH` is `arm64` on M1 machine, or `x86_64` on intel. )
 
-Both archives (`boost_macos_x86_64.tar.xz`, and `boost_macos_arm64.tar.xz`) are results. They occupy about 11M each.
+Both archives (`boost_macos_x86_64.tar.xz`, and `boost_macos_arm64.tar.xz`) are results. They occupy about 9M each.
 They're stored in `/work/cross/sysroots` folder on our dev server, and also available online to build docker from `https://repo.manticoresearch.com/repository/sysroots/boost_178/`.

+ 5 - 1
dist/build_dockers/cross/sysroots/boost_windows_x64.tar.xz.md

@@ -4,7 +4,9 @@ Boost for windows is official download from `boost.org`.
 
 OpenSSL is taken from `https://slproweb.com/download/Win64OpenSSL-1_1_1k.msi`
 
-Both packed int `boost` archive with following structure:
+LibCURL is taken from official `https://curl.se/windows/dl-7.85.0_9/curl-7.85.0_9-win64-mingw.zip`
+
+Both packed into `boost` archive with following structure:
 
 ```
 .
@@ -22,6 +24,8 @@ Both packed int `boost` archive with following structure:
 
 Notice, boost headers are removed and replaced with symlink. You should do it to avoid duplicates (target of that symlink came from `boost_include.tar.xz`). Also, you can clean-up boost from unnecessary libraries; follow the same recommendations as for `boost_macos...`.
 
+Notice, that illustration is just example; In actual tree version of the boost/openssl/libcurl might be different, just keep boost version consistent across all archives which share boost includes.
+
 Pack the content into archive
 ```bash
 tar -cf - diskc | xz -9 -f > boost_windows_x64.tar.xz

+ 6 - 10
dist/build_dockers/cross/sysroots/build_alma9.sh

@@ -1,12 +1,8 @@
 #!/bin/bash
-set -e
-arch=$(uname -m)
-mkdir "$arch"
-docker run --rm -v "$PWD:/sysroot" almalinux:9.0 bash /sysroot/in_alma9.sh
 
-cd "$arch"
-echo "pack archives"
-for a in *.tar; do
-  echo "pack $a..."
-  zstd "$a" && rm -f "$_";
-done
+# this is root script which should be run to do everything
+# build for centos/redhat 9 (alma)
+
+distr=rhel9
+image=almalinux:9.0
+. redhat.sh

+ 6 - 2
dist/build_dockers/cross/sysroots/build_bionic.sh

@@ -1,4 +1,8 @@
 #!/bin/bash
 
-export distr=bionic
-. ubuntu.sh
+# this is root script which should be run to do everything
+# build for ubuntu bionic (18.04 LTS)
+
+distr=bionic
+image=ubuntu:$distr
+. debian.sh

+ 8 - 0
dist/build_dockers/cross/sysroots/build_bookworm.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+# this is root script which should be run to do everything
+# build for debian bookworm (12), released ????
+
+distr=bookworm
+image=debian:$distr
+. debian.sh

+ 5 - 1
dist/build_dockers/cross/sysroots/build_bullseye.sh

@@ -1,4 +1,8 @@
 #!/bin/bash
 
-export distr=bullseye
+# this is root script which should be run to do everything
+# build for debian bullseye (11), released 2021
+
+distr=bullseye
+image=debian:$distr
 . debian.sh

+ 5 - 1
dist/build_dockers/cross/sysroots/build_buster.sh

@@ -1,4 +1,8 @@
 #!/bin/bash
 
-export distr=buster
+# this is root script which should be run to do everything
+# build for debian buster (10), released 2019
+
+distr=buster
+image=debian:$distr
 . debian.sh

+ 5 - 9
dist/build_dockers/cross/sysroots/build_centos7.sh

@@ -1,12 +1,8 @@
 #!/bin/bash
 
-arch=$(uname -m)
-mkdir $arch
-docker run --rm -v $(pwd):/sysroot centos:7 bash /sysroot/in_centos7.sh
+# this is root script which should be run to do everything
+# build for centos/redhat 7
 
-cd $arch
-echo "pack archives"
-for a in *.tar; do
-  echo "pack $a..."
-  zstd $a && rm -f $a;
-done
+image=centos:7
+distr=rhel7
+. redhat.sh

+ 5 - 9
dist/build_dockers/cross/sysroots/build_centos8.sh

@@ -1,12 +1,8 @@
 #!/bin/bash
 
-arch=$(uname -m)
-mkdir $arch
-docker run --rm -v $(pwd):/sysroot centos:8 bash /sysroot/in_centos8.sh
+# this is root script which should be run to do everything
+# build for centos/redhat 8
 
-cd $arch
-echo "pack archives"
-for a in *.tar; do
-  echo "pack $a..."
-  zstd $a && rm -f $a;
-done
+image=centos:8
+distr=rhel8
+. redhat.sh

+ 6 - 2
dist/build_dockers/cross/sysroots/build_focal.sh

@@ -1,4 +1,8 @@
 #!/bin/bash
 
-export distr=focal
-. ubuntu.sh
+# this is root script which should be run to do everything
+# build for ubuntu focal (20.04 LTS)
+
+distr=focal
+image=ubuntu:$distr
+. debian.sh

+ 6 - 2
dist/build_dockers/cross/sysroots/build_jammy.sh

@@ -1,4 +1,8 @@
 #!/bin/bash
 
-export distr=jammy
-. ubuntu.sh
+# this is root script which should be run to do everything
+# build for ubuntu jammy (22.04 LTS)
+
+distr=jammy
+image=ubuntu:$distr
+. debian.sh

+ 4 - 12
dist/build_dockers/cross/sysroots/debian.sh

@@ -1,16 +1,8 @@
-#!/bin/bash
-
-# distr should be set on inclusion of this file
+# file included from build_buster/bullseye/bookworm/focal/bionic/jammy
+# $distr and $image should be set on inclusion of this file
 
 arch=$(uname -m)
 mkdir $arch
-docker run --rm -v $(pwd):/sysroot debian:$distr bash /sysroot/in_debian.sh $distr
-
-cd $arch
-echo "pack archives"
-for a in *.tar; do
-  echo "pack $a..."
-  zstd $a && rm -f $a;
-done
-
+docker run --rm -v $(pwd):/sysroot $image bash /sysroot/in_debian.sh $distr
 
+. finalize.sh

+ 14 - 0
dist/build_dockers/cross/sysroots/finalize.sh

@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# file included from debian/ubuntu/redhat.sh, but also may be run as standalone.
+# nothing required to defined; file runs from host context
+# That is final step (m.b. not necessary in general)
+
+arch=$(uname -m)
+
+cd $arch
+echo "pack archives"
+for a in *.tar; do
+  echo "pack $a..."
+  zstd $a && rm -f $a;
+done

+ 16 - 3
dist/build_dockers/cross/sysroots/in_debian.sh

@@ -1,6 +1,19 @@
 #!/bin/bash
-# docker run --rm -v $(pwd):/sysroot ubuntu:xenial bash /sysroot/in_xenial.sh
-# docker run -it --rm -v $(pwd):/sysroot ubuntu:xenial bash
+# file runs in the docker, invoked by the command in script debian.sh
+# $distr should be passed as 1-st param
+
+# docker run --rm -v $(pwd):/sysroot debian:buster bash /sysroot/in_debian.sh buster
+# docker run -it --rm -v $(pwd):/sysroot debian:buster bash
+# docker run --rm -v $(pwd):/sysroot debian:bullseye bash /sysroot/in_debian.sh bullseye
+# docker run -it --rm -v $(pwd):/sysroot debian:bullseye bash
+# docker run --rm -v $(pwd):/sysroot debian:bookworm bash /sysroot/in_debian.sh bookworm
+# docker run -it --rm -v $(pwd):/sysroot debian:bookworm bash
+# docker run --rm -v $(pwd):/sysroot ubuntu:bionic bash /sysroot/in_debian.sh bionic
+# docker run -it --rm -v $(pwd):/sysroot ubuntu:bionic bash
+# docker run --rm -v $(pwd):/sysroot ubuntu:focal bash /sysroot/in_debian.sh focal
+# docker run -it --rm -v $(pwd):/sysroot ubuntu:focal bash
+# docker run --rm -v $(pwd):/sysroot ubuntu:jammy bash /sysroot/in_debian.sh jammy
+# docker run -it --rm -v $(pwd):/sysroot ubuntu:jammy bash
 
 export DEBIAN_FRONTEND=noninteractive
 arch=$(uname -m)
@@ -13,5 +26,5 @@ apt-get update && apt-get install -y \
  . /sysroot/mkboost.sh
 
 echo "install rest of dependencies"
-. /sysroot/$distr.apt
+. /sysroot/packages_$distr.txt
 . /sysroot/mksysroot.sh

+ 3 - 10
dist/build_dockers/cross/sysroots/in_centos7.sh → dist/build_dockers/cross/sysroots/in_rhel7.sh

@@ -1,10 +1,10 @@
 #!/bin/bash
-# docker run --rm -v $(pwd):/sysroot centos:7 bash /sysroot/in_centos.sh
+# file runs in the docker, invoked by the command in script redhat.sh
+# docker run --rm -v $(pwd):/sysroot centos:7 bash /sysroot/in_rhel7.sh
 # docker run -it --rm -v $(pwd):/sysroot centos:7 bash
 
 arch=$(uname -m)
 export arch
-#export distr=$1
 export distr=rhel7
 
 yum install -y centos-release-scl
@@ -16,13 +16,6 @@ export LD_LIBRARY_PATH="/opt/rh/devtoolset-8/root/usr/lib64/:$LD_LIBRARY_PATH"
 
 echo "install rest of dependencies"
 yum install -y epel-release
-yum install -y \
-        mysql-devel \
-        expat-devel \
-        postgresql-devel \
-        unixODBC-devel \
-        jemalloc-devel \
-        openssl-devel \
-        libzstd-devel
 
+. /sysroot/packages_$distr.txt
 . /sysroot/mksysrootrhel.sh

+ 4 - 11
dist/build_dockers/cross/sysroots/in_centos8.sh → dist/build_dockers/cross/sysroots/in_rhel8.sh

@@ -1,10 +1,10 @@
 #!/bin/bash
-# docker run --rm -v $(pwd):/sysroot centos:8 bash /sysroot/in_centos.sh
+# file runs in the docker, invoked by the command in script redhat.sh
+# docker run --rm -v $(pwd):/sysroot centos:8 bash /sysroot/in_rhel8.sh
 # docker run -it --rm -v $(pwd):/sysroot centos:8 bash
 
 arch=$(uname -m)
 export arch
-#export distr=$1
 export distr=rhel8
 
 # centos8 reached eol at 31.12.2021, repo was removed. So, need to patch to use vault instead of mirror.
@@ -16,17 +16,10 @@ yum install -y \
         gcc-c++ \
         which
 
-# . /sysroot/mkboost.sh
+ . /sysroot/mkboost.sh
 
 echo "install rest of dependencies"
 yum install -y epel-release
-yum install -y \
-        mariadb-connector-c-devel \
-        expat-devel \
-        postgresql-devel \
-        unixODBC-devel \
-        jemalloc-devel \
-        openssl-devel \
-        libzstd-devel
 
+. /sysroot/packages_$distr.txt
 . /sysroot/mksysrootrhel.sh

+ 3 - 9
dist/build_dockers/cross/sysroots/in_alma9.sh → dist/build_dockers/cross/sysroots/in_rhel9.sh

@@ -1,5 +1,6 @@
 #!/bin/bash
-# docker run --rm -v $(pwd):/sysroot almalinux:9 bash /sysroot/in_alma9.sh
+# file runs in the docker, invoked by the command in script redhat.sh
+# docker run --rm -v $(pwd):/sysroot almalinux:9 bash /sysroot/in_rhel9.sh
 # docker run -it --rm -v $(pwd):/sysroot almalinux:9 bash
 
 arch=$(uname -m)
@@ -14,13 +15,6 @@ echo "install rest of dependencies"
 dnf install -y epel-release
 dnf upgrade --refresh -y
 dnf config-manager --set-enabled crb
-dnf install -y \
-        mariadb-connector-c-devel \
-        expat-devel \
-        postgresql-devel \
-        unixODBC-devel \
-        jemalloc-devel \
-        openssl-devel \
-        libzstd-devel
 
+. /sysroot/packages_$distr.txt
 . /sysroot/mksysrootrhel.sh

+ 0 - 18
dist/build_dockers/cross/sysroots/in_ubuntu.sh

@@ -1,18 +0,0 @@
-#!/bin/bash
-# docker run --rm -v $(pwd):/sysroot ubuntu:xenial bash /sysroot/in_xenial.sh
-# docker run -it --rm -v $(pwd):/sysroot ubuntu:xenial bash
-
-export DEBIAN_FRONTEND=noninteractive
-arch=$(uname -m)
-export arch
-export distr=$1
-
-apt-get update && apt-get install -y \
-    build-essential
-
- . /sysroot/mkboost.sh
-
-echo "install rest of dependencies"
-. /sysroot/ubuntu.apt
-
-. /sysroot/mksysroot.sh

+ 11 - 4
dist/build_dockers/cross/sysroots/mkboost.sh

@@ -1,13 +1,20 @@
 #!/bin/bash
 
-echo "build boost"
-boostver=1_78_0
+# file included from all in_*.sh in context of target system docker
+
+# boost_library.sh defines $boostver and $boostlibs, something like this:
+# boostver=1_78_0
+# boostlibs="--with-context --with-system --with-fiber --with-program_options --with-stacktrace  --with-filesystem"
+
+. /sysroot/boost_library.sh
+echo "build boost $boostver, params $boostlibs"
+
 cd /
 ln -s /sysroot/boost_${boostver}.tar.gz boost_${boostver}.tar.gz
-tar -zxf boost_${boostver}.tar.gz
+tar -xf boost_${boostver}.tar.gz
 cd boost_${boostver}
 ./bootstrap.sh
-./b2 install --with-context --with-system --with-fiber --with-program_options --with-stacktrace
+./b2 install $boostlibs
 
 echo "make link to shared boost includes"
 cd /usr/local

+ 3 - 0
dist/build_dockers/cross/sysroots/mksysroot.sh

@@ -1,5 +1,8 @@
 #!/bin/bash
 
+# file included from all debian/ubuntu  in_*.sh in context of target system docker
+# $distr and $arch should be declared on inclusion of this file
+
 fixlinks()
 {
   cd $1

+ 4 - 1
dist/build_dockers/cross/sysroots/mksysrootrhel.sh

@@ -1,5 +1,8 @@
 #!/bin/bash
 
+# file included from all centos/redhat  in_*.sh in context of target system docker
+# $distr and $arch should be declared on inclusion of this file
+
 fixlinks()
 {
   cd $1
@@ -64,4 +67,4 @@ yum -y remove file
 yum -y autoremove
 
 echo "pack sysroot"
-tar -cf - /usr/lib/gcc /usr/lib64 /usr/include /lib /lib64> /sysroot/$arch/sysroot_${distr}_$arch.tar
+tar -cf - /usr/lib/gcc /usr/lib/ld-* /usr/lib64 /usr/include /lib /lib64> /sysroot/$arch/sysroot_${distr}_$arch.tar

+ 12 - 0
dist/build_dockers/cross/sysroots/packages_bionic.txt

@@ -0,0 +1,12 @@
+# packages for ubuntu bionic (18.04 LTS)
+# file included from in_debian.sh
+
+apt-get install -y \
+    libmysqlclient-dev \
+    libexpat-dev \
+    libpq-dev \
+    unixodbc-dev \
+    libjemalloc-dev \
+    libssl-dev \
+    libzstd-dev \
+    libcurl4-openssl-dev

+ 5 - 1
dist/build_dockers/cross/sysroots/bullseye.apt → dist/build_dockers/cross/sysroots/packages_bookworm.txt

@@ -1,3 +1,6 @@
+# packages for debian bookworm (12), released ????
+# file included from in_debian.sh
+
 apt-get install -y \
     default-libmysqlclient-dev \
     libexpat-dev \
@@ -5,4 +8,5 @@ apt-get install -y \
     unixodbc-dev \
     libjemalloc-dev \
     libssl-dev \
-    libzstd-dev
+    libzstd-dev \
+    libcurl4-openssl-dev

+ 12 - 0
dist/build_dockers/cross/sysroots/packages_bullseye.txt

@@ -0,0 +1,12 @@
+# packages for debian bullseye (11), released 2021
+# file included from in_debian.sh
+
+apt-get install -y \
+    default-libmysqlclient-dev \
+    libexpat-dev \
+    libpq-dev \
+    unixodbc-dev \
+    libjemalloc-dev \
+    libssl-dev \
+    libzstd-dev \
+    libcurl4-openssl-dev

+ 5 - 1
dist/build_dockers/cross/sysroots/buster.apt → dist/build_dockers/cross/sysroots/packages_buster.txt

@@ -1,3 +1,6 @@
+# packages for debian buster (10), released 2019
+# file included from in_debian.sh
+
 apt-get install -y \
     libmariadb-dev-compat \
     libexpat-dev \
@@ -5,4 +8,5 @@ apt-get install -y \
     unixodbc-dev \
     libjemalloc-dev \
     libssl-dev \
-    libzstd-dev
+    libzstd-dev \
+    libcurl4-openssl-dev

+ 5 - 1
dist/build_dockers/cross/sysroots/ubuntu.apt → dist/build_dockers/cross/sysroots/packages_focal.txt

@@ -1,3 +1,6 @@
+# packages for ubuntu focal (20.04 LTS)
+# file included from in_debian.sh
+
 apt-get install -y \
     libmysqlclient-dev \
     libexpat-dev \
@@ -5,4 +8,5 @@ apt-get install -y \
     unixodbc-dev \
     libjemalloc-dev \
     libssl-dev \
-    libzstd-dev
+    libzstd-dev \
+    libcurl4-openssl-dev

+ 12 - 0
dist/build_dockers/cross/sysroots/packages_jammy.txt

@@ -0,0 +1,12 @@
+# packages for ubuntu jammy (22.04.LTS)
+# file included from in_debian.sh
+
+apt-get install -y \
+    libmysqlclient-dev \
+    libexpat-dev \
+    libpq-dev \
+    unixodbc-dev \
+    libjemalloc-dev \
+    libssl-dev \
+    libzstd-dev \
+    libcurl4-openssl-dev

+ 12 - 0
dist/build_dockers/cross/sysroots/packages_rhel7.txt

@@ -0,0 +1,12 @@
+# packages for centos/redhat 7
+# file included from in_rhel7.sh
+
+yum install -y \
+        mysql-devel \
+        expat-devel \
+        postgresql-devel \
+        unixODBC-devel \
+        jemalloc-devel \
+        openssl-devel \
+        libzstd-devel \
+        libcurl-devel

+ 12 - 0
dist/build_dockers/cross/sysroots/packages_rhel8.txt

@@ -0,0 +1,12 @@
+# packages for centos/redhat 8
+# file included from in_rhel8.sh
+
+yum install -y \
+        mariadb-connector-c-devel \
+        expat-devel \
+        postgresql-devel \
+        unixODBC-devel \
+        jemalloc-devel \
+        openssl-devel \
+        libzstd-devel \
+        libcurl-devel

+ 11 - 0
dist/build_dockers/cross/sysroots/packages_rhel9.txt

@@ -0,0 +1,11 @@
+# file included from in_rhel9.sh
+
+dnf install -y \
+        mariadb-connector-c-devel \
+        expat-devel \
+        postgresql-devel \
+        unixODBC-devel \
+        jemalloc-devel \
+        openssl-devel \
+        libzstd-devel \
+        libcurl-devel

+ 9 - 0
dist/build_dockers/cross/sysroots/redhat.sh

@@ -0,0 +1,9 @@
+# file included from build_centos7/centos8/alma9
+# $distr and $image should be set on inclusion of this file
+
+arch=$(uname -m)
+mkdir $arch
+docker run --rm -v $(pwd):/sysroot $image bash /sysroot/in_$distr.sh
+
+. finalize.sh
+

+ 0 - 16
dist/build_dockers/cross/sysroots/ubuntu.sh

@@ -1,16 +0,0 @@
-#!/bin/bash
-
-# distr should be set on inclusion of this file
-
-arch=$(uname -m)
-mkdir $arch
-docker run --rm -v $(pwd):/sysroot ubuntu:$distr bash /sysroot/in_ubuntu.sh $distr
-
-cd $arch
-echo "pack archives"
-for a in *.tar; do
-  echo "pack $a..."
-  zstd $a && rm -f $a;
-done
-
-

+ 4 - 3
dist/build_dockers/cross/windows-cl.cmake

@@ -1,15 +1,16 @@
 # Cross toolchain configuration for using clang-cl on non-Windows hosts to
 # target MSVC.
 
-set ( boostdir boost_1_78_0 )
+set ( boostdir boost_1_80_0 ) # fixme!
 
 set ( winroot $ENV{winroot} )
 if (NOT winroot)
     set ( winroot /sysroot/root )
 endif ()
 
-set ( LLVM $ENV{LLVM} )
-if (NOT LLVM)
+if ($ENV{llvm})
+    set ( LLVM /usr/lib/llvm-$ENV{llvm} )
+else ()
     set ( LLVM /usr/lib/llvm-13 )
 endif ()
 

+ 4 - 3
dist/build_dockers/cross/windows.cmake

@@ -1,15 +1,16 @@
 # Cross toolchain configuration for using clang on non-Windows hosts to
 # target MSVC.
 
-set ( boostdir boost_1_78_0 )
+set ( boostdir boost_1_80_0 ) # fixme!
 
 set ( winroot $ENV{winroot} )
 if (NOT winroot)
     set ( winroot /sysroot/root )
 endif ()
 
-set ( LLVM $ENV{LLVM} )
-if (NOT LLVM)
+if ($ENV{llvm})
+    set ( LLVM /usr/lib/llvm-$ENV{llvm} )
+else ()
     set ( LLVM /usr/lib/llvm-13 )
 endif ()