Ticket #63460: cmake_bootstrap.log

File cmake_bootstrap.log, 70.2 KB (added by tehcog (tehcog), 3 years ago)

bootstrap.log

Line 
1Checking whether '/usr/bin/clang -pipe -Os -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation  ' works.
2Try: /usr/bin/clang
3Line: /usr/bin/clang -pipe -Os -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation   cmake_bootstrap_4359_test.c -o cmake_bootstrap_4359_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
24int main(int argc, char* argv[])
25{
26  printf("%d%c", (argv != 0), (char)0x0a);
27  return argc - 1;
28}
29
30------------------------------------------
311
32Test succeeded
33Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation  ' works.
34Try: /usr/bin/clang++
35Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation   cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_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>
60int 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
71int check_cxx14()
72{
73  return 0;
74}
75#endif
76
77#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
78#include <optional>
79template <typename T,
80          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
81typename T::pointer get_ptr(T& item)
82{
83  return item.get();
84}
85
86int 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
95int check_cxx17()
96{
97  return 0;
98}
99#endif
100
101class Class
102{
103public:
104  int Get() const { return this->Member; }
105private:
106  int Member = 1;
107};
108int 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------------------------------------------
116cmake_bootstrap_4359_test.cxx:7:2: error: "Compiler is not in a mode aware of C++11."
117#error "Compiler is not in a mode aware of C++11."
118 ^
119cmake_bootstrap_4359_test.cxx:70:14: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]
120  int Member = 1;
121             ^
122cmake_bootstrap_4359_test.cxx:74:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
123  auto const c = std::unique_ptr<Class>(new Class);
124  ^
1252 warnings and 1 error generated.
126Test failed to compile
127Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++17 ' works.
128Try: /usr/bin/clang++
129Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++17  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
130----------  file   -----------------------
131
132#include <iostream>
133#include <memory>
134#include <unordered_map>
135
136#if __cplusplus < 201103L
137#error "Compiler is not in a mode aware of C++11."
138#endif
139
140#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
141#error "On AIX with GNU we need the -pthread flag."
142#endif
143
144#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
145#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
146#endif
147
148#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
149#error "On HP-UX we need GCC 4.9 or higher."
150#endif
151
152#if __cplusplus > 201103L
153#include <iterator>
154int check_cxx14()
155{
156  int a[] = { 0, 1, 2 };
157  auto ai = std::cbegin(a);
158
159  int b[] = { 2, 1, 0 };
160  auto bi = std::cend(b);
161
162  return *ai + *(bi - 1);
163}
164#else
165int check_cxx14()
166{
167  return 0;
168}
169#endif
170
171#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
172#include <optional>
173template <typename T,
174          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
175typename T::pointer get_ptr(T& item)
176{
177  return item.get();
178}
179
180int check_cxx17()
181{
182  // Intel compiler do not handle correctly decltype inside invoke_result
183  std::unique_ptr<int> u(new int(0));
184  get_ptr(u);
185  std::optional<int> oi = 0;
186  return oi.value();
187}
188#else
189int check_cxx17()
190{
191  return 0;
192}
193#endif
194
195class Class
196{
197public:
198  int Get() const { return this->Member; }
199private:
200  int Member = 1;
201};
202int main()
203{
204  auto const c = std::unique_ptr<Class>(new Class);
205  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
206  return 0;
207}
208
209------------------------------------------
210error: invalid value 'gnu++17' in '-std=gnu++17'
211Test failed to compile
212Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++1z ' works.
213Try: /usr/bin/clang++
214Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++1z  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
215----------  file   -----------------------
216
217#include <iostream>
218#include <memory>
219#include <unordered_map>
220
221#if __cplusplus < 201103L
222#error "Compiler is not in a mode aware of C++11."
223#endif
224
225#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
226#error "On AIX with GNU we need the -pthread flag."
227#endif
228
229#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
230#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
231#endif
232
233#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
234#error "On HP-UX we need GCC 4.9 or higher."
235#endif
236
237#if __cplusplus > 201103L
238#include <iterator>
239int check_cxx14()
240{
241  int a[] = { 0, 1, 2 };
242  auto ai = std::cbegin(a);
243
244  int b[] = { 2, 1, 0 };
245  auto bi = std::cend(b);
246
247  return *ai + *(bi - 1);
248}
249#else
250int check_cxx14()
251{
252  return 0;
253}
254#endif
255
256#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
257#include <optional>
258template <typename T,
259          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
260typename T::pointer get_ptr(T& item)
261{
262  return item.get();
263}
264
265int check_cxx17()
266{
267  // Intel compiler do not handle correctly decltype inside invoke_result
268  std::unique_ptr<int> u(new int(0));
269  get_ptr(u);
270  std::optional<int> oi = 0;
271  return oi.value();
272}
273#else
274int check_cxx17()
275{
276  return 0;
277}
278#endif
279
280class Class
281{
282public:
283  int Get() const { return this->Member; }
284private:
285  int Member = 1;
286};
287int main()
288{
289  auto const c = std::unique_ptr<Class>(new Class);
290  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
291  return 0;
292}
293
294------------------------------------------
295error: invalid value 'gnu++1z' in '-std=gnu++1z'
296Test failed to compile
297Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++17 ' works.
298Try: /usr/bin/clang++
299Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++17  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
300----------  file   -----------------------
301
302#include <iostream>
303#include <memory>
304#include <unordered_map>
305
306#if __cplusplus < 201103L
307#error "Compiler is not in a mode aware of C++11."
308#endif
309
310#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
311#error "On AIX with GNU we need the -pthread flag."
312#endif
313
314#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
315#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
316#endif
317
318#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
319#error "On HP-UX we need GCC 4.9 or higher."
320#endif
321
322#if __cplusplus > 201103L
323#include <iterator>
324int check_cxx14()
325{
326  int a[] = { 0, 1, 2 };
327  auto ai = std::cbegin(a);
328
329  int b[] = { 2, 1, 0 };
330  auto bi = std::cend(b);
331
332  return *ai + *(bi - 1);
333}
334#else
335int check_cxx14()
336{
337  return 0;
338}
339#endif
340
341#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
342#include <optional>
343template <typename T,
344          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
345typename T::pointer get_ptr(T& item)
346{
347  return item.get();
348}
349
350int check_cxx17()
351{
352  // Intel compiler do not handle correctly decltype inside invoke_result
353  std::unique_ptr<int> u(new int(0));
354  get_ptr(u);
355  std::optional<int> oi = 0;
356  return oi.value();
357}
358#else
359int check_cxx17()
360{
361  return 0;
362}
363#endif
364
365class Class
366{
367public:
368  int Get() const { return this->Member; }
369private:
370  int Member = 1;
371};
372int main()
373{
374  auto const c = std::unique_ptr<Class>(new Class);
375  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
376  return 0;
377}
378
379------------------------------------------
380error: invalid value 'gnu++17' in '-std=gnu++17'
381Test failed to compile
382Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++17 ' works.
383Try: /usr/bin/clang++
384Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++17  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
385----------  file   -----------------------
386
387#include <iostream>
388#include <memory>
389#include <unordered_map>
390
391#if __cplusplus < 201103L
392#error "Compiler is not in a mode aware of C++11."
393#endif
394
395#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
396#error "On AIX with GNU we need the -pthread flag."
397#endif
398
399#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
400#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
401#endif
402
403#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
404#error "On HP-UX we need GCC 4.9 or higher."
405#endif
406
407#if __cplusplus > 201103L
408#include <iterator>
409int check_cxx14()
410{
411  int a[] = { 0, 1, 2 };
412  auto ai = std::cbegin(a);
413
414  int b[] = { 2, 1, 0 };
415  auto bi = std::cend(b);
416
417  return *ai + *(bi - 1);
418}
419#else
420int check_cxx14()
421{
422  return 0;
423}
424#endif
425
426#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
427#include <optional>
428template <typename T,
429          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
430typename T::pointer get_ptr(T& item)
431{
432  return item.get();
433}
434
435int check_cxx17()
436{
437  // Intel compiler do not handle correctly decltype inside invoke_result
438  std::unique_ptr<int> u(new int(0));
439  get_ptr(u);
440  std::optional<int> oi = 0;
441  return oi.value();
442}
443#else
444int check_cxx17()
445{
446  return 0;
447}
448#endif
449
450class Class
451{
452public:
453  int Get() const { return this->Member; }
454private:
455  int Member = 1;
456};
457int main()
458{
459  auto const c = std::unique_ptr<Class>(new Class);
460  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
461  return 0;
462}
463
464------------------------------------------
465error: invalid value 'gnu++17' in '-std=gnu++17'
466Test failed to compile
467Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++1z ' works.
468Try: /usr/bin/clang++
469Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++1z  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
470----------  file   -----------------------
471
472#include <iostream>
473#include <memory>
474#include <unordered_map>
475
476#if __cplusplus < 201103L
477#error "Compiler is not in a mode aware of C++11."
478#endif
479
480#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
481#error "On AIX with GNU we need the -pthread flag."
482#endif
483
484#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
485#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
486#endif
487
488#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
489#error "On HP-UX we need GCC 4.9 or higher."
490#endif
491
492#if __cplusplus > 201103L
493#include <iterator>
494int check_cxx14()
495{
496  int a[] = { 0, 1, 2 };
497  auto ai = std::cbegin(a);
498
499  int b[] = { 2, 1, 0 };
500  auto bi = std::cend(b);
501
502  return *ai + *(bi - 1);
503}
504#else
505int check_cxx14()
506{
507  return 0;
508}
509#endif
510
511#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
512#include <optional>
513template <typename T,
514          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
515typename T::pointer get_ptr(T& item)
516{
517  return item.get();
518}
519
520int check_cxx17()
521{
522  // Intel compiler do not handle correctly decltype inside invoke_result
523  std::unique_ptr<int> u(new int(0));
524  get_ptr(u);
525  std::optional<int> oi = 0;
526  return oi.value();
527}
528#else
529int check_cxx17()
530{
531  return 0;
532}
533#endif
534
535class Class
536{
537public:
538  int Get() const { return this->Member; }
539private:
540  int Member = 1;
541};
542int main()
543{
544  auto const c = std::unique_ptr<Class>(new Class);
545  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
546  return 0;
547}
548
549------------------------------------------
550error: invalid value 'gnu++1z' in '-std=gnu++1z'
551Test failed to compile
552Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -Qstd=c++17 ' works.
553Try: /usr/bin/clang++
554Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -Qstd=c++17  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
555----------  file   -----------------------
556
557#include <iostream>
558#include <memory>
559#include <unordered_map>
560
561#if __cplusplus < 201103L
562#error "Compiler is not in a mode aware of C++11."
563#endif
564
565#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
566#error "On AIX with GNU we need the -pthread flag."
567#endif
568
569#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
570#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
571#endif
572
573#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
574#error "On HP-UX we need GCC 4.9 or higher."
575#endif
576
577#if __cplusplus > 201103L
578#include <iterator>
579int check_cxx14()
580{
581  int a[] = { 0, 1, 2 };
582  auto ai = std::cbegin(a);
583
584  int b[] = { 2, 1, 0 };
585  auto bi = std::cend(b);
586
587  return *ai + *(bi - 1);
588}
589#else
590int check_cxx14()
591{
592  return 0;
593}
594#endif
595
596#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
597#include <optional>
598template <typename T,
599          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
600typename T::pointer get_ptr(T& item)
601{
602  return item.get();
603}
604
605int check_cxx17()
606{
607  // Intel compiler do not handle correctly decltype inside invoke_result
608  std::unique_ptr<int> u(new int(0));
609  get_ptr(u);
610  std::optional<int> oi = 0;
611  return oi.value();
612}
613#else
614int check_cxx17()
615{
616  return 0;
617}
618#endif
619
620class Class
621{
622public:
623  int Get() const { return this->Member; }
624private:
625  int Member = 1;
626};
627int main()
628{
629  auto const c = std::unique_ptr<Class>(new Class);
630  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
631  return 0;
632}
633
634------------------------------------------
635clang: error: unknown argument: '-Qstd=c++17'
636Test failed to compile
637Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++17 ' works.
638Try: /usr/bin/clang++
639Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++17  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
640----------  file   -----------------------
641
642#include <iostream>
643#include <memory>
644#include <unordered_map>
645
646#if __cplusplus < 201103L
647#error "Compiler is not in a mode aware of C++11."
648#endif
649
650#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
651#error "On AIX with GNU we need the -pthread flag."
652#endif
653
654#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
655#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
656#endif
657
658#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
659#error "On HP-UX we need GCC 4.9 or higher."
660#endif
661
662#if __cplusplus > 201103L
663#include <iterator>
664int check_cxx14()
665{
666  int a[] = { 0, 1, 2 };
667  auto ai = std::cbegin(a);
668
669  int b[] = { 2, 1, 0 };
670  auto bi = std::cend(b);
671
672  return *ai + *(bi - 1);
673}
674#else
675int check_cxx14()
676{
677  return 0;
678}
679#endif
680
681#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
682#include <optional>
683template <typename T,
684          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
685typename T::pointer get_ptr(T& item)
686{
687  return item.get();
688}
689
690int check_cxx17()
691{
692  // Intel compiler do not handle correctly decltype inside invoke_result
693  std::unique_ptr<int> u(new int(0));
694  get_ptr(u);
695  std::optional<int> oi = 0;
696  return oi.value();
697}
698#else
699int check_cxx17()
700{
701  return 0;
702}
703#endif
704
705class Class
706{
707public:
708  int Get() const { return this->Member; }
709private:
710  int Member = 1;
711};
712int main()
713{
714  auto const c = std::unique_ptr<Class>(new Class);
715  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
716  return 0;
717}
718
719------------------------------------------
720error: invalid value 'gnu++17' in '-std=gnu++17'
721Test failed to compile
722Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++17 ' works.
723Try: /usr/bin/clang++
724Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++17  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
725----------  file   -----------------------
726
727#include <iostream>
728#include <memory>
729#include <unordered_map>
730
731#if __cplusplus < 201103L
732#error "Compiler is not in a mode aware of C++11."
733#endif
734
735#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
736#error "On AIX with GNU we need the -pthread flag."
737#endif
738
739#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
740#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
741#endif
742
743#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
744#error "On HP-UX we need GCC 4.9 or higher."
745#endif
746
747#if __cplusplus > 201103L
748#include <iterator>
749int check_cxx14()
750{
751  int a[] = { 0, 1, 2 };
752  auto ai = std::cbegin(a);
753
754  int b[] = { 2, 1, 0 };
755  auto bi = std::cend(b);
756
757  return *ai + *(bi - 1);
758}
759#else
760int check_cxx14()
761{
762  return 0;
763}
764#endif
765
766#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
767#include <optional>
768template <typename T,
769          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
770typename T::pointer get_ptr(T& item)
771{
772  return item.get();
773}
774
775int check_cxx17()
776{
777  // Intel compiler do not handle correctly decltype inside invoke_result
778  std::unique_ptr<int> u(new int(0));
779  get_ptr(u);
780  std::optional<int> oi = 0;
781  return oi.value();
782}
783#else
784int check_cxx17()
785{
786  return 0;
787}
788#endif
789
790class Class
791{
792public:
793  int Get() const { return this->Member; }
794private:
795  int Member = 1;
796};
797int main()
798{
799  auto const c = std::unique_ptr<Class>(new Class);
800  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
801  return 0;
802}
803
804------------------------------------------
805error: invalid value 'gnu++17' in '-std=gnu++17'
806Test failed to compile
807Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -Qstd=c++17 ' works.
808Try: /usr/bin/clang++
809Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -Qstd=c++17  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
810----------  file   -----------------------
811
812#include <iostream>
813#include <memory>
814#include <unordered_map>
815
816#if __cplusplus < 201103L
817#error "Compiler is not in a mode aware of C++11."
818#endif
819
820#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
821#error "On AIX with GNU we need the -pthread flag."
822#endif
823
824#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
825#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
826#endif
827
828#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
829#error "On HP-UX we need GCC 4.9 or higher."
830#endif
831
832#if __cplusplus > 201103L
833#include <iterator>
834int check_cxx14()
835{
836  int a[] = { 0, 1, 2 };
837  auto ai = std::cbegin(a);
838
839  int b[] = { 2, 1, 0 };
840  auto bi = std::cend(b);
841
842  return *ai + *(bi - 1);
843}
844#else
845int check_cxx14()
846{
847  return 0;
848}
849#endif
850
851#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
852#include <optional>
853template <typename T,
854          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
855typename T::pointer get_ptr(T& item)
856{
857  return item.get();
858}
859
860int check_cxx17()
861{
862  // Intel compiler do not handle correctly decltype inside invoke_result
863  std::unique_ptr<int> u(new int(0));
864  get_ptr(u);
865  std::optional<int> oi = 0;
866  return oi.value();
867}
868#else
869int check_cxx17()
870{
871  return 0;
872}
873#endif
874
875class Class
876{
877public:
878  int Get() const { return this->Member; }
879private:
880  int Member = 1;
881};
882int main()
883{
884  auto const c = std::unique_ptr<Class>(new Class);
885  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
886  return 0;
887}
888
889------------------------------------------
890clang: error: unknown argument: '-Qstd=c++17'
891Test failed to compile
892Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std:c++17 ' works.
893Try: /usr/bin/clang++
894Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std:c++17  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
895----------  file   -----------------------
896
897#include <iostream>
898#include <memory>
899#include <unordered_map>
900
901#if __cplusplus < 201103L
902#error "Compiler is not in a mode aware of C++11."
903#endif
904
905#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
906#error "On AIX with GNU we need the -pthread flag."
907#endif
908
909#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
910#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
911#endif
912
913#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
914#error "On HP-UX we need GCC 4.9 or higher."
915#endif
916
917#if __cplusplus > 201103L
918#include <iterator>
919int check_cxx14()
920{
921  int a[] = { 0, 1, 2 };
922  auto ai = std::cbegin(a);
923
924  int b[] = { 2, 1, 0 };
925  auto bi = std::cend(b);
926
927  return *ai + *(bi - 1);
928}
929#else
930int check_cxx14()
931{
932  return 0;
933}
934#endif
935
936#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
937#include <optional>
938template <typename T,
939          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
940typename T::pointer get_ptr(T& item)
941{
942  return item.get();
943}
944
945int check_cxx17()
946{
947  // Intel compiler do not handle correctly decltype inside invoke_result
948  std::unique_ptr<int> u(new int(0));
949  get_ptr(u);
950  std::optional<int> oi = 0;
951  return oi.value();
952}
953#else
954int check_cxx17()
955{
956  return 0;
957}
958#endif
959
960class Class
961{
962public:
963  int Get() const { return this->Member; }
964private:
965  int Member = 1;
966};
967int main()
968{
969  auto const c = std::unique_ptr<Class>(new Class);
970  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
971  return 0;
972}
973
974------------------------------------------
975clang: error: unknown argument: '-std:c++17'
976Test failed to compile
977Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std:c++latest ' works.
978Try: /usr/bin/clang++
979Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std:c++latest  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
980----------  file   -----------------------
981
982#include <iostream>
983#include <memory>
984#include <unordered_map>
985
986#if __cplusplus < 201103L
987#error "Compiler is not in a mode aware of C++11."
988#endif
989
990#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
991#error "On AIX with GNU we need the -pthread flag."
992#endif
993
994#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
995#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
996#endif
997
998#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
999#error "On HP-UX we need GCC 4.9 or higher."
1000#endif
1001
1002#if __cplusplus > 201103L
1003#include <iterator>
1004int check_cxx14()
1005{
1006  int a[] = { 0, 1, 2 };
1007  auto ai = std::cbegin(a);
1008
1009  int b[] = { 2, 1, 0 };
1010  auto bi = std::cend(b);
1011
1012  return *ai + *(bi - 1);
1013}
1014#else
1015int check_cxx14()
1016{
1017  return 0;
1018}
1019#endif
1020
1021#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
1022#include <optional>
1023template <typename T,
1024          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
1025typename T::pointer get_ptr(T& item)
1026{
1027  return item.get();
1028}
1029
1030int check_cxx17()
1031{
1032  // Intel compiler do not handle correctly decltype inside invoke_result
1033  std::unique_ptr<int> u(new int(0));
1034  get_ptr(u);
1035  std::optional<int> oi = 0;
1036  return oi.value();
1037}
1038#else
1039int check_cxx17()
1040{
1041  return 0;
1042}
1043#endif
1044
1045class Class
1046{
1047public:
1048  int Get() const { return this->Member; }
1049private:
1050  int Member = 1;
1051};
1052int main()
1053{
1054  auto const c = std::unique_ptr<Class>(new Class);
1055  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
1056  return 0;
1057}
1058
1059------------------------------------------
1060clang: error: unknown argument: '-std:c++latest'
1061Test failed to compile
1062Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation --c++17 ' works.
1063Try: /usr/bin/clang++
1064Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation --c++17  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
1065----------  file   -----------------------
1066
1067#include <iostream>
1068#include <memory>
1069#include <unordered_map>
1070
1071#if __cplusplus < 201103L
1072#error "Compiler is not in a mode aware of C++11."
1073#endif
1074
1075#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
1076#error "On AIX with GNU we need the -pthread flag."
1077#endif
1078
1079#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
1080#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
1081#endif
1082
1083#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
1084#error "On HP-UX we need GCC 4.9 or higher."
1085#endif
1086
1087#if __cplusplus > 201103L
1088#include <iterator>
1089int check_cxx14()
1090{
1091  int a[] = { 0, 1, 2 };
1092  auto ai = std::cbegin(a);
1093
1094  int b[] = { 2, 1, 0 };
1095  auto bi = std::cend(b);
1096
1097  return *ai + *(bi - 1);
1098}
1099#else
1100int check_cxx14()
1101{
1102  return 0;
1103}
1104#endif
1105
1106#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
1107#include <optional>
1108template <typename T,
1109          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
1110typename T::pointer get_ptr(T& item)
1111{
1112  return item.get();
1113}
1114
1115int check_cxx17()
1116{
1117  // Intel compiler do not handle correctly decltype inside invoke_result
1118  std::unique_ptr<int> u(new int(0));
1119  get_ptr(u);
1120  std::optional<int> oi = 0;
1121  return oi.value();
1122}
1123#else
1124int check_cxx17()
1125{
1126  return 0;
1127}
1128#endif
1129
1130class Class
1131{
1132public:
1133  int Get() const { return this->Member; }
1134private:
1135  int Member = 1;
1136};
1137int main()
1138{
1139  auto const c = std::unique_ptr<Class>(new Class);
1140  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
1141  return 0;
1142}
1143
1144------------------------------------------
1145clang: error: unsupported option '--c++17'
1146Test failed to compile
1147Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation --gnu_extensions ' works.
1148Try: /usr/bin/clang++
1149Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation --gnu_extensions  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
1150----------  file   -----------------------
1151
1152#include <iostream>
1153#include <memory>
1154#include <unordered_map>
1155
1156#if __cplusplus < 201103L
1157#error "Compiler is not in a mode aware of C++11."
1158#endif
1159
1160#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
1161#error "On AIX with GNU we need the -pthread flag."
1162#endif
1163
1164#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
1165#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
1166#endif
1167
1168#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
1169#error "On HP-UX we need GCC 4.9 or higher."
1170#endif
1171
1172#if __cplusplus > 201103L
1173#include <iterator>
1174int check_cxx14()
1175{
1176  int a[] = { 0, 1, 2 };
1177  auto ai = std::cbegin(a);
1178
1179  int b[] = { 2, 1, 0 };
1180  auto bi = std::cend(b);
1181
1182  return *ai + *(bi - 1);
1183}
1184#else
1185int check_cxx14()
1186{
1187  return 0;
1188}
1189#endif
1190
1191#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
1192#include <optional>
1193template <typename T,
1194          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
1195typename T::pointer get_ptr(T& item)
1196{
1197  return item.get();
1198}
1199
1200int check_cxx17()
1201{
1202  // Intel compiler do not handle correctly decltype inside invoke_result
1203  std::unique_ptr<int> u(new int(0));
1204  get_ptr(u);
1205  std::optional<int> oi = 0;
1206  return oi.value();
1207}
1208#else
1209int check_cxx17()
1210{
1211  return 0;
1212}
1213#endif
1214
1215class Class
1216{
1217public:
1218  int Get() const { return this->Member; }
1219private:
1220  int Member = 1;
1221};
1222int main()
1223{
1224  auto const c = std::unique_ptr<Class>(new Class);
1225  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
1226  return 0;
1227}
1228
1229------------------------------------------
1230clang: error: unsupported option '--gnu_extensions'
1231Test failed to compile
1232Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++17 ' works.
1233Try: /usr/bin/clang++
1234Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++17  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
1235----------  file   -----------------------
1236
1237#include <iostream>
1238#include <memory>
1239#include <unordered_map>
1240
1241#if __cplusplus < 201103L
1242#error "Compiler is not in a mode aware of C++11."
1243#endif
1244
1245#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
1246#error "On AIX with GNU we need the -pthread flag."
1247#endif
1248
1249#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
1250#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
1251#endif
1252
1253#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
1254#error "On HP-UX we need GCC 4.9 or higher."
1255#endif
1256
1257#if __cplusplus > 201103L
1258#include <iterator>
1259int check_cxx14()
1260{
1261  int a[] = { 0, 1, 2 };
1262  auto ai = std::cbegin(a);
1263
1264  int b[] = { 2, 1, 0 };
1265  auto bi = std::cend(b);
1266
1267  return *ai + *(bi - 1);
1268}
1269#else
1270int check_cxx14()
1271{
1272  return 0;
1273}
1274#endif
1275
1276#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
1277#include <optional>
1278template <typename T,
1279          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
1280typename T::pointer get_ptr(T& item)
1281{
1282  return item.get();
1283}
1284
1285int check_cxx17()
1286{
1287  // Intel compiler do not handle correctly decltype inside invoke_result
1288  std::unique_ptr<int> u(new int(0));
1289  get_ptr(u);
1290  std::optional<int> oi = 0;
1291  return oi.value();
1292}
1293#else
1294int check_cxx17()
1295{
1296  return 0;
1297}
1298#endif
1299
1300class Class
1301{
1302public:
1303  int Get() const { return this->Member; }
1304private:
1305  int Member = 1;
1306};
1307int main()
1308{
1309  auto const c = std::unique_ptr<Class>(new Class);
1310  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
1311  return 0;
1312}
1313
1314------------------------------------------
1315error: invalid value 'gnu++17' in '-std=gnu++17'
1316Test failed to compile
1317Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++1z ' works.
1318Try: /usr/bin/clang++
1319Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++1z  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
1320----------  file   -----------------------
1321
1322#include <iostream>
1323#include <memory>
1324#include <unordered_map>
1325
1326#if __cplusplus < 201103L
1327#error "Compiler is not in a mode aware of C++11."
1328#endif
1329
1330#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
1331#error "On AIX with GNU we need the -pthread flag."
1332#endif
1333
1334#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
1335#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
1336#endif
1337
1338#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
1339#error "On HP-UX we need GCC 4.9 or higher."
1340#endif
1341
1342#if __cplusplus > 201103L
1343#include <iterator>
1344int check_cxx14()
1345{
1346  int a[] = { 0, 1, 2 };
1347  auto ai = std::cbegin(a);
1348
1349  int b[] = { 2, 1, 0 };
1350  auto bi = std::cend(b);
1351
1352  return *ai + *(bi - 1);
1353}
1354#else
1355int check_cxx14()
1356{
1357  return 0;
1358}
1359#endif
1360
1361#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
1362#include <optional>
1363template <typename T,
1364          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
1365typename T::pointer get_ptr(T& item)
1366{
1367  return item.get();
1368}
1369
1370int check_cxx17()
1371{
1372  // Intel compiler do not handle correctly decltype inside invoke_result
1373  std::unique_ptr<int> u(new int(0));
1374  get_ptr(u);
1375  std::optional<int> oi = 0;
1376  return oi.value();
1377}
1378#else
1379int check_cxx17()
1380{
1381  return 0;
1382}
1383#endif
1384
1385class Class
1386{
1387public:
1388  int Get() const { return this->Member; }
1389private:
1390  int Member = 1;
1391};
1392int main()
1393{
1394  auto const c = std::unique_ptr<Class>(new Class);
1395  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
1396  return 0;
1397}
1398
1399------------------------------------------
1400error: invalid value 'gnu++1z' in '-std=gnu++1z'
1401Test failed to compile
1402Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std:c++17 ' works.
1403Try: /usr/bin/clang++
1404Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std:c++17  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
1405----------  file   -----------------------
1406
1407#include <iostream>
1408#include <memory>
1409#include <unordered_map>
1410
1411#if __cplusplus < 201103L
1412#error "Compiler is not in a mode aware of C++11."
1413#endif
1414
1415#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
1416#error "On AIX with GNU we need the -pthread flag."
1417#endif
1418
1419#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
1420#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
1421#endif
1422
1423#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
1424#error "On HP-UX we need GCC 4.9 or higher."
1425#endif
1426
1427#if __cplusplus > 201103L
1428#include <iterator>
1429int check_cxx14()
1430{
1431  int a[] = { 0, 1, 2 };
1432  auto ai = std::cbegin(a);
1433
1434  int b[] = { 2, 1, 0 };
1435  auto bi = std::cend(b);
1436
1437  return *ai + *(bi - 1);
1438}
1439#else
1440int check_cxx14()
1441{
1442  return 0;
1443}
1444#endif
1445
1446#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
1447#include <optional>
1448template <typename T,
1449          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
1450typename T::pointer get_ptr(T& item)
1451{
1452  return item.get();
1453}
1454
1455int check_cxx17()
1456{
1457  // Intel compiler do not handle correctly decltype inside invoke_result
1458  std::unique_ptr<int> u(new int(0));
1459  get_ptr(u);
1460  std::optional<int> oi = 0;
1461  return oi.value();
1462}
1463#else
1464int check_cxx17()
1465{
1466  return 0;
1467}
1468#endif
1469
1470class Class
1471{
1472public:
1473  int Get() const { return this->Member; }
1474private:
1475  int Member = 1;
1476};
1477int main()
1478{
1479  auto const c = std::unique_ptr<Class>(new Class);
1480  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
1481  return 0;
1482}
1483
1484------------------------------------------
1485clang: error: unknown argument: '-std:c++17'
1486Test failed to compile
1487Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std:c++latest ' works.
1488Try: /usr/bin/clang++
1489Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std:c++latest  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
1490----------  file   -----------------------
1491
1492#include <iostream>
1493#include <memory>
1494#include <unordered_map>
1495
1496#if __cplusplus < 201103L
1497#error "Compiler is not in a mode aware of C++11."
1498#endif
1499
1500#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
1501#error "On AIX with GNU we need the -pthread flag."
1502#endif
1503
1504#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
1505#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
1506#endif
1507
1508#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
1509#error "On HP-UX we need GCC 4.9 or higher."
1510#endif
1511
1512#if __cplusplus > 201103L
1513#include <iterator>
1514int check_cxx14()
1515{
1516  int a[] = { 0, 1, 2 };
1517  auto ai = std::cbegin(a);
1518
1519  int b[] = { 2, 1, 0 };
1520  auto bi = std::cend(b);
1521
1522  return *ai + *(bi - 1);
1523}
1524#else
1525int check_cxx14()
1526{
1527  return 0;
1528}
1529#endif
1530
1531#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
1532#include <optional>
1533template <typename T,
1534          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
1535typename T::pointer get_ptr(T& item)
1536{
1537  return item.get();
1538}
1539
1540int check_cxx17()
1541{
1542  // Intel compiler do not handle correctly decltype inside invoke_result
1543  std::unique_ptr<int> u(new int(0));
1544  get_ptr(u);
1545  std::optional<int> oi = 0;
1546  return oi.value();
1547}
1548#else
1549int check_cxx17()
1550{
1551  return 0;
1552}
1553#endif
1554
1555class Class
1556{
1557public:
1558  int Get() const { return this->Member; }
1559private:
1560  int Member = 1;
1561};
1562int main()
1563{
1564  auto const c = std::unique_ptr<Class>(new Class);
1565  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
1566  return 0;
1567}
1568
1569------------------------------------------
1570clang: error: unknown argument: '-std:c++latest'
1571Test failed to compile
1572Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation  ' works.
1573Try: /usr/bin/clang++
1574Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation   cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
1575----------  file   -----------------------
1576
1577#include <iostream>
1578#include <memory>
1579#include <unordered_map>
1580
1581#if __cplusplus < 201103L
1582#error "Compiler is not in a mode aware of C++11."
1583#endif
1584
1585#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
1586#error "On AIX with GNU we need the -pthread flag."
1587#endif
1588
1589#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
1590#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
1591#endif
1592
1593#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
1594#error "On HP-UX we need GCC 4.9 or higher."
1595#endif
1596
1597#if __cplusplus > 201103L
1598#include <iterator>
1599int check_cxx14()
1600{
1601  int a[] = { 0, 1, 2 };
1602  auto ai = std::cbegin(a);
1603
1604  int b[] = { 2, 1, 0 };
1605  auto bi = std::cend(b);
1606
1607  return *ai + *(bi - 1);
1608}
1609#else
1610int check_cxx14()
1611{
1612  return 0;
1613}
1614#endif
1615
1616#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
1617#include <optional>
1618template <typename T,
1619          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
1620typename T::pointer get_ptr(T& item)
1621{
1622  return item.get();
1623}
1624
1625int check_cxx17()
1626{
1627  // Intel compiler do not handle correctly decltype inside invoke_result
1628  std::unique_ptr<int> u(new int(0));
1629  get_ptr(u);
1630  std::optional<int> oi = 0;
1631  return oi.value();
1632}
1633#else
1634int check_cxx17()
1635{
1636  return 0;
1637}
1638#endif
1639
1640class Class
1641{
1642public:
1643  int Get() const { return this->Member; }
1644private:
1645  int Member = 1;
1646};
1647int main()
1648{
1649  auto const c = std::unique_ptr<Class>(new Class);
1650  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
1651  return 0;
1652}
1653
1654------------------------------------------
1655cmake_bootstrap_4359_test.cxx:7:2: error: "Compiler is not in a mode aware of C++11."
1656#error "Compiler is not in a mode aware of C++11."
1657 ^
1658cmake_bootstrap_4359_test.cxx:70:14: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]
1659  int Member = 1;
1660             ^
1661cmake_bootstrap_4359_test.cxx:74:3: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
1662  auto const c = std::unique_ptr<Class>(new Class);
1663  ^
16642 warnings and 1 error generated.
1665Test failed to compile
1666Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++14 ' works.
1667Try: /usr/bin/clang++
1668Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++14  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
1669----------  file   -----------------------
1670
1671#include <iostream>
1672#include <memory>
1673#include <unordered_map>
1674
1675#if __cplusplus < 201103L
1676#error "Compiler is not in a mode aware of C++11."
1677#endif
1678
1679#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
1680#error "On AIX with GNU we need the -pthread flag."
1681#endif
1682
1683#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
1684#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
1685#endif
1686
1687#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
1688#error "On HP-UX we need GCC 4.9 or higher."
1689#endif
1690
1691#if __cplusplus > 201103L
1692#include <iterator>
1693int check_cxx14()
1694{
1695  int a[] = { 0, 1, 2 };
1696  auto ai = std::cbegin(a);
1697
1698  int b[] = { 2, 1, 0 };
1699  auto bi = std::cend(b);
1700
1701  return *ai + *(bi - 1);
1702}
1703#else
1704int check_cxx14()
1705{
1706  return 0;
1707}
1708#endif
1709
1710#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
1711#include <optional>
1712template <typename T,
1713          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
1714typename T::pointer get_ptr(T& item)
1715{
1716  return item.get();
1717}
1718
1719int check_cxx17()
1720{
1721  // Intel compiler do not handle correctly decltype inside invoke_result
1722  std::unique_ptr<int> u(new int(0));
1723  get_ptr(u);
1724  std::optional<int> oi = 0;
1725  return oi.value();
1726}
1727#else
1728int check_cxx17()
1729{
1730  return 0;
1731}
1732#endif
1733
1734class Class
1735{
1736public:
1737  int Get() const { return this->Member; }
1738private:
1739  int Member = 1;
1740};
1741int main()
1742{
1743  auto const c = std::unique_ptr<Class>(new Class);
1744  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
1745  return 0;
1746}
1747
1748------------------------------------------
1749error: invalid value 'gnu++14' in '-std=gnu++14'
1750Test failed to compile
1751Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++1y ' works.
1752Try: /usr/bin/clang++
1753Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -std=gnu++1y  cmake_bootstrap_4359_test.cxx -o cmake_bootstrap_4359_test
1754----------  file   -----------------------
1755
1756#include <iostream>
1757#include <memory>
1758#include <unordered_map>
1759
1760#if __cplusplus < 201103L
1761#error "Compiler is not in a mode aware of C++11."
1762#endif
1763
1764#if defined(_AIX) && defined(__GNUC__) && !defined(_THREAD_SAFE)
1765#error "On AIX with GNU we need the -pthread flag."
1766#endif
1767
1768#if defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5140
1769#error "SunPro <= 5.13 mode not supported due to bug in move semantics."
1770#endif
1771
1772#if defined(__hpux) && !(defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 409)
1773#error "On HP-UX we need GCC 4.9 or higher."
1774#endif
1775
1776#if __cplusplus > 201103L
1777#include <iterator>
1778int check_cxx14()
1779{
1780  int a[] = { 0, 1, 2 };
1781  auto ai = std::cbegin(a);
1782
1783  int b[] = { 2, 1, 0 };
1784  auto bi = std::cend(b);
1785
1786  return *ai + *(bi - 1);
1787}
1788#else
1789int check_cxx14()
1790{
1791  return 0;
1792}
1793#endif
1794
1795#if (__cplusplus >= 201703L || defined(__INTEL_COMPILER) && defined(__cpp_deduction_guides))
1796#include <optional>
1797template <typename T,
1798          typename std::invoke_result<decltype(&T::get), T>::type = nullptr>
1799typename T::pointer get_ptr(T& item)
1800{
1801  return item.get();
1802}
1803
1804int check_cxx17()
1805{
1806  // Intel compiler do not handle correctly decltype inside invoke_result
1807  std::unique_ptr<int> u(new int(0));
1808  get_ptr(u);
1809  std::optional<int> oi = 0;
1810  return oi.value();
1811}
1812#else
1813int check_cxx17()
1814{
1815  return 0;
1816}
1817#endif
1818
1819class Class
1820{
1821public:
1822  int Get() const { return this->Member; }
1823private:
1824  int Member = 1;
1825};
1826int main()
1827{
1828  auto const c = std::unique_ptr<Class>(new Class);
1829  std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
1830  return 0;
1831}
1832
1833------------------------------------------
1834100
1835Test succeeded
1836Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -std=gnu++1y   -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation' supports 'make_unique'.
1837Try: /usr/bin/clang++
1838Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -std=gnu++1y   -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.21.2/Source/Checks/cm_cxx_make_unique.cxx -o cmake_bootstrap_4359_test
1839----------  file   -----------------------
1840#include <memory>
1841int main()
1842{
1843  std::unique_ptr<int> u = std::make_unique<int>(0);
1844  return *u;
1845}
1846------------------------------------------
1847Test succeeded
1848Checking whether '/usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -std=gnu++1y   -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation' supports 'filesystem'.
1849Try: /usr/bin/clang++
1850Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -std=gnu++1y   -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.21.2/Source/Checks/cm_cxx_filesystem.cxx -o cmake_bootstrap_4359_test
1851----------  file   -----------------------
1852
1853#include <filesystem>
1854
1855int main()
1856{
1857  std::filesystem::path p0(L"/a/b/c");
1858
1859  std::filesystem::path p1("/a/b/c");
1860  std::filesystem::path p2("/a/b/c");
1861  if (p1 != p2) {
1862    return 1;
1863  }
1864
1865#if defined(_WIN32)
1866  std::filesystem::path p3("//host/a/b/../c");
1867  if (p3.lexically_normal().generic_string() != "//host/a/c") {
1868    return 1;
1869  }
1870
1871  std::filesystem::path p4("c://a/.///b/../");
1872  if (p4.lexically_normal().generic_string() != "c:/a/") {
1873    return 1;
1874  }
1875#endif
1876
1877  return 0;
1878}
1879------------------------------------------
1880/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.21.2/Source/Checks/cm_cxx_filesystem.cxx:2:10: fatal error: 'filesystem' file not found
1881#include <filesystem>
1882         ^
18831 error generated.
1884Test failed to compile
1885Try: gmake
1886"/usr/bin/clang" -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -pipe -Os -arch x86_64   -o test test.c
18871
1888gmake works
1889Try: /usr/bin/clang++
1890Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -std=gnu++1y   -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -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.21.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_4359_test
1891----------  file   -----------------------
1892/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
1893   file Copyright.txt or https://cmake.org/licensing#kwsys for details.  */
1894
1895#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
1896#  include <sys/types.h>
1897
1898#  include <sys/stat.h>
1899#  include <unistd.h>
1900int main()
1901{
1902  struct stat stat1;
1903  (void)stat1.st_mtim.tv_sec;
1904  (void)stat1.st_mtim.tv_nsec;
1905  return 0;
1906}
1907#endif
1908
1909#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
1910#  include <sys/types.h>
1911
1912#  include <sys/stat.h>
1913#  include <unistd.h>
1914int main()
1915{
1916  struct stat stat1;
1917  (void)stat1.st_mtimespec.tv_sec;
1918  (void)stat1.st_mtimespec.tv_nsec;
1919  return 0;
1920}
1921#endif
1922
1923#ifdef TEST_KWSYS_CXX_HAS_SETENV
1924#  include <stdlib.h>
1925int main()
1926{
1927  return setenv("A", "B", 1);
1928}
1929#endif
1930
1931#ifdef TEST_KWSYS_CXX_HAS_UNSETENV
1932#  include <stdlib.h>
1933int main()
1934{
1935  unsetenv("A");
1936  return 0;
1937}
1938#endif
1939
1940#ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
1941#  include <stdlib.h>
1942int main()
1943{
1944  char* e = environ[0];
1945  return e ? 0 : 1;
1946}
1947#endif
1948
1949#ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
1950// Match feature definitions from SystemInformation.cxx
1951#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
1952#    define _GNU_SOURCE
1953#  endif
1954#  include <stdlib.h>
1955int main()
1956{
1957  double loadavg[3] = { 0.0, 0.0, 0.0 };
1958  return getloadavg(loadavg, 3);
1959}
1960#endif
1961
1962#ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
1963#  include <sys/resource.h>
1964int main()
1965{
1966  struct rlimit64 rlim;
1967  return getrlimit64(0, &rlim);
1968}
1969#endif
1970
1971#ifdef TEST_KWSYS_CXX_HAS_UTIMES
1972#  include <sys/time.h>
1973int main()
1974{
1975  struct timeval* current_time = 0;
1976  return utimes("/example", current_time);
1977}
1978#endif
1979
1980#ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
1981#  include <fcntl.h>
1982#  include <sys/stat.h>
1983#  if defined(__APPLE__)
1984#    include <AvailabilityMacros.h>
1985#    if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
1986#      error "utimensat not available on macOS < 10.13"
1987#    endif
1988#  endif
1989int main()
1990{
1991  struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
1992  return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
1993}
1994#endif
1995
1996#ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
1997#  if defined(__PATHSCALE__) || defined(__PATHCC__) ||                        \
1998    (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
1999backtrace does not work with this compiler or os
2000#  endif
2001#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2002#    define _GNU_SOURCE
2003#  endif
2004#  include <execinfo.h>
2005int main()
2006{
2007  void* stackSymbols[256];
2008  backtrace(stackSymbols, 256);
2009  backtrace_symbols(&stackSymbols[0], 1);
2010  return 0;
2011}
2012#endif
2013
2014#ifdef TEST_KWSYS_CXX_HAS_DLADDR
2015#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2016#    define _GNU_SOURCE
2017#  endif
2018#  include <dlfcn.h>
2019int main()
2020{
2021  Dl_info info;
2022  int ierr = dladdr((void*)main, &info);
2023  return 0;
2024}
2025#endif
2026
2027#ifdef TEST_KWSYS_CXX_HAS_CXXABI
2028#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2029#    define _GNU_SOURCE
2030#  endif
2031#  if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux &&             \
2032    __SUNPRO_CC_COMPAT == 'G'
2033#    include <iostream>
2034#  endif
2035#  include <cxxabi.h>
2036int main()
2037{
2038  int status = 0;
2039  size_t bufferLen = 512;
2040  char buffer[512] = { '\0' };
2041  const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
2042  char* demangledFunction =
2043    abi::__cxa_demangle(function, buffer, &bufferLen, &status);
2044  return status;
2045}
2046#endif
2047
2048#ifdef TEST_KWSYS_STL_HAS_WSTRING
2049#  include <string>
2050void f(std::wstring*)
2051{
2052}
2053int main()
2054{
2055  return 0;
2056}
2057#endif
2058
2059#ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
2060#  include <ext/stdio_filebuf.h>
2061int main()
2062{
2063  return 0;
2064}
2065#endif
2066------------------------------------------
2067Test succeeded
2068Try: /usr/bin/clang++
2069Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -std=gnu++1y   -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -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.21.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_4359_test
2070----------  file   -----------------------
2071/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2072   file Copyright.txt or https://cmake.org/licensing#kwsys for details.  */
2073
2074#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
2075#  include <sys/types.h>
2076
2077#  include <sys/stat.h>
2078#  include <unistd.h>
2079int main()
2080{
2081  struct stat stat1;
2082  (void)stat1.st_mtim.tv_sec;
2083  (void)stat1.st_mtim.tv_nsec;
2084  return 0;
2085}
2086#endif
2087
2088#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
2089#  include <sys/types.h>
2090
2091#  include <sys/stat.h>
2092#  include <unistd.h>
2093int main()
2094{
2095  struct stat stat1;
2096  (void)stat1.st_mtimespec.tv_sec;
2097  (void)stat1.st_mtimespec.tv_nsec;
2098  return 0;
2099}
2100#endif
2101
2102#ifdef TEST_KWSYS_CXX_HAS_SETENV
2103#  include <stdlib.h>
2104int main()
2105{
2106  return setenv("A", "B", 1);
2107}
2108#endif
2109
2110#ifdef TEST_KWSYS_CXX_HAS_UNSETENV
2111#  include <stdlib.h>
2112int main()
2113{
2114  unsetenv("A");
2115  return 0;
2116}
2117#endif
2118
2119#ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
2120#  include <stdlib.h>
2121int main()
2122{
2123  char* e = environ[0];
2124  return e ? 0 : 1;
2125}
2126#endif
2127
2128#ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
2129// Match feature definitions from SystemInformation.cxx
2130#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2131#    define _GNU_SOURCE
2132#  endif
2133#  include <stdlib.h>
2134int main()
2135{
2136  double loadavg[3] = { 0.0, 0.0, 0.0 };
2137  return getloadavg(loadavg, 3);
2138}
2139#endif
2140
2141#ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
2142#  include <sys/resource.h>
2143int main()
2144{
2145  struct rlimit64 rlim;
2146  return getrlimit64(0, &rlim);
2147}
2148#endif
2149
2150#ifdef TEST_KWSYS_CXX_HAS_UTIMES
2151#  include <sys/time.h>
2152int main()
2153{
2154  struct timeval* current_time = 0;
2155  return utimes("/example", current_time);
2156}
2157#endif
2158
2159#ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
2160#  include <fcntl.h>
2161#  include <sys/stat.h>
2162#  if defined(__APPLE__)
2163#    include <AvailabilityMacros.h>
2164#    if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
2165#      error "utimensat not available on macOS < 10.13"
2166#    endif
2167#  endif
2168int main()
2169{
2170  struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
2171  return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
2172}
2173#endif
2174
2175#ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
2176#  if defined(__PATHSCALE__) || defined(__PATHCC__) ||                        \
2177    (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
2178backtrace does not work with this compiler or os
2179#  endif
2180#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2181#    define _GNU_SOURCE
2182#  endif
2183#  include <execinfo.h>
2184int main()
2185{
2186  void* stackSymbols[256];
2187  backtrace(stackSymbols, 256);
2188  backtrace_symbols(&stackSymbols[0], 1);
2189  return 0;
2190}
2191#endif
2192
2193#ifdef TEST_KWSYS_CXX_HAS_DLADDR
2194#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2195#    define _GNU_SOURCE
2196#  endif
2197#  include <dlfcn.h>
2198int main()
2199{
2200  Dl_info info;
2201  int ierr = dladdr((void*)main, &info);
2202  return 0;
2203}
2204#endif
2205
2206#ifdef TEST_KWSYS_CXX_HAS_CXXABI
2207#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2208#    define _GNU_SOURCE
2209#  endif
2210#  if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux &&             \
2211    __SUNPRO_CC_COMPAT == 'G'
2212#    include <iostream>
2213#  endif
2214#  include <cxxabi.h>
2215int main()
2216{
2217  int status = 0;
2218  size_t bufferLen = 512;
2219  char buffer[512] = { '\0' };
2220  const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
2221  char* demangledFunction =
2222    abi::__cxa_demangle(function, buffer, &bufferLen, &status);
2223  return status;
2224}
2225#endif
2226
2227#ifdef TEST_KWSYS_STL_HAS_WSTRING
2228#  include <string>
2229void f(std::wstring*)
2230{
2231}
2232int main()
2233{
2234  return 0;
2235}
2236#endif
2237
2238#ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
2239#  include <ext/stdio_filebuf.h>
2240int main()
2241{
2242  return 0;
2243}
2244#endif
2245------------------------------------------
2246Test succeeded
2247Try: /usr/bin/clang++
2248Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -std=gnu++1y   -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -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.21.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_4359_test
2249----------  file   -----------------------
2250/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2251   file Copyright.txt or https://cmake.org/licensing#kwsys for details.  */
2252
2253#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
2254#  include <sys/types.h>
2255
2256#  include <sys/stat.h>
2257#  include <unistd.h>
2258int main()
2259{
2260  struct stat stat1;
2261  (void)stat1.st_mtim.tv_sec;
2262  (void)stat1.st_mtim.tv_nsec;
2263  return 0;
2264}
2265#endif
2266
2267#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
2268#  include <sys/types.h>
2269
2270#  include <sys/stat.h>
2271#  include <unistd.h>
2272int main()
2273{
2274  struct stat stat1;
2275  (void)stat1.st_mtimespec.tv_sec;
2276  (void)stat1.st_mtimespec.tv_nsec;
2277  return 0;
2278}
2279#endif
2280
2281#ifdef TEST_KWSYS_CXX_HAS_SETENV
2282#  include <stdlib.h>
2283int main()
2284{
2285  return setenv("A", "B", 1);
2286}
2287#endif
2288
2289#ifdef TEST_KWSYS_CXX_HAS_UNSETENV
2290#  include <stdlib.h>
2291int main()
2292{
2293  unsetenv("A");
2294  return 0;
2295}
2296#endif
2297
2298#ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
2299#  include <stdlib.h>
2300int main()
2301{
2302  char* e = environ[0];
2303  return e ? 0 : 1;
2304}
2305#endif
2306
2307#ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
2308// Match feature definitions from SystemInformation.cxx
2309#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2310#    define _GNU_SOURCE
2311#  endif
2312#  include <stdlib.h>
2313int main()
2314{
2315  double loadavg[3] = { 0.0, 0.0, 0.0 };
2316  return getloadavg(loadavg, 3);
2317}
2318#endif
2319
2320#ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
2321#  include <sys/resource.h>
2322int main()
2323{
2324  struct rlimit64 rlim;
2325  return getrlimit64(0, &rlim);
2326}
2327#endif
2328
2329#ifdef TEST_KWSYS_CXX_HAS_UTIMES
2330#  include <sys/time.h>
2331int main()
2332{
2333  struct timeval* current_time = 0;
2334  return utimes("/example", current_time);
2335}
2336#endif
2337
2338#ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
2339#  include <fcntl.h>
2340#  include <sys/stat.h>
2341#  if defined(__APPLE__)
2342#    include <AvailabilityMacros.h>
2343#    if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
2344#      error "utimensat not available on macOS < 10.13"
2345#    endif
2346#  endif
2347int main()
2348{
2349  struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
2350  return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
2351}
2352#endif
2353
2354#ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
2355#  if defined(__PATHSCALE__) || defined(__PATHCC__) ||                        \
2356    (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
2357backtrace does not work with this compiler or os
2358#  endif
2359#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2360#    define _GNU_SOURCE
2361#  endif
2362#  include <execinfo.h>
2363int main()
2364{
2365  void* stackSymbols[256];
2366  backtrace(stackSymbols, 256);
2367  backtrace_symbols(&stackSymbols[0], 1);
2368  return 0;
2369}
2370#endif
2371
2372#ifdef TEST_KWSYS_CXX_HAS_DLADDR
2373#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2374#    define _GNU_SOURCE
2375#  endif
2376#  include <dlfcn.h>
2377int main()
2378{
2379  Dl_info info;
2380  int ierr = dladdr((void*)main, &info);
2381  return 0;
2382}
2383#endif
2384
2385#ifdef TEST_KWSYS_CXX_HAS_CXXABI
2386#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2387#    define _GNU_SOURCE
2388#  endif
2389#  if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux &&             \
2390    __SUNPRO_CC_COMPAT == 'G'
2391#    include <iostream>
2392#  endif
2393#  include <cxxabi.h>
2394int main()
2395{
2396  int status = 0;
2397  size_t bufferLen = 512;
2398  char buffer[512] = { '\0' };
2399  const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
2400  char* demangledFunction =
2401    abi::__cxa_demangle(function, buffer, &bufferLen, &status);
2402  return status;
2403}
2404#endif
2405
2406#ifdef TEST_KWSYS_STL_HAS_WSTRING
2407#  include <string>
2408void f(std::wstring*)
2409{
2410}
2411int main()
2412{
2413  return 0;
2414}
2415#endif
2416
2417#ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
2418#  include <ext/stdio_filebuf.h>
2419int main()
2420{
2421  return 0;
2422}
2423#endif
2424------------------------------------------
2425/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.21.2/Source/kwsys/kwsysPlatformTestsCXX.cxx:53:13: error: use of undeclared identifier 'environ'
2426  char* e = environ[0];
2427            ^
24281 error generated.
2429Test failed to compile
2430Try: /usr/bin/clang++
2431Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -std=gnu++1y   -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -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.21.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_4359_test
2432----------  file   -----------------------
2433/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2434   file Copyright.txt or https://cmake.org/licensing#kwsys for details.  */
2435
2436#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
2437#  include <sys/types.h>
2438
2439#  include <sys/stat.h>
2440#  include <unistd.h>
2441int main()
2442{
2443  struct stat stat1;
2444  (void)stat1.st_mtim.tv_sec;
2445  (void)stat1.st_mtim.tv_nsec;
2446  return 0;
2447}
2448#endif
2449
2450#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
2451#  include <sys/types.h>
2452
2453#  include <sys/stat.h>
2454#  include <unistd.h>
2455int main()
2456{
2457  struct stat stat1;
2458  (void)stat1.st_mtimespec.tv_sec;
2459  (void)stat1.st_mtimespec.tv_nsec;
2460  return 0;
2461}
2462#endif
2463
2464#ifdef TEST_KWSYS_CXX_HAS_SETENV
2465#  include <stdlib.h>
2466int main()
2467{
2468  return setenv("A", "B", 1);
2469}
2470#endif
2471
2472#ifdef TEST_KWSYS_CXX_HAS_UNSETENV
2473#  include <stdlib.h>
2474int main()
2475{
2476  unsetenv("A");
2477  return 0;
2478}
2479#endif
2480
2481#ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
2482#  include <stdlib.h>
2483int main()
2484{
2485  char* e = environ[0];
2486  return e ? 0 : 1;
2487}
2488#endif
2489
2490#ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
2491// Match feature definitions from SystemInformation.cxx
2492#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2493#    define _GNU_SOURCE
2494#  endif
2495#  include <stdlib.h>
2496int main()
2497{
2498  double loadavg[3] = { 0.0, 0.0, 0.0 };
2499  return getloadavg(loadavg, 3);
2500}
2501#endif
2502
2503#ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
2504#  include <sys/resource.h>
2505int main()
2506{
2507  struct rlimit64 rlim;
2508  return getrlimit64(0, &rlim);
2509}
2510#endif
2511
2512#ifdef TEST_KWSYS_CXX_HAS_UTIMES
2513#  include <sys/time.h>
2514int main()
2515{
2516  struct timeval* current_time = 0;
2517  return utimes("/example", current_time);
2518}
2519#endif
2520
2521#ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
2522#  include <fcntl.h>
2523#  include <sys/stat.h>
2524#  if defined(__APPLE__)
2525#    include <AvailabilityMacros.h>
2526#    if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
2527#      error "utimensat not available on macOS < 10.13"
2528#    endif
2529#  endif
2530int main()
2531{
2532  struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
2533  return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
2534}
2535#endif
2536
2537#ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
2538#  if defined(__PATHSCALE__) || defined(__PATHCC__) ||                        \
2539    (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
2540backtrace does not work with this compiler or os
2541#  endif
2542#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2543#    define _GNU_SOURCE
2544#  endif
2545#  include <execinfo.h>
2546int main()
2547{
2548  void* stackSymbols[256];
2549  backtrace(stackSymbols, 256);
2550  backtrace_symbols(&stackSymbols[0], 1);
2551  return 0;
2552}
2553#endif
2554
2555#ifdef TEST_KWSYS_CXX_HAS_DLADDR
2556#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2557#    define _GNU_SOURCE
2558#  endif
2559#  include <dlfcn.h>
2560int main()
2561{
2562  Dl_info info;
2563  int ierr = dladdr((void*)main, &info);
2564  return 0;
2565}
2566#endif
2567
2568#ifdef TEST_KWSYS_CXX_HAS_CXXABI
2569#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2570#    define _GNU_SOURCE
2571#  endif
2572#  if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux &&             \
2573    __SUNPRO_CC_COMPAT == 'G'
2574#    include <iostream>
2575#  endif
2576#  include <cxxabi.h>
2577int main()
2578{
2579  int status = 0;
2580  size_t bufferLen = 512;
2581  char buffer[512] = { '\0' };
2582  const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
2583  char* demangledFunction =
2584    abi::__cxa_demangle(function, buffer, &bufferLen, &status);
2585  return status;
2586}
2587#endif
2588
2589#ifdef TEST_KWSYS_STL_HAS_WSTRING
2590#  include <string>
2591void f(std::wstring*)
2592{
2593}
2594int main()
2595{
2596  return 0;
2597}
2598#endif
2599
2600#ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
2601#  include <ext/stdio_filebuf.h>
2602int main()
2603{
2604  return 0;
2605}
2606#endif
2607------------------------------------------
2608Test succeeded
2609Try: /usr/bin/clang++
2610Line: /usr/bin/clang++ -pipe -Os -stdlib=libc++ -arch x86_64 -std=gnu++1y   -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -arch x86_64 -framework CoreFoundation -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.21.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_4359_test
2611----------  file   -----------------------
2612/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2613   file Copyright.txt or https://cmake.org/licensing#kwsys for details.  */
2614
2615#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIM
2616#  include <sys/types.h>
2617
2618#  include <sys/stat.h>
2619#  include <unistd.h>
2620int main()
2621{
2622  struct stat stat1;
2623  (void)stat1.st_mtim.tv_sec;
2624  (void)stat1.st_mtim.tv_nsec;
2625  return 0;
2626}
2627#endif
2628
2629#ifdef TEST_KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
2630#  include <sys/types.h>
2631
2632#  include <sys/stat.h>
2633#  include <unistd.h>
2634int main()
2635{
2636  struct stat stat1;
2637  (void)stat1.st_mtimespec.tv_sec;
2638  (void)stat1.st_mtimespec.tv_nsec;
2639  return 0;
2640}
2641#endif
2642
2643#ifdef TEST_KWSYS_CXX_HAS_SETENV
2644#  include <stdlib.h>
2645int main()
2646{
2647  return setenv("A", "B", 1);
2648}
2649#endif
2650
2651#ifdef TEST_KWSYS_CXX_HAS_UNSETENV
2652#  include <stdlib.h>
2653int main()
2654{
2655  unsetenv("A");
2656  return 0;
2657}
2658#endif
2659
2660#ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
2661#  include <stdlib.h>
2662int main()
2663{
2664  char* e = environ[0];
2665  return e ? 0 : 1;
2666}
2667#endif
2668
2669#ifdef TEST_KWSYS_CXX_HAS_GETLOADAVG
2670// Match feature definitions from SystemInformation.cxx
2671#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2672#    define _GNU_SOURCE
2673#  endif
2674#  include <stdlib.h>
2675int main()
2676{
2677  double loadavg[3] = { 0.0, 0.0, 0.0 };
2678  return getloadavg(loadavg, 3);
2679}
2680#endif
2681
2682#ifdef TEST_KWSYS_CXX_HAS_RLIMIT64
2683#  include <sys/resource.h>
2684int main()
2685{
2686  struct rlimit64 rlim;
2687  return getrlimit64(0, &rlim);
2688}
2689#endif
2690
2691#ifdef TEST_KWSYS_CXX_HAS_UTIMES
2692#  include <sys/time.h>
2693int main()
2694{
2695  struct timeval* current_time = 0;
2696  return utimes("/example", current_time);
2697}
2698#endif
2699
2700#ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT
2701#  include <fcntl.h>
2702#  include <sys/stat.h>
2703#  if defined(__APPLE__)
2704#    include <AvailabilityMacros.h>
2705#    if MAC_OS_X_VERSION_MIN_REQUIRED < 101300
2706#      error "utimensat not available on macOS < 10.13"
2707#    endif
2708#  endif
2709int main()
2710{
2711  struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
2712  return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW);
2713}
2714#endif
2715
2716#ifdef TEST_KWSYS_CXX_HAS_BACKTRACE
2717#  if defined(__PATHSCALE__) || defined(__PATHCC__) ||                        \
2718    (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41))
2719backtrace does not work with this compiler or os
2720#  endif
2721#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2722#    define _GNU_SOURCE
2723#  endif
2724#  include <execinfo.h>
2725int main()
2726{
2727  void* stackSymbols[256];
2728  backtrace(stackSymbols, 256);
2729  backtrace_symbols(&stackSymbols[0], 1);
2730  return 0;
2731}
2732#endif
2733
2734#ifdef TEST_KWSYS_CXX_HAS_DLADDR
2735#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2736#    define _GNU_SOURCE
2737#  endif
2738#  include <dlfcn.h>
2739int main()
2740{
2741  Dl_info info;
2742  int ierr = dladdr((void*)main, &info);
2743  return 0;
2744}
2745#endif
2746
2747#ifdef TEST_KWSYS_CXX_HAS_CXXABI
2748#  if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
2749#    define _GNU_SOURCE
2750#  endif
2751#  if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 && __linux &&             \
2752    __SUNPRO_CC_COMPAT == 'G'
2753#    include <iostream>
2754#  endif
2755#  include <cxxabi.h>
2756int main()
2757{
2758  int status = 0;
2759  size_t bufferLen = 512;
2760  char buffer[512] = { '\0' };
2761  const char* function = "_ZN5kwsys17SystemInformation15GetProgramStackEii";
2762  char* demangledFunction =
2763    abi::__cxa_demangle(function, buffer, &bufferLen, &status);
2764  return status;
2765}
2766#endif
2767
2768#ifdef TEST_KWSYS_STL_HAS_WSTRING
2769#  include <string>
2770void f(std::wstring*)
2771{
2772}
2773int main()
2774{
2775  return 0;
2776}
2777#endif
2778
2779#ifdef TEST_KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H
2780#  include <ext/stdio_filebuf.h>
2781int main()
2782{
2783  return 0;
2784}
2785#endif
2786------------------------------------------
2787/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.21.2/Source/kwsys/kwsysPlatformTestsCXX.cxx:169:12: fatal error: 'ext/stdio_filebuf.h' file not found
2788#  include <ext/stdio_filebuf.h>
2789           ^
27901 error generated.
2791Test failed to compile