From 64257e6eae4e5e73052c8249316df08b91a2445a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 3 Sep 2014 17:54:36 +0200 Subject: Fix UHASH build on MacOS X --- cmake/checks.cmake | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'cmake') diff --git a/cmake/checks.cmake b/cmake/checks.cmake index d42f336..f9f0399 100644 --- a/cmake/checks.cmake +++ b/cmake/checks.cmake @@ -61,31 +61,33 @@ string(COMPARE NOTEQUAL "${SIZEOF_ETHHDR}" "" HAVE_ETHHDR) set(CMAKE_REQUIRED_INCLUDES "sys/types.h") -check_c_source_compiles(" -#include - -int main() { - return 0; -} -" HAVE_ENDIAN_H) - -if(HAVE_ENDIAN_H) - check_symbol_exists("be32toh" "endian.h" HAVE_LINUX_ENDIAN) - -else(HAVE_ENDIAN_H) +if(NOT DARWIN) check_c_source_compiles(" - #include - #include + #include int main() { return 0; } - " HAVE_SYS_ENDIAN_H) + " HAVE_ENDIAN_H) + + if(HAVE_ENDIAN_H) + check_symbol_exists("be32toh" "endian.h" HAVE_LINUX_ENDIAN) + + else(HAVE_ENDIAN_H) + check_c_source_compiles(" + #include + #include - if(HAVE_SYS_ENDIAN_H) - check_symbol_exists("be32toh" "sys/types.h;sys/endian.h" HAVE_LINUX_ENDIAN) + int main() { + return 0; + } + " HAVE_SYS_ENDIAN_H) - else(HAVE_SYS_ENDIAN_H) - message(FATAL_ERROR "Neither nor found") - endif(HAVE_SYS_ENDIAN_H) -endif(HAVE_ENDIAN_H) + if(HAVE_SYS_ENDIAN_H) + check_symbol_exists("be32toh" "sys/types.h;sys/endian.h" HAVE_LINUX_ENDIAN) + + else(HAVE_SYS_ENDIAN_H) + message(FATAL_ERROR "Neither nor found") + endif(HAVE_SYS_ENDIAN_H) + endif(HAVE_ENDIAN_H) +endif(NOT DARWIN) -- cgit v1.2.3