On 10.01.2014 14:36, Lukas Slebodnik wrote:
On (10/01/14 13:38), Stef Walter wrote:
On 10.01.2014 10:26, Jakub Hrozek wrote:
On Thu, Jan 09, 2014 at 09:26:40PM +0100, Stef Walter wrote:
diff --git a/configure.ac b/configure.ac index f89de6e..9156dfa 100644 --- a/configure.ac +++ b/configure.ac @@ -325,7 +325,7 @@ SSS_WARNINGS=' for option in $SSS_WARNINGS; do SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $option"
- AC_MSG_CHECKING([whether compiler understands $option])
- AC_MSG_CHECKING([compiler option $option])
Was this hunk intended to be part of patch #1 ?
Moved to first patch.
I think there should be a default for "enable_strict". Othwerwise the configure output looks a bit odd when neither --enable-strict nor --disable-strict is selected:
Right ... removed the tristate, now it's just either on or off, defaulting to off (at least for now).
In other projects I've used it as a tristate where --enable-strict turns on strictness, and --disable-strict makes things more liberal than default. But no need to get into that here.
Cheers,
Stef
From c181a90e8493a804b3ff1f5b3d1571cdf04d7681 Mon Sep 17 00:00:00 2001 From: Stef Walter stefw@redhat.com Date: Thu, 9 Jan 2014 14:12:08 +0100 Subject: [PATCH 1/2] configure: Enable usual SSSD_WARNINGS automatically
Instead of limiting these to Fedora based sssd developers via the bashrc_sssd script, enable them automatically in configure if supported by the compiler.
configure.ac | 23 +++++++++++++++++++++++ contrib/fedora/bashrc_sssd | 12 ++---------- 2 files changed, 25 insertions(+), 10 deletions(-)
With this patch, flag "-Wall" is used two times. 1st occurence if from CFLAGS and the 2nd occurence is from AM_CFLAGS (in Makefile.am) Can we move flags "-Wextra -Wno-unused-parameter -Wno-sign-compare -Wformat-security" into AM_CFLAGS?
Only if they're supported by all gcc versions in use. With this configure based scheme we can add new warning flags (as desired) even if not all gcc versions support them.
But maybe that's not a big deal in practice?
From f1e1cad379367f21e0a98d7f136ada284954a610 Mon Sep 17 00:00:00 2001 From: Stef Walter stefw@redhat.com Date: Thu, 9 Jan 2014 14:26:46 +0100 Subject: [PATCH 2/2] configure: Add strict compilation mode with --enable-strict
configure.ac | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/configure.ac b/configure.ac index f66bf0b..42941ac 100644 --- a/configure.ac +++ b/configure.ac @@ -335,6 +335,22 @@ for option in $SSS_WARNINGS; do fi done
+dnl Strict Compilation -- -Werror etc.
+AC_ARG_ENABLE(strict, [
AS_HELP_STRING([--enable-strict],
[Strict code compilation [default: auto]])
^^^^ I think default is no
done.
])
+AC_MSG_CHECKING([build strict]) +if test "$enable_strict" = "yes"; then
- CFLAGS="$CFLAGS -Werror"
^^ replace tab with spaces
done.
+else
- enable_strict="no"
else branch is useless, because default value of enable_strict is no It is an default action of 4th optional argument in the macro AC_ARG_ENABLE
For whatever reason, that's not the case here, for some reason. In my experience AC_ARG_ENABLE is a tristate. When:
* --enable-xxx is not present then $enable_xxx == "" * --enable-xxx is present then $enable_xxx == "yes" * --disable-xxx is present then $disable_xxx == "no"
Do you have a different a sufficiently different autoconf (mine is 2.69)? I'd be sucprised if they changed something like that though...
Cheers,
Stef