merge: fix build & tests with older tooling

This commit is contained in:
Lubomir Rintel
2015-06-02 12:30:51 +02:00
14 changed files with 43 additions and 9 deletions

View File

@@ -59,7 +59,7 @@ DISTCLEANFILES = intltool-extract intltool-merge intltool-update
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = NetworkManager.pc 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 CLEANFILES = cscope.in.out cscope.out cscope.po.out

View File

@@ -28,5 +28,5 @@ AUTOPOINT='intltoolize --automake --copy' autoreconf --force --install --verbose
cd $olddir cd $olddir
if test -z "$NOCONFIGURE"; then if test -z "$NOCONFIGURE"; then
exec $srcdir/configure --enable-maintainer-mode "$@" exec $srcdir/configure --enable-maintainer-mode --enable-more-warnings=error "$@"
fi fi

View File

@@ -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_systemd_logind" ], [use_systemd_logind="$with_systemd_logind"])
AS_IF([test -n "$with_consolekit" ], [use_consolekit="$with_consolekit"]) AS_IF([test -n "$with_consolekit" ], [use_consolekit="$with_consolekit"])
# defaults # 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"]) AS_IF([test -z "$use_consolekit"], [use_consolekit="yes"])
# output # output
session_tracking= session_tracking=
if test "$use_systemd_logind" = "yes"; then if test "$use_systemd_logind" = "yes" -o "$use_systemd_logind" = "auto"; then
PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd], , [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login])]) 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_CFLAGS)
AC_SUBST(SYSTEMD_LOGIN_LIBS) AC_SUBST(SYSTEMD_LOGIN_LIBS)
AC_DEFINE([SESSION_TRACKING_SYSTEMD], 1, [Define to 1 if libsystemd-login is available]) AC_DEFINE([SESSION_TRACKING_SYSTEMD], 1, [Define to 1 if libsystemd-login is available])

View File

@@ -24,6 +24,7 @@
#include <gio/gio.h> #include <gio/gio.h>
#include <glib/gi18n-lib.h> #include <glib/gi18n-lib.h>
#include "nm-glib-compat.h"
#include "nm-core-internal.h" #include "nm-core-internal.h"
typedef struct { typedef struct {

View File

@@ -91,7 +91,7 @@ _nm_gtype_hash (gconstpointer v)
return *((const GType *) v); return *((const GType *) v);
} }
static void __attribute__((constructor)) static void
_ensure_registered (void) _ensure_registered (void)
{ {
if (G_UNLIKELY (registered_settings == NULL)) { 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) \ #define _ensure_setting_info(self, priv) \
G_STMT_START { \ G_STMT_START { \
NMSettingPrivate *_priv_esi = (priv); \ NMSettingPrivate *_priv_esi = (priv); \

View File

@@ -99,7 +99,7 @@ _nm_gtype_hash (gconstpointer v)
return *((const GType *) v); return *((const GType *) v);
} }
static void __attribute__((constructor)) static void
_ensure_registered (void) _ensure_registered (void)
{ {
if (G_UNLIKELY (registered_settings == NULL)) { 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) \ #define _ensure_setting_info(self, priv) \
G_STMT_START { \ G_STMT_START { \
NMSettingPrivate *_priv_esi = (priv); \ NMSettingPrivate *_priv_esi = (priv); \

View File

@@ -22,7 +22,7 @@ AC_DEFUN([NM_COMPILER_WARNING], [
AC_DEFUN([NM_COMPILER_WARNINGS], AC_DEFUN([NM_COMPILER_WARNINGS],
[AC_ARG_ENABLE(more-warnings, [AC_ARG_ENABLE(more-warnings,
AS_HELP_STRING([--enable-more-warnings], [Possible values: no/yes/error]), 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) AC_MSG_CHECKING(for more warnings)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)

View File

@@ -34,6 +34,8 @@
#include <glib-unix.h> #include <glib-unix.h>
#include <gmodule.h> #include <gmodule.h>
#include "nm-glib-compat.h"
#include "gsystem-local-alloc.h" #include "gsystem-local-alloc.h"
#include "main-utils.h" #include "main-utils.h"
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"

View File

@@ -26,6 +26,8 @@
#include <libsoup/soup.h> #include <libsoup/soup.h>
#endif #endif
#include "nm-glib-compat.h"
#include "nm-connectivity.h" #include "nm-connectivity.h"
#include "nm-config.h" #include "nm-config.h"
#include "nm-logging.h" #include "nm-logging.h"

View File

@@ -39,6 +39,7 @@
#ifndef aligned_u64 #ifndef aligned_u64
#define aligned_u64 unsigned long long __attribute__((aligned(8))) #define aligned_u64 unsigned long long __attribute__((aligned(8)))
#endif #endif
#include <linux/if.h>
#include <linux/if_ppp.h> #include <linux/if_ppp.h>
#include "NetworkManagerUtils.h" #include "NetworkManagerUtils.h"

View File

@@ -27,6 +27,8 @@
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include "nm-glib-compat.h"
#include "nm-logging.h" #include "nm-logging.h"
#include "writer.h" #include "writer.h"
#include "common.h" #include "common.h"

View File

@@ -25,6 +25,8 @@
#include <glib.h> #include <glib.h>
#include <dbus/dbus.h> #include <dbus/dbus.h>
#include "nm-glib-compat.h"
#include "nm-supplicant-manager.h" #include "nm-supplicant-manager.h"
#include "nm-supplicant-interface.h" #include "nm-supplicant-interface.h"
#include "nm-logging.h" #include "nm-logging.h"

View File

@@ -41,6 +41,11 @@
#include "nm-logging.h" #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 static inline NMLogLevel

View File

@@ -1148,7 +1148,7 @@ def main():
sys.exit(1) sys.exit(1)
# Watch stdin; if it closes, assume our parent has crashed, and exit # 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) io.add_watch(GLib.IOCondition.HUP, stdin_cb)
# also quit after inactivity to ensure we don't stick around if the above fails somehow # also quit after inactivity to ensure we don't stick around if the above fails somehow