Re: [PATCH 4/4] Makefile: Don't pass $(ALL_CFLAGS) to the linker
From: Bernhard R. Link <hidden>
Date: 2016-06-15 22:49:00
* Ramsay Jones [off-list ref] [100626 20:02]:
Really? I thought that the general scheme was something like:
- LDFLAGS is for options which only affects the operation of
the linker (e.g. -L).
- CPPFLAGS is for options which only affects the operation of
the C pre-processor (e.g. -I, -D, -U)
- CFLAGS is for options which only affects the operation of
the compiler proper.I think the problem are options like -g or -m64 and the like which you also want to give to the linker on some systems, so it is quite common and I'd say recommended to have the compiling stage get CPPFLAGS and CFLAGS and the linking stage getting CFLAGS and LDFLAGS (and link using the compiler, otherwise you might miss libraries anyway). I do not know if automake started with this, or if it is older.
Also, the last time I was forced to use automake (yuck), I noticed that it passed CPPFLAGS to the linker; I consider this to be a bug in automake. :-P
Huh? Never heared of that bug, it must be more than 15 years ago. Are you sure it was not CFLAGS it passed to the linker? Bernhard R. Link No need to CC me, I'm subscribed...