Browse Source

build: tweaks for C++11 support on Android.

undefined
Sam Hocevar 11 years ago
parent
commit
c42e9a37a9
2 changed files with 9 additions and 6 deletions
  1. +8
    -5
      configure.ac
  2. +1
    -1
      src/lol/math/functions.h

+ 8
- 5
configure.ac View File

@@ -81,12 +81,18 @@ AC_ARG_ENABLE(doc,
[ --enable-doc build documentation (needs doxygen and LaTeX)])


dnl C++11 mode. Checked early so that we don't run into surprises.
LOL_TRY_CXXFLAGS(-std=c++11,
[AM_CXXFLAGS="${AM_CXXFLAGS} -std=c++11"
CXXFLAGS="${CXXFLAGS} -std=c++11"])


dnl Common C headers
AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h)
AC_CHECK_HEADERS(stdio.h stdarg.h inttypes.h endian.h stdint.h getopt.h math.h)
AC_CHECK_HEADERS(fastmath.h pthread.h libutil.h util.h pty.h glob.h unistd.h)
AC_CHECK_HEADERS(execinfo.h)
AC_CHECK_HEADERS(sys/ioctl.h sys/ptrace.h sys/stat.h sys/syscall.h sys/user.h)
AC_CHECK_HEADERS(sys/wait.h sys/time.h)
AC_CHECK_HEADERS(sys/wait.h sys/time.h sys/types.h)
AC_CHECK_HEADERS(linux/kdev_t.h linux/major.h)
AC_CHECK_HEADERS(security/pam_appl.h security/pam_misc.h)
AC_CHECK_HEADERS(pam/pam_appl.h pam/pam_misc.h)
@@ -177,9 +183,6 @@ AM_CONDITIONAL(USE_LATEX, test "${LATEX}" != "no")
AM_CONDITIONAL(USE_DOT, test "${DOT}" != "no")


dnl C++11 mode
LOL_TRY_CXXFLAGS(-std=c++11, [AM_CXXFLAGS="${AM_CXXFLAGS} -std=c++11"])

dnl No exceptions
LOL_TRY_CXXFLAGS(-fno-exceptions, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-exceptions"])
LOL_TRY_CXXFLAGS(-fno-rtti, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"])


+ 1
- 1
src/lol/math/functions.h View File

@@ -119,7 +119,7 @@ static inline int16_t abs(int16_t x) { return std::abs(x); }
static inline uint16_t abs(uint16_t x) { return x; }
static inline int32_t abs(int32_t x) { return std::abs(x); }
static inline uint32_t abs(uint32_t x) { return x; }
#if defined __native_client__
#if defined __native_client__ || defined __ANDROID__
/* The pepper 19 toolchain doesn't provide abs() for long long int. */
static inline int64_t abs(int64_t x) { return x > 0 ? x : -x; }
#else


Loading…
Cancel
Save