Commit: afb0ab3a451a2ae15759e62485d71aca76bc873c
Parent: 99fe325ad2b0a8f3247e522820f9aa4c7e9663b0
Author: Lucas De Marchi <lucas.de.marchi@gmail.com>
Committer: Johan Hedberg <johan.hedberg@intel.com>
Date: 2012-05-16 11:18:31
Tree: 307fd786d76db4a5a976741bd250aaae51af8275

build: Do not set CFLAGS/LDFLAGS directly Set a separate variable for adding warning flags, optimization, etc. Build systems are not supposed to change CFLAGS and LDFLAGS, these are user variables. Doing so we guarantee CFLAGS and LDFLAGS from environment is appended to the flags used during build. One useful use-case is to temporarily disable -Werror when using --enable-maintainer-mode, without completely loosing the warning flags and other parameters in CFLAGS (like -fPIC). Without this patch, fiddling with CFLAGS/LDFLAGS after configure may result in errors like below: /usr/bin/ld: tools/rfcomm.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC tools/rfcomm.o: could not read symbols: Bad value collect2: error: ld returned 1 exit status make[1]: *** [tools/rfcomm] Error 1 make: *** [all] Error 2 Reference: http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html

Diffstat

M Makefile.am | 22 ++++++++++++++- - - - - - - -
M acinclude.m4 | 38 ++++++++++++++++++++++- - - - - - - - - - - - - - - -

2 files changed, 36 insertions(+), 24 deletions(-)

View Full Diff | Patch