* [PATCH] configure: Respect LDFLAGS from the environment.
@ 2010-05-12 16:45 Nelson Elhage
2010-05-12 17:00 ` Jameson Rollins
0 siblings, 1 reply; 5+ messages in thread
From: Nelson Elhage @ 2010-05-12 16:45 UTC (permalink / raw)
To: notmuch; +Cc: Nelson Elhage
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-}
XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config-1.1 xapian-config}
# We don't allow the EMACS or GZIP Makefile variables inherit values
@@ -389,6 +390,9 @@ CFLAGS = ${CFLAGS}
# Default FLAGS for C++ compiler (can be overridden by user such as "make CXXFLAGS=-g")
CXXFLAGS = ${CXXFLAGS}
+# Default FLAGS for the linker (can be overridden by user such as "make LDFLAGS=-znow")
+LDFLAGS = ${LDFLAGS}
+
# Flags to enable warnings when using the C++ compiler
WARN_CXXFLAGS=-Wall -Wextra -Wwrite-strings -Wswitch-enum
--
1.6.6.30.g1e6fd
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] configure: Respect LDFLAGS from the environment.
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
0 siblings, 1 reply; 5+ messages in thread
From: Jameson Rollins @ 2010-05-12 17:00 UTC (permalink / raw)
To: Nelson Elhage, notmuch
[-- Attachment #1: Type: text/plain, Size: 800 bytes --]
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.
[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] configure: Respect LDFLAGS from the environment.
2010-05-12 17:00 ` Jameson Rollins
@ 2010-05-12 17:29 ` Nelson Elhage
2010-05-12 17:44 ` Jameson Rollins
2010-06-04 1:19 ` Carl Worth
0 siblings, 2 replies; 5+ messages in thread
From: Nelson Elhage @ 2010-05-12 17:29 UTC (permalink / raw)
To: Jameson Rollins; +Cc: notmuch
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] configure: Respect LDFLAGS from the environment.
2010-05-12 17:29 ` Nelson Elhage
@ 2010-05-12 17:44 ` Jameson Rollins
2010-06-04 1:19 ` Carl Worth
1 sibling, 0 replies; 5+ messages in thread
From: Jameson Rollins @ 2010-05-12 17:44 UTC (permalink / raw)
To: Nelson Elhage; +Cc: notmuch
[-- Attachment #1: Type: text/plain, Size: 533 bytes --]
On Wed, 12 May 2010 13:29:55 -0400, Nelson Elhage <nelhage@mit.edu> wrote:
> 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".
Interesting! Ok, I stand corrected. I was looking through the bash man
page to refresh my memory, and I didn't see that option. Good thing I
didn't put any money on it!
jamie.
[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] configure: Respect LDFLAGS from the environment.
2010-05-12 17:29 ` Nelson Elhage
2010-05-12 17:44 ` Jameson Rollins
@ 2010-06-04 1:19 ` Carl Worth
1 sibling, 0 replies; 5+ messages in thread
From: Carl Worth @ 2010-06-04 1:19 UTC (permalink / raw)
To: Nelson Elhage, Jameson Rollins; +Cc: notmuch
[-- Attachment #1: Type: text/plain, Size: 711 bytes --]
On Wed, 12 May 2010 13:29:55 -0400, Nelson Elhage <nelhage@MIT.EDU> wrote:
> Hm. You're probably right that it should be ${LDFLAGS:-} for
> consistency with the others, but what I wrote is functionally correct:
Thanks for the lesson! I learned something new. I've committed this
change now, (with the assignment consistent with the others in the
file).
> (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.)
I merged this commit in with Tomas' earlier commit, which was
functionally identical, but didn't have that line at all.
-Carl
--
carl.d.worth@intel.com
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-06-04 1:19 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2010-05-12 17:44 ` Jameson Rollins
2010-06-04 1:19 ` Carl Worth
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).