configure: Fix build with capabilities
PATCH 1/1 configure: Fix build with capabilities
Since commit 417c9d72d48275d19c60861896efd4962d21aca2 all configure tests normally run with -Werror. Some of these tests now fail because they raised a compiler warning.
This patch fixes support for capabilities.
--- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
configure +1 -1
@@ -2082,7 +2082,7 @@ if test "$cap" != "no" ; then cat > $TMPC <<EOF #include <stdio.h> #include <sys/capability.h> -int main(void) { cap_t caps; caps = cap_init(); } +int main(void) { cap_t caps; caps = cap_init(); return caps != NULL; } EOF if compile_prog "" "-lcap" ; then cap=yes
Signature · 1 line
1.7.10
Quoted 16 lines · Stefan Weil
Since commit
417c9d72d48275d19c60861896efd4962d21aca2all configure tests normally run with -Werror. Some of these tests now fail because they raised a compiler warning.This patch fixes support for capabilities.
Signed-off-by Stefan Weil <[email protected]>--- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)configure +0
-0
configure if test "$cap" != "no" ; then · line 2085
Quoted 5 lines
configure +1
-1@@ -2082,7 +2082,7 @@ if test "$cap" != "no" ; then cat > $TMPC <<EOF #include <stdio.h> #include <sys/capability.h> -int main(void) { cap_t caps; caps = cap_init(); } +int main(void) { cap_t caps; caps = cap_init(); return caps != NULL; }
Nothing wrong with this patch, per se, but in the Autoconf world, the general advice is that programs should check whether -Werror is supported, but then avoid using it for the entire remainder of the configure script (that is, store the result of -Werror into a different variable that gets added into the final CFLAGS at make time, but not used during any of the rest of the configure time). That's because it's just too hard to avoid warnings-turned-into-errors for all possible versions (including future releases) of gcc, so you are just too likely to run into spurious changes in configurations when the next version of gcc starts warning about something new if you try to run all your configure tests with -Werror.
Signature · 2 lines
Eric Blake [email protected] +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 5 lines · Eric Blake
Quoted 3 lines · Stefan Weil
Since commit
417c9d72d48275d19c60861896efd4962d21aca2all configure tests normally run with -Werror. Some of these tests now fail because they raised a compiler warning.
Quoted 11 lines
Nothing wrong with this patch, per se, but in the Autoconf world, the general advice is that programs should check whether -Werror is supported, but then avoid using it for the entire remainder of the configure script (that is, store the result of -Werror into a different variable that gets added into the final CFLAGS at make time, but not used during any of the rest of the configure time). That's because it's just too hard to avoid warnings-turned-into-errors for all possible versions (including future releases) of gcc, so you are just too likely to run into spurious changes in configurations when the next version of gcc starts warning about something new if you try to run all your configure tests with -Werror.
Hmm, good point -- unlike the actual program compile, failures due to -Werror inside configure are silent and near-invisible. Maybe we should back out 417c9d72 ?
-- PMM
Quoted 16 lines · Peter Maydell
Quoted 4 lines · Eric Blake
Quoted 3 lines · Stefan Weil
Since commit
417c9d72d48275d19c60861896efd4962d21aca2all configure tests normally run with -Werror. Some of these tests now fail because they raised a compiler warning.Quoted 11 lines
Nothing wrong with this patch, per se, but in the Autoconf world, the general advice is that programs should check whether -Werror is supported, but then avoid using it for the entire remainder of the configure script (that is, store the result of -Werror into a different variable that gets added into the final CFLAGS at make time, but not used during any of the rest of the configure time). That's because it's just too hard to avoid warnings-turned-into-errors for all possible versions (including future releases) of gcc, so you are just too likely to run into spurious changes in configurations when the next version of gcc starts warning about something new if you try to run all your configure tests with -Werror.
Quoted 3 lines
Hmm, good point -- unlike the actual program compile, failures due to -Werror inside configure are silent and near-invisible. Maybe we should back out
417c9d72?
So how do we deal with the original problem then? The one where the build broke for me because the smartcard code got compiled in because configure didn't know that it would fail to compile with -Werror?
Alex
Quoted 8 lines · Alexander Graf
Quoted 3 lines · Peter Maydell
Hmm, good point -- unlike the actual program compile, failures due to -Werror inside configure are silent and near-invisible. Maybe we should back out
417c9d72?So how do we deal with the original problem then? The one where the build broke for me because the smartcard code got compiled in because configure didn't know that it would fail to compile with -Werror?
We could have a specific configure check for "can you include this header file in a -Werror compilation", I guess?
-- PMM
Quoted 6 lines · Peter Maydell
Quoted 5 lines · Alexander Graf
Quoted 3 lines · Peter Maydell
Hmm, good point -- unlike the actual program compile, failures due to -Werror inside configure are silent and near-invisible. Maybe we should back out
417c9d72?
Quoted 6 lines
Quoted 3 lines
So how do we deal with the original problem then? The one where the build broke for me because the smartcard code got compiled in because configure didn't know that it would fail to compile with -Werror?
We could have a specific configure check for "can you include this header file in a -Werror compilation", I guess?
That's what my first patch did.
Alex