build: merge branch 'th/build-meson-on-travis'

https://github.com/NetworkManager/NetworkManager/pull/54
This commit is contained in:
Thomas Haller 2018-01-10 15:33:12 +01:00
commit 1712fae6e8
25 changed files with 146 additions and 126 deletions

View file

@ -19,6 +19,8 @@ addons:
- libnl-3-dev
- libnl-route-3-dev
- libnl-genl-3-dev
- libmm-glib-dev
- ppp
- ppp-dev
- libpolkit-gobject-1-dev
- libgnutls-dev
@ -44,7 +46,9 @@ addons:
- libnl-3-dev
- libndp-dev
- automake
- dnsmasq
- libcurl4-gnutls-dev
- python3-pip
coverity_scan:
project:
name: NetworkManager/NetworkManager
@ -53,13 +57,54 @@ addons:
branch_pattern: .*coverity.*
before_install:
- sudo dbus-uuidgen --ensure
- sudo dbus-uuidgen --ensure
- |
if test "$BUILD_TYPE" == 'meson'; then
git clone https://github.com/ninja-build/ninja &&
pushd ninja &&
./configure.py --bootstrap &&
sudo cp ninja /usr/bin/ &&
popd
sudo pip3 install meson
fi
- sudo chmod o+x /usr/sbin/pppd
script: |
sh autogen.sh --with-systemd-logind=no --enable-more-warnings=no --enable-ifcfg-rh --enable-ifupdown --enable-tests &&
make -j4 &&
./contrib/travis/travis-check.sh
script:
- |
if test "$BUILD_TYPE" == 'meson'; then
meson build \
\
-D ld_gc=false \
-D session_tracking=no \
-D systemdsystemunitdir=no \
-D systemd_journal=false \
-D selinux=false \
-D libaudit=no \
-D libpsl=false \
-D vapi=false \
-D introspection=false \
-D qt=false \
\
-D docs=true \
\
-D ifcfg_rh=false \
-D ibft=true \
-D ifupdown=true \
&&
ninja -C build &&
ninja -C build test
fi
- |
if test "$BUILD_TYPE" == 'autotools'; then
git clean -fdx &&
./autogen.sh --with-systemd-logind=no --enable-more-warnings=no --enable-ifcfg-rh --enable-config-plugin-ibft --enable-ifupdown --enable-tests &&
make -j4 &&
./contrib/travis/travis-check.sh
fi
env:
matrix:
- BUILD_TYPE=autotools
- BUILD_TYPE=meson
global:
secure: K36MXkcsuDZ0msuEj5zHMmHfv6O725lsXuFdP6AJ3rYWKuLYE1+iNLgIRndNWDK9ckkNQFaCxDY4Z/NCfCYQTGAS9oXR5AwNqNbhOq8XrqdaZ2GX35sob8Tp4B3IsoREkN/UbIkXQKYlA5rUhgtSifUg3EwfeOiFvnLCwHcp0rYHnvT/jaq5vodBbA1jChjezcMHsp43kvPXHpybKRkipb9EzV/V3VtDLLWh9WQBvQNawpsHnT+MXSke1yU1zfNMyD9XiD7VDzCwaTs6LzjoFBLc86QS5U/9W72s0rFe6SbecntQHftknRzSrGiJDNe64wDZN/Wxq1MHxEOFCwDi6vcSwQ+RoTdhyshhfPVY2Mm5soj2w7Dx43Cz0dDZDCMhu5xxzFAFgkieJSfwXbuxga0ds58Ph8MgtDSp3fBRewZwI+vMuzl7a1hGkcqJojrm1lfgAKbNgrNUzQRwbVYAyrpa6/vCbd6ZH4PEtITwLaRf2mz8PG71xiMQguDDDXS8WF0U7Looe+G9ybAUwDS5hqHfeP+3q6bfN5Sg5Zs5QkBIN5LZbeWbPYldOEEDTvo3VI7e84bk7U5qEoUKc0w/tqVF1B5KgNUq6nIkCkmoBx8RFnmjpOHh99IfeRG9nQTRpCaEDvAM4fcRzITzId8dIIfAW/45P3ozzfz/HYiie+o=

View file

@ -31,10 +31,9 @@ cflags = clients_cflags + [
'-DNMCLI_LOCALEDIR="@0@"'.format(nm_localedir)
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]
if enable_polkit_agent
sources += nm_polkit_listener

View file

@ -14,10 +14,9 @@ cflags = clients_cflags + [
'-DG_LOG_DOMAIN="@0@"'.format(name),
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]
executable(
name,

View file

@ -61,10 +61,9 @@ deps += [
libnmt_newt_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]
executable(
name,

View file

@ -54,10 +54,9 @@ sources += gnome.gdbus_codegen(
namespace: 'NMDBus'
)
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]
executable(
name,

View file

@ -3,14 +3,16 @@ doc_module = nm_name
settings = 'settings-spec'
output = settings + '.xml'
settings_xml = custom_target(
output,
input: nm_settings_docs,
output: output,
command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), settings + '.xsl'), '@INPUT@'],
# FIXME: there is no target depending on this, so it will not be built
build_by_default: true
)
if enable_introspection
settings_xml = custom_target(
output,
input: nm_settings_docs,
output: output,
command: [xsltproc, '--output', '@OUTPUT@', join_paths(meson.current_source_dir(), settings + '.xsl'), '@INPUT@'],
# FIXME: there is no target depending on this, so it will not be built
build_by_default: true
)
endif
configure_file(
input: version_xml + '.in',

View file

@ -102,10 +102,9 @@ deps = common_deps + [libnm_util_dep]
symbol_map = join_paths(meson.current_source_dir(), 'libnm-glib-vpn.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]
libnm_glib_vpn = shared_library(
'nm-glib-vpn',
@ -195,10 +194,9 @@ deps = common_deps + [
symbol_map = join_paths(meson.current_source_dir(), 'libnm-glib.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]
libnm_glib = shared_library(
'nm-glib',

View file

@ -7,8 +7,9 @@ deps = [
]
test_units = [
'test-nm-client',
'test-remote-settings-client'
# FIXME: these tests currently fail
#'test-nm-client',
#'test-remote-settings-client'
]
foreach test_unit: test_units

View file

@ -110,10 +110,9 @@ cflags = common_cflags + [
symbol_map = join_paths(meson.current_source_dir(), 'libnm-util.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]
libnm_util = shared_library(
'nm-util',

View file

@ -2,13 +2,7 @@ libnm_inc = include_directories('.')
sources = files('nm-libnm-utils.c')
if have_fake_typelibs
subdir('fake-typelib')
endif
deps = [
# FIXME: this makes GIR mandatory?
gir_dep,
libnmdbus_dep,
shared_dep
]
@ -19,6 +13,11 @@ cflags = [
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir)
]
if have_fake_typelibs
deps += [ gir_dep ]
subdir('fake-typelib')
endif
libnm_utils = static_library(
'nm-utils',
sources: sources,
@ -146,10 +145,9 @@ deps = [
symbol_map = join_paths(meson.current_source_dir(), 'libnm.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]
libnm = shared_library(
'nm',

View file

@ -165,14 +165,9 @@ endif
add_project_arguments(common_flags, language: 'c')
add_project_link_arguments(common_ldflags, language: 'c')
ldflag = '-Wl,--version-script'
have_version_script = host_machine.system().contains('linux') and cc.has_argument(ldflag)
if have_version_script
linker_script_binary = join_paths(meson.source_root(), 'linker-script-binary.ver')
linker_script_devices = join_paths(meson.source_root(), 'linker-script-devices.ver')
linker_script_settings = join_paths(meson.source_root(), 'linker-script-settings.ver')
endif
linker_script_binary = join_paths(meson.source_root(), 'linker-script-binary.ver')
linker_script_devices = join_paths(meson.source_root(), 'linker-script-devices.ver')
linker_script_settings = join_paths(meson.source_root(), 'linker-script-settings.ver')
uuid_dep = dependency('uuid')
libelogind_dep = dependency('libelogind', version: '>= 219', required: false)
@ -240,9 +235,9 @@ endif
enable_ifcfg_rh = get_option('ifcfg_rh') or (distro == 'redhat')
enable_ifupdown = get_option('ifupdown') or (distro == 'debian')
enable_ibft = get_option('ibft') or enable_ifcfg_rh
enable_config_plugin_ibft = get_option('config_plugin_ibft')
config_h.set10('WITH_SETTINGS_PLUGIN_IBFT', enable_config_plugin_ibft)
config_h.set10('WITH_SETTINGS_PLUGIN_IBFT', enable_ibft)
config_plugins_default = get_option('config_plugins_default')
if config_plugins_default == ''
@ -256,7 +251,7 @@ if config_plugins_default == ''
config_plugins += ['ifupdown']
endif
if enable_config_plugin_ibft
if enable_ibft
config_plugins += ['ibft']
endif
@ -402,6 +397,8 @@ session_tracking = get_option('session_tracking')
session_trackers = []
enable_session_tracking = (session_tracking != 'no')
enable_consolekit = get_option('consolekit')
if enable_session_tracking
if session_tracking == 'systemd'
logind_dep = libsystemd_dep
@ -418,7 +415,6 @@ if enable_session_tracking
config_h.set('SESSION_TRACKING_ELOGIND', true)
endif
enable_consolekit = get_option('consolekit')
if enable_consolekit
session_trackers += 'consolekit'
config_h.set_quoted('CKDB_PATH', '/var/run/ConsoleKit/database')
@ -981,7 +977,7 @@ output += ' libnm-glib: ' + enable_libnm_glib.to_string() + '\n'
output += ' nmcli: ' + enable_nmcli.to_string() + '\n'
output += ' nmtui: ' + enable_nmtui.to_string() + '\n'
output += '\nConfiguration_plugins (main.plugins=' + config_plugins_default + ')\n'
output += ' ibft: ' + enable_config_plugin_ibft.to_string() + '\n'
output += ' ibft: ' + enable_ibft.to_string() + '\n'
output += ' ifcfg-rh: ' + enable_ifcfg_rh.to_string() + '\n'
output += ' ifupdown: ' + enable_ifupdown.to_string() + '\n'
output += '\nHandlers for /etc/resolv.conf:\n'

View file

@ -44,7 +44,7 @@ option('bluez5_dun', type: 'boolean', value: false, description: 'enable Bluez5
# configuration plugins
option('config_plugins_default', type: 'string', value: '', description: 'Default configuration option for main.plugins setting, used as fallback if the configuration option is unset')
option('config_plugin_ibft', type: 'boolean', value: true, description: 'enable ibft configuration plugin')
option('ibft', type: 'boolean', value: false, description: 'enable ibft configuration plugin')
option('ifcfg_rh', type: 'boolean', value: false, description: 'enable ifcfg-rh configuration plugin (Fedora/RHEL)')
option('ifupdown', type: 'boolean', value: false, description: 'enable ifupdown configuration plugin (Debian/Ubuntu)')

View file

@ -9,10 +9,9 @@ deps = [
nm_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]
libnm_device_plugin_adsl = shared_module(
'nm-device-plugin-adsl',

View file

@ -14,10 +14,9 @@ deps = [
nm_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]
if enable_bluez5_dun
sources += files('nm-bluez5-dun.c')

View file

@ -12,10 +12,9 @@ deps = [
nm_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]
libnm_device_plugin_ovs = shared_module(
'nm-device-plugin-ovs',

View file

@ -10,10 +10,9 @@ deps = [
nm_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]
libnm_device_plugin_team = shared_module(
'nm-device-plugin-team',

View file

@ -21,10 +21,9 @@ deps = [
nm_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]
libnm_device_plugin_wifi = shared_module(
'nm-device-plugin-wifi',

View file

@ -16,10 +16,9 @@ endif
symbol_name = join_paths(meson.current_source_dir(), 'libnm-wwan.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_name)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_name),
]
libnm_wwan = shared_module(
'nm-wwan',
@ -51,10 +50,9 @@ sources = files(
deps += libnmdbus_dep
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_devices)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_devices),
]
libnm_device_plugin_wwan = shared_module(
'nm-device-plugin-wwan',

View file

@ -6,10 +6,9 @@ cflags = [
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir),
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]
executable(
name,

View file

@ -232,9 +232,7 @@ symbol_map = custom_target(
command: [create_exports_networkmanager, '--called-from-make', '@INPUT@']
)
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
'''
network_manager = executable(
@ -257,10 +255,9 @@ deps = [
nm_core_dep
]
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_binary)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_binary),
]
name = 'nm-iface-helper'

View file

@ -28,10 +28,9 @@ deps = [
symbol_map = join_paths(meson.current_source_dir(), 'nm-ppp-plugin.ver')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(symbol_map),
]
core_plugins += shared_module(
name,

View file

@ -17,10 +17,9 @@ sources = files(
'nms-ibft-plugin.c'
)
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_settings)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_settings),
]
libnm_settings_plugin_ibft = shared_module(
name,

View file

@ -46,10 +46,9 @@ libnms_ifcfg_rh_core = static_library(
sources = [dbus_sources] + files('nms-ifcfg-rh-connection.c')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_settings)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_settings),
]
libnm_settings_plugin_ifcfg_rh = shared_module(
'nm-settings-plugin-ifcfg-rh',

View file

@ -22,10 +22,9 @@ sources = files(
'nms-ifupdown-plugin.c'
)
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(linker_script_settings)
endif
ldflags = [
'-Wl,--version-script,@0@'.format(linker_script_settings),
]
libnm_settings_plugin_ifupdown = shared_module(
'nm-settings-plugin-ifupdown',

View file

@ -1,5 +1,5 @@
if enable_tests
subdir('keyfile/tests')
if enable_ibft
subdir('ibft')
endif
if enable_ifcfg_rh
@ -10,6 +10,6 @@ if enable_ifupdown
subdir('ifupdown')
endif
if enable_config_plugin_ibft
subdir('ibft')
if enable_tests
subdir('keyfile/tests')
endif