1. 18 Apr, 2019 1 commit
    • Thomas Haller's avatar
      shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" · d984b2ce
      Thomas Haller authored
      From the files under "shared/nm-utils" we build an internal library
      that provides glib-based helper utilities.
      
      Move the files of that basic library to a new subdirectory
      "shared/nm-glib-aux" and rename the helper library "libnm-core-base.la"
      to "libnm-glib-aux.la".
      
      Reasons:
      
       - the name "utils" is overused in our code-base. Everything's an
         "utils". Give this thing a more distinct name.
      
       - there were additional files under "shared/nm-utils", which are not
         part of this internal library "libnm-utils-base.la". All the files
         that are part of this library should be together in the same
         directory, but files that are not, should not be there.
      
       - the new name should better convey what this library is and what is isn't:
         it's a set of utilities and helper functions that extend glib with
         funcitonality that we commonly need.
      
      There are still some files left under "shared/nm-utils". They have less
      a unifying propose to be in their own directory, so I leave them there
      for now. But at least they are separate from "shared/nm-glib-aux",
      which has a very clear purpose.
      
      (cherry picked from commit 80db06f7)
      d984b2ce
  2. 03 Apr, 2019 1 commit
  3. 19 Mar, 2019 1 commit
    • Lubomir Rintel's avatar
      all: goodbye libnm-glib · 1de8383a
      Lubomir Rintel authored
      This removes libnm-glib, libnm-glib-vpn, and libnm-util for good.
      The it has been replaced with libnm since NetworkManager 1.0, disabled
      by default since 1.12 and no up-to-date distributions ship it for years
      now.
      
      Removing the libraries allows us to:
      
      * Remove the horrible hacks that were in place to deal with accidental use
        of both the new and old library in a single process.
      * Relief the translators of maintenance burden of similar yet different
        strings.
      * Get rid of known bad code without chances of ever getting fixed
        (libnm-glib/nm-object.c and libnm-glib/nm-object-cache.c)
      * Generally lower the footprint of the releases and our workspace
      
      If there are some really really legacy users; they can just build
      libnm-glib and friends from the NetworkManager-1.16 distribution. The
      D-Bus API is stable and old libnm-glib will keep working forever.
      
      https://github.com/NetworkManager/NetworkManager/pull/308
      1de8383a
  4. 05 Feb, 2019 1 commit
    • Thomas Haller's avatar
      build/meson: add intermediate shared/nm-utils base library · c67ebc8a
      Thomas Haller authored
      Like also done for autotools, create and use intermediate libraries
      from "shared/nm-utils/".
      
      Also, replace "shared_dep" by "shared_nm_utils_base_dep". We don't
      need super fine-grained selection of what we link. We can always
      link in "shared/libnm-utils-base.a", and let the linker throw away
      unsed parts.
      c67ebc8a
  5. 20 Dec, 2018 1 commit
  6. 17 Sep, 2018 1 commit
  7. 28 Aug, 2018 1 commit
  8. 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
  9. 31 May, 2018 1 commit
    • Thomas Haller's avatar
      build: use default NM_BUILD_* defines for tests · b7426e91
      Thomas Haller authored
      Use two common defines NM_BUILD_SRCDIR and NM_BUILD_BUILDDIR
      for specifying the location of srcdir and builddir.
      
      Note that this is only relevant for tests, as they expect
      a certain layout of the directories, to find files that concern
      them.
      b7426e91
  10. 12 Apr, 2018 2 commits
  11. 10 Jan, 2018 1 commit
    • 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
  12. 08 Jan, 2018 2 commits
    • Thomas Haller's avatar
      tests: use NMTST_EXPECT*() macros · 25ade397
      Thomas Haller authored
      Tests are commonly created via copy&paste. Hence, it's
      better to express a certain concept explicitly via a function
      or macro. This way, the implementation of the concept can be
      adjusted at one place, without requiring to change all the callers.
      
      Also, the macro is shorter, and brevity is better for tests
      so it's easier to understand what the test does. Without being
      bothered by noise from the redundant information.
      
      Also, the macro knows better which message to expect. For example,
      messages inside "src" are prepended by nm-logging.c with a level
      and a timestamp. The expect macro is aware of that and tests for it
      
        #define NMTST_EXPECT_NM_ERROR(msg)      NMTST_EXPECT_NM (G_LOG_LEVEL_MESSAGE, "*<error> [*] "msg)
      
      This again allows the caller to ignore this prefix, but still assert
      more strictly.
      25ade397
    • 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
  13. 18 Dec, 2017 2 commits
  14. 14 Dec, 2017 2 commits
  15. 13 Dec, 2017 1 commit
  16. 21 Oct, 2016 1 commit
  17. 19 Oct, 2016 1 commit
  18. 03 Oct, 2016 1 commit
  19. 23 Sep, 2016 1 commit
  20. 16 Jun, 2016 1 commit
    • Thomas Haller's avatar
      shared: move shared files to subdirectory "shared/nm-utils/" · 4b288136
      Thomas Haller authored
      The "shared" directory contains files that are possibly used by all components
      of NetworkManager repository.
      
      Some of these files are even copied as-is to other projects (VPN plugins, nm-applet)
      and used there without modification. Move those files to a separate directory.
      By moving them to a common directory, it is clearer that they belong
      together. Also, you can easier compare the copied versions to their
      original via
      
        $ diff -r ./shared/nm-utils/ /path/to/nm-vpn-plugin/shared/nm-utils/
      4b288136
  21. 09 Jun, 2016 1 commit
  22. 06 Jun, 2016 1 commit
  23. 03 Jun, 2016 1 commit
    • Beniamino Galvani's avatar
      libnm-util: skip linking test when address sanitizer is enabled · 9aad9022
      Beniamino Galvani authored
      The linking test causes a crash to check whether libnm and libnm-util
      are both linked. If abrt or systemd-coredump are enabled, the core
      dump processing will take a long time when the address sanitizer is
      enabled, due to the huge process address space. It seems a good choice
      to disable the test when NM was compiled with -fsanitize=address.
      9aad9022
  24. 05 Apr, 2016 1 commit
    • Thomas Haller's avatar
      build: disable deprecation checks for internal compilation · 9152dec9
      Thomas Haller authored
      For internal compilation we want to be able to use deprecated
      API without warnings.
      
      Define the version min/max macros to effectively disable deprecation
      warnings.
      
      However, don't do it via CFLAGS option in the makefiles, instead hack it
      to "nm-default.h". After all, *every* source file that is for internal
      compilation needs to include this header as first.
      9152dec9
  25. 19 Feb, 2016 1 commit
    • Thomas Haller's avatar
      all: cleanup includes and let "nm-default.h" include "config.h" · 8bace23b
      Thomas Haller authored
      - All internal source files (except "examples", which are not internal)
        should include "config.h" first. As also all internal source
        files should include "nm-default.h", let "config.h" be included
        by "nm-default.h" and include "nm-default.h" as first in every
        source file.
        We already wanted to include "nm-default.h" before other headers
        because it might contains some fixes (like "nm-glib.h" compatibility)
        that is required first.
      
      - After including "nm-default.h", we optinally allow for including the
        corresponding header file for the source file at hand. The idea
        is to ensure that each header file is self contained.
      
      - Don't include "config.h" or "nm-default.h" in any header file
        (except "nm-sd-adapt.h"). Public headers anyway must not include
        these headers, and internal headers are never included after
        "nm-default.h", as of the first previous point.
      
      - Include all internal headers with quotes instead of angle brackets.
        In practice it doesn't matter, because in our public headers we must
        include other headers with angle brackets. As we use our public
        headers also to compile our interal source files, effectively the
        result must be the same. Still do it for consistency.
      
      - Except for <config.h> itself. Include it with angle brackets as suggested by
        https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
      8bace23b
  26. 14 Feb, 2016 4 commits
  27. 11 Feb, 2016 1 commit
  28. 03 Feb, 2016 1 commit
  29. 24 Dec, 2015 1 commit
    • Thomas Haller's avatar
      build: rename directory "include" to "shared" · db80ec05
      Thomas Haller authored
      Up to now, the "include" directory contained (only) header files that were
      used project-wide by libs, core, clients, et al.
      
      Since the directory now also contains a non-header file, the "include"
      name is misleading. Instead of adding yet another directory that is
      project-wide, with non-header-only content, rename the "include"
      directory to "shared".
      db80ec05
  30. 10 Oct, 2015 1 commit
  31. 06 Oct, 2015 1 commit
  32. 30 Sep, 2015 1 commit
    • Thomas Haller's avatar
      build: extract version macros from "nm-version.h" to new header file "nm-version-macros.h" · 7bf10a75
      Thomas Haller authored
      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 c0852964 removed that dependancy.
      
      For libnm-glib library, the analog to "nm-dbus-interface.h" is
      "NetworkManager.h", and the same applies there. Commit
      159e827a 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: 4545a7fe
      7bf10a75
  33. 10 Aug, 2015 1 commit
    • Dan Winship's avatar
      core: final gdbus porting · 1cf35cb2
      Dan Winship authored
      Port remaining bits to gdbus and remove stray dbus-glib references
      
      Drop the dbus-glib version check from configure, since nothing depends
      on new dbus-glib any more.
      
      Move nm-dbus-glib-types.h and nm-gvaluearray-compat.h from include/ to
      libnm-util/ since they are now only used by libnm-util and libnm-glib.
      1cf35cb2