Advertisement
Guest User

Untitled

a guest
Sep 6th, 2021
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.76 KB | None | 0 0
  1. charlz_klug@v158841:~ % cat /usr/ports/devel/cmake/work/cmake-3.21.0/Bootstrap.cmk/cmake_bootstrap.log
  2. Checking whether 'cc -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fstack-protector-strong ' works.
  3. Try: cc
  4. Line: cc -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fstack-protector-strong cmake_bootstrap_85671_test.c -o cmake_bootstrap_85671_test
  5. ---------- file -----------------------
  6.  
  7. #ifdef __cplusplus
  8. # error "The CMAKE_C_COMPILER is set to a C++ compiler"
  9. #endif
  10.  
  11. #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
  12. #error "On AIX with GNU we need the -pthread flag."
  13. #endif
  14.  
  15. #if defined(__sun) && __STDC_VERSION__ < 199901L
  16. #error "On Solaris we need C99."
  17. #endif
  18.  
  19. #if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
  20. #error "On HP-UX we need GCC 4.9 or higher."
  21. #endif
  22.  
  23. #include <stdio.h>
  24.  
  25. int main(int argc, char* argv[])
  26. {
  27. printf("%d%c", (argv != 0), (char)0x0a);
  28. return argc - 1;
  29. }
  30.  
  31. ------------------------------------------
  32. 1
  33. Test succeeded
  34. Checking whether 'c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D__BSD_VISIBLE -isystem /usr/local/include -fstack-protector-strong ' works.
  35. Try: c++
  36. Line: c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D__BSD_VISIBLE -isystem /usr/local/include -fstack-protector-strong cmake_bootstrap_85671_test.cxx -o cmake_bootstrap_85671_test
  37. ---------- file -----------------------
  38.  
  39. #include <iostream>
  40. #include <memory>
  41. #include <unordered_map>
  42.  
  43. #if __cplusplus < 201103L
  44. #error "Compiler is not in a mode aware of C++11."
  45. #endif
  46.  
  47. #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
  48. #error "On AIX with GNU we need the -pthread flag."
  49. #endif
  50.  
  51. #if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
  52. #error "SunPro <= 5.13 mode not supported due to bug in move semantics."
  53. #endif
  54.  
  55. #if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC_
  56.  
  57. #if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
  58. #include <optional>
  59. template <typename T,
  60. typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
  61. typename T::pointer get_ptr(T& item)
  62. {
  63. return item.get();
  64. }
  65.  
  66. int check_cxx17()
  67. {
  68. // Intel compiler do not handle correctly decltype inside invoke_result
  69. std::unique_ptr<int> u(new int(0));
  70. get_ptr(u);
  71. std::optional<int> oi = 0;
  72. return oi.value();
  73. }
  74. #else
  75. int check_cxx17()
  76. {
  77. return 0;
  78. }
  79. #endif
  80.  
  81. class Class
  82. {
  83. public:
  84. int Get() const { return this->Member; }
  85. private:
  86. int Member = 1;
  87. };
  88. int main()
  89. {
  90. auto const c = std::unique_ptr<Class>(new Class);
  91. std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
  92. return 0;
  93. }
  94.  
  95. ------------------------------------------
  96. 100
  97. Test succeeded
  98. Checking whether 'c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D__BSD_VISIBLE -isystem /usr/local/include -fstack-protector-strong ' supports 'make_unique'.
  99. Try: c++
  100. Line: c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D__BSD_VISIBLE -isystem /usr/local/include -fstack-protector-strong /usr/ports/devel/cmake/work/cmake-3.21.0/Source/Checks/cm_cxx_make_unique.cxx -o cmake_bootstrap_85671_test
  101. ---------- file -----------------------
  102. #include <memory>
  103. int main()
  104. {
  105. std::unique_ptr<int> u = std::make_unique<int>(0);
  106. return *u;
  107. }
  108. ------------------------------------------
  109. Test succeeded
  110. Checking whether 'c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D__BSD_VISIBLE -isystem /usr/local/include -fstack-protector-strong ' supports 'filesystem'.
  111. Try: c++
  112. Line: c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D__BSD_VISIBLE -isystem /usr/local/include -fstack-protector-strong /usr/ports/devel/cmake/work/cmake-3.21.0/Source/Checks/cm_cxx_filesystem.cxx -o cmake_bootstrap_85671_test
  113. ---------- file -----------------------
  114.  
  115. #include <filesystem>
  116.  
  117. int main()
  118. {
  119. std::filesystem::path p0(L"/a/b/c");
  120.  
  121. std::filesystem::path p1("/a/b/c");
  122. std::filesystem::path p2("/a/b/c");
  123. if (p1 != p2) {
  124. return 1;
  125. }
  126.  
  127. #if defined(_WIN32)
  128. std::filesystem::path p3("//host/a/b/../c");
  129. if (p3.lexically_normal().generic_string() != "//host/a/c") {
  130. return 1;
  131. }
  132.  
  133. std::filesystem::path p4("c://a/.///b/../");
  134. if (p4.lexically_normal().generic_string() != "c:/a/") {
  135. return 1;
  136. }
  137. #endif
  138.  
  139. return 0;
  140. }
  141. ------------------------------------------
  142. /usr/ports/devel/cmake/work/cmake-3.21.0/Source/Checks/cm_cxx_filesystem.cxx:6:3: error: no member named 'filesystem' in namespace 'std'; did you mean 'std::__fs::filesystem'?
  143. std::filesystem::path p0(L"/a/b/c");
  144. ^~~~~~~~~~~~~~~
  145. std::__fs::filesystem
  146. /usr/include/c++/v1/filesystem:259:1: note: 'std::__fs::filesystem' declared here
  147. _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
  148. ^
  149. /usr/include/c++/v1/__config:790:58: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM'
  150. _LIBCPP_BEGIN_NAMESPACE_STD namespace __fs { namespace filesystem {
  151. ^
  152. /usr/ports/devel/cmake/work/cmake-3.21.0/Source/Checks/cm_cxx_filesystem.cxx:8:3: error: no member named 'filesystem' in namespace 'std'; did you mean 'std::__fs::filesystem'?
  153. std::filesystem::path p1("/a/b/c");
  154. ^~~~~~~~~~~~~~~
  155. std::__fs::filesystem
  156. /usr/include/c++/v1/filesystem:259:1: note: 'std::__fs::filesystem' declared here
  157. _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
  158. ^
  159. /usr/include/c++/v1/__config:790:58: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM'
  160. _LIBCPP_BEGIN_NAMESPACE_STD namespace __fs { namespace filesystem {
  161. ^
  162. /usr/ports/devel/cmake/work/cmake-3.21.0/Source/Checks/cm_cxx_filesystem.cxx:9:3: error: no member named 'filesystem' in namespace 'std'; did you mean 'std::__fs::filesystem'?
  163. std::filesystem::path p2("/a/b/c");
  164. ^~~~~~~~~~~~~~~
  165. std::__fs::filesystem
  166. /usr/include/c++/v1/filesystem:259:1: note: 'std::__fs::filesystem' declared here
  167. _LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
  168. ^
  169. /usr/include/c++/v1/__config:790:58: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM'
  170. _LIBCPP_BEGIN_NAMESPACE_STD namespace __fs { namespace filesystem {
  171. ^
  172. 3 errors generated.
  173. Test failed to compile
  174. Try: make
  175. "cc" -fstack-protector-strong -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -o test test.c
  176. 1
  177. make works
  178. Try: c++
  179. Line: c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D__BSD_VISIBLE -isystem /usr/local/include -fstack-protector-strong -DTEST_KWSYS_CXX_HAS_SETENV /usr/ports/devel/cmake/work/cmake-3.21.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_85671_test
  180. ---------- file -----------------------
  181. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  182. file Copyright.txt or https://cmake.org/licensing#kwsys for details. */
  183.  
  184. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
  185. # include <sys/types.h>
  186.  
  187. # include <sys/stat.h>
  188. # include <unistd.h>
  189. int main()
  190. {
  191. struct stat stat1;
  192. (void)stat1.st_mtim.tv_sec;
  193. (void)stat1.st_mtim.tv_nsec;
  194. return 0;
  195. }
  196. #endif
  197.  
  198. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
  199. # include <sys/types.h>
  200.  
  201. # include <sys/stat.h>
  202. # includ
  203. // Match feature definitions from SystemInformation.cxx
  204. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  205. # define _GNU_SOURCE
  206. # endif
  207. # include <stdlib.h>
  208. int main()
  209. {
  210. double loadavg[3] = { 0.0, 0.0, 0.0 };
  211. return getloadavg(loadavg, 3);
  212. }
  213. #endif
  214.  
  215. #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
  216. # include <sys/resource.h>
  217. int main()
  218. {
  219. struct rlimit64 rlim;
  220. return getrlimit64(0, &rlim);
  221. }
  222. #endif
  223.  
  224. #ifdef TEST_KWSYS_CXX_HAS_UTIMES
  225. # include <sys/time.h>
  226. int main()
  227. {
  228. struct timeval* current_time = 0;
  229. return utimes("/example", current_time);
  230. }
  231. #endif
  232.  
  233. #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
  234. # include <fcntl.h>
  235. # include <sys/stat.h>
  236. # if defined(__APPLE__)
  237. # include <AvailabilityMacros.h>
  238. # if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
  239. # error "utimensat not available on macOS < 10.13"
  240. # endif
  241. # endif
  242. int main()
  243. {
  244. struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
  245. return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
  246. }
  247. #endif
  248.  
  249. #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
  250. # if defined(__PATHSCALE__) || defined(__PATHCC__) || \
  251. (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
  252. backtrace does not work with this compiler or os
  253. # endif
  254. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  255. # define _GNU_SOURCE
  256. # endif
  257. # include <execinfo.h>
  258.  
  259. #ifdef TEST_KWSYS_CXX_HAS_CXXABI
  260. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  261. # define _GNU_SOURCE
  262. # endif
  263. # if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \
  264. __SUNPRO_CC_COMPAT == 'G'
  265. # include <iostream>
  266. # endif
  267. # include <cxxabi.h>
  268. int main()
  269. {
  270. int status = 0;
  271. size_t bufferLen = 512;
  272. char buffer[512] = { '\0' };
  273. const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
  274. char* demangledFunction =
  275. abi::__cxa_demangle(function, buffer, &bufferLen, &status);
  276. return status;
  277. }
  278. #endif
  279.  
  280. #ifdef TEST_KWSYS_STL_HAS_WSTRING
  281. # include <string>
  282. void f(std::wstring*)
  283. {
  284. }
  285. int main()
  286. {
  287. return 0;
  288. }
  289. #endif
  290.  
  291. #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
  292. # include <ext/stdio_filebuf.h>
  293. int main()
  294. {
  295. return 0;
  296. }
  297. #endif
  298. ------------------------------------------
  299. Test succeeded
  300. Try: c++
  301. Line: c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D__BSD_VISIBLE -isystem /usr/local/include -fstack-protector-strong -DTEST_KWSYS_CXX_HAS_UNSETENV /usr/ports/devel/cmake/work/cmake-3.21.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_85671_test
  302. ---------- file -----------------------
  303. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  304. file Copyright.txt or https://cmake.org/licensing#kwsys for details. */
  305.  
  306. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
  307. # include <sys/types.h>
  308.  
  309. # include <sys/stat.h>
  310. # include <unistd.h>
  311. int main()
  312. {
  313. struct stat
  314. {
  315. char* e = environ[0];
  316. return e ? 0 : 1;
  317. }
  318. #endif
  319.  
  320. #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
  321. // Match feature definitions from SystemInformation.cxx
  322. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  323. # define _GNU_SOURCE
  324. # endif
  325. # include <stdlib.h>
  326. int main()
  327. {
  328. double loadavg[3] = { 0.0, 0.0, 0.0 };
  329. return getloadavg(loadavg, 3);
  330. }
  331. #endif
  332.  
  333. #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
  334. # include <sys/resource.h>
  335. int main()
  336. {
  337. struct rlimit64 rlim;
  338. return getrlimit64(0, &rlim);
  339. }
  340. #endif
  341.  
  342. #ifdef TEST_KWSYS_CXX_HAS_UTIMES
  343. # include <sys/time.h>
  344. int main()
  345. {
  346. struct timeval* current_time = 0;
  347. return utimes("/example", current_time);
  348. }
  349. #endif
  350.  
  351. #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
  352. # include <fcntl.h>
  353. # include <sys/stat.h>
  354. # if defined(__APPLE__)
  355. # include <AvailabilityMacros.h>
  356. # if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
  357. # error "utimensat not available on macOS < 10.13"
  358. # endif
  359. # endif
  360. int main()
  361. {
  362. struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
  363. return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
  364. }
  365. #endif
  366.  
  367. #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
  368. # if defined(__PATHSCALE__) || defined(__PATHCC__) || \
  369. (defined(__LSB_VERSION__) && (__LSB_VER
  370. # include <dlfcn.h>
  371. int main()
  372. {
  373. Dl_info info;
  374. int ierr = dladdr((void*)main, &info);
  375. return 0;
  376. }
  377. #endif
  378.  
  379. #ifdef TEST_KWSYS_CXX_HAS_CXXABI
  380. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  381. # define _GNU_SOURCE
  382. # endif
  383. # if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \
  384. __SUNPRO_CC_COMPAT == 'G'
  385. # include <iostream>
  386. # endif
  387. # include <cxxabi.h>
  388. int main()
  389. {
  390. int status = 0;
  391. size_t bufferLen = 512;
  392. char buffer[512] = { '\0' };
  393. const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
  394. char* demangledFunction =
  395. abi::__cxa_demangle(function, buffer, &bufferLen, &status);
  396. return status;
  397. }
  398. #endif
  399.  
  400. #ifdef TEST_KWSYS_STL_HAS_WSTRING
  401. # include <string>
  402. void f(std::wstring*)
  403. {
  404. }
  405. int main()
  406. {
  407. return 0;
  408. }
  409. #endif
  410.  
  411. #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
  412. # include <ext/stdio_filebuf.h>
  413. int main()
  414. {
  415. return 0;
  416. }
  417. #endif
  418. ------------------------------------------
  419. Test succeeded
  420. Try: c++
  421. Line: c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D__BSD_VISIBLE -isystem /usr/local/include -fstack-protector-strong -DTEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H /usr/ports/devel/cmake/work/cmake-3.21.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_85671_test
  422. ---------- file -----------------------
  423. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  424. file
  425. }
  426. #endif
  427.  
  428. #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
  429. # include <stdlib.h>
  430. int main()
  431. {
  432. char* e = environ[0];
  433. return e ? 0 : 1;
  434. }
  435. #endif
  436.  
  437. #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
  438. // Match feature definitions from SystemInformation.cxx
  439. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  440. # define _GNU_SOURCE
  441. # endif
  442. # include <stdlib.h>
  443. int main()
  444. {
  445. double loadavg[3] = { 0.0, 0.0, 0.0 };
  446. return getloadavg(loadavg, 3);
  447. }
  448. #endif
  449.  
  450. #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
  451. # include <sys/resource.h>
  452. int main()
  453. {
  454. struct rlimit64 rlim;
  455. return getrlimit64(0, &rlim);
  456. }
  457. #endif
  458.  
  459. #ifdef TEST_KWSYS_CXX_HAS_UTIMES
  460. # include <sys/time.h>
  461. int main()
  462. {
  463. struct timeval* current_time = 0;
  464. return utimes("/example", current_time);
  465. }
  466. #endif
  467.  
  468. #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
  469. # include <fcntl.h>
  470. # include <sys/stat.h>
  471. # if defined(__APPLE__)
  472. # include <AvailabilityMacros.h>
  473. # if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
  474. # error "utimensat not available on macOS < 10.13"
  475. # endif
  476. # endif
  477. int main()
  478. {
  479. struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
  480. return utimensat(AT_FDCWD,
  481. # include <dlfcn.h>
  482. int main()
  483. {
  484. Dl_info info;
  485. int ierr = dladdr((void*)main, &info);
  486. return 0;
  487. }
  488. #endif
  489.  
  490. #ifdef TEST_KWSYS_CXX_HAS_CXXABI
  491. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  492. # define _GNU_SOURCE
  493. # endif
  494. # if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \
  495. __SUNPRO_CC_COMPAT == 'G'
  496. # include <iostream>
  497. # endif
  498. # include <cxxabi.h>
  499. int main()
  500. {
  501. int status = 0;
  502. size_t bufferLen = 512;
  503. char buffer[512] = { '\0' };
  504. const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
  505. char* demangledFunction =
  506. abi::__cxa_demangle(function, buffer, &bufferLen, &status);
  507. return status;
  508. }
  509. #endif
  510.  
  511. #ifdef TEST_KWSYS_STL_HAS_WSTRING
  512. # include <string>
  513. void f(std::wstring*)
  514. {
  515. }
  516. int main()
  517. {
  518. return 0;
  519. }
  520. #endif
  521.  
  522. #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
  523. # include <ext/stdio_filebuf.h>
  524. int main()
  525. {
  526. return 0;
  527. }
  528. #endif
  529. ------------------------------------------
  530. /usr/ports/devel/cmake/work/cmake-3.21.0/Source/kwsys/kwsysPlatformTestsCXX.cxx:53:13: error: use of undeclared identifier 'environ'
  531. char* e = environ[0];
  532. ^
  533. 1 error generated.
  534. Test failed to compile
  535. Try: c++
  536. Line: c++ -O2 -pipe -fstack-protec
  537. #endif
  538.  
  539. #ifdef TEST_KWSYS_CXX_HAS_SETENV
  540. # include <stdlib.h>
  541. int main()
  542. {
  543. return setenv("A", "B", 1);
  544. }
  545. #endif
  546.  
  547. #ifdef TEST_KWSYS_CXX_HAS_UNSETENV
  548. # include <stdlib.h>
  549. int main()
  550. {
  551. unsetenv("A");
  552. return 0;
  553. }
  554. #endif
  555.  
  556. #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
  557. # include <stdlib.h>
  558. int main()
  559. {
  560. char* e = environ[0];
  561. return e ? 0 : 1;
  562. }
  563. #endif
  564.  
  565. #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
  566. // Match feature definitions from SystemInformation.cxx
  567. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  568. # define _GNU_SOURCE
  569. # endif
  570. # include <stdlib.h>
  571. int main()
  572. {
  573. double loadavg[3] = { 0.0, 0.0, 0.0 };
  574. return getloadavg(loadavg, 3);
  575. }
  576. #endif
  577.  
  578. #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
  579. # include <sys/resource.h>
  580. int main()
  581. {
  582. struct rlimit64 rlim;
  583. return getrlimit64(0, &rlim);
  584. }
  585. #endif
  586.  
  587. #ifdef TEST_KWSYS_CXX_HAS_UTIMES
  588. # include <sys/time.h>
  589. int main()
  590. {
  591. struct timeval* current_time = 0;
  592. return utimes("/example", current_time
  593. # include <execinfo.h>
  594. int main()
  595. {
  596. void* stackSymbols[256];
  597. backtrace(stackSymbols, 256);
  598. backtrace_symbols(&stackSymbols[0], 1);
  599. return 0;
  600. }
  601. #endif
  602.  
  603. #ifdef TEST_KWSYS_CXX_HAS_DLADDR
  604. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  605. # define _GNU_SOURCE
  606. # endif
  607. # include <dlfcn.h>
  608. int main()
  609. {
  610. Dl_info info;
  611. int ierr = dladdr((void*)main, &info);
  612. return 0;
  613. }
  614. #endif
  615.  
  616. #ifdef TEST_KWSYS_CXX_HAS_CXXABI
  617. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  618. # define _GNU_SOURCE
  619. # endif
  620. # if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \
  621. __SUNPRO_CC_COMPAT == 'G'
  622. # include <iostream>
  623. # endif
  624. # include <cxxabi.h>
  625. int main()
  626. {
  627. int status = 0;
  628. size_t bufferLen = 512;
  629. char buffer[512] = { '\0' };
  630. const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
  631. char* demangledFunction =
  632. abi::__cxa_demangle(function, buffer, &bufferLen, &status);
  633. return status;
  634. }
  635. #endif
  636.  
  637. #ifdef TEST_KWSYS_STL_HAS_WSTRING
  638. # include <string>
  639. void f(std::wstring*)
  640. {
  641. }
  642. int main()
  643. {
  644. return 0;
  645. }
  646. #endif
  647.  
  648. #ifdef TEST_KWSYS_CX
  649.  
  650. # include <sys/stat.h>
  651. # include <unistd.h>
  652. int main()
  653. {
  654. struct stat stat1;
  655. (void)stat1.st_mtimespec.tv_sec;
  656. (void)stat1.st_mtimespec.tv_nsec;
  657. return 0;
  658. }
  659. #endif
  660.  
  661. #ifdef TEST_KWSYS_CXX_HAS_SETENV
  662. # include <stdlib.h>
  663. int main()
  664. {
  665. return setenv("A", "B", 1);
  666. }
  667. #endif
  668.  
  669. #ifdef TEST_KWSYS_CXX_HAS_UNSETENV
  670. # include <stdlib.h>
  671. int main()
  672. {
  673. unsetenv("A");
  674. return 0;
  675. }
  676. #endif
  677.  
  678. #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
  679. # include <stdlib.h>
  680. int main()
  681. {
  682. char* e = environ[0];
  683. return e ? 0 : 1;
  684. }
  685. #endif
  686.  
  687. #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
  688. // Match feature definitions from SystemInformation.cxx
  689. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  690. # define _GNU_SOURCE
  691. # endif
  692. # include <stdlib.h>
  693. int main()
  694. {
  695. double loadavg[3] = { 0.0, 0.0, 0.0 };
  696. return getloadavg(loadavg, 3);
  697. }
  698. #endif
  699.  
  700. #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
  701. # include <sys/resource.h>
  702. int main()
  703. {
  704. stru
  705. # endif
  706. int main()
  707. {
  708. struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
  709. return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
  710. }
  711. #endif
  712.  
  713. #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
  714. # if defined(__PATHSCALE__) || defined(__PATHCC__) || \
  715. (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
  716. backtrace does not work with this compiler or os
  717. # endif
  718. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  719. # define _GNU_SOURCE
  720. # endif
  721. # include <execinfo.h>
  722. int main()
  723. {
  724. void* stackSymbols[256];
  725. backtrace(stackSymbols, 256);
  726. backtrace_symbols(&stackSymbols[0], 1);
  727. return 0;
  728. }
  729. #endif
  730.  
  731. #ifdef TEST_KWSYS_CXX_HAS_DLADDR
  732. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  733. # define _GNU_SOURCE
  734. # endif
  735. # include <dlfcn.h>
  736. int main()
  737. {
  738. Dl_info info;
  739. int ierr = dladdr((void*)main, &info);
  740. return 0;
  741. }
  742. #endif
  743.  
  744. #ifdef TEST_KWSYS_CXX_HAS_CXXABI
  745. # if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  746. # define _GNU_SOURCE
  747. # endif
  748. # if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \
  749. __SUNPRO_CC_COMPAT == 'G'
  750. # include <iostream>
  751. # endif
  752. # include <cxxabi.h>
  753. int main()
  754. {
  755. int status = 0;
  756. size_t bufferLen = 512;
  757. char buffer[512] = { '\0' };
  758. const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
  759. char* demangledFunction =
  760. abi::__cxa_demangle(function, buffer, &bufferLen, &status);
  761. return status;
  762. }
  763. #endif
  764.  
  765. #ifdef TEST_KWSYS_STL_HAS_WSTRING
  766. # include <string>
  767. void f(std::wstring*)
  768. {
  769. }
  770. int main()
  771. {
  772. return 0;
  773. }
  774. #endif
  775.  
  776. #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
  777. # include <ext/stdio_filebuf.h>
  778. int main()
  779. {
  780. return 0;
  781. }
  782. #endif
  783. ------------------------------------------
  784. /usr/ports/devel/cmake/work/cmake-3.21.0/Source/kwsys/kwsysPlatformTestsCXX.cxx:169:12: fatal error: 'ext/stdio_filebuf.h' file not found
  785. # include <ext/stdio_filebuf.h>
  786. ^~~~~~~~~~~~~~~~~~~~~
  787. 1 error generated.
  788. Test failed to compile
  789.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement