This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Populate metaconfig branch.
[metaconfig.git] / dist-3.0at70b / mcon / U / d_SHM_MAC.U
1 ?RCS: $Id: d_SHM_MAC.U,v 3.0 1993/08/18 12:05:41 ram Exp $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
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 ?RCS: $Log: d_SHM_MAC.U,v $
12 ?RCS: Revision 3.0  1993/08/18  12:05:41  ram
13 ?RCS: Baseline for dist 3.0 netwide release.
14 ?RCS:
15 ?MAKE:d_SHM_MAC d_SHM_PRM d_SHM_SEG d_SHM_IMMU: cat d_shm test rm +cc +ccflags
16 ?MAKE:  -pick add $@ %<
17 ?S:d_SHM_MAC:
18 ?S:     Sometimes, the SHMLBA manifest needs sys/sysmacros.h, usually for
19 ?S:     the ctob() macro.
20 ?S:.
21 ?S:d_SHM_PRM:
22 ?S:     Sometimes, the SHMLBA manifest needs sys/param.h, usually for the
23 ?S:     NBPC constant.
24 ?S:.
25 ?S:d_SHM_SEG:
26 ?S:     Sometimes, the SHMLBA manifest needs sys/seg.h, usually for the
27 ?S:     SNUMSHFT constant.
28 ?S:.
29 ?S:d_SHM_IMMU:
30 ?S:     Sometimes, the SHMLBA manifest needs sys/immu.h, usually for the
31 ?S:     stob() macro.
32 ?S:.
33 ?C:SHMLBA_WANTS_SYSMACROS:
34 ?C:     This value tells us to include <sys/sysmacros.h> because SHMLBA
35 ?C:     needs something from there, probably the ctob() macro.
36 ?C:.
37 ?C:SHMLBA_WANTS_PARAM:
38 ?C:     This value tells us to include <sys/param.h> because SHMLBA needs
39 ?C:     something from there, probably the NBPC constant.
40 ?C:.
41 ?C:SHMLBA_WANTS_SEG:
42 ?C:     This value tells us to include <sys/seg.h> because SHMLBA needs
43 ?C:     something from there, probably the SNUMSHFT constant.
44 ?C:.
45 ?C:SHMLBA_WANTS_IMMU:
46 ?C:     This value tells us to include <sys/immu.h> because SHMLBA needs
47 ?C:     something from there, probably the stob() macro.  (tower_600 only?)
48 ?C:.
49 ?H:#$d_SHM_MAC  SHMLBA_WANTS_SYSMACROS  /* SHMLBA wants ctob()? */
50 ?H:#$d_SHM_PRM  SHMLBA_WANTS_PARAM      /* SHMLBA wants NBPC? */
51 ?H:#$d_SHM_SEG  SHMLBA_WANTS_SEG        /* SHMLBA wants SNUMSHFT? */
52 ?H:#$d_SHM_IMMU SHMLBA_WANTS_IMMU       /* SHMLBA wants stob()? */
53 ?H:.
54 ?T:flags D_sys_immu D_sys_seg D_sys_sysmacros D_sys_param
55 : check for SHMLBA braindamage
56 d_SHM_MAC="$undef"
57 d_SHM_PRM="$undef"
58 d_SHM_SEG="$undef"
59 d_SHM_IMMU="$undef"
60 if $test "$d_shm" = "$define" ; then
61         echo " "
62         $cat >&4 <<EOM
63 Checking to see if SHMLBA needs additional headers.
64 The headers I'll be checking are:
65
66     sys/macros.h (for the ctob() macro)
67     sys/param.h  (for NBPC)
68     sys/seg.h    (for SNUMSHFT)
69     sys/immu.h   (for the stob() macro)
70
71 EOM
72         $cat >shm_mac.c <<'EOCP'
73 #include <sys/types.h>
74 #include <sys/ipc.h>
75 #include <sys/shm.h>
76 #ifdef I_SYS_IMMU
77 #include <sys/immu.h>
78 #endif
79 #ifdef I_SYS_SYSMACROS
80 #include <sys/sysmacros.h>
81 #endif
82 #ifdef I_SYS_PARAM
83 #include <sys/param.h>
84 #endif
85 #ifdef I_SYS_SEG
86 #include <sys/seg.h>
87 #endif
88
89 main() {
90         int foo = SHMLBA ;
91         }
92 EOCP
93         flags='xxx'
94         for D_sys_immu in '' '-DI_SYS_IMMU'; do
95         for D_sys_seg in '' '-DI_SYS_SEG'; do
96         for D_sys_sysmacros in '' '-DI_SYS_SYSMACROS'; do
97         for D_sys_param in '' '-DI_SYS_PARAM'; do
98                 case "$flags" in
99                 'xxx')
100                         case "$D_sys_immu$D_sys_param$D_sys_sysmacros$D_sys_seg" in
101                         '')
102                                 echo "Trying it normally..."
103                                 ;;
104                         *)
105                         echo "Trying $D_sys_immu $D_sys_param $D_sys_sysmacros $D_sys_seg"
106                         ;;
107                         esac
108                         if $cc $ccflags \
109                         $D_sys_immu $D_sys_param $D_sys_sysmacros $D_sys_seg \
110                         -o shm_mac shm_mac.c >/dev/null 2>&1 ; then
111                                 set X $D_sys_immu $D_sys_param $D_sys_sysmacros $D_sys_seg
112                                 shift
113                                 flags="$*"
114                                 echo "Succeeded with $flags"
115                         fi
116                         ;;
117                 esac
118         done
119         done
120         done
121         done
122         case "$flags" in
123         xxx)
124                 echo "I don't know how to keep SHMLBA happy.  Good luck!"
125                 ;;
126         esac
127         case "$flags" in
128         *I_SYS_PARAM*) d_SHM_PRM="$define";;
129         esac
130         case "$flags" in
131         *I_SYS_SYSMACROS*) d_SHM_MAC="$define";;
132         esac
133         case "$flags" in
134         *I_SYS_SEG*) d_SHM_SEG="$define";;
135         esac
136         case "$flags" in
137         *I_SYS_IMMU*) d_SHM_IMMU="$define";;
138         esac
139 fi
140 $rm -f shm_mac*
141