diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2016-05-20 15:01:14 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-06-03 22:19:37 +0200 |
commit | 76eca6aca9676da5e860b65ab7c77d83580fc8a1 (patch) | |
tree | 899c76e9ff62fb51767ff920f22e3ec37378f1b0 | |
parent | 54b873a4757a5cce90057e5d79909ac9ba7671ac (diff) | |
download | NetworkManager-76eca6aca9676da5e860b65ab7c77d83580fc8a1.tar.gz |
build: configure.ac: replace NM_COMPILER_FLAG with CC_CHECK_FLAG_APPEND
-rw-r--r-- | configure.ac | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index cad6b4b6f4..ad9a6e0ae4 100644 --- a/configure.ac +++ b/configure.ac @@ -954,13 +954,17 @@ fi AC_ARG_ENABLE(ld-gc, AS_HELP_STRING([--enable-ld-gc], [Enable garbage collection of unused symbols on linking (default: auto)])) if (test "${enable_ld_gc}" != "no"); then - NM_COMPILER_FLAG([-fdata-sections -ffunction-sections -Wl,--gc-sections], [enable_ld_gc='yes'], [ - if (test "${enable_ld_gc}" = "yes"); then - AC_MSG_ERROR([Unused symbol eviction requested but not supported.]) - else - enable_ld_gc='no' - fi - ]) + CC_CHECK_FLAG_APPEND([ld_gc_flags], [CFLAGS], [-fdata-sections -ffunction-sections -Wl,--gc-sections]) + if (test -n "${ld_gc_flags}"); then + enable_ld_gc="yes" + CFLAGS="$CFLAGS $ld_gc_flags" + else + if (test "${enable_ld_gc}" = "yes"); then + AC_MSG_ERROR([Unused symbol eviction requested but not supported.]) + else + enable_ld_gc="no" + fi + fi fi dnl ------------------------- |