diff --git a/Makefile.am b/Makefile.am index 7501765364..e6d491fd39 100644 --- a/Makefile.am +++ b/Makefile.am @@ -103,37 +103,19 @@ dflt_cppflags = -std=gnu11 ############################################################################### -# 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: config.h - $(AM_V_GEN) \ - echo "/* Generated by Makefile.am */" >$@ && \ - echo "#define BINDIR \"$(bindir)\"" >>$@ && \ - echo "#define DATADIR \"$(datadir)\"" >>$@ && \ - 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 RUNSTATEDIR \"$(runstatedir)\"" >>$@ && \ - echo "#define SYSCONFDIR \"$(sysconfdir)\"" >>$@ && \ - true +include config-extra.h.mk DISTCLEANFILES += config-extra.h -libnm-core/.dirstamp: config-extra.h +$(libnm_core_lib_h_pub_mkenums): config-extra.h +libnm-core/.dirstamp: config-extra.h +shared/.dirstamp: config-extra.h +shared/nm-glib-aux/.dirstamp: config-extra.h +shared/nm-std-aux/.dirstamp: config-extra.h +shared/nm-udev-aux/.dirstamp: config-extra.h +shared/systemd/.dirstamp: config-extra.h +shared/systemd/src/basic/.dirstamp: config-extra.h +src/dhcp/.dirstamp: config-extra.h ############################################################################### diff --git a/config-extra.h.mk b/config-extra.h.mk new file mode 100644 index 0000000000..b1d3814ff0 --- /dev/null +++ b/config-extra.h.mk @@ -0,0 +1,27 @@ +# 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: config-extra.h.mk config.h + $(AM_V_GEN) \ + echo "/* Generated by Makefile.am */" >$@ && \ + echo "#define BINDIR \"$(bindir)\"" >>$@ && \ + echo "#define DATADIR \"$(datadir)\"" >>$@ && \ + 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 RUNSTATEDIR \"$(runstatedir)\"" >>$@ && \ + echo "#define SYSCONFDIR \"$(sysconfdir)\"" >>$@ && \ + true