[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: turn on --enable-gcc-warnings when in git tree
From: |
Eric Blake |
Subject: |
Re: turn on --enable-gcc-warnings when in git tree |
Date: |
Thu, 06 Sep 2012 06:41:08 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 |
On 09/06/2012 01:11 AM, Bernhard Voelker wrote:
>
>
> On September 6, 2012 at 8:39 AM Jim Meyering <address@hidden> wrote:
>
>> Bernhard Voelker wrote:
>>> What about making --enable-gcc-warnings the default
>>> for CU developers, i.e. when .git exists?
>>
>> Good idea.
>> If someone has gone to the trouble of building from cloned sources
>> they're probably also using modern enough tools.
>>
>> Do you feel like writing the patch?
>
> I'm not so familiar with coreutils' build system (you can
> guess from my recent mails when building failed in the last
> few days ...), so I'd be happy if someone else jumps in.
> I'll be busy with replacing a dying hard disk this weekend
> anyway ;-(
>
> A new --disable-gcc-warnings (or --disable-dev-warnings)
> would also be nice then ...
By virtue of the fact that you have --enable-gcc-warnings via autoconf,
you already automatically have --disable-gcc-warnings.
This patch should do it (although I didn't really stress-test it, but
just whipped something up for the purposes of a fast reply). If you
like it, I'll turn it into a formal patch before committing.
diff --git i/configure.ac w/configure.ac
index d087c33..e1aa6ca 100644
--- i/configure.ac
+++ w/configure.ac
@@ -75,7 +75,11 @@ AC_ARG_ENABLE([gcc-warnings],
*) AC_MSG_ERROR([bad value $enableval for gcc-warnings
option]) ;;
esac
gl_gcc_warnings=$enableval],
- [gl_gcc_warnings=no]
+ [if test -d "$srcdir"/.git; then
+ gl_gcc_warnings=yes
+ else
+ gl_gcc_warnings=no
+ fi]
)
# gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found],
[run-if-not-found])
--
Eric Blake address@hidden +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature