Commit | Line | Data |
---|---|---|
2cb64bf6 | 1 | ?RCS: Copyright (c) 2005-2007 H.Merijn Brand |
98232925 JH |
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: | |
2cb64bf6 | 6 | ?MAKE:d_cplusplus: Compile Setvar run cat rm_try |
98232925 JH |
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:. | |
0065f4af | 19 | ?F:!try |
98232925 | 20 | ?LINT:set d_cplusplus |
0065f4af | 21 | : Check if we are using C++ |
98232925 JH |
22 | echo " " |
23 | echo "Checking for C++..." >&4 | |
c6e816c7 | 24 | $cat >try.c <<'EOCP' |
98232925 JH |
25 | #include <stdio.h> |
26 | int main(void) | |
27 | { | |
28 | #ifdef __cplusplus | |
c6e816c7 | 29 | return 0; |
98232925 | 30 | #else |
c6e816c7 | 31 | return 1; |
98232925 | 32 | #endif |
98232925 JH |
33 | } |
34 | EOCP | |
35 | set try | |
c6e816c7 AD |
36 | if eval $compile_ok && $run ./try; then |
37 | val="$define" | |
98232925 JH |
38 | echo "You are using a C++ compiler." |
39 | else | |
40 | val="$undef" | |
41 | echo "You are not using a C++ compiler." | |
42 | fi | |
2cb64bf6 | 43 | $rm_try cplusplus$$ |
98232925 JH |
44 | set d_cplusplus |
45 | eval $setvar | |
46 |