diff options
author | Stefan Becker <chemobejk@gmail.com> | 2019-06-27 12:22:53 +0300 |
---|---|---|
committer | Stefan Becker <chemobejk@gmail.com> | 2019-06-27 19:52:31 +0300 |
commit | d4bc4fa35b5ea745195d116e1329fac6ad28dd5b (patch) | |
tree | 086e2df18d190361d08da70ac3fd53dae07abc91 | |
parent | 7b4b46f97c2d37da38eba4637dcf040105269772 (diff) | |
download | libnice-d4bc4fa35b5ea745195d116e1329fac6ad28dd5b.tar.gz |
build: make prefix option accept a list of strings
The parameter for the ignored network interface prefix build option
accepts a comma-separated string now. This list will be converted to a
comma-separated list of string literals for the C code.
Disable the feature:
./configure ...
./configure --with-ignored-network-interface-prefix= ...
meson setup -D ignored-network-interface-prefix= ...
meson setup -D ignored-network-interface-prefix=[] ...
Ignore interfaces whose names start with "virbr":
./configure --with-ignored-network-interface-prefix=virbr ...
meson setup -D ignored-network-interface-prefix=virbr ...
Ignore interfaces whose names start with "virbr" or "veth":
./configure --with-ignored-network-interface-prefix=virbr,veth ...
meson setup -D ignored-network-interface-prefix=virbr,veth ...
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | meson.build | 8 | ||||
-rw-r--r-- | meson_options.txt | 4 |
3 files changed, 14 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac index 147b033..5254154 100644 --- a/configure.ac +++ b/configure.ac @@ -395,16 +395,17 @@ AM_CONDITIONAL([ENABLE_GTK_DOC], false) # GObject introspection GOBJECT_INTROSPECTION_CHECK([1.30.0]) -dnl Ignore a specific network interface name prefix from the connection check -AC_MSG_CHECKING([whether to ignore a specific network interface name prefix]) +dnl Ignore specific network interface name prefixes from the connection check +AC_MSG_CHECKING([whether to ignore specific network interface name prefixes]) AC_ARG_WITH([ignored-network-interface-prefix], - [AS_HELP_STRING([--with-ignored-network-interface-prefix=string], - [Ignore network interfaces whose name starts with "string" from the ICE connection + [AS_HELP_STRING([--with-ignored-network-interface-prefix=string@<:@,string...@:>@], + [Ignore network interfaces whose name starts with a string from this list in the ICE connection check algorithm. For example, interfaces "virbr" in the case of the virtual bridge handled by libvirtd, do not help in finding connectivity.])], [interface_prefix="$withval"]) AS_IF([test -n "$interface_prefix"], - [AC_DEFINE_UNQUOTED([IGNORED_IFACE_PREFIX],["$interface_prefix"], + [[interface_prefix_list=`echo $interface_prefix | sed 's/,/","/g'`] + AC_DEFINE_UNQUOTED([IGNORED_IFACE_PREFIX],["$interface_prefix_list"], [Ignore this network interface prefix from the connection check]) AC_MSG_RESULT([yes, $interface_prefix])], [AC_MSG_RESULT([no])]) diff --git a/meson.build b/meson.build index c685e41..114d7c6 100644 --- a/meson.build +++ b/meson.build @@ -232,8 +232,12 @@ nice_incs = include_directories('.', 'agent', 'random', 'socket', 'stun') nice_deps = gio_deps + [gthread_dep, crypto_dep, gupnp_igd_dep] + syslibs ignored_iface_prefix = get_option('ignored-network-interface-prefix') -if ignored_iface_prefix != '' - cdata.set_quoted('IGNORED_IFACE_PREFIX', ignored_iface_prefix) +if ignored_iface_prefix != [] + ignored_iface_prefix_quoted = [] + foreach i : ignored_iface_prefix + ignored_iface_prefix_quoted += '"' + i + '"' + endforeach + cdata.set('IGNORED_IFACE_PREFIX', ','.join(ignored_iface_prefix_quoted)) endif gir = find_program('g-ir-scanner', required : get_option('introspection')) diff --git a/meson_options.txt b/meson_options.txt index d3a0ab9..9f9f7d6 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -2,8 +2,8 @@ option('gupnp', type: 'feature', value: 'auto', description: 'Enable or disable GUPnP IGD support') option('gstreamer', type: 'feature', value: 'auto', description: 'Enable or disable build of GStreamer plugins') -option('ignored-network-interface-prefix', type: 'string', value: '', - description: 'Ignore network interfaces whose name starts with this string in the ICE connection check algorithm. For example, "virbr" to ignore virtual bridge interfaces added by virtd, which do not help in finding connectivity.') +option('ignored-network-interface-prefix', type: 'array', value: [], + description: 'Ignore network interfaces whose name starts with a string from this list in the ICE connection check algorithm. For example, "virbr" to ignore virtual bridge interfaces added by virtd, which do not help in finding connectivity.') option('crypto-library', type: 'combo', choices : ['auto', 'gnutls', 'openssl'], value : 'auto') # Common feature options |