1 include(CheckCXXSourceCompiles)
2 include(CheckIncludeFile)
3 include(CheckIncludeFileCXX)
4 include(CheckSymbolExists)
6 # Check whether "long" and "int64_t" are distinct types w.r.t. overloading.
7 # Even if they have the same size, they can be distinct, and some platforms
8 # can have problems with ambiguous function calls when auto-converting
9 # int64_t to long, and others will complain if you overload a function
10 # that takes an int64_t with one that takes a long (giving a redefinition
11 # error). So we have to keep both happy. Probably the same underlying
12 # issue as the hash specialization below, but let's check separately
15 check_cxx_source_compiles(
19 int main() { return 0; }"
20 CVC4_NEED_INT64_T_OVERLOADS
22 if(NOT CVC4_NEED_INT64_T_OVERLOADS)
23 set(CVC4_NEED_INT64_T_OVERLOADS 0)
26 # Check to see if this version/architecture of GNU C++ explicitly
27 # instantiates std::hash<uint64_t> or not. Some do, some don't.
28 # See src/util/hash.h.
30 check_cxx_source_compiles(
33 namespace std { template<> struct hash<uint64_t> {}; }
34 int main() { return 0; }"
35 CVC4_NEED_HASH_UINT64_T_OVERLOAD
37 if(CVC4_NEED_HASH_UINT64_T_OVERLOAD)
38 add_definitions(-DCVC4_NEED_HASH_UINT64_T)
41 check_include_file(unistd.h HAVE_UNISTD_H)
42 check_include_file_cxx(ext/stdio_filebuf.h HAVE_EXT_STDIO_FILEBUF_H)
44 check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
45 check_symbol_exists(ffs "strings.h" HAVE_FFS)
46 check_symbol_exists(optreset "getopt.h" HAVE_DECL_OPTRESET)
47 check_symbol_exists(sigaltstack "signal.h" HAVE_SIGALTSTACK)
48 check_symbol_exists(strerror_r "string.h" HAVE_STRERROR_R)
49 check_symbol_exists(strtok_r "string.h" HAVE_STRTOK_R)
51 # Determine if we have the POSIX (int) or GNU (char *) variant of strerror_r.
52 check_c_source_compiles(
58 char c = *strerror_r(0, buf, 0);