1. 17 Jul, 2018 1 commit
    • Thomas Haller's avatar
      build: create "config-extra.h" header instead of passing directory variables via CFLAGS · a75ab799
      Thomas Haller authored
      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 commit e5d1a713
         and commit d63cf1ef).
         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
      a75ab799
  2. 28 Jun, 2018 1 commit
  3. 31 May, 2018 2 commits
    • Thomas Haller's avatar
      build/meson: fix meson build for shared files · f445128a
      Thomas Haller authored
      The files in shared/nm-utils are not compiled as one static library,
      instead each subproject that needs (parts of) them, re-compiles the
      files individually.
      
      The major reason for that is, because we might have different compile
      flags, depending on whether we build libnm-core or
      libnm-util/libnm-glib. Actually, I think that is not really the case,
      and maybe this should be refactored, to indeed build them all as a
      static library first.
      
      Anyway, libnm-util, libnm-glib, clients' common lib, they all need a
      different set of shared files that they should compile. Refactor
      "shared/meson.build" to account for that and handle it like autotools
      does.
      
      Another change is, that "shared_c_siphash_dep" no longer advertises
      "include_directories: include_directories('c-siphash/src')". We don't
      put c-siphash.h into the include search path. Users who need it, should
      include it via "#include <c-siphash/src/c-siphash.h>". The only exception
      is when building shared_n_acd library, which is not under our control.
      f445128a
    • Thomas Haller's avatar
      e5d1a713
  4. 11 Jan, 2018 1 commit
  5. 10 Jan, 2018 3 commits
    • Thomas Haller's avatar
      build/meson: unconditionally use linker version scripts · 349861ce
      Thomas Haller authored
      We also unconditionally use them with autotools.
      Also, the detection for have_version_script does
      not seem correct to me. At least, it didn't work
      with clang.
      349861ce
    • Inigo Martínez's avatar
      meson: Use string variables extensively · 50930ed1
      Inigo Martínez authored
      The strings holding the names used for libraries have also been
      moved to different variables. This way they would be less error
      as these variables can be reused easily and any typing error
      would be quickly detected.
      50930ed1
    • Inigo Martínez's avatar
      meson: Improve dependency system · 5e16bcf2
      Inigo Martínez authored
      Some targets are missing dependencies on some generated sources in
      the meson port. These makes the build to fail due to missing source
      files on a highly parallelized build.
      
      These dependencies have been resolved by taking advantage of meson's
      internal dependencies which can be used to pass source files,
      include directories, libraries and compiler flags.
      
      One of such internal dependencies called `core_dep` was already in
      use. However, in order to avoid any confusion with another new
      internal dependency called `nm_core_dep`, which is used to include
      directories and source files from the `libnm-core` directory, the
      `core_dep` dependency has been renamed to `nm_dep`.
      
      These changes have allowed minimizing the build details which are
      inherited by using those dependencies. The parallelized build has
      also been improved.
      5e16bcf2
  6. 08 Jan, 2018 1 commit
    • Thomas Haller's avatar
      build: refine the NETWORKMANAGER_COMPILATION define · 22ef6a50
      Thomas Haller authored
      Note that:
      
       - we compile some source files multiple times. Most notably those
         under "shared/".
      
       - we include a default header "shared/nm-default.h" in every source
         file. This header is supposed to setup a common environment by defining
         and including parts that are commonly used. As we always include the
         same header, the header must behave differently depending
         one whether the compilation is for libnm-core, NetworkManager or
         libnm-glib. E.g. it must include <glib/gi18n.h> or <glib/gi18n-lib.h>
         depending on whether we compile a library or an application.
      
      For that, the source files need the NETWORKMANAGER_COMPILATION #define
      to behave accordingly.
      
      Extend the define to be composed of flags. These flags are all named
      NM_NETWORKMANAGER_COMPILATION_WITH_*, they indicate which part of the
      build are available. E.g. when building libnm-core.la itself, then
      WITH_LIBNM_CORE, WITH_LIBNM_CORE_INTERNAL, and WITH_LIBNM_CORE_PRIVATE
      are available. When building NetworkManager, WITH_LIBNM_CORE_PRIVATE
      is not available but the internal parts are still accessible. When
      building nmcli, only WITH_LIBNM_CORE (the public part) is available.
      This granularily controls the build.
      22ef6a50
  7. 02 Jan, 2018 1 commit
  8. 18 Dec, 2017 1 commit
  9. 13 Dec, 2017 1 commit