Skip to content

Commit 4b465b5

Browse files
committed
ci: switch to pkgconf on Linux too
Change-Id: Iff9bf98512e4d1bbd7c5a37b8e4e0b9308f884da
1 parent 130975c commit 4b465b5

2 files changed

Lines changed: 21 additions & 11 deletions

File tree

.jenkins.d/00-deps.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,20 @@ APT_PKGS=(
1515
libpcap-dev
1616
libsqlite3-dev
1717
libssl-dev
18-
pkg-config
18+
pkgconf
1919
python3
2020
)
21+
DNF_PKGS=(
22+
boost-devel
23+
gcc-c++
24+
libasan
25+
libpcap-devel
26+
lld
27+
openssl-devel
28+
pkgconf
29+
python3
30+
sqlite-devel
31+
)
2132
FORMULAE=(boost openssl pkgconf)
2233
PIP_PKGS=()
2334
case $JOB_NAME in
@@ -44,9 +55,7 @@ elif [[ $ID_LIKE == *debian* ]]; then
4455
sudo apt-get update -qq
4556
sudo apt-get install -qy --no-install-recommends "${APT_PKGS[@]}"
4657
elif [[ $ID_LIKE == *fedora* ]]; then
47-
sudo dnf install -y gcc-c++ libasan lld pkgconf-pkg-config python3 \
48-
boost-devel openssl-devel sqlite-devel \
49-
libpcap-devel
58+
sudo dnf install -y "${DNF_PKGS[@]}"
5059
fi
5160

5261
if (( ${#PIP_PKGS[@]} )); then

.waf-tools/default-compiler-flags.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def configure(conf):
1111
conf.start_msg('Checking C++ compiler version')
1212

1313
cxx = conf.env.CXX_NAME # generic name of the compiler
14-
ccver = tuple(int(i) for i in conf.env.CC_VERSION)
14+
ccver = get_compiler_ver(conf)
1515
ccverstr = '.'.join(conf.env.CC_VERSION)
1616
errmsg = ''
1717
warnmsg = ''
@@ -60,6 +60,10 @@ def configure(conf):
6060
conf.env.DEFINES += generalFlags['DEFINES']
6161

6262

63+
def get_compiler_ver(conf):
64+
return tuple(int(i) for i in conf.env.CC_VERSION)
65+
66+
6367
@Configure.conf
6468
def check_compiler_flags(conf):
6569
# Debug or optimized CXXFLAGS and LINKFLAGS are applied only if the
@@ -124,9 +128,6 @@ def add_supported_linkflags(self, linkflags):
124128

125129

126130
class CompilerFlags:
127-
def getCompilerVersion(self, conf):
128-
return tuple(int(i) for i in conf.env.CC_VERSION)
129-
130131
def getGeneralFlags(self, conf):
131132
"""Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are always needed"""
132133
return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': []}
@@ -226,7 +227,7 @@ def getGeneralFlags(self, conf):
226227
elif Utils.unversioned_sys_platform() == 'freebsd':
227228
# Bug #4790
228229
flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']]
229-
if self.getCompilerVersion(conf) >= (18, 0, 0):
230+
if get_compiler_ver(conf) >= (18, 0, 0) and get_compiler_ver(conf) < (20, 1, 0):
230231
# Bug #5300
231232
flags['CXXFLAGS'] += ['-Wno-enum-constexpr-conversion']
232233
return flags
@@ -240,10 +241,10 @@ def getDebugFlags(self, conf):
240241
flags = super().getDebugFlags(conf)
241242
flags['CXXFLAGS'] += self.__cxxFlags
242243
# Enable assertions in libc++
243-
if self.getCompilerVersion(conf) >= (18, 0, 0):
244+
if get_compiler_ver(conf) >= (18, 0, 0):
244245
# https://libcxx.llvm.org/Hardening.html
245246
flags['DEFINES'] += ['_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE']
246-
elif self.getCompilerVersion(conf) >= (15, 0, 0):
247+
elif get_compiler_ver(conf) >= (15, 0, 0):
247248
# https://releases.llvm.org/15.0.0/projects/libcxx/docs/UsingLibcxx.html#enabling-the-safe-libc-mode
248249
flags['DEFINES'] += ['_LIBCPP_ENABLE_ASSERTIONS=1']
249250
# Tell libc++ to avoid including transitive headers

0 commit comments

Comments
 (0)