diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2013-09-08 20:30:24 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2014-01-18 19:41:06 +0000 |
commit | 123e4f878eb96ccd1a0de5d0a16230a2c2df41d1 (patch) | |
tree | 003d05e434c542e22e58c54f2afc8f98d40f570a | |
parent | 490d6a30461d11aa112efe9fb3006797651ba4d5 (diff) |
Bugfix: configure: Allow user-provided CXXFLAGS to override default optimisation, debug, and warning flags
-rw-r--r-- | configure.ac | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 9737b884b4..d12ccd24b2 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,12 @@ m4_include([pkg.m4]) dnl faketime breaks configure and is only needed for make. Disable it here. unset FAKETIME +if test "x${CXXFLAGS+set}" = "xset"; then + CXXFLAGS_overridden=yes +else + CXXFLAGS_overridden=no +fi + dnl ============================================================== dnl Setup for automake dnl ============================================================== @@ -134,7 +140,9 @@ PKG_PROG_PKG_CONFIG ## TODO: Remove these hard-coded paths and flags. They are here for the sake of ## compatibility with the legacy buildsystem. ## -CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter" +if test "x$CXXFLAGS_overridden" = "xno"; then + CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter" +fi CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS" AC_LANG_PUSH([C++]) @@ -182,7 +190,9 @@ case $host in CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D__USE_MINGW_ANSI_STDIO" LEVELDB_TARGET_FLAGS="TARGET_OS=OS_WINDOWS_CROSSCOMPILE" - CXXFLAGS="$CXXFLAGS -w" + if test "x$CXXFLAGS_overridden" = "xno"; then + CXXFLAGS="$CXXFLAGS -w" + fi ;; *darwin*) TARGET_OS=darwin |