This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add probe for __attribute__(always_inline)
[metaconfig.git] / dist / U / i_termio.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
4 ?RCS:
5 ?RCS: You may redistribute only under the terms of the Artistic License,
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 License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
10 ?RCS:
11 ?RCS: $Log: i_termio.U,v $
12 ?RCS: Revision 3.0.1.4  1994/10/29  16:20:54  ram
13 ?RCS: patch36: call ./usg and ./Cppsym explicitly instead of relying on PATH
14 ?RCS:
15 ?RCS: Revision 3.0.1.3  1994/08/29  16:26:38  ram
16 ?RCS: patch32: don't include all three I_* symbols in config.h
17 ?RCS: patch32: (had forgotten to undo this part last time)
18 ?RCS:
19 ?RCS: Revision 3.0.1.2  1994/05/13  15:25:03  ram
20 ?RCS: patch27: undone ADO's fix in previous patch since it was useless
21 ?RCS:
22 ?RCS: Revision 3.0.1.1  1994/05/06  15:05:23  ram
23 ?RCS: patch23: now include all three defines in config.h (ADO)
24 ?RCS:
25 ?RCS: Revision 3.0  1993/08/18  12:08:44  ram
26 ?RCS: Baseline for dist 3.0 netwide release.
27 ?RCS:
28 ?MAKE:i_termio i_sgtty i_termios: test Inlibc Cppsym Guess Setvar Findhdr Warn
29 ?MAKE:  -pick add $@ %<
30 ?S:i_termio:
31 ?S:     This variable conditionally defines the I_TERMIO symbol, which
32 ?S:     indicates to the C program that it should include <termio.h> rather
33 ?S:     than <sgtty.h>.
34 ?S:.
35 ?S:i_termios:
36 ?S:     This variable conditionally defines the I_TERMIOS symbol, which
37 ?S:     indicates to the C program that the POSIX <termios.h> file is
38 ?S:     to be included.
39 ?S:.
40 ?S:i_sgtty:
41 ?S:     This variable conditionally defines the I_SGTTY symbol, which
42 ?S:     indicates to the C program that it should include <sgtty.h> rather
43 ?S:     than <termio.h>.
44 ?S:.
45 ?C:I_TERMIO:
46 ?C:     This symbol, if defined, indicates that the program should include
47 ?C:     <termio.h> rather than <sgtty.h>.  There are also differences in
48 ?C:     the ioctl() calls that depend on the value of this symbol.
49 ?C:.
50 ?C:I_TERMIOS:
51 ?C:     This symbol, if defined, indicates that the program should include
52 ?C:     the POSIX termios.h rather than sgtty.h or termio.h.
53 ?C:     There are also differences in the ioctl() calls that depend on the
54 ?C:     value of this symbol.
55 ?C:.
56 ?C:I_SGTTY:
57 ?C:     This symbol, if defined, indicates that the program should include
58 ?C:     <sgtty.h> rather than <termio.h>.  There are also differences in
59 ?C:     the ioctl() calls that depend on the value of this symbol.
60 ?C:.
61 ?H:#$i_termio I_TERMIO          /**/
62 ?H:#$i_termios I_TERMIOS                /**/
63 ?H:#$i_sgtty I_SGTTY            /**/
64 ?H:.
65 ?T:val2 val3
66 ?LINT:set i_termio i_sgtty i_termios
67 : see if this is a termio system
68 val="$undef"
69 val2="$undef"
70 val3="$undef"
71 ?X: Prefer POSIX-approved termios.h over all else
72 if $test `./findhdr termios.h`; then
73         set tcsetattr i_termios
74         eval $inlibc
75         val3="$i_termios"
76 fi
77 echo " "
78 case "$val3" in
79 "$define") echo "You have POSIX termios.h... good!" >&4;;
80 *) if ./Cppsym pyr; then
81                 case "`/bin/universe`" in
82                 ucb) if $test `./findhdr sgtty.h`; then
83                                 val2="$define"
84                                 echo "<sgtty.h> found." >&4
85                         else
86                                 echo "System is pyramid with BSD universe."
87                                 ./warn "<sgtty.h> not found--you could have problems."
88                         fi;;
89                 *) if $test `./findhdr termio.h`; then
90                                 val="$define"
91                                 echo "<termio.h> found." >&4
92                         else
93                                 echo "System is pyramid with USG universe."
94                                 ./warn "<termio.h> not found--you could have problems."
95                         fi;;
96                 esac
97 ?X: Start with USG to avoid problems if both usg/bsd was guessed
98         elif ./usg; then
99                 if $test `./findhdr termio.h`; then
100                         echo "<termio.h> found." >&4
101                         val="$define"
102                 elif $test `./findhdr sgtty.h`; then
103                         echo "<sgtty.h> found." >&4
104                         val2="$define"
105                 else
106                         ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
107                 fi
108         else
109                 if $test `./findhdr sgtty.h`; then
110                         echo "<sgtty.h> found." >&4
111                         val2="$define"
112                 elif $test `./findhdr termio.h`; then
113                         echo "<termio.h> found." >&4
114                         val="$define"
115                 else
116                         ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
117                 fi
118         fi;;
119 esac
120 set i_termio; eval $setvar
121 val=$val2; set i_sgtty; eval $setvar
122 val=$val3; set i_termios; eval $setvar
123