summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-09-25 16:07:50 +0200
committerThomas Haller <thaller@redhat.com>2015-09-30 23:10:29 +0200
commit7bf10a75db84655e65fe6216d248f7775c58ca23 (patch)
tree8fbd9fe0f4a9e02c86662faeb364743c70964d08
parentb861900d45da588f4239be418c3e1f62505cbde1 (diff)
downloadNetworkManager-7bf10a75db84655e65fe6216d248f7775c58ca23.tar.gz
build: extract version macros from "nm-version.h" to new header file "nm-version-macros.h"
For libnm library, "nm-dbus-interface.h" contains defines like the D-Bus paths of NetworkManager. It is desirable to have this header usable without having a dependency on "glib.h", for example for a QT application. For that, commit c0852964a890cf43cc2dcaeff41ac6edc5028f24 removed that dependancy. For libnm-glib library, the analog to "nm-dbus-interface.h" is "NetworkManager.h", and the same applies there. Commit 159e827a72f420048e12d318f8ba1edd3f641fc8 removed that include. However, that broke build on PackageKit [1] which expected to get the version macros by including "NetworkManager.h". So at least for libnm-glib, we need to preserve old behavior so that a user including "NetworkManager.h" gets the version macros, but not "glib.h". Extract the version macros to a new header file "nm-version-macros.h". This header doesn't include "glib.h" and can be included from "NetworkManager.h". This gives as previous behavior and a glib-free include. For libnm we still don't include "nm-version-macros.h" to "nm-dbus-interface.h". Very few users will actually need the version macros, but not using libnm. Users that use libnm, should just include (libnm's) "NetworkManager.h" to get all headers. As a special case, a user who doesn't want to use glib/libnm, but still needs both "nm-dbus-interface.h" and "nm-version-macros.h", can include them both separately. [1] https://github.com/hughsie/PackageKit/issues/85 Fixes: 4545a7fe9670ce4d7c259c11c2cc853bfae6729b
-rw-r--r--.gitignore4
-rw-r--r--callouts/Makefile.am1
-rw-r--r--callouts/tests/Makefile.am1
-rw-r--r--clients/Makefile.am3
-rw-r--r--clients/cli/Makefile.am1
-rw-r--r--clients/tui/Makefile.am1
-rw-r--r--clients/tui/newt/Makefile.am1
-rw-r--r--configure.ac3
-rw-r--r--contrib/fedora/rpm/NetworkManager.spec1
-rw-r--r--docs/libnm-glib/Makefile.am2
-rw-r--r--examples/C/glib/Makefile.am1
-rw-r--r--include/Makefile.am3
-rw-r--r--include/nm-version-macros.h.in75
-rw-r--r--libnm-core/Makefile.am3
-rw-r--r--libnm-core/Makefile.libnm-core3
-rw-r--r--libnm-core/nm-dbus-interface.h2
-rw-r--r--libnm-core/nm-version.h (renamed from libnm-util/nm-version.h.in)51
-rw-r--r--libnm-core/tests/Makefile.am1
-rw-r--r--libnm-glib/Makefile.am1
-rw-r--r--libnm-glib/tests/Makefile.am1
-rw-r--r--libnm-util/Makefile.am10
-rw-r--r--libnm-util/NetworkManager.h4
-rw-r--r--libnm-util/nm-version.h (renamed from libnm-core/nm-version.h.in)49
-rw-r--r--libnm-util/tests/Makefile.am1
-rw-r--r--libnm/Makefile.am2
-rw-r--r--libnm/tests/Makefile.am1
-rw-r--r--src/Makefile.am2
-rw-r--r--src/devices/adsl/Makefile.am1
-rw-r--r--src/devices/bluetooth/Makefile.am1
-rw-r--r--src/devices/team/Makefile.am1
-rw-r--r--src/devices/wifi/Makefile.am1
-rw-r--r--src/devices/wifi/tests/Makefile.am1
-rw-r--r--src/devices/wwan/Makefile.am3
-rw-r--r--src/dhcp-manager/Makefile.am1
-rw-r--r--src/dhcp-manager/tests/Makefile.am1
-rw-r--r--src/dnsmasq-manager/tests/Makefile.am1
-rw-r--r--src/platform/tests/Makefile.am1
-rw-r--r--src/ppp-manager/Makefile.am1
-rw-r--r--src/rdisc/tests/Makefile.am1
-rw-r--r--src/settings/plugins/ibft/Makefile.am1
-rw-r--r--src/settings/plugins/ibft/tests/Makefile.am1
-rw-r--r--src/settings/plugins/ifcfg-rh/Makefile.am1
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/Makefile.am1
-rw-r--r--src/settings/plugins/ifnet/Makefile.am1
-rw-r--r--src/settings/plugins/ifnet/tests/Makefile.am1
-rw-r--r--src/settings/plugins/ifupdown/Makefile.am1
-rw-r--r--src/settings/plugins/ifupdown/tests/Makefile.am1
-rw-r--r--src/settings/plugins/keyfile/Makefile.am1
-rw-r--r--src/settings/plugins/keyfile/tests/Makefile.am1
-rw-r--r--src/supplicant-manager/tests/Makefile.am1
-rw-r--r--src/tests/Makefile.am1
-rw-r--r--src/tests/config/Makefile.am1
52 files changed, 144 insertions, 111 deletions
diff --git a/.gitignore b/.gitignore
index 42c1f33849..f365e956f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -136,6 +136,8 @@ test-*.trs
/examples/C/qt/list-connections
/examples/C/qt/change-ipv4-addresses
+/include/nm-version-macros.h
+
/initscript/Slackware/rc.networkmanager
/initscript/*/[Nn]etwork[Mm]anager
@@ -145,7 +147,6 @@ test-*.trs
/libgsystem/
-/libnm-core/nm-version.h
/libnm-core/tests/test-compare
/libnm-core/tests/test-crypto
/libnm-core/tests/test-settings-defaults
@@ -162,7 +163,6 @@ test-*.trs
/libnm-glib/tests/test-nm-client
/libnm-glib/tests/test-remote-settings-client
-/libnm-util/nm-version.h
/libnm-util/test-crypto
/libnm-util/tests/test-crypto
/libnm-util/tests/test-settings-defaults
diff --git a/callouts/Makefile.am b/callouts/Makefile.am
index a2d574c66b..3708aebbdf 100644
--- a/callouts/Makefile.am
+++ b/callouts/Makefile.am
@@ -2,6 +2,7 @@ SUBDIRS = . tests
AM_CPPFLAGS = \
-I${top_srcdir}/include \
+ -I${top_builddir}/include \
-I${top_srcdir}/libnm-core \
-I${top_builddir}/libnm-core \
$(GLIB_CFLAGS) \
diff --git a/callouts/tests/Makefile.am b/callouts/tests/Makefile.am
index 9e851805a0..30b73b17ca 100644
--- a/callouts/tests/Makefile.am
+++ b/callouts/tests/Makefile.am
@@ -2,6 +2,7 @@ if ENABLE_TESTS
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I$(top_srcdir)/callouts \
diff --git a/clients/Makefile.am b/clients/Makefile.am
index e30eb5d8eb..8316dcc0ed 100644
--- a/clients/Makefile.am
+++ b/clients/Makefile.am
@@ -1,11 +1,12 @@
SUBDIRS = cli tui
AM_CPPFLAGS = \
+ -I${top_srcdir}/include \
+ -I$(top_builddir)/include \
-I${top_srcdir}/libnm-core \
-I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm \
-I${top_builddir}/libnm \
- -I${top_srcdir}/include \
$(GLIB_CFLAGS) \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
-DNMLOCALEDIR=\"$(datadir)/locale\"
diff --git a/clients/cli/Makefile.am b/clients/cli/Makefile.am
index 75c00a998d..eef99cba71 100644
--- a/clients/cli/Makefile.am
+++ b/clients/cli/Makefile.am
@@ -5,6 +5,7 @@ AM_CPPFLAGS = \
-I${top_srcdir} \
-I${top_builddir} \
-I${top_srcdir}/include \
+ -I$(top_builddir)/include \
-I${top_srcdir}/libnm-core \
-I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm \
diff --git a/clients/tui/Makefile.am b/clients/tui/Makefile.am
index ad9335daf8..f6d93be2b4 100644
--- a/clients/tui/Makefile.am
+++ b/clients/tui/Makefile.am
@@ -5,6 +5,7 @@ SUBDIRS = newt .
AM_CPPFLAGS= \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I$(top_srcdir)/libnm \
diff --git a/clients/tui/newt/Makefile.am b/clients/tui/newt/Makefile.am
index 4633212ce4..9413e96087 100644
--- a/clients/tui/newt/Makefile.am
+++ b/clients/tui/newt/Makefile.am
@@ -1,5 +1,6 @@
AM_CPPFLAGS= \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DG_LOG_DOMAIN=\""nmtui"\" \
diff --git a/configure.ac b/configure.ac
index d4f673f217..16ffa4f876 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1007,6 +1007,7 @@ AM_CONDITIONAL(SETTING_DOCS_AVAILABLE, test "$build_setting_docs" = "yes" -o "$h
AC_CONFIG_FILES([
Makefile
include/Makefile
+include/nm-version-macros.h
src/Makefile
src/tests/Makefile
src/tests/config/Makefile
@@ -1039,14 +1040,12 @@ src/devices/team/Makefile
src/devices/wifi/Makefile
src/devices/wifi/tests/Makefile
src/devices/wwan/Makefile
-libnm-core/nm-version.h
libnm-core/Makefile
libnm-core/tests/Makefile
libnm/libnm.pc
libnm/Makefile
libnm/tests/Makefile
libnm-util/libnm-util.pc
-libnm-util/nm-version.h
libnm-util/Makefile
libnm-util/tests/Makefile
libnm-glib/libnm-glib.pc
diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec
index 0fe856aa71..aa488cbd72 100644
--- a/contrib/fedora/rpm/NetworkManager.spec
+++ b/contrib/fedora/rpm/NetworkManager.spec
@@ -562,6 +562,7 @@ fi
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/%{name}.h
%{_includedir}/%{name}/NetworkManagerVPN.h
+%{_includedir}/%{name}/nm-version-macros.h
%{_includedir}/%{name}/nm-version.h
%{_libdir}/pkgconfig/%{name}.pc
%dir %{_datadir}/gtk-doc/html/NetworkManager
diff --git a/docs/libnm-glib/Makefile.am b/docs/libnm-glib/Makefile.am
index 5c3c492ffc..2d78856103 100644
--- a/docs/libnm-glib/Makefile.am
+++ b/docs/libnm-glib/Makefile.am
@@ -53,6 +53,8 @@ extra_files = libnm-glib.png
# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
GTKDOC_CFLAGS = \
+ -I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/libnm-glib \
diff --git a/examples/C/glib/Makefile.am b/examples/C/glib/Makefile.am
index d8e5d2853e..4b03d87f5e 100644
--- a/examples/C/glib/Makefile.am
+++ b/examples/C/glib/Makefile.am
@@ -1,5 +1,6 @@
AM_CPPFLAGS = \
-I${top_srcdir}/include \
+ -I$(top_builddir)/include \
-I${top_srcdir}/libnm-core \
-I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm \
diff --git a/include/Makefile.am b/include/Makefile.am
index 2ebd172838..f0a1dba963 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -4,6 +4,7 @@ EXTRA_DIST = \
nm-default.h \
nm-glib.h \
nm-test-utils.h \
- nm-macros-internal.h
+ nm-macros-internal.h \
+ nm-version-macros.h.in
CLEANFILES=nm-version.h
diff --git a/include/nm-version-macros.h.in b/include/nm-version-macros.h.in
new file mode 100644
index 0000000000..a8ad5c8d6e
--- /dev/null
+++ b/include/nm-version-macros.h.in
@@ -0,0 +1,75 @@
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ *
+ * Copyright 2011, 2015 Red Hat, Inc.
+ */
+
+#ifndef __NM_VERSION_MACROS_H__
+#define __NM_VERSION_MACROS_H__
+
+/* This header must not include glib or libnm. */
+
+/**
+ * NM_MAJOR_VERSION:
+ *
+ * Evaluates to the major version number of NetworkManager which this source
+ * is compiled against.
+ */
+#define NM_MAJOR_VERSION (@NM_MAJOR_VERSION@)
+
+/**
+ * NM_MINOR_VERSION:
+ *
+ * Evaluates to the minor version number of NetworkManager which this source
+ * is compiled against.
+ */
+#define NM_MINOR_VERSION (@NM_MINOR_VERSION@)
+
+/**
+ * NM_MICRO_VERSION:
+ *
+ * Evaluates to the micro version number of NetworkManager which this source
+ * compiled against.
+ */
+#define NM_MICRO_VERSION (@NM_MICRO_VERSION@)
+
+/**
+ * NM_CHECK_VERSION:
+ * @major: major version (e.g. 1 for version 1.2.5)
+ * @minor: minor version (e.g. 2 for version 1.2.5)
+ * @micro: micro version (e.g. 5 for version 1.2.5)
+ *
+ * Returns: %TRUE if the version of the NetworkManager header files
+ * is the same as or newer than the passed-in version.
+ */
+#define NM_CHECK_VERSION(major,minor,micro) \
+ (NM_MAJOR_VERSION > (major) || \
+ (NM_MAJOR_VERSION == (major) && NM_MINOR_VERSION > (minor)) || \
+ (NM_MAJOR_VERSION == (major) && NM_MINOR_VERSION == (minor) && NM_MICRO_VERSION >= (micro)))
+
+
+#define NM_ENCODE_VERSION(major,minor,micro) ((major) << 16 | (minor) << 8 | (micro))
+
+#define NM_VERSION_0_9_8 (NM_ENCODE_VERSION (0, 9, 8))
+#define NM_VERSION_0_9_10 (NM_ENCODE_VERSION (0, 9, 10))
+#define NM_VERSION_1_0 (NM_ENCODE_VERSION (1, 0, 0))
+#define NM_VERSION_1_2 (NM_ENCODE_VERSION (1, 2, 0))
+
+#define NM_VERSION_CUR_STABLE NM_VERSION_1_0
+#define NM_VERSION_NEXT_STABLE NM_VERSION_1_2
+
+#endif /* __NM_VERSION_MACROS_H__ */
diff --git a/libnm-core/Makefile.am b/libnm-core/Makefile.am
index 470fd9af64..55ed2f6ab6 100644
--- a/libnm-core/Makefile.am
+++ b/libnm-core/Makefile.am
@@ -4,6 +4,7 @@ SUBDIRS = . tests
AM_CPPFLAGS = \
-I${top_srcdir}/include \
+ -I${top_builddir}/include \
-DG_LOG_DOMAIN=\""libnm"\" \
-DLOCALEDIR=\"$(datadir)/locale\" \
-DNMCONFDIR=\"$(nmconfdir)\" \
@@ -26,7 +27,7 @@ libnm_core_la_SOURCES = \
$(libnm_core_private_headers)
GLIB_GENERATED = nm-core-enum-types.h nm-core-enum-types.c
-nm_core_enum_types_sources = $(notdir $(libnminclude_HEADERS))
+nm_core_enum_types_sources = $(filter-out %nm-core-enum-types.h,$(libnminclude_HEADERS))
GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
diff --git a/libnm-core/Makefile.libnm-core b/libnm-core/Makefile.libnm-core
index a3763f4e56..b5e205acef 100644
--- a/libnm-core/Makefile.libnm-core
+++ b/libnm-core/Makefile.libnm-core
@@ -6,8 +6,8 @@ core = $(top_srcdir)/libnm-core
core_build = $(top_builddir)/libnm-core
libnm_core_headers = \
+ $(top_builddir)/include/nm-version-macros.h \
$(core_build)/nm-core-enum-types.h \
- $(core_build)/nm-version.h \
$(core)/nm-connection.h \
$(core)/nm-core-types.h \
$(core)/nm-dbus-interface.h \
@@ -42,6 +42,7 @@ libnm_core_headers = \
$(core)/nm-setting.h \
$(core)/nm-simple-connection.h \
$(core)/nm-utils.h \
+ $(core)/nm-version.h \
$(core)/nm-vpn-dbus-interface.h \
$(core)/nm-vpn-editor-plugin.h \
$(core)/nm-vpn-plugin-info.h
diff --git a/libnm-core/nm-dbus-interface.h b/libnm-core/nm-dbus-interface.h
index 511cbeb00a..0dda998f79 100644
--- a/libnm-core/nm-dbus-interface.h
+++ b/libnm-core/nm-dbus-interface.h
@@ -26,6 +26,8 @@
#ifndef __NM_DBUS_INTERFACE_H__
#define __NM_DBUS_INTERFACE_H__
+/* This header must not include glib or libnm. */
+
#ifndef NM_VERSION_H
#define NM_AVAILABLE_IN_1_2
#endif
diff --git a/libnm-util/nm-version.h.in b/libnm-core/nm-version.h
index 8ae0df6a5f..859a3a8cd9 100644
--- a/libnm-util/nm-version.h.in
+++ b/libnm-core/nm-version.h
@@ -15,7 +15,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * Copyright 2011 Red Hat, Inc.
+ * Copyright 2011, 2015 Red Hat, Inc.
*/
#ifndef NM_VERSION_H
@@ -23,57 +23,10 @@
#include <glib.h>
-/**
- * NM_MAJOR_VERSION:
- *
- * Evaluates to the major version number of NetworkManager which this source
- * is compiled against.
- */
-#define NM_MAJOR_VERSION (@NM_MAJOR_VERSION@)
-
-/**
- * NM_MINOR_VERSION:
- *
- * Evaluates to the minor version number of NetworkManager which this source
- * is compiled against.
- */
-#define NM_MINOR_VERSION (@NM_MINOR_VERSION@)
-
-/**
- * NM_MICRO_VERSION:
- *
- * Evaluates to the micro version number of NetworkManager which this source
- * compiled against.
- */
-#define NM_MICRO_VERSION (@NM_MICRO_VERSION@)
-
-/**
- * NM_CHECK_VERSION:
- * @major: major version (e.g. 1 for version 1.2.5)
- * @minor: minor version (e.g. 2 for version 1.2.5)
- * @micro: micro version (e.g. 5 for version 1.2.5)
- *
- * Returns: %TRUE if the version of the NetworkManager header files
- * is the same as or newer than the passed-in version.
- */
-#define NM_CHECK_VERSION(major,minor,micro) \
- (NM_MAJOR_VERSION > (major) || \
- (NM_MAJOR_VERSION == (major) && NM_MINOR_VERSION > (minor)) || \
- (NM_MAJOR_VERSION == (major) && NM_MINOR_VERSION == (minor) && NM_MICRO_VERSION >= (micro)))
-
+#include <nm-version-macros.h>
/* Deprecation / Availability macros */
-#define NM_ENCODE_VERSION(major,minor,micro) ((major) << 16 | (minor) << 8 | (micro))
-
-#define NM_VERSION_0_9_8 (NM_ENCODE_VERSION (0, 9, 8))
-#define NM_VERSION_0_9_10 (NM_ENCODE_VERSION (0, 9, 10))
-#define NM_VERSION_1_0 (NM_ENCODE_VERSION (1, 0, 0))
-#define NM_VERSION_1_2 (NM_ENCODE_VERSION (1, 2, 0))
-
-#define NM_VERSION_CUR_STABLE NM_VERSION_1_0
-#define NM_VERSION_NEXT_STABLE NM_VERSION_1_2
-
#if !defined (NM_VERSION_MIN_REQUIRED) || (NM_VERSION_MIN_REQUIRED == 0)
# undef NM_VERSION_MIN_REQUIRED
# define NM_VERSION_MIN_REQUIRED (NM_VERSION_CUR_STABLE)
diff --git a/libnm-core/tests/Makefile.am b/libnm-core/tests/Makefile.am
index dd38b3d685..bcccfda92d 100644
--- a/libnm-core/tests/Makefile.am
+++ b/libnm-core/tests/Makefile.am
@@ -13,6 +13,7 @@ certsdir = $(srcdir)/certs
AM_CPPFLAGS = \
-I${top_srcdir}/include \
+ -I${top_builddir}/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DNETWORKMANAGER_COMPILATION \
diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am
index 179f4e61d3..53d5669e85 100644
--- a/libnm-glib/Makefile.am
+++ b/libnm-glib/Makefile.am
@@ -4,6 +4,7 @@ SUBDIRS = . tests
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-DG_LOG_DOMAIN=\""libnm-glib"\" \
diff --git a/libnm-glib/tests/Makefile.am b/libnm-glib/tests/Makefile.am
index 7168d3dd15..aeaaa6b67c 100644
--- a/libnm-glib/tests/Makefile.am
+++ b/libnm-glib/tests/Makefile.am
@@ -2,6 +2,7 @@ if ENABLE_TESTS
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-I$(top_srcdir)/libnm-glib \
diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am
index 14c6ccacb6..29c83f09a1 100644
--- a/libnm-util/Makefile.am
+++ b/libnm-util/Makefile.am
@@ -5,6 +5,7 @@ SUBDIRS = . tests
AM_CPPFLAGS = \
-I${top_srcdir} \
-I${top_srcdir}/include \
+ -I$(top_builddir)/include \
-DG_LOG_DOMAIN=\""libnm-util"\" \
-DLOCALEDIR=\"$(datadir)/locale\" \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIB \
@@ -24,6 +25,7 @@ endif
lib_LTLIBRARIES=libnm-util.la
libnm_util_include_HEADERS = \
+ $(top_builddir)/include/nm-version-macros.h \
NetworkManager.h \
NetworkManagerVPN.h \
nm-connection.h \
@@ -54,11 +56,11 @@ libnm_util_include_HEADERS = \
nm-setting-wireless.h \
nm-setting-wireless-security.h \
nm-setting-vpn.h \
- nm-utils.h
+ nm-utils.h \
+ nm-version.h
nodist_libnm_util_include_HEADERS = \
- nm-utils-enum-types.h \
- nm-version.h
+ nm-utils-enum-types.h
libnm_util_la_private_headers = \
crypto.h \
@@ -159,7 +161,7 @@ pkgconfig_DATA = libnm-util.pc
DISTCLEANFILES = libnm-util.pc
-EXTRA_DIST = libnm-util.pc.in libnm-util.ver nm-version.h.in
+EXTRA_DIST = libnm-util.pc.in libnm-util.ver
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
diff --git a/libnm-util/NetworkManager.h b/libnm-util/NetworkManager.h
index b6827c2cbc..d83e4ab5a5 100644
--- a/libnm-util/NetworkManager.h
+++ b/libnm-util/NetworkManager.h
@@ -26,7 +26,9 @@
#ifndef NETWORK_MANAGER_H
#define NETWORK_MANAGER_H
-#include <nm-version.h>
+/* This header must not include glib or libnm. */
+
+#include <nm-version-macros.h>
/*
* dbus services details
diff --git a/libnm-core/nm-version.h.in b/libnm-util/nm-version.h
index 8ae0df6a5f..fd94e210ee 100644
--- a/libnm-core/nm-version.h.in
+++ b/libnm-util/nm-version.h
@@ -23,57 +23,10 @@
#include <glib.h>
-/**
- * NM_MAJOR_VERSION:
- *
- * Evaluates to the major version number of NetworkManager which this source
- * is compiled against.
- */
-#define NM_MAJOR_VERSION (@NM_MAJOR_VERSION@)
-
-/**
- * NM_MINOR_VERSION:
- *
- * Evaluates to the minor version number of NetworkManager which this source
- * is compiled against.
- */
-#define NM_MINOR_VERSION (@NM_MINOR_VERSION@)
-
-/**
- * NM_MICRO_VERSION:
- *
- * Evaluates to the micro version number of NetworkManager which this source
- * compiled against.
- */
-#define NM_MICRO_VERSION (@NM_MICRO_VERSION@)
-
-/**
- * NM_CHECK_VERSION:
- * @major: major version (e.g. 1 for version 1.2.5)
- * @minor: minor version (e.g. 2 for version 1.2.5)
- * @micro: micro version (e.g. 5 for version 1.2.5)
- *
- * Returns: %TRUE if the version of the NetworkManager header files
- * is the same as or newer than the passed-in version.
- */
-#define NM_CHECK_VERSION(major,minor,micro) \
- (NM_MAJOR_VERSION > (major) || \
- (NM_MAJOR_VERSION == (major) && NM_MINOR_VERSION > (minor)) || \
- (NM_MAJOR_VERSION == (major) && NM_MINOR_VERSION == (minor) && NM_MICRO_VERSION >= (micro)))
-
+#include <nm-version-macros.h>
/* Deprecation / Availability macros */
-#define NM_ENCODE_VERSION(major,minor,micro) ((major) << 16 | (minor) << 8 | (micro))
-
-#define NM_VERSION_0_9_8 (NM_ENCODE_VERSION (0, 9, 8))
-#define NM_VERSION_0_9_10 (NM_ENCODE_VERSION (0, 9, 10))
-#define NM_VERSION_1_0 (NM_ENCODE_VERSION (1, 0, 0))
-#define NM_VERSION_1_2 (NM_ENCODE_VERSION (1, 2, 0))
-
-#define NM_VERSION_CUR_STABLE NM_VERSION_1_0
-#define NM_VERSION_NEXT_STABLE NM_VERSION_1_2
-
#if !defined (NM_VERSION_MIN_REQUIRED) || (NM_VERSION_MIN_REQUIRED == 0)
# undef NM_VERSION_MIN_REQUIRED
# define NM_VERSION_MIN_REQUIRED (NM_VERSION_CUR_STABLE)
diff --git a/libnm-util/tests/Makefile.am b/libnm-util/tests/Makefile.am
index 16a7f8f3fc..e580a13486 100644
--- a/libnm-util/tests/Makefile.am
+++ b/libnm-util/tests/Makefile.am
@@ -2,6 +2,7 @@ if ENABLE_TESTS
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-util \
-I$(top_builddir)/libnm-util \
-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
diff --git a/libnm/Makefile.am b/libnm/Makefile.am
index 2ae3f87da8..a08bd80088 100644
--- a/libnm/Makefile.am
+++ b/libnm/Makefile.am
@@ -4,6 +4,7 @@ SUBDIRS = . tests
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_builddir)/introspection \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
@@ -25,6 +26,7 @@ lib_LTLIBRARIES = libnm.la
libnmincludedir = $(includedir)/libnm
libnminclude_hfiles = \
+ $(top_builddir)/include/nm-version-macros.h \
NetworkManager.h \
nm-access-point.h \
nm-active-connection.h \
diff --git a/libnm/tests/Makefile.am b/libnm/tests/Makefile.am
index a2dafec768..0acbae8fe3 100644
--- a/libnm/tests/Makefile.am
+++ b/libnm/tests/Makefile.am
@@ -2,6 +2,7 @@ if ENABLE_TESTS
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm \
-I$(top_builddir)/libnm \
-I$(top_srcdir)/libnm-core \
diff --git a/src/Makefile.am b/src/Makefile.am
index 9d1cb310c1..39082de872 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,6 +33,7 @@ endif
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_builddir)/introspection \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
@@ -130,6 +131,7 @@ libsystemd_nm_la_SOURCES = \
libsystemd_nm_la_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
$(SYSTEMD_NM_CFLAGS_PATHS) \
diff --git a/src/devices/adsl/Makefile.am b/src/devices/adsl/Makefile.am
index 1bccf7dc04..fa32c25a4d 100644
--- a/src/devices/adsl/Makefile.am
+++ b/src/devices/adsl/Makefile.am
@@ -9,6 +9,7 @@ AM_CPPFLAGS = \
-I${top_srcdir}/src/platform \
-I${top_builddir}/introspection \
-I${top_srcdir}/include \
+ -I$(top_builddir)/include \
-I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-adsl"\" \
diff --git a/src/devices/bluetooth/Makefile.am b/src/devices/bluetooth/Makefile.am
index 760632951d..37217dfac6 100644
--- a/src/devices/bluetooth/Makefile.am
+++ b/src/devices/bluetooth/Makefile.am
@@ -11,6 +11,7 @@ AM_CPPFLAGS = \
-I${top_srcdir}/src/devices/wwan \
-I${top_builddir}/introspection \
-I${top_srcdir}/include \
+ -I$(top_builddir)/include \
-I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-bluetooth"\" \
diff --git a/src/devices/team/Makefile.am b/src/devices/team/Makefile.am
index b48ea56053..13559a1867 100644
--- a/src/devices/team/Makefile.am
+++ b/src/devices/team/Makefile.am
@@ -9,6 +9,7 @@ AM_CPPFLAGS = \
-I${top_srcdir}/src/platform \
-I${top_builddir}/introspection \
-I${top_srcdir}/include \
+ -I$(top_builddir)/include \
-I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-team"\" \
diff --git a/src/devices/wifi/Makefile.am b/src/devices/wifi/Makefile.am
index 9133e312d0..250727f025 100644
--- a/src/devices/wifi/Makefile.am
+++ b/src/devices/wifi/Makefile.am
@@ -15,6 +15,7 @@ AM_CPPFLAGS = \
-I${top_srcdir}/src/supplicant-manager \
-I${top_builddir}/introspection \
-I${top_srcdir}/include \
+ -I$(top_builddir)/include \
-I${top_builddir}/libnm-core \
-I${top_srcdir}/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \
diff --git a/src/devices/wifi/tests/Makefile.am b/src/devices/wifi/tests/Makefile.am
index bc342eaa46..2e25dc422a 100644
--- a/src/devices/wifi/tests/Makefile.am
+++ b/src/devices/wifi/tests/Makefile.am
@@ -1,6 +1,7 @@
AM_CPPFLAGS = \
-I$(top_builddir)/introspection \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I${top_srcdir}/src/platform \
diff --git a/src/devices/wwan/Makefile.am b/src/devices/wwan/Makefile.am
index 56d4fb6665..1d2dcb680b 100644
--- a/src/devices/wwan/Makefile.am
+++ b/src/devices/wwan/Makefile.am
@@ -10,8 +10,9 @@ AM_CPPFLAGS = \
-I${top_srcdir}/src/platform \
-I${top_builddir}/introspection \
-I${top_srcdir}/include \
- -I${top_builddir}/libnm-core \
+ -I$(top_builddir)/include \
-I${top_srcdir}/libnm-core \
+ -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 \
diff --git a/src/dhcp-manager/Makefile.am b/src/dhcp-manager/Makefile.am
index 6437dddd94..b07bbc671f 100644
--- a/src/dhcp-manager/Makefile.am
+++ b/src/dhcp-manager/Makefile.am
@@ -5,6 +5,7 @@ nm_dhcp_helper_SOURCES = nm-dhcp-helper.c
nm_dhcp_helper_CPPFLAGS = \
$(GLIB_CFLAGS) \
-I$(top_srcdir)/include \
+ -I${top_builddir}/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DG_LOG_DOMAIN=\""nm-dhcp-helper"\" \
diff --git a/src/dhcp-manager/tests/Makefile.am b/src/dhcp-manager/tests/Makefile.am
index 16a11db3ba..578f7144ac 100644
--- a/src/dhcp-manager/tests/Makefile.am
+++ b/src/dhcp-manager/tests/Makefile.am
@@ -1,5 +1,6 @@
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I${top_builddir}/include \
-I${top_srcdir}/libnm-core \
-I${top_builddir}/libnm-core \
-I$(top_srcdir)/src/dhcp-manager \
diff --git a/src/dnsmasq-manager/tests/Makefile.am b/src/dnsmasq-manager/tests/Makefile.am
index fec3385954..0ddaa381c1 100644
--- a/src/dnsmasq-manager/tests/Makefile.am
+++ b/src/dnsmasq-manager/tests/Makefile.am
@@ -1,5 +1,6 @@
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I${top_builddir}/include \
-I${top_srcdir}/libnm-core \
-I${top_builddir}/libnm-core \
-I$(top_srcdir)/src/dnsmasq-manager \
diff --git a/src/platform/tests/Makefile.am b/src/platform/tests/Makefile.am
index 983fb796f4..1fb621d752 100644
--- a/src/platform/tests/Makefile.am
+++ b/src/platform/tests/Makefile.am
@@ -1,6 +1,7 @@
AM_CPPFLAGS = \
-I${top_srcdir} \
-I${top_srcdir}/include \
+ -I${top_builddir}/include \
-I${top_srcdir}/src \
-I${top_builddir}/src \
-I${top_srcdir}/libnm-core \
diff --git a/src/ppp-manager/Makefile.am b/src/ppp-manager/Makefile.am
index ee5788f7c2..650c4301f2 100644
--- a/src/ppp-manager/Makefile.am
+++ b/src/ppp-manager/Makefile.am
@@ -2,6 +2,7 @@ if WITH_PPP
AM_CPPFLAGS = \
-I${top_srcdir}/include \
+ -I${top_builddir}/include \
-I${top_srcdir}/libnm-core \
-I${top_srcdir}/src \
-I${top_builddir}/libnm-core \
diff --git a/src/rdisc/tests/Makefile.am b/src/rdisc/tests/Makefile.am
index b5b09f1979..cf302ad6c7 100644
--- a/src/rdisc/tests/Makefile.am
+++ b/src/rdisc/tests/Makefile.am
@@ -1,6 +1,7 @@
AM_CPPFLAGS = \
-I${top_srcdir} \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I${top_srcdir}/src \
-I${top_srcdir}/src/platform \
-I${top_srcdir}/libnm-core \
diff --git a/src/settings/plugins/ibft/Makefile.am b/src/settings/plugins/ibft/Makefile.am
index 3f9e934645..49d78311de 100644
--- a/src/settings/plugins/ibft/Makefile.am
+++ b/src/settings/plugins/ibft/Makefile.am
@@ -15,6 +15,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/platform \
-I$(top_srcdir)/src/settings \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
diff --git a/src/settings/plugins/ibft/tests/Makefile.am b/src/settings/plugins/ibft/tests/Makefile.am
index 257a3a5a01..3c3b5cf577 100644
--- a/src/settings/plugins/ibft/tests/Makefile.am
+++ b/src/settings/plugins/ibft/tests/Makefile.am
@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(CODE_COVERAGE_CFLAGS) \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I$(top_srcdir)/src/ \
diff --git a/src/settings/plugins/ifcfg-rh/Makefile.am b/src/settings/plugins/ifcfg-rh/Makefile.am
index 34f04f91e7..ebae6374e5 100644
--- a/src/settings/plugins/ifcfg-rh/Makefile.am
+++ b/src/settings/plugins/ifcfg-rh/Makefile.am
@@ -44,6 +44,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/platform \
-I$(top_srcdir)/src/settings \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
diff --git a/src/settings/plugins/ifcfg-rh/tests/Makefile.am b/src/settings/plugins/ifcfg-rh/tests/Makefile.am
index 4ac4eba929..4f942d2050 100644
--- a/src/settings/plugins/ifcfg-rh/tests/Makefile.am
+++ b/src/settings/plugins/ifcfg-rh/tests/Makefile.am
@@ -8,6 +8,7 @@ AM_CPPFLAGS = \
$(GLIB_CFLAGS) \
$(CODE_COVERAGE_CFLAGS) \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I$(top_srcdir)/src/ \
diff --git a/src/settings/plugins/ifnet/Makefile.am b/src/settings/plugins/ifnet/Makefile.am
index 0be0cc6cab..5e1713a147 100644
--- a/src/settings/plugins/ifnet/Makefile.am
+++ b/src/settings/plugins/ifnet/Makefile.am
@@ -7,6 +7,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src/platform \
-I$(top_srcdir)/src/settings \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-ifnet"\" \
diff --git a/src/settings/plugins/ifnet/tests/Makefile.am b/src/settings/plugins/ifnet/tests/Makefile.am
index 8d97f56f28..9c1bcbf62e 100644
--- a/src/settings/plugins/ifnet/tests/Makefile.am
+++ b/src/settings/plugins/ifnet/tests/Makefile.am
@@ -5,6 +5,7 @@ if ENABLE_TESTS
AM_CPPFLAGS= \
-I$(srcdir)/../ \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I$(top_srcdir)/src \
diff --git a/src/settings/plugins/ifupdown/Makefile.am b/src/settings/plugins/ifupdown/Makefile.am
index dfa64e051b..b3ab2efdfc 100644
--- a/src/settings/plugins/ifupdown/Makefile.am
+++ b/src/settings/plugins/ifupdown/Makefile.am
@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/settings \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-ifupdown"\" \
diff --git a/src/settings/plugins/ifupdown/tests/Makefile.am b/src/settings/plugins/ifupdown/tests/Makefile.am
index 4d404d9224..55d9f88b2a 100644
--- a/src/settings/plugins/ifupdown/tests/Makefile.am
+++ b/src/settings/plugins/ifupdown/tests/Makefile.am
@@ -2,6 +2,7 @@ if ENABLE_TESTS
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I$(top_srcdir)/src \
diff --git a/src/settings/plugins/keyfile/Makefile.am b/src/settings/plugins/keyfile/Makefile.am
index f146e7bdd3..e3566a3cad 100644
--- a/src/settings/plugins/keyfile/Makefile.am
+++ b/src/settings/plugins/keyfile/Makefile.am
@@ -6,6 +6,7 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/settings \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-DG_LOG_DOMAIN=\""NetworkManager-keyfile"\" \
diff --git a/src/settings/plugins/keyfile/tests/Makefile.am b/src/settings/plugins/keyfile/tests/Makefile.am
index 80f934e798..34331e15a8 100644
--- a/src/settings/plugins/keyfile/tests/Makefile.am
+++ b/src/settings/plugins/keyfile/tests/Makefile.am
@@ -6,6 +6,7 @@ SUBDIRS=keyfiles
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I$(top_srcdir)/src \
diff --git a/src/supplicant-manager/tests/Makefile.am b/src/supplicant-manager/tests/Makefile.am
index e786664779..66bd7d581d 100644
--- a/src/supplicant-manager/tests/Makefile.am
+++ b/src/supplicant-manager/tests/Makefile.am
@@ -2,6 +2,7 @@ SUBDIRS=certs
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I$(top_srcdir)/src \
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 8e06a54799..c4dd716f38 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -2,6 +2,7 @@ SUBDIRS = config
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I$(top_srcdir)/src/platform \
diff --git a/src/tests/config/Makefile.am b/src/tests/config/Makefile.am
index e0e3e13218..cc1ffb387b 100644
--- a/src/tests/config/Makefile.am
+++ b/src/tests/config/Makefile.am
@@ -1,5 +1,6 @@
AM_CPPFLAGS = \
-I$(top_srcdir)/include \
+ -I$(top_builddir)/include \
-I$(top_srcdir)/libnm-core \
-I$(top_builddir)/libnm-core \
-I$(top_srcdir)/src/ \