Commit Graph

36 Commits

Author SHA1 Message Date
Lubomir Rintel
6d91c14b00 build: add macro to check the compiler flag support
Also, fold duplicate chunks together.
2016-05-18 20:53:51 +02:00
Lubomir Rintel
3b0dd0a55c trivial: rename compiler_warnings.m4 to compiler_options.m4
We'll use that for more compiler feature-checking macros.
2016-05-18 20:53:05 +02:00
Lubomir Rintel
85c92ff372 build: use the glib cflags when checking the compiler flags
Some of the checks include glib headers.
2016-05-18 20:52:36 +02:00
Thomas Haller
f7941ceba3 build: compile with -Wno-duplicate-decl-specifier
Duplicated const specifiers are allowed by C99 and can easily
happen in macros. Also, systemd's interal code will use them.

Disable this warning, it doesn't seem useful.
2016-03-09 11:45:03 +01:00
Thomas Haller
7e091a230a m4: update introspection.m4 with original file from gobject-introspection
Originally m4/introspection.m4 was copied from gobject-introspection
repository. We however modified it in commit f6272144e9.

Reimport the file with latest changes, but still preserving our
workaround.
2016-03-04 09:25:23 +01:00
Thomas Haller
f6272144e9 build: hack around compiler warning in g-ir-scanner
The autoconf macro for GIR passes $CFLAGS to g-ir-scanner.
g-ir-scanner extends those flags with the system-default which
includes -D_FORTIFY_SOURCE=2. Probably it should not do that,
but if you disable optimization, this results in a compler warning
in "/usr/include/features.h" [1]

    export CFLAGS='-O0'
    # Happens both with clang or gcc.
    #export CC=clang
    git clean -fdx
    ./autogen.sh
    make

Work around that by injecting -Wno-error to $CFLAGS when invoking
g-ir-scanner.

[1] Related: https://sourceware.org/bugzilla/show_bug.cgi?id=13979
2015-11-10 18:12:12 +01:00
Lubomir Rintel
b38bc15747 build: set -Werror when checking whether a -W<warning> option works
Otherwise the check is effectively a no-op and unknown options still get
turned on. This results in unknown warnings when build without
--with-extra-warnings=error:

  warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option]
2015-09-29 14:08:14 +02:00
Lubomir Rintel
84021454eb build: don't default to -Werror
It seems like a poor default for various downstream toolchains. We can't
anticipate the compiler warnings for future compiler versions and older
ones are prone to false positives. Also, older gdbus-codegen is known
to generate code that triggers compiler warnings.

Let's keep it enabled for maintainer builds and distcheck so that we're
sure a tool chain that builds releases without warnings exists.
2015-06-02 12:30:03 +02:00
Dan Williams
21fef6a357 build: correct help message about missing readline + termcap libraries 2015-05-11 10:33:21 -05:00
Lubomir Rintel
5206a9b28d build: fix clang + glib 2.43 build
Known glib issue. Fixes Fedora 22 build.
2015-03-19 16:29:33 +01:00
Lubomir Rintel
f0740aff88 build: disable warnings that trigger known clang problems
Fixes build with clang 3.5 on Fedora 21.
2015-03-19 11:48:49 +01:00
Lubomir Rintel
3ccc6f290d build: disable warnings where macros expand to tautological comparisons 2015-03-19 11:48:49 +01:00
Thomas Haller
0462104317 build: fix detecting support for -Wno-* compiler flags
Since GCC 4.4, gcc does not warn about unknown -Wno-* flags. At
least, it does not warning unless another warning is raised as well
(https://gcc.gnu.org/wiki/FAQ#wnowarning).

We didn't notice up to now, because we only tested flags that GCC
actually supports.

Hack around this, by checking for the -W* counterpart instead.
2015-02-24 18:43:44 +01:00
Thomas Haller
94274c6fcd build: fix wrongly linking against libreadline in all applications
Every Makefile in the subtrees would include -lreadline
as part of LIBS, hence every application would link against
the library.

This was broken since we added 'm4/ax_lib_readline.m4'.

Fixes: 29297f8531
2014-11-26 11:43:23 +01:00
Dan Williams
d2dd3b2c90 dhcp: add systemd-based "internal" DHCP client
We must also remove -Waggregate-return from m4/compiler-warnings.m4 because systemd
uses aggregate return (correctly) in a couple cases, and we cannot keep single-level
makefiles and override aggregate-return only for the systemd sub-library.

This client currently only supports DHCPv4 because the base systemd code
does not yet fully support DHCPv6.
2014-11-06 22:42:43 -06:00
Thomas Haller
f1a0b4afd2 build: renable -Wstrict-prototypes compiler warning
The warning -Wstrict-prototypes was disabled by commit
db9b1df0e4 .

Enable it again, but avoid warnings for WiMax SDK by explicitly disabling the
compiler warning where needed.

Apparently clang does not produce a warning for -Wstrict-prototypes,
hence we don't need a clang specific #pragma.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 14:09:52 +01:00
Thomas Haller
dd243ceefe build: refactor compiler_warnings.m4 macro
NM_COMPILER_WARNINGS still works the same, but
rename variables to have a CFLAGS_* prefix.

Also cleanup the construction of CFLAGS by appending
to CFLAGS_MORE_WARNINGS variable instead of appending
to CFLAGS, and resetting to SAVE_CFLAGS.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-10-29 12:40:03 +01:00
Dan Williams
b69143b508 build: ensure rl_echo_signal_char() exists in the readline library 2014-10-14 14:30:44 -05:00
Thomas Haller
5009f2c7a3 build/clang: fix detection of valid warning compiler flags
clang does not exit with error when it is called with an
unrecognized (warning) option. Instead it just prints
a warning that makes the configure script believe the
warning is supported. Later, during build we might pass
-Werror, which causes clang to fail due to unrecognized
arguments.

Fix the script to detect compiler warnings by passing
'-Werror=unknown-warning-option', which lets clang fail too.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-01 13:16:33 +02:00
Dan Williams
29297f8531 build: check harder for readline
Not all distros build their readline linked with a termcap library,
since apps are (apparently) supposed to choose one for themselves
and explicitly link to it when using readline.  So add some checks
to figure out whether readline is already linked, and if not, prefer
ncurses since we use that for nmtui already.

ax_lib_readline based off:

http://www.gnu.org/software/autoconf-archive/ax_lib_readline.html
2014-06-27 13:10:50 -05:00
Dan Winship
ece92fe67a build: add -Wformat-security to the default warning flags 2014-04-02 09:24:56 -04:00
Dan Winship
9008730f89 build: update gnome-code-coverage.m4
Update gnome-code-coverage.m4 from gnome-common to fix some (harmless)
error messages when coverage is disabled (bug 699943), and to add
support for lcov 1.10.
2013-05-09 09:19:08 -04:00
Pavel Šimerda
a3d6a825df coverage: delete *.gcno on make clean 2013-04-24 14:50:04 +02:00
Pavel Šimerda
663859c180 build: drop libnl 1.x and 2.x support, require libnl >= 3.2.7 2013-01-24 19:47:53 +01:00
Pavel Šimerda
998f4ccc88 build: add code coverage support
Use the following in Makefile.am to enable code coverage for individual modules:

@GNOME_CODE_COVERAGE_RULES@
my_program_LIBS = … $(CODE_COVERAGE_LDFLAGS) …
my_program_CFLAGS = … $(CODE_COVERAGE_CFLAGS) …
2013-01-08 13:30:56 +01:00
Dan Williams
bb363997ed build: add some more build-time warnings 2012-07-30 10:58:47 -05:00
Alberto Ruiz
b1e1ee79bd vala: add vala bindings for libnm-util and libnm-glib
This patch adds the autotools facilities to generate vapi files so that
libnm-util and libnm-glib can be consumed from Vala.

It depends on vapigen and it is a soft dependency.
2012-06-12 16:31:20 -05:00
Colin Walters
e4f51d1968 build: allow --set-more-warnings=no|yes|error
For the GNOME autobuilders, we want compiler warnings, but don't want
-Werror.  For developer compatibility, the default value is "error".

https://bugzilla.gnome.org/show_bug.cgi?id=668974
2012-02-09 16:54:04 -06:00
Krzesimir Nowak
c2fffd76d2 build: put test source code into AC_LANG_PROGRAM (bgo #655225)
This change silences autotools warnings about source code not
being inside AC_LANG_SOURCE in AC_LANG_CONFTEST.
2011-07-28 13:53:36 -05:00
Dan Williams
db9b1df0e4 build: don't use -Wstrict-prototypes (bgo #584947)
First, -Wstrict-prototypes wasn't actually getting used because
-Werror was already in CFLAGS and AC_TRY_COMPILE doesn't produce
main() functions with valid strict prototypes.  Suck.  But even
fixing that, the WiMAX SDK won't build with the flag, so just rip
it out.
2011-04-26 13:55:52 -05:00
Dan Williams
df511f74f7 build: use -Wundef and fix up cases where stuff wasn't defined (bgo #647157) 2011-04-14 13:19:12 -05:00
Dan Williams
b7259fd2a8 Merge remote branch 'origin/master' into rm-userset 2011-01-25 15:41:03 -06:00
Dan Williams
398993e2f4 build: turn off set-but-not-used variable warnings in new GCC 2011-01-24 15:57:33 -06:00
Giovanni Campagna
3ebecd2a29 introspection: add GObject introspection support (bgo #637032)
Add the necessary annotations (the mininum required, that is those
on return values. NULL parameters or container types may require
more), and the Autotools stuff to get a NetworkManager GIR for
libnm-util and a NMClient for libnm-glib.
2011-01-21 14:46:09 -06:00
Dan Winship
67a5f31fc8 Work around libnl address caching bug
rtnl_addr requires that all addresses have the "peer" attribute set in
order to be compared for equality, but this attribute is not normally
set. As a result, most addresses will not compare as equal even to
themselves, busting caching. We fix this for now by poking into the
guts of libnl if it is broken...
2009-08-26 14:37:17 -04:00
Michael Biebl
dbd85915f1 Split compiler warnings into separate m4 macro file
The m4 macro is called NM_COMPILER_WARNINGS. Being in a separate file
makes it easier reusable for the other NM projects.
2009-05-02 18:01:13 -04:00