Ignore:
Timestamp:
Feb 11, 2013, 4:27:55 PM (7 years ago)
Author:
sam
Message:

build: better check for compiler flags; we no longer try to use
flags that autoconf hasn’t checked first.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r2388 r2395  
    140140AM_CONDITIONAL(USE_DOT, test "${DOT}" != "no")
    141141
    142 dnl No exceptions
    143 AM_CXXFLAGS="${AM_CXXFLAGS} -fno-exceptions -fno-rtti"
    144 dnl Optimizations
     142
     143dnl  No exceptions
     144LOL_TRY_CXXFLAGS(-fno-exceptions, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-exceptions"])
     145LOL_TRY_CXXFLAGS(-fno-rtti, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"])
     146
     147dnl  Optimizations
    145148AM_CXXFLAGS="${AM_CXXFLAGS} ${REL} ${OPT}"
    146 dnl Code qui fait des warnings == code de porc == deux baffes dans ta gueule
    147 AM_CPPFLAGS="${AM_CPPFLAGS} -Wall -Wextra -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare"
     149
     150dnl  Code qui fait des warnings == code de porc == deux baffes dans ta gueule
     151LOL_TRY_CXXFLAGS(-Wall, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wall"])
     152LOL_TRY_CXXFLAGS(-Wextra, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wextra"])
     153LOL_TRY_CXXFLAGS(-Wpointer-arith, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wpointer-arith"])
     154LOL_TRY_CXXFLAGS(-Wcast-align, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wcast-align"])
     155LOL_TRY_CXXFLAGS(-Wcast-qual, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wcast-qual"])
     156LOL_TRY_CXXFLAGS(-Wshadow, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wshadow"])
     157LOL_TRY_CXXFLAGS(-Wsign-compare, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wsign-compare"])
     158
     159dnl  Add these even though they're implicitly set, so that we can safely
     160dnl  remove them from within a Makefile.
     161LOL_TRY_CXXFLAGS(-Wno-maybe-uninitialized, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wno-maybe-uninitialized"])
     162LOL_TRY_CXXFLAGS(-Wno-narrowing, [AM_CPPFLAGS="${AM_CPPFLAGS} -Wno-narrowing"])
     163
    148164
    149165AC_CHECK_LIB(m, sin, MATH_LIBS="${MATH_LIBS} -lm")
Note: See TracChangeset for help on using the changeset viewer.