Skip to content

Commit

Permalink
changed default optimzation to -o2 for safety
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatharu committed Feb 19, 2019
1 parent 1417917 commit 67e62b9
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions configure.ac
Expand Up @@ -43,16 +43,28 @@ AC_ARG_ENABLE([osx],
AS_HELP_STRING([--enable-osx], [Enable OSX build]))

AS_IF([test "x$enable_osx" = "xyes"], [
CXXFLAGS="-std=c++11 -D__unix -Wno-unused-result -g -O3"
CXXFLAGSX="-std=c++11 -D__unix -Wno-unused-result -g"
],
[
CXXFLAGS="-std=c++11 -Wno-unused-result -ffunction-sections -fdata-sections -O3"
CXXFLAGSX="-std=c++11 -Wno-unused-result -ffunction-sections -fdata-sections"
# LDFLAGS="-Wl,--gc-sections -Wl,--strip-all"
]
)

dnl Optimization level for O3
AC_ARG_ENABLE([o3],
AS_HELP_STRING([--enable-o3], [Enable O3 build]))

# :${CXXFLAGS="-std=c++11 -Wno-unused-result -g -O3"}
AS_IF([test "x$enable_o3" = "xyes"], [
CXXFLAGSY="-O3"
],
[
CXXFLAGSY="-O2"
]
)


:${CXXFLAGS="$CXXFLAGSX $CXXFLAGSY"}

AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")

Expand All @@ -77,8 +89,6 @@ AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])


#LDFLAGS=-static

# Checks for programs.
AC_PROG_CXX([c++ g++])
AC_PROG_CC([cc gcc])
Expand Down

0 comments on commit 67e62b9

Please sign in to comment.