diff --git a/Makefile.am b/Makefile.am index 18bb6c68c..2420f3bbf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,7 +59,7 @@ DISTCLEANFILES = intltool-extract intltool-merge intltool-update pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = NetworkManager.pc -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} +DISTCHECK_CONFIGURE_FLAGS = --enable-more-warnings=error CLEANFILES = cscope.in.out cscope.out cscope.po.out diff --git a/autogen.sh b/autogen.sh index 141bcf120..5ec9a5aa8 100755 --- a/autogen.sh +++ b/autogen.sh @@ -28,5 +28,5 @@ AUTOPOINT='intltoolize --automake --copy' autoreconf --force --install --verbose cd $olddir if test -z "$NOCONFIGURE"; then - exec $srcdir/configure --enable-maintainer-mode "$@" + exec $srcdir/configure --enable-maintainer-mode --enable-more-warnings=error "$@" fi diff --git a/configure.ac b/configure.ac index 5f2eb2e85..442f25abd 100644 --- a/configure.ac +++ b/configure.ac @@ -364,12 +364,19 @@ AS_IF([test "$with_session_tracking" = "none"], [use_consolekit="no" use_systemd AS_IF([test -n "$with_systemd_logind" ], [use_systemd_logind="$with_systemd_logind"]) AS_IF([test -n "$with_consolekit" ], [use_consolekit="$with_consolekit"]) # defaults -AS_IF([test -z "$use_systemd_logind"], [use_systemd_logind="yes"]) +AS_IF([test -z "$use_systemd_logind"], [use_systemd_logind="auto"]) AS_IF([test -z "$use_consolekit"], [use_consolekit="yes"]) # output session_tracking= -if test "$use_systemd_logind" = "yes"; then - PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd], , [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login])]) +if test "$use_systemd_logind" = "yes" -o "$use_systemd_logind" = "auto"; then + PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd], [have_systemd_logind=yes], [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login], [have_systemd_logind=yes], [have_systemd_logind=no])]) +else + have_systemd_logind=no +fi +if test "$use_systemd_logind" = "yes" -a "$have_systemd_logind" = "no"; then + AC_MSG_ERROR([You must have libsystemd installed to build with systemd-logind support.]) +fi +if test "$have_systemd_logind" = "yes"; then AC_SUBST(SYSTEMD_LOGIN_CFLAGS) AC_SUBST(SYSTEMD_LOGIN_LIBS) AC_DEFINE([SESSION_TRACKING_SYSTEMD], 1, [Define to 1 if libsystemd-login is available]) diff --git a/libnm-core/nm-dbus-utils.c b/libnm-core/nm-dbus-utils.c index 1f1e20ced..4bdbdd094 100644 --- a/libnm-core/nm-dbus-utils.c +++ b/libnm-core/nm-dbus-utils.c @@ -24,6 +24,7 @@ #include #include +#include "nm-glib-compat.h" #include "nm-core-internal.h" typedef struct { diff --git a/libnm-core/nm-setting.c b/libnm-core/nm-setting.c index b78d9376f..0791b0d19 100644 --- a/libnm-core/nm-setting.c +++ b/libnm-core/nm-setting.c @@ -91,7 +91,7 @@ _nm_gtype_hash (gconstpointer v) return *((const GType *) v); } -static void __attribute__((constructor)) +static void _ensure_registered (void) { if (G_UNLIKELY (registered_settings == NULL)) { @@ -103,6 +103,12 @@ _ensure_registered (void) } } +static void __attribute__((constructor)) +_ensure_registered_constructor (void) +{ + _ensure_registered (); +} + #define _ensure_setting_info(self, priv) \ G_STMT_START { \ NMSettingPrivate *_priv_esi = (priv); \ diff --git a/libnm-util/nm-setting.c b/libnm-util/nm-setting.c index 105981bc3..35ae01daf 100644 --- a/libnm-util/nm-setting.c +++ b/libnm-util/nm-setting.c @@ -99,7 +99,7 @@ _nm_gtype_hash (gconstpointer v) return *((const GType *) v); } -static void __attribute__((constructor)) +static void _ensure_registered (void) { if (G_UNLIKELY (registered_settings == NULL)) { @@ -112,6 +112,12 @@ _ensure_registered (void) } } +static void __attribute__((constructor)) +_ensure_registered_constructor (void) +{ + _ensure_registered (); +} + #define _ensure_setting_info(self, priv) \ G_STMT_START { \ NMSettingPrivate *_priv_esi = (priv); \ diff --git a/m4/compiler_warnings.m4 b/m4/compiler_warnings.m4 index 5c8d20777..a1c4e1288 100644 --- a/m4/compiler_warnings.m4 +++ b/m4/compiler_warnings.m4 @@ -22,7 +22,7 @@ AC_DEFUN([NM_COMPILER_WARNING], [ AC_DEFUN([NM_COMPILER_WARNINGS], [AC_ARG_ENABLE(more-warnings, AS_HELP_STRING([--enable-more-warnings], [Possible values: no/yes/error]), - set_more_warnings="$enableval",set_more_warnings=error) + set_more_warnings="$enableval",set_more_warnings=yes) AC_MSG_CHECKING(for more warnings) if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then AC_MSG_RESULT(yes) diff --git a/src/main-utils.c b/src/main-utils.c index 1d899587e..5378ca97a 100644 --- a/src/main-utils.c +++ b/src/main-utils.c @@ -34,6 +34,8 @@ #include #include +#include "nm-glib-compat.h" + #include "gsystem-local-alloc.h" #include "main-utils.h" #include "NetworkManagerUtils.h" diff --git a/src/nm-connectivity.c b/src/nm-connectivity.c index 1dfcf00b1..f7e7576c2 100644 --- a/src/nm-connectivity.c +++ b/src/nm-connectivity.c @@ -26,6 +26,8 @@ #include #endif +#include "nm-glib-compat.h" + #include "nm-connectivity.h" #include "nm-config.h" #include "nm-logging.h" diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c index e27c82b70..d410ebfab 100644 --- a/src/ppp-manager/nm-ppp-manager.c +++ b/src/ppp-manager/nm-ppp-manager.c @@ -39,6 +39,7 @@ #ifndef aligned_u64 #define aligned_u64 unsigned long long __attribute__((aligned(8))) #endif +#include #include #include "NetworkManagerUtils.h" diff --git a/src/settings/plugins/keyfile/writer.c b/src/settings/plugins/keyfile/writer.c index 9cf119c0c..b6a8786dc 100644 --- a/src/settings/plugins/keyfile/writer.c +++ b/src/settings/plugins/keyfile/writer.c @@ -27,6 +27,8 @@ #include #include +#include "nm-glib-compat.h" + #include "nm-logging.h" #include "writer.h" #include "common.h" diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c index d07e23aea..083f2ebcb 100644 --- a/src/supplicant-manager/nm-supplicant-manager.c +++ b/src/supplicant-manager/nm-supplicant-manager.c @@ -25,6 +25,8 @@ #include #include +#include "nm-glib-compat.h" + #include "nm-supplicant-manager.h" #include "nm-supplicant-interface.h" #include "nm-logging.h" diff --git a/src/systemd/nm-sd-adapt.h b/src/systemd/nm-sd-adapt.h index 049b535c4..929ddc637 100644 --- a/src/systemd/nm-sd-adapt.h +++ b/src/systemd/nm-sd-adapt.h @@ -41,6 +41,11 @@ #include "nm-logging.h" +/* Missing in Linux 3.2.0, in Ubuntu 12.04 */ +#ifndef BPF_XOR +#define BPF_XOR 0xa0 +#endif + /*****************************************************************************/ static inline NMLogLevel diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py index 50803c887..6035fecd5 100755 --- a/tools/test-networkmanager-service.py +++ b/tools/test-networkmanager-service.py @@ -1148,7 +1148,7 @@ def main(): sys.exit(1) # Watch stdin; if it closes, assume our parent has crashed, and exit - io = GLib.IOChannel.unix_new(0) + io = GLib.IOChannel(0) io.add_watch(GLib.IOCondition.HUP, stdin_cb) # also quit after inactivity to ensure we don't stick around if the above fails somehow