This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Configure fixfest continues.
[metaconfig.git] / U / modified / d_longlong.U
CommitLineData
959f3c4c
JH
1?RCS: $Id: d_longlong.U,v $
2?RCS:
3?RCS: Copyright (c) 1998 Andy Dougherty
4?RCS:
5?RCS: You may distribute under the terms of either the GNU General Public
6?RCS: License or the Artistic License, as specified in the README file.
7?RCS:
8?RCS: $Log: d_longlong.U,v $
9?RCS:
10?MAKE:d_longlong longlongsize: Compile Setvar Myread +cc +ccflags +optimize \
11 echo n c cat rm test longsize
12?MAKE: -pick add $@ %<
13?S:d_longlong:
14?S: This variable conditionally defines HAS_LONG_LONG if
15?S: the long long type is supported.
16?S:.
17?S:longlongsize:
18?S: This variable contains the value of the LONGLONGSIZE symbol, which
19?S: indicates to the C program how many bytes there are in a long long,
20?S: if this system supports long long.
21?S:.
22?C:HAS_LONG_LONG:
23?C: This symbol will be defined if the C compiler supports long long.
24?C:.
25?C:LONGLONGSIZE:
26?C: This symbol contains the size of a long long, so that the
27?C: C preprocessor can make decisions based on it. It is only
28?C: defined if the system supports long long.
29?C:.
30?H:#$d_longlong HAS_LONG_LONG /**/
31?H:?LONGLONGSIZE:#ifdef HAS_LONG_LONG
32?H:?LONGLONGSIZE:#define LONGLONGSIZE $longlongsize /**/
33?H:?LONGLONGSIZE:#endif
34?H:.
35?LINT:set d_longlong
36?F:!try
37: check for long long
38echo " "
384e0155 39$echo $n "Checking to see if your system supports long long...$c" >&4
959f3c4c
JH
40echo 'long long foo() { long long x; x = 7; return x; }' > try.c
41if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
42 val="$define"
43 echo " Yup, it does." >&4
44else
45 val="$undef"
46 echo " Nope, it doesn't." >&4
47fi
48$rm try.*
49set d_longlong
50eval $setvar
51
52@if LONGLONGSIZE || longlongsize
53: check for length of long long
54?X: Check only if d_longlong and if longlongsize is not already set.
55case "${d_longlong}${longlongsize}" in
56$define)
57 echo " "
58 $echo $n "Checking to see how big your long longs are...$c" >&4
59 $cat >try.c <<'EOCP'
60#include <stdio.h>
61int main()
62{
63 printf("%d\n", sizeof(long long));
64}
65EOCP
66 set try
67 if eval $compile_ok; then
68 longlongsize=`./try`
69 $echo " $longlongsize bytes." >&4
70 else
71 dflt='8'
72 echo " "
73 echo "(I can't seem to compile the test program. Guessing...)"
74 rp="What is the size of a long long (in bytes)?"
75 . ./myread
76 longlongsize="$ans"
77 fi
78 if $test "X$longsize" = "X$longlongsize"; then
79 echo "(That isn't any different from an ordinary long.)"
80 fi
81 ;;
82esac
83$rm -f try.c try
84@end
85