NetworkManager/clients/cli
Thomas Haller a75ab799e4 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 commit e5d1a71396
   and commit d63cf1ef2f).
   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
2018-07-17 17:46:39 +02:00
..
agent.c all: remove consecutive empty lines 2018-04-30 16:24:52 +02:00
agent.h cli: add 'nmcli agent' command (bgo #739568) 2014-11-07 11:58:25 +01:00
common.c cli: add additional user-data argument to get_fcn() 2018-07-09 15:43:55 +02:00
common.h cli: merge IPv4 and IPv6 versions of ip/dhcp config print 2018-07-09 15:43:55 +02:00
connections.c cli: add support for configuring SR-IOV 2018-07-11 16:16:22 +02:00
connections.h cli: rework printing of vpn active-connection properties 2018-07-09 15:43:55 +02:00
devices.c all: don't use gchar/gshort/gint/glong but C types 2018-07-11 12:02:06 +02:00
devices.h cli: rework printing of "wired" and "wifi" device details 2018-07-09 15:43:55 +02:00
general.c cli: add additional user-data argument to get_fcn() 2018-07-09 15:43:55 +02:00
general.h cli: output a short summary of devices when called without arguments 2016-07-19 14:29:05 +02:00
meson.build build: create "config-extra.h" header instead of passing directory variables via CFLAGS 2018-07-17 17:46:39 +02:00
nmcli-completion cli: make nmcli do its own command completion 2017-02-13 16:32:15 +01:00
nmcli.c cli: rework printing of "wired" and "wifi" device details 2018-07-09 15:43:55 +02:00
nmcli.h cli: avoid passing NmCli to set_color() functions 2018-06-26 11:32:39 +02:00
polkit-agent.c cli: rework callbacks in NMPolkitListener to use one vtable structure 2018-04-16 16:03:14 +02:00
polkit-agent.h cli: add 'nmcli agent' command (bgo #739568) 2014-11-07 11:58:25 +01:00
settings.c cli: add additional user-data argument to get_fcn() 2018-07-09 15:43:55 +02:00
settings.h cli: move setting creation to meta data 2017-04-12 14:12:20 +02:00
utils.c cli: add additional user-data argument to get_fcn() 2018-07-09 15:43:55 +02:00
utils.h cli: add additional user-data argument to get_fcn() 2018-07-09 15:43:55 +02:00