This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix .gitignore: only ignore 'perl' in root of repo, not U/perl subdir
[metaconfig.git] / U / perl / d_cplusplus.U
1 ?RCS: Copyright (c) 2005-2007 H.Merijn Brand
2 ?RCS:
3 ?RCS: You may distribute under the terms of either the GNU General Public
4 ?RCS: License or the Artistic License, as specified in the README file.
5 ?RCS:
6 ?MAKE:d_cplusplus: Compile Setvar run cat rm_try
7 ?MAKE:  -pick add $@ %<
8 ?S:d_cplusplus (d_cplusplus.U):
9 ?S:     This variable conditionally defines the USE_CPLUSPLUS symbol, which
10 ?S:     indicates that a C++ compiler was used to compiled Perl and will be
11 ?S:     used to compile extensions.
12 ?S:.
13 ?C:USE_CPLUSPLUS:
14 ?C:     This symbol, if defined, indicates that a C++ compiler was
15 ?C:     used to compiled Perl and will be used to compile extensions.
16 ?C:.
17 ?H:#$d_cplusplus USE_CPLUSPLUS          /**/
18 ?H:.
19 ?F:!try
20 ?LINT:set d_cplusplus
21 : Check if we are using C++
22 echo " "
23 echo "Checking for C++..." >&4
24 $cat >try.c <<'EOCP'
25 #include <stdio.h>
26 int main(void)
27 {
28 #ifdef __cplusplus
29     return 0;
30 #else
31     return 1;
32 #endif
33 }
34 EOCP
35 set try
36 if eval $compile_ok && $run ./try; then
37         val="$define"
38         echo "You are using a C++ compiler."
39 else
40         val="$undef"
41         echo "You are not using a C++ compiler."
42 fi
43 $rm_try cplusplus$$
44 set d_cplusplus
45 eval $setvar
46