From: Tomi Ollila <tomi.ollila@iki.fi> To: David Bremner <david@tethera.net>, Ryan Schmidt <notmuch@ryandesign.com>, notmuch@notmuchmail.org Subject: Re: Fix order of -I and -L flags Date: Mon, 20 Dec 2021 23:21:23 +0200 [thread overview] Message-ID: <m2ee67km5o.fsf@guru.guru-group.fi> (raw) In-Reply-To: <875yrnny4t.fsf@tethera.net> On Fri, Dec 17 2021, David Bremner wrote: > Ryan Schmidt <notmuch@ryandesign.com> writes: > >> The notmuch build system puts -I and -L flags in the wrong order. >> >> Specifically, -I flags the user might specify in the CPPFLAGS >> environment variable appear before the -I flags for the project's own >> directories, resulting in build failure if a previous version of >> notmuch (whose headers differ sufficiently from the new version) was >> already installed. >> >> https://trac.macports.org/ticket/63274 >> >> Similarly, -L flags the user might specify in the LDFLAGS environment >> variable appear before the -L flags for the project's own directories, >> resulting in build failure if a previous version of notmuch (whose >> libraries differ sufficiently from the new version) was already >> installed. >> >> https://trac.macports.org/ticket/63665 > > Although I don't consider GNU standards normative for notmuch, there is > some value in doing things a standard way. In particular the way notmuch > uses {C,CPP,LD,CXX}FLAGS follows e.g. [1]. Does it ? I initially thought CFLAGS should be first so that user can modify anything, but then I thought that CFLAGS should be last just so that the "project internal" includes are taken first. 2 things) (1) I was wrong with where user can modify anything: -I's, -L's in c compiler options are used in order, but (OTOH) (probably) some other options given later may override previously given option. then (2) [1] seems to say that "Put CFLAGS last in the compilation command, after other variables containing compiler options, so the user can use CFLAGS to override the others. " ^^ that would also say mean that the -I's and -L's given in ${CFLAGS} would be effective after the -I's and -L' configured... > > I guess on the Linux / BSD side we expect the configure script to do the > heavy lifting so that manual setting of CPPFLAGS / LDFLAGS at build time > is not needed in general. So one question is why isn't this the case for > macports? > > I think there is value in letting individual end-users use these > variables to override things (we just saw a case the other day where > that fixed someone's unique build problem). What was the case ? > I'm open to ideas for how we can make things easier for macports without > taking away existing functionality for other users. Would putting CFLAGS last break someone's workflow? Did I understand correctly what [1] mean for use of CFLAGS ? > > d > > [1]: https://www.gnu.org/prep/standards/html_node/Command-Variables.html. Tomi
next prev parent reply other threads:[~2021-12-20 21:30 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-12-17 1:08 Ryan Schmidt 2021-12-17 13:45 ` David Bremner 2021-12-20 21:21 ` Tomi Ollila [this message] 2021-12-20 22:58 ` David Bremner 2021-12-21 7:33 ` Ryan Schmidt 2021-12-24 18:29 ` [PATCH 1/3] build: move LDFLAGS after notmuch libraries David Bremner 2021-12-24 18:29 ` [PATCH 2/3] build: move CPPFLAGS after source directory includes David Bremner 2021-12-24 18:29 ` [PATCH 3/3] build: move {C,CXX}FLAGS to the end of FINAL_{C,CXX}FLAGS David Bremner 2021-12-29 18:14 ` [PATCH 1/3] build: move LDFLAGS after notmuch libraries Tomi Ollila 2021-12-31 11:12 ` David Bremner
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=m2ee67km5o.fsf@guru.guru-group.fi \ --to=tomi.ollila@iki.fi \ --cc=david@tethera.net \ --cc=notmuch@notmuchmail.org \ --cc=notmuch@ryandesign.com \ --subject='Re: Fix order of -I and -L flags' \ /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
Code repositories for project(s) associated with this inbox: notmuch.git.git (no URL configured) 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).