diff mbox

[1/6] build: do not modify user variables

Message ID 1347416527-19752-2-git-send-email-jengelh@inai.de (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Engelhardt Sept. 12, 2012, 2:22 a.m. UTC
(automake-1.12 even reports this)

Makefile.am:12: warning: 'CFLAGS' is a user variable, you should
not override it;
Makefile.am:12: use 'AM_CFLAGS' instead
Makefile.am:18: warning: 'LDFLAGS' is a user variable, you should
not override it;
Makefile.am:18: use 'AM_LDFLAGS' instead
Makefile.am:14: warning: 'CXXFLAGS' is a user variable, you should
not override it;
Makefile.am:14: use 'AM_CXXFLAGS' instead

Also, libs _must absolutely not_ appear in LDFLAGS -
LDADD is appropriate here.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
---
 Makefile.am |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/Makefile.am b/Makefile.am
index 3488eba..25a24de 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,16 +9,17 @@  OPT ?= -O2 -DNDEBUG       # (A) Production use (optimized mode)
 
 # TODO maybe support android & chromium platforms via automake too?
 
-CFLAGS = -I$(srcdir)/include $(OPT) -pthread -fno-builtin-memcmp -DLEVELDB_PLATFORM_POSIX
+AM_CFLAGS = -I$(srcdir)/include $(OPT) -pthread -fno-builtin-memcmp -DLEVELDB_PLATFORM_POSIX
 
-CXXFLAGS = -I$(srcdir)/include $(OPT) -pthread -fno-builtin-memcmp -DLEVELDB_PLATFORM_POSIX
+AM_CXXFLAGS = -I$(srcdir)/include $(OPT) -pthread -fno-builtin-memcmp -DLEVELDB_PLATFORM_POSIX
 if CSTDATOMIC
-CXXFLAGS += -DLEVELDB_CSTDATOMIC_PRESENT -std=c++0x
+AM_CXXFLAGS += -DLEVELDB_CSTDATOMIC_PRESENT -std=c++0x
 endif
-LDFLAGS = -pthread
+AM_LDFLAGS = -pthread
 
+LDADD =
 if WITH_TCMALLOC
-LDFLAGS += -ltcmalloc
+LDADD += -ltcmalloc
 endif
 
 # items will be appended to this