| 1 | Checking whether '/opt/local/bin/clang-mp-9.0 -pipe -Os -arch x86_64 ' works. |
|---|
| 2 | Try: /opt/local/bin/clang-mp-9.0 |
|---|
| 3 | Line: /opt/local/bin/clang-mp-9.0 -pipe -Os -arch x86_64 cmake_bootstrap_19243_test.c -o cmake_bootstrap_19243_test |
|---|
| 4 | ---------- file ----------------------- |
|---|
| 5 | |
|---|
| 6 | #ifdef __cplusplus |
|---|
| 7 | # error "The CMAKE_C_COMPILER is set to a C++ compiler" |
|---|
| 8 | #endif |
|---|
| 9 | |
|---|
| 10 | #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE) |
|---|
| 11 | #error "On AIX with GNU we need the -pthread flag." |
|---|
| 12 | #endif |
|---|
| 13 | |
|---|
| 14 | #if defined(__sun) && __STDC_VERSION__ < 199901L |
|---|
| 15 | #error "On Solaris we need C99." |
|---|
| 16 | #endif |
|---|
| 17 | |
|---|
| 18 | #if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409) |
|---|
| 19 | #error "On HP-UX we need GCC 4.9 or higher." |
|---|
| 20 | #endif |
|---|
| 21 | |
|---|
| 22 | #include <stdio.h> |
|---|
| 23 | |
|---|
| 24 | int main(int argc, char* argv[]) |
|---|
| 25 | { |
|---|
| 26 | printf("%d%c", (argv != 0), (char)0x0a); |
|---|
| 27 | return argc - 1; |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | ------------------------------------------ |
|---|
| 31 | 1 |
|---|
| 32 | Test succeeded |
|---|
| 33 | Checking whether '/opt/local/bin/clang++-mp-9.0 -pipe -Os -stdlib=libc++ -arch x86_64 ' works. |
|---|
| 34 | Try: /opt/local/bin/clang++-mp-9.0 |
|---|
| 35 | Line: /opt/local/bin/clang++-mp-9.0 -pipe -Os -stdlib=libc++ -arch x86_64 cmake_bootstrap_19243_test.cxx -o cmake_bootstrap_19243_test |
|---|
| 36 | ---------- file ----------------------- |
|---|
| 37 | |
|---|
| 38 | #include <iostream> |
|---|
| 39 | #include <memory> |
|---|
| 40 | #include <unordered_map> |
|---|
| 41 | |
|---|
| 42 | #if __cplusplus < 201103L |
|---|
| 43 | #error "Compiler is not in a mode aware of C++11." |
|---|
| 44 | #endif |
|---|
| 45 | |
|---|
| 46 | #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE) |
|---|
| 47 | #error "On AIX with GNU we need the -pthread flag." |
|---|
| 48 | #endif |
|---|
| 49 | |
|---|
| 50 | #if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140 |
|---|
| 51 | #error "SunPro <= 5.13 mode not supported due to bug in move semantics." |
|---|
| 52 | #endif |
|---|
| 53 | |
|---|
| 54 | #if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409) |
|---|
| 55 | #error "On HP-UX we need GCC 4.9 or higher." |
|---|
| 56 | #endif |
|---|
| 57 | |
|---|
| 58 | #if __cplusplus > 201103L |
|---|
| 59 | #include <iterator> |
|---|
| 60 | int check_cxx14() |
|---|
| 61 | { |
|---|
| 62 | int a[] = { 0, 1, 2 }; |
|---|
| 63 | auto ai = std::cbegin(a); |
|---|
| 64 | |
|---|
| 65 | int b[] = { 2, 1, 0 }; |
|---|
| 66 | auto bi = std::cend(b); |
|---|
| 67 | |
|---|
| 68 | return *ai + *(bi - 1); |
|---|
| 69 | } |
|---|
| 70 | #else |
|---|
| 71 | int check_cxx14() |
|---|
| 72 | { |
|---|
| 73 | return 0; |
|---|
| 74 | } |
|---|
| 75 | #endif |
|---|
| 76 | |
|---|
| 77 | #if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_if_constexpr)) |
|---|
| 78 | #include <optional> |
|---|
| 79 | template <typename T, |
|---|
| 80 | typename std::invoke_result<decltype(&T::get), T>::type = nullptr> |
|---|
| 81 | typename T::pointer get_ptr(T& item) |
|---|
| 82 | { |
|---|
| 83 | return item.get(); |
|---|
| 84 | } |
|---|
| 85 | |
|---|
| 86 | int check_cxx17() |
|---|
| 87 | { |
|---|
| 88 | // Intel compiler do not handle correctly decltype inside invoke_result |
|---|
| 89 | std::unique_ptr<int> u(new int(0)); |
|---|
| 90 | get_ptr(u); |
|---|
| 91 | std::optional<int> oi = 0; |
|---|
| 92 | return oi.value(); |
|---|
| 93 | } |
|---|
| 94 | #else |
|---|
| 95 | int check_cxx17() |
|---|
| 96 | { |
|---|
| 97 | return 0; |
|---|
| 98 | } |
|---|
| 99 | #endif |
|---|
| 100 | |
|---|
| 101 | class Class |
|---|
| 102 | { |
|---|
| 103 | public: |
|---|
| 104 | int Get() const { return this->Member; } |
|---|
| 105 | private: |
|---|
| 106 | int Member = 1; |
|---|
| 107 | }; |
|---|
| 108 | int main() |
|---|
| 109 | { |
|---|
| 110 | auto const c = std::unique_ptr<Class>(new Class); |
|---|
| 111 | std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl; |
|---|
| 112 | return 0; |
|---|
| 113 | } |
|---|
| 114 | |
|---|
| 115 | ------------------------------------------ |
|---|
| 116 | 100 |
|---|
| 117 | Test succeeded |
|---|
| 118 | Checking whether '/opt/local/bin/clang++-mp-9.0 -pipe -Os -stdlib=libc++ -arch x86_64 ' supports 'make_unique'. |
|---|
| 119 | Try: /opt/local/bin/clang++-mp-9.0 |
|---|
| 120 | Line: /opt/local/bin/clang++-mp-9.0 -pipe -Os -stdlib=libc++ -arch x86_64 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.18.0/Source/Checks/cm_cxx_make_unique.cxx -o cmake_bootstrap_19243_test |
|---|
| 121 | ---------- file ----------------------- |
|---|
| 122 | #include <memory> |
|---|
| 123 | int main() |
|---|
| 124 | { |
|---|
| 125 | std::unique_ptr<int> u = std::make_unique<int>(0); |
|---|
| 126 | return *u; |
|---|
| 127 | } |
|---|
| 128 | ------------------------------------------ |
|---|
| 129 | Test succeeded |
|---|
| 130 | Try: gmake |
|---|
| 131 | "/opt/local/bin/clang-mp-9.0" -L/opt/local/lib -Wl,-headerpad_max_install_names /opt/local/lib/libMacportsLegacySupport.dylib -arch x86_64 -framework CoreFoundation -pipe -Os -arch x86_64 -o test test.c |
|---|
| 132 | 1 |
|---|
| 133 | gmake works |
|---|
| 134 | Try: /opt/local/bin/clang++-mp-9.0 |
|---|
| 135 | Line: /opt/local/bin/clang++-mp-9.0 -pipe -Os -stdlib=libc++ -arch x86_64 -DTEST_KWSYS_CXX_HAS_SETENV /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.18.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_19243_test |
|---|
| 136 | ---------- file ----------------------- |
|---|
| 137 | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
|---|
| 138 | file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ |
|---|
| 139 | |
|---|
| 140 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM |
|---|
| 141 | # include <sys/types.h> |
|---|
| 142 | |
|---|
| 143 | # include <sys/stat.h> |
|---|
| 144 | # include <unistd.h> |
|---|
| 145 | int main() |
|---|
| 146 | { |
|---|
| 147 | struct stat stat1; |
|---|
| 148 | (void)stat1.st_mtim.tv_sec; |
|---|
| 149 | (void)stat1.st_mtim.tv_nsec; |
|---|
| 150 | return 0; |
|---|
| 151 | } |
|---|
| 152 | #endif |
|---|
| 153 | |
|---|
| 154 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC |
|---|
| 155 | # include <sys/types.h> |
|---|
| 156 | |
|---|
| 157 | # include <sys/stat.h> |
|---|
| 158 | # include <unistd.h> |
|---|
| 159 | int main() |
|---|
| 160 | { |
|---|
| 161 | struct stat stat1; |
|---|
| 162 | (void)stat1.st_mtimespec.tv_sec; |
|---|
| 163 | (void)stat1.st_mtimespec.tv_nsec; |
|---|
| 164 | return 0; |
|---|
| 165 | } |
|---|
| 166 | #endif |
|---|
| 167 | |
|---|
| 168 | #ifdef TEST_KWSYS_CXX_HAS_SETENV |
|---|
| 169 | # include <stdlib.h> |
|---|
| 170 | int main() |
|---|
| 171 | { |
|---|
| 172 | return setenv("A", "B", 1); |
|---|
| 173 | } |
|---|
| 174 | #endif |
|---|
| 175 | |
|---|
| 176 | #ifdef TEST_KWSYS_CXX_HAS_UNSETENV |
|---|
| 177 | # include <stdlib.h> |
|---|
| 178 | int main() |
|---|
| 179 | { |
|---|
| 180 | unsetenv("A"); |
|---|
| 181 | return 0; |
|---|
| 182 | } |
|---|
| 183 | #endif |
|---|
| 184 | |
|---|
| 185 | #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H |
|---|
| 186 | # include <stdlib.h> |
|---|
| 187 | int main() |
|---|
| 188 | { |
|---|
| 189 | char* e = environ[0]; |
|---|
| 190 | return e ? 0 : 1; |
|---|
| 191 | } |
|---|
| 192 | #endif |
|---|
| 193 | |
|---|
| 194 | #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG |
|---|
| 195 | // Match feature definitions from SystemInformation.cxx |
|---|
| 196 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 197 | # define _GNU_SOURCE |
|---|
| 198 | # endif |
|---|
| 199 | # include <stdlib.h> |
|---|
| 200 | int main() |
|---|
| 201 | { |
|---|
| 202 | double loadavg[3] = { 0.0, 0.0, 0.0 }; |
|---|
| 203 | return getloadavg(loadavg, 3); |
|---|
| 204 | } |
|---|
| 205 | #endif |
|---|
| 206 | |
|---|
| 207 | #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 |
|---|
| 208 | # include <sys/resource.h> |
|---|
| 209 | int main() |
|---|
| 210 | { |
|---|
| 211 | struct rlimit64 rlim; |
|---|
| 212 | return getrlimit64(0, &rlim); |
|---|
| 213 | } |
|---|
| 214 | #endif |
|---|
| 215 | |
|---|
| 216 | #ifdef TEST_KWSYS_CXX_HAS_UTIMES |
|---|
| 217 | # include <sys/time.h> |
|---|
| 218 | int main() |
|---|
| 219 | { |
|---|
| 220 | struct timeval* current_time = 0; |
|---|
| 221 | return utimes("/example", current_time); |
|---|
| 222 | } |
|---|
| 223 | #endif |
|---|
| 224 | |
|---|
| 225 | #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT |
|---|
| 226 | # include <fcntl.h> |
|---|
| 227 | # include <sys/stat.h> |
|---|
| 228 | # if defined(__APPLE__) |
|---|
| 229 | # include <AvailabilityMacros.h> |
|---|
| 230 | # if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 |
|---|
| 231 | # error "utimensat not available on macOS < 10.13" |
|---|
| 232 | # endif |
|---|
| 233 | # endif |
|---|
| 234 | int main() |
|---|
| 235 | { |
|---|
| 236 | struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; |
|---|
| 237 | return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); |
|---|
| 238 | } |
|---|
| 239 | #endif |
|---|
| 240 | |
|---|
| 241 | #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE |
|---|
| 242 | # if defined(__PATHSCALE__) || defined(__PATHCC__) || \ |
|---|
| 243 | (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) |
|---|
| 244 | backtrace does not work with this compiler or os |
|---|
| 245 | # endif |
|---|
| 246 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 247 | # define _GNU_SOURCE |
|---|
| 248 | # endif |
|---|
| 249 | # include <execinfo.h> |
|---|
| 250 | int main() |
|---|
| 251 | { |
|---|
| 252 | void* stackSymbols[256]; |
|---|
| 253 | backtrace(stackSymbols, 256); |
|---|
| 254 | backtrace_symbols(&stackSymbols[0], 1); |
|---|
| 255 | return 0; |
|---|
| 256 | } |
|---|
| 257 | #endif |
|---|
| 258 | |
|---|
| 259 | #ifdef TEST_KWSYS_CXX_HAS_DLADDR |
|---|
| 260 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 261 | # define _GNU_SOURCE |
|---|
| 262 | # endif |
|---|
| 263 | # include <dlfcn.h> |
|---|
| 264 | int main() |
|---|
| 265 | { |
|---|
| 266 | Dl_info info; |
|---|
| 267 | int ierr = dladdr((void*)main, &info); |
|---|
| 268 | return 0; |
|---|
| 269 | } |
|---|
| 270 | #endif |
|---|
| 271 | |
|---|
| 272 | #ifdef TEST_KWSYS_CXX_HAS_CXXABI |
|---|
| 273 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 274 | # define _GNU_SOURCE |
|---|
| 275 | # endif |
|---|
| 276 | # if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \ |
|---|
| 277 | __SUNPRO_CC_COMPAT == 'G' |
|---|
| 278 | # include <iostream> |
|---|
| 279 | # endif |
|---|
| 280 | # include <cxxabi.h> |
|---|
| 281 | int main() |
|---|
| 282 | { |
|---|
| 283 | int status = 0; |
|---|
| 284 | size_t bufferLen = 512; |
|---|
| 285 | char buffer[512] = { '\0' }; |
|---|
| 286 | const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii"; |
|---|
| 287 | char* demangledFunction = |
|---|
| 288 | abi::__cxa_demangle(function, buffer, &bufferLen, &status); |
|---|
| 289 | return status; |
|---|
| 290 | } |
|---|
| 291 | #endif |
|---|
| 292 | |
|---|
| 293 | #ifdef TEST_KWSYS_STL_HAS_WSTRING |
|---|
| 294 | # include <string> |
|---|
| 295 | void f(std::wstring*) |
|---|
| 296 | { |
|---|
| 297 | } |
|---|
| 298 | int main() |
|---|
| 299 | { |
|---|
| 300 | return 0; |
|---|
| 301 | } |
|---|
| 302 | #endif |
|---|
| 303 | |
|---|
| 304 | #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H |
|---|
| 305 | # include <ext/stdio_filebuf.h> |
|---|
| 306 | int main() |
|---|
| 307 | { |
|---|
| 308 | return 0; |
|---|
| 309 | } |
|---|
| 310 | #endif |
|---|
| 311 | ------------------------------------------ |
|---|
| 312 | Test succeeded |
|---|
| 313 | Try: /opt/local/bin/clang++-mp-9.0 |
|---|
| 314 | Line: /opt/local/bin/clang++-mp-9.0 -pipe -Os -stdlib=libc++ -arch x86_64 -DTEST_KWSYS_CXX_HAS_UNSETENV /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.18.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_19243_test |
|---|
| 315 | ---------- file ----------------------- |
|---|
| 316 | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
|---|
| 317 | file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ |
|---|
| 318 | |
|---|
| 319 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM |
|---|
| 320 | # include <sys/types.h> |
|---|
| 321 | |
|---|
| 322 | # include <sys/stat.h> |
|---|
| 323 | # include <unistd.h> |
|---|
| 324 | int main() |
|---|
| 325 | { |
|---|
| 326 | struct stat stat1; |
|---|
| 327 | (void)stat1.st_mtim.tv_sec; |
|---|
| 328 | (void)stat1.st_mtim.tv_nsec; |
|---|
| 329 | return 0; |
|---|
| 330 | } |
|---|
| 331 | #endif |
|---|
| 332 | |
|---|
| 333 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC |
|---|
| 334 | # include <sys/types.h> |
|---|
| 335 | |
|---|
| 336 | # include <sys/stat.h> |
|---|
| 337 | # include <unistd.h> |
|---|
| 338 | int main() |
|---|
| 339 | { |
|---|
| 340 | struct stat stat1; |
|---|
| 341 | (void)stat1.st_mtimespec.tv_sec; |
|---|
| 342 | (void)stat1.st_mtimespec.tv_nsec; |
|---|
| 343 | return 0; |
|---|
| 344 | } |
|---|
| 345 | #endif |
|---|
| 346 | |
|---|
| 347 | #ifdef TEST_KWSYS_CXX_HAS_SETENV |
|---|
| 348 | # include <stdlib.h> |
|---|
| 349 | int main() |
|---|
| 350 | { |
|---|
| 351 | return setenv("A", "B", 1); |
|---|
| 352 | } |
|---|
| 353 | #endif |
|---|
| 354 | |
|---|
| 355 | #ifdef TEST_KWSYS_CXX_HAS_UNSETENV |
|---|
| 356 | # include <stdlib.h> |
|---|
| 357 | int main() |
|---|
| 358 | { |
|---|
| 359 | unsetenv("A"); |
|---|
| 360 | return 0; |
|---|
| 361 | } |
|---|
| 362 | #endif |
|---|
| 363 | |
|---|
| 364 | #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H |
|---|
| 365 | # include <stdlib.h> |
|---|
| 366 | int main() |
|---|
| 367 | { |
|---|
| 368 | char* e = environ[0]; |
|---|
| 369 | return e ? 0 : 1; |
|---|
| 370 | } |
|---|
| 371 | #endif |
|---|
| 372 | |
|---|
| 373 | #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG |
|---|
| 374 | // Match feature definitions from SystemInformation.cxx |
|---|
| 375 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 376 | # define _GNU_SOURCE |
|---|
| 377 | # endif |
|---|
| 378 | # include <stdlib.h> |
|---|
| 379 | int main() |
|---|
| 380 | { |
|---|
| 381 | double loadavg[3] = { 0.0, 0.0, 0.0 }; |
|---|
| 382 | return getloadavg(loadavg, 3); |
|---|
| 383 | } |
|---|
| 384 | #endif |
|---|
| 385 | |
|---|
| 386 | #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 |
|---|
| 387 | # include <sys/resource.h> |
|---|
| 388 | int main() |
|---|
| 389 | { |
|---|
| 390 | struct rlimit64 rlim; |
|---|
| 391 | return getrlimit64(0, &rlim); |
|---|
| 392 | } |
|---|
| 393 | #endif |
|---|
| 394 | |
|---|
| 395 | #ifdef TEST_KWSYS_CXX_HAS_UTIMES |
|---|
| 396 | # include <sys/time.h> |
|---|
| 397 | int main() |
|---|
| 398 | { |
|---|
| 399 | struct timeval* current_time = 0; |
|---|
| 400 | return utimes("/example", current_time); |
|---|
| 401 | } |
|---|
| 402 | #endif |
|---|
| 403 | |
|---|
| 404 | #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT |
|---|
| 405 | # include <fcntl.h> |
|---|
| 406 | # include <sys/stat.h> |
|---|
| 407 | # if defined(__APPLE__) |
|---|
| 408 | # include <AvailabilityMacros.h> |
|---|
| 409 | # if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 |
|---|
| 410 | # error "utimensat not available on macOS < 10.13" |
|---|
| 411 | # endif |
|---|
| 412 | # endif |
|---|
| 413 | int main() |
|---|
| 414 | { |
|---|
| 415 | struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; |
|---|
| 416 | return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); |
|---|
| 417 | } |
|---|
| 418 | #endif |
|---|
| 419 | |
|---|
| 420 | #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE |
|---|
| 421 | # if defined(__PATHSCALE__) || defined(__PATHCC__) || \ |
|---|
| 422 | (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) |
|---|
| 423 | backtrace does not work with this compiler or os |
|---|
| 424 | # endif |
|---|
| 425 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 426 | # define _GNU_SOURCE |
|---|
| 427 | # endif |
|---|
| 428 | # include <execinfo.h> |
|---|
| 429 | int main() |
|---|
| 430 | { |
|---|
| 431 | void* stackSymbols[256]; |
|---|
| 432 | backtrace(stackSymbols, 256); |
|---|
| 433 | backtrace_symbols(&stackSymbols[0], 1); |
|---|
| 434 | return 0; |
|---|
| 435 | } |
|---|
| 436 | #endif |
|---|
| 437 | |
|---|
| 438 | #ifdef TEST_KWSYS_CXX_HAS_DLADDR |
|---|
| 439 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 440 | # define _GNU_SOURCE |
|---|
| 441 | # endif |
|---|
| 442 | # include <dlfcn.h> |
|---|
| 443 | int main() |
|---|
| 444 | { |
|---|
| 445 | Dl_info info; |
|---|
| 446 | int ierr = dladdr((void*)main, &info); |
|---|
| 447 | return 0; |
|---|
| 448 | } |
|---|
| 449 | #endif |
|---|
| 450 | |
|---|
| 451 | #ifdef TEST_KWSYS_CXX_HAS_CXXABI |
|---|
| 452 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 453 | # define _GNU_SOURCE |
|---|
| 454 | # endif |
|---|
| 455 | # if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \ |
|---|
| 456 | __SUNPRO_CC_COMPAT == 'G' |
|---|
| 457 | # include <iostream> |
|---|
| 458 | # endif |
|---|
| 459 | # include <cxxabi.h> |
|---|
| 460 | int main() |
|---|
| 461 | { |
|---|
| 462 | int status = 0; |
|---|
| 463 | size_t bufferLen = 512; |
|---|
| 464 | char buffer[512] = { '\0' }; |
|---|
| 465 | const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii"; |
|---|
| 466 | char* demangledFunction = |
|---|
| 467 | abi::__cxa_demangle(function, buffer, &bufferLen, &status); |
|---|
| 468 | return status; |
|---|
| 469 | } |
|---|
| 470 | #endif |
|---|
| 471 | |
|---|
| 472 | #ifdef TEST_KWSYS_STL_HAS_WSTRING |
|---|
| 473 | # include <string> |
|---|
| 474 | void f(std::wstring*) |
|---|
| 475 | { |
|---|
| 476 | } |
|---|
| 477 | int main() |
|---|
| 478 | { |
|---|
| 479 | return 0; |
|---|
| 480 | } |
|---|
| 481 | #endif |
|---|
| 482 | |
|---|
| 483 | #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H |
|---|
| 484 | # include <ext/stdio_filebuf.h> |
|---|
| 485 | int main() |
|---|
| 486 | { |
|---|
| 487 | return 0; |
|---|
| 488 | } |
|---|
| 489 | #endif |
|---|
| 490 | ------------------------------------------ |
|---|
| 491 | Test succeeded |
|---|
| 492 | Try: /opt/local/bin/clang++-mp-9.0 |
|---|
| 493 | Line: /opt/local/bin/clang++-mp-9.0 -pipe -Os -stdlib=libc++ -arch x86_64 -DTEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.18.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_19243_test |
|---|
| 494 | ---------- file ----------------------- |
|---|
| 495 | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
|---|
| 496 | file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ |
|---|
| 497 | |
|---|
| 498 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM |
|---|
| 499 | # include <sys/types.h> |
|---|
| 500 | |
|---|
| 501 | # include <sys/stat.h> |
|---|
| 502 | # include <unistd.h> |
|---|
| 503 | int main() |
|---|
| 504 | { |
|---|
| 505 | struct stat stat1; |
|---|
| 506 | (void)stat1.st_mtim.tv_sec; |
|---|
| 507 | (void)stat1.st_mtim.tv_nsec; |
|---|
| 508 | return 0; |
|---|
| 509 | } |
|---|
| 510 | #endif |
|---|
| 511 | |
|---|
| 512 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC |
|---|
| 513 | # include <sys/types.h> |
|---|
| 514 | |
|---|
| 515 | # include <sys/stat.h> |
|---|
| 516 | # include <unistd.h> |
|---|
| 517 | int main() |
|---|
| 518 | { |
|---|
| 519 | struct stat stat1; |
|---|
| 520 | (void)stat1.st_mtimespec.tv_sec; |
|---|
| 521 | (void)stat1.st_mtimespec.tv_nsec; |
|---|
| 522 | return 0; |
|---|
| 523 | } |
|---|
| 524 | #endif |
|---|
| 525 | |
|---|
| 526 | #ifdef TEST_KWSYS_CXX_HAS_SETENV |
|---|
| 527 | # include <stdlib.h> |
|---|
| 528 | int main() |
|---|
| 529 | { |
|---|
| 530 | return setenv("A", "B", 1); |
|---|
| 531 | } |
|---|
| 532 | #endif |
|---|
| 533 | |
|---|
| 534 | #ifdef TEST_KWSYS_CXX_HAS_UNSETENV |
|---|
| 535 | # include <stdlib.h> |
|---|
| 536 | int main() |
|---|
| 537 | { |
|---|
| 538 | unsetenv("A"); |
|---|
| 539 | return 0; |
|---|
| 540 | } |
|---|
| 541 | #endif |
|---|
| 542 | |
|---|
| 543 | #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H |
|---|
| 544 | # include <stdlib.h> |
|---|
| 545 | int main() |
|---|
| 546 | { |
|---|
| 547 | char* e = environ[0]; |
|---|
| 548 | return e ? 0 : 1; |
|---|
| 549 | } |
|---|
| 550 | #endif |
|---|
| 551 | |
|---|
| 552 | #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG |
|---|
| 553 | // Match feature definitions from SystemInformation.cxx |
|---|
| 554 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 555 | # define _GNU_SOURCE |
|---|
| 556 | # endif |
|---|
| 557 | # include <stdlib.h> |
|---|
| 558 | int main() |
|---|
| 559 | { |
|---|
| 560 | double loadavg[3] = { 0.0, 0.0, 0.0 }; |
|---|
| 561 | return getloadavg(loadavg, 3); |
|---|
| 562 | } |
|---|
| 563 | #endif |
|---|
| 564 | |
|---|
| 565 | #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 |
|---|
| 566 | # include <sys/resource.h> |
|---|
| 567 | int main() |
|---|
| 568 | { |
|---|
| 569 | struct rlimit64 rlim; |
|---|
| 570 | return getrlimit64(0, &rlim); |
|---|
| 571 | } |
|---|
| 572 | #endif |
|---|
| 573 | |
|---|
| 574 | #ifdef TEST_KWSYS_CXX_HAS_UTIMES |
|---|
| 575 | # include <sys/time.h> |
|---|
| 576 | int main() |
|---|
| 577 | { |
|---|
| 578 | struct timeval* current_time = 0; |
|---|
| 579 | return utimes("/example", current_time); |
|---|
| 580 | } |
|---|
| 581 | #endif |
|---|
| 582 | |
|---|
| 583 | #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT |
|---|
| 584 | # include <fcntl.h> |
|---|
| 585 | # include <sys/stat.h> |
|---|
| 586 | # if defined(__APPLE__) |
|---|
| 587 | # include <AvailabilityMacros.h> |
|---|
| 588 | # if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 |
|---|
| 589 | # error "utimensat not available on macOS < 10.13" |
|---|
| 590 | # endif |
|---|
| 591 | # endif |
|---|
| 592 | int main() |
|---|
| 593 | { |
|---|
| 594 | struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; |
|---|
| 595 | return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); |
|---|
| 596 | } |
|---|
| 597 | #endif |
|---|
| 598 | |
|---|
| 599 | #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE |
|---|
| 600 | # if defined(__PATHSCALE__) || defined(__PATHCC__) || \ |
|---|
| 601 | (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) |
|---|
| 602 | backtrace does not work with this compiler or os |
|---|
| 603 | # endif |
|---|
| 604 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 605 | # define _GNU_SOURCE |
|---|
| 606 | # endif |
|---|
| 607 | # include <execinfo.h> |
|---|
| 608 | int main() |
|---|
| 609 | { |
|---|
| 610 | void* stackSymbols[256]; |
|---|
| 611 | backtrace(stackSymbols, 256); |
|---|
| 612 | backtrace_symbols(&stackSymbols[0], 1); |
|---|
| 613 | return 0; |
|---|
| 614 | } |
|---|
| 615 | #endif |
|---|
| 616 | |
|---|
| 617 | #ifdef TEST_KWSYS_CXX_HAS_DLADDR |
|---|
| 618 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 619 | # define _GNU_SOURCE |
|---|
| 620 | # endif |
|---|
| 621 | # include <dlfcn.h> |
|---|
| 622 | int main() |
|---|
| 623 | { |
|---|
| 624 | Dl_info info; |
|---|
| 625 | int ierr = dladdr((void*)main, &info); |
|---|
| 626 | return 0; |
|---|
| 627 | } |
|---|
| 628 | #endif |
|---|
| 629 | |
|---|
| 630 | #ifdef TEST_KWSYS_CXX_HAS_CXXABI |
|---|
| 631 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 632 | # define _GNU_SOURCE |
|---|
| 633 | # endif |
|---|
| 634 | # if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \ |
|---|
| 635 | __SUNPRO_CC_COMPAT == 'G' |
|---|
| 636 | # include <iostream> |
|---|
| 637 | # endif |
|---|
| 638 | # include <cxxabi.h> |
|---|
| 639 | int main() |
|---|
| 640 | { |
|---|
| 641 | int status = 0; |
|---|
| 642 | size_t bufferLen = 512; |
|---|
| 643 | char buffer[512] = { '\0' }; |
|---|
| 644 | const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii"; |
|---|
| 645 | char* demangledFunction = |
|---|
| 646 | abi::__cxa_demangle(function, buffer, &bufferLen, &status); |
|---|
| 647 | return status; |
|---|
| 648 | } |
|---|
| 649 | #endif |
|---|
| 650 | |
|---|
| 651 | #ifdef TEST_KWSYS_STL_HAS_WSTRING |
|---|
| 652 | # include <string> |
|---|
| 653 | void f(std::wstring*) |
|---|
| 654 | { |
|---|
| 655 | } |
|---|
| 656 | int main() |
|---|
| 657 | { |
|---|
| 658 | return 0; |
|---|
| 659 | } |
|---|
| 660 | #endif |
|---|
| 661 | |
|---|
| 662 | #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H |
|---|
| 663 | # include <ext/stdio_filebuf.h> |
|---|
| 664 | int main() |
|---|
| 665 | { |
|---|
| 666 | return 0; |
|---|
| 667 | } |
|---|
| 668 | #endif |
|---|
| 669 | ------------------------------------------ |
|---|
| 670 | /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.18.0/Source/kwsys/kwsysPlatformTestsCXX.cxx:53:13: error: use of undeclared identifier 'environ' |
|---|
| 671 | char* e = environ[0]; |
|---|
| 672 | ^ |
|---|
| 673 | 1 error generated. |
|---|
| 674 | Test failed to compile |
|---|
| 675 | Try: /opt/local/bin/clang++-mp-9.0 |
|---|
| 676 | Line: /opt/local/bin/clang++-mp-9.0 -pipe -Os -stdlib=libc++ -arch x86_64 -DTEST_KWSYS_STL_HAS_WSTRING /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.18.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_19243_test |
|---|
| 677 | ---------- file ----------------------- |
|---|
| 678 | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
|---|
| 679 | file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ |
|---|
| 680 | |
|---|
| 681 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM |
|---|
| 682 | # include <sys/types.h> |
|---|
| 683 | |
|---|
| 684 | # include <sys/stat.h> |
|---|
| 685 | # include <unistd.h> |
|---|
| 686 | int main() |
|---|
| 687 | { |
|---|
| 688 | struct stat stat1; |
|---|
| 689 | (void)stat1.st_mtim.tv_sec; |
|---|
| 690 | (void)stat1.st_mtim.tv_nsec; |
|---|
| 691 | return 0; |
|---|
| 692 | } |
|---|
| 693 | #endif |
|---|
| 694 | |
|---|
| 695 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC |
|---|
| 696 | # include <sys/types.h> |
|---|
| 697 | |
|---|
| 698 | # include <sys/stat.h> |
|---|
| 699 | # include <unistd.h> |
|---|
| 700 | int main() |
|---|
| 701 | { |
|---|
| 702 | struct stat stat1; |
|---|
| 703 | (void)stat1.st_mtimespec.tv_sec; |
|---|
| 704 | (void)stat1.st_mtimespec.tv_nsec; |
|---|
| 705 | return 0; |
|---|
| 706 | } |
|---|
| 707 | #endif |
|---|
| 708 | |
|---|
| 709 | #ifdef TEST_KWSYS_CXX_HAS_SETENV |
|---|
| 710 | # include <stdlib.h> |
|---|
| 711 | int main() |
|---|
| 712 | { |
|---|
| 713 | return setenv("A", "B", 1); |
|---|
| 714 | } |
|---|
| 715 | #endif |
|---|
| 716 | |
|---|
| 717 | #ifdef TEST_KWSYS_CXX_HAS_UNSETENV |
|---|
| 718 | # include <stdlib.h> |
|---|
| 719 | int main() |
|---|
| 720 | { |
|---|
| 721 | unsetenv("A"); |
|---|
| 722 | return 0; |
|---|
| 723 | } |
|---|
| 724 | #endif |
|---|
| 725 | |
|---|
| 726 | #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H |
|---|
| 727 | # include <stdlib.h> |
|---|
| 728 | int main() |
|---|
| 729 | { |
|---|
| 730 | char* e = environ[0]; |
|---|
| 731 | return e ? 0 : 1; |
|---|
| 732 | } |
|---|
| 733 | #endif |
|---|
| 734 | |
|---|
| 735 | #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG |
|---|
| 736 | // Match feature definitions from SystemInformation.cxx |
|---|
| 737 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 738 | # define _GNU_SOURCE |
|---|
| 739 | # endif |
|---|
| 740 | # include <stdlib.h> |
|---|
| 741 | int main() |
|---|
| 742 | { |
|---|
| 743 | double loadavg[3] = { 0.0, 0.0, 0.0 }; |
|---|
| 744 | return getloadavg(loadavg, 3); |
|---|
| 745 | } |
|---|
| 746 | #endif |
|---|
| 747 | |
|---|
| 748 | #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 |
|---|
| 749 | # include <sys/resource.h> |
|---|
| 750 | int main() |
|---|
| 751 | { |
|---|
| 752 | struct rlimit64 rlim; |
|---|
| 753 | return getrlimit64(0, &rlim); |
|---|
| 754 | } |
|---|
| 755 | #endif |
|---|
| 756 | |
|---|
| 757 | #ifdef TEST_KWSYS_CXX_HAS_UTIMES |
|---|
| 758 | # include <sys/time.h> |
|---|
| 759 | int main() |
|---|
| 760 | { |
|---|
| 761 | struct timeval* current_time = 0; |
|---|
| 762 | return utimes("/example", current_time); |
|---|
| 763 | } |
|---|
| 764 | #endif |
|---|
| 765 | |
|---|
| 766 | #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT |
|---|
| 767 | # include <fcntl.h> |
|---|
| 768 | # include <sys/stat.h> |
|---|
| 769 | # if defined(__APPLE__) |
|---|
| 770 | # include <AvailabilityMacros.h> |
|---|
| 771 | # if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 |
|---|
| 772 | # error "utimensat not available on macOS < 10.13" |
|---|
| 773 | # endif |
|---|
| 774 | # endif |
|---|
| 775 | int main() |
|---|
| 776 | { |
|---|
| 777 | struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; |
|---|
| 778 | return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); |
|---|
| 779 | } |
|---|
| 780 | #endif |
|---|
| 781 | |
|---|
| 782 | #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE |
|---|
| 783 | # if defined(__PATHSCALE__) || defined(__PATHCC__) || \ |
|---|
| 784 | (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) |
|---|
| 785 | backtrace does not work with this compiler or os |
|---|
| 786 | # endif |
|---|
| 787 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 788 | # define _GNU_SOURCE |
|---|
| 789 | # endif |
|---|
| 790 | # include <execinfo.h> |
|---|
| 791 | int main() |
|---|
| 792 | { |
|---|
| 793 | void* stackSymbols[256]; |
|---|
| 794 | backtrace(stackSymbols, 256); |
|---|
| 795 | backtrace_symbols(&stackSymbols[0], 1); |
|---|
| 796 | return 0; |
|---|
| 797 | } |
|---|
| 798 | #endif |
|---|
| 799 | |
|---|
| 800 | #ifdef TEST_KWSYS_CXX_HAS_DLADDR |
|---|
| 801 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 802 | # define _GNU_SOURCE |
|---|
| 803 | # endif |
|---|
| 804 | # include <dlfcn.h> |
|---|
| 805 | int main() |
|---|
| 806 | { |
|---|
| 807 | Dl_info info; |
|---|
| 808 | int ierr = dladdr((void*)main, &info); |
|---|
| 809 | return 0; |
|---|
| 810 | } |
|---|
| 811 | #endif |
|---|
| 812 | |
|---|
| 813 | #ifdef TEST_KWSYS_CXX_HAS_CXXABI |
|---|
| 814 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 815 | # define _GNU_SOURCE |
|---|
| 816 | # endif |
|---|
| 817 | # if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \ |
|---|
| 818 | __SUNPRO_CC_COMPAT == 'G' |
|---|
| 819 | # include <iostream> |
|---|
| 820 | # endif |
|---|
| 821 | # include <cxxabi.h> |
|---|
| 822 | int main() |
|---|
| 823 | { |
|---|
| 824 | int status = 0; |
|---|
| 825 | size_t bufferLen = 512; |
|---|
| 826 | char buffer[512] = { '\0' }; |
|---|
| 827 | const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii"; |
|---|
| 828 | char* demangledFunction = |
|---|
| 829 | abi::__cxa_demangle(function, buffer, &bufferLen, &status); |
|---|
| 830 | return status; |
|---|
| 831 | } |
|---|
| 832 | #endif |
|---|
| 833 | |
|---|
| 834 | #ifdef TEST_KWSYS_STL_HAS_WSTRING |
|---|
| 835 | # include <string> |
|---|
| 836 | void f(std::wstring*) |
|---|
| 837 | { |
|---|
| 838 | } |
|---|
| 839 | int main() |
|---|
| 840 | { |
|---|
| 841 | return 0; |
|---|
| 842 | } |
|---|
| 843 | #endif |
|---|
| 844 | |
|---|
| 845 | #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H |
|---|
| 846 | # include <ext/stdio_filebuf.h> |
|---|
| 847 | int main() |
|---|
| 848 | { |
|---|
| 849 | return 0; |
|---|
| 850 | } |
|---|
| 851 | #endif |
|---|
| 852 | ------------------------------------------ |
|---|
| 853 | Test succeeded |
|---|
| 854 | Try: /opt/local/bin/clang++-mp-9.0 |
|---|
| 855 | Line: /opt/local/bin/clang++-mp-9.0 -pipe -Os -stdlib=libc++ -arch x86_64 -DTEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.18.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_19243_test |
|---|
| 856 | ---------- file ----------------------- |
|---|
| 857 | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
|---|
| 858 | file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ |
|---|
| 859 | |
|---|
| 860 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM |
|---|
| 861 | # include <sys/types.h> |
|---|
| 862 | |
|---|
| 863 | # include <sys/stat.h> |
|---|
| 864 | # include <unistd.h> |
|---|
| 865 | int main() |
|---|
| 866 | { |
|---|
| 867 | struct stat stat1; |
|---|
| 868 | (void)stat1.st_mtim.tv_sec; |
|---|
| 869 | (void)stat1.st_mtim.tv_nsec; |
|---|
| 870 | return 0; |
|---|
| 871 | } |
|---|
| 872 | #endif |
|---|
| 873 | |
|---|
| 874 | #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC |
|---|
| 875 | # include <sys/types.h> |
|---|
| 876 | |
|---|
| 877 | # include <sys/stat.h> |
|---|
| 878 | # include <unistd.h> |
|---|
| 879 | int main() |
|---|
| 880 | { |
|---|
| 881 | struct stat stat1; |
|---|
| 882 | (void)stat1.st_mtimespec.tv_sec; |
|---|
| 883 | (void)stat1.st_mtimespec.tv_nsec; |
|---|
| 884 | return 0; |
|---|
| 885 | } |
|---|
| 886 | #endif |
|---|
| 887 | |
|---|
| 888 | #ifdef TEST_KWSYS_CXX_HAS_SETENV |
|---|
| 889 | # include <stdlib.h> |
|---|
| 890 | int main() |
|---|
| 891 | { |
|---|
| 892 | return setenv("A", "B", 1); |
|---|
| 893 | } |
|---|
| 894 | #endif |
|---|
| 895 | |
|---|
| 896 | #ifdef TEST_KWSYS_CXX_HAS_UNSETENV |
|---|
| 897 | # include <stdlib.h> |
|---|
| 898 | int main() |
|---|
| 899 | { |
|---|
| 900 | unsetenv("A"); |
|---|
| 901 | return 0; |
|---|
| 902 | } |
|---|
| 903 | #endif |
|---|
| 904 | |
|---|
| 905 | #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H |
|---|
| 906 | # include <stdlib.h> |
|---|
| 907 | int main() |
|---|
| 908 | { |
|---|
| 909 | char* e = environ[0]; |
|---|
| 910 | return e ? 0 : 1; |
|---|
| 911 | } |
|---|
| 912 | #endif |
|---|
| 913 | |
|---|
| 914 | #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG |
|---|
| 915 | // Match feature definitions from SystemInformation.cxx |
|---|
| 916 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 917 | # define _GNU_SOURCE |
|---|
| 918 | # endif |
|---|
| 919 | # include <stdlib.h> |
|---|
| 920 | int main() |
|---|
| 921 | { |
|---|
| 922 | double loadavg[3] = { 0.0, 0.0, 0.0 }; |
|---|
| 923 | return getloadavg(loadavg, 3); |
|---|
| 924 | } |
|---|
| 925 | #endif |
|---|
| 926 | |
|---|
| 927 | #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 |
|---|
| 928 | # include <sys/resource.h> |
|---|
| 929 | int main() |
|---|
| 930 | { |
|---|
| 931 | struct rlimit64 rlim; |
|---|
| 932 | return getrlimit64(0, &rlim); |
|---|
| 933 | } |
|---|
| 934 | #endif |
|---|
| 935 | |
|---|
| 936 | #ifdef TEST_KWSYS_CXX_HAS_UTIMES |
|---|
| 937 | # include <sys/time.h> |
|---|
| 938 | int main() |
|---|
| 939 | { |
|---|
| 940 | struct timeval* current_time = 0; |
|---|
| 941 | return utimes("/example", current_time); |
|---|
| 942 | } |
|---|
| 943 | #endif |
|---|
| 944 | |
|---|
| 945 | #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT |
|---|
| 946 | # include <fcntl.h> |
|---|
| 947 | # include <sys/stat.h> |
|---|
| 948 | # if defined(__APPLE__) |
|---|
| 949 | # include <AvailabilityMacros.h> |
|---|
| 950 | # if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 |
|---|
| 951 | # error "utimensat not available on macOS < 10.13" |
|---|
| 952 | # endif |
|---|
| 953 | # endif |
|---|
| 954 | int main() |
|---|
| 955 | { |
|---|
| 956 | struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; |
|---|
| 957 | return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); |
|---|
| 958 | } |
|---|
| 959 | #endif |
|---|
| 960 | |
|---|
| 961 | #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE |
|---|
| 962 | # if defined(__PATHSCALE__) || defined(__PATHCC__) || \ |
|---|
| 963 | (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) |
|---|
| 964 | backtrace does not work with this compiler or os |
|---|
| 965 | # endif |
|---|
| 966 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 967 | # define _GNU_SOURCE |
|---|
| 968 | # endif |
|---|
| 969 | # include <execinfo.h> |
|---|
| 970 | int main() |
|---|
| 971 | { |
|---|
| 972 | void* stackSymbols[256]; |
|---|
| 973 | backtrace(stackSymbols, 256); |
|---|
| 974 | backtrace_symbols(&stackSymbols[0], 1); |
|---|
| 975 | return 0; |
|---|
| 976 | } |
|---|
| 977 | #endif |
|---|
| 978 | |
|---|
| 979 | #ifdef TEST_KWSYS_CXX_HAS_DLADDR |
|---|
| 980 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 981 | # define _GNU_SOURCE |
|---|
| 982 | # endif |
|---|
| 983 | # include <dlfcn.h> |
|---|
| 984 | int main() |
|---|
| 985 | { |
|---|
| 986 | Dl_info info; |
|---|
| 987 | int ierr = dladdr((void*)main, &info); |
|---|
| 988 | return 0; |
|---|
| 989 | } |
|---|
| 990 | #endif |
|---|
| 991 | |
|---|
| 992 | #ifdef TEST_KWSYS_CXX_HAS_CXXABI |
|---|
| 993 | # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) |
|---|
| 994 | # define _GNU_SOURCE |
|---|
| 995 | # endif |
|---|
| 996 | # if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \ |
|---|
| 997 | __SUNPRO_CC_COMPAT == 'G' |
|---|
| 998 | # include <iostream> |
|---|
| 999 | # endif |
|---|
| 1000 | # include <cxxabi.h> |
|---|
| 1001 | int main() |
|---|
| 1002 | { |
|---|
| 1003 | int status = 0; |
|---|
| 1004 | size_t bufferLen = 512; |
|---|
| 1005 | char buffer[512] = { '\0' }; |
|---|
| 1006 | const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii"; |
|---|
| 1007 | char* demangledFunction = |
|---|
| 1008 | abi::__cxa_demangle(function, buffer, &bufferLen, &status); |
|---|
| 1009 | return status; |
|---|
| 1010 | } |
|---|
| 1011 | #endif |
|---|
| 1012 | |
|---|
| 1013 | #ifdef TEST_KWSYS_STL_HAS_WSTRING |
|---|
| 1014 | # include <string> |
|---|
| 1015 | void f(std::wstring*) |
|---|
| 1016 | { |
|---|
| 1017 | } |
|---|
| 1018 | int main() |
|---|
| 1019 | { |
|---|
| 1020 | return 0; |
|---|
| 1021 | } |
|---|
| 1022 | #endif |
|---|
| 1023 | |
|---|
| 1024 | #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H |
|---|
| 1025 | # include <ext/stdio_filebuf.h> |
|---|
| 1026 | int main() |
|---|
| 1027 | { |
|---|
| 1028 | return 0; |
|---|
| 1029 | } |
|---|
| 1030 | #endif |
|---|
| 1031 | ------------------------------------------ |
|---|
| 1032 | /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.18.0/Source/kwsys/kwsysPlatformTestsCXX.cxx:169:12: fatal error: 'ext/stdio_filebuf.h' file not found |
|---|
| 1033 | # include <ext/stdio_filebuf.h> |
|---|
| 1034 | ^~~~~~~~~~~~~~~~~~~~~ |
|---|
| 1035 | 1 error generated. |
|---|
| 1036 | Test failed to compile |
|---|