diff options
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 107 |
1 files changed, 46 insertions, 61 deletions
diff --git a/Makefile.am b/Makefile.am index 45074fa1e7..4fff329b04 100644 --- a/Makefile.am +++ b/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) \ |