Skip to content

Commit

Permalink
o Add ubuntu-22.04 builds.
Browse files Browse the repository at this point in the history
o Add gcc-11, gcc-12, clang-11, clang-12 and clang-13.

o actions/checkout@v2 -> actions/checkout@v3.
  • Loading branch information
sobomax committed Feb 16, 2023
1 parent 8a5e6ac commit 49bc08a
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 28 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
COMPILER: ${{ matrix.compiler }}
BUILD_OS: ${{ matrix.os }}

strategy:
matrix:
Expand All @@ -35,11 +36,25 @@ jobs:
compiler: 'gcc-arm32-cross'
- os: ubuntu-18.04
compiler: 'gcc-arm64-cross'
- os: ubuntu-22.04
compiler: 'gcc'
- os: ubuntu-22.04
compiler: 'clang'
- os: ubuntu-22.04
compiler: 'gcc-11'
- os: ubuntu-22.04
compiler: 'gcc-12'
- os: ubuntu-22.04
compiler: 'clang-11'
- os: ubuntu-22.04
compiler: 'clang-12'
- os: ubuntu-22.04
compiler: 'clang-13'

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive

Expand Down
5 changes: 4 additions & 1 deletion Makefile.openssl
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#
# WARNING: do not run this directly, it should be included by other Makefiles

# Needed to build with openssl 3.x
DEFS += -Wno-deprecated-declarations

ifeq ($(CROSS_COMPILE),)
SSL_BUILDER=$(shell \
if pkg-config --exists libssl; then \
Expand All @@ -21,4 +24,4 @@ endif

# enable this flag to increase performance by not serializing openssl
# connect/accept/read/write operations, at the cost of possible crashes
#DEFS+= -DNO_SSL_GLOBAL_LOCK
#DEFS+= -DNO_SSL_GLOBAL_LOCK
4 changes: 4 additions & 0 deletions modules/snmpstats/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ else
INSTALLMIBDIR = $(cfg_prefix)/share/snmp/mibs
endif

ifeq ($(CC_NAME), clang)
DEFS := $(filter-out -flto%,$(DEFS)) -Wno-ignored-optimization-argument
endif

CFLAGS+=
auto_gen=
NAME=snmpstats.so
Expand Down
37 changes: 12 additions & 25 deletions scripts/build/build.conf.sub
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ setup_qemu() {
sudo ln -sf "/usr/${ARCH1}-linux-${ARCH2}" "/etc/qemu-binfmt/${ARCH1}"
}

COMPILER_VER=`echo "${COMPILER}" | sed -e 's|[a-z]*-||'`

case "${COMPILER}" in
gcc)
export CC="${COMPILER}"
Expand Down Expand Up @@ -62,35 +64,20 @@ clang-i386-cross)
PRE_INSTALL_CMD="sudo dpkg --add-architecture i386"
PKGS="${PKGS} clang llvm-dev libc6-dev:i386 libstdc++6:i386 lib32gcc-7-dev"
;;
gcc-9)
export CC="${COMPILER}"
export AR="gcc-ar-9"
export RANLIB="gcc-ranlib-9"
export GCOV_CMD="gcov-9"
PRE_INSTALL_CMD="enable_ubuntu_toolchain_test"
PKGS="${PKGS} gcc-9 g++-9"
;;
gcc-10)
gcc-*)
export CC="${COMPILER}"
export AR="gcc-ar-10"
export RANLIB="gcc-ranlib-10"
export GCOV_CMD="gcov-10"
export AR="gcc-ar-${COMPILER_VER}"
export RANLIB="gcc-ranlib-${COMPILER_VER}"
export GCOV_CMD="gcov-${COMPILER_VER}"
PRE_INSTALL_CMD="enable_ubuntu_toolchain_test"
PKGS="${PKGS} gcc-10 g++-10"
;;
clang-9)
export CC="${COMPILER}"
export AR="llvm-ar-9"
export RANLIB="llvm-ranlib-9"
export GCOV_CMD="llvm-cov-9 gcov"
PKGS="${PKGS} clang-9 llvm-9-dev libc++-9-dev libc++abi-9-dev"
PKGS="${PKGS} gcc-${COMPILER_VER} g++-${COMPILER_VER}"
;;
clang-10)
clang-*)
export CC="${COMPILER}"
export AR="llvm-ar-10"
export RANLIB="llvm-ranlib-10"
export GCOV_CMD="llvm-cov-10 gcov"
PKGS="${PKGS} clang-10 llvm-10-dev libc++-10-dev libc++abi-10-dev"
export AR="llvm-ar-${COMPILER_VER}"
export RANLIB="llvm-ranlib-${COMPILER_VER}"
export GCOV_CMD="llvm-cov-${COMPILER_VER} gcov"
PKGS="${PKGS} clang-${COMPILER_VER} llvm-${COMPILER_VER}-dev libc++-${COMPILER_VER}-dev libc++abi-${COMPILER_VER}-dev"
;;
*)
printf 'COMPILER="%s" is unknown / unsupported\n' "${COMPILER}" 1>&2
Expand Down
10 changes: 9 additions & 1 deletion scripts/build/install_depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@

set -e

PKGS=`grep -A 35 packages: .travis.yml | grep -e '^ *[-]' | awk '{print $2}'`
PKGS=""
for pkg in `grep -A 35 packages: .travis.yml | grep -e '^ *[-]' | awk '{print $2}'`
do
if [ "${BUILD_OS}" = ubuntu-22.04 -a "${pkg}" = python-dev ]
then
pkg="python-dev-is-python3"
fi
PKGS="${PKGS} ${pkg}"
done

. $(dirname $0)/build.conf.sub

Expand Down

0 comments on commit 49bc08a

Please sign in to comment.