unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Nelson Elhage <nelhage@MIT.EDU>
To: Jameson Rollins <jrollins@finestructure.net>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] configure: Respect LDFLAGS from the environment.
Date: Wed, 12 May 2010 13:29:55 -0400	[thread overview]
Message-ID: <20100512172955.GB32152@mit.edu> (raw)
In-Reply-To: <87wrv9caxg.fsf@servo.finestructure.net>

Hm. You're probably right that it should be ${LDFLAGS:-} for
consistency with the others, but what I wrote is functionally correct:

${LDFLAGS-FOO} means "If LDFLAGS is set at all (even to an empty
value), substitute $LDFLAGS; otherwise, substitute FOO".

${LDFLAGS:-FOO} is the same, except in the case where LDFLAGS is set
to the empty string, in which case it substitutes FOO.

So, for the case where FOO is the empty string, they're
identical. However, since I chose ${LDFLAGS-} out of habit, and not
particularly intentionally, and the other lines use :-, so it probably
makes sense to use that form instead.

(Of course, as long as the default is empty and we're not running
under 'set -u', we could just remove the line entirely. But I think
it's good for the sake of explicitness.)

- Nelson

(If you're morbidly curious,
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02
defines all the different ${blah} forms you can use in sh)

On Wed, May 12, 2010 at 01:00:27PM -0400, Jameson Rollins wrote:
> On Wed, 12 May 2010 12:45:52 -0400, Nelson Elhage <nelhage@ksplice.com> wrote:
> > The configure usage string documents that it respects LDFLAGS, but
> > currently it doesn't do anything with the configure-time LDFLAGS
> > value.
> > ---
> >  configure |    4 ++++
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> > 
> > diff --git a/configure b/configure
> > index c522ad8..90355e8 100755
> > --- a/configure
> > +++ b/configure
> > @@ -6,6 +6,7 @@ CC=${CC:-gcc}
> >  CXX=${CXX:-g++}
> >  CFLAGS=${CFLAGS:--O2}
> >  CXXFLAGS=${CXXFLAGS:-\$(CFLAGS)}
> > +LDFLAGS=${LDFLAGS-}
> 
> Hey, Nelson.  I'm not sure exactly what you're trying to do here, but
> I'm betting that this is not it.  If you're trying to get the LDFLAGS
> var from the existing environment, you probably want:
> 
> LDFLAGS=${LDFLAGS:-}
> 
> jamie.



> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

  reply	other threads:[~2010-05-12 17:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-12 16:45 [PATCH] configure: Respect LDFLAGS from the environment Nelson Elhage
2010-05-12 17:00 ` Jameson Rollins
2010-05-12 17:29   ` Nelson Elhage [this message]
2010-05-12 17:44     ` Jameson Rollins
2010-06-04  1:19     ` Carl Worth

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

  List information: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to=20100512172955.GB32152@mit.edu \
    --to=nelhage@mit.edu \
    --cc=jrollins@finestructure.net \
    --cc=notmuch@notmuchmail.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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).