Skip to content

Commit

Permalink
Bugfix: configure: Allow user-provided CXXFLAGS to override default o…
Browse files Browse the repository at this point in the history
…ptimisation, debug, and warning flags
  • Loading branch information
luke-jr committed Jan 18, 2014
1 parent 490d6a3 commit 123e4f8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions configure.ac
Expand Up @@ -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 ==============================================================
Expand Down Expand Up @@ -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++])
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 123e4f8

Please sign in to comment.