summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-07-12 10:23:35 +0200
committerThomas Haller <thaller@redhat.com>2018-07-17 17:46:39 +0200
commitb9bc20f4da12f15b8950daea177e6dda42cd6c3f (patch)
tree365474bde906ab0efb76172c74943f06a3db45e4 /Makefile.am
parent00a523c4f3d4fc94d818f85699ef03a46c16e099 (diff)
build: pass -std=gnu99 to compiler
With --enable-more-warnings, we already used -std=gnu99, see commit ba2b2de3adcf3e8286249523e3841858e0c2655c. Compilation may behave differently depending on the selected C standard that we choose. It seems wrong, with more-warnings, to build against a C standard, while otherwise leaving it undefind. Indeed, one might argue, that our build system should not use such compiler specific options. At least, not without detecting support for the compiler option during ./configure. However: - we already did this for --enable-more-warnings. - we should not program against a theoretical compiler. In practice, only gcc and clang works to build NetworkManager. Both these compilers support this option, so there is no reason to not use it. If we ever come into the situation to support another compiler, adjusting -std=gnu99 will be the smallest problem. Until that happens (and that's far from imminent), don't pretend to be portable to non-existing compilers and use the flag that in practice is available. See-also: https://gcc.gnu.org/onlinedocs/gcc/Standards.html
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am16
1 files changed, 15 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 9fe016445..353f57fb8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -105,6 +105,8 @@ endif
endif
+dflt_cppflags = -std=gnu99
+
###############################################################################
# with autotools, it is not easily possible to generate these defines
@@ -592,6 +594,7 @@ nodist_libnminclude_HEADERS += \
###############################################################################
dflt_cppflags_libnm_core = \
+ $(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
@@ -1216,6 +1219,7 @@ libnm_tests_libnm_vpn_plugin_utils_test_la_SOURCES = \
shared/nm-utils/nm-vpn-plugin-utils.h
libnm_tests_libnm_vpn_plugin_utils_test_la_CFLAGS = \
+ $(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
@@ -1322,7 +1326,7 @@ EXTRA_DIST += shared/c-list/src/c-list.h
###############################################################################
src_libsystemd_nm_la_cppflags = \
- $(dflt_cppflags_std) \
+ $(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
@@ -1859,6 +1863,7 @@ EXTRA_DIST += \
libexec_PROGRAMS += src/dhcp/nm-dhcp-helper
src_dhcp_nm_dhcp_helper_CPPFLAGS = \
+ $(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-DG_LOG_DOMAIN=\""nm-dhcp-helper"\" \
@@ -1920,6 +1925,7 @@ core_plugins += src/ppp/libnm-ppp-plugin.la
pppd_plugin_LTLIBRARIES += src/ppp/nm-pppd-plugin.la
src_ppp_nm_pppd_plugin_la_CPPFLAGS = \
+ $(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
@@ -3152,6 +3158,7 @@ noinst_LTLIBRARIES += \
dispatcher/libnm-dispatcher-core.la
dispatcher_cppflags = \
+ $(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
@@ -3249,6 +3256,7 @@ EXTRA_DIST += \
check_programs += dispatcher/tests/test-dispatcher-envp
dispatcher_tests_test_dispatcher_envp_CPPFLAGS = \
+ $(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
@@ -3289,6 +3297,7 @@ EXTRA_DIST += \
bin_PROGRAMS += clients/nm-online
clients_nm_online_CPPFLAGS = \
+ $(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
@@ -3317,6 +3326,7 @@ EXTRA_DIST += \
###############################################################################
clients_cppflags = \
+ $(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-core \
@@ -3830,6 +3840,7 @@ lib_LTLIBRARIES += libnm-util/libnm-util.la
libnm_util_libnm_util_includedir=$(includedir)/NetworkManager
libnm_util_cppflags = \
+ $(dflt_cppflags) \
-I$(srcdir)/libnm-util \
-I$(builddir)/libnm-util \
-I$(srcdir)/shared \
@@ -4041,6 +4052,7 @@ dist_dependencies += libnm-util/libnm-util.la
###############################################################################
libnm_util_tests_cppflags = \
+ $(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-util \
@@ -4120,6 +4132,7 @@ EXTRA_DIST += \
###############################################################################
libnm_glib_cppflags = \
+ $(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-util \
@@ -4398,6 +4411,7 @@ dist_dependencies += \
###############################################################################
libnm_glib_tests_cppflags = \
+ $(dflt_cppflags) \
-I$(srcdir)/shared \
-I$(builddir)/shared \
-I$(srcdir)/libnm-util \