diff options
author | Chris Robinson <[email protected]> | 2014-03-03 20:02:15 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-03-03 20:02:15 -0800 |
commit | a6eb38ea7f89ae21d6621570a148aa3aed5edf54 (patch) | |
tree | 82e0c556b1c1e7f6023a39f6da9d707bea341849 /CMakeLists.txt | |
parent | a2d9133ffca3bbd6f44b83bedc2021866d0237e6 (diff) |
Use alloca for temp space decoding/encoding IMA4 blocks
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 968ad9f9..9752bf7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -314,6 +314,7 @@ CHECK_C_SOURCE_COMPILES("int foo(const char *str, ...) __attribute__((format(pri int main() {return 0;}" HAVE_GCC_FORMAT) CHECK_INCLUDE_FILE(malloc.h HAVE_MALLOC_H) +CHECK_INCLUDE_FILE(alloca.h HAVE_ALLOCA_H) CHECK_INCLUDE_FILE(strings.h HAVE_STRINGS_H) CHECK_INCLUDE_FILE(cpuid.h HAVE_CPUID_H) CHECK_INCLUDE_FILE(sys/sysconf.h HAVE_SYS_SYSCONF_H) @@ -337,6 +338,19 @@ CHECK_SYMBOL_EXISTS(aligned_alloc stdlib.h HAVE_ALIGNED_ALLOC) CHECK_SYMBOL_EXISTS(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN) CHECK_SYMBOL_EXISTS(_aligned_malloc malloc.h HAVE__ALIGNED_MALLOC) CHECK_SYMBOL_EXISTS(lrintf math.h HAVE_LRINTF) +IF(HAVE_ALLOCA_H) + CHECK_SYMBOL_EXISTS(alloca alloca.h HAVE_ALLOCA) +ELSEIF(HAVE_MALLOC_H) + CHECK_SYMBOL_EXISTS(alloca malloc.h HAVE_ALLOCA) +ENDIF() +IF(NOT HAVE_ALLOCA) + CHECK_SYMBOL_EXISTS(_alloca malloc.h HAVE__ALLOCA) + IF(NOT HAVE__ALLOCA) + MESSAGE(FATAL_ERROR "No alloca function found, please report!") + ENDIF() + + ADD_DEFINITIONS(-Dalloca=_alloca) +ENDIF() IF(HAVE_FLOAT_H) CHECK_SYMBOL_EXISTS(_controlfp float.h HAVE__CONTROLFP) |