cmake_bootstrap.log 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187
  1. Checking for GNU toolchain
  2. Try: gcc
  3. Line: gcc cmake_bootstrap_99926_test.c -o cmake_bootstrap_99926_test
  4. ---------- file -----------------------
  5. int main() { return 0; }
  6. ------------------------------------------
  7. Test succeeded
  8. Try: g++
  9. Line: g++ cmake_bootstrap_99926_test.cpp -o cmake_bootstrap_99926_test
  10. ---------- file -----------------------
  11. int main() { return 0; }
  12. ------------------------------------------
  13. Test succeeded
  14. Checking whether 'gcc ' works.
  15. Try: gcc
  16. Line: gcc cmake_bootstrap_99926_test.c -o cmake_bootstrap_99926_test
  17. ---------- file -----------------------
  18. #ifdef __cplusplus
  19. # error "The CMAKE_C_COMPILER is set to a C++ compiler"
  20. #endif
  21. #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
  22. #error "On AIX with GNU we need the -pthread flag."
  23. #endif
  24. #if defined(__sun) && __STDC_VERSION__ < 199901L
  25. #error "On Solaris we need C99."
  26. #endif
  27. #include <stdio.h>
  28. int main(int argc, char* argv[])
  29. {
  30. printf("%d%c", (argv != 0), (char)0x0a);
  31. return argc - 1;
  32. }
  33. ------------------------------------------
  34. 1
  35. Test succeeded
  36. Checking whether 'gcc ' works.
  37. Try: gcc
  38. Line: gcc cmake_bootstrap_99926_test.c -o cmake_bootstrap_99926_test
  39. ---------- file -----------------------
  40. #ifdef __cplusplus
  41. # error "The CMAKE_C_COMPILER is set to a C++ compiler"
  42. #endif
  43. #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
  44. #error "On AIX with GNU we need the -pthread flag."
  45. #endif
  46. #if defined(__sun) && __STDC_VERSION__ < 199901L
  47. #error "On Solaris we need C99."
  48. #endif
  49. #include <stdio.h>
  50. int main(int argc, char* argv[])
  51. {
  52. printf("%d%c", (argv != 0), (char)0x0a);
  53. return argc - 1;
  54. }
  55. ------------------------------------------
  56. 1
  57. Test succeeded
  58. Checking whether 'gcc ' works.
  59. Try: gcc
  60. Line: gcc cmake_bootstrap_99926_test.c -o cmake_bootstrap_99926_test
  61. ---------- file -----------------------
  62. #ifdef __cplusplus
  63. # error "The CMAKE_C_COMPILER is set to a C++ compiler"
  64. #endif
  65. #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
  66. #error "On AIX with GNU we need the -pthread flag."
  67. #endif
  68. #if defined(__sun) && __STDC_VERSION__ < 199901L
  69. #error "On Solaris we need C99."
  70. #endif
  71. #include <stdio.h>
  72. int main(int argc, char* argv[])
  73. {
  74. printf("%d%c", (argv != 0), (char)0x0a);
  75. return argc - 1;
  76. }
  77. ------------------------------------------
  78. 1
  79. Test succeeded
  80. Checking whether 'g++ ' works.
  81. Try: g++
  82. Line: g++ cmake_bootstrap_99926_test.cxx -o cmake_bootstrap_99926_test
  83. ---------- file -----------------------
  84. #include <iostream>
  85. #include <memory>
  86. #include <unordered_map>
  87. #if __cplusplus < 201103L
  88. #error "Compiler is not in a mode aware of C++11."
  89. #endif
  90. #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
  91. #error "On AIX with GNU we need the -pthread flag."
  92. #endif
  93. #if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
  94. #error "SunPro <= 5.13 mode not supported due to bug in move semantics."
  95. #endif
  96. class Class
  97. {
  98. public:
  99. int Get() const { return this->Member; }
  100. private:
  101. int Member = 1;
  102. };
  103. int main()
  104. {
  105. auto const c = std::unique_ptr<Class>(new Class);
  106. std::cout << c->Get() << std::endl;
  107. return 0;
  108. }
  109. ------------------------------------------
  110. In file included from /usr/include/c++/5/unordered_map:35:0,
  111. from cmake_bootstrap_99926_test.cxx:4:
  112. /usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
  113. #error This file requires compiler and library support \
  114. ^
  115. cmake_bootstrap_99926_test.cxx:7:2: error: #error "Compiler is not in a mode aware of C++11."
  116. #error "Compiler is not in a mode aware of C++11."
  117. ^
  118. cmake_bootstrap_99926_test.cxx:23:16: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
  119. int Member = 1;
  120. ^
  121. cmake_bootstrap_99926_test.cxx: In function ‘int main()’:
  122. cmake_bootstrap_99926_test.cxx:27:14: error: ‘c’ does not name a type
  123. auto const c = std::unique_ptr<Class>(new Class);
  124. ^
  125. cmake_bootstrap_99926_test.cxx:28:16: error: ‘c’ was not declared in this scope
  126. std::cout << c->Get() << std::endl;
  127. ^
  128. Test failed to compile
  129. Checking whether 'g++ -std=gnu++1z ' works.
  130. Try: g++
  131. Line: g++ -std=gnu++1z cmake_bootstrap_99926_test.cxx -o cmake_bootstrap_99926_test
  132. ---------- file -----------------------
  133. #include <iostream>
  134. #include <memory>
  135. #include <unordered_map>
  136. #if __cplusplus < 201103L
  137. #error "Compiler is not in a mode aware of C++11."
  138. #endif
  139. #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
  140. #error "On AIX with GNU we need the -pthread flag."
  141. #endif
  142. #if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
  143. #error "SunPro <= 5.13 mode not supported due to bug in move semantics."
  144. #endif
  145. class Class
  146. {
  147. public:
  148. int Get() const { return this->Member; }
  149. private:
  150. int Member = 1;
  151. };
  152. int main()
  153. {
  154. auto const c = std::unique_ptr<Class>(new Class);
  155. std::cout << c->Get() << std::endl;
  156. return 0;
  157. }
  158. ------------------------------------------
  159. 1
  160. Test succeeded
  161. Checking whether 'g++ -std=gnu++1z ' works.
  162. Try: g++
  163. Line: g++ -std=gnu++1z cmake_bootstrap_99926_test.cxx -o cmake_bootstrap_99926_test
  164. ---------- file -----------------------
  165. #include <iostream>
  166. #include <memory>
  167. #include <unordered_map>
  168. #if __cplusplus < 201103L
  169. #error "Compiler is not in a mode aware of C++11."
  170. #endif
  171. #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
  172. #error "On AIX with GNU we need the -pthread flag."
  173. #endif
  174. #if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
  175. #error "SunPro <= 5.13 mode not supported due to bug in move semantics."
  176. #endif
  177. class Class
  178. {
  179. public:
  180. int Get() const { return this->Member; }
  181. private:
  182. int Member = 1;
  183. };
  184. int main()
  185. {
  186. auto const c = std::unique_ptr<Class>(new Class);
  187. std::cout << c->Get() << std::endl;
  188. return 0;
  189. }
  190. ------------------------------------------
  191. 1
  192. Test succeeded
  193. Checking whether 'g++ -std=gnu++1z ' works.
  194. Try: g++
  195. Line: g++ -std=gnu++1z cmake_bootstrap_99926_test.cxx -o cmake_bootstrap_99926_test
  196. ---------- file -----------------------
  197. #include <iostream>
  198. #include <memory>
  199. #include <unordered_map>
  200. #if __cplusplus < 201103L
  201. #error "Compiler is not in a mode aware of C++11."
  202. #endif
  203. #if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
  204. #error "On AIX with GNU we need the -pthread flag."
  205. #endif
  206. #if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
  207. #error "SunPro <= 5.13 mode not supported due to bug in move semantics."
  208. #endif
  209. class Class
  210. {
  211. public:
  212. int Get() const { return this->Member; }
  213. private:
  214. int Member = 1;
  215. };
  216. int main()
  217. {
  218. auto const c = std::unique_ptr<Class>(new Class);
  219. std::cout << c->Get() << std::endl;
  220. return 0;
  221. }
  222. ------------------------------------------
  223. 1
  224. Test succeeded
  225. Try: gmake
  226. ./bootstrap: 767: ./bootstrap: gmake: not found
  227. gmake does not work
  228. Try: make
  229. "gcc" -o test test.c
  230. 1
  231. make works
  232. Try: g++
  233. Line: g++ -std=gnu++1z -DTEST_KWSYS_CXX_HAS_SETENV /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Tool/cmake-3.11.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_99926_test
  234. ---------- file -----------------------
  235. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  236. file Copyright.txt or https://cmake.org/licensing#kwsys for details. */
  237. #ifdef TEST_KWSYS_CXX_HAS_CSTDIO
  238. #include <cstdio>
  239. int main()
  240. {
  241. return 0;
  242. }
  243. #endif
  244. #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG
  245. long long f(long long n)
  246. {
  247. return n;
  248. }
  249. int main()
  250. {
  251. long long n = 0;
  252. return static_cast<int>(f(n));
  253. }
  254. #endif
  255. #ifdef TEST_KWSYS_CXX_HAS___INT64
  256. __int64 f(__int64 n)
  257. {
  258. return n;
  259. }
  260. int main()
  261. {
  262. __int64 n = 0;
  263. return static_cast<int>(f(n));
  264. }
  265. #endif
  266. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
  267. #include <sys/types.h>
  268. #include <sys/stat.h>
  269. #include <unistd.h>
  270. int main()
  271. {
  272. struct stat stat1;
  273. (void)stat1.st_mtim.tv_sec;
  274. (void)stat1.st_mtim.tv_nsec;
  275. return 0;
  276. }
  277. #endif
  278. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
  279. #include <sys/types.h>
  280. #include <sys/stat.h>
  281. #include <unistd.h>
  282. int main()
  283. {
  284. struct stat stat1;
  285. (void)stat1.st_mtimespec.tv_sec;
  286. (void)stat1.st_mtimespec.tv_nsec;
  287. return 0;
  288. }
  289. #endif
  290. #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64
  291. void function(long**)
  292. {
  293. }
  294. int main()
  295. {
  296. __int64** p = 0;
  297. function(p);
  298. return 0;
  299. }
  300. #endif
  301. #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64
  302. void function(long long**)
  303. {
  304. }
  305. int main()
  306. {
  307. __int64** p = 0;
  308. function(p);
  309. return 0;
  310. }
  311. #endif
  312. #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG
  313. #include <iostream>
  314. int test_istream(std::istream& is, long long& x)
  315. {
  316. return (is >> x) ? 1 : 0;
  317. }
  318. int main()
  319. {
  320. long long x = 0;
  321. return test_istream(std::cin, x);
  322. }
  323. #endif
  324. #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG
  325. #include <iostream>
  326. int test_ostream(std::ostream& os, long long x)
  327. {
  328. return (os << x) ? 1 : 0;
  329. }
  330. int main()
  331. {
  332. long long x = 0;
  333. return test_ostream(std::cout, x);
  334. }
  335. #endif
  336. #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64
  337. #include <iostream>
  338. int test_istream(std::istream& is, __int64& x)
  339. {
  340. return (is >> x) ? 1 : 0;
  341. }
  342. int main()
  343. {
  344. __int64 x = 0;
  345. return test_istream(std::cin, x);
  346. }
  347. #endif
  348. #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64
  349. #include <iostream>
  350. int test_ostream(std::ostream& os, __int64 x)
  351. {
  352. return (os << x) ? 1 : 0;
  353. }
  354. int main()
  355. {
  356. __int64 x = 0;
  357. return test_ostream(std::cout, x);
  358. }
  359. #endif
  360. #ifdef TEST_KWSYS_LFS_WORKS
  361. /* Return 0 when LFS is available and 1 otherwise. */
  362. #define _LARGEFILE_SOURCE
  363. #define _LARGEFILE64_SOURCE
  364. #define _LARGE_FILES
  365. #define _FILE_OFFSET_BITS 64
  366. #include <sys/types.h>
  367. #include <assert.h>
  368. #include <sys/stat.h>
  369. #if KWSYS_CXX_HAS_CSTDIO
  370. #include <cstdio>
  371. #endif
  372. #include <stdio.h>
  373. int main(int, char** argv)
  374. {
  375. /* check that off_t can hold 2^63 - 1 and perform basic operations... */
  376. #define OFF_T_64 (((off_t)1 << 62) - 1 + ((off_t)1 << 62))
  377. if (OFF_T_64 % 2147483647 != 1)
  378. return 1;
  379. // stat breaks on SCO OpenServer
  380. struct stat buf;
  381. stat(argv[0], &buf);
  382. if (!S_ISREG(buf.st_mode))
  383. return 2;
  384. FILE* file = fopen(argv[0], "r");
  385. off_t offset = ftello(file);
  386. fseek(file, offset, SEEK_CUR);
  387. fclose(file);
  388. return 0;
  389. }
  390. #endif
  391. #ifdef TEST_KWSYS_CXX_HAS_SETENV
  392. #include <stdlib.h>
  393. int main()
  394. {
  395. return setenv("A", "B", 1);
  396. }
  397. #endif
  398. #ifdef TEST_KWSYS_CXX_HAS_UNSETENV
  399. #include <stdlib.h>
  400. int main()
  401. {
  402. unsetenv("A");
  403. return 0;
  404. }
  405. #endif
  406. #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
  407. #include <stdlib.h>
  408. int main()
  409. {
  410. char* e = environ[0];
  411. return e ? 0 : 1;
  412. }
  413. #endif
  414. #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
  415. // Match feature definitions from SystemInformation.cxx
  416. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  417. #define _GNU_SOURCE
  418. #endif
  419. #include <stdlib.h>
  420. int main()
  421. {
  422. double loadavg[3] = { 0.0, 0.0, 0.0 };
  423. return getloadavg(loadavg, 3);
  424. }
  425. #endif
  426. #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
  427. #if defined(KWSYS_HAS_LFS)
  428. #define _LARGEFILE_SOURCE
  429. #define _LARGEFILE64_SOURCE
  430. #define _LARGE_FILES
  431. #define _FILE_OFFSET_BITS 64
  432. #endif
  433. #include <sys/resource.h>
  434. int main()
  435. {
  436. struct rlimit64 rlim;
  437. return getrlimit64(0, &rlim);
  438. }
  439. #endif
  440. #ifdef TEST_KWSYS_CXX_HAS_ATOLL
  441. #include <stdlib.h>
  442. int main()
  443. {
  444. const char* str = "1024";
  445. return static_cast<int>(atoll(str));
  446. }
  447. #endif
  448. #ifdef TEST_KWSYS_CXX_HAS_ATOL
  449. #include <stdlib.h>
  450. int main()
  451. {
  452. const char* str = "1024";
  453. return static_cast<int>(atol(str));
  454. }
  455. #endif
  456. #ifdef TEST_KWSYS_CXX_HAS__ATOI64
  457. #include <stdlib.h>
  458. int main()
  459. {
  460. const char* str = "1024";
  461. return static_cast<int>(_atoi64(str));
  462. }
  463. #endif
  464. #ifdef TEST_KWSYS_CXX_HAS_UTIMES
  465. #include <sys/time.h>
  466. int main()
  467. {
  468. struct timeval* current_time = 0;
  469. return utimes("/example", current_time);
  470. }
  471. #endif
  472. #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
  473. #include <fcntl.h>
  474. #include <sys/stat.h>
  475. #if defined(__APPLE__)
  476. #include <AvailabilityMacros.h>
  477. #if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
  478. #error "utimensat not available on macOS < 10.13"
  479. #endif
  480. #endif
  481. int main()
  482. {
  483. struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
  484. return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
  485. }
  486. #endif
  487. #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
  488. #if defined(__PATHSCALE__) || defined(__PATHCC__) || \
  489. (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
  490. backtrace does not work with this compiler or os
  491. #endif
  492. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  493. #define _GNU_SOURCE
  494. #endif
  495. #include <execinfo.h>
  496. int main()
  497. {
  498. void* stackSymbols[256];
  499. backtrace(stackSymbols, 256);
  500. backtrace_symbols(&stackSymbols[0], 1);
  501. return 0;
  502. }
  503. #endif
  504. #ifdef TEST_KWSYS_CXX_HAS_DLADDR
  505. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  506. #define _GNU_SOURCE
  507. #endif
  508. #include <dlfcn.h>
  509. int main()
  510. {
  511. Dl_info info;
  512. int ierr = dladdr((void*)main, &info);
  513. return 0;
  514. }
  515. #endif
  516. #ifdef TEST_KWSYS_CXX_HAS_CXXABI
  517. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  518. #define _GNU_SOURCE
  519. #endif
  520. #if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \
  521. __SUNPRO_CC_COMPAT == 'G'
  522. #include <iostream>
  523. #endif
  524. #include <cxxabi.h>
  525. int main()
  526. {
  527. int status = 0;
  528. size_t bufferLen = 512;
  529. char buffer[512] = { '\0' };
  530. const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
  531. char* demangledFunction =
  532. abi::__cxa_demangle(function, buffer, &bufferLen, &status);
  533. return status;
  534. }
  535. #endif
  536. #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM
  537. int main()
  538. {
  539. int a = 1;
  540. __asm {
  541. xor EBX, EBX;
  542. mov a, EBX;
  543. }
  544. return a;
  545. }
  546. #endif
  547. #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID
  548. int main()
  549. {
  550. int a = 0;
  551. __asm {
  552. xor EAX, EAX;
  553. cpuid;
  554. mov a, EAX;
  555. }
  556. return a;
  557. }
  558. #endif
  559. #ifdef TEST_KWSYS_STL_HAS_WSTRING
  560. #include <string>
  561. void f(std::wstring*)
  562. {
  563. }
  564. int main()
  565. {
  566. return 0;
  567. }
  568. #endif
  569. #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
  570. #include <ext/stdio_filebuf.h>
  571. int main()
  572. {
  573. return 0;
  574. }
  575. #endif
  576. ------------------------------------------
  577. Test succeeded
  578. Try: g++
  579. Line: g++ -std=gnu++1z -DTEST_KWSYS_CXX_HAS_UNSETENV /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Tool/cmake-3.11.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_99926_test
  580. ---------- file -----------------------
  581. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  582. file Copyright.txt or https://cmake.org/licensing#kwsys for details. */
  583. #ifdef TEST_KWSYS_CXX_HAS_CSTDIO
  584. #include <cstdio>
  585. int main()
  586. {
  587. return 0;
  588. }
  589. #endif
  590. #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG
  591. long long f(long long n)
  592. {
  593. return n;
  594. }
  595. int main()
  596. {
  597. long long n = 0;
  598. return static_cast<int>(f(n));
  599. }
  600. #endif
  601. #ifdef TEST_KWSYS_CXX_HAS___INT64
  602. __int64 f(__int64 n)
  603. {
  604. return n;
  605. }
  606. int main()
  607. {
  608. __int64 n = 0;
  609. return static_cast<int>(f(n));
  610. }
  611. #endif
  612. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
  613. #include <sys/types.h>
  614. #include <sys/stat.h>
  615. #include <unistd.h>
  616. int main()
  617. {
  618. struct stat stat1;
  619. (void)stat1.st_mtim.tv_sec;
  620. (void)stat1.st_mtim.tv_nsec;
  621. return 0;
  622. }
  623. #endif
  624. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
  625. #include <sys/types.h>
  626. #include <sys/stat.h>
  627. #include <unistd.h>
  628. int main()
  629. {
  630. struct stat stat1;
  631. (void)stat1.st_mtimespec.tv_sec;
  632. (void)stat1.st_mtimespec.tv_nsec;
  633. return 0;
  634. }
  635. #endif
  636. #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64
  637. void function(long**)
  638. {
  639. }
  640. int main()
  641. {
  642. __int64** p = 0;
  643. function(p);
  644. return 0;
  645. }
  646. #endif
  647. #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64
  648. void function(long long**)
  649. {
  650. }
  651. int main()
  652. {
  653. __int64** p = 0;
  654. function(p);
  655. return 0;
  656. }
  657. #endif
  658. #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG
  659. #include <iostream>
  660. int test_istream(std::istream& is, long long& x)
  661. {
  662. return (is >> x) ? 1 : 0;
  663. }
  664. int main()
  665. {
  666. long long x = 0;
  667. return test_istream(std::cin, x);
  668. }
  669. #endif
  670. #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG
  671. #include <iostream>
  672. int test_ostream(std::ostream& os, long long x)
  673. {
  674. return (os << x) ? 1 : 0;
  675. }
  676. int main()
  677. {
  678. long long x = 0;
  679. return test_ostream(std::cout, x);
  680. }
  681. #endif
  682. #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64
  683. #include <iostream>
  684. int test_istream(std::istream& is, __int64& x)
  685. {
  686. return (is >> x) ? 1 : 0;
  687. }
  688. int main()
  689. {
  690. __int64 x = 0;
  691. return test_istream(std::cin, x);
  692. }
  693. #endif
  694. #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64
  695. #include <iostream>
  696. int test_ostream(std::ostream& os, __int64 x)
  697. {
  698. return (os << x) ? 1 : 0;
  699. }
  700. int main()
  701. {
  702. __int64 x = 0;
  703. return test_ostream(std::cout, x);
  704. }
  705. #endif
  706. #ifdef TEST_KWSYS_LFS_WORKS
  707. /* Return 0 when LFS is available and 1 otherwise. */
  708. #define _LARGEFILE_SOURCE
  709. #define _LARGEFILE64_SOURCE
  710. #define _LARGE_FILES
  711. #define _FILE_OFFSET_BITS 64
  712. #include <sys/types.h>
  713. #include <assert.h>
  714. #include <sys/stat.h>
  715. #if KWSYS_CXX_HAS_CSTDIO
  716. #include <cstdio>
  717. #endif
  718. #include <stdio.h>
  719. int main(int, char** argv)
  720. {
  721. /* check that off_t can hold 2^63 - 1 and perform basic operations... */
  722. #define OFF_T_64 (((off_t)1 << 62) - 1 + ((off_t)1 << 62))
  723. if (OFF_T_64 % 2147483647 != 1)
  724. return 1;
  725. // stat breaks on SCO OpenServer
  726. struct stat buf;
  727. stat(argv[0], &buf);
  728. if (!S_ISREG(buf.st_mode))
  729. return 2;
  730. FILE* file = fopen(argv[0], "r");
  731. off_t offset = ftello(file);
  732. fseek(file, offset, SEEK_CUR);
  733. fclose(file);
  734. return 0;
  735. }
  736. #endif
  737. #ifdef TEST_KWSYS_CXX_HAS_SETENV
  738. #include <stdlib.h>
  739. int main()
  740. {
  741. return setenv("A", "B", 1);
  742. }
  743. #endif
  744. #ifdef TEST_KWSYS_CXX_HAS_UNSETENV
  745. #include <stdlib.h>
  746. int main()
  747. {
  748. unsetenv("A");
  749. return 0;
  750. }
  751. #endif
  752. #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
  753. #include <stdlib.h>
  754. int main()
  755. {
  756. char* e = environ[0];
  757. return e ? 0 : 1;
  758. }
  759. #endif
  760. #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
  761. // Match feature definitions from SystemInformation.cxx
  762. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  763. #define _GNU_SOURCE
  764. #endif
  765. #include <stdlib.h>
  766. int main()
  767. {
  768. double loadavg[3] = { 0.0, 0.0, 0.0 };
  769. return getloadavg(loadavg, 3);
  770. }
  771. #endif
  772. #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
  773. #if defined(KWSYS_HAS_LFS)
  774. #define _LARGEFILE_SOURCE
  775. #define _LARGEFILE64_SOURCE
  776. #define _LARGE_FILES
  777. #define _FILE_OFFSET_BITS 64
  778. #endif
  779. #include <sys/resource.h>
  780. int main()
  781. {
  782. struct rlimit64 rlim;
  783. return getrlimit64(0, &rlim);
  784. }
  785. #endif
  786. #ifdef TEST_KWSYS_CXX_HAS_ATOLL
  787. #include <stdlib.h>
  788. int main()
  789. {
  790. const char* str = "1024";
  791. return static_cast<int>(atoll(str));
  792. }
  793. #endif
  794. #ifdef TEST_KWSYS_CXX_HAS_ATOL
  795. #include <stdlib.h>
  796. int main()
  797. {
  798. const char* str = "1024";
  799. return static_cast<int>(atol(str));
  800. }
  801. #endif
  802. #ifdef TEST_KWSYS_CXX_HAS__ATOI64
  803. #include <stdlib.h>
  804. int main()
  805. {
  806. const char* str = "1024";
  807. return static_cast<int>(_atoi64(str));
  808. }
  809. #endif
  810. #ifdef TEST_KWSYS_CXX_HAS_UTIMES
  811. #include <sys/time.h>
  812. int main()
  813. {
  814. struct timeval* current_time = 0;
  815. return utimes("/example", current_time);
  816. }
  817. #endif
  818. #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
  819. #include <fcntl.h>
  820. #include <sys/stat.h>
  821. #if defined(__APPLE__)
  822. #include <AvailabilityMacros.h>
  823. #if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
  824. #error "utimensat not available on macOS < 10.13"
  825. #endif
  826. #endif
  827. int main()
  828. {
  829. struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
  830. return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
  831. }
  832. #endif
  833. #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
  834. #if defined(__PATHSCALE__) || defined(__PATHCC__) || \
  835. (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
  836. backtrace does not work with this compiler or os
  837. #endif
  838. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  839. #define _GNU_SOURCE
  840. #endif
  841. #include <execinfo.h>
  842. int main()
  843. {
  844. void* stackSymbols[256];
  845. backtrace(stackSymbols, 256);
  846. backtrace_symbols(&stackSymbols[0], 1);
  847. return 0;
  848. }
  849. #endif
  850. #ifdef TEST_KWSYS_CXX_HAS_DLADDR
  851. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  852. #define _GNU_SOURCE
  853. #endif
  854. #include <dlfcn.h>
  855. int main()
  856. {
  857. Dl_info info;
  858. int ierr = dladdr((void*)main, &info);
  859. return 0;
  860. }
  861. #endif
  862. #ifdef TEST_KWSYS_CXX_HAS_CXXABI
  863. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  864. #define _GNU_SOURCE
  865. #endif
  866. #if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \
  867. __SUNPRO_CC_COMPAT == 'G'
  868. #include <iostream>
  869. #endif
  870. #include <cxxabi.h>
  871. int main()
  872. {
  873. int status = 0;
  874. size_t bufferLen = 512;
  875. char buffer[512] = { '\0' };
  876. const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
  877. char* demangledFunction =
  878. abi::__cxa_demangle(function, buffer, &bufferLen, &status);
  879. return status;
  880. }
  881. #endif
  882. #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM
  883. int main()
  884. {
  885. int a = 1;
  886. __asm {
  887. xor EBX, EBX;
  888. mov a, EBX;
  889. }
  890. return a;
  891. }
  892. #endif
  893. #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID
  894. int main()
  895. {
  896. int a = 0;
  897. __asm {
  898. xor EAX, EAX;
  899. cpuid;
  900. mov a, EAX;
  901. }
  902. return a;
  903. }
  904. #endif
  905. #ifdef TEST_KWSYS_STL_HAS_WSTRING
  906. #include <string>
  907. void f(std::wstring*)
  908. {
  909. }
  910. int main()
  911. {
  912. return 0;
  913. }
  914. #endif
  915. #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
  916. #include <ext/stdio_filebuf.h>
  917. int main()
  918. {
  919. return 0;
  920. }
  921. #endif
  922. ------------------------------------------
  923. Test succeeded
  924. Try: g++
  925. Line: g++ -std=gnu++1z -DTEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Tool/cmake-3.11.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_99926_test
  926. ---------- file -----------------------
  927. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  928. file Copyright.txt or https://cmake.org/licensing#kwsys for details. */
  929. #ifdef TEST_KWSYS_CXX_HAS_CSTDIO
  930. #include <cstdio>
  931. int main()
  932. {
  933. return 0;
  934. }
  935. #endif
  936. #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG
  937. long long f(long long n)
  938. {
  939. return n;
  940. }
  941. int main()
  942. {
  943. long long n = 0;
  944. return static_cast<int>(f(n));
  945. }
  946. #endif
  947. #ifdef TEST_KWSYS_CXX_HAS___INT64
  948. __int64 f(__int64 n)
  949. {
  950. return n;
  951. }
  952. int main()
  953. {
  954. __int64 n = 0;
  955. return static_cast<int>(f(n));
  956. }
  957. #endif
  958. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
  959. #include <sys/types.h>
  960. #include <sys/stat.h>
  961. #include <unistd.h>
  962. int main()
  963. {
  964. struct stat stat1;
  965. (void)stat1.st_mtim.tv_sec;
  966. (void)stat1.st_mtim.tv_nsec;
  967. return 0;
  968. }
  969. #endif
  970. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
  971. #include <sys/types.h>
  972. #include <sys/stat.h>
  973. #include <unistd.h>
  974. int main()
  975. {
  976. struct stat stat1;
  977. (void)stat1.st_mtimespec.tv_sec;
  978. (void)stat1.st_mtimespec.tv_nsec;
  979. return 0;
  980. }
  981. #endif
  982. #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64
  983. void function(long**)
  984. {
  985. }
  986. int main()
  987. {
  988. __int64** p = 0;
  989. function(p);
  990. return 0;
  991. }
  992. #endif
  993. #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64
  994. void function(long long**)
  995. {
  996. }
  997. int main()
  998. {
  999. __int64** p = 0;
  1000. function(p);
  1001. return 0;
  1002. }
  1003. #endif
  1004. #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG
  1005. #include <iostream>
  1006. int test_istream(std::istream& is, long long& x)
  1007. {
  1008. return (is >> x) ? 1 : 0;
  1009. }
  1010. int main()
  1011. {
  1012. long long x = 0;
  1013. return test_istream(std::cin, x);
  1014. }
  1015. #endif
  1016. #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG
  1017. #include <iostream>
  1018. int test_ostream(std::ostream& os, long long x)
  1019. {
  1020. return (os << x) ? 1 : 0;
  1021. }
  1022. int main()
  1023. {
  1024. long long x = 0;
  1025. return test_ostream(std::cout, x);
  1026. }
  1027. #endif
  1028. #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64
  1029. #include <iostream>
  1030. int test_istream(std::istream& is, __int64& x)
  1031. {
  1032. return (is >> x) ? 1 : 0;
  1033. }
  1034. int main()
  1035. {
  1036. __int64 x = 0;
  1037. return test_istream(std::cin, x);
  1038. }
  1039. #endif
  1040. #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64
  1041. #include <iostream>
  1042. int test_ostream(std::ostream& os, __int64 x)
  1043. {
  1044. return (os << x) ? 1 : 0;
  1045. }
  1046. int main()
  1047. {
  1048. __int64 x = 0;
  1049. return test_ostream(std::cout, x);
  1050. }
  1051. #endif
  1052. #ifdef TEST_KWSYS_LFS_WORKS
  1053. /* Return 0 when LFS is available and 1 otherwise. */
  1054. #define _LARGEFILE_SOURCE
  1055. #define _LARGEFILE64_SOURCE
  1056. #define _LARGE_FILES
  1057. #define _FILE_OFFSET_BITS 64
  1058. #include <sys/types.h>
  1059. #include <assert.h>
  1060. #include <sys/stat.h>
  1061. #if KWSYS_CXX_HAS_CSTDIO
  1062. #include <cstdio>
  1063. #endif
  1064. #include <stdio.h>
  1065. int main(int, char** argv)
  1066. {
  1067. /* check that off_t can hold 2^63 - 1 and perform basic operations... */
  1068. #define OFF_T_64 (((off_t)1 << 62) - 1 + ((off_t)1 << 62))
  1069. if (OFF_T_64 % 2147483647 != 1)
  1070. return 1;
  1071. // stat breaks on SCO OpenServer
  1072. struct stat buf;
  1073. stat(argv[0], &buf);
  1074. if (!S_ISREG(buf.st_mode))
  1075. return 2;
  1076. FILE* file = fopen(argv[0], "r");
  1077. off_t offset = ftello(file);
  1078. fseek(file, offset, SEEK_CUR);
  1079. fclose(file);
  1080. return 0;
  1081. }
  1082. #endif
  1083. #ifdef TEST_KWSYS_CXX_HAS_SETENV
  1084. #include <stdlib.h>
  1085. int main()
  1086. {
  1087. return setenv("A", "B", 1);
  1088. }
  1089. #endif
  1090. #ifdef TEST_KWSYS_CXX_HAS_UNSETENV
  1091. #include <stdlib.h>
  1092. int main()
  1093. {
  1094. unsetenv("A");
  1095. return 0;
  1096. }
  1097. #endif
  1098. #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
  1099. #include <stdlib.h>
  1100. int main()
  1101. {
  1102. char* e = environ[0];
  1103. return e ? 0 : 1;
  1104. }
  1105. #endif
  1106. #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
  1107. // Match feature definitions from SystemInformation.cxx
  1108. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  1109. #define _GNU_SOURCE
  1110. #endif
  1111. #include <stdlib.h>
  1112. int main()
  1113. {
  1114. double loadavg[3] = { 0.0, 0.0, 0.0 };
  1115. return getloadavg(loadavg, 3);
  1116. }
  1117. #endif
  1118. #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
  1119. #if defined(KWSYS_HAS_LFS)
  1120. #define _LARGEFILE_SOURCE
  1121. #define _LARGEFILE64_SOURCE
  1122. #define _LARGE_FILES
  1123. #define _FILE_OFFSET_BITS 64
  1124. #endif
  1125. #include <sys/resource.h>
  1126. int main()
  1127. {
  1128. struct rlimit64 rlim;
  1129. return getrlimit64(0, &rlim);
  1130. }
  1131. #endif
  1132. #ifdef TEST_KWSYS_CXX_HAS_ATOLL
  1133. #include <stdlib.h>
  1134. int main()
  1135. {
  1136. const char* str = "1024";
  1137. return static_cast<int>(atoll(str));
  1138. }
  1139. #endif
  1140. #ifdef TEST_KWSYS_CXX_HAS_ATOL
  1141. #include <stdlib.h>
  1142. int main()
  1143. {
  1144. const char* str = "1024";
  1145. return static_cast<int>(atol(str));
  1146. }
  1147. #endif
  1148. #ifdef TEST_KWSYS_CXX_HAS__ATOI64
  1149. #include <stdlib.h>
  1150. int main()
  1151. {
  1152. const char* str = "1024";
  1153. return static_cast<int>(_atoi64(str));
  1154. }
  1155. #endif
  1156. #ifdef TEST_KWSYS_CXX_HAS_UTIMES
  1157. #include <sys/time.h>
  1158. int main()
  1159. {
  1160. struct timeval* current_time = 0;
  1161. return utimes("/example", current_time);
  1162. }
  1163. #endif
  1164. #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
  1165. #include <fcntl.h>
  1166. #include <sys/stat.h>
  1167. #if defined(__APPLE__)
  1168. #include <AvailabilityMacros.h>
  1169. #if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
  1170. #error "utimensat not available on macOS < 10.13"
  1171. #endif
  1172. #endif
  1173. int main()
  1174. {
  1175. struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
  1176. return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
  1177. }
  1178. #endif
  1179. #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
  1180. #if defined(__PATHSCALE__) || defined(__PATHCC__) || \
  1181. (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
  1182. backtrace does not work with this compiler or os
  1183. #endif
  1184. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  1185. #define _GNU_SOURCE
  1186. #endif
  1187. #include <execinfo.h>
  1188. int main()
  1189. {
  1190. void* stackSymbols[256];
  1191. backtrace(stackSymbols, 256);
  1192. backtrace_symbols(&stackSymbols[0], 1);
  1193. return 0;
  1194. }
  1195. #endif
  1196. #ifdef TEST_KWSYS_CXX_HAS_DLADDR
  1197. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  1198. #define _GNU_SOURCE
  1199. #endif
  1200. #include <dlfcn.h>
  1201. int main()
  1202. {
  1203. Dl_info info;
  1204. int ierr = dladdr((void*)main, &info);
  1205. return 0;
  1206. }
  1207. #endif
  1208. #ifdef TEST_KWSYS_CXX_HAS_CXXABI
  1209. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  1210. #define _GNU_SOURCE
  1211. #endif
  1212. #if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \
  1213. __SUNPRO_CC_COMPAT == 'G'
  1214. #include <iostream>
  1215. #endif
  1216. #include <cxxabi.h>
  1217. int main()
  1218. {
  1219. int status = 0;
  1220. size_t bufferLen = 512;
  1221. char buffer[512] = { '\0' };
  1222. const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
  1223. char* demangledFunction =
  1224. abi::__cxa_demangle(function, buffer, &bufferLen, &status);
  1225. return status;
  1226. }
  1227. #endif
  1228. #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM
  1229. int main()
  1230. {
  1231. int a = 1;
  1232. __asm {
  1233. xor EBX, EBX;
  1234. mov a, EBX;
  1235. }
  1236. return a;
  1237. }
  1238. #endif
  1239. #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID
  1240. int main()
  1241. {
  1242. int a = 0;
  1243. __asm {
  1244. xor EAX, EAX;
  1245. cpuid;
  1246. mov a, EAX;
  1247. }
  1248. return a;
  1249. }
  1250. #endif
  1251. #ifdef TEST_KWSYS_STL_HAS_WSTRING
  1252. #include <string>
  1253. void f(std::wstring*)
  1254. {
  1255. }
  1256. int main()
  1257. {
  1258. return 0;
  1259. }
  1260. #endif
  1261. #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
  1262. #include <ext/stdio_filebuf.h>
  1263. int main()
  1264. {
  1265. return 0;
  1266. }
  1267. #endif
  1268. ------------------------------------------
  1269. /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Tool/cmake-3.11.0/Source/kwsys/kwsysPlatformTestsCXX.cxx: In function ‘int main()’:
  1270. /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Tool/cmake-3.11.0/Source/kwsys/kwsysPlatformTestsCXX.cxx:196:13: error: ‘environ’ was not declared in this scope
  1271. char* e = environ[0];
  1272. ^
  1273. Test failed to compile
  1274. Try: g++
  1275. Line: g++ -std=gnu++1z -DTEST_KWSYS_STL_HAS_WSTRING /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Tool/cmake-3.11.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_99926_test
  1276. ---------- file -----------------------
  1277. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  1278. file Copyright.txt or https://cmake.org/licensing#kwsys for details. */
  1279. #ifdef TEST_KWSYS_CXX_HAS_CSTDIO
  1280. #include <cstdio>
  1281. int main()
  1282. {
  1283. return 0;
  1284. }
  1285. #endif
  1286. #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG
  1287. long long f(long long n)
  1288. {
  1289. return n;
  1290. }
  1291. int main()
  1292. {
  1293. long long n = 0;
  1294. return static_cast<int>(f(n));
  1295. }
  1296. #endif
  1297. #ifdef TEST_KWSYS_CXX_HAS___INT64
  1298. __int64 f(__int64 n)
  1299. {
  1300. return n;
  1301. }
  1302. int main()
  1303. {
  1304. __int64 n = 0;
  1305. return static_cast<int>(f(n));
  1306. }
  1307. #endif
  1308. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
  1309. #include <sys/types.h>
  1310. #include <sys/stat.h>
  1311. #include <unistd.h>
  1312. int main()
  1313. {
  1314. struct stat stat1;
  1315. (void)stat1.st_mtim.tv_sec;
  1316. (void)stat1.st_mtim.tv_nsec;
  1317. return 0;
  1318. }
  1319. #endif
  1320. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
  1321. #include <sys/types.h>
  1322. #include <sys/stat.h>
  1323. #include <unistd.h>
  1324. int main()
  1325. {
  1326. struct stat stat1;
  1327. (void)stat1.st_mtimespec.tv_sec;
  1328. (void)stat1.st_mtimespec.tv_nsec;
  1329. return 0;
  1330. }
  1331. #endif
  1332. #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64
  1333. void function(long**)
  1334. {
  1335. }
  1336. int main()
  1337. {
  1338. __int64** p = 0;
  1339. function(p);
  1340. return 0;
  1341. }
  1342. #endif
  1343. #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64
  1344. void function(long long**)
  1345. {
  1346. }
  1347. int main()
  1348. {
  1349. __int64** p = 0;
  1350. function(p);
  1351. return 0;
  1352. }
  1353. #endif
  1354. #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG
  1355. #include <iostream>
  1356. int test_istream(std::istream& is, long long& x)
  1357. {
  1358. return (is >> x) ? 1 : 0;
  1359. }
  1360. int main()
  1361. {
  1362. long long x = 0;
  1363. return test_istream(std::cin, x);
  1364. }
  1365. #endif
  1366. #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG
  1367. #include <iostream>
  1368. int test_ostream(std::ostream& os, long long x)
  1369. {
  1370. return (os << x) ? 1 : 0;
  1371. }
  1372. int main()
  1373. {
  1374. long long x = 0;
  1375. return test_ostream(std::cout, x);
  1376. }
  1377. #endif
  1378. #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64
  1379. #include <iostream>
  1380. int test_istream(std::istream& is, __int64& x)
  1381. {
  1382. return (is >> x) ? 1 : 0;
  1383. }
  1384. int main()
  1385. {
  1386. __int64 x = 0;
  1387. return test_istream(std::cin, x);
  1388. }
  1389. #endif
  1390. #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64
  1391. #include <iostream>
  1392. int test_ostream(std::ostream& os, __int64 x)
  1393. {
  1394. return (os << x) ? 1 : 0;
  1395. }
  1396. int main()
  1397. {
  1398. __int64 x = 0;
  1399. return test_ostream(std::cout, x);
  1400. }
  1401. #endif
  1402. #ifdef TEST_KWSYS_LFS_WORKS
  1403. /* Return 0 when LFS is available and 1 otherwise. */
  1404. #define _LARGEFILE_SOURCE
  1405. #define _LARGEFILE64_SOURCE
  1406. #define _LARGE_FILES
  1407. #define _FILE_OFFSET_BITS 64
  1408. #include <sys/types.h>
  1409. #include <assert.h>
  1410. #include <sys/stat.h>
  1411. #if KWSYS_CXX_HAS_CSTDIO
  1412. #include <cstdio>
  1413. #endif
  1414. #include <stdio.h>
  1415. int main(int, char** argv)
  1416. {
  1417. /* check that off_t can hold 2^63 - 1 and perform basic operations... */
  1418. #define OFF_T_64 (((off_t)1 << 62) - 1 + ((off_t)1 << 62))
  1419. if (OFF_T_64 % 2147483647 != 1)
  1420. return 1;
  1421. // stat breaks on SCO OpenServer
  1422. struct stat buf;
  1423. stat(argv[0], &buf);
  1424. if (!S_ISREG(buf.st_mode))
  1425. return 2;
  1426. FILE* file = fopen(argv[0], "r");
  1427. off_t offset = ftello(file);
  1428. fseek(file, offset, SEEK_CUR);
  1429. fclose(file);
  1430. return 0;
  1431. }
  1432. #endif
  1433. #ifdef TEST_KWSYS_CXX_HAS_SETENV
  1434. #include <stdlib.h>
  1435. int main()
  1436. {
  1437. return setenv("A", "B", 1);
  1438. }
  1439. #endif
  1440. #ifdef TEST_KWSYS_CXX_HAS_UNSETENV
  1441. #include <stdlib.h>
  1442. int main()
  1443. {
  1444. unsetenv("A");
  1445. return 0;
  1446. }
  1447. #endif
  1448. #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
  1449. #include <stdlib.h>
  1450. int main()
  1451. {
  1452. char* e = environ[0];
  1453. return e ? 0 : 1;
  1454. }
  1455. #endif
  1456. #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
  1457. // Match feature definitions from SystemInformation.cxx
  1458. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  1459. #define _GNU_SOURCE
  1460. #endif
  1461. #include <stdlib.h>
  1462. int main()
  1463. {
  1464. double loadavg[3] = { 0.0, 0.0, 0.0 };
  1465. return getloadavg(loadavg, 3);
  1466. }
  1467. #endif
  1468. #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
  1469. #if defined(KWSYS_HAS_LFS)
  1470. #define _LARGEFILE_SOURCE
  1471. #define _LARGEFILE64_SOURCE
  1472. #define _LARGE_FILES
  1473. #define _FILE_OFFSET_BITS 64
  1474. #endif
  1475. #include <sys/resource.h>
  1476. int main()
  1477. {
  1478. struct rlimit64 rlim;
  1479. return getrlimit64(0, &rlim);
  1480. }
  1481. #endif
  1482. #ifdef TEST_KWSYS_CXX_HAS_ATOLL
  1483. #include <stdlib.h>
  1484. int main()
  1485. {
  1486. const char* str = "1024";
  1487. return static_cast<int>(atoll(str));
  1488. }
  1489. #endif
  1490. #ifdef TEST_KWSYS_CXX_HAS_ATOL
  1491. #include <stdlib.h>
  1492. int main()
  1493. {
  1494. const char* str = "1024";
  1495. return static_cast<int>(atol(str));
  1496. }
  1497. #endif
  1498. #ifdef TEST_KWSYS_CXX_HAS__ATOI64
  1499. #include <stdlib.h>
  1500. int main()
  1501. {
  1502. const char* str = "1024";
  1503. return static_cast<int>(_atoi64(str));
  1504. }
  1505. #endif
  1506. #ifdef TEST_KWSYS_CXX_HAS_UTIMES
  1507. #include <sys/time.h>
  1508. int main()
  1509. {
  1510. struct timeval* current_time = 0;
  1511. return utimes("/example", current_time);
  1512. }
  1513. #endif
  1514. #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
  1515. #include <fcntl.h>
  1516. #include <sys/stat.h>
  1517. #if defined(__APPLE__)
  1518. #include <AvailabilityMacros.h>
  1519. #if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
  1520. #error "utimensat not available on macOS < 10.13"
  1521. #endif
  1522. #endif
  1523. int main()
  1524. {
  1525. struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
  1526. return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
  1527. }
  1528. #endif
  1529. #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
  1530. #if defined(__PATHSCALE__) || defined(__PATHCC__) || \
  1531. (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
  1532. backtrace does not work with this compiler or os
  1533. #endif
  1534. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  1535. #define _GNU_SOURCE
  1536. #endif
  1537. #include <execinfo.h>
  1538. int main()
  1539. {
  1540. void* stackSymbols[256];
  1541. backtrace(stackSymbols, 256);
  1542. backtrace_symbols(&stackSymbols[0], 1);
  1543. return 0;
  1544. }
  1545. #endif
  1546. #ifdef TEST_KWSYS_CXX_HAS_DLADDR
  1547. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  1548. #define _GNU_SOURCE
  1549. #endif
  1550. #include <dlfcn.h>
  1551. int main()
  1552. {
  1553. Dl_info info;
  1554. int ierr = dladdr((void*)main, &info);
  1555. return 0;
  1556. }
  1557. #endif
  1558. #ifdef TEST_KWSYS_CXX_HAS_CXXABI
  1559. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  1560. #define _GNU_SOURCE
  1561. #endif
  1562. #if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \
  1563. __SUNPRO_CC_COMPAT == 'G'
  1564. #include <iostream>
  1565. #endif
  1566. #include <cxxabi.h>
  1567. int main()
  1568. {
  1569. int status = 0;
  1570. size_t bufferLen = 512;
  1571. char buffer[512] = { '\0' };
  1572. const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
  1573. char* demangledFunction =
  1574. abi::__cxa_demangle(function, buffer, &bufferLen, &status);
  1575. return status;
  1576. }
  1577. #endif
  1578. #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM
  1579. int main()
  1580. {
  1581. int a = 1;
  1582. __asm {
  1583. xor EBX, EBX;
  1584. mov a, EBX;
  1585. }
  1586. return a;
  1587. }
  1588. #endif
  1589. #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID
  1590. int main()
  1591. {
  1592. int a = 0;
  1593. __asm {
  1594. xor EAX, EAX;
  1595. cpuid;
  1596. mov a, EAX;
  1597. }
  1598. return a;
  1599. }
  1600. #endif
  1601. #ifdef TEST_KWSYS_STL_HAS_WSTRING
  1602. #include <string>
  1603. void f(std::wstring*)
  1604. {
  1605. }
  1606. int main()
  1607. {
  1608. return 0;
  1609. }
  1610. #endif
  1611. #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
  1612. #include <ext/stdio_filebuf.h>
  1613. int main()
  1614. {
  1615. return 0;
  1616. }
  1617. #endif
  1618. ------------------------------------------
  1619. Test succeeded
  1620. Try: g++
  1621. Line: g++ -std=gnu++1z -DTEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/Tool/cmake-3.11.0/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_99926_test
  1622. ---------- file -----------------------
  1623. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  1624. file Copyright.txt or https://cmake.org/licensing#kwsys for details. */
  1625. #ifdef TEST_KWSYS_CXX_HAS_CSTDIO
  1626. #include <cstdio>
  1627. int main()
  1628. {
  1629. return 0;
  1630. }
  1631. #endif
  1632. #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG
  1633. long long f(long long n)
  1634. {
  1635. return n;
  1636. }
  1637. int main()
  1638. {
  1639. long long n = 0;
  1640. return static_cast<int>(f(n));
  1641. }
  1642. #endif
  1643. #ifdef TEST_KWSYS_CXX_HAS___INT64
  1644. __int64 f(__int64 n)
  1645. {
  1646. return n;
  1647. }
  1648. int main()
  1649. {
  1650. __int64 n = 0;
  1651. return static_cast<int>(f(n));
  1652. }
  1653. #endif
  1654. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
  1655. #include <sys/types.h>
  1656. #include <sys/stat.h>
  1657. #include <unistd.h>
  1658. int main()
  1659. {
  1660. struct stat stat1;
  1661. (void)stat1.st_mtim.tv_sec;
  1662. (void)stat1.st_mtim.tv_nsec;
  1663. return 0;
  1664. }
  1665. #endif
  1666. #ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
  1667. #include <sys/types.h>
  1668. #include <sys/stat.h>
  1669. #include <unistd.h>
  1670. int main()
  1671. {
  1672. struct stat stat1;
  1673. (void)stat1.st_mtimespec.tv_sec;
  1674. (void)stat1.st_mtimespec.tv_nsec;
  1675. return 0;
  1676. }
  1677. #endif
  1678. #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64
  1679. void function(long**)
  1680. {
  1681. }
  1682. int main()
  1683. {
  1684. __int64** p = 0;
  1685. function(p);
  1686. return 0;
  1687. }
  1688. #endif
  1689. #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64
  1690. void function(long long**)
  1691. {
  1692. }
  1693. int main()
  1694. {
  1695. __int64** p = 0;
  1696. function(p);
  1697. return 0;
  1698. }
  1699. #endif
  1700. #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG
  1701. #include <iostream>
  1702. int test_istream(std::istream& is, long long& x)
  1703. {
  1704. return (is >> x) ? 1 : 0;
  1705. }
  1706. int main()
  1707. {
  1708. long long x = 0;
  1709. return test_istream(std::cin, x);
  1710. }
  1711. #endif
  1712. #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG
  1713. #include <iostream>
  1714. int test_ostream(std::ostream& os, long long x)
  1715. {
  1716. return (os << x) ? 1 : 0;
  1717. }
  1718. int main()
  1719. {
  1720. long long x = 0;
  1721. return test_ostream(std::cout, x);
  1722. }
  1723. #endif
  1724. #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64
  1725. #include <iostream>
  1726. int test_istream(std::istream& is, __int64& x)
  1727. {
  1728. return (is >> x) ? 1 : 0;
  1729. }
  1730. int main()
  1731. {
  1732. __int64 x = 0;
  1733. return test_istream(std::cin, x);
  1734. }
  1735. #endif
  1736. #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64
  1737. #include <iostream>
  1738. int test_ostream(std::ostream& os, __int64 x)
  1739. {
  1740. return (os << x) ? 1 : 0;
  1741. }
  1742. int main()
  1743. {
  1744. __int64 x = 0;
  1745. return test_ostream(std::cout, x);
  1746. }
  1747. #endif
  1748. #ifdef TEST_KWSYS_LFS_WORKS
  1749. /* Return 0 when LFS is available and 1 otherwise. */
  1750. #define _LARGEFILE_SOURCE
  1751. #define _LARGEFILE64_SOURCE
  1752. #define _LARGE_FILES
  1753. #define _FILE_OFFSET_BITS 64
  1754. #include <sys/types.h>
  1755. #include <assert.h>
  1756. #include <sys/stat.h>
  1757. #if KWSYS_CXX_HAS_CSTDIO
  1758. #include <cstdio>
  1759. #endif
  1760. #include <stdio.h>
  1761. int main(int, char** argv)
  1762. {
  1763. /* check that off_t can hold 2^63 - 1 and perform basic operations... */
  1764. #define OFF_T_64 (((off_t)1 << 62) - 1 + ((off_t)1 << 62))
  1765. if (OFF_T_64 % 2147483647 != 1)
  1766. return 1;
  1767. // stat breaks on SCO OpenServer
  1768. struct stat buf;
  1769. stat(argv[0], &buf);
  1770. if (!S_ISREG(buf.st_mode))
  1771. return 2;
  1772. FILE* file = fopen(argv[0], "r");
  1773. off_t offset = ftello(file);
  1774. fseek(file, offset, SEEK_CUR);
  1775. fclose(file);
  1776. return 0;
  1777. }
  1778. #endif
  1779. #ifdef TEST_KWSYS_CXX_HAS_SETENV
  1780. #include <stdlib.h>
  1781. int main()
  1782. {
  1783. return setenv("A", "B", 1);
  1784. }
  1785. #endif
  1786. #ifdef TEST_KWSYS_CXX_HAS_UNSETENV
  1787. #include <stdlib.h>
  1788. int main()
  1789. {
  1790. unsetenv("A");
  1791. return 0;
  1792. }
  1793. #endif
  1794. #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
  1795. #include <stdlib.h>
  1796. int main()
  1797. {
  1798. char* e = environ[0];
  1799. return e ? 0 : 1;
  1800. }
  1801. #endif
  1802. #ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
  1803. // Match feature definitions from SystemInformation.cxx
  1804. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  1805. #define _GNU_SOURCE
  1806. #endif
  1807. #include <stdlib.h>
  1808. int main()
  1809. {
  1810. double loadavg[3] = { 0.0, 0.0, 0.0 };
  1811. return getloadavg(loadavg, 3);
  1812. }
  1813. #endif
  1814. #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
  1815. #if defined(KWSYS_HAS_LFS)
  1816. #define _LARGEFILE_SOURCE
  1817. #define _LARGEFILE64_SOURCE
  1818. #define _LARGE_FILES
  1819. #define _FILE_OFFSET_BITS 64
  1820. #endif
  1821. #include <sys/resource.h>
  1822. int main()
  1823. {
  1824. struct rlimit64 rlim;
  1825. return getrlimit64(0, &rlim);
  1826. }
  1827. #endif
  1828. #ifdef TEST_KWSYS_CXX_HAS_ATOLL
  1829. #include <stdlib.h>
  1830. int main()
  1831. {
  1832. const char* str = "1024";
  1833. return static_cast<int>(atoll(str));
  1834. }
  1835. #endif
  1836. #ifdef TEST_KWSYS_CXX_HAS_ATOL
  1837. #include <stdlib.h>
  1838. int main()
  1839. {
  1840. const char* str = "1024";
  1841. return static_cast<int>(atol(str));
  1842. }
  1843. #endif
  1844. #ifdef TEST_KWSYS_CXX_HAS__ATOI64
  1845. #include <stdlib.h>
  1846. int main()
  1847. {
  1848. const char* str = "1024";
  1849. return static_cast<int>(_atoi64(str));
  1850. }
  1851. #endif
  1852. #ifdef TEST_KWSYS_CXX_HAS_UTIMES
  1853. #include <sys/time.h>
  1854. int main()
  1855. {
  1856. struct timeval* current_time = 0;
  1857. return utimes("/example", current_time);
  1858. }
  1859. #endif
  1860. #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
  1861. #include <fcntl.h>
  1862. #include <sys/stat.h>
  1863. #if defined(__APPLE__)
  1864. #include <AvailabilityMacros.h>
  1865. #if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
  1866. #error "utimensat not available on macOS < 10.13"
  1867. #endif
  1868. #endif
  1869. int main()
  1870. {
  1871. struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
  1872. return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
  1873. }
  1874. #endif
  1875. #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
  1876. #if defined(__PATHSCALE__) || defined(__PATHCC__) || \
  1877. (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
  1878. backtrace does not work with this compiler or os
  1879. #endif
  1880. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  1881. #define _GNU_SOURCE
  1882. #endif
  1883. #include <execinfo.h>
  1884. int main()
  1885. {
  1886. void* stackSymbols[256];
  1887. backtrace(stackSymbols, 256);
  1888. backtrace_symbols(&stackSymbols[0], 1);
  1889. return 0;
  1890. }
  1891. #endif
  1892. #ifdef TEST_KWSYS_CXX_HAS_DLADDR
  1893. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  1894. #define _GNU_SOURCE
  1895. #endif
  1896. #include <dlfcn.h>
  1897. int main()
  1898. {
  1899. Dl_info info;
  1900. int ierr = dladdr((void*)main, &info);
  1901. return 0;
  1902. }
  1903. #endif
  1904. #ifdef TEST_KWSYS_CXX_HAS_CXXABI
  1905. #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
  1906. #define _GNU_SOURCE
  1907. #endif
  1908. #if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux && \
  1909. __SUNPRO_CC_COMPAT == 'G'
  1910. #include <iostream>
  1911. #endif
  1912. #include <cxxabi.h>
  1913. int main()
  1914. {
  1915. int status = 0;
  1916. size_t bufferLen = 512;
  1917. char buffer[512] = { '\0' };
  1918. const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
  1919. char* demangledFunction =
  1920. abi::__cxa_demangle(function, buffer, &bufferLen, &status);
  1921. return status;
  1922. }
  1923. #endif
  1924. #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM
  1925. int main()
  1926. {
  1927. int a = 1;
  1928. __asm {
  1929. xor EBX, EBX;
  1930. mov a, EBX;
  1931. }
  1932. return a;
  1933. }
  1934. #endif
  1935. #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID
  1936. int main()
  1937. {
  1938. int a = 0;
  1939. __asm {
  1940. xor EAX, EAX;
  1941. cpuid;
  1942. mov a, EAX;
  1943. }
  1944. return a;
  1945. }
  1946. #endif
  1947. #ifdef TEST_KWSYS_STL_HAS_WSTRING
  1948. #include <string>
  1949. void f(std::wstring*)
  1950. {
  1951. }
  1952. int main()
  1953. {
  1954. return 0;
  1955. }
  1956. #endif
  1957. #ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
  1958. #include <ext/stdio_filebuf.h>
  1959. int main()
  1960. {
  1961. return 0;
  1962. }
  1963. #endif
  1964. ------------------------------------------
  1965. Test succeeded