This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
IRIX 64-bitness fixes.
[metaconfig.git] / U / modified / d_mmap.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 1999, Jarkko Hietaniemi
4 ?RCS: 
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
10 ?RCS:
11 ?MAKE:d_mmap mmaptype: Inlibc i_sysmman cat cc ccflags
12 ?MAKE:  -pick add $@ %<
13 ?S:d_mmap:
14 ?S:     This variable conditionally defines HAS_MMAP if mmap() is
15 ?S:     available to map a file into memory.
16 ?S:.
17 ?S:mmaptype:
18 ?S:     This symbol contains the type of pointer returned by mmap()
19 ?S:     (and simultaneously the type of the first argument).
20 ?S:     It can be 'void *' or 'caddr_t'.
21 ?S:.
22 ?C:HAS_MMAP:
23 ?C:     This symbol, if defined, indicates that the mmap system call is
24 ?C:     available to map a file into memory.
25 ?C:.
26 ?C:Mmap_t:
27 ?C:     This symbol holds the return type of the mmap() system call
28 ?C:     (and simultaneously the type of the first argument).
29 ?C:     Usually set to 'void *' or 'cadd_t'.
30 ?C:.
31 ?H:#$d_mmap HAS_MMAP            /**/
32 ?H:#define Mmap_t $mmaptype     /**/
33 ?H:.
34 ?LINT:set d_mmap
35 ?LINT:set mmaptype
36 : see if mmap exists
37 set mmap d_mmap
38 eval $inlibc
39 : see what shmat returns
40 : default to something harmless
41 mmaptype='void *'
42 case "$i_sysmman$d_mmap" in
43 "$define$define")
44         $cat >mmap.c <<'END'
45 #include <sys/mman.h>
46 void *mmap();
47 END
48         if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
49                 mmaptype='void *'
50         else
51                 mmaptype='caddr_t'
52         fi
53         echo "and it returns ($mmaptype)." >&4
54         ;;
55 esac
56
57
58