public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: David Sastre <d.sastre.medina@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Error building run2 from source package in win7
Date: Wed, 25 May 2011 10:34:00 -0000	[thread overview]
Message-ID: <20110525103417.GA7442@jethro.local.lan> (raw)
In-Reply-To: <4DDC1ECD.8030609@cwilson.fastmail.fm>

[-- Attachment #1: Type: text/plain, Size: 3607 bytes --]

On Tue, May 24, 2011 at 05:10:37PM -0400, Charles Wilson wrote:
> On 5/24/2011 3:53 PM, David Sastre wrote:
> > On Tue, May 24, 2011 at 02:59:11PM -0400, Charles Wilson wrote:
> >> A-ha!
> >>
> >> Don't set -Werror as part of $CC, set it in $CFLAGS instead.
> > 
> > Which is what is defined in the *.cygport's src_compile func:
> > 
> > src_compile() {
> >         cd ${S}
> >         cygautoreconf
> >         cd ${B}
> >         cygconf CFLAGS="-Wall -Werror"
> >         cygmake
> > }
> > 
> > And I'm doing nothing but running 'cygport *.cygport all'.
> 
> Well, Eric is the real expert, and he says don't set the warning flags
> until the cygmake line, so that's first.  However, I assume the
> incantation above worked in the past for the original author of the
> .cygport(5) file, so why's it breaking for you?
> 
> Second, why does the STC below not work for you, when it worked for me?
> 
> > for the same reasons (config.log):
> > 
> > configure:2563: gcc -c -Wall -Werror  conftest.c >&5
> > cc1: warnings being treated as errors
> > conftest.c: In function 'main':
> > conftest.c:38:10: error: 't' is used uninitialized in this function
> > conftest.c:54:23: error: 'b' may be used uninitialized in this
> > function
> > configure:2563: $? = 1
> 
> Well, looking at my config.log, I too have:
> 
> configure:2498: checking for an ANSI C-conforming const
> configure:2563: gcc -c -Wall -Werror  conftest.c >&5
>                        ^^^^^^^^^^^^^
> configure:2563: $? = 0
> configure:2570: result: yes
> 
> but we already know that this conftest.c is not -Wall -Werror clean --
> or, at least, that YOUR conftest.c is not clean.
> 
> Digging deeper in my configure, I find that the test uses the shell
> function ac_fn_c_try_compile(), and that shell function has an
> interesting bit of code:
> 
> 1340      test -z "$ac_c_werror_flag" ||
> 1341      test ! -s conftest.err
> 1342        } && test -s conftest.$ac_objext; then :
> 1343   ac_retval=0
> 
> Hmmm...it's checking something to do with a Werror flag!  Maybe there's
> a workaround, but (a) is only activated if the -Werror is in CFLAGS, not
> CC -- otherwise *I* would have passed the STC with CC='gcc -Wall
> -Werror' but I didn't, and (b) its only present in specific (newer?)
> versions of autoconf, and you and I are using different versions.
> 
> Here's the first 3 lines of my configure script:
> 
>    1 #! /bin/sh
>    2 # Guess values for system-dependent variables and create Makefiles.
>    3 # Generated by GNU Autoconf 2.68.
> 
> What's yours say?

Autoconf version matches yours:

$ cygcheck -c autoconf2.5
Cygwin Package Information
Package              Version        Status
autoconf2.5          2.68-1         OK

$ head -3 configure
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.68 for run2 0.4.0.

Moving the -Werror flag to the cygmake step did the trick:

$ diff -u run2-0.4.0-1.cygport.orig run2-0.4.0-1.cygport
--- run2-0.4.0-1.cygport.orig   2009-12-29 07:30:19.000000000 +0100
+++ run2-0.4.0-1.cygport        2011-05-25 11:11:51.139200000 +0200
@@ -11,7 +11,7 @@
        cd ${S}
        cygautoreconf
        cd ${B}
-       cygconf CFLAGS="-Wall -Werror"
-       cygmake
+       cygconf CFLAGS="-Wall" 
+       cygmake CFLAGS="-Werror"
 }

checking for an ANSI C-conforming const... yes

I've been able to compile without problems.

Thanks for your time.

-- 
Huella de clave primaria: AD8F BDC0 5A2C FD5F A179  60E7 F79B AB04 5299 EC56

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 230 bytes --]

      reply	other threads:[~2011-05-25 10:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23 17:18 David Sastre
2011-05-23 17:22 ` Eric Blake
2011-05-23 18:34   ` Charles Wilson
2011-05-24 18:38     ` David Sastre
2011-05-24 18:48       ` Eric Blake
2011-05-24 18:59       ` Charles Wilson
2011-05-24 19:54         ` David Sastre
2011-05-24 21:10           ` Charles Wilson
2011-05-25 10:34             ` David Sastre [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110525103417.GA7442@jethro.local.lan \
    --to=d.sastre.medina@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).