mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
GHA: Linux: use the C(++) flags recommended by each respective distro
This commit is contained in:
parent
4227d427da
commit
f418d29379
29
.github/workflows/linux.bash
vendored
29
.github/workflows/linux.bash
vendored
@ -9,7 +9,7 @@ CMAKE_OPTS=()
|
|||||||
case "$DISTRO" in
|
case "$DISTRO" in
|
||||||
amazonlinux:2)
|
amazonlinux:2)
|
||||||
amazon-linux-extras install -y epel
|
amazon-linux-extras install -y epel
|
||||||
yum install -y bison ccache cmake3 gcc-c++ flex ninja-build \
|
yum install -y bison ccache cmake3 gcc-c++ flex ninja-build system-rpm-config \
|
||||||
{libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
|
{libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
|
||||||
|
|
||||||
yum install -y bzip2 tar wget
|
yum install -y bzip2 tar wget
|
||||||
@ -29,23 +29,25 @@ case "$DISTRO" in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
amazonlinux:20*)
|
amazonlinux:20*)
|
||||||
dnf install -y bison cmake flex gcc-c++ ninja-build \
|
dnf install -y amazon-rpm-config bison cmake flex gcc-c++ ninja-build \
|
||||||
{boost,libedit,mariadb1\*,ncurses,openssl,postgresql,systemd}-devel
|
{boost,libedit,mariadb1\*,ncurses,openssl,postgresql,systemd}-devel
|
||||||
;;
|
;;
|
||||||
|
|
||||||
debian:*|ubuntu:*)
|
debian:*|ubuntu:*)
|
||||||
apt-get update
|
apt-get update
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-{recommends,suggests} -y bison \
|
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-{recommends,suggests} -y \
|
||||||
ccache cmake flex g++ lib{boost-all,edit,mariadb,ncurses,pq,ssl,systemd}-dev ninja-build tzdata
|
bison ccache cmake dpkg-dev flex g++ ninja-build tzdata \
|
||||||
|
lib{boost-all,edit,mariadb,ncurses,pq,ssl,systemd}-dev
|
||||||
;;
|
;;
|
||||||
|
|
||||||
fedora:*)
|
fedora:*)
|
||||||
dnf install -y bison ccache cmake flex gcc-c++ ninja-build \
|
dnf install -y bison ccache cmake flex gcc-c++ ninja-build redhat-rpm-config \
|
||||||
{boost,libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
|
{boost,libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*suse*)
|
*suse*)
|
||||||
zypper in -y bison ccache cmake flex gcc-c++ ninja {lib{edit,mariadb,openssl},ncurses,postgresql,systemd}-devel \
|
zypper in -y bison ccache cmake flex gcc-c++ ninja rpm-config-SUSE \
|
||||||
|
{lib{edit,mariadb,openssl},ncurses,postgresql,systemd}-devel \
|
||||||
libboost_{context,coroutine,filesystem,iostreams,program_options,regex,system,test,thread}-devel
|
libboost_{context,coroutine,filesystem,iostreams,program_options,regex,system,test,thread}-devel
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -61,17 +63,28 @@ case "$DISTRO" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
dnf install -y bison ccache cmake gcc-c++ flex ninja-build \
|
dnf install -y bison ccache cmake gcc-c++ flex ninja-build redhat-rpm-config \
|
||||||
{boost,libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
|
{boost,libedit,mariadb,ncurses,openssl,postgresql,systemd}-devel
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
case "$DISTRO" in
|
||||||
|
debian:*|ubuntu:*)
|
||||||
|
CMAKE_OPTS+=(-DICINGA2_LTO_BUILD=ON)
|
||||||
|
source <(dpkg-buildflags --export=sh)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
CMAKE_OPTS+=(-DCMAKE_{C,CXX}_FLAGS="$(rpm -E '%{optflags} %{?march_flag}')")
|
||||||
|
export LDFLAGS="$(rpm -E '%{?build_ldflags}')"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
mkdir /icinga2/build
|
mkdir /icinga2/build
|
||||||
cd /icinga2/build
|
cd /icinga2/build
|
||||||
|
|
||||||
cmake \
|
cmake \
|
||||||
-GNinja \
|
-GNinja \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
-DICINGA2_UNITY_BUILD=ON \
|
-DICINGA2_UNITY_BUILD=ON \
|
||||||
-DUSE_SYSTEMD=ON \
|
-DUSE_SYSTEMD=ON \
|
||||||
-DICINGA2_USER=$(id -un) \
|
-DICINGA2_USER=$(id -un) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user