build: disable deprecation checks for internal compilation

For internal compilation we want to be able to use deprecated
API without warnings.

Define the version min/max macros to effectively disable deprecation
warnings.

However, don't do it via CFLAGS option in the makefiles, instead hack it
to "nm-default.h". After all, *every* source file that is for internal
compilation needs to include this header as first.
This commit is contained in:
Thomas Haller
2016-04-05 21:18:43 +02:00
committed by Lubomir Rintel
parent 29cfb144a8
commit 9152dec99f
44 changed files with 11 additions and 42 deletions

View File

@@ -7,7 +7,6 @@ AM_CPPFLAGS = \
-I${top_builddir}/libnm-core \
$(GLIB_CFLAGS) \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DNMCONFDIR=\"$(nmconfdir)\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\"

View File

@@ -8,7 +8,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/callouts \
-I$(top_builddir)/callouts \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DSRCDIR=\"$(abs_srcdir)\" \
$(GLIB_CFLAGS)

View File

@@ -8,7 +8,6 @@ AM_CPPFLAGS = \
-I${top_srcdir}/libnm \
-I${top_builddir}/libnm \
$(GLIB_CFLAGS) \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DNMLOCALEDIR=\"$(datadir)/locale\"
bin_PROGRAMS = nm-online

View File

@@ -15,7 +15,6 @@ AM_CPPFLAGS = \
-I${top_srcdir}/clients/common \
$(GLIB_CFLAGS) \
-DG_LOG_DOMAIN=\""nmcli"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DNMCLI_LOCALEDIR=\"$(datadir)/locale\"
nmcli_SOURCES = \

View File

@@ -16,7 +16,6 @@ AM_CPPFLAGS= \
$(NEWT_CFLAGS) \
$(GUDEV_CFLAGS) \
-DG_LOG_DOMAIN=\""nmtui"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DLOCALEDIR=\""$(localedir)"\" \
$(NULL)

View File

@@ -60,6 +60,7 @@ GTKDOC_CFLAGS = \
-I$(top_srcdir)/libnm-glib \
-I$(top_builddir)/libnm-glib \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS)

View File

@@ -55,6 +55,7 @@ extra_files =
GTKDOC_CFLAGS = \
-I$(top_srcdir)/libnm-util \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS)

View File

@@ -77,6 +77,7 @@ GTKDOC_CFLAGS = \
-I$(top_srcdir)/libnm \
-I$(top_builddir)/libnm \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DNM_VERSION_MIN_REQUIRED=NM_VERSION_0_9_8 \
$(GLIB_CFLAGS)
GTKDOC_LIBS = \

View File

@@ -12,7 +12,6 @@ AM_CPPFLAGS = \
-DNMCONFDIR=\"$(nmconfdir)\" \
-DNMLIBDIR=\"$(nmlibdir)\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(CODE_COVERAGE_CFLAGS)

View File

@@ -17,7 +17,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DNETWORKMANAGER_COMPILATION \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
-DTEST_CERT_DIR=\"$(certsdir)\"

View File

@@ -9,7 +9,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/libnm-util \
-DG_LOG_DOMAIN=\""libnm-glib"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(DBUS_CFLAGS) \
$(GLIB_CFLAGS)

View File

@@ -7,7 +7,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/libnm-glib \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DTEST_NM_SERVICE=\"$(abs_top_srcdir)/tools/test-networkmanager-service.py\" \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS)

View File

@@ -9,7 +9,6 @@ AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\""libnm-util"\" \
-DLOCALEDIR=\"$(datadir)/locale\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB_LEGACY \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
$(UUID_CFLAGS)

View File

@@ -5,7 +5,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/shared \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(DBUS_CFLAGS) \
-DBUILD_DIR=\"$(abs_builddir)\" \

View File

@@ -14,7 +14,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/libnm \
-DG_LOG_DOMAIN=\""libnm"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(GUDEV_CFLAGS) \
-DNMRUNDIR=\"$(nmrundir)\" \
@@ -133,7 +132,7 @@ libnm_la_SOURCES = \
GLIB_GENERATED = nm-enum-types.h nm-enum-types.c
nm_enum_types_sources = $(libnminclude_HEADERS)
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM --fhead '\#include <nm-core-enum-types.h>\n'
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM --fhead '\#include "nm-default.h"\n'
libnm_la_LIBADD = \
$(top_builddir)/libnm-core/libnm-core.la \

View File

@@ -8,7 +8,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DTEST_NM_SERVICE=\"$(abs_top_srcdir)/tools/test-networkmanager-service.py\" \
$(GLIB_CFLAGS)

View File

@@ -46,6 +46,12 @@
#include <config.h>
#endif
/* for internal compilation we don't want the deprecation macros
* to be in effect. Define the widest range of versions to effectively
* disable deprecation checks */
#define NM_VERSION_MAX_ALLOWED NM_VERSION_NEXT_STABLE
#define NM_VERSION_MIN_REQUIRED NM_VERSION_0_9_8
#include <stdlib.h>
#include "nm-glib.h"

View File

@@ -41,8 +41,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/callouts \
-DPREFIX=\"$(prefix)\" \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON
# add each subdirectory that contains a libNM source file. $(sort) is being used
# primarily for its side effect of removing duplicates.

View File

@@ -14,7 +14,6 @@ AM_CPPFLAGS = \
-I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-adsl"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GUDEV_CFLAGS)
pkglib_LTLIBRARIES = libnm-device-plugin-adsl.la

View File

@@ -16,7 +16,6 @@ AM_CPPFLAGS = \
-I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-bluetooth"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS)
GLIB_GENERATED = nm-bt-enum-types.h nm-bt-enum-types.c

View File

@@ -14,7 +14,6 @@ AM_CPPFLAGS = \
-I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-team"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS)
if WITH_TEAMDCTL

View File

@@ -12,7 +12,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/src \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS)
AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)

View File

@@ -20,7 +20,6 @@ AM_CPPFLAGS = \
-I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS)
pkglib_LTLIBRARIES = libnm-device-plugin-wifi.la

View File

@@ -10,7 +10,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/src \
-DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS)
noinst_PROGRAMS = test-wifi-ap-utils

View File

@@ -15,7 +15,6 @@ AM_CPPFLAGS = \
-I${top_builddir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-wwan"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(MM_GLIB_CFLAGS)

View File

@@ -9,7 +9,6 @@ nm_dhcp_helper_CPPFLAGS = \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DG_LOG_DOMAIN=\""nm-dhcp-helper"\" \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DNMRUNDIR=\"$(nmrundir)\"
nm_dhcp_helper_LDADD = $(GLIB_LIBS)

View File

@@ -8,7 +8,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/platform \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
-DTESTDIR="\"$(abs_srcdir)\""

View File

@@ -8,7 +8,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/platform \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
-DTESTDIR="\"$(abs_srcdir)\""

View File

@@ -9,7 +9,6 @@ AM_CPPFLAGS = \
-I${srcdir}/.. \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(GUDEV_CFLAGS) \
$(LIBNL_CFLAGS)

View File

@@ -8,7 +8,6 @@ AM_CPPFLAGS = \
-I${top_builddir}/libnm-core \
-DG_LOG_DOMAIN=\""nm-pppd-plugin"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS)
pppd_plugindir = $(PPPD_PLUGIN_DIR)

View File

@@ -9,7 +9,6 @@ AM_CPPFLAGS = \
-I${srcdir}/.. \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(LIBNDP_CFLAGS)

View File

@@ -19,7 +19,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
-DG_LOG_DOMAIN=\""NetworkManager-ibft"\" \
-DSYSCONFDIR=\"$(sysconfdir)\" \

View File

@@ -15,7 +15,6 @@ AM_CPPFLAGS = \
-I$(srcdir)/../ \
-DG_LOG_DOMAIN=\""NetworkManager-ibft"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DTEST_IBFT_DIR=\"$(abs_srcdir)\" \
-DTEST_SCRATCH_DIR=\"$(abs_builddir)/\"

View File

@@ -48,7 +48,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(NSS_CFLAGS) \
-DG_LOG_DOMAIN=\""NetworkManager-ifcfg-rh"\" \

View File

@@ -17,7 +17,6 @@ AM_CPPFLAGS = \
-I$(srcdir)/../ \
-DG_LOG_DOMAIN=\""NetworkManager-ifcfg-rh"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DTEST_IFCFG_DIR=\"$(abs_srcdir)\" \
-DTEST_SCRATCH_DIR=\"$(abs_builddir)/\" \
-DSYSCONFDIR=\"nonexistent\" \

View File

@@ -12,7 +12,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-ifnet"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
-DSYSCONFDIR=\"$(sysconfdir)\"
-DSBINDIR=\"$(sbindir)\"

View File

@@ -13,7 +13,6 @@ AM_CPPFLAGS= \
-I$(top_srcdir)/src/platform \
-DG_LOG_DOMAIN=\""NetworkManager-ifnet"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(CHECK_CFLAGS) \
$(GLIB_CFLAGS) \
$(CODE_COVERAGE_CFLAGS) \

View File

@@ -11,7 +11,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-ifupdown"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
$(GUDEV_CFLAGS) \
-DSYSCONFDIR=\"$(sysconfdir)\"

View File

@@ -10,7 +10,6 @@ AM_CPPFLAGS = \
-I$(srcdir)/../ \
-DG_LOG_DOMAIN=\""NetworkManager-ifupdown"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
-DTEST_ENI_DIR=\"$(abs_srcdir)\"

View File

@@ -11,7 +11,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-keyfile"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
-DNMCONFDIR=\"$(nmconfdir)\"

View File

@@ -16,7 +16,6 @@ AM_CPPFLAGS = \
$(CODE_COVERAGE_CFLAGS) \
-DG_LOG_DOMAIN=\""NetworkManager-keyfile"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DTEST_KEYFILES_DIR=\"$(abs_srcdir)/keyfiles\" \
-DTEST_SCRATCH_DIR=\"$(abs_builddir)/keyfiles\" \
-DNMCONFDIR=\"nonexistent\"

View File

@@ -9,7 +9,6 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/supplicant-manager \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DTEST_CERT_DIR=\"$(srcdir)/certs/\" \
$(GLIB_CFLAGS)

View File

@@ -12,7 +12,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/src \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS)
noinst_PROGRAMS = \

View File

@@ -8,7 +8,6 @@ AM_CPPFLAGS = \
-I${top_srcdir}/src/platform \
-DG_LOG_DOMAIN=\""NetworkManager"\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
$(GLIB_CFLAGS) \
-DSRCDIR=\""$(srcdir)"\" \
-DBUILDDIR=\""$(builddir)"\"