mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 04:40:04 +01:00
build: create "config-extra.h" header instead of passing directory variables via CFLAGS
1) the command line gets shorter. I frequently run `make V=1` to see the command line arguments for the compiler, and there is a lot of noise. 2) define each of these variables at one place. This makes it easy to verify that for all compilation units, a particular define has the same value. Previously that was not obvious or even not the case (see commite5d1a71396and commitd63cf1ef2f). The point is to avoid redundancy. 3) not all compilation units need all defines. In fact, most modules would only need a few of these defines. We aimed to pass the necessary minium of defines to each compilation unit, but that was non-obvious to get right and often we set a define that wasn't used. See for example "src_settings_plugins_ibft_cppflags" which needlessly had "-DSYSCONFDIR". This question is now entirely avoided by just defining all variables in a header. We don't care to find the minimum, because every component gets anyway all defines from the header. 4) this also avoids the situation, where a module that previously did not use a particular define gets modified to require it. Previously, that would have required to identify the missing define, and add it to the CFLAGS of the complation unit. Since every compilation now includes "config-extra.h", all defines are available everywhere. 5) the fact that each define is now available in all compilation units could be perceived as a downside. But it isn't, because these defines should have a unique name and one specific value. Defining the same name with different values, or refer to the same value by different names is a bug, not a desirable feature. Since these defines should be unique accross the entire tree, there is no problem in providing them to every compilation unit. 6) the reason why we generate "config-extra.h" this way, instead of using AC_DEFINE() in configure.ac, is due to the particular handling of autoconf for directory variables. See [1]. With meson, it would be trivial to put them into "config.h.meson". While that is not easy with autoconf, the "config-extra.h" workaround seems still preferable to me. [1] https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Installation-Directory-Variables.html
This commit is contained in:
parent
1c2033301c
commit
a75ab799e4
30 changed files with 114 additions and 146 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -47,6 +47,7 @@ test-*.trs
|
|||
/autom4te.cache
|
||||
/build-aux
|
||||
/config.*
|
||||
/config-extra.h
|
||||
/configure
|
||||
/intltool-*
|
||||
|
||||
|
|
|
|||
107
Makefile.am
107
Makefile.am
|
|
@ -107,10 +107,43 @@ endif
|
|||
|
||||
###############################################################################
|
||||
|
||||
nm_build_cflags = \
|
||||
-DNM_BUILD_SRCDIR=\"$(abs_srcdir)\" \
|
||||
-DNM_BUILD_BUILDDIR=\"$(abs_builddir)\" \
|
||||
$(NULL)
|
||||
# with autotools, it is not easily possible to generate these defines
|
||||
# from configure.ac.
|
||||
#
|
||||
# See https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Installation-Directory-Variables.html
|
||||
#
|
||||
# With meson-only, they could just be set via config.h.meson
|
||||
config-extra.h: Makefile
|
||||
$(AM_V_GEN) \
|
||||
echo "/* Generated by Makefile.am */" >$@ && \
|
||||
echo "#define BINDIR \"$(bindir)\"" >>$@ && \
|
||||
echo "#define DATADIR \"$(datadir)\"" >>$@ && \
|
||||
echo "#define DHCLIENT_PATH \"$(DHCLIENT_PATH)\"" >>$@ && \
|
||||
echo "#define DHCPCANON_PATH \"$(DHCPCANON_PATH)\"" >>$@ && \
|
||||
echo "#define DHCPCD_PATH \"$(DHCPCD_PATH)\"" >>$@ && \
|
||||
echo "#define LIBEXECDIR \"$(libexecdir)\"" >>$@ && \
|
||||
echo "#define LOCALSTATEDIR \"$(localstatedir)\"" >>$@ && \
|
||||
echo "#define NMCONFDIR \"$(nmconfdir)\"" >>$@ && \
|
||||
echo "#define NMLIBDIR \"$(nmlibdir)\"" >>$@ && \
|
||||
echo "#define NMLOCALEDIR \"$(nmlocaledir)\"" >>$@ && \
|
||||
echo "#define NMPLUGINDIR \"$(plugindir)\"" >>$@ && \
|
||||
echo "#define NMRUNDIR \"$(nmrundir)\"" >>$@ && \
|
||||
echo "#define NMSTATEDIR \"$(nmstatedir)\"" >>$@ && \
|
||||
echo "#define NMVPNDIR \"$(pkglibdir)\"" >>$@ && \
|
||||
echo "#define NM_BUILD_BUILDDIR \"$(abs_builddir)\"" >>$@ && \
|
||||
echo "#define NM_BUILD_SRCDIR \"$(abs_srcdir)\"" >>$@ && \
|
||||
echo "#define PPPD_PLUGIN_DIR \"$(PPPD_PLUGIN_DIR)\"" >>$@ && \
|
||||
echo "#define PREFIX \"$(prefix)\"" >>$@ && \
|
||||
echo "#define RUNDIR \"$(rundir)\"" >>$@ && \
|
||||
echo "#define RUNSTATEDIR \"$(runstatedir)\"" >>$@ && \
|
||||
echo "#define SYSCONFDIR \"$(sysconfdir)\"" >>$@ && \
|
||||
true
|
||||
|
||||
DISTCLEANFILES += config-extra.h
|
||||
|
||||
libnm-core/.dirstamp: config-extra.h
|
||||
|
||||
###############################################################################
|
||||
|
||||
set_sanitizer_env = \
|
||||
[ -n "$(SANITIZER_ENV)" ] && export $(SANITIZER_ENV) ; \
|
||||
|
|
@ -604,12 +637,6 @@ libnm_core_libnm_core_la_CPPFLAGS = \
|
|||
$(dflt_cppflags_libnm_core) \
|
||||
-DG_LOG_DOMAIN=\""libnm"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
|
||||
-DNMLOCALEDIR=\"$(nmlocaledir)\" \
|
||||
-DNMCONFDIR=\"$(nmconfdir)\" \
|
||||
-DNMLIBDIR=\"$(nmlibdir)\" \
|
||||
-DNMVPNDIR=\"$(pkglibdir)\" \
|
||||
-DNMPLUGINDIR=\"$(plugindir)\" \
|
||||
-DLIBEXECDIR=\"$(libexecdir)\" \
|
||||
$(NULL)
|
||||
|
||||
if WITH_JSON_VALIDATION
|
||||
|
|
@ -694,7 +721,6 @@ libnm_core_tests_cppflags = \
|
|||
$(dflt_cppflags_libnm_core) \
|
||||
-I$(srcdir)/libnm-core/tests \
|
||||
-I$(builddir)/libnm-core/tests \
|
||||
$(nm_build_cflags) \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
|
||||
$(NULL)
|
||||
|
|
@ -1015,7 +1041,7 @@ INTROSPECTION_GIRS += libnm/NM-1.0.gir
|
|||
if WITH_FAKE_TYPELIBS
|
||||
|
||||
libnm/fake-typelib/NetworkManager.typelib: libnm/fake-typelib/NetworkManager.gir libnm/fake-typelib/.dirstamp
|
||||
$(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@
|
||||
$(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@
|
||||
|
||||
libnm/fake-typelib/NMClient.typelib: libnm/fake-typelib/NMClient.gir libnm/fake-typelib/.dirstamp
|
||||
$(AM_V_GEN) $(INTROSPECTION_COMPILER) $< -o $@
|
||||
|
|
@ -1118,7 +1144,6 @@ libnm_tests_cppflags = \
|
|||
$(dflt_cppflags_libnm_core) \
|
||||
-I$(srcdir)/libnm \
|
||||
-I$(builddir)/libnm \
|
||||
$(nm_build_cflags) \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \
|
||||
$(NULL)
|
||||
|
|
@ -1214,29 +1239,8 @@ src_cppflags = \
|
|||
-I$(srcdir)/src \
|
||||
-I$(builddir)/src \
|
||||
\
|
||||
-DPREFIX=\"$(prefix)\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
\
|
||||
-DBINDIR=\"$(bindir)\" \
|
||||
-DDATADIR=\"$(datadir)\" \
|
||||
-DLIBEXECDIR=\"$(libexecdir)\" \
|
||||
-DLOCALSTATEDIR=\"$(localstatedir)\" \
|
||||
-DRUNSTATEDIR=\"$(runstatedir)\" \
|
||||
-DSBINDIR=\"$(sbindir)\" \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DRUNDIR=\"$(rundir)\" \
|
||||
\
|
||||
-DNMCONFDIR=\"$(nmconfdir)\" \
|
||||
-DNMLOCALEDIR=\"$(nmlocaledir)\" \
|
||||
-DNMPLUGINDIR=\"$(plugindir)\" \
|
||||
-DNMRUNDIR=\"$(nmrundir)\" \
|
||||
-DNMSTATEDIR=\"$(nmstatedir)\" \
|
||||
-DNMLIBDIR=\"$(nmlibdir)\" \
|
||||
\
|
||||
-DDHCPCANON_PATH=\"$(DHCPCANON_PATH)\" \
|
||||
-DDHCLIENT_PATH=\"$(DHCLIENT_PATH)\" \
|
||||
-DDHCPCD_PATH=\"$(DHCPCD_PATH)\" \
|
||||
\
|
||||
$(LIBUDEV_CFLAGS) \
|
||||
$(LIBNDP_CFLAGS) \
|
||||
$(LIBPSL_CFLAGS) \
|
||||
|
|
@ -1847,7 +1851,7 @@ src_dhcp_nm_dhcp_helper_CPPFLAGS = \
|
|||
-I$(builddir)/shared \
|
||||
-DG_LOG_DOMAIN=\""nm-dhcp-helper"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB \
|
||||
-DNMRUNDIR=\"$(nmrundir)\"
|
||||
$(NULL)
|
||||
|
||||
src_dhcp_nm_dhcp_helper_SOURCES = \
|
||||
src/dhcp/nm-dhcp-helper.c \
|
||||
|
|
@ -1868,7 +1872,6 @@ EXTRA_DIST += \
|
|||
|
||||
src_dhcp_tests_cppflags = \
|
||||
$(src_tests_cppflags) \
|
||||
$(nm_build_cflags) \
|
||||
$(NULL)
|
||||
|
||||
src_dhcp_tests_ldadd = \
|
||||
|
|
@ -1944,7 +1947,6 @@ src_ppp_libnm_ppp_plugin_la_CPPFLAGS = \
|
|||
-I$(builddir)/shared \
|
||||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/libnm-core \
|
||||
-DPPPD_PLUGIN_DIR=\"$(PPPD_PLUGIN_DIR)\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(GLIB_CFLAGS)
|
||||
|
||||
|
|
@ -1970,7 +1972,6 @@ check_programs += src/settings/plugins/keyfile/tests/test-keyfile
|
|||
|
||||
src_settings_plugins_keyfile_tests_test_keyfile_CPPFLAGS = \
|
||||
$(src_tests_cppflags) \
|
||||
$(nm_build_cflags) \
|
||||
$(NULL)
|
||||
|
||||
src_settings_plugins_keyfile_tests_test_keyfile_LDFLAGS = \
|
||||
|
|
@ -2043,8 +2044,7 @@ src_settings_plugins_ibft_cppflags = \
|
|||
-I$(builddir)/libnm-core \
|
||||
$(GLIB_CFLAGS) \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DSBINDIR=\"$(sbindir)\"
|
||||
$(NULL)
|
||||
|
||||
src_settings_plugins_ibft_libnms_ibft_core_la_CPPFLAGS = $(src_settings_plugins_ibft_cppflags)
|
||||
|
||||
|
|
@ -2081,7 +2081,6 @@ src_settings_plugins_ibft_tests_test_ibft_CPPFLAGS = \
|
|||
-I$(srcdir)/libnm-core \
|
||||
-I$(builddir)/libnm-core \
|
||||
-I$(srcdir)/src \
|
||||
$(nm_build_cflags) \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(NULL)
|
||||
|
|
@ -2142,8 +2141,7 @@ src_settings_plugins_ifcfg_rh_cppflags = \
|
|||
$(NSS_CFLAGS) \
|
||||
$(SANITIZER_EXEC_CFLAGS) \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DSBINDIR=\"$(sbindir)\"
|
||||
$(NULL)
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
@ -2222,7 +2220,6 @@ src_settings_plugins_ifcfg_rh_tests_test_ifcfg_rh_SOURCES = \
|
|||
|
||||
src_settings_plugins_ifcfg_rh_tests_test_ifcfg_rh_CPPFLAGS = \
|
||||
$(src_tests_cppflags) \
|
||||
$(nm_build_cflags) \
|
||||
$(NULL)
|
||||
|
||||
src_settings_plugins_ifcfg_rh_tests_test_ifcfg_rh_LDFLAGS = \
|
||||
|
|
@ -2489,7 +2486,7 @@ src_settings_plugins_ifupdown_cppflags = \
|
|||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(LIBUDEV_CFLAGS) \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\"
|
||||
$(NULL)
|
||||
|
||||
|
||||
src_settings_plugins_ifupdown_libnms_ifupdown_core_la_SOURCES = \
|
||||
|
|
@ -2539,7 +2536,6 @@ src_settings_plugins_ifupdown_tests_test_ifupdown_CPPFLAGS = \
|
|||
$(GLIB_CFLAGS) \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
$(nm_build_cflags) \
|
||||
$(NULL)
|
||||
|
||||
src_settings_plugins_ifupdown_tests_test_ifupdown_LDFLAGS = \
|
||||
|
|
@ -2936,7 +2932,6 @@ src_devices_ovs_libnm_device_plugin_ovs_la_CPPFLAGS = \
|
|||
-I$(srcdir)/libnm-core \
|
||||
\
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||
-DRUNSTATEDIR=\"$(runstatedir)\" \
|
||||
\
|
||||
$(JANSSON_CFLAGS) \
|
||||
$(GLIB_CFLAGS)
|
||||
|
|
@ -3140,7 +3135,6 @@ check_programs += src/supplicant/tests/test-supplicant-config
|
|||
|
||||
src_supplicant_tests_test_supplicant_config_CPPFLAGS = \
|
||||
$(src_tests_cppflags) \
|
||||
$(nm_build_cflags) \
|
||||
$(NULL)
|
||||
|
||||
src_supplicant_tests_test_supplicant_config_LDADD = \
|
||||
|
|
@ -3169,7 +3163,6 @@ src_tests_config_test_config_SOURCES = \
|
|||
|
||||
src_tests_config_test_config_CPPFLAGS = \
|
||||
$(src_tests_cppflags) \
|
||||
$(nm_build_cflags) \
|
||||
$(NULL)
|
||||
|
||||
src_tests_config_test_config_LDADD = \
|
||||
|
|
@ -3286,9 +3279,7 @@ dispatcher_cppflags = \
|
|||
$(GLIB_CFLAGS) \
|
||||
-DG_LOG_DOMAIN=\""nm-dispatcher"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||
-DNMCONFDIR=\"$(nmconfdir)\" \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DLIBEXECDIR=\"$(libexecdir)\"
|
||||
$(NULL)
|
||||
|
||||
|
||||
dispatcher_nmdbus_dispatcher_sources = \
|
||||
|
|
@ -3382,7 +3373,6 @@ dispatcher_tests_test_dispatcher_envp_CPPFLAGS = \
|
|||
-I$(builddir)/libnm \
|
||||
-I$(srcdir)/dispatcher \
|
||||
-I$(builddir)/dispatcher \
|
||||
$(nm_build_cflags) \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||
$(GLIB_CFLAGS) \
|
||||
|
|
@ -3425,7 +3415,7 @@ clients_nm_online_CPPFLAGS = \
|
|||
$(GLIB_CFLAGS) \
|
||||
-DG_LOG_DOMAIN=\""nm-online"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||
-DNMLOCALEDIR=\"$(nmlocaledir)\"
|
||||
$(NULL)
|
||||
|
||||
clients_nm_online_LDFLAGS = \
|
||||
-Wl,--version-script="$(srcdir)/linker-script-binary.ver"
|
||||
|
|
@ -3453,7 +3443,6 @@ clients_cppflags = \
|
|||
-I$(srcdir)/clients/common \
|
||||
-I$(builddir)/clients/common \
|
||||
$(GLIB_CFLAGS) \
|
||||
-DNMLOCALEDIR=\"$(nmlocaledir)\" \
|
||||
$(NULL)
|
||||
|
||||
check_ltlibraries += clients/common/libnmc-base.la
|
||||
|
|
@ -3605,10 +3594,9 @@ clients_cli_nmcli_CPPFLAGS = \
|
|||
-I$(srcdir)/clients/cli \
|
||||
$(clients_cppflags) \
|
||||
$(SANITIZER_EXEC_CFLAGS) \
|
||||
-DSYSCONFDIR=\"$(sysconfdir)\" \
|
||||
-DG_LOG_DOMAIN=\""nmcli"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||
-DNMLOCALEDIR=\"$(nmlocaledir)\"
|
||||
$(NULL)
|
||||
|
||||
clients_cli_nmcli_LDADD = \
|
||||
libnm/libnm.la \
|
||||
|
|
@ -3814,7 +3802,7 @@ clients_tui_nmtui_CPPFLAGS = \
|
|||
$(NEWT_CFLAGS) \
|
||||
-DG_LOG_DOMAIN=\""nmtui"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||
-DNMLOCALEDIR=\""$(nmlocaledir)"\"
|
||||
$(NULL)
|
||||
|
||||
clients_tui_nmtui_LDFLAGS = \
|
||||
-Wl,--version-script="$(srcdir)/linker-script-binary.ver" \
|
||||
|
|
@ -3975,7 +3963,6 @@ libnm_util_cppflags = \
|
|||
-I$(builddir)/shared \
|
||||
-DG_LOG_DOMAIN=\""libnm-util"\" \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL \
|
||||
-DNMLOCALEDIR=\"$(nmlocaledir)\" \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(DBUS_CFLAGS) \
|
||||
$(UUID_CFLAGS)
|
||||
|
|
@ -4187,7 +4174,6 @@ libnm_util_tests_cppflags = \
|
|||
-I$(builddir)/libnm-util \
|
||||
$(GLIB_CFLAGS) \
|
||||
$(DBUS_CFLAGS) \
|
||||
$(nm_build_cflags) \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL \
|
||||
$(SANITIZER_EXEC_CFLAGS) \
|
||||
|
|
@ -4544,7 +4530,6 @@ libnm_glib_tests_cppflags = \
|
|||
-I$(srcdir)/libnm-util \
|
||||
-I$(builddir)/libnm-util \
|
||||
-I$(srcdir)/libnm-glib \
|
||||
$(nm_build_cflags) \
|
||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_GLIB \
|
||||
$(GLIB_CFLAGS) \
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ deps = [
|
|||
]
|
||||
|
||||
cflags = clients_cflags + [
|
||||
'-DSYSCONFDIR="@0@"'.format(nm_sysconfdir),
|
||||
'-DG_LOG_DOMAIN="@0@"'.format(name),
|
||||
'-DNMLOCALEDIR="@0@"'.format(nm_localedir)
|
||||
]
|
||||
|
||||
if enable_polkit_agent
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ deps = [
|
|||
|
||||
clients_cflags = [
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
|
||||
'-DNMLOCALEDIR="@0@"'.format(nm_localedir),
|
||||
]
|
||||
|
||||
cflags = clients_cflags + [
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ deps = [
|
|||
|
||||
cflags = clients_cflags + [
|
||||
'-DG_LOG_DOMAIN="@0@"'.format(name),
|
||||
'-DNMLOCALEDIR="@0@"'.format(nm_localedir)
|
||||
]
|
||||
|
||||
subdir('newt')
|
||||
|
|
|
|||
21
config-extra.h.meson
Normal file
21
config-extra.h.meson
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#mesondefine BINDIR
|
||||
#mesondefine DATADIR
|
||||
#mesondefine DHCLIENT_PATH
|
||||
#mesondefine DHCPCANON_PATH
|
||||
#mesondefine DHCPCD_PATH
|
||||
#mesondefine LIBEXECDIR
|
||||
#mesondefine LOCALSTATEDIR
|
||||
#mesondefine NMCONFDIR
|
||||
#mesondefine NMLIBDIR
|
||||
#mesondefine NMLOCALEDIR
|
||||
#mesondefine NMPLUGINDIR
|
||||
#mesondefine NMRUNDIR
|
||||
#mesondefine NMSTATEDIR
|
||||
#mesondefine NMVPNDIR
|
||||
#mesondefine NM_BUILD_BUILDDIR
|
||||
#mesondefine NM_BUILD_SRCDIR
|
||||
#mesondefine PPPD_PLUGIN_DIR
|
||||
#mesondefine PREFIX
|
||||
#mesondefine RUNDIR
|
||||
#mesondefine RUNSTATEDIR
|
||||
#mesondefine SYSCONFDIR
|
||||
|
|
@ -31,9 +31,6 @@ deps = [
|
|||
]
|
||||
|
||||
cflags = [
|
||||
'-DLIBEXECDIR="@0@"'.format(nm_libexecdir),
|
||||
'-DSYSCONFDIR="@0@"'.format(nm_sysconfdir),
|
||||
'-DNMCONFDIR="@0@"'.format(nm_pkgconfdir),
|
||||
'-DG_LOG_DOMAIN="@0@"'.format(name),
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
|
||||
]
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ exe = executable(
|
|||
c_args: [
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
|
||||
] +
|
||||
nm_build_cflags,
|
||||
],
|
||||
link_with: libnm_dispatcher_core
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -144,12 +144,6 @@ deps = [
|
|||
cflags = [
|
||||
'-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE',
|
||||
'-DLIBEXECDIR="@0@"'.format(nm_libexecdir),
|
||||
'-DNMLOCALEDIR="@0@"'.format(nm_localedir),
|
||||
'-DNMCONFDIR="@0@"'.format(nm_pkgconfdir),
|
||||
'-DNMLIBDIR="@0@"'.format(nm_pkglibdir),
|
||||
'-DNMPLUGINDIR="@0@"'.format(nm_plugindir),
|
||||
'-DNMVPNDIR="@0@"'.format(nm_vpndir)
|
||||
]
|
||||
|
||||
if enable_json_validation
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ foreach test_unit: test_units
|
|||
c_args: [
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE',
|
||||
] +
|
||||
nm_build_cflags,
|
||||
],
|
||||
link_with: libnm_core
|
||||
)
|
||||
test(
|
||||
|
|
|
|||
|
|
@ -19,8 +19,7 @@ foreach test_unit: test_units
|
|||
c_args:
|
||||
common_cflags + [
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
] +
|
||||
nm_build_cflags,
|
||||
],
|
||||
)
|
||||
|
||||
test(
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ deps = [
|
|||
|
||||
common_cflags = [
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL',
|
||||
'-DNMLOCALEDIR="@0@"'.format(nm_localedir),
|
||||
]
|
||||
|
||||
cflags = common_cflags + [
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ deps = [
|
|||
|
||||
cflags = common_cflags + [
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
] + nm_build_cflags
|
||||
]
|
||||
|
||||
test = 'test-libnm-linking'
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ test_units = [
|
|||
cflags = [
|
||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM',
|
||||
] + nm_build_cflags
|
||||
]
|
||||
|
||||
foreach test_unit: test_units
|
||||
exe = executable(
|
||||
|
|
|
|||
43
meson.build
43
meson.build
|
|
@ -54,11 +54,6 @@ nm_pkgstatedir = join_paths(nm_localstatedir, nm_name)
|
|||
nm_vpndir = join_paths(nm_libdir, nm_name)
|
||||
nm_plugindir = join_paths(nm_libdir, nm_name, dist_version)
|
||||
|
||||
nm_build_cflags = [
|
||||
'-DNM_BUILD_SRCDIR="@0@"'.format(meson.source_root()),
|
||||
'-DNM_BUILD_BUILDDIR="@0@"'.format(meson.build_root()),
|
||||
]
|
||||
|
||||
libnm_name = 'libnm'
|
||||
|
||||
current = 1
|
||||
|
|
@ -874,6 +869,44 @@ configure_file(
|
|||
configuration: config_h
|
||||
)
|
||||
|
||||
config_extra_h = configuration_data()
|
||||
|
||||
config_extra_h.set_quoted('BINDIR', nm_bindir)
|
||||
config_extra_h.set_quoted('DATADIR', nm_datadir)
|
||||
if enable_dhclient
|
||||
config_extra_h.set_quoted('DHCLIENT_PATH', dhclient.path())
|
||||
endif
|
||||
if enable_dhcpcanon
|
||||
config_extra_h.set_quoted('DHCPCANON_PATH', dhcpcanon.path())
|
||||
endif
|
||||
if enable_dhcpcd
|
||||
config_extra_h.set_quoted('DHCPCD_PATH', dhcpcd.path())
|
||||
endif
|
||||
config_extra_h.set_quoted('LIBEXECDIR', nm_libexecdir)
|
||||
config_extra_h.set_quoted('LOCALSTATEDIR', nm_localstatedir)
|
||||
config_extra_h.set_quoted('NMCONFDIR', nm_pkgconfdir)
|
||||
config_extra_h.set_quoted('NMLIBDIR', nm_pkglibdir)
|
||||
config_extra_h.set_quoted('NMLIBDIR', nm_pkglibdir)
|
||||
config_extra_h.set_quoted('NMLOCALEDIR', nm_localedir)
|
||||
config_extra_h.set_quoted('NMPLUGINDIR', nm_plugindir)
|
||||
config_extra_h.set_quoted('NMRUNDIR', nm_pkgrundir)
|
||||
config_extra_h.set_quoted('NMSTATEDIR', nm_pkgstatedir)
|
||||
config_extra_h.set_quoted('NMVPNDIR', nm_vpndir)
|
||||
config_extra_h.set_quoted('NM_BUILD_BUILDDIR', meson.build_root())
|
||||
config_extra_h.set_quoted('NM_BUILD_SRCDIR', meson.source_root())
|
||||
config_extra_h.set_quoted('PPPD_PLUGIN_DIR', pppd_plugin_dir)
|
||||
config_extra_h.set_quoted('PREFIX', nm_prefix)
|
||||
config_extra_h.set_quoted('RUNDIR', nm_pkgrundir)
|
||||
config_extra_h.set_quoted('RUNSTATEDIR', nm_runstatedir)
|
||||
config_extra_h.set_quoted('SBINDIR', nm_sbindir)
|
||||
config_extra_h.set_quoted('SYSCONFDIR', nm_sysconfdir)
|
||||
|
||||
configure_file(
|
||||
input: 'config-extra.h.meson',
|
||||
output: 'config-extra.h',
|
||||
configuration: config_extra_h
|
||||
)
|
||||
|
||||
meson.add_install_script(
|
||||
'meson_post_install.py',
|
||||
nm_datadir,
|
||||
|
|
|
|||
|
|
@ -112,6 +112,8 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "config-extra.h"
|
||||
|
||||
/* 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 */
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ libnm_device_plugin_ovs = shared_module(
|
|||
'nm-device-plugin-ovs',
|
||||
sources: sources,
|
||||
dependencies: deps,
|
||||
c_args: '-DRUNSTATEDIR="@0@"'.format(nm_runstatedir),
|
||||
link_args: ldflags_linker_script_devices,
|
||||
link_depends: linker_script_devices,
|
||||
install: true,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ name = 'nm-dhcp-helper'
|
|||
cflags = [
|
||||
'-DG_LOG_DOMAIN="@0@"'.format(name),
|
||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_GLIB',
|
||||
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir),
|
||||
]
|
||||
|
||||
executable(
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ foreach test_unit: test_units
|
|||
test_unit,
|
||||
test_unit + '.c',
|
||||
dependencies: test_nm_dep,
|
||||
c_args: nm_build_cflags,
|
||||
)
|
||||
|
||||
test(
|
||||
|
|
|
|||
|
|
@ -17,35 +17,7 @@ nm_dep = declare_dependency(
|
|||
compile_args: nm_cflags
|
||||
)
|
||||
|
||||
cflags = nm_cflags + [
|
||||
'-DPREFIX="@0@"'.format(nm_prefix),
|
||||
'-DBINDIR="@0@"'.format(nm_bindir),
|
||||
'-DDATADIR="@0@"'.format(nm_datadir),
|
||||
'-DLIBEXECDIR="@0@"'.format(nm_libexecdir),
|
||||
'-DLOCALSTATEDIR="@0@"'.format(nm_localstatedir),
|
||||
'-DRUNSTATEDIR="@0@"'.format(nm_runstatedir),
|
||||
'-DSBINDIR="@0@"'.format(nm_sbindir),
|
||||
'-DSYSCONFDIR="@0@"'.format(nm_sysconfdir),
|
||||
'-DRUNDIR="@0@"'.format(nm_pkgrundir),
|
||||
'-DNMCONFDIR="@0@"'.format(nm_pkgconfdir),
|
||||
'-DNMLOCALEDIR="@0@"'.format(nm_localedir),
|
||||
'-DNMPLUGINDIR="@0@"'.format(nm_plugindir),
|
||||
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir),
|
||||
'-DNMSTATEDIR="@0@"'.format(nm_pkgstatedir),
|
||||
'-DNMLIBDIR="@0@"'.format(nm_pkglibdir)
|
||||
]
|
||||
|
||||
if enable_dhcpcanon
|
||||
cflags += '-DDHCPCANON_PATH="@0@"'.format(dhcpcanon.path())
|
||||
endif
|
||||
|
||||
if enable_dhclient
|
||||
cflags += '-DDHCLIENT_PATH="@0@"'.format(dhclient.path())
|
||||
endif
|
||||
|
||||
if enable_dhcpcd
|
||||
cflags += '-DDHCPCD_PATH="@0@"'.format(dhcpcd.path())
|
||||
endif
|
||||
cflags = nm_cflags
|
||||
|
||||
sources = files(
|
||||
'dhcp/nm-dhcp-client.c',
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ core_plugins += shared_module(
|
|||
name,
|
||||
sources: 'nm-ppp-manager.c',
|
||||
dependencies: deps,
|
||||
c_args: '-DPPPD_PLUGIN_DIR="@0@"'.format(pppd_plugin_dir),
|
||||
link_args: [
|
||||
'-Wl,--version-script,@0@'.format(linker_script),
|
||||
],
|
||||
|
|
|
|||
|
|
@ -1,15 +1,9 @@
|
|||
name = 'nm-settings-plugin-ibft'
|
||||
|
||||
cflags = [
|
||||
'-DSBINDIR="@0@"'.format(nm_sbindir),
|
||||
'-DSYSCONFDIR="@0@"'.format(nm_sysconfdir)
|
||||
]
|
||||
|
||||
libnms_ibft_core = static_library(
|
||||
'nms-ibft-core',
|
||||
'nms-ibft-reader.c',
|
||||
dependencies: nm_dep,
|
||||
c_args: cflags
|
||||
)
|
||||
|
||||
sources = files(
|
||||
|
|
@ -21,7 +15,6 @@ libnm_settings_plugin_ibft = shared_module(
|
|||
name,
|
||||
sources: sources,
|
||||
dependencies: nm_dep,
|
||||
c_args: cflags,
|
||||
link_with: libnms_ibft_core,
|
||||
link_args: ldflags_linker_script_settings,
|
||||
link_depends: linker_script_settings,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ exe = executable(
|
|||
test_unit,
|
||||
test_unit + '.c',
|
||||
dependencies: test_nm_dep,
|
||||
c_args: nm_build_cflags,
|
||||
link_with: libnms_ibft_core
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,6 @@ install_data(
|
|||
install_dir: dbus_conf_dir
|
||||
)
|
||||
|
||||
cflags = [
|
||||
'-DSBINDIR="@0@"'.format(nm_sbindir),
|
||||
'-DSYSCONFDIR="@0@"'.format(nm_sysconfdir)
|
||||
]
|
||||
|
||||
name = 'nmdbus-ifcfg-rh'
|
||||
|
||||
dbus_sources = gnome.gdbus_codegen(
|
||||
|
|
@ -21,7 +16,6 @@ libnmdbus_ifcfg_rh = static_library(
|
|||
name,
|
||||
sources: dbus_sources,
|
||||
dependencies: glib_dep,
|
||||
c_args: cflags
|
||||
)
|
||||
|
||||
sources = files(
|
||||
|
|
@ -41,7 +35,6 @@ libnms_ifcfg_rh_core = static_library(
|
|||
'nms-ifcfg-rh-core',
|
||||
sources: sources,
|
||||
dependencies: deps,
|
||||
c_args: cflags
|
||||
)
|
||||
|
||||
sources = [dbus_sources] + files('nms-ifcfg-rh-connection.c')
|
||||
|
|
@ -50,7 +43,6 @@ libnm_settings_plugin_ifcfg_rh = shared_module(
|
|||
'nm-settings-plugin-ifcfg-rh',
|
||||
sources: sources,
|
||||
dependencies: deps,
|
||||
c_args: cflags,
|
||||
link_with: [libnms_ifcfg_rh_core],
|
||||
link_args: ldflags_linker_script_settings,
|
||||
link_depends: linker_script_settings,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ exe = executable(
|
|||
test_unit,
|
||||
test_unit + '.c',
|
||||
dependencies: test_nm_dep,
|
||||
c_args: nm_build_cflags,
|
||||
link_with: libnms_ifcfg_rh_core
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,13 +8,10 @@ deps = [
|
|||
nm_dep
|
||||
]
|
||||
|
||||
cflags = '-DSYSCONFDIR="@0@"'.format(nm_sysconfdir)
|
||||
|
||||
libnms_ifupdown_core = static_library(
|
||||
'nms-ifupdown-core',
|
||||
sources: sources,
|
||||
dependencies: deps,
|
||||
c_args: cflags
|
||||
)
|
||||
|
||||
sources = files(
|
||||
|
|
@ -26,7 +23,6 @@ libnm_settings_plugin_ifupdown = shared_module(
|
|||
'nm-settings-plugin-ifupdown',
|
||||
sources: sources,
|
||||
dependencies: deps,
|
||||
c_args: cflags,
|
||||
link_with: libnms_ifupdown_core,
|
||||
link_args: ldflags_linker_script_settings,
|
||||
link_depends: linker_script_settings,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ exe = executable(
|
|||
test_unit,
|
||||
test_unit + '.c',
|
||||
dependencies: test_nm_dep,
|
||||
c_args: nm_build_cflags,
|
||||
link_with: libnms_ifupdown_core
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ exe = executable(
|
|||
test_unit,
|
||||
test_unit + '.c',
|
||||
dependencies: test_nm_dep,
|
||||
c_args: nm_build_cflags,
|
||||
)
|
||||
|
||||
test(
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ exe = executable(
|
|||
test_unit,
|
||||
test_unit + '.c',
|
||||
dependencies: test_nm_dep,
|
||||
c_args: nm_build_cflags,
|
||||
)
|
||||
|
||||
test(
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ exe = executable(
|
|||
test_unit,
|
||||
sources,
|
||||
dependencies: test_nm_dep,
|
||||
c_args: nm_build_cflags,
|
||||
)
|
||||
|
||||
test(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue