mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 12:34:55 +00:00
Revert "Makefile: rework team compilation flags"
I don't think we should do this.
- renamining/dropping configure options is still an annoyance,
because it requires to different ./configure options depending
on the version. The rename from --enable-teamctl to --enable-team
might be theoretically nice, but more annoying then helpful.
- There is no strict dependency between --enable-team and
--enable-json-validation. At most, one could argue that
when enabling the team plugin (--enable-teamctl), then
libnm must also be build with --enable-json-validation.
But in fact, the team plugin will happily work with a
libnm that doesn't link against libjansson.
That is --enable-teamctl --disable-json-validation will work
in practice just fine.
On the other hand, libnm is a client library to create connection
profiles, fully supporting team profiles also makes sense if the
actual plugin is not installed (or build). Thus, --disable-teamctl
--enable-json-validation certainly makes sense.
At this point, one might ask whether libnm is even still complete without
libjansson. Maybe libnm should *require* --enable-json-validation.
But that is not what the patch was doing, and it would also need
some careful consideration before doing so.
This reverts commit 9d5cd7eae8
.
This commit is contained in:
parent
af6f62be8d
commit
b1c65d32fe
|
@ -2753,7 +2753,7 @@ endif
|
||||||
# src/devices/team
|
# src/devices/team
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
if WITH_TEAM
|
if WITH_TEAMDCTL
|
||||||
|
|
||||||
core_plugins += src/devices/team/libnm-device-plugin-team.la
|
core_plugins += src/devices/team/libnm-device-plugin-team.la
|
||||||
|
|
||||||
|
|
31
configure.ac
31
configure.ac
|
@ -657,10 +657,10 @@ else
|
||||||
have_team_prereq=no
|
have_team_prereq=no
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_ARG_ENABLE(team,
|
AC_ARG_ENABLE(teamdctl,
|
||||||
AS_HELP_STRING([--enable-team], [enable Teamd control support]),
|
AS_HELP_STRING([--enable-teamdctl], [enable Teamd control support]),
|
||||||
[enable_team=${enableval}], [enable_team=${have_team_prereq}])
|
[enable_teamdctl=${enableval}], [enable_teamdctl=${have_team_prereq}])
|
||||||
if (test "${enable_team}" = "yes"); then
|
if (test "${enable_teamdctl}" = "yes"); then
|
||||||
if test "$have_teamdctl" = "no"; then
|
if test "$have_teamdctl" = "no"; then
|
||||||
AC_MSG_ERROR(Libteamdctl is required for team support)
|
AC_MSG_ERROR(Libteamdctl is required for team support)
|
||||||
fi
|
fi
|
||||||
|
@ -669,11 +669,25 @@ if (test "${enable_team}" = "yes"); then
|
||||||
fi
|
fi
|
||||||
# temporary bug workaround
|
# temporary bug workaround
|
||||||
LIBTEAMDCTL_CFLAGS=`echo $LIBTEAMDCTL_CFLAGS | sed -e 's:/teamdctl.h::'`
|
LIBTEAMDCTL_CFLAGS=`echo $LIBTEAMDCTL_CFLAGS | sed -e 's:/teamdctl.h::'`
|
||||||
AC_DEFINE(WITH_TEAM, 1, [Define if you have Teamd control support])
|
AC_DEFINE(WITH_TEAMDCTL, 1, [Define if you have Teamd control support])
|
||||||
else
|
else
|
||||||
AC_DEFINE(WITH_TEAM, 0, [Define if you have Teamd control support])
|
AC_DEFINE(WITH_TEAMDCTL, 0, [Define if you have Teamd control support])
|
||||||
|
fi
|
||||||
|
AM_CONDITIONAL(WITH_TEAMDCTL, test "${enable_teamdctl}" = "yes")
|
||||||
|
|
||||||
|
# Jansson for team configuration validation
|
||||||
|
AC_ARG_ENABLE(json-validation,
|
||||||
|
AS_HELP_STRING([--enable-json-validation], [Enable JSON validation in libnm]),
|
||||||
|
[enable_json_validation=${enableval}],
|
||||||
|
[enable_json_validation=${have_jansson}])
|
||||||
|
if (test "${enable_json_validation}" == "no"); then
|
||||||
|
AC_DEFINE(WITH_JSON_VALIDATION, 0, [Define if JSON validation in libnm is enabled])
|
||||||
|
else
|
||||||
|
if test "$have_jansson" = "no"; then
|
||||||
|
AC_MSG_ERROR([jansson is needed for team configuration validation. Use --disable-json-validation to build without it.])
|
||||||
|
fi
|
||||||
|
AC_DEFINE(WITH_JSON_VALIDATION, 1, [Define if JSON validation in libnm is enabled])
|
||||||
fi
|
fi
|
||||||
AM_CONDITIONAL(WITH_TEAM, test "${enable_team}" = "yes")
|
|
||||||
|
|
||||||
# we usually compile with polkit support. --enable-polkit=yes|no only sets the
|
# we usually compile with polkit support. --enable-polkit=yes|no only sets the
|
||||||
# default configuration for main.auth-polkit. User can always enable/disable polkit
|
# default configuration for main.auth-polkit. User can always enable/disable polkit
|
||||||
|
@ -1397,7 +1411,7 @@ echo " ppp: $enable_ppp ${PPPD_PLUGIN_DIR}"
|
||||||
echo " modemmanager-1: $with_modem_manager_1"
|
echo " modemmanager-1: $with_modem_manager_1"
|
||||||
echo " ofono: $with_ofono"
|
echo " ofono: $with_ofono"
|
||||||
echo " concheck: $enable_concheck"
|
echo " concheck: $enable_concheck"
|
||||||
echo " team: $enable_team"
|
echo " libteamdctl: $enable_teamdctl"
|
||||||
echo " ovs: $enable_ovs"
|
echo " ovs: $enable_ovs"
|
||||||
echo " libnm-glib: $with_libnm_glib"
|
echo " libnm-glib: $with_libnm_glib"
|
||||||
echo " nmcli: $build_nmcli"
|
echo " nmcli: $build_nmcli"
|
||||||
|
@ -1436,6 +1450,7 @@ echo " valgrind: $with_valgrind $with_valgrind_suppressions"
|
||||||
echo " code coverage: $enable_code_coverage"
|
echo " code coverage: $enable_code_coverage"
|
||||||
echo " LTO: $enable_lto"
|
echo " LTO: $enable_lto"
|
||||||
echo " linker garbage collection: $enable_ld_gc"
|
echo " linker garbage collection: $enable_ld_gc"
|
||||||
|
echo " JSON validation for libnm: $enable_json_validation"
|
||||||
echo " sanitizers: $sanitizers"
|
echo " sanitizers: $sanitizers"
|
||||||
echo " Mozilla Public Suffix List: $with_libpsl"
|
echo " Mozilla Public Suffix List: $with_libpsl"
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -434,9 +434,9 @@ intltoolize --automake --copy --force
|
||||||
--disable-gtk-doc \
|
--disable-gtk-doc \
|
||||||
%endif
|
%endif
|
||||||
%if %{with team}
|
%if %{with team}
|
||||||
--enable-team=yes \
|
--enable-teamdctl=yes \
|
||||||
%else
|
%else
|
||||||
--enable-team=no \
|
--enable-teamdctl=no \
|
||||||
%endif
|
%endif
|
||||||
%if %{with ovs}
|
%if %{with ovs}
|
||||||
--enable-ovs=yes \
|
--enable-ovs=yes \
|
||||||
|
@ -472,7 +472,8 @@ intltoolize --automake --copy --force
|
||||||
--with-dist-version=%{version}-%{release} \
|
--with-dist-version=%{version}-%{release} \
|
||||||
--with-config-plugins-default='ifcfg-rh,ibft' \
|
--with-config-plugins-default='ifcfg-rh,ibft' \
|
||||||
--with-config-dns-rc-manager-default=symlink \
|
--with-config-dns-rc-manager-default=symlink \
|
||||||
--with-config-logging-backend-default=journal
|
--with-config-logging-backend-default=journal \
|
||||||
|
--enable-json-validation
|
||||||
|
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
|
|
|
@ -4296,7 +4296,7 @@ const char **nm_utils_enum_get_values (GType type, gint from, gint to)
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#if WITH_TEAM
|
#if WITH_JSON_VALIDATION
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_json_add_object (json_t *json,
|
_json_add_object (json_t *json,
|
||||||
|
@ -5054,7 +5054,7 @@ done:
|
||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* !WITH_TEAM */
|
#else /* !WITH_JSON_VALIDATION */
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
nm_utils_is_json_object (const char *str, GError **error)
|
nm_utils_is_json_object (const char *str, GError **error)
|
||||||
|
|
|
@ -5858,7 +5858,7 @@ test_nm_utils_check_valid_json (void)
|
||||||
{
|
{
|
||||||
_json_config_check_valid (NULL, FALSE);
|
_json_config_check_valid (NULL, FALSE);
|
||||||
_json_config_check_valid ("", FALSE);
|
_json_config_check_valid ("", FALSE);
|
||||||
#if WITH_TEAM
|
#if WITH_JSON_VALIDATION
|
||||||
_json_config_check_valid ("{ }", TRUE);
|
_json_config_check_valid ("{ }", TRUE);
|
||||||
_json_config_check_valid ("{ \"a\" : 1 }", TRUE);
|
_json_config_check_valid ("{ \"a\" : 1 }", TRUE);
|
||||||
_json_config_check_valid ("{ \"a\" : }", FALSE);
|
_json_config_check_valid ("{ \"a\" : }", FALSE);
|
||||||
|
@ -5883,7 +5883,7 @@ _team_config_equal_check (const char *conf1,
|
||||||
static void
|
static void
|
||||||
test_nm_utils_team_config_equal (void)
|
test_nm_utils_team_config_equal (void)
|
||||||
{
|
{
|
||||||
#if WITH_TEAM
|
#if WITH_JSON_VALIDATION
|
||||||
_team_config_equal_check ("", "", TRUE, TRUE);
|
_team_config_equal_check ("", "", TRUE, TRUE);
|
||||||
_team_config_equal_check ("{}",
|
_team_config_equal_check ("{}",
|
||||||
"{ }",
|
"{ }",
|
||||||
|
|
|
@ -628,7 +628,7 @@ test_team_conf_read_valid (void)
|
||||||
static void
|
static void
|
||||||
test_team_conf_read_invalid (void)
|
test_team_conf_read_invalid (void)
|
||||||
{
|
{
|
||||||
#if WITH_TEAM
|
#if WITH_JSON_VALIDATION
|
||||||
GKeyFile *keyfile = NULL;
|
GKeyFile *keyfile = NULL;
|
||||||
gs_unref_object NMConnection *con = NULL;
|
gs_unref_object NMConnection *con = NULL;
|
||||||
NMSettingTeam *s_team;
|
NMSettingTeam *s_team;
|
||||||
|
|
|
@ -1277,7 +1277,7 @@ main (int argc, char **argv)
|
||||||
g_test_add_func ("/libnm/settings/dcb/priorities", test_dcb_priorities_valid);
|
g_test_add_func ("/libnm/settings/dcb/priorities", test_dcb_priorities_valid);
|
||||||
g_test_add_func ("/libnm/settings/dcb/bandwidth-sums", test_dcb_bandwidth_sums);
|
g_test_add_func ("/libnm/settings/dcb/bandwidth-sums", test_dcb_bandwidth_sums);
|
||||||
|
|
||||||
#if WITH_TEAM
|
#if WITH_JSON_VALIDATION
|
||||||
g_test_add_func ("/libnm/settings/team/sync_runner_from_config_roundrobin",
|
g_test_add_func ("/libnm/settings/team/sync_runner_from_config_roundrobin",
|
||||||
test_runner_roundrobin_sync_from_config);
|
test_runner_roundrobin_sync_from_config);
|
||||||
g_test_add_func ("/libnm/settings/team/sync_runner_from_config_broadcast",
|
g_test_add_func ("/libnm/settings/team/sync_runner_from_config_broadcast",
|
||||||
|
|
Loading…
Reference in a new issue