This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Configure gets d_u32align wrong
[metaconfig.git] / U / perl / fpossize.U
1 ?RCS:
2 ?RCS: Copyright (c) 1999, Jarkko Hietaniemi
3 ?RCS: 
4 ?RCS: You may redistribute only under the terms of the Artistic Licence,
5 ?RCS: as specified in the README file that comes with the distribution.
6 ?RCS: You may reuse parts of this distribution only within the terms of
7 ?RCS: that same Artistic Licence; a copy of which may be found at the root
8 ?RCS: of the source tree for dist 3.0.
9 ?RCS:
10 ?MAKE:fpossize: Myread Typedef fpostype Compile longsize run i_stdlib
11 ?MAKE:  -pick add $@ %<
12 ?S:fpossize:
13 ?S:     This variable contains the size of a fpostype in bytes.
14 ?S:.
15 ?C:Fpos_t_size:
16 ?C:     This symbol holds the size of a Fpos_t in bytes.
17 ?C:.
18 ?H:#define Fpos_t_size $fpossize                /* FPOS size */
19 ?H:.
20 ?T:yyy zzz
21 ?LINT: set fpossize
22 echo " "
23 case "$fpostype" in
24 *_t) zzz="$fpostype"    ;;
25 *)   zzz="fpos_t"       ;;
26 esac
27 echo "Checking the size of $zzz..." >&4 
28 cat > try.c <<EOCP
29 #include <sys/types.h>
30 #include <stdio.h>
31 #$i_stdlib I_STDLIB
32 #ifdef I_STDLIB
33 #include <stdlib.h>
34 #endif
35 int main() {
36     printf("%d\n", (int)sizeof($fpostype));
37     exit(0);
38 }
39 EOCP
40 set try
41 if eval $compile_ok; then
42         yyy=`$run ./try`
43         case "$yyy" in
44         '')     fpossize=4
45                 echo "(I can't execute the test program--guessing $fpossize.)" >&4
46                 ;;
47         *)      fpossize=$yyy
48                 echo "Your $zzz is $fpossize bytes long."
49                 ;;
50         esac
51 else
52         dflt="$longsize"
53         echo " " >&4
54         echo "(I can't compile the test program.  Guessing...)" >&4
55         rp="What is the size of your file positions (in bytes)?"
56         . ./myread
57         fpossize="$ans"
58 fi
59