git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v5 01/18] Makefile: pass CPPFLAGS through to fllow customization

From
GVGary V. Vaughan <git@mlists.thewrittenword.com>
Date
May 14, 2010, 12:01 UTC
Message-ID
<20100514120116.GC31921@thor.il.thewrittenword.com>
In-Reply-To
<robbat2-20100514T110034-766521339Z@orbis-terrarum.net>
Hi Robin,
On Fri, May 14, 2010 at 11:04:59AM +0000, Robin H. Johnson wrote:
Show 8 quoted lines
> On Fri, May 14, 2010 at 10:58:32AM +0000, Gary V. Vaughan wrote:
> > As a matter of fact, Automake even jumps through hoops with
> > AM_CPPFLAGS to make sure that the package maintainer doesn't
> > accidentally trample over the package builder's CPPFLAGS settings - I
> > can't think of a scenario where the person who writes the build system
> > for a package knows more about what CPPFLAGS the person who builds it
> > will need that the person doing the actual building.
> AM_CFLAGS != AM_CPPFLAGS. My concern was the mixing of them.

While I agree that mixing up AM_CFLAGS and AM_CPPFLAGS, or even AM_CXXFLAGS and AM_CFLAGS is likely to break your build, that's no reason to deprecate the user's CPPFLAGS setting!

Show 6 quoted lines
> As a middle ground:
> CFLAGS = $(OPTCFLAGS) -Wall
> CPPFLAGS = $(OPTCPPFLAGS)
> LDFLAGS = $(OPTLDFLAGS)
> CC = $(OPTCC)
> AR = $(OPTAR)

Okay, I think we are mostly in agreement here. In all the packages we build here at TWW, we let the user use CFLAGS, CPPFLAGS, LDFLAGS etc, and to preserve that we'll jump through some Automake-like hoops so that the build system doesn't overwrite them at build time.

You actually propose the same separation, except that you want the package builder to use the OPTCFLAGS, OPTCPPFLAGS, OPTLDFLAGS etc so that the build system can use CFLAGS et al. I don't think this buys you anything but confusion when anyone used to building on Unix over the last 20 or 30 years tries to pass flags into the build using the tried and tested mechanism (CFLAGS, CPPFLAGS et al) to no effect.

Git already follows the tried and tested mechanism, but forgot to honor the user's CPPFLAGS setting, which is what this patch is trying to address.

Cheers,
-- 
Gary V. Vaughan (gary@thewrittenword.com)
Previous: Robin H. JohnsonNext: Gary V. Vaughan
Message 6 of 34 in “Portability patches for git-1.7.1”
  1. 00/18 Portability patches for git-1.7.1Gary V. Vaughan, May 14, 2010
  2. 01/18 Makefile: pass CPPFLAGS through to fllow customizationGary V. Vaughan, May 14, 2010
  3. Robin H. JohnsonMay 14, 2010
  4. Gary V. VaughanMay 14, 2010
  5. Robin H. JohnsonMay 14, 2010
  6. Gary V. VaughanMay 14, 2010
  7. 02/18 Rewrite dynamic structure initializations to runtime assignmentGary V. Vaughan, May 14, 2010
  8. Junio C HamanoJun 2, 2010
  9. 03/18 Makefile: -lpthread may still be necessary when libc has only pthread stubsGary V. Vaughan, May 14, 2010
  10. 04/18 enums: omit trailing comma for portabilityGary V. Vaughan, May 14, 2010
  11. 05/18 Do not use "diff" found on PATH while building and installingGary V. Vaughan, May 14, 2010
  12. Junio C HamanoJun 2, 2010
  13. 06/18 tests: use "test_cmp", not "diff", when verifying the resultGary V. Vaughan, May 14, 2010
  14. Junio C HamanoJun 2, 2010
  15. 07/18 test_cmp: do not use "diff -u" on platforms that lack oneGary V. Vaughan, May 14, 2010
  16. 08/18 git-compat-util.h: some platforms with mmap() lack MAP_FAILED definitionGary V. Vaughan, May 14, 2010
  17. 09/18 Makefile: some platforms do not have hstrerror anywhereGary V. Vaughan, May 14, 2010
  18. 10/18 Make NO_{INET_NTOP,INET_PTON} configured independentlyGary V. Vaughan, May 14, 2010
  19. 11/18 Some platforms lack socklen_t typeGary V. Vaughan, May 14, 2010
  20. 12/18 Allow disabling "inline"Gary V. Vaughan, May 14, 2010
  21. 13/18 inline declaration does not work on AIXGary V. Vaughan, May 14, 2010
  22. 14/18 Makefile: SunOS 5.6 portability fixGary V. Vaughan, May 14, 2010
  23. 15/18 git-compat-util.h: Irix 6.5 defines sgi but not __sgi.Gary V. Vaughan, May 14, 2010
  24. git-compat-util.h: use apparently more common __sgi macro to detect SGI IRIXBrandon Casey, Jun 2, 2010
  25. Gary V. VaughanJun 2, 2010
  26. Tor ArntsenJun 2, 2010
  27. 16/18 Makefile: HPUX11 portability fixes.Gary V. Vaughan, May 14, 2010
  28. 17/18 Makefile: HP-UX 10.20 portability fixes.Gary V. Vaughan, May 14, 2010
  29. 18/18 Makefile: Tru64 portability fixGary V. Vaughan, May 14, 2010
  30. Gary V. VaughanMay 26, 2010
  31. Gary V. VaughanJun 7, 2010
  32. Junio C HamanoJun 7, 2010
  33. Tor ArntsenJun 9, 2010
  34. Junio C HamanoJun 11, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.