diff options
author | Mathis Rosenhauer <rosenhauer@dkrz.de> | 2014-07-15 13:28:38 +0200 |
---|---|---|
committer | Mathis Rosenhauer <rosenhauer@dkrz.de> | 2014-07-15 13:28:38 +0200 |
commit | 3e8bb4b3571ad832f211544c45d58b49ee0b0188 (patch) | |
tree | 005daf2c4e8c263a1ea363bbf50a8fcd21d544fc | |
parent | 1a1a18597550997680083c24be64ce9296d56695 (diff) | |
download | libaec-3e8bb4b3571ad832f211544c45d58b49ee0b0188.tar.gz libaec-3e8bb4b3571ad832f211544c45d58b49ee0b0188.tar.bz2 libaec-3e8bb4b3571ad832f211544c45d58b49ee0b0188.zip |
Check and enable CLZ intrinsic for decoding.
-rw-r--r-- | CMakeLists.txt | 9 | ||||
-rw-r--r-- | config.h.in | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 53b9090..9e9bf98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,15 +1,24 @@ cmake_minimum_required(VERSION 2.6) include(CheckIncludeFiles) include(TestBigEndian) +include(CheckCSourceCompiles) project(libaec) set(libaec_VERSION_MAJOR 0) set(libaec_VERSION_MINOR 2) set(CMAKE_BUILD_TYPE Release) enable_testing() +if(CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_C_FLAGS "-Wall -std=gnu99 ${CMAKE_C_FLAGS}") +endif(CMAKE_COMPILER_IS_GNUCC) + check_include_files(malloc.h HAVE_MALLOC_H) check_include_files(stdint.h HAVE_STDINT_H) test_big_endian(WORDS_BIGENDIAN) +check_c_source_compiles( + "int main(void) { return __builtin_clzll(1LL); }" + HAVE_DECL___BUILTIN_CLZLL + ) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in diff --git a/config.h.in b/config.h.in index 24783f9..160959d 100644 --- a/config.h.in +++ b/config.h.in @@ -1,3 +1,4 @@ #cmakedefine HAVE_MALLOC_H 1 #cmakedefine HAVE_STDINT_H 1 #cmakedefine WORDS_BIGENDIAN 1 +#cmakedefine HAVE_DECL___BUILTIN_CLZLL 1 |